Tools and Extensibility

From Lianjapedia
Jump to: navigation, search

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" 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 same directory as the tool.
<?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>
  <extension>both</extension>
</tool>

In this example main.prg is a 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 install the tool and/or extension for the Tools menu. The extension tag can contain menu, formbar or both. If formbar or both is specified then the tool is installed as an extension in the "Extensions" menu in the Form Tools as well as in the Tools menu.

When you start the App Builder the tool will be automatically installed in the Tools menu and/or the Extensions menu of the page builder in the Form Tools.


Bm-tools.png