[oXygen-sdk] Problem with opening dita maps

Oxygen XML Editor Support support at oxygenxml.com
Fri Feb 7 00:48:35 CST 2014


Hi Jan,

If you are using Oxygen 15.2 just overriding the 
"URLStreamHandler.getContentType()" should be enough.
Also in 15.2 you have the new API method:

> ro.sync.exml.workspace.api.Workspace.open(URL url, String imposedPage, String imposedContentType)

So you can open an URL resource by identifying it as a DITA Map by 
calling it something like:

> Workspace.open(url, null, "application/ditamap");

About your specific questions:

> ·         When I did an “Open map in editor” from the map manager panel I got a popup asking to open in the map manager or editor. Would expect it to open it in the editor immediately.

This happens because you added the "xml" extensions to the list of 
identified DITA Map extensions.

> ·         Is it possible to set the “DITA maps file patterns” through code? Otherwise all users have to do this manually.

It is possible but I would advise against it because of the side effect 
you observed above.
We have API:

> ro.sync.exml.workspace.api.PluginWorkspace.setGlobalObjectProperty(String, Object)

which could be used early when the workspace access plugin is activated 
to force the option like:

> PluginWorkspace.setGlobalObjectProperty("dita.map.file.patterns", "*.ditamap, *.bookmap, *.xml")



Regards,
Radu

Radu Coravu
<oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

On 2/6/2014 4:07 PM, Jan Bevers wrote:
> Hi
>
> I have a couple of questions related to opening DITA maps in combination
> with a custom protocol handler.
>
> In our system Dita maps are stored with an “.xml” extension on the file
> system. No difference with regular topics.
>
> Some stuff I had to do:
>
> ·I had to change a setting in the preferences
> File Types => DITA maps file patterns  =  “*.ditamap, *.bookmap , .xml”
>
> ·Next thing I did was adding following override in my CustomProtocolHandler
>
> @Override
>
>          public String getContentType() {
>
>                  // Set ditamap mimetype for maps
>
>                  // This changes oXygen behavior so it shows the
> question to open in map manager or editor
>
>                  WorkItem workItem =
> AuthoringBridge.getWorkArea().getWorkItemByPath(url);
>
>                  if
> (workItem.getObjectType().equals(SelectableObjectTypes.Map)) {
>
>                      return "application/ditamap";
>
>                  }
>
>              return super.getContentType();
>
>          }
>
> Some questions/remarks I have:
>
> ·When I did an “Open map in editor” from the map manager panel I got a
> popup asking to open in the map manager or editor. Would expect it to
> open it in the editor immediately.
>
> ·Is it possible to set the “DITA maps file patterns” through code?
> Otherwise all users have to do this manually.
>
> Thanks in advance.
>
> Regards
>
> *Jan Bevers |* Developer *|*SDL *| *Content Management Technologies
> Division *| *+32 (0)15 400 970*|* jbevers at sdl.com
> image001
>
>
>
> www.sdl.com
> <http://www.sdl.com/?utm_source=Email&utm_medium=Email%2BSignature&utm_campaign=SDL%2BStandard%2BEmail%2BSignature>
>
> *SDL PLC confidential, all rights reserved.* If you are not the intended
> recipient of this mail SDL requests and requires that you delete it
> without acting upon or copying any of its contents, and we further
> request that you advise us.
> SDL PLC is a public limited company registered in England and Wales.
> Registered number: 02675207.
> Registered address: Globe House, Clivemont Road, Maidenhead, Berkshire
> SL6 7DY, UK.
>
> This message has been scanned for malware by Websense. www.websense.com
> <http://www.websense.com/>
>
>
>
> _______________________________________________
> oXygen-sdk mailing list
> oXygen-sdk at oxygenxml.com
> http://www.oxygenxml.com/mailman/listinfo/oxygen-sdk
>



More information about the oXygen-sdk mailing list