summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2012-05-07 09:04:45 (EDT)
committerManik Kishore2012-06-19 07:28:51 (EDT)
commit42233b5adc978486e1bcb9445e9f80d85138dd5d (patch)
treec972348987ae76c51ca61d57cf5891760eeef49c
parent35b71f9287296b72a96d05cb52031fa8abee0f3a (diff)
downloadorg.eclipse.stardust.ui.web-42233b5adc978486e1bcb9445e9f80d85138dd5d.zip
org.eclipse.stardust.ui.web-42233b5adc978486e1bcb9445e9f80d85138dd5d.tar.gz
org.eclipse.stardust.ui.web-42233b5adc978486e1bcb9445e9f80d85138dd5d.tar.bz2
Jira-ID: CRNT-23229
1)Made changes to PreferenceManagerTableEntry.java constructor to include the UserFullName and PartitionId . 2)Added support for Sorting in createTable() of PreferenceManagerBean.java git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@56119 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--admin-portal/src/main/java/org/eclipse/stardust/ui/web/admin/views/PreferenceManagerBean.java16
-rw-r--r--admin-portal/src/main/java/org/eclipse/stardust/ui/web/admin/views/PreferenceManagerTableEntry.java24
2 files changed, 32 insertions, 8 deletions
diff --git a/admin-portal/src/main/java/org/eclipse/stardust/ui/web/admin/views/PreferenceManagerBean.java b/admin-portal/src/main/java/org/eclipse/stardust/ui/web/admin/views/PreferenceManagerBean.java
index f027156..c7dbf06 100644
--- a/admin-portal/src/main/java/org/eclipse/stardust/ui/web/admin/views/PreferenceManagerBean.java
+++ b/admin-portal/src/main/java/org/eclipse/stardust/ui/web/admin/views/PreferenceManagerBean.java
@@ -133,6 +133,7 @@ public class PreferenceManagerBean extends UIComponentBean implements ViewEventH
QueryService qService = SessionContext.findSessionContext().getServiceFactory().getQueryService();
List<Preferences> prefs = new ArrayList<Preferences>();
prefList.clear();
+ String userFullName = null;
if (VIEW_TYPE.TENENT.name().equals(selectedView))
{
// fetch all the Partition preferences
@@ -144,6 +145,7 @@ public class PreferenceManagerBean extends UIComponentBean implements ViewEventH
if (userWrapper != null)
{
User u = userWrapper.getUser();
+ userFullName = userWrapper.getFullName();
// fetch all preference store entries for User, the moduleId and PreferenceId
// can be passed as '*'
prefs = qService.getAllPreferences(PreferenceQuery.findPreferencesForUsers(u.getRealm().getId(), u.getId(),
@@ -157,8 +159,10 @@ public class PreferenceManagerBean extends UIComponentBean implements ViewEventH
for (Map.Entry<String, Serializable> entry : pref11.entrySet())
{
- prefList.add(new PreferenceManagerTableEntry(pref.getScope().name(), pref.getModuleId(), pref
- .getPreferencesId(), entry.getKey(), entry.getValue().toString()));
+ prefList
+ .add(new PreferenceManagerTableEntry(pref.getScope().name(), pref.getModuleId(), pref
+ .getPreferencesId(), entry.getKey(), entry.getValue().toString(), pref.getPartitionId(),
+ userFullName));
}
}
@@ -175,19 +179,19 @@ public class PreferenceManagerBean extends UIComponentBean implements ViewEventH
fixedCols.add(scopeCol);
ColumnPreference moduleIdCol = new ColumnPreference("ModuleId", "moduleId", ColumnDataType.STRING, getMessages()
- .getString("moduleId.label"), null, true, false);
+ .getString("moduleId.label"), null, true, true);
fixedCols.add(moduleIdCol);
ColumnPreference preferenceIdCol = new ColumnPreference("PreferenceId", "preferenceId", ColumnDataType.STRING,
- getMessages().getString("preferenceId.label"), null, true, false);
+ getMessages().getString("preferenceId.label"), null, true, true);
fixedCols.add(preferenceIdCol);
ColumnPreference preferenceNameCol = new ColumnPreference("PreferenceName", "preferenceName",
- ColumnDataType.STRING, getMessages().getString("preferenceName.label"), null, true, false);
+ ColumnDataType.STRING, getMessages().getString("preferenceName.label"), null, true, true);
fixedCols.add(preferenceNameCol);
ColumnPreference preferenceValueCol = new ColumnPreference("PreferenceValue", "preferenceValue",
- ColumnDataType.STRING, getMessages().getString("preferenceValue.label"), null, true, false);
+ ColumnDataType.STRING, getMessages().getString("preferenceValue.label"), null, true, true);
fixedCols.add(preferenceValueCol);
List<ColumnPreference> selectableCols = new ArrayList<ColumnPreference>();
diff --git a/admin-portal/src/main/java/org/eclipse/stardust/ui/web/admin/views/PreferenceManagerTableEntry.java b/admin-portal/src/main/java/org/eclipse/stardust/ui/web/admin/views/PreferenceManagerTableEntry.java
index 2792e1d..5ef931b 100644
--- a/admin-portal/src/main/java/org/eclipse/stardust/ui/web/admin/views/PreferenceManagerTableEntry.java
+++ b/admin-portal/src/main/java/org/eclipse/stardust/ui/web/admin/views/PreferenceManagerTableEntry.java
@@ -31,10 +31,10 @@ public class PreferenceManagerTableEntry extends DefaultRowModel
private boolean selected;
public PreferenceManagerTableEntry(String scope, String moduleId, String preferenceId, String preferenceName,
- String preferenceValue)
+ String preferenceValue, String partitionId, String userName)
{
super();
- this.scope = scope;
+ this.scope = scope + getPreferenceScope(partitionId, userName);
this.moduleId = moduleId;
this.preferenceId = preferenceId;
this.preferenceName = preferenceName;
@@ -76,4 +76,24 @@ public class PreferenceManagerTableEntry extends DefaultRowModel
this.selected = selected;
}
+ /**
+ * Utility method which returns the User Full Name or Partition Id for preference
+ *
+ * @param partitionId
+ * @param userName
+ * @return
+ */
+ private String getPreferenceScope(String partitionId, String userName)
+ {
+ if (null != userName)
+ {
+ return "(" + userName + ")";
+ }
+ else
+ {
+ return " (" + partitionId + ")";
+ }
+
+ }
+
}