Author: pnedonosko
Date: 2009-12-10 07:17:44 -0500 (Thu, 10 Dec 2009)
New Revision: 984
Modified:
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/ItemImpl.java
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/PropertyImpl.java
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/ValueFactoryImpl.java
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/VersionImpl.java
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java
Log:
EXOJCR-274 save can accept persistent data also now; VersionImpl data-flow rework.
Modified:
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/ItemImpl.java
===================================================================
---
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/ItemImpl.java 2009-12-10
11:28:57 UTC (rev 983)
+++
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/ItemImpl.java 2009-12-10
12:17:44 UTC (rev 984)
@@ -389,19 +389,20 @@
{
QPath qpath = QPath.makeChildPath(parentNode.getInternalPath(), propertyName);
+
int state;
String identifier;
int version;
- PropertyImpl oldProp = null;
- ItemImpl oldItem = dataManager.getItem(parentNode.nodeData(), new
QPathEntry(propertyName, 0), true);
- PropertyDefinitionDatas defs = null;
+ PropertyImpl prevProp;
+ PropertyDefinitionDatas defs;
+ ItemImpl prevItem = dataManager.getItem(parentNode.nodeData(), new
QPathEntry(propertyName, 0), true);
NodeTypeDataManager ntm = session.getWorkspace().getNodeTypesHolder();
NodeData parentData = (NodeData)parentNode.getData();
boolean isMultiValue = multiValue;
- if (oldItem == null || oldItem.isNode())
- { // new prop
+ if (prevItem == null || prevItem.isNode())
+ { // new property
identifier = IdGenerator.generate();
version = -1;
if (propertyValues == null)
@@ -416,18 +417,19 @@
}
defs =
ntm.getPropertyDefinitions(propertyName, parentData.getPrimaryTypeName(),
parentData.getMixinTypeNames());
-
+ prevProp = null;
state = ItemState.ADDED;
}
else
{
- oldProp = (PropertyImpl)oldItem;
- isMultiValue = oldProp.isMultiValued();
+ // update of the property
+ prevProp = (PropertyImpl)prevItem;
+ isMultiValue = prevProp.isMultiValued();
defs =
ntm.getPropertyDefinitions(propertyName, parentData.getPrimaryTypeName(),
parentData.getMixinTypeNames());
- identifier = oldProp.getInternalIdentifier();
- version = oldProp.getData().getPersistedVersion();
+ identifier = prevProp.getInternalIdentifier();
+ version = prevProp.getData().getPersistedVersion();
if (propertyValues == null)
state = ItemState.DELETED;
else
@@ -435,6 +437,7 @@
state = ItemState.UPDATED;
}
}
+
if (defs == null || defs.getAnyDefinition() == null)
throw new RepositoryException("Property definition '" +
propertyName.getAsString() + "' is not found.");
@@ -443,22 +446,23 @@
throw new ConstraintViolationException("Can not set protected property
"
+ locationFactory.createJCRPath(qpath).getAsString(false));
- if (multiValue && (def == null || (oldProp != null &&
!oldProp.isMultiValued())))
+ if (multiValue && (def == null || (prevProp != null &&
!prevProp.isMultiValued())))
{
throw new ValueFormatException("Can not assign multiple-values Value to a
single-valued property "
+ locationFactory.createJCRPath(qpath).getAsString(false));
}
- if (!multiValue && (def == null || (oldProp != null &&
oldProp.isMultiValued())))
+ if (!multiValue && (def == null || (prevProp != null &&
prevProp.isMultiValued())))
{
throw new ValueFormatException("Can not assign single-value Value to a
multiple-valued property "
+ locationFactory.createJCRPath(qpath).getAsString(false));
}
+ // Check if checked-in (versionable)
if (!parentNode.checkedOut())
throw new VersionException("Node " + parentNode.getPath() + " or
its nearest ancestor is checked-in");
- // Check locking
+ // Check is locked
if (!parentNode.checkLocking())
throw new LockException("Node " + parentNode.getPath() + " is
locked ");
@@ -532,18 +536,19 @@
+ "type of the property do not match required type" +
ExtendedPropertyType.nameFromValue(requiredType));
}
- PropertyImpl prop = null;
+ PropertyImpl prop;
if (state != ItemState.DELETED)
{
+ // add or update
TransientPropertyData newData =
new TransientPropertyData(qpath, identifier, version, propType,
parentNode.getInternalIdentifier(),
multiValue, valueDataList);
ItemState itemState = new ItemState(newData, state, true, qpath, false);
prop = (PropertyImpl)dataManager.update(itemState, true);
- // launch event
+
+ // launch event: post-set
session.getActionHandler().postSetProperty(prop, state);
-
}
else
{
@@ -552,14 +557,16 @@
throw new ConstraintViolationException("Can not remove (by setting null
value) mandatory property "
+ locationFactory.createJCRPath(qpath).getAsString(false));
}
+
TransientPropertyData newData =
new TransientPropertyData(qpath, identifier, version, propType,
parentNode.getInternalIdentifier(),
multiValue);
- // launch event
- session.getActionHandler().preRemoveItem(oldProp);
+ // launch event: pre-remove
+ session.getActionHandler().preRemoveItem(prevProp);
+
dataManager.delete(newData);
- prop = oldProp;
+ prop = prevProp;
}
return prop;
Modified:
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/PropertyImpl.java
===================================================================
---
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/PropertyImpl.java 2009-12-10
11:28:57 UTC (rev 983)
+++
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/PropertyImpl.java 2009-12-10
12:17:44 UTC (rev 984)
@@ -108,11 +108,11 @@
ConstraintViolationException
{
- if (!(data instanceof TransientPropertyData))
- throw new RepositoryException("Load data: TransientPropertyData is
expected, but have " + data);
+ //if (!(data instanceof TransientPropertyData))
+ // throw new RepositoryException("Load data: TransientPropertyData is
expected, but have " + data);
this.data = data;
- this.propertyData = (TransientPropertyData)data;
+ this.propertyData = (PropertyData)data;
this.type = propertyData.getType();
this.location = null;
@@ -136,14 +136,16 @@
checkValid();
- if (isMultiValued()) {
+ if (isMultiValued())
+ {
throw new ValueFormatException("The property " + getPath() + " is
multi-valued (6.2.4)");
}
-
- if (propertyData.getValues() != null && propertyData.getValues().size() ==
0) {
+
+ if (propertyData.getValues() != null && propertyData.getValues().size() ==
0)
+ {
throw new ValueFormatException("The single valued property " +
getPath() + " is empty");
}
-
+
return valueFactory.loadValue(propertyData.getValues().get(0),
propertyData.getType());
}
@@ -352,8 +354,10 @@
session.getWorkspace().getNodeTypesHolder().getPropertyDefinitions(pname,
parent.getPrimaryTypeName(),
parent.getMixinTypeNames());
if (definitions == null)
+ {
throw new ConstraintViolationException("Definition for property " +
getPath() + " not found.");
-
+ }
+
propertyDef = definitions.getDefinition(multiple);
}
Modified:
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/ValueFactoryImpl.java
===================================================================
---
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/ValueFactoryImpl.java 2009-12-10
11:28:57 UTC (rev 983)
+++
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/value/ValueFactoryImpl.java 2009-12-10
12:17:44 UTC (rev 984)
@@ -377,7 +377,7 @@
* Creates new Value object using ValueData
*
* @param data
- * TransientValueData
+ * ValueData
* @param type
* int
* @return Value
Modified:
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/VersionImpl.java
===================================================================
---
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/VersionImpl.java 2009-12-10
11:28:57 UTC (rev 983)
+++
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/version/VersionImpl.java 2009-12-10
12:17:44 UTC (rev 984)
@@ -59,14 +59,16 @@
public VersionImpl(NodeData data, SessionImpl session) throws PathNotFoundException,
RepositoryException
{
-
super(data, session);
if (!this.isNodeType(Constants.NT_VERSION))
+ {
throw new RepositoryException("Node " +
getLocation().getAsString(true) + " is not nt:version type");
+ }
}
@Override
+ /* needed for VersionHistoryImpl.removeVersion */
protected void invalidate()
{
super.invalidate();
@@ -77,17 +79,16 @@
*/
public Calendar getCreated() throws RepositoryException
{
-
checkValid();
PropertyData pdata = (PropertyData)dataManager.getItemData(nodeData(), new
QPathEntry(Constants.JCR_CREATED, 0));
if (pdata == null)
+ {
throw new VersionException("jcr:created property is not found for version
" + getPath());
+ }
- Value created =
-
session.getValueFactory().loadValue((TransientValueData)pdata.getValues().get(0),
pdata.getType());
-
+ Value created = session.getValueFactory().loadValue(pdata.getValues().get(0),
pdata.getType());
return created.getDate();
}
@@ -96,14 +97,15 @@
*/
public Version[] getSuccessors() throws RepositoryException
{
-
checkValid();
PropertyData successorsData =
(PropertyData)dataManager.getItemData(nodeData(), new
QPathEntry(Constants.JCR_SUCCESSORS, 0));
if (successorsData == null)
+ {
return new Version[0];
+ }
List<ValueData> successorsValues = successorsData.getValues();
Version[] successors = new Version[successorsValues.size()];
@@ -127,7 +129,6 @@
}
return successors;
-
}
/**
@@ -135,7 +136,6 @@
*/
public Version[] getPredecessors() throws RepositoryException
{
-
checkValid();
PropertyData predecessorsData =
@@ -166,15 +166,14 @@
}
return predecessors;
-
}
public void addSuccessor(String successorIdentifier, PlainChangesLog changesLog)
throws RepositoryException
{
ValueData successorRef = new TransientValueData(new
Identifier(successorIdentifier));
- TransientPropertyData successorsProp =
- (TransientPropertyData)dataManager.getItemData(nodeData(), new
QPathEntry(Constants.JCR_SUCCESSORS, 0));
+ PropertyData successorsProp =
+ (PropertyData)dataManager.getItemData(nodeData(), new
QPathEntry(Constants.JCR_SUCCESSORS, 0));
if (successorsProp == null)
{
@@ -188,20 +187,29 @@
}
else
{
- // add successor in existed one
- TransientPropertyData newSuccessorsProp = successorsProp.createTransientCopy();
- newSuccessorsProp.getValues().add(successorRef);
+ // add successor
+ List<ValueData> newSuccessorsValue = new ArrayList<ValueData>();
+ for (ValueData svd : successorsProp.getValues())
+ {
+ newSuccessorsValue.add(svd);
+ }
+ newSuccessorsValue.add(successorRef);
+
+ TransientPropertyData newSuccessorsProp =
+ new TransientPropertyData(successorsProp.getQPath(),
successorsProp.getIdentifier(), successorsProp
+ .getPersistedVersion(), successorsProp.getType(),
successorsProp.getParentIdentifier(), successorsProp
+ .isMultiValued(), newSuccessorsValue);
+
changesLog.add(ItemState.createUpdatedState(newSuccessorsProp));
}
}
public void addPredecessor(String predeccessorIdentifier, PlainChangesLog changesLog)
throws RepositoryException
{
-
ValueData predeccessorRef = new TransientValueData(new
Identifier(predeccessorIdentifier));
- TransientPropertyData predeccessorsProp =
- (TransientPropertyData)dataManager.getItemData(nodeData(), new
QPathEntry(Constants.JCR_PREDECESSORS, 0));
+ PropertyData predeccessorsProp =
+ (PropertyData)dataManager.getItemData(nodeData(), new
QPathEntry(Constants.JCR_PREDECESSORS, 0));
if (predeccessorsProp == null)
{
@@ -214,17 +222,27 @@
}
else
{
- // add successor in existed one
- TransientPropertyData newPredeccessorsProp =
predeccessorsProp.createTransientCopy();
- newPredeccessorsProp.getValues().add(predeccessorRef);
+ // add predeccessor
+ List<ValueData> newPredeccessorValue = new ArrayList<ValueData>();
+ for (ValueData svd : predeccessorsProp.getValues())
+ {
+ newPredeccessorValue.add(svd);
+ }
+ newPredeccessorValue.add(predeccessorRef);
+
+ TransientPropertyData newPredeccessorsProp =
+ new TransientPropertyData(predeccessorsProp.getQPath(),
predeccessorsProp.getIdentifier(),
+ predeccessorsProp.getPersistedVersion(), predeccessorsProp.getType(),
predeccessorsProp
+ .getParentIdentifier(), predeccessorsProp.isMultiValued(),
newPredeccessorValue);
+
changesLog.add(ItemState.createUpdatedState(newPredeccessorsProp));
}
}
void removeSuccessor(String successorIdentifier, PlainChangesLog changesLog) throws
RepositoryException
{
- TransientPropertyData successorsProp =
- (TransientPropertyData)dataManager.getItemData(nodeData(), new
QPathEntry(Constants.JCR_SUCCESSORS, 0));
+ PropertyData successorsProp =
+ (PropertyData)dataManager.getItemData(nodeData(), new
QPathEntry(Constants.JCR_SUCCESSORS, 0));
if (successorsProp != null)
{
List<ValueData> newSuccessors = new ArrayList<ValueData>();
@@ -234,7 +252,9 @@
for (ValueData sdata : successorsProp.getValues())
{
if (!successorIdentifier.equals(new String(sdata.getAsByteArray())))
+ {
newSuccessors.add(sdata);
+ }
}
}
catch (IOException e)
@@ -246,6 +266,7 @@
new TransientPropertyData(QPath.makeChildPath(nodeData().getQPath(),
Constants.JCR_SUCCESSORS,
successorsProp.getQPath().getIndex()), successorsProp.getIdentifier(),
successorsProp
.getPersistedVersion(), PropertyType.REFERENCE,
nodeData().getIdentifier(), true, newSuccessors);
+
changesLog.add(ItemState.createUpdatedState(newSuccessorsProp));
}
else
@@ -258,8 +279,8 @@
PlainChangesLog changesLog) throws RepositoryException
{
- TransientPropertyData successorsProp =
- (TransientPropertyData)dataManager.getItemData(nodeData(), new
QPathEntry(Constants.JCR_SUCCESSORS, 0));
+ PropertyData successorsProp =
+ (PropertyData)dataManager.getItemData(nodeData(), new
QPathEntry(Constants.JCR_SUCCESSORS, 0));
if (successorsProp != null)
{
@@ -270,7 +291,9 @@
for (ValueData sdata : successorsProp.getValues())
{
if (!removedSuccessorIdentifier.equals(new
String(sdata.getAsByteArray())))
+ {
newSuccessors.add(sdata);
+ }
}
}
catch (IOException e)
@@ -284,6 +307,7 @@
new TransientPropertyData(QPath.makeChildPath(nodeData().getQPath(),
Constants.JCR_SUCCESSORS,
successorsProp.getQPath().getIndex()), successorsProp.getIdentifier(),
successorsProp
.getPersistedVersion(), PropertyType.REFERENCE,
nodeData().getIdentifier(), true, newSuccessors);
+
changesLog.add(ItemState.createUpdatedState(newSuccessorsProp));
}
else
@@ -294,8 +318,8 @@
void removePredecessor(String predecessorIdentifier, PlainChangesLog changesLog)
throws RepositoryException
{
- TransientPropertyData predeccessorsProp =
- (TransientPropertyData)dataManager.getItemData(nodeData(), new
QPathEntry(Constants.JCR_PREDECESSORS, 0));
+ PropertyData predeccessorsProp =
+ (PropertyData)dataManager.getItemData(nodeData(), new
QPathEntry(Constants.JCR_PREDECESSORS, 0));
if (predeccessorsProp != null)
{
@@ -306,7 +330,9 @@
for (ValueData sdata : predeccessorsProp.getValues())
{
if (!predecessorIdentifier.equals(new String(sdata.getAsByteArray())))
+ {
newPredeccessors.add(sdata);
+ }
}
}
catch (IOException e)
@@ -318,6 +344,7 @@
new TransientPropertyData(QPath.makeChildPath(nodeData().getQPath(),
Constants.JCR_PREDECESSORS,
predeccessorsProp.getQPath().getIndex()),
predeccessorsProp.getIdentifier(), predeccessorsProp
.getPersistedVersion(), PropertyType.REFERENCE,
nodeData().getIdentifier(), true, newPredeccessors);
+
changesLog.add(ItemState.createUpdatedState(newPredecessorsProp));
}
else
@@ -330,8 +357,8 @@
PlainChangesLog changesLog) throws RepositoryException
{
- TransientPropertyData predeccessorsProp =
- (TransientPropertyData)dataManager.getItemData(nodeData(), new
QPathEntry(Constants.JCR_PREDECESSORS, 0));
+ PropertyData predeccessorsProp =
+ (PropertyData)dataManager.getItemData(nodeData(), new
QPathEntry(Constants.JCR_PREDECESSORS, 0));
if (predeccessorsProp != null)
{
@@ -342,7 +369,9 @@
for (ValueData sdata : predeccessorsProp.getValues())
{
if (!removedPredecessorIdentifier.equals(new
String(sdata.getAsByteArray())))
+ {
newPredeccessors.add(sdata);
+ }
}
}
catch (IOException e)
@@ -356,6 +385,7 @@
new TransientPropertyData(QPath.makeChildPath(nodeData().getQPath(),
Constants.JCR_PREDECESSORS,
predeccessorsProp.getQPath().getIndex()),
predeccessorsProp.getIdentifier(), predeccessorsProp
.getPersistedVersion(), PropertyType.REFERENCE,
nodeData().getIdentifier(), true, newPredeccessors);
+
changesLog.add(ItemState.createUpdatedState(newPredecessorsProp));
}
else
@@ -376,7 +406,9 @@
(VersionHistoryImpl)dataManager.getItemByIdentifier(nodeData().getParentIdentifier(),
true);
if (vhistory == null)
+ {
throw new VersionException("Version history item is not found for version
" + getPath());
+ }
return vhistory;
}
Modified:
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java
===================================================================
---
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 2009-12-10
11:28:57 UTC (rev 983)
+++
jcr/branches/1.12.0-OPT/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/WorkspacePersistentDataManager.java 2009-12-10
12:17:44 UTC (rev 984)
@@ -38,8 +38,7 @@
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.dataflow.TransientItemData;
-import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData;
+import org.exoplatform.services.jcr.impl.dataflow.PersistedValueData;
import org.exoplatform.services.jcr.impl.dataflow.TransientValueData;
import org.exoplatform.services.jcr.impl.storage.SystemDataContainerHolder;
import org.exoplatform.services.jcr.storage.WorkspaceDataContainer;
@@ -124,6 +123,7 @@
this.systemDataContainer = systemDataContainerHolder.getContainer();
}
+ // TODO cleanup prev impl
// /**
// * {@inheritDoc}
// */
@@ -216,10 +216,6 @@
if (readOnly && !(changesLog instanceof ReadOnlyThroughChanges))
throw new ReadOnlyWorkspaceException("Workspace container '" +
dataContainer.getName() + "' is read-only.");
- //final Set<QPath> addedNodes = new HashSet<QPath>();
- //WorkspaceStorageConnection thisConnection = null;
- //WorkspaceStorageConnection systemConnection = null;
-
ChangesLogPersister persister = new ChangesLogPersister();
// whole log will be reconstructed with persisted data
@@ -227,13 +223,9 @@
try
{
- //List<PlainChangesLog> chengesLogList = new
ArrayList<PlainChangesLog>();
if (changesLog instanceof PlainChangesLogImpl)
{
persistedLog = persister.save((PlainChangesLogImpl)changesLog);
- //new PlainChangesLogImpl(new ArrayList<ItemState>(),
prev.getSessionId(), prev.getEventType(), prev.getPairId());
-
- //chengesLogList.add((PlainChangesLog)changesLog);
}
else if (changesLog instanceof TransactionChangesLog)
{
@@ -245,8 +237,6 @@
for (ChangesLogIterator iter = orig.getLogIterator(); iter.hasNextLog();)
{
persisted.addLog(persister.save(iter.nextLog()));
-
- //chengesLogList.add(iter.nextLog());
}
persistedLog = persisted;
@@ -257,6 +247,7 @@
throw new RepositoryException("Unsupported changes log class " +
changesLog.getClass());
}
+ // TODO cleanup prev impl
// for (PlainChangesLog clog : chengesLogList)
// {
// for (Iterator<ItemState> iter =
clog.getAllStates().iterator(); iter.hasNext();)
@@ -306,12 +297,6 @@
// }
// }
// }
-
- // if (thisConnection != null)
- // thisConnection.commit();
- // if (systemConnection != null &&
!systemConnection.equals(thisConnection))
- // systemConnection.commit();
-
persister.commit();
}
catch (IOException e)
@@ -320,14 +305,6 @@
}
finally
{
- // if (thisConnection != null && thisConnection.isOpened())
- // thisConnection.rollback();
- // if (systemConnection != null &&
!systemConnection.equals(thisConnection) && systemConnection.isOpened())
- // systemConnection.rollback();
- //
- // // help to GC
- // addedNodes.clear();
-
persister.rollback();
}
@@ -437,7 +414,7 @@
}
else
{
- TransientPropertyData prevData =
(TransientPropertyData)prevState.getData();
+ PropertyData prevData = (PropertyData)prevState.getData();
List<ValueData> values = new ArrayList<ValueData>();
for (ValueData vd : prevData.getValues())
@@ -453,11 +430,23 @@
// TODO for JBC case, the storage connection will evict the
replicated Value to read it from the DB
File destFile = null;
- TransientValueData tvd = (TransientValueData)vd;
-
- // TODO review of TransientValueData logic about get stream and
file, to be sure we got a
- values.add(new StreamPersistedValueData(destFile,
tvd.getSpoolFile(), tvd.getSpoolFile() == null
- ? tvd.getAsStream(false) : null, vd.getOrderNumber()));
+ if (vd instanceof TransientValueData)
+ {
+ TransientValueData tvd = (TransientValueData)vd;
+ // TODO review TransientValueData logic about spool file and
stream
+ values.add(new StreamPersistedValueData(destFile,
tvd.getSpoolFile(),
+ tvd.getSpoolFile() == null ? tvd.getAsStream(false) : null,
vd.getOrderNumber()));
+ }
+ else if (vd instanceof PersistedValueData)
+ {
+ values.add(((PersistedValueData)vd).createTransientCopy());
+ }
+ else
+ {
+ throw new RepositoryException(
+ "Unexpected ValueData implementaion on persistent level,
only TransientValueData or PersistedValueData allowed. "
+ + vd.getClass());
+ }
}
}
@@ -691,8 +680,8 @@
* @throws InvalidItemStateException
* if the item is already deleted
*/
- protected void doDelete(final ItemData item, final WorkspaceStorageConnection con)
- throws RepositoryException, InvalidItemStateException
+ protected void doDelete(final ItemData item, final WorkspaceStorageConnection con)
throws RepositoryException,
+ InvalidItemStateException
{
if (item.isNode())
@@ -712,8 +701,8 @@
* @throws InvalidItemStateException
* if the item not found TODO compare persistedVersion number
*/
- protected void doUpdate(final ItemData item, final WorkspaceStorageConnection con)
- throws RepositoryException, InvalidItemStateException
+ protected void doUpdate(final ItemData item, final WorkspaceStorageConnection con)
throws RepositoryException,
+ InvalidItemStateException
{
if (item.isNode())
@@ -765,8 +754,8 @@
* @throws RepositoryException
* @throws InvalidItemStateException
*/
- protected void doRename(final ItemData item, final WorkspaceStorageConnection con,
- final Set<QPath> addedNodes) throws RepositoryException,
InvalidItemStateException
+ protected void doRename(final ItemData item, final WorkspaceStorageConnection con,
final Set<QPath> addedNodes)
+ throws RepositoryException, InvalidItemStateException
{
final NodeData node = (NodeData)item;