try {
// start view preparation phase
RequestContext context = onPrepareViewStarted();
getReportViewer().setRequestContext(context);
getReportViewer().setMsgBroker(extractMessageBroker());
getReportViewer().setRecord(new HeRecord(new HrRecord()));
String uuid = context.getServletRequest().getParameter("uuid");
if (UuidUtil.isUuid(uuid)) {
getCriteria().getActionCriteria().setEventUuid(uuid);
setExternal(true);
} else {
// check authorization
authorizeAction(context);
}
String sEventUuid = getCriteria().getActionCriteria().getEventUuid();
// get uuid of harvest event uuid
if (!UuidUtil.isUuid(sEventUuid)) {
throw new ApplicationException();
}
// select and read harvest event record
HeSelectOneRequest selectEventReq =
new HeSelectOneRequest(context, sEventUuid);
selectEventReq.execute();
HeRecords events = selectEventReq.getQueryResult().getRecords();
// get harvest event record
HeRecord event = events.size() == 1 ? events.get(0) : null;
if (event == null) {
throw new ApplicationException("No requested event found.");
}
HrRecord repository = event.getRepository();
getResult().getQueryResult().setUuid(repository.getUuid());
getResult().getQueryResult().setProtocolTypeAsString(repository.getProtocol().getKind());
getResult().getQueryResult().setName(repository.getName());
getResult().getQueryResult().setUrl(repository.getHostUrl());
getResult().getQueryResult().setReportUuid(event.getUuid());
getReportViewer().setRecord(event);
} catch (NotAuthorizedException e) {
try {