Package org.dbwiki.user

Examples of org.dbwiki.user.User


  protected void getUserListing(Connection connection) throws SQLException {
    _users = new UserListing();
    Statement stmt = connection.createStatement();
    ResultSet rs = stmt.executeQuery("SELECT * FROM " + RelationUser);
    while (rs.next()) {
      _users.add(new User(rs.getInt(RelUserColID), rs.getString(RelUserColLogin), rs.getString(RelUserColFullName), rs.getString(RelUserColPassword)));
    }
    rs.close();
    stmt.close();
   
  }
View Full Code Here


   * @param schemaNode
   * @param version
   * @throws org.dbwiki.exception.WikiException
   */
  public void insertSchemaNode(SchemaNode schemaNode, Version version) throws org.dbwiki.exception.WikiException {
    User user = version.provenance().user();
    TimeSequence timestamp = new TimeSequence(version);
    try {
      PreparedStatement insert = _con.prepareStatement(
        "INSERT INTO " + _database.name() + RelationSchema + " (" +
          RelSchemaColID + ", " +
          RelSchemaColType + ", " +
          RelSchemaColLabel + ", " +
          RelSchemaColParent + ", " +
          RelSchemaColUser + ")" +
          " VALUES(?, ?, ?, ?, ?)", Statement.RETURN_GENERATED_KEYS);
      insert.setInt(1, schemaNode.id());
      if (schemaNode.isAttribute()) {
        insert.setInt(2, RelSchemaColTypeValAttribute);
      } else {
        insert.setInt(2, RelSchemaColTypeValGroup);
      }
      insert.setString(3, schemaNode.label());
      if (schemaNode.parent() != null) {
        insert.setInt(4, schemaNode.parent().id());
      } else {
        insert.setInt(4, RelSchemaColParentValUnknown);
      }
      if (user != null) {
        insert.setInt(5, user.id());
      } else {
        insert.setInt(5, User.UnknownUserID);
      }

      insert.execute();
View Full Code Here

    Statement stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery("SELECT * FROM " + _name + RelationVersion + " ORDER BY " + RelVersionColNumber);
    while (rs.next()) {
      int versionNumber = rs.getInt(RelVersionColNumber);
      String versionName = rs.getString(RelVersionColName);
      User user = users.get(rs.getInt(RelVersionColUser));
      int nodeId = rs.getInt(RelVersionColNode);
      NodeIdentifier nid = null;
      if(nodeId != -1)
        nid = new NodeIdentifier(nodeId);
      Provenance provenance =
View Full Code Here

        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);
     
      _wiki = _server.get(args.name);
           
View Full Code Here

TOP

Related Classes of org.dbwiki.user.User

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.