Search in sources :

Example 1 with SubConfigModel

use of com.sun.identity.console.service.model.SubConfigModel in project OpenAM by OpenRock.

the class SubSchemaTypeSelectViewBean method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event);
    SubConfigModel model = (SubConfigModel) getModel();
    Map createables = model.getCreateableSubSchemaNames();
    CCRadioButton rb = (CCRadioButton) getChild(RB_SUBCONFIG);
    OptionList optList = AMFormatUtils.getSortedOptionList(createables, model.getUserLocale());
    rb.setOptions(optList);
    String val = (String) rb.getValue();
    if ((val == null) || (val.length() == 0)) {
        rb.setValue(optList.getValue(0));
    }
}
Also used : CCRadioButton(com.sun.web.ui.view.html.CCRadioButton) SubConfigModel(com.sun.identity.console.service.model.SubConfigModel) Map(java.util.Map) OptionList(com.iplanet.jato.view.html.OptionList)

Example 2 with SubConfigModel

use of com.sun.identity.console.service.model.SubConfigModel in project OpenAM by OpenRock.

the class SubConfigEditViewBean method createChild.

protected View createChild(String name) {
    if (!populatedSubConfigTable && name.equals(AMPropertySheetModel.TBL_SUB_CONFIG)) {
        populatedSubConfigTable = true;
        SubConfigModel model = (SubConfigModel) getModel();
        if (model.hasGlobalSubSchema()) {
            SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
            populateTableModel(szCache.<List<SMSubConfig>>getSerializedObj());
        }
    }
    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());
    } else if (ptModel.isChildSupported(name)) {
        view = ptModel.createChild(this, name);
    } else {
        view = super.createChild(name);
    }
    return view;
}
Also used : SerializedField(com.sun.identity.console.components.view.html.SerializedField) SMSubConfig(com.sun.identity.console.base.model.SMSubConfig) SubConfigModel(com.sun.identity.console.service.model.SubConfigModel) AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) View(com.iplanet.jato.view.View) CCPageTitle(com.sun.web.ui.view.pagetitle.CCPageTitle)

Example 3 with SubConfigModel

use of com.sun.identity.console.service.model.SubConfigModel in project OpenAM by OpenRock.

the class SubConfigEditViewBean method createPropertyModel.

private void createPropertyModel() {
    try {
        SubConfigModel model = (SubConfigModel) getModel();
        propertySheetModel = new AMPropertySheetModel(model.getEditConfigPropertyXML(getClass().getName()));
        propertySheetModel.clear();
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
}
Also used : SubConfigModel(com.sun.identity.console.service.model.SubConfigModel) AMPropertySheetModel(com.sun.identity.console.base.model.AMPropertySheetModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Example 4 with SubConfigModel

use of com.sun.identity.console.service.model.SubConfigModel in project OpenAM by OpenRock.

the class SubConfigEditViewBean method getAttributeValueMap.

@Override
protected Map<String, Set<String>> getAttributeValueMap() {
    try {
        SubConfigModel model = (SubConfigModel) getModel();
        AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
        return ps.getAttributeValues(model.getSubConfigAttributeValues().keySet());
    } catch (AMConsoleException e) {
        debug.error("Could not retrieve attribute values", e);
    } catch (ModelControlException e) {
        debug.error("Could not retrieve attribute values", e);
    }
    return Collections.emptyMap();
}
Also used : SubConfigModel(com.sun.identity.console.service.model.SubConfigModel) AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) ModelControlException(com.iplanet.jato.model.ModelControlException) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Example 5 with SubConfigModel

use of com.sun.identity.console.service.model.SubConfigModel in project OpenAM by OpenRock.

the class SubConfigEditViewBean method handleTblSubConfigButtonAddRequest.

/**
     * Adds sub configuration.
     *
     * @param event Request Invocation Event.
     */
public void handleTblSubConfigButtonAddRequest(RequestInvocationEvent event) {
    SubConfigModel model = (SubConfigModel) getModel();
    Map createable = model.getCreateableSubSchemaNames();
    if (!createable.isEmpty()) {
        if (createable.size() > 1) {
            SubSchemaTypeSelectViewBean vb = (SubSchemaTypeSelectViewBean) getViewBean(SubSchemaTypeSelectViewBean.class);
            addViewBeanClassToPageSession();
            unlockPageTrail();
            passPgSessionMap(vb);
            vb.forwardTo(getRequestContext());
        } else {
            String subSchema = (String) createable.keySet().iterator().next();
            setPageSessionAttribute(AMServiceProfile.PG_SESSION_SUB_SCHEMA_NAME, subSchema);
            SubConfigAddViewBean vb = (SubConfigAddViewBean) getViewBean(SubConfigAddViewBean.class);
            addViewBeanClassToPageSession();
            unlockPageTrail();
            passPgSessionMap(vb);
            vb.forwardTo(getRequestContext());
        }
    } else {
        forwardTo();
    }
}
Also used : SubConfigModel(com.sun.identity.console.service.model.SubConfigModel) Map(java.util.Map)

Aggregations

SubConfigModel (com.sun.identity.console.service.model.SubConfigModel)13 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)9 AMPropertySheet (com.sun.identity.console.base.AMPropertySheet)8 Map (java.util.Map)6 Set (java.util.Set)3 ModelControlException (com.iplanet.jato.model.ModelControlException)2 OptionList (com.iplanet.jato.view.html.OptionList)2 AMPropertySheetModel (com.sun.identity.console.base.model.AMPropertySheetModel)2 SMSubConfig (com.sun.identity.console.base.model.SMSubConfig)2 SerializedField (com.sun.identity.console.components.view.html.SerializedField)2 CCRadioButton (com.sun.web.ui.view.html.CCRadioButton)2 ArrayList (java.util.ArrayList)2 HashSet (java.util.HashSet)2 List (java.util.List)2 View (com.iplanet.jato.view.View)1 SubSchemaModel (com.sun.identity.console.service.model.SubSchemaModel)1 CCActionTableModel (com.sun.web.ui.model.CCActionTableModel)1 CCDropDownMenu (com.sun.web.ui.view.html.CCDropDownMenu)1 CCPageTitle (com.sun.web.ui.view.pagetitle.CCPageTitle)1 CCActionTable (com.sun.web.ui.view.table.CCActionTable)1