exo-jcr SVN: r5858 - jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2012-03-13 08:28:14 -0400 (Tue, 13 Mar 2012)
New Revision: 5858
Modified:
jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/query-handler-config.xml
Log:
EXOJCR-1805 : update documentation
Modified: jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/query-handler-config.xml
===================================================================
--- jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/query-handler-config.xml 2012-03-13 12:27:54 UTC (rev 5857)
+++ jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/query-handler-config.xml 2012-03-13 12:28:14 UTC (rev 5858)
@@ -334,8 +334,8 @@
storages, databases and indexes, cluster nodes are synchronized
anytime. But it's an issue when local index strategy used. If new node
joins cluster, having no index it is retrieved or recreated. Node can
- be restarted also and thus index not empty. By default existing index
- is thought to be actual, but can be outdated. JCR offers a mechanism
+ be restarted also and thus index not empty. Usually existing index is
+ thought to be actual, but can be outdated. JCR offers a mechanism
called RecoveryFilters that will automatically retrieve index for the
joining node on startup. This feature is a set of filters that can be
defined via QueryHandler configuration:</para>
@@ -348,11 +348,16 @@
<property name="index-recovery-filter" value="org.exoplatform.services.jcr.impl.core.query.lucene.SystemPropertyRecoveryFilter" />
</programlisting>
- <para>If any one returns fires, the index is re-synchronized. This
- feature uses standard index recovery mode defined by previously
- described parameter (can be "from-indexing" or "from-coordinator"
- (default value))</para>
+ <para>If any one fires, the index is re-synchronized. Please take in
+ account, that DocNumberRecoveryFilter is used in cases when no filter
+ configured. So, if resynchronization should be blocked, or strictly
+ required on start, then ConfigurationPropertyRecoveryFilter can be
+ used.</para>
+ <para>This feature uses standard index recovery mode defined by
+ previously described parameter (can be "from-indexing" or
+ "from-coordinator" (default value))</para>
+
<programlisting language="xml"><property name="index-recovery-mode" value="from-coordinator" />
</programlisting>
14 years, 1 month
exo-jcr SVN: r5856 - jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2012-03-13 08:27:52 -0400 (Tue, 13 Mar 2012)
New Revision: 5856
Modified:
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
Log:
EXOJCR-1805 : adding DocNumberRecoveryFilter if noone configured
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java 2012-03-13 11:23:12 UTC (rev 5855)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java 2012-03-13 12:27:52 UTC (rev 5856)
@@ -84,16 +84,7 @@
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.security.PrivilegedAction;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
import java.util.concurrent.CountDownLatch;
import javax.jcr.RepositoryException;
@@ -525,7 +516,7 @@
*/
protected boolean isSuspended = false;
- protected Set<String> recoveryFilterClasses = new HashSet<String>();
+ protected final Set<String> recoveryFilterClasses;
protected List<AbstractRecoveryFilter> recoveryFilters = null;
@@ -547,6 +538,7 @@
this.cfm = cfm;
SearchIndexConfigurationHelper searchIndexConfigurationHelper = new SearchIndexConfigurationHelper(this);
searchIndexConfigurationHelper.init(queryHandlerConfig);
+ this.recoveryFilterClasses = new LinkedHashSet<String>();
}
/**
@@ -569,6 +561,7 @@
this.analyzer = new JcrStandartAnalyzer();
this.cfm = null;
this.wsId = null;
+ this.recoveryFilterClasses = new LinkedHashSet<String>();
}
/**
@@ -761,6 +754,11 @@
{
recoveryFilters = new ArrayList<AbstractRecoveryFilter>();
log.info("Initializing RecoveryFilters.");
+ // add default filter, if none configured.
+ if (recoveryFilterClasses.isEmpty())
+ {
+ this.recoveryFilterClasses.add(DocNumberRecoveryFilter.class.getName());
+ }
for (String recoveryFilterClassName : recoveryFilterClasses)
{
AbstractRecoveryFilter filter = null;
14 years, 1 month
exo-jcr SVN: r5857 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2012-03-13 08:27:54 -0400 (Tue, 13 Mar 2012)
New Revision: 5857
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
Log:
EXOJCR-1805 : adding DocNumberRecoveryFilter if noone configured
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java 2012-03-13 12:27:52 UTC (rev 5856)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java 2012-03-13 12:27:54 UTC (rev 5857)
@@ -81,16 +81,7 @@
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.security.PrivilegedAction;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
import java.util.concurrent.CountDownLatch;
import javax.jcr.RepositoryException;
@@ -532,7 +523,7 @@
*/
protected boolean isSuspended = false;
- protected Set<String> recoveryFilterClasses = new HashSet<String>();
+ protected final Set<String> recoveryFilterClasses;
protected List<AbstractRecoveryFilter> recoveryFilters = null;
@@ -554,6 +545,7 @@
this.cfm = cfm;
SearchIndexConfigurationHelper searchIndexConfigurationHelper = new SearchIndexConfigurationHelper(this);
searchIndexConfigurationHelper.init(queryHandlerConfig);
+ this.recoveryFilterClasses = new LinkedHashSet<String>();
}
/**
@@ -576,6 +568,7 @@
this.analyzer = new JcrStandartAnalyzer();
this.cfm = null;
this.wsId = null;
+ this.recoveryFilterClasses = new LinkedHashSet<String>();
}
/**
@@ -769,6 +762,11 @@
{
recoveryFilters = new ArrayList<AbstractRecoveryFilter>();
log.info("Initializing RecoveryFilters.");
+ // add default filter, if none configured.
+ if (recoveryFilterClasses.isEmpty())
+ {
+ this.recoveryFilterClasses.add(DocNumberRecoveryFilter.class.getName());
+ }
for (String recoveryFilterClassName : recoveryFilterClasses)
{
AbstractRecoveryFilter filter = null;
14 years, 1 month
exo-jcr SVN: r5855 - in jcr/branches/1.15.x: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache and 11 other directories.
by do-not-reply@jboss.org
Author: tolusha
Date: 2012-03-13 07:23:12 -0400 (Tue, 13 Mar 2012)
New Revision: 5855
Modified:
jcr/branches/1.15.x/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/ISPNCacheWorkspaceStorageCache.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/DBConstants.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/statistics/StatisticsJDBCStorageConnection.java
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/storage/WorkspaceStorageConnection.java
jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/BaseStandaloneTest.java
jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestMoveNode.java
jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestCacheableWorkspaceDataManager.java
jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestWorkspaceStorageCacheInClusterMode.java
jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/cache/jbosscache/TestJBossCacheWorkspaceStorageCache.java
jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCConnectionTestBase.java
Log:
EXOJCR-1788: allow to rename previously updated binary property
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2012-03-13 10:28:55 UTC (rev 5854)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2012-03-13 11:23:12 UTC (rev 5855)
@@ -1896,45 +1896,15 @@
FilePersistedValueData fpvd = (FilePersistedValueData)vd;
if (fpvd.getFile() == null)
{
- // need read from storage
- ValueData svd = getPropertyValue(prop.getIdentifier(), vd.getOrderNumber(), prop.getPersistedVersion());
-
- if (svd == null)
- {
- // error, value not found
- throw new RepositoryException("Value cannot be found in storage for cached Property "
- + prop.getQPath().getAsString() + ", orderNumb:" + vd.getOrderNumber() + ", pversion:"
- + prop.getPersistedVersion());
- }
-
- vals.set(i, svd);
+ // error, value not found
+ throw new RepositoryException("Value cannot be found in storage for cached Property "
+ + prop.getQPath().getAsString() + ", orderNumb:" + vd.getOrderNumber() + ", pversion:"
+ + prop.getPersistedVersion());
}
}
}
}
- /**
- * Gets the value content of the property defined by the given parameters
- * @param propertyId the id of the property
- * @param orderNumb the order number or the property
- * @param persistedVersion the persisted version of the property
- * @return the value content wrapped into a ValueData object
- * @throws IllegalStateException if connection is already closed
- * @throws RepositoryException if some exception occurred
- */
- protected ValueData getPropertyValue(String propertyId, int orderNumb, int persistedVersion)
- throws IllegalStateException, RepositoryException
- {
- final WorkspaceStorageConnection con = dataContainer.openConnection();
- try
- {
- return con.getValue(propertyId, orderNumb, persistedVersion);
- }
- finally
- {
- con.close();
- }
- }
/**
* {@inheritDoc}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 2012-03-13 10:28:55 UTC (rev 5854)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 2012-03-13 11:23:12 UTC (rev 5855)
@@ -54,9 +54,11 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.Calendar;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import javax.jcr.InvalidItemStateException;
@@ -481,6 +483,8 @@
// copy state
PlainChangesLogImpl newLog = PlainChangesLogImpl.createCopy(new ArrayList<ItemState>(), changesLog);
+ Map<String, PropertyData> lastUpdateStates = new HashMap<String, PropertyData>();
+
for (Iterator<ItemState> iter = changesLog.getAllStates().iterator(); iter.hasNext();)
{
ItemState prevState = iter.next();
@@ -509,50 +513,63 @@
if (prevData.getValues() != null) // null if it's DELETE state
{
List<ValueData> values = new ArrayList<ValueData>();
- for (int i = 0; i < prevData.getValues().size(); i++)
+
+ if (prevState.isRenamed() && lastUpdateStates.containsKey(prevState.getData().getIdentifier()))
{
- ValueData vd = prevData.getValues().get(i);
-
- if (vd instanceof TransientValueData)
+ values = lastUpdateStates.get(prevState.getData().getIdentifier()).getValues();
+ }
+ else
+ {
+ for (int i = 0; i < prevData.getValues().size(); i++)
{
- TransientValueData tvd = (TransientValueData)vd;
- ValueData pvd;
+ ValueData vd = prevData.getValues().get(i);
- if (vd.isByteArray())
+ if (vd instanceof TransientValueData)
{
- pvd = new ByteArrayPersistedValueData(i, vd.getAsByteArray());
- values.add(pvd);
- }
- else
- {
- File destFile = null;
+ TransientValueData tvd = (TransientValueData)vd;
+ ValueData pvd;
- if (tvd.getSpoolFile() != null)
+ if (vd.isByteArray())
{
- // spooled to temp file
- pvd = new StreamPersistedValueData(i, tvd.getSpoolFile(), destFile);
+ pvd = new ByteArrayPersistedValueData(i, vd.getAsByteArray());
+ values.add(pvd);
}
else
{
- // with original stream
- pvd = new StreamPersistedValueData(i, tvd.getOriginalStream(), destFile);
+ File destFile = null;
+
+ if (tvd.getSpoolFile() != null)
+ {
+ // spooled to temp file
+ pvd = new StreamPersistedValueData(i, tvd.getSpoolFile(), destFile);
+ }
+ else
+ {
+ // with original stream
+ pvd = new StreamPersistedValueData(i, tvd.getOriginalStream(), destFile);
+ }
+
+ values.add(pvd);
}
- values.add(pvd);
+ tvd.delegate(pvd);
}
-
- tvd.delegate(pvd);
+ else
+ {
+ values.add(vd);
+ }
}
- else
- {
- values.add(vd);
- }
}
newData =
new PersistedPropertyData(prevData.getIdentifier(), prevData.getQPath(), prevData
.getParentIdentifier(), prevData.getPersistedVersion() + 1, prevData.getType(), prevData
.isMultiValued(), values);
+
+ if (prevState.isAdded() || prevState.isUpdated())
+ {
+ lastUpdateStates.put(prevState.getData().getIdentifier(), (PropertyData)newData);
+ }
}
else
{
@@ -614,6 +631,9 @@
}
}
}
+
+ lastUpdateStates.clear(); //help to GC
+
return newLog;
}
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java 2012-03-13 10:28:55 UTC (rev 5854)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java 2012-03-13 11:23:12 UTC (rev 5855)
@@ -28,6 +28,8 @@
import org.exoplatform.services.jcr.config.WorkspaceEntry;
import org.exoplatform.services.jcr.dataflow.ItemState;
import org.exoplatform.services.jcr.dataflow.ItemStateChangesLog;
+import org.exoplatform.services.jcr.dataflow.persistent.PersistedNodeData;
+import org.exoplatform.services.jcr.dataflow.persistent.PersistedPropertyData;
import org.exoplatform.services.jcr.dataflow.persistent.WorkspaceStorageCache;
import org.exoplatform.services.jcr.dataflow.persistent.WorkspaceStorageCacheListener;
import org.exoplatform.services.jcr.datamodel.IllegalPathException;
@@ -49,7 +51,6 @@
import org.exoplatform.services.jcr.impl.backup.rdbms.DataRestoreContext;
import org.exoplatform.services.jcr.impl.core.itemfilters.QPathEntryFilter;
import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData;
-import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData;
import org.exoplatform.services.jcr.jbosscache.ExoJBossCacheFactory;
import org.exoplatform.services.jcr.jbosscache.PrivilegedJBossCacheHelper;
import org.exoplatform.services.jcr.jbosscache.ExoJBossCacheFactory.CacheType;
@@ -878,7 +879,7 @@
*/
public void onSaveItems(final ItemStateChangesLog itemStates)
{
- // if something happen we will rollback changes
+ // if something happen we will rollback changes
boolean rollback = true;
try
{
@@ -1776,38 +1777,6 @@
}
/**
- * Update Node hierarchy in case of same-name siblings reorder.
- * Assumes the new (updated) nodes already put in the cache. Previous name of updated nodes will be calculated
- * and that node will be deleted (if has same id as the new node). Children paths will be updated to a new node path.
- *
- * @param node NodeData
- * @param prevNode NodeData
- */
- protected void update(final NodeData node, final NodeData prevNode)
- {
- // get previously cached NodeData and using its name remove child on the parent
- Fqn<String> prevFqn =
- makeChildFqn(childNodes, node.getParentIdentifier(), prevNode.getQPath().getEntries()[prevNode.getQPath()
- .getEntries().length - 1]);
- if (node.getIdentifier().equals(cache.get(prevFqn, ITEM_ID)))
- {
- // it's same-name siblings re-ordering, delete previous child
- if (!cache.removeNode(prevFqn) && LOG.isDebugEnabled())
- {
- LOG.debug("Node not extists as a child but update asked " + node.getQPath().getAsString());
- }
- }
-
- // update childs paths if index changed
- int nodeIndex = node.getQPath().getEntries()[node.getQPath().getEntries().length - 1].getIndex();
- int prevNodeIndex = prevNode.getQPath().getEntries()[prevNode.getQPath().getEntries().length - 1].getIndex();
- if (nodeIndex != prevNodeIndex)
- {
- updateTreePath(node.getIdentifier(), node.getQPath(), null); // don't change ACL, it's same parent
- }
- }
-
- /**
* This method duplicate update method, except using getFromBuffer inside.
*
* @param node NodeData
@@ -1889,10 +1858,10 @@
NodeData prevNode = (NodeData)data;
- TransientNodeData newNode =
- new TransientNodeData(newPath, prevNode.getIdentifier(), prevNode.getPersistedVersion(),
- prevNode.getPrimaryTypeName(), prevNode.getMixinTypeNames(), prevNode.getOrderNumber(),
- prevNode.getParentIdentifier(), inheritACL ? acl : prevNode.getACL());
+ NodeData newNode =
+ new PersistedNodeData(prevNode.getIdentifier(), newPath, prevNode.getParentIdentifier(),
+ prevNode.getPersistedVersion(), prevNode.getOrderNumber(), prevNode.getPrimaryTypeName(),
+ prevNode.getMixinTypeNames(), inheritACL ? acl : prevNode.getACL());
// update this node
cache.put(makeItemFqn(newNode.getIdentifier()), ITEM_DATA, newNode);
}
@@ -1909,9 +1878,9 @@
inheritACL = false;
}
- TransientPropertyData newProp =
- new TransientPropertyData(newPath, prevProp.getIdentifier(), prevProp.getPersistedVersion(), prevProp
- .getType(), prevProp.getParentIdentifier(), prevProp.isMultiValued(), prevProp.getValues());
+ PropertyData newProp =
+ new PersistedPropertyData(prevProp.getIdentifier(), newPath, prevProp.getParentIdentifier(),
+ prevProp.getPersistedVersion(), prevProp.getType(), prevProp.isMultiValued(), prevProp.getValues());
cache.put(makeItemFqn(newProp.getIdentifier()), ITEM_DATA, newProp);
}
}
@@ -1919,57 +1888,6 @@
}
/**
- * Update Nodes tree with new path.
- *
- * @param parentId String - root node id of JCR subtree.
- * @param rootPath QPath
- * @param acl AccessControlList
- */
- protected void updateTreePath(final String parentId, final QPath rootPath, final AccessControlList acl)
- {
- boolean inheritACL = acl != null;
-
- // update properties
- for (Iterator<PropertyData> iter = new ChildPropertiesIterator<PropertyData>(parentId); iter.hasNext();)
- {
- PropertyData prevProp = iter.next();
-
- if (inheritACL
- && (prevProp.getQPath().getName().equals(Constants.EXO_PERMISSIONS) || prevProp.getQPath().getName()
- .equals(Constants.EXO_OWNER)))
- {
- inheritACL = false;
- }
- // recreate with new path for child Props only
- QPath newPath =
- QPath
- .makeChildPath(rootPath, prevProp.getQPath().getEntries()[prevProp.getQPath().getEntries().length - 1]);
- TransientPropertyData newProp =
- new TransientPropertyData(newPath, prevProp.getIdentifier(), prevProp.getPersistedVersion(), prevProp
- .getType(), prevProp.getParentIdentifier(), prevProp.isMultiValued(), prevProp.getValues());
- cache.put(makeItemFqn(newProp.getIdentifier()), ITEM_DATA, newProp);
- }
-
- // update child nodes
- for (Iterator<NodeData> iter = new ChildNodesIterator<NodeData>(parentId); iter.hasNext();)
- {
- NodeData prevNode = iter.next();
- // recreate with new path for child Nodes only
- QPath newPath =
- QPath
- .makeChildPath(rootPath, prevNode.getQPath().getEntries()[prevNode.getQPath().getEntries().length - 1]);
- TransientNodeData newNode =
- new TransientNodeData(newPath, prevNode.getIdentifier(), prevNode.getPersistedVersion(),
- prevNode.getPrimaryTypeName(), prevNode.getMixinTypeNames(), prevNode.getOrderNumber(),
- prevNode.getParentIdentifier(), inheritACL ? acl : prevNode.getACL());
- // update this node
- cache.put(makeItemFqn(newNode.getIdentifier()), ITEM_DATA, newNode);
- // update childs recursive
- updateTreePath(newNode.getIdentifier(), newNode.getQPath(), inheritACL ? acl : null);
- }
- }
-
- /**
* Update child Nodes ACLs.
*
* @param parentId String - root node id of JCR subtree.
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/DBConstants.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/DBConstants.java 2012-03-13 10:28:55 UTC (rev 5854)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/DBConstants.java 2012-03-13 11:23:12 UTC (rev 5855)
@@ -144,11 +144,6 @@
protected String FIND_VALUES_VSTORAGE_DESC_BY_PROPERTYID;
/**
- * FIND_VALUE_BY_PROPERTYID_OREDERNUMB.
- */
- protected String FIND_VALUE_BY_PROPERTYID_OREDERNUMB;
-
- /**
* FIND_NODES_BY_PARENTID.
*/
protected String FIND_NODES_BY_PARENTID;
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2012-03-13 10:28:55 UTC (rev 5854)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2012-03-13 11:23:12 UTC (rev 5855)
@@ -147,8 +147,6 @@
protected PreparedStatement findValuesDataByPropertyId;
- protected PreparedStatement findValueByPropertyIdOrderNumber;
-
protected PreparedStatement findNodesByParentId;
protected PreparedStatement findLastOrderNumberByParentId;
@@ -528,11 +526,6 @@
findValuesDataByPropertyId.close();
}
- if (findValueByPropertyIdOrderNumber != null)
- {
- findValueByPropertyIdOrderNumber.close();
- }
-
if (findNodesByParentId != null)
{
findNodesByParentId.close();
@@ -1453,54 +1446,6 @@
}
/**
- * Reads Property Value from persistent storage.
- *
- * @param propertyId String, Property id
- * @param orderNumb int, Value order number (in list of values)
- * @param persistedVersion int
- * @return ValueData
- * @throws RepositoryException if read error occurs
- */
- public ValueData getValue(String propertyId, int orderNumb, int persistedVersion) throws RepositoryException
- {
- try
- {
- String cid = getInternalId(propertyId);
- ResultSet valueRecord = findValueByPropertyIdOrderNumber(cid, orderNumb);
- try
- {
- if (valueRecord.next())
- {
- String storageId = valueRecord.getString(COLUMN_VSTORAGE_DESC);
- return valueRecord.wasNull() ? readValueData(cid, orderNumb, persistedVersion,
- valueRecord.getBinaryStream(COLUMN_VDATA)) : readValueData(propertyId, orderNumb, storageId);
- }
-
- return null;
- }
- finally
- {
- try
- {
- valueRecord.close();
- }
- catch (SQLException e)
- {
- LOG.error("Can't close the ResultSet ", e);
- }
- }
- }
- catch (SQLException e)
- {
- throw new RepositoryException(e);
- }
- catch (IOException e)
- {
- throw new RepositoryException(e);
- }
- }
-
- /**
* Reads count of nodes in workspace.
*
* @return
@@ -2896,8 +2841,6 @@
protected abstract ResultSet findValuesStorageDescriptorsByPropertyId(String cid) throws SQLException;
- protected abstract ResultSet findValueByPropertyIdOrderNumber(String cid, int orderNumb) throws SQLException;
-
protected abstract ResultSet findMaxPropertyVersion(String parentId, String name, int index) throws SQLException;
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java 2012-03-13 10:28:55 UTC (rev 5854)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java 2012-03-13 11:23:12 UTC (rev 5855)
@@ -111,9 +111,6 @@
FIND_VALUES_VSTORAGE_DESC_BY_PROPERTYID =
"select distinct STORAGE_DESC from " + JCR_VALUE + " where PROPERTY_ID=?";
- FIND_VALUE_BY_PROPERTYID_OREDERNUMB =
- "select DATA, STORAGE_DESC from " + JCR_VALUE + " where PROPERTY_ID=? and ORDER_NUM=?";
-
FIND_NODES_BY_PARENTID =
"select * from " + JCR_ITEM + " where I_CLASS=1 and PARENT_ID=?" + " order by N_ORDER_NUM";
@@ -562,26 +559,6 @@
* {@inheritDoc}
*/
@Override
- protected ResultSet findValueByPropertyIdOrderNumber(String cid, int orderNumb) throws SQLException
- {
- if (findValueByPropertyIdOrderNumber == null)
- {
- findValueByPropertyIdOrderNumber = dbConnection.prepareStatement(FIND_VALUE_BY_PROPERTYID_OREDERNUMB);
- }
- else
- {
- findValueByPropertyIdOrderNumber.clearParameters();
- }
-
- findValueByPropertyIdOrderNumber.setString(1, cid);
- findValueByPropertyIdOrderNumber.setInt(2, orderNumb);
- return findValueByPropertyIdOrderNumber.executeQuery();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
protected int renameNode(NodeData data) throws SQLException
{
if (renameNode == null)
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2012-03-13 10:28:55 UTC (rev 5854)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2012-03-13 11:23:12 UTC (rev 5855)
@@ -116,9 +116,6 @@
FIND_VALUES_VSTORAGE_DESC_BY_PROPERTYID = "select distinct STORAGE_DESC from JCR_SVALUE where PROPERTY_ID=?";
- FIND_VALUE_BY_PROPERTYID_OREDERNUMB =
- "select DATA, STORAGE_DESC from JCR_SVALUE where PROPERTY_ID=? and ORDER_NUM=?";
-
FIND_NODES_BY_PARENTID =
"select * from JCR_SITEM" + " where I_CLASS=1 and CONTAINER_NAME=? and PARENT_ID=?" + " order by N_ORDER_NUM";
@@ -591,26 +588,6 @@
* {@inheritDoc}
*/
@Override
- protected ResultSet findValueByPropertyIdOrderNumber(String cid, int orderNumb) throws SQLException
- {
- if (findValueByPropertyIdOrderNumber == null)
- {
- findValueByPropertyIdOrderNumber = dbConnection.prepareStatement(FIND_VALUE_BY_PROPERTYID_OREDERNUMB);
- }
- else
- {
- findValueByPropertyIdOrderNumber.clearParameters();
- }
-
- findValueByPropertyIdOrderNumber.setString(1, cid);
- findValueByPropertyIdOrderNumber.setInt(2, orderNumb);
- return findValueByPropertyIdOrderNumber.executeQuery();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
protected int renameNode(NodeData data) throws SQLException
{
if (renameNode == null)
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java 2012-03-13 10:28:55 UTC (rev 5854)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java 2012-03-13 11:23:12 UTC (rev 5855)
@@ -137,9 +137,6 @@
FIND_VALUES_VSTORAGE_DESC_BY_PROPERTYID =
"select distinct STORAGE_DESC from " + JCR_VALUE + " where PROPERTY_ID=?";
- FIND_VALUE_BY_PROPERTYID_OREDERNUMB =
- "select DATA, STORAGE_DESC from " + JCR_VALUE + " where PROPERTY_ID=? and ORDER_NUM=?";
-
FIND_NODES_BY_PARENTID =
"select * from " + JCR_ITEM + " where I_CLASS=1 and PARENT_ID=?" + " order by N_ORDER_NUM";
@@ -745,26 +742,6 @@
* {@inheritDoc}
*/
@Override
- protected ResultSet findValueByPropertyIdOrderNumber(String cid, int orderNumb) throws SQLException
- {
- if (findValueByPropertyIdOrderNumber == null)
- {
- findValueByPropertyIdOrderNumber = dbConnection.prepareStatement(FIND_VALUE_BY_PROPERTYID_OREDERNUMB);
- }
- else
- {
- findValueByPropertyIdOrderNumber.clearParameters();
- }
-
- findValueByPropertyIdOrderNumber.setString(1, cid);
- findValueByPropertyIdOrderNumber.setInt(2, orderNumb);
- return findValueByPropertyIdOrderNumber.executeQuery();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
protected int renameNode(NodeData data) throws SQLException
{
if (renameNode == null)
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java 2012-03-13 10:28:55 UTC (rev 5854)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java 2012-03-13 11:23:12 UTC (rev 5855)
@@ -138,9 +138,6 @@
FIND_VALUES_VSTORAGE_DESC_BY_PROPERTYID = "select distinct STORAGE_DESC from JCR_SVALUE where PROPERTY_ID=?";
- FIND_VALUE_BY_PROPERTYID_OREDERNUMB =
- "select DATA, STORAGE_DESC from JCR_SVALUE where PROPERTY_ID=? and ORDER_NUM=?";
-
FIND_NODES_BY_PARENTID =
"select * from JCR_SITEM" + " where I_CLASS=1 and CONTAINER_NAME=? and PARENT_ID=?" + " order by N_ORDER_NUM";
@@ -674,26 +671,6 @@
* {@inheritDoc}
*/
@Override
- protected ResultSet findValueByPropertyIdOrderNumber(String cid, int orderNumb) throws SQLException
- {
- if (findValueByPropertyIdOrderNumber == null)
- {
- findValueByPropertyIdOrderNumber = dbConnection.prepareStatement(FIND_VALUE_BY_PROPERTYID_OREDERNUMB);
- }
- else
- {
- findValueByPropertyIdOrderNumber.clearParameters();
- }
-
- findValueByPropertyIdOrderNumber.setString(1, cid);
- findValueByPropertyIdOrderNumber.setInt(2, orderNumb);
- return findValueByPropertyIdOrderNumber.executeQuery();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
protected int renameNode(NodeData data) throws SQLException
{
if (renameNode == null)
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/statistics/StatisticsJDBCStorageConnection.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/statistics/StatisticsJDBCStorageConnection.java 2012-03-13 10:28:55 UTC (rev 5854)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/statistics/StatisticsJDBCStorageConnection.java 2012-03-13 11:23:12 UTC (rev 5855)
@@ -21,7 +21,6 @@
import org.exoplatform.services.jcr.datamodel.NodeData;
import org.exoplatform.services.jcr.datamodel.PropertyData;
import org.exoplatform.services.jcr.datamodel.QPathEntry;
-import org.exoplatform.services.jcr.datamodel.ValueData;
import org.exoplatform.services.jcr.impl.core.itemfilters.QPathEntryFilter;
import org.exoplatform.services.jcr.impl.dataflow.persistent.ACLHolder;
import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer;
@@ -94,12 +93,6 @@
/**
* The description of the statistics corresponding to the method
- * <code>getValue(String propertyId, int orderNumb, int persistedVersion)</code>
- */
- private static final String GET_VALUE_DESCR = "getValue";
-
- /**
- * The description of the statistics corresponding to the method
* <code>isOpened()</code>
*/
private static final String IS_OPENED_DESCR = "isOpened";
@@ -223,7 +216,6 @@
ALL_STATISTICS.put(LIST_CHILD_PROPERTIES_DATA_DESCR, new Statistics(GLOBAL_STATISTICS,
LIST_CHILD_PROPERTIES_DATA_DESCR));
ALL_STATISTICS.put(GET_REFERENCES_DATA_DESCR, new Statistics(GLOBAL_STATISTICS, GET_REFERENCES_DATA_DESCR));
- ALL_STATISTICS.put(GET_VALUE_DESCR, new Statistics(GLOBAL_STATISTICS, GET_VALUE_DESCR));
ALL_STATISTICS.put(GET_ACL_HOLDERS, new Statistics(GLOBAL_STATISTICS, GET_ACL_HOLDERS));
//Get nodes count
ALL_STATISTICS.put(NODES_COUNT, new Statistics(GLOBAL_STATISTICS, NODES_COUNT));
@@ -575,24 +567,6 @@
s.end();
}
}
-
- /**
- * {@inheritDoc}
- */
- public ValueData getValue(String propertyId, int orderNumb, int persistedVersion) throws IllegalStateException,
- RepositoryException
- {
- Statistics s = ALL_STATISTICS.get(GET_VALUE_DESCR);
- try
- {
- s.begin();
- return wcs.getValue(propertyId, orderNumb, persistedVersion);
- }
- finally
- {
- s.end();
- }
- }
/**
* {@inheritDoc}
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/storage/WorkspaceStorageConnection.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/storage/WorkspaceStorageConnection.java 2012-03-13 10:28:55 UTC (rev 5854)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/storage/WorkspaceStorageConnection.java 2012-03-13 11:23:12 UTC (rev 5855)
@@ -23,7 +23,6 @@
import org.exoplatform.services.jcr.datamodel.NodeData;
import org.exoplatform.services.jcr.datamodel.PropertyData;
import org.exoplatform.services.jcr.datamodel.QPathEntry;
-import org.exoplatform.services.jcr.datamodel.ValueData;
import org.exoplatform.services.jcr.impl.core.itemfilters.QPathEntryFilter;
import org.exoplatform.services.jcr.impl.dataflow.persistent.ACLHolder;
@@ -205,23 +204,6 @@
UnsupportedOperationException;
/**
- * Gets the value content of the property defined by the given parameters.
- *
- * @param propertyId
- * the id of the property
- * @param orderNumb
- * the order number or the property
- * @param persistedVersion
- * the persisted version of the property
- * @return the value content wrapped into a ValueData object
- * @throws IllegalStateException
- * if connection is already closed
- * @throws RepositoryException
- * if some exception occurred
- */
- ValueData getValue(String propertyId, int orderNumb, int persistedVersion) throws IllegalStateException, RepositoryException;
-
- /**
* Get child Nodes of the parent node.
*
* @param parent
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/BaseStandaloneTest.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/BaseStandaloneTest.java 2012-03-13 10:28:55 UTC (rev 5854)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/BaseStandaloneTest.java 2012-03-13 11:23:12 UTC (rev 5855)
@@ -30,7 +30,6 @@
import org.exoplatform.services.jcr.datamodel.NodeData;
import org.exoplatform.services.jcr.datamodel.PropertyData;
import org.exoplatform.services.jcr.datamodel.QPathEntry;
-import org.exoplatform.services.jcr.datamodel.ValueData;
import org.exoplatform.services.jcr.impl.core.ItemImpl;
import org.exoplatform.services.jcr.impl.core.NodeImpl;
import org.exoplatform.services.jcr.impl.core.RepositoryImpl;
@@ -720,16 +719,6 @@
}
/**
- * @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnection#getValue(java.lang.String, int, int)
- */
-
- public ValueData getValue(String propertyId, int orderNumb, int persistedVersion) throws IllegalStateException,
- RepositoryException
- {
- return null;
- }
-
- /**
* @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnection#getChildNodesDataByPage(org.exoplatform.services.jcr.datamodel.NodeData, int, int, java.util.List)
*/
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestMoveNode.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestMoveNode.java 2012-03-13 10:28:55 UTC (rev 5854)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestMoveNode.java 2012-03-13 11:23:12 UTC (rev 5855)
@@ -27,6 +27,7 @@
import org.exoplatform.services.jcr.storage.WorkspaceDataContainer;
import org.exoplatform.services.jcr.util.TesterConfigurationHelper;
+import java.io.ByteArrayInputStream;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.ArrayList;
@@ -34,8 +35,10 @@
import java.util.List;
import java.util.Random;
+import javax.jcr.Item;
import javax.jcr.Node;
import javax.jcr.PathNotFoundException;
+import javax.jcr.Property;
import javax.jcr.RepositoryException;
/**
@@ -209,6 +212,59 @@
}
+ public void testRenameNodeWithBinaryProperty() throws Exception
+ {
+ Node parentNode = root.addNode("testRenameNodeWithBinaryProperty");
+ String path = parentNode.getPath();
+ String value = "my Property Value";
+
+ parentNode.setProperty("myBinaryData", new ByteArrayInputStream(value.getBytes("UTF-8")));
+ root.save();
+
+ value = "my Property Value 2";
+ parentNode.setProperty("myBinaryData", new ByteArrayInputStream(value.getBytes("UTF-8")));
+ session.move(path, path + "2");
+
+ value = "my Property Value 3";
+ parentNode.setProperty("myBinaryData", new ByteArrayInputStream(value.getBytes("UTF-8")));
+ session.move(path + "2", path + "3");
+ session.save();
+
+ Item i = session.getItem(path + "3/myBinaryData");
+
+ assertTrue(i instanceof Property);
+
+ Property p = (Property)i;
+ InputStream is = p.getStream();
+ byte[] bValue = new byte[is.available()];
+ is.read(bValue);
+ is.close();
+
+ assertEquals(value, new String(bValue, "UTF-8"));
+ }
+
+ public void testRenameNodeWithBinaryProperty2() throws Exception
+ {
+ Node parentNode = root.addNode("testRenameNodeWithBinaryProperty");
+ String path = parentNode.getPath();
+
+ String value = "my Property Value";
+ parentNode.setProperty("myBinaryData", new ByteArrayInputStream(value.getBytes("UTF-8")));
+ session.move(path, path + "2");
+ session.save();
+
+ Item i = session.getItem(path + "2/myBinaryData");
+
+ assertTrue(i instanceof Property);
+ Property p = (Property)i;
+ InputStream is = p.getStream();
+ byte[] bValue = new byte[is.available()];
+ is.read(bValue);
+ is.close();
+
+ assertEquals(value, new String(bValue, "UTF-8"));
+ }
+
public void testLocalBigFiles() throws Exception
{
Node testBinaryValue = root.addNode("testBinaryValue");
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestCacheableWorkspaceDataManager.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestCacheableWorkspaceDataManager.java 2012-03-13 10:28:55 UTC (rev 5854)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestCacheableWorkspaceDataManager.java 2012-03-13 11:23:12 UTC (rev 5855)
@@ -605,12 +605,6 @@
return null;
}
- public ValueData getValue(String propertyId, int orderNumb, int persistedVersion) throws IllegalStateException,
- RepositoryException
- {
- return null;
- }
-
public boolean getChildNodesDataByPage(NodeData parent, int fromOrderNum, int toOrderNum, List<NodeData> childs)
throws RepositoryException
{
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestWorkspaceStorageCacheInClusterMode.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestWorkspaceStorageCacheInClusterMode.java 2012-03-13 10:28:55 UTC (rev 5854)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestWorkspaceStorageCacheInClusterMode.java 2012-03-13 11:23:12 UTC (rev 5855)
@@ -951,12 +951,6 @@
return children;
}
- public ValueData getValue(String propertyId, int orderNumb, int persistedVersion) throws IllegalStateException,
- RepositoryException
- {
- return null;
- }
-
public boolean getChildNodesDataByPage(NodeData parent, int fromOrderNum, int toOrderNum, List<NodeData> childs)
throws RepositoryException
{
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/cache/jbosscache/TestJBossCacheWorkspaceStorageCache.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/cache/jbosscache/TestJBossCacheWorkspaceStorageCache.java 2012-03-13 10:28:55 UTC (rev 5854)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/cache/jbosscache/TestJBossCacheWorkspaceStorageCache.java 2012-03-13 11:23:12 UTC (rev 5855)
@@ -33,7 +33,6 @@
import org.exoplatform.services.jcr.datamodel.NodeData;
import org.exoplatform.services.jcr.datamodel.PropertyData;
import org.exoplatform.services.jcr.datamodel.QPathEntry;
-import org.exoplatform.services.jcr.datamodel.ValueData;
import org.exoplatform.services.jcr.impl.Constants;
import org.exoplatform.services.jcr.impl.core.itemfilters.QPathEntryFilter;
import org.exoplatform.services.jcr.impl.dataflow.persistent.ACLHolder;
@@ -316,12 +315,6 @@
return getChildNodesData(parent);
}
- public ValueData getValue(String propertyId, int orderNumb, int persistedVersion) throws IllegalStateException,
- RepositoryException
- {
- return null;
- }
-
public boolean getChildNodesDataByPage(NodeData parent, int fromOrderNum, int toOrderNum, List<NodeData> childs)
throws RepositoryException
{
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCConnectionTestBase.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCConnectionTestBase.java 2012-03-13 10:28:55 UTC (rev 5854)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCConnectionTestBase.java 2012-03-13 11:23:12 UTC (rev 5855)
@@ -254,16 +254,4 @@
rs.next();
assertEquals(rsRemote.getString("STORAGE_DESC"), rs.getString("STORAGE_DESC"));
}
-
- public void testFindValueByPropertyIdOrderNumber() throws Exception
- {
-
- ResultSet rsRemote = jdbcConn.findValueByPropertyIdOrderNumber("A", 16);
- rsRemote.next();
- ResultSet rs =
- connect.createStatement().executeQuery(
- "select DATA from " + "JCR_" + tableType + "VALUE" + " where PROPERTY_ID='A' and ORDER_NUM=16");
- rs.next();
- assertEquals(rsRemote.getString("DATA"), rs.getString("DATA"));
- }
}
Modified: jcr/branches/1.15.x/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/ISPNCacheWorkspaceStorageCache.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/ISPNCacheWorkspaceStorageCache.java 2012-03-13 10:28:55 UTC (rev 5854)
+++ jcr/branches/1.15.x/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/ISPNCacheWorkspaceStorageCache.java 2012-03-13 11:23:12 UTC (rev 5855)
@@ -27,6 +27,8 @@
import org.exoplatform.services.jcr.config.WorkspaceEntry;
import org.exoplatform.services.jcr.dataflow.ItemState;
import org.exoplatform.services.jcr.dataflow.ItemStateChangesLog;
+import org.exoplatform.services.jcr.dataflow.persistent.PersistedNodeData;
+import org.exoplatform.services.jcr.dataflow.persistent.PersistedPropertyData;
import org.exoplatform.services.jcr.dataflow.persistent.WorkspaceStorageCache;
import org.exoplatform.services.jcr.dataflow.persistent.WorkspaceStorageCacheListener;
import org.exoplatform.services.jcr.datamodel.IllegalPathException;
14 years, 1 month
exo-jcr SVN: r5854 - in jcr/trunk: exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache and 12 other directories.
by do-not-reply@jboss.org
Author: tolusha
Date: 2012-03-13 06:28:55 -0400 (Tue, 13 Mar 2012)
New Revision: 5854
Modified:
jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/ISPNCacheWorkspaceStorageCache.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/WorkspacePersistentDataManager.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.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/DBConstants.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/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/TestMoveNode.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
jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCConnectionTestBase.java
Log:
EXOJCR-1788: allow to rename previously updated binary property
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 2012-03-13 09:17:20 UTC (rev 5853)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/CacheableWorkspaceDataManager.java 2012-03-13 10:28:55 UTC (rev 5854)
@@ -1916,45 +1916,15 @@
FilePersistedValueData fpvd = (FilePersistedValueData)vd;
if (fpvd.getFile() == null)
{
- // need read from storage
- ValueData svd = getPropertyValue(prop.getIdentifier(), vd.getOrderNumber(), prop.getPersistedVersion());
-
- if (svd == null)
- {
- // error, value not found
- throw new RepositoryException("Value cannot be found in storage for cached Property "
- + prop.getQPath().getAsString() + ", orderNumb:" + vd.getOrderNumber() + ", pversion:"
- + prop.getPersistedVersion());
- }
-
- vals.set(i, svd);
+ // error, value not found
+ throw new RepositoryException("Value cannot be found in storage for cached Property "
+ + prop.getQPath().getAsString() + ", orderNumb:" + vd.getOrderNumber() + ", pversion:"
+ + prop.getPersistedVersion());
}
}
}
}
- /**
- * Gets the value content of the property defined by the given parameters
- * @param propertyId the id of the property
- * @param orderNumb the order number or the property
- * @param persistedVersion the persisted version of the property
- * @return the value content wrapped into a ValueData object
- * @throws IllegalStateException if connection is already closed
- * @throws RepositoryException if some exception occurred
- */
- protected ValueData getPropertyValue(String propertyId, int orderNumb, int persistedVersion)
- throws IllegalStateException, RepositoryException
- {
- final WorkspaceStorageConnection con = dataContainer.openConnection();
- try
- {
- return con.getValue(propertyId, orderNumb, persistedVersion);
- }
- finally
- {
- con.close();
- }
- }
/**
* {@inheritDoc}
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 2012-03-13 09:17:20 UTC (rev 5853)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 2012-03-13 10:28:55 UTC (rev 5854)
@@ -54,9 +54,11 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.Calendar;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import javax.jcr.InvalidItemStateException;
@@ -481,6 +483,8 @@
// copy state
PlainChangesLogImpl newLog = PlainChangesLogImpl.createCopy(new ArrayList<ItemState>(), changesLog);
+ Map<String, PropertyData> lastUpdateStates = new HashMap<String, PropertyData>();
+
for (Iterator<ItemState> iter = changesLog.getAllStates().iterator(); iter.hasNext();)
{
ItemState prevState = iter.next();
@@ -509,50 +513,63 @@
if (prevData.getValues() != null) // null if it's DELETE state
{
List<ValueData> values = new ArrayList<ValueData>();
- for (int i = 0; i < prevData.getValues().size(); i++)
+
+ if (prevState.isRenamed() && lastUpdateStates.containsKey(prevState.getData().getIdentifier()))
{
- ValueData vd = prevData.getValues().get(i);
-
- if (vd instanceof TransientValueData)
+ values = lastUpdateStates.get(prevState.getData().getIdentifier()).getValues();
+ }
+ else
+ {
+ for (int i = 0; i < prevData.getValues().size(); i++)
{
- TransientValueData tvd = (TransientValueData)vd;
- ValueData pvd;
+ ValueData vd = prevData.getValues().get(i);
- if (vd.isByteArray())
+ if (vd instanceof TransientValueData)
{
- pvd = new ByteArrayPersistedValueData(i, vd.getAsByteArray());
- values.add(pvd);
- }
- else
- {
- File destFile = null;
+ TransientValueData tvd = (TransientValueData)vd;
+ ValueData pvd;
- if (tvd.getSpoolFile() != null)
+ if (vd.isByteArray())
{
- // spooled to temp file
- pvd = new StreamPersistedValueData(i, tvd.getSpoolFile(), destFile);
+ pvd = new ByteArrayPersistedValueData(i, vd.getAsByteArray());
+ values.add(pvd);
}
else
{
- // with original stream
- pvd = new StreamPersistedValueData(i, tvd.getOriginalStream(), destFile);
+ File destFile = null;
+
+ if (tvd.getSpoolFile() != null)
+ {
+ // spooled to temp file
+ pvd = new StreamPersistedValueData(i, tvd.getSpoolFile(), destFile);
+ }
+ else
+ {
+ // with original stream
+ pvd = new StreamPersistedValueData(i, tvd.getOriginalStream(), destFile);
+ }
+
+ values.add(pvd);
}
- values.add(pvd);
+ tvd.delegate(pvd);
}
-
- tvd.delegate(pvd);
+ else
+ {
+ values.add(vd);
+ }
}
- else
- {
- values.add(vd);
- }
}
newData =
new PersistedPropertyData(prevData.getIdentifier(), prevData.getQPath(), prevData
.getParentIdentifier(), prevData.getPersistedVersion() + 1, prevData.getType(), prevData
.isMultiValued(), values);
+
+ if (prevState.isAdded() || prevState.isUpdated())
+ {
+ lastUpdateStates.put(prevState.getData().getIdentifier(), (PropertyData)newData);
+ }
}
else
{
@@ -614,6 +631,9 @@
}
}
}
+
+ lastUpdateStates.clear(); //help to GC
+
return newLog;
}
}
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java 2012-03-13 09:17:20 UTC (rev 5853)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java 2012-03-13 10:28:55 UTC (rev 5854)
@@ -28,6 +28,8 @@
import org.exoplatform.services.jcr.config.WorkspaceEntry;
import org.exoplatform.services.jcr.dataflow.ItemState;
import org.exoplatform.services.jcr.dataflow.ItemStateChangesLog;
+import org.exoplatform.services.jcr.dataflow.persistent.PersistedNodeData;
+import org.exoplatform.services.jcr.dataflow.persistent.PersistedPropertyData;
import org.exoplatform.services.jcr.dataflow.persistent.WorkspaceStorageCache;
import org.exoplatform.services.jcr.dataflow.persistent.WorkspaceStorageCacheListener;
import org.exoplatform.services.jcr.datamodel.IllegalPathException;
@@ -49,7 +51,6 @@
import org.exoplatform.services.jcr.impl.backup.rdbms.DataRestoreContext;
import org.exoplatform.services.jcr.impl.core.itemfilters.QPathEntryFilter;
import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData;
-import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData;
import org.exoplatform.services.jcr.jbosscache.ExoJBossCacheFactory;
import org.exoplatform.services.jcr.jbosscache.ExoJBossCacheFactory.CacheType;
import org.exoplatform.services.log.ExoLogger;
@@ -866,7 +867,7 @@
*/
public void onSaveItems(final ItemStateChangesLog itemStates)
{
- // if something happen we will rollback changes
+ // if something happen we will rollback changes
boolean rollback = true;
try
{
@@ -1766,38 +1767,6 @@
}
/**
- * Update Node hierarchy in case of same-name siblings reorder.
- * Assumes the new (updated) nodes already put in the cache. Previous name of updated nodes will be calculated
- * and that node will be deleted (if has same id as the new node). Children paths will be updated to a new node path.
- *
- * @param node NodeData
- * @param prevNode NodeData
- */
- protected void update(final NodeData node, final NodeData prevNode)
- {
- // get previously cached NodeData and using its name remove child on the parent
- Fqn<String> prevFqn =
- makeChildFqn(childNodes, node.getParentIdentifier(), prevNode.getQPath().getEntries()[prevNode.getQPath()
- .getEntries().length - 1]);
- if (node.getIdentifier().equals(cache.get(prevFqn, ITEM_ID)))
- {
- // it's same-name siblings re-ordering, delete previous child
- if (!cache.removeNode(prevFqn) && LOG.isDebugEnabled())
- {
- LOG.debug("Node not extists as a child but update asked " + node.getQPath().getAsString());
- }
- }
-
- // update childs paths if index changed
- int nodeIndex = node.getQPath().getEntries()[node.getQPath().getEntries().length - 1].getIndex();
- int prevNodeIndex = prevNode.getQPath().getEntries()[prevNode.getQPath().getEntries().length - 1].getIndex();
- if (nodeIndex != prevNodeIndex)
- {
- updateTreePath(node.getIdentifier(), node.getQPath(), null); // don't change ACL, it's same parent
- }
- }
-
- /**
* This method duplicate update method, except using getFromBuffer inside.
*
* @param node NodeData
@@ -1876,10 +1845,10 @@
NodeData prevNode = (NodeData)data;
- TransientNodeData newNode =
- new TransientNodeData(newPath, prevNode.getIdentifier(), prevNode.getPersistedVersion(),
- prevNode.getPrimaryTypeName(), prevNode.getMixinTypeNames(), prevNode.getOrderNumber(),
- prevNode.getParentIdentifier(), inheritACL ? acl : prevNode.getACL());
+ NodeData newNode =
+ new PersistedNodeData(prevNode.getIdentifier(), newPath, prevNode.getParentIdentifier(),
+ prevNode.getPersistedVersion(), prevNode.getOrderNumber(), prevNode.getPrimaryTypeName(),
+ prevNode.getMixinTypeNames(), inheritACL ? acl : prevNode.getACL());
// update this node
cache.put(makeItemFqn(newNode.getIdentifier()), ITEM_DATA, newNode);
}
@@ -1896,9 +1865,9 @@
inheritACL = false;
}
- TransientPropertyData newProp =
- new TransientPropertyData(newPath, prevProp.getIdentifier(), prevProp.getPersistedVersion(), prevProp
- .getType(), prevProp.getParentIdentifier(), prevProp.isMultiValued(), prevProp.getValues());
+ PropertyData newProp =
+ new PersistedPropertyData(prevProp.getIdentifier(), newPath, prevProp.getParentIdentifier(),
+ prevProp.getPersistedVersion(), prevProp.getType(), prevProp.isMultiValued(), prevProp.getValues());
cache.put(makeItemFqn(newProp.getIdentifier()), ITEM_DATA, newProp);
}
}
@@ -1906,57 +1875,6 @@
}
/**
- * Update Nodes tree with new path.
- *
- * @param parentId String - root node id of JCR subtree.
- * @param rootPath QPath
- * @param acl AccessControlList
- */
- protected void updateTreePath(final String parentId, final QPath rootPath, final AccessControlList acl)
- {
- boolean inheritACL = acl != null;
-
- // update properties
- for (Iterator<PropertyData> iter = new ChildPropertiesIterator<PropertyData>(parentId); iter.hasNext();)
- {
- PropertyData prevProp = iter.next();
-
- if (inheritACL
- && (prevProp.getQPath().getName().equals(Constants.EXO_PERMISSIONS) || prevProp.getQPath().getName()
- .equals(Constants.EXO_OWNER)))
- {
- inheritACL = false;
- }
- // recreate with new path for child Props only
- QPath newPath =
- QPath
- .makeChildPath(rootPath, prevProp.getQPath().getEntries()[prevProp.getQPath().getEntries().length - 1]);
- TransientPropertyData newProp =
- new TransientPropertyData(newPath, prevProp.getIdentifier(), prevProp.getPersistedVersion(), prevProp
- .getType(), prevProp.getParentIdentifier(), prevProp.isMultiValued(), prevProp.getValues());
- cache.put(makeItemFqn(newProp.getIdentifier()), ITEM_DATA, newProp);
- }
-
- // update child nodes
- for (Iterator<NodeData> iter = new ChildNodesIterator<NodeData>(parentId); iter.hasNext();)
- {
- NodeData prevNode = iter.next();
- // recreate with new path for child Nodes only
- QPath newPath =
- QPath
- .makeChildPath(rootPath, prevNode.getQPath().getEntries()[prevNode.getQPath().getEntries().length - 1]);
- TransientNodeData newNode =
- new TransientNodeData(newPath, prevNode.getIdentifier(), prevNode.getPersistedVersion(),
- prevNode.getPrimaryTypeName(), prevNode.getMixinTypeNames(), prevNode.getOrderNumber(),
- prevNode.getParentIdentifier(), inheritACL ? acl : prevNode.getACL());
- // update this node
- cache.put(makeItemFqn(newNode.getIdentifier()), ITEM_DATA, newNode);
- // update childs recursive
- updateTreePath(newNode.getIdentifier(), newNode.getQPath(), inheritACL ? acl : null);
- }
- }
-
- /**
* Update child Nodes ACLs.
*
* @param parentId String - root node id of JCR subtree.
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 2012-03-13 09:17:20 UTC (rev 5853)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/inmemory/InmemoryStorageConnection.java 2012-03-13 10:28:55 UTC (rev 5854)
@@ -355,15 +355,6 @@
}
/**
- * @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnection#getValue(java.lang.String, int, int)
- */
- public ValueData getValue(String propertyId, int orderNumb, int persistedVersion) throws IllegalStateException,
- RepositoryException
- {
- return null;
- }
-
- /**
* {@inheritDoc}
*/
public boolean getChildNodesDataByPage(NodeData parent, int fromOrderNum, int toOrderNum, List<NodeData> childs)
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/DBConstants.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/DBConstants.java 2012-03-13 09:17:20 UTC (rev 5853)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/DBConstants.java 2012-03-13 10:28:55 UTC (rev 5854)
@@ -120,11 +120,6 @@
protected String FIND_VALUES_VSTORAGE_DESC_BY_PROPERTYID;
/**
- * FIND_VALUE_BY_PROPERTYID_OREDERNUMB.
- */
- protected String FIND_VALUE_BY_PROPERTYID_OREDERNUMB;
-
- /**
* FIND_NODES_BY_PARENTID.
*/
protected String FIND_NODES_BY_PARENTID;
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 2012-03-13 09:17:20 UTC (rev 5853)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCStorageConnection.java 2012-03-13 10:28:55 UTC (rev 5854)
@@ -157,8 +157,6 @@
protected PreparedStatement findValuesDataByPropertyId;
- protected PreparedStatement findValueByPropertyIdOrderNumber;
-
protected PreparedStatement findNodesByParentId;
protected PreparedStatement findLastOrderNumberByParentId;
@@ -491,11 +489,6 @@
findValuesDataByPropertyId.close();
}
- if (findValueByPropertyIdOrderNumber != null)
- {
- findValueByPropertyIdOrderNumber.close();
- }
-
if (findNodesByParentId != null)
{
findNodesByParentId.close();
@@ -1418,54 +1411,6 @@
}
}
- /**
- * Reads Property Value from persistent storage.
- *
- * @param propertyId String, Property id
- * @param orderNumb int, Value order number (in list of values)
- * @param persistedVersion int
- * @return ValueData
- * @throws RepositoryException if read error occurs
- */
- public ValueData getValue(String propertyId, int orderNumb, int persistedVersion) throws RepositoryException
- {
- try
- {
- String cid = getInternalId(propertyId);
- ResultSet valueRecord = findValueByPropertyIdOrderNumber(cid, orderNumb);
- try
- {
- if (valueRecord.next())
- {
- String storageId = valueRecord.getString(COLUMN_VSTORAGE_DESC);
- return valueRecord.wasNull() ? readValueData(cid, orderNumb, persistedVersion, valueRecord
- .getBinaryStream(COLUMN_VDATA)) : readValueData(propertyId, orderNumb, storageId);
- }
-
- return null;
- }
- finally
- {
- try
- {
- valueRecord.close();
- }
- catch (SQLException e)
- {
- LOG.error("Can't close the ResultSet ", e);
- }
- }
- }
- catch (SQLException e)
- {
- throw new RepositoryException(e);
- }
- catch (IOException e)
- {
- throw new RepositoryException(e);
- }
- }
-
// ------------------ Private methods ---------------
/**
@@ -2832,8 +2777,6 @@
protected abstract ResultSet findValuesStorageDescriptorsByPropertyId(String cid) throws SQLException;
- protected abstract ResultSet findValueByPropertyIdOrderNumber(String cid, int orderNumb) throws SQLException;
-
protected abstract ResultSet findMaxPropertyVersion(String parentId, String name, int index) throws SQLException;
}
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 2012-03-13 09:17:20 UTC (rev 5853)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/MultiDbJDBCConnection.java 2012-03-13 10:28:55 UTC (rev 5854)
@@ -125,9 +125,6 @@
FIND_VALUES_VSTORAGE_DESC_BY_PROPERTYID = "select distinct STORAGE_DESC from JCR_MVALUE where PROPERTY_ID=?";
- FIND_VALUE_BY_PROPERTYID_OREDERNUMB =
- "select DATA, STORAGE_DESC from JCR_MVALUE where PROPERTY_ID=? and ORDER_NUM=?";
-
FIND_NODES_BY_PARENTID = "select * from JCR_MITEM" + " where I_CLASS=1 and PARENT_ID=?" + " order by N_ORDER_NUM";
FIND_LAST_ORDER_NUMBER_BY_PARENTID =
@@ -497,22 +494,6 @@
* {@inheritDoc}
*/
@Override
- protected ResultSet findValueByPropertyIdOrderNumber(String cid, int orderNumb) throws SQLException
- {
- if (findValueByPropertyIdOrderNumber == null)
- findValueByPropertyIdOrderNumber = dbConnection.prepareStatement(FIND_VALUE_BY_PROPERTYID_OREDERNUMB);
- else
- findValueByPropertyIdOrderNumber.clearParameters();
-
- findValueByPropertyIdOrderNumber.setString(1, cid);
- findValueByPropertyIdOrderNumber.setInt(2, orderNumb);
- return findValueByPropertyIdOrderNumber.executeQuery();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
protected int renameNode(NodeData data) throws SQLException
{
if (renameNode == null)
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 2012-03-13 09:17:20 UTC (rev 5853)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/db/SingleDbJDBCConnection.java 2012-03-13 10:28:55 UTC (rev 5854)
@@ -131,9 +131,6 @@
FIND_VALUES_VSTORAGE_DESC_BY_PROPERTYID = "select distinct STORAGE_DESC from JCR_SVALUE where PROPERTY_ID=?";
- FIND_VALUE_BY_PROPERTYID_OREDERNUMB =
- "select DATA, STORAGE_DESC from JCR_SVALUE where PROPERTY_ID=? and ORDER_NUM=?";
-
FIND_NODES_BY_PARENTID =
"select * from JCR_SITEM" + " where I_CLASS=1 and CONTAINER_NAME=? and PARENT_ID=?" + " order by N_ORDER_NUM";
@@ -528,26 +525,6 @@
* {@inheritDoc}
*/
@Override
- protected ResultSet findValueByPropertyIdOrderNumber(String cid, int orderNumb) throws SQLException
- {
- if (findValueByPropertyIdOrderNumber == null)
- {
- findValueByPropertyIdOrderNumber = dbConnection.prepareStatement(FIND_VALUE_BY_PROPERTYID_OREDERNUMB);
- }
- else
- {
- findValueByPropertyIdOrderNumber.clearParameters();
- }
-
- findValueByPropertyIdOrderNumber.setString(1, cid);
- findValueByPropertyIdOrderNumber.setInt(2, orderNumb);
- return findValueByPropertyIdOrderNumber.executeQuery();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
protected int renameNode(NodeData data) throws SQLException
{
if (renameNode == null)
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 2012-03-13 09:17:20 UTC (rev 5853)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/MultiDbJDBCConnection.java 2012-03-13 10:28:55 UTC (rev 5854)
@@ -148,9 +148,6 @@
FIND_VALUES_VSTORAGE_DESC_BY_PROPERTYID = "select distinct STORAGE_DESC from JCR_MVALUE where PROPERTY_ID=?";
- FIND_VALUE_BY_PROPERTYID_OREDERNUMB =
- "select DATA, STORAGE_DESC from JCR_MVALUE where PROPERTY_ID=? and ORDER_NUM=?";
-
FIND_NODES_BY_PARENTID = "select * from JCR_MITEM" + " where I_CLASS=1 and PARENT_ID=?" + " order by N_ORDER_NUM";
FIND_NODES_BY_PARENTID_CQ = FIND_NODES_BY_PARENTID_CQ_QUERY;
@@ -747,26 +744,6 @@
* {@inheritDoc}
*/
@Override
- protected ResultSet findValueByPropertyIdOrderNumber(String cid, int orderNumb) throws SQLException
- {
- if (findValueByPropertyIdOrderNumber == null)
- {
- findValueByPropertyIdOrderNumber = dbConnection.prepareStatement(FIND_VALUE_BY_PROPERTYID_OREDERNUMB);
- }
- else
- {
- findValueByPropertyIdOrderNumber.clearParameters();
- }
-
- findValueByPropertyIdOrderNumber.setString(1, cid);
- findValueByPropertyIdOrderNumber.setInt(2, orderNumb);
- return findValueByPropertyIdOrderNumber.executeQuery();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
protected int renameNode(NodeData data) throws SQLException
{
if (renameNode == null)
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 2012-03-13 09:17:20 UTC (rev 5853)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/optimisation/db/SingleDbJDBCConnection.java 2012-03-13 10:28:55 UTC (rev 5854)
@@ -154,9 +154,6 @@
FIND_VALUES_VSTORAGE_DESC_BY_PROPERTYID = "select distinct STORAGE_DESC from JCR_SVALUE where PROPERTY_ID=?";
- FIND_VALUE_BY_PROPERTYID_OREDERNUMB =
- "select DATA, STORAGE_DESC from JCR_SVALUE where PROPERTY_ID=? and ORDER_NUM=?";
-
FIND_NODES_BY_PARENTID =
"select * from JCR_SITEM" + " where I_CLASS=1 and CONTAINER_NAME=? and PARENT_ID=?" + " order by N_ORDER_NUM";
@@ -608,26 +605,6 @@
* {@inheritDoc}
*/
@Override
- protected ResultSet findValueByPropertyIdOrderNumber(String cid, int orderNumb) throws SQLException
- {
- if (findValueByPropertyIdOrderNumber == null)
- {
- findValueByPropertyIdOrderNumber = dbConnection.prepareStatement(FIND_VALUE_BY_PROPERTYID_OREDERNUMB);
- }
- else
- {
- findValueByPropertyIdOrderNumber.clearParameters();
- }
-
- findValueByPropertyIdOrderNumber.setString(1, cid);
- findValueByPropertyIdOrderNumber.setInt(2, orderNumb);
- return findValueByPropertyIdOrderNumber.executeQuery();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
protected int renameNode(NodeData data) throws SQLException
{
if (renameNode == null)
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 2012-03-13 09:17:20 UTC (rev 5853)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/statistics/StatisticsJDBCStorageConnection.java 2012-03-13 10:28:55 UTC (rev 5854)
@@ -21,7 +21,6 @@
import org.exoplatform.services.jcr.datamodel.NodeData;
import org.exoplatform.services.jcr.datamodel.PropertyData;
import org.exoplatform.services.jcr.datamodel.QPathEntry;
-import org.exoplatform.services.jcr.datamodel.ValueData;
import org.exoplatform.services.jcr.impl.core.itemfilters.QPathEntryFilter;
import org.exoplatform.services.jcr.impl.dataflow.persistent.ACLHolder;
import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer;
@@ -94,12 +93,6 @@
/**
* The description of the statistics corresponding to the method
- * <code>getValue(String propertyId, int orderNumb, int persistedVersion)</code>
- */
- private static final String GET_VALUE_DESCR = "getValue";
-
- /**
- * The description of the statistics corresponding to the method
* <code>isOpened()</code>
*/
private static final String IS_OPENED_DESCR = "isOpened";
@@ -221,7 +214,6 @@
ALL_STATISTICS.put(LIST_CHILD_PROPERTIES_DATA_DESCR, new Statistics(GLOBAL_STATISTICS,
LIST_CHILD_PROPERTIES_DATA_DESCR));
ALL_STATISTICS.put(GET_REFERENCES_DATA_DESCR, new Statistics(GLOBAL_STATISTICS, GET_REFERENCES_DATA_DESCR));
- ALL_STATISTICS.put(GET_VALUE_DESCR, new Statistics(GLOBAL_STATISTICS, GET_VALUE_DESCR));
ALL_STATISTICS.put(GET_ACL_HOLDERS, new Statistics(GLOBAL_STATISTICS, GET_ACL_HOLDERS));
// Write Methods
// Commit
@@ -579,24 +571,6 @@
s.end();
}
}
-
- /**
- * {@inheritDoc}
- */
- public ValueData getValue(String propertyId, int orderNumb, int persistedVersion) throws IllegalStateException,
- RepositoryException
- {
- Statistics s = ALL_STATISTICS.get(GET_VALUE_DESCR);
- try
- {
- s.begin();
- return wcs.getValue(propertyId, orderNumb, persistedVersion);
- }
- finally
- {
- s.end();
- }
- }
/**
* {@inheritDoc}
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 2012-03-13 09:17:20 UTC (rev 5853)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/storage/WorkspaceStorageConnection.java 2012-03-13 10:28:55 UTC (rev 5854)
@@ -23,7 +23,6 @@
import org.exoplatform.services.jcr.datamodel.NodeData;
import org.exoplatform.services.jcr.datamodel.PropertyData;
import org.exoplatform.services.jcr.datamodel.QPathEntry;
-import org.exoplatform.services.jcr.datamodel.ValueData;
import org.exoplatform.services.jcr.impl.core.itemfilters.QPathEntryFilter;
import org.exoplatform.services.jcr.impl.dataflow.persistent.ACLHolder;
@@ -223,23 +222,6 @@
UnsupportedOperationException;
/**
- * Gets the value content of the property defined by the given parameters.
- *
- * @param propertyId
- * the id of the property
- * @param orderNumb
- * the order number or the property
- * @param persistedVersion
- * the persisted version of the property
- * @return the value content wrapped into a ValueData object
- * @throws IllegalStateException
- * if connection is already closed
- * @throws RepositoryException
- * if some exception occurred
- */
- ValueData getValue(String propertyId, int orderNumb, int persistedVersion) throws IllegalStateException, RepositoryException;
-
- /**
* Get child Nodes of the parent node.
*
* @param parent
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 2012-03-13 09:17:20 UTC (rev 5853)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/BaseStandaloneTest.java 2012-03-13 10:28:55 UTC (rev 5854)
@@ -30,7 +30,6 @@
import org.exoplatform.services.jcr.datamodel.NodeData;
import org.exoplatform.services.jcr.datamodel.PropertyData;
import org.exoplatform.services.jcr.datamodel.QPathEntry;
-import org.exoplatform.services.jcr.datamodel.ValueData;
import org.exoplatform.services.jcr.impl.core.ItemImpl;
import org.exoplatform.services.jcr.impl.core.NodeImpl;
import org.exoplatform.services.jcr.impl.core.RepositoryImpl;
@@ -726,15 +725,6 @@
}
/**
- * @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnection#getValue(java.lang.String, int, int)
- */
- public ValueData getValue(String propertyId, int orderNumb, int persistedVersion) throws IllegalStateException,
- RepositoryException
- {
- return null;
- }
-
- /**
* @see org.exoplatform.services.jcr.storage.WorkspaceStorageConnection#getChildNodesDataByPage(org.exoplatform.services.jcr.datamodel.NodeData, int, int, java.util.List)
*/
public boolean getChildNodesDataByPage(NodeData parent, int fromOrderNum, int toOrderNum, List<NodeData> childs)
Modified: jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestMoveNode.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestMoveNode.java 2012-03-13 09:17:20 UTC (rev 5853)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/core/TestMoveNode.java 2012-03-13 10:28:55 UTC (rev 5854)
@@ -22,6 +22,7 @@
import org.exoplatform.services.jcr.datamodel.InternalQName;
import org.exoplatform.services.jcr.datamodel.QPath;
+import java.io.ByteArrayInputStream;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.ArrayList;
@@ -29,8 +30,10 @@
import java.util.List;
import java.util.Random;
+import javax.jcr.Item;
import javax.jcr.Node;
import javax.jcr.PathNotFoundException;
+import javax.jcr.Property;
import javax.jcr.RepositoryException;
/**
@@ -204,6 +207,59 @@
}
+ public void testRenameNodeWithBinaryProperty() throws Exception
+ {
+ Node parentNode = root.addNode("testRenameNodeWithBinaryProperty");
+ String path = parentNode.getPath();
+ String value = "my Property Value";
+
+ parentNode.setProperty("myBinaryData", new ByteArrayInputStream(value.getBytes("UTF-8")));
+ root.save();
+
+ value = "my Property Value 2";
+ parentNode.setProperty("myBinaryData", new ByteArrayInputStream(value.getBytes("UTF-8")));
+ session.move(path, path + "2");
+
+ value = "my Property Value 3";
+ parentNode.setProperty("myBinaryData", new ByteArrayInputStream(value.getBytes("UTF-8")));
+ session.move(path + "2", path + "3");
+ session.save();
+
+ Item i = session.getItem(path + "3/myBinaryData");
+
+ assertTrue(i instanceof Property);
+
+ Property p = (Property)i;
+ InputStream is = p.getStream();
+ byte[] bValue = new byte[is.available()];
+ is.read(bValue);
+ is.close();
+
+ assertEquals(value, new String(bValue, "UTF-8"));
+ }
+
+ public void testRenameNodeWithBinaryProperty2() throws Exception
+ {
+ Node parentNode = root.addNode("testRenameNodeWithBinaryProperty");
+ String path = parentNode.getPath();
+
+ String value = "my Property Value";
+ parentNode.setProperty("myBinaryData", new ByteArrayInputStream(value.getBytes("UTF-8")));
+ session.move(path, path + "2");
+ session.save();
+
+ Item i = session.getItem(path + "2/myBinaryData");
+
+ assertTrue(i instanceof Property);
+ Property p = (Property)i;
+ InputStream is = p.getStream();
+ byte[] bValue = new byte[is.available()];
+ is.read(bValue);
+ is.close();
+
+ assertEquals(value, new String(bValue, "UTF-8"));
+ }
+
public void testLocalBigFiles() throws Exception
{
Node testBinaryValue = root.addNode("testBinaryValue");
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 2012-03-13 09:17:20 UTC (rev 5853)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestCacheableWorkspaceDataManager.java 2012-03-13 10:28:55 UTC (rev 5854)
@@ -622,12 +622,6 @@
return null;
}
- public ValueData getValue(String propertyId, int orderNumb, int persistedVersion) throws IllegalStateException,
- RepositoryException
- {
- return null;
- }
-
public 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/impl/dataflow/persistent/TestWorkspaceStorageCacheInClusterMode.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestWorkspaceStorageCacheInClusterMode.java 2012-03-13 09:17:20 UTC (rev 5853)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/TestWorkspaceStorageCacheInClusterMode.java 2012-03-13 10:28:55 UTC (rev 5854)
@@ -960,12 +960,6 @@
return children;
}
- public ValueData getValue(String propertyId, int orderNumb, int persistedVersion) throws IllegalStateException,
- RepositoryException
- {
- return null;
- }
-
public 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/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 2012-03-13 09:17:20 UTC (rev 5853)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/dataflow/persistent/cache/jbosscache/TestJBossCacheWorkspaceStorageCache.java 2012-03-13 10:28:55 UTC (rev 5854)
@@ -33,7 +33,6 @@
import org.exoplatform.services.jcr.datamodel.NodeData;
import org.exoplatform.services.jcr.datamodel.PropertyData;
import org.exoplatform.services.jcr.datamodel.QPathEntry;
-import org.exoplatform.services.jcr.datamodel.ValueData;
import org.exoplatform.services.jcr.impl.Constants;
import org.exoplatform.services.jcr.impl.core.itemfilters.QPathEntryFilter;
import org.exoplatform.services.jcr.impl.dataflow.persistent.ACLHolder;
@@ -325,12 +324,6 @@
return getChildNodesData(parent);
}
- public ValueData getValue(String propertyId, int orderNumb, int persistedVersion) throws IllegalStateException,
- RepositoryException
- {
- return null;
- }
-
public 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/impl/storage/jdbc/JDBCConnectionTestBase.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCConnectionTestBase.java 2012-03-13 09:17:20 UTC (rev 5853)
+++ jcr/trunk/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCConnectionTestBase.java 2012-03-13 10:28:55 UTC (rev 5854)
@@ -254,16 +254,4 @@
rs.next();
assertEquals(rsRemote.getString("STORAGE_DESC"), rs.getString("STORAGE_DESC"));
}
-
- public void testFindValueByPropertyIdOrderNumber() throws Exception
- {
-
- ResultSet rsRemote = jdbcConn.findValueByPropertyIdOrderNumber("A", 16);
- rsRemote.next();
- ResultSet rs =
- connect.createStatement().executeQuery(
- "select DATA from " + "JCR_" + tableType + "VALUE" + " where PROPERTY_ID='A' and ORDER_NUM=16");
- rs.next();
- assertEquals(rsRemote.getString("DATA"), rs.getString("DATA"));
- }
}
Modified: jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/ISPNCacheWorkspaceStorageCache.java
===================================================================
--- jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/ISPNCacheWorkspaceStorageCache.java 2012-03-13 09:17:20 UTC (rev 5853)
+++ jcr/trunk/exo.jcr.component.core.impl.infinispan.v5/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/ISPNCacheWorkspaceStorageCache.java 2012-03-13 10:28:55 UTC (rev 5854)
@@ -31,6 +31,8 @@
import org.exoplatform.services.jcr.config.WorkspaceEntry;
import org.exoplatform.services.jcr.dataflow.ItemState;
import org.exoplatform.services.jcr.dataflow.ItemStateChangesLog;
+import org.exoplatform.services.jcr.dataflow.persistent.PersistedNodeData;
+import org.exoplatform.services.jcr.dataflow.persistent.PersistedPropertyData;
import org.exoplatform.services.jcr.dataflow.persistent.WorkspaceStorageCache;
import org.exoplatform.services.jcr.dataflow.persistent.WorkspaceStorageCacheListener;
import org.exoplatform.services.jcr.datamodel.IllegalPathException;
@@ -52,7 +54,6 @@
import org.exoplatform.services.jcr.impl.backup.rdbms.DataRestoreContext;
import org.exoplatform.services.jcr.impl.core.itemfilters.QPathEntryFilter;
import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData;
-import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData;
import org.exoplatform.services.jcr.infinispan.AbstractMapper;
import org.exoplatform.services.jcr.infinispan.CacheKey;
import org.exoplatform.services.jcr.infinispan.ISPNCacheFactory;
@@ -1705,10 +1706,10 @@
// update node
NodeData prevNode = (NodeData)data;
- TransientNodeData newNode =
- new TransientNodeData(newPath, prevNode.getIdentifier(), prevNode.getPersistedVersion(),
- prevNode.getPrimaryTypeName(), prevNode.getMixinTypeNames(), prevNode.getOrderNumber(),
- prevNode.getParentIdentifier(), inheritACL ? acl : prevNode.getACL());
+ NodeData newNode =
+ new PersistedNodeData(prevNode.getIdentifier(), newPath, prevNode.getParentIdentifier(),
+ prevNode.getPersistedVersion(), prevNode.getOrderNumber(), prevNode.getPrimaryTypeName(),
+ prevNode.getMixinTypeNames(), inheritACL ? acl : prevNode.getACL());
// update this node
cache.put(new CacheId(ownerId, newNode.getIdentifier()), newNode);
@@ -1725,9 +1726,9 @@
inheritACL = false;
}
- TransientPropertyData newProp =
- new TransientPropertyData(newPath, prevProp.getIdentifier(), prevProp.getPersistedVersion(),
- prevProp.getType(), prevProp.getParentIdentifier(), prevProp.isMultiValued(), prevProp.getValues());
+ PropertyData newProp =
+ new PersistedPropertyData(prevProp.getIdentifier(), newPath, prevProp.getParentIdentifier(),
+ prevProp.getPersistedVersion(), prevProp.getType(), prevProp.isMultiValued(), prevProp.getValues());
// update this property
cache.put(new CacheId(ownerId, newProp.getIdentifier()), newProp);
@@ -1773,7 +1774,6 @@
/**
* This class defines all the methods that could change between the replicated and the distributed mode.
* By default it implements the methods for the local and replicated mode.
- *
*/
private class GlobalOperationCaller
{
14 years, 1 month
exo-jcr SVN: r5853 - jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2012-03-13 05:17:20 -0400 (Tue, 13 Mar 2012)
New Revision: 5853
Modified:
jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/query-handler-config.xml
Log:
EXOJCR-1803 : doc update
Modified: jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/query-handler-config.xml
===================================================================
--- jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/query-handler-config.xml 2012-03-13 09:17:07 UTC (rev 5852)
+++ jcr/trunk/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/query-handler-config.xml 2012-03-13 09:17:20 UTC (rev 5853)
@@ -5,8 +5,12 @@
<?dbhtml filename="ch-query-handler-config.html"?>
<title>QueryHandler configuration</title>
- <para>This chapter shows you how to configure <emphasis>QueryHandler</emphasis>: <link linkend="JCR.QueryHandlerConfiguration.Indexing_in_clustered_environment">Indexing in clustered environment</link>.</para>
+ <para>This chapter shows you how to configure
+ <emphasis>QueryHandler</emphasis>: <link
+ linkend="JCR.QueryHandlerConfiguration.Indexing_in_clustered_environment">Indexing
+ in clustered environment</link>.</para>
+
<section id="JCR.QueryHandlerConfiguration.Indexing_in_clustered_environment">
<title>Indexing in clustered environment</title>
@@ -26,7 +30,7 @@
<mediaobject>
<imageobject>
<imagedata align="center"
- fileref="images/diagram-standalone-index.png"/>
+ fileref="images/diagram-standalone-index.png" />
</imageobject>
</mediaobject>
@@ -42,7 +46,7 @@
<mediaobject>
<imageobject>
- <imagedata align="center" fileref="images/diagram-local-index.png"/>
+ <imagedata align="center" fileref="images/diagram-local-index.png" />
</imageobject>
</mediaobject>
@@ -65,7 +69,7 @@
<mediaobject>
<imageobject>
- <imagedata align="center" fileref="images/diagram-shared-index.png"/>
+ <imagedata align="center" fileref="images/diagram-shared-index.png" />
</imageobject>
</mediaobject>
@@ -195,9 +199,9 @@
<entry>If the parameter has been set to
<command>from-indexing</command>, so a full indexing will be
- automatically launched (default behavior), if the parameter has
- been set to <command>from-coordinator</command>, the index will
- be retrieved from coordinator</entry>
+ automatically launched, if the parameter has been set to
+ <command>from-coordinator</command> (default behavior), the
+ index will be retrieved from coordinator</entry>
</row>
<row>
@@ -346,8 +350,8 @@
<para>If any one returns fires, the index is re-synchronized. This
feature uses standard index recovery mode defined by previously
- described parameter (can be "from-indexing" (default) or
- "from-coordinator")</para>
+ described parameter (can be "from-indexing" or "from-coordinator"
+ (default value))</para>
<programlisting language="xml"><property name="index-recovery-mode" value="from-coordinator" />
</programlisting>
@@ -487,7 +491,7 @@
blocking whole application by using any JMX-compatible console (see
screenshot below, "JConsole in action").<mediaobject>
<imageobject>
- <imagedata align="center" fileref="images/jmx-jconsole.png"/>
+ <imagedata align="center" fileref="images/jmx-jconsole.png" />
</imageobject>
</mediaobject>Server can continue working as expected while index is
recreated. This depends on the flag "allow queries", passed via JMX
14 years, 1 month
exo-jcr SVN: r5852 - jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr.
by do-not-reply@jboss.org
Author: nzamosenchuk
Date: 2012-03-13 05:17:07 -0400 (Tue, 13 Mar 2012)
New Revision: 5852
Modified:
jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/query-handler-config.xml
Log:
EXOJCR-1803 : doc update
Modified: jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/query-handler-config.xml
===================================================================
--- jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/query-handler-config.xml 2012-03-12 15:13:48 UTC (rev 5851)
+++ jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/docbook/en-US/modules/jcr/query-handler-config.xml 2012-03-13 09:17:07 UTC (rev 5852)
@@ -5,8 +5,12 @@
<?dbhtml filename="ch-query-handler-config.html"?>
<title>QueryHandler configuration</title>
- <para>This chapter shows you how to configure <emphasis>QueryHandler</emphasis>: <link linkend="JCR.QueryHandlerConfiguration.Indexing_in_clustered_environment">Indexing in clustered environment</link>.</para>
+ <para>This chapter shows you how to configure
+ <emphasis>QueryHandler</emphasis>: <link
+ linkend="JCR.QueryHandlerConfiguration.Indexing_in_clustered_environment">Indexing
+ in clustered environment</link>.</para>
+
<section id="JCR.QueryHandlerConfiguration.Indexing_in_clustered_environment">
<title>Indexing in clustered environment</title>
@@ -26,7 +30,7 @@
<mediaobject>
<imageobject>
<imagedata align="center"
- fileref="images/diagram-standalone-index.png"/>
+ fileref="images/diagram-standalone-index.png" />
</imageobject>
</mediaobject>
@@ -42,7 +46,7 @@
<mediaobject>
<imageobject>
- <imagedata align="center" fileref="images/diagram-local-index.png"/>
+ <imagedata align="center" fileref="images/diagram-local-index.png" />
</imageobject>
</mediaobject>
@@ -65,7 +69,7 @@
<mediaobject>
<imageobject>
- <imagedata align="center" fileref="images/diagram-shared-index.png"/>
+ <imagedata align="center" fileref="images/diagram-shared-index.png" />
</imageobject>
</mediaobject>
@@ -195,9 +199,9 @@
<entry>If the parameter has been set to
<command>from-indexing</command>, so a full indexing will be
- automatically launched (default behavior), if the parameter has
- been set to <command>from-coordinator</command>, the index will
- be retrieved from coordinator</entry>
+ automatically launched, if the parameter has been set to
+ <command>from-coordinator</command> (default behavior), the
+ index will be retrieved from coordinator</entry>
</row>
<row>
@@ -346,8 +350,8 @@
<para>If any one returns fires, the index is re-synchronized. This
feature uses standard index recovery mode defined by previously
- described parameter (can be "from-indexing" (default) or
- "from-coordinator")</para>
+ described parameter (can be "from-indexing" or "from-coordinator"
+ (default value))</para>
<programlisting language="xml"><property name="index-recovery-mode" value="from-coordinator" />
</programlisting>
@@ -487,7 +491,7 @@
blocking whole application by using any JMX-compatible console (see
screenshot below, "JConsole in action").<mediaobject>
<imageobject>
- <imagedata align="center" fileref="images/jmx-jconsole.png"/>
+ <imagedata align="center" fileref="images/jmx-jconsole.png" />
</imageobject>
</mediaobject>Server can continue working as expected while index is
recreated. This depends on the flag "allow queries", passed via JMX
14 years, 1 month
exo-jcr SVN: r5851 - jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/resources/images/other.
by do-not-reply@jboss.org
Author: andrew.plotnikov
Date: 2012-03-12 11:13:48 -0400 (Mon, 12 Mar 2012)
New Revision: 5851
Modified:
jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/resources/images/other/lnkproducer1.JPG
jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/resources/images/other/lnkproducer2.JPG
jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/resources/images/other/lnkproducer3.JPG
jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/resources/images/other/lnkproducer4.JPG
Log:
EXOJCR-1798: Updated screenshots
Modified: jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/resources/images/other/lnkproducer1.JPG
===================================================================
(Binary files differ)
Modified: jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/resources/images/other/lnkproducer2.JPG
===================================================================
(Binary files differ)
Modified: jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/resources/images/other/lnkproducer3.JPG
===================================================================
(Binary files differ)
Modified: jcr/branches/1.15.x/exo.jcr.docs/exo.jcr.docs.developer/en/src/main/resources/images/other/lnkproducer4.JPG
===================================================================
(Binary files differ)
14 years, 1 month
exo-jcr SVN: r5850 - jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache.
by do-not-reply@jboss.org
Author: areshetnyak
Date: 2012-03-12 11:10:09 -0400 (Mon, 12 Mar 2012)
New Revision: 5850
Modified:
jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableLockManagerImpl.java
Log:
EXOJCR-1758 : The problem with eviction and stoping cache on repository stop was fixed.
Modified: jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableLockManagerImpl.java
===================================================================
--- jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableLockManagerImpl.java 2012-03-12 15:09:42 UTC (rev 5849)
+++ jcr/branches/1.15.x/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableLockManagerImpl.java 2012-03-12 15:10:09 UTC (rev 5850)
@@ -510,17 +510,9 @@
if (shareable)
{
// The cache cannot be stopped since it can be shared so we remove the root node instead
- try
- {
- cache.getInvocationContext().getOptionOverrides().setSuppressPersistence(true);
- cache.getInvocationContext().getOptionOverrides().setCacheModeLocal(true);
- cache.removeNode(lockRoot);
- }
- finally
- {
- cache.getInvocationContext().getOptionOverrides().setSuppressPersistence(false);
- cache.getInvocationContext().getOptionOverrides().setCacheModeLocal(false);
- }
+ cache.getInvocationContext().getOptionOverrides().setSuppressPersistence(true);
+ cache.getInvocationContext().getOptionOverrides().setCacheModeLocal(true);
+ cache.removeNode(lockRoot);
}
try
14 years, 1 month
exo-jcr SVN: r5849 - jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache.
by do-not-reply@jboss.org
Author: areshetnyak
Date: 2012-03-12 11:09:42 -0400 (Mon, 12 Mar 2012)
New Revision: 5849
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableLockManagerImpl.java
Log:
EXOJCR-1758 : The problem with eviction and stoping cache on repository stop was fixed.
Modified: jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableLockManagerImpl.java
===================================================================
--- jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableLockManagerImpl.java 2012-03-12 15:05:14 UTC (rev 5848)
+++ jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/jbosscache/CacheableLockManagerImpl.java 2012-03-12 15:09:42 UTC (rev 5849)
@@ -510,17 +510,9 @@
if (shareable)
{
// The cache cannot be stopped since it can be shared so we remove the root node instead
- try
- {
- cache.getInvocationContext().getOptionOverrides().setSuppressPersistence(true);
- cache.getInvocationContext().getOptionOverrides().setCacheModeLocal(true);
- cache.removeNode(lockRoot);
- }
- finally
- {
- cache.getInvocationContext().getOptionOverrides().setSuppressPersistence(false);
- cache.getInvocationContext().getOptionOverrides().setCacheModeLocal(false);
- }
+ cache.getInvocationContext().getOptionOverrides().setSuppressPersistence(true);
+ cache.getInvocationContext().getOptionOverrides().setCacheModeLocal(true);
+ cache.removeNode(lockRoot);
}
try
14 years, 1 month