|
|||||
|
||||||
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 |
export external string sink function writer of value stream document on value stream session extra-options read-only stream options optional
Argument definitions
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.
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)"
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.writer-options-format
- Specifies the file format of the content.
dctm.writer-options-page-num
- Specifies the number of the page to which the data will be written. The default is 0.
dctm.writer-options-get-resource
- Not used on Windows or Unix.
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 |
Copyright © Stilo International plc, 1988-2008.