You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tiles.apache.org by ap...@apache.org on 2007/03/23 10:12:37 UTC
svn commit: r521636 [2/2] - in /tiles/framework/trunk:
tiles-api/src/main/java/org/apache/tiles/
tiles-api/src/main/java/org/apache/tiles/mgmt/
tiles-api/src/main/java/org/apache/tiles/web/
tiles-core/src/main/java/org/apache/tiles/ tiles-core/src/main...
Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/BasicTilesContainer.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/BasicTilesContainer.java?view=diff&rev=521636&r1=521635&r2=521636
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/BasicTilesContainer.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/BasicTilesContainer.java Fri Mar 23 02:12:34 2007
@@ -23,15 +23,15 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.tiles.ComponentAttribute;
-import org.apache.tiles.ComponentContext;
+import org.apache.tiles.Attribute;
+import org.apache.tiles.AttributeContext;
import org.apache.tiles.TilesApplicationContext;
import org.apache.tiles.TilesContainer;
import org.apache.tiles.TilesException;
-import org.apache.tiles.context.BasicComponentContext;
+import org.apache.tiles.context.BasicAttributeContext;
import org.apache.tiles.context.TilesContextFactory;
import org.apache.tiles.context.TilesRequestContext;
-import org.apache.tiles.definition.ComponentDefinition;
+import org.apache.tiles.definition.Definition;
import org.apache.tiles.definition.DefinitionsFactory;
import org.apache.tiles.definition.DefinitionsFactoryException;
import org.apache.tiles.definition.NoSuchDefinitionException;
@@ -124,7 +124,7 @@
}
/** {@inheritDoc} */
- public ComponentContext startContext(Object... requestItems) {
+ public AttributeContext startContext(Object... requestItems) {
TilesRequestContext tilesContext = getRequestContext(requestItems);
return startContext(tilesContext);
}
@@ -136,24 +136,24 @@
}
/**
- * Starts a component context inside the container.
+ * Starts an attribute context inside the container.
*
* @param tilesContext The request context to use.
- * @return The newly created component context.
+ * @return The newly created attribute context.
*/
- private ComponentContext startContext(TilesRequestContext tilesContext) {
- ComponentContext context = new BasicComponentContext();
- BasicComponentContext.pushContext(context, tilesContext);
+ private AttributeContext startContext(TilesRequestContext tilesContext) {
+ AttributeContext context = new BasicAttributeContext();
+ BasicAttributeContext.pushContext(context, tilesContext);
return context;
}
/**
- * Releases and removes a previously created component context.
+ * Releases and removes a previously created attribute context.
*
* @param tilesContext The request context to use.
*/
private void endContext(TilesRequestContext tilesContext) {
- BasicComponentContext.popContext(tilesContext);
+ BasicAttributeContext.popContext(tilesContext);
}
/**
@@ -225,23 +225,23 @@
}
/** {@inheritDoc} */
- public ComponentContext getComponentContext(Object... requestItems) {
+ public AttributeContext getAttributeContext(Object... requestItems) {
TilesRequestContext tilesContext = getRequestContext(requestItems);
- return getComponentContext(tilesContext);
+ return getAttributeContext(tilesContext);
}
/**
- * Returns the current component context.
+ * Returns the current attribute context.
*
* @param tilesContext The request context to use.
- * @return The current component context.
+ * @return The current attribute context.
*/
- private ComponentContext getComponentContext(TilesRequestContext tilesContext) {
- ComponentContext context = BasicComponentContext.getContext(tilesContext);
+ private AttributeContext getAttributeContext(TilesRequestContext tilesContext) {
+ AttributeContext context = BasicAttributeContext.getContext(tilesContext);
if (context == null) {
- context = new BasicComponentContext();
- BasicComponentContext.pushContext(context, tilesContext);
+ context = new BasicAttributeContext();
+ BasicAttributeContext.pushContext(context, tilesContext);
}
return context;
}
@@ -354,11 +354,11 @@
throw new NoSuchPreparerException("Preparer '" + preparerName + " not found");
}
- ComponentContext componentContext = BasicComponentContext.getContext(context);
+ AttributeContext attributeContext = BasicAttributeContext.getContext(context);
// TODO: Temporary while preparerInstance gets refactored to throw a more specific exception.
try {
- preparer.execute(context, componentContext);
+ preparer.execute(context, attributeContext);
} catch (Exception e) {
throw new PreparerException(e.getMessage(), e);
}
@@ -388,7 +388,7 @@
LOG.debug("Render request recieved for definition '" + definitionName + "'");
}
- ComponentDefinition definition = getDefinition(definitionName, request);
+ Definition definition = getDefinition(definitionName, request);
if (definition == null) {
if (LOG.isWarnEnabled()) {
@@ -404,10 +404,10 @@
return;
}
- ComponentContext originalContext = getComponentContext(request);
- BasicComponentContext subContext = new BasicComponentContext(originalContext);
+ AttributeContext originalContext = getAttributeContext(request);
+ BasicAttributeContext subContext = new BasicAttributeContext(originalContext);
subContext.addMissing(definition.getAttributes());
- BasicComponentContext.pushContext(subContext, request);
+ BasicAttributeContext.pushContext(subContext, request);
try {
if (definition.getPreparer() != null) {
@@ -430,14 +430,14 @@
// TODO it would be nice to make the preparerInstance throw a more specific
throw new TilesException(e.getMessage(), e);
} finally {
- BasicComponentContext.popContext(request);
+ BasicAttributeContext.popContext(request);
}
}
/** {@inheritDoc} */
- public void render(ComponentAttribute attr, Writer writer, Object... requestItems)
+ public void render(Attribute attr, Writer writer, Object... requestItems)
throws TilesException, IOException {
- ComponentContext context = getComponentContext(requestItems);
+ AttributeContext context = getAttributeContext(requestItems);
TilesRequestContext request = getRequestContext(requestItems);
String type = calculateType(attr, request);
@@ -447,9 +447,9 @@
}
- Map<String, ComponentAttribute> attrs = attr.getAttributes();
+ Map<String, Attribute> attrs = attr.getAttributes();
if (attrs != null) {
- for (Map.Entry<String, ComponentAttribute> a : attrs.entrySet()) {
+ for (Map.Entry<String, Attribute> a : attrs.entrySet()) {
context.putAttribute(a.getKey(), a.getValue());
}
}
@@ -468,8 +468,8 @@
* @param requestItems The request items.
* @return <code>true</code> if the attribute is a definition.
*/
- private boolean isDefinition(ComponentAttribute attr, Object... requestItems) {
- return ComponentAttribute.DEFINITION.equals(attr.getType()) ||
+ private boolean isDefinition(Attribute attr, Object... requestItems) {
+ return Attribute.DEFINITION.equals(attr.getType()) ||
isValidDefinition(attr.getValue().toString(), requestItems);
}
@@ -481,7 +481,7 @@
* @return The calculated attribute type.
* @throws TilesException If the type is not recognized.
*/
- private String calculateType(ComponentAttribute attr,
+ private String calculateType(Attribute attr,
TilesRequestContext request) throws TilesException {
String type = attr.getType();
if (type == null) {
@@ -489,11 +489,11 @@
if (valueContent instanceof String) {
String valueString = (String) valueContent;
if (isValidDefinition(request, valueString)) {
- type = ComponentAttribute.DEFINITION;
+ type = Attribute.DEFINITION;
} else if (valueString.startsWith("/")) {
- type = ComponentAttribute.TEMPLATE;
+ type = Attribute.TEMPLATE;
} else {
- type = ComponentAttribute.STRING;
+ type = Attribute.STRING;
}
}
if (type == null) {
@@ -513,8 +513,8 @@
* @throws DefinitionsFactoryException If the definitions factory throws an
* exception.
*/
- protected ComponentDefinition getDefinition(String definitionName, TilesRequestContext request) throws DefinitionsFactoryException {
- ComponentDefinition definition =
+ protected Definition getDefinition(String definitionName, TilesRequestContext request) throws DefinitionsFactoryException {
+ Definition definition =
definitionsFactory.getDefinition(definitionName, request);
return definition;
}
@@ -604,7 +604,7 @@
*/
private boolean isValidDefinition(TilesRequestContext context, String definitionName) {
try {
- ComponentDefinition definition = getDefinition(definitionName, context);
+ Definition definition = getDefinition(definitionName, context);
return definition != null;
}
catch (NoSuchDefinitionException nsde) {
Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/KeyedDefinitionsFactoryTilesContainer.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/KeyedDefinitionsFactoryTilesContainer.java?view=diff&rev=521636&r1=521635&r2=521636
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/KeyedDefinitionsFactoryTilesContainer.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/KeyedDefinitionsFactoryTilesContainer.java Fri Mar 23 02:12:34 2007
@@ -27,7 +27,7 @@
import org.apache.tiles.TilesException;
import org.apache.tiles.context.TilesRequestContext;
-import org.apache.tiles.definition.ComponentDefinition;
+import org.apache.tiles.definition.Definition;
import org.apache.tiles.definition.DefinitionsFactory;
import org.apache.tiles.definition.DefinitionsFactoryException;
@@ -173,9 +173,9 @@
/** {@inheritDoc} */
@Override
- protected ComponentDefinition getDefinition(String definitionName,
+ protected Definition getDefinition(String definitionName,
TilesRequestContext request) throws DefinitionsFactoryException {
- ComponentDefinition retValue = null;
+ Definition retValue = null;
String key = getDefinitionsFactoryKey(request);
if (key != null) {
DefinitionsFactory definitionsFactory =
Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/mgmt/CachingKeyedDefinitionsFactoryTilesContainer.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/mgmt/CachingKeyedDefinitionsFactoryTilesContainer.java?view=diff&rev=521636&r1=521635&r2=521636
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/mgmt/CachingKeyedDefinitionsFactoryTilesContainer.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/mgmt/CachingKeyedDefinitionsFactoryTilesContainer.java Fri Mar 23 02:12:34 2007
@@ -27,7 +27,7 @@
import org.apache.tiles.TilesException;
import org.apache.tiles.context.TilesRequestContext;
-import org.apache.tiles.definition.ComponentDefinition;
+import org.apache.tiles.definition.Definition;
import org.apache.tiles.definition.DefinitionsFactory;
import org.apache.tiles.definition.DefinitionsFactoryException;
import org.apache.tiles.impl.KeyedDefinitionsFactoryTilesContainer;
@@ -74,7 +74,7 @@
/** {@inheritDoc} */
@Override
- protected ComponentDefinition getDefinition(String definition,
+ protected Definition getDefinition(String definition,
TilesRequestContext context)
throws DefinitionsFactoryException {
DefinitionManager mgr = getProperDefinitionManager(
@@ -127,7 +127,7 @@
TilesRequestContext request) throws DefinitionsFactoryException {
DefinitionManager mgr = getProperDefinitionManager(
getDefinitionsFactoryKey(request));
- ComponentDefinition def = new ComponentDefinition(definition);
+ Definition def = new Definition(definition);
mgr.addDefinition(def, request);
}
Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/mgmt/CachingTilesContainer.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/mgmt/CachingTilesContainer.java?view=diff&rev=521636&r1=521635&r2=521636
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/mgmt/CachingTilesContainer.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/mgmt/CachingTilesContainer.java Fri Mar 23 02:12:34 2007
@@ -23,7 +23,7 @@
import org.apache.tiles.TilesException;
import org.apache.tiles.context.TilesRequestContext;
-import org.apache.tiles.definition.ComponentDefinition;
+import org.apache.tiles.definition.Definition;
import org.apache.tiles.definition.DefinitionsFactoryException;
import org.apache.tiles.definition.DefinitionsFactory;
import org.apache.tiles.impl.BasicTilesContainer;
@@ -57,7 +57,7 @@
/** {@inheritDoc} */
@Override
- protected ComponentDefinition getDefinition(String definition,
+ protected Definition getDefinition(String definition,
TilesRequestContext context)
throws DefinitionsFactoryException {
return mgr.getDefinition(definition, context);
@@ -88,7 +88,7 @@
*/
protected void register(TileDefinition definition,
TilesRequestContext request) throws DefinitionsFactoryException {
- ComponentDefinition def = new ComponentDefinition(definition);
+ Definition def = new Definition(definition);
mgr.addDefinition(def, request);
}
}
Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/mgmt/DefinitionManager.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/mgmt/DefinitionManager.java?view=diff&rev=521636&r1=521635&r2=521636
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/mgmt/DefinitionManager.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/mgmt/DefinitionManager.java Fri Mar 23 02:12:34 2007
@@ -21,9 +21,9 @@
*/
package org.apache.tiles.impl.mgmt;
-import org.apache.tiles.ComponentAttribute;
+import org.apache.tiles.Attribute;
import org.apache.tiles.context.TilesRequestContext;
-import org.apache.tiles.definition.ComponentDefinition;
+import org.apache.tiles.definition.Definition;
import org.apache.tiles.definition.DefinitionsFactory;
import org.apache.tiles.definition.DefinitionsFactoryException;
import org.apache.tiles.definition.NoSuchDefinitionException;
@@ -111,9 +111,9 @@
* @throws DefinitionsFactoryException If something goes wrong when
* obtaining a main definition.
*/
- public ComponentDefinition getDefinition(String definition, TilesRequestContext request)
+ public Definition getDefinition(String definition, TilesRequestContext request)
throws DefinitionsFactoryException {
- Map<String, ComponentDefinition> definitions =
+ Map<String, Definition> definitions =
getDefinitions(request);
if (definitions != null && definitions.containsKey(definition)) {
return definitions.get(definition);
@@ -129,7 +129,7 @@
* @throws DefinitionsFactoryException If something goes wrong during the
* addition.
*/
- public void addDefinition(ComponentDefinition definition,
+ public void addDefinition(Definition definition,
TilesRequestContext request)
throws DefinitionsFactoryException {
validate(definition);
@@ -138,9 +138,9 @@
this.resolveInheritance(definition, request);
}
- for(ComponentAttribute attr : definition.getAttributes().values()) {
+ for(Attribute attr : definition.getAttributes().values()) {
if(isDefinition(attr, request)) {
- ComponentDefinition d = getDefinition(attr.getValue().toString(), request);
+ Definition d = getDefinition(attr.getValue().toString(), request);
attr.setAttributes(d.getAttributes());
}
}
@@ -157,9 +157,9 @@
* @throws DefinitionsFactoryException If something goes wrong during
* checking if the attribute is a main definition.
*/
- private boolean isDefinition(ComponentAttribute attribute,
+ private boolean isDefinition(Attribute attribute,
TilesRequestContext request) throws DefinitionsFactoryException {
- boolean explicit = ComponentAttribute.DEFINITION.equals(attribute.getType());
+ boolean explicit = Attribute.DEFINITION.equals(attribute.getType());
boolean implicit = attribute.getType() == null &&
(getDefinition((String)attribute.getValue(), request) != null);
return explicit || implicit;
@@ -171,8 +171,8 @@
* @param definition The definition to validate.
*/
private void validate(TileDefinition definition) {
- Map<String, ComponentAttribute> attrs = definition.getAttributes();
- for (ComponentAttribute attribute : attrs.values()) {
+ Map<String, Attribute> attrs = definition.getAttributes();
+ for (Attribute attribute : attrs.values()) {
if (attribute.getName() == null) {
throw new IllegalArgumentException("Attribute name not defined");
}
@@ -195,7 +195,7 @@
* @param request The current request.
* @throws DefinitionsFactoryException If an inheritance can not be solved.
*/
- protected void resolveInheritance(ComponentDefinition definition,
+ protected void resolveInheritance(Definition definition,
TilesRequestContext request)
throws DefinitionsFactoryException {
// Already done, or not needed ?
@@ -214,7 +214,7 @@
// however, this may cause errors for other implementations.
// we should probably make all factories agnostic and allow the manager to
// utilize the correct factory based on the context.
- ComponentDefinition parent = getDefinition(definition.getExtends(), request);
+ Definition parent = getDefinition(definition.getExtends(), request);
if (parent == null) { // error
@@ -243,12 +243,12 @@
* @param parent The parent definition.
* @param child The child that will be overloaded.
*/
- protected void overload(ComponentDefinition parent,
- ComponentDefinition child) {
+ protected void overload(Definition parent,
+ Definition child) {
// Iterate on each parent's attribute and add it if not defined in child.
- for(Map.Entry<String, ComponentAttribute> entry : parent.getAttributes().entrySet()) {
+ for(Map.Entry<String, Attribute> entry : parent.getAttributes().entrySet()) {
if (!child.hasAttributeValue(entry.getKey())) {
- child.putAttribute(entry.getKey(), new ComponentAttribute(entry.getValue()));
+ child.putAttribute(entry.getKey(), new Attribute(entry.getValue()));
}
}
@@ -270,9 +270,9 @@
* @return A map that connects a definition name to a definition.
*/
@SuppressWarnings("unchecked")
- protected Map<String, ComponentDefinition> getDefinitions(
+ protected Map<String, Definition> getDefinitions(
TilesRequestContext request) {
- return (Map<String, ComponentDefinition>) request.getRequestScope()
+ return (Map<String, Definition>) request.getRequestScope()
.get(definitionsAttributeName);
}
@@ -284,13 +284,13 @@
* @return A map that connects a definition name to a definition.
*/
@SuppressWarnings("unchecked")
- protected Map<String, ComponentDefinition> getOrCreateDefinitions(
+ protected Map<String, Definition> getOrCreateDefinitions(
TilesRequestContext request) {
- Map<String, ComponentDefinition> definitions =
- (Map<String, ComponentDefinition>) request
+ Map<String, Definition> definitions =
+ (Map<String, Definition>) request
.getRequestScope().get(definitionsAttributeName);
if (definitions == null) {
- definitions = new HashMap<String, ComponentDefinition>();
+ definitions = new HashMap<String, Definition>();
request.getRequestScope()
.put(definitionsAttributeName, definitions);
}
Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/locale/impl/DefaultLocaleResolver.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/locale/impl/DefaultLocaleResolver.java?view=diff&rev=521636&r1=521635&r2=521636
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/locale/impl/DefaultLocaleResolver.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/locale/impl/DefaultLocaleResolver.java Fri Mar 23 02:12:34 2007
@@ -24,7 +24,7 @@
import java.util.Locale;
import java.util.Map;
-import org.apache.tiles.ComponentConstants;
+import org.apache.tiles.Constants;
import org.apache.tiles.TilesException;
import org.apache.tiles.context.TilesRequestContext;
import org.apache.tiles.locale.LocaleResolver;
@@ -32,7 +32,7 @@
/**
* Default implementation of <code>LocaleResolver</code><br>
* It tries to take the locale from the session-scoped attribute
- * {@link ComponentConstants#LOCALE_KEY}. If it is not found, it returns the
+ * {@link Constants#LOCALE_KEY}. If it is not found, it returns the
* locale included in the request.
*
* @version $Rev$ $Date$
@@ -50,7 +50,7 @@
Locale retValue = null;
Map<String, Object> session = request.getSessionScope();
if (session != null) {
- retValue = (Locale) session.get(ComponentConstants.LOCALE_KEY);
+ retValue = (Locale) session.get(Constants.LOCALE_KEY);
}
if (retValue == null) {
retValue = request.getRequestLocale();
Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/package.html
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/package.html?view=diff&rev=521636&r1=521635&r2=521636
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/package.html (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/package.html Fri Mar 23 02:12:34 2007
@@ -281,7 +281,7 @@
<pre>
<servlet>
<servlet-name>action</servlet-name>
- <servlet-class>org.apache.struts.tiles.ActionComponentServlet</servlet-class>
+ <servlet-class>org.apache.tiles.servlet.TilesServlet</servlet-class>
<!-- Tiles Servlet parameter
Specify configuration file names. There can be several comma
separated file names
Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/ViewPreparer.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/ViewPreparer.java?view=diff&rev=521636&r1=521635&r2=521636
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/ViewPreparer.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/ViewPreparer.java Fri Mar 23 02:12:34 2007
@@ -22,7 +22,7 @@
package org.apache.tiles.preparer;
import org.apache.tiles.context.TilesRequestContext;
-import org.apache.tiles.ComponentContext;
+import org.apache.tiles.AttributeContext;
/**
* <p>
@@ -31,7 +31,7 @@
*
* <p>
* A view preparer is typically used to provide last minute
- * translations of the data within the Component or Tiles Context.
+ * translations of the data within the attribute context.
* A preparer is not intended to replace the controller within an
* MVC architecture.
* </p>
@@ -51,10 +51,10 @@
* is included.
*
* @param tilesContext Current tiles application context.
- * @param componentContext Current tile context.
+ * @param attributeContext Current tile context.
* @throws Exception If something goes wrong during execution.
*/
public void execute(TilesRequestContext tilesContext,
- ComponentContext componentContext)
+ AttributeContext attributeContext)
throws Exception;
}
Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/ViewPreparerSupport.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/ViewPreparerSupport.java?view=diff&rev=521636&r1=521635&r2=521636
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/ViewPreparerSupport.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/preparer/ViewPreparerSupport.java Fri Mar 23 02:12:34 2007
@@ -22,7 +22,7 @@
package org.apache.tiles.preparer;
import org.apache.tiles.context.TilesRequestContext;
-import org.apache.tiles.ComponentContext;
+import org.apache.tiles.AttributeContext;
/**
* Basic implementation of ViewPreparer. Implementations can extend this class
@@ -36,6 +36,6 @@
/** {@inheritDoc} */
public void execute(TilesRequestContext tilesContext,
- ComponentContext componentContext) throws Exception {
+ AttributeContext attributeContext) throws Exception {
}
}
Modified: tiles/framework/trunk/tiles-core/src/main/resources/org/apache/tiles/resources/tiles-config_2_0.dtd
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/resources/org/apache/tiles/resources/tiles-config_2_0.dtd?view=diff&rev=521636&r1=521635&r2=521636
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/resources/org/apache/tiles/resources/tiles-config_2_0.dtd (original)
+++ tiles/framework/trunk/tiles-core/src/main/resources/org/apache/tiles/resources/tiles-config_2_0.dtd Fri Mar 23 02:12:34 2007
@@ -37,8 +37,7 @@
<!ENTITY % Boolean "(true|false)">
-<!-- A "ContentType" is the content type of an attribute passed to a tile
- component.
+<!-- A "ContentType" is the content type of an attribute passed to a template.
-->
<!ENTITY % ContentType "(string|template|definition)">
Copied: tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/MockDefinitions.java (from r521325, tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/MockComponentDefinitions.java)
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/MockDefinitions.java?view=diff&rev=521636&p1=tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/MockComponentDefinitions.java&r1=521325&p2=tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/MockDefinitions.java&r2=521636
==============================================================================
--- tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/MockComponentDefinitions.java (original)
+++ tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/MockDefinitions.java Fri Mar 23 02:12:34 2007
@@ -26,15 +26,15 @@
import java.util.Locale;
import java.util.Map;
-import org.apache.tiles.definition.ComponentDefinitions;
+import org.apache.tiles.definition.Definitions;
import org.apache.tiles.definition.NoSuchDefinitionException;
-import org.apache.tiles.definition.ComponentDefinition;
+import org.apache.tiles.definition.Definition;
/**
*
* @version $Rev$ $Date$
*/
-public class MockComponentDefinitions implements ComponentDefinitions {
+public class MockDefinitions implements Definitions {
/**
* Hokey way to verify that this was created.
@@ -50,52 +50,52 @@
return instanceCount;
}
- /** Creates a new instance of MockComponentDefinitions */
- public MockComponentDefinitions() {
+ /** Creates a new instance of MockDefinitions */
+ public MockDefinitions() {
instanceCount++;
}
/**
- * Returns a ComponentDefinition object that matches the given name.
+ * Returns a Definition object that matches the given name.
*
- * @param name The name of the ComponentDefinition to return.
- * @return the ComponentDefinition matching the given name or null if none
+ * @param name The name of the Definition to return.
+ * @return the Definition matching the given name or null if none
* is found.
*/
- public ComponentDefinition getDefinition(String name) {
+ public Definition getDefinition(String name) {
return null;
}
/**
- * Adds new locale-specific ComponentDefinition objects to the internal
+ * Adds new locale-specific Definition objects to the internal
* collection and resolves inheritance attraibutes.
*
* @param defsMap The new definitions to add.
* @param locale The locale to add the definitions to.
*/
- public void addDefinitions(Map<String, ComponentDefinition> defsMap,
+ public void addDefinitions(Map<String, Definition> defsMap,
java.util.Locale locale) {
}
/**
- * Returns a ComponentDefinition object that matches the given name and locale.
+ * Returns a Definition object that matches the given name and locale.
*
- * @param name The name of the ComponentDefinition to return.
+ * @param name The name of the Definition to return.
* @param locale The locale to use to resolve the definition.
- * @return the ComponentDefinition matching the given name or null if none
+ * @return the Definition matching the given name or null if none
* is found.
*/
- public ComponentDefinition getDefinition(String name, java.util.Locale locale) {
+ public Definition getDefinition(String name, java.util.Locale locale) {
return null;
}
/**
- * Adds new ComponentDefinition objects to the internal collection and
+ * Adds new Definition objects to the internal collection and
* resolves inheritance attraibutes.
*
* @param defsMap The new definitions to add.
*/
- public void addDefinitions(Map<String, ComponentDefinition> defsMap) {
+ public void addDefinitions(Map<String, Definition> defsMap) {
}
/** {@inheritDoc} */
@@ -113,7 +113,7 @@
}
/** {@inheritDoc} */
- public Map<String, ComponentDefinition> getBaseDefinitions() {
+ public Map<String, Definition> getBaseDefinitions() {
return null;
}
Modified: tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/MockDefinitionsReader.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/MockDefinitionsReader.java?view=diff&rev=521636&r1=521635&r2=521636
==============================================================================
--- tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/MockDefinitionsReader.java (original)
+++ tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/MockDefinitionsReader.java Fri Mar 23 02:12:34 2007
@@ -55,18 +55,18 @@
}
/**
- * Reads <code>{@link org.apache.tiles.definition.ComponentDefinition}</code> objects from a source.
+ * Reads <code>{@link org.apache.tiles.definition.Definition}</code> objects from a source.
*
* Implementations should publish what type of source object is expected.
*
* @param source The source from which definitions will be read.
- * @return a Map of <code>ComponentDefinition</code> objects read from
+ * @return a Map of <code>Definition</code> objects read from
* the source.
* @throws org.apache.tiles.definition.DefinitionsFactoryException if the source is invalid or
* an error occurs when reading definitions.
*/
@SuppressWarnings("unchecked")
- public Map<String, ComponentDefinition> read(Object source) throws DefinitionsFactoryException {
+ public Map<String, Definition> read(Object source) throws DefinitionsFactoryException {
return Collections.EMPTY_MAP;
}
Modified: tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/MockPublicUrlDefinitionsFactory.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/MockPublicUrlDefinitionsFactory.java?view=diff&rev=521636&r1=521635&r2=521636
==============================================================================
--- tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/MockPublicUrlDefinitionsFactory.java (original)
+++ tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/MockPublicUrlDefinitionsFactory.java Fri Mar 23 02:12:34 2007
@@ -22,7 +22,7 @@
package org.apache.tiles.definition;
-import org.apache.tiles.definition.ComponentDefinitions;
+import org.apache.tiles.definition.Definitions;
import org.apache.tiles.definition.DefinitionsFactoryException;
import org.apache.tiles.context.TilesRequestContext;
import org.apache.tiles.definition.UrlDefinitionsFactory;
@@ -39,10 +39,10 @@
* Exposes the <code>addDefinitions</code> method of
* <code>UrlDefinitionsFactory</code>
*
- * @see org.apache.tiles.definition.UrlDefinitionsFactory#addDefinitions(org.apache.tiles.definition.ComponentDefinitions,
+ * @see org.apache.tiles.definition.UrlDefinitionsFactory#addDefinitions(org.apache.tiles.definition.Definitions,
*org.apache.tiles.context.TilesRequestContext)
*/
- public void addDefinitions(ComponentDefinitions definitions,
+ public void addDefinitions(Definitions definitions,
TilesRequestContext tilesContext) throws DefinitionsFactoryException {
super.addDefinitions(definitions, tilesContext);
}
Copied: tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/TestDefinition.java (from r521325, tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/TestComponentDefinition.java)
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/TestDefinition.java?view=diff&rev=521636&p1=tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/TestComponentDefinition.java&r1=521325&p2=tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/TestDefinition.java&r2=521636
==============================================================================
--- tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/TestComponentDefinition.java (original)
+++ tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/TestDefinition.java Fri Mar 23 02:12:34 2007
@@ -25,21 +25,21 @@
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
-import org.apache.tiles.definition.ComponentDefinition;
+import org.apache.tiles.definition.Definition;
/**
- * Tests the ComponentDefinition class.
+ * Tests the Definition class.
*
* @version $Rev$ $Date$
*/
-public class TestComponentDefinition extends TestCase{
+public class TestDefinition extends TestCase{
/**
- * Creates a new instance of TestComponentDefinition
+ * Creates a new instance of TestDefinition
*
* @param name The name of the test.
*/
- public TestComponentDefinition(String name) {
+ public TestDefinition(String name) {
super(name);
}
@@ -50,7 +50,7 @@
*/
public static void main(String[] theArgs) {
junit.textui.TestRunner.main(
- new String[] { TestComponentDefinition.class.getName()});
+ new String[] { TestDefinition.class.getName()});
}
/**
@@ -58,23 +58,23 @@
* starting with "test"
*/
public static Test suite() {
- return new TestSuite(TestComponentDefinition.class);
+ return new TestSuite(TestDefinition.class);
}
/**
* Verifies the put Attribute functionality.
*
- * Attributes are added or replaced in the component definition.
+ * Attributes are added or replaced in the definition.
*/
public void testPutAttribute() {
- ComponentDefinition def = new ComponentDefinition();
+ Definition def = new Definition();
def.setName("test1");
def.setTemplate("/page1.jsp");
- def.put("attr1", new ComponentDefinition(), "definition", null);
+ def.put("attr1", new Definition(), "definition", null);
Object attr1 = def.getAttribute("attr1");
assertNotNull("Null attribute.", attr1);
- assertTrue("Wrong attribute type", attr1 instanceof ComponentDefinition);
+ assertTrue("Wrong attribute type", attr1 instanceof Definition);
}
Copied: tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/TestDefinitions.java (from r521325, tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/TestComponentDefinitions.java)
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/TestDefinitions.java?view=diff&rev=521636&p1=tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/TestComponentDefinitions.java&r1=521325&p2=tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/TestDefinitions.java&r2=521636
==============================================================================
--- tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/TestComponentDefinitions.java (original)
+++ tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/TestDefinitions.java Fri Mar 23 02:12:34 2007
@@ -28,25 +28,25 @@
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
-import org.apache.tiles.definition.ComponentDefinitionsImpl;
-import org.apache.tiles.definition.ComponentDefinitions;
+import org.apache.tiles.definition.DefinitionsImpl;
+import org.apache.tiles.definition.Definitions;
import org.apache.tiles.definition.NoSuchDefinitionException;
-import org.apache.tiles.definition.ComponentDefinition;
-import org.apache.tiles.ComponentAttribute;
+import org.apache.tiles.definition.Definition;
+import org.apache.tiles.Attribute;
/**
- * Tests the ComponentDefinitionsImpl class.
+ * Tests the DefinitionsImpl class.
*
* @version $Rev$ $Date$
*/
-public class TestComponentDefinitions extends TestCase {
+public class TestDefinitions extends TestCase {
/**
- * Creates a new instance of TestComponentDefinitions
+ * Creates a new instance of TestDefinitions
*
* @param name The name of the test.
*/
- public TestComponentDefinitions(String name) {
+ public TestDefinitions(String name) {
super(name);
}
@@ -57,7 +57,7 @@
*/
public static void main(String[] theArgs) {
junit.textui.TestRunner.main(
- new String[] { TestComponentDefinitions.class.getName()});
+ new String[] { TestDefinitions.class.getName()});
}
/**
@@ -65,34 +65,34 @@
* starting with "test"
*/
public static Test suite() {
- return new TestSuite(TestComponentDefinitions.class);
+ return new TestSuite(TestDefinitions.class);
}
/**
- * Tests the inheritance properties of ComponentDefinition objects.
+ * Tests the inheritance properties of Definition objects.
*/
public void testResolveInheritances() {
- Map<String, ComponentDefinition> defs = new HashMap<String, ComponentDefinition>();
+ Map<String, Definition> defs = new HashMap<String, Definition>();
- ComponentDefinition def = new ComponentDefinition();
+ Definition def = new Definition();
def.setName("parent.def1");
def.setTemplate("/test1.jsp");
- ComponentAttribute attr = new ComponentAttribute();
+ Attribute attr = new Attribute();
attr.setName("attr1");
attr.setValue("value1");
def.addAttribute(attr);
defs.put(def.getName(), def);
- def = new ComponentDefinition();
+ def = new Definition();
def.setName("child.def1");
def.setExtends("parent.def1");
- attr = new ComponentAttribute();
+ attr = new Attribute();
attr.setName("attr1");
attr.setValue("New value");
def.addAttribute(attr);
defs.put(def.getName(), def);
- ComponentDefinitions definitions = new ComponentDefinitionsImpl();
+ Definitions definitions = new DefinitionsImpl();
try {
definitions.addDefinitions(defs);
} catch (NoSuchDefinitionException e) {
@@ -118,36 +118,36 @@
* Tests the inheritance with localized definitions.
*/
public void testLocalizedResolveInheritances() {
- Map<String, ComponentDefinition> defs = new HashMap<String, ComponentDefinition>();
- ComponentDefinition def = new ComponentDefinition();
+ Map<String, Definition> defs = new HashMap<String, Definition>();
+ Definition def = new Definition();
def.setName("parent.def1");
def.setTemplate("/test1.jsp");
- ComponentAttribute attr = new ComponentAttribute();
+ Attribute attr = new Attribute();
attr.setName("attr1");
attr.setValue("value1");
def.addAttribute(attr);
defs.put(def.getName(), def);
- def = new ComponentDefinition();
+ def = new Definition();
def.setName("child.def1");
def.setExtends("parent.def1");
- attr = new ComponentAttribute();
+ attr = new Attribute();
attr.setName("attr1");
attr.setValue("New value");
def.addAttribute(attr);
defs.put(def.getName(), def);
- Map<String, ComponentDefinition> localDefs = new HashMap<String, ComponentDefinition>();
- def = new ComponentDefinition();
+ Map<String, Definition> localDefs = new HashMap<String, Definition>();
+ def = new Definition();
def.setName("child.def1");
def.setExtends("parent.def1");
- attr = new ComponentAttribute();
+ attr = new Attribute();
attr.setName("attr1");
attr.setValue("US Value");
def.addAttribute(attr);
localDefs.put(def.getName(), def);
- ComponentDefinitions definitions = new ComponentDefinitionsImpl();
+ Definitions definitions = new DefinitionsImpl();
try {
definitions.addDefinitions(defs);
definitions.addDefinitions(localDefs, Locale.US);
@@ -188,27 +188,27 @@
* Tests the reset method.
*/
public void testReset() {
- Map<String, ComponentDefinition> defs = new HashMap<String, ComponentDefinition>();
+ Map<String, Definition> defs = new HashMap<String, Definition>();
- ComponentDefinition def = new ComponentDefinition();
+ Definition def = new Definition();
def.setName("parent.def1");
def.setTemplate("/test1.jsp");
- ComponentAttribute attr = new ComponentAttribute();
+ Attribute attr = new Attribute();
attr.setName("attr1");
attr.setValue("value1");
def.addAttribute(attr);
defs.put(def.getName(), def);
- def = new ComponentDefinition();
+ def = new Definition();
def.setName("child.def1");
def.setExtends("parent.def1");
- attr = new ComponentAttribute();
+ attr = new Attribute();
attr.setName("attr1");
attr.setValue("New value");
def.addAttribute(attr);
defs.put(def.getName(), def);
- ComponentDefinitions definitions = new ComponentDefinitionsImpl();
+ Definitions definitions = new DefinitionsImpl();
try {
definitions.addDefinitions(defs);
} catch (NoSuchDefinitionException e) {
@@ -226,38 +226,38 @@
/**
* Verifies that attribute dependencies are resolved.
*
- * A Component (tile) can have an attribute that points to another component.
+ * A definition can have an attribute that points to another definition.
* This test verifies that the <code>resolveAttributes</code> method is
* executed and attribute dependencies are calculated.
*/
public void testResolveAttributeDependencies() {
- Map<String, ComponentDefinition> defs = new HashMap<String, ComponentDefinition>();
+ Map<String, Definition> defs = new HashMap<String, Definition>();
- ComponentDefinition def = new ComponentDefinition();
+ Definition def = new Definition();
def.setName("parent.def1");
def.setTemplate("/test1.jsp");
- ComponentAttribute attr = new ComponentAttribute();
+ Attribute attr = new Attribute();
attr.setName("attr1");
attr.setValue("tiles.def2");
attr.setType("definition");
def.addAttribute(attr);
defs.put(def.getName(), def);
- def = new ComponentDefinition();
+ def = new Definition();
def.setName("parent.notype.def1");
def.setTemplate("/test1.jsp");
- attr = new ComponentAttribute();
+ attr = new Attribute();
attr.setName("attr1");
attr.setValue("tiles.def2");
// Don't set the type
def.addAttribute(attr);
defs.put(def.getName(), def);
- def = new ComponentDefinition();
+ def = new Definition();
def.setName("tiles.def2");
defs.put(def.getName(), def);
- ComponentDefinitions definitions = new ComponentDefinitionsImpl();
+ Definitions definitions = new DefinitionsImpl();
try {
definitions.addDefinitions(defs);
definitions.addDefinitions(defs, Locale.ITALIAN);
@@ -265,7 +265,7 @@
fail("Test failure: " + e);
}
- ComponentDefinition newDef = definitions.getDefinition("parent.def1");
+ Definition newDef = definitions.getDefinition("parent.def1");
assertNotNull("Parent definition not found.", newDef);
Object newAttr = newDef.getAttribute("attr1");
Modified: tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/TestReloadableDefinitionsFactory.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/TestReloadableDefinitionsFactory.java?view=diff&rev=521636&r1=521635&r2=521636
==============================================================================
--- tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/TestReloadableDefinitionsFactory.java (original)
+++ tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/TestReloadableDefinitionsFactory.java Fri Mar 23 02:12:34 2007
@@ -32,7 +32,7 @@
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.apache.tiles.definition.UrlDefinitionsFactory;
-import org.apache.tiles.definition.ComponentDefinitions;
+import org.apache.tiles.definition.Definitions;
import org.apache.tiles.definition.DefinitionsFactory;
import org.apache.tiles.definition.ReloadableDefinitionsFactory;
@@ -129,7 +129,7 @@
factory.addSource(url);
// Parse files.
- ComponentDefinitions definitions = factory.readDefinitions();
+ Definitions definitions = factory.readDefinitions();
assertNotNull("rewrite.test definition not found.",
definitions.getDefinition("rewrite.test"));
Modified: tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/TestUrlDefinitionsFactory.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/TestUrlDefinitionsFactory.java?view=diff&rev=521636&r1=521635&r2=521636
==============================================================================
--- tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/TestUrlDefinitionsFactory.java (original)
+++ tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/TestUrlDefinitionsFactory.java Fri Mar 23 02:12:34 2007
@@ -33,7 +33,7 @@
import junit.framework.TestCase;
import junit.framework.TestSuite;
import org.apache.tiles.definition.UrlDefinitionsFactory;
-import org.apache.tiles.definition.ComponentDefinitions;
+import org.apache.tiles.definition.Definitions;
import org.apache.tiles.definition.DefinitionsFactory;
import org.apache.tiles.definition.DefinitionsFactoryException;
import org.apache.tiles.definition.MockPublicUrlDefinitionsFactory;
@@ -42,7 +42,7 @@
import org.apache.tiles.context.TilesRequestContext;
/**
- * Tests the UrlDefinitionsFactory component.
+ * Tests the UrlDefinitionsFactory.
*
* @version $Rev$ $Date$
*/
@@ -101,7 +101,7 @@
factory.addSource(url3);
// Parse files.
- ComponentDefinitions definitions = factory.readDefinitions();
+ Definitions definitions = factory.readDefinitions();
assertNotNull("test.def1 definition not found.", definitions.getDefinition("test.def1"));
assertNotNull("test.def2 definition not found.", definitions.getDefinition("test.def2"));
@@ -219,7 +219,7 @@
factory.addSource(url3);
// Parse files.
- ComponentDefinitions definitions = factory.readDefinitions();
+ Definitions definitions = factory.readDefinitions();
factory.addDefinitions(definitions,
new MockOnlyLocaleTilesContext(Locale.US));
factory.addDefinitions(definitions,
@@ -258,7 +258,7 @@
factory.addSource(url1);
// Parse files.
- ComponentDefinitions definitions = factory.readDefinitions();
+ Definitions definitions = factory.readDefinitions();
TilesRequestContext tilesContext =
new MockOnlyLocaleTilesContext(Locale.US);
assertFalse("Locale should not be processed.",
Modified: tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/digester/TestDigesterDefinitionsReader.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/digester/TestDigesterDefinitionsReader.java?view=diff&rev=521636&r1=521635&r2=521636
==============================================================================
--- tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/digester/TestDigesterDefinitionsReader.java (original)
+++ tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/digester/TestDigesterDefinitionsReader.java Fri Mar 23 02:12:34 2007
@@ -32,7 +32,7 @@
import org.apache.tiles.definition.digester.DigesterDefinitionsReader;
import org.apache.tiles.definition.DefinitionsFactoryException;
import org.apache.tiles.definition.DefinitionsReader;
-import org.apache.tiles.definition.ComponentDefinition;
+import org.apache.tiles.definition.Definition;
/**
* Tests the <code>org.apache.tiles.definition.digester.DigesterDefinitionsReader</code> class.
@@ -81,7 +81,7 @@
assertNotNull("Config file not found", configFile);
InputStream source = configFile.openStream();
- Map<String, ComponentDefinition> definitions = reader.read(source);
+ Map<String, Definition> definitions = reader.read(source);
assertNotNull("Definitions not returned.", definitions);
assertNotNull("Couldn't find doc.mainLayout tile.",
Modified: tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/impl/KeyedDefinitionsFactoryTilesContainerTest.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/impl/KeyedDefinitionsFactoryTilesContainerTest.java?view=diff&rev=521636&r1=521635&r2=521636
==============================================================================
--- tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/impl/KeyedDefinitionsFactoryTilesContainerTest.java (original)
+++ tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/impl/KeyedDefinitionsFactoryTilesContainerTest.java Fri Mar 23 02:12:34 2007
@@ -34,7 +34,7 @@
import junit.framework.TestCase;
-import org.apache.tiles.ComponentConstants;
+import org.apache.tiles.Constants;
import org.apache.tiles.TilesException;
import org.apache.tiles.definition.DefinitionsFactory;
import org.apache.tiles.factory.KeyedDefinitionsFactoryTilesContainerFactory;
@@ -184,7 +184,7 @@
EasyMock.reset(session);
EasyMock.reset(response);
EasyMock.expect(request.getSession()).andReturn(session).anyTimes();
- EasyMock.expect(session.getAttribute(ComponentConstants.LOCALE_KEY)).andReturn(null).anyTimes();
+ EasyMock.expect(session.getAttribute(Constants.LOCALE_KEY)).andReturn(null).anyTimes();
EasyMock.expect(request.getLocale()).andReturn(null).anyTimes();
EasyMock.expect(request.getAttribute(
KeyedDefinitionsFactoryTilesContainer.DEFINITIONS_FACTORY_KEY_ATTRIBUTE_NAME))
@@ -203,7 +203,7 @@
KeyedDefinitionsFactoryTilesContainer.DEFINITIONS_FACTORY_KEY_ATTRIBUTE_NAME))
.andReturn("one").anyTimes();
EasyMock.expect(request.getSession()).andReturn(session).anyTimes();
- EasyMock.expect(session.getAttribute(ComponentConstants.LOCALE_KEY)).andReturn(null).anyTimes();
+ EasyMock.expect(session.getAttribute(Constants.LOCALE_KEY)).andReturn(null).anyTimes();
EasyMock.expect(request.getLocale()).andReturn(null).anyTimes();
EasyMock.replay(request);
EasyMock.replay(session);
@@ -219,7 +219,7 @@
KeyedDefinitionsFactoryTilesContainer.DEFINITIONS_FACTORY_KEY_ATTRIBUTE_NAME))
.andReturn("two").anyTimes();
EasyMock.expect(request.getSession()).andReturn(session).anyTimes();
- EasyMock.expect(session.getAttribute(ComponentConstants.LOCALE_KEY)).andReturn(null).anyTimes();
+ EasyMock.expect(session.getAttribute(Constants.LOCALE_KEY)).andReturn(null).anyTimes();
EasyMock.expect(request.getLocale()).andReturn(null).anyTimes();
EasyMock.replay(request);
EasyMock.replay(session);
Modified: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/AddAttributeTag.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/AddAttributeTag.java?view=diff&rev=521636&r1=521635&r2=521636
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/AddAttributeTag.java (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/AddAttributeTag.java Fri Mar 23 02:12:34 2007
@@ -22,7 +22,7 @@
package org.apache.tiles.jsp.taglib;
-import org.apache.tiles.ComponentConstants;
+import org.apache.tiles.Constants;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -59,7 +59,7 @@
* @version $Rev$ $Date$
*/
public class AddAttributeTag extends RoleSecurityTagSupport implements
- ComponentConstants {
+ Constants {
/**
* The logging object.
Modified: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/AddListAttributeTag.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/AddListAttributeTag.java?view=diff&rev=521636&r1=521635&r2=521636
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/AddListAttributeTag.java (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/AddListAttributeTag.java Fri Mar 23 02:12:34 2007
@@ -22,7 +22,7 @@
package org.apache.tiles.jsp.taglib;
-import org.apache.tiles.ComponentAttribute;
+import org.apache.tiles.Attribute;
import java.util.ArrayList;
import java.util.List;
@@ -41,11 +41,11 @@
/**
* Get list defined in tag.
*
- * @return The list of component attributes.
+ * @return The list of attributes.
*/
@SuppressWarnings("unchecked")
- public List<ComponentAttribute> getValue() {
- return (List<ComponentAttribute>) super.getValue();
+ public List<Attribute> getValue() {
+ return (List<Attribute>) super.getValue();
}
/** {@inheritDoc} */
@@ -56,7 +56,7 @@
/** {@inheritDoc} */
public int doStartTag() throws JspException {
- super.setValue(new ArrayList<ComponentAttribute>());
+ super.setValue(new ArrayList<Attribute>());
return super.doStartTag();
}
@@ -83,7 +83,7 @@
* Process nested ≶addAttribute> tag.
* <p/>
* Places the value of the nested tag within the
- * {@link org.apache.tiles.ComponentContext}.It is the responsibility
+ * {@link org.apache.tiles.AttributeContext}.It is the responsibility
* of the descendent to check security. Tags extending
* the {@link org.apache.tiles.jsp.taglib.ContainerTagSupport} will automatically provide
* the appropriate security.
@@ -91,7 +91,7 @@
* @param nestedTag the put tag desciendent.
*/
public void processNestedTag(AddAttributeTag nestedTag) {
- ComponentAttribute attribute = new ComponentAttribute(
+ Attribute attribute = new Attribute(
nestedTag.getValue(), nestedTag.getRole(),
nestedTag.getType());
@@ -103,7 +103,7 @@
*
* @param attribute The attribute to add.
*/
- private void addValue( ComponentAttribute attribute ) {
+ private void addValue( Attribute attribute ) {
this.getValue().add(attribute);
}
}
Modified: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/AttributeTagSupport.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/AttributeTagSupport.java?view=diff&rev=521636&r1=521635&r2=521636
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/AttributeTagSupport.java (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/AttributeTagSupport.java Fri Mar 23 02:12:34 2007
@@ -21,8 +21,8 @@
*/
package org.apache.tiles.jsp.taglib;
-import org.apache.tiles.ComponentAttribute;
-import org.apache.tiles.ComponentContext;
+import org.apache.tiles.Attribute;
+import org.apache.tiles.AttributeContext;
import org.apache.tiles.TilesContainer;
import org.apache.tiles.access.TilesAccess;
@@ -82,14 +82,14 @@
protected TilesContainer container;
/**
- * The current component context.
+ * The current attribute context.
*/
- protected ComponentContext componentContext;
+ protected AttributeContext attributeContext;
/**
* The found attribute.
*/
- protected ComponentAttribute attribute;
+ protected Attribute attribute;
/**
@@ -119,13 +119,13 @@
/** {@inheritDoc} */
public int doStartTag() throws JspException {
container = TilesAccess.getContainer(pageContext.getServletContext());
- componentContext = container.getComponentContext(pageContext);
+ attributeContext = container.getAttributeContext(pageContext);
scope = getScopeId();
// Some tags allow for unspecified attribues. This
// implies that the tag should use all of the attributes.
if (name != null) {
- attribute = componentContext.getAttribute(name);
+ attribute = attributeContext.getAttribute(name);
if ((attribute == null || attribute.getValue() == null) && ignore) {
return SKIP_BODY;
}
Modified: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/ContainerTagSupport.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/ContainerTagSupport.java?view=diff&rev=521636&r1=521635&r2=521636
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/ContainerTagSupport.java (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/ContainerTagSupport.java Fri Mar 23 02:12:34 2007
@@ -23,7 +23,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.tiles.ComponentContext;
+import org.apache.tiles.AttributeContext;
import org.apache.tiles.TilesContainer;
import org.apache.tiles.access.TilesAccess;
@@ -33,7 +33,7 @@
/**
* Base tag for the tiles tags which interact with the container.
* Provides standard support for security, and provides access
- * to the container and component context.
+ * to the container and attribute context.
* </p>
*
* @since Tiles 2.0
@@ -53,13 +53,13 @@
protected TilesContainer container;
/**
- * The component context to use to store and read attribute values.
+ * The attribute context to use to store and read attribute values.
*/
- protected ComponentContext componentContext;
+ protected AttributeContext attributeContext;
/**
* By default, all ContainerTags evaluate their body. Subclasses may choose to be more selective.
- * In any case, children can rely upon the container and componentContext being initialized if they
+ * In any case, children can rely upon the container and attributeContext being initialized if they
* call <code>super.doStartTag()</code>
*
* @return <code>EVAL_BODY_BUFFERED</code>.
@@ -91,7 +91,7 @@
public void release() {
super.release();
this.container = null;
- this.componentContext = null;
+ this.attributeContext = null;
}
/**
@@ -101,7 +101,7 @@
*/
protected void startContext(PageContext context) {
if (container != null) {
- componentContext = container.startContext(pageContext);
+ attributeContext = container.startContext(pageContext);
}
}
@@ -111,7 +111,7 @@
* @param context The page context to use.
*/
protected void endContext(PageContext context) {
- if (componentContext != null && container != null) {
+ if (attributeContext != null && container != null) {
container.endContext(pageContext);
}
}
Modified: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/GetAsStringTag.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/GetAsStringTag.java?view=diff&rev=521636&r1=521635&r2=521636
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/GetAsStringTag.java (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/GetAsStringTag.java Fri Mar 23 02:12:34 2007
@@ -21,13 +21,13 @@
*/
package org.apache.tiles.jsp.taglib;
-import org.apache.tiles.ComponentAttribute;
+import org.apache.tiles.Attribute;
import org.apache.tiles.TilesException;
import java.io.IOException;
/**
- * Retrieve the value of the specified component/template attribute property,
+ * Retrieve the value of the specified definition/template attribute property,
* and render it to the current JspWriter as a String.
* The usual toString() conversion is applied on the found value.
*
@@ -37,7 +37,7 @@
/** {@inheritDoc} */
@Override
- protected void render(ComponentAttribute attr)
+ protected void render(Attribute attr)
throws TilesException, IOException {
pageContext.getOut().print(attr.getValue().toString());
}
Modified: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/ImportAttributeTag.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/ImportAttributeTag.java?view=diff&rev=521636&r1=521635&r2=521636
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/ImportAttributeTag.java (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/ImportAttributeTag.java Fri Mar 23 02:12:34 2007
@@ -21,7 +21,7 @@
*/
package org.apache.tiles.jsp.taglib;
-import org.apache.tiles.ComponentAttribute;
+import org.apache.tiles.Attribute;
import org.apache.tiles.jsp.taglib.AttributeTagSupport;
import javax.servlet.jsp.JspException;
@@ -68,7 +68,7 @@
}
/**
- * Expose the requested property from component context.
+ * Expose the requested property from attribute context.
*
* @throws JspException On errors processing tag.
*/
@@ -77,7 +77,7 @@
pageContext.setAttribute(toName != null? toName : name,
attribute.getValue(), scope);
} else {
- Iterator<String> names = componentContext.getAttributeNames();
+ Iterator<String> names = attributeContext.getAttributeNames();
while (names.hasNext()) {
String name = names.next();
@@ -88,7 +88,7 @@
continue;
}
- ComponentAttribute attr = componentContext.getAttribute(name);
+ Attribute attr = attributeContext.getAttribute(name);
if ( (attr == null || attr.getValue() == null) && !ignore) {
throw new JspException("Error importing attributes. "+
Modified: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/InsertAttributeTag.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/InsertAttributeTag.java?view=diff&rev=521636&r1=521635&r2=521636
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/InsertAttributeTag.java (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/InsertAttributeTag.java Fri Mar 23 02:12:34 2007
@@ -22,8 +22,8 @@
package org.apache.tiles.jsp.taglib;
-import org.apache.tiles.ComponentAttribute;
-import org.apache.tiles.ComponentContext;
+import org.apache.tiles.Attribute;
+import org.apache.tiles.AttributeContext;
import org.apache.tiles.TilesException;
import javax.servlet.jsp.JspException;
@@ -53,7 +53,7 @@
/**
* The context used to evaluate the attribute.
*/
- protected ComponentContext evaluatingContext;
+ protected AttributeContext evaluatingContext;
/**
* Sets the name of the attribute.
@@ -100,7 +100,7 @@
/** {@inheritDoc} */
protected void render() throws JspException, TilesException, IOException {
- ComponentAttribute attr = (ComponentAttribute) value;
+ Attribute attr = (Attribute) value;
if (attr == null && evaluatingContext != null) {
attr = evaluatingContext.getAttribute(name);
}
@@ -123,7 +123,7 @@
protected void startContext(PageContext context) {
if (container != null) {
- evaluatingContext = container.getComponentContext(context);
+ evaluatingContext = container.getAttributeContext(context);
}
super.startContext(context);
}
@@ -136,7 +136,7 @@
* @throws IOException If something goes wrong during the reading of
* definition files.
*/
- protected void render(ComponentAttribute attr)
+ protected void render(Attribute attr)
throws TilesException, IOException {
container.render(attr, pageContext.getOut(), pageContext);
}
Modified: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/PutAttributeTag.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/PutAttributeTag.java?view=diff&rev=521636&r1=521635&r2=521636
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/PutAttributeTag.java (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/PutAttributeTag.java Fri Mar 23 02:12:34 2007
@@ -22,7 +22,7 @@
package org.apache.tiles.jsp.taglib;
-import org.apache.tiles.ComponentConstants;
+import org.apache.tiles.Constants;
import org.apache.tiles.jsp.taglib.PutAttributeTagParent;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -70,7 +70,7 @@
*
* @version $Rev$ $Date$
*/
-public class PutAttributeTag extends RoleSecurityTagSupport implements ComponentConstants {
+public class PutAttributeTag extends RoleSecurityTagSupport implements Constants {
/**
* The logging object.
@@ -78,7 +78,7 @@
private static final Log LOG = LogFactory.getLog(PutAttributeTag.class);
/**
- * Name of attribute to put in component context.
+ * Name of attribute to put in attribute context.
*/
protected String name = null;
Modified: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/PutListAttributeTag.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/PutListAttributeTag.java?view=diff&rev=521636&r1=521635&r2=521636
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/PutListAttributeTag.java (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/PutListAttributeTag.java Fri Mar 23 02:12:34 2007
@@ -22,7 +22,7 @@
package org.apache.tiles.jsp.taglib;
-import org.apache.tiles.ComponentAttribute;
+import org.apache.tiles.Attribute;
import java.util.ArrayList;
import java.util.List;
@@ -44,8 +44,8 @@
* @return The value of this list attribute.
*/
@SuppressWarnings("unchecked")
- public List<ComponentAttribute> getValue() {
- return (List<ComponentAttribute>) super.getValue();
+ public List<Attribute> getValue() {
+ return (List<Attribute>) super.getValue();
}
/** {@inheritDoc} */
@@ -57,7 +57,7 @@
/** {@inheritDoc} */
@Override
public int doStartTag() throws JspException {
- super.setValue(new ArrayList<ComponentAttribute>());
+ super.setValue(new ArrayList<Attribute>());
return super.doStartTag();
}
@@ -84,7 +84,7 @@
* Process nested ≶putAttribute> tag.
* <p/>
* Places the value of the nested tag within the
- * {@link org.apache.tiles.ComponentContext}.It is the responsibility
+ * {@link org.apache.tiles.AttributeContext}.It is the responsibility
* of the descendent to check security. Tags extending
* the {@link org.apache.tiles.jsp.taglib.ContainerTagSupport} will automatically provide
* the appropriate security.
@@ -92,7 +92,7 @@
* @param nestedTag the put tag desciendent.
*/
public void processNestedTag(AddAttributeTag nestedTag) {
- ComponentAttribute attribute = new ComponentAttribute(
+ Attribute attribute = new Attribute(
nestedTag.getValue(), nestedTag.getRole(),
nestedTag.getType());
@@ -104,7 +104,7 @@
*
* @param attribute The attribute to add.
*/
- private void addValue( ComponentAttribute attribute ) {
+ private void addValue( Attribute attribute ) {
this.getValue().add(attribute);
}
}
Modified: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/RenderTagSupport.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/RenderTagSupport.java?view=diff&rev=521636&r1=521635&r2=521636
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/RenderTagSupport.java (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/RenderTagSupport.java Fri Mar 23 02:12:34 2007
@@ -23,7 +23,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.tiles.ComponentAttribute;
+import org.apache.tiles.Attribute;
import org.apache.tiles.TilesException;
import org.apache.tiles.jsp.taglib.PutAttributeTag;
import org.apache.tiles.jsp.taglib.PutAttributeTagParent;
@@ -38,7 +38,7 @@
* Properly invokes the defined preparer and invokes the abstract
* render method upon completion.
* </p>
- * This tag takes special care to ensure that the component context is
+ * This tag takes special care to ensure that the attribute context is
* reset to it's original state after the execution of the tag is
* complete. This ensures that all all included attributes in subsequent
* tiles are scoped properly and do not bleed outside their intended
@@ -185,7 +185,7 @@
* Process nested ≶put> tag.
* <p/>
* Places the value of the nested tag within the
- * {@link org.apache.tiles.ComponentContext}.It is the responsibility
+ * {@link org.apache.tiles.AttributeContext}.It is the responsibility
* of the descendent to check security. Tags extending
* the {@link ContainerTagSupport} will automatically provide
* the appropriate security.
@@ -194,11 +194,11 @@
* @param nestedTag the put tag desciendent.
*/
public void processNestedTag(PutAttributeTag nestedTag) {
- ComponentAttribute attribute = new ComponentAttribute(
+ Attribute attribute = new Attribute(
nestedTag.getValue(), nestedTag.getRole(),
nestedTag.getType());
- componentContext.putAttribute(
+ attributeContext.putAttribute(
nestedTag.getName(),
attribute
);
Modified: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/UseAttributeTag.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/UseAttributeTag.java?view=diff&rev=521636&r1=521635&r2=521636
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/UseAttributeTag.java (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/UseAttributeTag.java Fri Mar 23 02:12:34 2007
@@ -32,8 +32,7 @@
/**
- * Exposes a component attribute as a scripting variable
- * within the page.
+ * Exposes am attribute as a scripting variable within the page.
*
* @since Tiles 1.0
* @version $Rev$ $Date$
@@ -75,7 +74,7 @@
/**
- * Expose the requested attribute from component context.
+ * Expose the requested attribute from attribute context.
*
* @throws JspException if a JSP exception has occurred
*/
Modified: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/definition/DefinitionTag.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/definition/DefinitionTag.java?view=diff&rev=521636&r1=521635&r2=521636
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/definition/DefinitionTag.java (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/definition/DefinitionTag.java Fri Mar 23 02:12:34 2007
@@ -21,7 +21,7 @@
*/
package org.apache.tiles.jsp.taglib.definition;
-import org.apache.tiles.ComponentAttribute;
+import org.apache.tiles.Attribute;
import org.apache.tiles.TilesContainer;
import org.apache.tiles.TilesException;
import org.apache.tiles.jsp.taglib.PutAttributeTag;
@@ -36,24 +36,12 @@
import java.util.HashMap;
/**
- * This is the tag handler for <tiles:definition>, which defines
- * a tiles (or template / component). TileDefinition is put in requested context and can be
- * used in <tiles:insert>.
+ * This is the tag handler for <tiles:definition>, which creates a custom
+ * definition. If the configured container is a {@link MutableTilesContainer},
+ * this newly created definition can be used in <tiles:insertDefinition>.
*
* @version $Rev$ $Date$
*/
-/**
- * @author PTRNTN77A26E506O
- *
- */
-/**
- * @author PTRNTN77A26E506O
- *
- */
-/**
- * @author PTRNTN77A26E506O
- *
- */
public class DefinitionTag extends TagSupport
implements PutAttributeTagParent {
@@ -92,7 +80,7 @@
/**
* Maps attribute names with their attributes.
*/
- private Map<String, ComponentAttribute> attributes;
+ private Map<String, Attribute> attributes;
/**
@@ -198,7 +186,7 @@
/** {@inheritDoc} */
public int doStartTag() throws JspException {
- attributes = new HashMap<String, ComponentAttribute>();
+ attributes = new HashMap<String, Attribute>();
TilesContainer c =
TilesAccess.getContainer(pageContext.getServletContext());
@@ -241,7 +229,7 @@
* @throws JspException Never thrown, it's here for API compatibility.
*/
public void processNestedTag(PutAttributeTag nestedTag) throws JspException {
- ComponentAttribute attr = new ComponentAttribute(nestedTag.getValue(),
+ Attribute attr = new Attribute(nestedTag.getValue(),
nestedTag.getRole(), nestedTag.getType());
attr.setName(nestedTag.getName());
attributes.put(nestedTag.getName(), attr);
Modified: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/package.html
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/package.html?view=diff&rev=521636&r1=521635&r2=521636
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/package.html (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/package.html Fri Mar 23 02:12:34 2007
@@ -28,8 +28,9 @@
<body bgcolor="white">
-<p> The "tiles-core" tag library contains tags that are useful in
- creating dynamic reusable components. </p>
+<p> The "tiles-jsp" tag library contains tags that are useful to create
+ templates, subpages other reusable view parts using the "tiles-core"
+ package. </p>
</body>
</html>
Modified: tiles/framework/trunk/tiles-jsp/src/main/resources/META-INF/tld/tiles-jsp.tld
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/resources/META-INF/tld/tiles-jsp.tld?view=diff&rev=521636&r1=521635&r2=521636
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/resources/META-INF/tld/tiles-jsp.tld (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/resources/META-INF/tld/tiles-jsp.tld Fri Mar 23 02:12:34 2007
@@ -759,7 +759,6 @@
</attribute>
</tag>
<tag>
- <!-- <name>initComponentDefinitions</name> -->
<name>initContainer</name>
<tag-class>org.apache.tiles.jsp.taglib.definition.InitContainerTag</tag-class>
<body-content>JSP</body-content>
Modified: tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/preparer/TestViewPreparer.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/preparer/TestViewPreparer.java?view=diff&rev=521636&r1=521635&r2=521636
==============================================================================
--- tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/preparer/TestViewPreparer.java (original)
+++ tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/preparer/TestViewPreparer.java Fri Mar 23 02:12:34 2007
@@ -23,8 +23,8 @@
import org.apache.tiles.preparer.ViewPreparer;
import org.apache.tiles.context.TilesRequestContext;
-import org.apache.tiles.ComponentContext;
-import org.apache.tiles.ComponentAttribute;
+import org.apache.tiles.AttributeContext;
+import org.apache.tiles.Attribute;
/**
* A simple test <code>ViewPreparer</code>.
@@ -34,10 +34,10 @@
public class TestViewPreparer implements ViewPreparer {
/** {@inheritDoc} */
- public void execute(TilesRequestContext tilesContext, ComponentContext componentContext)
+ public void execute(TilesRequestContext tilesContext, AttributeContext attributeContext)
throws Exception {
- componentContext.putAttribute(
+ attributeContext.putAttribute(
"body",
- new ComponentAttribute("This is the value added by the ViewPreparer"));
+ new Attribute("This is the value added by the ViewPreparer"));
}
}
Modified: tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/servlet/SelectLocaleServlet.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/servlet/SelectLocaleServlet.java?view=diff&rev=521636&r1=521635&r2=521636
==============================================================================
--- tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/servlet/SelectLocaleServlet.java (original)
+++ tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/servlet/SelectLocaleServlet.java Fri Mar 23 02:12:34 2007
@@ -33,7 +33,7 @@
import org.apache.tiles.TilesContainer;
import org.apache.tiles.TilesException;
import org.apache.tiles.access.TilesAccess;
-import org.apache.tiles.ComponentConstants;
+import org.apache.tiles.Constants;
/**
* Servlet able to let a user choose a locale.
@@ -81,7 +81,7 @@
locale = new Locale(localeStrings[0], localeStrings[1], localeStrings[2]);
}
}
- session.setAttribute(ComponentConstants.LOCALE_KEY, locale);
+ session.setAttribute(Constants.LOCALE_KEY, locale);
TilesContainer container = TilesAccess.getContainer(request
.getSession().getServletContext());
try {