Author: julien(a)jboss.com
Date: 2007-03-02 10:59:50 -0500 (Fri, 02 Mar 2007)
New Revision: 6489
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java
trunk/core-cms/src/main/org/jboss/portal/core/cms/content/CMSContent.java
trunk/core/src/main/org/jboss/portal/core/impl/model/content/portlet/PortletContent.java
trunk/core/src/main/org/jboss/portal/core/impl/model/portal/content/PortletContentRenderer.java
trunk/core/src/main/org/jboss/portal/core/model/content/Content.java
trunk/core/src/main/org/jboss/portal/core/model/portal/Window.java
trunk/core/src/main/org/jboss/portal/core/model/portal/command/InvokePortletWindowActionCommand.java
trunk/core/src/main/org/jboss/portal/test/core/model/content/NullContent.java
Log:
removed getURI() from the window interface since it belongs rather to the content state
object.
Modified:
trunk/core/src/main/org/jboss/portal/core/impl/model/content/portlet/PortletContent.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/impl/model/content/portlet/PortletContent.java 2007-03-01
23:07:44 UTC (rev 6488)
+++
trunk/core/src/main/org/jboss/portal/core/impl/model/content/portlet/PortletContent.java 2007-03-02
15:59:50 UTC (rev 6489)
@@ -61,6 +61,11 @@
return state;
}
+ public boolean isMutable()
+ {
+ return true;
+ }
+
public String getURI()
{
return getInstanceRef();
Modified:
trunk/core/src/main/org/jboss/portal/core/impl/model/portal/content/PortletContentRenderer.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/impl/model/portal/content/PortletContentRenderer.java 2007-03-01
23:07:44 UTC (rev 6488)
+++
trunk/core/src/main/org/jboss/portal/core/impl/model/portal/content/PortletContentRenderer.java 2007-03-02
15:59:50 UTC (rev 6489)
@@ -31,6 +31,7 @@
import org.jboss.portal.core.model.portal.command.response.PortletWindowResponse;
import org.jboss.portal.core.model.instance.Instance;
import org.jboss.portal.core.model.CustomizationManager;
+import org.jboss.portal.core.model.content.Content;
import org.jboss.portal.core.controller.ControllerContext;
import org.jboss.portal.core.controller.ResourceNotFoundException;
import org.jboss.portal.core.controller.ControllerException;
@@ -150,7 +151,17 @@
// No instance means we can't continue
if (instance == null)
{
- throw new ResourceNotFoundException(window.getURI());
+ String ref = null;
+ Content content = window.getContent();
+ if (content != null)
+ {
+ ref = content.getURI();
+ }
+ if (ref == null)
+ {
+ ref = window.getId().toString();
+ }
+ throw new ResourceNotFoundException(ref);
}
//
Modified: trunk/core/src/main/org/jboss/portal/core/model/content/Content.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/model/content/Content.java 2007-03-01
23:07:44 UTC (rev 6488)
+++ trunk/core/src/main/org/jboss/portal/core/model/content/Content.java 2007-03-02
15:59:50 UTC (rev 6489)
@@ -40,6 +40,13 @@
LocalizedString getDisplayName();
/**
+ * Returns true if the content state can be changed.
+ *
+ * @return true if the content state can be changed
+ */
+ boolean isMutable();
+
+ /**
* Returns the content URI.
*
* @return the content URI
@@ -50,6 +57,7 @@
* Updates the content URI.
*
* @param uri the new content URI value
+ * @throws IllegalStateException if the content cannot be changed for some reason
*/
- void setURI(String uri);
+ void setURI(String uri) throws IllegalStateException;
}
Modified: trunk/core/src/main/org/jboss/portal/core/model/portal/Window.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/model/portal/Window.java 2007-03-01 23:07:44
UTC (rev 6488)
+++ trunk/core/src/main/org/jboss/portal/core/model/portal/Window.java 2007-03-02 15:59:50
UTC (rev 6489)
@@ -33,9 +33,18 @@
*/
public interface Window extends PortalObject
{
- String getURI();
-
+ /**
+ * Return the window content type.
+ *
+ * @return the window content type
+ */
ContentType getContentType();
+ /**
+ * Returns the window content or null if no content can be provided. Content could not
be provided
+ * if no content handler has been found in the content handler registry.
+ *
+ * @return the window content
+ */
Content getContent();
}
Modified:
trunk/core/src/main/org/jboss/portal/core/model/portal/command/InvokePortletWindowActionCommand.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/portal/command/InvokePortletWindowActionCommand.java 2007-03-01
23:07:44 UTC (rev 6488)
+++
trunk/core/src/main/org/jboss/portal/core/model/portal/command/InvokePortletWindowActionCommand.java 2007-03-02
15:59:50 UTC (rev 6489)
@@ -34,6 +34,7 @@
import org.jboss.portal.core.model.portal.command.response.PortletWindowResponse;
import org.jboss.portal.core.model.portal.PortalObjectId;
import org.jboss.portal.core.model.instance.Instance;
+import org.jboss.portal.core.model.content.Content;
import org.jboss.portal.portlet.NoSuchPortletException;
import org.jboss.portal.portlet.PortletParameters;
import org.jboss.portal.portlet.PortletInvokerException;
@@ -124,7 +125,17 @@
// No instance means we can't continue
if (instance == null)
{
- throw new ResourceNotFoundException(window.getURI());
+ String ref = null;
+ Content content = window.getContent();
+ if (content != null)
+ {
+ ref = content.getURI();
+ }
+ if (ref == null)
+ {
+ ref = window.getId().toString();
+ }
+ throw new ResourceNotFoundException(ref);
}
}
Modified: trunk/core/src/main/org/jboss/portal/test/core/model/content/NullContent.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/test/core/model/content/NullContent.java 2007-03-01
23:07:44 UTC (rev 6488)
+++
trunk/core/src/main/org/jboss/portal/test/core/model/content/NullContent.java 2007-03-02
15:59:50 UTC (rev 6489)
@@ -47,6 +47,11 @@
this.state = state;
}
+ public boolean isMutable()
+ {
+ return true;
+ }
+
public String getContextId()
{
return contextId;
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java 2007-03-01
23:07:44 UTC (rev 6488)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java 2007-03-02
15:59:50 UTC (rev 6489)
@@ -54,6 +54,7 @@
import org.jboss.portal.core.model.portal.PortalObjectId;
import org.jboss.portal.core.model.portal.Window;
import org.jboss.portal.core.model.content.ContentType;
+import org.jboss.portal.core.model.content.Content;
import org.jboss.portal.core.admin.ui.actions.WindowComparator;
import org.jboss.portal.faces.el.DelegatingPropertyResolver;
import org.jboss.portal.faces.el.decorator.SimpleBeanDecorator;
@@ -471,7 +472,11 @@
Window window = (Window)object;
next = "windows";
selectedContentType = window.getContentType();
- selectedContentURI = window.getURI();
+ Content content = window.getContent();
+ if (content != null)
+ {
+ selectedContentURI = content.getURI();
+ }
break;
}
}
Modified: trunk/core-cms/src/main/org/jboss/portal/core/cms/content/CMSContent.java
===================================================================
--- trunk/core-cms/src/main/org/jboss/portal/core/cms/content/CMSContent.java 2007-03-01
23:07:44 UTC (rev 6488)
+++ trunk/core-cms/src/main/org/jboss/portal/core/cms/content/CMSContent.java 2007-03-02
15:59:50 UTC (rev 6489)
@@ -48,6 +48,11 @@
return new LocalizedString(state.getURI() + " cms", Locale.ENGLISH);
}
+ public boolean isMutable()
+ {
+ return true;
+ }
+
/**
*
* @return