BrightSide Workbench Full Report + Source Code
org.turro.documentation.DocumentationTask Class Reference
Inheritance diagram for org.turro.documentation.DocumentationTask:
Collaboration diagram for org.turro.documentation.DocumentationTask:

Public Member Functions

void execute ()
 
boolean isSystem ()
 
String getName ()
 
String getDataLabel ()
 
- Public Member Functions inherited from org.turro.scheduler.task.AbstractTask
void setConstructor (IConstructor constructor)
 
void setSettings (TaskSettings settings)
 
IConstructor getConstructor ()
 
TaskSettings getSettings ()
 
void setLastExecuted (Date lastExecuted)
 
boolean isDone ()
 
boolean shouldRun (Date now)
 
void doRun (Motor motor)
 
void stop ()
 
void run ()
 
String getColor ()
 
String getIcon ()
 
String getDescription ()
 
int compareTo (AbstractTask o)
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 37 of file DocumentationTask.java.

Member Function Documentation

◆ execute()

void org.turro.documentation.DocumentationTask.execute ( )

Reimplemented from org.turro.scheduler.task.AbstractTask.

Definition at line 40 of file DocumentationTask.java.

40  {
41  Time time = Time.now().addDays((Converter.STANDARD.convert(getSettings().getData(), Long.class)));
42  try(Stream<EntityDocumentation> documentation = SqlClause.select("d").from("EntityDocumentation d")
43  .where().isNotNull("deadline")
44  .and().smallerOrEqual("deadline", time.getDate())
45  .and().in("status", EntityDocumentationStatus.pendingStatusList())
46  .dao(new AttachPU())
47  .stream(EntityDocumentation.class)) {
48  documentation.forEach((ed) -> {
49  if(EntityDocumentationStatus.PENDING_VALIDATION.equals(ed.getStatus())) {
50  PushSenders.getPool()
51  .addContact(ed.getRequester())
52  .send(I_.get("Documentation"), I_.get("Pending to validate"), ed.getEntity().getEntityUrl());
53  MailSenders.getPool().setRoot("/documentation")
54  .addAdministrators()
55  .addContact(ed.getRequester())
56  .silentSendTemplate(ed, "uploaded", I_.get("Pending to validate"));
57  } else {
58  PushSenders.getPool()
59  .addContact(ed.getContact())
60  .addContact(ed.getRequester())
61  .send(I_.get("Documentation"), I_.get("Pending upload documents"), ed.getEntity().getEntityUrl());
62  MailSenders.getPool().setRoot("/documentation")
63  .addContact(ed.getContact())
64  .addContact(ed.getRequester())
65  .silentSendTemplate(ed, "required", I_.get("Pending upload documents"));
66  }
67  });
68  }
69  }
Here is the call graph for this function:

◆ getDataLabel()

String org.turro.documentation.DocumentationTask.getDataLabel ( )

Reimplemented from org.turro.scheduler.task.AbstractTask.

Definition at line 82 of file DocumentationTask.java.

82  {
83  return "Days before deadline";
84  }

◆ getName()

String org.turro.documentation.DocumentationTask.getName ( )

Reimplemented from org.turro.scheduler.task.AbstractTask.

Definition at line 77 of file DocumentationTask.java.

77  {
78  return I_.get("Documentation deadline check");
79  }
Here is the call graph for this function:

◆ isSystem()

boolean org.turro.documentation.DocumentationTask.isSystem ( )

Reimplemented from org.turro.scheduler.task.AbstractTask.

Definition at line 72 of file DocumentationTask.java.

72  {
73  return false;
74  }

The documentation for this class was generated from the following file: