[portal-commits] JBoss Portal SVN: r9138 - in branches/presentation: presentation/src/main/org/jboss/portal/presentation/impl/model and 2 other directories.

portal-commits at lists.jboss.org portal-commits at lists.jboss.org
Tue Nov 27 15:56:08 EST 2007


Author: julien at jboss.com
Date: 2007-11-27 15:56:08 -0500 (Tue, 27 Nov 2007)
New Revision: 9138

Added:
   branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/structural/StructuralState.java
Modified:
   branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/model/StructuralStateManagerImpl.java
   branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIContainerImpl.java
   branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIContextImpl.java
   branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIObjectImpl.java
   branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIPageImpl.java
   branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIPortalImpl.java
   branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIWindowImpl.java
   branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/structural/StructuralStateManager.java
   branches/presentation/presentation/src/main/org/jboss/portal/presentation/test/model/MockModel.java
   branches/presentation/presentation/src/main/org/jboss/portal/presentation/test/model/MockObject.java
Log:
rename ObjectState to StructuralState

Modified: branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/model/StructuralStateManagerImpl.java
===================================================================
--- branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/model/StructuralStateManagerImpl.java	2007-11-27 20:52:01 UTC (rev 9137)
+++ branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/model/StructuralStateManagerImpl.java	2007-11-27 20:56:08 UTC (rev 9138)
@@ -33,7 +33,7 @@
 import org.jboss.portal.presentation.model.UIPage;
 import org.jboss.portal.presentation.model.UIPortal;
 import org.jboss.portal.presentation.model.UIWindow;
-import org.jboss.portal.presentation.model.state.structural.ObjectState;
+import org.jboss.portal.presentation.model.state.structural.StructuralState;
 import org.jboss.portal.presentation.model.state.structural.StructuralStateManager;
 import org.jboss.portal.presentation.model.state.StateChangeVetoException;
 
@@ -82,9 +82,9 @@
    /**
     * 
     */
-   public ObjectState load(String objectId) throws IllegalArgumentException
+   public StructuralState load(String objectId) throws IllegalArgumentException
    {
-      ObjectState objectState = null;
+      StructuralState structuralState = null;
       
       // Get the PortalObject corresponding to this objectId from the PortalObjectContainer
       PortalObject portalObject = this.portalObjectContainer.getObject(PortalObjectId.parse(objectId, 
@@ -121,7 +121,7 @@
          childrenIds.add(child.getId().toString());
       }
       
-      objectState = new ObjectState(
+      structuralState = new StructuralState(
             type, //type
             name,
             properties, //properties
@@ -129,7 +129,7 @@
             childrenIds // childrenIds
       );
       
-      return objectState;
+      return structuralState;
    }
    
    /**
@@ -157,7 +157,7 @@
       return type;
    }
 
-   public ObjectState create(String parentId, Class<? extends UIObject> type, String name, Map<String, String> properties) throws StateChangeVetoException
+   public StructuralState create(String parentId, Class<? extends UIObject> type, String name, Map<String, String> properties) throws StateChangeVetoException
    {
       throw new StateChangeVetoException();
    }

Modified: branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIContainerImpl.java
===================================================================
--- branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIContainerImpl.java	2007-11-27 20:52:01 UTC (rev 9137)
+++ branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIContainerImpl.java	2007-11-27 20:56:08 UTC (rev 9138)
@@ -25,7 +25,7 @@
 import org.jboss.portal.presentation.model.UIContainer;
 import org.jboss.portal.presentation.model.UIObject;
 import org.jboss.portal.presentation.model.UIWindow;
-import org.jboss.portal.presentation.model.state.structural.ObjectState;
+import org.jboss.portal.presentation.model.state.structural.StructuralState;
 
 /**
  * @author <a href="mailto:sshah at redhat.com">Sohil Shah</a>
@@ -34,7 +34,7 @@
 public class UIContainerImpl extends UIObjectImpl implements UIContainer
 {
 
-   public UIContainerImpl(UIContextImpl context, String id, ObjectState state)
+   public UIContainerImpl(UIContextImpl context, String id, StructuralState state)
    {
       super(context, id, state);
    }

Modified: branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIContextImpl.java
===================================================================
--- branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIContextImpl.java	2007-11-27 20:52:01 UTC (rev 9137)
+++ branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIContextImpl.java	2007-11-27 20:56:08 UTC (rev 9138)
@@ -32,7 +32,7 @@
 import org.jboss.portal.presentation.model.UIContainer;
 import org.jboss.portal.presentation.model.UIWindow;
 import org.jboss.portal.presentation.model.state.structural.StructuralStateManager;
-import org.jboss.portal.presentation.model.state.structural.ObjectState;
+import org.jboss.portal.presentation.model.state.structural.StructuralState;
 
 /**
  * @author <a href="mailto:sshah at redhat.com">Sohil Shah</a>
@@ -54,7 +54,7 @@
       return loader.getRootId();
    }
 
-   private static ObjectState getRootState(StructuralStateManager loader)
+   private static StructuralState getRootState(StructuralStateManager loader)
    {
       return loader.load(loader.getRootId());
    }
@@ -81,8 +81,8 @@
          if (object == null)
          {
             //Fetch the state of the UIObject in question
-            ObjectState objectState = this.structuralStateManager.load(id);
-            object = getImplementation(id, objectState);
+            StructuralState structuralState = this.structuralStateManager.load(id);
+            object = getImplementation(id, structuralState);
             objects.put(id, object);
          }
          return object;
@@ -96,7 +96,7 @@
    /**
     * @return
     */
-   protected UIObject getImplementation(String id, ObjectState state) throws Exception
+   protected UIObject getImplementation(String id, StructuralState state) throws Exception
    {
       Class type = state.getType();
       if(type == UIPortal.class)

Modified: branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIObjectImpl.java
===================================================================
--- branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIObjectImpl.java	2007-11-27 20:52:01 UTC (rev 9137)
+++ branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIObjectImpl.java	2007-11-27 20:56:08 UTC (rev 9138)
@@ -24,7 +24,7 @@
 
 import org.jboss.portal.presentation.model.StateScopeType;
 import org.jboss.portal.presentation.model.UIObject;
-import org.jboss.portal.presentation.model.state.structural.ObjectState;
+import org.jboss.portal.presentation.model.state.structural.StructuralState;
 import org.jboss.portal.presentation.model.state.StateChangeVetoException;
 
 import java.io.Serializable;
@@ -57,7 +57,7 @@
    /**
     * This is used to assist with data needed during lazy loading, other state related data etc
     */
-   private ObjectState state;
+   private StructuralState state;
 
    /**
     *
@@ -69,7 +69,7 @@
     */
    private final Map<String, Object> navigationalState;
 
-   public UIObjectImpl(UIContextImpl context, String id, ObjectState state)
+   public UIObjectImpl(UIContextImpl context, String id, StructuralState state)
    {
       this.id = id;
       this.state = state;
@@ -79,7 +79,7 @@
       this.navigationalState = new HashMap<String, Object>();
    }
 
-   public UIObjectImpl(String id, ObjectState state)
+   public UIObjectImpl(String id, StructuralState state)
    {
       this.id = id;
       this.state = state;
@@ -170,7 +170,7 @@
                context.getModelLoader().update(id, changes);
                Map<String, String> updatedProperties = new HashMap<String, String>(state.getProperties());
                updateProperty(updatedProperties, propertyName, (String)propertyValue);
-               state = new ObjectState(state.getType(), state.getName(), updatedProperties, state.getParentId(), state.getChildrenIds());
+               state = new StructuralState(state.getType(), state.getName(), updatedProperties, state.getParentId(), state.getChildrenIds());
             }
             else
             {

Modified: branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIPageImpl.java
===================================================================
--- branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIPageImpl.java	2007-11-27 20:52:01 UTC (rev 9137)
+++ branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIPageImpl.java	2007-11-27 20:56:08 UTC (rev 9138)
@@ -26,7 +26,7 @@
 import org.jboss.portal.presentation.model.UIContainer;
 import org.jboss.portal.presentation.model.UIPage;
 import org.jboss.portal.presentation.model.UIWindow;
-import org.jboss.portal.presentation.model.state.structural.ObjectState;
+import org.jboss.portal.presentation.model.state.structural.StructuralState;
 
 /**
  * @author <a href="mailto:sshah at redhat.com">Sohil Shah</a>
@@ -35,7 +35,7 @@
 public class UIPageImpl extends UIObjectImpl implements UIPage
 {
 
-   public UIPageImpl(UIContextImpl context, String id, ObjectState state)
+   public UIPageImpl(UIContextImpl context, String id, StructuralState state)
    {
       super(context, id, state);
    }

Modified: branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIPortalImpl.java
===================================================================
--- branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIPortalImpl.java	2007-11-27 20:52:01 UTC (rev 9137)
+++ branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIPortalImpl.java	2007-11-27 20:56:08 UTC (rev 9138)
@@ -25,7 +25,7 @@
 import org.jboss.portal.presentation.model.UIObject;
 import org.jboss.portal.presentation.model.UIPortal;
 import org.jboss.portal.presentation.model.UIPage;
-import org.jboss.portal.presentation.model.state.structural.ObjectState;
+import org.jboss.portal.presentation.model.state.structural.StructuralState;
 
 /**
  * @author <a href="mailto:sshah at redhat.com">Sohil Shah</a>
@@ -34,7 +34,7 @@
 public class UIPortalImpl extends UIObjectImpl implements UIPortal
 {
 
-   public UIPortalImpl(UIContextImpl context, String id, ObjectState state)
+   public UIPortalImpl(UIContextImpl context, String id, StructuralState state)
    {
       super(context, id, state);
    }

Modified: branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIWindowImpl.java
===================================================================
--- branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIWindowImpl.java	2007-11-27 20:52:01 UTC (rev 9137)
+++ branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIWindowImpl.java	2007-11-27 20:56:08 UTC (rev 9138)
@@ -28,7 +28,7 @@
 import org.jboss.portal.presentation.model.UIObject;
 import org.jboss.portal.presentation.model.UIWindow;
 import org.jboss.portal.presentation.model.state.content.WindowContent;
-import org.jboss.portal.presentation.model.state.structural.ObjectState;
+import org.jboss.portal.presentation.model.state.structural.StructuralState;
 
 /**
  * @author <a href="mailto:sshah at redhat.com">Sohil Shah</a>
@@ -37,7 +37,7 @@
 public class UIWindowImpl extends UIObjectImpl implements UIWindow
 {
 
-   public UIWindowImpl(UIContextImpl context, String id, ObjectState state)
+   public UIWindowImpl(UIContextImpl context, String id, StructuralState state)
    {
       super(context, id, state);
    }

Copied: branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/structural/StructuralState.java (from rev 9129, branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/structural/ObjectState.java)
===================================================================
--- branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/structural/StructuralState.java	                        (rev 0)
+++ branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/structural/StructuralState.java	2007-11-27 20:56:08 UTC (rev 9138)
@@ -0,0 +1,86 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, 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.jboss.portal.presentation.model.state.structural;
+
+import org.jboss.portal.presentation.model.UIObject;
+
+import java.io.Serializable;
+import java.util.Map;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class StructuralState implements Serializable
+{
+
+   /** . */
+   private final Class<? extends UIObject> type;
+
+   /** . */
+   private final String name;
+
+   /** . */
+   private final Map<String, String> properties;
+
+   /** . */
+   private final String parentId;
+
+   /** . */
+   private final List<String> childrenIds;
+
+   public StructuralState(Class<? extends UIObject> type, String name, Map<String, String> properties, String parentId, List<String> childrenIds)
+   {
+      this.type = type;
+      this.name = name;
+      this.properties = properties;
+      this.parentId = parentId;
+      this.childrenIds = childrenIds;
+   }
+
+   public Class<? extends UIObject> getType()
+   {
+      return type;
+   }
+
+   public String getName()
+   {
+      return name;
+   }
+
+   public Map<String, String> getProperties()
+   {
+      return properties;
+   }
+
+   public String getParentId()
+   {
+      return parentId;
+   }
+
+   public List<String> getChildrenIds()
+   {
+      return childrenIds;
+   }
+}

Modified: branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/structural/StructuralStateManager.java
===================================================================
--- branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/structural/StructuralStateManager.java	2007-11-27 20:52:01 UTC (rev 9137)
+++ branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/structural/StructuralStateManager.java	2007-11-27 20:56:08 UTC (rev 9138)
@@ -43,11 +43,11 @@
     * @return the state of the object or null if such state does not exist
     * @throws IllegalArgumentException if the object id argument is null
     */
-   ObjectState load(String objectId) throws IllegalArgumentException;
+   StructuralState load(String objectId) throws IllegalArgumentException;
 
    String getRootId();
 
-   ObjectState create(String parentId, Class<? extends UIObject> type, String name, Map<String, String> properties) throws StateChangeVetoException;
+   StructuralState create(String parentId, Class<? extends UIObject> type, String name, Map<String, String> properties) throws StateChangeVetoException;
 
    void destroy(String objectId) throws StateChangeVetoException;
 

Modified: branches/presentation/presentation/src/main/org/jboss/portal/presentation/test/model/MockModel.java
===================================================================
--- branches/presentation/presentation/src/main/org/jboss/portal/presentation/test/model/MockModel.java	2007-11-27 20:52:01 UTC (rev 9137)
+++ branches/presentation/presentation/src/main/org/jboss/portal/presentation/test/model/MockModel.java	2007-11-27 20:56:08 UTC (rev 9138)
@@ -23,7 +23,7 @@
 package org.jboss.portal.presentation.test.model;
 
 import org.jboss.portal.presentation.model.state.structural.StructuralStateManager;
-import org.jboss.portal.presentation.model.state.structural.ObjectState;
+import org.jboss.portal.presentation.model.state.structural.StructuralState;
 import org.jboss.portal.presentation.model.state.StateChangeVetoException;
 import org.jboss.portal.presentation.model.UIObject;
 
@@ -54,7 +54,7 @@
       return context;
    }
 
-   public ObjectState load(String objectId) throws IllegalArgumentException
+   public StructuralState load(String objectId) throws IllegalArgumentException
    {
       if (objectId == null)
       {
@@ -143,14 +143,14 @@
          return id;
       }
 
-      public ObjectState takeSnapshot()
+      public StructuralState takeSnapshot()
       {
          ArrayList<String> childrenIds = new ArrayList<String>();
          for (MockObjectImpl child : children.values())
          {
             childrenIds.add(child.id);
          }
-         return new ObjectState(type.clazz, name, new HashMap<String, String>(propertyValues), parent != null ? parent.id : null, childrenIds);
+         return new StructuralState(type.clazz, name, new HashMap<String, String>(propertyValues), parent != null ? parent.id : null, childrenIds);
       }
 
       public String getPropertyValue(String propertyName)
@@ -212,7 +212,7 @@
       }
    }
 
-   public ObjectState create(String parentId, Class<? extends UIObject> type, String name, Map<String, String> properties) throws StateChangeVetoException
+   public StructuralState create(String parentId, Class<? extends UIObject> type, String name, Map<String, String> properties) throws StateChangeVetoException
    {
       throw new StateChangeVetoException();
    }

Modified: branches/presentation/presentation/src/main/org/jboss/portal/presentation/test/model/MockObject.java
===================================================================
--- branches/presentation/presentation/src/main/org/jboss/portal/presentation/test/model/MockObject.java	2007-11-27 20:52:01 UTC (rev 9137)
+++ branches/presentation/presentation/src/main/org/jboss/portal/presentation/test/model/MockObject.java	2007-11-27 20:56:08 UTC (rev 9138)
@@ -27,7 +27,7 @@
 import org.jboss.portal.presentation.model.UIPage;
 import org.jboss.portal.presentation.model.UIPortal;
 import org.jboss.portal.presentation.model.UIWindow;
-import org.jboss.portal.presentation.model.state.structural.ObjectState;
+import org.jboss.portal.presentation.model.state.structural.StructuralState;
 
 import java.util.Set;
 
@@ -78,5 +78,5 @@
     *
     * @return the state snapshot
     */
-   ObjectState takeSnapshot();
+   StructuralState takeSnapshot();
 }




More information about the portal-commits mailing list