Package edu.uga.galileo.voci.exception

Examples of edu.uga.galileo.voci.exception.NoSuchItemException


      if (qp.getResultCount() > 0) {
        return createItemsFromQueryParser(qp).get(0);
      }
    } catch (SQLException e) {
      Logger.fatal("Couldn't execute query", e);
      throw new NoSuchItemException("A SQLException was the cause: "
          + e.getMessage());
    }

    throw new NoSuchItemException("The requested item ID (" + itemId
        + ") doesn't exist.");
  }
View Full Code Here


    try {
      Configuration.getConnectionPool().executeInsertOrUpdate(qp);
    } catch (SQLException e) {
      Logger.error("Item record couldn't be added", e);
      throw new NoSuchItemException(
          "SQLException prevented item record addition: "
              + e.getMessage());
    }
  }
View Full Code Here

      return qp.getResult(Integer.class, "nextVal");
    } catch (SQLException e) {
      Logger
          .error("Item ID couldn't be retrieved b/c of SQLException",
              e);
      throw new NoSuchItemException(
          "Couldn't get a item ID from the handle_id_seq b/c of a SQLException: "
              + e.getMessage());
    } catch (DataTypeMismatchException e) {
      Logger.error("Item ID couldn't be retrieved", e);
      throw new NoSuchItemException(
          "Couldn't get a item ID from the handle_id_seq: "
              + e.getMessage());
    }
  }
View Full Code Here

    qp.addPreparedStmtElementDefinition(item.getItemId());
    qp.addPreparedStmtElementDefinition(item.getProjectId());

    try {
      if (!Configuration.getConnectionPool().executeInsertOrUpdate(qp)) {
        throw new NoSuchItemException("Item " + item.getId()
            + " in project " + item.getProjectId()
            + " couldn't be found to update.");
      }
    } catch (SQLException e) {
      Logger.error("Item record couldn't be updated.", e);
      throw new NoSuchItemException(
          "SQLException prevented item record update: "
              + e.getMessage());
    }
  }
View Full Code Here

    qp.addPreparedStmtElementDefinition(item.getItemId());
    qp.addPreparedStmtElementDefinition(item.getProjectId());

    try {
      if (!Configuration.getConnectionPool().executeInsertOrUpdate(qp)) {
        throw new NoSuchItemException("Item " + item.getId()
            + " in project " + item.getProjectId()
            + " couldn't be found to delete.");
      }
    } catch (SQLException e) {
      Logger.error("Item record couldn't be deleted", e);
      throw new NoSuchItemException(
          "SQLException prevented item record deletion: "
              + e.getMessage());
    }
  }
View Full Code Here

    int projectId;
    try {
      projectId = (new ProjectManager()).getProjectID(command
          .getProject());
    } catch (NoSuchProjectException e) {
      throw new NoSuchItemException("The project associated with this "
          + "item couldn't be found.");
    }

    if (itemId == -1) {
      item = new Item();
      item.setItemId(-1);
      item.setProjectId(projectId);
    } else {
      item = idao.getItem(itemId, projectId);
    }

    if ((mustBeActive) && (!item.isActive())) {
      throw new NoSuchItemException("No matching, active item found.");
    }

    if (addMetadata) {
      metadataManager.populateVBOWithMetadata(item);
    }
View Full Code Here

      idao.addItem(item, multiStatementConnection);
      if (parentId != -1) {
        ContentType parentIdType = DAOFactory.getHelperDAO()
            .getContentTypeById(parentId);
        if (parentIdType == null) {
          throw new NoSuchItemException(
              "No such parent ID exists in the database.");
        }
        idao.addItemMapping(item.getItemId(), parentId, parentIdType,
            multiStatementConnection);
      }
      mman.updateMetadataVBOMapping(item, multiStatementConnection);
      multiStatementConnection.commit();

      AuditLogManager alm = new AuditLogManager();
      alm
          .addRecord(item.getProjectId(), ContentType.ITEM,
              item.getItemId(), user.getUserName(),
              "{created}");
    } catch (SQLException e) {
      multiStatementConnection.rollback();
      throw e;
    } catch (NoSuchItemException e) {
      multiStatementConnection.rollback();
      throw e;
    } catch (NoAvailableDAOException e) {
      multiStatementConnection.rollback();
      Logger.fatal("Couldn't get an item DAO", e);
      throw new NoSuchItemException("Couldn't get the item DAO: "
          + e.getMessage());
    } finally {
      multiStatementConnection.setAutoCommit(true);
      Configuration.getConnectionPool().returnConnection(
          multiStatementConnection);
View Full Code Here

TOP

Related Classes of edu.uga.galileo.voci.exception.NoSuchItemException

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.