Should Export DITA Map Rewrite Pointers?

I have a DITA map that is stored in the RSuite CMS, where all the URLs are RSuite REST URLs of the form: <map> ... <topicref href="/rsuite/rest/v2/content/binary/alias/sales-demo-forward-01.dita"/> </map> This URL will resolve relative to the RSuite server URL, meaning that if the URL is resolved relative to the URL of the map opened from an absolute RSuite REST URL that it will always work (RSuite does not provide URLs that are hierarchical like a file system because there is no single or necessary containment relationship among objects in RSuite). Because the URLs just work, I can, for example, open a DITA map using a URL like: http://localhost:8080/rsuite/rest/v2/content/element/alias/sample-pubmap-no- keys.ditamap And Oxygen is happy with it--I can perform all read-only operations against the map, including export DITA map. However, when I tried that, just to see what I would get, I noticed that the structure of the files as packaged reflected the relative paths from the map to the topics, e.g. "element/alias/sales-demo-forward-01.dita" for the map and "binary/alias/sales-demo-forward-01.dita" for the topics. However, the URLs in the result were not rewritten to reflect the directory structure, so the map as exported doesn't work because it still uses the absolute paths. Obviously this is a somewhat artificial case, but it does demonstrate that the map exporter is making an assumption about the data that is not warranted in this case, namely that URLs are relative. My question: - Should the map exporter handle this case and rewrite pointers to reflect the location of the targets in the export location? - Should the exporter detect the use of absolute resource parts and make the output structure reflect those paths? That is, should the exported structure have started with /rsuite rather than "sample-pubmap-no-keys"? Cheers, E. -- Eliot Kimber Senior Solutions Architect | RSI Content Solutions Work: 512.554.9368 <http://www.youtube.com/watch?v=Sj4qT8sH42s> Web: http://www.rsicms.com Book: DITA For Practitioners, from XML Press, http://xmlpress.net/publications/dita/practitioners-1/

Hi Eliot, Right now the DITA Map Export facility just copies resources and creates equivalent folder structures considering that the references are already relative, which in the case of CMS's might not be a correct assumption. So between these two:
- Should the map exporter handle this case and rewrite pointers to reflect the location of the targets in the export location?
- Should the exporter detect the use of absolute resource parts and make the output structure reflect those paths? That is, should the exported structure have started with /rsuite rather than "sample-pubmap-no-keys"?
We should probably have also implemented the first approach, forcing the references to be made relative. I added an issue for this, we'll see when we have time to approach it. By the way, some CMSs also have features to export DITA content, does RSuite have one and if so, does it export the content by rewriting the references? Regards, Radu Radu Coravu <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 9/16/2013 11:48 PM, Eliot Kimber wrote:
I have a DITA map that is stored in the RSuite CMS, where all the URLs are RSuite REST URLs of the form:
<map> ... <topicref href="/rsuite/rest/v2/content/binary/alias/sales-demo-forward-01.dita"/>
</map>
This URL will resolve relative to the RSuite server URL, meaning that if the URL is resolved relative to the URL of the map opened from an absolute RSuite REST URL that it will always work (RSuite does not provide URLs that are hierarchical like a file system because there is no single or necessary containment relationship among objects in RSuite).
Because the URLs just work, I can, for example, open a DITA map using a URL like:
http://localhost:8080/rsuite/rest/v2/content/element/alias/sample-pubmap-no- keys.ditamap
And Oxygen is happy with it--I can perform all read-only operations against the map, including export DITA map.
However, when I tried that, just to see what I would get, I noticed that the structure of the files as packaged reflected the relative paths from the map to the topics, e.g. "element/alias/sales-demo-forward-01.dita" for the map and "binary/alias/sales-demo-forward-01.dita" for the topics.
However, the URLs in the result were not rewritten to reflect the directory structure, so the map as exported doesn't work because it still uses the absolute paths.
Obviously this is a somewhat artificial case, but it does demonstrate that the map exporter is making an assumption about the data that is not warranted in this case, namely that URLs are relative.
My question:
- Should the map exporter handle this case and rewrite pointers to reflect the location of the targets in the export location?
- Should the exporter detect the use of absolute resource parts and make the output structure reflect those paths? That is, should the exported structure have started with /rsuite rather than "sample-pubmap-no-keys"?
Cheers,
E.

Yes, I've implemented a general DITA map exporter for use with RSuite CMS and yes, it rewrites all pointers to be appropriate for the export context. It is implemented so that you can replace the built-in export logic to make the exported file organization be whatever you want, with pointers rewritten to match. It's not a quick process as it has to do a lot of data processing to provide a complete solution. That's why I tried the Oxygen map exporter--I was curious to see if it offered a "quick-and-dirty" way to export a map from RSuite. I didn't really expect it to work but I figured it would come pretty close. Cheers, E. On 9/17/13 2:37 AM, "Oxygen XML Editor Support" <support@oxygenxml.com> wrote:
Hi Eliot,
Right now the DITA Map Export facility just copies resources and creates equivalent folder structures considering that the references are already relative, which in the case of CMS's might not be a correct assumption.
So between these two:
- Should the map exporter handle this case and rewrite pointers to reflect the location of the targets in the export location?
- Should the exporter detect the use of absolute resource parts and make the output structure reflect those paths? That is, should the exported structure have started with /rsuite rather than "sample-pubmap-no-keys"?
We should probably have also implemented the first approach, forcing the references to be made relative. I added an issue for this, we'll see when we have time to approach it. By the way, some CMSs also have features to export DITA content, does RSuite have one and if so, does it export the content by rewriting the references?
Regards, Radu
Radu Coravu <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com
On 9/16/2013 11:48 PM, Eliot Kimber wrote:
I have a DITA map that is stored in the RSuite CMS, where all the URLs are RSuite REST URLs of the form:
<map> ... <topicref href="/rsuite/rest/v2/content/binary/alias/sales-demo-forward-01.dita"/>
</map>
This URL will resolve relative to the RSuite server URL, meaning that if the URL is resolved relative to the URL of the map opened from an absolute RSuite REST URL that it will always work (RSuite does not provide URLs that are hierarchical like a file system because there is no single or necessary containment relationship among objects in RSuite).
Because the URLs just work, I can, for example, open a DITA map using a URL like:
http://localhost:8080/rsuite/rest/v2/content/element/alias/sample-pubmap-no- keys.ditamap
And Oxygen is happy with it--I can perform all read-only operations against the map, including export DITA map.
However, when I tried that, just to see what I would get, I noticed that the structure of the files as packaged reflected the relative paths from the map to the topics, e.g. "element/alias/sales-demo-forward-01.dita" for the map and "binary/alias/sales-demo-forward-01.dita" for the topics.
However, the URLs in the result were not rewritten to reflect the directory structure, so the map as exported doesn't work because it still uses the absolute paths.
Obviously this is a somewhat artificial case, but it does demonstrate that the map exporter is making an assumption about the data that is not warranted in this case, namely that URLs are relative.
My question:
- Should the map exporter handle this case and rewrite pointers to reflect the location of the targets in the export location?
- Should the exporter detect the use of absolute resource parts and make the output structure reflect those paths? That is, should the exported structure have started with /rsuite rather than "sample-pubmap-no-keys"?
Cheers,
E.
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
-- Eliot Kimber Senior Solutions Architect | RSI Content Solutions Work: 512.554.9368 <http://www.youtube.com/watch?v=Sj4qT8sH42s> Web: http://www.rsicms.com Book: DITA For Practitioners, from XML Press, http://xmlpress.net/publications/dita/practitioners-1/
participants (2)
-
Eliot Kimber
-
Oxygen XML Editor Support