Search in sources :

Example 1 with SCModel

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

the class SCPropertiesBase method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event);
    SCModel model = (SCModel) getModel();
    if (model != null) {
        AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
        propertySheetModel.clear();
        setAttributeValuesToPropertyModel(ps, model);
    }
}
Also used : SCModel(com.sun.identity.console.service.model.SCModel) AMPropertySheet(com.sun.identity.console.base.AMPropertySheet)

Example 2 with SCModel

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

the class SCPropertiesBase method getValues.

protected Map getValues() throws ModelControlException, AMConsoleException {
    SCModel model = (SCModel) getModel();
    Map values = null;
    Map orig = model.getValues();
    AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
    // pass true to get only the values that have been modified
    return ps.getAttributeValues(orig, true, model);
}
Also used : SCModel(com.sun.identity.console.service.model.SCModel) AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) Map(java.util.Map)

Example 3 with SCModel

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

the class SCPropertiesBase method handleButton1Request.

/**
     * Handles save button request.
     *
     * @param event Request invocation event
     */
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
    try {
        SCModel model = (SCModel) getModel();
        Map modifiedValues = getValues();
        onBeforeSaveProfile(modifiedValues);
        model.setValues(modifiedValues);
        setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "message.updated");
        forwardTo();
    } catch (AMConsoleException a) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", a.getMessage());
        forwardTo();
    }
}
Also used : SCModel(com.sun.identity.console.service.model.SCModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) Map(java.util.Map)

Aggregations

SCModel (com.sun.identity.console.service.model.SCModel)3 AMPropertySheet (com.sun.identity.console.base.AMPropertySheet)2 Map (java.util.Map)2 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)1