summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authorkurrik@chromium.org <kurrik@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-19 16:13:59 +0000
committerkurrik@chromium.org <kurrik@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-19 16:13:59 +0000
commitc0cbe89d12dba6082c61854287aeae1cf22261b7 (patch)
tree8c43f7c34ac6ea10cea69555190621b62f0a83a4 /chrome/common
parent48495594c601e34b8caef655395bddaacc0cd967 (diff)
downloadchromium_src-c0cbe89d12dba6082c61854287aeae1cf22261b7.zip
chromium_src-c0cbe89d12dba6082c61854287aeae1cf22261b7.tar.gz
chromium_src-c0cbe89d12dba6082c61854287aeae1cf22261b7.tar.bz2
The "Hello world!" of the Chrome Web Store Licensing API, in Java.
BUG=none TEST=none Review URL: http://codereview.chromium.org/3130030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56691 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/extensions/docs/examples/apps/hello-java.zipbin0 -> 12953 bytes
-rw-r--r--chrome/common/extensions/docs/examples/apps/hello-java/HelloLicenseServlet.java118
-rw-r--r--chrome/common/extensions/docs/examples/apps/hello-java/README10
-rw-r--r--chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/.classpath9
-rw-r--r--chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/.project33
-rw-r--r--chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/.settings/com.google.appengine.eclipse.core.prefs3
-rw-r--r--chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/.settings/com.google.gdt.eclipse.core.prefs5
-rw-r--r--chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/.settings/com.google.gwt.eclipse.core.prefs3
-rw-r--r--chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/src/META-INF/jdoconfig.xml15
-rw-r--r--chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/src/com/example/HelloLicenseServlet.java118
-rw-r--r--chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/src/log4j.properties24
-rw-r--r--chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/war/WEB-INF/appengine-web.xml11
-rw-r--r--chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/war/WEB-INF/classes/META-INF/jdoconfig.xml15
-rw-r--r--chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/war/WEB-INF/classes/log4j.properties24
-rw-r--r--chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/war/WEB-INF/logging.properties13
-rw-r--r--chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/war/WEB-INF/web.xml18
-rw-r--r--chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/war/index.html26
17 files changed, 445 insertions, 0 deletions
diff --git a/chrome/common/extensions/docs/examples/apps/hello-java.zip b/chrome/common/extensions/docs/examples/apps/hello-java.zip
new file mode 100644
index 0000000..6266e55
--- /dev/null
+++ b/chrome/common/extensions/docs/examples/apps/hello-java.zip
Binary files differ
diff --git a/chrome/common/extensions/docs/examples/apps/hello-java/HelloLicenseServlet.java b/chrome/common/extensions/docs/examples/apps/hello-java/HelloLicenseServlet.java
new file mode 100644
index 0000000..08ab4d72
--- /dev/null
+++ b/chrome/common/extensions/docs/examples/apps/hello-java/HelloLicenseServlet.java
@@ -0,0 +1,118 @@
+/*
+ * The "Hello world!" of the Chrome Web Store Licensing API, in Java. This
+ * program logs the user in with OpenID, fetches their license state with OAuth,
+ * and prints one of these greetings as appropriate:
+ *
+ * 1. Hello *no* license!
+ * 2. Hello *free trial* license!
+ * 3. Hello *full* license!
+ *
+ * Copyright 2010 the Chromium Authors
+ *
+ * Use of this source code is governed by a BSD-style license that can be found
+ * in the "LICENSE" file.
+ *
+ * Brian Kennish <bkennish@chromium.org>
+ */
+package com.example;
+
+import java.io.*;
+import java.net.*;
+import java.util.HashSet;
+import javax.servlet.http.*;
+import com.google.appengine.api.users.*;
+import com.google.appengine.repackaged.org.json.JSONObject;
+import oauth.signpost.OAuthConsumer;
+import oauth.signpost.basic.DefaultOAuthConsumer;
+
+/* A Google App Engine servlet. */
+@SuppressWarnings("serial")
+public class HelloLicenseServlet extends HttpServlet {
+ /* TODO: The app ID from the Chrome Developer Dashboard. */
+ public static final String APP_ID = "[INSERT APP ID HERE]";
+
+ /* TODO: The token from the Chrome Developer Dashboard. */
+ private static final String TOKEN = "[INSERT TOKEN HERE]";
+
+ /* TODO: The token secret from the Chrome Developer Dashboard. */
+ private static final String TOKEN_SECRET = "[INSERT TOKEN SECRET HERE]";
+
+ /*
+ * The license server URL, where %s are placeholders for app and
+ * user IDs
+ */
+ public static final String SERVER_URL =
+ "https://www.googleapis.com/chromewebstore/v1/licenses/%s/%s";
+
+ /* The consumer key. */
+ public static final String CONSUMER_KEY = "anonymous";
+
+ /* The consumer secret. */
+ public static final String CONSUMER_SECRET = CONSUMER_KEY;
+
+ /* Handles "GET" requests. */
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws IOException {
+ response.setContentType("text/html; charset=UTF-8");
+ UserService userService = UserServiceFactory.getUserService();
+ PrintWriter output = response.getWriter();
+ String url = request.getRequestURI();
+
+ if (userService.isUserLoggedIn()) {
+ // Provide a logout path.
+ User user = userService.getCurrentUser();
+ output.printf(
+ "<strong>%s</strong> | <a href=\"%s\">Sign out</a><br><br>",
+ user.getEmail(),
+ userService.createLogoutURL(url)
+ );
+
+ try {
+ // Send a signed request for the user's license state.
+ OAuthConsumer oauth =
+ new DefaultOAuthConsumer(CONSUMER_KEY, CONSUMER_SECRET);
+ oauth.setTokenWithSecret(TOKEN, TOKEN_SECRET);
+ URLConnection http =
+ new URL(
+ String.format(
+ SERVER_URL,
+ APP_ID,
+ URLEncoder.encode(user.getFederatedIdentity(), "UTF-8")
+ )
+ ).openConnection();
+ oauth.sign(http);
+ http.connect();
+
+ // Convert the response from the license server to a string.
+ BufferedReader input =
+ new BufferedReader(new InputStreamReader(http.getInputStream()));
+ String file = "";
+ for (String line; (line = input.readLine()) != null; file += line);
+ input.close();
+
+ // Parse the string as JSON and display the license state.
+ JSONObject json = new JSONObject(file);
+ output.printf(
+ "Hello <strong>%s</strong> license!",
+ "YES".equals(json.get("result")) ?
+ "FULL".equals(json.get("accessLevel")) ? "full" : "free trial" :
+ "no"
+ );
+ } catch (Exception exception) {
+ // Dump any error.
+ output.printf("Oops! <strong>%s</strong>", exception.getMessage());
+ }
+ } else { // The user isn't logged in.
+ // Prompt for login.
+ output.printf(
+ "<a href=\"%s\">Sign in</a>",
+ userService.createLoginURL(
+ url,
+ null,
+ "https://www.google.com/accounts/o8/id",
+ new HashSet<String>()
+ )
+ );
+ }
+ }
+}
diff --git a/chrome/common/extensions/docs/examples/apps/hello-java/README b/chrome/common/extensions/docs/examples/apps/hello-java/README
new file mode 100644
index 0000000..11ef20c
--- /dev/null
+++ b/chrome/common/extensions/docs/examples/apps/hello-java/README
@@ -0,0 +1,10 @@
+See the documentation at
+ http://code.google.com/chrome/webstore/docs/get_started.html
+for instructions on how to use these files.
+
+"HelloLicenseServlet.java" contains all the code you need to talk to the Chrome
+Web Store Licensing API.
+
+"workspace" contains a complete Eclipse project, "HelloLicense", which you can
+import and deploy to Google App Engine after updating
+"HelloLicenseServlet.java".
diff --git a/chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/.classpath b/chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/.classpath
new file mode 100644
index 0000000..6e68fb3
--- /dev/null
+++ b/chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/.classpath
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="com.google.appengine.eclipse.core.GAE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="lib" path="war/WEB-INF/lib/commons-codec-1.4.jar"/>
+ <classpathentry kind="lib" path="war/WEB-INF/lib/signpost-core-1.2.1.1.jar"/>
+ <classpathentry kind="output" path="war/WEB-INF/classes"/>
+</classpath>
diff --git a/chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/.project b/chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/.project
new file mode 100644
index 0000000..9e3bf60
--- /dev/null
+++ b/chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/.project
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>HelloLicense</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.google.gdt.eclipse.core.webAppProjectValidator</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.google.appengine.eclipse.core.enhancerbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.google.appengine.eclipse.core.projectValidator</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>com.google.appengine.eclipse.core.gaeNature</nature>
+ </natures>
+</projectDescription>
diff --git a/chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/.settings/com.google.appengine.eclipse.core.prefs b/chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/.settings/com.google.appengine.eclipse.core.prefs
new file mode 100644
index 0000000..a5e4c39
--- /dev/null
+++ b/chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/.settings/com.google.appengine.eclipse.core.prefs
@@ -0,0 +1,3 @@
+#Sun Aug 15 09:29:11 PDT 2010
+eclipse.preferences.version=1
+filesCopiedToWebInfLib=appengine-api-1.0-sdk-1.3.5.jar|appengine-api-labs-1.3.5.jar|appengine-jsr107cache-1.3.5.jar|jsr107cache-1.1.jar|datanucleus-appengine-1.0.7.final.jar|datanucleus-core-1.1.5.jar|datanucleus-jpa-1.1.5.jar|geronimo-jpa_3.0_spec-1.1.1.jar|geronimo-jta_1.1_spec-1.1.1.jar|jdo2-api-2.3-eb.jar
diff --git a/chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/.settings/com.google.gdt.eclipse.core.prefs b/chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/.settings/com.google.gdt.eclipse.core.prefs
new file mode 100644
index 0000000..23a0f0a
--- /dev/null
+++ b/chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/.settings/com.google.gdt.eclipse.core.prefs
@@ -0,0 +1,5 @@
+#Tue Aug 17 23:40:51 PDT 2010
+eclipse.preferences.version=1
+jarsExcludedFromWebInfLib=
+warSrcDir=war
+warSrcDirIsOutput=true
diff --git a/chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/.settings/com.google.gwt.eclipse.core.prefs b/chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/.settings/com.google.gwt.eclipse.core.prefs
new file mode 100644
index 0000000..7c8408d
--- /dev/null
+++ b/chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/.settings/com.google.gwt.eclipse.core.prefs
@@ -0,0 +1,3 @@
+#Tue Aug 17 23:40:55 PDT 2010
+eclipse.preferences.version=1
+filesCopiedToWebInfLib=
diff --git a/chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/src/META-INF/jdoconfig.xml b/chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/src/META-INF/jdoconfig.xml
new file mode 100644
index 0000000..5f56aa1
--- /dev/null
+++ b/chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/src/META-INF/jdoconfig.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<jdoconfig xmlns="http://java.sun.com/xml/ns/jdo/jdoconfig"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="http://java.sun.com/xml/ns/jdo/jdoconfig">
+
+ <persistence-manager-factory name="transactions-optional">
+ <property name="javax.jdo.PersistenceManagerFactoryClass"
+ value="org.datanucleus.store.appengine.jdo.DatastoreJDOPersistenceManagerFactory"/>
+ <property name="javax.jdo.option.ConnectionURL" value="appengine"/>
+ <property name="javax.jdo.option.NontransactionalRead" value="true"/>
+ <property name="javax.jdo.option.NontransactionalWrite" value="true"/>
+ <property name="javax.jdo.option.RetainValues" value="true"/>
+ <property name="datanucleus.appengine.autoCreateDatastoreTxns" value="true"/>
+ </persistence-manager-factory>
+</jdoconfig>
diff --git a/chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/src/com/example/HelloLicenseServlet.java b/chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/src/com/example/HelloLicenseServlet.java
new file mode 100644
index 0000000..08ab4d72
--- /dev/null
+++ b/chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/src/com/example/HelloLicenseServlet.java
@@ -0,0 +1,118 @@
+/*
+ * The "Hello world!" of the Chrome Web Store Licensing API, in Java. This
+ * program logs the user in with OpenID, fetches their license state with OAuth,
+ * and prints one of these greetings as appropriate:
+ *
+ * 1. Hello *no* license!
+ * 2. Hello *free trial* license!
+ * 3. Hello *full* license!
+ *
+ * Copyright 2010 the Chromium Authors
+ *
+ * Use of this source code is governed by a BSD-style license that can be found
+ * in the "LICENSE" file.
+ *
+ * Brian Kennish <bkennish@chromium.org>
+ */
+package com.example;
+
+import java.io.*;
+import java.net.*;
+import java.util.HashSet;
+import javax.servlet.http.*;
+import com.google.appengine.api.users.*;
+import com.google.appengine.repackaged.org.json.JSONObject;
+import oauth.signpost.OAuthConsumer;
+import oauth.signpost.basic.DefaultOAuthConsumer;
+
+/* A Google App Engine servlet. */
+@SuppressWarnings("serial")
+public class HelloLicenseServlet extends HttpServlet {
+ /* TODO: The app ID from the Chrome Developer Dashboard. */
+ public static final String APP_ID = "[INSERT APP ID HERE]";
+
+ /* TODO: The token from the Chrome Developer Dashboard. */
+ private static final String TOKEN = "[INSERT TOKEN HERE]";
+
+ /* TODO: The token secret from the Chrome Developer Dashboard. */
+ private static final String TOKEN_SECRET = "[INSERT TOKEN SECRET HERE]";
+
+ /*
+ * The license server URL, where %s are placeholders for app and
+ * user IDs
+ */
+ public static final String SERVER_URL =
+ "https://www.googleapis.com/chromewebstore/v1/licenses/%s/%s";
+
+ /* The consumer key. */
+ public static final String CONSUMER_KEY = "anonymous";
+
+ /* The consumer secret. */
+ public static final String CONSUMER_SECRET = CONSUMER_KEY;
+
+ /* Handles "GET" requests. */
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws IOException {
+ response.setContentType("text/html; charset=UTF-8");
+ UserService userService = UserServiceFactory.getUserService();
+ PrintWriter output = response.getWriter();
+ String url = request.getRequestURI();
+
+ if (userService.isUserLoggedIn()) {
+ // Provide a logout path.
+ User user = userService.getCurrentUser();
+ output.printf(
+ "<strong>%s</strong> | <a href=\"%s\">Sign out</a><br><br>",
+ user.getEmail(),
+ userService.createLogoutURL(url)
+ );
+
+ try {
+ // Send a signed request for the user's license state.
+ OAuthConsumer oauth =
+ new DefaultOAuthConsumer(CONSUMER_KEY, CONSUMER_SECRET);
+ oauth.setTokenWithSecret(TOKEN, TOKEN_SECRET);
+ URLConnection http =
+ new URL(
+ String.format(
+ SERVER_URL,
+ APP_ID,
+ URLEncoder.encode(user.getFederatedIdentity(), "UTF-8")
+ )
+ ).openConnection();
+ oauth.sign(http);
+ http.connect();
+
+ // Convert the response from the license server to a string.
+ BufferedReader input =
+ new BufferedReader(new InputStreamReader(http.getInputStream()));
+ String file = "";
+ for (String line; (line = input.readLine()) != null; file += line);
+ input.close();
+
+ // Parse the string as JSON and display the license state.
+ JSONObject json = new JSONObject(file);
+ output.printf(
+ "Hello <strong>%s</strong> license!",
+ "YES".equals(json.get("result")) ?
+ "FULL".equals(json.get("accessLevel")) ? "full" : "free trial" :
+ "no"
+ );
+ } catch (Exception exception) {
+ // Dump any error.
+ output.printf("Oops! <strong>%s</strong>", exception.getMessage());
+ }
+ } else { // The user isn't logged in.
+ // Prompt for login.
+ output.printf(
+ "<a href=\"%s\">Sign in</a>",
+ userService.createLoginURL(
+ url,
+ null,
+ "https://www.google.com/accounts/o8/id",
+ new HashSet<String>()
+ )
+ );
+ }
+ }
+}
diff --git a/chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/src/log4j.properties b/chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/src/log4j.properties
new file mode 100644
index 0000000..d9c3edc9
--- /dev/null
+++ b/chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/src/log4j.properties
@@ -0,0 +1,24 @@
+# A default log4j configuration for log4j users.
+#
+# To use this configuration, deploy it into your application's WEB-INF/classes
+# directory. You are also encouraged to edit it as you like.
+
+# Configure the console as our one appender
+log4j.appender.A1=org.apache.log4j.ConsoleAppender
+log4j.appender.A1.layout=org.apache.log4j.PatternLayout
+log4j.appender.A1.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p [%c] - %m%n
+
+# tighten logging on the DataNucleus Categories
+log4j.category.DataNucleus.JDO=WARN, A1
+log4j.category.DataNucleus.Persistence=WARN, A1
+log4j.category.DataNucleus.Cache=WARN, A1
+log4j.category.DataNucleus.MetaData=WARN, A1
+log4j.category.DataNucleus.General=WARN, A1
+log4j.category.DataNucleus.Utility=WARN, A1
+log4j.category.DataNucleus.Transaction=WARN, A1
+log4j.category.DataNucleus.Datastore=WARN, A1
+log4j.category.DataNucleus.ClassLoading=WARN, A1
+log4j.category.DataNucleus.Plugin=WARN, A1
+log4j.category.DataNucleus.ValueGeneration=WARN, A1
+log4j.category.DataNucleus.Enhancer=WARN, A1
+log4j.category.DataNucleus.SchemaTool=WARN, A1
diff --git a/chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/war/WEB-INF/appengine-web.xml b/chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/war/WEB-INF/appengine-web.xml
new file mode 100644
index 0000000..99223a5
--- /dev/null
+++ b/chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/war/WEB-INF/appengine-web.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
+ <application></application>
+ <version>1</version>
+
+ <!-- Configure java.util.logging -->
+ <system-properties>
+ <property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
+ </system-properties>
+
+</appengine-web-app> \ No newline at end of file
diff --git a/chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/war/WEB-INF/classes/META-INF/jdoconfig.xml b/chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/war/WEB-INF/classes/META-INF/jdoconfig.xml
new file mode 100644
index 0000000..5f56aa1
--- /dev/null
+++ b/chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/war/WEB-INF/classes/META-INF/jdoconfig.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<jdoconfig xmlns="http://java.sun.com/xml/ns/jdo/jdoconfig"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="http://java.sun.com/xml/ns/jdo/jdoconfig">
+
+ <persistence-manager-factory name="transactions-optional">
+ <property name="javax.jdo.PersistenceManagerFactoryClass"
+ value="org.datanucleus.store.appengine.jdo.DatastoreJDOPersistenceManagerFactory"/>
+ <property name="javax.jdo.option.ConnectionURL" value="appengine"/>
+ <property name="javax.jdo.option.NontransactionalRead" value="true"/>
+ <property name="javax.jdo.option.NontransactionalWrite" value="true"/>
+ <property name="javax.jdo.option.RetainValues" value="true"/>
+ <property name="datanucleus.appengine.autoCreateDatastoreTxns" value="true"/>
+ </persistence-manager-factory>
+</jdoconfig>
diff --git a/chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/war/WEB-INF/classes/log4j.properties b/chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/war/WEB-INF/classes/log4j.properties
new file mode 100644
index 0000000..d9c3edc9
--- /dev/null
+++ b/chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/war/WEB-INF/classes/log4j.properties
@@ -0,0 +1,24 @@
+# A default log4j configuration for log4j users.
+#
+# To use this configuration, deploy it into your application's WEB-INF/classes
+# directory. You are also encouraged to edit it as you like.
+
+# Configure the console as our one appender
+log4j.appender.A1=org.apache.log4j.ConsoleAppender
+log4j.appender.A1.layout=org.apache.log4j.PatternLayout
+log4j.appender.A1.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p [%c] - %m%n
+
+# tighten logging on the DataNucleus Categories
+log4j.category.DataNucleus.JDO=WARN, A1
+log4j.category.DataNucleus.Persistence=WARN, A1
+log4j.category.DataNucleus.Cache=WARN, A1
+log4j.category.DataNucleus.MetaData=WARN, A1
+log4j.category.DataNucleus.General=WARN, A1
+log4j.category.DataNucleus.Utility=WARN, A1
+log4j.category.DataNucleus.Transaction=WARN, A1
+log4j.category.DataNucleus.Datastore=WARN, A1
+log4j.category.DataNucleus.ClassLoading=WARN, A1
+log4j.category.DataNucleus.Plugin=WARN, A1
+log4j.category.DataNucleus.ValueGeneration=WARN, A1
+log4j.category.DataNucleus.Enhancer=WARN, A1
+log4j.category.DataNucleus.SchemaTool=WARN, A1
diff --git a/chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/war/WEB-INF/logging.properties b/chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/war/WEB-INF/logging.properties
new file mode 100644
index 0000000..a172066
--- /dev/null
+++ b/chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/war/WEB-INF/logging.properties
@@ -0,0 +1,13 @@
+# A default java.util.logging configuration.
+# (All App Engine logging is through java.util.logging by default).
+#
+# To use this configuration, copy it into your application's WEB-INF
+# folder and add the following to your appengine-web.xml:
+#
+# <system-properties>
+# <property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
+# </system-properties>
+#
+
+# Set the default logging level for all loggers to WARNING
+.level = WARNING
diff --git a/chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/war/WEB-INF/web.xml b/chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/war/WEB-INF/web.xml
new file mode 100644
index 0000000..7226eb0
--- /dev/null
+++ b/chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/war/WEB-INF/web.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<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" version="2.5">
+ <servlet>
+ <servlet-name>HelloLicense</servlet-name>
+ <servlet-class>com.example.HelloLicenseServlet</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>HelloLicense</servlet-name>
+ <url-pattern>/hellolicense</url-pattern>
+ </servlet-mapping>
+ <welcome-file-list>
+ <welcome-file>index.html</welcome-file>
+ </welcome-file-list>
+</web-app>
diff --git a/chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/war/index.html b/chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/war/index.html
new file mode 100644
index 0000000..173070d
--- /dev/null
+++ b/chrome/common/extensions/docs/examples/apps/hello-java/workspace/HelloLicense/war/index.html
@@ -0,0 +1,26 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<!-- The HTML 4.01 Transitional DOCTYPE declaration-->
+<!-- above set at the top of the file will set -->
+<!-- the browser's rendering engine into -->
+<!-- "Quirks Mode". Replacing this declaration -->
+<!-- with a "Standards Mode" doctype is supported, -->
+<!-- but may lead to some differences in layout. -->
+
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <title>Hello App Engine</title>
+ </head>
+
+ <body>
+ <h1>Hello App Engine!</h1>
+ <table>
+ <tr>
+ <td colspan="2" style="font-weight:bold;">Available Servlets:</td>
+ </tr>
+ <tr>
+ <td><a href="hellolicense">HelloLicense</a></td>
+ </tr>
+ </table>
+ </body>
+</html>