diff --git a/announcements/src/org/labkey/announcements/AnnouncementsController.java b/announcements/src/org/labkey/announcements/AnnouncementsController.java index facc173c986..661fd56952c 100644 --- a/announcements/src/org/labkey/announcements/AnnouncementsController.java +++ b/announcements/src/org/labkey/announcements/AnnouncementsController.java @@ -303,11 +303,11 @@ public void addNavTrail(NavTree root) } } - public static ActionURL getAdminEmailURL(Container c, @Nullable URLHelper returnURL) + public static ActionURL getAdminEmailURL(Container c, @Nullable URLHelper returnUrl) { ActionURL url = urlProvider(AdminUrls.class).getNotificationsURL(c); - if (returnURL != null) - url.addReturnURL(returnURL); + if (returnUrl != null) + url.addReturnUrl(returnUrl); return url; } @@ -381,7 +381,7 @@ public ModelAndView getConfirmView(AnnouncementDeleteForm form, BindException er @Override public @NotNull URLHelper getSuccessURL(AnnouncementDeleteForm form) { - return form.getReturnURLHelper(new ActionURL(BeginAction.class, getContainer())); + return form.getReturnUrlHelper(new ActionURL(BeginAction.class, getContainer())); } @Override @@ -461,7 +461,7 @@ public static ActionURL getDeleteResponseURL(Container c, String entityId, URLHe { ActionURL url = new ActionURL(DeleteResponseAction.class, c); url.addParameter("entityId", entityId); - url.addReturnURL(returnUrl); + url.addReturnUrl(returnUrl); return url; } @@ -693,7 +693,7 @@ public static ActionURL getAdminURL(Container c, @Nullable URLHelper returnUrl) { ActionURL url = new ActionURL(CustomizeAction.class, c); if (returnUrl != null) - url.addReturnURL(returnUrl); + url.addReturnUrl(returnUrl); return url; } @@ -705,7 +705,7 @@ public class CustomizeAction extends FormViewAction @Override public URLHelper getSuccessURL(Settings form) { - return form.getReturnURLHelper(); + return form.getReturnUrlHelper(); } @Override @@ -714,7 +714,7 @@ public ModelAndView getView(Settings form, boolean reshow, BindException errors) CustomizeBean bean = new CustomizeBean(); bean.settings = getSettings(); // TODO: Just use form? - bean.returnURL = form.getReturnURLHelper(); + bean.returnUrl = form.getReturnUrlHelper(); bean.assignedToSelect = getAssignedToSelect(getContainer(), bean.settings.getDefaultAssignedTo(), "defaultAssignedTo", getUser()); if (hasEditorPerm(Group.groupGuests)) @@ -751,7 +751,7 @@ public void addNavTrail(NavTree root) public static class CustomizeBean { public Settings settings; - public URLHelper returnURL; // TODO: Settings has a returnUrl + public URLHelper returnUrl; // TODO: Settings has a returnUrl public String securityWarning; public SelectBuilder assignedToSelect; } @@ -821,10 +821,10 @@ public boolean handlePost(AnnouncementForm form, BindException errors) return false; } - URLHelper returnURL = form.getReturnURLHelper(); + URLHelper returnUrl = form.getReturnUrlHelper(); // Null in insert/update message case, since we want to redirect to thread view anchoring to new post - if (null == returnURL) + if (null == returnUrl) { AnnouncementModel thread = insert; if (null != insert.getParent()) @@ -832,24 +832,24 @@ public boolean handlePost(AnnouncementForm form, BindException errors) if (form.isFromDiscussion() && null != thread.getDiscussionSrcIdentifier()) { - returnURL = DiscussionServiceImpl.fromSaved(thread.getDiscussionSrcURL()); - returnURL.addParameter("discussion.id", "" + thread.getRowId()); - returnURL.addParameter("_anchor", "discussionArea"); // TODO: insert.getRowId() instead? -- target just inserted response + returnUrl = DiscussionServiceImpl.fromSaved(thread.getDiscussionSrcURL()); + returnUrl.addParameter("discussion.id", "" + thread.getRowId()); + returnUrl.addParameter("_anchor", "discussionArea"); // TODO: insert.getRowId() instead? -- target just inserted response } else { String threadId = thread.getEntityId(); - returnURL = getThreadURL(c, threadId, insert.getRowId()); + returnUrl = getThreadURL(c, threadId, insert.getRowId()); } } - _attachmentErrorView = AttachmentService.get().getErrorView(files, errors, returnURL); + _attachmentErrorView = AttachmentService.get().getErrorView(files, errors, returnUrl); boolean success = (null == _attachmentErrorView); // Can't use getSuccessURL since this is a URLHelper, not an ActionURL if (success) - throw new RedirectException(returnURL); + throw new RedirectException(returnUrl); return false; } @@ -895,7 +895,7 @@ public ModelAndView getInsertUpdateView(AnnouncementForm form, boolean reshow, B throw new UnauthorizedException(); } - InsertMessageView insertView = new InsertMessageView(form, "New " + settings.getConversationName(), errors, reshow, form.getReturnURLHelper(), false, true); + InsertMessageView insertView = new InsertMessageView(form, "New " + settings.getConversationName(), errors, reshow, form.getReturnUrlHelper(), false, true); insertView.setShowTitle(false); getPageConfig().setFocusId("title"); @@ -956,7 +956,7 @@ public ModelAndView getInsertUpdateView(AnnouncementForm form, boolean reshow, B ThreadView threadView = new ThreadView(c, getActionURL(), parent, perm); threadView.setFrame(WebPartView.FrameType.DIV); - HttpView respondView = new RespondView(c, parent, form, form.getReturnURLHelper(), errors, reshow, false); + HttpView respondView = new RespondView(c, parent, form, form.getReturnUrlHelper(), errors, reshow, false); getPageConfig().setFocusId("body"); _parent = parent; @@ -1067,11 +1067,11 @@ else if (!user.isGuest()) } - private static ActionURL getInsertURL(Container c, @Nullable ActionURL returnURL) + private static ActionURL getInsertURL(Container c, @Nullable ActionURL returnUrl) { ActionURL url = new ActionURL(InsertAction.class, c); - if (returnURL != null) - url.addReturnURL(returnURL); + if (returnUrl != null) + url.addReturnUrl(returnUrl); return url; } @@ -1200,7 +1200,7 @@ public static ActionURL getUpdateURL(Container c, String threadId, URLHelper ret { ActionURL url = new ActionURL(UpdateAction.class, c); url.addParameter("entityId", threadId); - url.addReturnURL(returnUrl); + url.addReturnUrl(returnUrl); return url; } @@ -1288,7 +1288,7 @@ public boolean handlePost(AnnouncementForm form, BindException errors) // Needs to support non-ActionURL (e.g., an HTML page using the client API with embedded discussion webpart) // so we can't use getSuccessURL() - URLHelper urlHelper = form.getReturnURLHelper(); + URLHelper urlHelper = form.getReturnUrlHelper(); if (null != urlHelper) throw new RedirectException(urlHelper); else @@ -1496,7 +1496,7 @@ public static ActionURL getEmailPreferencesURL(Container c, @Nullable URLHelper ActionURL result = new ActionURL(EmailPreferencesAction.class, c); result.addParameter("srcIdentifier", srcIdentifier); if (returnUrl != null) - result.addReturnURL(returnUrl); + result.addReturnUrl(returnUrl); return result; } @@ -2022,13 +2022,13 @@ private static ActionURL getPageURL(ViewContext ctx) { // This is set to the outer page URL in the case of rendering a dynamic webpart; use it instead of // the getWebPart URL. - String returnURL = (String)ctx.get(ActionURL.Param.returnUrl.name()); + String returnUrl = (String)ctx.get(ActionURL.Param.returnUrl.name()); - if (null != returnURL) + if (null != returnUrl) { try { - return new ActionURL(returnURL); + return new ActionURL(returnUrl); } catch (IllegalArgumentException x) { @@ -2371,7 +2371,7 @@ protected void init(Container c, AnnouncementModel ann, URLHelper currentURL, Pe bean.message = null; bean.perm = perm; bean.isResponse = isResponse; - bean.messagesURL = getBeginURL(c); // TODO: Used as returnURL after delete thread... should be messages or list, as appropriate + bean.messagesURL = getBeginURL(c); // TODO: Used as returnUrl after delete thread... should be messages or list, as appropriate bean.listURL = getListURL(c); bean.printURL = null == currentURL ? null : currentURL.clone().replaceParameter(ActionURL.Param._print.name(), "1"); bean.print = print; @@ -2399,7 +2399,7 @@ protected void init(Container c, AnnouncementModel ann, URLHelper currentURL, Pe // Build up a link to unsubscribe from the thread ActionURL url = new ActionURL(SubscribeThreadAction.class, c); url.addParameter("threadId", ann.getParent() == null ? ann.getEntityId() : ann.getParent()); - url.addReturnURL(getViewContext().getActionURL()); + url.addReturnUrl(getViewContext().getActionURL()); url.addParameter("unsubscribe", true); buttons.addChild("unsubscribe", url).usePost(); } @@ -2438,7 +2438,7 @@ else if ((emailOption == EmailOption.MESSAGES_MINE.getValue()) subscribeTree.addChild("forum", getEmailPreferencesURL(c, getViewContext().getActionURL(), ann.lookupSrcIdentifier())); ActionURL subscribeThreadURL = new ActionURL(SubscribeThreadAction.class, c); subscribeThreadURL.addParameter("threadId", ann.getParent() == null ? ann.getEntityId() : ann.getParent()); - subscribeThreadURL.addReturnURL(getViewContext().getActionURL()); + subscribeThreadURL.addReturnUrl(getViewContext().getActionURL()); subscribeTree.addChild("thread", subscribeThreadURL).usePost(); buttons.addChild(subscribeTree); } @@ -2582,7 +2582,7 @@ public class UpdateBean public SelectBuilder statusSelect; public SelectBuilder renderAsSelect; public String memberList; - public URLHelper returnURL; + public URLHelper returnUrl; private UpdateBean(AnnouncementForm form, AnnouncementModel ann) { @@ -2595,7 +2595,7 @@ private UpdateBean(AnnouncementForm form, AnnouncementModel ann) statusSelect = getStatusSelect(ann.getStatus()); assignedToSelect = getAssignedToSelect(c, ann.getAssignedTo(), "assignedTo", getViewContext().getUser()); renderAsSelect = getRenderAsSelect(WikiRendererType.valueOf(ann.getRendererType())); - returnURL = form.getReturnURLHelper(); + returnUrl = form.getReturnUrlHelper(); } } } diff --git a/announcements/src/org/labkey/announcements/announcementThread.jsp b/announcements/src/org/labkey/announcements/announcementThread.jsp index 047ddd081b1..5ac9e302ffe 100644 --- a/announcements/src/org/labkey/announcements/announcementThread.jsp +++ b/announcements/src/org/labkey/announcements/announcementThread.jsp @@ -270,7 +270,7 @@ if (!bean.isResponse && !bean.print) else { ActionURL respond = announcementURL(c, RespondAction.class, "parentId", announcementModel.getEntityId()); - respond.addReturnURL(bean.currentURL); + respond.addReturnUrl(bean.currentURL); %> <%= button("Respond").href(respond) %> <% } @@ -282,11 +282,11 @@ if (!bean.isResponse && !bean.print) if (bean.embedded) { URLHelper redirect = bean.currentURL.clone().deleteScopeParameters("discussion"); - deleteThread.addReturnURL(redirect); + deleteThread.addReturnUrl(redirect); } else { - deleteThread.addReturnURL(bean.messagesURL); + deleteThread.addReturnUrl(bean.messagesURL); } %> <%= button("Delete " + settings.getConversationName()).href(deleteThread) %> <% diff --git a/announcements/src/org/labkey/announcements/customize.jsp b/announcements/src/org/labkey/announcements/customize.jsp index bf891d3e8ac..1a4c9f69bb4 100644 --- a/announcements/src/org/labkey/announcements/customize.jsp +++ b/announcements/src/org/labkey/announcements/customize.jsp @@ -33,7 +33,7 @@ DiscussionService.Settings settings = bean.settings; %> -<%=generateReturnUrlFormField(bean.returnURL)%> +<%=generateReturnUrlFormField(bean.returnUrl)%> @@ -168,8 +168,8 @@ diff --git a/announcements/src/org/labkey/announcements/update.jsp b/announcements/src/org/labkey/announcements/update.jsp index 1eb24d22f25..cd8f4dec526 100644 --- a/announcements/src/org/labkey/announcements/update.jsp +++ b/announcements/src/org/labkey/announcements/update.jsp @@ -59,7 +59,7 @@ -<%=generateReturnUrlFormField(bean.returnURL)%> +<%=generateReturnUrlFormField(bean.returnUrl)%>
Board name
<%= button("Save").submit(true) %> - <% if (null != bean.returnURL) { %> - <%= button("Cancel").href(bean.returnURL) %> + <% if (null != bean.returnUrl) { %> + <%= button("Cancel").href(bean.returnUrl) %> <% } %>
<% if (settings.isTitleEditable()) diff --git a/api/src/org/labkey/api/action/ReturnUrlForm.java b/api/src/org/labkey/api/action/ReturnUrlForm.java index 2ca3261e525..2201152743b 100644 --- a/api/src/org/labkey/api/action/ReturnUrlForm.java +++ b/api/src/org/labkey/api/action/ReturnUrlForm.java @@ -21,13 +21,11 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.jetbrains.annotations.Nullable; -import org.labkey.api.settings.AppProps; import org.labkey.api.util.HtmlString; import org.labkey.api.util.PageFlowUtil; import org.labkey.api.util.ReturnURLString; import org.labkey.api.util.URLHelper; import org.labkey.api.view.ActionURL; -import org.labkey.api.view.HttpView; /** * Simple form bean that includes a returnUrl property, typically used to send the user back to the page where they initiated the action. @@ -89,7 +87,7 @@ public String getUrlhash() } @Nullable - public URLHelper getReturnURLHelper() + public URLHelper getReturnUrlHelper() { return _returnUrl != null ? _returnUrl.getURLHelper() : null; } @@ -111,9 +109,9 @@ public ActionURL getReturnActionURL(ActionURL defaultURL) /** * Get the first non-null URL from returnUrl or the defaultURL parameter. */ - public URLHelper getReturnURLHelper(URLHelper defaultURL) + public URLHelper getReturnUrlHelper(URLHelper defaultURL) { - return firstOf(getReturnURLHelper(), defaultURL); + return firstOf(getReturnUrlHelper(), defaultURL); } /** @@ -192,27 +190,12 @@ public ActionURL getSuccessActionURL(ActionURL defaultURL) defaultURL); } - // when we convert code to use ReturnUrlForm we may leave behind bookmarks using "returnURL" - @Deprecated - public ReturnURLString getReturnURL() - { - throwBadParam(); - return _returnUrl; - } - - @Deprecated - public void setReturnURL(ReturnURLString returnUrl) - { - throwBadParam(); - setReturnUrl(returnUrl); - } - /** Applies the return URL from this form (if any) to the given URL */ public void propagateReturnURL(ActionURL urlNeedingParameter) { - if (getReturnURLHelper() != null) + if (getReturnUrlHelper() != null) { - urlNeedingParameter.addReturnURL(getReturnURLHelper()); + urlNeedingParameter.addReturnUrl(getReturnUrlHelper()); } } @@ -225,30 +208,4 @@ private static X firstOf(X... urls) return null; } - - /** - * Report a bad returnUrl usage. - * Some views don't show Spring binding errors from the thrown exception so - * log an ERROR message to the console and let the test framework report it. - */ - public static void throwBadParam() - { - throwBadParam("returnURL"); - } - - /** - * Report a bad returnUrl usage. - * Some views don't show Spring binding errors from the thrown exception so - * log an ERROR message to the console and let the test framework report it. - */ - public static void throwBadParam(String badParamName) - { - StringBuilder msg = new StringBuilder("Use 'returnUrl' instead of '").append(badParamName).append("'"); - if (HttpView.hasCurrentView()) - msg.append(" from URL: ").append(HttpView.currentContext().getRequest().getRequestURI()); - LOG.error(msg.toString()); - if (AppProps.getInstance().isDevMode()) - throw new UnsupportedOperationException(msg.toString()); - } - } diff --git a/api/src/org/labkey/api/action/SpringActionController.java b/api/src/org/labkey/api/action/SpringActionController.java index 7481d38affb..354355a1a13 100644 --- a/api/src/org/labkey/api/action/SpringActionController.java +++ b/api/src/org/labkey/api/action/SpringActionController.java @@ -630,7 +630,7 @@ public static ActionURL getUpgradeMaintenanceRedirect(HttpServletRequest request if (user.isSearchUser()) return null; - URLHelper returnURL = null; + URLHelper returnUrl = null; try { StringBuilder url = new StringBuilder(request.getRequestURL().toString()); @@ -639,7 +639,7 @@ public static ActionURL getUpgradeMaintenanceRedirect(HttpServletRequest request url.append("?"); url.append(request.getQueryString()); } - returnURL = new URLHelper(url.toString()); + returnUrl = new URLHelper(url.toString()); } catch (URISyntaxException e) { @@ -656,11 +656,11 @@ public static ActionURL getUpgradeMaintenanceRedirect(HttpServletRequest request uae.setType(UnauthorizedException.Type.sendBasicAuth); throw uae; } - return urlProvider(AdminUrls.class).getMaintenanceURL(returnURL); + return urlProvider(AdminUrls.class).getMaintenanceURL(returnUrl); } else if (upgradeRequired || !startupComplete) { - return urlProvider(AdminUrls.class).getModuleStatusURL(returnURL); + return urlProvider(AdminUrls.class).getModuleStatusURL(returnUrl); } } } diff --git a/api/src/org/labkey/api/admin/AdminUrls.java b/api/src/org/labkey/api/admin/AdminUrls.java index 47812f10672..76ecd83580c 100644 --- a/api/src/org/labkey/api/admin/AdminUrls.java +++ b/api/src/org/labkey/api/admin/AdminUrls.java @@ -30,10 +30,10 @@ public interface AdminUrls extends UrlProvider { ActionURL getModuleErrorsURL(); ActionURL getAdminConsoleURL(); - ActionURL getModuleStatusURL(URLHelper returnURL); + ActionURL getModuleStatusURL(URLHelper returnUrl); ActionURL getCustomizeSiteURL(); ActionURL getCustomizeSiteURL(boolean upgradeInProgress); - ActionURL getMaintenanceURL(URLHelper returnURL); + ActionURL getMaintenanceURL(URLHelper returnUrl); ActionURL getModulesDetailsURL(); ActionURL getDeleteModuleURL(String moduleName); @@ -57,10 +57,10 @@ public interface AdminUrls extends UrlProvider ActionURL getProjectSettingsFileURL(Container c); ActionURL getFolderSettingsURL(Container c); - ActionURL getCreateProjectURL(@Nullable ActionURL returnURL); - ActionURL getCreateFolderURL(Container c, @Nullable ActionURL returnURL); + ActionURL getCreateProjectURL(@Nullable ActionURL returnUrl); + ActionURL getCreateFolderURL(Container c, @Nullable ActionURL returnUrl); ActionURL getMemTrackerURL(); - ActionURL getCustomizeEmailURL(Container c, Class selectedTemplate, URLHelper returnURL); + ActionURL getCustomizeEmailURL(Container c, Class selectedTemplate, URLHelper returnUrl); ActionURL getFilesSiteSettingsURL(boolean upgrade); ActionURL getSessionLoggingURL(); ActionURL getTrackedAllocationsViewerURL(); diff --git a/api/src/org/labkey/api/assay/AssayUrls.java b/api/src/org/labkey/api/assay/AssayUrls.java index 000ec54b65a..805954917d0 100644 --- a/api/src/org/labkey/api/assay/AssayUrls.java +++ b/api/src/org/labkey/api/assay/AssayUrls.java @@ -35,7 +35,7 @@ public interface AssayUrls extends UrlProvider ActionURL getProtocolURL(Container container, ExpProtocol protocol, Class action); @Nullable - ActionURL getDesignerURL(Container container, String providerName, @Nullable ActionURL returnURL); + ActionURL getDesignerURL(Container container, String providerName, @Nullable ActionURL returnUrl); /** * Returns the URL for the assay designer diff --git a/api/src/org/labkey/api/assay/actions/UploadWizardAction.java b/api/src/org/labkey/api/assay/actions/UploadWizardAction.java index 20fec397e48..796a066545f 100644 --- a/api/src/org/labkey/api/assay/actions/UploadWizardAction.java +++ b/api/src/org/labkey/api/assay/actions/UploadWizardAction.java @@ -416,9 +416,9 @@ protected InsertView createInsertView(TableInfo baseTable, String lsidCol, List< { view.getDataRegion().addHiddenFormField("reRunId", form.getReRunId().toString()); } - if (form.getReturnURLHelper() != null) + if (form.getReturnUrlHelper() != null) { - view.getDataRegion().addHiddenFormField(ActionURL.Param.returnUrl, form.getReturnURLHelper()); + view.getDataRegion().addHiddenFormField(ActionURL.Param.returnUrl, form.getReturnUrlHelper()); } if (null != StudyPublishService.get()) @@ -492,8 +492,8 @@ private ModelAndView getBatchPropertiesView(FormType runForm, boolean errorResho bbar.setStyle(ButtonBar.Style.separateButtons); addNextButton(bbar); addResetButton(runForm, insertView, bbar); - ActionURL returnURL = runForm.getReturnActionURL(); - addCancelButton(bbar, returnURL); + ActionURL returnUrl = runForm.getReturnActionURL(); + addCancelButton(bbar, returnUrl); insertView.getDataRegion().setButtonBar(bbar, DataRegion.MODE_INSERT); JspView> assayPropsView = new JspView<>("/org/labkey/assay/view/newUploadAssayProperties.jsp", runForm); @@ -536,12 +536,12 @@ protected void addCancelButton(ButtonBar bbar) bbar.add(cancelButton); } - protected void addCancelButton(ButtonBar bbar, String returnURL) + protected void addCancelButton(ButtonBar bbar, String returnUrl) { ActionURL link; - if (returnURL != null && !returnURL.equals("")) + if (returnUrl != null && !returnUrl.isEmpty()) { - link = new ActionURL(returnURL); + link = new ActionURL(returnUrl); } else { @@ -551,12 +551,12 @@ protected void addCancelButton(ButtonBar bbar, String returnURL) bbar.add(cancelButton); } - protected void addCancelButton(ButtonBar bbar, ActionURL returnURL) + protected void addCancelButton(ButtonBar bbar, ActionURL returnUrl) { ActionURL link; - if (returnURL != null) + if (returnUrl != null) { - link = returnURL; + link = returnUrl; } else { @@ -652,8 +652,8 @@ protected ModelAndView getRunPropertiesView(FormType newRunForm, boolean errorRe ButtonBar bbar = new ButtonBar(); bbar.setStyle(ButtonBar.Style.separateButtons); addRunActionButtons(newRunForm, insertView, bbar); - ActionURL returnURL = newRunForm.getReturnActionURL(); - addCancelButton(bbar, returnURL); + ActionURL returnUrl = newRunForm.getReturnActionURL(); + addCancelButton(bbar, returnUrl); insertView.getDataRegion().setButtonBar(bbar, DataRegion.MODE_INSERT); insertView.setTitle("Run Properties"); diff --git a/api/src/org/labkey/api/assay/actions/newUploadWarnings.jsp b/api/src/org/labkey/api/assay/actions/newUploadWarnings.jsp index 26f7ca7e942..4f473ea1933 100644 --- a/api/src/org/labkey/api/assay/actions/newUploadWarnings.jsp +++ b/api/src/org/labkey/api/assay/actions/newUploadWarnings.jsp @@ -34,10 +34,10 @@ } %> <% - JspView me = (JspView) HttpView.currentView(); + JspView> me = HttpView.currentView(); AssayRunUploadForm bean = me.getModelBean(); - ActionURL returnURL = urlFor(AssayRunsAction.class).addParameter("rowId", bean.getProtocol().getRowId()) + ActionURL returnUrl = urlFor(AssayRunsAction.class).addParameter("rowId", bean.getProtocol().getRowId()) .addParameter("uploadAttemptID", bean.getUploadAttemptID()); if (bean.getTransformResult().getWarnings() != null) @@ -64,7 +64,7 @@ %>
<%= button("Proceed").onClick("submitForm(getRegionForm()); return false;") %> - <%= button("Cancel").href(returnURL).style("margin: 0 0 0 10px;") %> + <%= button("Cancel").href(returnUrl).style("margin: 0 0 0 10px;") %> <% } %> diff --git a/api/src/org/labkey/api/assay/query/BatchListQueryView.java b/api/src/org/labkey/api/assay/query/BatchListQueryView.java index 2ea1f0832ae..6a3ec6929bc 100644 --- a/api/src/org/labkey/api/assay/query/BatchListQueryView.java +++ b/api/src/org/labkey/api/assay/query/BatchListQueryView.java @@ -56,7 +56,7 @@ protected void populateButtonBar(DataView view, ButtonBar bar) { super.populateButtonBar(view, bar); - ActionURL deleteURL = PageFlowUtil.urlProvider(ExperimentUrls.class).getDeleteExperimentsURL(getContainer(), getReturnURL()); + ActionURL deleteURL = PageFlowUtil.urlProvider(ExperimentUrls.class).getDeleteExperimentsURL(getContainer(), getReturnUrl()); ActionButton deleteButton = new ActionButton(deleteURL, "Delete"); deleteButton.setIconCls("trash"); deleteButton.setURL(deleteURL); diff --git a/api/src/org/labkey/api/assay/query/ResultsQueryView.java b/api/src/org/labkey/api/assay/query/ResultsQueryView.java index 9a23afe83d7..6be14b9b7ef 100644 --- a/api/src/org/labkey/api/assay/query/ResultsQueryView.java +++ b/api/src/org/labkey/api/assay/query/ResultsQueryView.java @@ -108,18 +108,18 @@ public DataView createDataView() // Add a default sort to the end of any sorts that have already been specified (by a custom view, for example) sort.appendSortColumn(AssayService.get().getProvider(_protocol).getTableMetadata(_protocol).getResultRowIdFieldKey(), Sort.SortDirection.ASC, false); view.getDataRegion().addHiddenFormField("rowId", "" + _protocol.getRowId()); - String returnURL = getViewContext().getRequest().getParameter(ActionURL.Param.returnUrl.name()); + String returnUrl = getViewContext().getRequest().getParameter(ActionURL.Param.returnUrl.name()); - if (returnURL == null) + if (returnUrl == null) { - // 27693: Respect returnURL from async webpart requests - if (getSettings().getReturnURLHelper() != null) - returnURL = getSettings().getReturnURLHelper().toString(); + // 27693: Respect returnUrl from async webpart requests + if (getSettings().getReturnUrlHelper() != null) + returnUrl = getSettings().getReturnUrlHelper().toString(); else - returnURL = getViewContext().getActionURL().toString(); + returnUrl = getViewContext().getActionURL().toString(); } - view.getDataRegion().addHiddenFormField(ActionURL.Param.returnUrl, returnURL); + view.getDataRegion().addHiddenFormField(ActionURL.Param.returnUrl, returnUrl); String redirectUrl = getViewContext().getRequest().getParameter(ActionURL.Param.redirectUrl.name()); if (redirectUrl != null) diff --git a/api/src/org/labkey/api/assay/query/RunListQueryView.java b/api/src/org/labkey/api/assay/query/RunListQueryView.java index 4f7962205a1..b2a16c8bc0c 100644 --- a/api/src/org/labkey/api/assay/query/RunListQueryView.java +++ b/api/src/org/labkey/api/assay/query/RunListQueryView.java @@ -143,7 +143,7 @@ private void createQCStateButton(ButtonBar bar, AssayProtocolSchema schema) if (getContainer().hasPermission(getUser(), QCAnalystPermission.class)) { ActionURL updateAction = PageFlowUtil.urlProvider(AssayUrls.class).getUpdateQCStateURL(getContainer(), schema.getProtocol()) - .addReturnURL(getViewContext().getActionURL()); + .addReturnUrl(getViewContext().getActionURL()); NavTree updateItem = button.addMenuItem("Update state of selected rows", "if (verifySelected(" + DataRegion.getJavaScriptObjectReference(getDataRegionName()) + ".form, \"" + updateAction.getLocalURIString() + "\", \"post\", \"rows\")) " + DataRegion.getJavaScriptObjectReference(getDataRegionName()) + ".form.submit()"); updateItem.setId("QCState:updateSelected"); @@ -154,7 +154,7 @@ private void createQCStateButton(ButtonBar bar, AssayProtocolSchema schema) if (protocolContainer.hasPermission(getUser(), AdminPermission.class)) { button.addMenuItem("Manage states", PageFlowUtil.urlProvider(CoreUrls.class).getManageQCStatesURL(protocolContainer) - .addReturnURL(getViewContext().getActionURL())); + .addReturnUrl(getViewContext().getActionURL())); addButton = true; } diff --git a/api/src/org/labkey/api/data/TableViewForm.java b/api/src/org/labkey/api/data/TableViewForm.java index 47c19d1c141..47b08e24f0d 100644 --- a/api/src/org/labkey/api/data/TableViewForm.java +++ b/api/src/org/labkey/api/data/TableViewForm.java @@ -31,7 +31,6 @@ import org.labkey.api.action.BaseViewAction; import org.labkey.api.action.HasBindParameters; import org.labkey.api.action.NullSafeBindException; -import org.labkey.api.action.ReturnUrlForm; import org.labkey.api.action.SpringActionController; import org.labkey.api.collections.CaseInsensitiveHashMap; import org.labkey.api.query.SchemaKey; @@ -358,8 +357,8 @@ public Object[] getPkVals() if (null == pkVal) { Object oldValues = getOldValues(); - if (oldValues instanceof Map) - pkVal = ((Map) oldValues).get(pkName); + if (oldValues instanceof Map m) + pkVal = m.get(pkName); else try { @@ -616,7 +615,7 @@ public Map getTypedColumns() public void setTypedValues(Map values, boolean merge) { assert null != _dynaClass; - assert null != (values = Collections.unmodifiableMap(values)); + values = Collections.unmodifiableMap(values); //We assume this means data is loaded. _isDataLoaded = true; @@ -784,7 +783,7 @@ public void setViewContext(@NotNull ViewContext context) if (_isBulkUpdate) { Set selected = DataRegionSelection.getSelected(context, null, false); - _selectedRows = selected.toArray(new String[selected.size()]); + _selectedRows = selected.toArray(new String[0]); } else { @@ -827,12 +826,6 @@ public void setViewContext(@NotNull ViewContext context) // handle binding of base class ReturnURLForm PropertyValue pvReturn = params.getPropertyValue(ActionURL.Param.returnUrl.toString()); - if (null == pvReturn) - { - pvReturn = params.getPropertyValue("returnURL"); - if (pvReturn != null) - ReturnUrlForm.throwBadParam(); - } if (null != pvReturn) { try diff --git a/api/src/org/labkey/api/defaults/SetDefaultValuesAction.java b/api/src/org/labkey/api/defaults/SetDefaultValuesAction.java index f9bd0700212..d74b4576aa4 100644 --- a/api/src/org/labkey/api/defaults/SetDefaultValuesAction.java +++ b/api/src/org/labkey/api/defaults/SetDefaultValuesAction.java @@ -169,13 +169,13 @@ protected DataRegion createDataRegion() @Override public HttpView getView(FormType domainIdForm, boolean reshow, BindException errors) throws Exception { - _returnUrl = domainIdForm.getReturnURLHelper(PageFlowUtil.urlProvider(ProjectUrls.class).getStartURL(getContainer())); + _returnUrl = domainIdForm.getReturnUrlHelper(PageFlowUtil.urlProvider(ProjectUrls.class).getStartURL(getContainer())); Domain domain = getDomain(domainIdForm); List properties = domain.getProperties(); if (properties.isEmpty()) { return HtmlView.unsafe("No fields are defined for this table.

" + - PageFlowUtil.button("Cancel").href(domainIdForm.getReturnURLHelper())); + PageFlowUtil.button("Cancel").href(domainIdForm.getReturnUrlHelper())); } @@ -294,9 +294,9 @@ protected ActionURL buildSetInheritedDefaultsURL(Container container, FormType d { // Overrides to this method should call super, and then add any additional url parameters the entity type may need. ActionURL url = new ActionURL(this.getClass(), container); - URLHelper returnUrl = domainIdForm.getReturnURLHelper(); + URLHelper returnUrl = domainIdForm.getReturnUrlHelper(); if (returnUrl != null) - url.addReturnURL(returnUrl); + url.addReturnUrl(returnUrl); url.addParameter("domainId", domainIdForm.getDomainId()); return url; } diff --git a/api/src/org/labkey/api/exp/ExperimentRunListView.java b/api/src/org/labkey/api/exp/ExperimentRunListView.java index 692700750f3..4a577e12e4d 100644 --- a/api/src/org/labkey/api/exp/ExperimentRunListView.java +++ b/api/src/org/labkey/api/exp/ExperimentRunListView.java @@ -156,7 +156,7 @@ protected void populateButtonBar(DataView view, ButtonBar bar) if (_showRemoveFromExperimentButton) { getExperiment(); - ActionURL removeRunUrl = PageFlowUtil.urlProvider(ExperimentUrls.class).getRemoveSelectedExpRunsURL(getContainer(), getReturnURL(), getExperiment()); + ActionURL removeRunUrl = PageFlowUtil.urlProvider(ExperimentUrls.class).getRemoveSelectedExpRunsURL(getContainer(), getReturnUrl(), getExperiment()); ActionButton removeRunAction = new ActionButton(removeRunUrl,"Remove"); removeRunAction.setActionType(ActionButton.Action.POST); removeRunAction.setRequiresSelection(true); @@ -167,7 +167,7 @@ protected void populateButtonBar(DataView view, ButtonBar bar) if (showDeleteButton()) { - ActionURL url = PageFlowUtil.urlProvider(ExperimentUrls.class).getDeleteSelectedExpRunsURL(context.getContainer(), getReturnURL()); + ActionURL url = PageFlowUtil.urlProvider(ExperimentUrls.class).getDeleteSelectedExpRunsURL(context.getContainer(), getReturnUrl()); ActionButton deleteButton = new ActionButton(url, "Delete"); deleteButton.setIconCls("trash"); deleteButton.setActionType(ActionButton.Action.POST); @@ -181,7 +181,7 @@ protected void populateButtonBar(DataView view, ButtonBar bar) MenuButton addToExperimentButton = new MenuButton("Add to run group"); addToExperimentButton.setRequiresSelection(true); - ActionURL url = PageFlowUtil.urlProvider(ExperimentUrls.class).getCreateRunGroupURL(getContainer(), getReturnURL(), true).addParameter("noPost", "true"); + ActionURL url = PageFlowUtil.urlProvider(ExperimentUrls.class).getCreateRunGroupURL(getContainer(), getReturnUrl(), true).addParameter("noPost", "true"); String javascript = view.getDataRegion().getJavascriptFormReference() + ".method = \"POST\";\n " + view.getDataRegion().getJavascriptFormReference() + ".action = " + PageFlowUtil.jsString(url) + ";\n " + view.getDataRegion().getJavascriptFormReference() + ".submit();"; diff --git a/api/src/org/labkey/api/exp/api/ExperimentUrls.java b/api/src/org/labkey/api/exp/api/ExperimentUrls.java index fdb823fcca1..3191f04da1e 100644 --- a/api/src/org/labkey/api/exp/api/ExperimentUrls.java +++ b/api/src/org/labkey/api/exp/api/ExperimentUrls.java @@ -46,15 +46,15 @@ static ExperimentUrls get() default ActionURL getRunTextURL(Container c, int rowId) { return null; } default ActionURL getRunTextURL(ExpRun run) { return null; } - default ActionURL getDeleteProtocolURL(@NotNull ExpProtocol protocol, URLHelper returnURL) { return null; } + default ActionURL getDeleteProtocolURL(@NotNull ExpProtocol protocol, URLHelper returnUrl) { return null; } - default ActionURL getDeleteExperimentsURL(Container container, URLHelper returnURL) { return null; } + default ActionURL getDeleteExperimentsURL(Container container, URLHelper returnUrl) { return null; } - default ActionURL getDeleteDatasURL(Container container, URLHelper returnURL) { return null; } + default ActionURL getDeleteDatasURL(Container container, URLHelper returnUrl) { return null; } default ActionURL getExperimentDetailsURL(Container c, ExpExperiment expExperiment) { return null; } - default ActionURL getRemoveSelectedExpRunsURL(Container container, URLHelper returnURL, ExpExperiment expExperiment) { return null; } + default ActionURL getRemoveSelectedExpRunsURL(Container container, URLHelper returnUrl, ExpExperiment expExperiment) { return null; } default ActionURL getExportProtocolURL(Container container, ExpProtocol protocol) { return null; } @@ -64,9 +64,9 @@ static ExperimentUrls get() default ActionURL getMoveRunsLocationURL(Container container) { return null; } - default ActionURL getDeleteSelectedExpRunsURL(Container container, URLHelper returnURL) { return null; } + default ActionURL getDeleteSelectedExpRunsURL(Container container, URLHelper returnUrl) { return null; } - default ActionURL getCreateRunGroupURL(Container container, URLHelper returnURL, boolean addSelectedRuns) { return null; } + default ActionURL getCreateRunGroupURL(Container container, URLHelper returnUrl, boolean addSelectedRuns) { return null; } default ActionURL getShowRunsURL(Container c, ExperimentRunType type) { return null; } diff --git a/api/src/org/labkey/api/jsp/JspBase.java b/api/src/org/labkey/api/jsp/JspBase.java index 36085f0be62..2357cc8fdf0 100644 --- a/api/src/org/labkey/api/jsp/JspBase.java +++ b/api/src/org/labkey/api/jsp/JspBase.java @@ -503,9 +503,9 @@ public SelectBuilder select() return PageFlowUtil.makeHtmlId(s); } - public HtmlString generateReturnUrlFormField(URLHelper returnURL) + public HtmlString generateReturnUrlFormField(URLHelper returnUrl) { - return ReturnUrlForm.generateHiddenFormField(returnURL); + return ReturnUrlForm.generateHiddenFormField(returnUrl); } public HtmlString generateReturnUrlFormField(ReturnUrlForm form) diff --git a/api/src/org/labkey/api/portal/ProjectUrls.java b/api/src/org/labkey/api/portal/ProjectUrls.java index 955260cdf93..d6f38508e50 100644 --- a/api/src/org/labkey/api/portal/ProjectUrls.java +++ b/api/src/org/labkey/api/portal/ProjectUrls.java @@ -31,13 +31,13 @@ public interface ProjectUrls extends UrlProvider ActionURL getHomeURL(); ActionURL getCustomizeWebPartURL(Container c); ActionURL getAddWebPartURL(Container c); - ActionURL getCustomizeWebPartURL(Container c, Portal.WebPart webPart, ActionURL returnURL); - ActionURL getMoveWebPartURL(Container c, Portal.WebPart webPart, int direction, ActionURL returnURL); - ActionURL getDeleteWebPartURL(Container c, Portal.WebPart webPart, ActionURL returnURL); - ActionURL getDeleteWebPartURL(Container c, String pageId, int index, ActionURL returnURL); - ActionURL getHidePortalPageURL(Container c, String pageId, ActionURL returnURL); - ActionURL getDeletePortalPageURL(Container c, String pageId, ActionURL returnURL); + ActionURL getCustomizeWebPartURL(Container c, Portal.WebPart webPart, ActionURL returnUrl); + ActionURL getMoveWebPartURL(Container c, Portal.WebPart webPart, int direction, ActionURL returnUrl); + ActionURL getDeleteWebPartURL(Container c, Portal.WebPart webPart, ActionURL returnUrl); + ActionURL getDeleteWebPartURL(Container c, String pageId, int index, ActionURL returnUrl); + ActionURL getHidePortalPageURL(Container c, String pageId, ActionURL returnUrl); + ActionURL getDeletePortalPageURL(Container c, String pageId, ActionURL returnUrl); ActionURL getExpandCollapseURL(Container c, String path, String treeId); ActionURL getFileBrowserURL(Container c, String path); - ActionURL getTogglePageAdminModeURL(Container c, ActionURL returnURL); + ActionURL getTogglePageAdminModeURL(Container c, ActionURL returnUrl); } diff --git a/api/src/org/labkey/api/query/QueryParam.java b/api/src/org/labkey/api/query/QueryParam.java index 028bdd2457f..5bc0f1def03 100644 --- a/api/src/org/labkey/api/query/QueryParam.java +++ b/api/src/org/labkey/api/query/QueryParam.java @@ -37,9 +37,6 @@ public enum QueryParam implements SafeToRenderEnum allowHeaderLock, dataRegionName, - /** Use {@link ActionURL.Param#returnUrl} and {@link ActionURL#addReturnURL(URLHelper)} instead. */ - @Deprecated - srcURL, containerFilterName, selectionKey } diff --git a/api/src/org/labkey/api/query/QuerySettings.java b/api/src/org/labkey/api/query/QuerySettings.java index 2e2df4712bc..e32369b2cf7 100644 --- a/api/src/org/labkey/api/query/QuerySettings.java +++ b/api/src/org/labkey/api/query/QuerySettings.java @@ -21,7 +21,6 @@ import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.jetbrains.annotations.NotNull; -import org.labkey.api.action.ReturnUrlForm; import org.labkey.api.collections.CaseInsensitiveHashMap; import org.labkey.api.data.Aggregate; import org.labkey.api.data.AnalyticsProviderItem; @@ -87,7 +86,7 @@ public class QuerySettings private ShowRows _showRows = ShowRows.PAGINATED; PropertyValues _filterSort = null; - private ReturnURLString _returnURL = null; + private ReturnURLString _returnUrl = null; private String _containerFilterName; private List _analyticsProviders = new ArrayList<>(); @@ -305,24 +304,12 @@ public void init(PropertyValues pvs) setContainerFilterName(containerFilterNameParam); } - String returnURL = _getParameter(ActionURL.Param.returnUrl.name()); - if (returnURL == null) - { - returnURL = _getParameter("returnURL"); - if (returnURL != null) - ReturnUrlForm.throwBadParam(); - } - if (returnURL == null) - { - returnURL = _getParameter(QueryParam.srcURL.toString()); - if (returnURL != null) - ReturnUrlForm.throwBadParam("srcURL"); - } - if (returnURL != null) + String returnUrl = _getParameter(ActionURL.Param.returnUrl.name()); + if (returnUrl != null) { try { - URLHelper url = new URLHelper(returnURL); + URLHelper url = new URLHelper(returnUrl); url.setReadOnly(); setReturnUrl(new ReturnURLString(url)); } @@ -499,26 +486,26 @@ public boolean getAllowHeaderLock() */ public ReturnURLString getReturnUrl() { - return _returnURL; + return _returnUrl; } - public void setReturnUrl(ReturnURLString returnURL) + public void setReturnUrl(ReturnURLString returnUrl) { - _returnURL = returnURL; + _returnUrl = returnUrl; } /** * Returns the "returnUrl" parameter or null if none. * The url may not necessarily be an ActionURL, e.g. if served from a FileContent html page. */ - public URLHelper getReturnURLHelper() + public URLHelper getReturnUrlHelper() { - return _returnURL == null ? null : _returnURL.getURLHelper(); + return _returnUrl == null ? null : _returnUrl.getURLHelper(); } - public URLHelper getReturnURLHelper(URLHelper defaultURL) + public URLHelper getReturnUrlHelper(URLHelper defaultURL) { - URLHelper url = getReturnURLHelper(); + URLHelper url = getReturnUrlHelper(); if (url == null) url = defaultURL; return url; @@ -556,8 +543,7 @@ protected TableInfo createTable(UserSchema schema) String queryName = getQueryName(); if (queryName == null) return null; - TableInfo table = schema.getTableCFF(queryName, ContainerFilter.getType(getContainerFilterName())); - return table; + return schema.getTableCFF(queryName, ContainerFilter.getType(getContainerFilterName())); } public final QueryDefinition getQueryDef(UserSchema schema) @@ -726,7 +712,7 @@ public ActionURL getSortFilterURL() public void addSortFilters(Map filters) { - if (filters != null && filters.size() > 0) + if (filters != null && !filters.isEmpty()) { // UNDONE: there should be an easier way to convert into a Filter than having to serialize them onto an ActionUrl and back out. // Issue 17411: Support multiple filters and aggregates on the same column. @@ -854,7 +840,7 @@ public void setShowReports(boolean showReports) // Always throws BadRequestException with our standard message. Use this for convenience and consistency. Also // helps address Issue 45567. - public static void throwParameterParseException(Enum parameterEnum) + public static void throwParameterParseException(Enum parameterEnum) { throw new BadRequestException(String.format(parseError, parameterEnum.name())); } diff --git a/api/src/org/labkey/api/query/QueryView.java b/api/src/org/labkey/api/query/QueryView.java index 9c244a62c49..25f517d7add 100644 --- a/api/src/org/labkey/api/query/QueryView.java +++ b/api/src/org/labkey/api/query/QueryView.java @@ -307,9 +307,9 @@ protected String getSelectionKey() /** * Returns an ActionURL for the "returnUrl" parameter or the current ActionURL if none. */ - public URLHelper getReturnURL() + public URLHelper getReturnUrl() { - return getSettings().getReturnURLHelper(ViewServlet.getRequestURL()); + return getSettings().getReturnUrlHelper(ViewServlet.getRequestURL()); } protected boolean verboseErrors() @@ -491,7 +491,7 @@ protected StringExpression urlExpr(QueryAction action) if (expr == null) return null; - // Don't append the returnURL parameter in API responses + // Don't append the returnUrl parameter in API responses if (!isApiResponseView()) { switch (action) @@ -504,10 +504,10 @@ protected StringExpression urlExpr(QueryAction action) case deleteQueryRows: { // ICK - URLHelper returnURL = getReturnURL(); - if (returnURL != null) + URLHelper returnUrl = getReturnUrl(); + if (returnUrl != null) { - String encodedReturnURL = PageFlowUtil.encode(returnURL.getLocalURIString()); + String encodedReturnURL = PageFlowUtil.encode(returnUrl.getLocalURIString()); expr = ((StringExpressionFactory.AbstractStringExpression) expr).addParameter(ActionURL.Param.returnUrl.name(), encodedReturnURL); } } @@ -596,7 +596,7 @@ protected ActionURL urlFor(QueryAction action) case importData: case updateQueryRows: case deleteQueryRows: - ret.addReturnURL(getReturnURL()); + ret.addReturnUrl(getReturnUrl()); break; case editSnapshot: ret.addParameter("snapshotName", getSettings().getQueryName()); @@ -677,7 +677,7 @@ protected ActionURL urlFor(QueryAction action) bean.setViewName(getSettings().getViewName()); bean.setDataRegionName(getDataRegionName()); - bean.setRedirectUrl(getReturnURL().getLocalURIString()); + bean.setRedirectUrl(getReturnUrl().getLocalURIString()); return ReportUtil.getScriptReportDesignerURL(_viewContext, bean); } return ret; @@ -713,7 +713,7 @@ protected String param(String param) protected URLHelper urlRefreshQuery() { - URLHelper ret = getSettings().getReturnURLHelper(getSettings().getSortFilterURL()); + URLHelper ret = getSettings().getReturnUrlHelper(getSettings().getSortFilterURL()); ret = ret.clone(); ret.deleteParameter(param(QueryParam.queryName)); ret.deleteParameter(param(QueryParam.viewName)); @@ -738,7 +738,7 @@ protected ActionURL urlBaseView() protected URLHelper urlChangeView() { - URLHelper ret = getSettings().getReturnURLHelper(); + URLHelper ret = getSettings().getReturnUrlHelper(); if (null == ret) { ret = getSettings().getSortFilterURL(); @@ -1662,7 +1662,7 @@ protected void addFilterItems(MenuButton button) { if (_customView != null && _customView.hasFilterOrSort()) { - URLHelper url = getSettings().getReturnURLHelper(getSettings().getSortFilterURL()); + URLHelper url = getSettings().getReturnUrlHelper(getSettings().getSortFilterURL()); url = url.clone(); NavTree item; String label = "Apply Grid Filter"; @@ -1698,7 +1698,7 @@ protected void addFilterItems(MenuButton button) for (ContainerFilter.Type filterType : getAllowableContainerFilterTypes()) { - URLHelper url = getSettings().getReturnURLHelper(getSettings().getSortFilterURL()); + URLHelper url = getSettings().getReturnUrlHelper(getSettings().getSortFilterURL()); url = url.clone(); String propName = getDataRegionName() + DataRegion.CONTAINER_FILTER_NAME; url.replaceParameter(propName, filterType.name()); diff --git a/api/src/org/labkey/api/query/UserSchemaAction.java b/api/src/org/labkey/api/query/UserSchemaAction.java index 99a288fa050..d3a10f0e51a 100644 --- a/api/src/org/labkey/api/query/UserSchemaAction.java +++ b/api/src/org/labkey/api/query/UserSchemaAction.java @@ -145,18 +145,18 @@ public ActionURL getSuccessURL(QueryUpdateForm form) return resolveReturnUrl(form == null ? getActionURLParam(ActionURL.Param.cancelUrl) : null, form); } - private ActionURL resolveReturnUrl(@Nullable ActionURL returnURL, QueryUpdateForm form) + private ActionURL resolveReturnUrl(@Nullable ActionURL returnUrl, QueryUpdateForm form) { - if (null == returnURL) - returnURL = getActionURLParam(ActionURL.Param.returnUrl); - if (null == returnURL) + if (null == returnUrl) + returnUrl = getActionURLParam(ActionURL.Param.returnUrl); + if (null == returnUrl) { if (_schema != null && _table != null) - returnURL = _schema.urlFor(QueryAction.executeQuery, _form.getQueryDef()); + returnUrl = _schema.urlFor(QueryAction.executeQuery, _form.getQueryDef()); else - returnURL = QueryService.get().urlDefault(form.getContainer(), QueryAction.executeQuery, null, null); + returnUrl = QueryService.get().urlDefault(form.getContainer(), QueryAction.executeQuery, null, null); } - return returnURL; + return returnUrl; } public ActionURL getCancelURL(QueryUpdateForm form) diff --git a/api/src/org/labkey/api/reports/Report.java b/api/src/org/labkey/api/reports/Report.java index a2b9a70ebb5..efd02750673 100644 --- a/api/src/org/labkey/api/reports/Report.java +++ b/api/src/org/labkey/api/reports/Report.java @@ -126,7 +126,7 @@ public interface Report extends AttachmentParent, ThumbnailProvider String getRunReportTarget(); @Nullable ActionURL getEditReportURL(ViewContext context); - @Nullable ActionURL getEditReportURL(ViewContext context, ActionURL returnURL); + @Nullable ActionURL getEditReportURL(ViewContext context, ActionURL returnUrl); /** * Allows source grid data to be downloaded for query based reports. This would be most diff --git a/api/src/org/labkey/api/reports/report/AbstractReport.java b/api/src/org/labkey/api/reports/report/AbstractReport.java index 0aa8bd71449..01592569d73 100644 --- a/api/src/org/labkey/api/reports/report/AbstractReport.java +++ b/api/src/org/labkey/api/reports/report/AbstractReport.java @@ -198,10 +198,10 @@ public ActionURL getEditReportURL(ViewContext context) // Callers should pass in the "after save" redirect location; report might not be able to figure this out // (e.g., when manage views call this method, context.getActionURL() is a JSON API action) @Override - public @Nullable ActionURL getEditReportURL(ViewContext context, ActionURL returnURL) + public @Nullable ActionURL getEditReportURL(ViewContext context, ActionURL returnUrl) { ActionURL url = getEditReportURL(context); - return null != url ? url.addReturnURL(returnURL) : null; + return null != url ? url.addReturnUrl(returnUrl) : null; } @Override diff --git a/api/src/org/labkey/api/reports/report/ReportUrls.java b/api/src/org/labkey/api/reports/report/ReportUrls.java index 0ea268c4b1b..612a401220a 100644 --- a/api/src/org/labkey/api/reports/report/ReportUrls.java +++ b/api/src/org/labkey/api/reports/report/ReportUrls.java @@ -44,8 +44,8 @@ public interface ReportUrls extends UrlProvider // Thumbnail or icon, depending on ImageType ActionURL urlImage(Container c, Report r, ThumbnailService.ImageType type, @Nullable Integer revision); ActionURL urlReportInfo(Container c); - ActionURL urlAttachmentReport(Container c, ActionURL returnURL); - ActionURL urlLinkReport(Container c, ActionURL returnURL); + ActionURL urlAttachmentReport(Container c, ActionURL returnUrl); + ActionURL urlLinkReport(Container c, ActionURL returnUrl); ActionURL urlReportDetails(Container c, Report r); ActionURL urlQueryReport(Container c, Report r); ActionURL urlManageNotifications(Container c); diff --git a/api/src/org/labkey/api/reports/report/view/RunReportView.java b/api/src/org/labkey/api/reports/report/view/RunReportView.java index f89ed373b5f..bb070aa00f7 100644 --- a/api/src/org/labkey/api/reports/report/view/RunReportView.java +++ b/api/src/org/labkey/api/reports/report/view/RunReportView.java @@ -131,12 +131,12 @@ public void setErrors(BindException errors) protected URLHelper getBaseUrl() { ActionURL url = getViewContext().getActionURL(); - String returnURL = url.getParameter(ActionURL.Param.returnUrl); + String returnUrl = url.getParameter(ActionURL.Param.returnUrl); try { - if (!StringUtils.isBlank(returnURL)) - return new URLHelper(returnURL); + if (!StringUtils.isBlank(returnUrl)) + return new URLHelper(returnUrl); else return new URLHelper(url.toString()); } diff --git a/api/src/org/labkey/api/security/AuthenticationConfiguration.java b/api/src/org/labkey/api/security/AuthenticationConfiguration.java index cb467cffbee..32d8dd19391 100644 --- a/api/src/org/labkey/api/security/AuthenticationConfiguration.java +++ b/api/src/org/labkey/api/security/AuthenticationConfiguration.java @@ -85,7 +85,7 @@ default void handleStartupProperties(Map propertyMap) interface PrimaryAuthenticationConfiguration> extends AuthenticationConfiguration { - default @Nullable URLHelper logout(HttpServletRequest request, @Nullable URLHelper returnURL) + default @Nullable URLHelper logout(HttpServletRequest request, @Nullable URLHelper returnUrl) { return null; } diff --git a/api/src/org/labkey/api/security/AuthenticationManager.java b/api/src/org/labkey/api/security/AuthenticationManager.java index 9d594429c22..10edb09bbd0 100644 --- a/api/src/org/labkey/api/security/AuthenticationManager.java +++ b/api/src/org/labkey/api/security/AuthenticationManager.java @@ -663,7 +663,7 @@ public enum AuthenticationStatus Success { @Override - public void addUserErrorMessage(BindException errors, PrimaryAuthenticationResult result, @Nullable String fullEmailAddress, @Nullable URLHelper returnURL, DisplayLocation location) + public void addUserErrorMessage(BindException errors, PrimaryAuthenticationResult result, @Nullable String fullEmailAddress, @Nullable URLHelper returnUrl, DisplayLocation location) { throw new IllegalStateException("Shouldn't be adding an error message in success case"); } @@ -671,13 +671,13 @@ public void addUserErrorMessage(BindException errors, PrimaryAuthenticationResul BadCredentials { @Override - public void addUserErrorMessage(BindException errors, PrimaryAuthenticationResult result, @Nullable String fullEmailAddress, @Nullable URLHelper returnURL, DisplayLocation location) + public void addUserErrorMessage(BindException errors, PrimaryAuthenticationResult result, @Nullable String fullEmailAddress, @Nullable URLHelper returnUrl, DisplayLocation location) { String errorMessage = "The email address and password you entered did not match any accounts on file." + (DisplayLocation.WebUI == location ? "\nNote: Passwords are case sensitive; make sure your Caps Lock is off." : ""); errors.addError(new LabKeyError(errorMessage)); // Provide additional guidance on failed login, pointing user toward the SSO configuration(s) claiming their email domain - if (null != fullEmailAddress && null != returnURL && DisplayLocation.WebUI == location) + if (null != fullEmailAddress && null != returnUrl && DisplayLocation.WebUI == location) { String domain = fullEmailAddress.split("@")[1]; // Callers must ensure that fullEmailAddress includes @ Collection ssoConfigs = AuthenticationConfigurationCache.getActiveConfigurationsForDomain(domain).stream() @@ -692,7 +692,7 @@ public void addUserErrorMessage(BindException errors, PrimaryAuthenticationResul .collect(Collectors.joining(" or ")) + ": "; HtmlString logos = ssoConfigs.stream() - .map(ac -> ac.getLinkFactory().getLink(returnURL, AuthLogoType.LOGIN_PAGE)) + .map(ac -> ac.getLinkFactory().getLink(returnUrl, AuthLogoType.LOGIN_PAGE)) .filter(Objects::nonNull) // Only those with a login page logo .collect(LabKeyCollectors.joining(HtmlString.unsafe("  "))); @@ -707,7 +707,7 @@ public void addUserErrorMessage(BindException errors, PrimaryAuthenticationResul InactiveUser { @Override - public void addUserErrorMessage(BindException errors, PrimaryAuthenticationResult result, @Nullable String fullEmailAddress, @Nullable URLHelper returnURL, DisplayLocation location) + public void addUserErrorMessage(BindException errors, PrimaryAuthenticationResult result, @Nullable String fullEmailAddress, @Nullable URLHelper returnUrl, DisplayLocation location) { errors.addError(new ContactAnAdministratorError("Your account has been deactivated.", "to request reactivation of this account.")); } @@ -715,7 +715,7 @@ public void addUserErrorMessage(BindException errors, PrimaryAuthenticationResul LoginDisabled { @Override - public void addUserErrorMessage(BindException errors, PrimaryAuthenticationResult result, @Nullable String fullEmailAddress, @Nullable URLHelper returnURL, DisplayLocation location) + public void addUserErrorMessage(BindException errors, PrimaryAuthenticationResult result, @Nullable String fullEmailAddress, @Nullable URLHelper returnUrl, DisplayLocation location) { String errorMessage = result.getMessage() == null ? "Due to the number of recent failed login attempts, authentication has been temporarily paused.\nTry again in one minute." : result.getMessage(); errors.reject(ERROR_MSG, errorMessage); @@ -724,7 +724,7 @@ public void addUserErrorMessage(BindException errors, PrimaryAuthenticationResul LoginPaused { @Override - public void addUserErrorMessage(BindException errors, PrimaryAuthenticationResult result, @Nullable String fullEmailAddress, @Nullable URLHelper returnURL, DisplayLocation location) + public void addUserErrorMessage(BindException errors, PrimaryAuthenticationResult result, @Nullable String fullEmailAddress, @Nullable URLHelper returnUrl, DisplayLocation location) { errors.reject(ERROR_MSG, "Due to the number of recent failed login attempts, authentication has been temporarily paused.\nTry again in one minute."); } @@ -732,7 +732,7 @@ public void addUserErrorMessage(BindException errors, PrimaryAuthenticationResul UserCreationError { @Override - public void addUserErrorMessage(BindException errors, PrimaryAuthenticationResult result, @Nullable String fullEmailAddress, @Nullable URLHelper returnURL, DisplayLocation location) + public void addUserErrorMessage(BindException errors, PrimaryAuthenticationResult result, @Nullable String fullEmailAddress, @Nullable URLHelper returnUrl, DisplayLocation location) { errors.addError(new ContactAnAdministratorError("The server could not create your account.", "for assistance.")); } @@ -740,7 +740,7 @@ public void addUserErrorMessage(BindException errors, PrimaryAuthenticationResul UserCreationNotAllowed { @Override - public void addUserErrorMessage(BindException errors, PrimaryAuthenticationResult result, @Nullable String fullEmailAddress, @Nullable URLHelper returnURL, DisplayLocation location) + public void addUserErrorMessage(BindException errors, PrimaryAuthenticationResult result, @Nullable String fullEmailAddress, @Nullable URLHelper returnUrl, DisplayLocation location) { errors.addError(new ContactAnAdministratorError("This server is not configured to create new accounts automatically.", "to request a new account.")); } @@ -754,7 +754,7 @@ public boolean handleRedirect() } @Override - public void addUserErrorMessage(BindException errors, PrimaryAuthenticationResult result, @Nullable String fullEmailAddress, @Nullable URLHelper returnURL, DisplayLocation location) + public void addUserErrorMessage(BindException errors, PrimaryAuthenticationResult result, @Nullable String fullEmailAddress, @Nullable URLHelper returnUrl, DisplayLocation location) { errors.reject(ERROR_MSG, "Your password has expired; please choose a new password."); } @@ -768,20 +768,20 @@ public boolean handleRedirect() } @Override - public void addUserErrorMessage(BindException errors, PrimaryAuthenticationResult result, @Nullable String fullEmailAddress, @Nullable URLHelper returnURL, DisplayLocation location) + public void addUserErrorMessage(BindException errors, PrimaryAuthenticationResult result, @Nullable String fullEmailAddress, @Nullable URLHelper returnUrl, DisplayLocation location) { errors.reject(ERROR_MSG, "Your password does not meet the complexity requirements; please choose a new password."); } }; // Add an appropriate error message to display to the user in the web UI - public final void addUserErrorMessage(BindException errors, PrimaryAuthenticationResult result, @Nullable String fullEmailAddress, @Nullable URLHelper returnURL) + public final void addUserErrorMessage(BindException errors, PrimaryAuthenticationResult result, @Nullable String fullEmailAddress, @Nullable URLHelper returnUrl) { - addUserErrorMessage(errors, result, fullEmailAddress, returnURL, DisplayLocation.WebUI); + addUserErrorMessage(errors, result, fullEmailAddress, returnUrl, DisplayLocation.WebUI); } // Add an appropriate error message to show the user in the specified DisplayLocation - public void addUserErrorMessage(BindException errors, PrimaryAuthenticationResult result, @Nullable String fullEmailAddress, @Nullable URLHelper returnURL, DisplayLocation location) + public void addUserErrorMessage(BindException errors, PrimaryAuthenticationResult result, @Nullable String fullEmailAddress, @Nullable URLHelper returnUrl, DisplayLocation location) { } @@ -919,7 +919,7 @@ public static void addAuditEvent(@NotNull User user, HttpServletRequest request, } - public static @NotNull PrimaryAuthenticationResult authenticate(HttpServletRequest request, String id, String password, URLHelper returnURL, boolean logFailures) throws InvalidEmailException + public static @NotNull PrimaryAuthenticationResult authenticate(HttpServletRequest request, String id, String password, URLHelper returnUrl, boolean logFailures) throws InvalidEmailException { PrimaryAuthenticationResult result = null; try @@ -927,7 +927,7 @@ public static void addAuditEvent(@NotNull User user, HttpServletRequest request, result = _beforeAuthenticate(request, id, password); if (null != result) return result; - result = _authenticate(request, id, password, returnURL, logFailures); + result = _authenticate(request, id, password, returnUrl, logFailures); return result; } finally @@ -937,7 +937,7 @@ public static void addAuditEvent(@NotNull User user, HttpServletRequest request, } - private static @NotNull PrimaryAuthenticationResult _authenticate(HttpServletRequest request, final String id, String password, URLHelper returnURL, boolean logFailures) throws InvalidEmailException + private static @NotNull PrimaryAuthenticationResult _authenticate(HttpServletRequest request, final String id, String password, URLHelper returnUrl, boolean logFailures) throws InvalidEmailException { if (areNotBlank(id, password)) { @@ -950,7 +950,7 @@ public static void addAuditEvent(@NotNull User user, HttpServletRequest request, try { LoginFormAuthenticationProvider provider = configuration.getAuthenticationProvider(); - authResponse = provider.authenticate(configuration, id, password, returnURL); + authResponse = provider.authenticate(configuration, id, password, returnUrl); } catch (RedirectException e) { @@ -1256,7 +1256,7 @@ private static void addDefaultUserLoginDelay(HttpServletRequest request, String throw new UnauthorizedException(message != null ? message : primaryResult.getStatusErrorMessage(DisplayLocation.API)); } - public static URLHelper logout(@NotNull User user, @NotNull HttpServletRequest request, URLHelper returnURL) + public static URLHelper logout(@NotNull User user, @NotNull HttpServletRequest request, URLHelper returnUrl) { URLHelper ret = null; HttpSession session = request.getSession(false); @@ -1269,7 +1269,7 @@ public static URLHelper logout(@NotNull User user, @NotNull HttpServletRequest r if (null != configuration) { - ret = configuration.logout(request, returnURL); + ret = configuration.logout(request, returnUrl); } } @@ -1567,23 +1567,23 @@ public static URLHelper getAfterLoginURL(Container current, @Nullable LoginRetur if (null == properties) properties = new LoginReturnProperties(); - URLHelper returnURL; + URLHelper returnUrl; if (null != properties.getReturnUrl()) { - returnURL = properties.getReturnUrl(); + returnUrl = properties.getReturnUrl(); } else { - // We don't have a returnURL. Try not to redirect to a folder where the user doesn't have permissions, #12947 + // We don't have a returnUrl. Try not to redirect to a folder where the user doesn't have permissions, #12947 Container c = (null == current || current.isRoot() ? ContainerManager.getHomeContainer() : current); - returnURL = !c.hasPermission(user, ReadPermission.class) ? getWelcomeURL() : c.getStartURL(user); + returnUrl = !c.hasPermission(user, ReadPermission.class) ? getWelcomeURL() : c.getStartURL(user); } // if not explicitly skipping profile page and some required field is blank, then go to update profile page if (!properties.isSkipProfile() && PageFlowUtil.urlProvider(UserUrls.class).requiresProfileUpdate(user)) { - returnURL = PageFlowUtil.urlProvider(UserUrls.class).getUserUpdateURL(current, returnURL, user.getUserId()); + returnUrl = PageFlowUtil.urlProvider(UserUrls.class).getUserUpdateURL(current, returnUrl, user.getUserId()); } // if this is the users first login, reset the user cache @@ -1594,10 +1594,10 @@ public static URLHelper getAfterLoginURL(Container current, @Nullable LoginRetur if (null != properties.getUrlhash()) { - returnURL.setFragment(properties.getUrlhash().replace("#", "")); + returnUrl.setFragment(properties.getUrlhash().replace("#", "")); } - return returnURL; + return returnUrl; } public static void registerMetricsProvider() @@ -1632,17 +1632,17 @@ public LinkFactory(SSOAuthenticationConfiguration> extends PrimaryAuthenticationProvider { // id and password will not be blank (not null, not empty, not whitespace only) - @NotNull AuthenticationResponse authenticate(AC configuration, @NotNull String id, @NotNull String password, URLHelper returnURL) throws InvalidEmailException; + @NotNull AuthenticationResponse authenticate(AC configuration, @NotNull String id, @NotNull String password, URLHelper returnUrl) throws InvalidEmailException; } interface SSOAuthenticationProvider>> extends PrimaryAuthenticationProvider diff --git a/api/src/org/labkey/api/security/LoginUrls.java b/api/src/org/labkey/api/security/LoginUrls.java index 5440a2eecd2..19654e471e1 100644 --- a/api/src/org/labkey/api/security/LoginUrls.java +++ b/api/src/org/labkey/api/security/LoginUrls.java @@ -29,14 +29,14 @@ public interface LoginUrls extends UrlProvider { ActionURL getConfigureURL(); ActionURL getVerificationURL(Container c, User user, String verification, @Nullable List> extraParameters); - ActionURL getChangePasswordURL(Container c, User user, URLHelper returnURL, @Nullable String message); + ActionURL getChangePasswordURL(Container c, User user, URLHelper returnUrl, @Nullable String message); ActionURL getInitialUserURL(); ActionURL getLoginURL(); - ActionURL getLoginURL(URLHelper returnURL); - ActionURL getLoginURL(Container c, @Nullable URLHelper returnURL); + ActionURL getLoginURL(URLHelper returnUrl); + ActionURL getLoginURL(Container c, @Nullable URLHelper returnUrl); ActionURL getLogoutURL(Container c); - ActionURL getLogoutURL(Container c, URLHelper returnURL); - ActionURL getStopImpersonatingURL(Container c, @Nullable URLHelper returnURL); - ActionURL getAgreeToTermsURL(Container c, URLHelper returnURL); - ActionURL getSSORedirectURL(SSOAuthenticationConfiguration configuration, URLHelper returnURL, boolean skipProfile); + ActionURL getLogoutURL(Container c, URLHelper returnUrl); + ActionURL getStopImpersonatingURL(Container c, @Nullable URLHelper returnUrl); + ActionURL getAgreeToTermsURL(Container c, URLHelper returnUrl); + ActionURL getSSORedirectURL(SSOAuthenticationConfiguration configuration, URLHelper returnUrl, boolean skipProfile); } diff --git a/api/src/org/labkey/api/security/SecurityManager.java b/api/src/org/labkey/api/security/SecurityManager.java index 9027fd39444..ef80aaa8827 100644 --- a/api/src/org/labkey/api/security/SecurityManager.java +++ b/api/src/org/labkey/api/security/SecurityManager.java @@ -812,14 +812,14 @@ public static HttpSession setAuthenticatedUser(HttpServletRequest request, @Null return newSession; } - public static URLHelper logoutUser(HttpServletRequest request, User user, @Nullable URLHelper returnURL) + public static URLHelper logoutUser(HttpServletRequest request, User user, @Nullable URLHelper returnUrl) { - URLHelper ret = AuthenticationManager.logout(user, request, returnURL); // Let AuthenticationProvider clean up auth-specific cookies, etc. + URLHelper ret = AuthenticationManager.logout(user, request, returnUrl); // Let AuthenticationProvider clean up auth-specific cookies, etc. SessionHelper.clearSession(request, true); return ret; } - public static void impersonateUser(ViewContext viewContext, User impersonatedUser, ActionURL returnURL) + public static void impersonateUser(ViewContext viewContext, User impersonatedUser, ActionURL returnUrl) { @Nullable Container project = viewContext.getContainer().getProject(); User user = viewContext.getUser(); @@ -827,16 +827,16 @@ public static void impersonateUser(ViewContext viewContext, User impersonatedUse if (user.hasRootAdminPermission()) project = null; - impersonate(viewContext, new UserImpersonationContextFactory(project, user, impersonatedUser, returnURL)); + impersonate(viewContext, new UserImpersonationContextFactory(project, user, impersonatedUser, returnUrl)); } - public static void impersonateGroup(ViewContext viewContext, Group group, ActionURL returnURL) + public static void impersonateGroup(ViewContext viewContext, Group group, ActionURL returnUrl) { @Nullable Container project = viewContext.getContainer().getProject(); - impersonate(viewContext, new GroupImpersonationContextFactory(project, viewContext.getUser(), group, returnURL)); + impersonate(viewContext, new GroupImpersonationContextFactory(project, viewContext.getUser(), group, returnUrl)); } - public static void impersonateRoles(ViewContext viewContext, Collection newImpersonationRoles, Set currentImpersonationRoles, ActionURL returnURL) + public static void impersonateRoles(ViewContext viewContext, Collection newImpersonationRoles, Set currentImpersonationRoles, ActionURL returnUrl) { @Nullable Container project = viewContext.getContainer().getProject(); User user = viewContext.getUser(); @@ -844,7 +844,7 @@ public static void impersonateRoles(ViewContext viewContext, Collection ne if (user.hasRootPermission(CanImpersonateSiteRolesPermission.class)) project = null; - impersonate(viewContext, new RoleImpersonationContextFactory(project, user, newImpersonationRoles, currentImpersonationRoles, returnURL)); + impersonate(viewContext, new RoleImpersonationContextFactory(project, user, newImpersonationRoles, currentImpersonationRoles, returnUrl)); } private static void impersonate(ViewContext viewContext, ImpersonationContextFactory factory) diff --git a/api/src/org/labkey/api/security/SecurityUrls.java b/api/src/org/labkey/api/security/SecurityUrls.java index 1e2e4aca672..b60d69e8d37 100644 --- a/api/src/org/labkey/api/security/SecurityUrls.java +++ b/api/src/org/labkey/api/security/SecurityUrls.java @@ -24,19 +24,19 @@ public interface SecurityUrls extends UrlProvider { ActionURL getBeginURL(Container container); - ActionURL getManageGroupURL(Container container, String groupName, URLHelper returnURL); + ActionURL getManageGroupURL(Container container, String groupName, URLHelper returnUrl); ActionURL getManageGroupURL(Container container, String groupName); - ActionURL getGroupPermissionURL(Container container, int id, URLHelper returnURL); + ActionURL getGroupPermissionURL(Container container, int id, URLHelper returnUrl); ActionURL getGroupPermissionURL(Container container, int id); ActionURL getPermissionsURL(Container container); - ActionURL getPermissionsURL(Container container, URLHelper returnURL); - ActionURL getSiteGroupsURL(Container container, URLHelper returnURL); + ActionURL getPermissionsURL(Container container, URLHelper returnUrl); + ActionURL getSiteGroupsURL(Container container, URLHelper returnUrl); ActionURL getContainerURL(Container container); ActionURL getShowRegistrationEmailURL(Container container, User user, String mailPrefix); ActionURL getAddUsersURL(Container container); ActionURL getFolderAccessURL(Container container); - ActionURL getExternalToolsViewURL(User user, Container c, @NotNull ActionURL returnURL); + ActionURL getExternalToolsViewURL(User user, Container c, @NotNull ActionURL returnUrl); ActionURL getCompleteUserURL(Container container); ActionURL getCompleteUserReadURL(Container container); - ActionURL getClonePermissionsURL(User targetUser, @NotNull ActionURL returnURL); + ActionURL getClonePermissionsURL(User targetUser, @NotNull ActionURL returnUrl); } diff --git a/api/src/org/labkey/api/security/UserUrls.java b/api/src/org/labkey/api/security/UserUrls.java index 6901d0bb5b1..a8950f01942 100644 --- a/api/src/org/labkey/api/security/UserUrls.java +++ b/api/src/org/labkey/api/security/UserUrls.java @@ -31,9 +31,9 @@ public interface UserUrls extends UrlProvider ActionURL getSiteUsersURL(); ActionURL getProjectUsersURL(Container container); ActionURL getUserAccessURL(Container container, int userId); - ActionURL getUserDetailsURL(Container container, int userId, @Nullable URLHelper returnURL); - ActionURL getUserDetailsURL(Container c, @Nullable URLHelper returnURL); - ActionURL getUserUpdateURL(Container c, URLHelper returnURL, int userId); + ActionURL getUserDetailsURL(Container container, int userId, @Nullable URLHelper returnUrl); + ActionURL getUserDetailsURL(Container c, @Nullable URLHelper returnUrl); + ActionURL getUserUpdateURL(Container c, URLHelper returnUrl, int userId); ActionURL getUserAttachmentDownloadURL(User user, String name); /** diff --git a/api/src/org/labkey/api/security/impersonation/AbstractImpersonationContext.java b/api/src/org/labkey/api/security/impersonation/AbstractImpersonationContext.java index 5e07bce206c..02b1db2f56f 100644 --- a/api/src/org/labkey/api/security/impersonation/AbstractImpersonationContext.java +++ b/api/src/org/labkey/api/security/impersonation/AbstractImpersonationContext.java @@ -33,14 +33,14 @@ public abstract class AbstractImpersonationContext implements ImpersonationConte private final User _adminUser; private final @Nullable Container _project; @JsonIgnore // Can't be handled by remote pipelines - private final ActionURL _returnURL; + private final ActionURL _returnUrl; private final ImpersonationContextFactory _factory; - protected AbstractImpersonationContext(User adminUser, @Nullable Container project, ActionURL returnURL, ImpersonationContextFactory factory) + protected AbstractImpersonationContext(User adminUser, @Nullable Container project, ActionURL returnUrl, ImpersonationContextFactory factory) { _adminUser = adminUser; _project = project; - _returnURL = returnURL; + _returnUrl = returnUrl; _factory = factory; } @@ -63,15 +63,15 @@ public final User getAdminUser() } @Override - public final ActionURL getReturnURL() + public final ActionURL getReturnUrl() { - return _returnURL; + return _returnUrl; } @Override public void addMenu(NavTree menu, Container c, User user, ActionURL currentURL) { - ActionURL url = PageFlowUtil.urlProvider(LoginUrls.class).getStopImpersonatingURL(c, user.getImpersonationContext().getReturnURL()); + ActionURL url = PageFlowUtil.urlProvider(LoginUrls.class).getStopImpersonatingURL(c, user.getImpersonationContext().getReturnUrl()); NavTree stop = new NavTree("Stop Impersonating", url).usePost(); menu.addChild(stop); } diff --git a/api/src/org/labkey/api/security/impersonation/GroupImpersonationContextFactory.java b/api/src/org/labkey/api/security/impersonation/GroupImpersonationContextFactory.java index 4bb4acbafaf..985a6c385bc 100644 --- a/api/src/org/labkey/api/security/impersonation/GroupImpersonationContextFactory.java +++ b/api/src/org/labkey/api/security/impersonation/GroupImpersonationContextFactory.java @@ -51,7 +51,7 @@ public class GroupImpersonationContextFactory extends AbstractImpersonationConte private final @Nullable GUID _projectId; private final int _groupId; @JsonIgnore // Can't be handled by remote pipelines - private final ActionURL _returnURL; + private final ActionURL _returnUrl; private final int _adminUserId; @JsonCreator @@ -64,15 +64,15 @@ protected GroupImpersonationContextFactory( _projectId = projectId; _groupId = groupId; _adminUserId = adminUserId; - _returnURL = null; + _returnUrl = null; } - public GroupImpersonationContextFactory(@Nullable Container project, User adminUser, Group group, ActionURL returnURL) + public GroupImpersonationContextFactory(@Nullable Container project, User adminUser, Group group, ActionURL returnUrl) { _projectId = null != project ? project.getEntityId() : null; _adminUserId = adminUser.getUserId(); _groupId = group.getUserId(); - _returnURL = returnURL; + _returnUrl = returnUrl; } @Override @@ -81,7 +81,7 @@ public ImpersonationContext getImpersonationContext() Container project = (null != _projectId ? ContainerManager.getForId(_projectId) : null); Group group = SecurityManager.getGroup(_groupId); - return new GroupImpersonationContext(project, getAdminUser(), group, _returnURL, this); + return new GroupImpersonationContext(project, getAdminUser(), group, _returnUrl, this); } @Override @@ -184,20 +184,20 @@ protected GroupImpersonationContext( @JsonProperty("_adminUser") User adminUser, @JsonProperty("_group") Group group, @JsonProperty("_groups") PrincipalArray groups, - @JsonProperty("_returnURL") ActionURL returnURL, + @JsonProperty("_returnUrl") ActionURL returnUrl, @JsonProperty("_factory") ImpersonationContextFactory factory) { - super(adminUser, project, returnURL, factory); + super(adminUser, project, returnUrl, factory); _group = group; _groups = groups; } - private GroupImpersonationContext(@Nullable Container project, User user, Group group, ActionURL returnURL, ImpersonationContextFactory factory) + private GroupImpersonationContext(@Nullable Container project, User user, Group group, ActionURL returnUrl, ImpersonationContextFactory factory) { // project is used to verify authorization, but isn't needed while impersonating... the group itself will // limit the admin user appropriately - super(user, null, returnURL, factory); + super(user, null, returnUrl, factory); if (!canImpersonateGroup(project, user, group)) throw new UnauthorizedImpersonationException("You are not allowed to impersonate this group", getFactory()); diff --git a/api/src/org/labkey/api/security/impersonation/ImpersonationContext.java b/api/src/org/labkey/api/security/impersonation/ImpersonationContext.java index 1e9c399432e..5b74e1e53c2 100644 --- a/api/src/org/labkey/api/security/impersonation/ImpersonationContext.java +++ b/api/src/org/labkey/api/security/impersonation/ImpersonationContext.java @@ -49,7 +49,7 @@ public interface ImpersonationContext extends Serializable User getAdminUser(); String getCacheKey(); // Caching permission-related state is very tricky with impersonation; context provides a cache key suffix that captures the current impersonation state /** @return the URL to which the user should be returned when impersonation is over */ - ActionURL getReturnURL(); + ActionURL getReturnUrl(); PrincipalArray getGroups(User user); /** diff --git a/api/src/org/labkey/api/security/impersonation/NotImpersonatingContext.java b/api/src/org/labkey/api/security/impersonation/NotImpersonatingContext.java index eaf23107e04..0663428db9a 100644 --- a/api/src/org/labkey/api/security/impersonation/NotImpersonatingContext.java +++ b/api/src/org/labkey/api/security/impersonation/NotImpersonatingContext.java @@ -69,7 +69,7 @@ public String getCacheKey() } @Override - public ActionURL getReturnURL() + public ActionURL getReturnUrl() { return null; } diff --git a/api/src/org/labkey/api/security/impersonation/RoleImpersonationContextFactory.java b/api/src/org/labkey/api/security/impersonation/RoleImpersonationContextFactory.java index 597e99be21c..eca8ab26106 100644 --- a/api/src/org/labkey/api/security/impersonation/RoleImpersonationContextFactory.java +++ b/api/src/org/labkey/api/security/impersonation/RoleImpersonationContextFactory.java @@ -56,7 +56,7 @@ public class RoleImpersonationContextFactory extends AbstractImpersonationContex private final RoleSet _roles; private final RoleSet _previousRoles; @JsonIgnore // Can't be handled by remote pipelines - private final ActionURL _returnURL; + private final ActionURL _returnUrl; private final String _cacheKey; @JsonCreator @@ -72,15 +72,15 @@ protected RoleImpersonationContextFactory( _adminUserId = adminUserId; _roles = roles; _previousRoles = previousRoles; - _returnURL = null; + _returnUrl = null; _cacheKey = cacheKey; } - public RoleImpersonationContextFactory(@Nullable Container project, User adminUser, Collection newImpersonationRoles, Set currentImpersonationRoles, ActionURL returnURL) + public RoleImpersonationContextFactory(@Nullable Container project, User adminUser, Collection newImpersonationRoles, Set currentImpersonationRoles, ActionURL returnUrl) { _projectId = null != project ? project.getEntityId() : null; _adminUserId = adminUser.getUserId(); - _returnURL = returnURL; + _returnUrl = returnUrl; // Compute the navtree cache key based on role names + project: NavTree will be different for each role set + project combination StringBuilder cacheKey = new StringBuilder("/impersonationRole="); @@ -106,7 +106,7 @@ public ImpersonationContext getImpersonationContext() { Container project = (null != _projectId ? ContainerManager.getForId(_projectId) : null); - return new RoleImpersonationContext(project, getAdminUser(), _roles, _returnURL, this, _cacheKey); + return new RoleImpersonationContext(project, getAdminUser(), _roles, _returnUrl, this, _cacheKey); } @Override @@ -214,11 +214,11 @@ private RoleImpersonationContext( @Nullable Container project, User adminUser, RoleSet roles, - ActionURL returnURL, + ActionURL returnUrl, ImpersonationContextFactory factory, String cacheKey) { - super(adminUser, project, returnURL, factory); + super(adminUser, project, returnUrl, factory); _roles = roles; _cacheKey = cacheKey; verifyPermissions(project, adminUser, _roles.getRoles()); diff --git a/api/src/org/labkey/api/security/impersonation/UserImpersonationContextFactory.java b/api/src/org/labkey/api/security/impersonation/UserImpersonationContextFactory.java index 29e96ce67e7..d35723f1c2f 100644 --- a/api/src/org/labkey/api/security/impersonation/UserImpersonationContextFactory.java +++ b/api/src/org/labkey/api/security/impersonation/UserImpersonationContextFactory.java @@ -51,7 +51,7 @@ public class UserImpersonationContextFactory extends AbstractImpersonationContex private final int _adminUserId; private final int _impersonatedUserId; @JsonIgnore // Can't be handled by remote pipelines - private final ActionURL _returnURL; + private final ActionURL _returnUrl; @JsonCreator protected UserImpersonationContextFactory( @@ -63,15 +63,15 @@ protected UserImpersonationContextFactory( _projectId = projectId; _adminUserId = adminUserId; _impersonatedUserId = impersonatedUserId; - _returnURL = null; + _returnUrl = null; } - public UserImpersonationContextFactory(@Nullable Container project, User adminUser, User impersonatedUser, ActionURL returnURL) + public UserImpersonationContextFactory(@Nullable Container project, User adminUser, User impersonatedUser, ActionURL returnUrl) { _projectId = null != project ? project.getEntityId() : null; _adminUserId = adminUser.getUserId(); _impersonatedUserId = impersonatedUser.getUserId(); - _returnURL = returnURL; + _returnUrl = returnUrl; } @Override @@ -85,7 +85,7 @@ public ImpersonationContext getImpersonationContext() { Container project = (null != _projectId ? ContainerManager.getForId(_projectId) : null); - return new UserImpersonationContext(project, getAdminUser(), UserManager.getUser(_impersonatedUserId), _returnURL, this); + return new UserImpersonationContext(project, getAdminUser(), UserManager.getUser(_impersonatedUserId), _returnUrl, this); } @Override @@ -178,9 +178,9 @@ protected UserImpersonationContext( super(adminUser, project, null, factory); } - private UserImpersonationContext(@Nullable Container project, User adminUser, User impersonatedUser, ActionURL returnURL, ImpersonationContextFactory factory) + private UserImpersonationContext(@Nullable Container project, User adminUser, User impersonatedUser, ActionURL returnUrl, ImpersonationContextFactory factory) { - super(adminUser, project, returnURL, factory); + super(adminUser, project, returnUrl, factory); verifyPermissions(project, impersonatedUser, adminUser); } diff --git a/api/src/org/labkey/api/security/impersonation/WrappedImpersonationContext.java b/api/src/org/labkey/api/security/impersonation/WrappedImpersonationContext.java index ad412818eac..791a8df82e1 100644 --- a/api/src/org/labkey/api/security/impersonation/WrappedImpersonationContext.java +++ b/api/src/org/labkey/api/security/impersonation/WrappedImpersonationContext.java @@ -74,9 +74,9 @@ public String getCacheKey() } @Override - public ActionURL getReturnURL() + public ActionURL getReturnUrl() { - return _delegate.getReturnURL(); + return _delegate.getReturnUrl(); } @Override diff --git a/api/src/org/labkey/api/study/publish/AbstractPublishConfirmAction.java b/api/src/org/labkey/api/study/publish/AbstractPublishConfirmAction.java index b9b6c8e667f..6d79df374a9 100644 --- a/api/src/org/labkey/api/study/publish/AbstractPublishConfirmAction.java +++ b/api/src/org/labkey/api/study/publish/AbstractPublishConfirmAction.java @@ -127,7 +127,7 @@ public void validateCommand(FORM form, Errors errors) if (_allObjects == null) // On first post, this is empty, so use the current selection _allObjects = new ArrayList<>(_selectedObjects); - if (form.getReturnURLHelper() == null) + if (form.getReturnUrlHelper() == null) errors.reject(SpringActionController.ERROR_MSG, "No return URL configured for this form"); } @@ -209,12 +209,12 @@ protected Map getHiddenFormFields(PublishConfirmForm form) Map fields = new HashMap<>(); fields.put("rowId", form.getRowId()); - String returnURL = getViewContext().getRequest().getParameter(ActionURL.Param.returnUrl.name()); - if (returnURL == null) + String returnUrl = getViewContext().getRequest().getParameter(ActionURL.Param.returnUrl.name()); + if (returnUrl == null) { - returnURL = getViewContext().getActionURL().toString(); + returnUrl = getViewContext().getActionURL().toString(); } - fields.put(ActionURL.Param.returnUrl.name(), returnURL); + fields.put(ActionURL.Param.returnUrl.name(), returnUrl); return fields; } @@ -254,11 +254,11 @@ public ModelAndView getView(FORM form, boolean reshow, BindException errors) thr getHiddenPublishResultsCaptions(form)); List buttons = new ArrayList<>(); - URLHelper returnURL = form.getReturnURLHelper(); - if (null == returnURL) + URLHelper returnUrl = form.getReturnUrlHelper(); + if (null == returnUrl) { // consider deleting in the future unless we can find legitimate cases where the return URL is not provided in the form bean -// returnURL = PageFlowUtil.urlProvider(AssayUrls.class).getAssayRunsURL(getContainer(), _protocol).addParameter("clearDataRegionSelectionKey", publishConfirmForm.getDataRegionSelectionKey()); +// returnUrl = PageFlowUtil.urlProvider(AssayUrls.class).getAssayRunsURL(getContainer(), _protocol).addParameter("clearDataRegionSelectionKey", publishConfirmForm.getDataRegionSelectionKey()); } ActionURL publishURL = getPublishHandlerURL(form); @@ -300,7 +300,7 @@ public ModelAndView getView(FORM form, boolean reshow, BindException errors) thr buttons.add(fromSpecimenButton); } - ActionButton cancelButton = new ActionButton("Cancel", returnURL); + ActionButton cancelButton = new ActionButton("Cancel", returnUrl); cancelButton.setScript("LABKEY.setSubmit(true);", true); buttons.add(cancelButton); diff --git a/api/src/org/labkey/api/study/publish/PublishBean.java b/api/src/org/labkey/api/study/publish/PublishBean.java index 305b33aa30d..b42aaf8f09d 100644 --- a/api/src/org/labkey/api/study/publish/PublishBean.java +++ b/api/src/org/labkey/api/study/publish/PublishBean.java @@ -13,7 +13,7 @@ public class PublishBean private final boolean _nullStudies; private final boolean _insufficientPermissions; private final String _dataRegionSelectionKey; - private final ActionURL _returnURL; + private final ActionURL _returnUrl; private final ActionURL _successURL; private final String _containerFilterName; private final List _batchIds; @@ -22,7 +22,7 @@ public class PublishBean public PublishBean(ActionURL successURL, List ids, String dataRegionSelectionKey, - Set studies, boolean nullStudies, boolean insufficientPermissions, ActionURL returnURL, + Set studies, boolean nullStudies, boolean insufficientPermissions, ActionURL returnUrl, String containerFilterName, List batchIds, String batchNoun, boolean autoLinkEnabled) { _successURL = successURL; @@ -31,7 +31,7 @@ public PublishBean(ActionURL successURL, _nullStudies = nullStudies; _ids = ids; _dataRegionSelectionKey = dataRegionSelectionKey; - _returnURL = returnURL; + _returnUrl = returnUrl; _containerFilterName = containerFilterName; _batchIds = batchIds; _batchNoun = batchNoun; @@ -43,9 +43,9 @@ public ActionURL getSuccessURL() return _successURL; } - public ActionURL getReturnURL() + public ActionURL getReturnUrl() { - return _returnURL; + return _returnUrl; } public List getIds() diff --git a/api/src/org/labkey/api/study/publish/publishChooseStudy.jsp b/api/src/org/labkey/api/study/publish/publishChooseStudy.jsp index 9b3782ca5ae..bc555be7252 100644 --- a/api/src/org/labkey/api/study/publish/publishChooseStudy.jsp +++ b/api/src/org/labkey/api/study/publish/publishChooseStudy.jsp @@ -268,7 +268,7 @@ %> - + <% for (Pair parameter : parameters) @@ -292,7 +292,7 @@ <% } %> - + diff --git a/api/src/org/labkey/api/util/PageFlowUtil.java b/api/src/org/labkey/api/util/PageFlowUtil.java index 29939cc4a99..604934c235e 100644 --- a/api/src/org/labkey/api/util/PageFlowUtil.java +++ b/api/src/org/labkey/api/util/PageFlowUtil.java @@ -2339,15 +2339,15 @@ public static String getServerSessionHash() } @Nullable - public static Project getTermsOfUseProject(Container container, String returnURL) + public static Project getTermsOfUseProject(Container container, String returnUrl) { Container termsContainer = null; - if (null != returnURL) + if (null != returnUrl) { try { - URLHelper urlHelper = new URLHelper(returnURL); + URLHelper urlHelper = new URLHelper(returnUrl); Container redirectContainer = ContainerManager.getForURL(new ActionURL(urlHelper.getLocalURIString())); if (null != redirectContainer) termsContainer = redirectContainer.getProject(); diff --git a/api/src/org/labkey/api/util/ReturnURLString.java b/api/src/org/labkey/api/util/ReturnURLString.java index 830fb8afa82..f0d6b8a4faf 100644 --- a/api/src/org/labkey/api/util/ReturnURLString.java +++ b/api/src/org/labkey/api/util/ReturnURLString.java @@ -39,7 +39,7 @@ */ public class ReturnURLString { - private static final Logger LOG = LogHelper.getLogger(ReturnURLString.class, "Validates that returnURL parameters are safe"); + private static final Logger LOG = LogHelper.getLogger(ReturnURLString.class, "Validates that returnUrl parameters are safe"); private final @Nullable URLHelper _url; diff --git a/api/src/org/labkey/api/util/URLHelper.java b/api/src/org/labkey/api/util/URLHelper.java index 6af0f69a1a3..569905fdfcd 100644 --- a/api/src/org/labkey/api/util/URLHelper.java +++ b/api/src/org/labkey/api/util/URLHelper.java @@ -454,7 +454,7 @@ public String getParameter(String key) } - public URLHelper addParameter(Enum key, boolean value) + public URLHelper addParameter(Enum key, boolean value) { return addParameter(key.name(), value); } @@ -468,8 +468,6 @@ public URLHelper addParameter(String key, boolean value) public URLHelper addParameter(String key, String value) { if (_readOnly) throw new java.lang.IllegalStateException(); - if (key.equals("returnURL")) - ReturnUrlForm.throwBadParam(); if (null == _parameters) _parameters = new ArrayList<>(); _parameters.add(new Pair<>(key, value)); return this; @@ -878,9 +876,7 @@ public boolean isHttpURL() if (null == getScheme() || null == getHost()) return false; String scheme = getScheme().toLowerCase(); - if ("https".equals(scheme) || "http".equals(scheme)) - return true; - return false; + return "https".equals(scheme) || "http".equals(scheme); } public static boolean isHttpURL(String url) @@ -925,7 +921,7 @@ public boolean isAllowableHost() { String host = StringUtils.trimToNull(this.getHost()); - // We have a returnURL that includes a server host name + // We have a returnUrl that includes a server host name if (host != null) { // Check if it matches the current server's preferred host name, per the base server URL setting @@ -945,7 +941,7 @@ public boolean isAllowableHost() if (!isConfigured) { - String logMessageDetails = "returnURL value: " + this; + String logMessageDetails = "returnUrl value: " + this; HttpServletRequest request = HttpView.currentRequest(); if (request != null) { @@ -962,7 +958,7 @@ public boolean isAllowableHost() } else { - LOG.debug("Detected configured external host returnURL: " + this); + LOG.debug("Detected configured external host returnUrl: " + this); } } } diff --git a/api/src/org/labkey/api/view/ActionURL.java b/api/src/org/labkey/api/view/ActionURL.java index 28273303a5c..1d24997af3f 100644 --- a/api/src/org/labkey/api/view/ActionURL.java +++ b/api/src/org/labkey/api/view/ActionURL.java @@ -242,13 +242,13 @@ private static String toPathStringNew(Path contextPath, String pageFlow, String } - public String getParameter(Enum key) + public String getParameter(Enum key) { return getParameter(key.toString()); } @Override - public ActionURL addParameter(Enum key, boolean value) + public ActionURL addParameter(Enum key, boolean value) { return (ActionURL)super.addParameter(key, value); } @@ -265,12 +265,12 @@ public ActionURL addParameter(String key, String value) return (ActionURL) super.addParameter(key, value); } - public ActionURL addParameter(Enum key, int value) + public ActionURL addParameter(Enum key, int value) { return addParameter(key.name(), value); } - public ActionURL addParameter(Enum key, long value) + public ActionURL addParameter(Enum key, long value) { return addParameter(key.name(), value); } @@ -285,7 +285,7 @@ public ActionURL addParameter(String key, long value) return (ActionURL) super.addParameter(key, String.valueOf(value)); } - public ActionURL addParameter(Enum e, String value) + public ActionURL addParameter(Enum e, String value) { return addParameter(e.name(), value); } @@ -366,7 +366,7 @@ public ActionURL replaceParameter(String key, long value) } // Add url as a parameter using standard parameter name - public ActionURL addReturnURL(@NotNull URLHelper url) + public ActionURL addReturnUrl(@NotNull URLHelper url) { return replaceParameter(Param.returnUrl, url.getLocalURIString()); } @@ -384,15 +384,15 @@ public ActionURL addSuccessURL(@NotNull URLHelper url) } @Nullable - public URLHelper getReturnURL() + public URLHelper getReturnUrl() { - String returnURLStr = getParameter(ActionURL.Param.returnUrl); - if (null == returnURLStr) + String returnUrlStr = getParameter(ActionURL.Param.returnUrl); + if (null == returnUrlStr) return null; try { - return new URLHelper(returnURLStr); + return new URLHelper(returnUrlStr); } catch (IllegalArgumentException | URISyntaxException e) { diff --git a/api/src/org/labkey/api/view/Portal.java b/api/src/org/labkey/api/view/Portal.java index 5a6682f3284..f2c788fad83 100644 --- a/api/src/org/labkey/api/view/Portal.java +++ b/api/src/org/labkey/api/view/Portal.java @@ -380,8 +380,8 @@ public ActionURL getCustomizePostURL(ViewContext viewContext) ActionURL ret = urlProvider().getCustomizeWebPartURL(container); ret.addParameter("pageId", getPageId()); ret.addParameter("index", Integer.toString(getIndex())); - if (null != current.getReturnURL()) - ret.addReturnURL(current.getReturnURL()); + if (null != current.getReturnUrl()) + ret.addReturnUrl(current.getReturnUrl()); return ret; } diff --git a/api/src/org/labkey/api/view/menu/SiteAdminMenu.java b/api/src/org/labkey/api/view/menu/SiteAdminMenu.java index dff67098fa3..ae393b08b32 100644 --- a/api/src/org/labkey/api/view/menu/SiteAdminMenu.java +++ b/api/src/org/labkey/api/view/menu/SiteAdminMenu.java @@ -56,19 +56,19 @@ public static NavTree[] getNavTree(ViewContext context) if (user.hasRootPermission(TroubleshooterPermission.class)) items.add(getAdminConsole(context)); - URLHelper returnURL = context.getActionURL().getReturnURL() == null ? context.getActionURL() : context.getActionURL().getReturnURL(); + URLHelper returnUrl = context.getActionURL().getReturnUrl() == null ? context.getActionURL() : context.getActionURL().getReturnUrl(); if (user.hasSiteAdminPermission()) { - items.add(new NavTree("Site Admins", securityUrls.getManageGroupURL(root, "Administrators", returnURL))); - items.add(new NavTree("Site Developers", securityUrls.getManageGroupURL(root, "Developers", returnURL))); + items.add(new NavTree("Site Admins", securityUrls.getManageGroupURL(root, "Administrators", returnUrl))); + items.add(new NavTree("Site Developers", securityUrls.getManageGroupURL(root, "Developers", returnUrl))); } if (user.hasRootPermission(UserManagementPermission.class)) { - items.add(new NavTree("Site Users", PageFlowUtil.urlProvider(UserUrls.class).getSiteUsersURL().addReturnURL(returnURL))); - items.add(new NavTree("Site Groups", securityUrls.getSiteGroupsURL(root, returnURL))); - items.add(new NavTree("Site Permissions", securityUrls.getPermissionsURL(root, returnURL))); + items.add(new NavTree("Site Users", PageFlowUtil.urlProvider(UserUrls.class).getSiteUsersURL().addReturnUrl(returnUrl))); + items.add(new NavTree("Site Groups", securityUrls.getSiteGroupsURL(root, returnUrl))); + items.add(new NavTree("Site Permissions", securityUrls.getPermissionsURL(root, returnUrl))); } if (user.hasRootAdminPermission()) @@ -92,10 +92,10 @@ private static NavTree getAdminConsole(ViewContext context) ActionURL consoleUrl = adminUrls.getAdminConsoleURL(); if (null != context && null != context.getActionURL()) { - if (null == context.getActionURL().getReturnURL()) - consoleUrl.addReturnURL(context.getActionURL()); + if (null == context.getActionURL().getReturnUrl()) + consoleUrl.addReturnUrl(context.getActionURL()); else - consoleUrl.addReturnURL(context.getActionURL().getReturnURL()); + consoleUrl.addReturnUrl(context.getActionURL().getReturnUrl()); } return new NavTree("Admin Console", consoleUrl); diff --git a/api/webapp/clientapi/dom/WebPart.js b/api/webapp/clientapi/dom/WebPart.js index edda127e6cd..036fef643b6 100644 --- a/api/webapp/clientapi/dom/WebPart.js +++ b/api/webapp/clientapi/dom/WebPart.js @@ -211,10 +211,6 @@ _partConfig["webpart.title"] = _title; if (_titleHref) _partConfig["webpart.titleHref"] = _titleHref; - // Prefer using 'returnUrl' instead of 'returnURL' - if (_partConfig.returnURL) { - throw new Error("Use 'returnUrl' instead of 'returnURL'"); - } if (!_errorCallback) _errorCallback = handleLoadError; diff --git a/assay/src/org/labkey/assay/AssayController.java b/assay/src/org/labkey/assay/AssayController.java index 064b91cf77f..9e81aaabf48 100644 --- a/assay/src/org/labkey/assay/AssayController.java +++ b/assay/src/org/labkey/assay/AssayController.java @@ -548,9 +548,9 @@ protected void renderCellContents(StringBuilder html, Container c, ActionURL url { //if user doesn't have read permission to the target container, set the return URL to be //the current container - ActionURL returnURL = (c.hasPermission(user, ReadPermission.class)) ? projectUrls.getStartURL(c) : projectUrls.getStartURL(currentContainer); + ActionURL returnUrl = (c.hasPermission(user, ReadPermission.class)) ? projectUrls.getStartURL(c) : projectUrls.getStartURL(currentContainer); - ActionURL copyURL = urlProvider(AssayUrls.class).getDesignerURL(c, _protocol, true, returnURL); + ActionURL copyURL = urlProvider(AssayUrls.class).getDesignerURL(c, _protocol, true, returnUrl); html.append(""); @@ -979,24 +979,24 @@ public ActionURL getProtocolURL(Container container, @Nullable ExpProtocol proto } @Override - public @Nullable ActionURL getDesignerURL(Container container, ExpProtocol protocol, boolean copy, @Nullable ActionURL returnURL) + public @Nullable ActionURL getDesignerURL(Container container, ExpProtocol protocol, boolean copy, @Nullable ActionURL returnUrl) { AssayProvider provider = AssayService.get().getProvider(protocol); - return getDesignerURL(container, provider, protocol, copy, returnURL); + return getDesignerURL(container, provider, protocol, copy, returnUrl); } @Override - public @Nullable ActionURL getDesignerURL(Container container, String providerName, ActionURL returnURL) + public @Nullable ActionURL getDesignerURL(Container container, String providerName, ActionURL returnUrl) { AssayProvider provider = AssayService.get().getProvider(providerName); if (provider == null) { return null; } - return getDesignerURL(container, provider, null, false, returnURL); + return getDesignerURL(container, provider, null, false, returnUrl); } - private ActionURL getDesignerURL(Container container, @NotNull AssayProvider provider, @Nullable ExpProtocol protocol, boolean copy, ActionURL returnURL) + private ActionURL getDesignerURL(Container container, @NotNull AssayProvider provider, @Nullable ExpProtocol protocol, boolean copy, ActionURL returnUrl) { Class designerAction = provider.getDesignerAction(); if (designerAction == null) @@ -1006,8 +1006,8 @@ private ActionURL getDesignerURL(Container container, @NotNull AssayProvider pro if (copy) url.addParameter("copy", "true"); url.addParameter("providerName", provider.getName()); - if (returnURL != null) - url.addReturnURL(returnURL); + if (returnUrl != null) + url.addReturnUrl(returnUrl); return url; } @@ -1265,7 +1265,7 @@ public ActionURL getSetDefaultValuesAssayURL(Container container, String provide ActionURL url = new ActionURL(SetDefaultValuesAssayAction.class, container); url.addParameter("providerName", providerName); url.addParameter("domainId", domain.getTypeId()); - url.addReturnURL(returnUrl); + url.addReturnUrl(returnUrl); return url; } diff --git a/assay/src/org/labkey/assay/AssayListPortalView.java b/assay/src/org/labkey/assay/AssayListPortalView.java index 2b23b9612de..84f62f6d10f 100644 --- a/assay/src/org/labkey/assay/AssayListPortalView.java +++ b/assay/src/org/labkey/assay/AssayListPortalView.java @@ -46,7 +46,7 @@ protected void populateButtonBar(DataView view, ButtonBar bar) if (getContainer().hasPermission(getUser(), DesignAssayPermission.class)) { ActionURL insertURL = PageFlowUtil.urlProvider(AssayUrls.class).getChooseAssayTypeURL(view.getViewContext().getContainer()); - insertURL.addReturnURL(getViewContext().getActionURL()); + insertURL.addReturnUrl(getViewContext().getActionURL()); bar.add(new ActionButton("New Assay Design", insertURL)); } bar.add(new ActionButton("Manage Assays", PageFlowUtil.urlProvider(AssayUrls.class).getBeginURL(getContainer()))); diff --git a/assay/src/org/labkey/assay/AssayListQueryView.java b/assay/src/org/labkey/assay/AssayListQueryView.java index 9f143bb169b..abf18ddf33b 100644 --- a/assay/src/org/labkey/assay/AssayListQueryView.java +++ b/assay/src/org/labkey/assay/AssayListQueryView.java @@ -57,7 +57,7 @@ protected void populateButtonBar(DataView view, ButtonBar bar) if (getContainer().hasPermission(getUser(), DesignAssayPermission.class)) { ActionURL insertURL = PageFlowUtil.urlProvider(AssayUrls.class).getChooseAssayTypeURL(view.getViewContext().getContainer()); - insertURL.addReturnURL(getViewContext().getActionURL()); + insertURL.addReturnUrl(getViewContext().getActionURL()); ActionButton insert = new ActionButton("New Assay Design", insertURL); insert.setActionType(ActionButton.Action.LINK); insert.setDisplayPermission(DesignAssayPermission.class); @@ -87,7 +87,7 @@ protected void populateButtonBar(DataView view, ButtonBar bar) if (getContainer().hasPermission(getUser(), DesignAssayPermission.class)) { ActionURL plateURL = PageFlowUtil.urlProvider(PlateUrls.class).getPlateListURL(getContainer()); - plateURL.addReturnURL(getViewContext().getActionURL()); + plateURL.addReturnUrl(getViewContext().getActionURL()); ActionButton insert = new ActionButton("Configure Plates", plateURL); insert.setActionType(ActionButton.Action.LINK); insert.setDisplayPermission(DesignAssayPermission.class); diff --git a/assay/src/org/labkey/assay/AssayManager.java b/assay/src/org/labkey/assay/AssayManager.java index 2f90bc97123..5b23ec80f44 100644 --- a/assay/src/org/labkey/assay/AssayManager.java +++ b/assay/src/org/labkey/assay/AssayManager.java @@ -449,7 +449,7 @@ public WebPartView createAssayListView(ViewContext context, boolean portalVie if (context.getContainer().hasPermission(context.getUser(), DesignAssayPermission.class)) { ActionURL insertURL = PageFlowUtil.urlProvider(AssayUrls.class).getChooseAssayTypeURL(context.getContainer()); - insertURL.addReturnURL(context.getActionURL()); + insertURL.addReturnUrl(context.getActionURL()); menu.addChild("New Assay Design", insertURL); } menu.addChild("Manage Assays", PageFlowUtil.urlProvider(AssayUrls.class).getBeginURL(context.getContainer())); diff --git a/core/src/client/ListDesigner/ListDesigner.tsx b/core/src/client/ListDesigner/ListDesigner.tsx index 8bec0fb4f7e..f3c0ad5da80 100644 --- a/core/src/client/ListDesigner/ListDesigner.tsx +++ b/core/src/client/ListDesigner/ListDesigner.tsx @@ -112,7 +112,7 @@ export class ListDesigner extends React.Component { const returnUrl = ActionURL.getReturnUrl(); if (!returnUrl || !model) return returnUrl; - // Issue 47356: Rewrite returnURL in the event of a list name change + // Issue 47356: Rewrite returnUrl in the event of a list name change const { action, containerPath, controller } = ActionURL.getPathFromLocation(returnUrl); if (controller?.toLowerCase() === 'list' && action?.toLowerCase() === 'grid') { const parameters = ActionURL.getParameters(returnUrl); diff --git a/core/src/org/labkey/core/admin/AdminController.java b/core/src/org/labkey/core/admin/AdminController.java index ab8e4e4e271..26d5630679b 100644 --- a/core/src/org/labkey/core/admin/AdminController.java +++ b/core/src/org/labkey/core/admin/AdminController.java @@ -587,7 +587,7 @@ public ModelAndView getView(Object o, BindException errors) @Override public void addNavTrail(NavTree root) { - URLHelper returnUrl = getViewContext().getActionURL().getReturnURL(); + URLHelper returnUrl = getViewContext().getActionURL().getReturnUrl(); if (null != returnUrl) root.addChild("Return to Project", returnUrl); root.addChild("Admin Console"); @@ -626,9 +626,9 @@ public ActionURL getAdminConsoleURL() } @Override - public ActionURL getModuleStatusURL(URLHelper returnURL) + public ActionURL getModuleStatusURL(URLHelper returnUrl) { - return AdminController.getModuleStatusURL(returnURL); + return AdminController.getModuleStatusURL(returnUrl); } @Override @@ -672,21 +672,21 @@ public ActionURL getProjectSettingsFileURL(Container c) } @Override - public ActionURL getCustomizeEmailURL(@NotNull Container c, @Nullable Class selectedTemplate, @Nullable URLHelper returnURL) + public ActionURL getCustomizeEmailURL(@NotNull Container c, @Nullable Class selectedTemplate, @Nullable URLHelper returnUrl) { - return getCustomizeEmailURL(c, selectedTemplate == null ? null : selectedTemplate.getName(), returnURL); + return getCustomizeEmailURL(c, selectedTemplate == null ? null : selectedTemplate.getName(), returnUrl); } - public ActionURL getCustomizeEmailURL(@NotNull Container c, @Nullable String selectedTemplate, @Nullable URLHelper returnURL) + public ActionURL getCustomizeEmailURL(@NotNull Container c, @Nullable String selectedTemplate, @Nullable URLHelper returnUrl) { ActionURL url = new ActionURL(CustomizeEmailAction.class, c); if (selectedTemplate != null) { url.addParameter("templateClass", selectedTemplate); } - if (returnURL != null) + if (returnUrl != null) { - url.addReturnURL(returnURL); + url.addReturnUrl(returnUrl); } return url; } @@ -697,11 +697,11 @@ public ActionURL getResetLookAndFeelPropertiesURL(Container c) } @Override - public ActionURL getMaintenanceURL(URLHelper returnURL) + public ActionURL getMaintenanceURL(URLHelper returnUrl) { ActionURL url = new ActionURL(MaintenanceAction.class, ContainerManager.getRoot()); - if (returnURL != null) - url.addReturnURL(returnURL); + if (returnUrl != null) + url.addReturnUrl(returnUrl); return url; } @@ -742,18 +742,18 @@ public ActionURL getImportFolderURL(Container c) } @Override - public ActionURL getCreateProjectURL(@Nullable ActionURL returnURL) + public ActionURL getCreateProjectURL(@Nullable ActionURL returnUrl) { - return getCreateFolderURL(ContainerManager.getRoot(), returnURL); + return getCreateFolderURL(ContainerManager.getRoot(), returnUrl); } @Override - public ActionURL getCreateFolderURL(Container c, @Nullable ActionURL returnURL) + public ActionURL getCreateFolderURL(Container c, @Nullable ActionURL returnUrl) { ActionURL result = new ActionURL(CreateFolderAction.class, c); - if (returnURL != null) + if (returnUrl != null) { - result.addReturnURL(returnURL); + result.addReturnUrl(returnUrl); } return result; } @@ -887,7 +887,7 @@ public static class MaintenanceBean * During upgrade, startup, or maintenance mode, the user will be redirected to * MaintenanceAction and only admin users will be allowed to log into the server. * The maintenance.jsp page checks startup is complete or adminOnly mode is turned off - * and will redirect to the returnURL or the loginURL. + * and will redirect to the returnUrl or the loginURL. * See Issue 18758 for more information. */ @RequiresNoPermission @@ -933,9 +933,9 @@ else if (maintenanceMode) ActionURL loginURL = null; if (getUser().isGuest()) { - URLHelper returnURL = form.getReturnURLHelper(); - if (returnURL != null) - loginURL = urlProvider(LoginUrls.class).getLoginURL(ContainerManager.getRoot(), returnURL); + URLHelper returnUrl = form.getReturnUrlHelper(); + if (returnUrl != null) + loginURL = urlProvider(LoginUrls.class).getLoginURL(ContainerManager.getRoot(), returnUrl); else loginURL = urlProvider(LoginUrls.class).getLoginURL(); } @@ -4303,11 +4303,11 @@ public void addNavTrail(NavTree root) } } - public static ActionURL getModuleStatusURL(URLHelper returnURL) + public static ActionURL getModuleStatusURL(URLHelper returnUrl) { ActionURL url = new ActionURL(ModuleStatusAction.class, ContainerManager.getRoot()); - if (returnURL != null) - url.addReturnURL(returnURL); + if (returnUrl != null) + url.addReturnUrl(returnUrl); return url; } @@ -6121,7 +6121,7 @@ public ActionURL getSuccessURL(FileRootsForm form) { ActionURL url = new ActionURL(FileRootsStandAloneAction.class, getContainer()) .addParameter("folderSetup", true) - .addReturnURL(getViewContext().getActionURL().getReturnURL()); + .addReturnUrl(getViewContext().getActionURL().getReturnUrl()); if (form.isFileRootChanged()) url.addParameter("rootSet", form.getMigrateFilesOption()); @@ -6169,9 +6169,9 @@ public ActionURL getSuccessURL(FileRootsForm form) { ActionURL url = getContainer().getStartURL(getUser()); - if (getViewContext().getActionURL().getReturnURL() != null) + if (getViewContext().getActionURL().getReturnUrl() != null) { - url.addReturnURL(getViewContext().getActionURL().getReturnURL()); + url.addReturnUrl(getViewContext().getActionURL().getReturnUrl()); } return url; @@ -7162,7 +7162,7 @@ public boolean handlePost(CustomEmailForm form, BindException errors) throws Exc @Override public URLHelper getSuccessURL(CustomEmailForm form) { - return new AdminUrlsImpl().getCustomizeEmailURL(getContainer(), form.getTemplateClass(), form.getReturnURLHelper()); + return new AdminUrlsImpl().getCustomizeEmailURL(getContainer(), form.getTemplateClass(), form.getReturnUrlHelper()); } } @@ -7540,7 +7540,7 @@ else if (name == null) @RequiresPermission(AdminPermission.class) public class RenameFolderAction extends FormViewAction { - private ActionURL _returnURL; + private ActionURL _returnUrl; @Override public void validateCommand(ManageFoldersForm target, Errors errors) @@ -7560,7 +7560,7 @@ public boolean handlePost(ManageFoldersForm form, BindException errors) { String title = form.isTitleSameAsName() ? null : StringUtils.trimToNull(form.getTitle()); Container c = ContainerManager.rename(getContainer(), getUser(), form.getName(), title, form.isAddAlias()); - _returnURL = new AdminUrlsImpl().getManageFoldersURL(c); + _returnUrl = new AdminUrlsImpl().getManageFoldersURL(c); return true; } catch (Exception e) @@ -7574,7 +7574,7 @@ public boolean handlePost(ManageFoldersForm form, BindException errors) @Override public ActionURL getSuccessURL(ManageFoldersForm form) { - return _returnURL; + return _returnUrl; } @Override diff --git a/core/src/org/labkey/core/admin/createFolder.jsp b/core/src/org/labkey/core/admin/createFolder.jsp index 73d9fb142d7..7ac1efdc982 100644 --- a/core/src/org/labkey/core/admin/createFolder.jsp +++ b/core/src/org/labkey/core/admin/createFolder.jsp @@ -316,7 +316,7 @@ text: 'Cancel', cls: 'labkey-button', handler: function() { - window.location = <%= q(form.getReturnURLHelper(new ActionURL(ProjectController.StartAction.class, ContainerManager.getHomeContainer()))) %>; + window.location = <%= q(form.getReturnUrlHelper(new ActionURL(ProjectController.StartAction.class, ContainerManager.getHomeContainer()))) %>; } },{ text: 'Next', diff --git a/core/src/org/labkey/core/admin/customizeEmail.jsp b/core/src/org/labkey/core/admin/customizeEmail.jsp index 51c9ef5762e..03b5970659c 100644 --- a/core/src/org/labkey/core/admin/customizeEmail.jsp +++ b/core/src/org/labkey/core/admin/customizeEmail.jsp @@ -98,7 +98,7 @@
diff --git a/core/src/org/labkey/core/admin/view/filesProjectSettings.jsp b/core/src/org/labkey/core/admin/view/filesProjectSettings.jsp index 3daed66b1ab..c3648ad8af1 100644 --- a/core/src/org/labkey/core/admin/view/filesProjectSettings.jsp +++ b/core/src/org/labkey/core/admin/view/filesProjectSettings.jsp @@ -79,8 +79,8 @@ String folderSetup = getActionURL().getParameter("folderSetup"); boolean isFolderSetup = "true".equalsIgnoreCase(folderSetup); String cancelButtonText = isFolderSetup ? "Next" : "Cancel"; - URLHelper cancelButtonUrl = isFolderSetup && getActionURL().getReturnURL() != null - ? getActionURL().getReturnURL() + URLHelper cancelButtonUrl = isFolderSetup && getActionURL().getReturnUrl() != null + ? getActionURL().getReturnUrl() : c.getStartURL(getUser()); ActionURL redirectToPipeline = urlProvider(PipelineUrls.class).urlBegin(c); boolean isCurrentFileRootCloud = FileRootProp.cloudRoot.name().equals(bean.getFileRootOption()); diff --git a/core/src/org/labkey/core/attachment/AttachmentServiceImpl.java b/core/src/org/labkey/core/attachment/AttachmentServiceImpl.java index e54a8090f4b..95c9bc7d6d9 100644 --- a/core/src/org/labkey/core/attachment/AttachmentServiceImpl.java +++ b/core/src/org/labkey/core/attachment/AttachmentServiceImpl.java @@ -303,7 +303,7 @@ public synchronized void addAttachments(AttachmentParent parent, List files, BindException errors, URLHelper returnURL) + public HttpView getErrorView(List files, BindException errors, URLHelper returnUrl) { boolean hasErrors = null != errors && errors.hasErrors(); HtmlString errorHtml = getErrorHtml(files); // TODO: Get rid of getErrorHtml() -- use errors collection @@ -313,7 +313,7 @@ public HttpView getErrorView(List files, BindException errors, U try { - return new ErrorView(errorHtml, errors, returnURL); + return new ErrorView(errorHtml, errors, returnUrl); } catch (Exception e) { @@ -343,13 +343,13 @@ public HttpView getErrorView(List files, BindException errors, U public static class ErrorView extends JspView { public HtmlString errorHtml; - public URLHelper returnURL; + public URLHelper returnUrl; - private ErrorView(HtmlString errorHtml, BindException errors, URLHelper returnURL) + private ErrorView(HtmlString errorHtml, BindException errors, URLHelper returnUrl) { super("/org/labkey/core/attachment/showErrors.jsp", new Object(), errors); this.errorHtml = errorHtml; - this.returnURL = returnURL; + this.returnUrl = returnUrl; } } diff --git a/core/src/org/labkey/core/attachment/showErrors.jsp b/core/src/org/labkey/core/attachment/showErrors.jsp index 420a94fd60b..1d07cc2baea 100644 --- a/core/src/org/labkey/core/attachment/showErrors.jsp +++ b/core/src/org/labkey/core/attachment/showErrors.jsp @@ -20,8 +20,8 @@ <%@ page import="org.labkey.core.attachment.AttachmentServiceImpl" %> <%@ page extends="org.labkey.api.jsp.JspBase" %> <% - AttachmentServiceImpl.ErrorView me = (AttachmentServiceImpl.ErrorView) HttpView.currentView(); + AttachmentServiceImpl.ErrorView me = HttpView.currentView(); %> <%=formatMissedErrors("form")%> <%=null != me.errorHtml ? me.errorHtml : HtmlString.EMPTY_STRING%> -

<%= button("Continue").href(me.returnURL) %> +

<%= button("Continue").href(me.returnUrl) %> diff --git a/core/src/org/labkey/core/login/DbLoginAuthenticationProvider.java b/core/src/org/labkey/core/login/DbLoginAuthenticationProvider.java index 02800cc3db3..bd17dc56082 100644 --- a/core/src/org/labkey/core/login/DbLoginAuthenticationProvider.java +++ b/core/src/org/labkey/core/login/DbLoginAuthenticationProvider.java @@ -109,7 +109,7 @@ public boolean isFicamApproved() @Override // id and password will not be blank (not null, not empty, not whitespace only) - public @NotNull AuthenticationResponse authenticate(DbLoginConfiguration configuration, @NotNull String id, @NotNull String password, URLHelper returnURL) throws InvalidEmailException + public @NotNull AuthenticationResponse authenticate(DbLoginConfiguration configuration, @NotNull String id, @NotNull String password, URLHelper returnUrl) throws InvalidEmailException { // Check for API key first if (API_KEY.equals(id)) @@ -170,7 +170,7 @@ public boolean isFicamApproved() if (!rule.isValidForLogin(password, user, messages)) { - return getChangePasswordResponse(configuration, user, returnURL, FailureReason.complexity); + return getChangePasswordResponse(configuration, user, returnUrl, FailureReason.complexity); } else { @@ -179,7 +179,7 @@ public boolean isFicamApproved() if (expiration.hasExpired(() -> LoginManager.getLastChanged(user2))) { - return getChangePasswordResponse(configuration, user, returnURL, FailureReason.expired); + return getChangePasswordResponse(configuration, user, returnUrl, FailureReason.expired); } } } @@ -225,7 +225,7 @@ public boolean test(HttpServletRequest httpServletRequest) } // If this appears to be a browser request then return an AuthenticationResponse that will result in redirect to the change password page. - private AuthenticationResponse getChangePasswordResponse(DbLoginConfiguration configuration, User user, URLHelper returnURL, FailureReason failureReason) + private AuthenticationResponse getChangePasswordResponse(DbLoginConfiguration configuration, User user, URLHelper returnUrl, FailureReason failureReason) { ActionURL redirectURL = null; @@ -242,11 +242,11 @@ private AuthenticationResponse getChangePasswordResponse(DbLoginConfiguration co // We have a container, so redirect to password change page // Fall back plan is the home page - if (null == returnURL) - returnURL = AppProps.getInstance().getHomePageActionURL(); + if (null == returnUrl) + returnUrl = AppProps.getInstance().getHomePageActionURL(); LoginUrls urls = PageFlowUtil.urlProvider(LoginUrls.class); - redirectURL = urls.getChangePasswordURL(c, user, returnURL, "Your " + failureReason.getMessage() + "; please choose a new password."); + redirectURL = urls.getChangePasswordURL(c, user, returnUrl, "Your " + failureReason.getMessage() + "; please choose a new password."); } } } diff --git a/core/src/org/labkey/core/login/LoginController.java b/core/src/org/labkey/core/login/LoginController.java index 76ccd263193..9811996ab85 100644 --- a/core/src/org/labkey/core/login/LoginController.java +++ b/core/src/org/labkey/core/login/LoginController.java @@ -190,7 +190,7 @@ public ActionURL getVerificationURL(Container c, User user, String verification, } @Override - public ActionURL getChangePasswordURL(Container c, User user, URLHelper returnURL, @Nullable String message) + public ActionURL getChangePasswordURL(Container c, User user, URLHelper returnUrl, @Nullable String message) { ActionURL url = new ActionURL(ChangePasswordAction.class, LookAndFeelProperties.getSettingsContainer(c)); url.addParameter("userId", user.getUserId()); @@ -198,7 +198,7 @@ public ActionURL getChangePasswordURL(Container c, User user, URLHelper returnUR if (null != message) url.addParameter("message", message); - url.addReturnURL(returnURL); + url.addReturnUrl(returnUrl); return url; } @@ -210,28 +210,28 @@ public ActionURL getLoginURL() } @Override - public ActionURL getLoginURL(URLHelper returnURL) + public ActionURL getLoginURL(URLHelper returnUrl) { - // Use root as placeholder; extra path of returnURL determines the real login URL path + // Use root as placeholder; extra path of returnUrl determines the real login URL path ActionURL url = new ActionURL(LoginAction.class, ContainerManager.getRoot()); - if (null == returnURL) - returnURL = AppProps.getInstance().getHomePageActionURL(); + if (null == returnUrl) + returnUrl = AppProps.getInstance().getHomePageActionURL(); - if (returnURL instanceof ActionURL) - url.setExtraPath(((ActionURL) returnURL).getExtraPath()); + if (returnUrl instanceof ActionURL) + url.setExtraPath(((ActionURL) returnUrl).getExtraPath()); - url.addReturnURL(returnURL); + url.addReturnUrl(returnUrl); return url; } @Override - public ActionURL getLoginURL(Container c, @Nullable URLHelper returnURL) + public ActionURL getLoginURL(Container c, @Nullable URLHelper returnUrl) { ActionURL url = new ActionURL(LoginAction.class, c); - if (null != returnURL) - url.addReturnURL(returnURL); + if (null != returnUrl) + url.addReturnUrl(returnUrl); return url; } @@ -243,34 +243,34 @@ public ActionURL getLogoutURL(Container c) } @Override - public ActionURL getLogoutURL(Container c, URLHelper returnURL) + public ActionURL getLogoutURL(Container c, URLHelper returnUrl) { ActionURL url = getLogoutURL(c); - url.addReturnURL(returnURL); + url.addReturnUrl(returnUrl); return url; } @Override - public ActionURL getStopImpersonatingURL(Container c, @Nullable URLHelper returnURL) + public ActionURL getStopImpersonatingURL(Container c, @Nullable URLHelper returnUrl) { ActionURL url = new ActionURL(StopImpersonatingAction.class, c); - if (null != returnURL) - url.addReturnURL(returnURL); + if (null != returnUrl) + url.addReturnUrl(returnUrl); return url; } @Override - public ActionURL getAgreeToTermsURL(Container c, URLHelper returnURL) + public ActionURL getAgreeToTermsURL(Container c, URLHelper returnUrl) { ActionURL url = new ActionURL(AgreeToTermsAction.class, c); - url.addReturnURL(returnURL); + url.addReturnUrl(returnUrl); return url; } @Override - public ActionURL getSSORedirectURL(SSOAuthenticationConfiguration configuration, URLHelper returnURL, boolean skipProfile) + public ActionURL getSSORedirectURL(SSOAuthenticationConfiguration configuration, URLHelper returnUrl, boolean skipProfile) { ActionURL url = new ActionURL(SsoRedirectAction.class, ContainerManager.getRoot()); url.addParameter("configuration", configuration.getRowId()); @@ -278,12 +278,12 @@ public ActionURL getSSORedirectURL(SSOAuthenticationConfiguration configurati { url.addParameter("skipProfile", 1); } - if (null != returnURL) + if (null != returnUrl) { - String fragment = returnURL.getFragment(); - if (!returnURL.isReadOnly()) - returnURL.setFragment(null); - url.addReturnURL(returnURL); + String fragment = returnUrl.getFragment(); + if (!returnUrl.isReadOnly()) + returnUrl.setFragment(null); + url.addReturnUrl(returnUrl); if (!StringUtils.isBlank(fragment)) url.replaceParameter("urlhash", "#" + fragment); } @@ -315,7 +315,7 @@ private static boolean authenticate(LoginForm form, BindException errors, HttpSe try { // Attempt authentication with all active form providers - PrimaryAuthenticationResult result = AuthenticationManager.authenticate(request, form.getEmail(), form.getPassword(), form.getReturnURLHelper(), true); + PrimaryAuthenticationResult result = AuthenticationManager.authenticate(request, form.getEmail(), form.getPassword(), form.getReturnUrlHelper(), true); AuthenticationStatus status = result.getStatus(); if (Success == status) @@ -335,7 +335,7 @@ private static boolean authenticate(LoginForm form, BindException errors, HttpSe else { // Pass in normalized email address, but only if user provided a full email address - status.addUserErrorMessage(errors, result, form.getEmail().contains("@") ? email.getEmailAddress() : null, form.getReturnURLHelper()); + status.addUserErrorMessage(errors, result, form.getEmail().contains("@") ? email.getEmailAddress() : null, form.getReturnUrlHelper()); } } } @@ -563,11 +563,11 @@ private ModelAndView redirectIfLoggedIn(AbstractLoginForm form) { if (!getUser().isGuest()) { - URLHelper returnURL = form.getReturnURLHelper(); + URLHelper returnUrl = form.getReturnUrlHelper(); - // Create LoginReturnProperties if we have a returnURL or skipProfile param - LoginReturnProperties properties = null != returnURL || form.getSkipProfile() - ? new LoginReturnProperties(returnURL, form.getUrlhash(), form.getSkipProfile()) : null; + // Create LoginReturnProperties if we have a returnUrl or skipProfile param + LoginReturnProperties properties = null != returnUrl || form.getSkipProfile() + ? new LoginReturnProperties(returnUrl, form.getUrlhash(), form.getSkipProfile()) : null; return HttpView.redirect(AuthenticationManager.getAfterLoginURL(getContainer(), properties, getUser()), true); } @@ -619,12 +619,12 @@ public Object execute(LoginForm form, BindException errors) { HttpServletRequest request = getViewContext().getRequest(); - // Store passed in returnURL and skipProfile param at the start of the login so we can redirect to it after + // Store passed in returnUrl and skipProfile param at the start of the login so we can redirect to it after // any password resets, secondary logins, profile updates, etc. have finished - URLHelper returnURL = form.getReturnURLHelper(); - if (null != returnURL || form.getSkipProfile()) + URLHelper returnUrl = form.getReturnUrlHelper(); + if (null != returnUrl || form.getSkipProfile()) { - LoginReturnProperties properties = new LoginReturnProperties(returnURL, form.getUrlhash(), form.getSkipProfile()); + LoginReturnProperties properties = new LoginReturnProperties(returnUrl, form.getUrlhash(), form.getSkipProfile()); AuthenticationManager.setLoginReturnProperties(request, properties); } @@ -756,7 +756,7 @@ public Object execute(SetPasswordForm form, BindException errors) throws Excepti if (isOldPasswordMatch(_user, oldPassword, errors)) { - AuthenticationResult result = attemptSetPassword(_user, form.getReturnURLHelper(), "Changed password.", false, errors); + AuthenticationResult result = attemptSetPassword(_user, form.getReturnUrlHelper(), "Changed password.", false, errors); if (result != null) response.put(ActionURL.Param.returnUrl.name(), result.getRedirectURL()); } @@ -784,7 +784,7 @@ public Object execute(SetPasswordForm form, BindException errors) throws Excepti User user = attemptVerification(form, errors); if (user != null) { - AuthenticationResult result = attemptSetPassword(user, form.getReturnURLHelper(), "Verified and chose a password.", true, errors); + AuthenticationResult result = attemptSetPassword(user, form.getReturnUrlHelper(), "Verified and chose a password.", true, errors); if (result != null) response.put(ActionURL.Param.returnUrl.name(), result.getRedirectURL()); } @@ -988,12 +988,12 @@ public static class GetLoginMechanismsApiAction extends MutatingApiAction ssoAuthenticationConfiguration = AuthenticationManager.getAutoRedirectSSOAuthConfiguration(); if (ssoAuthenticationConfiguration != null) - return HttpView.redirect(ssoAuthenticationConfiguration.getLinkFactory().getURL(form.getReturnURLHelper(), form.getSkipProfile())); + return HttpView.redirect(ssoAuthenticationConfiguration.getLinkFactory().getURL(form.getReturnUrlHelper(), form.getSkipProfile())); } page.setTemplate(PageConfig.Template.Dialog); @@ -1221,7 +1221,7 @@ else if (form.getTermsOfUseType() == TermsOfUseType.SITE_WIDE) @Override public URLHelper getSuccessURL(AgreeToTermsForm form) { - return form.getReturnURLHelper(); + return form.getReturnUrlHelper(); } @Override @@ -1396,7 +1396,7 @@ public void validateCommand(ReturnUrlForm target, Errors errors) @Override public boolean handlePost(ReturnUrlForm form, BindException errors) throws Exception { - _redirectURL = SecurityManager.logoutUser(getViewContext().getRequest(), getUser(), form.getReturnURLHelper(AppProps.getInstance().getHomePageActionURL())); + _redirectURL = SecurityManager.logoutUser(getViewContext().getRequest(), getUser(), form.getReturnUrlHelper(AppProps.getInstance().getHomePageActionURL())); return true; } @@ -1415,7 +1415,7 @@ public URLHelper getSuccessURL(ReturnUrlForm form) throw new RuntimeException(e); } } - return form.getReturnURLHelper(AuthenticationManager.getWelcomeURL()); + return form.getReturnUrlHelper(AuthenticationManager.getWelcomeURL()); } } @@ -1443,7 +1443,7 @@ public boolean handlePost(ReturnUrlForm form, BindException errors) throws Excep @Override public URLHelper getSuccessURL(ReturnUrlForm form) { - return form.getReturnURLHelper(AuthenticationManager.getWelcomeURL()); + return form.getReturnUrlHelper(AuthenticationManager.getWelcomeURL()); } } @@ -1480,7 +1480,7 @@ public static class LogoutApiAction extends MutatingApiAction @Override public Object execute(ReturnUrlForm form, BindException errors) { - URLHelper redirectURL = SecurityManager.logoutUser(getViewContext().getRequest(), getUser(), form.getReturnURLHelper(AppProps.getInstance().getHomePageActionURL())); + URLHelper redirectURL = SecurityManager.logoutUser(getViewContext().getRequest(), getUser(), form.getReturnUrlHelper(AppProps.getInstance().getHomePageActionURL())); ApiSimpleResponse response = new ApiSimpleResponse("success", true); if (null != redirectURL) response.put("redirectUrl", redirectURL.getURIString()); @@ -1527,11 +1527,11 @@ public ModelAndView getView(SsoRedirectForm form, BindException errors) if (!getUser().isGuest()) return HttpView.redirect(form.getReturnActionURL(AppProps.getInstance().getHomePageActionURL())); - // If we have a returnURL or skipProfile param then create and stash LoginReturnProperties - URLHelper returnURL = form.getReturnURLHelper(); - if (null != returnURL || form.getSkipProfile()) + // If we have a returnUrl or skipProfile param then create and stash LoginReturnProperties + URLHelper returnUrl = form.getReturnUrlHelper(); + if (null != returnUrl || form.getSkipProfile()) { - LoginReturnProperties properties = new LoginReturnProperties(returnURL, form.getUrlhash(), form.getSkipProfile()); + LoginReturnProperties properties = new LoginReturnProperties(returnUrl, form.getUrlhash(), form.getSkipProfile()); AuthenticationManager.setLoginReturnProperties(getViewContext().getRequest(), properties); } @@ -1612,11 +1612,11 @@ buttonText, getTitle() page.setIncludeLoginLink(false); page.setIncludeSearch(false); - // If we have a returnURL or skipProfile param then create and stash LoginReturnProperties - URLHelper returnURL = form.getReturnURLHelper(); - if (null != returnURL || form.getSkipProfile()) + // If we have a returnUrl or skipProfile param then create and stash LoginReturnProperties + URLHelper returnUrl = form.getReturnUrlHelper(); + if (null != returnUrl || form.getSkipProfile()) { - LoginReturnProperties properties = new LoginReturnProperties(returnURL, form.getUrlhash(), form.getSkipProfile()); + LoginReturnProperties properties = new LoginReturnProperties(returnUrl, form.getUrlhash(), form.getSkipProfile()); AuthenticationManager.setLoginReturnProperties(getViewContext().getRequest(), properties); } @@ -1633,7 +1633,7 @@ buttonText, getTitle() @Override public boolean handlePost(SetPasswordForm form, BindException errors) throws Exception { - AuthenticationResult result = attemptSetPassword(_user, form.getReturnURLHelper(), getAuditMessage(), clearVerification(), errors); + AuthenticationResult result = attemptSetPassword(_user, form.getReturnUrlHelper(), getAuditMessage(), clearVerification(), errors); if (errors.hasErrors()) return false; diff --git a/core/src/org/labkey/core/login/setPassword.jsp b/core/src/org/labkey/core/login/setPassword.jsp index ce35454b5c8..c6dda66700b 100644 --- a/core/src/org/labkey/core/login/setPassword.jsp +++ b/core/src/org/labkey/core/login/setPassword.jsp @@ -133,20 +133,20 @@ <% } - if (null != bean.form.getReturnURLHelper()) { %> + if (null != bean.form.getReturnUrlHelper()) { %> <%=generateReturnUrlFormField(bean.form)%> <% } %>
<%= button(bean.buttonText).submit(true).name("set") %> - <%=unsafe(bean.cancellable ? button("Cancel").href(bean.form.getReturnURLHelper() != null ? bean.form.getReturnURLHelper() : new ActionURL(HomeAction.class, getContainer())).toString() : "")%> + <%=unsafe(bean.cancellable ? button("Cancel").href(bean.form.getReturnUrlHelper() != null ? bean.form.getReturnUrlHelper() : new ActionURL(HomeAction.class, getContainer())).toString() : "")%>
<% } else { Container c = getContainer().isRoot() ? ContainerManager.getHomeContainer() : getContainer(); - URLHelper homeURL = bean.form.getReturnURLHelper() != null ? bean.form.getReturnURLHelper() : new ActionURL(StartAction.class, c); + URLHelper homeURL = bean.form.getReturnUrlHelper() != null ? bean.form.getReturnUrlHelper() : new ActionURL(StartAction.class, c); %>
<%= unsafe(button("Home").href(homeURL).toString()) %> diff --git a/core/src/org/labkey/core/login/termsOfUse.jsp b/core/src/org/labkey/core/login/termsOfUse.jsp index 9a4e3bb2f87..5face19abc0 100644 --- a/core/src/org/labkey/core/login/termsOfUse.jsp +++ b/core/src/org/labkey/core/login/termsOfUse.jsp @@ -34,15 +34,15 @@ } %> <% - HttpView me = (HttpView) HttpView.currentView(); + HttpView me = HttpView.currentView(); AgreeToTermsBean bean = me.getModelBean(); - URLHelper returnURL = bean.form.getReturnURLHelper(AppProps.getInstance().getHomePageActionURL()); + URLHelper returnUrl = bean.form.getReturnUrlHelper(AppProps.getInstance().getHomePageActionURL()); HtmlString termsHtml = bean.termsOfUseHTML; // Redirect immediately if terms are blank or null if (HtmlString.isBlank(termsHtml)) - throw new RedirectException(returnURL); + throw new RedirectException(returnUrl); ActionURL formURL = urlFor(AgreeToTermsAction.class); %> @@ -68,7 +68,7 @@
- <%=generateReturnUrlFormField(returnURL)%> + <%=generateReturnUrlFormField(returnUrl)%> diff --git a/core/src/org/labkey/core/portal/ProjectController.java b/core/src/org/labkey/core/portal/ProjectController.java index 30e6c1e6f73..497f8d0a4a1 100644 --- a/core/src/org/labkey/core/portal/ProjectController.java +++ b/core/src/org/labkey/core/portal/ProjectController.java @@ -162,57 +162,57 @@ public ActionURL getAddWebPartURL(Container c) } @Override - public ActionURL getCustomizeWebPartURL(Container c, Portal.WebPart webPart, ActionURL returnURL) + public ActionURL getCustomizeWebPartURL(Container c, Portal.WebPart webPart, ActionURL returnUrl) { ActionURL url = getCustomizeWebPartURL(c); url.addParameter("webPartId", String.valueOf(webPart.getRowId())); - url.addReturnURL(returnURL); + url.addReturnUrl(returnUrl); return url; } @Override - public ActionURL getMoveWebPartURL(Container c, Portal.WebPart webPart, int direction, ActionURL returnURL) + public ActionURL getMoveWebPartURL(Container c, Portal.WebPart webPart, int direction, ActionURL returnUrl) { ActionURL url = new ActionURL(MoveWebPartAction.class, c); url.addParameter("pageId", webPart.getPageId()); url.addParameter("index", String.valueOf(webPart.getIndex())); url.addParameter("direction", String.valueOf(direction)); - url.addReturnURL(returnURL); + url.addReturnUrl(returnUrl); return url; } @Override - public ActionURL getDeleteWebPartURL(Container c, String pageId, int index, ActionURL returnURL) + public ActionURL getDeleteWebPartURL(Container c, String pageId, int index, ActionURL returnUrl) { ActionURL url = new ActionURL(DeleteWebPartAction.class, c); url.addParameter("pageId", pageId); url.addParameter("index", index); - url.addReturnURL(returnURL); + url.addReturnUrl(returnUrl); return url; } @Override - public ActionURL getHidePortalPageURL(Container c, String pageId, ActionURL returnURL) + public ActionURL getHidePortalPageURL(Container c, String pageId, ActionURL returnUrl) { ActionURL url = new ActionURL(HidePortalPageAction.class, c); url.addParameter("pageId", pageId); - url.addReturnURL(returnURL); + url.addReturnUrl(returnUrl); return url; } @Override - public ActionURL getDeletePortalPageURL(Container c, String pageId, ActionURL returnURL) + public ActionURL getDeletePortalPageURL(Container c, String pageId, ActionURL returnUrl) { ActionURL url = new ActionURL(DeletePortalPageAction.class, c); url.addParameter("pageId", pageId); - url.addReturnURL(returnURL); + url.addReturnUrl(returnUrl); return url; } @Override - public ActionURL getDeleteWebPartURL(Container c, Portal.WebPart webPart, ActionURL returnURL) + public ActionURL getDeleteWebPartURL(Container c, Portal.WebPart webPart, ActionURL returnUrl) { - return getDeleteWebPartURL(c, webPart.getPageId(), webPart.getIndex(), returnURL); + return getDeleteWebPartURL(c, webPart.getPageId(), webPart.getIndex(), returnUrl); } @Override @@ -235,10 +235,10 @@ public ActionURL getFileBrowserURL(Container c, String path) } @Override - public ActionURL getTogglePageAdminModeURL(Container c, ActionURL returnURL) + public ActionURL getTogglePageAdminModeURL(Container c, ActionURL returnUrl) { ActionURL url = new ActionURL(TogglePageAdminModeAction.class, c); - url.addReturnURL(returnURL); + url.addReturnUrl(returnUrl); return url; } } @@ -546,7 +546,7 @@ else if (0 <= form.getIndex()) @Override public URLHelper getSuccessURL(CustomizePortletForm form) { - return form.getReturnURLHelper(beginURL()); + return form.getReturnUrlHelper(beginURL()); } } @@ -574,7 +574,7 @@ else if (0 <= form.getIndex()) @Override public URLHelper getSuccessURL(CustomizePortletForm form) { - URLHelper successURL = form.getReturnURLHelper(beginURL()); + URLHelper successURL = form.getReturnUrlHelper(beginURL()); if (null != successURL) { //Don't return to the deleted page @@ -606,7 +606,7 @@ public boolean handlePost(MovePortletForm form, BindException errors) @Override public URLHelper getSuccessURL(MovePortletForm movePortletForm) { - return movePortletForm.getReturnURLHelper(beginURL()); + return movePortletForm.getReturnUrlHelper(beginURL()); } } @@ -650,10 +650,10 @@ public URLHelper getSuccessURL(AddWebPartForm form) return new ActionURL(CustomizeWebPartAction.class, getContainer()) .addParameter("pageId", form.getPageId()) .addParameter("index", "" + _newPart.getIndex()) - .addReturnURL(form.getReturnActionURL()); + .addReturnUrl(form.getReturnActionURL()); } else - return form.getReturnURLHelper(); + return form.getReturnUrlHelper(); } @Override @@ -929,7 +929,7 @@ public boolean handlePost(CustomizePortletForm form, BindException errors) @Override public URLHelper getSuccessURL(CustomizePortletForm customizePortletForm) { - return customizePortletForm.getReturnURLHelper(beginURL()); + return customizePortletForm.getReturnUrlHelper(beginURL()); } @Override @@ -1873,7 +1873,7 @@ public boolean handlePost(ReturnUrlForm returnUrlForm, BindException errors) thr @Override public URLHelper getSuccessURL(ReturnUrlForm form) { - return form.getReturnURLHelper(beginURL()); + return form.getReturnUrlHelper(beginURL()); } } } diff --git a/core/src/org/labkey/core/project/folderNav.jsp b/core/src/org/labkey/core/project/folderNav.jsp index 1a6a87a7fb3..c87e61dcbea 100644 --- a/core/src/org/labkey/core/project/folderNav.jsp +++ b/core/src/org/labkey/core/project/folderNav.jsp @@ -63,10 +63,10 @@ ActionURL startURL = c.getStartURL(getUser()); // 30975: Return to startURL due to async view context ActionURL createProjectURL = urlProvider(AdminUrls.class).getCreateProjectURL(null); - createProjectURL.addReturnURL(startURL); + createProjectURL.addReturnUrl(startURL); ActionURL createFolderURL = urlProvider(AdminUrls.class).getCreateFolderURL(c, null); - createFolderURL.addReturnURL(startURL); + createFolderURL.addReturnUrl(startURL); ActionURL folderManagementURL = urlProvider(AdminUrls.class).getManageFoldersURL(c); if (size > 1) { // Only show the nav trail if subfolders exist diff --git a/core/src/org/labkey/core/security/SecurityController.java b/core/src/org/labkey/core/security/SecurityController.java index 0272af303a6..b6b3c9aa248 100644 --- a/core/src/org/labkey/core/security/SecurityController.java +++ b/core/src/org/labkey/core/security/SecurityController.java @@ -212,7 +212,7 @@ public ActionURL getManageGroupURL(Container container, String groupName, @Nulla { ActionURL url = new ActionURL(GroupAction.class, container); if (returnUrl != null) - url = url.addReturnURL(returnUrl); + url = url.addReturnUrl(returnUrl); return url.addParameter("group", groupName); } @@ -223,12 +223,12 @@ public ActionURL getManageGroupURL(Container container, String groupName) } @Override - public ActionURL getGroupPermissionURL(Container container, int id, @Nullable URLHelper returnURL) + public ActionURL getGroupPermissionURL(Container container, int id, @Nullable URLHelper returnUrl) { ActionURL url = new ActionURL(GroupPermissionAction.class, container); url.addParameter("id", id); - if (returnURL != null) - url.addReturnURL(returnURL); + if (returnUrl != null) + url.addReturnUrl(returnUrl); return url; } @@ -245,21 +245,21 @@ public ActionURL getPermissionsURL(Container container) } @Override - public ActionURL getPermissionsURL(Container container, @Nullable URLHelper returnURL) + public ActionURL getPermissionsURL(Container container, @Nullable URLHelper returnUrl) { ActionURL url = new ActionURL(PermissionsAction.class, container); - if (returnURL != null) - url.addReturnURL(returnURL); + if (returnUrl != null) + url.addReturnUrl(returnUrl); return url; } @Override - public ActionURL getSiteGroupsURL(Container container, @Nullable URLHelper returnURL) + public ActionURL getSiteGroupsURL(Container container, @Nullable URLHelper returnUrl) { ActionURL url = new ActionURL(PermissionsAction.class, container); url.addParameter("t", "sitegroups"); - if (returnURL != null) - url.addReturnURL(returnURL); + if (returnUrl != null) + url.addReturnUrl(returnUrl); return url; } @@ -312,7 +312,7 @@ public ActionURL getFolderAccessURL(Container container) @Override @Nullable - public ActionURL getExternalToolsViewURL(User user, Container c, @NotNull ActionURL returnURL) + public ActionURL getExternalToolsViewURL(User user, Container c, @NotNull ActionURL returnUrl) { long viewCount = ExternalToolsViewService.get().getExternalAccessViewProviders().stream() .filter(externalToolsViewProvider -> !externalToolsViewProvider.getViews(user).isEmpty()) @@ -320,7 +320,7 @@ public ActionURL getExternalToolsViewURL(User user, Container c, @NotNull Action if (viewCount > 0) { ActionURL url = new ActionURL(ExternalToolsViewAction.class, c); - url.addReturnURL(returnURL); + url.addReturnUrl(returnUrl); return url; } return null; @@ -331,7 +331,7 @@ public ActionURL getClonePermissionsURL(User targetUser, @NotNull ActionURL retu { return new ActionURL(ClonePermissionsAction.class, ContainerManager.getRoot()) .addParameter("targetUser", targetUser.getUserId()) - .addReturnURL(returnUrl); + .addReturnUrl(returnUrl); } } @@ -1511,11 +1511,11 @@ public boolean handlePost(AddUsersForm form, BindException errors) throws Except if (form.isSkipProfile()) extraParams.add(new Pair<>("skipProfile", "1")); - URLHelper returnURL = null; + URLHelper returnUrl = null; if (null != form.getReturnUrl()) { extraParams.add(new Pair<>(ActionURL.Param.returnUrl.name(), form.getReturnUrl())); - returnURL = form.getReturnURLHelper(); + returnUrl = form.getReturnUrlHelper(); } for (ValidEmail email : emails) @@ -1531,7 +1531,7 @@ public boolean handlePost(AddUsersForm form, BindException errors) throws Except { if (HtmlString.isBlank(result)) { - ActionURL url = urlProvider(UserUrls.class).getUserDetailsURL(getContainer(), newUser.getUserId(), returnURL); + ActionURL url = urlProvider(UserUrls.class).getUserDetailsURL(getContainer(), newUser.getUserId(), returnUrl); result = HtmlString.unsafe(PageFlowUtil.filter(email) + " was already a registered system user. Click here to see this user's profile and history."); } else if (userToClone != null) @@ -1932,7 +1932,7 @@ else if (!getUser().hasSiteAdminPermission() && formUser.hasSiteAdminPermission( @Override public @NotNull URLHelper getSuccessURL(UserForm form) { - return form.getReturnURLHelper(AppProps.getInstance().getHomePageActionURL()); + return form.getReturnUrlHelper(AppProps.getInstance().getHomePageActionURL()); } } @@ -1985,7 +1985,7 @@ public ModelAndView getSuccessView(UserForm form) PageFlowUtil.filter(affectedUser.getEmail()), _loginExists ? "reset" : "created", PageFlowUtil.filter(actionURL.getLocalURIString()), - PageFlowUtil.button("Done").href(form.getReturnURLHelper(AppProps.getInstance().getHomePageActionURL())) + PageFlowUtil.button("Done").href(form.getReturnUrlHelper(AppProps.getInstance().getHomePageActionURL())) ); getPageConfig().setTemplate(PageConfig.Template.Dialog); @@ -2010,7 +2010,7 @@ public ModelAndView getFailView(UserForm form, BindException errors) builder.unsafeAppend("

") .append(getErrorMessage(errors)) .unsafeAppend("

") - .append(PageFlowUtil.button("Done").href(form.getReturnURLHelper(AppProps.getInstance().getHomePageActionURL()))); + .append(PageFlowUtil.button("Done").href(form.getReturnUrlHelper(AppProps.getInstance().getHomePageActionURL()))); getPageConfig().setTemplate(PageConfig.Template.Dialog); setTitle("Password Reset Failed"); diff --git a/core/src/org/labkey/core/security/addUsers.jsp b/core/src/org/labkey/core/security/addUsers.jsp index 333f36f9f86..150a67a66a9 100644 --- a/core/src/org/labkey/core/security/addUsers.jsp +++ b/core/src/org/labkey/core/security/addUsers.jsp @@ -125,12 +125,12 @@ } %> <%=submit%> - <% if (form.getReturnURLHelper() == null) { %> + <% if (form.getReturnUrlHelper() == null) { %> <%= button("Done").href(urlFor(ShowUsersAction.class)) %> <% } else { %> - <%= button("Done").href(form.getReturnURLHelper()) %> + <%= button("Done").href(form.getReturnUrlHelper()) %> <% } %> <%=generateReturnUrlFormField(form)%> diff --git a/core/src/org/labkey/core/security/clonePermissions.jsp b/core/src/org/labkey/core/security/clonePermissions.jsp index 18fd7869e50..08387c8fc29 100644 --- a/core/src/org/labkey/core/security/clonePermissions.jsp +++ b/core/src/org/labkey/core/security/clonePermissions.jsp @@ -78,7 +78,7 @@ <%=ReturnUrlForm.generateHiddenFormField(form.getReturnActionURL())%> <%=button("Clone Permissions").submit(true)%> - <%=button("Cancel").href(form.getReturnURLHelper())%> + <%=button("Cancel").href(form.getReturnUrlHelper())%> <% diff --git a/core/src/org/labkey/core/security/externalToolsBase.jsp b/core/src/org/labkey/core/security/externalToolsBase.jsp index c670f195747..6a2b53daff9 100644 --- a/core/src/org/labkey/core/security/externalToolsBase.jsp +++ b/core/src/org/labkey/core/security/externalToolsBase.jsp @@ -24,7 +24,7 @@ <%@ taglib prefix="labkey" uri="http://www.labkey.org/taglib" %> <% ReturnUrlForm form = ((JspView) HttpView.currentView()).getModelBean(); - ActionURL alternativeURL = urlProvider(ProjectUrls.class).getBeginURL(getContainer()); - ActionURL returnURL = form.getReturnActionURL(alternativeURL); + ActionURL alternativeUrl = urlProvider(ProjectUrls.class).getBeginURL(getContainer()); + ActionURL returnUrl = form.getReturnActionURL(alternativeUrl); %> -<%= button("Done").href(returnURL) %> +<%= button("Done").href(returnUrl) %> diff --git a/core/src/org/labkey/core/security/group.jsp b/core/src/org/labkey/core/security/group.jsp index ccefcbb6584..1c8dd97ed5d 100644 --- a/core/src/org/labkey/core/security/group.jsp +++ b/core/src/org/labkey/core/security/group.jsp @@ -58,7 +58,7 @@ ActionURL completionUrl = urlFor(CompleteMemberAction.class); completionUrl.addParameter("groupId", bean.group.getUserId()); - URLHelper returnURL = getActionURL().clone().deleteParameter(ActionURL.Param.returnUrl); + URLHelper returnUrl = getActionURL().clone().deleteParameter(ActionURL.Param.returnUrl); %>
<%= button("Save").submit(true) %> - <%= button("Cancel").href(bean.getReturnURLHelper(urlProvider(AdminUrls.class).getAdminConsoleURL())) %> + <%= button("Cancel").href(bean.getReturnUrlHelper(urlProvider(AdminUrls.class).getAdminConsoleURL())) %> <%= button("Reset to Default Template").submit(true).onClick("this.form.action=" + q(urlFor(DeleteCustomEmailAction.class)) + ";").id("siteResetButton").style("display: none;")%> <%= button("Delete " + getContainer().getContainerNoun() + "-Level Template").submit(true).onClick("this.form.action=" + q(urlFor(DeleteCustomEmailAction.class)) + ";").id("folderResetButton").style("display: none;")%>