private List<IUIUser> convertToUIUserModel( List<IUser> users ) throws UIObjectCreationException { List<IUIUser> rusers = new ArrayList<IUIUser>(); for ( IUser user : users ) { rusers.add( UIObjectRegistry.getInstance().constructUIRepositoryUser( user ) ); } return rusers; }
public Set<IUIUser> getUsers() { Set<IUIUser> rusers = new HashSet<IUIUser>(); for ( IUser userInfo : rri.getUsers() ) { try { rusers.add( UIObjectRegistry.getInstance().constructUIRepositoryUser( userInfo ) ); } catch ( UIObjectCreationException e ) { // TODO Auto-generated catch block e.printStackTrace(); } } return rusers; }
public UISecurity( RepositorySecurityManager rsm ) throws Exception { this(); if ( rsm != null && rsm.getUsers() != null ) { for ( IUser user : rsm.getUsers() ) { userList.add( UIObjectRegistry.getInstance().constructUIRepositoryUser( user ) ); } Collections.sort( userList ); this.firePropertyChange( "userList", null, userList ); } }
public UIRepositoryUsers( RepositorySecurityProvider rsp, RepositorySecurityManager rsm ) { String[] logins; try { logins = rsp.getUserLogins(); for ( String login : logins ) { this.add( UIObjectRegistry.getInstance().constructUIRepositoryUser( rsm.loadUserInfo( login ) ) ); } } catch ( Exception e ) { // TODO: handle exception; can't get users??? } }
/** * 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(); } } } }
/** * addRole method is called when user has click ok on a add role dialog. The method add the role * * @throws Exception */ @Override protected void addUser() { if ( service != null ) { try { service.saveUserInfo( eeSecurityUser.getUserInfo() ); eeSecurity.addUser( UIObjectRegistry.getInstance().constructUIRepositoryUser( eeSecurityUser.getUserInfo() ) ); userDialog.hide(); } catch ( Throwable th ) { if ( mainController == null || !mainController.handleLostRepository( th ) ) { messageBox.setTitle( BaseMessages.getString( PKG, "CantCreateUserDialog.Title" ) );//$NON-NLS-1$ messageBox.setAcceptLabel( BaseMessages.getString( PKG, "Dialog.Close" ) );//$NON-NLS-1$ messageBox .setMessage( BaseMessages.getString( PKG, "CantCreateUserDialog.Message", th.getLocalizedMessage() ) );//$NON-NLS-1$ messageBox.open(); } } } }