- * 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- * 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- * 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 ListFile non ancora importato
-Processo in corso...
-Si prega di attendere qualche minuto
-