diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-05-02 16:55:11 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-05-02 16:55:11 +0200 |
commit | c8c01278d837b3ecc01636fdd5b2d52638833687 (patch) | |
tree | be9a12ebe3734978486623427e914d8b4db9982c /external | |
parent | df91fdfa373cacef6aa20998a00b8fbcfd164d1b (diff) |
implement all routes and function bodies for api calls
Diffstat (limited to 'external')
-rw-r--r-- | external/api.php | 0 | ||||
-rw-r--r-- | external/external.php | 42 | ||||
-rw-r--r-- | external/feedapi.php | 30 | ||||
-rw-r--r-- | external/folderapi.php | 74 | ||||
-rw-r--r-- | external/itemapi.php | 84 |
5 files changed, 229 insertions, 1 deletions
diff --git a/external/api.php b/external/api.php new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/external/api.php diff --git a/external/external.php b/external/external.php new file mode 100644 index 000000000..b134eee72 --- /dev/null +++ b/external/external.php @@ -0,0 +1,42 @@ +<?php + +/** +* ownCloud - News +* +* @author Alessandro Cosentino +* @author Bernhard Posselt +* @copyright 2012 Alessandro Cosentino cosenal@gmail.com +* @copyright 2012 Bernhard Posselt nukeawhale@gmail.com +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE +* License as published by the Free Software Foundation; either +* version 3 of the License, or any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU AFFERO GENERAL PUBLIC LICENSE for more details. +* +* You should have received a copy of the GNU Affero General Public +* License along with this library. If not, see <http://www.gnu.org/licenses/>. +* +*/ + +namespace OCA\News\External; + +class External { + + + /** + * Simple main function for API calls + */ + public static function main($controllerName, $methodName, $urlParams, + \Pimple $container) { + $container['urlParams'] = $urlParams; + $response = $container[$controllerName]->$methodName(); + return new \OC_OCS_Result($response); + } + + +}
\ No newline at end of file diff --git a/external/feedapi.php b/external/feedapi.php index 219c8a893..e13ee9b0a 100644 --- a/external/feedapi.php +++ b/external/feedapi.php @@ -26,6 +26,7 @@ namespace OCA\News\External; use \OCA\AppFramework\Core\API; +use \OCA\AppFramework\Http\Request; use \OCA\News\BusinessLayer\FeedBusinessLayer; use \OCA\News\BusinessLayer\FolderBusinessLayer; @@ -39,8 +40,10 @@ class FeedAPI { private $feedBusinessLayer; private $folderBusinessLayer; private $api; + private $request; public function __construct(API $api, + Request $request, FolderBusinessLayer $folderBusinessLayer, FeedBusinessLayer $feedBusinessLayer, ItemBusinessLayer $itemBusinessLayer){ @@ -51,7 +54,7 @@ class FeedAPI { } - public function getAll(array $urlParams=array()) { + public function getAll() { $userId = $this->api->getUserId(); @@ -74,4 +77,29 @@ class FeedAPI { } + public function get() { + + } + + + public function create() { + + } + + + public function delete() { + + } + + + public function read() { + + } + + + public function move() { + + } + + } diff --git a/external/folderapi.php b/external/folderapi.php new file mode 100644 index 000000000..283230fdc --- /dev/null +++ b/external/folderapi.php @@ -0,0 +1,74 @@ +<?php + +/** +* ownCloud - News +* +* @author Alessandro Cosentino +* @author Bernhard Posselt +* @copyright 2012 Alessandro Cosentino cosenal@gmail.com +* @copyright 2012 Bernhard Posselt nukeawhale@gmail.com +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE +* License as published by the Free Software Foundation; either +* version 3 of the License, or any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU AFFERO GENERAL PUBLIC LICENSE for more details. +* +* You should have received a copy of the GNU Affero General Public +* License along with this library. If not, see <http://www.gnu.org/licenses/>. +* +*/ + +namespace OCA\News\External; + +use \OCA\AppFramework\Core\API; +use \OCA\AppFramework\Http\Request; + +use \OCA\News\BusinessLayer\FolderBusinessLayer; +use \OCA\News\BusinessLayer\BusinessLayerException; + + +class FolderAPI { + + private $folderBusinessLayer; + private $api; + private $request; + + public function __construct(API $api, + Request $request, + FolderBusinessLayer $folderBusinessLayer){ + $this->api = $api; + $this->folderBusinessLayer = $folderBusinessLayer; + } + + + public function getAll() { + + + } + + + public function get() { + + } + + + public function create() { + + } + + + public function delete() { + + } + + + public function update() { + + } + +} diff --git a/external/itemapi.php b/external/itemapi.php new file mode 100644 index 000000000..4bb4f53af --- /dev/null +++ b/external/itemapi.php @@ -0,0 +1,84 @@ +<?php + +/** +* ownCloud - News +* +* @author Alessandro Cosentino +* @author Bernhard Posselt +* @copyright 2012 Alessandro Cosentino cosenal@gmail.com +* @copyright 2012 Bernhard Posselt nukeawhale@gmail.com +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE +* License as published by the Free Software Foundation; either +* version 3 of the License, or any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU AFFERO GENERAL PUBLIC LICENSE for more details. +* +* You should have received a copy of the GNU Affero General Public +* License along with this library. If not, see <http://www.gnu.org/licenses/>. +* +*/ + +namespace OCA\News\External; + +use \OCA\AppFramework\Core\API; +use \OCA\AppFramework\Http\Request; + +use \OCA\News\BusinessLayer\ItemBusinessLayer; +use \OCA\News\BusinessLayer\BusinessLayerException; + + +class ItemAPI { + + private $itemBusinessLayer; + private $api; + private $request; + + public function __construct(API $api, + Request $request, + ItemBusinessLayer $itemBusinessLayer){ + $this->api = $api; + $this->itemBusinessLayer = $itemBusinessLayer; + } + + + public function getAll() { + + } + + + public function getUpdated() { + + } + + + public function get() { + + } + + + public function read() { + + } + + + public function unread() { + + } + + + public function star() { + + } + + + public function unstar() { + + } + + +} |