brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rich...@apache.org
Subject [08/14] git commit: Styles HTML output
Date Mon, 08 Sep 2014 12:39:08 GMT
Styles HTML output


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/2157c98f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/2157c98f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/2157c98f

Branch: refs/heads/master
Commit: 2157c98fcf218057b68c456ea1b116d0e882ec52
Parents: 37ec238
Author: Martin Harris <github@nakomis.com>
Authored: Tue Sep 2 17:23:42 2014 +0100
Committer: Martin Harris <github@nakomis.com>
Committed: Mon Sep 8 11:20:34 2014 +0100

----------------------------------------------------------------------
 .../main/java/brooklyn/cli/AbstractMain.java    |  34 +--
 .../main/java/brooklyn/cli/CloudExplorer.java   |   4 -
 .../brooklyn/cli/itemlister/ClassFinder.java    |  18 ++
 .../cli/itemlister/ItemDescriptors.java         |  18 ++
 .../brooklyn/cli/itemlister/ItemLister.java     |  31 +++
 .../main/resources/brooklyn-object-list.html    | 188 ++++++++++------
 usage/cli/src/main/resources/enricher.html      |  65 ++++--
 usage/cli/src/main/resources/entity.html        | 110 ++++++----
 usage/cli/src/main/resources/items.css          | 217 +++++++++++++++++++
 usage/cli/src/main/resources/location.html      |  64 ++++--
 usage/cli/src/main/resources/policy.html        |  65 ++++--
 11 files changed, 622 insertions(+), 192 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/2157c98f/usage/cli/src/main/java/brooklyn/cli/AbstractMain.java
----------------------------------------------------------------------
diff --git a/usage/cli/src/main/java/brooklyn/cli/AbstractMain.java b/usage/cli/src/main/java/brooklyn/cli/AbstractMain.java
index d27dee7..d2b9169 100644
--- a/usage/cli/src/main/java/brooklyn/cli/AbstractMain.java
+++ b/usage/cli/src/main/java/brooklyn/cli/AbstractMain.java
@@ -18,8 +18,6 @@
  */
 package brooklyn.cli;
 
-import groovy.lang.GroovyClassLoader;
-import groovy.lang.GroovyShell;
 import io.airlift.command.Arguments;
 import io.airlift.command.Cli;
 import io.airlift.command.Cli.CliBuilder;
@@ -29,16 +27,10 @@ import io.airlift.command.Option;
 import io.airlift.command.OptionType;
 import io.airlift.command.ParseException;
 
-import java.io.Console;
-import java.io.IOException;
 import java.io.InputStream;
 import java.io.PrintStream;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.net.URI;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 import java.util.concurrent.Callable;
@@ -50,39 +42,15 @@ import org.slf4j.LoggerFactory;
 
 import brooklyn.BrooklynVersion;
 import brooklyn.catalog.BrooklynCatalog;
-import brooklyn.entity.Application;
-import brooklyn.entity.Entity;
-import brooklyn.entity.basic.AbstractApplication;
-import brooklyn.entity.basic.AbstractEntity;
-import brooklyn.entity.basic.ApplicationBuilder;
-import brooklyn.entity.basic.Entities;
-import brooklyn.entity.basic.StartableApplication;
-import brooklyn.entity.proxying.EntitySpec;
-import brooklyn.entity.rebind.persister.PersistMode;
-import brooklyn.entity.trait.Startable;
-import brooklyn.launcher.BrooklynLauncher;
-import brooklyn.launcher.BrooklynServerDetails;
-import brooklyn.launcher.config.StopWhichAppsOnShutdown;
-import brooklyn.management.ManagementContext;
-import brooklyn.management.ha.HighAvailabilityMode;
-import brooklyn.rest.security.PasswordHasher;
-import brooklyn.util.ResourceUtils;
-import brooklyn.util.exceptions.Exceptions;
+import brooklyn.cli.Main.LaunchCommand;
 import brooklyn.util.exceptions.FatalConfigurationRuntimeException;
 import brooklyn.util.exceptions.FatalRuntimeException;
 import brooklyn.util.exceptions.UserFacingException;
-import brooklyn.util.guava.Maybe;
-import brooklyn.util.javalang.Enums;
-import brooklyn.util.net.Networking;
-import brooklyn.util.text.Identifiers;
-import brooklyn.util.text.StringEscapes.JavaStringEscapes;
 import brooklyn.util.text.Strings;
 
-import com.google.common.annotations.Beta;
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Objects;
 import com.google.common.base.Objects.ToStringHelper;
-import com.google.common.collect.ImmutableList;
 
 /**
  * This class is the primary CLI for brooklyn.

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/2157c98f/usage/cli/src/main/java/brooklyn/cli/CloudExplorer.java
----------------------------------------------------------------------
diff --git a/usage/cli/src/main/java/brooklyn/cli/CloudExplorer.java b/usage/cli/src/main/java/brooklyn/cli/CloudExplorer.java
index d2936c8..a5f4948 100644
--- a/usage/cli/src/main/java/brooklyn/cli/CloudExplorer.java
+++ b/usage/cli/src/main/java/brooklyn/cli/CloudExplorer.java
@@ -40,8 +40,6 @@ import org.jclouds.compute.domain.Image;
 import org.jclouds.compute.domain.NodeMetadata;
 import org.jclouds.compute.domain.Template;
 import org.jclouds.compute.options.TemplateOptions;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 import brooklyn.location.Location;
 import brooklyn.location.LocationDefinition;
@@ -69,8 +67,6 @@ import com.google.common.collect.Lists;
  */
 public class CloudExplorer extends AbstractMain {
 
-    private static final Logger log = LoggerFactory.getLogger(Main.class);
-
     public static void main(String... args) {
         new CloudExplorer().execCli(args);
     }

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/2157c98f/usage/cli/src/main/java/brooklyn/cli/itemlister/ClassFinder.java
----------------------------------------------------------------------
diff --git a/usage/cli/src/main/java/brooklyn/cli/itemlister/ClassFinder.java b/usage/cli/src/main/java/brooklyn/cli/itemlister/ClassFinder.java
index 18888ac..92cf1ca 100644
--- a/usage/cli/src/main/java/brooklyn/cli/itemlister/ClassFinder.java
+++ b/usage/cli/src/main/java/brooklyn/cli/itemlister/ClassFinder.java
@@ -1,3 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package brooklyn.cli.itemlister;
 
 import java.io.File;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/2157c98f/usage/cli/src/main/java/brooklyn/cli/itemlister/ItemDescriptors.java
----------------------------------------------------------------------
diff --git a/usage/cli/src/main/java/brooklyn/cli/itemlister/ItemDescriptors.java b/usage/cli/src/main/java/brooklyn/cli/itemlister/ItemDescriptors.java
index a3929ee..ecb2264 100644
--- a/usage/cli/src/main/java/brooklyn/cli/itemlister/ItemDescriptors.java
+++ b/usage/cli/src/main/java/brooklyn/cli/itemlister/ItemDescriptors.java
@@ -1,3 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package brooklyn.cli.itemlister;
 
 import java.util.List;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/2157c98f/usage/cli/src/main/java/brooklyn/cli/itemlister/ItemLister.java
----------------------------------------------------------------------
diff --git a/usage/cli/src/main/java/brooklyn/cli/itemlister/ItemLister.java b/usage/cli/src/main/java/brooklyn/cli/itemlister/ItemLister.java
index 4375c38..8ee267f 100644
--- a/usage/cli/src/main/java/brooklyn/cli/itemlister/ItemLister.java
+++ b/usage/cli/src/main/java/brooklyn/cli/itemlister/ItemLister.java
@@ -1,3 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package brooklyn.cli.itemlister;
 
 import brooklyn.basic.BrooklynObject;
@@ -13,6 +31,7 @@ import brooklyn.util.ResourceUtils;
 import brooklyn.util.collections.MutableSet;
 import brooklyn.util.os.Os;
 import brooklyn.util.text.TemplateProcessor;
+
 import com.fasterxml.jackson.annotation.JsonAutoDetect;
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.annotation.PropertyAccessor;
@@ -26,6 +45,7 @@ import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Lists;
 import com.google.common.io.Files;
+
 import io.airlift.command.Cli;
 import io.airlift.command.Cli.CliBuilder;
 import io.airlift.command.Command;
@@ -38,7 +58,12 @@ import java.util.List;
 import java.util.Map;
 import java.util.ServiceLoader;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 public class ItemLister extends AbstractMain {
+    
+    private static final Logger LOG = LoggerFactory.getLogger(ItemLister.class);
 
     public static void main(String... args) {
         new ItemLister().execCli(args);
@@ -65,8 +90,10 @@ public class ItemLister extends AbstractMain {
         @Option(name = { "--output-folder" }, title = "Whether to only show name/type, and
not config keys etc")
         public String outputFolder;
 
+        @SuppressWarnings("unchecked")
         @Override
         public Void call() throws Exception {
+            LOG.info("Retrieving objects");
             List<URL> urls = getUrls();
             
             // TODO Remove duplication from separate ListPolicyCommand etc
@@ -88,6 +115,7 @@ public class ItemLister extends AbstractMain {
             if (outputFolder == null) {
                 System.out.println(json);
             } else {
+                LOG.info("Outputting item list to " + outputFolder);
                 String outputPath = Os.mergePaths(outputFolder, "index.html");
                 String parentDir = (new File(outputPath).getParentFile()).getAbsolutePath();
                 mkdir(parentDir, "entities");
@@ -97,6 +125,8 @@ public class ItemLister extends AbstractMain {
                 mkdir(parentDir, "locationResolvers");
                 Files.write("var items = " + json, new File(Os.mergePaths(outputFolder, "items.js")),
Charsets.UTF_8);
                 ResourceUtils resourceUtils = ResourceUtils.create(this);
+                String css = resourceUtils.getResourceAsString("items.css");
+                Files.write(css, new File(Os.mergePaths(outputFolder, "items.css")), Charsets.UTF_8);
                 String mainHtml = resourceUtils.getResourceAsString("brooklyn-object-list.html");
                 Files.write(mainHtml, new File(Os.mergePaths(outputFolder, "index.html")),
Charsets.UTF_8);
                 List<Map<String, Object>> entities = (List<Map<String,
Object>>) result.get("entities");
@@ -130,6 +160,7 @@ public class ItemLister extends AbstractMain {
                     String locationHtml = TemplateProcessor.processTemplateContents(locationTemplateHtml,
ImmutableMap.of("type", type));
                     Files.write(locationHtml, new File(Os.mergePaths(outputFolder, "locations",
type + ".html")), Charsets.UTF_8);
                 }
+                LOG.info("Finished outputting item list to " + outputFolder);
             }
             return null;
         }

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/2157c98f/usage/cli/src/main/resources/brooklyn-object-list.html
----------------------------------------------------------------------
diff --git a/usage/cli/src/main/resources/brooklyn-object-list.html b/usage/cli/src/main/resources/brooklyn-object-list.html
index 338da2b..8a5863c 100644
--- a/usage/cli/src/main/resources/brooklyn-object-list.html
+++ b/usage/cli/src/main/resources/brooklyn-object-list.html
@@ -1,70 +1,132 @@
-<html lang="en">
-    <head>
-        <meta charset="utf-8">
-        <title>Brooklyn Object List</title>
-    </head>
-    <body>
-        <h1>Entities</h1>
-        <table id="entities">
-            <tr>
-                <th>Name</th>
-                <th>Type</th>
-                <th>Description</th>
-            </tr>
-        </table>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head>
+    <title>Brooklyn Object List</title>
+    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
+    <link rel="stylesheet" href="items.css" type="text/css" media="screen"/>
+</head>
+<body>
+<div id="container">
+    <div id="header">
+        <div id="identity">
+            <a href="http://brooklyncentral.github.com/" rel="home">Brooklyn</a>
+        </div>
+        <div id="menubar">
+            <ul id="mainmenu">
+                <li class=""><a href="#" onclick="scrollTo('#entities')">Entities</a></li>
+                <li class=""><a href="#" onclick="scrollTo('#policies')">Policies</a></li>
+                <li class=""><a href="#" onclick="scrollTo('#enrichers')">Enrichers</a></li>
+                <li class=""><a href="#" onclick="scrollTo('#locations')">Locations</a></li>
+                <li class=""><a href="#" onclick="scrollTo('#locationResolvers')">Location
Resolvers</a></li>
+            </ul>
+        </div>
+    </div>
+    <br>
+
+    <div id="content">
+        <div id="entities">
+            <h1>Entities</h1>
+            <table id="entityTable">
+                <tr>
+                    <th>Name</th>
+                    <th>Type</th>
+                    <th>Description</th>
+                </tr>
+            </table>
+        </div>
         <br>
-        <h1>Policies</h1>
-        <table id="policies">
-            <tr>
-                <th>Name</th>
-                <th>Type</th>
-                <th>Description</th>
-            </tr>
-        </table>
-        <h1>Enrichers</h1>
-        <table id="enrichers">
-            <tr>
-                <th>Name</th>
-                <th>Type</th>
-                <th>Description</th>
-            </tr>
-        </table>
+
+        <div id="policies">
+            <h1>Policies</h1>
+            <table id="policyTable">
+                <tr>
+                    <th>Name</th>
+                    <th>Type</th>
+                    <th>Description</th>
+                </tr>
+            </table>
+        </div>
         <br>
-        <h1>Locations</h1>
-        <table id="locations">
-            <tr>
-                <th>Type</th>
-            </tr>
-        </table>
+
+        <div id="enrichers">
+            <h1>Enrichers</h1>
+            <table id="enricherTable">
+                <tr>
+                    <th>Name</th>
+                    <th>Type</th>
+                    <th>Description</th>
+                </tr>
+            </table>
+        </div>
         <br>
-        <h1>Location Resolvers</h1>
-        <table id="locationResolvers">
-            <tr>
-                <th>Name</th>
-            </tr>
-        </table>
+
+        <div id="locations">
+            <h1>Locations</h1>
+            <table id="locationTable">
+                <tr>
+                    <th>Type</th>
+                </tr>
+            </table>
+        </div>
         <br>
+
+        <div id="locationResolvers">
+            <h1>Location Resolvers</h1>
+            <table id="locationResolverTable">
+                <tr>
+                    <th>Name</th>
+                </tr>
+            </table>
+        </div>
         <br>
-        <script src="http://code.jquery.com/jquery-1.11.1.min.js" type="text/javascript"></script>
-        <script src="items.js" type="text/javascript"></script>
-        <script type="text/javascript">
-            $(document).ready(function() {
-                items.entities.forEach(function(element) {
-                    $("#entities").find("tr:last").after("<tr><td>" + element.name
+ "</td><td><a href='entities/" + element.type + ".html'>" + element.type
+ "</a></td><td>" + element.description + "</td></tr>")
-                });
-                items.policies.forEach(function(element) {
-                    $("#policies").find("tr:last").after("<tr><td>" + element.name
+ "</td><td><a href='policies/" + element.type + ".html'>" + element.type
+ "</a></td><td>" + element.description + "</td></tr>")
-                });
-                items.enrichers.forEach(function(element) {
-                    $("#enrichers").find("tr:last").after("<tr><td>" + element.name
+ "</td><td><a href='enrichers/" + element.type + ".html'>" + element.type
+ "</a></td><td>" + element.description + "</td></tr>")
-                });
-                items.locations.forEach(function(element) {
-                    $("#locations").find("tr:last").after("<tr><td><a href='locations/"
+ element.type + ".html'>" + element.type + "</a></td></tr>")
-                });
-                items.locationResolvers.forEach(function(element) {
-                    $("#locationResolvers").find("tr:last").after("<tr><td>"
+ element + "</td></tr>")
-                });
+    </div>
+    <br>
+    <script src="http://code.jquery.com/jquery-1.11.1.min.js" type="text/javascript"></script>
+    <script src="items.js" type="text/javascript"></script>
+    <script type="text/javascript">
+        function scrollTo(sectionName) {
+            var content = $("#content");
+            content.animate({
+                scrollTop: content.scrollTop() - content.offset().top + $(sectionName).offset().top
             });
-        </script>
-    </body>
+        }
+
+        $(document).ready(function () {
+            items.entities.forEach(function (element) {
+                $("#entityTable").find("tr:last").after("<tr><td>" + element.name
+ "</td><td><a href='entities/" + element.type + ".html'>" + element.type
+ "</a></td><td class='wordWrap'>" + element.description + "</td></tr>")
+            });
+            items.policies.forEach(function (element) {
+                $("#policyTable").find("tr:last").after("<tr><td>" + element.name
+ "</td><td><a href='policies/" + element.type + ".html'>" + element.type
+ "</a></td><td class='wordWrap'>" + element.description + "</td></tr>")
+            });
+            items.enrichers.forEach(function (element) {
+                $("#enricherTable").find("tr:last").after("<tr><td>" + element.name
+ "</td><td><a href='enrichers/" + element.type + ".html'>" + element.type
+ "</a></td><td class='wordWrap'>" + element.description + "</td></tr>")
+            });
+            items.locations.forEach(function (element) {
+                $("#locationTable").find("tr:last").after("<tr><td class='location'><a
href='locations/" + element.type + ".html'>" + element.type + "</a></td></tr>")
+            });
+            items.locationResolvers.forEach(function (element) {
+                $("#locationResolverTable").find("tr:last").after("<tr><td>"
+ element + "</td></tr>")
+            });
+        });
+    </script>
+</div>
+</body>
 </html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/2157c98f/usage/cli/src/main/resources/enricher.html
----------------------------------------------------------------------
diff --git a/usage/cli/src/main/resources/enricher.html b/usage/cli/src/main/resources/enricher.html
index 783af00..dc018fa 100644
--- a/usage/cli/src/main/resources/enricher.html
+++ b/usage/cli/src/main/resources/enricher.html
@@ -1,31 +1,62 @@
-<html lang="en">
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
 <head>
-    <meta charset="utf-8">
     <title>Brooklyn Enricher - ${name}</title>
+    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
+    <link rel="stylesheet" href="../items.css" type="text/css" media="screen"/>
 </head>
 <body>
-<h1>${name}</h1>
-Type: <span id="type"></span>
-<h2>Config Keys</h2>
-<table id="configKeys">
-    <tr>
-        <th>Name</th>
-        <th>Type</th>
-        <th>Default Value</th>
-        <th>Description</th>
-    </tr>
-</table>
-<br>
+<div id="container">
+    <div id="header">
+        <div id="identity">
+            <a href="http://brooklyncentral.github.com/" rel="home">Brooklyn</a>
+        </div>
+    </div>
+    <div id="content" class="objectContent">
+        <br>
+        <h1>${name}</h1>
+        <h2 class="typeLabel">Type:</h2><span id="type"></span>
+
+        <h2>Config Keys</h2>
+        <table id="configKeys">
+            <tr>
+                <th>Name</th>
+                <th>Type</th>
+                <th>Default Value</th>
+                <th>Description</th>
+            </tr>
+        </table>
+        <br>
+    </div>
+</div>
+
 
 <script src="http://code.jquery.com/jquery-1.11.1.min.js" type="text/javascript"></script>
 <script src="../items.js" type="text/javascript"></script>
 <script type="text/javascript">
-    $(document).ready(function() {
-        var item = $.grep((items.enrichers), function(entity) {
+    $(document).ready(function () {
+        var item = $.grep((items.enrichers), function (entity) {
             return entity.type == "${type}";
         })[0];
         $("#type").html(item.type);
-        item.config.forEach(function(element) {
+        item.config.forEach(function (element) {
             $("#configKeys").find("tr:last").after("<tr><td>" + element.name
+ "</td><td>" + element.type + "</td><td>" + element.defaultValue
+ "</td><td>" + element.description + "</td></tr>")
         });
     });

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/2157c98f/usage/cli/src/main/resources/entity.html
----------------------------------------------------------------------
diff --git a/usage/cli/src/main/resources/entity.html b/usage/cli/src/main/resources/entity.html
index 2255e78..d4d2fe7 100644
--- a/usage/cli/src/main/resources/entity.html
+++ b/usage/cli/src/main/resources/entity.html
@@ -1,56 +1,88 @@
-<html lang="en">
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
 <head>
-    <meta charset="utf-8">
     <title>Brooklyn - ${name}</title>
+    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
+    <link rel="stylesheet" href="../items.css" type="text/css" media="screen"/>
 </head>
 <body>
-<h1>${name}</h1>
-Type: <span id="type"></span>
-<h2>Config Keys</h2>
-<table id="configKeys">
-    <tr>
-        <th>Name</th>
-        <th>Type</th>
-        <th>Default Value</th>
-        <th>Description</th>
-    </tr>
-</table>
-<br>
-<h2>Sensors</h2>
-<table id="sensors">
-    <tr>
-        <th>Name</th>
-        <th>Type</th>
-        <th>Description</th>
-    </tr>
-</table>
-<br>
-<h2>Effectors</h2>
-<table id="effectors">
-    <tr>
-        <th>Name</th>
-        <th>Type</th>
-        <th>Description</th>
-    </tr>
-</table>
-<br>
+<div id="container">
+    <div id="header">
+        <div id="identity">
+            <a href="http://brooklyncentral.github.com/" rel="home">Brooklyn</a>
+        </div>
+    </div>
+    <div id="content" class="objectContent">
+        <h1>${name}</h1>
+        <h2 class="typeLabel">Type:</h2><span id="type"></span>
+
+        <h2>Config Keys</h2>
+        <table id="configKeys">
+            <tr>
+                <th>Name</th>
+                <th>Type</th>
+                <th>Default Value</th>
+                <th>Description</th>
+            </tr>
+        </table>
+        <br>
+
+        <h2>Sensors</h2>
+        <table id="sensors">
+            <tr>
+                <th>Name</th>
+                <th>Type</th>
+                <th>Description</th>
+            </tr>
+        </table>
+        <br>
+
+        <h2>Effectors</h2>
+        <table id="effectors">
+            <tr>
+                <th>Name</th>
+                <th>Type</th>
+                <th>Description</th>
+            </tr>
+        </table>
+        <br>
+    </div>
+</div>
+
 <script src="http://code.jquery.com/jquery-1.11.1.min.js" type="text/javascript"></script>
 <script src="../items.js" type="text/javascript"></script>
 <script type="text/javascript">
-    $(document).ready(function() {
-        var item = $.grep((items.entities), function(entity) {
+    $(document).ready(function () {
+        var item = $.grep((items.entities), function (entity) {
             return entity.type == "${type}";
         })[0];
         $("#type").html(item.type);
-        item.config.forEach(function(element) {
-            $("#configKeys").find("tr:last").after("<tr><td>" + element.name
+ "</td><td>" + element.type + "</td><td>" + element.defaultValue
+ "</td><td>" + element.description + "</td></tr>")
+        item.config.forEach(function (element) {
+            $("#configKeys").find("tr:last").after("<tr><td>" + element.name
+ "</td><td>" + element.type + "</td><td>" + element.defaultValue
+ "</td><td class='wordWrap'>" + element.description + "</td></tr>")
         });
-        item.sensors.forEach(function(element) {
-            $("#sensors").find("tr:last").after("<tr><td>" + element.name + "</td><td>"
+ element.type + "</td><td>" + element.description + "</td></tr>")
+        item.sensors.forEach(function (element) {
+            $("#sensors").find("tr:last").after("<tr><td>" + element.name + "</td><td>"
+ element.type + "</td><td class='wordWrap'>" + element.description + "</td></tr>")
         });
         if (item.effectors != undefined) {
             item.effectors.forEach(function (element) {
-                $("#effectors").find("tr:last").after("<tr><td>" + element.name
+ "</td><td>" + element.type + "</td><td>" + element.description +
"</td></tr>")
+                $("#effectors").find("tr:last").after("<tr><td>" + element.name
+ "</td><td>" + element.type + "</td><td  class='wordWrap'>" + element.description
+ "</td></tr>")
             });
         }
     });

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/2157c98f/usage/cli/src/main/resources/items.css
----------------------------------------------------------------------
diff --git a/usage/cli/src/main/resources/items.css b/usage/cli/src/main/resources/items.css
new file mode 100644
index 0000000..e6e87d1
--- /dev/null
+++ b/usage/cli/src/main/resources/items.css
@@ -0,0 +1,217 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+/* landing page */
+body {
+	margin: 0px;
+	padding: 10px 0px 20px 0px;
+	font-family: arial, helvetica, sans-serif;
+	background-color: #ffffff;
+	color: #393939;
+	font-size: 15px;
+}
+
+h1 {
+	margin: 0 0 20px 0;
+	padding: 0;
+	font-size: 32px;
+	font-weight: normal;
+	color: #4d9d3a;
+	border-bottom: 1px solid #e9e9e9;
+}
+
+th {
+	margin: 1.25em 0 20px 0;
+	font-size: 20px;
+	font-weight: normal;
+	color: #4f8243
+}
+
+.typeLabel {
+	display: inline;
+	padding-right: 10px;
+}
+
+table {
+	border: 1px solid #f0f0f0;
+	border-radius: 5px;
+	background-color: #fcfcfc;
+	border-collapse: collapse;
+    padding: 6px;
+}
+
+td {
+    border-bottom: 1px solid #f0f0f0;
+    padding: 6px;
+    max-width: 350px;
+    white-space: -moz-pre-wrap !important;  /* Mozilla, since 1999 */
+	white-space: -pre-wrap;      /* Opera 4-6 */
+	white-space: -o-pre-wrap;    /* Opera 7 */
+	white-space: pre-wrap;       /* css-3 */
+	word-wrap: break-word;       /* Internet Explorer 5.5+ */
+	word-break: break-all;
+	white-space: normal;
+}
+
+.wordWrap {
+	word-break: normal !important;
+}
+
+.location {
+	word-break: keep-all;
+	max-width: 100%;
+}
+
+.objectContent {
+	display: block;
+	clear: both;
+}
+
+#container {
+	width: 980px;
+	padding: 0;
+	margin: 0 auto;
+}
+
+#identity {
+	float: left;
+	margin: 0;
+	padding: 30px 0 15px 10px;
+}
+
+#identity a {
+	text-decoration: none;
+	display: block;
+	margin: 0;
+	color: #4d9d3a;
+	font-size: 2.5em;
+	padding: 0;
+	background: transparent url(images/brooklyn.gif) no-repeat 0 0;
+	width: 206px;
+	height: 44px;
+	text-indent: -1000px;
+	overflow: hidden;
+}
+
+#menubar {
+	clear: both;
+	width: 978px;
+	height: 34px;
+	background-color: #e8eded;
+	border: 1px solid #d5dade;
+	-moz-border-radius: 8px;
+	border-radius: 8px;
+}
+
+#mainmenu {
+	list-style: none;
+	margin: 0;
+	padding: 4px 0 0 2px;
+	width: 765px;
+	display: block;
+	float: left;
+	font-size: 15px;
+}
+
+#mainmenu li {
+	float: left;
+	position: relative;
+	margin: 0;
+	padding: 0;
+}
+
+#mainmenu>li {
+	border: 1px solid transparent;
+	border-top-left-radius: 5px;
+	-moz-border-radius-topleft: 5px;
+	border-top-right-radius: 5px;
+	-moz-border-radius-topright: 5px;
+	border-bottom: 0;
+}
+
+#mainmenu a {
+	display: block;
+	text-decoration: none;
+	color: #508243;
+}
+
+#mainmenu>li>a {
+	padding: 0 8px 5px 8px;
+	line-height: 25px;
+}
+
+#mainmenu>li:hover {
+	background-color: #ffffff;
+	border: 1px solid #dbe0e4;
+	border-bottom: 0;
+}
+
+#mainmenu .current a {
+	color: #838a8b;
+}
+
+#mainmenu ul {
+	display: none;
+	position: absolute;
+	top: 30px;
+	left: -1px;
+	float: left;
+	background-color: #f5f5f5;
+	border: 1px solid #dbe0e4;
+	border-top: 0;
+	list-style: none;
+	margin: 0;
+	padding: 5px;
+	width: 185px;
+}
+
+#mainmenu ul ul {
+	left: 100%;
+	margin-left: 6px;
+	top: -1px;
+	border-top: 1px solid #dbe0e4;
+}
+
+#mainmenu ul li {
+	width: 183px;
+	padding: 0;
+	border: 1px solid transparent;
+}
+
+#mainmenu ul li:hover {
+	border: 1px solid #dbe0e4;
+	background-color: #ffffff;
+}
+
+#mainmenu ul a {
+	font-size: 14px;
+	padding: 7px;
+}
+
+#mainmenu li:hover>ul,#mainmenu li.sfHover>ul {
+	display: block;
+}
+
+#content {
+	overflow: scroll;
+	height: 1000px;
+}
+
+#content a {
+	color: #4f8243;
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/2157c98f/usage/cli/src/main/resources/location.html
----------------------------------------------------------------------
diff --git a/usage/cli/src/main/resources/location.html b/usage/cli/src/main/resources/location.html
index 6c9aad5..3da1108 100644
--- a/usage/cli/src/main/resources/location.html
+++ b/usage/cli/src/main/resources/location.html
@@ -1,32 +1,60 @@
-<html lang="en">
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
 <head>
-    <meta charset="utf-8">
     <title>Brooklyn Location - ${type}</title>
+    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
+    <link rel="stylesheet" href="../items.css" type="text/css" media="screen"/>
 </head>
 <body>
-<h1>${type}</h1>
-Type: <span id="type"></span>
-<h2>Config Keys</h2>
-<table id="configKeys">
-    <tr>
-        <th>Name</th>
-        <th>Type</th>
-        <th>Default Value</th>
-        <th>Description</th>
-    </tr>
-</table>
-<br>
+<div id="container">
+    <div id="header">
+        <div id="identity">
+            <a href="http://brooklyncentral.github.com/" rel="home">Brooklyn</a>
+        </div>
+    </div>
+    <div id="content" class="objectContent">
+        <h1>${type}</h1>
+        <h2 class="typeLabel">Type:</h2><span id="type"></span>
 
+        <h2>Config Keys</h2>
+        <table id="configKeys">
+            <tr>
+                <th>Name</th>
+                <th>Type</th>
+                <th>Default Value</th>
+                <th>Description</th>
+            </tr>
+        </table>
+        <br>
+    </div>
+</div>
 <script src="http://code.jquery.com/jquery-1.11.1.min.js" type="text/javascript"></script>
 <script src="../items.js" type="text/javascript"></script>
 <script type="text/javascript">
-    $(document).ready(function() {
-        var item = $.grep((items.locations), function(entity) {
+    $(document).ready(function () {
+        var item = $.grep((items.locations), function (entity) {
             return entity.type == "${type}";
         })[0];
         $("#type").html(item.type);
-        item.config.forEach(function(element) {
-            $("#configKeys").find("tr:last").after("<tr><td>" + element.name
+ "</td><td>" + element.type + "</td><td>" + element.defaultValue
+ "</td><td>" + element.description + "</td></tr>")
+        item.config.forEach(function (element) {
+            $("#configKeys").find("tr:last").after("<tr><td>" + element.name
+ "</td><td>" + element.type + "</td><td>" + element.defaultValue
+ "</td><td class='wordWrap'>" + element.description + "</td></tr>")
         });
     });
 </script>

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/2157c98f/usage/cli/src/main/resources/policy.html
----------------------------------------------------------------------
diff --git a/usage/cli/src/main/resources/policy.html b/usage/cli/src/main/resources/policy.html
index c2f3ea8..4fc1f59 100644
--- a/usage/cli/src/main/resources/policy.html
+++ b/usage/cli/src/main/resources/policy.html
@@ -1,32 +1,61 @@
-<html lang="en">
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
 <head>
-    <meta charset="utf-8">
     <title>Brooklyn Policy - ${name}</title>
+    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
+    <link rel="stylesheet" href="../items.css" type="text/css" media="screen"/>
 </head>
 <body>
-<h1>${name}</h1>
-Type: <span id="type"></span>
-<h2>Config Keys</h2>
-<table id="configKeys">
-    <tr>
-        <th>Name</th>
-        <th>Type</th>
-        <th>Default Value</th>
-        <th>Description</th>
-    </tr>
-</table>
-<br>
+<div id="container">
+    <div id="header">
+        <div id="identity">
+            <a href="http://brooklyncentral.github.com/" rel="home">Brooklyn</a>
+        </div>
+    </div>
+    <div id="content" class="objectContent">
+        <h1>${name}</h1>
+        <h2 class="typeLabel">Type:</h2><span id="type"></span>
+
+        <h2>Config Keys</h2>
+        <table id="configKeys">
+            <tr>
+                <th>Name</th>
+                <th>Type</th>
+                <th>Default Value</th>
+                <th>Description</th>
+            </tr>
+        </table>
+        <br>
+    </div>
+</div>
 
 <script src="http://code.jquery.com/jquery-1.11.1.min.js" type="text/javascript"></script>
 <script src="../items.js" type="text/javascript"></script>
 <script type="text/javascript">
-    $(document).ready(function() {
-        var item = $.grep((items.policies), function(entity) {
+    $(document).ready(function () {
+        var item = $.grep((items.policies), function (entity) {
             return entity.type == "${type}";
         })[0];
         $("#type").html(item.type);
-        item.config.forEach(function(element) {
-            $("#configKeys").find("tr:last").after("<tr><td>" + element.name
+ "</td><td>" + element.type + "</td><td>" + element.defaultValue
+ "</td><td>" + element.description + "</td></tr>")
+        item.config.forEach(function (element) {
+            $("#configKeys").find("tr:last").after("<tr><td>" + element.name
+ "</td><td>" + element.type + "</td><td>" + element.defaultValue
+ "</td><td class='wordWrap'>" + element.description + "</td></tr>")
         });
     });
 </script>


Mime
View raw message