Dear All,
I am getting below exception when I am trying to add “dm_note” to a document with the same document ID. I understand my code is throwing below error because I don’t have the privileges to add new “dm_note” type to a document.
Is there any way to get the super user information (user name and password) using code?
DfSysObjectException:: THREAD: http-8080-Processor19; MSG: [DM_CONTENT_E_BAD_FORMAT]error: "Format T_L is invalid"; ERRORCODE: 100; NEXT: null
at com.documentum.fc.client.DfSysObjectException.newBadFormat(DfSysObjectException.java:30)
at com.documentum.fc.client.content.impl.ContentManager.verifyFormatExists(ContentManager.java:619)
at com.documentum.fc.client.content.impl.ContentManager.makeContentInternal(ContentManager.java:490)
at com.documentum.fc.client.content.impl.ContentManager.verifySetContentandLink(ContentManager.java:475)
at com.documentum.fc.client.content.impl.ContentManager.setStream(ContentManager.java:264)
at com.documentum.fc.client.DfSysObject.doSetContent(DfSysObject.java:1949)
at com.documentum.fc.client.DfSysObject.setContentEx2(DfSysObject.java:1931)
at com.documentum.fc.client.DfSysObject.setContentEx(DfSysObject.java:1925)
at com.documentum.fc.client.DfSysObject.setContent(DfSysObject.java:1920)
at com.documentum.fc.client.DfNote___PROXY.setContent(DfNote___PROXY.java)
at com.documentum.mstech.MSTView.getDocumentDataInBytes(MSTView.java:190)
I am using below code:-
/***************************************************************************************/
IDfSysObject annObject = (IDfSysObject)dfSession.newObject("dm_note");
annObject.setContentType("T_L");
annObject.setObjectName("Annotation");
ByteArrayOutputStream contentStream = new ByteArrayOutputStream();
InputStream inputStream= new FileInputStream("c://export_thick.t_l");
byte content[]= inputStream.toString().getBytes();
contentStream.write(content, 0, content.length);
annObject.setContent(contentStream);
IDfSysObject document = (IDfSysObject)dfSession.getObject(new DfId(objectId));
IDfId docChronId = document.getChronicleId();
annObject.addNote(docChronId, true);
annObject.save();
/******************************************************************************************/
Thanks and Regards,
Nitin Sengar