Commit ef792970bf9166c74b7e4e9eee35d0d8db850d2d
1 parent
8090e8f5
PT: 865156 - AtomPub - Added ResponseFeed Classes & updated default dms test services
Showing
3 changed files
with
17 additions
and
12 deletions
ktatompub/index.php
| @@ -72,6 +72,7 @@ include_once('lib/KTAPPHelper.inc.php'); //Containing helper bridge functio | @@ -72,6 +72,7 @@ include_once('lib/KTAPPHelper.inc.php'); //Containing helper bridge functio | ||
| 72 | include_once('lib/KTAPDoc.inc.php'); //Containing the parent class allowing easy XML manipulation | 72 | include_once('lib/KTAPDoc.inc.php'); //Containing the parent class allowing easy XML manipulation |
| 73 | include_once('lib/KTAPPServiceDoc.inc.php'); //Containing the servicedoc class allowing easy ServiceDocument generation | 73 | include_once('lib/KTAPPServiceDoc.inc.php'); //Containing the servicedoc class allowing easy ServiceDocument generation |
| 74 | include_once('lib/KTAPPFeed.inc.php'); //Containing the response feed class allowing easy atom feed generation | 74 | include_once('lib/KTAPPFeed.inc.php'); //Containing the response feed class allowing easy atom feed generation |
| 75 | +include_once('lib/KTAPP_ResponseFeed.inc.php'); //Containing the response feed class allowing easy atom feed generation | ||
| 75 | include_once('lib/ktAPP_Service.inc.php'); | 76 | include_once('lib/ktAPP_Service.inc.php'); |
| 76 | include_once('lib/ktApp.default_dms_services.inc.php'); | 77 | include_once('lib/ktApp.default_dms_services.inc.php'); |
| 77 | include_once('auth.php'); //Containing the authentication protocols | 78 | include_once('auth.php'); //Containing the authentication protocols |
ktatompub/lib/ktAPP_ResponseFeed.inc.php
| @@ -7,6 +7,5 @@ class ktAPP_ResponseFeed_GET extends ktAPP_ResponseFeed{} | @@ -7,6 +7,5 @@ class ktAPP_ResponseFeed_GET extends ktAPP_ResponseFeed{} | ||
| 7 | class ktAPP_ResponseFeed_PUT extends ktAPP_ResponseFeed{} | 7 | class ktAPP_ResponseFeed_PUT extends ktAPP_ResponseFeed{} |
| 8 | class ktAPP_ResponseFeed_POST extends ktAPP_ResponseFeed{} | 8 | class ktAPP_ResponseFeed_POST extends ktAPP_ResponseFeed{} |
| 9 | class ktAPP_ResponseFeed_DELETE extends ktAPP_ResponseFeed{ | 9 | class ktAPP_ResponseFeed_DELETE extends ktAPP_ResponseFeed{ |
| 10 | - | ||
| 11 | } | 10 | } |
| 12 | ?> | 11 | ?> |
| 13 | \ No newline at end of file | 12 | \ No newline at end of file |
ktatompub/lib/ktApp.default_dms_services.inc.php
| 1 | <?php | 1 | <?php |
| 2 | /** | 2 | /** |
| 3 | * AtomPub Service: fulltree | 3 | * AtomPub Service: fulltree |
| 4 | - * | 4 | + * |
| 5 | * Returns a full tree listing starting at the root document | 5 | * Returns a full tree listing starting at the root document |
| 6 | * Tree structure obtained by referencing parent id | 6 | * Tree structure obtained by referencing parent id |
| 7 | * | 7 | * |
| @@ -10,10 +10,10 @@ class ktAPP_Service_fullTree extends ktAPP_Service { | @@ -10,10 +10,10 @@ class ktAPP_Service_fullTree extends ktAPP_Service { | ||
| 10 | public function GET_action(){ | 10 | public function GET_action(){ |
| 11 | //Create a new response feed | 11 | //Create a new response feed |
| 12 | $feed=new KTAPPFeed(KT_APP_BASE_URI); | 12 | $feed=new KTAPPFeed(KT_APP_BASE_URI); |
| 13 | - | 13 | + |
| 14 | //Invoke the KtAPI to get detail about the referenced document | 14 | //Invoke the KtAPI to get detail about the referenced document |
| 15 | $tree=KTAPPHelper::getFullTree(); | 15 | $tree=KTAPPHelper::getFullTree(); |
| 16 | - | 16 | + |
| 17 | //Create the atom response feed | 17 | //Create the atom response feed |
| 18 | foreach($tree as $item){ | 18 | foreach($tree as $item){ |
| 19 | $id=$item['id']; | 19 | $id=$item['id']; |
| @@ -26,6 +26,11 @@ class ktAPP_Service_fullTree extends ktAPP_Service { | @@ -26,6 +26,11 @@ class ktAPP_Service_fullTree extends ktAPP_Service { | ||
| 26 | //Expose the responseFeed | 26 | //Expose the responseFeed |
| 27 | $this->responseFeed=$feed; | 27 | $this->responseFeed=$feed; |
| 28 | } | 28 | } |
| 29 | + | ||
| 30 | + public function DELETE_action(){ | ||
| 31 | + $feed = new ktAPP_ResponseFeed_DELETE(); | ||
| 32 | + $this->responseFeed=$feed; | ||
| 33 | + } | ||
| 29 | } | 34 | } |
| 30 | 35 | ||
| 31 | 36 | ||
| @@ -33,7 +38,7 @@ class ktAPP_Service_fullTree extends ktAPP_Service { | @@ -33,7 +38,7 @@ class ktAPP_Service_fullTree extends ktAPP_Service { | ||
| 33 | 38 | ||
| 34 | /** | 39 | /** |
| 35 | * AtomPub Service: folder | 40 | * AtomPub Service: folder |
| 36 | - * | 41 | + * |
| 37 | * Returns detail on a particular folder | 42 | * Returns detail on a particular folder |
| 38 | * | 43 | * |
| 39 | */ | 44 | */ |
| @@ -41,16 +46,16 @@ class ktAPP_Service_folder extends ktAPP_Service { | @@ -41,16 +46,16 @@ class ktAPP_Service_folder extends ktAPP_Service { | ||
| 41 | public function GET_action(){ | 46 | public function GET_action(){ |
| 42 | //Create a new response feed | 47 | //Create a new response feed |
| 43 | $feed=new KTAPPFeed(KT_APP_BASE_URI); | 48 | $feed=new KTAPPFeed(KT_APP_BASE_URI); |
| 44 | - | 49 | + |
| 45 | //Invoke the KtAPI to get detail about the referenced document | 50 | //Invoke the KtAPI to get detail about the referenced document |
| 46 | $folderDetail=KTAPPHelper::getFolderDetail($this->params[0]?$this->params[0]:1); | 51 | $folderDetail=KTAPPHelper::getFolderDetail($this->params[0]?$this->params[0]:1); |
| 47 | - | 52 | + |
| 48 | //Create the atom response feed | 53 | //Create the atom response feed |
| 49 | $entry=$feed->newEntry(); | 54 | $entry=$feed->newEntry(); |
| 50 | foreach($folderDetail as $property=>$value){ | 55 | foreach($folderDetail as $property=>$value){ |
| 51 | $feed->newField($property,$value,$entry); | 56 | $feed->newField($property,$value,$entry); |
| 52 | } | 57 | } |
| 53 | - | 58 | + |
| 54 | //Expose the responseFeed | 59 | //Expose the responseFeed |
| 55 | $this->responseFeed=$feed; | 60 | $this->responseFeed=$feed; |
| 56 | } | 61 | } |
| @@ -61,7 +66,7 @@ class ktAPP_Service_folder extends ktAPP_Service { | @@ -61,7 +66,7 @@ class ktAPP_Service_folder extends ktAPP_Service { | ||
| 61 | 66 | ||
| 62 | /** | 67 | /** |
| 63 | * AtomPub Service: document | 68 | * AtomPub Service: document |
| 64 | - * | 69 | + * |
| 65 | * Returns detail on a particular document | 70 | * Returns detail on a particular document |
| 66 | * | 71 | * |
| 67 | */ | 72 | */ |
| @@ -69,10 +74,10 @@ class ktAPP_Service_document extends ktAPP_Service { | @@ -69,10 +74,10 @@ class ktAPP_Service_document extends ktAPP_Service { | ||
| 69 | public function GET_action(){ | 74 | public function GET_action(){ |
| 70 | //Create a new response feed | 75 | //Create a new response feed |
| 71 | $feed=new KTAPPFeed(KT_APP_BASE_URI); | 76 | $feed=new KTAPPFeed(KT_APP_BASE_URI); |
| 72 | - | 77 | + |
| 73 | //Invoke the KtAPI to get detail about the referenced document | 78 | //Invoke the KtAPI to get detail about the referenced document |
| 74 | $docDetail=KTAPPHelper::getDocumentDetail($this->params[0]); | 79 | $docDetail=KTAPPHelper::getDocumentDetail($this->params[0]); |
| 75 | - | 80 | + |
| 76 | //Create the atom response feed | 81 | //Create the atom response feed |
| 77 | $entry=$feed->newEntry(); | 82 | $entry=$feed->newEntry(); |
| 78 | foreach($docDetail['results'] as $property=>$value){ | 83 | foreach($docDetail['results'] as $property=>$value){ |
| @@ -80,7 +85,7 @@ class ktAPP_Service_document extends ktAPP_Service { | @@ -80,7 +85,7 @@ class ktAPP_Service_document extends ktAPP_Service { | ||
| 80 | } | 85 | } |
| 81 | //Add a downloaduri field manually | 86 | //Add a downloaduri field manually |
| 82 | $feed->newField('downloaduri',urlencode(KT_APP_SYSTEM_URI.'/action.php?kt_path_info=ktcore.actions.document.view&fDocumentId='.$docDetail['results']['document_id']),$entry); | 87 | $feed->newField('downloaduri',urlencode(KT_APP_SYSTEM_URI.'/action.php?kt_path_info=ktcore.actions.document.view&fDocumentId='.$docDetail['results']['document_id']),$entry); |
| 83 | - | 88 | + |
| 84 | //Expose the responseFeed | 89 | //Expose the responseFeed |
| 85 | $this->responseFeed=$feed; | 90 | $this->responseFeed=$feed; |
| 86 | } | 91 | } |