Hi! I update the new sample-maven-archetype (see SHINDIG-1482) to use the common container instead of the obsolete simple container, as suggested by Ryan.
The archetype is not perfect now and could need some more documentation in the JavaScript file, but at least it now uses the recent common container. And I think it's a good starting point for integrating shindig in your own webapp. Please have a look at the patch before committing, as I'm still a shindig beginner and it's very likely that I made some mistakes. regards, - martin
Index: src/main/resources/META-INF/maven/archetype-metadata.xml =================================================================== --- src/main/resources/META-INF/maven/archetype-metadata.xml (revision 1411344) +++ src/main/resources/META-INF/maven/archetype-metadata.xml (working copy) @@ -26,8 +26,15 @@ <includes> <include>**/*.html</include> <include>**/*.xml</include> + <include>**/*.js</include> </includes> </fileSet> + <fileSet filtered="false" encoding="UTF-8"> + <directory>src/main/java</directory> + <includes> + <include>**/*.java</include> + </includes> + </fileSet> <fileSet filtered="true" encoding="UTF-8"> <directory>src/main/resources</directory> <includes> Index: src/main/resources/archetype-resources/src/main/webapp/my-container.js =================================================================== --- src/main/resources/archetype-resources/src/main/webapp/my-container.js (revision 0) +++ src/main/resources/archetype-resources/src/main/webapp/my-container.js (revision 0) @@ -0,0 +1,174 @@ +// This container lays out and renders gadgets itself. + +// ID used to associate gadget site +var curId = 0; + +var specUrl0 = 'http://localhost:8080/myFirstGadget.xml'; +var specUrl1 = 'http://www.labpixies.com/campaigns/todo/todo.xml'; + +// url base should be <host>:<port>//<contextRoot> +var urlBase = location.href.substr(0, location.href.lastIndexOf('/')); +var contextRoot = urlBase.substr(urlBase.indexOf(location.host) + location.host.length); +var testConfig = testConfig || {}; +testConfig[osapi.container.ServiceConfig.API_PATH] = contextRoot + '/rpc'; +testConfig[osapi.container.ContainerConfig.RENDER_DEBUG] = '1'; + +// Default the security token for the container. Using this example security token requires enabling +// the DefaultSecurityTokenCodec to let UrlParameterAuthenticationHandler create valid security token. +// 10 seconds is fast, but this is mostly for demonstration purposes. +testConfig[osapi.container.ContainerConfig.GET_CONTAINER_TOKEN] = function(callback) { + log('Updating container security token.'); + callback('john.doe:john.doe:appid:cont:url:0:default', 10); +}; + +// Create the new CommonContainer +var CommonContainer = new osapi.container.Container(testConfig); + + +{ + //Gadget site to title id map + var siteToTitleMap = {}; + + // Need to pull these from values supplied in the dialog + CommonContainer.init = function() { + + CommonContainer.addGadgetLifecycleCallback('com.example.commoncontainer', lifecycle()); + addGadgets([ specUrl0, specUrl1 ]); + }; + + //Wrapper function to set the gadget site/id and default width. Currently have some inconsistency with width actually being set. This + //seems to be related to the pubsub2 feature. + CommonContainer.renderGadget = function(gadgetURL, gadgetId) { + //going to hardcode these values for width. + var el = document.getElementById('gadget-site-' + gadgetId); + var params = {}; + params[osapi.container.RenderParam.WIDTH] = '400px'; + params[osapi.container.RenderParam.USER_PREFS] = {'someSetting' : 'bar' }; + var gadgetSite = CommonContainer.newGadgetSite(el); + CommonContainer.navigateGadget(gadgetSite, gadgetURL, {}, params); + return gadgetSite; + }; + + //TODO: Add in UI controls in portlet header to remove gadget from the canvas + CommonContainer.collapseGadget = function(gadgetSite) { + CommonContainer.closeGadget(gadgetSite); + }; + + function log(message) { + document.getElementById('output').innerHTML = gadgets.util.escapeString(message) + '<br/>' + document.getElementById('output').innerHTML; + } + + var lifecycle = function() { + var preloadStart; + var navigateStart; + var closeStart; + var unloadStart; + var renderStart; + var listeners = {}; + listeners[osapi.container.CallbackType.ON_BEFORE_PRELOAD] = function(gadgetUrls) { + preloadStart = osapi.container.util.getCurrentTimeMs(); + }; + listeners[osapi.container.CallbackType.ON_PRELOADED] = function(response) { + log('onPreload'); + var urls = []; + for(url in response) { + urls[urls.length] = url; + } + var dif = osapi.container.util.getCurrentTimeMs() - preloadStart; + log('It took ' + dif + 'ms to preload the URL(s) ' + urls + '.'); + }; + listeners[osapi.container.CallbackType.ON_BEFORE_NAVIGATE] = function(gadgetUrl) { + log('beforeNavigate'); + navigateStart = osapi.container.util.getCurrentTimeMs(); + }; + listeners[osapi.container.CallbackType.ON_NAVIGATED] = function(site) { + log('beforeNavigate'); + log('It took ' + (osapi.container.util.getCurrentTimeMs() - navigateStart) + ' ms' + + ' for the site ' + site.getId() + ' to navigate.'); + }; + listeners[osapi.container.CallbackType.ON_BEFORE_CLOSE] = function(site) { + log('beforeClos'); + closeStart = osapi.container.util.getCurrentTimeMs(); + }; + listeners[osapi.container.CallbackType.ON_CLOSED] = function(site) { + log('closed'); + log('It took ' + (osapi.container.util.getCurrentTimeMs() - closeStart) + + ' ms to close the gadget in the site with id ' + site.getId()); + }; + listeners[osapi.container.CallbackType.ON_BEFORE_RENDER] = function(gadgetUrl) { + log('beforeRender'); + renderStart = osapi.container.util.getCurrentTimeMs(); + }; + listeners[osapi.container.CallbackType.ON_RENDER] = function(gadgetUrl) { + log('It took ' + (osapi.container.util.getCurrentTimeMs() - renderStart) + + ' ms to render the gadget at the URL ' + gadgetUrl); + }; + return listeners; + } + + + window.getNewGadgetElement = function(result, gadgetURL){ + log('enter window.getNewGadgetElement'); + result[gadgetURL] = result[gadgetURL] || {}; + var gadgetSiteString = "$(this).closest(\'.portlet\').find(\'.portlet-content\').data(\'gadgetSite\')"; + var viewItems = ''; + var gadgetViews = result[gadgetURL].views || {}; + for (var aView in gadgetViews) { + viewItems = viewItems + '<li><a href="#" onclick="navigateView(' + gadgetSiteString + ',' + '\'' + gadgetURL + '\'' + ',' + '\'' + aView + '\'' + '); return false;">' + aView + '</a></li>'; + } + // Base html template that is used for the gadget wrapper and site + var gadgetTemplate = '<div class="portlet">' + + '<div class="portlet-header">sample to replace</div>' + + '<div id="gadget-site" class="portlet-content"></div>' + + '</div>'; + + var newGadgetSite = gadgetTemplate; + newGadgetSite = newGadgetSite.replace(/(gadget-site)/g, '$1-' + curId); + siteToTitleMap['gadget-site-' + curId] = 'gadget-title-' + curId; + var gadgetTitle = (result[gadgetURL] && result[gadgetURL]['modulePrefs'] && result[gadgetURL]['modulePrefs'].title) || 'Title not set'; + $(newGadgetSite).appendTo($('#gadgetArea')).addClass('ui-widget ui-widget-content ui-helper-clearfix ui-corner-all') + .find('.portlet-header') + .addClass('ui-widget-header ui-corner-all') + .text('') + .append('<span id="gadget-title-' + curId + '">' + gadgetTitle + '</span>'); + + var rv = $('#gadget-site-' + curId).get([0]); + log('leave window.getNewGadgetElement with return-value of ' + rv); + return rv; + } + + + //create a gadget with navigation tool bar header enabling gadget collapse, expand, remove, navigate to view actions. + window.buildGadget = function(result,gadgetURL){ + log('enter window.buildGadget'); + result = result || {}; + var element = window.getNewGadgetElement(result, gadgetURL); + $(element).data('gadgetSite', CommonContainer.renderGadget(gadgetURL, curId)); + + //determine which button was click and handle the appropriate event. + $('.portlet-header .ui-icon').click(function() { + handleNavigateAction($(this).closest('.portlet'), $(this).closest('.portlet').find('.portlet-content').data('gadgetSite'), gadgetURL, this.id); + }); + log('leave window.buildGadget'); + }; + + + // Load the collection of gadgets and render them in the gadget test area + addGadgets = function(gadgetUrls) { + log('enter addGadgets'); + + CommonContainer.preloadGadgets(gadgetUrls, function(result) { + for (var gadgetURL in result) { + if(!result[gadgetURL].error) { + window.buildGadget(result, gadgetURL); + curId++; + } + else { + log('Error on preloading gadget: ' + result[gadgetURL].error.message); + } + } + + }); + return true; + }; +} Index: src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml =================================================================== --- src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml (revision 1411344) +++ src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml (working copy) @@ -26,12 +26,14 @@ <param-value> org.apache.shindig.common.PropertiesModule: org.apache.shindig.gadgets.DefaultGuiceModule: + org.apache.shindig.gadgets.servlet.AuthenticationModule: org.apache.shindig.gadgets.oauth.OAuthModule: org.apache.shindig.gadgets.oauth2.OAuth2Module: org.apache.shindig.gadgets.oauth2.OAuth2MessageModule: org.apache.shindig.gadgets.oauth2.handler.OAuth2HandlerModule: org.apache.shindig.gadgets.oauth2.persistence.sample.OAuth2PersistenceModule: - org.apache.shindig.gadgets.admin.GadgetAdminModule + org.apache.shindig.gadgets.admin.GadgetAdminModule: + org.apache.shindig.common.MyPropertiesModule </param-value> </context-param> @@ -45,7 +47,34 @@ </param-value> </context-param> --> + + <filter> + <filter-name>authFilter</filter-name> + <filter-class>org.apache.shindig.auth.AuthenticationServletFilter</filter-class> + </filter> + <filter> + <filter-name>etagFilter</filter-name> + <filter-class>org.apache.shindig.gadgets.servlet.ETagFilter</filter-class> + </filter> + + <filter-mapping> + <filter-name>authFilter</filter-name> + <url-pattern>/social/*</url-pattern> + <url-pattern>/gadgets/ifr</url-pattern> + <url-pattern>/gadgets/makeRequest</url-pattern> + <url-pattern>/gadgets/proxy</url-pattern> + <url-pattern>/gadgets/api/rpc/*</url-pattern> + <url-pattern>/gadgets/api/rest/*</url-pattern> + <url-pattern>/rpc/*</url-pattern> + <url-pattern>/rest/*</url-pattern> + </filter-mapping> + + <filter-mapping> + <filter-name>etagFilter</filter-name> + <url-pattern>*</url-pattern> + </filter-mapping> + <listener> <listener-class> org.apache.shindig.common.servlet.GuiceServletContextListener @@ -69,6 +98,37 @@ </servlet> <servlet> + <servlet-name>restapiServlet</servlet-name> + <servlet-class> + org.apache.shindig.protocol.DataServiceServlet + </servlet-class> + <init-param> + <param-name>handlers</param-name> + <param-value>org.apache.shindig.handlers</param-value> + </init-param> + </servlet> + + <!-- Serve social RPC api --> + <servlet> + <servlet-name>jsonRpcServlet</servlet-name> + <servlet-class> + org.apache.shindig.protocol.JsonRpcServlet + </servlet-class> + <init-param> + <param-name>handlers</param-name> + <param-value>org.apache.shindig.handlers</param-value> + </init-param> + </servlet> + + <!-- makeRequest --> + <servlet> + <servlet-name>makeRequest</servlet-name> + <servlet-class> + org.apache.shindig.gadgets.servlet.MakeRequestServlet + </servlet-class> + </servlet> + + <servlet> <servlet-name>concat</servlet-name> <servlet-class> org.apache.shindig.gadgets.servlet.ConcatProxyServlet @@ -110,6 +170,25 @@ </servlet-mapping> <servlet-mapping> + <servlet-name>makeRequest</servlet-name> + <url-pattern>/gadgets/makeRequest</url-pattern> + </servlet-mapping> + + <servlet-mapping> + <servlet-name>jsonRpcServlet</servlet-name> + <url-pattern>/rpc/*</url-pattern> + <url-pattern>/gadgets/api/rpc/*</url-pattern> + <url-pattern>/social/rpc/*</url-pattern> + </servlet-mapping> + + <servlet-mapping> + <servlet-name>restapiServlet</servlet-name> + <url-pattern>/rest/*</url-pattern> + <url-pattern>/gadgets/api/rest/*</url-pattern> + <url-pattern>/social/rest/*</url-pattern> + </servlet-mapping> + + <servlet-mapping> <servlet-name>concat</servlet-name> <url-pattern>/gadgets/concat</url-pattern> </servlet-mapping> Index: src/main/resources/archetype-resources/src/main/webapp/myFirstGadget.xml =================================================================== --- src/main/resources/archetype-resources/src/main/webapp/myFirstGadget.xml (revision 1411344) +++ src/main/resources/archetype-resources/src/main/webapp/myFirstGadget.xml (working copy) @@ -21,10 +21,16 @@ under the License. --> <Module> - <ModulePrefs title="hello world example" /> + <ModulePrefs title="hello world example" > + <Require feature="setprefs" /> + </ModulePrefs> + + <UserPref name="someSetting" display_name="Some Setting" default_value="foo"/> <Content type="html"> <![CDATA[ Hello, world! - ]]> + <div> + Default value for UserPref "someSetting" = __UP_someSetting__ + </div>]]> </Content> </Module> Index: src/main/resources/archetype-resources/src/main/webapp/index.html =================================================================== --- src/main/resources/archetype-resources/src/main/webapp/index.html (revision 1411344) +++ src/main/resources/archetype-resources/src/main/webapp/index.html (working copy) @@ -21,33 +21,28 @@ --> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US"> <head> -<title>Sample: Simple Container</title> -<!-- default container look and feel --> -<link rel="stylesheet" href="css/gadgets.css"> -<script type="text/javascript" src="/gadgets/js/shindig-container:rpc.js?c=1&debug=1&nocache=1"></script> -<script type="text/javascript"> -var specUrl0 = 'http://localhost:8080/myFirstGadget.xml'; -var specUrl1 = 'http://www.labpixies.com/campaigns/todo/todo.xml'; + <title>Sample: Common Container</title> + <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" > + <!-- default container look and feel --> + <link rel="stylesheet" href="css/gadgets.css" > + <link rel="stylesheet" + href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/cupertino/jquery-ui.css" + type="text/css" media="all"> -// This container lays out and renders gadgets itself. + <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js" ></script> + <script type="text/javascript" src="/gadgets/js/open-views:opensearch:xmlutil:container:rpc.js?c=1&debug=1&nocache=1&container=default" ></script> + <script type="text/javascript" src="/my-container.js" ></script> +</head> -function renderGadgets() { - var gadget0 = shindig.container.createGadget({specUrl: specUrl0}); - var gadget1 = shindig.container.createGadget({specUrl: specUrl1}); +<body onLoad="CommonContainer.init()"> + <h2>Sample: Common Container</h2> - shindig.container.addGadget(gadget0); - shindig.container.addGadget(gadget1); - shindig.container.layoutManager.setGadgetChromeIds( - ['gadget-chrome-x', 'gadget-chrome-y']); + <div id="gadgetArea"> + <div id="gadget-site"></div> + </div> - shindig.container.renderGadget(gadget0); - shindig.container.renderGadget(gadget1); -}; -</script> -</head> -<body onLoad="renderGadgets();"> - <h2>Sample: Simple Container</h2> - <div id="gadget-chrome-x" class="gadgets-gadget-chrome"></div> - <div id="gadget-chrome-y" class="gadgets-gadget-chrome"></div> + <div id="output" class="log"> + <strong>This is the log window</strong> + </div> </body> </html> Index: src/main/resources/archetype-resources/src/main/java/org/apache/shindig/common/MyPropertiesModule.java =================================================================== --- src/main/resources/archetype-resources/src/main/java/org/apache/shindig/common/MyPropertiesModule.java (revision 0) +++ src/main/resources/archetype-resources/src/main/java/org/apache/shindig/common/MyPropertiesModule.java (revision 0) @@ -0,0 +1,43 @@ +package org.apache.shindig.common; + +import org.apache.shindig.common.PropertiesModule; +import org.apache.shindig.common.servlet.ParameterFetcher; +import org.apache.shindig.protocol.DataServiceServletFetcher; +import org.apache.shindig.protocol.conversion.BeanConverter; +import org.apache.shindig.protocol.conversion.BeanJsonConverter; +import org.apache.shindig.protocol.conversion.BeanXStreamConverter; +import org.apache.shindig.protocol.conversion.xstream.XStreamConfiguration; +import org.apache.shindig.social.core.util.BeanXStreamAtomConverter; +import org.apache.shindig.social.core.util.xstream.XStream081Configuration; + +import com.google.inject.AbstractModule; +import com.google.inject.Inject; +import com.google.inject.name.Names; + +/** + * Guice configuration module using my-shindig.properties file. + */ +public class MyPropertiesModule extends PropertiesModule +{ + + public MyPropertiesModule() + { + super("my-shindig.properties"); + } + + protected void configure() + { + super.configure(); + + bind(ParameterFetcher.class).annotatedWith(Names.named("DataServiceServlet")) + .to(DataServiceServletFetcher.class); + + bind(XStreamConfiguration.class).to(XStream081Configuration.class); + bind(BeanConverter.class).annotatedWith(Names.named("shindig.bean.converter.xml")).to( + BeanXStreamConverter.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( + BeanXStreamAtomConverter.class); + } +} Index: src/main/resources/archetype-resources/src/main/webresources/css/gadgets.css =================================================================== --- src/main/resources/archetype-resources/src/main/webresources/css/gadgets.css (revision 1411344) +++ src/main/resources/archetype-resources/src/main/webresources/css/gadgets.css (working copy) @@ -64,3 +64,84 @@ .gadgets-messages { } + + +.portlet-header .ui-icon { float: right; } +#content { +display: table; +width: 100%; +} + +#testArea { +display: table-cell; +width: 75%; +padding-left:22px; +} + +#controlPanel { +display: table-cell; +width: 25%; +} + +#viewsDropdown, #viewsDropdown ul { +list-style: none; +float: right; +position:relative; +font-weight:normal; +font-size:10pt; +} + +#viewsDropdown ul { +position: absolute; right: 0px; top: 20px; background-color: white; +} +#viewsDropdown, #viewsdropdown * { +padding: 0; margin: 0; +} + +#viewsDropdown li.li-header { +float: right; margin-left: -1px; +} +#viewsDropdown li.li-header a { +display: block; +} + +#viewsDropdown li.li-header ul { +display: none; border: 1px black solid; text-align: left; +} + +#viewsDropdown li.li-header:hover ul { +display: block; +} + +#viewsDropdown li.li-header ul li a { +padding: 5px; height: 17px; +} + +#tabs li .ui-icon-close { float: left; margin: 0.4em 0.2em 0 0; cursor: pointer; } + +.resultTitle { +color: blue; +} + +.searchEngine { +border: 1px solid blue; +} + +.widerInput { + width: 270px; +} + +.portlet { + float: left; + margin: 10px; +} + + +.log { + border:solid 2px lightgray; + white-space: pre; + overflow: scroll; + font-family: courier; + max-height: 300px; + clear:both; +} \ No newline at end of file Index: src/main/resources/archetype-resources/src/main/resources/shindig.properties =================================================================== --- src/main/resources/archetype-resources/src/main/resources/shindig.properties (revision 1411344) +++ src/main/resources/archetype-resources/src/main/resources/shindig.properties (working copy) @@ -1,214 +0,0 @@ -# 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. - -# Location of feature manifests (comma separated) -shindig.features.default=res://features/features.txt - -# Location of container configurations (comma separated) -shindig.containers.default=res://containers/default/container.js - -### Inbound OAuth support -# The URL base to use for full OAuth support (three-legged) -shindig.oauth.base-url=/oauth -shindig.oauth.authorize-action=/WEB-INF/authorize.jsp -# The range to the past and future of timestamp for OAuth token validation. Default to 5 minutes -shindig.oauth.validator-max-timestamp-age-ms=300000 - -### Outbound OAuth support -shindig.signing.state-key= -shindig.signing.key-name= -shindig.signing.key-file= -shindig.signing.global-callback-url=http://%authority%%contextRoot%/gadgets/oauthcallback -shindig.signing.enable-signed-callbacks=true - -### If a OAuth2Client does not specify a redirect uri it will default here -shindig.oauth2.global-redirect-uri=http://%authority%%contextRoot%/gadgets/oauth2callback -### Setting to true will cause the registered OAuth2Persistence plugin to load it's values -### with what's in config/oauth2.json, no meaning without a second persistence implementation. -shindig.oauth2.import=false -### Determines if the import will start by removing everything currently in persistence. -shindig.oauth2.import.clean=false -# Set to true if you want to allow the use of 3-party (authorization_code) OAuth 2.0 flow when viewer != owner. -# This setting is not recommeneded for pages that allow user-controlled javascript, since -# that javascript could be used to make unauthorized requests on behalf of the viewer of the page -shindig.oauth2.viewer-access-tokens-enabled=true -# Set to true to send extended trace messages to the client. Probably want this to be false for -# production systems and true for test/development. -shindig.oauth2.send-trace-to-client=true -shindig.signing.oauth2.state-key= - -# Set to true if you want to allow the use of 3-legged OAuth tokens when viewer != owner. -# This setting is not recommeneded for pages that allow user-controlled javascript, since -# that javascript could be used to make unauthorized requests on behalf of the viewer of the page -shindig.signing.viewer-access-tokens-enabled=false - -# If enabled here, configuration values can be found in container configuration files. -shindig.locked-domain.enabled=false - -# TODO: This needs to be moved to container configuration. -shindig.content-rewrite.only-allow-excludes=false -shindig.content-rewrite.include-urls=.* -shindig.content-rewrite.exclude-urls= -shindig.content-rewrite.include-tags=body,embed,img,input,link,script,style -shindig.content-rewrite.expires=86400 -shindig.content-rewrite.enable-split-js-concat=true -shindig.content-rewrite.enable-single-resource-concat=false - -# -# 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: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=true - -# Configuration for image rewriter -shindig.image-rewrite.max-inmem-bytes = 1048576 -shindig.image-rewrite.max-palette-size = 256 -shindig.image-rewrite.allow-jpeg-conversion = true -shindig.image-rewrite.jpeg-compression = 0.90 -shindig.image-rewrite.min-threshold-bytes = 200 -shindig.image-rewrite.jpeg-retain-subsampling = false -# Huffman optimization reduces the images size by addition 4-6% without -# any loss in the quality of the image, but takes extra cpu cycles for -# computing the optimized huffman tables. -shindig.image-rewrite.jpeg-huffman-optimization = false - -# Configuration for the os:Flash tag -shindig.flash.min-version = 9.0.115 - -# Configuration for template rewriter -shindig.template-rewrite.extension-tag-namespace=http://ns.opensocial.org/2009/extensions - -# These values provide default TTLs (in ms) for HTTP responses that don't use caching headers. -shindig.cache.http.defaultTtl=3600000 -shindig.cache.http.negativeCacheTtl=60000 - -# Amount of time after which the entry in cache should be considered for a refetch for a -# non-userfacing internal fetch when the response is strict-no-cache. -shindig.cache.http.strict-no-cache-resource.refetch-after-ms=-1 - -# A default refresh interval for XML files, since there is no natural way for developers to -# specify this value, and most HTTP responses don't include good cache control headers. -shindig.cache.xml.refreshInterval=300000 - -# Add entries in the form shindig.cache.lru.<name>.capacity to specify capacities for different -# caches when using the LruCacheProvider. -# It is highly recommended that the EhCache implementation be used instead of the LRU cache. -shindig.cache.lru.default.capacity=1000 -shindig.cache.lru.expressions.capacity=1000 -shindig.cache.lru.gadgetSpecs.capacity=1000 -shindig.cache.lru.messageBundles.capacity=1000 -shindig.cache.lru.httpResponses.capacity=10000 - -# The location of the EhCache configuration file. -shindig.cache.ehcache.config=res://org/apache/shindig/common/cache/ehcache/ehcacheConfig.xml - -# The location of the filter file for EhCache's SizeOfEngine -# This gets set as a system property to be consumed by EhCache. -# Can be a resource on the classpath or a path on the file system. -shindig.cache.ehcache.sizeof.filter=res://org/apache/shindig/common/cache/ehcache/SizeOfFilter.txt - -# true to enable JMX integration. -shindig.cache.ehcache.jmx.enabled=true - -# true to enable JMX stats. -shindig.cache.ehcache.jmx.stats=true - -# true to skip expensive encoding detection. -# if true, will only attempt to validate utf-8. Assumes all other encodings are ISO-8859-1. -shindig.http.fast-encoding-detection=true - -# Configuration for the HttpFetcher -# Connection timeout, in milliseconds, for requests. -shindig.http.client.connection-timeout-ms=5000 - -# Maximum size, in bytes, of the object we fetched, 0 == no limit -shindig.http.client.max-object-size-bytes=0 - -# 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 -shindig.proxy.remapInternalServerError=true - -# Add debug data when using VanillaCajaHtmlParser. -vanillaCajaParser.needsDebugData=true - -# Allow non-SSL OAuth 2.0 bearer tokens -org.apache.shindig.auth.oauth2-require-ssl=false - -# Set gadget param in proxied uri as authority if this is true -org.apache.shindig.gadgets.uri.setAuthorityAsGadgetParam=false - -# Maximum Get Url size limit -org.apache.shindig.gadgets.uri.urlMaxLength=2048 - -# Default cachettl value for versioned url in seconds. Here default value is 1 year. -org.apache.shindig.gadgets.servlet.longLivedRefreshSec=31536000 - -# Closure compiler optimization level. One of advanced|simple|whitespace_only|none. -# Defaults to simple. -shindig.closure.compile.level=simple - -# Size of the compiler thread pool -shindig.closure.compile.threadPoolSize=5 - -# OAuth 2.0 authorization code, access token, and refresh token expiration times. -# 5 * 60 * 1000 = 300000 = 5 minutes -# 5 * 60 * 60 * 1000 = 18000000 = 5 hours -# 5 * 60 * 60 * 1000 * 24 = 432000000 = 5 days -shindig.oauth2.authCodeExpiration=300000 -shindig.oauth2.accessTokenExpiration=18000000 -shindig.oauth2.refreshTokenExpiration=432000000 - -# Allows unauthenticated requests to Shindig -shindig.allowUnauthenticated=true - -# Comma separated tags that need to have its relative path to be resolved as absolute. -# Possible values are RESOURCES and HYPERLINKS -shindig.gadgets.rewriter.absolutePath.tags=RESOURCES
signature.asc
Description: PGP signature