使用 DXL 导出器将 javascript 脚本库导出到使用 Java 的文件
我正在尝试将 javascript 设计元素导出到 Java 代理中的文件中。问题是,如果我将 DXL 导出器的 ForceNoteFormat 设置为 false,我会得到 DXL 输出,在其中可以找到“javascript”标记内的 javascript 代码。我不能真正使用它,因为它是 UTF-8 编码的,如果发现无效字符(例如“>”),它将破坏脚本在字符串操作中。
所以我的第二次尝试是将 ForceNoteFormat 设置为 true,然后可以在“rawitemdata”标签内访问代码,因此我解码了 Base64 字符串,上面的问题得到了解决,除了它还包含一些我认为的标头信息。
我在这里发现了几乎相同的问题,但它是关于从base64解码的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.html
任何人都可以为我指明正确的方向,如何从导出的 DXL 中获取纯未修改的脚本?
I'm 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 a DXL output where I can find the javascript code inside the 'javascript' tag. I can't really use this because it is UTF-8 encoded, and it will break the script if invalid characters are found, like '>' inside a string manipulation.
So my second try was to set ForceNoteFormat to true, the code is then accessable inside the 'rawitemdata' tag, so I decoded the Base64 string and above problem was solved, except it also includes some header information I think.
I found almost the same problem here, but it is 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.html
Can anyone point me in the right direction how I can get the pure untouched script out of the exported DXL?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要采取不同的方法。使用 Domino Designer 中的 IResource API。这使您可以很好地访问 Js,而无需添加任何内容。OpenNTF 上的导入/导出插件可以做到这一点,因此请查看源代码。
You need to take a different approach. Use the IResource API in Domino Designer. This gives you nice access to the Js without anything sprinkled in. The import/export plugin on OpenNTF does that so look at the source.
斯蒂芬的回答听起来不错。也许您还可以尝试的一件事是 Andre 的 LotusScript 代码。
http://www.openntf .org/internal/home.nsf/project.xsp?action=openDocument&name=LotusScript%20Gold%20Collection
[*] 文件资源:支持从基于文件的设计元素(例如图像、样式表、xpage 等)读取和写入文件数据。此代码适用于当前版本,但一旦 DXL 团队添加对以描述性表示法表示 XPage 的直接支持,可能需要更改。留意这个空间。
Stephan's answer sounds good. Maybe 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 changes once the DXL team adds direct support for representing XPages in descriptive notation. Watch this space.