Author: sohil.shah(a)jboss.com
Date: 2007-11-15 16:52:45 -0500 (Thu, 15 Nov 2007)
New Revision: 8962
Added:
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model/
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model/UIContainerImpl.java
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model/UIContextImpl.java
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model/UIObjectImpl.java
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model/UIPageImpl.java
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model/UIPortalImpl.java
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model/UIWindowImpl.java
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/UIContainer.java
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/UIContext.java
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/UIObject.java
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/UIPage.java
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/UIPortal.java
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/UIWindow.java
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/state/
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/state/ModelLoader.java
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/state/ObjectState.java
Removed:
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model2/
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model2/
Modified:
branches/UIServer/core/src/main/org/jboss/portal/core/presentation/model/ModelLoaderImpl.java
branches/UIServer/core/src/main/org/jboss/portal/core/presentation/server/PresentationServerImpl.java
branches/UIServer/core/src/main/org/jboss/portal/test/core/presentation/model/UIModelTester.java
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/RequestContext.java
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/server/PresentationServer.java
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/test/model/MockModelLoaderImpl.java
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/test/model/UIModelTester.java
Log:
refactoring
Modified:
branches/UIServer/core/src/main/org/jboss/portal/core/presentation/model/ModelLoaderImpl.java
===================================================================
---
branches/UIServer/core/src/main/org/jboss/portal/core/presentation/model/ModelLoaderImpl.java 2007-11-15
21:29:52 UTC (rev 8961)
+++
branches/UIServer/core/src/main/org/jboss/portal/core/presentation/model/ModelLoaderImpl.java 2007-11-15
21:52:45 UTC (rev 8962)
@@ -29,12 +29,12 @@
import java.util.Iterator;
import java.util.ArrayList;
-import org.jboss.portal.presentation.model2.UIObject;
-import org.jboss.portal.presentation.model2.UIPortal;
-import org.jboss.portal.presentation.model2.UIPage;
-import org.jboss.portal.presentation.model2.UIWindow;
-import org.jboss.portal.presentation.model2.state.ModelLoader;
-import org.jboss.portal.presentation.model2.state.ObjectState;
+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.ModelLoader;
+import org.jboss.portal.presentation.model.state.ObjectState;
import org.jboss.portal.core.model.portal.PortalObjectContainer;
import org.jboss.portal.core.model.portal.PortalContainer;
Modified:
branches/UIServer/core/src/main/org/jboss/portal/core/presentation/server/PresentationServerImpl.java
===================================================================
---
branches/UIServer/core/src/main/org/jboss/portal/core/presentation/server/PresentationServerImpl.java 2007-11-15
21:29:52 UTC (rev 8961)
+++
branches/UIServer/core/src/main/org/jboss/portal/core/presentation/server/PresentationServerImpl.java 2007-11-15
21:52:45 UTC (rev 8962)
@@ -25,8 +25,8 @@
import org.jboss.portal.presentation.RequestContext;
import org.jboss.portal.presentation.server.Processor;
import org.jboss.portal.presentation.server.PresentationServer;
-import org.jboss.portal.presentation.model2.UIWindow;
-import org.jboss.portal.presentation.model2.state.ModelLoader;
+import org.jboss.portal.presentation.model.UIWindow;
+import org.jboss.portal.presentation.model.state.ModelLoader;
/**
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
Modified:
branches/UIServer/core/src/main/org/jboss/portal/test/core/presentation/model/UIModelTester.java
===================================================================
---
branches/UIServer/core/src/main/org/jboss/portal/test/core/presentation/model/UIModelTester.java 2007-11-15
21:29:52 UTC (rev 8961)
+++
branches/UIServer/core/src/main/org/jboss/portal/test/core/presentation/model/UIModelTester.java 2007-11-15
21:52:45 UTC (rev 8962)
@@ -36,8 +36,11 @@
import org.jboss.portal.core.model.portal.*;
import org.jboss.portal.core.model.content.ContentType;
import org.jboss.portal.core.presentation.model.ModelLoaderImpl;
-import org.jboss.portal.presentation.model2.*;
-import org.jboss.portal.presentation.impl.model2.UIContextImpl;
+import org.jboss.portal.presentation.impl.model.UIContextImpl;
+import org.jboss.portal.presentation.model.UIContext;
+import org.jboss.portal.presentation.model.UIObject;
+import org.jboss.portal.presentation.model.UIPortal;
+import org.jboss.portal.presentation.model.UIPage;
/**
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
Modified:
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/RequestContext.java
===================================================================
---
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/RequestContext.java 2007-11-15
21:29:52 UTC (rev 8961)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/RequestContext.java 2007-11-15
21:52:45 UTC (rev 8962)
@@ -23,8 +23,8 @@
package org.jboss.portal.presentation;
import org.jboss.portal.presentation.action.server.ServerAction;
-import org.jboss.portal.presentation.model2.UIContext;
-import org.jboss.portal.presentation.model2.state.ModelLoader;
+import org.jboss.portal.presentation.model.UIContext;
+import org.jboss.portal.presentation.model.state.ModelLoader;
/**
* The contract that defines the services that the client provides to the server during a
server invocation.
Added:
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model/UIContainerImpl.java
===================================================================
---
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model/UIContainerImpl.java
(rev 0)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model/UIContainerImpl.java 2007-11-15
21:52:45 UTC (rev 8962)
@@ -0,0 +1,52 @@
+/******************************************************************************
+ * 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.impl.model;
+
+import org.jboss.portal.presentation.model.UIContainer;
+import org.jboss.portal.presentation.model.UIObject;
+import org.jboss.portal.presentation.model.UIWindow;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class UIContainerImpl extends UIObjectImpl implements UIContainer
+{
+ /**
+ *
+ * @param <T>
+ * @param type
+ * @return
+ */
+ protected <T extends UIObject> boolean isAllowedAsChild(Class<T> type)
+ {
+ boolean isAllowedAsChild = false;
+
+ if(type == UIWindow.class)
+ {
+ isAllowedAsChild = true;
+ }
+
+ return isAllowedAsChild;
+ }
+}
Added:
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model/UIContextImpl.java
===================================================================
---
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model/UIContextImpl.java
(rev 0)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model/UIContextImpl.java 2007-11-15
21:52:45 UTC (rev 8962)
@@ -0,0 +1,131 @@
+/******************************************************************************
+ * 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.impl.model;
+
+import java.util.Map;
+import java.util.Iterator;
+import org.jboss.portal.presentation.model.UIContext;
+import org.jboss.portal.presentation.model.UIObject;
+import org.jboss.portal.presentation.model.UIPortal;
+import org.jboss.portal.presentation.model.state.ModelLoader;
+import org.jboss.portal.presentation.model.state.ObjectState;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class UIContextImpl extends UIObjectImpl implements UIContext
+{
+ /**
+ *
+ */
+ private ModelLoader modelLoader = null;
+
+ /**
+ *
+ *
+ */
+ public UIContextImpl()
+ {
+ }
+
+ /**
+ *
+ */
+ public <T extends UIObject> T getObject(String id, Class<T> type)
+ {
+ try
+ {
+ T uiObject = null;
+
+ //Fetch the state of the UIObject in question
+ ObjectState objectState = this.modelLoader.loadState(id);
+
+ uiObject = this.getImplementationClass(type).newInstance();
+ ((UIObjectImpl)uiObject).setState(this,objectState, true);
+
+ return uiObject;
+ }
+ catch(Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ /**
+ *
+ */
+ public UIContext initUIObjectTree(Map<String,Class<? extends UIObject>>
rootChildrenInfo)
+ {
+ UIContext uiContext = new UIContextImpl();
+ ((UIContextImpl)uiContext).setModelLoader(this.getModelLoader());
+
+ //load the children of the UIContext
+ Iterator<String> childrenNames = rootChildrenInfo.keySet().iterator();
+ while(childrenNames.hasNext())
+ {
+ String childName = childrenNames.next();
+ Class<? extends UIObject> type = rootChildrenInfo.get(childName);
+ UIObject child = uiContext.createChild(childName, type);
+ ObjectState objectState = this.modelLoader.loadState(child.getId());
+ ((UIObjectImpl)child).setState(this,objectState, false);
+ }
+
+ return uiContext;
+ }
+
+ /**
+ *
+ */
+ public ModelLoader getModelLoader()
+ {
+ return this.modelLoader;
+ }
+
+ /**
+ *
+ * @param modelLoader
+ */
+ public void setModelLoader(ModelLoader modelLoader)
+ {
+ this.modelLoader = modelLoader;
+ }
+
+ /**
+ *
+ * @param <T>
+ * @param type
+ * @return
+ */
+ protected <T extends UIObject> boolean isAllowedAsChild(Class<T> type)
+ {
+ boolean isAllowedAsChild = false;
+
+ if(type == UIPortal.class)
+ {
+ isAllowedAsChild = true;
+ }
+
+ return isAllowedAsChild;
+ }
+}
Added:
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model/UIObjectImpl.java
===================================================================
---
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model/UIObjectImpl.java
(rev 0)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model/UIObjectImpl.java 2007-11-15
21:52:45 UTC (rev 8962)
@@ -0,0 +1,387 @@
+/******************************************************************************
+ * 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.impl.model;
+
+import java.util.List;
+import java.util.ArrayList;
+import java.io.Serializable;
+
+import org.jboss.portal.presentation.model.UIObject;
+import org.jboss.portal.presentation.model.UIContext;
+import org.jboss.portal.presentation.model.UIPortal;
+import org.jboss.portal.presentation.model.UIContainer;
+import org.jboss.portal.presentation.model.UIWindow;
+import org.jboss.portal.presentation.model.UIPage;
+
+import org.jboss.portal.presentation.model.state.ObjectState;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public abstract class UIObjectImpl implements UIObject, Serializable
+{
+ /**
+ *
+ */
+ protected String id = null;
+
+ /**
+ *
+ */
+ protected String name = null;
+
+ /**
+ *
+ */
+ protected UIObject parent = null;
+
+ /**
+ *
+ */
+ protected List<UIObject> children = new ArrayList<UIObject>(); //Lazy
loaded
+
+ /**
+ * used to see if the children of this UIObject are fully loaded or not. Used for
helping with lazy loading
+ */
+ private boolean childrenFullyLoaded = false;
+
+
+ /**
+ * This is used to assist with data needed during lazy loading, other state related
data etc
+ */
+ private ObjectState state = null;
+
+
+ /**
+ *
+ */
+ public UIObjectImpl()
+ {
+ }
+
+ //UIObject interface
implementation-----------------------------------------------------------------------------------------------------------------------------
+ /**
+ *
+ */
+ public String getId()
+ {
+ return this.id;
+ }
+
+ /**
+ *
+ */
+ public String getName()
+ {
+ return this.name;
+ }
+
+ /**
+ *
+ */
+ public UIObject getParent()
+ {
+ return this.parent;
+ }
+
+ /**
+ *
+ */
+ public List<UIObject> getChildren()
+ {
+ if(!this.childrenFullyLoaded)
+ {
+ //Lazy Load just the children of this UIObject. Don't load the children of
each child though
+ if(this.state != null)
+ {
+ List<String> childrenIds = this.state.getChildrenIds();
+ if(childrenIds != null)
+ {
+ for(int i=0; i<childrenIds.size(); i++)
+ {
+ String childId = childrenIds.get(i);
+ ObjectState childState =
this.getUIContext().getModelLoader().loadState(childId);
+ this.createChild(childState.getName(), childState.getType());
+ }
+ }
+ }
+
+ this.childrenFullyLoaded = true;
+ }
+
+ return this.children;
+ }
+
+ /**
+ *
+ */
+ public <T extends UIObject> List<T> getChildren(Class<T> type)
+ {
+ try
+ {
+ List<T> filteredList = new ArrayList<T>();
+
+ //Making sure all children are fully loaded
+ List<UIObject> allChildren = this.getChildren();
+
+ Class<T> implementationClass = this.getImplementationClass(type);
+ if(allChildren != null)
+ {
+ for(int i=0; i<allChildren.size(); i++)
+ {
+ UIObject child = allChildren.get(i);
+ if(implementationClass == child.getClass())
+ {
+ filteredList.add((T)child);
+ }
+ }
+ }
+ return filteredList;
+ }
+ catch(Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ /**
+ *
+ * @param type
+ * @return
+ */
+ protected <T extends UIObject> Class<T>
getImplementationClass(Class<T> type) throws Exception
+ {
+ Class<T> uiobjectClass = null;
+
+ if(type == UIContext.class)
+ {
+ uiobjectClass = (Class<T>)UIContextImpl.class;
+ }
+ else if(type == UIPortal.class)
+ {
+ uiobjectClass = (Class<T>)UIPortalImpl.class;
+ }
+ else if(type == UIPage.class)
+ {
+ uiobjectClass = (Class<T>)UIPageImpl.class;
+ }
+ else if(type == UIContainer.class)
+ {
+ uiobjectClass = (Class<T>)UIContainerImpl.class;
+ }
+ else if(type == UIWindow.class)
+ {
+ uiobjectClass = (Class<T>)UIWindowImpl.class;
+ }
+
+ return uiobjectClass;
+ }
+
+ /**
+ *
+ * @param <T>
+ * @param type
+ * @return
+ */
+ protected abstract <T extends UIObject> boolean isAllowedAsChild(Class<T>
type);
+
+
+ /**
+ *
+ */
+ public <T extends UIObject> T createChild(String name, Class<T> type)
throws IllegalArgumentException
+ {
+ if(!this.isAllowedAsChild(type))
+ {
+ throw new IllegalArgumentException(type.getName()+" cannot be added as a
child to this parent");
+ }
+ try
+ {
+ T child = this.getImplementationClass(type).newInstance();
+
+ //Name
+ ((UIObjectImpl)child).name = name;
+
+ //Parent
+ ((UIObjectImpl)child).parent = this;
+
+ //Id
+ ((UIObjectImpl)child).id = this.generateChildId(name);
+
+ //State
+ ((UIObjectImpl)child).state =
this.getUIContext().getModelLoader().loadState(((UIObjectImpl)child).id);
+
+ this.children.add(child);
+
+ return child;
+ }
+ catch(Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ /**
+ *
+ */
+ public void destroyChild(String name)
+ {
+ //Make sure all children are loaded
+ this.getChildren();
+ if(this.children != null)
+ {
+ for(int i=0; i<this.children.size(); i++)
+ {
+ UIObject child = this.children.get(i);
+ if(child.getName().equals(name))
+ {
+ this.children.remove(child);
+ break;
+ }
+ }
+ }
+ }
+ //-----UIObjectImpl implementation specific
methods------------------------------------------------------------------------------------------------------------
+ protected void setState(UIContext uiContext, ObjectState state, boolean loadParent)
+ {
+ //Name
+ this.name = state.getName();
+
+ //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());
+ this.parent = uiContext.getObject(state.getParentId(), parentState.getType());
+ }
+
+ //Id
+ this.id = this.generateId();
+
+ //State
+ this.state = state;
+ }
+
//--------------------------------------------------------------------------------------------------------------------------------------------------------------
+ /**
+ *
+ * @return
+ */
+ private String generateId()
+ {
+ String newId = null;
+
+ String myName = "";
+ if(this.getName() != null && this.getName().trim().length()>0)
+ {
+ myName = this.getName();
+ }
+
+ //Generate a new id concatenating its entire path in the UIObject tree
+ StringBuffer buffer = new StringBuffer();
+ if(this.getParent() != null && !(this.getParent() instanceof UIContext))
+ {
+
buffer.append("/"+this.getParent().getId().substring(1)+"/");
+ if(myName.trim().length()>0)
+ {
+ buffer.append(myName);
+ }
+ newId = buffer.toString();
+ }
+ else
+ {
+ buffer.append("/");
+ if(myName.trim().length()>0)
+ {
+ buffer.append(myName);
+ }
+ newId = buffer.toString();
+ }
+
+ return newId;
+ }
+
+ /**
+ *
+ * @return
+ */
+ private String generateChildId(String childName)
+ {
+ String newId = null;
+
+ String myName = "";
+ if(this.getName() != null && this.getName().trim().length()>0)
+ {
+ myName = this.getName();
+ }
+
+ //Generate a new id concatenating its entire path in the UIObject tree
+ StringBuffer buffer = new StringBuffer();
+ if(this.getParent() != null && !(this.getParent() instanceof UIContext))
+ {
+
buffer.append("/"+this.getParent().getId().substring(1)+"/");
+ if(myName.trim().length()>0)
+ {
+ buffer.append(myName+"/");
+ }
+ buffer.append(childName);
+ newId = buffer.toString();
+ }
+ else
+ {
+ buffer.append("/");
+ if(myName.trim().length()>0)
+ {
+ buffer.append(myName+"/");
+ }
+ buffer.append(childName);
+ newId = buffer.toString();
+ }
+
+ return newId;
+ }
+
+ /**
+ *
+ * @return
+ */
+ private UIContext getUIContext()
+ {
+ UIContext uiContext = null;
+
+ //Make sure this UIObject is not the root UIContext object
+ if(this.getParent() == null)
+ {
+ return (UIContext)this;
+ }
+
+ //Move up the tree to the UIContext and get the ModelLoader
+ UIObject parent = this.getParent();
+ while(!(parent instanceof UIContext))
+ {
+ parent = parent.getParent();
+ }
+ uiContext = (UIContext)parent;
+
+ return uiContext;
+ }
+}
Added:
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model/UIPageImpl.java
===================================================================
---
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model/UIPageImpl.java
(rev 0)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model/UIPageImpl.java 2007-11-15
21:52:45 UTC (rev 8962)
@@ -0,0 +1,57 @@
+/******************************************************************************
+ * 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.impl.model;
+
+import org.jboss.portal.presentation.model.UIObject;
+import org.jboss.portal.presentation.model.UIContainer;
+import org.jboss.portal.presentation.model.UIPage;
+import org.jboss.portal.presentation.model.UIWindow;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class UIPageImpl extends UIObjectImpl implements UIPage
+{
+ /**
+ *
+ * @param <T>
+ * @param type
+ * @return
+ */
+ protected <T extends UIObject> boolean isAllowedAsChild(Class<T> type)
+ {
+ boolean isAllowedAsChild = false;
+
+ if(
+ type == UIPage.class ||
+ type == UIContainer.class ||
+ type == UIWindow.class
+ )
+ {
+ isAllowedAsChild = true;
+ }
+
+ return isAllowedAsChild;
+ }
+}
Added:
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model/UIPortalImpl.java
===================================================================
---
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model/UIPortalImpl.java
(rev 0)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model/UIPortalImpl.java 2007-11-15
21:52:45 UTC (rev 8962)
@@ -0,0 +1,54 @@
+/******************************************************************************
+ * 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.impl.model;
+
+import org.jboss.portal.presentation.model.UIObject;
+import org.jboss.portal.presentation.model.UIPortal;
+import org.jboss.portal.presentation.model.UIPage;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class UIPortalImpl extends UIObjectImpl implements UIPortal
+{
+ /**
+ *
+ * @param <T>
+ * @param type
+ * @return
+ */
+ protected <T extends UIObject> boolean isAllowedAsChild(Class<T> type)
+ {
+ boolean isAllowedAsChild = false;
+
+ if(
+ type == UIPage.class
+ )
+ {
+ isAllowedAsChild = true;
+ }
+
+ return isAllowedAsChild;
+ }
+}
Added:
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model/UIWindowImpl.java
===================================================================
---
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model/UIWindowImpl.java
(rev 0)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model/UIWindowImpl.java 2007-11-15
21:52:45 UTC (rev 8962)
@@ -0,0 +1,109 @@
+/******************************************************************************
+ * 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.impl.model;
+
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+import org.jboss.portal.presentation.model.UIObject;
+import org.jboss.portal.presentation.model.UIWindow;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class UIWindowImpl extends UIObjectImpl implements UIWindow
+{
+ /**
+ *
+ */
+ private Mode mode = null;
+
+ /**
+ *
+ */
+ private WindowState windowState = null;
+
+ /**
+ *
+ */
+ private String title = null;
+
+ /**
+ *
+ */
+ public Mode getMode()
+ {
+ return this.mode;
+ }
+
+ /**
+ *
+ */
+ public String getTitle()
+ {
+ return this.title;
+ }
+
+ /**
+ *
+ */
+ public WindowState getWindowState()
+ {
+ return this.windowState;
+ }
+
+ /**
+ *
+ */
+ public void setMode(Mode mode)
+ {
+ this.mode = mode;
+ }
+
+ /**
+ *
+ */
+ public void setTitle(String title)
+ {
+ this.title = title;
+ }
+
+ /**
+ *
+ */
+ public void setWindowState(WindowState windowState)
+ {
+ this.windowState = windowState;
+ }
+
+ /**
+ *
+ * @param <T>
+ * @param type
+ * @return
+ */
+ protected <T extends UIObject> boolean isAllowedAsChild(Class<T> type)
+ {
+ return false;
+ }
+}
Added:
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/UIContainer.java
===================================================================
---
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/UIContainer.java
(rev 0)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/UIContainer.java 2007-11-15
21:52:45 UTC (rev 8962)
@@ -0,0 +1,31 @@
+/******************************************************************************
+ * 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;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface UIContainer extends UIObject
+{
+}
Added:
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/UIContext.java
===================================================================
---
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/UIContext.java
(rev 0)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/UIContext.java 2007-11-15
21:52:45 UTC (rev 8962)
@@ -0,0 +1,54 @@
+/******************************************************************************
+ * 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;
+
+import java.util.Map;
+import org.jboss.portal.presentation.model.state.ModelLoader;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface UIContext extends UIObject
+{
+ /**
+ *
+ * @param id
+ * @return
+ */
+ public <T extends UIObject> T getObject(String id, Class<T> type);
+
+ /**
+ *
+ * @param <T>
+ * @param childrenInfo
+ * @return
+ */
+ public UIContext initUIObjectTree(Map<String,Class<? extends UIObject>>
rootChildrenInfo);
+
+ /**
+ *
+ * @return
+ */
+ public ModelLoader getModelLoader();
+}
Added:
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/UIObject.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/UIObject.java
(rev 0)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/UIObject.java 2007-11-15
21:52:45 UTC (rev 8962)
@@ -0,0 +1,80 @@
+/******************************************************************************
+ * 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;
+
+import java.util.List;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface UIObject
+{
+ /**
+ *
+ * @return
+ */
+ public String getId();
+
+ /**
+ *
+ * @return
+ */
+ public String getName();
+
+ /**
+ *
+ * @return
+ */
+ public UIObject getParent();
+
+ /**
+ * Create a child with a specified type.
+ *
+ * @param name the child name
+ * @param type the child type
+ * @return the newly created child
+ * @throws IllegalArgumentException if the name is null, already exists or this kind
of object does not accept children of the specified type
+ */
+ public <T extends UIObject> T createChild(String name, Class<T> type)
throws IllegalArgumentException;
+
+ /**
+ *
+ * @param name
+ */
+ public void destroyChild(String name);
+
+ /**
+ *
+ * @return
+ */
+ public List<UIObject> getChildren();
+
+ /**
+ *
+ * @param <T>
+ * @param type
+ * @return
+ */
+ public <T extends UIObject> List<T> getChildren(Class<T> type);
+}
Added:
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/UIPage.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/UIPage.java
(rev 0)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/UIPage.java 2007-11-15
21:52:45 UTC (rev 8962)
@@ -0,0 +1,31 @@
+/******************************************************************************
+ * 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;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface UIPage extends UIObject
+{
+}
Added:
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/UIPortal.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/UIPortal.java
(rev 0)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/UIPortal.java 2007-11-15
21:52:45 UTC (rev 8962)
@@ -0,0 +1,31 @@
+/******************************************************************************
+ * 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;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface UIPortal extends UIObject
+{
+}
Added:
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/UIWindow.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/UIWindow.java
(rev 0)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/UIWindow.java 2007-11-15
21:52:45 UTC (rev 8962)
@@ -0,0 +1,69 @@
+/******************************************************************************
+ * 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;
+
+import org.jboss.portal.WindowState;
+import org.jboss.portal.Mode;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface UIWindow extends UIObject
+{
+ /**
+ *
+ * @return
+ */
+ public String getTitle();
+
+ /**
+ *
+ * @param title
+ */
+ public void setTitle(String title);
+
+ /**
+ *
+ * @return
+ */
+ public WindowState getWindowState();
+
+ /**
+ *
+ * @param windowState
+ */
+ public void setWindowState(WindowState windowState);
+
+ /**
+ *
+ * @return
+ */
+ public Mode getMode();
+
+ /**
+ *
+ * @param mode
+ */
+ public void setMode(Mode mode);
+}
Added:
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/state/ModelLoader.java
===================================================================
---
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/state/ModelLoader.java
(rev 0)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/state/ModelLoader.java 2007-11-15
21:52:45 UTC (rev 8962)
@@ -0,0 +1,43 @@
+/******************************************************************************
+ * 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;
+
+}
Added:
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/state/ObjectState.java
===================================================================
---
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/state/ObjectState.java
(rev 0)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/state/ObjectState.java 2007-11-15
21:52:45 UTC (rev 8962)
@@ -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;
+
+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;
+ }
+}
Modified:
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/server/PresentationServer.java
===================================================================
---
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/server/PresentationServer.java 2007-11-15
21:29:52 UTC (rev 8961)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/server/PresentationServer.java 2007-11-15
21:52:45 UTC (rev 8962)
@@ -23,8 +23,8 @@
package org.jboss.portal.presentation.server;
import org.jboss.portal.presentation.RequestContext;
-import org.jboss.portal.presentation.model2.UIWindow;
-import org.jboss.portal.presentation.model2.state.ModelLoader;
+import org.jboss.portal.presentation.model.UIWindow;
+import org.jboss.portal.presentation.model.state.ModelLoader;
/**
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
Modified:
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/test/model/MockModelLoaderImpl.java
===================================================================
---
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/test/model/MockModelLoaderImpl.java 2007-11-15
21:29:52 UTC (rev 8961)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/test/model/MockModelLoaderImpl.java 2007-11-15
21:52:45 UTC (rev 8962)
@@ -25,9 +25,9 @@
import java.util.List;
import java.util.ArrayList;
-import org.jboss.portal.presentation.model2.UIPortal;
-import org.jboss.portal.presentation.model2.state.ModelLoader;
-import org.jboss.portal.presentation.model2.state.ObjectState;
+import org.jboss.portal.presentation.model.UIPortal;
+import org.jboss.portal.presentation.model.state.ModelLoader;
+import org.jboss.portal.presentation.model.state.ObjectState;
/**
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
Modified:
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/test/model/UIModelTester.java
===================================================================
---
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/test/model/UIModelTester.java 2007-11-15
21:29:52 UTC (rev 8961)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/test/model/UIModelTester.java 2007-11-15
21:52:45 UTC (rev 8962)
@@ -29,8 +29,8 @@
import java.util.Map;
import java.util.HashMap;
-import org.jboss.portal.presentation.model2.*;
-import org.jboss.portal.presentation.impl.model2.UIContextImpl;
+import org.jboss.portal.presentation.model.*;
+import org.jboss.portal.presentation.impl.model.UIContextImpl;
/**
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>