From 0852773340ed26ecc8faa8e61192f38132673bc6 Mon Sep 17 00:00:00 2001 From: Alessandro Cosentino Date: Sun, 3 Mar 2013 11:06:00 +0100 Subject: adds a call to create feed --- appinfo/bootstrap.php | 12 +++++++++++- appinfo/routes.php | 17 ++++++++++++++--- 2 files changed, 25 insertions(+), 4 deletions(-) (limited to 'appinfo') diff --git a/appinfo/bootstrap.php b/appinfo/bootstrap.php index e9628979b..c7ce8fb62 100644 --- a/appinfo/bootstrap.php +++ b/appinfo/bootstrap.php @@ -123,6 +123,16 @@ function createDIContainer(){ return new FeedBL($c['FeedMapper']); }); - + /** + * EXTERNAL API LAYER + */ + $newsContainer['API_Feed'] = $newsContainer->share(function($c){ + return new API_($c['FolderMapper']); + }); + + $newsContainer['API_Folder'] = $newsContainer->share(function($c){ + return new FeedBL($c['FeedMapper']); + }); + return $newsContainer; } \ No newline at end of file diff --git a/appinfo/routes.php b/appinfo/routes.php index 57b8cb02e..66dedd7f0 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -205,10 +205,21 @@ $this->create('news_ajax_importOPML', '/import')->action( /** * External API */ +/** + * Feed API + */ \OCP\API::register( - 'get', '/news/feeds', array('OCA\News\API_Feed', 'getAll'), 'news', \OC_API::USER_AUTH + 'get', '/news/feeds', array('OCA\News\API_Feed', 'getAll'), 'news', \OC_API::USER_AUTH ); - \OCP\API::register( - 'get', '/news/folders', array('OCA\News\API_Folder', 'getAll'), 'news', \OC_API::USER_AUTH + 'get', '/news/feeds/{feedid}', array('OCA\News\API_Feed', 'getById'), 'news', \OC_API::USER_AUTH +); +\OCP\API::register( + 'post', '/news/feeds/create', array('OCA\News\API_Feed', 'create'), 'news', \OC_API::USER_AUTH +); +/** + * Folder API + */ +\OCP\API::register( + 'get', '/news/folders', array('OCA\News\API_Folder', 'getAll'), 'news', \OC_API::USER_AUTH ); \ No newline at end of file -- cgit v1.2.3