Search in sources :

Example 1 with UIRepositoryObjectAclModel

use of org.pentaho.di.ui.repository.pur.repositoryexplorer.model.UIRepositoryObjectAclModel 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)

Aggregations

RepositorySecurityManager (org.pentaho.di.repository.RepositorySecurityManager)1 RepositorySecurityProvider (org.pentaho.di.repository.RepositorySecurityProvider)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 ControllerInitializationException (org.pentaho.di.ui.repository.repositoryexplorer.ControllerInitializationException)1 XulComponent (org.pentaho.ui.xul.XulComponent)1 DefaultBindingFactory (org.pentaho.ui.xul.binding.DefaultBindingFactory)1