aboutsummaryrefslogtreecommitdiff
path: root/appinfo
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2014-08-14 18:41:34 +0200
committerChristian Weiske <cweiske@cweiske.de>2014-08-14 18:41:34 +0200
commit3780cf15a59c48b3d71e8ec27e3bdacd8a119460 (patch)
tree84498c8ebdb29f212ab1b37c1d8b911eb6a237e9 /appinfo
downloadgrauphel-3780cf15a59c48b3d71e8ec27e3bdacd8a119460.tar.gz
grauphel-3780cf15a59c48b3d71e8ec27e3bdacd8a119460.zip
wip
Diffstat (limited to 'appinfo')
-rwxr-xr-xappinfo/app.php13
-rw-r--r--appinfo/application.php45
-rwxr-xr-xappinfo/database.xml173
-rwxr-xr-xappinfo/info.xml10
-rw-r--r--appinfo/routes.php75
-rwxr-xr-xappinfo/version1
6 files changed, 317 insertions, 0 deletions
diff --git a/appinfo/app.php b/appinfo/app.php
new file mode 100755
index 0000000..3e319df
--- /dev/null
+++ b/appinfo/app.php
@@ -0,0 +1,13 @@
+<?php
+require_once (__DIR__ . '/../src/grauphel/Autoloader.php');
+grauphel\Autoloader::register();
+
+//OCP\App::registerAdmin( 'apptemplate', 'settings' );
+
+OCP\App::addNavigationEntry( array(
+ 'id' => 'grauphel',
+ 'order' => 2342,
+ 'href' => OCP\Util::linkTo( 'grauphel', 'index.php' ),
+ 'icon' => OCP\Util::imagePath( 'grauphel', 'notes.png' ),
+ 'name' => 'Tomboy notes'
+));
diff --git a/appinfo/application.php b/appinfo/application.php
new file mode 100644
index 0000000..ecee129
--- /dev/null
+++ b/appinfo/application.php
@@ -0,0 +1,45 @@
+<?php
+namespace OCA\Grauphel\AppInfo;
+use \OCP\AppFramework\App;
+
+class Application extends App
+{
+ public function __construct(array $urlParams=array())
+ {
+ parent::__construct('grauphel', $urlParams);
+
+ $container = $this->getContainer();
+
+ /**
+ * Controllers
+ */
+ $container->registerService(
+ 'ApiController',
+ function($c) {
+ return new \OCA\Grauphel\Controller\ApiController(
+ $c->query('AppName'),
+ $c->query('Request')
+ );
+ }
+ );
+ $container->registerService(
+ 'AccessController',
+ function($c) {
+ return new \OCA\Grauphel\Controller\AccessController(
+ $c->query('AppName'),
+ $c->query('Request')
+ );
+ }
+ );
+ $container->registerService(
+ 'OAuthController',
+ function($c) {
+ return new \OCA\Grauphel\Controller\OAuthController(
+ $c->query('AppName'),
+ $c->query('Request')
+ );
+ }
+ );
+ }
+}
+?>
diff --git a/appinfo/database.xml b/appinfo/database.xml
new file mode 100755
index 0000000..ae089ca
--- /dev/null
+++ b/appinfo/database.xml
@@ -0,0 +1,173 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<database>
+ <name>*dbname*</name>
+ <create>true</create>
+ <overwrite>false</overwrite>
+ <charset>utf8</charset>
+ <table>
+ <name>*dbprefix*grauphel_oauth_tokens</name>
+ <declaration>
+ <field>
+ <name>token_id</name>
+ <type>integer</type>
+ <default>0</default>
+ <notnull>true</notnull>
+ <autoincrement>1</autoincrement>
+ <length>11</length>
+ </field>
+ <field>
+ <name>token_user</name>
+ <type>text</type>
+ <notnull>false</notnull>
+ <length>64</length>
+ </field>
+ <field>
+ <name>token_type</name>
+ <type>text</type>
+ <notnull>true</notnull>
+ <length>16</length>
+ </field>
+ <field>
+ <name>token_key</name>
+ <type>text</type>
+ <notnull>true</notnull>
+ <length>128</length>
+ </field>
+ <field>
+ <name>token_secret</name>
+ <type>text</type>
+ <notnull>true</notnull>
+ <length>128</length>
+ </field>
+ <field>
+ <name>token_verifier</name>
+ <type>text</type>
+ <notnull>true</notnull>
+ <length>128</length>
+ </field>
+ <field>
+ <name>token_callback</name>
+ <type>text</type>
+ <notnull>true</notnull>
+ <length>2048</length>
+ </field>
+ </declaration>
+ </table>
+
+ <table>
+ <name>*dbprefix*grauphel_notes</name>
+ <declaration>
+ <field>
+ <name>note_id</name>
+ <type>integer</type>
+ <default>0</default>
+ <notnull>true</notnull>
+ <autoincrement>1</autoincrement>
+ <length>11</length>
+ </field>
+ <field>
+ <name>note_user</name>
+ <type>text</type>
+ <notnull>false</notnull>
+ <length>64</length>
+ </field>
+
+ <field>
+ <name>note_guid</name>
+ <type>text</type>
+ <notnull>true</notnull>
+ <length>128</length>
+ </field>
+
+ <field>
+ <name>note_create_date</name>
+ <type>text</type>
+ <notnull>true</notnull>
+ <length>32</length>
+ </field>
+ <field>
+ <name>note_last_change_date</name>
+ <type>text</type>
+ <notnull>true</notnull>
+ <length>32</length>
+ </field>
+ <field>
+ <name>note_last_metadata_change_date</name>
+ <type>text</type>
+ <notnull>true</notnull>
+ <length>32</length>
+ </field>
+
+ <field>
+ <name>note_title</name>
+ <type>text</type>
+ <notnull>true</notnull>
+ <length>1024</length>
+ </field>
+ <field>
+ <name>note_content</name>
+ <type>clob</type>
+ <notnull>true</notnull>
+ </field>
+ <field>
+ <name>note_content_version</name>
+ <type>text</type>
+ <notnull>true</notnull>
+ <length>16</length>
+ </field>
+ <field>
+ <name>note_open_on_startup</name>
+ <type>integer</type>
+ <default>0</default>
+ <notnull>true</notnull>
+ <length>1</length>
+ </field>
+ <field>
+ <name>note_pinned</name>
+ <type>integer</type>
+ <default>0</default>
+ <notnull>true</notnull>
+ <length>1</length>
+ </field>
+ <field>
+ <name>note_tags</name>
+ <type>text</type>
+ <notnull>true</notnull>
+ <length>1024</length>
+ </field>
+ </declaration>
+ </table>
+
+ <table>
+ <name>*dbprefix*grauphel_syncdata</name>
+ <declaration>
+ <field>
+ <name>syncdata_id</name>
+ <type>integer</type>
+ <default>0</default>
+ <notnull>true</notnull>
+ <autoincrement>1</autoincrement>
+ <length>11</length>
+ </field>
+ <field>
+ <name>syncdata_user</name>
+ <type>text</type>
+ <notnull>false</notnull>
+ <length>64</length>
+ </field>
+ <field>
+ <name>syncdata_current_sync_guid</name>
+ <type>text</type>
+ <notnull>true</notnull>
+ <length>64</length>
+ </field>
+ <field>
+ <name>syncdata_latest_sync_revision</name>
+ <type>integer</type>
+ <default>0</default>
+ <notnull>true</notnull>
+ <length>11</length>
+ </field>
+ </declaration>
+ </table>
+</database>
diff --git a/appinfo/info.xml b/appinfo/info.xml
new file mode 100755
index 0000000..ac0f9ec
--- /dev/null
+++ b/appinfo/info.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<info>
+ <id>grauphel</id>
+ <name>Grauphel: Tomboy note server</name>
+ <description>Tomboy REST API server to sync notes between devices</description>
+ <version>0.1</version>
+ <licence>AGPL3 or later</licence>
+ <author>Christian Weiske</author>
+ <requiremin>7</requiremin>
+</info>
diff --git a/appinfo/routes.php b/appinfo/routes.php
new file mode 100644
index 0000000..da62dc9
--- /dev/null
+++ b/appinfo/routes.php
@@ -0,0 +1,75 @@
+<?php
+namespace OCA\Grauphel\AppInfo;
+
+$application = new Application();
+$application->registerRoutes(
+ $this,
+ array(
+ 'routes' => array(
+ array(
+ 'url' => '/test',
+ 'name' => 'access#test',
+ ),
+
+ array(
+ 'url' => '/authorize',
+ 'name' => 'access#authorize',
+ 'verb' => 'GET',
+ ),/*
+ array(
+ 'url' => '/authorize',
+ 'name' => 'access#authorize',
+ 'verb' => 'POST',
+ ),*/
+ array(
+ 'url' => '/login',
+ 'name' => 'access#login',
+ 'verb' => 'GET',
+ ),
+
+ array(
+ 'url' => '/oauth/access_token',
+ 'name' => 'oauth#accessToken',
+ 'verb' => 'POST',
+ ),
+ array(
+ 'url' => '/oauth/authorize',
+ 'name' => 'oauth#authorize',
+ 'verb' => 'GET',
+ ),
+ array(
+ 'url' => '/oauth/request_token',
+ 'name' => 'oauth#requestToken',
+ 'verb' => 'POST',
+ ),
+
+ array(
+ 'url' => '/api/1.0',
+ 'name' => 'api#index',
+ 'verb' => 'GET',
+ ),
+ array(
+ 'url' => '/api/1.0/{user}/note/{guid}',
+ 'name' => 'api#note',
+ 'verb' => 'GET',
+ ),
+ array(
+ 'url' => '/api/1.0/{user}/notes',
+ 'name' => 'api#notes',
+ 'verb' => 'GET',
+ ),
+ array(
+ 'url' => '/api/1.0/{user}/notes',
+ 'name' => 'api#notes',
+ 'verb' => 'POST',
+ ),
+ array(
+ 'url' => '/api/1.0/{user}',
+ 'name' => 'api#user',
+ 'verb' => 'GET',
+ ),
+ )
+ )
+);
+
+?>
diff --git a/appinfo/version b/appinfo/version
new file mode 100755
index 0000000..49d5957
--- /dev/null
+++ b/appinfo/version
@@ -0,0 +1 @@
+0.1