Examples of DebugString


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

        super(aliasesRegistry, cellBindings);
    }

    public String debugObjectStore() {
        final ObjectStore objectStore = getObjectStore();
        final DebugString debug = new DebugString();
        objectStore.debugData(debug);
        return debug.toString().replaceAll("\n", "<br>");
    }
View Full Code Here

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

    private void runAction(final Context context, final Request request, final Page page) {
        try {
            ACCESS_LOG.info("request " + request.toString());
            Request r = request;
            final DebugString debug = new DebugString();
            debug.startSection("Request");
            debug.appendln("http", request.toString());
            debug.endSection();
            do {
                final Action action = (Action) actions.get(r.getRequestType());
                try {
                    action.execute(r, context, page);
                } catch (final ObjectLookupException e) {
                    final String error = "The object/service you selected has timed out.  Please navigate to the object via the history bar.";
                    displayError(context, page, error);
                } catch (final TaskLookupException e) {
                    final String error = "The task you went back to has already been completed or cancelled.  Please start the task again.";
                    displayError(context, page, error);
                }
                r = r.getForward();
                if (r != null) {
                    LOG.debug("forward to " + r);
                }
            } while (r != null);
            if (LOG.isDebugEnabled()) {
                context.debug(debug);
                debug.appendln();
                if (IsisContext.inSession()) {
                    IsisContext.getSession(getExecutionContextId()).debugAll(debug);
                } else {
                    debug.appendln("No session");
                }
                LOG.debug(debug.toString());
            }
        } catch (final ActionException e) {
            page.setTitle("Error");
            page.getViewPane().setTitle("Error", "Action Exception");
            LOG.error("ActionException, executing action " + request.getRequestType(), e);
View Full Code Here

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

    public DebugServicesPeer(final AliasRegistry aliasesRegistry, final CellBinding... cellBindings) {
        super(aliasesRegistry, cellBindings);
    }

    public String debugServices() {
        final DebugString debug = new DebugString();

        final List<Object> services = getServices();

        for (final Object service : services) {
            debug.append(service.getClass().getName());
            debug.append("\n");
        }
        return debug.toString().replaceAll("\n", "<br>");
    }
View Full Code Here

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

            } else if (type.equals("object")) {
                final String value = request.getOptionalProperty(VALUE);
                final RequestContext context = request.getContext();
                final ObjectAdapter object = context.getMappedObject(value);
                final DebugString str = new DebugString();
                Dump.adapter(object, str);
                Dump.graph(object, IsisContext.getAuthenticationSession(), str);
                request.appendHtml("<h2>" + object.getSpecification().getFullIdentifier() + "</h2>");
                request.appendHtml("<pre class=\"debug\">" + str + "</pre>");
            }

        }

        if (alwaysShow || request.getContext().getDebug() == RequestContext.Debug.ON) {

            final RequestContext context = request.getContext();

            final String id = request.getOptionalProperty("object");
            if (id != null) {
                final ObjectAdapter object = context.getMappedObject(id);
                if (object instanceof DebuggableWithTitle) {
                    final DebugString debug = new DebugString();
                    ((DebuggableWithTitle) object).debugData(debug);
                    request.appendHtml("<pre class=\"debug\">" + debug + "</pre>");
                } else {
                    request.appendHtml(object.toString());
                }
            }

            final String variable = request.getOptionalProperty("variable");
            if (variable != null) {
                final Object object = context.getVariable(variable);
                request.appendHtml(variable + " => " + (object == null ? "null" : object.toString()));
            }

            final String list = request.getOptionalProperty("list");
            if (list != null) {
                final DebugString debug = new DebugString();
                context.append(debug, list);
                request.appendHtml(debug.toString());
            }

            final String uri = request.getOptionalProperty("uri");
            if (uri != null) {
                request.appendHtml("<pre class=\"debug\">");
View Full Code Here

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

    protected void objectGraph(final Request request) {
        final String id = request.getOptionalProperty(VALUE);
        final ObjectAdapter object = request.getContext().getMappedObjectOrResult(id);
        request.appendHtml("<h1>Object Graph - " + object + "</h1>");
        request.appendHtml("<pre>");
        final DebugBuilder debug = new DebugString();
        Dump.graph(object, null, debug);
        request.appendHtml(debug.toString());
        request.appendHtml("</pre>");
    }
View Full Code Here

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

        final String name = request.getOptionalProperty(VALUE);
        final ObjectSpecification spec = getSpecificationLoader().loadSpecification(name);
        request.appendHtml("<h1>Specification Graph - " + spec.getFullIdentifier() + "</h1>");
        request.appendHtml("<p><a href=\"./debug.shtml?type=specification&value=" + spec.getFullIdentifier() + "\">Full Specification</a></p>");
        request.appendHtml("<pre>");
        final DebugBuilder debug = new DebugString();
        debug.appendln(spec.getFullIdentifier());
        debug.indent();
        specificationGraph(spec, debug, new ArrayList<ObjectSpecification>());
        debug.unindent();
        request.appendHtml(debug.toString());
        request.appendHtml("</pre>");
    }
View Full Code Here

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

        }
    }

    private void object(final RequestContext context, final DebugHtmlWriter view) {
        final ObjectAdapter object = context.getMappedObjectOrResult(context.getParameter("object"));
        final DebugString str = new DebugString();
        Dump.adapter(object, str);
        Dump.graph(object, IsisContext.getAuthenticationSession(), str);
        view.appendTitle(object.getSpecification().getFullIdentifier());
        view.appendln("<pre class=\"debug\">" + str + "</pre>");
    }
View Full Code Here

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

    private void system(final RequestContext context, final DebugHtmlWriter view) {
        final DebuggableWithTitle[] debug = IsisContext.debugSystem();
        view.appendTitle("System");
        for (final DebuggableWithTitle element2 : debug) {
            final DebugString str = new DebugString();
            element2.debugData(str);
            view.appendTitle(element2.debugTitle());
            view.appendln("<pre class=\"debug\">" + str + "</pre>");
        }
    }
View Full Code Here

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

    // debug
    ////////////////////////////////////

    @Override
    public String debug() {
        final DebugString debug = new DebugString();
        memento.debug(debug);
        return debug.toString();
    }
View Full Code Here

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

            }
        } else {
            for (final DebuggableWithTitle info : infos) {
                if (info.debugTitle().equals(sectionName)) {
                    // TODO use an HTML debug string
                    final DebugString debug = new DebugString();
                    info.debugData(debug);
                    writer.println(debug.toString());
                    break;
                }
            }
        }
        writer.println("</pre>");
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.