MetaData Editor

From Lianjapedia
Revision as of 10:17, 10 April 2017 by Yvonne.milne (Talk | contribs)

Jump to: navigation, search

Under Construction

See Also

ACLASS(), ADDPROPERTY(), ALTER TABLE, AMEMBERS(), COLUMNMETADATA(), COMPOBJ(), CREATE TABLE, CREATEOBJECT(), DATABASEMETADATA(), DEFINE CLASS, DISPLAY CLASSES, DODEFAULT(), FOREACH, JSON_DECODE(), JSON_DECODE_FILE(), JSON_ENCODE(), Lianja MetaData API, LIST CLASSES, LOADOBJECT(), METADATA_DECODE(), METADATA_ENCODE(), METADATA_FINDTYPE(), NEWOBJECT(), OBJECT(), PRINT_JSON(), PRINT_HTML(), PRINT_R(), PRINT_XML(), REMOVEPROPERTY(), REQUIRE_ONCE(), SAVEOBJECT(), SQL SELECT, TABLEMETADATA(), TABLEMETADATAVERSION()

Overview

The MetaData Editor allows you to add, edit and delete database, table and column MetaData.

  • To add a new MetaData attribute, specify a name and a value and optionally a condition in the entry fields then click Add. The new attribute will be added to the grid.
  • Click the grid row of an existing attribute to load its details into the entry fields. From here the details can be edited - click Update when complete - or the whole attribute can be deleted by clicking Delete.
  • Click Clear to clear the entry fields.
  • Click Done to save changes and exit the MetaData Editor, or Cancel to abandon the changes and exit.

See Lianja MetaData API for an overview of creating and using Lianja MetaData.

Database MetaData

Database MetaData



Open the database (double-click) then switch back to the Databases tab and click the 'MetaData editor' icon at the bottom of the panel to open the MetaData Editor.


Note that the databasemetadata() function returns database MetaData and that this can be loaded into an object using the metadata_decode() function.


Table MetaData

Table MetaData



Select or open the table then click the 'MetaData editor' icon at the bottom of the panel to open the MetaData Editor.


Note that the tablemetadata() function returns table MetaData and that this can be loaded into an object using the metadata_decode() function.


The tablemetadataversion() function returns the table's MetaData version number. This number is incremented each time a MetaData change is made in the MetaData Editor or using the alter table command. It can be compared with the section MetaData version attribute to ensure that MetaData is only applied to a section when it has changed.


Table MetaData: Conditional Attributes



Here, additional attributes have been added and include conditions based on record contents.


Note the use of OData Operators in the conditions.

Applying MetaData: Conditional Attributes



Here, an App uses the products table in a Form Section.


The section DataChanged event delegate (After Data Changed) calls the Lianja system object applyMetaData() method so that the section.backcolor color is applied according to the supplierid as set in the MetaData.


Note also the setupUI.prg script, run automatically when the App is loaded. This applies the Column MetaData as shown below in the MetaData Editor.

Column MetaData

Column MetaData



Select the column then click the 'MetaData editor' icon at the bottom of the panel to open the MetaData Editor.


Note that the columnmetadata() function returns column MetaData and that this can be loaded into an object using the metadata_decode() function.