Package org.dbwiki.exception

Examples of org.dbwiki.exception.WikiFatalException


            throw structureParser.getException();
          }
          databaseSchema = structureParser.getDatabaseSchema();
          properties.setSchema(databaseSchema.printSchema());
        } catch (Exception excpt) {
          throw new WikiFatalException(excpt);
        }
        message = DatabaseWikiFormPrinter.MessageEditSchema;
      }
      if (in != null) {
        try {
          in.close();
        } catch (java.io.IOException ioe) {
        }
      }
    }
   
    if (message != DatabaseWikiFormPrinter.MessageNone) {
      //
      // If parameter validation results in an error message the create wiki
      // form is re-displayed showing the error message.
      //
      ServerResponseHandler responseHandler = new ServerResponseHandler(request, _wikiTitle + " - Create Database Wiki");
      responseHandler.put(HtmlContentGenerator.ContentContent, new DatabaseWikiFormPrinter(properties, RequestParameterAction.ActionInsert, "Create Database Wiki", message));
      return responseHandler;
    } else {
      //
      // If the parameter values are valid the database wiki is created
      //
      if ((request.user() == null) && (_authenticationMode != DatabaseWikiProperties.AuthenticateNever)) {
        throw new WikiFatalException("User information is missing");
      }
     
     
      if (databaseSchema != null) {
        // Path is either the value of the form parameter SCHEMA_PATH or
        // the path of the schema root node;
        String path = null;
        if (!properties.getSchemaPath().equals("")) {
          path = properties.getSchemaPath();
          databaseSchema = databaseSchema.getSubSchema(path);
        } else {
          path = databaseSchema.root().path();
        }
       
        URL resourceURL = null;
        if (!properties.getResource().equals("")) {
          resourceURL = new URL(properties.getResource());
        }
       
        try {
          registerDatabase(properties.getName(), properties.getTitle(), path, resourceURL, databaseSchema, request.user(),
              properties.getAuthentication(), properties.getAutoSchemaChanges());
        } catch (java.sql.SQLException sqlException) {
          throw new WikiFatalException(sqlException);
        }
      } else {
        throw new WikiFatalException("Empty Schema");
      }
           
      return this.getHomepageResponseHandler(request);
    }
  }
View Full Code Here


      responseHandler.put(HtmlContentGenerator.ContentContent, new DatabaseWikiFormPrinter(properties, RequestParameterAction.ActionUpdate, "Edit Database Wiki", message));
      return responseHandler;
    } else {
      // Otherwise, apply the changes.
      if ((request.user() == null) && (_authenticationMode != DatabaseWikiProperties.AuthenticateNever)) {
        throw new WikiFatalException("User information is missing");
      }
      try {
        Connection con = _connector.getConnection();
        con.setAutoCommit(false);
        PreparedStatement pStmt = con.prepareStatement("UPDATE " + RelationDatabase + " " +
          "SET " + RelDatabaseColTitle + " = ?, " +
          RelDatabaseColAuthentication + " = ?, " +
          RelDatabaseColAutoSchemaChanges + " = ? " +
          "WHERE " + RelDatabaseColID + " = " + wiki.id());
        pStmt.setString(1, properties.getTitle());
        pStmt.setInt(2, properties.getAuthentication());
        pStmt.setInt(3, properties.getAutoSchemaChanges());
        pStmt.execute();
        pStmt.close();
        con.commit();
        con.close();
      } catch (java.sql.SQLException sqlException) {
        throw new WikiFatalException(sqlException);
      }
      wiki.setAuthenticationMode(properties.getAuthentication());
      wiki.setAutoSchemaChanges(properties.getAutoSchemaChanges());
      wiki.setTitle(properties.getTitle());
      sortWikiListing();
View Full Code Here

        }
        in.close();
        return value;
      } else {
        System.out.println("File Not Found: " + path);
        throw new WikiFatalException("File Not Found: " + path);
      }
    } catch (java.io.IOException ioException) {
      throw new WikiFatalException(ioException);
    }
  }
View Full Code Here

      }
      rs.close();
      stmt.close();
      con.close();
    } catch (java.sql.SQLException sqlException) {
      throw new WikiFatalException(sqlException);
    }
    return value;
  }
View Full Code Here

      pStmt.execute();
      ResultSet rs = pStmt.getGeneratedKeys();
      if (rs.next()) {
        wikiID = rs.getInt(1);
      } else {
        throw new WikiFatalException("There are no generated keys.");
      }
      rs.close();
      return wikiID;
    }
View Full Code Here

      Connection con = _connector.getConnection();
      getUserListing(con)
      getWikiListing(con);
      con.close();
    } catch (java.sql.SQLException sqlException) {
      throw new WikiFatalException(sqlException);
    }
  }
View Full Code Here

          break;
        case RelConfigFileColFileTypeValURLDecoding:
          setting.setURLDecodingRulesVersion(rs.getInt(RelPresentationColVersion));
          break;
        default:
          throw new WikiFatalException("Unknown config file type");
        }
        settings.add(setting);
        currentSetting = setting;
      }
      stmt.close();
      con.close();
      return settings;
    } catch (java.sql.SQLException sqlException) {
      throw new WikiFatalException(sqlException);
    }
   
  }
View Full Code Here

        "WHERE " + RelDatabaseColID + " = " + wiki.id());
      stmt.close();
      con.close();
      wiki.reset(layoutVersion, templateVersion, styleSheetVersion, urlDecodingVersion);
    } catch (java.sql.SQLException sqlException) {
      throw new WikiFatalException(sqlException);
    }
  }
View Full Code Here

        stmt.close();
        con.commit();
      } catch (java.sql.SQLException sqlException) {
        con.rollback();
        con.close();
        throw new WikiFatalException(sqlException);
      }
      con.setAutoCommit(true);
      con.close();
      return version;
    } catch (java.sql.SQLException sqlException) {
      throw new WikiFatalException(sqlException);
    }
  }
View Full Code Here

          _elementStack.push(child);
        } else {
          _ignoreSubtreeDepth = 1;
        }
      } else {
        throw new WikiFatalException("Missing node value reader for attribute node " + element.label());
      }
    } else {
      throw new WikiDataException(WikiDataException.InvaldInputData, "Multiple root nodes detected");
    }
  }
View Full Code Here

TOP

Related Classes of org.dbwiki.exception.WikiFatalException

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.