Subversion Repositories bacoAlunos

Rev

Rev 1580 | Rev 1629 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1580 Rev 1586
Line 1... Line 1...
1
package pt.estgp.estgweb.services.questionarios;
1
package pt.estgp.estgweb.services.questionarios;
2
 
2
 
3
import jomm.dao.impl.AbstractDao;
-
 
4
import org.apache.log4j.Logger;
3
import org.apache.log4j.Logger;
5
import pt.estgp.estgweb.domain.*;
4
import pt.estgp.estgweb.domain.*;
6
import pt.estgp.estgweb.domain.dao.DaoFactory;
5
import pt.estgp.estgweb.domain.dao.DaoFactory;
7
import pt.estgp.estgweb.services.jobs.JobDeamon;
6
import pt.estgp.estgweb.services.jobs.JobDeamon;
8
import pt.estgp.estgweb.services.jobs.ServiceJob;
7
import pt.estgp.estgweb.services.jobs.ServiceJob;
Line 29... Line 28...
29
    {
28
    {
30
        QuestionarioReportFileGroup reportFileGroup = (QuestionarioReportFileGroup) 1.5.0/docs/api/java/lang/Class.html">Class.forName(classType).newInstance();
29
        QuestionarioReportFileGroup reportFileGroup = (QuestionarioReportFileGroup) 1.5.0/docs/api/java/lang/Class.html">Class.forName(classType).newInstance();
31
        reportFileGroup.setTitle(title);
30
        reportFileGroup.setTitle(title);
32
        1.5.0/docs/api/java/lang/String.html">String processorClassForGroup = ConfigProperties.getProperty("questionarios.processor." + classType);
31
        1.5.0/docs/api/java/lang/String.html">String processorClassForGroup = ConfigProperties.getProperty("questionarios.processor." + classType);
33
        reportFileGroup.setReportProcessorClass(processorClassForGroup);
32
        reportFileGroup.setReportProcessorClass(processorClassForGroup);
34
        AbstractDao.getCurrentSession().save(reportFileGroup);
33
        DaoFactory.getQuestionarioReportFileGroupDaoImpl().save(reportFileGroup);
35
    }
34
    }
36
 
35
 
37
    public void updateReportGroup(long reportGroupId, 1.5.0/docs/api/java/lang/String.html">String title, UserSession userSession) throws 1.5.0/docs/api/java/lang/ClassNotFoundException.html">ClassNotFoundException, 1.5.0/docs/api/java/lang/IllegalAccessException.html">IllegalAccessException, 1.5.0/docs/api/java/lang/InstantiationException.html">InstantiationException
36
    public void updateReportGroup(long reportGroupId, 1.5.0/docs/api/java/lang/String.html">String title, boolean active, UserSession userSession) throws 1.5.0/docs/api/java/lang/ClassNotFoundException.html">ClassNotFoundException, 1.5.0/docs/api/java/lang/IllegalAccessException.html">IllegalAccessException, 1.5.0/docs/api/java/lang/InstantiationException.html">InstantiationException
38
    {
37
    {
39
        QuestionarioReportFileGroupImpl reportGroup = (QuestionarioReportFileGroupImpl) DaoFactory.getQuestionarioReportFileGroupDaoImpl().load(reportGroupId);
38
        QuestionarioReportFileGroupImpl reportGroup = (QuestionarioReportFileGroupImpl) DaoFactory.getQuestionarioReportFileGroupDaoImpl().load(reportGroupId);
40
        reportGroup.setTitle(title);
39
        reportGroup.setTitle(title);
-
 
40
        reportGroup.setActive(active);
41
    }
41
    }
42
 
42
 
-
 
43
    public void updateReportFile(long reportFileId, boolean active, UserSession userSession) throws 1.5.0/docs/api/java/lang/ClassNotFoundException.html">ClassNotFoundException, 1.5.0/docs/api/java/lang/IllegalAccessException.html">IllegalAccessException, 1.5.0/docs/api/java/lang/InstantiationException.html">InstantiationException
-
 
44
    {
-
 
45
        QuestionarioReportFile reportFile = DaoFactory.getQuestionarioReportFileDaoImpl()
-
 
46
                .load(reportFileId);
-
 
47
        reportFile.setActive(active);
-
 
48
    }
-
 
49
 
43
    public QuestionarioReportFileGroupImpl runJobGenerate(long reportGroupId,1.5.0/docs/api/java/lang/String.html">String title, UserSession session) throws NotAuthorizedException, 1.5.0/docs/api/java/lang/ClassNotFoundException.html">ClassNotFoundException {
50
    public QuestionarioReportFileGroupImpl runJobGenerate(long reportGroupId,1.5.0/docs/api/java/lang/String.html">String title,boolean active, UserSession session) throws NotAuthorizedException, 1.5.0/docs/api/java/lang/ClassNotFoundException.html">ClassNotFoundException {
44
 
51
 
45
        QuestionarioReportFileGroupImpl reportGroup = (QuestionarioReportFileGroupImpl) DaoFactory.getQuestionarioReportFileGroupDaoImpl().load(reportGroupId);
52
        QuestionarioReportFileGroupImpl reportGroup = (QuestionarioReportFileGroupImpl) DaoFactory.getQuestionarioReportFileGroupDaoImpl().load(reportGroupId);
46
        reportGroup.setTitle(title);
53
        reportGroup.setTitle(title);
-
 
54
        reportGroup.setActive(active);
47
        Set<JobServiceTaskParameter> paramsJob = new HashSet<JobServiceTaskParameter>();
55
        Set<JobServiceTaskParameter> paramsJob = new HashSet<JobServiceTaskParameter>();
48
 
56
 
49
        JobServiceTaskParameterImpl paramJob = DomainObjectFactory.createJobServiceTaskParameterImpl();
57
        JobServiceTaskParameterImpl paramJob = DomainObjectFactory.createJobServiceTaskParameterImpl();
50
        paramJob.setName(ServiceJob.JOB_questionario_report_id_KEY);
58
        paramJob.setName(ServiceJob.JOB_questionario_report_id_KEY);
51
        paramJob.setDescription("ID do Report Group");
59
        paramJob.setDescription("ID do Report Group");