Author: naftali.vanderloon at luminis.eu
Date: Mon Nov 1 11:58:51 2010
New Revision: 226
Log:
[AMDATU-133] completed shindig 2.0.0 integration
Removed:
trunk/platform-bundles/shindig-application/src/main/java/org/amdatu/platform/shindig/application/oauth/OAuthServlet.java
Modified:
trunk/application-bundles/dashboard-bundle/pom.xml
trunk/application-bundles/dashboard-bundle/src/main/java/org/amdatu/application/dashboard/service/DashboardService.java
trunk/application-bundles/dashboard-bundle/src/main/resources/jsp/dashboard.jsp
trunk/changelog.txt
trunk/platform-bundles/filebased-configuration/src/main/resources/conf/org.amdatu.platform.shindig.application.cfg
trunk/platform-bundles/loghandler/src/main/java/org/amdatu/platform/loghandler/service/ConsoleLogHandler.java
trunk/platform-bundles/sesame-application/pom.xml
trunk/platform-bundles/shindig-application/pom.xml
trunk/platform-bundles/shindig-application/src/main/java/org/amdatu/platform/shindig/application/module/SocialApiModuleImpl.java
trunk/platform-bundles/shindig-application/src/main/java/org/amdatu/platform/shindig/application/service/ShindigRegistrationServiceImpl.java
trunk/platform-bundles/shindig-application/src/main/resources/conf/container.js
trunk/pom/pom.xml
Modified: trunk/application-bundles/dashboard-bundle/pom.xml
==============================================================================
--- trunk/application-bundles/dashboard-bundle/pom.xml (original)
+++ trunk/application-bundles/dashboard-bundle/pom.xml Mon Nov 1 11:58:51 2010
@@ -30,6 +30,59 @@
<scope>provided</scope>
<type>bundle</type>
</dependency>
+
+ <!--
+ <dependency>
+ <groupId>tomcat</groupId>
+ <artifactId>jasper-compiler</artifactId>
+ <version>5.5.23</version>
+ <scope>compile</scope>
+ <type>bundle</type>
+ </dependency>
+ <dependency>
+ <groupId>tomcat</groupId>
+ <artifactId>jasper-runtime</artifactId>
+ <version>5.5.23</version>
+ <scope>compile</scope>
+ <type>bundle</type>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.16</version>
+ <scope>compile</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.jms</groupId>
+ <artifactId>jms</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.sun.jmx</groupId>
+ <artifactId>jmxri</artifactId>
+ </exclusion>
+
+ </exclusions>
+ </dependency>
+ -->
+ <!--
+ <dependency>
+ <groupId>org.eclipse.equinox.jsp</groupId>
+ <artifactId>jasper</artifactId>
+ <version>1.0.0-v20070607</version>
+ <scope>compile</scope>
+ <type>bundle</type>
+ </dependency>
+
+ <dependency>
+ <groupId>org.eclipse.equinox.jsp.jasper</groupId>
+ <artifactId>registry</artifactId>
+ <version>1.0.0-v20070607</version>
+ <scope>compile</scope>
+ <type>bundle</type>
+ </dependency>
+ -->
+
+
</dependencies>
<build>
@@ -40,7 +93,10 @@
<configuration>
<instructions>
<Bundle-Activator>org.amdatu.application.dashboard.osgi.Activator</Bundle-Activator>
- <Bundle-SymbolicName>
org.amdatu.application.dashboard</Bundle-SymbolicName>
+ <Bundle-SymbolicName>
org.amdatu.application.dashboard</Bundle-SymbolicName>
+ <Embed-Dependency>*;scope=compile</Embed-Dependency>
+ <Embed-Transitive>true</Embed-Transitive>
+
</instructions>
</configuration>
</plugin>
Modified:
trunk/application-bundles/dashboard-bundle/src/main/java/org/amdatu/application/dashboard/service/DashboardService.java
==============================================================================
---
trunk/application-bundles/dashboard-bundle/src/main/java/org/amdatu/application/dashboard/service/DashboardService.java
(original)
+++
trunk/application-bundles/dashboard-bundle/src/main/java/org/amdatu/application/dashboard/service/DashboardService.java
Mon Nov 1 11:58:51 2010
@@ -19,11 +19,15 @@
import static org.amdatu.application.dashboard.osgi.Activator.RESOURCE_ID;
import java.net.URL;
+import java.util.Dictionary;
+import java.util.Hashtable;
import org.amdatu.platform.httpcontext.HttpContextServiceFactory;
import org.amdatu.platform.httpcontext.ResourceProvider;
import org.apache.felix.dm.Component;
import org.osgi.framework.BundleContext;
+import org.osgi.service.http.HttpContext;
+import org.osgi.service.http.HttpService;
import org.osgi.service.log.LogService;
/**
@@ -38,17 +42,34 @@
private volatile LogService m_logService;
private volatile HttpContextServiceFactory m_httpContextFactoryService;
+ private volatile HttpService m_httpService;
+
private Component m_httpContextComponent;
-
+ private HttpContext m_httpContext;
+
/**
* The init() method is invoked by the Felix dependency manager.
*/
public void init() {
// Create our own http context and register resources
m_httpContextComponent =
m_httpContextFactoryService.create(m_bundleContext, this);
-
+ m_httpContext = (HttpContext) m_httpContextComponent.getService();
+ Dictionary<String, String> initParams = new Hashtable<String,
String>();
+
+ /*JspServletWrapper servlet = new JspServletWrapper(m_bundleContext);
+ try {
+ m_httpService.registerServlet("/jsp", servlet,
initParams, m_httpContext);
+ } catch (ServletException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (NamespaceException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }*/
m_logService.log(LogService.LOG_INFO, getClass().getName() + " service
initialized");
}
+
+
/**
* The idestroynit() method is invoked by the Felix dependency manager.
Modified:
trunk/application-bundles/dashboard-bundle/src/main/resources/jsp/dashboard.jsp
==============================================================================
---
trunk/application-bundles/dashboard-bundle/src/main/resources/jsp/dashboard.jsp
(original)
+++
trunk/application-bundles/dashboard-bundle/src/main/resources/jsp/dashboard.jsp
Mon Nov 1 11:58:51 2010
@@ -17,13 +17,10 @@
<script type="text/javascript"
src="/dashboard/static/js/lib/jquery.dashboard.js"></script>
<script type="text/javascript"
src="/dashboard/static/js/lib/themeroller.js"></script>
- <script type="text/javascript"
src="/gadgets/js/rpc.js?c=1&debug=1"></script>
- <script type="text/javascript" src="/gadgets/container/cookies.js"></script>
- <script type="text/javascript" src="/gadgets/container/util.js"></script>
-
- <script type="text/javascript" src="/shindig/js/gadgets.js"></script>
- <script type="text/javascript"
src="/gadgets/container/cookiebaseduserprefstore.js"></script>
-
+ <script type="text/javascript"
src="/gadgets/js/shindig-container:rpc.js?c=1&debug=1&nocache=1"></script>
+ <script type="text/javascript"
src="/gadgets/js/shindig-container:util.js"></script>
+ <script type="text/javascript"
src="/gadgets/js/shindig-container:cookies.js"></script>
+
<script type="text/javascript">
$(function() {
$("body").append('<div id="templates" style="display:none">')
Modified: trunk/changelog.txt
==============================================================================
--- trunk/changelog.txt (original)
+++ trunk/changelog.txt Mon Nov 1 11:58:51 2010
@@ -86,9 +86,12 @@
* [AMDATU-51] - Root pom.xml defines far too many dependencies with scope
provided
* [AMDATU-52] - Install without clean throws runtime exception
* [AMDATU-53] - Dashboard not always accessible (404)
+ * [AMDATU-122] - Maven has jre target 1.5 but the code isn't 1.5 compliant
+ * [AMDATU-127] - "Unable to load version.properties" exception is thrown
upon startup
** Improvement
* [AMDATU-45] - Apache Wink bundle not using OSGi aggregate jar
+ * [AMDATU-110] - Upgrade to Cassandra 0.7
** Task
* [AMDATU-5] - Add TemplateConfigManager service for replacing config
entries in static config files
Modified:
trunk/platform-bundles/filebased-configuration/src/main/resources/conf/org.amdatu.platform.shindig.application.cfg
==============================================================================
---
trunk/platform-bundles/filebased-configuration/src/main/resources/conf/org.amdatu.platform.shindig.application.cfg
(original)
+++
trunk/platform-bundles/filebased-configuration/src/main/resources/conf/org.amdatu.platform.shindig.application.cfg
Mon Nov 1 11:58:51 2010
@@ -28,9 +28,6 @@
# The URL base to use for full OAuth support (three-legged)
shindig.oauth.base-url=/oauth/
shindig.oauth.authorize-action=/dashboard/authorize.jsp
-shindig.oauth.legacy-body-signing=true
-shindig.oauth.enable-oauth-1.0=true
-shindig.oauth.enable-signed-callbacks=true
### Outbound OAuth support
shindig.signing.state-key=
@@ -51,17 +48,22 @@
shindig.content-rewrite.only-allow-excludes=false
shindig.content-rewrite.include-urls=.*
shindig.content-rewrite.exclude-urls=
-shindig.content-rewrite.include-tags=link,script,embed,img,style
+shindig.content-rewrite.include-tags=body,embed,img,input,link,script,style
shindig.content-rewrite.expires=86400
-shindig.content-rewrite.proxy-url=/gadgets/proxy?url=
-shindig.content-rewrite.concat-url=/gadgets/concat?
+shindig.content-rewrite.proxy-url=/gadgets/proxy?container=default&url=
+shindig.content-rewrite.concat-url=/gadgets/concat?container=default&
+shindig.content-rewrite.enable-split-js-concat=true
#
# Default set of forced libs to allow for better caching
#
# NOTE: setting this causes the EndToEnd test to fail the opensocial-templates
test
-#shindig.gadget-rewrite.default-forced-libs=core:core.io
-shindig.gadget-rewrite.default-forced-libs=
+shindig.gadget-rewrite.default-forced-libs=core:rpc
+#shindig.gadget-rewrite.default-forced-libs=
+
+#
+# Allow supported JavaScript features required by a gadget to be externalized
on demand
+shindig.gadget-rewrite.externalize-feature-libs=false
# Configuration for image rewriter
shindig.image-rewrite.max-inmem-bytes = 1048576
@@ -114,8 +116,37 @@
# Maximum size, in bytes, of the object we fetched, 0 == no limit
shindig.http.client.max-object-size-bytes=0
-# true to force strict content type checking for requests made to API
endpoints.
-# E.g. require application/json for JSON-RPC
-shindig.api.disallow-unknown-content-types=true
+# Strict-mode parsing for proxy and concat URIs ensures that the
authority/host and path
+# for the URIs match precisely what is found in the container config for it.
This is
+# useful where statistics and traffic routing patterns, typically in large
installations,
+# key on hostname (and occasionally path). Enforcing this does come at the
cost that
+# mismatches break, which in turn mandates that URI generation always happen
in consistent
+# fashion, ie. by the class itself or tightly controlled code.
+shindig.uri.proxy.use-strict-parsing=false
+shindig.uri.concat.use-strict-parsing=false
+
+# Host:port of the proxy to use while fetching urls. Leave blank if proxy is
+# not to be used.
+org.apache.shindig.gadgets.http.basicHttpFetcherProxy=
+
+org.apache.shindig.serviceExpirationDurationMinutes=60
+
+#
+# Older versions of shindig used 'data' in the json-rpc response format
+# The spec calls for using 'result' instead, however to avoid breakage we
+# allow you to set it back to the old way here
+#
+# valid values are
+# result - new form
+# data - old broken form
+# both - return both fields for full compatibility
+#
+shindig.json-rpc.result-field=result
+
+# Remap "Internal server error"s received from the basicHttpFetcherProxy
server to
+# "Bad Gateway error"s, so that it is clear to the user that the proxy server
is
+# the one that threw the exception.
+shindig.accelerate.remapInternalServerError=true
-socialsite.http.session.timeout=3600
\ No newline at end of file
+shindig.host=${server.hostname}
+shindig.port=${server.port}
\ No newline at end of file
Modified:
trunk/platform-bundles/loghandler/src/main/java/org/amdatu/platform/loghandler/service/ConsoleLogHandler.java
==============================================================================
---
trunk/platform-bundles/loghandler/src/main/java/org/amdatu/platform/loghandler/service/ConsoleLogHandler.java
(original)
+++
trunk/platform-bundles/loghandler/src/main/java/org/amdatu/platform/loghandler/service/ConsoleLogHandler.java
Mon Nov 1 11:58:51 2010
@@ -32,7 +32,7 @@
* @author ivol
*/
public class ConsoleLogHandler implements LogListener, ManagedService {
- private static int DEFAULT_LOG_LEVEL = LogService.LOG_INFO;
+ private static int DEFAULT_LOG_LEVEL = LogService.LOG_DEBUG;
private int m_minLogLevel = DEFAULT_LOG_LEVEL;
private static final Map<Integer, String> LOG_LEVELS;
Modified: trunk/platform-bundles/sesame-application/pom.xml
==============================================================================
--- trunk/platform-bundles/sesame-application/pom.xml (original)
+++ trunk/platform-bundles/sesame-application/pom.xml Mon Nov 1 11:58:51 2010
@@ -25,7 +25,7 @@
<artifactId>slf4j-jdk14</artifactId>
<version>1.5.11</version>
<scope>compile</scope>
- </dependency>
+ </dependency>
<dependency>
<groupId>org.amdatu.platform</groupId>
<artifactId>httpcontext</artifactId>
Modified: trunk/platform-bundles/shindig-application/pom.xml
==============================================================================
--- trunk/platform-bundles/shindig-application/pom.xml (original)
+++ trunk/platform-bundles/shindig-application/pom.xml Mon Nov 1 11:58:51 2010
@@ -19,23 +19,86 @@
<groupId>org.apache.shindig</groupId>
<artifactId>shindig-common</artifactId>
<version>${shindig.version}</version>
+ <scope>compile</scope>
+ <exclusions>
+ <!-- force use of xml-apis until caja fixes their pom -->
+ <exclusion>
+ <groupId>xerces</groupId>
+ <artifactId>xmlParserAPIs</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.apache.shindig</groupId>
<artifactId>shindig-gadgets</artifactId>
<version>${shindig.version}</version>
+ <scope>compile</scope>
+ <exclusions>
+ <!-- force use of xml-apis until caja fixes their pom -->
+ <exclusion>
+ <groupId>xerces</groupId>
+ <artifactId>xmlParserAPIs</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.apache.shindig</groupId>
<artifactId>shindig-social-api</artifactId>
<version>${shindig.version}</version>
+ <scope>compile</scope>
+ <exclusions>
+ <!-- force use of xml-apis until caja fixes their pom -->
+ <exclusion>
+ <groupId>xerces</groupId>
+ <artifactId>xmlParserAPIs</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.apache.shindig</groupId>
<artifactId>shindig-features</artifactId>
<version>${shindig.version}</version>
+ <scope>compile</scope>
+ <exclusions>
+ <!-- force use of xml-apis until caja fixes their pom -->
+ <exclusion>
+ <groupId>xerces</groupId>
+ <artifactId>xmlParserAPIs</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.shindig</groupId>
+ <artifactId>shindig-extras</artifactId>
+ <version>${shindig.version}</version>
+ <scope>compile</scope>
+ <exclusions>
+ <!-- force use of xml-apis until caja fixes their pom -->
+ <exclusion>
+ <groupId>xerces</groupId>
+ <artifactId>xmlParserAPIs</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.5.6</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-jdk14</artifactId>
+ <version>1.5.6</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.1.1</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
@@ -100,55 +163,8 @@
<instructions>
<Bundle-Activator>org.amdatu.platform.shindig.application.osgi.Activator</Bundle-Activator>
<Bundle-SymbolicName>org.amdatu.platform.shindig-application</Bundle-SymbolicName>
-
<Embed-Dependency>*;scope=compile;artifactId=amdatu-utilities</Embed-Dependency>
- <Include-Resource>
- {maven-resources},
- lib=src/main/resources/lib
- </Include-Resource>
- <Bundle-ClassPath>
- .,
- lib/aopalliance-1.0.jar,
- lib/caja-r3828.jar,
- lib/commons-beanutils-1.7.0.jar,
- lib/commons-beanutils-core-1.7.0.jar,
- lib/commons-betwixt-0.8.jar,
- lib/commons-codec-1.3.jar,
- lib/commons-collections-2.0.jar,
- lib/commons-digester-1.7.jar,
- lib/commons-fileupload-1.2.jar,
- lib/commons-httpclient-3.1.jar,
- lib/commons-io-1.4.jar,
- lib/commons-lang-2.4.jar,
- lib/com.springsource.org.apache.commons.logging-1.1.1.jar,
- lib/ehcache-1.6.2.jar,
- lib/geronimo-stax-api_1.0_spec-1.0.1.jar,
- lib/google-collections-1.0-rc2.jar,
- lib/guice-2.0.jar,
- lib/htmlparser-1.0.7.jar,
- lib/icu4j-3.8.jar,
- lib/jdom-1.0.jar,
- lib/joda-time-1.6.jar,
- lib/json-20070829.jar,
- lib/json-simple-1.1.jar,
- lib/juel-api-2.1.2.jar,
- lib/juel-impl-2.1.2.jar,
- lib/nekohtml-1.9.13.jar,
- lib/oauth-20090531.jar,
- lib/oauth-consumer-20090531.jar,
- lib/oauth-httpclient3-20090531.jar,
- lib/oauth-provider-20090531.jar,
- lib/peaberry-1.1.1.jar,
- lib/rome-1.0.jar,
- lib/sanselan-0.97-incubator.jar,
- lib/shindig-common-1.1-BETA5-incubating.jar,
- lib/shindig-gadgets-1.1-BETA5-incubating.jar,
- lib/shindig-social-api-1.1-BETA5-incubating.jar,
- lib/shindig-features-1.1-BETA5-incubating.jar,
- lib/xercesImpl-2.9.1.jar,
-
- lib/xpp3_min-1.1.4c.jar,
- lib/xstream-1.3.1.jar
- </Bundle-ClassPath>
+ <Embed-Dependency>*;scope=compile</Embed-Dependency>
+ <Embed-Transitive>true</Embed-Transitive>
<Import-Package>
*;resolution:=optional
</Import-Package>
Modified:
trunk/platform-bundles/shindig-application/src/main/java/org/amdatu/platform/shindig/application/module/SocialApiModuleImpl.java
==============================================================================
---
trunk/platform-bundles/shindig-application/src/main/java/org/amdatu/platform/shindig/application/module/SocialApiModuleImpl.java
(original)
+++
trunk/platform-bundles/shindig-application/src/main/java/org/amdatu/platform/shindig/application/module/SocialApiModuleImpl.java
Mon Nov 1 11:58:51 2010
@@ -19,10 +19,6 @@
import java.util.List;
import java.util.Set;
-import com.google.inject.AbstractModule;
-import com.google.inject.TypeLiteral;
-import com.google.inject.internal.ImmutableSet;
-import com.google.inject.name.Names;
import org.amdatu.platform.shindig.application.SocialApiModule;
import org.amdatu.platform.shindig.application.service.PersonServiceDispatcher;
import org.apache.shindig.auth.AnonymousAuthenticationHandler;
@@ -45,11 +41,15 @@
import org.apache.shindig.social.opensocial.spi.AppDataService;
import org.apache.shindig.social.opensocial.spi.MessageService;
import org.apache.shindig.social.opensocial.spi.PersonService;
-import org.apache.shindig.social.sample.service.SampleContainerHandler;
import org.apache.shindig.social.sample.spi.JsonDbOpensocialService;
import org.osgi.framework.BundleContext;
import org.osgi.service.log.LogService;
+import com.google.inject.AbstractModule;
+import com.google.inject.TypeLiteral;
+import com.google.inject.internal.ImmutableSet;
+import com.google.inject.name.Names;
+
/**
* This module binds the Social Api services.
* @author ivol
@@ -108,7 +108,7 @@
ImmutableSet.Builder<Object> handlers = ImmutableSet.builder();
handlers.addAll(ImmutableSet.<Object>of(ActivityHandler.class,
AppDataHandler.class,
PersonHandler.class, MessageHandler.class));
- handlers.add(SampleContainerHandler.class);
+ /// NOT necessary??? handlers.add(SampleContainerHandler.class);
return handlers.build();
}
}
Modified:
trunk/platform-bundles/shindig-application/src/main/java/org/amdatu/platform/shindig/application/service/ShindigRegistrationServiceImpl.java
==============================================================================
---
trunk/platform-bundles/shindig-application/src/main/java/org/amdatu/platform/shindig/application/service/ShindigRegistrationServiceImpl.java
(original)
+++
trunk/platform-bundles/shindig-application/src/main/java/org/amdatu/platform/shindig/application/service/ShindigRegistrationServiceImpl.java
Mon Nov 1 11:58:51 2010
@@ -18,10 +18,6 @@
import static
org.amdatu.platform.shindig.application.osgi.Activator.RESOURCE_ID;
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
@@ -31,21 +27,29 @@
import java.util.List;
import java.util.Properties;
-import com.google.inject.Guice;
-import com.google.inject.Injector;
-import com.google.inject.Module;
-import com.google.inject.Stage;
-import com.google.inject.tools.jmx.Manager;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+
+import net.oauth.server.OAuthServlet;
+
import org.amdatu.platform.httpcontext.HttpContextServiceFactory;
import org.amdatu.platform.httpcontext.ResourceProvider;
import org.amdatu.platform.shindig.application.OAuthModule;
import org.amdatu.platform.shindig.application.SocialApiModule;
import
org.amdatu.platform.shindig.application.module.ConfigurationAdminGuiceModule;
-import org.amdatu.platform.shindig.application.oauth.OAuthServlet;
+import org.amdatu.platform.shindig.application.oauth.AmdatuOAuthServlet;
import org.apache.felix.dm.Component;
import org.apache.shindig.auth.AuthenticationServletFilter;
import org.apache.shindig.common.servlet.GuiceServletContextListener;
-import org.apache.shindig.gadgets.servlet.*;
+import org.apache.shindig.gadgets.servlet.ConcatProxyServlet;
+import org.apache.shindig.gadgets.servlet.GadgetRenderingServlet;
+import org.apache.shindig.gadgets.servlet.JsServlet;
+import org.apache.shindig.gadgets.servlet.MakeRequestServlet;
+import org.apache.shindig.gadgets.servlet.OAuthCallbackServlet;
+import org.apache.shindig.gadgets.servlet.ProxyServlet;
+import org.apache.shindig.gadgets.servlet.RpcServlet;
import org.apache.shindig.protocol.DataServiceServlet;
import org.apache.shindig.protocol.JsonRpcServlet;
import org.ops4j.pax.web.service.WebContainer;
@@ -55,6 +59,12 @@
import org.osgi.service.http.NamespaceException;
import org.osgi.service.log.LogService;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+import com.google.inject.Module;
+import com.google.inject.Stage;
+import com.google.inject.tools.jmx.Manager;
+
/**
* This service is responsible for registration and unregistration of Shindig
servlets, filters and static
* resources.
@@ -73,10 +83,9 @@
private static final String GADGET_SERVLET_BASE = GADGETS_BASE + "/ifr";
private static final String PROXY_BASE = GADGETS_BASE + "/proxy";
private static final String MAKEREQUEST_BASE = GADGETS_BASE +
"/makeRequest";
- private static final String GADGETS_RPC_BASE = GADGETS_BASE + "/api/rpc";
+ private static final String GADGETS_RPC_BASE = "/rpc";
private static final String GADGETS_REST_BASE = GADGETS_BASE + "/api/rest";
private static final String REST_BASE = "/social/rest";
- private static final String JSON_RPC_BASE = "/social/rpc";
private static final String CONCAT_BASE = GADGETS_BASE + "/concat";
private static final String JS_BASE = GADGETS_BASE + "/js";
private static final String METADATA_BASE = GADGETS_BASE + "/metadata";
@@ -233,10 +242,9 @@
addServlet(m_httpContext, METADATA_BASE, new RpcServlet());
addServlet(m_httpContext, JS_BASE, new JsServlet());
addServlet(m_httpContext, REST_BASE, new DataServiceServlet(),
params);
- addServlet(m_httpContext, JSON_RPC_BASE, new JsonRpcServlet(),
params);
addServlet(m_httpContext, GADGETS_REST_BASE, new
DataServiceServlet(), params);
addServlet(m_httpContext, GADGETS_RPC_BASE, new JsonRpcServlet(),
params);
- addServlet(m_httpContext, OAUTH_BASE, new OAuthServlet(), params);
+ addServlet(m_httpContext, OAUTH_BASE, new AmdatuOAuthServlet(),
params);
addServlet(m_httpContext, ECHO_BASE, new EchoServlet(), params);
// Register filters
@@ -245,7 +253,6 @@
GADGET_SERVLET_BASE,
MAKEREQUEST_BASE,
REST_BASE + "/*",
- JSON_RPC_BASE + "/*",
GADGETS_REST_BASE + "/*",
WINK_REST_BASE + "/*",
GADGETS_RPC_BASE + "/*"}, null, null, m_httpContext);
@@ -348,9 +355,11 @@
}
private String[] getGuiceModules() {
- return new String[]{
- "org.apache.shindig.gadgets.DefaultGuiceModule",
- "org.apache.shindig.common.cache.ehcache.EhCacheModule"};
+ return new String[] {
+ "org.apache.shindig.gadgets.DefaultGuiceModule",
+ "org.apache.shindig.extras.ShindigExtrasGuiceModule",
+ "org.apache.shindig.common.cache.ehcache.EhCacheModule"
+ };
}
/**
Modified:
trunk/platform-bundles/shindig-application/src/main/resources/conf/container.js
==============================================================================
---
trunk/platform-bundles/shindig-application/src/main/resources/conf/container.js
(original)
+++
trunk/platform-bundles/shindig-application/src/main/resources/conf/container.js
Mon Nov 1 11:58:51 2010
@@ -24,9 +24,9 @@
//
// B. If you run the PHP server: Create a myContainer.js, copy the contents
of container.js to it,
// change
-// {"gadgets.container" : ["default"],
+// {"gadgets.container" : ["default"],
// to
-// ?{"gadgets.container" : ["myContainer"],
+// ?{"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.
@@ -44,7 +44,8 @@
// 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.
+{"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
@@ -59,33 +60,71 @@
// 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" : "/gadgets/ifr",
+"gadgets.uri.iframe.basePath" : "/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%/gadgets/js/%js%",
+//New configuration for iframeUri generation:
+"gadgets.uri.iframe.lockedDomainSuffix" : "-a.example.com:8080",
+"gadgets.uri.iframe.unlockedDomain" : "www.example.com:8080",
+"gadgets.uri.iframe.basePath" : "/gadgets/ifr",
+
+"gadgets.uri.js.host" : "http://www.example.com/",
+"gadgets.uri.js.path" : "/gadgets/js",
+
+
// Callback URL. Scheme relative URL for easy switch between https/http.
-"gadgets.oauthGadgetCallbackTemplate" : "//%host%/gadgets/oauthcallback",
+"gadgets.uri.oauth.callbackTemplate" : "//%host%/gadgets/oauthcallback",
// Use an insecure security token by default
-// "gadgets.securityTokenType" : "secure",
+//"gadgets.securityTokenType" : "insecure",
// 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",
+"gadgets.osDataUri" : "http://%host%/rpc",
-// Uncomment these to switch to a secure version
+// Uncomment these to switch to a secure version
+//
"gadgets.securityTokenType" : "secure",
"gadgets.securityTokenKeyFile" : "conf/securitytokenkey.txt",
+// URI for the default shindig test instance.
+"defaultShindigTestHost": "http://${SERVER_HOST}:${SERVER_PORT}",
+
+// Authority (host:port without scheme) for the proxy and concat servlets.
+"defaultShindigProxyConcatAuthority": "${SERVER_HOST}:${SERVER_PORT}",
+
+// Default Uri config: these must be overridden - specified here for testing
purposes
+"gadgets.uri.iframe.unlockedDomain": "${Cur['defaultShindigTestHost']}",
+"gadgets.uri.iframe.lockedDomainSuffix": "${Cur['defaultShindigTestHost']}",
+
+// Default Js Uri config: also must be overridden.
+"gadgets.uri.js.host": "${Cur['defaultShindigTestHost']}",
+"gadgets.uri.js.path": "/gadgets/js",
+
+// Default concat Uri config; used for testing.
+"gadgets.uri.concat.host" : "${Cur['defaultShindigProxyConcatAuthority']}",
+"gadgets.uri.concat.path" : "/gadgets/concat",
+"gadgets.uri.concat.js.splitToken" : "false",
+
+// Default proxy Uri config; used for testing.
+"gadgets.uri.proxy.host" : "${Cur['defaultShindigProxyConcatAuthority']}",
+"gadgets.uri.proxy.path" : "/gadgets/proxy",
+
// This config data will be passed down to javascript. Please
// configure your object using the feature name rather than
// the javascript name.
@@ -95,8 +134,9 @@
"gadgets.features" : {
"core.io" : {
// Note: /proxy is an open proxy. Be careful how you expose this!
- "proxyUrl" :
"http://%host%/gadgets/proxy?refresh=%refresh%&url=%url%%rewriteMime%",
- "jsonProxyUrl" : "http://%host%/gadgets/makeRequest"
+ // Note: Here // is replaced with the current protocol http/https
+ "proxyUrl" :
"//%host%/gadgets/proxy?container=default&refresh=%refresh%&url=%url%%rewriteMime%",
+ "jsonProxyUrl" : "//%host%/gadgets/makeRequest"
},
"views" : {
"profile" : {
@@ -110,12 +150,80 @@
"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.
+ // 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" : "/gadgets/files/container/rpc_relay.html",
+ "parentRelayUrl" : "/container/rpc_relay.html",
// If true, this will use the legacy ifpc wire format when making rpc
// requests.
@@ -135,21 +243,27 @@
"opensocial" : {
// Path to fetch opensocial data from
// Must be on the same domain as the gadget rendering server
- "path" : "http://%host%/social/rpc",
+ "path" : "http://%host%/rpc",
// Path to issue invalidate calls
- "invalidatePath" : "http://%host%/gadgets/api/rpc",
+ "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"],
+ "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"]
@@ -157,7 +271,7 @@
},
"osapi" : {
// The endpoints to query for available JSONRPC/REST services
- "endPoints" : [ "http://%host%/social/rpc",
"http://%host%/gadgets/api/rpc" ]
+ "endPoints" : [ "http://%host%/rpc" ]
},
"osml": {
// OSML library resource. Can be set to null or the empty string to
disable OSML
Modified: trunk/pom/pom.xml
==============================================================================
--- trunk/pom/pom.xml (original)
+++ trunk/pom/pom.xml Mon Nov 1 11:58:51 2010
@@ -70,7 +70,7 @@
<!--
Version numbers of platform bundles
-->
- <shindig.version>1.1-BETA5-incubating</shindig.version>
+ <shindig.version>2.0.0</shindig.version>
<cassandra.version>0.7.0-beta2</cassandra.version>
<openrdf.version>2.3.1</openrdf.version>
</properties>