swirl
Guide to OmniMark 7   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
      Other Library Functions  
function  

dctm.reader

 
 

Library: Interfaces, Documentum interface (OMDOCUMENTUM)
Import: omdocumentum.xmd
Return type: Source
Returns: 

An OmniMark Source object which allows reading from dm_document object


Declaration

  export external source function reader
     of     value    stream document
     on    value    stream session
     extra-options  read-only stream options optional

Argument definitions

document
The id of the document to be read from
session
The id of the current session to use for reading.
options
A key-value shelf which provides additional parameterization for the read operation.


Purpose

dctm.reader returns the content of a dm_document object in a Documentum Docbase. dctm.reader is a streaming function.

Example

This example outputs the contents of all documents whose name is "my_asset.txt":

  import 'omdocumentum.xmd' prefixed by dctm.

  process
    local stream docbase  initial {"my_docbase"}
    local stream user     initial {"my_user_name"}
    local stream password initial {"my_password"}
    local stream session
    local stream asset-name   initial {"my_asset.txt"}
    local stream asset-id     variable
    local stream collection-id

    ; Connect to Docbase
    set session to dctm.result of "connect,%g(docbase),%g(user),%g(password)"
    assert session != ""
      message "Error connecting to Docbase %g(docbase) as %g(user):"
           || dctm.result of "getmessage,current"

    ; Find all of the assets called asset-name
    dctm.execute "execquery,%g(session),F,"
              || "select object_name, r_object_id, i_cabinet_id"
              || " from dm_document"
              || " where object_name = '" || asset-name || "'"
    set collection-id to dctm.result of "getlastcoll,%g(session)"
    repeat
      do
        dctm.execute "next,%g(session),%g(collection-id)"
        catch #external-exception
          exit ; no more data
      done
      set new asset-id to dctm.result of "get,%g(session),%g(collection-id),r_object_id"
    again
    output "d" % number of asset-id
        || " %g(asset-name) assets found.%n"

    ; Read the assets back
    repeat over asset-id
      output "===============================%n"
      output dctm.reader of asset-id on session
    again

Setting reader options

The options parameter is a keyed shelf. The key specifies the name of the option to be set. The following constants define the options supported by dctm.writer:

For more information about these options, refer to the getcontent function in the Documentum Content Server API Reference Guide.

Exceptions

The following exceptions can occur when calling this function:

        Other Library Functions
   dcmt.writer
   dctm.execute
   dctm.omdocumentum-version
   dctm.reader
   dctm.result
   dctm.set
 
 

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ LEGACYLIBRARIES ] [ ERRORS ]

OmniMark 7.1.2 Documentation Generated: June 28, 2005 at 5:45:08 pm
If you have any comments about this section of the documentation, send email to [email protected]

Copyright © Stilo Corporation, 1988-2005.