Search in sources :

Example 76 with PolicyModel

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

the class SelectResponseProviderTypeViewBean method handleButton2Request.

/**
     * Handles next button request.
     *
     * @param event Request invocation event.
     */
public void handleButton2Request(RequestInvocationEvent event) throws ModelControlException {
    PolicyModel model = (PolicyModel) getModel();
    String providerType = (String) propertySheetModel.getValue(ATTR_RESPONSEPROVIDER_TYPE);
    setPageSessionAttribute(ResponseProviderOpViewBeanBase.CALLING_VIEW_BEAN, (String) getPageSessionAttribute(CALLING_VIEW_BEAN));
    String realmName = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
    String viewBeanURL = model.getResponseProviderViewBeanURL(realmName, providerType);
    unlockPageTrailForSwapping();
    if ((viewBeanURL != null) && (viewBeanURL.trim().length() > 0)) {
        forwardToURL(viewBeanURL, providerType, realmName);
    } else {
        forwardToViewBean(model, providerType, realmName);
    }
}
Also used : PolicyModel(com.sun.identity.console.policy.model.PolicyModel)

Example 77 with PolicyModel

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

the class RuleEditViewBean method getBreadCrumbDisplayName.

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

Example 78 with PolicyModel

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

the class ResponseProviderEditViewBean method getBreadCrumbDisplayName.

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

Example 79 with PolicyModel

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

the class ReferralAddViewBean method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event);
    boolean wizard = getPageSessionAttribute(PolicyOpViewBeanBase.WIZARD) != null;
    String ptTitle = "page.title.policy.referral.create";
    if (!wizard) {
        ptTitle = "page.title.policy.referral.create.shortcut";
        disableButton("button1", true);
    }
    PolicyModel model = (PolicyModel) getModel();
    String i18nName = (String) propertySheetModel.getValue(REFERRAL_TYPE_NAME);
    String title = model.getLocalizedString(ptTitle);
    String[] param = { i18nName };
    ptModel.setPageTitleText(MessageFormat.format(title, (Object[]) param));
}
Also used : PolicyModel(com.sun.identity.console.policy.model.PolicyModel)

Example 80 with PolicyModel

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

the class PolicyReferralAddViewBean method handleButton1Request.

/**
     * Handles create policy request.
     *
     * @param event Request invocation event
     */
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
    String currentRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
    try {
        if (reconstructPolicy()) {
            // error message set in PolicyOpViewBeanBase
            forwardTo();
        } else {
            CachedPolicy cachedPolicy = getCachedPolicy();
            PolicyModel model = (PolicyModel) getModel();
            String name = cachedPolicy.getPolicy().getName();
            if (name.equals(model.getLocalizedString("policy.create.name"))) {
                setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", model.getLocalizedString("policy.name.change"));
                forwardTo();
            } else {
                try {
                    model.createPolicy(currentRealm, cachedPolicy.getPolicy());
                    backTrail();
                    forwardToPolicyViewBean();
                } catch (AMConsoleException e) {
                    setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
                    forwardTo();
                }
            }
        }
    } catch (AMConsoleException e) {
        redirectToStartURL();
    }
}
Also used : CachedPolicy(com.sun.identity.console.policy.model.CachedPolicy) PolicyModel(com.sun.identity.console.policy.model.PolicyModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

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