CMS integration: Resolving images

Hi, We are creating a plugin for oXygen (14.1) for our DITA based repository. All the content is stored in our repository, also the images, .... When e.g. a topic contains an image element, it only contains the unique identifier: <image href="GUID-1BA7EFB7-FE54-4643-8AEA-6A2E6A92BD85" placement="break"> What would be the best way to resolve this. Are there hooks foreseen in oXygen we can use? Does oXygen require that this image is on the file system (in other words does it expect a file path)? The same for internal links and conrefs. Kind regards, Pascal Beutels

Hi Pascal, Right now how exactly are you opening the XML files from the CMS? Did you create a custom protocol or are you relying on WebDav? Oxygen works inside using Java URLs. Usually references (to images, to links, conrefs) are converted to URLs by using the URL of the current opened resource (topic). Then Oxygen requests the content for these URLs to the URL protocol handler. Most (probably all known) CMS vendors who integrated with Oxygen took this approach:
http://www.oxygenxml.com/doc/ug-oxygen/index.html#tasks/howto-cms-plugin.htm...
Basically you use a plugin extension to define a custom URL protocol like: "sdl://...." Then you a Browse or "Check out" button on the application's toolbar using a Workspace Access plugin extension. The browse button will show the user your custom CMS browser and the user will choose a resource. Then you call our API (ro.sync.exml.workspace.api.Workspace.open(URL)) to open the resource using your custom protocol, something like: "sdl://path/to/resource.dita" Oxygen will request content for that resource from your custom protocol handler and your code will contact the CMS to obtain it. When Oxygen will find relative resources (like the image "GUID-1BA7EFB7-FE54-4643-8AEA-6A2E6A92BD85") it will consider them relative to the opened XML file, will create for them an URL like: "sdl://path/to/GUID-1BA7EFB7-FE54-4643-8AEA-6A2E6A92BD85" and will call again your protocol handler to obtain the content for it. Your custom protocol handler also gets called to produce an output stream if Oxygen wants to save the content of the edited resource. In dialogs in which the user needs to browse again the CMS to look for a certain resource (like Insert Image, Insert Conref, Insert Cross Reference) we have API which allows you to add a custom action for browsing the CMS:
ro.sync.exml.workspace.api.standalone.ReferencesCustomizer.addInputURLChooserCustomizer(InputURLChooserCustomizer)
This API is used in the sample Java class "CustomWorkspaceAccessPluginExtension" present in our Plugins SDK as a sample of Workspace Access plugin. Regards, Radu Radu Coravu <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 2/4/2013 10:25 AM, Pascal Beutels wrote:
Hi,
We are creating a plugin for oXygen (14.1) for our DITA based repository.
All the content is stored in our repository, also the images, ….
When e.g. a topic contains an image element, it only contains the unique identifier: <image href="GUID-1BA7EFB7-FE54-4643-8AEA-6A2E6A92BD85" placement="break">
What would be the best way to resolve this. Are there hooks foreseen in oXygen we can use? Does oXygen require that this image is on the file system (in other words does it expect a file path)?
The same for internal links and conrefs.
Kind regards,
Pascal Beutels
_______________________________________________ oXygen-sdk mailing list oXygen-sdk@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-sdk
participants (2)
-
Oxygen XML Editor Support
-
Pascal Beutels