Author: mwringe
Date: 2010-09-22 11:58:17 -0400 (Wed, 22 Sep 2010)
New Revision: 4312
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/producer/registrations/JCRRegistrationPersistenceManager.java
portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/RegistrationMapping.java
portal/branches/wsrp2-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp/producer-registrations-nodetypes.xml
Log:
GTNWSRP-72: Update registrations to contain a persistent list of portletcontexts specific
to that registration.
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-22
15:19:57 UTC (rev 4311)
+++
portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/WSRPServiceIntegration.java 2010-09-22
15:58:17 UTC (rev 4312)
@@ -59,6 +59,7 @@
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;
@@ -200,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);
Modified:
portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/JCRRegistrationPersistenceManager.java
===================================================================
---
portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/JCRRegistrationPersistenceManager.java 2010-09-22
15:19:57 UTC (rev 4311)
+++
portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/JCRRegistrationPersistenceManager.java 2010-09-22
15:58:17 UTC (rev 4312)
@@ -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:
portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/RegistrationMapping.java
===================================================================
---
portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/RegistrationMapping.java 2010-09-22
15:19:57 UTC (rev 4311)
+++
portal/branches/wsrp2-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/RegistrationMapping.java 2010-09-22
15:58:17 UTC (rev 4312)
@@ -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:
portal/branches/wsrp2-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp/producer-registrations-nodetypes.xml
===================================================================
---
portal/branches/wsrp2-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp/producer-registrations-nodetypes.xml 2010-09-22
15:19:57 UTC (rev 4311)
+++
portal/branches/wsrp2-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp/producer-registrations-nodetypes.xml 2010-09-22
15:58:17 UTC (rev 4312)
@@ -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"
Show replies by date