BrightSide Workbench Full Report + Source Code
DossierVisualElements.java
Go to the documentation of this file.
1 /*
2  * TurrĂ³ i Cutiller Foundation. License notice.
3  * Copyright (C) 2020 Lluis TurrĂ³ Cutiller <http://www.turro.org/>
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Affero General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Affero General Public License for more details.
14  *
15  * You should have received a copy of the GNU Affero General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 package org.turro.visual;
20 
21 import org.turro.dossier.entity.Dossier;
22 import org.turro.phase.PhaseType;
23 
28 public class DossierVisualElements extends VisualElements<DossierVisualElements, Dossier, DossierVisualElement> {
29 
30  @Override
32  return new DossierVisualElements();
33  }
34 
35  @Override
36  protected DossierVisualElement createElement(String name) {
37  return new DossierVisualElement(name, this);
38  }
39 
40  public static DossierVisualElements load() {
41  return VisualElements.doLoad("dossier", new DossierVisualElements());
42  }
43 
44  @Override
45  protected void setDefaults() {
46  addElement("Drivers");
47 
48  addElement("Follow");
49 
50  addElement("Stars");
51 
52  addElement("Descriptions");
53 
54  addElement("Voting")
55  .setLabel("Voting")
56  .addPhaseType(PhaseType.VOTES)
57  .addSyndication("patron");
58 
59  addElement("Voting Results")
60  .setLabel("Voting")
61  .addPhaseType(PhaseType.VOTES)
62  .setBranchAdmin(Boolean.TRUE);
63 
64  addElement("Voting Results Readonly")
65  .setLabel("Voting")
66  .addPhaseType(PhaseType.DECISION)
67  .setBranchAdmin(Boolean.TRUE)
68  .addSyndication("patron");
69 
70  addElement("Like")
71  .setLabel("Like it")
72  .addPhaseType(PhaseType.DECISION)
73  .setBranchAdmin(Boolean.TRUE)
74  .addSyndication("patron");
75 
76  addElement("Like Readonly")
77  .setLabel("Like it")
78  .addPhaseType(PhaseType.DECISION)
79  .setBranchAdmin(Boolean.TRUE);
80 
81  addElement("Descriptors");
82 
83  addElement("Participations")
84  .addSubElement("Show Beneficiaries")
85  .addSubElement("Contact")
86  .setVisitor(Boolean.TRUE)
87  .getParent()
88  .getParent()
89  .addSubElement("Show Offerers")
90  .addSubElement("Contact")
91  .setVisitor(Boolean.TRUE)
92  .getParent()
93  .getParent()
94  .addSubElement("Show Support")
95  .setParticipates(Boolean.TRUE)
96  .addSubElement("Contact")
97  .setVisitor(Boolean.TRUE)
98  .getParent()
99  .getParent()
100  .addSubElement("Show Coordinators")
101  .setParticipates(Boolean.TRUE)
102  .addSyndication("patron")
103  .addSyndication("partner")
104  .addSubElement("Contact")
105  .setVisitor(Boolean.TRUE)
106  .getParent()
107  .getParent()
108  .addSubElement("Show Funding")
109  .setParticipates(Boolean.TRUE)
110  .addSubElement("Contact")
111  .setVisitor(Boolean.TRUE)
112  .getParent()
113  .getParent()
114  .addSubElement("Show Research")
115  .setParticipates(Boolean.TRUE)
116  .addSubElement("Contact")
117  .setVisitor(Boolean.TRUE)
118  .getParent()
119  .getParent()
120  .addSubElement("Show Consortium")
121  .setParticipates(Boolean.TRUE)
122  .addSubElement("Contact")
123  .setVisitor(Boolean.TRUE);
124 
125  addElement("Documentation")
126  .setParticipates(Boolean.TRUE);
127 
128  addElement("Attachments")
129  .setLabel("Documents")
130  .setParticipates(Boolean.TRUE)
131  .addSyndication("patron")
132  .addSyndication("partner");
133 
134  addElement("Files")
135  .setLabel("Files")
136  .setParticipates(Boolean.TRUE)
137  .addSyndication("patron")
138  .addSyndication("partner");
139 
140  addElement("Deliverables")
141  .setLabel("Deliverables")
142  .addPhaseType(PhaseType.EXECUTION)
143  .addPhaseType(PhaseType.ARCHIVE)
144  .setParticipates(Boolean.TRUE)
145  .addSyndication("patron")
146  .addSyndication("partner");
147 
148  addElement("Polls");
149 
150  addElement("Galleries");
151 
152  addElement("Offers")
153  .addPhaseType(PhaseType.PROPOSALS)
154  .addPhaseType(PhaseType.EXECUTION)
155  .addPhaseType(PhaseType.ARCHIVE)
156  .setParticipates(Boolean.TRUE)
157  .addSyndication("patron")
158  .addSyndication("partner")
159  .addSubElement("Offer")
160  .setBranchAdmin(Boolean.TRUE)
161  .setDirectOwner(Boolean.TRUE)
162  .getParent()
163  .addSubElement("Working Documents")
164  .addPhaseType(PhaseType.PROPOSALS)
165  .setOfferer(Boolean.TRUE)
166  .setShowAllIssues(Boolean.TRUE)
167  .getParent()
168  .addSubElement("Final Documents")
169  .addPhaseType(PhaseType.EXECUTION)
170  .setOfferer(Boolean.TRUE)
171  .setShowAllIssues(Boolean.TRUE)
172  .getParent()
173  .addSubElement("Upload Offer")
174  .addPhaseType(PhaseType.PROPOSALS)
175  .setOfferer(Boolean.TRUE)
176  .setShowAllIssues(Boolean.TRUE);
177 
178  addElement("Milestones");
179 
180  addElement("Charts");
181 
182  addElement("Report");
183 
184  addElement("Data");
185 
186  addElement("Project Grants")
187  .addSyndication("patron")
188  .addSyndication("partner");
189 
190  addElement("Students")
191  .setVisitor(Boolean.TRUE);
192 
193  addElement("Ask Participate")
194  .addSyndication("patron")
195  .addSyndication("partner")
196  .addSubElement("As Beneficiary")
197  .getParent()
198  .addSubElement("As Offerer")
199  .getParent()
200  .addSubElement("As Support")
201  .addSyndication("consultant")
202  .getParent()
203  .addSubElement("As Coordinator")
204  .addDiscriminator("#PRIVATE")
205  .getParent()
206  .addSubElement("As Funding")
207  .addSyndication("investor")
208  .getParent()
209  .addSubElement("As Research")
210  .addSyndication("researcher")
211  .getParent()
212  .addSubElement("As Consortium");
213 
214  addElement("Actions");
215 
216  addElement("Forum")
217  .setVisitor(Boolean.TRUE);
218 
219 // Migrated to forum
220 // addElement("Comments")
221 // .setParticipates(Boolean.TRUE)
222 // .addSyndication("patron")
223 // .addSyndication("partner");
224  }
225 
226 }
DossierVisualElement createElement(String name)