@Override
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws Exception {
try {
WebUser user = SessionUtils.getWebUser(request.getSession());
MeasurementPreferences preferences = user.getMeasurementPreferences();
MetricRangePreferences rangePreferences = preferences.getMetricRangePreferences();
long begin = rangePreferences.begin;
long end = rangePreferences.end;
long interval = TimeUtil.getInterval(begin, end, DefaultConstants.DEFAULT_CHART_POINTS);
begin = Long.parseLong(WebUtility.getOptionalRequestParameter(request, "begin", "0"));
int resourceId = WebUtility.getOptionalIntRequestParameter(request, ParamConstants.RESOURCE_ID_PARAM, -1);
int groupId = WebUtility.getOptionalIntRequestParameter(request, ParamConstants.GROUP_ID_PARAM, -1);
int parent = WebUtility.getOptionalIntRequestParameter(request, "parent", -1);
int type = WebUtility.getOptionalIntRequestParameter(request, "type", -1);
String mode = WebUtility.getOptionalRequestParameter(request, "mode", "normal");
EventManagerLocal eventManager = LookupUtil.getEventManager();
Subject subject = user.getSubject();
EntityContext context = new EntityContext(resourceId, groupId, parent, type);
PageList<EventComposite> events = eventManager.findEventComposites(subject, context, begin, begin
+ interval, null, null, null, new PageControl(0, MAX_EVENTS_PER_DOT));
MessageResources res = getResources(request);