Extendin the frameworks

Post here questions and problems related to oXygen frameworks/document types.
SNO
Posts: 46
Joined: Mon Oct 01, 2012 3:05 pm

Extendin the frameworks

Post by SNO » Tue Oct 16, 2018 3:02 pm

Hi,
Is there a way to extend the oxygen frameworks without changing the default oxygen author eclipse plugin?
I am using the eclipse version of the newest oxygen author 20.1 and would like to extend the frameworks by adding new Plugins into my RCP CMS Client.
It would be nice if we could point to additional framework folders somehow and you would gather the contents of the folders at runtime in order to have a complete framework.
We do not want to modify your oxygen author 20.1 eclipse plugin in order to manage that.

Regards
Stefan
Stefan Nöbauer
Senior Solution Architect
KGU-Consulting GmbH

Radu
Posts: 7468
Joined: Fri Jul 09, 2004 5:18 pm

Re: Extendin the frameworks

Post by Radu » Tue Oct 16, 2018 3:22 pm

Hi Stefan,

In the Eclipse Preferences->"Oxygen plugin"->"Document Type Association / Locations" page you can specify additional framework locations. In those locations you can save extensions of existing framework configurations:

http://blog.oxygenxml.com/2015/08/docum ... aring.html

Now the problem which remains is how another Eclipse plugin can force set additional framework locations to the Oxygen plugin.
In our plugin.xml we have an extension point which looks like this:

Code: Select all

  <!--The usage in the other plugin.xml is something like:
<extension point="com.oxygenxml.editor.workspaceAccessPlugin">
<implementation class="my.package.WSPluginExtensionImpl"/>;
</extension>

where my.package.WSPluginExtensionImpl extends "com.oxygenxml.workspace.api.eclipse.EclipseWorkspaceAccessPluginExtension".
-->
<extension-point id="workspaceAccessPlugin" name="Workspace Access Plugin Extension"
schema="exsd-schema/workspaceAccessExtension.exsd"/>
so your Eclipse plugin can implement this extension point and receive a notification when the Oxygen Eclipse plugin starts up.
After this you can use our API to force set global settings to the Oxygen plugin, something like:

Code: Select all

    pluginWorkspace.setGlobalObjectProperty(ro.sync.exml.options.APIAccessibleOptionTags.ADDITIONAL_FRAMEWORKS_DIRECTORIES, new String[] {additionalFrameworksFolder.getAbsolutePath()});
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

SNO
Posts: 46
Joined: Mon Oct 01, 2012 3:05 pm

Re: Extendin the frameworks

Post by SNO » Tue May 11, 2021 9:48 am

Hi Radu,

I am facing a classpath problem witht the framework in an additional folder. When I put my new Framework into the framework folder in the Oxygen plugin I just need to add my additional jars into the classpath entry.
Now I moved my framework into an additional folder (user home) and now I have to add all the dependencies even eclipse plugins into the classpath.
Do I miss here something? how can I enter the hole plugin folder as classpah?
Stefan Nöbauer
Senior Solution Architect
KGU-Consulting GmbH

Radu
Posts: 7468
Joined: Fri Jul 09, 2004 5:18 pm

Re: Extendin the frameworks

Post by Radu » Tue May 11, 2021 11:46 am

Hi Stefan,

Can you give me more details, maybe stack traces about what errors you receive when you have only your framework's JAR libraries in the classpath? Do you get these errors when you compile your code or when running the runtime workbench? Maybe send us (support@oxygenxml.com) also your ".framework" framework file....

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

SNO
Posts: 46
Joined: Mon Oct 01, 2012 3:05 pm

Re: Extendin the frameworks

Post by SNO » Tue May 11, 2021 12:11 pm

Hi Radu,

Code: Select all

java.lang.NoClassDefFoundError: org/eclipse/ui/forms/events/IHyperlinkListener
	at de.kgucms.kgu.tps.client.oxygen.extensions.authordndlistener.InsertXMLFragmentDialog.createMultipleChoiseGroup(InsertXMLFragmentDialog.java:144)
	at de.kgucms.kgu.tps.client.oxygen.extensions.authordndlistener.InsertXMLFragmentDialog.createDialogArea(InsertXMLFragmentDialog.java:133)
	at org.eclipse.jface.dialogs.Dialog.createContents(Dialog.java:767)
	at org.eclipse.jface.window.Window.create(Window.java:431)
	at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1094)
	at org.eclipse.jface.window.Window.open(Window.java:788)
	at de.kgucms.kgu.tps.client.oxygen.extensions.authordndlistener.BaseAuthorDnDListener.showInsertXMLFragmentDialog(BaseAuthorDnDListener.java:707)
	at de.kgucms.kgu.tps.client.oxygen.extensions.authordndlistener.BaseAuthorDnDListener.selectInsertLocation(BaseAuthorDnDListener.java:676)
	at de.kgucms.kgu.tps.client.oxygen.extensions.authordndlistener.BaseAuthorDnDListener.insertElements(BaseAuthorDnDListener.java:654)
	at de.kgucms.kgu.tps.client.oxygen.extensions.authordndlistener.BaseAuthorDnDListener.createPlaceholderTags(BaseAuthorDnDListener.java:578)
	at de.kgucms.kgu.tps.client.oxygen.extensions.authordndlistener.BaseAuthorDnDListener.dropGraphicItems(BaseAuthorDnDListener.java:554)
	at de.kgucms.kgu.tps.client.oxygen.extensions.authordndlistener.BaseAuthorDnDListener.authorDrop(BaseAuthorDnDListener.java:298)
	at com.oxygenxml.editor.editors.author.g.drop(Unknown Source)
	at com.oxygenxml.editor.editors.sb.drop(Unknown Source)
	at org.eclipse.swt.dnd.DNDListener.handleEvent(DNDListener.java:94)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4209)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1037)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1046)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:760)
	at org.eclipse.swt.dnd.DropTarget.Drop(DropTarget.java:467)
	at org.eclipse.swt.dnd.DropTarget.Drop_64(DropTarget.java:401)
	at org.eclipse.swt.dnd.DropTarget$1.method6(DropTarget.java:265)
	at org.eclipse.swt.internal.ole.win32.COMObject.callback6(COMObject.java:120)
	at org.eclipse.swt.internal.ole.win32.COM.DoDragDrop(Native Method)
	at org.eclipse.swt.dnd.DragSource.drag(DragSource.java:541)
	at org.eclipse.swt.dnd.DragSource.lambda$0(DragSource.java:380)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4209)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1037)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4026)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3626)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1157)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156)
	at com.teamcenter.rac.contmgmt.client.DcApplication.start(DcApplication.java:218)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1461)
Caused by: java.lang.ClassNotFoundException: org.eclipse.ui.forms.events.IHyperlinkListener
	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
	at ro.sync.basic.classloader.LateDelegationClassLoader.loadClass(LateDelegationClassLoader.java:169)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
	... 54 more
In our Customization we use Eclipse Dialogs.
Stefan Nöbauer
Senior Solution Architect
KGU-Consulting GmbH

Radu
Posts: 7468
Joined: Fri Jul 09, 2004 5:18 pm

Re: Extendin the frameworks

Post by Radu » Wed May 12, 2021 12:52 pm

Hi,

I discussed the problem with Stefan via email, adding my reply here for completion:

Looking at the code on our side, we take all these JAR library references and create a custom Java class loader on our side. The custom class loader has as parent class loader the class loader which loaded our Oxygen Eclipse plugin.

About this particular error:

java.lang.NoClassDefFoundError: org/eclipse/ui/forms/events/IHyperlinkListener


Looking at the Oxygen eclipse plugin MANIFEST.MF:

OXYGEN_ECLIPSE_PLUGIN_FOLDER/META-INF/MANIFEST.MF

at the "Require-Bundle:" value, our plugin by default does not require the "org/eclipse/ui/forms" packages so the class loader that Eclipse creates for loading our plugin does not load those packages in it and they are not accessible to our plugin's classloader which becomes the parent class loader for the framework extension's class loader.

Are you sure this worked when the framework was placed inside the Oxygen frameworks folder? Because I'm not sure how it could have.

Stefan replied that indeed they had previously modified the MANIFEST.MF file from the Oxygen plugin.

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

Post Reply