Moving help content from jsp files to DITA format

Questions about XML that are not covered by the other forums should go here.
jeffcc
Posts: 3
Joined: Mon Sep 29, 2014 6:22 pm

Moving help content from jsp files to DITA format

Post by jeffcc »

I have the task to convert html help content that currently resides in .jsp files to DITA. In the java server pages there are statements such as:

Code: Select all


<%if (!Privileges.isRootOr(curUser, Privileges.DEPLOY_AGENT)){ %>
You do not have permission to view this page. Please contact your System Administrator.
<%} else{ %>
The Config Manager provides administrators ability to ...
Can this if else statement be duplicated in the WebHelp html output to obtain the same effect. Currently the .jsp pages provide the context sensitive help for parts of a Java web application. My goal is to use WebHelp generated from DITA for the context sensitive help.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Moving help content from jsp files to DITA format

Post by sorin_ristache »

Hello,

The Oxygen WebHelp transformation can be customized to include custom code in the WebHelp pages that is interpreted by the browser. The custom code can be any type of code that can be embedded in an XHTML page. For example the default WebHelp transformation includes JavaScript and CSS code that comes in the Oxygen install kit and that is copied to the output directory of the WebHelp transformation. So I suggest translating the conditions and the processing that is now done server side in JSP to client side code like JavaScript or server side code like PHP.

Depending on the extent of JSP constructs in your pages, I suppose with a little effort you can morph the WebHelp pages generated by the stock Oxygen transformation into JSP pages. For example if your current JSP pages include only a limited set of conditions like the above example with the if condition, it may not require much effort to insert the JSP constructs in the WebHelp pages by modifying the XSLT part of the WebHelp transformation. If you want to go this route I can give you more details about what XSLT files you need to modify. Please give more details about the JSP constructs that you need in the WebHelp pages.

Otherwise you can try to translate the JSP constructs to JavaScript and/or PHP and include the translated code in the WebHelp pages seen as general XHTML pages.
Regards,
Sorin

<oXygen/> XML Editor Support
jeffcc
Posts: 3
Joined: Mon Sep 29, 2014 6:22 pm

Re: Moving help content from jsp files to DITA format

Post by jeffcc »

Late response, but now I am interested in how to morph the WebHelp pages generated by the stock Oxygen transformation into JSP pages. There is a limited set of conditions like the example. How can I insert the JSP constructs in the WebHelp output html pages. Which XSLT files need to be modified to insert the jsp constructs in the output. Will this effect the index and search features of webhelp. Do the output files have to be html or can they have a jsp filename extension?
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Moving help content from jsp files to DITA format

Post by sorin_ristache »

jeffcc wrote:How can I insert the JSP constructs in the WebHelp output html pages. Which XSLT files need to be modified to insert the jsp constructs in the output.
That is possible but you have to let go of the search function available on the Search tab because the search feature needs to index the WebHelp pages, that is XHTML pages, that is well-formed XML pages. Inserting the <% or <%= characters in an XHTML page will break the XML well-formed property.

If you can live without the search function then you should look at the XSLT files located in directory OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT/plugins/com.oxygenxml.webhelp/xsl. You can start with createMainFiles.xsl that creates the index.html main file and with dita/dita2webhelp.xsl that creates the content of the right-side panel of the WebHelp pages. You can find also details about what XSLT files you need to modify in the ANT script OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT/plugins/com.oxygenxml.webhelp/xsl/build_dita.xml.
jeffcc wrote:Will this effect the index and search features of webhelp.
Yes, because the search function will not be available anymore, because the WebHelp pages can't be indexed anymore, as I explained above.
jeffcc wrote:Do the output files have to be html or can they have a jsp filename extension?
The file extension is not important as long as it is consistent (all WebHelp pages have the same extension), it is recognized by the web browser on the client side, and it is set also in the args.outext parameter of the WebHelp transformation (which means the file extension must be set as a DITA transformation parameter, not as a type of post-processing external batch process that modifies the extension of all WebHelp pages after they are generated by the DITA transformation).
Regards,
Sorin

<oXygen/> XML Editor Support
Post Reply