diff --git a/announcements/src/org/labkey/announcements/announcementWebPartWithExpandos.jsp b/announcements/src/org/labkey/announcements/announcementWebPartWithExpandos.jsp index a86c9008d02..4322dc4b7ed 100644 --- a/announcements/src/org/labkey/announcements/announcementWebPartWithExpandos.jsp +++ b/announcements/src/org/labkey/announcements/announcementWebPartWithExpandos.jsp @@ -223,7 +223,7 @@ for (AnnouncementModel a : bean.announcementModels) } if (!bean.isPrint) { - %>
Default values set here will be inherited by all sub-folders that use this table and do not specify their own defaults.
"); diff --git a/api/src/org/labkey/api/jsp/JspBase.java b/api/src/org/labkey/api/jsp/JspBase.java index 922b833e0c0..22c7298d790 100644 --- a/api/src/org/labkey/api/jsp/JspBase.java +++ b/api/src/org/labkey/api/jsp/JspBase.java @@ -443,7 +443,7 @@ public LinkBuilder iconLink(String iconCls, String tooltip, URLHelper url) public LinkBuilder link(String text) { - return new LinkBuilder(text); + return LinkBuilder.labkeyLink(text); } public LinkBuilder link(Renderable html) @@ -460,12 +460,12 @@ public LinkBuilder link(String text, @NotNull Class extends Controller> action // Link to a URLHelper public LinkBuilder link(String text, @NotNull URLHelper url) { - return link(text).href(url); + return LinkBuilder.labkeyLink(text, url); } public LinkBuilder link(String text, @NotNull String url) { - return link(text).href(url); + return LinkBuilder.labkeyLink(text, url); } public LinkBuilder link(Renderable html, @NotNull URLHelper url) @@ -473,12 +473,36 @@ public LinkBuilder link(Renderable html, @NotNull URLHelper url) return new LinkBuilder(html).href(url); } + // Simple, unstyled link + public LinkBuilder simpleLink(String text) + { + return LinkBuilder.simpleLink(text); + } + // Simple, unstyled link public LinkBuilder simpleLink(String text, @NotNull URLHelper url) { return LinkBuilder.simpleLink(text, url); } + // Simple, unstyled link + public LinkBuilder simpleLink(String text, @NotNull String url) + { + return LinkBuilder.simpleLink(text, url); + } + + // Simple, unstyled link + public LinkBuilder simpleLink(Renderable html) + { + return LinkBuilder.simpleLink(html); + } + + // Simple, unstyled link + public LinkBuilder simpleLink(Renderable html, @NotNull URLHelper url) + { + return LinkBuilder.simpleLink(html, url); + } + public InputBuilder> input() { return new InputBuilder<>(); diff --git a/api/src/org/labkey/api/query/QueryView.java b/api/src/org/labkey/api/query/QueryView.java index a639c322647..0df9e4ebc03 100644 --- a/api/src/org/labkey/api/query/QueryView.java +++ b/api/src/org/labkey/api/query/QueryView.java @@ -84,6 +84,7 @@ import org.labkey.api.util.ExceptionUtil; import org.labkey.api.util.FileUtil; import org.labkey.api.util.GUID; +import org.labkey.api.util.LinkBuilder; import org.labkey.api.util.PageFlowUtil; import org.labkey.api.util.Pair; import org.labkey.api.util.ResponseHelper; @@ -393,7 +394,7 @@ protected void renderErrors(PrintWriter out, String message, List extends Thro if (getUser().isPlatformDeveloper()) { out.write(" "); - out.print(PageFlowUtil.link(StringUtils.defaultString(resolveText, "resolve")).href(resolveURL)); + out.print(LinkBuilder.labkeyLink(StringUtils.defaultString(resolveText, "resolve"), resolveURL)); } } out.write("To use the template, fill in the values, select the entire spreadsheet (Ctrl-A), copy it to the clipboard, and paste it into the text area below.")) %> <%=link("download template").href(request.getContextPath()+"/study/assay/SampleLookupTemplate.xls")%>
To use the template, fill in the values, select the entire spreadsheet (Ctrl-A), copy it to the clipboard, and paste it into the text area below.")) %> <%=link("download template", request.getContextPath()+"/study/assay/SampleLookupTemplate.xls")%>
This folder inherits its pipeline root settings from the folder '");
html.append(root.getContainer().getPath());
html.unsafeAppend("'.
You can either ");
- html.append(PageFlowUtil.link("override", urlOverride));
+ html.append(LinkBuilder.labkeyLink("override", urlOverride));
html.unsafeAppend(" the inherited settings in this folder,
or ");
- html.append(PageFlowUtil.link("modify the setting for all folders", urlEditParent));
+ html.append(LinkBuilder.labkeyLink("modify the setting for all folders", urlEditParent));
html.unsafeAppend(" by setting the value in the folder '");
html.append(root.getContainer().getPath());
html.unsafeAppend("'.
The connection using the supplied credentials was not successful.
-<%=link("manage remote connections").href(QueryController.RemoteQueryConnectionUrls.urlManageRemoteConnection(getContainer()))%> +<%=link("manage remote connections", QueryController.RemoteQueryConnectionUrls.urlManageRemoteConnection(getContainer()))%> diff --git a/query/src/org/labkey/query/view/testRemoteConnectionsSuccess.jsp b/query/src/org/labkey/query/view/testRemoteConnectionsSuccess.jsp index bdc69132c0d..52dac981c74 100644 --- a/query/src/org/labkey/query/view/testRemoteConnectionsSuccess.jsp +++ b/query/src/org/labkey/query/view/testRemoteConnectionsSuccess.jsp @@ -21,4 +21,4 @@The connection using the supplied credentials was successful.
-<%=link("manage remote connections").href(QueryController.RemoteQueryConnectionUrls.urlManageRemoteConnection(getContainer()))%> +<%=link("manage remote connections", QueryController.RemoteQueryConnectionUrls.urlManageRemoteConnection(getContainer()))%> diff --git a/specimen/src/org/labkey/specimen/actions/ShowUploadSpecimensAction.java b/specimen/src/org/labkey/specimen/actions/ShowUploadSpecimensAction.java index 8cb118d7dc8..ea53ca904ea 100644 --- a/specimen/src/org/labkey/specimen/actions/ShowUploadSpecimensAction.java +++ b/specimen/src/org/labkey/specimen/actions/ShowUploadSpecimensAction.java @@ -31,6 +31,7 @@ import org.labkey.api.security.RequiresPermission; import org.labkey.api.security.User; import org.labkey.api.security.permissions.AdminPermission; +import org.labkey.api.util.LinkBuilder; import org.labkey.specimen.importer.SimpleSpecimenImporter; import org.labkey.specimen.settings.RepositorySettings; import org.labkey.api.study.Study; @@ -314,9 +315,9 @@ public ModelAndView getView(Object o, BindException errors) return new HtmlView( HtmlStringBuilder.of("Specimens uploaded successfully.") .append(HtmlString.BR).append(HtmlString.BR) - .append(PageFlowUtil.link("study home", homeLink)) + .append(LinkBuilder.labkeyLink("study home", homeLink)) .append(" ") - .append(PageFlowUtil.link("specimens", samplesLink) + .append(LinkBuilder.labkeyLink("specimens", samplesLink) ) ); } diff --git a/specimen/src/org/labkey/specimen/actions/SpecimenController.java b/specimen/src/org/labkey/specimen/actions/SpecimenController.java index 94674b80544..52650107fed 100644 --- a/specimen/src/org/labkey/specimen/actions/SpecimenController.java +++ b/specimen/src/org/labkey/specimen/actions/SpecimenController.java @@ -4099,8 +4099,8 @@ public ModelAndView getView(UpdateParticipantCommentsForm specimenCommentsForm, errors.reject(ERROR_MSG, e.getMessage()); } } - if (selectedVials == null || selectedVials.size() == 0) - return HtmlView.unsafe("No vials selected. " + PageFlowUtil.link("back").onClick("back()")); + if (selectedVials == null || selectedVials.isEmpty()) + return HtmlView.unsafe("No vials selected. " + LinkBuilder.labkeyLink("back").onClick("back()")); } return new JspView<>("/org/labkey/specimen/view/updateComments.jsp", @@ -4387,7 +4387,7 @@ public class RequestHistoryAction extends SimpleViewAction| <%=link("Export to Excel").href(downloadURL.replaceParameter("export", "xls"))%> | +<%=link("Export to Excel", downloadURL.replaceParameter("export", "xls"))%> |
| <%=link("Export to text file").href(downloadURL.replaceParameter("export", "tsv")) %> | +<%=link("Export to text file", downloadURL.replaceParameter("export", "tsv")) %> |
| <%= link("View Request").href(SpecimenController.getManageRequestURL(getContainer(), requirement.getRequestId(), null))%> | +<%= link("View Request", SpecimenController.getManageRequestURL(getContainer(), requirement.getRequestId(), null))%> | <%=link("delete").href(urlFor(DeleteStatusAction.class).addParameter("id", status.getRowId())).usePost()%> | +<%=link("delete", urlFor(DeleteStatusAction.class).addParameter("id", status.getRowId())).usePost()%> | <% } %> diff --git a/specimen/src/org/labkey/specimen/view/specimen.jsp b/specimen/src/org/labkey/specimen/view/specimen.jsp index e2bf2e5a3ae..97327250312 100644 --- a/specimen/src/org/labkey/specimen/view/specimen.jsp +++ b/specimen/src/org/labkey/specimen/view/specimen.jsp @@ -97,10 +97,10 @@ if (comment != null) <% } } -if (bean.getReturnUrl() != null && bean.getReturnUrl().length() > 0) +if (bean.getReturnUrl() != null && !bean.getReturnUrl().isEmpty()) { %> -
| "); if (_prevURL != null) { - PageFlowUtil.link("Previous " + subjectNoun).href(_prevURL).appendTo(out); + LinkBuilder.labkeyLink("Previous " + subjectNoun, _prevURL).appendTo(out); out.print(" "); } if (_nextURL != null) { - PageFlowUtil.link("Next " + subjectNoun).href(_nextURL).appendTo(out); + LinkBuilder.labkeyLink("Next " + subjectNoun, _nextURL).appendTo(out); out.print(" "); } @@ -5970,7 +5971,7 @@ protected void renderInternal(Object model, PrintWriter out) if (null != _currentParticipantId && null != ss) { ActionURL search = urlProvider(SearchUrls.class).getSearchURL(c, "+" + ss.escapeTerm(_currentParticipantId)); - PageFlowUtil.link("Search for '" + id(_currentParticipantId, c, user) + "'").href(search).appendTo(out); + LinkBuilder.labkeyLink("Search for '" + id(_currentParticipantId, c, user) + "'", search).appendTo(out); out.print(" "); } @@ -5984,7 +5985,7 @@ protected void renderInternal(Object model, PrintWriter out) customizeURL.addReturnUrl(getViewContext().getActionURL()); customizeURL.addParameter("participantId", _currentParticipantId); out.print(" | "); - PageFlowUtil.link("Customize View").href(customizeURL).appendTo(out); + LinkBuilder.labkeyLink("Customize View", customizeURL).appendTo(out); } if (_display != null) diff --git a/study/src/org/labkey/study/query/CohortQueryView.java b/study/src/org/labkey/study/query/CohortQueryView.java index ba06d86c943..27043f46662 100644 --- a/study/src/org/labkey/study/query/CohortQueryView.java +++ b/study/src/org/labkey/study/query/CohortQueryView.java @@ -137,7 +137,7 @@ public void renderGridCellContents(RenderContext ctx, Writer oldWriter, HtmlWrit ActionURL actionURL = new ActionURL(CohortController.DeleteCohortAction.class, folder); actionURL.addParameter("rowId", rowId.toString()); - oldWriter.write(new LinkBuilder("delete").href(actionURL).usePost().toString()); + oldWriter.write(LinkBuilder.labkeyLink("delete", actionURL).usePost().toString()); } else { diff --git a/study/src/org/labkey/study/query/DatasetQueryView.java b/study/src/org/labkey/study/query/DatasetQueryView.java index 2e4274043dd..856063fc740 100644 --- a/study/src/org/labkey/study/query/DatasetQueryView.java +++ b/study/src/org/labkey/study/query/DatasetQueryView.java @@ -78,6 +78,7 @@ import org.labkey.api.study.TimepointType; import org.labkey.api.study.model.ParticipantGroup; import org.labkey.api.util.GUID; +import org.labkey.api.util.LinkBuilder; import org.labkey.api.util.PageFlowUtil; import org.labkey.api.util.StringExpression; import org.labkey.api.view.ActionURL; @@ -345,7 +346,7 @@ public void renderGridCellContents(RenderContext ctx, Writer oldWriter, HtmlWrit { ActionURL dataURL = new ActionURL(StudyController.DatasetItemDetailsAction.class, getContainer()); dataURL.addParameter("sourceLsid", lsid.toString()); - PageFlowUtil.link("assay").href(dataURL).appendTo(oldWriter); + LinkBuilder.labkeyLink("assay", dataURL).appendTo(oldWriter); return; } } diff --git a/study/src/org/labkey/study/query/StudyPropertiesQueryView.java b/study/src/org/labkey/study/query/StudyPropertiesQueryView.java index 3d314245cdc..6b01d6e8f02 100644 --- a/study/src/org/labkey/study/query/StudyPropertiesQueryView.java +++ b/study/src/org/labkey/study/query/StudyPropertiesQueryView.java @@ -20,6 +20,7 @@ import org.labkey.api.data.RenderContext; import org.labkey.api.data.SimpleDisplayColumn; import org.labkey.api.security.User; +import org.labkey.api.util.LinkBuilder; import org.labkey.api.util.PageFlowUtil; import org.labkey.api.view.ActionURL; import org.labkey.api.view.DataView; @@ -83,7 +84,7 @@ public EditColumn(Container container) public void renderGridCellContents(RenderContext ctx, Writer oldWriter, HtmlWriter out) { ActionURL actionURL = new ActionURL(StudyPropertiesController.UpdateAction.class, container); - PageFlowUtil.link("edit").href(actionURL).appendTo(oldWriter); + LinkBuilder.labkeyLink("edit", actionURL).appendTo(oldWriter); } } } diff --git a/study/src/org/labkey/study/view/manageTimepoints.jsp b/study/src/org/labkey/study/view/manageTimepoints.jsp index e440c35c5c5..76329d91525 100644 --- a/study/src/org/labkey/study/view/manageTimepoints.jsp +++ b/study/src/org/labkey/study/view/manageTimepoints.jsp @@ -54,7 +54,7 @@ | ||
| Assign data to the correct timepoint | -<%=link("Recompute Timepoints").href(urlFor(UpdateParticipantVisitsAction.class)).usePost()%> | +<%=link("Recompute Timepoints", urlFor(UpdateParticipantVisitsAction.class)).usePost()%> | |
| <%=innerHtml%> | diff --git a/wiki/src/org/labkey/wiki/LinkBarView.java b/wiki/src/org/labkey/wiki/LinkBarView.java index e96921cc784..d3ea7f6e89b 100644 --- a/wiki/src/org/labkey/wiki/LinkBarView.java +++ b/wiki/src/org/labkey/wiki/LinkBarView.java @@ -16,6 +16,7 @@ package org.labkey.wiki; +import org.labkey.api.util.LinkBuilder; import org.labkey.api.util.PageFlowUtil; import org.labkey.api.view.NavTree; import org.labkey.api.view.WebPartView; @@ -49,7 +50,7 @@ protected void renderView(Object model, PrintWriter out) out.write("
| "); for (NavTree link : _links) { - out.write(PageFlowUtil.link(link.getText()).href(link.getHref()) + " "); + out.write(LinkBuilder.labkeyLink(link.getText(), link.getHref()) + " "); } out.write(" |
| "); - PageFlowUtil.link("expand all").onClick("LABKEY.wiki.internal.Wiki.adjustAllTocEntries('NavTree-" + getId() + "', true, true)").appendTo(out); - PageFlowUtil.link("collapse all").onClick("LABKEY.wiki.internal.Wiki.adjustAllTocEntries('NavTree-" + getId() + "', true, false)").appendTo(out); + LinkBuilder.labkeyLink("expand all").onClick("LABKEY.wiki.internal.Wiki.adjustAllTocEntries('NavTree-" + getId() + "', true, true)").appendTo(out); + LinkBuilder.labkeyLink("collapse all").onClick("LABKEY.wiki.internal.Wiki.adjustAllTocEntries('NavTree-" + getId() + "', true, false)").appendTo(out); } out.println(" | \n