use of org.olat.core.gui.control.WindowControl in project OpenOLAT by OpenOLAT.
the class DocumentPoolMainController method doSelectTaxonomyLevel.
private DocumentPoolLevelController doSelectTaxonomyLevel(UserRequest ureq, TaxonomyTreeNode node) {
if (isTaxonomyAdmin || node.isCanRead() || node.isCanWrite()) {
TaxonomyLevel level = node.getTaxonomyLevel();
SubscriptionContext subscriptionCtx = notificationsHandler.getTaxonomyDocumentsLibrarySubscriptionContext();
TaxonomyVFSSecurityCallback secCallback = new TaxonomyVFSSecurityCallback(node, subscriptionCtx);
OLATResourceable ores = OresHelper.createOLATResourceableInstance("TaxonomyLevel", node.getTaxonomyLevel().getKey());
WindowControl bwControl = addToHistory(ureq, ores, null);
DocumentPoolLevelController levelCtrl = new DocumentPoolLevelController(ureq, bwControl, level, node, secCallback);
listenTo(levelCtrl);
String displayName = level.getDisplayName();
content.popUpToRootController(ureq);
List<TreeNode> parentLines = TreeHelper.getTreePath(node);
for (int i = 1; i < parentLines.size() - 1; i++) {
TreeNode parent = parentLines.get(i);
content.pushController(parent.getTitle(), null, parent);
}
content.pushController(displayName, levelCtrl);
return levelCtrl;
}
return null;
}
use of org.olat.core.gui.control.WindowControl in project OpenOLAT by OpenOLAT.
the class QuestionListController method doOpenDetails.
private void doOpenDetails(UserRequest ureq, ItemRow row, int index, int count) {
removeAsListenerAndDispose(currentDetailsCtrl);
QuestionItem item = qpoolService.loadItemById(row.getKey());
if (item == null) {
showWarning("warning.item.deleted");
} else {
WindowControl bwControl = addToHistory(ureq, item, null);
currentDetailsCtrl = new QuestionItemDetailsController(ureq, bwControl, stackPanel, getSecurityCallback(), item, row.getSecurityCallback(), getSource(), index, count);
listenTo(currentDetailsCtrl);
stackPanel.pushController(item.getTitle(), currentDetailsCtrl);
}
}
use of org.olat.core.gui.control.WindowControl in project OpenOLAT by OpenOLAT.
the class QuestionListController method doOpenExcelImportQTI21.
private void doOpenExcelImportQTI21(UserRequest ureq) {
removeAsListenerAndDispose(excelImportWizard);
Step additionalStep = null;
if (getSource().askEditable()) {
additionalStep = new EditableStep(ureq);
}
final AssessmentItemsPackage importPackage = new AssessmentItemsPackage();
final ImportOptions options = new ImportOptions();
options.setShuffle(true);
Step start = new QImport_1_InputStep(ureq, importPackage, options, additionalStep);
StepRunnerCallback finish = new StepRunnerCallback() {
@Override
public Step execute(UserRequest uureq, WindowControl wControl, StepsRunContext runContext) {
QTI21QPoolServiceProvider spi = CoreSpringFactory.getImpl(QTI21QPoolServiceProvider.class);
List<AssessmentItemAndMetadata> items = importPackage.getItems();
List<QuestionItem> importItems = new ArrayList<>();
for (AssessmentItemAndMetadata item : items) {
QuestionItem importedItem = spi.importExcelItem(getIdentity(), item, getLocale());
if (importedItem != null) {
importItems.add(importedItem);
}
}
for (QuestionItem item : importItems) {
QuestionItemAuditLogBuilder builder = qpoolService.createAuditLogBuilder(getIdentity(), Action.CREATE_QUESTION_ITEM_BY_IMPORT);
builder.withAfter(item);
qpoolService.persist(builder.create());
}
boolean editable = true;
if (getSource().askEditable()) {
Object editableCtx = runContext.get("editable");
editable = (editableCtx instanceof Boolean) ? ((Boolean) editableCtx).booleanValue() : false;
}
qpoolService.index(importItems);
int postImported = getSource().postImport(importItems, editable);
if (postImported > 0) {
getItemsTable().reset();
}
return StepsMainRunController.DONE_MODIFIED;
}
};
excelImportWizard = new StepsMainRunController(ureq, getWindowControl(), start, finish, null, translate("import.excellike.21"), "o_sel_qpool_excel_import_wizard");
listenTo(excelImportWizard);
getWindowControl().pushAsModalDialog(excelImportWizard.getInitialComponent());
}
use of org.olat.core.gui.control.WindowControl in project OpenOLAT by OpenOLAT.
the class QuestionListController method doExport.
private void doExport(UserRequest ureq, List<QuestionItemShort> items) {
removeAsListenerAndDispose(exportWizard);
Step start = new Export_1_TypeStep(ureq, items);
StepRunnerCallback finish = new StepRunnerCallback() {
@Override
public Step execute(UserRequest uureq, WindowControl wControl, StepsRunContext runContext) {
return StepsMainRunController.DONE_MODIFIED;
}
};
exportWizard = new StepsMainRunController(ureq, getWindowControl(), start, finish, null, translate("export.item"), "o_sel_qpool_export_1_wizard");
listenTo(exportWizard);
getWindowControl().pushAsModalDialog(exportWizard.getInitialComponent());
}
use of org.olat.core.gui.control.WindowControl in project OpenOLAT by OpenOLAT.
the class CatalogNodeManagerController method selectCatalogEntry.
private CatalogNodeManagerController selectCatalogEntry(UserRequest ureq, CatalogEntry entry) {
if (entry != null && entry.getType() == CatalogEntry.TYPE_NODE) {
removeAsListenerAndDispose(childNodeCtrl);
OLATResourceable ores = OresHelper.createOLATResourceableInstance("CatalogEntry", entry.getKey());
ThreadLocalUserActivityLogger.addLoggingResourceInfo(LoggingResourceable.wrapBusinessPath(ores));
WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ores, null, rootwControl);
childNodeCtrl = new CatalogNodeManagerController(ureq, bwControl, rootwControl, entry, toolbarPanel, isLocalTreeAdmin);
listenTo(childNodeCtrl);
toolbarPanel.pushController(entry.getName(), childNodeCtrl);
childNodeCtrl.initToolbar();
addToHistory(ureq, childNodeCtrl);
}
return childNodeCtrl;
}
Aggregations