summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2012-06-12 05:49:01 (EDT)
committer Manik Kishore2012-06-19 07:31:43 (EDT)
commitd4b35c0c7f90202d6668ca4daa2c8f4e23d74413 (patch)
treec202935124007090deecc6c1514d153ee7e47f8f
parent964b5f085500eb57ec96aa38f0e8cc559c3b40af (diff)
downloadorg.eclipse.stardust.ui.web-d4b35c0c7f90202d6668ca4daa2c8f4e23d74413.zip
org.eclipse.stardust.ui.web-d4b35c0c7f90202d6668ca4daa2c8f4e23d74413.tar.gz
org.eclipse.stardust.ui.web-d4b35c0c7f90202d6668ca4daa2c8f4e23d74413.tar.bz2
Jira-ID: CRNT-25071
1)Removed the code to convert from String type to actual value type i.e float,String. 2)Added code to convert from String to Boolean in CriticalityConfigurationBean git-svn-id: http://emeafrazerg/svn/ipp/product/trunk/stardust/ui.web@56999 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b
-rw-r--r--admin-portal/src/main/java/org/eclipse/stardust/ui/web/admin/views/CreateOrModifyPreferenceBean.java33
-rw-r--r--admin-portal/src/main/java/org/eclipse/stardust/ui/web/admin/views/criticality/CriticalityConfigurationBean.java29
-rw-r--r--admin-portal/src/main/resources/META-INF/xhtml/views/createOrModifyPreference.xhtml9
3 files changed, 21 insertions, 50 deletions
diff --git a/admin-portal/src/main/java/org/eclipse/stardust/ui/web/admin/views/CreateOrModifyPreferenceBean.java b/admin-portal/src/main/java/org/eclipse/stardust/ui/web/admin/views/CreateOrModifyPreferenceBean.java
index 25f07e4..3063771 100644
--- a/admin-portal/src/main/java/org/eclipse/stardust/ui/web/admin/views/CreateOrModifyPreferenceBean.java
+++ b/admin-portal/src/main/java/org/eclipse/stardust/ui/web/admin/views/CreateOrModifyPreferenceBean.java
@@ -162,7 +162,7 @@ public class CreateOrModifyPreferenceBean extends PopupUIComponentBean
Preferences prefs = null;
User user = null;
Map<String, Serializable> preferenceMap = new HashMap<String, Serializable>();
- preferenceMap.put(preferenceBean.getPreferenceName(), (Serializable) parsePreferenceValue(preferenceBean.getPreferenceValue()));
+ preferenceMap.put(preferenceBean.getPreferenceName(), (Serializable) preferenceBean.getPreferenceValue());
UserWrapper userWrapper = getUserSelector().getSelectedValue();
if (partitionPrefSelected)
@@ -222,42 +222,13 @@ public class CreateOrModifyPreferenceBean extends PopupUIComponentBean
}
else
{
- prefs.getPreferences().put(preferenceBean.getPreferenceName(), (Serializable) parsePreferenceValue(preferenceBean.getPreferenceValue()));
+ prefs.getPreferences().put(preferenceBean.getPreferenceName(), (Serializable) preferenceBean.getPreferenceValue());
}
prefs.setUserId(preferenceBean.getUserId());
prefs.setRealmId(preferenceBean.getRealmId());
return prefs;
}
- private Object parsePreferenceValue(String preferenceValue)
- {
- if (null != preferenceValue)
- {
- String prefValue = preferenceValue.toString();
- Scanner numberValidation = new Scanner(prefValue.toString());
- if (numberValidation.hasNextBoolean())
- {
- return Boolean.valueOf(prefValue);
- }
- if (numberValidation.hasNextInt())
- {
- return Integer.valueOf(prefValue);
- }
- else if (numberValidation.hasNextFloat())
- {
- return Float.valueOf(prefValue);
- }
- else if (numberValidation.hasNextDouble())
- {
- return Double.valueOf(prefValue);
- }
- else
- return prefValue;
- }
- else
- return null;
- }
-
@Override
public void initialize()
{}
diff --git a/admin-portal/src/main/java/org/eclipse/stardust/ui/web/admin/views/criticality/CriticalityConfigurationBean.java b/admin-portal/src/main/java/org/eclipse/stardust/ui/web/admin/views/criticality/CriticalityConfigurationBean.java
index ef9cad7..d7d0656 100644
--- a/admin-portal/src/main/java/org/eclipse/stardust/ui/web/admin/views/criticality/CriticalityConfigurationBean.java
+++ b/admin-portal/src/main/java/org/eclipse/stardust/ui/web/admin/views/criticality/CriticalityConfigurationBean.java
@@ -512,13 +512,13 @@ public class CriticalityConfigurationBean extends UIComponentBean implements Vie
Preferences retrievedPrefs = adminService.getPreferences(PreferenceScope.PARTITION,
PreferencesConstants.MODULE_ID_ENGINE_INTERNALS,
PreferencesConstants.PREFERENCE_ID_WORKFLOW_CRITICALITES);
- Boolean criteria = (Boolean) retrievedPrefs.getPreferences().get(ActivityInstanceStateChangeMonitor.CRITICALITY_PREF_RECALC_ONCREATE);
-
- if (null != criteria)
+ Object value = retrievedPrefs.getPreferences().get(
+ ActivityInstanceStateChangeMonitor.CRITICALITY_PREF_RECALC_ONCREATE);
+ if (null != value)
{
- return criteria.booleanValue();
+ return Boolean.parseBoolean(value.toString());
}
-
+
return true; //default true
}
@@ -531,13 +531,14 @@ public class CriticalityConfigurationBean extends UIComponentBean implements Vie
Preferences retrievedPrefs = adminService.getPreferences(PreferenceScope.PARTITION,
PreferencesConstants.MODULE_ID_ENGINE_INTERNALS,
PreferencesConstants.PREFERENCE_ID_WORKFLOW_CRITICALITES);
- Boolean criteria = (Boolean) retrievedPrefs.getPreferences().get(ActivityInstanceStateChangeMonitor.CRITICALITY_PREF_RECALC_ONSUSPEND);
-
- if (null != criteria)
+ Object value = retrievedPrefs.getPreferences().get(
+ ActivityInstanceStateChangeMonitor.CRITICALITY_PREF_RECALC_ONSUSPEND);
+
+ if (null != value)
{
- return criteria.booleanValue();
+ return Boolean.parseBoolean(value.toString());
}
-
+
return true; //default true
}
@@ -550,11 +551,11 @@ public class CriticalityConfigurationBean extends UIComponentBean implements Vie
Preferences retrievedPrefs = adminService.getPreferences(PreferenceScope.PARTITION,
PreferencesConstants.MODULE_ID_ENGINE_INTERNALS,
PreferencesConstants.PREFERENCE_ID_WORKFLOW_CRITICALITES);
- Boolean criteria = (Boolean) retrievedPrefs.getPreferences().get(UpdateCriticalityAction.CRITICALITY_PREF_RECALC_ONPRIORITY);
-
- if (null != criteria)
+ Object value = retrievedPrefs.getPreferences().get(UpdateCriticalityAction.CRITICALITY_PREF_RECALC_ONPRIORITY);
+
+ if (null != value)
{
- return criteria.booleanValue();
+ return Boolean.parseBoolean(value.toString());
}
return true; //default true
diff --git a/admin-portal/src/main/resources/META-INF/xhtml/views/createOrModifyPreference.xhtml b/admin-portal/src/main/resources/META-INF/xhtml/views/createOrModifyPreference.xhtml
index b01fedd..067eddf 100644
--- a/admin-portal/src/main/resources/META-INF/xhtml/views/createOrModifyPreference.xhtml
+++ b/admin-portal/src/main/resources/META-INF/xhtml/views/createOrModifyPreference.xhtml
@@ -92,9 +92,9 @@
value="#{prefManagerBean.messages['preferenceValue.label']}#{messages_admin['common.colon']}"
styleClass="label-form" />
- <ice:inputTextarea id="preferenceValue"
+ <ice:inputTextarea
value="#{createOrModifyPreference.preferenceBean.preferenceValue}"
- required="true" cols="36" rows="5" partialSubmit="true">
+ required="true" cols="36" rows="5">
<pc:automationTag
value="auto-ADM-PrefMngrView-PrefMngrPopup-PreferenceValTxt"
standAlone="false" />
@@ -145,11 +145,10 @@
<ice:panelGroup>
<pc:automationTag value="auto-ADM-PrefMngrView-PrefMngrPopup-BtnsBar" standAlone="false" />
<ice:commandButton value="#{messages_admin['common.ok']}"
- action="#{createOrModifyPreference.apply}" styleClass="button"
- title="#{messages_admin['common.ok']}" immediate="true" />
+ action="#{createOrModifyPreference.apply}" styleClass="button" />
<ice:commandButton value="#{messages_admin['common.cancel']}"
action="#{createOrModifyPreference.closePopup}" immediate="true"
- styleClass="button" title="#{messages_admin['common.cancel']}" />
+ styleClass="button" />
</ice:panelGroup>
</f:facet>
</ice:panelBorder>