Difference between revisions of "Sednterp User Modules"
Bill Bashir (talk | contribs) |
Bill Bashir (talk | contribs) |
||
Line 41: | Line 41: | ||
} | } | ||
− | This is all you should need for Sednterp to recognize your module and try load it. | + | :This is all you should need for Sednterp to recognize your module and try load it. |
− | When creating your own module you will need to edit this code. The function getModuleName tells sednterp the name of your unique module, the function getModuleVersion tells sednterp the version number of the module, getModuleHTMLUI tells sednterp the full path location of your HTML Module UI you need to be careful when you set it otherwise your module will not load properly in the desktop version of sednterp. The module path should relative location of HTML file from the location where Sednterp is installed on your system. The other functions don't have a particular use yet however they are still necessary for sednterp to run your module so just leave them as the are. | + | :When creating your own module you will need to edit this code. The function getModuleName tells sednterp the name of your unique module, the function getModuleVersion tells sednterp the version number of the module, getModuleHTMLUI tells sednterp the full path location of your HTML Module UI you need to be careful when you set it otherwise your module will not load properly in the desktop version of sednterp. The module path should relative location of HTML file from the location where Sednterp is installed on your system. The other functions don't have a particular use yet however they are still necessary for sednterp to run your module so just leave them as the are. |
Revision as of 21:44, 23 August 2012
Sednterp Web and Desktop can load user created modules, written in HTML and Javascript. Both Sednterp Web and Desktop provide an editable display which the user has complete control of and platform tools to help create the module in the form of developer tools. The Sednterp distribution comes with an example module which can be edited so users can use it as a base to create their own modules.
This page shall provide documentation on how to create a user module from scratch.
The basic underlying tool you will need to know is JavaScript, you should not need to be an expert but some underlying fundamentals should be enough to create your own module.
First to create your own module you will need to place it in modules/QtScript under where you have Sednterp installed on your system. If you used the windows installer to install Sednterp you will most likely be able to find it in C:\Program Files\Sednterp
Therefore you should be saving your created modules in C:\Program Files\Sednterp\modules\QtScript
Your module file will be broken up into two parts JavaScript and HTML for the UI.
Part one: JavaScript
- Your JavaScript will need to include the following 6 different functions
/* Required Accessor Functions */ function getModuleName() { return "ModuleName"; } function getModuleVersion() { return "20120604"; } function getModuleInteractionXml() { return "No Interactions"; } function getModuleDate() { return "2010/06/22"; } function getModuleUI() { return "qt_sednterp.ui"; } function getModuleHTMLUI() { return "./modules/QtScript/module1.html"; }
- This is all you should need for Sednterp to recognize your module and try load it.
- When creating your own module you will need to edit this code. The function getModuleName tells sednterp the name of your unique module, the function getModuleVersion tells sednterp the version number of the module, getModuleHTMLUI tells sednterp the full path location of your HTML Module UI you need to be careful when you set it otherwise your module will not load properly in the desktop version of sednterp. The module path should relative location of HTML file from the location where Sednterp is installed on your system. The other functions don't have a particular use yet however they are still necessary for sednterp to run your module so just leave them as the are.
Part two: HTML UI
The HTML should be standard HTML it can include script in the head of the document and can be created any way you want for example you could create it using dreamweaver or many of the other tools out there to create HTML files. For the purpose of this tutorial I will show you how to do it with such tools.
Sednterp Developer Tools:
- Developer tools are provided in the Sednterp Desktop application automatically, similar functionality maybe offer in Sednterp Web application but this would depend on the browser you employ to view the web version, therefore I will only discuss the developer tools that come with desktop application.
- Load a your user module and right click on the module display like so and click "Inspect", you should see the following dialog appear. If you are familiar with the developer tools offered with google chrome this dialog should look familiar.
How to Access the Sednterp Database:
Module Window Graphics options:
jQuery:
- jQuery is a JavaScript library that is available for use with Sednterp, you do not need to include it in your HTML UI file, actually it is recomended that you do not because A: it will most likely not load properly on the web version, B: it will be just another file you will have have to keep track of with your module if you link it locally, C: because it is already provided for use.
- For more about jQuery visit:
jqPlot:
- jqPlot is a JavaScript library that is available for use with Sednterp for creating graphs, chart, etc, it also automatically provided in both Sednterp web and desktop applications to learn about how to use it visit for more.