Package org.dbwiki.web.server

Examples of org.dbwiki.web.server.WikiServer


   
    try {
      Properties properties = org.dbwiki.lib.IO.loadProperties(configFile);
      DatabaseConnector connector = new DatabaseConnectorFactory().getConnector(properties);
      //TODO #server: Use non-web wiki server for this
      WikiServer server = new WikiServerStandalone(properties);
      /*
       * DatabaseWiki wiki = null;
      for (int iWiki = 0; iWiki < server.size(); iWiki++) {
        if (server.get(iWiki).name().equalsIgnoreCase(wikiName)) {
          wiki = server.get(iWiki);
          break;
        }
      }*/
      DatabaseWiki wiki = server.get(wikiName);
     
      // [wiki] should never be null
      assert(wiki != null);
     
      Database database = wiki.database();
View Full Code Here


    String user = args[5];
 
    try {
      Properties properties = org.dbwiki.lib.IO.loadProperties(configFile);

      WikiServer server = new WikiServerStandalone(properties);
     
      // attempt to generate a schema from the input file
      // 1. get input file stream
      InputStream in = null;

      URL inputURL = new File(inputName).toURI().toURL();
      if (inputName.endsWith(".gz")) {
        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();
      System.exit(0);
    }
  }
View Full Code Here

TOP

Related Classes of org.dbwiki.web.server.WikiServer

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.