exo-jcr SVN: r2892 - in jcr/branches/1.12.x/docs/reference/en/src/main: docbook/en-US/modules/jcr/concepts and 2 other directories.
by do-not-reply@jboss.org
Author: dkatayev
Date: 2010-08-06 09:45:35 -0400 (Fri, 06 Aug 2010)
New Revision: 2892
Added:
jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/jcr/concepts/jcr-exo-implementation.xml
jcr/branches/1.12.x/docs/reference/en/src/main/resources/images/concepts/exojcr.gif
jcr/branches/1.12.x/docs/reference/en/src/main/resources/images/concepts/wsdatamodel.gif
Modified:
jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/jcr.xml
jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/jcr/configuration/exo-jcr-configuration.xml
Log:
EXOJCR-869 eXo JCR implementation chapter added
Added: jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/jcr/concepts/jcr-exo-implementation.xml
===================================================================
--- jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/jcr/concepts/jcr-exo-implementation.xml (rev 0)
+++ jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/jcr/concepts/jcr-exo-implementation.xml 2010-08-06 13:45:35 UTC (rev 2892)
@@ -0,0 +1,173 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<chapter id="JCR.eXoImplementation">
+ <?dbhtml filename="ch-jcr-exo-implementation.html"?>
+
+ <title>eXo JCR Implementation</title>
+
+ <section>
+ <title>Related Documents</title>
+
+ <para>Access Control Configuration Export Import Implementation External
+ Value Storages JDBC Data Container config Locking Multilanguage support
+ Node types and Namespaces Repository and Workspace management Repository
+ container life cycle Workspace Persistence Storage Workspace SimpleDB
+ storage</para>
+ </section>
+
+ <section>
+ <title>How it works</title>
+
+ <para>eXo Repository Service is a standard eXo service and is a registered
+ IoC component, i.e. can be deployed in some ExoContainer (see <link
+ linkend="JCR.eXoJCRconfiguration.RepositoryConfiguration">Service
+ configuration</link> for details) Relationships between components are
+ shown in the picture below:</para>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/concepts/exojcr.gif" />
+ </imageobject>
+ </mediaobject>
+
+ <para><emphasis role="bold">Exo Container</emphasis> some subclass of
+ org.exoplatform.container.ExoContainer (usually
+ org.exoplatform.container.StandaloneContainer or
+ org.exoplatform.container.PortalContainer) that holds a reference to
+ RepositoryService</para>
+
+ <itemizedlist>
+ <listitem>
+ <para><emphasis role="bold">Repository Service</emphasis> contains
+ information about repositories, eXo JCR is able to manage many
+ Repositories</para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis role="bold">Repository</emphasis> Implementation of
+ javax.jcr.Repository. It holds references to one or more
+ Workspace(s)</para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis role="bold">Workspace</emphasis> container of a single
+ rooted tree of Items (Note that here it is not exactly the same as
+ javax.jcr.Workspace as it is not a per Session object)</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>Usual JCR application use case includes two initial steps:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>Obtaining Repository object by getting <emphasis
+ role="bold">RepositoryService</emphasis> from current ExoContainer
+ (eXo "native" way) or via JNDI lookup if eXo repository is bound to
+ the naming context using (see <link
+ linkend="JCR.eXoJCRconfiguration">Service configuration</link> for
+ details)</para>
+ </listitem>
+
+ <listitem>
+ <para>Creating javax.jcr.Session object that calls
+ Repository.login(..)</para>
+ </listitem>
+
+ <listitem>
+ <para>Creating javax.jcr.Session object that calls
+ Repository.login(..)</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section>
+ <title>Workspace Data Model</title>
+
+ <para>The following diagram explains which components of eXo JCR
+ implementation are used in a data flow to perform operations specified in
+ JCR API</para>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/concepts/wsdatamodel.gif" />
+ </imageobject>
+ </mediaobject>
+
+ <para>The Workspace Data Model can be splitted into 4 levels by data
+ isolation and value from the JCR model point of view.</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>eXo JCR core implements <emphasis role="bold">JCR API</emphasis>
+ intefaces such as Item, Node, Property. It contains JCR "logical" view
+ on stored data</para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis role="bold">Session Level</emphasis> isolates
+ transient data viewable inside one JCR Session and interacts with API
+ level using eXo JCR internal API</para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis role="bold">Session Data Manager</emphasis> maintains
+ transient session data. Along with data
+ accessing/modification/validation logic it contains Modified Items
+ Storage to hold the data changed between subsequent save() calling and
+ Session Items Cache</para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis role="bold">Transaction Data Manager</emphasis>
+ maintains session data between save() and transaction commit/rollback
+ if the current session is part of a transaction</para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis role="bold">Workspace Level</emphasis> operates for
+ particular workspace shared data. It contains per-Workspace
+ objects</para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis role="bold">Workspace Storage Data Manager</emphasis>
+ maintains workspace data including final validation, events firing,
+ caching.</para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis role="bold">Workspace Data Container</emphasis>
+ implements physical data storage. It allows different types of backend
+ (like RDB, FS files etc) to be used as a storage for JCR data. Along
+ with the main Data Container other storages for persisted Property
+ Values can be configured and used.</para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis role="bold">Indexer</emphasis> maintains workspace
+ data indexing for further queries.</para>
+ </listitem>
+
+ <listitem>
+ <para><emphasis role="bold">Storage Level</emphasis> persistent
+ storages for:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>JCR Data</para>
+ </listitem>
+
+ <listitem>
+ <para>Indexes (Apache Lucene)</para>
+ </listitem>
+
+ <listitem>
+ <para>Values (for BLOBs for ex) if different from main Data
+ Container</para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </itemizedlist>
+ </section>
+</chapter>
Modified: jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/jcr/configuration/exo-jcr-configuration.xml
===================================================================
--- jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/jcr/configuration/exo-jcr-configuration.xml 2010-08-05 15:19:12 UTC (rev 2891)
+++ jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/jcr/configuration/exo-jcr-configuration.xml 2010-08-06 13:45:35 UTC (rev 2892)
@@ -149,7 +149,7 @@
</itemizedlist>
</section>
- <section>
+ <section id="JCR.eXoJCRconfiguration.RepositoryConfiguration">
<title>Repository service configuration (JCR repositories
configuration)</title>
Modified: jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/jcr.xml
===================================================================
--- jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/jcr.xml 2010-08-05 15:19:12 UTC (rev 2891)
+++ jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/jcr.xml 2010-08-06 13:45:35 UTC (rev 2892)
@@ -13,9 +13,12 @@
<xi:include href="jcr/concepts/why-jcr.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="jcr/concepts/jcr-exo-implementation.xml"
+ xmlns:xi="http://www.w3.org/2001/XInclude" />
+
<xi:include href="jcr/concepts/jcr-advantages.xml"
- xmlns:xi="http://www.w3.org/2001/XInclude" />
-
+ xmlns:xi="http://www.w3.org/2001/XInclude" />
+
<xi:include href="jcr/concepts/jcr-compatibility-levels.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
Added: jcr/branches/1.12.x/docs/reference/en/src/main/resources/images/concepts/exojcr.gif
===================================================================
(Binary files differ)
Property changes on: jcr/branches/1.12.x/docs/reference/en/src/main/resources/images/concepts/exojcr.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: jcr/branches/1.12.x/docs/reference/en/src/main/resources/images/concepts/wsdatamodel.gif
===================================================================
(Binary files differ)
Property changes on: jcr/branches/1.12.x/docs/reference/en/src/main/resources/images/concepts/wsdatamodel.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
15 years, 11 months
exo-jcr SVN: r2891 - in jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/jcr: searching and 1 other directory.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2010-08-05 11:19:12 -0400 (Thu, 05 Aug 2010)
New Revision: 2891
Modified:
jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/jcr/configuration/exo-jcr-configuration.xml
jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/jcr/searching/searching-repository-content.xml
Log:
EXOJCR-869: few fixes
Modified: jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/jcr/configuration/exo-jcr-configuration.xml
===================================================================
--- jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/jcr/configuration/exo-jcr-configuration.xml 2010-08-05 15:08:10 UTC (rev 2890)
+++ jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/jcr/configuration/exo-jcr-configuration.xml 2010-08-05 15:19:12 UTC (rev 2891)
@@ -55,27 +55,36 @@
<para>The following setup procedure is used to obtain a Standalone
configuration (find more in <link
linkend="Kernel.ContainerConfiguration">Container
- configuration</link>):</para>
+ configuration</link>):<itemizedlist>
+ <listitem>
+ <para>Configuration that is set explicitly using
+ StandaloneContainer.addConfigurationURL(String url) or
+ StandaloneContainer.addConfigurationPath(String path) before
+ getInstance()</para>
+ </listitem>
- <para>* Configuration that is set explicitly using
- StandaloneContainer.addConfigurationURL(String url) or
- StandaloneContainer.addConfigurationPath(String path) before
- getInstance()</para>
+ <listitem>
+ <para>Configuration from $base:directory/exo-configuration.xml or
+ $base:directory/conf/exo-configuration.xml file. Where
+ $base:directory is either AS's home directory in case of J2EE AS
+ environment or just the current directory in case of a standalone
+ application.</para>
+ </listitem>
- <para>* Configuration from $base:directory/exo-configuration.xml or
- $base:directory/conf/exo-configuration.xml file. Where $base:directory is
- either AS's home directory in case of J2EE AS environment or just the
- current directory in case of a standalone application.</para>
+ <listitem>
+ <para>/conf/exo-configuration.xml in the current classloader (e.g.
+ war, ear archive)</para>
+ </listitem>
- <para>* /conf/exo-configuration.xml in the current classloader (e.g. war,
- ear archive)</para>
+ <listitem>
+ <para>Configuration from
+ $service_jar_file/conf/portal/configuration.xml. WARNING: do not
+ rely on some concrete jar's configuration if you have more than one
+ jar containing conf/portal/configuration.xml file. In this case
+ choosing a configuration is unpredictable.</para>
+ </listitem>
+ </itemizedlist></para>
- <para>* Configuration from
- $service_jar_file/conf/portal/configuration.xml. WARNING: do not rely on
- some concrete jar's configuration if you have more than one jar containing
- conf/portal/configuration.xml file. In this case choosing a configuration
- is unpredictable.</para>
-
<para>JCR service configuration looks like:</para>
<programlisting><component>
Modified: jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/jcr/searching/searching-repository-content.xml
===================================================================
--- jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/jcr/searching/searching-repository-content.xml 2010-08-05 15:08:10 UTC (rev 2890)
+++ jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/jcr/searching/searching-repository-content.xml 2010-08-05 15:19:12 UTC (rev 2891)
@@ -34,8 +34,6 @@
<para>XPath query: //* .</para>
</listitem>
</itemizedlist>
-
- <para>")</para>
</note>
<para>TwoWayRangeIterator interface:</para>
15 years, 11 months
exo-jcr SVN: r2890 - in jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules: ws and 1 other directory.
by do-not-reply@jboss.org
Author: dkatayev
Date: 2010-08-05 11:08:10 -0400 (Thu, 05 Aug 2010)
New Revision: 2890
Added:
jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/introduction-to-rest.xml
Removed:
jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/rest-framework.xml
jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/rest-service-tutorial.xml
Modified:
jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws.xml
Log:
EXOJCR-870 WS documentation cleaned up
Added: jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/introduction-to-rest.xml
===================================================================
--- jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/introduction-to-rest.xml (rev 0)
+++ jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/introduction-to-rest.xml 2010-08-05 15:08:10 UTC (rev 2890)
@@ -0,0 +1,212 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<chapter id = "WS.Introduction">
+ <?dbhtml filename="ch-introduction-to-rest.html"?>
+
+ <title>Introduction to the Representational State Transfer (REST)</title>
+
+ <section>
+ <title>Introduction</title>
+
+ <para><command>Representational State Transfer (REST)</command> is a style
+ of software architecture for distributed hypermedia systems such as the
+ World Wide Web. The term was introduced in the doctoral dissertation in
+ 2000 by Roy Fielding, one of the principal authors of the Hypertext
+ Transfer Protocol (HTTP) specification, and has come into widespread use
+ in the networking community.</para>
+
+ <para>REST strictly refers to a collection of network architecture
+ principles that outline how resources are defined and addressed. The term
+ is often used in a looser sense to describe any simple interface that
+ transmits domain-specific data over HTTP without an additional messaging
+ layer such as SOAP or session tracking via HTTP cookies.</para>
+
+ <para>The key abstraction of information in REST is a
+ <command>resource</command>. Any information that can be named can be a
+ resource: a document or image, a temporal service (e.g. "today's weather
+ in Los Angeles"), a collection of other resources, a non-virtual object
+ (e.g. a person), and so on. In other words, any concept that might be the
+ target of an author's hypertext reference must fit within the definition
+ of a resource. A resource is a conceptual mapping to a set of entities,
+ not the entity that corresponds to the mapping at any particular point in
+ time.</para>
+
+ <para>REST uses a <command>resource identifier </command>to identify the
+ particular resource involved in an interaction between components. REST
+ connectors provide a generic interface for accessing and manipulating the
+ value set of a resource, regardless of how the membership function is
+ defined or the type of software that is handling the request. URL or URN
+ are the examples of a resource identifier.</para>
+
+ <para>REST components perform actions with a resource by using a
+ <command>representation</command> to capture the current or intended state
+ of that resource and transferring that representation between components.
+ A representation is a sequence of bytes, plus <command>representation
+ metadata </command>to describe those bytes. Other commonly used but less
+ precise names for a representation include: <command>document, file, and
+ HTTP message entity, instance, or variant</command>. A representation
+ consists of data, metadata describing the data, and, on occasion, metadata
+ to describe the metadata (usually for the purpose of verifying message
+ integrity). Metadata are in the form of name-value pairs, where the name
+ corresponds to a standard that defines the value's structure and
+ semantics. The data format of a representation is known as a media
+ type.</para>
+
+ <table>
+ <title>REST Data Elements</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry align="center">Data Element</entry>
+
+ <entry align="center">Modern Web Examples</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>resource</entry>
+
+ <entry>the intended conceptual target of a hypertext
+ reference</entry>
+ </row>
+
+ <row>
+ <entry>resource identifier</entry>
+
+ <entry>URL, URN</entry>
+ </row>
+
+ <row>
+ <entry>representation</entry>
+
+ <entry>HTML document, JPEG image</entry>
+ </row>
+
+ <row>
+ <entry>representation metadata</entry>
+
+ <entry>media type, last-modified time</entry>
+ </row>
+
+ <row>
+ <entry>resource metadata</entry>
+
+ <entry>source link, alternates, vary</entry>
+ </row>
+
+ <row>
+ <entry>control data</entry>
+
+ <entry>if-modified-since, cache-control</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>REST uses various <command>connector</command> types to encapsulate
+ the activities of accessing resources and transferring resource
+ representations. The connectors present an abstract interface for
+ component communication, enhancing simplicity by providing a complete
+ separation of concepts and hiding the underlying implementation of
+ resources and communication mechanisms.</para>
+
+ <table>
+ <title>REST Connectors</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry align="center">Connector</entry>
+
+ <entry align="center">Modern Web Examples</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>client</entry>
+
+ <entry>libwww, libwww-perl</entry>
+ </row>
+
+ <row>
+ <entry>server</entry>
+
+ <entry>libwww, Apache API, NSAPI</entry>
+ </row>
+
+ <row>
+ <entry>cache</entry>
+
+ <entry>browser cache, Akamai cache network</entry>
+ </row>
+
+ <row>
+ <entry>resolver</entry>
+
+ <entry>bind (DNS lookup library)</entry>
+ </row>
+
+ <row>
+ <entry>tunnel</entry>
+
+ <entry><para></para>SOCKS, SSL after HTTP CONNECT</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>The primary connector types are client and server. The essential
+ difference between the two is that a client initiates communication by
+ making a request, whereas a server listens for connections and responds to
+ requests in order to supply access to its services. A component may
+ include both client and server connectors.</para>
+
+ <para>An important part of RESTful architecture is a well-defined
+ interface to communicate, in particular it is a set of HTTP methods such
+ as POST, GET, PUT and DELETE. These methods are often compared with the
+ CREATE, READ, UPDATE, DELETE (CRUD) operations associated with database
+ technologies. An analogy can also be made:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>PUT is analogous to CREATE or PASTE OVER,</para>
+ </listitem>
+
+ <listitem>
+ <para>GET to READ or COPY,</para>
+ </listitem>
+
+ <listitem>
+ <para>POST to UPDATE or PASTE AFTER, and</para>
+ </listitem>
+
+ <listitem>
+ <para>DELETE to DELETE or CUT.</para>
+ </listitem>
+ </itemizedlist>
+
+ <para><command>Note</command>: RESTful architecture is not limited to
+ those methods, one of good examples of extension is the WebDAV
+ protocol.</para>
+
+ <para>The <command>CRUD</command> (Create, Read, Update and Delete) verbs
+ are designed to operate with atomic data within the context of a database
+ transaction. REST is designed around the atomic transfer of a more complex
+ state and can be viewed as a mechanism for transferring structured
+ information from one application to another.</para>
+
+ <para>HTTP separates the notions of a web server and a web browser. This
+ allows the implementation of each to vary from the other based on the
+ client/server principle. When used RESTfully, HTTP is
+ <command>stateless</command>. Each message contains all the information
+ necessary to understand the request.</para>
+
+ <para>As a result, neither the client nor the server needs to remember any
+ communication-state between messages. Any state retained by the server
+ must be modeled as a resource..</para>
+ </section>
+</chapter>
Deleted: jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/rest-framework.xml
===================================================================
--- jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/rest-framework.xml 2010-08-05 14:54:33 UTC (rev 2889)
+++ jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/rest-framework.xml 2010-08-05 15:08:10 UTC (rev 2890)
@@ -1,472 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
-"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<chapter id="WS.RestFramework">
- <?dbhtml filename="ch-rest-framework.html"?>
-
- <title>REST Framework</title>
-
- <important>
- <para>This describes REST framework before version exo-ws-2.0</para>
- </important>
-
- <section>
- <title>Requirements</title>
-
- <para>The purpose of eXo REST framework is to make eXo services (i.e. the
- components deployed inside eXo Container) simple and transparently
- accessible via HTTP in RESTful manner. In other words those services
- should be viewed as a set of REST Resources - endpoints of the HTTP
- request-response chain, we call those services ResourceContainers.</para>
-
- <para>image: Simplified working model</para>
-
- <para>Taking into account HTTP/REST constraints, it is considered that
- Resources (naturally mapped as Java methods) contained in
- ResourceContainer conform with the following conditions:</para>
-
- <itemizedlist>
- <listitem>
- <para>they are uniquely identifiable in the same way as it is
- specified for HTTP i.e. using URI</para>
- </listitem>
-
- <listitem>
- <para>they can accept data from an HTTP request using all possible
- mechanisms, i.e. as a part of an URL, as URI parameters, as HTTP
- headers and body</para>
- </listitem>
-
- <listitem>
- <para>they can return data to an HTTP response using all possible
- mechanisms, i.e. as HTTP status, headers and body</para>
- </listitem>
- </itemizedlist>
-
- <para>From the implementation point of view:</para>
-
- <itemizedlist>
- <listitem>
- <para>the framework should be as much JSR-311 compatible as possible
- for the time the Specification is in draft and fully compatible after
- the standard's release</para>
- </listitem>
-
- <listitem>
- <para>the ResourceContainer components should be deployable and
- accessible in the same way as an ordinary service</para>
- </listitem>
- </itemizedlist>
- </section>
-
- <section>
- <title>Implementation</title>
-
- <para>In our REST architecture implementation, an HTTPServlet is the
- front-end for the REST engine. In this RESTful framework, endpoints for
- HTTP request are represented by java classes (ResourceContainers). All
- ResourceContainers are run as components of an ExoContainer, so they are
- configured within the same configuration file.</para>
-
- <para>ResourceBinder and ResourceDispatcher are two other important
- components of the REST engine. ResourceBinder deals with binding and
- unbinding ResourceContainer. ResourceDispatcher dispatches REST requests
- to ResourceContainer. ResourceBinder and ResourceDispatcher are also
- components of the ExoContainer</para>
-
- <section>
- <title>ResourceContainer</title>
-
- <para>A ResourceContainer is an annotated java class. Annotations must
- at least describe URLs and HTTP methods to be served by this container.
- But they may also describe other parameters, like produced content type
- or transformers. Transformers are special Java classes, used to
- serialize and deserialize Java objects.</para>
-
- <para>A very simple ResourceContainer may look like this:</para>
-
- <programlisting>@HTTPMethod("GET")
-@URITemplate("/test1/{param}/test2/")
-public Response method1(@URIParam("param") String param) {
-//...
-//...
- Response resp = Response.Builder.ok().build();
- return resp;
-}</programlisting>
-
- <para>The ResourceContainer described above is very simple, it can serve
- the GET HTTP method for the relative URL /test1/{param}/test2/ where
- {param} can be any string value. Additionally, {param} can be used as a
- method parameter of the container by annotating it as :
- @URIParam("param") String param. For example, in URL /test1/myID/test2
- the method parameter "param" has the value "myID".</para>
-
- <para>@URITemplate may be used for annotating classes or methods. If the
- TYPE scope annotation is for example @URITemplate("/testservices/") and
- a METHOD scope annotation is @URITemplate("/service1/") then that method
- can be called with the path /testservices/service1/. All
- ResourceContainer methods return Response objects. A Response includes
- HTTP status, an entity (the requested resource), HTTP headers and
- OutputEntityTransformer.</para>
-
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/rest-scheme.png" />
- </imageobject>
- </mediaobject>
-
- <para>A client sends a request, after some operations, the HTTP request
- is parsed into three parts: the HTTP request stream, which consists of
- the body of the request, HTTP headers and query parameters. Then
- ResourceDispatcher gets this request. During the start of ExoContainers
- ResourceBinder collects all available ResourceContainers and after the
- start passes the list of ResourceContainers to the ResourceDispatcher.
- When ResourceDispatcher gets the request from a client it tries to
- search for a valid ResourceContainer. For this search ResourceDispatcher
- uses @HTTPMethod, @URITemplate and @ProducedMimeType annotations. The
- last one is not always necessary, if it is not specified this is set in
- / (all mime types). When ResourceDispatcher found the "right"
- ResourceContainer it tries to call a method with some parameters.
- ResourceDispatcher will send only parameters which ResourceContainer
- requests. In the code example above the parameter is a part of the
- requested URL between "/test1/" and "/test2/". ResourceContainer methods
- can consist only of some well-defined parameters. See the next
- rules:</para>
-
- <itemizedlist>
- <listitem>
- <para>Only one parameter of a method can be not annotated. This
- parameter represents the body of the HTTP request.</para>
- </listitem>
-
- <listitem>
- <para>All other parameters should be of java.lang.String types or
- must have a constructor with the java.lang.String parameter and must
- have annotation.</para>
- </listitem>
-
- <listitem>
- <para>If the parameter which represents the HTTP request body is
- present, then in the annotation @InputTransformer a java class must
- be defined that can build the requested parameter from
- java.io.InputStream. About transformation see below. After request
- processing ResourceContainer creates Request. Request is a special
- Java object which consists of HTTP status, a response header, an
- entity, a transformer. The entity is a representation of the
- requested resource. If Response has an entity it also must have
- OutputEntityTransformer. OutputEntityTransformer can be set in a few
- different ways.</para>
- </listitem>
- </itemizedlist>
- </section>
-
- <section>
- <title>Response</title>
-
- <para>Response is created by Builder. Builder is an inner static Java
- class within Response. Builder has some preset ways to build Response,
- for example (see code example above). The method ok() creates Builder
- with status 200 (OK HTTP status) and ok() returns again a Builder
- object. In this way a developer can again call other Builder methods.
- For example:</para>
-
- <programlisting>//...
-Document doc = ....
-Response response = Response.Builder.ok().entity(doc, "text/xml").transformer(new XMLOutputTransformer()).build();</programlisting>
-
- <para>In the code example above Response has HTTP status 200, an XML
- document like entity, a Content-Type header "text/xml" and
- OutputEntityTransformer of type XMLOutputTransformer. The method build()
- should be called at the end of process. In the same way a developer can
- build some other prepared Responses, like CREATED, NO CONTENT,
- FORBIDDEN, INTERNAL ERROR and other. In this example we set
- OutputEntityTransformer directly. Another mechanism to do this is the
- same like in the case with InputEntityTransformer.</para>
-
- <programlisting>//...
-@HTTPMethod("GET")
-@URITemplate("/test/resource1/")
-(a)InputTransformer(XMLInputTransformer.class)
-(a)OutputTransformer(XMLOutputTransformer.class)
-public Response method1(Document inputDoc) {
-//...
- Document doc = ....
- Response response = Response.Builder.ok(doc, "text/xml").build();
- return response;
-}</programlisting>
-
- <para>InputEntityTransformer is described in the annotation to the
- method "method1". OutputEntityTransformer is described in the annotation
- to the method "method1".</para>
- </section>
-
- <section>
- <title>Transformer</title>
-
- <para>All transformers can be created by EntityTransformerFactory.
- Transformers can be divided in two groups. Transformers from the first
- one extend the abstract class InputEntityTransformer.
- InputEntityTransformer implements the interface
- GenericInputEntityTransformer, and GenericInputEntityTransformer extends
- the interface GenericEntityTransformer. This architecture gives the
- possibility to use one class EntityTransformerFactory for creating both
- types of transformers (input and output). At first we will speak about
- InputEntityTransformer.</para>
-
- <para><command>InputEntityTransformer</command></para>
-
- <para>All classes which extend the abstract class InputEntitytransformer
- must override the method ObjectreadFrom(InputStream entityDataStream).
- This method must return an object with the same type as
- ResourceContainer requires in method parameters (one not annotated
- parameter). This mechanism works in the following way. For example, a
- class which extends InputEntityTransformer will be called
- SimpleInputTransformer. So, SimpleInputTransformer must have a simple
- constructor (without any parameters). SimpleInputTransformer also has
- two methods void setType(Class entityType) and Class getType(). Those
- methods are described in InputEntityTransformer. And, as we said above,
- SimpleInputTransformer must override the abstract method Object
- readFrom(InputStream entityDataStream). So, a developer needs to create
- a class which can build a Java Object from InputStream and then create
- annotation to ResourceContainer or some method in ResourceContainer.
- This annotation must define the type of InputEntityTransformer. Here is
- the code of the annotation InputTransformer.</para>
-
- <programlisting>//...
-@Retention(RUNTIME)
-@Target({TYPE, METHOD})
-public @interface InputTransformer {
- Class<? extends InputEntityTransformer> value();
-}</programlisting>
-
- <para>Then ResourceDispatcher gets InputTransformer from the factory
- during runtime then builds an Object from stream and adds it to the
- parameter array. See the code below.</para>
-
- <programlisting>//...
- InputEntityTransformer transformer = (InputEntityTransformer) factory_.newTransformer(resource.getInputTransformerType());
- transformer.setType(methodParameters[i]);
- params[i] = transformer.readFrom(request.getEntityStream());
-//...
- Response response = (Response) resource.getServer().invoke(resource.getResourceContainer(), params);</programlisting>
-
- <para>A developer can find some prepared transformers in the package
- "org.exoplatform.services.rest.transformer".</para>
-
- <para><command>OutputEntityTransformer</command></para>
-
- <para>OutputEntityTransformer can be used to serialize the Object which
- represents the requested resource to OutputStream.
- OutputEntityTransformer, in future we will call it
- SimpleOutputTransformer, can be defined in a few ways.</para>
-
- <para>Now some more words about transformation. The RESTful framework
- has two multi-purpose input/output transformers. One of them is
- JAXB(Input/Output)Transformer, and another one is
- Serializable(Input/Output)Transformer. The first one uses JAXB API for
- serializing and deserializing an object. Serializable
- (Input/Output)Transformer uses the own methods of an entity for
- serialization and deserialization. Here is an example:</para>
-
- <programlisting>/...
-public class SimpleSerializableEntity implements SerializableEntity {
-
- String data;
-
- public SimpleSerializableEntity() {
- }
-
- public void readObject(InputStream in) throws IOException {
- StringBuffer sb = new StringBuffer();
- int rd = -1;
- while((rd = in.read()) != -1)
- sb.append((char)rd);
- data = sb.toString();
- }
-
- public void writeObject(OutputStream out) throws IOException {
- out.write(data.getBytes());
- }
-}</programlisting>
-
- <para>SerializableInputTransformer will try to use the method void
- readObject(InputStream in) and SerializableOutputTransformer will try to
- use the method void writeObject(OutputStream in).</para>
- </section>
-
- <section>
- <title>Binding and unbinding components (ResourceContainers)</title>
-
- <para>ResourceBinder takes care of binding and unbinding components
- which represent ResourceContainer. All ResourceContainers must be
- defined as ExoContainer components in configuration files, for
- example:</para>
-
- <programlisting><component>
- <type>org.exoplatform.services.rest.samples.RESTSampleService</type>
-</component></programlisting>
-
- <para>ResourceBinder is an ExoContainer component and implements the
- interface org.picocontainer.Startable (see the picocontainer
- documentation). So at the start of ExoContainer ResourceBinder collects
- all available ResourceContainers. ResourceBinder makes validation for
- all ResourceContainers. At least each ResourceContainer must have the
- @HTTPMethod annotation and @URITemplate annotation. Other annotations
- are not obligatory. It's not allowed to have few ResourceContainers or
- methods with the same @HTTPMethod and @URITemplate annotation value. For
- example, if one container/method has the following code:</para>
-
- <programlisting>public class SimpleResourceContainer implements ResourceContainer {
- @HTTPMethod("GET")
- @URITemplate("/services/{id}/service1/")
- @InputTransformer(StringInputTransformer.class)
- @OutputTransformer(StringOutputTransformer.class)
- public Response method1(String data, @URIParam("id") String param) {
- // ...
- }
-}</programlisting>
-
- <para>than another component with @HTTPMethod("GET") and
- @URITemplate("/services/service1/{id}/") can't be bound. And now we'll
- try to explain this situation. On the one hand URITemplate is defined by
- value /services/{id}/service1/, instead of {id} there can be any other
- string value, so the combination /services/service1/service1/ is
- possible and valid. On the other hand another URITemplate
- /services/service1/{id}/ can have the string service1 instead of {id},
- so for this resource the combination /services/service1/service1/ is
- possible and valid. And now we have two resources with the same
- URITemplate and the same HTTPMethod. This situation is not obligatory,
- we can't say what method we must call! In this case ResourceBinder
- generates InvalidResourceDescriptorException. Binder also checks the
- method parameters. In parameters only one parameter without annotation
- and of free type is allowed. All other parameters must have String type
- (or have a constructor with String) and be annotated. In other cases
- InvalidResourceDescriptorException* is generated. If all components have
- the "right" @HTTPMethod and @URITemplate annotations they should be
- bound without any problems. ResourceDispather gets a collection of
- ResourceContainers during the start and everything is ready to serve a
- request.</para>
-
- <para>Note: within the scope of one component (one class) validation for
- URI templates is not implemented, so a developer must take care of
- @URITemplate and @HTTPMethod. Both of them must not be the same for
- different methods. Except if @QueryTemplate or/and @ProducedMimeTypes
- annotation is used.</para>
- </section>
-
- <section>
- <title>ResourceDispatcher</title>
-
- <para>Now let's talk about the features of ResourceDispatcher.
- ResourceDispatcher is the main part of the RESTful engine. Above we said
- some words about transformation and the role of ResourceDispatcher in
- this process. Now we are ready to talk about annotated method
- parameters. In one of the code examples above you could see the next
- construction</para>
-
- <programlisting>public Response method1(String data, @URIParam("id") String param) {</programlisting>
-
- <para>The method method1 is described with two parameters. The first
- parameter String data is built from the entity body (InputStream). The
- second one - String param is annotated by a special type Annotation.
- This Annotation has the following code:</para>
-
- <programlisting>@Target(value={PARAMETER})
-@Retention(RUNTIME)
-public @interface URIParam {
- String value();
-}</programlisting>
-
- <para>How does it work? After having found the right method
- ResourceDispatcher gets the list of method parameters and starts
- handling them. Dispatcher tries to find the not annotated parameter
- (this entity body) and addresses InputEntityTransformer in order to
- build the required Object from InputStream. When dispatcher finds an
- annotated parameter it checks the type of annotation. It is possible to
- have four types of annotation: @URIParam, @HeaderParam, @QueryParam and
- @ContextParameter. If dispatcher has found the annotation
- @URIParam("id") then it takes the parameter with the key "id" from
- ResourceDescription and adds it into the parameter array. The same
- situation is with header, context and query parameters. So within the
- method a developer gets only the necessary parameters from header, query
- and uri. Some more information about @ContextParameters.
- @ContextParameters can be set in the configuration file of a
- component:</para>
-
- <programlisting><component>
-<type>org.exoplatform.services.rest.ResourceDispatcher</type>
- <init-params>
- <properties-param>
- <name>context-params</name>
- <property name="test" value="test_1"/>
- </properties-param>
- </init-params>
-</component></programlisting>
-
- <para>In this case any service can use this parameter, for
- example:</para>
-
- <programlisting>...method(@ContextParam("test") String p) {
- System.out.println(p);
-}</programlisting>
-
- <para>After its execution you should see "test_1" in console.</para>
-
- <para>And in each service the next context parameters can be used. The
- name of these parameters are described in ResourceDispatcher:</para>
-
- <programlisting>public static final String CONTEXT_PARAM_HOST = "host";
-public static final String CONTEXT_PARAM_BASE_URI = "baseURI";
-public static final String CONTEXT_PARAM_REL_URI = "relURI";
-public static final String CONTEXT_PARAM_ABSLOCATION = "absLocation";</programlisting>
-
- <para>After that dispatcher finishes collecting parameters that the
- method requires, invokes this method and passes the result to the client
- as it is described above.</para>
-
- <para>This part of code can explain how this mechanism works:</para>
-
- <programlisting>//...
- for (int i = 0; i < methodParametersAnnotations.length; i++) {
- if (methodParametersAnnotations[i] == null) {
- InputEntityTransformer transformer = (InputEntityTransformer) factory
- .newTransformer(resource.getInputTransformerType());
- transformer.setType(methodParameters[i]);
- params[i] = transformer.readFrom(request.getEntityStream());
- } else {
- Constructor<?> constructor = methodParameters[i].getConstructor(String.class);
- String constructorParam = null;
- Annotation a = methodParametersAnnotations[i];
- if (a.annotationType().isAssignableFrom(URIParam.class)) {
- URIParam u = (URIParam) a;
- constructorParam = request.getResourceIdentifier().getParameters().get(u.value());
- } else if (a.annotationType().isAssignableFrom(HeaderParam.class)) {
- HeaderParam h = (HeaderParam) a;
- constructorParam = request.getHeaderParams().get(h.value());
- } else if (a.annotationType().isAssignableFrom(QueryParam.class)) {
- QueryParam q = (QueryParam) a;
- constructorParam = request.getQueryParams().get(q.value());
- } else if (a.annotationType().isAssignableFrom(ContextParam.class)) {
- ContextParam c = (ContextParam) a;
- constructorParam = contextHolder_.get().get(c.value());
- }
- if (methodParameters[i].isAssignableFrom(String.class)) {
- params[i] = constructorParam;
- } else {
- params[i] = (constructorParam != null) ? constructor.newInstance(constructorParam) : null;
- }
- }
- }
- Response resp = (Response) resource.getServer().invoke(resource.getResourceContainer(), params);
-//...</programlisting>
-
- <para>The more detailed schema looks like this:</para>
-
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/rest-scheme-detailed.png" />
- </imageobject>
- </mediaobject>
- </section>
- </section>
-</chapter>
Deleted: jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/rest-service-tutorial.xml
===================================================================
--- jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/rest-service-tutorial.xml 2010-08-05 14:54:33 UTC (rev 2889)
+++ jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/rest-service-tutorial.xml 2010-08-05 15:08:10 UTC (rev 2890)
@@ -1,218 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
-"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<chapter id="WS.RestServiceTutorial">
- <?dbhtml filename="ch-rest-service-tutorial.html"?>
-
- <title>REST Service Tutorial</title>
-
- <important>
- <para>This article describes REST framework before version
- exo-ws-2.0.</para>
- </important>
-
- <section>
- <title>Introduction</title>
-
- <para>This HOW-TO explains how to create your own REST based services. In
- this HOW-TO we will create a simple calculator, which can do basic
- operations with integers.</para>
- </section>
-
- <section>
- <title>Source code</title>
-
- <programlisting>// ...
-@URITemplate("/calculator/{item1}/{item2}/")
-public class Calculator implements ResourceContainer {
-}</programlisting>
-
- <para>Writing <command>@URITemplate</command> before the class definition
- gives you the possibility not to set it for each method. Furthermore the
- class must implement the interface <command>ResourceContainer</command>.
- This interface doesn't have any methods, it is just an indication for the
- <command>ResourceBinder</command>. Add the code for adding two
- integers.</para>
-
- <programlisting>// ...
-@URITemplate("/calculator/{item1}/{item2}/")
-public class Calculator implements ResourceContainer {
- @QueryTemplate("operation=add")
- @OutputTransformer(StringOutputTransformer.class)
- @HTTPMethod("GET")
- public Response add(@URIParam("item1") Integer item1,
- @URIParam("item2") Integer item2) {
- StringBuffer sb = new StringBuffer();
- sb.append(item1).append(" + ").append(item2).append(" = ").append(item1 + item2);
- return Response.Builder.ok(sb.toString(), "text/plain").build();
- }
-}</programlisting>
-
- <para>@QueryTemplate("operation=add") - only requests with query
- parameters "operation=add" can reach this method;
- @OutputTransformer(StringOutputTransformer.class) - the output
- transformer; @HTTPMethod("GET") - the HTTP method "GET".</para>
-
- <para>Write the code for other operations in the same way. Then the result
- should look like:</para>
-
- <programlisting>package org.exoplatform.services.rest.example;
-
-import org.exoplatform.services.rest.HTTPMethod;
-import org.exoplatform.services.rest.OutputTransformer;
-import org.exoplatform.services.rest.QueryTemplate;
-import org.exoplatform.services.rest.Response;
-import org.exoplatform.services.rest.URIParam;
-import org.exoplatform.services.rest.URITemplate;
-import org.exoplatform.services.rest.container.ResourceContainer;
-import org.exoplatform.services.rest.transformer.StringOutputTransformer;
-
-@URITemplate("/calculator/{item1}/{item2}/")
-(a)OutputTransformer(StringOutputTransformer.class)
-public class Calculator implements ResourceContainer {
-
- @QueryTemplate("operation=add")
- @HTTPMethod("GET")
- public Response add(@URIParam("item1") Integer item1, @URIParam("item2") Integer item2) {
- StringBuffer sb = new StringBuffer();
- sb.append(item1).append(" + ").append(item2).append(" = ").append(item1 + item2);
- return Response.Builder.ok(sb.toString(), "text/plain").build();
- }
-
- @QueryTemplate("operation=subtract")
- @HTTPMethod("GET")
- public Response subtract(@URIParam("item1") Integer item1, @URIParam("item2") Integer item2) {
- StringBuffer sb = new StringBuffer();
- sb.append(item1).append(" - ").append(item2).append(" = ").append(item1 - item2);
- return Response.Builder.ok(sb.toString(), "text/plain").build();
- }
-
- @QueryTemplate("operation=multiply")
- @HTTPMethod("GET")
- public Response multiply(@URIParam("item1") Integer item1, @URIParam("item2") Integer item2) {
- StringBuffer sb = new StringBuffer();
- sb.append(item1).append(" * ").append(item2).append(" = ").append(item1 * item2);
- return Response.Builder.ok(sb.toString(), "text/plain").build();
- }
-
- @QueryTemplate("operation=divide")
- @HTTPMethod("GET")
- public Response divide(@URIParam("item1") Integer item1, @URIParam("item2") Integer item2) {
- StringBuffer sb = new StringBuffer();
- sb.append(item1).append(" / ").append(item2).append(" = ").append(item1 / item2);
- return Response.Builder.ok(sb.toString(), "text/plain").build();
- }
-}</programlisting>
-
- <para>So we are done with the source code.</para>
- </section>
-
- <section>
- <title>Configuration</title>
-
- <para>Create the directory conf/portal and create the file
- configuration.xml in it. Add the following code to this file:</para>
-
- <programlisting><?xml version="1.0" encoding="ISO-8859-1"?>
-<configuration>
- <component>
- <type>org.exoplatform.services.rest.example.Calculator</type>
- </component>
-</configuration></programlisting>
- </section>
-
- <section>
- <title>Build</title>
-
- <para>Now we must create the following directory structure to get the
- possibility to build the source code using maven.</para>
-
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/rest-build-process.png" />
- </imageobject>
- </mediaobject>
-
- <para>Then create the file pom.xml using the following:</para>
-
- <programlisting><project>
- <parent>
- <groupId>org.exoplatform.ws</groupId>
- <artifactId>config</artifactId>
- <version>trunk</version>
- </parent>
-
- <modelVersion&#624;.0.0</modelVersion>
- <groupId>org.exoplatform.ws.rest</groupId>
- <artifactId>simple.calculator</artifactId>
- <packaging>jar</packaging>
- <version>trunk</version>
- <description>Simple REST service</description>
-
- <dependencies>
- <dependency>
- <groupId>org.exoplatform.ws.rest</groupId>
- <artifactId>exo.rest.core</artifactId>
- <version>trunk</version>
- </dependency>
- </dependencies>
-</project></programlisting>
-
- <para>Build this by executing the command:</para>
-
- <programlisting>andrew@ubu:~/workspace/calculator$ mvn clean install</programlisting>
- </section>
-
- <section>
- <title>Deploy</title>
-
- <para>We have done all now. Then copy the jar file from the target
- directory of project exo-tomcat into the server with all prepared stuff
- for REST services. (You can download it here: <ulink
- url="http://forge.ow2.org/project/download.php?group_id=151&file_id=9862">http://forge.objectweb.org/project/download.php?group_id=151&file_id=...</ulink>)</para>
-
- <para>So just put the jar file into the lib directory of the tomcat and
- restart it. In the console you should see this message:</para>
-
- <programlisting>[INFO] ResourceBinder - Bind new ResourceContainer: org.exoplatform.services.rest.example.Calculator@19846fd</programlisting>
-
- <para>This message indicates that our service was found, bound and is
- ready to work</para>
- </section>
-
- <section>
- <title>Usage</title>
-
- <para>Open your browser and type the following URL:
- <uri>http://localhost:8080/rest/calculator/12/5/?operation=add</uri> and
- you should see the next page:</para>
-
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/rest-run-process.png" />
- </imageobject>
- </mediaobject>
-
- <para>The service is working. This is a very simple example, but it should
- help developers use the REST framework.</para>
-
- <para>Try to check other URLs.</para>
-
- <itemizedlist>
- <listitem>
- <para><uri>http://localhost:8080/rest/calculator/12/5/?operation=subtract</uri>
- - must give "12 - 5 = 7";</para>
- </listitem>
-
- <listitem>
- <para><uri>http://localhost:8080/rest/calculator/12/5/?operation=multiply</uri>
- - must give "12 * 5 = 60";</para>
- </listitem>
-
- <listitem>
- <para><uri>http://localhost:8080/rest/calculator/12/5/?operation=divide</uri>-
- must give "12 / 5 = 2" (we are working with integers!);</para>
- </listitem>
- </itemizedlist>
- </section>
-</chapter>
Modified: jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws.xml
===================================================================
--- jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws.xml 2010-08-05 14:54:33 UTC (rev 2889)
+++ jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws.xml 2010-08-05 15:08:10 UTC (rev 2890)
@@ -9,8 +9,8 @@
<xi:include href="ws/ws.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="ws/rest-framework.xml"
- xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="ws/introduction-to-rest.xml"
+ xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="ws/groovy-scripts-as-rest-services.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
15 years, 11 months
exo-jcr SVN: r2889 - in jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules: ws and 1 other directory.
by do-not-reply@jboss.org
Author: dkatayev
Date: 2010-08-05 10:54:33 -0400 (Thu, 05 Aug 2010)
New Revision: 2889
Removed:
jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/introduction-to-rest.xml
Modified:
jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws.xml
Log:
EXOJCR-870 WS documentation cleaned up
Deleted: jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/introduction-to-rest.xml
===================================================================
--- jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/introduction-to-rest.xml 2010-08-05 14:50:43 UTC (rev 2888)
+++ jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/introduction-to-rest.xml 2010-08-05 14:54:33 UTC (rev 2889)
@@ -1,212 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
-"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<chapter id = "WS.Introduction">
- <?dbhtml filename="ch-introduction-to-rest.html"?>
-
- <title>Introduction to the Representational State Transfer (REST)</title>
-
- <section>
- <title>Introduction</title>
-
- <para><command>Representational State Transfer (REST)</command> is a style
- of software architecture for distributed hypermedia systems such as the
- World Wide Web. The term was introduced in the doctoral dissertation in
- 2000 by Roy Fielding, one of the principal authors of the Hypertext
- Transfer Protocol (HTTP) specification, and has come into widespread use
- in the networking community.</para>
-
- <para>REST strictly refers to a collection of network architecture
- principles that outline how resources are defined and addressed. The term
- is often used in a looser sense to describe any simple interface that
- transmits domain-specific data over HTTP without an additional messaging
- layer such as SOAP or session tracking via HTTP cookies.</para>
-
- <para>The key abstraction of information in REST is a
- <command>resource</command>. Any information that can be named can be a
- resource: a document or image, a temporal service (e.g. "today's weather
- in Los Angeles"), a collection of other resources, a non-virtual object
- (e.g. a person), and so on. In other words, any concept that might be the
- target of an author's hypertext reference must fit within the definition
- of a resource. A resource is a conceptual mapping to a set of entities,
- not the entity that corresponds to the mapping at any particular point in
- time.</para>
-
- <para>REST uses a <command>resource identifier </command>to identify the
- particular resource involved in an interaction between components. REST
- connectors provide a generic interface for accessing and manipulating the
- value set of a resource, regardless of how the membership function is
- defined or the type of software that is handling the request. URL or URN
- are the examples of a resource identifier.</para>
-
- <para>REST components perform actions with a resource by using a
- <command>representation</command> to capture the current or intended state
- of that resource and transferring that representation between components.
- A representation is a sequence of bytes, plus <command>representation
- metadata </command>to describe those bytes. Other commonly used but less
- precise names for a representation include: <command>document, file, and
- HTTP message entity, instance, or variant</command>. A representation
- consists of data, metadata describing the data, and, on occasion, metadata
- to describe the metadata (usually for the purpose of verifying message
- integrity). Metadata are in the form of name-value pairs, where the name
- corresponds to a standard that defines the value's structure and
- semantics. The data format of a representation is known as a media
- type.</para>
-
- <table>
- <title>REST Data Elements</title>
-
- <tgroup cols="2">
- <thead>
- <row>
- <entry align="center">Data Element</entry>
-
- <entry align="center">Modern Web Examples</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry>resource</entry>
-
- <entry>the intended conceptual target of a hypertext
- reference</entry>
- </row>
-
- <row>
- <entry>resource identifier</entry>
-
- <entry>URL, URN</entry>
- </row>
-
- <row>
- <entry>representation</entry>
-
- <entry>HTML document, JPEG image</entry>
- </row>
-
- <row>
- <entry>representation metadata</entry>
-
- <entry>media type, last-modified time</entry>
- </row>
-
- <row>
- <entry>resource metadata</entry>
-
- <entry>source link, alternates, vary</entry>
- </row>
-
- <row>
- <entry>control data</entry>
-
- <entry>if-modified-since, cache-control</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
- <para>REST uses various <command>connector</command> types to encapsulate
- the activities of accessing resources and transferring resource
- representations. The connectors present an abstract interface for
- component communication, enhancing simplicity by providing a complete
- separation of concepts and hiding the underlying implementation of
- resources and communication mechanisms.</para>
-
- <table>
- <title>REST Connectors</title>
-
- <tgroup cols="2">
- <thead>
- <row>
- <entry align="center">Connector</entry>
-
- <entry align="center">Modern Web Examples</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry>client</entry>
-
- <entry>libwww, libwww-perl</entry>
- </row>
-
- <row>
- <entry>server</entry>
-
- <entry>libwww, Apache API, NSAPI</entry>
- </row>
-
- <row>
- <entry>cache</entry>
-
- <entry>browser cache, Akamai cache network</entry>
- </row>
-
- <row>
- <entry>resolver</entry>
-
- <entry>bind (DNS lookup library)</entry>
- </row>
-
- <row>
- <entry>tunnel</entry>
-
- <entry><para></para>SOCKS, SSL after HTTP CONNECT</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
- <para>The primary connector types are client and server. The essential
- difference between the two is that a client initiates communication by
- making a request, whereas a server listens for connections and responds to
- requests in order to supply access to its services. A component may
- include both client and server connectors.</para>
-
- <para>An important part of RESTful architecture is a well-defined
- interface to communicate, in particular it is a set of HTTP methods such
- as POST, GET, PUT and DELETE. These methods are often compared with the
- CREATE, READ, UPDATE, DELETE (CRUD) operations associated with database
- technologies. An analogy can also be made:</para>
-
- <itemizedlist>
- <listitem>
- <para>PUT is analogous to CREATE or PASTE OVER,</para>
- </listitem>
-
- <listitem>
- <para>GET to READ or COPY,</para>
- </listitem>
-
- <listitem>
- <para>POST to UPDATE or PASTE AFTER, and</para>
- </listitem>
-
- <listitem>
- <para>DELETE to DELETE or CUT.</para>
- </listitem>
- </itemizedlist>
-
- <para><command>Note</command>: RESTful architecture is not limited to
- those methods, one of good examples of extension is the WebDAV
- protocol.</para>
-
- <para>The <command>CRUD</command> (Create, Read, Update and Delete) verbs
- are designed to operate with atomic data within the context of a database
- transaction. REST is designed around the atomic transfer of a more complex
- state and can be viewed as a mechanism for transferring structured
- information from one application to another.</para>
-
- <para>HTTP separates the notions of a web server and a web browser. This
- allows the implementation of each to vary from the other based on the
- client/server principle. When used RESTfully, HTTP is
- <command>stateless</command>. Each message contains all the information
- necessary to understand the request.</para>
-
- <para>As a result, neither the client nor the server needs to remember any
- communication-state between messages. Any state retained by the server
- must be modeled as a resource..</para>
- </section>
-</chapter>
Modified: jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws.xml
===================================================================
--- jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws.xml 2010-08-05 14:50:43 UTC (rev 2888)
+++ jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws.xml 2010-08-05 14:54:33 UTC (rev 2889)
@@ -9,15 +9,12 @@
<xi:include href="ws/ws.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="ws/introduction-to-rest.xml"
- xmlns:xi="http://www.w3.org/2001/XInclude" />
+ <xi:include href="ws/rest-framework.xml"
+ xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="ws/groovy-scripts-as-rest-services.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="ws/rest-framework.xml"
- xmlns:xi="http://www.w3.org/2001/XInclude" />
-
<xi:include href="ws/framework-for-cross-domain-ajax.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
15 years, 11 months
exo-jcr SVN: r2888 - jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws.
by do-not-reply@jboss.org
Author: dkatayev
Date: 2010-08-05 10:50:43 -0400 (Thu, 05 Aug 2010)
New Revision: 2888
Added:
jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/introduction-to-rest.xml
Log:
EXOJCR-870 WS introduction chapter (introduction-to-rest.xml) reverted
Added: jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/introduction-to-rest.xml
===================================================================
--- jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/introduction-to-rest.xml (rev 0)
+++ jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/introduction-to-rest.xml 2010-08-05 14:50:43 UTC (rev 2888)
@@ -0,0 +1,212 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<chapter id = "WS.Introduction">
+ <?dbhtml filename="ch-introduction-to-rest.html"?>
+
+ <title>Introduction to the Representational State Transfer (REST)</title>
+
+ <section>
+ <title>Introduction</title>
+
+ <para><command>Representational State Transfer (REST)</command> is a style
+ of software architecture for distributed hypermedia systems such as the
+ World Wide Web. The term was introduced in the doctoral dissertation in
+ 2000 by Roy Fielding, one of the principal authors of the Hypertext
+ Transfer Protocol (HTTP) specification, and has come into widespread use
+ in the networking community.</para>
+
+ <para>REST strictly refers to a collection of network architecture
+ principles that outline how resources are defined and addressed. The term
+ is often used in a looser sense to describe any simple interface that
+ transmits domain-specific data over HTTP without an additional messaging
+ layer such as SOAP or session tracking via HTTP cookies.</para>
+
+ <para>The key abstraction of information in REST is a
+ <command>resource</command>. Any information that can be named can be a
+ resource: a document or image, a temporal service (e.g. "today's weather
+ in Los Angeles"), a collection of other resources, a non-virtual object
+ (e.g. a person), and so on. In other words, any concept that might be the
+ target of an author's hypertext reference must fit within the definition
+ of a resource. A resource is a conceptual mapping to a set of entities,
+ not the entity that corresponds to the mapping at any particular point in
+ time.</para>
+
+ <para>REST uses a <command>resource identifier </command>to identify the
+ particular resource involved in an interaction between components. REST
+ connectors provide a generic interface for accessing and manipulating the
+ value set of a resource, regardless of how the membership function is
+ defined or the type of software that is handling the request. URL or URN
+ are the examples of a resource identifier.</para>
+
+ <para>REST components perform actions with a resource by using a
+ <command>representation</command> to capture the current or intended state
+ of that resource and transferring that representation between components.
+ A representation is a sequence of bytes, plus <command>representation
+ metadata </command>to describe those bytes. Other commonly used but less
+ precise names for a representation include: <command>document, file, and
+ HTTP message entity, instance, or variant</command>. A representation
+ consists of data, metadata describing the data, and, on occasion, metadata
+ to describe the metadata (usually for the purpose of verifying message
+ integrity). Metadata are in the form of name-value pairs, where the name
+ corresponds to a standard that defines the value's structure and
+ semantics. The data format of a representation is known as a media
+ type.</para>
+
+ <table>
+ <title>REST Data Elements</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry align="center">Data Element</entry>
+
+ <entry align="center">Modern Web Examples</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>resource</entry>
+
+ <entry>the intended conceptual target of a hypertext
+ reference</entry>
+ </row>
+
+ <row>
+ <entry>resource identifier</entry>
+
+ <entry>URL, URN</entry>
+ </row>
+
+ <row>
+ <entry>representation</entry>
+
+ <entry>HTML document, JPEG image</entry>
+ </row>
+
+ <row>
+ <entry>representation metadata</entry>
+
+ <entry>media type, last-modified time</entry>
+ </row>
+
+ <row>
+ <entry>resource metadata</entry>
+
+ <entry>source link, alternates, vary</entry>
+ </row>
+
+ <row>
+ <entry>control data</entry>
+
+ <entry>if-modified-since, cache-control</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>REST uses various <command>connector</command> types to encapsulate
+ the activities of accessing resources and transferring resource
+ representations. The connectors present an abstract interface for
+ component communication, enhancing simplicity by providing a complete
+ separation of concepts and hiding the underlying implementation of
+ resources and communication mechanisms.</para>
+
+ <table>
+ <title>REST Connectors</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry align="center">Connector</entry>
+
+ <entry align="center">Modern Web Examples</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>client</entry>
+
+ <entry>libwww, libwww-perl</entry>
+ </row>
+
+ <row>
+ <entry>server</entry>
+
+ <entry>libwww, Apache API, NSAPI</entry>
+ </row>
+
+ <row>
+ <entry>cache</entry>
+
+ <entry>browser cache, Akamai cache network</entry>
+ </row>
+
+ <row>
+ <entry>resolver</entry>
+
+ <entry>bind (DNS lookup library)</entry>
+ </row>
+
+ <row>
+ <entry>tunnel</entry>
+
+ <entry><para></para>SOCKS, SSL after HTTP CONNECT</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>The primary connector types are client and server. The essential
+ difference between the two is that a client initiates communication by
+ making a request, whereas a server listens for connections and responds to
+ requests in order to supply access to its services. A component may
+ include both client and server connectors.</para>
+
+ <para>An important part of RESTful architecture is a well-defined
+ interface to communicate, in particular it is a set of HTTP methods such
+ as POST, GET, PUT and DELETE. These methods are often compared with the
+ CREATE, READ, UPDATE, DELETE (CRUD) operations associated with database
+ technologies. An analogy can also be made:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>PUT is analogous to CREATE or PASTE OVER,</para>
+ </listitem>
+
+ <listitem>
+ <para>GET to READ or COPY,</para>
+ </listitem>
+
+ <listitem>
+ <para>POST to UPDATE or PASTE AFTER, and</para>
+ </listitem>
+
+ <listitem>
+ <para>DELETE to DELETE or CUT.</para>
+ </listitem>
+ </itemizedlist>
+
+ <para><command>Note</command>: RESTful architecture is not limited to
+ those methods, one of good examples of extension is the WebDAV
+ protocol.</para>
+
+ <para>The <command>CRUD</command> (Create, Read, Update and Delete) verbs
+ are designed to operate with atomic data within the context of a database
+ transaction. REST is designed around the atomic transfer of a more complex
+ state and can be viewed as a mechanism for transferring structured
+ information from one application to another.</para>
+
+ <para>HTTP separates the notions of a web server and a web browser. This
+ allows the implementation of each to vary from the other based on the
+ client/server principle. When used RESTfully, HTTP is
+ <command>stateless</command>. Each message contains all the information
+ necessary to understand the request.</para>
+
+ <para>As a result, neither the client nor the server needs to remember any
+ communication-state between messages. Any state retained by the server
+ must be modeled as a resource..</para>
+ </section>
+</chapter>
15 years, 11 months
exo-jcr SVN: r2887 - in jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules: ws and 1 other directory.
by do-not-reply@jboss.org
Author: dkatayev
Date: 2010-08-05 10:37:10 -0400 (Thu, 05 Aug 2010)
New Revision: 2887
Removed:
jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/central-authentication-service-configuration.xml
jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/cometd-cluster-bench.xml
jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/cometd-cluster.xml
jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/cometd.xml
jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/introduction-to-rest.xml
jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/javascript-webdav-library.xml
jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/kerberos-sso-on-active-directory.xml
jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/oauth.xml
jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/rest-migration-to-jsr311.xml
jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/soap-service-tutorial.xml
Modified:
jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws.xml
Log:
EXOJCR-870 WS documentation cleaned up
Deleted: jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/central-authentication-service-configuration.xml
===================================================================
--- jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/central-authentication-service-configuration.xml 2010-08-05 13:44:26 UTC (rev 2886)
+++ jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/central-authentication-service-configuration.xml 2010-08-05 14:37:10 UTC (rev 2887)
@@ -1,442 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
-"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<chapter id="WS.CentralAuthenticationServiceConfiguration">
- <?dbhtml filename="ch-central-authentication-service-configuration.html"?>
-
- <title>Central Authentication Service Configuration</title>
-
- <section>
- <title>Introduction</title>
-
- <para>Central Authentication Service (CAS) is a Web Single Sign-On
- (WebSSO), developped by JA-SIG as an open-source project. CAS, like any
- WebSSO, is very interesting in information systems where many applications
- share a common users repository. When you enable CAS on all the
- application, a user would log once and only once and will be recognized
- and authentified into all the applications.</para>
-
- <para>CAS documentation explains how to configure in details any
- environment, that is mainly a configuration of a Web application to
- authenticate itself against the CAS Server instead of an internal
- mechanism. This documentation explain how to configure eXo Platform to
- delegate the authentication to the CAS server and let it ensure the
- single-sign-one between all the applications of an IS.</para>
- </section>
-
- <section>
- <title>CAS configuration</title>
-
- <para>This article try to explain how to configure CAS server and client
- for exo. For this example we will use 2 the same tomcat instance, but one
- for it has additation CAS server.</para>
-
- <para>This configuration is not very useful, but very good example for
- configuration CAS.</para>
-
- <para>Tomcat 1 deployed on windows 2003 - this is CAS server, tomcat 2 on
- Ubuntu 7.10.</para>
-
- <section>
- <title>Configure CAS server</title>
-
- <para><command>(DNS name: test01-srv.exoua-int)</command></para>
-
- <para>1.Certificates.</para>
-
- <programlisting>E:/Program Files>cd java
-E:/Program Files/Java>cd jre1.5.0_11
-E:/Program Files/Java/jre1.5.0_11>cd bin
-E:/Program Files/Java/jre1.5.0_11/bin>keytool -genkey -alias tomcat -keypass 123456 -keyalg RSA
-Enter keystore password: 123456
-What is your first and last name?
- [Unknown]: test01-srv.exoua-int
-What is the name of your organizational unit?
- [Unknown]: .
-What is the name of your organization?
- [Unknown]: .
-What is the name of your City or Locality?
- [Unknown]: .
-What is the name of your State or Province?
- [Unknown]: .
-What is the two-letter country code for this unit?
- [Unknown]: UA
-Is CN=test01-srv.exoua-int, OU=., O=., L=., ST=., C=UA correct?
- [no]: yes
-
-E:/Program Files/Java/jre1.5.0_11/bin>keytool -export -alias tomcat -keypass 123456 -file server.crt
-Enter keystore password: 123456
-Certificate stored in file <server.crt></programlisting>
-
- <para>This is optional, I just want to have the same password for
- storage %JRE_HOME%/lib/security/cacerts.</para>
-
- <programlisting>E:/Program Files/Java/jre1.5.0_11/bin>keytool -storepasswd -keystore ../lib/security/cacerts
-Enter keystore password: changeit
-New keystore password: 123456
-Re-enter new keystore password: 123456</programlisting>
-
- <para>Continue with certificates.</para>
-
- <programlisting>E:/Program Files/Java/jre1.5.0_11/bin>keytool -import -file server.crt -keypass 123456 -keystore ../lib/security/cacerts
-Enter keystore password: 123456
-Owner: CN=test01-srv.exoua-int, OU=., O=., L=., ST=., C=UA
-Issuer: CN=test01-srv.exoua-int, OU=., O=., L=., ST=., C=UA
-Serial number: 4810c6c5
-Valid from: Fri Apr 24 20:33:36 HST 2008 until: Thu Jul 23 20:33:36 HST 2008
-Certificate fingerprints:
-MD5: CC:3B:FB:FB:AE:12:AD:FB:3E:D 5:98:CB:2E:3B:0A:AD
-SHA1: A1:16:80:68:39:C7:58:EA:2F:48:59:AA:1D:73:5F:56:78:CE:A4:CE
-Trust this certificate? [no]: yes
-Certificate was added to keystore
-
-E:/Program Files/Java/jre1.5.0_11/bin></programlisting>
-
- <para>2. Now edit server.xml file for tomcat (we are using 6.0.13
- everywhere).Uncomment configuration for SSL connection end edit it, it
- must looks as this:</para>
-
- <programlisting><Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
-maxThreads="150" scheme="https" secure="true"
-clientAuth="false" sslProtocol="TLS"
-keystoreFile="E:/Documents and Settings/admin/.keystore"
-keystorePass="123456"
-keyAlias="tomcat"
-truststoreFile="E:/Program Files/Java/jre1.5.0_11/lib/security/cacerts"
-truststorePass="123456" /></programlisting>
-
- <para>3. Now configure client part of CAS, as example we will use
- portal/private/* .Edit file /portal/WEB-INF/web.xml.</para>
-
- <programlisting><context-param>
- <param-name>serverName</param-name>
- <param-value>http://test01-srv.exoua-int:8080</param-value>
-</context-param></programlisting>
-
- <para>Configure client, in this example we will protect
- /portal/private/* resource. Note: These filter must be add before this
- filter "SetCurrentIdentityFilter", the same think for
- filter-mapping.</para>
-
- <programlisting><filter>
- <filter-name>SingleSignOutFilter</filter-name>
- <filter-class>org.jasig.cas.client.session.SingleSignOutFilter</filter-class>
-</filter>
-<filter>
- <filter-name>AuthenticationFilter</filter-name>
- <filter-class>org.jasig.cas.client.authentication.AuthenticationFilter</filter-class>
- <init-param>
- <param-name>casServerLoginUrl</param-name>
- <param-value>https://test01-srv.exoua-int:8443/cas/login</param-value>
- </init-param>
-</filter>
-<filter>
- <filter-name>Cas20ProxyReceivingTicketValidationFilter</filter-name>
- <filter-class>org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter</filter-class>
- <init-param>
- <param-name>casServerUrlPrefix</param-name>
- <param-value>https://test01-srv.exoua-int:8443/cas</param-value>
- </init-param>
- <init-param>
- <param-name>redirectAfterValidation</param-name>
- <param-value>true</param-value>
- </init-param>
-</filter>
-<filter>
- <filter-name>HttpServletRequestWrapperFilter</filter-name>
- <filter-class>org.jasig.cas.client.util.HttpServletRequestWrapperFilter</filter-class>
-</filter>
-<!-- eXo -->
-<filter>
- <filter-name>BaseIdentityInitializerFilterImpl</filter-name>
- <filter-class>org.exoplatform.services.security.cas.client.impl.BaseIdentityInitializerFilterImpl</filter-class>
-</filter>
-<!-- end exo -->
-....
-<filter-mapping>
- <filter-name>SingleSignOutFilter</filter-name>
- <url-pattern>/private/*</url-pattern>
-</filter-mapping>
-<filter-mapping>
- <filter-name>AuthenticationFilter</filter-name>
- <url-pattern>/private/*</url-pattern>
-</filter-mapping>
-<filter-mapping>
- <filter-name>Cas20ProxyReceivingTicketValidationFilter</filter-name>
- <url-pattern>/private/*</url-pattern>
-</filter-mapping>
-<filter-mapping>
- <filter-name>HttpServletRequestWrapperFilter</filter-name>
- <url-pattern>/private/*</url-pattern>
-</filter-mapping>
-<!-- exo -->
-<filter-mapping>
- <filter-name>BaseIdentityInitializerFilterImpl</filter-name>
- <url-pattern>/private/*</url-pattern>
-</filter-mapping>
-<!-- end exo -->
-....
-<listener>
- <listener-class>org.jasig.cas.client.session.SingleSignOutHttpSessionListener</listener-class>
-</listener>
-....
-<!-- exo -->
-<servlet>
- <servlet-name>LogoutServlet</servlet-name>
- <servlet-class>org.exoplatform.services.security.cas.client.impl.LogoutServlet</servlet-class>
- <init-param>
- <param-name>casServerLogoutUrl</param-name>
- <param-value>https://test01-srv.exoua-int:8443/cas/logout</param-value>
- </init-param>
- <init-param>
- <param-name>redirectToUrl</param-name>
- <param-value>http://test01-srv.exoua-int:8080/portal/public/classic</param-value>
- </init-param>
-</servlet>
-<!-- end exo -->
-.....
-<!-- exo -->
-<servlet-mapping>
- <servlet-name>LogoutServlet</servlet-name>
- <url-pattern>/logout/*</url-pattern>
-</servlet-mapping>
-<!-- end exo -->
-....</programlisting>
-
- <para>4. Download and build code from <link
- linkend="???">http://svn.exoplatform.org/svnroot/exoplatform/projects/ws/trunk/security...</link></para>
-
- <para>5. Download and put cas-client-core-3.1.1.jar in
- CATALINA_HOME%/lib directory.</para>
-
- <para>6. Download CAS server source code and build it or download
- binary. Put cas.war in webapps directoryChange configuration in file
- /cas/WEB-INF/deployConfigContext.xml. Comment test authenticator and add
- new one.</para>
-
- <programlisting><!--
-<bean class="org.jasig.cas.authentication.handler.support.SimpleTestUsernamePasswordAuthenticationHandler" />
--->
-<!-- will check username and password at remote host -->
-<bean class="org.exoplatform.services.security.cas.server.HTTPAuthenticationHandler"
-p:authenticationURL="https://ubu.exoua-int:8443/portal/login" /></programlisting>
-
- <para>7. Download and build code which can do remote
- authentication.Download and build code from <link
- linkend="???">http://svn.exoplatform.org/svnroot/exoplatform/projects/ws/trunk/security...</link>,
- andput it cas/WEB-INF/lib directory. This CAS server side handler which
- can call remote eXo authenticatiob service via HTTP.In this case
- validation of username/password wiil be done at ubu.exoua-int, but
- authentication sever (CAS) will be at test01-srv.exoua-int</para>
- </section>
-
- <section>
- <title>Configure other tomcat instance</title>
-
- <para><command>Configure other tomcat instance, deploy it on Ubuntu 7.10
- (DNS name: ubu.exoua-int).</command></para>
-
- <para>1. Generate certificates for CAS client. The same as for previous
- but change name to ubu.exoua-int.</para>
-
- <para>2. Edit server.xml file for tomcat.</para>
-
- <programlisting><Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
-maxThreads="150" scheme="https" secure="true"
-clientAuth="false" sslProtocol="TLS"
-keystoreFile="/home/andrew/.keystore"
-keystorePass="123456"
-keyAlias="tomcat"
-truststoreFile="/home/andrew/lib/java/jre/lib/security/cacerts"
-truststorePass="123456" /></programlisting>
-
- <para>3. Edit file portal/WEB-INF/web.xml, add next strings in it.
- Change context parameter.</para>
-
- <programlisting><context-param>
- <param-name>serverName</param-name>
- <param-value>http://ubu.exoua-int:8080</param-value>
-</context-param></programlisting>
-
- <para>Filters configuration must be the same as in client part on
- tomcat1. But add one more servlet which will check
- username/password.</para>
-
- <programlisting><filter>
- <filter-name>SingleSignOutFilter</filter-name>
- <filter-class>org.jasig.cas.client.session.SingleSignOutFilter</filter-class>
-</filter>
-<filter>
- <filter-name>AuthenticationFilter</filter-name>
- <filter-class>org.jasig.cas.client.authentication.AuthenticationFilter</filter-class>
- <init-param>
- <param-name>casServerLoginUrl</param-name>
- <param-value>https://test01-srv.exoua-int:8443/cas/login</param-value>
- </init-param>
-</filter>
-<filter>
- <filter-name>Cas20ProxyReceivingTicketValidationFilter</filter-name>
- <filter-class>org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter</filter-class>
- <init-param>
- <param-name>casServerUrlPrefix</param-name>
- <param-value>https://test01-srv.exoua-int:8443/cas</param-value>
- </init-param>
- <init-param>
- <param-name>redirectAfterValidation</param-name>
- <param-value>true</param-value>
- </init-param>
-</filter>
-<filter>
- <filter-name>HttpServletRequestWrapperFilter</filter-name>
- <filter-class>org.jasig.cas.client.util.HttpServletRequestWrapperFilter</filter-class>
-</filter>
-<!-- exo -->
-<filter>
- <filter-name>BaseIdentityInitializerFilterImpl</filter-name>
- <filter-class>org.exoplatform.services.security.cas.client.impl.BaseIdentityInitializerFilterImpl\
-</filter-class>
-</filter>
-<!-- end exo -->
-....
-<filter-mapping>
- <filter-name>SingleSignOutFilter</filter-name>
- <url-pattern>/private/&#42;</url-pattern>
-</filter-mapping>
-<filter-mapping>
- <filter-name>AuthenticationFilter</filter-name>
- <url-pattern>/private/&#42;</url-pattern>
-</filter-mapping>
-<filter-mapping>
- <filter-name>Cas20ProxyReceivingTicketValidationFilter</filter-name>
- <url-pattern>/private/&#42;</url-pattern>
-</filter-mapping>
-<filter-mapping>
- <filter-name>HttpServletRequestWrapperFilter</filter-name>
- <url-pattern>/private/&#42;</url-pattern>
-</filter-mapping>
-<!-- exo -->
-<filter-mapping>
- <filter-name>BaseIdentityInitializerFilterImpl</filter-name>
- <url-pattern>/private/&#42;</url-pattern>
-</filter-mapping>
-<!-- end exo -->
-....
-<listener>
- <listener-class>org.jasig.cas.client.session.SingleSignOutHttpSessionListener</listener-class>
-</listener>
-....
-<!-- exo -->
-<servlet>
- <servlet-name>BaseHTTPUsernamePasswordValidator</servlet-name>
- <servlet-class>org.exoplatform.services.security.cas.client.impl.BaseHTTPUsernamePasswordValidatorImpl</servlet-class>
-</servlet>
-<servlet>
- <servlet-name>LogoutServlet</servlet-name>
- <servlet-class>org.exoplatform.services.security.cas.client.impl.LogoutServlet</servlet-class>
- <init-param>
- <param-name>casServerLogoutUrl</param-name>
- <param-value>https://test01-srv.exoua-int:8443/cas/logout</param-value>
- </init-param>
- <init-param>
- <param-name>redirectToUrl</param-name>
- <param-value>http://ubu.exoua-int:8080/portal/public/classic</param-value>
- </init-param>
-</servlet>
-<!-- end exo -->
-.....
-<!-- exo -->
-<servlet-mapping>
- <servlet-name>BaseHTTPUsernamePasswordValidator</servlet-name>
- <url-pattern>/login/&#42;</url-pattern>
-</servlet-mapping>
-<servlet-mapping>
- <servlet-name>LogoutServlet</servlet-name>
- <url-pattern>/logout/&#42;</url-pattern>
-</servlet-mapping>
-<!-- end exo -->
-<!-- not use default authentification-->
-<!--
-<security-constraint>
- <web-resource-collection>
- <web-resource-name>user authentication</web-resource-name>
- <url-pattern>/private/&#42;</url-pattern>
- <http-method>POST</http-method>
- <http-method>GET</http-method>
- </web-resource-collection>
- <auth-constraint>
- <role-name>users</role-name>
- </auth-constraint>
- <user-data-constraint>
- <transport-guarantee>NONE</transport-guarantee>
- </user-data-constraint>
- </security-constraint>
-
- <login-config>
- <auth-method>FORM</auth-method>
- <realm-name>exo-domain</realm-name>
- <form-login-config>
- <form-login-page>/login/jsp/login.jsp</form-login-page>
- <form-error-page>/login/jsp/login.jsp</form-error-page>
- </form-login-config>
- </login-config>
-
- <security-role>
- <description>a simple user role</description>
- <role-name>users</role-name>
- </security-role>
-
- <security-role>
- <description>the admin role</description>
- <role-name>admin</role-name>
- </security-role>
--->
-<!-- end web.xml file-->
-....</programlisting>
-
- <para>4. Download and build code from <link
- linkend="???">http://svn.exoplatform.org/svnroot/exoplatform/projects/ws/trunk/security...</link></para>
-
- <para>5. Download and put cas-client-core-3.1.1.jar in
- CATALINA_HOME%/lib directory.</para>
-
- <para>6. Now get trusted certificate for CAS server instance. To do this
- download and compile this file: <link
- linkend="???">http://blogs.sun.com/andreas/resource/InstallCert.java</link>
- Then run it:</para>
-
- <programlisting>java InstallCert test01-srv.exoua-int:8443 123456</programlisting>
-
- <para>Change 123456 to actual password for keystore. You can see some
- exception but finally you must see info about certificates and prompt
- about adding it in storage. Select certificate, usually type 1 end press
- Enter.</para>
-
- <para>Finish!!!</para>
- </section>
-
- <section>
- <title>Usage</title>
-
- <para>Run both servers, and try open one of protected URLs, for example
- <link
- linkend="???">http://test01-srv.exoua-int:8080/portal/private/classic</link>.
- Accept certificates, and in login page username/password: root/exo. You
- must get private area in portal as root, then open other protected
- resource on server 'ubu.exoua-int', <link
- linkend="???">http://ubu.exoua-int:8080/portal/private/classic</link>.
- And you must get this private area in other portal <command>without
- login</command>. If you get it then SSO for login work as well.</para>
-
- <para>No try logout on 'ubu.exoua-int'. To do it directly from portal
- one groovy script must be modified, but it is not described here.</para>
-
- <para>After logout from 'ubu.exoua-int' you should be asked about login
- at 'test01-srv.exoua-int'. The SSO for logout work well also.</para>
-
- <para>That is all!</para>
-
- <para>If it works as described above, then configuration right and SSO
- works.</para>
- </section>
- </section>
-</chapter>
Deleted: jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/cometd-cluster-bench.xml
===================================================================
--- jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/cometd-cluster-bench.xml 2010-08-05 13:44:26 UTC (rev 2886)
+++ jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/cometd-cluster-bench.xml 2010-08-05 14:37:10 UTC (rev 2887)
@@ -1,186 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
-"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<chapter id = "WS.CometdClusterBench">
- <?dbhtml filename="ch-cometd-cluster-bench.html"?>
-
- <title>Cometd Cluster Bench</title>
-
- <section>
- <title>How we test</title>
-
- <para>We simple open many connection, all client subscribing to one
- channel, we don't send any message to client, they reconnect through
- 120000 ms. Settings for cometd servlet.</para>
-
- <programlisting><servlet>
- <servlet-name>cometd</servlet-name>
- <servlet-class>org.mortbay.cometd.continuation.EXoContinuationCometdServlet</servlet-class>
- <init-param>
- <param-name>filters</param-name>
- <param-value>/WEB-INF/filters.json</param-value>
- </init-param>
- <init-param>
- <param-name>timeout</param-name>
- <param-value>120000</param-value>
- </init-param>
- <init-param>
- <param-name>interval</param-name>
- <param-value>0</param-value>
- </init-param>
- <init-param>
- <param-name>multiFrameInterval</param-name>
- <param-value>1500</param-value>
- </init-param>
- <init-param>
- <param-name>logLevel</param-name>
- <param-value>0</param-value>
- </init-param>
- <init-param>
- <param-name>JSONCommented</param-name>
- <param-value>false</param-value>
- </init-param>
- <init-param>
- <param-name>alwaysResumePoll</param-name>
- <param-value>false</param-value> <!-- use true for x-site cometd -->
- </init-param>
- <load-on-startup>1</load-on-startup>
- </servlet></programlisting>
- </section>
-
- <section>
- <title>Environment</title>
-
- <para>Test running on our server for testing (Tornado)</para>
-
- <para>Processor : Intel(R) Xeon(R) CPU E5345 @ 2.33GHz (8 cores)</para>
-
- <para>RAM : 16 GB</para>
-
- <para>java version "1.5.0_15" (64-bit)</para>
- </section>
-
- <section>
- <title>Result</title>
-
- <table>
- <title></title>
-
- <tgroup cols="4">
- <thead>
- <row>
- <entry align="center">Connection</entry>
-
- <entry align="center">Heap (JProfiler), mb</entry>
-
- <entry align="center">Virt (top),gb</entry>
-
- <entry align="center">res (top), gb</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry>1000</entry>
-
- <entry>239</entry>
-
- <entry>-</entry>
-
- <entry>-</entry>
- </row>
-
- <row>
- <entry>2000</entry>
-
- <entry>318</entry>
-
- <entry>-</entry>
-
- <entry>-</entry>
- </row>
-
- <row>
- <entry>3000</entry>
-
- <entry>450</entry>
-
- <entry>6</entry>
-
- <entry>1.36</entry>
- </row>
-
- <row>
- <entry>4000</entry>
-
- <entry>610</entry>
-
- <entry>7.2</entry>
-
- <entry>1.6</entry>
- </row>
-
- <row>
- <entry>5000</entry>
-
- <entry>767</entry>
-
- <entry>12.9</entry>
-
- <entry>1.7</entry>
- </row>
-
- <row>
- <entry>6000</entry>
-
- <entry>895</entry>
-
- <entry>14.4</entry>
-
- <entry>1.8</entry>
- </row>
-
- <row>
- <entry>7000</entry>
-
- <entry>1004</entry>
-
- <entry>15.5</entry>
-
- <entry>2.2</entry>
- </row>
-
- <row>
- <entry>8000</entry>
-
- <entry>1116</entry>
-
- <entry>17.3</entry>
-
- <entry>2.6</entry>
- </row>
-
- <row>
- <entry>9000</entry>
-
- <entry>1295</entry>
-
- <entry>29.6</entry>
-
- <entry>9.8</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/cometd-bench.png" />
- </imageobject>
- </mediaobject>
-
- <para>In screenshot red line show thousand of connection. Then count of
- connection be 9000 the test fail, with exception connection
- timeout.</para>
- </section>
-</chapter>
Deleted: jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/cometd-cluster.xml
===================================================================
--- jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/cometd-cluster.xml 2010-08-05 13:44:26 UTC (rev 2886)
+++ jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/cometd-cluster.xml 2010-08-05 14:37:10 UTC (rev 2887)
@@ -1,224 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
-"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<chapter id="WS.Cometdcluster">
- <?dbhtml filename="ch-cometd-cluster.html"?>
-
- <title>Cometd cluster</title>
-
- <section>
- <title>Motivation</title>
-
- <para>When we run Stress Testing Cometd (Jetty implementation) <ulink
- url="http://docs.codehaus.org/display/JETTY/Stress+Testing+Cometd">http://docs.codehaus.org/display/JETTY/Stress+Testing+Cometd</ulink>
- we see that if we connect many clients, deliver message latency tends to
- grow up. This situation described in article "20,000 Reasons Why Comet
- Scales". <ulink
- url="http://cometdaily.com/2008/01/07/20000-reasons-that-comet-scales/">http://cometdaily.com/2008/01/07/20000-reasons-that-comet-scales/</ulink>
- So, in order to support a lot of concurrent cometd connections we need a
- mean to horizontally scale eXo cometd support.</para>
-
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/cometd-cluster.png" />
- </imageobject>
- </mediaobject>
-
- <para>1- Getting base URL for cometd connection (one of the node in cometd
- cluster)</para>
-
- <para>2 - Getting userToken at cometd server (it need for subscribing on
- channel)</para>
-
- <para>3 - Sending message from Exo-server</para>
-
- <para>LoadBalancer - component that give base URL of one of free cometd
- server.</para>
-
- <para>ContinuationServiceDelegate - component that send message from
- Exo-server to client via cometd server there client is registered</para>
-
- <para>RESTContinuationService - component that receive message from
- ContinuationServiceDelegate and delegate it to ContinuationServer and send
- userToken generated by ContinuationServer for user.</para>
-
- <para>ContinuationService - component that provide cometd
- connection.</para>
- </section>
-
- <section>
- <title>How it works</title>
-
- <para>To start work with cometd service the client should send request to
- Exo-server with the username, receive with response URL one of cometd
- servers (1 - on the scheme). This URL gives out LoadBalancer using the
- information set in a configuration</para>
-
- <programlisting><init-params>
- <object-param>
- <name>cometd.lb.configuration</name>
- <description>cometd lb nodes</description>
- <object type="org.exoplatform.ws.frameworks.cometd.loadbalancer.LoadBalancerImpl$LoadBalancerConf">
- <field name="nodes">
- <collection type="java.util.ArrayList">
- <value>
- <object type="org.exoplatform.ws.frameworks.cometd.loadbalancer.Node">
- <field name="id">
- <string>1</string>
- </field>
- <field name="url">
- <string>http://localhost:8080</string>
- </field>
- <field name="maxConnection">
- <int>10</int>
- </field>
- </object>
- </value>
- <value>
- <object type="org.exoplatform.ws.frameworks.cometd.loadbalancer.Node">
- <field name="id">
- <string>2</string>
- </field>
- <field name="url">
- <string>http://localhost:8081</string>
- </field>
- <field name="maxConnection">
- <int>15</int>
- </field>
- </object>
- </value>
- </collection>
- </field>
- </object>
- </object-param>
-</init-params></programlisting>
-
- <para>In the above configuration we described two cometd-cluseter nodes
- of. Let's consider one of them.</para>
-
- <para>1 - are unique the identifier of node (id) http://localhost:8080 -
- base URL 15 - the maximum number of the connected clients. LoadBalancer
- chooses one of node in cometd cluster (on which connection is possible)
- and associate with a name of the user! Now the client know on that cometd
- server connection is possible, for this purpose it is necessary to request
- userToken on cometd server(2). As for this need do request on other domain
- client must use framework that allowed cross-domain-ajax. We have
- framework that can do this task, how use this framework describe in
- article - Framework for cross-domain AJAX. After client receive userToken
- the client can do cometd-registration.</para>
-
- <para>Example: the Client with a name exo1 wishes to be connected to
- cometd to service. It is necessary to make HTTP request (GET) on
- Exo-server URL = "http://localhost:8080/rest/cometdurl/exo1" with the
- answer receives a base URL of cometd server, it can be as a remote server
- or local. We will assume that we use cluster and receive some thing like
- this "http://192.168.0.21:8080". Further it is necessary get userToken
- already from cometd server for this purpose do request (GET) URL
- ="http://192.168.0.22:8081/rest/gettoken/exo1", after that we do standard
- procedure for cometd connections.</para>
-
- <para>Then it is necessary to send the message to client
- ContinuationServiceDelegate requests at LoadBalancer the cometd server
- address on which the client is registered sends the message in format JSON
- on cometd server should be RESTContinuationService which to accept the
- message and to transfer them to ContinuationService (3)</para>
-
- <para>Example: we will want to send the message to the client exo1. For
- this purpose ContinuationServiceDelegate requests to LoadBalancer the
- information on that to what server the given user is connected, we will
- receive necessary URL http://192.168.0.22:8081) and do HTTP request (POST)
- on comets a server, URL =
- "http://192.168.0.22:8080/rest/sendprivatemessage/" in a body the message
- in format JSON is transferred, RESTContinuationService having received the
- given message transfers it ContinuationService which already in turn
- delivers it to the client.</para>
-
- <programlisting><configuration>
- <component>
- <type>org.exoplatform.ws.frameworks.cometd.ContinuationService</type>
- </component>
- <component>
- <key>org.mortbay.cometd.continuation.AbstractBayeux</key>
- <type>org.mortbay.cometd.continuation.EXoContinuationBayeux</type>
- </component>
- <component>
- <key>org.exoplatform.ws.frameworks.cometd.transport.ContinuationServiceDelegate</key>
- <type>org.exoplatform.ws.frameworks.cometd.transport.ContinuationServiceRemoteDelegate</type>
- </component>
- <component>
- <type>org.exoplatform.ws.frameworks.cometd.transport.RESTContinuationService</type>
- </component>
- <component>
- <type>org.exoplatform.ws.frameworks.cometd.loadbalancer.RESTLoadBalancerService</type>
- </component>
- <component>
- <key>org.exoplatform.ws.frameworks.cometd.loadbalancer.LoadBalancer</key>
- <type>org.exoplatform.ws.frameworks.cometd.loadbalancer.LoadBalancerImpl</type>
- <init-params>
- <object-param>
- <name>cometd.lb.configuration</name>
- <description>cometd lb nodes</description>
- <object type="org.exoplatform.ws.frameworks.cometd.loadbalancer.LoadBalancerImpl$LoadBalancerConf">
- <field name="nodes">
- <collection type="java.util.ArrayList">
- <value>
- <object type="org.exoplatform.ws.frameworks.cometd.loadbalancer.Node">
- <field name="id">
- <string>1</string>
- </field>
- <field name="url">
- <string>http://localhost:8080</string>
- </field>
- <field name="maxConnection">
- <int>10</int>
- </field>
- </object>
- </value>
- <value>
- <object type="org.exoplatform.ws.frameworks.cometd.loadbalancer.Node">
- <field name="id">
- <string>2</string>
- </field>
- <field name="url">
- <string>http://localhost:8081</string>
- </field>
- <field name="maxConnection">
- <int>15</int>
- </field>
- </object>
- </value>
- </collection>
- </field>
- </object>
- </object-param>
-</init-params>
- </component>
-</configuration></programlisting>
-
- <para>The test: At testing running two servlet-containers Tomcat (in role
- Exo - server'a) and Jetty (cometd server). A configuration example:</para>
-
- <programlisting><configuration clients="12" repeat="1" sleep-connection="500" sleep-sending="200">
- <container containerStart="false" port="8080" home=""/>
- <messages>
- <message broadcast="false" id="1">hello</message>
- <message broadcast="true" id="2">hello!!!</message>
- </messages>
- <cometd-url>http://localhost:8080/cometd/cometd</cometd-url>
- <base-url>http://localhost:8080/rest/</base-url>
- <channels>
- <channel>/eXo/comedt/test</channel>
- </channels>
-</configuration></programlisting>
-
- <para>configuration describe that we create 12 cometd connections with
- sleep-connection = "500" (мс), will be subscribe on the channel
- "/eXo/comedt/test". Then it will be sent two message "hello" "hello!!!"
- the First individually to each of the clients, the second broadcast on the
- channel. Messages delivered with an interval sleep-sending = "200".
- <uri>http://localhost:8080/rest/</uri> - base URL of Exo - server. For
- start test execute a command:</para>
-
- <programlisting>mvn clean install -f pom-test.xml -Dexo.test.skip=false -Djetty.home = "./target/jetty"</programlisting>
- </section>
-</chapter>
Deleted: jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/cometd.xml
===================================================================
--- jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/cometd.xml 2010-08-05 13:44:26 UTC (rev 2886)
+++ jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/cometd.xml 2010-08-05 14:37:10 UTC (rev 2887)
@@ -1,131 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
-"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<chapter id="WS.Cometd">
- <?dbhtml filename="ch-cometd.html"?>
-
- <title>Cometd</title>
-
- <section>
- <title>definition</title>
-
- <para>Comet is a World Wide Web application architecture in which a web
- server sends data to a client program (normally a web browser)
- asynchronously without any need for the client to explicitly request it.
- It allows creation of event-driven web applications, enabling real-time
- interaction which would otherwise require much more work. Though the term
- Comet was coined in 2006, the idea is several years older, and has been
- called various names, including server push, HTTP push, HTTP streaming,
- Pushlets, Reverse Ajax, and others.</para>
-
- <para>Cometd on wikipedia <ulink
- url="http://en.wikipedia.org/wiki/Comet_(programming)">http://en.wikipedia.org/wiki/Comet_(programming)</ulink>.</para>
-
- <para>It's an implementation of the Bayeux protocol.</para>
- </section>
-
- <section>
- <title>Use</title>
-
- <para>Cometd is deployed by default with the portal (only trunk version).
- it's composed of a service and a webapp.</para>
-
- <para>To get access to the cometd, you need to get a key associated with
- the login used in the portal.</para>
-
- <programlisting>public String getUserToken(String eXoId)</programlisting>
-
- <para>The connection has to be initialized, for doing so you can use the
- cometd widget available by default in the portal.</para>
-
- <para>to send a message from the service to a user :</para>
-
- <programlisting>public void sendMessage(String eXoId, String channel, Object data)</programlisting>
- </section>
-
- <section>
- <title>Sample</title>
-
- <para>you can find a sample here <link
- linkend="???">http://svn.exoplatform.org/svnroot/exoplatform/projects/portal/trunk/samp...</link></para>
-
- <para><command>To have it working :</command></para>
-
- <itemizedlist>
- <listitem>
- <para>deploy a trunk version of the portal</para>
- </listitem>
-
- <listitem>
- <para>go to ~/java/portal/trunk/sample/application/cometd/ and execute
- exoproject --deploy=module</para>
- </listitem>
-
- <listitem>
- <para>start the portal</para>
- </listitem>
-
- <listitem>
- <para>load all the widgets and portlets</para>
- </listitem>
-
- <listitem>
- <para>in a page, add the cometd widget and the portlet
- "CometdDemo"</para>
- </listitem>
-
- <listitem>
- <para>in the widget click on init</para>
- </listitem>
-
- <listitem>
- <para>in the CometdDemo portlet, type a message and click on "send", a
- pop up with your message will appear on the top right and disappear
- after 3 sec</para>
- </listitem>
- </itemizedlist>
-
- <para><command>What happened?</command></para>
-
- <itemizedlist>
- <listitem>
- <para>the portlet (JSR 286) sent an action with the message.</para>
- </listitem>
-
- <listitem>
- <para>the action called the continuation service and sent the message
- to the user that had sent it</para>
- </listitem>
-
- <listitem>
- <para>the service sent the message to the browser</para>
- </listitem>
-
- <listitem>
- <para>the cometd client side received the message, and sent it to
- topics</para>
- </listitem>
-
- <listitem>
- <para>in topic, the notification window listened to the topic
- "/eXo/portal/notification" so the notification window appeared.</para>
- </listitem>
- </itemizedlist>
- </section>
-
- <section>
- <title>improvements</title>
-
- <itemizedlist>
- <listitem>
- <para>replace the token system by oAuth would probably be good. not
- sure of how it is possible.</para>
- </listitem>
-
- <listitem>
- <para>There is no method yet to broadcast a message on a channel to
- all the subscribers</para>
- </listitem>
- </itemizedlist>
- </section>
-</chapter>
Deleted: jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/introduction-to-rest.xml
===================================================================
--- jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/introduction-to-rest.xml 2010-08-05 13:44:26 UTC (rev 2886)
+++ jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/introduction-to-rest.xml 2010-08-05 14:37:10 UTC (rev 2887)
@@ -1,212 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
-"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<chapter id = "WS.Introduction">
- <?dbhtml filename="ch-introduction-to-rest.html"?>
-
- <title>Introduction to the Representational State Transfer (REST)</title>
-
- <section>
- <title>Introduction</title>
-
- <para><command>Representational State Transfer (REST)</command> is a style
- of software architecture for distributed hypermedia systems such as the
- World Wide Web. The term was introduced in the doctoral dissertation in
- 2000 by Roy Fielding, one of the principal authors of the Hypertext
- Transfer Protocol (HTTP) specification, and has come into widespread use
- in the networking community.</para>
-
- <para>REST strictly refers to a collection of network architecture
- principles that outline how resources are defined and addressed. The term
- is often used in a looser sense to describe any simple interface that
- transmits domain-specific data over HTTP without an additional messaging
- layer such as SOAP or session tracking via HTTP cookies.</para>
-
- <para>The key abstraction of information in REST is a
- <command>resource</command>. Any information that can be named can be a
- resource: a document or image, a temporal service (e.g. "today's weather
- in Los Angeles"), a collection of other resources, a non-virtual object
- (e.g. a person), and so on. In other words, any concept that might be the
- target of an author's hypertext reference must fit within the definition
- of a resource. A resource is a conceptual mapping to a set of entities,
- not the entity that corresponds to the mapping at any particular point in
- time.</para>
-
- <para>REST uses a <command>resource identifier </command>to identify the
- particular resource involved in an interaction between components. REST
- connectors provide a generic interface for accessing and manipulating the
- value set of a resource, regardless of how the membership function is
- defined or the type of software that is handling the request. URL or URN
- are the examples of a resource identifier.</para>
-
- <para>REST components perform actions with a resource by using a
- <command>representation</command> to capture the current or intended state
- of that resource and transferring that representation between components.
- A representation is a sequence of bytes, plus <command>representation
- metadata </command>to describe those bytes. Other commonly used but less
- precise names for a representation include: <command>document, file, and
- HTTP message entity, instance, or variant</command>. A representation
- consists of data, metadata describing the data, and, on occasion, metadata
- to describe the metadata (usually for the purpose of verifying message
- integrity). Metadata are in the form of name-value pairs, where the name
- corresponds to a standard that defines the value's structure and
- semantics. The data format of a representation is known as a media
- type.</para>
-
- <table>
- <title>REST Data Elements</title>
-
- <tgroup cols="2">
- <thead>
- <row>
- <entry align="center">Data Element</entry>
-
- <entry align="center">Modern Web Examples</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry>resource</entry>
-
- <entry>the intended conceptual target of a hypertext
- reference</entry>
- </row>
-
- <row>
- <entry>resource identifier</entry>
-
- <entry>URL, URN</entry>
- </row>
-
- <row>
- <entry>representation</entry>
-
- <entry>HTML document, JPEG image</entry>
- </row>
-
- <row>
- <entry>representation metadata</entry>
-
- <entry>media type, last-modified time</entry>
- </row>
-
- <row>
- <entry>resource metadata</entry>
-
- <entry>source link, alternates, vary</entry>
- </row>
-
- <row>
- <entry>control data</entry>
-
- <entry>if-modified-since, cache-control</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
- <para>REST uses various <command>connector</command> types to encapsulate
- the activities of accessing resources and transferring resource
- representations. The connectors present an abstract interface for
- component communication, enhancing simplicity by providing a complete
- separation of concepts and hiding the underlying implementation of
- resources and communication mechanisms.</para>
-
- <table>
- <title>REST Connectors</title>
-
- <tgroup cols="2">
- <thead>
- <row>
- <entry align="center">Connector</entry>
-
- <entry align="center">Modern Web Examples</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry>client</entry>
-
- <entry>libwww, libwww-perl</entry>
- </row>
-
- <row>
- <entry>server</entry>
-
- <entry>libwww, Apache API, NSAPI</entry>
- </row>
-
- <row>
- <entry>cache</entry>
-
- <entry>browser cache, Akamai cache network</entry>
- </row>
-
- <row>
- <entry>resolver</entry>
-
- <entry>bind (DNS lookup library)</entry>
- </row>
-
- <row>
- <entry>tunnel</entry>
-
- <entry><para></para>SOCKS, SSL after HTTP CONNECT</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
- <para>The primary connector types are client and server. The essential
- difference between the two is that a client initiates communication by
- making a request, whereas a server listens for connections and responds to
- requests in order to supply access to its services. A component may
- include both client and server connectors.</para>
-
- <para>An important part of RESTful architecture is a well-defined
- interface to communicate, in particular it is a set of HTTP methods such
- as POST, GET, PUT and DELETE. These methods are often compared with the
- CREATE, READ, UPDATE, DELETE (CRUD) operations associated with database
- technologies. An analogy can also be made:</para>
-
- <itemizedlist>
- <listitem>
- <para>PUT is analogous to CREATE or PASTE OVER,</para>
- </listitem>
-
- <listitem>
- <para>GET to READ or COPY,</para>
- </listitem>
-
- <listitem>
- <para>POST to UPDATE or PASTE AFTER, and</para>
- </listitem>
-
- <listitem>
- <para>DELETE to DELETE or CUT.</para>
- </listitem>
- </itemizedlist>
-
- <para><command>Note</command>: RESTful architecture is not limited to
- those methods, one of good examples of extension is the WebDAV
- protocol.</para>
-
- <para>The <command>CRUD</command> (Create, Read, Update and Delete) verbs
- are designed to operate with atomic data within the context of a database
- transaction. REST is designed around the atomic transfer of a more complex
- state and can be viewed as a mechanism for transferring structured
- information from one application to another.</para>
-
- <para>HTTP separates the notions of a web server and a web browser. This
- allows the implementation of each to vary from the other based on the
- client/server principle. When used RESTfully, HTTP is
- <command>stateless</command>. Each message contains all the information
- necessary to understand the request.</para>
-
- <para>As a result, neither the client nor the server needs to remember any
- communication-state between messages. Any state retained by the server
- must be modeled as a resource..</para>
- </section>
-</chapter>
Deleted: jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/javascript-webdav-library.xml
===================================================================
--- jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/javascript-webdav-library.xml 2010-08-05 13:44:26 UTC (rev 2886)
+++ jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/javascript-webdav-library.xml 2010-08-05 14:37:10 UTC (rev 2887)
@@ -1,355 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
-"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<chapter id="WS.JavaScriptWebDAVLibrary">
- <?dbhtml filename="ch-javascript-webdav-library.html"?>
-
- <title>JavaScript WebDAV Library</title>
-
- <section>
- <title>Introduction to the JavaScript WebDAV library</title>
-
- <para>I am proud to introduce JavaScript WebDAV library webdav.js which
- based on AJAX. This library consists the special class webdav which is
- aimed to make all requests supported by eXo Platform WebDAV-server with
- supported parameters.</para>
-
- <para>Proposed library supports asynchronous (on default) and synchronous
- mode of AJAX request processing. To set one of some of this mode you
- should call webdav.setAsynchronous() or webdav.setSynchronous()
- method.</para>
-
- <para>Also this library can fulfill BASIC HTTP authentication using value
- of preset webdav.username and webdav.password properties.</para>
-
- <para>Scheme of WebDAV data exchange:</para>
-
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/javascript-webdav.png" />
- </imageobject>
- </mediaobject>
- </section>
-
- <section>
- <title>Content of JavaScript WebDAV Library:</title>
-
- <para>There is a list of realized methods:</para>
-
- <itemizedlist>
- <listitem>
- <para>ExtensionMethod(handler, path, options) method - a simple
- constructor of the user-defined WebDAV request.</para>
- </listitem>
- </itemizedlist>
-
- <para>1. WebDAV Modifications to HTTP Operations:</para>
-
- <itemizedlist>
- <listitem>
- <para>GET(handler, path, options) method - retrieves the content of a
- resource.</para>
- </listitem>
-
- <listitem>
- <para>PUT(handler, path, options) method - saves the content of a
- resource to the server.</para>
- </listitem>
-
- <listitem>
- <para>DELETE(handler, path, options) method - removes a resource or
- collection.</para>
- </listitem>
-
- <listitem>
- <para>OPTIONS(handler, path, options) method - returns the HTTP
- methods that the server supports for specified URL.</para>
- </listitem>
-
- <listitem>
- <para>MKCOL(handler, path, options) method - creates a
- collection.</para>
- </listitem>
-
- <listitem>
- <para>COPY(handler, path, options) method - copies a resource from one
- URI to another.</para>
- </listitem>
-
- <listitem>
- <para>MOVE(handler, path, options) method - moves a resource from one
- URI to another.</para>
- </listitem>
-
- <listitem>
- <para>HEAD(handler, path, options) method - asks for the response
- identical to the one that would correspond to a HEAD request, but
- without the response body. This is useful for retrieving
- meta-information written in response headers, without having to
- transport the entire content.</para>
- </listitem>
- </itemizedlist>
-
- <para>2. WebDAV Property Operations:</para>
-
- <itemizedlist>
- <listitem>
- <para>PROPFIND(handler, path, options) method - retrieves properties,
- stored as XML, from a resource. It is also overloaded to allow one to
- retrieve the collection structure (a.k.a. directory hierarchy) of a
- remote system.</para>
- </listitem>
-
- <listitem>
- <para>PROPPATCH(handler, path, options) method - changes and deletes
- multiple properties on a resource in a single atomic act.</para>
- </listitem>
- </itemizedlist>
-
- <para>3. WebDAV Lock Operations:</para>
-
- <itemizedlist>
- <listitem>
- <para>LOCK(handler, path, options) method - puts a lock on a
- resource.</para>
- </listitem>
-
- <listitem>
- <para>UNLOCK(handler, path, options) method - removes a lock from a
- resource.</para>
- </listitem>
- </itemizedlist>
-
- <para>4. WebDAV Versioning Extension Operations:</para>
-
- <itemizedlist>
- <listitem>
- <para>VERSIONCONTROL(handler, path, options) method - is used to
- create a new version-controlled resource for an existing version
- history. This allows the creation of version-controlled resources for
- the same version history in multiple workspaces.</para>
- </listitem>
-
- <listitem>
- <para>CHECKOUT(handler, path, options) method - can be applied to a
- checked-in version-controlled resource to allow modifications to the
- content and dead properties of that version-controlled
- resource.</para>
- </listitem>
-
- <listitem>
- <para>CHECKIN(handler, path, options) method - can be applied to a
- checked-out version-controlled resource to produce a new version whose
- content and dead properties are copied from the checked-out
- resource.</para>
- </listitem>
-
- <listitem>
- <para>UNCHECKOUT(handler, path, options) method - can be applied to a
- checked-out version-controlled resource to cancel the CHECKOUT and
- restore the pre-CHECKOUT state of the version-controlled
- resource.</para>
- </listitem>
-
- <listitem>
- <para>REPORT(handler, path, options) method - an extensible mechanism
- for obtaining information about a resource.</para>
- </listitem>
-
- <listitem>
- <para>ORDERPATCH(handler, path, options) method - is used to change
- the ordering semantics of a collection, to change the order of the
- collection's members in the ordering, or both.</para>
- </listitem>
- </itemizedlist>
-
- <para>5. WebDAV SEARCH Operation:</para>
-
- <itemizedlist>
- <listitem>
- <para>SEARCH(handler, path, options) method - a lightweight search
- method to transport queries and result sets that allows clients to
- make use of server-side search facilities retrieve properties, stored
- as XML, from a resource.</para>
- </listitem>
- </itemizedlist>
-
- <para>If there is no interested WebDAV method in the list above, you can
- use ExtensionMethod(handler, path, options) to construct WebDAV request
- you like with your own:</para>
-
- <itemizedlist>
- <listitem>
- <para>name of method (passing throw parameter options.method)</para>
- </listitem>
-
- <listitem>
- <para>request headers (passing throw parameter options.headers)
- and</para>
- </listitem>
-
- <listitem>
- <para>request body (passing throw parameter options.body).</para>
- </listitem>
- </itemizedlist>
-
- <para>First parameter of each method - hanlder - is an object {onSuccess ,
- onError, onComplete}, which describes three functions to call when the
- request either succeeds or fails, and completes:</para>
-
- <itemizedlist>
- <listitem>
- <para>handler.onSuccess - will call if the request succeeds,</para>
- </listitem>
-
- <listitem>
- <para>handler.onError - will call if the request fails,</para>
- </listitem>
-
- <listitem>
- <para>handler.onComplete - will call if the request completes.</para>
- </listitem>
- </itemizedlist>
-
- <para>Additionally you can add your own headers to the request by using
- the special parameter options.</para>
-
- <para>Each method returns object result which consists next
- properties:</para>
-
- <itemizedlist>
- <listitem>
- <para>result.status - status of XMLHttp response,</para>
- </listitem>
-
- <listitem>
- <para>result.statusstring - an explanation of status,</para>
- </listitem>
-
- <listitem>
- <para>result.headers - object with hash of XMLHttpRequest
- response.getAllResponseHeaders() (e.g. if this the response header is
- "Content-Type: test/plain" then result.headers['Content-Type'] =
- 'test/plain'),</para>
- </listitem>
-
- <listitem>
- <para>result.content = XMLHttprequest response.responseXML if
- response.header['Content-Type'] consists 'xml', or = XMLHttpRequest
- response.responseText otherwise.</para>
- </listitem>
- </itemizedlist>
- </section>
-
- <section>
- <title>Example of using of JavaScript WebDAV library</title>
-
- <para>An example of using WebDAV library for the eXo Platform
- WebDAV-server:</para>
-
- <programlisting><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <title>Demonstration of the eXo Platform Client Library of WebDAV</title>
- <script type="text/javascript" src="js/webdav.js"></script>
- <script>
-
-// Example of using of eXo Platform Client Library of WebDAV
-/**
- * Serialize an XML Document or Element and return it as a string.
- */
-function XMLtoString(node) {
- if (typeof node != 'object') return node;
- if (typeof XMLSerializer != "undefined")
- return (new XMLSerializer( )).serializeToString(node);
- else if (node.xml) return node.xml;
- else throw "XML.serialize is not supported or can't serialize " + node;
-};
-
-// get and setup webdav object
- var webdav = new Webdav('localhost', '8080');
-
- webdav.username = 'root';
- webdav.password = 'exo';
-
-// define webdav methods handlers
- function handler_onSuccess(result) {
- alert('Request SUCCEEDED with status = ' + result.status + ': ' + result.statusstring);
- };
-
- function handler_onError(result) {
- alert('Request FAILED with status = ' + result.status + ': ' + result.statusstring);
- };
-
-var handler = {
- onSuccess: handler_onSuccess,
- onError: handler_onError,
- onComplete: MKCOL_handler_onComplete
-}
-
-// for eXoPlatform webdav
-var default_webdav_path = '/rest/jcr/repository/collaboration';
-
-// create a collection 'test'
-webdav.MKCOL(handler, default_webdav_path + '/test1');
-
-// create a resource 'example.txt' with content 'an example'
- function MKCOL_handler_onComplete(result) {
- // create a resource 'example.txt' with content 'an example'
- var options = {
-content: 'an example',
-content_type: 'text/plain; charset=UTF-8'
- }
- handler.onComplete = PUT_handler_onComplete;
- webdav.PUT(handler, default_webdav_path + '/test1/example.txt', options);
- };
-
-// put resource example.txt under version control
- function PUT_handler_onComplete(result) {
- // put resource example.txt under version control
- handler.onComplete = VERSIONCONROL_handler_onComplete;
- webdav.VERSIONCONTROL(handler, default_webdav_path + '/test1/example.txt');
- };
-
-// obtain the 'version-tree' WebDAV report about 'example.txt'
- function VERSIONCONROL_handler_onComplete(result) {
- // obtain the 'version-tree' WebDAV report about 'example.txt'
- var options = {
- depth: '0',
- type: 'version-tree'
- };
- handler.onComplete = REPORT_handler_onComplete;
- webdav.REPORT(handler, default_webdav_path + '/test1/example.txt', options);
- };
-
- // delete the collection 'test'
- function REPORT_handler_onComplete(result) {
- if ( result.content )
-alert( 'Response of server: ' + XMLtoString(result.content) );
-
- // delete the collection 'test'
- handler.onComplete = 'function() {}';
- webdav.DELETE(handler, default_webdav_path + '/test1/');
- };
- </script>
-</head>
-<body>
- <h2>Demonstration of the eXo Platform Client Library of WebDAV</h2>
-</body>
-</html></programlisting>
- </section>
-
- <section>
- <title>How to get JavaScript WebDAV library</title>
-
- <para>You can get this library at the <ulink
- url="http://svn.exoplatform.org/svnroot/exoplatform/projects/ws/branches/2.0.x...">http://svn.exoplatform.org/svnroot/exoplatform/projects/ws/branches/2.0.x...</ulink></para>
-
- <para>Demonstration page was placed as <ulink
- url="http://svn.exoplatform.org/svnroot/exoplatform/projects/ws/branches/2.0.x...">http://svn.exoplatform.org/svnroot/exoplatform/projects/ws/branches/2.0.x...</ulink></para>
-
- <para>JSDoc is available at the <ulink
- url="http://svn.exoplatform.org/svnroot/exoplatform/projects/ws/branches/2.0.x...">http://svn.exoplatform.org/svnroot/exoplatform/projects/ws/branches/2.0.x...</ulink></para>
- </section>
-</chapter>
Deleted: jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/kerberos-sso-on-active-directory.xml
===================================================================
--- jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/kerberos-sso-on-active-directory.xml 2010-08-05 13:44:26 UTC (rev 2886)
+++ jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/kerberos-sso-on-active-directory.xml 2010-08-05 14:37:10 UTC (rev 2887)
@@ -1,304 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
-"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<chapter id="WS.KerberosSSOOnActiveDirectory">
- <?dbhtml filename="ch-kerberos-sso-on-active-directory.html"?>
-
- <title>Kerberos SSO on Active Directory</title>
-
- <section>
- <title>Overview</title>
-
- <para>ExoPortal allows to use SSO (Single Sign On) with Kerberos
- authentication on a Microsoft Active Directory. To install this
- functionality, some configuration is needed, on the Active Directory
- server and on the application server.</para>
-
- <para>In this example, we suppose that the complete name of the machine on
- which Tomcat server runs is ubu.exoua-int, and that it runs on the Linux
- host (Ubuntu 7.04). This machine must be in Windows domain. How to do it
- read in Samba documentation.</para>
-
- <para>Our implementation makes it possible to use SPNEGO or NTLM
- (sometimes this two terms can be mixed, but here we will try to separate
- it). The client will get two authentication headers 'Negotiate' and 'NTLM'
- and will use supported by client (browser). In Firefox it is possible to
- manage authentication types, in IE this is not possible. This HOWTO will
- describe how to make configuration to support both authentication types.
- In fact for IE SPNEGO will work.</para>
- </section>
-
- <section>
- <title>Active Directory configuration</title>
-
- <para>On the AD server, we need to create a Kerberos identification for
- Tomcat Server :</para>
-
- <para>1. Create a user account for the host computer on which Tomcat
- Server runs in the Active Directory server. (Select New > User, not New
- > Machine.)</para>
-
- <para>When creating the two user accounts, use the simple name of the
- computer, and I recommend give names as next pattern host_host-name and
- http_host-name. First account will be used for LDAP connection, second one
- will be used for authentication service via HTTP. For example, if the host
- name is ubu.exoua-int, create a users in Active Directory called host_ubu
- and http_ubu.</para>
-
- <para>Note the password you defined when creating the user account. You
- will need it in step 3. Do not select the "User must change password at
- next login" option, or any other password options.</para>
-
- <para>2. Configure the new user account to comply with the Kerberos
- protocol.</para>
-
- <itemizedlist>
- <listitem>
- <para>Right-click the name of the user account in the Users tree in
- the left pane and select Properties.</para>
- </listitem>
- </itemizedlist>
-
- <itemizedlist>
- <listitem>
- <para>NOTE Make sure the box "Use DES encryption types for this
- account" is unchecked. Also make sure no other boxes are checked,
- particularly the box "Do not require Kerberos
- pre-authentication."</para>
- </listitem>
-
- <listitem>
- <para>Setting the encryption type may corrupt the password. Therefore,
- you should reset the user password by right-clicking the name of the
- user account, selecting Reset Password, and re-entering the same
- password specified earlier.</para>
- </listitem>
- </itemizedlist>
-
- <para>3. Generate keys for service.</para>
-
- <programlisting>C:\> ktpass -princ host/ubu.exoua-int@EXOUA-INT -mapuser host_ubu@EXOUA-INT -crypto RC4-HMAC-NT \
--ptype KRB5_NT_PRINCIPAL -mapop set -pass 123456 -out c:\host_ubu.keytab
-
-
-C:\> ktpass -princ HTTP/ubu.exoua-int@EXOUA-INT -mapuser http_ubu@EXOUA-INT -crypto RC4-HMAC-NT \
--ptype KRB5_NT_PRINCIPAL -mapop set -pass 123456 -out c:\http_ubu.keytab</programlisting>
-
- <para>4. Use the setspn utility to create the Service Principal Names
- (SPNs) for the user account created in step 1. Enter the following
- commands:</para>
-
- <programlisting>C:\> setspn -A host/ubu.exoua-int host_ubu
-C:\> setspn -A HTTP/ubu.exoua-int http_ubu</programlisting>
-
- <para>5. Check which SPNs are associated with your user account, using the
- following command:</para>
-
- <programlisting>C:\> setspn -L host_ubu</programlisting>
-
- <para>NOTE This is an important step. If the same service is linked to a
- different account in the Active Directory server, the client will not send
- a Kerberos ticket to the server. If filter will be used secure-constraint
- must be removed from web.xml</para>
-
- <para>6. Configuration on Linux host. This is example of file
- /etc/krb5.conf</para>
-
- <programlisting>[logging]
- default = FILE:/var/log/krb5libs.log
- kdc = FILE:/var/log/krb5kdc.log
- admin_server = FILE:/var/log/kadmind.log
-
-[libdefaults]
- ticket_lifetime = 24000
- default_realm = EXOUA-INT
- default_tkt_enctypes = rc4-hmac
- default_tgs_enctypes = rc4-hmac
-
-[realms]
- EXOUA-INT = {
- kdc = test01-srv.exoua-int:88
- admin_server = test01-srv.exoua-int:749
- default_domain = EXOUA-INT
- }
-
-[domain_real]
- .exoua-int = EXOUA-INT
- exoua-int = EXOUA-INT
-
-[kdc]
- profile = /etc/kdc.conf
-
-[pam]
- debug = false
- ticket_lifetime = 36000
- renew_lifetime = 36000
- forwardable = true
- krb4_convert = false</programlisting>
-
- <para>7. Copy key generated on step 3 to the Linux machine where tomcat
- server runs.</para>
-
- <para>8. Run the ktutil utility on the Linux machine and import
- keys.</para>
-
- <programlisting>andrew@ubu:~$ ktutil
-ktutil: rkt host_ubu.keytab
-ktutil: wkt host.keytab
-ktutil: rkt http_ubu.keytab
-ktutil: wkt http.keytab</programlisting>
-
- <para>You must get to new files with tickets.</para>
- </section>
-
- <section>
- <title>Setup webserver</title>
-
- <para>1. Deploy an exo-tomcat, and copy the jar for SSO in lib folder and
- change configuration.xml file to your network settings :</para>
-
- <programlisting><configuration>
- <component>
- <key>org.exoplatform.services.security.sso.config.SSOConfigurator</key>
- <type>org.exoplatform.services.security.sso.config.SSOConfigurator</type>
- <init-params>
- <properties-param>
- <name>sso-properties</name>
- <property name="charset" value="UnicodeLittleUnmarked" />
- <property name="domain" value="EXOUA-INT" />
- <property name="jaas-context" value="krb5.ldap-action" />
- <property name="ldap-server" value="ldap://test01-srv.exoua-int:389/" />
- <!--
- **********************************************************
- Default cross domain authentication is disabled.
- NOTE: This is actual for NTLM only.
- For SPNEGO cross domain authentication is disabled by default.
- There is some more work to enable it for SPNEGO.
- **********************************************************
- -->
- <!--
- <property name="cross-domain" value="true" />
- -->
- <!--
- <property name="redirect-on-error" value="http://google.com" />
- -->
- </properties-param>
- </init-params>
- </component></programlisting>
-
- <para>2. In exo-tomcat/conf/Catalina/localhost/, change a file portal.xml
- :</para>
-
- <programlisting><Context path='/portal' docBase='portal' debug='0' reloadable='true' crossContext='true'>
- <Logger className='org.apache.catalina.logger.SystemOutLogger'
- prefix='localhost_portal_log.' suffix='.txt' timestamp='true'/>
- <Manager className='org.apache.catalina.session.PersistentManager' saveOnRestart='false'/>
- <!--
- <Realm className='org.apache.catalina.realm.JAASRealm'
- appName='exo-domain'
- userClassNames='org.exoplatform.services.security.jaas.UserPrincipal'
- roleClassNames='org.exoplatform.services.security.jaas.RolePrincipal'
- debug='0' cache='false'/>
- <Valve className='org.apache.catalina.authenticator.FormAuthenticator' characterEncoding='UTF-8'/>
- -->
- <Valve className="org.exoplatform.services.security.sso.tomcat.SSOAuthenticatorValve"/>
-</Context></programlisting>
-
- <para>Secure configuration in web.xml must be changed to next:</para>
-
- <programlisting><security-role>
- <description>a simple user role</description>
- <role-name>users</role-name>
- </security-role>
-
- <security-constraint>
- <web-resource-collection>
- <web-resource-name>portal</web-resource-name>
- <url-pattern>/*</url-pattern>
- </web-resource-collection>
- <auth-constraint>
- <role-name>users</role-name>
- </auth-constraint>
-
- <user-data-constraint>
- <transport-guarantee>NONE</transport-guarantee>
- </user-data-constraint>
- </security-constraint></programlisting>
-
- <para>NOTE At list one roles in web.xml must be corresponding to user
- group in AD.</para>
-
- <para>3. Download in lib folder jcif-1.2.17.jar . We need this for support
- NTLM authentication.</para>
-
- <para>4. In exo-tomcat/conf/jaas.conf, add :</para>
-
- <programlisting>com.sun.security.jgss.accept {
- com.sun.security.auth.module.Krb5LoginModule required
- keyTab = "/home/andrew/http.keytab"
- useKeyTab = true
- storeKey = true
- principal = "HTTP/ubu.exoua-int@EXOUA-INT"
- doNotPrompt = true
- realm = "EXOUA-INT"
- refreshKrb5Config = true
- debug = false
- ;
-};
-
-krb5.ldap-action {
- com.sun.security.auth.module.Krb5LoginModule required
- keyTab = "/home/andrew/host.keytab"
- useKeyTab = true
- storeKey = true
- principal = "host/ubu.exoua-int@EXOUA-INT"
- doNotPrompt = true
- realm = "EXOUA-INT"
- refreshKrb5Config = true
- debug = false
- ;
-};</programlisting>
-
- <para>5. Add next system properties in file bin/eXo.sh</para>
-
- <programlisting>KERBEROS="-Djavax.security.auth.useSubjectCredsOnly=false \
--Djava.security.krb5.kdc=test01-srv.exoua-int \
--Djava.security.krb5.realm=EXOUA-INT"
-
-JAVA_OPTS="$YOURKIT_PROFILE_OPTION $JAVA_OPTS $LOG_OPTS $SECURITY_OPTS $EXO_OPTS $EXO_CONFIG_OPTS $KERBEROS"</programlisting>
-
- <para>6. For portal add one more filter for initialize Identity for user
- org.exoplatform.services.security.sso.http.JndiIdentityInitalizerFilter
- this filter must be mapped before
- org.exoplatform.services.security.web.SetCurrentIdentityFilter on private
- area.</para>
-
- <para>7. For Firefox, there is an additionnal configuration to do to use
- AD authentication : in adress bar, go to about:config. Filter on ntlm and
- choose "network.automatic-ntlm-auth.trusted-uris". Set string to the name
- of the machine where webserver run (in this exemple : set "ubu"). For IE,
- there is no additional configuration.</para>
-
- <para>8. Go to <uri>http://ubu.exoua-int:8080/portal/private/classic</uri>
- If use was login windows (domain authentication) then, Active directory
- authentication will be used.</para>
-
- <para>Instead tomcat valve
- org.exoplatform.services.security.sso.tomcat.SSOAuthenticatorValve can be
- used filter
- org.exoplatform.services.security.sso.http.SSOAuthenticationFilter</para>
-
- <para>9. Important about using NTLM. JCIF may use MAC for signature
- connection to DC. In this case when one user logined, then next user may
- be not able login during time specified in property
- jcifs.smb.client.soTimeout (in ms), default 15000. This time JCIF keeps
- previous connection opened and may not create new one to authenticate
- other user. Must be set next properties to fix this
- jcifs.smb.client.domain, jcifs.smb.client.username,
- jcifs.smb.client.password. For example</para>
-
- <programlisting>-Djcifs.smb.client.domain=EXOUA-INT -Djcifs.smb.client.username=Admin -Djcifs.smb.client.password=secret"</programlisting>
-
- <para>In this case SMB connection will be signed for user.</para>
- </section>
-</chapter>
Deleted: jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/oauth.xml
===================================================================
--- jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/oauth.xml 2010-08-05 13:44:26 UTC (rev 2886)
+++ jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/oauth.xml 2010-08-05 14:37:10 UTC (rev 2887)
@@ -1,285 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
-"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<chapter id="WS.oAuth">
- <?dbhtml filename="ch-oauth.html"?>
-
- <title>oAuth</title>
-
- <section>
- <title>Overview</title>
-
- <para>OAuth allows to grant access to private resources on one site (which
- is called the Service Provider), to another site (called Consumer). OAuth
- is giving access to a resource without sharing your identity at all. More
- about oAuth at the site <ulink
- url="http://oauth.net/">http://oauth.net/</ulink>. (OAuth protocol: <ulink
- url="http://oauth.net/core/1.0/">http://oauth.net/core/1.0/</ulink>).</para>
-
- <para>This article describes how to configure our implementation of oAuth
- service and client part. Both parts, service (Provider) and client
- (Consumer) are based on oAuth core, this code can be found here <ulink
- url="http://oauth.googlecode.com/svn/code/java/core/">http://oauth.googlecode.com/svn/code/java/core/</ulink>.</para>
-
- <para>Our implementation can be found here <ulink
- url="http://svn.exoplatform.org/svnroot/exoplatform/projects/ws/trunk/security...">http://svn.exoplatform.org/svnroot/exoplatform/projects/ws/trunk/security...</ulink>.</para>
- </section>
-
- <section>
- <title>Provider</title>
-
- <para>The provider consists of two parts oauthprovider.war and
- exo.ws.security.oauth.provider.service-trunk.jar. The main part of the
- provider is OAuthProviderService, currently there is one implementation of
- this interface
- org.exoplatform.ws.security.oauth.impl.OAuthProviderServiceMD5Impl; this
- component has few required configuration parameters.</para>
-
- <section>
- <title>Configuration</title>
-
- <para>The configuration is defined in the file configuration.xml.</para>
-
- <programlisting><component>
- <type>org.exoplatform.ws.security.oauth.impl.OAuthProviderServiceMD5Impl</type>
- <init-params>
- <properties-param>
- <name>exo1</name>
- <property name="secret" value="81d1b5d080d1" />
- <property name="description" value="description" />
- <property name="callbackURL" value="http://localhost:8080/ws-examples/callback" />
- </properties-param>
- </init-params>
-</component></programlisting>
-
- <para>Properties:</para>
-
- <para>1. <command>name</command>: the name of provider, the client will
- send the name of provider that it wants to use.</para>
-
- <para>2. <command>secret</command>: this property is used for subscribe
- requests, this property must be known to the provider and the
- consumer.</para>
-
- <para>3. <command>description</command>: any description of the
- provider. Optional.</para>
-
- <para>4. <command>callbackURL</command>: this is URL where the client
- will be redirected after successful authentication by the
- provider.</para>
-
- <para>That is all what is needed for the configuration of the provider
- service. The next part of configuration is about web, such as
- servlets.</para>
- </section>
-
- <section>
- <title>Servlets</title>
-
- <para>The web part of the provider consists of 3 servlets:</para>
-
- <itemizedlist>
- <listitem>
- <para>OAuthRequestTokenServlet,</para>
- </listitem>
-
- <listitem>
- <para>OAuthAccessTokenServlet, and</para>
- </listitem>
-
- <listitem>
- <para>OAuthAuthorizationServlet</para>
- </listitem>
- </itemizedlist>
-
- <programlisting><?xml version="1.0" encoding="UTF-8"?>
-<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>oAuth provider</display-name>
- <context-param>
- <description>Login page name</description>
- <param-name>login-page</param-name>
- <param-value>login/jsp/login.jsp</param-value>
- </context-param>
- <servlet>
- <servlet-name>OAuthAuthenticationServlet</servlet-name>
- <servlet-class>org.exoplatform.ws.security.oauth.http.OAuthAuthenticationServlet</servlet-class>
- </servlet>
- <servlet>
- <servlet-name>OAuthRequestTokenServlet</servlet-name>
- <servlet-class>org.exoplatform.ws.security.oauth.http.OAuthRequestTokenServlet</servlet-class>
- </servlet>
- <servlet>
- <servlet-name>OAuthAccessTokenServlet</servlet-name>
- <servlet-class>org.exoplatform.ws.security.oauth.http.OAuthAccessTokenServlet</servlet-class>
- </servlet>
- <servlet-mapping>
- <servlet-name>OAuthAuthenticationServlet</servlet-name>
- <url-pattern>/authorize/*</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>OAuthRequestTokenServlet</servlet-name>
- <url-pattern>/request_token/*</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>OAuthAccessTokenServlet</servlet-name>
- <url-pattern>/access_token/*</url-pattern>
- </servlet-mapping>
-</web-app></programlisting>
- </section>
- </section>
-
- <section>
- <title>Consumer</title>
-
- <para>The consumer consists of OAuthConsumerService and web part (servlets
- and filters).</para>
-
- <section>
- <title>How it works</title>
-
- <para>OAuthConsumerFilter checks cookies in client's request. The cookie
- must have the name _consumer_name_.oauth_token and
- _consumer_name_.oauth_token_secret. Then this filter try to find the
- request/access token this at OAuthConsumerService. If the token from the
- request is an access token then the client is already authenticated and
- gets access to requested resource.</para>
-
- <para>Otherwise the client will be redirected to the provider for
- authentication (see below, property "provider.authorizationURL"). This
- is the part of configuration.xml for the consumer:</para>
-
- <programlisting><component>
- <type>org.exoplatform.ws.security.oauth.impl.OAuthConsumerServiceImpl</type>
- <init-params>
- <value-param>
- <!-- this parameter MUST be set in minutes -->
- <name>tokenAliveTime</name>
- <value>300</value>
- </value-param>
- <properties-param>
- <name>exo1</name>
- <property name="secret" value="81d1b5d080d1" />
- <property name="description" value="description" />
- <property name="provider.tokenRequestURL" value="http://localhost:8080/oauthprovider/request_token" />
- <property name="provider.authorizationURL" value="http://localhost:8080/oauthprovider/authorize" />
- <property name="provider.accessTokenURL" value="http://localhost:8080/oauthprovider/access_token" />
- </properties-param>
- </init-params>
-</component>
-<component>
- <type>org.exoplatform.ws.security.oauth.impl.OAuthClientHttpImpl</type>
-</component>
-<component>
- <type>org.exoplatform.ws.security.oauth.impl.OAuthTokenCleanerImpl</type>
- <init-params>
- <value-param>
- <!-- this parameter MUST be set in minutes -->
- <name>tokenCleanerTimeout</name>
- <value>3</value>
- </value-param>
- </init-params>
-</component></programlisting>
-
- <para>The client is redirected for authentication to the provider with
- the required parameters (request and secret token), before this token
- OAuthClient got from the provider (see configuration, property
- "provider.tokenRequestURL"). On the provider side, the user (if the
- authentication is successful and has valid request parameters) will be
- redirected to the consumer again (see property "callbackURL" in the
- provider configuration). Then the consumer (this is, the same as
- receiving request token, invisible for the client) receives the access
- token, and redirects the client to the original URL. Then the filter
- checks the token from the request and gives access to the requested
- resource.</para>
- </section>
-
- <section>
- <title>web.xml</title>
-
- <para>This is the file web.xml for consumer application, in this example
- the resource http://localhost:8080/ws-examples/oauth/protected/ is under
- oAuth protect :</para>
-
- <programlisting><filter>
-<filter-name>OAuthConsumerFilter</filter-name>
- <filter-class>org.exoplatform.ws.security.oauth.http.OAuthConsumerFilter</filter-class>
- <init-param>
- <param-name>consumer</param-name>
- <param-value>exo1</param-value>
-</init-param> </filter> <filter>
-<filter-name>OAuthRequestWrapperFilter</filter-name>
-<filter-class>org.exoplatform.ws.security.oauth.http.OAuthRequestWrapperFilter</filter-class> </filter>
- <filter-mapping>
-<filter-name>OAuthConsumerFilter</filter-name>
-<url-pattern>/oauth/protected/*</url-pattern>
-</filter-mapping>
-<filter-mapping>
-<filter-name>OAuthRequestWrapperFilter</filter-name>
-<url-pattern>/oauth/protected/*</url-pattern>
-</filter-mapping></programlisting>
-
- <para>Any resource can be protected by this mechanism under the
- condition that web.xml is configured to use OAuthConsumerFilter. Client
- must save the given access and the secret token in a cookie.</para>
- </section>
-
- <section>
- <title>Stages</title>
-
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/oauth-scheme.png" />
- </imageobject>
- </mediaobject>
-
- <para>1. continuous line - client's redirections</para>
-
- <para>2. fine dashed line - internal oAuth schema requests and
- responses.</para>
-
- <para>Stages:</para>
-
- <para>1. green - stage 1 (receiving request token)</para>
-
- <para>2. yellow - stage 2 (authentication)</para>
-
- <para>3. blue - stage 3 (receiving access token)</para>
-
- <para>4. red - stage 4 (get protected resource)</para>
- </section>
-
- <section>
- <title>Token Alive Time</title>
-
- <para>Alive time for tokens can be set using the parameter
- tokenAliveTime.</para>
-
- <programlisting><value-param>
- <!-- this parameter MUST be set in minutes -->
- <name>tokenAliveTime</name>
- <value>300</value>
-</value-param></programlisting>
- </section>
-
- <section>
- <title>Token Cleaner Timeout</title>
-
- <para>There is special component cleaner on consumer side, it starts, by
- default, every 5 minutes and checks all tokens. If it finds token with
- expired time it removes it from the storage. Token cleaner timeout (how
- often it must run) can be also set in the configuration:</para>
-
- <programlisting><component>
- <type>org.exoplatform.ws.security.oauth.impl.OAuthTokenCleanerImpl</type>
- <init-params>
- <value-param>
- <!-- this parameter MUST be set in minutes -->
- <name>tokenCleanerTimeout</name>
- <value&#623;</value>
- </value-param>
- </init-params>
- </component></programlisting>
- </section>
- </section>
-</chapter>
Deleted: jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/rest-migration-to-jsr311.xml
===================================================================
--- jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/rest-migration-to-jsr311.xml 2010-08-05 13:44:26 UTC (rev 2886)
+++ jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/rest-migration-to-jsr311.xml 2010-08-05 14:37:10 UTC (rev 2887)
@@ -1,327 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
-"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<chapter id = "WS.RESTMigrationJSR311">
- <?dbhtml filename="ch-rest-migration-to-jsr311.html"?>
-
- <title>REST Migration to jsr311</title>
-
- <important>
- <para>The new implementation of the REST engine respects the jsr311
- specification.</para>
- </important>
-
- <section>
- <title>REST service structure:</title>
-
- <itemizedlist>
- <listitem>
- <para>REST service must be represented by Java class that has @Path
- annotation, it calls <command>root resource</command>. In some cases
- class may have not @Path, about this classes see in Sub-Resource
- Locators section. Root resource class may contain <command>Resource
- Methods</command>, <command>Sub-Resource Methods</command> and
- <command>Sub-Resource Locators</command>. Root resource MUST contain
- at least one of it. </para>
-
- <para>1. <command>Resource Method</command> it is method that contains
- HTTP method annotation, e.g. @GET, @POST, etc. and it does not contain
- @Path annotation. </para>
-
- <para>2. <command>Sub-Resource Method</command> it is method that
- contains HTTP method annotation and @Path annotation. Sub-Resource
- Locator it is method that does not contain HTTP method annotation but
- contains @Path annotation. </para>
-
- <para>3. <command>Sub-Resource Locator </command>can't process request
- directly but it can produce Object (Resource) and that object can
- process request or has <command>Sub-Resource Locator</command> that
- can produce other Resource.Other important part @Consumes and
- @Produces annotations. These annotations can be used at classes and
- methods. Annotation on method override annotation on class.</para>
- </listitem>
-
- <listitem>
- <para>Annotated method parameters @PathParam, @QueryParam, @FormParam,
- @HeaderParam, @Matrix, @CookieParam, @Context annotation must be
- (Description of this annotation in jsr311 specification or jsr311-api
- javadoc): </para>
-
- <para>1. String </para>
-
- <para>2. Primitive type, except char </para>
-
- <para>3. Has constructor with single string arguments </para>
-
- <para>4. Has static valueOf method with single string argument </para>
-
- <para>5. Be List, Set or SortedSet with items described in first four
- points</para>
- </listitem>
-
- <listitem>
- <para>Not annotated method parameter or <command>Entity
- Parameter</command>. </para>
-
- <para>1. Must be not more then one </para>
-
- <para>2. <command>Sub-Resource Locator</command> MUST NOT have
- <command>Entity Parameter</command>. </para>
-
- <para>3. If <command>Resource Method</command> or
- <command>Sub-Resource Method</command> contains at least one parameter
- with @FormParam annotation then <command>Entity Parameter</command>
- MUST be MultivaluedMap<String, String> only.</para>
- </listitem>
-
- <listitem>
- <para>Method return type. Resource method (<command>Resource
- Method</command> or <command>Sub-Resource Method</command>) may return
- void,javax.ws.rs.core.Response,javax.ws.rs.core.GenericEntity or other
- Java type. If void type returned ot returned object is null then 204
- HTTP status will be set for response otherwise 200 status will be
- used. With javax.ws.rs.core.Response response can be set by service
- developer.</para>
- </listitem>
-
- <listitem>
- <para>Reading/Writing Entity done via
- <command>EntityProvider</command>. Each
- <command>EntityProvider</command> can require precise preset media
- type of entity, for example JsonEntityProvider require 'Content-Type'
- and/or 'Accept' header set as application/json. REST engine supports
- next entity provider:</para>
-
- <table>
- <title></title>
-
- <tgroup cols="3">
- <thead>
- <row>
- <entry align="center">Provider class</entry>
-
- <entry align="center">Media Type</entry>
-
- <entry align="center">Java Type</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry>ByteEntityProvider</entry>
-
- <entry>*/*</entry>
-
- <entry>byte[]</entry>
- </row>
-
- <row>
- <entry>DataSourceEntityProvider</entry>
-
- <entry>*/*</entry>
-
- <entry>javax.activation.DataSource</entry>
- </row>
-
- <row>
- <entry>DOMSourceEntityProvider</entry>
-
- <entry>application/xml,application/xhtml+xml,text/xml</entry>
-
- <entry>javax.xml.transform.dom.DOMSource</entry>
- </row>
-
- <row>
- <entry>FileEntityProvider</entry>
-
- <entry>*/*</entry>
-
- <entry>java.io.File</entry>
- </row>
-
- <row>
- <entry>MultivaluedMapEntityProvider</entry>
-
- <entry>application/x-www-form-urlencoded</entry>
-
- <entry>MultivaluedMap<String, String></entry>
- </row>
-
- <row>
- <entry>MultipartFormDataEntityProvider</entry>
-
- <entry>multipart/*</entry>
-
- <entry>java.util.Iterator<org.apache.commons.fileupload.FileItem></entry>
- </row>
-
- <row>
- <entry>InputStreamEntityProvider</entry>
-
- <entry>*/*</entry>
-
- <entry>java.io.InputStream</entry>
- </row>
-
- <row>
- <entry>ReaderEntityProvider</entry>
-
- <entry>*/*</entry>
-
- <entry>java.io.Reader</entry>
- </row>
-
- <row>
- <entry>SAXSourceEntityProvider</entry>
-
- <entry>application/xml,application/xhtml+xml,text/xml</entry>
-
- <entry>javax.xml.transform.sax.SAXSource</entry>
- </row>
-
- <row>
- <entry>StreamSourceEntityProvider</entry>
-
- <entry>application/xml,application/xhtml+xml,text/xml</entry>
-
- <entry>javax.xml.transform.stream.StreamSource</entry>
- </row>
-
- <row>
- <entry>StringEntityProvider</entry>
-
- <entry>*/*</entry>
-
- <entry>java.lang.String</entry>
- </row>
-
- <row>
- <entry>StreamOutputEntityProvider</entry>
-
- <entry>*/*</entry>
-
- <entry>NOTE for writing data only</entry>
- </row>
-
- <row>
- <entry>JsonEntityProvider</entry>
-
- <entry>application/json</entry>
-
- <entry>Object (simple constructor, get/set methods)</entry>
- </row>
-
- <row>
- <entry>JAXBElementEntityProvider</entry>
-
- <entry>application/xml,application/xhtml+xml,text/xml</entry>
-
- <entry>javax.xml.bind.JAXBElement</entry>
- </row>
-
- <row>
- <entry>JAXBObjectEntityProvider</entry>
-
- <entry>application/xml,application/xhtml+xml,text/xml</entry>
-
- <entry>Object (simple constructor, get/set methods)</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </listitem>
- </itemizedlist>
- </section>
-
- <section>
- <title>Migration Examples</title>
-
- <para>EXAMPLE #1</para>
-
- <para><command>Old code</command></para>
-
- <programlisting>package org.exoplatform.services.rest.example;
-
-import org.exoplatform.services.rest.HTTPMethod;
-import org.exoplatform.services.rest.URITemplate;
-import org.exoplatform.services.rest.URIParam;
-import org.exoplatform.services.rest.container.ResourceContainer;
-import org.exoplatform.services.rest.transformer.StringOutputTransformer;
-import org.exoplatform.services.rest.OutputTransformer;
-import org.exoplatform.services.rest.Response;
-
-@URITemplate("/a/{1}/b")
-public class Resource implements ResourceContainer {
-
- @HTTPMethod("GET")
- @URITemplate("{2}")
- @OutputTransformer(StringOutputTransformer.class)
- public Response m0(@URIParam("1") String param1, @URIParam("2") String param2) {
- Response resp = Response.Builder.ok(param1+param2, "text/plain").build();
- return resp;
- }
-}</programlisting>
-
- <para><command>New code</command></para>
-
- <programlisting>import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam
-
-@Path("/a/{1}/b")
-public class Resource implements ResourceContainer {
- @GET
- @Path("{2}")
- @Produces("text/plain")
- public String m0(@PathParam("1") String param1, @PathParam("2") String param2) {
- return path1+path2;
- }
-}</programlisting>
-
- <para>EXAMPLE #2</para>
-
- <para><command>Old code</command></para>
-
- <programlisting>import org.exoplatform.services.rest.HTTPMethod;
-import org.exoplatform.services.rest.InputTransformer;
-import org.exoplatform.services.rest.Response;
-import org.exoplatform.services.rest.URITemplate;
-import org.exoplatform.services.rest.container.ResourceContainer;
-import org.exoplatform.ws.frameworks.json.transformer.Json2BeanInputTransformer;
-
-public class Resource implements ResourceContainer {
- @HTTPMethod("POST")
- @URITemplate("/")
- @InputTransformer(Json2BeanInputTransformer.class)
- public Response m0(Book book) {
- // do something with bean
- return Response.Builder.noContent().build();
- }
-}</programlisting>
-
- <para><command>New code</command></para>
-
- <programlisting>import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.Consumes;
-
-@Path("/")
-public class Resource implements ResourceContainer {
- @POST
- @Consumes("application/json")
- public void m0(Book book) {
- // do something with bean
- }
-}</programlisting>
- </section>
-
- <section>
- <title>Support for javax.ws.rs.core.Application</title>
-
- <para>Since version exo-ws-2.0.1 add support for class
- javax.ws.rs.core.Application. It gives possibility to setup services and
- provider life-cycle to singleton or per-request mode. For details see
- JAX-RS specification, chapter 2. Subclass of Application should be
- configured as component of exo-container.</para>
- </section>
-</chapter>
Deleted: jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/soap-service-tutorial.xml
===================================================================
--- jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/soap-service-tutorial.xml 2010-08-05 13:44:26 UTC (rev 2886)
+++ jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/soap-service-tutorial.xml 2010-08-05 14:37:10 UTC (rev 2887)
@@ -1,247 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
-"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<chapter id="WS.SOAPTutorial">
- <?dbhtml filename="ch-soap-service-tutorial.html"?>
-
- <title>SOAP Service Tutorial</title>
-
- <section>
- <title>Introduction</title>
-
- <para>In this tutorial you will learn how you can use JSR 181 to expose
- your Exo Container components as web services.</para>
-
- <para>The steps given below have been tested with eXo WS samples 2.0.2
- under Tomcat 6.0.16. It uses the WS tomcat bundle.</para>
-
- <para>You can use maven build within "ws/tags/2.0.2/application" to deploy
- this sample application configuration:</para>
-
- <programlisting>mvn clean install -f product-exo-ws-as-tomcat6.xml antrun:run</programlisting>
- </section>
-
- <section>
- <title>Add JSR 181 support to the deployed application</title>
-
- <para>The JSR181 support does not come by default in portal.</para>
-
- <para>The WS example tomcat bundle, which you can deploy with provided
- command above, has already all necessary libraries and SOAP servlet
- declarations.</para>
-
- <para>For any other bundles you have to done the two steps below.</para>
-
- <section>
- <title>Add dependencies</title>
-
- <para>First you need to add the necessary dependencies inside
- exo-tomcat/lib</para>
-
- <para>The required artifacts are :</para>
-
- <itemizedlist>
- <listitem>
- <para>exo.ws.soap.cxf.jsr181-2.0.2.jar</para>
- </listitem>
-
- <listitem>
- <para>exo.ws.application.soap.cxf.samples-2.0.2.jar</para>
- </listitem>
-
- <listitem>
- <para>cxf-rt-transports-http-2.1.2.jar</para>
- </listitem>
-
- <listitem>
- <para>cxf-api-2.1.2.jar</para>
- </listitem>
-
- <listitem>
- <para>cxf-rt-core-2.1.2.jar</para>
- </listitem>
-
- <listitem>
- <para>cxf-common-utilities-2.1.2.jar</para>
- </listitem>
-
- <listitem>
- <para>wsdl4j-1.6.1.jar</para>
- </listitem>
-
- <listitem>
- <para>geronimo-jaxws_2.1_spec-1.0.jar</para>
- </listitem>
-
- <listitem>
- <para>geronimo-ws-metadata_2.0_spec-1.1.2.jar</para>
- </listitem>
-
- <listitem>
- <para>cxf-rt-frontend-jaxws-2.1.2.jar</para>
- </listitem>
-
- <listitem>
- <para>cxf-rt-frontend-simple-2.1.2.jar</para>
- </listitem>
-
- <listitem>
- <para>cxf-rt-bindings-soap-2.1.2.jar</para>
- </listitem>
-
- <listitem>
- <para>XmlSchema-1.4.2.jar</para>
- </listitem>
-
- <listitem>
- <para>cxf-rt-databinding-jaxb-2.1.2.jar</para>
- </listitem>
-
- <listitem>
- <para>jaxb-impl-2.1.7.jar</para>
- </listitem>
-
- <listitem>
- <para>cxf-tools-common-2.1.2.jar</para>
- </listitem>
-
- <listitem>
- <para>cxf-rt-ws-addr-2.1.2.jar</para>
- </listitem>
-
- <listitem>
- <para>saaj-api-1.3.jar</para>
- </listitem>
- </itemizedlist>
- </section>
-
- <section>
- <title>Configure CXF servlet</title>
-
- <para>Edit YOUR_APPLICATION.war/WEB-INF/web.xml and add the CXF servlet
- :</para>
-
- <programlisting><servlet>
- <servlet-name>SOAPServlet</servlet-name>
- <display-name>SOAP Servlet</display-name>
- <servlet-class>org.exoplatform.services.ws.impl.cxf.transport.http.SOAPServlet</servlet-class>
- </servlet>
-
- <servlet-mapping>
- <servlet-name>SOAPServlet</servlet-name>
- <url-pattern>/soap/services/*</url-pattern>
- </servlet-mapping></programlisting>
-
- <important>
- <para>alternatively, you could bundle cxf in a separate app, but make
- sure ws-examples.war starts before it</para>
- </important>
- </section>
- </section>
-
- <section>
- <title>Write the Web Service class</title>
-
- <para>We have a tiny sample to demonstrate called :
- TicketOrderService.</para>
-
- <para>Following JSR 181, it is now just a matter of annotating a class to
- create a Web Service. The main idea is the your interface has to extends
- extends AbstractSingletonWebService.</para>
-
- <programlisting>@WebService
-public interface TicketOrderService extends AbstractSingletonWebService {
-
- /**
- * @param departing departing place.
- * @param arriving arriving place.
- * @param departureDate departure date.
- * @param passenger passenger.
- * @return ticket order.
- */
- public String getTicket(String departing, String arriving, Date departureDate, String passenger);
-
- /**
- * @param confirmation confirm or not.
- */
- public void confirmation(boolean confirmation);
-
-}</programlisting>
-
- <programlisting>@WebService(serviceName = "TicketOrderService",
- portName = "TicketOrderServicePort",
- targetNamespace = "http://exoplatform.org/soap/cxf")
-public class TicketOrderServiceImpl implements TicketOrderService {
-
- /**
- * Logger.
- */
- private static final Log LOG = ExoLogger.getLogger(TicketOrderServiceImpl.class);
-
- /**
- * Ticket.
- */
- private Ticket ticket;
-
- /**
- * @param departing departing place.
- * @param arriving arriving place.
- * @param departureDate departure date.
- * @param passenger passenger.
- * @return ticket order.
- */
- public String getTicket(String departing, String arriving, Date departureDate, String passenger) {
- ticket = new Ticket(passenger, departing, arriving, departureDate);
- LOG.info(ticket);
- return String.valueOf(ticket.getOrder());
- }
-
- /**
- * @param confirmation confirm or not.
- */
- public void confirmation(boolean confirmation) {
- LOG.info("Confirmation : " + confirmation + " for order '" + ticket.getOrder() + "'.");
- }
-
-}</programlisting>
-
- <para>To test quickly, you can simply grab the jar on eXo repository and
- deploy within your application.</para>
- </section>
-
- <section>
- <title>Configure the component</title>
-
- <programlisting><configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.exoplatform.org/xml/ns/kernel_1_0.xsd http://www.exoplatform.org/xml/ns/kernel_1_0.xsd"
- xmlns="http://www.exoplatform.org/xml/ns/kernel_1_0.xsd">
- <component>
- <type>org.exoplatform.services.ws.soap.jsr181.TicketOrderServiceImpl</type>
- </component>
-</configuration></programlisting>
- </section>
-
- <section>
- <title>Verify it works.</title>
-
- <para>Start server.</para>
-
- <para>Execute script at
- ws/tags/2.0.2/application/java/services/samples/soap/client to test
- service</para>
-
- <programlisting>run.sh</programlisting>
-
- <para>and watch for this in the logs:</para>
-
- <programlisting>Sep 3, 2009 5:21:13 PM org.apache.cxf.endpoint.ServerImpl initDestination
-INFO: Setting the server's publish address to be /TicketOrderService/TicketOrderServicePort
-03.09.2009 17:21:13 *INFO * [http-8080-1] ExoDeployCXFUtils: The webservice '/TicketOrderService/TicketOrderServicePort' has been published SUCCESSFUL! (ExoDeployCXFUtils.java, line 190)
-03.09.2009 17:21:13 *INFO * [http-8080-1] WebServiceLoader: New singleton WebService '/TicketOrderService/TicketOrderServicePort' registered. (WebServiceLoader.java, line 95)
-03.09.2009 17:21:27 *INFO * [http-8080-1] TicketOrderServiceImpl: Ticket {, , , null, 1251991287079} (TicketOrderServiceImpl.java, line 57)
-03.09.2009 17:21:27 *INFO * [http-8080-1] TicketOrderServiceImpl: Confirmation : false for order '1251991287079'. (TicketOrderServiceImpl.java, line 65)</programlisting>
-
- <para>Now, your service is started and you can retrieve the WSDL at :
- <uri>http://localhost:8080/ws-examples/soap/services/TicketOrderService/Ticket...</uri></para>
- </section>
-</chapter>
Modified: jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws.xml
===================================================================
--- jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws.xml 2010-08-05 13:44:26 UTC (rev 2886)
+++ jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws.xml 2010-08-05 14:37:10 UTC (rev 2887)
@@ -12,43 +12,13 @@
<xi:include href="ws/introduction-to-rest.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="ws/rest-service-tutorial.xml"
- xmlns:xi="http://www.w3.org/2001/XInclude" />
-
- <xi:include href="ws/rest-migration-to-jsr311.xml"
- xmlns:xi="http://www.w3.org/2001/XInclude" />
-
<xi:include href="ws/groovy-scripts-as-rest-services.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="ws/rest-framework.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="ws/soap-service-tutorial.xml"
- xmlns:xi="http://www.w3.org/2001/XInclude" />
-
- <xi:include href="ws/central-authentication-service-configuration.xml"
- xmlns:xi="http://www.w3.org/2001/XInclude" />
-
- <xi:include href="ws/kerberos-sso-on-active-directory.xml"
- xmlns:xi="http://www.w3.org/2001/XInclude" />
-
- <xi:include href="ws/oauth.xml"
- xmlns:xi="http://www.w3.org/2001/XInclude" />
-
- <xi:include href="ws/cometd.xml"
- xmlns:xi="http://www.w3.org/2001/XInclude" />
-
- <xi:include href="ws/cometd-cluster.xml"
- xmlns:xi="http://www.w3.org/2001/XInclude" />
-
<xi:include href="ws/framework-for-cross-domain-ajax.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
- <xi:include href="ws/cometd-cluster-bench.xml"
- xmlns:xi="http://www.w3.org/2001/XInclude" />
-
- <xi:include href="ws/javascript-webdav-library.xml"
- xmlns:xi="http://www.w3.org/2001/XInclude" />
-
</part>
15 years, 11 months
exo-jcr SVN: r2886 - in jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/jcr: concepts and 1 other directory.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2010-08-05 09:44:26 -0400 (Thu, 05 Aug 2010)
New Revision: 2886
Modified:
jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/jcr/concepts/jcr-usage.xml
jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/jcr/statistics.xml
Log:
EXOJCR-869: few fixes
Modified: jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/jcr/concepts/jcr-usage.xml
===================================================================
--- jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/jcr/concepts/jcr-usage.xml 2010-08-05 12:40:40 UTC (rev 2885)
+++ jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/jcr/concepts/jcr-usage.xml 2010-08-05 13:44:26 UTC (rev 2886)
@@ -12,50 +12,72 @@
<section>
<title>Obtaining a Repository object</title>
- <para>A javax.jcr.Repository object can be obtained either by ...: *
- Using the eXo Container "native" mechanism. All Repositories are kept
- with a single RepositoryService component. So it can be obtained from
- eXo Container, described as following:</para>
+ <para>A javax.jcr.Repository object can be obtained either by ...:
+ <itemizedlist>
+ <listitem>
+ <para>Using the eXo Container "native" mechanism. All Repositories
+ are kept with a single RepositoryService component. So it can be
+ obtained from eXo Container, described as
+ following:<programlisting> RepositoryService repositoryService = (RepositoryService) container.getComponentInstanceOfType(RepositoryService.class);
+ Repository repository = repositoryService.getRepository("repositoryName"); </programlisting></para>
+ </listitem>
- <programlisting> RepositoryService repositoryService = (RepositoryService) container.getComponentInstanceOfType(RepositoryService.class);
- Repository repository = repositoryService.getRepository("repositoryName"); </programlisting>
-
- <para>* Using the eXo Container "native" mechanism with a thread local
- saved "current" repository (especially if you plan using a single
- repository which covers more than 90% of use cases)</para>
-
- <programlisting> // set current repository at initial time
+ <listitem>
+ <para>Using the eXo Container "native" mechanism with a thread
+ local saved "current" repository (especially if you plan using a
+ single repository which covers more than 90% of use
+ cases)<programlisting> // set current repository at initial time
RepositoryService repositoryService = (RepositoryService) container.getComponentInstanceOfType(RepositoryService.class);
repositoryService.setCurrentRepositoryName("repositoryName");
....
// retrieve and use this repository
- Repository repository = repositoryService.getCurrentRepository();</programlisting>
+ Repository repository = repositoryService.getCurrentRepository();</programlisting></para>
+ </listitem>
- <para>* Using JNDI as specified in JSR-170. This way you have to
- configure the reference (see eXo <link linkend="Kernel.JNDINaming"> JNDI
- Naming configuration </link> )</para>
-
- <programlisting> Context ctx = new InitialContext();
- Repository repository =(Repository) ctx.lookup("repositoryName");</programlisting>
+ <listitem>
+ <para>Using JNDI as specified in JSR-170. This way you have to
+ configure the reference (see eXo <link
+ linkend="Kernel.JNDINaming">JNDI Naming configuration</link>
+ )<programlisting> Context ctx = new InitialContext();
+ Repository repository =(Repository) ctx.lookup("repositoryName");</programlisting></para>
+ </listitem>
+ </itemizedlist></para>
</section>
<section>
<title>JCR Session common considerations</title>
- <para>* Remember javax.jcr.Session is not a thread safe object.
- <emphasis role="bold">Never try to share it between threads</emphasis> *
- Do not use <emphasis role="bold">System session</emphasis> from the
- <emphasis role="bold">user</emphasis> related code because a system
- session has <emphasis role="bold">unlimited rights</emphasis>. Call
- ManageableRepository.getSystemSession() from <emphasis
- role="bold">process</emphasis> related code only. * Call
- Session.logout() explicitly to <emphasis role="bold">release
- resources</emphasis> assigned to the session. * When designing your
- application take care of the Session policy inside your application. Two
- <emphasis role="bold">strategies</emphasis> are possible: <emphasis
- role="bold">Stateless</emphasis> (Session per business request) and
- <emphasis role="bold">Stateful</emphasis> (Session per User) or some
- mix.</para>
+ <para><itemizedlist>
+ <listitem>
+ <para>Remember javax.jcr.Session is not a thread safe object.
+ <emphasis role="bold">Never try to share it between
+ threads</emphasis>.</para>
+ </listitem>
+
+ <listitem>
+ <para>Do not use <emphasis role="bold">System session</emphasis>
+ from the <emphasis role="bold">user</emphasis> related code
+ because a system session has <emphasis role="bold">unlimited
+ rights</emphasis>. Call ManageableRepository.getSystemSession()
+ from <emphasis role="bold">process</emphasis> related code
+ only.</para>
+ </listitem>
+
+ <listitem>
+ <para>Call Session.logout() explicitly to <emphasis
+ role="bold">release resources</emphasis> assigned to the
+ session.</para>
+ </listitem>
+
+ <listitem>
+ <para>When designing your application take care of the Session
+ policy inside your application. Two <emphasis
+ role="bold">strategies</emphasis> are possible: <emphasis
+ role="bold">Stateless</emphasis> (Session per business request)
+ and <emphasis role="bold">Stateful</emphasis> (Session per User)
+ or some mix.</para>
+ </listitem>
+ </itemizedlist></para>
</section>
</section>
@@ -154,7 +176,7 @@
provides two implementations :</para>
<table>
- <title></title>
+ <title>SessionProvider implementations</title>
<tgroup cols="3">
<thead>
@@ -192,14 +214,25 @@
<para>For any implementation, your code should follow the following
sequence :</para>
- <para>* Call SessionProviderService.setSessionProvider(Object key,
- SessionProvider sessionProvider) at the beginning of a business request
- for Stateless application or application's session for Statefull policy.
- * Call SessionProviderService.getSessionProvider(Object key) for
- obtaining a SessionProvider object * Call
- SessionProviderService.removeSessionProvider(Object key) at the end of a
- business request for Stateless application or application's session for
- Statefull policy.</para>
+ <itemizedlist>
+ <listitem>
+ <para>Call SessionProviderService.setSessionProvider(Object key,
+ SessionProvider sessionProvider) at the beginning of a business
+ request for Stateless application or application's session for
+ Statefull policy.</para>
+ </listitem>
+
+ <listitem>
+ <para>Call SessionProviderService.getSessionProvider(Object key) for
+ obtaining a SessionProvider object</para>
+ </listitem>
+
+ <listitem>
+ <para>Call SessionProviderService.removeSessionProvider(Object key)
+ at the end of a business request for Stateless application or
+ application's session for Statefull policy.</para>
+ </listitem>
+ </itemizedlist>
</section>
</section>
</chapter>
Modified: jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/jcr/statistics.xml
===================================================================
--- jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/jcr/statistics.xml 2010-08-05 12:40:40 UTC (rev 2885)
+++ jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/jcr/statistics.xml 2010-08-05 13:44:26 UTC (rev 2886)
@@ -1,465 +1,465 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
-"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<chapter id="JCR.Statistics">
- <?dbhtml filename="ch-statistics"?>
-
- <title>eXo JCR statistics</title>
-
- <section>
- <title>Statistics on the Database Access Layer</title>
-
- <para>In order to have a better idea of the time spent into the database
- access layer, it cans be interesting to get some statistics on that part
- of the code, knowing that most of the time spent into eXo JCR is mainly
- the database access. This statistics will then allow you to identify
- without using any profiler what is anormally slow in this layer, which
- could help to fix the problem quickly.</para>
-
- <para>In case you use
- <envar>org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer</envar>
- or
- <envar>org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer</envar>
- as <envar>WorkspaceDataContainer</envar>, you can get statistics on the
- time spent into the database access layer. The database access layer (in
- eXo JCR) is represented by the methods of the interface
- <envar>org.exoplatform.services.jcr.storage.WorkspaceStorageConnection</envar>,
- so for all the methods defined in this interface, we can have the
- following figures:</para>
-
- <itemizedlist>
- <listitem>
- <para>The minimum time spent into the method.</para>
- </listitem>
-
- <listitem>
- <para>The maximum time spent into the method.</para>
- </listitem>
-
- <listitem>
- <para>The average time spent into the method.</para>
- </listitem>
-
- <listitem>
- <para>The total amount of time spent into the method.</para>
- </listitem>
-
- <listitem>
- <para>The total amount of times the method has been called.</para>
- </listitem>
- </itemizedlist>
-
- <para>Those figures are also available globaly for all the methods which
- gives us the global behavior of this layer.</para>
-
- <para>If you want to enable the statistics, you just need to set the JVM
- parameter called
- <emphasis>JDBCWorkspaceDataContainer.statistics.enabled</emphasis> to
- <emphasis>true</emphasis>. The corresponding CSV file is
- <emphasis>StatisticsJDBCStorageConnection-${creation-timestamp}.csv</emphasis>
- for more details about how the csv files are managed please refer to the
- section dedicated to the statistics manager.</para>
-
- <para>The format of each column header is ${method-alias}-${metric-alias}.
- The metric alias are described in the statistics manager section.</para>
-
- <table>
- <title>Method Alias</title>
-
- <tgroup cols="2">
- <tbody>
- <row>
- <entry>global</entry>
-
- <entry>This is the alias for all the methods.</entry>
- </row>
-
- <row>
- <entry>getItemDataById</entry>
-
- <entry>This is the alias for the method
- <emphasis>getItemData(String identifier).</emphasis></entry>
- </row>
-
- <row>
- <entry>getItemDataByNodeDataNQPathEntry</entry>
-
- <entry>This is the alias for the method
- <emphasis>getItemData(NodeData parentData, QPathEntry
- name).</emphasis></entry>
- </row>
-
- <row>
- <entry>getChildNodesData</entry>
-
- <entry>This is the alias for the method
- <emphasis>getChildNodesData(NodeData parent).</emphasis></entry>
- </row>
-
- <row>
- <entry>getChildNodesCount</entry>
-
- <entry>This is the alias for the method
- <emphasis>getChildNodesCount(NodeData parent).</emphasis></entry>
- </row>
-
- <row>
- <entry>getChildPropertiesData</entry>
-
- <entry>This is the alias for the method
- <emphasis>getChildPropertiesData(NodeData
- parent).</emphasis></entry>
- </row>
-
- <row>
- <entry>listChildPropertiesData</entry>
-
- <entry>This is the alias for the method
- <emphasis>listChildPropertiesData(NodeData
- parent).</emphasis></entry>
- </row>
-
- <row>
- <entry>getReferencesData</entry>
-
- <entry>This is the alias for the method
- <emphasis>getReferencesData(String
- nodeIdentifier).</emphasis></entry>
- </row>
-
- <row>
- <entry>commit</entry>
-
- <entry>This is the alias for the method
- <emphasis>commit().</emphasis></entry>
- </row>
-
- <row>
- <entry>addNodeData</entry>
-
- <entry>This is the alias for the method <emphasis>add(NodeData
- data).</emphasis></entry>
- </row>
-
- <row>
- <entry>addPropertyData</entry>
-
- <entry>This is the alias for the method <emphasis>add(PropertyData
- data).</emphasis></entry>
- </row>
-
- <row>
- <entry>updateNodeData</entry>
-
- <entry>This is the alias for the method <emphasis>update(NodeData
- data).</emphasis></entry>
- </row>
-
- <row>
- <entry>updatePropertyData</entry>
-
- <entry>This is the alias for the method
- <emphasis>update(PropertyData data).</emphasis></entry>
- </row>
-
- <row>
- <entry>deleteNodeData</entry>
-
- <entry>This is the alias for the method <emphasis>delete(NodeData
- data).</emphasis></entry>
- </row>
-
- <row>
- <entry>deletePropertyData</entry>
-
- <entry>This is the alias for the method
- <emphasis>delete(PropertyData data).</emphasis></entry>
- </row>
-
- <row>
- <entry>renameNodeData</entry>
-
- <entry>This is the alias for the method <emphasis>rename(NodeData
- data).</emphasis></entry>
- </row>
-
- <row>
- <entry>rollback</entry>
-
- <entry>This is the alias for the method
- <emphasis>rollback().</emphasis></entry>
- </row>
-
- <row>
- <entry>isOpened</entry>
-
- <entry>This is the alias for the method
- <emphasis>isOpened().</emphasis></entry>
- </row>
-
- <row>
- <entry>close</entry>
-
- <entry>This is the alias for the method
- <emphasis>close().</emphasis></entry>
- </row>
- </tbody>
- </tgroup>
- </table>
- </section>
-
- <section>
- <title>Statistics on the JCR API accesses</title>
-
- <para>In order to know exactly how your application uses eXo JCR, it cans
- be interesting to register all the JCR API accesses in order to easily
- create real life test scenario based on pure JCR calls and also to tune
- your eXo JCR to better fit your requirements.</para>
-
- <para>In order to allow you to specify into the configuration which part
- of eXo JCR needs to be monitored whitout applying any changes in your code
- and/or building anything, we choosed to rely on the Load-time Weaving
- proposed by AspectJ.</para>
-
- <para>To enable this feature, you will have to add in your classpath the
- following jar files:</para>
-
- <itemizedlist>
- <listitem>
- <para><emphasis>exo.jcr.component.statistics-X.Y.Z</emphasis>.jar
- corresponding to your eXo JCR version that you can get from the jboss
- maven repository <ulink
- url="http://repository.jboss.com/maven2/org/exoplatform/jcr/exo.jcr.component....">http://repository.jboss.com/maven2/org/exoplatform/jcr/exo.jcr.component....</ulink>.</para>
- </listitem>
-
- <listitem>
- <para>aspectjrt-1.6.8.jar that you can get from the main maven
- repository <ulink
- url="http://repo2.maven.org/maven2/org/aspectj/aspectjrt"><uri>http://repo2.maven.org/maven2/org/aspectj/aspectjrt</uri></ulink>.</para>
- </listitem>
- </itemizedlist>
-
- <para>You will also need to get aspectjweaver-1.6.8.jar from the main
- maven repository <ulink
- url="http://repo2.maven.org/maven2/org/aspectj/aspectjweaver">http://repo2.maven.org/maven2/org/aspectj/aspectjweaver</ulink>.
- At this stage, to enable the statistics on the JCR API accesses, you will
- need to add the JVM parameter
- <emphasis>-javaagent:${pathto}/aspectjweaver-1.6.8.jar</emphasis> to your
- command line, for more details please refer to <ulink
- url="http://www.eclipse.org/aspectj/doc/released/devguide/ltw-configuration.html">http://www.eclipse.org/aspectj/doc/released/devguide/ltw-configuration.html</ulink>.</para>
-
- <para>By default, the configuration will collect statistcs on all the
- methods of the internal interfaces
- <emphasis>org.exoplatform.services.jcr.core.ExtendedSession</emphasis> and
- <emphasis>org.exoplatform.services.jcr.core.ExtendedNode</emphasis>, and
- the JCR API interface <emphasis>javax.jcr.Property</emphasis>. To add
- and/or remove some interfaces to monitor, you have two configuration files
- to change that are bundled into the jar
- <emphasis>exo.jcr.component.statistics-X.Y.Z</emphasis>.jar, which are
- <emphasis>conf/configuration.xml</emphasis> and
- <emphasis>META-INF/aop.xml</emphasis>.</para>
-
- <para>The file content below is the content of
- <emphasis>conf/configuration.xml</emphasis> that you will need to modify
- to add and/or remove the full qualified name of the interfaces to monitor,
- into the list of parameter values of the init param called
- <emphasis>targetInterfaces</emphasis>.</para>
-
- <programlisting><configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
- xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
-
- <component>
- <type>org.exoplatform.services.jcr.statistics.JCRAPIAspectConfig</type>
- <init-params>
- <values-param>
- <name>targetInterfaces</name>
- <value>org.exoplatform.services.jcr.core.ExtendedSession</value>
- <value>org.exoplatform.services.jcr.core.ExtendedNode</value>
- <value>javax.jcr.Property</value>
- </values-param>
- </init-params>
- </component>
-</configuration></programlisting>
-
- <para>The file content below is the content of
- <emphasis>META-INF/aop.xml</emphasis> that you will to need to modify to
- add and/or remove the full qualified name of the interfaces to monitor,
- into the expression filter of the pointcut called
- <emphasis>JCRAPIPointcut</emphasis>. As you can see below, by default only
- JCR API calls from the exoplatform packages are took into account, don't
- hesistate to modify also this filter to add your own package names.</para>
-
- <programlisting><aspectj>
- <aspects>
- <concrete-aspect name="org.exoplatform.services.jcr.statistics.JCRAPIAspectImpl" extends="org.exoplatform.services.jcr.statistics.JCRAPIAspect">
- <pointcut name="JCRAPIPointcut"
- expression="(target(org.exoplatform.services.jcr.core.ExtendedSession) || target(org.exoplatform.services.jcr.core.ExtendedNode) || target(javax.jcr.Property)) &amp;&amp; call(public * *(..))" />
- </concrete-aspect>
- </aspects>
- <weaver options="-XnoInline">
- <include within="org.exoplatform..*" />
- </weaver>
-</aspectj> </programlisting>
-
- <para>The corresponding CSV files are of type
- <emphasis>Statistics${interface-name}-${creation-timestamp}.csv</emphasis>
- for more details about how the csv files are managed please refer to the
- section dedicated to the statistics manager.</para>
-
- <para>The format of each column header is ${method-alias}-${metric-alias}.
- The method alias will be of type ${method-name}(list of parameter types
- separeted by ; to be compatible with the CSV format).</para>
-
- <para>The metric alias are described in the statistics manager
- section.</para>
-
- <remark>Please note that this feature will affect the performances of eXo
- JCR so it must be used with caution.</remark>
- </section>
-
- <section>
- <title>Statistics Manager</title>
-
- <para>The statistics manager manages all the statistics provided by eXo
- JCR, it is responsible of printing the data into the CSV files but also to
- expose the statistics through JMX and/or Rest.</para>
-
- <para>The statistics manager will create all the CSV files for each
- category of statistics that it manages, the format of those files is
- <emphasis>Statistics${category-name}-${creation-timestamp}.csv</emphasis>.
- Those files will be created into the user directory if it is possible
- otherwise it will create them into the temporary directory. The format of
- those files is <envar>CSV</envar> (i.e. Comma-Seperated Values), one new
- line will be added regularily (every 5 seconds by default) and one last
- line will be added at JVM exit. Each line, will be composed of the 5
- figures described below for each method and globaly for all the
- methods.</para>
-
- <para><table>
- <title>Metric Alias</title>
-
- <tgroup cols="2">
- <tbody>
- <row>
- <entry>Min</entry>
-
- <entry>The minimum time spent into the method.</entry>
- </row>
-
- <row>
- <entry>Max</entry>
-
- <entry>The maximum time spent into the method.</entry>
- </row>
-
- <row>
- <entry>Total</entry>
-
- <entry>The total amount of time spent into the method.</entry>
- </row>
-
- <row>
- <entry>Avg</entry>
-
- <entry>The average time spent into the method.</entry>
- </row>
-
- <row>
- <entry>Times</entry>
-
- <entry>The total amount of times the method has been
- called.</entry>
- </row>
- </tbody>
- </tgroup>
- </table>You can disable the persistence of the statistics by setting the
- JVM parameter called
- <emphasis>JCRStatisticsManager.persistence.enabled</emphasis> to
- <emphasis>false</emphasis>, by default it is set to
- <emphasis>true</emphasis>. You can aslo define the period of time between
- each record (i.e. line of data into the file) by setting the JVM parameter
- called <emphasis>JCRStatisticsManager.persistence.timeout</emphasis> to
- your expected value expressed in milliseconds, by default it is set to
- <emphasis>5000</emphasis>.</para>
-
- <para>You can also access to the statistics thanks to JMX, the available
- methods are the following:</para>
-
- <para><table>
- <title>JMX Methods</title>
-
- <tgroup cols="2">
- <tbody>
- <row>
- <entry>getMin</entry>
-
- <entry>Gives the minimum time spent into the method
- corresponding to the given category name and statistics name.
- The expected arguments are the name of the category of the
- statistics (e.g. JDBCStorageConnection) and the name of the
- expected method or global for the global value.</entry>
- </row>
-
- <row>
- <entry>getMax</entry>
-
- <entry>Gives the maximum time spent into the method
- corresponding to the given category name and statistics name.
- The expected arguments are the name of the category of the
- statistics (e.g. JDBCStorageConnection) and the name of the
- expected method or global for the global value.</entry>
- </row>
-
- <row>
- <entry>getTotal</entry>
-
- <entry>Gives the total amount of time spent into the method
- corresponding to the given category name and statistics name.
- The expected arguments are the name of the category of the
- statistics (e.g. JDBCStorageConnection) and the name of the
- expected method or global for the global value.</entry>
- </row>
-
- <row>
- <entry>getAvg</entry>
-
- <entry>Gives the average time spent into the method
- corresponding to the given category name and statistics name.
- The expected arguments are the name of the category of the
- statistics (e.g. JDBCStorageConnection) and the name of the
- expected method or global for the global value.</entry>
- </row>
-
- <row>
- <entry>getTimes</entry>
-
- <entry>Gives the total amount of times the method has been
- called corresponding to the given category name and statistics
- name. The expected arguments are the name of the category of the
- statistics (e.g. JDBCStorageConnection) and the name of the
- expected method or global for the global value.</entry>
- </row>
-
- <row>
- <entry>reset</entry>
-
- <entry>Reset the statistics for the given category name and
- statistics name. The expected arguments are the name of the
- category of the statistics (e.g. JDBCStorageConnection) and the
- name of the expected method or global for the global
- value.</entry>
- </row>
-
- <row>
- <entry>resetAll</entry>
-
- <entry>Reset all the statistics for the given category name. The
- expected argument is the name of the category of the statistics
- (e.g. JDBCStorageConnection).</entry>
- </row>
- </tbody>
- </tgroup>
- </table>The full name of the related MBean is
- <emphasis>exo:service=statistic, view=jcr</emphasis>.</para>
- </section>
-</chapter>
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<chapter id="JCR.Statistics">
+ <?dbhtml filename="ch-statistics.html"?>
+
+ <title>eXo JCR statistics</title>
+
+ <section>
+ <title>Statistics on the Database Access Layer</title>
+
+ <para>In order to have a better idea of the time spent into the database
+ access layer, it cans be interesting to get some statistics on that part
+ of the code, knowing that most of the time spent into eXo JCR is mainly
+ the database access. This statistics will then allow you to identify
+ without using any profiler what is anormally slow in this layer, which
+ could help to fix the problem quickly.</para>
+
+ <para>In case you use
+ <envar>org.exoplatform.services.jcr.impl.storage.jdbc.optimisation.CQJDBCWorkspaceDataContainer</envar>
+ or
+ <envar>org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer</envar>
+ as <envar>WorkspaceDataContainer</envar>, you can get statistics on the
+ time spent into the database access layer. The database access layer (in
+ eXo JCR) is represented by the methods of the interface
+ <envar>org.exoplatform.services.jcr.storage.WorkspaceStorageConnection</envar>,
+ so for all the methods defined in this interface, we can have the
+ following figures:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>The minimum time spent into the method.</para>
+ </listitem>
+
+ <listitem>
+ <para>The maximum time spent into the method.</para>
+ </listitem>
+
+ <listitem>
+ <para>The average time spent into the method.</para>
+ </listitem>
+
+ <listitem>
+ <para>The total amount of time spent into the method.</para>
+ </listitem>
+
+ <listitem>
+ <para>The total amount of times the method has been called.</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>Those figures are also available globaly for all the methods which
+ gives us the global behavior of this layer.</para>
+
+ <para>If you want to enable the statistics, you just need to set the JVM
+ parameter called
+ <emphasis>JDBCWorkspaceDataContainer.statistics.enabled</emphasis> to
+ <emphasis>true</emphasis>. The corresponding CSV file is
+ <emphasis>StatisticsJDBCStorageConnection-${creation-timestamp}.csv</emphasis>
+ for more details about how the csv files are managed please refer to the
+ section dedicated to the statistics manager.</para>
+
+ <para>The format of each column header is ${method-alias}-${metric-alias}.
+ The metric alias are described in the statistics manager section.</para>
+
+ <table>
+ <title>Method Alias</title>
+
+ <tgroup cols="2">
+ <tbody>
+ <row>
+ <entry>global</entry>
+
+ <entry>This is the alias for all the methods.</entry>
+ </row>
+
+ <row>
+ <entry>getItemDataById</entry>
+
+ <entry>This is the alias for the method
+ <emphasis>getItemData(String identifier).</emphasis></entry>
+ </row>
+
+ <row>
+ <entry>getItemDataByNodeDataNQPathEntry</entry>
+
+ <entry>This is the alias for the method
+ <emphasis>getItemData(NodeData parentData, QPathEntry
+ name).</emphasis></entry>
+ </row>
+
+ <row>
+ <entry>getChildNodesData</entry>
+
+ <entry>This is the alias for the method
+ <emphasis>getChildNodesData(NodeData parent).</emphasis></entry>
+ </row>
+
+ <row>
+ <entry>getChildNodesCount</entry>
+
+ <entry>This is the alias for the method
+ <emphasis>getChildNodesCount(NodeData parent).</emphasis></entry>
+ </row>
+
+ <row>
+ <entry>getChildPropertiesData</entry>
+
+ <entry>This is the alias for the method
+ <emphasis>getChildPropertiesData(NodeData
+ parent).</emphasis></entry>
+ </row>
+
+ <row>
+ <entry>listChildPropertiesData</entry>
+
+ <entry>This is the alias for the method
+ <emphasis>listChildPropertiesData(NodeData
+ parent).</emphasis></entry>
+ </row>
+
+ <row>
+ <entry>getReferencesData</entry>
+
+ <entry>This is the alias for the method
+ <emphasis>getReferencesData(String
+ nodeIdentifier).</emphasis></entry>
+ </row>
+
+ <row>
+ <entry>commit</entry>
+
+ <entry>This is the alias for the method
+ <emphasis>commit().</emphasis></entry>
+ </row>
+
+ <row>
+ <entry>addNodeData</entry>
+
+ <entry>This is the alias for the method <emphasis>add(NodeData
+ data).</emphasis></entry>
+ </row>
+
+ <row>
+ <entry>addPropertyData</entry>
+
+ <entry>This is the alias for the method <emphasis>add(PropertyData
+ data).</emphasis></entry>
+ </row>
+
+ <row>
+ <entry>updateNodeData</entry>
+
+ <entry>This is the alias for the method <emphasis>update(NodeData
+ data).</emphasis></entry>
+ </row>
+
+ <row>
+ <entry>updatePropertyData</entry>
+
+ <entry>This is the alias for the method
+ <emphasis>update(PropertyData data).</emphasis></entry>
+ </row>
+
+ <row>
+ <entry>deleteNodeData</entry>
+
+ <entry>This is the alias for the method <emphasis>delete(NodeData
+ data).</emphasis></entry>
+ </row>
+
+ <row>
+ <entry>deletePropertyData</entry>
+
+ <entry>This is the alias for the method
+ <emphasis>delete(PropertyData data).</emphasis></entry>
+ </row>
+
+ <row>
+ <entry>renameNodeData</entry>
+
+ <entry>This is the alias for the method <emphasis>rename(NodeData
+ data).</emphasis></entry>
+ </row>
+
+ <row>
+ <entry>rollback</entry>
+
+ <entry>This is the alias for the method
+ <emphasis>rollback().</emphasis></entry>
+ </row>
+
+ <row>
+ <entry>isOpened</entry>
+
+ <entry>This is the alias for the method
+ <emphasis>isOpened().</emphasis></entry>
+ </row>
+
+ <row>
+ <entry>close</entry>
+
+ <entry>This is the alias for the method
+ <emphasis>close().</emphasis></entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+
+ <section>
+ <title>Statistics on the JCR API accesses</title>
+
+ <para>In order to know exactly how your application uses eXo JCR, it cans
+ be interesting to register all the JCR API accesses in order to easily
+ create real life test scenario based on pure JCR calls and also to tune
+ your eXo JCR to better fit your requirements.</para>
+
+ <para>In order to allow you to specify into the configuration which part
+ of eXo JCR needs to be monitored whitout applying any changes in your code
+ and/or building anything, we choosed to rely on the Load-time Weaving
+ proposed by AspectJ.</para>
+
+ <para>To enable this feature, you will have to add in your classpath the
+ following jar files:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para><emphasis>exo.jcr.component.statistics-X.Y.Z</emphasis>.jar
+ corresponding to your eXo JCR version that you can get from the jboss
+ maven repository <ulink
+ url="http://repository.jboss.com/maven2/org/exoplatform/jcr/exo.jcr.component....">http://repository.jboss.com/maven2/org/exoplatform/jcr/exo.jcr.component....</ulink>.</para>
+ </listitem>
+
+ <listitem>
+ <para>aspectjrt-1.6.8.jar that you can get from the main maven
+ repository <ulink
+ url="http://repo2.maven.org/maven2/org/aspectj/aspectjrt"><uri>http://repo2.maven.org/maven2/org/aspectj/aspectjrt</uri></ulink>.</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>You will also need to get aspectjweaver-1.6.8.jar from the main
+ maven repository <ulink
+ url="http://repo2.maven.org/maven2/org/aspectj/aspectjweaver">http://repo2.maven.org/maven2/org/aspectj/aspectjweaver</ulink>.
+ At this stage, to enable the statistics on the JCR API accesses, you will
+ need to add the JVM parameter
+ <emphasis>-javaagent:${pathto}/aspectjweaver-1.6.8.jar</emphasis> to your
+ command line, for more details please refer to <ulink
+ url="http://www.eclipse.org/aspectj/doc/released/devguide/ltw-configuration.html">http://www.eclipse.org/aspectj/doc/released/devguide/ltw-configuration.html</ulink>.</para>
+
+ <para>By default, the configuration will collect statistcs on all the
+ methods of the internal interfaces
+ <emphasis>org.exoplatform.services.jcr.core.ExtendedSession</emphasis> and
+ <emphasis>org.exoplatform.services.jcr.core.ExtendedNode</emphasis>, and
+ the JCR API interface <emphasis>javax.jcr.Property</emphasis>. To add
+ and/or remove some interfaces to monitor, you have two configuration files
+ to change that are bundled into the jar
+ <emphasis>exo.jcr.component.statistics-X.Y.Z</emphasis>.jar, which are
+ <emphasis>conf/configuration.xml</emphasis> and
+ <emphasis>META-INF/aop.xml</emphasis>.</para>
+
+ <para>The file content below is the content of
+ <emphasis>conf/configuration.xml</emphasis> that you will need to modify
+ to add and/or remove the full qualified name of the interfaces to monitor,
+ into the list of parameter values of the init param called
+ <emphasis>targetInterfaces</emphasis>.</para>
+
+ <programlisting><configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+
+ <component>
+ <type>org.exoplatform.services.jcr.statistics.JCRAPIAspectConfig</type>
+ <init-params>
+ <values-param>
+ <name>targetInterfaces</name>
+ <value>org.exoplatform.services.jcr.core.ExtendedSession</value>
+ <value>org.exoplatform.services.jcr.core.ExtendedNode</value>
+ <value>javax.jcr.Property</value>
+ </values-param>
+ </init-params>
+ </component>
+</configuration></programlisting>
+
+ <para>The file content below is the content of
+ <emphasis>META-INF/aop.xml</emphasis> that you will to need to modify to
+ add and/or remove the full qualified name of the interfaces to monitor,
+ into the expression filter of the pointcut called
+ <emphasis>JCRAPIPointcut</emphasis>. As you can see below, by default only
+ JCR API calls from the exoplatform packages are took into account, don't
+ hesistate to modify also this filter to add your own package names.</para>
+
+ <programlisting><aspectj>
+ <aspects>
+ <concrete-aspect name="org.exoplatform.services.jcr.statistics.JCRAPIAspectImpl" extends="org.exoplatform.services.jcr.statistics.JCRAPIAspect">
+ <pointcut name="JCRAPIPointcut"
+ expression="(target(org.exoplatform.services.jcr.core.ExtendedSession) || target(org.exoplatform.services.jcr.core.ExtendedNode) || target(javax.jcr.Property)) &amp;&amp; call(public * *(..))" />
+ </concrete-aspect>
+ </aspects>
+ <weaver options="-XnoInline">
+ <include within="org.exoplatform..*" />
+ </weaver>
+</aspectj> </programlisting>
+
+ <para>The corresponding CSV files are of type
+ <emphasis>Statistics${interface-name}-${creation-timestamp}.csv</emphasis>
+ for more details about how the csv files are managed please refer to the
+ section dedicated to the statistics manager.</para>
+
+ <para>The format of each column header is ${method-alias}-${metric-alias}.
+ The method alias will be of type ${method-name}(list of parameter types
+ separeted by ; to be compatible with the CSV format).</para>
+
+ <para>The metric alias are described in the statistics manager
+ section.</para>
+
+ <remark>Please note that this feature will affect the performances of eXo
+ JCR so it must be used with caution.</remark>
+ </section>
+
+ <section>
+ <title>Statistics Manager</title>
+
+ <para>The statistics manager manages all the statistics provided by eXo
+ JCR, it is responsible of printing the data into the CSV files but also to
+ expose the statistics through JMX and/or Rest.</para>
+
+ <para>The statistics manager will create all the CSV files for each
+ category of statistics that it manages, the format of those files is
+ <emphasis>Statistics${category-name}-${creation-timestamp}.csv</emphasis>.
+ Those files will be created into the user directory if it is possible
+ otherwise it will create them into the temporary directory. The format of
+ those files is <envar>CSV</envar> (i.e. Comma-Seperated Values), one new
+ line will be added regularily (every 5 seconds by default) and one last
+ line will be added at JVM exit. Each line, will be composed of the 5
+ figures described below for each method and globaly for all the
+ methods.</para>
+
+ <para><table>
+ <title>Metric Alias</title>
+
+ <tgroup cols="2">
+ <tbody>
+ <row>
+ <entry>Min</entry>
+
+ <entry>The minimum time spent into the method.</entry>
+ </row>
+
+ <row>
+ <entry>Max</entry>
+
+ <entry>The maximum time spent into the method.</entry>
+ </row>
+
+ <row>
+ <entry>Total</entry>
+
+ <entry>The total amount of time spent into the method.</entry>
+ </row>
+
+ <row>
+ <entry>Avg</entry>
+
+ <entry>The average time spent into the method.</entry>
+ </row>
+
+ <row>
+ <entry>Times</entry>
+
+ <entry>The total amount of times the method has been
+ called.</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>You can disable the persistence of the statistics by setting the
+ JVM parameter called
+ <emphasis>JCRStatisticsManager.persistence.enabled</emphasis> to
+ <emphasis>false</emphasis>, by default it is set to
+ <emphasis>true</emphasis>. You can aslo define the period of time between
+ each record (i.e. line of data into the file) by setting the JVM parameter
+ called <emphasis>JCRStatisticsManager.persistence.timeout</emphasis> to
+ your expected value expressed in milliseconds, by default it is set to
+ <emphasis>5000</emphasis>.</para>
+
+ <para>You can also access to the statistics thanks to JMX, the available
+ methods are the following:</para>
+
+ <para><table>
+ <title>JMX Methods</title>
+
+ <tgroup cols="2">
+ <tbody>
+ <row>
+ <entry>getMin</entry>
+
+ <entry>Gives the minimum time spent into the method
+ corresponding to the given category name and statistics name.
+ The expected arguments are the name of the category of the
+ statistics (e.g. JDBCStorageConnection) and the name of the
+ expected method or global for the global value.</entry>
+ </row>
+
+ <row>
+ <entry>getMax</entry>
+
+ <entry>Gives the maximum time spent into the method
+ corresponding to the given category name and statistics name.
+ The expected arguments are the name of the category of the
+ statistics (e.g. JDBCStorageConnection) and the name of the
+ expected method or global for the global value.</entry>
+ </row>
+
+ <row>
+ <entry>getTotal</entry>
+
+ <entry>Gives the total amount of time spent into the method
+ corresponding to the given category name and statistics name.
+ The expected arguments are the name of the category of the
+ statistics (e.g. JDBCStorageConnection) and the name of the
+ expected method or global for the global value.</entry>
+ </row>
+
+ <row>
+ <entry>getAvg</entry>
+
+ <entry>Gives the average time spent into the method
+ corresponding to the given category name and statistics name.
+ The expected arguments are the name of the category of the
+ statistics (e.g. JDBCStorageConnection) and the name of the
+ expected method or global for the global value.</entry>
+ </row>
+
+ <row>
+ <entry>getTimes</entry>
+
+ <entry>Gives the total amount of times the method has been
+ called corresponding to the given category name and statistics
+ name. The expected arguments are the name of the category of the
+ statistics (e.g. JDBCStorageConnection) and the name of the
+ expected method or global for the global value.</entry>
+ </row>
+
+ <row>
+ <entry>reset</entry>
+
+ <entry>Reset the statistics for the given category name and
+ statistics name. The expected arguments are the name of the
+ category of the statistics (e.g. JDBCStorageConnection) and the
+ name of the expected method or global for the global
+ value.</entry>
+ </row>
+
+ <row>
+ <entry>resetAll</entry>
+
+ <entry>Reset all the statistics for the given category name. The
+ expected argument is the name of the category of the statistics
+ (e.g. JDBCStorageConnection).</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>The full name of the related MBean is
+ <emphasis>exo:service=statistic, view=jcr</emphasis>.</para>
+ </section>
+</chapter>
15 years, 11 months
exo-jcr SVN: r2885 - jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2010-08-05 08:40:40 -0400 (Thu, 05 Aug 2010)
New Revision: 2885
Modified:
jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/cometd-cluster.xml
jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/cometd.xml
jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/framework-for-cross-domain-ajax.xml
jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/javascript-webdav-library.xml
jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/kerberos-sso-on-active-directory.xml
jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/oauth.xml
Log:
EXOJCR-869: link fixes
Modified: jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/cometd-cluster.xml
===================================================================
--- jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/cometd-cluster.xml 2010-08-05 12:04:47 UTC (rev 2884)
+++ jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/cometd-cluster.xml 2010-08-05 12:40:40 UTC (rev 2885)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<chapter id = "WS.Cometdcluster">
+<chapter id="WS.Cometdcluster">
<?dbhtml filename="ch-cometd-cluster.html"?>
<title>Cometd cluster</title>
@@ -9,12 +9,12 @@
<section>
<title>Motivation</title>
- <para>When we run Stress Testing Cometd (Jetty implementation) <link
- linkend="???">http://docs.codehaus.org/display/JETTY/Stress+Testing+Cometd</link>
+ <para>When we run Stress Testing Cometd (Jetty implementation) <ulink
+ url="http://docs.codehaus.org/display/JETTY/Stress+Testing+Cometd">http://docs.codehaus.org/display/JETTY/Stress+Testing+Cometd</ulink>
we see that if we connect many clients, deliver message latency tends to
grow up. This situation described in article "20,000 Reasons Why Comet
- Scales". <link
- linkend="???">http://cometdaily.com/2008/01/07/20000-reasons-that-comet-scales/</link>
+ Scales". <ulink
+ url="http://cometdaily.com/2008/01/07/20000-reasons-that-comet-scales/">http://cometdaily.com/2008/01/07/20000-reasons-that-comet-scales/</ulink>
So, in order to support a lot of concurrent cometd connections we need a
mean to horizontally scale eXo cometd support.</para>
@@ -215,16 +215,10 @@
sleep-connection = "500" (мс), will be subscribe on the channel
"/eXo/comedt/test". Then it will be sent two message "hello" "hello!!!"
the First individually to each of the clients, the second broadcast on the
- channel. Messages delivered with an interval sleep-sending = "200". <link
- linkend="???">http://localhost:8080/rest/</link> - base URL of Exo -
- server. For start test execute a command:</para>
+ channel. Messages delivered with an interval sleep-sending = "200".
+ <uri>http://localhost:8080/rest/</uri> - base URL of Exo - server. For
+ start test execute a command:</para>
<programlisting>mvn clean install -f pom-test.xml -Dexo.test.skip=false -Djetty.home = "./target/jetty"</programlisting>
</section>
-
- <section>
- <title>Bench</title>
-
- <para>See Cometd Cluster Bench</para>
- </section>
</chapter>
Modified: jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/cometd.xml
===================================================================
--- jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/cometd.xml 2010-08-05 12:04:47 UTC (rev 2884)
+++ jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/cometd.xml 2010-08-05 12:40:40 UTC (rev 2885)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<chapter id = "WS.Cometd">
+<chapter id="WS.Cometd">
<?dbhtml filename="ch-cometd.html"?>
<title>Cometd</title>
@@ -18,8 +18,8 @@
called various names, including server push, HTTP push, HTTP streaming,
Pushlets, Reverse Ajax, and others.</para>
- <para>Cometd on wikipedia <link
- linkend="???">http://en.wikipedia.org/wiki/Comet_(programming)</link>.</para>
+ <para>Cometd on wikipedia <ulink
+ url="http://en.wikipedia.org/wiki/Comet_(programming)">http://en.wikipedia.org/wiki/Comet_(programming)</ulink>.</para>
<para>It's an implementation of the Bayeux protocol.</para>
</section>
Modified: jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/framework-for-cross-domain-ajax.xml
===================================================================
--- jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/framework-for-cross-domain-ajax.xml 2010-08-05 12:04:47 UTC (rev 2884)
+++ jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/framework-for-cross-domain-ajax.xml 2010-08-05 12:40:40 UTC (rev 2885)
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<chapter id = "WS.CrossDomainAJAX">
+<chapter id="WS.CrossDomainAJAX">
<?dbhtml filename="ch-framework-for-cross-domain-ajax.html"?>
<title>Framework for cross-domain AJAX</title>
- <para>(<link
- linkend="???">http://svn.exoplatform.org/projects/ws/branches/1.3/frameworks/cross-doma...</link>)</para>
+ <para>(<ulink
+ url="https://anonsvn.jboss.org/repos/exo-jcr/ws/trunk/exo.ws.frameworks.javasc...">https://anonsvn.jboss.org/repos/exo-jcr/ws/trunk/exo.ws.frameworks.javasc...</ulink>)</para>
<section>
<title>Motivation</title>
@@ -17,8 +17,8 @@
server. This has put a serious limitation on Ajax developers: you can use
XmlHttpRequests to make background calls to a server, but it has to be the
same server that served up the current page. For detail's you can visit
- <link
- linkend="???">http://www.mozilla.org/projects/security/components/same-origin.html</link>.</para>
+ <ulink
+ url="http://www.mozilla.org/projects/security/components/same-origin.html">http://www.mozilla.org/projects/security/components/same-origin.html</ulink>.</para>
<mediaobject>
<imageobject>
Modified: jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/javascript-webdav-library.xml
===================================================================
--- jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/javascript-webdav-library.xml 2010-08-05 12:04:47 UTC (rev 2884)
+++ jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/javascript-webdav-library.xml 2010-08-05 12:40:40 UTC (rev 2885)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<chapter id = "WS.JavaScriptWebDAVLibrary">
+<chapter id="WS.JavaScriptWebDAVLibrary">
<?dbhtml filename="ch-javascript-webdav-library.html"?>
<title>JavaScript WebDAV Library</title>
@@ -343,16 +343,13 @@
<section>
<title>How to get JavaScript WebDAV library</title>
- <para>You can get this library at the <link
- linkend="???">http://svn.exoplatform.org/svnroot/exoplatform/projects/ws/branches/2.0.x...</link></para>
+ <para>You can get this library at the <ulink
+ url="http://svn.exoplatform.org/svnroot/exoplatform/projects/ws/branches/2.0.x...">http://svn.exoplatform.org/svnroot/exoplatform/projects/ws/branches/2.0.x...</ulink></para>
- <para>Demonstration page was placed as <link
- linkend="???">http://svn.exoplatform.org/svnroot/exoplatform/projects/ws/branches/2.0.x...</link></para>
+ <para>Demonstration page was placed as <ulink
+ url="http://svn.exoplatform.org/svnroot/exoplatform/projects/ws/branches/2.0.x...">http://svn.exoplatform.org/svnroot/exoplatform/projects/ws/branches/2.0.x...</ulink></para>
- <para>JSDoc is available at the <link
- linkend="???">http://svn.exoplatform.org/svnroot/exoplatform/projects/ws/branches/2.0.x...</link></para>
-
- <para>Another place of Javadoc will be at the <link
- linkend="???">http://docs.exoplatform.com.ua site soon</link>.</para>
+ <para>JSDoc is available at the <ulink
+ url="http://svn.exoplatform.org/svnroot/exoplatform/projects/ws/branches/2.0.x...">http://svn.exoplatform.org/svnroot/exoplatform/projects/ws/branches/2.0.x...</ulink></para>
</section>
</chapter>
Modified: jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/kerberos-sso-on-active-directory.xml
===================================================================
--- jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/kerberos-sso-on-active-directory.xml 2010-08-05 12:04:47 UTC (rev 2884)
+++ jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/kerberos-sso-on-active-directory.xml 2010-08-05 12:40:40 UTC (rev 2885)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<chapter id = "WS.KerberosSSOOnActiveDirectory">
+<chapter id="WS.KerberosSSOOnActiveDirectory">
<?dbhtml filename="ch-kerberos-sso-on-active-directory.html"?>
<title>Kerberos SSO on Active Directory</title>
@@ -226,10 +226,10 @@
</security-constraint></programlisting>
<para>NOTE At list one roles in web.xml must be corresponding to user
- group in AD. </para>
+ group in AD.</para>
<para>3. Download in lib folder jcif-1.2.17.jar . We need this for support
- NTLM authentication. </para>
+ NTLM authentication.</para>
<para>4. In exo-tomcat/conf/jaas.conf, add :</para>
@@ -279,9 +279,8 @@
of the machine where webserver run (in this exemple : set "ubu"). For IE,
there is no additional configuration.</para>
- <para>8. Go to <link
- linkend="???">http://ubu.exoua-int:8080/portal/private/classic</link> If
- use was login windows (domain authentication) then, Active directory
+ <para>8. Go to <uri>http://ubu.exoua-int:8080/portal/private/classic</uri>
+ If use was login windows (domain authentication) then, Active directory
authentication will be used.</para>
<para>Instead tomcat valve
Modified: jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/oauth.xml
===================================================================
--- jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/oauth.xml 2010-08-05 12:04:47 UTC (rev 2884)
+++ jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/oauth.xml 2010-08-05 12:40:40 UTC (rev 2885)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<chapter id = "WS.oAuth">
+<chapter id="WS.oAuth">
<?dbhtml filename="ch-oauth.html"?>
<title>oAuth</title>
@@ -12,17 +12,17 @@
<para>OAuth allows to grant access to private resources on one site (which
is called the Service Provider), to another site (called Consumer). OAuth
is giving access to a resource without sharing your identity at all. More
- about oAuth at the site <link linkend="???">http://oauth.net/</link>.
- (OAuth protocol: <link
- linkend="???">http://oauth.net/core/1.0/</link>).</para>
+ about oAuth at the site <ulink
+ url="http://oauth.net/">http://oauth.net/</ulink>. (OAuth protocol: <ulink
+ url="http://oauth.net/core/1.0/">http://oauth.net/core/1.0/</ulink>).</para>
<para>This article describes how to configure our implementation of oAuth
service and client part. Both parts, service (Provider) and client
- (Consumer) are based on oAuth core, this code can be found here <link
- linkend="???">http://oauth.googlecode.com/svn/code/java/core/</link>.</para>
+ (Consumer) are based on oAuth core, this code can be found here <ulink
+ url="http://oauth.googlecode.com/svn/code/java/core/">http://oauth.googlecode.com/svn/code/java/core/</ulink>.</para>
- <para>Our implementation can be found here <link
- linkend="???">http://svn.exoplatform.org/svnroot/exoplatform/projects/ws/trunk/security...</link>.</para>
+ <para>Our implementation can be found here <ulink
+ url="http://svn.exoplatform.org/svnroot/exoplatform/projects/ws/trunk/security...">http://svn.exoplatform.org/svnroot/exoplatform/projects/ws/trunk/security...</ulink>.</para>
</section>
<section>
15 years, 11 months
exo-jcr SVN: r2884 - in jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules: kernel and 1 other directories.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2010-08-05 08:04:47 -0400 (Thu, 05 Aug 2010)
New Revision: 2884
Modified:
jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/core/ldap-configuration.xml
jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/kernel/service-configuration-in-detail.xml
jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/rest-service-tutorial.xml
jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/soap-service-tutorial.xml
jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/ws.xml
Log:
EXOJCR-869: link fixes
Modified: jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/core/ldap-configuration.xml
===================================================================
--- jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/core/ldap-configuration.xml 2010-08-05 11:14:22 UTC (rev 2883)
+++ jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/core/ldap-configuration.xml 2010-08-05 12:04:47 UTC (rev 2884)
@@ -716,9 +716,6 @@
unsecured connection you have to use the ldaps protocol</para>
</note>
- <para>#info("There is a microsoft limitation: password can't be set in
- AD via unsecured connection you have to use the ldaps protocol")</para>
-
<para>here is how to use LDAPS protocol with Active Directory :</para>
<programlisting>1 setup AD to use SSL:
Modified: jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/kernel/service-configuration-in-detail.xml
===================================================================
--- jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/kernel/service-configuration-in-detail.xml 2010-08-05 11:14:22 UTC (rev 2883)
+++ jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/kernel/service-configuration-in-detail.xml 2010-08-05 12:04:47 UTC (rev 2884)
@@ -597,11 +597,13 @@
<para>The content of <emphasis role="bold"><init-params></emphasis>
corresponds to the structure of the TaxonomyPlugin object.</para>
- <para>#info("You can configure the component CategoriesService using the
- addTaxonomyPlugin as often as you wish, you can also call
- addTaxonomyPlugin in different configuration files. The method
- addTaxonomyPlugin is then called several times, everything else depends on
- the implementation of the method")</para>
+ <note>
+ <para>You can configure the component CategoriesService using the
+ addTaxonomyPlugin as often as you wish, you can also call
+ addTaxonomyPlugin in different configuration files. The method
+ addTaxonomyPlugin is then called several times, everything else depends
+ on the implementation of the method</para>
+ </note>
</section>
<section id="Import">
Modified: jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/rest-service-tutorial.xml
===================================================================
--- jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/rest-service-tutorial.xml 2010-08-05 11:14:22 UTC (rev 2883)
+++ jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/rest-service-tutorial.xml 2010-08-05 12:04:47 UTC (rev 2884)
@@ -1,221 +1,218 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
-"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<chapter id="WS.RestServiceTutorial">
- <?dbhtml filename="ch-rest-service-tutorial.html"?>
-
- <title>REST Service Tutorial</title>
-
- <important>
- <para>This article describes REST framework before version
- exo-ws-2.0.</para>
- </important>
-
- <section>
- <title>Introduction</title>
-
- <para>This HOW-TO explains how to create your own REST based services. In
- this HOW-TO we will create a simple calculator, which can do basic
- operations with integers.</para>
- </section>
-
- <section>
- <title>Source code</title>
-
- <programlisting>// ...
-@URITemplate("/calculator/{item1}/{item2}/")
-public class Calculator implements ResourceContainer {
-}</programlisting>
-
- <para>Writing <command>@URITemplate</command> before the class definition
- gives you the possibility not to set it for each method. Furthermore the
- class must implement the interface <command>ResourceContainer</command>.
- This interface doesn't have any methods, it is just an indication for the
- <command>ResourceBinder</command>. Add the code for adding two
- integers.</para>
-
- <programlisting>// ...
-@URITemplate("/calculator/{item1}/{item2}/")
-public class Calculator implements ResourceContainer {
- @QueryTemplate("operation=add")
- @OutputTransformer(StringOutputTransformer.class)
- @HTTPMethod("GET")
- public Response add(@URIParam("item1") Integer item1,
- @URIParam("item2") Integer item2) {
- StringBuffer sb = new StringBuffer();
- sb.append(item1).append(" + ").append(item2).append(" = ").append(item1 + item2);
- return Response.Builder.ok(sb.toString(), "text/plain").build();
- }
-}</programlisting>
-
- <para>@QueryTemplate("operation=add") - only requests with query
- parameters "operation=add" can reach this method;
- @OutputTransformer(StringOutputTransformer.class) - the output
- transformer; @HTTPMethod("GET") - the HTTP method "GET".</para>
-
- <para>Write the code for other operations in the same way. Then the result
- should look like:</para>
-
- <programlisting>package org.exoplatform.services.rest.example;
-
-import org.exoplatform.services.rest.HTTPMethod;
-import org.exoplatform.services.rest.OutputTransformer;
-import org.exoplatform.services.rest.QueryTemplate;
-import org.exoplatform.services.rest.Response;
-import org.exoplatform.services.rest.URIParam;
-import org.exoplatform.services.rest.URITemplate;
-import org.exoplatform.services.rest.container.ResourceContainer;
-import org.exoplatform.services.rest.transformer.StringOutputTransformer;
-
-@URITemplate("/calculator/{item1}/{item2}/")
-(a)OutputTransformer(StringOutputTransformer.class)
-public class Calculator implements ResourceContainer {
-
- @QueryTemplate("operation=add")
- @HTTPMethod("GET")
- public Response add(@URIParam("item1") Integer item1, @URIParam("item2") Integer item2) {
- StringBuffer sb = new StringBuffer();
- sb.append(item1).append(" + ").append(item2).append(" = ").append(item1 + item2);
- return Response.Builder.ok(sb.toString(), "text/plain").build();
- }
-
- @QueryTemplate("operation=subtract")
- @HTTPMethod("GET")
- public Response subtract(@URIParam("item1") Integer item1, @URIParam("item2") Integer item2) {
- StringBuffer sb = new StringBuffer();
- sb.append(item1).append(" - ").append(item2).append(" = ").append(item1 - item2);
- return Response.Builder.ok(sb.toString(), "text/plain").build();
- }
-
- @QueryTemplate("operation=multiply")
- @HTTPMethod("GET")
- public Response multiply(@URIParam("item1") Integer item1, @URIParam("item2") Integer item2) {
- StringBuffer sb = new StringBuffer();
- sb.append(item1).append(" * ").append(item2).append(" = ").append(item1 * item2);
- return Response.Builder.ok(sb.toString(), "text/plain").build();
- }
-
- @QueryTemplate("operation=divide")
- @HTTPMethod("GET")
- public Response divide(@URIParam("item1") Integer item1, @URIParam("item2") Integer item2) {
- StringBuffer sb = new StringBuffer();
- sb.append(item1).append(" / ").append(item2).append(" = ").append(item1 / item2);
- return Response.Builder.ok(sb.toString(), "text/plain").build();
- }
-}</programlisting>
-
- <para>So we are done with the source code.</para>
- </section>
-
- <section>
- <title>Configuration</title>
-
- <para>Create the directory conf/portal and create the file
- configuration.xml in it. Add the following code to this file:</para>
-
- <programlisting><?xml version="1.0" encoding="ISO-8859-1"?>
-<configuration>
- <component>
- <type>org.exoplatform.services.rest.example.Calculator</type>
- </component>
-</configuration></programlisting>
- </section>
-
- <section>
- <title>Build</title>
-
- <para>Now we must create the following directory structure to get the
- possibility to build the source code using maven.</para>
-
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/rest-build-process.png" />
- </imageobject>
- </mediaobject>
-
- <para>Then create the file pom.xml using the following:</para>
-
- <programlisting><project>
- <parent>
- <groupId>org.exoplatform.ws</groupId>
- <artifactId>config</artifactId>
- <version>trunk</version>
- </parent>
-
- <modelVersion&#624;.0.0</modelVersion>
- <groupId>org.exoplatform.ws.rest</groupId>
- <artifactId>simple.calculator</artifactId>
- <packaging>jar</packaging>
- <version>trunk</version>
- <description>Simple REST service</description>
-
- <dependencies>
- <dependency>
- <groupId>org.exoplatform.ws.rest</groupId>
- <artifactId>exo.rest.core</artifactId>
- <version>trunk</version>
- </dependency>
- </dependencies>
-</project></programlisting>
-
- <para>Build this by executing the command:</para>
-
- <programlisting>andrew@ubu:~/workspace/calculator$ mvn clean install</programlisting>
- </section>
-
- <section>
- <title>Deploy</title>
-
- <para>We have done all now. Then copy the jar file from the target
- directory of project exo-tomcat into the server with all prepared stuff
- for REST services. (You can download it here: <link
- linkend="???">http://forge.objectweb.org/project/download.php?group_id=151&file_id=...</link>)</para>
-
- <para>So just put the jar file into the lib directory of the tomcat and
- restart it. In the console you should see this message:</para>
-
- <programlisting>[INFO] ResourceBinder - Bind new ResourceContainer: org.exoplatform.services.rest.example.Calculator@19846fd</programlisting>
-
- <para>This message indicates that our service was found, bound and is
- ready to work</para>
- </section>
-
- <section>
- <title>Usage</title>
-
- <para>Open your browser and type the following URL: <link
- linkend="???">http://localhost:8080/rest/calculator/12/5/?operation=add</link>
- and you should see the next page:</para>
-
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/rest-run-process.png" />
- </imageobject>
- </mediaobject>
-
- <para>The service is working. This is a very simple example, but it should
- help developers use the REST framework.</para>
-
- <para>Try to check other URLs.</para>
-
- <itemizedlist>
- <listitem>
- <para><link
- linkend="???">http://localhost:8080/rest/calculator/12/5/?operation=subtract</link>
- - must give "12 - 5 = 7";</para>
- </listitem>
-
- <listitem>
- <para><link
- linkend="???">http://localhost:8080/rest/calculator/12/5/?operation=multiply</link>
- - must give "12 * 5 = 60";</para>
- </listitem>
-
- <listitem>
- <para><link
- linkend="???">http://localhost:8080/rest/calculator/12/5/?operation=divide</link>-
- must give "12 / 5 = 2" (we are working with integers!);</para>
- </listitem>
- </itemizedlist>
- </section>
-</chapter>
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<chapter id="WS.RestServiceTutorial">
+ <?dbhtml filename="ch-rest-service-tutorial.html"?>
+
+ <title>REST Service Tutorial</title>
+
+ <important>
+ <para>This article describes REST framework before version
+ exo-ws-2.0.</para>
+ </important>
+
+ <section>
+ <title>Introduction</title>
+
+ <para>This HOW-TO explains how to create your own REST based services. In
+ this HOW-TO we will create a simple calculator, which can do basic
+ operations with integers.</para>
+ </section>
+
+ <section>
+ <title>Source code</title>
+
+ <programlisting>// ...
+@URITemplate("/calculator/{item1}/{item2}/")
+public class Calculator implements ResourceContainer {
+}</programlisting>
+
+ <para>Writing <command>@URITemplate</command> before the class definition
+ gives you the possibility not to set it for each method. Furthermore the
+ class must implement the interface <command>ResourceContainer</command>.
+ This interface doesn't have any methods, it is just an indication for the
+ <command>ResourceBinder</command>. Add the code for adding two
+ integers.</para>
+
+ <programlisting>// ...
+@URITemplate("/calculator/{item1}/{item2}/")
+public class Calculator implements ResourceContainer {
+ @QueryTemplate("operation=add")
+ @OutputTransformer(StringOutputTransformer.class)
+ @HTTPMethod("GET")
+ public Response add(@URIParam("item1") Integer item1,
+ @URIParam("item2") Integer item2) {
+ StringBuffer sb = new StringBuffer();
+ sb.append(item1).append(" + ").append(item2).append(" = ").append(item1 + item2);
+ return Response.Builder.ok(sb.toString(), "text/plain").build();
+ }
+}</programlisting>
+
+ <para>@QueryTemplate("operation=add") - only requests with query
+ parameters "operation=add" can reach this method;
+ @OutputTransformer(StringOutputTransformer.class) - the output
+ transformer; @HTTPMethod("GET") - the HTTP method "GET".</para>
+
+ <para>Write the code for other operations in the same way. Then the result
+ should look like:</para>
+
+ <programlisting>package org.exoplatform.services.rest.example;
+
+import org.exoplatform.services.rest.HTTPMethod;
+import org.exoplatform.services.rest.OutputTransformer;
+import org.exoplatform.services.rest.QueryTemplate;
+import org.exoplatform.services.rest.Response;
+import org.exoplatform.services.rest.URIParam;
+import org.exoplatform.services.rest.URITemplate;
+import org.exoplatform.services.rest.container.ResourceContainer;
+import org.exoplatform.services.rest.transformer.StringOutputTransformer;
+
+@URITemplate("/calculator/{item1}/{item2}/")
+(a)OutputTransformer(StringOutputTransformer.class)
+public class Calculator implements ResourceContainer {
+
+ @QueryTemplate("operation=add")
+ @HTTPMethod("GET")
+ public Response add(@URIParam("item1") Integer item1, @URIParam("item2") Integer item2) {
+ StringBuffer sb = new StringBuffer();
+ sb.append(item1).append(" + ").append(item2).append(" = ").append(item1 + item2);
+ return Response.Builder.ok(sb.toString(), "text/plain").build();
+ }
+
+ @QueryTemplate("operation=subtract")
+ @HTTPMethod("GET")
+ public Response subtract(@URIParam("item1") Integer item1, @URIParam("item2") Integer item2) {
+ StringBuffer sb = new StringBuffer();
+ sb.append(item1).append(" - ").append(item2).append(" = ").append(item1 - item2);
+ return Response.Builder.ok(sb.toString(), "text/plain").build();
+ }
+
+ @QueryTemplate("operation=multiply")
+ @HTTPMethod("GET")
+ public Response multiply(@URIParam("item1") Integer item1, @URIParam("item2") Integer item2) {
+ StringBuffer sb = new StringBuffer();
+ sb.append(item1).append(" * ").append(item2).append(" = ").append(item1 * item2);
+ return Response.Builder.ok(sb.toString(), "text/plain").build();
+ }
+
+ @QueryTemplate("operation=divide")
+ @HTTPMethod("GET")
+ public Response divide(@URIParam("item1") Integer item1, @URIParam("item2") Integer item2) {
+ StringBuffer sb = new StringBuffer();
+ sb.append(item1).append(" / ").append(item2).append(" = ").append(item1 / item2);
+ return Response.Builder.ok(sb.toString(), "text/plain").build();
+ }
+}</programlisting>
+
+ <para>So we are done with the source code.</para>
+ </section>
+
+ <section>
+ <title>Configuration</title>
+
+ <para>Create the directory conf/portal and create the file
+ configuration.xml in it. Add the following code to this file:</para>
+
+ <programlisting><?xml version="1.0" encoding="ISO-8859-1"?>
+<configuration>
+ <component>
+ <type>org.exoplatform.services.rest.example.Calculator</type>
+ </component>
+</configuration></programlisting>
+ </section>
+
+ <section>
+ <title>Build</title>
+
+ <para>Now we must create the following directory structure to get the
+ possibility to build the source code using maven.</para>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/rest-build-process.png" />
+ </imageobject>
+ </mediaobject>
+
+ <para>Then create the file pom.xml using the following:</para>
+
+ <programlisting><project>
+ <parent>
+ <groupId>org.exoplatform.ws</groupId>
+ <artifactId>config</artifactId>
+ <version>trunk</version>
+ </parent>
+
+ <modelVersion&#624;.0.0</modelVersion>
+ <groupId>org.exoplatform.ws.rest</groupId>
+ <artifactId>simple.calculator</artifactId>
+ <packaging>jar</packaging>
+ <version>trunk</version>
+ <description>Simple REST service</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.exoplatform.ws.rest</groupId>
+ <artifactId>exo.rest.core</artifactId>
+ <version>trunk</version>
+ </dependency>
+ </dependencies>
+</project></programlisting>
+
+ <para>Build this by executing the command:</para>
+
+ <programlisting>andrew@ubu:~/workspace/calculator$ mvn clean install</programlisting>
+ </section>
+
+ <section>
+ <title>Deploy</title>
+
+ <para>We have done all now. Then copy the jar file from the target
+ directory of project exo-tomcat into the server with all prepared stuff
+ for REST services. (You can download it here: <ulink
+ url="http://forge.ow2.org/project/download.php?group_id=151&file_id=9862">http://forge.objectweb.org/project/download.php?group_id=151&file_id=...</ulink>)</para>
+
+ <para>So just put the jar file into the lib directory of the tomcat and
+ restart it. In the console you should see this message:</para>
+
+ <programlisting>[INFO] ResourceBinder - Bind new ResourceContainer: org.exoplatform.services.rest.example.Calculator@19846fd</programlisting>
+
+ <para>This message indicates that our service was found, bound and is
+ ready to work</para>
+ </section>
+
+ <section>
+ <title>Usage</title>
+
+ <para>Open your browser and type the following URL:
+ <uri>http://localhost:8080/rest/calculator/12/5/?operation=add</uri> and
+ you should see the next page:</para>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/rest-run-process.png" />
+ </imageobject>
+ </mediaobject>
+
+ <para>The service is working. This is a very simple example, but it should
+ help developers use the REST framework.</para>
+
+ <para>Try to check other URLs.</para>
+
+ <itemizedlist>
+ <listitem>
+ <para><uri>http://localhost:8080/rest/calculator/12/5/?operation=subtract</uri>
+ - must give "12 - 5 = 7";</para>
+ </listitem>
+
+ <listitem>
+ <para><uri>http://localhost:8080/rest/calculator/12/5/?operation=multiply</uri>
+ - must give "12 * 5 = 60";</para>
+ </listitem>
+
+ <listitem>
+ <para><uri>http://localhost:8080/rest/calculator/12/5/?operation=divide</uri>-
+ must give "12 / 5 = 2" (we are working with integers!);</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+</chapter>
Modified: jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/soap-service-tutorial.xml
===================================================================
--- jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/soap-service-tutorial.xml 2010-08-05 11:14:22 UTC (rev 2883)
+++ jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/soap-service-tutorial.xml 2010-08-05 12:04:47 UTC (rev 2884)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<chapter id = "WS.SOAPTutorial">
+<chapter id="WS.SOAPTutorial">
<?dbhtml filename="ch-soap-service-tutorial.html"?>
<title>SOAP Service Tutorial</title>
@@ -242,7 +242,6 @@
03.09.2009 17:21:27 *INFO * [http-8080-1] TicketOrderServiceImpl: Confirmation : false for order '1251991287079'. (TicketOrderServiceImpl.java, line 65)</programlisting>
<para>Now, your service is started and you can retrieve the WSDL at :
- <link
- linkend="???">http://localhost:8080/ws-examples/soap/services/TicketOrderService/Ticket...</link></para>
+ <uri>http://localhost:8080/ws-examples/soap/services/TicketOrderService/Ticket...</uri></para>
</section>
</chapter>
Modified: jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/ws.xml
===================================================================
--- jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/ws.xml 2010-08-05 11:14:22 UTC (rev 2883)
+++ jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/ws/ws.xml 2010-08-05 12:04:47 UTC (rev 2884)
@@ -14,8 +14,6 @@
<para>It's implementaion of API for RESTful Web Services with extensions,
Servlet and cross-domain AJAX web-frameworks and JavaBean-JSON
- transformer. Find full documentaion on <ulink
- url="http://wiki.exoplatform.org/xwiki/bin/view/WS/">eXo
- site</ulink>.</para>
+ transformer.</para>
</section>
</chapter>
15 years, 11 months
exo-jcr SVN: r2883 - jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/core.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2010-08-05 07:14:22 -0400 (Thu, 05 Aug 2010)
New Revision: 2883
Modified:
jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/core/core.xml
jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/core/ldap-configuration.xml
jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/core/organization-service-listener.xml
jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/core/organization-service.xml
jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/core/security-service.xml
jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/core/spring-security-integration.xml
Log:
EXOJCR-869: link fixes
Modified: jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/core/core.xml
===================================================================
--- jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/core/core.xml 2010-08-05 10:29:53 UTC (rev 2882)
+++ jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/core/core.xml 2010-08-05 11:14:22 UTC (rev 2883)
@@ -13,8 +13,6 @@
products and modules, it also can be used in the business logic.</para>
<para>It's Authentication and Security, Organization, Database, Logging,
- JNDI, LDAP, Document reader and other services. Find more on <ulink
- url="http://wiki.exoplatform.org/xwiki/bin/view/Core/">eXo
- site</ulink></para>
+ JNDI, LDAP, Document reader and other services.</para>
</section>
</chapter>
Modified: jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/core/ldap-configuration.xml
===================================================================
--- jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/core/ldap-configuration.xml 2010-08-05 10:29:53 UTC (rev 2882)
+++ jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/core/ldap-configuration.xml 2010-08-05 11:14:22 UTC (rev 2883)
@@ -3,6 +3,7 @@
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<chapter id="Core.LDAPConfiguration">
<?dbhtml filename="ch-ldap-configuration.html"?>
+
<title>LDAP Configuration</title>
<section>
@@ -91,10 +92,9 @@
<para>Firstly, start by connection settings which will tell eXo how to
connect to your directory server. These settings are very close to
- <ulink url="JNDI API>http://java.sun.com/products/jndi">JNDI
- API>http://java.sun.com/products/jndi</ulink> context parameters.
- This configuration is activated by the init-param ldap.config of service
- LDAPServiceImpl.</para>
+ <ulink url="http://java.sun.com/products/jndi">JNDI API</ulink> context
+ parameters. This configuration is activated by the init-param
+ ldap.config of service LDAPServiceImpl.</para>
<programlisting><component>
<key>org.exoplatform.services.ldap.LDAPService</key>
@@ -120,7 +120,7 @@
<listitem>
<para><emphasis role="bold">providerURL</emphasis>: LDAP server URL
(see <ulink
- url="PROVIDER_URL>http://java.sun.com/products/jndi/1.2/javadoc/javax/namin...">PROVIDER_URL>http://java.sun.com/products/jndi/1.2/javadoc/javax/namin...</ulink>).
+ url="http://java.sun.com/products/jndi/1.2/javadoc/javax/naming/Context.html#P...">PROVIDER_URL</ulink>).
For multiple ldap servers, use comma separated list of host:port
(Ex. ldap://127.0.0.1:389,10.0.0.1:389).</para>
</listitem>
@@ -128,33 +128,33 @@
<listitem>
<para><emphasis role="bold">rootdn</emphasis>: dn of user that will
be used by the service to authenticate on the server (see <ulink
- url="SECURITY_PRINCIPAL>http://java.sun.com/products/jndi/1.2/javadoc/javax...">SECURITY_PRINCIPAL>http://java.sun.com/products/jndi/1.2/javadoc/javax...</ulink>).</para>
+ url="http://java.sun.com/products/jndi/1.2/javadoc/javax/naming/Context.html#S...">SECURITY_PRINCIPAL</ulink>).</para>
</listitem>
<listitem>
<para><emphasis role="bold">password</emphasis>: password for user
rootdn (see <ulink
- url="SECURITY_CREDENTIALS>http://java.sun.com/products/jndi/1.2/javadoc/jav...">SECURITY_CREDENTIALS>http://java.sun.com/products/jndi/1.2/javadoc/jav...</ulink>).</para>
+ url="http://java.sun.com/products/jndi/1.2/javadoc/javax/naming/Context.html#S...">SECURITY_CREDENTIALS</ulink>).</para>
</listitem>
<listitem>
<para><emphasis role="bold">authenticationType</emphasis>: type of
authentication to be used (see <ulink
- url="SECURITY_AUTHENTICATION>http://java.sun.com/products/jndi/1.2/javadoc/...">SECURITY_AUTHENTICATION>http://java.sun.com/products/jndi/1.2/javadoc/...</ulink>).
+ url="http://java.sun.com/products/jndi/1.2/javadoc/javax/naming/Context.html#S...">SECURITY_AUTHENTICATION</ulink>).
Use one of none, simple, strong. Default is simple.</para>
</listitem>
<listitem>
<para><emphasis role="bold">version</emphasis>: LDAP protocol
version (see <ulink
- url="java.naming.ldap.version>http://java.sun.com/products/jndi/tutorial/ld...">java.naming.ldap.version>http://java.sun.com/products/jndi/tutorial/ld...</ulink>).
+ url="http://java.sun.com/products/jndi/tutorial/ldap/misc/version.html">java.naming.ldap.version</ulink>).
Set to 3 if your server supports LDAP V3.</para>
</listitem>
<listitem>
<para><emphasis role="bold">referalMode</emphasis>: one of follow,
ignore,throw (see <ulink
- url="REFERRAL>http://java.sun.com/products/jndi/1.2/javadoc/javax/naming/Co...">REFERRAL>http://java.sun.com/products/jndi/1.2/javadoc/javax/naming/Co...</ulink>).</para>
+ url="http://java.sun.com/products/jndi/1.2/javadoc/javax/naming/Context.html#R...">REFERRAL</ulink>).</para>
</listitem>
<listitem>
@@ -247,14 +247,14 @@
</listitem>
</itemizedlist>
- <para>Example : </para>
+ <para>Example :</para>
<programlisting>uid=john,cn=People,o=MyCompany,c=com</programlisting>
<para>However, if users exist deeply under userURL, eXo will be able
to retrieve them.</para>
- <para>Example : </para>
+ <para>Example :</para>
<programlisting>uid=tom,ou=France,ou=EMEA,cn=People,o=MyCompany,c=com</programlisting>
@@ -548,7 +548,7 @@
the given objectClass attributes. The classes must at least define the
attribute designated by membershipTypeMemberValue.</para>
- <para>Example : Adding membership validator would produce : </para>
+ <para>Example : Adding membership validator would produce :</para>
<programlisting>cn=validator,ou=human-resources,ou=groups,ou=portal,dc=exoplatform,dc=org
objectclass: top
@@ -780,12 +780,10 @@
<title>OpenLDAP dynlist overlays</title>
<para>If you use OpenLDAP, you may want to use the <ulink
- url="overlays > http://www.openldap.org/faq/data/cache/1169.html">overlays
- > http://www.openldap.org/faq/data/cache/1169.html</ulink>. Here is
- how you can use the <ulink
- url="dynlist overlay > http://www.openldap.org/faq/data/cache/1209.html">dynlist
- overlay > http://www.openldap.org/faq/data/cache/1209.html</ulink> to
- have memberships dynamically populated.</para>
+ url="http://www.openldap.org/faq/data/cache/1169.html">overlays</ulink>.
+ Here is how you can use the <ulink
+ url="http://www.openldap.org/faq/data/cache/1209.html">dynlist
+ overlay</ulink> to have memberships dynamically populated.</para>
<para>The main idea is to have your memberships populated dynamically by
an ldap query. Thus, you no longer have to maintain manually the roles
Modified: jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/core/organization-service-listener.xml
===================================================================
--- jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/core/organization-service-listener.xml 2010-08-05 10:29:53 UTC (rev 2882)
+++ jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/core/organization-service-listener.xml 2010-08-05 11:14:22 UTC (rev 2883)
@@ -3,14 +3,14 @@
"hp://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<chapter id="Core.OrganizationListener">
<?dbhtml filename="ch-organization-service-listener.html"?>
+
<title>Organization Listener</title>
<section>
<title>Overview</title>
- <para>The <link linkend="CoreOrganizationService">Organization
- Service</link>The Core Organization Service provides a mechanism to
- receive notifications when :</para>
+ <para>The <link linkend="Core.OrganizationService">Organization
+ Service</link> provides a mechanism to receive notifications when :</para>
<itemizedlist>
<listitem>
@@ -141,8 +141,8 @@
<para>Registering the listeners is then achieved by using the ExoContainer
plugin mechanism. Learn more about it on the <link
- linkend="KernelServiceConfigurationForBeginners">Service Configuration for
- Beginners</link> article.</para>
+ linkend="Kernel.ServiceConfigurationforBeginners">Service Configuration
+ for Beginners</link> article.</para>
<para>To effectively register organization service's listeners you simply
need to use the <>addListenerPlugin</> seer injector.</para>
Modified: jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/core/organization-service.xml
===================================================================
--- jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/core/organization-service.xml 2010-08-05 10:29:53 UTC (rev 2882)
+++ jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/core/organization-service.xml 2010-08-05 11:14:22 UTC (rev 2883)
@@ -1,149 +1,149 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
-"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
-<chapter id="Core.OrganizationService">
- <?dbhtml filename="ch-organization-service-listener.html"?>
- <title>Organization Service</title>
-
- <section id="Overview">
- <title>Overview</title>
-
- <para>OrganizationService is the service that allows to access the
- Organization model. This model is composed of :</para>
-
- <itemizedlist>
- <listitem>
- <para>Users</para>
- </listitem>
-
- <listitem>
- <para>Groups</para>
- </listitem>
-
- <listitem>
- <para>Memberships</para>
- </listitem>
- </itemizedlist>
-
- <para>It is the basis of eXo personalization and authorizations in eXo and
- is used allover the platform. The model is abstract and does not rely on
- any specific storage. Multiple implementations exist in exo :</para>
-
- <itemizedlist>
- <listitem>
- <para>hibernate : for storage into a RDBMS</para>
- </listitem>
-
- <listitem>
- <para>jndi : for storage into a directory such as an LDAP or MS Active
- Directory</para>
- </listitem>
-
- <listitem>
- <para>jcr : for storage inside a Java Content Repository</para>
- </listitem>
- </itemizedlist>
- </section>
-
- <section>
- <title>Organizational Model</title>
-
- <section>
- <title>User</title>
-
- <itemizedlist>
- <listitem>
- <para>username used as the identified</para>
- </listitem>
-
- <listitem>
- <para>Profile (identity and preferences)</para>
- </listitem>
- </itemizedlist>
- </section>
-
- <section>
- <title>Group</title>
-
- <para>Gather a set of users</para>
-
- <itemizedlist>
- <listitem>
- <para>applicative or business</para>
- </listitem>
-
- <listitem>
- <para>tree structure</para>
- </listitem>
-
- <listitem>
- <para>no inheritance</para>
- </listitem>
-
- <listitem>
- <para>expressed as /group/subgroup/subsubgroup</para>
- </listitem>
- </itemizedlist>
- </section>
-
- <section>
- <title>Membership</title>
-
- <itemizedlist>
- <listitem>
- <para>qualifies the group belonging</para>
- </listitem>
-
- <listitem>
- <para>"Member of group as XXX"</para>
- </listitem>
-
- <listitem>
- <para>expressed as : manager:/organization/hr, *:/partners</para>
- </listitem>
- </itemizedlist>
- </section>
- </section>
-
- <section>
- <title>Related articles and how-tos</title>
-
- <itemizedlist>
- <listitem>
- <para><ulink
- url="http://wiki.exoplatform.org/xwiki/bin/view/JCR/Organization+Service">JCR
- Organization Service</ulink></para>
- </listitem>
- </itemizedlist>
-
- <itemizedlist>
- <listitem>
- <para><ulink
- url="http://wiki.exoplatform.org/xwiki/bin/view/Core/Update+ConversationState+...'s+Membership+changed">Update
- ConversationState when user's Membership changed</ulink></para>
- </listitem>
-
- <listitem>
- <para><ulink url="Organization Service Initializer">Organization
- Service Initializer</ulink></para>
- </listitem>
-
- <listitem>
- <para><ulink
- url="http://wiki.exoplatform.org/xwiki/bin/view/Portal/Accessing+User+Profile">How
- to Access User Profile in your code</ulink></para>
- </listitem>
-
- <listitem>
- <para><ulink url="CoreOrganizationListener">How to create your own
- Organization Listener</ulink></para>
- </listitem>
-
- <listitem>
- <para><ulink
- url="How to manipulate Users and Memberships Programmatically">How to
- manipulate Users and Memberships Programmatically</ulink></para>
- </listitem>
- </itemizedlist>
- </section>
-</chapter>
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<chapter id="Core.OrganizationService">
+ <?dbhtml filename="ch-organization-service.html"?>
+ <title>Organization Service</title>
+
+ <section id="Overview">
+ <title>Overview</title>
+
+ <para>OrganizationService is the service that allows to access the
+ Organization model. This model is composed of :</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>Users</para>
+ </listitem>
+
+ <listitem>
+ <para>Groups</para>
+ </listitem>
+
+ <listitem>
+ <para>Memberships</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>It is the basis of eXo personalization and authorizations in eXo and
+ is used allover the platform. The model is abstract and does not rely on
+ any specific storage. Multiple implementations exist in exo :</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>hibernate : for storage into a RDBMS</para>
+ </listitem>
+
+ <listitem>
+ <para>jndi : for storage into a directory such as an LDAP or MS Active
+ Directory</para>
+ </listitem>
+
+ <listitem>
+ <para>jcr : for storage inside a Java Content Repository</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section>
+ <title>Organizational Model</title>
+
+ <section>
+ <title>User</title>
+
+ <itemizedlist>
+ <listitem>
+ <para>username used as the identified</para>
+ </listitem>
+
+ <listitem>
+ <para>Profile (identity and preferences)</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section>
+ <title>Group</title>
+
+ <para>Gather a set of users</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>applicative or business</para>
+ </listitem>
+
+ <listitem>
+ <para>tree structure</para>
+ </listitem>
+
+ <listitem>
+ <para>no inheritance</para>
+ </listitem>
+
+ <listitem>
+ <para>expressed as /group/subgroup/subsubgroup</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section>
+ <title>Membership</title>
+
+ <itemizedlist>
+ <listitem>
+ <para>qualifies the group belonging</para>
+ </listitem>
+
+ <listitem>
+ <para>"Member of group as XXX"</para>
+ </listitem>
+
+ <listitem>
+ <para>expressed as : manager:/organization/hr, *:/partners</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ </section>
+
+ <section>
+ <title>Related articles and how-tos</title>
+
+ <itemizedlist>
+ <listitem>
+ <para><ulink
+ url="http://wiki.exoplatform.org/xwiki/bin/view/JCR/Organization+Service">JCR
+ Organization Service</ulink></para>
+ </listitem>
+ </itemizedlist>
+
+ <itemizedlist>
+ <listitem>
+ <para><ulink
+ url="http://wiki.exoplatform.org/xwiki/bin/view/Core/Update+ConversationState+...'s+Membership+changed">Update
+ ConversationState when user's Membership changed</ulink></para>
+ </listitem>
+
+ <listitem>
+ <para><ulink url="Organization Service Initializer">Organization
+ Service Initializer</ulink></para>
+ </listitem>
+
+ <listitem>
+ <para><ulink
+ url="http://wiki.exoplatform.org/xwiki/bin/view/Portal/Accessing+User+Profile">How
+ to Access User Profile in your code</ulink></para>
+ </listitem>
+
+ <listitem>
+ <para><ulink url="CoreOrganizationListener">How to create your own
+ Organization Listener</ulink></para>
+ </listitem>
+
+ <listitem>
+ <para><ulink
+ url="How to manipulate Users and Memberships Programmatically">How to
+ manipulate Users and Memberships Programmatically</ulink></para>
+ </listitem>
+ </itemizedlist>
+ </section>
+</chapter>
Modified: jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/core/security-service.xml
===================================================================
--- jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/core/security-service.xml 2010-08-05 10:29:53 UTC (rev 2882)
+++ jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/core/security-service.xml 2010-08-05 11:14:22 UTC (rev 2883)
@@ -3,6 +3,7 @@
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<chapter id="Core.SecurityService">
<?dbhtml filename="ch-security-service.html"?>
+
<title>Security Service</title>
<section>
@@ -14,8 +15,8 @@
mechanism but the Security Service framework should not prevent other
(custom or standard) mechanisms from being used. You can learn more about
JAAS in the <ulink
- url="Java Tutorial>http://java.sun.com/j2se/1.5.0/docs/guide/security/jaas/tutor...">Java
- Tutorial>http://java.sun.com/j2se/1.5.0/docs/guide/security/jaas/tutor...</ulink></para>
+ url="http://java.sun.com/j2se/1.5.0/docs/guide/security/jaas/tutorials/General...">Java
+ Tutorial</ulink></para>
</section>
<section>
@@ -120,7 +121,6 @@
* @throws Exception
*/
Identity createIdentity(String userId) throws Exception;
-
}</programlisting>
<para>It is up to the application developer (and deployer) whether to
@@ -260,9 +260,6 @@
appropriate AS. In particular, we have dedicated Login modules for
Tomcat, JBoss, Jonas and WebSphere.</para>
- <para><emphasis role="bold">TODO: configuration examples for Tomcat,
- JBoss, Jonas and WebSphere</emphasis></para>
-
<para>Besides that, for the case when third party authentication
mechanism required, we have <emphasis
role="bold">org.exoplatform.services.security.jaas.IdentitySetLoginModule</emphasis>,
Modified: jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/core/spring-security-integration.xml
===================================================================
--- jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/core/spring-security-integration.xml 2010-08-05 10:29:53 UTC (rev 2882)
+++ jcr/branches/1.12.x/docs/reference/en/src/main/docbook/en-US/modules/core/spring-security-integration.xml 2010-08-05 11:14:22 UTC (rev 2883)
@@ -3,6 +3,7 @@
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<chapter id="Core.SpringSecurityIntegration">
<?dbhtml filename="ch-spring-security-integration.html"?>
+
<title>Spring Security Integration</title>
<section>
15 years, 11 months