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

LiveCycle Data Services and LC ES2 for Java Developers

0 (0 Likes / 0 Dislikes)
[ADOBE DEVELOPER CONNECTION] Hi. I'm Duane Nickull, I'm one of the Adobe Evangelists, and today, I'm going to show you some really cool features for developers for LiveCycle Data Services and LiveCycle ES2. [Getting Started with the LiveCycle ES2 Development Environment] We're going to first start by setting up a development enviroment, and then we're going to progress in a series of other exercises which will be released in subsequent weeks showing you how to do various third-party connections to the LiveCycle ES platform. So first of all, I've set my computer up; I've got a laptop running, and I have LiveCycle ES Server running on my system. And when I installed LiveCycle ES2, it also installed a bunch of third-party libraries for working with web services, and as well, it installed the LiveCycle ESS_DK, which is very handy if you happen to be a Java developer to invoke services from LiveCycle ES. To set this up and start working with it, though, it takes a few minutes, and that's what we're going to show right now. So onto the system--you can see I've got LiveCycle started. It's the JBOSS stop turnkey installation, and it started running on port 8080. And I've got a version of Eclipse, and we're going to set a brand new project and set it up to include all the necessary JAR files, and go. So first we click New, and this one we'll just call adobe.adc, click Finish. You notice that the LiveCycle ES2 runs on the Java SDK--the JDK1.6, which is an update from previous versions of LiveCycle ES. Within this, I'm going to set up a new package to contain all of my work. So we'll call it com.duanesworldtv.adc. Now, within here, we'll set up a new Java class and before we set up this class, we're going to have to change the name of it, or know what the name is of the class and what it's going to do. Now, LiveCycle has set up--the LiveCycle team has set up some Quick Starts for you to get working with LiveCycle, and these are very, very easy. So I have the first one from this url right here. You can go in and just cut and paste it, and this one is simply converting a document from one form to another. You can convert a document to a PDFA document using the Java API so I'm going to cut and paste this code, and the class name on this one is CreatePDFADocument, so I'm just going to keep that because I'm too lazy to retype it. And we can literally cut and paste our code in here. Now, it's created the class--public class--for this. When I first cut this in, I've got a lot of red x's, and that's because I haven't yet imported all the libraries. Now, if you want to know which libraries from the SDK to import, you can read the comment at the top of every LiveCycle ES2 Quick Start. So the minimum I have to have is the adobe-docconverter-client.jar, the adobe-livecycle-client.jar, and a few others. Since we're going to be doing a couple of these today, I'm going to import all of the jars that I need to work with. Additionally, there's a few other non-Adobe jars that we may need later on, such as the thirdparty jars. This first particular Quick Start is going to use the EJB_ENDPOINT, and the EJB_ENDPOINT will not require some of the SOAP jars, but later on, we'll need them. So I've got my class set up. I've got a lot of red x's. We'll have to go to the Project--Properties, and start importing the jars. Now, the jars, when you install LiveCycle ES, you will have a directory that's called the SDK, or LiveCycle_ES_SDK. And in this directory,you have 5 subdirectories: client libs, misc, samples, schemas, spi-- and the clientlibs is where most of these are. So the common libs are from Adobe, and these make up the bulk of all the things we're going to want to do today, so we're going to import those into the project. You can see our red x's have pretty much all but disappeared. Now, if we want to run this and just test out if we've got the right connection, we first have to set the END_POINT. In this case, it's localhost:1099 and that will actually run on my machine, and then there is an administrator credential and password that we're going to use to make the connection. If you want to invoke certain properties or certain services in the LiveCycle SDK, you have to first go into the LiveCycle Admin UI and make sure that these users that you're going to use or the credentials for it have the right permissions to use, so if I go in and I can look on a user, and we'll use Kal Varsen--he's already up here because I searched for him earlier-- and we can go down the list and select the tab Role Assignments. And for him to do anything PDFG, which is the generation modules, we would have to make sure that he has the rights to do the PDFG User, in this case he's already been added. If the user hasn't been added, you may get some strange errors coming back. So the first thing I'm going to do is in this code-- this Quick Starter list to explain what's going on here-- Scott McDonald set this up, and it's very well written. We set up a Properties object called connectionProps and then we set the default EJB_ENDPOINT. We set the transport protocol to server type--in this case, JBoss, and the username and password, and then we create the Factory object for the ServiceClient and we pass it the connection properties here. And then, we basically make the document converter Service Client and feed it the factory to create the client. We're going to read an input file; In this case, it has to be a PDF file. Now I don't have this particular pile for my machine, but I do have here a PDF--we have one called test.pdf, and it's in a directory of C:\\munich with a lowercase, so I will change this. Remember, if you're working on Windows you do have to escape the backslashes, so that means you have to double up on the backslashes\\. Down lower, we're going to take the PDFA conversion specifications and set the log level--in this case, it's fine. And then, just pass the 2 PDFA method, which takes the input document and the specifications and pass it to the return object called Result, and then we're going to take Result, extract the document from that, and we're going to write it out, and we'll write it out to the same directory to make it easy to find. We'll call it adc1.pdf and we'll save that and hit our magic green button. Now it seems at this point everything is set up to run properly, but we see we have errors, and the errors are because we haven't completely imported all of the libraries we need. In this case, to invoke from a client, we're going to have to install some additional libraries, so we go back to our project, Settings, Properties, and we're going to have to add some more external jars, and these are located in the jboss directory and there's 2 jars here. I'll select these both, and there was one more that we will need later on, and this one is located in the LiveCycle ESS_DK JBoss client, and this one is the client library that we will use for the web services calls. We also have to import the thirdparty jars. Try running our project again. You can see the red x is now terminated, meaning that our document results is being returned, and we now have adc1.pdf, which was created today, and I can open it up and show it to you. So that's about all you need to get going as a Java developer with LiveCycle ES2. The SDK is really well written, and the codes sample are all at this url that you can download it from. Cut and paste the code samples, and it gives you a good quick start to getting your dev environment up and running. Peace, love, may your code compile on the first go. [ADOBE DEVELOPER CONNECTION]

Video Details

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

Adobe Platform Evangelist Duane Nickull discusses how to set up a development environment to work with the LiveCycle Enterprise Suite 2 in a Java project.

Caption and Translate

    Sign In/Register for Dotsub to translate this video.