Package com.agiletec.plugins.jpwebdynamicform.aps.system.services.message.model

Examples of com.agiletec.plugins.jpwebdynamicform.aps.system.services.message.model.Message


  }
 
  @Override
  public String answer() {
    try {
      Message message = this.getMessage();
      if (message==null) {
        this.addActionError(this.getText("Message.message.notFound"));
        return "messageNotFound";
      } else if (!this.checkEmailAddress()) {
        return "messageNotFound";
View Full Code Here


  }
 
  @Override
  public String trash() {
    try {
      Message message = this.getMessage();
      if (message==null) {
        this.addActionError(this.getText("Message.message.notFound"));
        return "messageNotFound";
      }
    } catch(Throwable t) {
View Full Code Here

  }
 
  @Override
  public String delete() {
    try {
      Message message = this.getMessage();
      if (message==null) {
        this.addActionError(this.getText("Message.message.notFound"));
        return "messageNotFound";
      }
      this.getMessageManager().deleteMessage(message.getId());
    } catch(Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "answer");
      return FAILURE;
    }
    return SUCCESS;
View Full Code Here

    return attributeName.equals(this.getEmailAttribute());
  }
 
  protected String getEmailAttribute() {
    if (this._emailAttributeName==null) {
      Message message = this.getMessage();
      String mailAttributeName = this.getMessageManager().getMailAttributeName(message.getTypeCode());
      if (null!=mailAttributeName) {
        this._emailAttributeName = mailAttributeName!=null ? mailAttributeName : "";
      }
    }
    return this._emailAttributeName;
View Full Code Here

    return answer;
  }
 
  protected boolean checkEmailAddress() {
    boolean validated = false;
    Message message = this.getMessage();
    String mailAttributeName = this.getMessageManager().getMailAttributeName(message.getTypeCode());
    if (null!=mailAttributeName) {
      ITextAttribute mailAttribute = (ITextAttribute) this.getMessage().getAttribute(mailAttributeName);
      if (null!=mailAttribute) {
        String eMail = mailAttribute.getText();
        if (null!=eMail && eMail.length()>0 && EmailAddressValidator.isValidEmailAddress(eMail)) {
View Full Code Here

   
    public JAXBMessage() {}
   
    public JAXBMessage(IApsEntity mainEntity, String langCode) {
        super(mainEntity, langCode);
        Message message = (Message) mainEntity;
        this.setCreationDate(message.getCreationDate());
    this.setLangCode(message.getLangCode());
    this.setUsername(message.getUsername());
    }
View Full Code Here

    return ADD_MESSAGE;
  }

  @Override
  protected void buildAddEntityStatement(IApsEntity entity, PreparedStatement stat) throws Throwable {
    Message message = (Message) entity;
    stat.setString(1, message.getId());
    stat.setString(2, message.getUsername());
    stat.setString(3, message.getLangCode());
    stat.setString(4, message.getTypeCode());
    stat.setTimestamp(5, new Timestamp(message.getCreationDate().getTime()));
    stat.setString(6, message.getXML());
  }
View Full Code Here

    this.setLangCode(message.getLangCode());
    this.setUsername(message.getUsername());
    }
   
    public IApsEntity buildEntity(IApsEntity prototype, ICategoryManager categoryManager) {
        Message message = (Message) super.buildEntity(prototype, categoryManager);
        //this.setCreationDate(message.getCreationDate());
    message.setLangCode(this.getLangCode());
    message.setUsername(this.getUsername());
    return message;
    }
View Full Code Here

    super.setUp();
    this.activeMailManager(false);
  }
 
  public void testCreateMessageType() {
    Message message = this._messageManager.createMessageType("PER");
    Collection<String> attributes = message.getAttributeMap().keySet();
    assertEquals(5, attributes.size());
    assertTrue(attributes.contains("Name"));
    assertTrue(attributes.contains("Surname"));
    assertTrue(attributes.contains("Address"));
    assertTrue(attributes.contains("eMail"));
    assertTrue(attributes.contains("Note"));
   
    message = this._messageManager.createMessageType("COM");
    attributes = message.getAttributeMap().keySet();
    assertEquals(4, attributes.size());
    assertTrue(attributes.contains("Company"));
    assertTrue(attributes.contains("Address"));
    assertTrue(attributes.contains("eMail"));
    assertTrue(attributes.contains("Note"));
View Full Code Here

  public void testLoadMessagesId() throws Throwable {
    List<String> messageIds = this._messageManager.loadMessagesId(null);
    assertEquals(0, messageIds.size());
   
    Date currentDate = new Date();
    Message message1 = this._helper.createMessage(null, "admin", "it", currentDate, "MyName", "MySurname", "MyAddress", JpwebdynamicformTestHelper.EMAIL, "MyNotes");
    this._helper.addMessage(message1);
    messageIds = this._messageManager.loadMessagesId(null);
    assertEquals(1, messageIds.size());
   
    Message message2 = this._helper.createMessage(null, "admin", "it", currentDate, "MyCompany", "MyAddress", JpwebdynamicformTestHelper.EMAIL, "MyNotes");
    this._helper.addMessage(message2);
    messageIds = this._messageManager.loadMessagesId(null);
    assertEquals(2, messageIds.size());
   
    EntitySearchFilter filter = new EntitySearchFilter(IEntityManager.ENTITY_TYPE_CODE_FILTER_KEY, false, "PER", true);
View Full Code Here

TOP

Related Classes of com.agiletec.plugins.jpwebdynamicform.aps.system.services.message.model.Message

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.