Re: [oXygen-sdk] CMS integration: Resolving images

Then we probably need a RelativeReferenceResolver for our protocol when inserting e.g. images? ------------------------------ Message: 2 Date: Mon, 4 Feb 2013 08:25:33 -0000 From: "Pascal Beutels" <pbeutels@sdl.com> Subject: [oXygen-sdk] CMS integration: Resolving images To: <oxygen-sdk@oxygenxml.com> Message-ID: <D7B7EA2108156F42BEC04DEF9C75D66301303CDC@emeamail0304.global.sdl.corp> Content-Type: text/plain; charset="us-ascii" 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, In our custom protocol handler, how can we know that oXygen is requesting for a referenced resource and not the DITA document (topic, ...) itself? Kind regards, -Pascal ------------------------------ Message: 2 Date: Mon, 4 Feb 2013 08:25:33 -0000 From: "Pascal Beutels" <pbeutels@sdl.com> Subject: [oXygen-sdk] CMS integration: Resolving images To: <oxygen-sdk@oxygenxml.com> Message-ID: <D7B7EA2108156F42BEC04DEF9C75D66301303CDC@emeamail0304.global.sdl.corp> Content-Type: text/plain; charset="us-ascii" 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, I will try to make a list of situation in which Oxygen requests the content for a certain URL (resource): 1) The user wants to open a topic in Oxygen (checked out and opened it or clicked on a link in an already opened topic). There is an useful callback in the WSEditorChangedListener:
WSEditorChangeListener().editorAboutToBeOpenedVeto(URL)
which notifies you before Oxygen will request content for a certain URL in order to open it for editing. After this callback, Oxygen will call your custom protocol handler and request the content for that URL. 2) Oxygen itself wants to retrieve the content of a certain resource for an indirect reason: 2.1) Reference to an image. When the opened XML has a reference to an image, Oxygen will create an URL for the image reference and will ask your custom protocol handler for content. 2.2) Content reference, kind the same as for image, Oxygen will need to parse the target topic and retrieve content from the target element in order to show it in-place in the Author mode. 2.3) In Oxygen 14.2 xref's which point to topics will also display the title of the referenced topic in-place (somehow like a conref). So Oxygen will also request the content of the referenced topic in order to retrieve the target title text. Hope this helps. Regards, Radu Radu Coravu <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 2/8/2013 3:06 PM, Pascal Beutels wrote:
Hi,
In our custom protocol handler, how can we know that oXygen is requesting for a referenced resource and not the DITA document (topic, ...) itself?
Kind regards,
-Pascal
------------------------------
Message: 2 Date: Mon, 4 Feb 2013 08:25:33 -0000 From: "Pascal Beutels" <pbeutels@sdl.com> Subject: [oXygen-sdk] CMS integration: Resolving images To: <oxygen-sdk@oxygenxml.com> Message-ID:
<D7B7EA2108156F42BEC04DEF9C75D66301303CDC@emeamail0304.global.sdl.corp>
Content-Type: text/plain; charset="us-ascii"
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, So the user opens a topic in Oxygen using a custom protocol like: sdl://path/to/topic.dita Then the user calls the "Insert Image" toolbar action. I will assume that you have already added an URL chooser customizer (there is an example in the CustomWorkspaceAccess sample Java class): ReferencesCustomizer.addInputURLChooserCustomizer(InputURLChooserCustomizer) Then the user uses your custom "Browser CMS" action to browse the CMS and choose an image. Your action must return an absolute URL so you can return something like: sdl://GUID-1BA7EFB7-FE54-4643-8AEA-6A2E6A92BD85 Oxygen will try to make this URL relative to the URL of the opened topic, and will fail in this case because the image @href is actually an ID and not a path to a resource. Then indeed you could set a relative references resolver (like the example in the CustomWorkspaceAccess). which when receives a base URL like: sdl://path/to/topic.dita and a child URL like: sdl://GUID-1BA7EFB7-FE54-4643-8AEA-6A2E6A92BD85 actually returns GUID-1BA7EFB7-FE54-4643-8AEA-6A2E6A92BD85. This should probably work. Regards, Radu Radu Coravu <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 2/8/2013 2:57 PM, Pascal Beutels wrote:
Then we probably need a RelativeReferenceResolver for our protocol when inserting e.g. images?
------------------------------
Message: 2 Date: Mon, 4 Feb 2013 08:25:33 -0000 From: "Pascal Beutels" <pbeutels@sdl.com> Subject: [oXygen-sdk] CMS integration: Resolving images To: <oxygen-sdk@oxygenxml.com> Message-ID:
<D7B7EA2108156F42BEC04DEF9C75D66301303CDC@emeamail0304.global.sdl.corp>
Content-Type: text/plain; charset="us-ascii"
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
participants (2)
-
Oxygen XML Editor Support
-
Pascal Beutels