1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 package fr.paris.lutece.portal.business.resourceenhancer;
35
36 import fr.paris.lutece.portal.service.spring.SpringContextService;
37
38 import java.util.List;
39 import java.util.Map;
40
41 import javax.servlet.http.HttpServletRequest;
42
43
44
45
46
47 public final class ResourceEnhancer
48 {
49
50
51
52 private ResourceEnhancer( )
53 {
54
55 }
56
57
58
59
60
61
62
63
64
65 public static void getXmlAddOn( StringBuffer strXml, String strResourceType, int nResourceId )
66 {
67 List<IResourceDisplayManager> managers = SpringContextService.getBeansOfType( IResourceDisplayManager.class );
68
69 for ( IResourceDisplayManager manager : managers )
70 {
71 manager.getXmlAddOn( strXml, strResourceType, nResourceId );
72 }
73 }
74
75
76
77
78
79
80
81
82
83
84 public static void buildPageAddOn( Map<String, Object> model, String strResourceType, int nIdResource,
85 String strPortletId, HttpServletRequest request )
86 {
87 List<IResourceDisplayManager> managers = SpringContextService.getBeansOfType( IResourceDisplayManager.class );
88
89 for ( IResourceDisplayManager manager : managers )
90 {
91 manager.buildPageAddOn( model, strResourceType, nIdResource, strPortletId, request );
92 }
93 }
94
95
96
97
98
99
100
101 public static void getCreateResourceModelAddOn( Map<String, Object> model )
102 {
103 List<IResourceManager> managers = SpringContextService.getBeansOfType( IResourceManager.class );
104
105 for ( IResourceManager manager : managers )
106 {
107 manager.getCreateResourceModelAddOn( model );
108 }
109 }
110
111
112
113
114
115
116
117 public static void doCreateResourceAddOn( HttpServletRequest request, String strResourceType, int nResourceId )
118 {
119 List<IResourceManager> managers = SpringContextService.getBeansOfType( IResourceManager.class );
120
121 for ( IResourceManager manager : managers )
122 {
123 manager.doCreateResourceAddOn( request, strResourceType, nResourceId );
124 }
125 }
126
127
128
129
130
131
132
133 public static void getModifyResourceModelAddOn( Map<String, Object> model, String strResourceType, int nResourceId )
134 {
135 List<IResourceManager> managers = SpringContextService.getBeansOfType( IResourceManager.class );
136
137 for ( IResourceManager manager : managers )
138 {
139 manager.getModifyResourceModelAddOn( model, strResourceType, nResourceId );
140 }
141 }
142
143
144
145
146
147
148
149 public static void doModifyResourceAddOn( HttpServletRequest request, String strResourceType, int nResourceId )
150 {
151 List<IResourceManager> managers = SpringContextService.getBeansOfType( IResourceManager.class );
152
153 for ( IResourceManager manager : managers )
154 {
155 manager.doModifyResourceAddOn( request, strResourceType, nResourceId );
156 }
157 }
158
159
160
161
162
163
164
165 public static void doDeleteResourceAddOn( HttpServletRequest request, String strResourceType, int nResourceId )
166 {
167 List<IResourceManager> managers = SpringContextService.getBeansOfType( IResourceManager.class );
168
169 for ( IResourceManager manager : managers )
170 {
171 manager.doDeleteResourceAddOn( request, strResourceType, nResourceId );
172 }
173 }
174
175
176
177
178
179
180
181 public static void doDownloadResourceAddOn( HttpServletRequest request, String strResourceType, int nResourceId )
182 {
183 List<IResourceManager> managers = SpringContextService.getBeansOfType( IResourceManager.class );
184
185 for ( IResourceManager manager : managers )
186 {
187 manager.doDownloadResourceAddOn( request, strResourceType, nResourceId );
188 }
189 }
190 }