[portal-commits] JBoss Portal SVN: r8992 - in branches/UIServer: uiserver/src/main/org/jboss/portal/presentation/controller and 3 other directories.

portal-commits at lists.jboss.org portal-commits at lists.jboss.org
Sat Nov 17 13:43:51 EST 2007


Author: julien at jboss.com
Date: 2007-11-17 13:43:51 -0500 (Sat, 17 Nov 2007)
New Revision: 8992

Added:
   branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model/UIObjectList.java
Modified:
   branches/UIServer/core/src/main/org/jboss/portal/core/presentation/model/ModelLoaderImpl.java
   branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/controller/UIController.java
   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/UIContext.java
   branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/UIObject.java
   branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/state/ModelLoader.java
Log:
udpates

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-17 16:12:44 UTC (rev 8991)
+++ branches/UIServer/core/src/main/org/jboss/portal/core/presentation/model/ModelLoaderImpl.java	2007-11-17 18:43:51 UTC (rev 8992)
@@ -72,7 +72,13 @@
    {
       this.portalObjectContainer = portalObjectContainer;
    }
-   
+
+
+   public String getRootId()
+   {
+      return portalObjectContainer.getContext().getId().toString();
+   }
+
    /**
     * 
     */

Modified: branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/controller/UIController.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/controller/UIController.java	2007-11-17 16:12:44 UTC (rev 8991)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/controller/UIController.java	2007-11-17 18:43:51 UTC (rev 8992)
@@ -138,8 +138,8 @@
             if(targetPortalObject instanceof UIPage)
             {            
                //Load the objects in the UITree
-               UIPortal portal = requestContext.getUIContext().createChild(targetPortal.getName(), UIPortal.class);
-               UIPage page = portal.createChild(targetPortalObject.getName(), UIPage.class);
+               UIPortal portal = (UIPortal)requestContext.getUIContext().getChild(targetPortal.getName());
+               UIPage page = (UIPage)portal.getChild(targetPortalObject.getName());
                
                //Populate the state of the Windows in the Page that is being displayed
                //inside the UITree
@@ -266,7 +266,7 @@
          ObjectState objectState = this.presentationServer.getModelLoader().loadState(id);
          if(objectState != null && objectState.getType() == UIPortal.class)
          {
-            targetPortal = requestContext.getUIContext().getObject(id, UIPortal.class);
+            targetPortal = (UIPortal)requestContext.getUIContext().getObject(id);
             break;
          }
          buffer.append("/");
@@ -297,11 +297,11 @@
          {
             if(objectState.getType() == UIPage.class)
             {
-               targetPortalObject = requestContext.getUIContext().getObject(id, UIPage.class);
+               targetPortalObject = requestContext.getUIContext().getObject(id);
             }
             else if(objectState.getType() == UIWindow.class)
             {
-               targetPortalObject = requestContext.getUIContext().getObject(id, UIWindow.class);
+               targetPortalObject = requestContext.getUIContext().getObject(id);
             }
          }
          buffer.append("/");

Modified: 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	2007-11-17 16:12:44 UTC (rev 8991)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model/UIContainerImpl.java	2007-11-17 18:43:51 UTC (rev 8992)
@@ -25,6 +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;
 
 /**
  * @author <a href="mailto:sshah at redhat.com">Sohil Shah</a>
@@ -32,6 +33,12 @@
  */
 public class UIContainerImpl extends UIObjectImpl implements UIContainer
 {
+
+   public UIContainerImpl(UIContextImpl context, String id, ObjectState state)
+   {
+      super(context, id, state);
+   }
+
    /**
     * 
     * @param <T>

Modified: 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	2007-11-17 16:12:44 UTC (rev 8991)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model/UIContextImpl.java	2007-11-17 18:43:51 UTC (rev 8992)
@@ -23,11 +23,14 @@
 package org.jboss.portal.presentation.impl.model;
 
 import java.util.Map;
-import java.util.Iterator;
-import java.util.List;
+import java.util.HashMap;
+
 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;
+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;
 
@@ -37,64 +40,84 @@
  */
 public class UIContextImpl extends UIObjectImpl implements UIContext
 {
+
+   /** . */
+   Map<String, UIObject> objects = new HashMap<String, UIObject>();
+
    /**
     * 
     */
    private ModelLoader modelLoader = null;
-   
-   /**
-    * 
-    *
-    */
-   public UIContextImpl()
+
+   private static String getRootId(ModelLoader loader)
    {
+      return loader.getRootId();
    }
-   
+
+   private static ObjectState getRootState(ModelLoader loader)
+   {
+      return loader.loadState(loader.getRootId());
+   }
+
+   public UIContextImpl(ModelLoader modelLoader)
+   {
+      super(getRootId(modelLoader), getRootState(modelLoader));
+
+      //
+      this.modelLoader = modelLoader;
+   }
+
    /**
     * 
     */
-   public <T extends UIObject> T getObject(String id, Class<T> type)
+   public UIObject getObject(String id)
    {
       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;
+         UIObject object = objects.get(id);
+         if (object == null)
+         {
+            //Fetch the state of the UIObject in question
+            ObjectState objectState = this.modelLoader.loadState(id);
+            object = getImplementation(id, objectState);
+            objects.put(id, object);
+         }
+         return object;
       }
-      catch(Exception e)
+      catch (Exception e)
       {
          throw new RuntimeException(e);
-      }      
+      }
    }
-   
+
    /**
-    * 
+    * @return
     */
-   public UIContext initUIObjectTree(Map<String,Class<? extends UIObject>> rootChildrenInfo)
+   protected UIObject getImplementation(String id, ObjectState state) throws Exception
    {
-      UIContext uiContext = new UIContextImpl();
-      ((UIContextImpl)uiContext).setModelLoader(this.getModelLoader());
-      
-      //load the children of the UIContext
-      Iterator<String> childrenNames = rootChildrenInfo.keySet().iterator();
-      while(childrenNames.hasNext())
+      Class type = state.getType();
+      if(type == UIPortal.class)
       {
-         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;
+         return new UIPortalImpl(this, id, state);
+      }
+      else if(type == UIPage.class)
+      {
+         return new UIPageImpl(this, id, state);
+      }
+      else if(type == UIContainer.class)
+      {
+         return new UIContainerImpl(this, id, state);
+      }
+      else if(type == UIWindow.class)
+      {
+         return new UIWindowImpl(this, id, state);
+      }
+      else
+      {
+         throw new IllegalArgumentException();
+      }
    }
-   
+
    /**
     * 
     */
@@ -102,18 +125,9 @@
    {
       return this.modelLoader;
    }
-   
+
    /**
     * 
-    * @param modelLoader
-    */
-   public void setModelLoader(ModelLoader modelLoader)
-   {
-      this.modelLoader = modelLoader;
-   }   
-   
-   /**
-    * 
     * @param <T>
     * @param type
     * @return

Modified: 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	2007-11-17 16:12:44 UTC (rev 8991)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model/UIObjectImpl.java	2007-11-17 18:43:51 UTC (rev 8992)
@@ -41,45 +41,64 @@
  */
 public abstract class UIObjectImpl implements UIObject, Serializable
 {
+
    /**
-    * 
+    *
     */
-   protected String id = null;
-   
+   protected final UIContextImpl context;
+
    /**
     * 
     */
-   protected String name = null;
+   protected final String id;
    
    /**
     * 
     */
-   protected UIObject parent = null;
+   protected final String name;
    
    /**
-    * 
+    *
     */
-   protected List<UIObject> children = new ArrayList<UIObject>(); //Lazy loaded
-   
+   protected final String parentId;
+
    /**
-    * used to see if the children of this UIObject are fully loaded or not. Used for helping with lazy loading
+    *
     */
-   private boolean childrenFullyLoaded = false;
-   
-      
+   protected final UIObjectList children;
+
    /**
     * This is used to assist with data needed during lazy loading, other state related data etc
     */
-   private ObjectState state = null;
+   private final ObjectState state;
+
    
-   
    /**
-    * 
+    *
     */
-   public UIObjectImpl()
-   {      
+   public UIObjectImpl(UIContextImpl context, String id, ObjectState state)
+   {
+      this.id = id;
+      this.parentId = state.getParentId();
+      this.name = state.getName();
+      this.state = state;
+      this.context = context;
+      this.children = new UIObjectList(this.context, state.getChildrenIds());
    }
-   
+
+   /**
+    *
+    */
+   public UIObjectImpl(String id, ObjectState state)
+   {
+      this.id = id;
+      this.parentId = state.getParentId();
+      this.name = state.getName();
+      this.state = state;
+      this.context = (UIContextImpl)this;
+      this.children = new UIObjectList(this.context, state.getChildrenIds());
+   }
+
    //UIObject interface implementation-----------------------------------------------------------------------------------------------------------------------------
    /**
     * 
@@ -88,7 +107,19 @@
    {
       return this.id;
    }
-   
+
+   public UIObject getChild(String name)
+   {
+      for (UIObject child : getChildren())
+      {
+         if (child.getName().equals(name))
+         {
+            return child;
+         }
+      }
+      return null;
+   }
+
    /**
     * 
     */
@@ -102,7 +133,7 @@
     */
    public UIObject getParent()
    {      
-      return this.parent;
+      return context.getObject(parentId);
    }
    
    /**
@@ -110,26 +141,6 @@
     */
    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;
    }
    
@@ -138,68 +149,36 @@
     */
    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);
-      }
+//      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);
+//      }
+      throw new UnsupportedOperationException("todo");
    }
 
    /**
     * 
-    * @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
@@ -210,115 +189,114 @@
    /**
     * 
     */
-   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 <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;
+//
+//         //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;
+//            }
+//         }
+//      }
+//   }
 
-   /**
-    * 
-    */
-   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;
-   }
+//   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 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;
+//   }
    
    /**
     * 

Added: branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model/UIObjectList.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model/UIObjectList.java	                        (rev 0)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model/UIObjectList.java	2007-11-17 18:43:51 UTC (rev 8992)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * 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 java.util.AbstractList;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class UIObjectList extends AbstractList<UIObject>
+{
+
+   /** . */
+   private final UIContextImpl context;
+
+   /** . */
+   private final List<String> ids;
+
+   public UIObjectList(UIContextImpl context, List<String> ids)
+   {
+      this.context = context;
+      this.ids = ids;
+   }
+
+   public UIObject get(int i)
+   {
+      return context.getObject(ids.get(i));
+   }
+
+   public int size()
+   {
+      return ids.size();
+   }
+}

Modified: 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	2007-11-17 16:12:44 UTC (rev 8991)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model/UIPageImpl.java	2007-11-17 18:43:51 UTC (rev 8992)
@@ -26,13 +26,20 @@
 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;
 
 /**
  * @author <a href="mailto:sshah at redhat.com">Sohil Shah</a>
  *
  */
 public class UIPageImpl extends UIObjectImpl implements UIPage
-{ 
+{
+
+   public UIPageImpl(UIContextImpl context, String id, ObjectState state)
+   {
+      super(context, id, state);
+   }
+
    /**
     * 
     * @param <T>

Modified: 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	2007-11-17 16:12:44 UTC (rev 8991)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model/UIPortalImpl.java	2007-11-17 18:43:51 UTC (rev 8992)
@@ -25,6 +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;
 
 /**
  * @author <a href="mailto:sshah at redhat.com">Sohil Shah</a>
@@ -32,6 +33,12 @@
  */
 public class UIPortalImpl extends UIObjectImpl implements UIPortal
 {
+
+   public UIPortalImpl(UIContextImpl context, String id, ObjectState state)
+   {
+      super(context, id, state);
+   }
+
    /**
     * 
     * @param <T>

Modified: 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	2007-11-17 16:12:44 UTC (rev 8991)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model/UIWindowImpl.java	2007-11-17 18:43:51 UTC (rev 8992)
@@ -26,6 +26,7 @@
 import org.jboss.portal.WindowState;
 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.content.WindowContent;
 
 /**
@@ -49,6 +50,11 @@
     */
    private WindowContent content = null;
 
+   public UIWindowImpl(UIContextImpl context, String id, ObjectState state)
+   {
+      super(context, id, state);
+   }
+
    /**
     * 
     * @return

Modified: branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/UIContext.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/UIContext.java	2007-11-17 16:12:44 UTC (rev 8991)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/UIContext.java	2007-11-17 18:43:51 UTC (rev 8992)
@@ -36,19 +36,11 @@
     * @param id
     * @return
     */
-   public <T extends UIObject> T getObject(String id, Class<T> type);
+   public UIObject getObject(String id);
    
    /**
     * 
-    * @param <T>
-    * @param childrenInfo
     * @return
     */
-   public UIContext initUIObjectTree(Map<String,Class<? extends UIObject>> rootChildrenInfo);
-   
-   /**
-    * 
-    * @return
-    */
    public ModelLoader getModelLoader();      
 }

Modified: branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/UIObject.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/UIObject.java	2007-11-17 16:12:44 UTC (rev 8991)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/UIObject.java	2007-11-17 18:43:51 UTC (rev 8992)
@@ -48,6 +48,8 @@
     */
    public UIObject getParent();
 
+   public UIObject getChild(String name);
+
    /**
     * Create a child with a specified type.
     *
@@ -56,13 +58,13 @@
     * @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;
+//   public <T extends UIObject> T createChild(String name, Class<T> type) throws IllegalArgumentException;
 
    /**
     * 
     * @param name
     */
-   public void destroyChild(String name);
+//   public void destroyChild(String name);
 
    /**
     * 

Modified: 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	2007-11-17 16:12:44 UTC (rev 8991)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/state/ModelLoader.java	2007-11-17 18:43:51 UTC (rev 8992)
@@ -40,4 +40,6 @@
     */
    ObjectState loadState(String objectId) throws IllegalArgumentException;
 
+   String getRootId();
+
 }




More information about the portal-commits mailing list