Package com.liferay.faces.demos.dto

Examples of com.liferay.faces.demos.dto.Customer


  @PostConstruct
  public void postConstruct() {
    allCustomers = new ArrayList<Customer>();

    BookingService bookingService = getBookingService();
    Customer customer = new Customer(ID_BRIAN_GREEN, "Brian", "Green");
    customer.setBookings(bookingService.getBookingsByCustomerId(ID_BRIAN_GREEN));
    allCustomers.add(customer);
    customer = new Customer(ID_LIZ_KESSLER, "Liz", "Kessler");
    customer.setBookings(bookingService.getBookingsByCustomerId(ID_LIZ_KESSLER));
    allCustomers.add(customer);
    customer = new Customer(ID_RICH_SHEARER, "Rich", "Shearer");
    customer.setBookings(bookingService.getBookingsByCustomerId(ID_RICH_SHEARER));
    allCustomers.add(customer);
  }
View Full Code Here


    // Injected via @ManagedProperty annotation
    this.bookingService = bookingService;
  }

  public Customer getCustomer(long customerId) {
    Customer customer = null;

    for (Customer curCustomer : allCustomers) {

      if (curCustomer.getCustomerId() == customerId) {
        customer = curCustomer;
View Full Code Here

  private Customer customer;
  private List<Booking> flights;

  public BookingFlowModelBean() {
    this.cartBookings = new ArrayList<Booking>();
    this.customer = new Customer();
    clearBooking();
  }
View Full Code Here

  }

  public void selectionListener(ActionEvent actionEvent) {

    UICommand uiCommand = (UICommand) actionEvent.getComponent();
    Customer customer = (Customer) uiCommand.getValue();
    commandModelBean.setSelectedCustomer(customer);
  }
View Full Code Here

      // payload from the wrapper.
      if (value instanceof EventPayloadWrapper) {
        value = ((EventPayloadWrapper) value).getWrapped();
      }

      Customer customer = (Customer) value;
      BookingsModelBean bookingsModelBean = getBookingsModelBean(facesContext);
      bookingsModelBean.setCustomer(customer);

      String fromAction = null;
      String outcome = "ipc.customerSelected";
      eventNavigationResult = new EventNavigationResult(fromAction, outcome);
      logger.debug("Received event ipc.customerSelected for customerId=[{0}] firstName=[{1}] lastName=[{2}]",
        new Object[] { customer.getCustomerId(), customer.getFirstName(), customer.getLastName() });
    }

    return eventNavigationResult;
  }
View Full Code Here

  @PostConstruct
  public void postConstruct() {
    allCustomers = new ArrayList<Customer>();

    BookingService bookingService = getBookingService();
    Customer customer = new Customer(ID_BRIAN_GREEN, "Brian", "Green");
    customer.setBookings(bookingService.getBookingsByCustomerId(ID_BRIAN_GREEN));
    allCustomers.add(customer);
    customer = new Customer(ID_LIZ_KESSLER, "Liz", "Kessler");
    customer.setBookings(bookingService.getBookingsByCustomerId(ID_LIZ_KESSLER));
    allCustomers.add(customer);
    customer = new Customer(ID_RICH_SHEARER, "Rich", "Shearer");
    customer.setBookings(bookingService.getBookingsByCustomerId(ID_RICH_SHEARER));
    allCustomers.add(customer);
  }
View Full Code Here

  public EventNavigationResult handleEvent(FacesContext facesContext, Event event) {
    EventNavigationResult eventNavigationResult = null;
    String eventQName = event.getQName().toString();

    if (eventQName.equals("{http://liferay.com/events}ipc.customerEdited")) {
      Customer customer = (Customer) event.getValue();
      getCustomerService(facesContext).save(customer);
      logger.debug("Received event ipc.customerEdited for customerId=[{0}] firstName=[{1}] lastName=[{2}]",
        new Object[] { customer.getCustomerId(), customer.getFirstName(), customer.getLastName() });
    }

    return eventNavigationResult;
  }
View Full Code Here

  }

  public void selectionListener(ActionEvent actionEvent) {

    UICommand uiCommand = (UICommand) actionEvent.getComponent();
    Customer customer = (Customer) uiCommand.getValue();
    QName qName = new QName("http://liferay.com/events", "ipc.customerSelected");
    ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
    ActionResponse actionResponse = (ActionResponse) externalContext.getResponse();

    Serializable eventPayload = customer;
View Full Code Here

  private String selectedCustomerId;

  @PostConstruct
  public void postConstruct() {
    logger.trace("@PostConstruct annotation worked");
    customer = new Customer();
    customer.setBookings(new ArrayList<Booking>(5));

  }
View Full Code Here

    this.selectedCustomerId = selectedCustomerId;

    if (selectedCustomerId != null) {
      long customerId = Long.parseLong(selectedCustomerId);
      Customer selectedCustomer = customerService.getCustomer(customerId);
      setCustomer(selectedCustomer);
    }
  }
View Full Code Here

TOP

Related Classes of com.liferay.faces.demos.dto.Customer

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.