BrightSide Workbench Full Report + Source Code
org.turro.parser.DossierParser Class Reference
Inheritance diagram for org.turro.parser.DossierParser:
Collaboration diagram for org.turro.parser.DossierParser:

Public Member Functions

String getParserName ()
 
String getCategories (IConstructor constructor, String summaryTemplate, String fullTemplate, String context, String categories)
 
- Public Member Functions inherited from org.turro.parser.AbstractParser
 AbstractParser ()
 
ParserMacroSet getParserMacros ()
 
boolean execute (IConstructor constructor, PrintWriter out, String[] tokens)
 

Protected Member Functions

boolean doExecute ()
 
void explainMacros (ParserMacroSet macros)
 
- Protected Member Functions inherited from org.turro.parser.AbstractParser
String getMacroName ()
 
String getToken (String name)
 
String getToken (String name, boolean defParameter)
 
String getToken (String name, String def)
 
String getToken (int index)
 
String getToken (int index, boolean defParameter)
 
String getToken (int index, String def)
 
int getTokenSize ()
 
String getDefaultFor (int index)
 
void prepareProperties (ElephantMarker marker, String properties)
 

Additional Inherited Members

- Protected Attributes inherited from org.turro.parser.AbstractParser
IConstructor constructor
 
String[] tokens
 
PrintWriter out
 
String parserName
 
ParserMacroSet parserMacros = new ParserMacroSet()
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 48 of file DossierParser.java.

Member Function Documentation

◆ doExecute()

boolean org.turro.parser.DossierParser.doExecute ( )
protected

Reimplemented from org.turro.parser.AbstractParser.

Definition at line 56 of file DossierParser.java.

56  {
57  boolean done = false;
58  if("issues".equals(getMacroName()) || "issue-summary".equals(getMacroName()) ||
59  "myissues".equals(getMacroName()) || "myissue-summary".equals(getMacroName()) ||
60  "assisted-issues".equals(getMacroName()) || "assisted-issue-summary".equals(getMacroName())) {
61  IssueIterator ii = new IssueIterator(constructor,
62  Strings.isBlank(getToken(2)) ? null : ElephantContext.getRootWebPath() + getToken(2),
63  IdGenerator.generate());
64  if("onwork".equals(getToken(1))) {
65  ii.setIssueStatus(Arrays.asList("STATUS_NEW,STATUS_STARTED,STATUS_INCOMPLETE,STATUS_REOPENED,STATUS_REUNION,STATUS_FROZEN,STATUS_RESOLVED,STATUS_VERIFIED".split(",")));
66  } else if("closed".equals(getToken(1))) {
67  ii.setIssueStatus(Arrays.asList("STATUS_CLOSED".split(",")));
68  }
69  ii.setCategoryId((Integer) ObjectString.parseNativeString(getToken(3), Integer.class, true));
70  ii.setDossierId((Integer) ObjectString.parseNativeString(getToken(4), Integer.class, true));
71  ii.setPage((Integer) ObjectString.parseNativeString(getToken(5), Integer.class, true));
72  ii.setAllowAttachments(true);
73  ii.setAllowDescriptions(true);
74  ii.setAllowInterest(true);
75  ii.setAllowVotes(true);
76  ii.setAllowComments(true);
77  ii.setRestricted(false);
78  ii.setSummaryTemplate(getToken(6));
79  if(getMacroName().contains("summary")) {
80  ii.setOrderBy(IssueOrdering.ORDER_BY_ACTIVITY);
81  ii.setNavigatorTop(false);
82  ii.setNavigatorBottom(false);
83  }
84  if(getMacroName().contains("myissue")) {
85  ii.setRestricted(true);
86  }
87  if(getMacroName().contains("assisted")) {
88  ii.setRestricted(true);
89  ii.setOnlyAssists(true);
90  }
91  ii.load();
92  ii.render();
93  done = true;
94  } else if("dossiers".equals(getMacroName()) || "dossier-summary".equals(getMacroName()) ||
95  "mydossiers".equals(getMacroName()) || "mydossier-summary".equals(getMacroName())) {
96  //{@dossiers:onwork|closed|all:context:categoryIds:dossierId:count[:summary]}
97  DossierIterator di = new DossierIterator(constructor,
98  Strings.isBlank(getToken(2)) ? null : ElephantContext.getRootWebPath() + getToken(2),
99  IdGenerator.generate());
100  if("onwork".equals(getToken(1))) {
101  di.setDossierStatus(Arrays.asList("DOSSIER_OPENED,DOSSIER_FROZEN".split(",")));
102  } else if("closed".equals(getToken(1))) {
103  di.setDossierStatus(Arrays.asList("DOSSIER_CLOSED".split(",")));
104  } else if("not-frozen".equals(getToken(1))) {
105  di.setDossierStatus(Arrays.asList("DOSSIER_OPENED,DOSSIER_CLOSED".split(",")));
106  } else if("frozen".equals(getToken(1))) {
107  di.setDossierStatus(Arrays.asList("DOSSIER_FROZEN".split(",")));
108  }
109  di.setAllowedCategories(getToken(3));
110  di.setDossierId((Integer) ObjectString.parseNativeString(getToken(4), Integer.class, true));
111  di.setPage((Integer) ObjectString.parseNativeString(getToken(5), Integer.class, true));
112  di.setAllowAttachments(true);
113  di.setAllowDescriptions(true);
114  di.setAllowInterest(true);
115  di.setAllowVotes(true);
116  di.setAllowComments(true);
117  di.setRestricted(false);
118  di.setSummaryTemplate(getToken(6));
119  if(getMacroName().contains("summary")) {
120  di.setNavigatorTop(false);
121  di.setNavigatorBottom(false);
122  }
123  if(getMacroName().contains("mydossiers")) {
124  di.setRestricted(true);
125  }
126  di.load();
127  di.render();
128  done = true;
129  } else if("direct-dossiers".equals(getMacroName()) || "direct-dossier-summary".equals(getMacroName()) ||
130  "related-dossiers".equals(getMacroName()) || "related-dossier-summary".equals(getMacroName())) {
131  DossierIterator di = new DossierIterator(constructor,
132  Strings.isBlank(getToken(2)) ? null : ElephantContext.getRootWebPath() + getToken(2),
133  IdGenerator.generate());
134  if("onwork".equals(getToken(1))) {
135  di.setDossierStatus(Arrays.asList("DOSSIER_OPENED,DOSSIER_FROZEN".split(",")));
136  } else if("closed".equals(getToken(1))) {
137  di.setDossierStatus(Arrays.asList("DOSSIER_CLOSED".split(",")));
138  } else if("not-frozen".equals(getToken(1))) {
139  di.setDossierStatus(Arrays.asList("DOSSIER_OPENED,DOSSIER_CLOSED".split(",")));
140  } else if("frozen".equals(getToken(1))) {
141  di.setDossierStatus(Arrays.asList("DOSSIER_FROZEN".split(",")));
142  }
143  di.setAllowedCategories(getToken(3));
144  di.setPage((Integer) ObjectString.parseNativeString(getToken(4), Integer.class, true));
145  di.setAllowAttachments(true);
146  di.setAllowDescriptions(true);
147  di.setAllowInterest(true);
148  di.setAllowVotes(true);
149  di.setAllowComments(true);
150  if(getMacroName().contains("direct")) {
151  di.setRestricted(true);
152  di.setDirect(true);
153  }
154  if(getMacroName().contains("related")) {
155  di.setRestricted(false);
156  di.setRelated(Authentication.getIContact().getCoworkers());
157  }
158  di.setSummaryTemplate(getToken(5));
159  if(getMacroName().contains("summary")) {
160  di.setNavigatorTop(false);
161  di.setNavigatorBottom(false);
162  }
163  di.load();
164  di.render();
165  done = true;
166  } else if("pending-vote".equals(getMacroName())) {
167  DossierIterator di = new DossierIterator(constructor,
168  Strings.isBlank(getToken(1)) ? null : ElephantContext.getRootWebPath() + getToken(1),
169  IdGenerator.generate());
170  di.setProjectPhases(Arrays.asList(new String[] { getToken(2) }));
171  di.setAllowedCategories(getToken(4));
172  di.setPage((Integer) ObjectString.parseNativeString(getToken(5), Integer.class, true));
173  di.setAllowAttachments(true);
174  di.setAllowDescriptions(true);
175  di.setAllowInterest(true);
176  di.setAllowVotes(true);
177  di.setAllowComments(true);
178  di.setRestricted(false);
179  di.setPendingWorths(getToken(3));
180  di.setSummaryTemplate(getToken(6));
181  di.setNavigatorTop(false);
182  di.setNavigatorBottom(false);
183  di.load();
184  di.render();
185  done = true;
186  } else if("categories".equals(getMacroName())) {
188  null,
189  null,
190  getToken(1),
191  getToken(2)));
192  done = true;
193  } else if("web-path".equals(getMacroName())) {
194  if(getToken(1).startsWith("/dossier/")) {
195  Path path = new Path(getToken(1));
196  out.write("/user/mydossiers/?item=" + path.getLastNode());
197  done = true;
198  } else if(getToken(1).startsWith("/issue/")) {
199  Path path = new Path(getToken(1));
200  out.write("/user/myissues/?item=" + path.getLastNode());
201  done = true;
202  }
203  } else if("edit-dossier".equals(getMacroName())) {
204  out.write(EditDossierCtrl.editDossier(getToken(1), getToken(2), getToken(3)));
205  done = true;
206  } else if("create-issue".equals(getMacroName())) {
207  out.write(CreateIssueCtrl.createIssue(getToken(1), getToken(2), getToken(3)));
208  done = true;
209  } else if("edit-question".equals(getMacroName())) {
210  out.write(QuestionCtrl.editQuestion(getToken(1), getToken(2), IssueType.valueOf(getToken(3)), getToken(4)));
211  done = true;
212  } else if("issue-add-info".equals(getMacroName())) {
213  out.write(AddInformationCtrl.addInformation(getToken(1), getToken(3), getToken(2)));
214  done = true;
215  }
216  return done;
217  }
String getCategories(IConstructor constructor, String summaryTemplate, String fullTemplate, String context, String categories)
Here is the call graph for this function:

◆ explainMacros()

void org.turro.parser.DossierParser.explainMacros ( ParserMacroSet  macros)
protected

Reimplemented from org.turro.parser.AbstractParser.

Definition at line 220 of file DossierParser.java.

220  {
221  macros.addMacro("issues")
222  .addParameter("status", false)
223  .addPossibleValue("onwork")
224  .addPossibleValue("closed")
225  .addPossibleValue("all")
226  .addParameter("context", true)
227  .addParameter("categoryId", true, "0")
228  .addParameter("dossierId", true, "0")
229  .addParameter("count", true, "10")
230  .addParameter("template", true, "summary")
231  .addPossibleValue("mySummary")
232  .addPossibleValue("kbSummary")
233  .addPossibleValue("questions")
234  .addPossibleValue("proposals")
235  .addPossibleValue("motions");
236  macros.addMacro("issue-summary")
237  .copyParametersFrom("issues", macros);
238  macros.addMacro("myissues")
239  .copyParametersFrom("issues", macros);
240  macros.addMacro("myissues-summary")
241  .copyParametersFrom("issues", macros);
242  macros.addMacro("assisted-issues")
243  .copyParametersFrom("issues", macros);
244  macros.addMacro("assisted-issue-summary")
245  .copyParametersFrom("issues", macros);
246  macros.addMacro("dossiers")
247  .addParameter("status", false)
248  .addPossibleValue("onwork")
249  .addPossibleValue("closed")
250  .addPossibleValue("not-frozen")
251  .addPossibleValue("frozen")
252  .addPossibleValue("all")
253  .addParameter("context", true)
254  .addParameter("categoryIds", true, null, true)
255  .addParameter("dossierId", true)
256  .addParameter("count", true, "10")
257  .addParameter("template", true, "summary")
258  .addPossibleValue("projects")
259  .addPossibleValue("dossiers");
260  macros.addMacro("dossier-summary")
261  .copyParametersFrom("dossiers", macros);
262  macros.addMacro("mydossiers")
263  .copyParametersFrom("dossiers", macros);
264  macros.addMacro("mydossier-summary")
265  .copyParametersFrom("dossiers", macros);
266  macros.addMacro("direct-dossiers")
267  .addParameter("status", false)
268  .addPossibleValue("onwork")
269  .addPossibleValue("closed")
270  .addPossibleValue("not-frozen")
271  .addPossibleValue("frozen")
272  .addPossibleValue("all")
273  .addParameter("context", true)
274  .addParameter("categoryIds", true, null, true)
275  .addParameter("count", true, "10")
276  .addParameter("template", true, "summary")
277  .addPossibleValue("projects")
278  .addPossibleValue("dossiers");
279  macros.addMacro("direct-dossier-summary")
280  .copyParametersFrom("direct-dossiers", macros);
281  macros.addMacro("related-dossiers")
282  .copyParametersFrom("dossiers", macros);
283  macros.addMacro("related-dossier-summary")
284  .copyParametersFrom("dossiers", macros);
285  macros.addMacro("pending-vote")
286  .addParameter("context", false)
287  .addParameter("phase", false)
288  .addParameter("worths", false, null, true)
289  .addParameter("categoryIds", true, null, true)
290  .addParameter("count", true, "10")
291  .addParameter("template", true, "summary")
292  .addPossibleValue("projects")
293  .addPossibleValue("dossiers");
294  macros.addMacro("categories")
295  .addParameter("status", false)
296  .addPossibleValue("onwork")
297  .addPossibleValue("closed")
298  .addPossibleValue("not-frozen")
299  .addPossibleValue("frozen")
300  .addPossibleValue("all")
301  .addParameter("context", true)
302  .addParameter("categoryIds", true, null, true)
303  .addParameter("template", true, "full");
304  macros.addMacro("web-path")
305  .addParameter("path", false);
306  macros.addMacro("edit-dossier")
307  .addParameter("id", false)
308  .addParameter("template", true, "editDossier");
309  macros.addMacro("create-issue")
310  .addParameter("redirect", false)
311  .addParameter("dossierId", true)
312  .addParameter("template", true, "create");
313  macros.addMacro("edit-question")
314  .addParameter("id", false)
315  .addParameter("redirect", false)
316  .addParameter("type", true, "TYPE_QUESTION")
317  .addParameter("template", true, "editQuestion");
318  macros.addMacro("issue-add-info")
319  .addParameter("id", false)
320  .addParameter("template", true, "addinfo")
321  .addParameter("redirect", true);
322  }
Here is the call graph for this function:

◆ getCategories()

String org.turro.parser.DossierParser.getCategories ( IConstructor  constructor,
String  summaryTemplate,
String  fullTemplate,
String  context,
String  categories 
)

Definition at line 324 of file DossierParser.java.

324  {
325  try {
327  CategoriesTree pi = new CategoriesTree(constructor, context, Authentication.getIContact(), categories, null, null);
328  pi.fillTree("");
329  pi.render();
330  constructor.setOut(null);
331  return constructor.getOutputString();
332  } catch (IOException ex) {
333  Logger.getLogger(ContactsParser.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
334  }
335  return null;
336  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getParserName()

String org.turro.parser.DossierParser.getParserName ( )

Reimplemented from org.turro.parser.AbstractParser.

Definition at line 51 of file DossierParser.java.

51  {
52  return "Dossier";
53  }

The documentation for this class was generated from the following file: