1 package fr.paris.lutece.plugins.appointment.web.file;
2
3 import fr.paris.lutece.plugins.appointment.business.display.Display;
4 import fr.paris.lutece.plugins.appointment.service.DisplayService;
5 import fr.paris.lutece.portal.service.image.ImageResource;
6 import fr.paris.lutece.portal.service.image.ImageResourceManager;
7 import fr.paris.lutece.portal.service.image.ImageResourceProvider;
8 import fr.paris.lutece.portal.service.init.LuteceInitException;
9 import org.apache.commons.fileupload.FileItem;
10
11
12
13
14 public class AppointmentFormIconService implements ImageResourceProvider
15 {
16 private static AppointmentFormIconServicee/AppointmentFormIconService.html#AppointmentFormIconService">AppointmentFormIconService _singleton = new AppointmentFormIconService( );
17 private static final String IMAGE_RESOURCE_TYPE_ID = "appointmentForm_icon";
18
19
20
21
22 private AppointmentFormIconService( )
23 {
24 }
25
26
27
28
29
30
31
32 public static synchronized void init( )
33 {
34 getInstance( ).register( );
35 }
36
37
38
39
40 public void register( )
41 {
42 ImageResourceManager.registerProvider( this );
43 }
44
45
46
47
48
49
50 public static AppointmentFormIconService getInstance( )
51 {
52 return _singleton;
53 }
54
55
56
57
58
59
60
61
62 @Override
63 public ImageResource getImageResource( int nIdResource )
64 {
65 Display display = DisplayService.findDisplayWithFormId( nIdResource );
66
67 if ( display != null )
68 {
69 return display.getIcon( );
70 }
71 return null;
72 }
73
74
75
76
77
78
79 public String getResourceTypeId( )
80 {
81 return IMAGE_RESOURCE_TYPE_ID;
82 }
83
84
85
86
87
88
89
90 @Override
91 public String addImageResource( FileItem fileItem )
92 {
93 return null;
94 }
95
96 }
97