You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by we...@apache.org on 2004/03/05 22:48:28 UTC
cvs commit: jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/components/portletentity PortletEntityAccessComponentImpl.java StoreablePortletEntityDelegate.java
weaver 2004/03/05 13:48:28
Modified: components/registry/src/java/org/apache/jetspeed/om/portlet/impl
StoreablePortletDefinitionDelegate.java
components/registry/src/java/org/apache/jetspeed/components/portletentity
PortletEntityAccessComponentImpl.java
StoreablePortletEntityDelegate.java
Log:
fixed issues with "Storeable" types causing ojb to fail
Revision Changes Path
1.2 +7 -0 jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/om/portlet/impl/StoreablePortletDefinitionDelegate.java
Index: StoreablePortletDefinitionDelegate.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/om/portlet/impl/StoreablePortletDefinitionDelegate.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- StoreablePortletDefinitionDelegate.java 23 Feb 2004 13:13:46 -0000 1.1
+++ StoreablePortletDefinitionDelegate.java 5 Mar 2004 21:48:27 -0000 1.2
@@ -753,4 +753,11 @@
}
+ /**
+ * @return Returns the portlet.
+ */
+ public PortletDefinitionComposite getPortlet()
+ {
+ return portlet;
+ }
}
1.8 +12 -3 jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/components/portletentity/PortletEntityAccessComponentImpl.java
Index: PortletEntityAccessComponentImpl.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/components/portletentity/PortletEntityAccessComponentImpl.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- PortletEntityAccessComponentImpl.java 5 Mar 2004 16:53:30 -0000 1.7
+++ PortletEntityAccessComponentImpl.java 5 Mar 2004 21:48:28 -0000 1.8
@@ -62,6 +62,7 @@
import org.apache.jetspeed.components.persistence.store.PersistenceStore;
import org.apache.jetspeed.components.persistence.store.PersistenceStoreContainer;
import org.apache.jetspeed.components.persistence.store.Transaction;
+import org.apache.jetspeed.om.portlet.impl.StoreablePortletDefinitionDelegate;
import org.apache.jetspeed.om.preference.impl.PreferenceSetImpl;
import org.apache.jetspeed.util.JetspeedObjectID;
import org.apache.pluto.om.common.ObjectID;
@@ -150,7 +151,14 @@
public StoreablePortletEntityDelegate newPortletEntityInstance(PortletDefinition portletDefinition)
{
PortletEntityCtrl portletEntity = new PortletEntityImpl();
- portletEntity.setPortletDefinition(portletDefinition);
+ if (portletDefinition instanceof StoreablePortletDefinitionDelegate)
+ {
+ portletEntity.setPortletDefinition(((StoreablePortletDefinitionDelegate) portletDefinition).getPortlet());
+ }
+ else
+ {
+ portletEntity.setPortletDefinition(portletDefinition);
+ }
return wrapEntity((PortletEntityImpl) portletEntity);
}
@@ -204,7 +212,8 @@
if (portletEntity instanceof StoreablePortletEntityDelegate)
{
- store.lockForWrite(((StoreablePortletEntityDelegate)portletEntity).getPortletEntity());
+ PortletEntity realEntity = ((StoreablePortletEntityDelegate)portletEntity).getPortletEntity();
+ store.lockForWrite(realEntity);
}
else
{
1.3 +24 -2 jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/components/portletentity/StoreablePortletEntityDelegate.java
Index: StoreablePortletEntityDelegate.java
===================================================================
RCS file: /home/cvs/jakarta-jetspeed-2/components/registry/src/java/org/apache/jetspeed/components/portletentity/StoreablePortletEntityDelegate.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- StoreablePortletEntityDelegate.java 4 Mar 2004 21:21:36 -0000 1.2
+++ StoreablePortletEntityDelegate.java 5 Mar 2004 21:48:28 -0000 1.3
@@ -62,6 +62,8 @@
import org.apache.commons.beanutils.BeanUtils;
import org.apache.jetspeed.components.persistence.store.PersistenceStore;
import org.apache.jetspeed.components.persistence.store.Transaction;
+import org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite;
+import org.apache.jetspeed.om.portlet.impl.StoreablePortletDefinitionDelegate;
import org.apache.jetspeed.om.preference.impl.AbstractPreference;
import org.apache.jetspeed.om.preference.impl.PreferenceSetImpl;
import org.apache.pluto.om.common.Description;
@@ -108,6 +110,12 @@
List originalPreferences,
PersistenceStore store)
{
+
+ if(entity instanceof StoreablePortletEntityDelegate)
+ {
+ throw new IllegalArgumentException("The \"entity\" argument of the StoreablePortletEntityDelegate cannot be"+
+ " another StoreablePortletEntityDelegate.");
+ }
this.entity = entity;
this.control = control;
this.store = store;
@@ -152,7 +160,14 @@
*/
public PortletDefinition getPortletDefinition()
{
- return entity.getPortletDefinition();
+ if(entity.getPortletDefinition() instanceof StoreablePortletDefinitionDelegate)
+ {
+ return entity.getPortletDefinition();
+ }
+ else
+ {
+ return new StoreablePortletDefinitionDelegate((PortletDefinitionComposite)entity.getPortletDefinition(), store);
+ }
}
/**
@@ -219,7 +234,14 @@
*/
public void setPortletDefinition(PortletDefinition portletDefinition)
{
- setPortletDefinition(portletDefinition);
+ if(entity.getPortletDefinition() instanceof StoreablePortletDefinitionDelegate)
+ {
+ control.setPortletDefinition(((StoreablePortletDefinitionDelegate)portletDefinition).getPortlet());
+ }
+ else
+ {
+ control.setPortletDefinition(portletDefinition);
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org