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.mylutece.business.attribute; 35 36 import fr.paris.lutece.portal.service.plugin.Plugin; 37 38 import java.util.List; 39 import java.util.Locale; 40 41 /** 42 * 43 * IMylUteceFieldDAO 44 * 45 */ 46 public interface IMyLuteceUserFieldDAO 47 { 48 /** 49 * Load the user field 50 * 51 * @param nIdUserField 52 * Id of the user field 53 * @param locale 54 * the locale 55 * @param plugin 56 * The plugin 57 * @return MyLuteceField 58 */ 59 MyLuteceUserField load( int nIdUserField, Locale locale, Plugin plugin ); 60 61 /** 62 * Insert a new user field 63 * 64 * @param userField 65 * the user field 66 * @param plugin 67 * The plugin 68 */ 69 void insert( MyLuteceUserField userField, Plugin plugin ); 70 71 /** 72 * Update an user field 73 * 74 * @param userField 75 * the user field 76 * @param plugin 77 * The plugin 78 */ 79 void store( MyLuteceUserField userField, Plugin plugin ); 80 81 /** 82 * Delete an attribute 83 * 84 * @param nIdUserField 85 * the ID of the user field 86 * @param plugin 87 * The plugin 88 */ 89 void delete( int nIdUserField, Plugin plugin ); 90 91 /** 92 * Delete all user fields from given id field 93 * 94 * @param nIdField 95 * id field 96 * @param plugin 97 * The plugin 98 */ 99 void deleteUserFieldsFromIdField( int nIdField, Plugin plugin ); 100 101 /** 102 * Delete all user fields from given id user 103 * 104 * @param nIdUser 105 * id user 106 * @param plugin 107 * The plugin 108 */ 109 void deleteUserFieldsFromIdUser( int nIdUser, Plugin plugin ); 110 111 /** 112 * Delete all user fields from given id attribute 113 * 114 * @param nIdAttribute 115 * id attribute 116 * @param plugin 117 * The plugin 118 */ 119 void deleteUserFieldsFromIdAttribute( int nIdAttribute, Plugin plugin ); 120 121 /** 122 * Load all the user field by a given ID user 123 * 124 * @param nIdUser 125 * the ID user 126 * @param nIdAttribute 127 * the ID attribute 128 * @param plugin 129 * The plugin 130 * @return a list of MyLuteceUserField 131 */ 132 List<MyLuteceUserField> selectUserFieldsByIdUserIdAttribute( int nIdUser, int nIdAttribute, Plugin plugin ); 133 134 /** 135 * Load users by a given filter 136 * 137 * @param mlFieldFilter 138 * the filter 139 * @param plugin 140 * Plugin 141 * @return a list of users 142 */ 143 List<Integer> selectUsersByFilter( MyLuteceUserFieldFilter mlFieldFilter, Plugin plugin ); 144 }