exo-jcr SVN: r5249 - jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-11-30 09:02:46 -0500 (Wed, 30 Nov 2011)
New Revision: 5249
Modified:
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/multi-db-schema-support.xml
Log:
EXOJCR-1648: fix doc
Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/multi-db-schema-support.xml
===================================================================
--- jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/multi-db-schema-support.xml 2011-11-30 13:26:02 UTC (rev 5248)
+++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/multi-db-schema-support.xml 2011-11-30 14:02:46 UTC (rev 5249)
@@ -4,24 +4,28 @@
<chapter id="JCR.RESTServicesOnGroovy">
<?dbhtml filename="multi-db-schema-support.html"?>
- <title>JBossCache configuration for Multi DB Schema support</title>
+ <title>How to host several JCR instances on the same database
+ instance?</title>
<section>
<title>Concepts</title>
- <para>This feature allows us to use the same database instance for several
- JCR instances just by using different schemas/users. It is possible
- because database queries are to be launched in the scope of current
- schema.</para>
+ <para>Frequently a single database instance must be shared by several
+ other applications. But some of our customers have also asked for a way to
+ host several JCR instances in the same database instance. To fulfill this
+ need, we had to review our queries and scope them to the current schema;
+ it’s now possible to have one JCR instance per DB schema instead of per DB
+ instance. To benefit of the work done for this feature you will need to
+ apply the configuration changes described in the next sections. </para>
</section>
<section>
<title>LockManager configuration</title>
- <para>To enable the feature you need to mention
- org.exoplatform.services.jcr.impl.core.lock.jbosscache.JDBCCacheLoader
- instead of org.jboss.cache.loader.JDBCCacheLoader in JBossCache
- configuration file.</para>
+ <para>To enable this feature you need to replace
+ org.jboss.cache.loader.JDBCCacheLoader with
+ org.exoplatform.services.jcr.impl.core.lock.jbosscache.JDBCCacheLoader in
+ JBossCache configuration file.</para>
<para>Here is an example of this very part of the configuration:</para>
@@ -69,9 +73,10 @@
<section>
<title>HibernateService configuration</title>
- <para>If you use HibernateService for JDBC connections management you also
- may specify default schema by setting "hibernate.default_schema" property
- in the configuration of HibernateService. </para>
+ <para>If you use HibernateService for JDBC connections management you will
+ need to specify explicitly the default schema by setting
+ "hibernate.default_schema" property in the configuration of
+ HibernateService.</para>
<para>Here is an example:</para>
12 years, 4 months
exo-jcr SVN: r5248 - in core/trunk: exo.core.component.organization.jdbc/src/test/resources/conf/standalone and 1 other directories.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-11-30 08:26:02 -0500 (Wed, 30 Nov 2011)
New Revision: 5248
Added:
core/trunk/exo.core.component.organization.tests/src/main/java/org/exoplatform/services/tck/organization/TestGroupListener.java
Modified:
core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/hibernate/GroupDAOImpl.java
core/trunk/exo.core.component.organization.jdbc/src/test/resources/conf/standalone/test-configuration-hibernate.xml
Log:
EXOJCR-1650: Organization Service - open session after preSave()
Modified: core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/hibernate/GroupDAOImpl.java
===================================================================
--- core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/hibernate/GroupDAOImpl.java 2011-11-30 11:57:30 UTC (rev 5247)
+++ core/trunk/exo.core.component.organization.jdbc/src/main/java/org/exoplatform/services/organization/hibernate/GroupDAOImpl.java 2011-11-30 13:26:02 UTC (rev 5248)
@@ -114,12 +114,16 @@
*/
public void addChild(Group parent, Group child, boolean broadcast) throws Exception
{
- Session session = service_.openSession();
String groupId = "/" + child.getGroupName();
GroupImpl childImpl = (GroupImpl)child;
if (parent != null)
{
- Group parentGroup = (Group)session.get(GroupImpl.class, parent.getId());
+ Group parentGroup = findGroupById(parent.getId());
+ if (parentGroup == null)
+ {
+ throw new InvalidNameException("Can't add node to not existed parent " + parent.getId());
+ }
+
groupId = parentGroup.getId() + "/" + child.getGroupName();
childImpl.setParentId(parentGroup.getId());
}
@@ -127,7 +131,8 @@
{
groupId = child.getId();
}
- Object o = session.get(GroupImpl.class, groupId);
+
+ Object o = findGroupById(groupId);
if (o != null)
{
Object[] args = {child.getGroupName()};
@@ -138,13 +143,14 @@
if (broadcast)
preSave(child, true);
+ Session session = service_.openSession();
session.save(childImpl);
session.flush();
if (broadcast)
postSave(child, true);
}
-
+
/**
* {@inheritDoc}
*/
Modified: core/trunk/exo.core.component.organization.jdbc/src/test/resources/conf/standalone/test-configuration-hibernate.xml
===================================================================
--- core/trunk/exo.core.component.organization.jdbc/src/test/resources/conf/standalone/test-configuration-hibernate.xml 2011-11-30 11:57:30 UTC (rev 5247)
+++ core/trunk/exo.core.component.organization.jdbc/src/test/resources/conf/standalone/test-configuration-hibernate.xml 2011-11-30 13:26:02 UTC (rev 5248)
@@ -92,8 +92,15 @@
<type>org.exoplatform.services.organization.MembershipTypeEventListener</type>
<description>Membership type listerner for testing purpose</description>
</component-plugin>
+ <component-plugin>
+ <name>init.service.listener</name>
+ <set-method>addListenerPlugin</set-method>
+ <type>org.exoplatform.services.tck.organization.TestGroupListener</type>
+ <description>this listener populate organization data for the first launch</description>
+ </component-plugin>
</external-component-plugins>
+
<!-- org service initializer, copied from ECM portal.war -->
<external-component-plugins>
<target-component>org.exoplatform.services.organization.OrganizationService</target-component>
Added: core/trunk/exo.core.component.organization.tests/src/main/java/org/exoplatform/services/tck/organization/TestGroupListener.java
===================================================================
--- core/trunk/exo.core.component.organization.tests/src/main/java/org/exoplatform/services/tck/organization/TestGroupListener.java (rev 0)
+++ core/trunk/exo.core.component.organization.tests/src/main/java/org/exoplatform/services/tck/organization/TestGroupListener.java 2011-11-30 13:26:02 UTC (rev 5248)
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2011 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.exoplatform.services.tck.organization;
+
+import org.exoplatform.container.StandaloneContainer;
+import org.exoplatform.container.component.RequestLifeCycle;
+import org.exoplatform.services.organization.Group;
+import org.exoplatform.services.organization.GroupEventListener;
+
+/**
+ * @author <a href="abazko(a)exoplatform.com">Anatoliy Bazko</a>
+ * @version $Id: TestListener.java 34360 2009-07-22 23:58:59Z tolusha $
+ */
+public class TestGroupListener extends GroupEventListener
+{
+
+ public void preSave(Group group, boolean isNew) throws Exception
+ {
+ RequestLifeCycle.begin(StandaloneContainer.getInstance());
+ RequestLifeCycle.end();
+ }
+}
12 years, 4 months
exo-jcr SVN: r5247 - jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-11-30 06:57:30 -0500 (Wed, 30 Nov 2011)
New Revision: 5247
Modified:
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestGetNodesLazily.java
Log:
EXOJCR-1654: add test
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestGetNodesLazily.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestGetNodesLazily.java 2011-11-30 11:28:27 UTC (rev 5246)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestGetNodesLazily.java 2011-11-30 11:57:30 UTC (rev 5247)
@@ -370,6 +370,25 @@
catch (NoSuchElementException e)
{
}
+
+ // remove nodes from 31..60 to make gap in interval of order numbers
+ iterator = testRoot.getNodesLazily();
+ iterator.skip(30);
+ for (int i = 0; i < 30; i++)
+ {
+ ((NodeImpl)iterator.next()).remove();
+ }
+ testRoot.save();
+
+ iterator = testRoot.getNodesLazily(10);
+ size = 0;
+ while (iterator.hasNext())
+ {
+ size++;
+ iterator.next();
+ }
+
+ assertEquals(320, size);
}
//=============== stuff ===============
12 years, 4 months
exo-jcr SVN: r5246 - in jcr/trunk/exo.jcr.component.core/src: main/java/org/exoplatform/services/jcr/impl/core and 13 other directories.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-11-30 06:28:27 -0500 (Wed, 30 Nov 2011)
New Revision: 5246
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/ItemDataConsumer.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/TransactionChangesLog.java
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/SessionDataManager.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/ACLInheritanceSupportedWorkspaceDataManager.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/ShareableSupportedWorkspaceDataManager.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/VersionableWorkspaceDataManager.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/LocalWorkspaceStorageDataManagerProxy.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/TransactionableDataManager.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/inmemory/InmemoryStorageConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/statistics/StatisticsJDBCStorageConnection.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/storage/WorkspaceStorageConnection.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/BaseStandaloneTest.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestGetNodesLazily.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestCacheableWorkspaceDataManager.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestWorkspaceStorageCacheInClusterMode.java
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/cache/jbosscache/TestJBossCacheWorkspaceStorageCache.java
Log:
EXOJCR-1654: get rid of setMaxRows in the query
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/ItemDataConsumer.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/ItemDataConsumer.java 2011-11-30 10:16:17 UTC (rev 5245)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/ItemDataConsumer.java 2011-11-30 11:28:27 UTC (rev 5246)
@@ -110,14 +110,16 @@
* @param parent
* the parent data
* @param fromOrderNum
- * the last order number returned in previous request
- * @param limit
- * the recommended amount of children nodes to return
+ * the returned list of child nodes should not contain the node with order number
+ * less than <code>fromOrderNum</code>
+ * @param toOrderNum
+ * the returned list of child nodes should not contain the node with order number
+ * more than <code>toOrderNum</code>
* @param childs
- * will contain the resulted children nodes
+ * will contain the resulted child nodes
* @return true if there are data to retrieve for next request and false in other case
*/
- boolean getChildNodesDataByPage(NodeData parent, int fromOrderNum, int limit, List<NodeData> childs)
+ boolean getChildNodesDataByPage(NodeData parent, int fromOrderNum, int toOrderNum, List<NodeData> childs)
throws RepositoryException;
/**
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/TransactionChangesLog.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/TransactionChangesLog.java 2011-11-30 10:16:17 UTC (rev 5245)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/TransactionChangesLog.java 2011-11-30 11:28:27 UTC (rev 5246)
@@ -168,7 +168,9 @@
{
ItemData item = state.getData();
if (item.getParentIdentifier().equals(rootIdentifier) && item.isNode() == forNodes)
+ {
list.add(state);
+ }
}
return list;
}
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 2011-11-30 10:16:17 UTC (rev 5245)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/NodeImpl.java 2011-11-30 11:28:27 UTC (rev 5246)
@@ -3515,7 +3515,10 @@
{
private final SessionDataManager dataManager;
- private final int limit;
+ /**
+ * The approximate count of the nodes which can be retrieved from storage by request.
+ */
+ private final int pageSize;
private int fromOrderNum = 0;
@@ -3523,6 +3526,9 @@
private int pos = 0;
+ /**
+ * The count of child nodes. Calculated only once when asked.
+ */
private int size = -1;
private LazyNodeIterator lazyNodeItetator = new LazyNodeIterator(new ArrayList<NodeData>());
@@ -3532,10 +3538,10 @@
this(dataManager, session.getLazyNodeIteratorPageSize());
}
- LazyNodeIteratorByPage(SessionDataManager dataManager, int limit) throws RepositoryException
+ LazyNodeIteratorByPage(SessionDataManager dataManager, int pageSize) throws RepositoryException
{
this.dataManager = dataManager;
- this.limit = limit;
+ this.pageSize = pageSize;
}
/**
@@ -3622,11 +3628,21 @@
public void skip(long skipNum)
{
pos += skipNum;
- long leftToSkip = lazyNodeItetator.trySkip(skipNum, false);
- if (leftToSkip != 0)
+
+ // iterator is empty, no need to invoke trySkip() method since it returns
+ // decreased by 1 the skipNum parameter
+ if (!lazyNodeItetator.hasNext())
{
- readNextPage(leftToSkip + 1);
+ readNextPage(skipNum);
}
+ else
+ {
+ long leftToSkip = lazyNodeItetator.trySkip(skipNum, false);
+ if (leftToSkip != 0)
+ {
+ readNextPage(leftToSkip);
+ }
+ }
}
/**
@@ -3669,7 +3685,8 @@
List<NodeData> storedNodes = new ArrayList<NodeData>();
try
{
- hasNext = dataManager.getChildNodesDataByPage(nodeData(), fromOrderNum, limit, storedNodes);
+ hasNext =
+ dataManager.getChildNodesDataByPage(nodeData(), fromOrderNum, fromOrderNum + pageSize - 1, storedNodes);
}
catch (RepositoryException e)
{
@@ -3681,7 +3698,7 @@
int size = storedNodes.size();
- fromOrderNum = size == 0 ? fromOrderNum + limit : storedNodes.get(size - 1).getOrderNumber() + 1;
+ fromOrderNum = size == 0 ? fromOrderNum + pageSize : storedNodes.get(size - 1).getOrderNumber() + 1;
// skip some nodes
if (size != 0)
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionDataManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionDataManager.java 2011-11-30 10:16:17 UTC (rev 5245)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/SessionDataManager.java 2011-11-30 11:28:27 UTC (rev 5246)
@@ -991,7 +991,7 @@
/**
* {@inheritDoc}
*/
- public boolean getChildNodesDataByPage(final NodeData parent, int fromOrderNum, int limit, List<NodeData> childs)
+ public boolean getChildNodesDataByPage(final NodeData parent, int fromOrderNum, int toOrderNum, List<NodeData> childs)
throws RepositoryException
{
long start = 0;
@@ -1006,7 +1006,7 @@
boolean hasNext = false;
if (!isNew(parent.getIdentifier()))
{
- hasNext = transactionableManager.getChildNodesDataByPage(parent, fromOrderNum, limit, childs);
+ hasNext = transactionableManager.getChildNodesDataByPage(parent, fromOrderNum, toOrderNum, childs);
}
// merge data
@@ -1022,7 +1022,7 @@
descendants.put(childNode.getIdentifier(), childNode);
}
- int minOrderNum = childs.size() != 0 ? childs.get(0).getOrderNumber() :-1;
+ int minOrderNum = childs.size() != 0 ? childs.get(0).getOrderNumber() : -1;
int maxOrderNum = childs.size() != 0 ? childs.get(childs.size() - 1).getOrderNumber() : -1;
// merge data
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/ACLInheritanceSupportedWorkspaceDataManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/ACLInheritanceSupportedWorkspaceDataManager.java 2011-11-30 10:16:17 UTC (rev 5245)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/ACLInheritanceSupportedWorkspaceDataManager.java 2011-11-30 11:28:27 UTC (rev 5246)
@@ -73,10 +73,10 @@
/**
* {@inheritDoc}
*/
- public boolean getChildNodesDataByPage(NodeData parent, int fromOrderNum, int limit, List<NodeData> childs)
+ public boolean getChildNodesDataByPage(NodeData parent, int fromOrderNum, int toOrderNum, List<NodeData> childs)
throws RepositoryException
{
- return persistentManager.getChildNodesDataByPage(parent, fromOrderNum, limit, childs);
+ return persistentManager.getChildNodesDataByPage(parent, fromOrderNum, toOrderNum, childs);
}
/**
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2011-11-30 10:16:17 UTC (rev 5245)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2011-11-30 11:28:27 UTC (rev 5246)
@@ -594,7 +594,7 @@
/**
* {@inheritDoc}
*/
- public boolean getChildNodesDataByPage(final NodeData nodeData, final int fromOrderNum, final int limit,
+ public boolean getChildNodesDataByPage(final NodeData nodeData, final int fromOrderNum, final int toOrderNum,
final List<NodeData> childs) throws RepositoryException
{
// if child nodes lazy iteration feature not supported by cache
@@ -655,7 +655,8 @@
public Boolean run() throws RepositoryException
{
boolean hasNext =
- CacheableWorkspaceDataManager.super.getChildNodesDataByPage(nodeData, fromOrderNum, limit, childs);
+ CacheableWorkspaceDataManager.super.getChildNodesDataByPage(nodeData, fromOrderNum, toOrderNum,
+ childs);
if (cache.isEnabled())
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/ShareableSupportedWorkspaceDataManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/ShareableSupportedWorkspaceDataManager.java 2011-11-30 10:16:17 UTC (rev 5245)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/ShareableSupportedWorkspaceDataManager.java 2011-11-30 11:28:27 UTC (rev 5246)
@@ -73,10 +73,10 @@
/**
* {@inheritDoc}
*/
- public boolean getChildNodesDataByPage(NodeData parent, int fromOrderNum, int limit, List<NodeData> childs)
+ public boolean getChildNodesDataByPage(NodeData parent, int fromOrderNum, int toOrderNum, List<NodeData> childs)
throws RepositoryException
{
- return persistentManager.getChildNodesDataByPage(parent, fromOrderNum, limit, childs);
+ return persistentManager.getChildNodesDataByPage(parent, fromOrderNum, toOrderNum, childs);
}
/**
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/VersionableWorkspaceDataManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/VersionableWorkspaceDataManager.java 2011-11-30 10:16:17 UTC (rev 5245)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/VersionableWorkspaceDataManager.java 2011-11-30 11:28:27 UTC (rev 5246)
@@ -91,14 +91,14 @@
* {@inheritDoc}
*/
@Override
- public boolean getChildNodesDataByPage(NodeData nodeData, int fromOrderNum, int limit, List<NodeData> childs)
+ public boolean getChildNodesDataByPage(NodeData nodeData, int fromOrderNum, int toOrderNum, List<NodeData> childs)
throws RepositoryException
{
if (isSystemDescendant(nodeData.getQPath()) && !this.equals(versionDataManager))
{
- return versionDataManager.getChildNodesDataByPage(nodeData, fromOrderNum, limit, childs);
+ return versionDataManager.getChildNodesDataByPage(nodeData, fromOrderNum, toOrderNum, childs);
}
- return super.getChildNodesDataByPage(nodeData, fromOrderNum, limit, childs);
+ return super.getChildNodesDataByPage(nodeData, fromOrderNum, toOrderNum, childs);
}
/**
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 2011-11-30 10:16:17 UTC (rev 5245)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 2011-11-30 11:28:27 UTC (rev 5246)
@@ -629,13 +629,13 @@
/**
* {@inheritDoc}
*/
- public boolean getChildNodesDataByPage(final NodeData nodeData, int fromOrderNum, int limit,
+ public boolean getChildNodesDataByPage(final NodeData nodeData, int fromOrderNum, int toOrderNum,
List<NodeData> childNodes) throws RepositoryException
{
final WorkspaceStorageConnection con = dataContainer.openConnection();
try
{
- return con.getChildNodesDataByPage(nodeData, fromOrderNum, limit, childNodes);
+ return con.getChildNodesDataByPage(nodeData, fromOrderNum, toOrderNum, childNodes);
}
finally
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/LocalWorkspaceStorageDataManagerProxy.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/LocalWorkspaceStorageDataManagerProxy.java 2011-11-30 10:16:17 UTC (rev 5245)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/LocalWorkspaceStorageDataManagerProxy.java 2011-11-30 11:28:27 UTC (rev 5246)
@@ -154,10 +154,10 @@
/**
* {@inheritDoc}
*/
- public boolean getChildNodesDataByPage(NodeData parent, int fromOrderNum, int limit, List<NodeData> childs)
+ public boolean getChildNodesDataByPage(NodeData parent, int fromOrderNum, int toOrderNum, List<NodeData> childs)
throws RepositoryException
{
- return storageDataManager.getChildNodesDataByPage(parent, fromOrderNum, limit, copyNodes(childs));
+ return storageDataManager.getChildNodesDataByPage(parent, fromOrderNum, toOrderNum, copyNodes(childs));
}
/**
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/TransactionableDataManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/TransactionableDataManager.java 2011-11-30 10:16:17 UTC (rev 5245)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/TransactionableDataManager.java 2011-11-30 11:28:27 UTC (rev 5246)
@@ -105,10 +105,10 @@
/**
* {@inheritDoc}
*/
- public boolean getChildNodesDataByPage(final NodeData parent, int fromOrderNum, int limit, List<NodeData> childs)
+ public boolean getChildNodesDataByPage(final NodeData parent, int fromOrderNum, int toOrderNum, List<NodeData> childs)
throws RepositoryException
{
- boolean hasNext = storageDataManager.getChildNodesDataByPage(parent, fromOrderNum, limit, childs);
+ boolean hasNext = storageDataManager.getChildNodesDataByPage(parent, fromOrderNum, toOrderNum, childs);
if (txStarted())
{
@@ -116,10 +116,9 @@
List<ItemState> txChanges = transactionLog.getChildrenChanges(parent.getIdentifier(), true);
if (txChanges.size() > 0)
{
-
- int minOrderNum = childs.size() != 0 ? childs.get(0).getOrderNumber() :-1;
+ int minOrderNum = childs.size() != 0 ? childs.get(0).getOrderNumber() : -1;
int maxOrderNum = childs.size() != 0 ? childs.get(childs.size() - 1).getOrderNumber() : -1;
-
+
for (ItemState state : txChanges)
{
NodeData data = (NodeData)state.getData();
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/inmemory/InmemoryStorageConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/inmemory/InmemoryStorageConnection.java 2011-11-30 10:16:17 UTC (rev 5245)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/inmemory/InmemoryStorageConnection.java 2011-11-30 11:28:27 UTC (rev 5246)
@@ -362,7 +362,7 @@
/**
* {@inheritDoc}
*/
- public boolean getChildNodesDataByPage(NodeData parent, int fromOrderNum, int limit, List<NodeData> childs)
+ public boolean getChildNodesDataByPage(NodeData parent, int fromOrderNum, int toOrderNum, List<NodeData> childs)
throws RepositoryException
{
throw new UnsupportedOperationException(
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2011-11-30 10:16:17 UTC (rev 5245)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2011-11-30 11:28:27 UTC (rev 5246)
@@ -1187,7 +1187,7 @@
* @throws RepositoryException
* @throws IllegalStateException
*/
- public boolean getChildNodesDataByPage(NodeData parent, int fromOrderNum, int limit, List<NodeData> childNodes)
+ public boolean getChildNodesDataByPage(NodeData parent, int fromOrderNum, int toOrderNum, List<NodeData> childNodes)
throws RepositoryException, IllegalStateException
{
// not supported by non-CQ deprecated JDBC container
@@ -2928,7 +2928,7 @@
protected abstract ResultSet findNodesAndProperties(String lastNodeId, int offset, int limit) throws SQLException;
- protected abstract ResultSet findChildNodesByParentIdentifier(String parentCid, int fromOrderNum, int limit)
+ protected abstract ResultSet findChildNodesByParentIdentifier(String parentCid, int fromOrderNum, int toOrderNum)
throws SQLException;
protected abstract int addReference(PropertyData data) throws SQLException, IOException;
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java 2011-11-30 10:16:17 UTC (rev 5245)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java 2011-11-30 11:28:27 UTC (rev 5246)
@@ -422,7 +422,7 @@
/**
* {@inheritDoc}
*/
- protected ResultSet findChildNodesByParentIdentifier(String parentCid, int lastOrderNum, int limit)
+ protected ResultSet findChildNodesByParentIdentifier(String parentCid, int fromOrderNum, int toOrderNum)
throws SQLException
{
throw new UnsupportedOperationException("findChildNodesByParentIdentifier is not supported for old queries");
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2011-11-30 10:16:17 UTC (rev 5245)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2011-11-30 11:28:27 UTC (rev 5246)
@@ -436,7 +436,7 @@
/**
* {@inheritDoc}
*/
- protected ResultSet findChildNodesByParentIdentifier(String parentCid, int lastOrderNum, int limit)
+ protected ResultSet findChildNodesByParentIdentifier(String parentCid, int fromOrderNum, int toOrderNum)
throws SQLException
{
throw new UnsupportedOperationException("findChildNodesByParentIdentifier is not supported for old queries");
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java 2011-11-30 10:16:17 UTC (rev 5245)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/CQJDBCStorageConnection.java 2011-11-30 11:28:27 UTC (rev 5246)
@@ -388,23 +388,17 @@
* {@inheritDoc}
*/
@Override
- public boolean getChildNodesDataByPage(NodeData parent, int fromOrderNum, int limit, List<NodeData> childNodes)
+ public boolean getChildNodesDataByPage(NodeData parent, int fromOrderNum, int toOrderNum, List<NodeData> childNodes)
throws RepositoryException, IllegalStateException
{
checkIfOpened();
ResultSet resultSet = null;
try
{
- // query will return nodes and properties in same result set
- // last node can be incomplete, so reading one more ahead, to be sure returning
- // at least "limit" nodes.
- int rowsLimit = (limit + 1) * 4;
- resultSet = findChildNodesByParentIdentifier(getInternalId(parent.getIdentifier()), fromOrderNum, rowsLimit);
+ resultSet = findChildNodesByParentIdentifier(getInternalId(parent.getIdentifier()), fromOrderNum, toOrderNum);
TempNodeData data = null;
- int resultSetSize = 0;
while (resultSet.next())
{
- resultSetSize++;
if (data == null)
{
data = new TempNodeData(resultSet);
@@ -425,19 +419,14 @@
}
values.add(new TempPropertyData(resultSet));
}
- // last node can be incomplete, so removed
- boolean hasNext = resultSetSize == rowsLimit;
- if (!hasNext)
+
+ if (data != null)
{
- // the last one node
- if (data != null)
- {
- NodeData nodeData = loadNodeFromTemporaryNodeData(data, parent.getQPath(), parent.getACL());
- childNodes.add(nodeData);
- }
+ NodeData nodeData = loadNodeFromTemporaryNodeData(data, parent.getQPath(), parent.getACL());
+ childNodes.add(nodeData);
}
- return hasNext;
+ return childNodes.size() != 0 ? true : getLastOrderNumber(parent) > toOrderNum;
}
catch (SQLException e)
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java 2011-11-30 10:16:17 UTC (rev 5245)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java 2011-11-30 11:28:27 UTC (rev 5246)
@@ -212,7 +212,7 @@
FIND_NODES_BY_PARENTID_LAZILY_CQ =
"select I.*, P.NAME AS PROP_NAME, V.ORDER_NUM, V.DATA from JCR_MITEM I, JCR_MITEM P, JCR_MVALUE V"
- + " where I.I_CLASS=1 and I.PARENT_ID=? and I.N_ORDER_NUM >= ? and"
+ + " where I.I_CLASS=1 and I.PARENT_ID=? and I.N_ORDER_NUM >= ? and I.N_ORDER_NUM <= ? and"
+ " P.I_CLASS=2 and P.PARENT_ID=I.ID and (P.NAME='[http://www.jcp.org/jcr/1.0]primaryType' or"
+ " P.NAME='[http://www.jcp.org/jcr/1.0]mixinTypes' or"
+ " P.NAME='[http://www.exoplatform.com/jcr/exo/1.0]owner' or"
@@ -645,7 +645,7 @@
/**
* {@inheritDoc}
*/
- protected ResultSet findChildNodesByParentIdentifier(String parentCid, int fromOrderNum, int limit)
+ protected ResultSet findChildNodesByParentIdentifier(String parentCid, int fromOrderNum, int toOrderNum)
throws SQLException
{
if (findNodesByParentIdLazilyCQ == null)
@@ -659,7 +659,7 @@
findNodesByParentIdLazilyCQ.setString(1, parentCid);
findNodesByParentIdLazilyCQ.setInt(2, fromOrderNum);
- findNodesByParentIdLazilyCQ.setMaxRows(limit);
+ findNodesByParentIdLazilyCQ.setInt(3, toOrderNum);
return findNodesByParentIdLazilyCQ.executeQuery();
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java 2011-11-30 10:16:17 UTC (rev 5245)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java 2011-11-30 11:28:27 UTC (rev 5246)
@@ -217,7 +217,7 @@
FIND_NODES_BY_PARENTID_LAZILY_CQ =
"select I.*, P.NAME AS PROP_NAME, V.ORDER_NUM, V.DATA from JCR_SITEM I, JCR_SITEM P, JCR_SVALUE V"
+ " where I.I_CLASS=1 and I.CONTAINER_NAME=? and I.PARENT_ID=? and I.N_ORDER_NUM >= ? and "
- + " P.I_CLASS=2 and P.CONTAINER_NAME=? and P.PARENT_ID=I.ID and"
+ + " I.N_ORDER_NUM <= ? and P.I_CLASS=2 and P.CONTAINER_NAME=? and P.PARENT_ID=I.ID and"
+ " (P.NAME='[http://www.jcp.org/jcr/1.0]primaryType' or"
+ " P.NAME='[http://www.jcp.org/jcr/1.0]mixinTypes' or"
+ " P.NAME='[http://www.exoplatform.com/jcr/exo/1.0]owner' or"
@@ -500,7 +500,7 @@
/**
* {@inheritDoc}
*/
- protected ResultSet findChildNodesByParentIdentifier(String parentCid, int fromOrderNum, int limit)
+ protected ResultSet findChildNodesByParentIdentifier(String parentCid, int fromOrderNum, int toOrderNum)
throws SQLException
{
if (findNodesByParentIdLazilyCQ == null)
@@ -511,8 +511,8 @@
findNodesByParentIdLazilyCQ.setString(1, containerName);
findNodesByParentIdLazilyCQ.setString(2, parentCid);
findNodesByParentIdLazilyCQ.setInt(3, fromOrderNum);
- findNodesByParentIdLazilyCQ.setString(4, containerName);
- findNodesByParentIdLazilyCQ.setMaxRows(limit);
+ findNodesByParentIdLazilyCQ.setInt(4, toOrderNum);
+ findNodesByParentIdLazilyCQ.setString(5, containerName);
return findNodesByParentIdLazilyCQ.executeQuery();
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/statistics/StatisticsJDBCStorageConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/statistics/StatisticsJDBCStorageConnection.java 2011-11-30 10:16:17 UTC (rev 5245)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/statistics/StatisticsJDBCStorageConnection.java 2011-11-30 11:28:27 UTC (rev 5246)
@@ -82,7 +82,7 @@
/**
* The description of the statistics corresponding to the method
* <code>getChildNodesDataByPage(NodeData nodeData, int fromOrderNum,
- * int limit, List<NodeData> childNodes)</code>
+ * int toOrderNum, List<NodeData> childNodes)</code>
*/
private static final String GET_CHILD_NODES_DATA_BY_PAGE_DESCR = "getChildNodesDataByPage";
@@ -593,14 +593,14 @@
/**
* {@inheritDoc}
*/
- public boolean getChildNodesDataByPage(NodeData parent, int fromOrderNum, int limit, List<NodeData> childs)
+ public boolean getChildNodesDataByPage(NodeData parent, int fromOrderNum, int toOrderNum, List<NodeData> childs)
throws RepositoryException
{
Statistics s = ALL_STATISTICS.get(GET_CHILD_NODES_DATA_BY_PAGE_DESCR);
try
{
s.begin();
- return wcs.getChildNodesDataByPage(parent, fromOrderNum, limit, childs);
+ return wcs.getChildNodesDataByPage(parent, fromOrderNum, toOrderNum, childs);
}
finally
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/storage/WorkspaceStorageConnection.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/storage/WorkspaceStorageConnection.java 2011-11-30 10:16:17 UTC (rev 5245)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/storage/WorkspaceStorageConnection.java 2011-11-30 11:28:27 UTC (rev 5246)
@@ -245,14 +245,16 @@
* @param parent
* the parent data
* @param fromOrderNum
- * the last order number returned in previous request
- * @param limit
- * the recommended amount of children nodes to return
+ * the returned list of child nodes should not contain the node with order number
+ * less than <code>fromOrderNum</code>
+ * @param toOrderNum
+ * the returned list of child nodes should not contain the node with order number
+ * more than <code>toOrderNum</code>
* @param childs
- * will contain the resulted children nodes
+ * will contain the resulted child nodes
* @return true if there are data to retrieve for next request and false in other case
*/
- boolean getChildNodesDataByPage(NodeData parent, int fromOrderNum, int limit, List<NodeData> childs)
+ boolean getChildNodesDataByPage(NodeData parent, int fromOrderNum, int toOrderNum, List<NodeData> childs)
throws RepositoryException;
/**
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/BaseStandaloneTest.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/BaseStandaloneTest.java 2011-11-30 10:16:17 UTC (rev 5245)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/BaseStandaloneTest.java 2011-11-30 11:28:27 UTC (rev 5246)
@@ -767,7 +767,7 @@
* @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnection#getChildNodesDataByPage(org.exoplatform.services.jcr.datamodel.NodeData, int, int, java.util.List)
*/
@Override
- public boolean getChildNodesDataByPage(NodeData parent, int fromOrderNum, int limit, List<NodeData> childs)
+ public boolean getChildNodesDataByPage(NodeData parent, int fromOrderNum, int toOrderNum, List<NodeData> childs)
throws RepositoryException
{
return false;
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestGetNodesLazily.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestGetNodesLazily.java 2011-11-30 10:16:17 UTC (rev 5245)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestGetNodesLazily.java 2011-11-30 11:28:27 UTC (rev 5246)
@@ -24,6 +24,8 @@
import org.exoplatform.services.jcr.impl.Constants;
import org.exoplatform.services.transaction.TransactionService;
+import java.util.NoSuchElementException;
+
import javax.jcr.Node;
import javax.jcr.NodeIterator;
import javax.jcr.RangeIterator;
@@ -87,7 +89,7 @@
session.save();
assertChildNodes(testRoot, nodesCount);
}
-
+
/**
* All child they reordered one by one and though must be returned in same order
*/
@@ -145,7 +147,7 @@
session.save();
nodesCount++;
-
+
String newNodeName = "child" + (nodesCount - 1);
session.move("/" + newNodeName, testRoot.getPath() + "/" + newNodeName);
@@ -355,6 +357,19 @@
next = (NodeImpl)iterator.next();
assertEquals(116, iterator.getPosition());
assertEquals(115, next.getProperty(INDEX_PROPERTY).getLong());
+
+ iterator = testRoot.getNodesLazily();
+ long size = iterator.getSize();
+ iterator.skip(size);
+
+ try
+ {
+ iterator.next();
+ fail("Exception should be thrown");
+ }
+ catch (NoSuchElementException e)
+ {
+ }
}
//=============== stuff ===============
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestCacheableWorkspaceDataManager.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestCacheableWorkspaceDataManager.java 2011-11-30 10:16:17 UTC (rev 5245)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestCacheableWorkspaceDataManager.java 2011-11-30 11:28:27 UTC (rev 5246)
@@ -624,7 +624,7 @@
return null;
}
- public boolean getChildNodesDataByPage(NodeData parent, int fromOrderNum, int limit, List<NodeData> childs)
+ public boolean getChildNodesDataByPage(NodeData parent, int fromOrderNum, int toOrderNum, List<NodeData> childs)
throws RepositoryException
{
return false;
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestWorkspaceStorageCacheInClusterMode.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestWorkspaceStorageCacheInClusterMode.java 2011-11-30 10:16:17 UTC (rev 5245)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestWorkspaceStorageCacheInClusterMode.java 2011-11-30 11:28:27 UTC (rev 5246)
@@ -962,7 +962,7 @@
return null;
}
- public boolean getChildNodesDataByPage(NodeData parent, int fromOrderNum, int limit, List<NodeData> childs)
+ public boolean getChildNodesDataByPage(NodeData parent, int fromOrderNum, int toOrderNum, List<NodeData> childs)
throws RepositoryException
{
return false;
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/cache/jbosscache/TestJBossCacheWorkspaceStorageCache.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/cache/jbosscache/TestJBossCacheWorkspaceStorageCache.java 2011-11-30 10:16:17 UTC (rev 5245)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/cache/jbosscache/TestJBossCacheWorkspaceStorageCache.java 2011-11-30 11:28:27 UTC (rev 5246)
@@ -326,7 +326,7 @@
return null;
}
- public boolean getChildNodesDataByPage(NodeData parent, int fromOrderNum, int limit, List<NodeData> childs)
+ public boolean getChildNodesDataByPage(NodeData parent, int fromOrderNum, int toOrderNum, List<NodeData> childs)
throws RepositoryException
{
return false;
12 years, 4 months
exo-jcr SVN: r5245 - in jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules: jcr/configuration and 1 other directory.
by do-not-reply@jboss.org
Author: dkuleshov
Date: 2011-11-30 05:16:17 -0500 (Wed, 30 Nov 2011)
New Revision: 5245
Added:
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/multi-db-schema-support.xml
Modified:
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr.xml
Log:
EXOJCR-1648: added doc
Added: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/multi-db-schema-support.xml
===================================================================
--- jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/multi-db-schema-support.xml (rev 0)
+++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/configuration/multi-db-schema-support.xml 2011-11-30 10:16:17 UTC (rev 5245)
@@ -0,0 +1,92 @@
+<?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.RESTServicesOnGroovy">
+ <?dbhtml filename="multi-db-schema-support.html"?>
+
+ <title>JBossCache configuration for Multi DB Schema support</title>
+
+ <section>
+ <title>Concepts</title>
+
+ <para>This feature allows us to use the same database instance for several
+ JCR instances just by using different schemas/users. It is possible
+ because database queries are to be launched in the scope of current
+ schema.</para>
+ </section>
+
+ <section>
+ <title>LockManager configuration</title>
+
+ <para>To enable the feature you need to mention
+ org.exoplatform.services.jcr.impl.core.lock.jbosscache.JDBCCacheLoader
+ instead of org.jboss.cache.loader.JDBCCacheLoader in JBossCache
+ configuration file.</para>
+
+ <para>Here is an example of this very part of the configuration:</para>
+
+ <programlisting language="xml"><jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:jboss:jbosscache-core:config:3.1">
+
+ <locking useLockStriping="false" concurrencyLevel="500" lockParentForChildInsertRemove="false"
+ lockAcquisitionTimeout="20000" />
+
+ <clustering mode="replication" clusterName="${jbosscache-cluster-name}">
+ <stateRetrieval timeout="20000" fetchInMemoryState="false" />
+ <sync />
+ </clustering>
+
+ <loaders passivation="false" shared="true">
+ <!-- All the data of the JCR locks needs to be loaded at startup -->
+ <preload>
+ <node fqn="/" />
+ </preload>
+ <!--
+ For another cache-loader class you should use another template with
+ cache-loader specific parameters
+ -->
+ <loader class=<emphasis role="bold">"org.exoplatform.services.jcr.impl.core.lock.jbosscache.JDBCCacheLoader"</emphasis> async="false" fetchPersistentState="false"
+ ignoreModifications="false" purgeOnStartup="false">
+ <properties>
+ cache.jdbc.table.name=${jbosscache-cl-cache.jdbc.table.name}
+ cache.jdbc.table.create=${jbosscache-cl-cache.jdbc.table.create}
+ cache.jdbc.table.drop=${jbosscache-cl-cache.jdbc.table.drop}
+ cache.jdbc.table.primarykey=${jbosscache-cl-cache.jdbc.table.primarykey}
+ cache.jdbc.fqn.column=${jbosscache-cl-cache.jdbc.fqn.column}
+ cache.jdbc.fqn.type=${jbosscache-cl-cache.jdbc.fqn.type}
+ cache.jdbc.node.column=${jbosscache-cl-cache.jdbc.node.column}
+ cache.jdbc.node.type=${jbosscache-cl-cache.jdbc.node.type}
+ cache.jdbc.parent.column=${jbosscache-cl-cache.jdbc.parent.column}
+ cache.jdbc.datasource=${jbosscache-cl-cache.jdbc.datasource}
+ </properties>
+ </loader>
+ </loaders>
+</jbosscache></programlisting>
+
+ <para>You can also obtain file exmaple from <ulink
+ url="http://svn.jboss.org/repos/exo-jcr/jcr/trunk/exo.jcr.component.core/src/t...">svn</ulink>.</para>
+ </section>
+
+ <section>
+ <title>HibernateService configuration</title>
+
+ <para>If you use HibernateService for JDBC connections management you also
+ may specify default schema by setting "hibernate.default_schema" property
+ in the configuration of HibernateService. </para>
+
+ <para>Here is an example:</para>
+
+ <programlisting language="xml"><component>
+ <key>org.exoplatform.services.database.HibernateService</key>
+ <jmx-name>database:type=HibernateService</jmx-name>
+ <type>org.exoplatform.services.database.impl.HibernateServiceImpl</type>
+ <init-params>
+ <properties-param>
+ <name>hibernate.properties</name>
+ <description>Default Hibernate Service</description>
+ ...........
+ <emphasis role="bold"><property name="hibernate.default_schema" value="${gatein.idm.datasource.schema:}"/></emphasis>
+ </properties-param>
+ </init-params>
+</component></programlisting>
+ </section>
+</chapter>
Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr.xml
===================================================================
--- jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr.xml 2011-11-30 10:09:02 UTC (rev 5244)
+++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr.xml 2011-11-30 10:16:17 UTC (rev 5245)
@@ -50,7 +50,10 @@
<xi:include href="jcr/configuration/multilanguage-support.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
-
+
+ <xi:include href="jcr/configuration/multi-db-schema-support.xml"
+ xmlns:xi="http://www.w3.org/2001/XInclude" />
+
<xi:include href="jcr/configuration/search-configuration.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
12 years, 4 months
exo-jcr SVN: r5244 - in jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr: impl/dataflow and 1 other directory.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2011-11-30 05:09:02 -0500 (Wed, 30 Nov 2011)
New Revision: 5244
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/persistent/PersistedItemData.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientItemData.java
Log:
EXOJCR-1651 : Adding a check to avoid cycles in future.
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/persistent/PersistedItemData.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/persistent/PersistedItemData.java 2011-11-29 11:55:14 UTC (rev 5243)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/dataflow/persistent/PersistedItemData.java 2011-11-30 10:09:02 UTC (rev 5244)
@@ -66,6 +66,10 @@
public PersistedItemData(String id, QPath qpath, String parentId, int version)
{
+ if (id.equals(parentId))
+ {
+ throw new IllegalArgumentException("Item can't have itself as parent.");
+ }
this.id = id;
this.qpath = qpath;
this.parentId = parentId;
@@ -110,10 +114,14 @@
public boolean equals(Object obj)
{
if (obj == this)
+ {
return true;
+ }
if (obj == null)
+ {
return false;
+ }
if (obj instanceof ItemData)
{
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientItemData.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientItemData.java 2011-11-29 11:55:14 UTC (rev 5243)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/TransientItemData.java 2011-11-30 10:09:02 UTC (rev 5244)
@@ -67,6 +67,10 @@
*/
TransientItemData(QPath path, String identifier, int version, String parentIdentifier)
{
+ if (identifier.equals(parentIdentifier))
+ {
+ throw new IllegalArgumentException("Item can't have itself as parent.");
+ }
this.parentIdentifier = parentIdentifier != null ? parentIdentifier : null;
this.identifier = identifier;
this.qpath = path;
@@ -82,10 +86,14 @@
public boolean equals(Object obj)
{
if (obj == this)
+ {
return true;
+ }
if (obj == null)
+ {
return false;
+ }
if (obj instanceof ItemData)
{
@@ -208,7 +216,9 @@
out.write(parentIdentifier.getBytes());
}
else
+ {
out.writeInt(NULL_VALUE);
+ }
out.writeInt(persistedVersion);
}
12 years, 4 months
exo-jcr SVN: r5243 - jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy.
by do-not-reply@jboss.org
Author: areshetnyak
Date: 2011-11-29 06:55:14 -0500 (Tue, 29 Nov 2011)
New Revision: 5243
Modified:
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoaderPlugin.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScriptAddRepoPlugin.java
Log:
EXOJCR-1659 : GroovyScriptAddRepoPlugin and the GroovyScript2RestLoaderPlugin are used current repository if repository name was not previously configured.
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoaderPlugin.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoaderPlugin.java 2011-11-29 09:32:41 UTC (rev 5242)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoaderPlugin.java 2011-11-29 11:55:14 UTC (rev 5243)
@@ -21,6 +21,7 @@
import org.exoplatform.container.component.BaseComponentPlugin;
import org.exoplatform.container.xml.InitParams;
import org.exoplatform.container.xml.PropertiesParam;
+import org.exoplatform.services.jcr.RepositoryService;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
@@ -28,6 +29,8 @@
import java.util.Iterator;
import java.util.List;
+import javax.jcr.RepositoryException;
+
/**
* @author <a href="mailto:andrew00x@gmail.com">Andrey Parfonov</a>
* @version $Id: GroovyScript2RestLoaderPlugin.java 34445 2009-07-24 07:51:18Z dkatayev $
@@ -38,6 +41,9 @@
/** Logger. */
private static final Log LOG = ExoLogger.getLogger("exo.jcr.component.ext.GroovyScript2RestLoaderPlugin");
+ /** Repository service **/
+ private static RepositoryService repositoryService;
+
/** Configurations for scripts what were got from XML. */
private List<XMLGroovyScript2Rest> l = new ArrayList<XMLGroovyScript2Rest>();
@@ -51,9 +57,12 @@
private String node;
@SuppressWarnings("unchecked")
- public GroovyScript2RestLoaderPlugin(InitParams params)
+ public GroovyScript2RestLoaderPlugin(InitParams params, RepositoryService repoServiceo)
{
- repository = params.getValueParam("repository").getValue();
+ this.repositoryService = repoServiceo;
+
+ repository = params.containsKey("repository") ? params.getValueParam("repository").getValue() : null;
+
workspace = params.getValueParam("workspace").getValue();
node = params.getValueParam("node").getValue();
Iterator<PropertiesParam> iterator = params.getPropertiesParamIterator();
@@ -75,11 +84,30 @@
}
/**
- * @return the repository
+ * Get working repository name. Returns the repository name from configuration
+ * if it previously configured and returns the name of current repository in other case.
+ *
+ * @return String
+ * repository name
+ * @throws RepositoryException
*/
public String getRepository()
{
- return repository;
+ if (repository == null)
+ {
+ try
+ {
+ return repositoryService.getCurrentRepository().getConfiguration().getName();
+ }
+ catch (RepositoryException e)
+ {
+ throw new RuntimeException("Can not get current repository and repository name was not configured", e);
+ }
+ }
+ else
+ {
+ return repository;
+ }
}
/**
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScriptAddRepoPlugin.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScriptAddRepoPlugin.java 2011-11-29 09:32:41 UTC (rev 5242)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScriptAddRepoPlugin.java 2011-11-29 11:55:14 UTC (rev 5243)
@@ -23,6 +23,7 @@
import org.exoplatform.container.component.BaseComponentPlugin;
import org.exoplatform.container.xml.InitParams;
import org.exoplatform.container.xml.PropertiesParam;
+import org.exoplatform.services.jcr.RepositoryService;
import org.exoplatform.services.jcr.ext.resource.UnifiedNodeReference;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
@@ -37,6 +38,8 @@
import java.util.Iterator;
import java.util.Set;
+import javax.jcr.RepositoryException;
+
/**
* @author <a href="mailto:andrew00x@gmail.com">Andrey Parfonov</a>
* @version $Id$
@@ -49,9 +52,12 @@
private final InitParams params;
- public GroovyScriptAddRepoPlugin(InitParams params)
+ private final RepositoryService repositoryService;
+
+ public GroovyScriptAddRepoPlugin(InitParams params, RepositoryService repoService)
{
this.params = params;
+ this.repositoryService = repoService;
}
@SuppressWarnings("unchecked")
@@ -65,7 +71,8 @@
while (iterator.hasNext())
{
PropertiesParam p = iterator.next();
- final String repository = p.getProperty("repository");
+ final String repository = getWorkingRepositoryName(p);
+
final String workspace = p.getProperty("workspace");
final String path = p.getProperty("path");
try
@@ -87,4 +94,34 @@
}
return repos;
}
+
+ /**
+ * Get working repository name. Returns the repository name from configuration
+ * if it previously configured and returns the name of current repository in other case.
+ *
+ * @props PropertiesParam
+ * the properties parameters
+ * @return String
+ * repository name
+ * @throws RepositoryException
+ */
+ private String getWorkingRepositoryName(PropertiesParam props)
+ {
+
+ if (props.getProperty("repository") == null)
+ {
+ try
+ {
+ return repositoryService.getCurrentRepository().getConfiguration().getName();
+ }
+ catch (RepositoryException e)
+ {
+ throw new RuntimeException("Can not get current repository and repository name was not configured", e);
+ }
+ }
+ else
+ {
+ return props.getProperty("repository");
+ }
+ }
}
12 years, 4 months
exo-jcr SVN: r5242 - jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US.
by do-not-reply@jboss.org
Author: nfilotto
Date: 2011-11-29 04:32:41 -0500 (Tue, 29 Nov 2011)
New Revision: 5242
Modified:
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/master.xml
Log:
EXOJCR-1661: Change title of eXo JCR Developer Guide
Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/master.xml
===================================================================
--- jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/master.xml 2011-11-29 08:51:25 UTC (rev 5241)
+++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/master.xml 2011-11-29 09:32:41 UTC (rev 5242)
@@ -25,7 +25,7 @@
and https://svn.jboss.org/repos/richfaces/tags/3.3.2.GA/docs/userguide/en/src... -->
<book lang="en">
<bookinfo>
- <title>eXo JCR Developer Guide</title>
+ <title>Reference Guide / eXo JCR</title>
<!-- corpauthor>
<inlinemediaobject>
12 years, 4 months
exo-jcr SVN: r5241 - jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy.
by do-not-reply@jboss.org
Author: areshetnyak
Date: 2011-11-29 03:51:25 -0500 (Tue, 29 Nov 2011)
New Revision: 5241
Modified:
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java
Log:
EXOJCR-1659 : GroovyScript2Rest was used current repository if repository name was not previously configured.
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java 2011-11-25 12:38:43 UTC (rev 5240)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/script/groovy/GroovyScript2RestLoader.java 2011-11-29 08:51:25 UTC (rev 5241)
@@ -277,7 +277,8 @@
try
{
// Deploy auto-load scripts and start Observation Listeners.
- final String repositoryName = observationListenerConfiguration.getRepository();
+ final String repositoryName = getWorkingRepositoryName();
+
List<String> workspaceNames = observationListenerConfiguration.getWorkspaces();
final ManageableRepository repository = repositoryService.getRepository(repositoryName);
@@ -370,7 +371,7 @@
private void autoLoadScripts(Session session) throws RepositoryException
{
String workspaceName = session.getWorkspace().getName();
- String repositoryName = observationListenerConfiguration.getRepository();
+ String repositoryName = getWorkingRepositoryName();
String xpath = "//element(*, " + getNodeType() + ")[@exo:autoload='true']";
Query query = session.getWorkspace().getQueryManager().createQuery(xpath, Query.XPATH);
@@ -570,8 +571,11 @@
observationListenerConfiguration.setWorkspaces(wsList);
LOG.info("NodeType from RegistryService: " + getNodeType());
- LOG.info("Repository from RegistryService: " + observationListenerConfiguration.getRepository());
- LOG.info("Workspaces node from RegistryService: " + observationListenerConfiguration.getWorkspaces());
+ LOG.info("Repository name from RegistryService: "
+ + (observationListenerConfiguration.getRepository() != null ? observationListenerConfiguration.getRepository()
+ : "not configured, will be used the current one"));
+
+ LOG.info("List of workspaces from RegistryService: " + observationListenerConfiguration.getWorkspaces());
}
/**
@@ -688,8 +692,11 @@
LOG.info("NodeType from configuration file: " + getNodeType());
if (observationListenerConfiguration != null)
{
- LOG.info("Repository from configuration file: " + observationListenerConfiguration.getRepository());
- LOG.info("Workspaces node from configuration file: " + observationListenerConfiguration.getWorkspaces());
+ LOG.info("Repository name from configuration file: "
+ + (observationListenerConfiguration.getRepository() != null ? observationListenerConfiguration
+ .getRepository() : "not configured, will be used the current one"));
+
+ LOG.info("List of workspaces from configuration file: " + observationListenerConfiguration.getWorkspaces());
}
}
@@ -1525,6 +1532,26 @@
}
/**
+ * Get working repository name. Returns the repository name from configuration
+ * if it previously configured and returns the name of current repository in other case.
+ *
+ * @return String
+ * repository name
+ * @throws RepositoryException
+ */
+ private String getWorkingRepositoryName() throws RepositoryException
+ {
+ if (observationListenerConfiguration.getRepository() == null)
+ {
+ return repositoryService.getCurrentRepository().getConfiguration().getName();
+ }
+ else
+ {
+ return observationListenerConfiguration.getRepository();
+ }
+ }
+
+ /**
* Extract path to node's parent from full path.
*
* @param fullPath full path to node
12 years, 4 months
exo-jcr SVN: r5240 - core/trunk/exo.core.component.organization.tests/src/main/java/org/exoplatform/services/tck/organization.
by do-not-reply@jboss.org
Author: tolusha
Date: 2011-11-25 07:38:43 -0500 (Fri, 25 Nov 2011)
New Revision: 5240
Modified:
core/trunk/exo.core.component.organization.tests/src/main/java/org/exoplatform/services/tck/organization/TestMembershipHandler.java
Log:
EXOJCR-1658: fix test
Modified: core/trunk/exo.core.component.organization.tests/src/main/java/org/exoplatform/services/tck/organization/TestMembershipHandler.java
===================================================================
--- core/trunk/exo.core.component.organization.tests/src/main/java/org/exoplatform/services/tck/organization/TestMembershipHandler.java 2011-11-25 12:09:00 UTC (rev 5239)
+++ core/trunk/exo.core.component.organization.tests/src/main/java/org/exoplatform/services/tck/organization/TestMembershipHandler.java 2011-11-25 12:38:43 UTC (rev 5240)
@@ -410,7 +410,6 @@
assertEquals(currentUrer.getEmail(), u.getEmail());
assertEquals(currentUrer.getOrganizationId(), u.getOrganizationId());
assertEquals(currentUrer.getPassword(), u.getPassword());
- assertEquals(currentUrer.getCreatedDate().toString(), u.getCreatedDate().toString());
}
// try to find users by not existed entries. We supposed to get empty list instead of Exception
@@ -444,7 +443,6 @@
assertEquals(currentUrer.getEmail(), u.getEmail());
assertEquals(currentUrer.getOrganizationId(), u.getOrganizationId());
assertEquals(currentUrer.getPassword(), u.getPassword());
- assertEquals(currentUrer.getCreatedDate().toString(), u.getCreatedDate().toString());
}
// try to find users by not existed entries. We supposed to get empty list instead of Exception
12 years, 4 months