The Networking Architecture of BlazeDS BlazeDS provides a clean separation of the Selection from Agile Enterprise Application Development with Flex [Book]. In this example I am going to use Spring+BlazeDS integration API for integrating backend Spring based J2EE layer into client layer Flex. So the User Interface is produced using Flex and to take care of the remoting we can use BlazeDS which is Open Source from Adobe. BlazeDS.
|Published (Last):||18 April 2017|
|PDF File Size:||5.26 Mb|
|ePub File Size:||8.69 Mb|
|Price:||Free* [*Free Regsitration Required]|
Created 11 October Flash Builder 4 Download trial. Flex and BlazeDS, together with the Oracle WebLogic Server, enable you to build a fast, scalable, and high availability enterprise solution based on industry standards.
After completing this tutorial you can make your own enterprise application, and with Oracle WebLogic you won’t have to worry about the performance or availability of your application. Further, because Enterprise JavaBeans is an industry standard, there are plenty of resources and books available to help developers get started. This shared library will be used by the web project.
Integrating Flex, BlazeDS and Spring | Callista Enterprise
Next you will add a Dynamic Web project to the Eclipse workspace. The last Eclipse step is to deploy these projects to your WebLogic domain. After setting up the server-side implementation, you’ll create a Flex application in Flash Builder 4 that calls the EJB Session Bean method and displays the regions and countries in a grid. In addition to Flash Builder 4 and BlazeDS, you’ll need to download and install the following software: The first step is to a make a new WebLogic domain.
Generating a basic WebLogic domain.
Getting Started with BlazeDS
Creating a new JDBC data source. If the test fails, check if the hr account is locked this is default.
Instead, you only need to add a reference to a shared library in the weblogic-application. This streamlines BlazeDS web application deployment.
Also, you can upgrade the BlazeDS JARs by making a new shared library and use this new shared library in your web projects without changing the web applications. After you install Eclipse 3. Selecting the WebLogic home folder.
Specifying the domain directory. To generate the HR EJB entities from the database you need to add a database connection to your workbench. You can now see the countries and regions tables that will be used in this article see Figure 8. The HR database schema. The next step is to add a JPA project to the workbench. Configuring JPA project settings. Specifying the package name for the entities. You can now explore the generated code in Eclipse by opening the Region.
Because Region and Country have a reference to each other you need to change the Fetch option of one of the entities to Lazy and the other to Eager, otherwise you will get an endless loop of fetching entities.
Setting a Lazy Fetch on the Region attribute of Country. Setting an Eager Fetch on the Region entity. Setting the transaction type and JTA data source. Defining the new EJB project. Configuring the Session Bean. Setting the Session Bean mapped name. This Session Bean will return the Region and its Countries. Configuring the Java Build Path. Before moving on to the web application development you’ll want to test the Session Bean.
When you run the Java test application it will display a list of regions and countries see Figure Follow these steps to create the web application: Configuring the new Dynamic Web project. Make a note of the Context Root; you’ll need it for the Flash Builder project.
In the flex enyerprise, create two XML files named services-config.
This file is the main BlazeDS configuration, and it’s used to define the channels, the factories in this case the EJB factoryand the other BlazeDS configuration files. The web project is almost ready for deployment, now you just need to add a reference to the BlazeDS library.
This file is the WebLogic application deployment descriptor and contains the shared libraries references. Adding a shared library reference. Adding a WebLogic shared library. Selecting the blazeds shared library.
The last step is to make the Flex application and see the results. Creating a new Flex project. Configuring the J2EE server for the project.
In the Flex project you also need to create the Region and Country entities in a package called entities. RemoteClass is mapped to the Java Region entity class and the countries variable is an ArrayCollection. Number; public var regionName: String; public var countries: Insert the following code into the Country. This class also has a reference to the Country Java class and the region variable is a Region type.
Number; public var countryName: String; public var region: Next you need to create the user interface with data grids to display the regions and countries. Before you can display this data, however, you need to add a remote object with its destination attribute set to hrEJB.
Spring + BlazeDS Integration API for Flex based Enterprise Apps | ravigeek
This value must match the destination in the remoting-config. The RemoteObject must be defined in the fx: Declarations element because it is not a user interface component.
The last step is to display the Regions in a grid and flx Countries in a second grid. The dataprovider on the regions DataGrid is bound to the RemoteObject method call’s result. If you encounter problems, you can check your source code against the HrFlexApp.
Along the way, you saw how the Oracle Enterprise Pack for Eclipse and Flash Builder 4 can help you develop more productively. Here are some additional resources for further reading: