diff --git a/api/src/org/labkey/api/jsp/LabKeyJspWriter.java b/api/src/org/labkey/api/jsp/LabKeyJspWriter.java index c8b835ffba4..5f106580dcc 100644 --- a/api/src/org/labkey/api/jsp/LabKeyJspWriter.java +++ b/api/src/org/labkey/api/jsp/LabKeyJspWriter.java @@ -32,15 +32,25 @@ public class LabKeyJspWriter extends JspWriterWrapper } @Override - public void print(char[] s) + public void print(char[] c) { - throwException("A JSP is attempting to render a character array!"); + String s = new String(c); + throwException("A JSP is attempting to render a character array! " + truncateAndQuote(s)); + } + + private String truncateAndQuote(String s) + { + if (s == null) + { + return null; + } + return "'" + (s.length() < 50 ? s : (s.substring(0, 50) + "...")) + "'"; } @Override public void print(String s) throws IOException { - throwException("A JSP is attempting to render a string!"); + throwException("A JSP is attempting to render a string! " + truncateAndQuote(s)); } @Override diff --git a/api/src/org/labkey/api/util/UsageReportingLevel.java b/api/src/org/labkey/api/util/UsageReportingLevel.java index 3dff5497774..37a7ead98ac 100644 --- a/api/src/org/labkey/api/util/UsageReportingLevel.java +++ b/api/src/org/labkey/api/util/UsageReportingLevel.java @@ -52,75 +52,103 @@ public enum UsageReportingLevel implements SafeToRenderEnum { NONE - { - @Override - protected void addExtraParams(MothershipReport report, Map metrics) - { - // no op - } + { + @Override + protected void addExtraParams(MothershipReport report, Map metrics) + { + // no op + } - @Override - protected boolean doGeneration() - { - return false; - } - }, + @Override + public boolean showUpgradeBanner() + { + return false; + } + + @Override + protected boolean doGeneration() + { + return false; + } + }, /** * Captures basic User info, container count information and Site Settings info to help identify the organization * running the installation, and more detailed stats about how many items exist or actions have been invoked. - * + *

* May capture site-wide usage information, including counts for certain data types, such as assay designs, * reports of a specific type, or lists. May also capture the number of times a certain feature was used in a * given time window, such as since the server was last restarted. - * + *

* Per policy, this should not capture the names of specific objects like container names, dataset names, etc. - * + *

* Also per policy, this should not capture metrics at a container or other similar granularity. For example, * metrics should not break down the number of lists defined in each folder (even if that folder was de-identified). */ ON - { - @Override - protected void addExtraParams(MothershipReport report, Map metrics) - { - report.addParam("userCount", UserManager.getActiveUserCount()); - - report.addParam("containerCount", ContainerManager.getContainerCount()); - report.addParam("projectCount", ContainerManager.getRoot().getChildren().size()); - metrics.put("droppedExceptionCount", MothershipReport.getDroppedExceptionCount()); - - // Users within the last 30 days - Calendar cal = new GregorianCalendar(); - cal.add(Calendar.DATE, -30); - Date startDate = cal.getTime(); - report.addParam("recentUserCount", UserManager.getRecentUserCount(startDate)); - // Other counts within the last 30 days - metrics.put("recentLoginCount", UserManager.getRecentLoginCount(startDate)); - metrics.put("recentLogoutCount", UserManager.getRecentLogOutCount(startDate)); - metrics.put("activeDayCount", UserManager.getActiveDaysCount(startDate)); - metrics.put("recentAvgSessionDuration", UserManager.getAverageSessionDuration()); - metrics.put("mostRecentLogin", DateUtil.formatIsoDate(UserManager.getMostRecentLogin())); - - LookAndFeelProperties laf = LookAndFeelProperties.getInstance(ContainerManager.getRoot()); - report.addParam("logoLink", laf.getLogoHref()); - report.addParam("organizationName", laf.getCompanyName()); - report.addParam("systemDescription", laf.getDescription()); - report.addParam("systemShortName", laf.getShortName()); - report.addParam("administratorEmail", AppProps.getInstance().getAdministratorContactEmail(true)); - - @SuppressWarnings("unchecked") - Map> modulesMap = (Map>)metrics.computeIfAbsent("modules", s -> new TreeMap<>(String.CASE_INSENSITIVE_ORDER)); - - putModulesMetrics(modulesMap); - putModulesBuildInfo(modulesMap); - - metrics.put("folderTypeCounts", ContainerManager.getFolderTypeNameContainerCounts(ContainerManager.getRoot())); - metrics.put("auditCommentsRequiredContainerCount", ContainerManager.getAuditCommentRequiredCount()); - - report.addHostName(); - } - }; + { + @Override + protected void addExtraParams(MothershipReport report, Map metrics) + { + report.addParam("userCount", UserManager.getActiveUserCount()); + + report.addParam("containerCount", ContainerManager.getContainerCount()); + report.addParam("projectCount", ContainerManager.getRoot().getChildren().size()); + metrics.put("droppedExceptionCount", MothershipReport.getDroppedExceptionCount()); + + // Users within the last 30 days + Calendar cal = new GregorianCalendar(); + cal.add(Calendar.DATE, -30); + Date startDate = cal.getTime(); + report.addParam("recentUserCount", UserManager.getRecentUserCount(startDate)); + // Other counts within the last 30 days + metrics.put("recentLoginCount", UserManager.getRecentLoginCount(startDate)); + metrics.put("recentLogoutCount", UserManager.getRecentLogOutCount(startDate)); + metrics.put("activeDayCount", UserManager.getActiveDaysCount(startDate)); + metrics.put("recentAvgSessionDuration", UserManager.getAverageSessionDuration()); + metrics.put("mostRecentLogin", DateUtil.formatIsoDate(UserManager.getMostRecentLogin())); + + LookAndFeelProperties laf = LookAndFeelProperties.getInstance(ContainerManager.getRoot()); + report.addParam("logoLink", laf.getLogoHref()); + report.addParam("organizationName", laf.getCompanyName()); + report.addParam("systemDescription", laf.getDescription()); + report.addParam("systemShortName", laf.getShortName()); + report.addParam("administratorEmail", AppProps.getInstance().getAdministratorContactEmail(true)); + + @SuppressWarnings("unchecked") + Map> modulesMap = (Map>) metrics.computeIfAbsent("modules", s -> new TreeMap<>(String.CASE_INSENSITIVE_ORDER)); + + putModulesMetrics(modulesMap); + putModulesBuildInfo(modulesMap); + + metrics.put("folderTypeCounts", ContainerManager.getFolderTypeNameContainerCounts(ContainerManager.getRoot())); + metrics.put("auditCommentsRequiredContainerCount", ContainerManager.getAuditCommentRequiredCount()); + + report.addHostName(); + } + + @Override + public boolean showUpgradeBanner() + { + return true; + } + }, + ON_WITHOUT_UPGRADE_MESSAGE + { + @Override + protected void addExtraParams(MothershipReport report, Map metrics) + { + ON.addExtraParams(report, metrics); + } + + @Override + public boolean showUpgradeBanner() + { + return false; + } + }; + + public abstract boolean showUpgradeBanner(); protected abstract void addExtraParams(MothershipReport report, Map metrics); diff --git a/core/src/org/labkey/core/admin/customizeSite.jsp b/core/src/org/labkey/core/admin/customizeSite.jsp index 2375239879b..45744f30fc5 100644 --- a/core/src/org/labkey/core/admin/customizeSite.jsp +++ b/core/src/org/labkey/core/admin/customizeSite.jsp @@ -63,7 +63,7 @@ var enableExceptionTest = function() { }; var enableTestButton = function(el, level) { - if ("NONE" == level) + if ("NONE" === level) { LABKEY.Utils.addClass(el, 'labkey-disabled-button'); } @@ -122,22 +122,23 @@ Click the Save button at any time to accept the current settings and continue. -<%=getTroubleshooterWarning(hasAdminOpsPerms, HtmlString.unsafe("\n" + - "  \n" + - " \n" + - " \n" + - " "), HtmlString.unsafe("\n" + +<%=getTroubleshooterWarning(hasAdminOpsPerms, HtmlString.unsafe(""" + +   + + + """), HtmlString.unsafe("\n" + " "))%>   - Set site administrators (<%=bean.getSiteSettingsHelpLink("siteadmins")%>) + Set site administrator (<%=bean.getSiteSettingsHelpLink("siteadmins")%>) - Primary site administrator + - Use "path first" urls (/home/project-begin.view) + @@ -172,13 +173,12 @@ Click the Save button at any time to accept the current settings and continue. - Automatically check for updates to LabKey Server and - report usage statistics to LabKey. (<%=bean.getSiteSettingsHelpLink("usage")%>) + Automatically check for updates and report usage statistics. (<%=bean.getSiteSettingsHelpLink("usage")%>) Check for updates and report usage statistics to the LabKey team.
- LabKey uses this data to prioritize LabKey Server enhancements. Turn this on to ensure the + LabKey uses this data to prioritize enhancements. Turn this on to ensure the features you use are maintained and improved over time.
All data is transmitted securely over HTTPS. @@ -189,7 +189,6 @@ Click the Save button at any time to accept the current settings and continue. Update checks and usage reporting are automatically on for servers running a LabKey Server Community Edition. - <% } @@ -198,19 +197,28 @@ Click the Save button at any time to accept the current settings and continue. -