Difference between revisions of "Tools and Extensibility"

From Lianjapedia
Jump to: navigation, search
Line 1: Line 1:
 
''Under construction''
 
''Under construction''
 
+
==Overview==
 
You can extend the Lianja App Builder with your own or third party supplied tools.
 
You can extend the Lianja App Builder with your own or third party supplied tools.
  
Line 8: Line 8:
  
 
This particular extension is only a few lines of code and allows you to interactively build URL's that use Google charts which can be embedded into WebView sections. You can substitute data into the URL as you navigate data using { ... } macros and the charts will change dynamically.
 
This particular extension is only a few lines of code and allows you to interactively build URL's that use Google charts which can be embedded into WebView sections. You can substitute data into the URL as you navigate data using { ... } macros and the charts will change dynamically.
 +
 +
==The lifecycle of a Tool==
 +
 +
* Create the tool in the scripting language of your choice in a directory with a unique name.
 +
 +
* Create a tool.xml file to describe it in the tool directory.
 +
 +
<pre>
 +
<?xml version="1.0"?>
 +
<tool>
 +
  <caption>Google Charts</caption>
 +
  <icon>:/images/app</icon>
 +
  <command>do main</command>
 +
  <output>false</output>
 +
  <loadatstartup>true</loadatstartup>
 +
  <refreshfiles>false</refreshfiles>
 +
</tool>
 +
</pre>
 +
 +
In this example main.prg is tool written in Lianja/VFP.
 +
 +
<code lang="recital">
 +
//
 +
// Sample tools plugin for Lianja
 +
//
 +
myobj = createobject("webview")
 +
myobj.url = "https://developers.google.com/chart/interactive/docs/gallery"
 +
Lianja.addTool(myobj, "Google Charts")
 +
</code>
 +
 +
Now copy your tool directory into the tools directory e.g. in the above example C:\lianja\tools\google_charts
 +
 +
When you start the App Builder the tool will be automatically installed in the Tools menu.
 +
 +
[[File:bm-tools.png|middle|773px|link={{filepath:bm-tools.png}}]]

Revision as of 06:33, 27 December 2017

Under construction

Overview

You can extend the Lianja App Builder with your own or third party supplied tools.

The "Tools" menu in the Lianja App Builder system MenuBar contains custom tools that can extend Lianja's functionality.

There is an example tool called "google_charts_wizard" in the lianja\tools directory.

This particular extension is only a few lines of code and allows you to interactively build URL's that use Google charts which can be embedded into WebView sections. You can substitute data into the URL as you navigate data using { ... } macros and the charts will change dynamically.

The lifecycle of a Tool

  • Create the tool in the scripting language of your choice in a directory with a unique name.
  • Create a tool.xml file to describe it in the tool directory.
<?xml version="1.0"?>
<tool>
  <caption>Google Charts</caption>
  <icon>:/images/app</icon>
  <command>do main</command>
  <output>false</output>
  <loadatstartup>true</loadatstartup>
  <refreshfiles>false</refreshfiles>
</tool>

In this example main.prg is tool written in Lianja/VFP.

//
// Sample tools plugin for Lianja
//
myobj = createobject("webview")
myobj.url = "https://developers.google.com/chart/interactive/docs/gallery"
Lianja.addTool(myobj, "Google Charts")

Now copy your tool directory into the tools directory e.g. in the above example C:\lianja\tools\google_charts

When you start the App Builder the tool will be automatically installed in the Tools menu.

Bm-tools.png