Custom Protocol Plugin error with DITA-OT Transformations

Post here questions and problems related to oXygen frameworks/document types.
ankitr
Posts: 12

Custom Protocol Plugin error with DITA-OT Transformations

Tue Apr 24, 2018 9:41 am

Hi,

I have a Custom Protocol handler plugin. The plugin requires access to several Oxygen SDK classes like UtilAccess, StandalonePluginWorkspace to function. This is primarily required for reading server credentials from options storage.

When I run a transformation on a map opened over my custom protocol, my protocol handler class is called in action to download linked documents. However, it ends up throwing NPE as an instance of StandalonePluginWorkspace is not available. I investigated and it seems that my class is loaded into a new DITA-OT process.

My question is, if my Custom Protocol handler class is called from a new process, how can I obtain the options storage and establish a connection to a server.

Thanks,
Ankit
alex_jitianu
Posts: 656

Re: Custom Protocol Plugin error with DITA-OT Transformations

Wed Apr 25, 2018 11:26 am

Hi Ankit,

Indeed, a DITA-OT transformation is run in a different process in which a StandalonePluginWorkspace instance is not available. I will add an issue to investigate how we can make one available (at least one with partial functionality, like the UtilAccess methods). We will let you know as soon as the issue gets fixed. Meanwhile, I see no other possibility than to create your own implementations for encrypting and storing the user credentials.

Best regards,
Alex
ankitr
Posts: 12

Re: Custom Protocol Plugin error with DITA-OT Transformations

Thu Apr 26, 2018 8:20 am

Hi Alex,

Thanks for your reply.
Could you help me understand how does the new process know to instantiate the CustomURLHandler class for specific URLs? Plain DITA-OT code wouldn't know to do this, so is it run under some shell process that leverages available Oxygen plugins?

Regards,
Ankit
Radu
Posts: 6055

Re: Custom Protocol Plugin error with DITA-OT Transformations

Thu Apr 26, 2018 4:23 pm

Hi Ankit,

When the DITA OT is run from Oxygen, it starts as a separate process. But we set a parameter to it which will instantiate a custom XML parser configuration implementation available in our code. When that XML parser configuration class is first instantiated, it will also load all plugins (like the main Oxygen application usually does) in order for the custom protocols to work. But because this is not an entire Oxygen application, various APIs called (like the one you discovered) might not work.
One workaround for you might be to have your own options storage folder using the "user.home" system property to know where the user home resides, create a folder there and read/write settings to it using a certain custom file format that you decide. Thus the custom protocol would not call any API from that singleton.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Radu
Posts: 6055

Re: Custom Protocol Plugin error with DITA-OT Transformations

Mon Apr 30, 2018 11:56 am

Hi,

One more thing, can you also post the entire stack trace of the NullPointerException?

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Return to “SDK-API, Frameworks - Document Types”

Who is online

Users browsing this forum: No registered users and 1 guest