}
public ActionForward compareMetrics(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws Exception {
setResource(request);
Portal portal = Portal.createPortal(TITLE_COMPARE_METRICS, PORTLET_COMPARE_METRICS);
portal.setDialog(true);
portal.setWorkflowPortal(true);
// we potentially have a chained workflow happening here:
// wherever we came from =>
// compare metrics workflow =>
// edit metric display range workflow
//
// first we set up a bunch of workflow params so that the
// return path that goes to the compare metrics page has
// all the state it needs
//
// then we push the return path that goes to wherever we came
// from on to the compare metrics workflow
//
// next, ResourceController uses our workflow params to set up
// the return path that goes to the compare metrics page. this
// is used if we go to the edit display range page.
//
// finally, when the user clicks the "back to wherever we came
// from" link on the compare metrics page, we have to pop the
// return path for the compare metrics page off the compare
// metrics workflow. this leaves only one return path: the one
// that goes back to wherever we came from. this happens in
// CompareMetricsAction.
//
// the last thing to remember is that the compare metrics page
// has to use the same workflow property in struts-config.xml
// as the edit metric display range page. this allows them to
// utilize the same workflow stack.
// set up workflow params that preserve state for compare
// metrics page
portal.setWorkflowParams(makeCompareWorkflowParams(request));
// push old return path onto compare metrics workflow
SessionUtils.pushWorkflow(request.getSession(false), mapping, AttrConstants.WORKFLOW_COMPARE_METRICS_NAME);
request.setAttribute(AttrConstants.PORTAL_KEY, portal);