use of com.sun.identity.console.base.AMPostViewBean in project OpenAM by OpenRock.
the class AgentsViewBean method nodeClicked.
/**
* Handles tab selected event.
*
* @param event Request Invocation Event.
* @param nodeID Selected Node ID.
*/
public void nodeClicked(RequestInvocationEvent event, int nodeID) {
boolean forwardTo = false;
String strNodeId = Integer.toString(nodeID);
if (strNodeId.length() > 2) {
String prefix = strNodeId.substring(0, 2);
if (prefix.equals(AMAdminConstants.TAB_AGENT_PREFIX)) {
setPageSessionAttribute(getTrackingTabIDName(), Integer.toString(nodeID));
AMViewConfig amconfig = AMViewConfig.getInstance();
List list = amconfig.getSupportedAgentTypes(getModel());
strNodeId = strNodeId.substring(2);
int idx = Integer.parseInt(strNodeId);
if (idx < list.size()) {
setPageSessionAttribute(PG_SESSION_AGENT_TYPE, (String) list.get(idx));
AMPostViewBean vb = (AMPostViewBean) getViewBean(AMPostViewBean.class);
passPgSessionMap(vb);
vb.setTargetViewBeanURL("../agentconfig/Agents");
vb.forwardTo(getRequestContext());
forwardTo = true;
}
}
}
if (!forwardTo) {
try {
AMViewBeanBase vb = getTabNodeAssociatedViewBean("realms", nodeID);
String tmp = (String) getPageSessionAttribute(AMAdminConstants.PREVIOUS_REALM);
vb.setPageSessionAttribute(AMAdminConstants.PREVIOUS_REALM, tmp);
tmp = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
vb.setPageSessionAttribute(AMAdminConstants.CURRENT_REALM, tmp);
tmp = (String) getPageSessionAttribute(AMAdminConstants.PREVIOUS_TAB_ID);
vb.setPageSessionAttribute(AMAdminConstants.PREVIOUS_TAB_ID, tmp);
unlockPageTrailForSwapping();
passPgSessionMap(vb);
vb.forwardTo(getRequestContext());
} catch (AMConsoleException e) {
debug.error("AgentViewBean.nodeClicked", e);
forwardTo();
}
}
}
use of com.sun.identity.console.base.AMPostViewBean in project OpenAM by OpenRock.
the class SCConfigViewBean method forwardToProfile.
protected void forwardToProfile(String serviceName) {
SCConfigModel model = (SCConfigModel) getModel();
setPageSessionAttribute(AMServiceProfile.SERVICE_NAME, serviceName);
unlockPageTrail();
String url = model.getServicePropertiesViewBeanURL(serviceName);
if ((url != null) && (url.length() != 0)) {
AMPostViewBean vb = (AMPostViewBean) getViewBean(AMPostViewBean.class);
passPgSessionMap(vb);
vb.setTargetViewBeanURL(url);
vb.forwardTo(getRequestContext());
} else {
// check if this service has any attributes to display.
if (model.hasConfigAttributes(serviceName)) {
SCServiceProfileViewBean vb = (SCServiceProfileViewBean) getViewBean(SCServiceProfileViewBean.class);
passPgSessionMap(vb);
vb.forwardTo(getRequestContext());
} else {
setPageSessionAttribute(AMAdminConstants.SAVE_VB_NAME, getClass().getName());
ServicesNoAttributeViewBean vb = (ServicesNoAttributeViewBean) getViewBean(ServicesNoAttributeViewBean.class);
passPgSessionMap(vb);
vb.forwardTo(getRequestContext());
}
}
}
use of com.sun.identity.console.base.AMPostViewBean in project OpenAM by OpenRock.
the class AbstractEventHandlerEditViewBean method backToProfileViewBean.
private void backToProfileViewBean() {
String url = (String) ((List) getPageSessionAttribute(PG_SESSION_PROFILE_VIEWBEANS)).get(0);
AMPostViewBean vb = (AMPostViewBean) getViewBean(AMPostViewBean.class);
backTrail();
passPgSessionMap(vb);
vb.setTargetViewBeanURL(url);
vb.forwardTo(getRequestContext());
}
use of com.sun.identity.console.base.AMPostViewBean in project OpenAM by OpenRock.
the class AbstractEventHandlerAddViewBean method backToProfileViewBean.
private void backToProfileViewBean() {
String url = (String) ((List) getPageSessionAttribute(PG_SESSION_PROFILE_VIEWBEANS)).get(0);
AMPostViewBean vb = (AMPostViewBean) getViewBean(AMPostViewBean.class);
backTrail();
passPgSessionMap(vb);
vb.setTargetViewBeanURL(url);
vb.forwardTo(getRequestContext());
}
use of com.sun.identity.console.base.AMPostViewBean in project OpenAM by OpenRock.
the class SMDiscoveryServiceViewBean method handleEntityOperationRequest.
private void handleEntityOperationRequest(String realm, String univId, RequestContext rc) {
HttpServletRequest req = rc.getRequest();
String op = req.getParameter("Op");
if (op.equals(AMAdminConstants.OPERATION_EDIT)) {
setPageSessionAttribute(PG_SESSION_PAGE_TRAIL_ID, req.getParameter(PG_SESSION_PAGE_TRAIL_ID));
setPageSessionAttribute(EntityEditViewBean.UNIVERSAL_ID, univId);
setPageSessionAttribute(AMAdminConstants.CURRENT_REALM, realm);
unlockPageTrail();
EntityResourceOfferingViewBean vb = (EntityResourceOfferingViewBean) getViewBean(EntityResourceOfferingViewBean.class);
passPgSessionMap(vb);
vb.forwardTo(rc);
} else {
setPageSessionAttribute(PG_SESSION_PAGE_TRAIL_ID, req.getParameter(PG_SESSION_PAGE_TRAIL_ID));
setPageSessionAttribute(EntityEditViewBean.UNIVERSAL_ID, univId);
setPageSessionAttribute(AMAdminConstants.CURRENT_REALM, realm);
setPageSessionAttribute(EntityEditViewBean.ENTITY_TYPE, rc.getRequest().getParameter("type"));
EntityResourceOfferingModel entityModel = new EntityResourceOfferingModelImpl(req, getPageSessionAttributes());
try {
entityModel.assignService(univId);
} catch (AMConsoleException e) {
debug.error("SMDiscoveryServiceViewBean.handleEntityOperationRequest", e);
}
backTrail();
AMPostViewBean vb = (AMPostViewBean) getViewBean(AMPostViewBean.class);
passPgSessionMap(vb);
vb.setTargetViewBeanURL("../idm/EntityServices");
vb.forwardTo(rc);
}
}
Aggregations