Hi All,
I have seen and successfully been able to use examples of getting files from docbase using UCF to a client machine, where DFS consumer service is not running (by creating an Applet in the client machine and passing jSession id from the applet to the DFS service). In that case the document was directly transferred to the user's machine using UCF for viewing.
Now we have a scenario where the user wants to import document from the user's machine through a web page to Documentum. The web application is running in a different server. I have found that all the APIs for document import using UCF assumes that the file is present in the DFS consumer machine (code below), which is not the case in our scenario. In our scenario, it is like the Webtop import, where user selects documents from the local machine and then it's imported. How can we achieve this using DFS and UCF content transfer?
// CREATE object service ServiceFactory serviceFactory = ServiceFactory.getInstance(); IObjectService service = (IObjectService) serviceFactory.getRemoteService( IObjectService.class, context, "core", dfsURL); // CREATE object and set content ObjectIdentity documentIdentity = new ObjectIdentity(docbase); DataObject docObject = new DataObject(documentIdentity,"dm_document"); docObject.getProperties().set("object_name", localFile.getName()); docObject.getContents().add(new FileContent(localFile.getAbsolutePath(),format)); // We cannot get absolute path here because the file is present in the user's machine and this code is running in the application server... //docObject.getContents().add(new BinaryContent("dummydata".getBytes(),format)); // ADD the folder ReferenceRelationship ObjectPath objectPath = new ObjectPath("/Temp"); ObjectIdentity<ObjectPath> sampleFolderIdentity = new ObjectIdentity<ObjectPath>( objectPath, docbase); ReferenceRelationship sampleFolderRelationship = new ReferenceRelationship(); sampleFolderRelationship.setName(Relationship.RELATIONSHIP_FOLDER); sampleFolderRelationship.setTarget(sampleFolderIdentity); sampleFolderRelationship.setTargetRole(Relationship.ROLE_PARENT); docObject.getRelationships().add(sampleFolderRelationship);
// CONFIGURE service options OperationOptions options = new OperationOptions(); options.getContentTransferProfile().setTransferMode(ContentTransferMode.UCF); |
|---|
Thanks a lot in advance for your time and help,
Raj Sen