Tech Blog

Archive for January, 2008

Speaking at Capital Area LiveCycle User Group in DC

by Rolando on Jan.30, 2008, under LiveCycle ES

I’ll be speaking in the next LiveCycle User Group meeting in February at the David Packard Conference Center in DC. The topics I’ll be presenting are:

  • Capabilities and usage of Reader Extensions
  • Integrating LiveCycle ES with your backend systems

 

To register and to see more details on this meeting go to the Capital Area LiveCycle User Group website at: http://www.dc-livecycle.com/index.cfm?event=meetings.showMeeting&meetingId=29

Leave a Comment :, , more...

Transfer becoming a Professional Open Source Software

by Rolando on Jan.21, 2008, under Transfer ORM

Mark Mandel has announced today that Transfer ORM will become a Professional Open Source Software.  He wants to dedicate more time to present the framework and travel to conferences (he will remain coding for the framework though).  I’m sure we all agree Mark has done an excellent job developing, maintaining Transfer and keeping up with the developer group, so it is of great pleasure to hear Mark’s new endeavors.

If you wish to become actively involved with Transfer, check this out, Mark is looking for people interested in the following areas:

  • Transfer Support
    A subscription and/or per incident model for support as pertaining to Transfer installation, use and/or any overall issues. 
  • Transfer Training
    A Transfer curriculum that will come in a series of short courses, as well as single/multiple day training programs, covering both on-line training, and in-person training.
  • Transfer Developer Certification
    Much like ColdFusion Developer Certification,a Developer certification give you a listing on the new Transfer site as certified, as well as a spiffy certificate.
  • Transfer Training Certification
    Again, much like ColdFusion Training Certification, this would give you a listing on the Certified Trainers page on the Transfer ORM site, as well as access to the training materials.

If you are interested in any of the above programs you can contact him via the contact form, or the Transfer Google Group

To see the full details and his original post checkout his blog post http://www.compoundtheory.com/?action=displayPost&ID=281

Leave a Comment : more...

Environment Config - A single application config file for your CF Apps

by Rolando on Jan.17, 2008, under EnvironmentConfig

When working with web applications we often, very often, face the problem that the configurations in the various environments where the application will be deployed differ from one another.  This could be anything from different datasource names, security credentials, email server address and most important it could be an application setting to set your application mode (dev mode, live mode).  I say “most important” because if you have an e-commerce this flag could be the difference between charging customers or letting every transaction go through (Free goodies!).

 A way to deal with this problem (I believe the most commonly adopted) is to use a config file to set all this properties.  That’s where the famous “.ini” comes in (or XML), which is that text file with the variables for an environment.  It does the job but now you have a config file per environment and this could be a local, a dev, a staging and a production file.  So, now you have another problem, which is you have to make sure not to replace any of these files every time you do an update to your app (been there, done that).  You can use Ant to avoid making this mistake but you still have multiple copies of the config file lying around.  So, what if you can have a single file that “knows” what properties and values to use depending on the environment that is at?

Rob Gonda and I, created a very simple environment configurator that works of a single XML file and sets the needed properties based on the server is at.  We did this over a year ago but neither of us took the time to blog about it.  Now that I still see developers using multiple config files, I’ve decided post this as a small project on RIAForge.org. I’ve called it Environment Config for lack of creativeness, I guess.

The basics:

It consists of 2 files, one XML file and one CFC.  In the XML file you define all your environments and properties and pass the location of the file to the CFC which will parse your XML file and return a structure with the properties. Is that simple!

The Anatomy of the Environment XML:

The XML structure has two main elements, “default” and “environment”.

Default  - Under default you add those properties that are common to all your environments

Environment – Define one per server environment.

Pattern – Inside Environment you’ll find the Patterns element which contains the Pattern. This is a Regex string that holds the server’s name or a Regex pattern.  So you can enter something like: “^myapp.local” or “^.*.local” to match anything that ends in “.local”.  You can define as many Pattern elements as needed per environment.

Property – Also located inside the Environment is the config element which contains the Property.  You can define as many Property elements as needed per environment.  If you define a property that was defined in the Default element, it will be overwritten by the one in the Environment. 

If you look at the sample environment.xml, you’ll notice that in the production environment, the pattern is defined as ‘.*’ which is pretty much a “catch all” pattern.  I recommend using this for production environments so that later on you don’t get a call from your client asking you why his site is broken since he acquired a new domain.

Thanks for your feedback and suggestions!

Leave a Comment : more...

cfform to generate dynamic PDF forms?

by Rolando on Jan.14, 2008, under ColdFusion

 I’m trying to figure out if there’s a way to generate dynamic PDF forms with ColdFusion or anything at all and ran into this at CFFORM reference page for CF8:

Incorporating interactive fields in PDF forms      

ColdFusion 8 lets you use the cfform tag to create PDF forms that contain static and interactive form fields. The cfform tag must exist within a cfdocument tag (where format=”pdf”). Only one cfform tag can exist within a cfdocument tag.

Completed forms can be posted to the server as an HTTP Post, or the entire PDF can be submitted as binary stream. If the PDF is submitted, you can use the cffile tag to save completed PDF form to a hard drive:

<cffile action=”write” file=”c:\savedpdf.pdf” output=”#PDF.content#”>

The output can be manipulated and extracted by using the tag.

Only the following cfform attributes are supported in generating PDF forms:

  • action
  • format
  • method
  • name
  • onSubmit
  • skin
  • style

To embed an existing PDF form generated by LiveCycle Designer or Acrobat, use the tag.

Then they provide the following example which has some obvious errors:

A simple PDF form     

<cfdocument format="pdf">
    <cfdocumentsection ../>
    ...
    ...
    <cfform type="html/xform">
        <cfinput type="textbox" name="employeeName" value="#fullName#"
readonly="true">
        <cfinput type="textbox" name="employeeID" value="#id#" readonly>
        <cfselect name="contributionPercentage" options="#optionsStruct#"
 required="true">
        <cfinput type="submit" name="SubmitAsHTTPPost">
        <cfinput type="submit" name="SubmitAsPDF" submitType="PDF">
    </cfform>
    ...
    ...
    <cfdocumentsection ../>
</cfdocument>

 

Of course I got all excited about it but after several attempts all I got was a
PDF document that looked like a form but that didn’t work at all. It was merely
a PDF Document.

 So I wonder, is this a big goof from Adobe or can you really create dynamic PDF forms with ColdFusion (without any LiveCycle interaction).

Leave a Comment : more...

LiveCycle Error (ALC-WKS-007-043) / JBoss JMS connection failure

by Rolando on Jan.10, 2008, under LiveCycle ES

Interesting thing I came across in the past couple of days.  At work we have setup a TurnKey installation of LiveCycle ES for testing purposes.  As you might know this means LiveCycle is deployed in JBOSS with MySQL as the backend database.

Well, being a newbie to JBoss and because I did not take the time to Read the JBoss documentation since this was for testing purposes (Who does anyways?) I stumbled upon a merciless error that did not want to go away!

At one point I renamed the default data-source(DefaultDS) to something else and updated several files as mentioned in this tutorial from onjava.com.

Changing the name of the default data-source caused a connection failure since the “DefaultDS” that was being referenced in many files (as I explain below) did not exist. So, the server log was being bombarded by this error every 5 seconds or so! 

“ERROR [org.jboss.ejb.plugins.jms.JMSContainerInvoker] Reconnect failed: JMS

provider failure detected

javax.naming.NameNotFoundException: XAConnectionFactory”

 

I didn’t notice this until LiveCycle Workspace started to fail on every form submitted, showing the following error:

“An error occurred submitting the form (task xxx, form {1}). (ALC-WKS-007-043)”

Explanation:

 By default JBoss uses Hypersonic SQL (HSQL) open-source database which is written entirely in JAVA. The name for the default datasource is “DefaultDS”, this is more important than what one might think since JBoss reference this datasource in many places and several services depends on it. So, changing this default data-source takes quite a few extra steps than setting a regular data-source connection.  Thanks to the guys at Adobe, the turnkey installation of LiveCycle does all the dirty work for you so that JBoss is reconfigured to use MySQL as the default database.  

Fixing the error:

To fix the problem I just restored my original data-source with the proper name and added my own data-sources below just as:

<datasources>
  <local-tx-datasource>
      <jndi-name>DefaultDS</jndi-name>
      <connection-url>jdbc:mysql://localhost:3306/adobe</connection-url>
      <driver-class>com.mysql.jdbc.Driver</driver-class>
      <user-name>adobe</user-name>
      <password>pwd</password>
      <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>

<metadata>
         <type-mapping>mySQL</type-mapping>
      </metadata>
  </local-tx-datasource>

<!– my own ds –>

<local-tx-datasource>
    <jndi-name>MySqlDS</jndi-name>
    <connection-url>jdbc:mysql://localhost:3306/myownDb</connection-url>
    <driver-class>com.mysql.jdbc.Driver</driver-class>
    <user-name>myUser</user-name>
    <password>myPwd</password>
    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>

    <metadata>
       <type-mapping>mySQL</type-mapping>
    </metadata>
  </local-tx-datasource>
</datasources>

– And of course follow the extra steps mentioned at this tutorial.

As simple as it is, no one in the LiveCycle Forum was able to answer this question directly and the only person who had the same error before have opted to reinstall the server from the ground up at that time. I also “google” the JBoss error message and nothing lead me to the solution.  So, here it is in case some other folks out there using LiveCycle end up in the same situation.

By the way, if you wish to change the DefaultDS to something else or you want to change your default database, the steps to take are posted here.

Leave a Comment more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...