JBoss Portal SVN: r6084 - in trunk: core/src/resources/portal-core-sar/conf/data and 3 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-01-23 12:53:38 -0500 (Tue, 23 Jan 2007)
New Revision: 6084
Modified:
trunk/core-cms/src/resources/portal-cms-war/WEB-INF/default-object.xml
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/default-object.xml
trunk/core/src/resources/dtd/portal-object_2_6.dtd
trunk/core/src/resources/portal-core-sar/conf/data/default-object.xml
trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/wsrp-object.xml
Log:
updated portal-object dtd for 2.6 and corrected the various -object.xml to use it correctly
Modified: trunk/core/src/resources/dtd/portal-object_2_6.dtd
===================================================================
--- trunk/core/src/resources/dtd/portal-object_2_6.dtd 2007-01-23 17:35:39 UTC (rev 6083)
+++ trunk/core/src/resources/dtd/portal-object_2_6.dtd 2007-01-23 17:53:38 UTC (rev 6084)
@@ -24,7 +24,7 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--
-<!DOCTYPE deployment PUBLIC
+<!DOCTYPE deployments PUBLIC
"-//JBoss Portal//DTD Portal Object 2.6//EN"
"http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
-->
@@ -49,22 +49,62 @@
<!--
-->
-<!ELEMENT context (context-name,properties?,portal*,security-constraint?)>
+<!ELEMENT context (context-name,properties?,portal*,listener?,security-constraint?)>
<!--
-->
-<!ELEMENT portal (portal-name,properties?,supported-modes?,supported-window-states?,(page|window)*,security-constraint?)>
+<!ELEMENT context-name #PCDATA>
<!--
-->
-<!ELEMENT page (page-name,properties?,(page|window)*,security-constraint?)>
+<!ELEMENT portal (portal-name,properties?,supported-modes?,supported-window-states?,(page|window)*,listener?,security-constraint?)>
<!--
-->
-<!ELEMENT window (window-name,(instance-ref|content),properties?,region,height)>
+<!ELEMENT supported-modes (mode*)>
<!--
-->
+<!ELEMENT mode #PCDATA>
+
+<!--
+-->
+<!ELEMENT supported-window-states (window-state*)>
+
+<!--
+-->
+<!ELEMENT window-state #PCDATA>
+
+<!--
+-->
+<!ELEMENT portal-name #PCDATA>
+
+<!--
+-->
+<!ELEMENT page (page-name,properties?,(page|window)*,listener?,security-constraint?)>
+
+<!--
+-->
+<!ELEMENT listener #PCDATA>
+
+<!--
+-->
+<!ELEMENT page-name #PCDATA>
+
+<!--
+-->
+<!ELEMENT window (window-name,(instance-ref|content),properties?,region,height,listener?)>
+
+<!--
+-->
+<!ELEMENT window-name #PCDATA>
+
+<!--
+-->
+<!ELEMENT instance-ref #PCDATA>
+
+<!--
+-->
<!ELEMENT content (content-type,content-uri)>
<!--
@@ -74,3 +114,47 @@
<!--
-->
<!ELEMENT content-uri #PCDATA>
+
+<!--
+-->
+<!ELEMENT region #PCDATA>
+
+<!--
+-->
+<!ELEMENT height #PCDATA>
+
+<!--
+-->
+<!ELEMENT properties (property*)>
+
+<!--
+-->
+<!ELEMENT property (name,value)>
+
+<!--
+-->
+<!ELEMENT name #PCDATA>
+
+<!--
+-->
+<!ELEMENT value #PCDATA>
+
+<!--
+-->
+<!ELEMENT security-constraint (policy-permission)>
+
+<!--
+-->
+<!ELEMENT policy-permission (action-name*,unchecked?,role-name*)>
+
+<!--
+-->
+<!ELEMENT action-name #PCDATA>
+
+<!--
+-->
+<!ELEMENT unchecked EMPTY>
+
+<!--
+-->
+<!ELEMENT role-name #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 17:35:39 UTC (rev 6083)
+++ trunk/core/src/resources/portal-core-sar/conf/data/default-object.xml 2007-01-23 17:53:38 UTC (rev 6084)
@@ -22,6 +22,10 @@
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<!DOCTYPE deployments PUBLIC
+ "-//JBoss Portal//DTD Portal Object 2.6//EN"
+ "http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
+
<deployments>
<deployment>
<parent-ref/>
Modified: trunk/core-cms/src/resources/portal-cms-war/WEB-INF/default-object.xml
===================================================================
--- trunk/core-cms/src/resources/portal-cms-war/WEB-INF/default-object.xml 2007-01-23 17:35:39 UTC (rev 6083)
+++ trunk/core-cms/src/resources/portal-cms-war/WEB-INF/default-object.xml 2007-01-23 17:53:38 UTC (rev 6084)
@@ -22,6 +22,10 @@
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<!DOCTYPE deployments PUBLIC
+ "-//JBoss Portal//DTD Portal Object 2.6//EN"
+ "http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
+
<deployments>
<deployment>
<parent-ref>admin</parent-ref>
Modified: trunk/core-samples/src/resources/portal-samples-war/WEB-INF/default-object.xml
===================================================================
--- trunk/core-samples/src/resources/portal-samples-war/WEB-INF/default-object.xml 2007-01-23 17:35:39 UTC (rev 6083)
+++ trunk/core-samples/src/resources/portal-samples-war/WEB-INF/default-object.xml 2007-01-23 17:53:38 UTC (rev 6084)
@@ -22,6 +22,10 @@
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<!DOCTYPE deployments PUBLIC
+ "-//JBoss Portal//DTD Portal Object 2.6//EN"
+ "http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
+
<deployments>
<deployment>
<parent-ref>default</parent-ref>
@@ -52,7 +56,6 @@
</window>
<page>
<page-name>event test</page-name>
- <listener>event_listener</listener>
<window>
<window-name>CatalogPortletWindow</window-name>
<instance-ref>CatalogPortletInstance</instance-ref>
@@ -71,10 +74,10 @@
<region>center</region>
<height>1</height>
</window>
+ <listener>event_listener</listener>
</page>
<page>
<page-name>page event test</page-name>
- <listener>window_event_listener</listener>
<window>
<window-name>CatalogPortletWindow1</window-name>
<instance-ref>CatalogPortletInstance</instance-ref>
@@ -111,6 +114,7 @@
<region>center</region>
<height>2</height>
</window>
+ <listener>window_event_listener</listener>
</page>
<page>
<page-name>secure test</page-name>
Modified: trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/wsrp-object.xml
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/wsrp-object.xml 2007-01-23 17:35:39 UTC (rev 6083)
+++ trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/wsrp-object.xml 2007-01-23 17:53:38 UTC (rev 6084)
@@ -22,6 +22,10 @@
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<!DOCTYPE deployments PUBLIC
+ "-//JBoss Portal//DTD Portal Object 2.6//EN"
+ "http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
+
<deployments>
<deployment>
<parent-ref>admin</parent-ref>
@@ -34,12 +38,12 @@
<region>center</region>
<height>0</height>
</window>
+ <security-constraint>
+ <policy-permission>
+ <role-name>Admin</role-name>
+ <action-name>viewrecursive</action-name>
+ </policy-permission>
+ </security-constraint>
</page>
- <security-constraint>
- <policy-permission>
- <role-name>Admin</role-name>
- <action-name>viewrecursive</action-name>
- </policy-permission>
- </security-constraint>
- </deployment>
+ </deployment>
</deployments>
17 years, 4 months
JBoss Portal SVN: r6083 - trunk/core/src/resources/dtd.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-01-23 12:35:39 -0500 (Tue, 23 Jan 2007)
New Revision: 6083
Added:
trunk/core/src/resources/dtd/jboss-app_2_6.dtd
Log:
jboss-app for 2.6, a mere copy of 2.0
Added: trunk/core/src/resources/dtd/jboss-app_2_6.dtd
===================================================================
--- trunk/core/src/resources/dtd/jboss-app_2_6.dtd (rev 0)
+++ trunk/core/src/resources/dtd/jboss-app_2_6.dtd 2007-01-23 17:35:39 UTC (rev 6083)
@@ -0,0 +1,41 @@
+<?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 jboss-app PUBLIC
+ "-//JBoss Portal//DTD JBoss Web Application 2.6//EN"
+ "http://www.jboss.org/portal/dtd/jboss-app_2_6.dtd">
+-->
+
+<!ELEMENT jboss-app (app-name?)>
+
+<!--
+When a web application is deployed, the context path under wich it is deployed is taken as application
+name. The application name value in this descriptor is used to override it. When a component references a
+references a portlet, it needs to reference the application too and if the portlet application war file is renammed
+the reference is not valid anymore. Therefore this tag is used to have an application name that does not depend
+upon the context path under which the application is deployed.
+-->
+<!ELEMENT app-name (#PCDATA)>
\ No newline at end of file
17 years, 4 months
JBoss Portal SVN: r6082 - in trunk: core/src/main/org/jboss/portal/core/impl/model/content/portlet and 12 other directories.
by portal-commits@lists.jboss.org
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)
17 years, 4 months
JBoss Portal SVN: r6081 - trunk/core/src/resources/dtd.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-01-23 10:43:00 -0500 (Tue, 23 Jan 2007)
New Revision: 6081
Modified:
trunk/core/src/resources/dtd/jboss-portlet_2_6.dtd
trunk/core/src/resources/dtd/portlet-instances_2_6.dtd
Log:
root element of dtd usage update
Modified: trunk/core/src/resources/dtd/jboss-portlet_2_6.dtd
===================================================================
--- trunk/core/src/resources/dtd/jboss-portlet_2_6.dtd 2007-01-23 15:39:08 UTC (rev 6080)
+++ trunk/core/src/resources/dtd/jboss-portlet_2_6.dtd 2007-01-23 15:43:00 UTC (rev 6081)
@@ -25,7 +25,7 @@
<!-- The additional configuration elements of the JBoss portlet container.
-<!DOCTYPE jboss-web PUBLIC
+<!DOCTYPE portlet-app PUBLIC
"-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
"http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
-->
Modified: trunk/core/src/resources/dtd/portlet-instances_2_6.dtd
===================================================================
--- trunk/core/src/resources/dtd/portlet-instances_2_6.dtd 2007-01-23 15:39:08 UTC (rev 6080)
+++ trunk/core/src/resources/dtd/portlet-instances_2_6.dtd 2007-01-23 15:43:00 UTC (rev 6081)
@@ -24,7 +24,7 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<!--
-<!DOCTYPE jboss-web PUBLIC
+<!DOCTYPE deployments PUBLIC
"-//JBoss Portal//DTD Portlet Instances 2.6//EN"
"http://www.jboss.org/portal/dtd/portlet-instances_2_6.dtd">
-->
17 years, 4 months
JBoss Portal SVN: r6080 - trunk/core/src/resources/dtd.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-01-23 10:39:08 -0500 (Tue, 23 Jan 2007)
New Revision: 6080
Added:
trunk/core/src/resources/dtd/portlet-instances_2_6.dtd
Log:
started portlet-instances.dtd, some elements are only stubed
Added: trunk/core/src/resources/dtd/portlet-instances_2_6.dtd
===================================================================
--- trunk/core/src/resources/dtd/portlet-instances_2_6.dtd (rev 0)
+++ trunk/core/src/resources/dtd/portlet-instances_2_6.dtd 2007-01-23 15:39:08 UTC (rev 6080)
@@ -0,0 +1,122 @@
+<?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 jboss-web PUBLIC
+ "-//JBoss Portal//DTD Portlet Instances 2.6//EN"
+ "http://www.jboss.org/portal/dtd/portlet-instances_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 (instance)>
+
+<!--
+The instance element is used to create an instance of a portlet from the portlet application of the same
+war file containing the portlet-instances.xml file. The portlet will be created and configured only
+if the portlet is present and an instance with such a name does not already exist.
+
+Example :
+
+<instance>
+ <instance-id>MyPortletInstance</instance-id>
+ <portlet-ref>MyPortlet</portlet-ref>
+ <preferences>
+ <preference>
+ <name>abc</name>
+ <value>def</value>
+ </preference>
+ </preferences>
+ <security-constraint>
+ <policy-permission>
+ <role-name>User</role-name>
+ <action-name>view</action-name>
+ </policy-permission>
+ </security-constraint>
+</instance>
+
+-->
+<!ELEMENT instance (instance-id,portlet-ref,preferences?security-constraint?)>
+
+<!--
+The identifier of the instance.
+-->
+<!ELEMENT instance-id #PCDATA>
+
+<!--
+The reference to the portlet which is its portlet name.
+-->
+<!ELEMENT portlet-ref #PCDATA>
+
+<!--
+The preferences element configures the instance with a specific set of preferences.
+-->
+<!ELEMENT preferences (preference)>
+
+<!--
+The preference configure one preference of a set of preferences.
+-->
+<!ELEMENT preference (name,value)>
+
+<!--
+A name.
+-->
+<!ELEMENT name #PCDATA>
+
+<!--
+A string value.
+-->
+<!ELEMENT value #PCDATA>
+
+<!--
+todo
+-->
+<!ELEMENT security-constraint (policy-permission)>
+
+<!--
+todo
+-->
+<!ELEMENT policy-permission (action-name*,unchecked?,role-name*)>
+
+<!--
+todo
+-->
+<!ELEMENT action-name #PCDATA>
+
+<!--
+todo
+-->
+<!ELEMENT unchecked EMPTY>
+
+<!--
+todo
+-->
+<!ELEMENT role-name #PCDATA>
17 years, 4 months
JBoss Portal SVN: r6079 - trunk/core/src/resources/dtd.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-01-23 10:14:24 -0500 (Tue, 23 Jan 2007)
New Revision: 6079
Modified:
trunk/core/src/resources/dtd/jboss-portlet_2_6.dtd
Log:
dtd for jboss-portlet.xml 2.6
Modified: trunk/core/src/resources/dtd/jboss-portlet_2_6.dtd
===================================================================
--- trunk/core/src/resources/dtd/jboss-portlet_2_6.dtd 2007-01-23 15:03:42 UTC (rev 6078)
+++ trunk/core/src/resources/dtd/jboss-portlet_2_6.dtd 2007-01-23 15:14:24 UTC (rev 6079)
@@ -33,10 +33,13 @@
<!--
The remotable element is used to configure the default behavior of the portlets with respect to WSRP
exposure.
+
For each portlet defined in portlet.xml, it is possible to configure specific settings
of the portlet container.
+
+It is also possible to inject services in the portlet context of the application using the service elements.
-->
-<!ELEMENT portlet-app (remotable?,portlet*)>
+<!ELEMENT portlet-app (remotable?,portlet*,service*)>
<!--
Additional configuration for a portlet.
@@ -115,3 +118,41 @@
todo
-->
<!ATTLIST meta name content CDATA #REQUIRED>
+
+<!--
+Declare a service that will be injected by the portlet container as an attribute of the portlet context.
+
+Example :
+
+<service>
+ <service-name>UserModule</service-name>
+ <service-class>org.jboss.portal.identity.UserModule</service-class>
+ <service-ref>:service=Module,type=User</service-ref>
+</service>
+
+In the portlet it is then possible to use it by doing a lookup on the service name, for example in the
+init() lifecycle method :
+
+public void init()
+{
+ UserModule userModule = (UserModule)getPortletContext().getAttribute("UserModule");
+}
+
+-->
+<!ELEMENT service (service-name,service-class,service-ref)>
+
+<!--
+The service name that will be used to bind the service as a portlet context attribute.
+-->
+<!ELEMENT service-name (#PCDATA)>
+
+<!--
+The full qualified name of the interface that the service implements.
+-->
+<!ELEMENT service-class (#PCDATA)>
+
+<!--
+The reference to the service. In the JMX Microkernel environment it consist of the JMX name of the service MBean.
+For an MBean reference if the domain is left out, then the current domain of the portal will be used.
+-->
+<!ELEMENT service-ref (#PCDATA)>
17 years, 4 months
JBoss Portal SVN: r6078 - trunk/core/src/resources/dtd.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-01-23 10:03:42 -0500 (Tue, 23 Jan 2007)
New Revision: 6078
Modified:
trunk/core/src/resources/dtd/jboss-portlet_2_6.dtd
Log:
dtd for jboss-portlet.xml 2.6
Modified: trunk/core/src/resources/dtd/jboss-portlet_2_6.dtd
===================================================================
--- trunk/core/src/resources/dtd/jboss-portlet_2_6.dtd 2007-01-23 14:42:13 UTC (rev 6077)
+++ trunk/core/src/resources/dtd/jboss-portlet_2_6.dtd 2007-01-23 15:03:42 UTC (rev 6078)
@@ -62,7 +62,7 @@
</portlet>
-->
-<!ELEMENT portlet (portlet-name,remotable?,trans-attribute?)>
+<!ELEMENT portlet (portlet-name,remotable?,trans-attribute?,header-content?)>
<!--
The portlet name.
@@ -79,3 +79,39 @@
Mandatory, Never, Supports, NotSupported and RequiresNew.
-->
<!ELEMENT trans-attribute (#PCDATA)>
+
+<!--
+Specify content which should be included in the portal aggregated page when the portlet is present
+on that page. This setting only applies when the portlet is used in the local mode.
+-->
+<!ELEMENT header-content (link|script|meta)*>
+
+<!--
+todo
+-->
+<!ELEMENT link>
+
+<!--
+todo
+-->
+<!ATTLIST link href title type media ref CDATA #IMPLIED>
+
+<!--
+todo
+-->
+<!ELEMENT script>
+
+<!--
+todo
+-->
+<!ATTLIST script src type CDATA #IMPLIED>
+
+<!--
+todo
+-->
+<!ELEMENT meta>
+
+<!--
+todo
+-->
+<!ATTLIST meta name content CDATA #REQUIRED>
17 years, 4 months
JBoss Portal SVN: r6077 - trunk/core/src/resources/dtd.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-01-23 09:42:13 -0500 (Tue, 23 Jan 2007)
New Revision: 6077
Modified:
trunk/core/src/resources/dtd/jboss-portlet_2_6.dtd
Log:
dtd for jboss-portlet.xml 2.6
Modified: trunk/core/src/resources/dtd/jboss-portlet_2_6.dtd
===================================================================
--- trunk/core/src/resources/dtd/jboss-portlet_2_6.dtd 2007-01-23 14:36:09 UTC (rev 6076)
+++ trunk/core/src/resources/dtd/jboss-portlet_2_6.dtd 2007-01-23 14:42:13 UTC (rev 6077)
@@ -23,7 +23,8 @@
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-<!--
+<!-- The additional configuration elements of the JBoss portlet container.
+
<!DOCTYPE jboss-web PUBLIC
"-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
"http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
@@ -40,12 +41,31 @@
<!--
Additional configuration for a portlet.
+The portlet-name defines the name of the portlet. It must match a portlet defined already in portlet.xml
+of the same web application.
+
+The remotable element configures the portlet exposure to WSRP. If no value is present then the value considered
+is either the value defined globally at the portlet application level or false.
+
+The trans-attribute value specifies the behavior of the portlet when it is invoked at runtime with
+respect to the transactionnal context. According to how the portlet is invoked a transaction may exist or not
+before the portlet is invoked. Usually in the local context the portal transaction could be present.
+By default the value considered is NotSupported which means that the portal transaction will be suspended
+for the duration of the portlet invocation.
+
+Example :
+
+<portlet>
+ <portlet-name>MyPortlet</portlet-name>
+ <remotable>true</remotable>
+ <trans-attribute>Required</trans-attribute>
+</portlet>
+
-->
<!ELEMENT portlet (portlet-name,remotable?,trans-attribute?)>
<!--
-The portlet name defines the name of the portlet. It must match a portlet defined already in portlet.xml
-of the same web application.
+The portlet name.
-->
<!ELEMENT portlet-name (#PCDATA)>
@@ -55,11 +75,7 @@
<!ELEMENT remotable (#PCDATA)>
<!--
-The trans-attribute value specifies the behavior of the portlet when it is invoked at runtime with
-respect to the transactionnal context. The accepted values are Required, Mandatory, Never, Supports,
-NotSupported and RequiresNew. According to how the portlet is invoked a transaction may exist or not
-before the portlet is invoked. Usually in the local context the portal transaction could be present.
-By default the value considered is NotSupported which means that the portal transaction will be suspended
-for the duration of the portlet invocation.
+The trans-attribute value defines the transactionnal behavior. The accepted values are Required,
+Mandatory, Never, Supports, NotSupported and RequiresNew.
-->
<!ELEMENT trans-attribute (#PCDATA)>
17 years, 4 months
JBoss Portal SVN: r6076 - in trunk/core/src/resources: portal-core-war/WEB-INF and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-01-23 09:36:09 -0500 (Tue, 23 Jan 2007)
New Revision: 6076
Added:
trunk/core/src/resources/dtd/jboss-portlet_2_6.dtd
Modified:
trunk/core/src/resources/portal-core-war/WEB-INF/jboss-portlet.xml
Log:
dtd for jboss-portlet.xml 2.6
Added: trunk/core/src/resources/dtd/jboss-portlet_2_6.dtd
===================================================================
--- trunk/core/src/resources/dtd/jboss-portlet_2_6.dtd (rev 0)
+++ trunk/core/src/resources/dtd/jboss-portlet_2_6.dtd 2007-01-23 14:36:09 UTC (rev 6076)
@@ -0,0 +1,65 @@
+<?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 jboss-web PUBLIC
+ "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
+ "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
+-->
+
+<!--
+The remotable element is used to configure the default behavior of the portlets with respect to WSRP
+exposure.
+For each portlet defined in portlet.xml, it is possible to configure specific settings
+of the portlet container.
+-->
+<!ELEMENT portlet-app (remotable?,portlet*)>
+
+<!--
+Additional configuration for a portlet.
+
+-->
+<!ELEMENT portlet (portlet-name,remotable?,trans-attribute?)>
+
+<!--
+The portlet name defines the name of the portlet. It must match a portlet defined already in portlet.xml
+of the same web application.
+-->
+<!ELEMENT portlet-name (#PCDATA)>
+
+<!--
+The remotable value is used for WSRP exposure. The accepted values are the litterals true of false.
+-->
+<!ELEMENT remotable (#PCDATA)>
+
+<!--
+The trans-attribute value specifies the behavior of the portlet when it is invoked at runtime with
+respect to the transactionnal context. The accepted values are Required, Mandatory, Never, Supports,
+NotSupported and RequiresNew. According to how the portlet is invoked a transaction may exist or not
+before the portlet is invoked. Usually in the local context the portal transaction could be present.
+By default the value considered is NotSupported which means that the portal transaction will be suspended
+for the duration of the portlet invocation.
+-->
+<!ELEMENT trans-attribute (#PCDATA)>
Modified: trunk/core/src/resources/portal-core-war/WEB-INF/jboss-portlet.xml
===================================================================
--- trunk/core/src/resources/portal-core-war/WEB-INF/jboss-portlet.xml 2007-01-23 13:12:46 UTC (rev 6075)
+++ trunk/core/src/resources/portal-core-war/WEB-INF/jboss-portlet.xml 2007-01-23 14:36:09 UTC (rev 6076)
@@ -48,12 +48,6 @@
</transaction>
</portlet>
<portlet>
- <portlet-name>ThemeManager</portlet-name>
- <transaction>
- <trans-attribute>Required</trans-attribute>
- </transaction>
- </portlet>
- <portlet>
<portlet-name>CatalogPortlet</portlet-name>
<transaction>
<trans-attribute>Required</trans-attribute>
@@ -69,26 +63,12 @@
</transaction>
</portlet>
<portlet>
- <portlet-name>PolicyConfiguratorPortlet</portlet-name>
- <security-constraint>
- <policy-permission>
- <role-name>Admin</role-name>
- <action-name>view</action-name>
- </policy-permission>
- </security-constraint>
- </portlet>
- <portlet>
- <portlet-name>ThemeSelectorPortlet</portlet-name>
- <transaction>
- <trans-attribute>Required</trans-attribute>
- </transaction>
- </portlet>
- <portlet>
<portlet-name>ConfiguratorPortlet</portlet-name>
<transaction>
<trans-attribute>Required</trans-attribute>
</transaction>
</portlet>
+
<!-- Service injected in the portlet context. -->
<service>
<service-name>PortalObjectContainer</service-name>
17 years, 4 months
JBoss Portal SVN: r6075 - trunk/core/src/main/org/jboss/portal/core/impl/mail.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-01-23 08:12:46 -0500 (Tue, 23 Jan 2007)
New Revision: 6075
Modified:
trunk/core/src/main/org/jboss/portal/core/impl/mail/MailModuleImpl.java
Log:
use synchronized long in MailModuleImpl instead of int for the serial id
Modified: trunk/core/src/main/org/jboss/portal/core/impl/mail/MailModuleImpl.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/mail/MailModuleImpl.java 2007-01-23 13:00:22 UTC (rev 6074)
+++ trunk/core/src/main/org/jboss/portal/core/impl/mail/MailModuleImpl.java 2007-01-23 13:12:46 UTC (rev 6075)
@@ -26,6 +26,7 @@
import EDU.oswego.cs.dl.util.concurrent.Channel;
import EDU.oswego.cs.dl.util.concurrent.LinkedQueue;
import EDU.oswego.cs.dl.util.concurrent.QueuedExecutor;
+import EDU.oswego.cs.dl.util.concurrent.SynchronizedLong;
import org.apache.log4j.Logger;
import org.jboss.logging.util.LoggerStream;
import org.jboss.portal.core.modules.AbstractModule;
@@ -97,7 +98,7 @@
private LoggerStream logs;
/** A serial id used to track messages locally. */
- private int currentSerialId = 0;
+ private final SynchronizedLong currentSerialId = new SynchronizedLong(0);
public int getSMTPConnectionTimeout()
{
@@ -119,9 +120,9 @@
this.SMTPTimeout = SMTPTimeout;
}
- public int getCurrentSerialId()
+ public long getCurrentSerialId()
{
- return currentSerialId;
+ return currentSerialId.get();
}
public String getGateway()
@@ -297,7 +298,7 @@
}
}
- public boolean deliver(int serialId,
+ public boolean deliver(long serialId,
String from,
String to,
String subject,
@@ -323,7 +324,7 @@
return delivered;
}
- private boolean deliver(int serialId,
+ private boolean deliver(long serialId,
String host,
String from,
String to,
@@ -407,7 +408,7 @@
private class MyMessage
implements Runnable
{
- public final int serialId;
+ public final long serialId;
public final String from;
@@ -422,7 +423,7 @@
String subject,
String body)
{
- this.serialId = currentSerialId++;
+ this.serialId = currentSerialId.increment();
this.from = from;
this.to = to;
this.subject = subject;
17 years, 4 months