On April 27, 2024, our Sign-in and Create Account options will be unavailable from 9am-12pm ET. During this maintenance window, developer account access and free trial registration will be unavailable.

callout and database lookups

Hi All:

The templating dev guide says that java-callouts can be used within the datacapture.cfg files.

The example with the CGI callout shows data capture elements being populated with selection options taken from a flat file by a Perl script.

My question is is Perl script and cgi-lookups the only option to accomplish database lookups, or can java and java-lookup be used to accomplish the same thing (populating data capture fields with option fields defined in a database)?

Thanks in advance

Comments

  • Yes, you can use Java callouts much like you can use CGI callouts. Interwoven created a handful of interfaces you can use to sort of (I do use that loosely) manipulate the DOM structure of the DCR. I've only used it for the current <item> node that executes the callout, but I am sure you could use it for all the other <item> nodes as well.

    Steve
  • Hi,

    Thanks for replying to my post.

    I have tried to execute the java callout example provided by Interwoven, but the callout button does not appear on the pop-up data record screen. It seems as though the java callout elements are just ignored. I've also tried the cgi-callout example, and that works perfectly. I've followed all the instructions. Can you think of anything that I might have missed?

    Do you know if java callouts can be used to pull data from database to populate select, checkbox options?

    Thanks in advance.

    Nancy
  • Hi nancy,

    Im presuming you can use Java callouts to populate items from the database as is Java. I havnt done it or heard of anyone doing it but you have two real options here.

    Write a Java class that uses JDBC to create a connection, query a remote database pull back the record set and then use the IW api to populate the fields. This will mean connecting to your database directly from the client machine (ie the users machine running TS Templatiing client), but this may be difficult in a distributed network enviornment (with firewalls and such)

    The other alternative is to run a Java service server side which deals with the actually querying of the database and have a Java client contact the server using RMI (or some other protocol)

    The only problem i can see with these solutions is possibly the sandbox restrictions Java places on applets contacting addresses they were not downloaded from. But this can be overcome by using custom Java security files or by using the Teamsite server to do the database contacting.

    As i said i havnt done it but it should be possible, given a few hours i should be able to figure out more

    Stuart

    Stuart Eccles
    Technical Architect
    Quidnunc
    http://www.quidnunc.com