Author: jkuhnert
Date: Fri Mar 10 07:48:07 2006
New Revision: 384824
URL: http://svn.apache.org/viewcvs?rev=384824&view=rev
Log:
Various bug fixes/patches applied.
Modified:
jakarta/tapestry/branches/4.0/framework/src/documentation/content/xdocs/tapestry/ComponentReference/Script.xml
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/components/ILinkComponent.java
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/engine/EngineServiceLink.java
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/form/Form.java
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/form/Form.jwc
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/form/FormSupport.java
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/form/FormSupportImpl.java
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/html/HTMLMessages.java
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/html/HTMLStrings.properties
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/html/Script.java
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/html/Script.jwc
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/link/ActionLink.jwc
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/link/DefaultLinkRenderer.java
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/link/DirectLink.jwc
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/link/ExternalLink.jwc
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/link/PageLink.jwc
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/link/ServiceLink.jwc
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/wml/Go.jwc
jakarta/tapestry/branches/4.0/framework/src/test/org/apache/tapestry/BaseComponentTestCase.java
jakarta/tapestry/branches/4.0/framework/src/test/org/apache/tapestry/form/FormSupportTest.java
jakarta/tapestry/branches/4.0/framework/src/test/org/apache/tapestry/form/FormTest.java
jakarta/tapestry/branches/4.0/framework/src/test/org/apache/tapestry/html/ScriptTest.java
jakarta/tapestry/branches/4.0/framework/src/test/org/apache/tapestry/link/DefaultLinkRendererTest.java
jakarta/tapestry/branches/4.0/src/documentation/content/xdocs/UsersGuide/page-class.xml
jakarta/tapestry/branches/4.0/status.xml
Modified:
jakarta/tapestry/branches/4.0/framework/src/documentation/content/xdocs/tapestry/ComponentReference/Script.xml
URL:
http://svn.apache.org/viewcvs/jakarta/tapestry/branches/4.0/framework/src/documentation/content/xdocs/tapestry/ComponentReference/Script.xml?rev=384824&r1=384823&r2=384824&view=diff
==============================================================================
---
jakarta/tapestry/branches/4.0/framework/src/documentation/content/xdocs/tapestry/ComponentReference/Script.xml
(original)
+++
jakarta/tapestry/branches/4.0/framework/src/documentation/content/xdocs/tapestry/ComponentReference/Script.xml
Fri Mar 10 07:48:07 2006
@@ -52,14 +52,27 @@
<th>Description</th>
</tr>
<tr>
- <td>script</td>
+ <td>scriptPath</td>
<td>String</td>
<td>in</td>
- <td>yes</td>
+ <td>no</td>
<td> </td>
<td>
- The path of a resource (on the classpath) containing the script.
+ The path of a resource (on the classpath) containing the script. One
of either
+ scriptPath or scriptAsset must be specified.
+ </td>
+ </tr>
+ <tr>
+ <td>scriptAsset</td>
+ <td>&IAsset;</td>
+
+ <td>in</td>
+ <td>no</td>
+ <td> </td>
+ <td>
+ A reference to a script as an &IAsset; parameter. One of either
+ scriptPath or scriptAsset must be specified.
</td>
</tr>
<tr>
Modified:
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/components/ILinkComponent.java
URL:
http://svn.apache.org/viewcvs/jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/components/ILinkComponent.java?rev=384824&r1=384823&r2=384824&view=diff
==============================================================================
---
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/components/ILinkComponent.java
(original)
+++
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/components/ILinkComponent.java
Fri Mar 10 07:48:07 2006
@@ -40,6 +40,15 @@
public String getScheme();
/**
+ * Returns the desired port (i.e., "80" or "443") for the link, or null to
not output a
+ * specific port (in which case the URL will fall under the incoming
request's port).
+ *
+ * @since 4.1
+ */
+
+ public Integer getPort();
+
+ /**
* Returns whether this service link component is enabled or disabled.
*
* @since 0.2.9
Modified:
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/engine/EngineServiceLink.java
URL:
http://svn.apache.org/viewcvs/jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/engine/EngineServiceLink.java?rev=384824&r1=384823&r2=384824&view=diff
==============================================================================
---
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/engine/EngineServiceLink.java
(original)
+++
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/engine/EngineServiceLink.java
Fri Mar 10 07:48:07 2006
@@ -39,6 +39,7 @@
public class EngineServiceLink implements ILink
{
private static final int DEFAULT_HTTP_PORT = 80;
+ private static final int DEFAULT_HTTPS_PORT = 443;
private final IRequestCycle _cycle;
Modified:
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/form/Form.java
URL:
http://svn.apache.org/viewcvs/jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/form/Form.java?rev=384824&r1=384823&r2=384824&view=diff
==============================================================================
---
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/form/Form.java
(original)
+++
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/form/Form.java
Fri Mar 10 07:48:07 2006
@@ -246,8 +246,8 @@
_renderInformalParameters = new RenderInformalParameters();
ILink link = getLink(cycle, actionId);
-
- _formSupport.render(getMethod(), _renderInformalParameters, link,
getScheme());
+
+ _formSupport.render(getMethod(), _renderInformalParameters, link,
getScheme(), getPort());
}
IActionListener findListener(String mode)
@@ -389,6 +389,9 @@
/** scheme parameter, may be null */
public abstract String getScheme();
+
+ /** port , may be null */
+ public abstract Integer getPort();
public void setEncodingType(String encodingType)
{
@@ -439,4 +442,4 @@
_formSupport.registerForFocus(field, priority);
}
-}
\ No newline at end of file
+}
Modified:
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/form/Form.jwc
URL:
http://svn.apache.org/viewcvs/jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/form/Form.jwc?rev=384824&r1=384823&r2=384824&view=diff
==============================================================================
---
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/form/Form.jwc
(original)
+++
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/form/Form.jwc
Fri Mar 10 07:48:07 2006
@@ -109,6 +109,13 @@
</description>
</parameter>
+ <parameter name="port">
+ <description>
+ Forces the link to be generated as an absolute URL with the given port
+ (unless the port matches the port for the current request).
+ </description>
+ </parameter>
+
<reserved-parameter name="action"/>
<reserved-parameter name="name"/>
<reserved-parameter name="onsubmit"/>
Modified:
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/form/FormSupport.java
URL:
http://svn.apache.org/viewcvs/jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/form/FormSupport.java?rev=384824&r1=384823&r2=384824&view=diff
==============================================================================
---
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/form/FormSupport.java
(original)
+++
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/form/FormSupport.java
Fri Mar 10 07:48:07 2006
@@ -44,7 +44,7 @@
* non-null, and the scheme does not match the current
request's scheme, then an
* absolute URL with the specified scheme will be generated,
rather than a URI.
*/
- public void render(String method, IRender informalParametersRenderer,
ILink link, String scheme);
+ public void render(String method, IRender informalParametersRenderer,
ILink link, String scheme, Integer port);
/**
* Invoked to rewind the form, which renders the body of the form,
allowing form element
@@ -55,4 +55,4 @@
* [EMAIL PROTECTED] FormConstants#SUBMIT_CANCEL} or [EMAIL
PROTECTED] FormConstants#SUBMIT_REFRESH}.
*/
public String rewind();
-}
\ No newline at end of file
+}
Modified:
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/form/FormSupportImpl.java
URL:
http://svn.apache.org/viewcvs/jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/form/FormSupportImpl.java?rev=384824&r1=384823&r2=384824&view=diff
==============================================================================
---
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/form/FormSupportImpl.java
(original)
+++
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/form/FormSupportImpl.java
Fri Mar 10 07:48:07 2006
@@ -459,8 +459,9 @@
for (int i = 0; i < ids.length; i++)
_elementIdAllocator.allocateId(ids[i]);
}
-
- public void render(String method, IRender informalParametersRenderer,
ILink link, String scheme)
+
+ public void render(String method, IRender informalParametersRenderer,
ILink link,
+ String scheme, Integer port)
{
String formId = _form.getName();
@@ -486,9 +487,10 @@
_form.renderBody(nested, _cycle);
runDeferredRunnables();
-
- writeTag(_writer, method, link.getURL(scheme, null, 0, null, false));
-
+
+ int portI = (port == null) ? 0 : port.intValue();
+ writeTag(_writer, method, link.getURL(scheme, null, portI, null,
false));
+
// For HTML compatibility
_writer.attribute("name", formId);
Modified:
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/html/HTMLMessages.java
URL:
http://svn.apache.org/viewcvs/jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/html/HTMLMessages.java?rev=384824&r1=384823&r2=384824&view=diff
==============================================================================
---
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/html/HTMLMessages.java
(original)
+++
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/html/HTMLMessages.java
Fri Mar 10 07:48:07 2006
@@ -15,6 +15,7 @@
package org.apache.tapestry.html;
import org.apache.hivemind.impl.MessageFormatter;
+import org.apache.tapestry.IBinding;
/**
* @author Howard M. Lewis Ship
@@ -27,5 +28,15 @@
static String textConversionError(Throwable cause)
{
return _formatter.format("text-conversion-error", cause);
+ }
+
+ static String multiAssetParameterError(IBinding asset, IBinding scriptPath)
+ {
+ return _formatter.format("script-multiscript-error", new Object[]
{asset, scriptPath});
+ }
+
+ static String noScriptPathError()
+ {
+ return _formatter.getMessage("script-required-path-error");
}
}
Modified:
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/html/HTMLStrings.properties
URL:
http://svn.apache.org/viewcvs/jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/html/HTMLStrings.properties?rev=384824&r1=384823&r2=384824&view=diff
==============================================================================
---
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/html/HTMLStrings.properties
(original)
+++
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/html/HTMLStrings.properties
Fri Mar 10 07:48:07 2006
@@ -13,3 +13,7 @@
# limitations under the License.
text-conversion-error=Error converting text to lines (for InsertText
component): {0}
+script-multiscript-error=Script component has both script IAsset
parameter({0}) AND String scriptPath parameter({1}) set, \
+only one of the two parameters is allowed.
+script-required-path-error=Either the scriptAsset or the scriptPath parameter
must be supplied, neither parameter \
+was set.
\ No newline at end of file
Modified:
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/html/Script.java
URL:
http://svn.apache.org/viewcvs/jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/html/Script.java?rev=384824&r1=384823&r2=384824&view=diff
==============================================================================
---
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/html/Script.java
(original)
+++
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/html/Script.java
Fri Mar 10 07:48:07 2006
@@ -21,12 +21,12 @@
import org.apache.hivemind.ApplicationRuntimeException;
import org.apache.hivemind.Resource;
import org.apache.tapestry.AbstractComponent;
+import org.apache.tapestry.IAsset;
import org.apache.tapestry.IBinding;
import org.apache.tapestry.IMarkupWriter;
import org.apache.tapestry.IRequestCycle;
import org.apache.tapestry.IScript;
import org.apache.tapestry.PageRenderSupport;
-import org.apache.tapestry.Tapestry;
import org.apache.tapestry.TapestryUtils;
import org.apache.tapestry.engine.IScriptSource;
@@ -102,19 +102,30 @@
private IScript getParsedScript()
{
+ IAsset scriptAsset = getScriptAsset();
String scriptPath = getScriptPath();
-
- if (scriptPath == null)
- throw Tapestry.createRequiredParameterException(this,
"scriptPath");
-
+
+ //only one of the two is allowed
+ if (scriptAsset != null && scriptPath != null)
+ throw new
ApplicationRuntimeException(HTMLMessages.multiAssetParameterError(getBinding("scriptAsset"),
+ getBinding("scriptPath")));
+
+ if (scriptPath == null && scriptAsset == null)
+ throw new
ApplicationRuntimeException(HTMLMessages.noScriptPathError());
+
IScriptSource source = getScriptSource();
-
- // If the script path is relative, it should be relative to the Script
component's
- // container (i.e., relative to a page in the application).
-
- Resource rootLocation =
getContainer().getSpecification().getSpecificationLocation();
- Resource scriptLocation = rootLocation.getRelativeResource(scriptPath);
-
+
+ Resource scriptLocation = null;
+ if (scriptPath != null) {
+
+ // If the script path is relative, it should be relative to the
Script component's
+ // container (i.e., relative to a page in the application).
+
+ Resource rootLocation =
getContainer().getSpecification().getSpecificationLocation();
+ scriptLocation = rootLocation.getRelativeResource(scriptPath);
+ } else
+ scriptLocation = scriptAsset.getResourceLocation();
+
try
{
return source.getScript(scriptLocation);
@@ -144,6 +155,8 @@
public abstract String getScriptPath();
+ public abstract IAsset getScriptAsset();
+
// Parameter
public abstract Map getBaseSymbols();
Modified:
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/html/Script.jwc
URL:
http://svn.apache.org/viewcvs/jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/html/Script.jwc?rev=384824&r1=384823&r2=384824&view=diff
==============================================================================
---
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/html/Script.jwc
(original)
+++
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/html/Script.jwc
Fri Mar 10 07:48:07 2006
@@ -25,9 +25,15 @@
Constructs dynamic JavaScript which is added to the page.
</description>
- <parameter name="script" property="scriptPath" required="yes">
+ <parameter name="script" property="scriptPath" >
<description>
The resource path of the script to execute.
+ </description>
+ </parameter>
+
+ <parameter name="scriptAsset" property="scriptAsset" >
+ <description>
+ IAsset reference to script.
</description>
</parameter>
Modified:
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/link/ActionLink.jwc
URL:
http://svn.apache.org/viewcvs/jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/link/ActionLink.jwc?rev=384824&r1=384823&r2=384824&view=diff
==============================================================================
---
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/link/ActionLink.jwc
(original)
+++
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/link/ActionLink.jwc
Fri Mar 10 07:48:07 2006
@@ -46,6 +46,13 @@
</description>
</parameter>
+ <parameter name="port">
+ <description>
+ Forces the link to be generated as an absolute URL with the given port
+ (unless the port matches the port for the current request).
+ </description>
+ </parameter>
+
<reserved-parameter name="href"/>
<inject property="listenerInvoker" object="infrastructure:listenerInvoker"/>
Modified:
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/link/DefaultLinkRenderer.java
URL:
http://svn.apache.org/viewcvs/jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/link/DefaultLinkRenderer.java?rev=384824&r1=384823&r2=384824&view=diff
==============================================================================
---
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/link/DefaultLinkRenderer.java
(original)
+++
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/link/DefaultLinkRenderer.java
Fri Mar 10 07:48:07 2006
@@ -112,9 +112,11 @@
ILink link = component.getLink(cycle);
String scheme = component.getScheme();
+ Integer port = component.getPort();
+ int portI = (port == null) ? 0 : port.intValue();
String anchor = component.getAnchor();
-
- return link.getURL(scheme, null, 0, anchor, true);
+
+ return link.getURL(scheme, null, portI, anchor, true);
}
/**
Modified:
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/link/DirectLink.jwc
URL:
http://svn.apache.org/viewcvs/jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/link/DirectLink.jwc?rev=384824&r1=384823&r2=384824&view=diff
==============================================================================
---
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/link/DirectLink.jwc
(original)
+++
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/link/DirectLink.jwc
Fri Mar 10 07:48:07 2006
@@ -56,6 +56,13 @@
</description>
</parameter>
+ <parameter name="port">
+ <description>
+ Forces the link to be generated as an absolute URL with the given port
+ (unless the port matches the port for the current request).
+ </description>
+ </parameter>
+
<inject property="listenerInvoker" object="infrastructure:listenerInvoker"/>
</component-specification>
Modified:
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/link/ExternalLink.jwc
URL:
http://svn.apache.org/viewcvs/jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/link/ExternalLink.jwc?rev=384824&r1=384823&r2=384824&view=diff
==============================================================================
---
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/link/ExternalLink.jwc
(original)
+++
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/link/ExternalLink.jwc
Fri Mar 10 07:48:07 2006
@@ -49,6 +49,13 @@
</description>
</parameter>
+ <parameter name="port">
+ <description>
+ Forces the link to be generated as an absolute URL with the given port
+ (unless the port matches the port for the current request).
+ </description>
+ </parameter>
+
<reserved-parameter name="href"/>
<inject property="externalService" object="engine-service:external"/>
Modified:
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/link/PageLink.jwc
URL:
http://svn.apache.org/viewcvs/jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/link/PageLink.jwc?rev=384824&r1=384823&r2=384824&view=diff
==============================================================================
---
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/link/PageLink.jwc
(original)
+++
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/link/PageLink.jwc
Fri Mar 10 07:48:07 2006
@@ -50,6 +50,13 @@
</description>
</parameter>
+ <parameter name="port">
+ <description>
+ Forces the link to be generated as an absolute URL with the given port
+ (unless the port matches the port for the current request).
+ </description>
+ </parameter>
+
<inject property="pageService" object="engine-service:page"/>
</component-specification>
Modified:
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/link/ServiceLink.jwc
URL:
http://svn.apache.org/viewcvs/jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/link/ServiceLink.jwc?rev=384824&r1=384823&r2=384824&view=diff
==============================================================================
---
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/link/ServiceLink.jwc
(original)
+++
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/link/ServiceLink.jwc
Fri Mar 10 07:48:07 2006
@@ -51,4 +51,11 @@
</description>
</parameter>
+ <parameter name="port">
+ <description>
+ Forces the link to be generated as an absolute URL with the given port
+ (unless the port matches the port for the current request).
+ </description>
+ </parameter>
+
</component-specification>
Modified:
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/wml/Go.jwc
URL:
http://svn.apache.org/viewcvs/jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/wml/Go.jwc?rev=384824&r1=384823&r2=384824&view=diff
==============================================================================
---
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/wml/Go.jwc
(original)
+++
jakarta/tapestry/branches/4.0/framework/src/java/org/apache/tapestry/wml/Go.jwc
Fri Mar 10 07:48:07 2006
@@ -84,6 +84,13 @@
</description>
</parameter>
+ <parameter name="port">
+ <description>
+ Forces the link to be generated as an absolute URL with the given port
+ (unless the port matches the port for the current request).
+ </description>
+ </parameter>
+
<reserved-parameter name="href"/>
<reserved-parameter name="name"/>
Modified:
jakarta/tapestry/branches/4.0/framework/src/test/org/apache/tapestry/BaseComponentTestCase.java
URL:
http://svn.apache.org/viewcvs/jakarta/tapestry/branches/4.0/framework/src/test/org/apache/tapestry/BaseComponentTestCase.java?rev=384824&r1=384823&r2=384824&view=diff
==============================================================================
---
jakarta/tapestry/branches/4.0/framework/src/test/org/apache/tapestry/BaseComponentTestCase.java
(original)
+++
jakarta/tapestry/branches/4.0/framework/src/test/org/apache/tapestry/BaseComponentTestCase.java
Fri Mar 10 07:48:07 2006
@@ -437,10 +437,15 @@
writer.getNestedWriter();
setReturnValue(writer, nested);
}
-
+
protected void trainGetURL(ILink link, String scheme, String anchor,
String URL)
{
- link.getURL(scheme, null, 0, anchor, true);
+ trainGetURL(link, scheme, anchor, URL, 0);
+ }
+
+ protected void trainGetURL(ILink link, String scheme, String anchor,
String URL, int port)
+ {
+ link.getURL(scheme, null, port, anchor, true);
setReturnValue(link, URL);
}
Modified:
jakarta/tapestry/branches/4.0/framework/src/test/org/apache/tapestry/form/FormSupportTest.java
URL:
http://svn.apache.org/viewcvs/jakarta/tapestry/branches/4.0/framework/src/test/org/apache/tapestry/form/FormSupportTest.java?rev=384824&r1=384823&r2=384824&view=diff
==============================================================================
---
jakarta/tapestry/branches/4.0/framework/src/test/org/apache/tapestry/form/FormSupportTest.java
(original)
+++
jakarta/tapestry/branches/4.0/framework/src/test/org/apache/tapestry/form/FormSupportTest.java
Fri Mar 10 07:48:07 2006
@@ -206,7 +206,7 @@
replayControls();
- fs.render("post", render, link, null);
+ fs.render("post", render, link, null, null);
verifyControls();
}
@@ -320,7 +320,7 @@
replayControls();
- fs.render("post", render, link, null);
+ fs.render("post", render, link, null, null);
verifyControls();
}
@@ -390,7 +390,7 @@
replayControls();
- fs.render("post", render, link, null);
+ fs.render("post", render, link, null, null);
verifyControls();
}
@@ -520,7 +520,7 @@
replayControls();
- fs.render("post", render, link, null);
+ fs.render("post", render, link, null, null);
verifyControls();
}
@@ -573,7 +573,7 @@
try
{
- fs.render("post", render, link, null);
+ fs.render("post", render, link, null, null);
unreachable();
}
catch (ApplicationRuntimeException ex)
@@ -696,7 +696,7 @@
replayControls();
- fs.render("post", render, link, null);
+ fs.render("post", render, link, null, null);
verifyControls();
}
@@ -771,7 +771,7 @@
replayControls();
- fs.render("post", render, link, null);
+ fs.render("post", render, link, null, null);
verifyControls();
}
@@ -1051,7 +1051,7 @@
replayControls();
- fs.render("post", render, link, null);
+ fs.render("post", render, link, null, null);
verifyControls();
}
@@ -1140,7 +1140,7 @@
replayControls();
- fs.render("post", render, link, null);
+ fs.render("post", render, link, null, null);
verifyControls();
}
@@ -1154,9 +1154,9 @@
IValidationDelegate delegate = newDelegate();
ILink link = newLink();
IRender render = newRender();
-
+
MockForm form = new MockForm(delegate);
-
+
trainIsRewound(cycle, form, false);
trainGetEngine(cycle, engine);
@@ -1186,7 +1186,7 @@
trainGetNestedWriter(writer, nested);
- trainGetURL(link, "https", "https://foo.bar/app");
+ trainGetURL(link, "https", "https://foo.bar/app", 443);
writer.begin("form");
writer.attribute("method", "post");
@@ -1213,7 +1213,7 @@
replayControls();
- fs.render("post", render, link, "https");
+ fs.render("post", render, link, "https", new Integer(443));
verifyControls();
}
@@ -1376,7 +1376,7 @@
replayControls();
- fs.render("post", render, link, null);
+ fs.render("post", render, link, null, null);
verifyControls();
}
@@ -1417,12 +1417,17 @@
setReturnValue(delegate, fieldName);
}
- private void trainGetURL(ILink link, String scheme, String URL)
+ private void trainGetURL(ILink link, String scheme, String URL, int port)
{
// This will change shortly, with the new scheme parameter passed into
FormSupport.render()
- link.getURL(scheme, null, 0, null, false);
+ link.getURL(scheme, null, port, null, false);
setReturnValue(link, URL);
+ }
+
+ private void trainGetURL(ILink link, String scheme, String URL)
+ {
+ trainGetURL(link, scheme, URL, 0);
}
private void trainHidden(IMarkupWriter writer, String name, String value)
Modified:
jakarta/tapestry/branches/4.0/framework/src/test/org/apache/tapestry/form/FormTest.java
URL:
http://svn.apache.org/viewcvs/jakarta/tapestry/branches/4.0/framework/src/test/org/apache/tapestry/form/FormTest.java?rev=384824&r1=384823&r2=384824&view=diff
==============================================================================
---
jakarta/tapestry/branches/4.0/framework/src/test/org/apache/tapestry/form/FormTest.java
(original)
+++
jakarta/tapestry/branches/4.0/framework/src/test/org/apache/tapestry/form/FormTest.java
Fri Mar 10 07:48:07 2006
@@ -165,7 +165,7 @@
new DirectServiceParameter(form),
link);
- trainRender(support, link, render, null);
+ trainRender(support, link, render, null, null);
delegate.setFormComponent(null);
@@ -192,7 +192,7 @@
Form form = (Form) newInstance(FormFixture.class, new Object[]
{ "id", "myform", "direct", true, "expectedWriter", writer,
"expectedRequestCycle", cycle,
"formSupport", support, "response", response, "directService",
direct, "method",
- "post", "delegate", delegate, "scheme", "https" });
+ "post", "delegate", delegate, "scheme", "https", "port", new
Integer(443) });
trainStoreForm(cycle, form);
@@ -211,7 +211,7 @@
new DirectServiceParameter(form),
link);
- trainRender(support, link, render, "https");
+ trainRender(support, link, render, "https", new Integer(443));
delegate.setFormComponent(null);
@@ -231,9 +231,9 @@
cycle.setAttribute(TapestryUtils.FORM_ATTRIBUTE, form);
}
- private void trainRender(FormSupport support, ILink link, IRender render,
String scheme)
+ private void trainRender(FormSupport support, ILink link, IRender render,
String scheme, Integer port)
{
- support.render("post", render, link, scheme);
+ support.render("post", render, link, scheme, port);
getControl(support).setMatcher(new AggregateArgumentsMatcher(new
ArgumentMatcher[]
{ null, new IgnoreMatcher(), null, null }));
}
Modified:
jakarta/tapestry/branches/4.0/framework/src/test/org/apache/tapestry/html/ScriptTest.java
URL:
http://svn.apache.org/viewcvs/jakarta/tapestry/branches/4.0/framework/src/test/org/apache/tapestry/html/ScriptTest.java?rev=384824&r1=384823&r2=384824&view=diff
==============================================================================
---
jakarta/tapestry/branches/4.0/framework/src/test/org/apache/tapestry/html/ScriptTest.java
(original)
+++
jakarta/tapestry/branches/4.0/framework/src/test/org/apache/tapestry/html/ScriptTest.java
Fri Mar 10 07:48:07 2006
@@ -17,8 +17,10 @@
import java.util.HashMap;
import java.util.Map;
+import org.apache.hivemind.ApplicationRuntimeException;
import org.apache.hivemind.Resource;
import org.apache.tapestry.BaseComponentTestCase;
+import org.apache.tapestry.IAsset;
import org.apache.tapestry.IBinding;
import org.apache.tapestry.IComponent;
import org.apache.tapestry.IMarkupWriter;
@@ -79,9 +81,9 @@
source, "scriptPath", scriptPath });
trainGetPageRenderSupport(cycle, support);
-
+
trainGetScriptLocation(container, scriptPath, scriptLocation);
-
+
trainGetScript(source, scriptLocation, script);
script.execute(cycle, support, new HashMap());
@@ -208,6 +210,79 @@
verifyControls();
}
+ public void testMultiParamException()
+ {
+ IScriptSource source = newScriptSource();
+
+ PageRenderSupport support = newPageRenderSupport();
+ IRequestCycle cycle = newCycle(false);
+ IMarkupWriter writer = newWriter();
+ IRender body = newRender();
+
+ IComponent container = newComponent();
+
+ String scriptPath = "MyScript.script";
+
+ IAsset scriptAsset = newAsset();
+
+ Script component = (Script) newInstance(Script.class, new Object[]
+ { "specification", new ComponentSpecification(), "container",
container, "scriptSource",
+ source, "scriptPath", scriptPath, "scriptAsset", scriptAsset
});
+
+ trainGetPageRenderSupport(cycle, support);
+
+ replayControls();
+
+ component.addBody(body);
+
+ try {
+ component.renderComponent(writer, cycle);
+ } catch (ApplicationRuntimeException ex) {
+ assertExceptionSubstring(ex, "Script component has both script
IAsset");
+ }
+
+ verifyControls();
+ }
+
+ public void testIAssetParamRender()
+ {
+ IScriptSource source = newScriptSource();
+ IScript script = newScript();
+
+ PageRenderSupport support = newPageRenderSupport();
+ IRequestCycle cycle = newCycle(false);
+ IMarkupWriter writer = newWriter();
+ Resource scriptLocation = newResource();
+ IRender body = newRender();
+
+ IComponent container = newComponent();
+
+ IAsset scriptAsset = newAsset();
+
+ scriptAsset.getResourceLocation();
+ setReturnValue(scriptAsset, scriptLocation);
+
+ Script component = (Script) newInstance(Script.class, new Object[]
+ { "specification", new ComponentSpecification(), "container",
container, "scriptSource",
+ source, "scriptAsset", scriptAsset });
+
+ trainGetPageRenderSupport(cycle, support);
+
+ trainGetScript(source, scriptLocation, script);
+
+ script.execute(cycle, support, new HashMap());
+
+ body.render(writer, cycle);
+
+ replayControls();
+
+ component.addBody(body);
+
+ component.renderComponent(writer, cycle);
+
+ verifyControls();
+ }
+
protected IScript newScript()
{
return (IScript) newMock(IScript.class);
Modified:
jakarta/tapestry/branches/4.0/framework/src/test/org/apache/tapestry/link/DefaultLinkRendererTest.java
URL:
http://svn.apache.org/viewcvs/jakarta/tapestry/branches/4.0/framework/src/test/org/apache/tapestry/link/DefaultLinkRendererTest.java?rev=384824&r1=384823&r2=384824&view=diff
==============================================================================
---
jakarta/tapestry/branches/4.0/framework/src/test/org/apache/tapestry/link/DefaultLinkRendererTest.java
(original)
+++
jakarta/tapestry/branches/4.0/framework/src/test/org/apache/tapestry/link/DefaultLinkRendererTest.java
Fri Mar 10 07:48:07 2006
@@ -163,6 +163,7 @@
trainGetLink(component, cycle, link);
trainGetScheme(component, null);
+ trainGetPort(component, null);
trainGetAnchor(component, null);
trainGetURL(link, null, null, "/foo/bar.baz");
@@ -195,7 +196,13 @@
component.getScheme();
setReturnValue(component, scheme);
}
-
+
+ protected void trainGetPort(ILinkComponent component, Integer port)
+ {
+ component.getPort();
+ setReturnValue(component, port);
+ }
+
public void testStandardWithSchemaAnchorAndTarget()
{
IMarkupWriter writer = newWriter();
@@ -216,6 +223,8 @@
trainGetScheme(component, "https");
+ trainGetPort(component, null);
+
trainGetAnchor(component, "my-anchor");
trainGetURL(link, "https", "my-anchor",
"http://zap.com/foo/bar.baz#my-anchor");
@@ -231,11 +240,11 @@
component.renderBody(nested, cycle);
component.renderAdditionalAttributes(writer, cycle);
-
+
nested.close();
-
+
writer.end();
-
+
cycle.removeAttribute(Tapestry.LINK_COMPONENT_ATTRIBUTE_NAME);
replayControls();
@@ -310,6 +319,8 @@
trainGetScheme(component, null);
+ trainGetPort(component, null);
+
trainGetAnchor(component, "my-anchor");
trainGetURL(link, null, "my-anchor", "/foo/bar.baz#my-anchor");
@@ -367,6 +378,8 @@
trainGetScheme(component, null);
+ trainGetPort(component, null);
+
trainGetAnchor(component, "my-anchor");
trainGetURL(link, null, "my-anchor", "/foo/bar.baz#my-anchor");
Modified:
jakarta/tapestry/branches/4.0/src/documentation/content/xdocs/UsersGuide/page-class.xml
URL:
http://svn.apache.org/viewcvs/jakarta/tapestry/branches/4.0/src/documentation/content/xdocs/UsersGuide/page-class.xml?rev=384824&r1=384823&r2=384824&view=diff
==============================================================================
---
jakarta/tapestry/branches/4.0/src/documentation/content/xdocs/UsersGuide/page-class.xml
(original)
+++
jakarta/tapestry/branches/4.0/src/documentation/content/xdocs/UsersGuide/page-class.xml
Fri Mar 10 07:48:07 2006
@@ -84,7 +84,7 @@
<note>
These steps are specified in the
-<link
href="&hivedoc;/config/tapestry.page.PageClassProviderChain">tapestry.page.PageClassProviderChain</link>
+<link
href="&hivedoc;/config/tapestry.page.PageClassProviderChain.html">tapestry.page.PageClassProviderChain</link>
configuration point.
</note>
@@ -112,7 +112,7 @@
<note>
These steps are specified in the
-<link
href="&hivedoc;/config/tapestry.page.ComponentClassProviderChain">tapestry.page.ComponentClassProviderChain</link>
+<link
href="&hivedoc;/config/tapestry.page.ComponentClassProviderChain.html">tapestry.page.ComponentClassProviderChain</link>
configuration point.
</note>
</section>
Modified: jakarta/tapestry/branches/4.0/status.xml
URL:
http://svn.apache.org/viewcvs/jakarta/tapestry/branches/4.0/status.xml?rev=384824&r1=384823&r2=384824&view=diff
==============================================================================
--- jakarta/tapestry/branches/4.0/status.xml (original)
+++ jakarta/tapestry/branches/4.0/status.xml Fri Mar 10 07:48:07 2006
@@ -107,6 +107,18 @@
The patch against trunk simply adds a check in the lastIndexOf as it
is
assumed to be > -1 although the results of the check are used
differently
</action>
+ <action type="fix" dev="JK" fixes-bug="TAPESTRY-880" due-to="Fernando
Padilla" >
+ need 'port' parameter to supplement 'scheme' parameter for correct
generation of urls
+ </action>
+ <action type="fix" dev="JK" fixes-bug="TAPESTRY-879" due-to="Olve
Sæther Hansen" >
+ http://jakarta.apache.org/tapestry/UsersGuide/page-class.html
+ Has broken links to documentation about
+ tapestry.page.PageClassProviderChain and
tapestry.page.ComponentClassProviderChain
+ </action>
+ <action type="fix" dev="JK" fixes-bug="TAPESTRY-453" >
+ Added new scriptAsset parameter, as well as param checking to be sure
that only one
+ of scriptPath or scriptAsset can be set.
+ </action>
</release>
<release version="4.0" date="Jan 6 2006">
<action type="update" dev="HLS">Add link to DeveloperWorks Tapestry
article</action>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]