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; }
private UIDatabaseConnection createUIConnection( DatabaseMeta dbMeta ) { UIDatabaseConnection conn = null; try { conn = UIObjectRegistry.getInstance().constructUIDatabaseConnection( dbMeta, repository ); } catch ( UIObjectCreationException uoe ) { conn = new UIDatabaseConnection( dbMeta, repository ); } return conn; }
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??? } }
UIObjectRegistry.getInstance().registerUIRepositoryUserClass( UIEERepositoryUser.class ); } else { UIObjectRegistry.getInstance().registerUIRepositoryUserClass( UIObjectRegistry.DEFAULT_UIREPOSITORYUSER_CLASS ); UIObjectRegistry.getInstance().registerUIRepositoryDirectoryClass( UIEERepositoryDirectory.class ); UIObjectRegistry.getInstance().registerUIDatabaseConnectionClass( UIEEDatabaseConnection.class ); } else { UIObjectRegistry.getInstance().registerUIRepositoryDirectoryClass( UIObjectRegistry.DEFAULT_UIDIR_CLASS ); UIObjectRegistry.getInstance().registerUIJobClass( UIEEJob.class ); UIObjectRegistry.getInstance().registerUITransformationClass( UIEETransformation.class ); SpoonDelegateRegistry.getInstance().registerSpoonJobDelegateClass( SpoonEEJobDelegate.class ); SpoonDelegateRegistry.getInstance().registerSpoonTransDelegateClass( SpoonEETransformationDelegate.class ); } else { UIObjectRegistry.getInstance().registerUIJobClass( UIObjectRegistry.DEFAULT_UIJOB_CLASS ); UIObjectRegistry.getInstance().registerUITransformationClass( UIObjectRegistry.DEFAULT_UITRANS_CLASS ); SpoonDelegateRegistry.getInstance().registerSpoonJobDelegateClass( SpoonDelegateRegistry.DEFAULT_SPOONJOBDELEGATE_CLASS ); SpoonDelegateRegistry.getInstance().registerSpoonTransDelegateClass( SpoonDelegateRegistry.DEFAULT_SPOONTRANSDELEGATE_CLASS );
public void populateChildren() { if ( kidDirectoryCache == null || !populated ) { kidDirectoryCache = new UIRepositoryDirectories(); } for ( RepositoryDirectoryInterface child : rd.getChildren() ) { try { kidDirectoryCache.add( UIObjectRegistry.getInstance().constructUIRepositoryDirectory( child, this, rep ) ); } catch ( UIObjectCreationException e ) { kidDirectoryCache.add( new UIRepositoryDirectory( child, this, rep ) ); } } populated = true; }
/** * 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(); } } } }
public UIRepositoryDirectory createFolder( String name ) throws Exception { RepositoryDirectoryInterface thisDir = getDirectory(); RepositoryDirectoryInterface dir; //PDI-5202: the directory might exist already. If so, don't create a new one. String dirName = checkDirNameExistsInRepo( name ); if ( dirName == null ) { dir = rep.createRepositoryDirectory( thisDir, name ); } else { dir = rep.findDirectory( thisDir.getPath() + "/" + dirName ); } UIRepositoryDirectory newDir = null; try { newDir = UIObjectRegistry.getInstance().constructUIRepositoryDirectory( dir, this, rep ); } catch ( UIObjectCreationException uoe ) { newDir = new UIRepositoryDirectory( dir, this, rep ); } UIRepositoryDirectories directories = getChildren(); if ( !contains( directories, newDir ) ) { directories.add( newDir ); } else { throw new KettleException( "Unable to create folder with the same name [" + name + "]" ); } kidElementCache = null; // rebuild the element cache for correct positioning. return newDir; }
@SuppressWarnings( "deprecation" ) public void init( Repository repository ) throws ControllerInitializationException { try { this.repository = repository; mainController = (MainController) this.getXulDomContainer().getEventHandler( "mainController" ); RepositoryDirectoryInterface root; try { if ( repository instanceof RepositoryExtended ) { root = ( (RepositoryExtended) repository ).loadRepositoryDirectoryTree( false ); } else { root = repository.loadRepositoryDirectoryTree(); } this.repositoryDirectory = UIObjectRegistry.getInstance().constructUIRepositoryDirectory( root, null, repository ); } catch ( UIObjectCreationException uoe ) { this.repositoryDirectory = new UIRepositoryDirectory( repository.loadRepositoryDirectoryTree(), null, repository ); } this.repositoryDirectory.populateChildren(); dirMap = new HashMap<ObjectId, UIRepositoryDirectory>(); populateDirMap( repositoryDirectory ); bf = new SwtBindingFactory(); bf.setDocument( this.getXulDomContainer().getDocumentRoot() ); messageBox = (XulMessageBox) document.createElement( "messagebox" ); createBindings(); } catch ( Exception e ) { throw new ControllerInitializationException( e ); } }
if ( child.getObjectType().equals( RepositoryObjectType.TRANSFORMATION ) ) { try { kidElementCache.add( UIObjectRegistry.getInstance().constructUITransformation( child, this, rep ) ); } catch ( UIObjectCreationException e ) { kidElementCache.add( new UITransformation( child, this, rep ) ); kidElementCache.add( UIObjectRegistry.getInstance().constructUIJob( child, this, rep ) ); } catch ( UIObjectCreationException e ) { kidElementCache.add( new UIJob( child, this, rep ) );