Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Export Records and Insert File script steps, using CWP


This topic is 7068 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I have recently had to move from using Remote Access to having an xsl front end for an application. One feature did the following:

Based on a set of data, call the Export Records script step (using an xsl file), to create an rtf file.

Then, call the Insert File script to put the file into a container field.

I am having real trouble reproducing this functionality using CWP. I am using XSLT to create the HTML front end for my application, but cannot seem to find a way to get this functionality. I know the two script steps in question are not web compatible...

Any suggestions?

Posted (edited)

There is bad and good news for your interesting question.

First the bad:

AFAIK, with XML/XSLT CWP, you can only read out the contents of a container field, but not add contents to a container field. See p. 24 of the FMSA CWP Guide. I don't see there any possibility to use -edit or -new, and also tried out some commands with no luck.

Then the good:

There are various options with CWP, and you have to rethink your solution. Think web only.

Option 1) Why must the file be stored in general? Can it be generated on the fly with the data in the database? Or is that too slow?

E.g. when the user clicks in the browser a link which prepares the data and outputs it as XML result set tree, which is transformed to your rtf data. This data is displayed then in the browser (either the source code is interpreted or not by the browser) and can be saved with "File > Save page as ...".

What you need is a

as top-level declaration in your XSLT file.

Option 2)

If a file must be saved, must it be saved in the container field? Can it be saved also on the webserver, and downloaded from there, and a simple text or calculation field gives a reference to it?

For this you need some Xalan extension functions (see on the Apache Xalan website for documentation). The code would look like:

<?xml version="1.0"?>

your XML/XSLT code here

I have tried this, and it works fine. However, you can't use a relative file path, because http://yourhost/fmi/xml is a virtual path and Xalan then does not know where to put the file. The absolute path is absolute in its terms, e.g. it's absolute with respect to the root of the filesystem to which Xalan refers. The best is probably to use a writable subfolder of your web pages folder.

Option 3)

If the data (not file) must be saved in the database, why use a container field, if the data is text-based?

E.g. the resulting RTF data will populate a form (e.g. a text or textarea field) that by way of JavaScript (can be client- or serverside) will be posted to the database.

Option 4)

Last resort to PHP :smirk:

Martin

Edited by Guest

This topic is 7068 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.