exo-jcr SVN: r798 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/api/writing.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2009-11-20 11:39:32 -0500 (Fri, 20 Nov 2009)
New Revision: 798
Modified:
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/api/writing/TestSiblingsRemove.java
Log:
EXOJCR-199: Added test on SNS operations
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/api/writing/TestSiblingsRemove.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/api/writing/TestSiblingsRemove.java 2009-11-20 16:35:02 UTC (rev 797)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/api/writing/TestSiblingsRemove.java 2009-11-20 16:39:32 UTC (rev 798)
@@ -35,28 +35,35 @@
public void testRemoveSameNameSiblings() throws RepositoryException
{
- String nodeName1 = "name";
- NodeImpl testRootNode = (NodeImpl)root.addNode("testroot");
- root.save();
+ try
+ {
+ String nodeName1 = "name";
+ NodeImpl testRootNode = (NodeImpl)root.addNode("testroot");
+ root.save();
- testRootNode.addNode(nodeName1);
- testRootNode.addNode(nodeName1);
- testRootNode.save();
+ testRootNode.addNode(nodeName1);
+ testRootNode.addNode(nodeName1);
+ testRootNode.save();
- for (NodeIterator children = testRootNode.getNodes(); children.hasNext();)
- {
- Node child = children.nextNode();
- child.remove();
- }
+ for (NodeIterator children = testRootNode.getNodes(); children.hasNext();)
+ {
+ Node child = children.nextNode();
+ child.remove();
+ }
- root.save();
+ root.save();
- for (NodeIterator children = testRootNode.getNodes(); children.hasNext();)
+ for (NodeIterator children = testRootNode.getNodes(); children.hasNext();)
+ {
+ Node child = children.nextNode();
+ child.remove();
+ }
+ root.save();
+ }
+ catch (RepositoryException e)
{
- Node child = children.nextNode();
- child.remove();
+ fail("Unexpected exception: " + e.getMessage());
}
- root.save();
}
}
16 years, 8 months
exo-jcr SVN: r797 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/api/writing.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2009-11-20 11:35:02 -0500 (Fri, 20 Nov 2009)
New Revision: 797
Added:
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/api/writing/TestSiblingsRemove.java
Log:
EXOJCR-199: Added test on SNS operations
Added: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/api/writing/TestSiblingsRemove.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/api/writing/TestSiblingsRemove.java (rev 0)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/api/writing/TestSiblingsRemove.java 2009-11-20 16:35:02 UTC (rev 797)
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2009 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.jcr.api.writing;
+
+import org.exoplatform.services.jcr.JcrAPIBaseTest;
+import org.exoplatform.services.jcr.impl.core.NodeImpl;
+
+import javax.jcr.Node;
+import javax.jcr.NodeIterator;
+import javax.jcr.RepositoryException;
+
+/**
+ * @author <a href="mailto:nikolazius@gmail.com">Nikolay Zamosenchuk</a>
+ * @version $Id$
+ *
+ */
+public class TestSiblingsRemove extends JcrAPIBaseTest
+{
+
+ public void testRemoveSameNameSiblings() throws RepositoryException
+ {
+ String nodeName1 = "name";
+ NodeImpl testRootNode = (NodeImpl)root.addNode("testroot");
+ root.save();
+
+ testRootNode.addNode(nodeName1);
+ testRootNode.addNode(nodeName1);
+ testRootNode.save();
+
+ for (NodeIterator children = testRootNode.getNodes(); children.hasNext();)
+ {
+ Node child = children.nextNode();
+ child.remove();
+ }
+
+ root.save();
+
+ for (NodeIterator children = testRootNode.getNodes(); children.hasNext();)
+ {
+ Node child = children.nextNode();
+ child.remove();
+ }
+ root.save();
+ }
+
+}
Property changes on: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/api/writing/TestSiblingsRemove.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
16 years, 8 months
exo-jcr SVN: r796 - in jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage: jdbc and 1 other directories.
by do-not-reply@jboss.org
Author: sergiykarpenko
Date: 2009-11-20 11:15:37 -0500 (Fri, 20 Nov 2009)
New Revision: 796
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/DBConstants.java
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java
Log:
EXOJCR-246: JDBCCacheLoader reference support added
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11-20 14:25:20 UTC (rev 795)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheStorageConnection.java 2009-11-20 16:15:37 UTC (rev 796)
@@ -21,11 +21,9 @@
import org.exoplatform.services.jcr.datamodel.ItemData;
import org.exoplatform.services.jcr.datamodel.NodeData;
import org.exoplatform.services.jcr.datamodel.PropertyData;
-import org.exoplatform.services.jcr.datamodel.QPath;
import org.exoplatform.services.jcr.datamodel.QPathEntry;
import org.exoplatform.services.jcr.datamodel.ValueData;
import org.exoplatform.services.jcr.impl.core.lock.LockData;
-import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData;
import org.exoplatform.services.jcr.impl.dataflow.ValueDataConvertor;
import org.exoplatform.services.jcr.storage.WorkspaceStorageConnection;
import org.exoplatform.services.log.ExoLogger;
@@ -349,13 +347,13 @@
if (refParent != null)
{
refParent.removeChild(propUUID);
+ // check is there is no more references
+ if (refParent.getChildrenNames().size() == 0)
+ {
+ //TODO remove children
+ refsRoot.removeChild(makeNodeFqn(refNodeUUID));
+ }
}
- // check is there is no more references
- if (refParent.getChildrenNames().size() == 0)
- {
- //TODO remove children
- refsRoot.removeChild(makeNodeFqn(refNodeUUID));
- }
}
}
@@ -673,88 +671,88 @@
{
//TODO we expecting that on session.move() there will be only one rename() method call
-// startBatch();
-//
-// String nodeId = data.getIdentifier();
-//
-// //1. Update renamed node and also get old nodeData
-// Node<Serializable, Object> node = nodesRoot.getChild(makeNodeFqn(nodeId));
-// if (node == null)
-// {
-// throw new InvalidItemStateException("Renamed node is not exist" + data.getQPath().getAsString());
-// }
-//
-// NodeData prevData = (NodeData)node.put(ITEM_DATA, data);
-// if (prevData == null)
-// {
-// throw new RepositoryException("FATAL NodeData is empty " + data.getQPath().getAsString());
-// }
-//
-// // 2. remove renamed node from child list of previous parent node
-// // check if parent is cached
-// Node<Serializable, Object> prevParent = nodesRoot.getChild(makeNodeFqn(prevData.getParentIdentifier()));
-// if (prevParent == null)
-// {
-// throw new InvalidItemStateException("Node's previous parent doesn't exist "
-// + prevData.getQPath().getAsString() + ". Node " + data.getQPath().getAsString());
-// }
-//
-// // remove node form old parent child list
-// if (!prevParent
-// .removeChild(makeChildNodeFqn(prevData.getQPath().getEntries()[prevData.getQPath().getEntries().length - 1])))
-// {
-// throw new RepositoryException("FATAL Node doesn't listed in children nodes of previous parent "
-// + prevData.getQPath().getAsString() + ". Node " + data.getQPath().getAsString());
-// }
-//
-// // 3. add node to child list of new parent node
-// // check if parent is cached
-// Node<Serializable, Object> newParent = nodesRoot.getChild(makeNodeFqn(data.getParentIdentifier()));
-// if (newParent == null)
-// {
-// throw new InvalidItemStateException("Node's new parent doesn't exist " + data.getParentIdentifier()
-// + ". Node " + data.getQPath().getAsString());
-// }
-//
-// // add child to Parent
-// Node<Serializable, Object> childNode =
-// newParent.addChild(makeChildNodeFqn(data.getQPath().getEntries()[data.getQPath().getEntries().length - 1]));
-//
-// // set child id attr
-// childNode.put(ITEM_ID, data.getIdentifier());
-//
-// // 4. update all child nodes
-// for (Node<Serializable, Object> child : node.getChildren())
-// {
-// String childNodeId = (String)child.get(ITEM_ID);
-// if (childNodeId == null)
-// {
-// throw new RepositoryException("FATAL Child Node Id key is null. Parent " + data.getQPath().getAsString());
-// }
-//
-// // TODO NodeData or PropertyData? As ItemData check then and cast.
-// Node<Serializable, Object> childnode = nodesRoot.getChild(makeNodeFqn(childNodeId)); //cache.evict(fqn)
-// if (childnode == null)
-// {
-// throw new RepositoryException("FATAL Node record not found(" + childNodeId + "), but listed in childs of "
-// + data.getQPath().getAsString());
-// }
-// NodeData nodeData = (NodeData)childnode.get(ITEM_DATA);
-// if (nodeData == null)
-// {
-// // TODO should not occurs by contract
-// throw new RepositoryException("Child node data is null. Parent " + data.getQPath().getAsString());
-// }
-//
-// //repack child NodeData with new QPath
-// //TODO check it
-// QPath newPath = QPath.makeChildPath(data.getQPath(), nodeData.getQPath().getName());
-// TransientNodeData newNodeData =
-// new TransientNodeData(newPath, nodeData.getIdentifier(), nodeData.getPersistedVersion(), nodeData
-// .getPrimaryTypeName(), nodeData.getMixinTypeNames(), nodeData.getOrderNumber(), nodeData
-// .getParentIdentifier(), nodeData.getACL());
-// childnode.put(ITEM_DATA, newNodeData);
-// }
+ // startBatch();
+ //
+ // String nodeId = data.getIdentifier();
+ //
+ // //1. Update renamed node and also get old nodeData
+ // Node<Serializable, Object> node = nodesRoot.getChild(makeNodeFqn(nodeId));
+ // if (node == null)
+ // {
+ // throw new InvalidItemStateException("Renamed node is not exist" + data.getQPath().getAsString());
+ // }
+ //
+ // NodeData prevData = (NodeData)node.put(ITEM_DATA, data);
+ // if (prevData == null)
+ // {
+ // throw new RepositoryException("FATAL NodeData is empty " + data.getQPath().getAsString());
+ // }
+ //
+ // // 2. remove renamed node from child list of previous parent node
+ // // check if parent is cached
+ // Node<Serializable, Object> prevParent = nodesRoot.getChild(makeNodeFqn(prevData.getParentIdentifier()));
+ // if (prevParent == null)
+ // {
+ // throw new InvalidItemStateException("Node's previous parent doesn't exist "
+ // + prevData.getQPath().getAsString() + ". Node " + data.getQPath().getAsString());
+ // }
+ //
+ // // remove node form old parent child list
+ // if (!prevParent
+ // .removeChild(makeChildNodeFqn(prevData.getQPath().getEntries()[prevData.getQPath().getEntries().length - 1])))
+ // {
+ // throw new RepositoryException("FATAL Node doesn't listed in children nodes of previous parent "
+ // + prevData.getQPath().getAsString() + ". Node " + data.getQPath().getAsString());
+ // }
+ //
+ // // 3. add node to child list of new parent node
+ // // check if parent is cached
+ // Node<Serializable, Object> newParent = nodesRoot.getChild(makeNodeFqn(data.getParentIdentifier()));
+ // if (newParent == null)
+ // {
+ // throw new InvalidItemStateException("Node's new parent doesn't exist " + data.getParentIdentifier()
+ // + ". Node " + data.getQPath().getAsString());
+ // }
+ //
+ // // add child to Parent
+ // Node<Serializable, Object> childNode =
+ // newParent.addChild(makeChildNodeFqn(data.getQPath().getEntries()[data.getQPath().getEntries().length - 1]));
+ //
+ // // set child id attr
+ // childNode.put(ITEM_ID, data.getIdentifier());
+ //
+ // // 4. update all child nodes
+ // for (Node<Serializable, Object> child : node.getChildren())
+ // {
+ // String childNodeId = (String)child.get(ITEM_ID);
+ // if (childNodeId == null)
+ // {
+ // throw new RepositoryException("FATAL Child Node Id key is null. Parent " + data.getQPath().getAsString());
+ // }
+ //
+ // // TODO NodeData or PropertyData? As ItemData check then and cast.
+ // Node<Serializable, Object> childnode = nodesRoot.getChild(makeNodeFqn(childNodeId)); //cache.evict(fqn)
+ // if (childnode == null)
+ // {
+ // throw new RepositoryException("FATAL Node record not found(" + childNodeId + "), but listed in childs of "
+ // + data.getQPath().getAsString());
+ // }
+ // NodeData nodeData = (NodeData)childnode.get(ITEM_DATA);
+ // if (nodeData == null)
+ // {
+ // // TODO should not occurs by contract
+ // throw new RepositoryException("Child node data is null. Parent " + data.getQPath().getAsString());
+ // }
+ //
+ // //repack child NodeData with new QPath
+ // //TODO check it
+ // QPath newPath = QPath.makeChildPath(data.getQPath(), nodeData.getQPath().getName());
+ // TransientNodeData newNodeData =
+ // new TransientNodeData(newPath, nodeData.getIdentifier(), nodeData.getPersistedVersion(), nodeData
+ // .getPrimaryTypeName(), nodeData.getMixinTypeNames(), nodeData.getOrderNumber(), nodeData
+ // .getParentIdentifier(), nodeData.getACL());
+ // childnode.put(ITEM_DATA, newNodeData);
+ // }
}
/**
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-20 14:25:20 UTC (rev 795)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JDBCCacheLoader.java 2009-11-20 16:15:37 UTC (rev 796)
@@ -19,7 +19,6 @@
package org.exoplatform.services.jcr.impl.storage.jbosscache;
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
-import org.exoplatform.services.jcr.datamodel.IllegalNameException;
import org.exoplatform.services.jcr.datamodel.ItemData;
import org.exoplatform.services.jcr.datamodel.NodeData;
import org.exoplatform.services.jcr.datamodel.PropertyData;
@@ -108,6 +107,11 @@
{
case PUT_DATA :
//LOG.warn("PUT_DATA modification");
+ // Process references
+ // if (m.getFqn().get(0).equals(JBossCacheStorage.REFS))
+ // {
+ // addReferences((JDBCStorageConnection)conn, m);
+ // }
break;
case PUT_DATA_ERASE :
LOG.warn("PUT_DATA_ERASE modification");
@@ -134,7 +138,14 @@
break;
case REMOVE_NODE :
+ // if (m.getFqn().get(0).equals(JBossCacheStorage.REFS))
+ // {
+ // removeReference((JDBCStorageConnection)conn, m);
+ // }
+ // else
+ // {
doRemove(m, (JDBCStorageConnection)conn);
+ // }
break;
case MOVE :
@@ -362,14 +373,53 @@
LOG.warn("Unexpected Fqn asked " + name);
}
}
+ else if (name.get(0).equals(JBossCacheStorage.REFS))
+ {
+ // get reference
+ if (name.size() == 3)
+ {
+
+ // do we have such property reference
+ String nodeID = String.valueOf(name.get(1));
+ String propID = String.valueOf(name.get(2));
+
+ if (conn.hasReference(nodeID, propID))
+ {
+ attrs = new LinkedHashMap<Object, Object>();
+ }
+ else
+ {
+ attrs = null;
+ }
+ }
+ else if (name.size() == 2)
+ {
+ // do we have node with any reference
+ String nodeID = name.getLastElementAsString();
+ if (conn.getReferenceIdentifiers(nodeID).size() > 0)
+ {
+ attrs = new LinkedHashMap<Object, Object>();
+ }
+ else
+ {
+ attrs = null;
+ }
+ }
+ else
+ {
+ attrs = null;
+ }
+
+ }
else
{
attrs = null;
LOG.warn("Unexpected Fqn asked " + name);
}
}
- else if (name.equals(Fqn.ROOT) || name.equals(JBossCacheStorage.PROPS) || name.equals(JBossCacheStorage.NODES)
- || name.equals(JBossCacheStorage.LOCKS))
+ else if (name.get(0).equals(Fqn.ROOT) || name.get(0).equals(JBossCacheStorage.PROPS)
+ || name.get(0).equals(JBossCacheStorage.NODES) || name.get(0).equals(JBossCacheStorage.LOCKS)
+ || name.get(0).equals(JBossCacheStorage.REFS))
{
// roots, like NODES, PROPS etc
attrs = new LinkedHashMap<Object, Object>();
@@ -464,14 +514,37 @@
LOG.warn("Unexpected Fqn asked " + name);
}
}
+ else if (name.get(0).equals(JBossCacheStorage.REFS))
+ {
+ // /$REFS/<NODE_ID>
+ if (name.size() == 2)
+ {
+ String nodeId = name.getLastElementAsString();
+ exists = conn.getReferenceIdentifiers(nodeId).size() > 0;
+ }
+ // /$REFS/<NODE_ID>/<REF_PROP_ID>
+ else if (name.size() == 3)
+ {
+ String refPropertyId = name.getLastElementAsString();
+ String nodeId = (String)name.get(1);
+
+ exists = conn.hasReference(nodeId, refPropertyId);
+ }
+ else
+ {
+ exists = false;
+ LOG.warn("Unexpected Fqn asked " + name);
+ }
+ }
else
{
exists = false;
LOG.warn("Unexpected Fqn asked " + name);
}
}
- else if (name.equals(Fqn.ROOT) || name.equals(JBossCacheStorage.PROPS) || name.equals(JBossCacheStorage.NODES)
- || name.equals(JBossCacheStorage.LOCKS))
+ else if (name.get(0).equals(Fqn.ROOT) || name.get(0).equals(JBossCacheStorage.PROPS)
+ || name.get(0).equals(JBossCacheStorage.NODES) || name.get(0).equals(JBossCacheStorage.LOCKS)
+ || name.get(0).equals(JBossCacheStorage.REFS))
{
// roots, like NODES, PROPS etc
exists = true;
@@ -504,32 +577,53 @@
if (name.size() == 2)
{
String nodeId = (String)name.get(1);
- return conn.getChildNodeNames(nodeId);
+ if (name.get(0).equals(JBossCacheStorage.NODES))
+ {
+ return conn.getChildNodeNames(nodeId);
+ }
+ else if (name.get(0).equals(JBossCacheStorage.REFS))
+ {
+ List<String> references = conn.getReferenceIdentifiers(nodeId);
+ Set<String> result = new LinkedHashSet<String>();
+ result.addAll(references);
+ return result;
+ }
+ else
+ {
+ // TODO this a property on any unexpected part of cache throw Exception
+ return null;
+ }
}
- else if (name.equals(JBossCacheStorage.NODES))
+ else if (name.get(0).equals(JBossCacheStorage.NODES))
{
// TODO should never be called
LOG.warn("conn.getAllNodeIdentifiers()");
return conn.getAllNodeIdentifiers();
}
- else if (name.equals(JBossCacheStorage.PROPS))
+ else if (name.get(0).equals(JBossCacheStorage.PROPS))
{
// TODO should never be called
LOG.warn("conn.getAllPropertyIdentifiers()");
return conn.getAllPropertyIdentifiers();
}
- else if (name.equals(JBossCacheStorage.LOCKS))
+ else if (name.get(0).equals(JBossCacheStorage.LOCKS))
{
// TODO return all Locks in workspace
return new LinkedHashSet<String>();
}
- else if (name.equals(Fqn.ROOT))
+ else if (name.get(0).equals(JBossCacheStorage.REFS))
{
+ // TODO return all referenced nodes in workspace
+ return new LinkedHashSet<String>();
+ }
+ else if (name.get(0).equals(Fqn.ROOT))
+ {
Set<String> childs = new LinkedHashSet<String>();
childs.add(JBossCacheStorage.NODES);
childs.add(JBossCacheStorage.PROPS);
childs.add(JBossCacheStorage.LOCKS);
+ childs.add(JBossCacheStorage.REFS);
return childs;
}
else
@@ -541,6 +635,7 @@
{
conn.close();
}
+ // return null;
}
/**
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/DBConstants.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/DBConstants.java 2009-11-20 14:25:20 UTC (rev 795)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/DBConstants.java 2009-11-20 16:15:37 UTC (rev 796)
@@ -126,7 +126,7 @@
* FIND_NODES_BY_PARENTID.
*/
protected String FIND_NODES_BY_PARENTID;
-
+
/**
* FIND_NODES_NAME_BY_PARENTID.
*/
@@ -136,32 +136,32 @@
* FIND_PROPERTIES_BY_PARENTID.
*/
protected String FIND_PROPERTIES_BY_PARENTID;
-
+
/**
* FIND_PROPERTIES_IDNAME_BY_PARENTID.
*/
protected String FIND_PROPERTIES_IDNAME_BY_PARENTID;
-
+
/**
* FIND_ITEM_IDENTIFIER.
*/
protected String FIND_NODE_IDENTIFIER;
-
+
/**
* FIND_PROPERTY_IDENTIFIER.
*/
protected String FIND_PROPERTY_IDENTIFIER;
-
+
/**
* FIND_ITEM_NAME.
*/
protected String FIND_ITEM_NAME;
-
+
/**
* FIND_ALL_NODES.
*/
protected String FIND_ALL_NODES;
-
+
/**
* FIND_ALL_PROPERTIES.
*/
@@ -217,6 +217,11 @@
*/
protected String DELETE_REF;
+ /**
+ * FIND_REFERENCE
+ */
+ protected String FIND_REFERENCE;
+
// ======================== ITEMS table ========================
/**
* COLUMN_ID.
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-20 14:25:20 UTC (rev 795)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2009-11-20 16:15:37 UTC (rev 796)
@@ -700,6 +700,39 @@
}
}
+ public List<String> getReferenceIdentifiers(String nodeIdentifier) throws RepositoryException, IllegalStateException
+ {
+ checkIfOpened();
+ try
+ {
+ ResultSet refProps = findReferences(nodeIdentifier);
+ List<String> references = new ArrayList<String>();
+ while (refProps.next())
+ {
+ references.add(getIdentifier(refProps.getString(COLUMN_ID)));
+ }
+ return references;
+ }
+ catch (SQLException e)
+ {
+ throw new RepositoryException(e);
+ }
+ }
+
+ public boolean hasReference(String nodeIdentifier, String refPropertyIdentifier) throws RepositoryException,
+ IllegalStateException
+ {
+ checkIfOpened();
+ try
+ {
+ return hasReferenceRecord(nodeIdentifier, refPropertyIdentifier);
+ }
+ catch (SQLException e)
+ {
+ throw new RepositoryException(e);
+ }
+ }
+
/**
* @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnection#getLockData(java.lang.String)
*/
@@ -2317,6 +2350,9 @@
protected abstract ResultSet findReferences(String nodeIdentifier) throws SQLException;
+ protected abstract boolean hasReferenceRecord(String nodeIdentifier, String refPropertyIdentifier)
+ throws SQLException;
+
protected abstract int deleteItemByIdentifier(String identifier) throws SQLException;
protected abstract int updateNodeByIdentifier(int version, int index, int orderNumb, String identifier)
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java 2009-11-20 14:25:20 UTC (rev 795)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java 2009-11-20 16:15:37 UTC (rev 796)
@@ -85,13 +85,13 @@
protected PreparedStatement findPropertiesIdNameByParentId;
protected PreparedStatement findNodeIdentifier;
-
+
protected PreparedStatement findPropertyIdentifier;
protected PreparedStatement findItemName;
-
+
protected PreparedStatement findAllProperties;
-
+
protected PreparedStatement findAllNodes;
protected PreparedStatement insertNode;
@@ -124,6 +124,8 @@
protected PreparedStatement renameNode;
+ protected PreparedStatement findReference;
+
/**
* Multidatabase JDBC Connection constructor.
*
@@ -191,6 +193,8 @@
"select P.ID, P.PARENT_ID, P.VERSION, P.P_TYPE, P.P_MULTIVALUED, P.NAME" + " from JCR_MREF R, JCR_MITEM P"
+ " where R.NODE_ID=? and P.ID=R.PROPERTY_ID and P.I_CLASS=2";
+ FIND_REFERENCE = "select P.ID from JCR_MREF R, JCR_MITEM P where R.NODE_ID=? and R.PROPERTY_ID=?";
+
FIND_VALUES_BY_PROPERTYID =
"select PROPERTY_ID, ORDER_NUM, DATA, STORAGE_DESC from JCR_MVALUE where PROPERTY_ID=? order by ORDER_NUM";
@@ -201,20 +205,21 @@
FIND_NODES_BY_PARENTID = "select * from JCR_MITEM" + " where I_CLASS=1 and PARENT_ID=?" + " order by N_ORDER_NUM";
FIND_ALL_NODES = "select ID from JCR_MITEM where I_CLASS=1";
-
+
FIND_NODES_NAME_BY_PARENTID =
"select NAME, I_INDEX from JCR_MITEM" + " where I_CLASS=1 and PARENT_ID=?" + " order by N_ORDER_NUM";
FIND_PROPERTIES_BY_PARENTID = "select * from JCR_MITEM" + " where I_CLASS=2 and PARENT_ID=?" + " order by ID";
FIND_PROPERTIES_IDNAME_BY_PARENTID = "select ID, NAME from JCR_MITEM" + " where I_CLASS=2 and PARENT_ID=?";
-
+
FIND_ALL_PROPERTIES = "select ID from JCR_MITEM where I_CLASS=2";
FIND_NODE_IDENTIFIER = "select ID from JCR_MITEM" + " where I_CLASS=1 and PARENT_ID=? and NAME=? and I_INDEX=?";
-
- FIND_PROPERTY_IDENTIFIER = "select ID from JCR_MITEM" + " where I_CLASS=2 and PARENT_ID=? and NAME=? and I_INDEX=1";
+ FIND_PROPERTY_IDENTIFIER =
+ "select ID from JCR_MITEM" + " where I_CLASS=2 and PARENT_ID=? and NAME=? and I_INDEX=1";
+
FIND_ITEM_NAME = "select NAME, I_CLASS from JCR_MITEM" + " where ID=?";
INSERT_NODE =
@@ -616,7 +621,7 @@
findNodeIdentifier.setInt(3, index);
return findNodeIdentifier.executeQuery();
}
-
+
/**
* {@inheritDoc}
*/
@@ -705,4 +710,20 @@
}
return findAllProperties.executeQuery();
}
+
+ @Override
+ protected boolean hasReferenceRecord(String nodeIdentifier, String refPropertyIdentifier) throws SQLException
+ {
+ // TODO make query
+ if (findReference == null)
+ findReference = dbConnection.prepareStatement(FIND_REFERENCE);
+ else
+ findReference.clearParameters();
+
+ findReference.setString(1, nodeIdentifier);
+ findReference.setString(1, refPropertyIdentifier);
+ ResultSet result = findReference.executeQuery();
+
+ return result.next();
+ }
}
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2009-11-20 14:25:20 UTC (rev 795)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2009-11-20 16:15:37 UTC (rev 796)
@@ -82,7 +82,7 @@
protected PreparedStatement findPropertiesIdNameByParentId;
protected PreparedStatement findNodeIdentifier;
-
+
protected PreparedStatement findPropertyIdentifier;
protected PreparedStatement findItemName;
@@ -212,7 +212,7 @@
+ " order by N_ORDER_NUM";
FIND_ALL_NODES = "select ID from JCR_SITEM where I_CLASS=1 and CONTAINER_NAME=?";
-
+
FIND_PROPERTIES_BY_PARENTID =
"select * from JCR_SITEM" + " where I_CLASS=2 and CONTAINER_NAME=? and PARENT_ID=?" + " order by ID";
@@ -220,11 +220,13 @@
"select ID, NAME from JCR_SITEM" + " where I_CLASS=2 and CONTAINER_NAME=? and PARENT_ID=?";
FIND_ALL_PROPERTIES = "select ID from JCR_SITEM where I_CLASS=2 and CONTAINER_NAME=?";
-
- FIND_NODE_IDENTIFIER = "select ID from JCR_SITEM" + " where I_CLASS=1 and CONTAINER_NAME=? and PARENT_ID=? and NAME=? and I_INDEX=?";
-
- FIND_PROPERTY_IDENTIFIER = "select ID from JCR_SITEM" + " where I_CLASS=2 and CONTAINER_NAME=? and PARENT_ID=? and NAME=? and I_INDEX=1";
+ FIND_NODE_IDENTIFIER =
+ "select ID from JCR_SITEM" + " where I_CLASS=1 and CONTAINER_NAME=? and PARENT_ID=? and NAME=? and I_INDEX=?";
+
+ FIND_PROPERTY_IDENTIFIER =
+ "select ID from JCR_SITEM" + " where I_CLASS=2 and CONTAINER_NAME=? and PARENT_ID=? and NAME=? and I_INDEX=1";
+
FIND_ITEM_NAME = "select NAME, I_CLASS from JCR_SITEM" + " where ID=?";
INSERT_NODE =
@@ -630,7 +632,7 @@
findNodeIdentifier.setInt(4, index);
return findNodeIdentifier.executeQuery();
}
-
+
/**
* {@inheritDoc}
*/
@@ -684,7 +686,7 @@
findNodesNameByParentId.setString(2, parentCid);
return findNodesNameByParentId.executeQuery();
}
-
+
/**
* {@inheritDoc}
*/
@@ -719,5 +721,12 @@
}
findAllProperties.setString(1, containerName);
return findAllProperties.executeQuery();
- }
+ }
+
+ @Override
+ protected boolean hasReferenceRecord(String nodeId, String refPropertyId) throws SQLException
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
}
16 years, 8 months
exo-jcr SVN: r795 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache.
by do-not-reply@jboss.org
Author: skabashnyuk
Date: 2009-11-20 09:25:20 -0500 (Fri, 20 Nov 2009)
New Revision: 795
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/IndexModificationsBuilder.java
Log:
EXOJCR-241 : Lock's handling
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/IndexModificationsBuilder.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/IndexModificationsBuilder.java 2009-11-20 14:15:28 UTC (rev 794)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/IndexModificationsBuilder.java 2009-11-20 14:25:20 UTC (rev 795)
@@ -119,15 +119,16 @@
if (fqn.size() == 2)
{
String uuid = parseUUID(fqn);
- if (!isNode(fqn))
+ if (isProperty(fqn))
{
PropertyData property = (PropertyData)command.getValue();
uuid = property.getParentIdentifier();
+
+ if (!addedNodes.contains(uuid))
+ {
+ updateNodes.add(uuid);
+ }
}
- if (!addedNodes.contains(uuid))
- {
- updateNodes.add(uuid);
- }
}
return null;
@@ -189,6 +190,18 @@
/**
*
* @param fqn
+ * @return true if fqn is the path to the node, false if fqn is the path to the property.
+ */
+ private boolean isProperty(Fqn<String> fqn)
+ {
+ String items = (String)fqn.get(0);
+ String s = items.toString();
+ return s.equals(JBossCacheStorage.PROPS);
+ }
+
+ /**
+ *
+ * @param fqn
* @return Return uuid of item from fqn
*/
private String parseUUID(Fqn<String> fqn)
16 years, 8 months
exo-jcr SVN: r794 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent.
by do-not-reply@jboss.org
Author: areshetnyak
Date: 2009-11-20 09:15:28 -0500 (Fri, 20 Nov 2009)
New Revision: 794
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java
Log:
EXOJCR-203 : Add printing to log the added listentrs in WorkspacePersistentDataManager.
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 2009-11-20 14:09:54 UTC (rev 793)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 2009-11-20 14:15:28 UTC (rev 794)
@@ -522,8 +522,8 @@
mandatoryListeners.add((MandatoryItemsPersistenceListener)listener);
else
listeners.add(listener);
- if (LOG.isDebugEnabled())
- LOG.debug("Workspace '" + this.dataContainer.getName() + "' listener registered: " + listener);
+// if (LOG.isDebugEnabled())
+ LOG.info("Workspace '" + this.dataContainer.getName() + "' listener registered: " + listener);
}
public void removeItemPersistenceListener(ItemsPersistenceListener listener)
16 years, 8 months
exo-jcr SVN: r793 - jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent.
by do-not-reply@jboss.org
Author: areshetnyak
Date: 2009-11-20 09:09:54 -0500 (Fri, 20 Nov 2009)
New Revision: 793
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java
Log:
EXOJCR-203 : The notifySaveItems was added in JBossCacheWorkspaceDataManager.save.
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java 2009-11-20 14:08:01 UTC (rev 792)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/JBossCacheWorkspaceDataManager.java 2009-11-20 14:09:54 UTC (rev 793)
@@ -226,6 +226,8 @@
// help to GC
addedNodes.clear();
}
+
+ notifySaveItems(changesLog);
}
/**
16 years, 8 months
exo-jcr SVN: r792 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/api/writing.
by do-not-reply@jboss.org
Author: areshetnyak
Date: 2009-11-20 09:08:01 -0500 (Fri, 20 Nov 2009)
New Revision: 792
Modified:
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/api/writing/TestSetProperty.java
Log:
EXOJCR-203 : The test TestSetProperty was fixed.
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/api/writing/TestSetProperty.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/api/writing/TestSetProperty.java 2009-11-20 13:53:18 UTC (rev 791)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/api/writing/TestSetProperty.java 2009-11-20 14:08:01 UTC (rev 792)
@@ -382,13 +382,13 @@
tempFiles[1] = tmpFile2;
tempFiles[2] = tmpFile3;
-// for (int i = 2; i < cLog.getAllStates().size(); i++)
-// {
-// ItemState item = cLog.getAllStates().get(i);
+ for (int i = 2; i < cLog.getAllStates().size(); i++)
+ {
+ ItemState item = cLog.getAllStates().get(i);
// TODO doesn't pass with FileTree VS, ok with CAS if contents different
//compareStream(((PropertyData) item.getData()).getValues().get(0).getAsStream(),
// new FileInputStream(tempFiles[i - 2]));
-// }
+ }
}
public void onSaveItems(ItemStateChangesLog itemStates)
16 years, 8 months
exo-jcr SVN: r791 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/api/writing.
by do-not-reply@jboss.org
Author: areshetnyak
Date: 2009-11-20 08:53:18 -0500 (Fri, 20 Nov 2009)
New Revision: 791
Modified:
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/api/writing/TestSetProperty.java
Log:
EXOJCR-203 : The test TestSetProperty was fixed.
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/api/writing/TestSetProperty.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/api/writing/TestSetProperty.java 2009-11-20 13:45:40 UTC (rev 790)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/api/writing/TestSetProperty.java 2009-11-20 13:53:18 UTC (rev 791)
@@ -382,13 +382,13 @@
tempFiles[1] = tmpFile2;
tempFiles[2] = tmpFile3;
- for (int i = 2; i < cLog.getAllStates().size(); i++)
- {
- ItemState item = cLog.getAllStates().get(i);
+// for (int i = 2; i < cLog.getAllStates().size(); i++)
+// {
+// ItemState item = cLog.getAllStates().get(i);
// TODO doesn't pass with FileTree VS, ok with CAS if contents different
//compareStream(((PropertyData) item.getData()).getValues().get(0).getAsStream(),
// new FileInputStream(tempFiles[i - 2]));
- }
+// }
}
public void onSaveItems(ItemStateChangesLog itemStates)
16 years, 8 months
exo-jcr SVN: r790 - in jcr/branches/1.12.0-JBC/component/core/src: main/java/org/exoplatform/services/jcr/impl/core/query and 3 other directories.
by do-not-reply@jboss.org
Author: skabashnyuk
Date: 2009-11-20 08:45:40 -0500 (Fri, 20 Nov 2009)
New Revision: 790
Added:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/IndexerInterceptor.java
Removed:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/cacheloader/
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/IndexInterceptor.java
Modified:
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexingTree.java
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SystemSearchManager.java
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/IndexModificationsBuilder.java
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/IndexerCacheLoader.java
jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java
Log:
EXOJCR-241 : IndexInterceptor update. Fixed duplication on delete. Code reorganize
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java 2009-11-20 13:04:43 UTC (rev 789)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/RepositoryContainer.java 2009-11-20 13:45:40 UTC (rev 790)
@@ -50,7 +50,7 @@
import org.exoplatform.services.jcr.impl.core.query.SearchManager;
import org.exoplatform.services.jcr.impl.core.query.SystemSearchManager;
import org.exoplatform.services.jcr.impl.core.query.SystemSearchManagerHolder;
-import org.exoplatform.services.jcr.impl.core.query.cacheloader.IndexInterceptor;
+import org.exoplatform.services.jcr.impl.core.query.jbosscache.IndexerInterceptor;
import org.exoplatform.services.jcr.impl.core.value.ValueFactoryImpl;
import org.exoplatform.services.jcr.impl.dataflow.persistent.JBossCacheWorkspaceDataManager;
import org.exoplatform.services.jcr.impl.dataflow.persistent.LocalWorkspaceDataManagerStub;
@@ -221,7 +221,7 @@
//so IndexerCacheLoader will use it.
//registerComponentInstance(new SearchManagerHolder());
// workspaceContainer.registerComponentImplementation(SearchManagerHolder.class);
- workspaceContainer.registerComponentImplementation(IndexInterceptor.class);
+ workspaceContainer.registerComponentImplementation(IndexerInterceptor.class);
if (isSystem)
{
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexingTree.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexingTree.java 2009-11-20 13:04:43 UTC (rev 789)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/IndexingTree.java 2009-11-20 13:45:40 UTC (rev 790)
@@ -32,87 +32,94 @@
* @version $Id$
*
*/
-public class IndexingTree {
- private final QPath indexingRootQpath;
- private final NodeData indexingRoot;
+public class IndexingTree
+{
+ private final QPath indexingRootQpath;
- private final List<QPath> excludedPaths;
+ private final NodeData indexingRoot;
- /**
- * @param indexingRoot
- * @param excludedPaths
- */
- public IndexingTree(NodeData indexingRoot, List<QPath> excludedPaths) {
- super();
- this.indexingRoot = indexingRoot;
- this.indexingRootQpath = indexingRoot.getQPath();
- this.excludedPaths = excludedPaths;
- }
+ private final List<QPath> excludedPaths;
- /**
- * @param indexingRoot
- * @param excludedPaths
- */
- public IndexingTree(NodeData indexingRoot) {
- super();
- this.indexingRoot = indexingRoot;
- this.indexingRootQpath = indexingRoot.getQPath();
- this.excludedPaths = new ArrayList<QPath>();
- }
+ /**
+ * @param indexingRoot
+ * @param excludedPaths
+ */
+ public IndexingTree(NodeData indexingRoot, List<QPath> excludedPaths)
+ {
+ super();
+ this.indexingRoot = indexingRoot;
+ this.indexingRootQpath = indexingRoot.getQPath();
+ this.excludedPaths = excludedPaths;
+ }
- /**
- * @return the excludedPaths
- */
- public List<QPath> getExcludedPaths() {
- return excludedPaths;
- }
+ /**
+ * @param indexingRoot
+ * @param excludedPaths
+ */
+ public IndexingTree(NodeData indexingRoot)
+ {
+ super();
+ this.indexingRoot = indexingRoot;
+ this.indexingRootQpath = indexingRoot.getQPath();
+ this.excludedPaths = new ArrayList<QPath>();
+ }
- /**
- * @return the indexingRoot
- */
- public NodeData getIndexingRoot() {
- return indexingRoot;
- }
+ /**
+ * @return the excludedPaths
+ */
+ public List<QPath> getExcludedPaths()
+ {
+ return excludedPaths;
+ }
- /**
- * Checks if the given event should be excluded based on the
- * {@link #excludePath} setting.
- *
- * @param event
- * observation event
- * @return <code>true</code> if the event should be excluded,
- * <code>false</code> otherwise
- */
- public boolean isExcluded(ItemState event) {
+ /**
+ * @return the indexingRoot
+ */
+ public NodeData getIndexingRoot()
+ {
+ return indexingRoot;
+ }
- for (QPath excludedPath : excludedPaths) {
- if (event.getData().getQPath().isDescendantOf(excludedPath)
- || event.getData().getQPath().equals(excludedPath))
- return true;
- }
+ /**
+ * Checks if the given event should be excluded based on the
+ * {@link #excludePath} setting.
+ *
+ * @param event
+ * observation event
+ * @return <code>true</code> if the event should be excluded,
+ * <code>false</code> otherwise
+ */
+ public boolean isExcluded(ItemState event)
+ {
- return !event.getData().getQPath().isDescendantOf(indexingRootQpath)
- && !event.getData().getQPath().equals(indexingRootQpath);
- }
+ for (QPath excludedPath : excludedPaths)
+ {
+ if (event.getData().getQPath().isDescendantOf(excludedPath) || event.getData().getQPath().equals(excludedPath))
+ return true;
+ }
- /**
- * Checks if the given event should be excluded based on the
- * {@link #excludePath} setting.
- *
- * @param event
- * observation event
- * @return <code>true</code> if the event should be excluded,
- * <code>false</code> otherwise
- */
- public boolean isExcluded(ItemData eventData) {
+ return !event.getData().getQPath().isDescendantOf(indexingRootQpath)
+ && !event.getData().getQPath().equals(indexingRootQpath);
+ }
- for (QPath excludedPath : excludedPaths) {
- if (eventData.getQPath().isDescendantOf(excludedPath)
- || eventData.getQPath().equals(excludedPath))
- return true;
- }
+ /**
+ * Checks if the given event should be excluded based on the
+ * {@link #excludePath} setting.
+ *
+ * @param event
+ * observation event
+ * @return <code>true</code> if the event should be excluded,
+ * <code>false</code> otherwise
+ */
+ public boolean isExcluded(ItemData eventData)
+ {
- return !eventData.getQPath().isDescendantOf(indexingRootQpath)
- && !eventData.getQPath().equals(indexingRootQpath);
- }
+ for (QPath excludedPath : excludedPaths)
+ {
+ if (eventData.getQPath().isDescendantOf(excludedPath) || eventData.getQPath().equals(excludedPath))
+ return true;
+ }
+
+ return !eventData.getQPath().isDescendantOf(indexingRootQpath) && !eventData.getQPath().equals(indexingRootQpath);
+ }
}
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java 2009-11-20 13:04:43 UTC (rev 789)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java 2009-11-20 13:45:40 UTC (rev 790)
@@ -42,8 +42,8 @@
import org.exoplatform.services.jcr.impl.core.NamespaceRegistryImpl;
import org.exoplatform.services.jcr.impl.core.SessionDataManager;
import org.exoplatform.services.jcr.impl.core.SessionImpl;
-import org.exoplatform.services.jcr.impl.core.query.cacheloader.IndexInterceptor;
-import org.exoplatform.services.jcr.impl.core.query.cacheloader.IndexModificationsBuilder;
+import org.exoplatform.services.jcr.impl.core.query.jbosscache.IndexModificationsBuilder;
+import org.exoplatform.services.jcr.impl.core.query.jbosscache.IndexerInterceptor;
import org.exoplatform.services.jcr.impl.core.query.lucene.FieldNames;
import org.exoplatform.services.jcr.impl.core.query.lucene.LuceneVirtualTableResolver;
import org.exoplatform.services.jcr.impl.core.query.lucene.QueryHits;
@@ -168,7 +168,7 @@
public SearchManager(QueryHandlerEntry config, NamespaceRegistryImpl nsReg, NodeTypeDataManager ntReg,
WorkspacePersistentDataManager itemMgr, SystemSearchManagerHolder parentSearchManager,
DocumentReaderService extractor, ConfigurationManager cfm,
- final RepositoryIndexSearcherHolder indexSearcherHolder, IndexInterceptor indexInterceptor)
+ final RepositoryIndexSearcherHolder indexSearcherHolder, IndexerInterceptor indexInterceptor)
throws RepositoryException, RepositoryConfigurationException
{
@@ -181,8 +181,6 @@
this.cfm = cfm;
this.virtualTableResolver = new LuceneVirtualTableResolver(nodeTypeDataManager, nsReg);
this.parentSearchManager = parentSearchManager != null ? parentSearchManager.get() : null;
- //itemMgr.addItemPersistenceListener(this);
- //searchManagerHolder.put(this);
indexInterceptor.addIndexInterceptorListener(this);
}
@@ -432,7 +430,10 @@
if (item != null)
{
if (item.isNode())
- return (NodeData)item; // return node
+ {
+ if (!indexingTree.isExcluded(item))
+ return (NodeData)item;
+ }
else
log.warn("Node not found, but property " + id + ", " + item.getQPath().getAsString()
+ " found. ");
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SystemSearchManager.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SystemSearchManager.java 2009-11-20 13:04:43 UTC (rev 789)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SystemSearchManager.java 2009-11-20 13:45:40 UTC (rev 790)
@@ -26,7 +26,7 @@
import org.exoplatform.services.jcr.datamodel.QPath;
import org.exoplatform.services.jcr.impl.Constants;
import org.exoplatform.services.jcr.impl.core.NamespaceRegistryImpl;
-import org.exoplatform.services.jcr.impl.core.query.cacheloader.IndexInterceptor;
+import org.exoplatform.services.jcr.impl.core.query.jbosscache.IndexerInterceptor;
import org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePersistentDataManager;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
@@ -65,7 +65,7 @@
public SystemSearchManager(QueryHandlerEntry config, NamespaceRegistryImpl nsReg, NodeTypeDataManager ntReg,
WorkspacePersistentDataManager itemMgr, DocumentReaderService service, ConfigurationManager cfm,
- RepositoryIndexSearcherHolder indexSearcherHolder, IndexInterceptor indexInterceptor) throws RepositoryException,
+ RepositoryIndexSearcherHolder indexSearcherHolder, IndexerInterceptor indexInterceptor) throws RepositoryException,
RepositoryConfigurationException
{
super(config, nsReg, ntReg, itemMgr, null, service, cfm, indexSearcherHolder, indexInterceptor);
Copied: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache (from rev 782, jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/cacheloader)
Deleted: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/IndexInterceptor.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/cacheloader/IndexInterceptor.java 2009-11-19 16:19:28 UTC (rev 782)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/IndexInterceptor.java 2009-11-20 13:45:40 UTC (rev 790)
@@ -1,96 +0,0 @@
-/*
- * Copyright (C) 2009 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.jcr.impl.core.query.cacheloader;
-
-import org.exoplatform.services.jcr.impl.core.query.SearchManager;
-import org.exoplatform.services.log.ExoLogger;
-import org.exoplatform.services.log.Log;
-import org.jboss.cache.InvocationContext;
-import org.jboss.cache.commands.tx.PrepareCommand;
-import org.jboss.cache.interceptors.base.CommandInterceptor;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author <a href="mailto:Sergey.Kabashnyuk@exoplatform.org">Sergey Kabashnyuk</a>
- * @version $Id: exo-jboss-codetemplates.xml 34360 2009-07-22 23:58:59Z ksm $
- *
- */
-public class IndexInterceptor extends CommandInterceptor
-{
- private final Log log = ExoLogger.getLogger(IndexInterceptor.class);
-
- /**
- * List of index interceptor listeners.
- */
- private final List<SearchManager> indexInterceptorListners;
-
- /**
- * Default constructor.
- */
- public IndexInterceptor()
- {
- super();
- this.indexInterceptorListners = new ArrayList<SearchManager>();
- }
-
- /**
- * @see org.jboss.cache.commands.AbstractVisitor#visitPrepareCommand(org.jboss.cache.InvocationContext, org.jboss.cache.commands.tx.PrepareCommand)
- */
- @Override
- public Object visitPrepareCommand(InvocationContext ctx, PrepareCommand command) throws Throwable
- {
- // try
- // {
- // if (ctx.getTransactionContext().getModifications().size() > 0)
- // {
- // for (SearchManager searchManager : indexInterceptorListners)
- // {
- // searchManager.onSaveItems(ctx.getTransactionContext().getModifications());
- // }
- // }
- // }
- // catch (RepositoryException e)
- // {
- // //TODO handle rollback
- // log.error(e.getLocalizedMessage());
- // }
-
- return invokeNextInterceptor(ctx, command);
- }
-
- /**
- * Add new SearchManager to the indexInterceptorListners list.
- * @param searchManager - search manager.
- */
- public void addIndexInterceptorListener(SearchManager searchManager)
- {
- indexInterceptorListners.add(searchManager);
- }
-
- /**
- * Add new SearchManager to the indexInterceptorListners list.
- * @param searchManager - search manager.
- */
- public boolean removeIndexInterceptorListener(SearchManager searchManager)
- {
- return indexInterceptorListners.remove(searchManager);
- }
-}
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/IndexModificationsBuilder.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/cacheloader/IndexModificationsBuilder.java 2009-11-19 16:19:28 UTC (rev 782)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/IndexModificationsBuilder.java 2009-11-20 13:45:40 UTC (rev 790)
@@ -16,7 +16,7 @@
* 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.jcr.impl.core.query.cacheloader;
+package org.exoplatform.services.jcr.impl.core.query.jbosscache;
import org.exoplatform.services.jcr.datamodel.PropertyData;
import org.exoplatform.services.jcr.impl.storage.jbosscache.JBossCacheStorage;
@@ -53,13 +53,8 @@
public IndexModificationsBuilder(HashSet<String> addedNodes, HashSet<String> removedNodes,
HashSet<String> updateNodes)
{
- // nodes that need to be removed from the index.
this.removedNodes = removedNodes;
-
- // nodes that need to be added to the index.
this.addedNodes = addedNodes;
-
- // node thst must be updated
this.updateNodes = updateNodes;
}
@@ -95,10 +90,6 @@
//add second
addedNodes.add(parseUUID(command.getTo()));
}
- else
- {
- // this is property - do nothing
- }
}
return null;
}
@@ -117,10 +108,6 @@
String uuid = parseUUID(fqn);
addedNodes.add(uuid);
}
- else
- {
- // this is property - do nothing
- }
}
return null;
}
@@ -179,16 +166,19 @@
{
// add node
String uuid = parseUUID(fqn);
+ updateNodes.remove(uuid);
+ addedNodes.remove(uuid);
removedNodes.add(uuid);
}
- else
- {
- // this is property - do nothing
- }
}
return null;
}
+ /**
+ *
+ * @param fqn
+ * @return true if fqn is the path to the node, false if fqn is the path to the property.
+ */
private boolean isNode(Fqn<String> fqn)
{
String items = (String)fqn.get(0);
@@ -196,6 +186,11 @@
return s.equals(JBossCacheStorage.NODES);
}
+ /**
+ *
+ * @param fqn
+ * @return Return uuid of item from fqn
+ */
private String parseUUID(Fqn<String> fqn)
{
if (fqn.size() > 1)
@@ -206,10 +201,9 @@
//remove slash
return uuid;
}
- else
- {
- return null;
- }
+
+ return null;
+
}
}
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/IndexerCacheLoader.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/cacheloader/IndexerCacheLoader.java 2009-11-19 16:19:28 UTC (rev 782)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/IndexerCacheLoader.java 2009-11-20 13:45:40 UTC (rev 790)
@@ -14,7 +14,7 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, see<http://www.gnu.org/licenses/>.
*/
-package org.exoplatform.services.jcr.impl.core.query.cacheloader;
+package org.exoplatform.services.jcr.impl.core.query.jbosscache;
import org.exoplatform.services.jcr.datamodel.PropertyData;
import org.exoplatform.services.jcr.impl.storage.jbosscache.AbstractWriteOnlyCacheLoader;
Added: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/IndexerInterceptor.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/IndexerInterceptor.java (rev 0)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/IndexerInterceptor.java 2009-11-20 13:45:40 UTC (rev 790)
@@ -0,0 +1,109 @@
+/*
+ * Copyright (C) 2009 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.jcr.impl.core.query.jbosscache;
+
+import org.exoplatform.services.jcr.impl.core.query.SearchManager;
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+import org.jboss.cache.InvocationContext;
+import org.jboss.cache.commands.tx.PrepareCommand;
+import org.jboss.cache.commands.tx.RollbackCommand;
+import org.jboss.cache.interceptors.base.CommandInterceptor;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.jcr.RepositoryException;
+
+/**
+ * @author <a href="mailto:Sergey.Kabashnyuk@exoplatform.org">Sergey Kabashnyuk</a>
+ * @version $Id: exo-jboss-codetemplates.xml 34360 2009-07-22 23:58:59Z ksm $
+ *
+ */
+public class IndexerInterceptor extends CommandInterceptor
+{
+ private final Log log = ExoLogger.getLogger(IndexerInterceptor.class);
+
+ /**
+ * List of index interceptor listeners.
+ */
+ private final List<SearchManager> indexInterceptorListners;
+
+ /**
+ * Default constructor.
+ */
+ public IndexerInterceptor()
+ {
+ super();
+ this.indexInterceptorListners = new ArrayList<SearchManager>();
+ }
+
+ /**
+ * Add new SearchManager to the indexInterceptorListners list.
+ * @param searchManager - search manager.
+ */
+ public void addIndexInterceptorListener(SearchManager searchManager)
+ {
+ indexInterceptorListners.add(searchManager);
+ }
+
+ /**
+ * Add new SearchManager to the indexInterceptorListners list.
+ * @param searchManager - search manager.
+ */
+ public boolean removeIndexInterceptorListener(SearchManager searchManager)
+ {
+ return indexInterceptorListners.remove(searchManager);
+ }
+
+ /**
+ * @see org.jboss.cache.commands.AbstractVisitor#visitPrepareCommand(org.jboss.cache.InvocationContext, org.jboss.cache.commands.tx.PrepareCommand)
+ */
+ @Override
+ public Object visitPrepareCommand(InvocationContext ctx, PrepareCommand command) throws Throwable
+ {
+ try
+ {
+ if (ctx.getTransactionContext().getModifications().size() > 0)
+ {
+ for (SearchManager searchManager : indexInterceptorListners)
+ {
+ searchManager.onSaveItems(ctx.getTransactionContext().getModifications());
+ }
+ }
+ }
+ catch (RepositoryException e)
+ {
+ //TODO handle rollback
+ log.error(e.getLocalizedMessage());
+ }
+
+ return invokeNextInterceptor(ctx, command);
+ }
+
+ /**
+ * @see org.jboss.cache.commands.AbstractVisitor#visitRollbackCommand(org.jboss.cache.InvocationContext, org.jboss.cache.commands.tx.RollbackCommand)
+ */
+ @Override
+ public Object visitRollbackCommand(InvocationContext ctx, RollbackCommand command) throws Throwable
+ {
+ //TODO new feature rollBack
+ return super.visitRollbackCommand(ctx, command);
+ }
+}
Property changes on: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/jbosscache/IndexerInterceptor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java 2009-11-20 13:04:43 UTC (rev 789)
+++ jcr/branches/1.12.0-JBC/component/core/src/main/java/org/exoplatform/services/jcr/impl/storage/jbosscache/JBossCacheWorkspaceDataContainer.java 2009-11-20 13:45:40 UTC (rev 790)
@@ -21,7 +21,7 @@
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
import org.exoplatform.services.jcr.config.RepositoryEntry;
import org.exoplatform.services.jcr.config.WorkspaceEntry;
-import org.exoplatform.services.jcr.impl.core.query.cacheloader.IndexInterceptor;
+import org.exoplatform.services.jcr.impl.core.query.jbosscache.IndexerInterceptor;
import org.exoplatform.services.jcr.impl.storage.WorkspaceDataContainerBase;
import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer;
import org.exoplatform.services.jcr.storage.WorkspaceDataContainer;
@@ -82,7 +82,7 @@
*/
public JBossCacheWorkspaceDataContainer(WorkspaceEntry wsConfig, RepositoryEntry repConfig,
InitialContextInitializer contextInit, ValueStoragePluginProvider valueStorageProvider,
- IndexInterceptor indexInterceptor) throws RepositoryConfigurationException, NamingException, RepositoryException,
+ IndexerInterceptor indexInterceptor) throws RepositoryConfigurationException, NamingException, RepositoryException,
IOException
{
this.repositoryName = repConfig.getName();
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java 2009-11-20 13:04:43 UTC (rev 789)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/impl/storage/jbosscache/IndexerCacheLoaderTest.java 2009-11-20 13:45:40 UTC (rev 790)
@@ -31,7 +31,7 @@
import org.exoplatform.services.jcr.impl.core.query.QueryHandler;
import org.exoplatform.services.jcr.impl.core.query.RepositoryIndexSearcherHolder;
import org.exoplatform.services.jcr.impl.core.query.SearchManager;
-import org.exoplatform.services.jcr.impl.core.query.cacheloader.IndexerCacheLoader;
+import org.exoplatform.services.jcr.impl.core.query.jbosscache.IndexerCacheLoader;
import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData;
import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData;
import org.jboss.cache.Modification;
16 years, 8 months
exo-jcr SVN: r789 - jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/api/writing.
by do-not-reply@jboss.org
Author: areshetnyak
Date: 2009-11-20 08:04:43 -0500 (Fri, 20 Nov 2009)
New Revision: 789
Modified:
jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/api/writing/TestSetProperty.java
Log:
EXOJCR-203 : The test TestSetProperty was fixed.
Modified: jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/api/writing/TestSetProperty.java
===================================================================
--- jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/api/writing/TestSetProperty.java 2009-11-20 12:27:00 UTC (rev 788)
+++ jcr/branches/1.12.0-JBC/component/core/src/test/java/org/exoplatform/services/jcr/api/writing/TestSetProperty.java 2009-11-20 13:04:43 UTC (rev 789)
@@ -18,16 +18,6 @@
*/
package org.exoplatform.services.jcr.api.writing;
-import org.exoplatform.services.jcr.JcrAPIBaseTest;
-import org.exoplatform.services.jcr.core.WorkspaceContainerFacade;
-import org.exoplatform.services.jcr.dataflow.ItemState;
-import org.exoplatform.services.jcr.dataflow.ItemStateChangesLog;
-import org.exoplatform.services.jcr.dataflow.TransactionChangesLog;
-import org.exoplatform.services.jcr.dataflow.persistent.ItemsPersistenceListener;
-import org.exoplatform.services.jcr.impl.core.SessionImpl;
-import org.exoplatform.services.jcr.impl.core.value.NameValue;
-import org.exoplatform.services.jcr.impl.dataflow.persistent.CacheableWorkspaceDataManager;
-
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
@@ -43,6 +33,16 @@
import javax.jcr.ValueFormatException;
import javax.jcr.version.OnParentVersionAction;
+import org.exoplatform.services.jcr.JcrAPIBaseTest;
+import org.exoplatform.services.jcr.core.WorkspaceContainerFacade;
+import org.exoplatform.services.jcr.dataflow.ItemState;
+import org.exoplatform.services.jcr.dataflow.ItemStateChangesLog;
+import org.exoplatform.services.jcr.dataflow.TransactionChangesLog;
+import org.exoplatform.services.jcr.dataflow.persistent.ItemsPersistenceListener;
+import org.exoplatform.services.jcr.impl.core.SessionImpl;
+import org.exoplatform.services.jcr.impl.core.value.NameValue;
+import org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePersistentDataManager;
+
/**
* Created by The eXo Platform SAS.
*
@@ -63,8 +63,8 @@
super.setUp();
WorkspaceContainerFacade wsc = repository.getWorkspaceContainer(session.getWorkspace().getName());
- CacheableWorkspaceDataManager dm =
- (CacheableWorkspaceDataManager)wsc.getComponent(CacheableWorkspaceDataManager.class);
+ WorkspacePersistentDataManager dm =
+ (WorkspacePersistentDataManager)wsc.getComponent(WorkspacePersistentDataManager.class);
dm.addItemPersistenceListener(this);
}
16 years, 8 months