| 31 | | |
|---|
| 32 | | public void getStatisticReport(Properties properties) { |
|---|
| 33 | | File f = new File(properties.getProperty("output.filename.location") + File.separator + properties.getProperty("output.filename")); |
|---|
| 34 | | // System.out.println("file:" + |
|---|
| 35 | | // properties.getProperty("output.filename.location") + File.separator + |
|---|
| 36 | | // properties.getProperty("output.filename")); |
|---|
| | 31 | |
|---|
| | 32 | public enum ReportType{ |
|---|
| | 33 | PROJECTS, |
|---|
| | 34 | BUSINESS, |
|---|
| | 35 | USERS |
|---|
| | 36 | } |
|---|
| | 37 | |
|---|
| | 38 | public void getStatisticReport(Properties properties, ReportType rt) { |
|---|
| | 39 | File f = null; |
|---|
| | 40 | if (rt == ReportType.PROJECTS){ |
|---|
| | 41 | f = new File(properties.getProperty("output.filename.location") + File.separator + properties.getProperty("output.filename.projects")); |
|---|
| | 42 | }else if (rt == ReportType.BUSINESS){ |
|---|
| | 43 | f = new File(properties.getProperty("output.filename.location") + File.separator + properties.getProperty("output.filename.business")); |
|---|
| | 44 | }else if (rt == ReportType.USERS){ |
|---|
| | 45 | f = new File(properties.getProperty("output.filename.location") + File.separator + properties.getProperty("output.filename.users")); |
|---|
| | 46 | } |
|---|
| | 47 | |
|---|
| | 48 | |
|---|
| 57 | | tableHeader.addCell(new Phrase("DocVault size per project", headerFont)); |
|---|
| | 69 | if (rt == ReportType.PROJECTS){ |
|---|
| | 70 | tableHeader.addCell(new Phrase("DocVault size per project", headerFont)); |
|---|
| | 71 | }else if (rt == ReportType.BUSINESS){ |
|---|
| | 72 | tableHeader.addCell(new Phrase("DocVault size per business", headerFont)); |
|---|
| | 73 | }else if (rt == ReportType.USERS){ |
|---|
| | 74 | tableHeader.addCell(new Phrase("DocVault size per user", headerFont)); |
|---|
| | 75 | } |
|---|
| | 76 | |
|---|
| 70 | | table.addCell(new Phrase("Project id", tableFont)); |
|---|
| 71 | | table.addCell(new Phrase("Project name", tableFont)); |
|---|
| 72 | | table.addCell(new Phrase("Project size", tableFont)); |
|---|
| 73 | | |
|---|
| | 89 | if (rt == ReportType.PROJECTS){ |
|---|
| | 90 | table.addCell(new Phrase("Project id", tableFont)); |
|---|
| | 91 | table.addCell(new Phrase("Project name", tableFont)); |
|---|
| | 92 | table.addCell(new Phrase("Documents size", tableFont)); |
|---|
| | 93 | }else if (rt == ReportType.BUSINESS){ |
|---|
| | 94 | table.addCell(new Phrase("Business id", tableFont)); |
|---|
| | 95 | table.addCell(new Phrase("Business name", tableFont)); |
|---|
| | 96 | table.addCell(new Phrase("Documents size", tableFont)); |
|---|
| | 97 | }else if (rt == ReportType.USERS){ |
|---|
| | 98 | table.addCell(new Phrase("User id", tableFont)); |
|---|
| | 99 | table.addCell(new Phrase("Username", tableFont)); |
|---|
| | 100 | table.addCell(new Phrase("Documents size", tableFont)); |
|---|
| | 101 | } |
|---|
| | 102 | |
|---|
| 109 | | |
|---|
| 110 | | PreparedStatement ps = connection.prepareStatement("SELECT p.project_id, p.project_name from pn_project_space p where record_status='A' order by p.project_name"); |
|---|
| 111 | | // ps.setString(1, properties.getProperty("project.ids")); |
|---|
| | 138 | PreparedStatement ps = null; |
|---|
| | 139 | if (rt == ReportType.PROJECTS){ |
|---|
| | 140 | ps = connection.prepareStatement("SELECT p.project_id, p.project_name from pn_project_space p order by p.project_name"); |
|---|
| | 141 | }else if (rt == ReportType.BUSINESS){ |
|---|
| | 142 | ps = connection.prepareStatement("select b.business_id, b.business_name from pn_business b order by b.business_name"); |
|---|
| | 143 | }else if (rt == ReportType.USERS){ |
|---|
| | 144 | ps = connection.prepareStatement("select u.user_id, u.username from pn_user u order by u.username"); |
|---|
| | 145 | } |
|---|