1 /* 2 * Copyright (c) 2002-2022, 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 import java.util.Locale; 37 import java.util.Map; 38 39 import javax.servlet.http.HttpServletRequest; 40 41 /** 42 * IResourceRss 43 */ 44 public interface IResourceRss 45 { 46 /** 47 * 48 * @return the rss Id 49 */ 50 int getId( ); 51 52 /** 53 * set the rss id 54 * 55 * @param nId 56 * the rss id 57 */ 58 void setId( int nId ); 59 60 /** 61 * 62 * @return the description 63 */ 64 String getDescription( ); 65 66 /** 67 * set the description 68 * 69 * @param strDescription 70 * the description 71 */ 72 void setDescription( String strDescription ); 73 74 /** 75 * 76 * @return the name 77 */ 78 String getName( ); 79 80 /** 81 * set the name 82 * 83 * @param strName 84 * the name 85 */ 86 void setName( String strName ); 87 88 /** 89 * 90 * @return the ResourceRssType Object 91 */ 92 IResourceRssType getResourceRssType( ); 93 94 /** 95 * set the ResourceRssType object 96 * 97 * @param resourceRssType 98 * the ResourceRsstype object 99 */ 100 void setResourceRssType( IResourceRssType resourceRssType ); 101 102 /** 103 * validates the user input associated to the resource rss 104 * 105 * @param request 106 * request 107 * @param locale 108 * locale 109 * @return null if there is no error in the resourceRss form else return the error message url 110 */ 111 String doValidateConfigForm( HttpServletRequest request, Locale locale ); 112 113 /** 114 * returns the informations which must be displayed in the creation resourceRss configuration 115 * 116 * @param request 117 * request 118 * @param locale 119 * locale 120 * @return the information which must be displayed in the creation resourceRss configuration 121 */ 122 String getDisplayCreateConfigForm( HttpServletRequest request, Locale locale ); 123 124 /** 125 * returns the informations which must be displayed in the modification resourceRss configuration 126 * 127 * @param request 128 * request 129 * @param locale 130 * locale 131 * @return the information which must be displayed in the modification resourceRss configuration 132 */ 133 String getDisplayModifyConfigForm( HttpServletRequest request, Locale locale ); 134 135 /** 136 * Save the ResourceRss configuration 137 * 138 * @param request 139 * request 140 * @param locale 141 * locale 142 */ 143 void doSaveConfig( HttpServletRequest request, Locale locale ); 144 145 /** 146 * Update the ResourceRss configuration 147 * 148 * @param request 149 * request 150 * @param locale 151 * locale 152 */ 153 void doUpdateConfig( HttpServletRequest request, Locale locale ); 154 155 /** 156 * verified that the resource contains the resource to be exploited 157 * 158 * @return true if resourceRss content resource 159 */ 160 boolean contentResourceRss( ); 161 162 /** 163 * Gets the feed with items 164 * 165 * @return the {@link IFeedResource} 166 */ 167 IFeedResource getFeed( ); 168 169 /** 170 * Update the ResourceRss configuration 171 * 172 * @param idResourceRss 173 * id of resourceRss 174 */ 175 void deleteResourceRssConfig( int idResourceRss ); 176 177 /** 178 * Return the list of parameter to keep when action apply 179 * 180 * @param request 181 * request 182 * @return the map of parameter 183 */ 184 Map<String, String> getParameterToApply( HttpServletRequest request ); 185 186 /** 187 * verify that the resource exist 188 * 189 * @return true if resource exist 190 */ 191 boolean checkResource( ); 192 193 /** 194 * Gets the feed type 195 * 196 * @return the feed type 197 */ 198 String getFeedType( ); 199 200 /** 201 * Sets the feed type 202 * 203 * @param strFeedType 204 * the feed type 205 */ 206 void setFeedType( String strFeedType ); 207 208 /** 209 * Gets the encoding 210 * 211 * @return the encoding 212 */ 213 String getEncoding( ); 214 215 /** 216 * Sets the encoding 217 * 218 * @param strEncoding 219 * the encoding 220 */ 221 void setEncoding( String strEncoding ); 222 223 /** 224 * The number of displayed item. 225 * 226 * @return the number of displayed item 227 */ 228 int getMaxItems( ); 229 230 /** 231 * Sets the number of displayed item 232 * 233 * @param nMaxItems 234 * number of displayed item 235 */ 236 void setMaxItems( int nMaxItems ); 237 }