Author: julien(a)jboss.com
Date: 2008-06-01 19:11:09 -0400 (Sun, 01 Jun 2008)
New Revision: 10892
Removed:
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/PortletPresentationServer.java
Log:
remove obsolete class
Deleted:
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/PortletPresentationServer.java
===================================================================
---
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/PortletPresentationServer.java 2008-06-01
23:08:16 UTC (rev 10891)
+++
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/PortletPresentationServer.java 2008-06-01
23:11:09 UTC (rev 10892)
@@ -1,221 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.presentation.portal.content.portlet;
-
-import org.jboss.portal.presentation.server.PresentationServer;
-import org.jboss.portal.presentation.server.PresentationServerException;
-import org.jboss.portal.presentation.server.PresentationResponse;
-import org.jboss.portal.presentation.server.PresentationRequest;
-import org.jboss.portal.presentation.state.structural.StructuralStateContext;
-import org.jboss.portal.presentation.state.navigational.NavigationalStateContext;
-import org.jboss.portal.presentation.protocol.ProtocolAction;
-import org.jboss.portal.presentation.protocol.ShowUIObjectResponse;
-import org.jboss.portal.presentation.model.content.WindowContent;
-import org.jboss.portal.presentation.model.UINode;
-import org.jboss.portal.presentation.client.PresentationClient;
-import
org.jboss.portal.presentation.portal.content.portlet.protocol.PortletContainerAction;
-import
org.jboss.portal.presentation.portal.content.portlet.controller.PresentationPortletPageNavigationalState;
-import
org.jboss.portal.presentation.portal.content.portlet.controller.PresentationPortletControllerContext;
-import org.jboss.portal.presentation.impl.model.UINodeFactory;
-import org.jboss.portal.portlet.controller.request.ControllerRequest;
-import org.jboss.portal.portlet.controller.request.PortletActionRequest;
-import org.jboss.portal.portlet.controller.request.PortletRenderRequest;
-import org.jboss.portal.portlet.controller.state.PortletWindowNavigationalState;
-import org.jboss.portal.portlet.controller.PortletController;
-import org.jboss.portal.portlet.controller.response.ControllerResponse;
-import org.jboss.portal.portlet.controller.response.PageUpdateResponse;
-import org.jboss.portal.portlet.PortletInvokerException;
-import org.jboss.portal.portlet.PortletInvoker;
-import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
-import org.jboss.portal.portlet.invocation.response.FragmentResponse;
-import org.jboss.portal.common.NotYetImplemented;
-
-/**
- * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
- * @version $Revision: 630 $
- */
-public class PortletPresentationServer implements PresentationServer
-{
-
- /** . */
- private PortletInvoker portletInvoker;
-
- /** . */
- private PresentationServer next;
-
- public PortletPresentationServer(PortletInvoker portletInvoker, PresentationServer
next)
- {
- this.portletInvoker = portletInvoker;
- this.next = next;
- }
-
- public StructuralStateContext getStructuralStateContext()
- {
- return next.getStructuralStateContext();
- }
-
- public WindowContent renderWindow(PresentationClient client, String windowId) throws
PresentationServerException
- {
-/*
- try
- {
- NavigationalStateContext navigationalStateContext =
client.getNavigationalStateContext();
- StructuralStateContext structuralStateContext =
next.getStructuralStateContext();
- UINode windowNode = UINodeFactory.createNode(navigationalStateContext,
structuralStateContext, windowId);
-
- //
- UINode pageNode = windowNode.getParent();
-
- //
- PortletController controller = new PortletController();
-
- //
- PresentationPortletControllerContext portletControllerContext = new
PresentationPortletControllerContext(
- client,
- pageNode,
- portletInvoker);
-
- //
- PresentationPortletPageNavigationalState pageNavigationalState = new
PresentationPortletPageNavigationalState(
- portletControllerContext,
- client.getNavigationalStateContext(),
- PresentationPortletPageNavigationalState.READ_ONLY_MODE);
-
- PortletInvocationResponse response = controller.render(portletControllerContext,
null, pageNavigationalState, windowId);
-
- //
- if (response instanceof FragmentResponse)
- {
- FragmentResponse fragment = (FragmentResponse)response;
- return new WindowContent(0, fragment.getTitle(), fragment.getContent());
- }
- else
- {
- return new WindowContent(0, "Unexpected response for window " +
windowId, "");
- }
- }
- catch (PortletInvokerException e)
- {
-*/
- throw new PresentationServerException();
-/*
- }
-*/
- }
-
- public PresentationResponse process(PresentationClient client, PresentationRequest
request) throws PresentationServerException
- {
-/*
- ProtocolAction action = request.getProtocolAction();
-
- //
- if (action instanceof PortletContainerAction)
- {
- PortletContainerAction pcAction = (PortletContainerAction)action;
-
- NavigationalStateContext navigationalStateContext =
client.getNavigationalStateContext();
- StructuralStateContext structuralStateContext =
next.getStructuralStateContext();
- UINode windowNode = UINodeFactory.createNode(navigationalStateContext,
structuralStateContext, pcAction.getTargetId());
-
- //
- UINode pageNode = windowNode.getParent();
-
- //
- PresentationPortletControllerContext portletControllerContext = new
PresentationPortletControllerContext(
- client,
- pageNode,
- portletInvoker);
-
- PresentationPortletPageNavigationalState pageNavigationalState = new
PresentationPortletPageNavigationalState(
- portletControllerContext,
- client.getNavigationalStateContext(),
- PresentationPortletPageNavigationalState.CLONE_AND_WRITE_MODE);
-
- //
- ControllerRequest controllerRequest;
- switch (pcAction.getPhase())
- {
- case ACTION:
- controllerRequest = new PortletActionRequest(
- pcAction.getTargetId(),
- pcAction.getState(),
- pcAction.getForm(),
-
pageNavigationalState.getPortletWindowNavigationalState(pcAction.getTargetId()),
- pageNavigationalState
- );
- break;
- case RENDER:
- PortletWindowNavigationalState windowNavigationalState = new
PortletWindowNavigationalState(
- pcAction.getState(),
- pcAction.getMode(),
- pcAction.getWindowState()
- );
- controllerRequest = new PortletRenderRequest(
- pcAction.getTargetId(),
- windowNavigationalState,
- null,
- pageNavigationalState
- );
- break;
- default:
- throw new NotYetImplemented();
- }
-
- //
- PortletController controller = new PortletController();
-
- //
- try
- {
- ControllerResponse response = controller.process(portletControllerContext,
controllerRequest);
-
- if (response instanceof PageUpdateResponse)
- {
- PageUpdateResponse pageUpdate = (PageUpdateResponse)response;
-
- //
- NavigationalStateContext nsc = client.getNavigationalStateContext();
-
- //
- PresentationPortletPageNavigationalState blah =
(PresentationPortletPageNavigationalState)pageUpdate.getPageNavigationalState();
-
- //
- blah.flush();
- }
- }
- catch (PortletInvokerException e)
- {
- e.printStackTrace();
- }
-
- //
- return new PresentationResponse(new
ShowUIObjectResponse(pageNode.getObject().getId()));
- }
- else
- {
- return next.process(client, request);
- }
-*/
- return null;
- }
-}