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