Free cookie consent management tool by TermsFeed Policy Generator

Changes between Version 3 and Version 4 of Documentation/Howto/ImplementAHLWebAppPlugin


Ignore:
Timestamp:
07/01/15 10:13:31 (9 years ago)
Author:
dglaser
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Documentation/Howto/ImplementAHLWebAppPlugin

    v3 v4  
    2121[[Image(/raw-attachment/wiki/Documentation/Howto/ImplementAHLWebAppPlugin/references.PNG)]]
    2222=== Folder structure ===
     23HeuristicLab WebApp plugins use the following folder structure, which is recommended but not mandatory. The WebApp consists of all client files whereas the WebApi contains all data controllers.
    2324
    24 == Creating the Plugin definition file ==
    25 TODO
     25== Creating the Plugin configuration file ==
     26Every plugin requires a configuration file, which is used to register the views of the plugin with their associated controllers. The configuration file is also used to dynamicly build the sidebar menu. The name of the plugin configuration file has to be `{pluginname}.js`.
     27
     28The following template can be used to create a new configuration file:
     29{{{
     30#!javascript
     31var appPluginNamePlugin = app.registerPlugin('pluginname');
     32(function () {
     33    var plugin = appPluginNamePlugin;
     34    plugin.dependencies = ['ngResource'];
     35    plugin.files = [];
     36    plugin.view = '';
     37    plugin.controller = '';
     38    plugin.routes = [];
     39
     40    var menu = app.getMenu();
     41    var section = menu.getSection('Menu', 1);
     42    section.addEntry({
     43        name: 'Pluginname',
     44        route: '#/pluginname'
     45    });
     46})();
     47}}}
     48
     49* `plugin.dependencies` specifies the required AngularJS modules
     50* `plugin.files` specifies the files that will be dynamicly loaded when a view of the plugin is accessed
     51* `plugin.view` is the main view of the plugin
     52* `plugin.controller` is the controller of the main view
     53* `plugin.routes` is used to register new routes (e.g. more than one view)
     54* `app.getMenu()` is used to add an entry in the sidebar menu
     55
     56The `view` and `controller` properties are required all other properties are optional.
    2657
    2758== Example Plugin ==
    28 TODO
     59The [[https://dev.heuristiclab.com/trac.fcgi/browser/trunk/sources/HeuristicLab.Services.WebApp.Status]] plugin can be used as a good example of how to structure and configure a WebApp plugin.
    2960
    30 === WebApi ===
    31 TODO
    32 
    33 === WebApp ===
    34 TODO
    35 
    36 ==== View ====
    37 TODO
    38 
    39 ==== Controller ====
    40 TODO
    41 
    42 ==== Service ====
    43 TODO
     61== Conventions ==
     62* Controllers has to be derived from `ApiController` and have to end with `Controller` to be discovered by the WebApp
     63* The Plugin assembly name has to match the following `HeuristicLab.Services.WebApp.{pluginname}*.dll` pattern
     64* The plugin configuration file has to be `{pluginname}.js`