use of com.dexels.navajo.document.navascript.tags.NavascriptTag in project navajo by Dexels.
the class NS3ToNSXML method initialize.
public void initialize() throws UnsupportedEncodingException {
myNavascript = new NavascriptTag();
out = new OutputStreamWriter(System.out, "UTF-8");
}
use of com.dexels.navajo.document.navascript.tags.NavascriptTag in project navajo by Dexels.
the class NSXMLToNS3 method main.
public static void main(String[] args) throws Exception {
MapDefinitionInterrogatorImpl mdii = new MapDefinitionInterrogatorImpl();
mdii.addExtentionDefinition("com.dexels.navajo.adapter.StandardAdapterLibrary");
mdii.addExtentionDefinition("com.dexels.navajo.adapter.core.NavajoEnterpriseCoreAdapterLibrary");
mdii.addExtentionDefinition("com.dexels.navajo.mongo.adapter.MongoAdapterLibrary");
mdii.addExtentionDefinition("com.dexels.sportlink.adapters.SportlinkAdapterDefinitions");
mdii.addExtentionDefinition("com.dexels.navajo.resource.http.bundle.ResourceAdapterLibrary");
String argstate = "";
String inputFile = null;
String outputFile = null;
if (args.length == 0) {
System.out.println("Usage: java xmltons [-d] -i input [-o output] [-c config]");
System.out.println();
System.out.println();
System.out.println(" input : a navascript or tsl script file");
System.out.println(" output: a navascript 3 file");
System.out.println(" Option:");
System.out.println(" -d debug");
}
for (String arg : args) {
if (arg.equals("-i")) {
argstate = "readinput";
} else if (arg.equals("-o")) {
argstate = "writeoutput";
} else if (argstate.equals("readinput")) {
inputFile = arg;
} else if (argstate.equals("writeoutput")) {
outputFile = arg;
}
}
if (inputFile == null) {
System.out.println("No filename supplied");
return;
}
try {
FileInputStream fis = new FileInputStream(inputFile);
NavascriptTag navascript = (NavascriptTag) NavajoFactory.getInstance().createNavaScript(fis, mdii);
OutputStream os = System.out;
if (outputFile != null) {
os = new FileOutputStream(outputFile);
}
navascript.formatNS3(0, os);
os.close();
} catch (Exception e) {
System.err.println("Error transpiling " + inputFile + ": " + e.getMessage());
System.exit(-1);
}
}
Aggregations