View Javadoc
1   /*
2    * Copyright (c) 2002-2021, City of Paris
3    * All rights reserved.
4    *
5    * Redistribution and use in source and binary forms, with or without
6    * modification, are permitted provided that the following conditions
7    * are met:
8    *
9    *  1. Redistributions of source code must retain the above copyright notice
10   *     and the following disclaimer.
11   *
12   *  2. Redistributions in binary form must reproduce the above copyright notice
13   *     and the following disclaimer in the documentation and/or other materials
14   *     provided with the distribution.
15   *
16   *  3. Neither the name of 'Mairie de Paris' nor 'Lutece' nor the names of its
17   *     contributors may be used to endorse or promote products derived from
18   *     this software without specific prior written permission.
19   *
20   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23   * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
24   * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25   * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26   * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27   * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28   * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30   * POSSIBILITY OF SUCH DAMAGE.
31   *
32   * License 1.0
33   */
34  package fr.paris.lutece.plugins.extend.modules.comment.business.config;
35  
36  import fr.paris.lutece.plugins.extend.business.extender.config.ExtenderConfig;
37  
38  /**
39   * 
40   * CommentExtenderConfig
41   * 
42   */
43  public class CommentExtenderConfig extends ExtenderConfig
44  {
45      private boolean _bIsModerated;
46      private int _nNbComments;
47      private int _nIdMailingList = -1;
48      private boolean _bAuthorizeSubComments;
49      private boolean _bUseBBCodeEditor;
50      private String _strAdminBadge;
51      private String _strMessageCommentCreated;
52      private int _nAddCommentPosition;
53      private boolean _bEnabledAuthMode;
54      private boolean _bDisplaySubComments;
55      private boolean _bDeleteComments;
56      private boolean _bTriCommentsByCreation;
57      private int _nIdWorkflow;
58  
59      /**
60       * Checks if is moderated.
61       * 
62       * @return true, if is moderated
63       */
64      public boolean isModerated( )
65      {
66          return _bIsModerated;
67      }
68  
69      /**
70       * Sets the moderated.
71       * 
72       * @param bModerated
73       *            the new moderated
74       */
75      public void setModerated( boolean bModerated )
76      {
77          _bIsModerated = bModerated;
78      }
79  
80      /**
81       * @return the nNbComments
82       */
83      public int getNbComments( )
84      {
85          return _nNbComments;
86      }
87  
88      /**
89       * @param nNbComments
90       *            the nNbComments to set
91       */
92      public void setNbComments( int nNbComments )
93      {
94          _nNbComments = nNbComments;
95      }
96  
97      /**
98       * @return the nIdMailingList
99       */
100     public int getIdMailingList( )
101     {
102         return _nIdMailingList;
103     }
104 
105     /**
106      * @param nIdMailingList
107      *            the nIdMailingList to set
108      */
109     public void setIdMailingList( int nIdMailingList )
110     {
111         _nIdMailingList = nIdMailingList;
112     }
113 
114     /**
115      * Check if sub comments are authorized for this extender
116      * 
117      * @return True if sub comments are authorized, false otherwise
118      */
119     public boolean getAuthorizeSubComments( )
120     {
121         return _bAuthorizeSubComments;
122     }
123 
124     /**
125      * Authorize or unauthorize sub comments for this extender
126      * 
127      * @param bAuthorizeSubComments
128      *            True if sub comments are authorized, false otherwise
129      */
130     public void setAuthorizeSubComments( boolean bAuthorizeSubComments )
131     {
132         this._bAuthorizeSubComments = bAuthorizeSubComments;
133     }
134 
135     /**
136      * Check if a BBCode editor should be used to compose comments
137      * 
138      * @return True if a BBCode should be used to compose comments, false otherwise
139      */
140     public boolean getUseBBCodeEditor( )
141     {
142         return _bUseBBCodeEditor;
143     }
144 
145     /**
146      * Set the usage of a BBCode editor compose comments
147      * 
148      * @param bUseBBCodeEditor
149      *            True to use a BBCode editor to compose comments, false otherwise
150      */
151     public void setUseBBCodeEditor( boolean bUseBBCodeEditor )
152     {
153         this._bUseBBCodeEditor = bUseBBCodeEditor;
154     }
155 
156     /**
157      * Get the badge of comments posted by admin users
158      * 
159      * @return The badge of comments posted by admin users
160      */
161     public String getAdminBadge( )
162     {
163         return _strAdminBadge;
164     }
165 
166     /**
167      * Set the badge of comments posted by admin users
168      * 
169      * @param strAdminAnswerBadge
170      *            The badge of comments posted by admin users
171      */
172     public void setAdminBadge( String strAdminAnswerBadge )
173     {
174         this._strAdminBadge = strAdminAnswerBadge;
175     }
176 
177     /**
178      * Get the message to display to users when a comment is created
179      * 
180      * @return The message to display
181      */
182     public String getMessageCommentCreated( )
183     {
184         return _strMessageCommentCreated;
185     }
186 
187     /**
188      * Set the message to display to users when a comment is created
189      * 
190      * @param strMessageCommentCreated
191      *            The message to display
192      */
193     public void setMessageCommentCreated( String strMessageCommentCreated )
194     {
195         this._strMessageCommentCreated = strMessageCommentCreated;
196     }
197 
198     /**
199      * @returnthe position number of the add comment form
200      */
201     public int getAddCommentPosition( )
202     {
203         return _nAddCommentPosition;
204     }
205 
206     /**
207      * * @param the position number
208      * 
209      * @return void
210      */
211     public void setAddCommentPosition( int nPosition )
212     {
213         _nAddCommentPosition = nPosition;
214     }
215 
216     /**
217      * 
218      * @return isEnableAuthMode true if the authentication mode is enable
219      */
220     public boolean isEnabledAuthMode( )
221     {
222         return _bEnabledAuthMode;
223     }
224 
225     /**
226      * 
227      * @param bEnableAuthMode
228      *            true if the authentication mode is enable
229      */
230     public void setEnabledAuthMode( boolean bEnableAuthMode )
231     {
232         this._bEnabledAuthMode = bEnableAuthMode;
233     }
234 
235     /**
236      * 
237      * @return isDisplaySubComments true if the display sub comments mode is enable
238      */
239     public boolean isDisplaySubComments( )
240     {
241         return _bDisplaySubComments;
242     }
243 
244     /**
245      * 
246      * @param bDisplaySubComments
247      *            true if the display sub comments mode is enable
248      */
249     public void setDisplaySubComments( boolean bDisplaySubComments )
250     {
251         this._bDisplaySubComments = bDisplaySubComments;
252     }
253 
254     /**
255      * Returns the DeleteComments option
256      * 
257      * @return True if the the option is enabled
258      */
259     public boolean getDeleteComments( )
260     {
261         return _bDeleteComments;
262     }
263 
264     /**
265      * Sets the DeleteComments option
266      * 
267      * @param bDeleteComments
268      *            The DeleteComments option
269      */
270     public void setDeleteComments( boolean bDeleteComments )
271     {
272         _bDeleteComments = bDeleteComments;
273     }
274 
275     /**
276      * Get Tri date comments
277      * 
278      * @return if tri date comments
279      */
280     public boolean isTriCommentsByCreation( )
281     {
282         return _bTriCommentsByCreation;
283     }
284 
285     /**
286      * Sets tri date comments
287      * 
288      * @param bTriDateComments
289      *            tri date comments
290      */
291     public void setTriCommentsByCreation( boolean bTriDateComments )
292     {
293         _bTriCommentsByCreation = bTriDateComments;
294     }
295 
296     /**
297      * Getter for id_workflow
298      * 
299      * @return the _nIdWorkflow
300      */
301     public int getIdWorkflow( )
302     {
303         return _nIdWorkflow;
304     }
305 
306     /**
307      * setter for id_workflow
308      * 
309      * @param nIdWorkflow
310      *            the Id Workflow to set
311      */
312     public void setIdWorkflow( int nIdWorkflow )
313     {
314         _nIdWorkflow = nIdWorkflow;
315     }
316 
317 }