Web service document info
From KnowledgeTree Document Management Made Simple
Contents |
looking at a specific document in the respository
A client may need to get information about a specific document in the repository. This may be done using four helper functions:
get_document_detail_by_title(session : string, folder : integer, title : string, detail : string) : kt_document_detail get_document_detail_by_filename(session : string, folder : integer, filename : string, detail : string) : kt_document_detail get_document_detail_by_name(session : string, folder : integer, name : string, what : string, detail : string) : kt_document_detail get_document_detail(session : string, document : integer, detail : string) : kt_document_detail
All functions take a session reference as a parameter. This is obtained by the login method.
The get_document_detail_by_xxx methods take a folder id as a parameter as a starting point so that the document has a relative starting position. This may be set to 1, the root folder id, so that a full path may be used.
The get_document_detail_by_name method has a what parameter and may have values of 'F' for filename or 'T' for title. get_document_detail_by_title and get_document_detail_by_filename map onto this method by passing the appropriate what value.
All functions take detail parameter that indicate how much information may be returned in the kt_document_detail structure. This string may be composed of the values:
- 'M' to include metadata
- 'L' to include links
- 'T' to include workflow transitions
- 'V' to include version history
- 'H' to include transaction history
By leaving the detail parameter blank, only the core document fields will be returned.
Sample psuedo code using get_document_detail
response = webservice.get_document_detail('3a598320171890920a6b13f7fcc69dce', 1, 'MLTVH')
if response.status_code != 0
raise 'Could not get document detail for document. Reason: ' + response.message
end
print 'Document Title: ' + response.title
print 'Document Id: ' + response.document_id
Sample psuedo code using get_document_detail_by_filename
response = webservice.get_document_detail_by_filename('3a598320171890920a6b13f7fcc69dce', 1, '/invoice/inv-2008-01.xls', '')
if response.status_code != 0
raise 'Could not get document detail for document. Reason: ' + response.message
end
print 'Document Title: ' + response.title
print 'Document Id: ' + response.document_id
Note that all information is applicable to the last checked-in version of the document.
obtaining a list of links from a document
get_document_links(session : string, document_id : integer) : kt_linked_document_response
obtaining document metadata
get_document_metadata(session : string, document_id : integer) : kt_metadata_response
obtaining document history
get_document_transaction_history (session : string, document_id : integer) : kt_document_transaction_history_response get_document_version_history (session : string, document_id : integer) : kt_document_version_history_response
obtaining workflow information
get_document_workflow_state (session : string, document_id : integer) : kt_response get_document_workflow_transitions (session : string, document_id : integer) : kt_workflow_transitions_response
This is described in more detail in the workflow actions section.
del.icio.us
reddit



