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.helpdesk.business;
35
36 import fr.paris.lutece.portal.service.plugin.Plugin;
37 import fr.paris.lutece.portal.service.role.RoleRemovalListenerService;
38 import fr.paris.lutece.portal.service.workgroup.AdminWorkgroupResource;
39 import fr.paris.lutece.portal.service.workgroup.WorkgroupRemovalListenerService;
40
41 import java.util.Collection;
42
43
44
45
46
47 public class Faq implements AdminWorkgroupResource
48 {
49 private static FaqWorkgroupRemovalListener _listenerWorkgroup;
50 private static FaqRoleRemovalListener _listenerRole;
51 public static final String RESOURCE_TYPE = "HELPDESK_FAQ";
52 public static final String ROLE_NONE = "none";
53 private int _nId;
54 private String _strName;
55 private String _strDescription;
56 private String _strRoleKey;
57 private String _strWorkgroupKey;
58
59
60
61
62 public Faq( )
63 {
64 }
65
66
67
68
69 public static void init( )
70 {
71
72 if ( _listenerWorkgroup == null )
73 {
74 _listenerWorkgroup = new FaqWorkgroupRemovalListener( );
75 WorkgroupRemovalListenerService.getService( ).registerListener( _listenerWorkgroup );
76 }
77
78 if ( _listenerRole == null )
79 {
80 _listenerRole = new FaqRoleRemovalListener( );
81 RoleRemovalListenerService.getService( ).registerListener( _listenerRole );
82 }
83 }
84
85
86
87
88
89
90 public int getId( )
91 {
92 return _nId;
93 }
94
95
96
97
98
99
100 public void setId( int nId )
101 {
102 _nId = nId;
103 }
104
105
106
107
108
109
110 public String getName( )
111 {
112 return _strName;
113 }
114
115
116
117
118
119
120 public void setName( String strName )
121 {
122 _strName = strName;
123 }
124
125
126
127
128
129
130 public String getDescription( )
131 {
132 return _strDescription;
133 }
134
135
136
137
138
139
140 public void setDescription( String strDescription )
141 {
142 _strDescription = strDescription;
143 }
144
145
146
147
148
149
150 public String getRoleKey( )
151 {
152 return _strRoleKey;
153 }
154
155
156
157
158
159
160 public void setRoleKey( String strRoleKey )
161 {
162 _strRoleKey = strRoleKey;
163 }
164
165
166
167
168
169
170 public Collection<Subject> getSubjectsList( Plugin plugin )
171 {
172 return (Collection<Subject>) SubjectHome.getInstance( ).findByIdFaq( getId( ), plugin );
173 }
174
175
176
177
178
179
180
181 public Collection<Theme> getThemesList( Plugin plugin )
182 {
183 return (Collection<Theme>) ThemeHome.getInstance( ).findByIdFaq( getId( ), plugin );
184 }
185
186
187
188
189
190
191 public void setWorkgroup( String strWorkgroupKey )
192 {
193 this._strWorkgroupKey = strWorkgroupKey;
194 }
195
196
197
198
199
200
201 public String getWorkgroup( )
202 {
203 return _strWorkgroupKey;
204 }
205 }