Class DemandTypeService
java.lang.Object
fr.paris.lutece.plugins.crm.service.demand.DemandTypeService
DemandTypeService
-
Method Summary
Modifier and TypeMethodDescriptionbooleancheckRoleForDemandType(DemandType demandType, javax.servlet.http.HttpServletRequest request) Check if the user has the role in order to view the demand typeintcreate(DemandType demandType) Create a new demand typevoidReorder all demand typesvoiddoReorderDemandTypesGreaterOrder(int nCurrentOrder, int nOldOrder) Reorder the demand types that are greater or equal to thenCurrentOrder.voiddoReorderDemandTypesLowerOrder(int nCurrentOrder, int nOldOrder) Reorder the demand types that have a lower order than thenCurrentOrder.findAll()Find all demand typesfindByFilter(DemandTypeFilter dtFilter) Find the demand types given a filterfindByOrder(int nOrder) Find a demand type by its orderfindByPrimaryKey(int nIdDemandType) Find a demand type by its primary keyfr.paris.lutece.util.ReferenceListFind all demand types as aReferenceListfindForLuteceUser(javax.servlet.http.HttpServletRequest request) Find the list of demand types for the lutece user ordered by id categoryfindForLuteceUser(javax.servlet.http.HttpServletRequest request, int nIdCategory) Find the list of demand types for the lutece user and a categoryintFind the max order + 1Find the list of demand types that have not a date endfr.paris.lutece.util.ReferenceListGet the list of operators as aReferenceListfr.paris.lutece.util.ReferenceListGet the list of MyLutece role as aReferenceListstatic DemandTypeServiceGet the instance ofDemandTypeServicefr.paris.lutece.util.ReferenceListGet the list of targets as aReferenceListstatic voidinit()Initialize the servicebooleanCheck if the list of demand types are well orderedvoidremove(int nIdDemandType) Remove a demand typevoidupdate(DemandType demandType) Update a demand type
-
Method Details
-
getService
Get the instance ofDemandTypeService- Returns:
- the instance of
DemandTypeService
-
init
public static void init()Initialize the service -
create
Create a new demand type- Parameters:
demandType- the demand type- Returns:
- the newly created demand type ID
-
update
Update a demand type- Parameters:
demandType- the demand type
-
remove
public void remove(int nIdDemandType) Remove a demand type- Parameters:
nIdDemandType- the ID demand type
-
findByPrimaryKey
Find a demand type by its primary key- Parameters:
nIdDemandType- the id demand type- Returns:
- a
DemandType
-
findByOrder
Find a demand type by its order- Parameters:
nOrder- the order- Returns:
- a
DemandType
-
findAll
Find all demand types- Returns:
- a list of
DemandType
-
findDemandTypes
public fr.paris.lutece.util.ReferenceList findDemandTypes()Find all demand types as aReferenceList- Returns:
- a
ReferenceList
-
findMaxOrder
public int findMaxOrder()Find the max order + 1- Returns:
- the max order + 1
-
findByFilter
Find the demand types given a filter- Parameters:
dtFilter- the filter- Returns:
- a list of
DemandType
-
findForLuteceUser
public List<DemandType> findForLuteceUser(javax.servlet.http.HttpServletRequest request, int nIdCategory) Find the list of demand types for the lutece user and a category- Parameters:
request-HttpServletRequestnIdCategory- the category Id Selected- Returns:
- a list of demand Type
-
findForLuteceUser
public Map<String,List<DemandType>> findForLuteceUser(javax.servlet.http.HttpServletRequest request) Find the list of demand types for the lutece user ordered by id category- Parameters:
request-HttpServletRequest- Returns:
- a map of (id_category, List<DemandType>)
-
findNoDateEndDemandTypes
Find the list of demand types that have not a date end- Returns:
- a list of demand types
-
getRolesList
public fr.paris.lutece.util.ReferenceList getRolesList()Get the list of MyLutece role as aReferenceList- Returns:
ReferenceList
-
getOperatorsList
public fr.paris.lutece.util.ReferenceList getOperatorsList()Get the list of operators as aReferenceList- Returns:
- a
ReferenceList
-
getTargetsList
public fr.paris.lutece.util.ReferenceList getTargetsList()Get the list of targets as aReferenceList- Returns:
- a
ReferenceList
-
doReorderDemandTypes
public void doReorderDemandTypes()Reorder all demand types -
doReorderDemandTypesGreaterOrder
public void doReorderDemandTypesGreaterOrder(int nCurrentOrder, int nOldOrder) Reorder the demand types that are greater or equal to thenCurrentOrder.
Those demand types orders are move up by 1.
ThenOldOrderis ignored in the process.- Parameters:
nCurrentOrder- the current ordernOldOrder- the order to ignore
-
doReorderDemandTypesLowerOrder
public void doReorderDemandTypesLowerOrder(int nCurrentOrder, int nOldOrder) Reorder the demand types that have a lower order than thenCurrentOrder.
ThenOldOrderis ignored in the process.- Parameters:
nCurrentOrder- the current ordernOldOrder- the order to ignore
-
checkRoleForDemandType
public boolean checkRoleForDemandType(DemandType demandType, javax.servlet.http.HttpServletRequest request) Check if the user has the role in order to view the demand type- Parameters:
demandType- the demand typerequest-HttpServletRequest- Returns:
- true if the user has the role or the demand type does not require a role, false otherwise
-
isWellOrdered
public boolean isWellOrdered()Check if the list of demand types are well ordered- Returns:
- true if it is well ordered, false otherwise
-