|
146 | 146 | import org.labkey.api.util.ConfigurationException; |
147 | 147 | import org.labkey.api.util.ContainerContext; |
148 | 148 | import org.labkey.api.util.DOM; |
| 149 | +import org.labkey.api.util.DOM.Renderable; |
149 | 150 | import org.labkey.api.util.DateUtil; |
150 | 151 | import org.labkey.api.util.FileUtil; |
151 | 152 | import org.labkey.api.util.HelpTopic; |
|
174 | 175 | import org.labkey.api.view.WebPartView; |
175 | 176 | import org.labkey.api.view.template.ClientDependency; |
176 | 177 | import org.labkey.api.view.template.PageConfig; |
| 178 | +import org.labkey.api.writer.HtmlWriter; |
177 | 179 | import org.labkey.targetedms.chart.ChromatogramChartMakerFactory; |
178 | 180 | import org.labkey.targetedms.chart.ComparisonChartMaker; |
179 | 181 | import org.labkey.targetedms.chromlib.ChromatogramLibraryUtils; |
|
276 | 278 | import java.io.File; |
277 | 279 | import java.io.IOException; |
278 | 280 | import java.io.InputStream; |
279 | | -import java.io.PrintWriter; |
280 | 281 | import java.io.StringWriter; |
281 | 282 | import java.net.URI; |
282 | 283 | import java.net.URISyntaxException; |
|
313 | 314 | import static org.labkey.api.util.DOM.A; |
314 | 315 | import static org.labkey.api.util.DOM.Attribute.height; |
315 | 316 | import static org.labkey.api.util.DOM.Attribute.href; |
| 317 | +import static org.labkey.api.util.DOM.Attribute.id; |
316 | 318 | import static org.labkey.api.util.DOM.Attribute.method; |
317 | 319 | import static org.labkey.api.util.DOM.Attribute.src; |
| 320 | +import static org.labkey.api.util.DOM.Attribute.style; |
318 | 321 | import static org.labkey.api.util.DOM.Attribute.width; |
319 | 322 | import static org.labkey.api.util.DOM.DIV; |
320 | 323 | import static org.labkey.api.util.DOM.SPAN; |
@@ -5022,19 +5025,32 @@ public ModelAndView getView(IdForm form, BindException errors) |
5022 | 5025 | VBox result = new VBox(); |
5023 | 5026 |
|
5024 | 5027 | // Summary for this sample file |
5025 | | - DOM.Renderable renderable = DOM.TABLE(cl("lk-fields-table"), |
5026 | | - TR(TD(cl("labkey-form-label"), "Sample Identifier"), |
5027 | | - TD(materialURL == null ? sampleRow.get(SampleFileTable.SAMPLE_FIELD_KEY) : A(at(href, materialURL), _sampleFile.getSampleName()))), |
5028 | | - TR(TD(cl("labkey-form-label"), "File Path"), |
5029 | | - TD(_sampleFile.getFilePath())), |
5030 | | - TR(TD(cl("labkey-form-label"), "Acquired Time"), |
5031 | | - TD(DateUtil.formatDateTime(getContainer(), _sampleFile.getAcquiredTime()))), |
5032 | | - TR(TD(cl("labkey-form-label"), "Modified Time"), |
5033 | | - TD(DateUtil.formatDateTime(getContainer(), _sampleFile.getModifiedTime()))), |
5034 | | - TR(TD(cl("labkey-form-label"), "Instrument Serial Number"), |
5035 | | - TD(_sampleFile.getInstrumentSerialNumber())), |
5036 | | - TR(TD(cl("labkey-form-label"), "Replicate Name"), |
5037 | | - TD(replicate.getName())) |
| 5028 | + Renderable renderable = DOM.TABLE( |
| 5029 | + cl("lk-fields-table"), |
| 5030 | + TR( |
| 5031 | + TD(cl("labkey-form-label"), "Sample Identifier"), |
| 5032 | + TD(materialURL == null ? sampleRow.get(SampleFileTable.SAMPLE_FIELD_KEY) : A(at(href, materialURL), _sampleFile.getSampleName())) |
| 5033 | + ), |
| 5034 | + TR( |
| 5035 | + TD(cl("labkey-form-label"), "File Path"), |
| 5036 | + TD(_sampleFile.getFilePath()) |
| 5037 | + ), |
| 5038 | + TR( |
| 5039 | + TD(cl("labkey-form-label"), "Acquired Time"), |
| 5040 | + TD(DateUtil.formatDateTime(getContainer(), _sampleFile.getAcquiredTime())) |
| 5041 | + ), |
| 5042 | + TR( |
| 5043 | + TD(cl("labkey-form-label"), "Modified Time"), |
| 5044 | + TD(DateUtil.formatDateTime(getContainer(), _sampleFile.getModifiedTime())) |
| 5045 | + ), |
| 5046 | + TR( |
| 5047 | + TD(cl("labkey-form-label"), "Instrument Serial Number"), |
| 5048 | + TD(_sampleFile.getInstrumentSerialNumber()) |
| 5049 | + ), |
| 5050 | + TR( |
| 5051 | + TD(cl("labkey-form-label"), "Replicate Name"), |
| 5052 | + TD(replicate.getName()) |
| 5053 | + ) |
5038 | 5054 | ); |
5039 | 5055 |
|
5040 | 5056 | HtmlView summaryView = new HtmlView(renderable); |
@@ -5168,12 +5184,23 @@ public ModelAndView getView(final ProteinForm form, BindException errors) |
5168 | 5184 | ChromatogramGridView chromatogramView = new ChromatogramGridView(chromatogramRegion, errors) |
5169 | 5185 | { |
5170 | 5186 | @Override |
5171 | | - public void renderView(RenderContext model, PrintWriter out) throws IOException |
| 5187 | + public void renderView(RenderContext model, HtmlWriter out) |
5172 | 5188 | { |
5173 | | - out.write("<div style=\"display: inline-block\">\n"); |
5174 | | - out.write("<div id=\"groupChromatogramLegend\"></div>\n"); |
5175 | | - super.renderView(model, out); |
5176 | | - out.write("</div>\n"); |
| 5189 | + DIV(at(style, "display: inline-block")).appendTo(out); |
| 5190 | + DIV( |
| 5191 | + at(id, "groupChromatogramLegend"), |
| 5192 | + (Renderable) ret -> { |
| 5193 | + try |
| 5194 | + { |
| 5195 | + super.renderView(model, out); |
| 5196 | + } |
| 5197 | + catch (IOException e) |
| 5198 | + { |
| 5199 | + throw new RuntimeException(e); |
| 5200 | + } |
| 5201 | + return ret; |
| 5202 | + } |
| 5203 | + ).appendTo(out); |
5177 | 5204 | } |
5178 | 5205 | }; |
5179 | 5206 |
|
|
0 commit comments