View Javadoc
1   /*
2    * Copyright (c) 2002-2020, 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.plugins.blog.business;
35  
36  import fr.paris.lutece.portal.service.plugin.Plugin;
37  import fr.paris.lutece.util.ReferenceList;
38  
39  import java.util.List;
40  
41  /**
42   * IBlogDAO Interface
43   */
44  public interface IBlogDAO
45  {
46      /**
47       * Insert a new record in the table.
48       * 
49       * @param blog
50       *            instance of the Blog object to insert
51       * @param plugin
52       *            the Plugin
53       */
54      void insert( Blog blog, Plugin plugin );
55  
56      /**
57       * Insert a new record in the table.
58       * 
59       * @param blog
60       *            instance of the blog object to insert
61       * @param plugin
62       *            the Plugin
63       */
64      void insertVersion( Blog blog, Plugin plugin );
65  
66      /**
67       * Update the record in the table
68       * 
69       * @param blog
70       *            the reference of the blog
71       * @param plugin
72       *            the Plugin
73       */
74      void store( Blog blog, Plugin plugin );
75  
76      /**
77       * Delete a record from the table
78       * 
79       * @param nKey
80       *            The identifier of the blog to delete
81       * @param plugin
82       *            the Plugin
83       */
84      void delete( int nKey, Plugin plugin );
85  
86      /**
87       * Delete a record from the table
88       * 
89       * @param nKey
90       *            The identifier of the blog to delete
91       * @param plugin
92       *            the Plugin
93       */
94      void deleteVersions( int nKey, Plugin plugin );
95  
96      // /////////////////////////////////////////////////////////////////////////
97      // Finders
98  
99      /**
100      * Load the data from the table
101      * 
102      * @param nKey
103      *            The identifier of the blog
104      * @param plugin
105      *            the Plugin
106      * @return The instance of the blog
107      */
108     Blog load( int nKey, Plugin plugin );
109 
110     /**
111      * Load the data from the table
112      * 
113      * @param strName
114      *            The name of the blog
115      * @param plugin
116      *            the Plugin
117      * @return The instance of the blog
118      */
119     Blog loadByName( String strName, Plugin plugin );
120 
121     /**
122      * Load the data from the table
123      * 
124      * @param nId
125      *            The identifier of the blog
126      * @param nVersion
127      *            The version
128      * @param plugin
129      *            the Plugin
130      * @return The instance of the blog
131      */
132     Blog loadVersion( int nId, int nVersion, Plugin plugin );
133 
134     /**
135      * Load the data of all the blog objects and returns them as a list
136      * 
137      * @param plugin
138      *            the Plugin
139      * @return The list which contains the data of all the blog objects
140      */
141     List<Blog> selectBlogsList( Plugin plugin );
142 
143     /**
144      * Load the data of nLimit last modified blog objects and returns them as a list
145      * 
146      * @param plugin
147      *            the Plugin
148      * @param nLimit
149      *            number of blogument
150      * @return The list which contains the data of of nLimit last modified blog objects
151      */
152     List<Blog> selectlastModifiedBlogsList( Plugin plugin, int nLimit );
153 
154     /**
155      * Load the data of all the blog objects and returns them as a list
156      * 
157      * @param plugin
158      *            the Plugin
159      * @return The list which contains the data of all the blog objects
160      */
161     List<Blog> selectBlogsVersionsList( int nId, Plugin plugin );
162 
163     /**
164      * Load the data of all the users edited the blog and returns them as a list
165      * 
166      * @param plugin
167      *            the Plugin
168      * @return The list which contains the data of all the users edited blog objects
169      */
170     List<String> selectAllUsersEditedBlog( int nId, Plugin plugin );
171 
172     /**
173      * Load the id of all the Blog objects and returns them as a list
174      * 
175      * @param plugin
176      *            the Plugin
177      * @return The list which contains the id of all the Blog objects
178      */
179     List<Integer> selectIdBlogsList( Plugin plugin );
180 
181     /**
182      * Load the data of all the Blog objects and returns them as a referenceList
183      * 
184      * @param plugin
185      *            the Plugin
186      * @return The referenceList which contains the data of all the Blog objects
187      */
188     ReferenceList selectBlogsReferenceList( Plugin plugin );
189 
190     /**
191      * Load the list of Blogs
192      * 
193      * @param filter
194      *            The BlogFilter Object
195      * @return The Collection of the Blogss
196      */
197     List<Blog> selectByFilter( BlogFilter filter );
198 
199     /**
200      * Load the list of Blogs objects and returns them as a list
201      * 
202      * @param nIdTag
203      * @param plugin
204      *            the Plugin
205      * @return the list of Blogs objects
206      */
207     List<Blog> loadBlogByIdTag( int nIdTag, Plugin plugin );
208 
209     List<Blog> selectWithoutBinaries( Plugin plugin );
210 
211 }