Examples of NoSuchItemException


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

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

    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

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

      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

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

    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

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

    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

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

    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

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

      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

Examples of org.apache.mahout.cf.taste.common.NoSuchItemException

 
  @Override
  public PreferenceArray getPreferencesForItem(long itemID) throws NoSuchItemException {
    FastIDSet userIDs = preferenceForItems.get(itemID);
    if (userIDs == null) {
      throw new NoSuchItemException();
    }
    PreferenceArray prefArray = new BooleanItemPreferenceArray(userIDs.size());
    int i = 0;
    LongPrimitiveIterator it = userIDs.iterator();
    while (it.hasNext()) {
View Full Code Here

Examples of org.apache.mahout.cf.taste.common.NoSuchItemException

    if (itemIDs.length == 0) {
      return 0;
    }
    FastIDSet userIDs = preferenceForItems.get(itemIDs[0]);
    if (userIDs == null) {
      throw new NoSuchItemException();
    }
    FastIDSet intersection = new FastIDSet(userIDs.size());
    intersection.addAll(userIDs);
    int i = 1;
    while (!intersection.isEmpty() && (i < itemIDs.length)) {
      userIDs = preferenceForItems.get(itemIDs[i]);
      if (userIDs == null) {
        throw new NoSuchItemException();
      }
      intersection.retainAll(userIDs);
      i++;
    }
    return intersection.size();
View Full Code Here

Examples of org.apache.mahout.cf.taste.common.NoSuchItemException

      rs = stmt.executeQuery();
     
      if (rs.next()) {
        return rs.getDouble(1);
      } else {
        throw new NoSuchItemException();
      }
     
    } catch (SQLException sqle) {
      log.warn("Exception while retrieving user", sqle);
      throw new TasteException(sqle);
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.