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.page; 35 36 import fr.paris.lutece.portal.service.image.ImageResource; 37 import fr.paris.lutece.util.ReferenceList; 38 39 import java.util.Collection; 40 import java.util.List; 41 42 /** 43 * IPageDAO Interface 44 */ 45 public interface IPageDAO 46 { 47 /** 48 * Insert a new record in the table. 49 * 50 * @param page 51 * The Page object 52 */ 53 void insert( Page page ); 54 55 /** 56 * load the data of level from the table 57 * 58 * @param nPageId 59 * The identifier of the object Page 60 * @param bPortlets 61 * The boolean 62 * @return The Instance of the object Page 63 */ 64 Page load( int nPageId, boolean bPortlets ); 65 66 /** 67 * load the data of level from the table without image content 68 * 69 * @param nPageId 70 * The identifier of the object Page 71 * @param bPortlets 72 * The boolean 73 * @return The Instance of the object Page 74 */ 75 Page loadWithoutImageContent( int nPageId, boolean bPortlets ); 76 77 /** 78 * load a page associated to a portlet 79 * 80 * @param nPorletId 81 * The identifier of the object portlet associate to the page 82 * @return The Instance of the object Page 83 */ 84 Page loadPageByIdPortlet( int nPorletId ); 85 86 /** 87 * Delete a record from the table 88 * 89 * @param nPageId 90 * The identifier of the object nPageId 91 */ 92 void delete( int nPageId ); 93 94 /** 95 * Update the record in the table 96 * 97 * @param page 98 * The instance of the page to update 99 */ 100 void store( Page page ); 101 102 /** 103 * Select all the child pages for a page which is specified in parameter 104 * 105 * @param nParentPageId 106 * The parent page identifier 107 * @return The list of objects Page (without portlets list) 108 */ 109 Collection<Page> selectChildPages( int nParentPageId ); 110 111 /** 112 * Select all child pages for a page which is specified in parameter For each pages, only select : Id, pageParentId, name and description 113 * 114 * @param nParentPageId 115 * the ParentPageId identifier 116 * @return The list of objects Page 117 */ 118 Collection<Page> selectChildPagesMinimalData( int nParentPageId ); 119 120 /** 121 * Loads all the pages for a portal 122 * 123 * @return The pages of the current portal (without portlets list, of course !) 124 */ 125 List<Page> selectAllPages( ); 126 127 /** 128 * Invalidate the page after a modification 129 * 130 * @param nPageId 131 * the page identifier 132 */ 133 void invalidatePage( int nPageId ); 134 135 /** 136 * Load the Referencelist of documentTypes 137 * 138 * @return listDocumentTypes 139 */ 140 ReferenceList getPagesList( ); 141 142 /** 143 * Return the list of all the pages filtered by Lutece Role specified in parameter 144 * 145 * @param strRoleKey 146 * The Lutece Role key 147 * @return a collection of pages 148 */ 149 Collection<Page> getPagesByRoleKey( String strRoleKey ); 150 151 /** 152 * Search the last order of child page list 153 * 154 * @param nParentPageId 155 * The parent page Id 156 * @return The new page order 157 */ 158 int selectNewChildPageOrder( int nParentPageId ); 159 160 /** 161 * Load a image corresponding to an Page 162 * 163 * @param nIdPage 164 * The Page Id 165 * @return the instance of the ImageContent 166 */ 167 ImageResource loadImageResource( int nIdPage ); 168 169 /** 170 * Tests if page exist 171 * 172 * @param nPageId 173 * The identifier of the document 174 * @return true if the page existed, false otherwise 175 */ 176 boolean checkPageExist( int nPageId ); 177 178 /** 179 * Load the last modified page 180 * 181 * @return the last modified {@link Page} 182 */ 183 Page loadLastModifiedPage( ); 184 185 /** 186 * Update the authorization node of the page 187 * 188 * @param nIdPage 189 * the page id 190 * @param nIdAuthorizationNode 191 * the authorization node id 192 */ 193 void updateAutorisationNode( int nIdPage, Integer nIdAuthorizationNode ); 194 195 /** 196 * select list of children Pages Which Must Change their authorization node 197 * 198 * @param nIdParentPage 199 * the id of the parent page 200 * @return an id list 201 */ 202 List<Integer> selectPageForChangeAutorisationNode( int nIdParentPage ); 203 }