summaryrefslogtreecommitdiffstats
path: root/appinfo
diff options
context:
space:
mode:
authorAlessandro Cosentino <cosenal@gmail.com>2013-03-03 11:06:00 +0100
committerAlessandro Cosentino <cosenal@gmail.com>2013-03-03 11:06:00 +0100
commit0852773340ed26ecc8faa8e61192f38132673bc6 (patch)
treed5727c17955fb2e2f0d96f58717d819e75762bcf /appinfo
parent4902253e9c8aac706091c6337391153b02923689 (diff)
adds a call to create feed
Diffstat (limited to 'appinfo')
-rw-r--r--appinfo/bootstrap.php12
-rw-r--r--appinfo/routes.php17
2 files changed, 25 insertions, 4 deletions
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