Examples of XmlToAppData


Examples of org.apache.fulcrum.intake.transform.XmlToAppData

                String xmlPath = (String) it.next();
                AppData appData = null;

                getLogger().debug("Now parsing: " + xmlPath);

                XmlToAppData xmlApp = new XmlToAppData();
                xmlApp.enableLogging(getLogger());
                appData = xmlApp.parseFile(xmlPath);

                appDataElements.put(appData, xmlPath);
                getLogger().debug("Saving appData for " + xmlPath);
            }
View Full Code Here

Examples of org.apache.torque.engine.database.transform.XmlToAppData

     * @return the context
     * @throws Exception
     */
    public Context initControlContext() throws Exception
    {
        XmlToAppData xmlParser;

        if (xmlFile == null && filesets.isEmpty())
        {
            throw new BuildException("You must specify an XML schema or "
                    + "fileset of XML schemas!");
        }

        try
        {
            if (xmlFile != null)
            {
                // Transform the XML database schema into
                // data model object.
                xmlParser = new XmlToAppData(getTargetDatabase(),
                        getTargetPackage());
                Database ad = xmlParser.parseFile(xmlFile);
                ad.setFileName(grokName(xmlFile));
                dataModels.add(ad);
            }
            else
            {
                // Deal with the filesets.
                for (int i = 0; i < filesets.size(); i++)
                {
                    FileSet fs = (FileSet) filesets.get(i);
                    DirectoryScanner ds = fs.getDirectoryScanner(project);
                    File srcDir = fs.getDir(project);

                    String[] dataModelFiles = ds.getIncludedFiles();

                    // Make a transaction for each file
                    for (int j = 0; j < dataModelFiles.length; j++)
                    {
                        File f = new File(srcDir, dataModelFiles[j]);
                        xmlParser = new XmlToAppData(getTargetDatabase(),
                                getTargetPackage());
                        Database ad = xmlParser.parseFile(f.toString());
                        ad.setFileName(grokName(f.toString()));
                        dataModels.add(ad);
                    }
                }
            }
View Full Code Here

Examples of org.apache.torque.engine.database.transform.XmlToAppData

    public void loadIdBrokerModel()
            throws EngineException
    {
        // Transform the XML database schema into
        // data model object.
        XmlToAppData xmlParser = new XmlToAppData(getTargetDatabase(), null);
        Database ad = xmlParser.parseFile(getIdTableXMLFile());

        ad.setName("idmodel");
        context.put("idmodel", ad);
    }
View Full Code Here

Examples of org.apache.torque.engine.database.transform.XmlToAppData

     * @return the context
     * @throws Exception
     */
    public Context initControlContext() throws Exception
    {
        XmlToAppData xmlParser;

        if (xmlFile == null && filesets.isEmpty())
        {
            throw new BuildException("You must specify an XML schema or "
                    + "fileset of XML schemas!");
        }

        try
        {
            if (xmlFile != null)
            {
                // Transform the XML database schema into
                // data model object.
                xmlParser = new XmlToAppData(getTargetDatabase(),
                        getTargetPackage(), getBasePathToDbProps());
                AppData ad = xmlParser.parseFile(xmlFile);
                ad.setName(grokName(xmlFile));
                dataModels.add(ad);
            }
            else
            {
                // Deal with the filesets.
                for (int i = 0; i < filesets.size(); i++)
                {
                    FileSet fs = (FileSet) filesets.get(i);
                    DirectoryScanner ds = fs.getDirectoryScanner(project);
                    File srcDir = fs.getDir(project);
                   
                    String[] dataModelFiles = ds.getIncludedFiles();
                   
                    // Make a transaction for each file
                    for (int j = 0; j < dataModelFiles.length; j++)
                    {
                        File f = new File(srcDir, dataModelFiles[j]);
                        xmlParser = new XmlToAppData(getTargetDatabase(),
                                getTargetPackage(),
                                getBasePathToDbProps());
                        AppData ad = xmlParser.parseFile(f.toString());
                        ad.setName(grokName(f.toString()));
                        dataModels.add(ad);
                    }
                }
            }
View Full Code Here

Examples of org.apache.torque.engine.database.transform.XmlToAppData

    public void loadIdBrokerModel()
            throws EngineException
    {
        // Transform the XML database schema into
        // data model object.
        XmlToAppData xmlParser = new XmlToAppData(getTargetDatabase(), null,
                                                  getBasePathToDbProps());
        AppData ad = xmlParser.parseFile(getIdTableXMLFile());

        ad.setName("idmodel");
        context.put("idmodel", ad);
    }
View Full Code Here

Examples of org.apache.torque.engine.database.transform.XmlToAppData

     * @return the context
     * @throws Exception
     */
    public Context initControlContext() throws Exception
    {
        XmlToAppData xmlParser;

        if (xmlFile == null && filesets.isEmpty())
        {
            throw new BuildException("You must specify an XML schema or "
                    + "fileset of XML schemas!");
        }

        try
        {
            if (xmlFile != null)
            {
                // Transform the XML database schema into
                // data model object.
                xmlParser = new XmlToAppData(getTargetDatabase(),
                        getTargetPackage());
                Database ad = xmlParser.parseFile(xmlFile);
                ad.setFileName(grokName(xmlFile));
                dataModels.add(ad);
            }
            else
            {
                // Deal with the filesets.
                for (int i = 0; i < filesets.size(); i++)
                {
                    FileSet fs = (FileSet) filesets.get(i);
                    DirectoryScanner ds = fs.getDirectoryScanner(getProject());
                    File srcDir = fs.getDir(getProject());

                    String[] dataModelFiles = ds.getIncludedFiles();

                    // Make a transaction for each file
                    for (int j = 0; j < dataModelFiles.length; j++)
                    {
                        File f = new File(srcDir, dataModelFiles[j]);
                        xmlParser = new XmlToAppData(getTargetDatabase(),
                                getTargetPackage());
                        Database ad = xmlParser.parseFile(f.toString());
                        ad.setFileName(grokName(f.toString()));
                        dataModels.add(ad);
                    }
                }
            }
View Full Code Here

Examples of org.apache.torque.engine.database.transform.XmlToAppData

    public void loadIdBrokerModel()
            throws EngineException
    {
        // Transform the XML database schema into
        // data model object.
        XmlToAppData xmlParser = new XmlToAppData(getTargetDatabase(), null);
        Database ad = xmlParser.parseFile(getIdTableXMLFile());

        ad.setName("idmodel");
        context.put("idmodel", ad);
    }
View Full Code Here

Examples of org.apache.torque.engine.database.transform.XmlToAppData

     * test if the tables get the package name from the properties file
     */
    public void testDefaultPackageName()
            throws Exception
    {
        xmlToAppData = new XmlToAppData("mysql", "defaultpackage");
        database = xmlToAppData.parseFile(
            "src/test/org/apache/torque/engine/database/package-schema.xml");
        assertEquals("defaultpackage", database.getPackage());
        Table table = database.getTable("table_a");
        assertEquals("defaultpackage", table.getPackage());
View Full Code Here

Examples of org.apache.torque.engine.database.transform.XmlToAppData

     * test if the tables get the package name from the database tag
     */
    public void testDatabasePackageName()
            throws Exception
    {
        xmlToAppData = new XmlToAppData("mysql", "defaultpackage");
        database = xmlToAppData.parseFile(
            "src/test/org/apache/torque/engine/database/package2-schema.xml");
        assertEquals("packagefromdb", database.getPackage());
        Table table = database.getTable("table_a");
        assertEquals("packagefromdb", table.getPackage());
View Full Code Here

Examples of org.apache.torque.engine.database.transform.XmlToAppData

    }

    protected void setUp() throws Exception
    {
        super.setUp();
        xmlToAppData = new XmlToAppData("oracle", "defaultpackage");
        db = xmlToAppData.parseFile(
            "src/test/org/apache/torque/engine/database/model/domaintest-schema.xml");
    }
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.