use of com.sun.identity.console.base.model.AMConsoleException in project OpenAM by OpenRock.
the class CreateHostedSPViewBean method beginDisplay.
public void beginDisplay(DisplayEvent e) {
String value = (String) getDisplayFieldValue(HAS_META_DATA);
if ((value == null) || value.equals("")) {
setDisplayFieldValue(HAS_META_DATA, "no");
}
value = (String) getDisplayFieldValue(SELECT_COT);
if ((value == null) || value.equals("")) {
setDisplayFieldValue(SELECT_COT, "no");
}
value = (String) getDisplayFieldValue(RADIO_EXTENDED);
if ((value == null) || value.equals("")) {
setDisplayFieldValue(RADIO_EXTENDED, "file");
}
value = (String) getDisplayFieldValue(RADIO_META);
if ((value == null) || value.equals("")) {
setDisplayFieldValue(RADIO_META, "file");
}
setDisplayFieldValue(ENTITY_ID, (AMSystemConfig.isConsoleRemote) ? SystemProperties.getServerInstanceName() : getRequestURL());
populateTableModel();
Set userAttrNames = AMAdminUtils.getUserAttributeNames();
userAttrNames.remove("iplanet-am-user-account-life");
CCDropDownMenu menuUserAttribute = (CCDropDownMenu) getChild("menuUserAttributes");
OptionList optList = createOptionList(userAttrNames);
optList.add(0, "name.attribute.mapping.select", "");
menuUserAttribute.setOptions(optList);
CCCheckBox cbAttrDefault = (CCCheckBox) getChild("tfDefaultAttrMapping");
cbAttrDefault.setChecked(true);
try {
TaskModel model = (TaskModel) getModel();
Set realms = model.getRealms();
CCDropDownMenu menuRealm = (CCDropDownMenu) getChild(REALM);
menuRealm.setOptions(createOptionList(realms));
String realm = getRequestContext().getRequest().getParameter("realm");
if (realm != null && !realm.trim().isEmpty()) {
setDisplayFieldValue(REALM, realm);
}
} catch (AMConsoleException ex) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", ex.getMessage());
}
}
use of com.sun.identity.console.base.model.AMConsoleException in project OpenAM by OpenRock.
the class CreateRemoteIDPViewBean method beginDisplay.
public void beginDisplay(DisplayEvent e) {
HttpServletRequest req = getRequestContext().getRequest();
String cot = req.getParameter("cot");
if ((cot != null) && (cot.trim().length() > 0)) {
setDisplayFieldValue(COT, cot);
setDisplayFieldValue(COT_CHOICE, cot);
}
String realm = req.getParameter("realm");
if ((realm != null) && (realm.trim().length() > 0)) {
setDisplayFieldValue(REALM, realm);
}
String value = (String) getDisplayFieldValue(RADIO_META);
if ((value == null) || value.equals("")) {
setDisplayFieldValue(RADIO_META, "url");
}
value = (String) getDisplayFieldValue(SELECT_COT);
if ((value == null) || value.equals("")) {
setDisplayFieldValue(SELECT_COT, "no");
}
try {
TaskModel model = (TaskModel) getModel();
Set realms = model.getRealms();
CCDropDownMenu menuRealm = (CCDropDownMenu) getChild(REALM);
menuRealm.setOptions(createOptionList(realms));
} catch (AMConsoleException ex) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", ex.getMessage());
}
}
use of com.sun.identity.console.base.model.AMConsoleException in project OpenAM by OpenRock.
the class ConfigureSalesForceAppsCompleteViewBean method beginDisplay.
public void beginDisplay(DisplayEvent event) throws ModelControlException {
try {
super.beginDisplay(event);
HttpServletRequest req = getRequestContext().getRequest();
String realm = req.getParameter("realm");
String idp = req.getParameter("idp");
String attrMapp = req.getParameter("attrMapp");
String spEntityId = req.getParameter(ENTITY_ID);
setPageSessionAttribute(ENTITY_ID, spEntityId);
setPageSessionAttribute("entityRealm", realm);
TaskModel model = (TaskModel) getModelInternal();
Map values = model.getConfigureSalesForceAppsURLs(realm, idp, attrMapp);
String domainId = getModel().getLocalizedString("salesforce.link");
String msg = "<ul>";
String orgMsg = getModel().getLocalizedString("configure.salesforce.apps.complete.urllist");
msg += "<li>";
msg += MessageFormat.format(orgMsg, domainId, domainId);
msg += "</li>";
msg += "</ul>";
values.put("urllist", returnEmptySetIfValueIsNull(msg));
AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTIES);
ps.setAttributeValues(values, model);
} catch (AMConsoleException ex) {
Logger.getLogger(ConfigureSalesForceAppsCompleteViewBean.class.getName()).log(Level.SEVERE, null, ex);
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", ex.getMessage());
}
}
use of com.sun.identity.console.base.model.AMConsoleException in project OpenAM by OpenRock.
the class CreateRemoteSPViewBean method beginDisplay.
public void beginDisplay(DisplayEvent e) {
HttpServletRequest req = getRequestContext().getRequest();
String cot = req.getParameter("cot");
if ((cot != null) && (cot.trim().length() > 0)) {
setDisplayFieldValue(COT, cot);
setDisplayFieldValue(COT_CHOICE, cot);
}
String realm = req.getParameter("realm");
if ((realm != null) && (realm.trim().length() > 0)) {
setDisplayFieldValue(REALM, realm);
}
String value = (String) getDisplayFieldValue(RADIO_META);
if ((value == null) || value.equals("")) {
setDisplayFieldValue(RADIO_META, "url");
}
value = (String) getDisplayFieldValue(SELECT_COT);
if ((value == null) || value.equals("")) {
setDisplayFieldValue(SELECT_COT, "no");
}
populateTableModel();
Set userAttrNames = AMAdminUtils.getUserAttributeNames();
userAttrNames.remove("iplanet-am-user-account-life");
CCDropDownMenu menuUserAttribute = (CCDropDownMenu) getChild("menuUserAttributes");
OptionList optList = createOptionList(userAttrNames);
optList.add(0, "name.attribute.mapping.select", "");
menuUserAttribute.setOptions(optList);
try {
TaskModel model = (TaskModel) getModel();
Set realms = model.getRealms();
CCDropDownMenu menuRealm = (CCDropDownMenu) getChild(REALM);
menuRealm.setOptions(createOptionList(realms));
} catch (AMConsoleException ex) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", ex.getMessage());
}
}
use of com.sun.identity.console.base.model.AMConsoleException in project OpenAM by OpenRock.
the class ConfigureGoogleAppsViewBean method beginDisplay.
public void beginDisplay(DisplayEvent e) {
HttpServletRequest req = getRequestContext().getRequest();
try {
TaskModel model = (TaskModel) getModel();
Map map = model.getRealmCotWithHostedIDPs();
Set realms = new TreeSet();
realms.addAll(map.keySet());
CCDropDownMenu menuRealm = (CCDropDownMenu) getChild(REALM);
menuRealm.setOptions(createOptionList(realms));
String realm = req.getParameter("realm");
if ((realm != null) && (realm.trim().length() > 0)) {
setDisplayFieldValue(REALM, realm);
} else {
if (!realms.isEmpty()) {
realm = (String) realms.iterator().next();
}
}
if ((realm != null) && (realm.trim().length() > 0)) {
Map mapCots = (Map) map.get(realm);
Set cots = new TreeSet();
cots.addAll(mapCots.keySet());
CCDropDownMenu menuCOT = (CCDropDownMenu) getChild("choiceCOT");
menuCOT.setOptions(createOptionList(cots));
String cot = req.getParameter("cot");
if ((cot != null) && (cot.trim().length() > 0)) {
setDisplayFieldValue("choiceCOT", cot);
} else {
if (!cots.isEmpty()) {
cot = (String) cots.iterator().next();
}
}
if ((cot != null) && (cot.trim().length() > 0)) {
Set idps = new TreeSet();
idps.addAll((Set) mapCots.get(cot));
CCDropDownMenu menuIDP = (CCDropDownMenu) getChild("choiceIDP");
menuIDP.setOptions(createOptionList(idps));
String idp = req.getParameter("entityId");
if ((idp != null) && (idp.trim().length() > 0)) {
setDisplayFieldValue("choiceIDP", idp);
}
}
}
} catch (AMConsoleException ex) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", ex.getMessage());
}
String cot = req.getParameter("cot");
if ((cot != null) && (cot.trim().length() > 0)) {
setDisplayFieldValue(COT_CHOICE, cot);
}
}
Aggregations