[x3d-public] stylesheets and X3DJSAIL
John Carlson
yottzumm at gmail.com
Fri Sep 1 11:21:14 PDT 2017
Here’s how I test JavaScript output:
$ java -cp "../../../git/X3DJSAIL/target/X3DJSAIL.jar;saxon9he.jar" net.x3djsonld.data.abox js output.js
$ jjs output.js.intermediate.js
abox.java is attached. You should be able to use any Java file generated from X3dToJava.xslt
target/X3DJSAIL.jar is from: https://github.com/coderextreme/JavaSceneAuthoringInterfaceLibrary clone and build as
sh build.sh
You should run the java and jjs in X3DJSONLD root folder.
Note: it doesn’t work. Not quite sure what to do except complain somewhere.
John
Sent from Mail for Windows 10
From: Don Brutzman
Sent: Friday, September 1, 2017 11:09 AM
To: John Carlson
Cc: X3D Graphics public mailing list; Roy Walmsley
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20170901/867d71a3/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: abox.java
Type: application/octet-stream
Size: 5722 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20170901/867d71a3/attachment-0001.obj>
More information about the x3d-public
mailing list