Examples of LanguageHandlerException


Examples of org.openqreg.exception.LanguageHandlerException

      loadTexts(con);
    } catch (NamingException ne) {
      logger.log(Level.FATAL, "Unable to look up name: " + jndiName, ne);

      throw new LanguageHandlerException("Unable to look up name: "
          + jndiName + ne.getMessage());
    } catch (SQLException sqle) {
      throw new LanguageHandlerException(
          "LanguageHandler: Error in DbHandler: " + sqle.getMessage());
    } finally {
      this.releaseWriteLock();

      try {
        if (con != null) {
          con.close();
        }
      } catch (SQLException sqle) {
        logger.log(Level.ERROR, "Unable to close connection", sqle);

        throw new LanguageHandlerException(
            "LanguageHandler: Could not close db: "
                + sqle.getMessage());
      }
    }
View Full Code Here

Examples of org.openqreg.exception.LanguageHandlerException

    // Create the number of languageTreeMaps that are in the db
    int nrOfLanguages = availableLanguages.size();

    if (nrOfLanguages <= 0) {
      throw new LanguageHandlerException("No languages found in db");
    }

    // Get all languages and id's
    Map<String, String> tm;

    // Iterator textIterator = TextFinderBase.findAll(con).iterator();
    // Text text = null;
    // while (textIterator.hasNext()) {
    // text = (Text)textIterator.next();

    // Get text documents in correct order
    Collection<DocumentorderBean> doCol = DocumentorderFinder
        .findAllOrderByOrdernumber(con);
    // loop all texts in all documents (in right order) and put them in
    // the treemap will lead to the ones existing in more than one document
    // beeing overwritten in correct order
    for (DocumentorderBean doBean : doCol) {

      // for (Text text : TextFinderBase.findAll(con)) {
      for (Text text : TextFinder.findByDocument(con,
          doBean.getDocument())) {
        // tm is treemap for the current lang
        tm = languageKeeper.get(text.getLanguageid());

        if (tm == null) {
          throw new LanguageHandlerException(
              "Could not find mapping for language: "
                  + text.getLanguageid());
        }
        tm.put(text.getId(), text.getText());
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.