Home | Oracle ECM Home Page  | Oracle ECM Documentation  | Oracle ECM Downloads  | Oracle ECM Forums  | Yahoo Intradoc Users Group Feed your aggregator (RSS 2.0)  
  Oracle Fusion ECM Blog. Are you "kuh n-tent" with your "kon-tent"?
 
 
# Monday, August 18, 2008

Sometimes you have a Content ID and need to find the path to the Vault file.  If you are in a JSP (Java Server Page) or in a Java Class in your backend component you can use this method.  10gR3 introduces the FileStoreProvider component that is not necessarily compatible with this method.  I'll try to conjure up a FileStoreProvider compatible version in the future, someday.  If you already have one and want to share please drop me a note!  This is not without issue I suppose but it should get you started:

private String findLatestVaultPath(String strContentID) throws DataException
{
    // Setup a value to return
    String strPath = null;

    // Setup a binder to perform our lookup with
    DataBinder dbDocInfo = new DataBinder();
    dbDocInfo.putLocal("dDocName", strContentID);

    // Grab latest id by name
    ResultSet rsLatestByName = m_workspace.createResultSet("QlatestIDByName", dbDocInfo);

    // If we didn't get any results we are returning null
    if(rsLatestByName != null && rsLatestByName.isRowPresent())
    {
        // Get out the id
        String strID = rsLatestByName.getStringValue(ResultSetUtils.getIndexMustExist(rsLatestByName, "dID"));

        // If we don't have an id we're returning null
        if(strID != null && strID.length() != 0)
        {
            // Put the id in our binder
            dbDocInfo.putLocal("dID", strID);

            // Look up the DOC_INFO
            ResultSet rsDocInfo = m_workspace.createResultSet("QdocInfo", dbDocInfo);
            DataResultSet drsDocInfo = new DataResultSet();
            drsDocInfo.copy(rsDocInfo);
            dbDocInfo.addResultSet("DOC_INFO", drsDocInfo);

            // Finally, compute the path
            strPath = DirectoryLocator.computeVaultPath(DirectoryLocator.computeVaultFileName(dbDocInfo), dbDocInfo);
        }
    }
    return strPath;
}
Monday, August 18, 2008 8:02:36 AM (Central Daylight Time, UTC-05:00)  #    Comments [0]   Oracle UCM  | 
Comments are closed.
Copyright © 2008 Jason Stortz. All rights reserved.