Posts tagged "LiveCycle ES2"

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.

Where to find more LiveCycle ES2 Sample Applications

I got a request from a customer asking me to help debug a problem they were having with a sample application. I’ll be posting about the solution to this soon.

After a lot of searching I discovered that this was not a sample that you get out of the box with ES2, but rather one you can download separately. To save you all this trouble and to give you some more interesting samples, I’m pasting the link below.

http://help.adobe.com/en_US/livecycle/9.0/samples/lc_sample_service.html