Posts tagged "LiveCycle ES"

Setting Up Windows Service Dependencies – Oracle XE Example

Did you ever need a Windows service to startup, but only after other services are running? The LiveCycle Turnkey installation creates a dependency so that MySQL starts before JBoss. What if your application requires another DB such as Oracle XE to be running first?

Unfortunately, Oracle XE does not install this dependency, so that if you setup the Oracle XE DB to automatically start (the default installation), everything will be running, but you can’t access the XE DB. This can happen when the DB starts up before the TNS Listener, so that the TNS Listener doesn’t realize there’s a database running.

This Knowledge Base Article from Microsoft http://support.microsoft.com/kb/193888 describes how to do setup these dependencies, but the text does not match up with what I see in Windows 2003 EE R2, so I have attached some screen shots.

  1. Start->Run->regedit
  2. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\OracleServiceXE (swap OracleServiceXE for your service)
  3. Create a new Multi-String Value, by right-clicking on the background in the folder’s contents
    create_multi-string_value.png
  4. Change the name of the value to “DependOnService”
  5. Edit the value (right-click and select modify) and add the services that should be started before this one. You need to enter the service name exactly as it appears in the Windows Services application. For Oracle XE, it is the “OracleXETNSListener” service.
    edit_value.png
  6. Click OK
    change_multi-string_value_name.png
    View larger image.
  7. Verify that it was updated properly by checking the service properties
    service_properties.png

    service_dependencies.png

Working with the DataExtractionAndUpdateDatabase ES2 Sample Application Part 1

I had a customer contact me for help in getting this sample application to work.
http://help.adobe.com/en_US/livecycle/9.0/samples/ServiceUsageSampleFormsDataExtractionAndUpdateDatabase.html

It’s a nice sample application that shows you how to extract data from a form, transform the XML using XSLT and then save it to a MySQL database table.

The directions don’t tell you how to create the MySQL database and this can be a challenge. You can find documentation on MySQL 5.1 (the version installed as part of an ES2 turnkey installation) here. To save you the trouble, I’ve summarized the steps you need to follow to make the process work.

Note: This assumes you are using a LiveCycle ES2 JBoss turnkey installation on Windows.

Note: There seems to be a problem with the Watched Folder end point configuration and I could only get this process to work by using the invoke command from Workbench. I’ll post a fix to the WatchedFolder configuration in another blog entry.

  1. Open a command prompt and navigate to the MySQL installation. This is {LiveCycle ROOT}\mysql\bin. So, in a turnkey installation with the default folders, you would need to go to C:\Adobe\Adobe LiveCycle ES2\mysql\bin
  2. The turnkey installation creates this MySQL database account. user = adobe, password=password. Login with the adobe user using the mysql command line tool. The command is:
    mysql -u adobe -p
    Enter “password” when prompted for the password.
    login-resized.png
  3. Now you can create a test database by entering the command:
    CREATE DATABASE test;
  4. Switch to this database by entering the command:
    use test
    Note: you do not need a semicolon (;) for this command
  5. Now you can create the table by entering the command:
    CREATE TABLE tb_DataExtractionAndUpdateDB(data BLOB);
    Your command line prompt should look like the screen shot below.
    create_db_and_table-resized.png

    Please leave the mysql prompt open so we can verify the process updates the table later on.
  6. Now the database and table are created. You should verify the configuration of the data source (test-ds.xml). This was part of the collateral/resources folder that you downloaded earlier.
    You only need to change the user from root to adobe, if you’re using the default MySQL user and password. If you’ve chosen a different user/password, make sure you update it here. Since I’m using the default adobe user, my configuration looks like this.
    test-ds-resized.png
    This file should be copied to your deploy directory. If you used the default installation settings, this would be:
    C:\Adobe\Adobe LiveCycle ES2\jboss\server\lc_turnkey\deploy
    Note:If you changed anything in this file, then you will need to restart the LiveCycle server (just JBoss, not Windows) for the change to take affect.

  7. Open the DataExtractionAndUpdateDatabase process in LC Workbench.
    process-resized.png
  8. Double-click on the properties for the SQL activity which has the caption “Persist data to Database”.
    process_properties.png
  9. Click on the button with a caption of “…” next to the SQL Statement property.
    sql_default-resized.png
  10. Click on the test button. In the “Test Result” box you should see “Number of rows affected: 1″. Let’s check this in the database. Go back to the mysql command prompt and type in
    select * from tb_DataExtractionAndUpdateDB;

    you should see this result:
    check_results_1.png
  11. We’ve now proven we can insert a null BLOB. Let’s test that one with data will work too. Change the SQL to as shown in the screenshot below and then test it. Don’t save the changes!
    sql_test-resized.png
  12. Now let’s go back to the mysql command prompt and run the query again. You should see this:
    check_results_2.png
  13. Congratulations! You’ve now proven that the sample application works in your turnkey environment.

Updating Hostname of WSDL Connections in XDP with LiveCycle Form Rendering Process

A lot of times form developers develop form designs locally on their machines or on development servers. When dealing with web services, they would use the local or development instances of the web services by creating data connections pointing to WSDL URLs on localhost or dev.server.com. This is perfectly fine until the forms need to be migrated to other systems such as system test, stating or productions. The form developers would need to revisit the forms and update the data connections to point to the appropriate URLs depending on which environment the forms are being migrated to.
This becomes a big time consuming issue on projects dealing with a vast amount of form designs. So recently what I have been recommending my customers is to use a form rendering process that updates the WSDL data connections in the form design automatically on the fly as the form is requested by a user.


How does this work? (Please also refer to the process map below.)

  • The process reads the requested form design resource from the LiveCycle repository.
  • It then copies the content of the form design as XML to process variable and counts the number of WSDL data connections in the form.
  • Then it loops through every WSDL connections and update the domain name including the port with a new domain name extracted from a process variable called targetURL. (This targetURL variable is passed in automatically when you set up your the Render Service setting in your form variable.)
  • It then updates the form design variable with the new XML that has new WSDL information.
  • Finally LiveCycle renders the form design into a PDF. 
wsdl-updating-form-rendering-process.png

Requirements

  • LiveCycle Forms ES server.
  • The form design has to be in an XDP format.
  • The XDP has to be in the LiveCycle repository (e.g. database, Documentum, FileNet, etc.).
  • All web services used in the XDP have to be on the same server as the LiveCycle instance.
  • The only difference between web services on various environments must be the domain name and port. (e.g. http://dev:8080/soap/services/Weather?wsdl and http://staging/soap/services/Weather?wsld – OK but http://dev:8080/soap/services/Weather?wsdl and http:/staging/soap/services/Weather2?wsdl – Not OK)
Download

Download wsdl-updating-form-rendering-process.xml
and import the XML into LiveCycle Workbench as a process.

Further thoughts
  • If you need to reader extend your forms, add a Reader Extensions action at the end of the process map.
  • If your form design is in PDF, you could modify the process map to read the PDF resource from the repository and convert it to XDP.
  • What if you only deploy PDFs to your production system and don’t want to render them only the fly? You could render XDPs to PDFs as a batch process by creating a watched folder endpoint that invokes this form rendering proess.