[x3d-public] stylesheets and X3DJSAIL
Don Brutzman
brutzman at nps.edu
Fri Sep 1 08:08:15 PDT 2017
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
More information about the x3d-public
mailing list