Monday, October 29, 2012

Digging into the Back of the Closet… How Can I Retrieve Content That’s Not the Latest Revision?

This question periodically comes up in forum posts.  The poster is usually looking to search through ALL revisions of content.

Content Server doesn’t work that way.  When using GET_SEARCH_RESULTS, only the latest released content is searched and returned.

If the need is to only search metadata about an older item, and not the full text of the content, a pretty nice workaround can be used. 

Content Server operates under the covers with some type of SQL query, and a piece of logic called a “data source”.  The concept can be leveraged for this scenario by using an out of the box Content Server service called “GET_DATARESULTSET”.

A basic knowledge of the database tables is necessary, and a working knowledge of the available data sources is required.

The documentation describes the service as below.


This service executes a Select query against the database. The query is built from the dataSource parameter. The service returns the following information:
  • The resultset containing the results of the query.
  • An indication if the results were truncated. If the dataSource was defined so it cannot exceed the maximum number of rows and if the query returns more than the maximum allowed, the copyAborted key is set to 1 (true). This indicates that the returned resultset only contains a subset of the query.
Any query that tries to select against certain core Content Server tables have a security clause applied. In particular, Documents, Revisions, and Users tables have extra security clauses applied.

Location: IdcHomeDir/resources/core/templates/std_services.htm

Additional Required Service Parameters

  • dataSource: A Select query with a potential WHERE clause and ORDER BY clause that is provided by the caller. The dataSource is a Content Server resource, defined in the DataSources table (see the resource.htm file for the standard list of dataSources.)
Optional Service Parameters

  • whereClause: The WHERE clause to the Select query.
  • orderClause: If set to true, orders the query by clause.
  • resultName: specifies the name to use for the resultset of the query.

As a very basic example, the following shows how to retrieve content that is NOT the latest revision of a given content item from a URL (replace <the content id> with a valid content id):

IdcService=GET_DATARESULTSET&dataSource=Documents&whereClause=dRevRank>0 and Revisions.dDocName='<the content id>'&resultName=MyOldResults&IsSoap=1

Adding “IsSoap” to the URL forces the return of the response in a SOAP format, because the service does not have a template page associated with it.  (Otherwise an error is thrown.)  If you look in the result set “MyOldResults”, the information about the old revisions is shown.  It’s now a simple matter to construct a GET_FILE service call to retrieve the old item.

RIDC would look something like this:

binder.putLocal("whereClause","dRevRank>0 and Revisions.dDocName='<the content id>'");
ServiceResponse response = client.sendRequest(userContext, binder);

The caveats are:
  • The number of results returned is limited to the system’s MaxResults setting.
  • The results returned are restricted to the user’s security privilege.  This is a GOOD caveat, as this isn’t a back door to retrieve content.

Monday, October 15, 2012

Tips for OFR Configuration

         Checklist for OFR not picking up Batches
  1. Check the Import Directoryof ODC (Oracle Document Capture)while Configuring File Cabinets inside Commit Driver Configuration that ODC  Import folder path is same as OFR Import Directory
  2. ODC Import Directory in File Cabinet- 
  3. Ensure that Batch Root, Image Root and Export folder is set while configuring OFR
  4. Ensure that wait time is set
  5. Ensure that Import tab is enabled and that "Use Project File" (.sdp) has the correct path set inside OFR Import tab

  6. Ensure that Import Button is Enabled in Workflow tab

  7. Ensure that the .txt file extension is matched with the Import Mask set in the IPM Server

    • Login to IPM Server 
    • Expand Manage Inputs 
    • Select Correct Input (E.g., Invoices) 
    • Navigate to Basic Information link, ensure that correct *.txt file ix uploaded to IPM Server 
    • Select Next to complete settings 
    • Ensure that Input mask and delimiter is set 
    • Ensure that the sample data is correct according to the data set in sample. txt file
  8. Ensure that .XML file Extension is same as in .ini file


Checklist for OFR Verifier not picking up Batches

  1. Open the OFR Verifier Application
  2. Select Option --> Settings

  3. Ensure the Project File (.sdp) path, Batch Root path, and Image Root path is set correctly - These settings should be the same as the settings in the OFR Runtime service