Class OrderListState

java.lang.Object
org.apache.ofbiz.order.order.OrderListState
All Implemented Interfaces:
Serializable

public class OrderListState extends Object implements Serializable
Session object for keeping track of the list of orders. The state of the list is preserved here instead of via url parameters, which can get messy. There are three types of state: Order State, Order Type, and pagination position. Also provides convenience methods for retrieving the right set of data for a particular state. TODO: this can be generalized to use a set of State objects, including Pagination. Think about design patterns in Fowler.
See Also:
  • Field Details

  • Constructor Details

    • OrderListState

      protected OrderListState()
      Initializes the order list state with default values. Do not use directly, instead use getInstance().
  • Method Details

    • getInstance

      public static OrderListState getInstance(HttpServletRequest request)
      Retrieves the current user's OrderListState from the session or creates a new one with defaults.
    • update

      public void update(HttpServletRequest request)
      Given a request, decides what state to change. If a parameter changeStatusAndTypeState is present with value "Y", the status and type state will be updated. Otherwise, if the viewIndex and viewSize parameters are present, the pagination changes.
    • getOrderStatusState

      public Map<String,String> getOrderStatusState()
      Gets order status state.
      Returns:
      the order status state
    • getOrderTypeState

      public Map<String,String> getOrderTypeState()
      Gets order type state.
      Returns:
      the order type state
    • getorderFilterState

      public Map<String,String> getorderFilterState()
      Gets filter state.
      Returns:
      the filter state
    • setStatus

      public void setStatus(String param, boolean b)
      Sets status.
      Parameters:
      param - the param
      b - the b
    • setType

      public void setType(String param, boolean b)
      Sets type.
      Parameters:
      param - the param
      b - the b
    • hasStatus

      public boolean hasStatus(String param)
      Has status boolean.
      Parameters:
      param - the param
      Returns:
      the boolean
    • hasType

      public boolean hasType(String param)
      Has type boolean.
      Parameters:
      param - the param
      Returns:
      the boolean
    • hasFilter

      public boolean hasFilter(String param)
      Has filter boolean.
      Parameters:
      param - the param
      Returns:
      the boolean
    • hasAllStatus

      public boolean hasAllStatus()
      Has all status boolean.
      Returns:
      the boolean
    • getViewSize

      public int getViewSize()
      Gets view size.
      Returns:
      the view size
    • getViewIndex

      public int getViewIndex()
      Gets view index.
      Returns:
      the view index
    • getSize

      public int getSize()
      Gets size.
      Returns:
      the size
    • hasPrevious

      public boolean hasPrevious()
      Has previous boolean.
      Returns:
      the boolean
    • hasNext

      public boolean hasNext()
      Has next boolean.
      Returns:
      the boolean
    • getOrders

      public List<GenericValue> getOrders(String facilityId, Timestamp filterDate, Delegator delegator) throws GenericEntityException
      Get the OrderHeaders corresponding to the state.
      Throws:
      GenericEntityException
    • toString

      public String toString()
      Overrides:
      toString in class Object