Package org.apache.turbine.torque.engine.database.model

Examples of org.apache.turbine.torque.engine.database.model.AppData


        try
        {
            System.out.println ("Parsing SQL Schema");

            SQLToAppData sqlParser = new SQLToAppData(inputFile);
            AppData app = sqlParser.execute();

            System.out.println ("Preparing to write xml schema");
            FileWriter fr = new FileWriter (outputFile);
            BufferedWriter br = new BufferedWriter (fr);

            br.write (app.toString());

            System.out.println ("Writing xml schema");

            br.flush();
            br.close();
View Full Code Here


     * Execute the parser.
     */
    public AppData execute() throws IOException, ParseException
    {
        count = 0;
        appData = new AppData();
        appDataDB = new Database();
        appData.addDatabase(appDataDB);

        FileReader fr = new FileReader (sqlFile);
        BufferedReader br = new BufferedReader (fr);
View Full Code Here

     * Just 4 testing.
     */
    public static void main (String args[]) throws Exception
    {
        SQLToAppData s2a = new SQLToAppData (args[0]);
        AppData ad = s2a.execute();
        System.out.println (ad);
    }
View Full Code Here

        try
        {
            System.out.println ("Parsing SQL Schema");

            SQLToAppData sqlParser = new SQLToAppData(inputFile);
            AppData app = sqlParser.execute();

            System.out.println ("Preparing to write xml schema");
            FileWriter fr = new FileWriter (outputFile);
            BufferedWriter br = new BufferedWriter (fr);

            br.write (app.toString());

            System.out.println ("Writing xml schema");

            br.flush();
            br.close();
View Full Code Here

     * Execute the parser.
     */
    public AppData execute() throws IOException, ParseException
    {
        count = 0;
        appData = new AppData();
        appDataDB = new Database();
        appData.addDatabase(appDataDB);

        FileReader fr = new FileReader (sqlFile);
        BufferedReader br = new BufferedReader (fr);
View Full Code Here

     * Just 4 testing.
     */
    public static void main (String args[]) throws Exception
    {
        SQLToAppData s2a = new SQLToAppData (args[0]);
        AppData ad = s2a.execute();
        System.out.println (ad);
    }
View Full Code Here

    {
        try
        {
            if ( firstPass )
            {
                app = new AppData();               
            }
           
            SAXParser parser = new SAXParser();

            // set the Resolver for the database DTD
View Full Code Here

        try
        {
            System.out.println ("Parsing SQL Schema");

            SQLToAppData sqlParser = new SQLToAppData(inputFile);
            AppData app = sqlParser.execute();

            System.out.println ("Preparing to write xml schema");
            FileWriter fr = new FileWriter (outputFile);
            BufferedWriter br = new BufferedWriter (fr);

            br.write (app.toString());

            System.out.println ("Writing xml schema");

            br.flush();
            br.close();
View Full Code Here

    public Context initControlContext()
        throws Exception
    {
        super.initControlContext();

        AppData app = (AppData) getDataModels().elementAt(0);
        Database db = app.getDatabase();

        try
        {
            XmlToData dataXmlParser = new XmlToData(db, dataDTD);
            List data = dataXmlParser.parseFile(dataXmlFile);
View Full Code Here

        if (xmlFile != null)
        {
            // Transform the XML database schema into
            // data model object.
            xmlParser = new XmlToAppData();
            AppData ad = xmlParser.parseFile(xmlFile);
            xmlParser.parseFile(xmlFile);
            ad.setName(grokName(xmlFile));
            dataModels.addElement(ad);
        }
        else
        {
            // Deal with the filesets.
            for (int i = 0; i < filesets.size(); i++)
            {
                FileSet fs = (FileSet) filesets.elementAt(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();
                    AppData ad = xmlParser.parseFile(f.toString());
                    xmlParser.parseFile(f.toString());
                    ad.setName(grokName(f.toString()));
                    dataModels.addElement(ad);
                }
            }
        }

        Iterator i = dataModels.iterator();
        databaseNames = new Hashtable();
        dataModelDbMap = new Hashtable();

        // Different datamodels may state the same database
        // names, we just want the unique names of databases.
        while (i.hasNext())
        {
            AppData ad = (AppData) i.next();
            Database database = ad.getDatabase();
            databaseNames.put(database.getName(), database.getName());
            dataModelDbMap.put(ad.getName(), database.getName());
        }

        // Create a new Velocity context.
        context = new VelocityContext();
View Full Code Here

TOP

Related Classes of org.apache.turbine.torque.engine.database.model.AppData

Copyright © 2018 www.massapicom. 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.