View Javadoc
1   /*
2    * Copyright (c) 2002-2017, 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.directory.web.action;
35  
36  import fr.paris.lutece.plugins.directory.business.Directory;
37  import fr.paris.lutece.plugins.directory.business.IEntry;
38  import fr.paris.lutece.plugins.directory.business.RecordField;
39  import fr.paris.lutece.portal.service.plugin.Plugin;
40  
41  import java.util.Date;
42  import java.util.HashMap;
43  import java.util.List;
44  
45  import javax.servlet.http.HttpServletRequest;
46  
47  /**
48   * Visualization of all needed for searched record.
49   * 
50   * @author merlinfe
51   *
52   */
53  public interface IDirectorySearchFields
54  {
55      /**
56       * Default items per page
57       *
58       * @return default items per page
59       */
60      int getDefaultItemsPerPage( );
61  
62      /**
63       * Default items per page
64       *
65       * @param nDefaultItemsPerPage
66       *            default items per page
67       */
68      void setDefaultItemsPerPage( int nDefaultItemsPerPage );
69  
70      /**
71       * Current page index
72       *
73       * @return current page index
74       */
75      String getCurrentPageIndex( );
76  
77      /**
78       * Current page index
79       *
80       * @param strCurrentPageIndex
81       *            current page index
82       */
83      void setCurrentPageIndex( String strCurrentPageIndex );
84  
85      /**
86       * Id directory
87       *
88       * @return id directory
89       */
90      int getIdDirectory( );
91  
92      /**
93       * Id directory
94       *
95       * @param nIdDirectory
96       *            id directory
97       */
98      void setIdDirectory( int nIdDirectory );
99  
100     /**
101      * Id entry
102      *
103      * @return id entry
104      */
105     int getIdEntry( );
106 
107     /**
108      * Id entry
109      *
110      * @param nIdEntry
111      *            id entry
112      */
113     void setIdEntry( int nIdEntry );
114 
115     /**
116      * Map query
117      *
118      * @return map query
119      */
120     HashMap<String, List<RecordField>> getMapQuery( );
121 
122     /**
123      * Map query
124      *
125      * @param mapQuery
126      *            map query
127      */
128     void setMapQuery( HashMap<String, List<RecordField>> mapQuery );
129 
130     /**
131      * Date creation begin record
132      *
133      * @return date creation begin record
134      */
135     Date getDateCreationBeginRecord( );
136 
137     /**
138      * Date creation begin record
139      *
140      * @param dateCreationBeginRecord
141      *            date creation begin record
142      */
143     void setDateCreationBeginRecord( Date dateCreationBeginRecord );
144 
145     /**
146      * Date creation end record
147      *
148      * @return date creation end record
149      */
150     Date getDateCreationEndRecord( );
151 
152     /**
153      * Date creation end record
154      *
155      * @param dateCreationEndRecord
156      *            date creation end record
157      */
158     void setDateCreationEndRecord( Date dateCreationEndRecord );
159 
160     /**
161      * Date creation record
162      *
163      * @return date creation record
164      */
165     Date getDateCreationRecord( );
166 
167     /**
168      * Date creation record
169      *
170      * @param dateCreationRecord
171      *            date creation record
172      */
173     void setDateCreationRecord( Date dateCreationRecord );
174 
175     /**
176      * Set the sort entry
177      *
178      * @param sortEntry
179      *            the sort entry
180      */
181     void setSortEntry( IEntry sortEntry );
182 
183     /**
184      * Get the sort entry
185      *
186      * @return the sort entry
187      */
188     IEntry getSortEntry( );
189 
190     /**
191      * Set the sort order
192      *
193      * @param nSortOrder
194      *            the sort order
195      */
196     void setSortOrder( int nSortOrder );
197 
198     /**
199      * Get the sort order
200      *
201      * @return the sort order
202      */
203     int getSortOrder( );
204 
205     /**
206      * Set the sort parameters
207      *
208      * @param request
209      *            the HTTP request
210      * @param directory
211      *            the directory
212      * @param plugin
213      *            the plugin
214      */
215     void setSortParameters( HttpServletRequest request, Directory directory, Plugin plugin );
216 
217     /**
218      * return the default entry used for sorting the records
219      * 
220      * @param directory
221      *            the directory
222      * @return the default entry used for sorting the records
223      */
224     String getDefaultIdSortEntry( Directory directory );
225 
226     /**
227      * return true if the record must be sorted by ascending sort
228      * 
229      * @param directory
230      *            the directory
231      * @return true if the record must be sorted by ascending sort
232      */
233     boolean isDefaultAscendingSort( Directory directory );
234 
235     /**
236      * Items per page
237      * 
238      * @return items per page
239      */
240     int getItemsPerPage( );
241 
242     /**
243      * Items per page
244      * 
245      * @param nItemsPerPage
246      *            items per page
247      */
248     void setItemsPerPage( int nItemsPerPage );
249 
250     /**
251      *
252      * @return true if the records must be disabled
253      */
254     int getIsDisabled( );
255 
256     /***
257      * set true if the records displayed must be disabled
258      * 
259      * @param nIsDisabled
260      *            true if the records displayed must be disabled
261      */
262     void setIsDisabled( int nIsDisabled );
263 
264     /**
265      * Date modification begin record
266      * 
267      * @return date modification begin record
268      */
269     Date getDateModificationBeginRecord( );
270 
271     /**
272      * Date modification begin record
273      * 
274      * @param dateModificationBeginRecord
275      *            date modification begin record
276      */
277     void setDateModificationBeginRecord( Date dateModificationBeginRecord );
278 
279     /**
280      * Date modification end record
281      * 
282      * @return date modification end record
283      */
284     Date getDateModificationEndRecord( );
285 
286     /**
287      * Date modification end record
288      * 
289      * @param dateModificationEndRecord
290      *            date modification end record
291      */
292     void setDateModificationEndRecord( Date dateModificationEndRecord );
293 
294     /**
295      * Date modification record
296      * 
297      * @return date modification record
298      */
299     Date getDateModificationRecord( );
300 
301     /**
302      * Date modification record
303      * 
304      * @param dateModificationRecord
305      *            date modification record
306      */
307     void setDateModificationRecord( Date dateModificationRecord );
308 
309     /**
310      * Set true if it must be sort by date modification
311      * 
312      * @param bSortByDateModification
313      *            true if it must be sort by date modification
314      */
315     void setSortByDateModification( boolean bSortByDateModification );
316 
317     /**
318      * Check if it must be sort by date modification
319      * 
320      * @return true if it must be sort by date modification, false otherwise
321      */
322     boolean isSortByDateModification( );
323 }