Customer Portal

Comments 4

  • Avatar
    deshartman
    0
    Comment actions Permalink
    I discovered there was a XSD, so looking at that rather,

    Thanks
    Des
  • Avatar
    deshartman
    0
    Comment actions Permalink
    ok, so had a look at XSD and this is what I am after, except that I need to understand if there is a way to Marshall the TransformationGraph object using the XSD

    It seems JAXB is the way to do it, but was wondering if Clover has a build in way of doing this?

    TransformationGraphXMLReaderWriter.write seems to something in this direction, but from the posts it does not appear to be supported.

    Thanks
    Des
  • Avatar
    deshartman
    0
    Comment actions Permalink
    I have been fiddling around a bit with JAXB, but no luck. Here is what I tried. Would you be able to help me out on how to construct an XML representation of the transformationGraph again?

    FileInputStream graphXMLFile;
    try {
    graphXMLFile = new FileInputStream(MAIN_GRAPH);

    GraphRuntimeContext graphRuntimeContext = new GraphRuntimeContext();

    TransformationGraph mainGraph = TransformationGraphXMLReaderWriter.loadGraph(graphXMLFile, graphRuntimeContext);

    // Now we have the Java Object mainGraph.
    // Convert it back to XML using JAXB

    try {
    JAXBContext jc = JAXBContext.newInstance(TransformationGraph.class);

    Marshaller m = jc.createMarshaller();
    m.marshal(mainGraph, System.out);

    } catch (JAXBException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }

    Result I get is


    INFO [main] - Checking graph configuration...
    com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 4 counts of IllegalAnnotationExceptions
    org.jetel.graph.runtime.WatchDog does not have a no-arg default constructor.
    this problem is related to the following location:
    at org.jetel.graph.runtime.WatchDog
    at public org.jetel.graph.runtime.WatchDog org.jetel.graph.TransformationGraph.getWatchDog()
    at org.jetel.graph.TransformationGraph
    org.jetel.graph.runtime.IThreadManager is an interface, and JAXB can't handle interfaces.
    this problem is related to the following location:
    at org.jetel.graph.runtime.IThreadManager
    at public org.jetel.graph.runtime.IThreadManager org.jetel.graph.runtime.WatchDog.getThreadManager()
    at org.jetel.graph.runtime.WatchDog
    at public org.jetel.graph.runtime.WatchDog org.jetel.graph.TransformationGraph.getWatchDog()
    at org.jetel.graph.TransformationGraph
    org.jetel.graph.runtime.IThreadManager does not have a no-arg default constructor.
    this problem is related to the following location:
    at org.jetel.graph.runtime.IThreadManager
    at public org.jetel.graph.runtime.IThreadManager org.jetel.graph.runtime.WatchDog.getThreadManager()
    at org.jetel.graph.runtime.WatchDog
    at public org.jetel.graph.runtime.WatchDog org.jetel.graph.TransformationGraph.getWatchDog()
    at org.jetel.graph.TransformationGraph
    org.jetel.graph.GraphElement does not have a no-arg default constructor.
    this problem is related to the following location:
    at org.jetel.graph.GraphElement
    at org.jetel.graph.TransformationGraph

    at com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:91)
    at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:436)
    at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:277)
    at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1100)
    at com.sun.xml.internal.bind.v2.ContextFactory.createContext(ContextFactory.java:143)
    at com.sun.xml.internal.bind.v2.ContextFactory.createContext(ContextFactory.java:110)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:202)
    at javax.xml.bind.ContextFinder.find(ContextFinder.java:376)
    at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)
    at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:522)
    at com.wl.cfx.Main.runETL(Main.java:53)
    at com.wl.cfx.Main.main(Main.java:112)
  • Avatar
    avackova
    0
    Comment actions Permalink
    Hello Des,
    unfortunately storing graph into xml doesn't work and can't be done with Clover ETL. You would write your own serializer.
    You need to transform your graph as xml document - so to work directly with graph file or with org.w3c.dom.Document.

Please sign in to leave a comment.