BrightSide Workbench Full Report + Source Code
org.turro.dossier.content.DossierContentProvider Class Reference
Inheritance diagram for org.turro.dossier.content.DossierContentProvider:
Collaboration diagram for org.turro.dossier.content.DossierContentProvider:

Public Member Functions

 DossierContentProvider ()
 
ContentRenderer loadCommand (MacroCommand macroCommand, IContact contact, String idContext)
 
- Public Member Functions inherited from org.turro.action.content.AbstractContentProvider
List< String > getHelpCommands ()
 
boolean itsMe (String command)
 
ContentRenderer loadCommand (String command, IContact contact, String idContext)
 
List< MacroCommand > getCommands ()
 

Additional Inherited Members

- Protected Attributes inherited from org.turro.action.content.AbstractContentProvider
final List< MacroCommand > commands = new ArrayList<>()
 

Detailed Description

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

Definition at line 38 of file DossierContentProvider.java.

Constructor & Destructor Documentation

◆ DossierContentProvider()

org.turro.dossier.content.DossierContentProvider.DossierContentProvider ( )

Definition at line 40 of file DossierContentProvider.java.

40  {
41  addCommands();
42  }

Member Function Documentation

◆ loadCommand()

ContentRenderer org.turro.dossier.content.DossierContentProvider.loadCommand ( MacroCommand  macroCommand,
IContact  contact,
String  idContext 
)

Reimplemented from org.turro.action.content.AbstractContentProvider.

Definition at line 101 of file DossierContentProvider.java.

101  {
102  if(macroCommand.itsMe("dossiers(") || macroCommand.itsMe("projects(")) {
103  StringWriter sw = new StringWriter();
104  DossierContentIterator di = new DossierContentIterator(
105  HeadlessApplication.getInstance().getConstructor(),
106  sw, contact, true,
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(",")));
112  }
113  if(macroCommand.itsMe("projects(")) {
114  di.setDossierTypes(Arrays.asList("TYPE_PROJECT"));
115  }
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());
131  }
132  di.setNavigatorTop(false);
133  di.setNavigatorBottom(false);
134  di.load();
135  return new ContentRenderer(macroCommand, di, sw, (IContentIterator iterator, Writer writer) -> {
136  iterator.render();
137  return writer.toString();
138  });
139  } else if(macroCommand.itsMe("issues(")) {
140  StringWriter sw = new StringWriter();
141  IssueContentIterator ii = new IssueContentIterator(
142  HeadlessApplication.getInstance().getConstructor(),
143  sw, contact, true,
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(",")));
149  }
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);
164  }
165  ii.setNavigatorTop(false);
166  ii.setNavigatorBottom(false);
167  ii.load();
168  return new ContentRenderer(macroCommand, ii, sw, (IContentIterator iterator, Writer writer) -> {
169  iterator.render();
170  return writer.toString();
171  });
172  } else if(macroCommand.itsMe("workload(")) {
173  StringWriter sw = new StringWriter();
174  WorkloadContentIterator wi = new WorkloadContentIterator(
175  HeadlessApplication.getInstance().getConstructor(),
176  sw, contact, true,
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);
188  wi.load();
189  return new ContentRenderer(macroCommand, wi, sw, (IContentIterator iterator, Writer writer) -> {
190  iterator.render();
191  return writer.toString();
192  });
193  } else if(macroCommand.itsMe("kb(")) {
194  StringWriter sw = new StringWriter();
195  KnowledgeBaseContentIterator wi = new KnowledgeBaseContentIterator(
196  HeadlessApplication.getInstance().getConstructor(),
197  sw, contact, true,
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);
209  wi.load();
210  return new ContentRenderer(macroCommand, wi, sw, (IContentIterator iterator, Writer writer) -> {
211  iterator.render();
212  return writer.toString();
213  });
214  }
215  return null;
216  }
Here is the call graph for this function:

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