Source for file ktws_eg_folder_listing.php

Documentation is available at ktws_eg_folder_listing.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. $listing $root->get_listing();
  54. if (PEAR::isError($listing))
  55. {
  56.     print $listing->getMessage();
  57.     exit;
  58. }
  59.  
  60. // lets display the items
  61.  
  62. foreach($listing as $folderitem)
  63. {
  64.     $title $folderitem->title;
  65.     $item_type $folderitem->item_type;
  66.     $mime_display $folderitem->mime_display;
  67.      
  68.     print "$title $item_type $mime_display\n";
  69. }
  70.  
  71. ?>

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