mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Unfix AR-822 and defer to AR-1573.
The in-transaction work has to align with the work that will be done by the actual background archival, but node archival doesn't fully support all model constructs and associated behaviour. Instead of continuing to hack away at each issue that comes up, a complete archive rethink is in order. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6154 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -285,9 +285,6 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
|
||||
Assert.notNull(assocTypeQName);
|
||||
Assert.notNull(assocQName);
|
||||
|
||||
// Get the parent node
|
||||
Node parentNode = getNodeNotNull(parentRef);
|
||||
|
||||
// null property map is allowed
|
||||
if (properties == null)
|
||||
{
|
||||
@@ -327,6 +324,8 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
|
||||
// We now have enough to declare the child association creation
|
||||
invokeBeforeCreateChildAssociation(parentRef, childNodeRef, assocTypeQName, assocQName, true);
|
||||
|
||||
// Get the parent node
|
||||
Node parentNode = getNodeNotNull(parentRef);
|
||||
// Create the association
|
||||
ChildAssoc childAssoc = nodeDaoService.newChildAssoc(
|
||||
parentNode,
|
||||
@@ -521,12 +520,12 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
|
||||
{
|
||||
throw new InvalidTypeException(typeQName);
|
||||
}
|
||||
Node node = getNodeNotNull(nodeRef);
|
||||
|
||||
// Invoke policies
|
||||
invokeBeforeUpdateNode(nodeRef);
|
||||
|
||||
// Get the node and set the new type
|
||||
Node node = getNodeNotNull(nodeRef);
|
||||
node.setTypeQName(typeQName);
|
||||
|
||||
// Add the default aspects to the node (update the properties with any new default values)
|
||||
@@ -554,12 +553,12 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
|
||||
throw new InvalidAspectException("The aspect is invalid: " + aspectTypeQName, aspectTypeQName);
|
||||
}
|
||||
|
||||
Node node = getNodeNotNull(nodeRef);
|
||||
|
||||
// Invoke policy behaviours
|
||||
invokeBeforeUpdateNode(nodeRef);
|
||||
invokeBeforeAddAspect(nodeRef, aspectTypeQName);
|
||||
|
||||
Node node = getNodeNotNull(nodeRef);
|
||||
|
||||
// attach the properties to the current node properties
|
||||
Map<QName, Serializable> nodeProperties = getPropertiesImpl(node);
|
||||
|
||||
@@ -688,14 +687,11 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public boolean deleteNode(NodeRef nodeRef)
|
||||
public void deleteNode(NodeRef nodeRef)
|
||||
{
|
||||
// First get the node to ensure that it exists
|
||||
Node node = getNodeNotNull(nodeRef);
|
||||
|
||||
|
||||
boolean requiresDelete = false;
|
||||
|
||||
// Invoke policy behaviours
|
||||
@@ -740,20 +736,17 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
|
||||
archiveNode(nodeRef, archiveStoreRef);
|
||||
// The archive performs a move, which will fire the appropriate OnDeleteNode
|
||||
}
|
||||
// Done
|
||||
return true;
|
||||
}
|
||||
|
||||
public ChildAssociationRef addChild(NodeRef parentRef, NodeRef childRef, QName assocTypeQName, QName assocQName)
|
||||
{
|
||||
// Invoke policy behaviours
|
||||
invokeBeforeCreateChildAssociation(parentRef, childRef, assocTypeQName, assocQName, false);
|
||||
|
||||
// get the parent node and ensure that it is a container node
|
||||
Node parentNode = getNodeNotNull(parentRef);
|
||||
// get the child node
|
||||
Node childNode = getNodeNotNull(childRef);
|
||||
|
||||
// Invoke policy behaviours
|
||||
invokeBeforeCreateChildAssociation(parentRef, childRef, assocTypeQName, assocQName, false);
|
||||
|
||||
// make the association
|
||||
ChildAssoc assoc = nodeDaoService.newChildAssoc(
|
||||
parentNode,
|
||||
@@ -931,9 +924,6 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
|
||||
|
||||
public Serializable getProperty(NodeRef nodeRef, QName qname) throws InvalidNodeRefException
|
||||
{
|
||||
// get the property from the node
|
||||
Node node = getNodeNotNull(nodeRef);
|
||||
|
||||
// spoof referencable properties
|
||||
if (qname.equals(ContentModel.PROP_STORE_PROTOCOL))
|
||||
{
|
||||
@@ -948,6 +938,9 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
|
||||
return nodeRef.getId();
|
||||
}
|
||||
|
||||
// get the property from the node
|
||||
Node node = getNodeNotNull(nodeRef);
|
||||
|
||||
if (qname.equals(ContentModel.PROP_NODE_DBID))
|
||||
{
|
||||
return node.getId();
|
||||
@@ -1048,12 +1041,12 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
|
||||
{
|
||||
Assert.notNull(qname);
|
||||
|
||||
// get the node
|
||||
Node node = getNodeNotNull(nodeRef);
|
||||
|
||||
// Invoke policy behaviours
|
||||
invokeBeforeUpdateNode(nodeRef);
|
||||
|
||||
// get the node
|
||||
Node node = getNodeNotNull(nodeRef);
|
||||
|
||||
// Do the set operation
|
||||
Map<QName, Serializable> propertiesBefore = getPropertiesImpl(node);
|
||||
Map<QName, Serializable> propertiesAfter = setPropertyImpl(node, qname, value);
|
||||
@@ -1101,12 +1094,12 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
|
||||
throw new UnsupportedOperationException("The property " + qname + " may not be removed individually");
|
||||
}
|
||||
|
||||
// Get the node
|
||||
Node node = getNodeNotNull(nodeRef);
|
||||
|
||||
// Invoke policy behaviours
|
||||
invokeBeforeUpdateNode(nodeRef);
|
||||
|
||||
// Get the node
|
||||
Node node = getNodeNotNull(nodeRef);
|
||||
|
||||
// Get the values before
|
||||
Map<QName, Serializable> propertiesBefore = getPropertiesImpl(node);
|
||||
// Remove the property
|
||||
@@ -1617,7 +1610,6 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
|
||||
for (NodeStatus oldNodeStatus : nodeStatusesById.values())
|
||||
{
|
||||
Node nodeToMove = oldNodeStatus.getNode();
|
||||
NodeRef oldNodeRef = nodeToMove.getNodeRef();
|
||||
nodeToMove.setStore(store);
|
||||
NodeRef newNodeRef = nodeToMove.getNodeRef();
|
||||
|
||||
@@ -1627,10 +1619,6 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
|
||||
NodeStatus newNodeStatus = nodeDaoService.getNodeStatus(newNodeRef, true);
|
||||
newNodeStatus.setNode(nodeToMove);
|
||||
|
||||
// Record change IDs
|
||||
nodeDaoService.recordChangeId(oldNodeRef);
|
||||
nodeDaoService.recordChangeId(newNodeRef);
|
||||
|
||||
invokeOnUpdateNode(newNodeRef);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user