Search in sources :

Example 1 with CCCheckBox

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;
}
Also used : TreeSet(java.util.TreeSet) HashSet(java.util.HashSet) LinkedHashSet(java.util.LinkedHashSet) Set(java.util.Set) OrderedSet(com.sun.identity.shared.datastruct.OrderedSet) CCCheckBox(com.sun.web.ui.view.html.CCCheckBox) Iterator(java.util.Iterator) View(com.iplanet.jato.view.View) ContainerView(com.iplanet.jato.view.ContainerView)

Example 2 with CCCheckBox

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());
    }
}
Also used : Set(java.util.Set) CCCheckBox(com.sun.web.ui.view.html.CCCheckBox) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) CCDropDownMenu(com.sun.web.ui.view.html.CCDropDownMenu) OptionList(com.iplanet.jato.view.html.OptionList) TaskModel(com.sun.identity.console.task.model.TaskModel)

Example 3 with CCCheckBox

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();
}
Also used : CCCheckBox(com.sun.web.ui.view.html.CCCheckBox) List(java.util.List) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) UMUserPasswordResetOptionsModel(com.sun.identity.console.user.model.UMUserPasswordResetOptionsModel)

Example 4 with CCCheckBox

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));
    }
}
Also used : CCCheckBox(com.sun.web.ui.view.html.CCCheckBox) UMUserPasswordResetOptionsModel(com.sun.identity.console.user.model.UMUserPasswordResetOptionsModel)

Example 5 with CCCheckBox

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));
                }
            }
        }
    }
}
Also used : CCEditableList(com.sun.web.ui.view.editablelist.CCEditableList) CCCheckBox(com.sun.web.ui.view.html.CCCheckBox) HashMap(java.util.HashMap) Map(java.util.Map) View(com.iplanet.jato.view.View)

Aggregations

CCCheckBox (com.sun.web.ui.view.html.CCCheckBox)11 Set (java.util.Set)6 HashMap (java.util.HashMap)5 Map (java.util.Map)4 View (com.iplanet.jato.view.View)3 CCEditableList (com.sun.web.ui.view.editablelist.CCEditableList)3 HashSet (java.util.HashSet)3 OptionList (com.iplanet.jato.view.html.OptionList)2 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)2 UMUserPasswordResetOptionsModel (com.sun.identity.console.user.model.UMUserPasswordResetOptionsModel)2 Iterator (java.util.Iterator)2 List (java.util.List)2 ContainerView (com.iplanet.jato.view.ContainerView)1 TaskModel (com.sun.identity.console.task.model.TaskModel)1 EncodeAction (com.sun.identity.security.EncodeAction)1 OrderedSet (com.sun.identity.shared.datastruct.OrderedSet)1 CCDropDownMenu (com.sun.web.ui.view.html.CCDropDownMenu)1 CCPassword (com.sun.web.ui.view.html.CCPassword)1 CCSelectableList (com.sun.web.ui.view.html.CCSelectableList)1 CCStaticTextField (com.sun.web.ui.view.html.CCStaticTextField)1