Author: sohil.shah(a)jboss.com
Date: 2007-11-17 08:50:07 -0500 (Sat, 17 Nov 2007)
New Revision: 8986
Modified:
branches/UIServer/core/src/main/org/jboss/portal/core/presentation/server/MainProcessor.java
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/controller/UIController.java
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model/UIContextImpl.java
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model/UIWindowImpl.java
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/UIContext.java
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/UIWindow.java
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/server/ProcessorResponse.java
Log:
integration
Modified:
branches/UIServer/core/src/main/org/jboss/portal/core/presentation/server/MainProcessor.java
===================================================================
---
branches/UIServer/core/src/main/org/jboss/portal/core/presentation/server/MainProcessor.java 2007-11-17
13:43:55 UTC (rev 8985)
+++
branches/UIServer/core/src/main/org/jboss/portal/core/presentation/server/MainProcessor.java 2007-11-17
13:50:07 UTC (rev 8986)
@@ -22,13 +22,17 @@
******************************************************************************/
package org.jboss.portal.core.presentation.server;
+import java.util.List;
+import java.util.Map;
+import java.util.Iterator;
+import java.util.ArrayList;
+
import java.io.InputStream;
import org.apache.log4j.Logger;
import org.jboss.portal.common.util.MarkupInfo;
import org.jboss.portal.jems.as.system.AbstractJBossService;
-import org.jboss.portal.web.ServletContextDispatcher;
import org.jboss.portal.server.RequestControllerDispatcher;
import org.jboss.portal.server.ServerException;
import org.jboss.portal.server.RequestController;
@@ -40,11 +44,17 @@
import org.jboss.portal.presentation.server.Processor;
import org.jboss.portal.presentation.server.ProcessorRequest;
import org.jboss.portal.presentation.server.ProcessorResponse;
+import org.jboss.portal.presentation.action.server.ServerAction;
+import org.jboss.portal.presentation.action.server.ViewUIObjectAction;
import org.jboss.portal.presentation.action.server.ShowUIObjectResponse;
import org.jboss.portal.presentation.action.server.ErrorResponse;
import org.jboss.portal.presentation.action.server.RedirectResponse;
import org.jboss.portal.presentation.action.server.StreamResponse;
+import org.jboss.portal.presentation.model.*;
+import org.jboss.portal.theme.page.WindowContext;
+import org.jboss.portal.theme.page.WindowResult;
+
/**
* @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
*
@@ -86,10 +96,9 @@
{
try
{
- ProcessorResponse response = null;
-
+ ProcessorResponse response = null;
//For now, just for prototype sake just use the existing Controller to produce
the outcome
- requestContext.getInvocation().setHandler(new
RequestControllerDispatcher(this.requestController));
+ /*requestContext.getInvocation().setHandler(new
RequestControllerDispatcher(this.requestController));
requestContext.getInvocation().invokeNext();
//Get access to the core Portal objects to be used after the execution of the
incoming Portal request
@@ -100,12 +109,23 @@
if(task.equals("aggregate"))
{
//Handle page aggregation and sending result back to the client
- MarkupInfo markupInfo =
(MarkupInfo)invocation.getResponse().getContentInfo();
- PageResult pageResult =
(PageResult)invocation.getServerContext().getClientRequest().getAttribute("pageResult");
- String contentType = markupInfo.getContentType() + "; charset=" +
markupInfo.getCharset();
+ MarkupInfo markupMetaData =
(MarkupInfo)invocation.getResponse().getContentInfo();
+ String contentType = markupMetaData.getContentType() + "; charset="
+ markupMetaData.getCharset();
+ String characterSet = markupMetaData.getCharset();
+ PageResult pageResult =
(PageResult)invocation.getServerContext().getClientRequest().getAttribute("pageResult");
+ //Setup the state of the UIObjectTree
+ UIContext uiContext = requestContext.getUIContext();
+ List<UIWindow> uiWindows = this.getUIWindows(uiContext,
pageResult.getWindowContextMap());
+
+ //Setup the ShowUIObjectResponse object to be returned
+ ShowUIObjectResponse showResponse = new ShowUIObjectResponse(
+ ((ViewUIObjectAction)request.getAction()).getTargetId());
+
//Generate the response to be sent back for processing by the Presentation
Framework
- response = new ProcessorResponse(null);
+ response = new ProcessorResponse(showResponse);
+ response.setContentType(contentType);
+ response.setCharacterSet(characterSet);
}
else if(task.equals("stream"))
{
@@ -128,13 +148,19 @@
Integer errorCode =
(Integer)invocation.getServerContext().getClientRequest().getAttribute("errorCode");
ErrorResponse errorResponse = new ErrorResponse(errorCode.intValue());
response = new ProcessorResponse(errorResponse);
- }
-
+ }*/
+ ServerAction serverAction = request.getAction();
+ if(serverAction instanceof ViewUIObjectAction)
+ {
+ ViewUIObjectAction viewAction = (ViewUIObjectAction)serverAction;
+ ShowUIObjectResponse actionResponse = new
ShowUIObjectResponse(viewAction.getTargetId());
+ response = new ProcessorResponse(actionResponse);
+ }
return response;
}
catch(Exception e)
{
throw new ServerException(e);
}
- }
+ }
}
Modified:
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/controller/UIController.java
===================================================================
---
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/controller/UIController.java 2007-11-17
13:43:55 UTC (rev 8985)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/controller/UIController.java 2007-11-17
13:50:07 UTC (rev 8986)
@@ -36,6 +36,7 @@
import org.jboss.portal.presentation.action.server.GetActivation;
import org.jboss.portal.presentation.action.server.PostActivation;
import org.jboss.portal.presentation.action.server.ViewUIObjectAction;
+import org.jboss.portal.presentation.action.server.ShowUIObjectResponse;
import org.jboss.portal.presentation.model.UIPortal;
import org.jboss.portal.presentation.model.UIObject;
import org.jboss.portal.presentation.model.UIPage;
@@ -97,6 +98,7 @@
//Process the response from the Processor
ServerResponse serverResponse = processorResponse.getResponse();
+ this.handle(serverResponse);
}
catch(Exception e)
{
@@ -106,6 +108,23 @@
/**
*
+ * @param serverResponse
+ * @throws ServerException
+ */
+ private void handle(ServerResponse serverResponse) throws ServerException
+ {
+ if(serverResponse instanceof ShowUIObjectResponse)
+ {
+ ShowUIObjectResponse response = (ShowUIObjectResponse)serverResponse;
+
+ //Setup the objects in the UIObjectTree
+
+ //Populate the state of the Windows in the Page that is being displayed
+ }
+ }
+
+ /**
+ *
*
*/
public void start()
@@ -156,10 +175,10 @@
}
UIPortal targetPortal = this.getTargetPortal(requestContext,portalRequestPath);
- UIObject targetPortalObject =
this.getTargetPortalObject(requestContext,portalRequestPath);
+ UIObject targetPortalObject =
this.getTargetPortalObject(requestContext,portalRequestPath);
if(targetPortalObject instanceof UIPage)
- {
+ {
serverAction = new ViewUIObjectAction(targetPortalObject.getId());
}
else if(targetPortalObject instanceof UIWindow)
Modified:
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model/UIContextImpl.java
===================================================================
---
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model/UIContextImpl.java 2007-11-17
13:43:55 UTC (rev 8985)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model/UIContextImpl.java 2007-11-17
13:50:07 UTC (rev 8986)
@@ -24,6 +24,7 @@
import java.util.Map;
import java.util.Iterator;
+import java.util.List;
import org.jboss.portal.presentation.model.UIContext;
import org.jboss.portal.presentation.model.UIObject;
import org.jboss.portal.presentation.model.UIPortal;
@@ -109,7 +110,7 @@
public void setModelLoader(ModelLoader modelLoader)
{
this.modelLoader = modelLoader;
- }
+ }
/**
*
Modified:
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model/UIWindowImpl.java
===================================================================
---
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model/UIWindowImpl.java 2007-11-17
13:43:55 UTC (rev 8985)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/impl/model/UIWindowImpl.java 2007-11-17
13:50:07 UTC (rev 8986)
@@ -46,6 +46,11 @@
/**
*
*/
+ private String markup = null;
+
+ /**
+ *
+ */
public Mode getMode()
{
return this.mode;
@@ -77,6 +82,22 @@
/**
*
+ */
+ public String getMarkup()
+ {
+ return markup;
+ }
+
+ /**
+ *
+ */
+ public void setMarkup(String markup)
+ {
+ this.markup = markup;
+ }
+
+ /**
+ *
* @param <T>
* @param type
* @return
Modified:
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/UIContext.java
===================================================================
---
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/UIContext.java 2007-11-17
13:43:55 UTC (rev 8985)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/UIContext.java 2007-11-17
13:50:07 UTC (rev 8986)
@@ -50,5 +50,5 @@
*
* @return
*/
- public ModelLoader getModelLoader();
+ public ModelLoader getModelLoader();
}
Modified:
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/UIWindow.java
===================================================================
---
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/UIWindow.java 2007-11-17
13:43:55 UTC (rev 8985)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/model/UIWindow.java 2007-11-17
13:50:07 UTC (rev 8986)
@@ -54,4 +54,16 @@
* @param mode
*/
public void setMode(Mode mode);
+
+ /**
+ *
+ * @return
+ */
+ public String getMarkup();
+
+ /**
+ *
+ * @param markup
+ */
+ public void setMarkup(String markup);
}
Modified:
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/server/ProcessorResponse.java
===================================================================
---
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/server/ProcessorResponse.java 2007-11-17
13:43:55 UTC (rev 8985)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/presentation/server/ProcessorResponse.java 2007-11-17
13:50:07 UTC (rev 8986)
@@ -31,8 +31,18 @@
*
*/
public class ProcessorResponse implements Serializable
-{
+{
/**
+ * type of content to be sent back to the client
+ */
+ private String contentType = null;
+
+ /**
+ * character set to be used
+ */
+ private String characterSet = null;
+
+ /**
* The ServerResponse generated by processing the ProcessorRequest by the Processor
*/
private ServerResponse response = null;
@@ -63,5 +73,41 @@
public void setResponse(ServerResponse response)
{
this.response = response;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getCharacterSet()
+ {
+ return characterSet;
+ }
+
+ /**
+ *
+ * @param characterSet
+ */
+ public void setCharacterSet(String characterSet)
+ {
+ this.characterSet = characterSet;
+ }
+
+ /**
+ *
+ * @return
+ */
+ public String getContentType()
+ {
+ return contentType;
+ }
+
+ /**
+ *
+ * @param contentType
+ */
+ public void setContentType(String contentType)
+ {
+ this.contentType = contentType;
}
}
Show replies by date