diff --git a/src/main/java/org/olat/core/commons/modules/bc/FolderRunController.java b/src/main/java/org/olat/core/commons/modules/bc/FolderRunController.java index 4e85906b3dd4684180494fe98ad87259788e50e8..d404a015f0b3ad56679bd8a27ddefcdeffb25d26 100644 --- a/src/main/java/org/olat/core/commons/modules/bc/FolderRunController.java +++ b/src/main/java/org/olat/core/commons/modules/bc/FolderRunController.java @@ -297,6 +297,7 @@ public class FolderRunController extends BasicController implements Activateable } } + @Override public void event(UserRequest ureq, Controller source, Event event) { if (source == folderCommandController) { if (event == FolderCommand.FOLDERCOMMAND_FINISHED) { @@ -395,6 +396,7 @@ public class FolderRunController extends BasicController implements Activateable * null; .UserRequest, org.olat.core.gui.components.Component, * org.olat.core.gui.control.Event) */ + @Override public void event(UserRequest ureq, Component source, Event event) { if (source == folderComponent || source == folderContainer || source == editQuotaButton) { // we catch events from both folderComponent and folderContainer @@ -497,12 +499,12 @@ public class FolderRunController extends BasicController implements Activateable * * @see org.olat.core.gui.control.DefaultController#doDispose(boolean) */ + @Override protected void doDispose() { - //folderCommandController is registerd with listenTo and gets disposed in BasicController + // } @Override - //fxdiff BAKS-7 Resume function public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) { if(entries == null || entries.isEmpty()) return; diff --git a/src/main/java/org/olat/core/commons/modules/bc/components/CrumbRenderer.java b/src/main/java/org/olat/core/commons/modules/bc/components/CrumbRenderer.java index 59b442dd81e4b21c5b6d7942b4f1a425bc8b1eac..f8f8d5a57bc173e9b34b185c1dfb70d4a283973a 100644 --- a/src/main/java/org/olat/core/commons/modules/bc/components/CrumbRenderer.java +++ b/src/main/java/org/olat/core/commons/modules/bc/components/CrumbRenderer.java @@ -58,7 +58,7 @@ public class CrumbRenderer { // append toplevel node sb.append("<ol class='breadcrumb'><li><a "); - ubu.buildHrefAndOnclick(sb, null, iframePostEnabled, false, false) + ubu.buildHrefAndOnclick(sb, null, iframePostEnabled, false, true) .append(">").append(StringHelper.escapeHtml(fc.getRootContainer().getName())).append("</a></li>"); String path = fc.getCurrentContainerPath(); @@ -71,7 +71,7 @@ public class CrumbRenderer { pathLink.append(ubu.encodeUrl(token)); if (st.hasMoreElements()) { sb.append("<li><a "); - ubu.buildHrefAndOnclick(sb, pathLink.toString(), iframePostEnabled, false, false) + ubu.buildHrefAndOnclick(sb, pathLink.toString(), iframePostEnabled, false, true) .append(">").append(StringHelper.escapeHtml(token)).append("</a></li>"); } else { sb.append("<li class='active'>").append(StringHelper.escapeHtml(token)).append("</li>"); diff --git a/src/main/java/org/olat/core/commons/modules/bc/components/ListRenderer.java b/src/main/java/org/olat/core/commons/modules/bc/components/ListRenderer.java index bce65a7103ca9675e774ee1b829c5829ee2f7ca2..7c08e812ccf96a2a33c826d2d53c652693dcf239 100644 --- a/src/main/java/org/olat/core/commons/modules/bc/components/ListRenderer.java +++ b/src/main/java/org/olat/core/commons/modules/bc/components/ListRenderer.java @@ -232,7 +232,7 @@ public class ListRenderer { sb.append("<a id='o_sel_doc_").append(pos).append("'"); if (isContainer) { // for directories... normal module URIs - ubu.buildHrefAndOnclick(sb, pathAndName, iframePostEnabled, false, false); + ubu.buildHrefAndOnclick(sb, pathAndName, iframePostEnabled, false, true); } else { // for files, add PARAM_SERV command sb.append(" href=\""); ubu.buildURI(sb, new String[] { PARAM_SERV }, new String[] { "x" }, pathAndName, AJAXFlags.MODE_NORMAL); diff --git a/src/main/java/org/olat/core/commons/modules/glossary/GlossaryRuntimeController.java b/src/main/java/org/olat/core/commons/modules/glossary/GlossaryRuntimeController.java index 31ba122169d17f554217a5861e81c296787503c9..e90d9c7e9247aecc3bab73bcb658c03b7b5796ef 100644 --- a/src/main/java/org/olat/core/commons/modules/glossary/GlossaryRuntimeController.java +++ b/src/main/java/org/olat/core/commons/modules/glossary/GlossaryRuntimeController.java @@ -19,6 +19,8 @@ */ package org.olat.core.commons.modules.glossary; +import java.util.List; + import org.olat.core.gui.UserRequest; import org.olat.core.gui.components.Component; import org.olat.core.gui.components.dropdown.Dropdown; @@ -26,6 +28,8 @@ import org.olat.core.gui.components.link.Link; import org.olat.core.gui.components.link.LinkFactory; import org.olat.core.gui.control.Event; import org.olat.core.gui.control.WindowControl; +import org.olat.core.id.context.ContextEntry; +import org.olat.core.id.context.StateEntry; import org.olat.modules.glossary.GlossaryEditSettingsController; import org.olat.modules.glossary.GlossaryRegisterSettingsController; import org.olat.repository.RepositoryEntry; @@ -60,6 +64,24 @@ public class GlossaryRuntimeController extends RepositoryEntryRuntimeController settingsDropdown.addComponent(permissionLink); } } + + @Override + public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) { + entries = removeRepositoryEntry(entries); + if(entries != null && entries.size() > 0) { + String type = entries.get(0).getOLATResourceable().getResourceableTypeName(); + if("GlossarySettings".equalsIgnoreCase(type)) { + if (reSecurity.isEntryAdmin()) { + doRegister(ureq); + } + } else if("GlossaryPermissions".equalsIgnoreCase(type)) { + if (reSecurity.isEntryAdmin()) { + doPermission(ureq); + } + } + } + super.activate(ureq, entries, state); + } @Override protected void event(UserRequest ureq, Component source, Event event) { @@ -74,16 +96,18 @@ public class GlossaryRuntimeController extends RepositoryEntryRuntimeController private void doRegister(UserRequest ureq) { RepositoryEntry glossary = getRepositoryEntry(); + WindowControl bwControl = getSubWindowControl("GlossarySettings"); GlossaryRegisterSettingsController glossRegisterSetCtr - = new GlossaryRegisterSettingsController(ureq, getWindowControl(), glossary.getOlatResource()); + = new GlossaryRegisterSettingsController(ureq, addToHistory(ureq, bwControl), glossary.getOlatResource()); pushController(ureq, translate("tab.glossary.register"), glossRegisterSetCtr); setActiveTool(registerLink); } private void doPermission(UserRequest ureq) { RepositoryEntry glossary = getRepositoryEntry(); + WindowControl bwControl = getSubWindowControl("GlossaryPermissions"); GlossaryEditSettingsController glossEditCtr - = new GlossaryEditSettingsController(ureq, getWindowControl(), glossary.getOlatResource()); + = new GlossaryEditSettingsController(ureq, addToHistory(ureq, bwControl), glossary.getOlatResource()); pushController(ureq, translate("tab.glossary.edit"), glossEditCtr); setActiveTool(permissionLink); } diff --git a/src/main/java/org/olat/core/gui/components/Window.java b/src/main/java/org/olat/core/gui/components/Window.java index b457e31823eae447cb99b04dd772aa3a440dbd22..e2612110cfd0a4be07118074aaa35eec241111bd 100644 --- a/src/main/java/org/olat/core/gui/components/Window.java +++ b/src/main/java/org/olat/core/gui/components/Window.java @@ -542,7 +542,7 @@ public class Window extends AbstractComponent { String newWinUri = buildRenderOnlyURIFor(errWindow); Command rmrcom = CommandFactory.createParentRedirectTo(newWinUri); wbackofficeImpl.sendCommandTo(rmrcom); - MediaResource jsonmr = wbackofficeImpl.extractCommands(true); + MediaResource jsonmr = wbackofficeImpl.extractCommands(request); ServletUtil.serveResource(request, response, jsonmr); } catch (Throwable anotherTh) { log.error("Exception while handling exception!!!!", anotherTh); diff --git a/src/main/java/org/olat/core/gui/components/form/flexible/impl/elements/FormButtonRenderer.java b/src/main/java/org/olat/core/gui/components/form/flexible/impl/elements/FormButtonRenderer.java index cc43fa6793922779e90d0e7ac16e9e5b242359ce..1783ef6f75e4691c535f248dbe4539f43467aae2 100644 --- a/src/main/java/org/olat/core/gui/components/form/flexible/impl/elements/FormButtonRenderer.java +++ b/src/main/java/org/olat/core/gui/components/form/flexible/impl/elements/FormButtonRenderer.java @@ -25,46 +25,37 @@ */ package org.olat.core.gui.components.form.flexible.impl.elements; -import org.apache.commons.lang.StringEscapeUtils; import org.olat.core.gui.components.Component; -import org.olat.core.gui.components.ComponentRenderer; +import org.olat.core.gui.components.DefaultComponentRenderer; import org.olat.core.gui.components.form.flexible.impl.FormJSHelper; import org.olat.core.gui.render.RenderResult; import org.olat.core.gui.render.Renderer; -import org.olat.core.gui.render.RenderingState; import org.olat.core.gui.render.StringOutput; import org.olat.core.gui.render.URLBuilder; import org.olat.core.gui.translator.Translator; import org.olat.core.util.StringHelper; /** - * Description:<br> - * TODO: patrickb Class Description for FormSubmitRenderer * <P> * Initial Date: 08.12.2006 <br> * * @author patrickb */ -class FormButtonRenderer implements ComponentRenderer { +class FormButtonRenderer extends DefaultComponentRenderer { + @Override public void render(Renderer renderer, StringOutput sb, Component source, URLBuilder ubu, Translator translator, RenderResult renderResult, String[] args) { - // + FormButtonComponent fsC = (FormButtonComponent) source; FormButton fs = fsC.getFormButton(); - fs.getRootForm().getDispatchFieldId(); - // String id = fsC.getFormDispatchId(); //may be no id needed.. problems if the same submit button is //rendered twice, e.g. usability - sb.append("<button type=\"button\" id=\""); - sb.append(id); + sb.append("<button type=\"button\" id=\"").append(id) //name must stay id, this is used to fetch all submit buttons by name - sb.append("\" name=\""); - sb.append(id); - sb.append("\" value=\""); - sb.append(StringEscapeUtils.escapeHtml(fs.getTranslated())); - sb.append("\" "); + .append("\" name=\"").append(id) + .append("\" value=\"").append(StringHelper.escapeHtml(fs.getTranslated())).append("\" "); if(!source.isEnabled()){ sb.append(" disabled=\"disabled\" "); } @@ -76,15 +67,14 @@ class FormButtonRenderer implements ComponentRenderer { sb.append(" btn-default"); } if(!source.isEnabled()){ - sb.append(" o_disabled "); + sb.append(" o_disabled"); } if(StringHelper.containsNonWhitespace(fs.getElementCssClass())) { sb.append(" ").append(fs.getElementCssClass()); } - sb.append("\"><span>"); - sb.append(fs.getTranslated()); - sb.append("</span></button>"); + sb.append("\"><span>").append(fs.getTranslated()).append("</span></button>"); + if(source.isEnabled() && fsC.getIsSubmitAndValidate()){ //it is a submitting and validating button (e.g. FormSubmit) sb.append("<script type=\"text/javascript\">\n /* <![CDATA[ */ \n"); @@ -97,13 +87,4 @@ class FormButtonRenderer implements ComponentRenderer { sb.append("\n/* ]]> */ \n</script>"); } } - - public void renderBodyOnLoadJSFunctionCall(Renderer renderer, StringOutput sb, Component source, RenderingState rstate) { - // - } - - public void renderHeaderIncludes(Renderer renderer, StringOutput sb, Component source, URLBuilder ubu, Translator translator, - RenderingState rstate) { - // - } } \ No newline at end of file diff --git a/src/main/java/org/olat/core/gui/control/winmgr/AjaxController.java b/src/main/java/org/olat/core/gui/control/winmgr/AjaxController.java index 0b7f67f1d3123bc5fff98d097994feb92e7a1144..5f2d72b9e2bd3e54f6dedd135adbd1637a5682e1 100644 --- a/src/main/java/org/olat/core/gui/control/winmgr/AjaxController.java +++ b/src/main/java/org/olat/core/gui/control/winmgr/AjaxController.java @@ -131,12 +131,12 @@ public class AjaxController extends DefaultController { statsManager.incrementAuthenticatedPollerClick(); String uriPrefix = DispatcherModule.getLegacyUriPrefix(request); - UserRequest ureq = new UserRequestImpl(uriPrefix, request, null); + UserRequest uureq = new UserRequestImpl(uriPrefix, request, null); boolean reload = false; - Windows ws = Windows.getWindows(ureq); + Windows ws = Windows.getWindows(uureq); if(ws != null && wboImpl.getChiefController() != null) { ChiefController cc = wboImpl.getChiefController(); - reload = cc.wishAsyncReload(ureq, false); + reload = cc.wishAsyncReload(uureq, false); } MediaResource resource; @@ -151,7 +151,7 @@ public class AjaxController extends DefaultController { synchronized (windowcommands) { //o_clusterOK by:fj windowcommands.add(new WindowCommand(wboImpl, updateDirtyCom)); if(reload) { - String timestampID = ureq.getTimestampID(); + String timestampID = uureq.getTimestampID(); String reRenderUri = window.buildURIFor(window, timestampID, null); Command rmrcom = CommandFactory.createParentRedirectTo(reRenderUri); windowcommands.add(new WindowCommand(wboImpl, rmrcom)); @@ -162,7 +162,7 @@ public class AjaxController extends DefaultController { resource = new NothingChangedMediaResource(); } } catch (CannotReplaceDOMFragmentException e) { - String timestampID = ureq.getTimestampID(); + String timestampID = uureq.getTimestampID(); String reRenderUri = window.buildURIFor(window, timestampID, null); Command rmrcom = CommandFactory.createParentRedirectTo(reRenderUri); windowcommands.add(new WindowCommand(wboImpl, rmrcom)); diff --git a/src/main/java/org/olat/core/gui/control/winmgr/WindowBackOfficeImpl.java b/src/main/java/org/olat/core/gui/control/winmgr/WindowBackOfficeImpl.java index bce9e37ee11d0ead3cc98450944de106e93cbb1d..6a3a79b0eab77074bf0817fb5731243c8e1d3ead 100644 --- a/src/main/java/org/olat/core/gui/control/winmgr/WindowBackOfficeImpl.java +++ b/src/main/java/org/olat/core/gui/control/winmgr/WindowBackOfficeImpl.java @@ -28,14 +28,12 @@ package org.olat.core.gui.control.winmgr; import java.io.IOException; import java.io.Writer; import java.util.ArrayList; -import java.util.Enumeration; import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.apache.commons.io.IOUtils; import org.olat.core.gui.GlobalSettings; import org.olat.core.gui.UserRequest; import org.olat.core.gui.WindowManager; @@ -184,32 +182,23 @@ public class WindowBackOfficeImpl implements WindowBackOffice { } public void pushCommands(UserRequest ureq, HttpServletRequest request, HttpServletResponse response) { - Writer w = null; + try { - boolean acceptJson = false; - for(Enumeration<String> headers=request.getHeaders("Accept"); headers.hasMoreElements(); ) { - String accept = headers.nextElement(); - if(accept.contains("application/json")) { - acceptJson = true; - } - } - + boolean acceptJson = ServletUtil.acceptJson(request); //first set the headers with the content-type //and after get the writer with the encoding //fixed by the content-type if(acceptJson) { ServletUtil.setJSONResourceHeaders(response); - w = response.getWriter(); + Writer w = response.getWriter(); ajaxC.pushJSONAndClear(ureq, w); } else { ServletUtil.setStringResourceHeaders(response); - w = response.getWriter(); + Writer w = response.getWriter(); ajaxC.pushResource(ureq, w, true); } } catch (IOException e) { log.error("Error pushing commans to the AJAX canal.", e); - } finally { - IOUtils.closeQuietly(w); } } @@ -217,8 +206,9 @@ public class WindowBackOfficeImpl implements WindowBackOffice { * @param wrapHTML * @return */ - public MediaResource extractCommands(boolean wrapHTML) { - return ajaxC.extractMediaResource(wrapHTML); + public MediaResource extractCommands(HttpServletRequest request) { + boolean acceptJson = ServletUtil.acceptJson(request); + return ajaxC.extractMediaResource(!acceptJson); } /** diff --git a/src/main/java/org/olat/dispatcher/RESTDispatcher.java b/src/main/java/org/olat/dispatcher/RESTDispatcher.java index 3035a602ca6ca4838843ff92a799770a4c4e17b9..61d40055cabb50e882838469783ae5a54ed9297e 100644 --- a/src/main/java/org/olat/dispatcher/RESTDispatcher.java +++ b/src/main/java/org/olat/dispatcher/RESTDispatcher.java @@ -210,18 +210,17 @@ public class RESTDispatcher implements Dispatcher { boolean auth = usess.isAuthenticated(); if (auth) { - //fxdiff FXOLAT-113: business path in DMZ - setBusinessPathInUserSession(usess, businessPath, ureq.getParameter(WINDOW_SETTINGS)); - - //fxdiff if (Windows.getWindows(usess).getChiefController() == null) { // Session is already available, but no main window (Head-less REST // session). Only create the base chief controller and the window + setBusinessPathInUserSession(usess, businessPath, ureq.getParameter(WINDOW_SETTINGS)); + AuthHelper.createAuthHome(ureq); String url = getRedirectToURL(usess) + ";jsessionid=" + usess.getSessionInfo().getSession().getId(); DispatcherModule.redirectTo(response, url); } else { - String url = getRedirectToURL(usess); + //redirect to the authenticated dispatcher which support REST url + String url = WebappHelper.getServletContextPath() + DispatcherModule.PATH_AUTHENTICATED + restPart; DispatcherModule.redirectTo(response, url); } } else { diff --git a/src/main/java/org/olat/ims/cp/ui/CPRuntimeController.java b/src/main/java/org/olat/ims/cp/ui/CPRuntimeController.java index effc7a1ac0f9586e2bec3615b9ff47e968f89cda..cdff441839b3b47582afd45a15131a178a6af04f 100644 --- a/src/main/java/org/olat/ims/cp/ui/CPRuntimeController.java +++ b/src/main/java/org/olat/ims/cp/ui/CPRuntimeController.java @@ -19,6 +19,8 @@ */ package org.olat.ims.cp.ui; +import java.util.List; + import org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl; import org.olat.core.gui.UserRequest; import org.olat.core.gui.components.Component; @@ -33,6 +35,8 @@ import org.olat.core.gui.control.Event; import org.olat.core.gui.control.WindowControl; import org.olat.core.gui.control.generic.iframe.DeliveryOptions; import org.olat.core.gui.control.generic.iframe.DeliveryOptionsConfigurationController; +import org.olat.core.id.context.ContextEntry; +import org.olat.core.id.context.StateEntry; import org.olat.core.util.vfs.QuotaManager; import org.olat.fileresource.FileResourceManager; import org.olat.ims.cp.CPManager; @@ -82,6 +86,22 @@ public class CPRuntimeController extends RepositoryEntryRuntimeController { } } + @Override + public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) { + entries = removeRepositoryEntry(entries); + if(entries != null && entries.size() > 0) { + String type = entries.get(0).getOLATResourceable().getResourceableTypeName(); + if("Quota".equalsIgnoreCase(type)) { + doQuota(ureq); + } else if("Layout".equalsIgnoreCase(type)) { + if (reSecurity.isEntryAdmin()) { + doLayout(ureq); + } + } + } + super.activate(ureq, entries, state); + } + @Override protected void event(UserRequest ureq, Component source, Event event) { if(quotaLink == source) { @@ -108,7 +128,8 @@ public class CPRuntimeController extends RepositoryEntryRuntimeController { RepositoryEntry entry = getRepositoryEntry(); OLATResource resource = entry.getOlatResource(); OlatRootFolderImpl cpRoot = FileResourceManager.getInstance().unzipContainerResource(resource); - Controller quotaCtrl = quotaManager.getQuotaEditorInstance(ureq, getWindowControl(), cpRoot.getRelPath(), false); + WindowControl bwControl = getSubWindowControl("Quota"); + Controller quotaCtrl = quotaManager.getQuotaEditorInstance(ureq, addToHistory(ureq, bwControl), cpRoot.getRelPath(), false); pushController(ureq, translate("tab.quota.edit"), quotaCtrl); setActiveTool(quotaLink); } @@ -119,8 +140,9 @@ public class CPRuntimeController extends RepositoryEntryRuntimeController { final OLATResource resource = entry.getOlatResource(); CPPackageConfig cpConfig = cpManager.getCPPackageConfig(resource); DeliveryOptions config = cpConfig == null ? null : cpConfig.getDeliveryOptions(); - final DeliveryOptionsConfigurationController deliveryOptionsCtrl = new DeliveryOptionsConfigurationController(ureq, getWindowControl(), config); - + WindowControl bwControl = getSubWindowControl("Layout"); + final DeliveryOptionsConfigurationController deliveryOptionsCtrl + = new DeliveryOptionsConfigurationController(ureq, addToHistory(ureq, bwControl), config); deliveryOptionsCtrl.addControllerListener(new ControllerEventListener() { @Override diff --git a/src/main/java/org/olat/modules/cp/CPDisplayController.java b/src/main/java/org/olat/modules/cp/CPDisplayController.java index f3831b9d52f3e770a02106e27d65279c8093da84..0b37c0f7322b0455ca7345e0ebb06757eb0110b9 100644 --- a/src/main/java/org/olat/modules/cp/CPDisplayController.java +++ b/src/main/java/org/olat/modules/cp/CPDisplayController.java @@ -283,6 +283,7 @@ public class CPDisplayController extends BasicController implements Activateable * org.olat.core.gui.components.Component, * org.olat.core.gui.control.Event) */ + @Override public void event(UserRequest ureq, Component source, Event event) { if (source == cpTree) { // FIXME:fj: cleanup between MenuTree.COMMAND_TREENODE_CLICKED and @@ -316,35 +317,35 @@ public class CPDisplayController extends BasicController implements Activateable } } - @Override + @Override protected void event(UserRequest ureq, Controller source, Event event) { - if (source == cpContentCtr) { // a .html click within the contentpackage - if (event instanceof NewInlineUriEvent) { - NewInlineUriEvent nue = (NewInlineUriEvent) event; - // adjust the tree selection to the current choice if found - selectTreeNode(ureq, nue.getNewUri()); - } else if (event instanceof NewIframeUriEvent) { - NewIframeUriEvent nue = (NewIframeUriEvent) event; - selectTreeNode(ureq, nue.getNewUri()); - }// else ignore (e.g. misplaced olatcmd event (inner olat link found in a - // contentpackaging file) - } else if (source == printPopup) { - removeAsListenerAndDispose(printPopup); - removeAsListenerAndDispose(printController); - printController = null; - printPopup = null; - } else if (source == printController) { - if(Event.DONE_EVENT == event) { - List<String> nodeToPrint = printController.getSelectedNodeIdentifiers(); - printPages(nodeToPrint); - } - - printPopup.deactivate(); - removeAsListenerAndDispose(printPopup); - removeAsListenerAndDispose(printController); - printController = null; - printPopup = null; + if (source == cpContentCtr) { // a .html click within the contentpackage + if (event instanceof NewInlineUriEvent) { + NewInlineUriEvent nue = (NewInlineUriEvent) event; + // adjust the tree selection to the current choice if found + selectTreeNode(ureq, nue.getNewUri()); + } else if (event instanceof NewIframeUriEvent) { + NewIframeUriEvent nue = (NewIframeUriEvent) event; + selectTreeNode(ureq, nue.getNewUri()); + }// else ignore (e.g. misplaced olatcmd event (inner olat link found in a + // contentpackaging file) + } else if (source == printPopup) { + removeAsListenerAndDispose(printPopup); + removeAsListenerAndDispose(printController); + printController = null; + printPopup = null; + } else if (source == printController) { + if(Event.DONE_EVENT == event) { + List<String> nodeToPrint = printController.getSelectedNodeIdentifiers(); + printPages(nodeToPrint); } + + printPopup.deactivate(); + removeAsListenerAndDispose(printPopup); + removeAsListenerAndDispose(printController); + printController = null; + printPopup = null; + } } @Override @@ -485,6 +486,7 @@ public class CPDisplayController extends BasicController implements Activateable * * @see org.olat.core.gui.control.DefaultController#doDispose(boolean) */ + @Override protected void doDispose() { ThreadLocalUserActivityLogger.log(LearningResourceLoggingAction.LEARNING_RESOURCE_CLOSE, getClass()); cpTree = null; @@ -502,15 +504,6 @@ public class CPDisplayController extends BasicController implements Activateable return ctm; } - /** - * @param ureq - * @param te - * @deprecated @TODO To be deleted - does logging and would have to go via an event() method - */ - public void externalNodeClicked(UserRequest ureq, TreeEvent te) { - switchToPage(ureq, te); - } - /** * to use with the option "external menu" only * diff --git a/src/main/java/org/olat/modules/scorm/ScormAPIandDisplayController.java b/src/main/java/org/olat/modules/scorm/ScormAPIandDisplayController.java index 1a9808b77172e281e9c57d8871d51d516ae4aebf..f8bbcf2257d60d37f25320953d71b2119587cae6 100644 --- a/src/main/java/org/olat/modules/scorm/ScormAPIandDisplayController.java +++ b/src/main/java/org/olat/modules/scorm/ScormAPIandDisplayController.java @@ -416,14 +416,6 @@ public class ScormAPIandDisplayController extends MainLayoutBasicController impl public ScormCPManifestTreeModel getTreeModel() { return treeModel; } - - /** - * @param te - * @deprecated @TODO To be deleted - does logging and would have to go via an event() method - */ - public void externalNodeClicked(TreeEvent te) { - switchToPage(te); - } private void updateNextPreviousButtons(String nextScoId) { Integer nextInt = scormAdapter.getNextSco(nextScoId); diff --git a/src/main/java/org/olat/modules/scorm/ScormRuntimeController.java b/src/main/java/org/olat/modules/scorm/ScormRuntimeController.java index 96c7877424fc8765a09971848c1af423b615a5b5..9f5a6f1ad8a5a8f0943e09ff81ba6e88eda67288 100644 --- a/src/main/java/org/olat/modules/scorm/ScormRuntimeController.java +++ b/src/main/java/org/olat/modules/scorm/ScormRuntimeController.java @@ -19,6 +19,8 @@ */ package org.olat.modules.scorm; +import java.util.List; + import org.olat.core.gui.UserRequest; import org.olat.core.gui.components.Component; import org.olat.core.gui.components.dropdown.Dropdown; @@ -31,6 +33,8 @@ import org.olat.core.gui.control.Event; import org.olat.core.gui.control.WindowControl; import org.olat.core.gui.control.generic.iframe.DeliveryOptions; import org.olat.core.gui.control.generic.iframe.DeliveryOptionsConfigurationController; +import org.olat.core.id.context.ContextEntry; +import org.olat.core.id.context.StateEntry; import org.olat.repository.RepositoryEntry; import org.olat.repository.model.RepositoryEntrySecurity; import org.olat.repository.ui.RepositoryEntryRuntimeController; @@ -65,6 +69,20 @@ public class ScormRuntimeController extends RepositoryEntryRuntimeController { } } + @Override + public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) { + entries = removeRepositoryEntry(entries); + if(entries != null && entries.size() > 0) { + String type = entries.get(0).getOLATResourceable().getResourceableTypeName(); + if("Layout".equalsIgnoreCase(type)) { + if (reSecurity.isEntryAdmin()) { + doLayout(ureq); + } + } + } + super.activate(ureq, entries, state); + } + @Override protected void event(UserRequest ureq, Component source, Event event) { if(deliveryOptionsLink == source) { @@ -79,7 +97,9 @@ public class ScormRuntimeController extends RepositoryEntryRuntimeController { ScormPackageConfig scormConfig = ScormMainManager.getInstance().getScormPackageConfig(entry.getOlatResource()); DeliveryOptions config = scormConfig == null ? null : scormConfig.getDeliveryOptions(); final OLATResource resource = entry.getOlatResource(); - final DeliveryOptionsConfigurationController deliveryOptionsCtrl = new DeliveryOptionsConfigurationController(ureq, getWindowControl(), config); + WindowControl bwControl = getSubWindowControl("Layout"); + final DeliveryOptionsConfigurationController deliveryOptionsCtrl + = new DeliveryOptionsConfigurationController(ureq, addToHistory(ureq, bwControl), config); deliveryOptionsCtrl.addControllerListener(new ControllerEventListener() { @Override diff --git a/src/main/java/org/olat/modules/webFeed/ui/FeedRuntimeController.java b/src/main/java/org/olat/modules/webFeed/ui/FeedRuntimeController.java index 6d1c87fa8fcc01e86375b47649024c89e9b36d83..c0a85a738a9d7583497c142a0f398fc90434a5a7 100644 --- a/src/main/java/org/olat/modules/webFeed/ui/FeedRuntimeController.java +++ b/src/main/java/org/olat/modules/webFeed/ui/FeedRuntimeController.java @@ -19,6 +19,8 @@ */ package org.olat.modules.webFeed.ui; +import java.util.List; + import org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl; import org.olat.core.gui.UserRequest; import org.olat.core.gui.components.Component; @@ -29,6 +31,8 @@ import org.olat.core.gui.components.link.LinkFactory; import org.olat.core.gui.control.Controller; import org.olat.core.gui.control.Event; import org.olat.core.gui.control.WindowControl; +import org.olat.core.id.context.ContextEntry; +import org.olat.core.id.context.StateEntry; import org.olat.core.util.vfs.QuotaManager; import org.olat.fileresource.FileResourceManager; import org.olat.repository.RepositoryEntry; @@ -69,6 +73,18 @@ public class FeedRuntimeController extends RepositoryEntryRuntimeController { } } + @Override + public void activate(UserRequest ureq, List<ContextEntry> entries, StateEntry state) { + entries = removeRepositoryEntry(entries); + if(entries != null && entries.size() > 0) { + String type = entries.get(0).getOLATResourceable().getResourceableTypeName(); + if("Quota".equalsIgnoreCase(type)) { + doQuota(ureq); + } + } + super.activate(ureq, entries, state); + } + @Override protected void event(UserRequest ureq, Component source, Event event) { if(quotaLink == source) { @@ -82,7 +98,8 @@ public class FeedRuntimeController extends RepositoryEntryRuntimeController { if (quotaManager.hasQuotaEditRights(ureq.getIdentity())) { RepositoryEntry entry = getRepositoryEntry(); OlatRootFolderImpl feedRoot = FileResourceManager.getInstance().getFileResourceRootImpl(entry.getOlatResource()); - Controller quotaCtrl = quotaManager.getQuotaEditorInstance(ureq, getWindowControl(), feedRoot.getRelPath(), false); + WindowControl bwControl = getSubWindowControl("Quota"); + Controller quotaCtrl = quotaManager.getQuotaEditorInstance(ureq, addToHistory(ureq, bwControl), feedRoot.getRelPath(), false); pushController(ureq, translate("tab.quota.edit"), quotaCtrl); setActiveTool(quotaLink); } diff --git a/src/main/java/org/olat/repository/ui/RepositoryEntryRuntimeController.java b/src/main/java/org/olat/repository/ui/RepositoryEntryRuntimeController.java index 2710c9c4c9947ead65f5439481a41c6eb7f3ef8c..78d11922de34ad8b982eb546b64dec4a8c06d3bb 100644 --- a/src/main/java/org/olat/repository/ui/RepositoryEntryRuntimeController.java +++ b/src/main/java/org/olat/repository/ui/RepositoryEntryRuntimeController.java @@ -648,7 +648,8 @@ public class RepositoryEntryRuntimeController extends MainLayoutBasicController protected void doEdit(UserRequest ureq) { if(!reSecurity.isEntryAdmin()) return; - Controller ctrl = handler.createEditorController(re, ureq, getWindowControl(), toolbarPanel); + WindowControl bwControl = getSubWindowControl("Editor"); + Controller ctrl = handler.createEditorController(re, ureq, addToHistory(ureq, bwControl), toolbarPanel); if(ctrl != null) { listenTo(ctrl); editorCtrl = pushController(ureq, translate("resource.editor"), ctrl);