Author: chris.laprun(a)jboss.com
Date: 2009-12-18 12:16:25 -0500 (Fri, 18 Dec 2009)
New Revision: 1073
Modified:
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/ProducerInfoMapping.java
Log:
- @Create methods do not render an object persistent so need to persist it before
initializing.
- active can be null and Chromattic doesn't like null primitives.
Modified:
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java
===================================================================
---
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java 2009-12-18
15:27:33 UTC (rev 1072)
+++
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java 2009-12-18
17:16:25 UTC (rev 1073)
@@ -71,10 +71,9 @@
ProducerInfosMapping pims = getProducerInfosMapping(session);
ProducerInfoMapping pim = pims.createProducerInfo(info.getId());
- pim.initFrom(info);
-
String key = session.persist(pims, pim, info.getId());
info.setKey(key);
+ pim.initFrom(info);
persister.closeSession(session, true);
}
Modified:
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/ProducerInfoMapping.java
===================================================================
---
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/ProducerInfoMapping.java 2009-12-18
15:27:33 UTC (rev 1072)
+++
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/ProducerInfoMapping.java 2009-12-18
17:16:25 UTC (rev 1073)
@@ -60,9 +60,9 @@
public abstract void setExpirationCacheSeconds(Integer expiration);
@Property(name = "active")
- public abstract boolean getActive();
+ public abstract Boolean getActive();
- public abstract void setActive(boolean active);
+ public abstract void setActive(Boolean active);
@Id
public abstract String getKey();
@@ -94,7 +94,11 @@
// basic properties
info.setKey(getKey());
info.setId(getId());
- info.setActive(getActive());
+ Boolean active = getActive();
+ if (active != null)
+ {
+ info.setActive(active);
+ }
info.setExpirationCacheSeconds(getExpirationCacheSeconds());
// endpoint
Show replies by date