Package org.teiid.query.mapping.xml

Examples of org.teiid.query.mapping.xml.MappingLoader.loadDocument()


            String document = tableRecord.getSelectTransformation();           
            InputStream inputStream = new ByteArrayInputStream(document.getBytes());
            MappingLoader reader = new MappingLoader();
            MappingDocument mappingDoc = null;
            try{
                mappingDoc = reader.loadDocument(inputStream);
                mappingDoc.setName(groupName);
            } catch (Exception e){
                throw new TeiidComponentException(e, QueryPlugin.Util.getString("TransformationMetadata.Error_trying_to_read_virtual_document_{0},_with_body__n{1}_1", groupName, mappingDoc)); //$NON-NLS-1$
            } finally {
              try {
View Full Code Here


        byte[] bytes = xml.getBytes();

        InputStream istream = new ByteArrayInputStream (bytes);
       
        return reader.loadDocument(istream);
    }   
   
    public void testSourceAtRootXML50() throws Exception{
        String xml =
            "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n" //$NON-NLS-1$
View Full Code Here

    /** Load a mapping definition from a file. */
    private static MappingNode loadFromFile( String filename )
        throws Exception {
        String fileAbsolutePath = getFilePathInDataDir(filename);
        MappingLoader loader = new MappingLoader();
        return loader.loadDocument(fileAbsolutePath);
    }

    /** Load a mapping definition from a stream. */
    private static MappingNode loadFromStream( String filename )
        throws Exception {
View Full Code Here

        if ( istream == null ) {
            throw new IllegalStateException( "File " + filename //$NON-NLS-1$
                + " is not in the application's classpath." ); //$NON-NLS-1$
        }
        MappingLoader loader= new MappingLoader();
        return loader.loadDocument(istream);
    }


    /**
     * <p>Utility to get an input stream to a file in the app's classpath. </p>
View Full Code Here

   
            byte[] bytes = xml.getBytes();
   
            InputStream istream = new ByteArrayInputStream (bytes);
           
            return reader.loadDocument(istream);
    }
           
    /**
     * test of the adjustment XMLPlanner must do to the way
     * namespace declarations are constructed by the modeler
View Full Code Here

    private MappingDocument loadMappingDocument(String xml)
        throws MappingException {
        MappingLoader reader = new MappingLoader();
        byte[] bytes = xml.getBytes();
        InputStream istream = new ByteArrayInputStream(bytes);
        return reader.loadDocument(istream);
    }   
   
    private String saveMappingDocument(MappingDocument doc)
        throws IOException {
        StringWriter sw = new StringWriter();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.