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

Method list

jnode-core/src/jnode/robot/ScriptFix.java:178–221  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

176 }
177
178 private String list() throws SQLException {
179
180 StringBuilder sb = new StringBuilder();
181 sb.append("============== List of all jscripts ===============\n");
182 sb.append("| id | content |\n");
183 sb.append("|-----|--------------------------------------------|\n");
184 for (Jscript js : ORMManager.get(Jscript.class).getOrderAnd("id", true)) {
185 String code = js.getContent();
186 boolean first = true;
187 for (int i = 0; i < code.length(); i += 42) {
188 int endIndex = (code.length() > i + 42) ? i + 42 : code
189 .length();
190 String sub = code.substring(i, endIndex);
191 String id = (first) ? String.format("%05d", js.getId())
192 : " ";
193 for (int j = 42; j > sub.length(); j--) {
194 sub += " ";
195 }
196 sb.append("|" + id + "| " + sub + " |\n");
197 first = false;
198 }
199 sb.append("|-----|--------------scheduled-at------------------|\n");
200 for (Schedule s : ORMManager.get(Schedule.class).getAnd(
201 "jscript_id", "=", js)) {
202 String fmt = String.format(
203 "|%05d| %s AT %02d LAST %s",
204 s.getId(),
205 s.getType().name(),
206 s.getDetails(),
207 (s.getLastRunDate() != null) ? format.format(s
208 .getLastRunDate()) : "NEVER");
209 for (int j = 53; j > fmt.length(); j--) {
210 fmt += " ";
211 }
212 fmt += "|\n";
213 sb.append(fmt);
214 }
215 sb.append("|-----|--------------------------------------------|\n");
216
217 }
218 sb.append("============== List of all jscripts ================\n");
219 return sb.toString();
220
221 }
222}

Callers 1

processCommandsMethod · 0.95

Calls 11

getMethod · 0.95
appendMethod · 0.80
getOrderAndMethod · 0.80
getContentMethod · 0.80
formatMethod · 0.80
getAndMethod · 0.80
getDetailsMethod · 0.80
getLastRunDateMethod · 0.80
getIdMethod · 0.65
getTypeMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected