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

dctm.writer

 
 

Library: Documentum access (OMDOCUMENTUM)
Import: omdocumentum.xmd
Return type: String sink

Returns: An OmniMark output object which allows writing to a dm_document object


Declaration

export external string sink function writer
  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 written to
session
The id of the current docbase session.
options
A key-value shelf which provides additional parameterization for the write operation.


Purpose

The purpose of the writer function is to allow writing of data to a dm_document object on the Documentum Server in a streaming fashion.

The dm_document object must be created before it can be written.

Example

This example creates an asset called "my-asset.txt" and writes "This is the content of my asset." into it:

  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
    local stream writer-options variable
  
    ; 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"
  
    ; Create asset
    set asset-id to dctm.result of "create,%g(session),dm_document"
    assert asset-id != ""
      message "Error creating asset:"
           || dctm.result of "getmessage,current"
  
    ; Name the asset and link it to a folder
    dctm.set "set,%g(session),%g(asset-id),object_name" to asset-name
  
    ; Write the data to the asset
    set new writer-options{dctm.writer-options-format} to "text"
    set dctm.writer of asset-id
      on session
      extra-options writer-options
      to "This is the text for my new asset.%n"
  
    ; Commit the asset
    dctm.execute "save,%g(session),%g(asset-id)"

Setting writer 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 setcontent function in the Documentum Content Server API Reference Guide.

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

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

OmniMark 8.2.0 Documentation Generated: March 13, 2008 at 3:27:39 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2008.