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.business.stylesheet.StyleSheet; 37 38 import java.util.Collection; 39 import java.util.List; 40 41 42 /** 43 * IRssGeneratedFileDAO 44 */ 45 public interface IRssGeneratedFileDAO 46 { 47 /** 48 * Checks if a rssFile file exist for this portlet identifier 49 * @param nPortletId The identifier of the portlet 50 * @return true if a rssFile file exist for this portlet 51 */ 52 boolean checkExistPushrssByPortlet( int nPortletId ); 53 54 /** 55 * Tests if a push rss file exist with the same name 56 * @param strRssFileName The push RSS file's name 57 * @return true if the name already exist 58 */ 59 boolean checkRssFileFileName( String strRssFileName ); 60 61 /** 62 * Tests if the portlet has not been deleted before update 63 * @param nPortletId The portlet identifier for this RSS file 64 * @return true il the portlet exist 65 */ 66 boolean checkRssFilePortlet( int nPortletId ); 67 68 /** 69 * Deletes a record from the table 70 * @param nRssFileId The identifier of the rssFile object 71 */ 72 void delete( int nRssFileId ); 73 74 /** 75 * Inserts a new record in the table rss_generation. 76 * @param rssFile The Instance of the object RssFile 77 */ 78 void insert( RssGeneratedFile rssFile ); 79 80 /** 81 * Loads the data of a rssFile file from the table 82 * @param nRssFileId The identifier of the rssFile file 83 * @return The RSS file 84 */ 85 RssGeneratedFile load( int nRssFileId ); 86 87 /** 88 * Returns a collection of all portlets 89 * @return the portlets in form of Collection 90 */ 91 Collection selectAllRssPortlets( ); 92 93 /** 94 * Returns all the documents of a portlet whose identifier is specified in parameter 95 * @param nPortletId the identifier of the portlet 96 * @return List of documents 97 */ 98 List selectDocumentsByPortlet( int nPortletId ); 99 100 /** 101 * Returns the list of the rss_generation files 102 * @return the List of rss files 103 */ 104 List<RssGeneratedFile> selectRssFileList( ); 105 106 /** 107 * Reads the portlet's name 108 * @param nPortletId the identifier of the portlet 109 * @return The name of the portlet 110 */ 111 String selectRssFilePortletName( int nPortletId ); 112 113 /** 114 * Returns a collection of portlets for which there isn't any RSS files 115 * @return the portlets in form of Collection 116 */ 117 Collection selectRssPortlets( ); 118 119 /** 120 * Returns the stylesheet for RSS files 121 * @param nStyleSheetId the identifier of the Stylesheet 122 * @return the stylesheet 123 */ 124 StyleSheet selectXslFile( int nStyleSheetId ); 125 126 /** 127 * Updates the record in the table rss_generation 128 * @param rssFile The Instance of the object rssFile 129 */ 130 void store( RssGeneratedFile rssFile ); 131 132 /** 133 * Updates the rssFile's state 134 * @param rssFile The Instance of the object rssFile 135 */ 136 void updateState( RssGeneratedFile rssFile ); 137 }