FELIX-604 Add plugin to disply LICENSE and NOTICE files contained
in installed bundles
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@667359 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/webconsole/src/main/resources/res/ui/license.css b/webconsole/src/main/resources/res/ui/license.css
new file mode 100644
index 0000000..f371c35
--- /dev/null
+++ b/webconsole/src/main/resources/res/ui/license.css
@@ -0,0 +1,49 @@
+/*
+ * 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.
+ */ /* CSS Document */
+#licenseContent {
+ position: relative;
+ margin-top: 25px; padding : 5px;
+ width: 100%;
+ padding: 5px;
+}
+
+#licenseLeft {
+ width: 300px;
+ border-right: 1px black solid;
+}
+
+#licenseRight {
+ position: absolute;
+ top: 5px;
+ left: 305px;
+ padding: 5px;
+ width: 650px;
+ border-left: 1px black solid;
+}
+
+#licenseClear {
+ clear: both;
+ height: 1px;
+}
+
+.licenseButtons {
+ padding: 5px;
+}
+
+.licenseDetails {
+ padding: 5px;
+}
\ No newline at end of file
diff --git a/webconsole/src/main/resources/res/ui/license.js b/webconsole/src/main/resources/res/ui/license.js
new file mode 100644
index 0000000..a8cbb1f
--- /dev/null
+++ b/webconsole/src/main/resources/res/ui/license.js
@@ -0,0 +1,82 @@
+/*
+ * 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.
+ */
+
+function displayBundle(/* String */ bundleId)
+{
+ var theBundleData = bundleData[bundleId];
+ if (!theBundleData)
+ {
+ return;
+ }
+
+ var title = theBundleData.title;
+
+ var licenseButtons = document.getElementById('licenseButtons');
+ if (licenseButtons) {
+
+ var innerHTML = "";
+ for (var name in theBundleData.files)
+ {
+ var entry = theBundleData.files[name];
+ var buttons = "";
+ for (var idx in entry)
+ {
+ var descr = entry[idx];
+ buttons += "<a href='javascript:displayFile(\"" + bundleId + "\", \"" + name + "\", " + idx + ");'"
+ + " >" + descr.url + "</a> ";
+ }
+ if (buttons)
+ {
+ innerHTML += name + ": " + buttons + "<br />";
+ }
+ }
+
+ if (!innerHTML)
+ {
+ innerHTML = "<em>The Bundle contains neither LICENSE nor NOTICE files</em>";
+ }
+
+ licenseButtons.innerHTML = "<h1>" + title + "</h1>" + innerHTML;
+ }
+
+ var licenseDetails = document.getElementById('licenseDetails');
+ if (licenseDetails)
+ {
+ licenseDetails.innerHTML = "";
+ }
+}
+
+function displayFile ( /* String */ bundleId, /* String */ name, /* int */ idx )
+{
+ var theBundleData = bundleData[bundleId];
+ if (!theBundleData)
+ {
+ return;
+ }
+
+ var file = theBundleData.files[name][idx];
+ if (!file)
+ {
+ return;
+ }
+
+ var licenseDetails = document.getElementById('licenseDetails');
+ if (licenseDetails)
+ {
+ licenseDetails.innerHTML = "<h3>" + name + ": " + file.url + "</h3><pre>" + file.data + "</pre>";
+ }
+}