Rev 1590 | Rev 1592 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1583 | jmachado | 1 | <%@ tag import="jomm.utils.MessageResources" %> |
2 | <%@ tag import="pt.estgp.estgweb.domain.JobServiceTaskImpl" %> |
||
3 | <%@ tag import="pt.estgp.estgweb.domain.dao.DaoFactory" %> |
||
4 | <%@ tag import="pt.estgp.estgweb.web.form.configuration.SchedulleTasksForm" %> |
||
5 | <%@ tag import="jomm.dao.impl.AbstractDao" %> |
||
6 | <%@tag description="Body Tag Page template" pageEncoding="UTF-8"%> |
||
7 | <%@taglib prefix="t" tagdir="/WEB-INF/tags/examples" %> |
||
8 | <%@attribute name="taskId" type="java.lang.Long" required="false" %> <!-- Task ID to get the JOB from database --> |
||
9 | <%@attribute name="transactional" type="java.lang.Boolean" required="true" %> <!-- Define if tag should open database transaction --> |
||
10 | <%@attribute name="job" type="pt.estgp.estgweb.domain.JobServiceTaskImpl" required="false"%> <!-- If job defined TaskId is not used --> |
||
11 | <%@attribute name="targetUrlWithOutContextPath" type="java.lang.String" required="true" %> <!-- Task ID to get the JOB from database --> |
||
12 | <%@attribute name="logSizeXs" type="java.lang.Boolean" required="false" %> <!-- Task Log Size --> |
||
13 | |||
14 | <div class="col-md-12"> |
||
15 | <% |
||
16 | |||
17 | if(!transactional) |
||
18 | { |
||
19 | AbstractDao.getCurrentSession().beginTransaction(); |
||
20 | } |
||
21 | |||
22 | if(logSizeXs == null) |
||
23 | logSizeXs = false; |
||
24 | |||
25 | if(taskId != null) |
||
26 | { |
||
27 | job = taskId > 0 ? |
||
28 | (JobServiceTaskImpl) DaoFactory.getJobServiceTaskDaoImpl().load(taskId) : |
||
29 | null; |
||
30 | } |
||
31 | else |
||
32 | { |
||
33 | //do nothing job is already loaded |
||
34 | } |
||
35 | |||
36 | if(job != null) |
||
37 | { |
||
38 | SchedulleTasksForm schedulleTasksForm = new SchedulleTasksForm(); |
||
39 | schedulleTasksForm.setJobServiceTask(job); |
||
40 | schedulleTasksForm.setId(job.getId()); |
||
41 | request.setAttribute("SchedulleTasksForm",schedulleTasksForm); |
||
42 | if(job.getStatusEnum() == JobServiceTaskImpl.JobStatus.FAILED || |
||
43 | job.getStatusEnum() == JobServiceTaskImpl.JobStatus.UNKNOWN_ERROR || |
||
44 | job.getStatusEnum() == JobServiceTaskImpl.JobStatus.FINISHED_ERRORS ) |
||
45 | { |
||
46 | %> |
||
47 | <div class="alert alert-danger"><%=MessageResources.getInstance(request).getMessage("job.status."+job.getStatus())%>, Consulte o Log</div> |
||
48 | <% |
||
49 | } |
||
1591 | jmachado | 50 | request.setAttribute("logSize",(logSizeXs.booleanValue() ? "task-log-xs" : "")); |
1583 | jmachado | 51 | %> |
1590 | jmachado | 52 | <div class="task-log ${logSize}" data-href="<%=request.getContextPath()%>${targetUrlWithOutContextPath}"> |
1583 | jmachado | 53 | <jsp:include page="/admin/configuration/taskLog.jsp"/> |
54 | </div> |
||
55 | <% |
||
56 | } |
||
57 | else |
||
58 | { |
||
59 | %> |
||
60 | <div class="alert alert-danger">O sistema não conseguiu encontrar a tarefa de atribuição nas tarefas agendadas, por favor verifique em todos os logs de tarefas <html:link action="/user/configurationJobTasks">Aqui</html:link> </div> |
||
61 | <% |
||
62 | } |
||
63 | |||
64 | if(!transactional) |
||
65 | { |
||
66 | AbstractDao.getCurrentSession().getTransaction().commit(); |
||
67 | } |
||
68 | %> |
||
69 | </div> |