* Display the common ping targets with page
*/
public ActionForward view(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res) throws Exception {
ActionForward forward = mapping.findForward(PING_SETUP_PAGE);
RollerRequest rreq = RollerRequest.getRollerRequest(req);
PingTargetManager pingTargetMgr = RollerFactory.getRoller().getPingTargetManager();
WebsiteData website = rreq.getWebsite();
try {
if (!isAuthorized(rreq, website)) {
return mapping.findForward("access-denied");
}
BasePageModel pageModel = new BasePageModel("pings.title", req, res, mapping);
req.setAttribute("model", pageModel);
List commonPingTargets = pingTargetMgr.getCommonPingTargets();
req.setAttribute("commonPingTargets", commonPingTargets);
Boolean allowCustomTargets = new Boolean(!PingConfig.getDisallowCustomTargets());
req.setAttribute("allowCustomTargets", allowCustomTargets);
List customPingTargets = allowCustomTargets.booleanValue() ? pingTargetMgr.getCustomPingTargets(website) : Collections.EMPTY_LIST;
req.setAttribute("customPingTargets", customPingTargets);
// Build isEnabled map (keyed by ping target id and values Boolean.TRUE/Boolean.FALSE)
Map isEnabled = buildIsEnabledMap(rreq, commonPingTargets, customPingTargets);
req.setAttribute("isEnabled", isEnabled);