Package org.dbwiki.data.io

Examples of org.dbwiki.data.io.StructureParser


        message = DatabaseWikiFormPrinter.MessageFileNotFound;
      }
      if ((message == DatabaseWikiFormPrinter.MessageNone) && (properties.getSchema().equals(""))) {
        try {
          // FIXME #schemaparsing: Make this a method somewhere...
          StructureParser structureParser = new StructureParser();
          new SAXCallbackInputHandler(structureParser, false).parse(in, false, false);
          if (structureParser.hasException()) {
            throw structureParser.getException();
          }
          databaseSchema = structureParser.getDatabaseSchema();
          properties.setSchema(databaseSchema.printSchema());
        } catch (Exception excpt) {
          throw new WikiFatalException(excpt);
        }
        message = DatabaseWikiFormPrinter.MessageEditSchema;
View Full Code Here


        in = new GZIPInputStream(new FileInputStream(inputFile));
      } else {
        in = new FileInputStream(inputFile);
      }
     
      StructureParser structureParser = new StructureParser();
      new SAXCallbackInputHandler(structureParser, false).parse(in, false, false);
      in.close();
      if (structureParser.hasException()) {
        throw structureParser.getException();
      }
      DatabaseSchema databaseSchema = structureParser.getDatabaseSchema(args.path);
     
     
      User user = _server.users().get(args.username);
      // register the database with the server
      _server.registerDatabase(args.name, args.title, args.path, inputFile.toURI().toURL(), databaseSchema, user, 1, 0);
View Full Code Here

        in = new GZIPInputStream(inputURL.openStream());
      } else {
        in = inputURL.openStream();
      }
      // 2.  parse to infer schema
      StructureParser structureParser = new StructureParser();
      new SAXCallbackInputHandler(structureParser, false).parse(in, false, false);
      in.close();
      if (structureParser.hasException()) {
        throw structureParser.getException();
      }
      DatabaseSchema databaseSchema = structureParser.getDatabaseSchema(path);
     
      // register the database with the server
      server.registerDatabase(name, title, path, inputURL, databaseSchema, server.users().get(user), 1, 0);
    } catch (Exception exception) {
      exception.printStackTrace();
View Full Code Here

TOP

Related Classes of org.dbwiki.data.io.StructureParser

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.