[x3d-public] stylesheets and X3DJSAIL

John Carlson yottzumm at gmail.com
Fri Sep 1 12:31:49 PDT 2017


Still, I think a JarUriResolver from SO would be better in the Java code.

Pick something and try it, otherwise, I will.  I don’t have a use for the imports right now though, so you would be better. Try HelloWorld.java

John

Sent from Mail for Windows 10

From: John Carlson
Sent: Friday, September 1, 2017 3:16 PM
To: Don Brutzman
Cc: Roy Walmsley; X3D Graphics public mailing list
Subject: RE: stylesheets and X3DJSAIL

This looks like a way to reach inside a jar and pull out a file:

jar:file:/C:/foo.jar!/bar.html

But I am not really sure because this came from a SO question.

John

Sent from Mail for Windows 10

From: John Carlson
Sent: Friday, September 1, 2017 3:07 PM
To: Don Brutzman
Cc: Roy Walmsley; X3D Graphics public mailing list
Subject: RE: stylesheets and X3DJSAIL

A jar URL looks something like this:

jar:http://localhost/webstart/chat/icbmc.jar!/

John

Sent from Mail for Windows 10

From: John Carlson
Sent: Friday, September 1, 2017 3:02 PM
To: Don Brutzman
Cc: Roy Walmsley; X3D Graphics public mailing list
Subject: RE: stylesheets and X3DJSAIL

Note that imports won’t work in the stylesheet.  Not sure what to do, perhaps incorporate one stylesheet in the other.   There may be some other solutions if you google. Maybe give a jar URL on the import.  This impacts 2 stylesheets.

Check here:

https://stackoverflow.com/questions/3699860/resolving-relative-paths-when-loading-xslt-files


John


Sent from Mail for Windows 10

From: John Carlson
Sent: Friday, September 1, 2017 2:24 PM
To: Don Brutzman
Cc: Roy Walmsley; X3D Graphics public mailing list
Subject: RE: stylesheets and X3DJSAIL

Patch attached for X3DJSAIL creation stylesheet.

John

Sent from Mail for Windows 10

From: Don Brutzman
Sent: Friday, September 1, 2017 2:20 PM
To: John Carlson
Cc: Roy Walmsley
Subject: Re: stylesheets and X3DJSAIL

can you please to list without large attachment - thanks

On 9/1/2017 11:06 AM, John Carlson wrote:
> Don,
> 
> Try this file, attached.
> 
> Note that I’ve added some stylesheet code here I think.  Be sure to diff to make sure you get what you want.
> 
> Also, I’ve added code for outputting JavaScript files for nashorn.  Untested. Should not affect anything else.
> 
> Stylesheets are expected to be at lib/stylesheets in the classpath and jar.
> 
> Project is here: https://github.com/coderextreme/JavaSceneAuthoringInterfaceLibrary
> 
> Note that I have your X3DJSAIL stylesheet in src/main/resources/lib/stylesheets.  Mine is in src/main/xslt.
> 
> Plus I think you should be able to unify a lot of stylesheet code. Please diff and then start combining stylesheet code at your convenience.
> 
> John
> 
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
> 
> *From: *Don Brutzman <mailto:brutzman at nps.edu>
> *Sent: *Friday, September 1, 2017 11:09 AM
> *To: *John Carlson <mailto:yottzumm at gmail.com>
> *Cc: *X3D Graphics public mailing list <mailto:x3d-public at web3d.org>; Roy Walmsley <mailto:roy.walmsley at ntlworld.com>
> *Subject: *Re: stylesheets and X3DJSAIL
> 
> Am still trying to figure out the right way to do it, what i've tried so far didn't work.  am thinking/hoping these internal stylesheet assets should be visible to any program that has access to the X3DJSAIL .jar via CLASSPATH.
> 
> Thanks for these excellent leads, I will investigate and test further.
> 
> On 8/31/2017 5:47 PM, John Carlson wrote:
> 
>  > Not sure, but think that:
> 
>  >
> 
>  > ./jsail/Core/X3DObject.java:                    InputStream stylesheetInputStream = getClass().getResourceAsStream(stylesheetJarPath);
> 
>  >
> 
>  > Should be:
> 
>  >
> 
>  > InputStream stylesheetInputStream = getClass().getClassLoader().getResourceAsStream(stylesheetJarPath);
> 
> On 8/31/2017 6:04 PM, John Carlson wrote:
> 
>  > These three lines tell the story why you can’t find the stylesheet in the jar:
> 
>  >
> 
>  > find src/main/java/org/ -type f |xargs grep stylesheetJarPath
> 
>  >
> 
>  > src/main/java/org/web3d/x3d/jsail/Core/X3DObject.java:                  String stylesheetJarPath = "/stylesheets/" + ConfigurationProperties.STYLESHEET_htmlDocumentation;
> 
>  >
> 
>  > src/main/java/org/web3d/x3d/jsail/Core/X3DObject.java:                  InputStream stylesheetInputStream = getClass().getResourceAsStream(stylesheetJarPath);
> 
>  >
> 
>  > src/main/java/org/web3d/x3d/jsail/Core/X3DObject.java:                         errorNotice += "Stylesheet not found in jar: " + stylesheetJarPath + ", ";
> 
>  >
> 
>  > Unless I read this wrong, you are only looking for a single stylesheet in the jar, instead of a variable.
> 
>  >
> 
>  > These are the lines near where you need to work on:
> 
>  >
> 
>  > src/main/java/org/web3d/x3d/jsail/Core/X3DObject.java:                  String stylesheetJarPath = "/stylesheets/" + ConfigurationProperties.STYLESHEET_htmlDocumentation;
> 
>  >
> 
>  > src/main/java/org/web3d/x3d/jsail/Core/X3DObject.java:                  File stylesheetFile = new File("lib/stylesheets/", ConfigurationProperties.STYLESHEET_htmlDocumentation);
> 
>  >
> 
>  > src/main/java/org/web3d/x3d/jsail/Core/X3DObject.java:   * @see ConfigurationProperties#STYLESHEET_JSON
> 
>  >
> 
>  > src/main/java/org/web3d/x3d/jsail/Core/X3DObject.java:                  File stylesheetFile = new File("lib/stylesheets/", ConfigurationProperties.STYLESHEET_JSON);
> 
>  >
> 
>  > src/main/java/org/web3d/x3d/jsail/Core/X3DObject.java:   * @see ConfigurationProperties#STYLESHEET_JSON
> 
>  >
> 
>  > src/main/java/org/web3d/x3d/jsail/Core/X3DObject.java:                  File stylesheetFile = new File("lib/stylesheets/", ConfigurationProperties.STYLESHEET_JAVA);
> 
>  >
> 
>  > src/main/java/org/web3d/x3d/jsail/Core/X3DObject.java:   * @see ConfigurationProperties#STYLESHEET_X3DOM
> 
>  >
> 
>  > src/main/java/org/web3d/x3d/jsail/Core/X3DObject.java:                  File stylesheetFile = new File("lib/stylesheets/", ConfigurationProperties.STYLESHEET_X3DOM);
> 
>  >
> 
>  > src/main/java/org/web3d/x3d/jsail/Core/X3DObject.java:   * @see ConfigurationProperties#STYLESHEET_X3DOM
> 
>  >
> 
>  > src/main/java/org/web3d/x3d/jsail/Core/X3DObject.java:                  File stylesheetFile = new File("lib/stylesheets/", ConfigurationProperties.STYLESHEET_X3DOM);
> 
>  >
> 
>  > John
> 
>  >
> 
> all the best, Don
> 
> -- 
> 
> Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu
> 
> Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
> 
> X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman
> 


all the best, Don
-- 
Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20170901/ffec3b96/attachment-0001.html>


More information about the x3d-public mailing list