Esempio n. 1
0
  @Override
  public void addPushedToEpic(Protocol protocol) {
    try {
      String protocolMetaData = protocol.getMetaDataXml();

      protocolMetaData =
          xmlProcessor.replaceOrAddNodeValueByPath(
              "/protocol/pushed-to-epic", protocolMetaData, "y");

      protocolMetaData =
          xmlProcessor.replaceOrAddNodeValueByPath(
              "/protocol/pushed-to-epic-date",
              protocolMetaData,
              DateFormatUtil.formateDateToMDY(new Date()));

      protocol.setMetaDataXml(protocolMetaData);

      protocol = protocolDao.saveOrUpdate(protocol);

    } catch (Exception e) {
      // don't care
    }
  }
Esempio n. 2
0
  @Override
  public void setProtocolStatus(
      Protocol protocol,
      ProtocolStatusEnum protocolStatusEnum,
      User user,
      Committee committee,
      String note) {
    try {
      ProtocolStatus protocolStatus = new ProtocolStatus();
      protocolStatus.setCauseByUser(user);
      protocolStatus.setCausedByCommittee(committee);
      protocolStatus.setModified(new Date());
      protocolStatus.setNote(note);
      protocolStatus.setProtocol(protocol);
      protocolStatus.setProtocolStatus(protocolStatusEnum);
      protocolStatus.setRetired(Boolean.FALSE);

      protocolStatusDao.saveOrUpdate(protocolStatus);

      String protocolMetaDataXml = protocol.getMetaDataXml();

      protocolMetaDataXml =
          xmlProcessor.replaceOrAddNodeValueByPath(
              "/protocol/status",
              protocolMetaDataXml,
              org.apache.commons.lang.StringEscapeUtils.escapeXml(
                  protocolStatusEnum.getDescription()));

      Map<String, String> attributes = Maps.newHashMap();
      attributes.put("priority", protocolStatusEnum.getPriorityLevel());

      protocolMetaDataXml =
          xmlProcessor.addAttributesByPath("/protocol/status", protocolMetaDataXml, attributes);

      protocol.setMetaDataXml(protocolMetaDataXml);
      protocolDao.saveOrUpdate(protocol);

    } catch (Exception e) {
      e.printStackTrace();
    }
  }