private void doEdit(UserRequest ureq, Solution solution) { if (solution.getFilename().endsWith(".html")) { doEditSolutionEditor(ureq, solution); } else { doReplace(ureq, solution); } }
private void doCreateSolutionEditor(UserRequest ureq, Solution solution) { String documentName = solution.getFilename(); VFSItem item = solutionContainer.resolve(documentName); if (item == null) { solutionContainer.createChildLeaf(documentName); } else { documentName = VFSManager.rename(solutionContainer, documentName); solutionContainer.createChildLeaf(documentName); } newSolutionEditorCtrl = WysiwygFactory.createWysiwygController( ureq, getWindowControl(), solutionContainer, documentName, "media", true, true); newSolutionEditorCtrl.getRichTextConfiguration().disableMedia(); newSolutionEditorCtrl.getRichTextConfiguration().setAllowCustomMediaFactory(false); newSolutionEditorCtrl.setNewFile(true); newSolutionEditorCtrl.setUserObject(solution); listenTo(newSolutionEditorCtrl); cmc = new CloseableModalController( getWindowControl(), "close", newSolutionEditorCtrl.getInitialComponent()); listenTo(cmc); cmc.activate(); }
private void doEditSolutionEditor(UserRequest ureq, Solution solution) { String documentName = solution.getFilename(); editSolutionEditorCtrl = WysiwygFactory.createWysiwygController( ureq, getWindowControl(), solutionContainer, documentName, "media", true, true); editSolutionEditorCtrl.getRichTextConfiguration().disableMedia(); editSolutionEditorCtrl.getRichTextConfiguration().setAllowCustomMediaFactory(false); listenTo(editSolutionEditorCtrl); cmc = new CloseableModalController( getWindowControl(), "close", editSolutionEditorCtrl.getInitialComponent()); listenTo(cmc); cmc.activate(); }
private void updateModel() { List<Solution> solutionList = solutions.getSolutions(); List<SolutionRow> rows = new ArrayList<>(solutionList.size()); for (Solution solution : solutionList) { String filename = solution.getFilename(); String author = null; VFSItem item = solutionContainer.resolve(filename); if (item instanceof MetaTagged) { MetaInfo metaInfo = ((MetaTagged) item).getMetaInfo(); if (metaInfo != null && metaInfo.getAuthorIdentityKey() != null) { author = userManager.getUserDisplayName(metaInfo.getAuthorIdentityKey()); } } rows.add(new SolutionRow(solution, author)); } solutionModel.setObjects(rows); solutionTable.reset(); }