Examples of AppData


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

        try
        {
            log("Parsing SQL Schema", Project.MSG_INFO);

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

            log("Preparing to write xml schema", Project.MSG_INFO);
            FileWriter fr = new FileWriter(outputFile);
            BufferedWriter br = new BufferedWriter (fr);

            br.write(app.toString());

            log("Writing xml schema", Project.MSG_INFO);

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

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

                    + "a fileset of XML data files!");
        }

        try
        {
            AppData app = (AppData) getDataModels().get(0);
            Database db = app.getDatabase();
           
            List data;
           
            if (dataXmlFile != null)
            {
View Full Code Here

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

     * @throws ParseException error parsing the input file
     */
    public AppData execute() throws IOException, ParseException
    {
        count = 0;
        appData = new AppData(databaseType, basePropsFilePath);
        appDataDB = new Database();
        appData.addDatabase(appDataDB);

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

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

     * @throws Exception an exception
     */
    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

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

            {
                // 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);
                    }
                }
            }
           
            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());
            }
        }
        catch (EngineException ee)
        {
            throw new BuildException(ee);
View Full Code Here

Examples of org.apache.turbine.services.intake.xmlmodel.AppData

            appDataElements = new HashMap();

            for (Iterator it = xmlFiles.iterator(); it.hasNext();)
            {
                String xmlPath = (String) it.next();
                AppData appData = null;

                log.debug("Now parsing: " + xmlPath);
                try
                {
                    XmlToAppData xmlApp = new XmlToAppData();
                    appData = xmlApp.parseFile(xmlPath);
                }
                catch (Exception e)
                {
                    log.error("Could not parse XML file " + xmlPath, e);

                    throw new InitializationException("Could not parse XML file " +
                            xmlPath, e);
                }

                appDataElements.put(appData, xmlPath);
                log.debug("Saving appData for " + xmlPath);
            }

            saveSerialized(serialDataPath, appDataElements);
        }

        try
        {
            for (Iterator it = appDataElements.keySet().iterator(); it.hasNext();)
            {
                AppData appData = (AppData) it.next();

                int maxPooledGroups = 0;
                List glist = appData.getGroups();

                String groupPrefix = appData.getGroupPrefix();

                for (int i = glist.size() - 1; i >= 0; i--)
                {
                    XmlGroup g = (XmlGroup) glist.get(i);
                    String groupName = g.getName();
View Full Code Here

Examples of org.apache.turbine.services.intake.xmlmodel.AppData

    public Group getGroup(String groupName)
            throws IntakeException
    {
        Group group = null;

        AppData appData = (AppData) groupNames.get(groupName);

        if (groupName == null)
        {
            throw new IntakeException(
                    "Intake TurbineIntakeService.getGroup(groupName) is null");
View Full Code Here

Examples of org.apache.turbine.services.intake.xmlmodel.AppData

            throws IntakeException
    {
        if (instance != null)
        {
            String groupName = instance.getIntakeGroupName();
            AppData appData = (AppData) groupNames.get(groupName);

            if (appData == null)
            {
                throw new IntakeException(
                        "Intake TurbineIntakeService.releaseGroup(groupName): "
View Full Code Here

Examples of org.apache.turbine.services.intake.xmlmodel.AppData

     * @throws IntakeException The passed group name does not exist.
     */
    public int getSize(String groupName)
            throws IntakeException
    {
        AppData appData = (AppData) groupNames.get(groupName);
        if (appData == null)
        {
            throw new IntakeException(
                    "Intake TurbineIntakeService.Size(groupName): No XML definition for Group "
                    + groupName + " found");
View Full Code Here

Examples of org.apache.turbine.services.intake.xmlmodel.AppData

    /**
     * Creates a new instance of the Intake XML Parser
     */
    public XmlToAppData()
    {
        app = new AppData();
    }
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.