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.plugins.paybox.web;
35
36 import java.util.HashMap;
37 import java.util.List;
38 import java.util.Map;
39
40 import javax.servlet.http.HttpServletRequest;
41
42 import fr.paris.lutece.plugins.paybox.dto.PayboxLogDTO;
43 import fr.paris.lutece.plugins.paybox.service.PayboxLogService;
44 import fr.paris.lutece.plugins.paybox.service.PayboxPlugin;
45 import fr.paris.lutece.portal.service.plugin.PluginService;
46 import fr.paris.lutece.portal.service.spring.SpringContextService;
47 import fr.paris.lutece.portal.service.template.AppTemplateService;
48 import fr.paris.lutece.portal.web.admin.PluginAdminPageJspBean;
49 import fr.paris.lutece.util.html.HtmlTemplate;
50
51
52
53
54
55 public class PayboxAdminJspBean extends PluginAdminPageJspBean
56 {
57
58
59
60 private static final long serialVersionUID = 6430112940248220789L;
61
62
63 public static final String RIGHT_READ = "PAYBOX_READ";
64
65
66 private static final String FREEMARKER_TABLE = "table";
67
68
69 private static final String PROPERTY_PAGE_TITLE_PAYBOX = "paybox.adminFeature.pageTitle";
70
71
72 private static final String TEMPLATE = "admin/plugins/paybox/paybox_read_log.html";
73
74
75 private final PayboxLogService _payboxLogService = SpringContextService.getBean( "paybox.payboxLogService" );
76
77
78
79
80
81
82
83 public String getLogs( final HttpServletRequest request )
84 {
85 this.setPageTitleProperty( PayboxAdminJspBean.PROPERTY_PAGE_TITLE_PAYBOX );
86
87 final Map<String, Object> model = new HashMap<String, Object>( );
88 final List<PayboxLogDTO> all = this._payboxLogService.getAll( PluginService.getPlugin( PayboxPlugin.PLUGIN_NAME ) );
89 model.put( PayboxAdminJspBean.FREEMARKER_TABLE, all );
90
91 final HtmlTemplate templateList = AppTemplateService.getTemplate( PayboxAdminJspBean.TEMPLATE,
92 this.getLocale( ), model );
93
94 return this.getAdminPage( templateList.getHtml( ) );
95 }
96 }