19 package org.turro.dossier.entity;
21 import java.io.IOException;
22 import java.io.Serializable;
23 import java.util.Collections;
24 import java.util.Date;
25 import java.util.List;
26 import java.util.logging.Level;
27 import java.util.logging.Logger;
28 import javax.persistence.Column;
29 import javax.persistence.Entity;
30 import javax.persistence.GeneratedValue;
31 import javax.persistence.GenerationType;
32 import javax.persistence.Id;
33 import javax.persistence.JoinColumn;
34 import javax.persistence.Lob;
35 import javax.persistence.ManyToOne;
36 import javax.persistence.Temporal;
37 import org.turro.action.Contacts;
38 import org.turro.elephant.context.ElephantContext;
39 import org.turro.file.Document;
40 import org.turro.file.Folder;
41 import org.turro.jpa.entity.IDaoEntity;
42 import org.turro.plugin.contacts.IContact;
43 import org.turro.string.Strings;
53 @GeneratedValue(strategy=GenerationType.IDENTITY)
54 @Column(name=
"IDENTIFIER")
57 @Temporal(value = javax.persistence.TemporalType.TIMESTAMP)
58 private java.util.Date creation;
62 private String description;
64 private String bidderId;
66 private boolean accepted, declined;
69 @JoinColumn(name=
"DOSSIER_FK")
85 this.creation = creation;
93 this.description = description;
101 this.bidderId = bidderId;
109 this.accepted = accepted;
117 this.declined = declined;
125 this.dossier = dossier;
132 if(folder.exists())
try {
133 return folder.documents();
134 }
catch (IOException ex) {
135 Logger.getLogger(
DossierOffer.class.getName()).log(Level.SEVERE,
null, ex);
137 return Collections.EMPTY_LIST;
145 return "/WEB-INF/files/dossier/" + dossier.getId() +
"/dossier-offer/" + id;
155 bidderId = contact.
getId();
167 return dossier ==
null || Strings.isBlank(bidderId) || Strings.isBlank(description);
void setCreation(Date creation)
void setBidderId(String bidderId)
void setAccepted(boolean accepted)
void setDossier(Dossier dossier)
void setDeclined(boolean declined)
List< Document > getDocuments()
void setBidder(IContact contact)
void setDescription(String description)
static String getRealPath(String path)