Commit 83562c6d6f74670374f500af810216f60ff6385a

Authored by Megan Watson
2 parents 6da00392 a620abd9

Merge branch 'edge' of git@github.com:ktgit/knowledgetree into edge

webservice/atompub/index.php
... ... @@ -72,6 +72,7 @@ include_once(KT_ATOM_LIB_FOLDER.'KT_atom_server.inc.php');
72 72 include_once('demodms/KT_atom_service_helper.inc.php'); //Containing helper bridge functions to KtAPI
73 73 include_once(KT_ATOM_LIB_FOLDER.'KT_atom_baseDoc.inc.php'); //Containing the parent class allowing easy XML manipulation
74 74 include_once(KT_ATOM_LIB_FOLDER.'KT_atom_serviceDoc.inc.php'); //Containing the servicedoc class allowing easy ServiceDocument generation
  75 +include_once(KT_ATOM_LIB_FOLDER.'KT_atom_response.inc.php'); //Containing the response feed class allowing easy atom feed generation
75 76 include_once(KT_ATOM_LIB_FOLDER.'KT_atom_responseFeed.inc.php'); //Containing the response feed class allowing easy atom feed generation
76 77 include_once(KT_ATOM_LIB_FOLDER.'KT_atom_service.inc.php');
77 78 include_once('demodms/KT_atom_server.default_dms_services.inc.php');
... ... @@ -108,6 +109,7 @@ $APP->registerService('DMS','fulltree','KT_atom_service_fulltree','Full Document
108 109 $APP->registerService('DMS','folder','KT_atom_service_folder','Folder Detail');
109 110 $APP->registerService('DMS','document','KT_atom_service_document','Document Detail');
110 111 $APP->registerService('DMS','logout','KT_atom_service_logout','Forceful Logout');
  112 +$APP->registerService('DMS','test','KT_atom_service_test','Test Service');
111 113  
112 114 //Execute the current url/header request
113 115 $APP->execute();
... ...
webservice/classes/atompub/KT_atom_response.inc.php 0 → 100644
  1 +<?php
  2 +class KT_atom_response extends KT_atom_baseDoc {
  3 +
  4 + protected $baseURI=NULL;
  5 + protected $feed=NULL;
  6 +
  7 + public function __construct($baseURI=NULL){
  8 + parent::__construct();
  9 + $this->baseURI = $baseURI;
  10 + $this->feed =&$this->DOM;
  11 + }
  12 +
  13 + public function &newEntry(){
  14 + $entry=$this->newElement('entry');
  15 + $this->feed->appendChild($entry);
  16 + return $entry;
  17 + }
  18 +
  19 + public function &newField($name=NULL,$value=NULL,&$attachToNode=NULL){
  20 + $field=$this->newElement($name,$value);
  21 + if(isset($attachToNode))$attachToNode->appendChild($field);
  22 + return $field;
  23 + }
  24 +
  25 + public function render(){
  26 + return $this->formatXmlString(trim($this->DOM->saveXML()));
  27 + }
  28 +
  29 +
  30 +}
  31 +
  32 +class KT_atom_Response_GET extends KT_atom_response{}
  33 +class KT_atom_Response_PUT extends KT_atom_response{}
  34 +class KT_atom_Response_POST extends KT_atom_response{}
  35 +class KT_atom_Response_DELETE extends KT_atom_response{}
  36 +
  37 +?>
0 38 \ No newline at end of file
... ...
webservice/classes/atompub/KT_atom_responseFeed.inc.php
... ... @@ -4,19 +4,20 @@ class KT_atom_responseFeed extends KT_atom_baseDoc {
4 4 protected $baseURI=NULL;
5 5 protected $feed=NULL;
6 6  
7   - public function __construct($baseURI=NULL,$title=NULL,$link=NULL,$updated=NULL,$author=NULL,$id=NULL, $workspace = null){
  7 + public function __construct($baseURI=NULL){
8 8 parent::__construct();
9 9 $this->baseURI = $baseURI;
10   - $this->constructHeader();
  10 + $this->constructFeedHeader();
11 11 }
12 12  
13   - protected function constructHeader(){
14   - $feed=$this->newElement('feed');
  13 + protected function constructFeedHeader(){
  14 + $feed = $this->newElement('feed');
15 15 $feed->appendChild($this->newAttr('xmlns','http://www.w3.org/2005/Atom'));
16   - $this->feed=&$feed;
17   - $this->DOM->appendChild($this->feed);
  16 + $this->feed = &$feed;
  17 + $this->DOM->appendChild($this->feed);
18 18 }
19 19  
  20 +
20 21 public function &newEntry(){
21 22 $entry=$this->newElement('entry');
22 23 $this->feed->appendChild($entry);
... ...