Package com.liferay.faces.demos.model

Examples of com.liferay.faces.demos.model.Registrant


  // Private Data Members
  private Registrant registrant;

  public RegistrantModelBean() {
    registrant = new Registrant(LiferayFacesContext.getInstance().getCompanyId());
  }
View Full Code Here


  // Private Data Members
  private Boolean captchaRendered;

  public void submit(ActionEvent actionEvent) {

    Registrant submittedRegistrant = registrantModelBean.getRegistrant();
    logger.debug("Adding user firstName=[{0}], lastName=[{1}], emailAddress=[{2}], captchaText=[{3}]",
      new Object[] {
        submittedRegistrant.getFirstName(), submittedRegistrant.getLastName(),
        submittedRegistrant.getEmailAddress(), submittedRegistrant.getCaptchaText()
      });

    LiferayFacesContext liferayFacesContext = LiferayFacesContext.getInstance();
    long creatorUserId = liferayFacesContext.getUser().getUserId();
    long companyId = liferayFacesContext.getCompanyId();
    Locale locale = liferayFacesContext.getLocale();

    try {
      boolean active = true;
      boolean autoScreenName = false;
      boolean sendEmail = true;
      RegistrantServiceUtil.add(creatorUserId, companyId, locale, submittedRegistrant, active, autoScreenName,
        sendEmail);

      String key = "thank-you-for-registering";
      liferayFacesContext.addGlobalInfoMessage(key, submittedRegistrant.getEmailAddress());
      submittedRegistrant.clearProperties();
    }
    catch (DuplicateUserScreenNameException e) {
      liferayFacesContext.addGlobalErrorMessage("the-screen-name-you-requested-is-already-taken");
    }
    catch (DuplicateUserEmailAddressException e) {
View Full Code Here

TOP

Related Classes of com.liferay.faces.demos.model.Registrant

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.