Author: fmeschbe
Date: Sat Mar 13 15:09:51 2010
New Revision: 922580
URL: http://svn.apache.org/viewvc?rev=922580&view=rev
Log:
FELIX-569 Apply config-name_column-sorting.patch by Valentin Valchev (thanks)
Modified:
felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManagerBase.java
felix/trunk/webconsole/src/main/resources/res/ui/config.js
felix/trunk/webconsole/src/main/resources/templates/config.html
Modified:
felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManagerBase.java
URL:
http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManagerBase.java?rev=922580&r1=922579&r2=922580&view=diff
==============================================================================
---
felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManagerBase.java
(original)
+++
felix/trunk/webconsole/src/main/java/org/apache/felix/webconsole/internal/compendium/ConfigManagerBase.java
Sat Mar 13 15:09:51 2010
@@ -124,7 +124,20 @@ abstract class ConfigManagerBase extends
final String[] idList = idGetter.getIds( mti );
for ( int j = 0; idList != null && j < idList.length; j++ )
{
- ObjectClassDefinition ocd =
mti.getObjectClassDefinition( idList[j], locale );
+ // After getting the list of PIDs, a configuration
might be
+ // removed. So the getObjectClassDefinition will throw
+ // an exception, and this will prevent ALL
configuration from
+ // being displayed. By catching it, the configurations
will be
+ // visible
+ ObjectClassDefinition ocd = null;
+ try
+ {
+ ocd = mti.getObjectClassDefinition( idList[j],
locale );
+ }
+ catch (IllegalArgumentException ignore)
+ {
+ // ignore - just don't show this configuration
+ }
if ( ocd != null )
{
objectClasses.add( ocd );
@@ -189,7 +202,15 @@ abstract class ConfigManagerBase extends
MetaTypeInformation mti = mts.getMetaTypeInformation( bundle );
if ( mti != null )
{
- return mti.getObjectClassDefinition( pid, locale );
+ // see #getObjectClasses( final IdGetter idGetter, final
String locale )
+ try
+ {
+ return mti.getObjectClassDefinition( pid, locale );
+ }
+ catch (IllegalArgumentException e)
+ {
+ // ignore - return null
+ }
}
}
}
Modified: felix/trunk/webconsole/src/main/resources/res/ui/config.js
URL:
http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/resources/res/ui/config.js?rev=922580&r1=922579&r2=922580&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/resources/res/ui/config.js (original)
+++ felix/trunk/webconsole/src/main/resources/res/ui/config.js Sat Mar 13
15:09:51 2010
@@ -426,8 +426,8 @@ function confirmUnbind(/* String */ titl
function addConfig(conf) {
var tr = configRow.clone().appendTo(configBody);
- tr.find('td:eq(0)').text(conf.fpid ? conf.fpid : '-'); // fpid
- tr.find('td:eq(1)').text(conf.name).click(function() { // name & edit
+ tr.find('td:eq(1)').text(conf.fpid ? conf.fpid : '-'); // fpid
+ tr.find('td:eq(0)').text(conf.name).click(function() { // name & edit
configure(conf.id);
});
tr.find('td:eq(2)').html(conf.bundle ? '<a href="' + pluginRoot +
'/../bundles/' + conf.bundle + '">' + conf.bundle_name + '</a>' : '-'); //
binding
@@ -454,8 +454,8 @@ function addConfig(conf) {
function addFactoryConfig(conf) {
var tr = factoryRow.clone().appendTo(factoryBody);
- tr.find('td:eq(0)').text(conf.id); // fpid
- tr.find('td:eq(1)').text(conf.name).click(function() { // name & edit
+ tr.find('td:eq(1)').text(conf.id); // fpid
+ tr.find('td:eq(0)').text(conf.name).click(function() { // name & edit
configure(conf.id, true);
});
// buttons
@@ -480,7 +480,7 @@ $(document).ready(function() {
});
factoryBody = factoryTable.find('tbody');
factoryRow = factoryBody.find('tr').clone();
-
+
// setup button - cannot inline in dialog option because of i18n
var _buttons = {};
_buttons[i18n.abort] = function() {
@@ -511,6 +511,11 @@ $(document).ready(function() {
for(var i in configData.pids) addConfig(configData.pids[i]);
for(var i in configData.fpids)
addFactoryConfig(configData.fpids[i]);
initStaticWidgets(configContent);
+
+ // initial sorting orger by name
+ var sorting = [[0,0]];
+ configTable.trigger('sorton', [sorting]);
+ factoryTable.trigger('sorton', [sorting]);
} else {
configContent.addClass('ui-helper-hidden');
}
Modified: felix/trunk/webconsole/src/main/resources/templates/config.html
URL:
http://svn.apache.org/viewvc/felix/trunk/webconsole/src/main/resources/templates/config.html?rev=922580&r1=922579&r2=922580&view=diff
==============================================================================
--- felix/trunk/webconsole/src/main/resources/templates/config.html [UTF-8]
(original)
+++ felix/trunk/webconsole/src/main/resources/templates/config.html [UTF-8] Sat
Mar 13 15:09:51 2010
@@ -39,17 +39,17 @@ var i18n = { // i18n
<table class="tablesorter nicetable noauto">
<thead>
<tr>
- <th class="col_FPID">Factory PID</th>
<th class="col_Name">Name</th>
+ <th class="col_FPID">Factory PID</th>
<th class="col_Binding">Bundle</th>
<th class="col_Actions" style="width:
7em">Actions</th>
</tr>
</thead>
<tbody>
<tr>
- <td> </td>
<td class="pointer"> </td>
<td> </td>
+ <td> </td>
<td>
<ul class="icons">
<li class="dynhover"
title="${config.edit.tip}"><span class="ui-icon
ui-icon-pencil"> </span></li>
@@ -67,15 +67,15 @@ var i18n = { // i18n
<table class="tablesorter nicetable noauto">
<thead>
<tr>
- <th class="col_FPID">Factory PID</th>
<th class="col_Name">Name</th>
+ <th class="col_FPID">Factory PID</th>
<th class="col_Actions" style="width:
7em">Actions</th>
</tr>
</thead>
<tbody>
<tr>
- <td> </td>
<td class="pointer"> </td>
+ <td> </td>
<td>
<ul class="icons">
<li class="dynhover"
title="${config.create.tip}"><span class="ui-icon
ui-icon-plusthick"> </span></li>