You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by jk...@apache.org on 2008/01/18 23:09:43 UTC
svn commit: r613299 - in /tapestry/tapestry4/trunk:
src/site/xdoc/components/general/
tapestry-examples/TimeTracker/src/context/WEB-INF/
tapestry-framework/src/java/org/apache/tapestry/html/
tapestry-framework/src/java/org/apache/tapestry/services/impl...
Author: jkuhnert
Date: Fri Jan 18 14:09:41 2008
New Revision: 613299
URL: http://svn.apache.org/viewvc?rev=613299&view=rev
Log:
-) Fixes TAPESTRY-1794. Made shell component write informal parameters to html element.
-) Finally saw and fixed ExpressionEvaluator read expression bug.
Modified:
tapestry/tapestry4/trunk/src/site/xdoc/components/general/shell.xml
tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/context/WEB-INF/Border.html
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Shell.java
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Shell.jwc
tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/HiveMindExpressionCompiler.java
tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/services/impl/TestExpressionEvaluator.java
Modified: tapestry/tapestry4/trunk/src/site/xdoc/components/general/shell.xml
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/src/site/xdoc/components/general/shell.xml?rev=613299&r1=613298&r2=613299&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/src/site/xdoc/components/general/shell.xml (original)
+++ tapestry/tapestry4/trunk/src/site/xdoc/components/general/shell.xml Fri Jan 18 14:09:41 2008
@@ -373,7 +373,7 @@
<p>
Informal parameters:
- <strong>forbidden</strong>
+ <strong>allowed</strong> <em>(informal parameters written to top level html tag)</em>
</p>
<p>
Modified: tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/context/WEB-INF/Border.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/context/WEB-INF/Border.html?rev=613299&r1=613298&r2=613299&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/context/WEB-INF/Border.html (original)
+++ tapestry/tapestry4/trunk/tapestry-examples/TimeTracker/src/context/WEB-INF/Border.html Fri Jan 18 14:09:41 2008
@@ -2,7 +2,7 @@
title="message:window.title"
browserLogLevel="DEBUG"
consoleEnabled="true"
- debugEnabled="false" >
+ debugEnabled="false">
<link jwcid="@Relation" href="favicon.ico" type="image/gif" rel="shortcut icon" />
<link jwcid="@Relation" href="css/timetracker.css" media="all" />
<body jwcid="@Body">
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Shell.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Shell.java?rev=613299&r1=613298&r2=613299&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Shell.java (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Shell.java Fri Jan 18 14:09:41 2008
@@ -35,20 +35,20 @@
* <p>
* Specifically does <em>not</em> provide a <body> tag, that is usually accomplished using a
* {@link Body} component.
- *
+ *
* @author Howard Lewis Ship
*/
public abstract class Shell extends AbstractComponent
{
public static final String SHELL_ATTRIBUTE = "org.apache.tapestry.html.Shell";
-
+
private static final String GENERATOR_CONTENT = "Tapestry Application Framework, version " + Tapestry.VERSION;
protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
{
TapestryUtils.storeUniqueAttribute(cycle, SHELL_ATTRIBUTE, this);
-
+
long startTime = System.currentTimeMillis();
boolean rewinding = cycle.isRewinding();
boolean dynamic = getBuilder().isDynamic();
@@ -59,8 +59,8 @@
IPage page = getPage();
- if (!isDisableTapestryMeta()) {
-
+ if (!isDisableTapestryMeta())
+ {
writer.comment("Application: " + getApplicationSpecification().getName());
writer.comment("Page: " + page.getPageName());
@@ -68,6 +68,7 @@
}
writer.begin("html");
+ renderInformalParameters(writer, cycle);
writer.println();
writer.begin("head");
writer.println();
@@ -101,7 +102,7 @@
if (ajaxDelegate != null)
ajaxDelegate.render(writer, cycle);
-
+
IAsset stylesheet = getStylesheet();
if (stylesheet != null)
@@ -127,28 +128,28 @@
{
List relations = getRelations();
if (relations != null)
- writeRelations(writer, relations);
-
+ writeRelations(writer, relations);
+
StringBuffer additionalContent = getContentBuffer();
if (additionalContent != null)
writer.printRaw(additionalContent.toString());
-
+
writer.end(); // head
}
-
+
if (!dynamic)
nested.close();
-
+
if (!rewinding && !dynamic)
{
writer.end(); // html
writer.println();
- if (!isDisableTapestryMeta()) {
-
+ if (!isDisableTapestryMeta())
+ {
long endTime = System.currentTimeMillis();
- writer.comment("Render time: ~ " + (endTime - startTime) + " ms");
+ writer.comment("Render time: ~ " + (endTime - startTime) + " ms");
}
}
@@ -159,8 +160,8 @@
super.cleanupAfterRender(cycle);
cycle.removeAttribute(SHELL_ATTRIBUTE);
- }
-
+ }
+
private void writeDocType(IMarkupWriter writer, IRequestCycle cycle)
{
// This is the real code
@@ -180,7 +181,7 @@
writer.attribute("href", stylesheet.buildURL());
writer.println();
}
-
+
private void writeRefresh(IMarkupWriter writer, IRequestCycle cycle)
{
int refresh = getRefresh();
@@ -203,7 +204,7 @@
writeMetaTag(writer, "http-equiv", "Refresh", buffer.toString());
}
-
+
private void writeMetaTag(IMarkupWriter writer, String key, String value, String content)
{
writer.beginEmpty("meta");
@@ -211,10 +212,11 @@
writer.attribute("content", content);
writer.println();
}
-
+
private void writeRelations(IMarkupWriter writer, List relations)
{
Iterator i = relations.iterator();
+
while (i.hasNext())
{
RelationBean relationBean = (RelationBean) i.next();
@@ -222,37 +224,39 @@
writeRelation(writer, relationBean);
}
}
-
+
private void writeRelation(IMarkupWriter writer, RelationBean relationBean)
{
- writer.beginEmpty("link");
- writeAttributeIfNotNull(writer, "rel", relationBean.getRel());
- writeAttributeIfNotNull(writer, "rev", relationBean.getRev());
- writeAttributeIfNotNull(writer, "type", relationBean.getType());
- writeAttributeIfNotNull(writer, "media", relationBean.getMedia());
- writeAttributeIfNotNull(writer, "title", relationBean.getTitle());
- writeAttributeIfNotNull(writer, "href", relationBean.getHref());
- writer.println();
- }
-
+ writer.beginEmpty("link");
+
+ writeAttributeIfNotNull(writer, "rel", relationBean.getRel());
+ writeAttributeIfNotNull(writer, "rev", relationBean.getRev());
+ writeAttributeIfNotNull(writer, "type", relationBean.getType());
+ writeAttributeIfNotNull(writer, "media", relationBean.getMedia());
+ writeAttributeIfNotNull(writer, "title", relationBean.getTitle());
+ writeAttributeIfNotNull(writer, "href", relationBean.getHref());
+
+ writer.println();
+ }
+
private void writeAttributeIfNotNull(IMarkupWriter writer, String name, String value)
{
if (value != null)
writer.attribute(name, value);
}
-
+
/**
* Retrieves the {@link Shell} that was stored into the request
* cycle. This allows components wrapped by the {@link Shell} to
* locate it and access the services it provides.
- *
+ *
* @since 4.1.1
*/
public static Shell get(IRequestCycle cycle)
{
return (Shell) cycle.getAttribute(SHELL_ATTRIBUTE);
- }
-
+ }
+
/**
* Adds a relation (stylesheets, favicon, e.t.c.) to the page.
*
@@ -263,17 +267,17 @@
List relations = getRelations();
if (relations == null)
relations = new ArrayList();
-
+
if (!relations.contains(relation))
relations.add(relation);
-
- setRelations(relations);
+
+ setRelations(relations);
}
/**
* Include additional content in the header of a page.
- *
- * @param content
+ *
+ * @param content
*
* @since 4.1.1
*/
@@ -281,23 +285,23 @@
{
if (HiveMind.isBlank(content))
return;
-
+
StringBuffer buffer = getContentBuffer();
-
+
if (buffer == null)
buffer = new StringBuffer();
-
+
buffer.append(content);
-
+
setContentBuffer(buffer);
}
-
+
public abstract boolean isDisableCaching();
-
+
public abstract IRender getAjaxDelegate();
-
+
public abstract IRender getDelegate();
-
+
public abstract int getRefresh();
public abstract IAsset getStylesheet();
@@ -328,34 +332,34 @@
/** @since 4.0 */
public abstract IRender getBaseTagWriter();
-
+
/** @since 4.0.1 */
-
+
public abstract boolean getRenderBaseTag();
-
+
/** @since 4.0.3 */
-
+
public abstract boolean getRaw();
-
+
/** @since 4.1.1 */
-
+
public abstract List getRelations();
-
+
/** @since 4.1.1 */
-
+
public abstract void setRelations(List relations);
-
+
/** @since 4.1.1 */
-
+
public abstract StringBuffer getContentBuffer();
-
+
/** @since 4.1.1 */
-
- public abstract void setContentBuffer(StringBuffer buffer);
-
+
+ public abstract void setContentBuffer(StringBuffer buffer);
+
/** @since 4.1.4 */
public abstract String getSearchIds();
-
+
/** @since 4.1.4 */
public abstract void setSearchIds(String ids);
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Shell.jwc
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Shell.jwc?rev=613299&r1=613298&r2=613299&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Shell.jwc (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/html/Shell.jwc Fri Jan 18 14:09:41 2008
@@ -19,7 +19,7 @@
"-//Apache Software Foundation//Tapestry Specification 4.0//EN"
"http://tapestry.apache.org/dtd/Tapestry_4_0.dtd">
-<component-specification class="org.apache.tapestry.html.Shell" allow-informal-parameters="no">
+<component-specification class="org.apache.tapestry.html.Shell" allow-informal-parameters="yes">
<description>
Provides the outer tags in an HTML page: <html>, <head> and <title>.
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/HiveMindExpressionCompiler.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/HiveMindExpressionCompiler.java?rev=613299&r1=613298&r2=613299&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/HiveMindExpressionCompiler.java (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/HiveMindExpressionCompiler.java Fri Jan 18 14:09:41 2008
@@ -147,11 +147,6 @@
MethodSignature expressionSetter = new MethodSignature(void.class, "setExpression", new Class[]{Node.class}, null);
- // must evaluate expression value at least once if object isn't null
-
- //if (root != null)
- // Ognl.getValue(expression, context, root);
-
try
{
getBody = generateGetter(context, compiled);
Modified: tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/services/impl/TestExpressionEvaluator.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/services/impl/TestExpressionEvaluator.java?rev=613299&r1=613298&r2=613299&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/services/impl/TestExpressionEvaluator.java (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/test/org/apache/tapestry/services/impl/TestExpressionEvaluator.java Fri Jan 18 14:09:41 2008
@@ -93,7 +93,7 @@
}
catch (ApplicationRuntimeException ex)
{
- assertExceptionSubstring(ex, "Unable to parse OGNL expression");
+ assertExceptionSubstring(ex, "Unable to read OGNL expression");
}
}