|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.senn.magic.dctm.TypeConverter
public class TypeConverter
Converts an object in Documentum into another type (including older versions).
Currently only for dm_document
subtypes.
NOTES:
This creates a new object with data from the first one in Documentum so
Nested Class Summary | |
---|---|
protected class |
TypeConverter.InvalidMappingException
Internal Exception for when the mapping is invalid |
protected class |
TypeConverter.TempSysObject
Internal class that represents a sysobject with its versionlabels/ |
Field Summary | |
---|---|
protected Map<String,String> |
attributeMapping
|
protected static String |
FIRST_VERSION_LABEL
|
protected com.documentum.fc.client.IDfSysObject |
sourceObject
|
protected String |
targetObjectType
|
Constructor Summary | |
---|---|
TypeConverter(com.documentum.fc.client.IDfSysObject sourceObject,
String targetObjectType,
Map<String,String> attributeMapping)
Builds a TypeConverter object |
Method Summary | |
---|---|
void |
addAttributeMapping(String sourceAttr,
String targetAttr)
Adds an entry to the attribute mapping |
com.documentum.fc.client.IDfSysObject |
convert(com.documentum.fc.client.IDfSession session,
boolean deleteSource)
Converts the object to another type. |
Map<String,String> |
getAttributeMapping()
|
com.documentum.fc.client.IDfSysObject |
getSourceObject()
|
String |
getTargetObjectType()
|
protected void |
setAttributeMapping(Map<String,String> attributeMapping)
|
protected void |
setAttributes(com.documentum.fc.client.IDfSysObject newObject,
com.documentum.fc.client.IDfSession session)
Internal method that sets the attributes of the new sysobject. |
protected void |
setSourceObject(com.documentum.fc.client.IDfSysObject sourceObject)
|
protected void |
setTargetObjectType(String targetObjectType)
|
protected boolean |
validateMapping()
Internal method that validates the |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String FIRST_VERSION_LABEL
protected Map<String,String> attributeMapping
protected com.documentum.fc.client.IDfSysObject sourceObject
protected String targetObjectType
Constructor Detail |
---|
public TypeConverter(com.documentum.fc.client.IDfSysObject sourceObject, String targetObjectType, Map<String,String> attributeMapping)
TypeConverter
object
sourceObject
- the source object in DocumentumtargetObjectType
- the target object typeattributeMapping
- the mapping of attribute values to allow porting of (custom) metadata,
for example:
"source_custom_string" => "target_custom_string"
"source_custom_string2" => "title"
Method Detail |
---|
public com.documentum.fc.client.IDfSysObject convert(com.documentum.fc.client.IDfSession session, boolean deleteSource) throws com.documentum.fc.common.DfException
session
- a valid Documentum session.
The user must have enough privileges to perform the actions!deleteSource
- whether or not to delete the source object after the conversion.IDfSysObject
- the newly created object
com.documentum.fc.common.DfException
protected void setAttributes(com.documentum.fc.client.IDfSysObject newObject, com.documentum.fc.client.IDfSession session) throws com.documentum.fc.common.DfException
newObject
- the new sysobjectsession
- a valid Documentum session
com.documentum.fc.common.DfException
protected boolean validateMapping() throws TypeConverter.InvalidMappingException
TypeConverter.InvalidMappingException
public com.documentum.fc.client.IDfSysObject getSourceObject()
IDfSysObject
- the source objectprotected void setSourceObject(com.documentum.fc.client.IDfSysObject sourceObject)
public Map<String,String> getAttributeMapping()
Map
- the attribute mappingprotected void setAttributeMapping(Map<String,String> attributeMapping)
public void addAttributeMapping(String sourceAttr, String targetAttr)
sourceAttr
- attribute of the source objecttargetAttr
- attribute of the target objectpublic String getTargetObjectType()
String
- the target object typeprotected void setTargetObjectType(String targetObjectType)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |