Search in sources :

Example 11 with SubConfigModel

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

the class SubConfigAddViewBean method createPropertyModel.

private void createPropertyModel() {
    try {
        String schemaName = (String) getPageSessionAttribute(AMServiceProfile.PG_SESSION_SUB_SCHEMA_NAME);
        SubConfigModel model = (SubConfigModel) getModel();
        propertySheetModel = new AMPropertySheetModel(model.getAddConfigPropertyXML(schemaName));
        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 12 with SubConfigModel

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

the class SubConfigEditViewBean method handleTblSubConfigButtonDeleteRequest.

/**
     * Deletes sub configuration.
     *
     * @param event Request Invocation Event.
     * @throws ModelControlException if table model cannot be restored.
     */
public void handleTblSubConfigButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
    submitCycle = true;
    CCActionTable tbl = (CCActionTable) getChild(AMPropertySheetModel.TBL_SUB_CONFIG);
    tbl.restoreStateData();
    CCActionTableModel tblModel = (CCActionTableModel) tbl.getModel();
    Integer[] selected = tblModel.getSelectedRows();
    SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
    List list = (List) szCache.getSerializedObj();
    Set names = new HashSet(selected.length * 2);
    for (int i = 0; i < selected.length; i++) {
        SMSubConfig sc = (SMSubConfig) list.get(selected[i].intValue());
        names.add(sc.getName());
    }
    try {
        SubConfigModel model = (SubConfigModel) getModel();
        model.deleteSubConfigurations(names);
        if (selected.length == 1) {
            setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "subconfig.message.deleted");
        } else {
            setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "subconfig.message.deleted.pural");
        }
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
    submitCycle = false;
    forwardTo();
}
Also used : HashSet(java.util.HashSet) Set(java.util.Set) CCActionTableModel(com.sun.web.ui.model.CCActionTableModel) 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) ArrayList(java.util.ArrayList) List(java.util.List) CCActionTable(com.sun.web.ui.view.table.CCActionTable) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) HashSet(java.util.HashSet)

Example 13 with SubConfigModel

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

the class SubConfigEditViewBean method handleButton1Request.

/**
     * Handles next button request.
     *
     * @param event Request invocation event.
     */
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
    submitCycle = true;
    SubConfigModel model = (SubConfigModel) getModel();
    AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
    try {
        Map orig = model.getSubConfigAttributeValues();
        Map values = ps.getAttributeValues(orig, true, true, model);
        model.setSubConfigAttributeValues(values);
        backToProfileViewBean();
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
        forwardTo();
    }
}
Also used : SubConfigModel(com.sun.identity.console.service.model.SubConfigModel) AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) 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