Eclipse EditorDevelopers can use any XML editor to edit metadata files or they can use Openbiz's Eclipse Plug-in. The latter is recommended to be used by new OB users or by anyone when rapidly design and configuring a new application. Please refer to Openbiz Eclipse plug-in designer manual. Organize metadata by packageIn a big application, user may need to build lots of objects, therefore they might have a big metadata file list. Meta files under a single directory can be difficult to manage. From openbiz 1.1, metadata files can be organized by package name. Bear in mind, metadata package is different with the (BizObj, BizView ...) packages which are the code units. Metadata package is a naming system, different package maps to different directory. It is like the package concept used in Java. PackageX.PackageY.metaA.xml refers to the metaA.xml under META_PATH/PackageA/PackageB directory. Where META_PATH is the root metadata directory. This setting is defined in sysheader.inc and app.inc. How to configure package in metadata files?Let's explain it with the demo example. After you unzip the source, find the demo directory under metadata directory. Open FMRegist.xml file with a text editor. You'll see a Package="demo" attribute in the BizForm element. This attribute is to say the default package of any type of openbiz object is under "demo" package. Here the openbiz objects refer to the following object types.
If an object name doesn't contain dot symbol ("."), the system uses the package attribute defined in the object root element as its package. Otherwise, if an object name has format as aaa.objectname, the system thinks such object under package "aaa" and will locate such object under aaa directory. Go back to the example, you can find <BizForm Name="FMRegist" Package="demo" ... BizObj="BORegist"...> They all use default package, so the system will try to locate the metadata files as demo/BORegist.xml, demo/AttendeePopup.xml and demo/Selection.xml. If you want to refer to an object under another package, just add the package name as the prefix of the object name. Notice, there're a Selection.xml under /demo directory and another Selection.xml under /design directory, they belong to different packages. In FMRegist, whose package is "demo", you can use <BizCtrl ... SelectFrom="design.Selection(Mode)" ...> to configure a comboBox whose values are from the "Mode" element of "design/Selection.xml". You cannot refer to an object in different a application. But you can refer to any object in openbiz core application. For example, the core application has references to objects under metadata/shared/ directory. Openbiz tries to locate objects in same application and then in core application. If no object is found, it reports an error. Use object metadata inheritanceIf you have a complex application, you want to reuse the existing object to different places, but you want the object behave a little differently in different scenarios. Object inheritance will help with this frequent problem. Since objects map to metadata files in OB, object inheritance becomes metadata file inheritance. How to specify inheritance between metadata files?Specify an object attribute, InheritFrom = "parent object name". For example, in demo application, BOEventX has Metadata file inheritance is similar with class inheritance in programming languages, child objects can inherit parent object settings. OB will use the child object attributes where they conflict with parent object attributes.
Simple Expression LanguageIn order to add flexibility to metadata configuration, Openbiz accepts simple expressions in metadata files. If a statement has {expr} pattern, the expression is evaluated and used by the metadata config file. Expression can be used in a number of ways including:
Because it's a simple expression language, users should put more complicated logic in an associated object. Developers can also extend property support by modifying/overriding GetProperty() method. The input of GetProperty() can be either "property_name" or "*[child_name]" or something new supported by customer code. Where To Use Expressions
Literal SupportThe simple expression language defines the following literals:
Operator Support
The simple expression language provides the following operators:
Variable Support
Simple expression allows developers to use variables of openbiz metadata objects:
The following table describes variable support in more detail.
FunctionsDevelopers can invoke any PHP functions in simple expression. A user defined functions can be invoked if the file that contains such function is included. For example, if the metadata object A is based on a customer class, the class file is A.php that includes another A_help.inc. In this case, you can invoke functions defined in A_help.inc in simple expression. NEED EXAMPLE
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
