use of com.sun.web.ui.view.html.CCCheckBox in project OpenAM by OpenRock.
the class ServerEditViewBeanBase method getAttributeValues.
protected Map<String, String> getAttributeValues() {
Map<String, String> map = new HashMap<String, String>();
for (String uiName : activePropertyNames) {
View view = getChild(uiName);
String value;
if (view instanceof CCEditableList) {
CCEditableList list = (CCEditableList) view;
list.restoreStateData();
// Create a comma delimited String from the items in the OptionList for storage.
value = StringUtils.join(getValues(list.getModel().getOptionList()), ",");
} else {
value = (String) getDisplayFieldValue(uiName);
}
String propertyName = getActualPropertyName(uiName);
if (view instanceof CCCheckBox) {
value = (value.equals("true")) ? ServerPropertyValidator.getTrueValue(propertyName) : ServerPropertyValidator.getFalseValue(propertyName);
}
if (view instanceof CCPassword) {
// encrypt and include in the map of attribute values to save
if (!AMPropertySheetModel.passwordRandom.equals(value)) {
value = AccessController.doPrivileged(new EncodeAction(value));
map.put(propertyName, value);
}
} else {
map.put(propertyName, value);
}
}
return map;
}
use of com.sun.web.ui.view.html.CCCheckBox in project OpenAM by OpenRock.
the class SessionPropertyConditionEditViewBean method getConditionValues.
protected Map getConditionValues(boolean validate) {
Map map = (Map) getPageSessionAttribute(SessionPropertyConditionHelper.PG_SESSION_PROPERTY_VALUES);
if (map != null) {
map.remove(SessionPropertyCondition.VALUE_CASE_INSENSITIVE);
if (!validate || !map.isEmpty()) {
CCCheckBox cb = (CCCheckBox) getChild(SessionPropertyConditionHelper.CB_CASE);
Set set = new HashSet(2);
set.add(cb.isChecked() ? "true" : "false");
map.put(SessionPropertyCondition.VALUE_CASE_INSENSITIVE, set);
}
} else if (!validate) {
map = new HashMap();
setPageSessionAttribute(SessionPropertyConditionHelper.PG_SESSION_PROPERTY_VALUES, (HashMap) map);
CCCheckBox cb = (CCCheckBox) getChild(SessionPropertyConditionHelper.CB_CASE);
Set set = new HashSet(2);
set.add(cb.isChecked() ? "true" : "false");
map.put(SessionPropertyCondition.VALUE_CASE_INSENSITIVE, set);
}
return map;
}
use of com.sun.web.ui.view.html.CCCheckBox in project OpenAM by OpenRock.
the class SessionPropertyConditionAddViewBean method getConditionValues.
private Map getConditionValues(boolean validate) {
Map map = (Map) getPageSessionAttribute(SessionPropertyConditionHelper.PG_SESSION_PROPERTY_VALUES);
if (map != null) {
map.remove(SessionPropertyCondition.VALUE_CASE_INSENSITIVE);
if (!validate || !map.isEmpty()) {
CCCheckBox cb = (CCCheckBox) getChild(SessionPropertyConditionHelper.CB_CASE);
Set set = new HashSet(2);
set.add(cb.isChecked() ? "true" : "false");
map.put(SessionPropertyCondition.VALUE_CASE_INSENSITIVE, set);
}
} else if (!validate) {
map = new HashMap();
setPageSessionAttribute(SessionPropertyConditionHelper.PG_SESSION_PROPERTY_VALUES, (HashMap) map);
CCCheckBox cb = (CCCheckBox) getChild(SessionPropertyConditionHelper.CB_CASE);
Set set = new HashSet(2);
set.add(cb.isChecked() ? "true" : "false");
map.put(SessionPropertyCondition.VALUE_CASE_INSENSITIVE, set);
}
return map;
}
use of com.sun.web.ui.view.html.CCCheckBox in project OpenAM by OpenRock.
the class SMDiscoveryBootstrapRefOffViewBeanBase method setDirectiveMechIDMapping.
private void setDirectiveMechIDMapping(SMDiscoEntryData smDisco) {
populateDirectiveMechIDRefs(smDisco);
Map directives = smDisco.directives;
Set directiveNames = directives.keySet();
for (Iterator iter = DIRECTIVES_MECHID.iterator(); iter.hasNext(); ) {
String directiveName = (String) iter.next();
String childName = (String) MAP_DIRECTIVES_MECHID.get(directiveName);
CCCheckBox cb = null;
CCStaticTextField staticText = null;
if (canModify) {
cb = (CCCheckBox) getChild(childName.substring(0, childName.length() - 4));
} else {
staticText = (CCStaticTextField) getChild(childName.substring(0, childName.length() - 4));
}
if (directiveNames.contains(directiveName)) {
List refIds = (List) directives.get(directiveName);
if (canModify) {
cb.setChecked(true);
CCSelectableList child = (CCSelectableList) getChild(childName);
if ((refIds != null) && !refIds.isEmpty()) {
child.setValues(refIds.toArray());
} else {
child.setValues(null);
}
} else {
staticText.setValue("true");
CCStaticTextField child = (CCStaticTextField) getChild(childName);
if ((refIds != null) && !refIds.isEmpty()) {
child.setValue(AMAdminUtils.getString(refIds, ",", false));
} else {
child.setValue("");
}
}
} else {
if (canModify) {
cb.setChecked(false);
} else {
staticText.setValue("false");
}
}
}
}
use of com.sun.web.ui.view.html.CCCheckBox in project OpenAM by OpenRock.
the class FSSAMLSetTrustedPartnerTypeViewBean method setCheck.
private void setCheck(String childName) {
CCCheckBox cb = (CCCheckBox) getChild(childName);
cb.setChecked(true);
}
Aggregations