Support for jar: URNs?

I'm trying to set up an entity resolution catalog that resolves to files in a jar file. I can get it to work as expected if the URL to the jar is absolute, e.g.: <uri name="rsuite:/res/plugin/dita4publishers/net.sourceforge.dita4publishers.com mon.xslt/xsl/lib/relpath_util.xsl" uri="jar:file:///Users/ekimber/workspace/rsuite-dita-support-quickfix/java/l ib/dita4publishers-rsuite-plugin.jar!..."/> However, a relative URL (relative to the catalog), does not work. Is it possible for Oxygen to make a relative URL part of a jar: URN resolve relative to the catalog? This is to support development of XSLTs that import modules that, when deployed into the RSuite CMS, will be referenced by an RSuite-specific URN. The catalog allows the XSLTs to be developed without having to swap different URNs in and out. I'm trying to set up a system whereby developers can get the jar with the included modules from Ivy and then, by using an invariant catalog, have the inclusions work. I can't think of another way of doing it. Thanks, E. -- Eliot Kimber Senior Solutions Architect "Bringing Strategy, Content, and Technology Together" Main: 512.554.9368 www.reallysi.com www.rsuitecms.com

Seeing a non-obvious result for zip/jar URNs. I have this in my catalog: This one works with ctrl+Enter: <uri name="rsuite:/res/plugin/dita4publishers/org.dita2indesign.dita2indesign/xsl /topic2article.xsl" uri="jar:file:///Users/ekimber/workspace/rsuite-dita-support-quickfix/java/l ib/dita4publishers-rsuite-plugin.jar!/WebContent/org.dita2indesign.dita2inde sign/xsl/topic2article.xsl"/> This one does not: <uri name="rsuite:/res/plugin/dita4publishers/xslt/word2dita/docx2dita.xsl" uri="jar:file:///Users/ekimber/workspace/rsuite-dita-support-quickfix/java/l ib/dita4publishers-rsuite-plugin.jar!/WebContent/net.sourceforge.dita4publis hers.word2dita/xsl/docx2dita.xsl"/> This is the location of the second one as reported by the Oxygen Archive Viewer: zip:file:///Users/ekimber/workspace/rsuite-dita-support-quickfix/java/lib/di ta4publishers-rsuite-plugin.jar!/WebContent/net.sourceforge.dita4publishers. word2dita/xsl/docx2dita.xsl The only difference I can see between these two last items is "jar:" vs. "zip:". If I change "jar:" to "zip:" then the second one works with ctrl+Enter. I'm curious as to why zip would work and jar would not in this case--I thought they were essentially synonymous. Cheers, Eliot On 11/14/11 12:30 PM, "Eliot Kimber" <ekimber@reallysi.com> wrote:
I'm trying to set up an entity resolution catalog that resolves to files in a jar file.
I can get it to work as expected if the URL to the jar is absolute, e.g.:
<uri name="rsuite:/res/plugin/dita4publishers/net.sourceforge.dita4publishers.com mon.xslt/xsl/lib/relpath_util.xsl"
uri="jar:file:///Users/ekimber/workspace/rsuite-dita-support-quickfix/java/l ib/dita4publishers-rsuite-plugin.jar!..."/>
However, a relative URL (relative to the catalog), does not work.
Is it possible for Oxygen to make a relative URL part of a jar: URN resolve relative to the catalog?
This is to support development of XSLTs that import modules that, when deployed into the RSuite CMS, will be referenced by an RSuite-specific URN. The catalog allows the XSLTs to be developed without having to swap different URNs in and out. I'm trying to set up a system whereby developers can get the jar with the included modules from Ivy and then, by using an invariant catalog, have the inclusions work.
I can't think of another way of doing it.
Thanks,
E.
-- Eliot Kimber Senior Solutions Architect "Bringing Strategy, Content, and Technology Together" Main: 512.554.9368 www.reallysi.com www.rsuitecms.com
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
-- Eliot Kimber Senior Solutions Architect "Bringing Strategy, Content, and Technology Together" Main: 512.554.9368 www.reallysi.com www.rsuitecms.com

Hi Eliot, About this remark:
I'm curious as to why zip would work and jar would not in this case--I thought they were essentially synonymous.
The "jar" protocol is implemented in the Java libraries by default, it has only read access, so you cannot write to the resource. The "zip" protocol is implemented entirely by us using a third party library, it has full write access + browsing of the archive structure. So the implementations are very different but they should behave the same, the URL syntax is the same except the protocol part... I do not quite know why the Ctrl-Enter does not work in the second case, does Oxygen show you any kind of error message? I'll also try to reply to your first email. Regards, Radu On 11/14/2011 9:48 PM, Eliot Kimber wrote:
Seeing a non-obvious result for zip/jar URNs.
I have this in my catalog:
This one works with ctrl+Enter:
<uri name="rsuite:/res/plugin/dita4publishers/org.dita2indesign.dita2indesign/xsl /topic2article.xsl"
uri="jar:file:///Users/ekimber/workspace/rsuite-dita-support-quickfix/java/l ib/dita4publishers-rsuite-plugin.jar!/WebContent/org.dita2indesign.dita2inde sign/xsl/topic2article.xsl"/>
This one does not:
<uri name="rsuite:/res/plugin/dita4publishers/xslt/word2dita/docx2dita.xsl"
uri="jar:file:///Users/ekimber/workspace/rsuite-dita-support-quickfix/java/l ib/dita4publishers-rsuite-plugin.jar!/WebContent/net.sourceforge.dita4publis hers.word2dita/xsl/docx2dita.xsl"/>
This is the location of the second one as reported by the Oxygen Archive Viewer:
zip:file:///Users/ekimber/workspace/rsuite-dita-support-quickfix/java/lib/di ta4publishers-rsuite-plugin.jar!/WebContent/net.sourceforge.dita4publishers. word2dita/xsl/docx2dita.xsl
The only difference I can see between these two last items is "jar:" vs. "zip:".
If I change "jar:" to "zip:" then the second one works with ctrl+Enter.
I'm curious as to why zip would work and jar would not in this case--I thought they were essentially synonymous.
Cheers,
Eliot
On 11/14/11 12:30 PM, "Eliot Kimber"<ekimber@reallysi.com> wrote:
I'm trying to set up an entity resolution catalog that resolves to files in a jar file.
I can get it to work as expected if the URL to the jar is absolute, e.g.:
<uri name="rsuite:/res/plugin/dita4publishers/net.sourceforge.dita4publishers.com mon.xslt/xsl/lib/relpath_util.xsl"
uri="jar:file:///Users/ekimber/workspace/rsuite-dita-support-quickfix/java/l ib/dita4publishers-rsuite-plugin.jar!..."/>
However, a relative URL (relative to the catalog), does not work.
Is it possible for Oxygen to make a relative URL part of a jar: URN resolve relative to the catalog?
This is to support development of XSLTs that import modules that, when deployed into the RSuite CMS, will be referenced by an RSuite-specific URN. The catalog allows the XSLTs to be developed without having to swap different URNs in and out. I'm trying to set up a system whereby developers can get the jar with the included modules from Ivy and then, by using an invariant catalog, have the inclusions work.
I can't think of another way of doing it.
Thanks,
E.
-- Eliot Kimber Senior Solutions Architect "Bringing Strategy, Content, and Technology Together" Main: 512.554.9368 www.reallysi.com www.rsuitecms.com
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
-- Regards, Radu Radu Coravu <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com

Hi Eliot, If the catalog file is located directly on the local drive, relative references to it are interpreted as having the same protocol (which is the "file" protocol). I consider this to be correct. I understand that you would like relative references like this: "test.zip!/catalog.xml" to be expanded to absolute URLs having the protocol something like "zip:file" but this is not quite easy or correct to accomplish and would require some patches to the Xerces catalog resolver. What I tested and could be used as a workaround: Have the catalog file located directly inside the zip (or jar). For example in the catalogs list I referenced it like this:
zip:file:/D:/projects/eXml/samples/dita/flowers/concepts/test.zip!/catalog.xml
and it contained a relative reference like this:
<uri name="http://test/res/plugin/dita4publishers/net.sourceforge.dita4publishers.commo..." uri="personal.xsl"/>
which got solved also inside the same zip. Regards, Radu Radu Coravu <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 11/14/2011 8:30 PM, Eliot Kimber wrote:
I'm trying to set up an entity resolution catalog that resolves to files in a jar file.
I can get it to work as expected if the URL to the jar is absolute, e.g.:
<uri name="rsuite:/res/plugin/dita4publishers/net.sourceforge.dita4publishers.com mon.xslt/xsl/lib/relpath_util.xsl"
uri="jar:file:///Users/ekimber/workspace/rsuite-dita-support-quickfix/java/l ib/dita4publishers-rsuite-plugin.jar!..."/>
However, a relative URL (relative to the catalog), does not work.
Is it possible for Oxygen to make a relative URL part of a jar: URN resolve relative to the catalog?
This is to support development of XSLTs that import modules that, when deployed into the RSuite CMS, will be referenced by an RSuite-specific URN. The catalog allows the XSLTs to be developed without having to swap different URNs in and out. I'm trying to set up a system whereby developers can get the jar with the included modules from Ivy and then, by using an invariant catalog, have the inclusions work.
I can't think of another way of doing it.
Thanks,
E.

Sweet--it didn't even occur to me to put the catalog in the Zip file. My workaround yesterday was to use Ant to rewrite the catalog to add the ${base.dir} location since I know where the jar file will be relative to the catalog in the source tree. But having the catalog in the source is even easier. I also wonder if zip:file://../../foo/catalog.xml would work? I guess I can do that experiment. Cheers, E. On 11/15/11 6:24 AM, "Radu Coravu" <radu_coravu@sync.ro> wrote:
Hi Eliot,
If the catalog file is located directly on the local drive, relative references to it are interpreted as having the same protocol (which is the "file" protocol). I consider this to be correct. I understand that you would like relative references like this: "test.zip!/catalog.xml" to be expanded to absolute URLs having the protocol something like "zip:file" but this is not quite easy or correct to accomplish and would require some patches to the Xerces catalog resolver.
What I tested and could be used as a workaround: Have the catalog file located directly inside the zip (or jar). For example in the catalogs list I referenced it like this:
zip:file:/D:/projects/eXml/samples/dita/flowers/concepts/test.zip!/catalog.xm>> l
and it contained a relative reference like this:
<uri
name="http://test/res/plugin/dita4publishers/net.sourceforge.dita4publishers. common.xslt/xsl/lib/relpath_util.xsl" uri="personal.xsl"/>
which got solved also inside the same zip.
Regards, Radu
Radu Coravu <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com
On 11/14/2011 8:30 PM, Eliot Kimber wrote:
I'm trying to set up an entity resolution catalog that resolves to files in a jar file.
I can get it to work as expected if the URL to the jar is absolute, e.g.:
<uri name="rsuite:/res/plugin/dita4publishers/net.sourceforge.dita4publishers.com mon.xslt/xsl/lib/relpath_util.xsl"
uri="jar:file:///Users/ekimber/workspace/rsuite-dita-support-quickfix/java/l ib/dita4publishers-rsuite-plugin.jar!..."/>
However, a relative URL (relative to the catalog), does not work.
Is it possible for Oxygen to make a relative URL part of a jar: URN resolve relative to the catalog?
This is to support development of XSLTs that import modules that, when deployed into the RSuite CMS, will be referenced by an RSuite-specific URN. The catalog allows the XSLTs to be developed without having to swap different URNs in and out. I'm trying to set up a system whereby developers can get the jar with the included modules from Ivy and then, by using an invariant catalog, have the inclusions work.
I can't think of another way of doing it.
Thanks,
E.
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
-- Eliot Kimber Senior Solutions Architect "Bringing Strategy, Content, and Technology Together" Main: 512.554.9368 www.reallysi.com www.rsuitecms.com
participants (2)
-
Eliot Kimber
-
Radu Coravu