What is LiveCycle and why am I doing this?
From the website: “Adobe LiveCycle® ES (Enterprise Suite) software is an integrated server solution that blends data capture, information assurance, document output, process management, and content services to help you create and deliver rich and engaging applications that reduce paperwork, accelerate decision-making, and help ensure regulatory compliance.”
If you have trouble wrapping your mind around what exactly it is that LC ES can do you for you, you’re not alone. It’s not that LC is a solution in search of a problem; rather, it’s that LC does a lot of stuff! At its heart, LC is an enterprise Java app that provides a suite of services around document and information management.
I, however, do not yet have my head around all of its awesome. For me, it’s about one thing: doing stuff to PDFs that I otherwise couldn’t do, namely 1) unlocking functionality that lives in the PDF but which can only be exercised with Acrobat and 2) programmatically applying security policies to those PDFs. My company produces PDFs for public consumption, and the people opening those PDFs will probably not have Acrobat… just Reader.
Specifically, what I’m interested in is enabling Reader to save PDFs with form data still in tact; enabling “add comment” functionality in Reader; enabling digital signatures; and adding a “kill switch” into PDFs so that if the data goes out of date or is shown to be incorrect, the next time a user opens the PDF, the PDF can “phone home”, get instructions that the PDF is no longer valid, and give the user instructions for how to get a new version of the PDF. And I need to do all of this programmatically.
You can do all of this with LiveCycle; you can do all of it with web service calls (i.e. SOAP); and you can do it all with ColdFusion.
To be clear: you are not dropping some jar files into your ColdFusion install. You are setting up a full JEE server (JBoss, WebSphere, whatever version of LC you download), and you are writing ColdFusion code that will send PDFs to the LiveCycle server, ask LC to do stuff to the PDF, and get new bytes in return. Then, rather than distribute the “source” PDF, you’ll distribute the new “extended” PDF.Finally, this is not about LiveCycle Data Services (LCDS). That’s a part of LiveCycle ES, but it’s not the part I’m interested in for this short blog series. Lots of people have written (with copious examples) about using LCDS with CF. This series will be about using other parts of LC, namely Reader Extensions and Rights Management.
Installing LiveCycle ES
For me, the fastest way to get LiveCycle up and running on my machine was to download the "Turnkey" trial edition here: http://www.adobe.com/cfusion/tdrc/index.cfm?product=livecycle
I selected the JBoss option because I have no experience with WebLogic or WebSphere.
I'd say leave yourself at least a couple of hours to have LiveCycle installed and operational. This isn't a 5-second Tomcat download and 10-second exe install. It's a massive application, so adjust your expectations. Don't start this when you have an hour to go before you leave work (well... start the download then, and then let it go while you're driving home) It's a weighty download, at almost 3 gig.
You'll notice that there's no 64 bit download. This bit me in the ass. I am running this on 64 bit Windows, running the latest 64 bit JDK. The docs tell you that this only works on JDK5. Now, I don't know about you, but I'm the kind of guy who says "yeah, right", and proceeds. Fortunately, the LiveCycle installer asks you for your JDK path, and when you give it a Java 1.6 path, it won't let you proceed. Good on you, LiveCycle.
So, off I went to get a 1.5 JDK (http://java.sun.com/javase/downloads/index_jdk5.jsp). I downloaded the 64 bit JDK cuz that's how I roll. Installed it, changed the JAVA_HOME environment variable to point to it, and off I went with the installer.
Remarkably, I hit no other problems during the install. It takes a very long time, mind you. At times it might *appear* to be hung. Let it ride.
So, it finished installing, then said "Starting JBoss Service". And at that point, FAIL. JBoss started, then shut down right away. Now this is more like it! I expected more of this, honestly, so I was kind of pleasantly surprised. Off I traipsed to the Windows Event Viewer, where I found this gem: "The LoadLibrary function failed for the following reason: LoadLibrary is not a valid Win32 application."
Obviously, this is due to my 64 bit JDK. So I proceeded to futz about in the JBoss install directory, looking for a .config or .properties or .xml or .whatever file that appears to point to my jdk, thinking I can just go download the 32 bit JDK, install it, change the config file to point to that, and be done with it. This was not to be. I'm no rocket surgeon, but as near as I can tell, the JDK path is either a) set into a registry entry or b) stuck in the Windows service config somewhere. I doubt it's the latter though because even starting JBoss with the bat file produced the error. So my money's on the registry entry. Anyhoo, not being adventurous (this was later in the evening), and being generally lazy when it comes to this stuff, I just installed a 32 bit JDK and restarted the LiveCycle install. A few "OK" button clicks and gin & tonics later, and I was up and running.
It takes about 10-15 minutes for LiveCycle to become responsive once JBoss starts, so don't be surprised when "starting JBoss" or 'starting LiveCycle" takes a really long time.
You hit the admin UI link that they tell you on the installer, and up it pops. You will be greeted with a login screen reminiscent of the ColdFusion administrator. You’ll log in, and the similarities will end there. Queue the spooky music… you have entered a new dimension of sight and sound….
1) download the JDK 32 bit version
2) set your java_home variable to point to that version
3) when you download the installer, you'll be given a "serial number". I imagine this is just a stock trial serial. At any rate, copy it into a text file because you will need it later.
4) You will be prompted for a "credential" at some point during all of this. This is important! Write it down. I chose "Marc" as my credential, and then it gives some gibberish password. You will need this.
Next up.... Invoking the ReaderExtensions web service.