update api usage
Posted: Fri Dec 04, 2015 1:14 am
I am new to LogicalDOC.
I am trying to follow the UPDATE function in the DocumentService API using the PHP template.
I don't understand how you are updating a specific document. Isn't the UPDATE function supposed to be a stand alone process. If you are using the 'sid' number, how does the function know which document to update. In the example, there is no 'docid' found.
/*****************
* UPDATE
* ***************/
print_r ( "UPDATE\r\n" );
// Maybe we want to change some metadata informations
$udoc ['title'] = 'PHP Changed Title';
$udoc ['source'] = 'PHP-SOAP';
$udoc ['sourceAuthor'] = 'myself';
$udoc ['sourceDate'] = '2009-06-10';
$udoc ['sourceType'] = 'sourceType';
$udoc ['coverage'] = 'coverage';
$udoc ['language'] = 'en';
$udoc ['tags'] = array ('PHP', 'SOAP', 'webservice' );
$udoc ['sourceId'] = 'sourceId';
$udoc ['object'] = 'object';
$udoc ['recipient'] = 'recipient';
$udoc ['templateName'] = '';
$udoc ['templateFields'] = null;
$cdp = array ('sid' => $sid, 'document' => $udoc ); <---- you are only using the 'sid', which is session id. How do you know what document is being updated?
$result = $documentClient->update ( $cdp );
print_r ( $result );
Maybe I am not understanding how the update works; do you have to read the document first, or, does this only work on a newly created document? The example shows how to create first, then flows down.
Thanks
I am trying to follow the UPDATE function in the DocumentService API using the PHP template.
I don't understand how you are updating a specific document. Isn't the UPDATE function supposed to be a stand alone process. If you are using the 'sid' number, how does the function know which document to update. In the example, there is no 'docid' found.
/*****************
* UPDATE
* ***************/
print_r ( "UPDATE\r\n" );
// Maybe we want to change some metadata informations
$udoc ['title'] = 'PHP Changed Title';
$udoc ['source'] = 'PHP-SOAP';
$udoc ['sourceAuthor'] = 'myself';
$udoc ['sourceDate'] = '2009-06-10';
$udoc ['sourceType'] = 'sourceType';
$udoc ['coverage'] = 'coverage';
$udoc ['language'] = 'en';
$udoc ['tags'] = array ('PHP', 'SOAP', 'webservice' );
$udoc ['sourceId'] = 'sourceId';
$udoc ['object'] = 'object';
$udoc ['recipient'] = 'recipient';
$udoc ['templateName'] = '';
$udoc ['templateFields'] = null;
$cdp = array ('sid' => $sid, 'document' => $udoc ); <---- you are only using the 'sid', which is session id. How do you know what document is being updated?
$result = $documentClient->update ( $cdp );
print_r ( $result );
Maybe I am not understanding how the update works; do you have to read the document first, or, does this only work on a newly created document? The example shows how to create first, then flows down.
Thanks