53 final MacroAdapter macro = context.getMacro();
54 switch(macro.getName()) {
55 case "provider-macros" -> {
56 ElephantMarker marker = context.getMarker();
57 marker.put(
"providers", ContentProviders.getProviders());
59 marker.process(context.getTemplateRoot(), context.getTemplate(), context.getWriter());
61 case "social-groups" -> {
62 ElephantMarker marker = context.getMarker();
63 marker.put(
"socialGroups", SecurityGroups.getAll().stream().sorted().toList());
64 marker.put(
"roles", Permissions.permissionStringMap());
66 marker.process(context.getTemplateRoot(), context.getTemplate(), context.getWriter());
68 case "elephant-macros" -> {
69 ElephantMarker marker = context.getMarker();
70 marker.put(
"elephantParsers",
71 Instances.cached().byAnnotation(ExternalParser.class, IParser.class)
72 .stream().filter((p) -> {
73 return
"all".equals(macro.get(
"parser")) ||
74 ((p instanceof AbstractParser) &&
75 ((AbstractParser) p).getParserName().equals(macro.get(
"parser")));
76 }).collect(Collectors.toList()));
77 marker.put(
"headers",
"true".equals(macro.get(
"headers")));
79 marker.process(context.getTemplateRoot(), context.getTemplate(), context.getWriter());
81 case "elephant-macro-processors" -> {
82 ElephantMarker marker = context.getMarker();
83 marker.put(
"elephantProcessors",
85 .stream().filter((p) -> {
86 return
"all".equals(macro.get(
"processor")) ||
87 ((p instanceof AbstractMacroProcessor) &&
88 ((AbstractMacroProcessor) p).getName().equals(macro.get(
"processor")));
89 }).collect(Collectors.toList()));
90 marker.put(
"headers",
"true".equals(macro.get(
"headers")));
92 marker.process(context.getTemplateRoot(), context.getTemplate(), context.getWriter());
94 case "elephant-emojis" -> {
95 ElephantMarker marker = context.getMarker();
96 marker.put(
"emojimap", EmojiMap.getInstance());
97 marker.process(context.getTemplateRoot(), context.getTemplate(), context.getWriter());
99 case "elephant-icons" -> {
100 ElephantMarker marker = context.getMarker();
101 marker.put(
"iconset", IconSet.getInstance());
102 marker.process(context.getTemplateRoot(), context.getTemplate(), context.getWriter());
104 case "elephant-colors" -> {
105 ElephantMarker marker = context.getMarker();
106 marker.put(
"colors", Colors.getHueList());
107 marker.process(context.getTemplateRoot(), context.getTemplate(), context.getWriter());
109 case "elephant-indicators" -> {
110 ElephantMarker marker = context.getMarker();
111 marker.put(
"elephantIndicators", Indicators.getIndicators().stream().filter((i) -> {
112 return
"all".equals(macro.get(
"indicator")) ||
113 ((i instanceof IElephantIndicator) &&
114 ((IElephantIndicator) i).getRoot().equals(macro.get(
"indicator")));
116 marker.put(
"headers",
"true".equals(macro.get(
"headers")));
118 marker.process(context.getTemplateRoot(), context.getTemplate(), context.getWriter());
121 ElephantMarker marker = context.getMarker();
122 marker.put(
"notice", Secrets.<List<String>>getObject(
"key=notice;show=false"));
123 marker.process(context.getTemplateRoot(), context.getTemplate(), context.getWriter());
126 ElephantMarker marker = context.getMarker();
127 marker.put(
"licenses", Secrets.<List<String>>getObject(
"key=licenses;show=false"));
128 marker.process(context.getTemplateRoot(), context.getTemplate(), context.getWriter());
130 case "libraries" -> {
131 ElephantMarker marker = context.getMarker();
132 marker.put(
"libraries", Secrets.<List<String>>getObject(
"key=libraries;show=false"));
133 marker.process(context.getTemplateRoot(), context.getTemplate(), context.getWriter());
void prepareProperties(ElephantMarker marker, String properties)