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.rss.business;
35  
36  import fr.paris.lutece.portal.service.portlet.PortletRemovalListenerService;
37  import fr.paris.lutece.portal.service.workgroup.AdminWorkgroupResource;
38  
39  import java.sql.Timestamp;
40  
41  
42  /**
43   *  This class represents business object RssGeneratedFile
44   */
45  public class RssGeneratedFile implements AdminWorkgroupResource
46  {
47      private static RssGeneratedFilePortletRemovalListener _listenerWorkgroup;
48  
49      ////////////////////////////////////////////////////////////////////////////////
50      // Constants
51      private int _nId;
52      private int _nPortletId;
53      private int _nState;
54      private String _strName;
55      private String _strDescription;
56      private String _strPortletName;
57      private Timestamp _dateUpdate;
58      private String _strWorkgroup;
59      private String _strTypeResourceRss;
60      private String _strFeedType;
61      private String _strEncoding;
62      private int _nMaxItems;
63  
64      /**
65      * Initialize the Rss
66      */
67      public static void init(  )
68      {
69          // Create removal listeners and register them
70          if ( _listenerWorkgroup == null )
71          {
72              _listenerWorkgroup = new RssGeneratedFilePortletRemovalListener(  );
73              PortletRemovalListenerService.getService(  ).registerListener( _listenerWorkgroup );
74          }
75      }
76  
77      /**
78       * Returns the identifier of this pushRss object
79       * @return the identifier of this pushRss object
80       */
81      public int getId(  )
82      {
83          return _nId;
84      }
85  
86      /**
87       * Sets the identifier of the pushRss object to the specified int.
88       * @param nId the new identifier
89       */
90      public void setId( int nId )
91      {
92          _nId = nId;
93      }
94  
95      /**
96       * Returns the identifier of the portlet that corresponds to this pushRss object
97       * @return the identifier of the portlet that corresponds to this pushRss object
98       */
99      public int getPortletId(  )
100     {
101         return _nPortletId;
102     }
103 
104     /**
105      * Sets the identifier of the portlet for this pushRss object to the specified int.
106      * @param nPortletId the new identifier of the portlet
107      */
108     public void setPortletId( int nPortletId )
109     {
110         _nPortletId = nPortletId;
111     }
112 
113     /**
114      * Returns the name of this pushRss object
115      * @return the name of this pushRss object
116      */
117     public String getName(  )
118     {
119         return _strName;
120     }
121 
122     /**
123      * Returns the description of this pushRss object
124      * @return the description of this pushRss object
125      */
126     public String getPortletName(  )
127     {
128         return _strPortletName;
129     }
130 
131     /**
132      * Returns the description of this pushRss object
133      * @return the description of this pushRss object
134      */
135     public String getDescription(  )
136     {
137         return _strDescription;
138     }
139 
140     /**
141      * Sets the name of this pushRss object to the specified String
142      * @param strName the new name of this pushRss object
143      */
144     public void setName( String strName )
145     {
146         _strName = strName;
147     }
148 
149     /**
150      * Sets the portlet name of this pushRss object to the specified String
151      * @param strPortletName the new name of this pushRss object
152      */
153     public void setPortletName( String strPortletName )
154     {
155         _strPortletName = strPortletName;
156     }
157 
158     /**
159      * Sets the description of this pushRss object to the specified String
160      * @param strDescription the new description of this pushRss object
161      */
162     public void setDescription( String strDescription )
163     {
164         _strDescription = strDescription;
165     }
166 
167     /**
168      * Returns the state of this pushRss object
169      * @return the state of this pushRss object
170      */
171     public int getState(  )
172     {
173         return _nState;
174     }
175 
176     /**
177      * Sets the state of this pushRss object to the specified int
178      * @param nState the new state of this pushRss object
179      */
180     public void setState( int nState )
181     {
182         _nState = nState;
183     }
184 
185     /**
186      * Returns the date of update of this pushRss object
187      * @return the date of update of this pushRss object
188      */
189     public Timestamp getUpdateDate(  )
190     {
191         return _dateUpdate;
192     }
193 
194     /**
195      * Sets the date of the update of this pushRss object to the specified Date
196      * @param dateUpdate the new update date of this pushRss object
197      */
198     public void setUpdateDate( Timestamp dateUpdate )
199     {
200         _dateUpdate = dateUpdate;
201     }
202 
203     /**
204     *
205     * @return the work group associate to the category
206     */
207     public String getWorkgroup(  )
208     {
209         return _strWorkgroup;
210     }
211 
212     /**
213      * set  the work group associate to the category
214      * @param workGroup  the work group associate to the category
215      */
216     public void setWorkgroup( String workGroup )
217     {
218         _strWorkgroup = workGroup;
219     }
220 
221     /**
222     *
223     * @return the type of resource rss
224     */
225     public String getTypeResourceRss(  )
226     {
227         return _strTypeResourceRss;
228     }
229 
230     /**
231      * set the type of resource rss
232      * @param strTypeResourceRss  type of resource rss
233      */
234     public void setTypeResourceRss( String strTypeResourceRss )
235     {
236         _strTypeResourceRss = strTypeResourceRss;
237     }
238 
239     /**
240      * Gets the max items
241      * @return the max item
242      */
243     public int getMaxItems(  )
244     {
245         return _nMaxItems;
246     }
247 
248     /**
249      * Sets the max items
250      * @param nMaxItems the max items
251      */
252     public void setMaxItems( int nMaxItems )
253     {
254         this._nMaxItems = nMaxItems;
255     }
256 
257     /**
258      * The feed type
259      * @return the feed type
260      * @see FeedType#getType()
261      */
262     public String getFeedType(  )
263     {
264         return _strFeedType;
265     }
266 
267     /**
268      * The feed type
269      * @param strFeedType the feed type
270      * @see FeedType#getType()
271      */
272     public void setFeedType( String strFeedType )
273     {
274         _strFeedType = strFeedType;
275     }
276 
277     /**
278      * Gets the encoding
279      * @return the encoding
280      */
281     public String getEncoding(  )
282     {
283         return _strEncoding;
284     }
285 
286     /**
287      * Gets the encoding
288      * @param strEncoding the encoding
289      */
290     public void setEncoding( String strEncoding )
291     {
292         this._strEncoding = strEncoding;
293     }
294 }