Hi all,
I have a requirement in which for a perticular type of document, on import/create new i need to place(locate) this document to a folder location based on its attributes. So, we have written a TBO which will call an SBO - SBO takes care of reading the attributes from the sysobject, creating the folder path, checking if the folder path is already present - if not the folder path is created and link the document to the folder structure.
In my SBO, I am able to extract attribute values from the sysobject and I am constructing the folder structure and I am able to check if the folder structure is present or not in the repository.
Problem is, if the fodler path is not existing, I am trying to create a folder object, set attributes and save the folder object. While doing this, folder is not getting created and I am getting this error.
04:25:21,626 DEBUG [main] com.documentum.fc.client.impl.objectprotocol.ObjectProtocolV1 - Extended attributes changed for dmi_dd_type_info
AbstractObjectProtocol$AttributeMismatchException:: THREAD: main; MSG: [DFC_OBJPROTO_ATTRIBUTE_MISMATCH] The serialized attribute "r_supertype" did not match the previous definition; ERRORCODE: ff; NEXT: null
at com.documentum.fc.client.impl.objectprotocol.AbstractObjectProtocol.resolveAttribute(AbstractObjectProtocol.java:61)
at com.documentum.fc.client.impl.objectprotocol.ObjectProtocolV1.deserializeExtendedAttributes(ObjectProtocolV1.java:126)
at com.documentum.fc.client.impl.objectprotocol.ObjectProtocolV1.deserializeObject(ObjectProtocolV1.java:96)
at com.documentum.fc.client.impl.objectprotocol.ObjectProtocolV1.deserializeObjectWithPossiblyExtendedType(ObjectProtocolV1.java:203)
at com.documentum.fc.client.impl.objectprotocol.ObjectProtocolV1.deserializeObjectWithPreamble(ObjectProtocolV1.java:309)
at com.documentum.fc.client.impl.connection.docbase.netwise.NetwiseDocbaseRpcClient.applyForObject(NetwiseDocbaseRpcClient.java:663)
at com.documentum.fc.client.impl.connection.docbase.DocbaseConnection$8.evaluate(DocbaseConnection.java:1246)
at com.documentum.fc.client.impl.connection.docbase.DocbaseConnection.evaluateRpc(DocbaseConnection.java:1014)
at com.documentum.fc.client.impl.connection.docbase.DocbaseConnection.applyForObject(DocbaseConnection.java:1238)
at com.documentum.fc.client.impl.docbase.DocbaseApi.getDDObject(DocbaseApi.java:825)
at com.documentum.fc.client.impl.dd.DDInfoManager.fetchFromServer(DDInfoManager.java:177)
at com.documentum.fc.client.impl.dd.DDInfoManager.getCacheItem(DDInfoManager.java:100)
at com.documentum.fc.client.impl.dd.DDInfoManager.getDDInfo(DDInfoManager.java:46)
at com.documentum.fc.client.impl.TypeManager.getTypeDescription(TypeManager.java:80)
at com.documentum.fc.client.impl.session.Session.getTypeDescription(Session.java:1226)
at com.documentum.fc.client.impl.dd.DfTypeInfo.loadTypes(DfTypeInfo.java:49)
at com.documentum.fc.client.impl.dd.DfTypeInfo.getDefaultAspects(DfTypeInfo.java:189)
at com.documentum.fc.client.impl.dd.DfTypeInfo.getDefaultAspects(DfTypeInfo.java:152)
at com.documentum.fc.client.DfPersistentObject.attachDefaultAspects(DfPersistentObject.java:1872)
at com.documentum.fc.client.DfPersistentObject.init(DfPersistentObject.java:161)
at com.documentum.fc.client.DfSysObject.init(DfSysObject.java:98)
at com.documentum.fc.client.DfPersistentObject.initialize(DfPersistentObject.java:108)
at com.documentum.fc.client.DfFolder___PROXY.initialize(DfFolder___PROXY.java)
at com.documentum.fc.client.impl.objectmanager.PObjectFactoryWithAspects.makeObject(PObjectFactoryWithAspects.java:54)
at com.documentum.fc.client.impl.objectmanager.PersistentObjectManager.newUncachedObject(PersistentObjectManager.java:100)
at com.documentum.fc.client.impl.objectmanager.PersistentObjectManager.newObject(PersistentObjectManager.java:66)
at com.documentum.fc.client.impl.objectmanager.PersistentObjectManager.newObject(PersistentObjectManager.java:52)
at com.documentum.fc.client.impl.session.Session.newObject(Session.java:817)
at com.documentum.fc.client.impl.session.SessionHandle.newObject(SessionHandle.java:828)
at com.honeywell.dctm.sbo.HonAutoFileSBO.folderOperation(HonAutoFileSBO.java:293)
at com.honeywell.dctm.sbo.HonAutoFileSBO.execute(HonAutoFileSBO.java:72)
at com.test.TestTBO.main(TestTBO.java:62)
04:25:21,626 DEBUG [main] com.honeywell.dctm.sbo.HonAutoFileSBO - aaaa
04:25:21,626 DEBUG [main] com.honeywell.dctm.sbo.HonAutoFileSBO - bbbb
04:25:21,626 DEBUG [main] com.honeywell.dctm.sbo.HonAutoFileSBO - cccc
04:25:21,626 DEBUG [main] com.honeywell.dctm.sbo.HonAutoFileSBO - dddd
04:25:21,626 DEBUG [main] com.honeywell.dctm.sbo.HonAutoFileSBO - eeee
04:25:21,626 DEBUG [main] com.honeywell.dctm.sbo.HonAutoFileSBO - ffff
04:25:21,626 DEBUG [main] com.documentum.fc.client.impl.objectprotocol.ObjectProtocolV1 - deserializeType: 204:25:21,626 DEBUG [main] com.documentum.fc.client.impl.bof.cache.ClassCacheManager - queried cache for dm_user moduleKey
04:25:21,626 DEBUG [main] com.documentum.fc.client.impl.bof.cache.ClassCacheManager - cache miss for dm_user moduleKey
04:25:21,641 DEBUG [main] com.documentum.fc.client.impl.objectprotocol.ObjectProtocolV1 - deserializeType: 204:25:21,704 ERROR [main] com.honeywell.dctm.sbo.HonAutoFileSBO - Error has occurred in HonAutoFileSBO folderOperation
This is the method where I am extracting the folder structure and doing the check. I am getting the session from the sysobject
IDfSession session = sysObject.getSession();
@SuppressWarnings("finally")
public String folderOperation(IDfSession session, IDfSysObject sysObject,
Node element,String strFolderName)
throws DfException{
int iAttributeCount = 0;
int iCount = 0;
String strFolderType = null;
String strFolderAcl = null;
String strFolderNodeName = null;
String strOriFolderName = null;
ArrayList<String> alCommon = null;
Node ndFolder = null;
NodeList nlFolderNodeList = null;
//IDfFolder folder = null;
//IDfSysObject folder = null;
try {
nlFolderNodeList = xPathParserNode(element,STR_FOLDER_CHILD_NODES);
if(nlFolderNodeList!=null && nlFolderNodeList.getLength()>0){
DfLogger.debug(this, "folder node child count:::"+nlFolderNodeList.getLength(), null, null);
for(iAttributeCount = 0;iAttributeCount<nlFolderNodeList.
getLength();iAttributeCount++){
ndFolder = nlFolderNodeList.item(iAttributeCount);
strFolderNodeName = ndFolder.getNodeName().trim();
DfLogger.debug(this, "folderNode child node name:::"+strFolderNodeName, null, null);
alCommon = xPathParser(element, STR_ATTR_ACL_NAME);
if(alCommon!=null && alCommon.size()>0){
for(iCount = 0;iCount<alCommon.
size();iCount++){
strFolderAcl = alCommon.get(iCount).
trim();
}
}
alCommon = xPathParser(element, STR_ATTR_TYPE);
IDfClientX clientX = new DfClientX();
IDfQuery qDqlQuery = null;
if(alCommon!=null && alCommon.size()>0){
for(iCount = 0;iCount<alCommon.
size();iCount++){
strFolderType = alCommon.get(iCount).
trim();
}
}
if(strFolderNodeName.equalsIgnoreCase(STR_TEXT)){
strOriFolderName = ndFolder.getTextContent().trim();
}
if(strFolderNodeName.equalsIgnoreCase(STR_NAME)){
strOriFolderName = sysObject.getString
(ndFolder.getTextContent().trim());
}
strOriFolderName = strOriFolderName.replace('/', '-');
DfLogger.debug(this, "Inside HonAutoFileSBO, " +
"FolderName actual folder name:::"+strOriFolderName,
null, null);
DfLogger.debug(this, "Inside HonAutoFileSBO," +
" FolderName folder type:::"+strFolderType,
null, null);
DfLogger.debug(this, "Inside HonAutoFileSBO," +
" FolderName folder acl:::"+strFolderAcl,
null, null);
/* Check if the folder already exists
*/
if(strOriFolderName!=null && strFolderType!=null &&
strFolderName!=null){
IDfFolder folder1 = (IDfFolder) session.getObjectByQualification
("dm_folder where object_name = '"
+ strOriFolderName+ "' and FOLDER('"+
strFolderName+ "') and r_object_type = '"+
strFolderType+"'");
if (folder1 == null) {
DfLogger.debug(this, "Inside HonAutoFileSBO, " +
"Creating folder:::"+strOriFolderName,
null, null);
DfLogger.debug(this, "Docbase name::::"+session.getDocbaseName(), null, null);
IDfFolder folder = (IDfFolder) session.newObject
(strFolderType.trim());
DfLogger.debug(this, "aaaa", null, null);
folder.setObjectName(strOriFolderName);
DfLogger.debug(this, "bbbb", null, null);
if (strFolderAcl!=null && !strFolderAcl.
equals(STR_EMPTY_SPACE)) {
DfLogger.debug(this, "cccc", null, null);
folder.setACLName(strFolderAcl);
DfLogger.debug(this, "dddd", null, null);
folder.setACLDomain(STR_DM_DBO);
DfLogger.debug(this, "eeee", null, null);
}
DfLogger.debug(this, "ffff", null, null);
folder.setString("r_object_type", "dm_folder");
DfLogger.debug(this, "gggg", null, null);
folder.link(strFolderName);
DfLogger.debug(this, "hhhh", null, null);
folder.save();
DfLogger.debug(this, "iiii", null, null);
}
strFolderName = strFolderName+STR_SEPERATOR+
strOriFolderName;
DfLogger.debug(this, "Inside HonAutoFileSBO," +
" Folderpath constructed:::"+strFolderName,
null, null);
}
}
}
} catch (DfException dfException) {
DfLogger.error(this, "Error has occurred in HonAutoFileSBO " +
"folderOperation", null, null);
throw dfException;
} finally{
DfLogger.debug(this, "Inside HonAutoFileSBO, the folder path " +
"where the file needs to be linked:::"+strFolderName,
null, null);
return strFolderName;
}
}I don't get the fully formed fodler path at the end of this method.
Kindly help me in this regard.
TIA,
Siva Raj Gandhi