From 72e4baf4a3c12dc4feb2650a69dce8e9e0af02b9 Mon Sep 17 00:00:00 2001 From: Adam Rauch Date: Thu, 15 May 2025 11:58:18 -0700 Subject: [PATCH] Migrate to renderGridCellContents(RenderContext, HtmlWriter) --- .../PanoramaPublicController.java | 26 ++++++--- .../view/publish/CatalogEntryWebPart.java | 53 +++++++++++-------- 2 files changed, 48 insertions(+), 31 deletions(-) diff --git a/panoramapublic/src/org/labkey/panoramapublic/PanoramaPublicController.java b/panoramapublic/src/org/labkey/panoramapublic/PanoramaPublicController.java index 6e0982df..286c952a 100644 --- a/panoramapublic/src/org/labkey/panoramapublic/PanoramaPublicController.java +++ b/panoramapublic/src/org/labkey/panoramapublic/PanoramaPublicController.java @@ -7969,18 +7969,28 @@ private ModelAndView getSourceFilesView(SpectralLibrary specLib, ITargetedMSRun List spectrumFileNames = getSourceFiles(libSourceFiles, LibSourceFile::getSpectrumSourceFile); List idFileNames = getSourceFiles(libSourceFiles, LibSourceFile::getIdFile); view.addView(new HtmlView(DIV( - TABLE(TR( - TD(at(valign, "top", style, "padding:5px;"), - createTable("Spectrum Files", spectrumFileNames)), - TD(at(valign, "top", style, "padding:5px;"), - createTable("Search Results Files", idFileNames))) - )))); + TABLE(TR( + TD( + at(valign, "top", style, "padding:5px;"), + createTable("Spectrum Files", spectrumFileNames) + ), + TD( + at(valign, "top", style, "padding:5px;"), + createTable("Search Results Files", idFileNames) + ) + )) + ))); } } catch (SpecLibReaderException e) { - view.addView(new HtmlView(DIV(DIV(cl("labkey-error"), "Error reading library source files."), - DIV(ExceptionUtil.renderException(e))))); + view.addView(new HtmlView( + DIV(DIV( + cl("labkey-error"), + "Error reading library source files."), + DIV(ExceptionUtil.renderException(e)) + )) + ); } } } diff --git a/panoramapublic/src/org/labkey/panoramapublic/view/publish/CatalogEntryWebPart.java b/panoramapublic/src/org/labkey/panoramapublic/view/publish/CatalogEntryWebPart.java index 7aa2a3b5..f6fff8d4 100644 --- a/panoramapublic/src/org/labkey/panoramapublic/view/publish/CatalogEntryWebPart.java +++ b/panoramapublic/src/org/labkey/panoramapublic/view/publish/CatalogEntryWebPart.java @@ -82,32 +82,39 @@ public CatalogEntryWebPart(ExperimentAnnotations expAnnotations, User user, @Nul CatalogEntrySettings settings = CatalogEntryManager.getCatalogEntrySettings(); addView(new HtmlView( - DIV( - TABLE( - TR( - TD(at(style, "padding:0 10px 15px 0; vertical-align:top;"), U("Status:")), - TD(at(style, "vertical-align:top;"), - CatalogEntry.getStatusText(entry.getApproved()), - changeStatusBtn == null ? "" : changeStatusBtn) + DIV( + TABLE( + TR( + TD( + at(style, "padding:0 10px 15px 0; vertical-align:top;"), + U("Status:") ), - TR( - TD(at(style, "padding:0 10px 15px 0; vertical-align:top;"), U("Title:")), - TD(at(style, "vertical-align:top;"), expAnnotations.getTitle()) - ), - TR( - TD(at(style, "padding:0 10px 15px 0; vertical-align:top;"), U("Description:")), - TD(at(style, "vertical-align:top;"), entry.getDescription()) + TD( + at(style, "vertical-align:top;"), + CatalogEntry.getStatusText(entry.getApproved()), + changeStatusBtn == null ? "" : changeStatusBtn ) ), - DIV(IMG(at(src, PanoramaPublicController.getCatalogImageDownloadUrl(expAnnotations, entry.getImageFileName())) - .at(width, settings.getImgWidth()).at(height, settings.getImgHeight()) - .at(style, "margin:10px 0 15px 0;border: 1px solid lightgrey;"))), - new ButtonBuilder("Edit").href(editUrl), - HtmlString.NBSP, - new ButtonBuilder("Delete").href(deleteUrl) - .usePost("Are you sure you want to delete the Panorama Public catalog entry for this experiment?"), - returnUrl != null ? DIV(at(style, "margin-top:25px;"), new ButtonBuilder("Back").href(returnUrl)) - : HtmlString.EMPTY_STRING + TR( + TD(at(style, "padding:0 10px 15px 0; vertical-align:top;"), U("Title:")), + TD(at(style, "vertical-align:top;"), expAnnotations.getTitle()) + ), + TR( + TD(at(style, "padding:0 10px 15px 0; vertical-align:top;"), U("Description:")), + TD(at(style, "vertical-align:top;"), entry.getDescription()) + ) + ), + DIV(IMG( + at(src, PanoramaPublicController.getCatalogImageDownloadUrl(expAnnotations, entry.getImageFileName())) + .at(width, settings.getImgWidth()).at(height, settings.getImgHeight()) + .at(style, "margin:10px 0 15px 0;border: 1px solid lightgrey;") + )), + new ButtonBuilder("Edit").href(editUrl), + HtmlString.NBSP, + new ButtonBuilder("Delete").href(deleteUrl) + .usePost("Are you sure you want to delete the Panorama Public catalog entry for this experiment?"), + returnUrl != null ? DIV(at(style, "margin-top:25px;"), new ButtonBuilder("Back").href(returnUrl)) + : HtmlString.EMPTY_STRING ))); } }