You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rave.apache.org by zh...@apache.org on 2011/04/01 02:29:38 UTC
svn commit: r1087520 [28/35] - in
/incubator/rave/donations/ogce-gadget-container: ./ config/
config/shindig-1.1-BETA5/ config/shindig-2.0.0/ db-cleaner/ examples/
examples/src/ examples/src/main/ examples/src/main/java/
examples/src/main/java/cgl/ exa...
Added: incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/test/java/cgl/shindig/usermanage/servlet/AppTest.java
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/test/java/cgl/shindig/usermanage/servlet/AppTest.java?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/test/java/cgl/shindig/usermanage/servlet/AppTest.java (added)
+++ incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/test/java/cgl/shindig/usermanage/servlet/AppTest.java Fri Apr 1 00:29:22 2011
@@ -0,0 +1,59 @@
+package cgl.shindig.usermanage.servlet;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * Unit test for simple App.
+ */
+public class AppTest
+ extends TestCase
+{
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public AppTest( String testName )
+ {
+ super( testName );
+ }
+
+ /**
+ * @return the suite of tests being tested
+ */
+ public static Test suite()
+ {
+ return new TestSuite( AppTest.class );
+ }
+
+ /**
+ * Rigourous Test :-)
+ */
+ public void testApp()
+ {
+ assertTrue( true );
+ }
+}
Added: incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/test/webapp/www/js/dummytest.js
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/test/webapp/www/js/dummytest.js?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/test/webapp/www/js/dummytest.js (added)
+++ incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/test/webapp/www/js/dummytest.js Fri Apr 1 00:29:22 2011
@@ -0,0 +1,41 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+var dummyobj = dummyobj || {};
+
+function DummyTest(name) {
+ TestCase.call(this, name);
+};
+
+DummyTest.inherits(TestCase);
+
+DummyTest.prototype.setUp = function() {
+ dummyobj.name = "Gerald";
+};
+
+DummyTest.prototype.tearDown = function() {
+ delete dummyobj.name;
+};
+
+DummyTest.prototype.testDummy = function() {
+ this.assertEquals('Gerald', dummyobj.name);
+};
+
Added: incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/test/webapp/www/js/lib/testutils.js
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/test/webapp/www/js/lib/testutils.js?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/test/webapp/www/js/lib/testutils.js (added)
+++ incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/test/webapp/www/js/lib/testutils.js Fri Apr 1 00:29:22 2011
@@ -0,0 +1,207 @@
+/**
+ * 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.
+ */
+
+/**
+ * Verifies members for a single service request function
+ * @param fn (Function) Service Request function
+ */
+TestCase.prototype.assertRequestPropertiesForService = function(fn) {
+ this.assertTrue('Should have produced a result', fn);
+ this.assertTrue('Should have an execute method', fn.execute);
+ this.assertTrue('Should have a json-rpc method', !!fn.method);
+ this.assertTrue('Should have a json-rpc', fn.rpc);
+};
+
+
+/**
+ * Verify that arguments sent out of system (to non-proxied xhr) are built properly
+ * @param argsInCall
+ * @param expectedJson
+ */
+TestCase.prototype.assertArgsToMakeNonProxiedRequest = function(argsInCall, expectedJson) {
+ this.assertTrue('url should be passed to makeNonProxiedRequest',
+ argsInCall.hasOwnProperty('url'));
+ this.assertTrue('callback should be passed to makeNonProxiedRequest',
+ argsInCall.callback);
+ this.assertTrue('params should be passed to makeNonProxiedRequest',
+ argsInCall.params);
+ this.assertEquals('Content type should match', 'application/json',
+ argsInCall.contentType);
+ this.assertEquals('Json for batch should match', expectedJson,
+ gadgets.json.parse(argsInCall.params.POST_DATA));
+
+};
+
+/**
+ * Verify that arguments sent out of system (to proxied xhr) are built properly
+ * @param argsInCall
+ * @param expectedJson
+ */
+TestCase.prototype.assertArgsToMakeRequest = function(argsInCall) {
+ this.assertTrue('url should be passed to makeNonProxiedRequest',
+ argsInCall.hasOwnProperty('url'));
+ this.assertTrue('callback should be passed to makeNonProxiedRequest',
+ argsInCall.callback);
+ this.assertTrue('options should be passed to makeNonProxiedRequest',
+ argsInCall.options);
+
+};
+
+/**
+ * Make a callback that can be asserted that it was called, and that still calls
+ * a callback.
+ * @return (Function) A callback function
+ */
+var makeInspectableCallback = function(realCallback) {
+ var called = false;
+
+ return {
+ callback : function(result) {
+ called = true;
+ if (realCallback != null) {
+ if (typeof result !== 'array') {
+ result = [result];
+ }
+ realCallback.apply(this, result);
+ }
+ },
+ wasCalled : function() {
+ return called;
+ }
+ };
+};
+
+
+/**
+ * An assert equals that compares correctly and prints useful output for object types, like json.
+ * @param msg
+ * @param expected
+ * @param actual
+ */
+TestCase.prototype.assertEquals = function(msg, expected, actual) {
+ if (arguments.length == 2) {
+ actual = expected;
+ expected = msg;
+ msg = null;
+ }
+
+ if (!deepEquals(expected, actual)) {
+ if (typeof( expected ) == 'string' && typeof( actual ) == 'string') {
+ throw new ComparisonFailure(msg, expected, actual, new CallStack());
+ } else {
+ this.fail('Expected:<' + getSourceMessage(expected) +
+ '>\n, but was:<' + getSourceMessage(actual) + '>'
+ , new CallStack(), msg);
+ }
+ }
+};
+
+/**
+ * Print an operand to an assert operation.
+ * @param expected
+ * @param actual
+ */
+var getSourceMessage = function(operand) {
+ if (operand === undefined) {
+ return "undefined";
+ } else if (operand === null) {
+ return "null";
+ } else {
+ return operand.toSource();
+ }
+};
+
+/**
+ * Implements deep equality for JSON objects; the two objects
+ * are equal if they have the same properties with the same values.
+ *
+ * @param {Object} a first object
+ * @param {Object} b second object
+ * @return {boolean} true if the objects are equal
+ * @private
+ */
+function deepEquals(expected, actual) {
+ // Undefined/null can be treated as equal here, I believe
+ if (expected == null) {
+ return actual == null;
+ }
+
+ // If the types are different, the objects are different
+ var typeOfExpected = typeof expected;
+ if (typeOfExpected != typeof actual) {
+ return false;
+ }
+
+ // A few types that can handle a straight === check
+ if ((typeOfExpected == 'string') || (typeOfExpected == 'boolean') ||
+ (typeOfExpected == 'number')) {
+ return expected === actual;
+ }
+
+ // If it's an array, use deepEquals on each entry
+ if (typeOfExpected == 'array') {
+ if (expected.length != actual.length) {
+ return false;
+ }
+
+ for (var i = 0; i < expected.length; i++) {
+ if (!deepEquals(expected[i], actual[i])) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ // OK, we figure it's just an object.
+
+ // Make sure everything in a matches the value in b
+ for (var aKey in expected) {
+ if (!expected.hasOwnProperty(aKey)) {
+ continue;
+ }
+
+ if (!deepEquals(expected[aKey], actual[aKey])) {
+ return false;
+ }
+ }
+
+ // And make sure everything in b is in a
+ for (var bKey in actual) {
+ if (!actual.hasOwnProperty(bKey)) {
+ continue;
+ }
+ if (!(bKey in expected)) {
+ return false;
+ }
+ }
+
+ return true;
+}
+;
+
+
+Function.prototype.inherits = function(parentCtor) {
+ function tempCtor() {};
+ tempCtor.prototype = parentCtor.prototype;
+ this.superClass_ = parentCtor.prototype;
+ this.prototype = new tempCtor();
+ this.prototype.constructor = this;
+};
+
Added: incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/test/webapp/www/js/mocks/env.js
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/test/webapp/www/js/mocks/env.js?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/test/webapp/www/js/mocks/env.js (added)
+++ incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/test/webapp/www/js/mocks/env.js Fri Apr 1 00:29:22 2011
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+
+/**
+ * @fileoverview
+ *
+ * Provides a simulated browser environment.
+ * TODO Port John Resig's env.js.
+ */
+
+var document = {
+ location: {
+ href: "http://localhost"
+ }
+};
+
+// See mocks.FakeWindow if you need something more full featured.
+var window = {};
+
+var alert = function() {};
Added: incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/test/webapp/www/js/mocks/window.js
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/test/webapp/www/js/mocks/window.js?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/test/webapp/www/js/mocks/window.js (added)
+++ incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/test/webapp/www/js/mocks/window.js Fri Apr 1 00:29:22 2011
@@ -0,0 +1,142 @@
+/*
+ * 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.
+ */
+
+/**
+ * @fileoverview
+ *
+ * Provides a simulated window object. Recommended usage is to reset
+ * the global window object in each test case that uses the window.
+ *
+ * Example:
+ *
+ * ExampleTest.prototype.testSomething = function() {
+ * window = new mocks.FakeWindow();
+ * // Test things
+ * };
+ */
+
+var mocks = mocks || {};
+
+/**
+ * @constructor
+ * @description creates a new fake window object.
+ * @param {string} url Destination url.
+ * @param {string} target Name of window
+ * @param {string} options Options for window, such as size.
+ */
+mocks.FakeWindow = function(url, target, options) {
+ // Properties passed to window.open
+ this.url_ = url;
+ this.target_ = target;
+ this.options_ = options;
+
+ // Whether the window has been closed.
+ this.closed = false;
+
+ // Event handling. Events array is always sorted in order of ascending
+ // execution time.
+ this.now_ = 1000000;
+ this.events_ = [];
+ this.nextEventId_ = 1000;
+};
+
+/**
+ * Replacement for window.open.
+ */
+mocks.FakeWindow.prototype.open = function(url, target, options) {
+ return new mocks.FakeWindow(url, target, options);
+};
+
+/**
+ * Replacement for window.close.
+ */
+mocks.FakeWindow.prototype.close = function() {
+ this.closed = true;
+};
+
+/**
+ * Replacement for window.setInterval
+ */
+mocks.FakeWindow.prototype.setInterval = function(callback, millis) {
+ var event = {
+ id: this.nextEventId_,
+ when: this.now_ += millis,
+ interval: millis,
+ callback: callback
+ };
+ this.events_.push(event);
+ this.sortEvents_();
+ ++this.nextEventId_;
+ return event.id;
+};
+
+mocks.FakeWindow.prototype.sortEvents_ = function(event) {
+ this.events_.sort(function (a, b) {
+ return a.when - b.when;
+ });
+};
+
+/**
+ * Replacement for window.clearInterval
+ */
+mocks.FakeWindow.prototype.clearInterval = function(id) {
+ // Removes a single event by copying everything but that event.
+ var remaining = [];
+ for (var i = 0; i < this.events_.length; ++i) {
+ e = this.events_[i];
+ if (e.id !== id) {
+ remaining.push(e);
+ }
+ }
+ if (this.events_.length === remaining.length) {
+ throw 'window.clearInterval failed, no event with id ' + id;
+ }
+ this.events_ = remaining;
+};
+
+/**
+ * Moves the clock forward, running any associated events.
+ */
+mocks.FakeWindow.prototype.incrementTime = function(millis) {
+ if (this.active) {
+ throw 'recursive invocation of window.incrementTime. Cut that out';
+ }
+ this.active = true;
+
+ // Each iteration bumps the time just enough to run a single event, or
+ // else ends the loop.
+ var finish = this.now_ + millis;
+ do {
+ var ranEvent = false;
+ if (this.events_.length > 0) {
+ var e = this.events_[0];
+ if (e.when <= finish) {
+ this.now_ = e.when;
+ e.when += e.interval;
+ this.sortEvents_();
+ // Deliberately let exceptions propagate, it's probably a bug if
+ // a timer throws an exception.
+ e.callback();
+ ranEvent = true;
+ }
+ }
+ } while (ranEvent);
+ this.now_ = finish;
+ this.active = false;
+};
Added: incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/test/webapp/www/js/mocks/xhr.js
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/test/webapp/www/js/mocks/xhr.js?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/test/webapp/www/js/mocks/xhr.js (added)
+++ incubator/rave/donations/ogce-gadget-container/ishindig-webapp/src/test/webapp/www/js/mocks/xhr.js Fri Apr 1 00:29:22 2011
@@ -0,0 +1,247 @@
+/*
+ * 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.
+ */
+
+/**
+ * @fileoverview
+ *
+ * Provides a simulated XMLHttpRequest object.
+ *
+ * To use, create a FakeXhrFactory, then populate the factory
+ * with FakeXhrExpectation and FakeXhrResponse objects.
+ */
+
+var fakeXhr = fakeXhr || {};
+
+/**
+ * @class
+ * What XHR to expect. Requests are matched based on method, url, headers
+ * query string parameters, and body parameters. Parameter ordering does
+ * not matter.
+ *
+ * Parameters are assumed to be HTML form encoded.
+ *
+ * @name fakeXhr.Expectation
+ */
+
+/**
+ * Create a request.
+ *
+ * @constructor
+ */
+fakeXhr.Expectation = function(method, url) {
+ this.method = method;
+ this.url = url;
+ this.queryArgs = {};
+ this.bodyArgs = {};
+ this.headers = {};
+};
+
+fakeXhr.Expectation.prototype.setMethod = function(method) {
+ this.method = method;
+};
+
+fakeXhr.Expectation.prototype.setUrl = function(url) {
+ this.url = url;
+ var query = url.indexOf("?");
+ if (query !== -1) {
+ this.queryArgs = this.parseForm(url.substr(query+1));
+ this.url = url.substr(0, query);
+ }
+};
+
+fakeXhr.Expectation.prototype.setBodyArg = function(name, value) {
+ if (value !== null) {
+ this.bodyArgs[name] = value;
+ } else {
+ delete this.bodyArgs[name];
+ }
+};
+
+fakeXhr.Expectation.prototype.setQueryArg = function(name, value) {
+ if (value !== null) {
+ this.queryArgs[name] = value;
+ } else {
+ delete this.queryArgs[name];
+ }
+};
+
+fakeXhr.Expectation.prototype.setHeader = function(name, value) {
+ if (value !== null) {
+ this.headers[name] = value;
+ } else {
+ delete this.headers[name];
+ }
+};
+
+fakeXhr.Expectation.prototype.parseForm = function(form) {
+ var result = {};
+ if (form) {
+ var pairs = form.split("&");
+ for (var i=0; i < pairs.length; ++i) {
+ var arg = pairs[i].split("=");
+ // We use unescape here instead of decodeURIComponent because of a bug
+ // in Rhino: https://bugzilla.mozilla.org/show_bug.cgi?id=217257.
+ // Rhino fixed this ages ago, but there hasn't been a new release of
+ // the Berlios jsunit package that incorporates the fix.
+ var name = unescape(arg[0]);
+ var value = unescape(arg[1]);
+ result[name] = value;
+ }
+ }
+ return result;
+};
+
+fakeXhr.Expectation.prototype.toString = function() {
+ return gadgets.json.stringify(this);
+};
+
+fakeXhr.Expectation.prototype.checkMatch = function(testcase, other) {
+ testcase.assertEquals(this.method, other.method);
+ testcase.assertEquals(this.url, other.url);
+ this.checkTableEquals(testcase, "query", this.queryArgs, other.queryArgs);
+ this.checkTableEquals(testcase, "body", this.bodyArgs, other.bodyArgs);
+ this.checkTableEquals(testcase, "header", this.headers, other.headers);
+};
+
+fakeXhr.Expectation.prototype.checkTableEquals = function(testcase, type, x, y) {
+ // Check for things in x that aren't in y
+ var member;
+ for (member in x) if (x.hasOwnProperty(member)) {
+ testcase.assertEquals(
+ "wrong value for " + type + " parameter " + member,
+ x[member], y[member]);
+ }
+ // Check for things in y that aren't in x
+ for (member in y) if (y.hasOwnProperty(member)) {
+ testcase.assertEquals(
+ "extra value for " + type + " parameter " + member,
+ x[member], y[member]);
+ }
+};
+
+
+/**
+ * @class
+ * What data to return for an XMLHttpRequest.
+ *
+ * @name fakeXhr.Response
+ */
+
+/**
+ * Create a response.
+ *
+ * @constructor
+ */
+fakeXhr.Response = function(responseText, status) {
+ this.responseText = responseText;
+ this.status = status || 200;
+};
+
+fakeXhr.Response.prototype.getResponseText = function() {
+ return this.responseText;
+};
+
+fakeXhr.Response.prototype.getStatus = function() {
+ return this.status;
+};
+
+
+/**
+ * @class
+ * Holds a list of expected XMLHTTPRequests and responses.
+ *
+ * @name fakeXhr.Factory
+ */
+
+/**
+ * Create a factory to collect requests and responses.
+ *
+ * @constructor
+ */
+fakeXhr.Factory = function(testcase) {
+ this.testcase = testcase;
+ this.expectations = [];
+};
+
+/**
+ * Expect a certain request and return the specified response.
+ */
+fakeXhr.Factory.prototype.expect = function(expect, response) {
+ this.expectations.push({ "expect" : expect, "response" : response});
+};
+
+/**
+ * Finds the response matching a particular request.
+ */
+fakeXhr.Factory.prototype.find = function(req) {
+ this.testcase.assertTrue(this.expectations.length > 0);
+ var next = this.expectations.shift();
+ next.expect.checkMatch(this.testcase, req);
+ return next.response;
+};
+
+/**
+ * Create a new XMLHttpRequest that will be fed from the expectations
+ * associated with this factory.
+ */
+fakeXhr.Factory.prototype.getXhrConstructor = function() {
+ var factory = this;
+ return function() {
+ return new fakeXhr.Request(factory);
+ };
+};
+
+
+/**
+ * @class
+ * An XMLHTTPRequest object
+ *
+ * @name fakeXhr.Factory
+ */
+
+/**
+ * Create a new XMLHTTPRequest, with response data returned from the
+ * specified factory.
+ *
+ * @constructor
+ */
+fakeXhr.Request = function(factory) {
+ this.factory = factory;
+ this.actual = new fakeXhr.Expectation(null, null);
+ this.response = null;
+ this.onreadystatechange = null;
+};
+
+fakeXhr.Request.prototype.open = function(method, url, async) {
+ this.actual.setMethod(method);
+ this.actual.setUrl(url);
+};
+
+fakeXhr.Request.prototype.setRequestHeader = function(name, value) {
+ this.actual.setHeader(name, value);
+};
+
+fakeXhr.Request.prototype.send = function(body) {
+ this.actual.bodyArgs = this.actual.parseForm(body);
+ var response = this.factory.find(this.actual);
+ this.readyState = 4;
+ this.status = response.status;
+ this.responseText = response.responseText;
+ this.onreadystatechange();
+};
Added: incubator/rave/donations/ogce-gadget-container/keystore/keystore
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/keystore/keystore?rev=1087520&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/rave/donations/ogce-gadget-container/keystore/keystore
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/rave/donations/ogce-gadget-container/keystore/pom.xml
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/keystore/pom.xml?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/keystore/pom.xml (added)
+++ incubator/rave/donations/ogce-gadget-container/keystore/pom.xml Fri Apr 1 00:29:22 2011
@@ -0,0 +1,64 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <!-- dummy -->
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>cgl.ishindig</groupId>
+ <artifactId>keystore</artifactId>
+ <packaging>pom</packaging>
+ <version>1.0</version>
+ <name>keystore</name>
+
+ <parent>
+ <groupId>cgl.shindig</groupId>
+ <artifactId>gadget-container-main-driver</artifactId>
+ <version>0.1</version>
+ <relativePath>..</relativePath>
+ </parent>
+
+ <properties>
+ <main.basedir>${project.parent.basedir}</main.basedir>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>Copy keystore file to tomcat</id>
+ <phase>install</phase>
+ <configuration>
+ <mkdir dir="${catalina.home}/keystore"/>
+ <tasks>
+ <copy overwrite="true" filtering="true"
+ file="keystore"
+ todir="${catalina.home}/keystore/">
+ </copy>
+ <genkey alias="ogce-gadget-portal"
+ keystore="${catalina.home}/keystore/keystore"
+ storepass="changeit" >
+ <dname>
+ <param name="CN" value="${site.host}"/>
+ <param name="OU" value="Type here"/>
+ <param name="O" value="Type here"/>
+ <param name="C" value="Type here"/>
+ </dname>
+ </genkey>
+ <exec executable="keytool">
+ <arg line="-exportcert -alias ogce-gadget-portal -keystore '${catalina.home}/keystore/keystore' -storepass 'changeit' -rfc -file __temp_your_cert__.pem"/>
+ </exec>
+ <exec executable="keytool">
+ <arg line="-importcert -trustcacerts -alias '${site.host}' -keystore '${catalina.home}/keystore/keystore' -storepass 'changeit' -noprompt -file __temp_your_cert__.pem"/>
+ </exec>
+ <delete file="__temp_your_cert__.pem"/>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
+
Added: incubator/rave/donations/ogce-gadget-container/opensocial/pom.xml
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/opensocial/pom.xml?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/opensocial/pom.xml (added)
+++ incubator/rave/donations/ogce-gadget-container/opensocial/pom.xml Fri Apr 1 00:29:22 2011
@@ -0,0 +1,70 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>cgl.shindig</groupId>
+ <artifactId>opensocial</artifactId>
+ <packaging>jar</packaging>
+ <version>1.0</version>
+ <name>opensocial data provider</name>
+
+ <parent>
+ <groupId>cgl.shindig</groupId>
+ <artifactId>gadget-container-main-driver</artifactId>
+ <version>0.1</version>
+ <relativePath>..</relativePath>
+ </parent>
+
+ <properties>
+ <main.basedir>${project.parent.basedir}</main.basedir>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.google.code.facebookapi</groupId>
+ <artifactId>facebook-java-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>servlet-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.twitter4j</groupId>
+ <artifactId>twitter4j-core</artifactId>
+ <version>[2.1,)</version>
+ </dependency>
+
+ <!-- <dependency> -->
+ <!-- <groupId>net.oauth</groupId> -->
+ <!-- <artifactId>oauth-core</artifactId> -->
+ <!-- </dependency> -->
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.0.2</version>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
+
Added: incubator/rave/donations/ogce-gadget-container/opensocial/src/main/java/cgl/shindig/opensocial/FacebookAdapter.java
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/opensocial/src/main/java/cgl/shindig/opensocial/FacebookAdapter.java?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/opensocial/src/main/java/cgl/shindig/opensocial/FacebookAdapter.java (added)
+++ incubator/rave/donations/ogce-gadget-container/opensocial/src/main/java/cgl/shindig/opensocial/FacebookAdapter.java Fri Apr 1 00:29:22 2011
@@ -0,0 +1,138 @@
+package cgl.shindig.opensocial;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+
+// import static com.emobus.stuff.LoggerConstants.facebookUserId;
+// import static com.emobus.stuff.LoggerConstants.ipAddress;
+
+import java.io.IOException;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.slf4j.MDC;
+import org.w3c.dom.Document;
+
+import com.google.code.facebookapi.FacebookException;
+import com.google.code.facebookapi.FacebookWebappHelper;
+import com.google.code.facebookapi.FacebookXmlRestClient;
+import com.google.code.facebookapi.IFacebookRestClient;
+
+/**
+ * The Facebook User Filter ensures that a Facebook client that pertains to
+ * the logged in user is available in the session object named "facebook.user.client".
+ *
+ * The session ID is stored as "facebook.user.session". It's important to get
+ * the session ID only when the application actually needs it. The user has to
+ * authorise to give the application a session key.
+ *
+ * @author Dave
+ */
+public class FacebookAdapter implements Filter {
+
+ private static final Logger logger = LoggerFactory.getLogger(FacebookAdapter.class);
+
+ private String api_key;
+ private String secret;
+
+ private static final String FACEBOOK_USER_CLIENT = "facebook.user.client";
+
+ public void init(FilterConfig filterConfig) throws ServletException {
+ api_key = filterConfig.getServletContext().getInitParameter("facebook_api_key");
+ secret = filterConfig.getServletContext().getInitParameter("facebook_secret");
+ if(api_key == null || secret == null) {
+ throw new ServletException("Cannot initialise Facebook User Filter because the " +
+ "facebook_api_key or facebook_secret context init " +
+ "params have not been set. Check that they're there " +
+ "in your servlet context descriptor.");
+ } else {
+ logger.info("Using facebook API key: " + api_key);
+ }
+ }
+
+ public void destroy() {
+ }
+
+ public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
+ try {
+ // MDC.put(ipAddress, req.getRemoteAddr());
+
+ HttpServletRequest request = (HttpServletRequest)req;
+ HttpServletResponse response = (HttpServletResponse)res;
+
+ HttpSession session = request.getSession(true);
+ IFacebookRestClient<Document> userClient = getUserClient(session);
+ if(userClient == null) {
+ logger.debug("User session doesn't have a Facebook API client setup yet. Creating one and storing it in the user's session.");
+ userClient = new FacebookXmlRestClient(api_key, secret);
+ session.setAttribute(FACEBOOK_USER_CLIENT, userClient);
+ }
+
+ logger.trace("Creating a FacebookWebappHelper, which copies fb_ request param data into the userClient");
+ FacebookWebappHelper<Document> facebook = new FacebookWebappHelper<Document>(request, response, api_key, secret, userClient);
+ String nextPage = request.getRequestURI();
+ nextPage = nextPage.substring(nextPage.indexOf("/", 1) + 1); //cut out the first /, the context path and the 2nd /
+ logger.trace(nextPage);
+ boolean redirectOccurred = facebook.requireLogin(nextPage);
+ if(redirectOccurred) {
+ return;
+ }
+ redirectOccurred = facebook.requireFrame(nextPage);
+ if(redirectOccurred) {
+ return;
+ }
+
+ long facebookUserID;
+ try {
+ facebookUserID = userClient.users_getLoggedInUser();
+ } catch(FacebookException ex) {
+ response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Error while fetching user's facebook ID");
+ logger.error("Error while getting cached (supplied by request params) value " +
+ "of the user's facebook ID or while fetching it from the Facebook service " +
+ "if the cached value was not present for some reason. Cached value = {}", userClient.getCacheUserId());
+ return;
+ }
+
+ // MDC.put(facebookUserId, String.valueOf(facebookUserID));
+
+ chain.doFilter(request, response);
+ } finally {
+ // MDC.remove(ipAddress);
+ // MDC.remove(facebookUserId);
+ }
+ }
+
+ public static FacebookXmlRestClient getUserClient(HttpSession session) {
+ return (FacebookXmlRestClient)session.getAttribute(FACEBOOK_USER_CLIENT);
+ }
+}
+
Added: incubator/rave/donations/ogce-gadget-container/opensocial/src/main/java/cgl/shindig/opensocial/TwitterAdapter.java
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/opensocial/src/main/java/cgl/shindig/opensocial/TwitterAdapter.java?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/opensocial/src/main/java/cgl/shindig/opensocial/TwitterAdapter.java (added)
+++ incubator/rave/donations/ogce-gadget-container/opensocial/src/main/java/cgl/shindig/opensocial/TwitterAdapter.java Fri Apr 1 00:29:22 2011
@@ -0,0 +1,44 @@
+package cgl.shindig.opensocial;
+/*
+ *
+ * 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.
+ *
+ */
+
+
+import twitter4j.IDs;
+import twitter4j.PagableResponseList;
+import twitter4j.Twitter;
+import twitter4j.TwitterException;
+import twitter4j.TwitterFactory;
+import twitter4j.User;
+
+// @singleton
+public class TwitterAdapter {
+ private Twitter twitter;
+
+ private static int MAX_FRIEND_RET = 10;
+
+ public void init() throws TwitterException {
+ // twitter = TwitterFactory.getInstance(userName, password);
+ IDs friendids = twitter.getFriendsIDs();
+ IDs followersids = twitter.getFollowersIDs();
+ PagableResponseList<User> friendsStatuses = twitter.getFriendsStatuses();
+ }
+}
+
Added: incubator/rave/donations/ogce-gadget-container/pom.xml
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/pom.xml?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/pom.xml (added)
+++ incubator/rave/donations/ogce-gadget-container/pom.xml Fri Apr 1 00:29:22 2011
@@ -0,0 +1,294 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <!-- The rest of this should not be edited -->
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>cgl.shindig</groupId>
+ <artifactId>gadget-container-main-driver</artifactId>
+ <packaging>pom</packaging>
+ <version>0.1</version>
+ <name>gadget-container-main-driver</name>
+
+ <profiles>
+ <!-- This is the default profile -->
+ <profile>
+ <id>standalone</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <properties>
+ <main.basedir>${project.basedir}</main.basedir>
+ <project.home>${project.basedir}</project.home>
+ <deploy.dir>portal_deploy</deploy.dir>
+ <catalina.home>${main.basedir}/${deploy.dir}/${portal.tomcat.dir}</catalina.home>
+ <portal.server.ip>localhost</portal.server.ip>
+ <scope.sharedlib>provided</scope.sharedlib>
+
+ <!-- This is the "localhost" FriendConnect ID suitable for testing.
+ Replace with a real ID for your server if you want to use these gadgets.
+ -->
+ <site.friendconnectID.main>02963187904381158078</site.friendconnectID.main>
+
+ <!-- You probably do not need to modify any of the remaining properties-->
+ <site.port.main>7443</site.port.main>
+ <site.protocol.main>https</site.protocol.main>
+ <host.base.url>${site.protocol.main}://${portal.server.ip}:${site.port.main}/</host.base.url>
+ <site.port.insecure.main>7070</site.port.insecure.main>
+ <site.protocol.insecure.main>http</site.protocol.insecure.main>
+
+ <dot.globus.home>${env.HOME}/.globus/</dot.globus.home>
+ <portal.tomcat.version>6.0.20</portal.tomcat.version>
+ <portal.tomcat.dir>apache-tomcat-${portal.tomcat.version}</portal.tomcat.dir>
+ <portal.catalina.home>
+ ${project.home}/portal_deploy/${portal.tomcat.dir}/
+ </portal.catalina.home>
+ <trustedCertsLocation>${project.home}/certificates/</trustedCertsLocation>
+
+ <hibernate.h2.homedir>${project.home}/ogce-h2-data/</hibernate.h2.homedir>
+ <myproxy.server>myproxy.teragrid.org</myproxy.server>
+ </properties>
+ </profile>
+ <!--This is a profile for building the gadget container in as a child pom. -->
+ <profile>
+ <id>ogce all</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ <file>
+ <exists>betacollective</exists>
+ </file>
+ </activation>
+ <properties>
+ <main.basedir>${project.basedir}</main.basedir>
+ <scope.sharedlib>provided</scope.sharedlib>
+ <catalina.home>${main.basedir}/${deploy.dir}/${portal.tomcat.dir}</catalina.home>
+ </properties>
+ </profile>
+
+ </profiles>
+
+ <repositories>
+ <repository>
+ <id>jboss.maven2</id>
+ <name>JBoss Maven Repository</name>
+ <layout>default</layout>
+ <url>https://repository.jboss.org/nexus/content/groups/public-jboss/</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ <!-- for org.eclipse.higgins -->
+ <repository>
+ <id>alchim.snapshots</id>
+ <name>Achim Repository Snapshots</name>
+ <url>http://alchim.sf.net/download/snapshots</url>
+ <snapshots/>
+ </repository>
+ <repository>
+ <id>maven2-repository.dev.java.net</id>
+ <name>Java.net Repository for Maven</name>
+ <url>http://download.java.net/maven/2/</url>
+ <layout>default</layout>
+ </repository>
+ <repository>
+ <id>oauth-maven</id>
+ <name>Google Code OAuth Maven Repository</name>
+ <layout>default</layout>
+ <url>http://oauth.googlecode.com/svn/code/maven</url>
+ <releases> <enabled>true</enabled> </releases>
+ <snapshots> <enabled>true</enabled> </snapshots>
+ </repository>
+ <repository>
+ <id>repo1.maven2</id>
+ <name>Maven Repository</name>
+ <layout>default</layout>
+ <url>http://repo1.maven.org/maven2/</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ <!-- This is our private repo, needs to be deleted. -->
+ <repository>
+ <name>ogce.m2.all</name>
+ <id>ogce.m2.all</id>
+ <url>http://community.ucs.indiana.edu:9090/archiva/repository/ogce.m2.all</url>
+ </repository>
+ </repositories>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>com.google.code.facebookapi</groupId>
+ <artifactId>facebook-java-api</artifactId>
+ <version>3.0.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tomcat</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>${portal.tomcat.version}</version>
+ <scope>provided</scope>
+ <type>jar</type>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>1.5.6</version>
+ <scope>compile</scope>
+ <type>jar</type>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.5.6</version>
+ <scope>compile</scope>
+ <type>jar</type>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>create local property file if not exist</id>
+ <phase>validate</phase>
+ <configuration>
+ <tasks>
+ <touch file="${main.basedir}/config/site.properties"/>
+ <touch file="${main.basedir}/config/local.properties"/>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>create local property file if not exist during cleanup</id>
+ <phase>clean</phase>
+ <configuration>
+ <tasks>
+ <touch file="${main.basedir}/config/site.properties"/>
+ <touch file="${main.basedir}/config/local.properties"/>
+ <delete file="${main.basedir}/startup-tomcat.sh" quiet="true"/>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>Copy and filter startup-tomcat.sh.raw</id>
+ <goals><goal>run</goal></goals>
+ <phase>prepare-package</phase>
+ <configuration>
+ <tasks>
+ <copy tofile="${main.basedir}/startup-tomcat.sh"
+ overwrite="true"
+ failonerror="true"
+ filtering="true"
+ file="${main.basedir}/startup-tomcat.sh.raw">
+ <filterset>
+ <filter token="shindig.host" value="${gadget.server.host}"/>
+ <filter token="shindig.port" value="${gadget.server.port}"/>
+ <filter token="portal.tomcat.dir" value="${portal.tomcat.dir}"/>
+ <filter token="deploy.dir" value="${deploy.dir}"/>
+ <filter token="host.base.url" value="${host.base.url}"/>
+ </filterset>
+ </copy>
+ <chmod file="${main.basedir}/startup-tomcat.sh" perm="u+x"/>
+ <copy tofile="${main.basedir}/shutdown-tomcat.sh"
+ overwrite="true"
+ failonerror="true"
+ filtering="true"
+ file="${main.basedir}/shutdown-tomcat.sh.raw">
+ <filterset>
+ <filter token="shindig.host" value="${gadget.server.host}"/>
+ <filter token="shindig.port" value="${gadget.server.port}"/>
+ <filter token="portal.tomcat.dir" value="${portal.tomcat.dir}"/>
+ <filter token="deploy.dir" value="${deploy.dir}"/>
+ </filterset>
+ </copy>
+ <chmod file="${main.basedir}/shutdown-tomcat.sh" perm="u+x"/>
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>properties-maven-plugin</artifactId>
+ <version>1.0-alpha-2</version>
+ <executions>
+ <execution>
+ <id>clean-props</id>
+ <phase>clean</phase>
+ <goals>
+ <goal>read-project-properties</goal>
+ </goals>
+ <configuration>
+ <files>
+ <file>${main.basedir}/config/ishindig.properties</file>
+ <file>${main.basedir}/config/site.properties</file>
+ <file>${main.basedir}/config/local.properties</file>
+ </files>
+ </configuration>
+ </execution>
+ <execution>
+ <id>init-props</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>read-project-properties</goal>
+ </goals>
+ <configuration>
+ <files>
+ <file>${main.basedir}/config/ishindig.properties</file>
+ <file>${main.basedir}/config/site.properties</file>
+ <file>${main.basedir}/config/local.properties</file>
+ </files>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <modules>
+ <module>portal_deploy</module>
+ <module>tomcat-config</module>
+ <module>ishindig-webapp</module>
+ <module>third-party-gadgets</module>
+ <module>keystore</module>
+ <module>shindig</module>
+ <module>examples</module>
+ </modules>
+</project>
+
Added: incubator/rave/donations/ogce-gadget-container/portal.xml
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/portal.xml?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/portal.xml (added)
+++ incubator/rave/donations/ogce-gadget-container/portal.xml Fri Apr 1 00:29:22 2011
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+ 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.
+
+-->
+
+<config>
+ <Security appName="ogce_portal">
+ <SecurityManager class=""> <!--bean-->
+ <UserManager class="">
+ <param name="subsystem" value=""/>
+ </UserManager>
+ </SecurityManager>
+ <AccessManager class="">
+ <param name="name" value="value"/>
+ </AccessManager>
+ <LoginModule class="cgl.shindig.security.DefaultLoginModule">
+ <param name="anonymousId" value="anonymous"/>
+ <param name="adminId" value="admin"/>
+ </LoginModule>
+ </Security>
+</config>
Added: incubator/rave/donations/ogce-gadget-container/portal_deploy/apache-tomcat-6.0.20.tar.gz
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/portal_deploy/apache-tomcat-6.0.20.tar.gz?rev=1087520&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/rave/donations/ogce-gadget-container/portal_deploy/apache-tomcat-6.0.20.tar.gz
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/rave/donations/ogce-gadget-container/portal_deploy/pom.xml
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/portal_deploy/pom.xml?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/portal_deploy/pom.xml (added)
+++ incubator/rave/donations/ogce-gadget-container/portal_deploy/pom.xml Fri Apr 1 00:29:22 2011
@@ -0,0 +1,89 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <parent>
+ <groupId>cgl.shindig</groupId>
+ <artifactId>gadget-container-main-driver</artifactId>
+ <version>0.1</version>
+ <relativePath>..</relativePath>
+ </parent>
+
+ <properties>
+ <main.basedir>${project.parent.basedir}</main.basedir>
+ <tomcat.bin.perm>755</tomcat.bin.perm>
+ <maven.test.skip>true</maven.test.skip>
+ </properties>
+
+ <!-- The rest of this should not be edited -->
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>cgl.shindig</groupId>
+ <artifactId>portal_deploy</artifactId>
+ <packaging>pom</packaging>
+ <version>1.0</version>
+ <name>portal_deploy</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>Cleanup</id>
+ <phase>clean</phase>
+ <configuration>
+ <tasks>
+ <echo message="Cleaning up ${basedir}"/>
+ <delete includeemptydirs="true">
+ <fileset dir="${basedir}" >
+ <exclude name="*.tar.gz"/>
+ <exclude name="pom.xml"/>
+ <exclude name="**/.svn"/>
+ </fileset>
+ </delete>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+
+ <!-- Unpack the apache tomcat server and portal container -->
+ <execution>
+ <id>untar</id>
+ <phase>process-resources</phase>
+ <configuration>
+ <tasks>
+ <echo message="Unpacking ${basedir}"/>
+ <!-- These gunzips unfortunately must be done one at a time -->
+ <gunzip src="${basedir}/${portal.tomcat.dir}.tar.gz" dest="${basedir}/"></gunzip>
+
+ <untar dest="${basedir}" overwrite="true">
+ <fileset dir="${basedir}">
+ <include name="**/*.tar"/>
+ </fileset>
+ </untar>
+
+ <echo message="Setting execute permissions on tomcat shell scripts"/>
+ <chmod perm="${tomcat.bin.perm}" dir="${basedir}/${portal.tomcat.dir}/bin/">
+ <include name="*.sh"/>
+ </chmod>
+
+ <delete includeemptydirs="true">
+ <fileset dir="${basedir}" >
+ <include name="*.tar"/>
+ <exclude name="*.tar.gz"/>
+ <exclude name="pom.xml"/>
+ <exclude name="**/.svn"/>
+ </fileset>
+ </delete>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
+
Added: incubator/rave/donations/ogce-gadget-container/shindig/pom.xml
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/shindig/pom.xml?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/shindig/pom.xml (added)
+++ incubator/rave/donations/ogce-gadget-container/shindig/pom.xml Fri Apr 1 00:29:22 2011
@@ -0,0 +1,171 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <!-- dummy -->
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>cgl.ishindig.shindig</groupId>
+ <artifactId>shindig</artifactId>
+ <packaging>pom</packaging>
+ <version>1.0</version>
+ <name>shindig</name>
+
+ <parent>
+ <groupId>cgl.shindig</groupId>
+ <artifactId>gadget-container-main-driver</artifactId>
+ <version>0.1</version>
+ <relativePath>..</relativePath>
+ </parent>
+
+ <properties>
+ <main.basedir>${project.parent.basedir}</main.basedir>
+ <!-- <shindig.war.file>shindig-server-1.1-BETA5-incubating-SNAPSHOT.war</shindig.war.file> -->
+ <shindig.version>2.0.0</shindig.version>
+ <!-- <shindig.version>1.1-BETA5</shindig.version> -->
+ <shindig.war.file>shindig-server-${shindig.version}.war</shindig.war.file>
+ <shindig.customizedconfig.dir>shindig-${shindig.version}</shindig.customizedconfig.dir>
+
+ <shindig.containercfg.dir>WEB-INF/classes/containers/default</shindig.containercfg.dir>
+ <shindig.containercfg.file>container.js</shindig.containercfg.file>
+
+ <shindig.shindigcfg.dir>WEB-INF/classes</shindig.shindigcfg.dir>
+ <shindig.shindigcfg.file>shindig.properties</shindig.shindigcfg.file>
+
+
+ <shindig.oauthcfg.dir>WEB-INF/classes/config</shindig.oauthcfg.dir>
+ <shindig.oauthcfg.file>oauth.json</shindig.oauthcfg.file>
+
+ <shindig.webinf.dir>WEB-INF</shindig.webinf.dir>
+ <shindig.classes.dir>${shindig.webinf.dir}/classes</shindig.classes.dir>
+ <shindig.lib.dir>${shindig.webinf.dir}/lib</shindig.lib.dir>
+ <shindig.webxml.file>web.xml</shindig.webxml.file>
+
+ <temp.dir>__temp_</temp.dir>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy shindig war to tomcat</id>
+ <phase>install</phase>
+ <configuration>
+ <tasks>
+
+ <copy overwrite="true" filtering="false"
+ file="${shindig.war.file}"
+ tofile="${catalina.home}/shindig/shindig-server.war">
+ </copy>
+
+ <!-- move original ROOT dir -->
+ <!--Note this will fail if Tomcat server is running (on Mac anyway) -->
+ <move overwrite="true" filtering="false"
+ file="${catalina.home}/webapps/ROOT"
+ tofile="${catalina.home}/webapps/ROOT.ORG">
+ </move>
+
+ <!-- copy container config file -->
+ <mkdir dir="${temp.dir}/${shindig.containercfg.dir}"/>
+ <copy overwrite="true" filtering="true"
+ file="${main.basedir}/config/${shindig.customizedconfig.dir}/${shindig.containercfg.file}.${gadget.server.protocol}"
+ tofile="${temp.dir}/${shindig.containercfg.dir}/${shindig.containercfg.file}">
+ <filterset>
+ <filter token="site.base" value="${site.base}"/>
+ </filterset>
+ </copy>
+
+ <!-- copy shindig config file -->
+ <mkdir dir="${temp.dir}/${shindig.shindigcfg.dir}"/>
+ <copy overwrite="true" filtering="true"
+ file="${main.basedir}/config/${shindig.customizedconfig.dir}/${shindig.shindigcfg.file}"
+ tofile="${temp.dir}/${shindig.shindigcfg.dir}/${shindig.shindigcfg.file}">
+ <filterset>
+ <filter token="gadget.server.base" value="${gadget.server.base}"/>
+ </filterset>
+ </copy>
+
+ <!-- <zip destfile="${catalina.home}/shindig/shindig-server.war" basedir="${temp.dir}" update="true"/> -->
+
+ <!-- copy ishindig jar -->
+ <mkdir dir="${temp.dir}/${shindig.lib.dir}"/>
+ <copy overwrite="true" filtering="false"
+ file="${main.basedir}/ishindig-webapp/target/ishindig-webapp-0.1/WEB-INF/lib/ishindig-webapp-0.1.jar"
+ todir="${temp.dir}/${shindig.lib.dir}"/>
+ <copy overwrite="true" filtering="false"
+ file="${main.basedir}/ishindig-webapp/target/ishindig-webapp-0.1/WEB-INF/lib/hibernate-3.3.0.SP1.jar"
+ todir="${temp.dir}/${shindig.lib.dir}"/>
+ <copy overwrite="true" filtering="false"
+ file="${main.basedir}/ishindig-webapp/target/ishindig-webapp-0.1/WEB-INF/lib/commons-configuration-1.6.jar"
+ todir="${temp.dir}/${shindig.lib.dir}"/>
+ <copy overwrite="true" filtering="false"
+ file="${main.basedir}/ishindig-webapp/target/ishindig-webapp-0.1/WEB-INF/lib/dom4j-1.6.1.jar"
+ todir="${temp.dir}/${shindig.lib.dir}"/>
+ <copy overwrite="true" filtering="false"
+ file="${main.basedir}/ishindig-webapp/target/ishindig-webapp-0.1/WEB-INF/lib/javassist-3.4.ga.jar"
+ todir="${temp.dir}/${shindig.lib.dir}"/>
+ <copy overwrite="true" filtering="false"
+ file="${main.basedir}/ishindig-webapp/target/ishindig-webapp-0.1/WEB-INF/lib/jta-1.1.jar"
+ todir="${temp.dir}/${shindig.lib.dir}"/>
+ <copy overwrite="true" filtering="false"
+ file="${main.basedir}/ishindig-webapp/target/ishindig-webapp-0.1/WEB-INF/lib/h2-1.1.119.jar"
+ todir="${temp.dir}/${shindig.lib.dir}"/>
+ <copy overwrite="true" filtering="false"
+ file="${main.basedir}/ishindig-webapp/target/ishindig-webapp-0.1/WEB-INF/lib/mysql-connector-java-5.1.6.jar"
+ todir="${temp.dir}/${shindig.lib.dir}"/>
+
+
+
+
+ <!-- copy web.xml -->
+ <mkdir dir="${temp.dir}/${shindig.webinf.dir}"/>
+ <copy overwrite="true" filtering="false"
+ file="${shindig.webxml.file}"
+ todir="${temp.dir}/${shindig.webinf.dir}"/>
+
+ <!-- copy various resource files -->
+ <mkdir dir="${temp.dir}/${shindig.classes.dir}"/>
+ <copy overwrite="true" filtering="false"
+ file="${main.basedir}/ishindig-webapp/src/main/resources/AdminUser.hbm.xml"
+ todir="${temp.dir}/${shindig.classes.dir}"/>
+ <copy overwrite="true" filtering="false"
+ file="${main.basedir}/ishindig-webapp/src/main/resources/UILayout.hbm.xml"
+ todir="${temp.dir}/${shindig.classes.dir}"/>
+ <copy overwrite="true" filtering="true"
+ file="${main.basedir}/ishindig-webapp/target/ishindig-webapp-0.1/WEB-INF/classes/hibernate.cfg.xml"
+ todir="${temp.dir}/${shindig.classes.dir}"/>
+ <copy overwrite="true" filtering="false"
+ file="${main.basedir}/ishindig-webapp/src/main/resources/hibernate.properties"
+ todir="${temp.dir}/${shindig.classes.dir}"/>
+ <copy overwrite="true" filtering="false"
+ file="${main.basedir}/ishindig-webapp/src/main/resources/User.hbm.xml"
+ todir="${temp.dir}/${shindig.classes.dir}"/>
+ <copy overwrite="true" filtering="false"
+ file="${main.basedir}/ishindig-webapp/src/main/java/cgl/shindig/config/portal.xml"
+ todir="${temp.dir}/${shindig.classes.dir}"/>
+
+
+ <!-- copy oauth config file -->
+ <mkdir dir="${temp.dir}/${shindig.oauthcfg.dir}"/>
+ <copy overwrite="true" filtering="true"
+ file="${main.basedir}/config/${shindig.customizedconfig.dir}/${shindig.oauthcfg.file}"
+ tofile="${temp.dir}/${shindig.oauthcfg.dir}/${shindig.oauthcfg.file}">
+ <filterset>
+ <filter token="gadget.repo.base" value="${gadget.repo.base}"/>
+ </filterset>
+ </copy>
+
+ <!-- Zip up the WAR into the appropriate Tomcat server directory.
+ This is the "root" directory for the server. -->
+ <zip destfile="${catalina.home}/shindig/shindig-server.war" basedir="${temp.dir}" update="true"/>
+ <delete dir="${temp.dir}"/>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
+
Added: incubator/rave/donations/ogce-gadget-container/shindig/shindig-server-2.0.0.war
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/shindig/shindig-server-2.0.0.war?rev=1087520&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/rave/donations/ogce-gadget-container/shindig/shindig-server-2.0.0.war
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/rave/donations/ogce-gadget-container/shindig/web.xml
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/shindig/web.xml?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/shindig/web.xml (added)
+++ incubator/rave/donations/ogce-gadget-container/shindig/web.xml Fri Apr 1 00:29:22 2011
@@ -0,0 +1,275 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ id="Shindig"
+ version="2.5">
+ <display-name>Shindig</display-name>
+ <!-- configuration -->
+ <!-- If you have your own Guice module(s), put them here as a colon-separated list. -->
+ <!-- Note that any extras modules are optional -->
+ <context-param>
+ <param-name>guice-modules</param-name>
+ <param-value>
+ org.apache.shindig.common.PropertiesModule:
+ org.apache.shindig.gadgets.DefaultGuiceModule:
+ org.apache.shindig.social.core.config.SocialApiGuiceModule:
+ cgl.shindig.opensocial.GadgetContainerOSModule:
+ org.apache.shindig.gadgets.oauth.OAuthModule:
+ org.apache.shindig.common.cache.ehcache.EhCacheModule:
+ org.apache.shindig.sample.shiro.ShiroGuiceModule:
+ org.apache.shindig.sample.container.SampleContainerGuiceModule:
+ org.apache.shindig.extras.ShindigExtrasGuiceModule:
+ org.apache.shindig.extras.as.ActivityStreamsGuiceModule
+ </param-value>
+ </context-param>
+
+ <!--
+ Syntax: <key>=<value> separated by a newline
+
+ system.properties specifies the environmental variables that will be set to the JVM System Properties at server startup time.
+ Alternatively, you may add these values in your app server (ex: Tomcat) as
+ VM arguments like this: -Dshindig.host="my.production.shindig.server.com".
+
+ Here are a few properties that can be set for Shindig:
+ shindig.host: the server name that Shindig is deployed and running on
+ shindig.port: the port number of shindig.host server
+
+ Make sure you escape all HTML values for the web.xml to be parsed correctly.
+ -->
+ <context-param>
+ <param-name>system.properties</param-name>
+ <param-value>
+ aKey=/shindig/gadgets/proxy?container=default&url=
+ </param-value>
+ </context-param>
+
+ <filter>
+ <filter-name>ShiroFilter</filter-name>
+ <filter-class>org.apache.shiro.web.servlet.IniShiroFilter</filter-class>
+ <init-param>
+ <param-name>config</param-name>
+ <param-value>
+ # The ShiroFilter configuration is very powerful and flexible, while still remaining succinct.
+ # Please read the comprehensive example, with full comments and explanations, in the JavaDoc:
+ #
+ # http://www.jsecurity.org/api/org/jsecurity/web/servlet/JSecurityFilter.html
+ [main]
+ shindigSampleRealm = org.apache.shindig.sample.shiro.SampleShiroRealm
+ securityManager.realm = $shindigSampleRealm
+ authc.loginUrl = /login.jsp
+
+ [urls]
+ # The /login.jsp is not restricted to authenticated users (otherwise no one could log in!), but
+ # the 'authc' filter must still be specified for it so it can process that url's
+ # login submissions. It is 'smart' enough to allow those requests through as specified by the
+ # shiro.loginUrl above.
+ /login.jsp = authc
+
+ /oauth/authorize/** = authc
+
+ </param-value>
+ </init-param>
+ </filter>
+
+ <filter>
+ <filter-name>authFilter</filter-name>
+ <filter-class>org.apache.shindig.auth.AuthenticationServletFilter</filter-class>
+ </filter>
+
+
+ <filter-mapping>
+ <filter-name>ShiroFilter</filter-name>
+ <url-pattern>/oauth/authorize</url-pattern>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>ShiroFilter</filter-name>
+ <url-pattern>*.jsp</url-pattern>
+ </filter-mapping>
+
+ <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/api/rpc/*</url-pattern>
+ <url-pattern>/gadgets/api/rest/*</url-pattern>
+ <url-pattern>/rpc/*</url-pattern>
+ <url-pattern>/rest/*</url-pattern>
+ </filter-mapping>
+
+ <listener>
+ <listener-class>org.apache.shindig.common.servlet.GuiceServletContextListener</listener-class>
+ </listener>
+
+ <!-- Render a Gadget -->
+ <servlet>
+ <servlet-name>xml-to-html</servlet-name>
+ <servlet-class>
+ org.apache.shindig.gadgets.servlet.GadgetRenderingServlet
+ </servlet-class>
+ </servlet>
+
+ <servlet>
+ <servlet-name>accel</servlet-name>
+ <servlet-class>
+ org.apache.shindig.gadgets.servlet.HtmlAccelServlet
+ </servlet-class>
+ </servlet>
+
+ <!-- Proxy -->
+ <servlet>
+ <servlet-name>proxy</servlet-name>
+ <servlet-class>
+ org.apache.shindig.gadgets.servlet.ProxyServlet
+ </servlet-class>
+ </servlet>
+
+ <!-- makeRequest -->
+ <servlet>
+ <servlet-name>makeRequest</servlet-name>
+ <servlet-class>
+ org.apache.shindig.gadgets.servlet.MakeRequestServlet
+ </servlet-class>
+ </servlet>
+
+ <!-- Concat -->
+ <servlet>
+ <servlet-name>concat</servlet-name>
+ <servlet-class>
+ org.apache.shindig.gadgets.servlet.ConcatProxyServlet
+ </servlet-class>
+ </servlet>
+
+ <!-- OAuth callback -->
+ <servlet>
+ <servlet-name>oauthCallback</servlet-name>
+ <servlet-class>
+ org.apache.shindig.gadgets.servlet.OAuthCallbackServlet
+ </servlet-class>
+ </servlet>
+
+ <!-- Metadata RPC -->
+ <servlet>
+ <servlet-name>metadata</servlet-name>
+ <servlet-class>
+ org.apache.shindig.gadgets.servlet.RpcServlet
+ </servlet-class>
+ </servlet>
+
+ <!-- javascript serving -->
+ <servlet>
+ <servlet-name>js</servlet-name>
+ <servlet-class>org.apache.shindig.gadgets.servlet.JsServlet</servlet-class>
+ </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>
+
+ <!-- Serve sample OAuth apis -->
+ <servlet>
+ <servlet-name>sampleOAuth</servlet-name>
+ <servlet-class>
+ org.apache.shindig.social.sample.oauth.SampleOAuthServlet
+ </servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>js</servlet-name>
+ <url-pattern>/gadgets/js/*</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>proxy</servlet-name>
+ <url-pattern>/gadgets/proxy/*</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>makeRequest</servlet-name>
+ <url-pattern>/gadgets/makeRequest</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>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>
+
+ <servlet-mapping>
+ <servlet-name>oauthCallback</servlet-name>
+ <url-pattern>/gadgets/oauthcallback</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>xml-to-html</servlet-name>
+ <url-pattern>/gadgets/ifr</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>accel</servlet-name>
+ <url-pattern>/gadgets/accel</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>metadata</servlet-name>
+ <url-pattern>/gadgets/metadata</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>sampleOAuth</servlet-name>
+ <url-pattern>/oauth/*</url-pattern>
+ </servlet-mapping>
+</web-app>
Added: incubator/rave/donations/ogce-gadget-container/shutdown-tomcat.bat
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/shutdown-tomcat.bat?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/shutdown-tomcat.bat (added)
+++ incubator/rave/donations/ogce-gadget-container/shutdown-tomcat.bat Fri Apr 1 00:29:22 2011
@@ -0,0 +1,32 @@
+rem
+rem
+rem Licensed to the Apache Software Foundation (ASF) under one
+rem or more contributor license agreements. See the NOTICE file
+rem distributed with this work for additional information
+rem regarding copyright ownership. The ASF licenses this file
+rem to you under the Apache License, Version 2.0 (the
+rem "License"); you may not use this file except in compliance
+rem with the License. You may obtain a copy of the License at
+rem
+rem http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem Unless required by applicable law or agreed to in writing,
+rem software distributed under the License is distributed on an
+rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+rem KIND, either express or implied. See the License for the
+rem specific language governing permissions and limitations
+rem under the License.
+rem
+rem
+rem SHUTDOWN TOMCAT
+echo ####################################
+echo # Shutting down Portal Tomcat... #
+echo ####################################
+
+
+set pwd=%cd%
+cd portal_deploy\apache-tomcat-6.0.20\bin
+
+%pwd%\portal_deploy\apache-tomcat-6.0.20\bin\shutdown.bat /wait
+
+cd %pwd%
Added: incubator/rave/donations/ogce-gadget-container/shutdown-tomcat.sh
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/shutdown-tomcat.sh?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/shutdown-tomcat.sh (added)
+++ incubator/rave/donations/ogce-gadget-container/shutdown-tomcat.sh Fri Apr 1 00:29:22 2011
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+# SHUTDOWN TOMCAT
+echo "####################################"
+echo "# Shutting down Portal Tomcat... #"
+echo "####################################"
+
+
+`pwd`/portal_deploy/apache-tomcat-6.0.20/bin/shutdown.sh
Propchange: incubator/rave/donations/ogce-gadget-container/shutdown-tomcat.sh
------------------------------------------------------------------------------
svn:executable =
Added: incubator/rave/donations/ogce-gadget-container/shutdown-tomcat.sh.raw
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/shutdown-tomcat.sh.raw?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/shutdown-tomcat.sh.raw (added)
+++ incubator/rave/donations/ogce-gadget-container/shutdown-tomcat.sh.raw Fri Apr 1 00:29:22 2011
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+# SHUTDOWN TOMCAT
+echo "####################################"
+echo "# Shutting down Portal Tomcat... #"
+echo "####################################"
+
+
+`pwd`/portal_deploy/@portal.tomcat.dir@/bin/shutdown.sh
Propchange: incubator/rave/donations/ogce-gadget-container/shutdown-tomcat.sh.raw
------------------------------------------------------------------------------
svn:executable =
Added: incubator/rave/donations/ogce-gadget-container/startup-tomcat.bat
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/startup-tomcat.bat?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/startup-tomcat.bat (added)
+++ incubator/rave/donations/ogce-gadget-container/startup-tomcat.bat Fri Apr 1 00:29:22 2011
@@ -0,0 +1,38 @@
+@echo off
+rem
+rem
+rem Licensed to the Apache Software Foundation (ASF) under one
+rem or more contributor license agreements. See the NOTICE file
+rem distributed with this work for additional information
+rem regarding copyright ownership. The ASF licenses this file
+rem to you under the Apache License, Version 2.0 (the
+rem "License"); you may not use this file except in compliance
+rem with the License. You may obtain a copy of the License at
+rem
+rem http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem Unless required by applicable law or agreed to in writing,
+rem software distributed under the License is distributed on an
+rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+rem KIND, either express or implied. See the License for the
+rem specific language governing permissions and limitations
+rem under the License.
+rem
+rem
+
+rem SHUTDOWN TOMCAT before starting
+echo ####################################
+echo # Starting up Portal Tomcat... #
+echo ####################################
+
+set pwd=%cd%
+cd portal_deploy\apache-tomcat-6.0.20\bin
+
+rem %pwd%\portal_deploy\apache-tomcat-6.0.20\bin\shutdown.bat
+
+rem for SSL
+set CATALINA_OPTS=-Djavax.net.ssl.trustStore=%pwd%\portal_deploy\apache-tomcat-6.0.20\keystore\keystore
+
+start %pwd%\portal_deploy\apache-tomcat-6.0.20\bin\startup.bat $*
+
+cd "%pwd%"
Added: incubator/rave/donations/ogce-gadget-container/startup-tomcat.sh.raw
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/startup-tomcat.sh.raw?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/startup-tomcat.sh.raw (added)
+++ incubator/rave/donations/ogce-gadget-container/startup-tomcat.sh.raw Fri Apr 1 00:29:22 2011
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+unset DISPLAY
+unset CATALINA_HOME
+unset CATALINA_BASE
+
+# SHUTDOWN TOMCAT before starting
+echo "####################################"
+echo "# Starting up Portal Tomcat... #"
+echo "####################################"
+`pwd`/portal_deploy/@portal.tomcat.dir@/bin/shutdown.sh >& /dev/null
+sleep 3
+
+# for SSL
+export CATALINA_OPTS="${CATALINA_OPTS} -Djavax.net.ssl.trustStore=`pwd`/portal_deploy/@portal.tomcat.dir@/keystore/keystore"
+export CATALINA_OPTS="${CATALINA_OPTS} -Djavax.net.ssl.trustStorePassword=changeit"
+export CATALINA_OPTS="${CATALINA_OPTS} -Djavax.net.ssl.trustStoreType=jks"
+export CATALINA_OPTS="${CATALINA_OPTS} -Dsun.security.ssl.allowUnsafeRenegotiation=true"
+export CATALINA_OPTS="${CATALINA_OPTS} -Dshindig.host=@shindig.host@ -Dshindig.port=@shindig.port@"
+
+PRG="$0"
+PGRDIR=`dirname "$PRG"`
+PGRDIR=`cd "$PGRDIR" ; pwd`
+export CATALINA_OPTS="${CATALINA_OPTS} -Djava.security.auth.login.config=${PGRDIR}/@deploy.dir@/@portal.tomcat.dir@/conf/jaas.conf"
+
+
+# export CATALINA_OPTS=-Djavax.net.ssl.trustStore=/globalhome/zhguo/cilogon-keystore.p12
+#Java heap size
+JAVA_OPTS="$JAVA_OPTS -server -Xms512m -Xmx2048m -XX:MaxPermSize=512m"
+
+`pwd`/portal_deploy/@portal.tomcat.dir@/bin/startup.sh "$@"
+
+echo " "
+echo "The portal server has been started. Point your browser to @host.base.url@/ishindig-webapp."
+echo " "
+echo "Portal message and error logs can be read at `pwd`/portal_deploy/@portal.tomcat.dir@/logs/catalina.out"
+echo " "
Propchange: incubator/rave/donations/ogce-gadget-container/startup-tomcat.sh.raw
------------------------------------------------------------------------------
svn:executable =
Added: incubator/rave/donations/ogce-gadget-container/svn-commit.tmp
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/svn-commit.tmp?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/svn-commit.tmp (added)
+++ incubator/rave/donations/ogce-gadget-container/svn-commit.tmp Fri Apr 1 00:29:22 2011
@@ -0,0 +1,5 @@
+Initial import of cleaned up OGCE Gadget Container.
+
+--This line, and those below, will be ignored--
+
+A .
Added: incubator/rave/donations/ogce-gadget-container/third-party-gadgets/DiscussionBoard.html
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/third-party-gadgets/DiscussionBoard.html?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/third-party-gadgets/DiscussionBoard.html (added)
+++ incubator/rave/donations/ogce-gadget-container/third-party-gadgets/DiscussionBoard.html Fri Apr 1 00:29:22 2011
@@ -0,0 +1,33 @@
+<html>
+<body>
+<!-- Include the Google Friend Connect javascript library. -->
+<script type="text/javascript" src="http://www.google.com/friendconnect/script/friendconnect.js"></script>
+<!-- Define the div tag where the gadget will be inserted. -->
+<div id="div-3693037049777517384" style="width:282px;border:1px solid #cccccc;"></div>
+<!-- Render the gadget into a div. -->
+<script type="text/javascript">
+var skin = {};
+skin['BORDER_COLOR'] = '#cccccc';
+skin['ENDCAP_BG_COLOR'] = '#e0ecff';
+skin['ENDCAP_TEXT_COLOR'] = '#333333';
+skin['ENDCAP_LINK_COLOR'] = '#0000cc';
+skin['ALTERNATE_BG_COLOR'] = '#ffffff';
+skin['CONTENT_BG_COLOR'] = '#ffffff';
+skin['CONTENT_LINK_COLOR'] = '#0000cc';
+skin['CONTENT_TEXT_COLOR'] = '#333333';
+skin['CONTENT_SECONDARY_LINK_COLOR'] = '#7777cc';
+skin['CONTENT_SECONDARY_TEXT_COLOR'] = '#666666';
+skin['CONTENT_HEADLINE_COLOR'] = '#333333';
+skin['DEFAULT_COMMENT_TEXT'] = 'OGCE Container Comments';
+skin['HEADER_TEXT'] = 'OGCE Comments';
+skin['POSTS_PER_PAGE'] = '5';
+google.friendconnect.container.setParentUrl('/gadgets-repo/' /* location of rpc_relay.html and canvas.html */);
+google.friendconnect.container.renderWallGadget(
+ { id: 'div-3693037049777517384',
+ site: '@friendConnectSiteID@',
+ 'view-params':{"disableMinMax":"false","scope":"ID","features":"video,comment","docId":"gcomments","startMaximized":"true"}
+ },
+ skin);
+</script>
+</body>
+</html>
Added: incubator/rave/donations/ogce-gadget-container/third-party-gadgets/DiscussionBoard.xml
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/third-party-gadgets/DiscussionBoard.xml?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/third-party-gadgets/DiscussionBoard.xml (added)
+++ incubator/rave/donations/ogce-gadget-container/third-party-gadgets/DiscussionBoard.xml Fri Apr 1 00:29:22 2011
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Module>
+ <ModulePrefs
+ title="Discussion Board"
+ author_email="rsandhu1@gmail.com"
+ description="Open Social App for polargrid"
+ height="400">
+ <Require feature="opensocial-0.8" />
+ </ModulePrefs>
+<!--
+ <Content type="url" href="DiscussionBoard.html"></Content>
+-->
+ <Content type="html" view="home, canvas">
+<![CDATA[
+<html>
+<body>
+<!-- Include the Google Friend Connect javascript library. -->
+<script type="text/javascript" src="http://www.google.com/friendconnect/script/friendconnect.js"></script>
+<!-- Define the div tag where the gadget will be inserted. -->
+<div id="div-3693037049777517384" style="width:282px;border:1px solid #cccccc;"></div>
+<!-- Render the gadget into a div. -->
+<script type="text/javascript">
+var skin = {};
+skin['BORDER_COLOR'] = '#cccccc';
+skin['ENDCAP_BG_COLOR'] = '#e0ecff';
+skin['ENDCAP_TEXT_COLOR'] = '#333333';
+skin['ENDCAP_LINK_COLOR'] = '#0000cc';
+skin['ALTERNATE_BG_COLOR'] = '#ffffff';
+skin['CONTENT_BG_COLOR'] = '#ffffff';
+skin['CONTENT_LINK_COLOR'] = '#0000cc';
+skin['CONTENT_TEXT_COLOR'] = '#333333';
+skin['CONTENT_SECONDARY_LINK_COLOR'] = '#7777cc';
+skin['CONTENT_SECONDARY_TEXT_COLOR'] = '#666666';
+skin['CONTENT_HEADLINE_COLOR'] = '#333333';
+skin['DEFAULT_COMMENT_TEXT'] = 'OGCE Container Comments';
+skin['HEADER_TEXT'] = 'OGCE Comments';
+skin['POSTS_PER_PAGE'] = '5';
+google.friendconnect.container.setParentUrl('/gadgets-repo/' /* location of rpc_relay.html and canvas.html */);
+google.friendconnect.container.renderWallGadget(
+ { id: 'div-3693037049777517384',
+ site: '@friendConnectSiteID@',
+ 'view-params':{"disableMinMax":"false","scope":"ID","features":"video,comment","docId":"gcomments","startMaximized":"true"}
+ },
+ skin);
+</script>
+</body>
+</html>
+]]>
+</Content>
+</Module>
Added: incubator/rave/donations/ogce-gadget-container/third-party-gadgets/EmbeddedCalendar.xml
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/third-party-gadgets/EmbeddedCalendar.xml?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/third-party-gadgets/EmbeddedCalendar.xml (added)
+++ incubator/rave/donations/ogce-gadget-container/third-party-gadgets/EmbeddedCalendar.xml Fri Apr 1 00:29:22 2011
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Module>
+<ModulePrefs title="Google Calendar"
+ title_url="http://www.google.com/calendar/render"
+ height="400">
+<Require feature="setprefs"/>
+<Require feature="analytics"/>
+<Require feature="dynamic-height"/>
+</ModulePrefs>
+
+<Content type="html" view="home">
+<![CDATA[
+<center>
+<iframe src="http://www.google.com/calendar/embed?src=94f6mvur7c29ohvsuchvp1pnas%40group.calendar.google.com&ctz=America/New_York" style="border: 0" width="350" height="350" frameborder="0" scrolling="no"></iframe>
+</center>
+]]>
+</Content>
+
+<Content type="html" view="canvas">
+<![CDATA[
+<center>
+<iframe src="http://www.google.com/calendar/embed?src=94f6mvur7c29ohvsuchvp1pnas%40group.calendar.google.com&ctz=America/New_York" style="border: 0" width="800" height="500" frameborder="0" scrolling="no"></iframe>
+</center>
+]]>
+</Content>
+
+</Module>