Difference between revisions of "Custom Builders"
Yvonne.milne (Talk | contribs) |
Yvonne.milne (Talk | contribs) |
||
Line 1: | Line 1: | ||
− | Custom builders intercept the creation of new Apps, Pages, databases and tables to apply developer customizations. | + | Custom builders intercept the creation of new Apps, Pages, databases and tables to allow the operation to be handled programmatically and apply developer customizations. |
They can be coded in the following languages: | They can be coded in the following languages: | ||
Line 76: | Line 76: | ||
App attribute names can be found here: [[App Settings]]. | App attribute names can be found here: [[App Settings]]. | ||
+ | |||
+ | ==See Also== | ||
+ | [[App Settings]], [[App Wizard]], [[CREATE DATABASE]], [[CREATE TABLE]], [[Data_Files#Databases|Data Files:Databases]], [[Data_Files#Tables|Data Files:Tables]], [[Lianja|Lianja System Object]], [[Lianja Projects]], [[Page Wizard]] | ||
[[Category:Wizards]] | [[Category:Wizards]] | ||
[[Category:Lianja v5.5]] | [[Category:Lianja v5.5]] |
Revision as of 12:16, 11 November 2020
Custom builders intercept the creation of new Apps, Pages, databases and tables to allow the operation to be handled programmatically and apply developer customizations.
They can be coded in the following languages:
- Lianja (.prg)
- Python (.py)
- JavaScript (.js)
- PHP (.php)
- TypeScript (.ts)
- Lianja Server Pages (.rsp)
They should be located in the builders sub-directory of the Library and are named for the target element along with the default programming language extension.
Windows
Target | Filename |
---|---|
App | C:\lianja\library\builders\app.ext |
Page | C:\lianja\library\builders\page.ext |
Database | C:\lianja\library\builders\database.ext |
Table | C:\lianja\library\builders\table.ext |
Linux
Target | Filename |
---|---|
App | /opt/lianja/library/builders/app.ext |
Page | /opt/lianja/library/builders/page.ext |
Database | /opt/lianja/library/builders/database.ext |
Table | /opt/lianja/library/builders/table.ext |
Custom builders can also be created for a specific project. In this case, prefix the custom builder script with the name of the project. So the Lianja script custom builder for Apps in the myproject project would be:
myproject_app.prg
For example this could be used after the App Wizard completes to set some App attributes for each of the Apps created in a project.
// myproject_app.prg Lianja.writeOutput("Creating new App using the App wizard") // Show the wizard which is modal Lianja.showAppWizard() // after the wizard completes the new App is open if len(Lianja.Application) > 0 Lianja.writeOutput(format("App {0} was created place any post create code here", Lianja.Application)) // set attributes for all the apps created in myproject Lianja.setAttr("pwa", true) Lianja.saveApp() endif
Note the use of desktop Lianja system object methods (introduced in v5.5):
Lianja.saveApp() Lianja.setAttr(name, value) Lianja.showAppWizard()
The corresponding method to get an attribute is also now supported.
Lianja.getAttr(name)
App attribute names can be found here: App Settings.
See Also
App Settings, App Wizard, CREATE DATABASE, CREATE TABLE, Data Files:Databases, Data Files:Tables, Lianja System Object, Lianja Projects, Page Wizard