fr.paris.lutece.plugins.workflow.modules.alert.service
Class AlertService

java.lang.Object
  extended by fr.paris.lutece.plugins.workflow.modules.alert.service.AlertService
All Implemented Interfaces:
IAlertService

public final class AlertService
extends Object
implements IAlertService

AlertService


Field Summary
static String BEAN_SERVICE
           
 
Method Summary
 void create(Alert alert)
          Create a new alert
 void doChangeRecordState(TaskAlertConfig config, int nIdRecord, Alert alert)
          Do change the record state
 Alert find(int nIdResourceHistory, int nIdTask)
          Find an alert
 List<Alert> findAll()
          Find all alerts
 long getDate(TaskAlertConfig config, int nIdRecord, int nIdDirectory)
          Get the date
 fr.paris.lutece.util.ReferenceList getListDirectories()
          Get the list of directories
 List<fr.paris.lutece.plugins.directory.business.IEntry> getListEntries(int nIdTask)
          Get the list of entries from a given id task
 fr.paris.lutece.util.ReferenceList getListEntriesDate(int nIdTask, Locale locale)
          Get the list of entries that have the accepted type (which are defined in workflow-alert.properties)
 fr.paris.lutece.util.ReferenceList getListStates(int nIdAction)
          Get the list of states
 fr.paris.lutece.plugins.directory.business.Record getRecord(Alert alert)
          Get the record from a given Alert
 String getRecordFieldValue(int nPosition, int nIdRecord, int nIdDirectory)
          Get the record field value
 boolean isEntryTypeDateAccepted(int nIdEntryType)
          Check if the given entry type id is accepted for the date
 boolean isRecordStateValid(TaskAlertConfig config, fr.paris.lutece.plugins.directory.business.Record record, Locale locale)
          Check if the record has the same state before executing the action
 void removeByHistory(int nIdResourceHistory, int nIdTask)
          Remove an alert by id history
 void removeByTask(int nIdTask)
          Remove an alert by id task
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BEAN_SERVICE

public static final String BEAN_SERVICE
See Also:
Constant Field Values
Method Detail

create

@Transactional(value="workflow-alert.transactionManager")
public void create(Alert alert)
Create a new alert

Specified by:
create in interface IAlertService
Parameters:
alert - the alert

removeByHistory

@Transactional(value="workflow-alert.transactionManager")
public void removeByHistory(int nIdResourceHistory,
                                          int nIdTask)
Remove an alert by id history

Specified by:
removeByHistory in interface IAlertService
Parameters:
nIdResourceHistory - the id history
nIdTask - the id task

removeByTask

@Transactional(value="workflow-alert.transactionManager")
public void removeByTask(int nIdTask)
Remove an alert by id task

Specified by:
removeByTask in interface IAlertService
Parameters:
nIdTask - the id task

find

public Alert find(int nIdResourceHistory,
                  int nIdTask)
Find an alert

Specified by:
find in interface IAlertService
Parameters:
nIdResourceHistory - the id history
nIdTask - the id task
Returns:
an Alert

findAll

public List<Alert> findAll()
Find all alerts

Specified by:
findAll in interface IAlertService
Returns:
a list of Alert

isEntryTypeDateAccepted

public boolean isEntryTypeDateAccepted(int nIdEntryType)
Check if the given entry type id is accepted for the date

Specified by:
isEntryTypeDateAccepted in interface IAlertService
Parameters:
nIdEntryType - the id entry type
Returns:
true if it is accepted, false otherwise

isRecordStateValid

public boolean isRecordStateValid(TaskAlertConfig config,
                                  fr.paris.lutece.plugins.directory.business.Record record,
                                  Locale locale)
Check if the record has the same state before executing the action

Specified by:
isRecordStateValid in interface IAlertService
Parameters:
config - the config
record - the record
locale - the locale
Returns:
true if the record has a valid state, false otherwise

getListEntries

public List<fr.paris.lutece.plugins.directory.business.IEntry> getListEntries(int nIdTask)
Get the list of entries from a given id task

Specified by:
getListEntries in interface IAlertService
Parameters:
nIdTask - the id task
Returns:
a list of IEntry

getListEntriesDate

public fr.paris.lutece.util.ReferenceList getListEntriesDate(int nIdTask,
                                                             Locale locale)
Get the list of entries that have the accepted type (which are defined in workflow-alert.properties)

Specified by:
getListEntriesDate in interface IAlertService
Parameters:
nIdTask - the id task
locale - the Locale
Returns:
a ReferenceList

getListDirectories

public fr.paris.lutece.util.ReferenceList getListDirectories()
Get the list of directories

Specified by:
getListDirectories in interface IAlertService
Returns:
a ReferenceList

getListStates

public fr.paris.lutece.util.ReferenceList getListStates(int nIdAction)
Get the list of states

Specified by:
getListStates in interface IAlertService
Parameters:
nIdAction - the id action
Returns:
a ReferenceList

getRecord

public fr.paris.lutece.plugins.directory.business.Record getRecord(Alert alert)
Get the record from a given Alert

Specified by:
getRecord in interface IAlertService
Parameters:
alert - the alert
Returns:
a Record

getDate

public long getDate(TaskAlertConfig config,
                    int nIdRecord,
                    int nIdDirectory)
Get the date

Specified by:
getDate in interface IAlertService
Parameters:
config - the config
nIdRecord - the id record
nIdDirectory - the id directory
Returns:
the date

getRecordFieldValue

public String getRecordFieldValue(int nPosition,
                                  int nIdRecord,
                                  int nIdDirectory)
Get the record field value

Specified by:
getRecordFieldValue in interface IAlertService
Parameters:
nPosition - the position of the entry
nIdRecord - the id record
nIdDirectory - the id directory
Returns:
the record field value

doChangeRecordState

public void doChangeRecordState(TaskAlertConfig config,
                                int nIdRecord,
                                Alert alert)
Do change the record state

Specified by:
doChangeRecordState in interface IAlertService
Parameters:
config - the config
nIdRecord - the id record
alert - the alert


Copyright © 2013 Mairie de Paris. All Rights Reserved.