mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Extended the content model to include relevant avm specific types.
cm:avmcontent and cm:avmfolder are 'abstract'. cm:avmplaincontent is derived from cm:avmcontent and is just a plain file. cm:avmlayeredcontent is derived from cm:avmcontent and is (surprise) a layered file and has a d:noderef mandatory property, cm:avmfileindirection, that is the (possibly non-existent) file that the layered file is transparent to. cm:avmplainfolder is derived from cm:avmfolder and is just a plain directory. cm:avmlayeredfolder is a layered directory and has a property, cm:avmdirinderection, that is the (possibly non-existent) directory that the layered directory is transparent to. The ContentModel QName constants are. TYPE_AVM_PLAIN_FOLDER TYPE_AVM_LAYERED_FOLDER TYPE_AVM_PLAIN_CONTENT TYPE_AVM_LAYERED_CONTENT PROP_AVM_DIR_INDIRECTION PROP_AVM_FILE_INDIRECTION One can now create all four flavors of avm nodes through AVMNodeService.createNode(). The advantage of using these over the corresponding AVMService methods is that since (for now) AVMService, is permission and indexing unaware. Backed out cm:mounted aspect and dispatching code in DbNodeServiceImpl. (Dave and Derek, you may now relax) as we are implementing the UI with AVM dedicated screens. Finally, beginning interface for AVM node tree synchronization and comparison. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3764 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -31,7 +31,6 @@ import java.util.Stack;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.avm.AVMContext;
|
||||
import org.alfresco.repo.domain.ChildAssoc;
|
||||
import org.alfresco.repo.domain.Node;
|
||||
import org.alfresco.repo.domain.NodeAssoc;
|
||||
@@ -253,20 +252,6 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
|
||||
Assert.notNull(assocTypeQName);
|
||||
Assert.notNull(assocQName);
|
||||
|
||||
// get the parent node
|
||||
Node parentNode = getNodeNotNull(parentRef);
|
||||
|
||||
if (parentNode.getAspects().contains(ContentModel.ASPECT_MOUNTED))
|
||||
{
|
||||
NodeRef mounted = (NodeRef)parentNode.getProperties().get(ContentModel.PROP_MOUNTPOINT).
|
||||
getValue(DataTypeDefinition.NODE_REF);
|
||||
return AVMContext.fgInstance.getNodeService().createNode(mounted,
|
||||
assocTypeQName,
|
||||
assocQName,
|
||||
nodeTypeQName,
|
||||
properties);
|
||||
}
|
||||
|
||||
// null property map is allowed
|
||||
if (properties == null)
|
||||
{
|
||||
@@ -317,6 +302,9 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
|
||||
propertiesAfter = setPropertiesImpl(childNode, properties);
|
||||
}
|
||||
|
||||
// get the parent node
|
||||
Node parentNode = getNodeNotNull(parentRef);
|
||||
|
||||
// create the association
|
||||
ChildAssoc childAssoc = nodeDaoService.newChildAssoc(
|
||||
parentNode,
|
||||
@@ -724,15 +712,6 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
|
||||
{
|
||||
Node parentNode = getNodeNotNull(parentRef);
|
||||
|
||||
if (parentNode.getAspects().contains(ContentModel.ASPECT_MOUNTED))
|
||||
{
|
||||
NodeRef mounted =
|
||||
(NodeRef)parentNode.getProperties().get(ContentModel.PROP_MOUNTPOINT).
|
||||
getValue(DataTypeDefinition.NODE_REF);
|
||||
AVMContext.fgInstance.getNodeService().removeChild(mounted, childRef);
|
||||
return;
|
||||
}
|
||||
|
||||
Node childNode = getNodeNotNull(childRef);
|
||||
Long childNodeId = childNode.getId();
|
||||
|
||||
@@ -1017,14 +996,6 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
|
||||
public List<ChildAssociationRef> getChildAssocs(NodeRef nodeRef, QNamePattern typeQNamePattern, QNamePattern qnamePattern)
|
||||
{
|
||||
Node node = getNodeNotNull(nodeRef);
|
||||
if (node.getAspects().contains(ContentModel.ASPECT_MOUNTED))
|
||||
{
|
||||
NodeRef mounted = (NodeRef)node.getProperties().get(ContentModel.PROP_MOUNTPOINT).
|
||||
getValue(DataTypeDefinition.NODE_REF);
|
||||
return AVMContext.fgInstance.getNodeService().getChildAssocs(mounted,
|
||||
typeQNamePattern,
|
||||
qnamePattern);
|
||||
}
|
||||
// get the assocs pointing from it
|
||||
Collection<ChildAssociationRef> childAssocRefs = nodeDaoService.getChildAssocRefs(node);
|
||||
// shortcut if there are no assocs
|
||||
@@ -1061,14 +1032,6 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
|
||||
public NodeRef getChildByName(NodeRef nodeRef, QName assocTypeQName, String childName)
|
||||
{
|
||||
Node node = getNodeNotNull(nodeRef);
|
||||
if (node.getAspects().contains(ContentModel.ASPECT_MOUNTED))
|
||||
{
|
||||
NodeRef mounted = (NodeRef)node.getProperties().get(ContentModel.PROP_MOUNTPOINT).
|
||||
getValue(DataTypeDefinition.NODE_REF);
|
||||
return AVMContext.fgInstance.getNodeService().getChildByName(mounted,
|
||||
assocTypeQName,
|
||||
childName);
|
||||
}
|
||||
ChildAssoc childAssoc = nodeDaoService.getChildAssoc(node, assocTypeQName, childName);
|
||||
if (childAssoc != null)
|
||||
{
|
||||
|
Reference in New Issue
Block a user