Author: sohil.shah(a)jboss.com
Date: 2007-11-12 16:46:19 -0500 (Mon, 12 Nov 2007)
New Revision: 8889
Added:
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/processor/
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/processor/Processor.java
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/processor/ProcessorRequest.java
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/processor/ProcessorResponse.java
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/Component.java
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/Container.java
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/Page.java
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/Portal.java
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/PortalObject.java
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/Window.java
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/spi/
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/spi/PortalObjectReader.java
Removed:
branches/UIServer/core-uiserver/
Modified:
branches/UIServer/build/build.xml
branches/UIServer/core/build.xml
branches/UIServer/uiserver/build.xml
Log:
removing core-uiserver module and moving to uiserver
Modified: branches/UIServer/build/build.xml
===================================================================
--- branches/UIServer/build/build.xml 2007-11-12 21:14:44 UTC (rev 8888)
+++ branches/UIServer/build/build.xml 2007-11-12 21:46:19 UTC (rev 8889)
@@ -139,14 +139,13 @@
<module name="workflow"/>
<module name="widget"/>
<module name="uiserver"/>
- <module name="core-uiserver"/>
<!--<module name="core-admin"/>-->
<!-- Module groups -->
<group name="portal">
<include
- modules="common, test, api, web, jems, server, security, identity,
search, format, portlet, portlet-server, bridge, faces, portlet-federation, theme,
workflow, cms, registration, core-uiserver, uiserver, core, wsrp, core-admin, core-cms,
core-management, core-samples, widget"/>
+ modules="common, test, api, web, jems, server, security, identity,
search, format, portlet, portlet-server, bridge, faces, portlet-federation, theme,
workflow, cms, registration, uiserver, core, wsrp, core-admin, core-cms, core-management,
core-samples, widget"/>
</group>
<group name="cms">
Modified: branches/UIServer/core/build.xml
===================================================================
--- branches/UIServer/core/build.xml 2007-11-12 21:14:44 UTC (rev 8888)
+++ branches/UIServer/core/build.xml 2007-11-12 21:46:19 UTC (rev 8889)
@@ -133,7 +133,7 @@
<path refid="jboss.portlet-api.classpath"/>
<path refid="jboss.portal-theme.classpath"/>
<path refid="jboss.portal-security.classpath"/>
- <path refid="jboss.portal-core-uiserver.classpath"/>
+ <path refid="jboss.portal-uiserver.classpath"/>
<path refid="jboss.portal-test.classpath"/>
</path>
@@ -380,13 +380,7 @@
</target>
<!-- Build the jboss-portal.sar -->
- <target name="pre-output">
- <copy todir="${build.resources}/jboss-portal/lib">
- <fileset dir="${jboss.portal-core-uiserver.root}/lib"
includes="portal-core-uiserver-lib.jar"/>
- </copy>
- <copy todir="${build.resources}/jboss-portal.sar/lib">
- <fileset dir="${jboss.portal-core-uiserver.root}/lib"
includes="portal-core-uiserver-lib.jar"/>
- </copy>
+ <target name="pre-output">
<copy todir="${build.resources}/jboss-portal/portal-uiserver.sar">
<fileset
dir="${jboss.portal-uiserver.root}/resources/portal-uiserver.sar"/>
</copy>
Modified: branches/UIServer/uiserver/build.xml
===================================================================
--- branches/UIServer/uiserver/build.xml 2007-11-12 21:14:44 UTC (rev 8888)
+++ branches/UIServer/uiserver/build.xml 2007-11-12 21:46:19 UTC (rev 8889)
@@ -98,10 +98,12 @@
<!-- Configure modules -->
<call target="configure-modules"/>
- <path id="dependentmodule.classpath">
+ <path id="dependentmodule.classpath">
+ <path refid="jboss.portlet-api.classpath"/>
<path refid="jboss.portal-jems.classpath"/>
<path refid="jboss.portal-common.classpath"/>
<path refid="jboss.portal-server.classpath"/>
+ <path refid="jboss.portal-web.classpath"/>
<path refid="jboss.portal-core-uiserver.classpath"/>
</path>
Added:
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/processor/Processor.java
===================================================================
---
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/processor/Processor.java
(rev 0)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/processor/Processor.java 2007-11-12
21:46:19 UTC (rev 8889)
@@ -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.uiserver.processor;
+
+import org.jboss.portal.server.ServerException;
+
+/**
+ * UIServer calls the Processor to hand it
+ * processing of an incoming Portal Request using the protocol between the two components
encapsulated by the
+ * ProcessorRequest object
+ *
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public interface Processor
+{
+ /**
+ *
+ * @param request
+ * @throws ServerException
+ */
+ public ProcessorResponse process(ProcessorRequest request) throws ServerException;
+}
Added:
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/processor/ProcessorRequest.java
===================================================================
---
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/processor/ProcessorRequest.java
(rev 0)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/processor/ProcessorRequest.java 2007-11-12
21:46:19 UTC (rev 8889)
@@ -0,0 +1,153 @@
+/******************************************************************************
+ * 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.uiserver.processor;
+
+import java.io.Serializable;
+
+import org.jboss.portal.uiserver.protocol.Portal;
+import org.jboss.portal.uiserver.protocol.PortalObject;
+import org.jboss.portal.server.ServerInvocation;
+
+
+/**
+ * ProcessorRequest is used to communicate information from the UIServer to the core
Portal for it to process the incoming Portal request.
+ *
+ * This object is part of the protocol between the UIServer and the core
+ *
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class ProcessorRequest implements Serializable
+{
+ /**
+ * Target object where action needs to be performed
+ */
+ private PortalObject target = null;
+
+ /**
+ * The Portal that the target object belongs to
+ */
+ private Portal portal = null;
+
+ /**
+ * The Portal action to be performed. For now, action and render
+ */
+ private String actionType = null;
+
+
+ private ServerInvocation serverInvocation = null;
+
+ /**
+ *
+ *
+ */
+ public ProcessorRequest(String actionType, ServerInvocation serverInvocation, Portal
portal, PortalObject target)
+ {
+ this.actionType = actionType;
+ this.serverInvocation = serverInvocation;
+ this.portal = portal;
+ this.target = target;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getActionType()
+ {
+ return actionType;
+ }
+
+ /**
+ *
+ * @param actionType
+ */
+ public void setActionType(String actionType)
+ {
+ this.actionType = actionType;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public Portal getPortal()
+ {
+ return portal;
+ }
+
+ /**
+ *
+ * @param portal
+ */
+ public void setPortal(Portal portal)
+ {
+ this.portal = portal;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public PortalObject getTarget()
+ {
+ return target;
+ }
+
+ /**
+ *
+ * @param target
+ */
+ public void setTarget(PortalObject target)
+ {
+ this.target = target;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public ServerInvocation getServerInvocation()
+ {
+ return serverInvocation;
+ }
+
+ /**
+ *
+ * @param serverInvocation
+ */
+ public void setServerInvocation(ServerInvocation serverInvocation)
+ {
+ this.serverInvocation = serverInvocation;
+ }
+
+ /**
+ *
+ */
+ public String toString()
+ {
+ StringBuffer buffer = new StringBuffer();
+ buffer.append("[actionType="+this.actionType+",
portal="+this.portal+", target="+this.target+"]");
+ return buffer.toString();
+ }
+}
Added:
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/processor/ProcessorResponse.java
===================================================================
---
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/processor/ProcessorResponse.java
(rev 0)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/processor/ProcessorResponse.java 2007-11-12
21:46:19 UTC (rev 8889)
@@ -0,0 +1,171 @@
+/******************************************************************************
+ * 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.uiserver.processor;
+
+import java.io.Serializable;
+import java.util.List;
+
+import org.jboss.portal.web.ServletContextDispatcher;
+
+import org.jboss.portal.uiserver.protocol.Page;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class ProcessorResponse implements Serializable
+{
+ /**
+ *
+ */
+ private ServletContextDispatcher dispatcher = null;
+
+ /**
+ * Contains a list of pages that need to be updated on the client. These pages may not
necessarily
+ * be the currently displayed page, but nevertheless, these are pages whose window
content changed
+ * as a result of this particular Portal request processing.
+ *
+ * For most usecases this probably only consist of the Page that is currently being
displayed on the client
+ */
+ private List updatedPages = null;
+
+ /**
+ * Content Type of the response being sent back to the client
+ */
+ private String contentType = null;
+
+ /**
+ * Character Set of the response being sent back to the client
+ */
+ private String charSet = null;
+
+
+ /**
+ *
+ * @param dispatcher
+ * @param updatedPages
+ */
+ public ProcessorResponse(ServletContextDispatcher dispatcher, String contentType,
String charSet, List updatedPages)
+ {
+ this.dispatcher = dispatcher;
+ this.contentType = contentType;
+ this.charSet = charSet;
+ this.updatedPages = updatedPages;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public ServletContextDispatcher getDispatcher()
+ {
+ return dispatcher;
+ }
+
+ /**
+ *
+ * @param dispatcher
+ */
+ public void setDispatcher(ServletContextDispatcher dispatcher)
+ {
+ this.dispatcher = dispatcher;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public List getUpdatedPages()
+ {
+ return updatedPages;
+ }
+
+ /**
+ *
+ * @param updatedPages
+ */
+ public void setUpdatedPages(List updatedPages)
+ {
+ this.updatedPages = updatedPages;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getCharSet()
+ {
+ return charSet;
+ }
+
+ /**
+ *
+ * @param charSet
+ */
+ public void setCharSet(String charSet)
+ {
+ this.charSet = charSet;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getContentType()
+ {
+ return contentType;
+ }
+
+ /**
+ *
+ * @param contentType
+ */
+ public void setContentType(String contentType)
+ {
+ this.contentType = contentType;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public Page findDisplayedPage()
+ {
+ Page displayedPage = null;
+
+ if(this.updatedPages != null)
+ {
+ for(int i=0; i<this.updatedPages.size(); i++)
+ {
+ Page cour = (Page)this.updatedPages.get(i);
+ if(cour.isCurrentlyDisplayed())
+ {
+ displayedPage = cour;
+ break;
+ }
+ }
+ }
+
+ return displayedPage;
+ }
+}
Added:
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/Component.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/Component.java
(rev 0)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/Component.java 2007-11-12
21:46:19 UTC (rev 8889)
@@ -0,0 +1,53 @@
+/******************************************************************************
+ * 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.uiserver.protocol;
+
+import java.io.Serializable;
+
+/**
+ * Component represents a UI entity that will be rendered eventually on the client
+ *
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public interface Component extends Serializable
+{
+ /**
+ *
+ * @return
+ */
+ public String getId();
+
+ /**
+ *
+ * @param id
+ */
+ public void setId(String id);
+
+
+ /**
+ *
+ * @return
+ */
+ public String getMarkup();
+}
Added:
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/Container.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/Container.java
(rev 0)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/Container.java 2007-11-12
21:46:19 UTC (rev 8889)
@@ -0,0 +1,134 @@
+/******************************************************************************
+ * 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.uiserver.protocol;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * Container is an organizational entity which aggregates the Components that will be
rendered on the client
+ *
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class Container implements Serializable
+{
+ /**
+ * required unique id of the container. uniqueness in relation to
+ * other containers added to the same instance of the page
+ */
+ protected String id = null;
+
+
+ /**
+ *
+ */
+ private List components = null;
+
+ /**
+ *
+ *
+ */
+ public Container(String id)
+ {
+ this.id = id;
+ this.components = new ArrayList();
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getId()
+ {
+ return id;
+ }
+
+ /**
+ *
+ * @param id
+ */
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+
+ /**
+ *
+ * @return
+ */
+ public List getComponents()
+ {
+ return components;
+ }
+
+ /**
+ *
+ * @param components
+ */
+ public void setComponents(List components)
+ {
+ this.components = components;
+ }
+
+ /**
+ *
+ * @param componentId
+ * @return
+ */
+ public Component getComponent(String componentId)
+ {
+ Component component = null;
+
+ if(this.components != null)
+ {
+ for(int i=0;i<this.components.size();i++)
+ {
+ Component cour = (Component)this.components.get(i);
+ if(cour.getId().equals(componentId))
+ {
+ component = cour;
+ break;
+ }
+ }
+ }
+
+ return component;
+ }
+
+ /**
+ *
+ * @param component
+ */
+ public void addComponent(Component component)
+ {
+ if(this.components == null)
+ {
+ this.components = new ArrayList();
+ }
+
+ this.components.add(component);
+ }
+}
Added: branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/Page.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/Page.java
(rev 0)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/Page.java 2007-11-12
21:46:19 UTC (rev 8889)
@@ -0,0 +1,132 @@
+/******************************************************************************
+ * 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.uiserver.protocol;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class Page extends PortalObject
+{
+ /**
+ * A page consists of multiple containers that are to be displayed/aggregated along
with their corresponding
+ * UI components
+ */
+ private List containers = null;
+
+ /**
+ * Signifies if this page is currently being displayed on the client
+ */
+ private boolean currentlyDisplayed = false;
+
+ /**
+ *
+ *
+ */
+ public Page()
+ {
+ super();
+ this.containers = new ArrayList();
+ }
+
+ /**
+ *
+ */
+ public String toString()
+ {
+ return "Page: "+super.toString();
+ }
+
+ /**
+ *
+ * @return
+ */
+ public List getWindows()
+ {
+ List windows = new ArrayList();
+
+ if(this.children != null)
+ {
+ for(Iterator itr=this.children.iterator(); itr.hasNext();)
+ {
+ Object child = itr.next();
+
+ if(child instanceof Window)
+ {
+ windows.add(child);
+ }
+ }
+ }
+
+ return windows;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public List getContainers()
+ {
+ return containers;
+ }
+
+ /**
+ *
+ * @param containers
+ */
+ public void setContainers(List containers)
+ {
+ this.containers = containers;
+ }
+
+ /**
+ *
+ * @param container
+ */
+ public void addContainer(Container container)
+ {
+ this.getContainers().add(container);
+ }
+
+ /**
+ *
+ * @return
+ */
+ public boolean isCurrentlyDisplayed()
+ {
+ return currentlyDisplayed;
+ }
+
+ /**
+ *
+ * @param currentlyDisplayed
+ */
+ public void setCurrentlyDisplayed(boolean currentlyDisplayed)
+ {
+ this.currentlyDisplayed = currentlyDisplayed;
+ }
+}
Added: branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/Portal.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/Portal.java
(rev 0)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/Portal.java 2007-11-12
21:46:19 UTC (rev 8889)
@@ -0,0 +1,39 @@
+/******************************************************************************
+ * 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.uiserver.protocol;
+
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class Portal extends PortalObject
+{
+ /**
+ *
+ */
+ public String toString()
+ {
+ return "Portal: "+super.toString();
+ }
+}
Added:
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/PortalObject.java
===================================================================
---
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/PortalObject.java
(rev 0)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/PortalObject.java 2007-11-12
21:46:19 UTC (rev 8889)
@@ -0,0 +1,212 @@
+/******************************************************************************
+ * 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.uiserver.protocol;
+
+import java.io.Serializable;
+import java.util.Map;
+import java.util.Collection;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.HashMap;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public abstract class PortalObject implements Serializable
+{
+ protected String id = null;
+ protected String name = null;
+ protected PortalObject parent = null;
+ protected Collection children = null;
+ protected Map properties = null;
+
+ /**
+ *
+ *
+ */
+ public PortalObject()
+ {
+ this.children = new ArrayList();
+ this.properties = new HashMap(5);
+ }
+
+ /**
+ *
+ * @param id
+ * @param name
+ * @param parent
+ * @param children
+ */
+ public PortalObject(String id, String name, PortalObject parent, Collection children)
+ {
+ this.id = id;
+ this.name = name;
+ this.parent = parent;
+ this.children = children;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getId()
+ {
+ return id;
+ }
+
+ /**
+ *
+ * @param id
+ */
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ *
+ * @param name
+ */
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public PortalObject getParent()
+ {
+ return parent;
+ }
+
+ /**
+ *
+ * @param parent
+ */
+ public void setParent(PortalObject parent)
+ {
+ this.parent = parent;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public Collection getChildren()
+ {
+ if(this.children == null)
+ {
+ this.children = new ArrayList();
+ }
+ return children;
+ }
+
+ /**
+ *
+ * @param children
+ */
+ public void setChildren(Collection children)
+ {
+ this.children = children;
+ }
+
+ /**
+ * Recursively traverses the Portal Object's children tree to find a child
registered with the
+ * specified id
+ *
+ * @param id
+ * @return
+ */
+ public PortalObject findChild(String id)
+ {
+ PortalObject child = null;
+
+ for(Iterator itr=this.children.iterator(); itr.hasNext();)
+ {
+ PortalObject cour = (PortalObject)itr.next();
+ if(cour.id.equals(id))
+ {
+ child = cour;
+ }
+ else
+ {
+ child = cour.findChild(id);
+ }
+
+ if(child != null)
+ {
+ return child;
+ }
+ }
+
+ return child;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public Map getProperties()
+ {
+ return properties;
+ }
+
+ /**
+ *
+ * @param properties
+ */
+ public void setProperties(Map properties)
+ {
+ this.properties = properties;
+ }
+
+ /**
+ *
+ */
+ public String toString()
+ {
+ String rep = null;
+
+ StringBuffer buffer = new StringBuffer();
+ buffer.append("[");
+ buffer.append("id="+this.id+",");
+ buffer.append("name="+this.name);
+ buffer.append("]");
+
+ rep = buffer.toString();
+
+ return rep;
+ }
+}
Added: branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/Window.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/Window.java
(rev 0)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/protocol/Window.java 2007-11-12
21:46:19 UTC (rev 8889)
@@ -0,0 +1,240 @@
+/******************************************************************************
+ * 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.uiserver.protocol;
+
+import java.util.Map;
+import java.util.HashMap;
+
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class Window extends PortalObject implements Component
+{
+ /**
+ * Title for this Window
+ */
+ private String title = null;
+
+ /**
+ * Content/Markup to be displayed inside this Window
+ */
+ private String content = null;
+
+ /**
+ * Content/Markup related to the header of this Window
+ */
+ private final String headerContent;
+
+ /**
+ * The State of this Window such as Normal, Maximized, Minimized etc
+ */
+ private final WindowState windowState;
+
+ /**
+ * The Mode of this Window such as View, Edit, Help etc
+ */
+ private final Mode mode;
+
+ /**
+ * Runtime View related meta data associated with this particular window.
+ *
+ * The meta data is provided in the form of Name/Value pairs with Name being the key
of the and Value being the Value
+ * of a Map entry
+ */
+ private Map viewMetaData = null;
+
+
+ /**
+ *
+ *
+ */
+ public Window()
+ {
+ super();
+ this.viewMetaData = new HashMap(5);
+ this.headerContent = null;
+ this.windowState = null;
+ this.mode = null;
+ }
+
+ /**
+ *
+ *
+ */
+ public Window(String id,String title, String content, String headerContent,
WindowState windowState, Mode mode)
+ {
+ super();
+ this.viewMetaData = new HashMap(5);
+ this.id = id;
+ this.title = title;
+ this.content = content;
+ this.headerContent = headerContent;
+ this.windowState = windowState;
+ this.mode = mode;
+ }
+
+ /**
+ *
+ * @param id
+ * @param content
+ */
+ public Window(String id, String content)
+ {
+ super();
+ this.viewMetaData = new HashMap(5);
+ this.id = id;
+ this.content = content;
+ this.headerContent = null;
+ this.windowState = null;
+ this.mode = null;
+ }
+
+ /**
+ *
+ * @param id
+ * @param content
+ */
+ public Window(String id)
+ {
+ super();
+ this.viewMetaData = new HashMap(5);
+ this.id = id;
+ this.headerContent = null;
+ this.windowState = null;
+ this.mode = null;
+ }
+
+
+ /**
+ *
+ * @return
+ */
+ public String getContent()
+ {
+ return content;
+ }
+
+
+ /**
+ *
+ * @param content
+ */
+ public void setContent(String content)
+ {
+ this.content = content;
+ }
+
+
+ /**
+ *
+ * @return
+ */
+ public String getHeaderContent()
+ {
+ return headerContent;
+ }
+
+
+ /**
+ *
+ * @return
+ */
+ public Mode getMode()
+ {
+ return mode;
+ }
+
+
+ /**
+ *
+ * @return
+ */
+ public String getTitle()
+ {
+ return title;
+ }
+
+
+ /**
+ *
+ * @param title
+ */
+ public void setTitle(String title)
+ {
+ this.title = title;
+ }
+
+
+ /**
+ *
+ * @return
+ */
+ public WindowState getWindowState()
+ {
+ return windowState;
+ }
+
+
+ /**
+ *
+ */
+ public String toString()
+ {
+ return "Window: "+super.toString();
+ }
+
+ /**
+ *
+ */
+ public String getMarkup()
+ {
+ String markup = "";
+
+ markup = this.content;
+
+ return markup;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public Map getViewMetaData()
+ {
+ return viewMetaData;
+ }
+
+ /**
+ *
+ * @param viewMetaData
+ */
+ public void setViewMetaData(Map viewMetaData)
+ {
+ this.viewMetaData = viewMetaData;
+ }
+}
Added:
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/spi/PortalObjectReader.java
===================================================================
---
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/spi/PortalObjectReader.java
(rev 0)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/spi/PortalObjectReader.java 2007-11-12
21:46:19 UTC (rev 8889)
@@ -0,0 +1,55 @@
+/******************************************************************************
+ * 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.uiserver.spi;
+
+import org.jboss.portal.uiserver.protocol.Portal;
+import org.jboss.portal.uiserver.protocol.PortalObject;
+
+/**
+ * The PortalObjectReader service is used to provide information about different Portal
Objects stored in the system
+ *
+ * It provides an implementation independent way to query this information without any
coupling to low level Portal container
+ * implementation details
+ *
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public interface PortalObjectReader
+{
+ /**
+ * Finds a Portal registered with the specified id in the system
+ *
+ * @param id
+ * @return
+ */
+ public Portal findPortal(String id);
+
+ /**
+ * Finds a PortalObject registered as a child of the specified parent
+ *
+ * @param portal
+ * @param id
+ * @return
+ */
+ public PortalObject findPortalObject(PortalObject parent, String id);
+}