2009/05/20 - Apache Shale has been retired.

For more information, please explore the Attic.

View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to you under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  
18  /*
19   * $Id: Globals.java 473102 2006-11-09 22:26:21Z gvanmatre $
20   */
21  package org.apache.shale.clay.config;
22  
23  /***
24   * <p>A {@link Globals} contains static constants used throughout the clay
25   * plug-in.
26   * </p>
27   */
28  public class Globals {
29  
30      /***
31       *<p>EL properties will replaced the literal value of this constant with the
32       * mapped ViewController bean before the expression is evaluated.
33       *</p>
34       */
35      public static final String MANAGED_BEAN_MNEMONIC = "@managed-bean-name";
36  
37      /***
38       *<p>Name of the initialization param in the web deployment descriptor
39       * containing additional registered config files.  The list of files
40       * should be comma delimited and the path relative to the context root.
41       * <br/>
42       * The configuration files should conform to the clay-config_x_x.dtd
43       *</p>
44       * @deprecated use CLAY_COMMON_CONFIG_FILES
45       */
46      public static final String CLAY_CONFIG_FILES = "clay-config-files";
47  
48      /***
49       *<p>Name of the initialization parameter in the web deployment descriptor
50       *containing additional registered configuration files.  These files represent
51       *common component definitions that are not full view XML templates.   Common
52       *component definitions should have jsfid's that don't have a ".xml" or
53       *".html" suffix.  The list of files should be comma delimited and the path
54       *relative to the context root.
55       *<br>
56       *The configuration files should conform to the clay-config_x_x.dtd.
57       *</p>
58       */
59      public static final String CLAY_COMMON_CONFIG_FILES = "org.apache.shale.clay.COMMON_CONFIG_FILES";
60  
61      /***
62       *<p>Name of the initialization parameter in the web deployment descriptor
63       *containing additional registered configuration files.  These files represent
64       *common component definitions that are full view XML templates.
65       *The list of files should be comma delimited and the path relative to the context root.
66       *<br/>
67       *The configuration files should conform to the clay-config_x_x.dtd.
68       *</p>
69       */
70      public static final String CLAY_FULLXML_CONFIG_FILES = "org.apache.shale.clay.FULLXML_CONFIG_FILES";
71  
72      /***
73       * <p>The name of the initialization parameter defined in the
74       * web deployment descriptor that's value will define a suffix
75       * identifier used by the {@link org.apache.shale.clay.config.beans.TemplateConfigBean}.
76       * This suffix identifies a jsfid that uses HTML to define page composition.
77       * </p>
78       */
79      public static final String CLAY_HTML_TEMPLATE_SUFFIX = "org.apache.shale.clay.HTML_TEMPLATE_SUFFIX";
80  
81      /***
82       * <p>The name of the initialization parameter defined in the
83       * web deployment descriptor that's value will define a suffix
84       * identifier used by the {@link org.apache.shale.clay.config.beans.TemplateComponentConfigBean}.
85       * This suffix identifies a jsfid that uses full XML views to define page composition.
86       * </p>
87       */
88      public static final String CLAY_XML_TEMPLATE_SUFFIX = "org.apache.shale.clay.XML_TEMPLATE_SUFFIX";
89  
90      /***
91       * <p>The name of the initialization parameter defined in the
92       * web deployment descriptor that's value will determine if the
93       * configuration files defined by <code>CLAY_CONFIG_FILES</code>
94       * will be watched for changes.  The default value is <code>true</code>
95       * meaning that the config files will be automatically reloaded if
96       * a change occures.
97       * </p>
98       */
99      public static final String AUTO_RELOAD_CLAY_FILES = "org.apache.shale.clay.AUTO_RELOAD_CONFIG_FILES";
100 
101     /***
102      * <p>The default full html view template suffix identifier if one is not specified.
103      * Override using the CLAY_HTML_TEMPLATE_SUFFIX web init param parameter.</p>
104      */
105     public static final String CLAY_DEFAULT_HTML_TEMPLATE_SUFFIX = ".html";
106 
107     /***
108      * <p>The default full XML template view suffix identifier if one is not specified.
109      * Override using the CLAY_HTML_TEMPLATE_SUFFIX web init param parameter.</p>
110      */
111 
112     public static final String CLAY_DEFAULT_XML_TEMPLATE_SUFFIX = ".xml";
113 
114     /***
115      * <p>Configuration file prefix, "classpath*:", denotes that the resource
116      * should be loaded from the class path versus the context root.</p>
117      */
118     public static final String CLASSPATH_PREFIX = "classpath*:";
119 
120     /***
121      * <p>The name of the initializtion parameter in the web deployment descriptor that
122      * defines the default charset for all html templates.  If not specified, the
123      * "<code>file.encoding</code>" system parameter is the default.  The charset can
124      * be overridden for each template file using a special comment directive,
125      * <code>"&lt;!-- ### clay:page charset="UTF-8" /### --&gt;"</code>.</p>
126      */
127     public static final String CLAY_HTML_CHARSET = "org.apache.shale.clay.HTML_TEMPLATE_CHARSET";
128 
129     /***
130      * <p>The default subview configuration file containing the base supported
131      * components.
132      *</p>
133      */
134     public static final String DEFAULT_CLAY_CONFIG_FILE = CLASSPATH_PREFIX + "META-INF/clay-config.xml";
135 
136     /***
137      * <p>The literal string used to identify that a clay subtree should be
138      * built at runtime.  This value "RUNTIME" will be placed in the jsfid
139      * attribute.  The subtree construction should be build by providing implementation
140      * for the "shapeValidator" component event.
141      * </p>
142      */
143     public static final String RUNTIME_ELEMENT_ID = "RUNTIME";
144 
145     /***
146      * <p>The default catalog name used to configure the chain
147      * workflow for building the clay subtree from a object
148      * graph of metadata.
149      *</p>
150      */
151     public static final String CLAY_CATALOG_NAME = "clay";
152 
153     /***
154      * <p>The customization catalog name used to configure the chain
155      * workflow for building the clay subtree from a object
156      * graph of metadata.
157      *</p>
158      */
159     public static final String CLAY_CUSTOMIZATION_CATALOG_NAME = "clayCustomization";
160 
161     /***
162      * <p>Chain subchain command invoked by the {@link org.apache.shale.clay.component.chain.AssignPropertiesCommand}
163      * to assign the attributes to the components.  There are five subcommands
164      * under this chain that handle the associated attributes.
165      * </p>
166      */
167     public static final String SET_ATTRIBUTE_COMMAND_NAME = "setAttribute";
168 
169     /***
170      * <p>The command name used to add a component.  There are several subchains
171      * that will be invoked.  This command is invoked recursively  for each child
172      * component.
173      * </p>
174      */
175     public static final String ADD_COMPONENT_COMMAND_NAME = "addComponent";
176 
177     /***
178      * <p>This command is invoked to add a converter to a component implementing
179      * the {@link javax.faces.component.ValueHolder} interface.
180      * </p>
181      */
182     public static final String ADD_CONVERTER_COMMAND_NAME = "addConverter";
183 
184     /***
185      * <p>This command is invoked to add a validator to a component
186      * implementing the {@link javax.faces.component.EditableValueHolder}
187      * interface.</p>
188      */
189     public static final String ADD_VALIDATOR_COMMAND_NAME = "addValidator";
190 
191     /***
192      * <p>This command is invoked to add a valueChangeListener to a component that
193      * implements the {@link javax.faces.component.EditableValueHolder} interface.</p>
194      */
195     public static final String ADD_VALUE_CHANGE_LISTENER_COMMAND_NAME = "addValueChangeListener";
196 
197     /***
198      * <p>This command is invoked to add a actionListener to a component that
199      * implements the {@link javax.faces.component.ActionSource} interface.
200      *</p>
201      */
202     public static final String ADD_ACTION_LISTENER_COMMAND_NAME = "addActionListener";
203 
204     /***
205      * <p>The catalog name used by {@link org.apache.shale.clay.parser.builder.BuilderFactory}
206      *  to define the rules that map an HTML element to a {@link org.apache.shale.clay.parser.builder.Builder}.
207      *  </p>
208      */
209     public static final String BUILDER_CATALOG_NAME = "builder";
210 
211     /***
212      * <p> Command name in the BUILDER_CATALOG_NAME used to invoke a command
213      * chain of rule commands that locates a {@link org.apache.shale.clay.parser.builder.Builder}
214      * for the default namespace.
215      * </p>
216      */
217     public static final String FIND_DEFAULT_BUILDER_COMMAND_NAME = "default-namespace";
218 
219     /***
220      * <p> Command name in the BUILDER_CATALOG_NAME used to invoke a command
221      * chain of rule commands that locates a {@link org.apache.shale.clay.parser.builder.Builder}
222      * for a unknown namespace.
223      * </p>
224      */
225     public static final String FIND_UNKNOWN_BUILDER_COMMAND_NAME = "unknown-namespace";
226 
227     /***
228      * <p>The config file used by {@link org.apache.shale.clay.component.Clay} component to
229      * load the ADD_COMPONENT_COMMAND_NAME from the CLAY_CATALOG_NAME.
230      * </p>
231      */
232     public static final String CLAY_RESOURCE_NAME = "org/apache/shale/clay/component/chain/shale-clay-config.xml";
233 
234     /***
235      * <p> The config file used by the {@link org.apache.shale.clay.parser.builder.BuilderFactory}
236      * to assemble the rule finder chain.
237      * </p>
238      */
239     public static final String BUILDER_RESOURCE_NAME =
240         "org/apache/shale/clay/parser/builder/chain/shale-builder-config.xml";
241 
242     /***
243      * <p>The Map key used by the {@link org.apache.shale.clay.config.beans.ComponentConfigBean} to identify the
244      * {@link org.apache.shale.clay.config.beans.ComponentConfigBean$WatchDog}
245      * for the XML configuration files.</p>
246      */
247     public static final String DEFAULT_COMPONENT_CONFIG_WATCHDOG = "ComponentConfigBean$WatchDog";
248 
249     /***
250      * <p>The key value used to cache the original view suffix in request scope for full clay views.</p>
251      */
252     public static final String CLAY_FULL_VIEW_SUFFIX = "org.apache.shale.clay.suffix";
253 
254     /***
255      * <p>The key value used as a reqest scope indicator to determine a view has been restored.</p>
256      */
257     public static final String CLAY_FULL_VIEW_RESTORE_IND = "org.apache.shale.clay.forward";
258 
259     /***
260      * <p>The clay component attribute name that will capture the ComponentBean representing the root
261      * of the subtree.  The root is capture for enhanced error reporting.</p>
262      */
263     public static final String CLAY_RESERVED_ATTRIBUTE = "org.apache.shale.clay";
264 
265     /***
266      * <p>The request scope key that will be populated with the unknow namespace when parsing an
267      * HTML document.  Custom builders can be registed by the namespace uri by the commons chains.
268      * <br/><br/>For example:<br/>
269      * &lt;catalog name="clayCustomization" &gt;<br/>
270      * &nbsp;&lt;chain name="http://www.acme.com/jsf/mywidgets"&gt;<br/>
271      * &nbsp;&nbsp;&lt;command  className="org.apache.shale.clay.parser.builder.chain.JsfDefaultBuilderRule"
272      *  prefix="w"/&gt;<br/>
273      * &nbsp;&lt;/chain&gt;<br/>
274      *
275      */
276     public static final String CLAY_CUSTOM_BUILDER_XMLNS = "XMLNS";
277 
278     /***
279      * <p>The key value used to store clay's version of the <code>jspid</code>.
280      * This custom id is added to the <code>UIComponent</code>'s attributes
281      * map.</p>
282      */
283     public static final String CLAY_JSPID_ATTRIBUTE = "org.apache.shale.clay.jspid";
284 }
285