FELIX-2287 Improved Handling of queries on the OBR page:
- accept empty query to select all resources
- print error message if filter string is invalid
- fix WebConsoleUtil.urlDecode to return an empty string if
the value is an empty string (to be inline with the
URLDecode.decode methods).
- add resource symbolic name in parens after presentation
name to differentiate resources with the same presentation
name but different symbolic names
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@984322 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 b194815..7df8e19 100644
--- a/webconsole/src/main/resources/OSGI-INF/l10n/bundle.properties
+++ b/webconsole/src/main/resources/OSGI-INF/l10n/bundle.properties
@@ -225,6 +225,8 @@
obr.repo.title=Bundle Repositories
obr.action.add=Add
obr.action.search=Search
+obr.action.search.description=Enter word contained in bundle presentation \
+ and/or symbolic name or a valid OSGi Filter Expression
obr.action.deploy=Deploy Selected
obr.action.deploystart=Deploy and Start Selected
obr.repo.name=Name
@@ -234,6 +236,7 @@
obr.res.title=Available Resources
obr.res.name=Resource Name
obr.res.installedVer=Installed Version
+obr.error=Error Filtering Resources
# Configuration Status plugin
configStatus.pluginTitle=Configuration Status
diff --git a/webconsole/src/main/resources/res/ui/obr.js b/webconsole/src/main/resources/res/ui/obr.js
index 7c40daa..58e5ffb 100644
--- a/webconsole/src/main/resources/res/ui/obr.js
+++ b/webconsole/src/main/resources/res/ui/obr.js
@@ -137,7 +137,14 @@
blockElement.appendChild(titleElement);
titleElement.appendChild(inputElement);
titleElement.appendChild(text(" "));
- titleElement.appendChild(text(res.presentationname ? res.presentationname : res.symbolicname));
+ if (res.presentationname) {
+ titleElement.appendChild(text(res.presentationname));
+ titleElement.appendChild(text(" ("));
+ titleElement.appendChild(text(res.symbolicname));
+ titleElement.appendChild(text(")"));
+ } else {
+ titleElement.appendChild(text(res.symbolicname));
+ }
$(titleElement).click(function() {showVersions(res.symbolicname)});
_tr = tr( null, { 'id' : 'row' + _id } , [
@@ -426,11 +433,17 @@
$('#detailsTable').removeClass('ui-helper-hidden');
for (var i in obrData.resources ) {
renderDetailedResource( obrData.resources[i] );
- }
- } else {
+ }
+ } else if (obrData.resources) {
for (var i in obrData.resources ) {
renderResource( obrData.resources[i] );
- }
+ }
+ } else if (obrData.error) {
+ _tr = tr( "ui-state-error", null , [
+ td( "ui-state-error-text", { 'colspan': '2' },
+ [ text(i18n.error + ": " + obrData.error) ] )
+ ]);
+ resTable.append( _tr );
}
} else {
$('.statline').html(i18n.status_no);
diff --git a/webconsole/src/main/resources/templates/obr.html b/webconsole/src/main/resources/templates/obr.html
index 19a89f5..e54283d 100644
--- a/webconsole/src/main/resources/templates/obr.html
+++ b/webconsole/src/main/resources/templates/obr.html
@@ -3,7 +3,8 @@
var i18n = {
status_ok : '${obr.status.ok}',
status_no : '${obr.status.no}',
- selectVersion : '${obr.version.select}'
+ selectVersion : '${obr.version.select}',
+ error : '${obr.error}'
}
var obrData = ${__data__};
</script>
@@ -75,7 +76,7 @@
<a href="${pluginRoot}?list=z">Z</a>
<a href="${pluginRoot}?list=-">?</a>
</span>
- <input type="text" id="searchField"/>
+ <input type="text" id="searchField" title="${obr.action.search.description}"/>
<button id="searchBtn">${obr.action.search}</button>
</div>