bioinformatics-ua / dicoogle

Dicoogle - Open Source PACS
http://www.dicoogle.com/
GNU General Public License v3.0
447 stars 132 forks source link

Web UI Plugin Interface #20

Closed Enet4 closed 9 years ago

Enet4 commented 9 years ago

With the deprecation of the Swing graphical plugin interface and the uprising of future use cases for Dicoogle, there comes a need for extendability at the web user interface level. Web Service plugins can provide web interfaces, but these are not integrated into the rest of the Dicoogle web application.

Here are some of the features that we are trying to cover:

Below is a diagram with my proposal. The Dicoogle web page will provide specific UI slots for plugins to be inserted into (multiple plugins in the same slot could be separated with tabs). A Web UI plugin would compose a JavaScript module and a package descriptor (using a "package.json" typically seen in Node.js). An example of a package descriptor can be seen below. At the dicoogle subtree, it must contain at least the file name of the module and a pointer to the slot meant to be attached to.

{
  "name" : "cbir-query",
  "version" : "0.0.1",
  "description" : "CBIR Query-By-Example plugin",
  "dicoogle" : {
    "caption" : "Query by Example",
    "slot-id" : "query",
    "module-file" : "module.js"
  }
}

At the level of the actual module, a DicoogleWeb object would be exposed with some operations only relevant to the web interface. issueQuery would perform the query (thus passing all the data needed by the engine) and trigger a result plugin by invoking an event in the result slot. The onResult event function, implemented by each result web UI plugin, should take a list of results and expose them freely.

webui

Let this issue be used to design and discuss Dicoogle's Web UI plugin interface. I will add more details as more suggestions and ideas come up.

bastiao commented 9 years ago

Good idea.

According to our discussion I'm suggestion to have kind of Javascript Plugin that should be loaded at the bootstrap stage.

In terms of functionality they should be able to hook at least:

Maybe is a good idea to have some kind of extensions like the following (or maybe, we can go for ECMAScript 6 or Typescript)

// Examples of possible inputs for confs: {“name”: “widgetname", “width”: 10, “height”: 20, .. ? }
// This kind of information could be provided in a separated JSON files, for instance: SampleSearchWidget.js and SampleSearchWidget.json 
var SampleSearchWidget = function SampleSearchWidget(confs){

SampleSearchWidget._base.apply(this, [confs.widgetname, “My Sample", confs.width, confs.height, etc...]);

}.inherit(SearchWidget).addToPrototype({

     __init : function(parent){
    }
    setProxy : function(globalProxy){
           // If need to access to some of global features/context? 
           // could be part of dicoogle-sdk.js ? only for the client-side part? 
    }

});

Just my 2 cents.

Enet4 commented 9 years ago

Not bad, I say. The Dicoogle JS SDK is a critical to the solution, therefore. And the entire web UI plugin architecture would lie on the client side. Time to design dicoogle-webcore.js.

Enet4 commented 9 years ago

The web core JavaScript module is done. Next I will implement some actually useful plugins and add slots to the Dicoogle web application. https://github.com/bioinformatics-ua/dicoogle/tree/feature/webUI_plugin_interface/dicoogle/src/main/js

Enet4 commented 9 years ago

Dicoogle Web Core has reached a functional version, and test query and result plugins are already implemented in new/webUIplugin. I will start new issues to address future concerns.