Author: sohil.shah(a)jboss.com
Date: 2007-08-01 12:33:38 -0400 (Wed, 01 Aug 2007)
New Revision: 7858
Removed:
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ClassicUI.java
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ClientUI.java
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/PartialRefreshUI.java
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/UIServer.java
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/UIServerImpl.java
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/UIServerPageRendition.java
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/UIServerRequest.java
Log:
cleaning up old prototype code...Removing it
Deleted: branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ClassicUI.java
===================================================================
---
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ClassicUI.java 2007-08-01
16:16:54 UTC (rev 7857)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ClassicUI.java 2007-08-01
16:33:38 UTC (rev 7858)
@@ -1,52 +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.uiserver;
-
-import org.jboss.portal.server.ServerInvocation;
-import org.jboss.portal.web.ServletContextDispatcher;
-import org.jboss.portal.common.util.MarkupInfo;
-
-/**
- * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
- *
- */
-public class ClassicUI implements ClientUI
-{
- /**
- *
- * @param request
- */
- public void sendResponse(UIServerRequest request) throws Exception
- {
- ServerInvocation invocation =
(ServerInvocation)request.getAttribute(UIServerRequest.SERVER_INVOCATION);
- UIServerPageRendition rendition =
(UIServerPageRendition)request.getAttribute(UIServerRequest.UI_INDICATOR);
-
- ServletContextDispatcher dispatcher = new
ServletContextDispatcher(invocation.getServerContext().getClientRequest(),
- invocation.getServerContext().getClientResponse(),
- invocation.getRequest().getServer().getServletContainerContext());
-
- MarkupInfo markupInfo = (MarkupInfo)invocation.getResponse().getContentInfo();
-
- rendition.render(markupInfo, dispatcher);
- }
-}
Deleted: branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ClientUI.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ClientUI.java 2007-08-01
16:16:54 UTC (rev 7857)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/ClientUI.java 2007-08-01
16:33:38 UTC (rev 7858)
@@ -1,36 +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.uiserver;
-
-/**
- * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
- *
- */
-public interface ClientUI
-{
- /**
- *
- * @param request
- */
- public void sendResponse(UIServerRequest request) throws Exception;
-}
Deleted:
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/PartialRefreshUI.java
===================================================================
---
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/PartialRefreshUI.java 2007-08-01
16:16:54 UTC (rev 7857)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/PartialRefreshUI.java 2007-08-01
16:33:38 UTC (rev 7858)
@@ -1,55 +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.uiserver;
-
-import javax.servlet.http.HttpServletResponse;
-
-import org.jboss.portal.server.ServerInvocation;
-
-import org.jboss.portal.theme.impl.render.dynamic.JSONMarshaller;
-import org.jboss.portal.theme.impl.render.dynamic.DynaResponse;
-
-/**
- * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
- *
- */
-public class PartialRefreshUI implements ClientUI
-{
- /**
- *
- */
- private static final JSONMarshaller marshaller = new JSONMarshaller();
-
- /**
- *
- */
- public void sendResponse(UIServerRequest request) throws Exception
- {
- ServerInvocation serverInvocation =
(ServerInvocation)request.getAttribute(UIServerRequest.SERVER_INVOCATION);
- HttpServletResponse resp =
serverInvocation.getServerContext().getClientResponse();
- DynaResponse dynaResponse =
(DynaResponse)request.getAttribute(UIServerRequest.UI_INDICATOR);
-
- resp.setContentType("text/html");
- marshaller.write(dynaResponse, resp.getWriter());
- }
-}
Deleted: branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/UIServer.java
===================================================================
--- branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/UIServer.java 2007-08-01
16:16:54 UTC (rev 7857)
+++ branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/UIServer.java 2007-08-01
16:33:38 UTC (rev 7858)
@@ -1,36 +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.uiserver;
-
-/**
- * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
- *
- */
-public interface UIServer
-{
- /**
- *
- * @param uiServerContext
- */
- public void aggregate(UIServerRequest uiServerRequest);
-}
Deleted: branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/UIServerImpl.java
===================================================================
---
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/UIServerImpl.java 2007-08-01
16:16:54 UTC (rev 7857)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/UIServerImpl.java 2007-08-01
16:33:38 UTC (rev 7858)
@@ -1,141 +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.uiserver;
-
-import java.util.Map;
-import java.util.Iterator;
-import java.util.HashMap;
-import java.util.Properties;
-
-import org.w3c.dom.Element;
-import org.apache.log4j.Logger;
-
-import org.jboss.portal.common.xml.XMLTools;
-import org.jboss.portal.jems.as.system.AbstractJBossService;
-
-/**
- * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
- *
- */
-public class UIServerImpl extends AbstractJBossService implements UIServer
-{
- /**
- *
- */
- private static Logger log = Logger.getLogger(UIServerImpl.class);
-
- /**
- * A map of some UIIndicator object provided from the Controller Layer to the
corresponding Client Side
- * UI technology which will be used to handle the UI related tasks
- */
- private Map clientUiConfig = null;
-
-
- /**
- *
- *
- */
- public UIServerImpl()
- {
- this.clientUiConfig = new HashMap();
- }
-
- /**
- *
- */
- protected void startService() throws Exception
- {
- super.startService();
- }
-
- /**
- *
- */
- protected void stopService() throws Exception
- {
- super.stopService();
- this.clientUiConfig = null;
- }
-
-
- /**
- * Used to register the different Client side UI technologies supported by the Portal
- *
- * @param clientUiConfig
- */
- public void setClientUiConfig(Element clientUiConfigElement)
- {
- try
- {
- Properties properties = XMLTools.loadXMLProperties(clientUiConfigElement);
- if(properties != null)
- {
- for(Iterator itr=properties.keySet().iterator();itr.hasNext();)
- {
- String key = (String)itr.next();
- String value = (String)properties.get(key);
-
- this.clientUiConfig.put(key,
-
Thread.currentThread().getContextClassLoader().loadClass(value).newInstance());
- }
- }
- }
- catch(Exception e)
- {
- log.error(this,e);
- try
- {
- this.stopService();
- }
- catch(Exception ex)
- {
- //Dont worry about it...we tried to stop it..
- //Just cleanup now and proceed
- this.clientUiConfig = null;
- }
- throw new RuntimeException(e);
- }
- }
- //--------UIServer
implementation----------------------------------------------------------------------------------------------------
- /**
- *
- */
- public void aggregate(UIServerRequest uiServerRequest)
- {
- try
- {
- Object uiIndicator =
uiServerRequest.getAttribute(UIServerRequest.UI_INDICATOR);
-
- //Lookup the client UI that should be used to handle the aggregation/response
back to the Client
- ClientUI clientUI =
(ClientUI)this.clientUiConfig.get(uiIndicator.getClass().getName());
-
- //Actually send an aggregated response back to the Client
- clientUI.sendResponse(uiServerRequest);
- }
- catch(Exception e)
- {
- log.error(this,e);
- throw new RuntimeException(e);
- }
- }
-}
Deleted:
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/UIServerPageRendition.java
===================================================================
---
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/UIServerPageRendition.java 2007-08-01
16:16:54 UTC (rev 7857)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/UIServerPageRendition.java 2007-08-01
16:33:38 UTC (rev 7858)
@@ -1,104 +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.uiserver;
-
-import org.jboss.portal.theme.PageService;
-import org.jboss.portal.theme.render.RendererContext;
-import org.jboss.portal.theme.render.RenderException;
-import org.jboss.portal.theme.render.ThemeContext;
-import org.jboss.portal.theme.PortalLayout;
-import org.jboss.portal.theme.PortalTheme;
-import org.jboss.portal.theme.page.PageResult;
-import org.jboss.portal.common.util.MarkupInfo;
-import org.jboss.portal.web.ServletContextDispatcher;
-
-import javax.servlet.ServletException;
-import java.io.IOException;
-
-/**
- * Should not be a controller response, but it comes from legacy design.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class UIServerPageRendition
-{
-
- /** . */
- private PortalLayout layout;
-
- /** . */
- private PageResult pageResult;
-
- /** . */
- private PortalTheme theme;
-
- /** . */
- private PageService pageService;
-
- public UIServerPageRendition(
- PortalLayout layout,
- PortalTheme theme,
- PageResult markupResult,
- PageService pageService)
- {
- this.layout = layout;
- this.theme = theme;
- this.pageResult = markupResult;
- this.pageService = pageService;
- }
-
- /** Performs the page rendition. */
- public void render(MarkupInfo markupInfo, ServletContextDispatcher dispatcher) throws
IOException, ServletException
- {
- // Compute correct content type response header
-// String contentType = rendererContext.getContentType() + "; charset=" +
rendererContext.getCharset();
- String contentType = markupInfo.getContentType() + "; charset=" +
markupInfo.getCharset();
-
- // Set charset and content type on the response
- dispatcher.getResponse().setContentType(contentType);
- dispatcher.getResponse().setCharacterEncoding(markupInfo.getCharset());
-
-
- //
- ThemeContext themeContext = new ThemeContext(theme,
pageService.getThemeService());
-
- //
- RendererContext rendererContext = layout.getRenderContext(themeContext, markupInfo,
dispatcher);
-
- //
- try
- {
- rendererContext.render(pageResult);
- }
- catch (RenderException e)
- {
- e.printStackTrace();
- }
- }
-
- public PageResult getPageResult()
- {
- return pageResult;
- }
-}
Deleted:
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/UIServerRequest.java
===================================================================
---
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/UIServerRequest.java 2007-08-01
16:16:54 UTC (rev 7857)
+++
branches/UIServer/uiserver/src/main/org/jboss/portal/uiserver/UIServerRequest.java 2007-08-01
16:33:38 UTC (rev 7858)
@@ -1,94 +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.uiserver;
-
-import java.io.Serializable;
-import java.util.Map;
-import java.util.HashMap;
-
-/**
- * @author <a href="mailto:sshah@redhat.com">Sohil Shah</a>
- *
- */
-public class UIServerRequest implements Serializable
-{
- public static final String UI_INDICATOR = "uiIndicator";
- public static final String SERVER_INVOCATION = "serverInvocation";
-
- /**
- *
- */
- private Map attributes = null;
-
- /**
- *
- *
- */
- public UIServerRequest()
- {
- this.attributes = new HashMap();
- }
-
- /**
- *
- * @param name
- * @param value
- */
- public void setAttribute(String name,Object value)
- {
- if(name == null)
- {
- throw new IllegalArgumentException("Attribute Name cannot be null");
- }
-
- if(value == null)
- {
- this.removeAttribute(name);
- return;
- }
-
- this.attributes.put(name, value);
- }
-
- /**
- *
- * @param name
- * @return
- */
- public Object getAttribute(String name)
- {
- return this.attributes.get(name);
- }
-
- /**
- *
- * @param name
- */
- public void removeAttribute(String name)
- {
- if(this.attributes.containsKey(name))
- {
- this.attributes.remove(name);
- }
- }
-}