(String echoarea, String subject, String sql, String headers, String colLen, String formats)
| 56 | } |
| 57 | |
| 58 | public void report(String echoarea, String subject, String sql, |
| 59 | String headers, String colLen, String formats) { |
| 60 | |
| 61 | GenericRawResults<String[]> results = ORMManager.get(Echoarea.class) |
| 62 | .getRaw(sql); |
| 63 | |
| 64 | if (results == null) { |
| 65 | return; |
| 66 | } |
| 67 | |
| 68 | List<String[]> res; |
| 69 | try { |
| 70 | res = results.getResults(); |
| 71 | } catch (SQLException e) { |
| 72 | logger.l3("sql problem", e); |
| 73 | return; |
| 74 | } |
| 75 | |
| 76 | if (res == null || res.size() == 0) { |
| 77 | return; |
| 78 | } |
| 79 | |
| 80 | ReportBuilder builder = new ReportBuilder(); |
| 81 | builder.setColumns(headers, DELIM); |
| 82 | builder.setColLength(colLen, DELIM); |
| 83 | if (formats != null && formats.length() != 0) { |
| 84 | builder.setFormats(formats, DELIM); |
| 85 | } |
| 86 | |
| 87 | for (String[] items : res) { |
| 88 | builder.printLine(items); |
| 89 | } |
| 90 | |
| 91 | String text = builder.getText().toString(); |
| 92 | if (text.length() != 0) { |
| 93 | Echoarea area = FtnTools.getAreaByName(echoarea, null); |
| 94 | FtnTools.writeEchomail(area, subject, text); |
| 95 | logger.l5("send message to " + echoarea); |
| 96 | } |
| 97 | } |
| 98 | } |
nothing calls this directly
no test coverage detected