Export javascript script library using DXL export to file using Java

I am trying to export a javascript design element to a file in a Java agent. The problem is that if I set the ForceNoteFormat of the DXL exporter to false, I get DXL output where I can find the javascript code inside the javascript tag. I cannot use this because it is encoded with UTF-8 and it breaks the script if invalid characters are found, for example '>' inside string manipulation.

So, my second attempt was to set ForceNoteFormat to true, then the code is available in the "rawitemdata" tag, so I decrypted the Base64 string and the problem was solved, in addition, it also contains some header information, I think.

I found almost the same problem here, but it's about extracting images from base64 decoded DXL: http://lekkimworld.com/2006/03/17/helping_out_a_fellow_blogger_getting_the_actual_bytes_of_an_image_resource_a_lesson_in_the_intricacies_of_dxl_representation

Can someone point me in the right direction, how can I get a clean pristine script from exported DXL?

+4
source share
2 answers

You need to take a different approach. Use the IResource API in Domino Designer. This gives you good access to Js without any packages. The OpenNTF import / export plugin does this to look at the source.

+3
source

Stefan's answer sounds good. Perhaps one more thing you could try is the LotusScript code from Andre.

http://www.openntf.org/internal/home.nsf/project.xsp?action=openDocument&name=LotusScript%20Gold%20Collection

[*] FileResource: supports reading and writing file data from file-based design elements such as image, stylesheet, xpage, ... This code will work for current versions, but may need to be changed after the DXL command adds a direct support for representing XPages in descriptive notation. See this place.

+1
source

Source: https://habr.com/ru/post/1394044/


All Articles