12 Replies Latest reply on Dec 20, 2017 4:13 PM by Fabian Scherpenzeel-Oracle

    How to get the correct file path on file system

    Volker Heiselmayer

      Hi!

       

      I'd like to get a document file on the file system for a custom download service.

      I followed the instructions on

      Core Content Only Blog - Redstone Content Solutions

      which is referenced in

      Re: How to get the file path or id after check in it on UCM ?

       

      But I always get a wrong path:

       

      Rendition "primaryFile":

      Result:

      /u01/app/oracle/product/12.2.1/user_projects/domains/WCCdomain/ucm/cs/vault/document/149.pdf

      Real file:

      /u01/app/oracle/product/12.2.1/user_projects/domains/WCCdomain/ucm/cs/vault/document/c2jn/mdaw/149.pdf

       

      Rendition "web":

      Result

      /u01/app/oracle/product/12.2.1/user_projects/domains/WCCdomain/ucm/cs/weblayout/groups/archsas/documents/document/wccqualfe01sbg000157

      Real file:

      /u01/app/oracle/product/12.2.1/user_projects/domains/WCCdomain/ucm/cs/weblayout/groups/archsas/documents/document/c2jn/mdaw/~edisp/wccqualfe01sbg000157.pdf

       

      Code:

       

      DataBinder binder = new DataBinder();

      binder.putLocal("dID","157");

      binder.putLocal("dDocName","WCCQUALFE01SBG000157");

      binder.putLocal("dDocType","Document");

      binder.putLocal("dSecurityGroup","ArchSAS");

      binder.putLocal("dDocAccount","");

      binder.putLocal("dExtension","pdf");

      binder.putLocal("RenditionId","primaryFile");

      binder.putLocal("RenditionId.path","primaryFile");

       

      FileStoreProvider fileStoreProvider = DirectoryLocator.m_fileStore;

      IdcFileDescriptor idcFileDescriptor = null;

      try {

          idcFileDescriptor = fileStoreProvider.createDescriptor(binder, null, m_service);

          fileStoreProvider.forceToFilesystemPath(idcFileDescriptor, null, m_service);

          String filePath = fileStoreProvider.getFilesystemPath(idcFileDescriptor, m_service);

         

          log.WriteDebug("path: "+filePath);

      }

      catch (final Exception e) {

          log.WriteDebug("path error");

      }

       

      The document information comes from the Database, the document itself has just one revision.

      My Java class extends the "ServiceHandler".

       

      Any ideas what could be wrong?

       

      Thanks!

       

      BR,

          Volker