Page 1 of 1

Custom Protocol Plugin error with DITA-OT Transformations

Posted: Tue Apr 24, 2018 9:41 am
by ankitr
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

Re: Custom Protocol Plugin error with DITA-OT Transformations

Posted: Wed Apr 25, 2018 11:26 am
by alex_jitianu
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

Re: Custom Protocol Plugin error with DITA-OT Transformations

Posted: Thu Apr 26, 2018 8:20 am
by ankitr
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

Re: Custom Protocol Plugin error with DITA-OT Transformations

Posted: Thu Apr 26, 2018 4:23 pm
by Radu
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

Re: Custom Protocol Plugin error with DITA-OT Transformations

Posted: Mon Apr 30, 2018 11:56 am
by Radu
Hi,

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

Regards,
Radu