Search in sources :

Example 31 with AMPropertySheet

use of com.sun.identity.console.base.AMPropertySheet in project OpenAM by OpenRock.

the class STSEditViewBeanBase method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event);
    final String instanceName = (String) getPageSessionAttribute(STSHomeViewBean.INSTANCE_NAME);
    final String currentRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
    if (!submitCycle) {
        STSInstanceModel model = (STSInstanceModel) getModel();
        Map map;
        try {
            map = model.getInstanceState(stsType, currentRealm, instanceName);
        } catch (AMConsoleException e) {
            throw new ModelControlException(e);
        }
        if (!map.isEmpty()) {
            AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
            propertySheetModel.clear();
            ps.setAttributeValues(map, getModel());
        } else {
            setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", MessageFormat.format(model.getLocalizedString("rest.sts.view.no.instance.message"), instanceName));
        }
    }
}
Also used : AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) RestSTSInstanceModel(com.sun.identity.console.sts.model.RestSTSInstanceModel) STSInstanceModel(com.sun.identity.console.sts.model.STSInstanceModel) SoapSTSInstanceModel(com.sun.identity.console.sts.model.SoapSTSInstanceModel) ModelControlException(com.iplanet.jato.model.ModelControlException) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) Map(java.util.Map)

Example 32 with AMPropertySheet

use of com.sun.identity.console.base.AMPropertySheet in project OpenAM by OpenRock.

the class DelegationPropertiesViewBean method handleButton1Request.

/**
     * Handles save button request.
     *
     * @param event Request invocation event
     */
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
    submitCycle = true;
    DelegationModel model = (DelegationModel) getModel();
    String uid = (String) getPageSessionAttribute(CURRENT_IDENTITY);
    AMPropertySheet ps = (AMPropertySheet) getChild(DELEGATION_PROPERTIES);
    String realm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
    try {
        PrivilegeXMLBuilder builder = PrivilegeXMLBuilder.getInstance();
        Set privileges = builder.getAllPrivileges(realm, model);
        Map values = ps.getAttributeValues(privileges);
        model.setPrivileges(realm, uid, values);
        setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "delegation.privilege.updated");
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
    forwardTo();
}
Also used : HashSet(java.util.HashSet) Set(java.util.Set) DelegationModel(com.sun.identity.console.delegation.model.DelegationModel) AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) PrivilegeXMLBuilder(com.sun.identity.console.property.PrivilegeXMLBuilder) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) HashMap(java.util.HashMap) Map(java.util.Map)

Example 33 with AMPropertySheet

use of com.sun.identity.console.base.AMPropertySheet in project OpenAM by OpenRock.

the class DelegationPropertiesViewBean method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event);
    DelegationModel model = (DelegationModel) getModel();
    if (model != null) {
        if (!submitCycle && hasPrivileges) {
            AMPropertySheet ps = (AMPropertySheet) getChild(DELEGATION_PROPERTIES);
            psModel.clear();
            ps.setAttributeValues(getPrivileges(model), model);
        }
        setPageTitle(model);
    }
    if (!hasPrivileges) {
        disableButton("button1", true);
        disableButton("button2", true);
    }
}
Also used : DelegationModel(com.sun.identity.console.delegation.model.DelegationModel) AMPropertySheet(com.sun.identity.console.base.AMPropertySheet)

Example 34 with AMPropertySheet

use of com.sun.identity.console.base.AMPropertySheet in project OpenAM by OpenRock.

the class ResponseProviderOpViewBeanBase method getResponseProviderValues.

protected Map getResponseProviderValues(PolicyModel model, String realmName, String providerType) throws ModelControlException, AMConsoleException {
    List propertyNames = model.getResponseProviderPropertyNames(realmName, providerType);
    AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
    return ps.getAttributeValues(propertyNames);
}
Also used : AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) List(java.util.List)

Example 35 with AMPropertySheet

use of com.sun.identity.console.base.AMPropertySheet in project OpenAM by OpenRock.

the class ServerConfigXMLViewBean method createChild.

protected View createChild(String name) {
    View view = null;
    if (name.equals(TBL_SERVERS)) {
        SerializedField szCache = (SerializedField) getChild(SZ_CACHE_SERVER);
        populateServerTableModel((List) szCache.getSerializedObj());
        view = new CCActionTable(this, tblServerModel, name);
    } else if (name.equals(TBL_USERS)) {
        SerializedField szCache = (SerializedField) getChild(SZ_CACHE_USER);
        populateUserTableModel((List) szCache.getSerializedObj());
        view = new CCActionTable(this, tblUserModel, name);
    } else if (name.equals(PGTITLE_THREE_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 if (tblServerModel.isChildSupported(name)) {
        view = tblServerModel.createChild(this, name);
    } else if (tblUserModel.isChildSupported(name)) {
        view = tblUserModel.createChild(this, name);
    } else {
        view = super.createChild(name);
    }
    return view;
}
Also used : SerializedField(com.sun.identity.console.components.view.html.SerializedField) AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) List(java.util.List) CCActionTable(com.sun.web.ui.view.table.CCActionTable) View(com.iplanet.jato.view.View) CCPageTitle(com.sun.web.ui.view.pagetitle.CCPageTitle)

Aggregations

AMPropertySheet (com.sun.identity.console.base.AMPropertySheet)122 Map (java.util.Map)79 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)76 HashMap (java.util.HashMap)37 SAMLv2Model (com.sun.identity.console.federation.model.SAMLv2Model)28 Set (java.util.Set)21 HashSet (java.util.HashSet)15 List (java.util.List)10 View (com.iplanet.jato.view.View)9 IDFFModel (com.sun.identity.console.federation.model.IDFFModel)8 SubConfigModel (com.sun.identity.console.service.model.SubConfigModel)8 CCAddRemoveModel (com.sun.web.ui.model.CCAddRemoveModel)8 ArrayList (java.util.ArrayList)7 Iterator (java.util.Iterator)7 CCPageTitle (com.sun.web.ui.view.pagetitle.CCPageTitle)6 ModelControlException (com.iplanet.jato.model.ModelControlException)5 WSFedPropertiesModel (com.sun.identity.console.federation.model.WSFedPropertiesModel)5 EntitiesModel (com.sun.identity.console.idm.model.EntitiesModel)5 AbstractAuditModel (com.sun.identity.console.audit.model.AbstractAuditModel)4 FSAuthDomainsModel (com.sun.identity.console.federation.model.FSAuthDomainsModel)4