Class DemandService
- java.lang.Object
-
- fr.paris.lutece.plugins.crm.service.demand.DemandService
-
public class DemandService extends Object
DemandService
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcountByFilter(DemandFilter dFilter)Count results by filterintcreate(Demand demand)Create a new demandList<Demand>findAll()Find all demandsList<Demand>findByFilter(DemandFilter dFilter)Find by filterMap<String,List<Demand>>findByFilterMap(DemandFilter dFilter, Locale locale, PaginationFilterSortManager paginationFilterSortManager)Find by filter with mapList<Demand>findByFilterWithPagination(DemandFilter dFilter, IPaginationProperties paginationProperties)Find by filter with paginationMap<String,List<Demand>>findByIdCRMUser(int nIdCRMUser, Locale locale, int nIdStatusToSort, List<DemandSort> listDemandSort)Find the demands given an user crm id, results can be sortedDemandfindByPrimaryKey(int nIdDemand)Find a demand by its primary keyDemandfindByRemoteKey(String strRemoteId, int nIdDemandType)Find a demand by Remote keystatic DemandServicegetService()Get an instance ofDemandServicevoidremove(int nIdDemand)Remove a demandvoidremoveByIdDemandType(int nIdDemandType)Remove the demands given an id demand typevoidremoveWithItsResource(int nIdDemand, boolean bByDaemon)Remove a demand and its resourcevoidupdate(Demand demand)Update a demand
-
-
-
Method Detail
-
getService
public static DemandService getService()
Get an instance ofDemandService- Returns:
- an instance of
DemandService
-
findByPrimaryKey
public Demand findByPrimaryKey(int nIdDemand)
Find a demand by its primary key- Parameters:
nIdDemand- the id demand- Returns:
- a
Demand
-
findByRemoteKey
public Demand findByRemoteKey(String strRemoteId, int nIdDemandType)
Find a demand by Remote key- Parameters:
strRemoteId- the remote IdnIdDemandType- the idDemandType- Returns:
- a
Demand
-
create
public int create(Demand demand)
Create a new demand- Parameters:
demand- the demand- Returns:
- the newly created demand id
-
update
public void update(Demand demand)
Update a demand- Parameters:
demand- the demand
-
remove
public void remove(int nIdDemand)
Remove a demand- Parameters:
nIdDemand- the id demand
-
removeWithItsResource
public void removeWithItsResource(int nIdDemand, boolean bByDaemon)Remove a demand and its resource- Parameters:
nIdDemand- the id demand
-
removeByIdDemandType
public void removeByIdDemandType(int nIdDemandType)
Remove the demands given an id demand type- Parameters:
nIdDemandType- the id demand type
-
findByFilter
public List<Demand> findByFilter(DemandFilter dFilter)
Find by filter- Parameters:
dFilter- the filter- Returns:
- a list of
Demand
-
findByIdCRMUser
public Map<String,List<Demand>> findByIdCRMUser(int nIdCRMUser, Locale locale, int nIdStatusToSort, List<DemandSort> listDemandSort)
Find the demands given an user crm id, results can be sorted- Parameters:
nIdCRMUser- the user crm idlocale-LocalenIdStatusToSort- the id status of demands that will be sortedlistDemandSort- the sorts to apply- Returns:
- a map of (id_status_crm, List<Demand>)
-
findByFilterMap
public Map<String,List<Demand>> findByFilterMap(DemandFilter dFilter, Locale locale, PaginationFilterSortManager paginationFilterSortManager)
Find by filter with map- Parameters:
nIdCRMUser- the user crm idlocale-Locale- Returns:
- a map of (id_status_crm, List<Demand>)
-
findByFilterWithPagination
public List<Demand> findByFilterWithPagination(DemandFilter dFilter, IPaginationProperties paginationProperties)
Find by filter with pagination- Parameters:
dFilter- the filterpaginationProperties- the pagination properties- Returns:
- a list of
Demand
-
countByFilter
public int countByFilter(DemandFilter dFilter)
Count results by filter- Parameters:
dFilter- the filter- Returns:
- the number of results
-
-