Author: thomas.heute(a)jboss.com
Date: 2010-09-28 03:34:35 -0400 (Tue, 28 Sep 2010)
New Revision: 4403
Added:
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/MOPPortalStructureProvider.java
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/StoresByPathManager.java
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/JCRMigrationService.java
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportErrorMapping.java
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportInfoMapping.java
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportInfosMapping.java
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportedStateMapping.java
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/wsrp/migration-nodetypes.xml
Removed:
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/JCRMigrationService.java
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportErrorMapping.java
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportInfoMapping.java
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportInfosMapping.java
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportedStateMapping.java
Modified:
epp/portal/branches/EPP_5_1_Branch/component/wsrp/pom.xml
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/WSRPServiceIntegration.java
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/JCRPersister.java
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/JCRRegistrationPersistenceManager.java
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/RegistrationMapping.java
epp/portal/branches/EPP_5_1_Branch/pom.xml
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/wsrp/producer-registrations-nodetypes.xml
Log:
JBEPP-506: Merge WSRP-2 changes
Modified: epp/portal/branches/EPP_5_1_Branch/component/wsrp/pom.xml
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/component/wsrp/pom.xml 2010-09-28 03:32:25 UTC (rev
4402)
+++ epp/portal/branches/EPP_5_1_Branch/component/wsrp/pom.xml 2010-09-28 07:34:35 UTC (rev
4403)
@@ -46,6 +46,10 @@
<scope>provided</scope>
</dependency>
<dependency>
+ <groupId>org.gatein.mop</groupId>
+ <artifactId>mop-api</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.gatein.wsrp</groupId>
<artifactId>wsrp-integration-api</artifactId>
<scope>provided</scope>
@@ -75,6 +79,11 @@
<artifactId>exo.portal.component.common</artifactId>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.component.portal</artifactId>
+ <scope>provided</scope>
+ </dependency>
<dependency>
<groupId>org.exoplatform.jcr</groupId>
Copied:
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/MOPPortalStructureProvider.java
(from rev 4359,
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/MOPPortalStructureProvider.java)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/MOPPortalStructureProvider.java
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/MOPPortalStructureProvider.java 2010-09-28
07:34:35 UTC (rev 4403)
@@ -0,0 +1,214 @@
+/*
+ * 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;
+
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.portal.mop.Described;
+import org.exoplatform.portal.pom.config.POMSession;
+import org.exoplatform.portal.pom.config.POMSessionManager;
+import org.exoplatform.portal.pom.data.PageKey;
+import org.exoplatform.portal.pom.spi.wsrp.WSRP;
+import org.gatein.common.util.ParameterValidation;
+import org.gatein.mop.api.content.Customization;
+import org.gatein.mop.api.workspace.ObjectType;
+import org.gatein.mop.api.workspace.Page;
+import org.gatein.mop.api.workspace.Site;
+import org.gatein.mop.api.workspace.Workspace;
+import org.gatein.mop.api.workspace.ui.UIComponent;
+import org.gatein.mop.api.workspace.ui.UIContainer;
+import org.gatein.mop.api.workspace.ui.UIWindow;
+import org.gatein.pc.api.PortletContext;
+import org.gatein.pc.api.PortletStateType;
+import org.gatein.pc.api.StatefulPortletContext;
+import org.gatein.wsrp.api.PortalStructureProvider;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+public class MOPPortalStructureProvider implements PortalStructureProvider
+{
+ private final POMSessionManager pomManager;
+ private Map<String, PageInfo> pageInfos;
+ private Map<String, String> windowIdToUUIDs;
+
+ public MOPPortalStructureProvider(ExoContainer container)
+ {
+ pomManager =
(POMSessionManager)container.getComponentInstanceOfType(POMSessionManager.class);
+ windowIdToUUIDs = new HashMap<String, String>();
+ }
+
+ public List<String> getPageIdentifiers()
+ {
+ if (pageInfos == null)
+ {
+ POMSession session = pomManager.getSession();
+ Workspace workspace = session.getWorkspace();
+ Collection<Site> sites = workspace.getSites(ObjectType.PORTAL_SITE);
+
+ pageInfos = new HashMap<String, PageInfo>();
+ for (Site site : sites)
+ {
+ Page page = site.getRootPage().getChild("pages");
+ if (page != null)
+ {
+ processPage(page, true);
+ }
+ }
+ }
+
+ LinkedList<String> identifiers = new
LinkedList<String>(pageInfos.keySet());
+ Collections.sort(identifiers);
+ return identifiers;
+ }
+
+ private void processPage(Page page, boolean ignoreCurrent)
+ {
+ if (!ignoreCurrent)
+ {
+ Described described = page.adapt(Described.class);
+ PageInfo pageInfo = new PageInfo(page.getObjectId());
+ pageInfos.put(described.getName(), pageInfo);
+ UIContainer container = page.getRootComponent();
+ processContainer(container, pageInfo);
+ }
+
+ Collection<Page> children = page.getChildren();
+ if (ParameterValidation.existsAndIsNotEmpty(children))
+ {
+ for (Page child : children)
+ {
+ processPage(child, false);
+ }
+ }
+ }
+
+ public List<String> getWindowIdentifiersFor(String pageId)
+ {
+ PageInfo pageInfo = pageInfos.get(pageId);
+ ParameterValidation.throwIllegalArgExceptionIfNull(pageInfo, "PageInfo for
" + pageId);
+
+ return pageInfo.getChildrenWindows();
+ }
+
+ private void processContainer(UIContainer container, PageInfo pageInfo)
+ {
+ List<UIComponent> components = container.getComponents();
+ for (UIComponent component : components)
+ {
+ ObjectType<? extends UIComponent> type = component.getObjectType();
+ if (ObjectType.WINDOW.equals(type))
+ {
+ Described described = component.adapt(Described.class);
+ String name = described.getName();
+ windowIdToUUIDs.put(name, component.getObjectId());
+ pageInfo.addWindow(name);
+ }
+ else if (ObjectType.CONTAINER.equals(type))
+ {
+ processContainer((UIContainer)component, pageInfo);
+ }
+ else
+ {
+ // ignore
+ }
+ }
+ }
+
+ public void assignPortletToWindow(PortletContext portletContext, String windowId,
String pageId)
+ {
+ String uuid = windowIdToUUIDs.get(windowId);
+ ParameterValidation.throwIllegalArgExceptionIfNull(uuid, "UUID for " +
windowId);
+
+ // get the window
+ POMSession session = pomManager.getSession();
+ UIWindow window = session.findObjectById(ObjectType.WINDOW, uuid);
+
+ // construct the new customization state
+ WSRP wsrp = new WSRP();
+ String portletId = portletContext.getId();
+ wsrp.setPortletId(portletId);
+ if (portletContext instanceof StatefulPortletContext)
+ {
+ StatefulPortletContext context = (StatefulPortletContext)portletContext;
+ if (PortletStateType.OPAQUE.equals(context.getType()))
+ {
+ wsrp.setState((byte[])context.getState());
+ }
+ else
+ {
+ throw new IllegalArgumentException("Don't know how to deal with
state: " + context.getState());
+ }
+ }
+
+ // destroy existing customization as otherwise re-customizing will fail
+ Customization<?> customization = window.getCustomization();
+ customization.destroy();
+
+ // and re-customize
+ window.customize(WSRP.CONTENT_TYPE, portletId, wsrp);
+
+ // mark page for cache invalidation otherwise DataCache will use the previous
customization id when trying to set
+ // the portlet state in UIPortlet.setState and will not find it resulting in an
error
+ Page page = window.getPage();
+ session.scheduleForEviction(new PageKey("portal",
page.getSite().getName(), page.getName()));
+
+ // save
+ session.close(true);
+ }
+
+ private static class PageInfo
+ {
+ private String uuid;
+ private List<String> childrenWindows;
+
+ private PageInfo(String uuid)
+ {
+ this.uuid = uuid;
+ childrenWindows = new LinkedList<String>();
+ }
+
+ public String getUUID()
+ {
+ return uuid;
+ }
+
+ public List<String> getChildrenWindows()
+ {
+ return childrenWindows;
+ }
+
+ public void addWindow(String windowName)
+ {
+ childrenWindows.add(windowName);
+ }
+ }
+}
Modified:
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/WSRPServiceIntegration.java
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/WSRPServiceIntegration.java 2010-09-28
03:32:25 UTC (rev 4402)
+++
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/WSRPServiceIntegration.java 2010-09-28
07:34:35 UTC (rev 4403)
@@ -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;
@@ -54,9 +55,11 @@
import org.gatein.wci.WebAppListener;
import org.gatein.wci.impl.DefaultServletContainerFactory;
import org.gatein.wsrp.WSRPConstants;
+import org.gatein.wsrp.consumer.migration.MigrationService;
import org.gatein.wsrp.consumer.registry.ActivatingNullInvokerHandler;
import org.gatein.wsrp.consumer.registry.ConsumerRegistry;
import org.gatein.wsrp.producer.ProducerHolder;
+import org.gatein.wsrp.producer.WSRPPortletInvoker;
import org.gatein.wsrp.producer.WSRPProducer;
import org.gatein.wsrp.producer.config.ProducerConfigurationService;
import org.picocontainer.Startable;
@@ -198,10 +201,15 @@
producerPortletInvoker.setPersistenceManager(producerPersistenceManager);
producerPortletInvoker.setStateManagementPolicy(producerStateManagementPolicy);
producerPortletInvoker.setStateConverter(producerStateConverter);
+
+ WSRPPortletInvoker wsrpPortletInvoker = new WSRPPortletInvoker();
+ wsrpPortletInvoker.setNext(producerPortletInvoker);
+ wsrpPortletInvoker.setRegistrationManager(registrationManager);
+
// create and wire WSRP producer
producer = ProducerHolder.getProducer(true);
- producer.setPortletInvoker(producerPortletInvoker);
+ producer.setPortletInvoker(wsrpPortletInvoker);
producer.setRegistrationManager(registrationManager);
producer.setConfigurationService(producerConfigurationService);
@@ -227,6 +235,12 @@
consumerRegistry = new JCRConsumerRegistry(container);
consumerRegistry.setFederatingPortletInvoker(federatingPortletInvoker);
consumerRegistry.setSessionEventBroadcaster(sessionEventBroadcaster);
+
+ // migration service
+ MigrationService migrationService = new JCRMigrationService(container);
+ migrationService.setStructureProvider(new
MOPPortalStructureProvider(container));
+ consumerRegistry.setMigrationService(migrationService);
+
consumerRegistry.start();
// set up a NullInvokerHandler so that when a remote producer is queried, we can
start it if needed
Modified:
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/JCRPersister.java
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/JCRPersister.java 2010-09-28
03:32:25 UTC (rev 4402)
+++
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/JCRPersister.java 2010-09-28
07:34:35 UTC (rev 4403)
@@ -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);
}
Copied:
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/StoresByPathManager.java
(from rev 4359,
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/StoresByPathManager.java)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/StoresByPathManager.java
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/StoresByPathManager.java 2010-09-28
07:34:35 UTC (rev 4403)
@@ -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:
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java 2010-09-28
03:32:25 UTC (rev 4402)
+++
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java 2010-09-28
07:34:35 UTC (rev 4403)
@@ -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)
Copied:
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration
(from rev 4359,
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration)
Deleted:
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/JCRMigrationService.java
===================================================================
---
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/JCRMigrationService.java 2010-09-23
13:34:42 UTC (rev 4359)
+++
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/JCRMigrationService.java 2010-09-28
07:34:35 UTC (rev 4403)
@@ -1,186 +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.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;
- }
-}
Copied:
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/JCRMigrationService.java
(from rev 4359,
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/JCRMigrationService.java)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/JCRMigrationService.java
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/JCRMigrationService.java 2010-09-28
07:34:35 UTC (rev 4403)
@@ -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;
+ }
+}
Copied:
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping
(from rev 4359,
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping)
Deleted:
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportErrorMapping.java
===================================================================
---
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportErrorMapping.java 2010-09-23
13:34:42 UTC (rev 4359)
+++
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportErrorMapping.java 2010-09-28
07:34:35 UTC (rev 4403)
@@ -1,84 +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.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());
- }
- }
-}
Copied:
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportErrorMapping.java
(from rev 4359,
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportErrorMapping.java)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportErrorMapping.java
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportErrorMapping.java 2010-09-28
07:34:35 UTC (rev 4403)
@@ -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());
+ }
+ }
+}
Deleted:
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportInfoMapping.java
===================================================================
---
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportInfoMapping.java 2010-09-23
13:34:42 UTC (rev 4359)
+++
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportInfoMapping.java 2010-09-28
07:34:35 UTC (rev 4403)
@@ -1,139 +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.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()));
- }
-}
Copied:
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportInfoMapping.java
(from rev 4359,
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportInfoMapping.java)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportInfoMapping.java
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportInfoMapping.java 2010-09-28
07:34:35 UTC (rev 4403)
@@ -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()));
+ }
+}
Deleted:
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportInfosMapping.java
===================================================================
---
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportInfosMapping.java 2010-09-23
13:34:42 UTC (rev 4359)
+++
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportInfosMapping.java 2010-09-28
07:34:35 UTC (rev 4403)
@@ -1,47 +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.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);
-}
Copied:
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportInfosMapping.java
(from rev 4359,
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportInfosMapping.java)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportInfosMapping.java
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportInfosMapping.java 2010-09-28
07:34:35 UTC (rev 4403)
@@ -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);
+}
Deleted:
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportedStateMapping.java
===================================================================
---
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportedStateMapping.java 2010-09-23
13:34:42 UTC (rev 4359)
+++
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportedStateMapping.java 2010-09-28
07:34:35 UTC (rev 4403)
@@ -1,59 +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.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);
- }
- }
-}
Copied:
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportedStateMapping.java
(from rev 4359,
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportedStateMapping.java)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportedStateMapping.java
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/migration/mapping/ExportedStateMapping.java 2010-09-28
07:34:35 UTC (rev 4403)
@@ -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:
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/JCRRegistrationPersistenceManager.java
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/JCRRegistrationPersistenceManager.java 2010-09-28
03:32:25 UTC (rev 4402)
+++
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/JCRRegistrationPersistenceManager.java 2010-09-28
07:34:35 UTC (rev 4403)
@@ -185,6 +185,26 @@
return consumerSPI;
}
+
+ protected RegistrationSPI internalSaveChangesTo(Registration registration)
+ {
+ RegistrationSPI registrationSPI = super.internalSaveChangesTo(registration);
+
+ ChromatticSession session = persister.getSession();
+ try
+ {
+ RegistrationMapping cm = session.findById(RegistrationMapping.class,
registration.getPersistentKey());
+ cm.initFrom(registration);
+ persister.closeSession(session, true);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace(); //todo: fix me
+ persister.closeSession(session, false);
+ }
+
+ return registrationSPI;
+ }
@Override
protected ConsumerGroupSPI internalRemoveConsumerGroup(String name)
Modified:
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/RegistrationMapping.java
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/RegistrationMapping.java 2010-09-28
03:32:25 UTC (rev 4402)
+++
epp/portal/branches/EPP_5_1_Branch/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/RegistrationMapping.java 2010-09-28
07:34:35 UTC (rev 4403)
@@ -40,6 +40,7 @@
import javax.xml.namespace.QName;
import java.util.Collections;
+import java.util.List;
import java.util.Map;
/**
@@ -63,6 +64,11 @@
public abstract String getRegistrationHandle();
public abstract void setRegistrationHandle(String handle);
+
+ @Property(name="portletHandles")
+ public abstract List<String> getPortletHandles();
+
+ public abstract void setPortletHandles(List<String> portletHandles);
@OneToOne
@Owner
@@ -83,7 +89,8 @@
{
setStatus(registration.getStatus());
setRegistrationHandle(registration.getRegistrationHandle());
-
+ setPortletHandles(registration.getPortletHandles());
+
Map<QName, Object> properties = registration.getProperties();
if (ParameterValidation.existsAndIsNotEmpty(properties))
{
@@ -109,6 +116,7 @@
RegistrationSPI reg = persistenceManager.newRegistrationSPI(consumer, props,
getPersistentKey());
reg.setStatus(getStatus());
reg.setRegistrationHandle(getRegistrationHandle());
+ reg.getPortletHandles().addAll(getPortletHandles());
return reg;
}
Modified: epp/portal/branches/EPP_5_1_Branch/pom.xml
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/pom.xml 2010-09-28 03:32:25 UTC (rev 4402)
+++ epp/portal/branches/EPP_5_1_Branch/pom.xml 2010-09-28 07:34:35 UTC (rev 4403)
@@ -48,7 +48,7 @@
<org.gatein.wci.version>2.0.2-GA</org.gatein.wci.version>
<org.gatein.pc.version>2.2.0-Beta03</org.gatein.pc.version>
<org.picketlink.idm>1.1.5.GA</org.picketlink.idm>
- <org.gatein.wsrp.version>2.0.0-Alpha01</org.gatein.wsrp.version>
+ <org.gatein.wsrp.version>2.0.0-Alpha02</org.gatein.wsrp.version>
<org.gatein.mop.version>1.0.3-GA</org.gatein.mop.version>
<org.slf4j.version>1.5.6</org.slf4j.version>
<rhino.version>1.6R5</rhino.version>
Modified:
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml 2010-09-28
03:32:25 UTC (rev 4402)
+++
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml 2010-09-28
07:34:35 UTC (rev 4403)
@@ -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>
Copied:
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/wsrp/migration-nodetypes.xml
(from rev 4359,
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/migration-nodetypes.xml)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/wsrp/migration-nodetypes.xml
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/wsrp/migration-nodetypes.xml 2010-09-28
07:34:35 UTC (rev 4403)
@@ -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
Modified:
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/wsrp/producer-registrations-nodetypes.xml
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/wsrp/producer-registrations-nodetypes.xml 2010-09-28
03:32:25 UTC (rev 4402)
+++
epp/portal/branches/EPP_5_1_Branch/web/portal/src/main/webapp/WEB-INF/conf/wsrp/producer-registrations-nodetypes.xml 2010-09-28
07:34:35 UTC (rev 4403)
@@ -111,6 +111,9 @@
onParentVersion="COPY" protected="false"
multiple="false">
<valueConstraints/>
</propertyDefinition>
+ <propertyDefinition name="portletHandles"
requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="true">
+ </propertyDefinition>
</propertyDefinitions>
<childNodeDefinitions>
<childNodeDefinition name="properties"
defaultPrimaryType="wsrp:registrationproperties" autoCreated="false"