Undetected custom DITAExtensionsBundle

Post here questions and problems related to oXygen frameworks/document types.
Vince
Posts: 15
Joined: Wed Dec 03, 2014 11:25 am

Undetected custom DITAExtensionsBundle

Post by Vince » Tue May 18, 2021 5:58 pm

Hi,

I have created a plugin for Oxygen XML Editor with custom DITAExtensionsBundle and AuthorDnDListener classes.

Code: Select all

public class CustomDITAExtensionsBundle extends DITAExtensionsBundle {
    
    @Override
    public AuthorDnDListener createAuthorAWTDndListener() {
        return new CustomAuthorAWTDnDListener();
    }
}

Code: Select all

public class CustomAuthorAWTDnDListener implements AuthorDnDListener {
    ....
}
Then, I extend the DITA framework.
I specify "Use parent classloader from plugin with ID : <my plugin ID>" in the Classpath tab.
And go to Extensions tab.

If I choose for Extension bundle, CustomDITAExtensionsBundle isn't detected.
If I choose for an Author drag and drop listener, CustomAuthorAWTDnDListener class is detected.

If I add the dita.jar to my plugin libs, CustomDITAExtensionsBundle is now detected.

Is there a way to detect my custom DITA bundle without adding dita.jar to my plugin dependencies ?

Thanks,
Vince

alex_jitianu
Posts: 848
Joined: Wed Nov 16, 2005 11:11 am

Re: Undetected custom DITAExtensionsBundle

Post by alex_jitianu » Wed May 19, 2021 5:51 pm

Hello,

DITAExtensionsBundle class is present inside dita.jar. If dita.jar is not present in the classpath then CustomDITAExtensionsBundle can't be loaded either because it extends DITAExtensionsBundle. Is there a reason not to add it inside the plugin classpath?

Best regards,
Alex

Vince
Posts: 15
Joined: Wed Dec 03, 2014 11:25 am

Re: Undetected custom DITAExtensionsBundle

Post by Vince » Wed May 19, 2021 6:45 pm

Hello,

Thanks for the fast reply!

I see in a topic of this forum it isn't a good practice to distribute the dita.jar inside our plugin for many reasons:
* because it could lead to class loader issues
* as Oxygen provides the dita.jar at runtime, we just need it at compile time

Last point could be checked in Extensions tab, dita.jar is listed in the classpath (file:/opt/oxygen/frameworks/dita/dita.jar) and DITAExtensionsBundle is detected.

Best regards,
Vince

alex_jitianu
Posts: 848
Joined: Wed Nov 16, 2005 11:11 am

Re: Undetected custom DITAExtensionsBundle

Post by alex_jitianu » Thu May 20, 2021 9:40 am

Hello,

The dita.jar is referred and shipped inside the DITA framework, it is not present inside Oxygen's global classpath. If your framework is an extension of the DITA framework or it ships the dita.jar file itself, then the plugin should not put the dita.jar file in it's classpath.
Then, I extend the DITA framework.
I specify "Use parent classloader from plugin with ID : <my plugin ID>" in the Classpath tab.
Anyway, I did the same scenario and my extension bundle was detected. In fact, if i look inside the Classpath tab of my framework extension, I notice an entry: ${baseFramework}/dita.jar. So dita.jar file is indeed present inside the classpath. Is it there in your case?

Best regards,
Alex

Vince
Posts: 15
Joined: Wed Dec 03, 2014 11:25 am

Re: Undetected custom DITAExtensionsBundle

Post by Vince » Thu May 20, 2021 4:36 pm

Yes, dita.jar file is present inside the Classpath tab. I notice the entry ${baseFramework}/dita.jar too.

It is listed in the Classpath field inside the Extensions bundle modal view.

Regards,
Vince

alex_jitianu
Posts: 848
Joined: Wed Nov 16, 2005 11:11 am

Re: Undetected custom DITAExtensionsBundle

Post by alex_jitianu » Thu May 20, 2021 5:08 pm

Hi,

Could you send me the plugin on support@oxygenxml.com? After I reproduce the situation and understand what's happening I will remove it from my system.

Best regards,
Alex

Post Reply