Package org.apache.ofbiz.order.order
Class OrderListState
- java.lang.Object
-
- org.apache.ofbiz.order.order.OrderListState
-
- All Implemented Interfaces:
java.io.Serializable
public class OrderListState extends java.lang.Object implements java.io.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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
module
protected java.util.Map<java.lang.String,java.lang.String>
orderFilterState
protected int
orderListSize
protected java.util.Map<java.lang.String,java.lang.String>
orderStatusState
protected java.util.Map<java.lang.String,java.lang.String>
orderTypeState
protected static java.util.Map<java.lang.String,java.lang.String>
parameterToFilterId
protected static java.util.Map<java.lang.String,java.lang.String>
parameterToOrderStatusId
protected static java.util.Map<java.lang.String,java.lang.String>
parameterToOrderTypeId
static java.lang.String
SESSION_KEY
static java.lang.String
VIEW_INDEX_PARAM
static java.lang.String
VIEW_SIZE_PARAM
protected int
viewIndex
protected int
viewSize
-
Constructor Summary
Constructors Modifier Constructor Description protected
OrderListState()
Initializes the order list state with default values.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static OrderListState
getInstance(javax.servlet.http.HttpServletRequest request)
Retrieves the current user's OrderListState from the session or creates a new one with defaults.java.util.Map<java.lang.String,java.lang.String>
getorderFilterState()
java.util.List<GenericValue>
getOrders(java.lang.String facilityId, java.sql.Timestamp filterDate, Delegator delegator)
Get the OrderHeaders corresponding to the state.java.util.Map<java.lang.String,java.lang.String>
getOrderStatusState()
java.util.Map<java.lang.String,java.lang.String>
getOrderTypeState()
int
getSize()
int
getViewIndex()
int
getViewSize()
boolean
hasAllStatus()
boolean
hasFilter(java.lang.String param)
boolean
hasNext()
boolean
hasPrevious()
boolean
hasStatus(java.lang.String param)
boolean
hasType(java.lang.String param)
void
setStatus(java.lang.String param, boolean b)
void
setType(java.lang.String param, boolean b)
java.lang.String
toString()
void
update(javax.servlet.http.HttpServletRequest request)
Given a request, decides what state to change.
-
-
-
Field Detail
-
module
public static final java.lang.String module
-
SESSION_KEY
public static final java.lang.String SESSION_KEY
- See Also:
- Constant Field Values
-
VIEW_SIZE_PARAM
public static final java.lang.String VIEW_SIZE_PARAM
- See Also:
- Constant Field Values
-
VIEW_INDEX_PARAM
public static final java.lang.String VIEW_INDEX_PARAM
- See Also:
- Constant Field Values
-
viewSize
protected int viewSize
-
viewIndex
protected int viewIndex
-
orderStatusState
protected java.util.Map<java.lang.String,java.lang.String> orderStatusState
-
orderTypeState
protected java.util.Map<java.lang.String,java.lang.String> orderTypeState
-
orderFilterState
protected java.util.Map<java.lang.String,java.lang.String> orderFilterState
-
orderListSize
protected int orderListSize
-
parameterToOrderStatusId
protected static final java.util.Map<java.lang.String,java.lang.String> parameterToOrderStatusId
-
parameterToOrderTypeId
protected static final java.util.Map<java.lang.String,java.lang.String> parameterToOrderTypeId
-
parameterToFilterId
protected static final java.util.Map<java.lang.String,java.lang.String> parameterToFilterId
-
-
Method Detail
-
getInstance
public static OrderListState getInstance(javax.servlet.http.HttpServletRequest request)
Retrieves the current user's OrderListState from the session or creates a new one with defaults.
-
update
public void update(javax.servlet.http.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 java.util.Map<java.lang.String,java.lang.String> getOrderStatusState()
-
getOrderTypeState
public java.util.Map<java.lang.String,java.lang.String> getOrderTypeState()
-
getorderFilterState
public java.util.Map<java.lang.String,java.lang.String> getorderFilterState()
-
setStatus
public void setStatus(java.lang.String param, boolean b)
-
setType
public void setType(java.lang.String param, boolean b)
-
hasStatus
public boolean hasStatus(java.lang.String param)
-
hasType
public boolean hasType(java.lang.String param)
-
hasFilter
public boolean hasFilter(java.lang.String param)
-
hasAllStatus
public boolean hasAllStatus()
-
getViewSize
public int getViewSize()
-
getViewIndex
public int getViewIndex()
-
getSize
public int getSize()
-
hasPrevious
public boolean hasPrevious()
-
hasNext
public boolean hasNext()
-
getOrders
public java.util.List<GenericValue> getOrders(java.lang.String facilityId, java.sql.Timestamp filterDate, Delegator delegator) throws GenericEntityException
Get the OrderHeaders corresponding to the state.- Throws:
GenericEntityException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-