Examples of WebMailIntroInfo


Examples of com.agiletec.plugins.jpwebmail.aps.tags.util.WebMailIntroInfo

  @Override
  public int doStartTag() throws JspException {
    HttpSession session = this.pageContext.getSession();
    IWebMailManager webmailManager = (IWebMailManager) ApsWebApplicationUtils.getBean(JpwebmailSystemConstants.WEBMAIL_MANAGER, pageContext);
    Store store = null;
    WebMailIntroInfo info = new WebMailIntroInfo();
    try {
      UserDetails currentUser = (UserDetails) session.getAttribute(SystemConstants.SESSIONPARAM_CURRENT_USER);
      if (currentUser.getUsername().equals(SystemConstants.GUEST_USER_NAME)) return super.doStartTag();
      if (currentUser.getUsername().equals(SystemConstants.ADMIN_USER_NAME) && !this.isCheckAdmin()) return super.doStartTag();
      store = webmailManager.initInboxConnection(currentUser.getUsername(), currentUser.getPassword());
    } catch (Throwable t) {
      webmailManager.closeConnection(store);
      this.pageContext.setAttribute(this.getVar(), info);
      ApsSystemUtils.logThrowable(t, this, "doStartTag");
      return super.doStartTag();
    }
    try {
      Folder inboxFolder = store.getFolder("INBOX");
      info.setExistMailbox(true);
      info.setMessageCount(inboxFolder.getMessageCount());
      info.setNewMessageCount(inboxFolder.getNewMessageCount());
      info.setUnreadMessageCount(inboxFolder.getUnreadMessageCount());
      this.pageContext.setAttribute(this.getVar(), info);
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "doStartTag");
      throw new JspException("Errore inizializzazione tag", t);
    } finally {
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.