exo-jcr SVN: r2107 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2010-03-24 09:11:41 -0400 (Wed, 24 Mar 2010)
New Revision: 2107
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexUpdateMonitor.java
Log:
EXOJCR-589: When IOmode changes, updateInProgress was reseted twice (in Multiindex and updateInProgressMonitor): fixed, removed useless setUpdateInProgress(false) in JBossUpdateInProgressMonitor.
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexUpdateMonitor.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexUpdateMonitor.java 2010-03-24 11:10:40 UTC (rev 2106)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexUpdateMonitor.java 2010-03-24 13:11:41 UTC (rev 2107)
@@ -122,8 +122,6 @@
// In READ_WRITE, the value of UpdateInProgress is changed locally so no need to listen
// to the cache
cache.removeCacheListener(this);
- // possibly indexer was terminated, so status should be reseted
- setUpdateInProgress(false, true);
}
else
{
16 years, 1 month
exo-jcr SVN: r2106 - ws/branches/2.2.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/proxy.
by do-not-reply@jboss.org
Author: max_shaposhnik
Date: 2010-03-24 07:10:40 -0400 (Wed, 24 Mar 2010)
New Revision: 2106
Modified:
ws/branches/2.2.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/proxy/BaseConnector.java
Log:
EXOJCR-468
Modified: ws/branches/2.2.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/proxy/BaseConnector.java
===================================================================
--- ws/branches/2.2.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/proxy/BaseConnector.java 2010-03-24 10:50:46 UTC (rev 2105)
+++ ws/branches/2.2.x/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/proxy/BaseConnector.java 2010-03-24 11:10:40 UTC (rev 2106)
@@ -26,6 +26,7 @@
import java.util.Enumeration;
import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.core.HttpHeaders;
import org.exoplatform.common.http.client.Codecs;
import org.exoplatform.common.http.client.HTTPConnection;
@@ -106,7 +107,6 @@
LOG.error("Received Error: " + resp.getReasonLine());
LOG.error(resp.getText());
}
- conn.stop();
return resp;
}
@@ -133,7 +133,6 @@
LOG.error("Received Error: " + resp.getReasonLine());
LOG.error(resp.getText());
}
- conn.stop();
return resp;
}
@@ -157,7 +156,6 @@
LOG.error("Received Error: " + resp.getReasonLine());
LOG.error(resp.getText());
}
- conn.stop();
return resp;
}
@@ -173,6 +171,7 @@
{
NVPair pair = null;
String headerName = (String)en.nextElement();
+ if (!headerName.equalsIgnoreCase(HttpHeaders.HOST)) { //Do not need to send host
for (Enumeration<String> en2 = httpRequest.getHeaders(headerName); en2.hasMoreElements();)
{
pair = new NVPair(headerName, en2.nextElement());
@@ -180,6 +179,7 @@
hds.add(pair);
this.headers = new NVPair[hds.size()];
this.headers = hds.toArray(headers);
+ }
}
}
16 years, 1 month
exo-jcr SVN: r2105 - in jcr/trunk/exo.jcr.component.core/src: main/java/org/exoplatform/services/jcr/impl/core/query/lucene and 1 other directories.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2010-03-24 06:50:46 -0400 (Wed, 24 Mar 2010)
New Revision: 2105
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexUpdateMonitor.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DefaultIndexUpdateMonitor.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexUpdateMonitor.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/prepare/TestIndexUpdateMonitor.java
Log:
EXOJCR-589: Update in progress monitor has a parameter "persistent change" now. Default impl. doesn't care of it, but JBossCache impl. uses cache only if persistent change is performed.
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexUpdateMonitor.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexUpdateMonitor.java 2010-03-23 13:55:25 UTC (rev 2104)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/JBossCacheIndexUpdateMonitor.java 2010-03-24 10:50:46 UTC (rev 2105)
@@ -54,6 +54,8 @@
private final Cache<Serializable, Object> cache;
+ private boolean localUpdateInProgress = false;
+
private static final String INDEX_PARAMETERS = "$index_parameters".intern();
private static final String SYSINDEX_PARAMETERS = "$sysindex_parameters".intern();
@@ -83,7 +85,6 @@
this.listeners = new CopyOnWriteArrayList<IndexUpdateMonitorListener>();
// store parsed FQN to avoid it's parsing each time cache event is generated
this.parametersFqn = Fqn.fromString(system ? INDEX_PARAMETERS : SYSINDEX_PARAMETERS);
-
modeHandler.addIndexerIoModeListener(this);
Node<Serializable, Object> cacheRoot = cache.getRoot();
@@ -100,7 +101,8 @@
if (IndexerIoMode.READ_WRITE == modeHandler.getMode())
{
- setUpdateInProgress(false);
+ // global, replicated set
+ setUpdateInProgress(false, true);
}
else
{
@@ -120,6 +122,8 @@
// In READ_WRITE, the value of UpdateInProgress is changed locally so no need to listen
// to the cache
cache.removeCacheListener(this);
+ // possibly indexer was terminated, so status should be reseted
+ setUpdateInProgress(false, true);
}
else
{
@@ -134,15 +138,23 @@
*/
public boolean getUpdateInProgress()
{
-
- Object value = cache.get(parametersFqn, PARAMETER_NAME);
- return value != null ? (Boolean)value : false;
+ if (IndexerIoMode.READ_ONLY == modeHandler.getMode())
+ {
+ Object value = cache.get(parametersFqn, PARAMETER_NAME);
+ return value != null ? (Boolean)value : false;
+ }
+ else
+ {
+ // this node is read-write, so must read local value.
+ // Local value is updated every time, but remote cache value is skipped is volatile changes are performed
+ return localUpdateInProgress;
+ }
}
/**
- * @see org.exoplatform.services.jcr.impl.core.query.lucene.IndexUpdateMonitor#setUpdateInProgress(boolean)
+ * @see org.exoplatform.services.jcr.impl.core.query.lucene.IndexUpdateMonitor#setUpdateInProgress(boolean, boolean)
*/
- public void setUpdateInProgress(boolean updateInProgress)
+ public void setUpdateInProgress(boolean updateInProgress, boolean persitentUpdate)
{
if (IndexerIoMode.READ_ONLY == modeHandler.getMode())
{
@@ -150,7 +162,13 @@
}
try
{
- cache.put(parametersFqn, PARAMETER_NAME, new Boolean(updateInProgress));
+ // anyway set local update in progress
+ localUpdateInProgress = updateInProgress;
+ if (persitentUpdate)
+ {
+ cache.put(parametersFqn, PARAMETER_NAME, new Boolean(updateInProgress));
+
+ }
for (IndexUpdateMonitorListener listener : listeners)
{
listener.onUpdateInProgressChange(updateInProgress);
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DefaultIndexUpdateMonitor.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DefaultIndexUpdateMonitor.java 2010-03-23 13:55:25 UTC (rev 2104)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/DefaultIndexUpdateMonitor.java 2010-03-24 10:50:46 UTC (rev 2105)
@@ -57,9 +57,9 @@
/**
*
- * @see org.exoplatform.services.jcr.impl.core.query.lucene.IndexUpdateMonitor#setUpdateInProgress(boolean)
+ * @see org.exoplatform.services.jcr.impl.core.query.lucene.IndexUpdateMonitor#setUpdateInProgress(boolean, boolean)
*/
- public void setUpdateInProgress(boolean updateInProgress)
+ public void setUpdateInProgress(boolean updateInProgress, boolean persitentUpdate)
{
this.updateInProgress.set(updateInProgress);
for (IndexUpdateMonitorListener listener : listeners)
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexUpdateMonitor.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexUpdateMonitor.java 2010-03-23 13:55:25 UTC (rev 2104)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/IndexUpdateMonitor.java 2010-03-24 10:50:46 UTC (rev 2105)
@@ -33,8 +33,9 @@
/**
* @param updateInProgress the updateInProgress to set
+ * @param persitentUpdate Additional information, identifying persistent index update
*/
- void setUpdateInProgress(boolean updateInProgress);
+ void setUpdateInProgress(boolean updateInProgress, boolean persitentUpdate);
/**
* Adds a new listener of type {@link IndexUpdateMonitorListener}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java 2010-03-23 13:55:25 UTC (rev 2104)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/MultiIndex.java 2010-03-24 10:50:46 UTC (rev 2105)
@@ -432,7 +432,7 @@
synchronized (updateMonitor)
{
//updateInProgress = true;
- indexUpdateMonitor.setUpdateInProgress(true);
+ indexUpdateMonitor.setUpdateInProgress(true, false);
}
try
{
@@ -467,7 +467,7 @@
synchronized (updateMonitor)
{
//updateInProgress = false;
- indexUpdateMonitor.setUpdateInProgress(false);
+ indexUpdateMonitor.setUpdateInProgress(false, false);
updateMonitor.notifyAll();
releaseMultiReader();
}
@@ -514,7 +514,7 @@
synchronized (updateMonitor)
{
//updateInProgress = true;
- indexUpdateMonitor.setUpdateInProgress(true);
+ indexUpdateMonitor.setUpdateInProgress(true, false);
}
int num;
try
@@ -547,7 +547,7 @@
synchronized (updateMonitor)
{
//updateInProgress = false;
- indexUpdateMonitor.setUpdateInProgress(false);
+ indexUpdateMonitor.setUpdateInProgress(false, false);
updateMonitor.notifyAll();
releaseMultiReader();
}
@@ -733,7 +733,7 @@
synchronized (updateMonitor)
{
//updateInProgress = true;
- indexUpdateMonitor.setUpdateInProgress(true);
+ indexUpdateMonitor.setUpdateInProgress(true, true);
}
try
{
@@ -781,7 +781,7 @@
synchronized (updateMonitor)
{
//updateInProgress = false;
- indexUpdateMonitor.setUpdateInProgress(false);
+ indexUpdateMonitor.setUpdateInProgress(false, true);
updateMonitor.notifyAll();
releaseMultiReader();
}
@@ -1395,7 +1395,7 @@
synchronized (updateMonitor)
{
//updateInProgress = true;
- indexUpdateMonitor.setUpdateInProgress(true);
+ indexUpdateMonitor.setUpdateInProgress(true, true);
}
try
{
@@ -1406,7 +1406,7 @@
synchronized (updateMonitor)
{
//updateInProgress = false;
- indexUpdateMonitor.setUpdateInProgress(false);
+ indexUpdateMonitor.setUpdateInProgress(false, true);
updateMonitor.notifyAll();
releaseMultiReader();
}
@@ -2415,7 +2415,7 @@
// Release all the current threads
synchronized (updateMonitor)
{
- indexUpdateMonitor.setUpdateInProgress(false);
+ indexUpdateMonitor.setUpdateInProgress(false, true);
updateMonitor.notifyAll();
releaseMultiReader();
}
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/prepare/TestIndexUpdateMonitor.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/prepare/TestIndexUpdateMonitor.java 2010-03-23 13:55:25 UTC (rev 2104)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/lab/cluster/prepare/TestIndexUpdateMonitor.java 2010-03-24 10:50:46 UTC (rev 2105)
@@ -78,15 +78,15 @@
assertFalse(indexUpdateMonitor.getUpdateInProgress());
//test set false
- indexUpdateMonitor.setUpdateInProgress(false);
+ indexUpdateMonitor.setUpdateInProgress(false, true);
assertFalse(indexUpdateMonitor.getUpdateInProgress());
//test set true
- indexUpdateMonitor.setUpdateInProgress(true);
+ indexUpdateMonitor.setUpdateInProgress(true, true);
assertTrue(indexUpdateMonitor.getUpdateInProgress());
//test set false
- indexUpdateMonitor.setUpdateInProgress(false);
+ indexUpdateMonitor.setUpdateInProgress(false, true);
assertFalse(indexUpdateMonitor.getUpdateInProgress());
}
16 years, 1 month
exo-jcr SVN: r2104 - jcr/trunk/exo.jcr.component.core.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2010-03-23 09:55:25 -0400 (Tue, 23 Mar 2010)
New Revision: 2104
Modified:
jcr/trunk/exo.jcr.component.core/pom.xml
Log:
EXOJCR-587: TestOrderBefore removed from exclude
Modified: jcr/trunk/exo.jcr.component.core/pom.xml
===================================================================
--- jcr/trunk/exo.jcr.component.core/pom.xml 2010-03-23 13:47:01 UTC (rev 2103)
+++ jcr/trunk/exo.jcr.component.core/pom.xml 2010-03-23 13:55:25 UTC (rev 2104)
@@ -358,11 +358,11 @@
<property>
<name>emma.coverage.out.file</name>
<value>target/emma/coverage.ec</value>
- </property>
- <!-- Uncomment the line below if you want to enable the statistics -->
- <!--property>
- <name>JDBCWorkspaceDataContainer.statistics.enabled</name>
- <value>true</value>
+ </property>
+ <!-- Uncomment the line below if you want to enable the statistics -->
+ <!--property>
+ <name>JDBCWorkspaceDataContainer.statistics.enabled</name>
+ <value>true</value>
</property-->
</systemProperties>
<includes>
@@ -399,7 +399,6 @@
<exclude>org/exoplatform/services/jcr/**/impl/**/SQLBenchmarkTest.java</exclude>
<exclude>org/exoplatform/services/jcr/**/impl/**/TestLockPerstistentDataManager.java</exclude>
<exclude>org/exoplatform/services/jcr/**/impl/**/TestCleanableFileStreamValueData.java</exclude>
- <exclude>org/exoplatform/services/jcr/**/api/**/TestOrderBefore.java</exclude>
</excludes>
</configuration>
</plugin>
@@ -548,11 +547,11 @@
org.apache.jackrabbit.test.api.nodetype.PredefinedNodeTypeTest#testVersionable
org.apache.jackrabbit.test.api.nodetype.PredefinedNodeTypeTest#testVersion
org.apache.jackrabbit.test.api.NamespaceRegistryTest#testRegisterNamespace</value>
- </property>
- <!-- Uncomment the line below if you want to enable the statistics -->
- <!--property>
- <name>JDBCWorkspaceDataContainer.statistics.enabled</name>
- <value>true</value>
+ </property>
+ <!-- Uncomment the line below if you want to enable the statistics -->
+ <!--property>
+ <name>JDBCWorkspaceDataContainer.statistics.enabled</name>
+ <value>true</value>
</property-->
</systemProperties>
<includes>
@@ -620,11 +619,11 @@
org.apache.jackrabbit.test.api.nodetype.PredefinedNodeTypeTest#testVersionable
org.apache.jackrabbit.test.api.nodetype.PredefinedNodeTypeTest#testVersion
org.apache.jackrabbit.test.api.NamespaceRegistryTest#testRegisterNamespace</value>
- </property>
- <!-- Uncomment the line below if you want to enable the statistics -->
- <!--property>
- <name>JDBCWorkspaceDataContainer.statistics.enabled</name>
- <value>true</value>
+ </property>
+ <!-- Uncomment the line below if you want to enable the statistics -->
+ <!--property>
+ <name>JDBCWorkspaceDataContainer.statistics.enabled</name>
+ <value>true</value>
</property-->
</systemProperties>
<includes>
@@ -670,7 +669,6 @@
<exclude>org/exoplatform/services/jcr/**/impl/**/SQLBenchmarkTest.java</exclude>
<exclude>org/exoplatform/services/jcr/**/impl/**/TestCleanableFileStreamValueData.java</exclude>
<exclude>org/exoplatform/services/jcr/**/impl/**/TestLockPerstistentDataManager.java</exclude>
- <exclude>org/exoplatform/services/jcr/**/api/**/TestOrderBefore.java</exclude>
<!-- From TCK -->
<exclude>org/apache/jackrabbit/test/api/TestAll.java</exclude>
<exclude>org/apache/jackrabbit/test/api/**/Abstract*.java</exclude>
@@ -698,11 +696,11 @@
<property>
<name>jcr.test.configuration.file</name>
<value>${jcr.test.configuration.file}</value>
- </property>
- <!-- Uncomment the line below if you want to enable the statistics -->
- <!--property>
- <name>JDBCWorkspaceDataContainer.statistics.enabled</name>
- <value>true</value>
+ </property>
+ <!-- Uncomment the line below if you want to enable the statistics -->
+ <!--property>
+ <name>JDBCWorkspaceDataContainer.statistics.enabled</name>
+ <value>true</value>
</property-->
</systemProperties>
<includes>
16 years, 1 month
exo-jcr SVN: r2103 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2010-03-23 09:47:01 -0400 (Tue, 23 Mar 2010)
New Revision: 2103
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java
Log:
EXOJCR-587: NPE in doOrderBefore fixed
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java 2010-03-23 12:13:21 UTC (rev 2102)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java 2010-03-23 13:47:01 UTC (rev 2103)
@@ -2374,7 +2374,7 @@
srcInd = i;
}
}
- if (destInd == -1 && destPath != null)
+ if (destPath != null && destInd == -1)
{
if (nodeData.getQPath().getName().equals(destPath.getName())
&& (nodeData.getQPath().getIndex() == destPath.getIndex() || destPath.getIndex() == 0
@@ -2495,7 +2495,10 @@
}
}
// delete state first
- dataManager.getChangesLog().add(deleteState);
+ if (deleteState != null)
+ {
+ dataManager.getChangesLog().add(deleteState);
+ }
dataManager.getChangesLog().addAll(changes);
}
16 years, 1 month
exo-jcr SVN: r2102 - in jcr/trunk/docs/reference/en/src/main/docbook/en-US/modules: core and 1 other directories.
by do-not-reply@jboss.org
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>
16 years, 1 month
exo-jcr SVN: r2101 - in kernel/trunk/exo.kernel.container/src: test/java/org/exoplatform/container/definition and 1 other directory.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2010-03-23 07:47:17 -0400 (Tue, 23 Mar 2010)
New Revision: 2101
Modified:
kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerConfig.java
kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/definition/TestPortalContainerConfig.java
Log:
EXOJCR-601: The default dependencies were not used by default for the scopes of the servlet contexts
Modified: kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerConfig.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerConfig.java 2010-03-23 09:56:17 UTC (rev 2100)
+++ kernel/trunk/exo.kernel.container/src/main/java/org/exoplatform/container/definition/PortalContainerConfig.java 2010-03-23 11:47:17 UTC (rev 2101)
@@ -583,7 +583,7 @@
dependencies = defaultDefinition.getDependencies();
if (dependencies == null || dependencies.isEmpty())
{
- return;
+ return;
}
}
for (String context : dependencies)
@@ -960,6 +960,13 @@
}
initializeSettings(definition, true);
}
+ if (!mDefinitions.containsKey(defaultDefinition.getName()) && defaultDefinition.getDependencies() != null
+ && !defaultDefinition.getDependencies().isEmpty())
+ {
+ // The default portal container has not been defined and some default
+ // dependencies have been defined
+ registerDependencies(defaultDefinition, mScopes);
+ }
this.portalContainerNames = Collections.unmodifiableList(lPortalContainerNames);
this.scopes = Collections.unmodifiableMap(mScopes);
}
Modified: kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/definition/TestPortalContainerConfig.java
===================================================================
--- kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/definition/TestPortalContainerConfig.java 2010-03-23 09:56:17 UTC (rev 2100)
+++ kernel/trunk/exo.kernel.container/src/test/java/org/exoplatform/container/definition/TestPortalContainerConfig.java 2010-03-23 11:47:17 UTC (rev 2101)
@@ -196,8 +196,14 @@
assertTrue(deps != null && deps.size() == 1 && deps.contains("fooX"));
deps = config.getDependencies("myPortal-pcdef");
assertTrue(deps != null && deps.size() == 1 && deps.contains("fooX"));
+ names = config.getPortalContainerNames("fooX");
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals(2, names.size());
+ assertTrue(names.contains("myPortal-dpcdef"));
+ assertTrue(names.contains("myPortal-pcdef"));
names = config.getPortalContainerNames("foo");
assertTrue(names != null && !names.isEmpty());
+ assertEquals(1, names.size());
assertEquals("myPortal-dpcdef", names.get(0));
names = config.getPortalContainerNames("myPortal");
assertTrue(names != null && !names.isEmpty());
@@ -264,8 +270,13 @@
assertTrue(deps != null && deps.size() == 1 && deps.contains("fooX"));
deps = config.getDependencies("myPortal-pcdef");
assertTrue(deps != null && deps.size() == 3);
+ names = config.getPortalContainerNames("fooX");
+ assertTrue(names != null && !names.isEmpty());
+ assertEquals(1, names.size());
+ assertEquals("myPortal", names.get(0));
names = config.getPortalContainerNames("foo");
assertTrue(names != null && !names.isEmpty());
+ assertEquals(1, names.size());
assertEquals("myPortal-pcdef", names.get(0));
names = config.getPortalContainerNames("myPortal");
assertTrue(names != null && !names.isEmpty());
16 years, 1 month
exo-jcr SVN: r2100 - core/trunk/exo.core.component.organization.ldap/src/main/java/org/exoplatform/services/organization/ldap.
by do-not-reply@jboss.org
Author: tolusha
Date: 2010-03-23 05:56:17 -0400 (Tue, 23 Mar 2010)
New Revision: 2100
Modified:
core/trunk/exo.core.component.organization.ldap/src/main/java/org/exoplatform/services/organization/ldap/UserDAOImpl.java
Log:
EXOJCR-602: impossible to change user password
Modified: core/trunk/exo.core.component.organization.ldap/src/main/java/org/exoplatform/services/organization/ldap/UserDAOImpl.java
===================================================================
--- core/trunk/exo.core.component.organization.ldap/src/main/java/org/exoplatform/services/organization/ldap/UserDAOImpl.java 2010-03-23 09:16:29 UTC (rev 2099)
+++ core/trunk/exo.core.component.organization.ldap/src/main/java/org/exoplatform/services/organization/ldap/UserDAOImpl.java 2010-03-23 09:56:17 UTC (rev 2100)
@@ -127,6 +127,7 @@
{
LdapContext ctx = ldapService.getLdapContext();
String userDN = null;
+ User existingUser = null;
try
{
for (int err = 0;; err++)
@@ -136,7 +137,7 @@
userDN = getDNFromUsername(ctx, user.getUserName());
if (userDN == null)
return;
- User existingUser = getUserFromUsername(ctx, user.getUserName());
+ existingUser = getUserFromUsername(ctx, user.getUserName());
ModificationItem[] mods = createUserModification(user, existingUser);
if (broadcast)
preSave(user, false);
@@ -159,8 +160,10 @@
ldapService.release(ctx);
}
// TODO really need this ?
- if (!user.getPassword().equals("PASSWORD"))
+ if (existingUser != null && (!user.getPassword().equals(existingUser.getPassword())))
+ {
saveUserPassword(user, userDN);
+ }
}
/**
@@ -272,11 +275,11 @@
public LazyPageList<User> findUsersByGroup(String groupId) throws Exception
{
return new LazyPageList<User>(findUsersByGroupId(groupId), 10);
- }
+ }
- /**
- * {@inheritDoc}
- */
+ /**
+ * {@inheritDoc}
+ */
public ListAccess<User> findUsersByGroupId(String groupId) throws Exception
{
// ArrayList<User> users = new ArrayList<User>();
@@ -334,9 +337,9 @@
return new LazyPageList<User>(findAllUsers(), 10);
}
- /**
- * {@inheritDoc}
- */
+ /**
+ * {@inheritDoc}
+ */
public ListAccess<User> findAllUsers() throws Exception
{
String searchBase = ldapAttrMapping.userURL;
16 years, 1 month
exo-jcr SVN: r2099 - core/trunk.
by do-not-reply@jboss.org
Author: tolusha
Date: 2010-03-23 05:16:29 -0400 (Tue, 23 Mar 2010)
New Revision: 2099
Removed:
core/trunk/docs/
Modified:
core/trunk/pom.xml
Log:
EXOJCR-573: move docbook to JCR
Modified: core/trunk/pom.xml
===================================================================
--- core/trunk/pom.xml 2010-03-23 09:14:58 UTC (rev 2098)
+++ core/trunk/pom.xml 2010-03-23 09:16:29 UTC (rev 2099)
@@ -40,7 +40,6 @@
<org.exoplatform.framework.junit.version>1.2.2-GA-SNAPSHOT</org.exoplatform.framework.junit.version>
<org.exoplatform.kernel.version>2.2.1-GA-SNAPSHOT</org.exoplatform.kernel.version>
- <org.exoplatform.doc-style.version>2-SNAPSHOT</org.exoplatform.doc-style.version>
</properties>
<scm>
16 years, 1 month
exo-jcr SVN: r2098 - kernel/trunk.
by do-not-reply@jboss.org
Author: tolusha
Date: 2010-03-23 05:14:58 -0400 (Tue, 23 Mar 2010)
New Revision: 2098
Removed:
kernel/trunk/docs/
Modified:
kernel/trunk/pom.xml
Log:
EXOJCR-573: move docbook to JCR
Modified: kernel/trunk/pom.xml
===================================================================
--- kernel/trunk/pom.xml 2010-03-23 07:23:36 UTC (rev 2097)
+++ kernel/trunk/pom.xml 2010-03-23 09:14:58 UTC (rev 2098)
@@ -39,7 +39,6 @@
<exo.product.name>exo-kernel</exo.product.name>
<exo.product.specification>2.2</exo.product.specification>
<org.exoplatform.framework.junit.version>1.2.2-GA-SNAPSHOT</org.exoplatform.framework.junit.version>
- <org.exoplatform.doc-style.version>2-SNAPSHOT</org.exoplatform.doc-style.version>
<forkMode>always</forkMode>
</properties>
16 years, 1 month