Source for file ktws_eg_checkin.php

Documentation is available at ktws_eg_checkin.php

  1. <?
  2.  
  3. /**
  4.  *
  5.  * Demonstrates document checkout and checkin
  6.  * @license http://www.knowledgetree.com/KPL KnowledgeTree Public License Version 1.1
  7.  * @package KTWSAPI
  8.  */
  9.  
  10. /*
  11.  *
  12.  * The contents of this file are subject to the KnowledgeTree Public
  13.  * License Version 1.1 ("License"); You may not use this file except in
  14.  * compliance with the License. You may obtain a copy of the License at
  15.  * http://www.knowledgetree.com/KPL
  16.  * 
  17.  * Software distributed under the License is distributed on an "AS IS"
  18.  * basis,
  19.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  20.  * for the specific language governing rights and limitations under the
  21.  * License.
  22.  * 
  23.  * The Original Code is: KnowledgeTree Open Source
  24.  * 
  25.  * The Initial Developer of the Original Code is The Jam Warehouse Software
  26.  * (Pty) Ltd, trading as KnowledgeTree.
  27.  * Portions created by The Jam Warehouse Software (Pty) Ltd are Copyright
  28.  * (C) 2007 The Jam Warehouse Software (Pty) Ltd;
  29.  * All Rights Reserved.
  30.  *
  31.  */
  32.  
  33. require_once('../ktwsapi.inc.php');
  34.  
  35. $ktapi new KTWSAPI(KTWebService_WSDL);
  36.  
  37. // change session to something that is in table 'active_sessions'
  38.  
  39. $response $ktapi->active_session('sj5827sohdoj6h3nvifrcsa1f2');
  40. if (PEAR::isError($response))
  41. {
  42.     print $response->getMessage();
  43.     exit;
  44. }
  45.  
  46. $root $ktapi->get_root_folder();
  47. if (PEAR::isError($root))
  48. {
  49.     print $root->getMessage();
  50.     exit;
  51. }
  52.  
  53. $document $root->add_document('c:/temp/test.doc');
  54. if (PEAR::isError($document))
  55. {
  56.     print $document->getMessage();
  57.     exit;
  58. }
  59.  
  60. $result $document->checkout('going to update','c:/');
  61. if (PEAR::isError($result))
  62. {
  63.     print $result->getMessage();
  64.     exit;
  65. }
  66.  
  67. $result $document->checkin('c:/test.doc','have updated',false);
  68. if (PEAR::isError($result))
  69. {
  70.     print $result->getMessage();
  71.     exit;
  72. }
  73.  
  74. $ktapi->logout();
  75.  
  76. ?>

Documentation generated on Sun, 22 Apr 2007 02:31:00 +0200 by phpDocumentor 1.3.2