Author: julien(a)jboss.com
Date: 2007-11-27 11:28:30 -0500 (Tue, 27 Nov 2007)
New Revision: 9128
Added:
branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/model/StructuralStateManagerImpl.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/content/
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/content/WindowContent.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/structural/
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/StructuralStateManager.java
Removed:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/content/
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/ModelLoader.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/ObjectState.java
Modified:
branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/server/PresentationServerImpl.java
branches/presentation/core-presentation/src/resources/presentation-sar/META-INF/jboss-service.xml
branches/presentation/presentation/src/main/org/jboss/portal/presentation/client/controller/UIController.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/PresentationContextImpl.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/UIContext.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/server/PresentationServer.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:
reorg of packages for model state
Copied:
branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/model/StructuralStateManagerImpl.java
(from rev 9052,
branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/model/ModelLoaderImpl.java)
===================================================================
---
branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/model/StructuralStateManagerImpl.java
(rev 0)
+++
branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/model/StructuralStateManagerImpl.java 2007-11-27
16:28:30 UTC (rev 9128)
@@ -0,0 +1,177 @@
+/******************************************************************************
+ * 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.core.presentation.model;
+
+import java.util.Map;
+import java.util.List;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.ArrayList;
+
+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.UIWindow;
+import org.jboss.portal.presentation.model.state.structural.StructuralStateManager;
+import org.jboss.portal.presentation.model.state.structural.ObjectState;
+
+import org.jboss.portal.core.model.portal.PortalObjectContainer;
+import org.jboss.portal.core.model.portal.PortalObject;
+import org.jboss.portal.core.model.portal.PortalObjectId;
+import org.jboss.portal.core.model.portal.PortalObjectPath;
+import org.jboss.portal.core.model.portal.Page;
+import org.jboss.portal.core.model.portal.Window;
+import org.jboss.portal.core.model.portal.Portal;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class StructuralStateManagerImpl implements StructuralStateManager
+{
+ /**
+ *
+ */
+ private PortalObjectContainer portalObjectContainer = null;
+
+ /**
+ *
+ * @return
+ */
+ public PortalObjectContainer getPortalObjectContainer()
+ {
+ return portalObjectContainer;
+ }
+
+ /**
+ *
+ * @param portalObjectContainer
+ */
+ public void setPortalObjectContainer(
+ PortalObjectContainer portalObjectContainer)
+ {
+ this.portalObjectContainer = portalObjectContainer;
+ }
+
+
+ public String getRootId()
+ {
+ return portalObjectContainer.getContext().getId().toString();
+ }
+
+ /**
+ *
+ */
+ public ObjectState loadState(String objectId) throws IllegalArgumentException
+ {
+ ObjectState objectState = null;
+
+ // Get the PortalObject corresponding to this objectId from the
PortalObjectContainer
+ PortalObject portalObject =
this.portalObjectContainer.getObject(PortalObjectId.parse(objectId,
+ PortalObjectPath.CANONICAL_FORMAT));
+
+ if(portalObject == null)
+ {
+ // Object by this id was not found in the Portal
+ return null;
+ }
+
+ // Type
+ Class<? extends UIObject> type = this.getType(portalObject);
+
+ // Name
+ String name = portalObject.getName();
+
+ // Properties
+ Map<String, String> properties = portalObject.getDeclaredProperties();
+
+ // Parent Id
+ String parentId = null;
+ if(portalObject.getParent() != null)
+ {
+ parentId = portalObject.getParent().getId().toString();
+ }
+
+ //Children Ids
+ List<String> childrenIds = new ArrayList<String>();
+ Collection children = portalObject.getChildren();
+ for(Iterator itr=children.iterator(); itr.hasNext();)
+ {
+ PortalObject child = (PortalObject)itr.next();
+ childrenIds.add(child.getId().toString());
+ }
+
+ objectState = new ObjectState(
+ type, //type
+ name,
+ properties, //properties
+ parentId,
+ childrenIds // childrenIds
+ );
+
+ return objectState;
+ }
+
+ /**
+ *
+ * @param portalObject
+ * @return
+ */
+ private Class<? extends UIObject> getType(PortalObject portalObject)
+ {
+ Class<? extends UIObject> type = null;
+
+ if(portalObject instanceof Portal)
+ {
+ type = UIPortal.class;
+ }
+ else if(portalObject instanceof Page)
+ {
+ type = UIPage.class;
+ }
+ else if(portalObject instanceof Window)
+ {
+ type = UIWindow.class;
+ }
+
+ return type;
+ }
+
+ /**
+ *
+ *
+ */
+ public void start()
+ {
+
+ }
+
+ /**
+ *
+ *
+ */
+ public void stop()
+ {
+
+ }
+}
Modified:
branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/server/PresentationServerImpl.java
===================================================================
---
branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/server/PresentationServerImpl.java 2007-11-27
15:39:52 UTC (rev 9127)
+++
branches/presentation/core-presentation/src/main/org/jboss/portal/core/presentation/server/PresentationServerImpl.java 2007-11-27
16:28:30 UTC (rev 9128)
@@ -26,8 +26,8 @@
import org.jboss.portal.presentation.server.Processor;
import org.jboss.portal.presentation.server.PresentationServer;
import org.jboss.portal.presentation.model.UIWindow;
-import org.jboss.portal.presentation.model.content.WindowContent;
-import org.jboss.portal.presentation.model.state.ModelLoader;
+import org.jboss.portal.presentation.model.state.content.WindowContent;
+import org.jboss.portal.presentation.model.state.structural.StructuralStateManager;
import org.jboss.portal.core.controller.ControllerResponse;
import org.jboss.portal.core.model.portal.command.response.MarkupResponse;
import org.jboss.portal.core.model.portal.PortalObjectId;
@@ -56,7 +56,7 @@
/**
*
*/
- private ModelLoader modelLoader;
+ private StructuralStateManager structuralStateManager;
/**
*
@@ -98,18 +98,18 @@
/**
*
*/
- public ModelLoader getModelLoader()
+ public StructuralStateManager getStructuralStateManager()
{
- return modelLoader;
+ return structuralStateManager;
}
/**
*
- * @param modelLoader
+ * @param structuralStateManager
*/
- public void setModelLoader(ModelLoader modelLoader)
+ public void setModelLoader(StructuralStateManager structuralStateManager)
{
- this.modelLoader = modelLoader;
+ this.structuralStateManager = structuralStateManager;
}
/**
Modified:
branches/presentation/core-presentation/src/resources/presentation-sar/META-INF/jboss-service.xml
===================================================================
---
branches/presentation/core-presentation/src/resources/presentation-sar/META-INF/jboss-service.xml 2007-11-27
15:39:52 UTC (rev 9127)
+++
branches/presentation/core-presentation/src/resources/presentation-sar/META-INF/jboss-service.xml 2007-11-27
16:28:30 UTC (rev 9128)
@@ -82,7 +82,7 @@
<depends optional-attribute-name="CustomizationManager"
proxy-type="attribute">portal:service=CustomizationManager</depends>
</mbean>
<mbean
- code="org.jboss.portal.core.presentation.model.ModelLoaderImpl"
+
code="org.jboss.portal.core.presentation.model.StructuralStateManagerImpl"
name="portal:container=ModelLoader"
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
Modified:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/client/controller/UIController.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/client/controller/UIController.java 2007-11-27
15:39:52 UTC (rev 9127)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/client/controller/UIController.java 2007-11-27
16:28:30 UTC (rev 9128)
@@ -28,7 +28,7 @@
import org.jboss.portal.presentation.model.UIObject;
import org.jboss.portal.presentation.model.UIPage;
import org.jboss.portal.presentation.model.UIWindow;
-import org.jboss.portal.presentation.model.content.WindowContent;
+import org.jboss.portal.presentation.model.state.content.WindowContent;
import org.jboss.portal.presentation.protocol.GetActivation;
import org.jboss.portal.presentation.protocol.PostActivation;
import org.jboss.portal.presentation.protocol.ServerAction;
@@ -307,7 +307,7 @@
String token = st.nextToken();
buffer.append(token);
String id = buffer.toString();
- ObjectState objectState =
this.presentationServer.getModelLoader().loadState(id);
+ ObjectState objectState =
this.presentationServer.getStructuralStateManager().loadState(id);
if(objectState != null && objectState.getType() == UIPortal.class)
{
targetPortal = (UIPortal)requestContext.getUIContext().getObject(id);
@@ -336,7 +336,7 @@
String token = st.nextToken();
buffer.append(token);
String id = buffer.toString();
- ObjectState objectState =
this.presentationServer.getModelLoader().loadState(id);
+ ObjectState objectState =
this.presentationServer.getStructuralStateManager().loadState(id);
if(objectState != null)
{
if(objectState.getType() == UIPage.class)
Modified:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/PresentationContextImpl.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/PresentationContextImpl.java 2007-11-27
15:39:52 UTC (rev 9127)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/PresentationContextImpl.java 2007-11-27
16:28:30 UTC (rev 9128)
@@ -78,7 +78,7 @@
/**
* TODO: decouple the implementation via factory pattern
*/
- uiContext = new UIContextImpl(this.presentationServer.getModelLoader());
+ uiContext = new
UIContextImpl(this.presentationServer.getStructuralStateManager());
session.setAttribute("uicontext", uiContext);
}
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
15:39:52 UTC (rev 9127)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIContainerImpl.java 2007-11-27
16:28:30 UTC (rev 9128)
@@ -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.ObjectState;
+import org.jboss.portal.presentation.model.state.structural.ObjectState;
/**
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
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
15:39:52 UTC (rev 9127)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIContextImpl.java 2007-11-27
16:28:30 UTC (rev 9128)
@@ -31,8 +31,8 @@
import org.jboss.portal.presentation.model.UIPage;
import org.jboss.portal.presentation.model.UIContainer;
import org.jboss.portal.presentation.model.UIWindow;
-import org.jboss.portal.presentation.model.state.ModelLoader;
-import org.jboss.portal.presentation.model.state.ObjectState;
+import org.jboss.portal.presentation.model.state.structural.StructuralStateManager;
+import org.jboss.portal.presentation.model.state.structural.ObjectState;
/**
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
@@ -47,24 +47,24 @@
/**
*
*/
- private ModelLoader modelLoader = null;
+ private StructuralStateManager structuralStateManager = null;
- private static String getRootId(ModelLoader loader)
+ private static String getRootId(StructuralStateManager loader)
{
return loader.getRootId();
}
- private static ObjectState getRootState(ModelLoader loader)
+ private static ObjectState getRootState(StructuralStateManager loader)
{
return loader.loadState(loader.getRootId());
}
- public UIContextImpl(ModelLoader modelLoader)
+ public UIContextImpl(StructuralStateManager structuralStateManager)
{
- super(getRootId(modelLoader), getRootState(modelLoader));
+ super(getRootId(structuralStateManager), getRootState(structuralStateManager));
//
- this.modelLoader = modelLoader;
+ this.structuralStateManager = structuralStateManager;
// Put our self in the object cache
objects.put(getId(), this);
@@ -81,7 +81,7 @@
if (object == null)
{
//Fetch the state of the UIObject in question
- ObjectState objectState = this.modelLoader.loadState(id);
+ ObjectState objectState = this.structuralStateManager.loadState(id);
object = getImplementation(id, objectState);
objects.put(id, object);
}
@@ -124,9 +124,9 @@
/**
*
*/
- public ModelLoader getModelLoader()
+ public StructuralStateManager getModelLoader()
{
- return this.modelLoader;
+ return this.structuralStateManager;
}
/**
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
15:39:52 UTC (rev 9127)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIObjectImpl.java 2007-11-27
16:28:30 UTC (rev 9128)
@@ -25,7 +25,7 @@
import org.jboss.portal.common.NotYetImplemented;
import org.jboss.portal.presentation.model.StateScopeType;
import org.jboss.portal.presentation.model.UIObject;
-import org.jboss.portal.presentation.model.state.ObjectState;
+import org.jboss.portal.presentation.model.state.structural.ObjectState;
import java.io.Serializable;
import java.util.HashMap;
@@ -270,7 +270,7 @@
// ((UIObjectImpl)child).id = this.generateChildId(name);
//
// //State
-// ((UIObjectImpl)child).state =
this.getUIContext().getModelLoader().loadState(((UIObjectImpl)child).id);
+// ((UIObjectImpl)child).state =
this.getUIContext().getStructuralStateManager().loadState(((UIObjectImpl)child).id);
//
// this.children.add(child);
//
@@ -312,7 +312,7 @@
// //Parent..load using parentId from state being used
// if(loadParent && state.getParentId() != null &&
state.getParentId().trim().length()>0)
// {
-// ObjectState parentState =
uiContext.getModelLoader().loadState(state.getParentId());
+// ObjectState parentState =
uiContext.getStructuralStateManager().loadState(state.getParentId());
// this.parent = uiContext.getObject(state.getParentId(),
parentState.getType());
// }
//
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
15:39:52 UTC (rev 9127)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIPageImpl.java 2007-11-27
16:28:30 UTC (rev 9128)
@@ -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.ObjectState;
+import org.jboss.portal.presentation.model.state.structural.ObjectState;
/**
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
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
15:39:52 UTC (rev 9127)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIPortalImpl.java 2007-11-27
16:28:30 UTC (rev 9128)
@@ -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.ObjectState;
+import org.jboss.portal.presentation.model.state.structural.ObjectState;
/**
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
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
15:39:52 UTC (rev 9127)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIWindowImpl.java 2007-11-27
16:28:30 UTC (rev 9128)
@@ -27,8 +27,8 @@
import org.jboss.portal.presentation.model.StateScopeType;
import org.jboss.portal.presentation.model.UIObject;
import org.jboss.portal.presentation.model.UIWindow;
-import org.jboss.portal.presentation.model.content.WindowContent;
-import org.jboss.portal.presentation.model.state.ObjectState;
+import org.jboss.portal.presentation.model.state.content.WindowContent;
+import org.jboss.portal.presentation.model.state.structural.ObjectState;
/**
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
Modified:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/UIContext.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/UIContext.java 2007-11-27
15:39:52 UTC (rev 9127)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/UIContext.java 2007-11-27
16:28:30 UTC (rev 9128)
@@ -22,8 +22,7 @@
******************************************************************************/
package org.jboss.portal.presentation.model;
-import java.util.Map;
-import org.jboss.portal.presentation.model.state.ModelLoader;
+import org.jboss.portal.presentation.model.state.structural.StructuralStateManager;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -42,5 +41,5 @@
*
* @return
*/
- ModelLoader getModelLoader();
+ StructuralStateManager getModelLoader();
}
Deleted:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/ModelLoader.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/ModelLoader.java 2007-11-27
15:39:52 UTC (rev 9127)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/ModelLoader.java 2007-11-27
16:28:30 UTC (rev 9128)
@@ -1,45 +0,0 @@
-/******************************************************************************
- * 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;
-
-import org.jboss.portal.presentation.model.state.ObjectState;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public interface ModelLoader
-{
-
- /**
- * Load the state of a specified object.
- *
- * @param objectId the object id
- * @return the state of the object or null if such state does not exist
- * @throws IllegalArgumentException if the object id argument is null
- */
- ObjectState loadState(String objectId) throws IllegalArgumentException;
-
- String getRootId();
-
-}
Deleted:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/ObjectState.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/ObjectState.java 2007-11-27
15:39:52 UTC (rev 9127)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/ObjectState.java 2007-11-27
16:28:30 UTC (rev 9128)
@@ -1,86 +0,0 @@
-/******************************************************************************
- * 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;
-
-import org.jboss.portal.presentation.model.UIObject;
-
-import java.io.Serializable;
-import java.util.Map;
-import java.util.List;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class ObjectState 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 ObjectState(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;
- }
-}
Copied:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/content/WindowContent.java
(from rev 9052,
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/content/WindowContent.java)
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/content/WindowContent.java
(rev 0)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/content/WindowContent.java 2007-11-27
16:28:30 UTC (rev 9128)
@@ -0,0 +1,63 @@
+/******************************************************************************
+ * 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.content;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class WindowContent
+{
+
+ /** . */
+ private final long expirationMillis;
+
+ /** . */
+ private final String title;
+
+ /** . */
+ private final String markup;
+
+
+ public WindowContent(long expirationMillis, String title, String markup)
+ {
+ this.expirationMillis = expirationMillis;
+ this.title = title;
+ this.markup = markup;
+ }
+
+ public long getExpirationMillis()
+ {
+ return expirationMillis;
+ }
+
+ public String getTitle()
+ {
+ return title;
+ }
+
+ public String getMarkup()
+ {
+ return markup;
+ }
+}
Added:
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/ObjectState.java
(rev 0)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/structural/ObjectState.java 2007-11-27
16:28:30 UTC (rev 9128)
@@ -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@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ObjectState 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 ObjectState(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;
+ }
+}
Added:
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
(rev 0)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/structural/StructuralStateManager.java 2007-11-27
16:28:30 UTC (rev 9128)
@@ -0,0 +1,45 @@
+/******************************************************************************
+ * 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.state.structural.ObjectState;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface StructuralStateManager
+{
+
+ /**
+ * Load the state of a specified object.
+ *
+ * @param objectId the object id
+ * @return the state of the object or null if such state does not exist
+ * @throws IllegalArgumentException if the object id argument is null
+ */
+ ObjectState loadState(String objectId) throws IllegalArgumentException;
+
+ String getRootId();
+
+}
Modified:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/server/PresentationServer.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/server/PresentationServer.java 2007-11-27
15:39:52 UTC (rev 9127)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/server/PresentationServer.java 2007-11-27
16:28:30 UTC (rev 9128)
@@ -24,8 +24,8 @@
import org.jboss.portal.presentation.client.PresentationContext;
import org.jboss.portal.presentation.model.UIWindow;
-import org.jboss.portal.presentation.model.content.WindowContent;
-import org.jboss.portal.presentation.model.state.ModelLoader;
+import org.jboss.portal.presentation.model.state.content.WindowContent;
+import org.jboss.portal.presentation.model.state.structural.StructuralStateManager;
/**
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
@@ -53,5 +53,5 @@
*
* @return
*/
- ModelLoader getModelLoader();
+ StructuralStateManager getStructuralStateManager();
}
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
15:39:52 UTC (rev 9127)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/test/model/MockModel.java 2007-11-27
16:28:30 UTC (rev 9128)
@@ -22,8 +22,8 @@
******************************************************************************/
package org.jboss.portal.presentation.test.model;
-import org.jboss.portal.presentation.model.state.ModelLoader;
-import org.jboss.portal.presentation.model.state.ObjectState;
+import org.jboss.portal.presentation.model.state.structural.StructuralStateManager;
+import org.jboss.portal.presentation.model.state.structural.ObjectState;
import java.util.ArrayList;
import java.util.HashMap;
@@ -34,7 +34,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 630 $
*/
-public class MockModel implements ModelLoader
+public class MockModel implements StructuralStateManager
{
/** . */
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
15:39:52 UTC (rev 9127)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/test/model/MockObject.java 2007-11-27
16:28:30 UTC (rev 9128)
@@ -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.ObjectState;
+import org.jboss.portal.presentation.model.state.structural.ObjectState;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>