- Author
- Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g
Definition at line 60 of file OffersVM.java.
◆ accept()
void org.turro.dossier.offer.OffersVM.accept |
( |
@BindingParam("offer") DossierOffer |
offer | ) |
|
Definition at line 152 of file OffersVM.java.
153 Messages.confirmAcceptation().add(offer.getDescription()).paragraph()
154 .add(I_.get(
"This action will accept the offer and send a notification.")).show(() -> {
155 offer.setAccepted(
true);
156 offer.setDeclined(
false);
157 getDao().saveObject(offer);
158 IElephantEntity iee = Entities.getController(dossier);
159 PushSenders.getPool()
160 .addContact(offer.getDossier().getDefaultResponsible())
161 .addContact(offer.getBidder())
162 .send(I_.get(
"Offer"), I_.get(
"Accepted"), iee.getEntityUrl());
163 MailSenders.getPool().setRoot(
"/offers")
164 .addContact(offer.getDossier().getDefaultResponsible())
165 .addContact(offer.getBidder())
166 .silentSendTemplate(iee,
"accepted", I_.get(
"Accepted"));
◆ canAccept()
boolean org.turro.dossier.offer.OffersVM.canAccept |
( |
DossierOffer |
offer | ) |
|
Definition at line 222 of file OffersVM.java.
223 return canAll && !(offer.isAccepted() || offer.isDeclined());
◆ canCreate()
boolean org.turro.dossier.offer.OffersVM.canCreate |
( |
| ) |
|
◆ canDelete()
boolean org.turro.dossier.offer.OffersVM.canDelete |
( |
DossierOffer |
offer | ) |
|
Definition at line 214 of file OffersVM.java.
215 return canAll || !(offer.isAccepted() || offer.isDeclined());
◆ canUpload()
boolean org.turro.dossier.offer.OffersVM.canUpload |
( |
DossierOffer |
offer | ) |
|
Definition at line 208 of file OffersVM.java.
210 (canAddWorking && !(offer.isAccepted() || offer.isDeclined())) ||
211 (canAddFinal && offer.isAccepted());
◆ create()
void org.turro.dossier.offer.OffersVM.create |
( |
| ) |
|
Definition at line 119 of file OffersVM.java.
120 if(!canCreate)
return;
121 Dialogs.title(I_.get(
"New offer"))
124 .addField(DialogField.field(
"Description").lines(5).maxLength(1000))
126 String description = dialogs.getValue(
"Description", String.class);
127 if(!Strings.isBlank(description)) {
128 DossierOffer offer = new DossierOffer();
129 offer.setDossier(dossier);
130 offer.setCreation(new Date());
131 offer.setDescription(description);
132 offer.setBidderId(contact.getId());
133 offer = getDao().saveEntity(offer);
134 BindUtils.postNotifyChange(null, null, OffersVM.this,
"model");
135 IElephantEntity iee = Entities.getController(dossier);
136 PushSenders.getPool()
137 .addContact(offer.getDossier().getDefaultResponsible())
138 .addContact(offer.getBidder())
139 .send(I_.get(
"Offer"), I_.get(
"New offer"), iee.getEntityUrl());
140 MailSenders.getPool().setRoot(
"/offers")
141 .addContact(offer.getDossier().getDefaultResponsible())
142 .addContact(offer.getBidder())
143 .silentSendTemplate(iee,
"new", I_.get(
"New offer"));
◆ decline()
void org.turro.dossier.offer.OffersVM.decline |
( |
@BindingParam("offer") DossierOffer |
offer | ) |
|
Definition at line 172 of file OffersVM.java.
173 Messages.confirmProcess().add(offer.getDescription()).paragraph()
174 .add(I_.get(
"This action will decline the offer and send a notification.")).show(() -> {
175 offer.setAccepted(
false);
176 offer.setDeclined(
true);
177 getDao().saveObject(offer);
178 IElephantEntity iee = Entities.getController(dossier);
179 PushSenders.getPool()
180 .addContact(offer.getDossier().getDefaultResponsible())
181 .addContact(offer.getBidder())
182 .send(I_.get(
"Offer"), I_.get(
"Declined"), iee.getEntityUrl());
183 MailSenders.getPool().setRoot(
"/offers")
184 .addContact(offer.getDossier().getDefaultResponsible())
185 .addContact(offer.getBidder())
186 .silentSendTemplate(iee,
"declined", I_.get(
"Declined"));
◆ delete()
void org.turro.dossier.offer.OffersVM.delete |
( |
@BindingParam("offer") DossierOffer |
offer | ) |
|
Definition at line 110 of file OffersVM.java.
111 Messages.confirmDeletion().add(offer.getDescription()).show(() -> {
112 offer.getFolder().
remove();
114 BindUtils.postNotifyChange(
null,
null, OffersVM.this,
"model");
void deleteObject(Object obj)
◆ deleteDoc()
void org.turro.dossier.offer.OffersVM.deleteDoc |
( |
@BindingParam("document") Document |
document | ) |
|
Definition at line 102 of file OffersVM.java.
103 Messages.confirmDeletion().add(document.name()).show(() -> {
105 BindUtils.postNotifyChange(
null,
null, OffersVM.this,
"model");
◆ download()
void org.turro.dossier.offer.OffersVM.download |
( |
@BindingParam("document") Document |
document | ) |
|
Definition at line 97 of file OffersVM.java.
98 new FileWrapper(document.document()).download();
◆ getModel()
List<DossierOffer> org.turro.dossier.offer.OffersVM.getModel |
( |
| ) |
|
Definition at line 190 of file OffersVM.java.
191 if(prepareValues()) {
192 model = SqlClause.select(
"p")
193 .from(
"DossierOffer p")
194 .where().equal(
"p.dossier", dossier)
196 .and().equal(
"p.bidderId", contact.
getId())
199 .resultList(DossierOffer.class);
200 if(!model.isEmpty()) canCreate =
false;
203 return Collections.EMPTY_LIST;
◆ init()
void org.turro.dossier.offer.OffersVM.init |
( |
@ExecutionArgParam("dossierId") String |
dossierId | ) |
|
Definition at line 68 of file OffersVM.java.
69 if(Strings.isBlank(dossierId)) {
70 dossierId = Executions.getCurrent().getParameter(
"dossierId");
72 this.dossier = getDao().find(Dossier.class, Long.valueOf(dossierId));
73 this.visual = DossierVisualElements.load().
getElement(
"Offers");
VisualElement getElement(String name)
◆ upload()
void org.turro.dossier.offer.OffersVM.upload |
( |
@BindingParam("offer") DossierOffer |
offer, |
|
|
@BindingParam("medias") Media |
medias[] |
|
) |
| |
Definition at line 78 of file OffersVM.java.
80 Folder folder = offer.getFolder();
81 for(Media media : medias) {
82 Medias.toFolder(media, folder);
84 IElephantEntity iee = Entities.getController(dossier);
86 .addContact(offer.getDossier().getDefaultResponsible())
87 .addContact(offer.getBidder())
88 .send(I_.get(
"Offer"), I_.get(
"New documents"), iee.getEntityUrl());
89 MailSenders.getPool().setRoot(
"/offers")
90 .addContact(offer.getDossier().getDefaultResponsible())
91 .addContact(offer.getBidder())
92 .silentSendTemplate(iee,
"newdocs", I_.get(
"New documents"));
boolean canUpload(DossierOffer offer)
The documentation for this class was generated from the following file: