View Javadoc
1   /*
2    * Copyright (c) 2002-2020, 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.blog.business;
35  
36  /**
37   *
38   */
39  public class BlogFilter
40  {
41  
42      // Variables declarations
43      private Integer [ ] _arrayTagsId;
44      private Integer [ ] _arrayId;
45  
46      // The default value is true to assure ascendant compatibility
47      private boolean _bLoadBinaries = true;
48      private Boolean _bIsPublished;
49      private String _dateMin;
50      private String _dateMax;
51      private int _nPortletId;
52      private boolean _bOrderInPortlet;
53  
54      /**
55       * @return the _arrayTagsId
56       */
57      public Integer [ ] getTagsId( )
58      {
59          return _arrayTagsId;
60      }
61  
62      /**
63       * @param arrayTagsId
64       *            the _arrayTagsId to set
65       */
66      public void setTagsId( Integer [ ] arrayTagsId )
67      {
68          _arrayTagsId = arrayTagsId;
69      }
70  
71      /**
72       * Tell if the filter contains a criteria on the tag
73       * 
74       * @return True if the filter contains a criteria on the tags otherwise false
75       */
76      public boolean containsTagsCriteria( )
77      {
78          return ( ( _arrayTagsId != null ) && ( _arrayTagsId.length != 0 ) );
79      }
80  
81      /**
82       * Tell if the filter contains a criteria on the Id
83       * 
84       * @return True if the filter contains a criteria on the Ids otherwise false
85       */
86      public boolean containsIdsCriteria( )
87      {
88          return ( ( _arrayId != null ) && ( _arrayId.length != 0 ) );
89      }
90  
91      /**
92       * @return the _arrayId
93       */
94      public Integer [ ] getIds( )
95      {
96          return _arrayId;
97      }
98  
99      /**
100      * @param arrayId
101      *            the _arrayId to set
102      */
103     public void setIds( Integer [ ] arrayId )
104     {
105         _arrayId = arrayId;
106     }
107 
108     /**
109      * Get the boolean that indicates whether binaries of documents should be loaded
110      * 
111      * @return True if binaries should be loaded, false otherwise
112      */
113     public boolean getLoadBinaries( )
114     {
115         return _bLoadBinaries;
116     }
117 
118     /**
119      * Set the boolean that indicates whether binaries of documents should be loaded
120      * 
121      * @param bLoadBinaries
122      *            True if binaries should be loaded, false otherwise
123      */
124     public void setLoadBinaries( boolean bLoadBinaries )
125     {
126         this._bLoadBinaries = bLoadBinaries;
127     }
128 
129     /**
130      * @return the _bIsPublished
131      */
132     public Boolean isPublished( )
133     {
134         return _bIsPublished;
135     }
136 
137     /**
138      * @param bIsPublished
139      *            the _bIsPublished to set
140      */
141     public void setIsPublished( Boolean bIsPublished )
142     {
143         this._bIsPublished = bIsPublished;
144     }
145 
146     /**
147      * @return the _dateMin
148      */
149     public String getDateMin( )
150     {
151         return _dateMin;
152     }
153 
154     /**
155      * @param dateMin
156      *            the _dateMin to set
157      */
158     public void setDateMin( String dateMin )
159     {
160         this._dateMin = dateMin;
161     }
162 
163     /**
164      * @return the _dateMax
165      */
166     public String getDateMax( )
167     {
168         return _dateMax;
169     }
170 
171     /**
172      * @param dateMax
173      *            the _dateMax to set
174      */
175     public void setDateMax( String dateMax )
176     {
177         this._dateMax = dateMax;
178     }
179 
180     /**
181      * Get the boolean that indicates whether loaded by order in the portlet list
182      * 
183      * @return True if loaded by order in the portlet list, false otherwise
184      */
185     public boolean getOrderInPortlet( )
186     {
187         return _bOrderInPortlet;
188     }
189 
190     /**
191      * Set the boolean that indicates whether loaded by order in the portlet list
192      * 
193      * @param bOrder
194      *            True if if loaded by order in the portlet list, false otherwise
195      */
196     public void setOrderInPortlet( boolean bOrder )
197     {
198         this._bOrderInPortlet = bOrder;
199     }
200 
201     /**
202      * Returns the nPortletId
203      *
204      * @return The nPortletId
205      */
206     public int getPortletId( )
207     {
208         return _nPortletId;
209     }
210 
211     /**
212      * Sets the IdPortlet
213      *
214      * @param nPortletId
215      *            The nPortletId
216      */
217     public void setPortletId( int nPortletId )
218     {
219         _nPortletId = nPortletId;
220     }
221 }