[gatein-commits] gatein SVN: r6741 - in portal/trunk: component/portal/src/main/java/org/exoplatform/portal/config/serialize and 1 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Fri Jun 24 16:51:14 EDT 2011


Author: chris.laprun at jboss.com
Date: 2011-06-24 16:51:14 -0400 (Fri, 24 Jun 2011)
New Revision: 6741

Added:
   portal/trunk/component/portal/src/main/java/gatein_objects_1_2_1.xsd
Modified:
   portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/serialize/AbstractApplicationHandler.java
   portal/trunk/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/portal/group/platform/administrators/pages.xml
Log:
- GTNPORTAL-1946: Added <wsrp> element to GateIn objects model so that WSRP portlets can be specified in pages.xml files.

Copied: portal/trunk/component/portal/src/main/java/gatein_objects_1_2_1.xsd (from rev 6721, portal/trunk/component/portal/src/main/java/gatein_objects_1_2.xsd)
===================================================================
--- portal/trunk/component/portal/src/main/java/gatein_objects_1_2_1.xsd	                        (rev 0)
+++ portal/trunk/component/portal/src/main/java/gatein_objects_1_2_1.xsd	2011-06-24 20:51:14 UTC (rev 6741)
@@ -0,0 +1,222 @@
+<?xml version="1.0"?>
+<!--
+  ~ Copyright (C) 2009 eXo Platform SAS.
+  ~
+  ~ 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.
+  -->
+
+<xs:schema
+   targetNamespace="http://www.gatein.org/xml/ns/gatein_objects_1_2_1"
+   xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_2_1"
+   xmlns:xs="http://www.w3.org/2001/XMLSchema"
+   elementFormDefault="qualified"
+   attributeFormDefault="unqualified"
+   version="1.0">
+
+   <!-- A top page element -->
+   <xs:element name="page" type="pageType"/>
+
+   <!-- A top page-set element -->
+   <xs:element name="page-set" type="pageSetType"/>
+
+   <!-- A top portal-config element -->
+   <xs:element name="portal-config" type="portalConfigType"/>
+
+   <!-- A top container element -->
+   <xs:element name="container" type="containerType"/>
+
+   <!-- A top node-navigation element -->
+   <xs:element name="node-navigation" type="nodeNavigationType"/>
+
+   <!-- The type of a top navigation node -->
+   <xs:complexType name="nodeNavigationType">
+      <xs:sequence>
+         <xs:element name="priority" type="xs:positiveInteger"/>
+         <xs:element name="page-nodes" minOccurs="0" maxOccurs="1">
+            <xs:complexType>
+               <xs:sequence>
+                  <xs:element name="node" type="nodeType" minOccurs="0" maxOccurs="unbounded"/>
+               </xs:sequence>
+            </xs:complexType>
+         </xs:element>
+      </xs:sequence>
+   </xs:complexType>
+
+   <!-- The type of a navigation node -->
+   <xs:complexType name="nodeType">
+      <xs:sequence>
+         <xs:element name="uri" type="xs:string"/>
+         <xs:element name="name" type="xs:string"/>
+         <xs:element name="label" type="xs:string" minOccurs="0" maxOccurs="1"/>
+         <xs:element name="icon" type="xs:string" minOccurs="0" maxOccurs="1"/>
+         <xs:element name="start-publication-date" type="xs:string" minOccurs="0" maxOccurs="1"/>
+         <xs:element name="end-publication-date" type="xs:string" minOccurs="0" maxOccurs="1"/>
+         <xs:element name="visibility" type="visibility" default="DISPLAYED" minOccurs="0" maxOccurs="1"/>
+         <xs:element name="page-reference" type="xs:string" minOccurs="0" maxOccurs="1"/>
+         <xs:element name="node" type="nodeType" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:sequence>
+   </xs:complexType>
+
+   <xs:simpleType name="visibility">
+      <xs:restriction base='xs:string'>
+         <xs:enumeration value="DISPLAYED"/>
+         <xs:enumeration value="HIDDEN"/>
+         <xs:enumeration value="TEMPORAL"/>
+         <xs:enumeration value="SYSTEM"/>
+      </xs:restriction>
+   </xs:simpleType>
+
+   <xs:complexType name="pageSetType">
+      <xs:sequence>
+         <xs:element name="page" type="pageType" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:sequence>
+   </xs:complexType>
+
+   <xs:complexType name="portalConfigType">
+      <xs:sequence>
+         <xs:element name="portal-name" type="xs:string" minOccurs="1" maxOccurs="1"/>
+         <xs:element name="label" type="xs:string" minOccurs="0" maxOccurs="1"/>
+         <xs:element name="description" type="xs:string" minOccurs="0" maxOccurs="1"/>
+         <xs:element name="locale" type="xs:string" minOccurs="1" maxOccurs="1"/>
+         <xs:element name="access-permissions" type="xs:string" minOccurs="0" maxOccurs="1"/>
+         <xs:element name="edit-permission" type="xs:string" minOccurs="0" maxOccurs="1"/>
+         <xs:element name="skin" type="xs:string" minOccurs="0" maxOccurs="1"/>
+         <xs:element name="properties" type="propertiesType" minOccurs="0" maxOccurs="1"/>
+         <xs:element name="portal-layout" minOccurs="1" maxOccurs="1">
+            <xs:complexType>
+               <xs:group ref="containerChildrenGroup"/>
+            </xs:complexType>
+         </xs:element>
+      </xs:sequence>
+   </xs:complexType>
+
+   <xs:complexType name="propertiesType">
+      <xs:sequence minOccurs="0" maxOccurs="unbounded">
+         <xs:element name="entry" type="propertiesEntryType" minOccurs="1" maxOccurs="1"/>
+      </xs:sequence>
+   </xs:complexType>
+
+   <xs:complexType name="propertiesEntryType">
+      <xs:simpleContent>
+         <xs:extension base="xs:string">
+            <xs:attribute name="key" type="xs:string"/>
+         </xs:extension>
+      </xs:simpleContent>
+   </xs:complexType>
+
+   <xs:group name="containerChildrenGroup">
+      <xs:sequence>
+         <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element name="portlet-application" type="portletApplicationType" minOccurs="1" maxOccurs="1"/>
+            <xs:element name="gadget-application" type="gadgetApplicationType" minOccurs="1" maxOccurs="1"/>
+            <xs:element name="container" type="containerType" minOccurs="1" maxOccurs="1"/>
+            <xs:element name="page-body" type="xs:string" minOccurs="1" maxOccurs="1"/>
+            <xs:element name="site-body" type="xs:string" minOccurs="1" maxOccurs="1"/>
+         </xs:choice>
+      </xs:sequence>
+   </xs:group>
+
+   <xs:complexType name="pageType">
+      <xs:sequence>
+         <xs:element name="name" type="xs:string" minOccurs="1" maxOccurs="1"/>
+         <xs:element name="title" type="xs:string" minOccurs="0" maxOccurs="1"/>
+         <xs:element name="factory-id" type="xs:string" minOccurs="0" maxOccurs="1"/>
+         <xs:element name="access-permissions" type="xs:string" minOccurs="0" maxOccurs="1"/>
+         <xs:element name="edit-permission" type="xs:string" minOccurs="0" maxOccurs="1"/>
+         <xs:element name="show-max-window" type="xs:boolean" minOccurs="0" maxOccurs="1"/>
+         <xs:group ref="containerChildrenGroup"/>
+      </xs:sequence>
+   </xs:complexType>
+
+   <xs:complexType name="containerType">
+      <xs:sequence>
+         <xs:element name="name" type="xs:string" minOccurs="0" maxOccurs="1"/>
+         <xs:element name="title" type="xs:string" minOccurs="0" maxOccurs="1"/>
+         <xs:element name="icon" type="xs:string" minOccurs="0" maxOccurs="1"/>
+         <xs:element name="access-permissions" type="xs:string" minOccurs="0" maxOccurs="1"/>
+         <xs:element name="factory-id" type="xs:string" minOccurs="0" maxOccurs="1"/>
+         <xs:element name="description" type="xs:string" minOccurs="0" maxOccurs="1"/>
+         <xs:group ref="containerChildrenGroup"/>
+      </xs:sequence>
+      <xs:attribute name="id" type="xs:string"/>
+      <xs:attribute name="template" type="xs:string"/>
+      <xs:attribute name="attribute" type="xs:string"/>
+      <xs:attribute name="width" type="xs:string"/>
+      <xs:attribute name="height" type="xs:string"/>
+   </xs:complexType>
+
+   <xs:complexType name="portletApplicationType">
+      <xs:sequence>
+       <xs:choice>
+          <xs:element name="portlet" type="portletType"/>
+          <xs:element name="wsrp" type="xs:string"/>
+       </xs:choice>
+         <xs:element name="title" type="xs:string" minOccurs="0" maxOccurs="1"/>
+         <xs:element name="access-permissions" type="xs:string" minOccurs="1" maxOccurs="1"/>
+         <xs:element name="show-info-bar" type="xs:boolean" minOccurs="1" maxOccurs="1"/>
+         <xs:element name="show-application-state" type="xs:boolean" minOccurs="0" maxOccurs="1"/>
+         <xs:element name="show-application-mode" type="xs:boolean" minOccurs="0" maxOccurs="1"/>
+         <xs:element name="description" type="xs:string" minOccurs="0" maxOccurs="1"/>
+         <xs:element name="icon" type="xs:string" minOccurs="0" maxOccurs="1"/>
+         <xs:element name="width" type="xs:string" minOccurs="0" maxOccurs="1"/>
+         <xs:element name="height" type="xs:string" minOccurs="0" maxOccurs="1"/>
+      </xs:sequence>
+   </xs:complexType>
+
+   <xs:complexType name="gadgetApplicationType">
+      <xs:sequence>
+         <xs:element name="gadget" type="gadgetType" minOccurs="1" maxOccurs="1"/>
+         <xs:element name="theme" type="xs:string" minOccurs="0" maxOccurs="1"/>
+         <xs:element name="title" type="xs:string" minOccurs="0" maxOccurs="1"/>
+         <xs:element name="access-permissions" type="xs:string" minOccurs="1" maxOccurs="1"/>
+         <xs:element name="show-info-bar" type="xs:boolean" minOccurs="1" maxOccurs="1"/>
+         <xs:element name="show-application-state" type="xs:boolean" minOccurs="0" maxOccurs="1"/>
+         <xs:element name="show-application-mode" type="xs:boolean" minOccurs="0" maxOccurs="1"/>
+         <xs:element name="description" type="xs:string" minOccurs="0" maxOccurs="1"/>
+         <xs:element name="icon" type="xs:string" minOccurs="0" maxOccurs="1"/>
+         <xs:element name="width" type="xs:string" minOccurs="0" maxOccurs="1"/>
+         <xs:element name="height" type="xs:string" minOccurs="0" maxOccurs="1"/>
+      </xs:sequence>
+   </xs:complexType>
+
+   <xs:complexType name="portletType">
+      <xs:sequence>
+         <xs:element name="application-ref" type="xs:string" minOccurs="1" maxOccurs="1"/>
+         <xs:element name="portlet-ref" type="xs:string" minOccurs="1" maxOccurs="1"/>
+         <xs:element name="preferences" type="portletPreferencesType" minOccurs="0" maxOccurs="1"/>
+      </xs:sequence>
+   </xs:complexType>
+
+   <xs:complexType name="gadgetType">
+      <xs:sequence>
+         <xs:element name="gadget-ref" type="xs:string" minOccurs="1" maxOccurs="1"/>
+      </xs:sequence>
+   </xs:complexType>
+
+   <xs:complexType name="portletPreferencesType">
+      <xs:sequence>
+         <xs:element name="preference" type="portletPreferenceType" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:sequence>
+   </xs:complexType>
+
+   <xs:complexType name="portletPreferenceType">
+      <xs:sequence>
+         <xs:element name="name" type="xs:string" minOccurs="1" maxOccurs="1"/>
+         <xs:element name="value" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+         <xs:element name="read-only" type="xs:string" minOccurs="0" maxOccurs="1"/>
+      </xs:sequence>
+   </xs:complexType>
+</xs:schema>
\ No newline at end of file

Modified: portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/serialize/AbstractApplicationHandler.java
===================================================================
--- portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/serialize/AbstractApplicationHandler.java	2011-06-24 20:01:11 UTC (rev 6740)
+++ portal/trunk/component/portal/src/main/java/org/exoplatform/portal/config/serialize/AbstractApplicationHandler.java	2011-06-24 20:51:14 UTC (rev 6741)
@@ -102,6 +102,7 @@
 
       //
       Application<?> app;
+      TransientApplicationState state;
       if ("application".equals(m_name))
       {
          String instanceId = ctx.parseElementText(m_uri, "instance-id");
@@ -112,7 +113,6 @@
          String ownerId = instanceId.substring(i0 + 1, i1);
          String persistenceid = instanceId.substring(i1 + 2);
          String[] persistenceChunks = split("/", persistenceid);
-         TransientApplicationState<Portlet> state;
          if (persistenceChunks.length == 2)
          {
             state = new TransientApplicationState<Portlet>(
@@ -131,9 +131,8 @@
                ownerId,
                persistenceChunks[2]);
          }
-         Application<Portlet> application = Application.createPortletApplication();
-         application.setState(state);
-         app = application;
+         app = Application.createPortletApplication();
+         app.setState(state);
       }
       // Since we don't support dashboard's here, this only works for gadgets using the gadget wrapper portlet.
       else if ("gadget-application".equals(m_name))
@@ -144,18 +143,31 @@
          // Once the gadget portlet wrapper is able to use gadget userPref's, include parsing logic here.
          // Gadget gadget = new Gadget();
          // gadget.setUserPref();
-         TransientApplicationState<Gadget> state = new TransientApplicationState<Gadget>(gadgetName, gadget);
-         Application<Gadget> application = Application.createGadgetApplication();
-         application.setState(state);
-         app = application;
+         state = new TransientApplicationState<Gadget>(gadgetName, gadget);
+         app = Application.createGadgetApplication();
+         app.setState(state);
          ctx.parsePastEndTag(m_uri, "gadget");
       }
       else
       {
-         ctx.parsePastStartTag(m_uri, "portlet");
-         String applicationName = ctx.parseElementText(m_uri, "application-ref");
-         String portletName = ctx.parseElementText(m_uri, "portlet-ref");
-         TransientApplicationState<Portlet> state;
+         String contentId;
+         boolean isWSRP = false;
+         if(ctx.isAt(m_uri, "wsrp"))
+         {
+            contentId = ctx.parseElementText(m_uri, "wsrp");
+            app = Application.createWSRPApplication();
+            isWSRP = true;
+         }
+         else
+         {
+
+            ctx.parsePastStartTag(m_uri, "portlet");
+            String applicationName = ctx.parseElementText(m_uri, "application-ref");
+            String portletName = ctx.parseElementText(m_uri, "portlet-ref");
+            contentId = applicationName + "/" + portletName;
+            app = Application.createPortletApplication();
+         }
+
          if (ctx.isAt(m_uri, "preferences"))
          {
             PortletBuilder builder = new PortletBuilder();
@@ -166,16 +178,19 @@
                builder.add(value.getName(), value.getValues(), value.isReadOnly());
             }
             ctx.parsePastEndTag(m_uri, "preferences");
-            state = new TransientApplicationState<Portlet>(applicationName + "/" + portletName, builder.build());
+            state = new TransientApplicationState(contentId, builder.build());
          }
          else
          {
-            state = new TransientApplicationState<Portlet>(applicationName + "/" + portletName, null);
+            state = new TransientApplicationState(contentId, null);
          }
-         Application<Portlet> application = Application.createPortletApplication();
-         application.setState(state);
-         app = application;
-         ctx.parsePastEndTag(m_uri, "portlet");
+
+         if(!isWSRP)
+         {
+            ctx.parsePastEndTag(m_uri, "portlet");
+         }
+
+         app.setState(state);
       }
 
       //

Modified: portal/trunk/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/portal/group/platform/administrators/pages.xml
===================================================================
--- portal/trunk/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/portal/group/platform/administrators/pages.xml	2011-06-24 20:01:11 UTC (rev 6740)
+++ portal/trunk/wsrp-integration/extension-war/src/main/webapp/WEB-INF/conf/wsrp/portal/group/platform/administrators/pages.xml	2011-06-24 20:51:14 UTC (rev 6741)
@@ -24,8 +24,8 @@
 
 <page-set
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-   xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_1 http://www.gatein.org/xml/ns/gatein_objects_1_1"
-   xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_1">
+   xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_2_1 http://www.gatein.org/xml/ns/gatein_objects_1_2_1"
+   xmlns="http://www.gatein.org/xml/ns/gatein_objects_1_2_1">
 
    <page>
       <name>wsrpConfiguration</name>
@@ -41,6 +41,12 @@
          <access-permissions>manager:/platform/administrators</access-permissions>
          <show-info-bar>false</show-info-bar>
       </portlet-application>
+      <!--<portlet-application>
+         <wsrp>selfv2./richFacesPortlet.richFacesPortlet</wsrp>
+         <title>RichFaces</title>
+         <access-permissions>manager:/platform/administrators</access-permissions>
+         <show-info-bar>true</show-info-bar>
+      </portlet-application>-->
    </page>
 
 </page-set>



More information about the gatein-commits mailing list