gatein SVN: r3797 - portal/trunk/testsuite/testdefinitions.
by do-not-reply@jboss.org
Author: hangnguyen
Date: 2010-08-11 00:53:00 -0400 (Wed, 11 Aug 2010)
New Revision: 3797
Added:
portal/trunk/testsuite/testdefinitions/eXo_SniffTest_GateIn_3.1.0_TestDefinition.ods.ods
Log:
TestVN-1020 : Update Sniff tests
Added: portal/trunk/testsuite/testdefinitions/eXo_SniffTest_GateIn_3.1.0_TestDefinition.ods.ods
===================================================================
(Binary files differ)
Property changes on: portal/trunk/testsuite/testdefinitions/eXo_SniffTest_GateIn_3.1.0_TestDefinition.ods.ods
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
13 years, 10 months
gatein SVN: r3796 - portal/branches/branched-r3776/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component.
by do-not-reply@jboss.org
Author: hoang_to
Date: 2010-08-11 00:48:45 -0400 (Wed, 11 Aug 2010)
New Revision: 3796
Modified:
portal/branches/branched-r3776/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIPortletManagement.java
Log:
Apply patch for GTNPORTAL-1330
Modified: portal/branches/branched-r3776/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIPortletManagement.java
===================================================================
--- portal/branches/branched-r3776/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIPortletManagement.java 2010-08-11 04:11:03 UTC (rev 3795)
+++ portal/branches/branched-r3776/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIPortletManagement.java 2010-08-11 04:48:45 UTC (rev 3796)
@@ -313,17 +313,38 @@
public String getDisplayName()
{
- return getMetaValue(MetaInfo.DISPLAY_NAME, name_);
+ try
+ {
+ return getMetaValue(MetaInfo.DISPLAY_NAME, name_);
+ }
+ catch (Exception ex)
+ {
+ return "COULD NOT GET DISPLAY NAME OF THE PORTLET";
+ }
}
public String getDescription()
{
- return getMetaValue(MetaInfo.DESCRIPTION, name_);
+ try
+ {
+ return getMetaValue(MetaInfo.DESCRIPTION, name_);
+ }
+ catch (Exception ex)
+ {
+ return "COULD NOT GET DESCRIPTION OF THE PORTLET";
+ }
}
public PreferencesInfo getPortletPreferences()
{
- return portletInfo_.getPreferences();
+ try
+ {
+ return portletInfo_.getPreferences();
+ }
+ catch (Exception ex)
+ {
+ return null;
+ }
}
private String getMetaValue(String metaKey, String defaultValue)
13 years, 10 months
gatein SVN: r3795 - portal/branches/branched-r3776/webui/core/src/main/java/org/exoplatform/webui/form/validator.
by do-not-reply@jboss.org
Author: hoang_to
Date: 2010-08-11 00:11:03 -0400 (Wed, 11 Aug 2010)
New Revision: 3795
Modified:
portal/branches/branched-r3776/webui/core/src/main/java/org/exoplatform/webui/form/validator/DateTimeValidator.java
Log:
Apply patch for GTNPORTAL-1305
Modified: portal/branches/branched-r3776/webui/core/src/main/java/org/exoplatform/webui/form/validator/DateTimeValidator.java
===================================================================
--- portal/branches/branched-r3776/webui/core/src/main/java/org/exoplatform/webui/form/validator/DateTimeValidator.java 2010-08-11 01:19:02 UTC (rev 3794)
+++ portal/branches/branched-r3776/webui/core/src/main/java/org/exoplatform/webui/form/validator/DateTimeValidator.java 2010-08-11 04:11:03 UTC (rev 3795)
@@ -73,17 +73,16 @@
{
// Specify whether or not date/time parsing is to be lenient.
sdf.setLenient(false);
- Date stDate = sdf.parse(s);
- s = stFormat.format(stDate);
+ sdf.parse(s);
}
catch (Exception e)
{
- throw new MessageException(new ApplicationMessage("DateTimeValidator.msg.Invalid-input", args));
+ throw new MessageException(new ApplicationMessage("DateTimeValidator.msg.Invalid-input", args, ApplicationMessage.WARNING));
}
if (s.matches(DATETIME_REGEX) && isValidDateTime(s))
return;
- throw new MessageException(new ApplicationMessage("DateTimeValidator.msg.Invalid-input", args));
+ throw new MessageException(new ApplicationMessage("DateTimeValidator.msg.Invalid-input", args, ApplicationMessage.WARNING));
}
private boolean isValidDateTime(String dateTime)
13 years, 10 months
gatein SVN: r3794 - in components/wsrp/trunk: consumer/src/test/java/org/gatein/wsrp/test/support and 10 other directories.
by do-not-reply@jboss.org
Author: mwringe
Date: 2010-08-10 21:19:02 -0400 (Tue, 10 Aug 2010)
New Revision: 3794
Added:
components/wsrp/trunk/wsrp-producer-war/src/test/assembly/test-portletstate-portlet.xml
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/portlet/StatePortlet.java
components/wsrp/trunk/wsrp-producer-war/src/test/test-portlets/test-portletstate-portlet-war/
Modified:
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/WSRPConsumerImpl.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockWSRPConsumer.java
components/wsrp/trunk/producer/src/main/java/org/gatein/exports/ExportManager.java
components/wsrp/trunk/producer/src/main/java/org/gatein/exports/data/ExportData.java
components/wsrp/trunk/producer/src/main/java/org/gatein/exports/data/ExportPortletData.java
components/wsrp/trunk/producer/src/main/java/org/gatein/exports/impl/ExportManagerImpl.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/PortletManagementHandler.java
components/wsrp/trunk/producer/src/test/java/org/gatein/export/ExportTestCase.java
components/wsrp/trunk/wsrp-producer-war/pom.xml
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v2/PortletManagementTestCase.java
Log:
GTNWSRP-55: fixed issue with importing/exporting with states. Updated tests.
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/WSRPConsumerImpl.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/WSRPConsumerImpl.java 2010-08-10 15:35:03 UTC (rev 3793)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/WSRPConsumerImpl.java 2010-08-11 01:19:02 UTC (rev 3794)
@@ -23,6 +23,7 @@
package org.gatein.wsrp.consumer;
+import org.gatein.common.NotYetImplemented;
import org.gatein.common.util.ParameterValidation;
import org.gatein.pc.api.InvokerUnavailableException;
import org.gatein.pc.api.NoSuchPortletException;
@@ -390,8 +391,20 @@
}
}
+ public PortletContext exportPortletContext(PortletStateType stateType, PortletContext originalPortletContext)
+ throws PortletInvokerException
+ {
+ throw new NotYetImplemented();
+ }
+
+ public PortletContext importPortletContext(PortletStateType stateType, PortletContext originalPortletContext)
+ throws PortletInvokerException
+ {
+ throw new NotYetImplemented();
+ }
+
// Accessors ********************************************************************************************************
-
+
public String getProducerId()
{
return producerInfo.getId();
Modified: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockWSRPConsumer.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockWSRPConsumer.java 2010-08-10 15:35:03 UTC (rev 3793)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/test/support/MockWSRPConsumer.java 2010-08-11 01:19:02 UTC (rev 3794)
@@ -23,12 +23,14 @@
package org.gatein.wsrp.test.support;
+import org.gatein.common.NotYetImplemented;
import org.gatein.pc.api.Portlet;
import org.gatein.pc.api.PortletContext;
import org.gatein.pc.api.PortletInvokerException;
import org.gatein.pc.api.PortletStateType;
import org.gatein.pc.api.invocation.PortletInvocation;
import org.gatein.pc.api.invocation.response.PortletInvocationResponse;
+import org.gatein.pc.api.state.DestroyCloneFailure;
import org.gatein.pc.api.state.PropertyChange;
import org.gatein.pc.api.state.PropertyMap;
import org.gatein.wsrp.WSRPConsumer;
@@ -167,4 +169,16 @@
public void onSessionEvent(SessionEvent event)
{
}
+
+ public PortletContext exportPortletContext(PortletStateType stateType, PortletContext originalPortletContext)
+ throws PortletInvokerException
+ {
+ throw new NotYetImplemented();
+ }
+
+ public PortletContext importPortletContext(PortletStateType stateType, PortletContext originalPortletContext)
+ throws PortletInvokerException
+ {
+ throw new NotYetImplemented();
+ }
}
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/exports/ExportManager.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/exports/ExportManager.java 2010-08-10 15:35:03 UTC (rev 3793)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/exports/ExportManager.java 2010-08-11 01:19:02 UTC (rev 3794)
@@ -22,6 +22,7 @@
******************************************************************************/
package org.gatein.exports;
+import java.io.IOException;
import java.io.UnsupportedEncodingException;
import org.gatein.exports.data.ExportContext;
@@ -50,9 +51,9 @@
ExportPortletData createExportPortletData(ExportContext exportContext, Lifetime lifetime, byte[] bytes) throws OperationFailed;
- byte[] encodeExportPortletData(ExportContext exportContextData, ExportPortletData exportPortletData) throws UnsupportedEncodingException;
+ byte[] encodeExportPortletData(ExportContext exportContextData, ExportPortletData exportPortletData) throws UnsupportedEncodingException, IOException;
- byte[] encodeExportContextData (ExportContext exportContextData) throws UnsupportedEncodingException;
+ byte[] encodeExportContextData (ExportContext exportContextData) throws UnsupportedEncodingException, IOException;
Lifetime setExportLifetime(ExportContext exportContext, Lifetime lifetime) throws OperationFailed, OperationNotSupported;
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/exports/data/ExportData.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/exports/data/ExportData.java 2010-08-10 15:35:03 UTC (rev 3793)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/exports/data/ExportData.java 2010-08-11 01:19:02 UTC (rev 3794)
@@ -22,10 +22,13 @@
******************************************************************************/
package org.gatein.exports.data;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
import java.io.UnsupportedEncodingException;
-import org.gatein.common.NotYetImplemented;
-
/**
* @author <a href="mailto:mwringe@redhat.com">Matt Wringe</a>
* @version $Revision$
@@ -36,7 +39,7 @@
public abstract double getVersion();
public abstract String getType();
- protected abstract byte[] internalEncodeAsBytes() throws UnsupportedEncodingException;
+ protected abstract byte[] internalEncodeAsBytes() throws UnsupportedEncodingException, IOException;
//The encoding used to create the byte array
@@ -44,33 +47,37 @@
protected static final String SEPARATOR = "_@_";
- public byte[] encodeAsBytes() throws UnsupportedEncodingException
+ public byte[] encodeAsBytes() throws IOException
{
byte[] internalBytes = internalEncodeAsBytes();
- String token = this.getType() + SEPARATOR + this.getVersion() + SEPARATOR;
- String dataString = new String(internalBytes, ENCODING);
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ ObjectOutputStream oos = new ObjectOutputStream(baos);
- return (token + dataString).getBytes(ENCODING);
+ oos.writeUTF(this.getType());
+ oos.writeDouble(this.getVersion());
+
+ if (internalBytes != null)
+ {
+ oos.write(internalBytes);
+ }
+
+ oos.close();
+
+ return baos.toByteArray();
}
- public static double getVersion(byte[] bytes) throws UnsupportedEncodingException
+ public static double getVersion(byte[] bytes) throws IOException
{
if (bytes != null && bytes.length > 0)
{
- String dataString = new String(bytes, ENCODING);
- String[] split = dataString.split(SEPARATOR, 3);
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
+ ObjectInputStream ois = new ObjectInputStream(bais);
- if (split.length >= 2)
- {
- double version = Double.parseDouble(split[1]);
- return version;
- }
- else
- {
- //if a version could not be found, return -1
- return -1;
- }
+ String type = ois.readUTF();
+ Double version = ois.readDouble();
+
+ return version.doubleValue();
}
else
{
@@ -78,21 +85,14 @@
}
}
- public static String getType(byte[] bytes) throws UnsupportedEncodingException
+ public static String getType(byte[] bytes) throws IOException
{
if (bytes != null && bytes.length > 0)
{
- String dataString = new String(bytes, ENCODING);
- String[] split = dataString.split(SEPARATOR, 2);
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
+ ObjectInputStream ois = new ObjectInputStream(bais);
- if (split.length >= 2)
- {
- return split[0];
- }
- else
- {
- return null;
- }
+ return ois.readUTF();
}
else
{
@@ -100,29 +100,28 @@
}
}
- public static byte[] getInternalBytes(byte[] bytes) throws UnsupportedEncodingException
+ public static byte[] getInternalBytes(byte[] bytes) throws IOException
{
if (bytes != null && bytes.length > 0)
{
- String dataString = new String(bytes, ENCODING);
- String[] split = dataString.split(SEPARATOR, 3);
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
+ ObjectInputStream ois = new ObjectInputStream(bais);
- if (split.length >= 3)
+ String type = ois.readUTF();
+ Double version = ois.readDouble();
+
+ byte[] internalBytes = null;
+ if (ois.available() > 0)
{
- String internalString = split[2];
- return internalString.getBytes(ENCODING);
+ internalBytes = new byte[ois.available()];
+ ois.readFully(internalBytes);
}
- else
- {
- //if we could not find the internal bytes, return null
- return null;
- }
+ return internalBytes;
}
else
{
return null;
}
}
-
}
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/exports/data/ExportPortletData.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/exports/data/ExportPortletData.java 2010-08-10 15:35:03 UTC (rev 3793)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/exports/data/ExportPortletData.java 2010-08-11 01:19:02 UTC (rev 3794)
@@ -22,12 +22,12 @@
******************************************************************************/
package org.gatein.exports.data;
-import java.io.UnsupportedEncodingException;
-import java.util.Map;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
-import org.gatein.pc.api.ParametersStateString;
-import org.gatein.pc.api.StateString;
-
/**
* @author <a href="mailto:mwringe@redhat.com">Matt Wringe</a>
* @version $Revision$
@@ -71,51 +71,46 @@
return VERSION;
}
- public static ExportPortletData create(byte[] bytes) throws UnsupportedEncodingException
+ public static ExportPortletData create(byte[] bytes) throws IOException
{
- //why isn't there a way for a ParameterStateString to directly create itself from the string?
- Map<String, String[]> map = StateString.decodeOpaqueValue(new String(bytes, ENCODING));
-
+ ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
+ ObjectInputStream ois = new ObjectInputStream(bais);
+
String portletHandle;
byte[] portletState;
-
- String[] portletHandles = map.get(PORTLETHANDLEKEY);
- if (portletHandles != null && portletHandles.length > 0)
+
+ portletHandle = ois.readUTF();
+
+ if (ois.available() > 0)
{
- portletHandle = portletHandles[0];
+ portletState = new byte[ois.available()];
+ ois.readFully(portletState);
}
else
{
- return null; //TODO: should probably throw an error here about not getting a proper value
- }
-
- String[] portletStates = map.get(PORTLETSTATEKEY);
- if (portletStates != null && portletStates.length > 0)
- {
- portletState = portletStates[0].getBytes(ENCODING);
- }
- else
- {
portletState = null;
}
+
+ ois.close();
return new ExportPortletData(portletHandle, portletState);
}
- protected byte[] internalEncodeAsBytes() throws UnsupportedEncodingException
+ protected byte[] internalEncodeAsBytes() throws IOException
{
- ParametersStateString parameterStateString = ParametersStateString.create();
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ ObjectOutputStream oos = new ObjectOutputStream(baos);
+
+ oos.writeUTF(portletHandle);
+
if (portletState != null)
{
- //TODO: if might be better to use something other than a statestring that can handle byte[] directly
- String state = new String(portletState, ENCODING);
- parameterStateString.setValue(PORTLETSTATEKEY, state);
+ oos.write(portletState);
}
-
- parameterStateString.setValue(PORTLETHANDLEKEY, portletHandle);
- String stateString = parameterStateString.getStringValue();
- return stateString.getBytes(ENCODING);
+ oos.close();
+
+ return baos.toByteArray();
}
}
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/exports/impl/ExportManagerImpl.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/exports/impl/ExportManagerImpl.java 2010-08-10 15:35:03 UTC (rev 3793)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/exports/impl/ExportManagerImpl.java 2010-08-11 01:19:02 UTC (rev 3794)
@@ -22,6 +22,7 @@
******************************************************************************/
package org.gatein.exports.impl;
+import java.io.IOException;
import java.io.UnsupportedEncodingException;
import org.gatein.common.NotYetImplemented;
@@ -97,6 +98,10 @@
{
throw WSRPExceptionFactory.createWSException(OperationFailed.class, "Could not decode the byte array.", e);
}
+ catch (IOException e)
+ {
+ throw WSRPExceptionFactory.createWSException(OperationFailed.class, "Could not decode the byte array.", e);
+ }
}
public ExportPortletData createExportPortletData(ExportContext exportContextData, String portletHandle,
@@ -125,9 +130,13 @@
{
throw WSRPExceptionFactory.createWSException(OperationFailed.class, "Could not decode the byte array.", e);
}
+ catch (IOException e)
+ {
+ throw WSRPExceptionFactory.createWSException(OperationFailed.class, "Could not decode the byte array.", e);
+ }
}
- public byte[] encodeExportPortletData(ExportContext exportContextData, ExportPortletData exportPortletData) throws UnsupportedEncodingException
+ public byte[] encodeExportPortletData(ExportContext exportContextData, ExportPortletData exportPortletData) throws IOException
{
if (exportContextData.isExportByValue())
{
@@ -139,7 +148,7 @@
}
}
- public byte[] encodeExportContextData(ExportContext exportContextData) throws UnsupportedEncodingException
+ public byte[] encodeExportContextData(ExportContext exportContextData) throws IOException
{
if (exportContextData.isExportByValue())
{
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/PortletManagementHandler.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/PortletManagementHandler.java 2010-08-10 15:35:03 UTC (rev 3793)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/PortletManagementHandler.java 2010-08-11 01:19:02 UTC (rev 3794)
@@ -524,7 +524,16 @@
if (portletHandle != null)
{
org.gatein.pc.api.PortletContext portalPC = WSRPUtils.convertToPortalPortletContext(portletContext);
- if (producer.getPortletInvoker().getPortlet(portalPC) == null)
+
+ producer.getPortletInvoker().getPortlet(portalPC);
+
+ org.gatein.pc.api.PortletContext exportedPortalPC = producer.getPortletInvoker().exportPortletContext(PortletStateType.OPAQUE, portalPC);
+
+ PortletContext exportedPortalContext = WSRPUtils.convertToWSRPPortletContext(exportedPortalPC);
+ portletHandle = exportedPortalContext.getPortletHandle();
+ portletState = exportedPortalContext.getPortletState();
+
+ if (exportedPortalPC == null)
{
WSRP2ExceptionFactory.throwWSException(InvalidHandle.class, "Could not find a portlet with handle " + portletHandle + " in the producer", null);
}
@@ -642,7 +651,7 @@
PortletContext pc = WSRPTypeFactory.createPortletContext(portletHandle, portletState);
org.gatein.pc.api.PortletContext pcPortletContext = WSRPUtils.convertToPortalPortletContext(pc);
- org.gatein.pc.api.PortletContext cpc = producer.getPortletInvoker().createClone(PortletStateType.OPAQUE, pcPortletContext);
+ org.gatein.pc.api.PortletContext cpc = producer.getPortletInvoker().importPortletContext(PortletStateType.OPAQUE, pcPortletContext);
PortletContext wpc = WSRPUtils.convertToWSRPPortletContext(cpc);
ImportedPortlet importedPortlet = WSRPTypeFactory.createImportedPortlet(importPortlet.getImportID(), wpc);
Modified: components/wsrp/trunk/producer/src/test/java/org/gatein/export/ExportTestCase.java
===================================================================
--- components/wsrp/trunk/producer/src/test/java/org/gatein/export/ExportTestCase.java 2010-08-10 15:35:03 UTC (rev 3793)
+++ components/wsrp/trunk/producer/src/test/java/org/gatein/export/ExportTestCase.java 2010-08-11 01:19:02 UTC (rev 3794)
@@ -22,6 +22,7 @@
******************************************************************************/
package org.gatein.export;
+import java.io.IOException;
import java.io.UnsupportedEncodingException;
import org.gatein.exports.data.ExportData;
@@ -36,7 +37,7 @@
*/
public class ExportTestCase extends TestCase
{
- public void testTransformationByValueStateless() throws UnsupportedEncodingException
+ public void testTransformationByValueStateless() throws IOException
{
String portletId = "TestPortletID_123";
double version = 1.0;
@@ -48,8 +49,6 @@
byte[] bytes = exportPortletData.encodeAsBytes();
- String dataAsString = new String(bytes, "UTF-8");
-
byte[] internalBytes = ExportData.getInternalBytes(bytes);
ExportPortletData portletDataFromBytes = ExportPortletData.create(internalBytes);
assertEquals(version, portletDataFromBytes.getVersion());
@@ -59,11 +58,11 @@
assertNull(portletDataFromBytes.getPortletState());
}
- public void testTransformationByValueStatefull() throws UnsupportedEncodingException
+ public void testTransformationByValueStatefull() throws IOException
{
String portletId = "TestPortletID_123";
double version = 1.0;
- byte[] state = new byte[]{0, 1, 2, 3, 'a', 'b', 'c'};
+ byte[] state = new byte[]{-66, 0, 1, 2, 3, 'a', 'b', 'c'};
ExportPortletData exportPortletData = new ExportPortletData(portletId, state);
assertEquals(version, exportPortletData.getVersion());
@@ -73,18 +72,17 @@
byte[] bytes = exportPortletData.encodeAsBytes();
- String dataAsString = new String(bytes, "UTF-8");
-
byte[] internalBytes = ExportData.getInternalBytes(bytes);
ExportPortletData portletDataFromBytes = ExportPortletData.create(internalBytes);
assertEquals(version, portletDataFromBytes.getVersion());
assertEquals(portletId, portletDataFromBytes.getPortletHandle());
assertEquals(version, portletDataFromBytes.getVersion());
+ assertNotNull(portletDataFromBytes.getPortletState());
+ assertEquals(state.length, portletDataFromBytes.getPortletState().length);
ExtendedAssert.assertEquals(state, portletDataFromBytes.getPortletState());
}
-
/**
* ADD MORE TESTS
* - decode from a stored byte array
Modified: components/wsrp/trunk/wsrp-producer-war/pom.xml
===================================================================
--- components/wsrp/trunk/wsrp-producer-war/pom.xml 2010-08-10 15:35:03 UTC (rev 3793)
+++ components/wsrp/trunk/wsrp-producer-war/pom.xml 2010-08-11 01:19:02 UTC (rev 3794)
@@ -175,6 +175,7 @@
<descriptor>src/test/assembly/test-resource-portlet.xml</descriptor>
<descriptor>src/test/assembly/test-resourcenoencodeurl-portlet.xml</descriptor>
<descriptor>src/test/assembly/test-applicationscope-portlet.xml</descriptor>
+ <descriptor>src/test/assembly/test-portletstate-portlet.xml</descriptor>
</descriptors>
</configuration>
<executions>
Added: components/wsrp/trunk/wsrp-producer-war/src/test/assembly/test-portletstate-portlet.xml
===================================================================
--- components/wsrp/trunk/wsrp-producer-war/src/test/assembly/test-portletstate-portlet.xml (rev 0)
+++ components/wsrp/trunk/wsrp-producer-war/src/test/assembly/test-portletstate-portlet.xml 2010-08-11 01:19:02 UTC (rev 3794)
@@ -0,0 +1,25 @@
+<assembly>
+ <id>portletstate-portlet</id>
+ <formats>
+ <format>war</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+
+ <fileSets>
+ <!-- Test Classes -->
+ <fileSet>
+ <directory>target/test-classes</directory>
+ <outputDirectory>WEB-INF/classes</outputDirectory>
+ <includes>
+ <include>org/gatein/wsrp/portlet/StatePortlet.class</include>
+ </includes>
+ </fileSet>
+ <!-- Fileset for the sar strucuture -->
+ <fileSet>
+ <directory>src/test/test-portlets/test-portletstate-portlet-war</directory>
+ <outputDirectory></outputDirectory>
+ </fileSet>
+ </fileSets>
+
+</assembly>
+
Added: components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/portlet/StatePortlet.java
===================================================================
--- components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/portlet/StatePortlet.java (rev 0)
+++ components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/portlet/StatePortlet.java 2010-08-11 01:19:02 UTC (rev 3794)
@@ -0,0 +1,91 @@
+/******************************************************************************
+ * 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.portlet;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.GenericPortlet;
+import javax.portlet.PortletException;
+import javax.portlet.PortletPreferences;
+import javax.portlet.PortletSecurityException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * @author <a href="mailto:mwringe@redhat.com">Matt Wringe</a>
+ * @version $Revision$
+ */
+public class StatePortlet extends GenericPortlet
+{
+ private static final String COUNT = "count";
+
+ public void processAction(ActionRequest request, ActionResponse response) throws PortletException, PortletSecurityException, IOException
+ {
+ System.out.println("PROCESSACTION");
+ String value = request.getParameter("value");
+ if (value == null)
+ {
+ value = "default";
+ }
+
+ PortletPreferences pp = request.getPreferences();
+ pp.setValue("name", value);
+ pp.store();
+ }
+
+ protected void doView(RenderRequest req, RenderResponse resp) throws PortletException, PortletSecurityException, IOException
+ {
+ System.out.println("DOVIEW");
+ resp.setContentType("text/html");
+ PortletPreferences pp = req.getPreferences();
+ String value = pp.getValue("name", "default");
+ resp.getWriter().write(value);
+ }
+
+
+// protected void doView(RenderRequest req, RenderResponse resp) throws PortletException, PortletSecurityException, IOException
+// {
+// resp.setContentType("text/html");
+// PrintWriter writer = resp.getWriter();
+//
+// PortletPreferences pp = req.getPreferences();
+// int count = 0;
+//
+// if (!pp.getValue(COUNT, "0").equals("0"))
+// {
+// count = Integer.parseInt(pp.getValue(COUNT, "0")) + 1;
+// }
+//
+// pp.setValue(COUNT, "" + count);
+// pp.store();
+//
+// writer.write("<p>count = " + count + "</p>");
+//
+// //
+// writer.close();
+// }
+}
+
Modified: components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v2/PortletManagementTestCase.java
===================================================================
--- components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v2/PortletManagementTestCase.java 2010-08-10 15:35:03 UTC (rev 3793)
+++ components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v2/PortletManagementTestCase.java 2010-08-11 01:19:02 UTC (rev 3794)
@@ -22,17 +22,30 @@
******************************************************************************/
package org.gatein.wsrp.protocol.v2;
+import java.io.IOException;
import java.io.UnsupportedEncodingException;
+import java.rmi.RemoteException;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.gatein.exports.ExportManager;
import org.gatein.exports.data.ExportContext;
+import org.gatein.exports.data.ExportData;
import org.gatein.exports.data.ExportPortletData;
import org.gatein.exports.impl.ExportManagerImpl;
+import org.gatein.pc.api.Portlet;
+import org.gatein.pc.api.PortletStateType;
+import org.gatein.pc.api.state.PropertyMap;
+import org.gatein.pc.portlet.state.SimplePropertyMap;
+import org.gatein.pc.portlet.state.producer.PortletState;
+import org.gatein.pc.portlet.state.producer.ProducerPortletInvoker;
import org.gatein.wsrp.WSRPTypeFactory;
+import org.gatein.wsrp.WSRPUtils;
import org.gatein.wsrp.producer.WSRPProducerBaseTest;
import org.gatein.wsrp.servlet.ServletAccess;
+import org.gatein.wsrp.spec.v2.WSRP2RewritingConstants;
import org.gatein.wsrp.test.ExtendedAssert;
import org.gatein.wsrp.test.support.MockHttpServletRequest;
import org.gatein.wsrp.test.support.MockHttpServletResponse;
@@ -44,6 +57,8 @@
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.oasis.wsrp.v2.AccessDenied;
+import org.oasis.wsrp.v2.BlockingInteractionResponse;
import org.oasis.wsrp.v2.ExportPortlets;
import org.oasis.wsrp.v2.ExportPortletsResponse;
import org.oasis.wsrp.v2.ExportedPortlet;
@@ -53,14 +68,30 @@
import org.oasis.wsrp.v2.ImportPortlets;
import org.oasis.wsrp.v2.ImportPortletsResponse;
import org.oasis.wsrp.v2.ImportedPortlet;
+import org.oasis.wsrp.v2.InconsistentParameters;
+import org.oasis.wsrp.v2.InvalidCookie;
+import org.oasis.wsrp.v2.InvalidHandle;
import org.oasis.wsrp.v2.InvalidRegistration;
+import org.oasis.wsrp.v2.InvalidSession;
+import org.oasis.wsrp.v2.InvalidUserCategory;
import org.oasis.wsrp.v2.Lifetime;
+import org.oasis.wsrp.v2.MarkupContext;
+import org.oasis.wsrp.v2.MarkupParams;
import org.oasis.wsrp.v2.MarkupResponse;
import org.oasis.wsrp.v2.MissingParameters;
+import org.oasis.wsrp.v2.ModifyRegistrationRequired;
+import org.oasis.wsrp.v2.NamedString;
import org.oasis.wsrp.v2.OperationFailed;
+import org.oasis.wsrp.v2.PerformBlockingInteraction;
import org.oasis.wsrp.v2.PortletContext;
import org.oasis.wsrp.v2.RegistrationContext;
import org.oasis.wsrp.v2.RegistrationData;
+import org.oasis.wsrp.v2.ResourceSuspended;
+import org.oasis.wsrp.v2.StateChange;
+import org.oasis.wsrp.v2.UnsupportedLocale;
+import org.oasis.wsrp.v2.UnsupportedMimeType;
+import org.oasis.wsrp.v2.UnsupportedMode;
+import org.oasis.wsrp.v2.UnsupportedWindowState;
import org.oasis.wsrp.v2.UserContext;
/**
@@ -71,7 +102,6 @@
public class PortletManagementTestCase extends NeedPortletHandleTest
{
private static final String TEST_BASIC_PORTLET_WAR = "test-markup-portlet.war";
-
public PortletManagementTestCase() throws Exception
{
@@ -111,7 +141,6 @@
/*TODO:
* - tests usercontexts (not sure exactly what needs to be tested for this)
- * - test portlet states
*/
@Test
@@ -220,7 +249,7 @@
try
{
ExportPortletsResponse response = producer.exportPortlets(exportPortlets);
- ExtendedAssert.fail("ImportPortlets should fail if registration is required and non is provided");
+ ExtendedAssert.fail("ExportPortlets should fail if registration is required and none is provided");
}
catch (InvalidRegistration e)
{
@@ -229,6 +258,32 @@
}
@Test
+ public void testExportBadRegistrationHandle() throws Exception
+ {
+ producer.getConfigurationService().getConfiguration().getRegistrationRequirements().setRegistrationRequired(true);
+
+ RegistrationContext registrationContext = WSRPTypeFactory.createRegistrationContext("foo123");
+
+ List<PortletContext> portletContexts = createPortletContextList(getDefaultHandle());
+
+ boolean exportByValueRequired = true;
+ Lifetime lifetime = null;
+ UserContext userContext = null;
+
+ ExportPortlets exportPortlets = WSRPTypeFactory.createExportPortlets(registrationContext, portletContexts, userContext, lifetime, exportByValueRequired);
+
+ try
+ {
+ ExportPortletsResponse response = producer.exportPortlets(exportPortlets);
+ ExtendedAssert.fail("ExportPortlets should fail if registration is required and an invalid registration handle is provided");
+ }
+ catch (InvalidRegistration e)
+ {
+ //expected
+ }
+ }
+
+ @Test
public void testExportRegistrationRequired() throws Exception
{
producer.getConfigurationService().getConfiguration().getRegistrationRequirements().setRegistrationRequired(true);
@@ -335,9 +390,7 @@
assertEquals(importID, portlet.getImportID());
PortletContext portletContext = portlet.getNewPortletContext();
- //check that we are getting a new portlet handle back and not the original one
- ExtendedAssert.assertNotSame(getDefaultHandle(), portletContext.getPortletHandle());
-
+
//check that the new portlet handle is valid and we can access the portlet
GetMarkup markup = createMarkupRequest(portletContext.getPortletHandle());
MarkupResponse markupResponse = producer.getMarkup(markup);
@@ -400,8 +453,6 @@
assertEquals(importID, portlet.getImportID());
PortletContext portletContext = portlet.getNewPortletContext();
- //check that we are getting a new portlet handle back and not the original one
- ExtendedAssert.assertNotSame(getDefaultHandle(), portletContext.getPortletHandle());
//check that the new portlet handle is valid and we can access the portlet
GetMarkup markup = createMarkupRequest(portletContext.getPortletHandle());
@@ -413,6 +464,38 @@
}
@Test
+ public void testImportBadRegistration() throws Exception
+ {
+ producer.getConfigurationService().getConfiguration().getRegistrationRequirements().setRegistrationRequired(true);
+
+ RegistrationContext registrationContext = WSRPTypeFactory.createRegistrationContext("FAkeREgistrationHAndle");
+
+ String importID = "foo";
+
+ Lifetime lifetime = null;
+ UserContext userContext = null;
+
+ List<String> portletList = new ArrayList<String>();
+ portletList.add(getDefaultHandle());
+ ExportContext exportContextData = new ExportContext();
+ byte[] importContext = exportContextData.encodeAsBytes();
+
+ ImportPortlet importPortlet = createSimpleImportPortlet(importID, getDefaultHandle());
+ List<ImportPortlet> importPortletsList = createImportPortletList(importPortlet);
+
+ ImportPortlets importPortlets = WSRPTypeFactory.createImportPortlets(registrationContext, importContext, importPortletsList, userContext, lifetime);
+ try
+ {
+ ImportPortletsResponse response = producer.importPortlets(importPortlets);
+ ExtendedAssert.fail("Should have failed when registration is required and an invalid registration handle is used.");
+ }
+ catch (InvalidRegistration e)
+ {
+ //expected
+ }
+ }
+
+ @Test
public void testImportNullImportContext() throws Exception
{
String importId = "importInvalidPortletContext";
@@ -581,8 +664,6 @@
assertEquals(importID, portlet.getImportID());
PortletContext portletContext = portlet.getNewPortletContext();
- //check that we are getting a new portlet handle back and not the original one
- ExtendedAssert.assertNotSame(getDefaultHandle(), portletContext.getPortletHandle());
//check that the new portlet handle is valid and we can access the portlet
GetMarkup markup = createMarkupRequest(portletContext.getPortletHandle());
@@ -590,9 +671,208 @@
assertNotNull(markupResponse.getMarkupContext());
assertEquals("<p>symbol unset stock value: value unset</p>", new String(markupResponse.getMarkupContext().getItemString()));
}
+
+ @Test
+ public void testExportWithState() throws Exception
+ {
+ undeploy(TEST_BASIC_PORTLET_WAR);
+ String sessionPortletArchive = "test-portletstate-portlet.war";
+ deploy(sessionPortletArchive);
+
+ try
+ {
+ String originalHandle = getHandleForCurrentlyDeployedArchive();
+
+ //check the session portlet to make sure its at the inital state
+ checkStatePortlet(originalHandle, "initial");
+
+ PortletContext portletContext = performBlockingInteractionOnSessionPortlet(originalHandle, "new value", StateChange.CLONE_BEFORE_WRITE);
+ //check that we have a new portlet context
+ ExtendedAssert.assertFalse(originalHandle.equals(portletContext.getPortletHandle()));
+
+ checkStatePortlet(portletContext.getPortletHandle(), "new value");
+
+ List<PortletContext> portletContexts = createPortletContextList(portletContext.getPortletHandle());
+ ExportPortlets exportPortlets = createSimpleExportPortlets(portletContexts);
+ ExportPortletsResponse response = producer.exportPortlets(exportPortlets);
+
+ ExtendedAssert.assertFalse(response.getExportedPortlet().isEmpty());
+
+ List<PortletContext> portletContextsFromExport = getPortletContext(response);
+
+ ExtendedAssert.assertNotNull(portletContextsFromExport.isEmpty());
+ ExtendedAssert.assertEquals(1,portletContexts.size());
+
+ PortletContext portletContextFromExport = portletContextsFromExport.get(0);
+ //we should be getting the handle of the stateless portlet
+ assertEquals(originalHandle, portletContextFromExport.getPortletHandle());
+ //assert that we have a portlet state returned
+ assertNotNull(portletContextFromExport.getPortletState());
+
+ //quick check that the imported portlet has the right state
+ ImportPortletsResponse importResponse = createImportPortletsResponse("foo", portletContextFromExport);
+ checkStatePortlet(importResponse.getImportedPortlets().get(0).getNewPortletContext().getPortletHandle(), "new value");
+
+ }
+ finally
+ {
+ undeploy(sessionPortletArchive);
+ }
+ }
- protected ImportPortlet createSimpleImportPortlet(String importId, String handle) throws UnsupportedEncodingException
+ //Tests the situation in which we have a stateful export from one server and importing into another
+ @Test
+ public void testImportWithState() throws Exception
{
+ undeploy(TEST_BASIC_PORTLET_WAR);
+ String sessionPortletArchive = "test-portletstate-portlet.war";
+ deploy(sessionPortletArchive);
+
+ try
+ {
+ String importStringValue = "import value";
+ byte[] portletState = createSessionByteValue(getHandleForCurrentlyDeployedArchive(), importStringValue);
+
+ String importID = "foo";
+
+ List<String> portletList = new ArrayList<String>();
+ portletList.add(getDefaultHandle());
+ byte[] importContext = new ExportContext().encodeAsBytes();
+
+ ExportPortletData exportPortletData = new ExportPortletData(getHandleForCurrentlyDeployedArchive(), portletState);
+ byte[] exportData = exportPortletData.encodeAsBytes();
+ ImportPortlet importPortlet = WSRPTypeFactory.createImportPortlet(importID, exportData);
+
+ List<ImportPortlet> importPortletsList = createImportPortletList(importPortlet);
+
+ ImportPortlets importPortlets = createSimpleImportPortlets(importContext, importPortletsList);
+ ImportPortletsResponse response = producer.importPortlets(importPortlets);
+
+ ImportedPortlet importedPortlet = response.getImportedPortlets().get(0);
+
+ //since its a stateful, the portlet handles shouldn't be the same
+ assertNotSame(getHandleForCurrentlyDeployedArchive(), importedPortlet.getNewPortletContext().getPortletHandle());
+ //the pc should be storing the state, so it shouldn't appear in the imported portlet context
+ assertNull(importedPortlet.getNewPortletContext().getPortletState());
+
+ checkStatePortlet(importedPortlet.getNewPortletContext().getPortletHandle(), importStringValue);
+
+ }
+ finally
+ {
+ undeploy(sessionPortletArchive);
+ }
+ }
+
+ protected ImportPortletsResponse createImportPortletsResponse(String importID, PortletContext portletContext) throws Exception
+ {
+ byte[] importContext = new ExportContext().encodeAsBytes();
+ ExportPortletData exportPortletData = new ExportPortletData(portletContext.getPortletHandle(), portletContext.getPortletState());
+ byte[] exportData = exportPortletData.encodeAsBytes();
+ ImportPortlet importPortlet = WSRPTypeFactory.createImportPortlet(importID, exportData);
+ List<ImportPortlet> importPortletsList = createImportPortletList(importPortlet);
+ ImportPortlets importPortlets = createSimpleImportPortlets(importContext, importPortletsList);
+ return producer.importPortlets(importPortlets);
+ }
+
+ protected byte[] createSessionByteValue(String portletHandle, String value) throws Exception
+ {
+ ProducerPortletInvoker ppinvoker = (ProducerPortletInvoker) producer.getPortletInvoker();
+ Map<String, List<String>> properties = new HashMap<String, List<String>>();
+ List<String> values = new ArrayList<String>();
+ values.add(value);
+ properties.put("name", values);
+
+ PropertyMap property = new SimplePropertyMap(properties);
+ PortletState sstate = new PortletState(portletHandle, property);
+ return ppinvoker.getStateConverter().marshall(PortletStateType.OPAQUE, sstate);
+ }
+
+ @Test
+ public void testExportWithoutSession() throws Exception
+ {
+ undeploy(TEST_BASIC_PORTLET_WAR);
+ String sessionPortletArchive = "test-portletstate-portlet.war";
+ deploy(sessionPortletArchive);
+
+ try
+ {
+ String originalHandle = getHandleForCurrentlyDeployedArchive();
+
+ //check the session portlet to make sure its at the inital state
+ checkStatePortlet(originalHandle, "initial");
+
+ //export the cloned portlet context we get from the performBlockingInteraction
+ List<PortletContext> portletContexts = createPortletContextList(originalHandle);
+ ExportPortlets exportPortlets = createSimpleExportPortlets(portletContexts);
+ ExportPortletsResponse response = producer.exportPortlets(exportPortlets);
+
+ ExtendedAssert.assertFalse(response.getExportedPortlet().isEmpty());
+
+ List<PortletContext> portletContextsFromExport = getPortletContext(response);
+
+ ExtendedAssert.assertNotNull(portletContextsFromExport.isEmpty());
+ ExtendedAssert.assertEquals(1,portletContexts.size());
+
+ PortletContext portletContextFromExport = portletContextsFromExport.get(0);
+ assertEquals(originalHandle, portletContextFromExport.getPortletHandle());
+ assertNull(portletContextFromExport.getPortletState());
+ }
+ finally
+ {
+ undeploy(sessionPortletArchive);
+ }
+ }
+
+ protected List<PortletContext> getPortletContext(ExportPortletsResponse exportPortletsResponse) throws Exception
+ {
+ List<PortletContext> portletContexts = new ArrayList<PortletContext>();
+
+ ExportManager exportManager = new ExportManagerImpl();
+ ExportContext exportContext = exportManager.createExportContext(exportPortletsResponse.getExportContext());
+
+ List<ExportedPortlet> exportedPortlets = exportPortletsResponse.getExportedPortlet();
+
+ for (ExportedPortlet exportPortlet : exportedPortlets)
+ {
+ ExportPortletData exportPortletData = exportManager.createExportPortletData(exportContext, exportPortletsResponse.getLifetime(), exportPortlet.getExportData());
+ String portletHandle = exportPortletData.getPortletHandle();
+ byte[] portletState = exportPortletData.getPortletState();
+ portletContexts.add(WSRPTypeFactory.createPortletContext(portletHandle, portletState));
+ }
+
+ return portletContexts;
+ }
+
+ protected void checkStatePortlet(String handle, String expectedValue) throws Exception
+ {
+ GetMarkup getMarkupOriginalStateless = createMarkupRequest(handle);
+ MarkupResponse responseOriginalStateless = producer.getMarkup(getMarkupOriginalStateless);
+ ExtendedAssert.assertEquals(expectedValue, responseOriginalStateless.getMarkupContext().getItemString());
+ }
+
+ protected PortletContext performBlockingInteractionOnSessionPortlet(String handle, String value, StateChange stateChange) throws Exception
+ {
+ //perform a blocking interaction to set a state on the portlet;
+ PerformBlockingInteraction pbi = WSRPTypeFactory.createDefaultPerformBlockingInteraction(handle);
+ pbi.getInteractionParams().setPortletStateChange(stateChange);
+ pbi.getInteractionParams().getFormParameters().add(createNamedString("value", value));
+ BlockingInteractionResponse response = producer.performBlockingInteraction(pbi);
+ PortletContext portletContext = response.getUpdateResponse().getPortletContext();
+
+ return portletContext;
+ }
+
+ private NamedString createNamedString(String name, String value)
+ {
+ NamedString namedString = new NamedString();
+ namedString.setName(name);
+ namedString.setValue(value);
+ return namedString;
+ }
+
+ protected ImportPortlet createSimpleImportPortlet(String importId, String handle) throws IOException
+ {
ExportPortletData exportPortletData = new ExportPortletData(handle, null);
byte[] exportData = exportPortletData.encodeAsBytes();
return WSRPTypeFactory.createImportPortlet(importId, exportData);
@@ -618,7 +898,6 @@
return WSRPTypeFactory.createImportPortlets(registrationContext, importContext, importPortletsList, userContext, lifetime);
}
- @Override
protected String getMostUsedPortletWARFileName()
{
return TEST_BASIC_PORTLET_WAR;
13 years, 10 months
gatein SVN: r3793 - in components/wsrp/trunk: consumer/src/main/java/org/gatein/wsrp/consumer and 1 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-08-10 11:35:03 -0400 (Tue, 10 Aug 2010)
New Revision: 3793
Added:
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/InvocationDispatcher.java
Modified:
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPResourceURL.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/InvocationHandler.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/WSRPConsumerImpl.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/ActionHandler.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/EventHandler.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/MimeResponseHandler.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/NavigationalStateUpdatingHandler.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/RenderHandler.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/ResourceHandler.java
Log:
- GTNWSRP-58: Refactored InvocationHandler hierarchy to use generics.
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-08-10 13:22:57 UTC (rev 3792)
+++ components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPResourceURL.java 2010-08-10 15:35:03 UTC (rev 3793)
@@ -250,7 +250,7 @@
}
/**
- * Decodes the resource information specified by the encodeResource back into proper resource values
+ * Decodes the resource information specified by the encodeResource back into proper resource values todo: improve
*
* @param resourceInfo
*/
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/InvocationHandler.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/InvocationHandler.java 2010-08-10 13:22:57 UTC (rev 3792)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/InvocationHandler.java 2010-08-10 15:35:03 UTC (rev 3793)
@@ -59,7 +59,7 @@
* @version $Revision: 13121 $
* @since 2.4 (May 31, 2006)
*/
-public abstract class InvocationHandler
+public abstract class InvocationHandler<Invocation extends PortletInvocation, Request, Response>
{
protected final WSRPConsumerImpl consumer;
@@ -81,28 +81,49 @@
this.consumer = consumer;
}
- PortletInvocationResponse handle(PortletInvocation invocation) throws PortletInvokerException
+ public PortletInvocationResponse handle(Invocation invocation) throws PortletInvokerException
{
// Extracts basic required information from invocation
- RequestPrecursor requestPrecursor = new RequestPrecursor(consumer, invocation);
+ RequestPrecursor<Invocation> requestPrecursor = new RequestPrecursor<Invocation>(consumer, invocation);
// create the specific request
- Object request = prepareRequest(requestPrecursor, invocation);
+ Request request = prepareRequest(requestPrecursor, invocation);
// Perform the request
- Object response = performRequest(request, invocation);
- if (response instanceof ErrorResponse)
+ try
{
+ Response response = performRequest(request, invocation);
+ return processResponse(response, invocation, requestPrecursor);
+ }
+ catch (Exception e)
+ {
+ if (!(e instanceof PortletInvokerException))
+ {
+ ErrorResponse errorResponse = dealWithError(e, invocation, getRuntimeContextFrom(request));
+ if (errorResponse != null)
+ {
+ return unwrapWSRPError(errorResponse);
+ }
+ else
+ {
+ return new ErrorResponse(e);
+ }
+ }
+ else
+ {
+ throw (PortletInvokerException)e;
+ }
+ }
+ /*if (response instanceof ErrorResponse)
+ {
return unwrapWSRPError((ErrorResponse)response);
- }
-
- return processResponse(response, invocation, requestPrecursor);
+ }*/
}
- protected Object performRequest(Object request, PortletInvocation invocation) throws PortletInvokerException
+ protected Response performRequest(Request request, PortletInvocation invocation) throws Exception
{
int retryCount = 0;
- Object response = null;
+ Response response = null;
// as long as we don't get a non-null response and we're allowed to try again, try to perform the request
while (response == null && retryCount++ <= MAXIMUM_RETRY_NUMBER)
@@ -140,14 +161,14 @@
sessionHandler.updateCookiesIfNeeded(invocation);
}
- catch (Exception e)
+ /*catch (Exception e)
{
ErrorResponse errorResponse = dealWithError(e, invocation, runtimeContext);
if (errorResponse != null)
{
return errorResponse;
}
- }
+ }*/
finally
{
// we're done: reset currently held information
@@ -157,9 +178,12 @@
if (retryCount >= MAXIMUM_RETRY_NUMBER)
{
- return new ErrorResponse(new RuntimeException("Tried to perform request " + MAXIMUM_RETRY_NUMBER
+ /*return new ErrorResponse(new RuntimeException("Tried to perform request " + MAXIMUM_RETRY_NUMBER
+ " times before giving up. This usually happens if an error in the WS stack prevented the messages to be " +
- "properly transmitted. Look at server.log for clues as to what happened..."));
+ "properly transmitted. Look at server.log for clues as to what happened..."));*/
+ throw new RuntimeException("Tried to perform request " + MAXIMUM_RETRY_NUMBER
+ + " times before giving up. This usually happens if an error in the WS stack prevented the messages to be " +
+ "properly transmitted. Look at server.log for clues as to what happened...");
}
if (debug)
@@ -189,7 +213,7 @@
* @return an ErrorResponse if the error couldn't be dealt with or <code>null</code> if the error was correctly
* handled
*/
- private ErrorResponse dealWithError(Exception error, PortletInvocation invocation, RuntimeContext runtimeContext)
+ private ErrorResponse dealWithError(Exception error, Invocation invocation, RuntimeContext runtimeContext)
throws PortletInvokerException
{
log.error("The portlet threw an exception", error);
@@ -255,17 +279,17 @@
}
}
- protected abstract void updateUserContext(Object request, UserContext userContext);
+ protected abstract void updateUserContext(Request request, UserContext userContext);
- protected abstract void updateRegistrationContext(Object request) throws PortletInvokerException;
+ protected abstract void updateRegistrationContext(Request request) throws PortletInvokerException;
- protected abstract RuntimeContext getRuntimeContextFrom(Object request);
+ protected abstract RuntimeContext getRuntimeContextFrom(Request request);
- protected abstract Object performRequest(Object request) throws Exception;
+ protected abstract Response performRequest(Request request) throws Exception;
- protected abstract Object prepareRequest(RequestPrecursor requestPrecursor, PortletInvocation invocation);
+ protected abstract Request prepareRequest(RequestPrecursor<Invocation> requestPrecursor, Invocation invocation);
- protected abstract PortletInvocationResponse processResponse(Object response, PortletInvocation invocation, RequestPrecursor requestPrecursor) throws PortletInvokerException;
+ protected abstract PortletInvocationResponse processResponse(Response response, Invocation invocation, RequestPrecursor<Invocation> requestPrecursor) throws PortletInvokerException;
/**
* Extracts basic required elements for all invocation requests.
@@ -274,7 +298,7 @@
* @version $Revision: 13121 $
* @since 2.4
*/
- protected static class RequestPrecursor
+ protected static class RequestPrecursor<Invocation extends PortletInvocation>
{
private final static Logger log = LoggerFactory.getLogger(RequestPrecursor.class);
@@ -288,7 +312,7 @@
private static final String STREAM_INFO = "stream info in invocation context";
private static final String USER_AGENT = "User-Agent";
- public RequestPrecursor(WSRPConsumerImpl wsrpConsumer, PortletInvocation invocation) throws PortletInvokerException
+ public RequestPrecursor(WSRPConsumerImpl wsrpConsumer, Invocation invocation) throws PortletInvokerException
{
// retrieve handle
portletContext = WSRPUtils.convertToWSRPPortletContext(WSRPConsumerImpl.getPortletContext(invocation));
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/WSRPConsumerImpl.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/WSRPConsumerImpl.java 2010-08-10 13:22:57 UTC (rev 3792)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/WSRPConsumerImpl.java 2010-08-10 15:35:03 UTC (rev 3793)
@@ -30,12 +30,7 @@
import org.gatein.pc.api.PortletContext;
import org.gatein.pc.api.PortletInvokerException;
import org.gatein.pc.api.PortletStateType;
-import org.gatein.pc.api.invocation.ActionInvocation;
-import org.gatein.pc.api.invocation.EventInvocation;
-import org.gatein.pc.api.invocation.InvocationException;
import org.gatein.pc.api.invocation.PortletInvocation;
-import org.gatein.pc.api.invocation.RenderInvocation;
-import org.gatein.pc.api.invocation.ResourceInvocation;
import org.gatein.pc.api.invocation.response.PortletInvocationResponse;
import org.gatein.pc.api.spi.UserContext;
import org.gatein.pc.api.state.DestroyCloneFailure;
@@ -49,10 +44,7 @@
import org.gatein.wsrp.WSRPTypeFactory;
import org.gatein.wsrp.WSRPUtils;
import org.gatein.wsrp.api.SessionEvent;
-import org.gatein.wsrp.consumer.handlers.ActionHandler;
-import org.gatein.wsrp.consumer.handlers.EventHandler;
-import org.gatein.wsrp.consumer.handlers.RenderHandler;
-import org.gatein.wsrp.consumer.handlers.ResourceHandler;
+import org.gatein.wsrp.consumer.handlers.InvocationDispatcher;
import org.gatein.wsrp.consumer.portlet.WSRPPortlet;
import org.gatein.wsrp.consumer.portlet.info.WSRPPortletInfo;
import org.gatein.wsrp.services.MarkupService;
@@ -93,12 +85,10 @@
*/
public class WSRPConsumerImpl implements WSRPConsumer
{
- private final ActionHandler actionHandler;
- private final RenderHandler renderHandler;
- private final ResourceHandler resourceHandler;
private final SessionHandler sessionHandler;
- private final EventHandler eventHandler;
+ private final InvocationDispatcher dispatcher;
+
private ProducerInfo producerInfo;
/** A registration data element used to indicate when no registration was required by the producer */
@@ -135,11 +125,8 @@
ParameterValidation.throwIllegalArgExceptionIfNull(info, "ProducerInfo");
producerInfo = info;
- actionHandler = new ActionHandler(this);
- renderHandler = new RenderHandler(this);
sessionHandler = new SessionHandler(this);
- resourceHandler = new ResourceHandler(this);
- eventHandler = new EventHandler(this);
+ dispatcher = new InvocationDispatcher(this);
}
public ProducerInfo getProducerInfo()
@@ -180,30 +167,7 @@
public PortletInvocationResponse invoke(PortletInvocation invocation) throws PortletInvokerException
{
- InvocationHandler handler;
-
- if (invocation instanceof RenderInvocation)
- {
- handler = renderHandler;
- }
- else if (invocation instanceof ActionInvocation)
- {
- handler = actionHandler;
- }
- else if (invocation instanceof ResourceInvocation)
- {
- handler = resourceHandler;
- }
- else if (invocation instanceof EventInvocation)
- {
- handler = eventHandler;
- }
- else
- {
- throw new InvocationException("Unknown invocation type: " + invocation);
- }
-
- return handler.handle(invocation);
+ return dispatcher.dispatchAndHandle(invocation);
}
public PortletContext createClone(PortletStateType stateType, PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/ActionHandler.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/ActionHandler.java 2010-08-10 13:22:57 UTC (rev 3792)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/ActionHandler.java 2010-08-10 15:35:03 UTC (rev 3793)
@@ -31,7 +31,6 @@
import org.gatein.pc.api.PortletInvokerException;
import org.gatein.pc.api.StateString;
import org.gatein.pc.api.invocation.ActionInvocation;
-import org.gatein.pc.api.invocation.PortletInvocation;
import org.gatein.pc.api.invocation.response.ErrorResponse;
import org.gatein.pc.api.invocation.response.HTTPRedirectionResponse;
import org.gatein.pc.api.invocation.response.PortletInvocationResponse;
@@ -67,16 +66,60 @@
* @version $Revision: 13121 $
* @since 2.4 (May 31, 2006)
*/
-public class ActionHandler extends NavigationalStateUpdatingHandler
+public class ActionHandler extends NavigationalStateUpdatingHandler<ActionInvocation, PerformBlockingInteraction, BlockingInteractionResponse>
{
public ActionHandler(WSRPConsumerImpl consumer)
{
super(consumer);
}
- @SuppressWarnings({"CastToConcreteClass"})
- protected Object prepareRequest(RequestPrecursor requestPrecursor, PortletInvocation invocation)
+ @Override
+ protected void updateUserContext(PerformBlockingInteraction performBlockingInteraction, UserContext userContext)
{
+ performBlockingInteraction.setUserContext(userContext);
+ }
+
+ @Override
+ protected void updateRegistrationContext(PerformBlockingInteraction performBlockingInteraction) throws PortletInvokerException
+ {
+ performBlockingInteraction.setRegistrationContext(consumer.getRegistrationContext());
+ }
+
+ @Override
+ protected RuntimeContext getRuntimeContextFrom(PerformBlockingInteraction performBlockingInteraction)
+ {
+ return performBlockingInteraction.getRuntimeContext();
+ }
+
+ @Override
+ protected BlockingInteractionResponse performRequest(PerformBlockingInteraction interaction) throws Exception
+ {
+ Holder<UpdateResponse> updateResponseHolder = new Holder<UpdateResponse>();
+ Holder<String> redirectURL = new Holder<String>();
+
+ // invocation
+ if (debug)
+ {
+ log.debug("performBlockingInteraction on '" + interaction.getPortletContext().getPortletHandle() + "'");
+ }
+ consumer.getMarkupService().performBlockingInteraction(interaction.getRegistrationContext(),
+ interaction.getPortletContext(), interaction.getRuntimeContext(), interaction.getUserContext(),
+ interaction.getMarkupParams(), interaction.getInteractionParams(), updateResponseHolder, redirectURL,
+ new Holder<List<Extension>>());
+
+ // construct response
+ if (redirectURL.value != null)
+ {
+ return WSRPTypeFactory.createBlockingInteractionResponse(redirectURL.value);
+ }
+ else
+ {
+ return WSRPTypeFactory.createBlockingInteractionResponse(updateResponseHolder.value);
+ }
+ }
+
+ protected PerformBlockingInteraction prepareRequest(RequestPrecursor<ActionInvocation> requestPrecursor, ActionInvocation invocation)
+ {
if (!(invocation instanceof ActionInvocation))
{
throw new IllegalArgumentException("ActionHandler can only handle ActionInvocations!");
@@ -219,7 +262,7 @@
requestPrecursor.getMarkupParams(), interactionParams);
}
- protected PortletInvocationResponse processResponse(Object response, PortletInvocation invocation, RequestPrecursor requestPrecursor) throws PortletInvokerException
+ protected PortletInvocationResponse processResponse(BlockingInteractionResponse response, ActionInvocation invocation, RequestPrecursor<ActionInvocation> requestPrecursor) throws PortletInvokerException
{
BlockingInteractionResponse blockingInteractionResponse = (BlockingInteractionResponse)response;
@@ -247,58 +290,6 @@
}
}
- protected void updateUserContext(Object request, UserContext userContext)
- {
- getActionRequest(request).setUserContext(userContext);
- }
-
- protected void updateRegistrationContext(Object request) throws PortletInvokerException
- {
- getActionRequest(request).setRegistrationContext(consumer.getRegistrationContext());
- }
-
- protected RuntimeContext getRuntimeContextFrom(Object request)
- {
- return getActionRequest(request).getRuntimeContext();
- }
-
- protected Object performRequest(Object request) throws Exception
- {
- PerformBlockingInteraction interaction = getActionRequest(request);
- Holder<UpdateResponse> updateResponseHolder = new Holder<UpdateResponse>();
- Holder<String> redirectURL = new Holder<String>();
-
- // invocation
- if (debug)
- {
- log.debug("performBlockingInteraction on '" + interaction.getPortletContext().getPortletHandle() + "'");
- }
- consumer.getMarkupService().performBlockingInteraction(interaction.getRegistrationContext(),
- interaction.getPortletContext(), interaction.getRuntimeContext(), interaction.getUserContext(),
- interaction.getMarkupParams(), interaction.getInteractionParams(), updateResponseHolder, redirectURL,
- new Holder<List<Extension>>());
-
- // construct response
- if (redirectURL.value != null)
- {
- return WSRPTypeFactory.createBlockingInteractionResponse(redirectURL.value);
- }
- else
- {
- return WSRPTypeFactory.createBlockingInteractionResponse(updateResponseHolder.value);
- }
- }
-
- private PerformBlockingInteraction getActionRequest(Object request)
- {
- if (request instanceof PerformBlockingInteraction)
- {
- return (PerformBlockingInteraction)request;
- }
-
- throw new IllegalArgumentException("ActionHandler: request is not a PerformBlockingInteraction request!");
- }
-
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision: 10198 $
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/EventHandler.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/EventHandler.java 2010-08-10 13:22:57 UTC (rev 3792)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/EventHandler.java 2010-08-10 15:35:03 UTC (rev 3793)
@@ -26,7 +26,6 @@
import org.gatein.common.util.ParameterValidation;
import org.gatein.pc.api.PortletInvokerException;
import org.gatein.pc.api.invocation.EventInvocation;
-import org.gatein.pc.api.invocation.PortletInvocation;
import org.gatein.pc.api.invocation.response.ErrorResponse;
import org.gatein.pc.api.invocation.response.PortletInvocationResponse;
import org.gatein.pc.api.spi.InstanceContext;
@@ -56,7 +55,7 @@
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision$
*/
-public class EventHandler extends NavigationalStateUpdatingHandler
+public class EventHandler extends NavigationalStateUpdatingHandler<EventInvocation, HandleEvents, HandleEventsResponse>
{
public EventHandler(WSRPConsumerImpl consumer)
{
@@ -64,38 +63,36 @@
}
@Override
- protected void updateUserContext(Object request, UserContext userContext)
+ protected void updateUserContext(HandleEvents request, UserContext userContext)
{
- getHandleEvents(request).setUserContext(userContext);
+ request.setUserContext(userContext);
}
@Override
- protected void updateRegistrationContext(Object request) throws PortletInvokerException
+ protected void updateRegistrationContext(HandleEvents request) throws PortletInvokerException
{
- getHandleEvents(request).setRegistrationContext(consumer.getRegistrationContext());
+ request.setRegistrationContext(consumer.getRegistrationContext());
}
@Override
- protected RuntimeContext getRuntimeContextFrom(Object request)
+ protected RuntimeContext getRuntimeContextFrom(HandleEvents request)
{
- return getHandleEvents(request).getRuntimeContext();
+ return request.getRuntimeContext();
}
@Override
- protected Object performRequest(Object request) throws Exception
+ protected HandleEventsResponse performRequest(HandleEvents request) throws Exception
{
- HandleEvents eventRequest = getHandleEvents(request);
-
if (InvocationHandler.debug)
{
- InvocationHandler.log.debug("handleEvents on '" + eventRequest.getPortletContext().getPortletHandle() + "'");
+ InvocationHandler.log.debug("handleEvents on '" + request.getPortletContext().getPortletHandle() + "'");
}
Holder<List<HandleEventsFailed>> failedEvents = new Holder<List<HandleEventsFailed>>();
Holder<UpdateResponse> updateResponse = new Holder<UpdateResponse>();
- consumer.getMarkupService().handleEvents(eventRequest.getRegistrationContext(), eventRequest.getPortletContext(),
- eventRequest.getRuntimeContext(), eventRequest.getUserContext(), eventRequest.getMarkupParams(),
- eventRequest.getEventParams(), updateResponse, failedEvents,
+ consumer.getMarkupService().handleEvents(request.getRegistrationContext(), request.getPortletContext(),
+ request.getRuntimeContext(), request.getUserContext(), request.getMarkupParams(),
+ request.getEventParams(), updateResponse, failedEvents,
new Holder<List<Extension>>());
HandleEventsResponse response = WSRPTypeFactory.createHandleEventsReponse();
@@ -108,15 +105,9 @@
}
@Override
- protected Object prepareRequest(InvocationHandler.RequestPrecursor requestPrecursor, PortletInvocation invocation)
+ protected HandleEvents prepareRequest(RequestPrecursor<EventInvocation> requestPrecursor, EventInvocation invocation)
{
- if (!(invocation instanceof EventInvocation))
- {
- throw new IllegalArgumentException("EventHandler can only handle EventInvocations!");
- }
- EventInvocation eventInvocation = (EventInvocation)invocation;
-
PortletContext portletContext = requestPrecursor.getPortletContext();
if (InvocationHandler.debug)
{
@@ -134,8 +125,8 @@
}
// events
- QName name = eventInvocation.getName();
- Serializable payload = eventInvocation.getPayload();
+ QName name = invocation.getName();
+ Serializable payload = invocation.getPayload();
Event event = WSRPTypeFactory.createEvent(name, payload);
EventParams eventParams = WSRPTypeFactory.createEventParams(Collections.singletonList(event), WSRPUtils.getStateChangeFromAccessMode(accessMode));
@@ -144,26 +135,14 @@
}
@Override
- protected PortletInvocationResponse processResponse(Object response, PortletInvocation invocation, InvocationHandler.RequestPrecursor requestPrecursor) throws PortletInvokerException
+ protected PortletInvocationResponse processResponse(HandleEventsResponse response, EventInvocation invocation, RequestPrecursor<EventInvocation> requestPrecursor) throws PortletInvokerException
{
- HandleEventsResponse handleEventsResponse = (HandleEventsResponse)response;
-
- List<HandleEventsFailed> failed = handleEventsResponse.getFailedEvents();
+ List<HandleEventsFailed> failed = response.getFailedEvents();
if (ParameterValidation.existsAndIsNotEmpty(failed))
{
return new ErrorResponse("Couldn't process events: " + failed);
}
- return processUpdateResponse(invocation, requestPrecursor, handleEventsResponse.getUpdateResponse());
+ return processUpdateResponse(invocation, requestPrecursor, response.getUpdateResponse());
}
-
- private HandleEvents getHandleEvents(Object request)
- {
- if (request instanceof HandleEvents)
- {
- return (HandleEvents)request;
- }
-
- throw new IllegalArgumentException("EventHandler: request is not a HandleEvents request!");
- }
}
Added: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/InvocationDispatcher.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/InvocationDispatcher.java (rev 0)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/InvocationDispatcher.java 2010-08-10 15:35:03 UTC (rev 3793)
@@ -0,0 +1,201 @@
+/*
+ * 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.consumer.handlers;
+
+import org.apache.commons.httpclient.Cookie;
+import org.gatein.common.io.IOTools;
+import org.gatein.common.net.media.MediaType;
+import org.gatein.common.net.media.TypeDef;
+import org.gatein.common.util.MultiValuedPropertyMap;
+import org.gatein.common.util.Tools;
+import org.gatein.pc.api.PortletInvokerException;
+import org.gatein.pc.api.invocation.ActionInvocation;
+import org.gatein.pc.api.invocation.EventInvocation;
+import org.gatein.pc.api.invocation.InvocationException;
+import org.gatein.pc.api.invocation.PortletInvocation;
+import org.gatein.pc.api.invocation.RenderInvocation;
+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.PortletInvocationResponse;
+import org.gatein.pc.api.invocation.response.ResponseProperties;
+import org.gatein.wsrp.WSRPResourceURL;
+import org.gatein.wsrp.WSRPRewritingConstants;
+import org.gatein.wsrp.consumer.InvocationHandler;
+import org.gatein.wsrp.consumer.WSRPConsumerImpl;
+import org.gatein.wsrp.handler.CookieUtil;
+import org.gatein.wsrp.spec.v2.WSRP2RewritingConstants;
+
+import java.io.IOException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class InvocationDispatcher
+{
+ private final ActionHandler actionHandler;
+ private final RenderHandler renderHandler;
+ private final ResourceHandler resourceHandler;
+ private final EventHandler eventHandler;
+ private final WSRPConsumerImpl consumer;
+
+ public InvocationDispatcher(WSRPConsumerImpl consumer)
+ {
+ this.consumer = consumer;
+ actionHandler = new ActionHandler(consumer);
+ renderHandler = new RenderHandler(consumer);
+ resourceHandler = new ResourceHandler(consumer);
+ eventHandler = new EventHandler(consumer);
+ }
+
+ public PortletInvocationResponse dispatchAndHandle(PortletInvocation invocation) throws PortletInvokerException
+ {
+ InvocationHandler handler;
+
+ if (invocation instanceof RenderInvocation)
+ {
+ handler = renderHandler;
+ }
+ else if (invocation instanceof ActionInvocation)
+ {
+ handler = actionHandler;
+ }
+ else if (invocation instanceof ResourceInvocation)
+ {
+ String resourceInvocationId = ((ResourceInvocation)invocation).getResourceId();
+
+ Map<String, String> resourceMap = WSRPResourceURL.decodeResource(resourceInvocationId);
+
+ String resourceId = resourceMap.get(WSRP2RewritingConstants.RESOURCE_ID);
+ String resourceURL = resourceMap.get(WSRPRewritingConstants.RESOURCE_URL);
+ String preferOperationAsString = resourceMap.get(WSRP2RewritingConstants.RESOURCE_PREFER_OPERATION);
+ boolean preferOperation = (preferOperationAsString != null && Boolean.parseBoolean(preferOperationAsString));
+
+ int version = consumer.getMarkupService().getVersion();
+ if (version == 2 && (preferOperation || resourceURL == null || (resourceId != null && resourceId.length() > 0)))
+ {
+ handler = resourceHandler;
+ }
+ else
+ {
+ return performDirectURLRequest(resourceURL);
+ }
+ }
+ else if (invocation instanceof EventInvocation)
+ {
+ handler = eventHandler;
+ }
+ else
+ {
+ throw new InvocationException("Unknown invocation type: " + invocation);
+ }
+
+ return handler.handle(invocation);
+ }
+
+ private PortletInvocationResponse performDirectURLRequest(String resourceURL)
+ {
+ try
+ {
+ URL url = new URL(resourceURL);
+ URLConnection urlConnection = url.openConnection();
+ String contentType = urlConnection.getContentType();
+
+ // init ResponseProperties for ContentResponse result
+ Map<String, List<String>> headers = urlConnection.getHeaderFields();
+ ResponseProperties props = new ResponseProperties();
+ MultiValuedPropertyMap<String> transportHeaders = props.getTransportHeaders();
+ for (Map.Entry<String, List<String>> entry : headers.entrySet())
+ {
+ String key = entry.getKey();
+ if (key != null)
+ {
+ List<String> values = entry.getValue();
+ if (values != null)
+ {
+ if (CookieUtil.SET_COOKIE.equals(key))
+ {
+ Cookie[] cookies = CookieUtil.extractCookiesFrom(url, values.toArray(new String[values.size()]));
+ List<javax.servlet.http.Cookie> propCookies = props.getCookies();
+ for (Cookie cookie : cookies)
+ {
+ propCookies.add(CookieUtil.convertFrom(cookie));
+ }
+ }
+ else
+ {
+ for (String value : values)
+ {
+ transportHeaders.addValue(key, value);
+ }
+ }
+ }
+ }
+ }
+
+ int length = urlConnection.getContentLength();
+ // if length is not known, use a default value
+ length = (length > 0 ? length : Tools.DEFAULT_BUFFER_SIZE * 8);
+ byte[] bytes = IOTools.getBytes(urlConnection.getInputStream(), length);
+
+ ContentResponse result;
+ MediaType type = MediaType.create(contentType);
+ if (TypeDef.TEXT.equals(type.getType()))
+ {
+ // determine the charset of the content, if any
+ String charset = "UTF-8";
+ if (contentType != null)
+ {
+ for (String part : contentType.split(";"))
+ {
+ if (part.startsWith("charset="))
+ {
+ charset = part.substring("charset=".length());
+ }
+ }
+ }
+
+ // build a String-based content response
+ result = new ContentResponse(props, Collections.<String, Object>emptyMap(), contentType, null, new String(bytes, charset), null);
+ }
+ else
+ {
+ // build a byte-based content response
+ result = new ContentResponse(props, Collections.<String, Object>emptyMap(), contentType, bytes, null, null);
+ }
+
+ return result;
+ }
+ catch (IOException e)
+ {
+ return new ErrorResponse(e);
+ }
+ }
+}
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/MimeResponseHandler.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/MimeResponseHandler.java 2010-08-10 13:22:57 UTC (rev 3792)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/MimeResponseHandler.java 2010-08-10 15:35:03 UTC (rev 3793)
@@ -52,7 +52,7 @@
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision$
*/
-public abstract class MimeResponseHandler<Response, LocalMimeResponse extends MimeResponse> extends InvocationHandler
+public abstract class MimeResponseHandler<Invocation extends PortletInvocation, Request, Response, LocalMimeResponse extends MimeResponse> extends InvocationHandler<Invocation, Request, Response>
{
private static final org.gatein.pc.api.cache.CacheControl DEFAULT_CACHE_CONTROL = new org.gatein.pc.api.cache.CacheControl(0, CacheScope.PRIVATE, null);
@@ -66,14 +66,12 @@
protected abstract LocalMimeResponse getMimeResponseFrom(Response response);
@Override
- protected PortletInvocationResponse processResponse(Object response, PortletInvocation invocation, RequestPrecursor requestPrecursor) throws PortletInvokerException
+ protected PortletInvocationResponse processResponse(Response response, Invocation invocation, RequestPrecursor<Invocation> requestPrecursor) throws PortletInvokerException
{
- Response localResponse = (Response)response;
-
- consumer.getSessionHandler().updateSessionIfNeeded(getSessionContextFrom(localResponse), invocation,
+ consumer.getSessionHandler().updateSessionIfNeeded(getSessionContextFrom(response), invocation,
requestPrecursor.getPortletHandle());
- LocalMimeResponse mimeResponse = getMimeResponseFrom(localResponse);
+ LocalMimeResponse mimeResponse = getMimeResponseFrom(response);
String markup = mimeResponse.getItemString();
byte[] binary = mimeResponse.getItemBinary();
if (markup != null && binary != null)
@@ -119,7 +117,7 @@
return createContentResponse(mimeResponse, invocation, null, null, mimeType, binary, markup, createCacheControl(mimeResponse));
}
- protected PortletInvocationResponse createContentResponse(LocalMimeResponse mimeResponse, PortletInvocation invocation,
+ protected PortletInvocationResponse createContentResponse(LocalMimeResponse mimeResponse, Invocation invocation,
ResponseProperties properties, Map<String, Object> attributes,
String mimeType, byte[] bytes, String markup,
org.gatein.pc.api.cache.CacheControl cacheControl)
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/NavigationalStateUpdatingHandler.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/NavigationalStateUpdatingHandler.java 2010-08-10 13:22:57 UTC (rev 3792)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/NavigationalStateUpdatingHandler.java 2010-08-10 15:35:03 UTC (rev 3793)
@@ -48,14 +48,14 @@
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision$
*/
-public abstract class NavigationalStateUpdatingHandler extends InvocationHandler
+public abstract class NavigationalStateUpdatingHandler<Invocation extends PortletInvocation, Request, Response> extends InvocationHandler<Invocation, Request, Response>
{
public NavigationalStateUpdatingHandler(WSRPConsumerImpl consumer)
{
super(consumer);
}
- protected UpdateNavigationalStateResponse processUpdateResponse(PortletInvocation invocation, RequestPrecursor requestPrecursor, UpdateResponse updateResponse)
+ protected UpdateNavigationalStateResponse processUpdateResponse(Invocation invocation, RequestPrecursor<Invocation> requestPrecursor, UpdateResponse updateResponse)
{
UpdateNavigationalStateResponse result = new UpdateNavigationalStateResponse();
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/RenderHandler.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/RenderHandler.java 2010-08-10 13:22:57 UTC (rev 3792)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/RenderHandler.java 2010-08-10 15:35:03 UTC (rev 3793)
@@ -24,7 +24,6 @@
package org.gatein.wsrp.consumer.handlers;
import org.gatein.pc.api.PortletInvokerException;
-import org.gatein.pc.api.invocation.PortletInvocation;
import org.gatein.pc.api.invocation.RenderInvocation;
import org.gatein.pc.api.invocation.response.FragmentResponse;
import org.gatein.pc.api.invocation.response.PortletInvocationResponse;
@@ -49,7 +48,7 @@
* @version $Revision: 12082 $
* @since 2.4 (May 31, 2006)
*/
-public class RenderHandler extends MimeResponseHandler<MarkupResponse, MarkupContext>
+public class RenderHandler extends MimeResponseHandler<RenderInvocation, GetMarkup, MarkupResponse, MarkupContext>
{
public RenderHandler(WSRPConsumerImpl consumer)
@@ -70,7 +69,7 @@
}
@Override
- protected PortletInvocationResponse createContentResponse(MarkupContext markupContext, PortletInvocation invocation,
+ protected PortletInvocationResponse createContentResponse(MarkupContext markupContext, RenderInvocation invocation,
ResponseProperties properties, Map<String, Object> attributes,
String mimeType, byte[] bytes, String markup,
org.gatein.pc.api.cache.CacheControl cacheControl)
@@ -79,13 +78,8 @@
cacheControl, invocation.getPortalContext().getModes());
}
- protected Object prepareRequest(RequestPrecursor requestPrecursor, PortletInvocation invocation)
+ protected GetMarkup prepareRequest(RequestPrecursor<RenderInvocation> requestPrecursor, RenderInvocation invocation)
{
- if (!(invocation instanceof RenderInvocation))
- {
- throw new IllegalArgumentException("RenderHandler can only handle RenderInvocations!");
- }
-
// Create the markup request
PortletContext portletContext = requestPrecursor.getPortletContext();
if (debug)
@@ -95,49 +89,37 @@
return WSRPTypeFactory.createMarkupRequest(portletContext, requestPrecursor.getRuntimeContext(), requestPrecursor.getMarkupParams());
}
- protected void updateUserContext(Object request, UserContext userContext)
+ protected void updateUserContext(GetMarkup request, UserContext userContext)
{
- getRenderRequest(request).setUserContext(userContext);
+ request.setUserContext(userContext);
}
- protected void updateRegistrationContext(Object request) throws PortletInvokerException
+ protected void updateRegistrationContext(GetMarkup request) throws PortletInvokerException
{
- getRenderRequest(request).setRegistrationContext(consumer.getRegistrationContext());
+ request.setRegistrationContext(consumer.getRegistrationContext());
}
- protected RuntimeContext getRuntimeContextFrom(Object request)
+ protected RuntimeContext getRuntimeContextFrom(GetMarkup request)
{
- return getRenderRequest(request).getRuntimeContext();
+ return request.getRuntimeContext();
}
- protected Object performRequest(Object request) throws Exception
+ protected MarkupResponse performRequest(GetMarkup request) throws Exception
{
- GetMarkup renderRequest = getRenderRequest(request);
if (debug)
{
- log.debug("getMarkup on '" + renderRequest.getPortletContext().getPortletHandle() + "'");
+ log.debug("getMarkup on '" + request.getPortletContext().getPortletHandle() + "'");
}
// invocation
Holder<SessionContext> sessionContextHolder = new Holder<SessionContext>();
Holder<MarkupContext> markupContextHolder = new Holder<MarkupContext>();
- consumer.getMarkupService().getMarkup(renderRequest.getRegistrationContext(), renderRequest.getPortletContext(),
- renderRequest.getRuntimeContext(), renderRequest.getUserContext(), renderRequest.getMarkupParams(),
+ consumer.getMarkupService().getMarkup(request.getRegistrationContext(), request.getPortletContext(),
+ request.getRuntimeContext(), request.getUserContext(), request.getMarkupParams(),
markupContextHolder, sessionContextHolder, new Holder<List<Extension>>());
MarkupResponse markupResponse = new MarkupResponse();
markupResponse.setMarkupContext(markupContextHolder.value);
markupResponse.setSessionContext(sessionContextHolder.value);
return markupResponse;
}
-
- private GetMarkup getRenderRequest(Object request)
- {
- if (request instanceof GetMarkup)
- {
- return (GetMarkup)request;
- }
-
- throw new IllegalArgumentException("RenderHandler: Request is not a GetMarkup request!");
- }
-
}
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/ResourceHandler.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/ResourceHandler.java 2010-08-10 13:22:57 UTC (rev 3792)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/ResourceHandler.java 2010-08-10 15:35:03 UTC (rev 3793)
@@ -23,28 +23,16 @@
package org.gatein.wsrp.consumer.handlers;
-import org.apache.commons.httpclient.Cookie;
-import org.gatein.common.io.IOTools;
-import org.gatein.common.net.media.MediaType;
-import org.gatein.common.net.media.TypeDef;
-import org.gatein.common.util.MultiValuedPropertyMap;
import org.gatein.common.util.ParameterValidation;
-import org.gatein.common.util.Tools;
import org.gatein.pc.api.PortletInvokerException;
import org.gatein.pc.api.StateString;
-import org.gatein.pc.api.invocation.PortletInvocation;
import org.gatein.pc.api.invocation.ResourceInvocation;
-import org.gatein.pc.api.invocation.response.ContentResponse;
-import org.gatein.pc.api.invocation.response.PortletInvocationResponse;
-import org.gatein.pc.api.invocation.response.ResponseProperties;
import org.gatein.pc.api.spi.InstanceContext;
import org.gatein.pc.api.state.AccessMode;
import org.gatein.wsrp.WSRPResourceURL;
-import org.gatein.wsrp.WSRPRewritingConstants;
import org.gatein.wsrp.WSRPTypeFactory;
import org.gatein.wsrp.WSRPUtils;
import org.gatein.wsrp.consumer.WSRPConsumerImpl;
-import org.gatein.wsrp.handler.CookieUtil;
import org.gatein.wsrp.spec.v2.WSRP2RewritingConstants;
import org.oasis.wsrp.v2.Extension;
import org.oasis.wsrp.v2.GetResource;
@@ -58,9 +46,6 @@
import org.oasis.wsrp.v2.UserContext;
import javax.xml.ws.Holder;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.Collections;
import java.util.List;
import java.util.Map;
@@ -68,7 +53,7 @@
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision$
*/
-public class ResourceHandler extends MimeResponseHandler<ResourceResponse, ResourceContext>
+public class ResourceHandler extends MimeResponseHandler<ResourceInvocation, GetResource, ResourceResponse, ResourceContext>
{
public ResourceHandler(WSRPConsumerImpl consumer)
@@ -89,78 +74,30 @@
}
@Override
- protected void updateUserContext(Object request, UserContext userContext)
+ protected void updateUserContext(GetResource request, UserContext userContext)
{
- if (request instanceof GetResource)
- {
- getResourceRequest(request).setUserContext(userContext);
- }
+ request.setUserContext(userContext);
}
@Override
- protected void updateRegistrationContext(Object request) throws PortletInvokerException
+ protected void updateRegistrationContext(GetResource request) throws PortletInvokerException
{
- if (request instanceof GetResource)
- {
- getResourceRequest(request).setRegistrationContext(consumer.getRegistrationContext());
- }
+ request.setRegistrationContext(consumer.getRegistrationContext());
}
@Override
- protected RuntimeContext getRuntimeContextFrom(Object request)
+ protected RuntimeContext getRuntimeContextFrom(GetResource request)
{
- if (request instanceof GetResource)
- {
- return getResourceRequest(request).getRuntimeContext();
- }
- else
- {
- return null;
- }
+ return request.getRuntimeContext();
}
@Override
- protected Object prepareRequest(RequestPrecursor requestPrecursor, PortletInvocation invocation)
+ protected GetResource prepareRequest(RequestPrecursor<ResourceInvocation> requestPrecursor, ResourceInvocation invocation)
{
- if (!(invocation instanceof ResourceInvocation))
- {
- throw new IllegalArgumentException("ResourceHandler can only handle ResourceInvocations!");
- }
-
- ResourceInvocation resourceInvocation = (ResourceInvocation)invocation;
-
- String resourceInvocationId = resourceInvocation.getResourceId();
-
+ String resourceInvocationId = invocation.getResourceId();
Map<String, String> resourceMap = WSRPResourceURL.decodeResource(resourceInvocationId);
-
String resourceId = resourceMap.get(WSRP2RewritingConstants.RESOURCE_ID);
- String resourceURL = resourceMap.get(WSRPRewritingConstants.RESOURCE_URL);
- String preferOperationAsString = resourceMap.get(WSRP2RewritingConstants.RESOURCE_PREFER_OPERATION);
- boolean preferOperation = (preferOperationAsString != null && Boolean.parseBoolean(preferOperationAsString));
- int version = 1;
- try
- {
- version = consumer.getMarkupService().getVersion();
- }
- catch (PortletInvokerException portletInvokerException)
- {
- log.warn("Encountered an exception when trying to get the consumer's markup service's version, assuming WSRP 1.0 compliant.", portletInvokerException);
- }
-
- if (version == 2 && (preferOperation || resourceURL == null || (resourceId != null && resourceId.length() > 0)))
- {
- return prepareGetResourceRequest(requestPrecursor, resourceInvocation, resourceId);
- }
- else
- {
- return resourceURL;
- }
-
- }
-
- private GetResource prepareGetResourceRequest(RequestPrecursor requestPrecursor, ResourceInvocation invocation, String resourceId)
- {
PortletContext portletContext = requestPrecursor.getPortletContext();
// since we actually extracted the data into MarkupParams in the RequestPrecursor, use that! :)
@@ -205,31 +142,14 @@
}
@Override
- protected Object performRequest(Object request) throws Exception
+ protected ResourceResponse performRequest(GetResource request) throws Exception
{
- if (request instanceof GetResource)
- {
- return performGetResourceRequest((GetResource)request);
- }
- else if (request instanceof String)
- {
- return performURLRequest((String)request);
- }
- else
- {
- throw new IllegalArgumentException("ResourceHandler performRequest can only be called with a GetResource or String object. Received : " + request);
- }
-
- }
-
- private ResourceResponse performGetResourceRequest(GetResource getResource) throws Exception
- {
Holder<SessionContext> sessionContextHolder = new Holder<SessionContext>();
Holder<ResourceContext> resourceContextHolder = new Holder<ResourceContext>();
- Holder<PortletContext> portletContextHolder = new Holder<PortletContext>(getResource.getPortletContext());
+ Holder<PortletContext> portletContextHolder = new Holder<PortletContext>(request.getPortletContext());
- consumer.getMarkupService().getResource(getResource.getRegistrationContext(), portletContextHolder, getResource.getRuntimeContext(),
- getResource.getUserContext(), getResource.getResourceParams(), resourceContextHolder, sessionContextHolder, new Holder<List<Extension>>());
+ consumer.getMarkupService().getResource(request.getRegistrationContext(), portletContextHolder, request.getRuntimeContext(),
+ request.getUserContext(), request.getResourceParams(), resourceContextHolder, sessionContextHolder, new Holder<List<Extension>>());
ResourceResponse resourceResponse = WSRPTypeFactory.createResourceResponse(resourceContextHolder.value);
resourceResponse.setPortletContext(portletContextHolder.value);
@@ -237,102 +157,4 @@
return resourceResponse;
}
- private ContentResponse performURLRequest(String resourceURL) throws Exception
- {
- URL url = new URL(resourceURL);
- URLConnection urlConnection = url.openConnection();
- String contentType = urlConnection.getContentType();
-
- // init ResponseProperties for ContentResponse result
- Map<String, List<String>> headers = urlConnection.getHeaderFields();
- ResponseProperties props = new ResponseProperties();
- MultiValuedPropertyMap<String> transportHeaders = props.getTransportHeaders();
- for (Map.Entry<String, List<String>> entry : headers.entrySet())
- {
- String key = entry.getKey();
- if (key != null)
- {
- List<String> values = entry.getValue();
- if (values != null)
- {
- if (CookieUtil.SET_COOKIE.equals(key))
- {
- Cookie[] cookies = CookieUtil.extractCookiesFrom(url, values.toArray(new String[values.size()]));
- List<javax.servlet.http.Cookie> propCookies = props.getCookies();
- for (Cookie cookie : cookies)
- {
- propCookies.add(CookieUtil.convertFrom(cookie));
- }
- }
- else
- {
- for (String value : values)
- {
- transportHeaders.addValue(key, value);
- }
- }
- }
- }
- }
-
- int length = urlConnection.getContentLength();
- // if length is not known, use a default value
- length = (length > 0 ? length : Tools.DEFAULT_BUFFER_SIZE * 8);
- byte[] bytes = IOTools.getBytes(urlConnection.getInputStream(), length);
-
- ContentResponse result;
- MediaType type = MediaType.create(contentType);
- if (TypeDef.TEXT.equals(type.getType()))
- {
- // determine the charset of the content, if any
- String charset = "UTF-8";
- if (contentType != null)
- {
- for (String part : contentType.split(";"))
- {
- if (part.startsWith("charset="))
- {
- charset = part.substring("charset=".length());
- }
- }
- }
-
- // build a String-based content response
- result = new ContentResponse(props, Collections.<String, Object>emptyMap(), contentType, null, new String(bytes, charset), null);
- }
- else
- {
- // build a byte-based content response
- result = new ContentResponse(props, Collections.<String, Object>emptyMap(), contentType, bytes, null, null);
- }
-
- return result;
- }
-
- @Override
- protected PortletInvocationResponse processResponse(Object response, PortletInvocation invocation, RequestPrecursor requestPrecursor) throws PortletInvokerException
- {
- if (response instanceof ResourceResponse)
- {
- return super.processResponse(response, invocation, requestPrecursor);
- }
- else if (response instanceof ContentResponse)
- {
- return (ContentResponse)response;
- }
- else
- {
- throw new PortletInvokerException("Invalid response object: " + response + ". Expected either a " + ContentResponse.class + " or a " + ResourceResponse.class);
- }
- }
-
- private GetResource getResourceRequest(Object request)
- {
- if (request instanceof GetResource)
- {
- return (GetResource)request;
- }
-
- throw new IllegalArgumentException("ResourceHandler: Request is not a GetResource request!");
- }
}
13 years, 10 months
gatein SVN: r3792 - in components/wsrp/trunk: producer/src/main/java/org/gatein/wsrp/producer and 1 other directory.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-08-10 09:22:57 -0400 (Tue, 10 Aug 2010)
New Revision: 3792
Modified:
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/ResourceHandler.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/ResourceRequestProcessor.java
Log:
- GTNWSRP-54: do not transmit resource id placeholder to portlet.
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/ResourceHandler.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/ResourceHandler.java 2010-08-10 12:50:44 UTC (rev 3791)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/ResourceHandler.java 2010-08-10 13:22:57 UTC (rev 3792)
@@ -177,9 +177,9 @@
}
// if the portlet didn't request a resource id, use the fake one:
- if (resourceId == null || resourceId.length() == 0)
+ if (ParameterValidation.isNullOrEmpty(resourceId))
{
- resourceId = WSRPResourceURL.DEFAULT_RESOURCE_ID;
+ throw new IllegalArgumentException("GetResource needs a valid resource id.");
}
// Create ResourceParams
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/ResourceRequestProcessor.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/ResourceRequestProcessor.java 2010-08-10 12:50:44 UTC (rev 3791)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/ResourceRequestProcessor.java 2010-08-10 13:22:57 UTC (rev 3792)
@@ -27,6 +27,7 @@
import org.gatein.pc.api.invocation.ResourceInvocation;
import org.gatein.pc.api.state.AccessMode;
import org.gatein.pc.portlet.impl.jsr168.PortletUtils;
+import org.gatein.wsrp.WSRPResourceURL;
import org.gatein.wsrp.WSRPTypeFactory;
import org.gatein.wsrp.WSRPUtils;
import org.oasis.wsrp.v2.GetResource;
@@ -110,7 +111,12 @@
ResourceParams resourceParams = this.getResource.getResourceParams();
- resourceInvocation.setResourceId(this.getResource.getResourceParams().getResourceID());
+ // only set the resource id if it's different from the place holder we use if the portlet doesn't set one
+ String id = this.getResource.getResourceParams().getResourceID();
+ if (!WSRPResourceURL.DEFAULT_RESOURCE_ID.equals(id))
+ {
+ resourceInvocation.setResourceId(id);
+ }
WSRPRequestContext requestContext = WSRPRequestContext.createRequestContext(markupRequest, resourceParams);
resourceInvocation.setRequestContext(requestContext);
13 years, 10 months
gatein SVN: r3790 - portal/branches/branched-r3776/web/eXoResources/src/main/webapp/javascript/eXo/portal.
by do-not-reply@jboss.org
Author: hoang_to
Date: 2010-08-10 04:00:14 -0400 (Tue, 10 Aug 2010)
New Revision: 3790
Modified:
portal/branches/branched-r3776/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js
Log:
Apply patch to GTNPORTAL-1116
Modified: portal/branches/branched-r3776/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js
===================================================================
--- portal/branches/branched-r3776/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js 2010-08-10 07:52:37 UTC (rev 3789)
+++ portal/branches/branched-r3776/web/eXoResources/src/main/webapp/javascript/eXo/portal/UIPortal.js 2010-08-10 08:00:14 UTC (rev 3790)
@@ -98,6 +98,56 @@
}
newLayer.parentNode.style.top = -height + "px";
editBlock.style.display = "block";
+
+ //resize width of portlet/container control if IE + LTR align BEGIN
+
+ var uiInfoBar = DOMUtil.findFirstDescendantByClass(editBlock, "div", "UIInfoBar");
+
+ if( uiInfoBar && (eXo.core.Browser.isIE6() || (eXo.core.Browser.isIE7() && eXo.core.I18n.isRT()))){
+ //resize width of portlet/container only one time
+ if(uiInfoBar.style.width == ""){
+ var dragControlArea = DOMUtil.findFirstDescendantByClass(uiInfoBar, "div", "DragControlArea");
+
+ var portletIcon = DOMUtil.findFirstDescendantByClass(uiInfoBar, "div", "PortletIcon");
+ var editPortletPropertiesIcon = DOMUtil.findFirstDescendantByClass(uiInfoBar, "a", "EditPortletPropertiesIcon");
+ var deletePortletIcon = DOMUtil.findFirstDescendantByClass(uiInfoBar, "a", "DeletePortletIcon");
+
+ var contarnerIcon = DOMUtil.findFirstDescendantByClass(uiInfoBar, "div", "ContainerIcon");
+ var editContainerIcon = DOMUtil.findFirstDescendantByClass(uiInfoBar, "a", "EditContainerIcon");
+ var deleteContainerIcon = DOMUtil.findFirstDescendantByClass(uiInfoBar, "a", "DeleteContainerIcon");
+
+ var uiInfoBarWidth = dragControlArea.offsetWidth;
+
+ if(DOMUtil.hasClass(portlet, "UIPortlet")){
+ uiInfoBarWidth += portletIcon.offsetWidth;
+
+ if(editPortletPropertiesIcon){
+ uiInfoBarWidth += editPortletPropertiesIcon.offsetWidth;
+ }
+
+ if(deletePortletIcon){
+ uiInfoBarWidth += deletePortletIcon.offsetWidth;
+ }
+ }
+
+ if(DOMUtil.hasClass(portlet, "UIContainer")){
+ uiInfoBarWidth += contarnerIcon.offsetWidth
+
+ if(editContainerIcon){
+ uiInfoBarWidth += editContainerIcon.offsetWidth;
+ }
+
+ if(deleteContainerIcon){
+ uiInfoBarWidth += deleteContainerIcon.offsetWidth;
+ }
+ }
+
+ uiInfoBar.style.width= uiInfoBarWidth + 35 + "px";
+ }
+
+ }
+ //resize width of portlet/container control if IE + LTR align END
+
} else {
editBlock.style.display = "none";
if(!DOMUtil.hasClass(portlet, "UIPortlet")) {
13 years, 10 months
gatein SVN: r3789 - in portal/branches/branched-r3776: web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UITree/background and 1 other directories.
by do-not-reply@jboss.org
Author: hoang_to
Date: 2010-08-10 03:52:37 -0400 (Tue, 10 Aug 2010)
New Revision: 3789
Added:
portal/branches/branched-r3776/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UITree/background/NullItemIcon.gif
Modified:
portal/branches/branched-r3776/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UITree/Stylesheet.css
portal/branches/branched-r3776/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UITree/background/Dotted.gif
portal/branches/branched-r3776/webui/core/src/main/java/org/exoplatform/webui/core/UITree.java
Log:
Apply patch for GTNPORTAL-990
Modified: portal/branches/branched-r3776/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UITree/Stylesheet.css
===================================================================
--- portal/branches/branched-r3776/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UITree/Stylesheet.css 2010-08-10 07:38:03 UTC (rev 3788)
+++ portal/branches/branched-r3776/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UITree/Stylesheet.css 2010-08-10 07:52:37 UTC (rev 3789)
@@ -52,7 +52,7 @@
}
.UITrees .Node {
- line-height: 18px;
+ line-height: 19px;
padding-top: 7px;
margin-left: 15px; /* orientation=lt */
margin-right: 15px; /* orientation=rt */
@@ -97,6 +97,15 @@
font-weight: bold;
color: #058ee6;
cursor: pointer;
+}
+
+.UITrees .Node .NullItemIcon {
+ padding-left: 18px; /* orientation=lt */
+ padding-right: 18px; /* orientation=rt */
+ background: url('background/NullItemIcon.gif') no-repeat 6px top; /* orientation=lt */
+ background: url('background/NullItemIcon-rt.gif') no-repeat 98.5% top; /* orientation=rt */
+ -webkit-background: url('background/NullItemIcon-rt.gif') no-repeat 98.2% top; /* orientation=rt */
+ width: 100%; height: auto;
}
/** ################# Icons ###################*/
Modified: portal/branches/branched-r3776/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UITree/background/Dotted.gif
===================================================================
(Binary files differ)
Added: portal/branches/branched-r3776/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UITree/background/NullItemIcon.gif
===================================================================
(Binary files differ)
Property changes on: portal/branches/branched-r3776/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UITree/background/NullItemIcon.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: portal/branches/branched-r3776/webui/core/src/main/java/org/exoplatform/webui/core/UITree.java
===================================================================
--- portal/branches/branched-r3776/webui/core/src/main/java/org/exoplatform/webui/core/UITree.java 2010-08-10 07:38:03 UTC (rev 3788)
+++ portal/branches/branched-r3776/webui/core/src/main/java/org/exoplatform/webui/core/UITree.java 2010-08-10 07:52:37 UTC (rev 3789)
@@ -19,6 +19,7 @@
package org.exoplatform.webui.core;
+import org.exoplatform.portal.config.model.PageNode;
import org.exoplatform.util.ReflectionUtil;
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.commons.serialization.api.annotations.Serialized;
@@ -53,6 +54,11 @@
* The css class name to show the collapse icon
*/
private String colapseIcon = "CollapseIcon";
+
+ /**
+ * The css class name to show the null icon (item has no child)
+ */
+ private String nullItemIcon = "NullItemIcon";
/**
* The css class name to show the selected icon
@@ -265,6 +271,9 @@
iconGroup = selectedIcon;
note = " NodeSelected";
}
+ if(obj instanceof PageNode && ((PageNode)obj).getChildren().size() == 0) {
+ nodeIcon = nullItemIcon;
+ }
if (beanIconField_ != null && beanIconField_.length() > 0)
{
if (getFieldValue(obj, beanIconField_) != null)
@@ -284,11 +293,14 @@
{
builder.append(" <div class=\"").append(nodeIcon).append("\" onclick=\"").append(actionLink).append("\">");
}
- else
+ else if (nodeIcon.equals(colapseIcon))
{
builder.append(" <div class=\"").append(nodeIcon).append(
"\" onclick=\"eXo.portal.UIPortalControl.collapseTree(this)").append("\">");
}
+ else {//Null item
+ builder.append(" <div class=\"").append(nodeIcon).append("\">");
+ }
if (uiPopupMenu_ == null)
{
builder.append(" <a href=\"javascript:void(0);\" class=\"NodeIcon ").append(iconGroup).append(note).append(
13 years, 10 months
gatein SVN: r3788 - in epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US: extras/Authentication_Identity_SSO and 5 other directories.
by do-not-reply@jboss.org
Author: smumford
Date: 2010-08-10 03:38:03 -0400 (Tue, 10 Aug 2010)
New Revision: 3788
Removed:
epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/Gadget_Development_SetupGadgetServer/default142.java
epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default226.xml
epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default227.java
epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default228.xml
epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default229.xml
epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default234.java
epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default237.java
epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default240.java
Modified:
epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/Authentication_Identity_AuthenticationTokenConfiguration/default94.java
epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/Authentication_Identity_SSO/default109.xml
epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/Authentication_Identity_SSO/default112.xml
epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/Authentication_Identity_SSO/default115.xml
epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/Authentication_Identity_SSO/default122.xml
epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/Authentication_Identity_SSO/default124.xml
epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/Authentication_Identity_SSO/default128.xml
epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/Authentication_Identity_SSO/default129.java
epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/Gadget_Development_SetupGadgetServer/default141.java
epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default223.xml
epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default224.xml
epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default225.xml
epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default230.xml
epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default231.xml
epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default232.xml
epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default233.xml
epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default235.java
epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default236.java
epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default238.xml
epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default239.xml
epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default241.xml
epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default242.java
epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/modules/AuthenticationAndIdentity/AuthenticationTokenConfiguration.xml
epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/modules/GadgetDevelopment/SetupGadgetServer.xml
epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/modules/PortletDevelopment/PortletBridge/portlet_development.xml
Log:
JBEPP-370: Final programlisting edits. Fixed callout positioning and removed whitespaces breaking formatting
Modified: epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/Authentication_Identity_AuthenticationTokenConfiguration/default94.java
===================================================================
--- epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/Authentication_Identity_AuthenticationTokenConfiguration/default94.java 2010-08-10 06:50:03 UTC (rev 3787)
+++ epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/Authentication_Identity_AuthenticationTokenConfiguration/default94.java 2010-08-10 07:38:03 UTC (rev 3788)
@@ -1,6 +1,6 @@
- public Token getToken(String id) throws PathNotFoundException, RepositoryException;
- public Token deleteToken(String id) throws PathNotFoundException, RepositoryException;
- public String[] getAllTokens();
- public long getNumberTokens() throws Exception;
- public String createToken(Credentials credentials) throws IllegalArgumentException,NullPointerException;
- public Credentials validateToken(String tokenKey, boolean remove) throws NullPointerException;
+public Token getToken(String id) throws PathNotFoundException, RepositoryException;
+public Token deleteToken(String id) throws PathNotFoundException, RepositoryException;
+public String[] getAllTokens();
+public long getNumberTokens() throws Exception;
+public String createToken(Credentials credentials) throws IllegalArgumentException,NullPointerException;
+public Credentials validateToken(String tokenKey, boolean remove) throws NullPointerException;
\ No newline at end of file
Modified: epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/Authentication_Identity_SSO/default109.xml
===================================================================
--- epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/Authentication_Identity_SSO/default109.xml 2010-08-10 06:50:03 UTC (rev 3787)
+++ epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/Authentication_Identity_SSO/default109.xml 2010-08-10 07:38:03 UTC (rev 3788)
@@ -1,38 +1,30 @@
- <filter>
- <filter-name>LoginRedirectFilter</filter-name>
+<filter>
+ <filter-name>LoginRedirectFilter</filter-name>
<filter-class>org.gatein.sso.agent.filter.LoginRedirectFilter</filter-class>
<init-param>
- <!-- This should point to your SSO authentication server -->
+ <!-- This should point to your SSO authentication server -->
<param-name>LOGIN_URL</param-name>
- <!--
- If casRenewTicket param value of InitiateLoginServlet is: not specified or false
- -->
+ <!-- If casRenewTicket param value of InitiateLoginServlet is: not specified or false -->
<param-value>http://localhost:8888/cas/login?service=http://localhost:8080/portal/priv...</param-value>
- <!--
- If casRenewTicket param value of InitiateLoginServlet is : true
- -->
- <!--
- <param-value>http://localhost:8888/cas/login?service=http://localhost:8080/portal/private
- /classic&renew=true</param-value>
- -->
+ <!-- If casRenewTicket param value of InitiateLoginServlet is : true -->
+ <!-- <param-value>http://localhost:8888/cas/login?service=http://localhost:8080/portal/priv...</param-value> -->
</init-param>
</filter>
<filter>
- <filter-name>CASLogoutFilter</filter-name>
- <filter-class>org.gatein.sso.agent.filter.CASLogoutFilter</filter-class>
- <init-param>
- <!-- This should point to your JOSSO authentication server -->
- <param-name>LOGOUT_URL</param-name>
- <param-value>http://localhost:8888/cas/logout</param-value>
- </init-param>
- </filter>
-
+ <filter-name>CASLogoutFilter</filter-name>
+ <filter-class>org.gatein.sso.agent.filter.CASLogoutFilter</filter-class>
+ <init-param>
+ <!-- This should point to your JOSSO authentication server -->
+ <param-name>LOGOUT_URL</param-name>
+ <param-value>http://localhost:8888/cas/logout</param-value>
+ </init-param>
+ </filter>
<!-- Mapping the filters at the very top of the filter chain -->
<filter-mapping>
<filter-name>LoginRedirectFilter</filter-name>
- <url-pattern>/*</url-pattern>
+ <url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>CASLogoutFilter</filter-name>
<url-pattern>/*</url-pattern>
- </filter-mapping>
+ </filter-mapping>
\ No newline at end of file
Modified: epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/Authentication_Identity_SSO/default112.xml
===================================================================
--- epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/Authentication_Identity_SSO/default112.xml 2010-08-10 06:50:03 UTC (rev 3787)
+++ epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/Authentication_Identity_SSO/default112.xml 2010-08-10 07:38:03 UTC (rev 3788)
@@ -1,4 +1,2 @@
-<!--
-<a class="Login" onclick="$signInAction"><%=_ctx.appRes("UILoginForm.label.Signin")%></a>
--->
-<a class="Login" href="/portal/sso"><%=_ctx.appRes("UILoginForm.label.Signin")%></a>
+<!--<a class="Login" onclick="$signInAction"><%=_ctx.appRes("UILoginForm.label.Signin")%></a>-->
+<a class="Login" href="/portal/sso"><%=_ctx.appRes("UILoginForm.label.Signin")%></a>
\ No newline at end of file
Modified: epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/Authentication_Identity_SSO/default115.xml
===================================================================
--- epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/Authentication_Identity_SSO/default115.xml 2010-08-10 06:50:03 UTC (rev 3787)
+++ epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/Authentication_Identity_SSO/default115.xml 2010-08-10 07:38:03 UTC (rev 3788)
@@ -2,28 +2,26 @@
<filter-name>LoginRedirectFilter</filter-name>
<filter-class>org.gatein.sso.agent.filter.LoginRedirectFilter</filter-class>
<init-param>
- <!-- This should point to your SSO authentication server -->
- <param-name>LOGIN_URL</param-name>
- <param-value>http://localhost:8888/josso/signon/login.do?josso_back_to=http://localhos...
- /private/classic</param-value>
+ <!-- This should point to your SSO authentication server -->
+ <param-name>LOGIN_URL</param-name>
+ <param-value>http://localhost:8888/josso/signon/login.do?josso_back_to=http://localhos...</param-value>
</init-param>
</filter>
<filter>
- <filter-name>JOSSOLogoutFilter</filter-name>
- <filter-class>org.gatein.sso.agent.filter.JOSSOLogoutFilter</filter-class>
+ <filter-name>JOSSOLogoutFilter</filter-name>
+ <filter-class>org.gatein.sso.agent.filter.JOSSOLogoutFilter</filter-class>
<init-param>
- <!-- This should point to your JOSSO authentication server -->
- <param-name>LOGOUT_URL</param-name>
- <param-value>http://localhost:8888/josso/signon/logout.do</param-value>
- </init-param>
- </filter>
-
+ <!-- This should point to your JOSSO authentication server -->
+ <param-name>LOGOUT_URL</param-name>
+ <param-value>http://localhost:8888/josso/signon/logout.do</param-value>
+ </init-param>
+ </filter>
<!-- filters should be placed at the very top of the filter chain -->
<filter-mapping>
<filter-name>LoginRedirectFilter</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
<filter-mapping>
<filter-name>JOSSOLogoutFilter</filter-name>
<url-pattern>/*</url-pattern>
- </filter-mapping>
+ </filter-mapping>
\ No newline at end of file
Modified: epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/Authentication_Identity_SSO/default122.xml
===================================================================
--- epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/Authentication_Identity_SSO/default122.xml 2010-08-10 06:50:03 UTC (rev 3787)
+++ epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/Authentication_Identity_SSO/default122.xml 2010-08-10 07:38:03 UTC (rev 3788)
@@ -1,29 +1,27 @@
<filter>
<filter-name>LoginRedirectFilter</filter-name>
<filter-class>org.gatein.sso.agent.filter.LoginRedirectFilter</filter-class>
- <init-param>
- <!-- This should point to your SSO authentication server -->
- <param-name>LOGIN_URL</param-name>
- <param-value>http://localhost:8888/opensso/UI/Login?realm=gatein&amp;goto=http://l...
- /portal/private/classic</param-value>
+ <init-param>
+ <!-- This should point to your SSO authentication server -->
+ <param-name>LOGIN_URL</param-name>
+ <param-value>http://localhost:8888/opensso/UI/Login?realm=gatein&amp;goto=http://l...</param-value>
</init-param>
</filter>
<filter>
- <filter-name>OpenSSOLogoutFilter</filter-name>
- <filter-class>org.gatein.sso.agent.filter.OpenSSOLogoutFilter</filter-class>
- <init-param>
- <!-- This should point to your OpenSSO authentication server -->
- <param-name>LOGOUT_URL</param-name>
- <param-value>http://localhost:8888/opensso/UI/Logout</param-value>
- </init-param>
- </filter>
-
+ <filter-name>OpenSSOLogoutFilter</filter-name>
+ <filter-class>org.gatein.sso.agent.filter.OpenSSOLogoutFilter</filter-class>
+ <init-param>
+ <!-- This should point to your OpenSSO authentication server -->
+ <param-name>LOGOUT_URL</param-name>
+ <param-value>http://localhost:8888/opensso/UI/Logout</param-value>
+ </init-param>
+ </filter>
<!-- place the filters at the top of the filter chain -->
<filter-mapping>
<filter-name>LoginRedirectFilter</filter-name>
- <url-pattern>/*</url-pattern>
+ <url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>OpenSSOLogoutFilter</filter-name>
<url-pattern>/*</url-pattern>
- </filter-mapping>
+ </filter-mapping>
\ No newline at end of file
Modified: epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/Authentication_Identity_SSO/default124.xml
===================================================================
--- epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/Authentication_Identity_SSO/default124.xml 2010-08-10 06:50:03 UTC (rev 3787)
+++ epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/Authentication_Identity_SSO/default124.xml 2010-08-10 07:38:03 UTC (rev 3788)
@@ -1,14 +1,13 @@
<!-- SPNEGO domain -->
<application-policy name="host">
<authentication>
- <login-module code="com.sun.security.auth.module.Krb5LoginModule"
- flag="required">
+ <login-module code="com.sun.security.auth.module.Krb5LoginModule" flag="required">
<module-option name="storeKey">true</module-option>
- <module-option name="useKeyTab">true</module-option>
- <module-option name="principal">HTTP/server.local.network(a)LOCAL.NETWORK</module-option>
+ <module-option name="useKeyTab">true</module-option>
+ <module-option name="principal">HTTP/server.local.network(a)LOCAL.NETWORK</module-option>
<module-option name="keyTab">/home/user/krb5keytabs/jboss.keytab</module-option>
<module-option name="doNotPrompt">true</module-option>
<module-option name="debug">true</module-option>
</login-module>
</authentication>
- </application-policy>
+ </application-policy>
\ No newline at end of file
Modified: epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/Authentication_Identity_SSO/default128.xml
===================================================================
--- epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/Authentication_Identity_SSO/default128.xml 2010-08-10 06:50:03 UTC (rev 3787)
+++ epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/Authentication_Identity_SSO/default128.xml 2010-08-10 07:38:03 UTC (rev 3788)
@@ -1,22 +1,20 @@
<filter>
<filter-name>LoginRedirectFilter</filter-name>
<filter-class>org.gatein.sso.agent.filter.LoginRedirectFilter</filter-class>
- <init-param>
- <!-- This should point to your SSO authentication server -->
- <param-name>LOGIN_URL</param-name>
- <param-value>/portal/private/classic</param-value>
- </init-param>
+ <init-param>
+ <!-- This should point to your SSO authentication server -->
+ <param-name>LOGIN_URL</param-name>
+ <param-value>/portal/private/classic</param-value>
</filter>
<filter>
<filter-name>SPNEGOFilter</filter-name>
<filter-class>org.gatein.sso.agent.filter.SPNEGOFilter</filter-class>
</filter>
-
<filter-mapping>
<filter-name>LoginRedirectFilter</filter-name>
- <url-pattern>/*</url-pattern>
+ <url-pattern>/*</url-pattern>
</filter-mapping>
- <filter-mapping>
+ <filter-mapping>
<filter-name>SPNEGOFilter</filter-name>
<url-pattern>/*</url-pattern>
- </filter-mapping>
+ </filter-mapping>
\ No newline at end of file
Modified: epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/Authentication_Identity_SSO/default129.java
===================================================================
--- epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/Authentication_Identity_SSO/default129.java 2010-08-10 06:50:03 UTC (rev 3787)
+++ epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/Authentication_Identity_SSO/default129.java 2010-08-10 07:38:03 UTC (rev 3788)
@@ -1,4 +1,2 @@
-<!--
-<a onclick="$signInAction"><%=_ctx.appRes("UILoginForm.label.Signin")%></a>
--->
-<a href="/portal/sso"><%=_ctx.appRes("UILoginForm.label.Signin")%></a>
+<!--<a onclick="$signInAction"><%=_ctx.appRes("UILoginForm.label.Signin")%></a>-->
+<a href="/portal/sso"><%=_ctx.appRes("UILoginForm.label.Signin")%></a>
\ No newline at end of file
Modified: epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/Gadget_Development_SetupGadgetServer/default141.java
===================================================================
--- epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/Gadget_Development_SetupGadgetServer/default141.java 2010-08-10 06:50:03 UTC (rev 3787)
+++ epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/Gadget_Development_SetupGadgetServer/default141.java 2010-08-10 07:38:03 UTC (rev 3788)
@@ -5,4 +5,4 @@
"expires": "86400",
"proxy-url": "http://localhost:8080/eXoGadgetServer/gadgets/proxy?url=",
"concat-url": "http://localhost:8080/eXoGadgetServer/gadgets/concat?"
-},
+},
\ No newline at end of file
Deleted: epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/Gadget_Development_SetupGadgetServer/default142.java
===================================================================
--- epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/Gadget_Development_SetupGadgetServer/default142.java 2010-08-10 06:50:03 UTC (rev 3787)
+++ epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/Gadget_Development_SetupGadgetServer/default142.java 2010-08-10 07:38:03 UTC (rev 3788)
@@ -1 +0,0 @@
--Dhttp.proxyHost=proxyhostURL -Dhttp.proxyPort=proxyPortNumber -Dhttp.proxyUser=someUserName -Dhttp.proxyPassword=somePassword
Modified: epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default223.xml
===================================================================
--- epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default223.xml 2010-08-10 06:50:03 UTC (rev 3787)
+++ epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default223.xml 2010-08-10 07:38:03 UTC (rev 3788)
@@ -1,8 +1,8 @@
- <application>
- <application-extension>
- <bridge:excluded-attributes>
- <bridge:excluded-attribute>foo.bar</bridge:excluded-attribute>
- <bridge:excluded-attribute>foo.baz.*</bridge:excluded-attribute>
- </bridge:excluded-attributes>
- </application-extension>
- </application>
+<application>
+ <application-extension>
+ <bridge:excluded-attributes>
+ <bridge:excluded-attribute>foo.bar</bridge:excluded-attribute>
+ <bridge:excluded-attribute>foo.baz.*</bridge:excluded-attribute>
+ </bridge:excluded-attributes>
+ </application-extension>
+</application>
\ No newline at end of file
Modified: epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default224.xml
===================================================================
--- epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default224.xml 2010-08-10 06:50:03 UTC (rev 3787)
+++ epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default224.xml 2010-08-10 07:38:03 UTC (rev 3788)
@@ -1,7 +1,7 @@
- <navigation-rule>
- <from-view-id>/register.jspx</from-view-id>
- <navigation-case>
- <from-outcome>edit</from-outcome>
- <to-view-id>/edit.jspx?javax.portlet.faces.PortletMode=edit</to-view-id>
- </navigation-case>
- </navigation-rule>
+<navigation-rule>
+ <from-view-id>/register.jspx</from-view-id>
+ <navigation-case>
+ <from-outcome>edit</from-outcome>
+ <to-view-id>/edit.jspx?javax.portlet.faces.PortletMode=edit</to-view-id>
+ </navigation-case>
+</navigation-rule>
\ No newline at end of file
Modified: epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default225.xml
===================================================================
--- epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default225.xml 2010-08-10 06:50:03 UTC (rev 3787)
+++ epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default225.xml 2010-08-10 07:38:03 UTC (rev 3788)
@@ -1,7 +1,7 @@
- <navigation-rule>
- <from-view-id>/edit.jspx*</from-view-id>
- <navigation-case>
- <from-outcome>view</from-outcome>
- <to-view-id>#{sessionScope['javax.portlet.faces.viewIdHistory.view']}</to-view-id>
- </navigation-case>
- </navigation-rule>
+<navigation-rule>
+ <from-view-id>/edit.jspx*</from-view-id>
+ <navigation-case>
+ <from-outcome>view</from-outcome>
+ <to-view-id>#{sessionScope['javax.portlet.faces.viewIdHistory.view']}</to-view-id>
+ </navigation-case>
+</navigation-rule>
\ No newline at end of file
Deleted: epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default226.xml
===================================================================
--- epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default226.xml 2010-08-10 06:50:03 UTC (rev 3787)
+++ epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default226.xml 2010-08-10 07:38:03 UTC (rev 3788)
@@ -1 +0,0 @@
-<to-view-id>
Deleted: epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default227.java
===================================================================
--- epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default227.java 2010-08-10 06:50:03 UTC (rev 3787)
+++ epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default227.java 2010-08-10 07:38:03 UTC (rev 3788)
@@ -1 +0,0 @@
-/viewId?javax.portlet.faces.PortletMode=view&....
Deleted: epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default228.xml
===================================================================
--- epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default228.xml 2010-08-10 06:50:03 UTC (rev 3787)
+++ epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default228.xml 2010-08-10 07:38:03 UTC (rev 3788)
@@ -1 +0,0 @@
-<from-view-id>
Deleted: epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default229.xml
===================================================================
--- epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default229.xml 2010-08-10 06:50:03 UTC (rev 3787)
+++ epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default229.xml 2010-08-10 07:38:03 UTC (rev 3788)
@@ -1 +0,0 @@
-<to-view-id> /edit.jspx?javax.portlet.faces.PortletMode=edit </to-view-id>
Modified: epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default230.xml
===================================================================
--- epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default230.xml 2010-08-10 06:50:03 UTC (rev 3787)
+++ epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default230.xml 2010-08-10 07:38:03 UTC (rev 3788)
@@ -1,4 +1,4 @@
- <init-param>
- <name>javax.portlet.faces.extension.resetModeViewId</name>
- <value>true</value>
- </init-param>
+<init-param>
+ <name>javax.portlet.faces.extension.resetModeViewId</name>
+ <value>true</value>
+</init-param>
\ No newline at end of file
Modified: epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default231.xml
===================================================================
--- epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default231.xml 2010-08-10 06:50:03 UTC (rev 3787)
+++ epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default231.xml 2010-08-10 07:38:03 UTC (rev 3788)
@@ -1,8 +1,8 @@
- <error-page>
- <exception-type>javax.servlet.ServletException</exception-type>
- <location>/faces/error.xhtml</location>
- </error-page>
- <error-page>
- <exception-type>javax.faces.application.ViewExpiredException</exception-type>
- <location>/faces/error.xhtml</location>
- </error-page>
+<error-page>
+ <exception-type>javax.servlet.ServletException</exception-type>
+ <location>/faces/error.xhtml</location>
+</error-page>
+<error-page>
+ <exception-type>javax.faces.application.ViewExpiredException</exception-type>
+ <location>/faces/error.xhtml</location>
+</error-page>
\ No newline at end of file
Modified: epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default232.xml
===================================================================
--- epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default232.xml 2010-08-10 06:50:03 UTC (rev 3787)
+++ epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default232.xml 2010-08-10 07:38:03 UTC (rev 3788)
@@ -1,13 +1,13 @@
- <script type="text/javascript">
- A4J.AJAX.onError = function(req,status,message){
- window.alert("Custom onError handler "+message);
- }
+<script type="text/javascript">
+ A4J.AJAX.onError = function(req,status,message){
+ window.alert("Custom onError handler "+message);
+ }
- A4J.AJAX.onExpired = function(loc,expiredMsg){
- if(window.confirm("Custom onExpired handler "+expiredMsg+" for a location: "+loc)){
- return loc;
- } else {
- return false;
- }
- }
- </script>
+ A4J.AJAX.onExpired = function(loc,expiredMsg){
+ if(window.confirm("Custom onExpired handler "+expiredMsg+" for a location: "+loc)){
+ return loc;
+ } else {
+ return false;
+ }
+ }
+</script>
\ No newline at end of file
Modified: epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default233.xml
===================================================================
--- epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default233.xml 2010-08-10 06:50:03 UTC (rev 3787)
+++ epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default233.xml 2010-08-10 07:38:03 UTC (rev 3788)
@@ -1,4 +1,4 @@
- <context-param>
- <param-name>org.ajax4jsf.handleViewExpiredOnClient</param-name>
- <param-value>true</param-value>
- </context-param>
+<context-param>
+ <param-name>org.ajax4jsf.handleViewExpiredOnClient</param-name>
+ <param-value>true</param-value>
+</context-param>
\ No newline at end of file
Deleted: epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default234.java
===================================================================
--- epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default234.java 2010-08-10 06:50:03 UTC (rev 3787)
+++ epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default234.java 2010-08-10 07:38:03 UTC (rev 3788)
@@ -1 +0,0 @@
- @PortletScope(PortletScope.ScopeType.APPLICATION_SCOPE)
Modified: epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default235.java
===================================================================
--- epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default235.java 2010-08-10 06:50:03 UTC (rev 3787)
+++ epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default235.java 2010-08-10 07:38:03 UTC (rev 3788)
@@ -1 +1 @@
-YourSessionClass yourSessionClass = (YourSessionClass)getRenderRequest().getAttribute("javax.portlet.p./default/seamproject/seamprojectPortletWindow?textHolder");
+YourSessionClass yourSessionClass = (YourSessionClass)getRenderRequest().getAttribute("javax.portlet.p./default/seamproject/seamprojectPortletWindow?textHolder");
\ No newline at end of file
Modified: epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default236.java
===================================================================
--- epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default236.java 2010-08-10 06:50:03 UTC (rev 3787)
+++ epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default236.java 2010-08-10 07:38:03 UTC (rev 3788)
@@ -1,8 +1,8 @@
- Object objSession = FacesContext.getCurrentInstance().getExternalContext().getSession(false);
- try
- {
- if (objSession instanceof PortletSession)
- {
- PortletSession portalSession = (PortletSession)objSession;
- portalSession.setAttribute("your parameter name","parameter value",PortletSession.APPLICATION_SCOPE);
- ...
+Object objSession = FacesContext.getCurrentInstance().getExternalContext().getSession(false);
+try
+{
+ if (objSession instanceof PortletSession)
+ {
+ PortletSession portalSession = (PortletSession)objSession;
+ portalSession.setAttribute("your parameter name","parameter value",PortletSession.APPLICATION_SCOPE);
+ ...
\ No newline at end of file
Deleted: epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default237.java
===================================================================
--- epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default237.java 2010-08-10 06:50:03 UTC (rev 3787)
+++ epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default237.java 2010-08-10 07:38:03 UTC (rev 3788)
@@ -1 +0,0 @@
- #{httpSessionScope['your parameter name']}
Modified: epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default238.xml
===================================================================
--- epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default238.xml 2010-08-10 06:50:03 UTC (rev 3787)
+++ epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default238.xml 2010-08-10 07:38:03 UTC (rev 3788)
@@ -1,4 +1,4 @@
- <h:outputLink value="#{facesContext.externalContext.requestContextPath}/home.xhtml">
- <f:param name="javax.portlet.faces.ViewLink" value="true"/>
- navigate to the test page
- </h:outputLink>
+<h:outputLink value="#{facesContext.externalContext.requestContextPath}/home.xhtml">
+ <f:param name="javax.portlet.faces.ViewLink" value="true"/>
+ navigate to the test page
+</h:outputLink>
\ No newline at end of file
Modified: epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default239.xml
===================================================================
--- epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default239.xml 2010-08-10 06:50:03 UTC (rev 3787)
+++ epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default239.xml 2010-08-10 07:38:03 UTC (rev 3788)
@@ -1,4 +1,4 @@
- <h:commandLink actionListener="#{yourBean.yourListenr}">
- <f:param name="javax.portlet.faces.DirectLink" value="true"/>
- navigate to the test page
- </h:commandLink>
+<h:commandLink actionListener="#{yourBean.yourListenr}">
+ <f:param name="javax.portlet.faces.DirectLink" value="true"/>
+ navigate to the test page
+</h:commandLink>
\ No newline at end of file
Deleted: epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default240.java
===================================================================
--- epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default240.java 2010-08-10 06:50:03 UTC (rev 3787)
+++ epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default240.java 2010-08-10 07:38:03 UTC (rev 3788)
@@ -1 +0,0 @@
- FacesContext.getCurrentInstance().getExternalContext().redirect("http://www.jboss.org");
Modified: epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default241.xml
===================================================================
--- epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default241.xml 2010-08-10 06:50:03 UTC (rev 3787)
+++ epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default241.xml 2010-08-10 07:38:03 UTC (rev 3788)
@@ -1,4 +1,4 @@
- <h:form>
- <h:inputText id="pref" required="true" value="#{mutablePortletPreferencesValues['userName'].value}" />
- <h:commandButton actionListener="#{myBean.savePref}" value="Save Preferences" />
- </h:form>
+<h:form>
+ <h:inputText id="pref" required="true" value="#{mutablePortletPreferencesValues['userName'].value}" />
+ <h:commandButton actionListener="#{myBean.savePref}" value="Save Preferences" />
+</h:form>
\ No newline at end of file
Modified: epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default242.java
===================================================================
--- epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default242.java 2010-08-10 06:50:03 UTC (rev 3787)
+++ epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/extras/PortletBridge_Portlet_Development/default242.java 2010-08-10 07:38:03 UTC (rev 3788)
@@ -1,6 +1,6 @@
- Object request = FacesContext.getCurrentInstance().getExternalContext().getRequest();
- PortletRequest portletRequest = (PortletRequest)request;
- if (request instanceof PortletRequest) {
- try {
- PortletPreferences portletPreferences = portletRequest.getPreferences();
- portletPreferences.store();
+Object request = FacesContext.getCurrentInstance().getExternalContext().getRequest();
+PortletRequest portletRequest = (PortletRequest)request;
+if (request instanceof PortletRequest) {
+ try {
+ PortletPreferences portletPreferences = portletRequest.getPreferences();
+ portletPreferences.store();
\ No newline at end of file
Modified: epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/modules/AuthenticationAndIdentity/AuthenticationTokenConfiguration.xml
===================================================================
--- epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/modules/AuthenticationAndIdentity/AuthenticationTokenConfiguration.xml 2010-08-10 06:50:03 UTC (rev 3787)
+++ epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/modules/AuthenticationAndIdentity/AuthenticationTokenConfiguration.xml 2010-08-10 07:38:03 UTC (rev 3788)
@@ -57,9 +57,9 @@
</para>
<programlistingco>
<areaspec>
- <area coords="7" id="area-Reference_Guide-Authentication_Token_Configuration-Configure_token_services-name" />
- <area coords="8" id="area-Reference_Guide-Authentication_Token_Configuration-Configure_token_services-time" />
- <area coords="9" id="area-Reference_Guide-Authentication_Token_Configuration-Configure_token_services-unit" />
+ <area coords="7 50" id="area-Reference_Guide-Authentication_Token_Configuration-Configure_token_services-name" />
+ <area coords="8 50" id="area-Reference_Guide-Authentication_Token_Configuration-Configure_token_services-time" />
+ <area coords="9 50" id="area-Reference_Guide-Authentication_Token_Configuration-Configure_token_services-unit" />
</areaspec>
<programlisting language="XML" role="XML"><xi:include parse="text" href="../../extras/Authentication_Identity_AuthenticationTokenConfiguration/default95.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
Modified: epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/modules/GadgetDevelopment/SetupGadgetServer.xml
===================================================================
--- epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/modules/GadgetDevelopment/SetupGadgetServer.xml 2010-08-10 06:50:03 UTC (rev 3787)
+++ epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/modules/GadgetDevelopment/SetupGadgetServer.xml 2010-08-10 07:38:03 UTC (rev 3788)
@@ -80,10 +80,8 @@
To allow external gadgets when the server is behind a proxy, add the following code to the beginning of the JVM:
</para>
-<programlisting language="Java" role="Java"><xi:include parse="text" href="../../extras/Gadget_Development_SetupGadgetServer/default142.java" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
-
-<!--<programlisting>-Dhttp.proxyHost=proxyhostURL -Dhttp.proxyPort=proxyPortNumber -Dhttp.proxyUser=someUserName -Dhttp.proxyPassword=somePassword
-</programlisting>-->
+<programlisting language="Java" role="Java"><![CDATA[-Dhttp.proxyHost=proxyhostURL -Dhttp.proxyPort=proxyPortNumber -Dhttp.proxyUser=someUserName -Dhttp.proxyPassword=somePassword]]>
+</programlisting>
</section>
</section>
Modified: epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/modules/PortletDevelopment/PortletBridge/portlet_development.xml
===================================================================
--- epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/modules/PortletDevelopment/PortletBridge/portlet_development.xml 2010-08-10 06:50:03 UTC (rev 3787)
+++ epp/docs/branches/EPP_5_0_Branch/Reference_Guide/en-US/modules/PortletDevelopment/PortletBridge/portlet_development.xml 2010-08-10 07:38:03 UTC (rev 3788)
@@ -88,35 +88,30 @@
Depending on the bridge implementation, when using values from these session scoped attributes or any viewIds which may contain query string parameters it may be necessary to use the wildcard syntax when identifying the rule target. In the above, for example, the
</para>
-<programlisting language="XML" role="XML"><xi:include parse="text" href="../../../extras/PortletBridge_Portlet_Development/default226.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
-
-<!--<programlisting language="XML" role="XML"><![CDATA[<to-view-id>
-]]></programlisting>-->
+<programlisting language="XML" role="XML"><![CDATA[<to-view-id>
+]]></programlisting>
<para>
expression returns a <parameter>viewId</parameter> of the form
</para>
-<programlisting language="Java" role="Java"><xi:include parse="text" href="../../../extras/PortletBridge_Portlet_Development/default227.java" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+<programlisting language="XML" role="XML"><![CDATA[/viewId?javax.portlet.faces.PortletMode=view&....
+]]></programlisting>
-<!--<programlisting language="XML" role="XML"><![CDATA[/viewId?javax.portlet.faces.PortletMode=view&....
-]]></programlisting>-->
<para>
Without wildcarding, when a subsequent navigation occurs from this new view, the navigation rules wouldn't resolve because there wouldn't be an exact match. Likewise, the above <literal>edit.jspx</literal>
</para>
-<programlisting language="XML" role="XML"><xi:include parse="text" href="../../../extras/PortletBridge_Portlet_Development/default228.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+<programlisting language="XML" role="XML"><![CDATA[<from-view-id>
+]]></programlisting>
-<!--<programlisting language="XML" role="XML"><![CDATA[<from-view-id>
-]]></programlisting>-->
<para>
is wildcarded because there are navigation rules that target it that use a query string:
</para>
-<programlisting language="XML" role="XML"><xi:include parse="text" href="../../../extras/PortletBridge_Portlet_Development/default229.xml" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
-
-<!--<programlisting language="XML" role="XML"><![CDATA[
+<programlisting language="XML" role="XML"><![CDATA[
<to-view-id> /edit.jspx?javax.portlet.faces.PortletMode=edit </to-view-id>
-]]></programlisting>-->
+]]></programlisting>
+
<para>
Developers are encouraged to use such wildcarding to ensure they execute properly in the broadest set of bridge implementations.
</para>
@@ -236,11 +231,9 @@
By default, these objects are stored in the <parameter>PORTLET_SCOPE</parameter> but with the annotation below, this class can be pulled out of the <literal>PortletSession</literal> and its values used in other portlets across different <application>Seam</application> applications.
</para>
-<programlisting language="Java" role="Java"><xi:include parse="text" href="../../../extras/PortletBridge_Portlet_Development/default234.java" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+<programlisting language="Java" role="JAVA"><![CDATA[(a)PortletScope(PortletScope.ScopeType.APPLICATION_SCOPE)
+]]></programlisting>
-<!--<programlisting language="XML" role="XML">
- @PortletScope(PortletScope.ScopeType.APPLICATION_SCOPE)
-</programlisting>-->
<para>
Then you would pull the statefull object from the session:
</para>
@@ -277,11 +270,9 @@
Then, in your JSP or Facelets page, you can use:
</para>
-<programlisting language="Java" role="Java"><xi:include parse="text" href="../../../extras/PortletBridge_Portlet_Development/default237.java" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+<programlisting language="XML" role="XML"><![CDATA[#{httpSessionScope['your parameter name']}
+]]></programlisting>
-<!--<programlisting language="XML" role="XML"><![CDATA[
- #{httpSessionScope['your parameter name']}
-]]></programlisting>-->
<para>
<note>
<title>Note to Portlet Developers</title>
@@ -329,11 +320,8 @@
Then in your backing bean, you must call a <parameter>redirect()</parameter>.
</para>
-<programlisting language="Java" role="Java"><xi:include parse="text" href="../../../extras/PortletBridge_Portlet_Development/default240.java" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
-
-<!--<programlisting language="Java" role="JAVA"><![CDATA[
- FacesContext.getCurrentInstance().getExternalContext().redirect("http://www.jboss.org");
-]]></programlisting>-->
+<programlisting language="Java" role="JAVA"><![CDATA[FacesContext.getCurrentInstance().getExternalContext().redirect("http://www.jboss.org");
+]]></programlisting>
</section>
<section id="sect-Reference_Guide-Developing_Portlets_with_the_Bridge-Using_Provided_EL_Variables">
13 years, 10 months