102 if(macroCommand.itsMe(
"dossiers(") || macroCommand.itsMe(
"projects(")) {
103 StringWriter sw =
new StringWriter();
104 DossierContentIterator di =
new DossierContentIterator(
105 HeadlessApplication.getInstance().getConstructor(),
107 macroCommand.getParameterValue(String.class,
"context"));
108 if(macroCommand.getParameterValue(String.class,
"status").equals(
"onwork")) {
109 di.setDossierStatus(Arrays.asList(
"DOSSIER_OPENED,DOSSIER_FROZEN".split(
",")));
110 }
else if(macroCommand.getParameterValue(String.class,
"status").equals(
"closed")) {
111 di.setDossierStatus(Arrays.asList(
"DOSSIER_CLOSED".split(
",")));
113 if(macroCommand.itsMe(
"projects(")) {
114 di.setDossierTypes(Arrays.asList(
"TYPE_PROJECT"));
116 di.setAllowedCategories(macroCommand.getParameterValue(String.class,
"categoryIds"));
117 di.setDossierId(macroCommand.getParameterValue(Long.class,
"dossierId"));
118 di.setPage(macroCommand.getParameterValue(Integer.class,
"count"));
119 di.setAllowAttachments(
true);
120 di.setAllowFiles(
true);
121 di.setAllowDescriptions(
true);
122 di.setAllowInterest(
true);
123 di.setAllowVotes(
true);
124 di.setAllowComments(
true);
125 di.setAllowPolls(
true);
126 di.setSummaryTemplate(macroCommand.getParameterValue(String.class,
"template"));
127 di.setRestricted(macroCommand.getParameterValue(Boolean.class,
"restricted"));
128 di.setDirect(macroCommand.getParameterValue(Boolean.class,
"direct"));
129 if(macroCommand.getParameterValue(Boolean.class,
"related")) {
130 di.setRelated(contact.getCoworkers());
132 di.setNavigatorTop(
false);
133 di.setNavigatorBottom(
false);
135 return new ContentRenderer(macroCommand, di, sw, (IContentIterator iterator, Writer writer) -> {
137 return writer.toString();
139 }
else if(macroCommand.itsMe(
"issues(")) {
140 StringWriter sw =
new StringWriter();
141 IssueContentIterator ii =
new IssueContentIterator(
142 HeadlessApplication.getInstance().getConstructor(),
144 macroCommand.getParameterValue(String.class,
"context"));
145 if(macroCommand.getParameterValue(String.class,
"status").equals(
"onwork")) {
146 ii.setIssueStatus(Arrays.asList(
"STATUS_NEW,STATUS_STARTED,STATUS_INCOMPLETE,STATUS_REOPENED,STATUS_REUNION,STATUS_FROZEN,STATUS_RESOLVED,STATUS_VERIFIED".split(
",")));
147 }
else if(macroCommand.getParameterValue(String.class,
"status").equals(
"closed")) {
148 ii.setIssueStatus(Arrays.asList(
"STATUS_CLOSED".split(
",")));
150 ii.setCategoryId(macroCommand.getParameterValue(Long.class,
"categoryId"));
151 ii.setDossierId(macroCommand.getParameterValue(Long.class,
"dossierId"));
152 ii.setPage(macroCommand.getParameterValue(Integer.class,
"count"));
153 ii.setAllowAttachments(
true);
154 ii.setAllowFiles(
true);
155 ii.setAllowDescriptions(
true);
156 ii.setAllowInterest(
true);
157 ii.setAllowVotes(
true);
158 ii.setAllowComments(
true);
159 ii.setAllowPolls(
false);
160 ii.setRestricted(macroCommand.getParameterValue(Boolean.class,
"restricted"));
161 ii.setSummaryTemplate(macroCommand.getParameterValue(String.class,
"template"));
162 if(macroCommand.getParameterValue(Boolean.class,
"restricted")) {
163 ii.setOrderBy(IssueOrdering.ORDER_BY_ACTIVITY);
165 ii.setNavigatorTop(
false);
166 ii.setNavigatorBottom(
false);
168 return new ContentRenderer(macroCommand, ii, sw, (IContentIterator iterator, Writer writer) -> {
170 return writer.toString();
172 }
else if(macroCommand.itsMe(
"workload(")) {
173 StringWriter sw =
new StringWriter();
174 WorkloadContentIterator wi =
new WorkloadContentIterator(
175 HeadlessApplication.getInstance().getConstructor(),
177 macroCommand.getParameterValue(String.class,
"context"));
178 wi.setPage(macroCommand.getParameterValue(Integer.class,
"count"));
179 wi.setAllowAttachments(
true);
180 wi.setAllowDescriptions(
true);
181 wi.setAllowInterest(
true);
182 wi.setAllowVotes(
true);
183 wi.setAllowComments(
true);
184 wi.setAllowPolls(
false);
185 wi.setSummaryTemplate(macroCommand.getParameterValue(String.class,
"template"));
186 wi.setNavigatorTop(
false);
187 wi.setNavigatorBottom(
false);
189 return new ContentRenderer(macroCommand, wi, sw, (IContentIterator iterator, Writer writer) -> {
191 return writer.toString();
193 }
else if(macroCommand.itsMe(
"kb(")) {
194 StringWriter sw =
new StringWriter();
195 KnowledgeBaseContentIterator wi =
new KnowledgeBaseContentIterator(
196 HeadlessApplication.getInstance().getConstructor(),
198 macroCommand.getParameterValue(String.class,
"context"));
199 wi.setPage(macroCommand.getParameterValue(Integer.class,
"count"));
200 wi.setAllowAttachments(
true);
201 wi.setAllowDescriptions(
true);
202 wi.setAllowInterest(
true);
203 wi.setAllowVotes(
true);
204 wi.setAllowComments(
true);
205 wi.setAllowPolls(
false);
206 wi.setSummaryTemplate(macroCommand.getParameterValue(String.class,
"template"));
207 wi.setNavigatorTop(
false);
208 wi.setNavigatorBottom(
false);
210 return new ContentRenderer(macroCommand, wi, sw, (IContentIterator iterator, Writer writer) -> {
212 return writer.toString();