public void printConfiguration()

in src/main/java/org/apache/sling/installer/core/impl/console/OsgiInstallerWebConsolePlugin.java [288:364]


    public void printConfiguration(final PrintWriter pw, final String mode) {
        if ( !"zip".equals(mode) && !"txt".equals(mode) ) {
            return;
        }
        pw.println("Apache Sling OSGi Installer");
        pw.println("===========================");
        final InstallationState state = this.installer.getInstallationState();
        pw.println("Active Resources");
        pw.println("----------------");
        String rt = null;
        for(final ResourceGroup group : state.getActiveResources()) {
            final Resource toActivate = group.getResources().get(0);
            if ( !toActivate.getType().equals(rt) ) {
                pw.printf("%s:%n", getType(toActivate));
                rt = toActivate.getType();
            }
            pw.printf("- %s: %s, %s, %s, %s%n",
                    getEntityId(toActivate, group.getAlias()),
                    getInfo(toActivate),
                    getURL(toActivate),
                    toActivate.getState(),
                    getError(toActivate));
        }
        pw.println();

        pw.println("Processed Resources");
        pw.println("-------------------");
        rt = null;
        for(final ResourceGroup group : state.getInstalledResources()) {
            final Collection<Resource> resources = group.getResources();
            if (resources.size() > 0) {
                final Iterator<Resource> iter = resources.iterator();
                final Resource first = iter.next();
                if ( !first.getType().equals(rt) ) {
                    pw.printf("%s:%n", getType(first));
                    rt = first.getType();
                }
                pw.printf("* %s: %s, %s, %s, %s%n",
                        getEntityId(first, group.getAlias()),
                        getInfo(first),
                        getURL(first),
                        getState(first),
                        getError(first));
                if ( first.getAttribute(TaskResource.ATTR_INSTALL_EXCLUDED) != null ) {
                    pw.printf("  : %s",
                            first.getAttribute(TaskResource.ATTR_INSTALL_EXCLUDED));
                }
                if ( first.getAttribute(TaskResource.ATTR_INSTALL_INFO) != null ) {
                    pw.printf("  : %s",
                            first.getAttribute(TaskResource.ATTR_INSTALL_INFO));

                }
                while ( iter.hasNext() ) {
                    final Resource resource = iter.next();
                    pw.printf("  - %s, %s, %s, %s%n",
                            getInfo(resource),
                            getURL(resource),
                            resource.getState(),
                            getError(resource));
                }
            }
        }
        pw.println();

        pw.println("Untransformed Resources");
        pw.println("-----------------------");
        rt = null;
        for(final RegisteredResource registeredResource : state.getUntransformedResources()) {
            if ( !registeredResource.getType().equals(rt) ) {
                pw.printf("%s:%n", getType(registeredResource));
                rt = registeredResource.getType();
            }
            pw.printf("- %s, %s%n",
                    getInfo(registeredResource),
                    registeredResource.getURL());
        }
    }