Author: rich
Date: Sun Apr 24 20:26:17 2005
New Revision: 164533
URL: http://svn.apache.org/viewcvs?rev=164533&view=rev
Log:
This is a contribution from Carlin Rogers to address
http://issues.apache.org/jira/browse/BEEHIVE-490 : Provide a mechanism
(netui-config flag) to allow overriding URL encoding of href attributes in tags
.
Also, reinstated a bunch of defunct JSF tests.
tests: bvt in netui, bvt.myfaces in netui/test/webapps/jsf, bvt.jsf-ri in
netui/test/webapps/jsf-ri
BB: self (linux)
Added:
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/URIContextFactory.java
(with props)
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/core/urls/URIContext.java
(with props)
Removed:
incubator/beehive/trunk/netui/test/webapps/jsf/jsf-myfaces.xml
incubator/beehive/trunk/netui/test/webapps/jsf/jsf-ri.xml
incubator/beehive/trunk/netui/test/webapps/jsf/testRecorder/tests-jsf-ri/FacesSmokeConversions.xml
Modified:
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowUtils.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/DefaultURLRewriter.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Form.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RewriteURL.java
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/core/urls/DefaultTemplatedURLFormatter.java
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/core/urls/MutableURI.java
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/core/urls/TemplatedURLFormatter.java
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/core/urls/URLRewriterService.java
incubator/beehive/trunk/netui/test/src/junitTests/org/apache/beehive/netui/test/core/urls/FreezableMutableURITest.java
incubator/beehive/trunk/netui/test/src/junitTests/org/apache/beehive/netui/test/core/urls/MutableURITest.java
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/pageFlowUtils/index.jsp
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridCSSPrefix.xml
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridCaptionTest.xml
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridCustomHeaderStyle.xml
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridCustomTagAttributes.xml
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridFooterTest.xml
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridHeaderCellDecorator.xml
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridHeaderTest.xml
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridJavaScriptSmoke.xml
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridMessageOverrides.xml
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridModelTest.xml
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridPagerBasic.xml
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridPagerCustomSelect.xml
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridPagerInCaption.xml
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridPagerInFooter.xml
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridPagerOverride.xml
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridPagerRendererSmoke.xml
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridPagerStickyParam.xml
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridRowGroups.xml
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridRowGroupsEmptyStyle.xml
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridScriptletTagFile.xml
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridSimpleSort.xml
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridSmokeTest.xml
incubator/beehive/trunk/netui/test/webapps/jsf/build.xml
incubator/beehive/trunk/netui/test/webapps/jsf/testRecorder/config/testRecorder-tests.xml
incubator/beehive/trunk/netui/test/webapps/jsf/testRecorder/tests-jsf-ri/FacesSmokeAnchors.xml
incubator/beehive/trunk/netui/test/webapps/jsf/testRecorder/tests-jsf-ri/FacesSmokeBundle.xml
incubator/beehive/trunk/netui/test/webapps/jsf/testRecorder/tests-jsf-ri/FacesSmokeDataTable.xml
incubator/beehive/trunk/netui/test/webapps/jsf/testRecorder/tests-jsf-ri/FacesSmokeFormOne.xml
incubator/beehive/trunk/netui/test/webapps/jsf/testRecorder/tests-jsf-ri/FacesSmokeFormTwo.xml
incubator/beehive/trunk/netui/test/webapps/jsf/testRecorder/tests-jsf-ri/FacesSmokeImage.xml
incubator/beehive/trunk/netui/test/webapps/jsf/testRecorder/tests-jsf-ri/FacesSmokePanel.xml
Modified:
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java?rev=164533&r1=164532&r2=164533&view=diff
==============================================================================
---
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java
(original)
+++
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java
Sun Apr 24 20:26:17 2005
@@ -1991,7 +1991,7 @@
* @param actionName the action name to convert into a fully-rewritten URI.
* @param parameters the additional parameters to include in the URI query.
* @param asValidXml flag indicating that the query of the uri should be
written
- * using the "&" entity, rather than the character,
'&'.
+ * using the "&" entity, rather than
the character, '&'
* @return a fully-rewritten URI for the given action.
* @throws URISyntaxException if there is a problem converting the
action url (derived
* from processing the given action name)
into a URI.
Modified:
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowUtils.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowUtils.java?rev=164533&r1=164532&r2=164533&view=diff
==============================================================================
---
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowUtils.java
(original)
+++
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowUtils.java
Sun Apr 24 20:26:17 2005
@@ -21,6 +21,7 @@
import org.apache.beehive.netui.core.urls.FreezableMutableURI;
import org.apache.beehive.netui.core.urls.MutableURI;
+import org.apache.beehive.netui.core.urls.URIContext;
import org.apache.beehive.netui.core.urls.URLRewriterService;
import org.apache.beehive.netui.core.urls.URLType;
import org.apache.beehive.netui.core.urltemplates.URLTemplateDescriptor;
@@ -29,11 +30,14 @@
import org.apache.beehive.netui.pageflow.internal.InternalConstants;
import org.apache.beehive.netui.pageflow.internal.AdapterManager;
import org.apache.beehive.netui.pageflow.internal.PageFlowRequestWrapper;
+import org.apache.beehive.netui.pageflow.internal.URIContextFactory;
import org.apache.beehive.netui.pageflow.scoping.ScopedRequest;
import org.apache.beehive.netui.pageflow.scoping.ScopedResponse;
import org.apache.beehive.netui.pageflow.scoping.ScopedServletUtils;
import org.apache.beehive.netui.util.internal.FileUtils;
import org.apache.beehive.netui.util.internal.ServletUtils;
+import org.apache.beehive.netui.util.config.ConfigUtil;
+import org.apache.beehive.netui.util.config.bean.UrlConfig;
import org.apache.beehive.netui.util.logging.Logger;
import org.apache.beehive.netui.script.common.ImplicitObjectUtil;
import org.apache.struts.action.ActionForm;
@@ -1273,8 +1277,9 @@
{
String qualifiedAction = InternalUtils.qualifyAction( servletContext,
actionName );
String actionUrl = InternalUtils.createActionURL( request,
qualifiedAction );
- FreezableMutableURI uri = new FreezableMutableURI( actionUrl, true );
+ FreezableMutableURI uri = new FreezableMutableURI();
uri.setEncoding( response.getCharacterEncoding() );
+ uri.setURI( actionUrl, true );
return uri;
}
@@ -1289,7 +1294,7 @@
* @param params the additional parameters to include in the URI query.
* @param fragment the fragment (anchor or location) for this url.
* @param forXML flag indicating that the query of the uri should be
written
- * using the "&" entity, rather than the character, '&'.
+ * using the "&" entity, rather than the
character, '&'.
* @return a fully-rewritten URI for the given action.
* @throws URISyntaxException if there is a problem converting the action
URI (derived
* from processing the given action name) into
a MutableURI.
@@ -1301,8 +1306,9 @@
{
String qualifiedAction = InternalUtils.qualifyAction( servletContext,
actionName );
String actionUrl = InternalUtils.createActionURL( request,
qualifiedAction );
- FreezableMutableURI uri = new FreezableMutableURI( actionUrl, true );
+ FreezableMutableURI uri = new FreezableMutableURI();
uri.setEncoding( response.getCharacterEncoding() );
+ uri.setURI( actionUrl, true );
if ( params != null )
{
@@ -1317,8 +1323,9 @@
boolean needsToBeSecure = needsToBeSecure( servletContext, request,
actionUrl, true );
URLRewriterService.rewriteURL( servletContext, request, response, uri,
URLType.ACTION, needsToBeSecure );
String key = getURLTemplateKey( URLType.ACTION, needsToBeSecure );
+ URIContext uriContext = URIContextFactory.getInstance( forXML );
- return URLRewriterService.getTemplatedURL( request, uri, key, forXML );
+ return URLRewriterService.getTemplatedURL( request, uri, key,
uriContext );
}
/**
@@ -1333,7 +1340,7 @@
* @param params the additional parameters to include in the URI query.
* @param fragment the fragment (anchor or location) for this URI.
* @param forXML flag indicating that the query of the uri should be
written
- * using the "&" entity, rather than the character, '&'.
+ * using the "&" entity, rather than the
character, '&'.
* @return a fully-rewritten URI for the given action.
* @throws URISyntaxException if there's a problem converting the action
URI (derived
* from processing the given action name) into
a MutableURI.
@@ -1358,7 +1365,7 @@
* @param params the additional parameters to include in the URI query.
* @param fragment the fragment (anchor or location) for this URI.
* @param forXML flag indicating that the query of the uri should be
written
- * using the "&" entity, rather than the character, '&'.
+ * using the "&" entity, rather than the
character, '&'.
* @return a fully-rewritten URI for the given action.
* @throws URISyntaxException if there's a problem converting the action
URI (derived
* from processing the given action name) into
a MutableURI.
@@ -1376,8 +1383,16 @@
String fragment, boolean
forXML, URLType urlType )
throws URISyntaxException
{
- FreezableMutableURI uri = new FreezableMutableURI( path, false );
+ boolean encoded = false;
+ UrlConfig urlConfig = ConfigUtil.getConfig().getUrlConfig();
+
+ if (urlConfig != null && urlConfig.isSetUrlEncodeUrls()) {
+ encoded = !urlConfig.getUrlEncodeUrls();
+ }
+
+ FreezableMutableURI uri = new FreezableMutableURI();
uri.setEncoding( response.getCharacterEncoding() );
+ uri.setURI( path, encoded );
if ( params != null )
{
@@ -1389,14 +1404,10 @@
uri.setFragment( uri.encode( fragment ) );
}
+ URIContext uriContext = URIContextFactory.getInstance( forXML );
if ( uri.isAbsolute() )
{
- if ( forXML )
- {
- return uri.getURIStringForXML();
- }
-
- return uri.getURIString();
+ return uri.getURIString( uriContext );
}
if ( path.length() != 0 && path.charAt( 0 ) != '/' )
@@ -1410,7 +1421,7 @@
URLRewriterService.rewriteURL( servletContext, request, response, uri,
urlType, needsToBeSecure );
String key = getURLTemplateKey( urlType, needsToBeSecure );
- return URLRewriterService.getTemplatedURL( request, uri, key, forXML );
+ return URLRewriterService.getTemplatedURL( request, uri, key,
uriContext );
}
/**
Modified:
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/DefaultURLRewriter.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/DefaultURLRewriter.java?rev=164533&r1=164532&r2=164533&view=diff
==============================================================================
---
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/DefaultURLRewriter.java
(original)
+++
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/DefaultURLRewriter.java
Sun Apr 24 20:26:17 2005
@@ -61,8 +61,8 @@
{
if (_log.isWarnEnabled())
{
- _log.warn("Could not rewrite URL " +
url.getURIString() + " to be secure because a secure port was" +
- " not provided by the
ServletContainerAdapter.");
+ _log.warn("Could not rewrite URL " +
url.getURIString( null ) + " to be secure because" +
+ " a secure port was not provided by the
ServletContainerAdapter.");
}
}
}
@@ -81,8 +81,8 @@
{
if (_log.isWarnEnabled())
{
- _log.warn("Could not rewrite URL " +
url.getURIString() + " to be non-secure because a secure port was" +
- " not provided by the
ServletContainerAdapter.");
+ _log.warn("Could not rewrite URL " +
url.getURIString( null ) + " to be non-secure" +
+ " because a port was not provided by the
ServletContainerAdapter.");
}
}
}
Added:
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/URIContextFactory.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/URIContextFactory.java?rev=164533&view=auto
==============================================================================
---
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/URIContextFactory.java
(added)
+++
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/URIContextFactory.java
Sun Apr 24 20:26:17 2005
@@ -0,0 +1,85 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+package org.apache.beehive.netui.pageflow.internal;
+
+import org.apache.beehive.netui.core.urls.MutableURI;
+import org.apache.beehive.netui.core.urls.URIContext;
+import org.apache.beehive.netui.util.config.ConfigUtil;
+import org.apache.beehive.netui.util.config.bean.UrlConfig;
+
+/**
+ * Factory for the [EMAIL PROTECTED] URIContext} with the data needed to write
out
+ * a string form of a [EMAIL PROTECTED] MutableURI}.
+ */
+public final class URIContextFactory
+{
+
+ /* do not construct */
+ private URIContextFactory()
+ {
+ }
+
+ /**
+ * Get a URIContext. The context has data used to write a MutableURI
+ * as a string. For example, it will indicate that the URI should be
+ * written using the "&" entity, rather than the
+ * character, '&'. This returns the default context, but also
+ * checks for any overriding setting in the NetUI config.
+ *
+ * @return the URIContext
+ */
+ public static final URIContext getInstance()
+ {
+ URIContext uriContext = MutableURI.getDefaultContext();
+ UrlConfig urlConfig = ConfigUtil.getConfig().getUrlConfig();
+
+ if ( urlConfig != null && urlConfig.isSetHtmlAmpEntity() )
+ {
+ uriContext.setUseAmpEntity( urlConfig.getHtmlAmpEntity() );
+ }
+
+ return uriContext;
+ }
+
+ /**
+ * Get a URIContext. If it's for an XML document type, the context
+ * will indicate that the URI should be written using the
+ * "&" entity, rather than the character, '&'.
+ * If it's not for an XML doc type, then use the default context,
+ * but check for any overriding setting in the NetUI config.
+ *
+ * @param forXML flag indicating that the URI is for an XML doc type
+ * @return the URIContext
+ */
+ public static final URIContext getInstance( boolean forXML )
+ {
+ URIContext uriContext = null;
+
+ if ( forXML )
+ {
+ uriContext = new URIContext();
+ uriContext.setUseAmpEntity( true );
+ }
+ else
+ {
+ uriContext = getInstance();
+ }
+
+ return uriContext;
+ }
+}
Propchange:
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/internal/URIContextFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Form.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Form.java?rev=164533&r1=164532&r2=164533&view=diff
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Form.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Form.java
Sun Apr 24 20:26:17 2005
@@ -20,6 +20,7 @@
import org.apache.beehive.netui.util.internal.InternalStringBuilder;
import org.apache.beehive.netui.core.urls.MutableURI;
+import org.apache.beehive.netui.core.urls.URIContext;
import org.apache.beehive.netui.core.urls.URLType;
import org.apache.beehive.netui.core.urls.URLRewriterService;
import org.apache.beehive.netui.pageflow.FlowController;
@@ -27,6 +28,7 @@
import org.apache.beehive.netui.pageflow.handler.Handlers;
import org.apache.beehive.netui.pageflow.internal.InternalConstants;
import org.apache.beehive.netui.pageflow.internal.InternalUtils;
+import org.apache.beehive.netui.pageflow.internal.URIContextFactory;
import org.apache.beehive.netui.pageflow.scoping.ScopedServletUtils;
import org.apache.beehive.netui.script.common.ImplicitObjectUtil;
import org.apache.beehive.netui.tags.TagConfig;
@@ -928,7 +930,8 @@
}
String key = PageFlowUtils.getURLTemplateKey(URLType.ACTION,
needsToBeSecure);
- String rewrittenURI = URLRewriterService.getTemplatedURL(request, uri,
key, forXML);
+ URIContext uriContext = URIContextFactory.getInstance(forXML);
+ String rewrittenURI = URLRewriterService.getTemplatedURL(request, uri,
key, uriContext);
return rewrittenURI;
}
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RewriteURL.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RewriteURL.java?rev=164533&r1=164532&r2=164533&view=diff
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RewriteURL.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RewriteURL.java
Sun Apr 24 20:26:17 2005
@@ -18,13 +18,17 @@
package org.apache.beehive.netui.tags.html;
import org.apache.beehive.netui.core.urls.FreezableMutableURI;
+import org.apache.beehive.netui.core.urls.URIContext;
import org.apache.beehive.netui.core.urls.URLType;
import org.apache.beehive.netui.core.urls.URLRewriterService;
import org.apache.beehive.netui.pageflow.PageFlowUtils;
+import org.apache.beehive.netui.pageflow.internal.URIContextFactory;
import org.apache.beehive.netui.tags.AbstractClassicTag;
import org.apache.beehive.netui.tags.rendering.TagRenderingBase;
import org.apache.beehive.netui.util.Bundle;
import org.apache.beehive.netui.util.ParamHelper;
+import org.apache.beehive.netui.util.config.ConfigUtil;
+import org.apache.beehive.netui.util.config.bean.UrlConfig;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
@@ -123,9 +127,16 @@
ServletContext context = pageContext.getServletContext();
try {
- boolean needsToBeSecure = false;
- FreezableMutableURI uri = new FreezableMutableURI(url, false);
+ boolean encoded = false;
+ UrlConfig urlConfig = ConfigUtil.getConfig().getUrlConfig();
+ if (urlConfig != null && urlConfig.isSetUrlEncodeUrls()) {
+ encoded = !urlConfig.getUrlEncodeUrls();
+ }
+
+ FreezableMutableURI uri = new FreezableMutableURI();
uri.setEncoding(response.getCharacterEncoding());
+ uri.setURI(url, encoded);
+ boolean needsToBeSecure = false;
if (_params != null) {
uri.addParameters(_params, false );
}
@@ -136,7 +147,8 @@
URLRewriterService.rewriteURL(context, request, response, uri,
URLType.ACTION, needsToBeSecure);
String key = PageFlowUtils.getURLTemplateKey(URLType.ACTION,
needsToBeSecure);
boolean forXML = TagRenderingBase.Factory.isXHTML(request);
- String uriString = URLRewriterService.getTemplatedURL(request,
uri, key, forXML);
+ URIContext uriContext = URIContextFactory.getInstance(forXML);
+ String uriString = URLRewriterService.getTemplatedURL(request,
uri, key, uriContext);
write(response.encodeURL(uriString));
}
catch (URISyntaxException e) {
Modified:
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/core/urls/DefaultTemplatedURLFormatter.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/core/urls/DefaultTemplatedURLFormatter.java?rev=164533&r1=164532&r2=164533&view=diff
==============================================================================
---
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/core/urls/DefaultTemplatedURLFormatter.java
(original)
+++
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/core/urls/DefaultTemplatedURLFormatter.java
Sun Apr 24 20:26:17 2005
@@ -33,7 +33,20 @@
{
private static final String DEFAULT_TEMPLATE_REF = "default-url-templates";
- public String getTemplatedURL( ServletRequest request, MutableURI uri,
String key, boolean forXML )
+ /**
+ * Format the given URL using a URL template, if defined in a URL
+ * template config file. The [EMAIL PROTECTED] URIContext}
+ * encapsulates some additional data needed to write out the string form.
+ * E.g. It defines if the "&" entity or the
+ * '&' character should be used to separate quary parameters.
+ *
+ * @param request the current ServletRequest.
+ * @param uri the MutableURI to be formatted into a String.
+ * @param key key for the URL template type to use for formatting the URI
+ * @param uriContext data required to write out the string form.
+ * @return the URL as a <code>String</code>
+ */
+ public String getTemplatedURL( ServletRequest request, MutableURI uri,
String key, URIContext uriContext )
{
// Look for the template config and get the right template.
// If it is found, apply the value to the template.
@@ -43,32 +56,19 @@
if ( templateName != null )
{
URLTemplate template =
URLTemplateDescriptor.getInstance().getURLTemplate( templateName );
- result = formatURIWithTemplate( request, uri, forXML, template );
+ result = formatURIWithTemplate( request, uri, uriContext, template
);
}
else
{
// no template found, just return the uri as a String...
- if ( forXML )
- {
- result = uri.getURIStringForXML();
- }
- else
- {
- UrlConfig urlConfig = ConfigUtil.getConfig().getUrlConfig();
- if (urlConfig == null) {
- result = uri.getURIStringForXML();
- }
- else {
- result = (urlConfig.getHtmlAmpEntity()) ?
uri.getURIStringForXML() : uri.getURIString();
- }
- }
+ result = uri.getURIString( uriContext );
}
return result;
}
private String formatURIWithTemplate( ServletRequest request, MutableURI
uri,
- boolean forXML, URLTemplate template
)
+ URIContext uriContext, URLTemplate
template )
{
String scheme = uri.getScheme();
String host = uri.getHost();
@@ -86,14 +86,7 @@
template.substitute( URLTemplateDescriptor.PATH_TOKEN, uri.getPath() );
String query = null;
- if ( forXML )
- {
- query = uri.getQueryForXML();
- }
- else
- {
- query = uri.getQuery();
- }
+ query = uri.getQuery( uriContext );
if ( query == null ) {
query = "";
Modified:
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/core/urls/MutableURI.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/core/urls/MutableURI.java?rev=164533&r1=164532&r2=164533&view=diff
==============================================================================
---
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/core/urls/MutableURI.java
(original)
+++
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/core/urls/MutableURI.java
Sun Apr 24 20:26:17 2005
@@ -64,7 +64,7 @@
/** Value used to set the port as undefined. */
public static final int UNDEFINED_PORT = -1;
- /** Value used to set the port as undefined. */
+ /** Value used to set the encoding as undefined. */
public static final String DEFAULT_ENCODING = "UTF-8";
/** Character encoding used for the URI. */
@@ -95,10 +95,9 @@
/** Fragment */
private String _fragment;
- /** Delimiter for query parameters */
- private String _defaultParamDelimiter = PARAM_DELIMITER;
- private static final String PARAM_DELIMITER = "&";
- private static final String PARAM_DELIMITER_FOR_XML = "&";
+ /* Separators for query parameters */
+ private static final String AMP_ENTITY = "&";
+ private static final String AMP_CHAR = "&";
private static final Map/*< String, List< String > >*/ EMPTY_MAP =
Collections.unmodifiableMap( new HashMap/*< String, List< String >
>*/() );
@@ -223,7 +222,7 @@
*/
public void setURI( String uriString, boolean encoded ) throws
URISyntaxException
{
- if ( uriString == null || uriString.trim().length() == 0 )
+ if ( uriString == null )
{
setScheme( null );
setUserInfo( null );
@@ -448,49 +447,9 @@
}
/**
- * Sets the value of the delimiter used between each query parameter in
- * the query to be the XML "&amp;" entity, even for calls to
- * the [EMAIL PROTECTED] #getQuery()} and [EMAIL PROTECTED]
#getURIString()} methods.
- *
- * <p> The [EMAIL PROTECTED] #getQueryForXML()} and [EMAIL PROTECTED]
#getURIStringForXML()} methods
- * always use the XML "&amp;" entity as the delimeter.
However,
- * the [EMAIL PROTECTED] #getQuery()} and [EMAIL PROTECTED]
#getURIString()} methods
- * use a default delimeter value which initially is set to be the
- * '&' character. This method lets a client override this value such
- * that even the [EMAIL PROTECTED] #getQuery()} and [EMAIL PROTECTED]
#getURIString()} methods
- * will return strings with the XML "&amp;" entity as the
- * delimiter between the parameters in the query . </p>
- *
- * @param alwaysForXml flag for choosing the query parameter delimiter.
- */
- public void setAlwaysForXML( boolean alwaysForXml )
- {
- if ( alwaysForXml )
- {
- _defaultParamDelimiter = PARAM_DELIMITER_FOR_XML;
- }
- else
- {
- _defaultParamDelimiter = PARAM_DELIMITER;
- }
- }
-
- /**
- * Returns the value of the delimiter used between each query parameter
- * in the .
- *
- * @return query parameter delimiter.
- */
- public String getDefaultParamDelimiter()
- {
- return _defaultParamDelimiter;
- }
-
- /**
* Sets (and resets) the query string.
* This method assumes that the query is already encoded and
- * escaped and where the parameter delimiter is the '&'
- * character.
+ * escaped.
*
* @param query Query string
*/
@@ -524,40 +483,28 @@
/**
* Returns the query string (encoded/escaped).
*
- * <p> This uses a default delimiter to separate the parameters, usually
- * the "&" character unless the instance has been set to
- * always write the query for XML. In this case the delimiter value is
- * the XML "&amp;" entity. </p>
- *
- * @return encoded query string.
- */
- public String getQuery()
- {
- return getQuery( getDefaultParamDelimiter() );
- }
-
- /**
- * Returns the query string (encoded) to be used in an XML document.
- *
- * <p> This uses the XML "&amp;" entity as the demilimeter
- * to separate the parameters. </p>
+ * <p> The context states whether or not to use the default delimiter,
+ * usually the "&amp;" entity, to separate the parameters.
+ * Otherwise, the "&" character is used. </p>
*
+ * @param uriContext has property indicating if we use the HTML Amp entity
+ * to separate the query parameters.
* @return encoded query string.
*/
- public String getQueryForXML()
+ public String getQuery( URIContext uriContext )
{
- return getQuery( PARAM_DELIMITER_FOR_XML );
- }
+ if ( _params == null || _params.isEmpty() ) { return null; }
- private String getQuery( String paramSeparator )
- {
- assert paramSeparator != null;
- if ( paramSeparator == null || paramSeparator.length() == 0 )
+ String paramSeparator = AMP_ENTITY;
+ if ( uriContext == null )
{
- throw new IllegalArgumentException( "Parameter separator cannot be
null or empty.");
+ uriContext = getDefaultContext();
}
- if ( _params == null || _params.isEmpty() ) { return null; }
+ if ( !uriContext.useAmpEntity() )
+ {
+ paramSeparator = AMP_CHAR;
+ }
InternalStringBuilder query = new InternalStringBuilder( 64 );
boolean firstParam = true;
@@ -827,28 +774,16 @@
}
/**
- * Returns a string form of this URI.
+ * Returns a string form of this URI. The [EMAIL PROTECTED] URIContext}
+ * encapsulates the data needed to write out the string form.
*
- * @return the URI as a <code>String</code>
- */
- public String getURIString()
- {
- return getURIString( getDefaultParamDelimiter() );
- }
-
- /**
- * Returns a string form of this URI suitable for an XML document.
- * I.E. uses the XML "&amp;" entity as the demilimeter
- * to separate the parameters in the query. </p>
+ * <p> E.g. Defines if the "&amp;" entity or the
+ * '&' character should be used to separate quary parameters. </p>
*
+ * @param uriContext data required to write out the string form.
* @return the URI as a <code>String</code>
*/
- public String getURIStringForXML()
- {
- return getURIString( PARAM_DELIMITER_FOR_XML );
- }
-
- private String getURIString(String paramSeparator)
+ public String getURIString( URIContext uriContext )
{
InternalStringBuilder buf = new InternalStringBuilder( 128 );
@@ -895,7 +830,7 @@
if ( _params != null && _params.size() > 0 )
{
buf.append( '?' );
- buf.append( getQuery( paramSeparator ) );
+ buf.append( getQuery( uriContext ) );
}
// Append the fragment
@@ -907,6 +842,19 @@
String url = buf.toString();
return url;
+ }
+
+ /**
+ * Returns a default <code>URIContext</code>.
+ *
+ * @return the URIContext with default data.
+ */
+ public static URIContext getDefaultContext()
+ {
+ URIContext uriContext = new URIContext();
+ uriContext.setUseAmpEntity( true );
+
+ return uriContext;
}
private static void appendEnsureSeparator( InternalStringBuilder buf,
String token )
Modified:
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/core/urls/TemplatedURLFormatter.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/core/urls/TemplatedURLFormatter.java?rev=164533&r1=164532&r2=164533&view=diff
==============================================================================
---
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/core/urls/TemplatedURLFormatter.java
(original)
+++
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/core/urls/TemplatedURLFormatter.java
Sun Apr 24 20:26:17 2005
@@ -28,13 +28,16 @@
{
/**
* Format the given URL using a URL template, if defined in a URL
- * template config file.
+ * template config file. The [EMAIL PROTECTED] URIContext}
+ * encapsulates some additional data needed to write out the string form.
+ * E.g. It defines if the "&amp;" entity or the
+ * '&' character should be used to separate quary parameters.
*
* @param request the current ServletRequest.
* @param uri the MutableURI to be formatted into a String.
* @param key key for the URL template type to use for formatting the URI
- * @param forXML flag indicating that the query of the uri should be
written
- * using the "&" entity for XML, rather than the
character, '&'.
+ * @param uriContext data required to write out the string form.
+ * @return the URL as a <code>String</code>
*/
- public String getTemplatedURL( ServletRequest request, MutableURI uri,
String key, boolean forXML );
+ public String getTemplatedURL( ServletRequest request, MutableURI uri,
String key, URIContext uriContext );
}
Added:
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/core/urls/URIContext.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/core/urls/URIContext.java?rev=164533&view=auto
==============================================================================
---
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/core/urls/URIContext.java
(added)
+++
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/core/urls/URIContext.java
Sun Apr 24 20:26:17 2005
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+package org.apache.beehive.netui.core.urls;
+
+/**
+ * A JavaBean that encapsulates the data needed to write out
+ * a string form of a MutableURI.
+ */
+public class URIContext
+{
+ /** Character encoding used for the URI. */
+ private boolean _useAmpEntity = true;
+
+ /**
+ * Constructs a <code>URIContext</code>.
+ */
+ public URIContext()
+ {
+ }
+
+ /**
+ * Indicate that the query of the URI should be written using the
+ * "&amp;" entity, rather than the '&' character,
+ * to separate parameters.
+ *
+ * @return true if a URI should have the "&amp;" entity
+ * separating query parameters. Otherwise, false indicates that
+ * it is OK to use the '&' character.
+ */
+ public boolean useAmpEntity()
+ {
+ return _useAmpEntity;
+ }
+
+ /**
+ * Set the flag indicating that the query of the URI should be written
+ * with the "&amp;" entity, rather than the '&'
character,
+ * to separate parameters.
+ *
+ * @param useAmpEntity defines whether or not to use the
"&amp;" entity
+ */
+ public void setUseAmpEntity( boolean useAmpEntity )
+ {
+ _useAmpEntity = useAmpEntity;
+ }
+
+}
Propchange:
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/core/urls/URIContext.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified:
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/core/urls/URLRewriterService.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/core/urls/URLRewriterService.java?rev=164533&r1=164532&r2=164533&view=diff
==============================================================================
---
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/core/urls/URLRewriterService.java
(original)
+++
incubator/beehive/trunk/netui/src/util/org/apache/beehive/netui/core/urls/URLRewriterService.java
Sun Apr 24 20:26:17 2005
@@ -352,24 +352,27 @@
/**
* Format the given URI using a URL template, if defined in the URL
template
- * config file, WEB-INF/url-template-config.xml.
+ * config file, WEB-INF/url-template-config.xml. The [EMAIL PROTECTED]
URIContext}
+ * encapsulates some additional data needed to write out the string form.
+ * E.g. It defines if the "&amp;" entity or the
+ * '&' character should be used to separate quary parameters.
*
* @param request the current ServletRequest.
- * @param url the MutableURI to be formatted into a String.
+ * @param uri the MutableURI to be formatted into a String.
* @param key the URL template type to use for formatting the URI
- * @param forXML flag indicating that the query of the uri should be
written
- * using the "&" entity for XML, rather than the
character, '&'.
+ * @param uriContext data required to write out the string form.
+ * @return the URL as a <code>String</code>
*/
- public static String getTemplatedURL( ServletRequest request, MutableURI
url, String key, boolean forXML )
+ public static String getTemplatedURL( ServletRequest request, MutableURI
uri, String key, URIContext uriContext )
{
TemplatedURLFormatter formatter = getTemplatedURLFormatter( request );
if ( formatter != null )
{
- return formatter.getTemplatedURL( request, url, key, forXML );
+ return formatter.getTemplatedURL( request, uri, key, uriContext );
}
- return defaultFormatter.getTemplatedURL( request, url, key, forXML );
+ return defaultFormatter.getTemplatedURL( request, uri, key, uriContext
);
}
private static TemplatedURLFormatter getTemplatedURLFormatter(
ServletRequest request )
Modified:
incubator/beehive/trunk/netui/test/src/junitTests/org/apache/beehive/netui/test/core/urls/FreezableMutableURITest.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/src/junitTests/org/apache/beehive/netui/test/core/urls/FreezableMutableURITest.java?rev=164533&r1=164532&r2=164533&view=diff
==============================================================================
---
incubator/beehive/trunk/netui/test/src/junitTests/org/apache/beehive/netui/test/core/urls/FreezableMutableURITest.java
(original)
+++
incubator/beehive/trunk/netui/test/src/junitTests/org/apache/beehive/netui/test/core/urls/FreezableMutableURITest.java
Sun Apr 24 20:26:17 2005
@@ -27,6 +27,7 @@
import org.apache.beehive.netui.core.urls.FreezableMutableURI;
import org.apache.beehive.netui.core.urls.MutableURI;
+import org.apache.beehive.netui.core.urls.URIContext;
/**
* FreezableMutableURI JUnit TestCase.
@@ -48,8 +49,8 @@
// test for path + query
{ null, null, null, null,
"/portal/MockPortal.jsp",
- "smokeTestAaltAction=goNested&smokeTestA_submit=true", null,
-
"/portal/MockPortal.jsp?smokeTestAaltAction=goNested&smokeTestA_submit=true" },
+ "smokeTestAaltAction=goNested&smokeTestA_submit=true", null,
+
"/portal/MockPortal.jsp?smokeTestAaltAction=goNested&smokeTestA_submit=true"
},
// test for scheme + host + path
{ "https", null, "localhost", null,
@@ -63,8 +64,8 @@
// test for query parameter names without values and multiple
// instances of the same parameter name
{ "http", null, "localhost", "8080",
- "/test-servlet/TestServlet", "param1¶m1=¶m2", null,
-
"http://localhost:8080/test-servlet/TestServlet?param1¶m1=¶m2" }
+ "/test-servlet/TestServlet", "param1&param1=&param2", null,
+
"http://localhost:8080/test-servlet/TestServlet?param1&param1=&param2" }
};
public FreezableMutableURITest( String name )
@@ -92,6 +93,8 @@
public void testConstructors()
{
+ URIContext uriContext = MutableURI.getDefaultContext();
+
for ( int i = 0; i < _tests.length; i++ )
{
String scheme = _tests[i][0];
@@ -112,7 +115,7 @@
{
FreezableMutableURI uri = new FreezableMutableURI( scheme,
userInfo, host, port,
path, query, fragment );
- assertEquals( uriString, uri.getURIString() );
+ assertEquals( uriString, uri.getURIString( uriContext ) );
FreezableMutableURI other = new FreezableMutableURI(
uriString, false );
assertEquals( uri, other );
other = new FreezableMutableURI( new URI( uriString ) );
@@ -127,6 +130,8 @@
public void testSetters()
{
+ URIContext uriContext = MutableURI.getDefaultContext();
+
for ( int i = 0; i < _tests.length; i++ )
{
String scheme = _tests[i][0];
@@ -153,7 +158,7 @@
uri.setPath( path );
uri.setQuery( query );
uri.setFragment( fragment );
- assertEquals( uriString, uri.getURIString() );
+ assertEquals( uriString, uri.getURIString( uriContext ) );
FreezableMutableURI other = new FreezableMutableURI(
uriString, false );
assertEquals( uri, other );
@@ -178,7 +183,9 @@
fail( "Test failed for URI, \"" + uriString + "\", with a
URISyntaxException: " + e.getMessage() );
}
- assertEquals( uriString, uri.getURIString() );
+ URIContext uriContext = new URIContext();
+ uriContext.setUseAmpEntity( false );
+ assertEquals( uriString, uri.getURIString( uriContext ) );
assertFalse( uri.isFrozen() );
uri.setFrozen( true );
assertTrue( uri.isFrozen() );
@@ -297,6 +304,8 @@
public void testGettersWhenFrozen()
{
+ URIContext uriContext = MutableURI.getDefaultContext();
+
for ( int i = 0; i < _tests.length; i++ )
{
String scheme = _tests[i][0];
@@ -319,13 +328,13 @@
assertFalse( uri.isFrozen() );
uri.setFrozen( true );
assertTrue( uri.isFrozen() );
- assertEquals( uriString, uri.getURIString() );
+ assertEquals( uriString, uri.getURIString( uriContext ) );
assertEquals( uri.getScheme(), scheme );
assertEquals( uri.getHost(), host );
assertEquals( uri.getUserInfo(), userInfo );
assertEquals( uri.getPort(), port );
assertEquals( uri.getPath(), path );
- assertEquals( uri.getQuery(), query );
+ assertEquals( uri.getQuery( uriContext ), query );
assertEquals( uri.getFragment(), fragment );
}
catch ( URISyntaxException e )
@@ -344,7 +353,9 @@
uri.setPath( "/test" );
uri.setQuery( "param1¶m2¶m3=¶m3=true¶m4=true" );
String xmlString =
"https://localhost:443/test?param1&param2&param3=&param3=true&param4=true";
- assertEquals( uri.getURIStringForXML(), xmlString );
+ URIContext uriContext = new URIContext();
+ uriContext.setUseAmpEntity( true );
+ assertEquals( uri.getURIString( uriContext ), xmlString );
}
public void testEquals()
@@ -368,8 +379,10 @@
uriA.setQuery( "param1¶m2¶m1=¶m3=true¶m1=true" );
FreezableMutableURI uriB = new FreezableMutableURI( uriString,
true );
- assertEquals( uriA.getURIString(), uriString );
- assertEquals( uriA.getURIString(), uriB.getURIString() );
+ URIContext uriContext = new URIContext();
+ uriContext.setUseAmpEntity( false );
+ assertEquals( uriA.getURIString( uriContext ), uriString );
+ assertEquals( uriA.getURIString( uriContext ), uriB.getURIString(
uriContext ) );
FreezableMutableURI uriC = new FreezableMutableURI( new URI(
uriString ) );
@@ -444,15 +457,13 @@
}
else
{
- System.out.println( "uri: " + uri.getURIString() );
- System.out.println( "uri - XML: " + uri.getURIStringForXML() );
+ System.out.println( "uri: " + uri.getURIString( null ) );
System.out.println( "scheme: " + uri.getScheme() );
System.out.println( "user info: " + uri.getUserInfo() );
System.out.println( "host: " + uri.getHost() );
System.out.println( "port: " + uri.getPort() );
System.out.println( "path: " + uri.getPath() );
- System.out.println( "query: " + uri.getQuery() );
- System.out.println( "query XML: " + uri.getQueryForXML() );
+ System.out.println( "query: " + uri.getQuery( null ) );
System.out.println( "fragment: " + uri.getFragment() );
System.out.println( "encoding: " + uri.getEncoding() );
}
Modified:
incubator/beehive/trunk/netui/test/src/junitTests/org/apache/beehive/netui/test/core/urls/MutableURITest.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/src/junitTests/org/apache/beehive/netui/test/core/urls/MutableURITest.java?rev=164533&r1=164532&r2=164533&view=diff
==============================================================================
---
incubator/beehive/trunk/netui/test/src/junitTests/org/apache/beehive/netui/test/core/urls/MutableURITest.java
(original)
+++
incubator/beehive/trunk/netui/test/src/junitTests/org/apache/beehive/netui/test/core/urls/MutableURITest.java
Sun Apr 24 20:26:17 2005
@@ -28,6 +28,7 @@
import junit.framework.TestSuite;
import org.apache.beehive.netui.core.urls.MutableURI;
+import org.apache.beehive.netui.core.urls.URIContext;
/**
* MutableURI JUnit TestCase.
@@ -66,8 +67,8 @@
// test for path + query
{ null, null, null, null,
"/portal/MockPortal.jsp",
- "smokeTestAaltAction=goNested&smokeTestA_submit=true", null,
-
"/portal/MockPortal.jsp?smokeTestAaltAction=goNested&smokeTestA_submit=true" },
+ "smokeTestAaltAction=goNested&smokeTestA_submit=true", null,
+
"/portal/MockPortal.jsp?smokeTestAaltAction=goNested&smokeTestA_submit=true"
},
// test for scheme + host + path
{ "https", null, "localhost", null,
@@ -89,8 +90,8 @@
// test for query parameter names without values and multiple
// instances of the same parameter name
{ "http", null, "localhost", "8080",
- "/test-servlet/TestServlet", "param1¶m1=¶m2", null,
-
"http://localhost:8080/test-servlet/TestServlet?param1¶m1=¶m2" },
+ "/test-servlet/TestServlet", "param1&param1=&param2", null,
+
"http://localhost:8080/test-servlet/TestServlet?param1&param1=&param2"
},
// test URI with a session ID
{ "http", null, "localhost", "8080",
@@ -124,6 +125,8 @@
public void testConstructors()
{
+ URIContext uriContext = MutableURI.getDefaultContext();
+
for (int i = 0; i < _tests.length; i++ )
{
String scheme = _tests[i][0];
@@ -144,7 +147,7 @@
{
MutableURI uri = new MutableURI( scheme, userInfo, host, port,
path, query, fragment );
- assertEquals( uriString, uri.getURIString() );
+ assertEquals( uriString, uri.getURIString( uriContext ) );
MutableURI other = new MutableURI( uriString, false );
assertEquals( uri, other );
other = new MutableURI( new URI( uriString ) );
@@ -159,6 +162,8 @@
public void testSetters()
{
+ URIContext uriContext = MutableURI.getDefaultContext();
+
for (int i = 0; i < _tests.length; i++ )
{
String scheme = _tests[i][0];
@@ -185,7 +190,7 @@
uri.setPath( path );
uri.setQuery( query );
uri.setFragment( fragment );
- assertEquals( uriString, uri.getURIString() );
+ assertEquals( uriString, uri.getURIString( uriContext ) );
MutableURI other = new MutableURI( uriString, false );
assertEquals( uri, other );
@@ -199,6 +204,8 @@
public void testGetters()
{
+ URIContext uriContext = MutableURI.getDefaultContext();
+
for (int i = 0; i < _tests.length; i++ )
{
String scheme = _tests[i][0];
@@ -218,13 +225,13 @@
try
{
MutableURI uri = new MutableURI( uriString, false );
- assertEquals( uriString, uri.getURIString() );
+ assertEquals( uriString, uri.getURIString( uriContext ) );
assertEquals( uri.getScheme(), scheme );
assertEquals( uri.getHost(), host );
assertEquals( uri.getUserInfo(), userInfo );
assertEquals( uri.getPort(), port );
assertEquals( uri.getPath(), path );
- assertEquals( uri.getQuery(), query );
+ assertEquals( uri.getQuery( uriContext ), query );
assertEquals( uri.getFragment(), fragment );
}
catch ( URISyntaxException e )
@@ -269,9 +276,12 @@
// test for query parameter separated by "&" entity
query = "param1&param1=&param2";
+ URIContext uriContext = new URIContext();
+ uriContext.setUseAmpEntity( false );
uri.setQuery( query );
- assertEquals( uri.getQuery(), "param1¶m1=¶m2" );
- assertEquals( uri.getQueryForXML(), query );
+ assertEquals( uri.getQuery( uriContext ), "param1¶m1=¶m2" );
+ uriContext.setUseAmpEntity( true );
+ assertEquals( uri.getQuery( uriContext ), query );
// now use addParameter() to set the query
uri.setQuery( null );
@@ -342,7 +352,6 @@
assertEquals( uri.getParameters( initParams[0][0] ).size(), 1 );
assertEquals( uri.getParameters().size(), initParams.length );
Map/*< String, List< String > >*/ params = uri.getParameters();
- i = 0;
for ( java.util.Iterator j = params.keySet().iterator(); j.hasNext();
)
{
@@ -353,7 +362,6 @@
assertTrue( map.containsKey( n ) );
assertEquals( v, map.get( n ) );
}
- i++;
}
}
@@ -374,8 +382,10 @@
String mark = "hyph-un_per.ex!tilda~ast*ap'lp(rp)";
utf8EncodedUri.addParameter( reserved, mark, false );
eucJPEncodedUri.addParameter( reserved, mark, false );
- assertEquals( utf8EncodedUri.getURIString(),
eucJPEncodedUri.getURIString() );
- assertEquals( utf8EncodedUri.getQuery(),
+ URIContext uriContext = new URIContext();
+ uriContext.setUseAmpEntity( false );
+ assertEquals( utf8EncodedUri.getURIString( uriContext ),
eucJPEncodedUri.getURIString( uriContext ) );
+ assertEquals( utf8EncodedUri.getQuery( uriContext ),
"semi%3Bslash%2Fcolon%3Aat%40and%26eq%3Dpl%2Bdoller%24comm%2Cq%3Fend"
+ "=" + "hyph-un_per.ex%21tilda%7East*ap%27lp%28rp%29" );
@@ -386,8 +396,8 @@
String excluded = "space " + delims;
utf8EncodedUri.addParameter( unwise, excluded, false );
eucJPEncodedUri.addParameter( unwise, excluded, false );
- assertEquals( utf8EncodedUri.getURIString(),
eucJPEncodedUri.getURIString() );
- assertEquals( utf8EncodedUri.getQuery(),
+ assertEquals( utf8EncodedUri.getURIString( uriContext ),
eucJPEncodedUri.getURIString( uriContext ) );
+ assertEquals( utf8EncodedUri.getQuery( uriContext ),
"lcb%7Brcb%7Dbar%7Cbs%5Cctr%5Elb%5Brb%5Dlq%60"
+ "=" + "space+lt%3Cgt%3Elb%23perc%25%22quotes%22" );
@@ -398,10 +408,10 @@
String japaneseUnicode = "\u63d0\u51fa\u6e08\u307f";
utf8EncodedUri.addParameter( name, japaneseUnicode, false );
eucJPEncodedUri.addParameter( name, japaneseUnicode, false );
- assertFalse( utf8EncodedUri.getURIString().equals(
eucJPEncodedUri.getURIString() ) );
- assertEquals( utf8EncodedUri.getQuery(),
+ assertFalse( utf8EncodedUri.getURIString( uriContext ).equals(
eucJPEncodedUri.getURIString( uriContext ) ) );
+ assertEquals( utf8EncodedUri.getQuery( uriContext ),
name + "=" + "%E6%8F%90%E5%87%BA%E6%B8%88%E3%81%BF" );
- assertEquals( eucJPEncodedUri.getQuery(),
+ assertEquals( eucJPEncodedUri.getQuery( uriContext ),
name + "=" + "%C4%F3%BD%D0%BA%D1%A4%DF" );
// test encoding in constructor.
@@ -410,24 +420,24 @@
// mark characters OK unescaped in the path
MutableURI uri = new MutableURI( "http://localhost:80/mark/" +
mark, false );
assertEquals( "http://localhost:80/mark/" + mark,
- uri.getURIString() );
+ uri.getURIString( uriContext ) );
// reserved characters OK unescaped in the
// path and the '?' indicates the start of the query
uri = new MutableURI( "http://localhost:80/reserved/" + reserved,
false );
assertEquals( "http://localhost:80/reserved/" + reserved,
- uri.getURIString() );
+ uri.getURIString( uriContext ) );
// unwise
uri = new MutableURI( "http://localhost:80/unwise/" + unwise,
false );
assertEquals(
"http://localhost:80/unwise/lcb%7Brcb%7Dbar%7Cbs%5Cctr%5Elb%5Brb%5Dlq%60",
- uri.getURIString() );
+ uri.getURIString( uriContext ) );
// excluded. note that '#' is interpreted as fragment
// and should not be escaped in this test
uri = new MutableURI( "http://localhost:80/excluded/" + excluded,
false );
assertEquals(
"http://localhost:80/excluded/space%20lt%3Cgt%3Elb#perc%25%22quotes%22",
- uri.getURIString() );
+ uri.getURIString( uriContext ) );
}
catch ( URISyntaxException e )
{
@@ -444,7 +454,9 @@
uri.setPath( "/test" );
uri.setQuery( "param1¶m2¶m3=¶m3=true¶m4=true" );
String xmlString =
"https://localhost:443/test?param1&param2&param3=&param3=true&param4=true";
- assertEquals( uri.getURIStringForXML(), xmlString );
+ URIContext uriContext = new URIContext();
+ uriContext.setUseAmpEntity( true );
+ assertEquals( uri.getURIString( uriContext ), xmlString );
}
public void testEquals()
@@ -468,8 +480,10 @@
uriA.setQuery( "param1¶m2¶m1=¶m3=true¶m1=true" );
MutableURI uriB = new MutableURI( uriString, true );
- assertEquals( uriA.getURIString(), uriString );
- assertEquals( uriA.getURIString(), uriB.getURIString() );
+ URIContext uriContext = new URIContext();
+ uriContext.setUseAmpEntity( false );
+ assertEquals( uriA.getURIString( uriContext ), uriString );
+ assertEquals( uriA.getURIString( uriContext ), uriB.getURIString(
uriContext ) );
MutableURI uriC = new MutableURI( new URI( uriString ) );
@@ -513,7 +527,7 @@
// also, an extra test that setURI() resets the values of the
object
uriA.setURI( "", true );
- assertTrue( uriA.equals( new MutableURI() ) );
+ assertTrue( uriA.equals( new MutableURI( "", true ) ) );
}
catch ( URISyntaxException e )
{
@@ -530,15 +544,13 @@
}
else
{
- System.out.println( "uri: " + uri.getURIString() );
- System.out.println( "uri - XML: " + uri.getURIStringForXML() );
+ System.out.println( "uri: " + uri.getURIString( null) );
System.out.println( "scheme: " + uri.getScheme() );
System.out.println( "user info: " + uri.getUserInfo() );
System.out.println( "host: " + uri.getHost() );
System.out.println( "port: " + uri.getPort() );
System.out.println( "path: " + uri.getPath() );
- System.out.println( "query: " + uri.getQuery() );
- System.out.println( "query XML: " + uri.getQueryForXML() );
+ System.out.println( "query: " + uri.getQuery( null ) );
System.out.println( "fragment: " + uri.getFragment() );
System.out.println( "encoding: " + uri.getEncoding() );
}
Modified:
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/pageFlowUtils/index.jsp
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/pageFlowUtils/index.jsp?rev=164533&r1=164532&r2=164533&view=diff
==============================================================================
---
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/pageFlowUtils/index.jsp
(original)
+++
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/pageFlowUtils/index.jsp
Sun Apr 24 20:26:17 2005
@@ -139,7 +139,7 @@
<%= PageFlowUtils.getActionOutput( "bar", request ) %><br>
<code>getActionURI( cxt, request, response, "begin" )</code>:
- <%= PageFlowUtils.getActionURI( cxt, request, response, "begin"
).getURIString() %><br>
+ <%= PageFlowUtils.getActionURI( cxt, request, response, "begin"
).getURIString( null ) %><br>
<% java.util.HashMap params = new java.util.HashMap(); params.put(
"foo", "bar" ); %>
<code>PageFlowUtils.getRewrittenActionURI( cxt, request, response,
"begin", params, "frag", true )</code>:
Modified:
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridCSSPrefix.xml
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridCSSPrefix.xml?rev=164533&r1=164532&r2=164533&view=diff
==============================================================================
---
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridCSSPrefix.xml
(original)
+++
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridCSSPrefix.xml
Sun Apr 24 20:26:17 2005
@@ -123,7 +123,7 @@
<td class="foo"><span>14.35</span></td>
- <td class="foo"><a
href="http://www.bea.com?rowid=0&symbol=BEAS"><span>BEA Systems</span></a></td>
+ <td class="foo"><a
href="http://www.bea.com?rowid=0&symbol=BEAS"><span>BEA
Systems</span></a></td>
</tr>
@@ -132,7 +132,7 @@
<td class="foo"><span>19.42</span></td>
- <td class="foo"><a
href="http://www.cisco.com?rowid=1&symbol=CSCO"><span>Cisco
Systems</span></a></td>
+ <td class="foo"><a
href="http://www.cisco.com?rowid=1&symbol=CSCO"><span>Cisco
Systems</span></a></td>
</tr>
@@ -141,7 +141,7 @@
<td class="foo"><span>59.42</span></td>
- <td class="foo"><a
href="http://www.ge.com?rowid=2&symbol=GE"><span>General
Electric</span></a></td>
+ <td class="foo"><a
href="http://www.ge.com?rowid=2&symbol=GE"><span>General
Electric</span></a></td>
</tr>
@@ -150,7 +150,7 @@
<td class="foo"><span>18.2</span></td>
- <td class="foo"><a
href="http://www.redhat.com?rowid=3&symbol=RHAT"><span>RedHat
Systems</span></a></td>
+ <td class="foo"><a
href="http://www.redhat.com?rowid=3&symbol=RHAT"><span>RedHat
Systems</span></a></td>
</tr>
@@ -159,7 +159,7 @@
<td class="foo"><span>48.16</span></td>
- <td class="foo"><a
href="http://www.yahoo.com?rowid=4&symbol=YHOO"><span>Yahoo Inc</span></a></td>
+ <td class="foo"><a
href="http://www.yahoo.com?rowid=4&symbol=YHOO"><span>Yahoo
Inc</span></a></td>
</tr>
@@ -181,4 +181,4 @@
<ses:testCount>1</ses:testCount>
<ses:passedCount>0</ses:passedCount>
<ses:failedCount>1</ses:failedCount>
-</ses:recorderSession>
\ No newline at end of file
+</ses:recorderSession>
Modified:
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridCaptionTest.xml
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridCaptionTest.xml?rev=164533&r1=164532&r2=164533&view=diff
==============================================================================
---
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridCaptionTest.xml
(original)
+++
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridCaptionTest.xml
Sun Apr 24 20:26:17 2005
@@ -127,7 +127,7 @@
<td class="datagrid"><span>14.35</span></td>
- <td class="datagrid"><a
href="http://www.bea.com?rowid=0&symbol=BEAS"><span>BEA Systems</span></a></td>
+ <td class="datagrid"><a
href="http://www.bea.com?rowid=0&symbol=BEAS"><span>BEA
Systems</span></a></td>
</tr>
@@ -136,7 +136,7 @@
<td class="datagrid"><span>19.42</span></td>
- <td class="datagrid"><a
href="http://www.cisco.com?rowid=1&symbol=CSCO"><span>Cisco
Systems</span></a></td>
+ <td class="datagrid"><a
href="http://www.cisco.com?rowid=1&symbol=CSCO"><span>Cisco
Systems</span></a></td>
</tr>
@@ -145,7 +145,7 @@
<td class="datagrid"><span>59.42</span></td>
- <td class="datagrid"><a
href="http://www.ge.com?rowid=2&symbol=GE"><span>General
Electric</span></a></td>
+ <td class="datagrid"><a
href="http://www.ge.com?rowid=2&symbol=GE"><span>General
Electric</span></a></td>
</tr>
@@ -154,7 +154,7 @@
<td class="datagrid"><span>18.2</span></td>
- <td class="datagrid"><a
href="http://www.redhat.com?rowid=3&symbol=RHAT"><span>RedHat
Systems</span></a></td>
+ <td class="datagrid"><a
href="http://www.redhat.com?rowid=3&symbol=RHAT"><span>RedHat
Systems</span></a></td>
</tr>
@@ -163,7 +163,7 @@
<td class="datagrid"><span>48.16</span></td>
- <td class="datagrid"><a
href="http://www.yahoo.com?rowid=4&symbol=YHOO"><span>Yahoo Inc</span></a></td>
+ <td class="datagrid"><a
href="http://www.yahoo.com?rowid=4&symbol=YHOO"><span>Yahoo
Inc</span></a></td>
</tr>
@@ -195,4 +195,4 @@
<ses:testCount>1</ses:testCount>
<ses:passedCount>0</ses:passedCount>
<ses:failedCount>1</ses:failedCount>
-</ses:recorderSession>
\ No newline at end of file
+</ses:recorderSession>
Modified:
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridCustomHeaderStyle.xml
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridCustomHeaderStyle.xml?rev=164533&r1=164532&r2=164533&view=diff
==============================================================================
---
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridCustomHeaderStyle.xml
(original)
+++
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridCustomHeaderStyle.xml
Sun Apr 24 20:26:17 2005
@@ -126,7 +126,7 @@
<td class="foo"><span>14.35</span></td>
- <td class="foo"><a
href="http://www.bea.com?rowid=0&symbol=BEAS"><span>BEA Systems</span></a></td>
+ <td class="foo"><a
href="http://www.bea.com?rowid=0&symbol=BEAS"><span>BEA
Systems</span></a></td>
</tr>
@@ -135,7 +135,7 @@
<td class="foo"><span>19.42</span></td>
- <td class="foo"><a
href="http://www.cisco.com?rowid=1&symbol=CSCO"><span>Cisco
Systems</span></a></td>
+ <td class="foo"><a
href="http://www.cisco.com?rowid=1&symbol=CSCO"><span>Cisco
Systems</span></a></td>
</tr>
@@ -144,7 +144,7 @@
<td class="foo"><span>59.42</span></td>
- <td class="foo"><a
href="http://www.ge.com?rowid=2&symbol=GE"><span>General
Electric</span></a></td>
+ <td class="foo"><a
href="http://www.ge.com?rowid=2&symbol=GE"><span>General
Electric</span></a></td>
</tr>
@@ -153,7 +153,7 @@
<td class="foo"><span>18.2</span></td>
- <td class="foo"><a
href="http://www.redhat.com?rowid=3&symbol=RHAT"><span>RedHat
Systems</span></a></td>
+ <td class="foo"><a
href="http://www.redhat.com?rowid=3&symbol=RHAT"><span>RedHat
Systems</span></a></td>
</tr>
@@ -162,7 +162,7 @@
<td class="foo"><span>48.16</span></td>
- <td class="foo"><a
href="http://www.yahoo.com?rowid=4&symbol=YHOO"><span>Yahoo Inc</span></a></td>
+ <td class="foo"><a
href="http://www.yahoo.com?rowid=4&symbol=YHOO"><span>Yahoo
Inc</span></a></td>
</tr>
@@ -184,4 +184,4 @@
<ses:testCount>1</ses:testCount>
<ses:passedCount>0</ses:passedCount>
<ses:failedCount>1</ses:failedCount>
-</ses:recorderSession>
\ No newline at end of file
+</ses:recorderSession>
Modified:
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridCustomTagAttributes.xml
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridCustomTagAttributes.xml?rev=164533&r1=164532&r2=164533&view=diff
==============================================================================
---
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridCustomTagAttributes.xml
(original)
+++
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridCustomTagAttributes.xml
Sun Apr 24 20:26:17 2005
@@ -1,192 +1,192 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ses:recorderSession
xmlns:ses="http://beehive.apache.org/netui/tools/testrecorder/2004/session">
- <ses:sessionName>DataGridCustomTagAttributes</ses:sessionName>
- <ses:tester>ekoneil</ses:tester>
- <ses:startDate>24 Apr 2005, 04:47:59.115 PM MDT</ses:startDate>
- <ses:description>ekoneil</ses:description>
- <ses:tests>
- <ses:test>
- <ses:testNumber>1</ses:testNumber>
- <ses:request>
- <ses:protocol>HTTP</ses:protocol>
- <ses:protocolVersion>1.1</ses:protocolVersion>
- <ses:host>localhost</ses:host>
- <ses:port>8080</ses:port>
-
<ses:uri>/coreWeb/databinding/datagrid/misc/userAttributes.jsp</ses:uri>
- <ses:method>GET</ses:method>
- <ses:parameters/>
- <ses:cookies>
- <ses:cookie>
- <ses:name>JSESSIONID</ses:name>
- <ses:value>540BAC00651BB89E804869735792D4BF</ses:value>
- </ses:cookie>
- </ses:cookies>
- <ses:headers>
- <ses:header>
- <ses:name>---------------</ses:name>
- <ses:value>------------</ses:value>
- </ses:header>
- <ses:header>
- <ses:name>accept</ses:name>
-
<ses:value>text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</ses:value>
- </ses:header>
- <ses:header>
- <ses:name>accept-charset</ses:name>
- <ses:value>ISO-8859-1,utf-8;q=0.7,*;q=0.7</ses:value>
- </ses:header>
- <ses:header>
- <ses:name>accept-language</ses:name>
- <ses:value>en-us,en;q=0.5</ses:value>
- </ses:header>
- <ses:header>
- <ses:name>connection</ses:name>
- <ses:value>keep-alive</ses:value>
- </ses:header>
- <ses:header>
- <ses:name>cookie</ses:name>
- <ses:value>$Version=0;
JSESSIONID=540BAC00651BB89E804869735792D4BF; $Path=/coreWeb</ses:value>
- </ses:header>
- <ses:header>
- <ses:name>host</ses:name>
- <ses:value>localhost:8080</ses:value>
- </ses:header>
- <ses:header>
- <ses:name>keep-alive</ses:name>
- <ses:value>300</ses:value>
- </ses:header>
- <ses:header>
- <ses:name>testrecorder.playback.testid</ses:name>
- <ses:value>-6dc17ca0:1037664f187:-7fe2</ses:value>
- </ses:header>
- <ses:header>
- <ses:name>user-agent</ses:name>
- <ses:value>Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
rv:1.7) Gecko/20040614 Firefox/0.9</ses:value>
- </ses:header>
- </ses:headers>
- </ses:request>
- <ses:response>
- <ses:statusCode>200</ses:statusCode>
- <ses:reason/>
- <ses:responseBody><![CDATA[<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML
4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/loose.dtd">
-<html lang="en">
-
- <head>
- <title>NetUI Data Grid Samples</title>
- <link rel="stylesheet"
href="/coreWeb/databinding/datagrid/site/css/default.css" type="text/css"/>
- </head>
- <base
href="http://localhost:8080/coreWeb/databinding/datagrid/misc/userAttributes.jsp">
- <body>
- <p>
- <b>Basic Data Grid</b>
- <table width="100%">
- <tr><td></td></tr>
- <tr><td>
-
- <script language="javascript">
-function doAlert(node, index)
-{
- alert("hello from item: " + index);
-}
- </script>
- <p>
-
-
-
-
-
-
-
- Page 1 of 1
-<table class="datagrid">
-
-
-
-
-
-<tr class="datagrid-header">
- <th class="datagrid">Symbol</th>
-
-
- <th class="datagrid">Shares</th>
-
-
- <th class="datagrid">Web</th>
-
-
-
-</tr>
-
-
-
-
-<tr class="datagrid-odd">
- <td class="datagrid"><span attr-test-symbol="BEAS"
onclick="javascript:alert(this)">BEAS</span></td>
-
- <td class="datagrid"><span attr-index="0"
attr-onlyeven="foo">14.35</span></td>
-
- <td class="datagrid"><a
href="http://www.bea.com?rowid=0&symbol=BEAS" onmouseover="doAlert(this,
0)"><span>BEA Systems</span></a></td>
-
-
-</tr>
-<tr class="datagrid-even">
- <td class="datagrid"><span attr-test-symbol="CSCO"
onclick="javascript:alert(this)">CSCO</span></td>
-
- <td class="datagrid"><span attr-index="1">19.42</span></td>
-
- <td class="datagrid"><a
href="http://www.cisco.com?rowid=1&symbol=CSCO" onmouseover="doAlert(this,
1)"><span>Cisco Systems</span></a></td>
-
-
-</tr>
-<tr class="datagrid-odd">
- <td class="datagrid"><span attr-test-symbol="GE"
onclick="javascript:alert(this)">GE</span></td>
-
- <td class="datagrid"><span attr-index="2"
attr-onlyeven="foo">59.42</span></td>
-
- <td class="datagrid"><a href="http://www.ge.com?rowid=2&symbol=GE"
onmouseover="doAlert(this, 2)"><span>General Electric</span></a></td>
-
-
-</tr>
-<tr class="datagrid-even">
- <td class="datagrid"><span attr-test-symbol="RHAT"
onclick="javascript:alert(this)">RHAT</span></td>
-
- <td class="datagrid"><span attr-index="3">18.2</span></td>
-
- <td class="datagrid"><a
href="http://www.redhat.com?rowid=3&symbol=RHAT" onmouseover="doAlert(this,
3)"><span>RedHat Systems</span></a></td>
-
-
-</tr>
-<tr class="datagrid-odd">
- <td class="datagrid"><span attr-test-symbol="YHOO"
onclick="javascript:alert(this)">YHOO</span></td>
-
- <td class="datagrid"><span attr-index="4"
attr-onlyeven="foo">48.16</span></td>
-
- <td class="datagrid"><a
href="http://www.yahoo.com?rowid=4&symbol=YHOO" onmouseover="doAlert(this,
4)"><span>Yahoo Inc</span></a></td>
-
-
-</tr>
- </table>
-
-
-
- </td></tr>
- </p>
- <table>
- <tr><td><a
href="/netuiDRT/databinding/datagrid/basic/index.jsp">Home</a></td></tr>
- </table>
- </p>
- </body>
-
-</html>]]></ses:responseBody>
- </ses:response>
- <ses:testResults>
- <ses:testStatus>fail</ses:testStatus>
- </ses:testResults>
- </ses:test>
- </ses:tests>
- <ses:endDate>24 Apr 2005, 04:48:00.507 PM MDT</ses:endDate>
- <ses:sessionStatus>fail</ses:sessionStatus>
- <ses:testCount>1</ses:testCount>
- <ses:passedCount>0</ses:passedCount>
- <ses:failedCount>1</ses:failedCount>
-</ses:recorderSession>
\ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<ses:recorderSession
xmlns:ses="http://beehive.apache.org/netui/tools/testrecorder/2004/session">
+ <ses:sessionName>DataGridCustomTagAttributes</ses:sessionName>
+ <ses:tester>ekoneil</ses:tester>
+ <ses:startDate>24 Apr 2005, 04:47:59.115 PM MDT</ses:startDate>
+ <ses:description>ekoneil</ses:description>
+ <ses:tests>
+ <ses:test>
+ <ses:testNumber>1</ses:testNumber>
+ <ses:request>
+ <ses:protocol>HTTP</ses:protocol>
+ <ses:protocolVersion>1.1</ses:protocolVersion>
+ <ses:host>localhost</ses:host>
+ <ses:port>8080</ses:port>
+
<ses:uri>/coreWeb/databinding/datagrid/misc/userAttributes.jsp</ses:uri>
+ <ses:method>GET</ses:method>
+ <ses:parameters/>
+ <ses:cookies>
+ <ses:cookie>
+ <ses:name>JSESSIONID</ses:name>
+ <ses:value>540BAC00651BB89E804869735792D4BF</ses:value>
+ </ses:cookie>
+ </ses:cookies>
+ <ses:headers>
+ <ses:header>
+ <ses:name>---------------</ses:name>
+ <ses:value>------------</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>accept</ses:name>
+
<ses:value>text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>accept-charset</ses:name>
+ <ses:value>ISO-8859-1,utf-8;q=0.7,*;q=0.7</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>accept-language</ses:name>
+ <ses:value>en-us,en;q=0.5</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>connection</ses:name>
+ <ses:value>keep-alive</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>cookie</ses:name>
+ <ses:value>$Version=0;
JSESSIONID=540BAC00651BB89E804869735792D4BF; $Path=/coreWeb</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>host</ses:name>
+ <ses:value>localhost:8080</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>keep-alive</ses:name>
+ <ses:value>300</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>testrecorder.playback.testid</ses:name>
+ <ses:value>-6dc17ca0:1037664f187:-7fe2</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>user-agent</ses:name>
+ <ses:value>Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
rv:1.7) Gecko/20040614 Firefox/0.9</ses:value>
+ </ses:header>
+ </ses:headers>
+ </ses:request>
+ <ses:response>
+ <ses:statusCode>200</ses:statusCode>
+ <ses:reason/>
+ <ses:responseBody><![CDATA[<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML
4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+<html lang="en">
+
+ <head>
+ <title>NetUI Data Grid Samples</title>
+ <link rel="stylesheet"
href="/coreWeb/databinding/datagrid/site/css/default.css" type="text/css"/>
+ </head>
+ <base
href="http://localhost:8080/coreWeb/databinding/datagrid/misc/userAttributes.jsp">
+ <body>
+ <p>
+ <b>Basic Data Grid</b>
+ <table width="100%">
+ <tr><td></td></tr>
+ <tr><td>
+
+ <script language="javascript">
+function doAlert(node, index)
+{
+ alert("hello from item: " + index);
+}
+ </script>
+ <p>
+
+
+
+
+
+
+
+ Page 1 of 1
+<table class="datagrid">
+
+
+
+
+
+<tr class="datagrid-header">
+ <th class="datagrid">Symbol</th>
+
+
+ <th class="datagrid">Shares</th>
+
+
+ <th class="datagrid">Web</th>
+
+
+
+</tr>
+
+
+
+
+<tr class="datagrid-odd">
+ <td class="datagrid"><span attr-test-symbol="BEAS"
onclick="javascript:alert(this)">BEAS</span></td>
+
+ <td class="datagrid"><span attr-index="0"
attr-onlyeven="foo">14.35</span></td>
+
+ <td class="datagrid"><a
href="http://www.bea.com?rowid=0&symbol=BEAS" onmouseover="doAlert(this,
0)"><span>BEA Systems</span></a></td>
+
+
+</tr>
+<tr class="datagrid-even">
+ <td class="datagrid"><span attr-test-symbol="CSCO"
onclick="javascript:alert(this)">CSCO</span></td>
+
+ <td class="datagrid"><span attr-index="1">19.42</span></td>
+
+ <td class="datagrid"><a
href="http://www.cisco.com?rowid=1&symbol=CSCO" onmouseover="doAlert(this,
1)"><span>Cisco Systems</span></a></td>
+
+
+</tr>
+<tr class="datagrid-odd">
+ <td class="datagrid"><span attr-test-symbol="GE"
onclick="javascript:alert(this)">GE</span></td>
+
+ <td class="datagrid"><span attr-index="2"
attr-onlyeven="foo">59.42</span></td>
+
+ <td class="datagrid"><a
href="http://www.ge.com?rowid=2&symbol=GE" onmouseover="doAlert(this,
2)"><span>General Electric</span></a></td>
+
+
+</tr>
+<tr class="datagrid-even">
+ <td class="datagrid"><span attr-test-symbol="RHAT"
onclick="javascript:alert(this)">RHAT</span></td>
+
+ <td class="datagrid"><span attr-index="3">18.2</span></td>
+
+ <td class="datagrid"><a
href="http://www.redhat.com?rowid=3&symbol=RHAT" onmouseover="doAlert(this,
3)"><span>RedHat Systems</span></a></td>
+
+
+</tr>
+<tr class="datagrid-odd">
+ <td class="datagrid"><span attr-test-symbol="YHOO"
onclick="javascript:alert(this)">YHOO</span></td>
+
+ <td class="datagrid"><span attr-index="4"
attr-onlyeven="foo">48.16</span></td>
+
+ <td class="datagrid"><a
href="http://www.yahoo.com?rowid=4&symbol=YHOO" onmouseover="doAlert(this,
4)"><span>Yahoo Inc</span></a></td>
+
+
+</tr>
+ </table>
+
+
+
+ </td></tr>
+ </p>
+ <table>
+ <tr><td><a
href="/netuiDRT/databinding/datagrid/basic/index.jsp">Home</a></td></tr>
+ </table>
+ </p>
+ </body>
+
+</html>]]></ses:responseBody>
+ </ses:response>
+ <ses:testResults>
+ <ses:testStatus>fail</ses:testStatus>
+ </ses:testResults>
+ </ses:test>
+ </ses:tests>
+ <ses:endDate>24 Apr 2005, 04:48:00.507 PM MDT</ses:endDate>
+ <ses:sessionStatus>fail</ses:sessionStatus>
+ <ses:testCount>1</ses:testCount>
+ <ses:passedCount>0</ses:passedCount>
+ <ses:failedCount>1</ses:failedCount>
+</ses:recorderSession>
Modified:
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridFooterTest.xml
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridFooterTest.xml?rev=164533&r1=164532&r2=164533&view=diff
==============================================================================
---
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridFooterTest.xml
(original)
+++
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridFooterTest.xml
Sun Apr 24 20:26:17 2005
@@ -122,7 +122,7 @@
<td class="datagrid"><span>14.35</span></td>
- <td class="datagrid"><a
href="http://www.bea.com?rowid=0&symbol=BEAS"><span>BEA Systems</span></a></td>
+ <td class="datagrid"><a
href="http://www.bea.com?rowid=0&symbol=BEAS"><span>BEA
Systems</span></a></td>
</tr>
@@ -131,7 +131,7 @@
<td class="datagrid"><span>19.42</span></td>
- <td class="datagrid"><a
href="http://www.cisco.com?rowid=1&symbol=CSCO"><span>Cisco
Systems</span></a></td>
+ <td class="datagrid"><a
href="http://www.cisco.com?rowid=1&symbol=CSCO"><span>Cisco
Systems</span></a></td>
</tr>
@@ -140,7 +140,7 @@
<td class="datagrid"><span>59.42</span></td>
- <td class="datagrid"><a
href="http://www.ge.com?rowid=2&symbol=GE"><span>General
Electric</span></a></td>
+ <td class="datagrid"><a
href="http://www.ge.com?rowid=2&symbol=GE"><span>General
Electric</span></a></td>
</tr>
@@ -149,7 +149,7 @@
<td class="datagrid"><span>18.2</span></td>
- <td class="datagrid"><a
href="http://www.redhat.com?rowid=3&symbol=RHAT"><span>RedHat
Systems</span></a></td>
+ <td class="datagrid"><a
href="http://www.redhat.com?rowid=3&symbol=RHAT"><span>RedHat
Systems</span></a></td>
</tr>
@@ -158,7 +158,7 @@
<td class="datagrid"><span>48.16</span></td>
- <td class="datagrid"><a
href="http://www.yahoo.com?rowid=4&symbol=YHOO"><span>Yahoo Inc</span></a></td>
+ <td class="datagrid"><a
href="http://www.yahoo.com?rowid=4&symbol=YHOO"><span>Yahoo
Inc</span></a></td>
</tr>
@@ -199,4 +199,4 @@
<ses:testCount>1</ses:testCount>
<ses:passedCount>0</ses:passedCount>
<ses:failedCount>1</ses:failedCount>
-</ses:recorderSession>
\ No newline at end of file
+</ses:recorderSession>
Modified:
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridHeaderCellDecorator.xml
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridHeaderCellDecorator.xml?rev=164533&r1=164532&r2=164533&view=diff
==============================================================================
---
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridHeaderCellDecorator.xml
(original)
+++
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DataGridHeaderCellDecorator.xml
Sun Apr 24 20:26:17 2005
@@ -126,7 +126,7 @@
<td class="foo"><span>14.35</span></td>
- <td class="foo"><a
href="http://www.bea.com?rowid=0&symbol=BEAS"><span>BEA Systems</span></a></td>
+ <td class="foo"><a
href="http://www.bea.com?rowid=0&symbol=BEAS"><span>BEA
Systems</span></a></td>
</tr>
@@ -135,7 +135,7 @@
<td class="foo"><span>19.42</span></td>
- <td class="foo"><a
href="http://www.cisco.com?rowid=1&symbol=CSCO"><span>Cisco
Systems</span></a></td>
+ <td class="foo"><a
href="http://www.cisco.com?rowid=1&symbol=CSCO"><span>Cisco
Systems</span></a></td>
</tr>
@@ -144,7 +144,7 @@
<td class="foo"><span>59.42</span></td>
- <td class="foo"><a
href="http://www.ge.com?rowid=2&symbol=GE"><span>General
Electric</span></a></td>
+ <td class="foo"><a
href="http://www.ge.com?rowid=2&symbol=GE"><span>General
Electric</span></a></td>
</tr>
@@ -153,7 +153,7 @@
<td class="foo"><span>18.2</span></td>
- <td class="foo"><a
href="http://www.redhat.com?rowid=3&symbol=RHAT"><span>RedHat
Systems</span></a></td>
+ <td class="foo"><a
href="http://www.redhat.com?rowid=3&symbol=RHAT"><span>RedHat
Systems</span></a></td>
</tr>
@@ -162,7 +162,7 @@
<td class="foo"><span>48.16</span></td>
- <td class="foo"><a
href="http://www.yahoo.com?rowid=4&symbol=YHOO"><span>Yahoo Inc</span></a></td>
+ <td class="foo"><a
href="http://www.yahoo.com?rowid=4&symbol=YHOO"><span>Yahoo
Inc</span></a></td>
</tr>
@@ -184,4 +184,4 @@
<ses:testCount>1</ses:testCount>
<ses:passedCount>0</ses:passedCount>
<ses:failedCount>1</ses:failedCount>
-</ses:recorderSession>
\ No newline at end of file
+</ses:recorderSession>