Project

General

Profile

« Previous | Next » 

Revision 2579d7d6

Added by Katja Luther over 4 years ago

fix #8470: handle constraint violation exception for username

View differences:

eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/entitycreator/UserCreator.java
13 13
import java.util.List;
14 14
import java.util.Map;
15 15

  
16
import javax.validation.ConstraintViolationException;
17

  
16 18
import org.springframework.security.access.AccessDeniedException;
17 19

  
18 20
import eu.etaxonomy.cdm.api.service.IUserService;
......
30 32
 */
31 33
public class UserCreator  implements IEntityCreator<User>{
32 34

  
33
    public static final String USER = "User";
35
    public static final String USER = "User"; //$NON-NLS-1$
34 36

  
35 37
    /* (non-Javadoc)
36 38
	 * @see eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator#createEntity(java.lang.String)
......
57 59
	            return null;
58 60
			}
59 61
		} catch (AccessDeniedException e){
60
			MessagingUtils.messageDialog("Access denied", getClass(), e.getMessage(), e);
62
			MessagingUtils.messageDialog(Messages.USER_CREATOR_Acces_denied, getClass(), e.getMessage(), e);
61 63
			return null;
64
		} catch (ConstraintViolationException cve){
65
		    MessagingUtils.messageDialog(Messages.USER_CREATOR_Name_not_accepted, getClass(), Messages.USER_CREATOR_Name_not_accepted_message);
66
		    return null;
62 67
		}
63 68
	}
64 69

  
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/l10n/Messages.java
10 10
    public static String AbstractBulkEditorInput_MERGE_ERROR_TITLE;
11 11
    public static String USER_CREATOR_user_exists_title;
12 12
    public static String USER_CREATOR_user_exists;
13
    public static String USER_CREATOR_Acces_denied;
14
    public static String USER_CREATOR_Name_not_accepted;
15
    public static String USER_CREATOR_Name_not_accepted_message;
16

  
13 17
    public static String GROUP_CREATOR_group_exists_title;
14 18
    public static String GROUP_CREATOR_group_exists;
15 19
    public static String BulkEditorE4_CANCEL;
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/l10n/messages.properties
26 26

  
27 27
USER_CREATOR_user_exists_title=The user already exists
28 28
USER_CREATOR_user_exists=The user already exists in database
29
USER_CREATOR_Acces_denied=Access denied
30
USER_CREATOR_Name_not_accepted=Username not accepted
31
USER_CREATOR_Name_not_accepted_message=Only the following characters are allowed for usernames: A-Za-z0-9_.-
32

  
29 33
GROUP_CREATOR_group_exists_title=The group already exists
30 34
GROUP_CREATOR_group_exists=The group already exists in database.
31 35
ReferencingObjectsLabelProvider_No_description_available=No description available
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/l10n/messages_de.properties
26 26

  
27 27
USER_CREATOR_user_exists_title=Der Benutzer existiert bereits
28 28
USER_CREATOR_user_exists=Der Benutzer existiert bereits in der Datenbank.
29
USER_CREATOR_Acces_denied=Access denied
30
USER_CREATOR_Name_not_accepted=Username nicht akzeptiert
31
USER_CREATOR_Name_not_accepted_message=Der Username darf nur die folgenden Zeichen enthalten: A-Za-z0-9_.-
29 32
GROUP_CREATOR_group_exists_title=Die Gruppe existiert bereits
30 33
GROUP_CREATOR_group_exists=Die Gruppe existiert bereits in der Datenbank.
31 34

  

Also available in: Unified diff