gatein SVN: r932 - in portal/trunk/component/application-registry/src/main/java: org/exoplatform/application/gadget/impl and 1 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2009-12-04 14:58:27 -0500 (Fri, 04 Dec 2009)
New Revision: 932
Modified:
portal/trunk/component/application-registry/src/main/java/conf/application-nodetypes.xml
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetDefinition.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetRegistry.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/LocalGadgetData.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/RemoteGadgetData.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/CategoryDefinition.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/ContentDefinition.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/ContentRegistry.java
Log:
rename mop: namespace to app: namespace for the application registry related node types
Modified: portal/trunk/component/application-registry/src/main/java/conf/application-nodetypes.xml
===================================================================
--- portal/trunk/component/application-registry/src/main/java/conf/application-nodetypes.xml 2009-12-04 19:49:40 UTC (rev 931)
+++ portal/trunk/component/application-registry/src/main/java/conf/application-nodetypes.xml 2009-12-04 19:58:27 UTC (rev 932)
@@ -20,22 +20,22 @@
-->
<nodeTypes xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0">
- <nodeType name="mop:gadgetregistry" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <nodeType name="app:gadgetregistry" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
<supertypes>
<supertype>nt:base</supertype>
<supertype>mix:referenceable</supertype>
</supertypes>
<childNodeDefinitions>
- <childNodeDefinition name="*" defaultPrimaryType="mop:gadgetdefinition" autoCreated="false" mandatory="false"
+ <childNodeDefinition name="*" defaultPrimaryType="app:gadgetdefinition" autoCreated="false" mandatory="false"
onParentVersion="COPY" protected="false" sameNameSiblings="false">
<requiredPrimaryTypes>
- <requiredPrimaryType>mop:gadgetdefinition</requiredPrimaryType>
+ <requiredPrimaryType>app:gadgetdefinition</requiredPrimaryType>
</requiredPrimaryTypes>
</childNodeDefinition>
</childNodeDefinitions>
</nodeType>
- <nodeType name="mop:gadgetdefinition" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <nodeType name="app:gadgetdefinition" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
<supertypes>
<supertype>nt:base</supertype>
<supertype>mix:referenceable</supertype>
@@ -55,25 +55,25 @@
</propertyDefinition>
</propertyDefinitions>
<childNodeDefinitions>
- <childNodeDefinition name="data" defaultPrimaryType="mop:gadgetdata" autoCreated="false" mandatory="true"
+ <childNodeDefinition name="data" defaultPrimaryType="app:gadgetdata" autoCreated="false" mandatory="true"
onParentVersion="COPY" protected="false" sameNameSiblings="false">
<requiredPrimaryTypes>
- <requiredPrimaryType>mop:gadgetdata</requiredPrimaryType>
+ <requiredPrimaryType>app:gadgetdata</requiredPrimaryType>
</requiredPrimaryTypes>
</childNodeDefinition>
</childNodeDefinitions>
</nodeType>
- <nodeType name="mop:gadgetdata" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <nodeType name="app:gadgetdata" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
<supertypes>
<supertype>nt:base</supertype>
<supertype>mix:referenceable</supertype>
</supertypes>
</nodeType>
- <nodeType name="mop:localgadgetdata" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <nodeType name="app:localgadgetdata" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
<supertypes>
- <supertype>mop:gadgetdata</supertype>
+ <supertype>app:gadgetdata</supertype>
</supertypes>
<propertyDefinitions>
<propertyDefinition name="filename" requiredType="String" autoCreated="false" mandatory="true" onParentVersion="COPY" protected="false" multiple="false">
@@ -90,9 +90,9 @@
</childNodeDefinitions>
</nodeType>
- <nodeType name="mop:remotegadgetdata" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <nodeType name="app:remotegadgetdata" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
<supertypes>
- <supertype>mop:gadgetdata</supertype>
+ <supertype>app:gadgetdata</supertype>
</supertypes>
<propertyDefinitions>
<propertyDefinition name="url" requiredType="String" autoCreated="false" mandatory="true" onParentVersion="COPY" protected="false" multiple="false">
@@ -101,22 +101,22 @@
</propertyDefinitions>
</nodeType>
- <nodeType name="mop:contentregistry" isMixin="false" hasOrderableChildNodes="true" primaryItemName="">
+ <nodeType name="app:contentregistry" isMixin="false" hasOrderableChildNodes="true" primaryItemName="">
<supertypes>
<supertype>nt:base</supertype>
<supertype>mix:referenceable</supertype>
</supertypes>
<childNodeDefinitions>
- <childNodeDefinition name="*" defaultPrimaryType="mop:contentcategory" autoCreated="false" mandatory="false"
+ <childNodeDefinition name="*" defaultPrimaryType="app:contentcategory" autoCreated="false" mandatory="false"
onParentVersion="COPY" protected="false" sameNameSiblings="false">
<requiredPrimaryTypes>
- <requiredPrimaryType>mop:contentcategory</requiredPrimaryType>
+ <requiredPrimaryType>app:contentcategory</requiredPrimaryType>
</requiredPrimaryTypes>
</childNodeDefinition>
</childNodeDefinitions>
</nodeType>
- <nodeType name="mop:contentcategory" isMixin="false" hasOrderableChildNodes="true" primaryItemName="">
+ <nodeType name="app:contentcategory" isMixin="false" hasOrderableChildNodes="true" primaryItemName="">
<supertypes>
<supertype>nt:base</supertype>
<supertype>mix:referenceable</supertype>
@@ -139,16 +139,16 @@
</propertyDefinition>
</propertyDefinitions>
<childNodeDefinitions>
- <childNodeDefinition name="*" defaultPrimaryType="mop:content" autoCreated="false" mandatory="false"
+ <childNodeDefinition name="*" defaultPrimaryType="app:content" autoCreated="false" mandatory="false"
onParentVersion="COPY" protected="false" sameNameSiblings="false">
<requiredPrimaryTypes>
- <requiredPrimaryType>mop:content</requiredPrimaryType>
+ <requiredPrimaryType>app:content</requiredPrimaryType>
</requiredPrimaryTypes>
</childNodeDefinition>
</childNodeDefinitions>
</nodeType>
- <nodeType name="mop:content" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <nodeType name="app:content" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
<supertypes>
<supertype>nt:base</supertype>
<supertype>mix:referenceable</supertype>
Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetDefinition.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetDefinition.java 2009-12-04 19:49:40 UTC (rev 931)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetDefinition.java 2009-12-04 19:58:27 UTC (rev 932)
@@ -29,7 +29,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-@NodeMapping(name = "mop:gadgetdefinition")
+@NodeMapping(name = "app:gadgetdefinition")
public abstract class GadgetDefinition
{
Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetRegistry.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetRegistry.java 2009-12-04 19:49:40 UTC (rev 931)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetRegistry.java 2009-12-04 19:58:27 UTC (rev 932)
@@ -29,7 +29,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-@NodeMapping(name = "mop:gadgetregistry")
+@NodeMapping(name = "app:gadgetregistry")
public abstract class GadgetRegistry
{
Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/LocalGadgetData.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/LocalGadgetData.java 2009-12-04 19:49:40 UTC (rev 931)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/LocalGadgetData.java 2009-12-04 19:58:27 UTC (rev 932)
@@ -40,7 +40,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-@NodeMapping(name = "mop:localgadgetdata")
+@NodeMapping(name = "app:localgadgetdata")
public abstract class LocalGadgetData extends GadgetData implements NodeAware
{
Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/RemoteGadgetData.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/RemoteGadgetData.java 2009-12-04 19:49:40 UTC (rev 931)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/RemoteGadgetData.java 2009-12-04 19:58:27 UTC (rev 932)
@@ -25,7 +25,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-@NodeMapping(name = "mop:remotegadgetdata")
+@NodeMapping(name = "app:remotegadgetdata")
public abstract class RemoteGadgetData extends GadgetData
{
Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/CategoryDefinition.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/CategoryDefinition.java 2009-12-04 19:49:40 UTC (rev 931)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/CategoryDefinition.java 2009-12-04 19:58:27 UTC (rev 932)
@@ -36,7 +36,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-@NodeMapping(name = "mop:contentcategory")
+@NodeMapping(name = "app:contentcategory")
public abstract class CategoryDefinition
{
Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/ContentDefinition.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/ContentDefinition.java 2009-12-04 19:49:40 UTC (rev 931)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/ContentDefinition.java 2009-12-04 19:58:27 UTC (rev 932)
@@ -34,7 +34,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-@NodeMapping(name = "mop:content")
+@NodeMapping(name = "app:content")
public abstract class ContentDefinition
{
Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/ContentRegistry.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/ContentRegistry.java 2009-12-04 19:49:40 UTC (rev 931)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/ContentRegistry.java 2009-12-04 19:58:27 UTC (rev 932)
@@ -29,7 +29,7 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-@NodeMapping(name = "mop:contentregistry")
+@NodeMapping(name = "app:contentregistry")
public abstract class ContentRegistry
{
15 years
gatein SVN: r931 - portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2009-12-04 14:49:40 -0500 (Fri, 04 Dec 2009)
New Revision: 931
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.tmpl.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.xml
Log:
remove gadget workspace
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.tmpl.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.tmpl.xml 2009-12-04 18:33:00 UTC (rev 930)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.tmpl.xml 2009-12-04 19:49:40 UTC (rev 931)
@@ -120,53 +120,6 @@
</persister>
</lock-manager>
</workspace>
- <workspace name="gadgets">
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcexo${container.name.suffix}"/>
- <property name="dialect" value="${dialect}"/>
- <property name="multi-db" value="false"/>
- <property name="update-storage" value="true"/>
- <property name="max-buffer-size" value="204800"/>
- <property name="swap-directory" value="../temp/swap/gadgets${container.name.suffix}"/>
- </properties>
- <value-storages>
- <value-storage id="gadgets" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="../temp/values/gadgets${container.name.suffix}"/>
- </properties>
- <filters>
- <filter property-type="Binary"/>
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype" value="nt:unstructured"/>
- <property name="root-permissions" value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove"/>
- </properties>
- </initializer>
- <cache enabled="true">
- <properties>
- <property name="max-size" value="20000"/>
- <property name="live-time" value="30000"/>
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="../temp/jcrlucenedb/gadgets${container.name.suffix}"/>
- </properties>
- </query-handler>
- <lock-manager>
- <time-out>15m</time-out><!-- 15min -->
- <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
- <properties>
- <property name="path" value="../temp/lock/gadgets${container.name.suffix}"/>
- </properties>
- </persister>
- </lock-manager>
- </workspace>
</workspaces>
</repository>
</repositories>
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.xml 2009-12-04 18:33:00 UTC (rev 930)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.xml 2009-12-04 19:49:40 UTC (rev 931)
@@ -120,53 +120,6 @@
</persister>
</lock-manager>
</workspace>
- <workspace name="gadgets">
- <container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
- <properties>
- <property name="source-name" value="jdbcexo${container.name.suffix}"/>
- <property name="dialect" value="hsqldb"/>
- <property name="multi-db" value="false"/>
- <property name="update-storage" value="true"/>
- <property name="max-buffer-size" value="204800"/>
- <property name="swap-directory" value="../temp/swap/gadgets${container.name.suffix}"/>
- </properties>
- <value-storages>
- <value-storage id="gadgets" class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
- <properties>
- <property name="path" value="../temp/values/gadgets${container.name.suffix}"/>
- </properties>
- <filters>
- <filter property-type="Binary"/>
- </filters>
- </value-storage>
- </value-storages>
- </container>
- <initializer class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
- <properties>
- <property name="root-nodetype" value="nt:unstructured"/>
- <property name="root-permissions" value="any read;*:/platform/administrators read;*:/platform/administrators add_node;*:/platform/administrators set_property;*:/platform/administrators remove"/>
- </properties>
- </initializer>
- <cache enabled="true">
- <properties>
- <property name="max-size" value="20000"/>
- <property name="live-time" value="30000"/>
- </properties>
- </cache>
- <query-handler class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
- <properties>
- <property name="index-dir" value="../temp/jcrlucenedb/gadgets${container.name.suffix}"/>
- </properties>
- </query-handler>
- <lock-manager>
- <time-out>15m</time-out>
- <persister class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
- <properties>
- <property name="path" value="../temp/lock/gadgets${container.name.suffix}"/>
- </properties>
- </persister>
- </lock-manager>
- </workspace>
</workspaces>
</repository>
</repositories>
15 years
gatein SVN: r930 - in portal/trunk: component/application-registry/src/main/java/org/exoplatform/application/gadget and 3 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2009-12-04 13:33:00 -0500 (Fri, 04 Dec 2009)
New Revision: 930
Removed:
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/GadgetRegister.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/jcr/
portal/trunk/component/portal/src/main/java/conf/portal/model-nodetypes.xml
Modified:
portal/trunk/component/application-registry/src/main/java/conf/portal/configuration.xml
portal/trunk/component/application-registry/src/test/java/conf/portal/test-configuration.xml
portal/trunk/component/portal/src/main/java/conf/portal/configuration.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/application-registry-configuration.xml
Log:
remove legacy gadget persistence
Modified: portal/trunk/component/application-registry/src/main/java/conf/portal/configuration.xml
===================================================================
--- portal/trunk/component/application-registry/src/main/java/conf/portal/configuration.xml 2009-12-04 18:07:13 UTC (rev 929)
+++ portal/trunk/component/application-registry/src/main/java/conf/portal/configuration.xml 2009-12-04 18:33:00 UTC (rev 930)
@@ -40,19 +40,4 @@
<type>org.exoplatform.application.registry.mop.MOPApplicationRegistryService</type>
</component>
-
- <component>
- <key>org.exoplatform.application.gadget.SourceStorage</key>
- <type>org.exoplatform.application.gadget.jcr.SourceStorageImpl</type>
- <init-params>
- <properties-param>
- <name>location</name>
- <description>The location store source of gadgets</description>
- <property name="repository" value="repository"></property>
- <property name="workspace" value="gadgets"></property>
- <property name="store.path" value="/"></property>
- </properties-param>
- </init-params>
- </component>
-
</configuration>
Deleted: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/GadgetRegister.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/GadgetRegister.java 2009-12-04 18:07:13 UTC (rev 929)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/GadgetRegister.java 2009-12-04 18:33:00 UTC (rev 930)
@@ -1,215 +0,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.
- */
-
-package org.exoplatform.application.gadget;
-
-import org.apache.commons.io.IOUtils;
-import org.apache.shindig.common.uri.Uri;
-import org.apache.shindig.gadgets.spec.ModulePrefs;
-import org.exoplatform.container.PortalContainer;
-import org.exoplatform.container.RootContainer.PortalContainerPostInitTask;
-import org.exoplatform.services.log.ExoLogger;
-import org.exoplatform.services.log.Log;
-import org.exoplatform.web.application.gadget.GadgetApplication;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.Calendar;
-
-import javax.servlet.ServletContext;
-import javax.servlet.ServletContextEvent;
-import javax.servlet.ServletContextListener;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-/**
- * Created by The eXo Platform SAS
- * Author : dang.tung
- * tungcnw(a)gmail.com
- * May 15, 2008
- */
-/**
- * This class represents an registry for gadget application, it hear from context and then deployed
- * gadget
- */
-public class GadgetRegister implements ServletContextListener
-{
- protected static Log log = ExoLogger.getLogger("gadget:GadgetRegister");
-
- /**
- * Initializes the listener and each time a new gadget application war is deployed the gadgets
- * are added into the JCR node by GadgetRegistryService
- * @throws Exception when can't parse xml file
- */
- public void contextInitialized(ServletContextEvent event)
- {
- final PortalContainerPostInitTask task = new PortalContainerPostInitTask()
- {
-
- public void execute(ServletContext context, PortalContainer portalContainer)
- {
- contextInitialized(context, portalContainer);
- }
- };
- PortalContainer.addInitTask(event.getServletContext(), task);
- }
-
- private void contextInitialized(ServletContext context, PortalContainer pcontainer)
- {
- try
- {
- SourceStorage sourceStorage = (SourceStorage)pcontainer.getComponentInstanceOfType(SourceStorage.class);
- GadgetRegistryService gadgetService =
- (GadgetRegistryService)pcontainer.getComponentInstanceOfType(GadgetRegistryService.class);
- String confLocation = "/WEB-INF/gadget.xml";
- DocumentBuilder db = DocumentBuilderFactory.newInstance().newDocumentBuilder();
- InputStream in = context.getResourceAsStream(confLocation);
- Document docXML = db.parse(in);
- NodeList nodeList = docXML.getElementsByTagName("gadget");
- String gadgetName = null, address = null;
- for (int i = 0; i < nodeList.getLength(); i++)
- {
- Element gadgetElement = (Element)nodeList.item(i);
- gadgetName = gadgetElement.getAttribute("name");
- if (gadgetService.getGadget(gadgetName) != null)
- continue;
- try
- {
- NodeList nodeChild = gadgetElement.getChildNodes();
- for (int j = 0; j < nodeChild.getLength(); j++)
- {
- Node node = nodeChild.item(j);
- address = node.getTextContent();
- if (node.getNodeName().equals("path"))
- {
- InputStream sourceIs = context.getResourceAsStream(address);
- String realPath = context.getRealPath(address);
- File sourceFile = new File(realPath);
- File homeDir = sourceFile.getParentFile();
- String fileName = sourceFile.getName();
- //Saves source of gadget
- Source source = new Source(fileName, getMimeType(context, fileName));
-// source.setStreamContent(sourceIs);
- source.setLastModified(Calendar.getInstance());
- String homeName = homeDir.getName();
- // sourceStorage.saveSource(homeName, source);
- //Saves gadget
- ModulePrefs prefs =
- GadgetApplication.getModulePreferences(Uri.parse("http://www.exoplatform.org"), source
- .getTextContent());
- Gadget gadget = new Gadget();
- gadget.setName(gadgetName);
- // gadget.setUrl(sourceStorage.getSourceURI(homeName + "/" + fileName));
- gadget.setTitle(getGadgetTitle(prefs, gadget.getName()));
- gadget.setDescription(prefs.getDescription());
- gadget.setThumbnail(prefs.getThumbnail().toString());
- gadget.setReferenceUrl(prefs.getTitleUrl().toString());
- gadget.setLocal(true);
- gadgetService.saveGadget(gadget);
- //Saves source's included
- // int dotIdx = address.lastIndexOf('.');
- // if(dotIdx < 0) continue;
- // String dirPath = address.substring(0, dotIdx);
- if (homeDir.exists() && homeDir.isDirectory())
- {
- File[] files = homeDir.listFiles();
- for (int k = 0; k < files.length; k++)
- {
- saveTree(files[k], homeName, context, sourceStorage);
- }
- }
- }
- else if (node.getNodeName().equals("url"))
- {
- URL urlObj = new URL(address);
- URLConnection conn = urlObj.openConnection();
- InputStream is = conn.getInputStream();
- String source = IOUtils.toString(is, "UTF-8");
- ModulePrefs prefs = GadgetApplication.getModulePreferences(Uri.parse(address), source);
- Gadget gadget = new Gadget();
- gadget.setName(gadgetName);
- gadget.setUrl(address);
- gadget.setTitle(getGadgetTitle(prefs, gadget.getName()));
- gadget.setDescription(prefs.getDescription());
- gadget.setThumbnail(prefs.getThumbnail().toString());
- gadget.setReferenceUrl(prefs.getTitleUrl().toString());
- gadget.setLocal(false);
- gadgetService.saveGadget(gadget);
- }
- }
- }
- catch (Exception ex)
- {
- log.warn("Can not register the gadget: '" + gadgetName + "' ");
- }
- }
- }
- catch (Exception ex)
- {
- log.error("Error while deploying a gadget", ex);
- }
- }
-
- private void saveTree(File file, String savePath, ServletContext context, SourceStorage storage) throws Exception
- {
- if (file.isFile())
- {
- Source includedSource = new Source(file.getName(), getMimeType(context, file.getName()));
-// includedSource.setStreamContent(new FileInputStream(file));
- includedSource.setLastModified(Calendar.getInstance());
- // storage.saveSource(savePath, includedSource);
- }
- else if (file.isDirectory())
- {
- File[] files = file.listFiles();
- String childPath = savePath + "/" + file.getName();
- for (int i = 0; i < files.length; i++)
- saveTree(files[i], childPath, context, storage);
- }
- }
-
- private String getGadgetTitle(ModulePrefs prefs, String defaultValue)
- {
- String title = prefs.getDirectoryTitle();
- if (title == null || title.trim().length() < 1)
- title = prefs.getTitle();
- if (title == null || title.trim().length() < 1)
- return defaultValue;
- return title;
- }
-
- private String getMimeType(ServletContext context, String fileName)
- {
- return (context.getMimeType(fileName) != null) ? context.getMimeType(fileName) : "text/plain";
- }
-
- /**
- * Destroys the listener context
- */
- public void contextDestroyed(ServletContextEvent servletContextEvent)
- {
- }
-}
\ No newline at end of file
Modified: portal/trunk/component/application-registry/src/test/java/conf/portal/test-configuration.xml
===================================================================
--- portal/trunk/component/application-registry/src/test/java/conf/portal/test-configuration.xml 2009-12-04 18:07:13 UTC (rev 929)
+++ portal/trunk/component/application-registry/src/test/java/conf/portal/test-configuration.xml 2009-12-04 18:33:00 UTC (rev 930)
@@ -223,56 +223,6 @@
</component-plugins>
</component>
- <component>
- <key>org.exoplatform.application.gadget.GadgetRegistryService</key>
- <type>org.exoplatform.application.gadget.jcr.GadgetRegistryServiceImpl</type>
- <init-params>
- <value-param>
- <name>gadgets.country</name>
- <description>US</description>
- <value>US</value>
- </value-param>
-
- <value-param>
- <name>gadgets.language</name>
- <description>en</description>
- <value>en</value>
- </value-param>
-
- <value-param>
- <name>gadgets.moduleId</name>
- <description>0</description>
- <value>0</value>
- </value-param>
-
- <value-param>
- <name>gadgets.hostName</name>
- <description>Gadget server url</description>
- <value>http://localhost:8080</value>
- </value-param>
-
- <properties-param>
- <name>developerInfo</name>
- <description>The group that is allowed to develop gadgets</description>
- <property name="developer.group" value="/platform/administrators"></property>
- </properties-param>
- </init-params>
- </component>
-
- <component>
- <key>org.exoplatform.application.gadget.SourceStorage</key>
- <type>org.exoplatform.application.gadget.jcr.SourceStorageImpl</type>
- <init-params>
- <properties-param>
- <name>location</name>
- <description>The location store source of gadgets</description>
- <property name="repository" value="repository"></property>
- <property name="workspace" value="collaboration"></property>
- <property name="store.path" value="/"></property>
- </properties-param>
- </init-params>
- </component>
-
<external-component-plugins>
<target-component>org.exoplatform.services.naming.InitialContextInitializer</target-component>
<component-plugin>
Modified: portal/trunk/component/portal/src/main/java/conf/portal/configuration.xml
===================================================================
--- portal/trunk/component/portal/src/main/java/conf/portal/configuration.xml 2009-12-04 18:07:13 UTC (rev 929)
+++ portal/trunk/component/portal/src/main/java/conf/portal/configuration.xml 2009-12-04 18:33:00 UTC (rev 930)
@@ -97,20 +97,5 @@
<component>
<type>org.exoplatform.portal.resource.SkinService</type>
</component>
-
- <external-component-plugins>
- <target-component>org.exoplatform.services.jcr.RepositoryService</target-component>
- <component-plugin>
- <name>add.nodeType</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.jcr.impl.AddNodeTypePlugin</type>
- <init-params>
- <values-param>
- <name>autoCreatedInNewRepository</name>
- <value>jar:/conf/portal/model-nodetypes.xml</value>
- </values-param>
- </init-params>
- </component-plugin>
- </external-component-plugins>
</configuration>
Deleted: portal/trunk/component/portal/src/main/java/conf/portal/model-nodetypes.xml
===================================================================
--- portal/trunk/component/portal/src/main/java/conf/portal/model-nodetypes.xml 2009-12-04 18:07:13 UTC (rev 929)
+++ portal/trunk/component/portal/src/main/java/conf/portal/model-nodetypes.xml 2009-12-04 18:33:00 UTC (rev 930)
@@ -1,36 +0,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.
-
--->
-
-<nodeTypes xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0"
- xmlns:jcr="http://www.jcp.org/jcr/1.0">
-
- <nodeType name="exo:gadget" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
- <supertypes>
- <supertype>nt:unstructured</supertype>
- </supertypes>
- <propertyDefinitions>
- <!--propertyDefinition name="data" requiredType="Binary" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
- <valueConstraints/>
- </propertyDefinition-->
- </propertyDefinitions>
- </nodeType>
-
-</nodeTypes>
\ No newline at end of file
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/application-registry-configuration.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/application-registry-configuration.xml 2009-12-04 18:07:13 UTC (rev 929)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/application-registry-configuration.xml 2009-12-04 18:33:00 UTC (rev 930)
@@ -22,61 +22,11 @@
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd" xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+ <component>
+ <key>org.exoplatform.application.gadget.SourceStorage</key>
+ <type>org.exoplatform.application.gadget.impl.SourceStorageImpl</type>
+ </component>
-<!--
- <component>
- <key>org.exoplatform.application.gadget.GadgetRegistryService</key>
- <type>org.exoplatform.application.gadget.jcr.GadgetRegistryServiceImpl</type>
- <init-params>
- <value-param>
- <name>gadgets.country</name>
- <description>US</description>
- <value>US</value>
- </value-param>
-
- <value-param>
- <name>gadgets.language</name>
- <description>en</description>
- <value>en</value>
- </value-param>
-
- <value-param>
- <name>gadgets.moduleId</name>
- <description>0</description>
- <value>0</value>
- </value-param>
-
- <value-param>
- <name>gadgets.hostName</name>
- <description>Gadget server url</description>
- <value>eXoGadgetServer/gadgets</value>
- </value-param>
-
- <properties-param>
- <name>developerInfo</name>
- <description>The group that is allowed to develop gadgets</description>
- <property name="developer.group" value="/platform/administrators"/>
- </properties-param>
- </init-params>
- </component>
--->
-
- <component>
- <key>org.exoplatform.application.gadget.SourceStorage</key>
- <type>org.exoplatform.application.gadget.impl.SourceStorageImpl</type>
-<!--
- <init-params>
- <properties-param>
- <name>location</name>
- <description>The location store source of gadgets</description>
- <property name="repository" value="repository"/>
- <property name="workspace" value="gadgets"/>
- <property name="store.path" value="/"/>
- </properties-param>
- </init-params>
--->
- </component>
-
<component>
<key>org.exoplatform.application.gadget.GadgetRegistryService</key>
<type>org.exoplatform.application.gadget.impl.GadgetRegistryServiceImpl</type>
@@ -595,15 +545,9 @@
<value>org.exoplatform.application.gadget.impl.GadgetDefinition</value>
<value>org.exoplatform.application.gadget.impl.LocalGadgetData</value>
<value>org.exoplatform.application.gadget.impl.RemoteGadgetData</value>
-<!--
- <value>org.exoplatform.application.gadget.impl.NTFolder</value>
- <value>org.exoplatform.application.gadget.impl.NTFile</value>
- <value>org.exoplatform.application.gadget.impl.NTResource</value>
--->
</values-param>
</init-params>
</component-plugin>
</external-component-plugins>
-
</configuration>
\ No newline at end of file
15 years
gatein SVN: r929 - in portal/trunk: component/application-registry/src/main/java/org/exoplatform/application/gadget and 10 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2009-12-04 13:07:13 -0500 (Fri, 04 Dec 2009)
New Revision: 929
Added:
portal/trunk/component/application-registry/src/main/java/conf/application-nodetypes.xml
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/EncodingDetector.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/GadgetDeployer.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/LocalImporter.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/ServletLocalImporter.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetData.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetDefinition.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetRegistry.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetRegistryServiceImpl.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/LocalGadgetData.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/RemoteGadgetData.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/SourceStorageImpl.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/NodeAware.java
portal/trunk/component/portal/src/main/java/conf/content-nodetypes.xml
Removed:
portal/trunk/component/portal/src/main/java/conf/portal/portal-nodetypes.xml
Modified:
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/GadgetRegister.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/Source.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/SourceStorage.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/jcr/SourceStorageImpl.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/ApplicationRegistryChromatticLifeCycle.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/Injector.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/MOPApplicationRegistryService.java
portal/trunk/component/portal/src/test/java/conf/portal/jcr-configuration.xml
portal/trunk/gadgets/eXoGadgets/src/main/webapp/WEB-INF/gadget.xml
portal/trunk/gadgets/eXoGadgets/src/main/webapp/WEB-INF/web.xml
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetEditor.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetInfo.java
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/application-registry-configuration.xml
Log:
GTNPORTAL-309 : Gadget persistence based on Chromattic (first pass, need to remove old stuff after)
Added: portal/trunk/component/application-registry/src/main/java/conf/application-nodetypes.xml
===================================================================
--- portal/trunk/component/application-registry/src/main/java/conf/application-nodetypes.xml (rev 0)
+++ portal/trunk/component/application-registry/src/main/java/conf/application-nodetypes.xml 2009-12-04 18:07:13 UTC (rev 929)
@@ -0,0 +1,175 @@
+<!--
+
+ 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.
+
+-->
+<nodeTypes xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0">
+
+ <nodeType name="mop:gadgetregistry" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <childNodeDefinitions>
+ <childNodeDefinition name="*" defaultPrimaryType="mop:gadgetdefinition" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>mop:gadgetdefinition</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="mop:gadgetdefinition" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="title" requiredType="String" autoCreated="false" mandatory="true" onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="description" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="thumbnail" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="referenceurl" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ <childNodeDefinitions>
+ <childNodeDefinition name="data" defaultPrimaryType="mop:gadgetdata" autoCreated="false" mandatory="true"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>mop:gadgetdata</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="mop:gadgetdata" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ </nodeType>
+
+ <nodeType name="mop:localgadgetdata" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>mop:gadgetdata</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="filename" requiredType="String" autoCreated="false" mandatory="true" onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ <childNodeDefinitions>
+ <childNodeDefinition name="resources" defaultPrimaryType="nt:folder" autoCreated="false" mandatory="true"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>nt:folder</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="mop:remotegadgetdata" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>mop:gadgetdata</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="url" requiredType="String" autoCreated="false" mandatory="true" onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ </nodeType>
+
+ <nodeType name="mop:contentregistry" isMixin="false" hasOrderableChildNodes="true" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <childNodeDefinitions>
+ <childNodeDefinition name="*" defaultPrimaryType="mop:contentcategory" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>mop:contentcategory</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="mop:contentcategory" isMixin="false" hasOrderableChildNodes="true" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="displayname" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="description" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="creationdate" requiredType="Date" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="lastmodificationdate" requiredType="Date" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="accesspermissions" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ <childNodeDefinitions>
+ <childNodeDefinition name="*" defaultPrimaryType="mop:content" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>mop:content</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="mop:content" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="displayname" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="description" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="creationdate" requiredType="Date" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="lastmodificationdate" requiredType="Date" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="accesspermissions" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ </nodeType>
+
+</nodeTypes>
Added: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/EncodingDetector.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/EncodingDetector.java (rev 0)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/EncodingDetector.java 2009-12-04 18:07:13 UTC (rev 929)
@@ -0,0 +1,74 @@
+/*
+ * 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.
+ */
+package org.exoplatform.application.gadget;
+
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+import org.xml.sax.ext.Locator2;
+import org.xml.sax.helpers.DefaultHandler;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class EncodingDetector extends DefaultHandler
+{
+
+ public static String detect(InputStream in) throws IOException, ParserConfigurationException, SAXException
+ {
+ EncodingDetector detector = new EncodingDetector();
+ SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
+ parser.parse(in, detector);
+ return detector.encoding;
+ }
+
+ /** . */
+ private Locator2 locator;
+
+ /** Use UTF-8 if nothing provided. */
+ private String encoding = "UTF-8";
+
+ private EncodingDetector()
+ {
+ }
+
+ @Override
+ public void setDocumentLocator(Locator locator)
+ {
+ if (locator instanceof Locator2)
+ {
+ this.locator = (Locator2)locator;
+ }
+ }
+
+ @Override
+ public void startDocument() throws SAXException
+ {
+ if (locator != null)
+ {
+ encoding = locator.getEncoding();
+ }
+ }
+}
Added: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/GadgetDeployer.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/GadgetDeployer.java (rev 0)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/GadgetDeployer.java 2009-12-04 18:07:13 UTC (rev 929)
@@ -0,0 +1,160 @@
+/*
+ * 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.
+ */
+package org.exoplatform.application.gadget;
+
+import org.exoplatform.application.gadget.impl.GadgetRegistryServiceImpl;
+import org.exoplatform.commons.chromattic.ChromatticLifeCycle;
+import org.exoplatform.commons.chromattic.SessionContext;
+import org.exoplatform.container.PortalContainer;
+import org.exoplatform.container.RootContainer;
+import org.gatein.common.logging.Logger;
+import org.gatein.common.logging.LoggerFactory;
+import org.gatein.common.xml.XMLTools;
+import org.gatein.wci.WebApp;
+import org.gatein.wci.WebAppEvent;
+import org.gatein.wci.WebAppLifeCycleEvent;
+import org.gatein.wci.WebAppListener;
+import org.gatein.wci.impl.DefaultServletContainerFactory;
+import org.picocontainer.Startable;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+import javax.servlet.ServletContext;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class GadgetDeployer implements WebAppListener, Startable
+{
+
+ /** . */
+ private final Logger log = LoggerFactory.getLogger(GadgetDeployer.class);
+
+ /** . */
+ private GadgetRegistryServiceImpl gadgetRegistryService;
+
+ public GadgetDeployer(GadgetRegistryService gadgetRegistryService)
+ {
+ this.gadgetRegistryService = (GadgetRegistryServiceImpl)gadgetRegistryService;
+ }
+
+ public void onEvent(WebAppEvent webAppEvent)
+ {
+ if (webAppEvent instanceof WebAppLifeCycleEvent)
+ {
+ WebAppLifeCycleEvent lfEvent = (WebAppLifeCycleEvent)webAppEvent;
+ if (lfEvent.getType() == WebAppLifeCycleEvent.ADDED)
+ {
+ WebApp webApp = webAppEvent.getWebApp();
+ ServletContext scontext = webApp.getServletContext();
+ try
+ {
+ final URL url = scontext.getResource("/WEB-INF/gadget.xml");
+ if (url != null)
+ {
+ final RootContainer.PortalContainerPostInitTask task = new RootContainer.PortalContainerPostInitTask()
+ {
+ public void execute(ServletContext context, PortalContainer portalContainer)
+ {
+ handle(context, url);
+ }
+ };
+ PortalContainer.addInitTask(scontext, task);
+ }
+ }
+ catch (MalformedURLException e)
+ {
+ log.error("Could not read the content of the gadget file", e);
+ }
+ }
+ }
+ }
+
+ public void start()
+ {
+ DefaultServletContainerFactory.getInstance().getServletContainer().addWebAppListener(this);
+ }
+
+ public void stop()
+ {
+ DefaultServletContainerFactory.getInstance().getServletContainer().addWebAppListener(this);
+ }
+
+ private void handle(ServletContext scontext, URL gadgetsURL)
+ {
+ ChromatticLifeCycle lifeCycle = gadgetRegistryService.getChromatticLifeCycle();
+ SessionContext context = lifeCycle.openContext();
+ InputStream in;
+ try
+ {
+ in = gadgetsURL.openStream();
+ DocumentBuilder db = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ Document docXML = db.parse(in);
+ NodeList nodeList = docXML.getElementsByTagName("gadget");
+ for (int i = 0; i < nodeList.getLength(); i++)
+ {
+ Element gadgetElement = (Element)nodeList.item(i);
+ String gadgetName = gadgetElement.getAttribute("name");
+ System.out.println("About to import " + gadgetName);
+ Element pathElt = XMLTools.getUniqueChild(gadgetElement, "path", false);
+ if (pathElt != null)
+ {
+ String path = XMLTools.asString(pathElt, true);
+ ServletLocalImporter importer = new ServletLocalImporter(
+ gadgetName,
+ gadgetRegistryService.getRegistry(),
+ path,
+ scontext,
+ true);
+ importer.doImport();
+ }
+ else
+ {
+ Element urlElt = XMLTools.getUniqueChild(gadgetElement, "url", false);
+ if (urlElt != null)
+ {
+ String url = XMLTools.asString(urlElt, true);
+ ServletLocalImporter importer = new ServletLocalImporter(
+ gadgetName,
+ gadgetRegistryService.getRegistry(),
+ url,
+ scontext,
+ false);
+ importer.doImport();
+ }
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ log.error("Could not process gadget file " + gadgetsURL, e);
+ }
+ finally
+ {
+ lifeCycle.closeContext(context, true);
+ }
+ }
+}
Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/GadgetRegister.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/GadgetRegister.java 2009-12-04 17:17:43 UTC (rev 928)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/GadgetRegister.java 2009-12-04 18:07:13 UTC (rev 929)
@@ -111,18 +111,18 @@
File homeDir = sourceFile.getParentFile();
String fileName = sourceFile.getName();
//Saves source of gadget
- Source source = new Source(fileName, getMimeType(context, fileName), "UTF-8");
- source.setStreamContent(sourceIs);
+ Source source = new Source(fileName, getMimeType(context, fileName));
+// source.setStreamContent(sourceIs);
source.setLastModified(Calendar.getInstance());
String homeName = homeDir.getName();
- sourceStorage.saveSource(homeName, source);
+ // sourceStorage.saveSource(homeName, source);
//Saves gadget
ModulePrefs prefs =
GadgetApplication.getModulePreferences(Uri.parse("http://www.exoplatform.org"), source
.getTextContent());
Gadget gadget = new Gadget();
gadget.setName(gadgetName);
- gadget.setUrl(sourceStorage.getSourceURI(homeName + "/" + fileName));
+ // gadget.setUrl(sourceStorage.getSourceURI(homeName + "/" + fileName));
gadget.setTitle(getGadgetTitle(prefs, gadget.getName()));
gadget.setDescription(prefs.getDescription());
gadget.setThumbnail(prefs.getThumbnail().toString());
@@ -177,10 +177,10 @@
{
if (file.isFile())
{
- Source includedSource = new Source(file.getName(), getMimeType(context, file.getName()), "UTF-8");
- includedSource.setStreamContent(new FileInputStream(file));
+ Source includedSource = new Source(file.getName(), getMimeType(context, file.getName()));
+// includedSource.setStreamContent(new FileInputStream(file));
includedSource.setLastModified(Calendar.getInstance());
- storage.saveSource(savePath, includedSource);
+ // storage.saveSource(savePath, includedSource);
}
else if (file.isDirectory())
{
Added: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/LocalImporter.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/LocalImporter.java (rev 0)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/LocalImporter.java 2009-12-04 18:07:13 UTC (rev 929)
@@ -0,0 +1,240 @@
+/*
+ * 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.
+ */
+
+package org.exoplatform.application.gadget;
+
+import org.apache.shindig.common.uri.Uri;
+import org.apache.shindig.gadgets.spec.GadgetSpec;
+import org.apache.shindig.gadgets.spec.ModulePrefs;
+import org.exoplatform.application.gadget.impl.GadgetDefinition;
+import org.exoplatform.application.gadget.impl.GadgetRegistry;
+import org.exoplatform.application.gadget.impl.LocalGadgetData;
+import org.exoplatform.application.gadget.impl.RemoteGadgetData;
+import org.gatein.common.logging.Logger;
+import org.gatein.common.logging.LoggerFactory;
+import org.gatein.common.net.URLTools;
+
+import javax.jcr.Node;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.net.URL;
+import java.util.Calendar;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public abstract class LocalImporter
+{
+
+ /** . */
+ private static final Logger log = LoggerFactory.getLogger(LocalImporter.class);
+
+ /** The gadget name as seen by GateIn. */
+ private String name;
+
+ /** The gadget registry. */
+ private GadgetRegistry registry;
+
+ /** The gadget path. */
+ private String gadgetPath;
+
+ /** . */
+ private boolean local;
+
+ /** Used temporarily when importing resources. */
+ private Node folder;
+
+ protected LocalImporter(
+ String name,
+ GadgetRegistry registry,
+ String gadgetPath,
+ boolean local)
+ {
+ this.name = name;
+ this.registry = registry;
+ this.gadgetPath = gadgetPath;
+ this.local = local;
+ }
+
+ private byte[] getGadgetBytes() throws IOException
+ {
+ if (local)
+ {
+ return getContent(gadgetPath);
+ }
+ else
+ {
+ URL url = new URL(gadgetPath);
+ return URLTools.getContent(url, 5000, 5000);
+ }
+ }
+
+ private String getGadgetURL() throws Exception
+ {
+ if (local)
+ {
+ return "http://www.gatein.org";
+ }
+ else
+ {
+ return gadgetPath;
+ }
+ }
+
+ private String getGadgetTitle(ModulePrefs prefs, String defaultValue)
+ {
+ String title = prefs.getDirectoryTitle();
+ if (title == null || title.trim().length() < 1)
+ {
+ title = prefs.getTitle();
+ }
+ if (title == null || title.trim().length() < 1)
+ {
+ return defaultValue;
+ }
+ return title;
+ }
+
+ public void doImport() throws Exception
+ {
+ if (registry.getGadget(name) != null)
+ {
+ System.out.println("Cannot import existing gagdet " + name);
+ return;
+ }
+
+ // Get bytes
+ byte[] bytes = getGadgetBytes();
+ if (bytes == null)
+ {
+ System.out.println("Coult not import gadget " + gadgetPath);
+ return;
+ }
+
+ // Get encoding
+ String encoding = EncodingDetector.detect(new ByteArrayInputStream(bytes));
+
+ //
+ String gadget = new String(bytes, encoding);
+
+ //
+ String gadgetURL = getGadgetURL();
+ GadgetSpec spec = new GadgetSpec(Uri.parse(gadgetURL), gadget);
+ ModulePrefs prefs = spec.getModulePrefs();
+
+ //
+ GadgetDefinition def = registry.addGadget(name);
+
+ //
+ String description = prefs.getDescription();
+ String thumbnail = prefs.getThumbnail().toString();
+ String title = getGadgetTitle(prefs, name);
+ String referenceURL = prefs.getTitleUrl().toString();
+
+ //
+ log.info("Importing gadget name=" + name + " description=" + description + " thumbnail=" + thumbnail + " title=" +
+ thumbnail + " title=" + title);
+
+ //
+ def.setDescription(description);
+ def.setThumbnail(thumbnail); // Do something better than that
+ def.setTitle(title);
+ def.setReferenceURL(referenceURL);
+ def.setLocal(local);
+
+ //
+ if (local)
+ {
+ LocalGadgetData data = (LocalGadgetData)def.getData();
+
+ //
+ String fileName = getName(gadgetPath);
+ data.setFileName(fileName);
+
+ // Import resource
+ folder = data.getNode().addNode("resources", "nt:folder");
+ String folderPath = getParent(gadgetPath);
+ visitChildren(folderPath);
+ folder = null;
+ }
+ else
+ {
+ RemoteGadgetData data = (RemoteGadgetData)def.getData();
+
+ // Set remote URL
+ data.setURL(gadgetPath);
+ }
+ }
+
+ private void visit(String resourcePath) throws Exception
+ {
+ String name = getName(resourcePath);
+ if (isFile(resourcePath))
+ {
+ byte[] content = getContent(resourcePath);
+
+ //
+ if (content != null)
+ {
+ String mimeType = getMimeType(name);
+
+ //
+ Node file = folder.addNode(name, "nt:file");
+ Node resource = file.addNode("jcr:content", "nt:resource");
+ resource.setProperty("jcr:data", new ByteArrayInputStream(content));
+ resource.setProperty("jcr:lastModified", Calendar.getInstance());
+ resource.setProperty("jcr:mimeType", mimeType);
+
+ // We can detect encoding for XML files
+ if ("application/xml".equals(mimeType))
+ {
+ String encoding = EncodingDetector.detect(new ByteArrayInputStream(content));
+ resource.setProperty("jcr:encoding", encoding);
+ }
+ }
+ }
+ else
+ {
+ folder = folder.addNode(name, "nt:folder");
+ visitChildren(resourcePath);
+ folder = folder.getParent();
+ }
+ }
+
+ private void visitChildren(String folderPath) throws Exception
+ {
+ for (String childPath : getChildren(folderPath))
+ {
+ visit(childPath);
+ }
+ }
+
+ public abstract String getName(String resourcePath) throws IOException;
+
+ public abstract String getParent(String resourcePath) throws IOException;
+
+ public abstract byte[] getContent(String filePath) throws IOException;
+
+ public abstract Iterable<String> getChildren(String folderPath) throws IOException;
+
+ public abstract boolean isFile(String resourcePath) throws IOException;
+
+ public abstract String getMimeType(String fileName);
+}
Added: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/ServletLocalImporter.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/ServletLocalImporter.java (rev 0)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/ServletLocalImporter.java 2009-12-04 18:07:13 UTC (rev 929)
@@ -0,0 +1,122 @@
+/*
+ * 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.
+ */
+package org.exoplatform.application.gadget;
+
+import org.exoplatform.application.gadget.impl.GadgetRegistry;
+import org.gatein.common.io.IOTools;
+import org.gatein.common.logging.Logger;
+import org.gatein.common.logging.LoggerFactory;
+
+import javax.servlet.ServletContext;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class ServletLocalImporter extends LocalImporter
+{
+
+ /** . */
+ private final Logger log = LoggerFactory.getLogger(ServletLocalImporter.class);
+
+ /** . */
+ private final ServletContext servletContext;
+
+ public ServletLocalImporter(
+ String name,
+ GadgetRegistry registry,
+ String gadgetPath,
+ ServletContext servletContext,
+ boolean local)
+ {
+ super(name, registry, gadgetPath, local);
+
+ //
+ this.servletContext = servletContext;
+ }
+
+ @Override
+ public String getName(String resourcePath) throws IOException
+ {
+ // It's a directory, remove the trailing '/'
+ if (resourcePath.endsWith("/"))
+ {
+ resourcePath = resourcePath.substring(0, resourcePath.length() - 1);
+ }
+
+ // Get index of last '/'
+ int index = resourcePath.lastIndexOf('/');
+
+ // Return name
+ return resourcePath.substring(index + 1);
+ }
+
+ @Override
+ public String getParent(String resourcePath) throws IOException
+ {
+ // It's a directory, remove the trailing '/'
+ if (resourcePath.endsWith("/"))
+ {
+ resourcePath = resourcePath.substring(0, resourcePath.length() - 1);
+ }
+
+ // Get index of last '/'
+ int index = resourcePath.lastIndexOf('/');
+
+ // Return the parent that ends with a '/'
+ return resourcePath.substring(0, index + 1);
+ }
+
+ @Override
+ public byte[] getContent(String filePath) throws IOException
+ {
+ InputStream in = servletContext.getResourceAsStream(filePath);
+ if (in == null)
+ {
+ log.error("Could not obtain input stream for file " + filePath);
+ return null;
+ }
+ else
+ {
+ return IOTools.getBytes(in);
+ }
+ }
+
+ @Override
+ public Iterable<String> getChildren(String folderPath) throws IOException
+ {
+ @SuppressWarnings("unchecked") Set resourcePaths = servletContext.getResourcePaths(folderPath);
+ return resourcePaths;
+ }
+
+ @Override
+ public boolean isFile(String resourcePath) throws IOException
+ {
+ return !resourcePath.endsWith("/");
+ }
+
+ @Override
+ public String getMimeType(String fileName)
+ {
+ return servletContext.getMimeType(fileName);
+ }
+}
Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/Source.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/Source.java 2009-12-04 17:17:43 UTC (rev 928)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/Source.java 2009-12-04 18:07:13 UTC (rev 929)
@@ -19,8 +19,6 @@
package org.exoplatform.application.gadget;
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
import java.util.Calendar;
/**
@@ -34,14 +32,10 @@
private String name;
- private byte[] content;
+ private String content;
private String mimeType = "text/plain";
- private String encoding = "UTF-8";
-
- private long length = 0;
-
private Calendar lastModified;
public Source(String name)
@@ -49,11 +43,10 @@
this.name = name;
}
- public Source(String name, String mimeType, String encoding)
+ public Source(String name, String mimeType)
{
this.name = name;
this.mimeType = mimeType;
- this.encoding = encoding;
}
public String getName()
@@ -76,16 +69,6 @@
this.mimeType = mimeType;
}
- public String getEncoding()
- {
- return encoding;
- }
-
- public void setEncoding(String encoding)
- {
- this.encoding = encoding;
- }
-
public Calendar getLastModified()
{
return lastModified;
@@ -96,33 +79,13 @@
this.lastModified = lastModified;
}
- public long getLength()
- {
- return length;
- }
-
public void setTextContent(String text) throws Exception
{
- String textContent = (text == null) ? "" : text;
- content = textContent.getBytes(encoding);
- length = content.length;
+ content = text;
}
public String getTextContent() throws Exception
{
- return new String(content, encoding);
+ return content;
}
-
- public void setStreamContent(InputStream is) throws Exception
- {
- content = new byte[is.available()];
- is.read(content);
- length = content.length;
- }
-
- public InputStream getStreamContent()
- {
- return new ByteArrayInputStream(content);
- }
-
}
\ No newline at end of file
Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/SourceStorage.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/SourceStorage.java 2009-12-04 17:17:43 UTC (rev 928)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/SourceStorage.java 2009-12-04 18:07:13 UTC (rev 929)
@@ -33,7 +33,7 @@
* @return
* @throws Exception
*/
- public Source getSource(String sourcePath) throws Exception;
+ public Source getSource(Gadget gadget) throws Exception;
/**
* This method will save source to database to a specify path
@@ -41,21 +41,15 @@
* @param source
* @throws Exception
*/
- public void saveSource(String dirPath, Source source) throws Exception;
+ public void saveSource(Gadget gadget, Source source) throws Exception;
/**
- * This method will remove source from database base on source path
- * @param sourcePath
- * @throws Exception
+ * julien : this method does nothing and should be removed since now deleting a gadget
+ * in the gadget registry also deletes the source for the local gadgets.
+ *
+ * @param sourcePath the source path
+ * @throws Exception any exception
*/
public void removeSource(String sourcePath) throws Exception;
- /**
- * This method will get source URI from database.
- * For example: jcr/repository/collaboration/source/Todo.xml
- * @param sourcePath
- * @return
- */
- public String getSourceURI(String sourcePath);
-
}
\ No newline at end of file
Added: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetData.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetData.java (rev 0)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetData.java 2009-12-04 18:07:13 UTC (rev 929)
@@ -0,0 +1,27 @@
+/*
+ * 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.
+ */
+package org.exoplatform.application.gadget.impl;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public abstract class GadgetData
+{
+}
Added: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetDefinition.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetDefinition.java (rev 0)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetDefinition.java 2009-12-04 18:07:13 UTC (rev 929)
@@ -0,0 +1,98 @@
+/*
+ * 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.
+ */
+package org.exoplatform.application.gadget.impl;
+
+import org.chromattic.api.annotations.Create;
+import org.chromattic.api.annotations.MappedBy;
+import org.chromattic.api.annotations.Name;
+import org.chromattic.api.annotations.NodeMapping;
+import org.chromattic.api.annotations.OneToOne;
+import org.chromattic.api.annotations.Property;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+@NodeMapping(name = "mop:gadgetdefinition")
+public abstract class GadgetDefinition
+{
+
+ @Name
+ public abstract String getName();
+
+ @Property(name = "title")
+ public abstract String getTitle();
+
+ public abstract void setTitle(String title);
+
+ @Property(name = "description")
+ public abstract String getDescription();
+
+ public abstract void setDescription(String description);
+
+ @Property(name = "thumbnail")
+ public abstract String getThumbnail();
+
+ public abstract void setThumbnail(String thumbnail);
+
+ @Property(name = "referenceurl")
+ public abstract String getReferenceURL();
+
+ public abstract void setReferenceURL(String referenceURL);
+
+ @OneToOne
+ @MappedBy("data")
+ public abstract GadgetData getData();
+
+ public abstract void setData(GadgetData data);
+
+ @Create
+ protected abstract LocalGadgetData createLocalData();
+
+ @Create
+ protected abstract RemoteGadgetData createRemoteData();
+
+ public boolean isLocal()
+ {
+ GadgetData data = getData();
+ return data instanceof LocalGadgetData;
+ }
+
+ public void setLocal(boolean local)
+ {
+ GadgetData data = getData();
+ if (local)
+ {
+ if (data == null || data instanceof RemoteGadgetData)
+ {
+ LocalGadgetData localData = createLocalData();
+ setData(localData);
+ }
+ }
+ else
+ {
+ if (data == null || data instanceof LocalGadgetData)
+ {
+ RemoteGadgetData localData = createRemoteData();
+ setData(localData);
+ }
+ }
+ }
+
+}
Added: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetRegistry.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetRegistry.java (rev 0)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetRegistry.java 2009-12-04 18:07:13 UTC (rev 929)
@@ -0,0 +1,72 @@
+/*
+ * 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.
+ */
+package org.exoplatform.application.gadget.impl;
+
+import org.chromattic.api.annotations.Create;
+import org.chromattic.api.annotations.NodeMapping;
+import org.chromattic.api.annotations.OneToMany;
+
+import java.util.Collection;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+@NodeMapping(name = "mop:gadgetregistry")
+public abstract class GadgetRegistry
+{
+
+ @OneToMany
+ protected abstract Map<String, GadgetDefinition> getDefinitions();
+
+ @Create
+ protected abstract GadgetDefinition createGadget();
+
+/*
+ @Create
+ protected abstract NTFolder createFolder();
+*/
+
+ public Collection<GadgetDefinition> getGadgets()
+ {
+ return getDefinitions().values();
+ }
+
+ public GadgetDefinition getGadget(String name)
+ {
+ return getDefinitions().get(name);
+ }
+
+ public GadgetDefinition addGadget(String name)
+ {
+ if (name == null)
+ {
+ throw new NullPointerException();
+ }
+ GadgetDefinition def = createGadget();
+ getDefinitions().put(name, def);
+ return def;
+ }
+
+ public void removeGadget(String name)
+ {
+ getDefinitions().put(name, null);
+ }
+}
Added: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetRegistryServiceImpl.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetRegistryServiceImpl.java (rev 0)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetRegistryServiceImpl.java 2009-12-04 18:07:13 UTC (rev 929)
@@ -0,0 +1,263 @@
+/*
+ * 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.
+ */
+package org.exoplatform.application.gadget.impl;
+
+import org.chromattic.api.Chromattic;
+import org.chromattic.api.ChromatticSession;
+import org.exoplatform.application.gadget.Gadget;
+import org.exoplatform.application.gadget.GadgetRegistryService;
+import org.exoplatform.application.registry.mop.ApplicationRegistryChromatticLifeCycle;
+import org.exoplatform.commons.chromattic.ChromatticLifeCycle;
+import org.exoplatform.commons.chromattic.ChromatticManager;
+import org.exoplatform.container.xml.InitParams;
+import org.exoplatform.container.xml.PropertiesParam;
+import org.exoplatform.container.xml.ValueParam;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class GadgetRegistryServiceImpl implements GadgetRegistryService
+{
+
+ /** . */
+ private static final String DEFAULT_DEVELOPER_GROUP = "/platform/administrators";
+
+ /** . */
+ private ChromatticManager chromatticManager;
+
+ /** . */
+ private ChromatticLifeCycle chromatticLifeCycle;
+
+ /** . */
+ private String gadgetDeveloperGroup;
+
+ /** . */
+ private String country;
+
+ /** . */
+ private String language;
+
+ /** . */
+ private String moduleId;
+
+ /** . */
+ private String hostName;
+
+ public GadgetRegistryServiceImpl(ChromatticManager chromatticManager, InitParams params)
+ {
+ ApplicationRegistryChromatticLifeCycle lifeCycle = (ApplicationRegistryChromatticLifeCycle)chromatticManager.getLifeCycle("app");
+
+ //
+ String gadgetDeveloperGroup = null;
+ String country = null;
+ String language = null;
+ String moduleId = null;
+ String hostName = null;
+ if (params != null)
+ {
+ PropertiesParam properties = params.getPropertiesParam("developerInfo");
+ gadgetDeveloperGroup = properties != null ? properties.getProperty("developer.group") : null;
+ ValueParam gadgetCountry = params.getValueParam("gadgets.country");
+ country = gadgetCountry != null ? gadgetCountry.getValue() : null;
+ ValueParam gadgetLanguage = params.getValueParam("gadgets.language");
+ language = gadgetLanguage != null ? gadgetLanguage.getValue() : null;
+ ValueParam gadgetModuleId = params.getValueParam("gadgets.moduleId");
+ moduleId = gadgetModuleId != null ? gadgetModuleId.getValue() : null;
+ ValueParam gadgetHostName = params.getValueParam("gadgets.hostName");
+ hostName = gadgetHostName != null ? gadgetHostName.getValue() : null;
+ }
+
+ //
+ if (gadgetDeveloperGroup == null)
+ {
+ gadgetDeveloperGroup = DEFAULT_DEVELOPER_GROUP;
+ }
+
+ //
+ this.country = country;
+ this.language = language;
+ this.moduleId = moduleId;
+ this.hostName = hostName;
+ this.gadgetDeveloperGroup = gadgetDeveloperGroup;
+ this.chromatticManager = chromatticManager;
+ this.chromatticLifeCycle = lifeCycle;
+ }
+
+ public GadgetRegistry getRegistry()
+ {
+ Chromattic chromattic = chromatticLifeCycle.getChromattic();
+ ChromatticSession session = chromattic.openSession();
+ GadgetRegistry registry = session.findByPath(GadgetRegistry.class, "gadgets");
+ if (registry == null)
+ {
+ registry = session.insert(GadgetRegistry.class, "gadgets");
+ }
+ return registry;
+ }
+
+ public ChromatticLifeCycle getChromatticLifeCycle()
+ {
+ return chromatticLifeCycle;
+ }
+
+ // ***************
+
+
+ public Gadget getGadget(String name) throws Exception
+ {
+ GadgetRegistry registry = getRegistry();
+
+ //
+ GadgetDefinition def = registry.getGadget(name);
+
+ //
+ return def == null ? null : loadGadget(def);
+ }
+
+ public List<Gadget> getAllGadgets() throws Exception
+ {
+ return getAllGadgets(null);
+ }
+
+ public List<Gadget> getAllGadgets(Comparator<Gadget> sortComparator) throws Exception
+ {
+ GadgetRegistry registry = getRegistry();
+ List<Gadget> gadgets = new ArrayList<Gadget>();
+ for (GadgetDefinition def : registry.getGadgets())
+ {
+ Gadget gadget = loadGadget(def);
+ gadgets.add(gadget);
+ }
+ if (sortComparator != null)
+ {
+ Collections.sort(gadgets, sortComparator);
+ }
+ return gadgets;
+ }
+
+ public void saveGadget(Gadget gadget) throws Exception
+ {
+ if (gadget == null)
+ {
+ throw new NullPointerException();
+ }
+
+ //
+ GadgetRegistry registry = getRegistry();
+ GadgetDefinition def = registry.getGadget(gadget.getName());
+
+ //
+ if (def == null)
+ {
+ throw new IllegalArgumentException("No such gadget " + gadget.getName());
+ }
+
+ //
+ saveGadget(def, gadget);
+ }
+
+ public void removeGadget(String name) throws Exception
+ {
+ if (name == null)
+ {
+ throw new NullPointerException();
+ }
+
+ //
+ GadgetRegistry registry = getRegistry();
+ GadgetDefinition def = registry.getGadget(name);
+
+ //
+ if (def == null)
+ {
+ throw new IllegalArgumentException("No such gadget " + name);
+ }
+
+ //
+ registry.removeGadget(name);
+ }
+
+ private void saveGadget(GadgetDefinition def, Gadget gadget)
+ {
+ def.setDescription(gadget.getDescription());
+ def.setReferenceURL(gadget.getReferenceUrl());
+ def.setTitle(gadget.getTitle());
+ def.setThumbnail(gadget.getThumbnail());
+ }
+
+ private Gadget loadGadget(GadgetDefinition def)
+ {
+ GadgetData data = def.getData();
+
+ //
+ String url;
+ if (data instanceof LocalGadgetData)
+ {
+ LocalGadgetData localData = (LocalGadgetData)data;
+ url = "jcr/repository/portal-system/gadgets/" + def.getName() + "/data/resources/" + localData.getFileName();
+ }
+ else
+ {
+ RemoteGadgetData remoteData = (RemoteGadgetData)data;
+ url = remoteData.getURL();
+ }
+
+ //
+ Gadget gadget = new Gadget();
+ gadget.setName(def.getName());
+ gadget.setDescription(def.getDescription());
+ gadget.setLocal(def.isLocal());
+ gadget.setTitle(def.getTitle());
+ gadget.setReferenceUrl(def.getReferenceURL());
+ gadget.setThumbnail(def.getThumbnail());
+ gadget.setUrl(url);
+ return gadget;
+ }
+
+ public boolean isGadgetDeveloper(String username)
+ {
+ return true;
+ }
+
+ public String getCountry()
+ {
+ return country ;
+ }
+
+ public String getLanguage()
+ {
+ return language ;
+ }
+
+ public String getModuleId()
+ {
+ return moduleId;
+ }
+
+ public String getHostName()
+ {
+ return hostName ;
+ }
+}
Added: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/LocalGadgetData.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/LocalGadgetData.java (rev 0)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/LocalGadgetData.java 2009-12-04 18:07:13 UTC (rev 929)
@@ -0,0 +1,151 @@
+/**
+ * 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.
+ */
+package org.exoplatform.application.gadget.impl;
+
+import org.apache.shindig.common.uri.Uri;
+import org.apache.shindig.gadgets.spec.GadgetSpec;
+import org.apache.shindig.gadgets.spec.ModulePrefs;
+import org.chromattic.api.UndeclaredRepositoryException;
+import org.chromattic.api.annotations.ManyToOne;
+import org.chromattic.api.annotations.NodeMapping;
+import org.chromattic.api.annotations.Property;
+import org.exoplatform.application.gadget.EncodingDetector;
+import org.exoplatform.application.registry.mop.NodeAware;
+import org.gatein.common.io.IOTools;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.util.Calendar;
+
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+@NodeMapping(name = "mop:localgadgetdata")
+public abstract class LocalGadgetData extends GadgetData implements NodeAware
+{
+
+ /** Temporary hack, use with care. */
+ private Node node;
+
+ @ManyToOne
+ public abstract GadgetDefinition getDefinition();
+
+ @Property(name = "filename")
+ public abstract String getFileName();
+
+ public abstract void setFileName(String fileName);
+
+ public void setNode(Node node)
+ {
+ this.node = node;
+ }
+
+ public Node getNode()
+ {
+ return node;
+ }
+
+ public void setSource(String gadgetXML) throws Exception
+ {
+
+ // Get the definition
+ GadgetDefinition def = getDefinition();
+
+ // Get the related content
+ GadgetSpec spec = new GadgetSpec(Uri.parse("http://www.gatein.org"), gadgetXML);
+ ModulePrefs prefs = spec.getModulePrefs();
+ String fileName = getFileName();
+ Node contentNode = node.getNode("resources/" + fileName + "/jcr:content");
+ byte[] bytes = gadgetXML.getBytes();
+ String encoding = EncodingDetector.detect(new ByteArrayInputStream(bytes));
+
+ // Update def
+ def.setDescription(prefs.getDescription());
+ def.setThumbnail(prefs.getThumbnail().toString()); // Do something better than that
+ def.setTitle(prefs.getTitle());
+ def.setReferenceURL(prefs.getTitleUrl().toString());
+
+ // Update content
+ contentNode.setProperty("jcr:encoding", encoding);
+ contentNode.setProperty("jcr:data", new ByteArrayInputStream(bytes));
+ contentNode.setProperty("jcr:mimeType", "application/xml");
+ contentNode.setProperty("jcr:lastModified", Calendar.getInstance());
+ }
+
+ public String getSource() throws Exception
+ {
+ String fileName = getFileName();
+ Node contentNode = node.getNode("resources/" + fileName + "/jcr:content");
+ InputStream in = contentNode.getProperty("jcr:data").getStream();
+ String encoding = contentNode.getProperty("jcr:encoding").getString();
+ byte[] bytes = IOTools.getBytes(in);
+ return new String(bytes, encoding);
+ }
+
+ public Calendar getLastModified()
+ {
+ try
+ {
+ String fileName = getFileName();
+ Node contentNode = node.getNode("resources/" + fileName + "/jcr:content");
+ return contentNode.getProperty("jcr:lastModified").getDate();
+ }
+ catch (RepositoryException e)
+ {
+ throw new UndeclaredRepositoryException(e);
+ }
+ }
+
+ private static String getProperty(Node node, String name, String defaultValue) throws Exception
+ {
+ if (node.hasProperty(name))
+ {
+ return node.getProperty(name).getString();
+ }
+ else
+ {
+ return defaultValue;
+ }
+ }
+
+ private static Calendar getCalendarProperty(Node node, String name) throws Exception
+ {
+ if (node.hasProperty(name))
+ {
+ return node.getProperty(name).getDate();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+
+/*
+ @OneToOne
+ @MappedBy("folder")
+ public abstract NTFolder getFolder();
+
+ public abstract void setFolder(NTFolder folder);
+*/
+}
Added: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/RemoteGadgetData.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/RemoteGadgetData.java (rev 0)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/RemoteGadgetData.java 2009-12-04 18:07:13 UTC (rev 929)
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ */
+package org.exoplatform.application.gadget.impl;
+
+import org.chromattic.api.annotations.NodeMapping;
+import org.chromattic.api.annotations.Property;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+@NodeMapping(name = "mop:remotegadgetdata")
+public abstract class RemoteGadgetData extends GadgetData
+{
+
+ @Property(name = "url")
+ public abstract String getURL();
+
+ public abstract void setURL(String url);
+
+}
Added: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/SourceStorageImpl.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/SourceStorageImpl.java (rev 0)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/SourceStorageImpl.java 2009-12-04 18:07:13 UTC (rev 929)
@@ -0,0 +1,128 @@
+/*
+ * 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.
+ */
+package org.exoplatform.application.gadget.impl;
+
+import org.exoplatform.application.gadget.EncodingDetector;
+import org.exoplatform.application.gadget.Gadget;
+import org.exoplatform.application.gadget.GadgetRegistryService;
+import org.exoplatform.application.gadget.Source;
+import org.exoplatform.application.gadget.SourceStorage;
+import org.gatein.common.io.IOTools;
+
+import javax.jcr.Node;
+import java.io.ByteArrayInputStream;
+import java.io.InputStreamReader;
+import java.util.Calendar;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class SourceStorageImpl implements SourceStorage
+{
+ /** . */
+ private GadgetRegistryServiceImpl gadgetRegistryService;
+
+ public SourceStorageImpl(GadgetRegistryService gadgetRegistryService)
+ {
+
+ // resources/Calculator.xml
+ // resources/rssAggregator.xml
+
+ this.gadgetRegistryService = (GadgetRegistryServiceImpl)gadgetRegistryService;
+ }
+
+ public Source getSource(Gadget gadget) throws Exception
+ {
+ GadgetDefinition def = gadgetRegistryService.getRegistry().getGadget(gadget.getName());
+
+ //
+ if (def == null)
+ {
+ return null;
+ }
+
+ //
+ GadgetData data = def.getData();
+ if (data instanceof LocalGadgetData)
+ {
+ LocalGadgetData localData = (LocalGadgetData)data;
+ String content = localData.getSource();
+ Calendar lastModified = localData.getLastModified();
+
+ //
+ Source source = new Source(gadget.getName());
+ source.setMimeType("application/xml");
+ source.setLastModified(lastModified);
+ source.setTextContent(content);
+
+ //
+ return source;
+ }
+ else
+ {
+ throw new IllegalArgumentException("The provided gadget is remote");
+ }
+ }
+
+ public void saveSource(Gadget gadget, Source source) throws Exception
+ {
+ if (gadget == null)
+ {
+ throw new NullPointerException();
+ }
+ if (source == null)
+ {
+ throw new NullPointerException();
+ }
+
+ //
+ GadgetDefinition def = gadgetRegistryService.getRegistry().getGadget(gadget.getName());
+
+ //
+ if (def == null)
+ {
+ throw new IllegalStateException("No such gadget " + gadget.getName());
+ }
+
+ //
+ GadgetData data = def.getData();
+ if (data instanceof LocalGadgetData)
+ {
+ LocalGadgetData localData = (LocalGadgetData)data;
+ localData.setSource(source.getTextContent());
+ }
+ else
+ {
+ throw new IllegalArgumentException("The provided gadget is remote");
+ }
+ }
+
+
+
+ public void removeSource(String sourcePath) throws Exception
+ {
+ // No op
+ }
+
+ public String getSourceURI(String sourcePath)
+ {
+ throw new UnsupportedOperationException("Cannot obtain URI from source " + sourcePath);
+ }
+}
Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/jcr/SourceStorageImpl.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/jcr/SourceStorageImpl.java 2009-12-04 17:17:43 UTC (rev 928)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/jcr/SourceStorageImpl.java 2009-12-04 18:07:13 UTC (rev 929)
@@ -19,6 +19,7 @@
package org.exoplatform.application.gadget.jcr;
+import org.exoplatform.application.gadget.Gadget;
import org.exoplatform.application.gadget.Source;
import org.exoplatform.application.gadget.SourceStorage;
import org.exoplatform.container.xml.InitParams;
@@ -70,6 +71,16 @@
repoService = service;
}
+ public Source getSource(Gadget gadget) throws Exception
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void saveSource(Gadget gadget, Source source) throws Exception
+ {
+ throw new UnsupportedOperationException();
+ }
+
/**
* Overridden method.
* @param sourcePath
@@ -207,8 +218,8 @@
{
Source source = new Source(name);
source.setMimeType(node.getProperty(JCR_MIME).getString());
- source.setEncoding(node.getProperty(JCR_ENCODING).getString());
- source.setStreamContent(node.getProperty(JCR_DATA).getStream());
+// source.setEncoding(node.getProperty(JCR_ENCODING).getString());
+// source.setStreamContent(node.getProperty(JCR_DATA).getStream());
source.setLastModified(node.getProperty(JCR_MODIFIED).getDate());
return source;
}
@@ -222,8 +233,8 @@
private void map(Node node, Source source) throws Exception
{
node.setProperty(JCR_MIME, source.getMimeType());
- node.setProperty(JCR_ENCODING, source.getEncoding());
- node.setProperty(JCR_DATA, source.getStreamContent());
+// node.setProperty(JCR_ENCODING, source.getEncoding());
+// node.setProperty(JCR_DATA, source.getStreamContent());
node.setProperty(JCR_MODIFIED, source.getLastModified());
}
Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/ApplicationRegistryChromatticLifeCycle.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/ApplicationRegistryChromatticLifeCycle.java 2009-12-04 17:17:43 UTC (rev 928)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/ApplicationRegistryChromatticLifeCycle.java 2009-12-04 18:07:13 UTC (rev 929)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.application.registry.mop;
+import org.chromattic.core.DomainSession;
import org.exoplatform.commons.chromattic.ChromatticLifeCycle;
import org.exoplatform.commons.chromattic.SessionContext;
import org.exoplatform.container.xml.InitParams;
@@ -38,6 +39,6 @@
@Override
protected void onOpenSession(SessionContext context) {
- context.getSession().addEventListener(new Injector(registry));
+ context.getSession().addEventListener(new Injector(registry, (DomainSession)context.getSession()));
}
}
Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/Injector.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/Injector.java 2009-12-04 17:17:43 UTC (rev 928)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/Injector.java 2009-12-04 18:07:13 UTC (rev 929)
@@ -19,7 +19,10 @@
package org.exoplatform.application.registry.mop;
import org.chromattic.api.event.LifeCycleListener;
+import org.chromattic.core.DomainSession;
+import javax.jcr.Node;
+
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
@@ -30,9 +33,13 @@
/** . */
private final MOPApplicationRegistryService registry;
- public Injector(MOPApplicationRegistryService registry)
+ /** . */
+ private final DomainSession session;
+
+ public Injector(MOPApplicationRegistryService registry, DomainSession session)
{
this.registry = registry;
+ this.session = session;
}
public void created(Object o)
@@ -41,6 +48,11 @@
public void loaded(String id, String path, String name, Object o)
{
+ if (o instanceof NodeAware)
+ {
+ Node node = session.getNode(o);
+ ((NodeAware)o).setNode(node);
+ }
if (o instanceof CategoryDefinition)
{
((CategoryDefinition)o).registry = registry;
@@ -49,6 +61,11 @@
public void added(String id, String path, String name, Object o)
{
+ if (o instanceof NodeAware)
+ {
+ Node node = session.getNode(o);
+ ((NodeAware)o).setNode(node);
+ }
if (o instanceof CategoryDefinition)
{
((CategoryDefinition)o).registry = registry;
@@ -57,6 +74,10 @@
public void removed(String id, String path, String name, Object o)
{
+ if (o instanceof NodeAware)
+ {
+ ((NodeAware)o).setNode(null);
+ }
if (o instanceof CategoryDefinition)
{
((CategoryDefinition)o).registry = null;
Modified: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/MOPApplicationRegistryService.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/MOPApplicationRegistryService.java 2009-12-04 17:17:43 UTC (rev 928)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/MOPApplicationRegistryService.java 2009-12-04 18:07:13 UTC (rev 929)
@@ -79,7 +79,7 @@
public MOPApplicationRegistryService(ChromatticManager manager, POMSessionManager mopManager)
{
- ApplicationRegistryChromatticLifeCycle lifeCycle = (ApplicationRegistryChromatticLifeCycle)manager.getLifeCycle("registry");
+ ApplicationRegistryChromatticLifeCycle lifeCycle = (ApplicationRegistryChromatticLifeCycle)manager.getLifeCycle("app");
lifeCycle.registry = this;
//
Added: portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/NodeAware.java
===================================================================
--- portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/NodeAware.java (rev 0)
+++ portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/registry/mop/NodeAware.java 2009-12-04 18:07:13 UTC (rev 929)
@@ -0,0 +1,32 @@
+/*
+ * 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.
+ */
+package org.exoplatform.application.registry.mop;
+
+import javax.jcr.Node;
+
+/**
+ * Temporary hack.
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public interface NodeAware
+{
+ void setNode(Node node);
+}
Copied: portal/trunk/component/portal/src/main/java/conf/content-nodetypes.xml (from rev 865, portal/trunk/component/portal/src/main/java/conf/portal/portal-nodetypes.xml)
===================================================================
--- portal/trunk/component/portal/src/main/java/conf/content-nodetypes.xml (rev 0)
+++ portal/trunk/component/portal/src/main/java/conf/content-nodetypes.xml 2009-12-04 18:07:13 UTC (rev 929)
@@ -0,0 +1,80 @@
+<!--
+
+ 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.
+
+-->
+<nodeTypes xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0">
+
+ <nodeType name="mop:portletpreferences" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>mop:customizationstate</supertype>
+ </supertypes>
+ <childNodeDefinitions>
+ <childNodeDefinition name="*" defaultPrimaryType="mop:portletpreference" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>mop:portletpreference</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="mop:portletpreference" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="value" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="readonly" requiredType="Boolean" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ </nodeType>
+
+ <nodeType name="mop:gadget" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>mop:customizationstate</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="prefs" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ </nodeType>
+
+ <nodeType name="mop:wsrpstate" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>mop:customizationstate</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="portletid" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="state" requiredType="Binary" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="cloned" requiredType="Boolean" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ </nodeType>
+
+</nodeTypes>
Deleted: portal/trunk/component/portal/src/main/java/conf/portal/portal-nodetypes.xml
===================================================================
--- portal/trunk/component/portal/src/main/java/conf/portal/portal-nodetypes.xml 2009-12-04 17:17:43 UTC (rev 928)
+++ portal/trunk/component/portal/src/main/java/conf/portal/portal-nodetypes.xml 2009-12-04 18:07:13 UTC (rev 929)
@@ -1,151 +0,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.
-
--->
-<nodeTypes xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0">
-
- <nodeType name="mop:contentregistry" isMixin="false" hasOrderableChildNodes="true" primaryItemName="">
- <supertypes>
- <supertype>nt:base</supertype>
- <supertype>mix:referenceable</supertype>
- </supertypes>
- <childNodeDefinitions>
- <childNodeDefinition name="*" defaultPrimaryType="mop:contentcategory" autoCreated="false" mandatory="false"
- onParentVersion="COPY" protected="false" sameNameSiblings="false">
- <requiredPrimaryTypes>
- <requiredPrimaryType>mop:contentcategory</requiredPrimaryType>
- </requiredPrimaryTypes>
- </childNodeDefinition>
- </childNodeDefinitions>
- </nodeType>
-
- <nodeType name="mop:contentcategory" isMixin="false" hasOrderableChildNodes="true" primaryItemName="">
- <supertypes>
- <supertype>nt:base</supertype>
- <supertype>mix:referenceable</supertype>
- </supertypes>
- <propertyDefinitions>
- <propertyDefinition name="displayname" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true">
- <valueConstraints/>
- </propertyDefinition>
- <propertyDefinition name="description" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- <propertyDefinition name="creationdate" requiredType="Date" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- <propertyDefinition name="lastmodificationdate" requiredType="Date" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- <propertyDefinition name="accesspermissions" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true">
- <valueConstraints/>
- </propertyDefinition>
- </propertyDefinitions>
- <childNodeDefinitions>
- <childNodeDefinition name="*" defaultPrimaryType="mop:content" autoCreated="false" mandatory="false"
- onParentVersion="COPY" protected="false" sameNameSiblings="false">
- <requiredPrimaryTypes>
- <requiredPrimaryType>mop:content</requiredPrimaryType>
- </requiredPrimaryTypes>
- </childNodeDefinition>
- </childNodeDefinitions>
- </nodeType>
-
- <nodeType name="mop:content" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
- <supertypes>
- <supertype>nt:base</supertype>
- <supertype>mix:referenceable</supertype>
- </supertypes>
- <propertyDefinitions>
- <propertyDefinition name="displayname" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true">
- <valueConstraints/>
- </propertyDefinition>
- <propertyDefinition name="description" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- <propertyDefinition name="creationdate" requiredType="Date" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- <propertyDefinition name="lastmodificationdate" requiredType="Date" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- <propertyDefinition name="accesspermissions" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true">
- <valueConstraints/>
- </propertyDefinition>
- </propertyDefinitions>
- </nodeType>
-
- <nodeType name="mop:portletpreferences" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
- <supertypes>
- <supertype>mop:customizationstate</supertype>
- </supertypes>
- <childNodeDefinitions>
- <childNodeDefinition name="*" defaultPrimaryType="mop:portletpreference" autoCreated="false" mandatory="false"
- onParentVersion="COPY" protected="false" sameNameSiblings="false">
- <requiredPrimaryTypes>
- <requiredPrimaryType>mop:portletpreference</requiredPrimaryType>
- </requiredPrimaryTypes>
- </childNodeDefinition>
- </childNodeDefinitions>
- </nodeType>
-
- <nodeType name="mop:portletpreference" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
- <supertypes>
- <supertype>nt:base</supertype>
- <supertype>mix:referenceable</supertype>
- </supertypes>
- <propertyDefinitions>
- <propertyDefinition name="value" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true">
- <valueConstraints/>
- </propertyDefinition>
- <propertyDefinition name="readonly" requiredType="Boolean" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- </propertyDefinitions>
- </nodeType>
-
- <nodeType name="mop:gadget" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
- <supertypes>
- <supertype>mop:customizationstate</supertype>
- </supertypes>
- <propertyDefinitions>
- <propertyDefinition name="prefs" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- </propertyDefinitions>
- </nodeType>
-
- <nodeType name="mop:wsrpstate" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
- <supertypes>
- <supertype>mop:customizationstate</supertype>
- </supertypes>
- <propertyDefinitions>
- <propertyDefinition name="portletid" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- <propertyDefinition name="state" requiredType="Binary" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- <propertyDefinition name="cloned" requiredType="Boolean" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- </propertyDefinitions>
- </nodeType>
-
-</nodeTypes>
Modified: portal/trunk/component/portal/src/test/java/conf/portal/jcr-configuration.xml
===================================================================
--- portal/trunk/component/portal/src/test/java/conf/portal/jcr-configuration.xml 2009-12-04 17:17:43 UTC (rev 928)
+++ portal/trunk/component/portal/src/test/java/conf/portal/jcr-configuration.xml 2009-12-04 18:07:13 UTC (rev 929)
@@ -80,7 +80,7 @@
<name>autoCreatedInNewRepository</name>
<description>Node types configuration file</description>
<value>jar:/conf/mop-nodetypes.xml</value>
- <value>jar:/conf/portal/portal-nodetypes.xml</value>
+ <value>jar:/conf/content-nodetypes.xml</value>
</values-param>
</init-params>
</component-plugin>
Modified: portal/trunk/gadgets/eXoGadgets/src/main/webapp/WEB-INF/gadget.xml
===================================================================
--- portal/trunk/gadgets/eXoGadgets/src/main/webapp/WEB-INF/gadget.xml 2009-12-04 17:17:43 UTC (rev 928)
+++ portal/trunk/gadgets/eXoGadgets/src/main/webapp/WEB-INF/gadget.xml 2009-12-04 18:07:13 UTC (rev 929)
@@ -36,4 +36,8 @@
<gadget name="rssAggregator">
<path>/gadgets/rssAggregator/rssAggregator.xml</path>
</gadget>
+
+ <gadget name="Currency">
+ <url>http://www.donalobrien.net/apps/google/currency.xml</url>
+ </gadget>
</gadgets>
\ No newline at end of file
Modified: portal/trunk/gadgets/eXoGadgets/src/main/webapp/WEB-INF/web.xml
===================================================================
--- portal/trunk/gadgets/eXoGadgets/src/main/webapp/WEB-INF/web.xml 2009-12-04 17:17:43 UTC (rev 928)
+++ portal/trunk/gadgets/eXoGadgets/src/main/webapp/WEB-INF/web.xml 2009-12-04 18:07:13 UTC (rev 929)
@@ -35,9 +35,5 @@
<filter-name>ResourceRequestFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
-
- <listener>
- <listener-class>org.exoplatform.application.gadget.GadgetRegister</listener-class>
- </listener>
</web-app>
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetEditor.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetEditor.java 2009-12-04 17:17:43 UTC (rev 928)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetEditor.java 2009-12-04 18:07:13 UTC (rev 929)
@@ -154,9 +154,12 @@
fileName = name + ".xml";
dirPath = name;
}
+
+ //
+ Gadget gadget = service.getGadget(name);
if (isEdit)
{
- if (service.getGadget(name) == null)
+ if (gadget == null)
{
UIApplication uiApp = event.getRequestContext().getUIApplication();
uiApp.addMessage(new ApplicationMessage("gadget.msg.changeNotExist", null));
@@ -164,11 +167,17 @@
return;
}
}
- Source source = new Source(fileName, "application/xml", "UTF-8");
+
+ //
+ Source source = new Source(fileName, "application/xml");
source.setTextContent(text);
source.setLastModified(Calendar.getInstance());
- sourceStorage.saveSource(dirPath, source);
- service.saveGadget(GadgetUtil.toGadget(name, sourceStorage.getSourceURI(dirPath + "/" + fileName), true));
+
+ // This will update the source and also update the gadget related cached meta data
+ // from the source
+ sourceStorage.saveSource(gadget, source);
+
+ // service.saveGadget(GadgetUtil.toGadget(name, sourceStorage.getSourceURI(dirPath + "/" + fileName), true));
uiManagement.initData();
uiManagement.setSelectedGadget(name);
event.getRequestContext().addUIComponentToUpdateByAjax(uiManagement);
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetInfo.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetInfo.java 2009-12-04 17:17:43 UTC (rev 928)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetInfo.java 2009-12-04 18:07:13 UTC (rev 929)
@@ -107,7 +107,7 @@
for (String name : nameList)
{
names.append(name);
- if (name != nameList.get(nameList.size() - 1))
+ if (!name.equals(nameList.get(nameList.size() - 1)))
names.append(", ");
}
return names.toString();
@@ -160,11 +160,17 @@
InputStream is = conn.getInputStream();
SourceStorage sourceStorage = uiInfo.getApplicationComponent(SourceStorage.class);
String fileName = name + ".xml";
- Source source = new Source(fileName, "application/xml", "UTF-8");
+ Source source = new Source(fileName, "application/xml");
source.setTextContent(IOUtils.toString(is, "UTF-8"));
source.setLastModified(Calendar.getInstance());
- sourceStorage.saveSource(name, source);
- service.saveGadget(GadgetUtil.toGadget(name, sourceStorage.getSourceURI(name + "/" + fileName), true));
+
+ // This will update the source and also update the gadget related cached meta data
+ // from the source
+ sourceStorage.saveSource(uiInfo.getGadget(), source);
+
+ //
+ // service.saveGadget(GadgetUtil.toGadget(name, sourceStorage.getSourceURI(name + "/" + fileName), true));
+
WebAppController webController = uiManagement.getApplicationComponent(WebAppController.class);
webController.removeApplication(GadgetApplication.EXO_GADGET_GROUP + "/" + name);
uiManagement.initData();
@@ -200,7 +206,7 @@
String dirPath = gaggetUrlPart[gaggetUrlPart.length - 2];
//String dirPath = gaggetUrlPart[gaggetUrlPart.length - 9];
// get gadget's source: path = dir path + file name
- Source source = sourceStorage.getSource(dirPath + "/" + fileName);
+ Source source = sourceStorage.getSource(gadget);
uiEditor.setSource(source);
uiEditor.setDirPath(dirPath);
uiManagement.getChildren().clear();
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml 2009-12-04 17:17:43 UTC (rev 928)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml 2009-12-04 18:07:13 UTC (rev 929)
@@ -106,6 +106,7 @@
<name>namespaces</name>
<property name="dc" value="http://purl.org/dc/elements/1.1/"/>
<property name="mop" value="http://www.gatein.org/jcr/mop/1.0/"/>
+ <property name="app" value="http://www.gatein.org/jcr/app/1.0/"/>
</properties-param>
</init-params>
</component-plugin>
@@ -120,7 +121,8 @@
<value>jar:/conf/ext-nodetypes-config.xml</value>
<value>jar:/conf/organization-nodetypes.xml</value>
<value>jar:/conf/mop-nodetypes.xml</value>
- <value>jar:/conf/portal/portal-nodetypes.xml</value>
+ <value>jar:/conf/application-nodetypes.xml</value>
+ <value>jar:/conf/content-nodetypes.xml</value>
</values-param>
</init-params>
</component-plugin>
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/application-registry-configuration.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/application-registry-configuration.xml 2009-12-04 17:17:43 UTC (rev 928)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/portal/application-registry-configuration.xml 2009-12-04 18:07:13 UTC (rev 929)
@@ -21,6 +21,9 @@
-->
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd" xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+
+
+<!--
<component>
<key>org.exoplatform.application.gadget.GadgetRegistryService</key>
<type>org.exoplatform.application.gadget.jcr.GadgetRegistryServiceImpl</type>
@@ -56,10 +59,12 @@
</properties-param>
</init-params>
</component>
+-->
<component>
<key>org.exoplatform.application.gadget.SourceStorage</key>
- <type>org.exoplatform.application.gadget.jcr.SourceStorageImpl</type>
+ <type>org.exoplatform.application.gadget.impl.SourceStorageImpl</type>
+<!--
<init-params>
<properties-param>
<name>location</name>
@@ -69,8 +74,46 @@
<property name="store.path" value="/"/>
</properties-param>
</init-params>
+-->
</component>
+ <component>
+ <key>org.exoplatform.application.gadget.GadgetRegistryService</key>
+ <type>org.exoplatform.application.gadget.impl.GadgetRegistryServiceImpl</type>
+ <init-params>
+ <value-param>
+ <name>gadgets.country</name>
+ <description>US</description>
+ <value>US</value>
+ </value-param>
+ <value-param>
+ <name>gadgets.language</name>
+ <description>en</description>
+ <value>en</value>
+ </value-param>
+ <value-param>
+ <name>gadgets.moduleId</name>
+ <description>0</description>
+ <value>0</value>
+ </value-param>
+ <value-param>
+ <name>gadgets.hostName</name>
+ <description>Gadget server url</description>
+ <value>eXoGadgetServer/gadgets</value>
+ </value-param>
+ <properties-param>
+ <name>developerInfo</name>
+ <description>The group that is allowed to develop gadgets</description>
+ <property name="developer.group" value="/platform/administrators"/>
+ </properties-param>
+ </init-params>
+ </component>
+
+ <component>
+ <key>org.exoplatform.application.gadget.GadgetDeployer</key>
+ <type>org.exoplatform.application.gadget.GadgetDeployer</type>
+ </component>
+
<component>
<key>org.exoplatform.application.registry.ApplicationRegistryService</key>
<type>org.exoplatform.application.registry.mop.MOPApplicationRegistryService</type>
@@ -537,7 +580,7 @@
<init-params>
<value-param>
<name>name</name>
- <value>registry</value>
+ <value>app</value>
</value-param>
<value-param>
<name>workspace-name</name>
@@ -548,6 +591,15 @@
<value>org.exoplatform.application.registry.mop.ContentRegistry</value>
<value>org.exoplatform.application.registry.mop.CategoryDefinition</value>
<value>org.exoplatform.application.registry.mop.ContentDefinition</value>
+ <value>org.exoplatform.application.gadget.impl.GadgetRegistry</value>
+ <value>org.exoplatform.application.gadget.impl.GadgetDefinition</value>
+ <value>org.exoplatform.application.gadget.impl.LocalGadgetData</value>
+ <value>org.exoplatform.application.gadget.impl.RemoteGadgetData</value>
+<!--
+ <value>org.exoplatform.application.gadget.impl.NTFolder</value>
+ <value>org.exoplatform.application.gadget.impl.NTFile</value>
+ <value>org.exoplatform.application.gadget.impl.NTResource</value>
+-->
</values-param>
</init-params>
</component-plugin>
15 years
gatein SVN: r928 - in components/wsrp/trunk/producer/src/main/java/org/gatein/registration: impl and 1 other directory.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-12-04 12:17:43 -0500 (Fri, 04 Dec 2009)
New Revision: 928
Modified:
components/wsrp/trunk/producer/src/main/java/org/gatein/registration/Registration.java
components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationImpl.java
Log:
- Use generics.
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/registration/Registration.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/registration/Registration.java 2009-12-04 10:30:19 UTC (rev 927)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/registration/Registration.java 2009-12-04 17:17:43 UTC (rev 928)
@@ -70,7 +70,7 @@
*
* @return a Map containing the associated properties
*/
- Map getProperties();
+ Map<QName, Object> getProperties();
void setPropertyValueFor(QName propertyName, Object value) throws IllegalArgumentException;
Modified: components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationImpl.java
===================================================================
--- components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationImpl.java 2009-12-04 10:30:19 UTC (rev 927)
+++ components/wsrp/trunk/producer/src/main/java/org/gatein/registration/impl/RegistrationImpl.java 2009-12-04 17:17:43 UTC (rev 928)
@@ -77,7 +77,7 @@
return consumer;
}
- public Map getProperties()
+ public Map<QName, Object> getProperties()
{
return Collections.unmodifiableMap(properties);
}
15 years
gatein SVN: r927 - in portal/trunk: webui/portal/src/main/java/org/exoplatform/portal/webui/portal and 1 other directories.
by do-not-reply@jboss.org
Author: liem_nguyen
Date: 2009-12-04 05:30:19 -0500 (Fri, 04 Dec 2009)
New Revision: 927
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UISiteManagement.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIMainActionListener.java
Log:
GTNPORTAL-342 Problem when view dashboard page in special case
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UISiteManagement.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UISiteManagement.java 2009-12-04 09:39:03 UTC (rev 926)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/navigation/webui/component/UISiteManagement.java 2009-12-04 10:30:19 UTC (rev 927)
@@ -49,13 +49,11 @@
import org.exoplatform.webui.core.UIApplication;
import org.exoplatform.webui.core.UIContainer;
import org.exoplatform.webui.core.UIPopupWindow;
-import org.exoplatform.webui.core.UIRightClickPopupMenu;
import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
import org.exoplatform.webui.event.Event;
+import org.exoplatform.webui.event.EventListener;
import org.exoplatform.webui.event.Event.Phase;
-import org.exoplatform.webui.event.EventListener;
-import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Comparator;
@@ -63,6 +61,8 @@
import java.util.List;
import java.util.UUID;
+import javax.servlet.http.HttpServletRequest;
+
@ComponentConfigs({
@ComponentConfig(template = "app:/groovy/navigation/webui/component/UISiteManagement.gtmpl", events = {
@EventConfig(name = "EditPortalLayout", listeners = UISiteManagement.EditPortalLayoutActionListener.class),
@@ -209,14 +209,13 @@
else if (config != null)
{
uiPortalApp.addMessage(new ApplicationMessage("UISiteManagement.msg.Invalid-deletePermission",
- new String[]{config.getPortalConfig().getName()}));
- ;
+ new String[]{config.getPortalConfig().getName()}));;
return;
}
else
{
uiPortalApp.addMessage(new ApplicationMessage("UISiteManagement.msg.portal-not-exist",
- new String[]{portalName}));
+ new String[]{portalName}));
return;
}
@@ -253,11 +252,11 @@
UIPortalApplication portalApp = (UIPortalApplication)prContext.getUIApplication();
UserPortalConfig userConfig = service.getUserPortalConfig(portalName, prContext.getRemoteUser());
-
- if(userConfig == null)
+
+ if (userConfig == null)
{
portalApp.addMessage(new ApplicationMessage("UISiteManagement.msg.portal-not-exist",
- new String[]{portalName}));
+ new String[]{portalName}));
return;
}
PortalConfig portalConfig = userConfig.getPortalConfig();
@@ -280,17 +279,20 @@
uiComposer.setComponentConfig(UIPortalComposer.class, null);
UIPortal uiPortal = Util.getUIPortal();
- if (portalName.equals(uiPortal.getName()))
+ uiWorkingWS.setBackupUIPortal(uiPortal);
+
+ UIPortal editPortal = uiWorkingWS.createUIComponent(UIPortal.class, null, null);
+ PortalDataMapper.toUIPortal(editPortal, userConfig);
+ uiEditWS.setUIComponent(editPortal);
+
+ if (uiPortal.getName().equals(editPortal.getName()))
{
- uiEditWS.setUIComponent(uiPortal);
- uiWorkingWS.findFirstComponentOfType(UISiteBody.class).setUIComponent(null);
+ editPortal.setSelectedNode(uiPortal.getSelectedNode());
+ editPortal.setSelectedNavigation(uiPortal.getSelectedNavigation());
+ editPortal.setSelectedPaths(uiPortal.getSelectedPaths());
+ UISiteBody siteBody = uiWorkingWS.findFirstComponentOfType(UISiteBody.class);
+ siteBody.setUIComponent(null);
}
- else
- {
- UIPortal editPortal = uiWorkingWS.createUIComponent(UIPortal.class, null, null);
- PortalDataMapper.toUIPortal(editPortal, userConfig);
- uiEditWS.setUIComponent(editPortal);
- }
portalApp.setModeState(UIPortalApplication.APP_BLOCK_EDIT_MODE);
uiWorkingWS.setRenderedChild(UIPortalApplication.UI_EDITTING_WS_ID);
@@ -312,7 +314,7 @@
UIApplication uiApplication = context.getUIApplication();
UserPortalConfig userConfig = service.getUserPortalConfig(portalName, prContext.getRemoteUser());
- if(userConfig == null)
+ if (userConfig == null)
{
uiApplication.addMessage(new ApplicationMessage("UISiteManagement.msg.portal-not-exist",
new String[]{portalName}));
@@ -323,10 +325,9 @@
UserACL userACL = uicomp.getApplicationComponent(UserACL.class);
if (!userACL.hasEditPermission(portalConfig))
{
- uiApplication.addMessage(new ApplicationMessage("UISiteManagement.msg.Invalid-editPermission", null));
- ;
+ uiApplication.addMessage(new ApplicationMessage("UISiteManagement.msg.Invalid-editPermission", null));;
return;
- }
+ }
UIPopupWindow popUp = uicomp.getChild(UIPopupWindow.class);
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java 2009-12-04 09:39:03 UTC (rev 926)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComposer.java 2009-12-04 10:30:19 UTC (rev 927)
@@ -22,10 +22,11 @@
import org.exoplatform.portal.application.PortalRequestContext;
import org.exoplatform.portal.config.UserPortalConfig;
import org.exoplatform.portal.config.UserPortalConfigService;
-import org.exoplatform.portal.pom.data.ModelChange;
import org.exoplatform.portal.config.model.Page;
+import org.exoplatform.portal.config.model.PageNode;
import org.exoplatform.portal.config.model.PortalConfig;
import org.exoplatform.portal.config.model.PortalProperties;
+import org.exoplatform.portal.pom.data.ModelChange;
import org.exoplatform.portal.resource.SkinService;
import org.exoplatform.portal.webui.application.UIApplicationList;
import org.exoplatform.portal.webui.application.UIPortlet;
@@ -325,33 +326,14 @@
UIWorkingWorkspace uiWorkingWS = uiPortalApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
UIEditInlineWorkspace uiEditWS = uiWorkingWS.getChild(UIEditInlineWorkspace.class);
uiEditWS.getComposer().setEditted(false);
-
- UISiteBody siteBody = uiWorkingWS.findFirstComponentOfType(UISiteBody.class);
- UIPortal uiEditPortal = (UIPortal)uiEditWS.getUIComponent();
- UIPortal uiPortal = (UIPortal)siteBody.getUIComponent();
-
- String uri = null;
- String remoteUser = prContext.getRemoteUser();
- String ownerUser = prContext.getPortalOwner();
- if(uiEditPortal != null && uiEditPortal.getOwner().equals(ownerUser))
- uri = (uiEditPortal.getSelectedNode() != null) ? uiEditPortal.getSelectedNode().getUri() : null;
- else if(uiPortal != null)
- uri = (uiPortal.getSelectedNode() != null) ? uiPortal.getSelectedNode().getUri() : null;
-
- UserPortalConfigService configService = uiPortalApp.getApplicationComponent(UserPortalConfigService.class);
- UserPortalConfig userPortalConfig = configService.getUserPortalConfig(ownerUser, remoteUser);
- UIPortal newPortal = uiWorkingWS.createUIComponent(UIPortal.class, null, null);
- PortalDataMapper.toUIPortal(newPortal, userPortalConfig);
- siteBody.setUIComponent(newPortal);
- uiWorkingWS.getChild(UIEditInlineWorkspace.class).setRendered(false);
-
- uiPortal = (UIPortal)siteBody.getUIComponent();
+ uiEditWS.setRendered(false);
uiWorkingWS.setRenderedChild(UIPortalApplication.UI_VIEWING_WS_ID);
-
- if (uri == null)
- {
- uri = (uiPortal.getSelectedNode() != null) ? uiPortal.getSelectedNode().getUri() : null;
- }
+
+ UISiteBody siteBody = uiWorkingWS.findFirstComponentOfType(UISiteBody.class);
+ UIPortal uiPortal = uiWorkingWS.getBackupUIPortal();
+ siteBody.setUIComponent(uiPortal);
+
+ String uri = uiPortal.getSelectedNode() != null ? uiPortal.getSelectedNode().getUri() : null;
PageNodeEvent<UIPortal> pnevent = new PageNodeEvent<UIPortal>(uiPortal, PageNodeEvent.CHANGE_PAGE_NODE, uri);
uiPortal.broadcast(pnevent, Event.Phase.PROCESS);
prContext.addUIComponentToUpdateByAjax(uiWorkingWS);
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIMainActionListener.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIMainActionListener.java 2009-12-04 09:39:03 UTC (rev 926)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIMainActionListener.java 2009-12-04 10:30:19 UTC (rev 927)
@@ -21,6 +21,7 @@
import org.exoplatform.portal.application.PortalRequestContext;
import org.exoplatform.portal.config.UserACL;
+import org.exoplatform.portal.config.UserPortalConfig;
import org.exoplatform.portal.config.model.Page;
import org.exoplatform.portal.config.model.PortalConfig;
import org.exoplatform.portal.webui.page.UIPage;
@@ -34,7 +35,6 @@
import org.exoplatform.portal.webui.util.PortalDataMapper;
import org.exoplatform.portal.webui.util.Util;
import org.exoplatform.web.application.ApplicationMessage;
-import org.exoplatform.webui.core.UIComponent;
import org.exoplatform.webui.event.Event;
import org.exoplatform.webui.event.EventListener;
@@ -57,7 +57,8 @@
// check edit permission for page
UIPageBody pageBody = uiWorkingWS.findFirstComponentOfType(UIPageBody.class);
UIPage uiPage = (UIPage)pageBody.getUIComponent();
- if (uiPage == null) {
+ if (uiPage == null)
+ {
uiApp.addMessage(new ApplicationMessage("UIPageBrowser.msg.PageNotExist", null));
return;
}
@@ -133,23 +134,20 @@
}
PortalRequestContext pcontext = (PortalRequestContext)event.getRequestContext();
UIWorkingWorkspace uiWorkingWS = uiApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
- uiWorkingWS.setBackupUIPortal(null);
+ uiWorkingWS.setBackupUIPortal(uiPortal);
uiApp.setModeState(UIPortalApplication.APP_BLOCK_EDIT_MODE);
- // uiWorkingWS.addChild(UIPortalComposer.class, null, null);
- // UserPortalConfig portalConfig = uiApp.getUserPortalConfig();
- // UIPortal newPortal = uiWorkingWS.createUIComponent(UIPortal.class,
- // null, null);
- // PortalDataMapper.toUIPortal(newPortal, portalConfig);
- // UIEditInlineWorkspace uiEditWS =
- // uiWorkingWS.addChild(UIEditInlineWorkspace.class, null,
- // UIPortalApplication.UI_EDITTING_WS_ID);
- UIEditInlineWorkspace uiEditWS = uiWorkingWS.getChild(UIEditInlineWorkspace.class);
- // uiEditWS.setUIComponent(newPortal);
- UISiteBody uiSiteBody = uiWorkingWS.findFirstComponentOfType(UISiteBody.class);
- uiEditWS.setUIComponent(uiPortal);
- uiSiteBody.setUIComponent(null);
+ UIPortal newPortal = uiWorkingWS.createUIComponent(UIPortal.class, null, null);
+ PortalDataMapper.toUIPortal(newPortal, uiApp.getUserPortalConfig());
+ newPortal.setSelectedNode(uiPortal.getSelectedNode());
+ newPortal.setSelectedNavigation(uiPortal.getSelectedNavigation());
+ newPortal.setSelectedPaths(uiPortal.getSelectedPaths());
+ UIEditInlineWorkspace uiEditWS = uiWorkingWS.getChild(UIEditInlineWorkspace.class);
+ uiEditWS.setUIComponent(newPortal);
+ UISiteBody siteBody = uiWorkingWS.findFirstComponentOfType(UISiteBody.class);
+ siteBody.setUIComponent(null);
+
UIPortalComposer uiComposer = uiEditWS.getComposer().setRendered(true);
uiComposer.setComponentConfig(UIPortalComposer.class, null);
uiComposer.setShowControl(true);
15 years
gatein SVN: r926 - portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page.
by do-not-reply@jboss.org
Author: tan_pham_dinh
Date: 2009-12-04 04:39:03 -0500 (Fri, 04 Dec 2009)
New Revision: 926
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBody.java
Log:
GNTPORTAL-247: Cannot drag drop when page has maximized portlet
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBody.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBody.java 2009-12-04 09:10:50 UTC (rev 925)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBody.java 2009-12-04 09:39:03 UTC (rev 926)
@@ -121,7 +121,8 @@
uiPortal.setMaximizedUIComponent(null);
}
maximizedComponent = this.getMaximizedUIComponent();
- if(maximizedComponent !=null && maximizedComponent instanceof UIPage){
+ if (maximizedComponent != null && maximizedComponent instanceof UIPage)
+ {
this.setMaximizedUIComponent(null);
}
}
@@ -137,6 +138,11 @@
public void processRender(WebuiRequestContext context) throws Exception
{
+ if (maximizedUIComponent != null && Util.getUIPortalApplication().getModeState() % 2 == 0)
+ {
+ maximizedUIComponent.processRender((WebuiRequestContext)WebuiRequestContext.getCurrentInstance());
+ return;
+ }
if (uicomponent_ == null)
{
setPageBody(Util.getUIPortal().getSelectedNode(), Util.getUIPortal());
15 years
gatein SVN: r925 - portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component.
by do-not-reply@jboss.org
Author: hoang_to
Date: 2009-12-04 04:10:50 -0500 (Fri, 04 Dec 2009)
New Revision: 925
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationForm.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIPermissionForm.java
Log:
GTNPORTAL-343: Can't edit permissions in the application registry
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationForm.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationForm.java 2009-12-04 09:03:21 UTC (rev 924)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationForm.java 2009-12-04 09:10:50 UTC (rev 925)
@@ -106,7 +106,8 @@
application.setDisplayName(application.getApplicationName());
}
service.update(application);
- uiOrganizer.setSelectedApplication(uiOrganizer.getSelectedApplication());
+ //uiOrganizer.setSelectedApplication(uiOrganizer.getSelectedApplication());
+ uiOrganizer.setSelectedApplication(application);
ctx.addUIComponentToUpdateByAjax(uiOrganizer);
}
}
Modified: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIPermissionForm.java
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIPermissionForm.java 2009-12-04 09:03:21 UTC (rev 924)
+++ portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIPermissionForm.java 2009-12-04 09:10:50 UTC (rev 925)
@@ -61,9 +61,9 @@
{
application_ = app;
ArrayList<String> accessPermissions = application_.getAccessPermissions();
- String[] per = new String[accessPermissions.size()];
- if (accessPermissions != null && accessPermissions.size() > 0)
+ if (accessPermissions != null)
{
+ String[] per = new String[accessPermissions.size()];
getChild(UIListPermissionSelector.class).setValue(accessPermissions.toArray(per));
}
}
15 years
gatein SVN: r924 - in portal/trunk/web: portal/src/main/webapp/groovy/portal/webui/application and 1 other directory.
by do-not-reply@jboss.org
Author: thanh.do
Date: 2009-12-04 04:03:21 -0500 (Fri, 04 Dec 2009)
New Revision: 924
Modified:
portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIPortalComponent/Stylesheet.css
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl
Log:
PLF-28:Error UI in container/portlet icon with Default Skin
Modified: portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIPortalComponent/Stylesheet.css
===================================================================
--- portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIPortalComponent/Stylesheet.css 2009-12-04 09:00:39 UTC (rev 923)
+++ portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIPortalComponent/Stylesheet.css 2009-12-04 09:03:21 UTC (rev 924)
@@ -48,18 +48,18 @@
cursor: pointer;
}
-.UIPortlet .EditPortletPropertiesIcon {
- float: left; /* orientation=lt */
- float: right; /* orientation=rt */
+.UIPortlet .EditPortletPropertiesIcon {
+ float: right; /* orientation=lt */
+ float: left; /* orientation=rt */
width: 20px; height: 20px;
background: url('background/Pen.gif') no-repeat top;
margin: 4px 3px 0px 5px; /* orientation=lt */
margin: 4px 5px 0px 3px; /* orientation=rt */
}
-.UIPortlet .DeletePortletIcon {
- float: left; /* orientation=lt */
- float: right; /* orientation=rt */
+.UIPortlet .DeletePortletIcon {
+ float: right; /* orientation=lt */
+ float: left; /* orientation=rt */
width: 20px; height:20px;
background: url('background/Close.gif') no-repeat bottom;
margin: 0px 4px 0px 0px; /* orientation=lt */
Modified: portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl
===================================================================
--- portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl 2009-12-04 09:00:39 UTC (rev 923)
+++ portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl 2009-12-04 09:03:21 UTC (rev 924)
@@ -313,8 +313,8 @@
if(title.length() > 30) title = title.substring(0,27) + "...";
%>
<div class="PortletIcon $portletIcon">$title</div>
+ <a href="<%=uicomponent.event("DeleteComponent","$uicomponent.id")%>" class="DeletePortletIcon" title="<%=_ctx.appRes("UIPortlet.tooltip.deletePortlet");%>"></a>
<a href="<%=uicomponent.event("EditPortlet","$uicomponent.id")%>;eXo.portal.UIPortal.changeComposerSaveButton()" class="EditPortletPropertiesIcon" title="<%=_ctx.appRes("UIPortlet.tooltip.editPortlet");%>"></a>
- <a href="<%=uicomponent.event("DeleteComponent","$uicomponent.id")%>" class="DeletePortletIcon" title="<%=_ctx.appRes("UIPortlet.tooltip.deletePortlet");%>"></a>
</div>
<div class="ClearLeft"><span></span></div>
</div>
15 years
gatein SVN: r923 - in portal/trunk: web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UIToolbar and 3 other directories.
by do-not-reply@jboss.org
Author: tan_pham_dinh
Date: 2009-12-04 04:00:39 -0500 (Fri, 04 Dec 2009)
New Revision: 923
Modified:
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/applicationregistry/webui/component/UIApplicationRegistryPortlet.gtmpl
portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UIToolbar/Stylesheet.css
portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UIToolbar/background/BlueLargeToolbar.gif
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/portal/UIPortalComposer.gtmpl
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBody.java
Log:
GNTPORTAL-247: Cannot drag drop when page has maximized portlet
Modified: portal/trunk/portlet/exoadmin/src/main/webapp/groovy/applicationregistry/webui/component/UIApplicationRegistryPortlet.gtmpl
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/groovy/applicationregistry/webui/component/UIApplicationRegistryPortlet.gtmpl 2009-12-04 08:14:40 UTC (rev 922)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/groovy/applicationregistry/webui/component/UIApplicationRegistryPortlet.gtmpl 2009-12-04 09:00:39 UTC (rev 923)
@@ -19,31 +19,26 @@
<div class="ManagementIconContainer ClearFix">
<%
cssClass = "ItemButton";
- if(uicomponent.getChild(0).isRendered()) cssClass = "ItemButton SelectItemButton";
+ if(uicomponent.getChild(0).isRendered()) cssClass = "SelectItemButton";
%>
- <div onclick="<%=uicomponent.event("ViewChild", "UIApplicationOrganizer")%>" class="$cssClass">
- <div class="LablelIcon OrganizeIcon"><span></span></div>
- <a href="javascript:void(0);" class="ButtonLabel"><%=_ctx.appRes("UIToolbar.label.organize")%></a>
- </div>
+ <a onclick="<%=uicomponent.event("ViewChild", "UIApplicationOrganizer")%>" class="$cssClass ItemButton OrganizeIcon">
+ <%=_ctx.appRes("UIToolbar.label.organize")%>
+ </a>
<%
cssClass = "ItemButton";
if(uicomponent.getChild(2).isRendered()) cssClass = "ItemButton SelectItemButton";
%>
- <div onclick="<%=uicomponent.event("ViewChild", "UIGadgetManagement")%>" class="$cssClass" style="float: <%= isLT? "right" : "left" %>">
- <div class="LablelIcon GadgetIcon"><span></span></div>
- <a href="javascript:void(0)" class="ButtonLabel"><%=_ctx.appRes("UIToolbar.label.gadget")%></a>
- </div>
+ <a onclick="<%=uicomponent.event("ViewChild", "UIGadgetManagement")%>" class="$cssClass ItemButton GadgetIcon" style="float: <%= isLT? "right" : "left" %>">
+ <%=_ctx.appRes("UIToolbar.label.gadget")%>
+ </a>
<div class="HorizontalSeparator" style="float: <%= isLT? "right" : "left" %>"><span></span></div>
<%
cssClass = "ItemButton";
if(uicomponent.getChild(1).isRendered()) cssClass = "ItemButton SelectItemButton";
%>
- <div onclick="<%=uicomponent.event("ViewChild", "UIPortletManagement")%>" class="$cssClass" style="float: <%= isLT? "right" : "left" %>">
- <div class="LablelIcon PorletIcon"><span></span></div>
- <a href="javascript:void(0);" class="ButtonLabel"><%=_ctx.appRes("UIToolbar.label.portlet")%></a>
- </div>
- <div class="HorizontalSeparator" style="float: <%= isLT? "right" : "left" %>"><span></span></div>
-
+ <a onclick="<%=uicomponent.event("ViewChild", "UIPortletManagement")%>" class="$cssClass ItemButton PorletIcon" style="float: <%= isLT? "right" : "left" %>">
+ <%=_ctx.appRes("UIToolbar.label.portlet")%>
+ </a>
</div>
</div>
Modified: portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UIToolbar/Stylesheet.css
===================================================================
--- portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UIToolbar/Stylesheet.css 2009-12-04 08:14:40 UTC (rev 922)
+++ portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UIToolbar/Stylesheet.css 2009-12-04 09:00:39 UTC (rev 923)
@@ -147,93 +147,88 @@
}
/*##############################- BlueLargeToolbar style -#########################*/
+.UIToolbar .BlueLargeToolbar {
+ height: 32px;
+}
+
+.UIToolbar .BlueLargeToolbar .LeftToolbar {
+ background: url('background/BlueLargeToolbar.gif') no-repeat left top;
+ padding-left: 5px;
+ border-bottom: 1px solid #9a9a9a;
+}
+
+.UIToolbar .BlueLargeToolbar .RightToolbar {
+ background: url('background/BlueLargeToolbar.gif') no-repeat right top;
+ padding-right: 5px;
+}
+
+.UIToolbar .BlueLargeToolbar .MiddleToolbar {
+ height: 32px;
+ background: url('background/BlueLargeToolbar.gif') repeat-x center -61px;
+}
+
+.UIToolbar .BlueLargeToolbar a {
+ color: #7e9bc9; font-weight: bold;
+ padding: 0px 5px 0px 5px;
+ cursor: pointer;
+}
+
+.UIToolbar .BlueLargeToolbar a:hover {
+ color: #003c7f;
+}
+
+.UIToolbar .BlueLargeToolbar .SelectItemButton .LablelIcon {
+ filter: alpha(opacity=100);
+ -moz-opacity: 1.0;
+}
+
+.UIToolbar .BlueLargeToolbar .SelectItemButton .ButtonLabel {
+ line-height: 18px;
+ color: #003c7f;
+}
+
+.UIToolbar .BlueLargeToolbar .HorizontalSeparator {
+ float: left; /* orientation=lt */
+ float: right; /* orientation=rt */
+ margin: 2px 8px 0px 10px;
+ margin: 2px 10px 0px 8px;
+ width: 2px;
+ height: 22px;
+ background: url('background/BlueLargeToolbar.gif') no-repeat -6px top;
+}
+
+.UIToolbar .BlueLargeToolbar .ManagementIconContainer {
+ padding-top: 4px;
+ margin-left: 5px;
+}
+
+.UIToolbar .BlueLargeToolbar .ItemButton {
+ float: left; /* orientation=lt */
+ float: right; /* orientation=rt */
+ padding-left: 35px; /* orientation=lt */
+ padding-right: 35px; /* orientation=rt */
+ margin: 0 10px; display: block;
+ background-image: url('background/BlueLargeToolbar.gif');
+ background-repeat: no-repeat;
+ height: 26px; line-height: 26px;
+ color: #363636;
+}
+
+.UIToolbar .BlueLargeToolbar .OrganizeIcon {
+ background-position: left -122px; /* orientation=lt */
+ background-position: right -122px; /* orientation=rt */
+}
+
+.UIToolbar .BlueLargeToolbar .PorletIcon {
+ background-position: left -148px; /* orientation=lt */
+ background-position: right -148px; /* orientation=rt */
+}
+
+.UIToolbar .BlueLargeToolbar .GadgetIcon {
+ background-position: left -174px; /* orientation=lt */
+ background-position: right -174px; /* orientation=rt */
+}
-.UIToolbar .BlueLargeToolbar {
- height: 61px;
-}
-
-.UIToolbar .BlueLargeToolbar .LeftToolbar {
- background: url('background/BlueLargeToolbar.gif') no-repeat left top;
- padding-left: 5px;
-}
-
-.UIToolbar .BlueLargeToolbar .RightToolbar {
- background: url('background/BlueLargeToolbar.gif') no-repeat right top;
- padding-right: 5px;
-}
-
-.UIToolbar .BlueLargeToolbar .MiddleToolbar {
- height: 61px;
- background: url('background/BlueLargeToolbar.gif') repeat-x center -61px;
-}
-
-.UIToolbar .BlueLargeToolbar a {
- color: #7e9bc9; font-weight: bold;
- padding: 0px 5px 0px 5px;
- cursor: pointer;
-}
-
-.UIToolbar .BlueLargeToolbar a:hover {
- color: #003c7f;
-}
-
-.UIToolbar .BlueLargeToolbar .SelectItemButton .LablelIcon {
- filter: alpha(opacity=100);
- -moz-opacity: 1.0;
-}
-
-.UIToolbar .BlueLargeToolbar .SelectItemButton .ButtonLabel {
- line-height: 18px;
- color: #003c7f;
-}
-
-.UIToolbar .BlueLargeToolbar .HorizontalSeparator {
- float: left; /* orientation=lt */
- float: right; /* orientation=rt */
- margin: 0px 8px 0px 10px;
- margin: 0px 10px 0px 8px;
- width: 2px;
- height: 48px;
- background: url('background/BlueLargeToolbar.gif') no-repeat -6px top;
-}
-
-.UIToolbar .BlueLargeToolbar .ButtonLabel {
- height: 20px;
- line-height: 20px;
-}
-
-.UIToolbar .BlueLargeToolbar .ManagementIconContainer {
- padding-top: 4px;
- margin-left: 5px;
-}
-
-.UIToolbar .BlueLargeToolbar .ItemButton {
- float: left; /* orientation=lt */
- float: right; /* orientation=rt */
- text-align: center;
- padding: 5px;
- width: 75px;
-}
-
-.UIToolbar .BlueLargeToolbar .LablelIcon {
- width: 32px; height: 26px;
- margin: auto;
- background-image: url('background/BlueLargeToolbar.gif');
- background-repeat: no-repeat;
-}
-
-.UIToolbar .BlueLargeToolbar .OrganizeIcon {
- background-position: center -122px;
-}
-
-.UIToolbar .BlueLargeToolbar .PorletIcon {
- background-position: center -148px;
-}
-
-.UIToolbar .BlueLargeToolbar .GadgetIcon {
- background-position: center -174px;
-}
-
/*
* minh.js.exo
*/
Modified: portal/trunk/web/eXoResources/src/main/webapp/skin/DefaultSkin/webui/component/UIToolbar/background/BlueLargeToolbar.gif
===================================================================
(Binary files differ)
Modified: portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/portal/UIPortalComposer.gtmpl
===================================================================
--- portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/portal/UIPortalComposer.gtmpl 2009-12-04 08:14:40 UTC (rev 922)
+++ portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/portal/UIPortalComposer.gtmpl 2009-12-04 09:00:39 UTC (rev 923)
@@ -7,7 +7,7 @@
rcontext.getJavascriptManager().addJavascript("eXo.webui.UIPopupWindow.init('$popupId', true, true, true, false);");
rcontext.getJavascriptManager().addJavascript("eXo.webui.UIPopup.setAlign('$popupId', 2, 5, 5);");
%>
-<div class="UIPopupWindow UIDragObject UIPortalComposer" exo:minWidth="200" exo:minHeight="200" id="$uicomponent.id" style="width: 300px; display: block;">
+<div class="UIPopupWindow UIDragObject UIPortalComposer" exo:minWidth="200" exo:minHeight="200" id="$uicomponent.id" style="width: 320px; display: block;">
<div class="TLPortalComposer">
<div class="TRPortalComposer">
<div class="TCPortalComposer">
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBody.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBody.java 2009-12-04 08:14:40 UTC (rev 922)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/page/UIPageBody.java 2009-12-04 09:00:39 UTC (rev 923)
@@ -120,8 +120,8 @@
{
uiPortal.setMaximizedUIComponent(null);
}
- UIComponent maximizedComponentInPageBody = this.getMaximizedUIComponent();
- if(maximizedComponentInPageBody !=null && maximizedComponentInPageBody instanceof UIPage){
+ maximizedComponent = this.getMaximizedUIComponent();
+ if(maximizedComponent !=null && maximizedComponent instanceof UIPage){
this.setMaximizedUIComponent(null);
}
}
@@ -137,11 +137,6 @@
public void processRender(WebuiRequestContext context) throws Exception
{
- if (maximizedUIComponent != null)
- {
- maximizedUIComponent.processRender((WebuiRequestContext)WebuiRequestContext.getCurrentInstance());
- return;
- }
if (uicomponent_ == null)
{
setPageBody(Util.getUIPortal().getSelectedNode(), Util.getUIPortal());
15 years