19 package org.turro.dossier.content;
21 import java.io.Writer;
22 import java.util.ArrayList;
23 import java.util.Collection;
24 import java.util.EnumSet;
25 import java.util.List;
26 import org.turro.string.Strings;
27 import org.turro.attach.www.AttachCtrl;
28 import org.turro.dossier.db.DossierPU;
29 import org.turro.dossier.entity.Dossier;
30 import org.turro.dossier.entity.DossierStatus;
31 import org.turro.dossier.entity.Issue;
32 import org.turro.dossier.entity.IssueResolution;
33 import org.turro.dossier.entity.IssueStatus;
34 import org.turro.dossier.entity.IssueType;
35 import org.turro.dossier.workload.WorkloadItem;
36 import org.turro.dossier.workload.WorkloadQuery;
37 import org.turro.dossier.workload.WorkloadSet;
38 import org.turro.dossier.zul.issue.IssueStage;
39 import org.turro.elephant.context.IConstructor;
40 import org.turro.elephant.impl.repository.Repository;
41 import org.turro.elephant.impl.repository.RepositoryFile;
42 import org.turro.elephant.web.SocialImageMap;
43 import org.turro.elephant.web.SocialNet;
44 import org.turro.entities.Entities;
45 import org.turro.file.util.FileAttach;
46 import org.turro.jpa.content.EntityItemContentIterator;
47 import org.turro.marker.ElephantMarker;
48 import org.turro.plugin.contacts.IContact;
49 import org.turro.www.commentit.CommentItCtrl;
50 import org.turro.www.describeit.DescribeItCtrl;
51 import org.turro.www.starit.StarItCtrl;
52 import org.turro.www.voteit.VoteItCtrl;
60 private boolean showSubject;
61 private final boolean all;
65 super(getWorkload(contact),
constructor, writer, contact, mail, pubPath);
74 this.showSubject = showSubject;
85 prepareValues(e, page);
93 prepareValues(e, page);
100 if(wi.getIssue().getId().equals(value)) {
112 return super.isValid(e);
126 private String getIssueClass(Issue issue) {
128 (issue.getStatus().equals(IssueStatus.STATUS_NEW) ?
" new" :
"") +
129 (issue.getStatus().equals(IssueStatus.STATUS_STARTED) ?
" started" :
"") +
130 (issue.getStatus().equals(IssueStatus.STATUS_INCOMPLETE) ?
" incomplete" :
"") +
131 (issue.getStatus().equals(IssueStatus.STATUS_REOPENED) ?
" reopened" :
"") +
132 (issue.getStatus().equals(IssueStatus.STATUS_REUNION) ?
" reunion" :
"") +
133 (issue.getStatus().equals(IssueStatus.STATUS_FROZEN) ?
" frozen" :
"") +
134 (issue.getStatus().equals(IssueStatus.STATUS_RESOLVED) ?
" resolved" :
"") +
135 (issue.getStatus().equals(IssueStatus.STATUS_VERIFIED) ?
" verified" :
"") +
136 (issue.getStatus().equals(IssueStatus.STATUS_CLOSED) ?
" closed" :
"") +
138 (issue.getType().equals(IssueType.TYPE_DEFECT) ?
" defect" :
"") +
139 (issue.getType().equals(IssueType.TYPE_ENHANCEMENT) ?
" enhancement" :
"") +
140 (issue.getType().equals(IssueType.TYPE_FEATURE) ?
" feature" :
"") +
141 (issue.getType().equals(IssueType.TYPE_NONCONFORMITY) ?
" nonconformity" :
"") +
142 (issue.getType().equals(IssueType.TYPE_PATCH) ?
" patch" :
"") +
143 (issue.getType().equals(IssueType.TYPE_PREVENTION) ?
" prevention" :
"") +
144 (issue.getType().equals(IssueType.TYPE_QUESTION) ?
" question" :
"") +
145 (issue.getType().equals(IssueType.TYPE_TASK) ?
" task" :
"") +
146 (issue.getType().equals(IssueType.TYPE_DOCUMENT) ?
" document" :
"") +
147 (issue.getType().equals(IssueType.TYPE_BESTPRACTICE) ?
" bestpractice" :
"") +
148 (issue.getType().equals(IssueType.TYPE_PROCESS) ?
" process" :
"") +
149 (issue.getType().equals(IssueType.TYPE_PROPOSITION) ?
" proposition" :
"") +
151 (issue.getResolution().equals(IssueResolution.RESOLUTION_DUPLICATED) ?
" duplicated" :
"") +
152 (issue.getResolution().equals(IssueResolution.RESOLUTION_FIXED) ?
" fixed" :
"") +
153 (issue.getResolution().equals(IssueResolution.RESOLUTION_INVALID) ?
" invalid" :
"") +
154 (issue.getResolution().equals(IssueResolution.RESOLUTION_MOVED) ?
" moved" :
"") +
155 (issue.getResolution().equals(IssueResolution.RESOLUTION_NONE) ?
" none" :
"") +
156 (issue.getResolution().equals(IssueResolution.RESOLUTION_WONTFIX) ?
" wontfix" :
"") +
157 (issue.getResolution().equals(IssueResolution.RESOLUTION_WORKSFORME) ?
" worksforme" :
"");
170 ArrayList<RepositoryFile> files =
new ArrayList<>();
182 private static List<WorkloadItem> getWorkload(
IContact contact) {
190 return new ArrayList(ws);
195 return isMail() ?
"content/newsletter/sections/workload" :
"issue";
236 throw new UnsupportedOperationException(
"Not supported yet.");
254 return "/user/myissues";
String getSummaryTemplate()
WorkloadItem entity(Long value)
Object doVotesCtrl(WorkloadItem e)
void setShowSubject(boolean showSubject)
void renderSummary(ElephantMarker marker, WorkloadItem e, int page)
Object doCommentsCtrl(WorkloadItem e)
void renderItem(ElephantMarker marker, WorkloadItem e, int page)
Object doFilesCtrl(WorkloadItem e)
Object doPollsCtrl(WorkloadItem e)
String getRestrictedLink()
String title(WorkloadItem e)
WorkloadContentIterator(IConstructor constructor, Writer writer, IContact contact, boolean mail, String pubPath)
boolean isValid(WorkloadItem e)
Object doDescriptionsCtrl(WorkloadItem e)
Object doAttachmentsCtrl(WorkloadItem e)
Collection< String > metas(WorkloadItem e)
Object doInterestCtrl(WorkloadItem e)
String getItemLink(WorkloadItem e)
static String getObjectPath(Object object)
DossierStatus getStatus()
String getFullDescription()
boolean isFullParticipant()
IssueWrapper getWrapper()
static IssueStage getStage(WorkloadItem item)
void keep(EnumSet< IssueStage > set)
Set< RepositoryFile > getRepositoryFiles(String pattern)
static boolean hasImage(String url)
List< String > getMetas()
static IElephantEntity getController(String path)
Repository getPublishableRepository(IConstructor constructor)
void prepareControls(E entity, int page)
void process(String rootTmpl, String tmpl)
Object put(Object key, Object value)
boolean isInRole(String role)
ISSUE_STAGE_DATE_SURPASSED
Object configureCtrl(Object ctrl, IContact contact)