hi,
i am new to dfc. i want to view a document using dfc.
i am getting the r_object_id.
can somebody upload the code for viewing the document from document.
thanks
I will make an assumption that you have the PIA installed and ready to run. if not then I suggest that you install that first.
Once you have the PIA you can refererence virtuall everything that DFC has to offer and if you follow the basic patterns for connecting to a repository as detailed in the PIA documentation then once you have a session all you need to do is export the file either using an export operation or by coding up using the DFC as per the example in the PIA documentation.
Once you have the content file locally then you can use ShellExecute, System.Diagnostics.Process or one of the similar C#/Windows API calls to open it up in it's native application.
System.Diagnostics.Process p = new System.Diagnostics.Process(); p.StartInfo.FileName = "fred.doc"; p.Start();
yes i am thinking same. but i have r_object_id, how can i create IDfDocument from this object id.
void exportDoc( IDfClientX clientx, IDfDocument doc, String strDir ) throws DfException{IDfExportOperation opExport = clientx.getExportOperation();IDfExportNode node = (IDfExportNode)opExport.add( doc );if( node == null ) {}node.setFilePath( strDir );if( !opExport.execute() ) { }
}
IDfSysObject document = (IDfSysObject)mySession.getObject("object id in here");
Also check code search for more examples.
thanks it worked.
can i stream the content directly to the page without saving it to filesystem.
Hi,
Taking a leap here and assuming that as you are talking about a page you are producing an ASP.NET site? If so then there is nothing specific in Documentum to assist you. You will need to take a look at some ASP.NET resources for that one.
There is some support for PDF streaming in the 6.x product set that you may be able to leverage, but for other formats it's pretty much an all or nothing.
You might want to take a look at the Solution Gallery, this one looks good, for examples of viewer technologies that you can leverage.
Prashant,
You can use IDfSysObject.getContent() to get the content as ByteArrayInputStream.
Then you can play around with it as you wish.
There needs to be a correction in the previously posed code in case you are storing it as file:
void exportDoc( IDfClientX clientx, IDfDocument doc, String strDir ) throws DfException{IDfExportOperation opExport = clientx.getExportOperation();
opExport.setRecordInRegistry(IDfExportOperation.RECORD_AS_VIEWED_FILE_IN_REGISTRY); //Without this it is export not view(Documentum-wise)IDfExportNode node = (IDfExportNode)opExport.add( doc );if( node == null ) {}node.setFilePath( strDir );if( !opExport.execute() ) { }
I have documentum developer edition 6.6. I want to get document content (read content into stream) using DFC in c#. I have used following C#.net code
IDfId
but it throws following exception.
Exception: Unable to cast COM object of type 'System.__ComObject' to interface type 'DFCLib.IDfDocument'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{EFAC2D68-175B-11D2-9927-006097C27C31}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
I also tried following method(it runs successfully) but i don't know how to read content into stream or memory stream.