/** default constructor */
  public CorrespondenceViewBean() {
    super("correspondenceView");
    attachments = new ArrayList<Attachment>();
    Document document =
        (Document) PortalApplication.getInstance().getFocusView().getViewParams().get("attachment");
    if (null != document) {
      addAttachments(new Attachment(document, DocumentMgmtUtility.getDocumentManagementService()));
    }
    String procInstOID =
        (String)
            PortalApplication.getInstance()
                .getFocusView()
                .getViewParams()
                .get("processInstanceOID");
    processInstance = ProcessInstanceUtils.getProcessInstance(Long.valueOf(procInstOID));
    requestParamMap.put("To", "toaddressess");
    requestParamMap.put("Cc", "ccaddressess");
    requestParamMap.put("Bcc", "bccaddressess");
    requestParamMap.put("Fax", "faxaddressess");
    dropBoxEffect = new Pulsate(EFFECT_DURATION);
    dropBoxEffect.setFired(true);

    // set sender's mail address
    String emailId = getMailSender();
    emailId =
        (emailId == null || emailId.equals(""))
            ? DocumentMgmtUtility.getUser().getEMail()
            : emailId;
    emailId =
        (emailId == null || emailId.equals(""))
            ? Parameters.instance().getString(EngineProperties.MAIL_SENDER)
            : emailId;
    setMailSender(emailId);

    pdfConverterHelper = new PDFConverterHelper();
    printAvailable = pdfConverterHelper.isPDFConverterAvailable();

    correspondenceAttachments =
        new CorrespondenceAttachments(
            new CorrespondenceAttachmentsHandler() {
              public boolean addAttachment(Document document) {
                return CorrespondenceViewBean.this.addAttachments(
                    new Attachment(document, DocumentMgmtUtility.getDocumentManagementService()));
              }

              public boolean addTemplate(Document document, AddPolicy addPolicy) {
                return CorrespondenceViewBean.this.addTemplate(
                    document, AddPolicy.AT_TOP == addPolicy);
              }

              public boolean isDocumentTemplate(Document document) {
                return CorrespondenceViewBean.this.isDocumentTemplate(document);
              }
            });
  }
예제 #2
0
  @SuppressWarnings({"UnusedParameters"})
  public void validateLogin(FacesContext context, UIComponent toValidate, Object login) {
    String loginStr = (String) login;
    UIInput valInput = (UIInput) toValidate;

    if (loginStr.trim().length() == 0) {
      FacesUtil.messageError("login", "Небходимо ввести имя пользователя.", null);
      valInput.setValid(false);
    } else if (!usersService.isLoginRegistered(loginStr)) {
      FacesUtil.messageError(
          "login", "Пользователь " + login + " не зарегистрирован в системе", null);
      valInput.setValid(false);
    }

    if (!valInput.isValid()) {
      effect.setFired(false);
    }
  }
예제 #3
0
 public PassRecoveryPageBean() {
   effect = new Pulsate(1.1f);
   effect.setFired(true);
 }
 public SelectInputDateBean() {
   super();
   valueChangeEffect2 = new Highlight("#fda505");
   valueChangeEffect2.setFired(true);
 }
 /**
  * When values change event occures on date2 then we reset the effect so the user can see the
  * changed value more easily.
  *
  * @param event JSF value change event.
  */
 public void effect2ChangeListener(ValueChangeEvent event) {
   valueChangeEffect2.setFired(false);
 }