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.portal.business.rss;
35
36
37 /**
38 * ResourceRss that provides the resources rss.
39 * Implementations should override {@link #getFeed()}.
40 */
41 public abstract class ResourceRss implements IResourceRss
42 {
43 private int _nId;
44 private String _strEncoding;
45 private IResourceRssType _taskType;
46 private String _strName;
47 private String _strDescription;
48 private String _strFeedType;
49 private int _nMaxItems;
50
51 /**
52 * Get the rss id
53 * @return the rss Id
54 */
55 @Override
56 public int getId( )
57 {
58 return _nId;
59 }
60
61 /**
62 * Set the rss id
63 * @param nId the rss id
64 */
65 @Override
66 public void setId( int nId )
67 {
68 _nId = nId;
69 }
70
71 /**
72 * Get Rss resource Description
73 * @return the description
74 */
75 @Override
76 public String getDescription( )
77 {
78 return _strDescription;
79 }
80
81 /**
82 * Set the RSS resource description
83 * @param strDescription the description
84 */
85 @Override
86 public void setDescription( String strDescription )
87 {
88 _strDescription = strDescription;
89 }
90
91 /**
92 * Get The RSS resource name
93 * @return the name
94 */
95 @Override
96 public String getName( )
97 {
98 return _strName;
99 }
100
101 /**
102 * Set the RSS resource name
103 * @param strName the name
104 */
105 @Override
106 public void setName( String strName )
107 {
108 _strName = strName;
109 }
110
111 /**
112 * Get the RSS Resource Type
113 * @return the ResourceRssType Object
114 */
115 @Override
116 public IResourceRssType getResourceRssType( )
117 {
118 return _taskType;
119 }
120
121 /**
122 * Set the ResourceRssType object.
123 *
124 * @param taskType the new resource rss type
125 */
126 @Override
127 public void setResourceRssType( IResourceRssType taskType )
128 {
129 _taskType = taskType;
130 }
131
132 /**
133 *
134 *{@inheritDoc}
135 */
136 @Override
137 public String getFeedType( )
138 {
139 return _strFeedType;
140 }
141
142 /**
143 *
144 *{@inheritDoc}
145 */
146 @Override
147 public void setFeedType( String strFeedType )
148 {
149 _strFeedType = strFeedType;
150 }
151
152 /**
153 *
154 *{@inheritDoc}
155 */
156 @Override
157 public String getEncoding( )
158 {
159 return _strEncoding;
160 }
161
162 /**
163 *
164 *{@inheritDoc}
165 */
166 @Override
167 public void setEncoding( String strEncoding )
168 {
169 _strEncoding = strEncoding;
170 }
171
172 /**
173 *
174 *{@inheritDoc}
175 */
176 @Override
177 public int getMaxItems( )
178 {
179 return _nMaxItems;
180 }
181
182 /**
183 *
184 *{@inheritDoc}
185 */
186 @Override
187 public void setMaxItems( int nMaxItems )
188 {
189 _nMaxItems = nMaxItems;
190 }
191
192 /**
193 * Returns <code>null</code>. This method should be overriden.
194 *
195 * @return the feed
196 */
197 @Override
198 public IFeedResource getFeed( )
199 {
200 return null;
201 }
202
203 /**
204 * Always returns <code>null</code> and should be removed as soon as every plugin implement {@link #getFeed()}.
205 *
206 * @return the string
207 */
208 @Override
209 @Deprecated
210 public String createHtmlRss( )
211 {
212 return null;
213 }
214 }