use of com.sun.identity.console.task.model.TaskModel in project OpenAM by OpenRock.
the class ConfigureGoogleAppsViewBean method forwardTo.
public void forwardTo(RequestContext rc) {
boolean hasIdp = false;
try {
TaskModel model = (TaskModel) getModel();
Set realms = model.getRealms();
for (Iterator i = realms.iterator(); i.hasNext() && !hasIdp; ) {
String realm = (String) i.next();
Set cots = model.getCircleOfTrusts(realm);
for (Iterator j = cots.iterator(); j.hasNext() && !hasIdp; ) {
String cot = (String) j.next();
Set idps = model.getHostedIDP(realm, cot);
hasIdp = !idps.isEmpty();
}
}
} catch (AMConsoleException ex) {
hasIdp = false;
}
if (hasIdp) {
super.forwardTo(rc);
} else {
ConfigureGoogleAppsWarningViewBean vb = (ConfigureGoogleAppsWarningViewBean) getViewBean(ConfigureGoogleAppsWarningViewBean.class);
vb.forwardTo(rc);
}
}
use of com.sun.identity.console.task.model.TaskModel in project OpenAM by OpenRock.
the class ConfigureGoogleAppsWarningViewBean method endIalertCommonDisplay.
public String endIalertCommonDisplay(ChildContentDisplayEvent event) {
TaskModel model = (TaskModel) getModel();
String html = event.getContent();
int idx = html.lastIndexOf("</div>");
html = html.substring(0, idx + 6) + "<p> <p><center><div class=\"TtlBtnDiv\">" + "<input name=\"button1\" type=\"submit\" " + "" + "class=\"Btn1\" value=\" " + model.getLocalizedString("button.ok") + " \" onmouseover=\"javascript: this.className='Btn1Hov'\" " + "onmouseout=\"javascript: this.className='Btn1'\" " + "onblur=\"javascript: this.className='Btn1'\" " + "onfocus=\"javascript: this.className='Btn1Hov'\" " + "onClick=\"top.location.replace('../task/Home'); return false;\" " + "/></div></center>" + html.substring(idx + 6);
return html;
}
use of com.sun.identity.console.task.model.TaskModel in project OpenAM by OpenRock.
the class ConfigureSalesForceAppsCompleteViewBean method handleButton1Request.
/**
* Handles finish button request.
*
* @param event Request invocation event
*/
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
String acsUrl = getDisplayFieldStringValue("SalesforceLoginURL");
try {
if ((acsUrl != null) && (acsUrl.length() > 0)) {
String realm = (String) getPageSessionAttribute("entityRealm");
String entityId = (String) getPageSessionAttribute(ENTITY_ID);
TaskModel model = (TaskModel) getModelInternal();
model.setAcsUrl(realm, entityId, acsUrl);
redirectToHome();
} else if ((acsUrl == null) || !(acsUrl.length() > 0)) {
ConfigureSalesForceAppsFinishWarningViewBean vb = (ConfigureSalesForceAppsFinishWarningViewBean) getViewBean(ConfigureSalesForceAppsFinishWarningViewBean.class);
vb.forwardTo(getRequestContext());
}
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
}
use of com.sun.identity.console.task.model.TaskModel in project OpenAM by OpenRock.
the class ConfigureSalesForceAppsFinishWarningViewBean method endIalertCommonDisplay.
public String endIalertCommonDisplay(ChildContentDisplayEvent event) {
TaskModel model = (TaskModel) getModel();
String html = event.getContent();
int idx = html.lastIndexOf("</div>");
String redirectUrl;
if (XuiRedirectHelper.isXuiAdminConsoleEnabled()) {
String realm = RequestManager.getRequestContext().getRequest().getParameter("realm");
redirectUrl = "../XUI#realms/" + Uris.urlEncodePathElement(realm) + "/dashboard";
} else {
redirectUrl = "../task/Home";
}
html = html.substring(0, idx + 6) + "<p> <p><center><div class=\"TtlBtnDiv\">" + "<input name=\"button1\" type=\"submit\" " + "" + "class=\"Btn1\" value=\" " + model.getLocalizedString("button.ok") + " \" onmouseover=\"javascript: this.className='Btn1Hov'\" " + "onmouseout=\"javascript: this.className='Btn1'\" " + "onblur=\"javascript: this.className='Btn1'\" " + "onfocus=\"javascript: this.className='Btn1Hov'\" " + "onClick=\"top.location.replace('" + redirectUrl + "'); return false;\" " + "/></div></center>" + html.substring(idx + 6);
return html;
}
use of com.sun.identity.console.task.model.TaskModel in project OpenAM by OpenRock.
the class ConfigureSalesForceAppsViewBean 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);
}
}
//attrmapping
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);
}
} 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