use of com.sun.identity.console.base.model.QueryResults in project OpenAM by OpenRock.
the class PolicyOpViewBeanBase method handleTblSubjectsButtonAddRequest.
public void handleTblSubjectsButtonAddRequest(RequestInvocationEvent event) throws ModelControlException {
String curRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
PolicyModel model = (PolicyModel) getModel();
try {
if (!reconstructPolicy()) {
QueryResults queryResults = model.getActiveSubjectTypes(curRealm);
Map activeSubjectTypes = (Map) queryResults.getResults();
unlockPageTrail();
if (activeSubjectTypes.size() == 1) {
String subjectType = (String) activeSubjectTypes.keySet().iterator().next();
String viewBeanURL = model.getSubjectViewBeanURL(curRealm, subjectType);
removePageSessionAttribute(WIZARD);
setPageSessionAttribute(SubjectOpViewBeanBase.CALLING_VIEW_BEAN, getClass().getName());
if ((viewBeanURL != null) && (viewBeanURL.trim().length() > 0)) {
forwardToSubjectURL(viewBeanURL, "", subjectType, curRealm, "add");
} else {
forwardToSubjectAddViewBean(curRealm, subjectType);
}
} else {
setPageSessionAttribute(SelectSubjectTypeViewBean.CALLING_VIEW_BEAN, getClass().getName());
SelectSubjectTypeViewBean vb = (SelectSubjectTypeViewBean) getViewBean(SelectSubjectTypeViewBean.class);
setPageSessionAttribute(WIZARD, "true");
passPgSessionMap(vb);
vb.forwardTo(getRequestContext());
}
} else {
forwardTo();
}
} catch (AMConsoleException e) {
debug.warning("PolicyOpViewBeanBase.handleTblSubjectsButtonAddRequest", e);
redirectToStartURL();
}
}
Aggregations