Your Electronic Books
WHAT'S HOT
PARTS:
Part 31
Part 32
Part 33
Part 34
Part 35
Part 36
Part 37
Part 38
Part 39
Part 40
Part 41
Part 42
Part 43
Part 44
Part 45
Part 46
Part 47
Part 48
Part 49
Part 50
Resources
Prev
|
Current Page 681
|
Next
Frank Zammetti
"Practical DWR 2 Projects"
@SuppressWarnings("unchecked")
public List
getReportsList(
final HttpServletRequest inRequest) throws Exception {
try {
List
reports = databaseWorker.executeQuery(SQL_GET_REPORTS_LIST,
new HashMap());
List
reportList = new ArrayList
();
for (Map m : reports) {
boolean userCanSeeReport = false;
String reportGroups = (String)m.get("GROUPS");
if (reportGroups.indexOf("AllUsers") != -1) {
userCanSeeReport = true;
} else {
List
groupsUserIsIn =
(ArrayList)inRequest.getSession().getAttribute("groups");
if (groupsUserIsIn != null) {
for (String s : groupsUserIsIn) {
if (reportGroups.indexOf(s) != -1) {
userCanSeeReport = true;
CHAPTER 7 n ENTER THE ENTERPRISE: A DWR-BASED REPORT PORTAL 399
}
}
}
}
if (userCanSeeReport) {
ReportDescriptor report = new ReportDescriptor();
report.setReportName((String)m.get("REPORTNAME"));
report.setDescription((String)m.get("DESCRIPTION"));
report.setGroups(reportGroups);
report.setReportXML((String)m.get("REPORTXML"));
reportList.add(report);
}
}
return reportList;
} catch (Exception e) {
e.printStackTrace();
throw e;
}
}
First, we have a query to get the list of reports, nothing too different there.
Pages:
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693