mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Support for different import strategies:
- replace existing - remove existing - throw error on conflict git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2027 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -49,6 +49,7 @@ public class NodeContext extends ElementContext
|
||||
{
|
||||
private ParentContext parentContext;
|
||||
private NodeRef nodeRef;
|
||||
private String uuid;
|
||||
private TypeDefinition typeDef;
|
||||
private String childName;
|
||||
private Map<QName, AspectDefinition> nodeAspects = new HashMap<QName, AspectDefinition>();
|
||||
@@ -69,6 +70,7 @@ public class NodeContext extends ElementContext
|
||||
super(elementName, parentContext.getDictionaryService(), parentContext.getImporter());
|
||||
this.parentContext = parentContext;
|
||||
this.typeDef = typeDef;
|
||||
this.uuid = null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
@@ -112,6 +114,23 @@ public class NodeContext extends ElementContext
|
||||
{
|
||||
this.nodeRef = nodeRef;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.repo.importer.ImportNode#getUUID()
|
||||
*/
|
||||
public String getUUID()
|
||||
{
|
||||
return uuid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param uuid uuid
|
||||
*/
|
||||
public void setUUID(String uuid)
|
||||
{
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.repo.importer.ImportNode#getChildName()
|
||||
@@ -128,8 +147,7 @@ public class NodeContext extends ElementContext
|
||||
{
|
||||
this.childName = childName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Adds a collection property to the node
|
||||
*
|
||||
@@ -163,9 +181,17 @@ public class NodeContext extends ElementContext
|
||||
*/
|
||||
public void addProperty(QName property, String value)
|
||||
{
|
||||
// Do not import properties of sys:referenceable or cm:versionable
|
||||
// Process "special" properties
|
||||
// TODO: Make this configurable...
|
||||
PropertyDefinition propDef = getDictionaryService().getProperty(property);
|
||||
|
||||
// Process Alfresco UUID
|
||||
if (propDef != null && propDef.getName().equals(ContentModel.PROP_NODE_UUID))
|
||||
{
|
||||
uuid = value;
|
||||
}
|
||||
|
||||
// Do not import properties of sys:referenceable or cm:versionable
|
||||
ClassDefinition classDef = (propDef == null) ? null : propDef.getContainerClass();
|
||||
if (classDef != null)
|
||||
{
|
||||
|
@@ -110,6 +110,16 @@ public class ParentContext extends ElementContext
|
||||
return parentRef;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Parent Reference
|
||||
*
|
||||
* @param parentRef parent reference
|
||||
*/
|
||||
public void setParentRef(NodeRef parentRef)
|
||||
{
|
||||
this.parentRef = parentRef;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.repo.importer.ImportParent#getAssocType()
|
||||
*/
|
||||
@@ -118,6 +128,16 @@ public class ParentContext extends ElementContext
|
||||
return assocType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Parent / Child Assoc Type
|
||||
*
|
||||
* @param assocType association type
|
||||
*/
|
||||
public void setAssocType(QName assocType)
|
||||
{
|
||||
this.assocType = assocType;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
|
Reference in New Issue
Block a user