Author: chris.laprun(a)jboss.com
Date: 2009-12-21 06:42:31 -0500 (Mon, 21 Dec 2009)
New Revision: 1098
Modified:
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/JCRRegistrationPersistenceManager.java
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/RegistrationMapping.java
Log:
- Added @Create method for RegistrationPropertiesMapping.
- Added missing mapping for RegistrationPropertiesMapping when initializing persister for
JCRRegistrationPersistenceManager.
Modified:
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/JCRRegistrationPersistenceManager.java
===================================================================
---
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/JCRRegistrationPersistenceManager.java 2009-12-21
11:05:51 UTC (rev 1097)
+++
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/JCRRegistrationPersistenceManager.java 2009-12-21
11:42:31 UTC (rev 1098)
@@ -30,6 +30,7 @@
import org.gatein.portal.wsrp.state.producer.registrations.mapping.ConsumerMapping;
import
org.gatein.portal.wsrp.state.producer.registrations.mapping.ConsumersAndGroupsMapping;
import org.gatein.portal.wsrp.state.producer.registrations.mapping.RegistrationMapping;
+import
org.gatein.portal.wsrp.state.producer.registrations.mapping.RegistrationPropertiesMapping;
import org.gatein.registration.ConsumerGroup;
import org.gatein.registration.Registration;
import org.gatein.registration.RegistrationException;
@@ -59,7 +60,7 @@
List<Class> mappingClasses = new ArrayList<Class>(5);
Collections.addAll(mappingClasses, ConsumersAndGroupsMapping.class,
ConsumerMapping.class, ConsumerGroupMapping.class,
- RegistrationMapping.class, ConsumerCapabilitiesMapping.class);
+ RegistrationMapping.class, ConsumerCapabilitiesMapping.class,
RegistrationPropertiesMapping.class);
persister.initializeBuilderFor(mappingClasses);
Modified:
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/RegistrationMapping.java
===================================================================
---
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/RegistrationMapping.java 2009-12-21
11:05:51 UTC (rev 1097)
+++
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/RegistrationMapping.java 2009-12-21
11:42:31 UTC (rev 1098)
@@ -22,6 +22,7 @@
package org.gatein.portal.wsrp.state.producer.registrations.mapping;
+import org.chromattic.api.annotations.Create;
import org.chromattic.api.annotations.Id;
import org.chromattic.api.annotations.ManyToOne;
import org.chromattic.api.annotations.MappedBy;
@@ -70,6 +71,11 @@
@MappedBy("properties")
public abstract RegistrationPropertiesMapping getProperties();
+ public abstract void setProperties(RegistrationPropertiesMapping rpm);
+
+ @Create
+ public abstract RegistrationPropertiesMapping createProperties();
+
/**
* At this point, this RegistrationMapping should already have been added to its
parent
*
@@ -83,7 +89,8 @@
Map<QName, Object> properties = registration.getProperties();
if (ParameterValidation.existsAndIsNotEmpty(properties))
{
- RegistrationPropertiesMapping rpm = getProperties(); // todo: how to create a
new one if there isn't one already?
+ RegistrationPropertiesMapping rpm = createProperties();
+ setProperties(rpm);
rpm.initFrom(properties);
}
}
Show replies by date