1 package fr.paris.lutece.plugins.helpdesk.utils;
2
3 import fr.paris.lutece.portal.business.event.ResourceEvent;
4 import fr.paris.lutece.portal.business.indexeraction.IndexerAction;
5 import fr.paris.lutece.portal.service.event.ResourceEventManager;
6
7
8
9
10
11
12 public class HelpdeskIndexerUtils
13 {
14
15 public static final String CONSTANT_SUBJECT_TYPE_RESOURCE = "HELPDESK_SUBJECT";
16 public static final String CONSTANT_QUESTION_ANSWER_TYPE_RESOURCE = "HELPDESK_QUESTION_ANSWER";
17
18
19
20
21
22
23
24 public static void addIndexerAction( String strIdDocument, int nIdTask, String strResourceType )
25 {
26 ResourceEvent event = new ResourceEvent();
27 event.setIdResource( strIdDocument );
28 event.setTypeResource( strResourceType );
29 switch (nIdTask)
30 {
31 case IndexerAction.TASK_CREATE:
32 ResourceEventManager.fireAddedResource( event );
33 break;
34 case IndexerAction.TASK_MODIFY:
35 ResourceEventManager.fireUpdatedResource( event );
36 break;
37 case IndexerAction.TASK_DELETE:
38 ResourceEventManager.fireDeletedResource( event );
39 break;
40 default:
41 break;
42 }
43 }
44 }