Skip to content

Commit

Permalink
Set to mirror the develop branch on the last point where the classes
Browse files Browse the repository at this point in the history
where named AppAPI (commit 76baed6... Merge pull request #4 from
aptoma/docs-update)
  • Loading branch information
michael committed Dec 11, 2014
1 parent 4071493 commit bda56f9
Show file tree
Hide file tree
Showing 53 changed files with 100,412 additions and 7,906 deletions.
62 changes: 62 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/* global module:false */

module.exports = function(grunt) {
"use strict";

require('time-grunt')(grunt);

grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-jsdoc');

grunt.registerTask('ci', ['jshint', 'karma:ci']);

grunt.initConfig({
jshint: {
options: {
jshintrc: true
},
all: ['Gruntfile.js', 'js/*.js', 'test/**/*.js']
},

karma: {
ci: {
configFile: 'karma.conf.js',
background: false,
singleRun: true,
browsers: ['PhantomJS']
},
unit: {
configFile: 'karma.conf.js',
background: true,
browsers: ['PhantomJS']
},
autowatch: {
configFile: 'karma.conf.js',
autoWatch: true,
browsers: ['PhantomJS']
}
},

watch: {
scripts: {
files: ['js/**/*.js', 'test/**/*.js'],
tasks: ['jshint', 'karma:autowatch'],
options: {
spawn: false
}
}
},

jsdoc: {
dist: {
src: ['README.md', 'js/*.js'],
options: {
destination: 'doc',
template : "node_modules/grunt-jsdoc/node_modules/ink-docstrap/template"
}
}
}
});
};
48 changes: 47 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,52 @@ Take a look at the example app to see how to get started. There you will see an

When you're bored of that you can look through the method listings avaiable on the right and that is hopefully enough to set you on the right track to create any app you want.

Costum configuration
==============
Apps can ask for and specify a customized configuration object. The API function to retrieve the configuration option is AppAPI.getConfiguration, and you can find documentation on that in the AppAPI module.

To specify the format of the configuration object the App needs to provide an URL where other applications (in most cases DrPublish's App Admin tool) can recieve an [JSON schema](http://json-schema.org/) describing the desired configuration setup. In case of DrPublish this URL is then registered alongside the URL to the app in the Publication configuration.

A simple example JSON schema for an image app could look like:
```JSON
{
"search": {
"type": "string",
"title": "Default Search",
"required": true
},
"images": {
"type": "array",
"title": "Image Sizes",
"items": {
"type": "object",
"title": "Image Size",
"properties": {
"name": {
"type": "string",
"title": "name",
"required": true
},
"filter": {
"type": "string",
"title": "Filter",
"enum": [
"grayscale",
"sepia",
"none"
]
},
"height": {
"type": "integer",
"title": "Height"
}
}
}
}
}
```


Authentication explained
==============
When an app is loaded DrPublish send an encrypted token to the app, this is done so the app can check that it is actually being loaded by a DrPublish instance with a valid user logged in. Apps should always verify this token, otherwise this security aspect dissappears.
Expand Down Expand Up @@ -53,4 +99,4 @@ Note especially warnings and errors since these indicate that something of speci

Documentation Generation
========================
Documentation has been generated using [jsdoc](https://github.com/jsdoc3/jsdoc) and the supplied conf.json file
Documentation has been generated using [jsdoc](https://github.com/jsdoc3/jsdoc) and the supplied jsdoc.json file
10 changes: 10 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "plugin-api",
"repository": {
"type": "git",
"url": "https://github.com/aptoma/no.aptoma.plugin-api.git"
},
"dependencies": {
"jquery": "2.1.1"
}
}
1 change: 0 additions & 1 deletion conf.json

This file was deleted.

Loading

0 comments on commit bda56f9

Please sign in to comment.