Author: tolusha
Date: 2010-03-23 08:13:21 -0400 (Tue, 23 Mar 2010)
New Revision: 2102
Added:
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/core/db-creator-service.xml
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel/initial-context-binder-service.xml
Modified:
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/core.xml
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel.xml
Log:
EXOJCR-573: add docbook docs
Added:
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/core/db-creator-service.xml
===================================================================
---
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/core/db-creator-service.xml
(rev 0)
+++
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/core/db-creator-service.xml 2010-03-23
12:13:21 UTC (rev 2102)
@@ -0,0 +1,181 @@
+<?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>
+ <?dbhtml filename="ch-db-creator-service.html"?>
+
+ <title>Database Creator</title>
+
+ <section>
+ <title>About</title>
+
+ <para>Database Creator is responsible for execution DDL script at runtime.
+ A DDL script may contain templates for database name, user name and
+ password which will be replaced by real values at execution time.</para>
+
+ <para>Supports 3 templates:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>${database} for database name;</para>
+ </listitem>
+
+ <listitem>
+ <para>${username} for user name;</para>
+ </listitem>
+
+ <listitem>
+ <para>${password} for user's password;</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section>
+ <title>API</title>
+
+ <para>Service provide method for execute script for new database creation.
+ Database name which are passed as parameter will be substituted in DDL
+ script instead of ${database} template. Returns DBConnectionInfo object
+ (with all neccesary information of new database's connection) or throws
+ DBScriptExecutorException exception if any errors occurs in other
+ case.</para>
+
+ <programlisting>public DBConnectionInfo createDatabase(String dbName) throws
DBCreatorException;</programlisting>
+
+ <para>For MSSQL and Sybase servers uses autocommit mode set true for
+ connection. It's due to after execution "create database" command
newly
+ created database not available for "use" command and therefore you
can't
+ create new user inside database per one script.</para>
+ </section>
+
+ <section>
+ <title>A configuration examples</title>
+
+ <para>Service's configuration.</para>
+
+ <programlisting><component>
+
<key>org.exoplatform.services.database.creator.DBCreator</key>
+
<type>org.exoplatform.services.database.creator.DBCreator</type>
+ <init-params>
+ <properties-param>
+ <name>db-connection</name>
+ <description>database connection
properties</description>
+ <property name="driverClassName"
value="com.mysql.jdbc.Driver" />
+ <property name="url"
value="jdbc:mysql://localhost/" />
+ <property name="username" value="root" />
+ <property name="password" value="admin" />
+ </properties-param>
+ <properties-param>
+ <name>db-creation</name>.
+ <description>database creation
properties</description>.
+ <property name="scriptPath" value="script.sql"
/>
+ <property name="username" value="testuser"
/>
+ <property name="password" value="testpwd"
/>
+ </properties-param>
+ </init-params>
+ </component></programlisting>
+
+ <para>db-connection properties section contains parameters needed for
+ connection to database server</para>
+
+ <para>db-creation properties section contains paramaters for database
+ creation using DDL script:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>scriptPath: absolute path to DDL script file;</para>
+ </listitem>
+
+ <listitem>
+ <para>username: user name for substitution ${username} template in DDL
+ script;</para>
+ </listitem>
+
+ <listitem>
+ <para>password: user's password for substitution ${password} template
+ in DDL script;</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>Specific db-connection properties section for different
+ databases.</para>
+
+ <para>MySQL:</para>
+
+ <programlisting><property name="driverClassName"
value="com.mysql.jdbc.Driver" />
+<property name="url" value="jdbc:mysql://localhost/"
/>
+<property name="username" value="root" />
+<property name="password" value="admin"
/></programlisting>
+
+ <para>PostgreSQL:</para>
+
+ <programlisting><property name="driverClassName"
value="org.postgresql.Driver" />
+<property name="url" value="jdbc:postgresql://localhost/"
/>
+<property name="username" value="root" />
+<property name="password" value="admin"
/></programlisting>
+
+ <para>MSSQL:</para>
+
+ <programlisting><property name="driverClassName"
value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
+<property name="url"
value="jdbc:sqlserver://localhost:1433;"/>
+<property name="username" value="root"/>
+<property name="password"
value="admin"/></programlisting>
+
+ <para>Sybase:</para>
+
+ <programlisting><property name="driverClassName"
value="com.sybase.jdbc3.jdbc.SybDriver" />
+<property name="url"
value="jdbc:sybase:Tds:localhost:5000/"/>
+<property name="username" value="root"/>
+<property name="password"
value="admin"/></programlisting>
+
+ <para>Oracle:</para>
+
+ <programlisting><property name="driverClassName"
value="oracle.jdbc.OracleDriver" />
+<property name="url"
value="jdbc:oracle:thin:@db2.exoua-int:1521:orclvm" />
+<property name="username" value="root" />
+<property name="password" value="admin"
/></programlisting>
+ </section>
+
+ <section>
+ <title>An examples of a DDL script</title>
+
+ <para>MySQL:</para>
+
+ <programlisting>CREATE DATABASE ${database};
+USE ${database};
+CREATE USER '${username}' IDENTIFIED BY '${password}';
+GRANT SELECT,INSERT,UPDATE,DELETE ON ${database}.* TO
'${username}';</programlisting>
+
+ <para>PostgreSQL:</para>
+
+ <programlisting>CREATE USER ${username} WITH PASSWORD '${password}';
+CREATE DATABASE ${database} WITH OWNER ${username};</programlisting>
+
+ <para>MSSQL:</para>
+
+ <programlisting>USE MASTER;
+CREATE DATABASE ${database};
+USE ${database};
+CREATE LOGIN ${username} WITH PASSWORD = '${password}';
+CREATE USER ${username} FOR LOGIN ${username};</programlisting>
+
+ <para>Sybase:</para>
+
+ <programlisting>sp_addlogin ${username}, ${password};
+CREATE DATABASE ${database};
+USE ${database};
+sp_adduser ${username};</programlisting>
+
+ <para>Oracle:</para>
+
+ <programlisting>CREATE TABLESPACE "${database}" DATAFILE
'/var/oracle_db/orclvm/${database}' SIZE 10M AUTOEXTEND ON NEXT 6M MAXSIZE
UNLIMITED LOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;
+CREATE TEMPORARY TABLESPACE "${database}.TEMP" TEMPFILE
'/var/oracle_db/orclvm/${database}.temp' SIZE 5M AUTOEXTEND ON NEXT 5M MAXSIZE
UNLIMITED EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1M;
+CREATE USER "${username}" PROFILE "DEFAULT" IDENTIFIED BY
"${password}" DEFAULT TABLESPACE "${database}" TEMPORARY TABLESPACE
"${database}.TEMP" ACCOUNT UNLOCK;
+GRANT CREATE SEQUENCE TO "${username}";
+GRANT CREATE TABLE TO "${username}";
+GRANT CREATE TRIGGER TO "${username}";
+GRANT UNLIMITED TABLESPACE TO "${username}";
+GRANT "CONNECT" TO "${username}";
+GRANT "RESOURCE" TO "${username}";</programlisting>
+ </section>
+</chapter>
Modified: jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/core.xml
===================================================================
--- jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/core.xml 2010-03-23
11:47:17 UTC (rev 2101)
+++ jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/core.xml 2010-03-23
12:13:21 UTC (rev 2102)
@@ -8,5 +8,8 @@
<xi:include href="core/core.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
+
+ <xi:include href="core/db-creator-service.xml"
+
xmlns:xi="http://www.w3.org/2001/XInclude" />
</part>
Added:
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel/initial-context-binder-service.xml
===================================================================
---
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel/initial-context-binder-service.xml
(rev 0)
+++
jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel/initial-context-binder-service.xml 2010-03-23
12:13:21 UTC (rev 2102)
@@ -0,0 +1,60 @@
+<?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>
+ <?dbhtml filename="ch-initial-context-binder-service.html"?>
+
+ <title>Initial Context Binder</title>
+
+ <section>
+ <title>About</title>
+
+ <para>Initial Context Binder is responsible for binding references at
+ runtime, persisting in file and automatically rebinding after restart.
+ Java temp directory is used to persist references in bind-references.xml
+ file.</para>
+ </section>
+
+ <section>
+ <title>API</title>
+
+ <para>Service provide methods for binding reference.</para>
+
+ <programlisting>public void bind(String bindName, String className, String
factory, String factoryLocation, Map<String, String> refAddr) throws
NamingException, FileNotFoundException, XMLStreamException;</programlisting>
+
+ <itemizedlist>
+ <listitem>
+ <para>bindName - name of binding</para>
+ </listitem>
+
+ <listitem>
+ <para>className - the fully-qualified name of the class of the object
+ to which this Reference refers</para>
+ </listitem>
+
+ <listitem>
+ <para>factory - the name of the factory class for creating an instance
+ of the object to which this Reference refers</para>
+ </listitem>
+
+ <listitem>
+ <para>factoryLocation - the location of the factory class</para>
+ </listitem>
+
+ <listitem>
+ <para>refAddr - object's properties map</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+
+ <section>
+ <title>A configuration examples</title>
+
+ <para>Service's configuration.</para>
+
+ <programlisting><component>
+
<key>org.exoplatform.services.naming.InitialContextBinder</key>
+
<type>org.exoplatform.services.naming.InitialContextBinder</type>
+</component></programlisting>
+ </section>
+</chapter>
Modified: jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel.xml
===================================================================
--- jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel.xml 2010-03-23
11:47:17 UTC (rev 2101)
+++ jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules/kernel.xml 2010-03-23
12:13:21 UTC (rev 2102)
@@ -17,6 +17,8 @@
<xi:include href="kernel/transaction-service.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
-
-
+
+ <xi:include href="kernel/initial-context-binder-service.xml"
+
xmlns:xi="http://www.w3.org/2001/XInclude" />
+
</part>