diff --git a/webservice/atompub/index.php b/webservice/atompub/index.php index 40b66b6..96d364b 100644 --- a/webservice/atompub/index.php +++ b/webservice/atompub/index.php @@ -72,6 +72,7 @@ include_once(KT_ATOM_LIB_FOLDER.'KT_atom_server.inc.php'); include_once('demodms/KT_atom_service_helper.inc.php'); //Containing helper bridge functions to KtAPI include_once(KT_ATOM_LIB_FOLDER.'KT_atom_baseDoc.inc.php'); //Containing the parent class allowing easy XML manipulation include_once(KT_ATOM_LIB_FOLDER.'KT_atom_serviceDoc.inc.php'); //Containing the servicedoc class allowing easy ServiceDocument generation +include_once(KT_ATOM_LIB_FOLDER.'KT_atom_response.inc.php'); //Containing the response feed class allowing easy atom feed generation include_once(KT_ATOM_LIB_FOLDER.'KT_atom_responseFeed.inc.php'); //Containing the response feed class allowing easy atom feed generation include_once(KT_ATOM_LIB_FOLDER.'KT_atom_service.inc.php'); 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 $APP->registerService('DMS','folder','KT_atom_service_folder','Folder Detail'); $APP->registerService('DMS','document','KT_atom_service_document','Document Detail'); $APP->registerService('DMS','logout','KT_atom_service_logout','Forceful Logout'); +$APP->registerService('DMS','test','KT_atom_service_test','Test Service'); //Execute the current url/header request $APP->execute(); diff --git a/webservice/classes/atompub/KT_atom_response.inc.php b/webservice/classes/atompub/KT_atom_response.inc.php new file mode 100644 index 0000000..42983d3 --- /dev/null +++ b/webservice/classes/atompub/KT_atom_response.inc.php @@ -0,0 +1,37 @@ +baseURI = $baseURI; + $this->feed =&$this->DOM; + } + + public function &newEntry(){ + $entry=$this->newElement('entry'); + $this->feed->appendChild($entry); + return $entry; + } + + public function &newField($name=NULL,$value=NULL,&$attachToNode=NULL){ + $field=$this->newElement($name,$value); + if(isset($attachToNode))$attachToNode->appendChild($field); + return $field; + } + + public function render(){ + return $this->formatXmlString(trim($this->DOM->saveXML())); + } + + +} + +class KT_atom_Response_GET extends KT_atom_response{} +class KT_atom_Response_PUT extends KT_atom_response{} +class KT_atom_Response_POST extends KT_atom_response{} +class KT_atom_Response_DELETE extends KT_atom_response{} + +?> \ No newline at end of file diff --git a/webservice/classes/atompub/KT_atom_responseFeed.inc.php b/webservice/classes/atompub/KT_atom_responseFeed.inc.php index 98ccb0d..9efafa0 100644 --- a/webservice/classes/atompub/KT_atom_responseFeed.inc.php +++ b/webservice/classes/atompub/KT_atom_responseFeed.inc.php @@ -4,19 +4,20 @@ class KT_atom_responseFeed extends KT_atom_baseDoc { protected $baseURI=NULL; protected $feed=NULL; - public function __construct($baseURI=NULL,$title=NULL,$link=NULL,$updated=NULL,$author=NULL,$id=NULL, $workspace = null){ + public function __construct($baseURI=NULL){ parent::__construct(); $this->baseURI = $baseURI; - $this->constructHeader(); + $this->constructFeedHeader(); } - protected function constructHeader(){ - $feed=$this->newElement('feed'); + protected function constructFeedHeader(){ + $feed = $this->newElement('feed'); $feed->appendChild($this->newAttr('xmlns','http://www.w3.org/2005/Atom')); - $this->feed=&$feed; - $this->DOM->appendChild($this->feed); + $this->feed = &$feed; + $this->DOM->appendChild($this->feed); } + public function &newEntry(){ $entry=$this->newElement('entry'); $this->feed->appendChild($entry);