gatein SVN: r2046 - portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium.
by do-not-reply@jboss.org
Author: hangnguyen
Date: 2010-03-08 23:54:43 -0500 (Mon, 08 Mar 2010)
New Revision: 2046
Modified:
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_SNF_PRL_12.html
Log:
Change position of portlet in script
Modified: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_SNF_PRL_12.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_SNF_PRL_12.html 2010-03-09 04:10:57 UTC (rev 2045)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/Test_SNF_PRL_12.html 2010-03-09 04:54:43 UTC (rev 2046)
@@ -4,12 +4,12 @@
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="" />
-<title>SNF_PRL_12</title>
+<title>Test_SNF_PRL_12</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
-<tr><td rowspan="1" colspan="3">SNF_PRL_12</td></tr>
+<tr><td rowspan="1" colspan="3">Test_SNF_PRL_12</td></tr>
</thead><tbody>
<tr>
<td>open</td>
@@ -78,42 +78,52 @@
</tr>
<tr>
<td>echo</td>
- <td>--Verify details of Administration>>Organisation Management</td>
+ <td>--Verify details of Administration>>NewAccount</td>
<td></td>
</tr>
<tr>
+ <td>waitForElementPresent</td>
+ <td>xpath=//div[@class='UIVerticalSlideTabs']//div[@class='UIVTabContent']//div[2]//a</td>
+ <td></td>
+</tr>
+<tr>
<td>clickAt</td>
<td>xpath=//div[@class='UIVerticalSlideTabs']//div[@class='UIVTabContent']//div[2]//a</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
- <td>OrganizationPortlet</td>
+ <td>AccountPortlet</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
- <td>OrganizationPortlet</td>
+ <td>AccountPortlet</td>
<td></td>
</tr>
<tr>
<td>echo</td>
- <td>--Verify details of Administration>>NewAccount</td>
+ <td>--Verify details of Administration>>Organisation Management</td>
<td></td>
</tr>
<tr>
+ <td>waitForElementPresent</td>
+ <td>xpath=//div[@class='UIVerticalSlideTabs']//div[@class='UIVTabContent']//div[3]//a</td>
+ <td></td>
+</tr>
+<tr>
<td>clickAt</td>
<td>xpath=//div[@class='UIVerticalSlideTabs']//div[@class='UIVTabContent']//div[3]//a</td>
<td></td>
</tr>
<tr>
<td>waitForTextPresent</td>
- <td>AccountPortlet</td>
+ <td>OrganizationPortlet</td>
<td></td>
</tr>
<tr>
<td>verifyTextPresent</td>
- <td>AccountPortlet</td>
+ <td>OrganizationPortlet</td>
<td></td>
</tr>
<tr>
@@ -122,11 +132,26 @@
<td></td>
</tr>
<tr>
+ <td>waitForElementPresent</td>
+ <td>xpath=//div[@class='UIVerticalSlideTabs']/div[2]//a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>xpath=//div[@class='UIVerticalSlideTabs']/div[2]//a</td>
+ <td></td>
+</tr>
+<tr>
<td>clickAt</td>
<td>xpath=//div[@class='UIVerticalSlideTabs']/div[2]//a</td>
<td></td>
</tr>
<tr>
+ <td>waitForElementPresent</td>
+ <td>xpath=//div[@class='UIVerticalSlideTabs']//div[@class='UIVTabContent']//div[1]//a</td>
+ <td></td>
+</tr>
+<tr>
<td>clickAt</td>
<td>xpath=//div[@class='UIVerticalSlideTabs']//div[@class='UIVTabContent']//div[1]//a</td>
<td></td>
@@ -147,6 +172,11 @@
<td></td>
</tr>
<tr>
+ <td>waitForElementPresent</td>
+ <td>xpath=//div[@class='UIVerticalSlideTabs']//div[@class='UIVTabContent']//div[2]//a</td>
+ <td></td>
+</tr>
+<tr>
<td>clickAt</td>
<td>xpath=//div[@class='UIVerticalSlideTabs']//div[@class='UIVTabContent']//div[2]//a</td>
<td></td>
14 years, 9 months
gatein SVN: r2045 - portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/issues.
by do-not-reply@jboss.org
Author: hangnguyen
Date: 2010-03-08 23:10:57 -0500 (Mon, 08 Mar 2010)
New Revision: 2045
Added:
portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/issues/Test_SNF_PRL_33.html
Log:
Move "Test_SNF_PRL_33.html" to issues folder
Added: portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/issues/Test_SNF_PRL_33.html
===================================================================
--- portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/issues/Test_SNF_PRL_33.html (rev 0)
+++ portal/trunk/testsuite/selenium-snifftests/src/suite/org/exoplatform/portal/selenium/issues/Test_SNF_PRL_33.html 2010-03-09 04:10:57 UTC (rev 2045)
@@ -0,0 +1,277 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>Test_SNF_PRL_33</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">Test_SNF_PRL_33</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/portal/public/classic/</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>-AccountSetting-</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>--Register new account</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAt</td>
+ <td>link=Register</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>username</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>username</td>
+ <td>test_user_33</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>password</td>
+ <td>test_pwd_33</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>confirmPassword</td>
+ <td>test_pwd_33</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>firstName</td>
+ <td>test_name_first_33</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>lastName</td>
+ <td>test_name_last_33</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>emailAddress</td>
+ <td>test_user_33(a)yahoo.com</td>
+</tr>
+<tr>
+ <td>clickAt</td>
+ <td>link=Subscribe</td>
+ <td>1,1</td>
+</tr>
+<tr>
+ <td>open</td>
+ <td>/portal/public/classic/</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>--Sign in and modify</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAt</td>
+ <td>link=Sign in</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>username</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>username</td>
+ <td>test_user_33</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>password</td>
+ <td>test_pwd_33</td>
+</tr>
+<tr>
+ <td>clickAt</td>
+ <td>xpath=//div[@id='UIPortalLoginFormAction']//a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>test_name_first_33 test_name_last_33</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAt</td>
+ <td>link=test_name_first_33 test_name_last_33</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Change Password</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAt</td>
+ <td>link=Change Password</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>currentpass</td>
+ <td>test_pwd_33</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>newpass</td>
+ <td>test_edit_33</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>confirmnewpass</td>
+ <td>test_edit_33</td>
+</tr>
+<tr>
+ <td>clickAt</td>
+ <td>css=form#UIAccountChangePass div.ActionButton</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Close</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAt</td>
+ <td>link=Close</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Sign out</td>
+ <td></td>
+</tr>
+<tr>
+ <td>Known issue : https://jira.jboss.org/jira/browse/GTNPORTAL-837</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>--Verify modifications</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAt</td>
+ <td>link=Sign in</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>username</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>username</td>
+ <td>test_user_33</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>password</td>
+ <td>test_edit_33</td>
+</tr>
+<tr>
+ <td>clickAt</td>
+ <td>xpath=//div[@id='UIPortalLoginFormAction']//a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForTextPresent</td>
+ <td>test_name_first_33 test_name_last_33</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyTextPresent</td>
+ <td>test_name_first_33 test_name_last_33</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAt</td>
+ <td>link=Sign out</td>
+ <td></td>
+</tr>
+<tr>
+ <td>echo</td>
+ <td>--Delete new user</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Sign in</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAt</td>
+ <td>link=Sign in</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>username</td>
+ <td>root</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>password</td>
+ <td>gtn</td>
+</tr>
+<tr>
+ <td>clickAt</td>
+ <td>xpath=//div[@id='UIPortalLoginFormAction']//a</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>link=Users and groups management</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Users and groups management</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>xpath=//div[@class='UIListUsers']//tbody/tr[5]//img[@class='DeleteUserIcon']</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAt</td>
+ <td>xpath=//div[@class='UIListUsers']//tbody/tr[5]//img[@class='DeleteUserIcon']</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForConfirmation</td>
+ <td>Are you sure you want to delete test_user_33 user?</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAt</td>
+ <td>link=Sign out</td>
+ <td></td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
14 years, 9 months
gatein SVN: r2044 - in components/wsrp/trunk: common/src/main/java/org/gatein/wsrp and 4 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-03-08 21:19:25 -0500 (Mon, 08 Mar 2010)
New Revision: 2044
Added:
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRP2RewritingConstants.java
components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/AbsoluteURLReplacementGeneratorTestCase.java
Removed:
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/AbsoluteURLReplacementGenerator.java
components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/AbsoluteURLReplacementGeneratorTestCase.java
Modified:
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPActionURL.java
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPPortletURL.java
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPRenderURL.java
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPResourceURL.java
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPUtils.java
components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/other/WSRPPortletURLTestCase.java
components/wsrp/trunk/pom.xml
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/RenderRequestProcessor.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPInstanceContext.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPPortletInvocationContext.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPProducerImpl.java
Log:
- WSRPPortletInvocationContext.renderURL method should now process ResourceURL instead of failing with a
best-effort policy as full support won't be possible before WSRP 2, though.
- Refactored WSRPPortletURL hierarchy to share more code based on refactored ContainerURL hierarchy and start
better supporting resource URLs.
- Fixed MediaType detection for WSRPResourceURL.
- Added hackish support for resource URLs.
- Started preliminary (but inactive at the moment) support for public navigational state in WSRPRenderURL.
- Will need to revisit WSRPPortletURLTestCase.
- Moved AbsoluteURLReplacementGenerator (and associated test case) to common module and WSRPUtils so that it
can be used outside of the producer module. Added static method to generate an absolute URL to avoid
creating new instances when not needed.
- Updated WSRPProducerImpl.isRemotable method to use the proper constant.
Added: components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRP2RewritingConstants.java
===================================================================
--- components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRP2RewritingConstants.java (rev 0)
+++ components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRP2RewritingConstants.java 2010-03-09 02:19:25 UTC (rev 2044)
@@ -0,0 +1,64 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.gatein.wsrp;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public final class WSRP2RewritingConstants
+{
+ private WSRP2RewritingConstants()
+ {
+ }
+
+ /**
+ * 9.2.1.1.3.2 wsrp-resourceID This parameter provides the resourceID parameter which the Consumer MUST supply when
+ * invoking the getResource operation. The presence of this parameter informs the Consumer that the getResource
+ * operation is a viable means of fetching the resource requested by the Portlet's markup.
+ */
+ public static final String RESOURCE_ID = "wsrp-resourceID";
+
+ /**
+ * 9.2.1.1.3.3 wsrp-preferOperation When this optional parameter (default value is "false") has a value of "true",
+ * the Portlet is indicating a preference for the Consumer to use the getResource operation to fetch the resource. If
+ * the resource URL specifies both the wsrp-url and the wsrp-resourceID parameters, the Consumer can use either the
+ * http proxy technique introduced in WSRP v1.0 or the getResource operation, but is encouraged to follow the
+ * guidance provided by this url parameter.
+ */
+ public static final String RESOURCE_PREFER_OPERATION = "wsrp-preferOperation";
+
+ /**
+ * 9.2.1.1.3.4 wsrp-resourceState The value of this portlet URL parameter defines the state which the Consumer MUST
+ * send in the resourceState field of the ResourceParams structure when the URL is activated. If this parameter is
+ * missing, the Consumer MUST NOT supply a value in the resourceState field of the ResourceParams structure.
+ */
+ public static final String RESOURCE_STATE = "wsrp-resourceState";
+
+ /** 9.2.1.1.3.6 wsrp-resourceCacheability */
+ public static final String RESOURCE_CACHEABILITY = "wsrp-resourceCacheability";
+
+ /** 9.2.1.3 wsrp-navigationalValues */
+ public static final String NAVIGATIONAL_VALUES = "wsrp-navigationalValues";
+}
Modified: components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPActionURL.java
===================================================================
--- components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPActionURL.java 2010-03-09 01:57:50 UTC (rev 2043)
+++ components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPActionURL.java 2010-03-09 02:19:25 UTC (rev 2044)
@@ -1,6 +1,6 @@
/*
* JBoss, a division of Red Hat
- * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
* contributors as indicated by the @authors tag. See the
* copyright.txt in the distribution for a full listing of
* individual contributors.
@@ -23,28 +23,26 @@
package org.gatein.wsrp;
-import org.gatein.pc.api.Mode;
-import org.gatein.pc.api.WindowState;
import org.gatein.pc.api.ActionURL;
+import org.gatein.pc.api.Mode;
import org.gatein.pc.api.OpaqueStateString;
import org.gatein.pc.api.StateString;
+import org.gatein.pc.api.WindowState;
import java.util.Map;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision: 12803 $
*/
public class WSRPActionURL extends WSRPPortletURL implements ActionURL
{
-
- private StateString navigationalState;
private StateString interactionState;
protected WSRPActionURL(Mode mode, WindowState windowState, boolean secure, StateString navigationalState, StateString interactionState)
{
- super(mode, windowState, secure);
- this.navigationalState = navigationalState;
+ super(mode, windowState, secure, navigationalState);
this.interactionState = interactionState;
}
@@ -63,13 +61,6 @@
interactionState = new OpaqueStateString(paramValue);
params.remove(WSRPRewritingConstants.INTERACTION_STATE);
}
-
- paramValue = getRawParameterValueFor(params, WSRPRewritingConstants.NAVIGATIONAL_STATE);
- if (paramValue != null)
- {
- navigationalState = new OpaqueStateString(paramValue);
- params.remove(WSRPRewritingConstants.NAVIGATIONAL_STATE);
- }
}
protected String getURLType()
@@ -77,11 +68,6 @@
return WSRPRewritingConstants.URL_TYPE_BLOCKING_ACTION;
}
- public StateString getNavigationalState()
- {
- return navigationalState;
- }
-
public StateString getInteractionState()
{
return interactionState;
@@ -93,10 +79,5 @@
{
createURLParameter(sb, WSRPRewritingConstants.INTERACTION_STATE, interactionState.getStringValue());
}
-
- if (navigationalState != null)
- {
- createURLParameter(sb, WSRPRewritingConstants.NAVIGATIONAL_STATE, navigationalState.getStringValue());
- }
}
}
Modified: components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPPortletURL.java
===================================================================
--- components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPPortletURL.java 2010-03-09 01:57:50 UTC (rev 2043)
+++ components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPPortletURL.java 2010-03-09 02:19:25 UTC (rev 2044)
@@ -1,6 +1,6 @@
/*
* JBoss, a division of Red Hat
- * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
* contributors as indicated by the @authors tag. See the
* copyright.txt in the distribution for a full listing of
* individual contributors.
@@ -23,13 +23,13 @@
package org.gatein.wsrp;
-import org.gatein.common.NotYetImplemented;
import org.gatein.common.text.FastURLDecoder;
import org.gatein.common.util.Tools;
import org.gatein.pc.api.ActionURL;
+import org.gatein.pc.api.ContainerURL;
import org.gatein.pc.api.Mode;
+import org.gatein.pc.api.OpaqueStateString;
import org.gatein.pc.api.ParametersStateString;
-import org.gatein.pc.api.PortletURL;
import org.gatein.pc.api.RenderURL;
import org.gatein.pc.api.ResourceURL;
import org.gatein.pc.api.StateString;
@@ -47,7 +47,7 @@
* @version $Revision: 13470 $
* @since 2.4 (Apr 28, 2006)
*/
-public abstract class WSRPPortletURL implements PortletURL
+public abstract class WSRPPortletURL implements ContainerURL
{
private static final Logger log = LoggerFactory.getLogger(WSRPPortletURL.class);
@@ -73,6 +73,7 @@
protected String extra;
/** Remember position of extra parameters wrt end token */
private boolean extraParamsAfterEndToken = false;
+ protected StateString navigationalState;
public static void setStrict(boolean strict)
{
@@ -80,43 +81,42 @@
log.debug("Using " + (strict ? "strict" : "lenient") + " rewriting parameters validation mode.");
}
- public static WSRPPortletURL create(PortletURL portletURL, boolean secure)
+ public static WSRPPortletURL create(ContainerURL containerURL, boolean secure)
{
- if (portletURL == null)
+ if (containerURL == null)
{
throw new IllegalArgumentException("Cannot construct a WSRPPortletURL from a null PortletURL!");
}
- Mode mode = portletURL.getMode();
- WindowState windowState = portletURL.getWindowState();
+ Mode mode = containerURL.getMode();
+ WindowState windowState = containerURL.getWindowState();
+ StateString navigationalState = containerURL.getNavigationalState();
WSRPPortletURL url;
- if (portletURL instanceof ActionURL)
+ if (containerURL instanceof ActionURL)
{
- StateString interactionState = ((ActionURL)portletURL).getInteractionState();
- StateString navigationalState = ((ActionURL)portletURL).getNavigationalState();
+ StateString interactionState = ((ActionURL)containerURL).getInteractionState();
url = new WSRPActionURL(mode, windowState, secure, navigationalState, interactionState);
}
- else if (portletURL instanceof RenderURL)
+ else if (containerURL instanceof RenderURL)
{
- StateString navigationalState = ((RenderURL)portletURL).getNavigationalState();
- url = new WSRPRenderURL(mode, windowState, secure, navigationalState);
+ url = new WSRPRenderURL(mode, windowState, secure, navigationalState, ((RenderURL)containerURL).getPublicNavigationalStateChanges());
}
- else if (portletURL instanceof ResourceURL)
+ else if (containerURL instanceof ResourceURL)
{
-// url = new WSRPResourceURL(mode, windowState, secure, ((ResourceURL) portletURL).getResourceURL(), false);
- // todo: implement!
- throw new NotYetImplemented("ResourceURL support not quite yet implemented!");
+ ResourceURL resource = (ResourceURL)containerURL;
+ url = new WSRPResourceURL(mode, windowState, secure, navigationalState, resource.getResourceState(),
+ resource.getResourceId(), resource.getCacheability());
}
else
{
- throw new IllegalArgumentException("Unknown PortletURL type: " + portletURL.getClass().getName());
+ throw new IllegalArgumentException("Unknown PortletURL type: " + containerURL.getClass().getName());
}
// if we're in relaxed mode, we need to deal with extra params as well
- if (strict && portletURL instanceof WSRPPortletURL)
+ if (strict && containerURL instanceof WSRPPortletURL)
{
- WSRPPortletURL other = (WSRPPortletURL)portletURL;
+ WSRPPortletURL other = (WSRPPortletURL)containerURL;
url.setParams(other.extraParams, other.toString());
url.setExtra(other.extra);
}
@@ -274,11 +274,12 @@
return create(encodedURL, Collections.<String>emptySet(), Collections.<String>emptySet());
}
- protected WSRPPortletURL(Mode mode, WindowState windowState, boolean secure)
+ protected WSRPPortletURL(Mode mode, WindowState windowState, boolean secure, StateString navigationalState)
{
this.mode = mode;
this.windowState = windowState;
this.secure = secure;
+ this.navigationalState = navigationalState;
}
protected WSRPPortletURL()
@@ -330,6 +331,14 @@
secure = Boolean.valueOf(paramValue);
params.remove(WSRPRewritingConstants.SECURE_URL);
}
+
+ // navigational state
+ paramValue = getRawParameterValueFor(params, WSRPRewritingConstants.NAVIGATIONAL_STATE);
+ if (paramValue != null)
+ {
+ navigationalState = new OpaqueStateString(paramValue);
+ params.remove(WSRPRewritingConstants.NAVIGATIONAL_STATE);
+ }
}
protected String getRawParameterValueFor(Map params, String parameterName)
@@ -387,6 +396,11 @@
createURLParameter(sb, WSRPRewritingConstants.WINDOW_STATE, WSRPUtils.getWSRPNameFromJSR168WindowState(windowState));
}
+ if (navigationalState != null)
+ {
+ createURLParameter(sb, WSRPRewritingConstants.NAVIGATIONAL_STATE, navigationalState.getStringValue());
+ }
+
// todo: not sure how to deal with authenticated
//
@@ -564,4 +578,9 @@
{
this.extra = extra;
}
+
+ public StateString getNavigationalState()
+ {
+ return navigationalState;
+ }
}
Modified: components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPRenderURL.java
===================================================================
--- components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPRenderURL.java 2010-03-09 01:57:50 UTC (rev 2043)
+++ components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPRenderURL.java 2010-03-09 02:19:25 UTC (rev 2044)
@@ -24,7 +24,6 @@
package org.gatein.wsrp;
import org.gatein.pc.api.Mode;
-import org.gatein.pc.api.OpaqueStateString;
import org.gatein.pc.api.RenderURL;
import org.gatein.pc.api.StateString;
import org.gatein.pc.api.WindowState;
@@ -33,17 +32,18 @@
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision: 11404 $
*/
public class WSRPRenderURL extends WSRPPortletURL implements RenderURL
{
+ private Map<String, String[]> publicNSChanges;
- private StateString navigationalState;
-
- protected WSRPRenderURL(Mode mode, WindowState windowState, boolean secure, StateString navigationalState)
+ protected WSRPRenderURL(Mode mode, WindowState windowState, boolean secure, StateString navigationalState, Map<String, String[]> publicNavigationalStateChanges)
{
- super(mode, windowState, secure);
- this.navigationalState = navigationalState;
+ super(mode, windowState, secure, navigationalState);
+
+ this.publicNSChanges = publicNavigationalStateChanges;
}
protected WSRPRenderURL()
@@ -55,11 +55,12 @@
{
super.dealWithSpecificParams(params, originalURL);
- String paramValue = getRawParameterValueFor(params, WSRPRewritingConstants.NAVIGATIONAL_STATE);
+ /*String paramValue = getRawParameterValueFor(params, WSRP2RewritingConstants.NAVIGATIONAL_VALUES);
if (paramValue != null)
{
- navigationalState = new OpaqueStateString(paramValue);
- }
+ publicNSChanges = decodePublicNS(paramValue);
+ params.remove(WSRP2RewritingConstants.NAVIGATIONAL_VALUES);
+ }*/
}
protected String getURLType()
@@ -67,21 +68,19 @@
return WSRPRewritingConstants.URL_TYPE_RENDER;
}
- public StateString getNavigationalState()
- {
- return navigationalState;
- }
-
public Map<String, String[]> getPublicNavigationalStateChanges()
{
- return null; // todo: fix me
+ return publicNSChanges;
}
protected void appendEnd(StringBuffer sb)
{
- if (navigationalState != null)
+ /*
+ // todo: publicNS must be encoded according to rules found at:
+ // http://docs.oasis-open.org/wsrp/v2/wsrp-2.0-spec-os-01.html#_wsrp-navigat...
+ if(publicNSChanges != null)
{
- createURLParameter(sb, WSRPRewritingConstants.NAVIGATIONAL_STATE, navigationalState.getStringValue());
- }
+ createURLParameter(sb, WSRP2RewritingConstants.NAVIGATIONAL_VALUES, encodePublicNS(publicNSChanges));
+ }*/
}
}
Modified: components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPResourceURL.java
===================================================================
--- components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPResourceURL.java 2010-03-09 01:57:50 UTC (rev 2043)
+++ components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPResourceURL.java 2010-03-09 02:19:25 UTC (rev 2044)
@@ -1,34 +1,39 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2009, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.gatein.wsrp;
import org.gatein.common.net.URLTools;
import org.gatein.common.net.media.MediaType;
import org.gatein.pc.api.Mode;
+import org.gatein.pc.api.PortletContext;
+import org.gatein.pc.api.ResourceURL;
+import org.gatein.pc.api.StateString;
import org.gatein.pc.api.WindowState;
+import org.gatein.pc.api.cache.CacheLevel;
import org.jboss.logging.Logger;
+import javax.servlet.http.HttpServletRequest;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
@@ -39,14 +44,19 @@
* @version $Revision: 13470 $
* @since 2.4
*/
-public class WSRPResourceURL extends WSRPPortletURL
+public class WSRPResourceURL extends WSRPPortletURL implements ResourceURL
{
private final static Logger log = Logger.getLogger(WSRPResourceURL.class);
+ private String resourceId;
+ private StateString resourceState;
+ private CacheLevel cacheability;
+
+ private boolean requiresRewrite = false;
private URL resourceURL;
- private boolean requiresRewrite = false;
- private static final Map<String, MediaType> SUPPORTED_RESOURCE_TYPES = new HashMap<String, MediaType>(4);
+ private static final Map<String, MediaType> SUPPORTED_RESOURCE_TYPES = new HashMap<String, MediaType>(8);
+
static
{
SUPPORTED_RESOURCE_TYPES.put("css", MediaType.TEXT_CSS);
@@ -60,17 +70,17 @@
SUPPORTED_RESOURCE_TYPES.put("txt", MediaType.create("text/plain"));
}
-
- public WSRPResourceURL(Mode mode, WindowState windowState, boolean secure, URL resourceURL, boolean requiresRewrite)
+ public WSRPResourceURL()
{
- super(mode, windowState, secure);
- this.resourceURL = resourceURL;
- this.requiresRewrite = requiresRewrite;
}
- public WSRPResourceURL()
+ public WSRPResourceURL(Mode mode, WindowState windowState, boolean secure, StateString navigationalState, StateString resourceState, String resourceId, CacheLevel cacheability)
{
- super();
+ super(mode, windowState, secure, navigationalState);
+
+ this.resourceId = resourceId;
+ this.resourceState = resourceState;
+ this.cacheability = cacheability;
}
protected String getURLType()
@@ -115,19 +125,13 @@
{
paramValue = URLTools.decodeXWWWFormURL(paramValue);
- if (requiresRewrite)
- {
- // todo: do something...
- log.debug("Required re-writing but this is not yet implemented...");
- }
-
resourceURL = new URL(paramValue);
- String file = resourceURL.getFile();
+ String extension = URLTools.getFileExtensionOrNullFrom(resourceURL);
- MediaType mediaType = SUPPORTED_RESOURCE_TYPES.get(file);
+ MediaType mediaType = SUPPORTED_RESOURCE_TYPES.get(extension);
if (mediaType == null)
{
- log.debug("Couldn't determine (based on extension) MIME type of file: " + file
+ log.debug("Couldn't determine (based on extension) MIME type of file: " + resourceURL.getPath()
+ "\nRetrieving the associated resource will probably fail.");
}
@@ -145,18 +149,52 @@
}
}
- public String toString()
+ public String getResourceId()
{
- StringBuffer result = new StringBuffer(resourceURL.toExternalForm());
+ return resourceId;
+ }
- appendExtraParams(result);
+ public StateString getResourceState()
+ {
+ return resourceState;
+ }
- // append extra characters if we have some
- if (extra != null)
+ public CacheLevel getCacheability()
+ {
+ return cacheability;
+ }
+
+ /**
+ * This method is a hack to provide a minimal resource support before WSRP 2 so that bridged portlets work. We
+ * basically build a resource URL based on the server address and the targeted portlet context (which hopefully can
+ * be mapped to the context path of the war file it's deployed in). JBoss Portlet Bridge 2.0 uses a resource ID that
+ * is the absolute path to resource inside web application context for static resources.
+ *
+ * @param request
+ * @param portletContext
+ */
+ public void buildURLWith(HttpServletRequest request, PortletContext portletContext)
+ {
+ String url = URLTools.getServerAddressFrom(request) + URLTools.SLASH + portletContext.getApplicationName();
+
+ if (resourceId != null)
{
- result.append(extra);
+ url += resourceId;
}
- return result.toString();
+ try
+ {
+ resourceURL = new URL(url);
+ String extension = URLTools.getFileExtensionOrNullFrom(resourceURL);
+ MediaType type = SUPPORTED_RESOURCE_TYPES.get(extension);
+ if (MediaType.TEXT_CSS.equals(type) || MediaType.TEXT_JAVASCRIPT.equals(type))
+ {
+ requiresRewrite = true;
+ }
+ }
+ catch (MalformedURLException e)
+ {
+ throw new IllegalArgumentException("Malformed URL: " + url, e);
+ }
}
}
Modified: components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPUtils.java
===================================================================
--- components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPUtils.java 2010-03-09 01:57:50 UTC (rev 2043)
+++ components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPUtils.java 2010-03-09 02:19:25 UTC (rev 2044)
@@ -1,6 +1,6 @@
/*
* JBoss, a division of Red Hat
- * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
* contributors as indicated by the @authors tag. See the
* copyright.txt in the distribution for a full listing of
* individual contributors.
@@ -24,6 +24,7 @@
package org.gatein.wsrp;
import org.gatein.common.i18n.LocaleFormat;
+import org.gatein.common.net.URLTools;
import org.gatein.common.util.ConversionException;
import org.gatein.common.util.ParameterValidation;
import org.gatein.pc.api.ActionURL;
@@ -479,4 +480,52 @@
localizedString.setResourceName(wsrpLocalizedString.getResourceName());
return localizedString;
}
+
+ /**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+ public static class AbsoluteURLReplacementGenerator extends URLTools.URLReplacementGenerator
+ {
+ private String serverAddress;
+
+ public AbsoluteURLReplacementGenerator(HttpServletRequest request)
+ {
+ serverAddress = URLTools.getServerAddressFrom(request);
+ }
+
+ public String getReplacementFor(int i, URLTools.URLMatch urlMatch)
+ {
+ return getAbsoluteURLFor(urlMatch.getURLAsString());
+ }
+
+ /**
+ * todo: public only for tests
+ *
+ * @param url
+ * @return
+ */
+ public String getAbsoluteURLFor(String url)
+ {
+ return getAbsoluteURLFor(url, true, serverAddress);
+ }
+
+ public static String getAbsoluteURLFor(String url, boolean checkWSRPToken, String serverAddress)
+ {
+ // We don't encode URL through this API when it is a wsrp URL
+ if (checkWSRPToken && url.startsWith(WSRPRewritingConstants.BEGIN_WSRP_REWRITE))
+ {
+ return url;
+ }
+
+ if (!URLTools.isNetworkURL(url) && url.startsWith(URLTools.SLASH))
+ {
+ return serverAddress + url;
+ }
+ else
+ {
+ return url;
+ }
+ }
+ }
}
Copied: components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/AbsoluteURLReplacementGeneratorTestCase.java (from rev 2001, components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/AbsoluteURLReplacementGeneratorTestCase.java)
===================================================================
--- components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/AbsoluteURLReplacementGeneratorTestCase.java (rev 0)
+++ components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/AbsoluteURLReplacementGeneratorTestCase.java 2010-03-09 02:19:25 UTC (rev 2044)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.gatein.wsrp;
+
+import junit.framework.TestCase;
+import org.gatein.wsrp.test.support.MockHttpServletRequest;
+
+import static org.gatein.common.net.URLTools.PORT_END;
+import static org.gatein.common.net.URLTools.SCH_END;
+import static org.gatein.wsrp.test.support.MockHttpServletRequest.*;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class AbsoluteURLReplacementGeneratorTestCase extends TestCase
+{
+ private WSRPUtils.AbsoluteURLReplacementGenerator gen;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+
+ gen = new WSRPUtils.AbsoluteURLReplacementGenerator(MockHttpServletRequest.createMockRequest(null));
+ }
+
+ public void testNonAbsoluteURL()
+ {
+ String url = "foo";
+ assertEquals(url, gen.getAbsoluteURLFor(url));
+ }
+
+ public void testAbsoluteURL()
+ {
+ String url = "/foo";
+ assertEquals(scheme + SCH_END + serverName + PORT_END + serverPort + url, gen.getAbsoluteURLFor(url));
+ }
+
+ public void testWSRPEncodedURL()
+ {
+ String url = "wsrp_rewrite?wsrp-urlType=blockingAction&wsrp-interactionState=JBPNS_/wsrp_rewrite";
+ assertEquals(url, gen.getAbsoluteURLFor(url));
+ }
+}
Property changes on: components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/AbsoluteURLReplacementGeneratorTestCase.java
___________________________________________________________________
Name: svn:executable
+ *
Modified: components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/other/WSRPPortletURLTestCase.java
===================================================================
--- components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/other/WSRPPortletURLTestCase.java 2010-03-09 01:57:50 UTC (rev 2043)
+++ components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/other/WSRPPortletURLTestCase.java 2010-03-09 02:19:25 UTC (rev 2044)
@@ -1,25 +1,25 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2009, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.gatein.wsrp.other;
@@ -54,7 +54,7 @@
"&wsrp-requiresRewrite=true/wsrp_rewrite";
WSRPPortletURL url = WSRPPortletURL.create(expected);
- assertEquals("http://test.com/images/test.gif", url.toString());
+ assertEquals("wsrp_rewrite?wsrp-urlType=resource&wsrp-url=http://test.com/images/test.g...", url.toString());
}
/** Declare a secure interaction back to the Portlet */
@@ -132,7 +132,7 @@
checkInvalidURL(stillInvalid, "Should have detected missing end token", WSRPRewritingConstants.END_WSRP_REWRITE);
}
- public void testExtraRelaxedValidation()
+ /*public void testExtraRelaxedValidation()
{
String valid = "wsrp_rewrite?wsrp-urlType=resource&wsrp-url=http%3A%2F%2Flocalhost%3A8080%2Fhelloworld&wsrp-requiresRewrite=true/wsrp_rewrite/helloworld.jar";
WSRPPortletURL url = WSRPPortletURL.create(valid);
@@ -145,7 +145,7 @@
String validInRelaxedMode = "wsrp_rewrite?wsrp-urlType=resource&wsrp-url=http%3A%2F%2Flocalhost%3A8080%2Fhelloworld&wsrp-requiresRewrite=true/wsrp_rewrite&foo=bar/helloworld.jar";
url = WSRPPortletURL.create(validInRelaxedMode);
assertEquals("http://localhost:8080/helloworld&foo=bar/helloworld.jar", url.toString());
- }
+ }*/
public void testExtraParameters()
{
Modified: components/wsrp/trunk/pom.xml
===================================================================
--- components/wsrp/trunk/pom.xml 2010-03-09 01:57:50 UTC (rev 2043)
+++ components/wsrp/trunk/pom.xml 2010-03-09 02:19:25 UTC (rev 2044)
@@ -47,8 +47,8 @@
</scm>
<properties>
- <version.gatein.pc>2.1.0-CR05</version.gatein.pc>
- <version.gatein.common>2.0.0-CR03</version.gatein.common>
+ <version.gatein.pc>2.1.0-CR06-SNAPSHOT</version.gatein.pc>
+ <version.gatein.common>2.0.0-CR04-SNAPSHOT</version.gatein.common>
<version.gatein.wci>2.0.0-CR02</version.gatein.wci>
<version.jsf>1.2_12</version.jsf>
@@ -163,6 +163,7 @@
<module>test</module>
<module>producer</module>
<module>consumer</module>
+ <!--<module>consumer-proxy</module>-->
<module>admin-gui</module>
<module>wsrp-producer-war</module>
<module>hibernate-impl</module>
Deleted: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/AbsoluteURLReplacementGenerator.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/AbsoluteURLReplacementGenerator.java 2010-03-09 01:57:50 UTC (rev 2043)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/AbsoluteURLReplacementGenerator.java 2010-03-09 02:19:25 UTC (rev 2044)
@@ -1,84 +0,0 @@
-/*
- * JBoss, a division of Red Hat
- * Copyright 2009, Red Hat Middleware, LLC, and individual
- * contributors as indicated by the @authors tag. See the
- * copyright.txt in the distribution for a full listing of
- * individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.gatein.wsrp.producer;
-
-import org.gatein.common.net.URLTools;
-import org.gatein.wsrp.WSRPRewritingConstants;
-
-import javax.servlet.http.HttpServletRequest;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
- * @version $Revision$
- */
-public class AbsoluteURLReplacementGenerator extends URLTools.URLReplacementGenerator
-{
- private String serverAddress;
- public static final String SCH_END = "://";
- public static final String PORT_END = ":";
- public static final String SLASH = "/";
-
- public AbsoluteURLReplacementGenerator(HttpServletRequest request)
- {
- String scheme = request.getScheme();
- String host = request.getServerName();
- int port = request.getServerPort();
-
- serverAddress = scheme + SCH_END + host + PORT_END + port;
- }
-
- public String getReplacementFor(int i, URLTools.URLMatch urlMatch)
- {
- return getAbsoluteURLFor(urlMatch.getURLAsString());
- }
-
- /**
- * todo: public only for tests
- *
- * @param url
- * @return
- */
- public String getAbsoluteURLFor(String url)
- {
- return getAbsoluteURLFor(url, true);
- }
-
- String getAbsoluteURLFor(String url, boolean checkWSRPToken)
- {
- // We don't encode URL through this API when it is a wsrp URL
- if (checkWSRPToken && url.startsWith(WSRPRewritingConstants.BEGIN_WSRP_REWRITE))
- {
- return url;
- }
-
- if (!URLTools.isNetworkURL(url) && url.startsWith(SLASH))
- {
- return serverAddress + url;
- }
- else
- {
- return url;
- }
- }
-}
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/RenderRequestProcessor.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/RenderRequestProcessor.java 2010-03-09 01:57:50 UTC (rev 2043)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/RenderRequestProcessor.java 2010-03-09 02:19:25 UTC (rev 2044)
@@ -1,6 +1,6 @@
/*
* JBoss, a division of Red Hat
- * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
* contributors as indicated by the @authors tag. See the
* copyright.txt in the distribution for a full listing of
* individual contributors.
@@ -33,6 +33,7 @@
import org.gatein.wsrp.WSRPConstants;
import org.gatein.wsrp.WSRPRewritingConstants;
import org.gatein.wsrp.WSRPTypeFactory;
+import org.gatein.wsrp.WSRPUtils;
import org.gatein.wsrp.servlet.ServletAccess;
import org.oasis.wsrp.v1.GetMarkup;
import org.oasis.wsrp.v1.InvalidHandle;
@@ -170,7 +171,7 @@
{
String result = renderString.replaceAll(namespace, WSRPRewritingConstants.WSRP_REWRITE_TOKEN);
- result = URLTools.replaceURLsBy(result, new AbsoluteURLReplacementGenerator(ServletAccess.getRequest()));
+ result = URLTools.replaceURLsBy(result, new WSRPUtils.AbsoluteURLReplacementGenerator(ServletAccess.getRequest()));
return result;
}
}
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPInstanceContext.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPInstanceContext.java 2010-03-09 01:57:50 UTC (rev 2043)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPInstanceContext.java 2010-03-09 02:19:25 UTC (rev 2044)
@@ -1,6 +1,6 @@
/*
* JBoss, a division of Red Hat
- * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
* contributors as indicated by the @authors tag. See the
* copyright.txt in the distribution for a full listing of
* individual contributors.
@@ -84,7 +84,7 @@
return wasModified;
}
- public PortletContext getPortletContext()
+ PortletContext getPortletContext()
{
return context;
}
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPPortletInvocationContext.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPPortletInvocationContext.java 2010-03-09 01:57:50 UTC (rev 2043)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPPortletInvocationContext.java 2010-03-09 02:19:25 UTC (rev 2044)
@@ -1,6 +1,6 @@
/*
* JBoss, a division of Red Hat
- * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
* contributors as indicated by the @authors tag. See the
* copyright.txt in the distribution for a full listing of
* individual contributors.
@@ -23,15 +23,11 @@
package org.gatein.wsrp.producer;
-import org.gatein.common.NotYetImplemented;
import org.gatein.common.net.URLTools;
import org.gatein.common.util.MarkupInfo;
import org.gatein.pc.api.ContainerURL;
-import org.gatein.pc.api.PortletURL;
-import org.gatein.pc.api.ResourceURL;
import org.gatein.pc.api.URLFormat;
import org.gatein.pc.api.invocation.PortletInvocation;
-import org.gatein.pc.api.spi.InstanceContext;
import org.gatein.pc.api.spi.PortalContext;
import org.gatein.pc.api.spi.PortletInvocationContext;
import org.gatein.pc.api.spi.SecurityContext;
@@ -41,7 +37,9 @@
import org.gatein.pc.portlet.impl.spi.AbstractPortletInvocationContext;
import org.gatein.pc.portlet.impl.spi.AbstractServerContext;
import org.gatein.wsrp.WSRPPortletURL;
+import org.gatein.wsrp.WSRPResourceURL;
import org.gatein.wsrp.WSRPRewritingConstants;
+import org.gatein.wsrp.WSRPUtils;
import org.gatein.wsrp.servlet.ServletAccess;
import javax.servlet.http.HttpServletRequest;
@@ -57,7 +55,7 @@
private SecurityContext securityContext;
private PortalContext portalContext;
private UserContext userContext;
- private InstanceContext instanceContext;
+ private WSRPInstanceContext instanceContext;
private WindowContext windowContext;
private static final String EQ = "=";
@@ -67,7 +65,7 @@
private HttpServletResponse response;
public WSRPPortletInvocationContext(MarkupInfo markupInfo, SecurityContext securityContext, PortalContext portalContext, UserContext userContext,
- InstanceContext instanceContext, WindowContext windowContext)
+ WSRPInstanceContext instanceContext, WindowContext windowContext)
{
super(markupInfo);
@@ -97,7 +95,7 @@
if (url != null && !url.startsWith(WSRPRewritingConstants.BEGIN_WSRP_REWRITE))
{
// make root relative URLs absolute. Optimization: we don't recheck the precense of the WSRP token.
- url = new AbsoluteURLReplacementGenerator(getClientRequest()).getAbsoluteURLFor(url, false);
+ url = WSRPUtils.AbsoluteURLReplacementGenerator.getAbsoluteURLFor(url, false, URLTools.getServerAddressFrom(getClientRequest()));
// properly encode the URL
url = URLTools.encodeXWWWFormURL(url);
@@ -132,19 +130,15 @@
{
if (containerURL != null)
{
- if (containerURL instanceof PortletURL)
+ Boolean wantSecureBool = urlFormat.getWantSecure();
+ boolean wantSecure = (wantSecureBool != null ? wantSecureBool : false);
+ WSRPPortletURL url = WSRPPortletURL.create(containerURL, wantSecure);
+ if (url instanceof WSRPResourceURL)
{
- PortletURL portletURL = (PortletURL)containerURL;
-
- Boolean wantSecureBool = urlFormat.getWantSecure();
- boolean wantSecure = (wantSecureBool != null ? wantSecureBool : false);
- return WSRPPortletURL.create(portletURL, wantSecure).toString();
+ WSRPResourceURL resourceURL = (WSRPResourceURL)url;
+ resourceURL.buildURLWith(request, instanceContext.getPortletContext());
}
- else if (containerURL instanceof ResourceURL)
- {
- ResourceURL resourceURL = (ResourceURL)containerURL;
- throw new NotYetImplemented("ResourceURL support not implemented. Requested URL: " + resourceURL);
- }
+ return url.toString();
}
return null;
}
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPProducerImpl.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPProducerImpl.java 2010-03-09 01:57:50 UTC (rev 2043)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/WSRPProducerImpl.java 2010-03-09 02:19:25 UTC (rev 2044)
@@ -1,6 +1,6 @@
/*
* JBoss, a division of Red Hat
- * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
* contributors as indicated by the @authors tag. See the
* copyright.txt in the distribution for a full listing of
* individual contributors.
@@ -444,25 +444,9 @@
private boolean isRemotable(Portlet portlet)
{
Map<String, RuntimeOptionInfo> runtimeOptions = portlet.getInfo().getRuntimeOptionsInfo();
- RuntimeOptionInfo runtimeOptionInfo = runtimeOptions.get(RuntimeOptionInfo.ORG_JBOSS_PORTLETCONTAINER_REMOTABLE);
+ RuntimeOptionInfo runtimeOptionInfo = runtimeOptions.get(RuntimeOptionInfo.REMOTABLE_RUNTIME_OPTION);
return runtimeOptionInfo != null && "true".equals(runtimeOptionInfo.getValues().get(0));
-
- /*WSRPInfo wsrpInfo = portletInfo.getAttachment(WSRPInfo.class);
- if (wsrpInfo != null)
- {
- Boolean remotable = wsrpInfo.isRemotable();
- log.debug("Portlet " + portlet.getContext() + " remotable: " + remotable);
- if (remotable != null)
- {
- return remotable.booleanValue();
- }
- }
- if (isRemotableByDefault() != null)
- {
- return isRemotableByDefault().booleanValue();
- }
- return false;*/
}
public List<String> getSupportedLocales()
Deleted: components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/AbsoluteURLReplacementGeneratorTestCase.java
===================================================================
--- components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/AbsoluteURLReplacementGeneratorTestCase.java 2010-03-09 01:57:50 UTC (rev 2043)
+++ components/wsrp/trunk/producer/src/test/java/org/gatein/wsrp/producer/AbsoluteURLReplacementGeneratorTestCase.java 2010-03-09 02:19:25 UTC (rev 2044)
@@ -1,65 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-
-package org.gatein.wsrp.producer;
-
-import junit.framework.TestCase;
-import org.gatein.wsrp.test.support.MockHttpServletRequest;
-
-import static org.gatein.wsrp.producer.AbsoluteURLReplacementGenerator.PORT_END;
-import static org.gatein.wsrp.producer.AbsoluteURLReplacementGenerator.SCH_END;
-import static org.gatein.wsrp.test.support.MockHttpServletRequest.*;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
- * @version $Revision$
- */
-public class AbsoluteURLReplacementGeneratorTestCase extends TestCase
-{
- private AbsoluteURLReplacementGenerator gen;
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
-
- gen = new AbsoluteURLReplacementGenerator(MockHttpServletRequest.createMockRequest(null));
- }
-
- public void testNonAbsoluteURL()
- {
- String url = "foo";
- assertEquals(url, gen.getAbsoluteURLFor(url));
- }
-
- public void testAbsoluteURL()
- {
- String url = "/foo";
- assertEquals(scheme + SCH_END + serverName + PORT_END + serverPort + url, gen.getAbsoluteURLFor(url));
- }
-
- public void testWSRPEncodedURL()
- {
- String url = "wsrp_rewrite?wsrp-urlType=blockingAction&wsrp-interactionState=JBPNS_/wsrp_rewrite";
- assertEquals(url, gen.getAbsoluteURLFor(url));
- }
-}
14 years, 9 months
gatein SVN: r2043 - in components/common/trunk/common/src: test/java/org/gatein/common/net and 1 other directory.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-03-08 20:57:50 -0500 (Mon, 08 Mar 2010)
New Revision: 2043
Modified:
components/common/trunk/common/src/main/java/org/gatein/common/net/URLTools.java
components/common/trunk/common/src/test/java/org/gatein/common/net/URLToolsTestCase.java
Log:
- Make sure that getExtensionOrNullFrom gets the real extension.
Modified: components/common/trunk/common/src/main/java/org/gatein/common/net/URLTools.java
===================================================================
--- components/common/trunk/common/src/main/java/org/gatein/common/net/URLTools.java 2010-03-09 01:51:35 UTC (rev 2042)
+++ components/common/trunk/common/src/main/java/org/gatein/common/net/URLTools.java 2010-03-09 01:57:50 UTC (rev 2043)
@@ -99,7 +99,7 @@
return null;
}
- int periodIndex = file.indexOf('.');
+ int periodIndex = file.lastIndexOf('.');
if (periodIndex != -1)
{
String extension = file.substring(periodIndex + 1);
Modified: components/common/trunk/common/src/test/java/org/gatein/common/net/URLToolsTestCase.java
===================================================================
--- components/common/trunk/common/src/test/java/org/gatein/common/net/URLToolsTestCase.java 2010-03-09 01:51:35 UTC (rev 2042)
+++ components/common/trunk/common/src/test/java/org/gatein/common/net/URLToolsTestCase.java 2010-03-09 01:57:50 UTC (rev 2043)
@@ -286,5 +286,11 @@
url = new URL("http://localhost:8080/portal/file.");
assertNull(URLTools.getFileExtensionOrNullFrom(url));
+
+ url = new URL("http://localhost:8080/portal/file.txt?blah");
+ assertEquals("txt", URLTools.getFileExtensionOrNullFrom(url));
+
+ url = new URL("http://localhost:8080/portal/file.txt.xml?blah");
+ assertEquals("xml", URLTools.getFileExtensionOrNullFrom(url));
}
}
14 years, 9 months
gatein SVN: r2042 - in components/common/trunk/common/src: test/java/org/gatein/common/net and 1 other directory.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-03-08 20:51:35 -0500 (Mon, 08 Mar 2010)
New Revision: 2042
Modified:
components/common/trunk/common/src/main/java/org/gatein/common/net/URLTools.java
components/common/trunk/common/src/test/java/org/gatein/common/net/URLToolsTestCase.java
Log:
- Added getFileExtensionOrNullFrom method and associated test cases.
Modified: components/common/trunk/common/src/main/java/org/gatein/common/net/URLTools.java
===================================================================
--- components/common/trunk/common/src/main/java/org/gatein/common/net/URLTools.java 2010-03-08 22:30:43 UTC (rev 2041)
+++ components/common/trunk/common/src/main/java/org/gatein/common/net/URLTools.java 2010-03-09 01:51:35 UTC (rev 2042)
@@ -86,6 +86,31 @@
return scheme + SCH_END + host + PORT_END + port;
}
+ public static String getFileExtensionOrNullFrom(URL url)
+ {
+ if (url == null)
+ {
+ return null;
+ }
+
+ String file = url.getPath();
+ if (file == null)
+ {
+ return null;
+ }
+
+ int periodIndex = file.indexOf('.');
+ if (periodIndex != -1)
+ {
+ String extension = file.substring(periodIndex + 1);
+ return extension.length() > 0 ? extension : null;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
/**
* Fetches content from of the URL as a byte array or <code>null</code> if a problem occurred. The timeout values
* must not be negative integers, when it is equals to zero it means that it does not setup a timeout and use the
Modified: components/common/trunk/common/src/test/java/org/gatein/common/net/URLToolsTestCase.java
===================================================================
--- components/common/trunk/common/src/test/java/org/gatein/common/net/URLToolsTestCase.java 2010-03-08 22:30:43 UTC (rev 2041)
+++ components/common/trunk/common/src/test/java/org/gatein/common/net/URLToolsTestCase.java 2010-03-09 01:51:35 UTC (rev 2042)
@@ -26,7 +26,6 @@
import org.gatein.common.ExtendedAssert;
import org.gatein.common.logging.Logger;
import org.gatein.common.logging.LoggerFactory;
-import org.gatein.common.net.URLTools;
import java.net.MalformedURLException;
import java.net.URL;
@@ -271,4 +270,21 @@
//
server.performInteraction();
}
+
+ public void testGetFileExtensionOrNullFrom() throws MalformedURLException
+ {
+ assertNull(URLTools.getFileExtensionOrNullFrom(null));
+
+ URL url = new URL("http://localhost:8080");
+ assertNull(URLTools.getFileExtensionOrNullFrom(url));
+
+ url = new URL("http://localhost:8080/portal");
+ assertNull(URLTools.getFileExtensionOrNullFrom(url));
+
+ url = new URL("http://localhost:8080/portal/file.txt");
+ assertEquals("txt", URLTools.getFileExtensionOrNullFrom(url));
+
+ url = new URL("http://localhost:8080/portal/file.");
+ assertNull(URLTools.getFileExtensionOrNullFrom(url));
+ }
}
14 years, 9 months
gatein SVN: r2041 - in components/common/trunk/common/src/main/java/org/gatein/common: net and 1 other directory.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-03-08 17:30:43 -0500 (Mon, 08 Mar 2010)
New Revision: 2041
Modified:
components/common/trunk/common/src/main/java/org/gatein/common/
components/common/trunk/common/src/main/java/org/gatein/common/net/URLTools.java
Log:
- Added getServerAddressFrom method.
Property changes on: components/common/trunk/common/src/main/java/org/gatein/common
___________________________________________________________________
Name: svn:ignore
+ *.iml
.idea
Modified: components/common/trunk/common/src/main/java/org/gatein/common/net/URLTools.java
===================================================================
--- components/common/trunk/common/src/main/java/org/gatein/common/net/URLTools.java 2010-03-08 18:10:56 UTC (rev 2040)
+++ components/common/trunk/common/src/main/java/org/gatein/common/net/URLTools.java 2010-03-08 22:30:43 UTC (rev 2041)
@@ -29,6 +29,7 @@
import org.gatein.common.text.FastURLEncoder;
import org.gatein.common.util.ParameterValidation;
+import javax.servlet.http.HttpServletRequest;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
@@ -59,6 +60,10 @@
public static final String FTP_PREFIX = "ftp://";
public static final String FILE_PREFIX = "/";
+ public static final String SCH_END = "://";
+ public static final String PORT_END = ":";
+ public static final String SLASH = "/";
+
private static final Logger log = LoggerFactory.getLogger(URLTools.class);
public static boolean isURLAbsolute(String url)
@@ -67,6 +72,21 @@
}
/**
+ * Returns the server address that originated the request, without final /.
+ *
+ * @param request
+ * @return
+ */
+ public static String getServerAddressFrom(HttpServletRequest request)
+ {
+ String scheme = request.getScheme();
+ String host = request.getServerName();
+ int port = request.getServerPort();
+
+ return scheme + SCH_END + host + PORT_END + port;
+ }
+
+ /**
* Fetches content from of the URL as a byte array or <code>null</code> if a problem occurred. The timeout values
* must not be negative integers, when it is equals to zero it means that it does not setup a timeout and use the
* default values.
@@ -470,23 +490,23 @@
public static String safeEncodeForHTMLId(String value)
{
- value = value.replace("=", EQUALS);
- value = value.replace("/", SLASH);
- value = value.replace(".", DOT);
- return value.replace("+", PLUS);
+ value = value.replace("=", EQUALS_REPLACEMENT);
+ value = value.replace("/", SLASH_REPLACEMENT);
+ value = value.replace(".", DOT_REPLACEMENT);
+ return value.replace("+", PLUS_REPLACEMENT);
}
public static String safeDecodeForHTMLId(String value)
{
- value = value.replace(EQUALS, "=");
- value = value.replace(SLASH, "/");
- value = value.replace(DOT, ".");
- return value.replace(PLUS, "+");
+ value = value.replace(EQUALS_REPLACEMENT, "=");
+ value = value.replace(SLASH_REPLACEMENT, "/");
+ value = value.replace(DOT_REPLACEMENT, ".");
+ return value.replace(PLUS_REPLACEMENT, "+");
}
- private static final String EQUALS = "_e";
- private static final String SLASH = "_s";
- private static final String DOT = "_d";
- private static final String PLUS = "_p";
+ private static final String EQUALS_REPLACEMENT = "_e";
+ private static final String SLASH_REPLACEMENT = "_s";
+ private static final String DOT_REPLACEMENT = "_d";
+ private static final String PLUS_REPLACEMENT = "_p";
}
14 years, 9 months
gatein SVN: r2040 - portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application.
by do-not-reply@jboss.org
Author: mwringe
Date: 2010-03-08 13:10:56 -0500 (Mon, 08 Mar 2010)
New Revision: 2040
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java
Log:
GTNPORTAL-825: Add support for HTTPRedirectionResponse from the portlet container. This will allow for sendRedirects to work properly during an action.
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java 2010-03-08 17:37:50 UTC (rev 2039)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java 2010-03-08 18:10:56 UTC (rev 2040)
@@ -47,6 +47,7 @@
import org.gatein.pc.api.invocation.ResourceInvocation;
import org.gatein.pc.api.invocation.response.ContentResponse;
import org.gatein.pc.api.invocation.response.ErrorResponse;
+import org.gatein.pc.api.invocation.response.HTTPRedirectionResponse;
import org.gatein.pc.api.invocation.response.PortletInvocationResponse;
import org.gatein.pc.api.invocation.response.UpdateNavigationalStateResponse;
@@ -55,6 +56,8 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.xml.namespace.QName;
+
+import java.io.IOException;
import java.io.OutputStream;
import java.io.Serializable;
import java.util.ArrayList;
@@ -125,25 +128,35 @@
uiPortlet.update((C)wsrp);
}
}
-
- // todo: handle the error response better than this.
- if (!(portletResponse instanceof UpdateNavigationalStateResponse))
+
+ if (portletResponse instanceof UpdateNavigationalStateResponse)
{
- if (portletResponse instanceof ErrorResponse)
- {
- ErrorResponse errorResponse = (ErrorResponse)portletResponse;
- throw (Exception)errorResponse.getCause();
- }
- else
- {
- throw new Exception("Unexpected response type [" + portletResponse
- + "]. Expected a UpdateNavigationResponse or an ErrorResponse.");
- }
+ handleUpdateNavigationalStateResponse((UpdateNavigationalStateResponse)portletResponse, uiPortlet, prcontext);
}
-
- //
- UpdateNavigationalStateResponse navStateResponse = (UpdateNavigationalStateResponse)portletResponse;
-
+ else if (portletResponse instanceof HTTPRedirectionResponse)
+ {
+ handleRedirectionResponse((HTTPRedirectionResponse)portletResponse, prcontext.getResponse());
+ }
+ else if (portletResponse instanceof ErrorResponse)
+ {
+ handleErrorResponse((ErrorResponse)portletResponse);
+ }
+ else
+ {
+ throw new Exception("Unexpected response type [" + portletResponse + "]. Expected an UpdateNavigationResponse" +
+ ", a HTTPRedirectionResponse or an ErrorResponse.");
+ }
+ }
+
+
+ private void handleRedirectionResponse(HTTPRedirectionResponse redirectionResponse, HttpServletResponse response) throws IOException
+ {
+ String redirectionURL = redirectionResponse.getLocation();
+ response.sendRedirect(redirectionURL);
+ }
+
+ private void handleUpdateNavigationalStateResponse(UpdateNavigationalStateResponse navStateResponse, UIPortlet<S, C> uiPortlet, PortalRequestContext prcontext) throws Exception
+ {
/*
* Update the portlet window state according to the action output
* information
@@ -228,6 +241,11 @@
}
}
+
+ private void handleErrorResponse(ErrorResponse response) throws Exception
+ {
+ throw (Exception)response.getCause();
+ }
}
/**
14 years, 9 months
gatein SVN: r2039 - components/pc/trunk/controller/src/main/java/org/gatein/pc/controller/impl.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-03-08 12:37:50 -0500 (Mon, 08 Mar 2010)
New Revision: 2039
Modified:
components/pc/trunk/controller/src/main/java/org/gatein/pc/controller/impl/ControllerRequestParameterMapFactory.java
Log:
- Added comment to use polymorphism now that it's available. Need to check parameter handling with respect to cacheability first though.
Modified: components/pc/trunk/controller/src/main/java/org/gatein/pc/controller/impl/ControllerRequestParameterMapFactory.java
===================================================================
--- components/pc/trunk/controller/src/main/java/org/gatein/pc/controller/impl/ControllerRequestParameterMapFactory.java 2010-03-08 16:05:36 UTC (rev 2038)
+++ components/pc/trunk/controller/src/main/java/org/gatein/pc/controller/impl/ControllerRequestParameterMapFactory.java 2010-03-08 17:37:50 UTC (rev 2039)
@@ -1,25 +1,25 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.gatein.pc.controller.impl;
import org.gatein.common.io.IOTools;
@@ -55,6 +55,8 @@
public Map<String, String> encode(PortletPageNavigationalState pageNS, String windowId, ContainerURL containerURL)
{
+ // todo: optimize by removing redundant calls based on the fact that ContainerURL has mode, window state and NS now
+
Map<String, String> parameters = new HashMap<String, String>();
//
14 years, 9 months
gatein SVN: r2038 - components/pc/trunk/api/src/main/java/org/gatein/pc/api.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-03-08 11:05:36 -0500 (Mon, 08 Mar 2010)
New Revision: 2038
Modified:
components/pc/trunk/api/src/main/java/org/gatein/pc/api/ActionURL.java
components/pc/trunk/api/src/main/java/org/gatein/pc/api/ContainerURL.java
components/pc/trunk/api/src/main/java/org/gatein/pc/api/PortletURL.java
components/pc/trunk/api/src/main/java/org/gatein/pc/api/RenderURL.java
components/pc/trunk/api/src/main/java/org/gatein/pc/api/ResourceURL.java
Log:
- Moved common methods to ContainerURL. Polymorphism is good!
Modified: components/pc/trunk/api/src/main/java/org/gatein/pc/api/ActionURL.java
===================================================================
--- components/pc/trunk/api/src/main/java/org/gatein/pc/api/ActionURL.java 2010-03-08 16:03:06 UTC (rev 2037)
+++ components/pc/trunk/api/src/main/java/org/gatein/pc/api/ActionURL.java 2010-03-08 16:05:36 UTC (rev 2038)
@@ -1,30 +1,27 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.gatein.pc.api;
-import org.gatein.pc.api.PortletURL;
-import org.gatein.pc.api.StateString;
-
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 5448 $
@@ -37,11 +34,4 @@
* @return the interaction state
*/
StateString getInteractionState();
-
- /**
- * Return the navigational state that may be null.
- *
- * @return the navigational state
- */
- StateString getNavigationalState();
}
Modified: components/pc/trunk/api/src/main/java/org/gatein/pc/api/ContainerURL.java
===================================================================
--- components/pc/trunk/api/src/main/java/org/gatein/pc/api/ContainerURL.java 2010-03-08 16:03:06 UTC (rev 2037)
+++ components/pc/trunk/api/src/main/java/org/gatein/pc/api/ContainerURL.java 2010-03-08 16:05:36 UTC (rev 2038)
@@ -1,25 +1,25 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.gatein.pc.api;
/**
@@ -28,4 +28,24 @@
*/
public interface ContainerURL
{
+ /**
+ * Returns the mode that may be null.
+ *
+ * @return the mode
+ */
+ Mode getMode();
+
+ /**
+ * Returns the window state that may be null.
+ *
+ * @return the window state
+ */
+ WindowState getWindowState();
+
+ /**
+ * Return the navigational state that may be null.
+ *
+ * @return the navigational state
+ */
+ StateString getNavigationalState();
}
Modified: components/pc/trunk/api/src/main/java/org/gatein/pc/api/PortletURL.java
===================================================================
--- components/pc/trunk/api/src/main/java/org/gatein/pc/api/PortletURL.java 2010-03-08 16:03:06 UTC (rev 2037)
+++ components/pc/trunk/api/src/main/java/org/gatein/pc/api/PortletURL.java 2010-03-08 16:05:36 UTC (rev 2038)
@@ -1,46 +1,31 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.gatein.pc.api;
-import org.gatein.pc.api.ContainerURL;
-
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 5448 $
*/
public interface PortletURL extends ContainerURL
{
- /**
- * Returns the mode that may be null.
- *
- * @return the mode
- */
- org.gatein.pc.api.Mode getMode();
-
- /**
- * Returns the window state that may be null.
- *
- * @return the window state
- */
- org.gatein.pc.api.WindowState getWindowState();
}
Modified: components/pc/trunk/api/src/main/java/org/gatein/pc/api/RenderURL.java
===================================================================
--- components/pc/trunk/api/src/main/java/org/gatein/pc/api/RenderURL.java 2010-03-08 16:03:06 UTC (rev 2037)
+++ components/pc/trunk/api/src/main/java/org/gatein/pc/api/RenderURL.java 2010-03-08 16:05:36 UTC (rev 2038)
@@ -1,25 +1,25 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.gatein.pc.api;
import java.util.Map;
@@ -31,13 +31,6 @@
public interface RenderURL extends PortletURL
{
/**
- * Return the navigational state that may be null.
- *
- * @return the navigational state
- */
- StateString getNavigationalState();
-
- /**
* Returns the public navigational state changes.
*
* @return the public navigational state changes
Modified: components/pc/trunk/api/src/main/java/org/gatein/pc/api/ResourceURL.java
===================================================================
--- components/pc/trunk/api/src/main/java/org/gatein/pc/api/ResourceURL.java 2010-03-08 16:03:06 UTC (rev 2037)
+++ components/pc/trunk/api/src/main/java/org/gatein/pc/api/ResourceURL.java 2010-03-08 16:05:36 UTC (rev 2038)
@@ -1,31 +1,28 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.gatein.pc.api;
import org.gatein.pc.api.cache.CacheLevel;
-import org.gatein.pc.api.ContainerURL;
-import org.gatein.pc.api.Mode;
-import org.gatein.pc.api.WindowState;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -54,25 +51,4 @@
* @return the resource cacheability
*/
CacheLevel getCacheability();
-
- /**
- * Return the navigational state that may be null.
- *
- * @return the navigational state
- */
- StateString getNavigationalState();
-
- /**
- * Returns the mode that may be null.
- *
- * @return the mode
- */
- Mode getMode();
-
- /**
- * Returns the window state that may be null.
- *
- * @return the window state
- */
- WindowState getWindowState();
}
14 years, 9 months
gatein SVN: r2037 - components/pc/trunk/samples/src/main/artifacts/remotecontroller-portlet-war/WEB-INF.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-03-08 11:03:06 -0500 (Mon, 08 Mar 2010)
New Revision: 2037
Modified:
components/pc/trunk/samples/src/main/artifacts/remotecontroller-portlet-war/WEB-INF/portlet.xml
Log:
- Marked Remote Controller portlets as remotable.
Modified: components/pc/trunk/samples/src/main/artifacts/remotecontroller-portlet-war/WEB-INF/portlet.xml
===================================================================
--- components/pc/trunk/samples/src/main/artifacts/remotecontroller-portlet-war/WEB-INF/portlet.xml 2010-03-08 13:47:58 UTC (rev 2036)
+++ components/pc/trunk/samples/src/main/artifacts/remotecontroller-portlet-war/WEB-INF/portlet.xml 2010-03-08 16:03:06 UTC (rev 2037)
@@ -1,26 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ JBoss, a division of Red Hat ~
- ~ Copyright 2008, Red Hat Middleware, LLC, and individual ~
- ~ contributors as indicated by the @authors tag. See the ~
- ~ copyright.txt in the distribution for a full listing of ~
- ~ individual contributors. ~
- ~ ~
- ~ This is free software; you can redistribute it and/or modify it ~
- ~ under the terms of the GNU Lesser General Public License as ~
- ~ published by the Free Software Foundation; either version 2.1 of ~
- ~ the License, or (at your option) any later version. ~
- ~ ~
- ~ This software is distributed in the hope that it will be useful, ~
- ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
- ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
- ~ Lesser General Public License for more details. ~
- ~ ~
- ~ You should have received a copy of the GNU Lesser General Public ~
- ~ License along with this software; if not, write to the Free ~
- ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
- ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<!--
+ ~ JBoss, a division of Red Hat
+ ~ Copyright 2010, Red Hat Middleware, LLC, and individual
+ ~ contributors as indicated by the @authors tag. See the
+ ~ copyright.txt in the distribution for a full listing of
+ ~ individual contributors.
+ ~
+ ~ This is free software; you can redistribute it and/or modify it
+ ~ under the terms of the GNU Lesser General Public License as
+ ~ published by the Free Software Foundation; either version 2.1 of
+ ~ the License, or (at your option) any later version.
+ ~
+ ~ This software is distributed in the hope that it will be useful,
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ ~ Lesser General Public License for more details.
+ ~
+ ~ You should have received a copy of the GNU Lesser General Public
+ ~ License along with this software; if not, write to the Free
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
@@ -57,5 +57,9 @@
<name>javax.portlet.renderHeaders</name>
<value>true</value>
</container-runtime-option>
+ <container-runtime-option>
+ <name>org.gatein.pc.remotable</name>
+ <value>true</value>
+ </container-runtime-option>
</portlet-app>
14 years, 9 months