Search in sources :

Example 66 with PolicyModel

use of com.sun.identity.console.policy.model.PolicyModel in project OpenAM by OpenRock.

the class PolicyReferralViewBeanBase method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event);
    try {
        populateAttributes();
        PolicyModel model = (PolicyModel) getModel();
        String realmName = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
        if (model.getActiveReferralTypes(realmName).isEmpty()) {
            CCButton btn = (CCButton) getChild("tblReferralsButtonAdd");
            btn.setDisabled(true);
        }
        CCButton btn = (CCButton) getChild("tblReferralsButtonDelete");
        btn.setDisabled(true);
    } catch (AMConsoleException e) {
        CCButton btn = (CCButton) getChild("tblReferralsButtonAdd");
        btn.setDisabled(true);
        btn = (CCButton) getChild("tblReferralsButtonDelete");
        btn.setDisabled(true);
    }
}
Also used : CCButton(com.sun.web.ui.view.html.CCButton) PolicyModel(com.sun.identity.console.policy.model.PolicyModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Example 67 with PolicyModel

use of com.sun.identity.console.policy.model.PolicyModel in project OpenAM by OpenRock.

the class SelectTypeViewBeanBase method getCachedPolicy.

protected CachedPolicy getCachedPolicy() throws AMConsoleException {
    CachedPolicy policy = null;
    String cacheID = (String) getPageSessionAttribute(ProfileViewBeanBase.PG_SESSION_POLICY_CACHE_ID);
    if (cacheID != null) {
        PolicyModel model = (PolicyModel) getModel();
        policy = model.getCachedPolicy(cacheID);
    }
    return policy;
}
Also used : CachedPolicy(com.sun.identity.console.policy.model.CachedPolicy) PolicyModel(com.sun.identity.console.policy.model.PolicyModel)

Example 68 with PolicyModel

use of com.sun.identity.console.policy.model.PolicyModel in project OpenAM by OpenRock.

the class ResponseProviderOpViewBeanBase method getValues.

protected Map getValues(String providerType) throws ModelControlException, AMConsoleException {
    PolicyModel model = (PolicyModel) getModel();
    String realmName = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
    Map values = getResponseProviderValues(model, realmName, providerType);
    if (values.isEmpty()) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", getMissingValuesMessage());
        values = null;
    }
    return values;
}
Also used : PolicyModel(com.sun.identity.console.policy.model.PolicyModel) Map(java.util.Map)

Example 69 with PolicyModel

use of com.sun.identity.console.policy.model.PolicyModel in project OpenAM by OpenRock.

the class ResponseProviderOpViewBeanBase method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event);
    if (!submitCycle) {
        PolicyModel model = (PolicyModel) getModel();
        String providerName = (String) getPageSessionAttribute(PG_SESSION_PROVIDER_NAME);
        String providerType = (String) getPageSessionAttribute(PG_SESSION_PROVIDER_TYPE);
        String realmName = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
        propertySheetModel.setValue(RESPONSEPROVIDER_NAME, providerName);
        propertySheetModel.setValue(RESPONSEPROVIDER_TYPE, providerType);
        Map map = model.getActiveResponseProviderTypes(realmName);
        String i18nName = (String) map.get(providerType);
        propertySheetModel.setValue(RESPONSEPROVIDER_TYPE_NAME, i18nName);
        setPropertiesValues(getDefaultValues(), model);
    }
}
Also used : PolicyModel(com.sun.identity.console.policy.model.PolicyModel) Map(java.util.Map)

Example 70 with PolicyModel

use of com.sun.identity.console.policy.model.PolicyModel in project OpenAM by OpenRock.

the class ResponseProviderOpViewBeanBase method createResponseProvider.

private ResponseProvider createResponseProvider(String providerType, Map values) throws AMConsoleException {
    String realmName = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
    PolicyModel model = (PolicyModel) getModel();
    return model.createResponseProvider(realmName, providerType, values);
}
Also used : PolicyModel(com.sun.identity.console.policy.model.PolicyModel)

Aggregations

PolicyModel (com.sun.identity.console.policy.model.PolicyModel)84 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)28 Map (java.util.Map)27 CachedPolicy (com.sun.identity.console.policy.model.CachedPolicy)26 HashMap (java.util.HashMap)14 Policy (com.sun.identity.policy.Policy)12 Set (java.util.Set)12 NameNotFoundException (com.sun.identity.policy.NameNotFoundException)11 Iterator (java.util.Iterator)8 OptionList (com.iplanet.jato.view.html.OptionList)7 PolicyCache (com.sun.identity.console.policy.model.PolicyCache)6 QueryResults (com.sun.identity.console.base.model.QueryResults)5 Syntax (com.sun.identity.policy.Syntax)5 Rule (com.sun.identity.policy.Rule)3 Referral (com.sun.identity.policy.interfaces.Referral)3 CCButton (com.sun.web.ui.view.html.CCButton)3 List (java.util.List)3 IdentitySubjectModel (com.sun.identity.console.policy.model.IdentitySubjectModel)2 ActionSchema (com.sun.identity.policy.ActionSchema)2 ValidValues (com.sun.identity.policy.ValidValues)2