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.web.globalmanagement;
35
36 import fr.paris.lutece.portal.service.admin.AdminUserService;
37 import fr.paris.lutece.portal.service.panel.LutecePanelService;
38 import fr.paris.lutece.portal.service.template.AppTemplateService;
39 import fr.paris.lutece.portal.web.admin.PluginAdminPageJspBean;
40 import fr.paris.lutece.util.html.HtmlTemplate;
41
42 import java.util.HashMap;
43 import java.util.List;
44 import java.util.Map;
45
46 import javax.servlet.http.HttpServletRequest;
47
48
49
50
51
52 public class GlobalManagementJspBean extends PluginAdminPageJspBean
53 {
54 public static final String JSP_URL_GLOBAL_MANAGEMENT = "jsp/admin/globalmanagement/GetGlobalManagement.jsp";
55
56
57
58
59 private static final long serialVersionUID = 4377398578063850128L;
60 private static final String MARK_PANELS_LIST = "panels_list";
61 private static final String TEMPLATE_GLOBAL_MANAGEMENT = "/admin/globalmanagement/global_management.html";
62
63
64
65
66
67
68
69 public String getGlobalManagement( HttpServletRequest request )
70 {
71 LutecePanelService<AbstractGMLutecePanel> gmLutecePanel = LutecePanelService.instance( AbstractGMLutecePanel.class );
72
73 List<AbstractGMLutecePanel> listPanels = gmLutecePanel.getPanels( );
74
75 for ( AbstractGMLutecePanel panel : listPanels )
76 {
77 panel.setPanelLocale( AdminUserService.getLocale( request ) );
78 panel.setRequest( request );
79 }
80
81 Map<String, Object> model = new HashMap<String, Object>( );
82 model.put( MARK_PANELS_LIST, listPanels );
83
84 HtmlTemplate template = AppTemplateService.getTemplate( TEMPLATE_GLOBAL_MANAGEMENT,
85 AdminUserService.getLocale( request ), model );
86
87 return getAdminPage( template.getHtml( ) );
88 }
89 }