Author: allee8285
Date: Wed Nov 28 22:33:34 2012
New Revision: 1414971
URL: http://svn.apache.org/viewvc?rev=1414971&view=rev
Log:
CMS migration updates.
Added:
openjpa/site/trunk/content/images/deploymentModes.GIF (with props)
openjpa/site/trunk/content/images/welcome-page.JPG (with props)
Modified:
openjpa/site/trunk/WhoIsWorkingOnWhat.txt
openjpa/site/trunk/content/jest-examples.mdtext
openjpa/site/trunk/content/jest-representation.mdtext
openjpa/site/trunk/content/jest-syntax.mdtext
openjpa/site/trunk/content/jest-transaction.mdtext
openjpa/site/trunk/content/jest-usage.mdtext
openjpa/site/trunk/content/jest.mdtext
Modified: openjpa/site/trunk/WhoIsWorkingOnWhat.txt
URL: http://svn.apache.org/viewvc/openjpa/site/trunk/WhoIsWorkingOnWhat.txt?rev=1414971&r1=1414970&r2=1414971&view=diff
==============================================================================
--- openjpa/site/trunk/WhoIsWorkingOnWhat.txt (original)
+++ openjpa/site/trunk/WhoIsWorkingOnWhat.txt Wed Nov 28 22:33:34 2012
@@ -43,12 +43,12 @@ done index.mdtext
done integration.mdtext
done intro.mdtext
done jconsole-datacache-plugin.mdtext
- jest-examples.mdtext
- jest.mdtext
- jest-representation.mdtext
- jest-syntax.mdtext
- jest-transaction.mdtext
- jest-usage.mdtext
+done jest-examples.mdtext
+done jest.mdtext
+done jest-representation.mdtext
+done jest-syntax.mdtext
+done jest-transaction.mdtext
+done jest-usage.mdtext
jpa-2.0-development-process.mdtext
jpa-2.0-iterations.mdtext
jpa-2.0-presentations.mdtext
Added: openjpa/site/trunk/content/images/deploymentModes.GIF
URL: http://svn.apache.org/viewvc/openjpa/site/trunk/content/images/deploymentModes.GIF?rev=1414971&view=auto
==============================================================================
Binary file - no diff available.
Propchange: openjpa/site/trunk/content/images/deploymentModes.GIF
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: openjpa/site/trunk/content/images/welcome-page.JPG
URL: http://svn.apache.org/viewvc/openjpa/site/trunk/content/images/welcome-page.JPG?rev=1414971&view=auto
==============================================================================
Binary file - no diff available.
Propchange: openjpa/site/trunk/content/images/welcome-page.JPG
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Modified: openjpa/site/trunk/content/jest-examples.mdtext
URL: http://svn.apache.org/viewvc/openjpa/site/trunk/content/jest-examples.mdtext?rev=1414971&r1=1414970&r2=1414971&view=diff
==============================================================================
--- openjpa/site/trunk/content/jest-examples.mdtext (original)
+++ openjpa/site/trunk/content/jest-examples.mdtext Wed Nov 28 22:33:34 2012
@@ -1,76 +1,74 @@
Title: JEST Examples
<a name="JESTExamples-JESTinAction"></a>
+
# JEST in Action
-!welcome-page.JPG|width=1200,height=800!
+<img src="images/welcome-page.JPG" width="1200" height="800"/>
<a name="JESTExamples-DescriptionofaSimpleJEST-enabledWebApplication"></a>
## Description of a Simple JEST-enabled Web Application
A sample is available to demonstrate JEST usage. You will find the example
-in OpenJPA code repository under *openjpa-examples/jest* tree with its
-source code and deployment descriptors *WEB-INF/web.xml* and
-*META-INF/persistence.xml*. The example is a simple servlet
-*demo.SimpleApp* that instantiates a persistent unit named *jestdemo*
+in OpenJPA code repository under **openjpa-examples/jest** tree with its
+source code and deployment descriptors **WEB-INF/web.xml** and
+**META-INF/persistence.xml**. The example is a simple servlet
+**demo.SimpleApp** that instantiates a persistent unit named **estdemo**
and populates a database with few sample records of two persistent entities
-*demo.Actor* and *demo.Movie*.
+**demo.Actor** and **demo.Movie**.
<a name="JESTExamples-PersistenceUnitInitialization"></a>
-### Persistence Unit Initialization
+## Persistence Unit Initialization
+
+The following code from **demo.SimpleApp** shows the initialization
+process at the servlet's **init()** method.
-The following code from *demo.SimpleApp* shows the initialization
-process at the servlet's *init()* method.
+ <DIV style="border-style: solid;border-width: 0px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><B>Simple Servlet initializes a pooled Persistent Unit</B></DIV>
-<DIV class="code panel" style="border-style: solid;border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><B>Simple Servlet initializes a pooled Persistent Unit</B></DIV><DIV class="codeContent panelContent">
public class SimpleApp extends HttpServlet {
EntityManagerFactory _emf;
private static String UNIT_NAME = "jestdemo";
@Override
public void init(ServletConfig config) throws ServletException {
- super.init(config);
- config.getServletContext().log("Initializing persistence unit [" + UNIT_NAME + "]
-");
- try {
- Map<String,Object> props = new HashMap<String, Object>();
- props.put("openjpa.EntityManagerFactoryPool", "true");
- _emf = Persistence.createEntityManagerFactory(UNIT_NAME,
-props);
- new DataLoader().populate(_emf.createEntityManager());
- } catch (Exception e) {
- throw new ServletException(e);
- }
- config.getServletContext().log("Initialized with persistence unit [" + UNIT_NAME + "]
-");
+ super.init(config);
+ config.getServletContext().log("Initializing persistence unit [" + UNIT_NAME + "]");
+ try {
+ Map<String,Object> props = new HashMap<String, Object>();
+ props.put("openjpa.EntityManagerFactoryPool", "true");
+ _emf = Persistence.createEntityManagerFactory(UNIT_NAME,props);
+ new DataLoader().populate(_emf.createEntityManager());
+ } catch (Exception e) {
+ throw new ServletException(e);
+ }
+ config.getServletContext().log("Initialized with persistence unit [" + UNIT_NAME + "]");
}
-
-It is *important* to notice that the persistent unit is instantiated so
-that the *EntityManagerFactory* is pooled by OpenJPA. The way to achieve
-that is to set configuration property *openjpa.EntityManagerFactoryPool*
-to *true*. It is also important to note that this property is recognized
+It is **important** to notice that the persistent unit is instantiated so
+that the `EntityManagerFactory` is pooled by OpenJPA. The way to achieve
+that is to set configuration property `openjpa.EntityManagerFactoryPool`
+to **true**. It is also important to note that this property is recognized
_only_ when passed via runtime and _not_ if it were specified in
-*META-INF/persistence.xml* unlike other OpenJPA configuration properties.
+`META-INF/persistence.xml` unlike other OpenJPA configuration properties.
Besides instantiating the persistent unit, the servlet does not do anything
else other than serving a welcome *index.html* web page as its
*doGet()* method shows:
-<DIV class="code panel" style="border-style: solid;border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><B>Simple Servlet that only serves a single index.html page</B></DIV><DIV class="codeContent panelContent">
- /**
- * The only response by this application is an <code>index.html</code>
-file.
- */
- @Override
- protected void doGet(HttpServletRequest req, HttpServletResponse resp)
-throws ServletException, IOException {
+
+ <DIV style="border-style: solid;border-width: 0px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><B>Simple Servlet that only serves a single index.html page</B></DIV>
+
+ /**
+ * The only response by this application is an <code>index.html</code> file.
+ */
+ @Override
+ protected void doGet(HttpServletRequest req, HttpServletResponse resp)
+ throws ServletException, IOException {
resp.setContentType("text/html");
OutputStream out = resp.getOutputStream();
InputStream in = getClass().getResourceAsStream("index.html");
for (int c = 0; (c = in.read()) != -1;) {
out.write((char)c);
}
- }
-
+ }
<a name="JESTExamples-DeploymentDescriptortoenableJEST"></a>
@@ -80,83 +78,81 @@ The sample web application deploys *demo
servlet. The essential aspect of the deployment descriptor
*WEB-INF/web.xml* is shown below
-{code:xml|title=web.xml deployment descriptor (edited version)}
-<web-app version="2.4"
- xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
-http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
- <display-name>Demo Application with JEST Servlet</display-name>
- <welcome-file-list>
- <welcome-file>index.html</welcome-file>
- </welcome-file-list>
- <servlet>
- <servlet-name>demo</servlet-name>
- <servlet-class>demo.SimpleApp</servlet-class>
- </servlet>
- <servlet-mapping>
- <servlet-name>demo</servlet-name>
- <url-pattern>/*</url-pattern>
- </servlet-mapping>
-
- <servlet>
- <servlet-name>jest</servlet-name>
-
-<servlet-class>org.apache.openjpa.persistence.jest.JESTServlet</servlet-class>
- <init-param>
- <param-name>persistence.unit</param-name>
- <param-value>jestdemo</param-value>
- </init-param>
- </servlet>
- <servlet-mapping>
- <servlet-name>jest</servlet-name>
- <url-pattern>/jest/*</url-pattern>
- </servlet-mapping>
+ <DIV style="border-style: solid;border-width: 0px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><B>web.xml deployment descriptor (edited version)</B></DIV>
+
+ <web-app version="2.4"
+ xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
+ http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+ <display-name>Demo Application with JEST Servlet</display-name>
+ <welcome-file-list>
+ <welcome-file>index.html</welcome-file>
+ </welcome-file-list>
+ <servlet>
+ <servlet-name>demo</servlet-name>
+ <servlet-class>demo.SimpleApp</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>demo</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+ <servlet>
+ <servlet-name>jest</servlet-name>
+ <servlet-class>org.apache.openjpa.persistence.jest.JESTServlet</servlet-class>
+ <init-param>
+ <param-name>persistence.unit</param-name>
+ <param-value>jestdemo</param-value>
+ </init-param>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>jest</servlet-name>
+ <url-pattern>/jest/*</url-pattern>
+ </servlet-mapping>
-</web-app>
+ </web-app>
- h3. Discovery of Persistent Unit
- As can be seen in {{WEB-INF/web.xml}} above, the JEST servlet
-{{org.apache.openjpa.persistence.jest.JESTServlet}} needs to know the
-persistent unit name {{jestdemo}} to _discover_ the actual
-{{EntityManagerFactory}} instantiated by its sibling {{demo.SimpleApp}}
-servlet. This discovery of an {{EntityManagerFactory}} instantiated by
+## Discovery of Persistent Unit
+As can be seen in `WEB-INF/web.xml` above, the JEST servlet
+`org.apache.openjpa.persistence.jest.JESTServlet` needs to know the
+persistent unit name `jestdemo` to _discover_ the actual
+`EntityManagerFactory` instantiated by its sibling `demo.SimpleApp`
+servlet. This discovery of an `EntityManagerFactory` instantiated by
another component is possible because the said
- {{EntityManagerFactory}} is being pooled by OpenJPA. A more general
-discovery mechanics where JEST can discover a {{EntityManagerFactory}}
+ `EntityManagerFactory` is being pooled by OpenJPA. A more general
+discovery mechanics where JEST can discover a `EntityManagerFactory`
instantiated and injected by the container
would be available in future.
- h2. Building the sample application
- An Ant build script {{build.xml}} is provided and a {{build.properties}} to
+## Building the sample application
+An Ant build script `build.xml` is provided and a `build.properties` to
adjust for local settings. To suit your local environment, please edit the
-{{build.properties}} for OpenJPA library and {{META-INF/persistence.xml}}
+`build.properties` for OpenJPA library and `META-INF/persistence.xml`
for database specifics. The supplied build file compiles two persistent
-domain classes {{demo.Actor}} and {{demo.Movie}}, enhanced them and
-packages them in an web archive {{demo.war}}. The script assumes that the
+domain classes `demo.Actor` and `demo.Movie`, enhanced them and
+packages them in an web archive `demo.war`. The script assumes that the
OpenJPA library and the JDBC driver (the sample persistence descriptor uses
MySQL, by deafult) are available in shared library of the Servlet Container
and hence does _not_ package these libraries in the web archive
-{{demo.war}}.
+`demo.war`.
- h2. Deploying the sample application
+## Deploying the sample application
- The next step is to deploy this simple web archive {{demo.war}} in a
+The next step is to deploy this simple web archive `demo.war` in a
Servlet Container such as Tomcat or a a JEE container. We do not describe
these steps because they are fairly standard.
- h2. JEST in action
+## JEST in action
- Once the sample web application is deployed, say in Tomcat running on
-{{localhost:8080}}, open the web browser {{http://localhost:8080/demo}} and
-you should see the web page served by {{demo.SimpleApp}}. This step
-initializes {{demo.SimpleApp}} and hence the persistence unit {{jestdemo}}.
+Once the sample web application is deployed, say in Tomcat running on
+`localhost:8080`, open the web browser <http://localhost:8080/demo> and
+you should see the web page served by `demo.SimpleApp`. This step
+initializes `demo.SimpleApp` and hence the persistence unit `jestdemo`.
- Now, if you go to URL {{http://localhost:8080/demo/jest/}}, the JEST
+Now, if you go to URL <http://localhost:8080/demo/jest/>, the JEST
welcome page will be displayed -- which is JavaScript enabled web page that
demonstrates currently available JEST facilities such as finding or
querying for instances.
-
- !welcome-page.JPG!
-
+
Modified: openjpa/site/trunk/content/jest-representation.mdtext
URL: http://svn.apache.org/viewvc/openjpa/site/trunk/content/jest-representation.mdtext?rev=1414971&r1=1414970&r2=1414971&view=diff
==============================================================================
--- openjpa/site/trunk/content/jest-representation.mdtext (original)
+++ openjpa/site/trunk/content/jest-representation.mdtext Wed Nov 28 22:33:34 2012
@@ -1,4 +1,6 @@
Title: JEST Representation
+<a name="JEST-Representation"></a>
+
JEST response is either XML or JSON.
@@ -9,222 +11,179 @@ JEST represents persistent Java object g
schema is metamodel-driven and hence invariant to particular domain model.
The schema *jest-instance.xsd* is as follows:
-{code:xml|title=Metamodel-driven schema for JEST XML}
-<!--
-=========================================================================
--->
-<!-- Schema for serialized persistence instance graph
- -->
-<!--
-=========================================================================
--->
-<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- attributeFormDefault="unqualified" elementFormDefault="qualified"
- version="1.0">
+ <DIV style="border-style: solid;border-width: 0px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><B>Metamodel-driven schema for JEST XML</B></DIV>
+ <!-- ========================================================================= -->
+ <!-- Schema for serialized persistence instance graph -->
+ <!-- ========================================================================= -->
+ <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ attributeFormDefault="unqualified" elementFormDefault="qualified"
+ version="1.0">
- <xsd:annotation>
- <xsd:documentation><![CDATA[
+ <xsd:annotation>
+ <xsd:documentation><![CDATA[
Describes closure of managed persistence instance.
Each instance is described by all its loaded persistent attribute.
The related instances are resolved within the document root.
Document root represents zero or more instances.
The file must be named "jest-instance.xsd".
- ]
-]>
- </xsd:documentation>
- </xsd:annotation>
-
- <!-- The root element of the document contains zero or more instances
--->
- <xsd:element name="instances">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="uri" minOccurs="1"
-maxOccurs="1" type="xsd:anyURI"/>
- <xsd:element name="description" minOccurs="0"
-maxOccurs="1" type="xsd:string"/>
- <xsd:element name="instance"
-minOccurs="0" maxOccurs="unbounded" type="instance-type" />
- </xsd:sequence>
- <xsd:attribute name="version" type="xsd:string" />
- </xsd:complexType>
- </xsd:element>
-
- <!-- The root element for a single instance. Children of this
-element are persistent attribute -->
- <!-- Persistent Attributes occur in order. The order is determined
-by the attribute category. -->
- <!-- Attribute category is determined by the enumerated
-PersistentAttributeType defined in -->
- <!-- javax.persistence.metamodel and then further refined by id,
-version, lob and enum. -->
- <!-- See org.apache.openjpa.persistence.jest.MetamodelHelper for
-further details. -->
- <xsd:complexType name="instance-type">
- <xsd:sequence>
- <xsd:element name="id"
-type="basic-attr-type" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="version"
-type="basic-attr-type" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="basic"
-type="basic-attr-type" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="enum"
-type="basic-attr-type" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="embedded"
-type="instance-type" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="lob"
-type="lob-attr-type" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="one-to-one"
-type="singular-attr-type" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="many-to-one"
-type="singular-attr-type" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="element-collection"
-type="collection-attr-type" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="one-to-many"
-type="collection-attr-type" minOccurs="0" maxOccurs="unbounded"/>
- <xsd:element name="many-to-many"
-type="map-attr-type" minOccurs="0" maxOccurs="unbounded"/>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:ID" use="required" />
- </xsd:complexType>
-
- <!-- A reference to another instance within the same(?) document
--->
- <xsd:complexType name="ref-type">
- <xsd:simpleContent>
- <xsd:extension base="xsd:string">
- <xsd:attribute name="id" type="xsd:IDREF"
-/>
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
+ ]]>
+ </xsd:documentation>
+ </xsd:annotation>
+
+ <!-- The root element of the document contains zero or more instances -->
+ <xsd:element name="instances">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="uri" minOccurs="1" maxOccurs="1" type="xsd:anyURI"/>
+ <xsd:element name="description" minOccurs="0" maxOccurs="1" type="xsd:string"/>
+ <xsd:element name="instance" minOccurs="0" maxOccurs="unbounded" type="instance-type" />
+ </xsd:sequence>
+ <xsd:attribute name="version" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+
+ <!-- The root element for a single instance. Children of this element are persistent attribute -->
+ <!-- Persistent Attributes occur in order. The order is determined by the attribute category. -->
+ <!-- Attribute category is determined by the enumerated PersistentAttributeType defined in -->
+ <!-- javax.persistence.metamodel and then further refined by id, version, lob and enum. -->
+ <!-- See org.apache.openjpa.persistence.jest.MetamodelHelper for further details. -->
+ <xsd:complexType name="instance-type">
+ <xsd:sequence>
+ <xsd:element name="id" type="basic-attr-type"
+ minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="version" type="basic-attr-type"
+ minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="basic" type="basic-attr-type"
+ minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="enum" type="basic-attr-type"
+ minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="embedded" type="instance-type"
+ minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="lob" type="lob-attr-type"
+ minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="one-to-one" type="singular-attr-type"
+ minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="many-to-one" type="singular-attr-type"
+ minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="element-collection" type="collection-attr-type"
+ minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="one-to-many" type="collection-attr-type"
+ minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="many-to-many" type="map-attr-type"
+ minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ <xsd:attribute name="id" type="xsd:ID" use="required" />
+ </xsd:complexType>
+
+ <!-- A reference to another instance within the same(?) document -->
+ <xsd:complexType name="ref-type">
+ <xsd:simpleContent>
+ <xsd:extension base="xsd:string">
+ <xsd:attribute name="id" type="xsd:IDREF"/>
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
- <!-- A null reference
--->
- <xsd:complexType name="ref-null">
- <xsd:simpleContent>
- <xsd:extension base="xsd:string">
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <!-- Basic Attribute has a name and its runtime type -->
- <!-- non-null value appears as text content. -->
- <!-- null value appears as attribute with empty text . -->
- <xsd:complexType name="basic-attr-type">
- <xsd:simpleContent>
- <xsd:extension base="xsd:string">
- <xsd:attribute name="name"
-type="xsd:string" use="required" />
- <xsd:attribute name="type"
-type="xsd:string" use="required" />
- <xsd:attribute name="null"
-type="xsd:boolean" />
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
+ <!-- A null reference -->
+ <xsd:complexType name="ref-null">
+ <xsd:simpleContent>
+ <xsd:extension base="xsd:string">
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+ <!-- Basic Attribute has a name and its runtime type -->
+ <!-- non-null value appears as text content. -->
+ <!-- null value appears as attribute with empty text . -->
+ <xsd:complexType name="basic-attr-type">
+ <xsd:simpleContent>
+ <xsd:extension base="xsd:string">
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ <xsd:attribute name="type" type="xsd:string" use="required" />
+ <xsd:attribute name="null" type="xsd:boolean" />
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
- <!-- Large Binary Objects (LOB) represented as hex array -->
- <xsd:complexType name="lob-attr-type">
- <xsd:simpleContent>
- <xsd:extension base="xsd:hexBinary">
- <xsd:attribute name="name"
-type="xsd:string" use="required" />
- <xsd:attribute name="type"
-type="xsd:string" use="required" />
- <xsd:attribute name="null"
-type="xsd:boolean" />
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <!-- Singular attribute is a reference to another instance or a
-null reference. -->
- <xsd:complexType name="singular-attr-type">
- <xsd:choice>
- <xsd:element name="null" type="ref-null" />
- <xsd:element name="ref" type="ref-type" />
- </xsd:choice>
- <xsd:attribute name="name" type="xsd:string" use="required"
-/>
- <xsd:attribute name="type" type="xsd:string" use="required"
-/>
- </xsd:complexType>
-
- <!-- Collection attributes list their members with their runtime
-type -->
- <!-- Members can be basic or other managed instance
- -->
- <xsd:complexType name="collection-attr-type">
- <xsd:sequence>
- <xsd:element name="member" type="member-type"
-minOccurs="0"
- maxOccurs="unbounded" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"
-/>
- <xsd:attribute name="type" type="xsd:string" use="required"
-/>
- <xsd:attribute name="member-type" type="xsd:string"
-use="required" />
- </xsd:complexType>
-
- <!-- Map attributes list their entries with runtime type of key and
-value -->
- <!-- Both key and value can be independently basic or other managed
-instance -->
- <xsd:complexType name="map-attr-type">
- <xsd:sequence>
- <xsd:element name="entry" type="entry-type" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required"
-/>
- <xsd:attribute name="type" type="xsd:string" use="required"
-/>
- <xsd:attribute name="key-type" type="xsd:string"
-use="required" />
- <xsd:attribute name="value-type" type="xsd:string"
-use="required" />
- </xsd:complexType>
-
- <!-- Value of a member of basic type. -->
- <xsd:complexType name="basic-value-type">
- <xsd:simpleContent>
- <xsd:extension base="xsd:string">
- <xsd:attribute name="null"
-type="xsd:boolean" />
- </xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <!-- Value of a member of a collection/map -->
- <xsd:complexType name="member-type">
- <xsd:choice>
- <xsd:element name="basic" type="basic-value-type"
-/>
- <xsd:element name="null" type="ref-null" />
- <xsd:element name="ref" type="ref-type" />
- </xsd:choice>
- </xsd:complexType>
-
- <!-- Denotes entry of a map element -->
- <xsd:complexType name="entry-type">
- <xsd:sequence>
- <xsd:element name="key" type="member-type"
-minOccurs="1" maxOccurs="1" />
- <xsd:element name="value" type="member-type"
-minOccurs="1" maxOccurs="1" />
- </xsd:sequence>
- </xsd:complexType>
+ <!-- Large Binary Objects (LOB) represented as hex array -->
+ <xsd:complexType name="lob-attr-type">
+ <xsd:simpleContent>
+ <xsd:extension base="xsd:hexBinary">
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ <xsd:attribute name="type" type="xsd:string" use="required" />
+ <xsd:attribute name="null" type="xsd:boolean" />
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+ <!-- Singular attribute is a reference to another instance or a null reference. -->
+ <xsd:complexType name="singular-attr-type">
+ <xsd:choice>
+ <xsd:element name="null" type="ref-null" />
+ <xsd:element name="ref" type="ref-type" />
+ </xsd:choice>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ <xsd:attribute name="type" type="xsd:string" use="required" />
+ </xsd:complexType>
+
+ <!-- Collection attributes list their members with their runtime type -->
+ <!-- Members can be basic or other managed instance -->
+ <xsd:complexType name="collection-attr-type">
+ <xsd:sequence>
+ <xsd:element name="member" type="member-type" minOccurs="0" maxOccurs="unbounded" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ <xsd:attribute name="type" type="xsd:string" use="required" />
+ <xsd:attribute name="member-type" type="xsd:string" use="required" />
+ </xsd:complexType>
+
+ <!-- Map attributes list their entries with runtime type of key and value -->
+ <!-- Both key and value can be independently basic or other managed instance -->
+ <xsd:complexType name="map-attr-type">
+ <xsd:sequence>
+ <xsd:element name="entry" type="entry-type" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ <xsd:attribute name="type" type="xsd:string" use="required" />
+ <xsd:attribute name="key-type" type="xsd:string" use="required" />
+ <xsd:attribute name="value-type" type="xsd:string" use="required" />
+ </xsd:complexType>
+
+ <!-- Value of a member of basic type. -->
+ <xsd:complexType name="basic-value-type">
+ <xsd:simpleContent>
+ <xsd:extension base="xsd:string">
+ <xsd:attribute name="null" type="xsd:boolean" />
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+ <!-- Value of a member of a collection/map -->
+ <xsd:complexType name="member-type">
+ <xsd:choice>
+ <xsd:element name="basic" type="basic-value-type" />
+ <xsd:element name="null" type="ref-null" />
+ <xsd:element name="ref" type="ref-type" />
+ </xsd:choice>
+ </xsd:complexType>
+
+ <!-- Denotes entry of a map element -->
+ <xsd:complexType name="entry-type">
+ <xsd:sequence>
+ <xsd:element name="key" type="member-type" minOccurs="1" maxOccurs="1" />
+ <xsd:element name="value" type="member-type" minOccurs="1" maxOccurs="1" />
+ </xsd:sequence>
+ </xsd:complexType>
-</xsd:schema>
+ </xsd:schema>
- h3. Example of a serialized object graph
- The example shows a Person (primary key p1) who is her own partner.
+## Example of a serialized object graph
+The example shows a Person (primary key p1) who is her own partner.
- {code:xml|title=Example of Object Graph with Circular Reference}
+ <DIV style="border-style: solid;border-width: 0px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><B>Example of Object Graph with Circular Reference</B></DIV>
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<instances>
<instance id="Person-p1">
@@ -251,7 +210,6 @@ minOccurs="1" maxOccurs="1" />
</instances>
-
<a name="JESTRepresentation-JSONRepresentation"></a>
## JSON Representation
@@ -265,8 +223,8 @@ instances in a serialized graph. However
by standard JSON parsers.
Enhanced JSON representation in JEST introduces two _special_ fields named
-*$id* and *$ref* to address circular reference. Each JSON object
-carries a *$id* field whose value is the persistent identity of the
+`$id` and `$ref` to address circular reference. Each JSON object
+carries a `$id` field whose value is the persistent identity of the
corresponding entity. When JSON serialization encounters a circular
reference a
\ No newline at end of file
Modified: openjpa/site/trunk/content/jest-syntax.mdtext
URL: http://svn.apache.org/viewvc/openjpa/site/trunk/content/jest-syntax.mdtext?rev=1414971&r1=1414970&r2=1414971&view=diff
==============================================================================
--- openjpa/site/trunk/content/jest-syntax.mdtext (original)
+++ openjpa/site/trunk/content/jest-syntax.mdtext Wed Nov 28 22:33:34 2012
@@ -1,5 +1,6 @@
Title: JEST Syntax
<a name="JESTSyntax-JESTURISyntax"></a>
+
## JEST URI Syntax
JEST defines URI syntax to access persistent resources over HTTP.
@@ -8,130 +9,126 @@ For example, to find a persistent Person
receive the result in *JSON* format will be:
-*http://www.example.com:8080/jest/find/format=json?type=Person&1234*
+<http://www.example.com:8080/jest/find/format=json?type=Person&1234>
The formal notation of a JEST URI is
- {code}URI := http://{host}[:port](:port.html)
-/{context}/{action}[/qualifier]* [?argument]
-[&argument]*{code}
+ URI := http://{host}[:port]/{context}/{action}[/qualifier]* [?argument] [&argument]*
The URI syntax rules, in the light of the above example, are as follows:
- * _protocol_ is always *http*
+ * _protocol_ is always `http`
- * _host_ (*www.example.com*) and optional _port_ number locates the
+ * _host_ (`www.example.com`) and optional _port_ number locates the
JEST servlet
- * _context_ (*jest*) identifies the context path of the JEST servlet.
+ * _context_ (`jest`) identifies the context path of the JEST servlet.
The context path is the servlet name
as specified in the web deployment descriptor for JEST servlet
- * _action_ (*find*) is the first segment of the servlet path.
- Allowed actions are *find*, *query*, *domain*, *properties*
+ * _action_ (`find`) is the first segment of the servlet path.
+ Allowed actions are `find`, `query`, `domain`, `properties`
etc.
- * zero or more _qualifier_ may constitute the servlet path. Each
-qualifier is separated by */* character.
+ * zero or more `qualifier` may constitute the servlet path. Each
+qualifier is separated by `/` character.
* A qualifier must have a key and an optional value.
- * The qualifier key and value, if present, are separated by *=* sign.
+ * The qualifier key and value, if present, are separated by `=` sign.
* A qualifier key is a valid Java identifier. The exact key is
-conditional on the action. For example, *find* action
- accepts *format* qualifier, *query* action accepts *single*,
-*named*, *maxResult*, *firstResult*,
- *format* as qualifiers.
- In the example above, *format=json* qualifies that the response of
-*find* action be formatted as JSON.
- * A qualifier may or may not have a value. For example, *maxResult*
-qualifier for *query* action must have
- an integer value while *single* qualifier does not.
+conditional on the action. For example, `find` action
+ accepts *format* qualifier, `query` action accepts `single`,
+`named`, `maxResult`, `firstResult`,
+ `format` as qualifiers.
+ In the example above, `format=json` qualifies that the response of
+`find` action be formatted as JSON.
+ * A qualifier may or may not have a value. For example, `maxResult`
+qualifier for `query` action must have
+ an integer value while `single` qualifier does not.
- * zero or more _argument_ may follow after the path by *?* character.
- * each _argument_ is separated by *&* character
+ * zero or more _argument_ may follow after the path by `?` character.
+ * each _argument_ is separated by `&` character
* An _argument_ has an optional key and must have a value.
- * The _argument_ key, if present, and value are separated by *=* sign.
+ * The _argument_ key, if present, and value are separated by `=` sign.
- * some actions may enforce mandatory argument(s). For example, a *find*
-action must have *type* argument
- and at least one more argument for the primary key. A *query* action
-must have *q* argument etc.
+ * some actions may enforce mandatory argument(s). For example, a `find`
+action must have `type` argument
+ and at least one more argument for the primary key. A `query` action
+must have `q` argument etc.
-
-
<a name="JESTSyntax-Listofsupportedactions,qualifiersandarguments"></a>
-### List of supported actions, qualifiers and arguments
+## List of supported actions, qualifiers and arguments
The following sections tabulates the currently supported actions and
corresponding qualifiers and arguments.
-A *bold font* denotes qualifier or argument as mandatory.
+A **bold font** denotes qualifier or argument as mandatory.
<a name="JESTSyntax-Action:find"></a>
-#### Action: find
+### Action: find
Returns the result of a *find()* operation.
<table>
<tr><th>qualifier-key </th><th> qualifier-value</th><th> Comment</th></tr>
-<tr><td>format </td><td> *xml* or *json* </td><td> default is *xml*</td></tr>
-<tr><td>plan </td><td> </td><td> name of one or more fetch
+<tr><td class="border">format </td><td class="border"> <tt>xml</tt> or <tt>json</tt> </td><td class="border"> default is <tt>xml</tt></td></tr>
+<tr><td class="border">plan </td><td class="border"> </td><td class="border"> name of one or more fetch
plan(s). Each name separated by comma character.</td></tr>
-<tr><td> </td><td> </td><td> e.g.
-*find/plan=onlyBasicFields?type=Person&1234*</td></tr>
-<tr><td> </td><td> </td><td> where *onlyBasicFields* is
+<tr><td class="border"> </td><td class="border"> </td><td class="border"> e.g.
+<tt>find/plan=onlyBasicFields?type=Person&1234</tt></td></tr>
+<tr><td class="border"> </td><td class="border"> </td><td class="border"> where <tt>onlyBasicFields</tt> is
name of a pre-defined Fetch Group</td></tr>
</table>
<table>
<tr><th>argument-key </th><th>argument-value </th><th> Comment </th></tr>
-<tr><td>*type* </td><td>entity name </td><td> Fully-qualified Java class name or
+<tr><td class="border"><tt>type</tt> </td><td class="border">entity name </td><td class="border"> Fully-qualified Java class name or
alias of the entity </td></tr>
-<tr><td> </td><td>primary key value </td><td> can be used for simple identity
+<tr><td class="border"> </td><td class="border">primary key value </td><td class="border"> can be used for simple identity
without the id property name</td></tr>
-<tr><td> </td><td> </td><td> e.g. */find?type=Person&1234*</td></tr>
-<tr><td>id property </td><td>primary key value </td><td> Used for compound primary keys</td></tr>
-<tr><td> </td><td> </td><td> e.g.
-*/find?type=Person&firstName=John&lastName=Doe*</td></tr>
+<tr><td class="border"> </td><td class="border"> </td><td class="border"> e.g. <tt>/find?type=Person&1234</tt></td></tr>
+<tr><td class="border">id property </td><td class="border">primary key value </td><td class="border"> Used for compound primary keys</td></tr>
+<tr><td class="border"> </td><td class="border"> </td><td class="border"> e.g.
+<tt>/find?type=Person&firstName=John&lastName=Doe</tt></td></tr>
</table>
<a name="JESTSyntax-Action:query"></a>
-#### Action : query
+### Action : query
-Returns the result of a *Query.getResultList()* or
-*Query.getSingleResult()* operation.
+Returns the result of a `Query.getResultList()` or
+`Query.getSingleResult()` operation.
<table>
<tr><th>qualifier-key </th><th> qualifier-value</th><th> Comment</th></tr>
-<tr><td>format </td><td> *xml* or *json* </td><td> default is *xml*</td></tr>
-<tr><td>plan </td><td> </td><td> name of one or more fetch plan(s). Each
+<tr><td class="border">format </td><td class="border"> <tt>xml</tt> or <tt>json</tt> </td><td class="border"> default is <tt>xml</tt></td></tr>
+<tr><td class="border">plan </td><td class="border"> </td><td class="border"> name of one or more fetch plan(s). Each
name separated by comma character.</td></tr>
-<tr><td>single </td><td> </td><td> enforces single instance as query result
+<tr><td class="border">single </td><td class="border"> </td><td class="border"> enforces single instance as query result
</td></tr>
-<tr><td> </td><td> </td><td> e.g. {{/query/single?q=select p from
+<tr><td class="border"> </td><td class="border"> </td><td class="border"> e.g. {{/query/single?q=select p from
Person p where p.name=:x&x=John}} </td></tr>
-<tr><td>named </td><td> </td><td> interprets the q argument value as a
+<tr><td class="border">named </td><td class="border"> </td><td class="border"> interprets the q argument value as a
named query</td></tr>
-<tr><td> </td><td> </td><td> e.g.
-*/query/named?q=PersonByName&x=John* </td></tr>
-<tr><td> </td><td> </td><td> where *PersonByName* is named query
-with *x* its named parameter</td></tr>
+<tr><td class="border"> </td><td class="border"> </td><td class="border"> e.g.
+<tt>/query/named?q=PersonByName&x=John</tt> </td></tr>
+<tr><td class="border"> </td><td class="border"> </td><td class="border"> where <tt>PersonByName</tt> is named query
+with <tt>x</tt> its named parameter</td></tr>
</table>
<table>
<tr><th>argument-key </th><th>argument-value </th><th> Comment </th></tr>
-<tr><td>*q* </td><td>JPQL or Named Query </td><td> e.g. */query/named?q=AllPerson*</td></tr>
-<tr><td> </td><td> </td><td> or {{/query?q=select p from Person
+<tr><td class="border"><tt>q</tt> </td><td class="border">JPQL or Named Query </td><td class="border"> e.g. <tt>/query/named?q=AllPerson</tt></td></tr>
+<tr><td class="border"> </td><td class="border"> </td><td class="border"> or {{/query?q=select p from Person
p}}</td></tr>
-<tr><td> </td><td> </td><td> e.g. {{/query?q=select p from
+<tr><td class="border"> </td><td class="border"> </td><td class="border"> e.g. {{/query?q=select p from
Person p where p.firstName=:x&x=John}}</td></tr>
-<tr><td>bind parameter </td><td>parameter value </td><td> the values are converted to match
+<tr><td class="border">bind parameter </td><td class="border">parameter value </td><td class="border"> the values are converted to match
the target type</td></tr>
-<tr><td> </td><td> </td><td> e.g. {{/query?q=select p from
+<tr><td class="border"> </td><td class="border"> </td><td class="border"> e.g. {{/query?q=select p from
Person p where p.gender=:g&g=MALE}}</td></tr>
</table>
<a name="JESTSyntax-Action:domain"></a>
-#### Action : domain
+### Action : domain
Returns the domain model in XML format.
@@ -139,7 +136,7 @@ Accepts no qualifier.
Accepts no argument.
<a name="JESTSyntax-Action:properties"></a>
-#### Action : properties
+### Action : properties
Returns the configuration properties in HTML format.
@@ -150,19 +147,13 @@ Accepts no argument.
<a name="JESTSyntax-Formalsyntax:"></a>
### Formal syntax:
- {code}URI := http://{host}[:port](:port.html)
-/{context}/{action}[/qualifier]* [?argument]
-[&argument]*{code}
+ URI := http://{host}[:port]/{context}/{action}[/qualifier]* [?argument][&argument]*
-
- context := JEST servlet context root
- action := find|query|domain|properties
- qualifier := qualifier-key[=qualifier-value]
- argument := [argument-key=]
-argument-value
- qualifier-key := any valid Java identifier
+ context := JEST servlet context root
+ action := find|query|domain|properties
+ qualifier := qualifier-key[=qualifier-value]
+ argument := [argument-key=] argument-value
+ qualifier-key := any valid Java identifier
qualifier-value := string
- argument-key := string
- argument-value := string
-
-
+ argument-key := string
+ argument-value := string
Modified: openjpa/site/trunk/content/jest-transaction.mdtext
URL: http://svn.apache.org/viewvc/openjpa/site/trunk/content/jest-transaction.mdtext?rev=1414971&r1=1414970&r2=1414971&view=diff
==============================================================================
--- openjpa/site/trunk/content/jest-transaction.mdtext (original)
+++ openjpa/site/trunk/content/jest-transaction.mdtext Wed Nov 28 22:33:34 2012
@@ -1,2 +1,4 @@
Title: JEST Transaction
+<a name="JEST-Transaction"></a>
+
We have not figured that out yet!
Modified: openjpa/site/trunk/content/jest-usage.mdtext
URL: http://svn.apache.org/viewvc/openjpa/site/trunk/content/jest-usage.mdtext?rev=1414971&r1=1414970&r2=1414971&view=diff
==============================================================================
--- openjpa/site/trunk/content/jest-usage.mdtext (original)
+++ openjpa/site/trunk/content/jest-usage.mdtext Wed Nov 28 22:33:34 2012
@@ -1,44 +1,47 @@
Title: JEST Usage
+<a name="JEST-Usage"></a>
+
JEST facilities are available as a HTTP servlet,
-*org.apache.openjpa.persistence.jest.JESTServlet*.
+`org.apache.openjpa.persistence.jest.JESTServlet`.
-*JESTServlet* can be deployed in a servlet container e.g. Tomcat in two
-possible modes: *primary* or *auxiliary*.
+`JESTServlet` can be deployed in a servlet container e.g. Tomcat in two
+possible modes: **primary** or **auxiliary**.
<a name="JESTUsage-DeploymentModes"></a>
-#### Deployment Modes
-!deploymentModes.gif!
+### Deployment Modes
+
+<img src="images/deploymentModes.GIF" width="700"/>
-In *primary* mode, the *JESTServlet* itself instantiates a persistence
+In **primary** mode, the `JESTServlet` itself instantiates a persistence
unit during initialization.
-In *auxiliary* mode, the *JESTServlet* discovers a persistence unit used
-by another component *X*.
-The sibling component *X* must satisfy the following for JEST to discover
-its persistent unit
-* The component *X* and *JESTServlet* must belong to the same
+In **auxiliary** mode, the `JESTServlet` discovers a persistence unit used
+by another component `X`.
+The sibling component `X` must satisfy the following for JEST to discover
+its persistent unit
+
+* The component `X` and `JESTServlet` must belong to the same
deployment unit.
-* The component *X* must activate OpenJPA's native
-*EntityManagerFactory* pool. The pool is activated by switching on
-*openjpa.EntityManagerFactoryPool* configuration property to *true*.
+* The component `X` must activate OpenJPA's native
+`EntityManagerFactory` pool. The pool is activated by switching on
+`openjpa.EntityManagerFactoryPool` configuration property to `true`.
This property is available _only_ via runtime configuration. The following
-code example ensures that OpenJPA's native *EntityManagerFactory* pool is
+code example ensures that OpenJPA's native `EntityManagerFactory` pool is
active.
-<DIV class="code panel" style="border-style: solid;border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><B>Activation of OpenJPA's native EntityManagerFactory pool</B></DIV><DIV class="codeContent panelContent">
- Map<String,Object> props = new HashMap<String, Object>();
- props.put("openjpa.EntityManagerFactoryPool", "true");
- EntityManagerFactory emf = Persistence.createEntityManagerFactory("myPU",
-props);
-
+ <DIV style="border-style: solid;border-width: 0px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><B>Activation of OpenJPA's native EntityManagerFactory pool</B></DIV>
+
+ Map<String,Object> props = new HashMap<String, Object>();
+ props.put("openjpa.EntityManagerFactoryPool", "true");
+ EntityManagerFactory emf = Persistence.createEntityManagerFactory("myPU",props);
-*JESTServlet* accepts following initial configuration parameters
+`JESTServlet` accepts following initial configuration parameters
<table>
<tr><th>Property</th><th>Description</th></tr>
-<tr><td>persistence.unit</td><td>Name of the persistent unit. Must be specified.</td></tr>
-<tr><td>standalone</td><td>true implies primary mode. Defaults to false.</td></tr>
-<tr><td>debug</td><td>true implies verbose tracing of HTTP requests. Defaults to false.</td></tr>
+<tr><td class="border">persistence.unit</td><td class="border">Name of the persistent unit. Must be specified.</td></tr>
+<tr><td class="border">standalone</td><td class="border">true implies primary mode. Defaults to false.</td></tr>
+<tr><td class="border">debug</td><td class="border">true implies verbose tracing of HTTP requests. Defaults to false.</td></tr>
</table>
@@ -46,77 +49,71 @@ props);
The following deployment descriptor *WEB-INF/web.xml* deploys
*JESTServlet* in auxiliary mode
-{code:xml|title=JEST Deployment Descriptor in Auxiliary Mode}
-<web-app version="2.4"
- xmlns="http://java.sun.com/xml/ns/j2ee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
-http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
- <display-name>Demo Application with JEST Servlet</display-name>
- <welcome-file-list>
- <welcome-file>index.html</welcome-file>
- </welcome-file-list>
- <description>
- An example of deploying a simple web application with JEST servlet.
- This descriptor specifies the Demo Application servlet as well as JEST
-servlet.
- </description>
+ <DIV style="border-style: solid;border-width: 0px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><B>JEST Deployment Descriptor in Auxiliary Mode</B></DIV>
+
+ <web-app version="2.4"
+ xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
+ http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+ <display-name>Demo Application with JEST Servlet</display-name>
+ <welcome-file-list>
+ <welcome-file>index.html</welcome-file>
+ </welcome-file-list>
+ <description>
+ An example of deploying a simple web application with JEST servlet.
+ This descriptor specifies the Demo Application servlet as well as JEST servlet.
+ </description>
- <servlet>
- <description>
- This is the Demo Application Servlet.
- The servlet is mapped to URL pattern /app/* so this servlet can be
-accessed as
- http://host:port/demo/app/
- where "demo" is the name of the deployed web application.
+ <servlet>
+ <description>
+ This is the Demo Application Servlet.
+ The servlet is mapped to URL pattern /app/* so this servlet can be accessed as
+ http://host:port/demo/app/
+ where "demo" is the name of the deployed web application.
- Assume that the Demo Application Servlet is using a persistence
-unit named
- 'jestdemo'. The JEST Servlet will require the persistence unit name
-to
- browse the Demo Application.
- </description>
+ Assume that the Demo Application Servlet is using a persistence unit named
+ 'jestdemo'. The JEST Servlet will require the persistence unit name to
+ browse the Demo Application.
+ </description>
- <servlet-name>demo</servlet-name>
- <servlet-class>demo.SimpleApp</servlet-class>
- </servlet>
+ <servlet-name>demo</servlet-name>
+ <servlet-class>demo.SimpleApp</servlet-class>
+ </servlet>
- <servlet-mapping>
- <servlet-name>demo</servlet-name>
- <url-pattern>/*</url-pattern>
- </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>demo</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
- <!-- Deployment descriptor for JESTServlet.
- -->
- <servlet>
- <description>
- This is the JEST servlet.
- JEST Servlet needs to know the name of the persistence unit used by
-the Demo Application.
- The unit name is specified by mandatory "persistence.unit"
-parameter during initialization.
+ <!-- Deployment descriptor for JESTServlet. -->
+ <servlet>
+ <description>
+ This is the JEST servlet.
+ JEST Servlet needs to know the name of the persistence unit used by the
+ Demo Application. The unit name is specified by mandatory "persistence.unit"
+ parameter during initialization.
- The JEST servlet is mapped to URL pattern /jest/* in servlet
-mapping section. So to access
- JEST servlet, use the following URI
- http://host:port/demo/jest/
- Notice the trailing forward slash character is significant.
- </description>
- <servlet-name>jest</servlet-name>
-
-<servlet-class>org.apache.openjpa.persistence.jest.JESTServlet</servlet-class>
- <init-param>
- <param-name>persistence.unit</param-name>
- <param-value>jestdemo</param-value>
- </init-param>
- <init-param>
- <param-name>debug</param-name>
- <param-value>true</param-value>
- </init-param>
- </servlet>
- <servlet-mapping>
- <servlet-name>jest</servlet-name>
- <url-pattern>/jest/*</url-pattern>
- </servlet-mapping>
-</web-app>
+ The JEST servlet is mapped to URL pattern /jest/* in servlet mapping section.
+ So to access JEST servlet, use the following URI
+ http://host:port/demo/jest/
+ Notice the trailing forward slash character is significant.
+ </description>
+ <servlet-name>jest</servlet-name>
+
+ <servlet-class>org.apache.openjpa.persistence.jest.JESTServlet</servlet-class>
+ <init-param>
+ <param-name>persistence.unit</param-name>
+ <param-value>jestdemo</param-value>
+ </init-param>
+ <init-param>
+ <param-name>debug</param-name>
+ <param-value>true</param-value>
+ </init-param>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>jest</servlet-name>
+ <url-pattern>/jest/*</url-pattern>
+ </servlet-mapping>
+ </web-app>
Modified: openjpa/site/trunk/content/jest.mdtext
URL: http://svn.apache.org/viewvc/openjpa/site/trunk/content/jest.mdtext?rev=1414971&r1=1414970&r2=1414971&view=diff
==============================================================================
--- openjpa/site/trunk/content/jest.mdtext (original)
+++ openjpa/site/trunk/content/jest.mdtext Wed Nov 28 22:33:34 2012
@@ -1,36 +1,41 @@
Title: JEST
-{excerpt:hidden=true}JEST{excerpt}
+<a name="JEST"></a>
<a name="JEST-JEST:RESTonOpenJPA"></a>
# JEST: REST on OpenJPA
-*JEST* is a *REST* style access to any *OpenJPA* runtime.
+**JEST** is a **REST** style access to any **OpenJPA** runtime.
The salient principles of JEST are:
-* *non-invasive* : Any persistent data managed by OpenJPA can be accessed
+* **non-invasive** : Any persistent data managed by OpenJPA can be accessed
_without_ any change to POJO classes or to an existing application.
-* *language-neutral* : A client _not_ necessarily Java-based can access
+* **language-neutral** : A client _not_ necessarily Java-based can access
persistent data simply by sending an HTTP request. JEST is URI-based as
opposed to API-based.
-* *schema-free* : The content is self-describing. The client does not
+* **schema-free** : The content is self-describing. The client does not
require access to persistent Java class definitions.
In [REST](http://en.wikipedia.org/wiki/Representational_State_Transfer)
(Representational State Transfer) terminology,
-* *Resource* : the resources are _customizable_ graph of persistent
+* **Resource** : the resources are _customizable_ graph of persistent
objects. The object graph is _coherent_ in the sense that if any entity
-*e* of the graph has a reference to another entity *r*, then *r* is
+**e** of the graph has a reference to another entity **r**, then **r** is
also belongs to the graph.
-* *Representation*: the representation of resources are in XML or
+* **Representation**: the representation of resources are in XML or
specialized JSON. JSON is specialized to account for any circular reference
in the object graph. However, the JSON representation remains consumable by
other standard JSON parsers.
-* *Stateless* : the life time of any computational resources used by JEST
+* **Stateless** : the life time of any computational resources used by JEST
is bound by a single HTTP request-response lifetime.
JEST is further described under the following sections
-{children:all=true|excerpt=true}
+* [JEST Examples](jest-examples.html)
+* [JEST Representation](jest-representation.html)
+* [JEST Syntax](jest-syntax.html)
+* [JEST Transaction](jest-transaction.html)
+* [JEST Usage](jest-usage.html)
+
|