Author: hfnukal
Date: 2011-07-08 12:52:42 -0400 (Fri, 08 Jul 2011)
New Revision: 6852
Added:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/pom.xml
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/conf/
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/conf/configuration.xml
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/conf/gadgettoken-nodetypes.xml
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/conf/portal/
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/conf/portal/configuration.xml
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/config/
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/config/oauth.json
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/containers/
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/containers/default/
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/containers/default/container.js
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoContainerConfig.java
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoDefaultSecurityTokenGenerator.java
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoHttpFetcher.java
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoModule.java
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoOAuthModule.java
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoOAuthStore.java
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/GadgetToken.java
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/GadgetTokenContainer.java
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/GadgetTokenEntry.java
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/GadgetTokenInfoService.java
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ProxyServletFilter.java
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/SecurityTokenGenerator.java
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/pom.xml
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/resources/
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/resources/tomcat/
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/resources/tomcat/eXoGadgets.xml
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/WEB-INF/
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/WEB-INF/gadget.xml
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/WEB-INF/web.xml
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/gadgets/
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/gadgets/Calculator/
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/gadgets/Calculator/Calculator.xml
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/gadgets/Calendar/
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/gadgets/Calendar/Calendar.xml
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/gadgets/Todo/
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/gadgets/Todo/Todo.xml
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/gadgets/rssAggregator/
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/gadgets/rssAggregator/rssAggregator.xml
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/gadgets/rssAggregator/script.js
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/gadgets/rssAggregator/style.css
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/locale/
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/locale/Todo/
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/locale/Todo/ALL_ALL.xml
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/locale/Todo/ar_ALL.xml
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/locale/Todo/de_ALL.xml
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/locale/Todo/es_ALL.xml
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/locale/Todo/fr_ALL.xml
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/locale/Todo/ja_ALL.xml
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/locale/Todo/kr_ALL.xml
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/locale/Todo/vi_ALL.xml
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/locale/Todo/zh_ALL.xml
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/locale/Todo/zh_TW_ALL.xml
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/skin/
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/skin/DefaultSkin/
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/skin/DefaultSkin/portletIcons/
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/skin/DefaultSkin/portletIcons/Calculator.png
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/skin/DefaultSkin/portletIcons/Calendar.png
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/skin/DefaultSkin/portletIcons/Todo.png
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/skin/DefaultSkin/portletIcons/rssAggregator.png
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/skin/image/
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/skin/image/Button.gif
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/skin/image/ButtonCalendarleft.gif
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/skin/image/ButtonCalendarright.gif
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/skin/image/Calculator.png
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/skin/image/Display.png
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/skin/image/Noteleft.jpg
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/skin/image/Noteright.jpg
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/skin/image/calender.gif
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/skin/image/line.gif
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/pom.xml
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/server/
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/server/pom.xml
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/server/src/
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/server/src/main/
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/server/src/main/webapp/
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/server/src/main/webapp/WEB-INF/
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/server/src/main/webapp/WEB-INF/web.xml
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/server/src/main/webapp/oauth.xml
Modified:
epp/portal/branches/EPP_5_1_Branch/packaging/jboss-as/ear/pom.xml
epp/portal/branches/EPP_5_1_Branch/packaging/jboss-as/integration.war/pom.xml
epp/portal/branches/EPP_5_1_Branch/packaging/jboss-as/pkg/pom.xml
epp/portal/branches/EPP_5_1_Branch/packaging/jboss-as/pom.xml
epp/portal/branches/EPP_5_1_Branch/packaging/module/pom.xml
epp/portal/branches/EPP_5_1_Branch/packaging/pkg/pom.xml
epp/portal/branches/EPP_5_1_Branch/packaging/pom.xml
epp/portal/branches/EPP_5_1_Branch/packaging/product/pom.xml
epp/portal/branches/EPP_5_1_Branch/packaging/reports/pom.xml
Log:
Packaging update
Property changes on: epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core
___________________________________________________________________
Added: svn:ignore
+ target
Copied: epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/pom.xml (from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/core/pom.xml)
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/pom.xml
(rev 0)
+++ epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/pom.xml 2011-07-08 16:52:42
UTC (rev 6852)
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8"?>
+ <!--
+
+ 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.
+ -->
+
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.gadgets</artifactId>
+ <version>5.1.1-epp-DEV02</version>
+ </parent>
+
+ <artifactId>exo.portal.gadgets-core</artifactId>
+ <packaging>jar</packaging>
+ <name>GateIn Portal eXo Gadgets Core</name>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>unpack</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.gatein.shindig</groupId>
+ <artifactId>shindig-gadgets</artifactId>
+ <version>${org.shindig.version}</version>
+ <type>jar</type>
+ <overWrite>false</overWrite>
+
<outputDirectory>${project.build.directory}/classes</outputDirectory>
+
<excludes>config/oauth.json,containers/default/container.js</excludes>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+ <resources>
+ <resource>
+ <directory>src/main/java</directory>
+ <includes>
+ <include>**/container.js</include>
+ <include>**/oauth.json</include>
+ <include>**/*.xml</include>
+ </includes>
+ </resource>
+ </resources>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.component.common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.component.web.controller</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.component.web.security</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.container</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.shindig</groupId>
+ <artifactId>shindig-gadgets</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.shindig</groupId>
+ <artifactId>shindig-common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.shindig</groupId>
+ <artifactId>shindig-features</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.chromattic</groupId>
+ <artifactId>chromattic.api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.chromattic</groupId>
+ <artifactId>chromattic.spi</artifactId>
+ </dependency>
+ </dependencies>
+</project>
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/conf/configuration.xml
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/core/src/main/java/conf/configuration.xml)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/conf/configuration.xml
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/conf/configuration.xml 2011-07-08
16:52:42 UTC (rev 6852)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<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">
+</configuration>
\ No newline at end of file
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/conf/gadgettoken-nodetypes.xml
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/core/src/main/java/conf/gadgettoken-nodetypes.xml)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/conf/gadgettoken-nodetypes.xml
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/conf/gadgettoken-nodetypes.xml 2011-07-08
16:52:42 UTC (rev 6852)
@@ -0,0 +1,75 @@
+<!--
+
+ 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="tkn:gadgettokencontainer" isMixin="false"
hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <childNodeDefinitions>
+ <childNodeDefinition name="*"
defaultPrimaryType="tkn:gadgettoken" autoCreated="false"
mandatory="false"
+ onParentVersion="COPY" protected="false"
sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>tkn:gadgettoken</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="tkn:gadgettoken" isMixin="false"
hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="userId" requiredType="String"
autoCreated="false" mandatory="false" onParentVersion="COPY"
protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="gadgetUri" requiredType="String"
autoCreated="false" mandatory="false" onParentVersion="COPY"
protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="moduleId" requiredType="Long"
autoCreated="false" mandatory="false" onParentVersion="COPY"
protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="tokenName" requiredType="String"
autoCreated="false" mandatory="false" onParentVersion="COPY"
protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="serviceName" requiredType="String"
autoCreated="false" mandatory="false" onParentVersion="COPY"
protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+
+ <propertyDefinition name="accessToken" requiredType="String"
autoCreated="false" mandatory="false" onParentVersion="COPY"
protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="tokenSecret" requiredType="String"
autoCreated="false" mandatory="false" onParentVersion="COPY"
protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="sessionHandle"
requiredType="String" autoCreated="false" mandatory="false"
onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="tokenExpireMillis"
requiredType="Long" autoCreated="false" mandatory="false"
onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ </nodeType>
+
+</nodeTypes>
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/conf/portal/configuration.xml
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/core/src/main/java/conf/portal/configuration.xml)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/conf/portal/configuration.xml
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/conf/portal/configuration.xml 2011-07-08
16:52:42 UTC (rev 6852)
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<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.portal.gadget.core.SecurityTokenGenerator</key>
+ <type>org.exoplatform.portal.gadget.core.ExoDefaultSecurityTokenGenerator</type>
+ </component>
+ <component>
+ <type>org.exoplatform.portal.gadget.core.GadgetTokenInfoService</type>
+ <init-params>
+ <values-param>
+ <name>service.configuration</name>
+ <value>gadget-token</value>
+ <value>7</value>
+ <value>DAY</value>
+ </values-param>
+ </init-params>
+ </component>
+
+ <external-component-plugins>
+
<target-component>org.exoplatform.commons.chromattic.ChromatticManager</target-component>
+ <component-plugin>
+ <name>chromattic</name>
+ <set-method>addLifeCycle</set-method>
+ <type>org.exoplatform.commons.chromattic.ChromatticLifeCycle</type>
+ <init-params>
+ <value-param>
+ <name>domain-name</name>
+ <value>gadgettokens</value>
+ </value-param>
+ <value-param>
+ <name>workspace-name</name>
+ <value>portal-work</value>
+ </value-param>
+ <values-param>
+ <name>entities</name>
+
<value>org.exoplatform.portal.gadget.core.GadgetTokenContainer</value>
+ <value>org.exoplatform.portal.gadget.core.GadgetTokenEntry</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+
+ <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>
+ <description>Node types configuration file</description>
+ <value>jar:/conf/gadgettoken-nodetypes.xml</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+</configuration>
\ No newline at end of file
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/config/oauth.json
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/core/src/main/java/config/oauth.json)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/config/oauth.json
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/config/oauth.json 2011-07-08
16:52:42 UTC (rev 6852)
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+{
+ "http://localhost:8080/gadgets/files/samplecontainer/examples/oauth.xml" : {
+ "" : {
+ "consumer_key" : "gadgetConsumer",
+ "consumer_secret" : "gadgetSecret",
+ "key_type" : "HMAC_SYMMETRIC"
+ }
+ },
+
"http://localhost:8080/gadgets/files/samplecontainer/examples/shindigoauth.xml"
: {
+ "shindig" : {
+ "consumer_key" :
"http://localhost:8080/gadgets/files/samplecontainer/examples/shindigoauth.xml",
+ "consumer_secret" : "secret",
+ "key_type" : "HMAC_SYMMETRIC"
+ }
+ },
+ "http://dirk.balfanz.googlepages.com/contacts.xml" : {
+ "google" : {
+ "consumer_secret" :
"MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBALRiMLAh9iimur8VA7qVvdqxevEuUkW4K+2KdMXmnQbG9Aa7k7eBjK1S+0LYmVjPKlJGNXHDGuy5Fw/d7rjVJ0BLB+ubPK8iA/Tw3hLQgXMRRGRXXCn8ikfuQfjUS1uZSatdLB81mydBETlJhI6GH4twrbDJCR2Bwy/XWXgqgGRzAgMBAAECgYBYWVtleUzavkbrPjy0T5FMou8HX9u2AC2ry8vD/l7cqedtwMPp9k7TubgNFo+NGvKsl2ynyprOZR1xjQ7WgrgVB+mmuScOM/5HVceFuGRDhYTCObE+y1kxRloNYXnx3ei1zbeYLPCHdhxRYW7T0qcynNmwrn05/KO2RLjgQNalsQJBANeA3Q4Nugqy4QBUCEC09SqylT2K9FrrItqL2QKc9v0ZzO2uwllCbg0dwpVuYPYXYvikNHHg+aCWF+VXsb9rpPsCQQDWR9TT4ORdzoj+NccnqkMsDmzt0EfNaAOwHOmVJ2RVBspPcxt5iN4HI7HNeG6U5YsFBb+/GZbgfBT3kpNGWPTpAkBI+gFhjfJvRw38n3g/+UeAkwMI2TJQS4n8+hid0uus3/zOjDySH3XHCUnocn1xOJAyZODBo47E+67R4jV1/gzbAkEAklJaspRPXP877NssM5nAZMU0/O/NGCZ+3jPgDUno6WbJn5cqm8MqWhW1xGkImgRk+fkDBquiq4gPiT898jusgQJAd5Zrr6Q8AO/0isr/3aa6O6NLQxISLKcPDk2NOccAfS/xOtfOz4sJYM3+Bs4Io9+dZGSDCA54Lw03eHTNQghS0A==",
+ "consumer_key" : "weitu.googlepages.com",
+ "key_type" : "RSA_PRIVATE"
+ }
+ }
+}
+
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/containers/default/container.js
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/core/src/main/java/containers/default/container.js)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/containers/default/container.js
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/containers/default/container.js 2011-07-08
16:52:42 UTC (rev 6852)
@@ -0,0 +1,180 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+// Default container configuration. To change the configuration, you have two options:
+//
+// A. If you run the Java server: Create your own "myContainer.js" file and
+// modify the value in web.xml.
+//
+// B. If you run the PHP server: Create a myContainer.js, copy the contents of
container.js to it,
+// change
+// {"gadgets.container" : ["default"],
+// to
+// {"gadgets.container" : ["myContainer"],
+// And make your changes that you need to myContainer.js.
+// Just make sure on the iframe URL you specify &container=myContainer
+// for it to use that config.
+//
+// All configurations will automatically inherit values from this
+// config, so you only need to provide configuration for items
+// that you require explicit special casing for.
+//
+// Please namespace your attributes using the same conventions
+// as you would for javascript objects, e.g. gadgets.features
+// rather than "features".
+
+// NOTE: Please _don't_ leave trailing commas because the php json parser
+// errors out on this.
+
+// Container must be an array; this allows multiple containers
+// to share configuration.
+{"gadgets.container" : ["default"],
+
+// Set of regular expressions to validate the parent parameter. This is
+// necessary to support situations where you want a single container to support
+// multiple possible host names (such as for localized domains, such as
+// <
language>.example.org. If left as null, the parent parameter will be
+// ignored; otherwise, any requests that do not include a parent
+// value matching this set will return a 404 error.
+"gadgets.parent" : null,
+
+// Should all gadgets be forced on to a locked domain?
+"gadgets.lockedDomainRequired" : false,
+
+// DNS domain on which gadgets should render.
+"gadgets.lockedDomainSuffix" : "-a.example.com:8080",
+
+// Various urls generated throughout the code base.
+// iframeBaseUri will automatically have the host inserted
+// if locked domain is enabled and the implementation supports it.
+// query parameters will be added.
+"gadgets.iframeBaseUri" : "/eXoGadgetServer/gadgets/ifr",
+
+// jsUriTemplate will have %host% and %js% substituted.
+// No locked domain special cases, but jsUriTemplate must
+// never conflict with a lockedDomainSuffix.
+"gadgets.jsUriTemplate" :
"http://%host%/eXoGadgetServer/gadgets/js/%js%",
+
+// Callback URL. Scheme relative URL for easy switch between https/http.
+"gadgets.oauthGadgetCallbackTemplate" :
"//%host%/eXoGadgetServer/gadgets/oauthcallback",
+
+// Use an insecure security token by default
+"gadgets.securityTokenType" : "secure",
+"gadgets.securityTokenKeyFile" : "key.txt",
+
+"gadgets.signingKeyFile" : "oauthkey.pem",
+"gadgets.signingKeyName" : "mytestkey",
+
+"gadgets.signedFetchDomain" : "eXo",
+// Config param to load Opensocial data for social
+// preloads in data pipelining. %host% will be
+// substituted with the current host.
+"gadgets.osDataUri" : "http://%host%/social/rpc",
+
+// Uncomment these to switch to a secure version
+//
+//"gadgets.securityTokenType" : "secure",
+//"gadgets.securityTokenKeyFile" : "/path/to/key/file.txt",
+
+"gadgets.content-rewrite" : {
+ "include-urls": ".*",
+ "exclude-urls": "",
+ "include-tags": ["link", "script", "embed",
"img", "style"],
+ "expires": "86400",
+ "proxy-url": "/eXoGadgetServer/gadgets/proxy?url=",
+ "concat-url": "/eXoGadgetServer/gadgets/concat?"
+},
+
+// This config data will be passed down to javascript. Please
+// configure your object using the feature name rather than
+// the javascript name.
+
+// Only configuration for required features will be used.
+// See individual feature.xml files for configuration details.
+"gadgets.features" : {
+ "core.io" : {
+ // Note: /proxy is an open proxy. Be careful how you expose this!
+ "proxyUrl" :
"//%host%/eXoGadgetServer/gadgets/proxy?refresh=%refresh%&url=%url%",
+ "jsonProxyUrl" : "//%host%/eXoGadgetServer/gadgets/makeRequest"
+ },
+ "views" : {
+ "home" : {
+ "isOnlyVisible" : false,
+ "urlTemplate" :
"http://%host%/eXoGadgetServer/gadgets/home?{var}",
+ "aliases": ["DASHBOARD", "default"]
+ },
+ "canvas" : {
+ "isOnlyVisible" : true,
+ "urlTemplate" :
"http://%host%/eXoGadgetServer/gadgets/canvas?{var}",
+ "aliases" : ["FULL_PAGE"]
+ }
+ },
+ "rpc" : {
+ // Path to the relay file. Automatically appended to the parent
+ /// parameter if it passes input validation and is not null.
+ // This should never be on the same host in a production environment!
+ // Only use this for TESTING!
+ "parentRelayUrl" :
"/eXoGadgetServer/gadgets/files/container/rpc_relay.html",
+
+ // If true, this will use the legacy ifpc wire format when making rpc
+ // requests.
+ "useLegacyProtocol" : false
+ },
+ // Skin defaults
+ "skins" : {
+ "properties" : {
+ "BG_COLOR": "",
+ "BG_IMAGE": "",
+ "BG_POSITION": "",
+ "BG_REPEAT": "",
+ "FONT_COLOR": "",
+ "ANCHOR_COLOR": ""
+ }
+ },
+ "opensocial-0.8" : {
+ // Path to fetch opensocial data from
+ // Must be on the same domain as the gadget rendering server
+ "path" : "http://%host%/social",
+ "domain" : "shindig",
+ "enableCaja" : false,
+ "supportedFields" : {
+ "person" : ["id", {"name" : ["familyName",
"givenName", "unstructured"]}, "thumbnailUrl",
"profileUrl"],
+ "activity" : ["id", "title"]
+ }
+ },
+ "osapi.services" : {
+ // Specifying a binding to "container.listMethods" instructs osapi to
dynamicaly introspect the services
+ // provided by the container and delay the gadget onLoad handler until that
introspection is
+ // complete.
+ // Alternatively a container can directly configure services here rather than having
them
+ // introspected. Simply list out the available servies and omit
"container.listMethods" to
+ // avoid the initialization delay caused by gadgets.rpc
+ // E.g. "gadgets.rpc" : ["activities.requestCreate",
"messages.requestSend", "requestShareApp",
"requestPermission"]
+ "gadgets.rpc" : ["container.listMethods"]
+ },
+// "osapi" : {
+// // The endpoints to query for available JSONRPC/REST services
+// "endPoints" : [ "http://%host%/social/rpc",
"http://%host%/gadgets/api/rpc" ]
+// },
+ "osml": {
+ // OSML library resource. Can be set to null or the empty string to disable OSML
+ // for a container.
+ "library": ""
+ }
+}}
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoContainerConfig.java
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoContainerConfig.java)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoContainerConfig.java
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoContainerConfig.java 2011-07-08
16:52:42 UTC (rev 6852)
@@ -0,0 +1,217 @@
+/**
+ * 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.portal.gadget.core;
+
+import com.google.inject.Singleton;
+
+import com.google.inject.Inject;
+import com.google.inject.name.Named;
+import sun.misc.BASE64Encoder;
+
+import org.apache.shindig.auth.BlobCrypterSecurityTokenDecoder;
+import org.apache.shindig.config.ContainerConfigException;
+import org.apache.shindig.config.JsonContainerConfig;
+import org.apache.shindig.expressions.Expressions;
+import org.exoplatform.commons.utils.Safe;
+import org.exoplatform.container.monitor.jvm.J2EEServerInfo;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.Writer;
+import java.security.NoSuchAlgorithmException;
+import java.security.SecureRandom;
+
+/**
+ * <p>The goal of the container config subclass is to integrate security key file
along
+ * with exo configuration.</p>
+ *
+ * <p>The implementation first determine the most relevant directory for performing
the key lookup.
+ * It will look for a <i>gadgets</i> directory under the configuration
directory returned by the
+ * {@link
org.exoplatform.container.monitor.jvm.J2EEServerInfo#getExoConfigurationDirectory()}
+ * method. If no such valid directory can be found then the implementation use the
current execution directory
+ * (which should be /bin in tomcat and jboss).</p>
+ *
+ * <p>When the lookup directory is determined, the implementation looks for a file
named key.txt.
+ * If no such file is found, then it will attempt to create it with a base 64 value
encoded from
+ * a 32 bytes random sequence generated by {@link SecureRandom} seeded by the current
time. If the
+ * file exist already but is a directory then no acton is done.<p>
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
+ * @version $Revision$
+ */
+
+@Singleton
+public class
+ ExoContainerConfig extends JsonContainerConfig
+{
+
+ /** . */
+ private Log log = ExoLogger.getLogger(ExoContainerConfig.class);
+
+ /** . */
+ private static volatile String _keyPath;
+
+ @Inject
+ public ExoContainerConfig((a)Named("shindig.containers.default") String s,
Expressions expressions)
+ throws ContainerConfigException
+ {
+ super(s, expressions);
+
+ //
+ J2EEServerInfo info = new J2EEServerInfo();
+
+ //
+ String confPath = info.getExoConfigurationDirectory();
+
+ File keyFile = null;
+ if (confPath != null)
+ {
+ File confDir = new File(confPath);
+ if (!confDir.exists())
+ {
+ log.debug("Exo conf directory (" + confPath + ") does not
exist");
+ }
+ else
+ {
+ if (!confDir.isDirectory())
+ {
+ log.debug("Exo conf directory (" + confPath + ") is not a
directory");
+ }
+ else
+ {
+ keyFile = new File(confDir, "gadgets/key.txt");
+ }
+ }
+ }
+
+ if (keyFile == null)
+ {
+ keyFile = new File("key.txt");
+ }
+
+ String keyPath = keyFile.getAbsolutePath();
+
+ if (!keyFile.exists())
+ {
+ log.debug("No key file found at path " + keyPath + " generating a
new key and saving it");
+ File fic = keyFile.getAbsoluteFile();
+ File parentFolder = fic.getParentFile();
+ if (!parentFolder.exists())
+ parentFolder.mkdirs();
+ String key = generateKey();
+ Writer out = null;
+ try
+ {
+ out = new FileWriter(keyFile);
+ out.write(key);
+ out.write('\n');
+ log.info("Generated key file " + keyPath + " for eXo
Gadgets");
+ setKeyPath(keyPath);
+ }
+ catch (IOException e)
+ {
+ log.error("Coult not create key file " + keyPath, e);
+ }
+ finally
+ {
+ Safe.close(out);
+ }
+ }
+ else if (!keyFile.isFile())
+ {
+ log.debug("Found key file " + keyPath + " but it's not a
file");
+ }
+ else
+ {
+ log.info("Found key file " + keyPath + " for gadgets
security");
+ setKeyPath(keyPath);
+ }
+ }
+
+ private void setKeyPath(String keyPath)
+ {
+ // _keyPath is volatile so no concurrent writes and read are safe
+ synchronized (ExoContainerConfig.class)
+ {
+ if (_keyPath != null && !_keyPath.equals(keyPath))
+ {
+ throw new IllegalStateException("There is already a configured key path
old=" + _keyPath + " new="
+ + keyPath);
+ }
+ _keyPath = keyPath;
+ }
+ }
+
+ @Override
+ public Object getProperty(String container, String property)
+ {
+ if (property.equals(BlobCrypterSecurityTokenDecoder.SECURITY_TOKEN_KEY_FILE)
&& _keyPath != null)
+ {
+ return _keyPath;
+ }
+ return super.getProperty(container, property);
+ }
+
+ // @Override
+ // public Object getJson(String container, String parameter) {
+ // if (parameter.equals(BlobCrypterSecurityTokenDecoder.SECURITY_TOKEN_KEY_FILE)
&& _keyPath != null) {
+ // return _keyPath;
+ // }
+ // return super.getJson(container, parameter);
+ // }
+
+ /**
+ * It's not public as we don't want to expose it to the outter world. The fact
that this class
+ * is instantiated by Guice and the ExoDefaultSecurityTokenGenerator is managed by exo
kernel
+ * force us to use static reference to share the keyPath value.
+ *
+ * @return the key path
+ */
+ static String getKeyPath()
+ {
+ return _keyPath;
+ }
+
+ /**
+ * Generate a key of 32 bytes encoded in base64. The generation is based on
+ * {@link SecureRandom} seeded with the current time.
+ *
+ * @return the key
+ */
+ private static String generateKey()
+ {
+ try
+ {
+ SecureRandom random = SecureRandom.getInstance("SHA1PRNG");
+ random.setSeed(System.currentTimeMillis());
+ byte bytes[] = new byte[32];
+ random.nextBytes(bytes);
+ BASE64Encoder encoder = new BASE64Encoder();
+ return encoder.encode(bytes);
+ }
+ catch (NoSuchAlgorithmException e)
+ {
+ throw new AssertionError(e);
+ }
+ }
+}
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoDefaultSecurityTokenGenerator.java
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoDefaultSecurityTokenGenerator.java)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoDefaultSecurityTokenGenerator.java
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoDefaultSecurityTokenGenerator.java 2011-07-08
16:52:42 UTC (rev 6852)
@@ -0,0 +1,154 @@
+/**
+ * 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.portal.gadget.core;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.shindig.auth.BlobCrypterSecurityToken;
+import org.apache.shindig.common.crypto.BasicBlobCrypter;
+import org.apache.shindig.common.crypto.BlobCrypter;
+import org.apache.shindig.common.crypto.BlobCrypterException;
+import org.apache.shindig.common.util.TimeSource;
+import org.exoplatform.container.monitor.jvm.J2EEServerInfo;
+import org.exoplatform.web.application.RequestContext;
+
+public class ExoDefaultSecurityTokenGenerator implements SecurityTokenGenerator
+{
+ private String containerKey;
+
+ private final TimeSource timeSource;
+
+ public ExoDefaultSecurityTokenGenerator() throws Exception
+ {
+ // TODO should be moved to config
+ // generateKeys("RSA", 1024);
+ this.containerKey = getKeyFilePath();
+ this.timeSource = new TimeSource();
+ }
+
+ // private static void generateKeys(String keyAlgorithm, int numBits) {
+ // FileOutputStream keyFile = null;
+ // try {
+ // keyFile = new FileOutputStream("exokey.pem");
+ //
+ // // RSA private key
+ //
+ // CertAndKeyGen cakg = new CertAndKeyGen(keyAlgorithm,
"SHA1WithRSA");
+ // cakg.generate(1024);
+ //
+ // PrivateKey privateKey = cakg.getPrivateKey();
+ //
+ // keyFile.write("-----BEGIN RSA PRIVATE KEY-----\n".getBytes());
+ // // wrap at 64
+ // int wrapIndex = 64;
+ // StringBuffer sb = new StringBuffer(new
String(Base64.encode(privateKey.getEncoded())));
+ // for (int i = wrapIndex; i < sb.length(); i = i + wrapIndex + 1) {
+ // sb.insert(i, "\n");
+ // }
+ // keyFile.write((sb.toString()).getBytes());
+ // keyFile.write("\n-----END RSA PRIVATE KEY-----\n".getBytes());
+ //
+ // X500Name name = new X500Name("One", "Two",
"Three", "Four", "Five", "Six");
+ //
+ // X509Certificate certificate = cakg.getSelfCertificate(name, 2000000);
+ // System.out.println("\n CN: " + certificate.getSubjectDN());
+ // keyFile.write("-----BEGIN CERTIFICATE-----\n".getBytes());
+ // // wrap at 64
+ // wrapIndex = 64;
+ // sb = new StringBuffer(new String(Base64.encode(certificate.getEncoded())));
+ // for (int i = wrapIndex; i < sb.length(); i = i + wrapIndex + 1) {
+ // sb.insert(i, "\n");
+ // }
+ // keyFile.write(sb.toString().getBytes());
+ // keyFile.write("\n-----END CERTIFICATE-----".getBytes());
+ // } catch (Exception e) {
+ // e.printStackTrace();
+ // } finally {
+ // Safe.close(keyFile);
+ // }
+ // }
+
+ protected String createToken(String gadgetURL, String owner, String viewer, Long
moduleId, String container)
+ {
+ try
+ {
+ BlobCrypterSecurityToken t = new
BlobCrypterSecurityToken(getBlobCrypter(this.containerKey), container, null);
+
+ t.setAppUrl(gadgetURL);
+ t.setModuleId(moduleId);
+ t.setOwnerId(owner);
+ t.setViewerId(viewer);
+ t.setTrustedJson("trusted");
+
+ return t.encrypt();
+ }
+ catch (IOException e)
+ {
+ e.printStackTrace(); // To change body of catch statement use File |
+ // Settings | File Templates.
+ }
+ catch (BlobCrypterException e)
+ {
+ e.printStackTrace(); // To change body of catch statement use File |
+ // Settings | File Templates.
+ }
+ return null;
+ }
+
+ public String createToken(String gadgetURL, Long moduleId)
+ {
+ RequestContext context = RequestContext.getCurrentInstance();
+ // context.get
+ String rUser = context.getRemoteUser();
+ String viewer = rUser;
+
+ return createToken(gadgetURL, viewer, rUser, moduleId, "default");
+ }
+
+ private BlobCrypter getBlobCrypter(String fileName) throws IOException
+ {
+ BasicBlobCrypter c = new BasicBlobCrypter(new File(fileName));
+ c.timeSource = timeSource;
+ return c;
+ }
+
+ /**
+ * Method returns a path to the file containing the encryption key
+ */
+ private String getKeyFilePath(){
+ J2EEServerInfo info = new J2EEServerInfo();
+ String confPath = info.getExoConfigurationDirectory();
+ File keyFile = null;
+
+ if (confPath != null) {
+ File confDir = new File(confPath);
+ if (confDir != null && confDir.exists() &&
confDir.isDirectory()) {
+ keyFile = new File(confDir, "gadgets/key.txt");
+ }
+ }
+
+ if (keyFile == null) {
+ keyFile = new File("key.txt");
+ }
+
+ return keyFile.getAbsolutePath();
+ }
+}
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoHttpFetcher.java
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoHttpFetcher.java)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoHttpFetcher.java
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoHttpFetcher.java 2011-07-08
16:52:42 UTC (rev 6852)
@@ -0,0 +1,46 @@
+/**
+ * Copyright (C) 2010 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.portal.gadget.core;
+
+import com.google.inject.Singleton;
+
+import com.google.inject.Inject;
+
+import org.apache.shindig.gadgets.http.BasicHttpFetcher;
+
+/**
+ * The goal of Http Fetcher subclass is to overwrite the default timeout in
BasicHttpFetcher
+ * which is quite short time to make a conversion if the server is slow.
+ *
+ * @author <a href="trong.tran(a)exoplatform.com">Trong Tran</a>
+ * @version $Revision$
+ */
+
+@Singleton
+public class ExoHttpFetcher extends BasicHttpFetcher
+{
+ private static final int DEFAULT_CONNECT_TIMEOUT_MS = 15000;
+ private static final int DEFAULT_MAX_OBJECT_SIZE = 1024 * 1024;
+
+ @Inject
+ public ExoHttpFetcher()
+ {
+ super(DEFAULT_MAX_OBJECT_SIZE, DEFAULT_CONNECT_TIMEOUT_MS);
+ }
+}
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoModule.java
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoModule.java)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoModule.java
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoModule.java 2011-07-08
16:52:42 UTC (rev 6852)
@@ -0,0 +1,46 @@
+/**
+ * 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.portal.gadget.core;
+
+import org.apache.shindig.config.ContainerConfig;
+import org.apache.shindig.gadgets.DefaultGuiceModule;
+import org.apache.shindig.gadgets.http.HttpFetcher;
+
+/**
+ * The goal of the module is to bind the {@link
org.apache.shindig.common.ContainerConfig} interface to the
+ * {@link org.exoplatform.portal.gadget.core.ExoContainerConfig} implementation instead
of the default
+ * implementation annotated on the container config interface.
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
+ * @version $Revision$
+ */
+public class ExoModule extends DefaultGuiceModule
+{
+
+ @Override
+ protected void configure()
+ {
+ //super.configure();
+
+ //
+ bind(ContainerConfig.class).to(ExoContainerConfig.class);
+ bind(HttpFetcher.class).to(ExoHttpFetcher.class);
+ }
+}
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoOAuthModule.java
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoOAuthModule.java)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoOAuthModule.java
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoOAuthModule.java 2011-07-08
16:52:42 UTC (rev 6852)
@@ -0,0 +1,169 @@
+/**
+ * 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.portal.gadget.core;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang.StringUtils;
+import org.apache.shindig.auth.AnonymousAuthenticationHandler;
+import org.apache.shindig.common.crypto.BlobCrypter;
+import org.apache.shindig.common.util.ResourceLoader;
+import org.apache.shindig.config.ContainerConfig;
+import org.apache.shindig.gadgets.http.HttpFetcher;
+import org.apache.shindig.gadgets.oauth.BasicOAuthStore;
+import org.apache.shindig.gadgets.oauth.BasicOAuthStoreConsumerKeyAndSecret;
+import org.apache.shindig.gadgets.oauth.OAuthFetcherConfig;
+import org.apache.shindig.gadgets.oauth.OAuthModule;
+import org.apache.shindig.gadgets.oauth.OAuthRequest;
+import org.apache.shindig.gadgets.oauth.OAuthStore;
+import org.apache.shindig.gadgets.oauth.BasicOAuthStoreConsumerKeyAndSecret.KeyType;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+import com.google.inject.name.Names;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: jeremi
+ * Date: Jan 9, 2009
+ * Time: 10:45:57 AM
+ * To change this template use File | Settings | File Templates.
+ */
+public class ExoOAuthModule extends OAuthModule
+{
+ private static final String SIGNING_KEY_FILE = "gadgets.signingKeyFile";
+
+ private static final String SIGNING_KEY_NAME = "gadgets.signingKeyName";
+
+ private static final String CALLBACK_URL =
"gadgets.signing.global-callback-url";
+
+ private static final String OAUTH_CONFIG = "config/oauth.json";
+ private static final String OAUTH_SIGNING_KEY_FILE =
"shindig.signing.key-file";
+ private static final String OAUTH_SIGNING_KEY_NAME =
"shindig.signing.key-name";
+ private static final String OAUTH_CALLBACK_URL =
"shindig.signing.global-callback-url";
+
+
+ private static final Logger logger = Logger.getLogger(OAuthModule.class.getName());
+
+ @Override
+ protected void configure()
+ {
+ // Used for encrypting client-side OAuth state.
+
bind(BlobCrypter.class).annotatedWith(Names.named(OAuthFetcherConfig.OAUTH_STATE_CRYPTER)).toProvider(
+ OAuthCrypterProvider.class);
+
+ // Used for persistent storage of OAuth access tokens.
+ bind(OAuthStore.class).toProvider(ExoOAuthStoreProvider.class);
+ bind(OAuthRequest.class).toProvider(OAuthRequestProvider.class);
+
+ // TODO: tung.dang add some missing implement
+
bind(Boolean.class).annotatedWith(Names.named(AnonymousAuthenticationHandler.ALLOW_UNAUTHENTICATED)).toInstance(
+ Boolean.TRUE);
+ }
+
+ public static class ExoOAuthStoreProvider implements Provider<OAuthStore>
+ {
+
+ private final ExoOAuthStore store;
+
+ @Inject
+ public ExoOAuthStoreProvider(ContainerConfig config)
+ {
+ //super(config.getString(ContainerConfig.DEFAULT_CONTAINER, SIGNING_KEY_FILE),
config.getString(ContainerConfig.DEFAULT_CONTAINER, SIGNING_KEY_NAME));
+// super(config.getString(ContainerConfig.DEFAULT_CONTAINER, SIGNING_KEY_FILE),
config.getString(
+// ContainerConfig.DEFAULT_CONTAINER, SIGNING_KEY_NAME),
config.getString(ContainerConfig.DEFAULT_CONTAINER,
+// CALLBACK_URL));
+
+ store = new ExoOAuthStore();
+
+ String signingKeyFile = config.getString(ContainerConfig.DEFAULT_CONTAINER,
SIGNING_KEY_FILE);
+ String signingKeyName = config.getString(ContainerConfig.DEFAULT_CONTAINER,
SIGNING_KEY_NAME);
+ String defaultCallbackUrl =
config.getString(ContainerConfig.DEFAULT_CONTAINER,CALLBACK_URL);
+
+ loadDefaultKey(signingKeyFile, signingKeyName);
+ store.setDefaultCallbackUrl(defaultCallbackUrl);
+ loadConsumers();
+ }
+
+
+
+ private void loadDefaultKey(String signingKeyFile, String signingKeyName) {
+ BasicOAuthStoreConsumerKeyAndSecret key = null;
+ if (!StringUtils.isBlank(signingKeyFile)) {
+ try {
+ logger.info("Loading OAuth signing key from " + signingKeyFile);
+ String privateKey = IOUtils.toString(ResourceLoader.open(signingKeyFile),
"UTF-8");
+ privateKey = BasicOAuthStore.convertFromOpenSsl(privateKey);
+ key = new BasicOAuthStoreConsumerKeyAndSecret(null, privateKey,
KeyType.RSA_PRIVATE,
+ signingKeyName, null);
+ } catch (Throwable t) {
+ logger.log(Level.WARNING, "Couldn't load key file " +
signingKeyFile, t);
+ }
+ }
+ if (key != null) {
+ store.setDefaultKey(key);
+ } else {
+ logger.log(Level.WARNING, "Couldn't load OAuth signing key. To create
a key, run:\n" +
+ " openssl req -newkey rsa:1024 -days 365 -nodes -x509 -keyout
testkey.pem \\\n" +
+ " -out testkey.pem -subj '/CN=mytestkey'\n" +
+ " openssl pkcs8 -in testkey.pem -out oauthkey.pem -topk8 -nocrypt
-outform PEM\n" +
+ '\n' +
+ "Then edit gadgets.properties and add these lines:\n" +
+ OAUTH_SIGNING_KEY_FILE + "=<path-to-oauthkey.pem>\n" +
+ OAUTH_SIGNING_KEY_NAME + "=mykey\n");
+ }
+ }
+
+ private void loadConsumers() {
+ try {
+ String oauthConfigString = ResourceLoader.getContent(OAUTH_CONFIG);
+ store.initFromConfigString(oauthConfigString);
+ } catch (Throwable t) {
+ logger.log(Level.WARNING, "Failed to initialize OAuth consumers from
" + OAUTH_CONFIG, t);
+ }
+ }
+
+ public OAuthStore get() {
+ return store;
+ }
+ }
+
+ public static class ExoOAuthRequestProvider extends OAuthRequestProvider
+ {
+ private final HttpFetcher fetcher;
+
+ private final OAuthFetcherConfig config;
+
+ @Inject
+ public ExoOAuthRequestProvider(HttpFetcher fetcher, OAuthFetcherConfig config)
+ {
+ super(fetcher, config);
+ this.fetcher = fetcher;
+ this.config = config;
+ }
+
+ public OAuthRequest get()
+ {
+ return new OAuthRequest(config, fetcher);
+ }
+ }
+}
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoOAuthStore.java
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoOAuthStore.java)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoOAuthStore.java
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoOAuthStore.java 2011-07-08
16:52:42 UTC (rev 6852)
@@ -0,0 +1,250 @@
+package org.exoplatform.portal.gadget.core;
+
+import com.google.common.collect.Maps;
+import net.oauth.OAuth;
+import net.oauth.OAuthConsumer;
+import net.oauth.OAuthServiceProvider;
+import net.oauth.signature.RSA_SHA1;
+
+import org.apache.shindig.auth.SecurityToken;
+import org.apache.shindig.gadgets.GadgetException;
+import org.apache.shindig.gadgets.oauth.BasicOAuthStoreConsumerIndex;
+import org.apache.shindig.gadgets.oauth.BasicOAuthStoreConsumerKeyAndSecret;
+import org.apache.shindig.gadgets.oauth.BasicOAuthStoreTokenIndex;
+import org.apache.shindig.gadgets.oauth.OAuthStore;
+import org.apache.shindig.gadgets.oauth.BasicOAuthStoreConsumerKeyAndSecret.KeyType;
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.PortalContainer;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Iterator;
+import java.util.Map;
+
+/*
+* Created by The eXo Platform SAS
+* Author : tung.dang
+* tungcnw(a)gmail.com
+* Dec 10, 2009
+*
+*/
+
+/**
+ * Simple implementation of the {@link OAuthStore} interface. We use a
+ * in-memory hash map. If initialized with a private key, then the store will
+ * return an OAuthAccessor in {@code getOAuthAccessor} that uses that private
+ * key if no consumer key and secret could be found.
+ */
+
+public class ExoOAuthStore implements OAuthStore {
+
+ private static final String CONSUMER_SECRET_KEY = "consumer_secret";
+ private static final String CONSUMER_KEY_KEY = "consumer_key";
+ private static final String KEY_TYPE_KEY = "key_type";
+ private static final String CALLBACK_URL = "callback_url";
+
+ /**
+ * HashMap of provider and consumer information. Maps BasicOAuthStoreConsumerIndexs
(i.e.
+ * nickname of a service provider and the gadget that uses that nickname) to
+ * {@link BasicOAuthStoreConsumerKeyAndSecret}s.
+ */
+ private final Map<BasicOAuthStoreConsumerIndex,
BasicOAuthStoreConsumerKeyAndSecret> consumerInfos;
+
+ /**
+ * HashMap of token information. Maps BasicOAuthStoreTokenIndexs (i.e. gadget id,
token
+ * nickname, module id, etc.) to TokenInfos (i.e. access token and token
+ * secrets).
+ */
+ // TODO: tung.dang don't need it, we store token in our memory.
+ //private Map<BasicOAuthStoreTokenIndex, TokenInfo> tokens = Maps.newHashMap();
+
+
+ /**
+ * Key to use when no other key is found.
+ */
+ private BasicOAuthStoreConsumerKeyAndSecret defaultKey;
+
+ /**
+ * Callback to use when no per-key callback URL is found.
+ */
+ private String defaultCallbackUrl;
+
+ /** Number of times we looked up a consumer key */
+ private int consumerKeyLookupCount = 0;
+
+ /** Number of times we looked up an access token */
+ private int accessTokenLookupCount = 0;
+
+ /** Number of times we added an access token */
+ private int accessTokenAddCount = 0;
+
+ /** Number of times we removed an access token */
+ private int accessTokenRemoveCount = 0;
+
+ public ExoOAuthStore() {
+ consumerInfos = Maps.newHashMap();
+ }
+
+ public void initFromConfigString(String oauthConfigStr) throws GadgetException {
+ try {
+ JSONObject oauthConfigs = new JSONObject(oauthConfigStr);
+ for (Iterator<?> i = oauthConfigs.keys(); i.hasNext();) {
+ String url = (String) i.next();
+ URI gadgetUri = new URI(url);
+ JSONObject oauthConfig = oauthConfigs.getJSONObject(url);
+ storeConsumerInfos(gadgetUri, oauthConfig);
+ }
+ } catch (JSONException e) {
+ throw new GadgetException(GadgetException.Code.OAUTH_STORAGE_ERROR, e);
+ } catch (URISyntaxException e) {
+ throw new GadgetException(GadgetException.Code.OAUTH_STORAGE_ERROR, e);
+ }
+ }
+
+ private void storeConsumerInfos(URI gadgetUri, JSONObject oauthConfig)
+ throws JSONException, GadgetException {
+ for (String serviceName : JSONObject.getNames(oauthConfig)) {
+ JSONObject consumerInfo = oauthConfig.getJSONObject(serviceName);
+ storeConsumerInfo(gadgetUri, serviceName, consumerInfo);
+ }
+ }
+
+ private void storeConsumerInfo(URI gadgetUri, String serviceName, JSONObject
consumerInfo)
+ throws JSONException, GadgetException {
+ realStoreConsumerInfo(gadgetUri, serviceName, consumerInfo);
+ }
+
+ private void realStoreConsumerInfo(URI gadgetUri, String serviceName, JSONObject
consumerInfo)
+ throws JSONException {
+ String callbackUrl = consumerInfo.optString(CALLBACK_URL, null);
+ String consumerSecret = consumerInfo.getString(CONSUMER_SECRET_KEY);
+ String consumerKey = consumerInfo.getString(CONSUMER_KEY_KEY);
+ String keyTypeStr = consumerInfo.getString(KEY_TYPE_KEY);
+ KeyType keyType = KeyType.HMAC_SYMMETRIC;
+
+ if (keyTypeStr.equals("RSA_PRIVATE")) {
+ keyType = KeyType.RSA_PRIVATE;
+ consumerSecret = convertFromOpenSsl(consumerSecret);
+ }
+
+ BasicOAuthStoreConsumerKeyAndSecret kas = new BasicOAuthStoreConsumerKeyAndSecret(
+ consumerKey, consumerSecret, keyType, null, callbackUrl);
+
+ BasicOAuthStoreConsumerIndex index = new BasicOAuthStoreConsumerIndex();
+ index.setGadgetUri(gadgetUri.toASCIIString());
+ index.setServiceName(serviceName);
+ setConsumerKeyAndSecret(index, kas);
+ }
+
+ // Support standard openssl keys by stripping out the headers and blank lines
+ public static String convertFromOpenSsl(String privateKey) {
+ return privateKey.replaceAll("-----[A-Z ]*-----",
"").replace("\n", "");
+ }
+
+ public void setDefaultKey(BasicOAuthStoreConsumerKeyAndSecret defaultKey) {
+ this.defaultKey = defaultKey;
+ }
+
+ public void setDefaultCallbackUrl(String defaultCallbackUrl) {
+ this.defaultCallbackUrl = defaultCallbackUrl;
+ }
+
+ public void setConsumerKeyAndSecret(
+ BasicOAuthStoreConsumerIndex providerKey, BasicOAuthStoreConsumerKeyAndSecret
keyAndSecret) {
+ consumerInfos.put(providerKey, keyAndSecret);
+ }
+
+ public ConsumerInfo getConsumerKeyAndSecret(
+ SecurityToken securityToken, String serviceName, OAuthServiceProvider provider)
+ throws GadgetException {
+ ++consumerKeyLookupCount;
+ BasicOAuthStoreConsumerIndex pk = new BasicOAuthStoreConsumerIndex();
+ pk.setGadgetUri(securityToken.getAppUrl());
+ pk.setServiceName(serviceName);
+ BasicOAuthStoreConsumerKeyAndSecret cks = consumerInfos.get(pk);
+ if (cks == null) {
+ cks = defaultKey;
+ }
+ if (cks == null) {
+ throw new GadgetException(GadgetException.Code.INTERNAL_SERVER_ERROR,
+ "No key for gadget " + securityToken.getAppUrl() + " and service
" + serviceName);
+ }
+ OAuthConsumer consumer = null;
+ if (cks.getKeyType() == KeyType.RSA_PRIVATE) {
+ consumer = new OAuthConsumer(null, cks.getConsumerKey(), null, provider);
+ // The
oauth.net java code has lots of magic. By setting this property here, code
thousands
+ // of lines away knows that the consumerSecret value in the consumer should be
treated as
+ // an RSA private key and not an HMAC key.
+ consumer.setProperty(OAuth.OAUTH_SIGNATURE_METHOD, OAuth.RSA_SHA1);
+ consumer.setProperty(RSA_SHA1.PRIVATE_KEY, cks.getConsumerSecret());
+ } else {
+ consumer = new OAuthConsumer(null, cks.getConsumerKey(), cks.getConsumerSecret(),
provider);
+ consumer.setProperty(OAuth.OAUTH_SIGNATURE_METHOD, OAuth.HMAC_SHA1);
+ }
+ String callback = (cks.getCallbackUrl() != null ? cks.getCallbackUrl() :
defaultCallbackUrl);
+ return new ConsumerInfo(consumer, cks.getKeyName(), callback);
+ }
+
+ private BasicOAuthStoreTokenIndex makeBasicOAuthStoreTokenIndex(
+ SecurityToken securityToken, String serviceName, String tokenName) {
+ BasicOAuthStoreTokenIndex tokenKey = new BasicOAuthStoreTokenIndex();
+ tokenKey.setGadgetUri(securityToken.getAppUrl());
+
+ // TODO: tung.dang need to improve, why moduleId different each time?.
+ //tokenKey.setModuleId(securityToken.getModuleId());
+
+ tokenKey.setServiceName(serviceName);
+ tokenKey.setTokenName(tokenName);
+ tokenKey.setUserId(securityToken.getViewerId());
+ return tokenKey;
+ }
+
+ public TokenInfo getTokenInfo(SecurityToken securityToken, ConsumerInfo consumerInfo,
+ String serviceName, String tokenName) {
+ ++accessTokenLookupCount;
+ BasicOAuthStoreTokenIndex tokenKey =
+ makeBasicOAuthStoreTokenIndex(securityToken, serviceName, tokenName);
+
+ ExoContainer container = PortalContainer.getInstance();
+ GadgetTokenInfoService tokenSer =
(GadgetTokenInfoService)container.getComponentInstanceOfType(GadgetTokenInfoService.class);
+ return tokenSer.getToken(tokenKey);
+ }
+
+ public void setTokenInfo(SecurityToken securityToken, ConsumerInfo consumerInfo,
+ String serviceName, String tokenName, TokenInfo tokenInfo) {
+ ++accessTokenAddCount;
+ BasicOAuthStoreTokenIndex tokenKey =
+ makeBasicOAuthStoreTokenIndex(securityToken, serviceName, tokenName);
+ ExoContainer container = PortalContainer.getInstance();
+ GadgetTokenInfoService tokenSer =
(GadgetTokenInfoService)container.getComponentInstanceOfType(GadgetTokenInfoService.class);
+ tokenSer.createToken(tokenKey, tokenInfo);
+ }
+
+ public void removeToken(SecurityToken securityToken, ConsumerInfo consumerInfo,
+ String serviceName, String tokenName) {
+ ++accessTokenRemoveCount;
+ BasicOAuthStoreTokenIndex tokenKey =
+ makeBasicOAuthStoreTokenIndex(securityToken, serviceName, tokenName);
+ ExoContainer container = PortalContainer.getInstance();
+ GadgetTokenInfoService tokenSer =
(GadgetTokenInfoService)container.getComponentInstanceOfType(GadgetTokenInfoService.class);
+ tokenSer.deleteToken(tokenKey);
+ }
+
+ public int getConsumerKeyLookupCount() {
+ return consumerKeyLookupCount;
+ }
+
+ public int getAccessTokenLookupCount() {
+ return accessTokenLookupCount;
+ }
+
+ public int getAccessTokenAddCount() {
+ return accessTokenAddCount;
+ }
+
+ public int getAccessTokenRemoveCount() {
+ return accessTokenRemoveCount;
+ }
+}
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/GadgetToken.java
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/GadgetToken.java)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/GadgetToken.java
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/GadgetToken.java 2011-07-08
16:52:42 UTC (rev 6852)
@@ -0,0 +1,31 @@
+package org.exoplatform.portal.gadget.core;
+
+import org.apache.shindig.gadgets.oauth.OAuthStore.TokenInfo;
+import org.exoplatform.web.security.Credentials;
+import org.exoplatform.web.security.Token;
+
+
+public class GadgetToken extends TokenInfo implements Token
+{
+ public GadgetToken(String accessToken, String tokenSecret, String sessionHandle,
+ long tokenExpireMillis)
+ {
+ super(accessToken, tokenSecret, sessionHandle, tokenExpireMillis);
+ }
+
+ public boolean isExpired()
+ {
+ return false;
+ }
+
+ public long getExpirationTimeMillis()
+ {
+ return getTokenExpireMillis();
+ }
+
+ public Credentials getPayload()
+ {
+ // Should we return something ?
+ return null;
+ }
+}
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/GadgetTokenContainer.java
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/GadgetTokenContainer.java)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/GadgetTokenContainer.java
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/GadgetTokenContainer.java 2011-07-08
16:52:42 UTC (rev 6852)
@@ -0,0 +1,76 @@
+package org.exoplatform.portal.gadget.core;
+
+import org.apache.shindig.gadgets.oauth.BasicOAuthStoreTokenIndex;
+import org.apache.shindig.gadgets.oauth.OAuthStore.TokenInfo;
+import org.chromattic.api.annotations.Create;
+import org.chromattic.api.annotations.OneToMany;
+import org.chromattic.api.annotations.PrimaryType;
+
+import java.util.Map;
+
+@PrimaryType(name = "tkn:gadgettokencontainer")
+public abstract class GadgetTokenContainer
+{
+ @Create
+ protected abstract GadgetTokenEntry createGadgetToken();
+
+ @OneToMany
+ protected abstract Map<String, GadgetTokenEntry> getGadgetTokens();
+
+ public GadgetToken getToken(BasicOAuthStoreTokenIndex tokenKey)
+ {
+ Map<String, GadgetTokenEntry> tokens = getGadgetTokens();
+ for (GadgetTokenEntry tokenEntry : tokens.values())
+ {
+ BasicOAuthStoreTokenIndex key = tokenEntry.getKey();
+ if (tokenKey.equals(key)) return tokenEntry.getToken();
+ }
+ return null;
+ }
+
+ public GadgetToken removeToken(BasicOAuthStoreTokenIndex tokenKey)
+ {
+ Map<String, GadgetTokenEntry> tokens = getGadgetTokens();
+
+ for (GadgetTokenEntry tokenEntry : tokens.values())
+ {
+ BasicOAuthStoreTokenIndex key = tokenEntry.getKey();
+ if (tokenKey.equals(key))
+ {
+ tokenEntry.remove();
+ return tokenEntry.getToken();
+ }
+ }
+ return null;
+ }
+
+ public GadgetToken saveToken(BasicOAuthStoreTokenIndex tokenKey, TokenInfo tokenInfo)
+ {
+ Map<String, GadgetTokenEntry> tokens = getGadgetTokens();
+ GadgetTokenEntry entry = null;
+ for (GadgetTokenEntry item : tokens.values())
+ {
+ BasicOAuthStoreTokenIndex key = item.getKey();
+ if (tokenKey.equals(key))
+ {
+ entry = item;
+ }
+ }
+ if (entry == null)
+ {
+ entry = createGadgetToken();
+ tokens.put("gadgettoken" + System.currentTimeMillis(), entry);
+ }
+ entry.setGadgetUri(tokenKey.getGadgetUri());
+ entry.setModuleId(tokenKey.getModuleId());
+ entry.setServiceName(tokenKey.getServiceName());
+ entry.setTokenName(tokenKey.getTokenName());
+ entry.setUserId(tokenKey.getUserId());
+
+ entry.setAccessToken(tokenInfo.getAccessToken());
+ entry.setTokenSecret(tokenInfo.getTokenSecret());
+ entry.setSessionHandle(tokenInfo.getSessionHandle() == null ? "" :
tokenInfo.getSessionHandle());
+ entry.setTokenExpireMillis(tokenInfo.getTokenExpireMillis());
+ return entry.getToken();
+ }
+}
\ No newline at end of file
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/GadgetTokenEntry.java
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/GadgetTokenEntry.java)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/GadgetTokenEntry.java
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/GadgetTokenEntry.java 2011-07-08
16:52:42 UTC (rev 6852)
@@ -0,0 +1,75 @@
+package org.exoplatform.portal.gadget.core;
+
+import org.apache.shindig.gadgets.oauth.BasicOAuthStoreTokenIndex;
+import org.chromattic.api.annotations.Destroy;
+import org.chromattic.api.annotations.PrimaryType;
+import org.chromattic.api.annotations.Property;
+
+@PrimaryType(name = "tkn:gadgettoken")
+public abstract class GadgetTokenEntry
+{
+
+ public BasicOAuthStoreTokenIndex getKey()
+ {
+ BasicOAuthStoreTokenIndex key = new BasicOAuthStoreTokenIndex();
+ key.setGadgetUri(getGadgetUri());
+ key.setModuleId(getModuleId());
+ key.setServiceName(getServiceName());
+ key.setTokenName(getTokenName());
+ key.setUserId(getUserId());
+ return key;
+ }
+
+ @Property(name = "userId")
+ public abstract String getUserId();
+
+ public abstract void setUserId(String userId);
+
+ @Property(name = "gadgetUri")
+ public abstract String getGadgetUri();
+
+ public abstract void setGadgetUri(String gadgetUri);
+
+ @Property(name = "moduleId")
+ public abstract long getModuleId();
+
+ public abstract void setModuleId(long moduleId);
+
+ @Property(name = "tokenName")
+ public abstract String getTokenName();
+
+ public abstract void setTokenName(String tokenName);
+
+ @Property(name = "serviceName")
+ public abstract String getServiceName();
+
+ public abstract void setServiceName(String serviceName);
+
+ @Property(name = "accessToken")
+ public abstract String getAccessToken();
+
+ public abstract void setAccessToken(String accessToken);
+
+ @Property(name = "tokenSecret")
+ public abstract String getTokenSecret();
+
+ public abstract void setTokenSecret(String tokenSecret);
+
+ @Property(name = "sessionHandle")
+ public abstract String getSessionHandle();
+
+ public abstract void setSessionHandle(String sessionHandle);
+
+ @Property(name = "tokenExpireMillis")
+ public abstract long getTokenExpireMillis();
+
+ public abstract void setTokenExpireMillis(long tokenExpireMillis);
+
+ @Destroy
+ public abstract void remove();
+
+ public GadgetToken getToken()
+ {
+ return new GadgetToken(getAccessToken(), getTokenSecret(), getServiceName(),
getTokenExpireMillis());
+ }
+}
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/GadgetTokenInfoService.java
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/GadgetTokenInfoService.java)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/GadgetTokenInfoService.java
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/GadgetTokenInfoService.java 2011-07-08
16:52:42 UTC (rev 6852)
@@ -0,0 +1,173 @@
+/**
+ * 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.portal.gadget.core;
+
+import org.apache.shindig.gadgets.oauth.BasicOAuthStoreTokenIndex;
+import org.apache.shindig.gadgets.oauth.OAuthStore.TokenInfo;
+import org.chromattic.api.ChromatticSession;
+import org.exoplatform.commons.chromattic.ChromatticLifeCycle;
+import org.exoplatform.commons.chromattic.ChromatticManager;
+import org.exoplatform.commons.chromattic.ContextualTask;
+import org.exoplatform.commons.chromattic.SessionContext;
+import org.exoplatform.container.xml.InitParams;
+import org.exoplatform.web.security.Credentials;
+import org.exoplatform.web.security.security.AbstractTokenService;
+
+import java.util.Collection;
+
+public class GadgetTokenInfoService extends AbstractTokenService<GadgetToken,
BasicOAuthStoreTokenIndex>
+{
+
+ private ChromatticLifeCycle chromatticLifeCycle;
+
+ public GadgetTokenInfoService(InitParams initParams, ChromatticManager
chromatticManager)
+ {
+ super(initParams);
+ chromatticLifeCycle = chromatticManager.getLifeCycle("gadgettokens");
+ }
+
+ public GadgetToken createToken(final BasicOAuthStoreTokenIndex key, final TokenInfo
tokenInfo)
+ {
+ return new TokenTask<GadgetToken>()
+ {
+ @Override
+ protected GadgetToken execute()
+ {
+ GadgetTokenContainer container = getGadgetTokenContainer();
+ return container.saveToken(key, tokenInfo);
+ }
+ }.executeWith(chromatticLifeCycle);
+ }
+
+ @Override
+ public GadgetToken getToken(final BasicOAuthStoreTokenIndex key)
+ {
+ return new TokenTask<GadgetToken>()
+ {
+ @Override
+ protected GadgetToken execute()
+ {
+ return getGadgetTokenContainer().getToken(key);
+ }
+ }.executeWith(chromatticLifeCycle);
+ }
+
+ @Override
+ public GadgetToken deleteToken(final BasicOAuthStoreTokenIndex key)
+ {
+ return new TokenTask<GadgetToken>()
+ {
+ @Override
+ protected GadgetToken execute()
+ {
+ return getGadgetTokenContainer().removeToken(key);
+ }
+ }.executeWith(chromatticLifeCycle);
+ }
+
+ @Override
+ public BasicOAuthStoreTokenIndex[] getAllTokens()
+ {
+ return new TokenTask<BasicOAuthStoreTokenIndex[]>()
+ {
+ @Override
+ protected BasicOAuthStoreTokenIndex[] execute()
+ {
+ GadgetTokenContainer container = getGadgetTokenContainer();
+ Collection<GadgetTokenEntry> tokens =
container.getGadgetTokens().values();
+ BasicOAuthStoreTokenIndex[] gadgetTokens = new BasicOAuthStoreTokenIndex[9];
+ int count = 0;
+ for(GadgetTokenEntry tokenEntry : tokens) {
+ gadgetTokens[count++] = tokenEntry.getKey();
+ }
+ return gadgetTokens;
+ }
+ }.executeWith(chromatticLifeCycle);
+ }
+
+ @Override
+ public long size() throws Exception
+ {
+ return new TokenTask<Long>()
+ {
+ @Override
+ protected Long execute()
+ {
+ GadgetTokenContainer container = getGadgetTokenContainer();
+ Collection<GadgetTokenEntry> tokens =
container.getGadgetTokens().values();
+ return (long)tokens.size();
+ }
+ }.executeWith(chromatticLifeCycle);
+ }
+
+ public String createToken(Credentials credentials) throws IllegalArgumentException,
NullPointerException
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ protected BasicOAuthStoreTokenIndex decodeKey(String stringKey)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Wraps token store logic conveniently.
+ *
+ * @param <V> the return type
+ */
+ private abstract class TokenTask<V> extends ContextualTask<V>
+ {
+
+ /** . */
+ private SessionContext context;
+
+ protected final GadgetTokenContainer getGadgetTokenContainer()
+ {
+ ChromatticSession session = context.getSession();
+ GadgetTokenContainer container = session.findByPath(GadgetTokenContainer.class,
"gadgettokens");
+ if (container == null)
+ {
+ container = session.insert(GadgetTokenContainer.class,
"gadgettokens");
+ }
+ return container;
+ }
+
+ @Override
+ protected V execute(SessionContext context)
+ {
+ this.context = context;
+
+ //
+ try
+ {
+ return execute();
+ }
+ finally
+ {
+ this.context = null;
+ }
+ }
+
+ protected abstract V execute();
+
+ }
+}
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ProxyServletFilter.java
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ProxyServletFilter.java)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ProxyServletFilter.java
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ProxyServletFilter.java 2011-07-08
16:52:42 UTC (rev 6852)
@@ -0,0 +1,125 @@
+/*
+ * Copyright (C) 2010 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.portal.gadget.core;
+
+import org.exoplatform.container.PortalContainer;
+import org.exoplatform.web.security.proxy.ProxyFilterService;
+
+import org.gatein.common.logging.LoggerFactory;
+import org.gatein.common.logging.Logger;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.net.URI;
+
+/**
+ * The proxy servlet filter is a servlet filter placed in front of Shindig proxy
servlet.
+ * It filters a request and allows only the request satisfying the following:
+ * <ul>
+ * <li>the request has an URL parameter</li>
+ * <li>the request can locate a container associated with the request</li>
+ * <li>the request can locate the {@link ProxyFilterService} within the
container</li>
+ * <li>the method {@link ProxyFilterService#accept(HttpServletRequest,
PortalContainer, URI)} invocation returns true</li>
+ * </ul>
+ *
+ * This service is located in front and does not use Shindig integration point (such as
org.apache.shindig.gadgets.GadgetBlacklist}
+ * as the execution is performed by a thread that is not associated with the portal
request precluding any access to
+ * information enabling contextual filtering.
+ *
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
+ * @version $Revision$
+ */
+public class ProxyServletFilter implements Filter
+{
+
+ /** . */
+ private ServletContext ctx;
+
+ /** . */
+ private static final Logger logger =
LoggerFactory.getLogger(ProxyServletFilter.class);
+
+ public void init(FilterConfig cfg) throws ServletException
+ {
+ this.ctx = cfg.getServletContext();
+ }
+
+ public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain)
throws IOException, ServletException
+ {
+ HttpServletRequest hreq = (HttpServletRequest)req;
+ HttpServletResponse hresp = (HttpServletResponse)resp;
+
+ // Get URL
+ String url = hreq.getParameter("url");
+ if (url == null)
+ {
+ hresp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "No
URL");
+ }
+ else
+ {
+ // Get container
+ PortalContainer container = PortalContainer.getInstance(ctx);
+ if (container == null)
+ {
+ hresp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Could not
access container for servlet context " + ctx.getContextPath());
+ }
+ else
+ {
+ ProxyFilterService service =
(ProxyFilterService)container.getComponentInstanceOfType(ProxyFilterService.class);
+ if (service == null)
+ {
+ hresp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Could
not access proxy filter service " + ctx.getContextPath());
+ }
+ else
+ {
+ try
+ {
+ URI uri = URI.create(url);
+ if (!service.accept(hreq, container, uri))
+ {
+ hresp.sendError(HttpServletResponse.SC_FORBIDDEN, "Gadget
" + url + " is blacklisted");
+ }
+ else
+ {
+ chain.doFilter(req, resp);
+ }
+
+ }
+ catch (java.lang.IllegalArgumentException e)
+ {
+ // It happens that some URLs can be wrong, I've seen this with
"http://" as URL in one of the Google Gadgets
+ logger.debug("Invalid URL: " + url);
+ }
+ }
+ }
+ }
+ }
+
+ public void destroy()
+ {
+ }
+}
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/SecurityTokenGenerator.java
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/SecurityTokenGenerator.java)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/SecurityTokenGenerator.java
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/SecurityTokenGenerator.java 2011-07-08
16:52:42 UTC (rev 6852)
@@ -0,0 +1,33 @@
+/**
+ * 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.portal.gadget.core;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: jeremi
+ * Date: Oct 6, 2008
+ * Time: 10:53:13 AM
+ * To change this template use File | Settings | File Templates.
+ */
+public interface SecurityTokenGenerator
+{
+
+ String createToken(String gadgetURL, Long moduleId);
+}
Property changes on: epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets
___________________________________________________________________
Added: svn:ignore
+ target
Copied: epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/pom.xml (from rev
6643, epp/portal/branches/EPP_5_1_Branch/gadgets/eXoGadgets/pom.xml)
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/pom.xml
(rev 0)
+++ epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/pom.xml 2011-07-08
16:52:42 UTC (rev 6852)
@@ -0,0 +1,58 @@
+<!--
+
+ 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.
+
+-->
+
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.gadgets</artifactId>
+ <version>5.1.1-epp-DEV02</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>exo.portal.eXoGadgets</artifactId>
+ <packaging>war</packaging>
+ <name>GateIn Portal eXo Gadgets Application</name>
+
+ <build>
+ <finalName>eXoGadgets</finalName>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.component.web.security</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.webui.portal</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.gatein.shindig</groupId>
+ <artifactId>shindig-common</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ </dependencies>
+</project>
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/resources/tomcat/eXoGadgets.xml
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/eXoGadgets/src/main/resources/tomcat/eXoGadgets.xml)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/resources/tomcat/eXoGadgets.xml
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/resources/tomcat/eXoGadgets.xml 2011-07-08
16:52:42 UTC (rev 6852)
@@ -0,0 +1,23 @@
+<!--
+
+ 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.
+
+-->
+
+<Context path="/eXoGadgetWeb"
docBase="../../../eXoProjects/portal/trunk/gadgets/eXoGadgets/src/main/webapp"
+ debug="0" reloadable="true" />
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/WEB-INF/gadget.xml
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/eXoGadgets/src/main/webapp/WEB-INF/gadget.xml)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/WEB-INF/gadget.xml
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/WEB-INF/gadget.xml 2011-07-08
16:52:42 UTC (rev 6852)
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<gadgets
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://www.gatein.org/xml/ns/gatein_objects_1_0
http://www.gatein.org/xml/ns/gadgets_1_0"
+
xmlns="http://www.gatein.org/xml/ns/gadgets_1_0">
+
+ <gadget name="Todo">
+ <path>/gadgets/Todo/Todo.xml</path>
+ </gadget>
+
+ <gadget name="Calendar">
+ <path>/gadgets/Calendar/Calendar.xml</path>
+ </gadget>
+
+ <gadget name="Calculator">
+ <path>/gadgets/Calculator/Calculator.xml</path>
+ </gadget>
+
+ <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
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/WEB-INF/web.xml
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/eXoGadgets/src/main/webapp/WEB-INF/web.xml)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/WEB-INF/web.xml
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/WEB-INF/web.xml 2011-07-08
16:52:42 UTC (rev 6852)
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<!DOCTYPE web-app
+ PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<web-app>
+ <display-name>eXoGadgets</display-name>
+ <filter>
+ <filter-name>ResourceRequestFilter</filter-name>
+
<filter-class>org.exoplatform.portal.application.ResourceRequestFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>ResourceRequestFilter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <servlet>
+ <servlet-name>GateInServlet</servlet-name>
+ <servlet-class>org.gatein.wci.api.GateInServlet</servlet-class>
+ <load-on-startup>0</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>GateInServlet</servlet-name>
+ <url-pattern>/gateinservlet</url-pattern>
+ </servlet-mapping>
+
+</web-app>
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/gadgets/Calculator/Calculator.xml
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/eXoGadgets/src/main/webapp/gadgets/Calculator/Calculator.xml)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/gadgets/Calculator/Calculator.xml
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/gadgets/Calculator/Calculator.xml 2011-07-08
16:52:42 UTC (rev 6852)
@@ -0,0 +1,301 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+
+ 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.
+
+-->
+
+<!--
+ **
+ * Created by The eXo Platform SARL
+ * Author : dang.tung
+ * tungcnw(a)gmail.com
+ * Sep 30, 2008
+ *
+-->
+<Module>
+ <ModulePrefs author="eXoPlatform"
+ title="Calculator"
+ directory_title="Calculator"
+ title_url="http://www.exoplatform.org"
+ description="This simple and useful calculator lets you perform most
of the basic arithmetic operations."
+
thumbnail="http://localhost:8080/eXoGadgets/skin/DefaultSkin/portletIcons/Calculator.png"
+ height="227">
+ <Locale lang="ar" language_direction="rtl"/>
+ </ModulePrefs>
+ <Content type="html">
+ <![CDATA[
+ <style type="text/css">
+ body {
+ margin: 0;
+ outline: none;
+ font: normal 100%/1.25 Arial, Verdana, Tahoma, Helvetica, sans-serif;
+ text-decoration: none;
+ text-align: center;
+ }
+ img {
+ border:none;
+ }
+
+ li {
+ list-style-type:none;
+ }
+
+ .clear {
+ clear:both;
+ width:0;
+ height:0;
+ line-height:0;
+ font-size:0;
+ }
+
+ .LeftCalculator {
+ background: url(/eXoGadgets/skin/image/Calculator.png) no-repeat top left;
+ width: 193px;
+ padding-left: 7px;
+ margin: 0 auto;
+ }
+
+ .RightCalculator {
+ background: url(/eXoGadgets/skin/image/Calculator.png) no-repeat top right;
+ padding-right: 9px;
+ }
+
+ .CenterCalculator {
+ background: url(/eXoGadgets/skin/image/Calculator.png) repeat-x bottom left;
+ height: 227px;
+ }
+
+ .Display {
+ padding-top: 24px;
+ text-align: center;
+ }
+
+ .Display input {
+ background: url(/eXoGadgets/skin/image/Display.png) no-repeat top left;
+ width: 164px;
+ height: 23px;
+ margin: 0 auto;
+ font-size: 15px;
+ line-height: auto;
+ color: #333333;
+ font-weight: bold;
+ padding: 3px 3px 0 0;
+ direction: __BIDI_REVERSE_DIR__;
+ }
+
+ .Number {
+ padding-top: 8px;
+ padding-__BIDI_START_EDGE__: 9px;
+ }
+
+ .Row a {
+ background: url(/eXoGadgets/skin/image/Button.gif) no-repeat top center;
+ color: #000000;
+ font-weight: bold;
+ text-align: center;
+ font-size: 13px;
+ width: 37px;
+ height: 24px;
+ display: block;
+ float: __BIDI_START_EDGE__;
+ margin-top: 4px;
+ margin-__BIDI_START_EDGE__: 3px;
+ cursor: pointer;
+ padding-top: 3px;
+ }
+
+ .ClearLeft {
+ clear: __BIDI_START_EDGE__;
+ }
+
+ .Row a sup {
+ font-size: 8px;
+ }
+
+ a.Orange {
+ font-size: 15px;
+ color: orange;
+ }
+
+ a.Blue {
+ font-size: 15px;
+ color: blue;
+ line-height: 6px;
+ }
+
+ a.Red {
+ font-size: 15px;
+ color: red;
+ }
+
+ a.Green {
+ color: green;
+ }
+
+ .bold {
+ font-weight: bold;
+ }
+ </style>
+ <script type="text/javascript">
+ var lenAfterPoint = 3;
+ var Number1 = "";
+ var Number2 = "";
+ var NewNumber = "blank";
+ var opvalue = "";
+ function Display(displaynumber) {
+ document.getElementById("calculator").value = displaynumber;
+ }
+ function ClearCalc() {
+ Number1 = "";
+ Number2 = "";
+ NewNumber = "blank";
+ Display("0");
+ }
+ function CheckNumber(answer) {
+ if(answer == ".") {
+ Number = document.getElementById("calculator").value;
+ if(Number.indexOf(".") != -1) {
+ answer = "";
+ }
+ }
+ if(NewNumber == "yes") {
+ Number2 += answer;
+ Display(Number2);
+ }
+ else {
+ if(NewNumber == "blank") {
+ Number1 = answer;
+ Number2 = "";
+ NewNumber = "no";
+ }
+ else {
+ Number1 += answer;
+ }
+ Display(Number1);
+ }
+ }
+ function AddButton(x) {
+ if(x == 1) EqualButton();
+ if(Number2 != "") {
+ Number1 = parseFloat(Number1) + parseFloat(Number2);
+ }
+ NewNumber = "yes";
+ opvalue = '+';
+ Display(Number1);
+ }
+ function SubButton(x) {
+ if(x == 1) EqualButton();
+ if(Number2 != "") {
+ Number1 = parseFloat(Number1) - parseFloat(Number2);
+ }
+ NewNumber = "yes";
+ opvalue = '-';
+ Display(Number1);
+ }
+ function MultButton(x) {
+ if(x == 1) EqualButton();
+ if(Number2 != "") {
+ Number1 = parseFloat(Number1) * parseFloat(Number2);
+ }
+ NewNumber = "yes";
+ opvalue = '*';
+ Display(parseFloat(parseFloat(Number1).toFixed(lenAfterPoint)));
+ }
+ function DivButton(x) {
+ if(x == 1) EqualButton();
+ if(Number2 != "") {
+ Number1 = parseFloat(Number1) / parseFloat(Number2);
+ }
+ NewNumber = "yes";
+ opvalue = '/';
+ Display(parseFloat(parseFloat(Number1).toFixed(lenAfterPoint)));
+ }
+ function PercentButton() {
+ if(NewNumber != "blank") {
+ Number2 *= .01;
+ NewNumber = "blank";
+ Display(Number2);
+ }
+ }
+ function RecipButton() {
+ Number1 = 1/Number1;
+ NewNumber = "blank";
+ Display(Number1);
+ }
+ function NegateButton() {
+ Number1 = parseFloat(-Number1);
+ NewNumber = "no";
+ Display(Number1);
+ }
+ function EqualButton() {
+ if(opvalue == '+') AddButton(0);
+ if(opvalue == '-') SubButton(0);
+ if(opvalue == '*') MultButton(0);
+ if(opvalue == '/') DivButton(0);
+ Number2 = "";
+ opvalue = "";
+ }
+ </script>
+ <body>
+ <div class="LeftCalculator">
+ <div class="RightCalculator">
+ <div class="CenterCalculator">
+ <div class="Display">
+ <input id="calculator" value="0" disabled />
+ </div>
+ <div class="Number">
+ <div class="Row">
+ <a onClick="RecipButton(); return false;">1/x</a>
+ <a onClick="NegateButton(); return false;">+/-</a>
+ <a onClick="PercentButton(); return false;">%</a>
+ <a class="Orange" onClick="AddButton(1); return
false;">+</a>
+ </div>
+ <div class="Row">
+ <a onClick="CheckNumber('7'); return false;">7</a>
+ <a onClick="CheckNumber('8'); return false;">8</a>
+ <a onClick="CheckNumber('9'); return false;">9</a>
+ <a class="Blue" onClick="SubButton(1); return
false;">_</a>
+ </div>
+ <div class="Row">
+ <a onClick="CheckNumber('4'); return false;">4</a>
+ <a onClick="CheckNumber('5'); return false;">5</a>
+ <a onClick="CheckNumber('6'); return false;">6</a>
+ <a class="Red" onClick="MultButton(1); return
false;">x</a>
+ </div>
+ <div class="Row">
+ <a onClick="CheckNumber('1'); return false;">1</a>
+ <a onClick="CheckNumber('2'); return false;">2</a>
+ <a onClick="CheckNumber('3'); return false;">3</a>
+ <a class="Green" onClick="DivButton(1); return
false;">:</a>
+ </div>
+ <div class="Row">
+ <a onClick="CheckNumber('0'); return false;">0</a>
+ <a style="line-height:9px" onClick="CheckNumber('.');
return false;">.</a>
+ <a onClick="ClearCalc(); return false;">C</a>
+ <a style="font-size:15px" onClick="EqualButton(); return
false;">=</a>
+ </div>
+ <div class="ClearLeft"><span></span></div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </body>
+ ]]>
+ </Content>
+</Module>
\ No newline at end of file
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/gadgets/Calendar/Calendar.xml
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/eXoGadgets/src/main/webapp/gadgets/Calendar/Calendar.xml)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/gadgets/Calendar/Calendar.xml
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/gadgets/Calendar/Calendar.xml 2011-07-08
16:52:42 UTC (rev 6852)
@@ -0,0 +1,292 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+
+ 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.
+
+-->
+
+<!--
+ **
+ * Created by The eXo Platform SARL
+ * Author : dang.tung
+ * tungcnw(a)gmail.com
+ * Sep 30, 2008
+ *
+-->
+<Module>
+ <ModulePrefs author="eXoPlatform"
+ title="Calendar"
+ directory_title="Calendar"
+ title_url="http://www.exoplatform.org"
+ description="What date is it? Use this cool calendar to keep track of the date in
style. You can switch easily between daily, monthly or yearly view."
+ thumbnail="http://localhost:8080/eXoGadgets/skin/DefaultSkin/portletIcons/Calendar.png"
+ height="205">
+ <Locale lang="ar" language_direction="rtl"/>
+ </ModulePrefs>
+ <Content type="html">
+ <![CDATA[
+ <style type="text/css">
+ body {
+ margin: 0;
+ outline: none;
+ font: normal 100%/1.25 Verdana, Tahoma, Arial, Helvetica, sans-serif;
+ text-decoration: none;
+ text-align: center;
+ }
+
+ img {
+ border:none;
+ }
+
+ li {
+ list-style-type:none;
+ }
+
+ .clear {
+ clear:both;
+ width:0;
+ height:0;
+ line-height:0;
+ font-size:0;
+ }
+
+ .LeftCalender {
+ background: url(/eXoGadgets/skin/image/calender.gif) top left no-repeat;
+ width: 190px;
+ padding-left: 10px;
+ margin: 0 auto;
+ }
+
+ .RightCalender {
+ background: url(/eXoGadgets/skin/image/calender.gif) top right no-repeat;
+ padding-right: 12px;
+ }
+
+ .CenterCalender {
+ background: url(/eXoGadgets/skin/image/calender.gif) bottom left repeat-x;
+ height: 203px;
+ }
+
+ .Month {
+ text-align: center;
+ height: 46px;
+ }
+
+ .LeftButtonCalendarMonth,
+ .RightButtonCalendarMonth {
+ background: url(/eXoGadgets/skin/image/ButtonCalendar__BIDI_START_EDGE__.gif) top
__BIDI_START_EDGE__ no-repeat;
+ width: 17px;
+ height: 16px;
+ display: block;
+ float: __BIDI_START_EDGE__;
+ margin-top: 17px;
+ cursor: pointer;
+ }
+
+ .RightButtonCalendarMonth {
+ background: url(/eXoGadgets/skin/image/ButtonCalendar__BIDI_START_EDGE__.gif)
__BIDI_START_EDGE__ -25px no-repeat;
+ }
+
+ .Month .text {
+ width: 134px;
+ font-size: 17px;
+ color: #fff;
+ line-height: auto;
+ float: __BIDI_START_EDGE__;
+ text-align: center;
+ padding-top: 13px;
+ cursor: pointer;
+ }
+
+ .Day {
+ padding-top: 5px;
+ text-align: center;
+ }
+
+ .Row {
+ width: 160px;
+ margin: 0 auto;
+ }
+
+ .Row a,
+ .RowDay a {
+ background: #fff;
+ padding-top: 2px;
+ width: 18px;
+ height: 14px;
+ display: block;
+ text-align: center;
+ font-size: 11px;
+ line-height: auto;
+ float: __BIDI_START_EDGE__;
+ color: #5f5f5f;
+ margin: 3px 4px 0 0;
+ }
+
+ .Row a.fo {
+ background: #eb5657;
+ color: #fff;
+ }
+
+ .Row a.last {
+ margin-right: 0;
+ }
+
+ .RowDay {
+ width: 160px;
+ margin: 0 auto;
+ margin-bottom: 3px;
+ }
+
+ .RowDay a {
+ font-size: 12px;
+ font-weight: bold;
+ }
+
+ .RowDay a.fo {
+ font-size: 12px;
+ font-weight: bold;
+ color: #ed1c24;
+ }
+
+ .Row a.old {
+ color: #cfcfcf;
+ }
+
+ .Prev,
+ .Next {
+ background: url(/eXoGadgets/skin/image/ButtonCalendar__BIDI_START_EDGE__.gif) center
-50px no-repeat;
+ width: 15px;
+ height: 13px;
+ display: block;
+ float:__BIDI_START_EDGE__;
+ margin-top: 5px;
+ cursor: pointer;
+ }
+
+ .Next {
+ background: url(/eXoGadgets/skin/image/ButtonCalendar__BIDI_START_EDGE__.gif) center
-70px no-repeat;
+ float: __BIDI_END_EDGE__;
+ }
+
+ </style>
+ <script type="text/javascript">
+ var months =
['January','February','March','April','May','June','July','August','September','October','November','December']
;
+ var currentDate;
+
+ function renderCalendar() {
+ var dayOfMonth = 1 ;
+ var validDay = 0 ;
+
+ if(currentDate == null) {
+ currentDate = new Date();
+ }
+
+ var cDate = currentDate;
+ var startDayOfWeek = getDayOfWeek(cDate.getFullYear(), cDate.getMonth() + 1,
dayOfMonth) ;
+ var daysInMonth = getDaysInMonth(cDate.getFullYear(), cDate.getMonth()) ;
+ var clazz = null;
+ var today = new Date();
+ var tempCalendar = '<div class="Month">';
+ tempCalendar += '<a class="LeftButtonCalendarMonth"
onclick="changeYear(-1);" title="Previous Year"></a>';
+ tempCalendar += '<div class="text"
onclick="goToday();">' + months[cDate.getMonth()] + '-' +
cDate.getFullYear() + '</div>';
+ tempCalendar += '<a class="RightButtonCalendarMonth"
onclick="changeYear(1);" title="Next Year"></a>';
+ tempCalendar += '</div>';
+ tempCalendar += '<div class="Day">';
+ tempCalendar += '<div class="RowDay">';
+ tempCalendar += '<a class="fo
last">S</a><a>M</a><a>T</a><a>W</a><a>T</a><a>F</a><a
class="fo last">S</a><div
class="clear"></div>';
+ tempCalendar += '</div>';
+ for (var week=0; week < 5; week++) {
+ tempCalendar += '<div class="Row">';
+ for (var dayOfWeek=0; dayOfWeek < 7; dayOfWeek++) {
+ if (week == 0 && startDayOfWeek == dayOfWeek) {
+ validDay = 1;
+ } else if (validDay == 1 && dayOfMonth > daysInMonth) {
+ validDay = 0;
+ }
+
+ if (validDay) {
+ if ((today.getDate() == dayOfMonth) && (today.getMonth() ==
cDate.getMonth()) && (today.getFullYear() == cDate.getFullYear())) {
+ clazz = 'fo';
+ } else if (dayOfWeek == 6) {
+ clazz = 'last';
+ } else {
+ clazz = '';
+ }
+
+ tempCalendar += '<a class=' + clazz + '>' + dayOfMonth
+ '</a>';
+ dayOfMonth++ ;
+ } else {
+ tempCalendar += '<a class="old"></a>';
+ }
+ }
+ tempCalendar += '<div class="clear"></div>';
+ tempCalendar += '</div>';
+ }
+ tempCalendar += '<div><a class="Prev"
onclick="changeMonth(-1);" title="Previous Month"></a><a
class="Next" onclick="changeMonth(1);" title="Next
Month"></a></div>';
+ tempCalendar += '</div>';
+ currentDate = cDate;
+ document.getElementById("Calendar").innerHTML = tempCalendar;
+ }
+
+ function getDayOfWeek(year,month,day) {
+ var date = new Date(year, month-1, day);
+ return date.getDay();
+ }
+
+ function getDaysInMonth(year, month) {
+ return [31, ((!(year % 4 ) && ( (year % 100 ) || !( year % 400 ) ))? 29:28),
31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month];
+ }
+
+ function changeYear(change) {
+ currentDate.setFullYear(currentDate.getFullYear() + change) ;
+ renderCalendar() ;
+ }
+
+ function changeMonth(change) {
+ var indexMonth = currentDate.getMonth()+change;
+
+ if(indexMonth == 12) {
+ currentDate.setMonth(0);
+ } else {
+ if(indexMonth == -1) {
+ currentDate.setMonth(11);
+ } else {
+ currentDate.setMonth(indexMonth);
+ }
+ }
+
+ renderCalendar() ;
+ }
+
+ function goToday(){
+ currentDate = new Date();
+ renderCalendar();
+ }
+ </script>
+ <body onload="renderCalendar()">
+ <div class="LeftCalender">
+ <div class="RightCalender">
+ <div class="CenterCalender" id="Calendar">
+ </div>
+ </div>
+ </div>
+ </body>
+ ]]>
+ </Content>
+</Module>
\ No newline at end of file
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/gadgets/Todo/Todo.xml
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/eXoGadgets/src/main/webapp/gadgets/Todo/Todo.xml)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/gadgets/Todo/Todo.xml
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/gadgets/Todo/Todo.xml 2011-07-08
16:52:42 UTC (rev 6852)
@@ -0,0 +1,276 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+
+ 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.
+
+-->
+
+<!--
+ **
+ * Created by The eXo Platform SARL
+ * Author : dang.tung
+ * tungcnw(a)gmail.com
+ * Oct 01, 2008
+ *
+-->
+<Module>
+ <ModulePrefs author="eXoPlatform"
+ title="Todo"
+ directory_title="Todo"
+ title_url="http://www.exoplatform.org"
+ description="ToDo Gadget, easily manage and track your daily to-do list."
+ thumbnail="http://localhost:8080/eXoGadgets/skin/DefaultSkin/portletIcons/Todo.png"
+ height="235">
+ <Locale
messages="http://localhost:8080/eXoGadgets/locale/Todo/ALL_ALL.xml" />
+ <Locale lang="ar"
messages="http://localhost:8080/eXoGadgets/locale/Todo/ar_ALL.xml"
language_direction="rtl"/>
+ <Locale lang="fr"
messages="http://localhost:8080/eXoGadgets/locale/Todo/fr_ALL.xml" />
+ <Locale lang="vi"
messages="http://localhost:8080/eXoGadgets/locale/Todo/vi_ALL.xml" />
+ <Require feature="setprefs"/>
+ </ModulePrefs>
+ <UserPref name="todoList" datatype="list"/>
+ <Content type="html">
+ <![CDATA[
+ <style type="text/css">
+
+ body {
+ margin: 0;
+ outline: none;
+ font: normal 100%/1.25 Verdana, Tahoma, Arial, Helvetica, sans-serif;
+ text-decoration: none;
+ text-align: center;
+ }
+
+ img {
+ border:none;
+ }
+
+ li {
+ list-style-type:none;
+ }
+
+ .clear {
+ clear:both;
+ width:0;
+ height:0;
+ line-height:0;
+ font-size:0;
+ }
+
+ .Note {
+ background: url(/eXoGadgets/skin/image/Note__BIDI_START_EDGE__.jpg) top
__BIDI_START_EDGE__ no-repeat;
+ width: 160px;
+ height: 235px;
+ margin: 0 auto;
+ padding: 42px 18px 0 18px;
+ }
+
+ .write {
+ width: 160px;
+ height: 150px;
+ overflow-y: auto;
+ overflow-x: hidden;
+ }
+
+ .write input {
+ background: url(/eXoGadgets/skin/image/line.gif) bottom left repeat-x;
+ font-size: 11px;
+ color: #be0d08;
+ border: none;
+ width: 100%;
+ line-height: auto;
+ font-style: italic;
+ margin-bottom: 2px;
+ height: 15px;
+ }
+
+ .UIAction .ActionContainer {
+ width: auto;
+ margin: auto;
+ }
+
+ .UIAction .ActionButton {
+ display: block;
+ float: __BIDI_START_EDGE__;
+ margin: 0px 3px;
+ cursor: pointer;
+ }
+
+ .UIAction .SimpleStyle {}
+
+ .UIAction .SimpleStyle .ButtonLeft {
+ background:
url('/eXoResources/skin/DefaultSkin/webui/component/UIBarDecorator/UIAction/background/SimpleStyle.gif')
no-repeat left top;
+ padding: 0px 0px 0px 10px;
+ height: 21px;
+ }
+
+ .UIAction .SimpleStyle .ButtonRight {
+ background:
url('/eXoResources/skin/DefaultSkin/webui/component/UIBarDecorator/UIAction/background/SimpleStyle.gif')
no-repeat right top;
+ padding: 0px 10px 0px 0px ;
+ height: 21px;
+ }
+
+ .UIAction .SimpleStyle .ButtonMiddle {
+ line-height: 21px;
+ background:
url('/eXoResources/skin/DefaultSkin/webui/component/UIBarDecorator/UIAction/background/SimpleStyle.gif')
repeat-x bottom;
+ text-align: center;
+ padding: 0px 12px;
+ height: 21px;
+ }
+
+ .UIAction .SimpleStyle a {
+ color: #353535;
+ margin: 0px 6px;
+ white-space: nowrap;
+ font-size: 11px;
+ text-decoration: none;
+ display: block;
+ }
+
+ .UIAction .SimpleStyle a:hover {
+ color: #1273df;
+ }
+
+ </style>
+ <script type="text/javascript">
+ var prefs = new _IG_Prefs(__MODULE_ID__);
+ function onLoad() {
+ var listsTodo = prefs.getArray("todoList");
+ var appendParrent = document.getElementById("write");
+ for(var i=0; i<listsTodo.length; i++) {
+ if(i>6) {
+ createTaskInput(i+1);
+ }
+ var tmp = document.getElementById(parseInt(i)+1);
+ tmp.value = listsTodo[i];
+ }
+ reArrange();
+ }
+
+ function focusFirstTask(firstInput) {
+ if(firstInput.value == '1. __MSG_type_here__') {
+ firstInput.focus();
+ firstInput.value = "1.";
+ }
+ }
+
+ function reArrange() {
+ var nodeParent = document.getElementById("write");
+ var inputList = nodeParent.getElementsByTagName("input");
+ for(var i=0; i < inputList.length; i++) {
+ if(inputList[i].value != null && inputList[i].value != "")
{
+ var tmp = inputList[i].value;
+ var numTask = tmp.substring(0, tmp.indexOf('.'));
+ var contentTask = tmp.substring(tmp.indexOf('.') + 1, tmp.length);
+ if(parseInt(numTask) != parseInt(inputList[i].id)) {
+ numTask = inputList[i].id;
+ }
+ inputList[i].value = numTask + "." + contentTask;
+ }
+ }
+ }
+
+ function save() {
+ values = [];
+ var nodeParent = document.getElementById("write");
+ var inputList = nodeParent.getElementsByTagName("input");
+ for (var i = 0; i < inputList.length; i++) {
+ if(inputList[i].value != null && inputList[i].value != "") {
+ values.push(inputList[i].value);
+ }
+ }
+ prefs.setArray("todoList", values);
+ }
+
+ function setEnterKey(event) {
+ var e = event || window.event;
+ var elementInput = e.srcElement || e.target;
+ var keynum = e.keyCode || e.which;
+ if(keynum == 13) {
+ var nextInputElement = findNextElementByTagName(elementInput, "input");
+ if(nextInputElement) {
+ if(nextInputElement.value != null && nextInputElement.value !=
"") {
+ nextInputElement.focus();
+ } else {
+ nextInputElement.focus();
+ nextInputElement.value = (parseInt(elementInput.id)+1)+".";
+ }
+ } else {
+ createTaskInput(parseInt(elementInput.id)+1);
+ }
+ }
+ }
+
+ function createTaskInput(index) {
+ var parentNode = document.getElementById("write");
+ var input = document.createElement("input");
+ parentNode.insertBefore(input,null);
+ input.focus();
+ input.setAttribute("type","text");
+ input.setAttribute("name",index);
+ input.onkeydown = setEnterKey;
+ input.value = index+".";
+ input.setAttribute("id",index);
+ }
+
+
+ function findNextElementByTagName(element, tagName) {
+ var nextElement = element.nextSibling ;
+ while (nextElement != null) {
+ var nodeName = nextElement.nodeName ;
+ if (nodeName != null) nodeName = nodeName.toLowerCase() ;
+ if (nodeName == tagName) return nextElement ;
+ nextElement = nextElement.nextSibling ;
+ }
+ return null ;
+ }
+
+ gadgets.util.registerOnLoadHandler(onLoad);
+ </script>
+ <div class="Note">
+ <div class="write" id="write">
+ <input type="text" id="1"
onfocus="focusFirstTask(this);" value="1. __MSG_type_here__"
name="1" onkeydown="setEnterKey(event);"/>
+ <input type="text" id="2" name="2"
onkeydown="setEnterKey(event);"/>
+ <input type="text" id="3" name="3"
onkeydown="setEnterKey(event);"/>
+ <input type="text" id="4" name="4"
onkeydown="setEnterKey(event);"/>
+ <input type="text" id="5" name="5"
onkeydown="setEnterKey(event);"/>
+ <input type="text" id="6" name="6"
onkeydown="setEnterKey(event);"/>
+ <input type="text" id="7" name="7"
onkeydown="setEnterKey(event);"/>
+
+ </div>
+
+<div class="UIAction">
+ <table class="ActionContainer">
+ <tbody><tr>
+ <td>
+ <div class="ActionButton SimpleStyle"
onclick="save();">
+ <div class="ButtonLeft">
+ <div class="ButtonRight">
+ <div class="ButtonMiddle">
+ <a href="javascript:void(0);">__MSG_save__</a>
+ </div>
+ </div>
+ </div>
+ </div>
+ </td>
+ </tr>
+ </tbody></table>
+ </div>
+ </div>
+ ]]>
+ </Content>
+</Module>
\ No newline at end of file
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/gadgets/rssAggregator/rssAggregator.xml
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/eXoGadgets/src/main/webapp/gadgets/rssAggregator/rssAggregator.xml)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/gadgets/rssAggregator/rssAggregator.xml
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/gadgets/rssAggregator/rssAggregator.xml 2011-07-08
16:52:42 UTC (rev 6852)
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+
+ 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.
+
+-->
+
+<Module>
+<ModulePrefs title="RSS Reader"
title_url="http://www.exoplatform.com" directory_title="RSS Reader"
+ description="RSS Reader"
+ thumbnail="/eXoGadgets/skin/DefaultSkin/portletIcons/rssAggregator.png">
+<Require feature="dynamic-height" />
+<Require feature="setprefs"/>
+<Require feature="settitle"/>
+<Locale lang="ar" language_direction="rtl"/>
+</ModulePrefs>
+ <UserPref name="rssurl" display_name="FEED URL"
default_value="http://feeds.feedburner.com/gatein" required="true"
/>
+ <UserPref name="num_entries" display_name="# of Items (1-100)"
default_value="10"/>
+<Content type="html"><![CDATA[
+<link rel="stylesheet" type="text/css"
href="style.css"></link>
+
+<script type="text/javascript" src="script.js"></script>
+<div id="feedContainer"
style="height:229px;overflow:auto;"></div>
+
+<script type="text/javascript">
+// Get userprefs
+ var prefs = new _IG_Prefs(__MODULE_ID__);
+ var entries = prefs.getInt("num_entries");
+ var feedurl = prefs.getString("rssurl");
+
+ if (isNaN(entries)) {
+ entries = 10;
+ }
+ else {
+ if (entries < 1) { entries = 1; }
+ if (entries > 100) { entries = 100; }
+ }
+
+ var rssAggregator = new RssAggregator();
+ gadgets.util.registerOnLoadHandler(rssAggregator.refreshFeed);
+</script>
+
+]]>
+</Content>
+</Module>
\ No newline at end of file
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/gadgets/rssAggregator/script.js
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/eXoGadgets/src/main/webapp/gadgets/rssAggregator/script.js)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/gadgets/rssAggregator/script.js
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/gadgets/rssAggregator/script.js 2011-07-08
16:52:42 UTC (rev 6852)
@@ -0,0 +1,159 @@
+/**
+ * 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.
+ */
+
+function RssAggregator() {
+ this.feed = {};
+}
+
+RssAggregator.prototype.getFavicon = function(feedurl) {
+ var favicon = feedurl.match( /:\/\/(www\.)?([^\/:]+)/ );
+ favicon = favicon[2]?favicon[2]:'';
+ favicon = "http://"+favicon+"/favicon.ico";
+ return favicon;
+}
+
+RssAggregator.prototype.toggleDescription = function(elmnt_id) {
+ if (_gel('more_'+elmnt_id).style.display == 'none') {
+ _gel('more_'+elmnt_id).style.display = '';
+ _gel('item_'+elmnt_id).className = 'item descriptionHighlight';
+ } else {
+ _gel('more_'+elmnt_id).style.display = 'none';
+ _gel('item_'+elmnt_id).className = 'item';
+ }
+ gadgets.window.adjustHeight();
+}
+
+RssAggregator.prototype.timeToPrettyString = function(B) {
+ if (isNaN(B)) {
+ return "an indeterminate amount of time ago"
+ }
+ time = (new Date().getTime() - B) / 1000;
+ if (time < 60) {
+ return "less than a minute ago"
+ } else {
+ if (time < 120) {
+ return "about a minute ago"
+ } else {
+ if (time < 3600) {
+ var A = Math.round(time / 60);
+ return "about " + A + " minutes ago"
+ } else {
+ if (time < 7200) {
+ return "about an hour ago"
+ } else {
+ if (time < 86400) {
+ var A = Math.round(time / 3600);
+ return "about " + A + " hours ago"
+ } else {
+ if (time < 172800) {
+ return "about a day ago"
+ } else {
+ if (time < 2592000) {
+ var A = Math.round(time / 86400);
+ return "about " + A + " days ago"
+ } else {
+ if (time < 5184000) {
+ return "about a month ago"
+ } else {
+ var A = Math.round(time / 2592000);
+ return "about " + A + " months
ago"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+RssAggregator.prototype.renderFeed = function(feedObj) {
+ if(feedObj.rc != 200 && feedObj.data == undefined) {
+ document.write("the url: " + feedurl + " is down or invalid");
+ return;
+ }
+ this.feed = feedObj.data;
+ gadgets.window.setTitle("RSS: " + this.feed.Title);
+ var feedEl = _gel("feedContainer");
+ var bullet = "<img src='" + this.getFavicon(feedurl) + "'
alt='' border=0 align='absmiddle' style='height:16;width:16;'
onerror='this.style.visibility=\"hidden\";'> ";
+
+ if (this.feed != null) {
+ // Access the data for a given entry
+ if (this.feed.Entry) {
+ for (var i = 0; i < this.feed.Entry.length; i++) {
+ var itemEl = document.createElement('div');
+ var item_title = document.createElement('div');
+ var item_more = document.createElement('div');
+ var item_desc = document.createElement('div');
+ var item_date = document.createElement('div');
+ var item_link = document.createElement('div');
+
+ itemEl.id = 'item_'+i;
+ item_title.id = 'title_'+i;
+ item_more.id = 'more_'+i;
+ item_more.style.display='none';
+ item_desc.id = 'desc_'+i;
+ item_date.id = 'date_'+i;
+ item_link.id = 'link_'+i;
+
+
+ itemEl.className = 'item';
+ item_title.className = 'title';
+ item_more.className = 'more';
+ item_desc.className = 'desc';
+ item_date.className = 'date';
+ item_link.className = 'link';
+
+ item_title.innerHTML = bullet + "<a
id='link_title_"+i+"' class='titlelink' href='" +
this.feed.Entry[i].Link + "'
onclick='rssAggregator.toggleDescription("+i+");return false;'>"
+ this.feed.Entry[i].Title + "</a>";
+ item_date.innerHTML = this.timeToPrettyString(this.feed.Entry[i].Date);
+
+ item_desc.innerHTML = this.feed.Entry[i].Summary;
+
+ item_link.innerHTML = this.generateLinkContent(i);
+
+
+ item_more.appendChild(item_date);
+ item_more.appendChild(item_desc);
+ item_more.appendChild(item_link);
+
+
+ itemEl.appendChild(item_title);
+ itemEl.appendChild(item_more);
+
+ feedEl.appendChild(itemEl);
+ }
+ }
+ } else {
+ document.write("No feed found at " + feedurl);
+ }
+ gadgets.window.adjustHeight();
+}
+
+RssAggregator.prototype.generateLinkContent = function(i) {
+ return "<a href='" + this.feed.Entry[i].Link + "'
target='_blank'>view link »</a>";
+}
+
+RssAggregator.prototype.refreshFeed = function() {
+ var params = {};
+ params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.FEED;
+ params[gadgets.io.RequestParameters.NUM_ENTRIES] = entries;
+ params[gadgets.io.RequestParameters.GET_SUMMARIES] = true;
+ gadgets.io.makeRequest(prefs.getString("rssurl"), function(feedObj)
{rssAggregator.renderFeed(feedObj);}, params);
+}
+
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/gadgets/rssAggregator/style.css
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/eXoGadgets/src/main/webapp/gadgets/rssAggregator/style.css)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/gadgets/rssAggregator/style.css
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/gadgets/rssAggregator/style.css 2011-07-08
16:52:42 UTC (rev 6852)
@@ -0,0 +1,78 @@
+
+a {
+ color: #0158c9;
+ text-decoration: none;
+}
+
+a:visited {
+ color: #0158c9;
+}
+
+p {
+ margin: 0px;
+}
+
+.descriptionHighlight .title {
+ background: #ffffff;
+ margin: 0px;
+ color: #0158c9;
+ font-size: 12px;
+}
+
+.descriptionHighlight .title a {
+ color: #000000;
+ font-size: 12px;
+ margin-bottom: 2px;
+}
+
+.title {
+ padding: 3px 10px;
+ font-weight: bold;
+ font-size: 12px;
+}
+
+.item {
+ background: #fbfbfb;
+ border-bottom: 1px solid #E3E3E3;
+ margin: 0 9px 2px;
+}
+
+.item .more {
+ background: #ffffff;
+ color:#000000;
+ display:block;
+ font-size: 11px;
+ width:100%;
+ padding: 0px;
+}
+
+.item .date {
+ margin-bottom: 2px;
+ padding: 2px 20px 0px;
+ color: #c3c3c3;
+ font-size: 10px;
+}
+
+.item .more .desc {
+ padding: 4px 20px 10px;
+ color: #5c5c5c;
+ text-align: justify;
+}
+
+.item .more .link {
+ margin-top: 2px;
+ padding: 0px 5px 0px 0px;
+ color: #fe7000;
+ font-weight: bold;
+ text-align: right;
+}
+
+.item .more .link a {
+ color: #fe7000;
+}
+
+.descriptionHighlight {
+ border:none;
+ margin: 3px 0px;
+ padding:0px;
+}
\ No newline at end of file
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/locale/Todo/ALL_ALL.xml
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/eXoGadgets/src/main/webapp/locale/Todo/ALL_ALL.xml)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/locale/Todo/ALL_ALL.xml
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/locale/Todo/ALL_ALL.xml 2011-07-08
16:52:42 UTC (rev 6852)
@@ -0,0 +1,29 @@
+<!--
+
+ 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.
+
+-->
+
+<messagebundle>
+ <msg name="save">
+ Save
+ </msg>
+ <msg name="type_here">
+ Type new task here
+ </msg>
+</messagebundle>
\ No newline at end of file
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/locale/Todo/ar_ALL.xml
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/eXoGadgets/src/main/webapp/locale/Todo/ar_ALL.xml)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/locale/Todo/ar_ALL.xml
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/locale/Todo/ar_ALL.xml 2011-07-08
16:52:42 UTC (rev 6852)
@@ -0,0 +1,29 @@
+<!--
+
+ 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.
+
+-->
+
+<messagebundle>
+ <msg name="save">
+ حفظ
+ </msg>
+ <msg name="type_here">
+ نوع المهمة الجديدة هنا
+ </msg>
+</messagebundle>
\ No newline at end of file
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/locale/Todo/de_ALL.xml
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/eXoGadgets/src/main/webapp/locale/Todo/de_ALL.xml)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/locale/Todo/de_ALL.xml
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/locale/Todo/de_ALL.xml 2011-07-08
16:52:42 UTC (rev 6852)
@@ -0,0 +1,29 @@
+<!--
+
+ 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.
+
+-->
+
+<messagebundle>
+ <msg name="save">
+ Speichern
+ </msg>
+ <msg name="type_here">
+ Hier neue Aufgabe eingeben
+ </msg>
+</messagebundle>
\ No newline at end of file
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/locale/Todo/es_ALL.xml
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/eXoGadgets/src/main/webapp/locale/Todo/es_ALL.xml)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/locale/Todo/es_ALL.xml
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/locale/Todo/es_ALL.xml 2011-07-08
16:52:42 UTC (rev 6852)
@@ -0,0 +1,29 @@
+<!--
+
+ 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.
+
+-->
+
+<messagebundle>
+ <msg name="save">
+ Guardar
+ </msg>
+ <msg name="type_here">
+ Introduce la nueva Tarea aquí
+ </msg>
+</messagebundle>
\ No newline at end of file
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/locale/Todo/fr_ALL.xml
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/eXoGadgets/src/main/webapp/locale/Todo/fr_ALL.xml)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/locale/Todo/fr_ALL.xml
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/locale/Todo/fr_ALL.xml 2011-07-08
16:52:42 UTC (rev 6852)
@@ -0,0 +1,29 @@
+<!--
+
+ 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.
+
+-->
+
+<messagebundle>
+ <msg name="save">
+ Sauver
+ </msg>
+ <msg name="type_here">
+ Type de nouvelle tâche ici
+ </msg>
+</messagebundle>
\ No newline at end of file
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/locale/Todo/ja_ALL.xml
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/eXoGadgets/src/main/webapp/locale/Todo/ja_ALL.xml)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/locale/Todo/ja_ALL.xml
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/locale/Todo/ja_ALL.xml 2011-07-08
16:52:42 UTC (rev 6852)
@@ -0,0 +1,29 @@
+<!--
+
+ 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.
+
+-->
+
+<messagebundle>
+ <msg name="save">
+ 保存
+ </msg>
+ <msg name="type_here">
+ 新しいタスクを入力してください。
+ </msg>
+</messagebundle>
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/locale/Todo/kr_ALL.xml
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/eXoGadgets/src/main/webapp/locale/Todo/kr_ALL.xml)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/locale/Todo/kr_ALL.xml
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/locale/Todo/kr_ALL.xml 2011-07-08
16:52:42 UTC (rev 6852)
@@ -0,0 +1,29 @@
+<!--
+
+ 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.
+
+-->
+
+<messagebundle>
+ <msg name="save">
+ 저장
+ </msg>
+ <msg name="type_here">
+ 새로운 태스크를 입력하십시오
+ </msg>
+</messagebundle>
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/locale/Todo/vi_ALL.xml
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/eXoGadgets/src/main/webapp/locale/Todo/vi_ALL.xml)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/locale/Todo/vi_ALL.xml
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/locale/Todo/vi_ALL.xml 2011-07-08
16:52:42 UTC (rev 6852)
@@ -0,0 +1,29 @@
+<!--
+
+ 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.
+
+-->
+
+<messagebundle>
+ <msg name="save">
+ Lưu
+ </msg>
+ <msg name="type_here">
+ Ghi chú công việc
+ </msg>
+</messagebundle>
\ No newline at end of file
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/locale/Todo/zh_ALL.xml
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/eXoGadgets/src/main/webapp/locale/Todo/zh_ALL.xml)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/locale/Todo/zh_ALL.xml
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/locale/Todo/zh_ALL.xml 2011-07-08
16:52:42 UTC (rev 6852)
@@ -0,0 +1,29 @@
+<!--
+
+ 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.
+
+-->
+
+<messagebundle>
+ <msg name="save">
+ 保存
+ </msg>
+ <msg name="type_here">
+ 在此增加新的任务
+ </msg>
+</messagebundle>
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/locale/Todo/zh_TW_ALL.xml
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/eXoGadgets/src/main/webapp/locale/Todo/zh_TW_ALL.xml)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/locale/Todo/zh_TW_ALL.xml
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/locale/Todo/zh_TW_ALL.xml 2011-07-08
16:52:42 UTC (rev 6852)
@@ -0,0 +1,29 @@
+<!--
+
+ 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.
+
+-->
+
+<messagebundle>
+ <msg name="save">
+ Save
+ </msg>
+ <msg name="type_here">
+ Type new task here
+ </msg>
+</messagebundle>
\ No newline at end of file
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/skin/DefaultSkin/portletIcons/Calculator.png
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/eXoGadgets/src/main/webapp/skin/DefaultSkin/portletIcons/Calculator.png)
===================================================================
(Binary files differ)
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/skin/DefaultSkin/portletIcons/Calendar.png
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/eXoGadgets/src/main/webapp/skin/DefaultSkin/portletIcons/Calendar.png)
===================================================================
(Binary files differ)
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/skin/DefaultSkin/portletIcons/Todo.png
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/eXoGadgets/src/main/webapp/skin/DefaultSkin/portletIcons/Todo.png)
===================================================================
(Binary files differ)
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/skin/DefaultSkin/portletIcons/rssAggregator.png
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/eXoGadgets/src/main/webapp/skin/DefaultSkin/portletIcons/rssAggregator.png)
===================================================================
(Binary files differ)
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/skin/image/Button.gif
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/eXoGadgets/src/main/webapp/skin/image/Button.gif)
===================================================================
(Binary files differ)
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/skin/image/ButtonCalendarleft.gif
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/eXoGadgets/src/main/webapp/skin/image/ButtonCalendarleft.gif)
===================================================================
(Binary files differ)
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/skin/image/ButtonCalendarright.gif
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/eXoGadgets/src/main/webapp/skin/image/ButtonCalendarright.gif)
===================================================================
(Binary files differ)
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/skin/image/Calculator.png
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/eXoGadgets/src/main/webapp/skin/image/Calculator.png)
===================================================================
(Binary files differ)
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/skin/image/Display.png
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/eXoGadgets/src/main/webapp/skin/image/Display.png)
===================================================================
(Binary files differ)
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/skin/image/Noteleft.jpg
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/eXoGadgets/src/main/webapp/skin/image/Noteleft.jpg)
===================================================================
(Binary files differ)
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/skin/image/Noteright.jpg
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/eXoGadgets/src/main/webapp/skin/image/Noteright.jpg)
===================================================================
(Binary files differ)
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/skin/image/calender.gif
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/eXoGadgets/src/main/webapp/skin/image/calender.gif)
===================================================================
(Binary files differ)
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/eXoGadgets/src/main/webapp/skin/image/line.gif
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/eXoGadgets/src/main/webapp/skin/image/line.gif)
===================================================================
(Binary files differ)
Copied: epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/pom.xml (from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/pom.xml)
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/pom.xml
(rev 0)
+++ epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/pom.xml 2011-07-08 16:52:42 UTC
(rev 6852)
@@ -0,0 +1,39 @@
+<!--
+
+ 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.
+
+-->
+
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.parent</artifactId>
+ <version>5.1.1-epp-DEV02</version>
+ </parent>
+
+ <artifactId>exo.portal.gadgets</artifactId>
+ <name>GateIn Portal eXo Gadgets</name>
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>core</module>
+ <module>server</module>
+ <module>eXoGadgets</module>
+ </modules>
+</project>
Property changes on: epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/server
___________________________________________________________________
Added: svn:ignore
+ target
Copied: epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/server/pom.xml (from rev
6643, epp/portal/branches/EPP_5_1_Branch/gadgets/server/pom.xml)
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/server/pom.xml
(rev 0)
+++ epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/server/pom.xml 2011-07-08
16:52:42 UTC (rev 6852)
@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.gadgets</artifactId>
+ <version>5.1.1-epp-DEV02</version>
+ </parent>
+
+ <artifactId>exo.portal.gadgets-server</artifactId>
+ <packaging>war</packaging>
+ <name>GateIn Portal eXo Gadgets Server</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <dependentWarExcludes>gadgets/**</dependentWarExcludes>
+
<dependentWarExcludes>WEB-INF/web**</dependentWarExcludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <!-- project dependencies -->
+ <dependency>
+ <groupId>org.gatein.shindig</groupId>
+ <artifactId>shindig-server</artifactId>
+ <type>war</type>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.shindig</groupId>
+ <artifactId>shindig-features</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.shindig</groupId>
+ <artifactId>shindig-social-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <!-- external dependencies -->
+
+ <dependency>
+ <groupId>org.json</groupId>
+ <artifactId>json</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>caja</groupId>
+ <artifactId>caja</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>caja</groupId>
+ <artifactId>json_simple</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>net.oauth</groupId>
+ <artifactId>core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.collections</groupId>
+ <artifactId>google-collections</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.code.guice</groupId>
+ <artifactId>guice</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>rome</groupId>
+ <artifactId>rome</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.ibm.icu</groupId>
+ <artifactId>icu4j</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>net.sourceforge.nekohtml</groupId>
+ <artifactId>nekohtml</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>jaxen</groupId>
+ <artifactId>jaxen</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>nu.validator.htmlparser</groupId>
+ <artifactId>htmlparser</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-digester</groupId>
+ <artifactId>commons-digester</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+</project>
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/server/src/main/webapp/WEB-INF/web.xml
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/server/src/main/webapp/WEB-INF/web.xml)
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/server/src/main/webapp/WEB-INF/web.xml
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/server/src/main/webapp/WEB-INF/web.xml 2011-07-08
16:52:42 UTC (rev 6852)
@@ -0,0 +1,207 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<web-app
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ id="Shindig"
+ version="2.5">
+
+ <display-name>eXoGadgetServer</display-name>
+
+ <!-- configuration -->
+ <!-- If you have your own Guice module(s), put them here as a colon-separated list.
-->
+ <context-param>
+ <param-name>guice-modules</param-name>
+ <param-value>
+ org.apache.shindig.common.PropertiesModule:
+ org.apache.shindig.gadgets.DefaultGuiceModule:
+ org.apache.shindig.gadgets.servlet.AuthenticationModule:
+ org.exoplatform.portal.gadget.core.ExoOAuthModule:
+ org.apache.shindig.common.cache.ehcache.EhCacheModule:
+ org.exoplatform.portal.gadget.core.ExoModule
+ </param-value>
+ </context-param>
+
+ <filter>
+ <filter-name>authFilter</filter-name>
+
<filter-class>org.apache.shindig.auth.AuthenticationServletFilter</filter-class>
+ </filter>
+
+ <filter>
+ <filter-name>ProxyServletFilter</filter-name>
+
<filter-class>org.exoplatform.portal.gadget.core.ProxyServletFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>authFilter</filter-name>
+ <url-pattern>/gadgets/ifr</url-pattern>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>authFilter</filter-name>
+ <url-pattern>/gadgets/makeRequest</url-pattern>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>authFilter</filter-name>
+ <url-pattern>/gadgets/api/rpc/*</url-pattern>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>authFilter</filter-name>
+ <url-pattern>/gadgets/api/rpc/*</url-pattern>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>ProxyServletFilter</filter-name>
+ <servlet-name>proxy</servlet-name>
+ </filter-mapping>
+
+ <listener>
+
<listener-class>org.apache.shindig.common.servlet.GuiceServletContextListener</listener-class>
+ </listener>
+
+ <!-- Render a Gadget -->
+ <servlet>
+ <servlet-name>xml-to-html</servlet-name>
+ <servlet-class>
+ org.apache.shindig.gadgets.servlet.GadgetRenderingServlet
+ </servlet-class>
+ </servlet>
+
+ <!-- Proxy -->
+ <servlet>
+ <servlet-name>proxy</servlet-name>
+ <servlet-class>
+ org.apache.shindig.gadgets.servlet.ProxyServlet
+ </servlet-class>
+ </servlet>
+
+ <servlet>
+ <servlet-name>concat</servlet-name>
+ <servlet-class>
+ org.apache.shindig.gadgets.servlet.ConcatProxyServlet
+ </servlet-class>
+ </servlet>
+
+ <!-- OAuth callback -->
+ <servlet>
+ <servlet-name>oauthCallback</servlet-name>
+ <servlet-class>
+ org.apache.shindig.gadgets.servlet.OAuthCallbackServlet
+ </servlet-class>
+ </servlet>
+
+ <!-- Metadata RPC -->
+ <servlet>
+ <servlet-name>metadata</servlet-name>
+ <servlet-class>
+ org.apache.shindig.gadgets.servlet.RpcServlet
+ </servlet-class>
+ </servlet>
+
+ <!-- makeRequest -->
+ <servlet>
+ <servlet-name>makeRequest</servlet-name>
+ <servlet-class>
+ org.apache.shindig.gadgets.servlet.MakeRequestServlet
+ </servlet-class>
+ </servlet>
+
+
+ <!-- Serve gadgets RPC api -->
+ <servlet>
+ <servlet-name>gadgetsJsonRpcServlet</servlet-name>
+ <servlet-class>
+ org.apache.shindig.protocol.JsonRpcServlet
+ </servlet-class>
+ <init-param>
+ <param-name>handlers</param-name>
+ <param-value>org.apache.shindig.gadgets.handlers</param-value>
+ </init-param>
+ </servlet>
+
+ <servlet>
+ <servlet-name>gadgetsRestapiServlet</servlet-name>
+ <servlet-class>
+ org.apache.shindig.protocol.DataServiceServlet
+ </servlet-class>
+ <init-param>
+ <param-name>handlers</param-name>
+ <param-value>org.apache.shindig.gadgets.handlers</param-value>
+ </init-param>
+ </servlet>
+
+ <!-- javascript serving -->
+ <servlet>
+ <servlet-name>js</servlet-name>
+
<servlet-class>org.apache.shindig.gadgets.servlet.JsServlet</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>js</servlet-name>
+ <url-pattern>/gadgets/js/*</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>proxy</servlet-name>
+ <url-pattern>/gadgets/proxy/*</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>makeRequest</servlet-name>
+ <url-pattern>/gadgets/makeRequest</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>gadgetsJsonRpcServlet</servlet-name>
+ <url-pattern>/gadgets/api/rpc/*</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>gadgetsRestapiServlet</servlet-name>
+ <url-pattern>/gadgets/api/rest/*</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>concat</servlet-name>
+ <url-pattern>/gadgets/concat</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>oauthCallback</servlet-name>
+ <url-pattern>/gadgets/oauthcallback</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>xml-to-html</servlet-name>
+ <url-pattern>/gadgets/ifr</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>metadata</servlet-name>
+ <url-pattern>/gadgets/metadata</url-pattern>
+ </servlet-mapping>
+
+</web-app>
Copied:
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/server/src/main/webapp/oauth.xml
(from rev 6643,
epp/portal/branches/EPP_5_1_Branch/gadgets/server/src/main/webapp/oauth.xml)
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/server/src/main/webapp/oauth.xml
(rev 0)
+++
epp/portal/branches/EPP_5_1_Branch/packaging/gadgets/server/src/main/webapp/oauth.xml 2011-07-08
16:52:42 UTC (rev 6852)
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+
+ 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.
+
+-->
+
+<Module>
+ <ModulePrefs title="Pankow Gadget">
+
+ <Require feature="oauth">
+ <Param name="service_name">
+ demo
+ </Param>
+ <Param name="access_url">
+
http://localhost:9090/oauth-provider/access_token
+ </Param>
+ <Param name="access_method">
+ GET
+ </Param>
+
+ <Param name="request_url">
+
http://localhost:9090/oauth-provider/request_token
+ </Param>
+ <Param name="request_method">
+ GET
+ </Param>
+
+ <Param name="authorize_url">
+
http://localhost:9090/oauth-provider/authorize
+ </Param>
+ </Require>
+
+ </ModulePrefs>
+ <Content type="html">
+ <![CDATA[
+
+ <style>
+ #main {
+ margin: 0px;
+ padding: 0px;
+ font-size: small;
+ }
+ </style>
+
+ <div id="main" style="display: none">
+ </div>
+
+ <div id="approval" style="display: none">
+ <img
src="http://localhost:8080/gadgets/files/samplecontainer/examples/new.gif">
+ <a id="personalize"
+ onclick="javascript:showOneSection('waiting'); return true"
+ target="approve">Personalize this gadget</a>
+ </div>
+
+ <div id="waiting" style="display: none">
+ Please click
+ <a onclick="javascript:fetchData()">I've approved
access</a>
+ once you've approved access to your data.
+ </div>
+
+ <script type="text/javascript">
+ function showOneSection(toshow) {
+ var sections = [ 'main', 'approval', 'waiting' ];
+ for (var i=0; i < sections.length; ++i) {
+ var s = sections[i];
+ var el = document.getElementById(s);
+ if (s === toshow) {
+ el.style.display = "block";
+ } else {
+ el.style.display = "none";
+ }
+ }
+ }
+
+ function fetchData() {
+ url = "http://localhost:9090/oauth-provider/echo";
+ var params = {};
+ params[gadgets.io.RequestParameters.CONTENT_TYPE] =
+ gadgets.io.ContentType.TEXT;
+ params[gadgets.io.RequestParameters.AUTHORIZATION] =
+ gadgets.io.AuthorizationType.AUTHENTICATED;
+ params[gadgets.io.RequestParameters.OAUTH_SERVICE] = "demo";
+ params[gadgets.io.RequestParameters.METHOD] =
+ gadgets.io.MethodType.GET;
+
+ gadgets.io.makeRequest(url, function (response) {
+ if (response.approvalUrl) {
+ var personalize = document.getElementById('personalize');
+ personalize.href = response.approvalUrl;
+ showOneSection('approval');
+ } else if (response.data) {
+ var main = document.getElementById('main');
+ var txt = document.createTextNode(response.data);
+ main.appendChild(txt);
+ showOneSection('main');
+ } else {
+ var main = document.getElementById('main');
+ var whoops = document.createTextNode('Something went wrong');
+ main.appendChild(whoops);
+ showOneSection('main');
+ }
+ }, params);
+ }
+
+ gadgets.util.registerOnLoadHandler(fetchData);
+ </script>
+ ]]>
+ </Content>
+</Module>
Modified: epp/portal/branches/EPP_5_1_Branch/packaging/jboss-as/ear/pom.xml
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/packaging/jboss-as/ear/pom.xml 2011-07-08 16:45:24
UTC (rev 6851)
+++ epp/portal/branches/EPP_5_1_Branch/packaging/jboss-as/ear/pom.xml 2011-07-08 16:52:42
UTC (rev 6852)
@@ -4,7 +4,7 @@
<parent>
<groupId>org.exoplatform.portal</groupId>
<artifactId>exo.portal.parent</artifactId>
- <version>5.1.1-epp-DEV03-SNAPSHOT</version>
+ <version>5.1.1-epp-DEV03</version>
</parent>
<artifactId>exo.portal.packaging.jboss-as.ear</artifactId>
<packaging>ear</packaging>
Modified: epp/portal/branches/EPP_5_1_Branch/packaging/jboss-as/integration.war/pom.xml
===================================================================
---
epp/portal/branches/EPP_5_1_Branch/packaging/jboss-as/integration.war/pom.xml 2011-07-08
16:45:24 UTC (rev 6851)
+++
epp/portal/branches/EPP_5_1_Branch/packaging/jboss-as/integration.war/pom.xml 2011-07-08
16:52:42 UTC (rev 6852)
@@ -4,7 +4,7 @@
<parent>
<groupId>org.exoplatform.portal</groupId>
<artifactId>exo.portal.parent</artifactId>
- <version>5.1.1-epp-DEV03-SNAPSHOT</version>
+ <version>5.1.1-epp-DEV03</version>
</parent>
<artifactId>exo.portal.packaging.jboss-as.integration</artifactId>
<packaging>war</packaging>
Modified: epp/portal/branches/EPP_5_1_Branch/packaging/jboss-as/pkg/pom.xml
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/packaging/jboss-as/pkg/pom.xml 2011-07-08 16:45:24
UTC (rev 6851)
+++ epp/portal/branches/EPP_5_1_Branch/packaging/jboss-as/pkg/pom.xml 2011-07-08 16:52:42
UTC (rev 6852)
@@ -6,7 +6,7 @@
<parent>
<groupId>org.exoplatform.portal</groupId>
<artifactId>exo.portal.parent</artifactId>
- <version>5.1.1-epp-DEV03-SNAPSHOT</version>
+ <version>5.1.1-epp-DEV03</version>
</parent>
<artifactId>exo.portal.packaging.jboss-as.pkg</artifactId>
<packaging>pom</packaging>
Modified: epp/portal/branches/EPP_5_1_Branch/packaging/jboss-as/pom.xml
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/packaging/jboss-as/pom.xml 2011-07-08 16:45:24 UTC
(rev 6851)
+++ epp/portal/branches/EPP_5_1_Branch/packaging/jboss-as/pom.xml 2011-07-08 16:52:42 UTC
(rev 6852)
@@ -5,7 +5,7 @@
<parent>
<groupId>org.exoplatform.portal</groupId>
<artifactId>exo.portal.parent</artifactId>
- <version>5.1.1-epp-DEV03-SNAPSHOT</version>
+ <version>5.1.1-epp-DEV03</version>
</parent>
<artifactId>exo.portal.packaging.jboss-as</artifactId>
<packaging>pom</packaging>
Modified: epp/portal/branches/EPP_5_1_Branch/packaging/module/pom.xml
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/packaging/module/pom.xml 2011-07-08 16:45:24 UTC
(rev 6851)
+++ epp/portal/branches/EPP_5_1_Branch/packaging/module/pom.xml 2011-07-08 16:52:42 UTC
(rev 6852)
@@ -23,7 +23,7 @@
<parent>
<groupId>org.exoplatform.portal</groupId>
<artifactId>exo.portal.packaging</artifactId>
- <version>5.1.1-epp-DEV03-SNAPSHOT</version>
+ <version>5.1.1-epp-DEV03</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: epp/portal/branches/EPP_5_1_Branch/packaging/pkg/pom.xml
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/packaging/pkg/pom.xml 2011-07-08 16:45:24 UTC (rev
6851)
+++ epp/portal/branches/EPP_5_1_Branch/packaging/pkg/pom.xml 2011-07-08 16:52:42 UTC (rev
6852)
@@ -23,7 +23,7 @@
<parent>
<groupId>org.exoplatform.portal</groupId>
<artifactId>exo.portal.packaging</artifactId>
- <version>5.1.1-epp-DEV03-SNAPSHOT</version>
+ <version>5.1.1-epp-DEV03</version>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -67,13 +67,13 @@
<dependency>
<groupId>org.exoplatform.portal</groupId>
<artifactId>portal.packaging.module</artifactId>
- <version>5.1.1-epp-DEV03-SNAPSHOT</version>
+ <version>5.1.1-epp-DEV03</version>
<type>js</type>
</dependency>
<dependency>
<groupId>org.exoplatform.portal</groupId>
<artifactId>portal.packaging.product</artifactId>
- <version>5.1.1-epp-DEV03-SNAPSHOT</version>
+ <version>5.1.1-epp-DEV03</version>
<type>js</type>
</dependency>
</dependencies>
Modified: epp/portal/branches/EPP_5_1_Branch/packaging/pom.xml
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/packaging/pom.xml 2011-07-08 16:45:24 UTC (rev
6851)
+++ epp/portal/branches/EPP_5_1_Branch/packaging/pom.xml 2011-07-08 16:52:42 UTC (rev
6852)
@@ -23,7 +23,7 @@
<parent>
<groupId>org.exoplatform.portal</groupId>
<artifactId>exo.portal.parent</artifactId>
- <version>5.1.1-epp-DEV03-SNAPSHOT</version>
+ <version>5.1.1-epp-DEV03</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: epp/portal/branches/EPP_5_1_Branch/packaging/product/pom.xml
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/packaging/product/pom.xml 2011-07-08 16:45:24 UTC
(rev 6851)
+++ epp/portal/branches/EPP_5_1_Branch/packaging/product/pom.xml 2011-07-08 16:52:42 UTC
(rev 6852)
@@ -23,7 +23,7 @@
<parent>
<groupId>org.exoplatform.portal</groupId>
<artifactId>exo.portal.packaging</artifactId>
- <version>5.1.1-epp-DEV03-SNAPSHOT</version>
+ <version>5.1.1-epp-DEV03</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: epp/portal/branches/EPP_5_1_Branch/packaging/reports/pom.xml
===================================================================
--- epp/portal/branches/EPP_5_1_Branch/packaging/reports/pom.xml 2011-07-08 16:45:24 UTC
(rev 6851)
+++ epp/portal/branches/EPP_5_1_Branch/packaging/reports/pom.xml 2011-07-08 16:52:42 UTC
(rev 6852)
@@ -23,7 +23,7 @@
<parent>
<groupId>org.exoplatform.portal</groupId>
<artifactId>exo.portal.packaging</artifactId>
- <version>5.1.1-epp-DEV03-SNAPSHOT</version>
+ <version>5.1.1-epp-DEV03</version>
</parent>
<modelVersion>4.0.0</modelVersion>