Package com.agiletec.plugins.jpcontentworkflow.aps.system.services.notifier.model

Examples of com.agiletec.plugins.jpcontentworkflow.aps.system.services.notifier.model.ContentStatusChangedEventInfo


    this._helper.deleteContentEvents();
    super.tearDown();
  }
 
  public void testSaveContentEvent() throws Throwable {
    ContentStatusChangedEventInfo statusChangedInfo = this.prepareContentEventInfo();
    try {
      this._notifierDao.saveContentEvent(statusChangedInfo);
      Map<String, List<ContentStatusChangedEventInfo>> statusChangedInfos = this._notifierDao.getEventsToNotify();
      assertEquals(1, statusChangedInfos.size());
      List<ContentStatusChangedEventInfo> artStatusChangedInfos = statusChangedInfos.get("ART");
      assertEquals(1, artStatusChangedInfos.size());
      ContentStatusChangedEventInfo addedStatusChangedInfo = artStatusChangedInfos.get(0);
      this.compareContentEvents(statusChangedInfo, addedStatusChangedInfo);
    } catch (Throwable t) {
      throw t;
    }
  }
View Full Code Here


      throw t;
    }
  }
 
  public void testSignNotifiedEvents() throws Throwable {
    ContentStatusChangedEventInfo event = this.prepareContentEventInfo();
    try {
      assertEquals(0, this._notifierDao.getEventsToNotify().size());
      this._notifierDao.saveContentEvent(event);
      assertEquals(1, this._notifierDao.getEventsToNotify().size());
     
View Full Code Here

    assertEquals(info1.getMainGroup(), info2.getMainGroup());
    assertEquals(info1.getStatus(), info2.getStatus());
  }
 
  private ContentStatusChangedEventInfo prepareContentEventInfo() {
    ContentStatusChangedEventInfo statusChangedInfo = new ContentStatusChangedEventInfo();
    statusChangedInfo.setContentId("ART1");
    statusChangedInfo.setContentTypeCode("ART");
    statusChangedInfo.setContentDescr("contentDescr");
    statusChangedInfo.setDate(new Date());
    statusChangedInfo.setMainGroup("free");
    statusChangedInfo.setStatus(Content.STATUS_DRAFT);
    return statusChangedInfo;
  }
View Full Code Here

  }
 
  private Map<String, List<ContentStatusChangedEventInfo>> extractContentMailInfoFromResultSet(ResultSet res) throws SQLException {
    Map<String, List<ContentStatusChangedEventInfo>> eventsToNotify = new HashMap<String, List<ContentStatusChangedEventInfo>>();
    while (res.next()) {
      ContentStatusChangedEventInfo event = new ContentStatusChangedEventInfo();
      event.setId(res.getInt(1));
      event.setDate(res.getDate(2));
      event.setContentId(res.getString(3));
      String contentType = res.getString(4);
      event.setContentTypeCode(contentType);
      event.setContentDescr(res.getString(5));
      event.setMainGroup(res.getString(6));
      event.setStatus(res.getString(7));
      List<ContentStatusChangedEventInfo> contentTypeEvents = (List<ContentStatusChangedEventInfo>) eventsToNotify.get(contentType);
      if (contentTypeEvents == null) {
        contentTypeEvents = new ArrayList<ContentStatusChangedEventInfo>();
        eventsToNotify.put(contentType, contentTypeEvents);
      }
View Full Code Here

  }

  protected void saveContentStatusChanged(Content content) {
    if (this.getWorkflowNotifierConfig().isActive()) {
      try {
        ContentStatusChangedEventInfo statusChangedInfo = new ContentStatusChangedEventInfo();
        statusChangedInfo.setContentId(content.getId());
        statusChangedInfo.setContentTypeCode(content.getTypeCode());
        statusChangedInfo.setContentDescr(content.getDescr());
        statusChangedInfo.setMainGroup(content.getMainGroup());
        statusChangedInfo.setDate(new Date());
        statusChangedInfo.setStatus(content.getStatus());
        this.getNotifierDAO().saveContentEvent(statusChangedInfo);
      } catch (Throwable t) {
        ApsSystemUtils.logThrowable(t, this, "saveContentStatusChanged",
            "Error saving content status changed event" + content.getId());
      }
View Full Code Here

    try {
      conn = this.getConnection();
      stat = conn.createStatement();
      res = stat.executeQuery(LOAD_ALL_EVENTS_TO_BE_NOTIFIED);
      while (res.next()) {
        ContentStatusChangedEventInfo event = new ContentStatusChangedEventInfo();
        event.setId(res.getInt(1));
        event.setDate(res.getTimestamp(2));
        event.setContentId(res.getString(3));
        String contentType = res.getString(4);
        event.setContentTypeCode(contentType);
        event.setContentDescr(res.getString(5));
        event.setMainGroup(res.getString(6));
        event.setStatus(res.getString(7));
        List<ContentStatusChangedEventInfo> contentTypeEvents = (List<ContentStatusChangedEventInfo>) eventsToNotify.get(contentType);
        if (contentTypeEvents == null) {
          contentTypeEvents = new ArrayList<ContentStatusChangedEventInfo>();
          eventsToNotify.put(contentType, contentTypeEvents);
        }
View Full Code Here

TOP

Related Classes of com.agiletec.plugins.jpcontentworkflow.aps.system.services.notifier.model.ContentStatusChangedEventInfo

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.