gatein SVN: r4261 - in portal/branches/navcontroller: component/web/controller/src/main/java/org/exoplatform/web/controller/metadata and 1 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-09-20 18:39:18 -0400 (Mon, 20 Sep 2010)
New Revision: 4261
Modified:
portal/branches/navcontroller/component/web/controller/pom.xml
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/metadata/DescriptorBuilder.java
portal/branches/navcontroller/packaging/module/src/main/javascript/portal.packaging.module.js
Log:
remove staxmate experiment for now and rely only on stax provided in JDK
Modified: portal/branches/navcontroller/component/web/controller/pom.xml
===================================================================
--- portal/branches/navcontroller/component/web/controller/pom.xml 2010-09-20 18:34:59 UTC (rev 4260)
+++ portal/branches/navcontroller/component/web/controller/pom.xml 2010-09-20 22:39:18 UTC (rev 4261)
@@ -40,10 +40,5 @@
<groupId>org.exoplatform.portal</groupId>
<artifactId>exo.portal.component.web.resources</artifactId>
</dependency>
- <dependency>
- <groupId>org.codehaus.staxmate</groupId>
- <artifactId>staxmate</artifactId>
- <version>2.0.0</version>
- </dependency>
</dependencies>
</project>
Modified: portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/metadata/DescriptorBuilder.java
===================================================================
--- portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/metadata/DescriptorBuilder.java 2010-09-20 18:34:59 UTC (rev 4260)
+++ portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/metadata/DescriptorBuilder.java 2010-09-20 22:39:18 UTC (rev 4261)
@@ -19,12 +19,10 @@
package org.exoplatform.web.controller.metadata;
-import org.codehaus.staxmate.SMInputFactory;
-import org.codehaus.staxmate.in.SMHierarchicCursor;
-import org.codehaus.staxmate.in.SMInputCursor;
import org.exoplatform.web.controller.QualifiedName;
import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamConstants;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import java.util.List;
@@ -47,48 +45,69 @@
public RouterDescriptor build(XMLStreamReader reader) throws Exception
{
+ System.out.println("reader = " + reader);
+ System.out.println("reader = " + reader.getClass().getName());
RouterDescriptor routerDesc = new RouterDescriptor();
- SMHierarchicCursor routerC = SMInputFactory.rootElementCursor(reader);
- routerC.getNext();
//
- SMInputCursor routeC = routerC.childElementCursor(routeQN);
- while (routeC.getNext() != null)
+ while (true)
{
- build(routeC, routerDesc.getRoutes());
+ int event = reader.next();
+ if (event == XMLStreamConstants.END_DOCUMENT)
+ {
+ reader.close();
+ break;
+ }
+ else if (event == XMLStreamConstants.START_ELEMENT)
+ {
+ if (routeQN.equals(reader.getName()))
+ {
+ build(reader, routerDesc.getRoutes());
+ }
+ }
}
//
return routerDesc;
}
- private void build(SMInputCursor routeC, List<RouteDescriptor> descriptors) throws XMLStreamException
+ private void build(XMLStreamReader reader, List<RouteDescriptor> descriptors) throws XMLStreamException
{
- String path = routeC.getAttrValue("path");
+ String path = reader.getAttributeValue(null, "path");
RouteDescriptor routeDesc = new RouteDescriptor(path);
//
- SMInputCursor childC = routeC.childElementCursor();
- while (childC.getNext() != null)
+ while (true)
{
- if (childC.getQName().equals(paramQN))
+ int event = reader.next();
+ if (event == XMLStreamConstants.END_ELEMENT)
{
- String name = childC.getAttrValue("name");
- String value = childC.getAttrValue("value");
- routeDesc.addParam(QualifiedName.parse(name), value);
+ if (routeQN.equals(reader.getName()))
+ {
+ break;
+ }
}
- else if (childC.getQName().equals(requestParamQN))
+ else if (event == XMLStreamConstants.START_ELEMENT)
{
- String name = childC.getAttrValue("name");
- String matchName = childC.getAttrValue("matchName");
- String matchValue = childC.getAttrValue("matchValue");
- String optional = childC.getAttrValue("required");
- routeDesc.addRequestParam(QualifiedName.parse(name), matchName, matchValue, "true".equals(optional));
+ if (paramQN.equals(reader.getName()))
+ {
+ String name = reader.getAttributeValue(null, "name");
+ String value = reader.getAttributeValue(null, "value");
+ routeDesc.addParam(QualifiedName.parse(name), value);
+ }
+ else if (requestParamQN.equals(reader.getName()))
+ {
+ String name = reader.getAttributeValue(null, "name");
+ String matchName = reader.getAttributeValue(null, "matchName");
+ String matchValue = reader.getAttributeValue(null, "matchValue");
+ String optional = reader.getAttributeValue(null, "required");
+ routeDesc.addRequestParam(QualifiedName.parse(name), matchName, matchValue, "true".equals(optional));
+ }
+ else if (routeQN.equals(reader.getName()))
+ {
+ build(reader, routeDesc.getChildren());
+ }
}
- else if (childC.getQName().equals(routeQN))
- {
- build(childC, routeDesc.getChildren());
- }
}
//
Modified: portal/branches/navcontroller/packaging/module/src/main/javascript/portal.packaging.module.js
===================================================================
--- portal/branches/navcontroller/packaging/module/src/main/javascript/portal.packaging.module.js 2010-09-20 18:34:59 UTC (rev 4260)
+++ portal/branches/navcontroller/packaging/module/src/main/javascript/portal.packaging.module.js 2010-09-20 22:39:18 UTC (rev 4261)
@@ -100,8 +100,6 @@
module.component.web = {}
module.component.web.controller =
new Project("org.exoplatform.portal", "exo.portal.component.web.controller", "jar", module.version).
- addDependency(new Project("org.codehaus.staxmate", "staxmate", "jar", "2.0.0")).
- addDependency(new Project("org.codehaus.woodstox", "stax2-api", "jar", "3.0.2")).
addDependency(module.component.common);
module.component.web.security =
15 years, 7 months
gatein SVN: r4260 - in components/wsrp/trunk/consumer/src: main/java/org/gatein/wsrp/consumer/migration and 1 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-09-20 14:34:59 -0400 (Mon, 20 Sep 2010)
New Revision: 4260
Added:
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/migration/InMemoryMigrationService.java
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/migration/MigrationService.java
Removed:
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/migration/MigrationService.java
Modified:
components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/WSRPConsumerImpl.java
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/migration/MigrationServiceTestCase.java
Log:
- GTNWSRP-61: Made MigrationService an interface so that we can have a JCR backend in GateIn integration code.
- Minor error reporting improvement.
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-09-20 18:13:41 UTC (rev 4259)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/WSRPConsumerImpl.java 2010-09-20 18:34:59 UTC (rev 4260)
@@ -52,6 +52,7 @@
import org.gatein.wsrp.consumer.handlers.SessionHandler;
import org.gatein.wsrp.consumer.migration.ExportInfo;
import org.gatein.wsrp.consumer.migration.ImportInfo;
+import org.gatein.wsrp.consumer.migration.InMemoryMigrationService;
import org.gatein.wsrp.consumer.migration.MigrationService;
import org.gatein.wsrp.consumer.portlet.WSRPPortlet;
import org.gatein.wsrp.consumer.portlet.info.WSRPPortletInfo;
@@ -140,7 +141,7 @@
public WSRPConsumerImpl()
{
- this(new ProducerInfo(), new MigrationService());
+ this(new ProducerInfo(), new InMemoryMigrationService());
}
public WSRPConsumerImpl(ProducerInfo info, MigrationService migrationService)
@@ -880,7 +881,7 @@
}*/
catch (Exception e)
{
- throw new PortletInvokerException(e);
+ throw new PortletInvokerException(e.getLocalizedMessage(), e);
}
}
else
@@ -985,7 +986,7 @@
}*/
catch (Exception e)
{
- throw new PortletInvokerException(e);
+ throw new PortletInvokerException(e.getLocalizedMessage(), e);
}
}
else
Copied: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/migration/InMemoryMigrationService.java (from rev 4238, components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/migration/MigrationService.java)
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/migration/InMemoryMigrationService.java (rev 0)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/migration/InMemoryMigrationService.java 2010-09-20 18:34:59 UTC (rev 4260)
@@ -0,0 +1,88 @@
+/*
+ * 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.migration;
+
+import org.gatein.common.util.ParameterValidation;
+import org.gatein.wsrp.api.PortalStructureProvider;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.SortedMap;
+import java.util.TreeMap;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class InMemoryMigrationService implements MigrationService
+{
+ private SortedMap<Long, ExportInfo> exportInfos;
+ private PortalStructureProvider structureProvider;
+
+ public PortalStructureProvider getStructureProvider()
+ {
+ return structureProvider;
+ }
+
+ public void setStructureProvider(PortalStructureProvider structureProvider)
+ {
+ this.structureProvider = structureProvider;
+ }
+
+ public List<ExportInfo> getAvailableExportInfos()
+ {
+ return new ArrayList<ExportInfo>(getExportInfos().values());
+ }
+
+ public ExportInfo getExportInfo(long exportTime)
+ {
+ return exportInfos.get(exportTime);
+ }
+
+ public void add(ExportInfo info)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(info, "ExportInfo");
+
+ getExportInfos().put(info.getExportTime(), info);
+ }
+
+ public ExportInfo remove(ExportInfo info)
+ {
+ return info == null ? null : getExportInfos().remove(info.getExportTime());
+ }
+
+ private SortedMap<Long, ExportInfo> getExportInfos()
+ {
+ if (exportInfos == null)
+ {
+ exportInfos = new TreeMap<Long, ExportInfo>();
+ }
+ return exportInfos;
+ }
+
+ public boolean isAvailableExportInfosEmpty()
+ {
+ return exportInfos == null || exportInfos.isEmpty();
+ }
+}
Deleted: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/migration/MigrationService.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/migration/MigrationService.java 2010-09-20 18:13:41 UTC (rev 4259)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/migration/MigrationService.java 2010-09-20 18:34:59 UTC (rev 4260)
@@ -1,125 +0,0 @@
-/*
- * 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.migration;
-
-import org.gatein.common.util.ParameterValidation;
-import org.gatein.pc.api.PortletContext;
-import org.gatein.wsrp.api.PortalStructureProvider;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.SortedMap;
-import java.util.TreeMap;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
- * @version $Revision$
- */
-public class MigrationService
-{
- private SortedMap<Long, ExportInfo> exportInfos;
- // todo: fix me
- private PortalStructureProvider structureProvider = new PortalStructureProvider()
- {
- private Map<String, List<String>> pagesToWindows = new HashMap<String, List<String>>(7);
-
- {
- List<String> windows = new ArrayList<String>(3);
- windows.add("p1w1");
- windows.add("p1w2");
- windows.add("p1w3");
-
- pagesToWindows.put("p1", windows);
-
- windows = new ArrayList<String>(2);
- windows.add("p2w1");
- windows.add("p2w2");
-
- pagesToWindows.put("p2", windows);
- }
-
- public List<String> getPageIdentifiers()
- {
- return new ArrayList<String>(pagesToWindows.keySet());
- }
-
- public List<String> getWindowIdentifiersFor(String pageId)
- {
- return pagesToWindows.get(pageId);
- }
-
- public void assignPortletToWindow(PortletContext portletContext, String windowId, String pageId)
- {
- System.out.println("Assigned portlet " + portletContext + " to window " + windowId + " on page " + pageId);
- }
- };
-
- public PortalStructureProvider getStructureProvider()
- {
- return structureProvider;
- }
-
- public void setStructureProvider(PortalStructureProvider structureProvider)
- {
- this.structureProvider = structureProvider;
- }
-
- public List<ExportInfo> getAvailableExportInfos()
- {
- return new ArrayList<ExportInfo>(getExportInfos().values());
- }
-
- public ExportInfo getExportInfo(long exportTime)
- {
- return exportInfos.get(exportTime);
- }
-
- public void add(ExportInfo info)
- {
- ParameterValidation.throwIllegalArgExceptionIfNull(info, "ExportInfo");
-
- getExportInfos().put(info.getExportTime(), info);
- }
-
- public ExportInfo remove(ExportInfo info)
- {
- return info == null ? null : getExportInfos().remove(info.getExportTime());
- }
-
- private SortedMap<Long, ExportInfo> getExportInfos()
- {
- if (exportInfos == null)
- {
- exportInfos = new TreeMap<Long, ExportInfo>();
- }
- return exportInfos;
- }
-
- public boolean isAvailableExportInfosEmpty()
- {
- return exportInfos == null || exportInfos.isEmpty();
- }
-}
Added: components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/migration/MigrationService.java
===================================================================
--- components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/migration/MigrationService.java (rev 0)
+++ components/wsrp/trunk/consumer/src/main/java/org/gatein/wsrp/consumer/migration/MigrationService.java 2010-09-20 18:34:59 UTC (rev 4260)
@@ -0,0 +1,49 @@
+/*
+ * 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.migration;
+
+import org.gatein.wsrp.api.PortalStructureProvider;
+
+import java.util.List;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public interface MigrationService
+{
+ PortalStructureProvider getStructureProvider();
+
+ void setStructureProvider(PortalStructureProvider structureProvider);
+
+ List<ExportInfo> getAvailableExportInfos();
+
+ ExportInfo getExportInfo(long exportTime);
+
+ void add(ExportInfo info);
+
+ ExportInfo remove(ExportInfo info);
+
+ boolean isAvailableExportInfosEmpty();
+}
Modified: components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/migration/MigrationServiceTestCase.java
===================================================================
--- components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/migration/MigrationServiceTestCase.java 2010-09-20 18:13:41 UTC (rev 4259)
+++ components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/migration/MigrationServiceTestCase.java 2010-09-20 18:34:59 UTC (rev 4260)
@@ -39,7 +39,7 @@
@Override
protected void setUp() throws Exception
{
- service = new MigrationService();
+ service = new InMemoryMigrationService();
}
public void testIsAvailableExportInfosEmpty()
15 years, 7 months
gatein SVN: r4259 - in portal/branches/wsrp2-integration: component/wsrp/src/main/java/org/gatein/portal/wsrp/state and 5 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2010-09-20 14:13:41 -0400 (Mon, 20 Sep 2010)
New Revision: 4259
Added:
portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/StoresByPathManager.java
portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/
portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/JCRMigrationService.java
portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/
portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportErrorMapping.java
portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportInfoMapping.java
portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportInfosMapping.java
portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportedStateMapping.java
portal/branches/wsrp2-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp/migration-nodetypes.xml
Modified:
portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/WSRPServiceIntegration.java
portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/JCRPersister.java
portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java
portal/branches/wsrp2-integration/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml
Log:
- GTNWSRP-61: First implementation of JCR persistence for export data.
- Added JCRPersister.delete method and used it in JCRConsumerRegistry.
Modified: portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/WSRPServiceIntegration.java
===================================================================
--- portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/WSRPServiceIntegration.java 2010-09-20 15:19:44 UTC (rev 4258)
+++ portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/WSRPServiceIntegration.java 2010-09-20 18:13:41 UTC (rev 4259)
@@ -40,6 +40,7 @@
import org.gatein.pc.portlet.state.producer.PortletStatePersistenceManager;
import org.gatein.pc.portlet.state.producer.ProducerPortletInvoker;
import org.gatein.portal.wsrp.state.consumer.JCRConsumerRegistry;
+import org.gatein.portal.wsrp.state.migration.JCRMigrationService;
import org.gatein.portal.wsrp.state.producer.configuration.JCRProducerConfigurationService;
import org.gatein.portal.wsrp.state.producer.registrations.JCRRegistrationPersistenceManager;
import org.gatein.portal.wsrp.state.producer.state.JCRPortletStatePersistenceManager;
@@ -230,7 +231,7 @@
consumerRegistry.setSessionEventBroadcaster(sessionEventBroadcaster);
// migration service
- MigrationService migrationService = new MigrationService();
+ MigrationService migrationService = new JCRMigrationService(container);
migrationService.setStructureProvider(new MOPPortalStructureProvider(container));
consumerRegistry.setMigrationService(migrationService);
Modified: portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/JCRPersister.java
===================================================================
--- portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/JCRPersister.java 2010-09-20 15:19:44 UTC (rev 4258)
+++ portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/JCRPersister.java 2010-09-20 18:13:41 UTC (rev 4259)
@@ -100,7 +100,26 @@
session.save();
}
+ public <T> boolean delete(T toDelete, StoresByPathManager<T> manager)
+ {
+ ChromatticSession session = getSession();
+ Object old = session.findByPath(toDelete.getClass(), manager.getChildPath(toDelete));
+
+ if (old != null)
+ {
+ session.remove(old);
+ closeSession(session, true);
+ return true;
+ }
+ else
+ {
+ closeSession(session, false);
+ return false;
+ }
+
+ }
+
public static class WSRPSessionLifeCycle implements SessionLifeCycle
{
private ManageableRepository repository;
@@ -234,12 +253,12 @@
return encode(s);
}
- private String decode(String s)
+ public static String decode(String s)
{
return s.replace(CLOSE_BRACE_REPLACEMENT, CLOSE_BRACE).replace(OPEN_BRACE_REPLACEMENT, OPEN_BRACE).replace(COLON_REPLACEMENT, COLON);
}
- private String encode(String s)
+ public static String encode(String s)
{
return s.replace(OPEN_BRACE, OPEN_BRACE_REPLACEMENT).replace(CLOSE_BRACE, CLOSE_BRACE_REPLACEMENT).replace(COLON, COLON_REPLACEMENT);
}
@@ -252,6 +271,11 @@
public String decodeNodeName(FormatterContext formatterContext, String s)
{
+ return decode(s);
+ }
+
+ public static String decode(String s)
+ {
return s.replace(SLASH_REPLACEMENT, SLASH);
}
Added: portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/StoresByPathManager.java
===================================================================
--- portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/StoresByPathManager.java (rev 0)
+++ portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/StoresByPathManager.java 2010-09-20 18:13:41 UTC (rev 4259)
@@ -0,0 +1,33 @@
+/*
+ * 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.portal.wsrp.state;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public interface StoresByPathManager<C>
+{
+ String getChildPath(C needsComputedPath);
+}
Modified: portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java
===================================================================
--- portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java 2010-09-20 15:19:44 UTC (rev 4258)
+++ portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java 2010-09-20 18:13:41 UTC (rev 4259)
@@ -26,6 +26,7 @@
import org.chromattic.api.ChromatticSession;
import org.exoplatform.container.ExoContainer;
import org.gatein.portal.wsrp.state.JCRPersister;
+import org.gatein.portal.wsrp.state.StoresByPathManager;
import org.gatein.portal.wsrp.state.consumer.mapping.EndpointInfoMapping;
import org.gatein.portal.wsrp.state.consumer.mapping.ProducerInfoMapping;
import org.gatein.portal.wsrp.state.consumer.mapping.ProducerInfosMapping;
@@ -46,7 +47,7 @@
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision$
*/
-public class JCRConsumerRegistry extends AbstractConsumerRegistry
+public class JCRConsumerRegistry extends AbstractConsumerRegistry implements StoresByPathManager<ProducerInfo>
{
// private NewJCRPersister persister;
private JCRPersister persister;
@@ -89,10 +90,7 @@
@Override
protected void delete(ProducerInfo info)
{
- ChromatticSession session = persister.getSession();
- delete(session, getPathFor(info));
-
- persister.closeSession(session, true);
+ persister.delete(info, this);
}
@Override
@@ -168,14 +166,9 @@
return producerInfosMapping;
}
- private void delete(ChromatticSession session, String path)
+ public String getChildPath(ProducerInfo needsComputedPath)
{
- ProducerInfoMapping old = session.findByPath(ProducerInfoMapping.class, path);
-
- if (old != null)
- {
- session.remove(old);
- }
+ return getPathFor(needsComputedPath);
}
private static String getPathFor(ProducerInfo info)
Added: portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/JCRMigrationService.java
===================================================================
--- portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/JCRMigrationService.java (rev 0)
+++ portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/JCRMigrationService.java 2010-09-20 18:13:41 UTC (rev 4259)
@@ -0,0 +1,186 @@
+/*
+ * 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.portal.wsrp.state.migration;
+
+import org.chromattic.api.ChromatticSession;
+import org.exoplatform.container.ExoContainer;
+import org.gatein.common.util.ParameterValidation;
+import org.gatein.portal.wsrp.state.JCRPersister;
+import org.gatein.portal.wsrp.state.StoresByPathManager;
+import org.gatein.portal.wsrp.state.migration.mapping.ExportErrorMapping;
+import org.gatein.portal.wsrp.state.migration.mapping.ExportInfoMapping;
+import org.gatein.portal.wsrp.state.migration.mapping.ExportInfosMapping;
+import org.gatein.portal.wsrp.state.migration.mapping.ExportedStateMapping;
+import org.gatein.wsrp.api.PortalStructureProvider;
+import org.gatein.wsrp.consumer.migration.ExportInfo;
+import org.gatein.wsrp.consumer.migration.MigrationService;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class JCRMigrationService implements MigrationService, StoresByPathManager<ExportInfo>
+{
+ private PortalStructureProvider structureProvider;
+ private JCRPersister persister;
+ private static final String EXPORT_INFOS_PATH = ExportInfosMapping.NODE_NAME;
+ private int exportInfosCount = -1;
+
+ public JCRMigrationService(ExoContainer container) throws Exception
+ {
+ List<Class> mappingClasses = new ArrayList<Class>(4);
+ Collections.addAll(mappingClasses, ExportInfosMapping.class, ExportInfoMapping.class, ExportedStateMapping.class,
+ ExportErrorMapping.class);
+
+ persister = new JCRPersister(container, JCRPersister.WSRP_WORKSPACE_NAME);
+ persister.initializeBuilderFor(mappingClasses);
+ }
+
+ public PortalStructureProvider getStructureProvider()
+ {
+ return structureProvider;
+ }
+
+ public void setStructureProvider(PortalStructureProvider structureProvider)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(structureProvider, "PortalStructureProvider");
+ this.structureProvider = structureProvider;
+ }
+
+ public List<ExportInfo> getAvailableExportInfos()
+ {
+ ChromatticSession session = persister.getSession();
+
+ ExportInfosMapping exportInfosMapping = getExportInfosMapping(session);
+
+ List<ExportInfoMapping> exportInfoMappings = exportInfosMapping.getExportInfos();
+ List<ExportInfo> exportInfos = new ArrayList<ExportInfo>(exportInfoMappings.size());
+ for (ExportInfoMapping eim : exportInfoMappings)
+ {
+ exportInfos.add(eim.toExportInfo());
+ }
+
+ persister.closeSession(session, false);
+
+ exportInfosCount = exportInfos.size();
+
+ return exportInfos;
+ }
+
+ private ExportInfosMapping getExportInfosMapping(ChromatticSession session)
+ {
+ ExportInfosMapping exportInfosMapping = session.findByPath(ExportInfosMapping.class, ExportInfosMapping.NODE_NAME);
+ if(exportInfosMapping == null)
+ {
+ exportInfosMapping = session.insert(ExportInfosMapping.class, ExportInfosMapping.NODE_NAME);
+ exportInfosCount = 0;
+ }
+
+ return exportInfosMapping;
+ }
+
+ public ExportInfo getExportInfo(long exportTime)
+ {
+ ChromatticSession session = persister.getSession();
+
+ ExportInfoMapping eim = session.findByPath(ExportInfoMapping.class, getPathFor(exportTime));
+
+ if(eim != null)
+ {
+ return eim.toExportInfo();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public void add(ExportInfo info)
+ {
+ ChromatticSession session = persister.getSession();
+
+ ExportInfoMapping eim = session.findByPath(ExportInfoMapping.class, getChildPath(info));
+ long exportTime = info.getExportTime();
+ if(eim != null)
+ {
+ throw new IllegalArgumentException("An ExportInfo with export time "
+ + exportTime + " already exists!");
+ }
+ else
+ {
+ ExportInfosMapping exportInfosMapping = getExportInfosMapping(session);
+ String exportTimeAsString = "" + exportTime;
+ ExportInfoMapping exportInfo = exportInfosMapping.createExportInfo(exportTimeAsString);
+ session.persist(exportInfosMapping, exportInfo, exportTimeAsString);
+ exportInfo.initFrom(info);
+
+ persister.closeSession(session, true);
+ exportInfosCount++;
+ }
+ }
+
+ public ExportInfo remove(ExportInfo info)
+ {
+ if (persister.delete(info, this))
+ {
+ exportInfosCount--;
+ return info;
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public boolean isAvailableExportInfosEmpty()
+ {
+ if(exportInfosCount == -1)
+ {
+ ChromatticSession session = persister.getSession();
+ ExportInfosMapping mappings = getExportInfosMapping(session);
+ exportInfosCount = mappings.getExportInfos().size();
+ }
+
+ return exportInfosCount == 0;
+ }
+
+ public String getParentPath()
+ {
+ return EXPORT_INFOS_PATH;
+ }
+
+ public String getChildPath(ExportInfo exportInfo)
+ {
+ return getPathFor(exportInfo.getExportTime());
+ }
+
+ private String getPathFor(final long exportTime)
+ {
+ return getParentPath() + "/" + exportTime;
+ }
+}
Added: portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportErrorMapping.java
===================================================================
--- portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportErrorMapping.java (rev 0)
+++ portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportErrorMapping.java 2010-09-20 18:13:41 UTC (rev 4259)
@@ -0,0 +1,84 @@
+/*
+ * 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.portal.wsrp.state.migration.mapping;
+
+import org.chromattic.api.annotations.PrimaryType;
+import org.chromattic.api.annotations.Property;
+import org.gatein.common.util.ParameterValidation;
+
+import javax.xml.namespace.QName;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+@PrimaryType(name = ExportErrorMapping.NODE_NAME)
+public abstract class ExportErrorMapping
+{
+ public static final String NODE_NAME = "wsrp:exporterror";
+ private static final String COMMA = ",";
+
+ @Property(name = "errorcode")
+ public abstract String getCode();
+
+ public abstract void setCode(String code);
+
+ @Property(name = "handles")
+ public abstract String getHandles();
+
+ public abstract void setHandles(String handles);
+
+ public QName getErrorCode()
+ {
+ return QName.valueOf(getCode());
+ }
+
+ public List<String> getPortletHandles()
+ {
+ return Arrays.asList(getHandles().split(COMMA));
+ }
+
+ public void initFrom(QName errorCode, List<String> handles)
+ {
+ setCode(errorCode.toString());
+
+ if (ParameterValidation.existsAndIsNotEmpty(handles))
+ {
+ StringBuilder sb = new StringBuilder();
+ int size = handles.size();
+ int index = 0;
+ for (String handle : handles)
+ {
+ sb.append(handle);
+ if (index++ < size)
+ {
+ sb.append(COMMA);
+ }
+ }
+ setHandles(sb.toString());
+ }
+ }
+}
Added: portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportInfoMapping.java
===================================================================
--- portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportInfoMapping.java (rev 0)
+++ portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportInfoMapping.java 2010-09-20 18:13:41 UTC (rev 4259)
@@ -0,0 +1,139 @@
+/*
+ * 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.portal.wsrp.state.migration.mapping;
+
+import org.chromattic.api.annotations.Create;
+import org.chromattic.api.annotations.OneToMany;
+import org.chromattic.api.annotations.PrimaryType;
+import org.chromattic.api.annotations.Property;
+import org.exoplatform.commons.utils.Safe;
+import org.gatein.portal.wsrp.state.JCRPersister;
+import org.gatein.wsrp.consumer.migration.ExportInfo;
+
+import javax.xml.namespace.QName;
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.util.List;
+import java.util.Map;
+import java.util.SortedMap;
+import java.util.TreeMap;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+@PrimaryType(name = ExportInfoMapping.NODE_NAME)
+public abstract class ExportInfoMapping
+{
+ public static final String NODE_NAME = "wsrp:exportinfo";
+
+ @Property(name = "exporttime")
+ public abstract long getExportTime();
+ public abstract void setExportTime(long exportTime);
+
+ @Property(name = "expirationtime")
+ public abstract long getExpirationTime();
+ public abstract void setExpirationTime(long expirationTime);
+
+ @Property(name = "exportcontext")
+ public abstract InputStream getExportContext();
+ public abstract void setExportContext(InputStream exportContext);
+
+ @OneToMany
+ public abstract List<ExportedStateMapping> getExportedStates();
+
+ @Create
+ public abstract ExportedStateMapping internalCreateExportedState(String portletHandle);
+
+ public ExportedStateMapping createExportedState(String portletHandle)
+ {
+ return internalCreateExportedState(JCRPersister.PortletNameFormatter.encode(portletHandle));
+ }
+
+ @OneToMany
+ protected abstract List<ExportErrorMapping> getErrors();
+
+ @Create
+ public abstract ExportErrorMapping internalCreateError(String errorCode);
+
+ public ExportErrorMapping createError(String errorCode)
+ {
+ return internalCreateError(JCRPersister.QNameFormatter.encode(errorCode));
+ }
+
+ public void initFrom(ExportInfo exportInfo)
+ {
+ setExportTime(exportInfo.getExportTime());
+ setExpirationTime(exportInfo.getExpirationTime());
+
+ byte[] exportContext = exportInfo.getExportContext();
+ if(exportContext != null && exportContext.length > 0)
+ {
+ ByteArrayInputStream is = new ByteArrayInputStream(exportContext);
+ setExportContext(is);
+ }
+
+ List<ExportedStateMapping> exportedStates = getExportedStates();
+ exportedStates.clear();
+ for (String handle : exportInfo.getExportedPortletHandles())
+ {
+ ExportedStateMapping exportedState = createExportedState(handle);
+
+ // add then init idiom
+ exportedStates.add(exportedState);
+ exportedState.initFrom(handle, exportInfo.getPortletStateFor(handle));
+ }
+
+ List<ExportErrorMapping> errors = getErrors();
+ errors.clear();
+ for (Map.Entry<QName, List<String>> entry : exportInfo.getErrorCodesToFailedPortletHandlesMapping().entrySet())
+ {
+ QName errorCode = entry.getKey();
+ ExportErrorMapping error = createError(errorCode.toString());
+
+ // add then init idiom
+ errors.add(error);
+ error.initFrom(errorCode, entry.getValue());
+ }
+ }
+
+ public ExportInfo toExportInfo()
+ {
+ List<ExportedStateMapping> exportedStates = getExportedStates();
+ SortedMap<String, byte[]> states = new TreeMap<String,byte[]>();
+ for (ExportedStateMapping exportedState : exportedStates)
+ {
+ states.put(JCRPersister.PortletNameFormatter.decode(exportedState.getHandle()), Safe.getBytes(exportedState.getState()));
+ }
+
+ List<ExportErrorMapping> errors = getErrors();
+ SortedMap<QName, List<String>> errorCodesToHandles = new TreeMap<QName, List<String>>();
+ for (ExportErrorMapping error : errors)
+ {
+ errorCodesToHandles.put(error.getErrorCode(), error.getPortletHandles());
+ }
+
+ return new ExportInfo(getExportTime(), errorCodesToHandles, states, Safe.getBytes(getExportContext()));
+ }
+}
Added: portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportInfosMapping.java
===================================================================
--- portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportInfosMapping.java (rev 0)
+++ portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportInfosMapping.java 2010-09-20 18:13:41 UTC (rev 4259)
@@ -0,0 +1,47 @@
+/*
+ * 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.portal.wsrp.state.migration.mapping;
+
+import org.chromattic.api.annotations.Create;
+import org.chromattic.api.annotations.OneToMany;
+import org.chromattic.api.annotations.PrimaryType;
+
+import java.util.List;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+@PrimaryType(name = ExportInfosMapping.NODE_NAME)
+public abstract class ExportInfosMapping
+{
+
+ public static final String NODE_NAME = "wsrp:exportinfos";
+
+ @OneToMany
+ public abstract List<ExportInfoMapping> getExportInfos();
+
+ @Create
+ public abstract ExportInfoMapping createExportInfo(String exportTimeAsString);
+}
Added: portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportedStateMapping.java
===================================================================
--- portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportedStateMapping.java (rev 0)
+++ portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportedStateMapping.java 2010-09-20 18:13:41 UTC (rev 4259)
@@ -0,0 +1,59 @@
+/*
+ * 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.portal.wsrp.state.migration.mapping;
+
+import org.chromattic.api.annotations.PrimaryType;
+import org.chromattic.api.annotations.Property;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+@PrimaryType(name = ExportedStateMapping.NODE_NAME)
+public abstract class ExportedStateMapping
+{
+ public static final String NODE_NAME = "wsrp:exportedstate";
+
+ @Property(name = "handle")
+ public abstract String getHandle();
+ public abstract void setHandle(String handle);
+
+ @Property(name = "state")
+ public abstract InputStream getState();
+ public abstract void setState(InputStream state);
+
+ public void initFrom(String handle, byte[] state)
+ {
+ setHandle(handle);
+
+ if(state != null && state.length > 0)
+ {
+ ByteArrayInputStream is = new ByteArrayInputStream(state);
+ setState(is);
+ }
+ }
+}
Modified: portal/branches/wsrp2-integration/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml
===================================================================
--- portal/branches/wsrp2-integration/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml 2010-09-20 15:19:44 UTC (rev 4258)
+++ portal/branches/wsrp2-integration/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml 2010-09-20 18:13:41 UTC (rev 4259)
@@ -123,6 +123,7 @@
<value>war:/conf/wsrp/producer-configuration-nodetypes.xml</value>
<value>war:/conf/wsrp/producer-registrations-nodetypes.xml</value>
<value>war:/conf/wsrp/producer-pc-nodetypes.xml</value>
+ <value>war:/conf/wsrp/migration-nodetypes.xml</value>
</values-param>
</init-params>
</component-plugin>
Added: portal/branches/wsrp2-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp/migration-nodetypes.xml
===================================================================
--- portal/branches/wsrp2-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp/migration-nodetypes.xml (rev 0)
+++ portal/branches/wsrp2-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp/migration-nodetypes.xml 2010-09-20 18:13:41 UTC (rev 4259)
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!--
+ ~ 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.
+ -->
+
+<nodeTypes xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0"
+ xmlns:jcr="http://www.jcp.org/jcr/1.0">
+
+ <nodeType name="wsrp:exportinfos" isMixin="false" hasOrderableChildNodes="true" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <childNodeDefinitions>
+ <childNodeDefinition name="*" defaultPrimaryType="wsrp:exportinfo" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>wsrp:exportinfo</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="wsrp:exportinfo" isMixin="false" hasOrderableChildNodes="true" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="exporttime" requiredType="Long" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="expirationtime" requiredType="Long" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="exportcontext" requiredType="Binary" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ <childNodeDefinitions>
+ <childNodeDefinition name="*" defaultPrimaryType="wsrp:exportedstate" autoCreated="false"
+ mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>wsrp:exportedstate</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ <childNodeDefinition name="*" defaultPrimaryType="wsrp:exporterror" autoCreated="false"
+ mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>wsrp:exporterror</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="wsrp:exportedstate" isMixin="false" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="handle" requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="state" requiredType="Binary" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ </nodeType>
+
+ <nodeType name="wsrp:exporterror" isMixin="false" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="errorcode" requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="handles" requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ </nodeType>
+</nodeTypes>
\ No newline at end of file
15 years, 7 months
gatein SVN: r4258 - portal/branches/navcontroller/webui/portlet/src/main/java/org/exoplatform/webui/application/portlet.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-09-20 11:19:44 -0400 (Mon, 20 Sep 2010)
New Revision: 4258
Modified:
portal/branches/navcontroller/webui/portlet/src/main/java/org/exoplatform/webui/application/portlet/PortletURLBuilder.java
Log:
remove obsolete reminder
Modified: portal/branches/navcontroller/webui/portlet/src/main/java/org/exoplatform/webui/application/portlet/PortletURLBuilder.java
===================================================================
--- portal/branches/navcontroller/webui/portlet/src/main/java/org/exoplatform/webui/application/portlet/PortletURLBuilder.java 2010-09-20 14:04:17 UTC (rev 4257)
+++ portal/branches/navcontroller/webui/portlet/src/main/java/org/exoplatform/webui/application/portlet/PortletURLBuilder.java 2010-09-20 15:19:44 UTC (rev 4258)
@@ -27,8 +27,6 @@
import javax.portlet.PortletURL;
/**
- * julien todo : use PortletURL parameter instead of appending them to the url returned by the PortletURL
- *
* Created by The eXo Platform SAS
* Apr 3, 2007
*/
15 years, 7 months
gatein SVN: r4257 - in portal/branches/navcontroller: portlet/web/src/main/webapp/groovy/portal/webui/component and 3 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-09-20 10:04:17 -0400 (Mon, 20 Sep 2010)
New Revision: 4257
Modified:
portal/branches/navcontroller/pom.xml
portal/branches/navcontroller/portlet/web/src/main/webapp/groovy/portal/webui/component/UIPortalNavigation.gtmpl
portal/branches/navcontroller/web/portal/src/main/webapp/groovy/webui/core/UISitemapTree.gtmpl
portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/webui/application/ExoPortletInvocationContext.java
portal/branches/navcontroller/webui/portlet/src/main/java/org/exoplatform/webui/application/portlet/PortletURLBuilder.java
Log:
- fix an issue with the renaming of ResourceURL to ControllerURL in gtmpl
- update to portlet container 2.2.0-Beta02 and common 2.0.3-GA
- fix issue with PortletURL.getParameterMap().clear() that now does a proper reset
- use PortletURL properties to propagate ajax and confirm from PortletURLBuilder
Modified: portal/branches/navcontroller/pom.xml
===================================================================
--- portal/branches/navcontroller/pom.xml 2010-09-20 12:56:49 UTC (rev 4256)
+++ portal/branches/navcontroller/pom.xml 2010-09-20 14:04:17 UTC (rev 4257)
@@ -44,9 +44,9 @@
<org.jibx.version>1.2.1</org.jibx.version>
<org.shindig.version>1.0-r790473-Patch02</org.shindig.version>
<nl.captcha.simplecaptcha.version>1.1.1-GA-Patch01</nl.captcha.simplecaptcha.version>
- <org.gatein.common.version>2.0.2-GA</org.gatein.common.version>
+ <org.gatein.common.version>2.0.3-GA</org.gatein.common.version>
<org.gatein.wci.version>2.0.1-GA</org.gatein.wci.version>
- <org.gatein.pc.version>2.1.1-GA</org.gatein.pc.version>
+ <org.gatein.pc.version>2.2.0-Beta02</org.gatein.pc.version>
<org.picketlink.idm>1.1.5.CR01</org.picketlink.idm>
<org.gatein.wsrp.version>1.1.1-GA</org.gatein.wsrp.version>
<org.gatein.mop.version>1.0.3-GA</org.gatein.mop.version>
Modified: portal/branches/navcontroller/portlet/web/src/main/webapp/groovy/portal/webui/component/UIPortalNavigation.gtmpl
===================================================================
--- portal/branches/navcontroller/portlet/web/src/main/webapp/groovy/portal/webui/component/UIPortalNavigation.gtmpl 2010-09-20 12:56:49 UTC (rev 4256)
+++ portal/branches/navcontroller/portlet/web/src/main/webapp/groovy/portal/webui/component/UIPortalNavigation.gtmpl 2010-09-20 14:04:17 UTC (rev 4257)
@@ -5,7 +5,7 @@
import org.exoplatform.portal.webui.util.Util;
import org.gatein.common.text.EntityEncoder;
import org.exoplatform.portal.application.PortalRequestContext;
- import org.exoplatform.web.url.ResourceURL;
+ import org.exoplatform.web.url.ControllerURL;
import org.exoplatform.web.application.Parameter;
def rcontext = _ctx.getRequestContext();
@@ -22,9 +22,9 @@
navigations = uicomponent.getNavigations();
- ResourceURL nodeURL = pcontext.createURL(org.exoplatform.portal.url.navigation.NavigationLocator.TYPE);
+ ControllerURL nodeURL = pcontext.createURL(org.exoplatform.portal.url.navigation.NavigationLocator.TYPE);
- public void renderChildrenContainer(PageNavigation nav, PageNode node, ResourceURL nodeURL) {
+ public void renderChildrenContainer(PageNavigation nav, PageNode node, ControllerURL nodeURL) {
print """
<div class="MenuItemContainer" style="display: none;">
<div class="MenuItemDecorator">
@@ -54,7 +54,7 @@
""";
}
- public void renderChildNode(PageNavigation nav, PageNode node, ResourceURL nodeURL) {
+ public void renderChildNode(PageNavigation nav, PageNode node, ControllerURL nodeURL) {
PageNode selectedNode = uicomponent.getSelectedPageNode();
PageNavigation selectedNav = uicomponent.getSelectedNavigation();
String tabStyleNavigation = "NormalItem"; // OverItem
Modified: portal/branches/navcontroller/web/portal/src/main/webapp/groovy/webui/core/UISitemapTree.gtmpl
===================================================================
--- portal/branches/navcontroller/web/portal/src/main/webapp/groovy/webui/core/UISitemapTree.gtmpl 2010-09-20 12:56:49 UTC (rev 4256)
+++ portal/branches/navcontroller/web/portal/src/main/webapp/groovy/webui/core/UISitemapTree.gtmpl 2010-09-20 14:04:17 UTC (rev 4257)
@@ -4,7 +4,7 @@
import org.exoplatform.portal.application.PortalRequestContext;
import org.exoplatform.portal.webui.util.Util;
import org.exoplatform.portal.webui.navigation.TreeNode;
- import org.exoplatform.web.url.ResourceURL;
+ import org.exoplatform.web.url.ControllerURL;
import org.exoplatform.web.application.Parameter;
%>
<%
@@ -19,10 +19,10 @@
def actionExpandAll = uicomponent.event("ExpandAllNode");
def actionCollapseAll = uicomponent.event("CollapseAllNode");
- ResourceURL nodeURL = pcontext.createURL(org.exoplatform.portal.url.navigation.NavigationLocator.TYPE);
+ ControllerURL nodeURL = pcontext.createURL(org.exoplatform.portal.url.navigation.NavigationLocator.TYPE);
nodeURL.setAjax(true);
- public void renderNodes(TreeNode rootTree, ResourceURL nodeURL, boolean useAjax) {
+ public void renderNodes(TreeNode rootTree, ControllerURL nodeURL, boolean useAjax) {
List childrenNodes=rootTree.getChildren();
int childrenSize = childrenNodes.size() ;
int size = 0;
@@ -37,7 +37,7 @@
actionExpand = uicomponent.event("ExpandNode", nav.getId() + "::" + node.getUri());
def actionCollapse = "ajaxAsyncGetRequest('" + uicomponent.url("CollapseNode",nav.getId() + "::" + node.getUri()) + "', true)";
- String actionLink = nodeURL.setResource(node).toString();
+ String actionLink = nodeURL.setController(node).toString();
lastNode = '';
Modified: portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/webui/application/ExoPortletInvocationContext.java
===================================================================
--- portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/webui/application/ExoPortletInvocationContext.java 2010-09-20 12:56:49 UTC (rev 4256)
+++ portal/branches/navcontroller/webui/portal/src/main/java/org/exoplatform/portal/webui/application/ExoPortletInvocationContext.java 2010-09-20 14:04:17 UTC (rev 4257)
@@ -243,6 +243,12 @@
}
}
+ // Ajax support
+ url.setAjax("true".equals(containerURL.getProperties().get("ajax")));
+
+ // Confirm messsage
+ url.setConfirm(containerURL.getProperties().get("confirm"));
+
//
return url.toString();
}
Modified: portal/branches/navcontroller/webui/portlet/src/main/java/org/exoplatform/webui/application/portlet/PortletURLBuilder.java
===================================================================
--- portal/branches/navcontroller/webui/portlet/src/main/java/org/exoplatform/webui/application/portlet/PortletURLBuilder.java 2010-09-20 12:56:49 UTC (rev 4256)
+++ portal/branches/navcontroller/webui/portlet/src/main/java/org/exoplatform/webui/application/portlet/PortletURLBuilder.java 2010-09-20 14:04:17 UTC (rev 4257)
@@ -25,7 +25,6 @@
import org.exoplatform.webui.core.UIComponent;
import javax.portlet.PortletURL;
-import java.net.URLEncoder;
/**
* julien todo : use PortletURL parameter instead of appending them to the url returned by the PortletURL
@@ -46,61 +45,28 @@
public String createAjaxURL(UIComponent targetComponent, String action, String confirm, String targetBeanId, Parameter[] params)
{
- StringBuilder builder = new StringBuilder("javascript:");
- if (confirm != null && confirm.length() > 0)
- {
- builder.append("if(confirm('").append(confirm.replaceAll("'", "\\\\'")).append("'))");
- }
- builder.append("ajaxGet('");
- if (targetBeanId != null)
- {
- try
- {
- targetBeanId = URLEncoder.encode(targetBeanId, "utf-8");
- }
- catch (Exception e)
- {
- System.err.println(e.toString());
- }
- }
- createURL(builder, targetComponent, action, targetBeanId, params);
- builder.append("&ajaxRequest=true')");
- return builder.toString();
+ return createURL(true, confirm, targetComponent, action, targetBeanId, params);
}
public String createURL(UIComponent targetComponent, String action, String confirm, String targetBeanId, Parameter[] params)
{
- StringBuilder builder = new StringBuilder();
- boolean hasConfirm = confirm != null && confirm.length() > 0;
- if (hasConfirm)
- {
- builder.append("javascript:if(confirm('").append(confirm.replaceAll("'", "\\\\'")).append("'))");
- builder.append("window.location=\'");
- }
- if (targetBeanId != null)
- {
- try
- {
- targetBeanId = URLEncoder.encode(targetBeanId, "utf-8");
- }
- catch (Exception e)
- {
- System.err.println(e.toString());
- }
- }
- createURL(builder, targetComponent, action, targetBeanId, params);
- if (hasConfirm)
- builder.append("\';");
- return builder.toString();
+ return createURL(false, confirm, targetComponent, action, targetBeanId, params);
}
- private void createURL(StringBuilder builder, UIComponent targetComponent, String action, String targetBeanId,
+ private String createURL(
+ boolean ajax,
+ String confirm,
+ UIComponent targetComponent, String action, String targetBeanId,
Parameter[] params)
{
// Clear URL
url.getParameterMap().clear();
//
+ url.setProperty("ajax", Boolean.toString(ajax));
+ url.setProperty("confirm", confirm);
+
+ //
url.setParameter(UIComponent.UICOMPONENT, targetComponent.getId());
//
@@ -125,6 +91,6 @@
}
//
- builder.append(url.toString());
+ return url.toString();
}
}
15 years, 7 months
gatein SVN: r4256 - in components/pc/trunk: api and 12 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-09-20 08:56:49 -0400 (Mon, 20 Sep 2010)
New Revision: 4256
Modified:
components/pc/trunk/api/pom.xml
components/pc/trunk/bridge/pom.xml
components/pc/trunk/controller/pom.xml
components/pc/trunk/docs/pom.xml
components/pc/trunk/docs/user-guide/pom.xml
components/pc/trunk/federation/pom.xml
components/pc/trunk/jsr168api/pom.xml
components/pc/trunk/management/pom.xml
components/pc/trunk/mc/pom.xml
components/pc/trunk/pom.xml
components/pc/trunk/portal/pom.xml
components/pc/trunk/portlet/pom.xml
components/pc/trunk/samples/pom.xml
components/pc/trunk/test/pom.xml
Log:
[maven-release-plugin] prepare for next development iteration
Modified: components/pc/trunk/api/pom.xml
===================================================================
--- components/pc/trunk/api/pom.xml 2010-09-20 12:56:24 UTC (rev 4255)
+++ components/pc/trunk/api/pom.xml 2010-09-20 12:56:49 UTC (rev 4256)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-Beta02</version>
+ <version>2.2.0-Beta03-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.gatein.pc</groupId>
Modified: components/pc/trunk/bridge/pom.xml
===================================================================
--- components/pc/trunk/bridge/pom.xml 2010-09-20 12:56:24 UTC (rev 4255)
+++ components/pc/trunk/bridge/pom.xml 2010-09-20 12:56:49 UTC (rev 4256)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-Beta02</version>
+ <version>2.2.0-Beta03-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-bridge</artifactId>
Modified: components/pc/trunk/controller/pom.xml
===================================================================
--- components/pc/trunk/controller/pom.xml 2010-09-20 12:56:24 UTC (rev 4255)
+++ components/pc/trunk/controller/pom.xml 2010-09-20 12:56:49 UTC (rev 4256)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-Beta02</version>
+ <version>2.2.0-Beta03-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-controller</artifactId>
Modified: components/pc/trunk/docs/pom.xml
===================================================================
--- components/pc/trunk/docs/pom.xml 2010-09-20 12:56:24 UTC (rev 4255)
+++ components/pc/trunk/docs/pom.xml 2010-09-20 12:56:49 UTC (rev 4256)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-Beta02</version>
+ <version>2.2.0-Beta03-SNAPSHOT</version>
</parent>
<artifactId>docs-aggregator</artifactId>
<packaging>pom</packaging>
Modified: components/pc/trunk/docs/user-guide/pom.xml
===================================================================
--- components/pc/trunk/docs/user-guide/pom.xml 2010-09-20 12:56:24 UTC (rev 4255)
+++ components/pc/trunk/docs/user-guide/pom.xml 2010-09-20 12:56:49 UTC (rev 4256)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-Beta02</version>
+ <version>2.2.0-Beta03-SNAPSHOT</version>
</parent>
<groupId>org.gatein.pc</groupId>
<artifactId>user-guide-${translation}</artifactId>
Modified: components/pc/trunk/federation/pom.xml
===================================================================
--- components/pc/trunk/federation/pom.xml 2010-09-20 12:56:24 UTC (rev 4255)
+++ components/pc/trunk/federation/pom.xml 2010-09-20 12:56:49 UTC (rev 4256)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-Beta02</version>
+ <version>2.2.0-Beta03-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-federation</artifactId>
Modified: components/pc/trunk/jsr168api/pom.xml
===================================================================
--- components/pc/trunk/jsr168api/pom.xml 2010-09-20 12:56:24 UTC (rev 4255)
+++ components/pc/trunk/jsr168api/pom.xml 2010-09-20 12:56:49 UTC (rev 4256)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-Beta02</version>
+ <version>2.2.0-Beta03-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-jsr168api</artifactId>
Modified: components/pc/trunk/management/pom.xml
===================================================================
--- components/pc/trunk/management/pom.xml 2010-09-20 12:56:24 UTC (rev 4255)
+++ components/pc/trunk/management/pom.xml 2010-09-20 12:56:49 UTC (rev 4256)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-Beta02</version>
+ <version>2.2.0-Beta03-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-management</artifactId>
Modified: components/pc/trunk/mc/pom.xml
===================================================================
--- components/pc/trunk/mc/pom.xml 2010-09-20 12:56:24 UTC (rev 4255)
+++ components/pc/trunk/mc/pom.xml 2010-09-20 12:56:49 UTC (rev 4256)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-Beta02</version>
+ <version>2.2.0-Beta03-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-mc</artifactId>
Modified: components/pc/trunk/pom.xml
===================================================================
--- components/pc/trunk/pom.xml 2010-09-20 12:56:24 UTC (rev 4255)
+++ components/pc/trunk/pom.xml 2010-09-20 12:56:49 UTC (rev 4256)
@@ -29,7 +29,7 @@
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-Beta02</version>
+ <version>2.2.0-Beta03-SNAPSHOT</version>
<packaging>pom</packaging>
<parent>
@@ -39,9 +39,9 @@
</parent>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/gatein/components/pc/tags/2.2.0-Be...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/gatein/components/pc/tags/2.2.0-Beta02</developerConnection>
- <url>http://fisheye.jboss.org/browse/gatein/components/pc/tags/2.2.0-Beta02</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/gatein/components/pc/trunk/</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/gatein/components/pc/trunk/</developerConnection>
+ <url>http://fisheye.jboss.org/browse/gatein/components/pc/trunk/</url>
</scm>
<properties>
Modified: components/pc/trunk/portal/pom.xml
===================================================================
--- components/pc/trunk/portal/pom.xml 2010-09-20 12:56:24 UTC (rev 4255)
+++ components/pc/trunk/portal/pom.xml 2010-09-20 12:56:49 UTC (rev 4256)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-Beta02</version>
+ <version>2.2.0-Beta03-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-portal</artifactId>
Modified: components/pc/trunk/portlet/pom.xml
===================================================================
--- components/pc/trunk/portlet/pom.xml 2010-09-20 12:56:24 UTC (rev 4255)
+++ components/pc/trunk/portlet/pom.xml 2010-09-20 12:56:49 UTC (rev 4256)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-Beta02</version>
+ <version>2.2.0-Beta03-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-portlet</artifactId>
Modified: components/pc/trunk/samples/pom.xml
===================================================================
--- components/pc/trunk/samples/pom.xml 2010-09-20 12:56:24 UTC (rev 4255)
+++ components/pc/trunk/samples/pom.xml 2010-09-20 12:56:49 UTC (rev 4256)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-Beta02</version>
+ <version>2.2.0-Beta03-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-samples</artifactId>
Modified: components/pc/trunk/test/pom.xml
===================================================================
--- components/pc/trunk/test/pom.xml 2010-09-20 12:56:24 UTC (rev 4255)
+++ components/pc/trunk/test/pom.xml 2010-09-20 12:56:49 UTC (rev 4256)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-Beta02</version>
+ <version>2.2.0-Beta03-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-test</artifactId>
15 years, 7 months
gatein SVN: r4255 - components/pc/tags.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-09-20 08:56:24 -0400 (Mon, 20 Sep 2010)
New Revision: 4255
Added:
components/pc/tags/2.2.0-Beta02/
Log:
[maven-scm] copy for tag 2.2.0-Beta02
Copied: components/pc/tags/2.2.0-Beta02 (from rev 4254, components/pc/trunk)
15 years, 7 months
gatein SVN: r4254 - in components/pc/trunk: api and 12 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-09-20 08:56:03 -0400 (Mon, 20 Sep 2010)
New Revision: 4254
Modified:
components/pc/trunk/api/pom.xml
components/pc/trunk/bridge/pom.xml
components/pc/trunk/controller/pom.xml
components/pc/trunk/docs/pom.xml
components/pc/trunk/docs/user-guide/pom.xml
components/pc/trunk/federation/pom.xml
components/pc/trunk/jsr168api/pom.xml
components/pc/trunk/management/pom.xml
components/pc/trunk/mc/pom.xml
components/pc/trunk/pom.xml
components/pc/trunk/portal/pom.xml
components/pc/trunk/portlet/pom.xml
components/pc/trunk/samples/pom.xml
components/pc/trunk/test/pom.xml
Log:
[maven-release-plugin] prepare release 2.2.0-Beta02
Modified: components/pc/trunk/api/pom.xml
===================================================================
--- components/pc/trunk/api/pom.xml 2010-09-20 12:13:48 UTC (rev 4253)
+++ components/pc/trunk/api/pom.xml 2010-09-20 12:56:03 UTC (rev 4254)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-Beta02-SNAPSHOT</version>
+ <version>2.2.0-Beta02</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.gatein.pc</groupId>
Modified: components/pc/trunk/bridge/pom.xml
===================================================================
--- components/pc/trunk/bridge/pom.xml 2010-09-20 12:13:48 UTC (rev 4253)
+++ components/pc/trunk/bridge/pom.xml 2010-09-20 12:56:03 UTC (rev 4254)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-Beta02-SNAPSHOT</version>
+ <version>2.2.0-Beta02</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-bridge</artifactId>
Modified: components/pc/trunk/controller/pom.xml
===================================================================
--- components/pc/trunk/controller/pom.xml 2010-09-20 12:13:48 UTC (rev 4253)
+++ components/pc/trunk/controller/pom.xml 2010-09-20 12:56:03 UTC (rev 4254)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-Beta02-SNAPSHOT</version>
+ <version>2.2.0-Beta02</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-controller</artifactId>
Modified: components/pc/trunk/docs/pom.xml
===================================================================
--- components/pc/trunk/docs/pom.xml 2010-09-20 12:13:48 UTC (rev 4253)
+++ components/pc/trunk/docs/pom.xml 2010-09-20 12:56:03 UTC (rev 4254)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-Beta02-SNAPSHOT</version>
+ <version>2.2.0-Beta02</version>
</parent>
<artifactId>docs-aggregator</artifactId>
<packaging>pom</packaging>
Modified: components/pc/trunk/docs/user-guide/pom.xml
===================================================================
--- components/pc/trunk/docs/user-guide/pom.xml 2010-09-20 12:13:48 UTC (rev 4253)
+++ components/pc/trunk/docs/user-guide/pom.xml 2010-09-20 12:56:03 UTC (rev 4254)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-Beta02-SNAPSHOT</version>
+ <version>2.2.0-Beta02</version>
</parent>
<groupId>org.gatein.pc</groupId>
<artifactId>user-guide-${translation}</artifactId>
Modified: components/pc/trunk/federation/pom.xml
===================================================================
--- components/pc/trunk/federation/pom.xml 2010-09-20 12:13:48 UTC (rev 4253)
+++ components/pc/trunk/federation/pom.xml 2010-09-20 12:56:03 UTC (rev 4254)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-Beta02-SNAPSHOT</version>
+ <version>2.2.0-Beta02</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-federation</artifactId>
Modified: components/pc/trunk/jsr168api/pom.xml
===================================================================
--- components/pc/trunk/jsr168api/pom.xml 2010-09-20 12:13:48 UTC (rev 4253)
+++ components/pc/trunk/jsr168api/pom.xml 2010-09-20 12:56:03 UTC (rev 4254)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-Beta02-SNAPSHOT</version>
+ <version>2.2.0-Beta02</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-jsr168api</artifactId>
Modified: components/pc/trunk/management/pom.xml
===================================================================
--- components/pc/trunk/management/pom.xml 2010-09-20 12:13:48 UTC (rev 4253)
+++ components/pc/trunk/management/pom.xml 2010-09-20 12:56:03 UTC (rev 4254)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-Beta02-SNAPSHOT</version>
+ <version>2.2.0-Beta02</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-management</artifactId>
Modified: components/pc/trunk/mc/pom.xml
===================================================================
--- components/pc/trunk/mc/pom.xml 2010-09-20 12:13:48 UTC (rev 4253)
+++ components/pc/trunk/mc/pom.xml 2010-09-20 12:56:03 UTC (rev 4254)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-Beta02-SNAPSHOT</version>
+ <version>2.2.0-Beta02</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-mc</artifactId>
Modified: components/pc/trunk/pom.xml
===================================================================
--- components/pc/trunk/pom.xml 2010-09-20 12:13:48 UTC (rev 4253)
+++ components/pc/trunk/pom.xml 2010-09-20 12:56:03 UTC (rev 4254)
@@ -29,7 +29,7 @@
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-Beta02-SNAPSHOT</version>
+ <version>2.2.0-Beta02</version>
<packaging>pom</packaging>
<parent>
@@ -39,9 +39,9 @@
</parent>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/gatein/components/pc/trunk/</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/gatein/components/pc/trunk/</developerConnection>
- <url>http://fisheye.jboss.org/browse/gatein/components/pc/trunk/</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/gatein/components/pc/tags/2.2.0-Be...</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/gatein/components/pc/tags/2.2.0-Beta02</developerConnection>
+ <url>http://fisheye.jboss.org/browse/gatein/components/pc/tags/2.2.0-Beta02</url>
</scm>
<properties>
Modified: components/pc/trunk/portal/pom.xml
===================================================================
--- components/pc/trunk/portal/pom.xml 2010-09-20 12:13:48 UTC (rev 4253)
+++ components/pc/trunk/portal/pom.xml 2010-09-20 12:56:03 UTC (rev 4254)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-Beta02-SNAPSHOT</version>
+ <version>2.2.0-Beta02</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-portal</artifactId>
Modified: components/pc/trunk/portlet/pom.xml
===================================================================
--- components/pc/trunk/portlet/pom.xml 2010-09-20 12:13:48 UTC (rev 4253)
+++ components/pc/trunk/portlet/pom.xml 2010-09-20 12:56:03 UTC (rev 4254)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-Beta02-SNAPSHOT</version>
+ <version>2.2.0-Beta02</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-portlet</artifactId>
Modified: components/pc/trunk/samples/pom.xml
===================================================================
--- components/pc/trunk/samples/pom.xml 2010-09-20 12:13:48 UTC (rev 4253)
+++ components/pc/trunk/samples/pom.xml 2010-09-20 12:56:03 UTC (rev 4254)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-Beta02-SNAPSHOT</version>
+ <version>2.2.0-Beta02</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-samples</artifactId>
Modified: components/pc/trunk/test/pom.xml
===================================================================
--- components/pc/trunk/test/pom.xml 2010-09-20 12:13:48 UTC (rev 4253)
+++ components/pc/trunk/test/pom.xml 2010-09-20 12:56:03 UTC (rev 4254)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.pc</groupId>
<artifactId>pc-parent</artifactId>
- <version>2.2.0-Beta02-SNAPSHOT</version>
+ <version>2.2.0-Beta02</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>pc-test</artifactId>
15 years, 7 months
gatein SVN: r4253 - in components/pc/trunk: portal/src/main/java/org/gatein/pc/portal/jsp/taglib and 1 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-09-20 08:13:48 -0400 (Mon, 20 Sep 2010)
New Revision: 4253
Modified:
components/pc/trunk/api/src/main/java/org/gatein/pc/api/ContainerURL.java
components/pc/trunk/portal/src/main/java/org/gatein/pc/portal/jsp/taglib/PortletURLTag.java
components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/BaseURLImpl.java
components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/PortletURLImpl.java
Log:
GTNPC-29 : Basic support for URL properties
Modified: components/pc/trunk/api/src/main/java/org/gatein/pc/api/ContainerURL.java
===================================================================
--- components/pc/trunk/api/src/main/java/org/gatein/pc/api/ContainerURL.java 2010-09-20 11:43:54 UTC (rev 4252)
+++ components/pc/trunk/api/src/main/java/org/gatein/pc/api/ContainerURL.java 2010-09-20 12:13:48 UTC (rev 4253)
@@ -22,6 +22,8 @@
*/
package org.gatein.pc.api;
+import java.util.Map;
+
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 630 $
@@ -48,4 +50,12 @@
* @return the navigational state
*/
StateString getNavigationalState();
+
+ /**
+ * Returns a set of properties associated with this URL. The returned map cannot be modified.
+ *
+ * @return the property map
+ */
+ Map<String, String> getProperties();
+
}
Modified: components/pc/trunk/portal/src/main/java/org/gatein/pc/portal/jsp/taglib/PortletURLTag.java
===================================================================
--- components/pc/trunk/portal/src/main/java/org/gatein/pc/portal/jsp/taglib/PortletURLTag.java 2010-09-20 11:43:54 UTC (rev 4252)
+++ components/pc/trunk/portal/src/main/java/org/gatein/pc/portal/jsp/taglib/PortletURLTag.java 2010-09-20 12:13:48 UTC (rev 4253)
@@ -33,6 +33,7 @@
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.SimpleTagSupport;
+import java.util.Collections;
import java.util.Map;
import java.io.IOException;
@@ -124,6 +125,11 @@
{
return ws;
}
+
+ public Map<String, String> getProperties()
+ {
+ return Collections.emptyMap();
+ }
};
try
Modified: components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/BaseURLImpl.java
===================================================================
--- components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/BaseURLImpl.java 2010-09-20 11:43:54 UTC (rev 4252)
+++ components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/BaseURLImpl.java 2010-09-20 12:13:48 UTC (rev 4253)
@@ -31,6 +31,8 @@
import javax.portlet.BaseURL;
import javax.portlet.PortletSecurityException;
import javax.portlet.PortletURLGenerationListener;
+import java.util.Collections;
+import java.util.HashMap;
import java.util.Map;
import java.io.Writer;
import java.io.IOException;
@@ -126,25 +128,21 @@
return url.getParameters();
}
- public void addProperty(String s, String s1)
+ public void addProperty(String key, String value)
{
- if (s == null)
- {
- throw new IllegalArgumentException("property name cannot be null");
- }
-
- //TODO:
-
+ // We only support mono valued properties
+ setProperty(key, value);
}
- public void setProperty(String s, String s1)
+ public void setProperty(String key, String value)
{
- if (s == null)
+ if (key == null)
{
throw new IllegalArgumentException("property name cannot be null");
}
- //TODO:
+ //
+ getContainerURL().setProperty(key, value);
}
private InternalContainerURL blah()
@@ -212,6 +210,46 @@
protected static abstract class InternalContainerURL implements ContainerURL
{
+ /** . */
+ static final Map<String, String> EMPTY_MAP = Collections.emptyMap();
+
+ /** . */
+ private Map<String, String> properties;
+
+ protected InternalContainerURL()
+ {
+ this.properties = EMPTY_MAP;
+ }
+
+ protected InternalContainerURL(InternalContainerURL that)
+ {
+ this.properties = that.properties.isEmpty() ? EMPTY_MAP : new HashMap<String, String>(this.properties);
+ }
+
+ public final Map<String, String> getProperties()
+ {
+ return properties;
+ }
+
+ private void setProperty(String key, String value)
+ {
+ if (value == null)
+ {
+ if (properties.size() > 0)
+ {
+ properties.remove(key);
+ }
+ }
+ else
+ {
+ if (properties == EMPTY_MAP)
+ {
+ properties = new HashMap<String, String>();
+ }
+ properties.put(key, value);
+ }
+ }
+
protected abstract void setParameter(String name, String value);
protected abstract void setParameter(String name, String[] values);
Modified: components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/PortletURLImpl.java
===================================================================
--- components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/PortletURLImpl.java 2010-09-20 11:43:54 UTC (rev 4252)
+++ components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/PortletURLImpl.java 2010-09-20 12:13:48 UTC (rev 4253)
@@ -164,6 +164,9 @@
protected InternalPortletURL(InternalPortletURL original)
{
+ super(original);
+
+ //
this.windowState = original.windowState;
this.portletMode = original.portletMode;
}
15 years, 7 months
gatein SVN: r4252 - in components/pc/trunk: portlet/src/main/java/org/gatein/pc/portlet/impl/jsr286/taglib and 1 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2010-09-20 07:43:54 -0400 (Mon, 20 Sep 2010)
New Revision: 4252
Added:
components/pc/trunk/test/src/test/java/org/gatein/pc/test/portlet/jsr286/api/portleturl/ParameterMapTestCase.java
Modified:
components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/PortletURLImpl.java
components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/ResourceURLImpl.java
components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr286/taglib/GenerateURL286Tag.java
Log:
GTNPC-27 : The map returned by BaseURL.getParameterMap() should allow modification of the parameters while preserving the integrity of the String[] values
Modified: components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/PortletURLImpl.java
===================================================================
--- components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/PortletURLImpl.java 2010-09-20 08:45:10 UTC (rev 4251)
+++ components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/PortletURLImpl.java 2010-09-20 11:43:54 UTC (rev 4252)
@@ -298,7 +298,7 @@
protected Map<String, String[]> getParameters()
{
- return ParameterMap.clone(parameters.getMap());
+ return parameters.getMap();
}
}
}
Modified: components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/ResourceURLImpl.java
===================================================================
--- components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/ResourceURLImpl.java 2010-09-20 08:45:10 UTC (rev 4251)
+++ components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr168/api/ResourceURLImpl.java 2010-09-20 11:43:54 UTC (rev 4252)
@@ -232,7 +232,7 @@
protected Map<String, String[]> getParameters()
{
- return ParameterMap.clone(parameters.getParameters());
+ return parameters.getParameters();
}
public StateString getResourceState()
Modified: components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr286/taglib/GenerateURL286Tag.java
===================================================================
--- components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr286/taglib/GenerateURL286Tag.java 2010-09-20 08:45:10 UTC (rev 4251)
+++ components/pc/trunk/portlet/src/main/java/org/gatein/pc/portlet/impl/jsr286/taglib/GenerateURL286Tag.java 2010-09-20 11:43:54 UTC (rev 4252)
@@ -75,7 +75,8 @@
{
// Parameters values specified in tag need to be pre-pended
- Map<String, String[]> parameters = portletURL.getParameterMap();
+ // Clone the map
+ Map<String, String[]> parameters = new HashMap<String, String[]>(portletURL.getParameterMap());
Map<String, String[]> privateParams = getPortletRequest().getPrivateParameterMap();
@@ -112,7 +113,7 @@
{
// Introduced in jsr 286 - the empty param tag value removes the parameter
- Map<String, String[]> parameters = portletURL.getParameterMap();
+ Map<String, String[]> parameters = new HashMap<String, String[]>(portletURL.getParameterMap());
Map<String, String[]> tagParams = getURLParameters();
Added: components/pc/trunk/test/src/test/java/org/gatein/pc/test/portlet/jsr286/api/portleturl/ParameterMapTestCase.java
===================================================================
--- components/pc/trunk/test/src/test/java/org/gatein/pc/test/portlet/jsr286/api/portleturl/ParameterMapTestCase.java (rev 0)
+++ components/pc/trunk/test/src/test/java/org/gatein/pc/test/portlet/jsr286/api/portleturl/ParameterMapTestCase.java 2010-09-20 11:43:54 UTC (rev 4252)
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 2010 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.
+ */
+
+package org.gatein.pc.test.portlet.jsr286.api.portleturl;
+
+import org.gatein.pc.test.portlet.framework.UTP1;
+import org.gatein.pc.test.unit.Assertion;
+import org.gatein.pc.test.unit.PortletTestCase;
+import org.gatein.pc.test.unit.PortletTestContext;
+import org.gatein.pc.test.unit.actions.PortletRenderTestAction;
+import org.gatein.pc.test.unit.annotations.TestCase;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
+
+import javax.portlet.Portlet;
+import javax.portlet.PortletException;
+import javax.portlet.PortletURL;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.Map;
+
+import static org.jboss.unit.api.Assert.assertEquals;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+(a)TestCase(Assertion.API286_BASE_URL_4)
+public class ParameterMapTestCase
+{
+ public ParameterMapTestCase(PortletTestCase seq)
+ {
+
+ seq.bindAction(0, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws PortletException, IOException
+ {
+ PortletURL url = response.createRenderURL();
+
+ // Set parameter
+ url.setParameter("foo", "bar");
+
+ // Clear parameters
+ Map<String, String[]> map = url.getParameterMap();
+
+ // Check expected entry
+ String[] bar1 = map.get("foo");
+ assertEquals(1, bar1.length);
+ assertEquals("bar", bar1[0]);
+
+ // Check that the entry we had a copy of the value
+ url.setParameter("foo", "juu");
+ assertEquals("bar", bar1[0]);
+
+ //
+ map.clear();
+
+ // Invoker with the no parameter URL
+ return new InvokeGetResponse(url.toString());
+ }
+ });
+ seq.bindAction(1, UTP1.RENDER_JOIN_POINT, new PortletRenderTestAction()
+ {
+ protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws PortletException, IOException
+ {
+ // It should be empty
+ assertEquals(Collections.<Object, Object>emptyMap(), request.getParameterMap());
+
+ // Done
+ return new EndTestResponse();
+ }
+ });
+ }
+}
15 years, 7 months