use of com.sun.identity.console.task.model.SocialAuthNModel in project OpenAM by OpenRock.
the class ConfigureSocialAuthNViewBean method beginDisplay.
@Override
public void beginDisplay(DisplayEvent event) throws ModelControlException {
HttpServletRequest req = getRequestContext().getRequest();
try {
super.beginDisplay(event);
SocialAuthNModel model = (SocialAuthNModel) getModel();
// If provider is known then use the simplified property sheet
if (model.isKnownProvider()) {
propertySheetModel.setDocument(openPropertySheetXml(KNOWN_PROVIDER_PROPERTIES));
final String titleMessage = model.getLocalizedString(TITLE_MESSAGE);
ptModel.setPageTitleText(MessageFormat.format(titleMessage, model.getProviderDisplayName()));
ptModel.setPageTitleHelpMessage(model.getLocalizedProviderHelpMessage());
}
SortedSet<String> realms = model.getRealms();
CCDropDownMenu menuRealm = (CCDropDownMenu) getChild(REALM_FIELD);
menuRealm.setOptions(createOptionList(realms));
String realm = req.getParameter("realm");
if (realm != null && !realm.trim().isEmpty()) {
setDisplayFieldValue(REALM_FIELD, realm);
}
setDisplayFieldValue(REDIRECT_URL_FIELD, model.getDefaultRedirectUrl());
String provider = req.getParameter("type");
if (provider != null && !provider.trim().isEmpty()) {
setPageSessionAttribute(PROVIDER_ATTR, provider.trim());
}
} catch (AMConsoleException ex) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", ex.getMessage());
}
}
Aggregations