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.contact.business;
35
36 import fr.paris.lutece.plugins.contact.service.ContactListWorkgroupRemovalListener;
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.AdminWorkgroupService;
40 import fr.paris.lutece.portal.service.workgroup.WorkgroupRemovalListenerService;
41
42
43
44
45 public class ContactList implements AdminWorkgroupResource
46 {
47 public static final String RESOURCE_TYPE = "CONTACT_LIST";
48 public static final String ROLE_NONE = "none";
49 private static ContactListWorkgroupRemovalListener _listenerWorkgroup;
50 private static ContactListRoleRemovalListener _listenerRole;
51 private static final String EMPTY_STRING = "";
52
53
54
55 private int _nId;
56 private String _strContactListLabel;
57 private String _strContactListDescription;
58 private int _nContactsNumber;
59 private String _strAdminWorkgroup;
60 private String _strRole;
61 private int _nContactListOrder;
62 private boolean _bActiveTos;
63 private String _strTosMessage;
64
65
66
67
68 public static void init( )
69 {
70
71 if ( _listenerWorkgroup == null )
72 {
73 _listenerWorkgroup = new ContactListWorkgroupRemovalListener( );
74 WorkgroupRemovalListenerService.getService( ).registerListener( _listenerWorkgroup );
75 }
76
77 if ( _listenerRole == null )
78 {
79 _listenerRole = new ContactListRoleRemovalListener( );
80 RoleRemovalListenerService.getService( ).registerListener( _listenerRole );
81 }
82 }
83
84
85
86
87
88
89 public int getId( )
90 {
91 return _nId;
92 }
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 getLabel( )
111 {
112 return _strContactListLabel;
113 }
114
115
116
117
118
119
120
121 public void setLabel( String strContactListLabel )
122 {
123 _strContactListLabel = ( strContactListLabel == null ) ? EMPTY_STRING : strContactListLabel;
124 }
125
126
127
128
129
130
131 public String getDescription( )
132 {
133 return _strContactListDescription;
134 }
135
136
137
138
139
140
141
142 public void setDescription( String strContactListDescription )
143 {
144 _strContactListDescription = ( strContactListDescription == null ) ? EMPTY_STRING : strContactListDescription;
145 }
146
147
148
149
150
151
152 public int getContactsNumber( )
153 {
154 return _nContactsNumber;
155 }
156
157
158
159
160
161
162
163 public void setContactsNumber( int nContactsNumber )
164 {
165 _nContactsNumber = nContactsNumber;
166 }
167
168
169
170
171
172
173 public String getWorkgroup( )
174 {
175 return _strAdminWorkgroup;
176 }
177
178
179
180
181
182
183
184 public void setWorkgroup( String strAdminWorkgroup )
185 {
186 _strAdminWorkgroup = AdminWorkgroupService.normalizeWorkgroupKey( strAdminWorkgroup );
187 }
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202 public String getRole( )
203 {
204 return _strRole;
205 }
206
207
208
209
210
211
212
213 public void setRole( String strRole )
214 {
215 _strRole = ( ( strRole == null ) || ( strRole.equals( "" ) ) ) ? ROLE_NONE : strRole;
216 }
217
218
219
220
221
222
223 public int getContactListOrder( )
224 {
225 return _nContactListOrder;
226 }
227
228
229
230
231
232
233
234 public void setContactListOrder( int nContactListOrder )
235 {
236 _nContactListOrder = nContactListOrder;
237 }
238
239 public boolean getTos( )
240 {
241 return _bActiveTos;
242 }
243
244 public void setTos( boolean bActiveTos )
245 {
246 _bActiveTos = bActiveTos;
247 }
248
249 public String getTosMessage( )
250 {
251 return _strTosMessage;
252 }
253
254 public void setTosMessage( String strTosMessage )
255 {
256 _strTosMessage = strTosMessage;
257 }
258
259 }