use of com.sun.identity.console.base.AMPostViewBean in project OpenAM by OpenRock.
the class AbstractEventHandlerSelectViewBean method handleButton2Request.
/**
* Handles Cancel request.
*
* @param event Request invocation event
*/
@SuppressWarnings("unused")
public void handleButton2Request(RequestInvocationEvent event) {
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 handleRealmOperationRequest.
private void handleRealmOperationRequest(String realm, 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(AMAdminConstants.CURRENT_REALM, realm);
unlockPageTrail();
RealmResourceOfferingViewBean vb = (RealmResourceOfferingViewBean) getViewBean(RealmResourceOfferingViewBean.class);
passPgSessionMap(vb);
vb.forwardTo(rc);
} else {
setPageSessionAttribute(PG_SESSION_PAGE_TRAIL_ID, req.getParameter(PG_SESSION_PAGE_TRAIL_ID));
setPageSessionAttribute(AMAdminConstants.CURRENT_REALM, realm);
RealmResourceOfferingModel realmModel = new RealmResourceOfferingModelImpl(req, getPageSessionAttributes());
try {
realmModel.assignService(realm);
} catch (AMConsoleException e) {
debug.error("SMDiscoveryServiceViewBean.handleRealmOperationRequest", e);
}
backTrail();
AMPostViewBean vb = (AMPostViewBean) getViewBean(AMPostViewBean.class);
passPgSessionMap(vb);
vb.setTargetViewBeanURL("../realm/Services");
vb.forwardTo(rc);
}
}
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 SubConfigEditViewBean method backToProfileViewBean.
private void backToProfileViewBean() {
List urls = (List) getPageSessionAttribute(PG_SESSION_PROFILE_VIEWBEANS);
String url = (String) urls.remove(0);
List parentIds = (List) getPageSessionAttribute(AMServiceProfile.PG_SESSION_SUB_CONFIG_IDS);
parentIds.remove(0);
AMPostViewBean vb = (AMPostViewBean) getViewBean(AMPostViewBean.class);
backTrail();
passPgSessionMap(vb);
vb.setTargetViewBeanURL(url);
vb.forwardTo(getRequestContext());
}
Aggregations