Author: julien(a)jboss.com
Date: 2007-01-23 11:46:19 -0500 (Tue, 23 Jan 2007)
New Revision: 6082
Added:
trunk/core/src/main/org/jboss/portal/core/model/portal/metadata/ContentMetaData.java
trunk/core/src/resources/dtd/portal-object_2_6.dtd
Removed:
trunk/core/src/main/org/jboss/portal/core/impl/model/content/cms/CMSContentMetaData.java
trunk/core/src/main/org/jboss/portal/core/impl/model/content/portlet/PortletContentMetaData.java
trunk/core/src/main/org/jboss/portal/core/model/content/metadata/
Modified:
trunk/core-cms/src/main/org/jboss/portal/core/cms/editor/CMSContentEditor.java
trunk/core/src/main/org/jboss/portal/core/impl/model/content/cms/CMSContentHandler.java
trunk/core/src/main/org/jboss/portal/core/impl/model/content/portlet/PortletContentHandler.java
trunk/core/src/main/org/jboss/portal/core/impl/model/portal/PageImpl.java
trunk/core/src/main/org/jboss/portal/core/impl/model/portal/WindowImpl.java
trunk/core/src/main/org/jboss/portal/core/model/content/spi/ContentHandler.java
trunk/core/src/main/org/jboss/portal/core/model/portal/Page.java
trunk/core/src/main/org/jboss/portal/core/model/portal/metadata/WindowMetaData.java
trunk/core/src/main/org/jboss/portal/core/portlet/dashboard/AddWindowContext.java
trunk/core/src/main/org/jboss/portal/core/portlet/dashboard/PortletContentEditor.java
trunk/core/src/main/org/jboss/portal/core/portlet/management/actions/AddWindowAction.java
trunk/core/src/main/org/jboss/portal/test/core/model/content/NullContentHandler.java
trunk/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java
trunk/core/src/resources/portal-core-sar/conf/data/default-object.xml
Log:
- simplified how window content metadata is build from XML
- changed the schema of the content part of the window of portal object XML
- added DTD for portal object, needs to be completed with comments
Modified:
trunk/core/src/main/org/jboss/portal/core/impl/model/content/cms/CMSContentHandler.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/impl/model/content/cms/CMSContentHandler.java 2007-01-23
15:43:00 UTC (rev 6081)
+++
trunk/core/src/main/org/jboss/portal/core/impl/model/content/cms/CMSContentHandler.java 2007-01-23
16:46:19 UTC (rev 6082)
@@ -26,9 +26,6 @@
import org.jboss.portal.core.model.content.spi.ContentState;
import org.jboss.portal.core.impl.model.content.AbstractContentHandler;
import org.jboss.portal.core.model.content.Content;
-import org.jboss.portal.core.model.content.metadata.ContentMetaData;
-import org.jboss.portal.common.util.XML;
-import org.w3c.dom.Element;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -40,12 +37,4 @@
{
return new CMSContent(state);
}
-
- public ContentMetaData newMetaData(Element windowElement)
- {
- CMSContentMetaData contentMD = new CMSContentMetaData();
- String instanceRef = XML.asString(XML.getUniqueChild(windowElement,
"uri", true));
- contentMD.setUri(instanceRef);
- return contentMD;
- }
}
Deleted:
trunk/core/src/main/org/jboss/portal/core/impl/model/content/cms/CMSContentMetaData.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/impl/model/content/cms/CMSContentMetaData.java 2007-01-23
15:43:00 UTC (rev 6081)
+++
trunk/core/src/main/org/jboss/portal/core/impl/model/content/cms/CMSContentMetaData.java 2007-01-23
16:46:19 UTC (rev 6082)
@@ -1,53 +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.core.impl.model.content.cms;
-
-import org.jboss.portal.core.model.content.metadata.ContentMetaData;
-import org.jboss.portal.core.model.content.Content;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class CMSContentMetaData implements ContentMetaData
-{
-
- /** The instance handle of this window. */
- protected String uri;
-
- public String getUri()
- {
- return uri;
- }
-
- public void setUri(String uri)
- {
- this.uri = uri;
- }
-
- public void configure(Content content)
- {
- CMSContent pc = (CMSContent)content;
- pc.setURI(uri);
- }
-}
Modified:
trunk/core/src/main/org/jboss/portal/core/impl/model/content/portlet/PortletContentHandler.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/impl/model/content/portlet/PortletContentHandler.java 2007-01-23
15:43:00 UTC (rev 6081)
+++
trunk/core/src/main/org/jboss/portal/core/impl/model/content/portlet/PortletContentHandler.java 2007-01-23
16:46:19 UTC (rev 6082)
@@ -26,11 +26,8 @@
import org.jboss.portal.core.model.content.spi.ContentState;
import org.jboss.portal.core.impl.model.content.AbstractContentHandler;
import org.jboss.portal.core.model.content.Content;
-import org.jboss.portal.core.model.content.metadata.ContentMetaData;
import org.jboss.portal.core.model.instance.InstanceContainer;
import org.jboss.portal.core.model.instance.Instance;
-import org.jboss.portal.common.util.XML;
-import org.w3c.dom.Element;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -57,14 +54,6 @@
return new PortletContent(this, contextId, state);
}
- public ContentMetaData newMetaData(Element windowElement)
- {
- PortletContentMetaData contentMD = new PortletContentMetaData();
- String instanceRef = XML.asString(XML.getUniqueChild(windowElement,
"instance-ref", true));
- contentMD.setInstanceRef(instanceRef);
- return contentMD;
- }
-
public void destroyContent(String contextId, ContentState state)
{
String instanceRef = state.getURI();
Deleted:
trunk/core/src/main/org/jboss/portal/core/impl/model/content/portlet/PortletContentMetaData.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/impl/model/content/portlet/PortletContentMetaData.java 2007-01-23
15:43:00 UTC (rev 6081)
+++
trunk/core/src/main/org/jboss/portal/core/impl/model/content/portlet/PortletContentMetaData.java 2007-01-23
16:46:19 UTC (rev 6082)
@@ -1,53 +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.core.impl.model.content.portlet;
-
-import org.jboss.portal.core.model.content.metadata.ContentMetaData;
-import org.jboss.portal.core.model.content.Content;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class PortletContentMetaData implements ContentMetaData
-{
-
- /** The instance handle of this window. */
- protected String instanceRef;
-
- public String getInstanceRef()
- {
- return instanceRef;
- }
-
- public void setInstanceRef(String instanceRef)
- {
- this.instanceRef = instanceRef;
- }
-
- public void configure(Content content)
- {
- PortletContent pc = (PortletContent)content;
- pc.setInstanceRef(instanceRef);
- }
-}
Modified: trunk/core/src/main/org/jboss/portal/core/impl/model/portal/PageImpl.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/model/portal/PageImpl.java 2007-01-23
15:43:00 UTC (rev 6081)
+++ trunk/core/src/main/org/jboss/portal/core/impl/model/portal/PageImpl.java 2007-01-23
16:46:19 UTC (rev 6082)
@@ -85,9 +85,9 @@
return null;
}
- public Window createWindow(String name, ContentType contentType) throws
DuplicatePortalObjectException, IllegalArgumentException
+ public Window createWindow(String name, ContentType contentType, String contentURI)
throws DuplicatePortalObjectException, IllegalArgumentException
{
- WindowImpl window = new WindowImpl(contentType);
+ WindowImpl window = new WindowImpl(contentType, contentURI);
addChild(name, window);
return window;
}
Modified: trunk/core/src/main/org/jboss/portal/core/impl/model/portal/WindowImpl.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/model/portal/WindowImpl.java 2007-01-23
15:43:00 UTC (rev 6081)
+++ trunk/core/src/main/org/jboss/portal/core/impl/model/portal/WindowImpl.java 2007-01-23
16:46:19 UTC (rev 6082)
@@ -54,17 +54,17 @@
super(true);
//
+ this.contentType = null;
this.instanceRef = null;
- this.contentType = null;
}
/**
* Creates a new window.
*
* @param contentType the window content type
- * @throws IllegalArgumentException if the content type is null
+ * @throws IllegalArgumentException if the content type is null or the content URI is
null
*/
- public WindowImpl(ContentType contentType) throws IllegalArgumentException
+ public WindowImpl(ContentType contentType, String contentURI) throws
IllegalArgumentException
{
super(false);
@@ -73,10 +73,14 @@
{
throw new IllegalArgumentException("No null content type accepted");
}
+ if (contentURI == null)
+ {
+ throw new IllegalArgumentException("No null content URI accepted");
+ }
//
- this.instanceRef = null;
this.contentType = contentType;
+ this.instanceRef = contentURI;
//
setDeclaredProperty(PORTAL_PROP_WINDOW_CONTENT_TYPE, contentType.toString());
Modified: trunk/core/src/main/org/jboss/portal/core/model/content/spi/ContentHandler.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/content/spi/ContentHandler.java 2007-01-23
15:43:00 UTC (rev 6081)
+++
trunk/core/src/main/org/jboss/portal/core/model/content/spi/ContentHandler.java 2007-01-23
16:46:19 UTC (rev 6082)
@@ -22,9 +22,7 @@
******************************************************************************/
package org.jboss.portal.core.model.content.spi;
-import org.jboss.portal.core.model.content.metadata.ContentMetaData;
import org.jboss.portal.core.model.content.Content;
-import org.w3c.dom.Element;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -46,9 +44,4 @@
* Life cycle method to signal destruction.
*/
void destroyContent(String contextId, ContentState state);
-
- /**
- * Factory method treate the window content meta data from XML.
- */
- ContentMetaData newMetaData(Element windowElement);
}
Modified: trunk/core/src/main/org/jboss/portal/core/model/portal/Page.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/model/portal/Page.java 2007-01-23 15:43:00
UTC (rev 6081)
+++ trunk/core/src/main/org/jboss/portal/core/model/portal/Page.java 2007-01-23 16:46:19
UTC (rev 6082)
@@ -54,9 +54,10 @@
*
* @param name window name
* @param contentType the window content type
+ * @param contentURI the window content URI
* @return the created window
* @throws DuplicatePortalObjectException if a portal object with the specified name
already exist
* @throws IllegalArgumentException if the name is null
*/
- Window createWindow(String name, ContentType contentType) throws
DuplicatePortalObjectException, IllegalArgumentException;
+ Window createWindow(String name, ContentType contentType, String contentURI) throws
DuplicatePortalObjectException, IllegalArgumentException;
}
Added:
trunk/core/src/main/org/jboss/portal/core/model/portal/metadata/ContentMetaData.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/model/portal/metadata/ContentMetaData.java
(rev 0)
+++
trunk/core/src/main/org/jboss/portal/core/model/portal/metadata/ContentMetaData.java 2007-01-23
16:46:19 UTC (rev 6082)
@@ -0,0 +1,59 @@
+/******************************************************************************
+ * 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.core.model.portal.metadata;
+
+import org.jboss.portal.core.model.content.ContentType;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ContentMetaData
+{
+
+ /** . */
+ private ContentType contentType;
+
+ /** . */
+ private String uri;
+
+ public ContentType getContentType()
+ {
+ return contentType;
+ }
+
+ public void setContentType(ContentType contentType)
+ {
+ this.contentType = contentType;
+ }
+
+ public String getURI()
+ {
+ return uri;
+ }
+
+ public void setURI(String uri)
+ {
+ this.uri = uri;
+ }
+}
Modified:
trunk/core/src/main/org/jboss/portal/core/model/portal/metadata/WindowMetaData.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/portal/metadata/WindowMetaData.java 2007-01-23
15:43:00 UTC (rev 6081)
+++
trunk/core/src/main/org/jboss/portal/core/model/portal/metadata/WindowMetaData.java 2007-01-23
16:46:19 UTC (rev 6082)
@@ -26,9 +26,7 @@
import org.jboss.portal.core.model.portal.PortalObject;
import org.jboss.portal.core.model.portal.Window;
import org.jboss.portal.core.model.content.ContentType;
-import org.jboss.portal.core.model.content.metadata.ContentMetaData;
import org.jboss.portal.core.model.content.spi.ContentHandlerRegistry;
-import org.jboss.portal.core.model.content.spi.ContentHandler;
import org.jboss.portal.theme.ThemeConstants;
import org.jboss.portal.common.util.XML;
import org.w3c.dom.Element;
@@ -100,16 +98,13 @@
}
//
- Window window = ((Page)parent).createWindow(getName(), contentType);
+ Window window = ((Page)parent).createWindow(getName(), content.getContentType(),
content.getURI());
//
window.setDeclaredProperty(ThemeConstants.PORTAL_PROP_REGION, region);
window.setDeclaredProperty(ThemeConstants.PORTAL_PROP_ORDER, "" +
order);
//
- content.configure(window.getContent());
-
- //
return window;
}
@@ -130,18 +125,31 @@
windowMD.setOrder(height);
//
- ContentType contentType = ContentType.PORTLET;
- Element contentTypeElt = XML.getUniqueChild(windowElt, "content-type",
false);
- if (contentTypeElt != null)
+ ContentType contentType;
+ String contentURI;
+ Element instanceRefElt = XML.getUniqueChild(windowElt, "instance-ref",
false);
+ if (instanceRefElt != null)
{
- String value = XML.asString(contentTypeElt);
- contentType = ContentType.create(value);
+ contentType = ContentType.PORTLET;
+ contentURI = XML.asString(instanceRefElt);
}
- windowMD.setContentType(contentType);
+ else
+ {
+ Element contentElt = XML.getUniqueChild(windowElt, "content", true);
+ Element contentTypeElt = XML.getUniqueChild(contentElt,
"content-type", true);
+ Element contentURIElt = XML.getUniqueChild(contentElt, "content-uri",
true);
+ //
+ contentType = ContentType.create(XML.asString(contentTypeElt));
+ contentURI = XML.asString(contentURIElt);
+ }
+
// Build content meta data
- ContentHandler handler = registry.getHandler(contentType);
- ContentMetaData contentMD = handler.newMetaData(windowElt);
+ ContentMetaData contentMD = new ContentMetaData();
+ contentMD.setContentType(contentType);
+ contentMD.setURI(contentURI);
+
+ //
windowMD.setContent(contentMD);
//
Modified:
trunk/core/src/main/org/jboss/portal/core/portlet/dashboard/AddWindowContext.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/portlet/dashboard/AddWindowContext.java 2007-01-23
15:43:00 UTC (rev 6081)
+++
trunk/core/src/main/org/jboss/portal/core/portlet/dashboard/AddWindowContext.java 2007-01-23
16:46:19 UTC (rev 6082)
@@ -48,7 +48,7 @@
this.toRegion = toRegion;
}
- public Content createWindow(ContentType contentType)
+ public Content createWindow(ContentType contentType, String contentURI)
{
try
{
@@ -57,7 +57,7 @@
{
windowName = "" + doWindowNaming();
}
- Window window = page.createWindow(windowName, contentType);
+ Window window = page.createWindow(windowName, contentType, contentURI);
window.setDeclaredProperty(ThemeConstants.PORTAL_PROP_REGION, toRegion);
window.setDeclaredProperty(ThemeConstants.PORTAL_PROP_ORDER, "" +
Integer.MAX_VALUE);
return window.getContent();
Modified:
trunk/core/src/main/org/jboss/portal/core/portlet/dashboard/PortletContentEditor.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/portlet/dashboard/PortletContentEditor.java 2007-01-23
15:43:00 UTC (rev 6081)
+++
trunk/core/src/main/org/jboss/portal/core/portlet/dashboard/PortletContentEditor.java 2007-01-23
16:46:19 UTC (rev 6082)
@@ -80,8 +80,7 @@
Instance instance = instanceContainer.getDefinition(instanceRef);
if (instance != null)
{
- PortletContent content =
(PortletContent)ctx.createWindow(ContentType.PORTLET);
- content.setInstanceRef(instanceRef);
+ PortletContent content =
(PortletContent)ctx.createWindow(ContentType.PORTLET, instanceRef);
}
else
{
Modified:
trunk/core/src/main/org/jboss/portal/core/portlet/management/actions/AddWindowAction.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/portlet/management/actions/AddWindowAction.java 2007-01-23
15:43:00 UTC (rev 6081)
+++
trunk/core/src/main/org/jboss/portal/core/portlet/management/actions/AddWindowAction.java 2007-01-23
16:46:19 UTC (rev 6082)
@@ -25,7 +25,6 @@
import org.jboss.portal.core.model.portal.Page;
import org.jboss.portal.core.model.portal.Window;
import org.jboss.portal.core.model.content.ContentType;
-import org.jboss.portal.core.impl.model.content.portlet.PortletContent;
import org.jboss.portal.core.portlet.management.PortalObjectManagerBean;
import org.jboss.portal.theme.ThemeConstants;
@@ -121,13 +120,9 @@
Page page = (Page)pomgr.getSelectedObject();
//
- Window window = page.createWindow(windowName, ContentType.PORTLET);
+ Window window = page.createWindow(windowName, ContentType.PORTLET, instanceId);
window.setDeclaredProperty(ThemeConstants.PORTAL_PROP_REGION, region);
window.setDeclaredProperty(ThemeConstants.PORTAL_PROP_ORDER, "" +
Integer.MAX_VALUE);
-
- //
- PortletContent content = (PortletContent)window.getContent();
- content.setInstanceRef(instanceId);
}
catch (Exception e)
{
Modified:
trunk/core/src/main/org/jboss/portal/test/core/model/content/NullContentHandler.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/test/core/model/content/NullContentHandler.java 2007-01-23
15:43:00 UTC (rev 6081)
+++
trunk/core/src/main/org/jboss/portal/test/core/model/content/NullContentHandler.java 2007-01-23
16:46:19 UTC (rev 6082)
@@ -24,7 +24,6 @@
import org.jboss.portal.core.model.content.spi.ContentState;
import org.jboss.portal.core.model.content.Content;
-import org.jboss.portal.core.model.content.metadata.ContentMetaData;
import org.jboss.portal.core.impl.model.content.AbstractContentHandler;
import org.jboss.portal.common.NotYetImplemented;
import org.w3c.dom.Element;
@@ -47,9 +46,4 @@
public void destroyContent(String contextId, ContentState state)
{
}
-
- public ContentMetaData newMetaData(Element windowElement)
- {
- throw new NotYetImplemented();
- }
}
Modified:
trunk/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java 2007-01-23
15:43:00 UTC (rev 6081)
+++
trunk/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java 2007-01-23
16:46:19 UTC (rev 6082)
@@ -174,7 +174,7 @@
assertEquals("bar3", page.getProperty("foo3"));
//
- Window window = page.createWindow("default", ContentType.PORTLET);
+ Window window = page.createWindow("default", ContentType.PORTLET,
"uri");
assertNotNull(window);
PortalObjectId windowId = window.getId();
assertNotNull(windowId);
@@ -268,7 +268,7 @@
portal.getSupportedModes().add(Mode.VIEW);
Page page = portal.createPage("default");
page.setDeclaredProperty("pagename", "pagevalue");
- Window window = page.createWindow("window", ContentType.PORTLET);
+ Window window = page.createWindow("window", ContentType.PORTLET,
"uri");
window.setDeclaredProperty("windowname", "windowvalue");
NullContent content = (NullContent)window.getContent();
assertNotNull(content);
Added: trunk/core/src/resources/dtd/portal-object_2_6.dtd
===================================================================
--- trunk/core/src/resources/dtd/portal-object_2_6.dtd (rev 0)
+++ trunk/core/src/resources/dtd/portal-object_2_6.dtd 2007-01-23 16:46:19 UTC (rev 6082)
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!--
+<!DOCTYPE deployment PUBLIC
+ "-//JBoss Portal//DTD Portal Object 2.6//EN"
+ "http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
+-->
+
+<!--
+The deployements element is a container for deployment elements.
+-->
+<!ELEMENT deployments (deployment*)>
+
+<!--
+The deployment is a container for an instance element.
+-->
+<!ELEMENT deployment (parent-ref,if-exists?,(context|portal|page|window)*)>
+
+<!--
+-->
+<!ELEMENT parent-ref #PCDATA>
+
+<!--
+-->
+<!ELEMENT if-exists #PCDATA>
+
+<!--
+-->
+<!ELEMENT context (context-name,properties?,portal*,security-constraint?)>
+
+<!--
+-->
+<!ELEMENT portal
(portal-name,properties?,supported-modes?,supported-window-states?,(page|window)*,security-constraint?)>
+
+<!--
+-->
+<!ELEMENT page (page-name,properties?,(page|window)*,security-constraint?)>
+
+<!--
+-->
+<!ELEMENT window (window-name,(instance-ref|content),properties?,region,height)>
+
+<!--
+-->
+<!ELEMENT content (content-type,content-uri)>
+
+<!--
+-->
+<!ELEMENT content-type #PCDATA>
+
+<!--
+-->
+<!ELEMENT content-uri #PCDATA>
Modified: trunk/core/src/resources/portal-core-sar/conf/data/default-object.xml
===================================================================
--- trunk/core/src/resources/portal-core-sar/conf/data/default-object.xml 2007-01-23
15:43:00 UTC (rev 6081)
+++ trunk/core/src/resources/portal-core-sar/conf/data/default-object.xml 2007-01-23
16:46:19 UTC (rev 6082)
@@ -91,10 +91,12 @@
</window>
<window>
<window-name>CMSWindow</window-name>
- <content-type>cms</content-type>
+ <content>
+ <content-type>cms</content-type>
+ <content-uri>/default/index.html</content-uri>
+ </content>
<region>center</region>
<height>0</height>
- <uri>/default/index.html</uri>
</window>
<window>
<window-name>UserPortletWindow</window-name>
@@ -263,10 +265,12 @@
</window>
<window>
<window-name>CMSWindow</window-name>
- <content-type>cms</content-type>
+ <content>
+ <content-type>cms</content-type>
+ <content-uri>/default/index.html</content-uri>
+ </content>
<region>center</region>
<height>0</height>
- <uri>/default/index.html</uri>
</window>
<window>
<window-name>UserPortletWindow</window-name>
Modified: trunk/core-cms/src/main/org/jboss/portal/core/cms/editor/CMSContentEditor.java
===================================================================
---
trunk/core-cms/src/main/org/jboss/portal/core/cms/editor/CMSContentEditor.java 2007-01-23
15:43:00 UTC (rev 6081)
+++
trunk/core-cms/src/main/org/jboss/portal/core/cms/editor/CMSContentEditor.java 2007-01-23
16:46:19 UTC (rev 6082)
@@ -82,8 +82,7 @@
for (int i = 0; i < files.length; i++)
{
String file = files[i];
- CMSContent content = (CMSContent)ctx.createWindow(ContentType.CMS);
- content.setURI(file);
+ CMSContent content = (CMSContent)ctx.createWindow(ContentType.CMS, file);
}
}
catch (Exception e)