Resolved FELIX-1996 /Console should warn when config is bound to a different bundle/
https://issues.apache.org/jira/browse/FELIX-1996
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@926009 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/webconsole/src/main/resources/OSGI-INF/l10n/bundle.properties b/webconsole/src/main/resources/OSGI-INF/l10n/bundle.properties
index 8c05008..3ff8e9b 100644
--- a/webconsole/src/main/resources/OSGI-INF/l10n/bundle.properties
+++ b/webconsole/src/main/resources/OSGI-INF/l10n/bundle.properties
@@ -201,6 +201,7 @@
config.title.actions=Actions
config.title.bundle=Bundle
config.title.name=Name
+config.bind.error=Error: the PID "{0}" is bound to "{1}" but the actual managed service is registered from "{2}" bundle
# License plugin
license.pluginTitle=Licenses
diff --git a/webconsole/src/main/resources/res/ui/config.js b/webconsole/src/main/resources/res/ui/config.js
index 6eeeb2b..11061ce 100644
--- a/webconsole/src/main/resources/res/ui/config.js
+++ b/webconsole/src/main/resources/res/ui/config.js
@@ -29,6 +29,7 @@
// editor dialog
var editor = false;
+var editorMessage = false;
function configure(pid, create) {
var uri = pluginRoot + '/' + pid;
@@ -116,6 +117,9 @@
}
printConfigurationInfo(parent, obj);
+ if ( obj.service_location && obj.bundle_location && obj.service_location != obj.bundle_location) {
+ editorMessage.removeClass('ui-helper-hidden').text(i18n.err_bind.msgFormat(obj.pid, obj.bundle_location, obj.service_location));
+ } else editorMessage.addClass('ui-helper-hidden');
initStaticWidgets(editor.attr('__pid', obj.pid).dialog('option', 'title', obj.title).dialog('open'));
}
@@ -521,6 +525,7 @@
closeText: i18n.abort,
buttons : _buttons
});
+ editorMessage = editor.find('p');
// display the configuration data
$(".statline").html(configData.status ? i18n.stat_ok : i18n.stat_missing);
diff --git a/webconsole/src/main/resources/templates/config.html b/webconsole/src/main/resources/templates/config.html
index a013e33..1e60387 100644
--- a/webconsole/src/main/resources/templates/config.html
+++ b/webconsole/src/main/resources/templates/config.html
@@ -23,7 +23,8 @@
del_ask : '${config.del.ask}', // "Are you sure to delete this configuration ?";
del_config : '${config.del.config}', // "Configuration: ";
del_bundle : '${config.del.bundle}', // "Bundle: ";
- unbind_ask : '${config.unbind.ask}' // "Are you sure to unbind this configuration ?"
+ unbind_ask : '${config.unbind.ask}', // "Are you sure to unbind this configuration ?"
+ err_bind : '${config.bind.error}' // Error: the PID'{0}' is bound to '{1}' but the actual managed service is registered from '{2}' bundle
}
// ]]>
</script>
@@ -72,6 +73,7 @@
<!-- placeholder for property editor -->
<div id="editor" class="ui-helper-hidden">
+ <p class="ui-state-error ui-helper-hidden"> </p>
<table id="editorTable" class="nicetable">
<tr><td> </td></tr>
</table>