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);
}
}
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);
}
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);
}
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));
}
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();
}
}
Aggregations