Examples of DebugHtmlString


Examples of org.apache.isis.core.commons.debug.DebugHtmlString

    }

    private void specification(final Request request, final ObjectSpecification spec) {
        request.appendHtml("<h1>Specification - " + spec.getFullIdentifier() + "</h1>");
        request.appendHtml("<p><a href=\"./debug.shtml?type=specification-graph&value=" + spec.getFullIdentifier() + "\">Specification Graph</a></p>");
        final DebugBuilder debug = new DebugHtmlString();
        specification(spec, debug);
        request.appendHtml(debug.toString());
    }
View Full Code Here

Examples of org.apache.isis.core.commons.debug.DebugHtmlString

        request.appendHtml("</pre>");
    }

    private void displayContext(final Request request) {
        request.appendHtml("<h1>Context</h1>");
        final DebugHtmlString debugString = new DebugHtmlString();
        request.getContext().append(debugString);
        request.appendHtml(debugString.toString());
    }
View Full Code Here

Examples of org.apache.isis.core.commons.debug.DebugHtmlString

        request.appendHtml(debugString.toString());
    }

    private void displayDispatcher(final Request request) {
        request.appendHtml("<h1>Dispatcher</h1>");
        final DebugHtmlString debugString = new DebugHtmlString();
        dispatcher.debug(debugString);
        request.appendHtml(debugString.toString());
    }
View Full Code Here

Examples of org.apache.isis.core.commons.debug.DebugHtmlString

        request.appendHtml(debugString.toString());
    }

    protected void displayVariables(final Request request) {
        request.appendHtml("<h1>Variables</h1>");
        final DebugHtmlString debug = new DebugHtmlString();
        final RequestContext context = request.getContext();
        context.append(debug, "variables");
        request.appendHtml(debug.toString());
    }
View Full Code Here

Examples of org.apache.isis.core.commons.debug.DebugHtmlString

    protected void displaySystem(final Request request) {
        request.appendHtml("<h1>System</h1>");
        final DebuggableWithTitle[] debug = IsisContext.debugSystem();
        for (final DebuggableWithTitle element2 : debug) {
            final DebugHtmlString str = new DebugHtmlString();
            str.appendTitle(element2.debugTitle());
            element2.debugData(str);
            request.appendHtml(str.toString());
        }
    }
View Full Code Here

Examples of org.apache.isis.core.commons.debug.DebugHtmlString

    protected void listSpecifications(final Request request) {
        request.appendHtml("<h1>Specifications</h1>");
        final List<ObjectSpecification> fullIdentifierList = new ArrayList<ObjectSpecification>(getSpecificationLoader().allSpecifications());
        Collections.sort(fullIdentifierList, ObjectSpecification.COMPARATOR_SHORT_IDENTIFIER_IGNORE_CASE);
        final DebugHtmlString debug = new DebugHtmlString();
        for (final ObjectSpecification spec : fullIdentifierList) {
            final String name = spec.getSingularName();
            debug.appendln(name, specificationLink(spec));
        }
        request.appendHtml(debug.toString());
    }
View Full Code Here

Examples of org.apache.isis.core.commons.debug.DebugHtmlString

                final AuthenticationSession session = IsisContext.getAuthenticationSession();
                request.appendHtml("Session:  " + session.getUserName() + " " + session.getRoles());
                request.appendHtml("</pre>");
            } else if ("variables".equals(type)) {
                final RequestContext context = request.getContext();
                final DebugHtmlString debug = new DebugHtmlString();
                debug.appendln("", "");
                context.append(debug, "variables");
                debug.close();
                request.appendHtml(debug.toString());
            } else if ("processing".equals(type)) {
                request.appendHtml("<pre>");
                request.appendHtml(request.getContext().getDebugTrace());
                request.appendHtml("</pre>");
            } else {
View Full Code Here

Examples of org.apache.isis.core.commons.debug.DebugHtmlString

    }

    private void prepareErrorDetails(final Throwable exception, final RequestContext requestContext,
        final String errorRef, final String servletPath) {
        final DebugString debugText = new DebugString();
        final DebugHtmlString debugHtml = new DebugHtmlString();
        final DebugBuilder debug = new DebugTee(debugText, debugHtml);

        try {
            debug.startSection("Exception");
            debug.appendException(exception);
            debug.endSection();
        } catch (final RuntimeException e) {
            debug.appendln("NOTE - an exception occurred while dumping an exception!");
            debug.appendException(e);
        }

        if (IsisContext.getCurrentTransaction() != null) {
            final List<String> messages = IsisContext.getMessageBroker().getMessages();
            final List<String> warnings = IsisContext.getMessageBroker().getWarnings();
            if (messages.size() > 0 || messages.size() > 0) {
                debug.startSection("Warnings/Messages");
                for (final String message : messages) {
                    debug.appendln("message", message);
                }
                for (final String message : warnings) {
                    debug.appendln("warning", message);
                }
            }
        }

        requestContext.append(debug);

        debug.startSection("Processing Trace");
        debug.appendPreformatted(requestContext.getDebugTrace());
        debug.endSection();
        debug.close();

        PrintWriter writer;
        try {
            final String directory =
                IsisContext.getConfiguration().getString(ConfigurationConstants.ROOT + "scimpi.error-snapshots", ".");
            File dir = new File(directory);
            if (!dir.exists()) {
                dir.mkdirs();
            }
            writer = new PrintWriter(new File(dir, "error_" + errorRef + ".html"));
            final DebugWriter writer2 = new DebugWriter(writer, true);
            writer2.concat(debugHtml);
            writer2.close();
            writer.close();
        } catch (final FileNotFoundException e) {
            LOG.error("Failed to archive error page", e);
        }

        final String replace = "";
        final String withReplacement = "";
        final String message = exception.getMessage();
        requestContext.addVariable("_error-message",
            message == null ? "" : message.replaceAll(replace, withReplacement), Scope.ERROR);
        requestContext.addVariable("_error-details", debugHtml.toString().replaceAll(replace, withReplacement),
            Scope.ERROR);
        requestContext.addVariable("_error-ref", errorRef, Scope.ERROR);
        requestContext.clearTransientVariables();

        final String msg = "failed during request for " + servletPath;
View Full Code Here

Examples of org.apache.isis.core.commons.debug.DebugHtmlString

    private void specification(final Request request, final ObjectSpecification spec) {
        request.appendHtml("<h1>Specification - " + spec.getFullIdentifier() + "</h1>");
        request.appendHtml("<p><a href=\"./debug.shtml?type=specification-graph&value=" + spec.getFullIdentifier()
            + "\">Specification Graph</a></p>");
        final DebugBuilder debug = new DebugHtmlString();
        specification(spec, debug);
        request.appendHtml(debug.toString());
    }
View Full Code Here

Examples of org.apache.isis.core.commons.debug.DebugHtmlString

        request.appendHtml("</pre>");
    }

    private void displayContext(final Request request) {
        request.appendHtml("<h1>Context</h1>");
        final DebugHtmlString debugString = new DebugHtmlString();
        request.getContext().append(debugString);
        request.appendHtml(debugString.toString());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.