incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1221262 - /sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/console/OsgiInstallerWebConsolePlugin.java
Date Tue, 20 Dec 2011 13:59:47 GMT
Author: cziegeler
Date: Tue Dec 20 13:59:47 2011
New Revision: 1221262

URL: http://svn.apache.org/viewvc?rev=1221262&view=rev
Log:
SLING-2335 : Provide support for versioned resources

Modified:
    sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/console/OsgiInstallerWebConsolePlugin.java

Modified: sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/console/OsgiInstallerWebConsolePlugin.java
URL: http://svn.apache.org/viewvc/sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/console/OsgiInstallerWebConsolePlugin.java?rev=1221262&r1=1221261&r2=1221262&view=diff
==============================================================================
--- sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/console/OsgiInstallerWebConsolePlugin.java
(original)
+++ sling/trunk/installer/core/src/main/java/org/apache/sling/installer/core/impl/console/OsgiInstallerWebConsolePlugin.java
Tue Dec 20 13:59:47 2011
@@ -136,6 +136,13 @@ public class OsgiInstallerWebConsolePlug
         return (alias == null ? id : id + '\n' + alias);
     }
 
+    private String getURL(final TaskResource rsrc) {
+        if ( rsrc.getVersion() != null ) {
+            return rsrc.getURL() + " (" + rsrc.getVersion() + ")";
+        }
+        return rsrc.getURL();
+    }
+
     /** Default date format used. */
     private final DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSS yyyy-MMM-dd");
 
@@ -171,13 +178,13 @@ public class OsgiInstallerWebConsolePlug
                     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</th><th>URL</th><th>State</th></tr>");
+                    pw.printf("<tr><th>Entity ID</th><th>Digest</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()),
                         toActivate.getDigest(),
-                        toActivate.getURL(),
+                        getURL(toActivate),
                         toActivate.getState());
             }
             if ( rt != null ) {
@@ -198,7 +205,7 @@ public class OsgiInstallerWebConsolePlug
                         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</th><th>URL</th><th>State</th></tr>");
+                        pw.printf("<tr><th>Entity ID</th><th>Digest</th><th>URL
(Version)</th><th>State</th></tr>");
                         rt = first.getType();
                     }
                     pw.print("<tr><td>");
@@ -206,7 +213,7 @@ public class OsgiInstallerWebConsolePlug
                     pw.print("</td><td>");
                     pw.print(first.getDigest());
                     pw.print("</td><td>");
-                    pw.print(first.getURL());
+                    pw.print(getURL(first));
                     pw.print("</td><td>");
                     pw.print(first.getState());
                     if ( first.getState() == ResourceState.INSTALLED ) {
@@ -222,7 +229,7 @@ public class OsgiInstallerWebConsolePlug
                         final TaskResource resource = iter.next();
                         pw.printf("<tr><td></td><td>%s</td><td>%s</td><td>%s</td></tr>",
                             resource.getDigest(),
-                            resource.getURL(),
+                            getURL(resource),
                             resource.getState());
                     }
                 }
@@ -278,7 +285,7 @@ public class OsgiInstallerWebConsolePlug
                 pw.printf("- %s: %s, %s, %s%n",
                         getEntityId(toActivate, group.getAlias()),
                         toActivate.getDigest(),
-                        toActivate.getURL(),
+                        getURL(toActivate),
                         toActivate.getState());
             }
             pw.println();
@@ -298,13 +305,13 @@ public class OsgiInstallerWebConsolePlug
                     pw.printf("* %s: %s, %s, %s%n",
                             getEntityId(first, group.getAlias()),
                             first.getDigest(),
-                            first.getURL(),
+                            getURL(first),
                             first.getState());
                     while ( iter.hasNext() ) {
                         final TaskResource resource = iter.next();
                         pw.printf("  - %s, %s, %s%n",
                             resource.getDigest(),
-                            resource.getURL(),
+                            getURL(resource),
                             resource.getState());
                     }
                 }



Mime
View raw message