Package org.apache.sling.installer.api.info

Examples of org.apache.sling.installer.api.info.Resource


        }
        pw.print("</p>");

        String rt = null;
        for(final ResourceGroup group : state.getActiveResources()) {
            final Resource toActivate = group.getResources().get(0);
            if ( !toActivate.getType().equals(rt) ) {
                if ( rt != null ) {
                    pw.println("</tbody></table>");
                }
                pw.println("<div class='ui-widget-header ui-corner-top buttonGroup' style='height: 15px;'>");
                pw.printf("<span style='float: left; margin-left: 1em;'>Active Resources - %s</span>", getType(toActivate));
                pw.println("</div>");
                pw.println("<table class='nicetable'><tbody>");
                pw.printf("<tr><th>Entity ID</th><th>Digest/Priority</th><th>URL (Version)</th><th>State</th></tr>");
                rt = toActivate.getType();
            }
            pw.printf("<tr><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>",
                    getEntityId(toActivate, group.getAlias()),
                    getInfo(toActivate),
                    getURL(toActivate),
                    toActivate.getState());
        }
        if ( rt != null ) {
            pw.println("</tbody></table>");
        }
        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) ) {
                    if ( rt != null ) {
                        pw.println("</tbody></table>");
                    }
                    pw.println("<div class='ui-widget-header ui-corner-top buttonGroup' style='height: 15px;'>");
                    pw.printf("<span style='float: left; margin-left: 1em;'>Processed Resources - %s</span>", getType(first));
                    pw.println("</div>");
                    pw.println("<table class='nicetable'><tbody>");
                    pw.printf("<tr><th>Entity ID</th><th>Digest/Priority</th><th>URL (Version)</th><th>State</th></tr>");
                    rt = first.getType();
                }
                pw.print("<tr><td>");
                pw.print(getEntityId(first, group.getAlias()));
                pw.print("</td><td>");
                pw.print(getInfo(first));
                pw.print("</td><td>");
                pw.print(getURL(first));
                pw.print("</td><td>");
                pw.print(getState(first));
                if ( first.getState() == ResourceState.INSTALLED ) {
                    final long lastChange = first.getLastChange();
                    if ( lastChange > 0 ) {
                        pw.print("<br/>");
                        pw.print(formatDate(lastChange));
                    }
                }
                pw.print("</td></tr>");
                if ( first.getAttribute(TaskResource.ATTR_INSTALL_EXCLUDED) != null ) {
                    pw.printf("<tr><td></td><td colspan='2'>%s</td><td></td></tr>",
                            first.getAttribute(TaskResource.ATTR_INSTALL_EXCLUDED));
                }
                if ( first.getAttribute(TaskResource.ATTR_INSTALL_INFO) != null ) {
                    pw.printf("<tr><td></td><td colspan='2'>%s</td><td></td></tr>",
                            first.getAttribute(TaskResource.ATTR_INSTALL_INFO));

                }
                while ( iter.hasNext() ) {
                    final Resource resource = iter.next();
                    pw.printf("<tr><td></td><td>%s</td><td>%s</td><td>%s</td></tr>",
                            getInfo(resource),
                            getURL(resource),
                            resource.getState());
                }
            }
        }
        if ( rt != null ) {
            pw.println("</tbody></table>");
View Full Code Here


        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%n",
                    getEntityId(toActivate, group.getAlias()),
                    getInfo(toActivate),
                    getURL(toActivate),
                    toActivate.getState());
        }
        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%n",
                        getEntityId(first, group.getAlias()),
                        getInfo(first),
                        getURL(first),
                        getState(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%n",
                            getInfo(resource),
                            getURL(resource),
                            resource.getState());
                }
            }
        }
        pw.println();

View Full Code Here

                    final EntityResourceList group = this.persistentList.getEntityResourceList(entityId);

                    final String alias = group.getAlias();
                    final List<Resource> resources = new ArrayList<Resource>();
                    for(final TaskResource tr : group.getResources()) {
                        resources.add(new Resource() {

                            public String getScheme() {
                                return tr.getScheme();
                            }
View Full Code Here

TOP

Related Classes of org.apache.sling.installer.api.info.Resource

Copyright © 2018 www.massapicom. 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.