Search in sources :

Example 6 with CCRadioButton

use of com.sun.web.ui.view.html.CCRadioButton in project OpenAM by OpenRock.

the class ServicesSelectViewBean method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event);
    disableButton("button1", true);
    CCRadioButton rb = (CCRadioButton) getChild(ATTR_SERVICE_LIST);
    setRadioButtons(rb);
}
Also used : CCRadioButton(com.sun.web.ui.view.html.CCRadioButton)

Example 7 with CCRadioButton

use of com.sun.web.ui.view.html.CCRadioButton in project OpenAM by OpenRock.

the class IDRepoSelectTypeViewBean method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event);
    disableButton("button1", true);
    try {
        IDRepoModel model = (IDRepoModel) getModel();
        OptionList optList = model.getIDRepoTypes();
        if (optList.size() > 0) {
            CCRadioButton menu = (CCRadioButton) getChild(ATTR_IDREPO_TYPE);
            menu.setOptions(optList);
            String type = (String) menu.getValue();
            if ((type == null) || (type.trim().length() == 0)) {
                menu.setValue(optList.getValue(0));
            }
        }
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
}
Also used : CCRadioButton(com.sun.web.ui.view.html.CCRadioButton) IDRepoModel(com.sun.identity.console.realm.model.IDRepoModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) OptionList(com.iplanet.jato.view.html.OptionList)

Example 8 with CCRadioButton

use of com.sun.web.ui.view.html.CCRadioButton in project OpenAM by OpenRock.

the class SCServiceProfileViewBean method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event);
    SubSchemaModel model = (SubSchemaModel) getModel();
    if (model.hasGlobalSubSchema()) {
        if (!submitCycle) {
            populateTableModel(model.getSubConfigurations());
        }
        resetButtonState(AMPropertySheetModel.TBL_SUB_CONFIG_BUTTON_DELETE);
        Map createable = model.getCreateableSubSchemaNames();
        if (createable.isEmpty()) {
            resetButtonState(AMPropertySheetModel.TBL_SUB_CONFIG_BUTTON_ADD);
        } else {
            SubConfigModel scModel = getSubConfigModel();
            boolean canCreate = false;
            for (Iterator i = createable.keySet().iterator(); i.hasNext() && !canCreate; ) {
                String name = (String) i.next();
                String plugin = scModel.getSelectableSubConfigNamesPlugin(name);
                if (plugin == null) {
                    canCreate = true;
                } else {
                    Set subconfigNames = scModel.getSelectableConfigNames(name);
                    canCreate = (subconfigNames != null) && !subconfigNames.isEmpty();
                }
            }
            disableButton(AMPropertySheetModel.TBL_SUB_CONFIG_BUTTON_ADD, !canCreate);
        }
    }
    if (serviceName.equals("iPlanetAMAuthHTTPBasicService")) {
        CCRadioButton radio = (CCRadioButton) getChild("iplanet-am-auth-http-basic-module-configured");
        if ((radio.getValue() == null) || (radio.getValue().equals(""))) {
            String defaultModule = new String();
            String realmName = SMSEntry.getRootSuffix();
            if (realmName != null) {
                List moduleList = AMAuthUtils.getModuleInstancesForHttpBasic(realmName);
                if (!moduleList.isEmpty()) {
                    defaultModule = (String) moduleList.get(0);
                    radio.setValue(defaultModule);
                }
            }
        }
    }
    // If this is a dynamic request the UI is set with unsaved attribute values
    AMPropertySheet propertySheet = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
    if (dynamicRequest) {
        propertySheet.setAttributeValues(unsavedAttributeValues, model);
    }
}
Also used : SubSchemaModel(com.sun.identity.console.service.model.SubSchemaModel) CCRadioButton(com.sun.web.ui.view.html.CCRadioButton) HashSet(java.util.HashSet) Set(java.util.Set) SubConfigModel(com.sun.identity.console.service.model.SubConfigModel) AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) Iterator(java.util.Iterator) ArrayList(java.util.ArrayList) List(java.util.List) Map(java.util.Map)

Example 9 with CCRadioButton

use of com.sun.web.ui.view.html.CCRadioButton in project OpenAM by OpenRock.

the class SelectTypeViewBeanBase method createChild.

protected View createChild(String name) {
    View view = null;
    if (name.equals(PGTITLE_TWO_BTNS)) {
        view = new CCPageTitle(this, ptModel, name);
    } else if (name.equals(PROPERTY_ATTRIBUTE)) {
        view = new AMPropertySheet(this, propertySheetModel, name);
    } else if (propertySheetModel.isChildSupported(name)) {
        view = propertySheetModel.createChild(this, name, getModel());
        if (name.equals(getTypeOptionsChildName())) {
            CCRadioButton rb = (CCRadioButton) view;
            rb.setOptions(getTypeOptions());
        }
    } else if (ptModel.isChildSupported(name)) {
        view = ptModel.createChild(this, name);
    } else {
        view = super.createChild(name);
    }
    return view;
}
Also used : CCRadioButton(com.sun.web.ui.view.html.CCRadioButton) AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) View(com.iplanet.jato.view.View) CCPageTitle(com.sun.web.ui.view.pagetitle.CCPageTitle)

Example 10 with CCRadioButton

use of com.sun.web.ui.view.html.CCRadioButton in project OpenAM by OpenRock.

the class ServicesSelectViewBean method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event);
    disableButton("button1", true);
    try {
        ServicesModel model = (ServicesModel) getModel();
        String curRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
        Map assignables = model.getAssignableServiceNames(curRealm);
        CCRadioButton rb = (CCRadioButton) getChild(ATTR_SERVICE_LIST);
        OptionList optList = AMFormatUtils.getSortedOptionList(assignables, model.getUserLocale());
        rb.setOptions(optList);
        String val = (String) rb.getValue();
        if ((val == null) || (val.length() == 0)) {
            rb.setValue(optList.getValue(0));
        }
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
}
Also used : CCRadioButton(com.sun.web.ui.view.html.CCRadioButton) ServicesModel(com.sun.identity.console.realm.model.ServicesModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) Map(java.util.Map) OptionList(com.iplanet.jato.view.html.OptionList)

Aggregations

CCRadioButton (com.sun.web.ui.view.html.CCRadioButton)11 OptionList (com.iplanet.jato.view.html.OptionList)6 Map (java.util.Map)4 AMPropertySheet (com.sun.identity.console.base.AMPropertySheet)3 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)3 Iterator (java.util.Iterator)3 Set (java.util.Set)3 View (com.iplanet.jato.view.View)2 SubConfigModel (com.sun.identity.console.service.model.SubConfigModel)2 CCPageTitle (com.sun.web.ui.view.pagetitle.CCPageTitle)2 ViewBean (com.iplanet.jato.view.ViewBean)1 AbstractAuditModel (com.sun.identity.console.audit.model.AbstractAuditModel)1 AMPropertySheetModel (com.sun.identity.console.base.model.AMPropertySheetModel)1 IDRepoModel (com.sun.identity.console.realm.model.IDRepoModel)1 ServicesModel (com.sun.identity.console.realm.model.ServicesModel)1 MAPCreateDeviceModel (com.sun.identity.console.service.model.MAPCreateDeviceModel)1 SubSchemaModel (com.sun.identity.console.service.model.SubSchemaModel)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1