From 21179a3dabb85695f95a7b17c3e923bf077f17b3 Mon Sep 17 00:00:00 2001 From: Arun Gupta Date: Sun, 6 Oct 2013 21:50:44 -0700 Subject: [PATCH 001/905] Starting work on HBase sample --- extra/nosql/hbase/pom.xml | 28 +++ .../org/javaee7/extra/nosql/hbase/Person.java | 92 ++++++++++ .../extra/nosql/hbase/PersonSessionBean.java | 162 ++++++++++++++++++ .../hbase/src/main/webapp/WEB-INF/beans.xml | 49 ++++++ .../src/main/webapp/WEB-INF/template.xhtml | 26 +++ .../hbase/src/main/webapp/WEB-INF/web.xml | 24 +++ extra/nosql/hbase/src/main/webapp/index.xhtml | 33 ++++ .../main/webapp/resources/css/cssLayout.css | 61 +++++++ .../src/main/webapp/resources/css/default.css | 29 ++++ extra/nosql/hbase/src/main/webapp/show.xhtml | 29 ++++ 10 files changed, 533 insertions(+) create mode 100644 extra/nosql/hbase/pom.xml create mode 100644 extra/nosql/hbase/src/main/java/org/javaee7/extra/nosql/hbase/Person.java create mode 100644 extra/nosql/hbase/src/main/java/org/javaee7/extra/nosql/hbase/PersonSessionBean.java create mode 100644 extra/nosql/hbase/src/main/webapp/WEB-INF/beans.xml create mode 100644 extra/nosql/hbase/src/main/webapp/WEB-INF/template.xhtml create mode 100644 extra/nosql/hbase/src/main/webapp/WEB-INF/web.xml create mode 100644 extra/nosql/hbase/src/main/webapp/index.xhtml create mode 100644 extra/nosql/hbase/src/main/webapp/resources/css/cssLayout.css create mode 100644 extra/nosql/hbase/src/main/webapp/resources/css/default.css create mode 100644 extra/nosql/hbase/src/main/webapp/show.xhtml diff --git a/extra/nosql/hbase/pom.xml b/extra/nosql/hbase/pom.xml new file mode 100644 index 000000000..574b06db3 --- /dev/null +++ b/extra/nosql/hbase/pom.xml @@ -0,0 +1,28 @@ + + + 4.0.0 + + org.javaee7.extra.nosql + extra-nosql-samples + 1.0-SNAPSHOT + ../pom.xml + + + org.javaee7.extra.nosql + hbase + 1.0-SNAPSHOT + war + + + + org.apache.hadoop + hadoop-core + 0.20.2 + + + org.apache.hbase + hbase + 0.90.2 + + + diff --git a/extra/nosql/hbase/src/main/java/org/javaee7/extra/nosql/hbase/Person.java b/extra/nosql/hbase/src/main/java/org/javaee7/extra/nosql/hbase/Person.java new file mode 100644 index 000000000..0842f0198 --- /dev/null +++ b/extra/nosql/hbase/src/main/java/org/javaee7/extra/nosql/hbase/Person.java @@ -0,0 +1,92 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common Development + * and Distribution License("CDDL") (collectively, the "License"). You + * may not use this file except in compliance with the License. You can + * obtain a copy of the License at + * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html + * or packager/legal/LICENSE.txt. See the License for the specific + * language governing permissions and limitations under the License. + * + * When distributing the software, include this License Header Notice in each + * file and include the License file at packager/legal/LICENSE.txt. + * + * GPL Classpath Exception: + * Oracle designates this particular file as subject to the "Classpath" + * exception as provided by Oracle in the GPL Version 2 section of the License + * file that accompanied this code. + * + * Modifications: + * If applicable, add the following below the License Header, with the fields + * enclosed by brackets [] replaced by your own identifying information: + * "Portions Copyright [year] [name of copyright owner]" + * + * Contributor(s): + * If you wish your version of this file to be governed by only the CDDL or + * only the GPL Version 2, indicate your decision by adding "[Contributor] + * elects to include this software in this distribution under the [CDDL or GPL + * Version 2] license." If you don't indicate a single choice of license, a + * recipient has the option to distribute your version of this file under + * either the CDDL, the GPL Version 2 or to extend the choice of license to + * its licensees as provided above. However, if you add GPL Version 2 code + * and therefore, elected the GPL Version 2 license, then the option applies + * only if the new code is made subject to such option by the copyright + * holder. + */ +package org.javaee7.extra.nosql.hbase; + +import java.util.StringTokenizer; +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Named; +import javax.validation.constraints.Size; + +/** + * @author Arun Gupta + */ +@Named +@ApplicationScoped +public class Person { + + @Size(min = 1, max = 20) + private String name; + + private int age; + + public Person() { + } + + public Person(String name, int age) { + this.name = name; + this.age = age; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public int getAge() { + return age; + } + + public void setAge(int age) { + this.age = age; + } + + @Override + public String toString() { + return name + ", " + age; + } + + public static Person fromString(String string) { + StringTokenizer tokens = new StringTokenizer(string, ","); + return new Person(tokens.nextToken(), Integer.parseInt(tokens.nextToken().trim())); + } +} diff --git a/extra/nosql/hbase/src/main/java/org/javaee7/extra/nosql/hbase/PersonSessionBean.java b/extra/nosql/hbase/src/main/java/org/javaee7/extra/nosql/hbase/PersonSessionBean.java new file mode 100644 index 000000000..10643fd11 --- /dev/null +++ b/extra/nosql/hbase/src/main/java/org/javaee7/extra/nosql/hbase/PersonSessionBean.java @@ -0,0 +1,162 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common Development + * and Distribution License("CDDL") (collectively, the "License"). You + * may not use this file except in compliance with the License. You can + * obtain a copy of the License at + * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html + * or packager/legal/LICENSE.txt. See the License for the specific + * language governing permissions and limitations under the License. + * + * When distributing the software, include this License Header Notice in each + * file and include the License file at packager/legal/LICENSE.txt. + * + * GPL Classpath Exception: + * Oracle designates this particular file as subject to the "Classpath" + * exception as provided by Oracle in the GPL Version 2 section of the License + * file that accompanied this code. + * + * Modifications: + * If applicable, add the following below the License Header, with the fields + * enclosed by brackets [] replaced by your own identifying information: + * "Portions Copyright [year] [name of copyright owner]" + * + * Contributor(s): + * If you wish your version of this file to be governed by only the CDDL or + * only the GPL Version 2, indicate your decision by adding "[Contributor] + * elects to include this software in this distribution under the [CDDL or GPL + * Version 2] license." If you don't indicate a single choice of license, a + * recipient has the option to distribute your version of this file under + * either the CDDL, the GPL Version 2 or to extend the choice of license to + * its licensees as provided above. However, if you add GPL Version 2 code + * and therefore, elected the GPL Version 2 license, then the option applies + * only if the new code is made subject to such option by the copyright + * holder. + */ +package org.javaee7.extra.nosql.hbase; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.annotation.PostConstruct; +import javax.annotation.PreDestroy; +import javax.ejb.Stateless; +import javax.inject.Inject; +import javax.inject.Named; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hbase.HBaseConfiguration; +import org.apache.hadoop.hbase.HColumnDescriptor; +import org.apache.hadoop.hbase.HTableDescriptor; +import org.apache.hadoop.hbase.KeyValue; +import org.apache.hadoop.hbase.client.HBaseAdmin; +import org.apache.hadoop.hbase.client.HTableInterface; +import org.apache.hadoop.hbase.client.HTablePool; +import org.apache.hadoop.hbase.client.Put; +import org.apache.hadoop.hbase.client.Result; +import org.apache.hadoop.hbase.client.ResultScanner; +import org.apache.hadoop.hbase.client.Scan; +import org.apache.hadoop.hbase.util.Bytes; + +/** + * @author Arun Gupta + */ +@Named +@Stateless +public class PersonSessionBean { + + @Inject + Person person; + + Set set = new HashSet<>(); + + private static final String personsColumnFamily = "person"; + private static final String personsTable = "persons"; + HTablePool pool; + + @PostConstruct + private void initDB() { + try { + // By default, it's localhost, don't worry. + Configuration config = HBaseConfiguration.create(); + + // Without pooling, the connection to a table will be reinitialized. + // Creating a new connection to a table might take up to 5-10 seconds! + pool = new HTablePool(config, 10); + + HBaseAdmin admin = new HBaseAdmin(config); + HTableDescriptor blogstable = new HTableDescriptor(personsTable); + admin.createTable(blogstable); + + // Cannot edit a stucture on an active table. + admin.disableTable(personsTable); + + HColumnDescriptor userCol = new HColumnDescriptor("name"); + admin.addColumn(personsTable, userCol); + + HColumnDescriptor ageCol = new HColumnDescriptor("age"); + admin.addColumn(personsTable, ageCol); + + // For readin, it needs to be re-enabled. + admin.enableTable(personsTable); + } catch (IOException ex) { + Logger.getLogger(PersonSessionBean.class.getName()).log(Level.SEVERE, null, ex); + } + } + + @PreDestroy + private void stopDB() { + } + + public void createPerson() { + try { + HTableInterface table = pool.getTable(personsTable); + Put put = new Put(Bytes.toBytes(person.getName())); + put.add( + Bytes.toBytes(personsColumnFamily), + Bytes.toBytes(person.getName()), + Bytes.toBytes(person.getAge())); + table.put(put); + table.close(); + } catch (IOException ex) { + Logger.getLogger(PersonSessionBean.class.getName()).log(Level.SEVERE, null, ex); + } + } + + public List getPersons() { + List persons = new ArrayList<>(); + + try { + HTableInterface table = pool.getTable(personsTable); + Scan scan = new Scan(); + scan.addFamily(Bytes.toBytes(personsColumnFamily)); + + ResultScanner resultScanner = table.getScanner(scan); + +// For each row + for (Result result : resultScanner) { + for (KeyValue kv : result.raw()) { + Person p = new Person(); +// p.setTitle(Bytes.toString(kv.getQualifier())); +// p.setBody(Bytes.toString(kv.getValue())); +// p.setId(Bytes.toString(result.getRow())); + persons.add(person); + } + } + + resultScanner.close(); + table.close(); + } catch (IOException ex) { + Logger.getLogger(PersonSessionBean.class.getName()).log(Level.SEVERE, null, ex); + } + + return persons; + } +} diff --git a/extra/nosql/hbase/src/main/webapp/WEB-INF/beans.xml b/extra/nosql/hbase/src/main/webapp/WEB-INF/beans.xml new file mode 100644 index 000000000..aa81c7c3c --- /dev/null +++ b/extra/nosql/hbase/src/main/webapp/WEB-INF/beans.xml @@ -0,0 +1,49 @@ + + + + \ No newline at end of file diff --git a/extra/nosql/hbase/src/main/webapp/WEB-INF/template.xhtml b/extra/nosql/hbase/src/main/webapp/WEB-INF/template.xhtml new file mode 100644 index 000000000..c0d6c22b3 --- /dev/null +++ b/extra/nosql/hbase/src/main/webapp/WEB-INF/template.xhtml @@ -0,0 +1,26 @@ + + + + + + + + + Redis using Java EE 7 + + + + +
+

Redis using Java EE 7

+
+ +
+ Content +
+ +
+ + diff --git a/extra/nosql/hbase/src/main/webapp/WEB-INF/web.xml b/extra/nosql/hbase/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 000000000..c5e7c7381 --- /dev/null +++ b/extra/nosql/hbase/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,24 @@ + + + + javax.faces.PROJECT_STAGE + Development + + + Faces Servlet + javax.faces.webapp.FacesServlet + 1 + + + Faces Servlet + /faces/* + + + + 30 + + + + faces/index.xhtml + + diff --git a/extra/nosql/hbase/src/main/webapp/index.xhtml b/extra/nosql/hbase/src/main/webapp/index.xhtml new file mode 100644 index 000000000..e2f909985 --- /dev/null +++ b/extra/nosql/hbase/src/main/webapp/index.xhtml @@ -0,0 +1,33 @@ + + + + + + + + + + + Name:
+ Age:

+ +
+
+

+
    +
  • Download HBase stable and tar xzvf.
  • +
  • Start HBase: ./bin/start-hbase.sh
  • +
  • Look for messages like:
    + starting master, logging to /Users/arungup/tools/hbase/hbase-0.94.12/bin/../logs/hbase-arungup-master-arungup-mac.local.out +
  • +
+
+ +
+ + + diff --git a/extra/nosql/hbase/src/main/webapp/resources/css/cssLayout.css b/extra/nosql/hbase/src/main/webapp/resources/css/cssLayout.css new file mode 100644 index 000000000..8ee7cebe3 --- /dev/null +++ b/extra/nosql/hbase/src/main/webapp/resources/css/cssLayout.css @@ -0,0 +1,61 @@ + +#top { + position: relative; + background-color: #036fab; + color: white; + padding: 5px; + margin: 0px 0px 10px 0px; +} + +#bottom { + position: relative; + background-color: #c2dfef; + padding: 5px; + margin: 10px 0px 0px 0px; +} + +#left { + float: left; + background-color: #ece3a5; + padding: 5px; + width: 150px; +} + +#right { + float: right; + background-color: #ece3a5; + padding: 5px; + width: 150px; +} + +.center_content { + position: relative; + background-color: #dddddd; + padding: 5px; +} + +.left_content { + background-color: #dddddd; + padding: 5px; + margin-left: 170px; +} + +.right_content { + background-color: #dddddd; + padding: 5px; + margin: 0px 170px 0px 170px; +} + +#top a:link, #top a:visited { + color: white; + font-weight : bold; + text-decoration: none; +} + +#top a:link:hover, #top a:visited:hover { + color: black; + font-weight : bold; + text-decoration : underline; +} + + diff --git a/extra/nosql/hbase/src/main/webapp/resources/css/default.css b/extra/nosql/hbase/src/main/webapp/resources/css/default.css new file mode 100644 index 000000000..6cbc3d18e --- /dev/null +++ b/extra/nosql/hbase/src/main/webapp/resources/css/default.css @@ -0,0 +1,29 @@ +body { + background-color: #ffffff; + font-size: 12px; + font-family: Verdana, "Verdana CE", Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif; + color: #000000; + margin: 10px; +} + +h1 { + font-family: Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif; + border-bottom: 1px solid #AFAFAF; + font-size: 16px; + font-weight: bold; + margin: 0px; + padding: 0px; + color: #D20005; +} + +a:link, a:visited { + color: #045491; + font-weight : bold; + text-decoration: none; +} + +a:link:hover, a:visited:hover { + color: #045491; + font-weight : bold; + text-decoration : underline; +} diff --git a/extra/nosql/hbase/src/main/webapp/show.xhtml b/extra/nosql/hbase/src/main/webapp/show.xhtml new file mode 100644 index 000000000..342b4446b --- /dev/null +++ b/extra/nosql/hbase/src/main/webapp/show.xhtml @@ -0,0 +1,29 @@ + + + + + + + + + + + Name#{p.name} + Age#{p.age} + +

+ + + + +
+ +
+ + + From 743c01967074ad713a9b42d78bc4f304f5af471e Mon Sep 17 00:00:00 2001 From: Heiko Scherrer Date: Mon, 7 Oct 2013 09:15:39 +0200 Subject: [PATCH 002/905] Fixed javadocs and sources download --- .gitignore | 198 +++++++++++++++++++++-------------------------------- pom.xml | 11 ++- 2 files changed, 87 insertions(+), 122 deletions(-) diff --git a/.gitignore b/.gitignore index 4da7b0943..4f469494d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,121 +1,77 @@ -/jaxrs/resource-validation/target/ -/jaxrs/mapping-exceptions/target/ -/jaxrs/server-negotiation/target/ -/jaxrs/async-client/target/ -/batch/flow/target/ -/batch/batchlet-simple/target/ -/batch/chunk-checkpoint/target/ -/batch/chunk-exception/target/ -/batch/chunk-mapper/target/ -/batch/decision/target/ -/batch/listeners/target/ -/batch/multiple-steps/target/ -/batch/split/target/ -/batch/chunk-simple-nobeans/target/ -/json/object-builder/target/ -/json/object-reader/target/ -/json/streaming-generate/target/ -/json/streaming-parser/target/ -/websocket/binary/target/ -/websocket/whiteboard/target/ -/cdi/vetoed/target/ -/cdi/pkg-level/target/ -/cdi/decorators/target/ -/cdi/bean-discovery-all/target/ -/cdi/bean-discovery-none/target/ -/cdi/bean-discovery-annotated/target/ -/cdi/exclude-filter/target/ -/cdi/built-in/target/ -/cdi/interceptors/target/ -/cdi/nobeans-xml/target/ -/cdi/beansxml-noversion/target/ -/cdi/beanmanager/target/ -/concurrency/dynamicproxy/target/ -/concurrency/executor/target/ -/concurrency/schedule/target/ -/concurrency/threads/target/ -/websocket/chat/target/ -/websocket/encoder/target/ -/websocket/encoder-client/target/ -/websocket/encoder-programmatic/target/ -/websocket/endpoint/target/ -/websocket/endpoint-async/target/ -/jaxrs/endpoint/target/ -/jaxrs/client/target/ -/jsf/server-extension/target/ -/jaxrs/jaxrs-endpoint/target/ -/jaxrs/jaxrs-client/target/ -/jsf/http-get/target/ -/websocket/endpoint-javatypes/target/ -/websocket/endpoint-config/target/ -/websocket/endpoint-programmatic/target/ -/websocket/endpoint-programmatic-async/target/ -/websocket/endpoint-programmatic-config/target/ -/websocket/endpoint-programmatic-injection/target/ -/websocket/endpoint-security/target/ -/websocket/httpsession/target/ -/websocket/injection/target/ -/websocket/messagesize/target/ -/websocket/parameters/target/ -/websocket/websocket-vs-rest/target/ -/websocket/subprotocol/target/ -/websocket/websocket-client/target/ -/websocket/websocket-client-config/target/ -/websocket/websocket-client-programmatic/target/ -/websocket/websocket-client-programmatic-config/target/ -/websocket/websocket-client-programmatic-encoders/target/ -/websocket/javase-client/target/ -/ejb/stateful/target/ -/jpa/pu-typesafe/target/ -/jpa/criteria/target/ -/jta/transactional/target/ -/jta/transaction-scope/target/ -/jta/tx-exception/target/ -/ejb/stateless/target/ -/servlet/cookies/target/ -/jpa/schema-gen-scripts/target/ -/jta/user-transaction/target/ -/ejb/singleton/target/ -/ejb/lifecycle/singleton/target/ -/servlet/async-servlet/target/ -/jms/send-receive-simple/target/ -/jms/send-receive/target/ -/servlet/error-mapping/target/ -/servlet/event-listeners/target/ -/servlet/metadata-complete/target/ -/servlet/nonblocking/target/ -/servlet/resource-packaging/target/ -/servlet/servlet-filters/target/ -/servlet/web-fragment/target/ -/servlet/servlet-security/target/ -/jsf/flows-simple/target/ -/jsf/flows-mixed/target/ -/jaxrs/client-negotiation/target/ -/jpa/schema-gen-scripts-generate/target/ -/jaxrs/readerwriter-injection/target/ -/jsf/flows-programmatic/target/ -/jsf/flows-declarative/target/ -/javamail/definition/target/ -/jta/transactional-scope/target/ -/cdi/extension-impl/target/ -/cdi/extension/target/ -/batch/chunk-csv-database/target/ -/batch/chunk-optional-processor/target/ -/batch/chunk-partition/target/ -/jpa/listeners/target/ -/jpa/multiple-pu/target/ -/json/twitter-search/target/ -/jsf/radio-buttons/target/ -/jsf/viewscoped/target/ -/ejb/lifecycle/target/ -/jpa/schema-gen/target/ -/jpa/storedprocedure/target/ -/jsf/contracts/target/ -/jsf/contracts-library/target/ -/jsf/file-upload/target/ -/extra/quartz/target/ -/extra/twitter-search/target/ -/concurrency/managedexecutor/target/ -/concurrency/managedscheduledexecutor/target/ -/concurrency/manageablethread/target/ -/batch/chunk-simple/target/ \ No newline at end of file +# Directories # +/build/ +/bin/ +target/ +libs/ + +# OS Files # +.DS_Store + +*.class + +# Package Files # +*.jar +*.war +*.ear +*.db +rebel.xml + +###################### +# Windows +###################### + +# Windows image file caches +Thumbs.db + +# Folder config file +Desktop.ini + +###################### +# OSX +###################### + +.DS_Store +.svn + +# Thumbnails +._* + +# Files that might appear on external disk +.Spotlight-V100 +.Trashes + +###################### +# IDEA +###################### +*.iml + +###################### +# Eclipse +###################### + +*.pydevproject +.project +.metadata +bin/** +tmp/** +tmp/**/* +*.tmp +*.bak +*.swp +*~.nib +local.properties +.classpath +.settings/ +.loadpath +/src/main/resources/rebel.xml +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# CDT-specific +.cproject + +# PDT-specific +.buildpath \ No newline at end of file diff --git a/pom.xml b/pom.xml index 72dd86b90..0bda70765 100644 --- a/pom.xml +++ b/pom.xml @@ -266,12 +266,21 @@ javadocs + javadocs + org.apache.maven.plugins maven-dependency-plugin - 2.8 + 2.4 sources From d85165f994535b37466b5521fc8c691ecc5523ab Mon Sep 17 00:00:00 2001 From: Heiko Scherrer Date: Mon, 7 Oct 2013 19:49:17 +0200 Subject: [PATCH 003/905] Added maven-enforcer-plugin to take care of Maven in version 3.x and Java 1.7, to avoid clashes on developer environment --- pom.xml | 58 ++++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 49 insertions(+), 9 deletions(-) diff --git a/pom.xml b/pom.xml index 0bda70765..44267415d 100644 --- a/pom.xml +++ b/pom.xml @@ -1,5 +1,5 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.javaee7 @@ -9,6 +9,8 @@ Java EE 7 Samples + 1.7 + 3.0.0 glassfish4x /Users/arungup/tools/glassfish/4.0/final/glassfish4 wildfly8x @@ -17,8 +19,11 @@ weblogic12x /Users/arungup/tools/weblogic/12c/wlserver gfv3ee6 + + + 1.3.1 - + javax @@ -33,7 +38,7 @@ provided - + codehaus-snapshots @@ -70,8 +75,8 @@ maven-compiler-plugin 2.3.2 - 1.7 - 1.7 + ${java.min.version} + ${java.min.version} @@ -111,9 +116,36 @@ + + maven-enforcer-plugin + + + + At least Maven in version ${maven.min.version} is required. + ${maven.min.version} + + + At least a JDK in version ${java.min.version} is required. + ${java.min.version} + + + + + enforce + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + ${plugin.enforcer.version} + + + - + glassfish @@ -165,14 +197,14 @@ 8080 8181 - + org.glassfish.main.common simple-glassfish-api 4.0 - + org.glassfish.main.extras glassfish-embedded-all @@ -266,7 +298,11 @@ javadocs - javadocs + + + javadocs + + + + \ No newline at end of file diff --git a/extra/nosql/voldemort/src/main/webapp/WEB-INF/template.xhtml b/extra/nosql/voldemort/src/main/webapp/WEB-INF/template.xhtml new file mode 100644 index 000000000..31d2e3aeb --- /dev/null +++ b/extra/nosql/voldemort/src/main/webapp/WEB-INF/template.xhtml @@ -0,0 +1,26 @@ + + + + + + + + + Voldemort using Java EE 7 + + + + +
+

Voldemort using Java EE 7

+
+ +
+ Content +
+ +
+ + diff --git a/extra/nosql/voldemort/src/main/webapp/WEB-INF/web.xml b/extra/nosql/voldemort/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 000000000..c5e7c7381 --- /dev/null +++ b/extra/nosql/voldemort/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,24 @@ + + + + javax.faces.PROJECT_STAGE + Development + + + Faces Servlet + javax.faces.webapp.FacesServlet + 1 + + + Faces Servlet + /faces/* + + + + 30 + + + + faces/index.xhtml + + diff --git a/extra/nosql/voldemort/src/main/webapp/index.xhtml b/extra/nosql/voldemort/src/main/webapp/index.xhtml new file mode 100644 index 000000000..457c3dba9 --- /dev/null +++ b/extra/nosql/voldemort/src/main/webapp/index.xhtml @@ -0,0 +1,29 @@ + + + + + + + + + + + Name:
+ Age:

+ +
+
+ +
+ +
+ + + diff --git a/extra/nosql/voldemort/src/main/webapp/resources/css/cssLayout.css b/extra/nosql/voldemort/src/main/webapp/resources/css/cssLayout.css new file mode 100644 index 000000000..8ee7cebe3 --- /dev/null +++ b/extra/nosql/voldemort/src/main/webapp/resources/css/cssLayout.css @@ -0,0 +1,61 @@ + +#top { + position: relative; + background-color: #036fab; + color: white; + padding: 5px; + margin: 0px 0px 10px 0px; +} + +#bottom { + position: relative; + background-color: #c2dfef; + padding: 5px; + margin: 10px 0px 0px 0px; +} + +#left { + float: left; + background-color: #ece3a5; + padding: 5px; + width: 150px; +} + +#right { + float: right; + background-color: #ece3a5; + padding: 5px; + width: 150px; +} + +.center_content { + position: relative; + background-color: #dddddd; + padding: 5px; +} + +.left_content { + background-color: #dddddd; + padding: 5px; + margin-left: 170px; +} + +.right_content { + background-color: #dddddd; + padding: 5px; + margin: 0px 170px 0px 170px; +} + +#top a:link, #top a:visited { + color: white; + font-weight : bold; + text-decoration: none; +} + +#top a:link:hover, #top a:visited:hover { + color: black; + font-weight : bold; + text-decoration : underline; +} + + diff --git a/extra/nosql/voldemort/src/main/webapp/resources/css/default.css b/extra/nosql/voldemort/src/main/webapp/resources/css/default.css new file mode 100644 index 000000000..6cbc3d18e --- /dev/null +++ b/extra/nosql/voldemort/src/main/webapp/resources/css/default.css @@ -0,0 +1,29 @@ +body { + background-color: #ffffff; + font-size: 12px; + font-family: Verdana, "Verdana CE", Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif; + color: #000000; + margin: 10px; +} + +h1 { + font-family: Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif; + border-bottom: 1px solid #AFAFAF; + font-size: 16px; + font-weight: bold; + margin: 0px; + padding: 0px; + color: #D20005; +} + +a:link, a:visited { + color: #045491; + font-weight : bold; + text-decoration: none; +} + +a:link:hover, a:visited:hover { + color: #045491; + font-weight : bold; + text-decoration : underline; +} diff --git a/extra/nosql/voldemort/src/main/webapp/show.xhtml b/extra/nosql/voldemort/src/main/webapp/show.xhtml new file mode 100644 index 000000000..8f1d60f31 --- /dev/null +++ b/extra/nosql/voldemort/src/main/webapp/show.xhtml @@ -0,0 +1,27 @@ + + + + + + + + + + + Name#{p.name} + Age#{p.age} + +

+ + + + +
+ +
+ + + From 3a36540c684f577daa89c3e32d798dcf0cb0f267 Mon Sep 17 00:00:00 2001 From: Arun Gupta Date: Mon, 7 Oct 2013 17:32:55 -0700 Subject: [PATCH 007/905] Starting work on Alternatives sample --- cdi/alternatives/pom.xml | 15 +++ .../org/javaee7/cdi/alternatives/Fancy.java | 58 ++++++++ .../cdi/alternatives/FancyGreeting.java | 56 ++++++++ .../javaee7/cdi/alternatives/Greeting.java | 47 +++++++ .../cdi/alternatives/SimpleGreeting.java | 55 ++++++++ .../javaee7/cdi/alternatives/TestServlet.java | 127 ++++++++++++++++++ .../src/main/webapp/WEB-INF/beans.xml | 52 +++++++ cdi/alternatives/src/main/webapp/index.jsp | 55 ++++++++ 8 files changed, 465 insertions(+) create mode 100644 cdi/alternatives/pom.xml create mode 100644 cdi/alternatives/src/main/java/org/javaee7/cdi/alternatives/Fancy.java create mode 100644 cdi/alternatives/src/main/java/org/javaee7/cdi/alternatives/FancyGreeting.java create mode 100644 cdi/alternatives/src/main/java/org/javaee7/cdi/alternatives/Greeting.java create mode 100644 cdi/alternatives/src/main/java/org/javaee7/cdi/alternatives/SimpleGreeting.java create mode 100644 cdi/alternatives/src/main/java/org/javaee7/cdi/alternatives/TestServlet.java create mode 100644 cdi/alternatives/src/main/webapp/WEB-INF/beans.xml create mode 100644 cdi/alternatives/src/main/webapp/index.jsp diff --git a/cdi/alternatives/pom.xml b/cdi/alternatives/pom.xml new file mode 100644 index 000000000..6f1fcf381 --- /dev/null +++ b/cdi/alternatives/pom.xml @@ -0,0 +1,15 @@ + + + 4.0.0 + + org.javaee7.cdi + cdi-samples + 1.0-SNAPSHOT + ../pom.xml + + + org.javaee7.cdi + alternatives + 1.0-SNAPSHOT + war + diff --git a/cdi/alternatives/src/main/java/org/javaee7/cdi/alternatives/Fancy.java b/cdi/alternatives/src/main/java/org/javaee7/cdi/alternatives/Fancy.java new file mode 100644 index 000000000..a30c0f6d3 --- /dev/null +++ b/cdi/alternatives/src/main/java/org/javaee7/cdi/alternatives/Fancy.java @@ -0,0 +1,58 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common Development + * and Distribution License("CDDL") (collectively, the "License"). You + * may not use this file except in compliance with the License. You can + * obtain a copy of the License at + * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html + * or packager/legal/LICENSE.txt. See the License for the specific + * language governing permissions and limitations under the License. + * + * When distributing the software, include this License Header Notice in each + * file and include the License file at packager/legal/LICENSE.txt. + * + * GPL Classpath Exception: + * Oracle designates this particular file as subject to the "Classpath" + * exception as provided by Oracle in the GPL Version 2 section of the License + * file that accompanied this code. + * + * Modifications: + * If applicable, add the following below the License Header, with the fields + * enclosed by brackets [] replaced by your own identifying information: + * "Portions Copyright [year] [name of copyright owner]" + * + * Contributor(s): + * If you wish your version of this file to be governed by only the CDDL or + * only the GPL Version 2, indicate your decision by adding "[Contributor] + * elects to include this software in this distribution under the [CDDL or GPL + * Version 2] license." If you don't indicate a single choice of license, a + * recipient has the option to distribute your version of this file under + * either the CDDL, the GPL Version 2 or to extend the choice of license to + * its licensees as provided above. However, if you add GPL Version 2 code + * and therefore, elected the GPL Version 2 license, then the option applies + * only if the new code is made subject to such option by the copyright + * holder. + */ +package org.javaee7.cdi.alternatives; + +import static java.lang.annotation.ElementType.TYPE; +import static java.lang.annotation.ElementType.FIELD; +import static java.lang.annotation.ElementType.PARAMETER; +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.RetentionPolicy.RUNTIME; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; +import javax.inject.Qualifier; + +/** + * @author Arun Gupta + */ +@Qualifier +@Retention(RUNTIME) +@Target({METHOD, FIELD, PARAMETER, TYPE}) +public @interface Fancy { +} diff --git a/cdi/alternatives/src/main/java/org/javaee7/cdi/alternatives/FancyGreeting.java b/cdi/alternatives/src/main/java/org/javaee7/cdi/alternatives/FancyGreeting.java new file mode 100644 index 000000000..c08874349 --- /dev/null +++ b/cdi/alternatives/src/main/java/org/javaee7/cdi/alternatives/FancyGreeting.java @@ -0,0 +1,56 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common Development + * and Distribution License("CDDL") (collectively, the "License"). You + * may not use this file except in compliance with the License. You can + * obtain a copy of the License at + * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html + * or packager/legal/LICENSE.txt. See the License for the specific + * language governing permissions and limitations under the License. + * + * When distributing the software, include this License Header Notice in each + * file and include the License file at packager/legal/LICENSE.txt. + * + * GPL Classpath Exception: + * Oracle designates this particular file as subject to the "Classpath" + * exception as provided by Oracle in the GPL Version 2 section of the License + * file that accompanied this code. + * + * Modifications: + * If applicable, add the following below the License Header, with the fields + * enclosed by brackets [] replaced by your own identifying information: + * "Portions Copyright [year] [name of copyright owner]" + * + * Contributor(s): + * If you wish your version of this file to be governed by only the CDDL or + * only the GPL Version 2, indicate your decision by adding "[Contributor] + * elects to include this software in this distribution under the [CDDL or GPL + * Version 2] license." If you don't indicate a single choice of license, a + * recipient has the option to distribute your version of this file under + * either the CDDL, the GPL Version 2 or to extend the choice of license to + * its licensees as provided above. However, if you add GPL Version 2 code + * and therefore, elected the GPL Version 2 license, then the option applies + * only if the new code is made subject to such option by the copyright + * holder. + */ +package org.javaee7.cdi.alternatives; + +import javax.enterprise.inject.Alternative; + +/** + * @author Arun Gupta + */ +@Fancy +@Alternative +public class FancyGreeting implements Greeting { + + @Override + public String greet(String name) { + return "Nice to meet you, hello" + name; + } + +} diff --git a/cdi/alternatives/src/main/java/org/javaee7/cdi/alternatives/Greeting.java b/cdi/alternatives/src/main/java/org/javaee7/cdi/alternatives/Greeting.java new file mode 100644 index 000000000..7c65d641f --- /dev/null +++ b/cdi/alternatives/src/main/java/org/javaee7/cdi/alternatives/Greeting.java @@ -0,0 +1,47 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common Development + * and Distribution License("CDDL") (collectively, the "License"). You + * may not use this file except in compliance with the License. You can + * obtain a copy of the License at + * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html + * or packager/legal/LICENSE.txt. See the License for the specific + * language governing permissions and limitations under the License. + * + * When distributing the software, include this License Header Notice in each + * file and include the License file at packager/legal/LICENSE.txt. + * + * GPL Classpath Exception: + * Oracle designates this particular file as subject to the "Classpath" + * exception as provided by Oracle in the GPL Version 2 section of the License + * file that accompanied this code. + * + * Modifications: + * If applicable, add the following below the License Header, with the fields + * enclosed by brackets [] replaced by your own identifying information: + * "Portions Copyright [year] [name of copyright owner]" + * + * Contributor(s): + * If you wish your version of this file to be governed by only the CDDL or + * only the GPL Version 2, indicate your decision by adding "[Contributor] + * elects to include this software in this distribution under the [CDDL or GPL + * Version 2] license." If you don't indicate a single choice of license, a + * recipient has the option to distribute your version of this file under + * either the CDDL, the GPL Version 2 or to extend the choice of license to + * its licensees as provided above. However, if you add GPL Version 2 code + * and therefore, elected the GPL Version 2 license, then the option applies + * only if the new code is made subject to such option by the copyright + * holder. + */ +package org.javaee7.cdi.alternatives; + +/** + * @author Arun Gupta + */ +public interface Greeting { + public String greet(String name); +} diff --git a/cdi/alternatives/src/main/java/org/javaee7/cdi/alternatives/SimpleGreeting.java b/cdi/alternatives/src/main/java/org/javaee7/cdi/alternatives/SimpleGreeting.java new file mode 100644 index 000000000..9ea9b18ea --- /dev/null +++ b/cdi/alternatives/src/main/java/org/javaee7/cdi/alternatives/SimpleGreeting.java @@ -0,0 +1,55 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common Development + * and Distribution License("CDDL") (collectively, the "License"). You + * may not use this file except in compliance with the License. You can + * obtain a copy of the License at + * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html + * or packager/legal/LICENSE.txt. See the License for the specific + * language governing permissions and limitations under the License. + * + * When distributing the software, include this License Header Notice in each + * file and include the License file at packager/legal/LICENSE.txt. + * + * GPL Classpath Exception: + * Oracle designates this particular file as subject to the "Classpath" + * exception as provided by Oracle in the GPL Version 2 section of the License + * file that accompanied this code. + * + * Modifications: + * If applicable, add the following below the License Header, with the fields + * enclosed by brackets [] replaced by your own identifying information: + * "Portions Copyright [year] [name of copyright owner]" + * + * Contributor(s): + * If you wish your version of this file to be governed by only the CDDL or + * only the GPL Version 2, indicate your decision by adding "[Contributor] + * elects to include this software in this distribution under the [CDDL or GPL + * Version 2] license." If you don't indicate a single choice of license, a + * recipient has the option to distribute your version of this file under + * either the CDDL, the GPL Version 2 or to extend the choice of license to + * its licensees as provided above. However, if you add GPL Version 2 code + * and therefore, elected the GPL Version 2 license, then the option applies + * only if the new code is made subject to such option by the copyright + * holder. + */ +package org.javaee7.cdi.alternatives; + +import javax.enterprise.inject.Alternative; + +/** + * @author Arun Gupta + */ +@Alternative +public class SimpleGreeting implements Greeting { + + @Override + public String greet(String name) { + return "Hello " + name; + } + +} diff --git a/cdi/alternatives/src/main/java/org/javaee7/cdi/alternatives/TestServlet.java b/cdi/alternatives/src/main/java/org/javaee7/cdi/alternatives/TestServlet.java new file mode 100644 index 000000000..821fb7fec --- /dev/null +++ b/cdi/alternatives/src/main/java/org/javaee7/cdi/alternatives/TestServlet.java @@ -0,0 +1,127 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common Development + * and Distribution License("CDDL") (collectively, the "License"). You + * may not use this file except in compliance with the License. You can + * obtain a copy of the License at + * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html + * or packager/legal/LICENSE.txt. See the License for the specific + * language governing permissions and limitations under the License. + * + * When distributing the software, include this License Header Notice in each + * file and include the License file at packager/legal/LICENSE.txt. + * + * GPL Classpath Exception: + * Oracle designates this particular file as subject to the "Classpath" + * exception as provided by Oracle in the GPL Version 2 section of the License + * file that accompanied this code. + * + * Modifications: + * If applicable, add the following below the License Header, with the fields + * enclosed by brackets [] replaced by your own identifying information: + * "Portions Copyright [year] [name of copyright owner]" + * + * Contributor(s): + * If you wish your version of this file to be governed by only the CDDL or + * only the GPL Version 2, indicate your decision by adding "[Contributor] + * elects to include this software in this distribution under the [CDDL or GPL + * Version 2] license." If you don't indicate a single choice of license, a + * recipient has the option to distribute your version of this file under + * either the CDDL, the GPL Version 2 or to extend the choice of license to + * its licensees as provided above. However, if you add GPL Version 2 code + * and therefore, elected the GPL Version 2 license, then the option applies + * only if the new code is made subject to such option by the copyright + * holder. + */ +package org.javaee7.cdi.alternatives; + +import java.io.IOException; +import java.io.PrintWriter; +import javax.inject.Inject; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * @author Arun Gupta + */ +@WebServlet(urlPatterns = {"/TestServlet"}) +public class TestServlet extends HttpServlet { + + @Inject Greeting greeting; + + /** + * Processes requests for both HTTP + * GET and + * POST methods. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + protected void processRequest(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + response.setContentType("text/html;charset=UTF-8"); + try (PrintWriter out = response.getWriter()) { + out.println(""); + out.println(""); + out.println(""); + out.println("CDI Interceptors"); + out.println(""); + out.println(""); + out.println("

CDI Interceptors

"); + out.println(greeting.greet("Duke")); + out.println("

Look for output in \"server.log\"."); + out.println(""); + out.println(""); + } + } + + // + /** + * Handles the HTTP + * GET method. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + processRequest(request, response); + } + + /** + * Handles the HTTP + * POST method. + * + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + processRequest(request, response); + } + + /** + * Returns a short description of the servlet. + * + * @return a String containing servlet description + */ + @Override + public String getServletInfo() { + return "Short description"; + }// +} diff --git a/cdi/alternatives/src/main/webapp/WEB-INF/beans.xml b/cdi/alternatives/src/main/webapp/WEB-INF/beans.xml new file mode 100644 index 000000000..ea66c22d0 --- /dev/null +++ b/cdi/alternatives/src/main/webapp/WEB-INF/beans.xml @@ -0,0 +1,52 @@ + + + + + org.javaee7.cdi.alternatives.FancyGreeting + + diff --git a/cdi/alternatives/src/main/webapp/index.jsp b/cdi/alternatives/src/main/webapp/index.jsp new file mode 100644 index 000000000..fc02ee19d --- /dev/null +++ b/cdi/alternatives/src/main/webapp/index.jsp @@ -0,0 +1,55 @@ + +<%@page contentType="text/html" pageEncoding="UTF-8"%> + + + + + + CDI : Alternatives + + +

CDI : Alternatives

+ Invoke the client. + + From 8be988cfce0bc882b0caaea6bc4b22b9c9025937 Mon Sep 17 00:00:00 2001 From: Arun Gupta Date: Tue, 8 Oct 2013 14:41:19 -0700 Subject: [PATCH 008/905] Adding alternatives module --- cdi/pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/cdi/pom.xml b/cdi/pom.xml index bf10b1f41..6d9a4bd77 100644 --- a/cdi/pom.xml +++ b/cdi/pom.xml @@ -29,5 +29,6 @@ beanmanager extension scopes + alternatives From b327f697479562fa3572071b0ead1df7e5fefe8a Mon Sep 17 00:00:00 2001 From: Arun Gupta Date: Tue, 8 Oct 2013 16:57:25 -0700 Subject: [PATCH 009/905] Adding riak module --- extra/nosql/pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/extra/nosql/pom.xml b/extra/nosql/pom.xml index cc3b0bd64..4c3088fa7 100644 --- a/extra/nosql/pom.xml +++ b/extra/nosql/pom.xml @@ -22,5 +22,6 @@ neo4j hbase voldemort + riak From aa2b1a46d499fee4635f89c845329a367aed7b53 Mon Sep 17 00:00:00 2001 From: Arun Gupta Date: Tue, 8 Oct 2013 16:57:34 -0700 Subject: [PATCH 010/905] Adding Riak module --- extra/nosql/riak/pom.xml | 30 +++++ .../org/javaee7/extra/nosql/riak/Person.java | 95 +++++++++++++++ .../extra/nosql/riak/PersonSessionBean.java | 109 ++++++++++++++++++ .../riak/src/main/webapp/WEB-INF/beans.xml | 49 ++++++++ .../src/main/webapp/WEB-INF/template.xhtml | 26 +++++ .../riak/src/main/webapp/WEB-INF/web.xml | 24 ++++ extra/nosql/riak/src/main/webapp/index.xhtml | 49 ++++++++ .../main/webapp/resources/css/cssLayout.css | 61 ++++++++++ .../src/main/webapp/resources/css/default.css | 29 +++++ extra/nosql/riak/src/main/webapp/show.xhtml | 27 +++++ 10 files changed, 499 insertions(+) create mode 100644 extra/nosql/riak/pom.xml create mode 100644 extra/nosql/riak/src/main/java/org/javaee7/extra/nosql/riak/Person.java create mode 100644 extra/nosql/riak/src/main/java/org/javaee7/extra/nosql/riak/PersonSessionBean.java create mode 100644 extra/nosql/riak/src/main/webapp/WEB-INF/beans.xml create mode 100644 extra/nosql/riak/src/main/webapp/WEB-INF/template.xhtml create mode 100644 extra/nosql/riak/src/main/webapp/WEB-INF/web.xml create mode 100644 extra/nosql/riak/src/main/webapp/index.xhtml create mode 100644 extra/nosql/riak/src/main/webapp/resources/css/cssLayout.css create mode 100644 extra/nosql/riak/src/main/webapp/resources/css/default.css create mode 100644 extra/nosql/riak/src/main/webapp/show.xhtml diff --git a/extra/nosql/riak/pom.xml b/extra/nosql/riak/pom.xml new file mode 100644 index 000000000..73eb681e1 --- /dev/null +++ b/extra/nosql/riak/pom.xml @@ -0,0 +1,30 @@ + + + 4.0.0 + + org.javaee7.extra.nosql + extra-nosql-samples + 1.0-SNAPSHOT + ../pom.xml + + + org.javaee7.extra.nosql + riak + 1.0-SNAPSHOT + war + + + + voldemort-repo + http://repo.springsource.org/plugins-release/ + + + + + + com.basho.riak + riak-client + 1.4.1 + + + diff --git a/extra/nosql/riak/src/main/java/org/javaee7/extra/nosql/riak/Person.java b/extra/nosql/riak/src/main/java/org/javaee7/extra/nosql/riak/Person.java new file mode 100644 index 000000000..154f2a246 --- /dev/null +++ b/extra/nosql/riak/src/main/java/org/javaee7/extra/nosql/riak/Person.java @@ -0,0 +1,95 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common Development + * and Distribution License("CDDL") (collectively, the "License"). You + * may not use this file except in compliance with the License. You can + * obtain a copy of the License at + * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html + * or packager/legal/LICENSE.txt. See the License for the specific + * language governing permissions and limitations under the License. + * + * When distributing the software, include this License Header Notice in each + * file and include the License file at packager/legal/LICENSE.txt. + * + * GPL Classpath Exception: + * Oracle designates this particular file as subject to the "Classpath" + * exception as provided by Oracle in the GPL Version 2 section of the License + * file that accompanied this code. + * + * Modifications: + * If applicable, add the following below the License Header, with the fields + * enclosed by brackets [] replaced by your own identifying information: + * "Portions Copyright [year] [name of copyright owner]" + * + * Contributor(s): + * If you wish your version of this file to be governed by only the CDDL or + * only the GPL Version 2, indicate your decision by adding "[Contributor] + * elects to include this software in this distribution under the [CDDL or GPL + * Version 2] license." If you don't indicate a single choice of license, a + * recipient has the option to distribute your version of this file under + * either the CDDL, the GPL Version 2 or to extend the choice of license to + * its licensees as provided above. However, if you add GPL Version 2 code + * and therefore, elected the GPL Version 2 license, then the option applies + * only if the new code is made subject to such option by the copyright + * holder. + */ +package org.javaee7.extra.nosql.riak; + +import java.io.Serializable; +import java.util.StringTokenizer; +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Named; +import javax.validation.constraints.Size; + +/** + * @author Arun Gupta + */ +@Named +@ApplicationScoped +public class Person implements Serializable { + + @Size(min = 1, max = 20) + private String name; + + private int age; + + public Person() { + } + + public Person(String name, int age) { + this.name = name; + this.age = age; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public int getAge() { + return age; + } + + public void setAge(int age) { + this.age = age; + } + + @Override + public String toString() { + return name + ", " + age; + } + + public static Person fromString(String string) { + StringTokenizer tokens = new StringTokenizer(string, ","); + + return new Person(tokens.nextToken(), Integer.parseInt(tokens.nextToken().trim())); + } + +} diff --git a/extra/nosql/riak/src/main/java/org/javaee7/extra/nosql/riak/PersonSessionBean.java b/extra/nosql/riak/src/main/java/org/javaee7/extra/nosql/riak/PersonSessionBean.java new file mode 100644 index 000000000..85d04d6ad --- /dev/null +++ b/extra/nosql/riak/src/main/java/org/javaee7/extra/nosql/riak/PersonSessionBean.java @@ -0,0 +1,109 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common Development + * and Distribution License("CDDL") (collectively, the "License"). You + * may not use this file except in compliance with the License. You can + * obtain a copy of the License at + * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html + * or packager/legal/LICENSE.txt. See the License for the specific + * language governing permissions and limitations under the License. + * + * When distributing the software, include this License Header Notice in each + * file and include the License file at packager/legal/LICENSE.txt. + * + * GPL Classpath Exception: + * Oracle designates this particular file as subject to the "Classpath" + * exception as provided by Oracle in the GPL Version 2 section of the License + * file that accompanied this code. + * + * Modifications: + * If applicable, add the following below the License Header, with the fields + * enclosed by brackets [] replaced by your own identifying information: + * "Portions Copyright [year] [name of copyright owner]" + * + * Contributor(s): + * If you wish your version of this file to be governed by only the CDDL or + * only the GPL Version 2, indicate your decision by adding "[Contributor] + * elects to include this software in this distribution under the [CDDL or GPL + * Version 2] license." If you don't indicate a single choice of license, a + * recipient has the option to distribute your version of this file under + * either the CDDL, the GPL Version 2 or to extend the choice of license to + * its licensees as provided above. However, if you add GPL Version 2 code + * and therefore, elected the GPL Version 2 license, then the option applies + * only if the new code is made subject to such option by the copyright + * holder. + */ +package org.javaee7.extra.nosql.riak; + +import com.basho.riak.client.IRiakClient; +import com.basho.riak.client.RiakException; +import com.basho.riak.client.RiakFactory; +import com.basho.riak.client.RiakRetryFailedException; +import com.basho.riak.client.bucket.Bucket; +import com.basho.riak.client.cap.UnresolvedConflictException; +import com.basho.riak.client.convert.ConversionException; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.annotation.PostConstruct; +import javax.annotation.PreDestroy; +import javax.inject.Inject; +import javax.inject.Named; +import javax.inject.Singleton; + +/** + * @author Arun Gupta + */ +@Named +@Singleton +public class PersonSessionBean { + + @Inject + Person person; + + Set set = new HashSet<>(); + Bucket myBucket; + + @PostConstruct + private void initDB() { + try { + IRiakClient client = RiakFactory.pbcClient("localhost", 8087); + myBucket = client.fetchBucket("test").execute(); + } catch (RiakException ex) { + Logger.getLogger(PersonSessionBean.class.getName()).log(Level.SEVERE, null, ex); + } + } + + @PreDestroy + private void stopDB() { + } + + public void createPerson() { + try { + myBucket.store(person.getName(), new Person(person.getName(), person.getAge())).execute(); + set.add(person.getName()); + } catch (RiakRetryFailedException | UnresolvedConflictException | ConversionException ex) { + Logger.getLogger(PersonSessionBean.class.getName()).log(Level.SEVERE, null, ex); + } + } + + public List getPersons() { + List persons = new ArrayList(); + for (String key : set) { + try { + Person p = myBucket.fetch(key, Person.class).execute(); + persons.add(p); + } catch (UnresolvedConflictException | RiakRetryFailedException | ConversionException ex) { + Logger.getLogger(PersonSessionBean.class.getName()).log(Level.SEVERE, null, ex); + } + } + return persons; + } +} diff --git a/extra/nosql/riak/src/main/webapp/WEB-INF/beans.xml b/extra/nosql/riak/src/main/webapp/WEB-INF/beans.xml new file mode 100644 index 000000000..aa81c7c3c --- /dev/null +++ b/extra/nosql/riak/src/main/webapp/WEB-INF/beans.xml @@ -0,0 +1,49 @@ + + + + \ No newline at end of file diff --git a/extra/nosql/riak/src/main/webapp/WEB-INF/template.xhtml b/extra/nosql/riak/src/main/webapp/WEB-INF/template.xhtml new file mode 100644 index 000000000..730271b63 --- /dev/null +++ b/extra/nosql/riak/src/main/webapp/WEB-INF/template.xhtml @@ -0,0 +1,26 @@ + + + + + + + + + Riak using Java EE 7 + + + + +
+

Riak using Java EE 7

+
+ +
+ Content +
+ +
+ + diff --git a/extra/nosql/riak/src/main/webapp/WEB-INF/web.xml b/extra/nosql/riak/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 000000000..c5e7c7381 --- /dev/null +++ b/extra/nosql/riak/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,24 @@ + + + + javax.faces.PROJECT_STAGE + Development + + + Faces Servlet + javax.faces.webapp.FacesServlet + 1 + + + Faces Servlet + /faces/* + + + + 30 + + + + faces/index.xhtml + + diff --git a/extra/nosql/riak/src/main/webapp/index.xhtml b/extra/nosql/riak/src/main/webapp/index.xhtml new file mode 100644 index 000000000..b05d3200a --- /dev/null +++ b/extra/nosql/riak/src/main/webapp/index.xhtml @@ -0,0 +1,49 @@ + + + + + + + + + + + Name:
+ Age:

+ +
+
+ + +
    Build from source (more details) +
  • Install Erlang (more details)
  • +
      +
    • curl -O http://erlang.org/download/otp_src_R15B01.tar.gz
    • +
    • tar zxvf otp_src_R15B01.tar.gz
    • +
    • cd otp_src_R15B01
    • +
    • export CFLAGS=-O0
    • +
    • ./configure --disable-hipe --enable-smp-support --enable-threads --enable-kernel-poll --enable-darwin-64bit
    • +
    • unset CFLAGS
    • +
    • make
    • +
    • make install
    • +
    +
  • wget http://s3.amazonaws.com/downloads.basho.com/riak/1.4/1.4.2/riak-1.4.2.tar.gz
  • +
  • tar zxvf riak-1.4.2.tar.gz
  • +
  • cd riak-1.4.2
  • +
  • make rel
  • +
  • cd rel/riak
  • +
  • ./bin/riak start
  • +
  • ./bin/riak ping (to verify)
  • +
+
+ +
+ + + diff --git a/extra/nosql/riak/src/main/webapp/resources/css/cssLayout.css b/extra/nosql/riak/src/main/webapp/resources/css/cssLayout.css new file mode 100644 index 000000000..8ee7cebe3 --- /dev/null +++ b/extra/nosql/riak/src/main/webapp/resources/css/cssLayout.css @@ -0,0 +1,61 @@ + +#top { + position: relative; + background-color: #036fab; + color: white; + padding: 5px; + margin: 0px 0px 10px 0px; +} + +#bottom { + position: relative; + background-color: #c2dfef; + padding: 5px; + margin: 10px 0px 0px 0px; +} + +#left { + float: left; + background-color: #ece3a5; + padding: 5px; + width: 150px; +} + +#right { + float: right; + background-color: #ece3a5; + padding: 5px; + width: 150px; +} + +.center_content { + position: relative; + background-color: #dddddd; + padding: 5px; +} + +.left_content { + background-color: #dddddd; + padding: 5px; + margin-left: 170px; +} + +.right_content { + background-color: #dddddd; + padding: 5px; + margin: 0px 170px 0px 170px; +} + +#top a:link, #top a:visited { + color: white; + font-weight : bold; + text-decoration: none; +} + +#top a:link:hover, #top a:visited:hover { + color: black; + font-weight : bold; + text-decoration : underline; +} + + diff --git a/extra/nosql/riak/src/main/webapp/resources/css/default.css b/extra/nosql/riak/src/main/webapp/resources/css/default.css new file mode 100644 index 000000000..6cbc3d18e --- /dev/null +++ b/extra/nosql/riak/src/main/webapp/resources/css/default.css @@ -0,0 +1,29 @@ +body { + background-color: #ffffff; + font-size: 12px; + font-family: Verdana, "Verdana CE", Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif; + color: #000000; + margin: 10px; +} + +h1 { + font-family: Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif; + border-bottom: 1px solid #AFAFAF; + font-size: 16px; + font-weight: bold; + margin: 0px; + padding: 0px; + color: #D20005; +} + +a:link, a:visited { + color: #045491; + font-weight : bold; + text-decoration: none; +} + +a:link:hover, a:visited:hover { + color: #045491; + font-weight : bold; + text-decoration : underline; +} diff --git a/extra/nosql/riak/src/main/webapp/show.xhtml b/extra/nosql/riak/src/main/webapp/show.xhtml new file mode 100644 index 000000000..8f1d60f31 --- /dev/null +++ b/extra/nosql/riak/src/main/webapp/show.xhtml @@ -0,0 +1,27 @@ + + + + + + + + + + + Name#{p.name} + Age#{p.age} + +

+ + + + +
+ +
+ + + From 2d3edb86f95c0154885ac673e01e25f9c15c93ef Mon Sep 17 00:00:00 2001 From: Arun Gupta Date: Thu, 10 Oct 2013 14:04:06 -0700 Subject: [PATCH 011/905] Adding new sample for Oracle NoSQL --- extra/nosql/oracle/pom.xml | 23 +++++ .../javaee7/extra/nosql/oracle/Person.java | 95 +++++++++++++++++++ .../extra/nosql/oracle/PersonSessionBean.java | 94 ++++++++++++++++++ .../oracle/src/main/webapp/WEB-INF/beans.xml | 49 ++++++++++ .../src/main/webapp/WEB-INF/template.xhtml | 26 +++++ .../oracle/src/main/webapp/WEB-INF/web.xml | 24 +++++ .../nosql/oracle/src/main/webapp/index.xhtml | 33 +++++++ .../main/webapp/resources/css/cssLayout.css | 61 ++++++++++++ .../src/main/webapp/resources/css/default.css | 29 ++++++ extra/nosql/oracle/src/main/webapp/show.xhtml | 27 ++++++ 10 files changed, 461 insertions(+) create mode 100644 extra/nosql/oracle/pom.xml create mode 100644 extra/nosql/oracle/src/main/java/org/javaee7/extra/nosql/oracle/Person.java create mode 100644 extra/nosql/oracle/src/main/java/org/javaee7/extra/nosql/oracle/PersonSessionBean.java create mode 100644 extra/nosql/oracle/src/main/webapp/WEB-INF/beans.xml create mode 100644 extra/nosql/oracle/src/main/webapp/WEB-INF/template.xhtml create mode 100644 extra/nosql/oracle/src/main/webapp/WEB-INF/web.xml create mode 100644 extra/nosql/oracle/src/main/webapp/index.xhtml create mode 100644 extra/nosql/oracle/src/main/webapp/resources/css/cssLayout.css create mode 100644 extra/nosql/oracle/src/main/webapp/resources/css/default.css create mode 100644 extra/nosql/oracle/src/main/webapp/show.xhtml diff --git a/extra/nosql/oracle/pom.xml b/extra/nosql/oracle/pom.xml new file mode 100644 index 000000000..125b0685b --- /dev/null +++ b/extra/nosql/oracle/pom.xml @@ -0,0 +1,23 @@ + + + 4.0.0 + + org.javaee7.extra.nosql + extra-nosql-samples + 1.0-SNAPSHOT + ../pom.xml + + + org.javaee7.extra.nosql + oracle + 1.0-SNAPSHOT + war + + + + com.oracle.nosql + oracle-nosql + 2.1.19 + + + diff --git a/extra/nosql/oracle/src/main/java/org/javaee7/extra/nosql/oracle/Person.java b/extra/nosql/oracle/src/main/java/org/javaee7/extra/nosql/oracle/Person.java new file mode 100644 index 000000000..bec1295d5 --- /dev/null +++ b/extra/nosql/oracle/src/main/java/org/javaee7/extra/nosql/oracle/Person.java @@ -0,0 +1,95 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common Development + * and Distribution License("CDDL") (collectively, the "License"). You + * may not use this file except in compliance with the License. You can + * obtain a copy of the License at + * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html + * or packager/legal/LICENSE.txt. See the License for the specific + * language governing permissions and limitations under the License. + * + * When distributing the software, include this License Header Notice in each + * file and include the License file at packager/legal/LICENSE.txt. + * + * GPL Classpath Exception: + * Oracle designates this particular file as subject to the "Classpath" + * exception as provided by Oracle in the GPL Version 2 section of the License + * file that accompanied this code. + * + * Modifications: + * If applicable, add the following below the License Header, with the fields + * enclosed by brackets [] replaced by your own identifying information: + * "Portions Copyright [year] [name of copyright owner]" + * + * Contributor(s): + * If you wish your version of this file to be governed by only the CDDL or + * only the GPL Version 2, indicate your decision by adding "[Contributor] + * elects to include this software in this distribution under the [CDDL or GPL + * Version 2] license." If you don't indicate a single choice of license, a + * recipient has the option to distribute your version of this file under + * either the CDDL, the GPL Version 2 or to extend the choice of license to + * its licensees as provided above. However, if you add GPL Version 2 code + * and therefore, elected the GPL Version 2 license, then the option applies + * only if the new code is made subject to such option by the copyright + * holder. + */ +package org.javaee7.extra.nosql.oracle; + +import java.io.Serializable; +import java.util.StringTokenizer; +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Named; +import javax.validation.constraints.Size; + +/** + * @author Arun Gupta + */ +@Named +@ApplicationScoped +public class Person implements Serializable { + + @Size(min = 1, max = 20) + private String name; + + private int age; + + public Person() { + } + + public Person(String name, int age) { + this.name = name; + this.age = age; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public int getAge() { + return age; + } + + public void setAge(int age) { + this.age = age; + } + + @Override + public String toString() { + return name + ", " + age; + } + + public static Person fromString(String string) { + StringTokenizer tokens = new StringTokenizer(string, ","); + + return new Person(tokens.nextToken(), Integer.parseInt(tokens.nextToken().trim())); + } + +} diff --git a/extra/nosql/oracle/src/main/java/org/javaee7/extra/nosql/oracle/PersonSessionBean.java b/extra/nosql/oracle/src/main/java/org/javaee7/extra/nosql/oracle/PersonSessionBean.java new file mode 100644 index 000000000..bc1a17a53 --- /dev/null +++ b/extra/nosql/oracle/src/main/java/org/javaee7/extra/nosql/oracle/PersonSessionBean.java @@ -0,0 +1,94 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common Development + * and Distribution License("CDDL") (collectively, the "License"). You + * may not use this file except in compliance with the License. You can + * obtain a copy of the License at + * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html + * or packager/legal/LICENSE.txt. See the License for the specific + * language governing permissions and limitations under the License. + * + * When distributing the software, include this License Header Notice in each + * file and include the License file at packager/legal/LICENSE.txt. + * + * GPL Classpath Exception: + * Oracle designates this particular file as subject to the "Classpath" + * exception as provided by Oracle in the GPL Version 2 section of the License + * file that accompanied this code. + * + * Modifications: + * If applicable, add the following below the License Header, with the fields + * enclosed by brackets [] replaced by your own identifying information: + * "Portions Copyright [year] [name of copyright owner]" + * + * Contributor(s): + * If you wish your version of this file to be governed by only the CDDL or + * only the GPL Version 2, indicate your decision by adding "[Contributor] + * elects to include this software in this distribution under the [CDDL or GPL + * Version 2] license." If you don't indicate a single choice of license, a + * recipient has the option to distribute your version of this file under + * either the CDDL, the GPL Version 2 or to extend the choice of license to + * its licensees as provided above. However, if you add GPL Version 2 code + * and therefore, elected the GPL Version 2 license, then the option applies + * only if the new code is made subject to such option by the copyright + * holder. + */ +package org.javaee7.extra.nosql.oracle; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import javax.annotation.PostConstruct; +import javax.annotation.PreDestroy; +import javax.inject.Inject; +import javax.inject.Named; +import javax.inject.Singleton; +import oracle.kv.KVStore; +import oracle.kv.KVStoreConfig; +import oracle.kv.KVStoreFactory; +import oracle.kv.Key; +import oracle.kv.Value; + +/** + * @author Arun Gupta + */ +@Named +@Singleton +public class PersonSessionBean { + + @Inject + Person person; + + Set set = new HashSet<>(); + + private KVStore store; + + @PostConstruct + private void initDB() { + // bootstrap + store = KVStoreFactory.getStore(new KVStoreConfig("kvstore", "localhost:5000")); + } + + @PreDestroy + private void stopDB() { + } + + public void createPerson() { + store.put(Key.createKey(person.getName()), Value.createValue(new Person(person.getName(), person.getAge()).toString().getBytes())); + set.add(person.getName()); + } + + public List getPersons() { + List persons = new ArrayList(); + for (String key : set) { + persons.add(Person.fromString(new String(store.get(Key.createKey(key)).getValue().getValue()))); + } + return persons; + } +} diff --git a/extra/nosql/oracle/src/main/webapp/WEB-INF/beans.xml b/extra/nosql/oracle/src/main/webapp/WEB-INF/beans.xml new file mode 100644 index 000000000..aa81c7c3c --- /dev/null +++ b/extra/nosql/oracle/src/main/webapp/WEB-INF/beans.xml @@ -0,0 +1,49 @@ + + + + \ No newline at end of file diff --git a/extra/nosql/oracle/src/main/webapp/WEB-INF/template.xhtml b/extra/nosql/oracle/src/main/webapp/WEB-INF/template.xhtml new file mode 100644 index 000000000..3418cda01 --- /dev/null +++ b/extra/nosql/oracle/src/main/webapp/WEB-INF/template.xhtml @@ -0,0 +1,26 @@ + + + + + + + + + Oracle NoSQL using Java EE 7 + + + + +
+

Oracle NoSQL using Java EE 7

+
+ +
+ Content +
+ +
+ + diff --git a/extra/nosql/oracle/src/main/webapp/WEB-INF/web.xml b/extra/nosql/oracle/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 000000000..c5e7c7381 --- /dev/null +++ b/extra/nosql/oracle/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,24 @@ + + + + javax.faces.PROJECT_STAGE + Development + + + Faces Servlet + javax.faces.webapp.FacesServlet + 1 + + + Faces Servlet + /faces/* + + + + 30 + + + + faces/index.xhtml + + diff --git a/extra/nosql/oracle/src/main/webapp/index.xhtml b/extra/nosql/oracle/src/main/webapp/index.xhtml new file mode 100644 index 000000000..eae2f204d --- /dev/null +++ b/extra/nosql/oracle/src/main/webapp/index.xhtml @@ -0,0 +1,33 @@ + + + + + + + + + + + Name:
+ Age:

+ +
+
+
    +
  • Download Oracle NoSQL Community Edition and unzip.
  • +
  • Install the NoSQL Client jar: mvn install:install-file -Dfile=/Users/arungup/tools/oracle/nosql/kv-2.1.19/lib/kvclient.jar -DgroupId=com.oracle.nosql -DartifactId=oracle-nosql -Dversion=2.1.19 -Dpackaging=jar
  • +
  • Start the server as: java -jar lib/kvstore.jar kvlite to see the output as:
    +Created new kvlite store with args:
    +-root ./kvroot -store kvstore -host arungup-mac.local -port 5000 -admin 5001 +
  • +
+
+ +
+ + + diff --git a/extra/nosql/oracle/src/main/webapp/resources/css/cssLayout.css b/extra/nosql/oracle/src/main/webapp/resources/css/cssLayout.css new file mode 100644 index 000000000..8ee7cebe3 --- /dev/null +++ b/extra/nosql/oracle/src/main/webapp/resources/css/cssLayout.css @@ -0,0 +1,61 @@ + +#top { + position: relative; + background-color: #036fab; + color: white; + padding: 5px; + margin: 0px 0px 10px 0px; +} + +#bottom { + position: relative; + background-color: #c2dfef; + padding: 5px; + margin: 10px 0px 0px 0px; +} + +#left { + float: left; + background-color: #ece3a5; + padding: 5px; + width: 150px; +} + +#right { + float: right; + background-color: #ece3a5; + padding: 5px; + width: 150px; +} + +.center_content { + position: relative; + background-color: #dddddd; + padding: 5px; +} + +.left_content { + background-color: #dddddd; + padding: 5px; + margin-left: 170px; +} + +.right_content { + background-color: #dddddd; + padding: 5px; + margin: 0px 170px 0px 170px; +} + +#top a:link, #top a:visited { + color: white; + font-weight : bold; + text-decoration: none; +} + +#top a:link:hover, #top a:visited:hover { + color: black; + font-weight : bold; + text-decoration : underline; +} + + diff --git a/extra/nosql/oracle/src/main/webapp/resources/css/default.css b/extra/nosql/oracle/src/main/webapp/resources/css/default.css new file mode 100644 index 000000000..6cbc3d18e --- /dev/null +++ b/extra/nosql/oracle/src/main/webapp/resources/css/default.css @@ -0,0 +1,29 @@ +body { + background-color: #ffffff; + font-size: 12px; + font-family: Verdana, "Verdana CE", Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif; + color: #000000; + margin: 10px; +} + +h1 { + font-family: Arial, "Arial CE", "Lucida Grande CE", lucida, "Helvetica CE", sans-serif; + border-bottom: 1px solid #AFAFAF; + font-size: 16px; + font-weight: bold; + margin: 0px; + padding: 0px; + color: #D20005; +} + +a:link, a:visited { + color: #045491; + font-weight : bold; + text-decoration: none; +} + +a:link:hover, a:visited:hover { + color: #045491; + font-weight : bold; + text-decoration : underline; +} diff --git a/extra/nosql/oracle/src/main/webapp/show.xhtml b/extra/nosql/oracle/src/main/webapp/show.xhtml new file mode 100644 index 000000000..8f1d60f31 --- /dev/null +++ b/extra/nosql/oracle/src/main/webapp/show.xhtml @@ -0,0 +1,27 @@ + + + + + + + + + + + Name#{p.name} + Age#{p.age} + +

+ + + + +
+ +
+ + + From 3214cca7f2c614e74dbe39c214fa63a730d8305b Mon Sep 17 00:00:00 2001 From: Arun Gupta Date: Thu, 10 Oct 2013 15:41:05 -0700 Subject: [PATCH 012/905] Adding a line break --- extra/nosql/oracle/src/main/webapp/index.xhtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/nosql/oracle/src/main/webapp/index.xhtml b/extra/nosql/oracle/src/main/webapp/index.xhtml index eae2f204d..5e1c6d271 100644 --- a/extra/nosql/oracle/src/main/webapp/index.xhtml +++ b/extra/nosql/oracle/src/main/webapp/index.xhtml @@ -20,7 +20,7 @@