JBoss Portal SVN: r10955 - modules/presentation/trunk/portal/src/main/artifacts/presentation-portal-war/WEB-INF.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-06-09 06:23:13 -0400 (Mon, 09 Jun 2008)
New Revision: 10955
Modified:
modules/presentation/trunk/portal/src/main/artifacts/presentation-portal-war/WEB-INF/page-structure.xml
Log:
more portlets on the default page
Modified: modules/presentation/trunk/portal/src/main/artifacts/presentation-portal-war/WEB-INF/page-structure.xml
===================================================================
--- modules/presentation/trunk/portal/src/main/artifacts/presentation-portal-war/WEB-INF/page-structure.xml 2008-06-09 10:15:48 UTC (rev 10954)
+++ modules/presentation/trunk/portal/src/main/artifacts/presentation-portal-war/WEB-INF/page-structure.xml 2008-06-09 10:23:13 UTC (rev 10955)
@@ -19,6 +19,17 @@
<markup>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum, libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante. Aenean molestie ipsum in nisi.</markup>
</window-def>
</simple-layout>
+ <simple-layout orientation="horizontal">
+ <window-def name="windowE">
+ <portlet ref="/portal-server.PublicParameterPortlet1"/>
+ </window-def>
+ <window-def name="windowF">
+ <portlet ref="/portal-server.PublicParameterPortlet2"/>
+ </window-def>
+ <window-def name="windowG">
+ <portlet ref="/portal-server.PublicParameterPortlet3"/>
+ </window-def>
+ </simple-layout>
</simple-layout>
<page-def name="child-page-default-1">
<simple-layout>
17 years, 11 months
JBoss Portal SVN: r10954 - modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-06-09 06:15:48 -0400 (Mon, 09 Jun 2008)
New Revision: 10954
Modified:
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/PresentationServerImpl.java
Log:
fix minor bug
Modified: modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/PresentationServerImpl.java
===================================================================
--- modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/PresentationServerImpl.java 2008-06-09 09:35:52 UTC (rev 10953)
+++ modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/PresentationServerImpl.java 2008-06-09 10:15:48 UTC (rev 10954)
@@ -166,7 +166,7 @@
PageNode page = (PageNode)window.getParent();
//
- response = new ShowUIObjectResponse(page.getId());
+ response = new ShowUIObjectResponse("node." + page.getId());
}
//
17 years, 11 months
JBoss Portal SVN: r10953 - in modules/presentation/trunk: portal/src/main/java/org/jboss/portal/presentation/portal/content and 6 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-06-09 05:35:52 -0400 (Mon, 09 Jun 2008)
New Revision: 10953
Added:
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/Content.java
Removed:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/content/WindowContent.java
Modified:
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/PresentationServerImpl.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/WindowContentContext.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/markup/MarkupContent.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/PortletContent.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/PortletPageContextImpl.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/ModelImporter.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/content/WindowContentContextImpl.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/object/WindowNode.java
Log:
finally introduced the Content interface instead of using WindowNode.Content class which ties the content to the internal implementation
Modified: modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/PresentationServerImpl.java
===================================================================
--- modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/PresentationServerImpl.java 2008-06-09 09:27:51 UTC (rev 10952)
+++ modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/PresentationServerImpl.java 2008-06-09 09:35:52 UTC (rev 10953)
@@ -35,6 +35,7 @@
import org.jboss.portal.presentation.portal.content.ContentHandler;
import org.jboss.portal.presentation.portal.content.PageContentContext;
import org.jboss.portal.presentation.portal.content.WindowContentContext;
+import org.jboss.portal.presentation.portal.content.Content;
import org.jboss.portal.presentation.model.content.ContentFragment;
import org.jboss.portal.presentation.protocol.ErrorResponse;
import org.jboss.portal.presentation.protocol.ProtocolAction;
@@ -92,7 +93,7 @@
WindowNode window = (WindowNode)portalNodeManager.getNode(element.getObjectRef());
- WindowNode.Content content = window.getContent();
+ Content content = window.getContent();
String contentType = content.getType();
@@ -142,7 +143,7 @@
WindowNode window = (WindowNode)targetNode;
//
- WindowNode.Content content = window.getContent();
+ Content content = window.getContent();
//
String contentType = content.getType();
Added: modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/Content.java
===================================================================
--- modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/Content.java (rev 0)
+++ modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/Content.java 2008-06-09 09:35:52 UTC (rev 10953)
@@ -0,0 +1,39 @@
+/******************************************************************************
+ * 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;
+
+/**
+ * Generic content.
+ *
+ * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public interface Content
+{
+ /**
+ * Returns the content type.
+ *
+ * @return the content type
+ */
+ String getType();
+}
Modified: modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/WindowContentContext.java
===================================================================
--- modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/WindowContentContext.java 2008-06-09 09:27:51 UTC (rev 10952)
+++ modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/WindowContentContext.java 2008-06-09 09:35:52 UTC (rev 10953)
@@ -22,8 +22,6 @@
******************************************************************************/
package org.jboss.portal.presentation.portal.content;
-import org.jboss.portal.presentation.portal.model.object.WindowNode;
-
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
* @version $Revision: 630 $
@@ -33,7 +31,7 @@
String getId();
- WindowNode.Content getContent();
+ Content getContent();
PageContentContext getPageContext();
Modified: modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/markup/MarkupContent.java
===================================================================
--- modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/markup/MarkupContent.java 2008-06-09 09:27:51 UTC (rev 10952)
+++ modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/markup/MarkupContent.java 2008-06-09 09:35:52 UTC (rev 10953)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.presentation.portal.content.markup;
-import org.jboss.portal.presentation.portal.model.object.WindowNode;
+import org.jboss.portal.presentation.portal.content.Content;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
* @version $Revision: 630 $
*/
-public class MarkupContent extends WindowNode.Content
+public class MarkupContent implements Content
{
/** . */
Modified: modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/PortletContent.java
===================================================================
--- modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/PortletContent.java 2008-06-09 09:27:51 UTC (rev 10952)
+++ modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/PortletContent.java 2008-06-09 09:35:52 UTC (rev 10953)
@@ -22,13 +22,13 @@
******************************************************************************/
package org.jboss.portal.presentation.portal.content.portlet;
-import org.jboss.portal.presentation.portal.model.object.WindowNode;
+import org.jboss.portal.presentation.portal.content.Content;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
* @version $Revision: 630 $
*/
-public class PortletContent extends WindowNode.Content
+public class PortletContent implements Content
{
/** . */
Modified: modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/PortletPageContextImpl.java
===================================================================
--- modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/PortletPageContextImpl.java 2008-06-09 09:27:51 UTC (rev 10952)
+++ modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/PortletPageContextImpl.java 2008-06-09 09:35:52 UTC (rev 10953)
@@ -22,11 +22,11 @@
******************************************************************************/
package org.jboss.portal.presentation.portal.content.portlet;
-import org.jboss.portal.presentation.portal.model.object.WindowNode;
import org.jboss.portal.presentation.portal.content.portlet.controller.PresentationPageContext;
import org.jboss.portal.presentation.portal.content.portlet.controller.PresentationWindowContext;
import org.jboss.portal.presentation.portal.content.PageContentContext;
import org.jboss.portal.presentation.portal.content.WindowContentContext;
+import org.jboss.portal.presentation.portal.content.Content;
import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.PortletContext;
import org.jboss.portal.portlet.PortletInvokerException;
@@ -59,7 +59,7 @@
//
for (WindowContentContext child : page.getWindowContexts())
{
- WindowNode.Content content = child.getContent();
+ Content content = child.getContent();
//
if (content instanceof PortletContent)
Modified: modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/ModelImporter.java
===================================================================
--- modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/ModelImporter.java 2008-06-09 09:27:51 UTC (rev 10952)
+++ modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/ModelImporter.java 2008-06-09 09:35:52 UTC (rev 10953)
@@ -28,6 +28,7 @@
import static org.jboss.portal.common.xml.XMLTools.*;
import org.jboss.portal.presentation.portal.content.markup.MarkupContent;
import org.jboss.portal.presentation.portal.content.portlet.PortletContent;
+import org.jboss.portal.presentation.portal.content.Content;
import org.jboss.portal.presentation.portal.model.layout.LayoutStructure;
import org.jboss.portal.presentation.portal.model.layout.LayoutElement;
import org.jboss.portal.presentation.portal.model.layout.StructureElement;
@@ -233,7 +234,7 @@
WindowNode windowNode = createStructuralNode(parentNode, WindowNode.class, windowDefElt);
//
- WindowNode.Content content = null;
+ Content content = null;
org.w3c.dom.Element markupElt = getUniqueChild(windowDefElt, "markup", false);
if (markupElt != null)
{
Modified: modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/content/WindowContentContextImpl.java
===================================================================
--- modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/content/WindowContentContextImpl.java 2008-06-09 09:27:51 UTC (rev 10952)
+++ modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/content/WindowContentContextImpl.java 2008-06-09 09:35:52 UTC (rev 10953)
@@ -24,6 +24,7 @@
import org.jboss.portal.presentation.portal.content.WindowContentContext;
import org.jboss.portal.presentation.portal.content.PageContentContext;
+import org.jboss.portal.presentation.portal.content.Content;
import org.jboss.portal.presentation.portal.model.object.WindowNode;
/**
@@ -37,7 +38,7 @@
private final String id;
/** . */
- private final WindowNode.Content content;
+ private final Content content;
/** . */
private final PageContentContextImpl pageContext;
@@ -54,7 +55,7 @@
return id;
}
- public WindowNode.Content getContent()
+ public Content getContent()
{
return content;
}
Modified: modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/object/WindowNode.java
===================================================================
--- modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/object/WindowNode.java 2008-06-09 09:27:51 UTC (rev 10952)
+++ modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/object/WindowNode.java 2008-06-09 09:35:52 UTC (rev 10953)
@@ -24,6 +24,7 @@
import org.jboss.portal.presentation.model.ui.UIObject;
import org.jboss.portal.presentation.model.ui.UIWindow;
+import org.jboss.portal.presentation.portal.content.Content;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
@@ -55,7 +56,7 @@
return content;
}
- public static abstract class Content
+ public static abstract class ContentImpl
{
public abstract String getType();
}
Deleted: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/content/WindowContent.java
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/content/WindowContent.java 2008-06-09 09:27:51 UTC (rev 10952)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/content/WindowContent.java 2008-06-09 09:35:52 UTC (rev 10953)
@@ -1,65 +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.presentation.model.content;
-
-/**
- * The content of a window.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class WindowContent
-{
-
- /** . */
- private final long expirationMillis;
-
- /** . */
- private final String title;
-
- /** . */
- private final String markup;
-
-
- public WindowContent(long expirationMillis, String title, String markup)
- {
- this.expirationMillis = expirationMillis;
- this.title = title;
- this.markup = markup;
- }
-
- public long getExpirationMillis()
- {
- return expirationMillis;
- }
-
- public String getTitle()
- {
- return title;
- }
-
- public String getMarkup()
- {
- return markup;
- }
-}
17 years, 11 months
JBoss Portal SVN: r10952 - in modules/presentation/trunk: ajax/src/test/java/org/jboss/portal/presentation/test/portal and 7 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-06-09 05:27:51 -0400 (Mon, 09 Jun 2008)
New Revision: 10952
Added:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/content/ContentFragment.java
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/AjaxPresentationClient.java
modules/presentation/trunk/ajax/src/test/java/org/jboss/portal/presentation/test/portal/PresentationServerImpl.java
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/ClassicPresentationClient.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/PresentationServerImpl.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/ContentHandler.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/markup/MarkupContent.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/markup/MarkupContentHandler.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/PortletContentHandler.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/server/PresentationServer.java
Log:
rename WindowContent to ContentFragment
Modified: modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/AjaxPresentationClient.java
===================================================================
--- modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/AjaxPresentationClient.java 2008-06-09 09:23:18 UTC (rev 10951)
+++ modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/AjaxPresentationClient.java 2008-06-09 09:27:51 UTC (rev 10952)
@@ -36,7 +36,7 @@
import org.jboss.portal.presentation.model.ui.UIObject;
import org.jboss.portal.presentation.model.ViewPort;
import org.jboss.portal.presentation.model.ViewPortScope;
-import org.jboss.portal.presentation.model.content.WindowContent;
+import org.jboss.portal.presentation.model.content.ContentFragment;
import org.jboss.portal.presentation.model.ui.UIContext;
import org.jboss.portal.presentation.model.ui.UIPage;
import org.jboss.portal.presentation.model.ui.UIWindow;
@@ -249,7 +249,7 @@
if(navState.isStale(object.getId()) || this.req.getAttribute(Constants.forceRender)!=null)
{
- WindowContent content = server.renderWindow(this, object.getId());
+ ContentFragment content = server.renderWindow(this, object.getId());
clientWindow.setContent(content.getMarkup());
}
Modified: modules/presentation/trunk/ajax/src/test/java/org/jboss/portal/presentation/test/portal/PresentationServerImpl.java
===================================================================
--- modules/presentation/trunk/ajax/src/test/java/org/jboss/portal/presentation/test/portal/PresentationServerImpl.java 2008-06-09 09:23:18 UTC (rev 10951)
+++ modules/presentation/trunk/ajax/src/test/java/org/jboss/portal/presentation/test/portal/PresentationServerImpl.java 2008-06-09 09:27:51 UTC (rev 10952)
@@ -30,7 +30,7 @@
import org.jboss.portal.presentation.impl.state.structural.StructuralNode;
import org.jboss.portal.presentation.impl.state.structural.StructuralStateContextImpl;
import org.jboss.portal.presentation.impl.state.structural.WindowNode;
-import org.jboss.portal.presentation.model.content.WindowContent;
+import org.jboss.portal.presentation.model.content.ContentFragment;
import org.jboss.portal.presentation.state.navigational.NavigationalStateContext;
import org.jboss.portal.presentation.protocol.ErrorResponse;
import org.jboss.portal.presentation.protocol.ProtocolAction;
@@ -69,7 +69,7 @@
/**
*
*/
- public WindowContent renderWindow(PresentationClient client, String windowId) throws PresentationServerException
+ public ContentFragment renderWindow(PresentationClient client, String windowId) throws PresentationServerException
{
StructuralNode node = structuralStateContext.getNode(windowId);
@@ -77,7 +77,7 @@
if (node instanceof WindowNode)
{
WindowNode window = (WindowNode)node;
- return new WindowContent(0, "Window " + window.getName(), window.getContent());
+ return new ContentFragment(0, "Window " + window.getName(), window.getContent());
}
else
{
Modified: modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/ClassicPresentationClient.java
===================================================================
--- modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/ClassicPresentationClient.java 2008-06-09 09:23:18 UTC (rev 10951)
+++ modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/ClassicPresentationClient.java 2008-06-09 09:27:51 UTC (rev 10952)
@@ -42,7 +42,7 @@
import org.jboss.portal.presentation.model.layout.Layout;
import org.jboss.portal.presentation.model.layout.SimpleLayout;
import org.jboss.portal.presentation.model.layout.Orientation;
-import org.jboss.portal.presentation.model.content.WindowContent;
+import org.jboss.portal.presentation.model.content.ContentFragment;
import org.jboss.portal.presentation.model.ui.UIContext;
import org.jboss.portal.presentation.model.ui.UIPage;
import org.jboss.portal.presentation.model.ui.UIWindow;
@@ -293,7 +293,7 @@
{
try
{
- WindowContent content = server.renderWindow(this, object.getId());
+ ContentFragment content = server.renderWindow(this, object.getId());
//
writer.print("<li class=\"element\">");
Modified: modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/PresentationServerImpl.java
===================================================================
--- modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/PresentationServerImpl.java 2008-06-09 09:23:18 UTC (rev 10951)
+++ modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/PresentationServerImpl.java 2008-06-09 09:27:51 UTC (rev 10952)
@@ -35,7 +35,7 @@
import org.jboss.portal.presentation.portal.content.ContentHandler;
import org.jboss.portal.presentation.portal.content.PageContentContext;
import org.jboss.portal.presentation.portal.content.WindowContentContext;
-import org.jboss.portal.presentation.model.content.WindowContent;
+import org.jboss.portal.presentation.model.content.ContentFragment;
import org.jboss.portal.presentation.protocol.ErrorResponse;
import org.jboss.portal.presentation.protocol.ProtocolAction;
import org.jboss.portal.presentation.protocol.ShowUIObjectResponse;
@@ -86,7 +86,7 @@
return structuralStateContext;
}
- public WindowContent renderWindow(PresentationClient client, String windowId) throws PresentationServerException
+ public ContentFragment renderWindow(PresentationClient client, String windowId) throws PresentationServerException
{
ObjectElement element = (ObjectElement)structuralAdapter.getNode(windowId);
Modified: modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/ContentHandler.java
===================================================================
--- modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/ContentHandler.java 2008-06-09 09:23:18 UTC (rev 10951)
+++ modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/ContentHandler.java 2008-06-09 09:27:51 UTC (rev 10952)
@@ -22,8 +22,7 @@
******************************************************************************/
package org.jboss.portal.presentation.portal.content;
-import org.jboss.portal.presentation.model.content.WindowContent;
-import org.jboss.portal.presentation.portal.model.object.WindowNode;
+import org.jboss.portal.presentation.model.content.ContentFragment;
import org.jboss.portal.presentation.portal.content.protocol.ContentAction;
import org.jboss.portal.presentation.client.PresentationClient;
import org.jboss.portal.presentation.server.PresentationServerException;
@@ -38,6 +37,6 @@
ProtocolResponse process(WindowContentContext windowContentContext, PresentationClient client, ContentAction action) throws PresentationServerException;
- WindowContent render(WindowContentContext windowContentContext, PresentationClient client) throws PresentationServerException;
+ ContentFragment render(WindowContentContext windowContentContext, PresentationClient client) throws PresentationServerException;
}
Modified: modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/markup/MarkupContent.java
===================================================================
--- modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/markup/MarkupContent.java 2008-06-09 09:23:18 UTC (rev 10951)
+++ modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/markup/MarkupContent.java 2008-06-09 09:27:51 UTC (rev 10952)
@@ -23,10 +23,6 @@
package org.jboss.portal.presentation.portal.content.markup;
import org.jboss.portal.presentation.portal.model.object.WindowNode;
-import org.jboss.portal.presentation.model.content.WindowContent;
-import org.jboss.portal.presentation.client.PresentationClient;
-import org.jboss.portal.presentation.server.PresentationServerException;
-import org.jboss.portal.portlet.PortletInvoker;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
Modified: modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/markup/MarkupContentHandler.java
===================================================================
--- modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/markup/MarkupContentHandler.java 2008-06-09 09:23:18 UTC (rev 10951)
+++ modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/markup/MarkupContentHandler.java 2008-06-09 09:27:51 UTC (rev 10952)
@@ -25,7 +25,7 @@
import org.jboss.portal.presentation.portal.content.ContentHandler;
import org.jboss.portal.presentation.portal.content.WindowContentContext;
import org.jboss.portal.presentation.portal.content.protocol.ContentAction;
-import org.jboss.portal.presentation.model.content.WindowContent;
+import org.jboss.portal.presentation.model.content.ContentFragment;
import org.jboss.portal.presentation.client.PresentationClient;
import org.jboss.portal.presentation.server.PresentationServerException;
import org.jboss.portal.presentation.protocol.ProtocolResponse;
@@ -42,9 +42,9 @@
throw new UnsupportedOperationException();
}
- public WindowContent render(WindowContentContext windowContentContext, PresentationClient client) throws PresentationServerException
+ public ContentFragment render(WindowContentContext windowContentContext, PresentationClient client) throws PresentationServerException
{
String markup = ((MarkupContent)windowContentContext.getContent()).getMarkup();
- return new WindowContent(0, "blah", markup);
+ return new ContentFragment(0, "blah", markup);
}
}
Modified: modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/PortletContentHandler.java
===================================================================
--- modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/PortletContentHandler.java 2008-06-09 09:23:18 UTC (rev 10951)
+++ modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/PortletContentHandler.java 2008-06-09 09:27:51 UTC (rev 10952)
@@ -29,11 +29,10 @@
import org.jboss.portal.presentation.portal.content.portlet.controller.PresentationPortletPageNavigationalState;
import org.jboss.portal.presentation.portal.content.portlet.controller.PresentationPageContext;
import org.jboss.portal.presentation.portal.content.portlet.protocol.PortletContainerAction;
-import org.jboss.portal.presentation.model.content.WindowContent;
+import org.jboss.portal.presentation.model.content.ContentFragment;
import org.jboss.portal.presentation.client.PresentationClient;
import org.jboss.portal.presentation.server.PresentationServerException;
import org.jboss.portal.presentation.protocol.ProtocolResponse;
-import org.jboss.portal.presentation.state.navigational.NavigationalStateContext;
import org.jboss.portal.portlet.controller.PortletController;
import org.jboss.portal.portlet.controller.response.ControllerResponse;
import org.jboss.portal.portlet.controller.response.PageUpdateResponse;
@@ -146,7 +145,7 @@
return null;
}
- public WindowContent render(WindowContentContext windowContentContext, PresentationClient client) throws PresentationServerException
+ public ContentFragment render(WindowContentContext windowContentContext, PresentationClient client) throws PresentationServerException
{
try
{
@@ -171,11 +170,11 @@
if (response instanceof FragmentResponse)
{
FragmentResponse fragment = (FragmentResponse)response;
- return new WindowContent(0, fragment.getTitle(), fragment.getContent());
+ return new ContentFragment(0, fragment.getTitle(), fragment.getContent());
}
else
{
- return new WindowContent(0, "Unexpected response for window " + windowContentContext.getId(), "");
+ return new ContentFragment(0, "Unexpected response for window " + windowContentContext.getId(), "");
}
}
catch (PortletInvokerException e)
Copied: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/content/ContentFragment.java (from rev 10942, modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/content/WindowContent.java)
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/content/ContentFragment.java (rev 0)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/content/ContentFragment.java 2008-06-09 09:27:51 UTC (rev 10952)
@@ -0,0 +1,65 @@
+/******************************************************************************
+ * 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.presentation.model.content;
+
+/**
+ * The content of a window.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ContentFragment
+{
+
+ /** . */
+ private final long expirationMillis;
+
+ /** . */
+ private final String title;
+
+ /** . */
+ private final String markup;
+
+
+ public ContentFragment(long expirationMillis, String title, String markup)
+ {
+ this.expirationMillis = expirationMillis;
+ this.title = title;
+ this.markup = markup;
+ }
+
+ public long getExpirationMillis()
+ {
+ return expirationMillis;
+ }
+
+ public String getTitle()
+ {
+ return title;
+ }
+
+ public String getMarkup()
+ {
+ return markup;
+ }
+}
Modified: modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/server/PresentationServer.java
===================================================================
--- modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/server/PresentationServer.java 2008-06-09 09:23:18 UTC (rev 10951)
+++ modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/server/PresentationServer.java 2008-06-09 09:27:51 UTC (rev 10952)
@@ -23,8 +23,7 @@
package org.jboss.portal.presentation.server;
import org.jboss.portal.presentation.client.PresentationClient;
-import org.jboss.portal.presentation.model.content.WindowContent;
-import org.jboss.portal.presentation.protocol.ProtocolAction;
+import org.jboss.portal.presentation.model.content.ContentFragment;
import org.jboss.portal.presentation.state.structural.StructuralStateContext;
/**
@@ -36,7 +35,7 @@
StructuralStateContext getStructuralStateContext();
- WindowContent renderWindow(PresentationClient client, String windowId) throws PresentationServerException;
+ ContentFragment renderWindow(PresentationClient client, String windowId) throws PresentationServerException;
PresentationResponse process(PresentationClient client, PresentationRequest request) throws PresentationServerException;
17 years, 11 months
JBoss Portal SVN: r10951 - in modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal: content and 7 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-06-09 05:23:18 -0400 (Mon, 09 Jun 2008)
New Revision: 10951
Added:
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/PageContentContext.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/WindowContentContext.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/PortletPageContextImpl.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/PortletWindowContextImpl.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/controller/PresentationPageContext.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/controller/PresentationWindowContext.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/content/
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/content/PageContentContextImpl.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/content/WindowContentContextImpl.java
Removed:
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/PortalNodeAdapter.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/PortalNodeState.java
Modified:
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/PresentationServerImpl.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/ContentHandler.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/markup/MarkupContent.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/markup/MarkupContentHandler.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/PortletContent.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/PortletContentHandler.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/controller/PresentationPortletControllerContext.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/spi/PresentationInstanceContext.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/spi/PresentationWindowContext.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/object/WindowNode.java
Log:
improve and refactor
Modified: modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/PresentationServerImpl.java
===================================================================
--- modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/PresentationServerImpl.java 2008-06-08 17:24:16 UTC (rev 10950)
+++ modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/PresentationServerImpl.java 2008-06-09 09:23:18 UTC (rev 10951)
@@ -28,10 +28,13 @@
import org.jboss.portal.presentation.portal.model.object.PageNode;
import org.jboss.portal.presentation.portal.model.object.PortalNodeManager;
import org.jboss.portal.presentation.portal.model.layout.ObjectElement;
+import org.jboss.portal.presentation.portal.model.content.PageContentContextImpl;
import org.jboss.portal.presentation.impl.state.structural.adapter.StructuralAdapter;
import org.jboss.portal.presentation.portal.content.protocol.ContentAction;
import org.jboss.portal.presentation.portal.content.ContentHandlerRegistry;
import org.jboss.portal.presentation.portal.content.ContentHandler;
+import org.jboss.portal.presentation.portal.content.PageContentContext;
+import org.jboss.portal.presentation.portal.content.WindowContentContext;
import org.jboss.portal.presentation.model.content.WindowContent;
import org.jboss.portal.presentation.protocol.ErrorResponse;
import org.jboss.portal.presentation.protocol.ProtocolAction;
@@ -95,7 +98,11 @@
ContentHandler handler = contentHandlerRegistry.getContentHandler(contentType);
- return handler.render(window, client);
+ PageContentContext pageContext = new PageContentContextImpl((PageNode)window.getParent());
+
+ WindowContentContext windowContext = pageContext.getWindowContext("node." + window.getId());
+
+ return handler.render(windowContext, client);
}
public PresentationResponse process(PresentationClient client, PresentationRequest request) throws PresentationServerException
@@ -144,9 +151,15 @@
ContentHandler handler = contentHandlerRegistry.getContentHandler(contentType);
//
- ProtocolResponse response = handler.process(window, client, contentAction);
+ PageContentContext pageContext = new PageContentContextImpl((PageNode)window.getParent());
//
+ WindowContentContext windowContext = pageContext.getWindowContext("node." + window.getId());
+
+ //
+ ProtocolResponse response = handler.process(windowContext, client, contentAction);
+
+ //
if (response == null)
{
PageNode page = (PageNode)window.getParent();
Modified: modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/ContentHandler.java
===================================================================
--- modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/ContentHandler.java 2008-06-08 17:24:16 UTC (rev 10950)
+++ modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/ContentHandler.java 2008-06-09 09:23:18 UTC (rev 10951)
@@ -36,8 +36,8 @@
public interface ContentHandler
{
- ProtocolResponse process(WindowNode window, PresentationClient client, ContentAction action) throws PresentationServerException;
+ ProtocolResponse process(WindowContentContext windowContentContext, PresentationClient client, ContentAction action) throws PresentationServerException;
- WindowContent render(WindowNode window, PresentationClient client) throws PresentationServerException;
+ WindowContent render(WindowContentContext windowContentContext, PresentationClient client) throws PresentationServerException;
}
Added: modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/PageContentContext.java
===================================================================
--- modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/PageContentContext.java (rev 0)
+++ modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/PageContentContext.java 2008-06-09 09:23:18 UTC (rev 10951)
@@ -0,0 +1,41 @@
+/******************************************************************************
+ * 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;
+
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public interface PageContentContext
+{
+
+ String getId();
+
+ Collection<? extends WindowContentContext> getWindowContexts();
+
+ WindowContentContext getWindowContext(String windowId);
+
+}
+
Added: modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/WindowContentContext.java
===================================================================
--- modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/WindowContentContext.java (rev 0)
+++ modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/WindowContentContext.java 2008-06-09 09:23:18 UTC (rev 10951)
@@ -0,0 +1,40 @@
+/******************************************************************************
+ * 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;
+
+import org.jboss.portal.presentation.portal.model.object.WindowNode;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public interface WindowContentContext
+{
+
+ String getId();
+
+ WindowNode.Content getContent();
+
+ PageContentContext getPageContext();
+
+}
Modified: modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/markup/MarkupContent.java
===================================================================
--- modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/markup/MarkupContent.java 2008-06-08 17:24:16 UTC (rev 10950)
+++ modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/markup/MarkupContent.java 2008-06-09 09:23:18 UTC (rev 10951)
@@ -52,9 +52,4 @@
{
return "markup";
}
-
- public WindowContent render(WindowNode window, PresentationClient client, PortletInvoker portletInvoker) throws PresentationServerException
- {
- return new WindowContent(0, "blah", "markup");
- }
}
Modified: modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/markup/MarkupContentHandler.java
===================================================================
--- modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/markup/MarkupContentHandler.java 2008-06-08 17:24:16 UTC (rev 10950)
+++ modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/markup/MarkupContentHandler.java 2008-06-09 09:23:18 UTC (rev 10951)
@@ -23,8 +23,8 @@
package org.jboss.portal.presentation.portal.content.markup;
import org.jboss.portal.presentation.portal.content.ContentHandler;
+import org.jboss.portal.presentation.portal.content.WindowContentContext;
import org.jboss.portal.presentation.portal.content.protocol.ContentAction;
-import org.jboss.portal.presentation.portal.model.object.WindowNode;
import org.jboss.portal.presentation.model.content.WindowContent;
import org.jboss.portal.presentation.client.PresentationClient;
import org.jboss.portal.presentation.server.PresentationServerException;
@@ -37,14 +37,14 @@
public class MarkupContentHandler implements ContentHandler
{
- public ProtocolResponse process(WindowNode window, PresentationClient client, ContentAction action) throws PresentationServerException
+ public ProtocolResponse process(WindowContentContext windowContentContext, PresentationClient client, ContentAction action) throws PresentationServerException
{
throw new UnsupportedOperationException();
}
- public WindowContent render(WindowNode window, PresentationClient client) throws PresentationServerException
+ public WindowContent render(WindowContentContext windowContentContext, PresentationClient client) throws PresentationServerException
{
- String markup = ((MarkupContent)window.getContent()).getMarkup();
+ String markup = ((MarkupContent)windowContentContext.getContent()).getMarkup();
return new WindowContent(0, "blah", markup);
}
}
Modified: modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/PortletContent.java
===================================================================
--- modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/PortletContent.java 2008-06-08 17:24:16 UTC (rev 10950)
+++ modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/PortletContent.java 2008-06-09 09:23:18 UTC (rev 10951)
@@ -23,17 +23,6 @@
package org.jboss.portal.presentation.portal.content.portlet;
import org.jboss.portal.presentation.portal.model.object.WindowNode;
-import org.jboss.portal.presentation.portal.model.object.PageNode;
-import org.jboss.portal.presentation.portal.content.portlet.controller.PresentationPortletControllerContext;
-import org.jboss.portal.presentation.portal.content.portlet.controller.PresentationPortletPageNavigationalState;
-import org.jboss.portal.presentation.model.content.WindowContent;
-import org.jboss.portal.presentation.client.PresentationClient;
-import org.jboss.portal.presentation.server.PresentationServerException;
-import org.jboss.portal.portlet.controller.PortletController;
-import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
-import org.jboss.portal.portlet.invocation.response.FragmentResponse;
-import org.jboss.portal.portlet.PortletInvokerException;
-import org.jboss.portal.portlet.PortletInvoker;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
@@ -59,44 +48,4 @@
{
return "portlet";
}
-
- public WindowContent render(WindowNode window, PresentationClient client, PortletInvoker portletInvoker) throws PresentationServerException
- {
- try
- {
- PageNode page = (PageNode)window.getParent();
-
- //
- PortletController controller = new PortletController();
-
- //
- PresentationPortletControllerContext portletControllerContext = new PresentationPortletControllerContext(
- client,
- page,
- portletInvoker);
-
- //
- PresentationPortletPageNavigationalState pageNavigationalState = new PresentationPortletPageNavigationalState(
- portletControllerContext,
- client.getNavigationalStateContext(),
- PresentationPortletPageNavigationalState.READ_ONLY_MODE);
-
- PortletInvocationResponse response = controller.render(portletControllerContext, null, pageNavigationalState, window.getId());
-
- //
- 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 " + window.getId(), "");
- }
- }
- catch (PortletInvokerException e)
- {
- throw new PresentationServerException(e);
- }
- }
}
Modified: modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/PortletContentHandler.java
===================================================================
--- modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/PortletContentHandler.java 2008-06-08 17:24:16 UTC (rev 10950)
+++ modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/PortletContentHandler.java 2008-06-09 09:23:18 UTC (rev 10951)
@@ -23,12 +23,12 @@
package org.jboss.portal.presentation.portal.content.portlet;
import org.jboss.portal.presentation.portal.content.ContentHandler;
+import org.jboss.portal.presentation.portal.content.WindowContentContext;
import org.jboss.portal.presentation.portal.content.protocol.ContentAction;
import org.jboss.portal.presentation.portal.content.portlet.controller.PresentationPortletControllerContext;
import org.jboss.portal.presentation.portal.content.portlet.controller.PresentationPortletPageNavigationalState;
+import org.jboss.portal.presentation.portal.content.portlet.controller.PresentationPageContext;
import org.jboss.portal.presentation.portal.content.portlet.protocol.PortletContainerAction;
-import org.jboss.portal.presentation.portal.model.object.WindowNode;
-import org.jboss.portal.presentation.portal.model.object.PageNode;
import org.jboss.portal.presentation.model.content.WindowContent;
import org.jboss.portal.presentation.client.PresentationClient;
import org.jboss.portal.presentation.server.PresentationServerException;
@@ -67,18 +67,21 @@
this.portletInvoker = portletInvoker;
}
- public ProtocolResponse process(WindowNode window, PresentationClient client, ContentAction action) throws PresentationServerException
+ private PresentationPageContext createPortletPageContext(WindowContentContext windowContentContext)
{
+ return new PortletPageContextImpl(portletInvoker, windowContentContext.getPageContext());
+ }
+
+ public ProtocolResponse process(WindowContentContext windowContentContext, PresentationClient client, ContentAction action) throws PresentationServerException
+ {
PortletContainerAction pcAction = (PortletContainerAction)action;
//
- PageNode page = (PageNode)window.getParent();
+ PresentationPageContext portletPageContext = createPortletPageContext(windowContentContext);
//
PresentationPortletControllerContext portletControllerContext = new PresentationPortletControllerContext(
- client,
- page,
- portletInvoker);
+ client, portletPageContext);
PresentationPortletPageNavigationalState pageNavigationalState = new PresentationPortletPageNavigationalState(
portletControllerContext,
@@ -128,9 +131,6 @@
PageUpdateResponse pageUpdate = (PageUpdateResponse)response;
//
- NavigationalStateContext nsc = client.getNavigationalStateContext();
-
- //
PresentationPortletPageNavigationalState blah = (PresentationPortletPageNavigationalState)pageUpdate.getPageNavigationalState();
//
@@ -146,20 +146,18 @@
return null;
}
- public WindowContent render(WindowNode window, PresentationClient client) throws PresentationServerException
+ public WindowContent render(WindowContentContext windowContentContext, PresentationClient client) throws PresentationServerException
{
try
{
- PageNode page = (PageNode)window.getParent();
+ PresentationPageContext portletPageContext = createPortletPageContext(windowContentContext);
//
PortletController controller = new PortletController();
//
PresentationPortletControllerContext portletControllerContext = new PresentationPortletControllerContext(
- client,
- page,
- portletInvoker);
+ client, portletPageContext);
//
PresentationPortletPageNavigationalState pageNavigationalState = new PresentationPortletPageNavigationalState(
@@ -167,7 +165,7 @@
client.getNavigationalStateContext(),
PresentationPortletPageNavigationalState.READ_ONLY_MODE);
- PortletInvocationResponse response = controller.render(portletControllerContext, null, pageNavigationalState, window.getId());
+ PortletInvocationResponse response = controller.render(portletControllerContext, null, pageNavigationalState, windowContentContext.getId());
//
if (response instanceof FragmentResponse)
@@ -177,7 +175,7 @@
}
else
{
- return new WindowContent(0, "Unexpected response for window " + window.getId(), "");
+ return new WindowContent(0, "Unexpected response for window " + windowContentContext.getId(), "");
}
}
catch (PortletInvokerException e)
Added: modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/PortletPageContextImpl.java
===================================================================
--- modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/PortletPageContextImpl.java (rev 0)
+++ modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/PortletPageContextImpl.java 2008-06-09 09:23:18 UTC (rev 10951)
@@ -0,0 +1,107 @@
+/******************************************************************************
+ * 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.portal.model.object.WindowNode;
+import org.jboss.portal.presentation.portal.content.portlet.controller.PresentationPageContext;
+import org.jboss.portal.presentation.portal.content.portlet.controller.PresentationWindowContext;
+import org.jboss.portal.presentation.portal.content.PageContentContext;
+import org.jboss.portal.presentation.portal.content.WindowContentContext;
+import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.PortletContext;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.PortletInvoker;
+
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PortletPageContextImpl implements PresentationPageContext
+{
+
+ /** . */
+ private final PageContentContext page;
+
+ /** A map of window ids to window contexts. */
+ private final Map<String, PortletWindowContextImpl> windows;
+
+ /** . */
+ final PortletInvoker portletInvoker;
+
+ public PortletPageContextImpl(PortletInvoker portletInvoker, PageContentContext page)
+ {
+ Map<String, PortletWindowContextImpl> windows = new HashMap<String, PortletWindowContextImpl>();
+
+ //
+ for (WindowContentContext child : page.getWindowContexts())
+ {
+ WindowNode.Content content = child.getContent();
+
+ //
+ if (content instanceof PortletContent)
+ {
+ PortletContent portletContent = (PortletContent)content;
+
+ //
+ try
+ {
+ Portlet portlet = portletInvoker.getPortlet(PortletContext.createPortletContext(portletContent.getRef()));
+
+ //
+ String windowId = child.getId();
+
+ //
+ windows.put(windowId, new PortletWindowContextImpl(windowId, portlet, this));
+ }
+ catch (PortletInvokerException e)
+ {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ //
+ this.page = page;
+ this.windows = windows;
+ this.portletInvoker = portletInvoker;
+ }
+
+ public String getId()
+ {
+ return page.getId();
+ }
+
+ public Set<String> getWindowIds()
+ {
+ return windows.keySet();
+ }
+
+ public PresentationWindowContext getWindowContext(String windowId)
+ {
+ return windows.get(windowId);
+ }
+}
Added: modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/PortletWindowContextImpl.java
===================================================================
--- modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/PortletWindowContextImpl.java (rev 0)
+++ modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/PortletWindowContextImpl.java 2008-06-09 09:23:18 UTC (rev 10951)
@@ -0,0 +1,77 @@
+/******************************************************************************
+ * 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.portlet.Portlet;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.presentation.portal.content.portlet.controller.PresentationWindowContext;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PortletWindowContextImpl implements PresentationWindowContext
+{
+
+ /** . */
+ private final String id;
+
+ /** . */
+ private final Portlet portlet;
+
+ /** . */
+ private final PortletPageContextImpl pageContext;
+
+ public PortletWindowContextImpl(String id, Portlet portlet, PortletPageContextImpl pageContext)
+ {
+ this.id = id;
+ this.portlet = portlet;
+ this.pageContext = pageContext;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public Portlet getPortlet()
+ {
+ return portlet;
+ }
+
+ public PortletInfo getPortletInfo()
+ {
+ return portlet.getInfo();
+ }
+
+ public PortletInvocationResponse invoke(PortletInvocation portletInvocation) throws PortletInvokerException
+ {
+ portletInvocation.setTarget(portlet.getContext());
+
+ //
+ return pageContext.portletInvoker.invoke(portletInvocation);
+ }
+}
Added: modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/controller/PresentationPageContext.java
===================================================================
--- modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/controller/PresentationPageContext.java (rev 0)
+++ modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/controller/PresentationPageContext.java 2008-06-09 09:23:18 UTC (rev 10951)
@@ -0,0 +1,38 @@
+/******************************************************************************
+ * 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.controller;
+
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public interface PresentationPageContext
+{
+ String getId();
+
+ Set<String> getWindowIds();
+
+ PresentationWindowContext getWindowContext(String windowId);
+}
Modified: modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/controller/PresentationPortletControllerContext.java
===================================================================
--- modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/controller/PresentationPortletControllerContext.java 2008-06-08 17:24:16 UTC (rev 10950)
+++ modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/controller/PresentationPortletControllerContext.java 2008-06-09 09:23:18 UTC (rev 10951)
@@ -22,10 +22,7 @@
******************************************************************************/
package org.jboss.portal.presentation.portal.content.portlet.controller;
-import org.jboss.portal.portlet.PortletInvoker;
import org.jboss.portal.portlet.PortletInvokerException;
-import org.jboss.portal.portlet.PortletContext;
-import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.NoSuchPortletException;
import org.jboss.portal.portlet.impl.spi.AbstractUserContext;
import org.jboss.portal.portlet.controller.PortletControllerContext;
@@ -47,16 +44,10 @@
import org.jboss.portal.presentation.portal.content.portlet.spi.PresentationClientContext;
import org.jboss.portal.presentation.portal.content.portlet.spi.PresentationPortalContext;
import org.jboss.portal.presentation.portal.content.portlet.spi.PresentationSecurityContext;
-import org.jboss.portal.presentation.portal.content.portlet.PortletContent;
-import org.jboss.portal.presentation.portal.model.object.PageNode;
-import org.jboss.portal.presentation.portal.model.object.PortalNode;
-import org.jboss.portal.presentation.portal.model.object.WindowNode;
import org.jboss.portal.presentation.client.PresentationClient;
import javax.servlet.http.Cookie;
import java.util.List;
-import java.util.Map;
-import java.util.HashMap;
import java.util.Set;
/**
@@ -67,86 +58,40 @@
{
/** . */
- private final PageNode page;
+ private final PresentationPageContext pageContext;
/** . */
- private final PortletInvoker invoker;
-
- /** . */
private final StateControllerContext stateControllerContext;
- /** A map of window ids to portlets. */
- private final Map<String, Portlet> portlets;
-
- /** A map of window ids to windows. */
- private final Map<String, WindowNode> windows;
-
/** . */
private final PresentationClient client;
/** . */
private final EventControllerContext eventControllerContext;
- public PresentationPortletControllerContext(
- PresentationClient client,
- PageNode page,
- PortletInvoker invoker)
+ public PresentationPortletControllerContext(PresentationClient client, PresentationPageContext pageContext)
{
- Map<String, Portlet> portlets = new HashMap<String, Portlet>();
- Map<String, WindowNode> windows = new HashMap<String, WindowNode>();
//
- for (PortalNode child : page.getChildren())
- {
- if (child instanceof WindowNode)
- {
- WindowNode.Content content = ((WindowNode)child).getContent();
-
- //
- if (content instanceof PortletContent)
- {
- PortletContent portletContent = (PortletContent)content;
-
- //
- try
- {
- Portlet portlet = invoker.getPortlet(PortletContext.createPortletContext(portletContent.getRef()));
-
- //
- portlets.put(child.getId(), portlet);
- windows.put(child.getId(), (WindowNode)child);
- }
- catch (PortletInvokerException e)
- {
- e.printStackTrace();
- }
- }
- }
- }
-
- //
this.client = client;
- this.page = page;
- this.invoker = invoker;
+ this.pageContext = pageContext;
this.stateControllerContext = new PresentationStateControllerContext(this);
- this.portlets = portlets;
- this.windows = windows;
this.eventControllerContext = new PresentationEventControllerContext(this);
}
public String getPageId()
{
- return page.getId();
+ return pageContext.getId();
}
public Set<String> getWindowIds()
{
- return windows.keySet();
+ return pageContext.getWindowIds();
}
public PortletInfo getPortletInfo(String windowId)
{
- return portlets.get(windowId).getInfo();
+ return pageContext.getWindowContext(windowId).getPortletInfo();
}
public PortletInvocationContext createPortletInvocationContext(String windowId, PortletPageNavigationalState pageNavigationalState)
@@ -179,9 +124,15 @@
PresentationPortletInvocationContext ctx = (PresentationPortletInvocationContext)portletInvocation.getContext();
//
- WindowNode window = windows.get(ctx.getWindowId());
+ org.jboss.portal.presentation.portal.content.portlet.controller.PresentationWindowContext window = pageContext.getWindowContext(ctx.getWindowId());
//
+ if (window == null)
+ {
+ throw new NoSuchPortletException(ctx.getWindowId());
+ }
+
+ //
portletInvocation.setServerContext(new PresentationServerContext(client));
portletInvocation.setSecurityContext(new PresentationSecurityContext());
portletInvocation.setClientContext(new PresentationClientContext());
@@ -191,17 +142,7 @@
portletInvocation.setWindowContext(new PresentationWindowContext(window));
//
- Portlet portlet = portlets.get(ctx.getWindowId());
- if (portlet == null)
- {
- throw new NoSuchPortletException(ctx.getWindowId());
- }
-
- //
- portletInvocation.setTarget(portlet.getContext());
-
- //
- return invoker.invoke(portletInvocation);
+ return window.invoke(portletInvocation);
}
public EventControllerContext getEventControllerContext()
Added: modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/controller/PresentationWindowContext.java
===================================================================
--- modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/controller/PresentationWindowContext.java (rev 0)
+++ modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/controller/PresentationWindowContext.java 2008-06-09 09:23:18 UTC (rev 10951)
@@ -0,0 +1,41 @@
+/******************************************************************************
+ * 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.controller;
+
+import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.PortletInvokerException;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public interface PresentationWindowContext
+{
+ String getId();
+
+ PortletInfo getPortletInfo();
+
+ PortletInvocationResponse invoke(PortletInvocation portletInvocation) throws PortletInvokerException;
+}
Modified: modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/spi/PresentationInstanceContext.java
===================================================================
--- modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/spi/PresentationInstanceContext.java 2008-06-08 17:24:16 UTC (rev 10950)
+++ modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/spi/PresentationInstanceContext.java 2008-06-09 09:23:18 UTC (rev 10951)
@@ -25,7 +25,7 @@
import org.jboss.portal.portlet.StateEvent;
import org.jboss.portal.portlet.spi.InstanceContext;
import org.jboss.portal.portlet.state.AccessMode;
-import org.jboss.portal.presentation.portal.model.object.WindowNode;
+import org.jboss.portal.presentation.portal.content.portlet.controller.PresentationWindowContext;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
@@ -35,9 +35,9 @@
{
/** . */
- private final WindowNode window;
+ private final org.jboss.portal.presentation.portal.content.portlet.controller.PresentationWindowContext window;
- public PresentationInstanceContext(WindowNode window)
+ public PresentationInstanceContext(PresentationWindowContext window)
{
this.window = window;
}
Modified: modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/spi/PresentationWindowContext.java
===================================================================
--- modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/spi/PresentationWindowContext.java 2008-06-08 17:24:16 UTC (rev 10950)
+++ modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/content/portlet/spi/PresentationWindowContext.java 2008-06-09 09:23:18 UTC (rev 10951)
@@ -23,7 +23,6 @@
package org.jboss.portal.presentation.portal.content.portlet.spi;
import org.jboss.portal.portlet.spi.WindowContext;
-import org.jboss.portal.presentation.portal.model.object.WindowNode;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
@@ -33,9 +32,9 @@
{
/** . */
- private final WindowNode window;
+ private final org.jboss.portal.presentation.portal.content.portlet.controller.PresentationWindowContext window;
- public PresentationWindowContext(WindowNode window)
+ public PresentationWindowContext(org.jboss.portal.presentation.portal.content.portlet.controller.PresentationWindowContext window)
{
this.window = window;
}
Deleted: modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/PortalNodeAdapter.java
===================================================================
--- modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/PortalNodeAdapter.java 2008-06-08 17:24:16 UTC (rev 10950)
+++ modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/PortalNodeAdapter.java 2008-06-09 09:23:18 UTC (rev 10951)
@@ -1,288 +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.model;
-
-import org.jboss.portal.presentation.impl.state.structural.adapter.StructuralAdapter;
-import org.jboss.portal.presentation.portal.model.layout.LayoutStructure;
-import org.jboss.portal.presentation.portal.model.layout.LayoutElement;
-import org.jboss.portal.presentation.portal.model.layout.StructureElement;
-import org.jboss.portal.presentation.portal.model.layout.NestedStructure;
-import org.jboss.portal.presentation.portal.model.layout.ObjectStructure;
-import org.jboss.portal.presentation.portal.model.layout.LayoutStore;
-import org.jboss.portal.presentation.portal.model.layout.LayoutObject;
-import org.jboss.portal.presentation.portal.model.layout.ObjectElement;
-import org.jboss.portal.presentation.portal.model.object.PortalNodeManager;
-import org.jboss.portal.presentation.portal.model.object.PortalNode;
-import org.jboss.portal.presentation.portal.model.object.PageNode;
-import org.jboss.portal.presentation.portal.model.object.WindowNode;
-import org.jboss.portal.presentation.model.ui.UIObject;
-import org.jboss.portal.presentation.model.ui.UIPane;
-import org.jboss.portal.presentation.model.ui.UIWindow;
-import org.jboss.portal.presentation.state.structural.StructuralState;
-import org.jboss.portal.common.NotYetImplemented;
-
-import java.util.Collection;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.Collections;
-import java.io.Serializable;
-
-/**
- * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class PortalNodeAdapter implements StructuralAdapter<Object>
-{
-
- /** . */
- private PortalNodeManager nodeManager;
-
- /** . */
- private LayoutStore layoutStore;
-
- public PortalNodeAdapter(PortalNodeManager nodeManager, LayoutStore layoutStore)
- {
- this.nodeManager = nodeManager;
- this.layoutStore = layoutStore;
- }
-
- public String getRootId()
- {
- return "node." + nodeManager.getRoot().getId();
- }
-
- public Object getNode(String id)
- {
- if (id.startsWith("node."))
- {
- return nodeManager.getNode(id.substring(5));
- }
- else if (id.startsWith("structure."))
- {
- return layoutStore.getObject(id.substring(10));
- }
- else
- {
- throw new IllegalArgumentException("Unrecognized id " + id);
- }
- }
-
- public Object getParent(Object o)
- {
- if (o instanceof PortalNode)
- {
- return ((PortalNode)o).getParent();
- }
- else if (o instanceof LayoutElement)
- {
- LayoutStructure layout = ((LayoutElement)o).getStructure();
-
- //
- if (layout instanceof NestedStructure)
- {
- return ((NestedStructure)layout).getStructureElement();
- }
- else
- {
- ObjectStructure objectStructure = (ObjectStructure)layout;
- String objectId = objectStructure.getObjectRef();
- return nodeManager.getNode(objectId);
- }
- }
- else
- {
- throw new NotYetImplemented();
- }
- }
-
- public Collection<?> getChilren(Object o)
- {
- if (o instanceof PortalNode)
- {
- if (o instanceof PageNode)
- {
- String layoutStructureId = ((PageNode)o).getLayoutStructureId();
-
- //
- LayoutStructure layoutStructure = (LayoutStructure)layoutStore.getObject(layoutStructureId);
-
- //
- return layoutStructure.getElements();
- }
- else
- {
- return ((PortalNode)o).getChildren();
- }
- }
- else if (o instanceof LayoutElement)
- {
- if (o instanceof StructureElement)
- {
- return ((StructureElement)o).getNestedStructure().getElements();
- }
- else
- {
- return Collections.emptyList();
- }
- }
- else
- {
- throw new NotYetImplemented();
- }
- }
-
- public String getId(Object o)
- {
- if (o instanceof PortalNode)
- {
- return "node." + ((PortalNode)o).getId();
- }
- else if (o instanceof LayoutObject)
- {
- return "structure." + ((LayoutObject)o).getId();
- }
- else
- {
- throw new NotYetImplemented();
- }
- }
-
- public Class<? extends UIObject> getType(Object o)
- {
- if (o instanceof PortalNode)
- {
- return ((PortalNode)o).getType();
- }
- else if (o instanceof LayoutElement)
- {
- if (o instanceof StructureElement)
- {
- return UIPane.class;
- }
- else if (o instanceof ObjectElement)
- {
- return UIWindow.class;
- }
- else
- {
- throw new NotYetImplemented();
- }
- }
- else
- {
- throw new NotYetImplemented();
- }
- }
-
- public String getName(Object o)
- {
- if (o instanceof PortalNode)
- {
- return ((PortalNode)o).getName();
- }
- else if (o instanceof LayoutObject)
- {
- // no natural name, for now use id
- return ((LayoutObject)o).getId();
- }
- else
- {
- throw new NotYetImplemented();
- }
- }
-
- public Map<String, Serializable> getProperties(Object o)
- {
- if (o instanceof PageNode)
- {
- PageNode page = (PageNode)o;
-
- //
- String layoutStructureId = ((PageNode)o).getLayoutStructureId();
-
- //
- LayoutStructure layoutStructure = (LayoutStructure)layoutStore.getObject(layoutStructureId);
-
- //
- Map<String, Serializable> properties = new HashMap<String, Serializable>(page.getProperties());
-
- //
- properties.putAll(layoutStructure.getState().getProperties());
-
- //
- return properties;
- }
- else if (o instanceof PortalNode)
- {
- return ((PortalNode)o).getProperties();
- }
- else if (o instanceof LayoutObject)
- {
- if (o instanceof ObjectElement)
- {
- ObjectElement element = (ObjectElement)o;
-
- //
- String windowId = element.getObjectRef();
-
- //
- WindowNode window = (WindowNode)nodeManager.getNode(windowId);
-
- //
- Map<String, Serializable> properties = new HashMap<String, Serializable>(window.getProperties());
-
- //
- properties.putAll(element.getState().getProperties());
-
- //
- return properties;
- }
- else
- {
- return ((LayoutObject)o).getState().getProperties();
- }
- }
- else
- {
- throw new NotYetImplemented();
- }
- }
-
- public StructuralState getState(Object o)
- {
- Class<? extends UIObject> type = getType(o);
- String name = getName(o);
- Map<String, Serializable> properties = getProperties(o);
-
- //
- return new PortalNodeState(type, name, properties);
- }
-
- public void lock(Object o)
- {
- }
-
- public void unlock(Object o)
- {
- }
-}
Deleted: modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/PortalNodeState.java
===================================================================
--- modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/PortalNodeState.java 2008-06-08 17:24:16 UTC (rev 10950)
+++ modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/PortalNodeState.java 2008-06-09 09:23:18 UTC (rev 10951)
@@ -1,99 +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.model;
-
-import org.jboss.portal.presentation.model.ui.UIObject;
-import org.jboss.portal.presentation.state.structural.StructuralState;
-
-import java.util.Map;
-import java.io.Serializable;
-
-/**
- * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-class PortalNodeState implements StructuralState
-{
-
- /** . */
- private final Class<? extends UIObject> type;
-
- /** . */
- private final String name;
-
- /** . */
- private final Map<String, Serializable> properties;
-
- public PortalNodeState(
- Class<? extends UIObject> type,
- String name,
- Map<String, Serializable> properties)
- {
- this.type = type;
- this.name = name;
- this.properties = properties;
- }
-
- public Class<? extends UIObject> getType()
- {
- return type;
- }
-
- public String getName()
- {
- return name;
- }
-
- public Map<String, Serializable> getProperties()
- {
- return properties;
- }
-
- public boolean equals(Object obj)
- {
- if (obj == this)
- {
- return true;
- }
- if (obj instanceof PortalNodeState)
- {
- PortalNodeState that = (PortalNodeState)obj;
-
- //
- if (!that.type.equals(this.type))
- {
- return false;
- }
-
- //
- if (!that.name.equals(this.name))
- {
- return false;
- }
-
- //
- return that.properties.equals(this.properties);
- }
- return false;
- }
-}
Added: modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/content/PageContentContextImpl.java
===================================================================
--- modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/content/PageContentContextImpl.java (rev 0)
+++ modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/content/PageContentContextImpl.java 2008-06-09 09:23:18 UTC (rev 10951)
@@ -0,0 +1,82 @@
+/******************************************************************************
+ * 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.model.content;
+
+import org.jboss.portal.presentation.portal.content.PageContentContext;
+import org.jboss.portal.presentation.portal.content.WindowContentContext;
+import org.jboss.portal.presentation.portal.model.object.PageNode;
+import org.jboss.portal.presentation.portal.model.object.PortalNode;
+import org.jboss.portal.presentation.portal.model.object.WindowNode;
+
+import java.util.Collection;
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PageContentContextImpl implements PageContentContext
+{
+
+ /** . */
+ private final String id;
+
+ /** . */
+ private final Map<String, WindowContentContextImpl> windowContexts;
+
+ public PageContentContextImpl(PageNode page)
+ {
+ Map<String, WindowContentContextImpl> windowContexts = new HashMap<String, WindowContentContextImpl>();
+
+ //
+ for (PortalNode child : page.getChildren())
+ {
+ if (child instanceof WindowNode)
+ {
+ WindowNode window = (WindowNode)child;
+ WindowContentContextImpl windowContext = new WindowContentContextImpl(this, window);
+ windowContexts.put(windowContext.getId(), windowContext);
+ }
+ }
+
+ //
+ this.id = "node." + page.getId();
+ this.windowContexts = windowContexts;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public Collection<? extends WindowContentContext> getWindowContexts()
+ {
+ return windowContexts.values();
+ }
+
+ public WindowContentContext getWindowContext(String windowId)
+ {
+ return windowContexts.get(windowId);
+ }
+}
Added: modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/content/WindowContentContextImpl.java
===================================================================
--- modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/content/WindowContentContextImpl.java (rev 0)
+++ modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/content/WindowContentContextImpl.java 2008-06-09 09:23:18 UTC (rev 10951)
@@ -0,0 +1,66 @@
+/******************************************************************************
+ * 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.model.content;
+
+import org.jboss.portal.presentation.portal.content.WindowContentContext;
+import org.jboss.portal.presentation.portal.content.PageContentContext;
+import org.jboss.portal.presentation.portal.model.object.WindowNode;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class WindowContentContextImpl implements WindowContentContext
+{
+
+ /** . */
+ private final String id;
+
+ /** . */
+ private final WindowNode.Content content;
+
+ /** . */
+ private final PageContentContextImpl pageContext;
+
+ public WindowContentContextImpl(PageContentContextImpl pageContext, WindowNode window)
+ {
+ this.id = "node." + window.getId();
+ this.content = window.getContent();
+ this.pageContext = pageContext;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public WindowNode.Content getContent()
+ {
+ return content;
+ }
+
+ public PageContentContext getPageContext()
+ {
+ return pageContext;
+ }
+}
Modified: modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/object/WindowNode.java
===================================================================
--- modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/object/WindowNode.java 2008-06-08 17:24:16 UTC (rev 10950)
+++ modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/object/WindowNode.java 2008-06-09 09:23:18 UTC (rev 10951)
@@ -24,10 +24,6 @@
import org.jboss.portal.presentation.model.ui.UIObject;
import org.jboss.portal.presentation.model.ui.UIWindow;
-import org.jboss.portal.presentation.model.content.WindowContent;
-import org.jboss.portal.presentation.client.PresentationClient;
-import org.jboss.portal.presentation.server.PresentationServerException;
-import org.jboss.portal.portlet.PortletInvoker;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
@@ -61,9 +57,6 @@
public static abstract class Content
{
- public abstract WindowContent render(WindowNode window, PresentationClient client, PortletInvoker portletInvoker) throws PresentationServerException;
-
public abstract String getType();
-
}
}
17 years, 11 months
JBoss Portal SVN: r10950 - branches/JBoss_Portal_Branch_2_7/core-samples/src/resources/portal-portlet-samples-war/WEB-INF.
by portal-commits@lists.jboss.org
Author: sviluppatorefico
Date: 2008-06-08 13:24:16 -0400 (Sun, 08 Jun 2008)
New Revision: 10950
Modified:
branches/JBoss_Portal_Branch_2_7/core-samples/src/resources/portal-portlet-samples-war/WEB-INF/default-object.xml
Log:
italian update
Modified: branches/JBoss_Portal_Branch_2_7/core-samples/src/resources/portal-portlet-samples-war/WEB-INF/default-object.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-samples/src/resources/portal-portlet-samples-war/WEB-INF/default-object.xml 2008-06-08 16:01:17 UTC (rev 10949)
+++ branches/JBoss_Portal_Branch_2_7/core-samples/src/resources/portal-portlet-samples-war/WEB-INF/default-object.xml 2008-06-08 17:24:16 UTC (rev 10950)
@@ -34,6 +34,7 @@
<page-name>Samples</page-name>
<display-name xml:lang="en">Samples</display-name>
<display-name xml:lang="fr">Exemples</display-name>
+ <display-name xml:lang="it">Esempi</display-name>
<!--
<properties>
<property>
17 years, 11 months
JBoss Portal SVN: r10949 - branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/classes.
by portal-commits@lists.jboss.org
Author: sviluppatorefico
Date: 2008-06-08 12:01:17 -0400 (Sun, 08 Jun 2008)
New Revision: 10949
Modified:
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource.properties
Log:
correct orthographical error
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource.properties
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource.properties 2008-06-08 15:56:44 UTC (rev 10948)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource.properties 2008-06-08 16:01:17 UTC (rev 10949)
@@ -240,7 +240,7 @@
TAB_ORDER_NAME=Tab order
TAB_ORDER_DESCRIPTION=The order value to display pages in tabs
INITIAL_WINDOW_STATE_NAME=Initial Mode
-INITIAL_WINDOW_STATE_DESCRIPTION=The inital mode of the window
+INITIAL_WINDOW_STATE_DESCRIPTION=The initial mode of the window
CONTROL_POLICY_PAGE_ACCESS_DENIED_NAME=When access to the window is denied
CONTROL_POLICY_PAGE_ACCESS_DENIED_DESCRIPTION=When access to the window is denied
CONTROL_POLICY_PAGE_UNAVAILABLE_NAME=When the window is unavailable
17 years, 11 months
JBoss Portal SVN: r10948 - branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/classes.
by portal-commits@lists.jboss.org
Author: sviluppatorefico
Date: 2008-06-08 11:56:44 -0400 (Sun, 08 Jun 2008)
New Revision: 10948
Modified:
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource.properties
branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource_it.properties
Log:
added NO_BOUND_LISTENER
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource.properties
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource.properties 2008-06-08 15:55:43 UTC (rev 10947)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource.properties 2008-06-08 15:56:44 UTC (rev 10948)
@@ -265,3 +265,5 @@
CONTROL_POLICY_PORTAL_NOT_FOUND_DESCRIPTION=When the page is not found
CONTROL_POLICY_PORTAL_RESOURCE_URI_NAME=On error redirect to this resource
CONTROL_POLICY_PORTAL_RESOURCE_URI_DESCRIPTION=On error redirect to this resource
+
+NO_BOUND_LISTENER=no bound listener
\ No newline at end of file
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource_it.properties
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource_it.properties 2008-06-08 15:55:43 UTC (rev 10947)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/resources/portal-admin-war/WEB-INF/classes/Resource_it.properties 2008-06-08 15:56:44 UTC (rev 10948)
@@ -265,3 +265,5 @@
CONTROL_POLICY_PORTAL_NOT_FOUND_DESCRIPTION=Quando la pagina non viene trovata
CONTROL_POLICY_PORTAL_RESOURCE_URI_NAME=In caso di errore redireziona sulla risorsa
CONTROL_POLICY_PORTAL_RESOURCE_URI_DESCRIPTION=In caso di errore redireziona sulla risorsa
+
+NO_BOUND_LISTENER=nessun listener
\ No newline at end of file
17 years, 11 months
JBoss Portal SVN: r10947 - branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui.
by portal-commits@lists.jboss.org
Author: sviluppatorefico
Date: 2008-06-08 11:55:43 -0400 (Sun, 08 Jun 2008)
New Revision: 10947
Modified:
branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java
Log:
managed "NO BOUND LISTENER" phrase as ResourceBundle property
Modified: branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java 2008-06-08 14:18:05 UTC (rev 10946)
+++ branches/JBoss_Portal_Branch_2_7/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java 2008-06-08 15:55:43 UTC (rev 10947)
@@ -22,6 +22,23 @@
******************************************************************************/
package org.jboss.portal.core.admin.ui;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.ResourceBundle;
+import java.util.Set;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
+import javax.faces.model.SelectItem;
+
import org.jboss.portal.core.admin.ui.actions.AddPageAction;
import org.jboss.portal.core.admin.ui.actions.PropertyAction;
import org.jboss.portal.core.admin.ui.common.PageManagerBean;
@@ -50,21 +67,6 @@
import org.jboss.portal.theme.LayoutService;
import org.jboss.portal.theme.ThemeService;
-import javax.faces.application.FacesMessage;
-import javax.faces.context.FacesContext;
-import javax.faces.event.ActionEvent;
-import javax.faces.model.SelectItem;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
/** The portal object manager bean. */
public class PortalObjectManagerBean implements Serializable, AddPageAction.Listener
{
@@ -872,7 +874,8 @@
{
SelectItem[] result = new SelectItem[ids.size() + 1];
int i = 1;
- result[0] = new SelectItem("", "no bound listener");
+ ResourceBundle rb = ResourceBundle.getBundle("Resource");
+ result[0] = new SelectItem("", rb.getString("NO_BOUND_LISTENER"));
for (Iterator idsIt = ids.iterator(); idsIt.hasNext();)
{
result[i++] = new SelectItem(idsIt.next());
17 years, 11 months
JBoss Portal SVN: r10946 - in modules/presentation/trunk/portal/src: main/java/org/jboss/portal/presentation/portal/model and 2 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-06-08 10:18:05 -0400 (Sun, 08 Jun 2008)
New Revision: 10946
Added:
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/ModelAdapter.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/ModelStructuralState.java
Removed:
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/object/PortalNodeAdapter.java
modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/object/PortalNodeState.java
Modified:
modules/presentation/trunk/portal/src/main/artifacts/presentation-portal-war/WEB-INF/jboss-beans.xml
modules/presentation/trunk/portal/src/test/java/org/jboss/portal/presentation/portal/model/StructuralStateContextTestCase.java
Log:
convenient renaming
Modified: modules/presentation/trunk/portal/src/main/artifacts/presentation-portal-war/WEB-INF/jboss-beans.xml
===================================================================
--- modules/presentation/trunk/portal/src/main/artifacts/presentation-portal-war/WEB-INF/jboss-beans.xml 2008-06-08 14:13:28 UTC (rev 10945)
+++ modules/presentation/trunk/portal/src/main/artifacts/presentation-portal-war/WEB-INF/jboss-beans.xml 2008-06-08 14:18:05 UTC (rev 10946)
@@ -135,7 +135,7 @@
<bean name="LayoutStore" class="org.jboss.portal.presentation.portal.model.layout.LayoutStore"/>
- <bean name="PortalNodeAdapter" class="org.jboss.portal.presentation.portal.model.PortalNodeAdapter">
+ <bean name="PortalNodeAdapter" class="org.jboss.portal.presentation.portal.model.ModelAdapter">
<constructor>
<parameter><inject bean="PortalNodeManager"/></parameter>
<parameter><inject bean="LayoutStore"/></parameter>
Copied: modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/ModelAdapter.java (from rev 10945, modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/PortalNodeAdapter.java)
===================================================================
--- modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/ModelAdapter.java (rev 0)
+++ modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/ModelAdapter.java 2008-06-08 14:18:05 UTC (rev 10946)
@@ -0,0 +1,288 @@
+/******************************************************************************
+ * 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.model;
+
+import org.jboss.portal.presentation.impl.state.structural.adapter.StructuralAdapter;
+import org.jboss.portal.presentation.portal.model.layout.LayoutStructure;
+import org.jboss.portal.presentation.portal.model.layout.LayoutElement;
+import org.jboss.portal.presentation.portal.model.layout.StructureElement;
+import org.jboss.portal.presentation.portal.model.layout.NestedStructure;
+import org.jboss.portal.presentation.portal.model.layout.ObjectStructure;
+import org.jboss.portal.presentation.portal.model.layout.LayoutStore;
+import org.jboss.portal.presentation.portal.model.layout.LayoutObject;
+import org.jboss.portal.presentation.portal.model.layout.ObjectElement;
+import org.jboss.portal.presentation.portal.model.object.PortalNodeManager;
+import org.jboss.portal.presentation.portal.model.object.PortalNode;
+import org.jboss.portal.presentation.portal.model.object.PageNode;
+import org.jboss.portal.presentation.portal.model.object.WindowNode;
+import org.jboss.portal.presentation.model.ui.UIObject;
+import org.jboss.portal.presentation.model.ui.UIPane;
+import org.jboss.portal.presentation.model.ui.UIWindow;
+import org.jboss.portal.presentation.state.structural.StructuralState;
+import org.jboss.portal.common.NotYetImplemented;
+
+import java.util.Collection;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Collections;
+import java.io.Serializable;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class ModelAdapter implements StructuralAdapter<Object>
+{
+
+ /** . */
+ private PortalNodeManager nodeManager;
+
+ /** . */
+ private LayoutStore layoutStore;
+
+ public ModelAdapter(PortalNodeManager nodeManager, LayoutStore layoutStore)
+ {
+ this.nodeManager = nodeManager;
+ this.layoutStore = layoutStore;
+ }
+
+ public String getRootId()
+ {
+ return "node." + nodeManager.getRoot().getId();
+ }
+
+ public Object getNode(String id)
+ {
+ if (id.startsWith("node."))
+ {
+ return nodeManager.getNode(id.substring(5));
+ }
+ else if (id.startsWith("structure."))
+ {
+ return layoutStore.getObject(id.substring(10));
+ }
+ else
+ {
+ throw new IllegalArgumentException("Unrecognized id " + id);
+ }
+ }
+
+ public Object getParent(Object o)
+ {
+ if (o instanceof PortalNode)
+ {
+ return ((PortalNode)o).getParent();
+ }
+ else if (o instanceof LayoutElement)
+ {
+ LayoutStructure layout = ((LayoutElement)o).getStructure();
+
+ //
+ if (layout instanceof NestedStructure)
+ {
+ return ((NestedStructure)layout).getStructureElement();
+ }
+ else
+ {
+ ObjectStructure objectStructure = (ObjectStructure)layout;
+ String objectId = objectStructure.getObjectRef();
+ return nodeManager.getNode(objectId);
+ }
+ }
+ else
+ {
+ throw new NotYetImplemented();
+ }
+ }
+
+ public Collection<?> getChilren(Object o)
+ {
+ if (o instanceof PortalNode)
+ {
+ if (o instanceof PageNode)
+ {
+ String layoutStructureId = ((PageNode)o).getLayoutStructureId();
+
+ //
+ LayoutStructure layoutStructure = (LayoutStructure)layoutStore.getObject(layoutStructureId);
+
+ //
+ return layoutStructure.getElements();
+ }
+ else
+ {
+ return ((PortalNode)o).getChildren();
+ }
+ }
+ else if (o instanceof LayoutElement)
+ {
+ if (o instanceof StructureElement)
+ {
+ return ((StructureElement)o).getNestedStructure().getElements();
+ }
+ else
+ {
+ return Collections.emptyList();
+ }
+ }
+ else
+ {
+ throw new NotYetImplemented();
+ }
+ }
+
+ public String getId(Object o)
+ {
+ if (o instanceof PortalNode)
+ {
+ return "node." + ((PortalNode)o).getId();
+ }
+ else if (o instanceof LayoutObject)
+ {
+ return "structure." + ((LayoutObject)o).getId();
+ }
+ else
+ {
+ throw new NotYetImplemented();
+ }
+ }
+
+ public Class<? extends UIObject> getType(Object o)
+ {
+ if (o instanceof PortalNode)
+ {
+ return ((PortalNode)o).getType();
+ }
+ else if (o instanceof LayoutElement)
+ {
+ if (o instanceof StructureElement)
+ {
+ return UIPane.class;
+ }
+ else if (o instanceof ObjectElement)
+ {
+ return UIWindow.class;
+ }
+ else
+ {
+ throw new NotYetImplemented();
+ }
+ }
+ else
+ {
+ throw new NotYetImplemented();
+ }
+ }
+
+ public String getName(Object o)
+ {
+ if (o instanceof PortalNode)
+ {
+ return ((PortalNode)o).getName();
+ }
+ else if (o instanceof LayoutObject)
+ {
+ // no natural name, for now use id
+ return ((LayoutObject)o).getId();
+ }
+ else
+ {
+ throw new NotYetImplemented();
+ }
+ }
+
+ public Map<String, Serializable> getProperties(Object o)
+ {
+ if (o instanceof PageNode)
+ {
+ PageNode page = (PageNode)o;
+
+ //
+ String layoutStructureId = ((PageNode)o).getLayoutStructureId();
+
+ //
+ LayoutStructure layoutStructure = (LayoutStructure)layoutStore.getObject(layoutStructureId);
+
+ //
+ Map<String, Serializable> properties = new HashMap<String, Serializable>(page.getProperties());
+
+ //
+ properties.putAll(layoutStructure.getState().getProperties());
+
+ //
+ return properties;
+ }
+ else if (o instanceof PortalNode)
+ {
+ return ((PortalNode)o).getProperties();
+ }
+ else if (o instanceof LayoutObject)
+ {
+ if (o instanceof ObjectElement)
+ {
+ ObjectElement element = (ObjectElement)o;
+
+ //
+ String windowId = element.getObjectRef();
+
+ //
+ WindowNode window = (WindowNode)nodeManager.getNode(windowId);
+
+ //
+ Map<String, Serializable> properties = new HashMap<String, Serializable>(window.getProperties());
+
+ //
+ properties.putAll(element.getState().getProperties());
+
+ //
+ return properties;
+ }
+ else
+ {
+ return ((LayoutObject)o).getState().getProperties();
+ }
+ }
+ else
+ {
+ throw new NotYetImplemented();
+ }
+ }
+
+ public StructuralState getState(Object o)
+ {
+ Class<? extends UIObject> type = getType(o);
+ String name = getName(o);
+ Map<String, Serializable> properties = getProperties(o);
+
+ //
+ return new ModelStructuralState(type, name, properties);
+ }
+
+ public void lock(Object o)
+ {
+ }
+
+ public void unlock(Object o)
+ {
+ }
+}
Copied: modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/ModelStructuralState.java (from rev 10945, modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/PortalNodeState.java)
===================================================================
--- modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/ModelStructuralState.java (rev 0)
+++ modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/ModelStructuralState.java 2008-06-08 14:18:05 UTC (rev 10946)
@@ -0,0 +1,99 @@
+/******************************************************************************
+ * 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.model;
+
+import org.jboss.portal.presentation.model.ui.UIObject;
+import org.jboss.portal.presentation.state.structural.StructuralState;
+
+import java.util.Map;
+import java.io.Serializable;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+class ModelStructuralState implements StructuralState
+{
+
+ /** . */
+ private final Class<? extends UIObject> type;
+
+ /** . */
+ private final String name;
+
+ /** . */
+ private final Map<String, Serializable> properties;
+
+ public ModelStructuralState(
+ Class<? extends UIObject> type,
+ String name,
+ Map<String, Serializable> properties)
+ {
+ this.type = type;
+ this.name = name;
+ this.properties = properties;
+ }
+
+ public Class<? extends UIObject> getType()
+ {
+ return type;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public Map<String, Serializable> getProperties()
+ {
+ return properties;
+ }
+
+ public boolean equals(Object obj)
+ {
+ if (obj == this)
+ {
+ return true;
+ }
+ if (obj instanceof ModelStructuralState)
+ {
+ ModelStructuralState that = (ModelStructuralState)obj;
+
+ //
+ if (!that.type.equals(this.type))
+ {
+ return false;
+ }
+
+ //
+ if (!that.name.equals(this.name))
+ {
+ return false;
+ }
+
+ //
+ return that.properties.equals(this.properties);
+ }
+ return false;
+ }
+}
Deleted: modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/object/PortalNodeAdapter.java
===================================================================
--- modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/object/PortalNodeAdapter.java 2008-06-08 14:13:28 UTC (rev 10945)
+++ modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/object/PortalNodeAdapter.java 2008-06-08 14:18:05 UTC (rev 10946)
@@ -1,284 +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.model.object;
-
-import org.jboss.portal.presentation.impl.state.structural.adapter.StructuralAdapter;
-import org.jboss.portal.presentation.portal.model.layout.LayoutStructure;
-import org.jboss.portal.presentation.portal.model.layout.LayoutElement;
-import org.jboss.portal.presentation.portal.model.layout.StructureElement;
-import org.jboss.portal.presentation.portal.model.layout.NestedStructure;
-import org.jboss.portal.presentation.portal.model.layout.ObjectStructure;
-import org.jboss.portal.presentation.portal.model.layout.LayoutStore;
-import org.jboss.portal.presentation.portal.model.layout.LayoutObject;
-import org.jboss.portal.presentation.portal.model.layout.ObjectElement;
-import org.jboss.portal.presentation.model.ui.UIObject;
-import org.jboss.portal.presentation.model.ui.UIPane;
-import org.jboss.portal.presentation.model.ui.UIWindow;
-import org.jboss.portal.presentation.state.structural.StructuralState;
-import org.jboss.portal.common.NotYetImplemented;
-
-import java.util.Collection;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.Collections;
-import java.io.Serializable;
-
-/**
- * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class PortalNodeAdapter implements StructuralAdapter<Object>
-{
-
- /** . */
- private PortalNodeManager nodeManager;
-
- /** . */
- private LayoutStore layoutStore;
-
- public PortalNodeAdapter(PortalNodeManager nodeManager, LayoutStore layoutStore)
- {
- this.nodeManager = nodeManager;
- this.layoutStore = layoutStore;
- }
-
- public String getRootId()
- {
- return "node." + nodeManager.getRoot().getId();
- }
-
- public Object getNode(String id)
- {
- if (id.startsWith("node."))
- {
- return nodeManager.getNode(id.substring(5));
- }
- else if (id.startsWith("structure."))
- {
- return layoutStore.getObject(id.substring(10));
- }
- else
- {
- throw new IllegalArgumentException("Unrecognized id " + id);
- }
- }
-
- public Object getParent(Object o)
- {
- if (o instanceof PortalNode)
- {
- return ((PortalNode)o).getParent();
- }
- else if (o instanceof LayoutElement)
- {
- LayoutStructure layout = ((LayoutElement)o).getStructure();
-
- //
- if (layout instanceof NestedStructure)
- {
- return ((NestedStructure)layout).getStructureElement();
- }
- else
- {
- ObjectStructure objectStructure = (ObjectStructure)layout;
- String objectId = objectStructure.getObjectRef();
- return nodeManager.getNode(objectId);
- }
- }
- else
- {
- throw new NotYetImplemented();
- }
- }
-
- public Collection<?> getChilren(Object o)
- {
- if (o instanceof PortalNode)
- {
- if (o instanceof PageNode)
- {
- String layoutStructureId = ((PageNode)o).getLayoutStructureId();
-
- //
- LayoutStructure layoutStructure = (LayoutStructure)layoutStore.getObject(layoutStructureId);
-
- //
- return layoutStructure.getElements();
- }
- else
- {
- return ((PortalNode)o).getChildren();
- }
- }
- else if (o instanceof LayoutElement)
- {
- if (o instanceof StructureElement)
- {
- return ((StructureElement)o).getNestedStructure().getElements();
- }
- else
- {
- return Collections.emptyList();
- }
- }
- else
- {
- throw new NotYetImplemented();
- }
- }
-
- public String getId(Object o)
- {
- if (o instanceof PortalNode)
- {
- return "node." + ((PortalNode)o).getId();
- }
- else if (o instanceof LayoutObject)
- {
- return "structure." + ((LayoutObject)o).getId();
- }
- else
- {
- throw new NotYetImplemented();
- }
- }
-
- public Class<? extends UIObject> getType(Object o)
- {
- if (o instanceof PortalNode)
- {
- return ((PortalNode)o).getType();
- }
- else if (o instanceof LayoutElement)
- {
- if (o instanceof StructureElement)
- {
- return UIPane.class;
- }
- else if (o instanceof ObjectElement)
- {
- return UIWindow.class;
- }
- else
- {
- throw new NotYetImplemented();
- }
- }
- else
- {
- throw new NotYetImplemented();
- }
- }
-
- public String getName(Object o)
- {
- if (o instanceof PortalNode)
- {
- return ((PortalNode)o).getName();
- }
- else if (o instanceof LayoutObject)
- {
- // no natural name, for now use id
- return ((LayoutObject)o).getId();
- }
- else
- {
- throw new NotYetImplemented();
- }
- }
-
- public Map<String, Serializable> getProperties(Object o)
- {
- if (o instanceof PageNode)
- {
- PageNode page = (PageNode)o;
-
- //
- String layoutStructureId = ((PageNode)o).getLayoutStructureId();
-
- //
- LayoutStructure layoutStructure = (LayoutStructure)layoutStore.getObject(layoutStructureId);
-
- //
- Map<String, Serializable> properties = new HashMap<String, Serializable>(page.getProperties());
-
- //
- properties.putAll(layoutStructure.getState().getProperties());
-
- //
- return properties;
- }
- else if (o instanceof PortalNode)
- {
- return ((PortalNode)o).getProperties();
- }
- else if (o instanceof LayoutObject)
- {
- if (o instanceof ObjectElement)
- {
- ObjectElement element = (ObjectElement)o;
-
- //
- String windowId = element.getObjectRef();
-
- //
- WindowNode window = (WindowNode)nodeManager.getNode(windowId);
-
- //
- Map<String, Serializable> properties = new HashMap<String, Serializable>(window.getProperties());
-
- //
- properties.putAll(element.getState().getProperties());
-
- //
- return properties;
- }
- else
- {
- return ((LayoutObject)o).getState().getProperties();
- }
- }
- else
- {
- throw new NotYetImplemented();
- }
- }
-
- public StructuralState getState(Object o)
- {
- Class<? extends UIObject> type = getType(o);
- String name = getName(o);
- Map<String, Serializable> properties = getProperties(o);
-
- //
- return new PortalNodeState(type, name, properties);
- }
-
- public void lock(Object o)
- {
- }
-
- public void unlock(Object o)
- {
- }
-}
Deleted: modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/object/PortalNodeState.java
===================================================================
--- modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/object/PortalNodeState.java 2008-06-08 14:13:28 UTC (rev 10945)
+++ modules/presentation/trunk/portal/src/main/java/org/jboss/portal/presentation/portal/model/object/PortalNodeState.java 2008-06-08 14:18:05 UTC (rev 10946)
@@ -1,99 +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.model.object;
-
-import org.jboss.portal.presentation.model.ui.UIObject;
-import org.jboss.portal.presentation.state.structural.StructuralState;
-
-import java.util.Map;
-import java.io.Serializable;
-
-/**
- * @author <a href="mailto:julien@jboss-portal.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class PortalNodeState implements StructuralState
-{
-
- /** . */
- private final Class<? extends UIObject> type;
-
- /** . */
- private final String name;
-
- /** . */
- private final Map<String, Serializable> properties;
-
- public PortalNodeState(
- Class<? extends UIObject> type,
- String name,
- Map<String, Serializable> properties)
- {
- this.type = type;
- this.name = name;
- this.properties = properties;
- }
-
- public Class<? extends UIObject> getType()
- {
- return type;
- }
-
- public String getName()
- {
- return name;
- }
-
- public Map<String, Serializable> getProperties()
- {
- return properties;
- }
-
- public boolean equals(Object obj)
- {
- if (obj == this)
- {
- return true;
- }
- if (obj instanceof PortalNodeState)
- {
- PortalNodeState that = (PortalNodeState)obj;
-
- //
- if (!that.type.equals(this.type))
- {
- return false;
- }
-
- //
- if (!that.name.equals(this.name))
- {
- return false;
- }
-
- //
- return that.properties.equals(this.properties);
- }
- return false;
- }
-}
Modified: modules/presentation/trunk/portal/src/test/java/org/jboss/portal/presentation/portal/model/StructuralStateContextTestCase.java
===================================================================
--- modules/presentation/trunk/portal/src/test/java/org/jboss/portal/presentation/portal/model/StructuralStateContextTestCase.java 2008-06-08 14:13:28 UTC (rev 10945)
+++ modules/presentation/trunk/portal/src/test/java/org/jboss/portal/presentation/portal/model/StructuralStateContextTestCase.java 2008-06-08 14:18:05 UTC (rev 10946)
@@ -34,7 +34,7 @@
import org.jboss.portal.presentation.portal.model.object.ContextNode;
import org.jboss.portal.presentation.portal.model.object.PageNode;
import org.jboss.portal.presentation.portal.model.object.PortalNode;
-import org.jboss.portal.presentation.portal.model.PortalNodeAdapter;
+import org.jboss.portal.presentation.portal.model.ModelAdapter;
import org.jboss.portal.presentation.portal.model.object.PortalNodeManager;
import org.jboss.portal.presentation.portal.model.object.WindowNode;
@@ -145,7 +145,7 @@
protected void setUp() throws Exception
{
portalNodeManager = new PortalNodeManager();
- StructuralAdapter<Object> adapter = new PortalNodeAdapter(portalNodeManager, new LayoutStore());
+ StructuralAdapter<Object> adapter = new ModelAdapter(portalNodeManager, new LayoutStore());
structuralStateContext = new StructuralStateContextImpl<Object>(adapter);
}
}
17 years, 11 months