1 /*
2 * Copyright (c) 2002-2021, 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 java.util.List;
37
38 import fr.paris.lutece.portal.service.plugin.Plugin;
39
40 public interface IDocContentDAO
41 {
42 /**
43 * Create an instance of the DocContent class
44 *
45 * @param docContent
46 * The Document Content
47 * @param plugin
48 * the plugin
49 */
50 void insertDocContent( DocContent docContent, Plugin plugin );
51
52 /**
53 * Returns an instance of a DocContent whose identifier is specified in parameter
54 *
55 * @param nIdDocument
56 * @param plugin
57 * the plugin
58 * @return an instance of DocContent
59 */
60 DocContent loadDocContent( int nIdDocument, Plugin plugin );
61
62 /**
63 * Returns an list of a DocContent whose htmldoc identifier is specified in parameter
64 *
65 * @param idHtmlDoc
66 * @param plugin
67 * the plugin
68 * @return an instance of DocContent
69 */
70 List<DocContent> loadDocContentByIdHtemldoc( int idHtmlDoc, Plugin plugin );
71
72 /**
73 * Remove the DocContent identifier Blog is specified in parameter
74 *
75 * @param nBlogId
76 * the Id Blog
77 * @param plugin
78 * the plugin
79 */
80 void delete( int nBlogId, Plugin plugin );
81
82 /**
83 * Remove the DocContent whose identifier is specified in parameter
84 *
85 * @param nDocumentId
86 * the Id DocContent
87 * @param plugin
88 * the plugin
89 */
90 void deleteById( int nDocumentId, Plugin plugin );
91
92 /**
93 * Update of the DocContent which is specified in parameter
94 *
95 * @param docContent
96 * the Document Content
97 * @param plugin
98 * the plugin
99 */
100 void store( DocContent docContent, Plugin plugin );
101
102 /**
103 * Returns an instance of a ContentType whose identifier is specified in parameter
104 *
105 * @param idType
106 * The identifier
107 * @param plugin
108 * the plugin
109 * @return an instance of a ContentType
110 */
111 ContentType loadContentType( int idType, Plugin plugin );
112
113 /**
114 * Returns a list of a ContentType
115 *
116 * @param plugin
117 * the plugin
118 * @return a list of a ContentType
119 */
120 List<ContentType> loadListContentType( Plugin plugin );
121
122 /**
123 * Link a blog with a document
124 *
125 * @param nIdBlog
126 *
127 * @param nIdDocument
128 *
129 * @param nPriority
130 *
131 * @param plugin
132 *
133 */
134 void insertDocContentInBlog( int nIdBlog, int nIdDocument, int nPriority, Plugin plugin );
135
136 /**
137 * Remove the link between the document and the blog
138 *
139 * @param nDocumentId
140 * the document Id
141 * @param plugin
142 * the plugin
143 */
144 void deleteInBlogById( int nDocumentId, Plugin plugin );
145 }