Escolar Documentos
Profissional Documentos
Cultura Documentos
• With Adobe Flex developers can easily create Rich Internet Frontend
Applications
• LiveCycle Data Services is Adobe’s solution for providing Java based
middleware to access Java Classes directly from Flex Frontends.
• However, Flex Developers still have to program Java to provide backend
services for Flex Applications.
Our mission
• Flex – Developers without or little Java and J2EE knowledge shall be enabled to
develop Java-Backends for Flex Applications
• Beside a persistence store the j2flex Framework also shall offer advanced
features like User-Management with LDAP-Synchroniation,
Rightmanagement, Multilanguage capabilities, versioning and workflow
support
• By using the j2flex Persistence Framework developers shall be able to reduce
development time for backend services up to 65%
The solution: j2flex Framework
physical database
(Oracle, SQLServer) Meta database model
j2flex
Objectmodel
Using an physical database schema with j2flex
PK,FK1 obj_type
PK,FK1 obj_id obj_int
PK,FK2 mand_type
PK,FK1,FK2 obj_type
PK,FK2 mand_id
PK,FK1 obj_id
PK,FK1 version_id
right_id
PK,FK2 field_id
from_parent
delete_flag
int_value
obj_version obj_date
PK,FK1 obj_type PK,FK1,FK2 obj_type
PK,FK1 obj_id PK,FK1 obj_id
PK version_id PK,FK1 version_id
object_pair object PK,FK2 field_id
date_from
PK,FK2 obj_id1 PK obj_type date_to date_value
PK,FK2,I2 obj_type1 PK obj_id vers_comment
PK,FK1,I2 obj_type2 op_type
PK,FK1,I2 obj_id2 FK1 parent_id
PK,I1 pair_flag FK1 parent_type obj_simpletext
I1 obj_uuid PK,FK1,FK2 obj_type
pair_order obj_f_system PK,FK1 obj_id
obj_f_enabled PK,FK1 version_id
obj_edit_version_id PK,FK2 field_id
obj_version_ready
obj_level text_value
I2 obj_order
obj_order_state
obj_hide_from_search
obj_next_editor obj_systext
obj_workflow_deadline PK,FK1,FK2 obj_type
o_date_created PK,FK1 obj_id
o_date_changed language PK,FK2 field_id
has_child PK,FK3 lang_id
PK,FK1 lang_id
text_value
FK1 obj_type
obj_type default_flag
lang_locale obj_text
PK,FK1 obj_type lang_img type_field
lang_f_used PK,FK1,FK2 obj_type
FK1 obj_type_stub lang_meta PK,FK1 obj_id PK field_id
hierarchy_flag code PK,FK1 version_id PK,FK1 obj_type
versions_flag PK,FK2 field_id
href PK,FK3 lang_id field_name
obj_table field_type
obj_pk text_value meta_flag
inc_pre_save table_flag
inc_post_save field_default
type_img_list obj_blob field_order
obj_min_right field_tag_type
obj_sort_type PK,FK1,FK2 obj_type field_tag_param
obj_sort_dir PK,FK1 obj_id field_visibility
type_name PK,FK1 version_id field_required
obj_icon PK,FK2 field_id field_verity
PK,FK3 lang_id field_min_right
field_multi_language
blob_uuid field_tab
blob_value
Enhanced features of the j2flex Framework
• A complete integrated user and right management system which also can be
synchronised with external LDAP-Systems
• Integrated asset management with up- and download functionality
• Full text retrieval for all assets stored in the asset management system and for
all database objects
Flex Application with RemoteObject Access to j2flex
1. Creation of a physical database model and mapping inside the meta model
2. Destination definition in remoting-config.xml of LC Data Services
3. Using the j2flex API in Flex for accessing the j2flex Persistence Store
Flex Application with RemoteObject Access to j2flex
1. Creation of a physical database model and mapping inside the meta model
2. Destination definition in remoting-config.xml of LC Data Services
3. Using the j2flex API in Flex for accessing the j2flex Persistence Store
Destination definition in remoting-config.xml of LCDS 2.5
<destination id=„j2flex.service">
<security>
<security-constraint ref="j2flex"/>
</security>
<properties>
<source>com.j2flex.Service</source>
<scope>application</scope>
<message-service-id>j2flex.messaging</message-service-id>
</properties>
</destination>
1. Creation of a physical database model and mapping inside the meta model
2. Destination definition in remoting-config.xml of LC Data Services
3. Using the j2flex API in Flex for accessing the j2flex Persistence Store
j2flex API
// rs is a J2FlexRecordSet
//
while (rs.hasNext())
{
// jump to next row
rs.next();
// output obj_id
trace("obj_id: " + rs.getColumn("obj_id"));
By defining a mapping file j2flex automatically can create server-side ValueObjects for getting
typed objects in AS3:
j2flexmaping.properties:
products=foo.bar.Product
supplier=foo.bar.supplier
On the left side there is the object type name (type_name), NOT the name of the physical
table. On the right side there is the name of the AS3 class which shall be used for the
mapping.
That means: by using that mapping file and sending a SQL-Statement like „select * from
products“ to j2flex you now will get a J2FlexRecordSet with an ArrayCollection of poducts.
Access to the meta database model by using SQL
• Access to the meta database model with SQL by using the j2flex SQL-Parser
• The j2flex SQL-Parser transforms the SQL-Statement for the meta database
model … so it does no matter whether objects are directly mapped to physical
tables or mapped to virtual tables inside the meta database model
• j2flex returns a result set which automatically includes only objects with
correct language properties based on the selected session language and to
which the user has granted access to
• As they are no real SQL queries there's no danger of SQL injections as
everything gets handled by the SQL Parser.
Insert / Update / Deletion of objects
1. Creation of a physical database model and mapping inside the meta model
2. Destination definition in data-mangement-config.xml of LCDS 2.5
3. Create Assembler classes in Java for all defined destinations
4. Using the j2flex API in Flex for accessing the j2flex Persistence Store
Flex Application with Data Management Service Access to j2flex
1. Creation of a physical database model and mapping inside the meta model
2. Destination definition in data-mangement-config.xml of LCDS 2.5
3. Create Assembler classes in Java for all defined destinations
4. Using the j2flex API in Flex for accessing the j2flex Persistence Store
Destination definition in data-mangement-config.xml of LCDS 2.5
<destination id="Produkt">
<adapter ref="java-dao"/>
<security>
<security-constraint ref="j2flex"/>
</security>
<properties>
<source>workflowsystem.assemblers.ProduktAssembler</source>
<scope>application</scope>
<metadata>
<identity property="obj_id"/> Mapping of a destination to a
</metadata>
</properties>
j2flex assembler class
</destination>
Here you have to program server-
side Java!
Flex Application with Data Management Service Access to j2flex
1. Creation of a physical database model and mapping inside the meta model
2. Definition der Destinations in der datamanagement.xml der LC Data Services
3. Create Assembler classes in Java for all defined destinations
4. Using the j2flex API in Flex for accessing the j2flex Persistence Store
Create a Assembler class for a destination
1. Creation of a physical database model and mapping inside the meta model
2. Definition der Destinations in der datamanagement.xml der LC Data Services
3. Create Assembler classes in Java for all defined destinations
4. Using the j2flex API in Flex for accessing the j2flex Persistence Store
Flex Source with j2flex and Data Service Management Services
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx=http://www.adobe.com/2006/mxml layout="absolute"
creationComplete="init()">
<mx:Script>
<![CDATA[
import com.j2flex.core.J2FlexService;
import com.j2flex.events.J2FlexResultEvent;
import mx.collections.ArrayCollection;
import com.j2flex.events.J2FlexEventKind;
[Bindable]
private var collection:ArrayCollection;
private var service:J2FlexService;
private function init():void {
collection = new ArrayCollection();
service = new J2FlexService();
service.destination = "J2Flex.service";
service.loginUser("admin", "test");
service.addEventListener(J2FlexEventKind.LOGIN_USER, getData);
}
private function getData(event:J2FlexResultEvent):void {
ds.fill(collection)
}
]]>
</mx:Script>
<mx:DataService id="ds" destination= "product" autoCommit=“true" />
<mx:DataGrid dataProvider="{collection}"/>
</mx:Application>
j2flex Systemrequirements
• Uses standard SQL and a simple • Quite complicated and own SQL
API for communication with Flex dialect, not optimized for Flex
http://www.j2flex.com
http://blog.j2flex.com
http://docs.j2flex.com