--
PedroRio - 21 Dec 2010
XEO Object Model Behavior- XEO Library
Custom Behavior in XEO Object Models can be achieved through various way :
- Object Events
- Object Methods
- Attribute Events
- Attribute Properties
To define custom behavior there are two methods: BOL and the Java API. BOL is an acronym for Business Object Language which is essentially a small expression language specific to the XEO platform to aid in creating custom behavior. Everything that can be done using BOL can be done using Java (BOL expressions are ultimately converted to Java as the whole Object Model is also converted to Java).
In this chapter we'll create the custom behavior required for the Object Models in the XEO Library and introduce briefly the XEO Java API (and BOL).
XEO Java API (Basic Introduction)
Each XEO Object Model is ultimatelly converted to a Java class to support operations (database tables are also created to persist data) and abstract from the relational data model. The classes created from Object Models extend from a java class included in the framework, the
boObject class , which has a set of base methods to deal with attributes and other Model properties.
A user can login to a XEO Application via the login form or using the Java API to create a session within the XEO application. With access to a boSession, the Java API can be used to create new instances of Object Models, load existing instances, change attribute values in an existing instance as well as save the changed values. One can also query object instances and iterate through the results as well as checking the Object Model definitions to perform operations based on that information.
In order to perform most of these operations.
Para as coisas que me interessa.
boObject.update()
boObject.getAttribute("name").getValueString()
boObject.getAttribute("name").setValueString(newVal)