public String execute()
{
try
{
ReportGroup reportGroup = null;
if (groupId == Integer.MIN_VALUE)
{
reportGroup =
(ReportGroup) ActionContext.getContext().getSession().get(
ORStatics.REPORT_GROUP);
}
else
{
ReportUser reportUser =
(ReportUser) ActionContext.getContext().getSession().get(
ORStatics.REPORT_USER);
reportGroup =
groupProvider.getReportGroup(new Integer(groupId));
if (reportUser.isValidGroup(reportGroup))
{
session.put(ORStatics.REPORT_GROUP, reportGroup);
}
else
{
addActionError(LocalStrings.ERROR_REPORTGROUP_NOTAUTHORIZED);
return ERROR;
}
}
if (reportGroup != null)
{
reports = reportGroup.getReportsForDisplay();
Collections.sort(reports);
}
return SUCCESS;
}