Source for file ktws_eg_doc_info.php

Documentation is available at ktws_eg_doc_info.php

  1. <?
  2.  
  3. /**
  4.  *
  5.  * Demonstrates using an active session and getting document info and metadata.
  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. // lets ge the document based on id.
  47.  
  48. $document $ktapi->get_document_by_id(50);
  49. if (PEAR::isError($document))
  50. {
  51.     print $document->getMessage();
  52.     exit;
  53. }
  54.  
  55. // lets get the document metadata
  56.  
  57. $metadata $document->get_metadata();
  58. if (PEAR::isError($metadata))
  59. {
  60.     print $metadata->getMessage();
  61.     exit;
  62. }
  63. var_dump($metadata);
  64.  
  65. ?>

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