View Javadoc
1   /*
2    * Copyright (c) 2002-2017, 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.adminsql.business;
35  
36  import fr.paris.lutece.plugins.adminsql.business.Field;
37  import fr.paris.lutece.portal.service.plugin.Plugin;
38  import fr.paris.lutece.util.ReferenceList;
39  
40  import java.sql.SQLException;
41  
42  import java.util.List;
43  
44  
45  /**
46   * Lists all methods which are in FieldDAO
47   */
48  public interface IFieldDAO
49  {
50      /**
51       * Find the field list
52       * @param strPoolName the name of the pool
53       * @param strTableName the name of the table
54       * @param plugin Plugin adminsql
55       * @return the field list
56       */
57      List<Field> selectFieldList( String strPoolName, String strTableName, Plugin plugin );
58  
59      /**
60       * Load a field from the table
61       * @param strPoolName the name of the pool
62       * @param strTableName the name of the table
63       * @param strFieldName the name of the field
64       * @param plugin Plugin adminsql
65       * @return a field object
66       */
67      Field load( String strPoolName, String strTableName, String strFieldName, Plugin plugin );
68  
69      /**
70       * lists the field list possiblilities to create or modify fields form
71       * @param strPoolName the name of the pool
72       * @param plugin plugin adminsql
73       * @return Field list
74       */
75      ReferenceList selectFieldTypeList( String strPoolName, Plugin plugin );
76  
77      /**
78       * lists the field list possiblilities to create or modify fields form
79       * @param strPoolName the name of the pool
80       * @param plugin plugin adminsql
81       * @return Field list
82       */
83      ReferenceList selectFieldKeyList( String strPoolName, Plugin plugin );
84  
85      /**
86       * Find the reference list of null list
87       * @param strPoolName the name of the pool
88       * @param plugin Plugin adminsql
89       * @return reference list of null list
90       */
91      ReferenceList selectFieldNullList( String strPoolName, Plugin plugin );
92  
93      /**
94       * Insert a field into a table
95       * @param strPoolName the name of the pool
96       * @param strTableName the name of the pool
97       * @param field Field object
98       * @param plugin Plugin adminsql
99       */
100     void insert( String strPoolName, String strTableName, Field field, Plugin plugin );
101 
102     /**
103      * Delete field from a table
104      * @param strTableName the name of the table
105      * @param strFieldName the name of the field
106      * @param plugin Plugin adminsql
107      */
108     void delete( String strTableName, String strFieldName, Plugin plugin );
109 
110     /**
111      * Store a field into a table
112      * @param strPoolName the name of the pool
113      * @param strTableName the name of the table
114      * @param field Field object
115      * @param strFieldNameToModify the name of the field to modify
116      * @param nIdOldFieldKey the id of the field key
117      * @param plugin Plugin adminsql
118      */
119     void store( String strPoolName, String strTableName, Field field, String strFieldNameToModify, int nIdOldFieldKey,
120         Plugin plugin );
121 }