19 package org.turro.dossier.entity;
21 import java.time.Instant;
22 import java.util.Date;
23 import java.util.List;
24 import javax.persistence.AttributeOverride;
25 import javax.persistence.AttributeOverrides;
26 import javax.persistence.Column;
27 import javax.persistence.Embedded;
28 import javax.persistence.Entity;
29 import javax.persistence.GeneratedValue;
30 import javax.persistence.GenerationType;
31 import javax.persistence.Id;
32 import javax.persistence.Temporal;
33 import org.turro.string.Strings;
34 import org.turro.entities.IElephantEntity;
35 import org.turro.html.HtmlContent;
36 import org.turro.jpa.embeddables.Wiki;
37 import org.turro.jpa.entity.IDaoEntity;
47 @GeneratedValue(strategy=GenerationType.IDENTITY)
48 @Column(name=
"IDENTIFIER")
55 @AttributeOverride( name =
"text", column = @Column(name =
"goal")),
56 @AttributeOverride( name =
"wiki", column = @Column(name =
"wgoal"))
60 @Temporal(value = javax.persistence.TemporalType.TIMESTAMP)
61 private java.util.Date endDate;
63 private boolean recurrent, endOfBudget;
67 @AttributeOverride( name =
"text", column = @Column(name =
"deadline")),
68 @AttributeOverride( name =
"wiki", column = @Column(name =
"wdeadline"))
72 private boolean micro, small, medium, big, otherOrgs;
76 @AttributeOverride( name =
"text", column = @Column(name =
"beneficiaries")),
77 @AttributeOverride( name =
"wiki", column = @Column(name =
"wbeneficiaries"))
79 private Wiki beneficiaries =
new Wiki();
81 private double budget;
88 @AttributeOverride( name =
"text", column = @Column(name =
"elegible")),
89 @AttributeOverride( name =
"wiki", column = @Column(name =
"welegible"))
93 private boolean subvention, loan, inKind;
94 private boolean collaboration;
98 @AttributeOverride( name =
"text", column = @Column(name =
"features")),
99 @AttributeOverride( name =
"wiki", column = @Column(name =
"wfeatures"))
104 @AttributeOverrides({
105 @AttributeOverride( name =
"text", column = @Column(name =
"intensity")),
106 @AttributeOverride( name =
"wiki", column = @Column(name =
"wintensity"))
108 private Wiki intensity =
new Wiki();
110 private boolean minimis;
112 private String source;
114 private String convocation, basis;
145 this.endDate = endDate;
153 this.recurrent = recurrent;
161 this.endOfBudget = endOfBudget;
169 this.deadline = deadline;
193 this.medium = medium;
209 this.otherOrgs = otherOrgs;
213 return beneficiaries;
217 this.beneficiaries = beneficiaries;
225 this.budget = budget;
229 return matchCriteria;
233 this.matchCriteria = matchCriteria;
241 this.elegible = elegible;
249 this.subvention = subvention;
265 this.inKind = inKind;
269 return collaboration;
273 this.collaboration = collaboration;
281 this.features = features;
289 this.intensity = intensity;
297 this.minimis = minimis;
305 this.source = source;
313 this.convocation = convocation;
333 if(goal ==
null) goal =
new Wiki();
334 if(deadline ==
null) deadline =
new Wiki();
335 if(beneficiaries ==
null) beneficiaries =
new Wiki();
336 if(elegible ==
null) elegible =
new Wiki();
337 if(features ==
null) features =
new Wiki();
338 if(intensity ==
null) intensity =
new Wiki();
340 return Strings.isBlank(title) || goal.
isEmpty();
346 return title ==
null ?
"!***" : title;
350 return goal ==
null ?
"!***" : HtmlContent.plain(goal.
getText(), 500);
354 return micro | small | medium | big;
358 return endDate ==
null || endDate.toInstant().isAfter(Instant.now());
362 return matchCriteria !=
null ? matchCriteria.getMatchingsForProjectGrant(
id) :
null;
void setSubvention(boolean subvention)
List< IElephantEntity > getGrantMatches()
void setOtherOrgs(boolean otherOrgs)
void setMatchCriteria(GrantMatchCriteria matchCriteria)
void setRecurrent(boolean recurrent)
void setFeatures(Wiki features)
void setEndOfBudget(boolean endOfBudget)
void setEndDate(Date endDate)
void setBudget(double budget)
void setCollaboration(boolean collaboration)
void setIntensity(Wiki intensity)
void setDeadline(Wiki deadline)
void setMinimis(boolean minimis)
void setBeneficiaries(Wiki beneficiaries)
boolean isCollaboration()
void setConvocation(String convocation)
void setElegible(Wiki elegible)
void setMicro(boolean micro)
void setTitle(String title)
void setSmall(boolean small)
void setMedium(boolean medium)
void setBasis(String basis)
GrantMatchCriteria getMatchCriteria()
void setSource(String source)
void setLoan(boolean loan)
void setInKind(boolean inKind)