[x3d-public] Errors in my X3DJSAIL HelloWorldProgramOutput.java command line, generating XML, JSON and JS

John Carlson yottzumm at gmail.com
Thu Jan 11 16:34:47 PST 2018


I reverted my change to JavaScriptSerializer.js to get the \’s right.  Now what’s left is the missing MetadataString in the JSON file I think.   And various spaces in the comments.  Could be my issue.

I also added the X3D source file to the command line to get the JSON, JS and XML output.  I must have been dreaming some of that code I thought appeared in HelloWorldProgramOutput.java that I though would handle this (setting the loadedX3dModel in CommandLine....  hmm.

I guess I’m fairly happy, but I have changes to CreateX3dSceneAccessInterfaceJava.xslt that I don’t think were applied yet.  Should I resubmit them? I also have a new nashorn.zip  Is nashorn checked into SVN yet?

John

Sent from Mail for Windows 10

From: John Carlson
Sent: Thursday, January 11, 2018 2:10 PM
To: Don Brutzman
Cc: X3D Graphics public mailing list
Subject: Re: Errors in my X3DJSAIL HelloWorldProgramOutput.java command line,generating XML, JSON and JS

I don't see as why I need the original source file, as the X3DObject is loaded into memory and passed to CommandLine.   Loading an XML file was not required with the old handleArguments(), and I think a test to see whether the object is loaded into memory may be all that is required.  I will look at modifying the source code.
John


On Jan 11, 2018 1:45 PM, "Brutzman, Donald (Don) (CIV)" <brutzman at nps.edu> wrote:
Yes. You also need to tell it original source file that you were loading first.  That way it knows what to load, which is necessary before it can save out as a different version. 

A list of all switches can be found on X3DJSAIL page under CommandLine. 
Sent from my handheld device

On Jan 11, 2018, at 01:33, John Carlson <yottzumm at gmail.com> wrote:
Incomplete?
 
Build:
 
test.nashorn:
     [echo] Compile:
     [echo] Run:
     [java] parameter: "-toJS" for conversion to JSON encoding
     [java] parameter: "-toFile" "nashorn/examples/HelloWorldProgramOutputOutput.js" for result file name root nashorn/examples/HelloWorldProgramOutputOutput
     [java] [Error] Source model file name is empty, therefore file loading not possible.
     [java] parameter: "-toJSON" for conversion to JSON encoding
     [java] parameter: "-toFile" "nashorn/examples/HelloWorldProgramOutputOutput.json" for result file name root nashorn/examples/HelloWorldProgramOutputOutput
     [java] [Error] Source model file name is empty, therefore file loading not possible.
     [java] parameter: "-toX3D" for conversion to X3D encoding
     [java] parameter: "-toFile" "nashorn/examples/HelloWorldProgramOutputOutput.x3d" for result file name root nashorn/examples/HelloWorldProgramOutputOutput
     [java] [Error] Source model file name is empty, therefore file loading not possible.
 
 
Ant script:
 
                <java classname="HelloWorldProgramOutput" classpath="${java.classes.dir};${java.jars.dir}/${jsai.full.archive.jar.name}" fork="${fork}">
                        <arg value="-toJS"/>
                        <arg value="-toFile"/>
                        <arg value="nashorn/examples/HelloWorldProgramOutputOutput.js"/>
                </java>
                <java classname="HelloWorldProgramOutput" classpath="${java.classes.dir};${java.jars.dir}/${jsai.full.archive.jar.name}" fork="${fork}">
                    <arg value="-toJSON"/>
                    <arg value="-toFile"/>
                    <arg value="nashorn/examples/HelloWorldProgramOutputOutput.json"/>
                </java>
                <java classname="HelloWorldProgramOutput" classpath="${java.classes.dir};${java.jars.dir}/${jsai.full.archive.jar.name}" fork="${fork}">
                    <arg value="-toX3D"/>
                    <arg value="-toFile"/>
                    <arg value="nashorn/examples/HelloWorldProgramOutputOutput.x3d"/>
                </java>
 
 
How to do it?
 
Thanks,
 
John


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


More information about the x3d-public mailing list