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 | 72 | include_once('lib/KTAPDoc.inc.php'); //Containing the parent class allowing easy XML manipulation |
| 73 | 73 | include_once('lib/KTAPPServiceDoc.inc.php'); //Containing the servicedoc class allowing easy ServiceDocument generation |
| 74 | 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 | 76 | include_once('lib/ktAPP_Service.inc.php'); |
| 76 | 77 | include_once('lib/ktApp.default_dms_services.inc.php'); |
| 77 | 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 | 7 | class ktAPP_ResponseFeed_PUT extends ktAPP_ResponseFeed{} |
| 8 | 8 | class ktAPP_ResponseFeed_POST extends ktAPP_ResponseFeed{} |
| 9 | 9 | class ktAPP_ResponseFeed_DELETE extends ktAPP_ResponseFeed{ |
| 10 | - | |
| 11 | 10 | } |
| 12 | 11 | ?> |
| 13 | 12 | \ No newline at end of file | ... | ... |
ktatompub/lib/ktApp.default_dms_services.inc.php
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | 3 | * AtomPub Service: fulltree |
| 4 | - * | |
| 4 | + * | |
| 5 | 5 | * Returns a full tree listing starting at the root document |
| 6 | 6 | * Tree structure obtained by referencing parent id |
| 7 | 7 | * |
| ... | ... | @@ -10,10 +10,10 @@ class ktAPP_Service_fullTree extends ktAPP_Service { |
| 10 | 10 | public function GET_action(){ |
| 11 | 11 | //Create a new response feed |
| 12 | 12 | $feed=new KTAPPFeed(KT_APP_BASE_URI); |
| 13 | - | |
| 13 | + | |
| 14 | 14 | //Invoke the KtAPI to get detail about the referenced document |
| 15 | 15 | $tree=KTAPPHelper::getFullTree(); |
| 16 | - | |
| 16 | + | |
| 17 | 17 | //Create the atom response feed |
| 18 | 18 | foreach($tree as $item){ |
| 19 | 19 | $id=$item['id']; |
| ... | ... | @@ -26,6 +26,11 @@ class ktAPP_Service_fullTree extends ktAPP_Service { |
| 26 | 26 | //Expose the responseFeed |
| 27 | 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 | 38 | |
| 34 | 39 | /** |
| 35 | 40 | * AtomPub Service: folder |
| 36 | - * | |
| 41 | + * | |
| 37 | 42 | * Returns detail on a particular folder |
| 38 | 43 | * |
| 39 | 44 | */ |
| ... | ... | @@ -41,16 +46,16 @@ class ktAPP_Service_folder extends ktAPP_Service { |
| 41 | 46 | public function GET_action(){ |
| 42 | 47 | //Create a new response feed |
| 43 | 48 | $feed=new KTAPPFeed(KT_APP_BASE_URI); |
| 44 | - | |
| 49 | + | |
| 45 | 50 | //Invoke the KtAPI to get detail about the referenced document |
| 46 | 51 | $folderDetail=KTAPPHelper::getFolderDetail($this->params[0]?$this->params[0]:1); |
| 47 | - | |
| 52 | + | |
| 48 | 53 | //Create the atom response feed |
| 49 | 54 | $entry=$feed->newEntry(); |
| 50 | 55 | foreach($folderDetail as $property=>$value){ |
| 51 | 56 | $feed->newField($property,$value,$entry); |
| 52 | 57 | } |
| 53 | - | |
| 58 | + | |
| 54 | 59 | //Expose the responseFeed |
| 55 | 60 | $this->responseFeed=$feed; |
| 56 | 61 | } |
| ... | ... | @@ -61,7 +66,7 @@ class ktAPP_Service_folder extends ktAPP_Service { |
| 61 | 66 | |
| 62 | 67 | /** |
| 63 | 68 | * AtomPub Service: document |
| 64 | - * | |
| 69 | + * | |
| 65 | 70 | * Returns detail on a particular document |
| 66 | 71 | * |
| 67 | 72 | */ |
| ... | ... | @@ -69,10 +74,10 @@ class ktAPP_Service_document extends ktAPP_Service { |
| 69 | 74 | public function GET_action(){ |
| 70 | 75 | //Create a new response feed |
| 71 | 76 | $feed=new KTAPPFeed(KT_APP_BASE_URI); |
| 72 | - | |
| 77 | + | |
| 73 | 78 | //Invoke the KtAPI to get detail about the referenced document |
| 74 | 79 | $docDetail=KTAPPHelper::getDocumentDetail($this->params[0]); |
| 75 | - | |
| 80 | + | |
| 76 | 81 | //Create the atom response feed |
| 77 | 82 | $entry=$feed->newEntry(); |
| 78 | 83 | foreach($docDetail['results'] as $property=>$value){ |
| ... | ... | @@ -80,7 +85,7 @@ class ktAPP_Service_document extends ktAPP_Service { |
| 80 | 85 | } |
| 81 | 86 | //Add a downloaduri field manually |
| 82 | 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 | 89 | //Expose the responseFeed |
| 85 | 90 | $this->responseFeed=$feed; |
| 86 | 91 | } | ... | ... |