Search in sources :

Example 6 with PolicyModel

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

the class ResponseProviderEditViewBean method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event);
    PolicyModel model = (PolicyModel) getModel();
    String i18nName = (String) propertySheetModel.getValue(RESPONSEPROVIDER_TYPE_NAME);
    String title = model.getLocalizedString("page.title.policy.responseprovider.edit");
    String[] param = { i18nName };
    ptModel.setPageTitleText(MessageFormat.format(title, (Object[]) param));
}
Also used : PolicyModel(com.sun.identity.console.policy.model.PolicyModel)

Example 7 with PolicyModel

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

the class ReferralEditViewBean method getBreadCrumbDisplayName.

protected String getBreadCrumbDisplayName() {
    PolicyModel model = (PolicyModel) getModel();
    String origName = (String) getPageSessionAttribute(EDIT_REFERRAL_NAME);
    String[] arg = { origName };
    return MessageFormat.format(model.getLocalizedString("breadcrumbs.editReferral"), (Object[]) arg);
}
Also used : PolicyModel(com.sun.identity.console.policy.model.PolicyModel)

Example 8 with PolicyModel

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

the class ReferralOpViewBeanBase method createReferral.

protected Referral createReferral() throws ModelControlException, AMConsoleException {
    Referral referral = null;
    String referralType = (String) propertySheetModel.getValue(REFERRAL_TYPE);
    String referralName = getReferralName();
    if (referralName != null) {
        Set values = getValues(referralType);
        if (values != null) {
            String realmName = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
            PolicyModel model = (PolicyModel) getModel();
            referral = model.createReferral(realmName, referralType, values);
        }
    }
    return referral;
}
Also used : Set(java.util.Set) Referral(com.sun.identity.policy.interfaces.Referral) PolicyModel(com.sun.identity.console.policy.model.PolicyModel)

Example 9 with PolicyModel

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

the class ReferralOpViewBeanBase method setPossibleValues.

private void setPossibleValues(CCSelect selectView) {
    String filter = (String) propertySheetModel.getValue(FILTER);
    String realmName = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
    String referralType = (String) propertySheetModel.getValue(REFERRAL_TYPE);
    PolicyModel model = (PolicyModel) getModel();
    ValidValues validValues = model.getReferralPossibleValues(realmName, referralType, filter);
    if (validValues != null) {
        int errCode = validValues.getErrorCode();
        if (errCode == ValidValues.SIZE_LIMIT_EXCEEDED) {
            setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", "policy.referral.sizelimit.exceeded.message");
        } else if (errCode == ValidValues.SIZE_LIMIT_EXCEEDED) {
            setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", "policy.referral.timelimit.exceeded.message");
        }
        OptionList optList = createOptionList(validValues.getSearchResults());
        selectView.setOptions(optList);
    }
}
Also used : ValidValues(com.sun.identity.policy.ValidValues) PolicyModel(com.sun.identity.console.policy.model.PolicyModel) OptionList(com.iplanet.jato.view.html.OptionList)

Example 10 with PolicyModel

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

the class ProfileViewBeanBase method getCachedPolicy.

protected CachedPolicy getCachedPolicy() throws AMConsoleException {
    CachedPolicy policy = null;
    String cacheID = (String) getPageSessionAttribute(PG_SESSION_POLICY_CACHE_ID);
    if (cacheID != null) {
        PolicyCache cache = PolicyCache.getInstance();
        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) PolicyCache(com.sun.identity.console.policy.model.PolicyCache)

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