Package org.dbwiki.web.server

Examples of org.dbwiki.web.server.WikiServerStandalone


import org.dbwiki.web.server.WikiServerStandalone;

public class TestDatabaseReader {
  public static void main(String[] args) {
      try {
          WikiServerStandalone wikiserver=new WikiServerStandalone(org.dbwiki.lib.IO.loadProperties(new File(args[0])));
        PSQLDatabaseConnector psql = new PSQLDatabaseConnector("jdbc:postgresql://localhost", "dbwiki", "password");
        RDBMSDatabase database= new RDBMSDatabase(wikiserver.get(1), psql);
        NodeIdentifier nodeidentifier= new NodeIdentifier();
        DatabaseReader.get(psql.getConnection(), database, nodeidentifier);
          database.query("wpath://child::COUNTRY/child::NAME");
          database.query("wpath://COUNTRY[CATEGORY/PROPERTY/*='Europe']/NAME");
          database.query("wpath://COUNTRY[NAME='United States']/CATEGORY[NAME='Economy']/PROPERTY[NAME='GDP (purchasing power parity)']");
          System.out.println(wikiserver.size());
          
        
  


View Full Code Here


      // Parse the arguments.
      Args args = new Args(argv);
     
      Properties properties = org.dbwiki.lib.IO.loadProperties(args.configFile);

      _server = new WikiServerStandalone(properties);
     
      // attempt to generate a schema from the input file
      OutputStream out = null;
      File outputFile = new File(args.xmlFile);
     
View Full Code Here

   
    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

     
     
     
      Properties properties = org.dbwiki.lib.IO.loadProperties(args.configFile);

      _server = new WikiServerStandalone(properties);
     
      // attempt to generate a schema from the input file
      InputStream in = null;

      File inputFile = new File(args.inputName);
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.WikiServerStandalone

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.