Question about making a custom InputURLChooser

Hi I'm working on a custom InputURLChooser. When I click for example the insert image button I can see my custom url chooser in the list. But when I call the getResourceFilters() method I get back an empty array.
From this point of view my custom chooser doesn't know if it needs to filter for images/topics/...
Is there any way to know where my custom chooser is called from (insert content reference, insert image, web link, cross reference...)? So I can make my chooser smart enough. Thanks in advance Jan Bevers | Developer | SDL | Content Management Technologies Division | +32 (0)15 400 970 | jbevers@sdl.com

Hi Jan, This seems to work for me, here's what I tested: I created a workspace access plugin which used the API "addInputURLChooserCustomizer(InputURLChooserCustomizer)" to add a special browse operation:
pluginWorkspaceAccess.addInputURLChooserCustomizer(new InputURLChooserCustomizer() { public void customizeBrowseActions(List<Action> existingBrowseActions, final InputURLChooser chooser) { Action browseCMS = new AbstractAction("CMS") { public void actionPerformed(ActionEvent e) { System.err.println(Arrays.asList(chooser.getResourceFilters())); } }; // Add the CMS action on the first position. existingBrowseActions.add(0, browseCMS); } });
I opened Oxygen, opened a DITA topic and clicked the "Insert Image Reference" action, then I pressed the "CMS" browse action, the resource filter which was printed in the console output was something like:
Image files (GIF, JPG, JPEG, BMP, PNG, SVG, WMF, MATHML...)
By the way, in Oxygen 14.2 there will be an additional API method:
InputURLChooser.getContextDescription()
which will also provide more information about the dialog in which the custom CMS browse action was added (dialog for inserting conrefs or xrefs or topic refs, etc). Regards, Radu Radu Coravu <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 2/13/2013 12:22 PM, Jan Bevers wrote:
Hi
I’m working on a custom InputURLChooser. When I click for example the insert image button I can see my custom url chooser in the list.
But when I call the getResourceFilters() method I get back an empty array. From this point of view my custom chooser doesn’t know if it needs to filter for images/topics/…
Is there any way to know where my custom chooser is called from (insert content reference, insert image, web link, cross reference…)? So I can make my chooser smart enough.
Thanks in advance
*Jan Bevers |* Developer *|*SDL *| *Content Management Technologies Division *| *+32 (0)15 400 970*|* jbevers@sdl.com image001
_______________________________________________ oXygen-sdk mailing list oXygen-sdk@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-sdk
--
participants (2)
-
Jan Bevers
-
Radu Coravu