Package org.apache.ofbiz.order.order
Class OrderListState
java.lang.Object
org.apache.ofbiz.order.order.OrderListState
- All Implemented Interfaces:
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 Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
Initializes the order list state with default values. -
Method Summary
Modifier and TypeMethodDescriptionstatic OrderListState
getInstance
(HttpServletRequest request) Retrieves the current user's OrderListState from the session or creates a new one with defaults.Gets filter state.Get the OrderHeaders corresponding to the state.Gets order status state.Gets order type state.int
getSize()
Gets size.int
Gets view index.int
Gets view size.boolean
Has all status boolean.boolean
Has filter boolean.boolean
hasNext()
Has next boolean.boolean
Has previous boolean.boolean
Has status boolean.boolean
Has type boolean.void
Sets status.void
Sets type.toString()
void
update
(HttpServletRequest request) Given a request, decides what state to change.
-
Field Details
-
SESSION_KEY
- See Also:
-
VIEW_SIZE_PARAM
- See Also:
-
VIEW_INDEX_PARAM
- See Also:
-
PARAM_TO_ORDER_STATUS_ID
-
PARAM_TO_ORDER_TYPE_ID
-
PARAM_TO_FILTER_ID
-
-
Constructor Details
-
OrderListState
protected OrderListState()Initializes the order list state with default values. Do not use directly, instead use getInstance().
-
-
Method Details
-
getInstance
Retrieves the current user's OrderListState from the session or creates a new one with defaults. -
update
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
Gets order status state.- Returns:
- the order status state
-
getOrderTypeState
Gets order type state.- Returns:
- the order type state
-
getorderFilterState
Gets filter state.- Returns:
- the filter state
-
setStatus
Sets status.- Parameters:
param
- the paramb
- the b
-
setType
Sets type.- Parameters:
param
- the paramb
- the b
-
hasStatus
Has status boolean.- Parameters:
param
- the param- Returns:
- the boolean
-
hasType
Has type boolean.- Parameters:
param
- the param- Returns:
- the boolean
-
hasFilter
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
-