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 2009/07/22 20:25:50 UTC
svn commit: r796822 - in /tiles/framework/trunk/tiles-jsp/src/main:
java/org/apache/tiles/jsp/taglib/AddAttributeTag.java
java/org/apache/tiles/jsp/taglib/PutAttributeTag.java
resources/META-INF/tld/tiles-jsp.tld
Author: apetrelli
Date: Wed Jul 22 18:25:50 2009
New Revision: 796822
URL: http://svn.apache.org/viewvc?rev=796822&view=rev
Log:
TILES-428
Added expression property in AddAttributeTag and PutAttributeTag.
Added templateExpression attribute in insertDefinition, insertTemplate, addAttribute and putAttribute.
Added templateType in insertTemplate and insertDefinition.
Modified:
tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/AddAttributeTag.java
tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/PutAttributeTag.java
tiles/framework/trunk/tiles-jsp/src/main/resources/META-INF/tld/tiles-jsp.tld
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?rev=796822&r1=796821&r2=796822&view=diff
==============================================================================
--- 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 Wed Jul 22 18:25:50 2009
@@ -77,6 +77,12 @@
private Object value = null;
/**
+ * The expression to calculate the value from. Use this parameter, or value,
+ * or body.
+ */
+ private String expression = null;
+
+ /**
* Requested type for the value.
*/
private String type = null;
@@ -120,6 +126,28 @@
}
/**
+ * Returns the expression to calculate the value from. Use this parameter,
+ * or value, or body.
+ *
+ * @return The expression
+ * @since 2.2.0
+ */
+ public String getExpression() {
+ return expression;
+ }
+
+ /**
+ * Sets the expression to calculate the value from. Use this parameter, or
+ * value, or body.
+ *
+ * @param expression The expression
+ * @since 2.2.0
+ */
+ public void setExpression(String expression) {
+ this.expression = expression;
+ }
+
+ /**
* <p>
* Returns content type: string, template or definition.
* </p>
@@ -165,7 +193,7 @@
JspContext pageContext = getJspContext();
model.start(JspUtil.getComposeStack(pageContext));
String body = JspUtil.evaluateFragmentAsString(getJspBody());
- model.end(JspUtil.getComposeStack(pageContext), value, null, body,
- role, type);
+ model.end(JspUtil.getComposeStack(pageContext), value, expression,
+ body, role, type);
}
}
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?rev=796822&r1=796821&r2=796822&view=diff
==============================================================================
--- 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 Wed Jul 22 18:25:50 2009
@@ -99,6 +99,12 @@
private Object value = null;
/**
+ * The expression to calculate the value from. Use this parameter, or value,
+ * or body.
+ */
+ private String expression = null;
+
+ /**
* Requested type for the value.
*/
private String type = null;
@@ -181,6 +187,28 @@
}
/**
+ * Returns the expression to calculate the value from. Use this parameter,
+ * or value, or body.
+ *
+ * @return The expression
+ * @since 2.2.0
+ */
+ public String getExpression() {
+ return expression;
+ }
+
+ /**
+ * Sets the expression to calculate the value from. Use this parameter, or
+ * value, or body.
+ *
+ * @param expression The expression
+ * @since 2.2.0
+ */
+ public void setExpression(String expression) {
+ this.expression = expression;
+ }
+
+ /**
* <p>
* Returns content type: string, template or definition.
* </p>
@@ -227,7 +255,7 @@
model.start(JspUtil.getComposeStack(jspContext));
String body = JspUtil.evaluateFragmentAsString(getJspBody());
model.end(JspUtil.getCurrentContainer(jspContext), JspUtil
- .getComposeStack(jspContext), name, value, null,
- body, role, type, cascade, jspContext);
+ .getComposeStack(jspContext), name, value, expression, body,
+ role, type, cascade, jspContext);
}
}
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?rev=796822&r1=796821&r2=796822&view=diff
==============================================================================
--- 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 Wed Jul 22 18:25:50 2009
@@ -80,6 +80,30 @@
<attribute>
<description>
<![CDATA[
+ <p>The type of the template attribute.</p>
+ ]]>
+ </description>
+ <name>templateType</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>
+ <![CDATA[
+ <p>The expression to evaluate to get the value of the template.
+ </p>
+ <p>If used together with <code>template</code>, this attribute will be ignored.</p>
+ ]]>
+ </description>
+ <name>templateExpression</name>
+ <required>false</required>
+ <rtexprvalue>false</rtexprvalue>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>
+ <![CDATA[
<p>True or false. If true, current page out stream is flushed
before insertion.</p>
]]>
@@ -181,6 +205,30 @@
<attribute>
<description>
<![CDATA[
+ <p>The type of the template attribute.</p>
+ ]]>
+ </description>
+ <name>templateType</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>
+ <![CDATA[
+ <p>The expression to evaluate to get the value of the template.
+ </p>
+ <p>If used together with <code>template</code>, this attribute will be ignored.</p>
+ ]]>
+ </description>
+ <name>templateExpression</name>
+ <required>false</required>
+ <rtexprvalue>false</rtexprvalue>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>
+ <![CDATA[
<p>True or false. If true, current page out stream is flushed
before insertion.</p>
]]>
@@ -480,6 +528,17 @@
</attribute>
<attribute>
<description>
+ <![CDATA[
+ <p>The expression to calculate the value from. Use this parameter, or value, or body.</p>
+ ]]>
+ </description>
+ <name>expression</name>
+ <required>false</required>
+ <rtexprvalue>false</rtexprvalue>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>
<![CDATA[
<p>Specify content type: string, template or definition.</p>
<ul>
@@ -603,6 +662,17 @@
</attribute>
<attribute>
<description>
+ <![CDATA[
+ <p>The expression to calculate the value from. Use this parameter, or value, or body.</p>
+ ]]>
+ </description>
+ <name>expression</name>
+ <required>false</required>
+ <rtexprvalue>false</rtexprvalue>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>
<![CDATA[
<p>Specify content type: string, template or definition.</p>
<ul>