use of com.sun.web.ui.view.html.CCCheckBox in project OpenAM by OpenRock.
the class AMPropertySheet method setValuesToMultipleChoices.
private boolean setValuesToMultipleChoices(ViewBean parent, String name, Object values, AMModel amModel, AMPropertySheetModel model) {
boolean set = false;
if (Set.class.isInstance(values)) {
for (Iterator i = ((Set) values).iterator(); i.hasNext(); ) {
String val = (String) i.next();
if ((val != null) && (val.indexOf('=') == -1)) {
val = escapeSqBracket(val);
try {
View view = parent.getChild(PropertyTemplate.DYN_GUI_MULTIPLE_LIST_CHECKBOX_PREFIX + name + "_" + val);
if (view instanceof CCCheckBox) {
((CCCheckBox) view).setChecked(true);
}
set = true;
} catch (IllegalArgumentException e) {
//ok if it is not found.
}
}
}
}
return set;
}
use of com.sun.web.ui.view.html.CCCheckBox in project OpenAM by OpenRock.
the class CreateHostedSPViewBean method beginDisplay.
public void beginDisplay(DisplayEvent e) {
String value = (String) getDisplayFieldValue(HAS_META_DATA);
if ((value == null) || value.equals("")) {
setDisplayFieldValue(HAS_META_DATA, "no");
}
value = (String) getDisplayFieldValue(SELECT_COT);
if ((value == null) || value.equals("")) {
setDisplayFieldValue(SELECT_COT, "no");
}
value = (String) getDisplayFieldValue(RADIO_EXTENDED);
if ((value == null) || value.equals("")) {
setDisplayFieldValue(RADIO_EXTENDED, "file");
}
value = (String) getDisplayFieldValue(RADIO_META);
if ((value == null) || value.equals("")) {
setDisplayFieldValue(RADIO_META, "file");
}
setDisplayFieldValue(ENTITY_ID, (AMSystemConfig.isConsoleRemote) ? SystemProperties.getServerInstanceName() : getRequestURL());
populateTableModel();
Set userAttrNames = AMAdminUtils.getUserAttributeNames();
userAttrNames.remove("iplanet-am-user-account-life");
CCDropDownMenu menuUserAttribute = (CCDropDownMenu) getChild("menuUserAttributes");
OptionList optList = createOptionList(userAttrNames);
optList.add(0, "name.attribute.mapping.select", "");
menuUserAttribute.setOptions(optList);
CCCheckBox cbAttrDefault = (CCCheckBox) getChild("tfDefaultAttrMapping");
cbAttrDefault.setChecked(true);
try {
TaskModel model = (TaskModel) getModel();
Set realms = model.getRealms();
CCDropDownMenu menuRealm = (CCDropDownMenu) getChild(REALM);
menuRealm.setOptions(createOptionList(realms));
String realm = getRequestContext().getRequest().getParameter("realm");
if (realm != null && !realm.trim().isEmpty()) {
setDisplayFieldValue(REALM, realm);
}
} catch (AMConsoleException ex) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", ex.getMessage());
}
}
use of com.sun.web.ui.view.html.CCCheckBox in project OpenAM by OpenRock.
the class UMUserPasswordResetOptionsViewBean method handleButton1Request.
/**
* Handles save password options request.
*
* @param event Request invocation event.
* @throws ModelControlException if action table model state cannot be
* restored.
*/
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
List optionData = restoreOptionsData();
CCCheckBox cbForceResetPwd = (CCCheckBox) getChild(CB_FORCE_RESET_PWD);
boolean forceResetPwd = cbForceResetPwd.isChecked();
UMUserPasswordResetOptionsModel model = (UMUserPasswordResetOptionsModel) getModel();
String userId = (String) getPageSessionAttribute(EntityEditViewBean.UNIVERSAL_ID);
try {
model.modifyUserOption(optionData, userId, forceResetPwd);
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", model.getLocalizedString("profile.updated"));
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
forwardTo();
}
use of com.sun.web.ui.view.html.CCCheckBox in project OpenAM by OpenRock.
the class UMUserPasswordResetOptionsViewBean method beginDisplay.
public void beginDisplay(DisplayEvent event) throws ModelControlException {
super.beginDisplay(event);
if (!tblModelPopulated) {
getQuestions();
CCCheckBox cbForceResetPwd = (CCCheckBox) getChild(CB_FORCE_RESET_PWD);
UMUserPasswordResetOptionsModel model = (UMUserPasswordResetOptionsModel) getModel();
String userId = (String) getPageSessionAttribute(EntityEditViewBean.UNIVERSAL_ID);
cbForceResetPwd.setChecked(model.isForceReset(userId));
}
}
use of com.sun.web.ui.view.html.CCCheckBox in project OpenAM by OpenRock.
the class ServerEditViewBeanBase method setConfigProperties.
private void setConfigProperties(String serverName, ServerSiteModel model) throws AMConsoleException {
if (!submitCycle) {
Map attributeValues = model.getServerConfiguration(serverName);
for (String name : activePropertyNames) {
String propertyName = getActualPropertyName(name);
String val = (String) attributeValues.get(propertyName);
if (val == null) {
propertySheetModel.setValue(name, "");
} else {
View view = this.getChild(name);
if (view instanceof CCCheckBox) {
String trueValue = ServerPropertyValidator.getTrueValue(propertyName);
String v = (val.equals(trueValue)) ? "true" : "false";
propertySheetModel.setValue(name, v);
} else if (view instanceof CCEditableList) {
CCEditableList list = (CCEditableList) view;
list.resetStateData();
// The list is stored as a comma delimited String
list.getModel().setOptionList(CollectionUtils.asSet(val.split(",")));
propertySheetModel.setValue(name, val);
} else {
propertySheetModel.setValue(name, XMLUtils.escapeSpecialCharacters(val));
}
}
}
}
}
Aggregations