Author: ndkhoiits
Date: 2011-08-13 07:10:07 -0400 (Sat, 13 Aug 2011)
New Revision: 7070
Modified:
portal/trunk/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoContainerConfig.java
portal/trunk/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoHttpFetcher.java
portal/trunk/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoModule.java
portal/trunk/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/GateInGuiceServletContextListener.java
portal/trunk/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/GateInJsonContainerConfig.java
portal/trunk/gadgets/server/pom.xml
portal/trunk/gadgets/server/src/main/webapp/WEB-INF/web.xml
portal/trunk/gadgets/server/src/main/webapp/containers/default/container.js
portal/trunk/packaging/jboss-as5/pkg/pom.xml
portal/trunk/packaging/jboss-as6/pkg/pom.xml
portal/trunk/packaging/jetty/pkg/pom.xml
portal/trunk/packaging/tomcat/pkg/pom.xml
portal/trunk/pom.xml
portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/gadget/webui/component/UIGadgetPortlet.java
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/gadget/Gadgets.js
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/gadget/UIGadget.js
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/application/UIGadget.gtmpl
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/GadgetUtil.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java
Log:
GTNPORTAL-2002 Upgrade to usage Shindig 2
Modified:
portal/trunk/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoContainerConfig.java
===================================================================
---
portal/trunk/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoContainerConfig.java 2011-08-13
07:49:09 UTC (rev 7069)
+++
portal/trunk/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoContainerConfig.java 2011-08-13
11:10:07 UTC (rev 7070)
@@ -25,7 +25,7 @@
import com.google.inject.name.Named;
import sun.misc.BASE64Encoder;
-import org.apache.shindig.auth.BlobCrypterSecurityTokenDecoder;
+import org.apache.shindig.auth.BlobCrypterSecurityTokenCodec;
import org.apache.shindig.config.ContainerConfigException;
import org.apache.shindig.expressions.Expressions;
import org.exoplatform.commons.utils.PropertyManager;
@@ -195,7 +195,7 @@
@Override
public Object getProperty(String container, String property)
{
- if (property.equals(BlobCrypterSecurityTokenDecoder.SECURITY_TOKEN_KEY_FILE)
&& tokenKey_ != null)
+ if (property.equals(BlobCrypterSecurityTokenCodec.SECURITY_TOKEN_KEY_FILE)
&& tokenKey_ != null)
{
return tokenKey_;
}
Modified:
portal/trunk/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoHttpFetcher.java
===================================================================
---
portal/trunk/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoHttpFetcher.java 2011-08-13
07:49:09 UTC (rev 7069)
+++
portal/trunk/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoHttpFetcher.java 2011-08-13
11:10:07 UTC (rev 7070)
@@ -41,6 +41,6 @@
@Inject
public ExoHttpFetcher()
{
- super(DEFAULT_MAX_OBJECT_SIZE, DEFAULT_CONNECT_TIMEOUT_MS);
+ super(DEFAULT_MAX_OBJECT_SIZE, DEFAULT_CONNECT_TIMEOUT_MS,
DEFAULT_CONNECT_TIMEOUT_MS, null);
}
}
Modified:
portal/trunk/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoModule.java
===================================================================
---
portal/trunk/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoModule.java 2011-08-13
07:49:09 UTC (rev 7069)
+++
portal/trunk/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/ExoModule.java 2011-08-13
11:10:07 UTC (rev 7070)
@@ -19,9 +19,16 @@
package org.exoplatform.portal.gadget.core;
+import com.google.inject.AbstractModule;
+import com.google.inject.name.Names;
+
import org.apache.shindig.config.ContainerConfig;
import org.apache.shindig.gadgets.DefaultGuiceModule;
import org.apache.shindig.gadgets.http.HttpFetcher;
+import org.apache.shindig.protocol.conversion.BeanAtomConverter;
+import org.apache.shindig.protocol.conversion.BeanConverter;
+import org.apache.shindig.protocol.conversion.BeanJsonConverter;
+import org.apache.shindig.protocol.conversion.BeanXmlConverter;
/**
* The goal of the module is to bind the {@link
org.apache.shindig.common.ContainerConfig} interface to the
@@ -31,16 +38,17 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien
Viet</a>
* @version $Revision$
*/
-public class ExoModule extends DefaultGuiceModule
+public class ExoModule extends AbstractModule
{
@Override
protected void configure()
{
- //super.configure();
-
- //
bind(ContainerConfig.class).to(ExoContainerConfig.class);
bind(HttpFetcher.class).to(ExoHttpFetcher.class);
+
+
bind(BeanConverter.class).annotatedWith(Names.named("shindig.bean.converter.xml")).to(BeanXmlConverter.class);
+
bind(BeanConverter.class).annotatedWith(Names.named("shindig.bean.converter.json")).to(BeanJsonConverter.class);
+
bind(BeanConverter.class).annotatedWith(Names.named("shindig.bean.converter.atom")).to(BeanAtomConverter.class);
}
}
Modified:
portal/trunk/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/GateInGuiceServletContextListener.java
===================================================================
---
portal/trunk/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/GateInGuiceServletContextListener.java 2011-08-13
07:49:09 UTC (rev 7069)
+++
portal/trunk/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/GateInGuiceServletContextListener.java 2011-08-13
11:10:07 UTC (rev 7070)
@@ -41,12 +41,7 @@
}
InputStream is = scontext.getResourceAsStream(path);
-
- if(is == null)
- {
- throw new NullPointerException("There is no file specified by path :
" + path);
- }
- return IOUtils.toString(is, encoding);
+ return (is != null) ? IOUtils.toString(is, encoding) : null;
}
};
Modified:
portal/trunk/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/GateInJsonContainerConfig.java
===================================================================
---
portal/trunk/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/GateInJsonContainerConfig.java 2011-08-13
07:49:09 UTC (rev 7069)
+++
portal/trunk/gadgets/core/src/main/java/org/exoplatform/portal/gadget/core/GateInJsonContainerConfig.java 2011-08-13
11:10:07 UTC (rev 7070)
@@ -239,12 +239,16 @@
try {
for (String entry : files) {
LOG.info("Reading container config: " + entry);
- //final ClassLoader contextCl = Thread.currentThread().getContextClassLoader();
- //InputStream resourceInputStream = contextCl.getResourceAsStream(entry);
- //String content = IOUtils.toString(resourceInputStream, "UTF-8");
-
GateInContainerConfigLoader currentLoader =
GateInGuiceServletContextListener.getCurrentLoader();
String content = currentLoader.loadContentAsString(entry, "UTF-8");
+
+ if(content == null) {
+ LOG.warning("There is no configuration file " + entry + " in
Gadget Server context");
+ content = ResourceLoader.getContent(entry);
+ if (content == null || content.length() == 0) {
+ throw new IOException("The file " + entry + " is
empty");
+ }
+ }
loadFromString(content, all);
}
} catch (IOException e) {
Modified: portal/trunk/gadgets/server/pom.xml
===================================================================
--- portal/trunk/gadgets/server/pom.xml 2011-08-13 07:49:09 UTC (rev 7069)
+++ portal/trunk/gadgets/server/pom.xml 2011-08-13 11:10:07 UTC (rev 7070)
@@ -49,34 +49,9 @@
<!-- 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>
- <exclusions>
- <exclusion>
- <groupId>net.oauth.core</groupId>
- <artifactId>oauth-provider</artifactId>
- </exclusion>
- <exclusion>
- <groupId>net.oauth</groupId>
- <artifactId>core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.google.code.guice</groupId>
- <artifactId>guice-jmx</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
<!-- external dependencies -->
<dependency>
@@ -94,24 +69,12 @@
<artifactId>json_simple</artifactId>
<scope>provided</scope>
</dependency>
- <!--
<dependency>
- <groupId>net.oauth</groupId>
- <artifactId>core</artifactId>
- <scope>provided</scope>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <scope>provided</scope>
</dependency>
- -->
<dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>com.google.inject</groupId>
- <artifactId>guice</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<scope>provided</scope>
@@ -144,16 +107,16 @@
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>nu.validator.htmlparser</groupId>
- <artifactId>htmlparser</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>
+ <dependency>
+ <groupId>commons-digester</groupId>
+ <artifactId>commons-digester</artifactId>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
</project>
Modified: portal/trunk/gadgets/server/src/main/webapp/WEB-INF/web.xml
===================================================================
--- portal/trunk/gadgets/server/src/main/webapp/WEB-INF/web.xml 2011-08-13 07:49:09 UTC
(rev 7069)
+++ portal/trunk/gadgets/server/src/main/webapp/WEB-INF/web.xml 2011-08-13 11:10:07 UTC
(rev 7070)
@@ -52,8 +52,23 @@
<filter-name>ProxyServletFilter</filter-name>
<filter-class>org.exoplatform.portal.gadget.core.ProxyServletFilter</filter-class>
</filter>
+
+ <filter>
+ <filter-name>hostFilter</filter-name>
+
<filter-class>org.apache.shindig.common.servlet.HostFilter</filter-class>
+ </filter>
<filter-mapping>
+ <filter-name>hostFilter</filter-name>
+ <url-pattern>/gadgets/ifr</url-pattern>
+ <url-pattern>/gadgets/js/*</url-pattern>
+ <url-pattern>/gadgets/proxy/*</url-pattern>
+ <url-pattern>/gadgets/concat</url-pattern>
+ <url-pattern>/rpc/*</url-pattern>
+ <url-pattern>/rest/*</url-pattern>
+ </filter-mapping>
+
+ <filter-mapping>
<filter-name>authFilter</filter-name>
<url-pattern>/gadgets/ifr</url-pattern>
</filter-mapping>
@@ -79,7 +94,6 @@
</filter-mapping>
<listener>
-
<!--<listener-class>org.apache.shindig.common.servlet.GuiceServletContextListener</listener-class>-->
<listener-class>org.exoplatform.portal.gadget.core.GateInGuiceServletContextListener</listener-class>
</listener>
@@ -139,7 +153,7 @@
</servlet-class>
<init-param>
<param-name>handlers</param-name>
- <param-value>org.apache.shindig.gadgets.handlers</param-value>
+ <param-value>org.apache.shindig.handlers</param-value>
</init-param>
</servlet>
@@ -150,7 +164,7 @@
</servlet-class>
<init-param>
<param-name>handlers</param-name>
- <param-value>org.apache.shindig.gadgets.handlers</param-value>
+ <param-value>org.apache.shindig.handlers</param-value>
</init-param>
</servlet>
Modified: portal/trunk/gadgets/server/src/main/webapp/containers/default/container.js
===================================================================
--- portal/trunk/gadgets/server/src/main/webapp/containers/default/container.js 2011-08-13
07:49:09 UTC (rev 7069)
+++ portal/trunk/gadgets/server/src/main/webapp/containers/default/container.js 2011-08-13
11:10:07 UTC (rev 7070)
@@ -44,7 +44,9 @@
// Container must be an array; this allows multiple containers
// to share configuration.
-{"gadgets.container" : ["default"],
+// TODO: Move out accel container config into a separate accel.js file.
+// TODO : remove "" container
+{"gadgets.container" : ["default", "accel", ""],
// Set of regular expressions to validate the parent parameter. This is
// necessary to support situations where you want a single container to support
@@ -60,38 +62,45 @@
// DNS domain on which gadgets should render.
"gadgets.lockedDomainSuffix" : "-a.example.com:8080",
+// Origins for CORS requests and/or Referer validation
+// Indicate a set of origins or an entry with * to indicate that all origins are allowed
+"gadgets.parentOrigins" : ["*"],
+
// 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",
+"gadgets.uri.iframe.basePath" : "/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%",
+//New configuration for iframeUri generation:
+"gadgets.uri.iframe.lockedDomainSuffix" : "-a.example.com:8080",
+"gadgets.uri.iframe.unlockedDomain" : "http://%host%",
+"gadgets.uri.iframe.basePath" : "/eXoGadgetServer/gadgets/ifr",
+
+
// Callback URL. Scheme relative URL for easy switch between https/http.
-"gadgets.oauthGadgetCallbackTemplate" :
"//%host%/eXoGadgetServer/gadgets/oauthcallback",
+"gadgets.uri.oauth.callbackTemplate" :
"//%host%/eXoGadgetServer/gadgets/oauthcallback",
// Use an insecure security token by default
"gadgets.securityTokenType" : "secure",
"gadgets.securityTokenKeyFile" : "key.txt",
+// Config param to load Opensocial data for social
+// preloads in data pipelining. %host% will be
+// substituted with the current host.
+"gadgets.osDataUri" : "http://%host%/rpc",
+
"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": "",
@@ -101,6 +110,19 @@
"concat-url": "/eXoGadgetServer/gadgets/concat?"
},
+// Default Js Uri config: also must be overridden.
+"gadgets.uri.js.host" : "http://%host%/",
+"gadgets.uri.js.path" : "/eXoGadgetServer/gadgets/js",
+
+// Default concat Uri config; used for testing.
+"gadgets.uri.concat.host" : "%host%",
+"gadgets.uri.concat.path" : "/eXoGadgetServer/gadgets/concat",
+"gadgets.uri.concat.js.splitToken" : "false",
+
+// Default proxy Uri config; used for testing.
+"gadgets.uri.proxy.host" : "%host%",
+"gadgets.uri.proxy.path" : "/eXoGadgetServer/gadgets/proxy",
+
// This config data will be passed down to javascript. Please
// configure your object using the feature name rather than
// the javascript name.
@@ -110,7 +132,7 @@
"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%",
+ "proxyUrl" :
"//%host%/eXoGadgetServer/gadgets/proxy?container=default&refresh=%refresh%&url=%url%%rewriteMime%",
"jsonProxyUrl" : "//%host%/eXoGadgetServer/gadgets/makeRequest"
},
"views" : {
@@ -125,6 +147,74 @@
"aliases" : ["FULL_PAGE"]
}
},
+ "tabs": {
+ "css" : [
+ ".tablib_table {",
+ "width: 100%;",
+ "border-collapse: separate;",
+ "border-spacing: 0px;",
+ "empty-cells: show;",
+ "font-size: 11px;",
+ "text-align: center;",
+ "}",
+ ".tablib_emptyTab {",
+ "border-bottom: 1px solid #676767;",
+ "padding: 0px 1px;",
+ "}",
+ ".tablib_spacerTab {",
+ "border-bottom: 1px solid #676767;",
+ "padding: 0px 1px;",
+ "width: 1px;",
+ "}",
+ ".tablib_selected {",
+ "padding: 2px;",
+ "background-color: #ffffff;",
+ "border: 1px solid #676767;",
+ "border-bottom-width: 0px;",
+ "color: #3366cc;",
+ "font-weight: bold;",
+ "width: 80px;",
+ "cursor: default;",
+ "}",
+ ".tablib_unselected {",
+ "padding: 2px;",
+ "background-color: #dddddd;",
+ "border: 1px solid #aaaaaa;",
+ "border-bottom-color: #676767;",
+ "color: #000000;",
+ "width: 80px;",
+ "cursor: pointer;",
+ "}",
+ ".tablib_navContainer {",
+ "width: 10px;",
+ "vertical-align: middle;",
+ "}",
+ ".tablib_navContainer a:link, ",
+ ".tablib_navContainer a:visited, ",
+ ".tablib_navContainer a:hover {",
+ "color: #3366aa;",
+ "text-decoration: none;",
+ "}"
+ ]
+ },
+ "minimessage": {
+ "css": [
+ ".mmlib_table {",
+ "width: 100%;",
+ "font: bold 9px arial,sans-serif;",
+ "background-color: #fff4c2;",
+ "border-collapse: separate;",
+ "border-spacing: 0px;",
+ "padding: 1px 0px;",
+ "}",
+ ".mmlib_xlink {",
+ "font: normal 1.1em arial,sans-serif;",
+ "font-weight: bold;",
+ "color: #0000cc;",
+ "cursor: pointer;",
+ "}"
+ ]
+ },
"rpc" : {
// Path to the relay file. Automatically appended to the parent
/// parameter if it passes input validation and is not null.
@@ -147,34 +237,44 @@
"ANCHOR_COLOR": ""
}
},
- "opensocial-0.8" : {
+ "opensocial" : {
// Path to fetch opensocial data from
// Must be on the same domain as the gadget rendering server
- "path" : "http://%host%/social",
+ "path" : "http://%host%/rpc",
+ // Path to issue invalidate calls
+ "invalidatePath" : "http://%host%/rpc",
"domain" : "shindig",
"enableCaja" : false,
"supportedFields" : {
"person" : ["id", {"name" : ["familyName",
"givenName", "unstructured"]}, "thumbnailUrl",
"profileUrl"],
- "activity" : ["id", "title"]
+ "activity" : ["appId", "body", "bodyId",
"externalId", "id", "mediaItems", "postedTime",
"priority",
+ "streamFaviconUrl", "streamSourceUrl",
"streamTitle", "streamUrl", "templateParams",
"title",
+ "url", "userId"],
+ "activityEntry" : ["icon", "postedTime",
"actor", "verb", "object", "target",
"generator", "provider", "title",
+ "body", "standardLinks", "to",
"cc", "bcc"],
+ "album" : ["id", "thumbnailUrl", "title",
"description", "location", "ownerId"],
+ "mediaItem" : ["album_id", "created",
"description", "duration", "file_size", "id",
"language", "last_updated",
+ "location", "mime_type",
"num_comments", "num_views", "num_votes",
"rating", "start_time",
+ "tagged_people", "tags",
"thumbnail_url", "title", "type", "url"]
}
},
"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
+ // 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" ]
-// },
+ "osapi" : {
+ // The endpoints to query for available JSONRPC/REST services
+ "endPoints" : [ "http://%host%/rpc" ]
+ },
"osml": {
// OSML library resource. Can be set to null or the empty string to disable OSML
// for a container.
- "library": ""
+ "library": "config/OSML_library.xml"
}
-}}
+}}
\ No newline at end of file
Modified: portal/trunk/packaging/jboss-as5/pkg/pom.xml
===================================================================
--- portal/trunk/packaging/jboss-as5/pkg/pom.xml 2011-08-13 07:49:09 UTC (rev 7069)
+++ portal/trunk/packaging/jboss-as5/pkg/pom.xml 2011-08-13 11:10:07 UTC (rev 7070)
@@ -417,7 +417,7 @@
<artifactId>shindig-common</artifactId>
<exclusions>
<exclusion>
- <groupId>com.google.code.guice</groupId>
+ <groupId>com.google.inject.extensions</groupId>
<artifactId>guice-jmx</artifactId>
</exclusion>
</exclusions>
@@ -427,7 +427,7 @@
<artifactId>shindig-social-api</artifactId>
<exclusions>
<exclusion>
- <groupId>com.google.code.guice</groupId>
+ <groupId>com.google.inject.extensions</groupId>
<artifactId>guice-jmx</artifactId>
</exclusion>
<exclusion>
@@ -435,11 +435,19 @@
<artifactId>oauth-provider</artifactId>
</exclusion>
<exclusion>
- <groupId>net.oauth</groupId>
- <artifactId>core</artifactId>
+ <groupId>net.oauth.core</groupId>
+ <artifactId>oauth</artifactId>
</exclusion>
</exclusions>
</dependency>
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpcore</artifactId>
+ </dependency>
<!-- GateIn -->
<dependency>
@@ -606,6 +614,10 @@
<artifactId>guice-jmx</artifactId>
</dependency>
<dependency>
+ <groupId>com.google.inject.extensions</groupId>
+ <artifactId>guice-multibindings</artifactId>
+ </dependency>
+ <dependency>
<groupId>aopalliance</groupId>
<artifactId>aopalliance</artifactId>
<version>1.0</version>
@@ -708,11 +720,13 @@
</dependency>
<dependency>
<groupId>de.odysseus.juel</groupId>
- <artifactId>juel-api</artifactId>
- </dependency>
- <dependency>
- <groupId>de.odysseus.juel</groupId>
<artifactId>juel-impl</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>de.odysseus.juel</groupId>
+ <artifactId>juel-api</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
@@ -793,8 +807,8 @@
<version>1.3.1</version>
</dependency>
<dependency>
- <groupId>net.oauth</groupId>
- <artifactId>core</artifactId>
+ <groupId>net.oauth.core</groupId>
+ <artifactId>oauth</artifactId>
</dependency>
<dependency>
<groupId>org.jvnet.jaxb2.maven2</groupId>
Modified: portal/trunk/packaging/jboss-as6/pkg/pom.xml
===================================================================
--- portal/trunk/packaging/jboss-as6/pkg/pom.xml 2011-08-13 07:49:09 UTC (rev 7069)
+++ portal/trunk/packaging/jboss-as6/pkg/pom.xml 2011-08-13 11:10:07 UTC (rev 7070)
@@ -415,7 +415,7 @@
<artifactId>shindig-common</artifactId>
<exclusions>
<exclusion>
- <groupId>com.google.code.guice</groupId>
+ <groupId>com.google.inject.extensions</groupId>
<artifactId>guice-jmx</artifactId>
</exclusion>
</exclusions>
@@ -425,7 +425,7 @@
<artifactId>shindig-social-api</artifactId>
<exclusions>
<exclusion>
- <groupId>com.google.code.guice</groupId>
+ <groupId>com.google.inject.extensions</groupId>
<artifactId>guice-jmx</artifactId>
</exclusion>
<exclusion>
@@ -433,11 +433,19 @@
<artifactId>oauth-provider</artifactId>
</exclusion>
<exclusion>
- <groupId>net.oauth</groupId>
- <artifactId>core</artifactId>
+ <groupId>net.oauth.core</groupId>
+ <artifactId>oauth</artifactId>
</exclusion>
</exclusions>
</dependency>
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpcore</artifactId>
+ </dependency>
<!-- GateIn -->
<dependency>
@@ -597,6 +605,10 @@
<artifactId>guice-jmx</artifactId>
</dependency>
<dependency>
+ <groupId>com.google.inject.extensions</groupId>
+ <artifactId>guice-multibindings</artifactId>
+ </dependency>
+ <dependency>
<groupId>aopalliance</groupId>
<artifactId>aopalliance</artifactId>
<version>1.0</version>
@@ -699,11 +711,13 @@
</dependency>
<dependency>
<groupId>de.odysseus.juel</groupId>
- <artifactId>juel-api</artifactId>
- </dependency>
- <dependency>
- <groupId>de.odysseus.juel</groupId>
<artifactId>juel-impl</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>de.odysseus.juel</groupId>
+ <artifactId>juel-api</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
@@ -784,8 +798,8 @@
<version>1.3.1</version>
</dependency>
<dependency>
- <groupId>net.oauth</groupId>
- <artifactId>core</artifactId>
+ <groupId>net.oauth.core</groupId>
+ <artifactId>oauth</artifactId>
</dependency>
<dependency>
<groupId>org.jvnet.jaxb2.maven2</groupId>
Modified: portal/trunk/packaging/jetty/pkg/pom.xml
===================================================================
--- portal/trunk/packaging/jetty/pkg/pom.xml 2011-08-13 07:49:09 UTC (rev 7069)
+++ portal/trunk/packaging/jetty/pkg/pom.xml 2011-08-13 11:10:07 UTC (rev 7070)
@@ -66,8 +66,8 @@
<artifactId>commons-fileupload</artifactId>
</dependency>
<dependency>
- <groupId>commons-httpclient</groupId>
- <artifactId>commons-httpclient</artifactId>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
@@ -417,6 +417,14 @@
<groupId>org.gatein.shindig</groupId>
<artifactId>shindig-social-api</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpcore</artifactId>
+ </dependency>
<!-- GateIn -->
<dependency>
@@ -570,6 +578,10 @@
<artifactId>guice-jmx</artifactId>
</dependency>
<dependency>
+ <groupId>com.google.inject.extensions</groupId>
+ <artifactId>guice-multibindings</artifactId>
+ </dependency>
+ <dependency>
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
</dependency>
@@ -611,7 +623,7 @@
</dependency>
<dependency>
<groupId>net.sf.ehcache</groupId>
- <artifactId>ehcache</artifactId>
+ <artifactId>ehcache-core</artifactId>
</dependency>
<dependency>
<groupId>com.jhlabs</groupId>
@@ -671,11 +683,13 @@
</dependency>
<dependency>
<groupId>de.odysseus.juel</groupId>
- <artifactId>juel-api</artifactId>
- </dependency>
- <dependency>
- <groupId>de.odysseus.juel</groupId>
<artifactId>juel-impl</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>de.odysseus.juel</groupId>
+ <artifactId>juel-api</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
@@ -750,8 +764,8 @@
<artifactId>xstream</artifactId>
</dependency>
<dependency>
- <groupId>net.oauth</groupId>
- <artifactId>core</artifactId>
+ <groupId>net.oauth.core</groupId>
+ <artifactId>oauth</artifactId>
</dependency>
<dependency>
<groupId>org.apache.tika</groupId>
Modified: portal/trunk/packaging/tomcat/pkg/pom.xml
===================================================================
--- portal/trunk/packaging/tomcat/pkg/pom.xml 2011-08-13 07:49:09 UTC (rev 7069)
+++ portal/trunk/packaging/tomcat/pkg/pom.xml 2011-08-13 11:10:07 UTC (rev 7070)
@@ -62,8 +62,8 @@
<artifactId>commons-fileupload</artifactId>
</dependency>
<dependency>
- <groupId>commons-httpclient</groupId>
- <artifactId>commons-httpclient</artifactId>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
@@ -409,6 +409,14 @@
<groupId>org.gatein.shindig</groupId>
<artifactId>shindig-social-api</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpclient</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.httpcomponents</groupId>
+ <artifactId>httpcore</artifactId>
+ </dependency>
<!-- GateIn -->
<dependency>
@@ -568,6 +576,10 @@
<artifactId>guice-jmx</artifactId>
</dependency>
<dependency>
+ <groupId>com.google.inject.extensions</groupId>
+ <artifactId>guice-multibindings</artifactId>
+ </dependency>
+ <dependency>
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
</dependency>
@@ -609,7 +621,7 @@
</dependency>
<dependency>
<groupId>net.sf.ehcache</groupId>
- <artifactId>ehcache</artifactId>
+ <artifactId>ehcache-core</artifactId>
</dependency>
<dependency>
<groupId>com.jhlabs</groupId>
@@ -669,11 +681,13 @@
</dependency>
<dependency>
<groupId>de.odysseus.juel</groupId>
- <artifactId>juel-api</artifactId>
- </dependency>
- <dependency>
- <groupId>de.odysseus.juel</groupId>
<artifactId>juel-impl</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>de.odysseus.juel</groupId>
+ <artifactId>juel-api</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
@@ -748,8 +762,8 @@
<artifactId>xstream</artifactId>
</dependency>
<dependency>
- <groupId>net.oauth</groupId>
- <artifactId>core</artifactId>
+ <groupId>net.oauth.core</groupId>
+ <artifactId>oauth</artifactId>
</dependency>
<dependency>
<groupId>org.apache.tika</groupId>
Modified: portal/trunk/pom.xml
===================================================================
--- portal/trunk/pom.xml 2011-08-13 07:49:09 UTC (rev 7069)
+++ portal/trunk/pom.xml 2011-08-13 11:10:07 UTC (rev 7070)
@@ -41,7 +41,7 @@
<org.exoplatform.core.version>2.4.0-CR2</org.exoplatform.core.version>
<org.exoplatform.ws.version>2.2.0-CR2</org.exoplatform.ws.version>
<org.exoplatform.jcr.version>1.14.0-CR2</org.exoplatform.jcr.version>
- <org.shindig.version>1.0-r790473-Patch06</org.shindig.version>
+ <org.shindig.version>2.0.2-Beta02</org.shindig.version>
<nl.captcha.simplecaptcha.version>1.1.1-GA-Patch01</nl.captcha.simplecaptcha.version>
<org.gatein.common.version>2.0.4-Beta03</org.gatein.common.version>
<org.gatein.wci.version>2.1.0-Beta04</org.gatein.wci.version>
@@ -96,7 +96,7 @@
<dependency>
<groupId>org.gatein</groupId>
<artifactId>gatein-dep</artifactId>
- <version>1.1.0-Beta04</version>
+ <version>1.1.0-Beta06</version>
<type>pom</type>
<scope>import</scope>
</dependency>
@@ -736,12 +736,6 @@
<groupId>org.gatein.shindig</groupId>
<artifactId>shindig-gadgets</artifactId>
<version>${org.shindig.version}</version>
- <exclusions>
- <exclusion>
- <groupId>com.google.code.guice</groupId>
- <artifactId>guice-jmx</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>org.gatein.shindig</groupId>
@@ -755,17 +749,6 @@
</dependency>
<dependency>
<groupId>org.gatein.shindig</groupId>
- <artifactId>shindig-server</artifactId>
- <version>${org.shindig.version}</version>
- </dependency>
- <dependency>
- <groupId>org.gatein.shindig</groupId>
- <artifactId>shindig-server</artifactId>
- <version>${org.shindig.version}</version>
- <type>war</type>
- </dependency>
- <dependency>
- <groupId>org.gatein.shindig</groupId>
<artifactId>shindig-social-api</artifactId>
<version>${org.shindig.version}</version>
</dependency>
Modified:
portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/gadget/webui/component/UIGadgetPortlet.java
===================================================================
---
portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/gadget/webui/component/UIGadgetPortlet.java 2011-08-13
07:49:09 UTC (rev 7069)
+++
portal/trunk/portlet/dashboard/src/main/java/org/exoplatform/gadget/webui/component/UIGadgetPortlet.java 2011-08-13
11:10:07 UTC (rev 7070)
@@ -25,6 +25,7 @@
import org.exoplatform.container.ExoContainer;
import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.portal.webui.application.GadgetUtil;
+import org.exoplatform.portal.webui.application.UIGadget;
import org.exoplatform.web.application.ApplicationMessage;
import org.exoplatform.webui.application.WebuiApplication;
import org.exoplatform.webui.application.WebuiRequestContext;
@@ -35,6 +36,7 @@
import org.exoplatform.webui.core.lifecycle.UIApplicationLifecycle;
import org.gatein.common.logging.Logger;
import org.gatein.common.logging.LoggerFactory;
+import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
@@ -146,19 +148,18 @@
public String getMetadata(String url)
{
- String metadata_ = GadgetUtil.fetchGagdetMetadata(url);
+ JSONObject metadata_ = null;
try
{
- JSONObject jsonObj = new JSONObject(metadata_);
- JSONObject obj = jsonObj.getJSONArray("gadgets").getJSONObject(0);
+ String strMetadata = GadgetUtil.fetchGagdetRpcMetadata(url);
+ metadata_ = new
JSONArray(strMetadata).getJSONObject(0).getJSONObject(UIGadget.RPC_RESULT).getJSONObject(url);
String token = GadgetUtil.createToken(url, new Long(hashCode()));
- obj.put("secureToken", token);
- metadata_ = jsonObj.toString();
+ metadata_.put("secureToken", token);
}
catch (JSONException e)
{
e.printStackTrace(); //To change body of catch statement use File | Settings |
File Templates.
}
- return metadata_;
+ return metadata_.toString();
}
}
Modified: portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/gadget/Gadgets.js
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/gadget/Gadgets.js 2011-08-13
07:49:09 UTC (rev 7069)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/gadget/Gadgets.js 2011-08-13
11:10:07 UTC (rev 7070)
@@ -218,7 +218,7 @@
value) {
var id = gadgets.container.gadgetService.getGadgetIdFromModuleId(this.f);
var gadget = gadgets.container.getGadget(id);
- var new_prefs = {};
+ var new_prefs = gadget.getUserPrefs() || {};
for (var i = 1, j = arguments.length; i < j; i += 2) {
new_prefs[arguments[i]] = arguments[i + 1];
}
@@ -631,7 +631,7 @@
var j = 0;
for (var att in prefs) {
//TODO: dang.tung not append when using list
- type = prefs[att].type;
+ type = prefs[att].dataType.toLowerCase();
if(type == "list"|| type == "hidden") continue;
// end
var attEl = document.createElement("div");
Modified: portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/gadget/UIGadget.js
===================================================================
---
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/gadget/UIGadget.js 2011-08-13
07:49:09 UTC (rev 7069)
+++
portal/trunk/web/eXoResources/src/main/webapp/javascript/eXo/gadget/UIGadget.js 2011-08-13
11:10:07 UTC (rev 7070)
@@ -52,11 +52,11 @@
var gadget;
if (metadata != null) {
// Check if gadget's height is not set and current view is canvas. By
default, gadget's height is 800px
- if(metadata.gadgets[0].height == 0 && view == 'canvas') {
- metadata.gadgets[0].height = "800px";
+ if(metadata.modulePrefs.height == 0 && view == 'canvas') {
+ metadata.modulePrefs.height = "800px";
}
- gadget = gadgets.container.createGadget({specUrl: url,height:
metadata.gadgets[0].height, secureToken: metadata.gadgets[0].secureToken, view: view});
- gadget.metadata = metadata.gadgets[0];
+ gadget = gadgets.container.createGadget({specUrl: url,height:
metadata.modulePrefs.height, secureToken: metadata.secureToken, view: view});
+ gadget.metadata = metadata;
} else {
gadget = gadgets.container.createGadget({specUrl: url});
}
@@ -101,7 +101,7 @@
gadgetControl.style.display = "block";
var gadgetTitle = eXo.core.DOMUtil.findFirstDescendantByClass(gadgetControl,
"div", "GadgetTitle") ;
gadgetTitle.style.display = "block";
- if (metadata && metadata.title != null &&
metadata.title.length > 0) gadgetTitle.innerHTML = metadata.title;
+ if (metadata && metadata.modulePrefs.title != null &&
metadata.modulePrefs.title.length > 0) gadgetTitle.innerHTML =
metadata.modulePrefs.title;
}
if (inDesktop) {
Modified:
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/application/UIGadget.gtmpl
===================================================================
---
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/application/UIGadget.gtmpl 2011-08-13
07:49:09 UTC (rev 7069)
+++
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/application/UIGadget.gtmpl 2011-08-13
11:10:07 UTC (rev 7070)
@@ -17,13 +17,13 @@
def view = uicomponent.getView();
def userPref = null;
-
rcontext.getJavascriptManager().addCustomizedOnLoadScript("eXo.gadget.UIGadget.confirmDeleteGadget
= '" + _ctx.appRes("UIGadgetContainerManagement.confirm.DeleteGadget")
+ "';");
def isLossData = uicomponent.isLossData();
if(!isLossData) {
url = uicomponent.getUrl();
- metadata = uicomponent.getMetadata();
+ metadata = uicomponent.getRpcMetadata();
userPref = uicomponent.getUserPref();
jsmanager.importJavascript("eXo.gadget.UIGadget");
+
rcontext.getJavascriptManager().addCustomizedOnLoadScript("eXo.gadget.UIGadget.confirmDeleteGadget
= '" + _ctx.appRes("UIGadgetContainerManagement.confirm.DeleteGadget")
+ "';");
jsmanager.addCustomizedOnLoadScript("eXo.gadget.UIGadget.createGadget('$url','content-$id',
$metadata, $userPref, '$view', '$hostName', " + (isDev ? 1 : 0)
+ ", " + (isDebug ? 1 : 0) +
", " + (noCache ? 1 : 0) + ");");
}
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/GadgetUtil.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/GadgetUtil.java 2011-08-13
07:49:09 UTC (rev 7069)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/GadgetUtil.java 2011-08-13
11:10:07 UTC (rev 7070)
@@ -28,6 +28,7 @@
import org.exoplatform.portal.application.PortalRequestContext;
import org.exoplatform.portal.gadget.core.SecurityTokenGenerator;
import org.exoplatform.portal.webui.util.Util;
+import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
@@ -73,6 +74,7 @@
*
* @return the string represents metadata of gadget application
*/
+ @Deprecated
public static String fetchGagdetMetadata(String urlStr)
{
String result = null;
@@ -86,6 +88,7 @@
"{\"context\":{\"country\":\"" +
gadgetService.getCountry() + "\",\"language\":\""
+ gadgetService.getLanguage() +
"\"},\"gadgets\":[" + "{\"moduleId\":" +
gadgetService.getModuleId()
+ ",\"url\":\"" + urlStr +
"\",\"prefs\":[]}]}";
+
// Send data
String gadgetServer = getGadgetServerUrl();
URL url = new URL(gadgetServer + (gadgetServer.endsWith("/") ?
"" : "/") + "metadata");
@@ -106,6 +109,47 @@
return result;
}
+ /**
+ * Fetchs Metatada of gadget application, create the connection to shindig
+ * server to get the metadata TODO cache the informations for better
+ * performance
+ *
+ * @return the string represents metadata of gadget application
+ */
+ public static String fetchGagdetRpcMetadata(String urlStr)
+ {
+ String result = null;
+
+ ExoContainer container = ExoContainerContext.getCurrentContainer();
+ GadgetRegistryService gadgetService =
+
(GadgetRegistryService)container.getComponentInstanceOfType(GadgetRegistryService.class);
+ try
+ {
+ String data = "[{method:\"gadgets.metadata\",
id:\"test\", params: {ids:[\""
+ + urlStr + "\"], container:\"default\",
language:\""
+ + gadgetService.getLanguage() + "\", country:\"" +
gadgetService.getCountry() + "\", view:\"home\"}}]";
+
+ // Send data
+ String gadgetServer = getGadgetServerUrl();
+ URL url = new URL(gadgetServer + (gadgetServer.endsWith("/") ?
"" : "/") + "api/rpc");
+ URLConnection conn = url.openConnection();
+ conn.setRequestProperty("Content-Type",
"application/json");
+ conn.setDoOutput(true);
+ OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
+ wr.write(data);
+ wr.flush();
+ // Get the response
+ result = IOUtils.toString(conn.getInputStream(), "UTF-8");
+ wr.close();
+ }
+ catch (IOException ioexc)
+ {
+ ioexc.printStackTrace();
+ return "{}";
+ }
+ return result;
+ }
+
public static String createToken(String gadgetURL, Long moduleId)
{
SecurityTokenGenerator tokenGenerator =
@@ -125,9 +169,9 @@
static public Map<String, String> getMapMetadata(String url) throws
JSONException
{
Map<String, String> mapMetaData = new HashMap<String, String>();
- String metadata = fetchGagdetMetadata(url);
+ String metadata = fetchGagdetRpcMetadata(url);
metadata = metadata.substring(metadata.indexOf("[") + 1,
metadata.lastIndexOf("]"));
- JSONObject jsonObj = new JSONObject(metadata);
+ JSONObject jsonObj = new
JSONObject(metadata).getJSONObject(UIGadget.RPC_RESULT).getJSONObject(url).getJSONObject(UIGadget.METADATA_MODULEPREFS);
Iterator<String> iter = jsonObj.keys();
while (iter.hasNext())
{
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java 2011-08-13
07:49:09 UTC (rev 7069)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java 2011-08-13
11:10:07 UTC (rev 7070)
@@ -94,8 +94,12 @@
public static final String METADATA_USERPREFS = "userPrefs";
- public static final String METADATA_USERPREFS_TYPE = "type";
+ public static final String METADATA_MODULEPREFS = "modulePrefs";
+ public static final String RPC_RESULT = "result";
+
+ public static final String METADATA_USERPREFS_TYPE = "dataType";
+
public static final String METADATA_USERPREFS_TYPE_HIDDEN = "hidden";
public static final String METADATA_USERPREFS_TYPE_LIST = "list";
@@ -207,13 +211,14 @@
this.properties_ = properties;
}
+ @Deprecated
public String getMetadata()
{
try
{
if (metadata_ == null)
{
- String strMetadata = GadgetUtil.fetchGagdetMetadata(getUrl());
+ String strMetadata = GadgetUtil.fetchGagdetRpcMetadata(getUrl());
metadata_ = new JSONObject(strMetadata);
}
JSONObject obj = metadata_.getJSONArray(METADATA_GADGETS).getJSONObject(0);
@@ -226,6 +231,27 @@
return null;
}
}
+
+ public String getRpcMetadata()
+ {
+ try
+ {
+ if (metadata_ == null)
+ {
+ String gadgetUrl = getUrl();
+ String strMetadata = GadgetUtil.fetchGagdetRpcMetadata(gadgetUrl);
+ metadata_ = new
JSONArray(strMetadata).getJSONObject(0).getJSONObject(UIGadget.RPC_RESULT).getJSONObject(gadgetUrl);
+ }
+ String token = GadgetUtil.createToken(this.getUrl(), new Random().nextLong());
+ metadata_.put("secureToken", token);
+ return metadata_.toString();
+ }
+ catch (JSONException e)
+ {
+ return null;
+ }
+ }
+
/**
* Check if content of gadget has <UserPref>? (Content is parsed from gadget
specification in .xml file)
* @return boolean
@@ -236,8 +262,7 @@
{
if(metadata_ != null)
{
- JSONObject obj = metadata_.getJSONArray(METADATA_GADGETS).getJSONObject(0);
- JSONObject userPrefs = obj.getJSONObject(METADATA_USERPREFS);
+ JSONObject userPrefs = metadata_.getJSONObject(METADATA_USERPREFS);
JSONArray names = userPrefs.names();
int count = names.length();
if(count > 0)