Package edu.uga.galileo.voci.bo

Examples of edu.uga.galileo.voci.bo.AuditLog


          .getCommand(), collectionId)) {
        errors.add("You don't have permission to edit "
            + "the requested collection.");
        goToList = true;
      } else {
        AuditLog record = alm.getRecord(Integer.parseInt(vals[0]),
            ContentType.valueOf(Integer.parseInt(vals[1])),
            (collectionId = Integer.parseInt(vals[2])), Timestamp
                .valueOf(vals[3]));
        String data = record.getDataExport();
        collection = new Collection();
        collection.fromString(data);
      }
    } catch (NullPointerException e) {
      goToList = true;
View Full Code Here


          }
        } else if (subCommand.equals("history")) {
          alm = new AuditLogManager();
          String[] vals = command.getOther().get(2).split("\\|");
          try {
            AuditLog record = alm.getRecord(Integer
                .parseInt(vals[0]), ContentType.valueOf(Integer
                .parseInt(vals[1])), metadataId, Timestamp
                .valueOf(vals[2]));
            String data = record.getDataExport();
            elem = new MetadataElement();
            elem.fromString(data);
            request.setAttribute("isDirty", "t");
          } catch (NullPointerException e) {
            errors.add("Invalid history request format.");
View Full Code Here

    {
      // userid/type/date
      // getRecord(int projectId, ContentType contentType, int contentId,
      // Timestamp update)
      projectId = new ProjectManager().getProjectID(command.getProject());
      AuditLog record = alm.getRecord(projectId, ContentType.valueOf(Integer.parseInt(vals[1])), Integer.parseInt(vals[0]),
          Timestamp.valueOf(vals[2].replace("%20", " ")));
      data = record.getDataExport();

      Logger.debug("\n\n the data looks like : " + data + "\n\n");

      user = new User();
      user.fromString(data);
View Full Code Here

          .getCommand(), communityId)) {
        errors.add("You don't have permission to edit "
            + "the requested community.");
        goToList = true;
      } else {
        AuditLog record = alm.getRecord(Integer.parseInt(vals[0]),
            ContentType.valueOf(Integer.parseInt(vals[1])),
            (communityId = Integer.parseInt(vals[2])), Timestamp
                .valueOf(vals[3]));
        String data = record.getDataExport();
        community = new Community();
        community.fromString(data);
      }
    } catch (NullPointerException e) {
      goToList = true;
View Full Code Here

      Configuration.getConnectionPool().executeQuery(qp);
      if (qp.getResultCount() < 1) {
        throw new NoSuchAuditLogRecordException(
            "No such record exists.");
      }
      AuditLog result = createObjectFromQueryParser(AuditLog.class, qp);
      // repopulate the next four bits from the method call
      result.setProjectId(projectId);
      result.setContentType(contentType);
      result.setContentId(contentId);
      result.setUpdateDate(update);
      return result;
    } catch (SQLException e) {
      Logger.warn("Audit logs records couldn't be retrieved", e);
      throw new NoSuchAuditLogRecordException(
          "SQLException prevented audit log retrieval: "
View Full Code Here

   */
  public void addRecord(int projectId, ContentType contentType,
      int contentId, String userName, String dataExport) {
    // TODO: compress the dataExport string before storing ... probably
    // in the file system rather than the db
    AuditLog record = new AuditLog(projectId, contentType, contentId,
        userName, new Timestamp(Calendar.getInstance()
            .getTimeInMillis()), dataExport);
    try {
      aldao.addRecord(record);
    } catch (SQLException e) {
      Logger.error("Couldn't add audit log record to the database: "
          + record.toString());
    }
  }
View Full Code Here

  public AuditLog getRecord(int projectId, ContentType contentType,
      int contentId, Timestamp update)
      throws NoSuchAuditLogRecordException {
    Logger.debug("Audit log sought for " + projectId + "/" + contentType
        + "/" + contentId + "/" + update.toString());
    AuditLog result = aldao.getRecord(projectId, contentType, contentId,
        update);
    // TODO: decompress the dataExport var in result (once it's getting
    // compressed above) ... or retrieve from the zipped file
    return result;
  }
View Full Code Here

            command.getCommand(), itemId)) {
          errors.add("You don't have permission to edit "
              + "the requested item.");
          goToList = true;
        } else {
          AuditLog record = alm.getRecord(Integer.parseInt(vals[0]),
              ContentType.valueOf(Integer.parseInt(vals[1])),
              (itemId = Integer.parseInt(vals[2])), Timestamp
                  .valueOf(vals[3]));
          String data = record.getDataExport();
          item = new Item();
          item.fromString(data);
        }
      } catch (NullPointerException e) {
        goToList = true;
View Full Code Here

      if ((command.getModifier() != null)
          && (command.getModifier().equals("history"))) {
        String[] vals = command.getOther().get(0).split("\\|");
        AuditLogManager alm = new AuditLogManager();
        try {
          AuditLog record = alm.getRecord(Integer.parseInt(vals[0]),
              ContentType.valueOf(Integer.parseInt(vals[1])),
              Integer.parseInt(vals[2]), Timestamp
                  .valueOf(vals[3]));
          String data = record.getDataExport();
          project = new Project();
          project.fromString(data);
          request.setAttribute("isDirty", "t");
        } catch (NullPointerException e) {
          errors.add("Invalid history request format.");
View Full Code Here

          .getCommand(), bundleId)) {
        errors.add("You don't have permission to edit "
            + "the requested bundle.");
        goToList = true;
      } else {
        AuditLog record = alm.getRecord(Integer.parseInt(vals[0]),
            ContentType.valueOf(Integer.parseInt(vals[1])),
            (bundleId = Integer.parseInt(vals[2])), Timestamp
                .valueOf(vals[3]));
        String data = record.getDataExport();
        bundle = new Bundle();
        bundle.fromString(data);
      }
    } catch (NullPointerException e) {
      goToList = true;
View Full Code Here

TOP

Related Classes of edu.uga.galileo.voci.bo.AuditLog

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.