diff --git a/jasper/VIArch_attivazione.jrxml b/jasper/VIArch_attivazione.jrxml new file mode 100644 index 00000000..91ab7704 --- /dev/null +++ b/jasper/VIArch_attivazione.jrxml @@ -0,0 +1,463 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jasper/VIArch_conclusione.jrxml b/jasper/VIArch_conclusione.jrxml new file mode 100644 index 00000000..c7ed288c --- /dev/null +++ b/jasper/VIArch_conclusione.jrxml @@ -0,0 +1,463 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/AvvisoUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/AvvisoUtil.java index ec005abc..06017fde 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/AvvisoUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/AvvisoUtil.java @@ -151,6 +151,28 @@ public class AvvisoUtil { return allTipoDocumentoFileTemplateProps; } + public static String getFileTemplateProp(String statoPratica, String tipoProcedura) { + String label = statoPratica; + switch (tipoProcedura) { + // VIArch + case Constants.PROCEDURA_P3: + switch (statoPratica) { + case StatoPraticaConstants.AUTORIZZATA: + case StatoPraticaConstants.CONFORME: + label = "VIARCH2"; + break; + case StatoPraticaConstants.INTEGRAZIONE: + label = "VIARCH1"; + break; + } + } + switch (statoPratica) { + case StatoPraticaConstants.VIDIMATA: + label = "DP" + tipoProcedura; + } + return allTipoDocumentoFileTemplateProps.get(label); + } + public static Collection getUniqueTipoDocumentoFileTemplateProps() { Collection result = new HashSet<>(); for (String value : allTipoDocumentoFileTemplateProps.values()) { diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/content/Language.properties b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/content/Language.properties index 6817a527..dbab78b8 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/content/Language.properties +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/content/Language.properties @@ -154,6 +154,7 @@ conf.geniocivile.avviso.folder.id.manuale = Cartella Avvisi Manuali conf.geniocivile.avviso.folder.id.doc_annullamento = Cartella File Annullamento Fascicolo conf.geniocivile.avviso.folder.id.doc_pagamento = Cartella File Allegati MDB conf.geniocivile.avviso.folder.id.domanda_pdf = Cartella Template Domanda +conf.geniocivile.avviso.folder.id.viarch = Cartella Avvisi VIArch #Configurazione Templates conf.geniocivile.template.folder.id = Cartella Template diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/AvvisoImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/AvvisoImpl.java index aeee0166..947f4904 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/AvvisoImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/AvvisoImpl.java @@ -1,13 +1,13 @@ /** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * GNU Lesser General Public License as published by the Free Software Foundation; either version - * 2.1 of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. */ package it.tref.liferay.portos.bo.model.impl; @@ -36,71 +36,69 @@ import com.liferay.portlet.documentlibrary.service.DLAppLocalServiceUtil; import com.liferay.portlet.documentlibrary.util.DLUtil; /** - * The extended model implementation for the Avviso service. Represents a row in - * the "portos_bo_Avviso" database table, with each column mapped to a - * property of this class. + * The extended model implementation for the Avviso service. Represents a row in the "portos_bo_Avviso" + * database table, with each column mapped to a property of this class. * *

- * Helper methods and all application logic should be put in this class. - * Whenever methods are added, rerun ServiceBuilder to copy their definitions - * into the {@link it.tref.liferay.portos.bo.model.Avviso} interface. + * Helper methods and all application logic should be put in this class. Whenever methods are added, rerun + * ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.bo.model.Avviso} interface. *

* * @author Davide Barbagallo, 3F Consulting */ public class AvvisoImpl extends AvvisoBaseImpl { /** - * + * */ private static final long serialVersionUID = -2350602144741897095L; /* - * NOTE FOR DEVELOPERS: Never reference this class directly. All methods - * that expect a avviso model instance should use the {@link - * it.tref.liferay.portos.bo.model.Avviso} interface instead. + * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a avviso model instance should + * use the {@link it.tref.liferay.portos.bo.model.Avviso} interface instead. */ public AvvisoImpl() { } + @Override public String getFullDescription() throws PortalException, SystemException { - String tipoDocumento = AvvisoUtil.getAllTipoDocumento().containsKey(this.getTipoDocumento()) ? AvvisoUtil - .getAllTipoDocumento().get(this.getTipoDocumento()) - : "label.admingeniocivile.avviso.tipoDocumento.avvisomanuale"; - - String fullDescription = LanguageUtil.get(LocaleUtil.ITALIAN, tipoDocumento); + String fullDescription; + if (Validator.isNull(this.getDescLong())) { + String tipoDocumento = AvvisoUtil.getAllTipoDocumento().containsKey(this.getTipoDocumento()) ? AvvisoUtil + .getAllTipoDocumento().get(this.getTipoDocumento()) + : "label.admingeniocivile.avviso.tipoDocumento.avvisomanuale"; + fullDescription = LanguageUtil.get(LocaleUtil.ITALIAN, tipoDocumento); + } else { + fullDescription = this.getDescLong(); + } if (this.getTipoDocumento().equalsIgnoreCase(StatoPraticaConstants.VIDIMATA)) { if (this.getClassName().equals(DettPratica.class.getName())) { DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(this.getClassPk()); - if (TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equalsIgnoreCase(dettPratica - .getTipoIntegrazione())) { - fullDescription += " di " - + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-12") + ""; + if (TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equalsIgnoreCase(dettPratica.getTipoIntegrazione())) { + fullDescription += " di " + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-12") + + ""; } else if (TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE.equalsIgnoreCase(dettPratica .getTipoIntegrazione())) { - fullDescription += " di " - + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-05") + " n° " - + dettPratica.getIntegrazione() + ""; + fullDescription += " di " + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-05") + + " n° " + dettPratica.getIntegrazione() + ""; } else if (TipoIntegrazioneUtil.VARIANTE.equalsIgnoreCase(dettPratica.getTipoIntegrazione())) { - fullDescription += " di " - + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-13") + " n° " - + dettPratica.getVarianteNumero() + ""; + fullDescription += " di " + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-13") + + " n° " + dettPratica.getVarianteNumero() + ""; } } else if (this.getClassName().equals(FineLavori.class.getName())) { FineLavori fineLavori = FineLavoriLocalServiceUtil.getFineLavori(this.getClassPk()); fullDescription += " di " - + LanguageUtil.get(LocaleUtil.ITALIAN, - "label-integrazione-" + (fineLavori.getParziale() ? "09" : "07")) + " n° " - + fineLavori.getNumero() + ""; + + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-" + + (fineLavori.getParziale() ? "09" : "07")) + " n° " + fineLavori.getNumero() + + ""; } else if (this.getClassName().equals(Collaudo.class.getName())) { Collaudo collaudo = CollaudoLocalServiceUtil.getCollaudo(this.getClassPk()); fullDescription += " di " - + LanguageUtil.get(LocaleUtil.ITALIAN, - "label-integrazione-" + (collaudo.getParziale() ? "10" : "08")) + " n° " - + collaudo.getNumero() + ""; + + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-" + + (collaudo.getParziale() ? "10" : "08")) + " n° " + collaudo.getNumero() + ""; } } else if (this.getTipoDocumento().equalsIgnoreCase(StatoPraticaConstants.CONFORME)) { @@ -122,6 +120,7 @@ public class AvvisoImpl extends AvvisoBaseImpl { return fullDescription; } + @Override public String getDescriptionOggettoProtocollo() throws PortalException, SystemException { String tipoDocumento = AvvisoUtil.getAllTipoDocumento().containsKey(this.getTipoDocumento()) ? AvvisoUtil @@ -134,10 +133,8 @@ public class AvvisoImpl extends AvvisoBaseImpl { if (this.getClassName().equals(DettPratica.class.getName())) { DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(this.getClassPk()); - if (TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equalsIgnoreCase(dettPratica - .getTipoIntegrazione())) { - fullDescription += " di " + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-12") - + ""; + if (TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equalsIgnoreCase(dettPratica.getTipoIntegrazione())) { + fullDescription += " di " + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-12") + ""; } else if (TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE.equalsIgnoreCase(dettPratica .getTipoIntegrazione())) { fullDescription += " di " + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-05"); @@ -147,14 +144,14 @@ public class AvvisoImpl extends AvvisoBaseImpl { } else if (this.getClassName().equals(FineLavori.class.getName())) { FineLavori fineLavori = FineLavoriLocalServiceUtil.getFineLavori(this.getClassPk()); fullDescription += " di " - + LanguageUtil.get(LocaleUtil.ITALIAN, - "label-integrazione-" + (fineLavori.getParziale() ? "09" : "07")); + + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-" + + (fineLavori.getParziale() ? "09" : "07")); } else if (this.getClassName().equals(Collaudo.class.getName())) { Collaudo collaudo = CollaudoLocalServiceUtil.getCollaudo(this.getClassPk()); fullDescription += " di " - + LanguageUtil.get(LocaleUtil.ITALIAN, - "label-integrazione-" + (collaudo.getParziale() ? "10" : "08")); + + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-" + + (collaudo.getParziale() ? "10" : "08")); } } else if (this.getTipoDocumento().equalsIgnoreCase(StatoPraticaConstants.CONFORME)) { @@ -176,18 +173,19 @@ public class AvvisoImpl extends AvvisoBaseImpl { return fullDescription.replace("Avviso di ", ""); } + @Override public String getDownloadUrl(ThemeDisplay themeDisplay) throws PortalException, SystemException { if (Validator.isNotNull(getFileEntryIdInvio())) { FileEntry fileEntry = DLAppLocalServiceUtil.getFileEntry(getFileEntryIdInvio()); - return DLUtil - .getPreviewURL(fileEntry, fileEntry.getFileVersion(), themeDisplay, "&download=true"); + return DLUtil.getPreviewURL(fileEntry, fileEntry.getFileVersion(), themeDisplay, "&download=true"); } return null; } + @Override public String translateTipoDocumento() throws PortalException, SystemException { String tipoDocumento = AvvisoUtil.getAllTipoDocumento().containsKey(this.getTipoDocumento()) ? AvvisoUtil diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/scheduler/SchedulerGeneraDocumento.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/scheduler/SchedulerGeneraDocumento.java index f884a7fa..f9ecf376 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/scheduler/SchedulerGeneraDocumento.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/scheduler/SchedulerGeneraDocumento.java @@ -49,6 +49,7 @@ public class SchedulerGeneraDocumento implements MessageListener { private static final int SIZE = 10; + @Override public void receive(Message message) throws MessageListenerException { if (lock.tryLock()) { @@ -56,10 +57,10 @@ public class SchedulerGeneraDocumento implements MessageListener { try { // campo abilitazione scheduler for (Company company : CompanyLocalServiceUtil.getCompanies()) { - String condition = ConfigurazioneLocalServiceUtil.findByC_ChiaveString( - company.getCompanyId(), ConfigurazioneConstants.SCHEDULER_GENERA_DOCUMENTO); - _log.debug("SchedulerGeneraDocumento - per company " + company.getCompanyId() - + " attivo? " + condition); + String condition = ConfigurazioneLocalServiceUtil.findByC_ChiaveString(company.getCompanyId(), + ConfigurazioneConstants.SCHEDULER_GENERA_DOCUMENTO); + _log.debug("SchedulerGeneraDocumento - per company " + company.getCompanyId() + " attivo? " + + condition); if (Boolean.parseBoolean(condition)) { int count = AvvisoLocalServiceUtil.countAvvisiGenerazioneDocumento(); @@ -68,8 +69,8 @@ public class SchedulerGeneraDocumento implements MessageListener { for (int cursor = 0; cursor <= count; cursor += SIZE) { - List avvisi = AvvisoLocalServiceUtil.getAvvisiGenerazioneDocumento( - cursor, cursor + SIZE); + List avvisi = AvvisoLocalServiceUtil.getAvvisiGenerazioneDocumento(cursor, + cursor + SIZE); for (Avviso avviso : avvisi) { _log.debug("SchedulerGeneraDocumento - avviso " + avviso.getAvvisoId()); @@ -82,8 +83,7 @@ public class SchedulerGeneraDocumento implements MessageListener { // bloccato, non esiste file di // template _log.debug("SchedulerGeneraDocumento - non esiste file template"); - AvvisoLocalServiceUtil.updateAvvisoErrore(avviso.getAvvisoId(), - true); + AvvisoLocalServiceUtil.updateAvvisoErrore(avviso.getAvvisoId(), true); } if (fileEntryTemplate != null && avviso.getOldFileEntryIdBase() == 0L) { _log.debug("SchedulerGeneraDocumento - inizio genera documento"); @@ -124,9 +124,10 @@ public class SchedulerGeneraDocumento implements MessageListener { long folderId = ConfigurazioneLocalServiceUtil.findByC_ChiaveLong(companyId, AvvisoUtil .getAllTipoDocumentoFolderProps().get(avviso.getTipoDocumento())); - - String fileName = AvvisoLocalServiceUtil.getFileNameAvviso(avviso.getClassPk(), - avviso.getTipoDocumento(), avviso.getAvvisoId(), "B"); + _log.info("tipoDocumento = " + avviso.getTipoDocumento() + ", prop = " + + AvvisoUtil.getAllTipoDocumentoFolderProps().get(avviso.getTipoDocumento())); + String fileName = AvvisoLocalServiceUtil.getFileNameAvviso(avviso.getClassPk(), avviso.getTipoDocumento(), + avviso.getAvvisoId(), "B"); Map parameters = new HashMap(); if (Validator.isNotNull(avviso.getJsonParameters())) { @@ -141,8 +142,7 @@ public class SchedulerGeneraDocumento implements MessageListener { if (intPratica != null && Validator.isNotNull(intPratica.getStatusByUserId())) { User tecnico = UserLocalServiceUtil.fetchUserById(intPratica.getStatusByUserId()); if (tecnico != null) { - parameters.put(WorkflowConstants.WORKFLOW_PARAM_NAME_TECNICO, - tecnico.getFullName()); + parameters.put(WorkflowConstants.WORKFLOW_PARAM_NAME_TECNICO, tecnico.getFullName()); parameters.put("delegato", tecnico.getFullName()); } } @@ -150,25 +150,11 @@ public class SchedulerGeneraDocumento implements MessageListener { } bean = ReportAvvisoBeanBuilder.build(avviso, parameters); - parameters.put(ReportConstants.LOGO_REGIONE, - getClass().getResource(ReportConstants.PATH_LOGO_REGIONE).getPath()); + parameters.put(ReportConstants.LOGO_REGIONE, getClass().getResource(ReportConstants.PATH_LOGO_REGIONE) + .getPath()); parameters.put(ReportConstants.LOGO_DIPARTIMENTO, getClass().getResource(ReportConstants.PATH_LOGO_DIPARTIMENTO).getPath()); - // avviso = gestioneProtocollazione(avviso, dettPratica); - - /* - * Message messageReport = new Message(); - * messageReport.put(ReportConstants.FILE_ENTRY_ID_TEMPLATE, - * fileEntryIdTemplate); - * messageReport.put(ReportConstants.FOLDER_ID_REPORT, folderId); - * messageReport.put(ReportConstants.REPORT_NAME, fileName); - * messageReport.put(ReportConstants.SERVICE_CONTEXT, - * serviceContext); - * messageReport.put(ReportConstants.REPORT_PARAMETERS, parameters); - * messageReport.put(ReportConstants.REPORT_DATASOURCE, bean); - */ - ReportDto reportDto = new ReportDto(); reportDto.setFileEntryIds(new long[] { fileEntryIdTemplate }); reportDto.setFolderId(folderId); @@ -181,9 +167,6 @@ public class SchedulerGeneraDocumento implements MessageListener { _log.info("generaDocumento: generateReport: " + fileEntryIdTemplate); ReportResultDto result = ReportUtil.generateReport(companyId, userId, reportDto, bean); idFileEntry = result.getFileEntryIds()[0]; - // idFileEntry = (Long) - // MessageBusUtil.sendSynchronousMessage(ReportDestinationNames.SYNC, - // messageReport, 1); if (Validator.isNotNull(idFileEntry)) { if (avviso.getTipoAvviso().equalsIgnoreCase(AvvisoUtil.TIPO_AVVISO_DIRETTO)) { diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AllegatoManualeLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AllegatoManualeLocalServiceImpl.java index 59f39fb9..7241222f 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AllegatoManualeLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AllegatoManualeLocalServiceImpl.java @@ -1,13 +1,13 @@ /** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * GNU Lesser General Public License as published by the Free Software Foundation; either version - * 2.1 of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. */ package it.tref.liferay.portos.bo.service.impl; @@ -43,15 +43,12 @@ import com.liferay.portlet.documentlibrary.NoSuchFolderException; * The implementation of the allegato manuale local service. * *

- * All custom service methods should be put in this class. Whenever methods are - * added, rerun ServiceBuilder to copy their definitions into the - * {@link it.tref.liferay.portos.bo.service.AllegatoManualeLocalService} - * interface. + * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy + * their definitions into the {@link it.tref.liferay.portos.bo.service.AllegatoManualeLocalService} interface. * *

- * This is a local service. Methods of this service will not have security - * checks based on the propagated JAAS credentials because this service can only - * be accessed from within the same VM. + * This is a local service. Methods of this service will not have security checks based on the propagated JAAS + * credentials because this service can only be accessed from within the same VM. *

* * @author Davide Barbagallo, 3F Consulting @@ -61,41 +58,47 @@ import com.liferay.portlet.documentlibrary.NoSuchFolderException; public class AllegatoManualeLocalServiceImpl extends AllegatoManualeLocalServiceBaseImpl { /* * NOTE FOR DEVELOPERS: - * + * * Never reference this interface directly. Always use {@link - * it.tref.liferay.portos.bo.service.AllegatoManualeLocalServiceUtil} to - * access the allegato manuale local service. + * it.tref.liferay.portos.bo.service.AllegatoManualeLocalServiceUtil} to access the allegato manuale local service. */ + @Override public List findByIntPratica(long intPraticaId) throws SystemException { return allegatoManualePersistence.findByIntPratica(intPraticaId); } + @Override public List findByIntPratica(long intPraticaId, int start, int end, OrderByComparator orderByComparator) throws SystemException { return allegatoManualePersistence.findByIntPratica(intPraticaId, start, end, orderByComparator); } + @Override public int countByIntPratica(long intPraticaId) throws SystemException { return allegatoManualePersistence.countByIntPratica(intPraticaId); } + @Override public List findByDettPratica(long dettPraticaId) throws SystemException { return allegatoManualePersistence.findByIntPratica(dettPraticaId); } + @Override public List findByDettPratica(long dettPraticaId, int start, int end, OrderByComparator orderByComparator) throws SystemException { return allegatoManualePersistence.findByIntPratica(dettPraticaId, start, end, orderByComparator); } + @Override public int countByDettPratica(long dettPraticaId) throws SystemException { return allegatoManualePersistence.countByIntPratica(dettPraticaId); } - public AllegatoManuale addAllegatoManuale(long userId, long intPraticaId, long dettPraticaId, - String descrizione, byte[] content, String sourceFileName, ServiceContext serviceContext) - throws SystemException, PortalException { + @Override + public AllegatoManuale addAllegatoManuale(long userId, long intPraticaId, long dettPraticaId, String descrizione, + byte[] content, String sourceFileName, ServiceContext serviceContext) throws SystemException, + PortalException { AllegatoManuale allegatoManuale = allegatoManualePersistence.create(counterLocalService .increment(AllegatoManuale.class.getName())); @@ -126,8 +129,8 @@ public class AllegatoManualeLocalServiceImpl extends AllegatoManualeLocalService String folderName = PraticaUtil.getFolderName(dettPratica.getDettPraticaId()); Folder folder = null; try { - folder = dlAppLocalService.getFolder(defaultFolder.getRepositoryId(), - defaultFolder.getFolderId(), folderName); + folder = dlAppLocalService.getFolder(defaultFolder.getRepositoryId(), defaultFolder.getFolderId(), + folderName); } catch (NoSuchFolderException e) { // cartella non presente -> creo cartella folder = dlAppLocalService.addFolder(serviceContext.getUserId(), defaultFolder.getRepositoryId(), @@ -139,9 +142,9 @@ public class AllegatoManualeLocalServiceImpl extends AllegatoManualeLocalService String mimeType = MimeTypesUtil.getContentType(sourceFileName); String changeLog = StringPool.BLANK; - FileEntry fileEntry = dlAppLocalService.addFileEntry(serviceContext.getUserId(), - folder.getRepositoryId(), folder.getFolderId(), now.getTime() + "_" + sourceFileName, - mimeType, title, description, changeLog, content, serviceContext); + FileEntry fileEntry = dlAppLocalService.addFileEntry(serviceContext.getUserId(), folder.getRepositoryId(), + folder.getFolderId(), now.getTime() + "_" + sourceFileName, mimeType, title, description, changeLog, + content, serviceContext); fileEntryId = fileEntry.getFileEntryId(); allegatoManuale.setFileEntryId(fileEntryId); @@ -157,7 +160,7 @@ public class AllegatoManualeLocalServiceImpl extends AllegatoManualeLocalService } Avviso avviso = avvisoLocalService.addAvviso(intPratica.getIntPraticaId(), descrizione, now, AvvisoUtil.TIPO_AVVISO_FIRMA, StatoPraticaConstants.INVIO_AVVISO_MANUALE, 0l, dettPraticaId, - DettPratica.class.getName(), codiceFiscalePrimaFirma, fileEntryId, 0l, StringPool.BLANK, 0l, + DettPratica.class.getName(), codiceFiscalePrimaFirma, fileEntryId, 0L, StringPool.BLANK, 0L, serviceContextAvvisi); allegatoManuale.setAvvisoId(avviso.getAvvisoId()); @@ -168,24 +171,11 @@ public class AllegatoManualeLocalServiceImpl extends AllegatoManualeLocalService @Override public AllegatoManuale deleteAllegatoManuale(AllegatoManuale allegatoManuale) throws SystemException { - // Se si cancella il fileEntryid da qui, va tolto anche nell'avviso - - // try { - // if (Validator.isNotNull(allegatoManuale.getFileEntryId())) { - // dlAppLocalService.deleteFileEntry(allegatoManuale.getFileEntryId()); - // } - // } catch (NoSuchFileEntryException | NoSuchRepositoryEntryException e) - // { - // - // } catch (PortalException e) { - // throw new SystemException(e); - // } return super.deleteAllegatoManuale(allegatoManuale); } @Override - public AllegatoManuale deleteAllegatoManuale(long allegatoManuale) throws PortalException, - SystemException { - return this.deleteAllegatoManuale(allegatoManualeLocalService.getAllegatoManuale(allegatoManuale)); + public AllegatoManuale deleteAllegatoManuale(long allegatoManualeId) throws PortalException, SystemException { + return this.deleteAllegatoManuale(allegatoManualeLocalService.getAllegatoManuale(allegatoManualeId)); } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AvvisoLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AvvisoLocalServiceImpl.java index c1244afa..c80680ef 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AvvisoLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AvvisoLocalServiceImpl.java @@ -1,13 +1,13 @@ /** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * GNU Lesser General Public License as published by the Free Software Foundation; either version - * 2.1 of the License, or (at your option) any later version. + * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. */ package it.tref.liferay.portos.bo.service.impl; @@ -70,14 +70,12 @@ import com.liferay.util.dao.orm.CustomSQLUtil; * The implementation of the avviso local service. * *

- * All custom service methods should be put in this class. Whenever methods are - * added, rerun ServiceBuilder to copy their definitions into the - * {@link it.tref.liferay.portos.bo.service.AvvisoLocalService} interface. + * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy + * their definitions into the {@link it.tref.liferay.portos.bo.service.AvvisoLocalService} interface. * *

- * This is a local service. Methods of this service will not have security - * checks based on the propagated JAAS credentials because this service can only - * be accessed from within the same VM. + * This is a local service. Methods of this service will not have security checks based on the propagated JAAS + * credentials because this service can only be accessed from within the same VM. *

* * @author Davide Barbagallo, 3F Consulting @@ -86,13 +84,13 @@ import com.liferay.util.dao.orm.CustomSQLUtil; */ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { /* - * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use - * {@link it.tref.liferay.portos.bo.service.AvvisoLocalServiceUtil} to - * access the avviso local service. + * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link + * it.tref.liferay.portos.bo.service.AvvisoLocalServiceUtil} to access the avviso local service. */ private static final Log _log = LogFactoryUtil.getLog(AvvisoLocalServiceImpl.class.getName()); + @Override public Avviso createStandardAvvisoPratica(IntPratica intPratica, long classPk, String className, ServiceContext serviceContext, String tipoAvviso, String userCodiceFiscalePrimaFirma, long controlloPraticaId) throws SystemException, PortalException { @@ -101,6 +99,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { userCodiceFiscalePrimaFirma, StringPool.BLANK, controlloPraticaId); } + @Override public Avviso createStandardAvvisoPratica(IntPratica intPratica, long classPk, String className, ServiceContext serviceContext, String tipoAvviso, String userCodiceFiscalePrimaFirma, String jsonParameters, long controlloPraticaId) throws SystemException, PortalException { @@ -116,95 +115,81 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { } } - String propertiesTemplate = null; String tipoProcedura = intPratica.getTipoProcedura(); - switch (statoPratica) { - case StatoPraticaConstants.VIDIMATA: - propertiesTemplate = AvvisoUtil.getAllTipoDocumentoFileTemplateProps().get( - "DP" + tipoProcedura); - break; - default: - propertiesTemplate = AvvisoUtil.getAllTipoDocumentoFileTemplateProps().get(statoPratica); - } - long fileEntryIdTemplate = configurazioneLocalService.findByC_ChiaveLong( - serviceContext.getCompanyId(), propertiesTemplate); - - _log.info("statoPratica=" + statoPratica + ", tipoProcedura=" + tipoProcedura - + ", propertiesTemplate=" + propertiesTemplate + ", fileEntryIdTemplate=" - + fileEntryIdTemplate); - + String propertiesTemplate = AvvisoUtil.getFileTemplateProp(statoPratica, tipoProcedura); + long fileEntryIdTemplate = configurazioneLocalService.findByC_ChiaveLong(serviceContext.getCompanyId(), + propertiesTemplate); if (fileEntryIdTemplate != 0) { - return addAvviso(intPratica.getIntPraticaId(), StringPool.BLANK, new Date(), tipoAvviso, - statoPratica, fileEntryIdTemplate, classPk, className, userCodiceFiscalePrimaFirma, - jsonParameters, controlloPraticaId, serviceContext); + return addAvviso(intPratica.getIntPraticaId(), StringPool.BLANK, new Date(), tipoAvviso, statoPratica, + fileEntryIdTemplate, classPk, className, userCodiceFiscalePrimaFirma, jsonParameters, + controlloPraticaId, serviceContext); } } return null; } - public Avviso createStandardAvvisoPratica(long intPraticaId, String stato, String jsonParameters, - long classPk, String className, ServiceContext serviceContext, String tipoAvviso, - String userCodiceFiscalePrimaFirma, long controlloPraticaId) throws SystemException, - PortalException { + @Override + public Avviso createStandardAvvisoPratica(long intPraticaId, String stato, String jsonParameters, long classPk, + String className, ServiceContext serviceContext, String tipoAvviso, String userCodiceFiscalePrimaFirma, + long controlloPraticaId) throws SystemException, PortalException { IntPratica intPratica = intPraticaLocalService.getIntPratica(intPraticaId); - boolean varianteNonSostanziale = false; if (className.equals(DettPratica.class.getName())) { DettPratica dettPratica = dettPraticaLocalService.getDettPratica(classPk); varianteNonSostanziale = dettPratica.getTipoIntegrazione().equals(TipoIntegrazioneUtil.VARIANTE) && !dettPratica.getVarianteSostanziale(); } - String statoPraticaCode = varianteNonSostanziale ? "DPVNS" : PraticaUtil.getStatoPraticaCode(stato, - intPratica); - String propertiesTemplate = AvvisoUtil.getAllTipoDocumentoFileTemplateProps().get(statoPraticaCode); - - long fileEntryIdTemplate = configurazioneLocalService.findByC_ChiaveLong( - serviceContext.getCompanyId(), propertiesTemplate); - - _log.info("debugAvviso: " + propertiesTemplate + " (" + statoPraticaCode + ")" - + (varianteNonSostanziale ? " non sostanziale" : "")); - return addAvviso(intPraticaId, StringPool.BLANK, new Date(), tipoAvviso, stato, fileEntryIdTemplate, - classPk, className, userCodiceFiscalePrimaFirma, jsonParameters, controlloPraticaId, - serviceContext); + String statoPraticaCode = varianteNonSostanziale ? "DPVNS" : PraticaUtil.getStatoPraticaCode(stato, intPratica); + String propertiesTemplate = AvvisoUtil.getFileTemplateProp(statoPraticaCode, intPratica.getTipoProcedura()); + long fileEntryIdTemplate = configurazioneLocalService.findByC_ChiaveLong(serviceContext.getCompanyId(), + propertiesTemplate); + _log.info("statoPraticaCode=" + statoPraticaCode + ", tipoProcedura=" + intPratica.getTipoProcedura() + + ", propertiesTemplate=" + propertiesTemplate + ", fileEntryIdTemplate=" + fileEntryIdTemplate); + return addAvviso(intPraticaId, StringPool.BLANK, new Date(), tipoAvviso, stato, fileEntryIdTemplate, classPk, + className, userCodiceFiscalePrimaFirma, jsonParameters, controlloPraticaId, serviceContext); } - public Avviso createStandardAvvisoPratica(long intPraticaId, String stato, long classPk, - String className, ServiceContext serviceContext, String tipoAvviso, - String userCodiceFiscalePrimaFirma, long controlloPraticaId) throws SystemException, - PortalException { + @Override + public Avviso createStandardAvvisoPratica(long intPraticaId, String stato, long classPk, String className, + ServiceContext serviceContext, String tipoAvviso, String userCodiceFiscalePrimaFirma, + long controlloPraticaId) throws SystemException, PortalException { - return createStandardAvvisoPratica(intPraticaId, stato, null, classPk, className, serviceContext, - tipoAvviso, userCodiceFiscalePrimaFirma, controlloPraticaId); + return createStandardAvvisoPratica(intPraticaId, stato, null, classPk, className, serviceContext, tipoAvviso, + userCodiceFiscalePrimaFirma, controlloPraticaId); } - public Avviso addAvviso(long intPraticaId, String descLong, Date dtAvviso, String tipoAvviso, - String tipoDocumento, long fileEntryIdTemplate, long classPk, String className, - long controlloPraticaId, ServiceContext serviceContext) throws SystemException, PortalException { + @Override + public Avviso addAvviso(long intPraticaId, String descLong, Date dtAvviso, String tipoAvviso, String tipoDocumento, + long fileEntryIdTemplate, long classPk, String className, long controlloPraticaId, + ServiceContext serviceContext) throws SystemException, PortalException { - return addAvviso(intPraticaId, descLong, dtAvviso, tipoAvviso, tipoDocumento, fileEntryIdTemplate, - classPk, className, StringPool.BLANK, StringPool.BLANK, controlloPraticaId, serviceContext); + return addAvviso(intPraticaId, descLong, dtAvviso, tipoAvviso, tipoDocumento, fileEntryIdTemplate, classPk, + className, StringPool.BLANK, StringPool.BLANK, controlloPraticaId, serviceContext); } - public Avviso addAvviso(long intPraticaId, String descLong, Date dtAvviso, String tipoAvviso, - String tipoDocumento, long fileEntryIdTemplate, long classPk, String className, - String userCodiceFiscalePrimaFirma, String jsonParameters, long controlloPraticaId, - ServiceContext serviceContext) throws SystemException, PortalException { + @Override + public Avviso addAvviso(long intPraticaId, String descLong, Date dtAvviso, String tipoAvviso, String tipoDocumento, + long fileEntryIdTemplate, long classPk, String className, String userCodiceFiscalePrimaFirma, + String jsonParameters, long controlloPraticaId, ServiceContext serviceContext) throws SystemException, + PortalException { - return addAvviso(intPraticaId, descLong, dtAvviso, tipoAvviso, tipoDocumento, fileEntryIdTemplate, - classPk, className, userCodiceFiscalePrimaFirma, null, 0L, jsonParameters, - controlloPraticaId, serviceContext); + return addAvviso(intPraticaId, descLong, dtAvviso, tipoAvviso, tipoDocumento, fileEntryIdTemplate, classPk, + className, userCodiceFiscalePrimaFirma, null, 0L, jsonParameters, controlloPraticaId, serviceContext); } - public Avviso addAvviso(long intPraticaId, String descLong, Date dtAvviso, String tipoAvviso, - String tipoDocumento, long fileEntryIdTemplate, long classPk, String className, - String userCodiceFiscalePrimaFirma, Long fileEntryIdBase, long fileEntryIdFirma, - String jsonParameters, long controlloPraticaId, ServiceContext serviceContext) - throws SystemException, PortalException { + @Override + public Avviso addAvviso(long intPraticaId, String descLong, Date dtAvviso, String tipoAvviso, String tipoDocumento, + long fileEntryIdTemplate, long classPk, String className, String userCodiceFiscalePrimaFirma, + Long fileEntryIdBase, long fileEntryIdFirma, String jsonParameters, long controlloPraticaId, + ServiceContext serviceContext) throws SystemException, PortalException { - _log.info("addAvviso: descLong=\"" + descLong + "\", tipoAvviso=\"" + tipoAvviso - + "\", tipoDocumento=\"" + tipoDocumento + "\", className=\"" + className - + "\", jsonParameters=\"" + jsonParameters + "\", fileEntryIdTemplate=" + fileEntryIdTemplate); + _log.info("addAvviso: intPraticaId=" + intPraticaId + ", descLong=\"" + descLong + "\", dtAvviso=" + dtAvviso + + ", tipoAvviso=\"" + tipoAvviso + "\", tipoDocumento=\"" + tipoDocumento + "\", fileEntryIdTemplate=" + + fileEntryIdTemplate + ", classPk=" + classPk + ", className=\"" + className + + "\", userCodiceFiscalePrimaFirma=\"" + userCodiceFiscalePrimaFirma + "\", fileEntryIdBase=" + + fileEntryIdBase + ", fileEntryIdFirma=" + fileEntryIdFirma + ", jsonParameters=\"" + jsonParameters + + "\", controlloPraticaId=" + controlloPraticaId + ", serviceContext=\"" + serviceContext + "\""); if (0 == fileEntryIdTemplate) { throw new PortalException("fileEntryIdTemplate=" + fileEntryIdTemplate); @@ -243,6 +228,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return addAvviso(avviso); } + @Override public Avviso addAvvisoForImport(String descLong, Date dtAvviso, String tipoAvviso, String tipoDocumento, long fileEntryIdTemplate, long classPk, String className, String userCodiceFiscalePrimaFirma, long fileEntryIdBase, String jsonParameters, long intPraticaId, long oldAvvisoId, String inviato, @@ -292,6 +278,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return super.addAvviso(avviso); } + @Override public List search(long[] groupIds, Long classPk, String keywords, int start, int end) throws SystemException { @@ -300,6 +287,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return avvisoPersistence.findWithDynamicQuery(dynamicQuery, start, end); } + @Override public int countSearch(long[] groupIds, Long classPk, String keywords) throws SystemException { return (int) avvisoPersistence.countWithDynamicQuery(searchDynamicQuery(groupIds, classPk, keywords)); @@ -330,14 +318,15 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return dynamicQuery; } - public List getAvvisiFirmatiByCF(long companyId, String cf, int start, int end) - throws SystemException { + @Override + public List getAvvisiFirmatiByCF(long companyId, String cf, int start, int end) throws SystemException { DynamicQuery dynamicQuery = getDynamicQueryAvvisiFirmatiByCF(companyId, cf); dynamicQuery.addOrder(OrderFactoryUtil.desc("dtAvviso")); return avvisoPersistence.findWithDynamicQuery(dynamicQuery, start, end); } + @Override public int countAvvisiFirmatiByCF(long companyId, String cf) throws SystemException { DynamicQuery dynamicQuery = getDynamicQueryAvvisiFirmatiByCF(companyId, cf); @@ -360,6 +349,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return dynamicQuery; } + @Override public List getAvvisiDaFirmarePrimaFirmaByCF(long companyId, String cf, int start, int end) throws SystemException { @@ -368,6 +358,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return avvisoPersistence.findWithDynamicQuery(dynamicQuery, start, end); } + @Override public int countAvvisiDaFirmarePrimaFirmaByCF(long companyId, String cf) throws SystemException { DynamicQuery dynamicQuery = getDynamicQueryAvvisiDaFirmarePrimaFirmaByCF(companyId, cf); @@ -427,23 +418,23 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return dynamicQuery; } - public List getAvvisiDaFirmarePrimaFirmaByNotCF(long companyId, long[] groupIds, String cf, - int start, int end) throws SystemException { + @Override + public List getAvvisiDaFirmarePrimaFirmaByNotCF(long companyId, long[] groupIds, String cf, int start, + int end) throws SystemException { DynamicQuery dynamicQuery = getDynamicQueryAvvisiDaFirmarePrimaFirmaByNotCF(companyId, groupIds, cf); dynamicQuery.addOrder(OrderFactoryUtil.desc("dtAvviso")); return avvisoPersistence.findWithDynamicQuery(dynamicQuery, start, end); } - public int countAvvisiDaFirmarePrimaFirmaByNotCF(long companyId, long[] groupIds, String cf) - throws SystemException { + @Override + public int countAvvisiDaFirmarePrimaFirmaByNotCF(long companyId, long[] groupIds, String cf) throws SystemException { DynamicQuery dynamicQuery = getDynamicQueryAvvisiDaFirmarePrimaFirmaByNotCF(companyId, groupIds, cf); return (int) avvisoPersistence.countWithDynamicQuery(dynamicQuery); } - private DynamicQuery getDynamicQueryAvvisiDaFirmarePrimaFirmaByNotCF(long companyId, long[] groupIds, - String cf) { + private DynamicQuery getDynamicQueryAvvisiDaFirmarePrimaFirmaByNotCF(long companyId, long[] groupIds, String cf) { DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery(); dynamicQuery.add(PropertyFactoryUtil.forName("companyId").eq(companyId)); @@ -452,8 +443,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { } else { dynamicQuery.add(PropertyFactoryUtil.forName("groupId").eq(0l)); } - dynamicQuery.add(RestrictionsFactoryUtil.not(RestrictionsFactoryUtil.ilike( - "userCodiceFiscalePrimaFirma", cf))); + dynamicQuery.add(RestrictionsFactoryUtil.not(RestrictionsFactoryUtil.ilike("userCodiceFiscalePrimaFirma", cf))); dynamicQuery.add(RestrictionsFactoryUtil.isNotNull("userCodiceFiscalePrimaFirma")); dynamicQuery.add(RestrictionsFactoryUtil.ne("userCodiceFiscalePrimaFirma", StringPool.BLANK)); dynamicQuery.add(PropertyFactoryUtil.forName("fileEntryIdBase").ne(0L)); @@ -466,6 +456,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return dynamicQuery; } + @Override public List getAvvisiDaFirmarePrimaFirma(long companyId, long[] groupIds, int start, int end) throws SystemException { @@ -474,6 +465,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return avvisoPersistence.findWithDynamicQuery(dynamicQuery, start, end); } + @Override public int countAvvisiDaFirmarePrimaFirma(long companyId, long[] groupIds) throws SystemException { DynamicQuery dynamicQuery = getDynamicQueryAvvisiDaFirmarePrimaFirma(companyId, groupIds); @@ -505,12 +497,14 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return dynamicQuery; } + @Override public int countAvvisiGenerazioneDocumento() throws SystemException { DynamicQuery dynamicQuery = dynamicQueryAvvisiGenerazioneDocumento(); return (int) avvisoPersistence.countWithDynamicQuery(dynamicQuery); } + @Override public List getAvvisiGenerazioneDocumento(int start, int end) throws SystemException { DynamicQuery dynamicQuery = dynamicQueryAvvisiGenerazioneDocumento(); @@ -518,6 +512,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return avvisoPersistence.findWithDynamicQuery(dynamicQuery, start, end); } + @Override public DynamicQuery dynamicQueryAvvisiGenerazioneDocumento() throws SystemException { DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery(); @@ -528,12 +523,14 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return dynamicQuery; } + @Override public int countAvvisiFirmaDocumento() throws SystemException { DynamicQuery dynamicQuery = dynamicQueryAvvisiFirmaDocumento(); return (int) avvisoPersistence.countWithDynamicQuery(dynamicQuery); } + @Override public List getAvvisiFirmaDocumento(int start, int end) throws SystemException { DynamicQuery dynamicQuery = dynamicQueryAvvisiFirmaDocumento(); @@ -541,6 +538,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return avvisoPersistence.findWithDynamicQuery(dynamicQuery, start, end); } + @Override public DynamicQuery dynamicQueryAvvisiFirmaDocumento() throws SystemException { DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery(); @@ -558,12 +556,14 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return dynamicQuery; } + @Override public int countAvvisiInvioDocumento() throws SystemException { DynamicQuery dynamicQuery = dynamicQueryAvvisiInvioDocumento(); return (int) avvisoPersistence.countWithDynamicQuery(dynamicQuery); } + @Override public List getAvvisiInvioDocumento(int start, int end) throws SystemException { DynamicQuery dynamicQuery = dynamicQueryAvvisiInvioDocumento(); @@ -571,6 +571,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return avvisoPersistence.findWithDynamicQuery(dynamicQuery, start, end); } + @Override public DynamicQuery dynamicQueryAvvisiInvioDocumento() throws SystemException { DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery(); @@ -582,12 +583,14 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return dynamicQuery; } + @Override public int countAvvisiInvioSignal() throws SystemException { DynamicQuery dynamicQuery = dynamicQueryAvvisiInvioSignal(null); return (int) avvisoPersistence.countWithDynamicQuery(dynamicQuery); } + @Override public Avviso getAvvisoInvioSignal(long avvisoId) throws SystemException { DynamicQuery dynamicQuery = dynamicQueryAvvisiInvioSignal(avvisoId); @@ -595,6 +598,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return !avviso.isEmpty() ? avviso.get(0) : null; } + @Override public List getAvvisiInvioSignal(int start, int end) throws SystemException { DynamicQuery dynamicQuery = dynamicQueryAvvisiInvioSignal(null); @@ -602,6 +606,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return avvisoPersistence.findWithDynamicQuery(dynamicQuery, start, end); } + @Override public DynamicQuery dynamicQueryAvvisiInvioSignal(Long avvisoId) throws SystemException { DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery(); @@ -621,12 +626,14 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return dynamicQuery; } + @Override public int countAvvisiTempistica() throws SystemException { DynamicQuery dynamicQuery = dynamicQueryAvvisiTempistica(null); return (int) avvisoPersistence.countWithDynamicQuery(dynamicQuery); } + @Override public Avviso getAvvisoTempistica(long avvisoId) throws SystemException { DynamicQuery dynamicQuery = dynamicQueryAvvisiTempistica(avvisoId); @@ -634,6 +641,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return !avviso.isEmpty() ? avviso.get(0) : null; } + @Override public List getAvvisiTempistica(int start, int end) throws SystemException { DynamicQuery dynamicQuery = dynamicQueryAvvisiTempistica(null); @@ -641,6 +649,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return avvisoPersistence.findWithDynamicQuery(dynamicQuery, start, end); } + @Override public DynamicQuery dynamicQueryAvvisiTempistica(Long avvisoId) throws SystemException { DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery(); @@ -655,6 +664,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return dynamicQuery; } + @Override public Avviso updateAvvisoDlFileEntryFirma(long avvisoId, long fileEntryFirma) throws SystemException { Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); @@ -663,8 +673,8 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return avvisoLocalService.updateAvviso(avviso); } - public Avviso updateAvvisoPrimaFirma(long avvisoId, String transactionId) throws PortalException, - SystemException { + @Override + public Avviso updateAvvisoPrimaFirma(long avvisoId, String transactionId) throws PortalException, SystemException { Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); if (Validator.isNotNull(avviso.getTransactionIdPrimaFirma())) { @@ -675,6 +685,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return avvisoLocalService.updateAvviso(avviso); } + @Override public Avviso updateAvvisoRollbackPrimaFirma(long avvisoId) throws SystemException { Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); @@ -683,6 +694,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return avvisoLocalService.updateAvviso(avviso); } + @Override public Avviso updateAvvisoDlFileEntryIdBase(long avvisoId, long fileEntryIdBase) throws SystemException { Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); @@ -690,16 +702,17 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return avvisoLocalService.updateAvviso(avviso); } - public Avviso updateAvvisoDlFileEntryIdBaseSingola(long avvisoId, long fileEntryIdBase) - throws SystemException { + @Override + public Avviso updateAvvisoDlFileEntryIdBaseSingola(long avvisoId, long fileEntryIdBase) throws SystemException { Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); avviso.setFileEntryIdBase(fileEntryIdBase); return avvisoLocalService.updateAvviso(avviso); } - public Avviso updateAvvisoDlFileEntryIdBaseAndInvio(long avvisoId, long fileEntryId, - Date dtCreateFileEntryInvio) throws SystemException { + @Override + public Avviso updateAvvisoDlFileEntryIdBaseAndInvio(long avvisoId, long fileEntryId, Date dtCreateFileEntryInvio) + throws SystemException { Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); avviso.setFileEntryIdBase(fileEntryId); @@ -710,8 +723,9 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return avvisoLocalService.updateAvviso(avviso); } - public Avviso updateAvvisoDlFileEntryIdInvio(long avvisoId, long fileEntryIdInvio, - Date dtCreateFileEntryInvio) throws SystemException { + @Override + public Avviso updateAvvisoDlFileEntryIdInvio(long avvisoId, long fileEntryIdInvio, Date dtCreateFileEntryInvio) + throws SystemException { Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); avviso.setFileEntryIdInvio(fileEntryIdInvio); @@ -720,6 +734,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return avvisoLocalService.updateAvviso(avviso); } + @Override public Avviso updateAvvisoInvio(long avvisoId) throws SystemException { Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); @@ -728,6 +743,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return avvisoLocalService.updateAvviso(avviso); } + @Override public Avviso updateAvvisoErrore(long avvisoId, boolean errore) throws SystemException { Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); @@ -735,6 +751,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return avvisoLocalService.updateAvviso(avviso); } + @Override public Avviso updateAvvisoAnnullato(long avvisoId, boolean annullato) throws SystemException { Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); @@ -742,6 +759,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return avvisoLocalService.updateAvviso(avviso); } + @Override public Avviso updateAvvisoSignal(long avvisoId, Date dtInvioSignal) throws SystemException { Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); @@ -749,6 +767,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return avvisoLocalService.updateAvviso(avviso); } + @Override public Avviso updateAvvisoSignal(long avvisoId, boolean signal) throws SystemException { Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); @@ -756,6 +775,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return avvisoLocalService.updateAvviso(avviso); } + @Override public Avviso updateAvvisoTempistica(long avvisoId, Date dtTempistica) throws SystemException { Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); @@ -763,6 +783,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return avvisoLocalService.updateAvviso(avviso); } + @Override public Avviso updateAvvisoTempistica(long avvisoId, boolean tempistica) throws SystemException { Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); @@ -770,6 +791,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return avvisoLocalService.updateAvviso(avviso); } + @Override public Avviso updateAvvisoProtocollo(long avvisoId, String protocollo) throws SystemException { Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); @@ -785,6 +807,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return avvisoLocalService.updateAvviso(avviso); } + @Override public Avviso getAvvisoInvioTecnico(long avvisoId) throws SystemException { DynamicQuery dynamicQuery = dynamicQueryAvvisiInvioTecnico(avvisoId); @@ -792,12 +815,14 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return avvisi.isEmpty() ? null : avvisi.get(0); } + @Override public int countAvvisiInvioTecnico() throws SystemException { DynamicQuery dynamicQuery = dynamicQueryAvvisiInvioTecnico(null); return (int) avvisoPersistence.countWithDynamicQuery(dynamicQuery); } + @Override public List getAvvisiInvioTecnico(int start, int end) throws SystemException { DynamicQuery dynamicQuery = dynamicQueryAvvisiInvioTecnico(null); @@ -809,9 +834,8 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery(); dynamicQuery.add(PropertyFactoryUtil.forName("inviatoTecnico").eq(false)); - dynamicQuery.add(PropertyFactoryUtil.forName("tipoDocumento") - .in(new String[] { StatoPraticaConstants.VIDIMATA, - StatoPraticaConstants.INTEGRAZIONE_ACCETTATA })); + dynamicQuery.add(PropertyFactoryUtil.forName("tipoDocumento").in( + new String[] { StatoPraticaConstants.VIDIMATA, StatoPraticaConstants.INTEGRAZIONE_ACCETTATA })); dynamicQuery.add(PropertyFactoryUtil.forName("errore").eq(false)); dynamicQuery.add(PropertyFactoryUtil.forName("annullato").eq(false)); if (Validator.isNotNull(avvisoId)) { @@ -820,11 +844,13 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return dynamicQuery; } + @Override public Avviso fetchAvvisoByOldAvvisoId(long oldAvvisoId) throws SystemException { return avvisoPersistence.fetchByoldAvvisoId(oldAvvisoId); } + @Override public Avviso updateAvvisoInviatoTecnico(long avvisoId, boolean inviatoTecnico) throws SystemException { Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); @@ -832,26 +858,28 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return avvisoLocalService.updateAvviso(avviso); } - public List findByClassPk_tipoDocumento(Long classPk, String tipoDocumento) - throws SystemException { + @Override + public List findByClassPk_tipoDocumento(Long classPk, String tipoDocumento) throws SystemException { return avvisoPersistence.findByClassPk_tipoDocumento(classPk, tipoDocumento); } + @Override public List findByIntPraticaId_tipoDocumento(Long intPraticaId, String tipoDocumento) throws SystemException { return avvisoPersistence.findByIntPraticaId_tipoDocumento(intPraticaId, tipoDocumento); } + @Override public List findByIntPraticaIds_tipoDocumento(long[] intPraticaIds, String tipoDocumento) throws SystemException { return avvisoPersistence.findByIntPraticaIds_tipoDocumento(intPraticaIds, tipoDocumento); } - public List findByClassPk_ExcludeTipoDocumento(Long classPk, String tipoDocumento) - throws SystemException { + @Override + public List findByClassPk_ExcludeTipoDocumento(Long classPk, String tipoDocumento) throws SystemException { DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery(); dynamicQuery.add(RestrictionsFactoryUtil.ne("tipoDocumento", tipoDocumento)); @@ -859,26 +887,28 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return avvisoPersistence.findWithDynamicQuery(dynamicQuery); } - public List findByIntPratica(long intPraticaId, int start, int end, - OrderByComparator orderByComparator) throws SystemException { + @Override + public List findByIntPratica(long intPraticaId, int start, int end, OrderByComparator orderByComparator) + throws SystemException { return avvisoPersistence.findByIntPratica(intPraticaId, start, end, orderByComparator); } + @Override public List findByIntPratica_Inviato(long intPraticaId, String inviato, int start, int end, OrderByComparator orderByComparator) throws SystemException { - return avvisoPersistence.findByIntPratica_Inviato(intPraticaId, inviato, start, end, - orderByComparator); + return avvisoPersistence.findByIntPratica_Inviato(intPraticaId, inviato, start, end, orderByComparator); } + @Override public int countByIntPratica(long intPraticaId) throws SystemException { return avvisoPersistence.countByIntPratica(intPraticaId); } - public boolean containsFileEntry(long companyId, long[] groupIds, long fileEntryId) - throws SystemException { + @Override + public boolean containsFileEntry(long companyId, long[] groupIds, long fileEntryId) throws SystemException { DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery(); dynamicQuery.add(RestrictionsFactoryUtil.eq("companyId", companyId)); @@ -896,11 +926,13 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return count > 0; } + @Override public List findByUUID(String uuid, int start, int end) throws SystemException { return avvisoPersistence.findByUuid(uuid, start, end); } + @Override public int countAvvisoByClassPk(long classPk) throws SystemException { DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery(); @@ -908,6 +940,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return (int) avvisoPersistence.countWithDynamicQuery(dynamicQuery); } + @Override public int countAvvisoByClassPk_ClassName(long classPk, String className) throws SystemException { DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery(); @@ -916,26 +949,28 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return (int) avvisoPersistence.countWithDynamicQuery(dynamicQuery); } + @Override public Avviso findByProtocollo(long companyId, long groupId, String protocollo) throws PortalException, SystemException { return avvisoPersistence.findByC_G_Protocollo(companyId, groupId, protocollo); } + @Override public Avviso fetchByProtocollo(long companyId, long groupId, String protocollo) throws PortalException, SystemException { return avvisoPersistence.fetchByC_G_Protocollo(companyId, groupId, protocollo); } + @Override public Avviso fetchByProtocollo(String protocollo) throws PortalException, SystemException { return avvisoPersistence.fetchByProtocollo(protocollo); } /* - * Utilizzato nell'override di update e add per automatizzazione campo - * signal (default false) + * Utilizzato nell'override di update e add per automatizzazione campo signal (default false) */ private void updateSignalAndTempistica(Avviso avviso) { @@ -954,6 +989,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { avviso.setTempistica(tempistica); } + @Override public Avviso fetchLastAvvisoByIntPraticaPerStatoFinale(long intPraticaId) throws SystemException { DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery(); @@ -965,8 +1001,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { disjunction.add(RestrictionsFactoryUtil.eq("tipoDocumento", StatoPraticaConstants.AUTORIZZATA)); disjunction.add(RestrictionsFactoryUtil.eq("tipoDocumento", StatoPraticaConstants.NON_AUTORIZZATA)); disjunction.add(RestrictionsFactoryUtil.eq("tipoDocumento", StatoPraticaConstants.INTEGRAZIONE)); - disjunction.add(RestrictionsFactoryUtil - .eq("tipoDocumento", StatoPraticaConstants.PREAVVISO_CONTRARIO)); + disjunction.add(RestrictionsFactoryUtil.eq("tipoDocumento", StatoPraticaConstants.PREAVVISO_CONTRARIO)); disjunction.add(RestrictionsFactoryUtil.eq("tipoDocumento", StatoPraticaConstants.ANNULLATA)); dynamicQuery.add(disjunction); dynamicQuery.addOrder(OrderFactoryUtil.desc("avvisoId")); @@ -979,6 +1014,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { } + @Override public List getListaAvvisiPerApplet(String codFisc) throws SystemException { DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery(); @@ -990,11 +1026,13 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return avvisoPersistence.findWithDynamicQuery(dynamicQuery); } + @Override public Map getAllTipoDocumentoFolderProps() { return AvvisoUtil.getAllTipoDocumentoFolderProps(); } + @Override public String getFileNameAvviso(long classPk, String tipoDocumento, Long idAvviso, String doc) { // boolean docBase, boolean docFirma, boolean docControfirma @@ -1008,14 +1046,15 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { // } String filename = StringUtils.leftPad(String.valueOf(classPk), 10, '0') - + (Validator.isNotNull(tipoDocumento) ? StringPool.UNDERLINE + tipoDocumento - : StringPool.BLANK) + StringPool.UNDERLINE + doc + StringPool.UNDERLINE + + (Validator.isNotNull(tipoDocumento) ? StringPool.UNDERLINE + tipoDocumento : StringPool.BLANK) + + StringPool.UNDERLINE + doc + StringPool.UNDERLINE + (Validator.isNotNull(idAvviso) ? idAvviso : System.currentTimeMillis()); return filename; } + @Override public Avviso rilasciaFirma(long avvisoId) throws SystemException { Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); @@ -1027,6 +1066,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return avvisoLocalService.updateAvviso(avviso); } + @Override public Avviso assegnaFirma(long avvisoId, String cf) throws SystemException { Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); @@ -1038,6 +1078,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return avvisoLocalService.updateAvviso(avviso); } + @Override public List getAvvisiWithOldFileEntryIdInvio(int start, int end) throws SystemException { DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(Avviso.class); @@ -1047,6 +1088,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return avvisoLocalService.dynamicQuery(dynamicQuery, start, end); } + @Override public List getAvvisiWithOldFileEntryIdBase(int start, int end) throws SystemException { DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(Avviso.class); @@ -1056,8 +1098,8 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return avvisoLocalService.dynamicQuery(dynamicQuery, start, end); } - public List getAvvisiRifiutatiByControlloPraticaId(long controlloPraticaId) - throws SystemException { + @Override + public List getAvvisiRifiutatiByControlloPraticaId(long controlloPraticaId) throws SystemException { DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(Avviso.class); dynamicQuery.add(RestrictionsFactoryUtil.eq("controlloPraticaId", controlloPraticaId)); @@ -1068,6 +1110,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return avvisoLocalService.dynamicQuery(dynamicQuery); } + @Override public Avviso addFileFirmato(long avvisoId, long classPk, String fileToSave, ServiceContext serviceContext) throws Exception { @@ -1075,8 +1118,8 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { // DettPratica dettPratica = // DettPraticaLocalServiceUtil.fetchDettPratica(dettPraticaId); - long folderId = ConfigurazioneLocalServiceUtil.findByC_ChiaveLong(avviso.getCompanyId(), - avvisoLocalService.getAllTipoDocumentoFolderProps().get(avviso.getTipoDocumento())); + long folderId = ConfigurazioneLocalServiceUtil.findByC_ChiaveLong(avviso.getCompanyId(), avvisoLocalService + .getAllTipoDocumentoFolderProps().get(avviso.getTipoDocumento())); String fileName = getFileNameAvviso(classPk, avviso.getTipoDocumento(), avviso.getAvvisoId(), "F"); @@ -1086,17 +1129,15 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { if (Validator.isNotNull(folder)) { byte[] bytes = Base64.decode(fileToSave); - FileEntry fileEntry = DLAppLocalServiceUtil.addFileEntry(avviso.getUserId(), - folder.getRepositoryId(), folderId, fileName, - MimeTypesUtil.getContentType(fileName + ".p7m"), fileName + ".p7m", "", "", bytes, - serviceContext); + FileEntry fileEntry = DLAppLocalServiceUtil.addFileEntry(avviso.getUserId(), folder.getRepositoryId(), + folderId, fileName, MimeTypesUtil.getContentType(fileName + ".p7m"), fileName + ".p7m", "", "", + bytes, serviceContext); avviso.setFileEntryIdInvio(fileEntry.getFileEntryId()); avviso = avvisoLocalService.updateAvviso(avviso); if (Validator.isNull(avviso.getProtocollo())) { - String protocollo = ProtocollazioneUtil.protocollaPartenza(avviso, - fileEntry.getFileEntryId()); + String protocollo = ProtocollazioneUtil.protocollaPartenza(avviso, fileEntry.getFileEntryId()); avviso = avvisoLocalService.updateAvvisoProtocollo(avviso.getAvvisoId(), protocollo); } @@ -1111,8 +1152,9 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { } - public List protocolliSearch(String dataDa, String dataA, String numeroProtocollo, int start, - int end) throws ParseException, SystemException { + @Override + public List protocolliSearch(String dataDa, String dataA, String numeroProtocollo, int start, int end) + throws ParseException, SystemException { SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); @@ -1156,8 +1198,8 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { } - if ((numeroProtocollo != null && !numeroProtocollo.equals("")) - || (dataDa != null && !dataDa.equals("")) || (dataA != null && !dataA.equals(""))) { + if ((numeroProtocollo != null && !numeroProtocollo.equals("")) || (dataDa != null && !dataDa.equals("")) + || (dataA != null && !dataA.equals(""))) { Order defaultOrder = OrderFactoryUtil.asc("dtProtocollo"); query.addOrder(defaultOrder); @@ -1168,8 +1210,9 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return lista; } - public int countProtocolliSearch(String dataDa, String dataA, String numeroProtocollo) - throws SystemException, ParseException { + @Override + public int countProtocolliSearch(String dataDa, String dataA, String numeroProtocollo) throws SystemException, + ParseException { int count = 0; SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); @@ -1212,14 +1255,15 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { } - if ((numeroProtocollo != null && !numeroProtocollo.equals("")) - || (dataDa != null && !dataDa.equals("")) || (dataA != null && !dataA.equals(""))) { + if ((numeroProtocollo != null && !numeroProtocollo.equals("")) || (dataDa != null && !dataDa.equals("")) + || (dataA != null && !dataA.equals(""))) { count = (int) avvisoPersistence.countWithDynamicQuery(query); } return count; } + @Override public List getAvvisiPerAggiuntaProtocollo(int start, int end) throws SystemException { DynamicQuery dynamicQuery = dynamicQueryAggiuntaProtocollo(); @@ -1227,6 +1271,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return avvisoPersistence.findWithDynamicQuery(dynamicQuery, start, end); } + @Override public DynamicQuery dynamicQueryAggiuntaProtocollo() throws SystemException { DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery(); @@ -1241,6 +1286,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { return dynamicQuery; } + @Override public List findByClassPk(long classPk) throws SystemException { return avvisoPersistence.findByClassPk(classPk); @@ -1253,6 +1299,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { /** * ADT */ + @Override public int countAvvisiInvioTecnicoNew() throws SystemException { DynamicQuery dynamicQuery = dynamicQueryAvvisiInvioTecnicoNew(null); return (int) avvisoPersistence.countWithDynamicQuery(dynamicQuery); @@ -1260,8 +1307,9 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { /** * ADT - * + * */ + @Override public List getAvvisiInvioTecnicoNew(int start, int end) throws SystemException { DynamicQuery dynamicQuery = dynamicQueryAvvisiInvioTecnicoNew(null); @@ -1271,9 +1319,9 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { } /** - * + * * ADT - * + * * @param avvisoId * @return * @throws SystemException @@ -1283,8 +1331,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery(); dynamicQuery.add(PropertyFactoryUtil.forName("inviatoTecnico").eq(false)); dynamicQuery.add(PropertyFactoryUtil.forName("tipoDocumento").in( - new String[] { StatoPraticaConstants.SOTTOPOSTA_A_PARERE, - StatoPraticaConstants.CAMBIO_ISTRUTTORE })); + new String[] { StatoPraticaConstants.SOTTOPOSTA_A_PARERE, StatoPraticaConstants.CAMBIO_ISTRUTTORE })); dynamicQuery.add(PropertyFactoryUtil.forName("errore").eq(false)); dynamicQuery.add(PropertyFactoryUtil.forName("annullato").eq(false)); if (Validator.isNotNull(avvisoId)) { @@ -1305,12 +1352,13 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { /** * ADT - * + * * @param intPraticaId * @param dettPraticaID * @return * @throws SystemException */ + @Override public Avviso getAvvisoVidimazione(long intPraticaId, long dettPraticaID) throws SystemException { DynamicQuery dynamicQuery = AvvisoLocalServiceUtil.dynamicQuery(); @@ -1334,18 +1382,18 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { } /** - * - * + * + * * @param intPraticaId * @return * @throws SystemException */ + @Override public Avviso getLastAvvisoIntegrazione(long intPraticaId) throws SystemException { DynamicQuery dynamicQuery = AvvisoLocalServiceUtil.dynamicQuery(); - dynamicQuery.add(PropertyFactoryUtil.forName("tipoDocumento") - .in(new String[] { StatoPraticaConstants.INTEGRAZIONE, - StatoPraticaConstants.PREAVVISO_CONTRARIO })); + dynamicQuery.add(PropertyFactoryUtil.forName("tipoDocumento").in( + new String[] { StatoPraticaConstants.INTEGRAZIONE, StatoPraticaConstants.PREAVVISO_CONTRARIO })); dynamicQuery.add(PropertyFactoryUtil.forName("fileEntryIdProtocollo").ne(0L)); dynamicQuery.add(PropertyFactoryUtil.forName("errore").eq(false)); dynamicQuery.add(PropertyFactoryUtil.forName("annullato").eq(false)); diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ControlloPraticaLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ControlloPraticaLocalServiceImpl.java index fe3adc8c..6f52913c 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ControlloPraticaLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ControlloPraticaLocalServiceImpl.java @@ -607,7 +607,12 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi jsonObject.put("esito", jsonArray); JSONObject etichette = JSONFactoryUtil.createJSONObject(); etichette.put("label", "Attiva VIArch"); - etichette.put("value", StatoPraticaConstants.VIARCH); + etichette.put("value", StatoPraticaConstants.INTEGRAZIONE); + etichette.put("default", false); + jsonArray.put(etichette); + etichette = JSONFactoryUtil.createJSONObject(); + etichette.put("label", "Concludi VIArch"); + etichette.put("value", StatoPraticaConstants.CONFORME); etichette.put("default", false); jsonArray.put(etichette); etichette = JSONFactoryUtil.createJSONObject(); diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties index 109e5a95..b7a88994 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties @@ -13,8 +13,8 @@ ## build.namespace=portos_bo - build.number=2915 - build.date=1616068476446 + build.number=2932 + build.date=1616496884713 build.auto.upgrade=true ## diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/avvisi/view.jsp b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/avvisi/view.jsp index a38bbb1e..41efe377 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/avvisi/view.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/avvisi/view.jsp @@ -1,221 +1,135 @@ <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> -<%@page import="it.tref.liferay.portos.bo.util.AvvisoUtil"%> -<%@page import="it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants"%> -<%@page import="it.tref.liferay.portos.bo.shared.util.TipoIntegrazioneUtil"%> -<%@page import="com.liferay.portlet.documentlibrary.util.DLUtil"%> +<%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%> <%@page import="com.liferay.portal.kernel.repository.model.FileEntry"%> <%@page import="com.liferay.portlet.documentlibrary.service.DLAppLocalServiceUtil"%> -<%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%> +<%@page import="com.liferay.portlet.documentlibrary.util.DLUtil"%> +<%@page import="it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants"%> +<%@page import="it.tref.liferay.portos.bo.shared.util.TipoIntegrazioneUtil"%> +<%@page import="it.tref.liferay.portos.bo.util.AvvisoUtil"%> <%@ include file="/html/avvisi/init.jsp" %> - <% - long intPraticaId = ParamUtil.getLong(request, "intPraticaId", 0l); +long intPraticaId = ParamUtil.getLong(request, "intPraticaId", 0L); +List avvisi = AvvisoLocalServiceUtil.findByIntPratica(intPraticaId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); %> - - - - - - - - - - + + + + <%= avviso.getFullDescription() %> - <%= avviso.getFirmaInCorso() ? "Si" : "No" %> + <%= avviso.getFirmaInCorso() ? "Sì" : "No" %> - - - + + - - + <% - if(Validator.isNotNull(avviso.getFileEntryIdBase())){ + if (Validator.isNotNull(avviso.getFileEntryIdBase())) { %> - +
- +
- <% + <% FileEntry fileEntry = DLAppLocalServiceUtil.getFileEntry(avviso.getFileEntryIdBase()); - String downloadUrl = DLUtil.getPreviewURL(fileEntry, fileEntry.getLatestFileVersion(), themeDisplay, "&download=true"); - %> + String downloadUrl = DLUtil.getPreviewURL(fileEntry, fileEntry.getLatestFileVersion(), themeDisplay, + "&download=true"); + %>
- +
<% - } else if(Validator.isNull(avviso.getFileEntryIdInvio()) && Validator.isNotNull(avviso.getOldAvvisoId())){ - - String avvisoId = String.valueOf(avviso.getAvvisoId()); - String className = Avviso.class.getName(); - %> - - - - - - - <% - } + } %>
- - + <% - if(Validator.isNotNull(avviso.getFileEntryIdProtocollo())){ + if (Validator.isNotNull(avviso.getFileEntryIdProtocollo())) { %> - - + +
- +
- <% + <% FileEntry fileEntryProtocollo = DLAppLocalServiceUtil.getFileEntry(avviso.getFileEntryIdProtocollo()); - String protocolloDownloadUrl = DLUtil.getPreviewURL(fileEntryProtocollo, fileEntryProtocollo.getLatestFileVersion(), themeDisplay, "&download=true"); - %> + String protocolloDownloadUrl = DLUtil.getPreviewURL(fileEntryProtocollo, + fileEntryProtocollo.getLatestFileVersion(), themeDisplay, "&download=true"); + %>
- +
<% - } + } %>
-
- - + <% - if(Validator.isNotNull(avviso.getFileEntryIdInvio())){ + if (Validator.isNotNull(avviso.getFileEntryIdInvio())) { %>
- +
- <% + <% FileEntry fileEntryInvio = DLAppLocalServiceUtil.getFileEntry(avviso.getFileEntryIdInvio()); - String invioDownloadUrl = DLUtil.getPreviewURL(fileEntryInvio, fileEntryInvio.getLatestFileVersion(), themeDisplay, "&download=true"); - %> + String invioDownloadUrl = DLUtil.getPreviewURL(fileEntryInvio, fileEntryInvio.getLatestFileVersion(), + themeDisplay, "&download=true"); + %>
- +
<% - } else if(Validator.isNull(avviso.getFileEntryIdInvio()) && Validator.isNotNull(avviso.getOldAvvisoId())){ - - String avvisoId = String.valueOf(avviso.getAvvisoId()); - String className = Avviso.class.getName(); - /* String random = StringUtil.randomId(); - String buttonId = "eventButton"+random; - String contentId = "contentDiv"+random; - String titleId = "Importazione File"; */ - %> - <%--
- -
-
-

File non ancora importato

-

Processo in corso...

-

Si prega di attendere qualche minuto

-
- - - - - - - - -
-
- - - <% - String function = "A.io.request('"+importFileURL+"',{data: {"+renderResponse.getNamespace()+"classPk: "+avvisoId+", "+renderResponse.getNamespace()+"className: '"+className+"'},"+ - "dataType: 'json',on: {failure: function() {alert('impossibile importare il file allegato...');},success: function(event, id, obj) {var response = this.get('responseData');content.html(response)}}});"; - %> - - - - - - - --%> - - - - - - - - <% - } + } %>
-
-
- - +
- \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/advanced_search.jsp b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/advanced_search.jsp index 3dcf370d..bd65fbfa 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/advanced_search.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/advanced_search.jsp @@ -1,253 +1,242 @@ <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants"%> <%@page import="java.util.ArrayList"%> -<%@page import="java.util.Comparator"%> -<%@page import="java.util.Comparator"%> <%@page import="java.util.Collections"%> -<%@page import="com.liferay.portal.model.Organization"%> -<%@page import="com.liferay.portal.service.OrganizationLocalServiceUtil"%> -<%@include file="/html/fascicolo/init.jsp" %> - +<%@page import="java.util.Comparator"%> +<%@include file="/html/fascicolo/init.jsp"%> - - <% - String comune = ParamUtil.getString(request, "comune"); - String provinciaJS = ParamUtil.getString(request, "provinciaJS"); - - %> - - - -
-
-
- -
-
- -
-
- - Seleziona il tipo di pratica - - - - - -
-
- - Stato Pratica - -<%-- --%> -<%-- --%> -<%-- --%> - - - - - - - - - - - - - - - -
-
-
-
- -
-
- - Tipo Intervento - - - - - -
-
- - Pratica Aperta : - - - - -
-
- -
-
- - - <% - List province = TerritorioLocalServiceUtil.getActiveProvince(); - - //ADT BUG-ID=15 Sezione Ricerca / Ordinamento Filtro - List provinceList = new ArrayList(); - for (String codiceProvincia : province) { - Provincia provinciaToStamp = ProvinciaLocalServiceUtil.fetchByC_C(company.getCompanyId(), codiceProvincia); - provinceList.add(provinciaToStamp); - } - - Collections.sort(provinceList, new Comparator(){ - public int compare(Provincia o1, Provincia o2){ - return o1.getProvincia().compareTo(o2.getProvincia()); - } - }); - - for (Provincia provincia : provinceList) { - %> - <%=provincia.getProvincia() %> - <% - } - %> - -
-
- - - <% - if(provinciaJS != null && !provinciaJS.equals("") && !provinciaJS.equals("000")){ - List comuni = TerritorioLocalServiceUtil.getActiveComuniByCodiceProvincia(provinciaJS); - for (long comuneId : comuni) { - Comune comuneToStamp = ComuneLocalServiceUtil.getComune(comuneId); - %> - <%=comuneToStamp.getDenominazione()%> - <% - } - } - %> - - -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- - - - - - - - - - -
-
-
-
-
-
- - Numero Progetto - Protocollo - Data Invio - -
-
- - Dec - Asc - -
-
-
-
- - + +<% +String comune = ParamUtil.getString(request, "comune"); +String provinciaJS = ParamUtil.getString(request, "provinciaJS"); +%> + +
+
+
+ +
+
+ +
+
+ + Seleziona il tipo di pratica + + + + +
+
+ + Stato Pratica + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+ + Tipo Intervento + + + + + +
+
+ + Pratica Aperta : + + + + +
+
+
+
+ + + <% + List province = TerritorioLocalServiceUtil.getActiveProvince(); + //ADT BUG-ID=15 Sezione Ricerca / Ordinamento Filtro + List provinceList = new ArrayList(); + for (String codiceProvincia : province) { + Provincia provinciaToStamp = ProvinciaLocalServiceUtil.fetchByC_C(company.getCompanyId(), + codiceProvincia); + provinceList.add(provinciaToStamp); + } + Collections.sort(provinceList, new Comparator() { + public int compare(Provincia o1, Provincia o2){ + return o1.getProvincia().compareTo(o2.getProvincia()); + } + }); + for (Provincia provincia : provinceList) { + %> + + <%= provincia.getProvincia() %> + + <% + } + %> + +
+
+ + + <% + if (Validator.isNotNull(provinciaJS) && !provinciaJS.equals("000")) { + List comuni = TerritorioLocalServiceUtil.getActiveComuniByCodiceProvincia(provinciaJS); + for (long comuneId : comuni) { + Comune comuneToStamp = ComuneLocalServiceUtil.getComune(comuneId); + %> + + <%= comuneToStamp.getDenominazione() %> + + <% + } + } + %> + +
+
+ +
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+ + + + + + + + + + +
+
+
+
+
+
+ + Numero Progetto + Protocollo + Data Invio + +
+
+ + Dec + Asc +
- - +
+
+
+ +
+
- var getComuni = function(provinciaId, comuneId, comuneValue) { var comuneSelect = A.one("#"+comuneId); - - - if(provinciaId == "" || provinciaId == "000"){ + if (provinciaId == "" || provinciaId == "000") { comuneSelect.html("") - comuneSelect.addClass("disabled").set("disabled", true); + comuneSelect.addClass("disabled").set("disabled", true); } else { - A.io.request( - '<%= getComuniURL %>', - { - data: { - provinciaId: provinciaId - },dataType: 'json', - on: { - success: function() { - - var response = this.get('responseData'); - comuneSelect.html("") - for( index in response ){ - var code =''; - comuneSelect.append(code); - } - - if(provinciaId!="" && provinciaId!="000" ){ - comuneSelect.removeClass("disabled").set("disabled", false); - } + A.io.request('<%= getComuniURL %>', { + data: { + provinciaId: provinciaId + }, + dataType: 'json', + on: { + success: function() { + var response = this.get('responseData'); + comuneSelect.html("") + for (index in response) { + var code = ''; + comuneSelect.append(code); + } + if (provinciaId != "" && provinciaId != "000") { + comuneSelect.removeClass("disabled").set("disabled", false); } } } - ); - } + }); + } }; - -A.ready(function(){ - - - A.one(".provinciaSelect").on('change', function(event){ - +A.ready(function() { + A.one(".provinciaSelect").on('change', function(event) { var provinciaId = event.currentTarget.get('value'), comuneId = event.currentTarget.attr("id").replace("provincia","comune"), comuneValue = "000"; - - getComuni(provinciaId, comuneId, comuneValue) - + getComuni(provinciaId, comuneId, comuneValue) }); }); - - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/navigator/page_avvisi.jsp b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/navigator/page_avvisi.jsp index 737352cd..59b42c57 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/navigator/page_avvisi.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/navigator/page_avvisi.jsp @@ -1,24 +1,19 @@ <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> -<%@page import="it.tref.liferay.portos.bo.model.IntPratica"%> -<%@page import="com.liferay.portal.kernel.util.ParamUtil"%> <%@page import="it.tref.liferay.portos.bo.model.DettPratica"%> - -<%@ include file="/html/fascicolo/init.jsp" %> - -

+<%@page import="it.tref.liferay.portos.bo.model.IntPratica"%> +<%@include file="/html/fascicolo/init.jsp"%> + +

<% - DettPratica dettPratica = (DettPratica)request.getAttribute("bean.dettPratica.lastData"); - IntPratica intPratica = (IntPratica)request.getAttribute("bean.intPratica"); +DettPratica dettPratica = (DettPratica) request.getAttribute("bean.dettPratica.lastData"); +IntPratica intPratica = (IntPratica) request.getAttribute("bean.intPratica"); %> -
-
- - - +
+ + -
\ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/view_columns.jspf b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/view_columns.jspf index 02711ffa..5007a192 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/view_columns.jspf +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/view_columns.jspf @@ -28,9 +28,8 @@ <%@page import="it.tref.liferay.portos.bo.util.WorkflowUtil"%> <%@page import="java.util.List"%> <% -String rowUrl = StringPool.BLANK; //ADT - BUG-12 Aggiunta colonna Data Esito -String currentTab = (String)request.getAttribute("tabs1"); +String currentTab = (String) request.getAttribute("tabs1"); //Informazioni relative alla pratica IntPratica intPratica = IntPraticaLocalServiceUtil.fetchIntPratica(controlloPratica.getIntPraticaId()); DettPratica lastDettPratica = DettPraticaLocalServiceUtil.getLastCompletedByIntPratica(intPratica.getIntPraticaId()); @@ -40,14 +39,11 @@ DettPratica lastDettPratica = DettPraticaLocalServiceUtil.getLastCompletedByIntP ControlloPraticaLocalServiceUtil.calculateDateAvvioProcedimento(controlloPratica.getControlloPraticaId()); Territorio territorio = TerritorioLocalServiceUtil.fetchTerritorio(intPratica.getTerritorioId()); Comune comune = ComuneLocalServiceUtil.fetchComune(territorio.getComuneId()); - Provincia provincia = ProvinciaLocalServiceUtil.fetchByC_C(territorio.getCompanyId(), territorio.getCodiceProvincia()); - //Informazioni relative al workflow WorkflowInstanceLink workflowInstanceLink = WorkflowInstanceLinkLocalServiceUtil.fetchWorkflowInstanceLink( controlloPratica.getCompanyId(), controlloPratica.getGroupId(), ControlloPratica.class.getName(), controlloPratica.getPrimaryKey()); - List listaTask = null; WorkflowInstance workflowInstance = null; if (workflowInstanceLink != null) { @@ -87,10 +83,7 @@ DettPratica lastDettPratica = DettPraticaLocalServiceUtil.getLastCompletedByIntP %> - <% - String tipoEsito = ControlloPraticaLocalServiceUtil.getTipoEsito(controlloPratica.getControlloPraticaId()); - out.print(LanguageUtil.get(pageContext, tipoEsito)); - %> + <%= ControlloPraticaLocalServiceUtil.getTipoEsito(controlloPratica.getControlloPraticaId()) %> <%-- ADT - BUG-12 Aggiunta colonna Data Esito --%> @@ -131,7 +124,7 @@ DettPratica lastDettPratica = DettPraticaLocalServiceUtil.getLastCompletedByIntP if (tecnico != null) { out.print(tecnico.getFullName()); } else { - out.print(" [" + intPratica.getStatusByUserId() + StringPool.CLOSE_BRACKET); + out.print(StringPool.OPEN_BRACKET + intPratica.getStatusByUserId() + StringPool.CLOSE_BRACKET); } %> @@ -153,11 +146,7 @@ DettPratica lastDettPratica = DettPraticaLocalServiceUtil.getLastCompletedByIntP if (approvatore!=null) { out.print(approvatore.getFullName()); } else { - if (workflowTask.getAssigneeUserId() == -1) { - out.print( " [Portos 1]"); - } else { - out.print( " [" + workflowTask.getAssigneeUserId() + StringPool.CLOSE_BRACKET); - } + out.print( " [" + workflowTask.getAssigneeUserId() + StringPool.CLOSE_BRACKET); } out.print(" (" + workflowTask.getName() + StringPool.CLOSE_PARENTHESIS); %> @@ -172,10 +161,7 @@ DettPratica lastDettPratica = DettPraticaLocalServiceUtil.getLastCompletedByIntP <%= provincia.getProvincia() + " - " + comune.getDenominazione() %> - <% - long days = ControlloPraticaLocalServiceUtil.calculateDateAvvioProcedimento(controlloPratica.getControlloPraticaId()); - %> - <%= days %> + <%= ControlloPraticaLocalServiceUtil.calculateDateAvvioProcedimento(controlloPratica.getControlloPraticaId()) %> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/view_columns_completed.jspf b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/view_columns_completed.jspf index 69fe81ad..0e70e664 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/view_columns_completed.jspf +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/view_columns_completed.jspf @@ -1,19 +1,20 @@ +<%@page import="java.text.DateFormat"%> +<%@page import="java.util.Locale"%> + <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@page import="com.liferay.portal.kernel.language.LanguageUtil"%> +<%@page import="com.liferay.portal.kernel.util.StringPool"%> +<%@page import="com.liferay.portal.kernel.util.StringUtil"%> +<%@page import="com.liferay.portal.kernel.util.Validator"%> <%@page import="com.liferay.portal.kernel.workflow.WorkflowConstants"%> +<%@page import="com.liferay.portal.model.User"%> +<%@page import="com.liferay.portal.service.UserLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.model.DettPratica"%> <%@page import="it.tref.liferay.portos.bo.service.ControlloPraticaLocalServiceUtil"%> -<%@page import="com.liferay.portal.workflow.kaleo.service.KaleoInstanceLocalServiceUtil"%> -<%@page import="com.liferay.portal.workflow.kaleo.model.KaleoInstance"%> -<%@page import="java.text.DateFormat"%> -<%@page import="com.liferay.portal.kernel.language.LanguageUtil"%> -<%@page import="com.liferay.portal.kernel.util.StringPool"%> -<%@page import="it.tref.liferay.portos.bo.util.WorkflowUtil"%> <%@page import="it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil"%> -<%@page import="it.tref.liferay.portos.bo.service.impl.DettPraticaLocalServiceImpl"%> -<%@page import="it.tref.liferay.portos.bo.service.SorteggioLocalServiceUtil"%> -<%@page import="com.liferay.portal.service.UserLocalServiceUtil"%> -<%@page import="com.liferay.portal.model.User"%> +<%@page import="it.tref.liferay.portos.bo.util.WorkflowUtil"%> <%@page import="java.util.concurrent.TimeUnit"%> + <%@page import="java.util.Date"%> <%@page import="it.tref.liferay.portos.bo.service.ProvinciaLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.model.Provincia"%> @@ -33,7 +34,13 @@ <%@page import="com.liferay.portal.model.WorkflowInstanceLink"%> <%@page import="com.liferay.portal.service.WorkflowInstanceLinkLocalServiceUtil"%> <% - String rowUrl = StringPool.BLANK; +ControlloPratica controlloPratica = null; +Locale locale = null; +DateFormat dateFormatDate = null; +String tabs1 = null; +String tabNames = null; + +String rowUrl = StringPool.BLANK; %> <% @@ -99,27 +106,14 @@ IntPratica intPratica = IntPraticaLocalServiceUtil.fetchIntPratica(controlloPrat <% - if(workflowInstanceId != 0){ - String tipoEsito = ControlloPraticaLocalServiceUtil.getTipoEsito(controlloPratica.getControlloPraticaId()); - out.print(tipoEsito); + if (workflowInstanceId != 0) { + String tipoEsito = ControlloPraticaLocalServiceUtil.getTipoEsito(controlloPratica.getControlloPraticaId()); + out.print(tipoEsito); } - %> - - <%-- - <% - /*boolean sorteggiata = SorteggioLocalServiceUtil.findByIntPratica(intPratica.getIntPraticaId())!=null; - String clazz = StringPool.BLANK; - if(sorteggiata){ - out.print(""); - }*/ - %> - --%> - <% - DettPratica lastDettPratica = DettPraticaLocalServiceUtil.getLastCompletedByIntPratica(intPratica.getIntPraticaId()); if(lastDettPratica != null){ long lastDettPraticaId = lastDettPratica.getDettPraticaId(); @@ -199,9 +193,9 @@ IntPratica intPratica = IntPraticaLocalServiceUtil.fetchIntPratica(controlloPrat Date now = new Date(); long diff = now.getTime() - data.getTime(); - long days = TimeUnit.DAYS.convert(diff, TimeUnit.MILLISECONDS); + long days = TimeUnit.DAYS.convert(diff, TimeUnit.MILLISECONDS); %> - <%=days %> + <%= days %> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/lib/commons-logging.jar b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/lib/commons-logging.jar new file mode 100644 index 00000000..8758a96b Binary files /dev/null and b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/lib/commons-logging.jar differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/lib/log4j.jar b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/lib/log4j.jar new file mode 100644 index 00000000..068867eb Binary files /dev/null and b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/lib/log4j.jar differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/lib/util-bridges.jar b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/lib/util-bridges.jar new file mode 100644 index 00000000..7d7435fe Binary files /dev/null and b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/lib/util-bridges.jar differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/lib/util-java.jar b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/lib/util-java.jar new file mode 100644 index 00000000..6b5d95f8 Binary files /dev/null and b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/lib/util-java.jar differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/lib/util-taglib.jar b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/lib/util-taglib.jar new file mode 100644 index 00000000..fbba5f0a Binary files /dev/null and b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/lib/util-taglib.jar differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/liferay-plugin-package.properties b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/liferay-plugin-package.properties index 6cf24d26..521baf2a 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/liferay-plugin-package.properties +++ b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/liferay-plugin-package.properties @@ -10,4 +10,5 @@ author=Liferay, Inc. licenses=LGPL liferay-versions=6.2.0+ required-deployment-contexts=\ - portos-bo-portlet + portos-bo-portlet,\ + portos-kaleo-web \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/controller/scheduler/SchedulerKaleoController.java b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/controller/scheduler/SchedulerKaleoController.java index b4e11705..724e54c1 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/controller/scheduler/SchedulerKaleoController.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/controller/scheduler/SchedulerKaleoController.java @@ -3,14 +3,6 @@ package it.tref.liferay.portos.kaleo.controller.scheduler; import it.tref.liferay.portos.bo.model.ControlloPratica; import it.tref.liferay.portos.bo.service.ControlloPraticaLocalServiceUtil; import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil; -import it.tref.liferay.portos.kaleo.controller.model.KaleoInstance; -import it.tref.liferay.portos.kaleo.controller.model.KaleoInstanceToken; -import it.tref.liferay.portos.kaleo.controller.model.KaleoTaskAssignmentInstance; -import it.tref.liferay.portos.kaleo.controller.model.KaleoTaskInstanceToken; -import it.tref.liferay.portos.kaleo.controller.service.KaleoInstanceLocalServiceUtil; -import it.tref.liferay.portos.kaleo.controller.service.KaleoInstanceTokenLocalServiceUtil; -import it.tref.liferay.portos.kaleo.controller.service.KaleoTaskAssignmentInstanceLocalServiceUtil; -import it.tref.liferay.portos.kaleo.controller.service.KaleoTaskInstanceTokenLocalServiceUtil; import java.io.Serializable; import java.util.ArrayList; @@ -26,7 +18,6 @@ import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil; import com.liferay.portal.kernel.dao.orm.Order; import com.liferay.portal.kernel.dao.orm.OrderFactoryUtil; import com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil; -import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.kernel.log.Log; import com.liferay.portal.kernel.log.LogFactoryUtil; import com.liferay.portal.kernel.messaging.Message; @@ -36,165 +27,95 @@ import com.liferay.portal.kernel.workflow.WorkflowInstance; import com.liferay.portal.kernel.workflow.WorkflowInstanceManagerUtil; import com.liferay.portal.model.User; - public class SchedulerKaleoController implements MessageListener { private static final Log _log = LogFactoryUtil.getLog(SchedulerKaleoController.class); - + private static final Lock lock = new ReentrantLock(); - + @Override public void receive(Message message) throws MessageListenerException { - if (lock.tryLock()) { try { - - //Riparazione pratiche con workflow sporco - //riparaLifecycleWorkflow(); + // Riparazione pratiche con workflow sporco riparaLifecycleWorkflowNew(); - } catch (Exception e) { - _log.error(e,e); - }finally{ + _log.error(e, e); + } finally { lock.unlock(); } } } - - /*private void riparaLifecycleWorkflow() throws SystemException{ - - List lista = IntPraticaLocalServiceUtil.riparaWorkflow(); - for (Object[] objs : lista) { - long kaleotaskinstancetokenid = Long.parseLong(String.valueOf(objs[0])); - long kaleoinstancetokenid = Long.parseLong(String.valueOf(objs[1])); - long controllopraticaid = Long.parseLong(String.valueOf(objs[2])); - long statusbyuserid = Long.parseLong(String.valueOf(objs[3])); - - - ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil.fetchControlloPratica(controllopraticaid); - - DynamicQuery queryKIT = DynamicQueryFactoryUtil.forClass(KaleoTaskInstanceToken.class); - queryKIT.add(RestrictionsFactoryUtil.eq("classPK", controllopraticaid)); - Order defaultOrderDettPrtatica = OrderFactoryUtil.asc("createDate"); - queryKIT.addOrder(defaultOrderDettPrtatica); - - List listas = KaleoTaskInstanceTokenLocalServiceUtil.dynamicQuery(queryKIT); - if(listas != null && !listas.isEmpty()){ - KaleoTaskInstanceToken ktit = listas.get(0); - - DynamicQuery queryKAT = DynamicQueryFactoryUtil.forClass(KaleoTaskAssignmentInstance.class); - queryKAT.add(RestrictionsFactoryUtil.eq("kaleoTaskInstanceTokenId", ktit.getKaleoTaskInstanceTokenId())); - - List listass = KaleoTaskAssignmentInstanceLocalServiceUtil.dynamicQuery(queryKAT); - if(listass != null && !listass.isEmpty()){ - - KaleoTaskAssignmentInstance assignmentInstanceApp = listass.get(0); - - long kaleoTaskAssignementInstanceId = assignmentInstanceApp.getKaleoTaskAssignmentInstanceId() + 1; -// long kaleoTaskAssignementInstanceId = KaleoTaskAssignmentInstanceLocalServiceUtil.getLastKaleoTaskAssignmentInstanceId(); -// KaleoTaskAssignmentInstance app = KaleoTaskAssignmentInstanceLocalServiceUtil.fetchKaleoTaskAssignmentInstance(kaleoTaskAssignementInstanceId); -// if(app != null){ -// kaleoTaskAssignementInstanceId = KaleoTaskAssignmentInstanceLocalServiceUtil.getLastKaleoTaskAssignmentInstanceId(); -// } - - KaleoTaskAssignmentInstance assignmentInstance = KaleoTaskAssignmentInstanceLocalServiceUtil.createKaleoTaskAssignmentInstance( - kaleoTaskAssignementInstanceId); - - assignmentInstance.setCreateDate(assignmentInstanceApp.getCreateDate()); - assignmentInstance.setModifiedDate(assignmentInstanceApp.getModifiedDate()); - assignmentInstance.setModifiedDate(assignmentInstanceApp.getModifiedDate()); - assignmentInstance.setGroupId(assignmentInstanceApp.getGroupId()); - assignmentInstance.setCompanyId(assignmentInstanceApp.getCompanyId()); - assignmentInstance.setUserId(assignmentInstanceApp.getUserId()); - assignmentInstance.setUserName(assignmentInstanceApp.getUserName()); - assignmentInstance.setKaleoDefinitionId(assignmentInstanceApp.getKaleoDefinitionId()); - assignmentInstance.setKaleoInstanceId(assignmentInstanceApp.getKaleoInstanceId()); - assignmentInstance.setKaleoInstanceTokenId(kaleoinstancetokenid); - assignmentInstance.setKaleoTaskInstanceTokenId(kaleotaskinstancetokenid); - assignmentInstance.setKaleoTaskId(21642L); - assignmentInstance.setKaleoTaskName("Esito"); - assignmentInstance.setAssigneeClassName(User.class.getName()); - assignmentInstance.setAssigneeClassPK(statusbyuserid); - assignmentInstance.setCompleted(false); - - KaleoTaskAssignmentInstanceLocalServiceUtil.updateKaleoTaskAssignmentInstance(assignmentInstance); - - if(controlloPratica != null){ - _log.debug("Pulisco Workflow ed indicizzo per intPraticaId=" + controlloPratica.getIntPraticaId()); - IntPraticaLocalServiceUtil.reIndexFasciolo(controlloPratica.getIntPraticaId(), controlloPratica.getCompanyId()); - } - - } - - } - - } - } - */ - + /** * ADT - * @throws Exception - * - * - * */ - private void riparaLifecycleWorkflowNew() throws Exception { - List listaKO=new ArrayList(); + private void riparaLifecycleWorkflowNew() throws Exception { + List listaKO = new ArrayList(); List lista = IntPraticaLocalServiceUtil.riparaWorkflow(); for (Object[] objs : lista) { long kaleotaskinstancetokenid = Long.parseLong(String.valueOf(objs[0])); long kaleoinstancetokenid = Long.parseLong(String.valueOf(objs[1])); - long controllopraticaid = (objs[2]!=null)? Long.parseLong(String.valueOf(objs[2])):0; + long controllopraticaid = (objs[2] != null) ? Long.parseLong(String.valueOf(objs[2])) : 0; long statusbyuserid = Long.parseLong(String.valueOf(objs[3])); - _log.info("RIPARA_WORKFLOW inizio lavorazione -- controllopraticaid="+controllopraticaid+" statusbyuserid="+statusbyuserid+" kaleoinstancetokenid="+kaleoinstancetokenid+" --kaleotaskinstancetokenid="+kaleotaskinstancetokenid); - - if (controllopraticaid==0){ - _log.info("RIPARA_WORKFLOW KO controllopraticaid non valorizzato ="+controllopraticaid); + _log.info("RIPARA_WORKFLOW inizio lavorazione -- controllopraticaid=" + controllopraticaid + + " statusbyuserid=" + statusbyuserid + " kaleoinstancetokenid=" + kaleoinstancetokenid + + " --kaleotaskinstancetokenid=" + kaleotaskinstancetokenid); + + if (controllopraticaid == 0) { + _log.info("RIPARA_WORKFLOW KO controllopraticaid non valorizzato =" + controllopraticaid); continue; } - try{ - ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil.fetchControlloPratica(controllopraticaid); + try { + ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil + .fetchControlloPratica(controllopraticaid); DynamicQuery queryKIT = DynamicQueryFactoryUtil.forClass(KaleoTaskInstanceToken.class); queryKIT.add(RestrictionsFactoryUtil.eq("classPK", controllopraticaid)); Order defaultOrderDettPrtatica = OrderFactoryUtil.asc("createDate"); queryKIT.addOrder(defaultOrderDettPrtatica); - + List listas = KaleoTaskInstanceTokenLocalServiceUtil.dynamicQuery(queryKIT); - if(listas != null && !listas.isEmpty()){ - KaleoTaskInstanceToken ktit =null; - - for (KaleoTaskInstanceToken k:listas){ - if (k.getKaleoTaskName().equalsIgnoreCase("Assegnazione")){ - ktit=k; + if (listas != null && !listas.isEmpty()) { + KaleoTaskInstanceToken ktit = null; + + for (KaleoTaskInstanceToken k : listas) { + if (k.getKaleoTaskName().equalsIgnoreCase("Assegnazione")) { + ktit = k; break; } } - if (ktit!=null){ - WorkflowInstance wfInstance=WorkflowInstanceManagerUtil.getWorkflowInstance(controlloPratica.getCompanyId(), ktit.getKaleoInstanceId()); - Serializable wfVariante=wfInstance.getWorkflowContext().get("wf_variante"); - boolean isVariante=false; - if (wfVariante!=null){ - isVariante=(wfVariante!=null&&wfVariante.toString().length()>0); + if (ktit != null) { + WorkflowInstance wfInstance = WorkflowInstanceManagerUtil.getWorkflowInstance( + controlloPratica.getCompanyId(), ktit.getKaleoInstanceId()); + Serializable wfVariante = wfInstance.getWorkflowContext().get("wf_variante"); + boolean isVariante = false; + if (wfVariante != null) { + isVariante = (wfVariante != null && wfVariante.toString().length() > 0); } - _log.info("RIPARA_WORKFLOW isVariante="+isVariante+" per controllopraticaid="+controllopraticaid); - _log.info("RIPARA_WORKFLOW KaleoTaskInstanceTokenId="+ktit.getKaleoTaskInstanceTokenId()+" --controllopraticaid="+controllopraticaid); - + _log.info("RIPARA_WORKFLOW isVariante=" + isVariante + " per controllopraticaid=" + + controllopraticaid); + _log.info("RIPARA_WORKFLOW KaleoTaskInstanceTokenId=" + ktit.getKaleoTaskInstanceTokenId() + + " --controllopraticaid=" + controllopraticaid); + DynamicQuery queryKAT = DynamicQueryFactoryUtil.forClass(KaleoTaskAssignmentInstance.class); - queryKAT.add(RestrictionsFactoryUtil.eq("kaleoTaskInstanceTokenId", ktit.getKaleoTaskInstanceTokenId())); - - List listass = KaleoTaskAssignmentInstanceLocalServiceUtil.dynamicQuery(queryKAT); - _log.info("size lista KaleoTaskAssignmentInstance per kaleoTaskInstanceTokenId="+ ktit.getKaleoTaskInstanceTokenId()+" :"+listass.size()); - //for (KaleoTaskAssignmentInstance x:listass){ - // _log.info("KaleoTaskAssignmentInstanceId="+x.getKaleoTaskAssignmentInstanceId()+" -- KaleoTaskName:"+x.getKaleoTaskName()); - //} - if(listass != null && !listass.isEmpty()){ - //creazione record assente sulla tabella KaleoTaskAssignmentInstance - KaleoTaskAssignmentInstance assignmentInstanceApp = listass.get(0); - long kaleoTaskAssignementInstanceId = CounterLocalServiceUtil.increment("com.liferay.counter.model.Counter"); - KaleoTaskAssignmentInstance assignmentInstance = KaleoTaskAssignmentInstanceLocalServiceUtil.createKaleoTaskAssignmentInstance( - kaleoTaskAssignementInstanceId); - + queryKAT.add(RestrictionsFactoryUtil.eq("kaleoTaskInstanceTokenId", + ktit.getKaleoTaskInstanceTokenId())); + + List listass = KaleoTaskAssignmentInstanceLocalServiceUtil + .dynamicQuery(queryKAT); + _log.info("size lista KaleoTaskAssignmentInstance per kaleoTaskInstanceTokenId=" + + ktit.getKaleoTaskInstanceTokenId() + " :" + listass.size()); + // for (KaleoTaskAssignmentInstance x:listass){ + // _log.info("KaleoTaskAssignmentInstanceId="+x.getKaleoTaskAssignmentInstanceId()+" -- KaleoTaskName:"+x.getKaleoTaskName()); + // } + if (listass != null && !listass.isEmpty()) { + // creazione record assente sulla tabella KaleoTaskAssignmentInstance + KaleoTaskAssignmentInstance assignmentInstanceApp = listass.get(0); + long kaleoTaskAssignementInstanceId = CounterLocalServiceUtil + .increment("com.liferay.counter.model.Counter"); + KaleoTaskAssignmentInstance assignmentInstance = KaleoTaskAssignmentInstanceLocalServiceUtil + .createKaleoTaskAssignmentInstance(kaleoTaskAssignementInstanceId); + assignmentInstance.setCreateDate(assignmentInstanceApp.getCreateDate()); assignmentInstance.setModifiedDate(assignmentInstanceApp.getModifiedDate()); assignmentInstance.setModifiedDate(assignmentInstanceApp.getModifiedDate()); @@ -211,111 +132,132 @@ public class SchedulerKaleoController implements MessageListener { assignmentInstance.setAssigneeClassName(User.class.getName()); assignmentInstance.setAssigneeClassPK(statusbyuserid); assignmentInstance.setCompleted(false); - - KaleoTaskAssignmentInstanceLocalServiceUtil.updateKaleoTaskAssignmentInstance(assignmentInstance); - - //////////////////////////////////////////////////////////////////////////////// - //patch per tener contro anche delle varianti create da applicativo portos2: forzo lo stato del WF a ESITO - long kaleoInstanceId=assignmentInstanceApp.getKaleoInstanceId(); - KaleoInstance kaleoInstance = KaleoInstanceLocalServiceUtil.getKaleoInstance(kaleoInstanceId); - - long rootKaleoInstanceTokenId=kaleoInstance.getRootKaleoInstanceTokenId(); - - KaleoInstanceToken rootKaleoInstanceToken = KaleoInstanceTokenLocalServiceUtil.getKaleoInstanceToken(rootKaleoInstanceTokenId); - - _log.info("rootKaleoInstanceToken="+rootKaleoInstanceToken.getCurrentKaleoNodeName()); - rootKaleoInstanceToken.setCurrentKaleoNodeId(21639); - rootKaleoInstanceToken.setCurrentKaleoNodeName("Esito"); - KaleoInstanceTokenLocalServiceUtil.updateKaleoInstanceToken(rootKaleoInstanceToken); - //////////////////// - - //task di assegnazione viene inserito a completato: - if (!assignmentInstanceApp.isCompleted()){ - assignmentInstanceApp.setCompleted(true); - assignmentInstanceApp.setCompletionDate(new Date()); - KaleoTaskAssignmentInstanceLocalServiceUtil.updateKaleoTaskAssignmentInstance(assignmentInstanceApp); - } - //solo per le nuove varianti di PORTOS2 - if (isVariante){ - _log.info("cancellazione task di assegnazione per controllopraticaid="+controllopraticaid); - - KaleoTaskInstanceTokenLocalServiceUtil.deleteKaleoTaskInstanceToken(ktit); - KaleoTaskAssignmentInstanceLocalServiceUtil.deleteKaleoTaskAssignmentInstance(assignmentInstanceApp); - }else if (!ktit.isCompleted()){ - ktit.setCompleted(true); - ktit.setCompletionDate(new Date()); - KaleoTaskInstanceTokenLocalServiceUtil.updateKaleoTaskInstanceToken(ktit); - } - ////////////////////////////////////////////////////////////////////////////////// - - - if(controlloPratica != null){ - _log.info("RIPARA_WORKFLOW - Pulisco Workflow ed indicizzo per intPraticaId=" + controlloPratica.getIntPraticaId()); + + KaleoTaskAssignmentInstanceLocalServiceUtil + .updateKaleoTaskAssignmentInstance(assignmentInstance); + + // patch per tener contro anche delle varianti create da applicativo portos2: forzo lo stato + // del WF a ESITO + long kaleoInstanceId = assignmentInstanceApp.getKaleoInstanceId(); + KaleoInstance kaleoInstance = KaleoInstanceLocalServiceUtil + .getKaleoInstance(kaleoInstanceId); + + long rootKaleoInstanceTokenId = kaleoInstance.getRootKaleoInstanceTokenId(); + + KaleoInstanceToken rootKaleoInstanceToken = KaleoInstanceTokenLocalServiceUtil + .getKaleoInstanceToken(rootKaleoInstanceTokenId); + + _log.info("rootKaleoInstanceToken=" + rootKaleoInstanceToken.getCurrentKaleoNodeName()); + rootKaleoInstanceToken.setCurrentKaleoNodeId(21639); + rootKaleoInstanceToken.setCurrentKaleoNodeName("Esito"); + KaleoInstanceTokenLocalServiceUtil.updateKaleoInstanceToken(rootKaleoInstanceToken); + // ////////////////// + + // task di assegnazione viene inserito a completato: + if (!assignmentInstanceApp.isCompleted()) { + assignmentInstanceApp.setCompleted(true); + assignmentInstanceApp.setCompletionDate(new Date()); + KaleoTaskAssignmentInstanceLocalServiceUtil + .updateKaleoTaskAssignmentInstance(assignmentInstanceApp); + } + // solo per le nuove varianti di PORTOS2 + if (isVariante) { + _log.info("cancellazione task di assegnazione per controllopraticaid=" + + controllopraticaid); + + KaleoTaskInstanceTokenLocalServiceUtil.deleteKaleoTaskInstanceToken(ktit); + KaleoTaskAssignmentInstanceLocalServiceUtil + .deleteKaleoTaskAssignmentInstance(assignmentInstanceApp); + } else if (!ktit.isCompleted()) { + ktit.setCompleted(true); + ktit.setCompletionDate(new Date()); + KaleoTaskInstanceTokenLocalServiceUtil.updateKaleoTaskInstanceToken(ktit); + } + // //////////////////////////////////////////////////////////////////////////////// + + if (controlloPratica != null) { + _log.info("RIPARA_WORKFLOW - Pulisco Workflow ed indicizzo per intPraticaId=" + + controlloPratica.getIntPraticaId()); CacheRegistryUtil.clear(); - IntPraticaLocalServiceUtil.reIndexFasciolo(controlloPratica.getIntPraticaId(), controlloPratica.getCompanyId()); + IntPraticaLocalServiceUtil.reIndexFasciolo(controlloPratica.getIntPraticaId(), + controlloPratica.getCompanyId()); } - - } - _log.info("RIPARA_WORKFLOW fine lavorazione OK -- controllopraticaid="+controllopraticaid+" statusbyuserid="+statusbyuserid+" kaleoinstancetokenid="+kaleoinstancetokenid+" --kaleotaskinstancetokenid="+kaleotaskinstancetokenid); - }else{ - _log.info("RIPARA_WORKFLOW fine lavorazione KO --task assegnazione non trovato per controllopraticaid="+controllopraticaid+" statusbyuserid="+statusbyuserid+" kaleoinstancetokenid="+kaleoinstancetokenid+" --kaleotaskinstancetokenid="+kaleotaskinstancetokenid); + + } + _log.info("RIPARA_WORKFLOW fine lavorazione OK -- controllopraticaid=" + controllopraticaid + + " statusbyuserid=" + statusbyuserid + " kaleoinstancetokenid=" + kaleoinstancetokenid + + " --kaleotaskinstancetokenid=" + kaleotaskinstancetokenid); + } else { + _log.info("RIPARA_WORKFLOW fine lavorazione KO --task assegnazione non trovato per controllopraticaid=" + + controllopraticaid + + " statusbyuserid=" + + statusbyuserid + + " kaleoinstancetokenid=" + + kaleoinstancetokenid + " --kaleotaskinstancetokenid=" + kaleotaskinstancetokenid); listaKO.add(objs); - } + } } - - - }catch(Exception e){ - _log.error("Errore RIPARA_WORKFLOW -- controllopraticaid="+controllopraticaid+" statusbyuserid="+statusbyuserid+" kaleoinstancetokenid="+kaleoinstancetokenid+" --kaleotaskinstancetokenid="+kaleotaskinstancetokenid,e); - } - } - + + } catch (Exception e) { + _log.error("Errore RIPARA_WORKFLOW -- controllopraticaid=" + controllopraticaid + " statusbyuserid=" + + statusbyuserid + " kaleoinstancetokenid=" + kaleoinstancetokenid + + " --kaleotaskinstancetokenid=" + kaleotaskinstancetokenid, e); + } + } + patchTaskEsitiForWF(listaKO); - + } - - private void patchTaskEsitiForWF(List lista){ - + + private void patchTaskEsitiForWF(List lista) { + for (Object[] objs : lista) { long kaleotaskinstancetokenid = Long.parseLong(String.valueOf(objs[0])); long kaleoinstancetokenid = Long.parseLong(String.valueOf(objs[1])); - long controllopraticaid = (objs[2]!=null)? Long.parseLong(String.valueOf(objs[2])):0; + long controllopraticaid = (objs[2] != null) ? Long.parseLong(String.valueOf(objs[2])) : 0; long statusbyuserid = Long.parseLong(String.valueOf(objs[3])); - try{ - if (controllopraticaid==0){ + try { + if (controllopraticaid == 0) { continue; } - - ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil.fetchControlloPratica(controllopraticaid); - if (controlloPratica==null) + + ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil + .fetchControlloPratica(controllopraticaid); + if (controlloPratica == null) continue; - - //KaleoTaskInstanceToken ordinati per dati di creazione decresente + + // KaleoTaskInstanceToken ordinati per dati di creazione decresente DynamicQuery queryKIT = DynamicQueryFactoryUtil.forClass(KaleoTaskInstanceToken.class); queryKIT.add(RestrictionsFactoryUtil.eq("classPK", controllopraticaid)); queryKIT.add(RestrictionsFactoryUtil.eq("kaleoTaskName", "Esito")); queryKIT.add(RestrictionsFactoryUtil.eq("completed", false)); Order defaultOrderDettPrtatica = OrderFactoryUtil.desc("createDate"); - queryKIT.addOrder(defaultOrderDettPrtatica); + queryKIT.addOrder(defaultOrderDettPrtatica); List listas = KaleoTaskInstanceTokenLocalServiceUtil.dynamicQuery(queryKIT); - - - if(listas != null && !listas.isEmpty()){ - KaleoTaskInstanceToken ktit =null; - - for (KaleoTaskInstanceToken k:listas){ - if (k.getKaleoTaskName().equalsIgnoreCase("Esito")){ - ktit=k; - _log.info("patchTaskEsitiForWF - task esito senza assegnazione controlloPraticaid = "+controllopraticaid+" - KaleoTaskInstanceTokenId= " +k.getKaleoTaskInstanceTokenId()+" -KaleoTaskId="+k.getKaleoTaskId()+" -statusbyuserid="+statusbyuserid); + + if (listas != null && !listas.isEmpty()) { + KaleoTaskInstanceToken ktit = null; + + for (KaleoTaskInstanceToken k : listas) { + if (k.getKaleoTaskName().equalsIgnoreCase("Esito")) { + ktit = k; + _log.info("patchTaskEsitiForWF - task esito senza assegnazione controlloPraticaid = " + + controllopraticaid + " - KaleoTaskInstanceTokenId= " + + k.getKaleoTaskInstanceTokenId() + " -KaleoTaskId=" + k.getKaleoTaskId() + + " -statusbyuserid=" + statusbyuserid); break; } } - if (ktit!=null){ - //WorkflowInstance wfInstance=WorkflowInstanceManagerUtil.getWorkflowInstance(controlloPratica.getCompanyId(), ktit.getKaleoInstanceId()); - - long kaleoTaskAssignementInstanceId = CounterLocalServiceUtil.increment("com.liferay.counter.model.Counter"); - KaleoTaskAssignmentInstance assignmentInstance = KaleoTaskAssignmentInstanceLocalServiceUtil.createKaleoTaskAssignmentInstance( - kaleoTaskAssignementInstanceId); - + if (ktit != null) { + // WorkflowInstance + // wfInstance=WorkflowInstanceManagerUtil.getWorkflowInstance(controlloPratica.getCompanyId(), + // ktit.getKaleoInstanceId()); + + long kaleoTaskAssignementInstanceId = CounterLocalServiceUtil + .increment("com.liferay.counter.model.Counter"); + KaleoTaskAssignmentInstance assignmentInstance = KaleoTaskAssignmentInstanceLocalServiceUtil + .createKaleoTaskAssignmentInstance(kaleoTaskAssignementInstanceId); + assignmentInstance.setCreateDate(ktit.getCreateDate()); assignmentInstance.setModifiedDate(ktit.getModifiedDate()); assignmentInstance.setModifiedDate(ktit.getModifiedDate()); @@ -332,26 +274,37 @@ public class SchedulerKaleoController implements MessageListener { assignmentInstance.setAssigneeClassName(User.class.getName()); assignmentInstance.setAssigneeClassPK(statusbyuserid); assignmentInstance.setCompleted(false); - - KaleoTaskAssignmentInstanceLocalServiceUtil.updateKaleoTaskAssignmentInstance(assignmentInstance); - - if(controlloPratica != null){ + + KaleoTaskAssignmentInstanceLocalServiceUtil + .updateKaleoTaskAssignmentInstance(assignmentInstance); + + if (controlloPratica != null) { CacheRegistryUtil.clear(); - IntPraticaLocalServiceUtil.reIndexFasciolo(controlloPratica.getIntPraticaId(), controlloPratica.getCompanyId()); + IntPraticaLocalServiceUtil.reIndexFasciolo(controlloPratica.getIntPraticaId(), + controlloPratica.getCompanyId()); } - - _log.info("patchTaskEsitiForWF fine lavorazione OK -- controllopraticaid="+controllopraticaid+" statusbyuserid="+statusbyuserid+" kaleoinstancetokenid="+kaleoinstancetokenid+" --kaleotaskinstancetokenid="+kaleotaskinstancetokenid); - }else{ - _log.info("patchTaskEsitiForWF fine lavorazione KO --task esito non trovato per controllopraticaid="+controllopraticaid+" statusbyuserid="+statusbyuserid+" kaleoinstancetokenid="+kaleoinstancetokenid+" --kaleotaskinstancetokenid="+kaleotaskinstancetokenid); - - } + + _log.info("patchTaskEsitiForWF fine lavorazione OK -- controllopraticaid=" + controllopraticaid + + " statusbyuserid=" + statusbyuserid + " kaleoinstancetokenid=" + kaleoinstancetokenid + + " --kaleotaskinstancetokenid=" + kaleotaskinstancetokenid); + } else { + _log.info("patchTaskEsitiForWF fine lavorazione KO --task esito non trovato per controllopraticaid=" + + controllopraticaid + + " statusbyuserid=" + + statusbyuserid + + " kaleoinstancetokenid=" + + kaleoinstancetokenid + " --kaleotaskinstancetokenid=" + kaleotaskinstancetokenid); + + } } - - }catch(Exception e){ - _log.error("Errore patchTaskEsitiForWF -- controllopraticaid="+controllopraticaid+" statusbyuserid="+statusbyuserid+" kaleoinstancetokenid="+kaleoinstancetokenid+" --kaleotaskinstancetokenid="+kaleotaskinstancetokenid,e); + + } catch (Exception e) { + _log.error("Errore patchTaskEsitiForWF -- controllopraticaid=" + controllopraticaid + + " statusbyuserid=" + statusbyuserid + " kaleoinstancetokenid=" + kaleoinstancetokenid + + " --kaleotaskinstancetokenid=" + kaleotaskinstancetokenid, e); } - - } + + } } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/src/service.properties b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/src/service.properties index cace6c4a..7dc4c86d 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/src/service.properties +++ b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/src/service.properties @@ -13,8 +13,8 @@ ## build.namespace=portos_kaleo_controller - build.number=6 - build.date=1574151325177 + build.number=8 + build.date=1616412878684 build.auto.upgrade=true ## diff --git a/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/StatoPraticaConstants.java b/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/StatoPraticaConstants.java index bdfc6457..dbae2be9 100644 --- a/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/StatoPraticaConstants.java +++ b/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/StatoPraticaConstants.java @@ -32,7 +32,6 @@ public class StatoPraticaConstants { public static final String CAMBIO_ISTRUTTORE = "CI"; public static final String NON_AUTORIZZATA = "AN"; public static final String VARIAZIONE_SOGGETTI = "VS"; - public static final String VIARCH = "IA"; /* * Probabilmente non è il posto più corretto, però si usa dovunque lo stato della pratica per impostare tipo avviso, diff --git a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_instances/workflow_logs.jspf b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_instances/workflow_logs.jspf index 8a372bc5..7b6a4edb 100644 --- a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_instances/workflow_logs.jspf +++ b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_instances/workflow_logs.jspf @@ -1,242 +1,202 @@ <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%-- -/** - * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. - */ ---%> +Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. +This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later +version. +This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied +warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more +details. +--%> <%@page import="com.liferay.portal.kernel.json.JSONException"%> -<%@page import="com.liferay.portal.kernel.util.Validator"%> <%@page import="com.liferay.portal.kernel.json.JSONFactoryUtil"%> <%@page import="com.liferay.portal.kernel.json.JSONObject"%> <%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%> - - - -> +<%@page import="com.liferay.portal.kernel.util.HtmlUtil"%> +<%@page import="com.liferay.portal.kernel.util.StringPool"%> +<%@page import="com.liferay.portal.kernel.util.StringUtil"%> +<%@page import="com.liferay.portal.kernel.util.Validator"%> +<%@page import="com.liferay.portal.kernel.workflow.WorkflowLog"%> +<%@page import="com.liferay.portal.model.Role"%> +<%@page import="com.liferay.portal.model.User"%> +<%@page import="com.liferay.portal.service.RoleLocalServiceUtil"%> +<%@page import="com.liferay.portal.service.UserLocalServiceUtil"%> +<%@page import="com.liferay.portal.util.PortalUtil"%> +<%@page import="java.util.Map"%> +
- + -<% - -//ADT: bug bo id=33 -Map historyWorkflowEsitiLogs = (Map)request.getAttribute("historyWorkflowEsitiLogs"); - -for (WorkflowLog workflowLog : workflowLogs) { - Role curRole = null; - User curUser = null; - String actorName = null; - - if (workflowLog.getRoleId() != 0) { - curRole = RoleLocalServiceUtil.getRole(workflowLog.getRoleId()); - actorName = curRole.getDescriptiveName(); - } - else if (workflowLog.getUserId() != 0) { - curUser = UserLocalServiceUtil.getUser(workflowLog.getUserId()); - actorName = curUser.getFullName(); - } - String kaleoNodeName = null; - String transitionName = null; - - try { - JSONObject jsonObject = JSONFactoryUtil.createJSONObject(workflowLog.getState()); - kaleoNodeName = jsonObject.getString("kaleoNodeName"); - transitionName = jsonObject.getString("transitionName"); - } catch (JSONException e) { - kaleoNodeName = workflowLog.getState(); - } - -%> - - - - + <% + @SuppressWarnings("unchecked") + Map historyWorkflowEsitiLogs = (Map) request.getAttribute("historyWorkflowEsitiLogs"); + for (WorkflowLog workflowLog : workflowLogs) { + Role curRole = null; + User curUser = null; + String actorName = null; + if (workflowLog.getRoleId() != 0) { + curRole = RoleLocalServiceUtil.getRole(workflowLog.getRoleId()); + actorName = HtmlUtil.escape(curRole.getDescriptiveName()); + } + else if (workflowLog.getUserId() != 0) { + curUser = UserLocalServiceUtil.getUser(workflowLog.getUserId()); + actorName = HtmlUtil.escape(curUser.getFullName()); + } + String kaleoNodeName = null; + String transitionName = null; + try { + JSONObject jsonObject = JSONFactoryUtil.createJSONObject(workflowLog.getState()); + kaleoNodeName = jsonObject.getString("kaleoNodeName"); + transitionName = jsonObject.getString("transitionName"); + } catch (JSONException e) { + kaleoNodeName = workflowLog.getState(); + } + %> - - + - + - - - - - - - - - <%--
- - - - -
- -
-
--%> - -<% -} -%> - + + + + <% + } + %> +
Data Descrizione Attività Commento
- <%= dateFormatDateTime.format(workflowLog.getCreateDate()) %> - + <%= dateFormatDateTime.format(workflowLog.getCreateDate()) %> -
- + <% - //ADT: bug bo id=33 - String esito = (String)request.getAttribute("registra-esito-value"); - if (historyWorkflowEsitiLogs!=null&& historyWorkflowEsitiLogs.containsKey(workflowLog.getWorkflowLogId()) ){ - esito=historyWorkflowEsitiLogs.get(workflowLog.getWorkflowLogId()); - } + String esito = (String)request.getAttribute("registra-esito-value"); + if (historyWorkflowEsitiLogs != null && historyWorkflowEsitiLogs.containsKey( + workflowLog.getWorkflowLogId())) { + esito=historyWorkflowEsitiLogs.get(workflowLog.getWorkflowLogId()); + } %> - + <% - String assegna = (String)request.getAttribute("assegna-value"); + String assegna = (String) request.getAttribute("assegna-value"); %> - + - - - + + - - + -   - - - +
- +
- +
- +
- <% if (curRole == null) { String assignerName = PortalUtil.getUserName(workflowLog.getAuditUserId(), StringPool.BLANK); %> -
- - + - +
- <% - } - else { + } else { %> -
- +
- <% } %> -
-
- <% - if(Validator.isNotNull(kaleoNodeName)){ - out.print(kaleoNodeName); - if(Validator.isNotNull(transitionName)){ - if("registra-esito".equalsIgnoreCase(transitionName)){ - //out.print(" ( " + (String)request.getAttribute("registra-esito-value") + " ) "); - //ADT BUG BO ID=33 - String esito = (String)request.getAttribute("registra-esito-value"); - if (historyWorkflowEsitiLogs!=null&& historyWorkflowEsitiLogs.containsKey(workflowLog.getWorkflowLogId()) ){ - esito=historyWorkflowEsitiLogs.get(workflowLog.getWorkflowLogId()); + + <% + if (Validator.isNotNull(kaleoNodeName)) { + out.print(kaleoNodeName); + if (Validator.isNotNull(transitionName)) { + if ("registra-esito".equalsIgnoreCase(transitionName)) { + String esito = (String) request.getAttribute("registra-esito-value"); + if (historyWorkflowEsitiLogs != null && historyWorkflowEsitiLogs.containsKey(workflowLog + .getWorkflowLogId())) { + esito = historyWorkflowEsitiLogs.get(workflowLog.getWorkflowLogId()); } out.print(" ( " + esito + " ) "); - - - } else if("assegna".equalsIgnoreCase(transitionName)){ - out.print(" ( " + (String)request.getAttribute("assegna-value") + " ) "); - } - + } else if ("assegna".equalsIgnoreCase(transitionName)) { + out.print(" ( " + (String)request.getAttribute("assegna-value") + " ) "); } } + } %> - - - -
-
-

<%= dateFormatDateTime.format(workflowLog.getCreateDate()) %>

-

- - <%= curUser.getFullName() %> - -

-
-
- <%= HtmlUtil.escape(workflowLog.getComment()) %> -
-
-
- -
+ +
+
+

<%= dateFormatDateTime.format(workflowLog.getCreateDate()) %>

+

+ + <%= curUser.getFullName() %> + +

+
+
+ <%= HtmlUtil.escape(workflowLog.getComment()) %> +
+
+
+
- - - \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_tasks/render_form_task.jsp b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_tasks/render_form_task.jsp index cc1c767a..48c59cc2 100644 --- a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_tasks/render_form_task.jsp +++ b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_tasks/render_form_task.jsp @@ -68,11 +68,11 @@ for (Entry>> entry : fieldNameOptions.ent String select = match.replaceAll("(?s)([?>]*>).*", "$1\n"); for (Map option : entry.getValue()) { String value = option.get("value").toString(); - select += "\n"; } html = html.replaceAll(regexSelect, "$1" + select + "\n" + "$3"); } else { @@ -89,7 +89,7 @@ for (Entry>> entry : fieldNameOptions.ent } } } -html = html.replaceAll("name=\"" + ns + "(.*?)_INSTANCE_[^\"]+\"", "name=\"" + prefix + "$1" + suffix + "\""); +html = html.replaceAll("name=\"" + ns + "(.*?)_INSTANCE_[^\"]+\"", "name=\"" + prefix + "$1" + suffix + StringPool.QUOTE); html = html.replace("name=\"" + ns + "_fieldsDisplay\"", "name=\"_fieldsDisplay\""); for (Entry p : parameters.entrySet()) { html = html.replaceAll("(]*>[^<]*)", @@ -97,6 +97,6 @@ for (Entry p : parameters.entrySet()) { } // Rimozione valori non utilizzati html = html.replaceAll("(?s)]*?value=\"Value[0-9]\"[^>]*>.*?", ""); -html = html.replaceAll("(?s)]*>[ \t\r\n]*", ""); +html = html.replaceAll("(?s)]*>[ \t\r\n]*", StringPool.BLANK); %> <%= html %> \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/hook/struts/EditWorkflowTaskAction.java b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/hook/struts/EditWorkflowTaskAction.java index cd4d8c53..ed84495a 100644 --- a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/hook/struts/EditWorkflowTaskAction.java +++ b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/hook/struts/EditWorkflowTaskAction.java @@ -90,6 +90,7 @@ import com.liferay.portal.workflow.kaleo.service.KaleoTaskInstanceTokenLocalServ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { private final static Log _log = LogFactoryUtil.getLog(EditWorkflowTaskAction.class); + @SuppressWarnings("serial") private final static List valoriAmmessi = new ArrayList() { { @@ -99,7 +100,16 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { add(StatoPraticaConstants.NON_CONFORME); add(StatoPraticaConstants.NO_PARERE); add(StatoPraticaConstants.PREAVVISO_CONTRARIO); - add(StatoPraticaConstants.VIARCH); + } + }; + + @SuppressWarnings("serial") + private static final List logTypes = new ArrayList() { + { + add(WorkflowLog.TASK_ASSIGN); + add(WorkflowLog.TASK_COMPLETION); + add(WorkflowLog.TASK_UPDATE); + add(WorkflowLog.TRANSITION); } }; @@ -144,12 +154,9 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { protected void assignTask(ActionRequest actionRequest) throws Exception { ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); - long workflowTaskId = ParamUtil.getLong(actionRequest, "workflowTaskId"); - long assigneeUserId = ParamUtil.getLong(actionRequest, "assigneeUserId"); String comment = ParamUtil.getString(actionRequest, "comment"); - WorkflowTaskManagerUtil.assignWorkflowTaskToUser(themeDisplay.getCompanyId(), themeDisplay.getUserId(), workflowTaskId, assigneeUserId, comment, null, null); } @@ -164,17 +171,13 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { // ADT: bug mancata problema assegnazione WF checkPresenzaIstruttore(transitionName, workflowTaskId); // ADT: BUG ANOMALIA REGISTRA ESITO - _log.info("transitionName = " + transitionName); if (transitionName.equalsIgnoreCase("registra-esito")) { HttpServletRequest httpServletRequest = PortalUtil.getOriginalServletRequest(PortalUtil .getHttpServletRequest(actionRequest)); String esito = httpServletRequest.getParameter("kaleo--esito--") != null ? httpServletRequest.getParameter( - "kaleo--esito--").trim() : ""; + "kaleo--esito--").trim() : StringPool.BLANK; String testoDocumento = httpServletRequest.getParameter("kaleo--testo_del_documento--") != null ? httpServletRequest - .getParameter("kaleo--testo_del_documento--") : ""; - if (esito.equals(StatoPraticaConstants.VIARCH)) { - aggiorna = false; - } + .getParameter("kaleo--testo_del_documento--") : StringPool.BLANK; if (!valoriAmmessi.contains(esito) || ((esito.equalsIgnoreCase(StatoPraticaConstants.INTEGRAZIONE) || esito .equalsIgnoreCase(StatoPraticaConstants.PREAVVISO_CONTRARIO)) && testoDocumento.isEmpty())) { @@ -200,7 +203,6 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { long companyId = controllo.getCompanyId(); long roleId = RoleLocalServiceUtil.getRole(companyId, "portos_assegnatore").getRoleId(); int uo = Integer.parseInt(istruttore.substring(6)); - WorkflowTaskManagerUtil.assignWorkflowTaskToRole(companyId, themeDisplay.getUserId(), workflowTaskId, roleId, "Trasferito all'UO " + uo + " per assegnazione all'istruttore.\n" + comment, null, WorkflowUtil.getWorkflowContext(controllo)); @@ -218,8 +220,8 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { } protected void removeUO(ActionRequest actionRequest) throws PortalException, SystemException { - ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); + ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); long workflowTaskId = ParamUtil.getLong(actionRequest, "workflowTaskId"); String comment = ParamUtil.getString(actionRequest, "comment"); ControlloPratica controllo = WorkflowUtil.getControlloPratica(workflowTaskId); @@ -228,7 +230,6 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { long userId = themeDisplay.getUserId(); Map workflowContext = WorkflowUtil.getWorkflowContext(controllo); long roleId = RoleLocalServiceUtil.getRole(companyId, "portos_assegnatore").getRoleId(); - WorkflowTaskManagerUtil.assignWorkflowTaskToUser(companyId, userId, workflowTaskId, userId, StringPool.BLANK, null, workflowContext); WorkflowTaskManagerUtil @@ -241,12 +242,9 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { protected void relaseTask(ActionRequest actionRequest) throws Exception { ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); - long workflowTaskId = ParamUtil.getLong(actionRequest, "workflowTaskId"); - long assigneeUserId = ParamUtil.getLong(actionRequest, "assigneeUserId"); String comment = ParamUtil.getString(actionRequest, "comment"); - WorkflowTaskManagerUtil.assignWorkflowTaskToRole(themeDisplay.getCompanyId(), assigneeUserId, workflowTaskId, 0L, comment, null, null); } @@ -259,25 +257,19 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { protected void updateTask(ActionRequest actionRequest) throws Exception { ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); - long workflowTaskId = ParamUtil.getLong(actionRequest, "workflowTaskId"); - String comment = ParamUtil.getString(actionRequest, "comment"); - int dueDateMonth = ParamUtil.getInteger(actionRequest, "dueDateMonth"); int dueDateDay = ParamUtil.getInteger(actionRequest, "dueDateDay"); int dueDateYear = ParamUtil.getInteger(actionRequest, "dueDateYear"); int dueDateHour = ParamUtil.getInteger(actionRequest, "dueDateHour"); int dueDateMinute = ParamUtil.getInteger(actionRequest, "dueDateMinute"); int dueDateAmPm = ParamUtil.getInteger(actionRequest, "dueDateAmPm"); - if (dueDateAmPm == Calendar.PM) { dueDateHour += 12; } - Date dueDate = PortalUtil.getDate(dueDateMonth, dueDateDay, dueDateYear, dueDateHour, dueDateMinute, WorkflowTaskDueDateException.class); - WorkflowTaskManagerUtil.updateDueDate(themeDisplay.getCompanyId(), themeDisplay.getUserId(), workflowTaskId, comment, dueDate); } @@ -296,45 +288,30 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { if (isDisplaySuccessMessage(actionRequest)) { addSuccessMessage(actionRequest, actionResponse); } - if (Validator.isNull(redirect)) { redirect = (String) actionRequest.getAttribute(WebKeys.REDIRECT); } - if (Validator.isNull(redirect)) { redirect = ParamUtil.getString(actionRequest, "redirect"); } - if ((portletConfig != null) && Validator.isNotNull(redirect) && Validator.isNotNull(closeRedirect)) { - redirect = HttpUtil.setParameter(redirect, "closeRedirect", closeRedirect); - SessionMessages.add(actionRequest, PortalUtil.getPortletId(actionRequest) + SessionMessages.KEY_SUFFIX_CLOSE_REDIRECT, closeRedirect); } - if (Validator.isNull(redirect)) { return; } - - // LPS-1928 - HttpServletRequest request = PortalUtil.getHttpServletRequest(actionRequest); - if (BrowserSnifferUtil.isIe(request) && (BrowserSnifferUtil.getMajorVersion(request) == 6.0) && redirect.contains(StringPool.POUND)) { - String redirectToken = "&#"; - if (!redirect.contains(StringPool.QUESTION)) { redirectToken = StringPool.QUESTION + redirectToken; } - redirect = StringUtil.replace(redirect, StringPool.POUND, redirectToken); } - redirect = PortalUtil.escapeRedirect(redirect); - if (Validator.isNotNull(redirect)) { actionResponse.sendRedirect(redirect); } @@ -345,17 +322,12 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { if (!SessionErrors.isEmpty(portletRequest)) { return false; } - ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY); - Layout layout = themeDisplay.getLayout(); - if (layout.isTypeControlPanel()) { return true; } - String portletId = (String) portletRequest.getAttribute(WebKeys.PORTLET_ID); - try { LayoutTypePortlet layoutTypePortlet = themeDisplay.getLayoutTypePortlet(); @@ -367,29 +339,22 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { _log.debug(pe, pe); } } - Portlet portlet = PortletLocalServiceUtil.getPortletById(themeDisplay.getCompanyId(), portletId); - if (portlet.isAddDefaultResource()) { return true; } - return false; } protected void addSuccessMessage(ActionRequest actionRequest, ActionResponse actionResponse) { PortletConfig portletConfig = (PortletConfig) actionRequest.getAttribute(JavaConstants.JAVAX_PORTLET_CONFIG); - boolean addProcessActionSuccessMessage = GetterUtil.getBoolean( portletConfig.getInitParameter("add-process-action-success-action"), true); - if (!addProcessActionSuccessMessage) { return; } - String successMessage = ParamUtil.getString(actionRequest, "successMessage"); - SessionMessages.add(actionRequest, "requestProcessed", successMessage); } @@ -401,9 +366,7 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { public static String getForwardKey(PortletRequest portletRequest) { String portletId = (String) portletRequest.getAttribute(WebKeys.PORTLET_ID); - String portletNamespace = PortalUtil.getPortletNamespace(portletId); - return portletNamespace.concat(PORTLET_STRUTS_FORWARD); } @@ -429,11 +392,8 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { // Gestione permessi action button ControlloPratica controllo = getControlloPratica(workflowTask.getWorkflowInstanceId()); - - // ADT BUG BO ID=33 renderRequest.setAttribute("historyWorkflowEsitiLogs", getHistoryWorkfloLogs(themeDisplay, workflowTask.getWorkflowInstanceId(), renderRequest, controllo)); - Group group = GroupLocalServiceUtil.getGroup(controllo.getGroupId()); User user = themeDisplay.getUser(); Organization org = OrganizationLocalServiceUtil.getOrganization(group.getClassPK()); @@ -463,20 +423,16 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { ClassLoader classLoaderKaleoLog = (ClassLoader) PortletBeanLocatorUtil.locate( it.tref.liferay.portos.kaleo.service.ClpSerializer.getServletContextName(), "portletClassLoader"); - DynamicQuery dqKaleoLog = DynamicQueryFactoryUtil.forClass(FormLog.class, classLoaderKaleoLog); dqKaleoLog.add(RestrictionsFactoryUtil.eq("workflowInstanceId", taskInstanceId)); dqKaleoLog.add(RestrictionsFactoryUtil.eq("transitionName", transitionName)); - List listaKaleoLog = FormLogLocalServiceUtil.dynamicQuery(dqKaleoLog); if (listaKaleoLog != null && !listaKaleoLog.isEmpty()) { FormLog formLog = listaKaleoLog.get(0); JSONObject json = JSONFactoryUtil.createJSONObject(formLog.getFormParameters()); - KaleoInstance kaleoInstance = KaleoInstanceLocalServiceUtil.getKaleoInstance(taskInstanceId); ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil.getControlloPratica(kaleoInstance .getClassPK()); - if (json.has("esito")) { String tipoEsito = StringPool.BLANK; if (AzioniPraticheUtil.isDeposito(controlloPratica.getIntPraticaId())) { @@ -511,11 +467,6 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { Map esitiMapByWorkflowLogID = new HashMap(); try { - List logTypes = new ArrayList(); - logTypes.add(WorkflowLog.TASK_ASSIGN); - logTypes.add(WorkflowLog.TASK_COMPLETION); - logTypes.add(WorkflowLog.TASK_UPDATE); - logTypes.add(WorkflowLog.TRANSITION); List workflowLogs = WorkflowLogManagerUtil.getWorkflowLogsByWorkflowInstance( themeDisplay.getCompanyId(), workflowInstanceId, logTypes, QueryUtil.ALL_POS, QueryUtil.ALL_POS, WorkflowComparatorFactoryUtil.getLogCreateDateComparator(true)); @@ -586,7 +537,7 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { ServiceContext serviceContext = new ServiceContext(); serviceContext.setCompanyId(controlloPratica.getCompanyId()); serviceContext.setUserId(controlloPratica.getUserId()); - FormLogLocalServiceUtil.addFormLog(kaleoTaskInstanceToken.getKaleoInstanceId(), 0l, + FormLogLocalServiceUtil.addFormLog(kaleoTaskInstanceToken.getKaleoInstanceId(), 0L, "cambio-istruttore", jsonFormParameters, serviceContext); _log.info("checkPresenzaIstruttore correttamente eseguito - ControlloPraticaId = " + controlloPratica.getControlloPraticaId()); @@ -598,7 +549,7 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { } catch (Exception e) { _log.error("checkPresenzaIstruttore KO per workflowTaskId = " + workflowTaskId + " [" + e.getMessage() - + " , " + e.getCause() + "]"); + + " , " + e.getCause() + StringPool.CLOSE_BRACKET); } } } diff --git a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/hook/struts/RenderFormTaskPortletAction.java b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/hook/struts/RenderFormTaskPortletAction.java index 9750effd..2b417bac 100644 --- a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/hook/struts/RenderFormTaskPortletAction.java +++ b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/hook/struts/RenderFormTaskPortletAction.java @@ -53,130 +53,95 @@ import com.liferay.portlet.dynamicdatamapping.util.DDMXSDUtil; public class RenderFormTaskPortletAction extends BaseStrutsPortletAction { + private static final Log _log = LogFactoryUtil.getLog(RenderFormTaskPortletAction.class); + @Override - public String render(PortletConfig portletConfig, RenderRequest renderRequest, - RenderResponse renderResponse) throws Exception { + public String render(PortletConfig portletConfig, RenderRequest renderRequest, RenderResponse renderResponse) + throws Exception { ServiceContext serviceContext = ServiceContextFactory.getInstance(renderRequest); - long companyId = PortalUtil.getCompanyId(renderRequest); - long workflowTaskId = ParamUtil.getLong(renderRequest, "workflowTaskId"); long assigneeUserId = ParamUtil.getLong(renderRequest, "assigneeUserId"); String transitionName = ParamUtil.getString(renderRequest, "transitionName"); - KaleoTaskInstanceToken kaleoTaskInstanceToken = KaleoTaskInstanceTokenLocalServiceUtil .getKaleoTaskInstanceToken(workflowTaskId); - - KaleoDefinition kaleoDefinition = KaleoDefinitionLocalServiceUtil - .getKaleoDefinition(kaleoTaskInstanceToken.getKaleoDefinitionId()); - + KaleoDefinition kaleoDefinition = KaleoDefinitionLocalServiceUtil.getKaleoDefinition(kaleoTaskInstanceToken + .getKaleoDefinitionId()); KaleoTask kaleoTask = kaleoTaskInstanceToken.getKaleoTask(); - FormDefinitionLink formDefinitionLink = FormDefinitionLinkLocalServiceUtil .fetchByC_DefinitionName_DefinitionVersion(companyId, kaleoDefinition.getName(), kaleoDefinition.getVersion()); - if (formDefinitionLink == null) { return null; } - FormTemplateLink formTemplateLink = FormTemplateLinkLocalServiceUtil - .fetchByFormDefinitionLinkId_KaleoNodeId_TransitionName( - formDefinitionLink.getFormDefinitionLinkId(), kaleoTask.getKaleoNodeId(), - transitionName); - + .fetchByFormDefinitionLinkId_KaleoNodeId_TransitionName(formDefinitionLink.getFormDefinitionLinkId(), + kaleoTask.getKaleoNodeId(), transitionName); if (formTemplateLink == null) { return null; } - long ddmTemplateId = formTemplateLink.getDdmTemplateId(); long ddmStructureId = formDefinitionLink.getDdmStructureId(); - /* * Script OnOpenForm */ Map workflowContext = WorkflowUtil.executeOnOpenForm(companyId, workflowTaskId, assigneeUserId, transitionName); - Map parameters = WorkflowUtil.getFormParameters(companyId, workflowTaskId); - Map>> fieldNameOptions = getOptions(workflowContext, serviceContext.getLocale()); - renderRequest.setAttribute("ddmTemplateId", ddmTemplateId); renderRequest.setAttribute("ddmStructureId", ddmStructureId); renderRequest.setAttribute("parameters", parameters); renderRequest.setAttribute("prefix", WorkflowConstants.PREFIX_NAME_ELEMENT_FORM); renderRequest.setAttribute("suffix", WorkflowConstants.SUFFIX_NAME_ELEMENT_FORM); renderRequest.setAttribute("fieldNameOptions", fieldNameOptions); - - // ADT BUG BO id = 27 String classPkForCarichiLavoro = ParamUtil.getString(renderRequest, "classPkForCarichiLavoro"); boolean checkVisualizzaCarichiLavoro = (ddmTemplateId == 21699 || ddmTemplateId == 21705); if (checkVisualizzaCarichiLavoro) { renderRequest.setAttribute("classPkForCarichiLavoro", classPkForCarichiLavoro); } - // ADT BUG BO ID=32 if (transitionName != null && transitionName.equalsIgnoreCase("registra-esito")) { parameters.remove("esito"); parameters.remove("testo_del_documento"); } - return "/portlet/workflow_tasks/render_form_task.jsp"; } - @SuppressWarnings("unchecked") @Override public void serveResource(PortletConfig portletConfig, ResourceRequest resourceRequest, ResourceResponse resourceResponse) throws Exception { ServiceContext serviceContext = ServiceContextFactory.getInstance(resourceRequest); - long companyId = PortalUtil.getCompanyId(resourceRequest); - long workflowTaskId = ParamUtil.getLong(resourceRequest, "workflowTaskId"); long assigneeUserId = ParamUtil.getLong(resourceRequest, "assigneeUserId"); String transitionName = ParamUtil.getString(resourceRequest, "transitionName"); - List errors = new ArrayList(); - KaleoTaskInstanceToken kaleoTaskInstanceToken = KaleoTaskInstanceTokenLocalServiceUtil .getKaleoTaskInstanceToken(workflowTaskId); - - KaleoDefinition kaleoDefinition = KaleoDefinitionLocalServiceUtil - .getKaleoDefinition(kaleoTaskInstanceToken.getKaleoDefinitionId()); - + KaleoDefinition kaleoDefinition = KaleoDefinitionLocalServiceUtil.getKaleoDefinition(kaleoTaskInstanceToken + .getKaleoDefinitionId()); KaleoTask kaleoTask = kaleoTaskInstanceToken.getKaleoTask(); - FormDefinitionLink formDefinitionLink = FormDefinitionLinkLocalServiceUtil .fetchByC_DefinitionName_DefinitionVersion(companyId, kaleoDefinition.getName(), kaleoDefinition.getVersion()); - if (formDefinitionLink != null) { - FormTemplateLink formTemplateLink = FormTemplateLinkLocalServiceUtil .fetchByFormDefinitionLinkId_KaleoNodeId_TransitionName( - formDefinitionLink.getFormDefinitionLinkId(), kaleoTask.getKaleoNodeId(), - transitionName); - + formDefinitionLink.getFormDefinitionLinkId(), kaleoTask.getKaleoNodeId(), transitionName); if (formTemplateLink != null) { - Map workflowContext = new HashMap(); - WorkflowUtil.updateWorkflowContextWithTaskFormParameters(resourceRequest, workflowContext); - DDMTemplate ddmTemplate = DDMTemplateLocalServiceUtil.getDDMTemplate(formTemplateLink .getDdmTemplateId()); - String xsd = DDMXSDUtil.getXSD(PortalUtil.getClassNameId(DDMTemplate.class), ddmTemplate.getTemplateId()); - JSONArray jsonArray = DDMXSDUtil.getJSONArray(xsd); - + @SuppressWarnings("unchecked") Map formParameters = (Map) workflowContext .get(WorkflowConstants.CONTEXT_TASK_FORM_PARAMETERS); - if (formParameters != null) { for (int i = 0; i < jsonArray.length(); i++) { JSONObject jsonObject = jsonArray.getJSONObject(i); @@ -201,15 +166,13 @@ public class RenderFormTaskPortletAction extends BaseStrutsPortletAction { } } } - /* * Script OnValidation */ workflowContext = WorkflowUtil.executeOnValidation(companyId, workflowTaskId, assigneeUserId, transitionName, workflowContext); - - String json = MapUtil.getString(workflowContext, - WorkflowConstants.CONTEXT_VALIDATION_OUTCOME_PARAMETER); + String json = MapUtil + .getString(workflowContext, WorkflowConstants.CONTEXT_VALIDATION_OUTCOME_PARAMETER); if (Validator.isNotNull(json)) { JSONObject validationJSON = JSONFactoryUtil.createJSONObject(json); JSONArray validationErrorsJSON = validationJSON.getJSONArray("errors"); @@ -221,9 +184,7 @@ public class RenderFormTaskPortletAction extends BaseStrutsPortletAction { } } } - JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); - if (!errors.isEmpty()) { jsonObject.put("valid", false); JSONArray jsonMessages = JSONFactoryUtil.createJSONArray(); @@ -234,24 +195,19 @@ public class RenderFormTaskPortletAction extends BaseStrutsPortletAction { } else { jsonObject.put("valid", true); } - resourceResponse.setContentType(ContentTypes.APPLICATION_JSON); - HttpServletResponse httpServletResponse = PortalUtil.getHttpServletResponse(resourceResponse); - ServletResponseUtil.write(httpServletResponse, jsonObject.toString()); - resourceResponse.flushBuffer(); } - private Map>> getOptions( - Map workflowContext, Locale locale) throws PortalException { + private Map>> getOptions(Map workflowContext, + Locale locale) throws PortalException { Map>> fieldNameOptions = Collections.emptyMap(); if (workflowContext.containsKey(WorkflowConstants.CONTEXT_OPEN_FORM_OPTIONS_PARAMETER)) { - String json = MapUtil.getString(workflowContext, - WorkflowConstants.CONTEXT_OPEN_FORM_OPTIONS_PARAMETER); + String json = MapUtil.getString(workflowContext, WorkflowConstants.CONTEXT_OPEN_FORM_OPTIONS_PARAMETER); if (Validator.isNotNull(json)) { // field name (ddm) -> map fieldNameOptions = new HashMap>>(); @@ -267,8 +223,7 @@ public class RenderFormTaskPortletAction extends BaseStrutsPortletAction { for (int i = 0; i < jsonArray.length(); i++) { JSONObject optionJSON = jsonArray.getJSONObject(i); Map optionFields = new HashMap(); - optionFields.put("label", - LanguageUtil.get(locale, optionJSON.getString("label"))); + optionFields.put("label", LanguageUtil.get(locale, optionJSON.getString("label"))); optionFields.put("value", optionJSON.getString("value")); optionFields.put("default", optionJSON.getBoolean("default")); options.add(optionFields); diff --git a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/util/WorkflowUtil.java b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/util/WorkflowUtil.java index 44adfae9..355887c2 100644 --- a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/util/WorkflowUtil.java +++ b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/util/WorkflowUtil.java @@ -56,8 +56,7 @@ public class WorkflowUtil { KaleoTaskInstanceToken taskInstanceToken = KaleoTaskInstanceTokenLocalServiceUtil .getKaleoTaskInstanceToken(workflowTaskId); if (taskInstanceToken.getClassName().equals(ControlloPratica.class.getName())) { - controllo = ControlloPraticaLocalServiceUtil.getControlloPratica(taskInstanceToken - .getClassPK()); + controllo = ControlloPraticaLocalServiceUtil.getControlloPratica(taskInstanceToken.getClassPK()); } } catch (PortalException | SystemException e) { } @@ -74,8 +73,8 @@ public class WorkflowUtil { return pratica; } - public static Map getWorkflowContext(ControlloPratica controllo) - throws PortalException, SystemException { + public static Map getWorkflowContext(ControlloPratica controllo) throws PortalException, + SystemException { WorkflowInstanceLink link = WorkflowInstanceLinkLocalServiceUtil.getWorkflowInstanceLink( controllo.getCompanyId(), controllo.getGroupId(), ControlloPratica.class.getName(), controllo.getPrimaryKey()); @@ -84,46 +83,34 @@ public class WorkflowUtil { return instance.getWorkflowContext(); } - public static Map executeOnOpenForm(long companyId, long workflowTaskId, - long assigneeUserId, String transitionName) throws PortalException, SystemException { + public static Map executeOnOpenForm(long companyId, long workflowTaskId, long assigneeUserId, + String transitionName) throws PortalException, SystemException { ServiceContext serviceContext = new ServiceContext(); serviceContext.setCompanyId(companyId); serviceContext.setUserId(assigneeUserId); - KaleoTaskInstanceToken kaleoTaskInstanceToken = KaleoTaskInstanceTokenLocalServiceUtil .getKaleoTaskInstanceToken(workflowTaskId); - KaleoTask kaleoTask = kaleoTaskInstanceToken.getKaleoTask(); - Map workflowContext = new HashMap(); - - WorkflowHandler workflowHandler = WorkflowHandlerRegistryUtil - .getWorkflowHandler(kaleoTaskInstanceToken.getClassName()); + WorkflowHandler workflowHandler = WorkflowHandlerRegistryUtil.getWorkflowHandler(kaleoTaskInstanceToken + .getClassName()); if (workflowHandler != null) { - workflowContext.put(WorkflowConstants.CONTEXT_ENTRY_TYPE, - workflowHandler.getType(Locale.getDefault())); + workflowContext.put(WorkflowConstants.CONTEXT_ENTRY_TYPE, workflowHandler.getType(Locale.getDefault())); } - - workflowContext - .put(WorkflowConstants.CONTEXT_ENTRY_CLASS_NAME, kaleoTaskInstanceToken.getClassName()); + workflowContext.put(WorkflowConstants.CONTEXT_ENTRY_CLASS_NAME, kaleoTaskInstanceToken.getClassName()); workflowContext.put(WorkflowConstants.CONTEXT_ENTRY_CLASS_PK, String.valueOf(kaleoTaskInstanceToken.getClassPK())); - workflowContext.put(WorkflowConstants.CONTEXT_COMPANY_ID, - String.valueOf(kaleoTaskInstanceToken.getCompanyId())); - workflowContext.put(WorkflowConstants.CONTEXT_GROUP_ID, - String.valueOf(kaleoTaskInstanceToken.getGroupId())); + workflowContext + .put(WorkflowConstants.CONTEXT_COMPANY_ID, String.valueOf(kaleoTaskInstanceToken.getCompanyId())); + workflowContext.put(WorkflowConstants.CONTEXT_GROUP_ID, String.valueOf(kaleoTaskInstanceToken.getGroupId())); workflowContext.put(WorkflowConstants.CONTEXT_USER_ID, String.valueOf(assigneeUserId)); workflowContext.put(WorkflowConstants.CONTEXT_SERVICE_CONTEXT, serviceContext); workflowContext.put(WorkflowConstants.CONTEXT_TRANSITION_NAME, transitionName); - - ExecutionContext executionContext = new ExecutionContext( - kaleoTaskInstanceToken.getKaleoInstanceToken(), kaleoTaskInstanceToken, workflowContext, - serviceContext); - + ExecutionContext executionContext = new ExecutionContext(kaleoTaskInstanceToken.getKaleoInstanceToken(), + kaleoTaskInstanceToken, workflowContext, serviceContext); ActionExecutorUtil.executeKaleoActions(KaleoNode.class.getName(), kaleoTask.getKaleoNodeId(), ExecutionType.ON_OPEN_FORM, executionContext); - return executionContext.getWorkflowContext(); } @@ -140,42 +127,30 @@ public class WorkflowUtil { if (workflowContext == null) { workflowContext = Collections. emptyMap(); } - ServiceContext serviceContext = new ServiceContext(); serviceContext.setCompanyId(companyId); serviceContext.setUserId(assigneeUserId); - KaleoTaskInstanceToken kaleoTaskInstanceToken = KaleoTaskInstanceTokenLocalServiceUtil .getKaleoTaskInstanceToken(workflowTaskId); - KaleoTask kaleoTask = kaleoTaskInstanceToken.getKaleoTask(); - - WorkflowHandler workflowHandler = WorkflowHandlerRegistryUtil - .getWorkflowHandler(kaleoTaskInstanceToken.getClassName()); + WorkflowHandler workflowHandler = WorkflowHandlerRegistryUtil.getWorkflowHandler(kaleoTaskInstanceToken + .getClassName()); if (workflowHandler != null) { - workflowContext.put(WorkflowConstants.CONTEXT_ENTRY_TYPE, - workflowHandler.getType(Locale.getDefault())); + workflowContext.put(WorkflowConstants.CONTEXT_ENTRY_TYPE, workflowHandler.getType(Locale.getDefault())); } - - workflowContext - .put(WorkflowConstants.CONTEXT_ENTRY_CLASS_NAME, kaleoTaskInstanceToken.getClassName()); + workflowContext.put(WorkflowConstants.CONTEXT_ENTRY_CLASS_NAME, kaleoTaskInstanceToken.getClassName()); workflowContext.put(WorkflowConstants.CONTEXT_ENTRY_CLASS_PK, String.valueOf(kaleoTaskInstanceToken.getClassPK())); - workflowContext.put(WorkflowConstants.CONTEXT_COMPANY_ID, - String.valueOf(kaleoTaskInstanceToken.getCompanyId())); - workflowContext.put(WorkflowConstants.CONTEXT_GROUP_ID, - String.valueOf(kaleoTaskInstanceToken.getGroupId())); + workflowContext + .put(WorkflowConstants.CONTEXT_COMPANY_ID, String.valueOf(kaleoTaskInstanceToken.getCompanyId())); + workflowContext.put(WorkflowConstants.CONTEXT_GROUP_ID, String.valueOf(kaleoTaskInstanceToken.getGroupId())); workflowContext.put(WorkflowConstants.CONTEXT_USER_ID, String.valueOf(assigneeUserId)); workflowContext.put(WorkflowConstants.CONTEXT_SERVICE_CONTEXT, serviceContext); workflowContext.put(WorkflowConstants.CONTEXT_TRANSITION_NAME, transitionName); - - ExecutionContext executionContext = new ExecutionContext( - kaleoTaskInstanceToken.getKaleoInstanceToken(), kaleoTaskInstanceToken, workflowContext, - serviceContext); - + ExecutionContext executionContext = new ExecutionContext(kaleoTaskInstanceToken.getKaleoInstanceToken(), + kaleoTaskInstanceToken, workflowContext, serviceContext); ActionExecutorUtil.executeKaleoActions(KaleoNode.class.getName(), kaleoTask.getKaleoNodeId(), ExecutionType.ON_VALIDATION, executionContext); - return executionContext.getWorkflowContext(); } @@ -189,26 +164,20 @@ public class WorkflowUtil { String className, long workflowTaskId) throws PortalException, SystemException { if (Validator.isNotNull(workflowTaskId)) { - KaleoTaskInstanceToken kaleoTaskInstanceToken = KaleoTaskInstanceTokenLocalServiceUtil .getKaleoTaskInstanceToken(workflowTaskId); - companyId = kaleoTaskInstanceToken.getCompanyId(); groupId = kaleoTaskInstanceToken.getGroupId(); classPK = kaleoTaskInstanceToken.getClassPK(); className = kaleoTaskInstanceToken.getClassName(); } - - WorkflowInstanceLink workflowInstanceLink = WorkflowInstanceLinkLocalServiceUtil - .fetchWorkflowInstanceLink(companyId, groupId, className, classPK); + WorkflowInstanceLink workflowInstanceLink = WorkflowInstanceLinkLocalServiceUtil.fetchWorkflowInstanceLink( + companyId, groupId, className, classPK); if (workflowInstanceLink == null) { throw new NoSuchWorkflowInstanceLinkException(); } - long workflowInstanceId = workflowInstanceLink.getWorkflowInstanceId(); - Map parameters = new HashMap(); - // order asc List formLogs = FormLogLocalServiceUtil.findByC_Instance(companyId, workflowInstanceId, QueryUtil.ALL_POS, QueryUtil.ALL_POS); @@ -220,7 +189,6 @@ public class WorkflowUtil { parameters.putAll(jsonDeserializer.deserialize(formParameters)); } } - return parameters; } @@ -228,23 +196,18 @@ public class WorkflowUtil { Map workflowContext) { Map formParameters = null; - Enumeration enu = portletRequest.getParameterNames(); - while (enu.hasMoreElements()) { String name = enu.nextElement(); - if (!name.startsWith(WorkflowConstants.PREFIX_NAME_ELEMENT_FORM) && !name.endsWith(WorkflowConstants.SUFFIX_NAME_ELEMENT_FORM)) { continue; } - if (formParameters == null) { formParameters = new HashMap(); } - - String parameterName = name.substring(WorkflowConstants.PREFIX_NAME_ELEMENT_FORM.length(), - name.length() - WorkflowConstants.SUFFIX_NAME_ELEMENT_FORM.length()); + String parameterName = name.substring(WorkflowConstants.PREFIX_NAME_ELEMENT_FORM.length(), name.length() + - WorkflowConstants.SUFFIX_NAME_ELEMENT_FORM.length()); String[] values = ParamUtil.getParameterValues(portletRequest, name); for (int i = 0; i < values.length; i++) { _log.info(name + "[" + i + "] = \"" + values[i] + "\""); @@ -253,37 +216,27 @@ public class WorkflowUtil { _log.info("Finale \"" + value + "\""); formParameters.put(parameterName, value); } - if (formParameters == null) { - HttpServletRequest httpServletRequest = PortalUtil.getOriginalServletRequest(PortalUtil .getHttpServletRequest(portletRequest)); - Enumeration enums = httpServletRequest.getParameterNames(); - while (enums.hasMoreElements()) { String name = enums.nextElement(); - if (!name.startsWith(WorkflowConstants.PREFIX_NAME_ELEMENT_FORM) && !name.endsWith(WorkflowConstants.SUFFIX_NAME_ELEMENT_FORM)) { continue; } - if (formParameters == null) { formParameters = new HashMap(); } - String parameterName = name.substring(WorkflowConstants.PREFIX_NAME_ELEMENT_FORM.length(), name.length() - WorkflowConstants.SUFFIX_NAME_ELEMENT_FORM.length()); String value = StringUtil.merge(ParamUtil.getParameterValues(httpServletRequest, name)); formParameters.put(parameterName, value); } } - if (formParameters != null) { - workflowContext - .put(WorkflowConstants.CONTEXT_TASK_FORM_PARAMETERS, (Serializable) formParameters); + workflowContext.put(WorkflowConstants.CONTEXT_TASK_FORM_PARAMETERS, (Serializable) formParameters); } } - } diff --git a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/service.properties b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/service.properties index a191b6b3..03bd9d29 100644 --- a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/service.properties +++ b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/service.properties @@ -13,8 +13,8 @@ ## build.namespace=Kaleo - build.number=28 - build.date=1616063088077 + build.number=32 + build.date=1616424088204 build.auto.upgrade=true ##