From ef792970bf9166c74b7e4e9eee35d0d8db850d2d Mon Sep 17 00:00:00 2001 From: Mark Holtzhausen Date: Thu, 2 Jul 2009 17:30:54 +0200 Subject: [PATCH] PT: 865156 - AtomPub - Added ResponseFeed Classes & updated default dms test services --- ktatompub/index.php | 1 + ktatompub/lib/ktAPP_ResponseFeed.inc.php | 1 - ktatompub/lib/ktApp.default_dms_services.inc.php | 27 ++++++++++++++++----------- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/ktatompub/index.php b/ktatompub/index.php index 78bfdad..94b3aef 100644 --- a/ktatompub/index.php +++ b/ktatompub/index.php @@ -72,6 +72,7 @@ include_once('lib/KTAPPHelper.inc.php'); //Containing helper bridge functio include_once('lib/KTAPDoc.inc.php'); //Containing the parent class allowing easy XML manipulation include_once('lib/KTAPPServiceDoc.inc.php'); //Containing the servicedoc class allowing easy ServiceDocument generation include_once('lib/KTAPPFeed.inc.php'); //Containing the response feed class allowing easy atom feed generation +include_once('lib/KTAPP_ResponseFeed.inc.php'); //Containing the response feed class allowing easy atom feed generation include_once('lib/ktAPP_Service.inc.php'); include_once('lib/ktApp.default_dms_services.inc.php'); include_once('auth.php'); //Containing the authentication protocols diff --git a/ktatompub/lib/ktAPP_ResponseFeed.inc.php b/ktatompub/lib/ktAPP_ResponseFeed.inc.php index d066e25..bee5aa7 100644 --- a/ktatompub/lib/ktAPP_ResponseFeed.inc.php +++ b/ktatompub/lib/ktAPP_ResponseFeed.inc.php @@ -7,6 +7,5 @@ class ktAPP_ResponseFeed_GET extends ktAPP_ResponseFeed{} class ktAPP_ResponseFeed_PUT extends ktAPP_ResponseFeed{} class ktAPP_ResponseFeed_POST extends ktAPP_ResponseFeed{} class ktAPP_ResponseFeed_DELETE extends ktAPP_ResponseFeed{ - } ?> \ No newline at end of file diff --git a/ktatompub/lib/ktApp.default_dms_services.inc.php b/ktatompub/lib/ktApp.default_dms_services.inc.php index d6ea227..917e3a4 100644 --- a/ktatompub/lib/ktApp.default_dms_services.inc.php +++ b/ktatompub/lib/ktApp.default_dms_services.inc.php @@ -1,7 +1,7 @@ responseFeed=$feed; } + + public function DELETE_action(){ + $feed = new ktAPP_ResponseFeed_DELETE(); + $this->responseFeed=$feed; + } } @@ -33,7 +38,7 @@ class ktAPP_Service_fullTree extends ktAPP_Service { /** * AtomPub Service: folder - * + * * Returns detail on a particular folder * */ @@ -41,16 +46,16 @@ class ktAPP_Service_folder extends ktAPP_Service { public function GET_action(){ //Create a new response feed $feed=new KTAPPFeed(KT_APP_BASE_URI); - + //Invoke the KtAPI to get detail about the referenced document $folderDetail=KTAPPHelper::getFolderDetail($this->params[0]?$this->params[0]:1); - + //Create the atom response feed $entry=$feed->newEntry(); foreach($folderDetail as $property=>$value){ $feed->newField($property,$value,$entry); } - + //Expose the responseFeed $this->responseFeed=$feed; } @@ -61,7 +66,7 @@ class ktAPP_Service_folder extends ktAPP_Service { /** * AtomPub Service: document - * + * * Returns detail on a particular document * */ @@ -69,10 +74,10 @@ class ktAPP_Service_document extends ktAPP_Service { public function GET_action(){ //Create a new response feed $feed=new KTAPPFeed(KT_APP_BASE_URI); - + //Invoke the KtAPI to get detail about the referenced document $docDetail=KTAPPHelper::getDocumentDetail($this->params[0]); - + //Create the atom response feed $entry=$feed->newEntry(); foreach($docDetail['results'] as $property=>$value){ @@ -80,7 +85,7 @@ class ktAPP_Service_document extends ktAPP_Service { } //Add a downloaduri field manually $feed->newField('downloaduri',urlencode(KT_APP_SYSTEM_URI.'/action.php?kt_path_info=ktcore.actions.document.view&fDocumentId='.$docDetail['results']['document_id']),$entry); - + //Expose the responseFeed $this->responseFeed=$feed; } -- libgit2 0.21.4