1 /* 2 * Copyright (c) 2002-2016, 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 35 package fr.paris.lutece.plugins.htmldocs.business; 36 37 import fr.paris.lutece.portal.service.plugin.Plugin; 38 import fr.paris.lutece.util.ReferenceList; 39 40 import java.sql.Timestamp; 41 import java.util.Collection; 42 import java.util.Date; 43 import java.util.List; 44 45 /** 46 * IHtmlDocDAO Interface 47 */ 48 public interface IHtmlDocDAO 49 { 50 /** 51 * Insert a new record in the table. 52 * 53 * @param htmlDoc 54 * instance of the HtmlDoc object to insert 55 * @param plugin 56 * the Plugin 57 */ 58 void insert( HtmlDoc htmlDoc, Plugin plugin ); 59 60 /** 61 * Insert a new record in the table. 62 * 63 * @param htmlDoc 64 * instance of the HtmlDoc object to insert 65 * @param plugin 66 * the Plugin 67 */ 68 void insertVersion( HtmlDoc htmlDoc, Plugin plugin ); 69 70 /** 71 * Update the record in the table 72 * 73 * @param htmlDoc 74 * the reference of the HtmlDoc 75 * @param plugin 76 * the Plugin 77 */ 78 void store( HtmlDoc htmlDoc, Plugin plugin ); 79 80 /** 81 * Delete a record from the table 82 * 83 * @param nKey 84 * The identifier of the HtmlDoc to delete 85 * @param plugin 86 * the Plugin 87 */ 88 void delete( int nKey, Plugin plugin ); 89 90 /** 91 * Delete a record from the table 92 * 93 * @param nKey 94 * The identifier of the HtmlDoc to delete 95 * @param plugin 96 * the Plugin 97 */ 98 void deleteVersions( int nKey, Plugin plugin ); 99 100 // ///////////////////////////////////////////////////////////////////////// 101 // Finders 102 103 /** 104 * Load the data from the table 105 * 106 * @param nKey 107 * The identifier of the htmlDoc 108 * @param plugin 109 * the Plugin 110 * @return The instance of the htmlDoc 111 */ 112 HtmlDoc load( int nKey, Plugin plugin ); 113 114 /** 115 * Load the data from the table 116 * 117 * @param nKey 118 * The identifier of the htmlDoc 119 * @param plugin 120 * the Plugin 121 * @return The instance of the htmlDoc 122 */ 123 HtmlDoc loadByName( String strName, Plugin plugin ); 124 125 /** 126 * Load the data from the table 127 * 128 * @param nKey 129 * The identifier of the htmlDoc 130 * @param plugin 131 * the Plugin 132 * @return The instance of the htmlDoc 133 */ 134 HtmlDoc loadVersion( int nId, int nVersion, Plugin plugin ); 135 136 /** 137 * Load the data of all the htmlDoc objects and returns them as a list 138 * 139 * @param plugin 140 * the Plugin 141 * @return The list which contains the data of all the htmlDoc objects 142 */ 143 List<HtmlDoc> selectHtmlDocsList( Plugin plugin ); 144 145 /** 146 * Load the data of all the htmlDoc objects and returns them as a list 147 * 148 * @param plugin 149 * the Plugin 150 * @return The list which contains the data of all the htmlDoc objects 151 */ 152 List<HtmlDoc> selectHtmlDocsVersionsList( int nId, Plugin plugin ); 153 154 /** 155 * Load the id of all the htmlDoc objects and returns them as a list 156 * 157 * @param plugin 158 * the Plugin 159 * @return The list which contains the id of all the htmlDoc objects 160 */ 161 List<Integer> selectIdHtmlDocsList( Plugin plugin ); 162 163 /** 164 * Load the data of all the htmlDoc objects and returns them as a referenceList 165 * 166 * @param plugin 167 * the Plugin 168 * @return The referenceList which contains the data of all the htmlDoc objects 169 */ 170 ReferenceList selectHtmlDocsReferenceList( Plugin plugin ); 171 172 /** 173 * Load the list of htmldocs 174 * @param filter The HtmlDOcFilter Object 175 * @return The Collection of the htmldocss 176 */ 177 List<HtmlDoc> selectByFilter( HtmlDocFilter filter ); 178 179 180 181 }