View Javadoc
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.tagcloud.business;
35  
36  import fr.paris.lutece.portal.service.plugin.Plugin;
37  import fr.paris.lutece.util.ReferenceList;
38  
39  import java.util.ArrayList;
40  import java.util.Collection;
41  
42  
43  /**
44  * ITagDAO Interface
45  */
46  public interface ITagDAO
47  {
48      /**
49       * Insert a new record in the table.
50       * @param tag instance of the tag object to inssert
51       * @param plugin the Plugin
52       */
53      void insert( Tag tag, Plugin plugin );
54  
55      /**
56      * Update the record in the table
57      * @param tag the reference of the tag
58      * @param plugin the Plugin
59      */
60      void store( Tag tag, Plugin plugin );
61  
62      /**
63       * Deletes a Tag
64       * @param nIdTag The tag id
65       * @param nCloudId The Cloud id
66       * @param plugin the Plugin
67       */
68      void deleteTag( int nIdTag, int nCloudId, Plugin plugin );
69  
70      /**
71       * Deletes a cloud
72       * @param nCloudId The Cloud id
73       * @param plugin the Plugin
74       */
75      void deleteCloud( int nCloudId, Plugin plugin );
76  
77      ///////////////////////////////////////////////////////////////////////////
78      // Finders
79  
80      /**
81       * Load the data from the table
82       * @return The instance of the tag
83       * @param nCloudId The Cloud id
84       * @param nTagId The tag id
85       * @param plugin the Plugin
86       */
87      Tag load( int nCloudId, int nTagId, Plugin plugin );
88  
89      /**
90       * Load by cloud
91       * @param nCloudId The Cloud id
92       * @param plugin The plugin
93       * @return A list of tags
94       */
95      ArrayList<Tag> loadByCloud( int nCloudId, Plugin plugin );
96  
97      /**
98      * Load the data of all the tag objects and returns them as a collection
99      * @param plugin the Plugin
100     * @return The collection which contains the data of all the tags
101     */
102     Collection<Tag> selectTagList( Plugin plugin );
103 
104     /**
105      * Select all tag clouds
106      * @param plugin The plugin
107      * @return A collection of tag clouds
108      */
109     Collection<TagCloud> selectTagClouds( Plugin plugin );
110 
111     /**
112      * Select tag cloud by identifier
113      * @param nCloudId The Cloud id
114      * @param plugin The plugin
115      * @return A tagcloud
116      */
117     TagCloud selectCloudById( int nCloudId, Plugin plugin );
118 
119     /**
120      * Inserts a tag cloud
121      * @param tagCloud The tag cloud
122      * @param plugin The plugin
123      */
124     void insert( TagCloud tagCloud, Plugin plugin );
125 
126     /**
127      * Stores a tagcloud
128      * @param tagCloud The tagcloud object
129      * @param plugin The plugin
130      */
131     void store( TagCloud tagCloud, Plugin plugin );
132 
133     /**
134      * Selects all tagclouds
135      * @param plugin The plugin
136      * @return a ReferenceList
137      */
138     ReferenceList selectAllTagClouds( Plugin plugin );
139 }