rave-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zh...@apache.org
Subject svn commit: r1087520 [35/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...
Date Fri, 01 Apr 2011 00:29:38 GMT
Added: incubator/rave/donations/ogce-gadget-container/third-party-gadgets/twitter-contacts.xml
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/third-party-gadgets/twitter-contacts.xml?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/third-party-gadgets/twitter-contacts.xml (added)
+++ incubator/rave/donations/ogce-gadget-container/third-party-gadgets/twitter-contacts.xml Fri Apr  1 00:29:22 2011
@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<Module>
+  <ModulePrefs title="Google Contacts Gadget">
+
+  <Require feature="opensocial-0.8"/>
+
+  <OAuth>
+    <Service name="twitter">
+    <Access url="http://twitter.com/oauth/access_token" method="GET" /> 
+    <Request url="http://twitter.com/oauth/request_token" method="GET" />
+    <Authorization url="http://twitter.com/oauth/authorize" /> </Service>
+  </OAuth>
+
+  </ModulePrefs>
+  <Content type="html">
+  <![CDATA[
+    <style>
+    #main {
+        margin: 0px;
+        padding: 0px;
+        font-size: small;
+    }
+    </style>
+
+    <div id="main" style="display: none">
+      <textarea id="main_textarea" style="width:100%;height:100%;">
+      </textarea>
+    </div>
+
+    <div id="approval" style="display: none">
+      <img src="http://dirk.balfanz.googlepages.com/new.gif">
+      <a id="personalize"
+        onclick="javascript:showOneSection('waiting'); return true"
+        target="approve">Personalize this gadget</a>
+    </div>
+
+    <div id="waiting" style="display: none">
+      Please click
+      <a onclick="javascript:fetchData()">I've approved access</a>
+      once you've approved access to your data.
+    </div>
+
+    <script type="text/javascript">
+      function showOneSection(toshow) {
+        var sections = [ 'main', 'approval', 'waiting' ];
+        for (var i=0; i < sections.length; ++i) {
+          var s = sections[i];
+          var el = document.getElementById(s);
+          if (s === toshow) {
+            el.style.display = "block";
+          } else {
+            el.style.display = "none";
+          }
+        }
+      }
+
+      function showResults(result) {
+        var ele = document.getElementById('main_textarea');
+        if (ele != null) {
+          ele.value = result;
+        }
+        return;
+
+        showOneSection('main');
+
+        var titleElement = document.createElement('div');
+
+        var nameNode = document.createTextNode(result.feed.title.$t);
+
+        titleElement.appendChild(nameNode);
+
+        document.getElementById("main").appendChild(titleElement);
+        document.getElementById("main").appendChild(document.createElement("br"));
+
+        list = result.feed.entry;
+
+        for(var i = 0; i < list.length; i++) {
+
+          entry = list[i];
+
+          var divElement = document.createElement('div');
+          divElement.setAttribute('class', 'name');
+
+          var valueNode = document.createTextNode(entry.gd$email[0].address);
+
+          divElement.appendChild(nameNode);
+          divElement.appendChild(valueNode);
+
+          document.getElementById("main").appendChild(divElement);
+        }
+      }
+
+      function fetchData() {
+        var params = {};
+        // url = "http://www.google.com/m8/feeds/contacts/default/base?alt=json";
+        url = "http://twitter.com/statuses/friends_timeline.xml";
+        params[gadgets.io.RequestParameters.CONTENT_TYPE] = gadgets.io.ContentType.TEXT;
+        params[gadgets.io.RequestParameters.AUTHORIZATION] = gadgets.io.AuthorizationType.OAUTH;
+        params[gadgets.io.RequestParameters.OAUTH_SERVICE_NAME] = "twitter";
+        params[gadgets.io.RequestParameters.OAUTH_USE_TOKEN] = "always";
+        params["OWNER_SIGNED"] = false;
+        params["VIEWER_SIGNED"] = false;
+
+        params[gadgets.io.RequestParameters.METHOD] = gadgets.io.MethodType.GET;
+
+        gadgets.io.makeRequest(url, function (response) {
+          if (response.oauthApprovalUrl) {
+            var personalize = document.getElementById('personalize');
+            personalize.href = response.oauthApprovalUrl;
+            showOneSection('approval');
+          } else if (response.data) {
+            showOneSection('main');
+            showResults(response.data);
+          } else {
+	    errorStr = response.oauthErrorText;
+            var main = document.getElementById('main');
+            var wtf = document.createTextNode('Something went wrong: ' + errorStr);
+            if (main.firstChild != null)
+              main.insertBefore(wtf, main.firstChild);
+            else {
+              main.appendChild(wtf);
+            }
+            showOneSection('main');
+          }
+        }, params);
+      }
+
+      gadgets.util.registerOnLoadHandler(fetchData);
+    </script>
+        ]]>
+  </Content>
+</Module>

Added: incubator/rave/donations/ogce-gadget-container/third-party-gadgets/twitter.xml
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/third-party-gadgets/twitter.xml?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/third-party-gadgets/twitter.xml (added)
+++ incubator/rave/donations/ogce-gadget-container/third-party-gadgets/twitter.xml Fri Apr  1 00:29:22 2011
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" ?> 
+<Module> 
+<ModulePrefs
+    thumbnail="http://www.twittergadget.com/images/thumbnail2.png" 
+    screenshot="http://www.twittergadget.com/images/twittergadget2.jpg" 
+    title="TwitterGadget" 
+    title_url="http://www.twittergadget.com/" 
+    description="Fully functional, lightweight, AJAX-based twitter user interface with many configuration options including user specified auto-refresh rate, full timeline, pagination, and more.  Control display elements such as user thumbnails, date stamps, and post source.  Specify gadget size based on availble screen footprint, even incorporate into your Gmail account.  Insert symbols, dingbats and emoticons into your tweets using the TwitterGadget Symbols pulldown menu." 
+    scrolling="true" 
+    singleton="true" 
+    height="400"
+    author="LOGIKA Corporation" 
+    author_email="twittergadget@logika.net"     
+    author_aboutme="Internet technology company specializing in search and navigation, coding gurus."                    
+    
+>
+  <require feature="dynamic-height"/>
+  <require feature="settitle"/>
+</ModulePrefs>
+
+<Content type="url" href="http://www.twittergadget.com/gadget.asp" view="home,canvas"/>
+</Module> 

Added: incubator/rave/donations/ogce-gadget-container/third-party-gadgets/userPref_test.xml
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/third-party-gadgets/userPref_test.xml?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/third-party-gadgets/userPref_test.xml (added)
+++ incubator/rave/donations/ogce-gadget-container/third-party-gadgets/userPref_test.xml Fri Apr  1 00:29:22 2011
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Module>
+  <ModulePrefs 
+    title="User pref test"
+    directory_title="User pref Reader" 
+    render_inline="never"
+    scrolling="false"
+    description="User Preference test." 
+    author="Gerald Guo" 
+    author_email="zhguo@indiana.edu"
+    author_affiliation="Indiana University" 
+    author_location="Bloomington, IN"  >
+    <Require feature="setprefs"/>
+  </ModulePrefs>
+
+  <UserPref name="test" 
+    datatype="string"
+    default_value="Original value"
+    display_name="label" />
+  <Content type="html">
+    <![CDATA[
+    <script type="text/javascript">
+      function setPref() {
+        var prefs = new gadgets.Prefs();
+        prefs.set('test', 'hello, world');
+      }
+    </script>
+
+    <div>
+      <input type='button' value='set pref' onClick="setPref();">
+    </div>
+    ]]>
+  </Content>
+</Module>
+

Added: incubator/rave/donations/ogce-gadget-container/third-party-gadgets/xregistry.xml
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/third-party-gadgets/xregistry.xml?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/third-party-gadgets/xregistry.xml (added)
+++ incubator/rave/donations/ogce-gadget-container/third-party-gadgets/xregistry.xml Fri Apr  1 00:29:22 2011
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8" ?> 
+<Module>
+  <ModulePrefs title="RPC test"
+     title_url=""
+     description="A gadget to wrap xregistry"
+     height="250" 
+     screenshot=""
+     thumbnail=""
+     scrolling="true"
+     author="Gerald Guo"
+     author_affiliation="CGL, IU"
+     author_email="zhguo@indiana.edu" 
+     author_location="Innovation Center, IU"
+	 category="tools"
+     author_link=""
+     author_photo=""
+     author_aboutme=""
+     author_quote="" >
+    <Require feature="rpc"/>
+    <Require feature="dynamic-height"/>
+  </ModulePrefs>
+
+  <UserPref name="xregistry_url" datatype="string" 
+    default_value="/xregistryinterface/pages/Index.jsf"
+    display_name="Xregistry url" />
+
+  <Content type="html" view="home, canvas">
+     <![CDATA[
+     <script type="text/javascript">
+      function getUserInfoCB(msg) {
+        var obj = eval('('+msg+')');
+        var username = obj.username;
+
+        var prefs = new gadgets.Prefs();
+        var url = prefs.getString('xregistry_url');
+        if(url == null || url.indexOf("?") == -1)
+          url += "?"
+        url += "username=" + encodeURIComponent(username);
+        window.location = url;
+      }
+
+      function fetchInfoFromCt () {
+        gadgets.rpc.call("..", "getUserInfo", getUserInfoCB);
+      }
+
+      fetchInfoFromCt();
+    </script>
+    ]]>
+  </Content> 
+</Module>
+

Added: incubator/rave/donations/ogce-gadget-container/third-party-gadgets/youtubesearch.xml
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/third-party-gadgets/youtubesearch.xml?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/third-party-gadgets/youtubesearch.xml (added)
+++ incubator/rave/donations/ogce-gadget-container/third-party-gadgets/youtubesearch.xml Fri Apr  1 00:29:22 2011
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8" ?> 
+<Module>
+  <ModulePrefs title="Search YouTube"
+     title_url="http://youtube.com"
+     description="A search module, which searches YouTube by tags Politics News Life Music Family Photography Art Random Travel Personal Religion Movies Business Thoughts Media Humor Culture Poetry Christmas Writing Books Food Friends Video Entertainment Love Economy Christianity Technology Videos Events Health Faith Reviews Education Holidays Fashion Photos History Sports Blogging 2008 People Film Marketing Work Church Blog Design God Relationships Philosophy Environment School Musings Jesus Recipes Fun Christian Science Society Barack Obama Home Rants Pictures] Miscellaneous Iraq Theology Internet Games Opinion Fiction Inspiration Funny Random Thoughts Announcements Economics India Obama Nature Software Articles Human Rights Quotes Comedy Current Events Commentary Journal Children Review Shopping Islam Literature The Page Advertising Bible Crime Wonder Girls Parenting Television Me Government Ramblings Misc Links Blogs Holiday Community Reflections Research Spirituality Hi
 p-hop Women My Life Finance Interviews Journalism Photo TV Dating Democrats Israel Kids Anime Updates Canada Architecture Poems Social Media Corruption War World WTF INTERNATIONAL Animals Marriage Current Affairs Beauty Sex Daily life Club Penguin Cheats Law Depression Apple Rant Style Dreams WorDs Projects Lifestyle  free."
+     height="250" 
+     screenshot="http://www.zytu.com/youtube/youtubesearchscreen.png"
+     thumbnail="http://www.zytu.com/youtube/youtubesearchthumb.png"
+     scrolling="true"
+     author="David Olsen"
+     author_affiliation=""
+     author_email="chouhab@gmail.com" 
+     author_location="shouhab"
+	 category="tools"
+     author_link=""
+     author_photo=""
+     author_aboutme=""
+     author_quote=""
+>
+<Require feature="analytics"/>
+</ModulePrefs>	
+  <Content type="html">
+     <![CDATA[
+	<script type="text/javascript">
+var Statements = new Array(
+
+'<form name=\"yt\" action=\"http://sortr.com/youtube.php\" method=\"get\"><input type=\"text\" name=\"v\" size=\"20\" maxlength=\"20\" /><input type=\"hidden\" name=\"page\" value=\"1\"/></form>',
+'<form name=\"yt\" action=\"http://sortr.com/youtube.php\" method=\"get\"><input type=\"text\" name=\"v\" size=\"20\" maxlength=\"20\" /><input type=\"hidden\" name=\"page\" value=\"1\"/></form>',
+'<form name=\"yt\" action=\"http://sortr.com/youtube.php\" method=\"get\"><input type=\"text\" name=\"v\" size=\"20\" maxlength=\"20\" /><input type=\"hidden\" name=\"page\" value=\"1\"/></form>',
+'<form name=\"yt\" action=\"http://sortr.com/youtube.php\" method=\"get\"><input type=\"text\" name=\"v\" size=\"20\" maxlength=\"20\" /><input type=\"hidden\" name=\"page\" value=\"1\"/></form>',
+
+'<form name=\"yt\" action=\"http://sortr.com/youtube.php\" method=\"get\"><input type=\"text\" name=\"v\" size=\"20\" maxlength=\"20\" /><input type=\"hidden\" name=\"page\" value=\"1\"/></form>',
+
+'<form name=\"yt\" action=\"http://sortr.com/youtube.php\" method=\"get\"><input type=\"text\" name=\"v\" size=\"20\" maxlength=\"20\" /><input type=\"hidden\" name=\"page\" value=\"1\"/></form>',
+
+'<form name=\"yt\" action=\"http://sortr.com/youtube.php\" method=\"get\"><input type=\"text\" name=\"v\" size=\"20\" maxlength=\"20\" /><input type=\"hidden\" name=\"page\" value=\"1\"/></form>',
+
+'<form name=\"yt\" action=\"http://sortr.com/youtube.php\" method=\"get\"><input type=\"text\" name=\"v\" size=\"20\" maxlength=\"20\" /><input type=\"hidden\" name=\"page\" value=\"1\"/></form>'
+
+);
+
+function GetStatement(outputtype) //modified by javascriptkit.com to either write out result or set innerHTML prop
+{
+	if(++Number > Statements.length - 1) Number = 0;
+	if (outputtype==0)
+	document.write(Statements[Number])
+	else if (document.getElementById)
+	document.getElementById("ponder").innerHTML=Statements[Number];
+}
+
+function GetRandomNumber(lbound, ubound) 
+{
+	return (Math.floor(Math.random() * (ubound - lbound)) + lbound);
+}
+
+var Number = GetRandomNumber(0, Statements.length - 1);
+
+</script>
+	<style>
+	form {display: inline;}
+	img {vertical-align: middle}
+	</style>
+	
+	<img src="http://hosting.gmodules.com/ig/gadgets/file/118163833077303799558/youtube_logo.png" alt="" />
+	<!--<img src="http://www.throttled.org/images/youtube_logo.png" alt="" />-->
+ 	<!--<img src="http://www.izytu.com/social_gadgets/images/youtube_logo.png" alt="" />-->
+ 	<script type="text/javascript">
+
+GetStatement(0)
+_IG_Analytics("UA-193144-3", "/youtube");
+</script>
+	<center><br><br><br><br><br>
+	
+
+</script>
+<!--
+<script type="text/javascript"
+src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
+</script>
+-->	
+
+<!--	
+	<br>
+	<iframe src="http://remiseenforme.blogspot.com/" scrolling="no" frameborder="0" width="99%" height="40px"></iframe>
+-->
+	<!--<font size="2"><a href="http://hybrid1.onlinedegreeatwaldenu.com/?s_id=9686&bid=117&aid=CD39&opt=" target="_blank">Online Masters Degree</a></font>
+	<font size="2"><a href="http://www.google.com/ig/directory?q=wikipedia&hl=en&root=%2Fig&dpos=top&url=zytu.com.googlepages.com/wikipedia.xml" target=_blank>Add Wikipedia Search</a>-->
+	</center>
+
+     ]]>
+  </Content> 
+</Module>

Added: incubator/rave/donations/ogce-gadget-container/tomcat-config/Catalina/localhost/ROOT.xml
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/tomcat-config/Catalina/localhost/ROOT.xml?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/tomcat-config/Catalina/localhost/ROOT.xml (added)
+++ incubator/rave/donations/ogce-gadget-container/tomcat-config/Catalina/localhost/ROOT.xml Fri Apr  1 00:29:22 2011
@@ -0,0 +1,29 @@
+<?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.
+
+-->
+
+<Context
+    path=""
+    docBase="../shindig/shindig-server.war"
+    debug="0"
+    reloadable="true">
+</Context>
+

Added: incubator/rave/donations/ogce-gadget-container/tomcat-config/bin/startup.sh
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/tomcat-config/bin/startup.sh?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/tomcat-config/bin/startup.sh (added)
+++ incubator/rave/donations/ogce-gadget-container/tomcat-config/bin/startup.sh Fri Apr  1 00:29:22 2011
@@ -0,0 +1,67 @@
+#!/bin/sh
+
+# 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.
+
+# -----------------------------------------------------------------------------
+# Start Script for the CATALINA Server
+#
+# $Id: startup.sh 562770 2007-08-04 22:13:58Z markt $
+# -----------------------------------------------------------------------------
+
+# Better OS/400 detection: see Bugzilla 31132
+os400=false
+darwin=false
+case "`uname`" in
+CYGWIN*) cygwin=true;;
+OS400*) os400=true;;
+Darwin*) darwin=true;;
+esac
+
+# resolve links - $0 may be a softlink
+PRG="$0"
+
+while [ -h "$PRG" ] ; do
+  ls=`ls -ld "$PRG"`
+  link=`expr "$ls" : '.*-> \(.*\)$'`
+  if expr "$link" : '/.*' > /dev/null; then
+    PRG="$link"
+  else
+    PRG=`dirname "$PRG"`/"$link"
+  fi
+done
+ 
+PRGDIR=`dirname "$PRG"`
+EXECUTABLE=catalina.sh
+
+# Check that target executable exists
+if $os400; then
+  # -x will Only work on the os400 if the files are: 
+  # 1. owned by the user
+  # 2. owned by the PRIMARY group of the user
+  # this will not work if the user belongs in secondary groups
+  eval
+else
+  if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
+    echo "Cannot find $PRGDIR/$EXECUTABLE"
+    echo "This file is needed to run this program"
+    exit 1
+  fi
+fi 
+
+CATALINA_OPTS="-Xmx1024m -XX:MaxPermSize=512m $CATALINA_OPTS"
+JAVA_OPTS="$JAVA_OPTS -server -Xms512m -Xmx2048m -XX:MaxPermSize=512m"
+
+exec "$PRGDIR"/"$EXECUTABLE" start "$@"

Propchange: incubator/rave/donations/ogce-gadget-container/tomcat-config/bin/startup.sh
------------------------------------------------------------------------------
    svn:executable = 

Added: incubator/rave/donations/ogce-gadget-container/tomcat-config/conf/catalina.properties
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/tomcat-config/conf/catalina.properties?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/tomcat-config/conf/catalina.properties (added)
+++ incubator/rave/donations/ogce-gadget-container/tomcat-config/conf/catalina.properties Fri Apr  1 00:29:22 2011
@@ -0,0 +1,81 @@
+# 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.
+
+#
+# List of comma-separated packages that start with or equal this string
+# will cause a security exception to be thrown when
+# passed to checkPackageAccess unless the
+# corresponding RuntimePermission ("accessClassInPackage."+package) has
+# been granted.
+package.access=sun.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.,sun.beans.
+#
+# List of comma-separated packages that start with or equal this string
+# will cause a security exception to be thrown when
+# passed to checkPackageDefinition unless the
+# corresponding RuntimePermission ("defineClassInPackage."+package) has
+# been granted.
+#
+# by default, no packages are restricted for definition, and none of
+# the class loaders supplied with the JDK call checkPackageDefinition.
+#
+package.definition=sun.,java.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.
+
+#
+#
+# List of comma-separated paths defining the contents of the "common" 
+# classloader. Prefixes should be used to define what is the repository type.
+# Path may be relative to the CATALINA_HOME or CATALINA_BASE path or absolute.
+# If left as blank,the JVM system loader will be used as Catalina's "common" 
+# loader.
+# Examples:
+#     "foo": Add this folder as a class repository
+#     "foo/*.jar": Add all the JARs of the specified folder as class 
+#                  repositories
+#     "foo/bar.jar": Add bar.jar as a class repository
+common.loader=${catalina.home}/lib,${catalina.home}/lib/*.jar,${catalina.home}/shared/lib/*.jar
+
+#
+# List of comma-separated paths defining the contents of the "server" 
+# classloader. Prefixes should be used to define what is the repository type.
+# Path may be relative to the CATALINA_HOME or CATALINA_BASE path or absolute.
+# If left as blank, the "common" loader will be used as Catalina's "server" 
+# loader.
+# Examples:
+#     "foo": Add this folder as a class repository
+#     "foo/*.jar": Add all the JARs of the specified folder as class 
+#                  repositories
+#     "foo/bar.jar": Add bar.jar as a class repository
+server.loader=
+
+#
+# List of comma-separated paths defining the contents of the "shared" 
+# classloader. Prefixes should be used to define what is the repository type.
+# Path may be relative to the CATALINA_BASE path or absolute. If left as blank,
+# the "common" loader will be used as Catalina's "shared" loader.
+# Examples:
+#     "foo": Add this folder as a class repository
+#     "foo/*.jar": Add all the JARs of the specified folder as class 
+#                  repositories
+#     "foo/bar.jar": Add bar.jar as a class repository 
+# Please note that for single jars, e.g. bar.jar, you need the URL form
+# starting with file:.
+shared.loader==${catalina.home}/shared/lib,${catalina.home}/shared/lib/*.jar 
+
+#
+# String cache configuration.
+tomcat.util.buf.StringCache.byte.enabled=true
+#tomcat.util.buf.StringCache.char.enabled=true
+#tomcat.util.buf.StringCache.trainThreshold=500000
+#tomcat.util.buf.StringCache.cacheSize=5000

Added: incubator/rave/donations/ogce-gadget-container/tomcat-config/jaas.conf
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/tomcat-config/jaas.conf?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/tomcat-config/jaas.conf (added)
+++ incubator/rave/donations/ogce-gadget-container/tomcat-config/jaas.conf Fri Apr  1 00:29:22 2011
@@ -0,0 +1,6 @@
+
+CertBasedCustomLogin {
+    cgl.shindig.security.CertBasedLoginModule
+    sufficient;
+};
+

Added: incubator/rave/donations/ogce-gadget-container/tomcat-config/pom.xml
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/tomcat-config/pom.xml?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/tomcat-config/pom.xml (added)
+++ incubator/rave/donations/ogce-gadget-container/tomcat-config/pom.xml Fri Apr  1 00:29:22 2011
@@ -0,0 +1,181 @@
+<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.tomcat</groupId>
+  <artifactId>tomcat-config</artifactId>
+  <packaging>pom</packaging>
+  <version>1.0</version>
+  <name>tomcat-config</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>proxymanager-api</groupId>
+       <artifactId>proxymanager-api</artifactId>
+       <version>4.2</version>
+     </dependency>
+     <dependency>
+       <groupId>javax.portlet</groupId>
+       <artifactId>portlet-api</artifactId>
+       <version>1.0</version>
+     </dependency>  
+     <dependency>
+       <groupId>commons-codec</groupId>
+       <artifactId>commons-codec</artifactId>
+       <version>1.3</version>
+       <type>jar</type>
+     </dependency>
+     <dependency>
+       <groupId>commons-logging</groupId>
+       <artifactId>commons-logging</artifactId>
+       <version>1.1.1</version>
+     </dependency>
+     <dependency>
+       <groupId>commons-fileupload</groupId>
+       <artifactId>commons-fileupload</artifactId>
+       <version>1.2.1</version>
+       <type>jar</type>
+     </dependency> 
+     <dependency>
+       <groupId>commons-collections</groupId>
+       <artifactId>commons-collections</artifactId>
+       <version>3.1</version>
+     </dependency>
+     <dependency>
+       <groupId>commons-digester</groupId>
+       <artifactId>commons-digester</artifactId>
+       <version>1.8</version>
+     </dependency>
+     <dependency>
+       <groupId>commons-el</groupId>
+       <artifactId>commons-el</artifactId>
+       <version>1.0</version>
+     </dependency>
+     <dependency>
+       <groupId>commons-lang</groupId>
+       <artifactId>commons-lang</artifactId>
+       <version>2.4</version>
+     </dependency>
+   </dependencies>
+  
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>Update the xml files as necessary</id>
+            <phase>install</phase>
+            <configuration>
+              <tasks>
+					 <!-- 
+							Overwrite this so that we can use alternative ports (7005, 7070, 7443). We 
+							will also enable SSL. 
+						-->
+                <copy overwrite="true" filtering="true"
+                  file="server.xml"
+                  todir="${catalina.home}/conf/">
+                  <filterset>
+                    <filter token="clientAuth" value="${clientAuth}"/>
+                  </filterset>
+                </copy>
+
+					 <!-- TODO: This may be obsolete. -->
+                <copy overwrite="true" filtering="true"
+                  file="tomcat-users.xml"
+                  todir="${catalina.home}/conf/">
+                </copy>
+					 
+					 <!--For OSG? -->
+                <copy overwrite="true" filtering="false"
+                  file="jaas.conf"
+                  todir="${catalina.home}/conf/">
+                </copy>
+
+					 <!-- Here we are going to override the default tomcat ROOT -->
+					 <!-- See http://svn.apache.org/repos/asf/shindig/trunk/java/README -->
+					 <!-- See also http://cglreport.zhenhua.info/2009/02/shindig-server-on-tomcat.html -->
+                <copy overwrite="true" filtering="true"
+                  file="Catalina/localhost/ROOT.xml"
+                  todir="${catalina.home}/conf/Catalina/localhost/">
+                </copy>
+              </tasks>
+            </configuration>
+            <goals>
+              <goal>run</goal>
+            </goals>
+          </execution>
+        </executions>       
+      </plugin>
+        <plugin>
+         <groupId>org.apache.maven.plugins</groupId>
+         <artifactId>maven-dependency-plugin</artifactId>
+         <version>2.1</version>
+         <executions>
+           <execution>
+             <id>copy-dependencies</id>
+             <phase>install</phase>
+             <goals>
+               <goal>copy-dependencies</goal>
+             </goals>
+             <configuration>
+               <outputDirectory>${catalina.home}/shared/lib</outputDirectory>
+               <overWriteReleases>false</overWriteReleases>
+               <overWriteSnapshots>true</overWriteSnapshots>
+             </configuration>
+           </execution>
+         </executions>
+       </plugin>
+
+       <plugin>
+         <groupId>org.apache.maven.plugins</groupId>
+         <artifactId>maven-resources-plugin</artifactId>
+         <version>2.4.3</version>
+         <executions>
+            <execution>
+             <id>copy-catalina-conf</id>
+             <phase>install</phase>
+             <goals>
+               <goal>copy-resources</goal>
+             </goals>
+             <configuration>
+             <outputDirectory>${catalina.home}/conf</outputDirectory>
+               <resources>
+                 <resource>
+                   <directory>${basedir}/conf</directory>
+                   <filtering>true</filtering>
+                 </resource>
+               </resources>
+           </configuration>
+           </execution>
+           <execution>
+             <id>copy-catalina-bin</id>
+             <phase>install</phase>
+             <goals>
+               <goal>copy-resources</goal>
+             </goals>
+             <configuration>
+             <outputDirectory>${catalina.home}/bin</outputDirectory>
+               <resources>
+                 <resource>
+                   <directory>${basedir}/bin</directory>
+                   <filtering>true</filtering>
+                 </resource>
+               </resources>
+           </configuration>
+           </execution> 
+	      </executions>
+       </plugin>
+    </plugins>
+  </build>
+</project>
+

Added: incubator/rave/donations/ogce-gadget-container/tomcat-config/server.xml
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/tomcat-config/server.xml?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/tomcat-config/server.xml (added)
+++ incubator/rave/donations/ogce-gadget-container/tomcat-config/server.xml Fri Apr  1 00:29:22 2011
@@ -0,0 +1,149 @@
+<?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.
+-->
+<!-- Note:  A "Server" is not itself a "Container", so you may not
+     define subcomponents such as "Valves" at this level.
+     Documentation at /docs/config/server.html
+ -->
+<Server port="7005" shutdown="SHUTDOWN">
+
+  <!--APR library loader. Documentation at /docs/apr.html -->
+  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
+  <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
+  <Listener className="org.apache.catalina.core.JasperListener" />
+  <!-- JMX Support for the Tomcat server. Documentation at /docs/non-existent.html -->
+  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
+  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
+
+  <!-- Global JNDI resources
+       Documentation at /docs/jndi-resources-howto.html
+  -->
+  <GlobalNamingResources>
+    <!-- Editable user database that can also be used by
+         UserDatabaseRealm to authenticate users
+    -->
+    <Resource name="UserDatabase" auth="Container"
+              type="org.apache.catalina.UserDatabase"
+              description="User database that can be updated and saved"
+              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
+              pathname="conf/tomcat-users.xml" />
+  </GlobalNamingResources>
+
+  <!-- A "Service" is a collection of one or more "Connectors" that share
+       a single "Container" Note:  A "Service" is not itself a "Container", 
+       so you may not define subcomponents such as "Valves" at this level.
+       Documentation at /docs/config/service.html
+   -->
+  <Service name="Catalina">
+  
+    <!--The connectors can use a shared executor, you can define one or more named thread pools-->
+    <!--
+    <Executor name="tomcatThreadPool" namePrefix="catalina-exec-" 
+        maxThreads="150" minSpareThreads="4"/>
+    -->
+    
+    
+    <!-- A "Connector" represents an endpoint by which requests are received
+         and responses are returned. Documentation at :
+         Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
+         Java AJP  Connector: /docs/config/ajp.html
+         APR (HTTP/AJP) Connector: /docs/apr.html
+         Define a non-SSL HTTP/1.1 Connector on port 7070
+    -->
+    <Connector port="7070" protocol="HTTP/1.1" 
+               connectionTimeout="20000" 
+               redirectPort="7443" />
+    <!-- A "Connector" using the shared thread pool-->
+    <!--
+    <Connector executor="tomcatThreadPool"
+               port="7070" protocol="HTTP/1.1" 
+               connectionTimeout="20000" 
+               redirectPort="7443" />
+    -->           
+    <!-- Define a SSL HTTP/1.1 Connector on port 7443
+         This connector uses the JSSE configuration, when using APR, the 
+         connector should be using the OpenSSL style configuration
+         described in the APR documentation -->
+
+    <Connector port="7443" protocol="HTTP/1.1" SSLEnabled="true"
+               maxThreads="150" scheme="https" secure="true"
+               clientAuth="@clientAuth@" sslProtocol="TLS"
+               keystoreFile="keystore/keystore"
+               keystorePass="changeit"
+               keyAlias="ogce-gadget-portal" />
+
+
+    <!-- Define an AJP 1.3 Connector on port 7009 -->
+    <Connector port="7009" protocol="AJP/1.3" redirectPort="7443" />
+
+
+    <!-- An Engine represents the entry point (within Catalina) that processes
+         every request.  The Engine implementation for Tomcat stand alone
+         analyzes the HTTP headers included with the request, and passes them
+         on to the appropriate Host (virtual host).
+         Documentation at /docs/config/engine.html -->
+
+    <!-- You should set jvmRoute to support load-balancing via AJP ie :
+    <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">         
+    --> 
+    <Engine name="Catalina" defaultHost="localhost">
+
+      <!--For clustering, please take a look at documentation at:
+          /docs/cluster-howto.html  (simple how to)
+          /docs/config/cluster.html (reference documentation) -->
+      <!--
+      <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
+      -->        
+
+      <!-- The request dumper valve dumps useful debugging information about
+           the request and response data received and sent by Tomcat.
+           Documentation at: /docs/config/valve.html -->
+      <!--
+      <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
+      -->
+
+      <!-- This Realm uses the UserDatabase configured in the global JNDI
+           resources under the key "UserDatabase".  Any edits
+           that are performed against this UserDatabase are immediately
+           available for use by the Realm.  -->
+      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
+             resourceName="UserDatabase"/>
+
+      <!-- Define the default virtual host
+           Note: XML Schema validation will not work with Xerces 2.2.
+       -->
+      <Host name="localhost"  appBase="webapps"
+            unpackWARs="true" autoDeploy="true"
+            xmlValidation="false" xmlNamespaceAware="false">
+
+        <!-- SingleSignOn valve, share authentication between web applications
+             Documentation at: /docs/config/valve.html -->
+        <!--
+        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
+        -->
+
+        <!-- Access log processes all example.
+             Documentation at: /docs/config/valve.html -->
+        <!--
+        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"  
+               prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/>
+        -->
+
+      </Host>
+    </Engine>
+  </Service>
+</Server>

Added: incubator/rave/donations/ogce-gadget-container/tomcat-config/tomcat-users.xml
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/tomcat-config/tomcat-users.xml?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/tomcat-config/tomcat-users.xml (added)
+++ incubator/rave/donations/ogce-gadget-container/tomcat-config/tomcat-users.xml Fri Apr  1 00:29:22 2011
@@ -0,0 +1,30 @@
+<?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.
+
+-->
+
+<tomcat-users>
+  <role rolename="tomcat"/>
+  <role rolename="role1"/>
+  <user username="gadgetboss" password="gadgetboss" roles="manager,admin"/>
+  <user username="tomcat" password="tomcat" roles="tomcat"/>
+  <user username="both" password="tomcat" roles="tomcat,role1"/>
+  <user username="role1" password="tomcat" roles="role1"/>
+</tomcat-users>

Added: incubator/rave/donations/ogce-gadget-container/tools/cssprocess.py
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/tools/cssprocess.py?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/tools/cssprocess.py (added)
+++ incubator/rave/donations/ogce-gadget-container/tools/cssprocess.py Fri Apr  1 00:29:22 2011
@@ -0,0 +1,445 @@
+#!/usr/bin/env python
+#
+#
+# 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.
+#
+#
+# -*- coding: utf-8 -*-
+
+"""
+Two main functionalities:
+    1) change color value in css files
+    If the color is not represented numerically (e.g. #fff, #ffffff), it will
+    not be handled. In other words, css rule "color: black" is not handled.
+    2) Adjust relative references to images.
+        For example: url("images/default/logo.png") may be changed to
+                     url("images/newtheme/logo.png").
+
+Prerequisites
+    Following python packages are needed:
+        cssutils
+
+Usage:
+    python cssprocess.py -r deltaR -g deltaG -b deltaB -t newthemename cssFileName
+
+    newthemename: name of the new theme. The resultant css file will be named
+                  <newthemename>.css
+    cssFileName: name of the css file to be processed.
+    -r, -g, -b: color difference in each channel (red, green, blue).
+
+"""
+
+import cssutils
+import string
+import re
+import random
+import sys
+from optparse import OptionParser
+
+
+class ColorTweakerUtil:
+    @staticmethod
+    def colors2Html(coloriter):
+        html = ""
+        totalwidth=800
+        padding=10
+        width = 40
+        height = 40
+        cumwidth = 0
+        for color in coloriter:
+            if cumwidth + width > totalwidth:
+                html += '<div style="clear:both;">'
+                html += '\n'
+                cumwidth = 0
+            cumwidth += (width + padding);
+            html += '<div style="float:left;background-color:\
+                    %s;width:%dpx;height:%dpx;\
+                    margin-right:%dpx"></div>'%(color, width, height, padding)
+            html += '\n'
+        return html
+
+    @staticmethod
+    def applyNewColors(colorRules, sheet, debug=False):
+        for colorRule in colorRules:
+            oldcolor = colorRule.color
+            newcolor = colorRule.newColor;
+            if newcolor is None:
+                continue
+
+            if debug:
+                print 'old color:%s; new color:%s'%(oldcolor, newcolor)
+
+            for (idx, index) in enumerate(colorRule.index):
+                propName = colorRule.propName[idx]
+                rule = sheet.cssRules.item(index)
+                property = rule.style.getProperty(propName)
+                currentvalue = property.cssValue.cssText
+                property.cssValue.cssText = currentvalue.replace(oldcolor, newcolor)
+
+        return colorRules
+
+    @staticmethod
+    def colorRuleList2Html(colorRules):
+        html = ""
+        totalwidth=800
+        padding=10
+        width = 40
+        height = 40
+        cumwidth = 0
+        for colorRule in colorRules:
+            color = colorRule.color
+            selectors = colorRule.selectors
+            selectors = ' '.join(selectors)
+
+            if cumwidth + width > totalwidth:
+                html += '<div style="clear:both;">'
+                html += '\n'
+                cumwidth = 0
+            cumwidth += (width + padding);
+            html += '<div OnMouseOver="javascript:alert(&quot;%s&quot;);" \
+                    style="float:left;background-color:%s;width:%dpx;\
+                    height:%dpx;margin-right:%dpx"></div>'%(selectors, color, width, height, padding)
+            html += '\n'
+
+        return html
+
+
+class ColorRule(object):
+    """"""
+    def __init__(self):
+        self._selectors = []
+        self._color = None
+        self._index = []
+        self._propName = []
+        self._newColor = None
+
+    def addEntry(self, selector, index, propName):
+        self.index.append(index)
+        self.propName.append(propName)
+        if isinstance(selector, unicode):
+            self.addSelector(selector)
+        elif isinstance(selector, list):
+            self.addSelectors(selector)
+        else:
+            print "Unrecognized selector parameter:%s"%selector
+
+    def addSelector(self, selector):
+        self._selectors.append(selector)
+
+    def addSelectors(self, selectors):
+        self._selectors.extend(selectors)
+
+
+    @property
+    def selectors(self):
+        return self._selectors
+
+    def getColor(self):
+        return self._color
+
+    def setColor(self, color):
+        self._color = color
+
+    def getNewColor(self):
+        return self._newColor
+
+    def setNewColor(self, newcolor):
+        self._newColor = newcolor
+
+    def getIndex(self):
+        return self._index
+
+    def setIndex(self, index):
+        self._index = index
+
+    def getPropName(self):
+        return self._propName
+
+    def setPropName(self, propName):
+        self._propName = propName
+
+    newColor = property(getNewColor, setNewColor)
+    color = property(getColor, setColor)
+    index = property(getIndex, setIndex)
+    propName = property(getPropName, setPropName)
+
+
+class ColorRuleList(object):
+    def __init__(self):
+        self._colorRules = []
+
+    @property
+    def colorRules(self):
+        return self._colorRules
+
+    def addARule(self, color, selectors, index, propName):
+        for colorRule in self.colorRules:
+            acolor = colorRule.color
+            if acolor == color:
+                colorRule.addEntry(selectors, index, propName)
+                return
+        colorRule = ColorRule()
+        colorRule.color = color
+        colorRule.addEntry(selectors, index, propName)
+        self.colorRules.append(colorRule)
+
+    def changeColor(oldcolor, newcolor):
+        for colorRule in self.colorRules:
+            color = colorRule.color
+            if oldcolor == color:
+                colorRule.newColor = newcolor
+                return
+        print "Could not find color: %s"%oldcolor
+
+    def randomChangeColors(self):
+        for colorRule in self.colorRules:
+            # color = colorRule.color
+            red = random.randint(0, 0xff)
+            green = random.randint(0, 0xff)
+            blue = random.randint(0, 0xff)
+            colorRule.newColor = "#%02x%02x%02x"%(red, green, blue)
+
+    def offsetChangeColors(self, offsets):
+        for colorRule in self.colorRules:
+            color = colorRule.color
+            m = re.search("([a-zA-Z0-9]+)", color)
+            color = m.group(0)
+            if len(color) == 3:
+                color = int(color, 16)
+                (redo, greeno, blueo) = \
+                    ((color & 0xf00) >> 8, (color & 0x0f0) >> 4, (color & 0x00f))
+                (redo, greeno, blueo) = (redo*0xff/0xf, greeno*0xff/0xf, blueo*0xff/0xf)
+            elif len(color) == 6:
+                color = int(color, 16)
+                (redo, greeno, blueo) = \
+                    ((color & 0xff0000) >> 16, (color & 0x00ff00) >> 8, (color & 0x0000ff))
+            else:
+                continue
+
+            (redn, greenn, bluen) = offsets
+            (redn, greenn, bluen) = (redo+redn, greeno+greenn, blueo+bluen)
+
+            check = lambda x: \
+                0xff if x > 0xff else 0 if x <0 else x
+                # x-0xff if x > 0xff else -x if x < 0 else x
+
+            (redn, greenn, bluen) = (check(redn), check(greenn), check(bluen))
+            colorRule.newColor = "#%02x%02x%02x"%(redn, greenn, bluen)
+
+    def __iter__(self):
+        for colorRule in self.colorRules:
+            yield colorRule
+
+
+class CSSColorTweaker:
+    @staticmethod
+    def parseCSSColors (cssFile, themename):
+        """ parse css file and extracts css rules """
+        sheet = cssutils.parseFile(cssFile)
+        colorRules = ColorRuleList()
+        count = 0
+        idx = -1
+        colorset = set([])
+
+        colorpat = re.compile(r"(#[a-zA-Z0-9]+)\b")
+        imgurlpat = re.compile(r"(.*url\W*\(\.\./images/)default(/.*)")
+
+        for rule in sheet:
+            idx += 1
+            if rule.type == rule.STYLE_RULE:
+                selectorList = rule.selectorList
+                selectors = []
+                for cssselector in selectorList:
+                    selectors.append(cssselector.selectorText)
+
+                for property in rule.style:
+                    value = property.value
+                    name = property.name
+                    value = imgurlpat.sub(r"\1%s\2"%themename, value)
+                    property.value = value
+                    m = colorpat.findall(value)
+                    for v in m:
+                        colorRules.addARule(v, selectors, idx, name)
+                        colorset.add(v)
+                        count += 1
+            else:
+                print "rule type is %d, it is skipped."%rule.type
+
+        return (sheet, colorset, colorRules)
+
+    @classmethod
+    def tweak(cls, cssFileName, newtheme, debug=False, strategy=1,
+            cssoverrides=""):
+        (sheet, colorset, colorRules) = cls.parseCSSColors(cssFileName, newtheme)
+        if debug:
+            print "All colors in the css file %s"%cssFileName
+            print colorset
+            print "Number of colors:%d\n"%len(colorset)
+            colorHtmlFileName = "%s.colorlist.html"%cssFileName
+
+            # html = ColorTweakerUtil.colors2Html(colorset)
+            # colorHtmlFile = open(colorHtmlFileName, "w")
+            # colorHtmlFile.write(html);
+
+            html = ColorTweakerUtil.colorRuleList2Html(colorRules)
+            colorHtmlFile = open(colorHtmlFileName, "w")
+            colorHtmlFile.write(html);
+
+        newCssFileName = "%s.css"%newtheme
+
+        if strategy == 0:
+            colorRules.randomChangeColors()
+            ColorTweakerUtil.applyNewColors(colorRules, sheet)
+            html = sheet.cssText
+            colorHtmlFile = open(newCssFileName, "w")
+            colorHtmlFile.write(html);
+            colorHtmlFile.write(cssoverrides);
+            print "A new css file is generated:%s"%newCssFileName
+
+        elif strategy == 1:
+            # offsets = [0x1, -0x72, -0xC6]
+            # offsets = [0x3C, -0x06, -0x50]
+            # offsets = [0x3C, -0x25, -0xC0]
+            offsets = [0x1D, -0x63, -0xCF]
+            colorRules.offsetChangeColors(offsets)
+            ColorTweakerUtil.applyNewColors(colorRules, sheet)
+            html = sheet.cssText
+            colorHtmlFile = open(newCssFileName, "w")
+            colorHtmlFile.write(html);
+            colorHtmlFile.write(cssoverrides);
+            print "A new css file is generated:%s"%newCssFileName
+
+
+def optionparse(argv=None):
+    if argv is None:
+        argv = sys.argv
+    usage = "usage: %prog [options] cssFileName"
+    parser = OptionParser(usage=usage)
+    parser.add_option("-r", "--red",
+            action="store", type="int", dest="red",
+            help="difference in red channel")
+    parser.add_option("-g", "--green",
+            action="store", type="int", dest="green",
+            help="difference in green channel")
+    parser.add_option("-b", "--blue",
+            action="store", type="int", dest="blue",
+            help="difference in blue channel")
+    parser.add_option("-d", "--debug",
+            action="store_true", dest="debug", default=False,
+            help="turn on debug mode")
+    parser.add_option("-t", "--theme",
+            action="store", type="string", dest="themename",
+            help="Name of new theme")
+
+    (options, args) = parser.parse_args()
+
+    if len(args) != 1:
+        print "Error: incorrect number of arguments\n"
+        parser.print_help()
+        raise Exception()
+
+    if options.themename is None:
+        print "Error: option -t is not specified\n"
+        parser.print_help()
+        raise Exception()
+
+    if options.red is None or options.green is None or options.blue is None:
+        print "Error: differences in red, green and blue channels must be set.\n"
+        parser.print_help()
+        raise Exception()
+
+    return (options, args)
+
+def main(argv=None):
+    try:
+        (options, args) = optionparse()
+    except:
+        return 2
+
+    cssoverrides="""
+
+    /*
+     * Added by Gerald.
+     */
+    .x-menu a.x-menu-item {
+        color: #ffffff;
+    }
+    body {
+        color: #ffffff;
+    }
+    * {
+        color: inherit;
+    }
+
+    .x-tree-node a span, .x-dd-drag-ghost a span {
+        color: white;
+    }
+
+    .x-combo-list {
+        background: #de7a38;
+    }
+    .x-combo-list-inner {
+        background: #ff6666;
+    }
+
+    .x-tab-strip span.x-tab-strip-text {
+        color: #ffffff;
+        }
+    .x-tab-strip-over span.x-tab-strip-text {
+        color: #00ffaa
+        }
+    .x-tab-strip-active span.x-tab-strip-text {
+        color: #22ffff;
+    }
+
+    .x-btn-disabled * {
+        color: gray !important;
+        cursor: default !important
+        }
+
+    .x-panel-header {
+        color: #ffffff;
+    }
+    .x-panel-tl .x-panel-header {
+        color: #ffffff;
+    }
+
+    .x-window-tl .x-window-header {
+        color: #ffffff;
+    }
+
+    .x-form-empty-field {
+        color: white
+        }
+    """
+
+    cssFileName = 'ext-all.css'
+    # cssFile = 'ext-small.css'
+    # cssFile = 'test.css'
+    themename = "myosg-orange"
+    debug = False
+
+    cssFileName = args[0]
+    themename = options.themename
+    debug = options.debug
+
+    CSSColorTweaker.tweak(cssFileName, themename, debug, 1, cssoverrides)
+
+if __name__ == "__main__":
+    sys.exit(main())
+

Propchange: incubator/rave/donations/ogce-gadget-container/tools/cssprocess.py
------------------------------------------------------------------------------
    svn:executable = 

Added: incubator/rave/donations/ogce-gadget-container/tools/imageprocess.py
URL: http://svn.apache.org/viewvc/incubator/rave/donations/ogce-gadget-container/tools/imageprocess.py?rev=1087520&view=auto
==============================================================================
--- incubator/rave/donations/ogce-gadget-container/tools/imageprocess.py (added)
+++ incubator/rave/donations/ogce-gadget-container/tools/imageprocess.py Fri Apr  1 00:29:22 2011
@@ -0,0 +1,182 @@
+#!/usr/bin/env python
+#
+#
+# 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.
+#
+#
+# -*- coding: utf-8 -*-
+
+"""
+Batch process bunch of images. 
+For each pixle with color rgb(r,g,b), if the offset is [x,y,z], the new color
+of the pixel will be rgb(r+x, g+y, b+z).
+If any r,g,b value is smaller than 0, it is set to 0.
+If any r,g,b value is large than 255, it is set to 255.
+
+Only image files with extension jpg, png, or gif are considered.
+
+Prerequisite:
+    ImageMagick
+
+Usage:
+    python imageprocess.py -r deltaR -g deltaG -b deltaB srcimagedir dstimagedir
+
+    deltaR, deltaG, deltaB are color difference for red, green and blue
+    channels. They are integers and can be positive or negative. They can be
+    represented in hex or decimal.
+
+    srcimagedir: images under this directory will be processed (recursively)
+    dstimagedir: resultant images will be put into this directory.
+
+Example:
+    python imageprocess.py -r 20 -g 30 -b 40 srcimagedir dstimagedir
+    python imageprocess.py -r -20 -g -30 -b -40 srcimagedir dstimagedir
+    python imageprocess.py -r 0x20 -g 0x30 -b 0x40 srcimagedir dstimagedir
+    python imageprocess.py -r -0x20 -g -0x30 -b -0x40 srcimagedir dstimagedir
+
+"""
+
+import subprocess
+import os
+import sys
+from optparse import OptionParser
+
+class ImageTweaker:
+    @staticmethod
+    def imageColorMod(imageFileName, dstFileName, offsets):
+        """ change all pixels in an image file """
+
+        # scale to 0 - 1
+        red = offsets[0]/255.0
+        green = offsets[1]/255.0
+        blue = offsets[2]/255.0
+
+        rfxparam = "u.r%+.6f"%(red)
+        gfxparam = "u.g%+.6f"%(green)
+        bfxparam = "u.b%+.6f"%(blue)
+
+        # convert rose: -channel red -fx "u.r+1" -channel green -fx "u.g-1"
+        # -channel blue -fx "u.b-1" rose.png
+        command = ['convert', imageFileName, 
+                '-channel', 'red', '-fx', rfxparam, 
+                '-channel', 'green', '-fx', gfxparam, 
+                '-channel', 'blue', '-fx', bfxparam, 
+                dstFileName]
+
+        # print command
+        retcode = subprocess.call(command)
+        if retcode != 0:
+            print "error happens:%s->%s"%(imageFileName, dstFileName)
+        else:
+            print "conversion succeeded:%s->%s"%(imageFileName, dstFileName)
+
+
+    @classmethod
+    def dirImageColrMod(cls, dir, dstdir, offsets):
+        """ change all image files under a directory """
+        if not os.path.exists(dstdir):
+            os.makedirs(dstdir)
+        elif not os.path.isdir(dstdir):
+            print "Warning: %s exists and is not a directory."%dstdir
+            return
+
+        extList = (".jpg", ".png", ".gif")
+        for f in os.listdir(dir):
+            f = os.path.normcase(f)
+            if f.startswith("."): # skip hidden files/dirs
+                continue
+
+            if os.path.isfile(os.path.join(dir, f)):
+                if os.path.splitext(f)[1] not in extList:
+                    continue;
+                cls.imageColorMod(os.path.join(dir, f), os.path.join(dstdir, f), offsets)
+            elif os.path.isdir(os.path.join(dir, f)):
+                dirImageColrMod(os.path.join(dir, f), os.path.join(dstdir, f), offsets)
+
+
+def optionparse(argv=None):
+    if argv is None:
+        argv = sys.argv
+    usage = "usage: %prog [options] srcdir dstdir"
+    parser = OptionParser(usage=usage)
+    parser.add_option("-r", "--red",
+            action="store", type="int", dest="red",
+            help="difference in red channel")
+    parser.add_option("-g", "--green",
+            action="store", type="int", dest="green",
+            help="difference in green channel")
+    parser.add_option("-b", "--blue",
+            action="store", type="int", dest="blue",
+            help="difference in blue channel")
+
+    (options, args) = parser.parse_args()
+
+    if len(args) != 2:
+        print "Error: incorrect number of arguments\n"
+        parser.print_help()
+        raise Exception()
+
+    if options.red is None or options.green is None or options.blue is None:
+        print "Error: differences in red, green and blue channels must be set.\n"
+        parser.print_help()
+        raise Exception()
+    return (options, args)
+
+def main():
+    try:
+        (options, args) = optionparse()
+        srcdir = args[0]
+        dstdir = args[1]
+
+        if not os.path.isdir(srcdir):
+            print "Error: '%s' does not exist or is not a directory"%srcdir
+            return 2;
+
+        if not os.path.isdir(dstdir):
+            print "Error: '%s' does not exist or is not a directory"%dstdir
+            return 2;
+
+        print "src image dir:%s"%srcdir
+        print "dst image dir:%s"%dstdir
+        print "Confirm bbove information is correct (y/n): ",
+
+        offsets = [options.red, options.green, options.blue]
+
+        confirm = raw_input()
+        if confirm == 'n' or confirm == 'N':
+            return 0;
+        else:
+            print offsets
+            ImageTweaker.dirImageColrMod(srcdir, dstdir, offsets)
+
+        print "Done"
+
+    except:
+        return 2
+
+if __name__ == "__main__":
+    sys.exit(main())
+
+# dstDir="/globalhome/zhguo/ongoing/myshindig-sourceforge/ishindig-trunk/portal_deploy/apache-tomcat-6.0.18/webapps/ishindig-webapp/www/extjs/MyOSGTheme/images/myosg-orange"
+# srcDir="/globalhome/zhguo/ongoing/myshindig-sourceforge/ishindig-trunk/portal_deploy/apache-tomcat-6.0.18/webapps/ishindig-webapp/www/extjs/resources/images/default.original"
+# FFD3AF - #C3D9FF
+# FFB43F - #C3D9FF
+# FF9966 - #C3D9FF
+# E07630 - #C3D9FF
+# offsets = [0x1D, -0x63, -0xCF]
+

Propchange: incubator/rave/donations/ogce-gadget-container/tools/imageprocess.py
------------------------------------------------------------------------------
    svn:executable = 



Mime
View raw message