MCPcopy Create free account
hub / github.com/annmuor/jnode / report

Method report

jnode-core/src/jnode/jscript/ReportHelper.java:58–97  ·  view source on GitHub ↗
(String echoarea, String subject, String sql,
			String headers, String colLen, String formats)

Source from the content-addressed store, hash-verified

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}

Callers

nothing calls this directly

Calls 12

getMethod · 0.95
setColumnsMethod · 0.95
setColLengthMethod · 0.95
setFormatsMethod · 0.95
printLineMethod · 0.95
getTextMethod · 0.95
getAreaByNameMethod · 0.95
writeEchomailMethod · 0.95
getRawMethod · 0.80
l3Method · 0.80
l5Method · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected