Watch videos with subtitles in your language, upload your videos, create your own subtitles! Click here to learn more on "how to Dotsub"

Model-Driven Development in LiveCycle Data Services 3

0 (0 Likes / 0 Dislikes)
[ringing sound] [ADOBE DEVELOPER CONNECTION] Hi, I'm Duane Nickull, an Adobe evangelist. [Duane Nickull - Platform Evangelist] Today for this version of ADC Presents, we're going to go in and look at LiveCycle Data Services 3 and this cool new feature that's been called Fiber as its internal code name. [Model-Driven Development in LiveCycle Data Services 3] And this a methodology for data-driven development. LiveCycle Data Services and the Flash Builder 4 release work together side by side. Flash Builder 4 is the product that is a continuation from the Flex Builder line of products. Flex Builder 3 would have yielded normally to Flex Builder 4, and it's now called Flash Builder 4. This has some very powerful modeling plug-ins that you can add to it [Complete Tutorial and Downloads] [http://www.adobe.com/devnet/livecycle/articles/lcdses2_mdd_quickstart.html] that enable it to examine and inspect the data models on the server side and work with them and pass information back and forth to build an application very quickly with cred capabilities, assuming, of course, you have proper permissions. So let's get started, shall we? First thing I'm going to do is go down to my root directory and go to the applications directory and find the LiveCycle Data Services standalone. And inside this directory there is a database which we can start up, and this is called the Sample DB. When we start this up on the Mac, we say, sh startdb.sh There's a little shell script there. We'll open another window, and while that's going on we'll go to the applications directory again and this time go to the Tomcat bin directory. Under the Tomcat directory there's a Catalina file that we can start up using the same sort of syntax, and this will start up our LiveCycle Data Services, and this is in standalone. Now, as this is roaring through, you might not see this--this is going too fast-- you'll see there's a Hibernate database that's running on one of the ports--I believe it's 9002. We can get the Hibernate database mapping the HSQLDB driver and reference it from this port. And there's a database called orders.db. We've modified a file. When you install LiveCycle Data Services, you'll have to go to the conf directory, Catalina, local host, LIveCycle Data Services and add this snippet of code to this particular file. As well, you'll have to modify the permission so that you have access to code against this. I've disabled the security login with credentials on this, and we now should have the database in a position that's running inside of the container. [keyboard clicking] So there it is. Our application server is up and running. Now, to connect to this through Flash Builder, there's a number of wizards. I'm going to create a new Flex project, and we'll call this adc4, and this one will take J2EE as the basic type. We're going to check "Use remote object access service," and we have a choice of service. We're going to take LiveCycle Data Services ES as our data services folder, data services option, and before we set up the project, we have to validate the configuration and make sure that the web root folder and the root URL are valid. In this case, I pointed the root folder at the LiveCycle Data Services folder under Web Apps, and we've picked the LCDS subfolder from Local Host 8400, and the context route is LCDS. And that's really all we need to do to set this up. I've now set up a new project, and you can see that the stub code has been added for me. Assuming you have downloaded and installed the data modeler plug-in, you will be able to get a new RDS Dataview window by going to Window, Other Views... And there will be a new folder called Data Model and the RDS Dataview. And when you open this Dataview up, it's giving you a remote data services view of data that is on the server in the database we referenced through the configuration code that we just showed. So we have Tables and a database that appear up here for us, and the Fiber data model can be inspected and used. We just go over and Edit Active Data Model. There's a little icon that will be added here when you use the plug-in. Clicking on this will create a new Fiber data model view. At this point we can simply drag the product over and look at the design view of it or the source view. In this particular ID environment, we could get very, very complex, and you can show complete databases with relations between different entities and you can set attributes, properties and a number of other things. We've got this particular subset of the data because we're time constrained and we're just trying to do a simple demo. The next thing we'll do is deploy the model back to the LiveCycle Data Services. I always like to save this before I do it. So I save the project, and when you save the project, you'll notice a small change occurred down here. It automatically added us a product service, and it generated a lot of code for us. This code is being generated under the adc4 package. We have five different classes, actions or classes, that have been built for us which we can inspect later if we want. We now deploy the model back to the server. I'm going to check "Overwrite existing data model." This is usually done in case you have modified the data model on the client side, and it'll recreate it and overwrite any data model that you've got. It tells us it was successfully deployed back to the server. We can go back to our project now and switch into design view. It's very easy to now get a simple data view of this. We can go down here to our Data Services. We drag the data grid up, we drag get all product onto this, and you'll see that this data grid is now bound to this. Running the project will yield a call to the database, and it will display the results back to the application. This is pretty cool. We've managed to do this without writing a single line of code. But we can take this concept a little bit further, thanks to the engineers who have worked on the Adobe LiveCycle Data Services. This is simply one of the best integration stories people have for enterprise RIAs today. Let's go back and modify it further. In the Flex Builder environment, we have got simple read access right now coming to and from the database. But imagine we wanted to be able to update and write products to this database table as well. We can click on the service and ask the Flash Builder IDE to generate a form for us. We click the type of Model Driven Form and it generates a form that's automatically bound to that service call. It hasn't laid it out in a very elegant way, so I'm just going to slide this down myself, and we'll put it a little bit under here. I don't want to align it too much, or I might be accused of being a good designer one day, which I don't want. When you run this again, this gives us some additional capabilities. So if we want to add a new product, we could say, adcproduct, and we could put a price on it and a product name and hit Save. And this product now persists in our database. We've actually written this to the back end. If we reload this database and get the call back again, you'll see that it in fact has reappeared right now. We can make one final tweak to this program to make it populate the form from the value of the selected index in the data grid. So we have the data grid in the code view, and it has an ID of data grid. What we're going to do for the form is basically take the data grid, selected object, and the data grid, selected object will have to be cast. So this one will be selected item, which returns type object as, and what we want to do is use our custom data type which we created in this project called Product. We save this again and run it. When we run it, you can see when we select something from our data grid, it automatically populates the form below. I'm Duane Nickull. This has been a great exploratory tutorial for LiveCycle Data Services 3, the Fiber data modeling technology and data-driven development working with Flash Builder 4. [Duane Nickull - adobe.com/devnet] I encourage you to try this out. This is really, really cool technology. It really clearly puts the RIA stack from Adobe miles above what the competition's doing. Have fun with it. Play around with it. Peace. Love. May your code compile on the first go. [ADOBE DEVELOPER CONNECTION]

Video Details

Duration: 9 minutes and 34 seconds
Country:
Language: English
License: All rights reserved
Genre: None
Views: 135
Posted by: adobetv on Oct 21, 2010

Evangelist Duane Nickull demonstrates how to build a Flex 4 application to integrate a LiveCycle Data Services Java (tm) App Server using Model Driven Development.

Caption and Translate

    Sign In/Register for Dotsub to translate this video.