use of com.sun.identity.console.policy.model.PolicyModel in project OpenAM by OpenRock.
the class SubjectOpViewBeanBase method getValidValues.
protected Set getValidValues() {
Set values = null;
String filter = (String) propertySheetModel.getValue(FILTER);
String realmName = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
String subjectType = (String) propertySheetModel.getValue(SUBJECT_TYPE);
PolicyModel model = (PolicyModel) getModel();
try {
ValidValues validValues = model.getSubjectPossibleValues(realmName, subjectType, filter);
if (validValues != null) {
int errCode = validValues.getErrorCode();
if (errCode == ValidValues.SIZE_LIMIT_EXCEEDED) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", "policy.subject.sizelimit.exceeded.message");
} else if (errCode == ValidValues.SIZE_LIMIT_EXCEEDED) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", "policy.subject.timelimit.exceeded.message");
}
values = validValues.getSearchResults();
}
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
return values;
}
use of com.sun.identity.console.policy.model.PolicyModel in project OpenAM by OpenRock.
the class SubjectAddViewBean method beginDisplay.
public void beginDisplay(DisplayEvent event) throws ModelControlException {
super.beginDisplay(event);
boolean wizard = getPageSessionAttribute(PolicyOpViewBeanBase.WIZARD) != null;
String ptTitle = "page.title.policy.subject.create";
if (!wizard) {
ptTitle = "page.title.policy.subject.create.shortcut";
disableButton("button1", true);
}
PolicyModel model = (PolicyModel) getModel();
String i18nName = (String) propertySheetModel.getValue(SUBJECT_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 SubjectEditViewBean method beginDisplay.
public void beginDisplay(DisplayEvent event) throws ModelControlException {
super.beginDisplay(event);
PolicyModel model = (PolicyModel) getModel();
String i18nName = (String) propertySheetModel.getValue(SUBJECT_TYPE_NAME);
String title = model.getLocalizedString("page.title.policy.subject.edit");
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 SubjectOpViewBeanBase method createSubject.
private Subject createSubject(String subjectType, Set values) throws AMConsoleException {
String realmName = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
PolicyModel model = (PolicyModel) getModel();
return model.createSubject(realmName, subjectType, values);
}
use of com.sun.identity.console.policy.model.PolicyModel in project OpenAM by OpenRock.
the class PolicyOpViewBeanBase method handleTblResponseProvidersEditLinkRequest.
public void handleTblResponseProvidersEditLinkRequest(RequestInvocationEvent event) throws ModelControlException {
PolicyModel model = (PolicyModel) getModel();
String name = hexToString((String) getDisplayFieldValue(TBL_RESPONSE_ATTRIBUTES_ACTION_HREF));
setPageSessionAttribute(ResponseProviderEditViewBean.CALLING_VIEW_BEAN, getClass().getName());
setPageSessionAttribute(ResponseProviderEditViewBean.EDIT_RESPONSEPROVIDER_NAME, name);
try {
CachedPolicy cachedPolicy = getCachedPolicy();
Policy policy = cachedPolicy.getPolicy();
ResponseProvider provider = policy.getResponseProvider(name);
String realmName = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
String responseProviderType = model.getResponseProviderTypeName(realmName, provider);
String viewBeanURL = model.getResponseProviderViewBeanURL(realmName, responseProviderType);
unlockPageTrail();
if ((viewBeanURL != null) && (viewBeanURL.trim().length() > 0)) {
forwardToResponseProviderURL(viewBeanURL, name, responseProviderType, realmName, "edit");
} else {
forwardToResponseProviderEditViewBean(model, realmName, name, responseProviderType);
}
} catch (NameNotFoundException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", model.getErrorString(e));
forwardTo();
} catch (AMConsoleException e) {
debug.warning("PolicyOpViewBeanBase.handleTblResponseProvidersEditLinkRequest", e);
redirectToStartURL();
}
}
Aggregations