public void writeMBeans(Map<String, List<MBeanNode>> mbeansByTitle) throws IOException { try { document.open(); for (final Map.Entry<String, List<MBeanNode>> entry : mbeansByTitle.entrySet()) { addParagraph(entry.getKey(), "mbeans.png"); new PdfMBeansReport(entry.getValue(), document).toPdf(); } } catch (final DocumentException e) { throw createIOException(e); } document.close(); }
public void writeProcessInformations( Map<String, List<ProcessInformations>> processInformationsByTitle) throws IOException { try { document.open(); for (final Map.Entry<String, List<ProcessInformations>> entry : processInformationsByTitle .entrySet()) { addParagraph(entry.getKey(), "processes.png"); new PdfProcessInformationsReport(entry.getValue(), document).toPdf(); } } catch (final DocumentException e) { throw createIOException(e); } document.close(); }
public void toPdf() throws IOException { try { document.open(); // il serait possible d'ouvrir la boƮte de dialogue Imprimer de Adobe Reader // if (writer instanceof PdfWriter) { // ((PdfWriter) writer).addJavaScript("this.print(true);", false); // } pdfCoreReport.toPdf(); } catch (final DocumentException e) { throw createIOException(e); } document.close(); }
public void writeRequestAndGraphDetail(Collector collector, CollectorServer collectorServer, Range range, String requestId) throws IOException { try { document.open(); new PdfRequestAndGraphDetailReport(collector, collectorServer, range, requestId, pdfDocumentFactory, document).toPdf(); } catch (final DocumentException e) { throw createIOException(e); } document.close(); }
@Override protected final void renderMergedOutputModel( Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception { // IE workaround: write into byte array first. ByteArrayOutputStream baos = createTemporaryOutputStream(); // Apply preferences and build metadata. Document document = newDocument(); PdfWriter writer = newWriter(document, baos); prepareWriter(model, writer, request); buildPdfMetadata(model, document, request); // Build PDF document. document.open(); buildPdfDocument(model, document, writer, request, response); document.close(); // Flush to HTTP response. writeToResponse(response, baos); }
public void writeHeapHistogram(HeapHistogram heapHistogram) throws IOException { try { document.open(); addParagraph( getFormattedString("heap_histo_du", I18N.createDateAndTimeFormat().format(heapHistogram.getTime())), "memory.png"); new PdfHeapHistogramReport(heapHistogram, document).toPdf(); } catch (final DocumentException e) { throw createIOException(e); } document.close(); }
public void writeProcessInformations(List<ProcessInformations> processInformations) throws IOException { try { document.open(); addParagraph(getString("Processus"), "processes.png"); new PdfProcessInformationsReport(processInformations, document).toPdf(); } catch (final DocumentException e) { throw createIOException(e); } document.close(); }
public void writeSessionInformations(List<SessionInformations> sessionsInformations) throws IOException { try { document.open(); addParagraph(getString("Sessions"), "system-users.png"); new PdfSessionInformationsReport(sessionsInformations, document).toPdf(); } catch (final DocumentException e) { throw createIOException(e); } document.close(); }
public void writeHotspots(List<SampledMethod> hotspots) throws IOException { try { document.open(); addParagraph(getString("hotspots"), "clock.png"); new PdfHotspotsReport(hotspots, document).toPdf(); } catch (final DocumentException e) { throw createIOException(e); } document.close(); }
public void writeMBeans(List<MBeanNode> mbeans) throws IOException { try { document.open(); addParagraph(getString("MBeans"), "mbeans.png"); new PdfMBeansReport(mbeans, document).toPdf(); } catch (final DocumentException e) { throw createIOException(e); } document.close(); }
public void writeJndi(List<JndiBinding> jndiBindings, String path) throws IOException { try { document.open(); if (path.isEmpty()) { addParagraph(getString("Arbre_JNDI"), "jndi.png"); } else { addParagraph(getFormattedString("Arbre_JNDI_pour_contexte", path), "jndi.png"); } new PdfJndiReport(jndiBindings, document).toPdf(); } catch (final DocumentException e) { throw createIOException(e); } document.close(); }
throw createIOException(e); document.close();
public void writeDatabaseInformations(DatabaseInformations databaseInformations) throws IOException { try { document.open(); final String selectedRequestName = databaseInformations.getSelectedRequestName(); addParagraph(getString("database") + " : " + getString(selectedRequestName), "db.png"); new PdfDatabaseInformationsReport(databaseInformations, document).toPdf(); } catch (final DocumentException e) { throw createIOException(e); } document.close(); }
document.close();
@Override public void export(FacesContext context, DataTable table, String filename, boolean pageOnly, boolean selectionOnly, String encodingType, MethodExpression preProcessor, MethodExpression postProcessor, ExporterOptions options, MethodExpression onTableRender) throws IOException { try { Document document = new Document(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); PdfWriter.getInstance(document, baos); this.onTableRender = onTableRender; if (preProcessor != null) { preProcessor.invoke(context.getELContext(), new Object[]{document}); } if (!document.isOpen()) { document.open(); } if (options != null) { expOptions = options; } document.add(exportPDFTable(context, table, pageOnly, selectionOnly, encodingType)); if (postProcessor != null) { postProcessor.invoke(context.getELContext(), new Object[]{document}); } document.close(); writePDFToResponse(context.getExternalContext(), baos, filename); } catch (DocumentException e) { throw new IOException(e.getMessage()); } }
@Override protected final void renderMergedOutputModel( Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception { // IE workaround: write into byte array first. ByteArrayOutputStream baos = createTemporaryOutputStream(); // Apply preferences and build metadata. Document document = newDocument(); PdfWriter writer = newWriter(document, baos); prepareWriter(model, writer, request); buildPdfMetadata(model, document, request); // Build PDF document. document.open(); buildPdfDocument(model, document, writer, request, response); document.close(); // Flush to HTTP response. writeToResponse(response, baos); }
document.close();
public void writeRuntimeDependencies(Counter counter, Range range) throws IOException { try { final Document myDocument = pdfDocumentFactory.createDocument(true); myDocument.open(); final String counterLabel = getString(counter.getName() + "Label"); final String paragraphTitle = getFormattedString("Dependance_compteur", counterLabel) + " - " + range.getLabel(); myDocument.add(pdfDocumentFactory.createParagraphElement(paragraphTitle, counter.getIconName())); new PdfRuntimeDependenciesReport(counter, myDocument).toPdf(); myDocument.close(); } catch (final DocumentException e) { throw createIOException(e); } }
public void writeCounterSummaryPerClass(Collector collector, Counter counter, String requestId, Range range) throws IOException { final List<CounterRequest> requestList = new CounterRequestAggregation(counter) .getRequestsAggregatedOrFilteredByClassName(requestId); try { document.open(); final String counterLabel = getString(counter.getName() + "Label"); final String title = getFormattedString("Statistiques_compteur", counterLabel) + " - " + range.getLabel(); addParagraph(title, counter.getIconName()); new PdfCounterReport(collector, counter, range, false, document) .writeRequests(counter.getChildCounterName(), requestList); } catch (final DocumentException e) { throw createIOException(e); } document.close(); }
public void writeThreads(List<JavaInformations> javaInformationsList) throws IOException { try { document.open(); addParagraph(getString("Threads"), "threads.png"); String eol = ""; final Font normalFont = PdfFonts.NORMAL.getFont(); for (final JavaInformations javaInformations : javaInformationsList) { addToDocument(new Phrase(eol, normalFont)); final PdfThreadInformationsReport pdfThreadInformationsReport = new PdfThreadInformationsReport( javaInformations.getThreadInformationsList(), javaInformations.isStackTraceEnabled(), pdfDocumentFactory, document); pdfThreadInformationsReport.writeIntro(javaInformations); pdfThreadInformationsReport.writeDeadlocks(); pdfThreadInformationsReport.toPdf(); eol = "\n"; } } catch (final DocumentException e) { throw createIOException(e); } document.close(); }