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;
- }
-}