fr.paris.lutece.plugins.crm.service.demand
Class DemandService

java.lang.Object
  extended by fr.paris.lutece.plugins.crm.service.demand.DemandService

public class DemandService
extends Object

DemandService


Constructor Summary
protected DemandService()
          Constructor
 
Method Summary
 int countByFilter(DemandFilter dFilter)
          Count results by filter
 int create(Demand demand)
          Create a new demand
 List<Demand> findAll()
          Find all demands
 List<Demand> findByFilter(DemandFilter dFilter)
          Find by filter
 Map<String,List<Demand>> findByFilterMap(DemandFilter dFilter, Locale locale, PaginationFilterSortManager paginationFilterSortManager)
          Find by filter with map
 List<Demand> findByFilterWithPagination(DemandFilter dFilter, IPaginationProperties paginationProperties)
          Find by filter with pagination
 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
 Demand findByPrimaryKey(int nIdDemand)
          Find a demand by its primary key
static DemandService getService()
          Get an instance of DemandService
 void remove(int nIdDemand)
          Remove a demand
 void removeByIdDemandType(int nIdDemandType)
          Remove the demands given an id demand type
 void removeWithItsResource(int nIdDemand, boolean bByDaemon)
          Remove a demand and its resource
 void update(Demand demand)
          Update a demand
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DemandService

protected DemandService()
Constructor

Method Detail

getService

public static DemandService getService()
Get an instance of DemandService

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

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

findAll

public List<Demand> findAll()
Find all demands

Returns:
a list of Demand

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 id
locale - Locale
nIdStatusToSort - the id status of demands that will be sorted
listDemandSort - 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 id
locale - 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 filter
paginationProperties - 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


Copyright © 2013 Mairie de Paris. All Rights Reserved.