Sfoglia il codice sorgente

Merge branch 'master' of 149.202.172.180:/home/mattia/sicilia/sources

master
Mattia Gosetto 4 anni fa
parent
commit
a649d1f3ab
  1. 2
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/portlet.xml
  2. 319
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SismicaUtil.java
  3. 23
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/listener/ControlloPraticaModelListener.java
  4. 36
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/listener/DettPraticaModelListener.java
  5. 29
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/listener/DocPraticaModelListener.java
  6. 44
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/listener/IntPraticaModelListener.java
  7. 136
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/listener/KaleoInstanceModelListener.java
  8. 183
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/listener/KaleoLogModelListener.java
  9. 152
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/listener/KaleoTaskInstanceTokenModelListener.java
  10. 29
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/listener/SoggettoModelListener.java
  11. 14
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/SismicaAdministrationPortlet.java
  12. 2
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AvvisoLocalServiceImpl.java
  13. 4
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ControlloPraticaLocalServiceImpl.java
  14. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/IntPraticaLocalServiceImpl.java
  15. 4
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties
  16. 66
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/sismica_administration/view.jsp
  17. 37
      liferay-plugins-sdk-6.2/portlets/portos-importazione-portlet/bin/.project

2
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/portlet.xml

@ -406,7 +406,7 @@
<portlet-name>portos-administration</portlet-name>
<display-name>Amministrazione Sismica</display-name>
<portlet-class>
it.tref.liferay.portos.bo.portlet.PortosAdministrationPortlet
it.tref.liferay.portos.bo.portlet.SismicaAdministrationPortlet
</portlet-class>
<init-param>
<name>view-template</name>

319
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SismicaUtil.java

@ -8,6 +8,7 @@ package it.mwg.sismica.bo.util;
import it.tref.liferay.portos.bo.model.AllegatoManuale;
import it.tref.liferay.portos.bo.model.Asseverazione;
import it.tref.liferay.portos.bo.model.Avviso;
import it.tref.liferay.portos.bo.model.Collaudo;
import it.tref.liferay.portos.bo.model.ControlloPratica;
import it.tref.liferay.portos.bo.model.DettPratica;
import it.tref.liferay.portos.bo.model.DocAggiuntiva;
@ -16,9 +17,11 @@ import it.tref.liferay.portos.bo.model.IntPratica;
import it.tref.liferay.portos.bo.model.Pagamento;
import it.tref.liferay.portos.bo.model.ParereGeologo;
import it.tref.liferay.portos.bo.model.Territorio;
import it.tref.liferay.portos.bo.model.impl.CollaudoImpl;
import it.tref.liferay.portos.bo.service.AllegatoManualeLocalServiceUtil;
import it.tref.liferay.portos.bo.service.AsseverazioneLocalServiceUtil;
import it.tref.liferay.portos.bo.service.AvvisoLocalServiceUtil;
import it.tref.liferay.portos.bo.service.CollaudoLocalServiceUtil;
import it.tref.liferay.portos.bo.service.ConfigurazioneLocalServiceUtil;
import it.tref.liferay.portos.bo.service.ControlloPraticaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil;
@ -47,6 +50,9 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.TreeMap;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
import com.liferay.counter.service.CounterLocalServiceUtil;
import com.liferay.portal.NoSuchResourcePermissionException;
import com.liferay.portal.kernel.dao.orm.QueryUtil;
@ -57,11 +63,14 @@ import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.repository.model.FileEntry;
import com.liferay.portal.kernel.repository.model.Folder;
import com.liferay.portal.kernel.servlet.SessionErrors;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.LocaleUtil;
import com.liferay.portal.kernel.util.OrderByComparatorFactoryUtil;
import com.liferay.portal.kernel.util.ParamUtil;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.kernel.util.WebKeys;
import com.liferay.portal.kernel.workflow.WorkflowException;
import com.liferay.portal.kernel.workflow.WorkflowHandlerRegistryUtil;
import com.liferay.portal.kernel.workflow.WorkflowInstance;
@ -83,6 +92,7 @@ import com.liferay.portal.service.ResourcePermissionLocalServiceUtil;
import com.liferay.portal.service.RoleLocalServiceUtil;
import com.liferay.portal.service.ServiceContext;
import com.liferay.portal.service.UserLocalServiceUtil;
import com.liferay.portal.theme.ThemeDisplay;
import com.liferay.portal.workflow.kaleo.model.KaleoInstanceToken;
import com.liferay.portal.workflow.kaleo.model.KaleoTaskAssignmentInstance;
import com.liferay.portal.workflow.kaleo.model.KaleoTaskInstanceToken;
@ -91,6 +101,8 @@ import com.liferay.portal.workflow.kaleo.service.KaleoTaskAssignmentInstanceLoca
import com.liferay.portal.workflow.kaleo.service.KaleoTaskInstanceTokenLocalServiceUtil;
import com.liferay.portlet.documentlibrary.model.DLFileEntry;
import com.liferay.portlet.documentlibrary.model.DLFolder;
import com.liferay.portlet.documentlibrary.service.DLAppHelperLocalServiceUtil;
import com.liferay.portlet.documentlibrary.service.DLAppLocalServiceUtil;
import com.liferay.portlet.documentlibrary.service.DLAppServiceUtil;
import com.liferay.portlet.documentlibrary.service.DLFileEntryLocalServiceUtil;
@ -224,6 +236,81 @@ public class SismicaUtil {
} while (fileEntries.size() > 0);
return esito;
}
public static void sostituisciDL(ActionRequest actionRequest, ActionResponse actionResponse) {
}
public static void inviaAvviso(ActionRequest actionRequest, ActionResponse actionResponse)
throws SystemException {
List<String> esito = new ArrayList<>();
ThemeDisplay td = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
long companyId = td.getCompanyId();
String tipoAvviso = ParamUtil.getString(actionRequest, "tipoAvviso");
actionResponse.setRenderParameter("tipoAvviso", tipoAvviso);
if (Validator.isNull(tipoAvviso)) {
SessionErrors.add(actionRequest, "invia-avviso-tipo-obbligatorio");
}
String numeroProgetto = ParamUtil.getString(actionRequest, "numeroProgetto");
actionResponse.setRenderParameter("numeroProgetto", numeroProgetto);
if (Validator.isNull(numeroProgetto)) {
SessionErrors.add(actionRequest, "invia-avviso-progetto-obbligatorio");
}
IntPratica intPratica = IntPraticaLocalServiceUtil.findByNumeroProgetto(numeroProgetto);
if (Validator.isNull(intPratica)) {
SessionErrors.add(actionRequest, "invia-avviso-progetto-inesistente");
return;
}
long intPraticaId = intPratica.getIntPraticaId();
List<ControlloPratica> controlli = ControlloPraticaLocalServiceUtil.findByIntPratica(intPraticaId);
long controlloPraticaId = 0;
for (ControlloPratica controllo : controlli) {
controlloPraticaId = controllo.getControlloPraticaId();
}
String tipoDocumento = null;
String className = null;
long classPk = 0;
switch (tipoAvviso) {
case StatoPraticaConstants.COLLAUDO:
List<Collaudo> collaudi = CollaudoLocalServiceUtil.findByIntPraticaId_Completata(intPraticaId,
true, QueryUtil.ALL_POS, QueryUtil.ALL_POS,
OrderByComparatorFactoryUtil.create(CollaudoImpl.TABLE_NAME, "dtProtocollo", true));
Collaudo collaudo = null;
for (Collaudo el : collaudi) {
if (Validator.isNotNull(el.getDtProtocollo())) {
collaudo = el;
}
}
if (Validator.isNull(collaudo)) {
SessionErrors.add(actionRequest, "invia-avviso-collaudo-non-trovato");
return;
}
tipoDocumento = StatoPraticaConstants.VIDIMATA;
className = Collaudo.class.getName();
classPk = collaudo.getPrimaryKey();
controlloPraticaId = 0;
break;
default:
SessionErrors.add(actionRequest, "operazione-non-supportata");
return;
}
String templateName = AvvisoUtil.getAllTipoDocumentoFileTemplateProps().get(tipoAvviso);
long template = ConfigurazioneLocalServiceUtil.findByC_ChiaveLong(companyId, templateName);
esito.add("template = " + templateName);
try {
AvvisoLocalServiceUtil.addAvviso(intPraticaId, StringPool.BLANK, new Date(),
AvvisoUtil.TIPO_AVVISO_DIRETTO, tipoDocumento, template, classPk, className,
controlloPraticaId, getServiceContextbyIntPratica(intPratica));
} catch (PortalException e) {
SessionErrors.add(actionRequest, "errore-generico");
esito.add("Errore durante la generazione dell'avviso: " + e.getMessage());
}
actionResponse.setRenderParameter("esito", esito.toArray(new String[esito.size()]));
}
public static List<String> riparaWorkflow(long companyId, long userId) {
List<String> esito = new ArrayList<>();
@ -411,39 +498,25 @@ public class SismicaUtil {
esito.add("Errore caricamento intPratiche: " + e.getMessage());
}
start += SLICE;
List<Avviso> avvisi = null;
for (IntPratica pratica : pratiche) {
List<Avviso> avvisi = null;
List<Avviso> totali = null;
String stato = pratica.getStatoPratica();
// Avvisi conformi
try {
avvisi = AvvisoLocalServiceUtil.findByIntPraticaId_tipoDocumento(
pratica.getIntPraticaId(), StatoPraticaConstants.CONFORME);
} catch (SystemException e) {
avvisi = new ArrayList<>();
}
// Tutti gli avvisi
try {
totali = AvvisoLocalServiceUtil.findByIntPratica(pratica.getIntPraticaId(),
QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} catch (SystemException e) {
totali = new ArrayList<>();
}
if (Validator.isNotNull(stato) && Validator.isNotNull(pratica.getTipoProcedura())
&& pratica.getTipoPratica().equalsIgnoreCase(Constants.TIPO_PRATICA_DEPOSITO)) {
// Dettaglio pratica
DettPratica dettPratica = null;
try {
dettPratica = DettPraticaLocalServiceUtil.getLastCompletedByIntPratica(pratica
.getIntPraticaId());
avvisi = AvvisoLocalServiceUtil.findByIntPraticaId_tipoDocumento(
pratica.getIntPraticaId(), StatoPraticaConstants.CONFORME);
} catch (SystemException e) {
esito.add("Errore caricamento avvisi: " + e.getMessage());
}
if (Validator.isNotNull(dettPratica)) {
// Controllo pratica
List<Avviso> totali = null;
try {
totali = AvvisoLocalServiceUtil.findByIntPratica(pratica.getIntPraticaId(),
QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} catch (SystemException e) {
totali = new ArrayList<>();
}
if ((avvisi.size() == 0) && stato.equalsIgnoreCase(StatoPraticaConstants.VIDIMATA)) {
List<ControlloPratica> controlli = null;
try {
controlli = ControlloPraticaLocalServiceUtil.findByIntPratica(pratica
@ -451,71 +524,68 @@ public class SismicaUtil {
} catch (SystemException e) {
controlli = new ArrayList<>();
}
ControlloPratica controllo = null;
if (controlli.size() > 0) {
controllo = controlli.get(controlli.size() - 1);
}
boolean totaliOk = (totali.size() == 0)
|| ((totali.size() == 1) && totali.get(0).getTipoDocumento()
.equalsIgnoreCase(StatoPraticaConstants.VIDIMATA));
if ((avvisi.size() == 0 && stato.equalsIgnoreCase(StatoPraticaConstants.VIDIMATA))
|| (totaliOk && stato.equalsIgnoreCase(StatoPraticaConstants.CONFORME))) {
if (pratica.getStatoPratica().equals(StatoPraticaConstants.VIDIMATA)
&& (controlli.size() == 0)) {
esito.add("Progetto: " + pratica.getNumeroProgetto() + " ("
+ pratica.getIntPraticaId() + "), procedura="
+ pratica.getTipoProcedura() + ", avvisi=" + totali.size() + ", stato="
+ pratica.getStatoPratica() + ", controlli=" + controlli.size());
DettPratica dettPratica;
try {
dettPratica = DettPraticaLocalServiceUtil
.getLastCompletedByIntPratica(pratica.getIntPraticaId());
} catch (SystemException e) {
dettPratica = null;
}
ServiceContext serviceContext = new ServiceContext();
serviceContext.setCompanyId(dettPratica.getCompanyId());
serviceContext.setScopeGroupId(dettPratica.getGroupId());
serviceContext.setUserId(dettPratica.getUserId());
if (Validator.isNotNull(dettPratica)) {
ServiceContext serviceContext = new ServiceContext();
serviceContext.setCompanyId(dettPratica.getCompanyId());
serviceContext.setScopeGroupId(dettPratica.getGroupId());
serviceContext.setUserId(dettPratica.getUserId());
if (Validator.isNull(controllo)) {
ControlloPratica controllo;
try {
controllo = ControlloPraticaLocalServiceUtil.addControlloPratica(
dettPratica.getGroupId(), dettPratica.getUserId(),
pratica.getIntPraticaId(), dettPratica.getDettPraticaId(), false,
serviceContext);
} catch (PortalException | SystemException e) {
controllo = null;
}
}
if (Validator.isNotNull(controllo)) {
controllo.setStatus(WorkflowConstants.STATUS_APPROVED);
try {
ControlloPraticaLocalServiceUtil.updateControlloPratica(controllo);
} catch (SystemException e) {
}
long fileEntryIdTemplate;
try {
fileEntryIdTemplate = ConfigurazioneLocalServiceUtil.findByC_ChiaveLong(
companyId, "conf.geniocivile.avviso.template.id.deposito.B2");
} catch (SystemException e) {
fileEntryIdTemplate = 0;
}
if (Validator.isNotNull(controllo)) {
controllo.setStatus(WorkflowConstants.STATUS_APPROVED);
try {
ControlloPraticaLocalServiceUtil.updateControlloPratica(controllo);
} catch (SystemException e) {
}
_log.info("Pratica "
+ pratica.getNumeroProgetto()
+ ", totali.size() = "
+ totali.size()
+ (totali.size() > 0 ? ", totali(0) = "
+ totali.get(0).getTipoDocumento() : "")
+ ", avvisi.size() = " + avvisi.size() + ", stato = " + stato
+ ", controllo = " + controllo.getPrimaryKey()
+ ", fileEntryIdTemplate = " + fileEntryIdTemplate);
if (Validator.isNotNull(fileEntryIdTemplate)) {
long fileEntryIdTemplate;
try {
if (!pratica.getTipoProcedura().equalsIgnoreCase(
Constants.PROCEDURA_C)) {
AvvisoLocalServiceUtil.addAvviso(pratica.getIntPraticaId(),
"Attestazione di deposito progetto", new Date(),
AvvisoUtil.TIPO_AVVISO_DIRETTO,
StatoPraticaConstants.CONFORME, fileEntryIdTemplate,
dettPratica.getDettPraticaId(),
DettPratica.class.getName(),
controllo.getControlloPraticaId(), serviceContext);
fileEntryIdTemplate = ConfigurazioneLocalServiceUtil
.findByC_ChiaveLong(companyId,
"conf.geniocivile.avviso.template.id.deposito.B2");
} catch (SystemException e) {
fileEntryIdTemplate = 0;
}
if (Validator.isNotNull(fileEntryIdTemplate)) {
try {
if (!pratica.getTipoProcedura().equalsIgnoreCase(
Constants.PROCEDURA_C)) {
AvvisoLocalServiceUtil.addAvviso(pratica.getIntPraticaId(),
"Attestazione di deposito progetto", new Date(),
AvvisoUtil.TIPO_AVVISO_DIRETTO,
StatoPraticaConstants.CONFORME, fileEntryIdTemplate,
dettPratica.getDettPraticaId(),
DettPratica.class.getName(),
controllo.getControlloPraticaId(), serviceContext);
}
pratica.setStatoPratica(StatoPraticaConstants.CONFORME);
IntPraticaLocalServiceUtil.updateIntPratica(pratica);
} catch (PortalException | SystemException e) {
}
pratica.setStatoPratica(StatoPraticaConstants.CONFORME);
IntPraticaLocalServiceUtil.updateIntPratica(pratica);
} catch (PortalException | SystemException e) {
}
}
}
@ -1024,7 +1094,7 @@ public class SismicaUtil {
private static long userRoleId;
private static ResourceAction raFileEntry;
private static ResourceAction raFolder;
public static List<String> generaDocumenti(long companyId) throws PortalException, SystemException {
List<String> esito = new ArrayList<>();
@ -1066,6 +1136,7 @@ public class SismicaUtil {
int inizio = 0;
int totali = 0;
int corretti = 0;
List<AllegatoManuale> documenti = null;
String tipoDocumento = null;
do {
@ -1086,11 +1157,11 @@ public class SismicaUtil {
try {
fileEntry = DLAppServiceUtil.getFileEntry(documento.getFileEntryId());
} catch (Exception e) {
_log.info(e.getClass() + ": " + e.getMessage());
// _log.info(e.getClass() + ": " + e.getMessage());
}
esito.addAll(riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry,
corretti += riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry,
"Pratica " + pratica.getNumeroProgetto() + " (" + pratica.getIntPraticaId()
+ "), " + tipoDocumento + " " + documento.getPrimaryKey()));
+ "), " + tipoDocumento + " " + documento.getPrimaryKey());
}
}
inizio += SLICE;
@ -1099,6 +1170,7 @@ public class SismicaUtil {
_log.info(totali + " " + tipoDocumento);
}
} while (documenti.size() > 0);
_log.info("Corretti " + corretti + " " + tipoDocumento);
return esito;
}
@ -1108,6 +1180,7 @@ public class SismicaUtil {
int inizio = 0;
int totali = 0;
int corretti = 0;
List<Asseverazione> documenti = null;
String tipoDocumento = null;
do {
@ -1128,11 +1201,11 @@ public class SismicaUtil {
try {
fileEntry = DLAppServiceUtil.getFileEntry(documento.getFileEntryId());
} catch (Exception e) {
_log.info(e.getClass() + ": " + e.getMessage());
// _log.info(e.getClass() + ": " + e.getMessage());
}
esito.addAll(riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry,
corretti += riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry,
"Pratica " + pratica.getNumeroProgetto() + " (" + pratica.getIntPraticaId()
+ "), " + tipoDocumento + " " + documento.getPrimaryKey()));
+ "), " + tipoDocumento + " " + documento.getPrimaryKey());
}
}
inizio += SLICE;
@ -1141,6 +1214,7 @@ public class SismicaUtil {
_log.info(totali + " " + tipoDocumento);
}
} while (documenti.size() > 0);
_log.info("Corretti " + corretti + " " + tipoDocumento);
return esito;
}
@ -1149,6 +1223,7 @@ public class SismicaUtil {
int inizio = 0;
int totali = 0;
int corretti = 0;
List<Avviso> documenti = null;
String tipoDocumento = null;
do {
@ -1169,11 +1244,11 @@ public class SismicaUtil {
try {
fileEntry = DLAppServiceUtil.getFileEntry(documento.getFileEntryIdBase());
} catch (Exception e) {
_log.info(e.getClass() + ": " + e.getMessage());
// _log.info(e.getClass() + ": " + e.getMessage());
}
esito.addAll(riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry,
corretti += riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry,
"Pratica " + pratica.getNumeroProgetto() + " (" + pratica.getIntPraticaId()
+ "), " + tipoDocumento + " " + documento.getPrimaryKey()));
+ "), " + tipoDocumento + " " + documento.getPrimaryKey());
}
if (Validator.isNotNull(pratica) && (documento.getFileEntryIdInvio() != 0)) {
Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(pratica
@ -1182,11 +1257,11 @@ public class SismicaUtil {
try {
fileEntry = DLAppServiceUtil.getFileEntry(documento.getFileEntryIdInvio());
} catch (Exception e) {
_log.info(e.getClass() + ": " + e.getMessage());
// _log.info(e.getClass() + ": " + e.getMessage());
}
esito.addAll(riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry,
corretti += riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry,
"Pratica " + pratica.getNumeroProgetto() + " (" + pratica.getIntPraticaId()
+ "), " + tipoDocumento + " " + documento.getPrimaryKey()));
+ "), " + tipoDocumento + " " + documento.getPrimaryKey());
}
if (Validator.isNotNull(pratica) && (documento.getFileEntryIdProtocollo() != 0)) {
Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(pratica
@ -1195,11 +1270,11 @@ public class SismicaUtil {
try {
fileEntry = DLAppServiceUtil.getFileEntry(documento.getFileEntryIdProtocollo());
} catch (Exception e) {
_log.info(e.getClass() + ": " + e.getMessage());
// _log.info(e.getClass() + ": " + e.getMessage());
}
esito.addAll(riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry,
corretti += riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry,
"Pratica " + pratica.getNumeroProgetto() + " (" + pratica.getIntPraticaId()
+ "), " + tipoDocumento + " " + documento.getPrimaryKey()));
+ "), " + tipoDocumento + " " + documento.getPrimaryKey());
}
}
inizio += SLICE;
@ -1208,6 +1283,7 @@ public class SismicaUtil {
_log.info(totali + " " + tipoDocumento);
}
} while (documenti.size() > 0);
_log.info("Corretti " + corretti + " " + tipoDocumento);
return esito;
}
@ -1217,6 +1293,7 @@ public class SismicaUtil {
int inizio = 0;
int totali = 0;
int corretti = 0;
List<DocAggiuntiva> documenti = null;
String tipoDocumento = null;
do {
@ -1237,11 +1314,11 @@ public class SismicaUtil {
try {
fileEntry = DLAppServiceUtil.getFileEntry(documento.getFileEntryId());
} catch (Exception e) {
_log.info(e.getClass() + ": " + e.getMessage());
// _log.info(e.getClass() + ": " + e.getMessage());
}
esito.addAll(riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry,
corretti += riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry,
"Pratica " + pratica.getNumeroProgetto() + " (" + pratica.getIntPraticaId()
+ "), " + tipoDocumento + " " + documento.getPrimaryKey()));
+ "), " + tipoDocumento + " " + documento.getPrimaryKey());
}
}
inizio += SLICE;
@ -1250,6 +1327,7 @@ public class SismicaUtil {
_log.info(totali + " " + tipoDocumento);
}
} while (documenti.size() > 0);
_log.info("Corretti " + corretti + " " + tipoDocumento);
return esito;
}
@ -1259,6 +1337,7 @@ public class SismicaUtil {
int inizio = 0;
int totali = 0;
int corretti = 0;
List<DocPratica> documenti = null;
String tipoDocumento = null;
do {
@ -1279,11 +1358,11 @@ public class SismicaUtil {
try {
fileEntry = DLAppServiceUtil.getFileEntry(documento.getDlFileEntryId());
} catch (Exception e) {
_log.info(e.getClass() + ": " + e.getMessage());
// _log.info(e.getClass() + ": " + e.getMessage());
}
esito.addAll(riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry,
corretti += riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry,
"Pratica " + pratica.getNumeroProgetto() + " (" + pratica.getIntPraticaId()
+ "), " + tipoDocumento + " " + documento.getPrimaryKey()));
+ "), " + tipoDocumento + " " + documento.getPrimaryKey());
}
}
inizio += SLICE;
@ -1292,6 +1371,7 @@ public class SismicaUtil {
_log.info(totali + " " + tipoDocumento);
}
} while (documenti.size() > 0);
_log.info("Corretti " + corretti + " " + tipoDocumento);
return esito;
}
@ -1301,6 +1381,7 @@ public class SismicaUtil {
int inizio = 0;
int totali = 0;
int corretti = 0;
List<Pagamento> documenti = null;
String tipoDocumento = null;
do {
@ -1321,11 +1402,11 @@ public class SismicaUtil {
try {
fileEntry = DLAppServiceUtil.getFileEntry(documento.getFileEntryId());
} catch (Exception e) {
_log.info(e.getClass() + ": " + e.getMessage());
// _log.info(e.getClass() + ": " + e.getMessage());
}
esito.addAll(riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry,
corretti += riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry,
"Pratica " + pratica.getNumeroProgetto() + " (" + pratica.getIntPraticaId()
+ "), " + tipoDocumento + " " + documento.getPrimaryKey()));
+ "), " + tipoDocumento + " " + documento.getPrimaryKey());
}
}
inizio += SLICE;
@ -1334,6 +1415,7 @@ public class SismicaUtil {
_log.info(totali + " " + tipoDocumento);
}
} while (documenti.size() > 0);
_log.info("Corretti " + corretti + " " + tipoDocumento);
return esito;
}
@ -1343,6 +1425,7 @@ public class SismicaUtil {
int inizio = 0;
int totali = 0;
int corretti = 0;
List<ParereGeologo> documenti = null;
String tipoDocumento = null;
do {
@ -1363,11 +1446,11 @@ public class SismicaUtil {
try {
fileEntry = DLAppServiceUtil.getFileEntry(documento.getFileEntryId());
} catch (Exception e) {
_log.info(e.getClass() + ": " + e.getMessage());
// _log.info(e.getClass() + ": " + e.getMessage());
}
esito.addAll(riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry,
corretti += riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry,
"Pratica " + pratica.getNumeroProgetto() + " (" + pratica.getIntPraticaId()
+ "), " + tipoDocumento + " " + documento.getPrimaryKey()));
+ "), " + tipoDocumento + " " + documento.getPrimaryKey());
}
}
inizio += SLICE;
@ -1376,12 +1459,13 @@ public class SismicaUtil {
_log.info(totali + " " + tipoDocumento);
}
} while (documenti.size() > 0);
_log.info("Corretti " + corretti + " " + tipoDocumento);
return esito;
}
private static List<String> riparaPermessiFileEntry(long companyId, long groupId, FileEntry fileEntry,
private static int riparaPermessiFileEntry(long companyId, long groupId, FileEntry fileEntry,
String datiDocumento) throws PortalException, SystemException {
List<String> esito = new ArrayList<>();
int corretti = 0;
if (Validator.isNotNull(fileEntry)) {
PermissionChecker pc = orgPc.get(groupId);
if (!fileEntry.containsPermission(pc, ActionKeys.VIEW)) {
@ -1429,9 +1513,10 @@ public class SismicaUtil {
}
folder = folder.getParentFolder();
}
corretti = 1;
}
}
return esito;
return corretti;
}
public static List<String> generaDocumenti2(long companyId) throws SystemException, PortalException {
@ -1530,7 +1615,7 @@ public class SismicaUtil {
private static void inviaConformita(DettPratica dettPratica, ControlloPratica controllo, long template)
throws PortalException, SystemException {
ServiceContext serviceContext = getServiceContext(dettPratica);
ServiceContext serviceContext = getServiceContextbyDettPratica(dettPratica);
AvvisoLocalServiceUtil.addAvviso(dettPratica.getIntPraticaId(), "Avviso di Conformità", new Date(),
AvvisoUtil.TIPO_AVVISO_DIRETTO, StatoPraticaConstants.CONFORME, template,
dettPratica.getDettPraticaId(), DettPratica.class.getName(),
@ -1539,7 +1624,7 @@ public class SismicaUtil {
private static void inviaVidimazione(DettPratica dettPratica, ControlloPratica controllo, long template)
throws PortalException, SystemException {
ServiceContext serviceContext = getServiceContext(dettPratica);
ServiceContext serviceContext = getServiceContextbyDettPratica(dettPratica);
AvvisoLocalServiceUtil.addAvviso(dettPratica.getIntPraticaId(), "Avviso di Vidimazione", new Date(),
AvvisoUtil.TIPO_AVVISO_DIRETTO, StatoPraticaConstants.VIDIMATA, template,
dettPratica.getDettPraticaId(), DettPratica.class.getName(),
@ -1563,7 +1648,15 @@ public class SismicaUtil {
return result;
}
private static ServiceContext getServiceContext(DettPratica dettPratica) {
private static ServiceContext getServiceContextbyIntPratica(IntPratica intPratica) {
ServiceContext serviceContext = new ServiceContext();
serviceContext.setCompanyId(intPratica.getCompanyId());
serviceContext.setScopeGroupId(intPratica.getGroupId());
serviceContext.setUserId(intPratica.getUserId());
return serviceContext;
}
private static ServiceContext getServiceContextbyDettPratica(DettPratica dettPratica) {
ServiceContext serviceContext = new ServiceContext();
serviceContext.setCompanyId(dettPratica.getCompanyId());
serviceContext.setScopeGroupId(dettPratica.getGroupId());

23
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/listener/ControlloPraticaModelListener.java

@ -14,27 +14,26 @@ import com.liferay.portal.model.BaseModelListener;
public class ControlloPraticaModelListener extends BaseModelListener<ControlloPratica> {
private static final Log _log = LogFactoryUtil.getLog(ControlloPraticaModelListener.class);
@Override
public void onAfterUpdate(ControlloPratica model)
throws ModelListenerException {
public void onAfterUpdate(ControlloPratica model) throws ModelListenerException {
try {
Indexer intIndexer = IndexerRegistryUtil.getIndexer(IntPratica.class);
Indexer controlloIndexer = IndexerRegistryUtil.getIndexer(ControlloPratica.class);
intIndexer.delete(model.getCompanyId(), model.getUuid());
intIndexer.reindex(IntPratica.class.getName(), model.getIntPraticaId());
controlloIndexer.delete(model.getCompanyId(),model.getUuid());
controlloIndexer.reindex(ControlloPratica.class.getName(),model.getControlloPraticaId());
controlloIndexer.delete(model.getCompanyId(), model.getUuid());
controlloIndexer.reindex(ControlloPratica.class.getName(), model.getControlloPraticaId());
} catch (SearchException e) {
_log.error(e,e);
}
_log.error(e, e);
}
super.onAfterUpdate(model);
}
}

36
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/listener/DettPraticaModelListener.java

@ -19,28 +19,30 @@ import com.liferay.portal.model.BaseModelListener;
public class DettPraticaModelListener extends BaseModelListener<DettPratica> {
private static final Log _log = LogFactoryUtil.getLog(DettPraticaModelListener.class);
private static final Log _log = LogFactoryUtil.getLog(DettPraticaModelListener.class);
@Override
public void onAfterUpdate(DettPratica model) throws ModelListenerException {
@Override
public void onAfterUpdate(DettPratica model) throws ModelListenerException {
try {
try {
Indexer indexer = IndexerRegistryUtil.getIndexer(IntPratica.class);
indexer.reindex(IntPratica.class.getName(), model.getIntPraticaId());
Indexer indexer = IndexerRegistryUtil.getIndexer(IntPratica.class);
indexer.reindex(IntPratica.class.getName(), model.getIntPraticaId());
if (_log.isDebugEnabled()) {
_log.debug("DettPraticaModelListener - Chiamato Reindex IntPraticaId : " + model.getIntPraticaId());
}
if (_log.isDebugEnabled()) {
_log.debug("DettPraticaModelListener - Chiamato Reindex IntPraticaId : "
+ model.getIntPraticaId());
}
if (model.getStatus() == WorkflowConstants.STATUS_APPROVED) {
IntPratica intPratica = IntPraticaLocalServiceUtil.updateModifiedDate(model.getIntPraticaId(), new Date());
}
if (model.getStatus() == WorkflowConstants.STATUS_APPROVED) {
IntPratica intPratica = IntPraticaLocalServiceUtil.updateModifiedDate(
model.getIntPraticaId(), new Date());
}
} catch (SearchException | NoSuchIntPraticaException | SystemException e) {
_log.error(e, e);
}
} catch (SearchException | NoSuchIntPraticaException | SystemException e) {
_log.error(e, e);
}
super.onAfterUpdate(model);
}
super.onAfterUpdate(model);
}
}

29
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/listener/DocPraticaModelListener.java

@ -13,23 +13,24 @@ import com.liferay.portal.model.BaseModelListener;
public class DocPraticaModelListener extends BaseModelListener<DocPratica> {
private static final Log _log = LogFactoryUtil.getLog(DocPraticaModelListener.class);
private static final Log _log = LogFactoryUtil.getLog(DocPraticaModelListener.class);
@Override
public void onAfterUpdate(DocPratica model) throws ModelListenerException {
@Override
public void onAfterUpdate(DocPratica model) throws ModelListenerException {
try {
try {
Indexer indexer = IndexerRegistryUtil.getIndexer(IntPratica.class);
indexer.reindex(IntPratica.class.getName(), model.getIntPraticaId());
Indexer indexer = IndexerRegistryUtil.getIndexer(IntPratica.class);
indexer.reindex(IntPratica.class.getName(), model.getIntPraticaId());
if (_log.isDebugEnabled()) {
_log.debug("DettPraticaModelListener - Chiamato Reindex IntPraticaId : " + model.getIntPraticaId());
}
} catch (SearchException e) {
_log.error(e, e);
}
if (_log.isDebugEnabled()) {
_log.debug("DettPraticaModelListener - Chiamato Reindex IntPraticaId : "
+ model.getIntPraticaId());
}
} catch (SearchException e) {
_log.error(e, e);
}
super.onAfterUpdate(model);
}
super.onAfterUpdate(model);
}
}

44
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/listener/IntPraticaModelListener.java

@ -20,41 +20,41 @@ import com.liferay.portal.kernel.search.SearchException;
import com.liferay.portal.model.BaseModelListener;
public class IntPraticaModelListener extends BaseModelListener<IntPratica> {
private static final Log _log = LogFactoryUtil.getLog(IntPraticaModelListener.class);
@Override
public void onAfterUpdate(IntPratica model) throws ModelListenerException {
try {
Indexer intIndexer = IndexerRegistryUtil.getIndexer(IntPratica.class);
Indexer controlloIndexer = IndexerRegistryUtil.getIndexer(ControlloPratica.class);
intIndexer.delete(model.getCompanyId(), model.getUuid());
intIndexer.reindex(IntPratica.class.getName(), model.getIntPraticaId());
DynamicQuery queryCP = DynamicQueryFactoryUtil.forClass(ControlloPratica.class);
queryCP.add(RestrictionsFactoryUtil.eq("intPraticaId", model.getIntPraticaId()));
List<ControlloPratica> appList =
ControlloPraticaLocalServiceUtil.dynamicQuery(queryCP, QueryUtil.ALL_POS, QueryUtil.ALL_POS);
if (appList != null && !appList.isEmpty()) {
for (ControlloPratica controlloPratica : appList) {
controlloIndexer.delete(model.getCompanyId(),controlloPratica.getUuid());
controlloIndexer.reindex(ControlloPratica.class.getName(),controlloPratica.getControlloPraticaId());
}
}
queryCP.add(RestrictionsFactoryUtil.eq("intPraticaId", model.getIntPraticaId()));
List<ControlloPratica> appList = ControlloPraticaLocalServiceUtil.dynamicQuery(queryCP,
QueryUtil.ALL_POS, QueryUtil.ALL_POS);
if (appList != null && !appList.isEmpty()) {
for (ControlloPratica controlloPratica : appList) {
controlloIndexer.delete(model.getCompanyId(), controlloPratica.getUuid());
controlloIndexer.reindex(ControlloPratica.class.getName(),
controlloPratica.getControlloPraticaId());
}
}
} catch (SearchException e) {
_log.error(e,e);
_log.error(e, e);
} catch (SystemException e) {
_log.error(e,e);
_log.error(e, e);
}
super.onAfterUpdate(model);
}
}

136
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/listener/KaleoInstanceModelListener.java

@ -13,102 +13,104 @@ import com.liferay.portal.workflow.kaleo.model.KaleoInstance;
public class KaleoInstanceModelListener extends BaseModelListener<KaleoInstance> {
private static final Log _log = LogFactoryUtil.getLog(KaleoInstanceModelListener.class);
private static final Log _log = LogFactoryUtil.getLog(KaleoInstanceModelListener.class);
@Override
public void onAfterUpdate(KaleoInstance model) throws ModelListenerException {
@Override
public void onAfterUpdate(KaleoInstance model) throws ModelListenerException {
try {
try {
if (model.getClassName().equals(ControlloPratica.class.getName())) {
if (model.getClassName().equals(ControlloPratica.class.getName())) {
Indexer indexer = IndexerRegistryUtil.getIndexer(ControlloPratica.class);
indexer.reindex(ControlloPratica.class.getName(), model.getClassPK());
Indexer indexer = IndexerRegistryUtil.getIndexer(ControlloPratica.class);
indexer.reindex(ControlloPratica.class.getName(), model.getClassPK());
if (_log.isDebugEnabled()) {
_log.debug("KaleoInstanceModelListener - Chiamato Reindex ControlloPraticaId : " + model.getClassPK());
}
}
if (_log.isDebugEnabled()) {
_log.debug("KaleoInstanceModelListener - Chiamato Reindex ControlloPraticaId : "
+ model.getClassPK());
}
}
} catch (SearchException e) {
_log.error(e, e);
}
} catch (SearchException e) {
_log.error(e, e);
}
super.onAfterUpdate(model);
}
super.onAfterUpdate(model);
}
@Override
public void onAfterAddAssociation(Object classPK, String associationClassName, Object associationClassPK)
throws ModelListenerException {
@Override
public void onAfterAddAssociation(Object classPK, String associationClassName, Object associationClassPK)
throws ModelListenerException {
super.onAfterAddAssociation(classPK, associationClassName, associationClassPK);
}
super.onAfterAddAssociation(classPK, associationClassName, associationClassPK);
}
@Override
public void onAfterCreate(KaleoInstance model) throws ModelListenerException {
@Override
public void onAfterCreate(KaleoInstance model) throws ModelListenerException {
super.onAfterCreate(model);
}
super.onAfterCreate(model);
}
@Override
public void onAfterRemove(KaleoInstance model) throws ModelListenerException {
@Override
public void onAfterRemove(KaleoInstance model) throws ModelListenerException {
try {
try {
if (model.getClassName().equals(ControlloPratica.class.getName())) {
if (model.getClassName().equals(ControlloPratica.class.getName())) {
Indexer indexer = IndexerRegistryUtil.getIndexer(ControlloPratica.class);
indexer.reindex(ControlloPratica.class.getName(), model.getClassPK());
Indexer indexer = IndexerRegistryUtil.getIndexer(ControlloPratica.class);
indexer.reindex(ControlloPratica.class.getName(), model.getClassPK());
if (_log.isDebugEnabled()) {
_log.debug("KaleoInstanceModelListener - Chiamato Reindex ControlloPraticaId : " + model.getClassPK());
}
}
if (_log.isDebugEnabled()) {
_log.debug("KaleoInstanceModelListener - Chiamato Reindex ControlloPraticaId : "
+ model.getClassPK());
}
}
} catch (SearchException e) {
_log.error(e, e);
}
} catch (SearchException e) {
_log.error(e, e);
}
super.onAfterRemove(model);
}
super.onAfterRemove(model);
}
@Override
public void onAfterRemoveAssociation(Object classPK, String associationClassName, Object associationClassPK)
throws ModelListenerException {
@Override
public void onAfterRemoveAssociation(Object classPK, String associationClassName,
Object associationClassPK) throws ModelListenerException {
super.onAfterRemoveAssociation(classPK, associationClassName, associationClassPK);
}
super.onAfterRemoveAssociation(classPK, associationClassName, associationClassPK);
}
@Override
public void onBeforeAddAssociation(Object classPK, String associationClassName, Object associationClassPK)
throws ModelListenerException {
@Override
public void onBeforeAddAssociation(Object classPK, String associationClassName, Object associationClassPK)
throws ModelListenerException {
super.onBeforeAddAssociation(classPK, associationClassName, associationClassPK);
}
super.onBeforeAddAssociation(classPK, associationClassName, associationClassPK);
}
@Override
public void onBeforeCreate(KaleoInstance model) throws ModelListenerException {
@Override
public void onBeforeCreate(KaleoInstance model) throws ModelListenerException {
super.onBeforeCreate(model);
}
super.onBeforeCreate(model);
}
@Override
public void onBeforeRemove(KaleoInstance model) throws ModelListenerException {
@Override
public void onBeforeRemove(KaleoInstance model) throws ModelListenerException {
super.onBeforeRemove(model);
}
super.onBeforeRemove(model);
}
@Override
public void onBeforeRemoveAssociation(Object classPK, String associationClassName, Object associationClassPK)
throws ModelListenerException {
@Override
public void onBeforeRemoveAssociation(Object classPK, String associationClassName,
Object associationClassPK) throws ModelListenerException {
super.onBeforeRemoveAssociation(classPK, associationClassName, associationClassPK);
}
super.onBeforeRemoveAssociation(classPK, associationClassName, associationClassPK);
}
@Override
public void onBeforeUpdate(KaleoInstance model) throws ModelListenerException {
@Override
public void onBeforeUpdate(KaleoInstance model) throws ModelListenerException {
super.onBeforeUpdate(model);
}
super.onBeforeUpdate(model);
}
}

183
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/listener/KaleoLogModelListener.java

@ -17,128 +17,127 @@ import com.liferay.portal.workflow.kaleo.service.KaleoInstanceTokenLocalServiceU
public class KaleoLogModelListener extends BaseModelListener<KaleoLog> {
private static final Log _log = LogFactoryUtil.getLog(KaleoLogModelListener.class);
private static final Log _log = LogFactoryUtil.getLog(KaleoLogModelListener.class);
@Override
public void onAfterCreate(KaleoLog model) throws ModelListenerException {
@Override
public void onAfterCreate(KaleoLog model) throws ModelListenerException {
try {
try {
long kaleoInstanceTokenId = model.getKaleoInstanceTokenId();
KaleoInstanceToken instanceToken =
KaleoInstanceTokenLocalServiceUtil.fetchKaleoInstanceToken(kaleoInstanceTokenId);
long kaleoInstanceTokenId = model.getKaleoInstanceTokenId();
KaleoInstanceToken instanceToken = KaleoInstanceTokenLocalServiceUtil
.fetchKaleoInstanceToken(kaleoInstanceTokenId);
if (Validator.isNotNull(instanceToken)) {
if (instanceToken.getClassName().equals(ControlloPratica.class.getName())) {
if (Validator.isNotNull(instanceToken)) {
if (instanceToken.getClassName().equals(ControlloPratica.class.getName())) {
Indexer indexer = IndexerRegistryUtil.getIndexer(ControlloPratica.class);
indexer.reindex(ControlloPratica.class.getName(), instanceToken.getClassPK());
Indexer indexer = IndexerRegistryUtil.getIndexer(ControlloPratica.class);
indexer.reindex(ControlloPratica.class.getName(), instanceToken.getClassPK());
if (_log.isDebugEnabled()) {
_log.debug("KaleoLogModelListener - Chiamato Reindex ControlloPraticaId : " + instanceToken.getClassPK());
}
}
}
if (_log.isDebugEnabled()) {
_log.debug("KaleoLogModelListener - Chiamato Reindex ControlloPraticaId : "
+ instanceToken.getClassPK());
}
}
}
} catch (SearchException e) {
_log.error(e, e);
} catch (SystemException e) {
_log.error(e, e);
}
} catch (SearchException e) {
_log.error(e, e);
} catch (SystemException e) {
_log.error(e, e);
}
super.onAfterUpdate(model);
}
super.onAfterUpdate(model);
}
@Override
public void onAfterAddAssociation(Object classPK, String associationClassName, Object associationClassPK)
throws ModelListenerException {
@Override
public void onAfterAddAssociation(Object classPK, String associationClassName, Object associationClassPK)
throws ModelListenerException {
// TODO Auto-generated method stub
super.onAfterAddAssociation(classPK, associationClassName, associationClassPK);
}
// TODO Auto-generated method stub
super.onAfterAddAssociation(classPK, associationClassName, associationClassPK);
}
@Override
public void onAfterRemove(KaleoLog model) throws ModelListenerException {
@Override
public void onAfterRemove(KaleoLog model) throws ModelListenerException {
try {
try {
long kaleoInstanceTokenId = model.getKaleoInstanceTokenId();
KaleoInstanceToken instanceToken = KaleoInstanceTokenLocalServiceUtil
.fetchKaleoInstanceToken(kaleoInstanceTokenId);
long kaleoInstanceTokenId = model.getKaleoInstanceTokenId();
KaleoInstanceToken instanceToken =
KaleoInstanceTokenLocalServiceUtil.fetchKaleoInstanceToken(kaleoInstanceTokenId);
if (Validator.isNotNull(instanceToken)) {
if (instanceToken.getClassName().equals(ControlloPratica.class.getName())) {
if (Validator.isNotNull(instanceToken)) {
if (instanceToken.getClassName().equals(ControlloPratica.class.getName())) {
Indexer indexer = IndexerRegistryUtil.getIndexer(ControlloPratica.class);
indexer.reindex(ControlloPratica.class.getName(), instanceToken.getClassPK());
Indexer indexer = IndexerRegistryUtil.getIndexer(ControlloPratica.class);
indexer.reindex(ControlloPratica.class.getName(), instanceToken.getClassPK());
if (_log.isDebugEnabled()) {
_log.debug("KaleoLogModelListener - Chiamato Reindex ControlloPraticaId : "
+ instanceToken.getClassPK());
}
}
}
if (_log.isDebugEnabled()) {
_log.debug("KaleoLogModelListener - Chiamato Reindex ControlloPraticaId : " + instanceToken.getClassPK());
}
}
}
} catch (SearchException e) {
_log.error(e, e);
} catch (SystemException e) {
_log.error(e, e);
}
super.onAfterRemove(model);
}
} catch (SearchException e) {
_log.error(e, e);
} catch (SystemException e) {
_log.error(e, e);
}
@Override
public void onAfterRemoveAssociation(Object classPK, String associationClassName,
Object associationClassPK) throws ModelListenerException {
// TODO Auto-generated method stub
super.onAfterRemoveAssociation(classPK, associationClassName, associationClassPK);
}
super.onAfterRemove(model);
}
@Override
public void onAfterUpdate(KaleoLog model) throws ModelListenerException {
@Override
public void onAfterRemoveAssociation(Object classPK, String associationClassName, Object associationClassPK)
throws ModelListenerException {
// TODO Auto-generated method stub
super.onAfterUpdate(model);
}
// TODO Auto-generated method stub
super.onAfterRemoveAssociation(classPK, associationClassName, associationClassPK);
}
@Override
public void onBeforeAddAssociation(Object classPK, String associationClassName, Object associationClassPK)
throws ModelListenerException {
@Override
public void onAfterUpdate(KaleoLog model) throws ModelListenerException {
// TODO Auto-generated method stub
super.onBeforeAddAssociation(classPK, associationClassName, associationClassPK);
}
// TODO Auto-generated method stub
super.onAfterUpdate(model);
}
@Override
public void onBeforeCreate(KaleoLog model) throws ModelListenerException {
@Override
public void onBeforeAddAssociation(Object classPK, String associationClassName, Object associationClassPK)
throws ModelListenerException {
// TODO Auto-generated method stub
super.onBeforeCreate(model);
}
// TODO Auto-generated method stub
super.onBeforeAddAssociation(classPK, associationClassName, associationClassPK);
}
@Override
public void onBeforeRemove(KaleoLog model) throws ModelListenerException {
@Override
public void onBeforeCreate(KaleoLog model) throws ModelListenerException {
// TODO Auto-generated method stub
super.onBeforeRemove(model);
}
// TODO Auto-generated method stub
super.onBeforeCreate(model);
}
@Override
public void onBeforeRemoveAssociation(Object classPK, String associationClassName,
Object associationClassPK) throws ModelListenerException {
@Override
public void onBeforeRemove(KaleoLog model) throws ModelListenerException {
// TODO Auto-generated method stub
super.onBeforeRemoveAssociation(classPK, associationClassName, associationClassPK);
}
// TODO Auto-generated method stub
super.onBeforeRemove(model);
}
@Override
public void onBeforeUpdate(KaleoLog model) throws ModelListenerException {
@Override
public void onBeforeRemoveAssociation(Object classPK, String associationClassName, Object associationClassPK)
throws ModelListenerException {
// TODO Auto-generated method stub
super.onBeforeRemoveAssociation(classPK, associationClassName, associationClassPK);
}
@Override
public void onBeforeUpdate(KaleoLog model) throws ModelListenerException {
// TODO Auto-generated method stub
super.onBeforeUpdate(model);
}
// TODO Auto-generated method stub
super.onBeforeUpdate(model);
}
}

152
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/listener/KaleoTaskInstanceTokenModelListener.java

@ -13,110 +13,112 @@ import com.liferay.portal.workflow.kaleo.model.KaleoTaskInstanceToken;
public class KaleoTaskInstanceTokenModelListener extends BaseModelListener<KaleoTaskInstanceToken> {
private static final Log _log = LogFactoryUtil.getLog(KaleoTaskInstanceTokenModelListener.class);
private static final Log _log = LogFactoryUtil.getLog(KaleoTaskInstanceTokenModelListener.class);
@Override
public void onAfterUpdate(KaleoTaskInstanceToken model) throws ModelListenerException {
@Override
public void onAfterUpdate(KaleoTaskInstanceToken model) throws ModelListenerException {
try {
try {
if (model.getClassName().equals(ControlloPratica.class.getName())) {
if (model.getClassName().equals(ControlloPratica.class.getName())) {
Indexer indexer = IndexerRegistryUtil.getIndexer(ControlloPratica.class);
indexer.reindex(ControlloPratica.class.getName(), model.getClassPK());
Indexer indexer = IndexerRegistryUtil.getIndexer(ControlloPratica.class);
indexer.reindex(ControlloPratica.class.getName(), model.getClassPK());
if (_log.isDebugEnabled()) {
_log.debug("KaleoTaskInstanceToken - Chiamato Reindex ControlloPraticaId : " + model.getClassPK());
}
}
if (_log.isDebugEnabled()) {
_log.debug("KaleoTaskInstanceToken - Chiamato Reindex ControlloPraticaId : "
+ model.getClassPK());
}
}
} catch (SearchException e) {
_log.error(e, e);
}
} catch (SearchException e) {
_log.error(e, e);
}
super.onAfterUpdate(model);
}
super.onAfterUpdate(model);
}
@Override
public void onAfterAddAssociation(Object classPK, String associationClassName, Object associationClassPK)
throws ModelListenerException {
@Override
public void onAfterAddAssociation(Object classPK, String associationClassName, Object associationClassPK)
throws ModelListenerException {
// TODO Auto-generated method stub
super.onAfterAddAssociation(classPK, associationClassName, associationClassPK);
}
// TODO Auto-generated method stub
super.onAfterAddAssociation(classPK, associationClassName, associationClassPK);
}
@Override
public void onAfterCreate(KaleoTaskInstanceToken model) throws ModelListenerException {
@Override
public void onAfterCreate(KaleoTaskInstanceToken model) throws ModelListenerException {
// TODO Auto-generated method stub
super.onAfterCreate(model);
}
// TODO Auto-generated method stub
super.onAfterCreate(model);
}
@Override
public void onAfterRemove(KaleoTaskInstanceToken model) throws ModelListenerException {
@Override
public void onAfterRemove(KaleoTaskInstanceToken model) throws ModelListenerException {
try {
try {
if (model.getClassName().equals(ControlloPratica.class.getName())) {
if (model.getClassName().equals(ControlloPratica.class.getName())) {
Indexer indexer = IndexerRegistryUtil.getIndexer(ControlloPratica.class);
indexer.reindex(ControlloPratica.class.getName(), model.getClassPK());
Indexer indexer = IndexerRegistryUtil.getIndexer(ControlloPratica.class);
indexer.reindex(ControlloPratica.class.getName(), model.getClassPK());
if (_log.isDebugEnabled()) {
_log.debug("KaleoTaskInstanceToken - Chiamato Reindex ControlloPraticaId : " + model.getClassPK());
}
}
if (_log.isDebugEnabled()) {
_log.debug("KaleoTaskInstanceToken - Chiamato Reindex ControlloPraticaId : "
+ model.getClassPK());
}
}
} catch (SearchException e) {
_log.error(e, e);
}
} catch (SearchException e) {
_log.error(e, e);
}
super.onAfterRemove(model);
}
super.onAfterRemove(model);
}
@Override
public void onAfterRemoveAssociation(Object classPK, String associationClassName, Object associationClassPK)
throws ModelListenerException {
@Override
public void onAfterRemoveAssociation(Object classPK, String associationClassName,
Object associationClassPK) throws ModelListenerException {
// TODO Auto-generated method stub
super.onAfterRemoveAssociation(classPK, associationClassName, associationClassPK);
}
// TODO Auto-generated method stub
super.onAfterRemoveAssociation(classPK, associationClassName, associationClassPK);
}
@Override
public void onBeforeAddAssociation(Object classPK, String associationClassName, Object associationClassPK)
throws ModelListenerException {
@Override
public void onBeforeAddAssociation(Object classPK, String associationClassName, Object associationClassPK)
throws ModelListenerException {
// TODO Auto-generated method stub
super.onBeforeAddAssociation(classPK, associationClassName, associationClassPK);
}
// TODO Auto-generated method stub
super.onBeforeAddAssociation(classPK, associationClassName, associationClassPK);
}
@Override
public void onBeforeCreate(KaleoTaskInstanceToken model) throws ModelListenerException {
@Override
public void onBeforeCreate(KaleoTaskInstanceToken model) throws ModelListenerException {
// TODO Auto-generated method stub
super.onBeforeCreate(model);
}
// TODO Auto-generated method stub
super.onBeforeCreate(model);
}
@Override
public void onBeforeRemove(KaleoTaskInstanceToken model) throws ModelListenerException {
@Override
public void onBeforeRemove(KaleoTaskInstanceToken model) throws ModelListenerException {
// TODO Auto-generated method stub
super.onBeforeRemove(model);
}
// TODO Auto-generated method stub
super.onBeforeRemove(model);
}
@Override
public void onBeforeRemoveAssociation(Object classPK, String associationClassName, Object associationClassPK)
throws ModelListenerException {
@Override
public void onBeforeRemoveAssociation(Object classPK, String associationClassName,
Object associationClassPK) throws ModelListenerException {
// TODO Auto-generated method stub
super.onBeforeRemoveAssociation(classPK, associationClassName, associationClassPK);
}
// TODO Auto-generated method stub
super.onBeforeRemoveAssociation(classPK, associationClassName, associationClassPK);
}
@Override
public void onBeforeUpdate(KaleoTaskInstanceToken model) throws ModelListenerException {
@Override
public void onBeforeUpdate(KaleoTaskInstanceToken model) throws ModelListenerException {
// TODO Auto-generated method stub
super.onBeforeUpdate(model);
}
// TODO Auto-generated method stub
super.onBeforeUpdate(model);
}
}

29
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/listener/SoggettoModelListener.java

@ -13,23 +13,24 @@ import com.liferay.portal.model.BaseModelListener;
public class SoggettoModelListener extends BaseModelListener<Soggetto> {
private static final Log _log = LogFactoryUtil.getLog(SoggettoModelListener.class);
private static final Log _log = LogFactoryUtil.getLog(SoggettoModelListener.class);
@Override
public void onAfterUpdate(Soggetto model) throws ModelListenerException {
@Override
public void onAfterUpdate(Soggetto model) throws ModelListenerException {
try {
try {
Indexer indexer = IndexerRegistryUtil.getIndexer(IntPratica.class);
indexer.reindex(IntPratica.class.getName(), model.getIntPraticaId());
Indexer indexer = IndexerRegistryUtil.getIndexer(IntPratica.class);
indexer.reindex(IntPratica.class.getName(), model.getIntPraticaId());
if (_log.isDebugEnabled()) {
_log.debug("DettPraticaModelListener - Chiamato Reindex IntPraticaId : " + model.getIntPraticaId());
}
} catch (SearchException e) {
_log.error(e, e);
}
if (_log.isDebugEnabled()) {
_log.debug("DettPraticaModelListener - Chiamato Reindex IntPraticaId : "
+ model.getIntPraticaId());
}
} catch (SearchException e) {
_log.error(e, e);
}
super.onAfterUpdate(model);
}
super.onAfterUpdate(model);
}
}

14
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/PortosAdministrationPortlet.java → liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/SismicaAdministrationPortlet.java

@ -38,11 +38,11 @@ import com.liferay.portal.theme.ThemeDisplay;
import com.liferay.util.bridges.mvc.MVCPortlet;
/**
* Portlet implementation class PortosAdministrationPortlet
* Portlet implementation class SismicaAdministrationPortlet
*/
public class PortosAdministrationPortlet extends MVCPortlet {
public class SismicaAdministrationPortlet extends MVCPortlet {
private static final Log _log = LogFactoryUtil.getLog(PortosAdministrationPortlet.class);
private static final Log _log = LogFactoryUtil.getLog(SismicaAdministrationPortlet.class);
public void mostraConfigurazione(ActionRequest actionRequest, ActionResponse actionResponse)
throws SystemException {
@ -70,6 +70,10 @@ public class PortosAdministrationPortlet extends MVCPortlet {
}
actionResponse.setRenderParameter("esito", esito.toArray(new String[esito.size()]));
}
public void sostituisciDL(ActionRequest actionRequest, ActionResponse actionResponse) {
SismicaUtil.sostituisciDL(actionRequest, actionResponse);
}
public void resetFirme(ActionRequest actionRequest, ActionResponse actionResponse) {
ThemeDisplay td = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
@ -127,6 +131,10 @@ public class PortosAdministrationPortlet extends MVCPortlet {
List<String> esito = PuliziaDatabase.pulisci(serviceContext);
actionResponse.setRenderParameter("esito", esito.toArray(new String[esito.size()]));
}
public void inviaAvviso(ActionRequest actionRequest, ActionResponse actionResponse) throws SystemException {
SismicaUtil.inviaAvviso(actionRequest, actionResponse);
}
public void salvaDataProssimoSorteggio(ActionRequest actionRequest, ActionResponse actionResponse)
throws PortalException, SystemException {

2
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AvvisoLocalServiceImpl.java

@ -120,8 +120,6 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
String propertiesTemplate = null;
String tipoProcedura = intPratica.getTipoProcedura();
switch (statoPratica) {
// case StatoPraticaConstants.INTEGRAZIONE:
// break;
case StatoPraticaConstants.SOTTOPOSTA_A_PARERE:
if (Validator.isNull(tipoProcedura) || tipoProcedura.equalsIgnoreCase(Constants.PROCEDURA_A)) {
propertiesTemplate = AvvisoUtil.getAllTipoDocumentoFileTemplateProps().get(statoPratica);

4
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ControlloPraticaLocalServiceImpl.java

@ -759,7 +759,7 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi
.getOrderByComparatorFactory().create("portos_bo_Avviso", "createDate", true));
Date start = null;
Date end = null;
_log.debug("Pratica " + pratica.getNumeroProgetto());
for (Avviso avviso : avvisi) {
if (!avviso.isAnnullato()) {
@ -804,7 +804,7 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi
start = end = null;
}
}
// C'è uno stop ancora attivo
if (Validator.isNotNull(start)) {
chiusura = start;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/IntPraticaLocalServiceImpl.java

@ -201,7 +201,6 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl {
*
* @author Manifattura Web Group per Regione Siciliana.
*/
@SuppressWarnings("unchecked")
public Map<String, List<IntPratica>> findSorteggiabili(long companyId, Date dtSorteggio)
throws SystemException, PortalException {
HashMap<String, List<IntPratica>> ret = new HashMap<>();

4
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=2458
build.date=1601547633470
build.number=2459
build.date=1602068010186
build.auto.upgrade=true
##

66
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/sismica_administration/view.jsp

@ -1,3 +1,4 @@
<%@page import="it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants"%>
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="org.apache.commons.lang.time.DateUtils"%>
<%@page import="java.util.Calendar"%>
@ -7,15 +8,22 @@
<%@ include file="/html/sismica_administration/init.jsp"%>
<%
SimpleDateFormat simpleDateTimeFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
SimpleDateFormat simpleDateTimeFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
String dataUltimoSorteggioString =
ConfigurazioneLocalServiceUtil.findByC_ChiaveString(themeDisplay.getCompanyId(), ConfigurazioneConstants.DATE_ULTIMO_SORTEGGIO);
String dataProssimoSorteggio =
ConfigurazioneServiceUtil.findByC_ChiaveString(company.getCompanyId(), "conf.geniocivile.sorteggio.data.prossimo.sorteggio");
%>
<hr style="margin: 0" />
<liferay-ui:error key="operazione-non-supportata" message="Operazione non supportata" />
<liferay-ui:error key="invia-avviso-tipo-obbligatorio" message="Nessun tipo di avviso selezionato" />
<liferay-ui:error key="invia-avviso-progetto-obbligatorio"
message="Non è stato indicato nessun numero di progetto" />
<liferay-ui:error key="invia-avviso-progetto-inesistente" message="Progetto non trovato" />
<liferay-ui:error key="invia-avviso-collaudo-non-trovato"
message="Non è stato trovato alcun collaudo completo e protocollato per il progetto selezionato" />
<hr style="margin: 0" />
<liferay-portlet:actionURL name="reIndexFasciolo" var="reIndexFascioloURL" />
<liferay-portlet:actionURL name="reIndexFascicoli" var="reIndexFascicoliURL" />
<liferay-portlet:actionURL name="salvaDataProssimoSorteggio" var="salvaDataProssimoSorteggioURL" />
@ -108,10 +116,11 @@ String dataProssimoSorteggio =
</div>
<liferay-portlet:actionURL name="resetFirme" var="resetFirmeURL" />
<liferay-portlet:actionURL name="inviaAvviso" var="inviaAvvisoURL" />
<div class="row-fluid" style="margin-top: 10px">
<div class="span6">
<div style="font-weight: bold; font-size: 18px; margin-bottom: 10px;">Form per reimpostare
i documenti alla firma</div>
<div style="font-weight: bold; font-size: 18px; margin-bottom: 10px;">Form per reimpostare i documenti
alla firma</div>
<aui:form action="<%=resetFirmeURL%>" method="post" name="fmResetFirme">
<div>
<aui:input name="numeroProgetto" label="Numero progetto">
@ -121,8 +130,55 @@ String dataProssimoSorteggio =
</div>
</aui:form>
</div>
<%
String tipoAvviso = ParamUtil.getString(renderRequest, "tipoAvviso", "");
String numeroProgetto = ParamUtil.getString(renderRequest, "numeroProgetto", "");
%>
<div class="span6">
<div style="font-weight: bold; font-size: 18px; margin-bottom: 10px;">Invia avviso</div>
<aui:form action="<%=inviaAvvisoURL%>" method="post" name="fmResetFirme">
<div>
<aui:select name="tipoAvviso">
<aui:option label="Seleziona tipo avviso" value=""></aui:option>
<aui:option label="Vidimazione collaudo"
selected="<%=tipoAvviso.equals(StatoPraticaConstants.COLLAUDO)%>"
value="<%=StatoPraticaConstants.COLLAUDO%>"></aui:option>
</aui:select>
</div>
<div>
<aui:input name="numeroProgetto" label="Numero progetto" value="<%=numeroProgetto%>">
<aui:validator name="number" />
</aui:input>
<aui:button type="submit" value="Invia avviso" />
</div>
</aui:form>
</div>
</div>
<%
String oggetto = ParamUtil.getString(renderRequest, "tipoAvviso", "");
%>
<liferay-portlet:actionURL name="sostituisciDL" var="sostituisciDLURL" />
<div class="row-fluid" style="margin-top: 10px">
<div class="span6">
<div style="font-weight: bold; font-size: 18px; margin-bottom: 10px;">Form per sostituire file in
Document Library</div>
<aui:form action="<%=sostituisciDLURL%>" method="post" enctype="multipart/form-data" name="fmSostituisciDL">
<div>
<aui:select name="className">
<aui:option label="Seleziona tipo di oggetto" value=""></aui:option>
<aui:option label="DocPratica (allegati)" selected="<%=oggetto.equals(DocPratica.class.getName())%>"
value="<%=DocPratica.class.getName()%>"></aui:option>
</aui:select>
<aui:input type="file" name="file" label="File" />
<aui:input name="classPK" label="Id oggetto">
<aui:validator name="number" />
</aui:input>
<aui:button type="submit" value="Sostituisci file in DL" />
</div>
</aui:form>
</div>
</div>
<%
String[] esito = renderRequest.getParameterValues("esito");
%>
@ -149,4 +205,6 @@ String dataProssimoSorteggio =
}
});
});
</aui:script>

37
liferay-plugins-sdk-6.2/portlets/portos-importazione-portlet/bin/.project

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>portos-importazione-portlet</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
<nature>org.apache.ivyde.eclipse.ivynature</nature>
</natures>
</projectDescription>
Caricamento…
Annulla
Salva