Expand my Community achievements bar.

Automatic change of fragment reference in a form

Avatar

Former Community Member

Hi,

We were using a single LiveCycle application and folders inside to hold forms and fragments. Now the fragments are moved to another Aapplication. Is there any way to automatically change the reference of a fragment used in all forms.

Any help at the earliest will be appreciated.

Thnaks in Advance,

Shabeer

8 Replies

Avatar

Former Community Member

Nope ...you will have to go back into the form design and relink the fragments from their new location.

Paul

Avatar

Former Community Member

Whether script or Java code help for changing the reference to other location?

Avatar

Former Community Member

Surely you can create a javascript that does the changing for you. You'll still need to open each form, insert the script (set to server-side, running on form open), save the form locally (as dynamic PDF), close the form, open the form and replace the old xdp.

Avatar

Former Community Member

That will not work ....the references to the fragment are resolved before your script woudl even run. Along the same lines you woudl

have to modify the references in the XDP template before the form is rendered. You coudl do this with XSLT

but the amount of effort may be more than it is worth.

paul

Avatar

Former Community Member

I think it will work - it's a two-stepper: LC won't find the fragments the first time you open the form to add the script. Once you've added it, saved, closed and opened the form, the script kicks in to change all the references. References are followed before the script runs (set to server-side - important), so you might have to save and open the form a third time just to check that it all worked out.

The technique is described here:

http://blogs.adobe.com/formfeed/2009/05/template_transformation.html

Avatar

Former Community Member

Please note that my form and fragments are in different applications. And also the form need to refer to fragments in different applications.

Whether the above technique work for this situation?

Avatar

Former Community Member

Hi All,

Thanks for your helps and support.

I solved the problem by creating  a .Net application. The working of the application is as follows.

1. I put all the XDP files in a local folder.

2. Get the new root path for one fragment by putting a form in the LiveCycle server.

3. Get the xml file for the XDP using the stream reader through .net/java code.

4. Iterate through the file for the fragment references.

5. update the the fragment path with the new path.

Put step 3-5 in a loop to change the reference for all files, it will take only few minutes to re-reference thousands of files.

Regards,

Shabeer