@Override public void debugData(final DebugBuilder debug) { debug.appendTitle("Authenticators"); debug.indent(); for (final Authenticator authenticator : authenticators) { debug.appendln(authenticator.toString()); } debug.unindent(); debug.appendTitle("Users"); debug.indent(); for (final String userName : userByValidationCode.values()) { debug.appendln(userName); } debug.unindent(); }
@Override public void debugAll(final DebugBuilder debug) { debug.startSection("Isis Context Snapshot"); debug.appendln(debugSnapshot); debug.endSection(); }
@Override public void debugData(final DebugBuilder debug) { debug.appendTitle("Business Objects"); debug.appendln(dataManager.getDebugData()); }
public static void specification(final ObjectSpecification specification, final DebugBuilder debugBuilder) { try { debugBuilder.appendTitle(specification.getClass().getName()); debugBuilder.appendAsHexln("Hash code", specification.hashCode()); debugBuilder.appendln("ID", specification.getIdentifier()); debugBuilder.appendln("Full Name", specification.getFullIdentifier()); debugBuilder.appendln("Short Name", specification.getShortIdentifier()); debugBuilder.appendln("Singular Name", specification.getSingularName()); debugBuilder.appendln("Plural Name", specification.getPluralName()); debugBuilder.appendln("Description", specification.getDescription()); debugBuilder.blankLine(); debugBuilder.appendln("Features", featureList(specification)); debugBuilder.appendln("Type", specification.isCollection() ? "Collection" : "Object"); if (specification.superclass() != null) { debugBuilder.appendln("Superclass", specification.superclass().getFullIdentifier()); debugBuilder.appendln("Interfaces", specificationNames(specification.interfaces())); debugBuilder.appendln("Subclasses", specificationNames(specification.subclasses())); debugBuilder.blankLine(); debugBuilder.appendln("Service", specification.isService()); debugBuilder.appendln("Encodable", specification.isEncodeable()); debugBuilder.appendln("Parseable", specification.isParseable()); debugBuilder.appendln("Aggregated", specification.isValueOrIsAggregated()); } catch (final RuntimeException e) { debugBuilder.appendException(e); debugBuilder.blankLine(); debugBuilder.appendln("Facets"); final Class<? extends Facet>[] facetTypes = specification.getFacetTypes();
private static void specificationFields(final ObjectSpecification specification, final DebugBuilder debugBuilder) { final List<ObjectAssociation> fields = specification.getAssociations(); debugBuilder.appendln("All"); debugBuilder.indent(); for (int i = 0; i < fields.size(); i++) { debugBuilder.appendln((i + 1) + "." + fields.get(i).getId()); debugBuilder.unindent(); debugBuilder.appendln("Static"); debugBuilder.indent(); for (int i = 0; i < fields2.size(); i++) { debugBuilder.appendln((i + 1) + "." + fields2.get(i).getId()); debugBuilder.unindent(); debugBuilder.appendln(); debugBuilder.appendln("none"); } else { for (int i = 0; i < fields.size(); i++) { debugBuilder.appendln((i + 1) + "." + field.getId() + " (" + field.getClass().getName() + ")"); debugBuilder.indent(); final String description = field.getDescription(); if (description != null && !description.equals("")) { debugBuilder.appendln("Description", description); debugBuilder.appendln("Help", help.substring(0, Math.min(30, help.length())) + (help.length() > 30 ? "..." : ""));
private void specification(final ObjectSpecification spec, final DebugBuilder view) { view.startSection("Summary"); view.appendln("Hash code", "#" + Integer.toHexString(spec.hashCode())); view.appendln("ID", spec.getIdentifier()); view.appendln("Full name", spec.getFullIdentifier()); view.appendln("Short name", spec.getShortIdentifier()); view.appendln("Singular name", spec.getSingularName()); view.appendln("Plural name", spec.getPluralName()); view.appendln("Description", spec.getDescription()); view.appendln("Type", "?"); view.appendln("Value/aggregated", String.valueOf(!spec.isValueOrIsAggregated())); view.appendln("Parent specification", specificationLink(spec.superclass())); specificationClasses(view, "Child specifications", spec.subclasses()); specificationClasses(view, "Implemented interfaces", spec.interfaces()); specificationMembers(view, "Prototype Actions", spec.getObjectActions(ActionType.PROTOTYPE, Contributed.INCLUDED)); specificationMembers(view, "Debug Actions", spec.getObjectActions(ActionType.DEBUG, Contributed.INCLUDED)); view.endSection(); view.startSection("Fields"); for (int i = 0; i < fields.size(); i++) { final ObjectAssociation field = fields.get(i); view.appendTitle("<span id=\"" + field.getId() + "\"><em>Field:</em> " + field.getId() + "</span>"); view.appendln("ID", field.getIdentifier()); view.appendln("Short ID", field.getId()); view.appendln("Name", field.getName()); view.appendln("Specification", specificationLink(field.getSpecification()));
@Override public void debugData(final DebugBuilder debug) { debug.appendTitle("Domain Objects"); for (final ObjectSpecification spec : persistedObjects.specifications()) { debug.appendln(spec.getFullIdentifier()); final ObjectStoreInstances instances = instancesFor(spec); instances.debugData(debug); } debug.unindent(); debug.appendln(); }
public void append(final DebugBuilder debug) { debug.startSection("Request"); debug.appendTitle("User"); final AuthenticationSession session = getSession(); debug.appendln("Session", session); if (session != null) { debug.appendln("Name", session.getUserName()); debug.appendln("Roles", session.getRoles()); } debug.appendTitle("context"); debug.appendln("Parent request path", requestedParentPath); debug.appendln("Requested file", requestedFile); debug.appendln("Parent resource path", resourceParentPath); debug.appendln("Resource file", resourceFile); debug.endSection(); debug.startSection("Variables"); append(debug, Scope.GLOBAL); append(debug, Scope.SESSION); append(debug, Scope.INTERACTION); append(debug, Scope.REQUEST); append(debug, Scope.ERROR); debug.endSection(); debug.startSection("Object Mapping"); objectMapping.append(debug); debug.endSection(); }
@Override public void debugData(final DebugBuilder str) { facetDecoratorSet.debugData(str); str.appendln(); str.appendTitle("Specifications"); final List<ObjectSpecification> specs = Lists.newArrayList(allSpecifications()); Collections.sort(specs, ObjectSpecification.COMPARATOR_SHORT_IDENTIFIER_IGNORE_CASE); for (final ObjectSpecification spec : specs) { str.append(spec.isAbstract() ? "A" : "."); str.append(spec.isService() ? "S" : "."); str.append(BoundedFacetUtils.isBoundedSet(spec) ? "B" : "."); str.append(spec.isCollection() ? "C" : "."); str.append(spec.isNotCollection() ? "O" : "."); str.append("."); // placeholder for future support of maps str.append(spec.isParseable() ? "P" : "."); str.append(spec.isEncodeable() ? "E" : "."); str.append(spec.isValueOrIsAggregated() ? "A" : "."); str.append(!spec.isCollectionOrIsAggregated() ? "I" : "."); str.append(" "); str.append(spec.getShortIdentifier()); str.append(" [fqc="); str.append(spec.getFullIdentifier()); str.append(",type="); str.append(spec.getClass().getName()); str.appendln("]"); } }
private void debugOverview(final DebugBuilder debug) { try { debug.appendln(AboutIsis.getFrameworkName()); debug.appendln(AboutIsis.getFrameworkVersion()); if (AboutIsis.getApplicationName() != null) { debug.appendln("application: " + AboutIsis.getApplicationName()); debug.appendln("version" + AboutIsis.getApplicationVersion()); final String system = System.getProperty("os.name") + " (" + System.getProperty("os.arch") + ") " + System.getProperty("os.version"); final String java = System.getProperty("java.vm.name") + " " + System.getProperty("java.vm.version"); debug.appendln("user: " + user); debug.appendln("os: " + system); debug.appendln("java: " + java); debug.appendln("working directory: " + new File(".").getAbsolutePath()); debug.appendTitle("System Installer"); appendFixturesInstallerDebug(debug); debug.appendTitle("System Components"); debug.appendln("Authentication manager", IsisContext.getAuthenticationManager().getClass().getName()); debug.appendln("Configuration", getConfiguration().getClass().getName()); debug.appendException(e);
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); 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); debug.appendln("warning", message); debug.startSection("Processing Trace"); debug.appendPreformatted(requestContext.getDebugTrace()); debug.endSection(); debug.close();
/** * @see #adapter(ObjectAdapter) */ public static void adapter(final ObjectAdapter adapter, final DebugBuilder builder) { try { builder.appendln("Adapter", adapter.getClass().getName()); builder.appendln("Class", adapter.getObject() == null ? "none" : adapter.getObject().getClass().getName()); builder.appendAsHexln("Hash", adapter.hashCode()); builder.appendln("Object", adapter.getObject()); builder.appendln("Title", adapter.titleString()); builder.appendln("Specification", adapter.getSpecification().getFullIdentifier()); builder.appendln(); builder.appendln("Icon", adapter.getIconName()); builder.appendln("OID", adapter.getOid()); builder.appendln("State", adapter.getResolveState()); builder.appendln("Version", adapter.getVersion()); } catch (final RuntimeException e) { builder.appendException(e); } }
@Override public void debug(final DebugBuilder debug) { debug.appendAsHexln("hash", hashCode()); debug.appendln("context id", id); debug.appendln("accessed", DATE_FORMAT.format(new Date(getSessionOpenTime()))); debugState(debug); }
private static void simpleObject(final ObjectAdapter collectionAdapter, final DebugBuilder debugBuilder) { debugBuilder.appendln(collectionAdapter.titleString()); final ObjectSpecification objectSpec = collectionAdapter.getSpecification(); if (objectSpec.isCollection()) { final CollectionFacet facet = CollectionFacetUtils.getCollectionFacetFromSpec(collectionAdapter); int i = 1; for (final ObjectAdapter element : facet.collection(collectionAdapter)) { debugBuilder.appendln(i++ + " " + element.titleString()); } } else { // object is a regular Object try { final List<ObjectAssociation> fields = objectSpec.getAssociations(); for (int i = 0; i < fields.size(); i++) { final ObjectAssociation field = fields.get(i); final ObjectAdapter obj = field.get(collectionAdapter); final String name = field.getId(); if (obj == null) { debugBuilder.appendln(name, "null"); } else { debugBuilder.appendln(name, obj.titleString()); } } } catch (final RuntimeException e) { debugBuilder.appendException(e); } } }
private void debugSessionInfo(final DebugBuilder debug) { try { if (debugSessionInfo != null) { for (final DebuggableWithTitle info : debugSessionInfo) { debug.appendTitle(info.debugTitle()); info.debugData(debug); } } } catch (final RuntimeException e) { debug.appendException(e); } }
@Override public void appendTitle(final String title) { builder1.appendTitle(title); builder2.appendTitle(title); }