You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by hl...@apache.org on 2007/03/02 19:07:36 UTC
svn commit: r513873 [1/2] - in /tapestry/tapestry5/tapestry-core/trunk/src:
main/java/org/apache/tapestry/internal/parser/
main/java/org/apache/tapestry/internal/services/
main/resources/org/apache/tapestry/
main/resources/org/apache/tapestry/corelib/c...
Author: hlship
Date: Fri Mar 2 10:07:33 2007
New Revision: 513873
URL: http://svn.apache.org/viewvc?view=rev&rev=513873
Log:
TAPESTRY-1311: Replace <t:comp> element with <t:componentType>.
Added:
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/internal/services/complex_component_type.html
Removed:
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/internal/services/component_without_id_or_type.html
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/internal/services/unexpected_element_in_tapestry_namespace.html
Modified:
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/parser/StartComponentToken.java
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/PageLoaderProcessor.java
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/ServicesMessages.java
tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/TemplateParserImpl.java
tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/corelib/components/BeanEditForm.html
tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/corelib/components/Grid.html
tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/corelib/components/GridColumns.html
tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/corelib/components/GridRows.html
tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/corelib/pages/ExceptionReport.html
tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/default.css
tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/internal/services/ServicesStrings.properties
tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/internal/services/tapestry_5_0_0.xsd
tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/assets.apt
tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/coercion.apt
tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/conf.apt
tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/event.apt
tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/localization.apt
tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/pagenav.apt
tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/parameters.apt
tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/templates.apt
tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/validation.apt
tapestry/tapestry5/tapestry-core/trunk/src/site/apt/index.apt
tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/AnyDemo.html
tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/BeanEditorDemo.html
tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/BlockDemo.html
tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/ClassLoaderInspect.html
tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/GridDemo.html
tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/PasswordFieldDemo.html
tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/RenderComponentDemo.html
tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/SimpleForm.html
tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/SimpleTrackGridDemo.html
tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/Target.html
tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/ToDoList.html
tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/ToDoListVolatile.html
tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/ViewRegistration.html
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/IntegrationTests.java
tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/TemplateParserImplTest.java
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/ActionPage.html
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/AssetDemo.html
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/BadTemplate.html
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/Barney.html
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/Countdown.html
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/EnvironmentalDemo.html
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/Expansion.html
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/Fred.html
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/InjectComponentMismatch.html
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/InjectDemo.html
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/InstanceMixin.html
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/Localization.html
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/MerryChristmas.html
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/NumberSelect.html
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/ParameterConflict.html
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/ParameterDefault.html
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/RenderPhaseOrder.html
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/ShowSelection.html
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/ValidForm.html
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/Wilma.html
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app2/pages/TestPageForActionLink.html
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app2/pages/TestPageForForm.html
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app2/pages/TestPageForIf.html
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app2/pages/TestPageForLoop.html
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app2/pages/TestPageForSubmit.html
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/internal/services/component.html
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/internal/services/componentWithBody.html
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/internal/services/componentWithParameters.html
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/internal/services/component_ids.html
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/internal/services/component_with_mixins.html
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/internal/services/empty_string_mixins_is_null.html
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/internal/services/parameter_element.html
tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/internal/services/root_element_is_component.html
Modified: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/parser/StartComponentToken.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/parser/StartComponentToken.java?view=diff&rev=513873&r1=513872&r2=513873
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/parser/StartComponentToken.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/parser/StartComponentToken.java Fri Mar 2 10:07:33 2007
@@ -28,7 +28,7 @@
private final String _id;
- private final String _type;
+ private final String _componentType;
private final String _mixins;
@@ -55,7 +55,7 @@
_elementName = elementName;
_id = id;
- _type = type;
+ _componentType = type;
_mixins = mixins;
}
@@ -84,9 +84,9 @@
* Returns a non-blank component type if one was provided in the template. If the type attribute
* was missing (or the value was blank), returns null.
*/
- public String getType()
+ public String getComponentType()
{
- return _type;
+ return _componentType;
}
@Override
@@ -96,7 +96,7 @@
add(builder, "element", _elementName);
add(builder, "id", _id);
- add(builder, "type", _type);
+ add(builder, "type", _componentType);
add(builder, "mixins", _mixins);
builder.insert(0, "StartComponentToken[");
Modified: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/PageLoaderProcessor.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/PageLoaderProcessor.java?view=diff&rev=513873&r1=513872&r2=513873
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/PageLoaderProcessor.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/PageLoaderProcessor.java Fri Mar 2 10:07:33 2007
@@ -524,7 +524,7 @@
String elementName = token.getElementName();
// Initial guess: the type from the token (but this may be null in many cases).
- String embeddedType = token.getType();
+ String embeddedType = token.getComponentType();
String embeddedId = token.getId();
Modified: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/ServicesMessages.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/ServicesMessages.java?view=diff&rev=513873&r1=513872&r2=513873
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/ServicesMessages.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/ServicesMessages.java Fri Mar 2 10:07:33 2007
@@ -156,10 +156,6 @@
return MESSAGES.format("non-private-fields", className, InternalUtils.joinSorted(names));
}
- static String compRequiresIdOrType()
- {
- return MESSAGES.get("comp-requires-id-or-type");
- }
static String compTypeConflict(String embeddedId, String templateType, String modelType)
{
@@ -332,10 +328,6 @@
.getClass()), InternalUtils.joinSorted(classNames));
}
- static String undefinedTapestryElement(String elementName)
- {
- return MESSAGES.format("undefined-tapestry-element", elementName);
- }
static String undefinedTapestryAttribute(String elementName, String attributeName,
String allowedAttributeName)
Modified: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/TemplateParserImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/TemplateParserImpl.java?view=diff&rev=513873&r1=513872&r2=513873
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/TemplateParserImpl.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/internal/services/TemplateParserImpl.java Fri Mar 2 10:07:33 2007
@@ -285,85 +285,7 @@
// TODO: Handle interpolations inside attributes?
- startStaticElement(localName, attributes);
- }
-
- private void startStaticElement(String localName, Attributes attributes)
- {
- Location location = getCurrentLocation();
-
- List<TemplateToken> attributeTokens = newList();
-
- int count = attributes.getLength();
-
- String id = null;
- String type = null;
- String mixins = null;
-
- for (int i = 0; i < count; i++)
- {
- String name = attributes.getLocalName(i);
-
- // The name will be blank for an xmlns: attribute
-
- if (InternalUtils.isBlank(name))
- continue;
-
- String uri = attributes.getURI(i);
-
- String value = attributes.getValue(i);
-
- if (TAPESTRY_SCHEMA_5_0_0.equals(uri))
- {
- if (InternalUtils.isNonBlank(value))
- {
- if (name.equals(ID_ATTRIBUTE_NAME))
- {
- id = value;
- continue;
- }
-
- if (name.equals(TYPE_ATTRIBUTE_NAME))
- {
- type = value;
- continue;
- }
-
- if (name.equals(MIXINS_ATTRIBUTE_NAME))
- {
- mixins = value;
- continue;
- }
-
- // Anything else is the name of a Tapestry component parameter that is simply
- // not part of the template's doctype for the element being instrumented.
- }
- }
-
- attributeTokens.add(new AttributeToken(name, value, location));
- }
-
- boolean isComponent = (id != null || type != null);
-
- // If provided t:mixins but not t:id or t:type, then its not quite a component
-
- if (mixins != null && !isComponent)
- throw new TapestryException(ServicesMessages.mixinsInvalidWithoutIdOrType(localName),
- location, null);
-
- if (isComponent)
- {
- _tokens.add(new StartComponentToken(localName, id, type, mixins, location));
- }
- else
- {
- _tokens.add(new StartElementToken(localName, location));
- }
-
- _tokens.addAll(attributeTokens);
-
- if (id != null)
- _componentIds.add(id);
+ startPossibleComponent(attributes, localName, null);
}
/**
@@ -390,32 +312,32 @@
private void startTapestryElement(String qname, String localName, Attributes attributes)
{
- if (localName.equals("comp"))
- {
- startComponent(attributes);
- return;
- }
-
- if (localName.equals("body"))
+ if (localName.equalsIgnoreCase("body"))
{
startBody();
return;
}
- if (localName.equals("parameter"))
+ if (localName.equalsIgnoreCase("parameter"))
{
startParameter(attributes);
return;
}
- if (localName.equals("block"))
+ if (localName.equalsIgnoreCase("block"))
{
startBlock(attributes);
return;
}
- throw new TapestryException(ServicesMessages.undefinedTapestryElement(qname),
- getCurrentLocation(), null);
+ // The component type is derived from the element name. Since element names may not contain
+ // slashes, we convert periods to slashes. Later down the pipeline, they'll probably be
+ // converted back into periods, as part of a fully qualified class name.
+
+ String componentType = localName.replace('.', '/');
+
+ // With a component type specified, it's not just possibly a component ...
+ startPossibleComponent(attributes, null, componentType);
}
private void startBlock(Attributes attributes)
@@ -464,10 +386,26 @@
return result;
}
- private void startComponent(Attributes attributes)
+ private String nullForBlank(String input)
+ {
+ return InternalUtils.isBlank(input) ? null : input;
+ }
+
+ /**
+ * @param attributes
+ * the attributes for the element
+ * @param elementName
+ * the name of the element (to be assigned to the new token), may be null for a
+ * component in the Tapestry namespace
+ * @param identifiedType
+ * the type of the element, usually null, but may be the component type derived from
+ * the element name (for an element in the Tapestry namespace)
+ */
+ private void startPossibleComponent(Attributes attributes, String elementName,
+ String identifiedType)
{
String id = null;
- String type = null;
+ String type = identifiedType;
String mixins = null;
int count = attributes.getLength();
Location location = getCurrentLocation();
@@ -476,50 +414,64 @@
for (int i = 0; i < count; i++)
{
String name = attributes.getLocalName(i);
- String value = attributes.getValue(i);
- // TODO: Validate that the id is a reasonable string.
+ // The name will be blank for an xmlns: attribute
- if (name.equals(ID_ATTRIBUTE_NAME))
- {
- if (InternalUtils.isNonBlank(value))
- id = value;
+ if (InternalUtils.isBlank(name))
continue;
- }
- if (name.equals(TYPE_ATTRIBUTE_NAME))
- {
+ String uri = attributes.getURI(i);
- if (InternalUtils.isNonBlank(value))
- type = value;
- continue;
- }
+ String value = attributes.getValue(i);
- if (name.equals(MIXINS_ATTRIBUTE_NAME))
+ if (TAPESTRY_SCHEMA_5_0_0.equals(uri))
{
- if (InternalUtils.isNonBlank(value))
- mixins = value;
- continue;
- }
+ if (name.equalsIgnoreCase(ID_ATTRIBUTE_NAME))
+ {
+ id = nullForBlank(value);
+ continue;
+ }
- // The name will be blank for an xmlns: attribute; we sometimes see this
- // in the root element if the root element is a component.
+ if (type == null && name.equalsIgnoreCase(TYPE_ATTRIBUTE_NAME))
+ {
+ type = nullForBlank(value);
+ continue;
+ }
- if (name.equals(""))
- continue;
+ if (name.equalsIgnoreCase(MIXINS_ATTRIBUTE_NAME))
+ {
+ mixins = nullForBlank(value);
+ continue;
+ }
+
+ // Anything else is the name of a Tapestry component parameter that is simply
+ // not part of the template's doctype for the element being instrumented.
+ }
attributeTokens.add(new AttributeToken(name, value, location));
}
- if (id == null && type == null)
- throw new TapestryException(ServicesMessages.compRequiresIdOrType(), location, null);
+ boolean isComponent = (id != null || type != null);
- if (id != null)
- _componentIds.add(id);
+ // If provided t:mixins but not t:id or t:type, then its not quite a component
+
+ if (mixins != null && !isComponent)
+ throw new TapestryException(ServicesMessages.mixinsInvalidWithoutIdOrType(elementName),
+ location, null);
+
+ if (isComponent)
+ {
+ _tokens.add(new StartComponentToken(elementName, id, type, mixins, location));
+ }
+ else
+ {
+ _tokens.add(new StartElementToken(elementName, location));
+ }
- // Add the component
- _tokens.add(new StartComponentToken(null, id, type, mixins, location));
_tokens.addAll(attributeTokens);
+
+ if (id != null)
+ _componentIds.add(id);
}
private void startBody()
Modified: tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/corelib/components/BeanEditForm.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/corelib/components/BeanEditForm.html?view=diff&rev=513873&r1=513872&r2=513873
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/corelib/components/BeanEditForm.html (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/corelib/components/BeanEditForm.html Fri Mar 2 10:07:33 2007
@@ -1,10 +1,10 @@
<form t:id="form" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
- <t:comp type="Errors"/>
+ <t:errors/>
<div class="t-beaneditor">
<div class="t-beaneditor-row" t:type="Loop" t:source="model.propertyNames"
t:value="propertyName">
- <t:comp type="Delegate" to="blockForProperty"/>
+ <t:delegate to="blockForProperty"/>
</div>
<div class="t-beaneditor-row">
<input t:type="Submit" type="submit" value="prop:submitLabel"/>
@@ -17,12 +17,12 @@
</t:block>
<t:block id="enum">
- <label t:type="Label" for="select"/>
+ <t:label for="select"/>
<input t:id="select"/>
</t:block>
<t:block id="checkbox">
- <label t:type="Label" for="checkboxField"/>
+ <t:label for="checkboxField"/>
<input t:id="checkboxField"/>
</t:block>
</form>
Modified: tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/corelib/components/Grid.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/corelib/components/Grid.html?view=diff&rev=513873&r1=513872&r2=513873
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/corelib/components/Grid.html (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/corelib/components/Grid.html Fri Mar 2 10:07:33 2007
@@ -1,18 +1,18 @@
<div class="t-data-grid" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
- <t:comp id="pagerTop"/>
+ <div t:id="pagerTop"/>
<table class="t-data-grid">
<thead t:id="columns"/>
<tbody>
- <t:comp id="rows"/>
+ <tr t:id="rows"/>
</tbody>
</table>
- <t:comp id="pagerBottom"/>
+ <div t:id="pagerBottom"/>
<t:block>
- <t:comp id="pager"/>
+ <div t:id="pager"/>
</t:block>
<t:block id="empty"> There is no data to display. </t:block>
Modified: tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/corelib/components/GridColumns.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/corelib/components/GridColumns.html?view=diff&rev=513873&r1=513872&r2=513873
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/corelib/components/GridColumns.html (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/corelib/components/GridColumns.html Fri Mar 2 10:07:33 2007
@@ -2,11 +2,11 @@
<tr>
<th t:type="Loop" source="columnNames" value="columnName" volatile="true" class="prop:cellClass">
<a t:id="sort">${columnModel.label}</a>
- <t:comp type="If" test="activeSortColumn">
+ <t:if test="activeSortColumn">
<a t:id="sort2">
- <img t:type="Img" src="icon" class="t-sort-icon" alt="prop:iconLabel"/>
+ <t:img src="icon" class="t-sort-icon" alt="prop:iconLabel"/>
</a>
- </t:comp>
+ </t:if>
</th>
</tr>
</thead>
Modified: tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/corelib/components/GridRows.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/corelib/components/GridRows.html?view=diff&rev=513873&r1=513872&r2=513873
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/corelib/components/GridRows.html (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/corelib/components/GridRows.html Fri Mar 2 10:07:33 2007
@@ -1,7 +1,7 @@
<tr t:id="row" class="prop:rowClass" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
- <t:comp type="loop" source="propertyNames" value="propertyName" volatile="true">
+ <t:loop source="propertyNames" value="propertyName" volatile="true">
<td t:id="cell" class="prop:cellClass">
- <t:comp type="GridCell" model="columnModel" row="row" resources="componentResources.containerResources"/>
+ <t:gridcell model="columnModel" row="row" resources="componentResources.containerResources"/>
</td>
- </t:comp>
+ </t:loop>
</tr>
Modified: tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/corelib/pages/ExceptionReport.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/corelib/pages/ExceptionReport.html?view=diff&rev=513873&r1=513872&r2=513873
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/corelib/pages/ExceptionReport.html (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/corelib/pages/ExceptionReport.html Fri Mar 2 10:07:33 2007
@@ -1,61 +1,60 @@
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
- <head>
- <title>An Exception Has Occurred</title>
- </head>
- <body>
- <h1 class="t-exception-report">A runtime exception has occurred.</h1>
-
+ <head>
+ <title>Application Exception</title>
+ </head>
+ <body>
+ <h1 class="t-exception-report">An unexpected application exception has occurred.</h1>
- <div class="t-exception-report">
- <ul>
- <t:comp type="Loop" source="stack" value="info">
- <li>
- <span class="t-exception-class-name">${info.className}</span>
- <t:comp type="If" test="info.message">
- <div class="t-exception-message">
- ${info.message}
- </div>
- </t:comp>
+ <div class="t-exception-report">
+ <ul>
+ <t:loop source="stack" value="info">
+ <li>
+ <span class="t-exception-class-name">${info.className}</span>
- <t:comp type="If" test="showPropertyList">
- <dl>
- <t:comp type="Loop" source="info.propertyNames" value="propertyName">
- <dt>${propertyName}</dt>
- <dd>
- <t:comp type="renderobject" object="propertyValue"/>
- </dd>
- </t:comp>
- <t:comp type="If" test="info.stackTrace">
- <dt>Stack trace</dt>
- <dd>
- <ul class="t-stack-trace">
- <t:comp type="Loop" source="info.stackTrace"
- value="frame">
- <li>${frame}</li>
- </t:comp>
- </ul>
- </dd>
- </t:comp>
- </dl>
- </t:comp>
- </li>
- </t:comp>
- </ul>
- </div>
- <div class="t-env-data">
- <h2>Request</h2>
- <t:comp type="renderobject" object="request"/>
-
- <t:comp type="If" test="hasSession">
- <h2>Session</h2>
- <dl>
- <t:comp type="Loop" source="session.attributeNames" value="attributeName">
- <dt>${attributeName}</dt>
- <dd><t:comp type="renderobject" object="attributeValue"/></dd>
- </t:comp>
- </dl>
- </t:comp>
- </div>
- </body>
+ <t:if test="info.message">
+ <div class="t-exception-message">${info.message}</div>
+ </t:if>
+
+ <t:if test="showPropertyList">
+ <dl>
+ <t:loop source="info.propertyNames" value="propertyName">
+ <dt>${propertyName}</dt>
+ <dd>
+ <t:renderobject object="propertyValue"/>
+ </dd>
+ </t:loop>
+ <t:if test="info.stackTrace">
+ <dt>Stack trace</dt>
+ <dd>
+ <ul class="t-stack-trace">
+ <t:loop source="info.stackTrace" value="frame">
+ <li>${frame}</li>
+ </t:loop>
+ </ul>
+ </dd>
+ </t:if>
+ </dl>
+ </t:if>
+ </li>
+ </t:loop>
+ </ul>
+ </div>
+ <div class="t-env-data">
+ <h2>Request</h2>
+ <t:renderobject object="request"/>
+
+ <t:if test="hasSession">
+ <h2>Session</h2>
+ <dl>
+ <t:loop source="session.attributeNames" value="attributeName">
+ <dt>${attributeName}</dt>
+ <dd>
+ <t:renderobject object="attributeValue"/>
+ </dd>
+ </t:loop>
+ </dl>
+ </t:if>
+ </div>
+ </body>
</html>
Modified: tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/default.css
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/default.css?view=diff&rev=513873&r1=513872&r2=513873
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/default.css (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/default.css Fri Mar 2 10:07:33 2007
@@ -111,8 +111,9 @@
TABLE.t-data-table
{
+ border-collapse: collapse;
margin: 0px;
- padding: 2px;
+ padding: 2px;
}
Modified: tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/internal/services/ServicesStrings.properties
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/internal/services/ServicesStrings.properties?view=diff&rev=513873&r1=513872&r2=513873
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/internal/services/ServicesStrings.properties (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/internal/services/ServicesStrings.properties Fri Mar 2 10:07:33 2007
@@ -40,7 +40,6 @@
non-private-fields=Class %s contains field(s) (%s) that are not private. Tapestry will ignore these fields, even if they \
have annotations. Runtime behavior, especially in production, may not be what you expect. \
You should change these fields to private, and add accessor methods if needed.
-comp-requires-id-or-type=The <comp> element requires either an id or a type attribute to be specified.
mixins-invalid-without-id-or-type=You may not specify mixins for element <%s> because it does not represent a component (which requires either an id attribute or a type attribute).
comp-type-conflict=Embedded component '%s' provides a type attribute in the template ('%s') as well as in the component class ('%s'). \
You should not provide a type attribute in the template when defining an embedded component within the component class.
@@ -70,7 +69,6 @@
unknown-translator-type=Unknown translator type '%s'. Configured translators are %s.
missing-from-environment=No object of type %s is available from the Environment. Available types are %s.
invalid-component-event-result=An event handler for component %s returned the value %s (from method %s). Return type %s can not be handled. Configured return types are %s.
-undefined-tapestry-element=Element <%s> is in the Tapestry namespace, but is not a recognized Tapestry template element.
undefined-tapestry-attribute=Element <%s> does not support an attribute named '%s'. The only allowed attribute name is '%s'.
parameter-element-name-required=The name attribute of the <parameter> element must be specified.
missing-application-state-persistence-strategy=No application state persistence strategy is available with name '%s'. Available strategies: %s.
Modified: tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/internal/services/tapestry_5_0_0.xsd
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/internal/services/tapestry_5_0_0.xsd?view=diff&rev=513873&r1=513872&r2=513873
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/internal/services/tapestry_5_0_0.xsd (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/internal/services/tapestry_5_0_0.xsd Fri Mar 2 10:07:33 2007
@@ -1,47 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"
- targetNamespace="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
- <xs:element name="comp">
- <xs:annotation>
- <xs:documentation> A component within the template. Allows any attributes, these are
- bound to parameters of the component. A component will have either an id, a type, or
- both (they are both optional, with the requirement for one or the other implemented
- internally). </xs:documentation>
- </xs:annotation>
- <xs:complexType mixed="true">
- <xs:attribute name="id" type="xs:ID">
- <xs:annotation>
- <xs:documentation> A unique identifier for the component within the template. If the type
- is omitted, Tapestry will provide a unique id for the component.
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:attribute name="type" type="xs:string">
- <xs:annotation>
- <xs:documentation>
- The name of a component type. This is optional, as the type may be determined elsewhere
- or otherwise defaulted by Tapestry.
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:attribute name="mixins" type="xs:string">
- <xs:annotation>
- <xs:documentation>
- A comma-seperated list of mixin type names. Mixins are optional and provide additional
- functionality to the base component.
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:anyAttribute>
- <xs:annotation>
- <xs:documentation>
- Any additional attributes are used to bind parameters of the component (or of mixins of the component).
- </xs:documentation>
- </xs:annotation>
- </xs:anyAttribute>
- </xs:complexType>
- </xs:element>
+ targetNamespace="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
<!-- body identifies where the body of the component belongs within the component's template -->
<xs:element name="body">
<xs:annotation>
@@ -73,8 +33,8 @@
<xs:element name="block">
<xs:annotation>
<xs:documentation>
- A block is simply a container of other elements. Blocks do not render themselves or their bodies normally, unless
- specifically directed to.
+ A block is simply a container of other elements. Blocks do not render themselves or their bodies in the normal flow; they
+ only get rendered when specifially directed to.
</xs:documentation>
</xs:annotation>
<xs:complexType>
Modified: tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/assets.apt
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/assets.apt?view=diff&rev=513873&r1=513872&r2=513873
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/assets.apt (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/assets.apt Fri Mar 2 10:07:33 2007
@@ -30,6 +30,11 @@
the "classpath:" domain. This is often used when creating component libraries, where the assets used by the components
are packaged in the JAR with the components themselves.
+ Unlike elsewhere in Tapestry, <case matters>. This is because Tapestry is dependenent on the Servlet API and the Java runtime
+ to access the underlying files, and those APIs, unlike Tapestry, are case sensitive. Be aware that some <operating systems> (such as Windows)
+ are case insenitive, which may mask errors that will be revealed at deployment (if the deployment operating system is case sensitive,
+ such as Linux).
+
Relative Assets
You can use relative paths with domains (if you omit the prefix):
Modified: tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/coercion.apt
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/coercion.apt?view=diff&rev=513873&r1=513872&r2=513873
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/coercion.apt (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/coercion.apt Fri Mar 2 10:07:33 2007
@@ -31,7 +31,7 @@
However, it is likely that the component will be used as so:
+---+
- Merry Christmas: <t:comp type="Count" end="3"> Ho! </t:comp>
+ Merry Christmas: <t:count end="3"> Ho! </t:count>
+---+
A bare whole number is interpreted by the prop binding prefix as a long. So this is the <long> value 3.
Modified: tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/conf.apt
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/conf.apt?view=diff&rev=513873&r1=513872&r2=513873
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/conf.apt (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/conf.apt Fri Mar 2 10:07:33 2007
@@ -95,7 +95,7 @@
[tapestry.scriptaculous]
The path to the embedded copy of {{{http://script.taculo.us}script.taculo.us}} packaged with Tapestry. This value may be overridden
- to use a different version of the script.taculo.us library. Tapestry's default version if 1.7.0.
+ to use a different version of the script.taculo.us library. Tapestry's default version is 1.7.0 (including Prototype 1.5.0).
[tapestry.supported-locales]
A comma-separated list of supported locales. Incoming requests as "narrowed" to one of these locales, based on closest match.
Modified: tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/event.apt
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/event.apt?view=diff&rev=513873&r1=513872&r2=513873
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/event.apt (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/event.apt Fri Mar 2 10:07:33 2007
@@ -44,9 +44,9 @@
<p> Choose a number from 1 to 10: </p>
<p>
- <t:comp type="Count" end="10" value="index">
+ <t:count end="10" value="index">
<a t:id="select" t:type="actionlink" context="index">${index}</t:comp>
- </t:comp>
+ </t:count>
</p>
+---+
Modified: tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/localization.apt
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/localization.apt?view=diff&rev=513873&r1=513872&r2=513873
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/localization.apt (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/localization.apt Fri Mar 2 10:07:33 2007
@@ -25,6 +25,8 @@
localization for just French as spoken in France, you could create <<<MyPage_fr_FR.properties>>> (thats a language code plus a country code, you can even go further
and add variants ... but its unlikely that you'll ever need to go beyond just language codes in practice).
+ The messages in the catalog are accessed by keys. Tapestry ignores the case of the keys when accessing messages in the catalog.
+
Message Catalog Inheritance
If a component class is a subclass of another component class, then it inherits that base class' message catalog. Its own message catalog extends and overrides
@@ -57,12 +59,12 @@
In the first case, you may use the message: binding prefix with component parameters, or with template expansions:
+-----+
-<t:comp type="Border" title="message:page-title">
+<t:layout title="message:page-title">
${message:greeting}, ${user.name}!
. . .
-</t:comp>
+</t:layout>
+-----+
Here, the <<<page-title>>> message is extracted from the catalog and passed to the Border component's title parameter.
@@ -113,12 +115,13 @@
+----+
As easy as conditionals are to do inside a Tapestry template, sometimes its even easier to do it in Java code.
+
Missing Keys
If you reference a key that is not in the message catalog, Tapestry does not throw an exception (that would make initially developing
- an application very frustrating). Instead, it converts the key to upper case, surrounds it in brackets, and returns it. You'll sometimes
- see output such as <<<[NO-ITMS]>>> in your output when a key (here, "no-itms") is misspelled.
+ an application very frustrating). When a key can not be located, a "placeholder" message is generated, such as "[[missing key: key-not-found]]".
+
Reloading
Modified: tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/pagenav.apt
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/pagenav.apt?view=diff&rev=513873&r1=513872&r2=513873
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/pagenav.apt (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/pagenav.apt Fri Mar 2 10:07:33 2007
@@ -162,9 +162,9 @@
ProductListing.html:
+---+
- <t:comp id="loop" source="products" value="product">
+ <t:loop source="products" value="product">
<a t:type="actionlink" t:id="select" context="product.id">${product.name}</a>
- </t:comp>
+ </t:loop>
+---+
ProductListing.java:
@@ -252,9 +252,9 @@
ProductListing.html:
+---+
- <t:comp id="loop" source="products" value="product">
+ <t:loop source="products" value="product">
<a t:type="pagelink" page="productdetails" context="product.id">${product.name}</a>
- </t:comp>
+ </t:loop>
+---+
ProductListing.java:
Modified: tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/parameters.apt
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/parameters.apt?view=diff&rev=513873&r1=513872&r2=513873
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/parameters.apt (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/parameters.apt Fri Mar 2 10:07:33 2007
@@ -86,13 +86,13 @@
{{{templates.html}template}}:
+---+
-<t:comp type="Border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
- <p> Merry Christmas: <t:comp type="Count" end="3"> Ho! </t:comp>
+<html t:type="layout" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+ <p> Merry Christmas: <t:count end="3"> Ho! </t:comp>
</p>
-</t:comp>
+</html>
+---+
- Inside the \<comp\> element, the end attribute is used to <bind> the end parameter of the
+ The end attribute is used to <bind> the end parameter of the
Count component. Here, it is being bound to the string value "3", which is automatically
{{{coercion.html}coerced}} by Tapestry into the int value, 3.
@@ -234,13 +234,13 @@
to its own instance variable.
+---+
-<t:comp type="Border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+<t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
<p> Countdown:
- <t:comp type="Count" start="5" end="1" value="index">
+ <t:count start="5" end="1" value="index">
${index} ...
- </t:comp>
+ </t:count>
</p>
-</t:comp>
+</t:layout>
+---+
Because the Count component updates its value parameter (the _value field), the index property
Modified: tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/templates.apt
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/templates.apt?view=diff&rev=513873&r1=513872&r2=513873
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/templates.apt (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/templates.apt Fri Mar 2 10:07:33 2007
@@ -73,49 +73,6 @@
All other elements should be in the default namespace, with no prefix.
-* \<comp\>
-
- The \<comp\> element is used to identify an <embedded component> within the template.
-
- Embedded components have three parameters:
-
- * id: A unique id for the component (within its container).
-
- * type: Used to identify the type of the component; this is typically a partial class name (details below).
-
- * mixins: An optional comma seperated list of mixins for the the component.
-
- []
-
- Either id or type <<must>> be specified.
-
- If the id attribute is ommitted, Tapestry will assign a unique id for the element.
-
- The type attribute is optional; when not specified, Tapestry will expect the class to define
- the type of the component (with
- {{{component-classes.html#Embedded Components}a Component annotation}}).
-
- Additional attributes are used to {{{parameters.html}bind parameters of the component}}. These may be formal parameters
- or informal parameters. Formal parameters will have a default binding prefix (usually "prop:"). Informal parameters
- will be assumed to be literals (i.e., the "literal:" binding prefix).
-
- The \<comp\> element defines where, within the containing component's template, the embedded component is active.
-
- It also defines the <<body>> of the embedded component, the portion of the template enclosed by the open and close
- \<comp\> tags.
-
- The following example presumes a component, "Count" that iterates from a start value (which defaults to 1) to
- an end value (here specified as 3), rendering its body on each iteration:
-
-+----+
-<p>
- Merry Christmas:
- <t:comp type="Count" end="3">
- Ho!
- </t:comp>
-</p>
-+---+
-
* \<body\>
In many cases, a component is designed to integrate its template with its container's
@@ -126,7 +83,7 @@
Components have control over if, and even how often, their body is rendered.
- The following example is a Border component, that adds basic HTML elements
+ The following example is a Layout component, that adds basic HTML elements
around the page specific content:
+---+
@@ -143,11 +100,11 @@
A page would use this component as follow:
+---+
-<t:comp type="Border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+<t:layout xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
My Page Specific Content
-</t:comp >
+</t:layout>
+---+
When the page renders, the page's template and the Border component's template
@@ -184,39 +141,15 @@
Example:
+---+
-<t:comp type="If" test="loggedIn">
+<t:if test="loggedIn">
Hello, ${userName}!
<t:parameter name="else">
- Click <a t:type="ActionLink" t:id="login">here</a> to log in.
+ Click <a t:type="actionlink" t:id="login">here</a> to log in.
</t:parameter>
-</t:comp>
+</t:if>
+---+
-
-Invisible Instrumentation
- A favorite feature of Tapestry 4 is <invisible instrumentation>, the ability to mark ordinary HTML elements as components. Invisible instrumentation
- leads to more concise templates that are also more readable.
-
- For Tapestry 5, you make use of <namespaced> id or type attributes to mark an element as a component, for example:
-
-+---+
-<p>
- Merry Christmas:
- <span t:type="Count" end="3">
- Ho!
- </span>
-</p>
-+---+
- The id, type and mixins attributes must be placed in the Tapestry namespace. Any additional attributes may be in the Tapestry namespace
- or in the default namespace. Placing an attribute in the Tapestry namespace is useful when the attribute is not defined for the
- element being instrumented.
-
- It is valid to specify just the t:id attribute and not supply a specific type in either the template or in the containing class.
- In this situation, Tapestry will make use of the
- {{{../apidocs/org/apache/tapestry/corelib/components/Any.html}Any}} component, a kind of placeholder for any kind of element
- whatsoever.
-
Expansions
Another option when rendering output is the use of <expansions>. Expansions
@@ -241,6 +174,108 @@
Tapestry 4 users will note that expansions are a concise, easy replacement for the
Insert component, and for the \<span key="..."\> directive.
+
+Component Elements
+
+ An embedded component is identified within the template as an element in the t: namespace. Example:
+
++---+
+ You have ${cartItems.size()} items in your cart.
+ <t:actionlink t:id="clear">Remove All</t:actionlink>.
++---+
+
+ The element name, "actionlink" is used to select the type of component, "ActionLink" (Tapestry is case insensitive about
+ cmponent types).
+
+ Embedded components may have two Tapestry-specific parameters:
+
+ * id: A unique id for the component (within its container).
+
+ * mixins: An optional comma seperated list of mixins for the the component.
+
+ []
+
+ These attributes are specified inside the t: namespace (i.e., <<<t:id="clear">>>).
+
+ If the id attribute is ommitted, Tapestry will assign a unique id for the element.
+
+
+ Any other attributes are used to {{{parameters.html}bind parameters of the component}}. These may be formal parameters
+ or informal parameters. Formal parameters will have a default binding prefix (usually "prop:"). Informal parameters
+ will be assumed to be literals (i.e., the "literal:" binding prefix).
+
+ Use of the t: prefix is optional for all other attributes. Some users implement a build process where the Tapestry template
+ files are validated ... in that case, any Tapestry-specific attributes, not defined by the underlying DTD or schema, should be in
+ the Tapestry namespace, to avoid validation errors.
+
+ The open and close tags of a Tapestry component element define the <<body>> of the component. It is quite common for
+ additional components to be <<enclosed>> in the body of another component:
+
++----+
+<t:form>
+ <t:errors/>
+ <t:label for="userId"/>
+ <t:textfield t:id="userId"/>
+ <br/>
+ <t:table for="password"/>
+ <t:passwordfield t:id="password"/>
+ <br/>
+ <input type="submit" value="Login"/>
+</t:form>
++---+
+
+ In some cases, components require some kind of enclosure; for example, all of the field components will throw a runtime exception
+ if not enclosed by a Form component.
+
+ It is possible to place Tapestry components in subclasses. For example, your application may have a package org.example.myapp.components.ajax.Dialog.
+ This component's normal type name is "ajax/dialog" (because it is in the ajax subfolder). This name is problematic, as
+ it is not valid to define an XML element with an element name <<<\<t:ajax/dialog\>>>>. Instead,
+ replace the slashes with periods: <<<\<t:ajax.dialog\>>>>.
+
+Invisible Instrumentation
+
+ A favorite feature of Tapestry 4 is <invisible instrumentation>, the ability to mark ordinary HTML elements as components. Invisible instrumentation
+ leads to more concise templates that are also more readable.
+
+ For Tapestry 5, you make use of <namespaced> id or type attributes to mark an arbitrary element as a component, for example:
+
++---+
+<p>
+ Merry Christmas:
+ <span t:type="Count" end="3">
+ Ho!
+ </span>
+</p>
++---+
+
+ The id, type and mixins attributes must be placed in the Tapestry namespace. Any additional attributes may be in the Tapestry namespace
+ or in the default namespace. Placing an attribute in the Tapestry namespace is useful when the attribute is not defined for the
+ element being instrumented.
+
+ It is valid to specify just the t:id attribute and not supply a specific type in either the template or in the containing class.
+ In this situation, Tapestry will make use of the
+ {{{../apidocs/org/apache/tapestry/corelib/components/Any.html}Any}} component, a kind of placeholder for any kind of element
+ whatsoever.
+
+ In <most> cases,it is an aesthetic choice between normal emebedded components, and embedded components via invisible instrumentation. In a few instances,
+ such as the Loop component, the behavior of the component is influenced by your choice. The Loop component, when included using invisible instrumentation, will
+ render the tag and any informal parameters, around its body. Thus, for example:
+
++---+
+ <table>
+ <tr t:type="loop" source="items" value="item" class="prop:rowClass">
+ <td>${item.id}</td>
+ <td>${item.name}</td>
+ <td>${item.quantity}</td>
+ </tr>
+ </tabel>
++---+
+
+ Here, the loop component "merges into" the \<tr\> element. It will render out a \<tr\> for each item object in the items list.
+ It will write a dynamic class attribute into each \<tr\>.
+
+
+
Modified: tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/validation.apt
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/validation.apt?view=diff&rev=513873&r1=513872&r2=513873
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/validation.apt (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/site/apt/guide/validation.apt Fri Mar 2 10:07:33 2007
@@ -158,18 +158,18 @@
<body>
<h1>Please Login</h1>
- <form t:id="form">
+ <t:form>
- <t:comp type="Errors"/>
+ <t:errors/>
- <label t:type="Label" for="userName"/>:
+ <t:label for="userName"/>:
<input t:type="TextField" t:id="userName" t:validate="required,minlength=3" size="30"/>
<br/>
- <label t:type="Label" for="password"/>:
+ <t:label for="password"/>:
<input t:type="PasswordField" t:id="password" t:validate="required,minlength=3" size="30"/>
<br/>
<input type="submit" value="Login"/>
- </form>
+ </t:form>
</body>
</html>
+---+
@@ -203,6 +203,8 @@
be <valid>.
Errors and Decorations
+
+ <<Note: This section has not been updated to reflect the introduction of client-side input validation.>>
When you first activate the Login page, the fields and forms will render normally, awaiting input:
Modified: tapestry/tapestry5/tapestry-core/trunk/src/site/apt/index.apt
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/site/apt/index.apt?view=diff&rev=513873&r1=513872&r2=513873
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/site/apt/index.apt (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/site/apt/index.apt Fri Mar 2 10:07:33 2007
@@ -13,7 +13,14 @@
Progress on Tapestry 5 is really taking off. This space lists some cool new features that have been added
recently.
+ * The type of component may now be specified in a template using the element name, rather than the
+ t:type attribute (this represents an incompatible change from 5.0.2).
+
+ * Form validation now runs on the client side (as well as on the server side) with some basic effects,
+ built on {{{http://script.taculo.us}script.taculo.us}}.
+
* The default ExceptionReport page has been improved to show details of the incoming request,
+ to filter out repetative and unnecessary data,
and to display file content when an exception includes a location.
* Action request URLs have been shortened and simplified for the common case. They may also include a query
Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/AnyDemo.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/AnyDemo.html?view=diff&rev=513873&r1=513872&r2=513873
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/AnyDemo.html (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/AnyDemo.html Fri Mar 2 10:07:33 2007
@@ -1,4 +1,4 @@
-<t:comp type="Border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+<html t:type="Border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
<h1>Any Component Demo</h1>
<p>
@@ -13,8 +13,8 @@
<ul>
- <t:comp type="Loop" source="1..3">
+ <t:loop source="1..3">
<li t:id="item">Item (${item.clientId})</li>
- </t:comp>
+ </t:loop>
</ul>
-</t:comp>
\ No newline at end of file
+</html>
\ No newline at end of file
Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/BeanEditorDemo.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/BeanEditorDemo.html?view=diff&rev=513873&r1=513872&r2=513873
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/BeanEditorDemo.html (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/BeanEditorDemo.html Fri Mar 2 10:07:33 2007
@@ -1,16 +1,14 @@
-<t:comp type="Border"
- xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
- <h1>${pageTitle}</h1>
+<t:border xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+ <h1>${pageTitle}</h1>
- <t:comp id="edit" submitlabel="Register">
+ <form t:id="edit" submitlabel="Register">
- <t:parameter name="firstName">
- <label t:type="Label" for="firstName" /> <input t:type="TextField"
- t:id="firstName" value="registrationData.firstName" size="40" />
- (First Name is Required)
- </t:parameter>
+ <t:parameter name="firstName">
+ <t:label for="firstName"/>
+ <input t:type="TextField" t:id="firstName" value="registrationData.firstName" size="40"/>
+ (First Name is Required) </t:parameter>
- </t:comp>
+ </form>
- <p>[<a t:type="ActionLink" t:id="clear">Clear Data</a>]</p>
-</t:comp>
+ <p>[<a t:type="ActionLink" t:id="clear">Clear Data</a>]</p>
+</t:border>
Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/BlockDemo.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/BlockDemo.html?view=diff&rev=513873&r1=513872&r2=513873
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/BlockDemo.html (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/BlockDemo.html Fri Mar 2 10:07:33 2007
@@ -1,19 +1,18 @@
<html t:type="Border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
-
- <h1>Block Demo</h1>
-
- <p>
- This page demonstrates how blocks may be used to contain text and other elements and control when and
- if they are rendered.
-</p>
-
- <form t:type="Form">
- <select t:type="Select" t:id="blockName" model="',fred,barney'" onchange="this.form.submit();"/> <label t:type="Label" for="blockName">Block to display</label>
- </form>
-
- <p>The block: [<t:comp type="Render" value="blockToRender"/>]</p>
-
-<t:block id="fred">Block fred.</t:block>
-<t:block id="barney">Block barney.</t:block>
-
+
+ <h1>Block Demo</h1>
+
+ <p> This page demonstrates how blocks may be used to contain text and other elements and control
+ when and if they are rendered. </p>
+
+ <t:form>
+ <t:select t:id="blockName" model="',fred,barney'" onchange="this.form.submit();"/>
+ <t:label for="blockName">Block to display</t:label>
+ </t:form>
+
+ <p>The block: [<t:render value="blockToRender"/>]</p>
+
+ <t:block id="fred">Block fred.</t:block>
+ <t:block id="barney">Block barney.</t:block>
+
</html>
Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/ClassLoaderInspect.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/ClassLoaderInspect.html?view=diff&rev=513873&r1=513872&r2=513873
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/ClassLoaderInspect.html (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/ClassLoaderInspect.html Fri Mar 2 10:07:33 2007
@@ -1,70 +1,70 @@
<html t:type="Border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
- <h1>Class Loader Inspection</h1>
+ <h1>Class Loader Inspection</h1>
- <dl>
- <dt>Context ClassLoader</dt>
- <dd>${classLoader} [${classLoader.class.name}]</dd>
+ <dl>
+ <dt>Context ClassLoader</dt>
+ <dd>${classLoader} [${classLoader.class.name}]</dd>
- <dt> Instance ClassLoader </dt>
- <dd>${class.classLoader}</dd>
+ <dt> Instance ClassLoader </dt>
+ <dd>${class.classLoader}</dd>
- </dl>
+ </dl>
- <h2>Class Loader Hierarchy</h2>
+ <h2>Class Loader Hierarchy</h2>
- <ul>
- <t:comp type="Loop" source="loaders" value="loader">
- <li> ${loader} </li>
- </t:comp>
- </ul>
+ <ul>
+ <t:loop source="loaders" value="loader">
+ <li>${loader}</li>
+ </t:loop>
+ </ul>
+
+ <h2> Find Resources </h2>
+
+ <form t:id="search">
+ <t:errors/>
+ <t:label for="resource"/>: <input t:id="resource" t:type="TextField" size="50"
+ validate="required"/>
+ <br/>
+ <input type="submit"/>
+ </form>
- <h2> Find Resources </h2>
+ <t:if test="showMatches">
- <form t:id="search">
- <t:comp type="Errors"/>
- <label t:type="Label" for="resource"/>: <input t:id="resource"
- t:type="TextField" size="50" validate="required"/>
- <br/>
- <input type="submit"/>
- </form>
-
- <t:comp type="If" test="showMatches">
-
- <h3>${listSize} Matches</h3>
-
- <ul>
- <t:comp type="Loop" source="URLs" value="URL">
- <li>${URL} <dl>
-
- <dt>Connection</dt>
- <dd>${URLConnection} [${URLConnection.class.name}]</dd>
- <dt>Content</dt>
- <dd>${URL.content}</dd>
-
- <dt>Stream </dt>
- <dd>
-<pre>
+ <h3>${listSize} Matches</h3>
+
+ <ul>
+ <t:loop source="URLs" value="URL">
+ <li>${URL} <dl>
+
+ <dt>Connection</dt>
+ <dd>${URLConnection} [${URLConnection.class.name}]</dd>
+ <dt>Content</dt>
+ <dd>${URL.content}</dd>
+
+ <dt>Stream </dt>
+ <dd>
+ <pre>
${contentStreamContents}
</pre>
- </dd>
+ </dd>
- <dt> JAR Entries </dt>
+ <dt> JAR Entries </dt>
- <dd>
- <ul>
- <t:comp type="Loop" source="jarEntries" value="jarEntry">
- <li> ${jarEntry} </li>
- </t:comp>
- </ul>
- </dd>
-
- </dl>
- </li>
- </t:comp>
- </ul>
+ <dd>
+ <ul>
+ <t:loop source="jarEntries" value="jarEntry">
+ <li>${jarEntry}</li>
+ </t:loop>
+ </ul>
+ </dd>
+
+ </dl>
+ </li>
+ </t:loop>
+ </ul>
- </t:comp>
+ </t:if>
</html>
Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/GridDemo.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/GridDemo.html?view=diff&rev=513873&r1=513872&r2=513873
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/GridDemo.html (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/GridDemo.html Fri Mar 2 10:07:33 2007
@@ -4,7 +4,7 @@
<table t:type="Grid" source="tracks" row="track">
<t:parameter name="ratingcell">
- <t:comp type="OutputRating" rating="track.rating"/>
+ <t:outputRating rating="track.rating"/>
</t:parameter>
</table>
Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/PasswordFieldDemo.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/PasswordFieldDemo.html?view=diff&rev=513873&r1=513872&r2=513873
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/PasswordFieldDemo.html (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/PasswordFieldDemo.html Fri Mar 2 10:07:33 2007
@@ -5,12 +5,12 @@
<form t:id="form">
- <span t:type="Errors"/>
+ <t:errors/>
- <label t:type="Label" for="userName"/>
+ <t:label for="userName"/>
<input t:type="TextField" t:id="userName" t:validate="required" size="30"/>
<br/>
- <label t:type="Label" for="password"/>
+ <t:label for="password"/>
<input t:id="password" t:validate="required" size="30"/>
<br/>
<input type="submit" value="Login"/>
Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/RenderComponentDemo.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/RenderComponentDemo.html?view=diff&rev=513873&r1=513872&r2=513873
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/RenderComponentDemo.html (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/RenderComponentDemo.html Fri Mar 2 10:07:33 2007
@@ -12,18 +12,18 @@
</span>
</t:block>
- <form t:type="Form">
+ <t:form>
<input t:type="Checkbox" t:id="enabled" onchange="this.form.submit();"/> <label t:type="Label" for="enabled">Enable optional text</label>
- </form>
+ </t:form>
- <t:comp type="If" test="enabled">
+ <t:if test="enabled">
Should now show up:
<t:parameter name="else">
Should be blank:
</t:parameter>
- </t:comp>
+ </t:if>
- <span id="container">[<t:comp type="Render" value="thing"/>]</span>
+ <span id="container">[<t:render value="thing"/>]</span>
</html>
Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/SimpleForm.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/SimpleForm.html?view=diff&rev=513873&r1=513872&r2=513873
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/SimpleForm.html (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/SimpleForm.html Fri Mar 2 10:07:33 2007
@@ -1,35 +1,35 @@
-<t:comp type="Border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+<html t:type="Border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
<h1>Simple Form</h1>
<p> This is the <em>very early</em> start to Tapestry 5 form support. </p>
- <form t:type="Form">
+ <t:form>
<input t:type="Checkbox" t:id="disabled"/>
- <label t:type="Label" for="disabled"/>
+ <t:label for="disabled"/>
<br/>
<div class="t-beaneditor">
- <label t:type="Label" for="email">This isn't used</label>
+ <t:label for="email">This isn't used</t:label>
<input t:type="TextField" t:id="email" value="incident.email" size="50" disabled="disabled"/>
<br/>
- <label t:type="Label" for="message"/>
+ <t:label for="message"/>
<input t:type="TextArea" t:id="message" label="Incident Message" value="incident.message"
cols="50" rows="10" disabled="disabled"> You can put text here, but it isn't used. </input>
<br/>
- <label t:type="Label" for="operatingSystem"/>
+ <t:label for="operatingSystem"/>
<select t:type="Select" t:id="operatingSystem" value="incident.operatingSystem"
model="message:os-values" disabled="disabled"/>
<br/>
- <label t:type="Label" for="department"/>
+ <t:label for="department"/>
<select t:type="Select" t:id="department" value="incident.department" disabled="disabled"/>
<br/>
- <label t:type="Label" for="urgent"/>
+ <t:label for="urgent"/>
<input t:type="Checkbox" t:id="urgent" value="incident.urgent" disabled="disabled"/>
<br/>
<input type="submit"/>
</div>
- </form>
+ </t:form>
<hr/>
@@ -45,4 +45,4 @@
-</t:comp>
+</html>
Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/SimpleTrackGridDemo.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/SimpleTrackGridDemo.html?view=diff&rev=513873&r1=513872&r2=513873
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/SimpleTrackGridDemo.html (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/SimpleTrackGridDemo.html Fri Mar 2 10:07:33 2007
@@ -4,7 +4,7 @@
<table t:type="Grid" source="tracks" row="track" model="simpleTrackModel">
<t:parameter name="ratingcell">
- <t:comp type="OutputRating" rating="track.rating"/>
+ <t:outputRating rating="track.rating"/>
</t:parameter>
</table>
Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/Target.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/Target.html?view=diff&rev=513873&r1=513872&r2=513873
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/Target.html (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/Target.html Fri Mar 2 10:07:33 2007
@@ -1,22 +1,22 @@
<html t:type="Border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
<h1>Target</h1>
<h2>Activation Context</h2>
- <t:comp type="if" test="activationContext">
+ <t:if test="activationContext">
<ul>
<li t:type="loop" source="activationContext" value="object">${object}</li>
</ul>
<t:parameter name="else">No activation context.</t:parameter>
- </t:comp>
+ </t:if>
<h2>Component Context</h2>
- <t:comp type="if" test="componentContext">
+ <t:if test="componentContext">
<ul>
<li t:type="loop" source="componentContext" value="object">${object}</li>
</ul>
<t:parameter name="else"> No component context. </t:parameter>
- </t:comp>
+ </t:if>
<h2>Setup Component Context</h2> [<a t:type="actionlink" context="contextToEncode">go</a>]
<h2>Navigation</h2>
Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/ToDoList.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/ToDoList.html?view=diff&rev=513873&r1=513872&r2=513873
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/ToDoList.html (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/ToDoList.html Fri Mar 2 10:07:33 2007
@@ -4,9 +4,9 @@
<form t:id="form">
- <t:comp type="Errors"/>
+ <t:errors/>
- <table class="t-data-table" cellspacing="0px">
+ <table class="t-data-table">
<tr>
<th> Title </th>
<th> Reorder </th>
Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/ToDoListVolatile.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/ToDoListVolatile.html?view=diff&rev=513873&r1=513872&r2=513873
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/ToDoListVolatile.html (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/ToDoListVolatile.html Fri Mar 2 10:07:33 2007
@@ -4,9 +4,9 @@
<form t:id="form">
- <t:comp type="Errors"/>
+ <t:errors/>
- <table class="t-data-table" cellspacing="0px">
+ <table class="t-data-table">
<tr>
<th> Title </th>
<th> Reorder </th>
Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/ViewRegistration.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/ViewRegistration.html?view=diff&rev=513873&r1=513872&r2=513873
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/ViewRegistration.html (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/app1/WEB-INF/ViewRegistration.html Fri Mar 2 10:07:33 2007
@@ -1,4 +1,4 @@
-<t:comp type="Border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+<html t:type="Border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
<h1>BeanEdit Component Demo</h1>
First Name: [${registrationData.firstName}]
@@ -11,4 +11,4 @@
<br/>
U.S. Citizen: [${registrationData.citizen}]
-</t:comp>
\ No newline at end of file
+</html>
\ No newline at end of file
Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/IntegrationTests.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/IntegrationTests.java?view=diff&rev=513873&r1=513872&r2=513873
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/IntegrationTests.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/IntegrationTests.java Fri Mar 2 10:07:33 2007
@@ -696,6 +696,7 @@
_selenium.open(BASE_URL);
clickAndWait("link=BeanEditor Demo");
+ clickAndWait("link=Clear Data");
clickAndWait(submitButton);
assertTextPresent(
Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/TemplateParserImplTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/TemplateParserImplTest.java?view=diff&rev=513873&r1=513872&r2=513873
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/TemplateParserImplTest.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/internal/services/TemplateParserImplTest.java Fri Mar 2 10:07:33 2007
@@ -264,7 +264,7 @@
StartComponentToken t = get(tokens, 2);
assertEquals(t.getId(), "fred");
- assertEquals(t.getType(), "Fred");
+ assertEquals(t.getComponentType(), "somecomponent");
assertNull(t.getMixins());
checkLine(t, 2);
@@ -297,7 +297,7 @@
StartComponentToken start = get(tokens, 0);
assertEquals(start.getId(), "fred");
- assertEquals(start.getType(), "Fred");
+ assertEquals(start.getComponentType(), "Fred");
assertNull(start.getElementName());
AttributeToken attr = get(tokens, 1);
@@ -319,7 +319,7 @@
StartComponentToken start = get(tokens, 0);
assertEquals(start.getId(), "fred");
- assertEquals(start.getType(), "Fred");
+ assertEquals(start.getComponentType(), "Fred");
assertEquals(start.getElementName(), "html");
AttributeToken attr = get(tokens, 1);
@@ -409,7 +409,7 @@
StartComponentToken t = get(tokens, 2);
assertEquals(t.getId(), "fred");
- assertNull(t.getType());
+ assertEquals(t.getComponentType(), "comp");
assertEquals(t.getMixins(), "Barney");
}
@@ -424,7 +424,7 @@
assertEquals(t.getId(), "fred");
// We also check that empty string type is null ..
- assertNull(t.getType());
+ assertNull(t.getComponentType());
assertNull(t.getMixins());
}
@@ -544,11 +544,23 @@
assertEquals(token6.getComment(), "fred content");
TemplateToken token8 = get(tokens, 8);
-
+
assertEquals(token8.getTokenType(), TokenType.END_ELEMENT);
}
@Test
+ public void complex_component_type()
+ {
+ List<TemplateToken> tokens = tokens("complex_component_type.html");
+
+ assertEquals(tokens.size(), 6);
+
+ StartComponentToken token2 = get(tokens, 2);
+
+ assertEquals(token2.getComponentType(), "subfolder/nifty");
+ }
+
+ @Test
public void block_element()
{
List<TemplateToken> tokens = tokens("block_element.html");
@@ -577,11 +589,6 @@
2 },
{ "illegal_nesting_within_body_element.html",
"Element 'xyz' is nested within a Tapestry body element", 2 },
- { "component_without_id_or_type.html", ServicesMessages.compRequiresIdOrType(), 2 },
- {
- "unexpected_element_in_tapestry_namespace.html",
- "Element <t:fubar> is in the Tapestry namespace, but is not a recognized Tapestry template element.",
- 3 },
{
"unexpected_attribute_in_parameter_element.html",
"Element <parameter> does not support an attribute named 'grok'. The only allowed attribute name is 'name'.",
Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/ActionPage.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/ActionPage.html?view=diff&rev=513873&r1=513872&r2=513873
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/ActionPage.html (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/ActionPage.html Fri Mar 2 10:07:33 2007
@@ -1,15 +1,15 @@
-<t:comp type="Border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+<html t:type="Border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
<p> Choose a number from 1 to 10: </p>
<p>
- <t:comp type="Count" end="10" value="index">
- <t:comp id="choose" type="ActionLink" context="index" class="linkClass">${index}</t:comp>
- </t:comp>
+ <t:count end="10" value="index">
+ <a t:id="choose" t:type="ActionLink" context="index" class="linkClass">${index}</a>
+ </t:count>
</p>
- <t:comp type="If" test="value">
+ <t:if test="value">
<p> <strong>You chose: ${value}</strong>.</p>
- </t:comp>
+ </t:if>
-</t:comp>
+</html>
Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/AssetDemo.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/AssetDemo.html?view=diff&rev=513873&r1=513872&r2=513873
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/AssetDemo.html (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/AssetDemo.html Fri Mar 2 10:07:33 2007
@@ -1,4 +1,4 @@
-<t:comp type="Border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+<html t:type="Border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
<p>
This page demonstrates the ability to inject assets into components and pass them around as parameters.
@@ -8,12 +8,12 @@
The Tapestry banner:
</p>
- <t:comp type="Img" src="icon"/>
+ <t:img src="icon"/>
<p>
A classpath asset:
</p>
- <t:comp type="Img" src="button"/>
+ <t:img src="button"/>
-</t:comp>
\ No newline at end of file
+</html>
\ No newline at end of file
Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/BadTemplate.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/BadTemplate.html?view=diff&rev=513873&r1=513872&r2=513873
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/BadTemplate.html (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/BadTemplate.html Fri Mar 2 10:07:33 2007
@@ -1,13 +1,12 @@
-<t:comp type="Border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+<html t:type="Border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
<p>
- This template includes an invalid element in the Tapestry namespace.
- </p>
+ This template is not well formed.</p>
- <t:foobar>content from template</t:foobar>
+ <t:foobar>content from template</foobar>
<p>
This page is used to test exception reporting.
</p>
-</t:comp>
\ No newline at end of file
+</html>
\ No newline at end of file
Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/Barney.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/Barney.html?view=diff&rev=513873&r1=513872&r2=513873
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/Barney.html (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/Barney.html Fri Mar 2 10:07:33 2007
@@ -1,4 +1,4 @@
-<t:comp type="Border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+<html t:type="Border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
<p>
You clicked Barney.
@@ -11,4 +11,4 @@
<p>
[<a t:type="PageLink" t:page="InjectDemo">Back</a>]
</p>
-</t:comp>
+</html>
Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/Countdown.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/Countdown.html?view=diff&rev=513873&r1=513872&r2=513873
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/Countdown.html (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/Countdown.html Fri Mar 2 10:07:33 2007
@@ -1,11 +1,11 @@
-<t:comp type="Border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+<html t:type="Border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
<p> This component demonstrates embedded components defined in the component class using the @Component annotation.</p>
- <p> Countdown: <t:comp id="count">
+ <p> Countdown: <div t:id="count">
${countValue}
- </t:comp>
+ </div>
</p>
<p>
Brought to you by the ${component:count} component.
</p>
-</t:comp>
+</html>