|  | 
 | ||||
|        | |||||
|  | ||||||
| Other Library Functions | ||||||
| function | dctm.reader | 
| Library: Documentum access (OMDOCUMENTUM) Import: omdocumentum.xmd | Return type: String source Returns: An OmniMark Source object which allows reading from dm_document object | 
export external string source function reader of value string document on value string session extra-options read-only stream options optional
Argument definitions
dctm.reader returns the content of a dm_document object in a Documentum Docbase. dctm.reader is a streaming function.
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
 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:
dctm.reader-options-format: Identifies the file format in which you want the content. The default is the format identified in the document's a_content_type attribute.
dctm.reader-options-page-num: Identifies the content page with which the content file is associated.
The default is zero (the first content page).
dctm.reader-options-page-modifier Identifies a rendition. This is a character string defined when the rendition was created. The default is an empty string.
dctm.reader-options-get-resource - Not used on Windows or Unix
For more information about these options, refer to the getcontent function in the Documentum Content Server API Reference Guide.
The following exceptions can occur when calling this function:
| Other Library Functions dctm.execute dctm.omdocumentum-version dctm.reader dctm.result dctm.set dctm.writer | 
Copyright © Stilo International plc, 1988-2008.