|
19 | 19 | import org.apache.commons.lang3.StringUtils; |
20 | 20 | import org.apache.commons.lang3.Strings; |
21 | 21 | import org.apache.commons.lang3.math.NumberUtils; |
22 | | -import org.apache.logging.log4j.LogManager; |
| 22 | +import org.apache.logging.log4j.Logger; |
23 | 23 | import org.jetbrains.annotations.NotNull; |
24 | 24 | import org.jetbrains.annotations.Nullable; |
25 | 25 | import org.json.JSONArray; |
|
76 | 76 | import org.labkey.api.util.ThumbnailUtil; |
77 | 77 | import org.labkey.api.util.URLHelper; |
78 | 78 | import org.labkey.api.util.UniqueID; |
| 79 | +import org.labkey.api.util.logging.LogHelper; |
79 | 80 | import org.labkey.api.view.ActionURL; |
80 | 81 | import org.labkey.api.view.TabStripView; |
81 | 82 | import org.labkey.api.view.ViewContext; |
|
90 | 91 |
|
91 | 92 | public class ReportUtil |
92 | 93 | { |
| 94 | + private static final Logger LOG = LogHelper.getLogger(ReportUtil.class, "Utilities to help with report rendering and management"); |
| 95 | + |
93 | 96 | public static ActionURL getScriptReportDesignerURL(ViewContext context, ScriptReportBean bean) |
94 | 97 | { |
95 | 98 | ActionURL url = PageFlowUtil.urlProvider(ReportUrls.class).urlCreateScriptReport(context.getContainer()); |
@@ -395,7 +398,7 @@ public static void addErrors(List<ValidationError> reportErrors, Errors errors) |
395 | 398 |
|
396 | 399 | public static String getErrors(List<ValidationError> reportErrors) |
397 | 400 | { |
398 | | - StringBuffer sb = new StringBuffer(); |
| 401 | + StringBuilder sb = new StringBuilder(); |
399 | 402 | for (ValidationError error : reportErrors) |
400 | 403 | sb.append(error.getMessage()).append("\n"); |
401 | 404 |
|
@@ -527,31 +530,6 @@ public static boolean isInherited(CustomViewInfo view, Container container) |
527 | 530 | return false; |
528 | 531 | } |
529 | 532 |
|
530 | | - public static JSONArray getCreateReportButtons(ViewContext context) |
531 | | - { |
532 | | - List<ReportService.DesignerInfo> designers = new ArrayList<>(); |
533 | | - for (ReportService.UIProvider provider : ReportService.get().getUIProviders()) |
534 | | - designers.addAll(provider.getDesignerInfo(context)); |
535 | | - |
536 | | - designers.sort(Comparator.comparing(ReportService.DesignerInfo::getLabel)); |
537 | | - |
538 | | - JSONArray json = new JSONArray(); |
539 | | - |
540 | | - for (ReportService.DesignerInfo info : designers) |
541 | | - { |
542 | | - JSONObject o = new JSONObject(); |
543 | | - |
544 | | - o.put("text", info.getLabel()); |
545 | | - o.put("id", info.getId()); |
546 | | - o.put("disabled", info.isDisabled()); |
547 | | - o.put("icon", info.getIconURL().getLocalURIString()); |
548 | | - o.put("redirectUrl", info.getDesignerURL().getLocalURIString()); |
549 | | - |
550 | | - json.put(o); |
551 | | - } |
552 | | - return json; |
553 | | - } |
554 | | - |
555 | 533 | public static Report getReportById(ViewContext viewContext, String reportIdString) |
556 | 534 | { |
557 | 535 | ReportIdentifier reportId = ReportService.get().getReportIdentifier(reportIdString, viewContext.getUser(), viewContext.getContainer()); |
@@ -609,7 +587,7 @@ public static String createReportSessionId() |
609 | 587 | */ |
610 | 588 | public static String makeExceptionString(Exception e, String formatString) |
611 | 589 | { |
612 | | - LogManager.getLogger(ReportUtil.class).error("Error executing script - makeExceptionString", e); |
| 590 | + LOG.warn("Error executing script", e); |
613 | 591 | final String error1 = "Error executing command"; |
614 | 592 | final String error2 = PageFlowUtil.filter(e.getMessage()); |
615 | 593 | return String.format(formatString, error1, error2); |
|
0 commit comments