View Javadoc

1   /*
2    * Copyright (c) 2002-2014, Mairie de 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.digglike.business;
35  
36  import fr.paris.lutece.portal.business.regularexpression.RegularExpression;
37  import fr.paris.lutece.portal.service.plugin.Plugin;
38  import fr.paris.lutece.util.ReferenceList;
39  import fr.paris.lutece.util.html.Paginator;
40  
41  import java.util.List;
42  import java.util.Locale;
43  
44  import javax.servlet.http.HttpServletRequest;
45  
46  
47  /**
48   *
49   *IEntry Class
50   */
51  public interface IEntry
52  {
53      /**
54       * @return the  id of entry
55       */
56      int getIdEntry(  );
57  
58      /**
59       * set the id of the entry
60       * @param idEntry  the id of the entry
61       */
62      void setIdEntry( int idEntry );
63  
64      /**
65       * @return title entry
66       */
67      String getTitle(  );
68  
69      /**
70       * set title entry
71       * @param  title title
72       */
73      void setTitle( String title );
74  
75      /**
76       *  @return the entry  help message
77       */
78      String getHelpMessage(  );
79  
80      /**
81       * set  the entry  help message
82       * @param  helpMessage the entry  help message
83       */
84      void setHelpMessage( String helpMessage );
85  
86      /**
87       *  @return the entry comment
88       */
89      String getComment(  );
90  
91      /**
92       * set entry comment
93       * @param comment entry comment
94       */
95      void setComment( String comment );
96  
97      /**
98       * @return true if the question is mandatory
99       */
100     boolean isMandatory(  );
101 
102     /**
103      * @return true if the entry must be shown in digg submit list
104      */
105     boolean isShowInDiggSubmitList(  );
106 
107     /**
108      * set true if the question is mandatory
109      * @param  mandatory true if the question is mandatory
110      */
111     void setMandatory( boolean mandatory );
112 
113     /**
114      * set true if the entry must be shown in digg submit list
115      * @param  show true if the entry must be shown in digg submit list
116      */
117     void setShowInDiggSubmitList( boolean show );
118 
119     /**
120      * @return position entry
121      */
122     int getPosition(  );
123 
124     /**
125      * set position entry
126      * @param  position  position entry
127      */
128     void setPosition( int position );
129 
130     /**
131      *
132      * @return the form of the entry
133      */
134     Digg getDigg(  );
135 
136     /**
137      * set the digg of the entry
138      * @param digg the digg of the entry
139      */
140     void setDigg( Digg digg );
141 
142     /**
143      *  @return the type of the entry
144      */
145     EntryType getEntryType(  );
146 
147     /**
148      * set the type of the entry
149      * @param entryType the type of the entry
150      */
151     void setEntryType( EntryType entryType );
152 
153     /**
154     *
155     * @return a list of regular expression which is associate to the entry
156     */
157     List<RegularExpression> getRegularExpressionList(  );
158 
159     /**
160      * set a list of regular expression which is associate to the entry
161      * @param regularExpressionList a list of regular expression which is associate to the entry
162      */
163     void setRegularExpressionList( List<RegularExpression> regularExpressionList );
164 
165     /**
166     *
167     * @return the value of the entry
168     */
169     String getDefaultValue(  );
170 
171     /**
172      * set the default value of the entry
173      * @param value the default value of the entry
174      */
175     void setDefaultValue( String value );
176 
177     /**
178      *
179      * @return the width of the entry
180      */
181     int getWidth(  );
182 
183     /**
184      * set the width of the entry
185      * @param width the width of the entry
186      */
187     void setWidth( int width );
188 
189     /**
190      *
191      * @return  the height of the entry
192      */
193     int getHeight(  );
194 
195     /**
196      * set the height of the entry
197      * @param height  the height of the entry
198      */
199     void setHeight( int height );
200 
201     /**
202     *
203     * @return the max size of enter user
204     */
205     int getMaxSizeEnter(  );
206 
207     /**
208      * set the max size of enter user
209      * @param maxSizeEnter the max size of enter user
210      */
211     void setMaxSizeEnter( int maxSizeEnter );
212 
213     /**
214      * Get the request data
215      * @param request HttpRequest
216      * @param locale the locale
217      * @return null if all data requiered are in the request else the url of jsp error
218      */
219     String getRequestData( HttpServletRequest request, Locale locale );
220 
221     /**
222      * save in the list of response the response associate to the entry in the form submit
223      * @param request HttpRequest
224      * @param listResponse the list of response associate to the entry in the form submit
225      * @param locale the locale
226      * @return a Form error object if there is an error in the response
227      */
228     FormError getResponseData( HttpServletRequest request, List<Response> listResponse, Locale locale );
229 
230     /**
231     * save in the list of response the response associate to the entry in the form submit
232     * @param nIdDiggSubmit the id of the diggSubmit
233     * @param request HttpRequest
234     * @param listResponse the list of response associate to the entry in the form submit
235     * @param locale the locale
236     * @param plugin the current plugin
237     * @return a Form error object if there is an error in the response
238     */
239     FormError getResponseData( int nIdDiggSubmit, HttpServletRequest request, List<Response> listResponse,
240         Locale locale, Plugin plugin );
241 
242     /**
243      * Get the HtmlCode  of   the entry
244      * @return the HtmlCode  of   the entry
245      *
246      * */
247     String getTemplateHtmlCodeForm(  );
248 
249     /**
250      * Get the template of the html code of the response value  associate to the entry
251      * @return the template of the html code of the response value  associate to the entry
252      */
253     String getTemplateHtmlCodeResponse(  );
254 
255     /**
256      * Get template create url of the entry
257      * @return template create url of the entry
258      */
259     String getTemplateCreate(  );
260 
261     /**
262      * Get the template modify url  of the entry
263      * @return template modify url  of the entry
264      */
265     String getTemplateModify(  );
266 
267     /**
268      * The paginator who is use in the template modify of the entry
269      * @param nItemPerPage Number of items to display per page
270     * @param strBaseUrl The base Url for build links on each page link
271     * @param strPageIndexParameterName The parameter name for the page index
272     * @param strPageIndex The current page index
273      * @return the paginator who is use in the template modify of the entry
274      */
275     Paginator getPaginator( int nItemPerPage, String strBaseUrl, String strPageIndexParameterName, String strPageIndex );
276 
277     /**
278      * Get the list of regular expression  who is use in the template modify of the entry
279      * @param plugin the plugin
280      * @param entry the entry
281      * @return the regular expression list who is use in the template modify of the entry
282      */
283     ReferenceList getReferenceListRegularExpression( IEntry entry, Plugin plugin );
284 
285     /**
286     *
287     * @return a list of additional attribute which is associate to the entry
288     */
289     List<EntryAdditionalAttribute> getEntryAdditionalAttributeList(  );
290 
291     /**
292      * set a list of additional attribute which is associate to the entry
293      * @param entryAdditionalAttributeList a list of additional attribute which is associate to the entry
294      */
295     void setEntryAdditionalAttributeList( List<EntryAdditionalAttribute> entryAdditionalAttributeList );
296 
297     /**
298      * add The Xml of the entry in the string buffer
299     
300      * @param locale loclae
301      * @param strXml the string buffer
302      *
303      */
304     void getXml( Locale locale, StringBuffer strXml );
305 }