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