gatein SVN: r4615 - exo/portal/branches.
by do-not-reply@jboss.org
Author: aheritier
Date: 2010-10-10 18:13:41 -0400 (Sun, 10 Oct 2010)
New Revision: 4615
Added:
exo/portal/branches/3.1.5-PLF_REL/
Log:
[maven-release-plugin] copy for branch 3.1.5-PLF_REL
Copied: exo/portal/branches/3.1.5-PLF_REL (from rev 4614, exo/portal/branches/3.1.x)
14 years, 3 months
gatein SVN: r4612 - in portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web: security and 1 other directory.
by do-not-reply@jboss.org
Author: alain_defrance
Date: 2010-10-08 10:42:10 -0400 (Fri, 08 Oct 2010)
New Revision: 4612
Modified:
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/login/InitiateLoginServlet.java
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/login/RememberMeFilter.java
portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/PortalLoginModule.java
Log:
Some bugs fixed
Modified: portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/login/InitiateLoginServlet.java
===================================================================
--- portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/login/InitiateLoginServlet.java 2010-10-08 14:41:51 UTC (rev 4611)
+++ portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/login/InitiateLoginServlet.java 2010-10-08 14:42:10 UTC (rev 4612)
@@ -19,7 +19,6 @@
package org.exoplatform.web.login;
-import org.exoplatform.container.PortalContainer;
import org.exoplatform.container.web.AbstractHttpServlet;
import org.exoplatform.web.security.security.AbstractTokenService;
import org.exoplatform.web.security.security.CookieTokenService;
@@ -27,12 +26,12 @@
import org.gatein.common.logging.LoggerFactory;
import org.gatein.wci.authentication.AuthenticationResult;
import org.gatein.wci.authentication.GenericAuthenticationResult;
+import org.gatein.wci.authentication.ProgrammaticAuthenticationResult;
import org.gatein.wci.security.Credentials;
import org.gatein.wci.impl.DefaultServletContainerFactory;
import java.io.IOException;
-import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
@@ -105,26 +104,18 @@
}
else
{
- try
- {
- // WCI authentication
- AuthenticationResult result = DefaultServletContainerFactory.getInstance().getServletContainer()
- .login(req, resp, credentials.getUsername(), credentials.getPassword());
+ // WCI authentication
+ AuthenticationResult result = DefaultServletContainerFactory.getInstance().getServletContainer()
+ .login(req, resp, credentials.getUsername(), credentials.getPassword());
- log.debug("Login initiated with credentials in session, performing authentication");
- if (result instanceof GenericAuthenticationResult)
- {
- ((GenericAuthenticationResult) result).perform(req, resp);
- }
- else
- {
- resp.sendRedirect(resp.encodeRedirectURL(""));
- }
+ log.debug("Login initiated with credentials in session, performing authentication");
+ if (result instanceof GenericAuthenticationResult)
+ {
+ ((GenericAuthenticationResult) result).perform(req, resp);
}
- catch (Exception e)
+ else if (result instanceof ProgrammaticAuthenticationResult)
{
- // TODO : login fails
- getServletContext().getRequestDispatcher("/portal/errorlogin").forward(req, resp);
+ resp.sendRedirect(resp.encodeRedirectURL((String)req.getAttribute("javax.servlet.forward.request_uri")));
}
}
}
Modified: portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/login/RememberMeFilter.java
===================================================================
--- portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/login/RememberMeFilter.java 2010-10-08 14:41:51 UTC (rev 4611)
+++ portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/login/RememberMeFilter.java 2010-10-08 14:42:10 UTC (rev 4612)
@@ -78,6 +78,7 @@
if (result instanceof GenericAuthenticationResult)
{
((GenericAuthenticationResult) result).perform(req, resp);
+ resp.sendRedirect(s);
}
else if (result instanceof ProgrammaticAuthenticationResult)
{
Modified: portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/PortalLoginModule.java
===================================================================
--- portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/PortalLoginModule.java 2010-10-08 14:41:51 UTC (rev 4611)
+++ portal/branches/wci/component/web/security/src/main/java/org/exoplatform/web/security/PortalLoginModule.java 2010-10-08 14:42:10 UTC (rev 4612)
@@ -24,7 +24,6 @@
import org.exoplatform.services.log.Log;
import org.exoplatform.services.security.jaas.AbstractLoginModule;
import org.exoplatform.web.login.InitiateLoginServlet;
-import org.exoplatform.web.security.security.CookieTokenService;
import org.gatein.wci.security.Credentials;
import javax.security.auth.callback.Callback;
14 years, 3 months
gatein SVN: r4611 - in components/wci/branches/adf: wci/src/main/java/org/gatein/wci/security and 1 other directory.
by do-not-reply@jboss.org
Author: alain_defrance
Date: 2010-10-08 10:41:51 -0400 (Fri, 08 Oct 2010)
New Revision: 4611
Modified:
components/wci/branches/adf/tomcat7/src/main/java/org/gatein/wci/tomcat/TC7ServletContainerContext.java
components/wci/branches/adf/wci/src/main/java/org/gatein/wci/security/WCILoginController.java
Log:
Some bugs fixed
Modified: components/wci/branches/adf/tomcat7/src/main/java/org/gatein/wci/tomcat/TC7ServletContainerContext.java
===================================================================
--- components/wci/branches/adf/tomcat7/src/main/java/org/gatein/wci/tomcat/TC7ServletContainerContext.java 2010-10-08 14:40:14 UTC (rev 4610)
+++ components/wci/branches/adf/tomcat7/src/main/java/org/gatein/wci/tomcat/TC7ServletContainerContext.java 2010-10-08 14:41:51 UTC (rev 4611)
@@ -37,9 +37,12 @@
import org.gatein.common.logging.LoggerFactory;
import org.gatein.wci.RequestDispatchCallback;
import org.gatein.wci.authentication.AuthenticationResult;
+import org.gatein.wci.authentication.GenericAuthentication;
+import org.gatein.wci.authentication.GenericAuthenticationResult;
import org.gatein.wci.authentication.ProgrammaticAuthenticationResult;
import org.gatein.wci.command.CommandDispatcher;
import org.gatein.wci.impl.DefaultServletContainerFactory;
+import org.gatein.wci.security.Credentials;
import org.gatein.wci.spi.ServletContainerContext;
import javax.servlet.ServletContext;
@@ -102,13 +105,32 @@
public AuthenticationResult login(HttpServletRequest request, HttpServletResponse response, String userName, String password) throws ServletException
{
- request.login(userName, password);
+ try
+ {
+ request.login(userName, password);
+ }
+ catch (ServletException se)
+ {
+ try
+ {
+ String ticket = GenericAuthentication.TICKET_SERVICE.createTicket(new Credentials(userName, password));
+ String url = "j_security_check?j_username=" + userName + "&j_password=" + ticket;
+ url = response.encodeRedirectURL(url);
+ response.sendRedirect(url);
+ response.flushBuffer();
+ }
+ catch (Exception ignore)
+ {
+ }
+ return null;
+ }
return new ProgrammaticAuthenticationResult();
}
public void logout(HttpServletRequest request, HttpServletResponse response) throws ServletException
{
request.logout();
+ request.getSession().invalidate();
}
public synchronized void containerEvent(ContainerEvent event)
Modified: components/wci/branches/adf/wci/src/main/java/org/gatein/wci/security/WCILoginController.java
===================================================================
--- components/wci/branches/adf/wci/src/main/java/org/gatein/wci/security/WCILoginController.java 2010-10-08 14:40:14 UTC (rev 4610)
+++ components/wci/branches/adf/wci/src/main/java/org/gatein/wci/security/WCILoginController.java 2010-10-08 14:41:51 UTC (rev 4611)
@@ -27,7 +27,6 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
-import java.lang.reflect.Field;
/**
* @author <a href="mailto:alain.defrance@exoplatform.com">Alain Defrance</a>
@@ -69,6 +68,5 @@
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
{
doGet(req, resp);
- Field f;
}
}
14 years, 3 months
gatein SVN: r4610 - in components/wsrp/trunk: common/src/main/java/org/gatein/wsrp/payload and 3 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-10-08 10:40:14 -0400 (Fri, 08 Oct 2010)
New Revision: 4610
Modified:
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPConstants.java
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPTypeFactory.java
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/payload/PayloadUtils.java
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/payload/XSDTypeConverter.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/NavigationalStateUpdatingHandler.java
components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/EventRequestProcessor.java
components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v2/MarkupTestCase.java
Log:
- GTNWSRP-49: Improvements to marshalling / unmarshalling, which should now be more accurate. Still not working with NetUnity's producer though... and somehow feeling that this should not be that complex. :(
Modified: components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPConstants.java
===================================================================
--- components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPConstants.java 2010-10-08 14:09:25 UTC (rev 4609)
+++ components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPConstants.java 2010-10-08 14:40:14 UTC (rev 4610)
@@ -193,6 +193,23 @@
/** A QName representing the string type defined as part of XML Schemas Part 2 */
public static final QName XSD_STRING = new QName("http://www.w3.org/2001/XMLSchema", "string");
+ public static final QName XSD_INTEGER = new QName("http://www.w3.org/2001/XMLSchema", "integer");
+ public static final QName XSD_INT = new QName("http://www.w3.org/2001/XMLSchema", "int");
+ public static final QName XSD_LONG = new QName("http://www.w3.org/2001/XMLSchema", "long");
+ public static final QName XSD_SHORT = new QName("http://www.w3.org/2001/XMLSchema", "short");
+ public static final QName XSD_DECIMAL = new QName("http://www.w3.org/2001/XMLSchema", "decimal");
+ public static final QName XSD_FLOAT = new QName("http://www.w3.org/2001/XMLSchema", "float");
+ public static final QName XSD_DOUBLE = new QName("http://www.w3.org/2001/XMLSchema", "double");
+ public static final QName XSD_BOOLEAN = new QName("http://www.w3.org/2001/XMLSchema", "boolean");
+ public static final QName XSD_BYTE = new QName("http://www.w3.org/2001/XMLSchema", "byte");
+ public static final QName XSD_DATE_TIME = new QName("http://www.w3.org/2001/XMLSchema", "dateTime");
+ public static final QName XSD_BASE_64_BINARY = new QName("http://www.w3.org/2001/XMLSchema", "base64Binary");
+ public static final QName XSD_HEX_BINARY = new QName("http://www.w3.org/2001/XMLSchema", "hexBinary");
+ public static final QName XSD_UNSIGNED_INT = new QName("http://www.w3.org/2001/XMLSchema", "unsignedInt");
+ public static final QName XSD_UNSIGNED_SHORT = new QName("http://www.w3.org/2001/XMLSchema", "unsignedShort");
+ public static final QName XSD_TIME = new QName("http://www.w3.org/2001/XMLSchema", "time");
+ public static final QName XSD_DATE = new QName("http://www.w3.org/2001/XMLSchema", "date");
+ public static final QName XSD_ANY_SIMPLE_TYPE = new QName("http://www.w3.org/2001/XMLSchema", "anySimpleType");
private WSRPConstants()
{
Modified: components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPTypeFactory.java
===================================================================
--- components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPTypeFactory.java 2010-10-08 14:09:25 UTC (rev 4609)
+++ components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPTypeFactory.java 2010-10-08 14:40:14 UTC (rev 4610)
@@ -1401,10 +1401,7 @@
event.setName(name);
if (payload != null)
{
- Class<? extends Object> type = payload.getClass();
- QName typeName = new QName(type.getName());
- event.setType(typeName);
- event.setPayload(PayloadUtils.getPayloadAsEventPayload(typeName, payload));
+ event.setPayload(PayloadUtils.getPayloadAsEventPayload(event, payload));
}
return event;
}
Modified: components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/payload/PayloadUtils.java
===================================================================
--- components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/payload/PayloadUtils.java 2010-10-08 14:09:25 UTC (rev 4609)
+++ components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/payload/PayloadUtils.java 2010-10-08 14:40:14 UTC (rev 4610)
@@ -24,7 +24,9 @@
package org.gatein.wsrp.payload;
import org.gatein.common.util.ParameterValidation;
+import org.gatein.pc.api.info.EventInfo;
import org.gatein.wsrp.WSRPTypeFactory;
+import org.oasis.wsrp.v2.Event;
import org.oasis.wsrp.v2.EventPayload;
import org.oasis.wsrp.v2.NamedStringArray;
import org.w3c.dom.Document;
@@ -47,26 +49,37 @@
*/
public class PayloadUtils
{
- private final static Map<String, XSDTypeConverter> converters = new HashMap<String, XSDTypeConverter>(19);
+ private final static Map<String, XSDTypeConverter> typeToConverters = new HashMap<String, XSDTypeConverter>(19);
+ private final static Map<QName, XSDTypeConverter> nameToConverters = new HashMap<QName, XSDTypeConverter>(5);
+ private final static Map<Class, XSDTypeConverter> classToConverters = new HashMap<Class, XSDTypeConverter>(19);
static
{
XSDTypeConverter[] converterArray = XSDTypeConverter.values();
for (XSDTypeConverter converter : converterArray)
{
- converters.put(converter.typeName(), converter);
+ typeToConverters.put(converter.typeName(), converter);
+
+ // reverse mapping, unfortunately, there's not a one to one mapping from Java to XSD so converters with
+ // null Java types are considered secondary... Semantic analysis could possibly be used...
+ Class javaType = converter.getJavaType();
+ if (javaType != null)
+ {
+ classToConverters.put(javaType, converter);
+ }
}
}
- public static Serializable getPayloadAsSerializable(QName type, EventPayload payload)
+ public static Serializable getPayloadAsSerializable(Event event, EventInfo eventInfo)
{
// GTNWSRP-49
+ EventPayload payload = event.getPayload();
if (payload == null)
{
return null;
}
- ParameterValidation.throwIllegalArgExceptionIfNull(type, "Payload expected type");
+ ParameterValidation.throwIllegalArgExceptionIfNull(event, "Payload expected type");
Object any = payload.getAny();
if (any == null)
@@ -84,18 +97,22 @@
else
{
Element element = (Element)any;
+ QName type = event.getType();
String typeName = type.getLocalPart();
if (XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(type.getNamespaceURI()))
{
// if we want a default simple datatype, convert it directly
- XSDTypeConverter converter = converters.get(typeName);
+ XSDTypeConverter converter = typeToConverters.get(typeName);
if (converter == null)
{
throw new IllegalArgumentException("Don't know how to deal with standard type: " + type);
}
- return converter.convert(element.getTextContent());
+ // record which converter was used so that we can use it when it's time to marshall it back to XML
+ nameToConverters.put(event.getName(), converter);
+
+ return converter.parseFromXML(element.getTextContent());
}
else
{
@@ -111,13 +128,13 @@
}
catch (Exception e)
{
- throw new IllegalArgumentException("Couldn't unmarshall element " + element + " with expected type " + type, e);
+ throw new IllegalArgumentException("Couldn't unmarshall element " + element + " with expected type " + event, e);
}
}
}
}
- public static EventPayload getPayloadAsEventPayload(QName type, Serializable payload)
+ public static EventPayload getPayloadAsEventPayload(Event eventNeedingType, Serializable payload)
{
if (payload instanceof SerializableNamedStringArray)
{
@@ -127,12 +144,40 @@
else
{
// todo: complete GTNWSRP-49
+ QName name = eventNeedingType.getName();
+
+ // we will use the payload class name as type for serialiation if we can't find something better...
+ Class payloadClass = payload.getClass();
+ QName type = new QName(payloadClass.getName());
+
+ // first, try to get a converter from the event name and use the converter type
+ XSDTypeConverter converter = nameToConverters.get(name);
+ if (converter != null)
+ {
+ // remove from map to avoid memory leak
+ nameToConverters.remove(name);
+
+ type = converter.getXSDType();
+ }
+ else
+ {
+ // otherwise, try to get a converter from the payload class
+ converter = classToConverters.get(payloadClass);
+
+ if (converter != null)
+ {
+ type = converter.getXSDType();
+ }
+ }
+
+ // else, use the class name as type for the serialization
+ eventNeedingType.setType(type);
try
{
- Class payloadClass = payload.getClass();
JAXBContext context = JAXBContext.newInstance(payloadClass);
Marshaller marshaller = context.createMarshaller();
- JAXBElement<Serializable> element = new JAXBElement<Serializable>(type, payloadClass, payload);
+
+ JAXBElement<Serializable> element = new JAXBElement<Serializable>(name, payloadClass, payload);
DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
builderFactory.setNamespaceAware(true);
Document document = builderFactory.newDocumentBuilder().newDocument();
Modified: components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/payload/XSDTypeConverter.java
===================================================================
--- components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/payload/XSDTypeConverter.java 2010-10-08 14:09:25 UTC (rev 4609)
+++ components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/payload/XSDTypeConverter.java 2010-10-08 14:40:14 UTC (rev 4610)
@@ -23,7 +23,13 @@
package org.gatein.wsrp.payload;
+import org.gatein.wsrp.WSRPConstants;
+
+import javax.xml.namespace.QName;
import java.io.Serializable;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.Calendar;
import static javax.xml.bind.DatatypeConverter.*;
@@ -36,146 +42,475 @@
ANY_SIMPLE_TYPE("anySimpleType")
{
@Override
- public Serializable convert(String value)
+ public Serializable parseFromXML(String value)
{
return parseAnySimpleType(value);
}
+
+ @Override
+ public String printToXML(Serializable value)
+ {
+ return printAnySimpleType((String)value);
+ }
+
+ @Override
+ public Class getJavaType()
+ {
+ return Object.class;
+ }
+
+ @Override
+ public QName getXSDType()
+ {
+ return WSRPConstants.XSD_ANY_SIMPLE_TYPE;
+ }
},
BASE64_BINARY("base64Binary")
{
@Override
- public Serializable convert(String value)
+ public Serializable parseFromXML(String value)
{
return parseBase64Binary(value);
}
+
+ @Override
+ public String printToXML(Serializable value)
+ {
+ return printBase64Binary((byte[])value);
+ }
+
+ @Override
+ public Class getJavaType()
+ {
+ return byte[].class;
+ }
+
+ @Override
+ public QName getXSDType()
+ {
+ return WSRPConstants.XSD_BASE_64_BINARY;
+ }
},
BOOLEAN("boolean")
{
@Override
- public Serializable convert(String value)
+ public Serializable parseFromXML(String value)
{
return parseBoolean(value);
}
+
+ @Override
+ public String printToXML(Serializable value)
+ {
+ return printBoolean((Boolean)value);
+ }
+
+ @Override
+ public Class getJavaType()
+ {
+ return boolean.class;
+ }
+
+ @Override
+ public QName getXSDType()
+ {
+ return WSRPConstants.XSD_BOOLEAN;
+ }
},
BYTE("byte")
{
@Override
- public Serializable convert(String value)
+ public Serializable parseFromXML(String value)
{
return parseByte(value);
}
+
+ @Override
+ public String printToXML(Serializable value)
+ {
+ return printByte((Byte)value);
+ }
+
+ @Override
+ public Class getJavaType()
+ {
+ return byte.class;
+ }
+
+ @Override
+ public QName getXSDType()
+ {
+ return WSRPConstants.XSD_BYTE;
+ }
},
DATE("date")
{
@Override
- public Serializable convert(String value)
+ public Serializable parseFromXML(String value)
{
return parseDate(value);
}
+
+ @Override
+ public String printToXML(Serializable value)
+ {
+ return printDate((Calendar)value);
+ }
+
+ @Override
+ public Class getJavaType()
+ {
+// return Calendar.class;
+ return null;
+ }
+
+ @Override
+ public QName getXSDType()
+ {
+ return WSRPConstants.XSD_DATE;
+ }
},
DATE_TIME("dateTime")
{
@Override
- public Serializable convert(String value)
+ public Serializable parseFromXML(String value)
{
return parseDateTime(value);
}
+
+ @Override
+ public String printToXML(Serializable value)
+ {
+ return printDateTime((Calendar)value);
+ }
+
+ @Override
+ public Class getJavaType()
+ {
+ return Calendar.class;
+ }
+
+ @Override
+ public QName getXSDType()
+ {
+ return WSRPConstants.XSD_DATE_TIME;
+ }
},
DECIMAL("decimal")
{
@Override
- public Serializable convert(String value)
+ public Serializable parseFromXML(String value)
{
return parseDecimal(value);
}
+
+ @Override
+ public String printToXML(Serializable value)
+ {
+ return printDecimal((BigDecimal)value);
+ }
+
+ @Override
+ public Class getJavaType()
+ {
+ return BigDecimal.class;
+ }
+
+ @Override
+ public QName getXSDType()
+ {
+ return WSRPConstants.XSD_DECIMAL;
+ }
},
DOUBLE("double")
{
@Override
- public Serializable convert(String value)
+ public Serializable parseFromXML(String value)
{
return parseDouble(value);
}
+
+ @Override
+ public String printToXML(Serializable value)
+ {
+ return printDouble((Double)value);
+ }
+
+ @Override
+ public Class getJavaType()
+ {
+ return double.class;
+ }
+
+ @Override
+ public QName getXSDType()
+ {
+ return WSRPConstants.XSD_DOUBLE;
+ }
},
FLOAT("float")
{
@Override
- public Serializable convert(String value)
+ public Serializable parseFromXML(String value)
{
return parseFloat(value);
}
+
+ @Override
+ public String printToXML(Serializable value)
+ {
+ return printFloat((Float)value);
+ }
+
+ @Override
+ public Class getJavaType()
+ {
+ return float.class;
+ }
+
+ @Override
+ public QName getXSDType()
+ {
+ return WSRPConstants.XSD_FLOAT;
+ }
},
HEX_BINARY("hexBinary")
{
@Override
- public Serializable convert(String value)
+ public Serializable parseFromXML(String value)
{
return parseHexBinary(value);
}
+
+ @Override
+ public String printToXML(Serializable value)
+ {
+ return printHexBinary((byte[])value);
+ }
+
+ @Override
+ public Class getJavaType()
+ {
+// return byte[].class;
+ return null;
+ }
+
+ @Override
+ public QName getXSDType()
+ {
+ return WSRPConstants.XSD_HEX_BINARY;
+ }
},
INT("int")
{
@Override
- public Serializable convert(String value)
+ public Serializable parseFromXML(String value)
{
return parseInt(value);
}
+
+ @Override
+ public String printToXML(Serializable value)
+ {
+ return printInt((Integer)value);
+ }
+
+ @Override
+ public Class getJavaType()
+ {
+ return int.class;
+ }
+
+ @Override
+ public QName getXSDType()
+ {
+ return WSRPConstants.XSD_INT;
+ }
},
INTEGER("integer")
{
@Override
- public Serializable convert(String value)
+ public Serializable parseFromXML(String value)
{
return parseInteger(value);
}
+
+ @Override
+ public String printToXML(Serializable value)
+ {
+ return printInteger((BigInteger)value);
+ }
+
+ @Override
+ public Class getJavaType()
+ {
+ return BigInteger.class;
+ }
+
+ @Override
+ public QName getXSDType()
+ {
+ return WSRPConstants.XSD_INTEGER;
+ }
},
LONG("long")
{
@Override
- public Serializable convert(String value)
+ public Serializable parseFromXML(String value)
{
return parseLong(value);
}
+
+ @Override
+ public String printToXML(Serializable value)
+ {
+ return printLong((Long)value);
+ }
+
+ @Override
+ public Class getJavaType()
+ {
+ return long.class;
+ }
+
+ @Override
+ public QName getXSDType()
+ {
+ return WSRPConstants.XSD_LONG;
+ }
},
SHORT("short")
{
@Override
- public Serializable convert(String value)
+ public Serializable parseFromXML(String value)
{
return parseShort(value);
}
+
+ @Override
+ public String printToXML(Serializable value)
+ {
+ return printShort((Short)value);
+ }
+
+ @Override
+ public Class getJavaType()
+ {
+ return short.class;
+ }
+
+ @Override
+ public QName getXSDType()
+ {
+ return WSRPConstants.XSD_SHORT;
+ }
},
STRING("string")
{
@Override
- public Serializable convert(String value)
+ public Serializable parseFromXML(String value)
{
return parseString(value);
}
+
+ @Override
+ public String printToXML(Serializable value)
+ {
+ return printString((String)value);
+ }
+
+ @Override
+ public Class getJavaType()
+ {
+ return String.class;
+ }
+
+ @Override
+ public QName getXSDType()
+ {
+ return WSRPConstants.XSD_STRING;
+ }
},
TIME("time")
{
@Override
- public Serializable convert(String value)
+ public Serializable parseFromXML(String value)
{
return parseTime(value);
}
+
+ @Override
+ public String printToXML(Serializable value)
+ {
+ return printTime((Calendar)value);
+ }
+
+ @Override
+ public Class getJavaType()
+ {
+// return Calendar.class;
+ return null;
+ }
+
+ @Override
+ public QName getXSDType()
+ {
+ return WSRPConstants.XSD_TIME;
+ }
},
UNSIGNED_INT("unsignedInt")
{
@Override
- public Serializable convert(String value)
+ public Serializable parseFromXML(String value)
{
return parseUnsignedInt(value);
}
+
+ @Override
+ public String printToXML(Serializable value)
+ {
+ return printUnsignedInt((Long)value);
+ }
+
+ @Override
+ public Class getJavaType()
+ {
+// return long.class;
+ return null;
+ }
+
+ @Override
+ public QName getXSDType()
+ {
+ return WSRPConstants.XSD_UNSIGNED_INT;
+ }
},
UNSIGNED_SHORT("unsignedShort")
{
@Override
- public Serializable convert(String value)
+ public Serializable parseFromXML(String value)
{
return parseUnsignedShort(value);
}
+
+ @Override
+ public String printToXML(Serializable value)
+ {
+ return printUnsignedShort((Integer)value);
+ }
+
+ @Override
+ public Class getJavaType()
+ {
+// return int.class;
+ return null;
+ }
+
+ @Override
+ public QName getXSDType()
+ {
+ return WSRPConstants.XSD_UNSIGNED_SHORT;
+ }
};
private XSDTypeConverter(String typeName)
@@ -190,5 +525,11 @@
return typeName;
}
- public abstract Serializable convert(String value);
+ public abstract Serializable parseFromXML(String value);
+
+ public abstract String printToXML(Serializable value);
+
+ public abstract Class getJavaType();
+
+ public abstract QName getXSDType();
}
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-10-08 14:09:25 UTC (rev 4609)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/handlers/NavigationalStateUpdatingHandler.java 2010-10-08 14:40:14 UTC (rev 4610)
@@ -26,6 +26,7 @@
import org.gatein.common.util.ParameterValidation;
import org.gatein.pc.api.OpaqueStateString;
import org.gatein.pc.api.StateEvent;
+import org.gatein.pc.api.info.EventInfo;
import org.gatein.pc.api.invocation.PortletInvocation;
import org.gatein.pc.api.invocation.response.UpdateNavigationalStateResponse;
import org.gatein.pc.api.spi.InstanceContext;
@@ -33,7 +34,6 @@
import org.gatein.wsrp.consumer.WSRPConsumerImpl;
import org.gatein.wsrp.payload.PayloadUtils;
import org.oasis.wsrp.v2.Event;
-import org.oasis.wsrp.v2.EventPayload;
import org.oasis.wsrp.v2.NamedString;
import org.oasis.wsrp.v2.NavigationalContext;
import org.oasis.wsrp.v2.PortletContext;
@@ -96,8 +96,8 @@
{
for (Event event : events)
{
- EventPayload payload = event.getPayload();
- result.queueEvent(new UpdateNavigationalStateResponse.Event(event.getName(), PayloadUtils.getPayloadAsSerializable(event.getType(), payload)));
+ EventInfo eventInfo = consumer.getProducerInfo().getInfoForEvent(event.getName());
+ result.queueEvent(new UpdateNavigationalStateResponse.Event(event.getName(), PayloadUtils.getPayloadAsSerializable(event, eventInfo)));
}
}
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/EventRequestProcessor.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/EventRequestProcessor.java 2010-10-08 14:09:25 UTC (rev 4609)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/wsrp/producer/handlers/processors/EventRequestProcessor.java 2010-10-08 14:40:14 UTC (rev 4610)
@@ -37,7 +37,6 @@
import org.gatein.wsrp.spec.v2.WSRP2ExceptionFactory;
import org.oasis.wsrp.v2.Event;
import org.oasis.wsrp.v2.EventParams;
-import org.oasis.wsrp.v2.EventPayload;
import org.oasis.wsrp.v2.HandleEvents;
import org.oasis.wsrp.v2.HandleEventsResponse;
import org.oasis.wsrp.v2.InvalidHandle;
@@ -150,10 +149,8 @@
Event event = events.get(0);
eventInvocation.setName(event.getName());
- EventPayload payload = event.getPayload();
+ eventInvocation.setPayload(PayloadUtils.getPayloadAsSerializable(event, null));
- eventInvocation.setPayload(PayloadUtils.getPayloadAsSerializable(event.getType(), payload));
-
return eventInvocation;
}
Modified: components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v2/MarkupTestCase.java
===================================================================
--- components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v2/MarkupTestCase.java 2010-10-08 14:09:25 UTC (rev 4609)
+++ components/wsrp/trunk/wsrp-producer-war/src/test/java/org/gatein/wsrp/protocol/v2/MarkupTestCase.java 2010-10-08 14:40:14 UTC (rev 4610)
@@ -842,8 +842,8 @@
assertEquals(1, events.size());
Event event = events.get(0);
assertEquals(new QName("urn:jboss:gatein:samples:event", "eventsample"), event.getName());
- assertEquals(new QName("java.lang.String"), event.getType());
- assertEquals("param-value", PayloadUtils.getPayloadAsSerializable(event.getType(), event.getPayload()));
+ assertEquals(WSRPConstants.XSD_STRING, event.getType());
+ assertEquals("param-value", PayloadUtils.getPayloadAsSerializable(event, null));
// send event
HandleEvents handleEvents = WSRPTypeFactory.createHandleEvents(null,
14 years, 3 months
gatein SVN: r4609 - components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-10-08 10:09:25 -0400 (Fri, 08 Oct 2010)
New Revision: 4609
Modified:
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/ServiceWrapper.java
Log:
- Need to pass a String, not an int...
Modified: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/ServiceWrapper.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/ServiceWrapper.java 2010-10-08 13:50:58 UTC (rev 4608)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/services/ServiceWrapper.java 2010-10-08 14:09:25 UTC (rev 4609)
@@ -109,7 +109,7 @@
// better interoperability as Oracle's producer doesn't support it, for example.
// See https://jira.jboss.org/jira/browse/JBWS-2884 and
// http://community.jboss.org/wiki/JBossWS-NativeUserGuide#Chunked_encoding_...
- requestContext.put(JBOSS_WS_STUBEXT_PROPERTY_CHUNKED_ENCODING_SIZE, 0);
+ requestContext.put(JBOSS_WS_STUBEXT_PROPERTY_CHUNKED_ENCODING_SIZE, "0");
// Add client side handler via JAX-WS API
Binding binding = bindingProvider.getBinding();
14 years, 3 months
gatein SVN: r4608 - in components/wsrp/trunk/common/src: test/java/org/gatein/wsrp/other and 1 other directory.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-10-08 09:50:58 -0400 (Fri, 08 Oct 2010)
New Revision: 4608
Modified:
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPPortletURL.java
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPResourceURL.java
components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/other/WSRPPortletURLTestCase.java
Log:
- GTNWSRP-96: properly set resource state in WSRPResourceURL.
Modified: components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPPortletURL.java
===================================================================
--- components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPPortletURL.java 2010-10-08 13:28:01 UTC (rev 4607)
+++ components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPPortletURL.java 2010-10-08 13:50:58 UTC (rev 4608)
@@ -65,15 +65,19 @@
private WindowState windowState;
+ protected StateString navigationalState;
+
/** Are we using strict rewriting parameters validation mode? */
protected static boolean strict = true;
+
/** Holds extra parameters if we are in relaxed validation mode */
private Map<String, String> extraParams;
+
/** Holds extra data after URL in relaxed mode */
protected String extra;
+
/** Remember position of extra parameters wrt end token */
private boolean extraParamsAfterEndToken = false;
- protected StateString navigationalState;
public static void setStrict(boolean strict)
{
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-10-08 13:28:01 UTC (rev 4607)
+++ components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPResourceURL.java 2010-10-08 13:50:58 UTC (rev 4608)
@@ -25,6 +25,7 @@
import org.gatein.common.net.URLTools;
import org.gatein.pc.api.Mode;
+import org.gatein.pc.api.OpaqueStateString;
import org.gatein.pc.api.ResourceURL;
import org.gatein.pc.api.StateString;
import org.gatein.pc.api.WindowState;
@@ -98,6 +99,11 @@
{
createURLParameter(sb, WSRP2RewritingConstants.RESOURCE_PREFER_OPERATION, Boolean.toString(preferOperation));
}
+
+ if (resourceState != null)
+ {
+ createURLParameter(sb, WSRP2RewritingConstants.RESOURCE_STATE, resourceState.getStringValue());
+ }
}
@Override
@@ -112,6 +118,14 @@
params.remove(WSRPRewritingConstants.RESOURCE_REQUIRES_REWRITE);
}
+ // navigational state
+ String resourceState = getRawParameterValueFor(params, WSRP2RewritingConstants.RESOURCE_STATE);
+ if (resourceState != null)
+ {
+ this.resourceState = new OpaqueStateString(resourceState);
+ params.remove(WSRP2RewritingConstants.RESOURCE_STATE);
+ }
+
String url = getRawParameterValueFor(params, WSRPRewritingConstants.RESOURCE_URL);
if (url != null)
{
@@ -133,12 +147,12 @@
{
resourceId = resourceIDParam;
}
-
+
// we either need a resource Id or (requiredRewrite and url)
if (resourceIDParam == null && (requireRewrite == null || url == null))
{
throw new IllegalArgumentException("The parsed parameters don't are not valid for a resource url. It must contain either a "
- + WSRP2RewritingConstants.RESOURCE_ID + " or " + WSRPRewritingConstants.RESOURCE_URL + " and " + WSRPRewritingConstants.RESOURCE_REQUIRES_REWRITE + " parameter in " + originalURL);
+ + WSRP2RewritingConstants.RESOURCE_ID + " or " + WSRPRewritingConstants.RESOURCE_URL + " and " + WSRPRewritingConstants.RESOURCE_REQUIRES_REWRITE + " parameter in " + originalURL);
}
String preferOperationParam = getRawParameterValueFor(params, WSRP2RewritingConstants.RESOURCE_PREFER_OPERATION);
Modified: components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/other/WSRPPortletURLTestCase.java
===================================================================
--- components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/other/WSRPPortletURLTestCase.java 2010-10-08 13:28:01 UTC (rev 4607)
+++ components/wsrp/trunk/common/src/test/java/org/gatein/wsrp/other/WSRPPortletURLTestCase.java 2010-10-08 13:50:58 UTC (rev 4608)
@@ -24,8 +24,13 @@
package org.gatein.wsrp.other;
import junit.framework.TestCase;
+import org.gatein.pc.api.ContainerURL;
import org.gatein.pc.api.Mode;
+import org.gatein.pc.api.ParametersStateString;
+import org.gatein.pc.api.ResourceURL;
+import org.gatein.pc.api.StateString;
import org.gatein.pc.api.WindowState;
+import org.gatein.pc.api.cache.CacheLevel;
import org.gatein.wsrp.WSRPActionURL;
import org.gatein.wsrp.WSRPPortletURL;
import org.gatein.wsrp.WSRPRenderURL;
@@ -33,6 +38,7 @@
import org.gatein.wsrp.WSRPRewritingConstants;
import org.gatein.wsrp.spec.v2.WSRP2RewritingConstants;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
@@ -61,20 +67,20 @@
WSRPResourceURL resource = (WSRPResourceURL)url;
assertFalse(resource.requiresRewrite());
assertEquals("http://test.com/images/test.gif", resource.getResourceURL().toExternalForm());
-
+
//resource.getResourceId will not return the actual resource id, but an encoded resource map used to determine how to access the resource
Map<String, String> resourceMap = WSRPResourceURL.decodeResource(resource.getResourceId());
String resourceURL = resourceMap.get(WSRPRewritingConstants.RESOURCE_URL);
assertEquals("http://test.com/images/test.gif", resourceURL);
assertNull(resourceMap.get(WSRP2RewritingConstants.RESOURCE_ID));
- assertEquals("false",resourceMap.get(WSRP2RewritingConstants.RESOURCE_PREFER_OPERATION));
+ assertEquals("false", resourceMap.get(WSRP2RewritingConstants.RESOURCE_PREFER_OPERATION));
}
-
+
public void testResourceID()
{
String expected = "wsrp_rewrite?wsrp-urlType=resource&wsrp-resourceID=resource_123" +
- "&wsrp-requiresRewrite=false/wsrp_rewrite";
+ "&wsrp-requiresRewrite=false/wsrp_rewrite";
WSRPPortletURL url = WSRPPortletURL.create(expected);
assertTrue(url instanceof WSRPResourceURL);
@@ -86,15 +92,15 @@
Map<String, String> resourceMap = WSRPResourceURL.decodeResource(resource.getResourceId());
String resourceID = resourceMap.get(WSRP2RewritingConstants.RESOURCE_ID);
assertEquals("resource_123", resourceID);
-
+
assertNull(resourceMap.get(WSRPRewritingConstants.RESOURCE_URL));
assertEquals("false", resourceMap.get(WSRP2RewritingConstants.RESOURCE_PREFER_OPERATION));
}
-
+
public void testResources()
{
String expected = "wsrp_rewrite?wsrp-urlType=resource&wsrp-resourceID=resource_123" +
- "&wsrp-url=http%3A%2F%2Ftest.com%2Fimages%2Ftest.gif&wsrp-requiresRewrite=false/wsrp_rewrite";
+ "&wsrp-url=http%3A%2F%2Ftest.com%2Fimages%2Ftest.gif&wsrp-requiresRewrite=false/wsrp_rewrite";
WSRPPortletURL url = WSRPPortletURL.create(expected);
assertTrue(url instanceof WSRPResourceURL);
@@ -106,16 +112,16 @@
Map<String, String> resourceMap = WSRPResourceURL.decodeResource(resource.getResourceId());
String resourceID = resourceMap.get(WSRP2RewritingConstants.RESOURCE_ID);
assertEquals("resource_123", resourceID);
-
+
String resourceURL = resourceMap.get(WSRPRewritingConstants.RESOURCE_URL);
assertEquals("http://test.com/images/test.gif", resourceURL);
- assertEquals("false",resourceMap.get(WSRP2RewritingConstants.RESOURCE_PREFER_OPERATION));
+ assertEquals("false", resourceMap.get(WSRP2RewritingConstants.RESOURCE_PREFER_OPERATION));
}
-
+
public void testResourcesNoRequiresRewrite()
{
String expected = "wsrp_rewrite?wsrp-urlType=resource&wsrp-resourceID=resource_123" +
- "&wsrp-url=http%3A%2F%2Ftest.com%2Fimages%2Ftest.gif&/wsrp_rewrite";
+ "&wsrp-url=http%3A%2F%2Ftest.com%2Fimages%2Ftest.gif&/wsrp_rewrite";
WSRPPortletURL url = WSRPPortletURL.create(expected);
assertTrue(url instanceof WSRPResourceURL);
@@ -127,16 +133,16 @@
Map<String, String> resourceMap = WSRPResourceURL.decodeResource(resource.getResourceId());
String resourceID = resourceMap.get(WSRP2RewritingConstants.RESOURCE_ID);
assertEquals("resource_123", resourceID);
-
+
String resourceURL = resourceMap.get(WSRPRewritingConstants.RESOURCE_URL);
assertEquals("http://test.com/images/test.gif", resourceURL);
- assertEquals("false",resourceMap.get(WSRP2RewritingConstants.RESOURCE_PREFER_OPERATION));
+ assertEquals("false", resourceMap.get(WSRP2RewritingConstants.RESOURCE_PREFER_OPERATION));
}
-
+
public void testResourcesNoResourceURL()
{
String expected = "wsrp_rewrite?wsrp-urlType=resource&wsrp-resourceID=resource_123" +
- "&wsrp-requiresRewrite=false/wsrp_rewrite";
+ "&wsrp-requiresRewrite=false/wsrp_rewrite";
WSRPPortletURL url = WSRPPortletURL.create(expected);
assertTrue(url instanceof WSRPResourceURL);
@@ -147,14 +153,14 @@
Map<String, String> resourceMap = WSRPResourceURL.decodeResource(resource.getResourceId());
String resourceID = resourceMap.get(WSRP2RewritingConstants.RESOURCE_ID);
assertEquals("resource_123", resourceID);
-
- assertEquals("false",resourceMap.get(WSRP2RewritingConstants.RESOURCE_PREFER_OPERATION));
+
+ assertEquals("false", resourceMap.get(WSRP2RewritingConstants.RESOURCE_PREFER_OPERATION));
}
-
+
public void testPreferOperation()
{
String expected = "wsrp_rewrite?wsrp-urlType=resource&wsrp-resourceID=resource_123" +
- "&wsrp-url=http%3A%2F%2Ftest.com%2Fimages%2Ftest.gif&wsrp-preferOperation=true&wsrp-requiresRewrite=false/wsrp_rewrite";
+ "&wsrp-url=http%3A%2F%2Ftest.com%2Fimages%2Ftest.gif&wsrp-preferOperation=true&wsrp-requiresRewrite=false/wsrp_rewrite";
WSRPPortletURL url = WSRPPortletURL.create(expected);
assertTrue(url instanceof WSRPResourceURL);
@@ -166,7 +172,7 @@
Map<String, String> resourceMap = WSRPResourceURL.decodeResource(resource.getResourceId());
String resourceID = resourceMap.get(WSRP2RewritingConstants.RESOURCE_ID);
assertEquals("resource_123", resourceID);
-
+
String resourceURL = resourceMap.get(WSRPRewritingConstants.RESOURCE_URL);
assertEquals("http://test.com/images/test.gif", resourceURL);
@@ -174,6 +180,32 @@
assertEquals("true", preferOperation);
}
+ public void testShouldProperlyTransmitResourceState()
+ {
+ // create URL from container
+ ResourceURL resourceURL = new TestResourceURL("resparam", "resvalue");
+ WSRPPortletURL url = WSRPPortletURL.create(resourceURL, false);
+
+ assertTrue(url instanceof WSRPResourceURL);
+ WSRPResourceURL resource = (WSRPResourceURL)url;
+ StateString resourceState = resource.getResourceState();
+ assertNotNull(resourceState);
+
+ // serialize URL to WSRP string format
+ String resourceAsString = resource.toString();
+
+ // and re-create it
+ url = WSRPPortletURL.create(resourceAsString);
+
+ // check that we have indeed the same state
+ assertTrue(url instanceof WSRPResourceURL);
+ resource = (WSRPResourceURL)url;
+ resourceState = resource.getResourceState();
+ assertNotNull(resourceState);
+ Map<String, String[]> state = StateString.decodeOpaqueValue(resourceState.getStringValue());
+ assertEquals("resvalue", state.get("resparam")[0]);
+ }
+
/** Declare a secure interaction back to the Portlet */
public void testSecureInteraction()
{
@@ -391,4 +423,97 @@
assertTrue(e.getLocalizedMessage().contains(mustBeInException));
}
}
+
+ private static class TestContainerURL implements ContainerURL
+ {
+ private Mode mode;
+ private WindowState ws;
+ private StateString ns;
+ private Map<String, String> props;
+
+ static final StateString DEFAULT_NS;
+ static final Map<String, String[]> DEFAULT_PARAMS = new HashMap<String, String[]>(3);
+ static final String PARAM = "param";
+ static final String VALUE = "value";
+
+ static
+ {
+ DEFAULT_PARAMS.put(PARAM, new String[]{VALUE});
+ DEFAULT_NS = ParametersStateString.create(DEFAULT_PARAMS);
+ }
+
+ private TestContainerURL(Mode mode, WindowState ws, StateString ns, Map<String, String> props)
+ {
+ this.mode = mode;
+ this.ws = ws;
+ this.ns = ns;
+ this.props = props;
+ }
+
+ public Mode getMode()
+ {
+ return mode;
+ }
+
+ public WindowState getWindowState()
+ {
+ return ws;
+ }
+
+ public StateString getNavigationalState()
+ {
+ return ns;
+ }
+
+ public Map<String, String> getProperties()
+ {
+ return props;
+ }
+ }
+
+ private static class TestResourceURL extends TestContainerURL implements ResourceURL
+ {
+ private static final String RESID = "resid";
+ private String id;
+ private StateString state;
+ private CacheLevel cache;
+
+ private TestResourceURL(String id, StateString state, CacheLevel cache)
+ {
+ super(Mode.VIEW, WindowState.NORMAL, DEFAULT_NS, null);
+ init(id, state, cache);
+ }
+
+ private void init(String id, StateString state, CacheLevel cache)
+ {
+ this.id = id;
+ this.state = state;
+ this.cache = cache;
+ }
+
+ private TestResourceURL(String param, String value)
+ {
+ super(Mode.VIEW, WindowState.NORMAL, DEFAULT_NS, null);
+
+ HashMap<String, String[]> params = new HashMap<String, String[]>(3);
+ params.put(param, new String[]{value});
+
+ init(RESID, ParametersStateString.create(params), CacheLevel.FULL);
+ }
+
+ public String getResourceId()
+ {
+ return id;
+ }
+
+ public StateString getResourceState()
+ {
+ return state;
+ }
+
+ public CacheLevel getCacheability()
+ {
+ return cache;
+ }
+ }
}
\ No newline at end of file
14 years, 3 months
gatein SVN: r4607 - in exo/portal/branches/3.1.x/packaging: ear and 1 other directory.
by do-not-reply@jboss.org
Author: hoang_to
Date: 2010-10-08 09:28:01 -0400 (Fri, 08 Oct 2010)
New Revision: 4607
Added:
exo/portal/branches/3.1.x/packaging/ear/
exo/portal/branches/3.1.x/packaging/ear/pom.xml
Modified:
exo/portal/branches/3.1.x/packaging/pom.xml
Log:
EXOGTN-97: JBoss EAR packaging
Added: exo/portal/branches/3.1.x/packaging/ear/pom.xml
===================================================================
--- exo/portal/branches/3.1.x/packaging/ear/pom.xml (rev 0)
+++ exo/portal/branches/3.1.x/packaging/ear/pom.xml 2010-10-08 13:28:01 UTC (rev 4607)
@@ -0,0 +1,237 @@
+<!--
+
+ Copyright (C) 2009 eXo Platform SAS.
+
+ 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.
+
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.packaging</artifactId>
+ <version>3.1.5-PLF-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>jboss-ear-gatein</artifactId>
+ <packaging>ear</packaging>
+ <name>GateIn Portal JBoss Ear</name>
+ <url>http://www.exoplatform.org</url>
+ <description>GateIn Portal JBoss Ear</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.web.eXoResources</artifactId>
+ <version>3.1.5-PLF-SNAPSHOT</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.web.portal</artifactId>
+ <version>3.1.5-PLF-SNAPSHOT</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.portlet.dashboard</artifactId>
+ <version>3.1.5-PLF-SNAPSHOT</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.portlet.exoadmin</artifactId>
+ <version>3.1.5-PLF-SNAPSHOT</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.portlet.web</artifactId>
+ <version>3.1.5-PLF-SNAPSHOT</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.eXoGadgets</artifactId>
+ <version>3.1.5-PLF-SNAPSHOT</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.gadgets-server</artifactId>
+ <version>3.1.5-PLF-SNAPSHOT</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.web.rest</artifactId>
+ <version>3.1.5-PLF-SNAPSHOT</version>
+ <type>war</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.component.application-registry</artifactId>
+ <version>3.1.5-PLF-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.gatein.wsrp</groupId>
+ <artifactId>wsrp-admin-gui</artifactId>
+ <version>${org.gatein.wsrp.version}</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.wsrp</groupId>
+ <artifactId>wsrp-producer</artifactId>
+ <version>${org.gatein.wsrp.version}</version>
+ <type>war</type>
+ </dependency>
+
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-ear-plugin</artifactId>
+ <configuration>
+ <displayName>gatein</displayName>
+ <defaultLibBundleDir>lib</defaultLibBundleDir>
+ <modules>
+ <webModule>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.web.eXoResources</artifactId>
+ <contextRoot>eXoResources</contextRoot>
+ <bundleFileName>01eXoResources.war</bundleFileName>
+ <unpack>true</unpack>
+ </webModule>
+ <webModule>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.web.portal</artifactId>
+ <contextRoot>portal</contextRoot>
+ <bundleFileName>02portal.war</bundleFileName>
+ <unpack>true</unpack>
+ </webModule>
+ <webModule>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.portlet.dashboard</artifactId>
+ <contextRoot>dashboard</contextRoot>
+ <bundleFileName>dashboard.war</bundleFileName>
+ </webModule>
+ <webModule>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.portlet.exoadmin</artifactId>
+ <contextRoot>exoadmin</contextRoot>
+ <bundleFileName>exoadmin.war</bundleFileName>
+ </webModule>
+ <webModule>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.portlet.web</artifactId>
+ <contextRoot>web</contextRoot>
+ <bundleFileName>web.war</bundleFileName>
+ </webModule>
+ <webModule>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.eXoGadgets</artifactId>
+ <contextRoot>eXoGadgets</contextRoot>
+ <bundleFileName>eXoGadgets.war</bundleFileName>
+ </webModule>
+ <webModule>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.gadgets-server</artifactId>
+ <contextRoot>eXoGadgetServer</contextRoot>
+ <bundleFileName>eXoGadgetServer.war</bundleFileName>
+ </webModule>
+ <webModule>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.web.rest</artifactId>
+ <contextRoot>rest</contextRoot>
+ <bundleFileName>rest.war</bundleFileName>
+ </webModule>
+
+ <webModule>
+ <groupId>org.gatein.wsrp</groupId>
+ <artifactId>wsrp-admin-gui</artifactId>
+ <contextRoot>wsrp-admin-gui</contextRoot>
+ <bundleFileName>wsrp-admin-gui.war</bundleFileName>
+ </webModule>
+
+ <webModule>
+ <groupId>org.gatein.wsrp</groupId>
+ <artifactId>wsrp-producer</artifactId>
+ <contextRoot>wsrp-producer</contextRoot>
+ <bundleFileName>wsrp-producer.war</bundleFileName>
+ </webModule>
+
+ </modules>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>unpack</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.server.jboss.patch-ear</artifactId>
+ <version>3.1.5-PLF-SNAPSHOT</version>
+ <type>jar</type>
+ <outputDirectory>${project.build.directory}/temp</outputDirectory>
+ <includes>server/default/deploy/gatein.ear/**/*.xml</includes>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy_integration.war</id>
+ <phase>test</phase>
+ <configuration>
+ <tasks>
+ <mkdir dir="${project.build.directory}/jboss-ear-gatein-${project.version}/integration.war" />
+ <copy todir="${project.build.directory}/jboss-ear-gatein-${project.version}/integration.war" >
+ <fileset dir="${project.build.directory}/temp/server/default/deploy/gatein.ear/integration.war" />
+ </copy>
+ <copy todir="${project.build.directory}/jboss-ear-gatein-${project.version}/META-INF" >
+ <fileset dir="${project.build.directory}/temp/server/default/deploy/gatein.ear/META-INF/" />
+ </copy>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Modified: exo/portal/branches/3.1.x/packaging/pom.xml
===================================================================
--- exo/portal/branches/3.1.x/packaging/pom.xml 2010-10-08 12:25:39 UTC (rev 4606)
+++ exo/portal/branches/3.1.x/packaging/pom.xml 2010-10-08 13:28:01 UTC (rev 4607)
@@ -32,6 +32,7 @@
<name>GateIn Portal Packaging</name>
<modules>
+ <module>ear</module>
<module>module</module>
<module>product</module>
<module>pkg</module>
14 years, 3 months
gatein SVN: r4606 - components/wsrp/trunk/consumer/src/main/resources/conf.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-10-08 08:25:39 -0400 (Fri, 08 Oct 2010)
New Revision: 4606
Modified:
components/wsrp/trunk/consumer/src/main/resources/conf/wsrp-consumers-config.xml
Log:
- Updated WSDL for NetUnity's public producer and split between v1 and v2 support.
Modified: components/wsrp/trunk/consumer/src/main/resources/conf/wsrp-consumers-config.xml
===================================================================
--- components/wsrp/trunk/consumer/src/main/resources/conf/wsrp-consumers-config.xml 2010-10-08 10:41:50 UTC (rev 4605)
+++ components/wsrp/trunk/consumer/src/main/resources/conf/wsrp-consumers-config.xml 2010-10-08 12:25:39 UTC (rev 4606)
@@ -39,10 +39,16 @@
</wsrp-producer>
</deployment>
<!--<deployment>
- <wsrp-producer id="NetUnity" expiration-cache="300">
- <endpoint-wsdl-url>http://wsrp.netunitysoftware.com/WSRPTestService/WSRPTestService.asmx?Ope...</endpoint-wsdl-url>
+ <wsrp-producer id="NetUnityV2" expiration-cache="300">
+ <endpoint-wsdl-url>http://www.netunitysoftware.com/wsrp2interop/WsrpProducer.asmx?Operation=...</endpoint-wsdl-url>
<registration-data/>
</wsrp-producer>
+ </deployment>
+ <deployment>
+ <wsrp-producer id="NetUnityV1" expiration-cache="300">
+ <endpoint-wsdl-url>http://www.netunitysoftware.com/wsrp2interop/WsrpProducer.asmx?Operation=...</endpoint-wsdl-url>
+ <registration-data/>
+ </wsrp-producer>
</deployment>-->
<!--<deployment>
<wsrp-producer id="vignette" expiration-cache="300">
14 years, 3 months
gatein SVN: r4605 - in exo/portal/branches/3.1.x: server/tomcat/patch/src/main/tomcat/conf and 1 other directories.
by do-not-reply@jboss.org
Author: phuong_vu
Date: 2010-10-08 06:41:50 -0400 (Fri, 08 Oct 2010)
New Revision: 4605
Added:
exo/portal/branches/3.1.x/server/jboss/patch-ear/src/main/jboss/server/default/deploy/jbossweb.sar/server.xml
Modified:
exo/portal/branches/3.1.x/server/tomcat/patch/src/main/tomcat/conf/server.xml
exo/portal/branches/3.1.x/web/rest/src/main/webapp/WEB-INF/web.xml
Log:
EXOGTN-4 Add session listeners to rest.war to free memory
Added: exo/portal/branches/3.1.x/server/jboss/patch-ear/src/main/jboss/server/default/deploy/jbossweb.sar/server.xml
===================================================================
--- exo/portal/branches/3.1.x/server/jboss/patch-ear/src/main/jboss/server/default/deploy/jbossweb.sar/server.xml (rev 0)
+++ exo/portal/branches/3.1.x/server/jboss/patch-ear/src/main/jboss/server/default/deploy/jbossweb.sar/server.xml 2010-10-08 10:41:50 UTC (rev 4605)
@@ -0,0 +1,168 @@
+<Server>
+
+ <!-- Optional listener which ensures correct init and shutdown of APR,
+ and provides information if it is not installed -->
+ <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
+ <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
+ <Listener className="org.apache.catalina.core.JasperListener" />
+
+ <Service name="jboss.web">
+
+ <!-- A HTTP/1.1 Connector on port 8080 -->
+ <Connector protocol="HTTP/1.1" port="8080" address="${jboss.bind.address}"
+ connectionTimeout="20000" redirectPort="8443" />
+
+ <!-- Add this option to the connector to avoid problems with
+ .NET clients that don't implement HTTP/1.1 correctly
+ restrictedUserAgents="^.*MS Web Services Client Protocol 1.1.4322.*$"
+ -->
+
+ <!-- A AJP 1.3 Connector on port 8009 -->
+ <Connector protocol="AJP/1.3" port="8009" address="${jboss.bind.address}"
+ redirectPort="8443" />
+
+ <!-- SSL/TLS Connector configuration using the admin devl guide keystore
+ <Connector protocol="HTTP/1.1" SSLEnabled="true"
+ port="8443" address="${jboss.bind.address}"
+ scheme="https" secure="true" clientAuth="false"
+ keystoreFile="${jboss.server.home.dir}/conf/chap8.keystore"
+ keystorePass="rmi+ssl" sslProtocol = "TLS" />
+ -->
+
+ <Engine name="jboss.web" defaultHost="localhost">
+
+ <!-- The JAAS based authentication and authorization realm implementation
+ that is compatible with the jboss 3.2.x realm implementation.
+ - certificatePrincipal : the class name of the
+ org.jboss.security.auth.certs.CertificatePrincipal impl
+ used for mapping X509[] cert chains to a Princpal.
+ - allRolesMode : how to handle an auth-constraint with a role-name=*,
+ one of strict, authOnly, strictAuthOnly
+ + strict = Use the strict servlet spec interpretation which requires
+ that the user have one of the web-app/security-role/role-name
+ + authOnly = Allow any authenticated user
+ + strictAuthOnly = Allow any authenticated user only if there are no
+ web-app/security-roles
+ -->
+ <Realm className="org.jboss.web.tomcat.security.JBossWebRealm"
+ certificatePrincipal="org.jboss.security.auth.certs.SubjectDNMapping"
+ allRolesMode="authOnly"
+ />
+ <!-- A subclass of JBossSecurityMgrRealm that uses the authentication
+ behavior of JBossSecurityMgrRealm, but overrides the authorization
+ checks to use JACC permissions with the current java.security.Policy
+ to determine authorized access.
+ - allRolesMode : how to handle an auth-constraint with a role-name=*,
+ one of strict, authOnly, strictAuthOnly
+ + strict = Use the strict servlet spec interpretation which requires
+ that the user have one of the web-app/security-role/role-name
+ + authOnly = Allow any authenticated user
+ + strictAuthOnly = Allow any authenticated user only if there are no
+ web-app/security-roles
+ <Realm className="org.jboss.web.tomcat.security.JaccAuthorizationRealm"
+ certificatePrincipal="org.jboss.security.auth.certs.SubjectDNMapping"
+ allRolesMode="authOnly"
+ />
+ -->
+
+ <Host name="localhost">
+
+ <!-- Uncomment to enable request dumper. This Valve "logs interesting
+ contents from the specified Request (before processing) and the
+ corresponding Response (after processing). It is especially useful
+ in debugging problems related to headers and cookies."
+ -->
+ <!--
+ <Valve className="org.apache.catalina.valves.RequestDumperValve" />
+ -->
+
+ <!-- Access logger -->
+ <!--
+ <Valve className="org.apache.catalina.valves.AccessLogValve"
+ prefix="localhost_access_log." suffix=".log"
+ pattern="common" directory="${jboss.server.log.dir}"
+ resolveHosts="false" />
+ -->
+
+ <!-- Uncomment to enable single sign-on across web apps
+ deployed to this host. Does not provide SSO across a cluster.
+
+ If this valve is used, do not use the JBoss ClusteredSingleSignOn
+ valve shown below.
+
+ A new configuration attribute is available beginning with
+ release 4.0.4:
+
+ cookieDomain configures the domain to which the SSO cookie
+ will be scoped (i.e. the set of hosts to
+ which the cookie will be presented). By default
+ the cookie is scoped to "/", meaning the host
+ that presented it. Set cookieDomain to a
+ wider domain (e.g. "xyz.com") to allow an SSO
+ to span more than one hostname.
+ -->
+
+ <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
+
+
+ <!-- Uncomment to enable single sign-on across web apps
+ deployed to this host AND to all other hosts in the cluster.
+
+ If this valve is used, do not use the standard Tomcat SingleSignOn
+ valve shown above.
+
+ Valve uses a JBossCache instance to support SSO credential
+ caching and replication across the cluster. The JBossCache
+ instance must be configured separately. See the
+ "jboss-web-clusteredsso-beans.xml" file in the
+ server/all/deploy directory for cache configuration details.
+
+ Besides the attributes supported by the standard Tomcat
+ SingleSignOn valve (see the Tomcat docs), this version also
+ supports the following attributes:
+
+ cookieDomain see non-clustered valve above
+
+ cacheConfig Name of the CacheManager service configuration
+ to use for the clustered SSO cache. See
+ deploy/cluster/jboss-cache-manager.sar/META-INF/jboss-cache-manager-jboss-beans.xml
+ Default is "clustered-sso".
+
+ treeCacheName Deprecated. Use "cacheConfig".
+ JMX ObjectName of the JBoss Cache MBean used to
+ support credential caching and replication across
+ the cluster. Only used if no cache can be located
+ from the CacheManager service using the "cacheConfig"
+ attribute (or its default value). If not set, the
+ default is "jboss.cache:service=TomcatClusteringCache"
+
+ maxEmptyLife The maximum number of seconds an SSO with no
+ active sessions will be usable by a request
+
+ processExpiresInterval The minimum number of seconds between
+ efforts by the valve to find and invalidate
+ SSO's that have exceeded their 'maxEmptyLife'.
+ Does not imply effort will be spent on such
+ cleanup every 'processExpiresInterval'.
+ -->
+ <!--
+ <Valve className="org.jboss.web.tomcat.service.sso.ClusteredSingleSignOn" />
+ -->
+
+ <!-- Check for unclosed connections and transaction terminated checks
+ in servlets/jsps.
+
+ Important: The dependency on the CachedConnectionManager
+ in META-INF/jboss-service.xml must be uncommented, too
+ -->
+
+ <Valve className="org.jboss.web.tomcat.service.jca.CachedConnectionValve"
+ cachedConnectionManagerObjectName="jboss.jca:service=CachedConnectionManager"
+ transactionManagerObjectName="jboss:service=TransactionManager" />
+
+ </Host>
+ </Engine>
+
+ </Service>
+
+</Server>
Modified: exo/portal/branches/3.1.x/server/tomcat/patch/src/main/tomcat/conf/server.xml
===================================================================
--- exo/portal/branches/3.1.x/server/tomcat/patch/src/main/tomcat/conf/server.xml 2010-10-08 10:33:20 UTC (rev 4604)
+++ exo/portal/branches/3.1.x/server/tomcat/patch/src/main/tomcat/conf/server.xml 2010-10-08 10:41:50 UTC (rev 4605)
@@ -121,9 +121,7 @@
<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
- <!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
- -->
<!-- Access log processes all example.
Documentation at: /docs/config/valve.html -->
Modified: exo/portal/branches/3.1.x/web/rest/src/main/webapp/WEB-INF/web.xml
===================================================================
--- exo/portal/branches/3.1.x/web/rest/src/main/webapp/WEB-INF/web.xml 2010-10-08 10:33:20 UTC (rev 4604)
+++ exo/portal/branches/3.1.x/web/rest/src/main/webapp/WEB-INF/web.xml 2010-10-08 10:41:50 UTC (rev 4605)
@@ -56,7 +56,17 @@
<filter-name>RestEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
-
+
+ <!-- ================================================================== -->
+ <!-- LISTENER -->
+ <!-- ================================================================== -->
+ <listener>
+ <listener-class>org.exoplatform.web.GenericHttpListener</listener-class>
+ </listener>
+ <listener>
+ <listener-class>org.exoplatform.services.security.web.JAASConversationStateListener</listener-class>
+ </listener>
+
<servlet>
<servlet-name>RestServer</servlet-name>
<description>eXo - Platform REST Server</description>
@@ -74,6 +84,10 @@
<url-pattern>/*</url-pattern>
</servlet-mapping>
+ <session-config>
+ <session-timeout>30</session-timeout>
+ </session-config>
+
<security-constraint>
<web-resource-collection>
<web-resource-name>rest</web-resource-name>
14 years, 3 months