|
void | init (@ExecutionArgParam("entityPath") String entityPath) |
|
IElephantEntity | getIee () |
|
boolean | isCanCreate () |
|
void | add (@BindingParam("document") EntityDocumentation document) |
|
void | upload (@BindingParam("document") EntityDocumentation document, @BindingParam("medias") Media medias[]) |
|
void | download (@BindingParam("document") Document document) |
|
void | deleteDoc (@BindingParam("document") Document document) |
|
void | validate (@BindingParam("document") EntityDocumentation document) |
|
void | deny (@BindingParam("document") EntityDocumentation document) |
|
void | delete (@BindingParam("document") EntityDocumentation document) |
|
void | info (@BindingParam("document") DocumentDefinition document) |
|
void | create () |
|
String | getSelectedType () |
|
void | setSelectedType (String selectedType) |
|
List< String > | getDocumentationTypes () |
|
List< EntityDocumentation > | getModel () |
|
◆ add()
void org.turro.documentation.model.DocumentationVM.add |
( |
@BindingParam("document") EntityDocumentation |
document | ) |
|
Definition at line 96 of file DocumentationVM.java.
97 DocumentDefinition dd = document.getDefinition();
98 if(dd.isAllowMultiple()) {
99 Dialogs.title(I_.get(
"Add contact"))
102 .addField(DialogField.field(
"Request to").onEditor(() -> {
103 AssistantListbox al = new AssistantListbox();
104 al.setWebUsers(true);
105 al.setEntityPath(iee.getPath());
106 al.setMold(
"select");
110 IContact require = dialogs.<AssistantListbox>getEditor(
"Request to").getObjectValue();
111 if(require !=
null && require.isValid()) {
112 document.getAssistantIds().add(require.getId());
113 getDao().saveObject(document);
114 BindUtils.postNotifyChange(
null,
null, DocumentationVM.this,
"model");
115 PushSenders.getPool()
118 .send(I_.get(
"Documentation"), I_.get(
"Pending upload documents"), document.getEntity().getEntityUrl());
119 MailSenders.getPool().setRoot(
"/documentation")
122 .silentSendTemplate(document,
"required", I_.get(
"Pending upload documents"));
◆ create()
void org.turro.documentation.model.DocumentationVM.create |
( |
| ) |
|
Definition at line 242 of file DocumentationVM.java.
243 Dialogs.title(I_.get(
"Request new documentation"))
246 .addField(DialogField.field(
"Request to").onEditor(() -> {
247 AssistantListbox al = new AssistantListbox();
248 al.setWebUsers(true);
249 al.setEntityPath(iee.getPath());
250 al.setMold(
"select");
253 .addField(DialogField.field(
"Deadline").onEditor(() -> {
254 Datebox dl = new Datebox();
255 dl.setFormat(
"short");
258 .addField(DialogField.field(
"Documentation").onEditor(() -> {
259 DocumentationListbox dl = new DocumentationListbox(iee.getRoot());
260 dl.setSelectFirst(false);
261 dl.setCheckmark(true);
262 dl.setMultiple(true);
266 Collection<DocumentDefinition> dds = dialogs.<DocumentationListbox>getEditor(
"Documentation").getObjectValues();
268 IContact require = dialogs.<AssistantListbox>getEditor(
"Request to").getObjectValue();
269 if(require !=
null && require.isValid()) {
270 List<EntityDocumentation> eds =
new ArrayList<>();
272 EntityDocumentation ed =
new EntityDocumentation();
273 ed.setRequesterId(Authentication.getIContact().getId());
274 ed.setEntityPath(iee.
getPath());
275 ed.setContactId(require.getId());
276 ed.setDocumentation(dd.getName());
277 ed.setStatus(EntityDocumentationStatus.PENDING_UPLOAD);
278 ed.setDeadline(dialogs.<Datebox>getEditor(
"Deadline").getValue());
282 BindUtils.postNotifyChange(
null,
null, DocumentationVM.this,
"model");
283 EntityDocumentation document = eds.iterator().next();
284 PushSenders.getPool()
287 .send(I_.get(
"Documentation"), I_.get(
"Pending upload documents"), document.getEntity().getEntityUrl());
288 MailSenders.getPool().setRoot(
"/documentation")
291 .silentSendTemplate(document,
"required", I_.get(
"Pending upload documents"));
void saveCollection(Collection objs)
◆ delete()
void org.turro.documentation.model.DocumentationVM.delete |
( |
@BindingParam("document") EntityDocumentation |
document | ) |
|
Definition at line 221 of file DocumentationVM.java.
222 Messages.confirmDeletion().add(document.getDocumentation()).show(() -> {
223 document.getFolder().
remove();
225 BindUtils.postNotifyChange(
null,
null, DocumentationVM.this,
"model");
void deleteObject(Object obj)
◆ deleteDoc()
void org.turro.documentation.model.DocumentationVM.deleteDoc |
( |
@BindingParam("document") Document |
document | ) |
|
Definition at line 169 of file DocumentationVM.java.
170 Messages.confirmDeletion().add(document.name()).show(() -> {
172 BindUtils.postNotifyChange(
null,
null, DocumentationVM.this,
"model");
◆ deny()
void org.turro.documentation.model.DocumentationVM.deny |
( |
@BindingParam("document") EntityDocumentation |
document | ) |
|
Definition at line 194 of file DocumentationVM.java.
195 Dialogs.title(I_.get(
"Deny"))
198 .addField(DialogField.field(
"Reason").scale(2))
200 String comment = dialogs.<Textbox>getEditor(
"Reason").getValue();
201 document.setStatus(EntityDocumentationStatus.DENIED);
202 document.setComment(comment);
203 getDao().saveObject(document);
204 BindUtils.postNotifyChange(
null,
null, DocumentationVM.this,
"model");
205 PushSenders.getPool()
207 .addContact(document.getContact())
208 .addContacts(document.getAssistants())
209 .send(I_.get(
"Documentation"), I_.get(
"Denied"), document.getEntity().getEntityUrl());
210 MailSenders.getPool().setRoot(
"/documentation")
212 .addContact(document.getContact())
213 .addContacts(document.getAssistants())
214 .silentSendTemplate(document,
"denied", I_.get(
"Denied") +
": " + document.getComment());
◆ download()
void org.turro.documentation.model.DocumentationVM.download |
( |
@BindingParam("document") Document |
document | ) |
|
◆ getDocumentationTypes()
List<String> org.turro.documentation.model.DocumentationVM.getDocumentationTypes |
( |
| ) |
|
Definition at line 310 of file DocumentationVM.java.
311 List<String> types =
new ArrayList<>();
313 types.addAll(model.stream().map(ed -> ed.getDefinition().getName()).distinct().toList());
◆ getIee()
◆ getModel()
Definition at line 317 of file DocumentationVM.java.
319 String orderBy = canCreate ?
"ed.status, ed.entityPath, ed.documentation" :
321 model = SqlClause.select(
"ed")
322 .from(
"EntityDocumentation ed")
326 .and().in(
"ed.contactId", contactIds)
327 .or().equal(
"ed.requesterId", contact.
getId())
328 .or().members(
"ed.assistantIds", contactIds)
332 .and().equal(
"ed.entityPath", iee.
getPath())
335 .and().not().equal(
"ed.status", EntityDocumentationStatus.VALIDATED)
339 .resultList(EntityDocumentation.class);
340 List<EntityDocumentation> invalids =
new ArrayList<>();
341 model.removeIf(ed -> !ed.isValid(invalids));
343 model.forEach(ed -> ed.reviewStatus());
345 if(!Strings.isBlank(selectedType)) {
346 model.removeIf(ed -> !selectedType.equals(ed.getDefinition().getName()));
void deleteCollection(Collection objs)
◆ getSelectedType()
String org.turro.documentation.model.DocumentationVM.getSelectedType |
( |
| ) |
|
◆ info()
void org.turro.documentation.model.DocumentationVM.info |
( |
@BindingParam("document") DocumentDefinition |
document | ) |
|
Definition at line 230 of file DocumentationVM.java.
231 Dialogs.title(I_.get(
"Information"))
234 .addComponent(
new Label(document.getDescription()))
235 .addComponent(
new Space())
236 .addComponent(
new DownloadDocuments(I_.get(
"References"), document.getDocumentsFor(contact)))
◆ init()
void org.turro.documentation.model.DocumentationVM.init |
( |
@ExecutionArgParam("entityPath") String |
entityPath | ) |
|
Definition at line 76 of file DocumentationVM.java.
77 if(Strings.isBlank(entityPath)) {
78 entityPath = Executions.getCurrent().getParameter(
"entityPath");
80 if(!Strings.isBlank(entityPath)) {
83 iee = Entities.emptyController();
IElephantEntity getController(String entityPath)
◆ isCanCreate()
boolean org.turro.documentation.model.DocumentationVM.isCanCreate |
( |
| ) |
|
◆ setSelectedType()
void org.turro.documentation.model.DocumentationVM.setSelectedType |
( |
String |
selectedType | ) |
|
Definition at line 305 of file DocumentationVM.java.
306 this.selectedType = selectedType;
307 BindUtils.postNotifyChange(
null,
null, DocumentationVM.this,
"model");
◆ upload()
void org.turro.documentation.model.DocumentationVM.upload |
( |
@BindingParam("document") EntityDocumentation |
document, |
|
|
@BindingParam("medias") Media |
medias[] |
|
) |
| |
Definition at line 132 of file DocumentationVM.java.
133 DocumentDefinition dd = document.getDefinition();
134 Folder folder = document.getFolder();
135 long count = folder.count();
137 for(Media media : medias) {
138 if(++count > dd.getMax() && !exists(folder, media))
break;
139 if(!dd.isUploadControl() || !guessOverrides(folder, media)) {
140 Medias.toFolder(media, folder);
143 Messages.error().format(I_.get(
"Download current %s version first!"), media.getName()).show();
146 if(count > dd.getMin()) {
147 document.setStatus(EntityDocumentationStatus.PENDING_VALIDATION);
149 document.reviewStatus();
150 getDao().saveObject(document);
152 PushSenders.getPool()
154 .addContact(document.getRequester())
155 .send(I_.get(
"Documentation"), I_.get(
"Pending to validate"), document.getEntity().getEntityUrl());
156 MailSenders.getPool().setRoot(
"/documentation")
158 .addContact(document.getRequester())
159 .silentSendTemplate(document,
"uploaded", I_.get(
"Pending to validate"));
◆ validate()
void org.turro.documentation.model.DocumentationVM.validate |
( |
@BindingParam("document") EntityDocumentation |
document | ) |
|
Definition at line 178 of file DocumentationVM.java.
179 document.setStatus(EntityDocumentationStatus.VALIDATED);
180 getDao().saveObject(document);
181 PushSenders.getPool()
183 .addContact(document.getContact())
184 .addContacts(document.getAssistants())
185 .send(I_.get(
"Documentation"), I_.get(
"Validated"), document.getEntity().getEntityUrl());
186 MailSenders.getPool().setRoot(
"/documentation")
188 .addContact(document.getContact())
189 .addContacts(document.getAssistants())
190 .silentSendTemplate(document,
"validated", I_.get(
"Validated"));
The documentation for this class was generated from the following file: