Author: sohil.shah(a)jboss.com
Date: 2007-09-12 23:55:54 -0400 (Wed, 12 Sep 2007)
New Revision: 8256
Added:
branches/UIServer/core-uiserver/
branches/UIServer/core-uiserver/build.bat
branches/UIServer/core-uiserver/build.sh
branches/UIServer/core-uiserver/build.xml
branches/UIServer/core-uiserver/src/
branches/UIServer/core-uiserver/src/main/
branches/UIServer/core-uiserver/src/main/org/
branches/UIServer/core-uiserver/src/main/org/jboss/
branches/UIServer/core-uiserver/src/main/org/jboss/portal/
branches/UIServer/core-uiserver/src/main/org/jboss/portal/uiserver/
branches/UIServer/core-uiserver/src/main/org/jboss/portal/uiserver/processor/
branches/UIServer/core-uiserver/src/main/org/jboss/portal/uiserver/processor/Processor.java
branches/UIServer/core-uiserver/src/main/org/jboss/portal/uiserver/processor/ProcessorRequest.java
branches/UIServer/core-uiserver/src/main/org/jboss/portal/uiserver/protocol/
branches/UIServer/core-uiserver/src/main/org/jboss/portal/uiserver/protocol/Page.java
branches/UIServer/core-uiserver/src/main/org/jboss/portal/uiserver/protocol/Portal.java
branches/UIServer/core-uiserver/src/main/org/jboss/portal/uiserver/protocol/PortalObject.java
branches/UIServer/core-uiserver/src/main/org/jboss/portal/uiserver/protocol/Window.java
branches/UIServer/core-uiserver/src/main/org/jboss/portal/uiserver/spi/
branches/UIServer/core-uiserver/src/main/org/jboss/portal/uiserver/spi/PortalObjectReader.java
branches/UIServer/core-uiserver/src/resources/
branches/UIServer/core/src/main/org/jboss/portal/core/spi/
branches/UIServer/core/src/main/org/jboss/portal/core/spi/PortalObjectReaderImpl.java
Removed:
branches/UIServer/core/src/main/org/jboss/portal/core/processor/Processor.java
branches/UIServer/core/src/main/org/jboss/portal/core/processor/ProcessorRequest.java
Modified:
branches/UIServer/build/build.xml
branches/UIServer/core/build.xml
branches/UIServer/core/src/main/org/jboss/portal/core/processor/MainProcessor.java
branches/UIServer/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
branches/UIServer/tools/etc/buildfragments/modules.ent
branches/UIServer/uiserver/build.xml
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/UIServer.java
Log:
Prototype architecture for modeling the HTTP -> UIServer -> Core Portal interaction
- (Refactoring with decoupling the Core Portal Model from UIServer)
Modified: branches/UIServer/build/build.xml
===================================================================
--- branches/UIServer/build/build.xml 2007-09-12 23:39:23 UTC (rev 8255)
+++ branches/UIServer/build/build.xml 2007-09-13 03:55:54 UTC (rev 8256)
@@ -139,13 +139,14 @@
<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, 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, core-uiserver, 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-09-12 23:39:23 UTC (rev 8255)
+++ branches/UIServer/core/build.xml 2007-09-13 03:55:54 UTC (rev 8256)
@@ -133,9 +133,7 @@
<path refid="jboss.portlet-api.classpath"/>
<path refid="jboss.portal-theme.classpath"/>
<path refid="jboss.portal-security.classpath"/>
- <!--
- <path refid="jboss.portal-uiserver.classpath"/>
- -->
+ <path refid="jboss.portal-core-uiserver.classpath"/>
<path refid="jboss.portal-test.classpath"/>
</path>
@@ -363,7 +361,7 @@
</target>
<!-- Build the jboss-portal-ha.sar -->
- <target name="output-ha" depends="artifacts">
+ <target name="output-ha" depends="artifacts,pre-output">
<copy todir="${build.resources}/jboss-portal-ha.sar">
<fileset dir="${build.resources}/jboss-portal"
excludes="**/*.xml"/>
</copy>
@@ -382,14 +380,21 @@
</target>
<!-- Build the jboss-portal.sar -->
- <target name="output" depends="artifacts">
- <copy todir="${build.resources}/jboss-portal/lib">
- <fileset dir="${jboss.portal-uiserver.root}/lib"
includes="portal-uiserver-lib.jar"/>
- </copy>
- <copy todir="${build.resources}/jboss-portal.sar/lib">
- <fileset dir="${jboss.portal-uiserver.root}/lib"
includes="portal-uiserver-lib.jar"/>
- </copy>
-
+ <target name="pre-output">
+ <copy todir="${build.resources}/jboss-portal/lib">
+ <fileset dir="${jboss.portal-uiserver.root}/lib"
includes="portal-uiserver-lib.jar"/>
+ </copy>
+ <copy todir="${build.resources}/jboss-portal.sar/lib">
+ <fileset dir="${jboss.portal-uiserver.root}/lib"
includes="portal-uiserver-lib.jar"/>
+ </copy>
+ <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>
+ <target name="output" depends="artifacts,pre-output">
<!-- Build configurations -->
<copy todir="${build.resources}/jboss-portal.sar">
<fileset dir="${build.resources}/jboss-portal"
excludes="**/*.xml"/>
@@ -509,11 +514,10 @@
<!--
| Deploy the application
- -->
-
+ -->
<target name="deploy"
description="Deploy."
- depends="output">
+ depends="output">
<require file="${jboss.home}/server/${portal.deploy.dir}"/>
<copy file="${build.lib}/jboss-portal.sar"
todir="${jboss.home}/server/${portal.deploy.dir}"
overwrite="true"/>
</target>
Modified:
branches/UIServer/core/src/main/org/jboss/portal/core/processor/MainProcessor.java
===================================================================
---
branches/UIServer/core/src/main/org/jboss/portal/core/processor/MainProcessor.java 2007-09-12
23:39:23 UTC (rev 8255)
+++
branches/UIServer/core/src/main/org/jboss/portal/core/processor/MainProcessor.java 2007-09-13
03:55:54 UTC (rev 8256)
@@ -22,11 +22,16 @@
******************************************************************************/
package org.jboss.portal.core.processor;
+import org.apache.log4j.Logger;
+
import org.jboss.portal.jems.as.system.AbstractJBossService;
import org.jboss.portal.server.RequestControllerDispatcher;
import org.jboss.portal.server.ServerException;
import org.jboss.portal.server.RequestController;
+import org.jboss.portal.uiserver.processor.Processor;
+import org.jboss.portal.uiserver.processor.ProcessorRequest;
+
/**
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
*
@@ -36,6 +41,11 @@
/**
*
*/
+ private static Logger log = Logger.getLogger(MainProcessor.class);
+
+ /**
+ *
+ */
private RequestController temp = null;
@@ -55,9 +65,12 @@
//the appropriate action and then send its Response back to the UIServer which
should process
//the Response and sent a Response back to the client
+ //Just outputting values coming in on ProcessorRequest.....Just for testing
+ log.info("Action="+request.getActionType());
+ log.info("Portal="+request.getPortal());
+ log.info("Target="+request.getTarget());
//For now, just for prototype sake just use the existing Controller to produce
the outcome
- System.out.println(request);
request.getServerInvocation().setHandler(new
RequestControllerDispatcher(this.temp));
request.getServerInvocation().invokeNext();
}
Deleted: branches/UIServer/core/src/main/org/jboss/portal/core/processor/Processor.java
===================================================================
---
branches/UIServer/core/src/main/org/jboss/portal/core/processor/Processor.java 2007-09-12
23:39:23 UTC (rev 8255)
+++
branches/UIServer/core/src/main/org/jboss/portal/core/processor/Processor.java 2007-09-13
03:55:54 UTC (rev 8256)
@@ -1,37 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.core.processor;
-
-import org.jboss.portal.server.ServerException;
-
-/**
- * Processor is the service exposed by the Core Portal to the UIServer. UIServer calls
the Processor to hand it
- * processing of an incoming Portal Request using the protocol between the two
components
- *
- * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
- *
- */
-public interface Processor
-{
- public void process(ProcessorRequest request) throws ServerException;
-}
Deleted:
branches/UIServer/core/src/main/org/jboss/portal/core/processor/ProcessorRequest.java
===================================================================
---
branches/UIServer/core/src/main/org/jboss/portal/core/processor/ProcessorRequest.java 2007-09-12
23:39:23 UTC (rev 8255)
+++
branches/UIServer/core/src/main/org/jboss/portal/core/processor/ProcessorRequest.java 2007-09-13
03:55:54 UTC (rev 8256)
@@ -1,153 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.core.processor;
-
-import java.io.Serializable;
-
-import org.jboss.portal.core.model.portal.Portal;
-import org.jboss.portal.core.model.portal.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/core/src/main/org/jboss/portal/core/spi/PortalObjectReaderImpl.java
===================================================================
--- branches/UIServer/core/src/main/org/jboss/portal/core/spi/PortalObjectReaderImpl.java
(rev 0)
+++
branches/UIServer/core/src/main/org/jboss/portal/core/spi/PortalObjectReaderImpl.java 2007-09-13
03:55:54 UTC (rev 8256)
@@ -0,0 +1,203 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.core.spi;
+
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.ArrayList;
+import java.util.StringTokenizer;
+
+import org.jboss.portal.jems.as.system.AbstractJBossService;
+import org.jboss.portal.core.model.portal.PortalObjectContainer;
+import org.jboss.portal.core.model.portal.PortalContainer;
+
+import org.jboss.portal.uiserver.protocol.Portal;
+import org.jboss.portal.uiserver.protocol.PortalObject;
+import org.jboss.portal.uiserver.protocol.Page;
+import org.jboss.portal.uiserver.protocol.Window;
+import org.jboss.portal.uiserver.spi.PortalObjectReader;
+
+/**
+ * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
+ *
+ */
+public class PortalObjectReaderImpl extends AbstractJBossService implements
PortalObjectReader
+{
+ private PortalObjectContainer portalObjectContainer = null;
+
+ /**
+ *
+ * @return
+ */
+ public PortalObjectContainer getPortalObjectContainer()
+ {
+ return portalObjectContainer;
+ }
+
+ /**
+ *
+ * @param portalObjectContainer
+ */
+ public void setPortalObjectContainer(
+ PortalObjectContainer portalObjectContainer)
+ {
+ this.portalObjectContainer = portalObjectContainer;
+ }
+
+ /**
+ *
+ */
+ public Portal findPortal(String id)
+ {
+ Portal portal = null;
+ PortalContainer portalContainer = this.portalObjectContainer.getContext();
+
+ org.jboss.portal.core.model.portal.Portal cour = portalContainer
+ .getPortal(id);
+ if (cour != null)
+ {
+ portal = new Portal();
+ portal.setId(cour.getId().toString());
+ portal.setName(cour.getName());
+
+ // Setup top level children for this node
+ Collection children = cour.getChildren();
+ Collection portalChildren = new ArrayList();
+ for (Iterator itr = children.iterator(); itr.hasNext();)
+ {
+ org.jboss.portal.core.model.portal.PortalObject child =
(org.jboss.portal.core.model.portal.PortalObject) itr
+ .next();
+
+ PortalObject portalChild = null;
+
+ if (child instanceof org.jboss.portal.core.model.portal.Page)
+ {
+ portalChild = new Page();
+ portalChild.setId(child.getId().toString());
+ portalChild.setName(child.getName());
+ portalChild.setParent(portal);
+ portalChildren.add(portalChild);
+ }
+ else if (child instanceof org.jboss.portal.core.model.portal.Window)
+ {
+ portalChild = new Window();
+ portalChild.setId(child.getId().toString());
+ portalChild.setName(child.getName());
+ portalChild.setParent(portal);
+ portalChildren.add(portalChild);
+ }
+ }
+
+ portal.setChildren(portalChildren);
+ }
+
+ return portal;
+ }
+
+ /**
+ *
+ */
+ public PortalObject findPortalObject(PortalObject parent, String id)
+ {
+ PortalObject portalObject = null;
+ PortalContainer portalContainer = this.portalObjectContainer.getContext();
+
+ //Find the Portal to introspect
+ int startIndex = 1;
+ int endIndex = id.indexOf('/', startIndex);
+ String portalName = id.substring(startIndex, endIndex);
+ org.jboss.portal.core.model.portal.Portal portal =
portalContainer.getPortal(portalName);
+ if(portal == null)
+ {
+ return null;
+ }
+
+ //Find the Portal Object inside this Portal represented by the id
+ org.jboss.portal.core.model.portal.PortalObject cour = null;
+ StringTokenizer st = new StringTokenizer(id, "/");
+ while(st.hasMoreTokens())
+ {
+ String token = st.nextToken();
+
+ if(cour == null)
+ {
+ cour = portal.getChild(token);
+ }
+ else
+ {
+ cour = cour.getChild(token);
+ }
+ }
+
+ //Map the Portal Object to the protocol Portal Object
+ if (cour != null)
+ {
+ if (cour instanceof org.jboss.portal.core.model.portal.Page)
+ {
+ portalObject = new Page();
+ }
+ else if (cour instanceof org.jboss.portal.core.model.portal.Window)
+ {
+ portalObject = new Window();
+ }
+
+ if (portalObject != null)
+ {
+ portalObject.setId(cour.getId().toString());
+ portalObject.setName(cour.getName());
+ portalObject.setParent(parent);
+
+ // Setup top level children for this node
+ Collection children = cour.getChildren();
+ Collection portalChildren = new ArrayList();
+ for (Iterator itr = children.iterator(); itr.hasNext();)
+ {
+ org.jboss.portal.core.model.portal.PortalObject child =
(org.jboss.portal.core.model.portal.PortalObject) itr
+ .next();
+
+ PortalObject portalChild = null;
+
+ if (child instanceof org.jboss.portal.core.model.portal.Page)
+ {
+ portalChild = new Page();
+ portalChild.setId(child.getId().toString());
+ portalChild.setName(child.getName());
+ portalChild.setParent(portalObject);
+ portalChildren.add(portalChild);
+ }
+ else if (child instanceof org.jboss.portal.core.model.portal.Window)
+ {
+ portalChild = new Window();
+ portalChild.setId(child.getId().toString());
+ portalChild.setName(child.getName());
+ portalChild.setParent(portalObject);
+ portalChildren.add(portalChild);
+ }
+ }
+ portalObject.setChildren(portalChildren);
+ }
+ }
+
+ return portalObject;
+ }
+}
Modified: branches/UIServer/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
===================================================================
---
branches/UIServer/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-09-12
23:39:23 UTC (rev 8255)
+++
branches/UIServer/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-09-13
03:55:54 UTC (rev 8256)
@@ -1092,13 +1092,13 @@
proxy-type="attribute">portal:service=ControlPolicy,type=Page</depends>
</mbean>
<mbean
- code="org.jboss.portal.uiserver.service.UIServer"
- name="portal:service=Controller"
+ code="org.jboss.portal.core.processor.MainProcessor"
+ name="portal:service=Processor"
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <depends optional-attribute-name="PortalObjectContainer"
proxy-type="attribute">portal:container=PortalObject</depends>
- <depends optional-attribute-name="Processor"
proxy-type="attribute">portal:service=Processor</depends>
+ <depends optional-attribute-name="Temp"
proxy-type="attribute">portal:service=Temp</depends>
+ <depends>portal:container=PortalObject</depends>
<depends>portal:service=PageService</depends>
<depends>portal:commandFactory=DefaultPortal</depends>
<depends>portal:urlFactory=Delegating</depends>
@@ -1111,12 +1111,12 @@
<depends>portal:service=ControlPolicy,type=Page</depends>
</mbean>
<mbean
- code="org.jboss.portal.core.processor.MainProcessor"
- name="portal:service=Processor"
+ code="org.jboss.portal.core.spi.PortalObjectReaderImpl"
+ name="portal:container=PortalObjectReader"
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <depends optional-attribute-name="Temp"
proxy-type="attribute">portal:service=Temp</depends>
+ <depends optional-attribute-name="PortalObjectContainer"
proxy-type="attribute">portal:container=PortalObject</depends>
<depends>portal:container=PortalObject</depends>
<depends>portal:service=PageService</depends>
<depends>portal:commandFactory=DefaultPortal</depends>
@@ -1129,6 +1129,26 @@
<depends>portal:service=ResponseHandler,type=Selector</depends>
<depends>portal:service=ControlPolicy,type=Page</depends>
</mbean>
+ <mbean
+ code="org.jboss.portal.uiserver.service.UIServer"
+ name="portal:service=Controller"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="PortalObjectReader"
proxy-type="attribute">portal:container=PortalObjectReader</depends>
+ <depends optional-attribute-name="Processor"
proxy-type="attribute">portal:service=Processor</depends>
+ <depends>portal:service=PageService</depends>
+ <depends>portal:commandFactory=DefaultPortal</depends>
+ <depends>portal:urlFactory=Delegating</depends>
+ <depends>portal:service=InterceptorStackFactory,type=Command</depends>
+ <depends>portal:container=Instance</depends>
+ <depends>portal:service=PortalAuthorizationManagerFactory</depends>
+ <depends>portal:service=CustomizationManager</depends>
+ <depends>portal:service=ContentProviderRegistry</depends>
+ <depends>portal:service=ResponseHandler,type=Selector</depends>
+ <depends>portal:service=ControlPolicy,type=Page</depends>
+ </mbean>
+
<!-- The controller factory -->
<mbean
Added: branches/UIServer/core-uiserver/build.bat
===================================================================
--- branches/UIServer/core-uiserver/build.bat (rev 0)
+++ branches/UIServer/core-uiserver/build.bat 2007-09-13 03:55:54 UTC (rev 8256)
@@ -0,0 +1,54 @@
+@echo off
+rem
+rem Invokes a script of the same name in the 'tools' module.
+rem
+rem The 'tools' module is expected to be a peer directory of the directory
+rem in which this script lives.
+rem
+rem @author Jason Dillon <jason(a)planet57.com>
+rem
+
+rem $Id: build.bat 1015 2005-11-04 20:15:13Z mholzner $
+
+setlocal
+
+set PROGNAME=%~nx0
+set DIRNAME=%~dp0
+
+rem Legacy shell support
+if x%PROGNAME%==x set PROGNAME=build.bat
+if x%DIRNAME%==x set DIRNAME=.\
+
+set MODULE_ROOT=%DIRNAME%
+if x%TOOLS_ROOT%==x set TOOLS_ROOT=%DIRNAME%..\tools
+set TARGET=%TOOLS_ROOT%\bin\build.bat
+set ARGS=%*
+
+rem Start'er up yo
+goto main
+
+:debug
+if not x%DEBUG%==x echo %PROGNAME%: %*
+goto :EOF
+
+:main
+call :debug PROGNAME=%PROGNAME%
+call :debug DIRNAME=%DIRNAME%
+call :debug TOOLS_ROOT=%TOOLS_ROOT%
+call :debug TARGET=%TARGET%
+
+if exist %TARGET% call :call-script & goto :EOF
+rem else fail, we can not go on
+
+echo %PROGNAME%: *ERROR* The target executable does not exist:
+echo %PROGNAME%:
+echo %PROGNAME%: %TARGET%
+echo %PROGNAME%:
+echo %PROGNAME%: Please make sure you have checked out the 'tools' module
+echo %PROGNAME%: and make sure it is up to date.
+goto :EOF
+
+:call-script
+call :debug Executing %TARGET% %ARGS%
+call %TARGET% %ARGS%
+goto :EOF
Property changes on: branches/UIServer/core-uiserver/build.bat
___________________________________________________________________
Name: svn:executable
+ *
Added: branches/UIServer/core-uiserver/build.sh
===================================================================
--- branches/UIServer/core-uiserver/build.sh (rev 0)
+++ branches/UIServer/core-uiserver/build.sh 2007-09-13 03:55:54 UTC (rev 8256)
@@ -0,0 +1,49 @@
+#!/bin/sh
+##
+## Invokes a script of the same name in the 'tools' module.
+##
+## The 'tools' module is expected to be a peer directory of the directory
+## in which this script lives.
+##
+## @author Jason Dillon <jason(a)planet57.com>
+##
+
+# $Id: build.sh 1015 2005-11-04 20:15:13Z mholzner $
+
+PROGNAME=`basename $0`
+DIRNAME=`dirname $0`
+
+# Buss it yo
+main() {
+ if [ "x$TOOLS_ROOT" = "x" ]; then
+ TOOLS_ROOT=`cd $DIRNAME/../tools && pwd`
+ fi
+
+ MODULE_ROOT=`cd $DIRNAME; pwd`
+ export TOOLS_ROOT MODULE_ROOT DEBUG TRACE
+
+ # Where is the target script?
+ target="$TOOLS_ROOT/bin/$PROGNAME"
+ if [ ! -f "$target" ]; then
+ echo "${PROGNAME}: *ERROR* The target executable does not exist:"
+ echo "${PROGNAME}:"
+ echo "${PROGNAME}: $target"
+ echo "${PROGNAME}:"
+ echo "${PROGNAME}: Please make sure you have checked out the 'tools'
module"
+ echo "${PROGNAME}: and make sure it is up to date."
+ exit 2
+ fi
+
+ # Get busy yo!
+ if [ "x$DEBUG" != "x" ]; then
+ echo "${PROGNAME}: Executing: /bin/sh $target $@"
+ fi
+ if [ "x$TRACE" = "x" ]; then
+ exec /bin/sh $target "$@"
+ else
+ exec /bin/sh -x $target "$@"
+ fi
+}
+
+# Lets get ready to rumble!
+main "$@"
Property changes on: branches/UIServer/core-uiserver/build.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: branches/UIServer/core-uiserver/build.xml
===================================================================
--- branches/UIServer/core-uiserver/build.xml (rev 0)
+++ branches/UIServer/core-uiserver/build.xml 2007-09-13 03:55:54 UTC (rev 8256)
@@ -0,0 +1,241 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE project [
+ <!ENTITY libraries SYSTEM "../thirdparty/libraries.ent">
+ <!ENTITY buildmagic SYSTEM
"../tools/etc/buildfragments/buildmagic.ent">
+ <!ENTITY tools SYSTEM "../tools/etc/buildfragments/tools.ent">
+ <!ENTITY modules SYSTEM "../tools/etc/buildfragments/modules.ent">
+ <!ENTITY defaults SYSTEM
"../tools/etc/buildfragments/defaults.ent">
+ <!ENTITY targets SYSTEM "../tools/etc/buildfragments/targets.ent">
+ ]>
+
+<!--+======================================================================+-->
+<!--| JBoss Portal (The OpenSource Portal) Build File |-->
+<!--| |-->
+<!--| Distributable under LGPL license. |-->
+<!--| See terms of license at
http://www.gnu.org. |-->
+<!--| |-->
+<!--| This file has been designed to work with the 'tools' module and
|-->
+<!--| Buildmagic extentions. |-->
+<!--+======================================================================+-->
+
+<project default="main" name="JBoss Portal">
+
+ <!--+====================================================================+-->
+ <!--| Setup |-->
+ <!--| |-->
+ <!--| Include the common build elements. |-->
+ <!--| |-->
+ <!--| This defines several different targets, properties and paths. |-->
+ <!--| It also sets up the basic extention tasks amoung other things. |-->
+ <!--+====================================================================+-->
+
+ &buildmagic;
+ &modules;
+ &defaults;
+ &tools;
+ &targets;
+
+ <!-- ================================================================== -->
+ <!-- Initialization -->
+ <!-- ================================================================== -->
+
+ <!--
+ | Initialize the build system. Must depend on '_buildmagic:init'.
+ | Other targets should depend on 'init' or things will mysteriously fail.
+ -->
+
+ <target name="init" unless="init.disable"
depends="_buildmagic:init">
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Configuration |-->
+ <!--| |-->
+ <!--| This target is invoked by the Buildmagic initialization logic |-->
+ <!--| and should contain module specific configuration elements. |-->
+ <!--+====================================================================+-->
+
+ <target name="configure" unless="configure.disable">
+
+ <!-- Configure some properties -->
+ <property name="jboss-junit-configuration" value=""/>
+ <property name="junit.formatter.usefile" value="true"/>
+
+ <!-- Configure thirdparty libraries -->
+ &libraries;
+
+ <path id="library.classpath">
+ <path refid="jbossas/core.libs.classpath"/>
+ <path refid="sun.servlet.classpath"/>
+ <path refid="apache.log4j.classpath"/>
+ <path refid="junit.junit.classpath"/>
+ </path>
+
+ <!-- Configure modules -->
+ <call target="configure-modules"/>
+ <path id="dependentmodule.classpath">
+ <path refid="jboss.portal-server.classpath"/>
+ </path>
+
+ <!--+=======================================+-->
+ <!--| Override any default properties here. |-->
+ <!--+=======================================+-->
+
+ <!-- Configure defaults & build tools -->
+ <call target="configure-defaults"/>
+ <call target="configure-tools"/>
+ <call target="configure-explode"/>
+ <call target="configure-jbossaop"/>
+
+ <!--+=======================================+-->
+ <!--| Define module specific elements here. |-->
+ <!--+=======================================+-->
+ <property name="javadoc.private" value="true"/>
+ <property name="javadoc.protected" value="false"/>
+
+ <path id="hibernate.classpath">
+ <path refid="apache.commons.classpath"/>
+ <path refid="asm.asm.classpath"/>
+ <path refid="cglib.cglib.classpath"/>
+ <path refid="antlr.antlr.classpath"/>
+ <path refid="odmg.odmg.classpath"/>
+ <path refid="ehcache.ehcache.classpath"/>
+ <path refid="hibernate.hibernate.classpath"/>
+ </path>
+
+ <path id="aop.classpath">
+ <pathelement
path="${jbossas/core.libs.lib}/jboss-aspect-library.jar"/>
+ <pathelement path="${jboss.aop.lib}/jboss-aop.jar"/>
+ <path refid="javassist.javassist.classpath"/>
+ <path refid="oswego.concurrent.classpath"/>
+ <path refid="trove.trove.classpath"/>
+ <path refid="qdox.qdox.classpath"/>
+ </path>
+
+ <taskdef name="explode"
+ classname="org.jboss.portal.common.ant.Explode"
+ classpathref="explode.task.classpath"/>
+ <taskdef name="implode"
+ classname="org.jboss.portal.common.ant.Implode"
+ classpathref="explode.task.classpath"/>
+
+ </target>
+
+ <target name="configure-explode">
+ <path id="explode.task.classpath">
+ <pathelement location="${project.tools}/lib/explode.jar"/>
+ <path refid="apache.ant.classpath"/>
+ </path>
+ <taskdef
+ name="explode"
+ classname="org.jboss.portal.common.ant.Explode"
+ classpathref="explode.task.classpath"/>
+ </target>
+
+ <target name="configure-jbossaop">
+ <path id="jbossaop.task.classpath">
+ <path refid="jboss.aop.classpath"/>
+ <path refid="javassist.javassist.classpath"/>
+ <path refid="oswego.concurrent.classpath"/>
+ <path refid="trove.trove.classpath"/>
+ <path refid="qdox.qdox.classpath"/>
+ </path>
+ <taskdef
+ name="aopc"
+ classname="org.jboss.aop.ant.AopC"
+ classpathref="jbossaop.task.classpath"/>
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Compile |-->
+ <!--| |-->
+ <!--| This target should depend on other compile-* targets for each |-->
+ <!--| different type of compile that needs to be performed, short of |-->
+ <!--| documentation compiles. |-->
+ <!--+====================================================================+-->
+
+ <target name="compile"
+ description="Compile all source files."
+ depends="_default:compile-classes,
+ _default:compile-etc,
+ _default:compile-resources">
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Generate Output |-->
+ <!--| |-->
+ <!--| Generates the target output for this module. Target output is |-->
+ <!--| the output which is ment to be released or used by external |-->
+ <!--| modules. |-->
+ <!--+====================================================================+-->
+
+ <target name="artifacts"
+ description="Generate all target output."
+ depends="compile">
+
+ <mkdir dir="${build.lib}"/>
+
+ <!-- portal-core-uiserver-lib.jar -->
+ <jar jarfile="${build.lib}/portal-core-uiserver-lib.jar">
+ <fileset dir="${build.classes}">
+ </fileset>
+ </jar>
+ </target>
+
+ <target name="output" depends="artifacts">
+ </target>
+
+ <!-- ================================================================== -->
+ <!-- Cleaning -->
+ <!-- ================================================================== -->
+
+ <!-- Clean up all build output -->
+ <target name="clean" depends="_default:clean">
+ <!-- Add module specific elements here. -->
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Documents |-->
+ <!--| |-->
+ <!--| Generate all documentation for this module. |-->
+ <!--+====================================================================+-->
+
+ <target name="docs" depends="_default:docs">
+ <!-- Add module specific elements here. -->
+ </target>
+
+ <!-- ================================================================== -->
+ <!-- Misc. -->
+ <!-- ================================================================== -->
+
+ <target name="main" depends="most"/>
+ <target name="all" depends="_default:all"/>
+ <target name="most" depends="_default:most"/>
+ <target name="help" depends="_default:help"/>
+
+ <!-- ================================================================== -->
+ <!-- Deployment -->
+ <!-- ================================================================== -->
+</project>
Property changes on: branches/UIServer/core-uiserver/build.xml
___________________________________________________________________
Name: svn:executable
+ *
Added:
branches/UIServer/core-uiserver/src/main/org/jboss/portal/uiserver/processor/Processor.java
===================================================================
---
branches/UIServer/core-uiserver/src/main/org/jboss/portal/uiserver/processor/Processor.java
(rev 0)
+++
branches/UIServer/core-uiserver/src/main/org/jboss/portal/uiserver/processor/Processor.java 2007-09-13
03:55:54 UTC (rev 8256)
@@ -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 void process(ProcessorRequest request) throws ServerException;
+}
Added:
branches/UIServer/core-uiserver/src/main/org/jboss/portal/uiserver/processor/ProcessorRequest.java
===================================================================
---
branches/UIServer/core-uiserver/src/main/org/jboss/portal/uiserver/processor/ProcessorRequest.java
(rev 0)
+++
branches/UIServer/core-uiserver/src/main/org/jboss/portal/uiserver/processor/ProcessorRequest.java 2007-09-13
03:55:54 UTC (rev 8256)
@@ -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/core-uiserver/src/main/org/jboss/portal/uiserver/protocol/Page.java
===================================================================
--- branches/UIServer/core-uiserver/src/main/org/jboss/portal/uiserver/protocol/Page.java
(rev 0)
+++
branches/UIServer/core-uiserver/src/main/org/jboss/portal/uiserver/protocol/Page.java 2007-09-13
03:55:54 UTC (rev 8256)
@@ -0,0 +1,38 @@
+/******************************************************************************
+ * 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 Page extends PortalObject
+{
+ /**
+ *
+ */
+ public String toString()
+ {
+ return "Page: "+super.toString();
+ }
+}
Added:
branches/UIServer/core-uiserver/src/main/org/jboss/portal/uiserver/protocol/Portal.java
===================================================================
---
branches/UIServer/core-uiserver/src/main/org/jboss/portal/uiserver/protocol/Portal.java
(rev 0)
+++
branches/UIServer/core-uiserver/src/main/org/jboss/portal/uiserver/protocol/Portal.java 2007-09-13
03:55:54 UTC (rev 8256)
@@ -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/core-uiserver/src/main/org/jboss/portal/uiserver/protocol/PortalObject.java
===================================================================
---
branches/UIServer/core-uiserver/src/main/org/jboss/portal/uiserver/protocol/PortalObject.java
(rev 0)
+++
branches/UIServer/core-uiserver/src/main/org/jboss/portal/uiserver/protocol/PortalObject.java 2007-09-13
03:55:54 UTC (rev 8256)
@@ -0,0 +1,190 @@
+/******************************************************************************
+ * 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.Collection;
+import java.util.ArrayList;
+import java.util.Iterator;
+
+/**
+ * @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;
+
+ /**
+ *
+ *
+ */
+ public PortalObject()
+ {
+ this.children = new ArrayList();
+ }
+
+ /**
+ *
+ * @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;
+ }
+
+ /**
+ *
+ */
+ 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/core-uiserver/src/main/org/jboss/portal/uiserver/protocol/Window.java
===================================================================
---
branches/UIServer/core-uiserver/src/main/org/jboss/portal/uiserver/protocol/Window.java
(rev 0)
+++
branches/UIServer/core-uiserver/src/main/org/jboss/portal/uiserver/protocol/Window.java 2007-09-13
03:55:54 UTC (rev 8256)
@@ -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 Window extends PortalObject
+{
+ /**
+ *
+ */
+ public String toString()
+ {
+ return "Window: "+super.toString();
+ }
+}
Added:
branches/UIServer/core-uiserver/src/main/org/jboss/portal/uiserver/spi/PortalObjectReader.java
===================================================================
---
branches/UIServer/core-uiserver/src/main/org/jboss/portal/uiserver/spi/PortalObjectReader.java
(rev 0)
+++
branches/UIServer/core-uiserver/src/main/org/jboss/portal/uiserver/spi/PortalObjectReader.java 2007-09-13
03:55:54 UTC (rev 8256)
@@ -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);
+}
Modified: branches/UIServer/tools/etc/buildfragments/modules.ent
===================================================================
--- branches/UIServer/tools/etc/buildfragments/modules.ent 2007-09-12 23:39:23 UTC (rev
8255)
+++ branches/UIServer/tools/etc/buildfragments/modules.ent 2007-09-13 03:55:54 UTC (rev
8256)
@@ -200,4 +200,11 @@
<path id="jboss.portal-uiserver.classpath">
<pathelement
path="${jboss.portal-uiserver.lib}/portal-uiserver-lib.jar"/>
</path>
+
+ <!-- core-uiserver -->
+ <property name="jboss.portal-core-uiserver.root"
value="${project.root}/core-uiserver/output"/>
+ <property name="jboss.portal-core-uiserver.lib"
value="${jboss.portal-core-uiserver.root}/lib"/>
+ <path id="jboss.portal-core-uiserver.classpath">
+ <pathelement
path="${jboss.portal-core-uiserver.lib}/portal-core-uiserver-lib.jar"/>
+ </path>
</target>
Modified: branches/UIServer/uiserver/build.xml
===================================================================
--- branches/UIServer/uiserver/build.xml 2007-09-12 23:39:23 UTC (rev 8255)
+++ branches/UIServer/uiserver/build.xml 2007-09-13 03:55:54 UTC (rev 8256)
@@ -102,7 +102,7 @@
<path refid="jboss.portal-server.classpath"/>
<path refid="jboss.portal-theme.classpath"/>
<path refid="jboss.portal-web.classpath"/>
- <path refid="jboss.portal-core.classpath"/>
+ <path refid="jboss.portal-core-uiserver.classpath"/>
</path>
<!--+=======================================+-->
Modified:
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/UIServer.java
===================================================================
---
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/UIServer.java 2007-09-12
23:39:23 UTC (rev 8255)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/service/UIServer.java 2007-09-13
03:55:54 UTC (rev 8256)
@@ -29,10 +29,9 @@
import javax.management.MBeanServer;
import javax.management.ObjectName;
-
-
import org.jboss.mx.util.MBeanProxy;
import org.jboss.mx.util.MBeanServerLocator;
+
import org.jboss.portal.uiserver.layout.Container;
import org.jboss.portal.uiserver.layout.Page;
import org.jboss.portal.uiserver.layout.Window;
@@ -42,20 +41,21 @@
import org.jboss.portal.uiserver.layout.classic.FlexibleGridLayoutManager;
import org.jboss.portal.uiserver.layout.classic.RegionLayoutManager;
import org.jboss.portal.uiserver.layout.classic.RegionConstraints;
+
import org.jboss.portal.uiserver.protocol.PageResult;
import org.jboss.portal.uiserver.protocol.WindowResult;
+import org.jboss.portal.uiserver.protocol.PortalObject;
+import org.jboss.portal.uiserver.protocol.Portal;
+import org.jboss.portal.uiserver.processor.Processor;
+import org.jboss.portal.uiserver.processor.ProcessorRequest;
+import org.jboss.portal.uiserver.spi.PortalObjectReader;
+
import org.jboss.portal.jems.as.system.AbstractJBossService;
import org.jboss.portal.server.RequestController;
import org.jboss.portal.server.ServerException;
import org.jboss.portal.server.ServerInvocation;
-import org.jboss.portal.core.model.portal.PortalObjectContainer;
-import org.jboss.portal.core.model.portal.PortalContainer;
-import org.jboss.portal.core.model.portal.Portal;
-import org.jboss.portal.core.model.portal.PortalObject;
-import org.jboss.portal.core.processor.Processor;
-import org.jboss.portal.core.processor.ProcessorRequest;
/**
* The UIServer is responsible for generating the output that is sent back to the client
based on the Portal state of a particular Portal Request
@@ -72,7 +72,7 @@
/**
*
*/
- private PortalObjectContainer portalObjectContainer = null;
+ private PortalObjectReader portalObjectReader = null;
/**
*
@@ -96,34 +96,60 @@
public void handle(ServerInvocation invocation) throws ServerException
{
String portalRequestPath = invocation.getServerContext().getPortalRequestPath();
- PortalContainer container = this.portalObjectContainer.getContext();
-
+
//Process the incoming request and produce a proper ProcessorRequest to be
- //processed by the core Portal component
+ //processed by the core Portal component
Portal portal = null;
PortalObject target = null;
- String actionType = "render";
+ String actionType = "render";
StringTokenizer st = new StringTokenizer(portalRequestPath, "/");
+ StringBuffer buffer = new StringBuffer("/");
while(st.hasMoreTokens())
{
- String token = st.nextToken();
-
+ String token = st.nextToken();
if(portal == null)
{
- portal = container.getPortal(token);
+ portal = this.portalObjectReader.findPortal(token);
+ if(portal != null)
+ {
+ buffer.append(token);
+ if(st.hasMoreTokens())
+ {
+ buffer.append("/");
+ }
+ }
}
else
{
+ buffer.append(token);
+ String id = buffer.toString();
+ if(st.hasMoreTokens())
+ {
+ buffer.append("/");
+ }
+
if(target == null)
{
- target = portal.getChild(token);
+ target = portal.findChild(id);
+ if(target == null)
+ {
+ target = this.portalObjectReader.findPortalObject(portal, id);
+ }
}
else
{
- target = target.getChild(token);
+ PortalObject cour = target.findChild(id);
+ if(cour == null)
+ {
+ target = this.portalObjectReader.findPortalObject(target, id);
+ }
+ else
+ {
+ target = cour;
+ }
}
- }
- }
+ }
+ }
String actionParam =
invocation.getServerContext().getClientRequest().getParameter("action");
if(actionParam != null && actionParam.trim().length()>0 &&
actionParam.equals("1"))
@@ -191,20 +217,20 @@
/**
*
*/
- public PortalObjectContainer getPortalObjectContainer()
+ public PortalObjectReader getPortalObjectReader()
{
- return this.portalObjectContainer;
+ return portalObjectReader;
}
/**
*
- * @param portalObjectContainer
+ * @param portalObjectReader
*/
- public void setPortalObjectContainer(PortalObjectContainer portalObjectContainer)
+ public void setPortalObjectReader(PortalObjectReader portalObjectReader)
{
- this.portalObjectContainer = portalObjectContainer;
- }
-
+ this.portalObjectReader = portalObjectReader;
+ }
+
/**
*
* @return