Search in sources :

Example 1 with MapDefinitionInterrogatorImpl

use of com.dexels.navajo.mapping.compiler.meta.MapDefinitionInterrogatorImpl in project navajo by Dexels.

the class Tester method main.

public static void main(String[] args) {
    try {
        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");
        FileInputStream fis = new FileInputStream("/Users/arjenschoneveld/EmptyArray.xml");
        NavascriptTag navascript = (NavascriptTag) NavajoFactory.getInstance().createNavaScript(fis, mdii);
        navascript.write(System.err);
        OutputStream os = System.err;
        navascript.formatNS3(0, os);
        os.close();
    } catch (Exception e) {
        System.err.print(e);
        System.exit(-1);
    }
}
Also used : MapDefinitionInterrogatorImpl(com.dexels.navajo.mapping.compiler.meta.MapDefinitionInterrogatorImpl) OutputStream(java.io.OutputStream) FileInputStream(java.io.FileInputStream) NavascriptTag(com.dexels.navajo.document.navascript.tags.NavascriptTag)

Example 2 with MapDefinitionInterrogatorImpl

use of com.dexels.navajo.mapping.compiler.meta.MapDefinitionInterrogatorImpl 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);
    }
}
Also used : MapDefinitionInterrogatorImpl(com.dexels.navajo.mapping.compiler.meta.MapDefinitionInterrogatorImpl) OutputStream(java.io.OutputStream) FileOutputStream(java.io.FileOutputStream) FileOutputStream(java.io.FileOutputStream) FileInputStream(java.io.FileInputStream) NavascriptTag(com.dexels.navajo.document.navascript.tags.NavascriptTag)

Aggregations

NavascriptTag (com.dexels.navajo.document.navascript.tags.NavascriptTag)2 MapDefinitionInterrogatorImpl (com.dexels.navajo.mapping.compiler.meta.MapDefinitionInterrogatorImpl)2 FileInputStream (java.io.FileInputStream)2 OutputStream (java.io.OutputStream)2 FileOutputStream (java.io.FileOutputStream)1