protected void createSecurityUser() throws Exception { securityUser = new UISecurityUser( service ); }
public void setPassword( String password ) { String previousValue = this.password; this.password = password; this.firePropertyChange( "password", previousValue, password ); }
public void clear() { setMode( Mode.ADD ); setName( "" ); setDescription( "" ); setPassword( "" ); }
public void setUser( IUIUser user ) throws Exception { setDescription( user.getDescription() ); setName( user.getName() ); // Show empty password on the client site setPassword( "" ); }
@Override public void clear() { super.clear(); setAssignedSelectedRoles( null ); setAvailableSelectedRoles( null ); setAvailableRoles( null ); setAssignedRoles( null ); setRoleAssignmentPossible( false ); setRoleUnassignmentPossible( false ); }
public void setUser( IUIUser user, List<IUIRole> roles ) throws Exception { super.setUser( user ); setAvailableRoles( roles ); if ( user instanceof IUIEEUser ) { for ( IUIRole role : ( (IUIEEUser) user ).getRoles() ) { removeFromAvailableRoles( role.getName() ); addToAssignedRoles( UIEEObjectRegistery.getInstance().constructUIRepositoryRole( role.getRole() ) ); } } }
/** * updateUser method is called when user has click ok on a edit user dialog. The method updates the user * * @throws Exception */ protected void updateUser() { if ( service != null ) { try { IUIUser uiUser = security.getSelectedUser(); uiUser.setDescription( securityUser.getDescription() ); uiUser.setPassword( securityUser.getPassword() ); service.updateUser( uiUser.getUserInfo() ); security.updateUser( uiUser ); userDialog.hide(); } catch ( Throwable th ) { if ( mainController == null || !mainController.handleLostRepository( th ) ) { messageBox.setTitle( BaseMessages.getString( PKG, "Dialog.Error" ) ); messageBox.setAcceptLabel( BaseMessages.getString( PKG, "Dialog.Ok" ) ); messageBox.setMessage( BaseMessages.getString( PKG, "UpdateUser.UnableToUpdateUser", th .getLocalizedMessage() ) ); messageBox.open(); } } } }
/** * saveUser method is called when the user click on the ok button of a Add or Edit User dialog Depending on the mode * it calls add of update user method * * @throws Exception */ public void saveUser() throws Exception { if ( securityUser.getMode().equals( Mode.ADD ) ) { addUser(); } else { updateUser(); } }
/** * addRole method is called when user has click ok on a add role dialog. The method add the role * * @throws Exception */ protected void addUser() { if ( service != null ) { try { service.saveUserInfo( securityUser.getUserInfo() ); security.addUser( UIObjectRegistry.getInstance().constructUIRepositoryUser( securityUser.getUserInfo() ) ); userDialog.hide(); } catch ( Throwable th ) { if ( mainController == null || !mainController.handleLostRepository( th ) ) { messageBox.setTitle( BaseMessages.getString( PKG, "CantCreateUserDialog.Title" ) ); messageBox.setAcceptLabel( BaseMessages.getString( PKG, "Dialog.Close" ) ); messageBox.setMessage( BaseMessages.getString( PKG, "CantCreateUserDialog.Message", th.getLocalizedMessage() ) ); messageBox.open(); } } } }
public void setName( String name ) { String previousValue = this.name; this.name = name; this.firePropertyChange( "name", previousValue, name ); }
public void setDescription( String description ) { String previousValue = this.description; this.description = description; this.firePropertyChange( "description", previousValue, description ); }
public void setMode( Mode mode ) { this.mode = mode; this.firePropertyChange( "mode", null, mode ); }