Search in sources :

Example 6 with ControllerInitializationException

use of org.pentaho.di.ui.repository.repositoryexplorer.ControllerInitializationException in project pentaho-kettle by pentaho.

the class AbstractPermissionsController method init.

protected void init(Repository rep) throws Exception {
    if (rep != null && rep.hasService(RepositorySecurityProvider.class)) {
        service = (RepositorySecurityProvider) rep.getService(RepositorySecurityProvider.class);
    } else {
        throw new ControllerInitializationException(BaseMessages.getString(PKG, "PermissionsController.ERROR_0001_UNABLE_TO_INITIAL_REPOSITORY_SERVICE", // $NON-NLS-1$
        RepositorySecurityManager.class));
    }
    // $NON-NLS-1$
    messageBox = (XulMessageBox) document.createElement("messagebox");
    viewAclsModel = new UIRepositoryObjectAcls();
    manageAclsModel = new UIRepositoryObjectAclModel(viewAclsModel);
    bf = new DefaultBindingFactory();
    bf.setDocument(this.getXulDomContainer().getDocumentRoot());
    mainController = (MainController) this.getXulDomContainer().getEventHandler("mainController");
    // $NON-NLS-1$
    confirmBox = (XulConfirmBox) document.createElement("confirmbox");
    // $NON-NLS-1$
    confirmBox.setTitle(BaseMessages.getString(PKG, "PermissionsController.RemoveAclWarning"));
    // $NON-NLS-1$
    confirmBox.setMessage(BaseMessages.getString(PKG, "PermissionsController.RemoveAclWarningText"));
    // $NON-NLS-1$
    confirmBox.setAcceptLabel(BaseMessages.getString(PKG, "Dialog.Ok"));
    // $NON-NLS-1$
    confirmBox.setCancelLabel(BaseMessages.getString(PKG, "Dialog.Cancel"));
    confirmBox.addDialogCallback(new XulDialogCallback<Object>() {

        public void onClose(XulComponent sender, Status returnCode, Object retVal) {
            if (returnCode == Status.ACCEPT) {
                viewAclsModel.removeSelectedAcls();
            }
        }

        public void onError(XulComponent sender, Throwable t) {
        }
    });
}
Also used : UIRepositoryObjectAcls(org.pentaho.di.ui.repository.pur.repositoryexplorer.model.UIRepositoryObjectAcls) RepositorySecurityProvider(org.pentaho.di.repository.RepositorySecurityProvider) DefaultBindingFactory(org.pentaho.ui.xul.binding.DefaultBindingFactory) RepositorySecurityManager(org.pentaho.di.repository.RepositorySecurityManager) ControllerInitializationException(org.pentaho.di.ui.repository.repositoryexplorer.ControllerInitializationException) IAclObject(org.pentaho.di.ui.repository.pur.repositoryexplorer.IAclObject) XulComponent(org.pentaho.ui.xul.XulComponent) UIRepositoryObjectAclModel(org.pentaho.di.ui.repository.pur.repositoryexplorer.model.UIRepositoryObjectAclModel)

Example 7 with ControllerInitializationException

use of org.pentaho.di.ui.repository.repositoryexplorer.ControllerInitializationException in project pentaho-kettle by pentaho.

the class ConnectionPermissionsController method init.

public void init(Repository rep) throws ControllerInitializationException {
    try {
        super.init(rep);
        connectionsController = (ConnectionsController) this.getXulDomContainer().getEventHandler("connectionsController");
        connectionsController.addContextChangeVetoer(this);
        createBindings();
    } catch (Exception e) {
        throw new ControllerInitializationException(e);
    }
}
Also used : ControllerInitializationException(org.pentaho.di.ui.repository.repositoryexplorer.ControllerInitializationException) AccessDeniedException(org.pentaho.di.ui.repository.repositoryexplorer.AccessDeniedException) ControllerInitializationException(org.pentaho.di.ui.repository.repositoryexplorer.ControllerInitializationException)

Example 8 with ControllerInitializationException

use of org.pentaho.di.ui.repository.repositoryexplorer.ControllerInitializationException in project pentaho-kettle by pentaho.

the class RepositoryLockController method init.

public void init(Repository rep) throws ControllerInitializationException {
    try {
        if (rep != null && rep.hasService(ILockService.class)) {
            repository = rep;
            service = (ILockService) rep.getService(ILockService.class);
        } else {
            throw new ControllerInitializationException(BaseMessages.getString(PKG, "RepositoryLockController.ERROR_0001_UNABLE_TO_INITIAL_REPOSITORY_SERVICE", // $NON-NLS-1$
            ILockService.class));
        }
        bindingFactory = new DefaultBindingFactory();
        bindingFactory.setDocument(getXulDomContainer().getDocumentRoot());
        // $NON-NLS-1$
        XulEventHandler eventHandler = getXulDomContainer().getEventHandler("browseController");
        if (eventHandler instanceof BrowseController) {
            browseController = (BrowseController) eventHandler;
        }
        // Disable row dragging if it is locked and the user does not have permissions
        // $NON-NLS-1$
        fileTable = (XulTree) getXulDomContainer().getDocumentRoot().getElementById("file-table");
        // $NON-NLS-1$
        folderTree = (XulTree) document.getElementById("folder-tree");
        // $NON-NLS-1$
        lockFileMenuItem = (XulMenuitem) getXulDomContainer().getDocumentRoot().getElementById("file-context-lock");
        // $NON-NLS-1$
        deleteFileMenuItem = (XulMenuitem) getXulDomContainer().getDocumentRoot().getElementById("file-context-delete");
        // $NON-NLS-1$
        renameFileMenuItem = (XulMenuitem) getXulDomContainer().getDocumentRoot().getElementById("file-context-rename");
        // $NON-NLS-1$
        messageBox = (XulMessageBox) document.createElement("messagebox");
        createBindings();
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
Also used : DefaultBindingFactory(org.pentaho.ui.xul.binding.DefaultBindingFactory) ControllerInitializationException(org.pentaho.di.ui.repository.repositoryexplorer.ControllerInitializationException) AbstractXulEventHandler(org.pentaho.ui.xul.impl.AbstractXulEventHandler) XulEventHandler(org.pentaho.ui.xul.impl.XulEventHandler) ILockService(org.pentaho.di.ui.repository.pur.services.ILockService) BrowseController(org.pentaho.di.ui.repository.repositoryexplorer.controllers.BrowseController) XulException(org.pentaho.ui.xul.XulException) KettleException(org.pentaho.di.core.exception.KettleException) ControllerInitializationException(org.pentaho.di.ui.repository.repositoryexplorer.ControllerInitializationException)

Example 9 with ControllerInitializationException

use of org.pentaho.di.ui.repository.repositoryexplorer.ControllerInitializationException in project pentaho-kettle by pentaho.

the class AbsContextMenuController method init.

public void init(Repository repository) throws ControllerInitializationException {
    try {
        if (repository.hasService(IAbsSecurityProvider.class)) {
            service = (IAbsSecurityProvider) repository.getService(IAbsSecurityProvider.class);
            bf = new DefaultBindingFactory();
            bf.setDocument(this.getXulDomContainer().getDocumentRoot());
            if (bf != null) {
                createBindings();
            }
            setAllowed(allowedActionsContains(service, IAbsSecurityProvider.CREATE_CONTENT_ACTION));
        }
    } catch (KettleException e) {
        throw new ControllerInitializationException(e);
    }
}
Also used : DefaultBindingFactory(org.pentaho.ui.xul.binding.DefaultBindingFactory) KettleException(org.pentaho.di.core.exception.KettleException) ControllerInitializationException(org.pentaho.di.ui.repository.repositoryexplorer.ControllerInitializationException)

Example 10 with ControllerInitializationException

use of org.pentaho.di.ui.repository.repositoryexplorer.ControllerInitializationException in project pentaho-kettle by pentaho.

the class PermissionsController method init.

public void init(Repository rep) throws ControllerInitializationException {
    try {
        super.init(rep);
        browseController = (IBrowseController) this.getXulDomContainer().getEventHandler("browseController");
        browseController.addContextChangeVetoer(this);
        createBindings();
    } catch (Exception e) {
        throw new ControllerInitializationException(e);
    }
}
Also used : ControllerInitializationException(org.pentaho.di.ui.repository.repositoryexplorer.ControllerInitializationException) KettleException(org.pentaho.di.core.exception.KettleException) AccessDeniedException(org.pentaho.di.ui.repository.repositoryexplorer.AccessDeniedException) ControllerInitializationException(org.pentaho.di.ui.repository.repositoryexplorer.ControllerInitializationException)

Aggregations

ControllerInitializationException (org.pentaho.di.ui.repository.repositoryexplorer.ControllerInitializationException)10 KettleException (org.pentaho.di.core.exception.KettleException)5 XulException (org.pentaho.ui.xul.XulException)5 DefaultBindingFactory (org.pentaho.ui.xul.binding.DefaultBindingFactory)5 AccessDeniedException (org.pentaho.di.ui.repository.repositoryexplorer.AccessDeniedException)2 ObjectId (org.pentaho.di.repository.ObjectId)1 RepositoryDirectoryInterface (org.pentaho.di.repository.RepositoryDirectoryInterface)1 RepositoryExtended (org.pentaho.di.repository.RepositoryExtended)1 RepositorySecurityManager (org.pentaho.di.repository.RepositorySecurityManager)1 RepositorySecurityProvider (org.pentaho.di.repository.RepositorySecurityProvider)1 RepositoryConfigModel (org.pentaho.di.ui.repository.pur.model.RepositoryConfigModel)1 IAclObject (org.pentaho.di.ui.repository.pur.repositoryexplorer.IAclObject)1 UIRepositoryObjectAclModel (org.pentaho.di.ui.repository.pur.repositoryexplorer.model.UIRepositoryObjectAclModel)1 UIRepositoryObjectAcls (org.pentaho.di.ui.repository.pur.repositoryexplorer.model.UIRepositoryObjectAcls)1 ILockService (org.pentaho.di.ui.repository.pur.services.ILockService)1 IUISupportController (org.pentaho.di.ui.repository.repositoryexplorer.IUISupportController)1 BrowseController (org.pentaho.di.ui.repository.repositoryexplorer.controllers.BrowseController)1 UIObjectCreationException (org.pentaho.di.ui.repository.repositoryexplorer.model.UIObjectCreationException)1 UIRepositoryDirectory (org.pentaho.di.ui.repository.repositoryexplorer.model.UIRepositoryDirectory)1 XulComponent (org.pentaho.ui.xul.XulComponent)1