Catalog and DnD customization using own plugin

Oxygen general issues.
empmm
Posts: 2
Joined: Thu Mar 31, 2011 12:14 pm

Catalog and DnD customization using own plugin

Post by empmm »

Hi,

I'm currently evaluating an Oxygen Author integration with our CMS. Since the CMS is Java-based too, this is quite straightforward. What I'm basically doing is writing an own plugin and launching Author using the command line, providing the plugin path explicitly. This way, our customers don't need to modify their Author installations or settings.

Up until now most of the things on my Boss' wishlish seem to work quite well, but two issues still remain:
  1. I could not find a way to modify the XML catalog using command line options or hooking into something from our plugin.
  2. Dragging a file from our CMS to Author always resulted in a file transfer operation, which did not trigger our own custom protocol handler in the plugin.
Any idea, advice or insight on how to solve these issues is greatly appreciated!

Regards,
Matthias
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Catalog and DnD customization using own plugin

Post by Radu »

Hi Matthias,
I could not find a way to modify the XML catalog using command line options or hooking into something from our plugin.
Do you want to contribute to the catalogs in Oxygen without modifying anything the in installation directory?

We do not have the plugin API which would allow you to add your own Entity and URI Resolvers. But this seems like a good improvement for a future version, I noted it down.

Other approaches:
Create your own custom Document Type in the Oxygen Preferences->Document Types Association page which would contain a reference to an additional catalog, save this document type as an external framework directory in the OXYGEN_INSTALL_DIR
frameworks
directory. Then automatically copy this additional framework directory to the OXYGEN_INSTALL/frameworks directory from each user's installation. But this would mean modifying the user's installation.

or:

Add a new catalog entry in the Oxygen Preferences, pass the page to Project options (which will save them in the project .xpr file) and then have a procedure for users to open the custom project in the Oxygen Project view before working with the CMS.
Dragging a file from our CMS to Author always resulted in a file transfer operation, which did not trigger our own custom protocol handler in the plugin.
You probably use the DataFlavor.javaFileListFlavor flavor in the transferable and Oxygen prefers it and interprets the transferable as a list of local Java Files.

If the transferable would not support the DataFlavor.javaFileListFlavor flavor then Oxygen would also look if the transferable supports this type of flavor:

Code: Select all

DataFlavor FLAVOR_LIST_OF_STRINGS = new DataFlavor(List.class, "files-as-URLs");
looking for a List of String resources which will be interpreted as URLs.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
empmm
Posts: 2
Joined: Thu Mar 31, 2011 12:14 pm

Re: Catalog and DnD customization using own plugin

Post by empmm »

Hi Radu,
Do you want to contribute to the catalogs in Oxygen without modifying anything the in installation directory?
That was indeed one of the preconditions. I came up with a third solution, which involves opening the files using a custom protocol file name on the command line (which we needed anyway):

Code: Select all

java.exe ro.sync.exml.Oxygen ownprotocol:C:\Temp\file.xml
By handling the protocol in the plugin using a custom URLStreamHandler, we can also process references to additional files (like DTDs!), since they become prefixed with the same protocol automatically.

That didn't seem very robust to me, so I hoped this could be replaced by some more "official" way, which may exist in a future version, according to your answer.
You probably use the DataFlavor.javaFileListFlavor flavor in the transferable and Oxygen prefers it and interprets the transferable as a list of local Java Files.
Our CMS is based on Eclipse RCP, so I tried using URLTransfer and FileTransfer, but only the latter works (using prefixed file names as well). Unfortunately, that breaks our integration with other XML editors, which would result in some additional work to fix these.

We would have been more happy if our customer would use the Eclipse version of Author, but they use the editor independently from our integration as well, so we have to manage the Standalone installation of Author.

Regards,
Matthias
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Re: Catalog and DnD customization using own plugin

Post by george »

Hi,

We'll look into the problem that dragging from Eclipse a resource with URLTransfer to Oxygen standalone does not open the URL in Oxygen.

Regards,
Radu
George Cristian Bina
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Catalog and DnD customization using own plugin

Post by Radu »

Hi,

This problem:
I could not find a way to modify the XML catalog using command line options or hooking into something from our plugin.
will be addressed in Oxygen 13 (which will be released shortly) as we added API for adding your custom priority entity and URI resolvers to the editor from a plugin.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Catalog and DnD customization using own plugin

Post by Radu »

Correction:

The API for setting the URI and entity resolvers is only available in the Oxygen standalone version. We do not yet have this available in the Oxygen Eclipse plugin version.

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