Subversion Repositories bacoAlunos

Rev

Rev 1133 | Rev 1145 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
995 jmachado 1
package pt.estgp.estgweb.services.sigesimports;
2
 
3
import jomm.dao.impl.AbstractDao;
4
import jomm.utils.FilesUtils;
5
import jomm.utils.PdfUtils;
6
import org.apache.commons.net.ftp.FTP;
7
import org.apache.commons.net.ftp.FTPClient;
8
import org.apache.fop.apps.FOPException;
9
import org.apache.log4j.Logger;
10
import org.dom4j.Document;
11
import org.json.JSONArray;
12
import org.json.JSONException;
13
import org.json.JSONObject;
14
import pt.estgp.estgweb.Globals;
15
import pt.estgp.estgweb.domain.*;
16
import pt.estgp.estgweb.domain.dao.DaoFactory;
17
import pt.estgp.estgweb.domain.enums.LangEnum;
18
import pt.estgp.estgweb.services.courseunits.CreateCourseUnitXML;
19
import pt.estgp.estgweb.services.email.EMAILJob;
20
import pt.estgp.estgweb.services.email.SendEmailService;
21
import pt.estgp.estgweb.services.expceptions.ServiceException;
22
import pt.estgp.estgweb.services.jobs.JobScheduleService;
23
import pt.estgp.estgweb.services.jobs.ServiceJob;
24
import pt.estgp.estgweb.services.logresults.ILogMessages;
25
import pt.estgp.estgweb.services.logresults.LogMessageTypeEnum;
26
import pt.estgp.estgweb.services.logresults.impl.DefaultLogMessage;
27
import pt.estgp.estgweb.services.logresults.impl.DefaultLogMessages;
28
import pt.estgp.estgweb.utils.Dom4jUtil;
29
import pt.estgp.estgweb.web.FtpServer;
30
import pt.ipportalegre.siges.web.services.ArrayOfAula;
31
import pt.ipportalegre.siges.web.services.Aula;
32
import pt.ipportalegre.siges.web.services.SiGesWEB;
33
import pt.utl.ist.berserk.logic.serviceManager.IService;
34
 
35
import javax.xml.namespace.QName;
36
import javax.xml.transform.TransformerException;
37
import javax.xml.transform.dom.DOMSource;
38
import java.io.File;
39
import java.io.FileInputStream;
40
import java.io.FileOutputStream;
41
import java.io.IOException;
1017 jmachado 42
import java.math.BigDecimal;
995 jmachado 43
import java.net.URL;
44
import java.util.ArrayList;
45
import java.util.HashMap;
46
import java.util.List;
47
import java.util.Map;
48
 
49
/**
50
 * @author Jorge Machado
51
 * @date 11/May/2008
52
 * @time 12:51:32
53
 * @see pt.estgp.estgweb
54
 */
55
public class ImportSumariesJson extends ServiceJob implements IService
56
{
57
 
58
    private static final 1.5.0/docs/api/java/util/logging/Logger.html">Logger logger = 1.5.0/docs/api/java/util/logging/Logger.html">Logger.getLogger(ImportSumariesJson.class);
59
 
1030 jmachado 60
    private static final int MAX_COMMIT = 10;
995 jmachado 61
 
62
 
63
    public ILogMessages run(1.5.0/docs/api/java/lang/String.html">String year,1.5.0/docs/api/java/lang/String.html">String semestre) throws ServiceException
64
    {
65
        return run(year,semestre,true,true);
66
    }
67
 
68
    public ILogMessages run(1.5.0/docs/api/java/lang/String.html">String year,1.5.0/docs/api/java/lang/String.html">String semestre,boolean sendIONLINE,boolean sendEMAIL) throws ServiceException
69
    {
70
        1.5.0/docs/api/java/lang/String.html">String msgS = "STARTING SUMARIES IMPORT SERVICE FOR year: " + year + " semestre: " + semestre + " sendIONLINE: " + sendIONLINE + " sendEMAIL: " + sendEMAIL;
71
        serviceLogInfo(msgS);
72
        logger.info(msgS);
73
 
74
        DefaultLogMessages logMessages = new DefaultLogMessages();
1017 jmachado 75
        logMessages.addMessage(new DefaultLogMessage("import.summaries", LogMessageTypeEnum.INFO, "instituicao " + DaoFactory.getConfigurationDaoImpl().getSigesInstitutionCode()));
995 jmachado 76
        serviceLogInfo(logMessages.getLastMessage());
77
 
78
 
79
        int countUnits = 0;
80
        int countUnitsOk = 0;
81
        int countUnitsZeroSummaries = 0;
1081 jmachado 82
        int countUnitsZeroValidSummaries = 0;
995 jmachado 83
 
84
        List<String> unitsZeroSummaries = new ArrayList<String>();
85
        List<String> unitsFailed = new ArrayList<String>();
86
        try
87
        {
88
 
89
            SiGesWEB service;
1017 jmachado 90
            1.5.0/docs/api/java/lang/String.html">String WSDL = DaoFactory.getConfigurationDaoImpl().getSigesWebServicesWsdl();
995 jmachado 91
            try
92
            {
1017 jmachado 93
                serviceLogInfo("STARTING WEB SERVICE AT " + WSDL);
94
                service = new SiGesWEB(new 1.5.0/docs/api/java/net/URL.html">URL(WSDL), new 1.5.0/docs/api/javax/xml/namespace/QName.html">QName(Globals.SIGES_WEBSERVICE_TARGET_NAMESPACE, "SiGesWEB"));
995 jmachado 95
            }
96
            catch (1.5.0/docs/api/java/lang/Throwable.html">Throwable e)
97
            {
98
                logMessages.addMessage(new DefaultLogMessage("import.error",e.toString(),"erro na configuracao do WEB Service", LogMessageTypeEnum.INFO));
99
                serviceLogInfo(logMessages.getLastMessage());
100
                logger.fatal(e, e);
101
                serviceLogError(e.toString(), e);
102
                return logMessages;
103
            }
104
 
105
            int i = 0;
106
            //List<Long> cUs = DaoFactory.getCourseUnitDaoImpl().loadIds(year,DatesUtils.getSemestre());
107
            List<Long> cUs = DaoFactory.getCourseUnitDaoImpl().loadIds(year,semestre);
108
            1.5.0/docs/api/java/lang/String.html">String nowCode = "";
109
            for(1.5.0/docs/api/java/lang/Long.html">Long cId: cUs)
110
            {
1144 jmachado 111
                nowCode = "" + cId;
995 jmachado 112
                countUnits++;
113
                try
114
                {
115
                    if (i++ > MAX_COMMIT)
116
                    {
117
                        i = 0;
996 jmachado 118
                        setProgress((int) (((float)countUnits)/((float)cUs.size())*100.0f));
1076 jmachado 119
                        commitPartially();
995 jmachado 120
                    }
121
                    CourseUnit c = DaoFactory.getCourseUnitDaoImpl().load(cId);
122
                    nowCode = c.getCode();
123
                    logMessages.addMessage(new DefaultLogMessage("import.info","Importing Summaries to CourseUnit: " + c.getCode() + ": course: " + c.getCourse().getCode(),"", LogMessageTypeEnum.INFO));
124
                    logger.info("Importing Summaries to CourseUnit: " + c.getName() + " (" + c.getCode() + ") course " + c.getCourse().getName() + " (" + c.getCourse().getCode() + ")");
125
                    serviceLogInfo(logMessages.getLastMessage());
126
 
127
                    int tries = 3;
128
                    ArrayOfAula arrayOfAulas = null;
129
                    while(tries > 0)
130
                    {
131
                    //comentario de teste
132
                        try
133
                        {
1048 jmachado 134
                            arrayOfAulas = service.getSiGesWEBSoap().getAulas(new 1.5.0/docs/api/java/math/BigDecimal.html">BigDecimal(DaoFactory.getConfigurationDaoImpl().getSigesInstitutionCode()), year,c.getCode(),semestre,c.getCourse().getCode());
995 jmachado 135
                            break;
136
                        }
137
                        catch(1.5.0/docs/api/java/lang/Throwable.html">Throwable t)
138
                        {
139
                            if(tries-- == 0)
140
                            {
141
                                logger.error("Giving up of courseUnit:" + cId + " ( " + c.getName() + " ) ",t);
142
                                serviceLogError("Giving up of courseUnit:" + cId + " ( " + c.getName() + " ) ",t);
143
                                break;
144
                            }
145
 
1144 jmachado 146
 
995 jmachado 147
                            logger.error("WebService Fail, trying " + tries + " times sleeping a while");
1144 jmachado 148
                            serviceLogError("WebService Fail, trying " + tries + " times sleeping a while " + t.toString());
149
                            serviceLogError("WebService Fail, trying " + tries + " times sleeping a while " + t.getCause());
995 jmachado 150
                            1.5.0/docs/api/java/lang/Thread.html">Thread.sleep(5000);
151
                        }
152
                    }
153
 
154
                    if(arrayOfAulas != null && arrayOfAulas.getAula() != null)
155
                    {
156
                        List<CourseUnitSummary> courseUnitSummaries = new ArrayList<CourseUnitSummary>();
157
 
158
                        //HashMap<String, CourseUnitSummary> map = new HashMap<String, CourseUnitSummary>();
159
                        /*if(c.getSummaries() != null && c.getSummaries().size() > 0)
160
                            for(CourseUnitSummary s: c.getSummaries())
161
                                map.put(s.getCodigoAula() + ":" + s.getCodigoSumario(),s);
162
                        else
163
                            c.setSummaries(new HashSet<CourseUnitSummary>());*/
164
                        JSONObject summariesJson = new JSONObject();
165
                        JSONArray summaries = new JSONArray();
166
                        summariesJson.put("summary",summaries);
1081 jmachado 167
                        int summariesValid = 0;
995 jmachado 168
                        for(Aula aula: arrayOfAulas.getAula())
169
                        {
170
 
1133 jmachado 171
                            if(c.getCdTurma() != null && aula.getAulaCodigoTurma()!=null
172
                                    && c.getCdTurma().trim().length() > 0
173
                                    && aula.getAulaCodigoTurma().trim().length() > 0
174
                                    && !aula.getAulaCodigoTurma().equals(c.getCdTurma()))
175
                            {
176
                                //Código de Turma diferente
177
                                1.5.0/docs/api/java/lang/System.html">System.out.println("Ignoring summary code: " + aula.getAulaCodigoTurma() + " for unit " + c.getName() + "/" + c.getCode() + " T:" + c.getCdTurma());
178
                                continue;
179
                            }
180
 
995 jmachado 181
                            //CourseUnitSummary s = map.get(aula.getSumNumeroAula() + ":" + aula.getCodigoSumario());
182
                            //if(s == null)
183
                            //{
184
                            CourseUnitSummaryImpl s = DomainObjectFactory.createCourseUnitSummaryImpl();
185
                            s.setCourseUnit(c);
186
                                //c.getSummaries().add(s);
187
                                //DaoFactory.getCourseUnitSummaryDaoImpl().save(s);
188
                            //summaries.add();
189
                            //}
190
                            s.setCodigoSumario(""+aula.getCodigoSumario().intValue());
191
                            s.setCodigoAula(""+aula.getSumNumeroAula().intValue());
192
                            s.setNumeroAula(aula.getSumNumeroAula().intValue());
193
                            s.setDataAula(aula.getData().toGregorianCalendar().getTime());
194
                            s.setTipoAula(aula.getSumTipoAula());
195
                            s.setCodigoSalaAula("" + aula.getAulaCodigoSalaAula().intValue());
196
                            s.setAlunosPresentes(aula.getSumNumeroAlunos().intValue());
197
                            s.setTitulo(aula.getSumTitulo());
198
                            s.setDescricao(aula.getSumDescricao());
199
                            s.setcEstado(""+aula.getSumCdEstado().intValue());
200
                            s.setNumeroHoras("" + aula.getNumeroCelulas().intValue());
201
                            summaries.put(s.getJson());
202
                            courseUnitSummaries.add(s);
1081 jmachado 203
                            if(s.getNumeroAula() > 0)
204
                                summariesValid++;
995 jmachado 205
                        }
206
                        if(courseUnitSummaries.size() == 0)
207
                        {
208
                            countUnitsZeroSummaries++;
209
                            unitsZeroSummaries.add(c.getCode());
1081 jmachado 210
                            logger.info("ZERO SUMARIES unit:" + c.getCode() + " course: " + c.getCourseCode());
211
                            serviceLogInfo("ZERO SUMARIES unit:" + c.getCode() + " course: " + c.getCourseCode());
995 jmachado 212
                        }
1081 jmachado 213
                        else if(summariesValid == 0)
214
                        {
1144 jmachado 215
                            //NAO METE OK NEM ZERO
1081 jmachado 216
                            countUnitsZeroValidSummaries++;
217
                            unitsZeroSummaries.add(c.getCode());
218
                            logger.info("ZERO VALID SUMARIES unit:" + c.getCode() + " course: " + c.getCourseCode());
219
                            serviceLogInfo("ZERO VALID SUMARIES unit:" + c.getCode() + " course: " + c.getCourseCode());
220
                        }
995 jmachado 221
                        else
222
                        {
223
                            countUnitsOk++;
224
                        }
225
                        c.setSummariesJson(summariesJson.toString());
226
 
227
                        if(sendIONLINE)
228
                        {
229
                            1.5.0/docs/api/java/lang/String.html">String path = generatePdf(c);
230
                            sendPdfFtpIonline(c,new ArrayList<String>(),null,path,null);
231
                            FilesUtils.delete(path);
232
                        }
233
                        if(sendEMAIL)
234
                        {
235
                            sendEmail(null, courseUnitSummaries,true);
236
                        }
237
                    }
238
                    else
239
                    {
1144 jmachado 240
                        //NAO METE OK MAS METE ZERO
995 jmachado 241
                        countUnitsZeroSummaries++;
242
                        unitsZeroSummaries.add(c.getCode());
243
                        logger.error("Summaries come null in unit:" + c.getCode());
244
                        serviceLogError("Summaries come null in unit:" + c.getCode());
245
                    }
246
                }
247
                catch(1.5.0/docs/api/java/lang/Throwable.html">Throwable e)
248
                {
1144 jmachado 249
                    //NAO METE OK
995 jmachado 250
                    unitsFailed.add(nowCode);
251
                    logger.error(e,e);
252
                    serviceLogError(e.toString(),e);
253
                }
254
            }
255
 
256
            setProgress(100);
257
            serviceLogError("Finish commiting");
258
 
259
        }
260
        catch (1.5.0/docs/api/java/lang/Throwable.html">Throwable e)
261
        {
262
            logger.error(e, e);
263
            logMessages.addMessage(new DefaultLogMessage("import.error", e.toString(), "see log for details", LogMessageTypeEnum.ERROR));
264
            serviceLogError(logMessages.getLastMessage(),e);
265
            throw new ServiceException(e.toString(), e);
266
        }
267
 
268
        logMessages.addMessage(new DefaultLogMessage("import.summaries.terminating", LogMessageTypeEnum.INFO));
269
        logger.info("terminating summaries import");
270
        serviceLogInfo(logMessages.getLastMessage());
271
 
1144 jmachado 272
        1.5.0/docs/api/java/lang/StringBuilder.html">StringBuilder failedUnitsExc = new 1.5.0/docs/api/java/lang/StringBuilder.html">StringBuilder();
273
        for(1.5.0/docs/api/java/lang/String.html">String cId: unitsFailed)
274
            failedUnitsExc.append(cId).append(";");
275
 
995 jmachado 276
        serviceLogInfo("#######################################");
277
        serviceLogInfo("#######################################");
278
        serviceLogInfo("UNITS PROCESSED: " + countUnits);
1144 jmachado 279
        serviceLogInfo("UNITS FAILED: " + (countUnits - countUnitsZeroSummaries - countUnitsOk - countUnitsZeroValidSummaries));
280
        serviceLogInfo("UNITS FAILED EXCEPTION PARSING XML WEB SERVICE: " + unitsFailed.size());
995 jmachado 281
        serviceLogInfo("UNITS IMPORT OK: " + countUnitsOk);
282
        serviceLogInfo("UNITS ZERO SUMARIES: " + countUnitsZeroSummaries);
1081 jmachado 283
        serviceLogInfo("UNITS ZERO VALID SUMARIES: " + countUnitsZeroValidSummaries);
995 jmachado 284
        serviceLogInfo("#######################################");
1144 jmachado 285
        serviceLogWarn("####FAILED Exception (Check exceptions in log): Units Baco Id Code : " + failedUnitsExc.toString());
1025 jmachado 286
 
287
        logger.info("#######################################");
288
        logger.info("#######################################");
289
        logger.info("UNITS PROCESSED: " + countUnits);
1144 jmachado 290
        logger.info("UNITS FAILED: " + (countUnits - countUnitsZeroSummaries - countUnitsOk - countUnitsZeroValidSummaries));
291
        logger.info("UNITS FAILED EXCEPTION PARSING XML WEB SERVICE: " + unitsFailed.size());
1025 jmachado 292
        logger.info("UNITS IMPORT OK: " + countUnitsOk);
293
        logger.info("UNITS ZERO SUMARIES: " + countUnitsZeroSummaries);
1081 jmachado 294
        logger.info("UNITS ZERO VALID SUMARIES: " + countUnitsZeroValidSummaries);
1025 jmachado 295
        logger.info("#######################################");
1144 jmachado 296
        logger.warn("####FAILED Exception (Check exceptions in log): Units Baco Id Code : " + failedUnitsExc.toString());
297
 
298
 
995 jmachado 299
        return logMessages;
300
    }
301
 
302
 
303
    public static SendEmailService sendEmailService = new SendEmailService();
304
 
305
    private void sendEmail(UserSession userSession,List<CourseUnitSummary> summaries,boolean sendEmail)
306
    {
307
        if(Globals.EMAIL_SUMMARIES && summaries.size() > 0 && sendEmail)
308
        {
309
           // for(CourseUnitSummary summary: summaries)
310
           // {
311
 
312
                List<String> emails = DaoFactory.getCourseUnitSummaryDaoImpl().getStudentsEmails(summaries.get(0).getId());
313
                if(emails == null)
314
                    logger.warn("No students emails in unit: code:" + summaries.get(0).getCourseUnit().getCode() + " " + summaries.get(0).getCourseUnit().getName());
315
                EMAILJob emailJob = new EMAILJob(sendEmailService.getSummariesEmail(emails, summaries, summaries.get(0).getCourseUnit(), LangEnum.PORTUGUESE));
316
                JobScheduleService.getInstance().scheduleNow(emailJob,"New Summary EMAIL from: " + summaries.get(0).getCourseUnit().getName() + " aula: " +summaries.get(summaries.size()-1).getNumeroAula() ,userSession);
317
           // }
318
        }
319
    }
320
 
321
 
322
 
323
 
324
 
325
 
326
    public static 1.5.0/docs/api/java/lang/String.html">String generatePdf(CourseUnit c) throws 1.5.0/docs/api/java/io/IOException.html">IOException, 1.5.0/docs/api/javax/xml/transform/TransformerException.html">TransformerException, FOPException {
327
        5+0%2Fdocs%2Fapi+Document">Document dom = new CreateCourseUnitXML().run(c,null);
328
        org.w3c.dom.5+0%2Fdocs%2Fapi+Document">Document dd = Dom4jUtil.toW3c(dom);
329
        1.5.0/docs/api/java/lang/String.html">String path = Globals.TMP_DIR + 1.5.0/docs/api/java/io/File.html">File.separator + c.getCode() + "-" + c.getNormalizedName() + "-sumarios.pdf";
330
        1.5.0/docs/api/java/io/FileOutputStream.html">FileOutputStream out = new 1.5.0/docs/api/java/io/FileOutputStream.html">FileOutputStream(path);
331
        Map<String,Object> params = new HashMap<String,Object>();
332
        params.put("site", Globals.SITE_URL);
333
        PdfUtils.createPdfFromXml(new 1.5.0/docs/api/javax/xml/transform/dom/DOMSource.html">DOMSource(dd), "pt/estgp/estgweb/services/courseunits/courseunitsummaries.fo.xsl", out, params);
334
        out.flush();
335
        out.close();
336
        return path;
337
    }
338
 
1006 jmachado 339
    private void sendPdfFtpIonline(CourseUnit cu, List<String> errors, UserSession u,1.5.0/docs/api/java/lang/String.html">String pdfPath,FTPClient client) throws 1.5.0/docs/api/java/io/IOException.html">IOException, 1.5.0/docs/api/javax/xml/transform/TransformerException.html">TransformerException, FOPException {
995 jmachado 340
 
341
        FtpServer server = null;
342
        if(client == null)
343
        {
344
            server = FtpServer.getNewServer(Globals.FTP_IONLINE_URL,Globals.FTP_IONLINE_USER,Globals.FTP_IONLINE_PASS);
345
            client = server.getClient();
1005 jmachado 346
            if(client == null)
347
            {
348
                logger.warn("###################");
1009 jmachado 349
                logger.warn("################### > CANT CONNECT FTP - could be FTPTimeout: " + Globals.FTP_TIMEOUT_SECONDS);
350
                errors.add("################### > CANT CONNECT FTP to send summaries " + ((CourseUnitImpl)cu).getSummariosPathIntranet());
1005 jmachado 351
                return;
352
            }
353
 
995 jmachado 354
        }
355
        client.setFileType(FTP.BINARY_FILE_TYPE);
356
 
357
 
358
        1.5.0/docs/api/java/lang/String.html">String pastaFichaCurricular = ((CourseUnitImpl)cu).getSummariosPathIntranet();
359
        if(!client.changeWorkingDirectory(pastaFichaCurricular))
360
        {
361
            logger.error("FTP CANT CHANGE TO PATH: " + pastaFichaCurricular);
362
        }
363
        else
364
        {
1009 jmachado 365
            if(!client.storeFile(((CourseUnitImpl)cu).getSummariosFileNameIntranet(),new 1.5.0/docs/api/java/io/FileInputStream.html">FileInputStream(pdfPath)))
366
            {
1010 jmachado 367
                1.5.0/docs/api/java/lang/String.html">String msgS = "CANT store file in given time, probably timeout at " + Globals.FTP_DATA_STORE_TIMEOUT_SECONDS;
368
                logger.error(msgS);
369
                serviceLogError(msgS);
1009 jmachado 370
            }
995 jmachado 371
            if(server != null)
372
            {
373
                client.quit();
374
                client.disconnect();
375
            }
376
        }
377
        //
378
    }
379
    /**
380
     * Testar por aqui poi requer Super Role e assim e' autmatico
381
     *
382
     *
383
     * @param args of main
384
     * @throws pt.estgp.estgweb.services.expceptions.ServiceException on error
385
     */
386
    public static void main(1.5.0/docs/api/java/lang/String.html">String[] args) throws ServiceException, JSONException {
387
 
997 jmachado 388
        1.5.0/docs/api/java/lang/System.html">System.out.println("Syntax:");
389
        1.5.0/docs/api/java/lang/System.html">System.out.println("year, semestre, sendIonline, sendEmail");
390
        1.5.0/docs/api/java/lang/System.html">System.out.println("If no arguments wil user actual year import config in all semestres and true in email and ionline");
391
 
995 jmachado 392
        1.5.0/docs/api/java/lang/String.html">String year = DaoFactory.getConfigurationDaoImpl().getImportsDefaultImportYearCreateTransaction();
393
        1.5.0/docs/api/java/lang/String.html">String semestre = null;
1133 jmachado 394
        boolean sendIonline = false;
395
        boolean sendEmail = false;
995 jmachado 396
        if(args != null && args.length > 0)
397
            year = args[0];
997 jmachado 398
 
995 jmachado 399
        if(args != null && args.length > 1)
400
            semestre = args[1];
997 jmachado 401
 
995 jmachado 402
        if(args != null && args.length > 2)
403
            sendIonline = 1.5.0/docs/api/java/lang/Boolean.html">Boolean.parseBoolean(args[2]);
997 jmachado 404
 
995 jmachado 405
        if(args != null && args.length > 3)
406
            sendEmail = 1.5.0/docs/api/java/lang/Boolean.html">Boolean.parseBoolean(args[3]);
997 jmachado 407
 
995 jmachado 408
        AbstractDao.getCurrentSession().beginTransaction();
409
        if(semestre != null)
410
            new ImportSumariesJson().run(year,semestre,sendIonline,sendEmail);
411
        else
412
        {
413
            new ImportSumariesJson().run(year,"S1",sendIonline,sendEmail);
414
            new ImportSumariesJson().run(year,"S2",sendIonline,sendEmail);
415
            new ImportSumariesJson().run(year,"A",sendIonline,sendEmail);
416
        }
417
        AbstractDao.getCurrentSession().getTransaction().commit();
418
    }
419
 
420
 
421
    @1.5.0/docs/api/java/lang/Override.html">Override
1070 jmachado 422
    protected ILogMessages runJobServiceTask() throws 1.5.0/docs/api/java/lang/Throwable.html">Throwable {
995 jmachado 423
 
1070 jmachado 424
        1.5.0/docs/api/java/lang/String.html">String importYear =  getParametersMap().get(JOB_importYear_KEY).getObject();
425
        1.5.0/docs/api/java/lang/String.html">String semestre =  getParametersMap().get(JOB_semestre_KEY).getObject();
426
        1.5.0/docs/api/java/lang/String.html">String sendIonlineStr = getParametersMap().get(JOB_sendIonline_KEY).getObject();
427
        1.5.0/docs/api/java/lang/String.html">String sendEmailStr =  getParametersMap().get(JOB_sendEmail_KEY).getObject();
428
        boolean sendIonline = sendIonlineStr != null && 1.5.0/docs/api/java/lang/Boolean.html">Boolean.parseBoolean(sendIonlineStr);
429
        boolean sendEmail = sendEmailStr != null && 1.5.0/docs/api/java/lang/Boolean.html">Boolean.parseBoolean(sendEmailStr);
430
        return run(importYear,semestre,sendIonline,sendEmail);
995 jmachado 431
    }
432
 
433
}