Search in sources :

Example 91 with CloseableModalController

use of org.olat.core.gui.control.generic.closablewrapper.CloseableModalController in project OpenOLAT by OpenOLAT.

the class CatalogNodeManagerController method doAddResource.

private void doAddResource(UserRequest ureq) {
    removeAsListenerAndDispose(entrySearchCtrl);
    removeAsListenerAndDispose(cmc);
    entrySearchCtrl = new RepositorySearchController(translate("choose"), ureq, getWindowControl(), true, false, new String[0], null);
    listenTo(entrySearchCtrl);
    // OLAT-Admin has search form
    if (ureq.getUserSession().getRoles().isOLATAdmin()) {
        entrySearchCtrl.displaySearchForm();
    } else // an Author gets the list of his repository
    {
        // admin is responsible for not inserting wrong visibility entries!!
        entrySearchCtrl.doSearchByOwnerLimitAccess(ureq.getIdentity());
    }
    // open form in dialog
    cmc = new CloseableModalController(getWindowControl(), "close", entrySearchCtrl.getInitialComponent(), true, translate("tools.add.catalog.link"));
    listenTo(cmc);
    cmc.activate();
}
Also used : RepositorySearchController(org.olat.repository.controllers.RepositorySearchController) CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)

Example 92 with CloseableModalController

use of org.olat.core.gui.control.generic.closablewrapper.CloseableModalController in project OpenOLAT by OpenOLAT.

the class CatalogNodeManagerController method doMoveCategory.

private void doMoveCategory(UserRequest ureq, CatalogEntryRow row) {
    removeAsListenerAndDispose(cmc);
    removeAsListenerAndDispose(entryResourceMoveCtrl);
    CatalogEntry moveMe = catalogManager.getCatalogEntryBy(row, catalogEntry);
    if (moveMe != null) {
        entryResourceMoveCtrl = new CatalogEntryMoveController(getWindowControl(), ureq, moveMe, getTranslator());
        listenTo(entryResourceMoveCtrl);
        cmc = new CloseableModalController(getWindowControl(), "close", entryResourceMoveCtrl.getInitialComponent(), true, translate("tools.move.catalog.entry"));
        listenTo(cmc);
        cmc.activate();
    }
}
Also used : CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) CatalogEntry(org.olat.repository.CatalogEntry)

Example 93 with CloseableModalController

use of org.olat.core.gui.control.generic.closablewrapper.CloseableModalController in project OpenOLAT by OpenOLAT.

the class CatalogNodeManagerController method doEditCategory.

private void doEditCategory(UserRequest ureq) {
    removeAsListenerAndDispose(editEntryCtrl);
    removeAsListenerAndDispose(cmc);
    catModificationLock = CoordinatorManager.getInstance().getCoordinator().getLocker().acquireLock(lockRes, getIdentity(), LOCK_TOKEN);
    if (catModificationLock.isSuccess()) {
        editEntryCtrl = new CatalogEntryEditController(ureq, getWindowControl(), catalogEntry);
        editEntryCtrl.setElementCssClass("o_sel_catalog_edit_category_popup");
        listenTo(editEntryCtrl);
        // open form in dialog
        cmc = new CloseableModalController(getWindowControl(), "close", editEntryCtrl.getInitialComponent(), true, translate("tools.edit.catalog.category"));
        listenTo(cmc);
        cmc.activate();
    } else {
        String ownerName = userManager.getUserDisplayName(catModificationLock.getOwner());
        showError("catalog.locked.by", ownerName);
    }
}
Also used : CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)

Example 94 with CloseableModalController

use of org.olat.core.gui.control.generic.closablewrapper.CloseableModalController in project OpenOLAT by OpenOLAT.

the class CatalogNodeManagerController method doAddCategory.

private void doAddCategory(UserRequest ureq) {
    removeAsListenerAndDispose(addEntryCtrl);
    removeAsListenerAndDispose(cmc);
    catModificationLock = CoordinatorManager.getInstance().getCoordinator().getLocker().acquireLock(lockRes, getIdentity(), LOCK_TOKEN);
    if (catModificationLock.isSuccess()) {
        CatalogEntry ce = catalogManager.createCatalogEntry();
        addEntryCtrl = new CatalogEntryEditController(ureq, getWindowControl(), ce, catalogEntry);
        addEntryCtrl.setElementCssClass("o_sel_catalog_add_category_popup");
        listenTo(addEntryCtrl);
        cmc = new CloseableModalController(getWindowControl(), "close", addEntryCtrl.getInitialComponent(), true, translate("tools.add.catalog.category"));
        listenTo(cmc);
        cmc.activate();
    } else {
        String ownerName = userManager.getUserDisplayName(catModificationLock.getOwner());
        showError("catalog.locked.by", ownerName);
    }
}
Also used : CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) CatalogEntry(org.olat.repository.CatalogEntry)

Example 95 with CloseableModalController

use of org.olat.core.gui.control.generic.closablewrapper.CloseableModalController in project OpenOLAT by OpenOLAT.

the class RepositoryEntryRuntimeController method doDelete.

private void doDelete(UserRequest ureq) {
    if (!reSecurity.isEntryAdmin()) {
        throw new OLATSecurityException("Trying to delete, but not allowed: user = " + ureq.getIdentity());
    }
    List<RepositoryEntry> entryToDelete = Collections.singletonList(getRepositoryEntry());
    confirmDeleteCtrl = new ConfirmDeleteSoftlyController(ureq, getWindowControl(), entryToDelete, false);
    listenTo(confirmDeleteCtrl);
    String title = translate("del.header", re.getDisplayname());
    cmc = new CloseableModalController(getWindowControl(), "close", confirmDeleteCtrl.getInitialComponent(), true, title);
    listenTo(cmc);
    cmc.activate();
}
Also used : CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) ConfirmDeleteSoftlyController(org.olat.repository.ui.author.ConfirmDeleteSoftlyController) OLATSecurityException(org.olat.core.logging.OLATSecurityException) RepositoryEntry(org.olat.repository.RepositoryEntry)

Aggregations

CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)789 RepositoryEntry (org.olat.repository.RepositoryEntry)52 ArrayList (java.util.ArrayList)48 Identity (org.olat.core.id.Identity)42 ReferencableEntriesSearchController (org.olat.repository.controllers.ReferencableEntriesSearchController)38 VFSContainer (org.olat.core.util.vfs.VFSContainer)24 Component (org.olat.core.gui.components.Component)20 ContactMessage (org.olat.core.util.mail.ContactMessage)20 ContactFormController (org.olat.modules.co.ContactFormController)20 File (java.io.File)17 List (java.util.List)16 UserSearchController (org.olat.admin.user.UserSearchController)16 TableEvent (org.olat.core.gui.components.table.TableEvent)16 TableMultiSelectEvent (org.olat.core.gui.components.table.TableMultiSelectEvent)16 ContactList (org.olat.core.util.mail.ContactList)16 MailTemplate (org.olat.core.util.mail.MailTemplate)14 OLATResourceable (org.olat.core.id.OLATResourceable)12 MailNotificationEditController (org.olat.core.util.mail.MailNotificationEditController)12 OLATSecurityException (org.olat.core.logging.OLATSecurityException)10 Roles (org.olat.core.id.Roles)8