Salvatore La Manna 4 anni fa
parent
commit
2dc29866ee
  1. 40
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/ManutenzioneDatabase.java
  2. 29
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SismicaUtil.java
  3. 14
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/indexer/ControlloPraticaIndexer.java
  4. 186
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/indexer/IntPraticaIndexer.java
  5. 21
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/AllegatoManualeImpl.java
  6. 34
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/AsseverazioneImpl.java
  7. 98
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/AvvisoImpl.java
  8. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/CollaudoImpl.java
  9. 3
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/DelegaImpl.java
  10. 3
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/DettPraticaImpl.java
  11. 2
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/DocAggiuntivaImpl.java
  12. 2
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/DocPraticaImpl.java
  13. 62
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/FineLavoriImpl.java
  14. 27
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/HistoryWorkflowActionImpl.java
  15. 27
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/IUVImpl.java
  16. 27
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/InfoFascicoloImpl.java
  17. 44
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/IntPraticaImpl.java
  18. 38
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/PagamentoImpl.java
  19. 22
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/ParereGeologoImpl.java
  20. 27
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/ProvinciaImpl.java
  21. 41
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/SoggettoImpl.java
  22. 31
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/SorteggioImpl.java
  23. 28
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/StoricoSoggettoPraticaImpl.java
  24. 22
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/TempisticaImpl.java
  25. 31
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/TerritorioImpl.java
  26. 27
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/UtentePortosImpl.java
  27. 47
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/scheduler/SchedulerPratiche.java
  28. 25
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AllegatoManualeLocalServiceImpl.java
  29. 56
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AllegatoManualeServiceImpl.java
  30. 76
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AsseverazioneLocalServiceImpl.java
  31. 106
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AvvisoLocalServiceImpl.java
  32. 149
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/CollaudoLocalServiceImpl.java
  33. 133
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ComunicazioneLocalServiceImpl.java
  34. 43
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ConfigurazioneLocalServiceImpl.java
  35. 21
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ControlloPraticaLocalServiceImpl.java
  36. 246
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DelegaLocalServiceImpl.java
  37. 512
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DettPraticaLocalServiceImpl.java
  38. 82
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DocAggiuntivaLocalServiceImpl.java
  39. 285
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DocPraticaLocalServiceImpl.java
  40. 48
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DocPraticaServiceImpl.java
  41. 279
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/FineLavoriLocalServiceImpl.java
  42. 41
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/HistoryWorkflowActionLocalServiceImpl.java
  43. 47
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/InfoFascicoloLocalServiceImpl.java
  44. 470
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/IntPraticaLocalServiceImpl.java
  45. 275
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/PagamentoLocalServiceImpl.java
  46. 3
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/Constants.java
  47. 5
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/ContentType.java
  48. 147
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/FestivitaUtil.java
  49. 42
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/GenioCivileBaseUtil.java
  50. 6
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/GestioneFirmeUtil.java
  51. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/MockAllegato.java
  52. 97
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/PagamentiUtil.java
  53. 76
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/workflow/ControlloPraticaWorkflowHandler.java
  54. 4
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties
  55. BIN
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/commons-beanutils.jar
  56. BIN
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/commons-codec.jar
  57. BIN
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/commons-collections.jar
  58. BIN
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/commons-digester.jar
  59. BIN
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/commons-io.jar
  60. BIN
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/commons-lang.jar
  61. BIN
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/commons-logging.jar
  62. BIN
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/jstl-api.jar
  63. BIN
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/jstl-impl.jar
  64. BIN
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/log4j.jar
  65. BIN
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/util-bridges.jar
  66. BIN
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/util-taglib.jar
  67. 572
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/tld/c.tld
  68. 4
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/service.properties

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

@ -156,8 +156,12 @@ public class ManutenzioneDatabase {
public static List<String> pulisci(ServiceContext serviceContext, String mode) throws SystemException, public static List<String> pulisci(ServiceContext serviceContext, String mode) throws SystemException,
PortalException { PortalException {
List<String> esito = new ArrayList<>(); List<String> esito = new ArrayList<>();
long companyId = serviceContext.getCompanyId(); long companyId = serviceContext.getCompanyId();
if (mode.contains("!Workflow=")) {
esito.addAll(SismicaUtil.riparaWorkflow(mode.replaceAll(".*?!Workflow=([^!]*)!", "$1")));
}
if (mode.contains("!Pulisci!")) { if (mode.contains("!Pulisci!")) {
esito.addAll(puliziaDocumentLibrary(companyId)); esito.addAll(puliziaDocumentLibrary(companyId));
esitoLog( esitoLog(
@ -166,8 +170,8 @@ public class ManutenzioneDatabase {
ConfigurazioneConstants.ATTACHMENT_FOLDER_ID))); ConfigurazioneConstants.ATTACHMENT_FOLDER_ID)));
esitoLog( esitoLog(
esito, esito,
puliziaAllegati(companyId, ConfigurazioneLocalServiceUtil.findByC_ChiaveLong(companyId, puliziaAllegati(companyId, ConfigurazioneLocalServiceUtil.findByC_ChiaveLong(companyId, AvvisoUtil
AvvisoUtil.getAllTipoDocumentoFolderProps().get(StatoPraticaConstants.CONFORME)))); .getAllTipoDocumentoFolderProps().get(StatoPraticaConstants.CONFORME))));
if (mode.contains("!IntPratica!")) { if (mode.contains("!IntPratica!")) {
esitoLog(esito, svuotaIntPraticaDettPratica()); esitoLog(esito, svuotaIntPraticaDettPratica());
} }
@ -176,8 +180,7 @@ public class ManutenzioneDatabase {
} }
esito.addAll(svuotaDatabase(companyId)); esito.addAll(svuotaDatabase(companyId));
if (mode.contains("!Reset!")) { if (mode.contains("!Reset!")) {
ConfigurazioneLocalServiceUtil.storeConfig(Constants.NUMERO_PROGETTO_KEY_DB, "1", ConfigurazioneLocalServiceUtil.storeConfig(Constants.NUMERO_PROGETTO_KEY_DB, "1", serviceContext);
serviceContext);
} }
clearCache(); clearCache();
_log.info("Elaborazione completata correttamente."); _log.info("Elaborazione completata correttamente.");
@ -185,10 +188,6 @@ public class ManutenzioneDatabase {
if (mode.contains("!Integrazioni!")) { if (mode.contains("!Integrazioni!")) {
SismicaUtil.integrazioniScadute(); SismicaUtil.integrazioniScadute();
} }
if (mode.startsWith("!Workflow!")) {
String[] pezzi = StringUtil.split(mode, '!');
esito.addAll(SismicaUtil.aggiungiWorkflow(pezzi[2], pezzi[3]));
}
return esito; return esito;
} }
@ -262,12 +261,10 @@ public class ManutenzioneDatabase {
if (parent.getFolderId() == allegatiFolderId) { if (parent.getFolderId() == allegatiFolderId) {
long[] ids = StringUtil.split(folder.getName(), "_", 0L); long[] ids = StringUtil.split(folder.getName(), "_", 0L);
if ((ids.length == 2) && (ids[0] == ids[1])) { if ((ids.length == 2) && (ids[0] == ids[1])) {
if (!esiste(DETTPRATICA_CLASS_NAME, ids[0]) if (!esiste(DETTPRATICA_CLASS_NAME, ids[0]) && !esiste(DOCPRATICA_CLASS_NAME, ids[0])
&& !esiste(DOCPRATICA_CLASS_NAME, ids[0])
&& !esiste(ALLEGATOMANUALE_CLASS_NAME, ids[0]) && !esiste(ALLEGATOMANUALE_CLASS_NAME, ids[0])
&& !esiste(ASSEVERAZIONE_CLASS_NAME, ids[0]) && !esiste(ASSEVERAZIONE_CLASS_NAME, ids[0])
&& !esiste(AVVISO_CLASS_NAME, ids[0]) && !esiste(AVVISO_CLASS_NAME, ids[0]) && !esiste(COLLAUDO_CLASS_NAME, ids[0])
&& !esiste(COLLAUDO_CLASS_NAME, ids[0])
&& !esiste(CONTROLLOPRATICA_CLASS_NAME, ids[0]) && !esiste(CONTROLLOPRATICA_CLASS_NAME, ids[0])
&& !esiste(DELEGA_CLASS_NAME, ids[0]) && !esiste(DELEGA_CLASS_NAME, ids[0])
&& !esiste(DOCAGGIUNTIVA_CLASS_NAME, ids[0]) && !esiste(DOCAGGIUNTIVA_CLASS_NAME, ids[0])
@ -291,8 +288,7 @@ public class ManutenzioneDatabase {
emailId = Long.parseLong(folder.getName()); emailId = Long.parseLong(folder.getName());
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
} }
if (Validator.isNotNull(emailId) if (Validator.isNotNull(emailId) && String.valueOf(emailId).equals(folder.getName())
&& String.valueOf(emailId).equals(folder.getName())
&& !esiste(EMAIL_CLASS_NAME, emailId)) { && !esiste(EMAIL_CLASS_NAME, emailId)) {
_log.info("Cancello la cartella " + folder.getName()); _log.info("Cancello la cartella " + folder.getName());
DLAppLocalServiceUtil.deleteFolder(folder.getFolderId()); DLAppLocalServiceUtil.deleteFolder(folder.getFolderId());
@ -332,8 +328,7 @@ public class ManutenzioneDatabase {
return result; return result;
} }
private static String puliziaAllegati(long companyId, long folderId) throws SystemException, private static String puliziaAllegati(long companyId, long folderId) throws SystemException, PortalException {
PortalException {
List<Long> avvisiFileEntries = avvisiFileEntries(); List<Long> avvisiFileEntries = avvisiFileEntries();
long repositoryId = DLAppLocalServiceUtil.getFolder(folderId).getRepositoryId(); long repositoryId = DLAppLocalServiceUtil.getFolder(folderId).getRepositoryId();
int start = 0; int start = 0;
@ -343,8 +338,7 @@ public class ManutenzioneDatabase {
int rimossi = 0; int rimossi = 0;
fileEntries = DLAppServiceUtil.getFileEntries(repositoryId, folderId, start, start + SLICE); fileEntries = DLAppServiceUtil.getFileEntries(repositoryId, folderId, start, start + SLICE);
for (FileEntry fileEntry : fileEntries) { for (FileEntry fileEntry : fileEntries) {
String[] parti = StringUtil.split(fileEntry.getTitle() String[] parti = StringUtil.split(fileEntry.getTitle().replaceAll("\\.p7m$", StringPool.BLANK), '_');
.replaceAll("\\.p7m$", StringPool.BLANK), '_');
String strId1 = parti[0]; String strId1 = parti[0];
String tipo = StringPool.BLANK; String tipo = StringPool.BLANK;
String strId2 = StringPool.BLANK; String strId2 = StringPool.BLANK;
@ -886,8 +880,7 @@ public class ManutenzioneDatabase {
List<ResourcePermission> resourcePermissions = null; List<ResourcePermission> resourcePermissions = null;
do { do {
int rimossi = 0; int rimossi = 0;
resourcePermissions = ResourcePermissionLocalServiceUtil.getResourcePermissions(start, start resourcePermissions = ResourcePermissionLocalServiceUtil.getResourcePermissions(start, start + SLICE);
+ SLICE);
for (ResourcePermission resourcePermission : resourcePermissions) { for (ResourcePermission resourcePermission : resourcePermissions) {
long classPK = 0; long classPK = 0;
try { try {
@ -971,12 +964,11 @@ public class ManutenzioneDatabase {
List<StoricoSoggettoPratica> storicoSoggettiPratiche = null; List<StoricoSoggettoPratica> storicoSoggettiPratiche = null;
do { do {
int rimossi = 0; int rimossi = 0;
storicoSoggettiPratiche = StoricoSoggettoPraticaLocalServiceUtil.getStoricoSoggettoPraticas( storicoSoggettiPratiche = StoricoSoggettoPraticaLocalServiceUtil.getStoricoSoggettoPraticas(start, start
start, start + SLICE); + SLICE);
for (StoricoSoggettoPratica storicoSoggettoPratica : storicoSoggettiPratiche) { for (StoricoSoggettoPratica storicoSoggettoPratica : storicoSoggettiPratiche) {
if (!esiste(INTPRATICA_CLASS_NAME, storicoSoggettoPratica.getIntPraticaId())) { if (!esiste(INTPRATICA_CLASS_NAME, storicoSoggettoPratica.getIntPraticaId())) {
StoricoSoggettoPraticaLocalServiceUtil StoricoSoggettoPraticaLocalServiceUtil.deleteStoricoSoggettoPratica(storicoSoggettoPratica);
.deleteStoricoSoggettoPratica(storicoSoggettoPratica);
cancellati++; cancellati++;
rimossi++; rimossi++;
} }

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

@ -320,6 +320,35 @@ public class SismicaUtil {
return esito; return esito;
} }
public static List<String> riparaWorkflow(String numeroProgetto) throws SystemException, PortalException {
List<String> esito = new ArrayList<>();
IntPratica pratica = IntPraticaLocalServiceUtil.findByNumeroProgetto(numeroProgetto);
long intPraticaId = pratica.getIntPraticaId();
long companyId = pratica.getCompanyId();
long groupId = pratica.getGroupId();
long userId = pratica.getUserId();
DettPratica dettPratica = DettPraticaLocalServiceUtil.getLastCompletedByIntPratica(intPraticaId);
long dettPraticaId = dettPratica.getDettPraticaId();
if (Validator.isNull(pratica)) {
esitoLog(esito, "Progetto " + numeroProgetto + " non trovato");
return esito;
}
// STATUS_APPROVED STATUS_DENIED STATUS_DRAFT STATUS_INACTIVE STATUS_PENDING
List<ControlloPratica> controlli = ControlloPraticaLocalServiceUtil.findByIntPraticaId_Status(intPraticaId,
WorkflowConstants.STATUS_PENDING);
if (0 == controlli.size()) {
esitoLog(esito, "Aggiungo controllo pratica");
ServiceContext serviceContext = new ServiceContext();
serviceContext.setCompanyId(companyId);
serviceContext.setScopeGroupId(dettPraticaId);
serviceContext.setUserId(userId);
ControlloPraticaLocalServiceUtil.addControlloPratica(groupId, userId, intPraticaId, dettPraticaId, true,
serviceContext);
}
return esito;
}
public static List<String> aggiungiWorkflow(String numeroProgetto, String mode) throws SystemException, public static List<String> aggiungiWorkflow(String numeroProgetto, String mode) throws SystemException,
PortalException { PortalException {

14
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/indexer/ControlloPraticaIndexer.java

@ -71,21 +71,25 @@ public class ControlloPraticaIndexer extends BaseIndexer {
private static final Log _log = LogFactoryUtil.getLog(ControlloPraticaIndexer.class); private static final Log _log = LogFactoryUtil.getLog(ControlloPraticaIndexer.class);
public ControlloPraticaIndexer() { public ControlloPraticaIndexer() {
setPermissionAware(true); setPermissionAware(true);
} }
@Override @Override
public String[] getClassNames() { public String[] getClassNames() {
return CLASS_NAMES; return CLASS_NAMES;
} }
@Override @Override
public String getPortletId() { public String getPortletId() {
return PORTLET_ID; return PORTLET_ID;
} }
@Override @Override
protected void doDelete(Object obj) throws Exception { protected void doDelete(Object obj) throws Exception {
if (Validator.isNotNull(obj)) { if (Validator.isNotNull(obj)) {
ControlloPratica controlloPratica = (ControlloPratica) obj; ControlloPratica controlloPratica = (ControlloPratica) obj;
deleteDocument(controlloPratica.getCompanyId(), controlloPratica.getControlloPraticaId()); deleteDocument(controlloPratica.getCompanyId(), controlloPratica.getControlloPraticaId());
@ -96,6 +100,7 @@ public class ControlloPraticaIndexer extends BaseIndexer {
@Override @Override
protected Document doGetDocument(Object obj) throws Exception { protected Document doGetDocument(Object obj) throws Exception {
Document document = null; Document document = null;
if (Validator.isNotNull(obj)) { if (Validator.isNotNull(obj)) {
ControlloPratica controlloPratica = (ControlloPratica) obj; ControlloPratica controlloPratica = (ControlloPratica) obj;
@ -323,6 +328,7 @@ public class ControlloPraticaIndexer extends BaseIndexer {
@Override @Override
protected Document getBaseModelDocument(String portletId, BaseModel<?> baseModel) throws SystemException { protected Document getBaseModelDocument(String portletId, BaseModel<?> baseModel) throws SystemException {
Document document = newDocument(); Document document = newDocument();
String className = baseModel.getModelClassName(); String className = baseModel.getModelClassName();
long classPK = 0; long classPK = 0;
@ -385,6 +391,7 @@ public class ControlloPraticaIndexer extends BaseIndexer {
@Override @Override
protected void doReindex(Object obj) throws Exception { protected void doReindex(Object obj) throws Exception {
if (Validator.isNotNull(obj)) { if (Validator.isNotNull(obj)) {
ControlloPratica controlloPratica = (ControlloPratica) obj; ControlloPratica controlloPratica = (ControlloPratica) obj;
Document document = getDocument(controlloPratica); Document document = getDocument(controlloPratica);
@ -406,9 +413,12 @@ public class ControlloPraticaIndexer extends BaseIndexer {
} }
protected void reindexControlloPratica(long companyId) throws PortalException, SystemException { protected void reindexControlloPratica(long companyId) throws PortalException, SystemException {
ActionableDynamicQuery actionableDynamicQuery = new ControlloPraticaActionableDynamicQuery() { ActionableDynamicQuery actionableDynamicQuery = new ControlloPraticaActionableDynamicQuery() {
@Override @Override
protected void performAction(Object object) throws PortalException { protected void performAction(Object object) throws PortalException {
if (object != null) { if (object != null) {
ControlloPratica controlloPratica = (ControlloPratica) object; ControlloPratica controlloPratica = (ControlloPratica) object;
if (controlloPratica != null) { if (controlloPratica != null) {
@ -438,15 +448,18 @@ public class ControlloPraticaIndexer extends BaseIndexer {
@Override @Override
protected void doReindex(String className, long id) throws Exception { protected void doReindex(String className, long id) throws Exception {
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil.getControlloPratica(id); ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil.getControlloPratica(id);
doReindex(controlloPratica); doReindex(controlloPratica);
} }
private boolean checkSottopostaAParere(long intPraticaId) throws SystemException, PortalException { private boolean checkSottopostaAParere(long intPraticaId) throws SystemException, PortalException {
return WorkflowUtil.isWorkflowDisattivabile(intPraticaId); return WorkflowUtil.isWorkflowDisattivabile(intPraticaId);
} }
private boolean checkLavorazioneSorteggiata(long intPraticaId) throws SystemException { private boolean checkLavorazioneSorteggiata(long intPraticaId) throws SystemException {
Sorteggio sorteggio = SorteggioLocalServiceUtil.findByIntPratica(intPraticaId); Sorteggio sorteggio = SorteggioLocalServiceUtil.findByIntPratica(intPraticaId);
if (Validator.isNotNull(sorteggio)) { if (Validator.isNotNull(sorteggio)) {
return true; return true;
@ -457,6 +470,7 @@ public class ControlloPraticaIndexer extends BaseIndexer {
@Override @Override
protected String getPortletId(SearchContext searchContext) { protected String getPortletId(SearchContext searchContext) {
return PORTLET_ID; return PORTLET_ID;
} }
} }

186
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/indexer/IntPraticaIndexer.java

@ -6,7 +6,6 @@ import it.tref.liferay.portos.bo.model.IntPratica;
import it.tref.liferay.portos.bo.model.ParereGeologo; import it.tref.liferay.portos.bo.model.ParereGeologo;
import it.tref.liferay.portos.bo.model.Provincia; import it.tref.liferay.portos.bo.model.Provincia;
import it.tref.liferay.portos.bo.model.Soggetto; import it.tref.liferay.portos.bo.model.Soggetto;
import it.tref.liferay.portos.bo.model.Sorteggio;
import it.tref.liferay.portos.bo.model.Territorio; import it.tref.liferay.portos.bo.model.Territorio;
import it.tref.liferay.portos.bo.service.ComuneLocalServiceUtil; import it.tref.liferay.portos.bo.service.ComuneLocalServiceUtil;
import it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil; import it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil;
@ -97,61 +96,43 @@ public class IntPraticaIndexer extends BaseIndexer {
/* /*
* Manifattura Web Group per Regione Siciliana * Manifattura Web Group per Regione Siciliana
* *
* Modifiche per rendere i campi di testo ricercabili per parole contenute e * Modifiche per rendere i campi di testo ricercabili per parole contenute e non per corrispondenza esatta.
* non per corrispondenza esatta.
*/ */
@Override @Override
protected Document doGetDocument(Object obj) throws Exception { protected Document doGetDocument(Object obj) throws Exception {
Document document = null; Document document = null;
if (Validator.isNotNull(obj)) { if (Validator.isNotNull(obj)) {
IntPratica intPratica = (IntPratica) obj; IntPratica intPratica = (IntPratica) obj;
IntPratica intPraticaFromDB = IntPraticaServiceUtil.getIntPratica(intPratica.getIntPraticaId()); IntPratica intPraticaFromDB = IntPraticaServiceUtil.getIntPratica(intPratica.getIntPraticaId());
if (_log.isDebugEnabled()) { if (_log.isDebugEnabled()) {
_log.debug("Indicizzo la pratica " _log.debug("Indicizzo la pratica "
+ (Validator.isNull(intPratica.getNumeroProgetto()) ? "" : intPratica + (Validator.isNull(intPratica.getNumeroProgetto()) ? "" : intPratica.getNumeroProgetto()
.getNumeroProgetto() + ", ") + "id " + intPratica.getIntPraticaId()); + ", ") + "id " + intPratica.getIntPraticaId());
} }
document = getBaseModelDocument(PORTLET_ID, intPratica); document = getBaseModelDocument(PORTLET_ID, intPratica);
document.addKeyword("entryClassName", IntPratica.class.getName()); document.addKeyword("entryClassName", IntPratica.class.getName());
// Prendo l'ultimo DettPratica legato a IntPratica
// Prendo l ultimo DettPratica legato a IntPratica
DettPratica lastDettPratica = DettPraticaLocalServiceUtil DettPratica lastDettPratica = DettPraticaLocalServiceUtil
.getLastCompletedByIntPraticaAndProtocolloNotEmpty(intPraticaFromDB.getIntPraticaId()); .getLastCompletedByIntPraticaAndProtocolloNotEmpty(intPraticaFromDB.getIntPraticaId());
if (Validator.isNull(lastDettPratica)) { if (Validator.isNull(lastDettPratica)) {
lastDettPratica = DettPraticaLocalServiceUtil.getLastCompletedByIntPratica(intPratica lastDettPratica = DettPraticaLocalServiceUtil
.getIntPraticaId()); .getLastCompletedByIntPratica(intPratica.getIntPraticaId());
} }
// Aggiunta field custom per la ricerca // Aggiunta field custom per la ricerca
document.addKeyword(Field.PORTLET_ID, getPortletId()); document.addKeyword(Field.PORTLET_ID, getPortletId());
if (Validator.isNotNull(intPraticaFromDB.getDtPratica())) { if (Validator.isNotNull(intPraticaFromDB.getDtPratica())) {
document.addKeyword(PortosIndexField.DATA_RICHIESTA, document.addKeyword(PortosIndexField.DATA_RICHIESTA,
DATE_FORMAT.format(intPraticaFromDB.getDtPratica())); DATE_FORMAT.format(intPraticaFromDB.getDtPratica()));
document.addKeyword(PortosIndexField.DT_PRATICA, DATE_FORMAT.format(intPraticaFromDB.getDtPratica()));
document.addKeyword(PortosIndexField.DT_PRATICA,
DATE_FORMAT.format(intPraticaFromDB.getDtPratica()));
document.addKeywordSortable(PortosIndexField.DT_PRATICA, document.addKeywordSortable(PortosIndexField.DT_PRATICA,
DATE_FORMAT.format(intPraticaFromDB.getDtPratica())); DATE_FORMAT.format(intPraticaFromDB.getDtPratica()));
document.addDate(PortosIndexField.DT_PRATICA, intPraticaFromDB.getDtPratica()); document.addDate(PortosIndexField.DT_PRATICA, intPraticaFromDB.getDtPratica());
} else { } else {
document.addKeyword(PortosIndexField.DT_PRATICA, 0); document.addKeyword(PortosIndexField.DT_PRATICA, 0);
} }
document.addKeyword(PortosIndexField.INT_PRATICA_ID, intPraticaFromDB.getIntPraticaId()); document.addKeyword(PortosIndexField.INT_PRATICA_ID, intPraticaFromDB.getIntPraticaId());
if (intPraticaFromDB.getNumeroProgetto() != null && !intPraticaFromDB.getNumeroProgetto().equals("")) {
if (intPraticaFromDB.getNumeroProgetto() != null
&& !intPraticaFromDB.getNumeroProgetto().equals("")) {
document.addKeyword(PortosIndexField.NUMERO_PROGETTO, document.addKeyword(PortosIndexField.NUMERO_PROGETTO,
Integer.valueOf(intPraticaFromDB.getNumeroProgetto())); Integer.valueOf(intPraticaFromDB.getNumeroProgetto()));
document.addNumber(PortosIndexField.NUMERO_PROGETTO, document.addNumber(PortosIndexField.NUMERO_PROGETTO,
@ -159,38 +140,27 @@ public class IntPraticaIndexer extends BaseIndexer {
document.addNumberSortable(PortosIndexField.NUMERO_PROGETTO, document.addNumberSortable(PortosIndexField.NUMERO_PROGETTO,
Integer.valueOf(intPraticaFromDB.getNumeroProgetto())); Integer.valueOf(intPraticaFromDB.getNumeroProgetto()));
} }
if (lastDettPratica != null) { if (lastDettPratica != null) {
document.addKeyword("nuovaCostruzione", lastDettPratica.getTcNuovaCostruzione()); document.addKeyword("nuovaCostruzione", lastDettPratica.getTcNuovaCostruzione());
document.addKeyword("adeguamentoSismico", lastDettPratica.getTcAdeguamentoSismico()); document.addKeyword("adeguamentoSismico", lastDettPratica.getTcAdeguamentoSismico());
document.addKeyword("miglioramentoSismico", lastDettPratica.getTcMiglioramentoSismico()); document.addKeyword("miglioramentoSismico", lastDettPratica.getTcMiglioramentoSismico());
document.addKeyword("interventoLocale", lastDettPratica.getTcRiparazioneInterventoLocale()); document.addKeyword("interventoLocale", lastDettPratica.getTcRiparazioneInterventoLocale());
if (lastDettPratica.getProtocollo() != null && !lastDettPratica.getProtocollo().equals("")) { if (lastDettPratica.getProtocollo() != null && !lastDettPratica.getProtocollo().equals("")) {
document.addKeyword(PortosIndexField.PROTOCOLLO, document.addKeyword(PortosIndexField.PROTOCOLLO, Long.parseLong(lastDettPratica.getProtocollo()));
Long.parseLong(lastDettPratica.getProtocollo())); document.addNumber(PortosIndexField.PROTOCOLLO, Long.parseLong(lastDettPratica.getProtocollo()));
document.addNumber(PortosIndexField.PROTOCOLLO,
Long.parseLong(lastDettPratica.getProtocollo()));
document.addNumberSortable(PortosIndexField.PROTOCOLLO, document.addNumberSortable(PortosIndexField.PROTOCOLLO,
Long.parseLong(lastDettPratica.getProtocollo())); Long.parseLong(lastDettPratica.getProtocollo()));
} }
if (lastDettPratica.getVia() != null && !lastDettPratica.getVia().equals("")) { if (lastDettPratica.getVia() != null && !lastDettPratica.getVia().equals("")) {
document.addText(PortosIndexField.INDIRIZZO, lastDettPratica.getVia()); document.addText(PortosIndexField.INDIRIZZO, lastDettPratica.getVia());
} }
if (lastDettPratica.getLocalita() != null && !lastDettPratica.getLocalita().equals("")) { if (lastDettPratica.getLocalita() != null && !lastDettPratica.getLocalita().equals("")) {
document.addText(PortosIndexField.LOCALITA, lastDettPratica.getLocalita()); document.addText(PortosIndexField.LOCALITA, lastDettPratica.getLocalita());
} }
} }
boolean sorteggiata = SorteggioLocalServiceUtil.findByIntPratica(intPraticaFromDB.getIntPraticaId()) != null;
boolean sorteggiata = SorteggioLocalServiceUtil.findByIntPratica(intPraticaFromDB
.getIntPraticaId()) != null;
document.addKeyword("sorteggiata", sorteggiata); document.addKeyword("sorteggiata", sorteggiata);
document.addKeyword("controlloObbligatorio", intPraticaFromDB.isControlloObbligatorio()); document.addKeyword("controlloObbligatorio", intPraticaFromDB.isControlloObbligatorio());
// Gestione pratica aperta/chiusa fine lavori // Gestione pratica aperta/chiusa fine lavori
if (intPraticaFromDB.getCollaudoTotale()) { if (intPraticaFromDB.getCollaudoTotale()) {
document.addKeyword(PortosIndexField.PRATICA_APERTA, false); document.addKeyword(PortosIndexField.PRATICA_APERTA, false);
@ -203,23 +173,17 @@ public class IntPraticaIndexer extends BaseIndexer {
} else { } else {
document.addKeyword(PortosIndexField.PRATICA_APERTA, true); document.addKeyword(PortosIndexField.PRATICA_APERTA, true);
} }
if (intPraticaFromDB.getStatoPratica().equals(StatoPraticaConstants.INTEGRAZIONE)) { if (intPraticaFromDB.getStatoPratica().equals(StatoPraticaConstants.INTEGRAZIONE)) {
document.addKeyword(PortosIndexField.PRATICA_APERTA, true); document.addKeyword(PortosIndexField.PRATICA_APERTA, true);
} }
document.addKeyword(PortosIndexField.STATUS, intPraticaFromDB.getStatus()); document.addKeyword(PortosIndexField.STATUS, intPraticaFromDB.getStatus());
if (intPraticaFromDB.getStatusDate() != null) { if (intPraticaFromDB.getStatusDate() != null) {
document.addKeyword(PortosIndexField.STATUS_DATE, document.addKeyword(PortosIndexField.STATUS_DATE, DATE_FORMAT.format(intPraticaFromDB.getStatusDate()));
DATE_FORMAT.format(intPraticaFromDB.getStatusDate()));
} }
// LAVORAZIONE STATO PRATICA // LAVORAZIONE STATO PRATICA
if (intPraticaFromDB.getStatoPratica() != null && !intPraticaFromDB.getStatoPratica().equals("")) { if (intPraticaFromDB.getStatoPratica() != null && !intPraticaFromDB.getStatoPratica().equals("")) {
document.addKeyword(PortosIndexField.STATO_PRATICA, intPraticaFromDB.getStatoPratica()); document.addKeyword(PortosIndexField.STATO_PRATICA, intPraticaFromDB.getStatoPratica());
} }
boolean variata = false; boolean variata = false;
int countVariantiForIntPratica = DettPraticaLocalServiceUtil.countVariateByIntPratica(intPratica int countVariantiForIntPratica = DettPraticaLocalServiceUtil.countVariateByIntPratica(intPratica
.getIntPraticaId()); .getIntPraticaId());
@ -227,18 +191,14 @@ public class IntPraticaIndexer extends BaseIndexer {
variata = true; variata = true;
} }
document.addKeyword(PortosIndexField.VARIATA, variata); document.addKeyword(PortosIndexField.VARIATA, variata);
document.addKeyword(PortosIndexField.COLLAUDO_COMPLETATO, intPraticaFromDB.getCollaudoTotale()); document.addKeyword(PortosIndexField.COLLAUDO_COMPLETATO, intPraticaFromDB.getCollaudoTotale());
document.addKeyword(PortosIndexField.COLLAUDO_PARZIALE, intPraticaFromDB.getCollaudoParziale()); document.addKeyword(PortosIndexField.COLLAUDO_PARZIALE, intPraticaFromDB.getCollaudoParziale());
document.addKeyword(PortosIndexField.FINE_LAVORI_COMPLETATI, document.addKeyword(PortosIndexField.FINE_LAVORI_COMPLETATI, intPraticaFromDB.getFineLavoriTotale());
intPraticaFromDB.getFineLavoriTotale()); document.addKeyword(PortosIndexField.FINE_LAVORI_PARZIALI, intPraticaFromDB.getFineLavoriParziale());
document.addKeyword(PortosIndexField.FINE_LAVORI_PARZIALI,
intPraticaFromDB.getFineLavoriParziale());
document.addKeyword(PortosIndexField.SOTTOPOSTO_A_PARERE, document.addKeyword(PortosIndexField.SOTTOPOSTO_A_PARERE,
checkSottopostaAParere(intPraticaFromDB.getIntPraticaId())); checkSottopostaAParere(intPraticaFromDB.getIntPraticaId()));
document.addKeyword(PortosIndexField.LAVORAZIONE_SORTEGGIATA, document.addKeyword(PortosIndexField.LAVORAZIONE_SORTEGGIATA,
checkLavorazioneSorteggiata(intPraticaFromDB.getIntPraticaId())); checkLavorazioneSorteggiata(intPraticaFromDB.getIntPraticaId()));
// Gestione Istruttore // Gestione Istruttore
if (Validator.isNotNull(intPraticaFromDB.getStatusByUserId())) { if (Validator.isNotNull(intPraticaFromDB.getStatusByUserId())) {
document.addKeyword(PortosIndexField.ISTRUTTORE_USER_ID, intPraticaFromDB.getStatusByUserId()); document.addKeyword(PortosIndexField.ISTRUTTORE_USER_ID, intPraticaFromDB.getStatusByUserId());
@ -246,14 +206,12 @@ public class IntPraticaIndexer extends BaseIndexer {
UserLocalServiceUtil.getUser(intPraticaFromDB.getStatusByUserId()).getScreenName() UserLocalServiceUtil.getUser(intPraticaFromDB.getStatusByUserId()).getScreenName()
.toUpperCase()); .toUpperCase());
} }
if (intPratica.getStatusByUserId() != 0L) { if (intPratica.getStatusByUserId() != 0L) {
User userIstruttore = UserLocalServiceUtil.fetchUser(intPratica.getStatusByUserId()); User userIstruttore = UserLocalServiceUtil.fetchUser(intPratica.getStatusByUserId());
if (userIstruttore != null) { if (userIstruttore != null) {
document.addText(PortosIndexField.ISTRUTTORE_FULL_NAME, userIstruttore.getFullName()); document.addText(PortosIndexField.ISTRUTTORE_FULL_NAME, userIstruttore.getFullName());
} }
} }
if (intPratica.getUserId() != 0L) { if (intPratica.getUserId() != 0L) {
User proprietarioDigitale = UserLocalServiceUtil.fetchUser(intPratica.getUserId()); User proprietarioDigitale = UserLocalServiceUtil.fetchUser(intPratica.getUserId());
if (proprietarioDigitale != null) { if (proprietarioDigitale != null) {
@ -261,90 +219,62 @@ public class IntPraticaIndexer extends BaseIndexer {
proprietarioDigitale.getFullName()); proprietarioDigitale.getFullName());
} }
} }
// Prendo la lista dei soggetti committenti legati a IntPratica // Prendo la lista dei soggetti committenti legati a IntPratica
List<Soggetto> committenti = SoggettoLocalServiceUtil.findByIntPratica_TipologiaSoggetto( List<Soggetto> committenti = SoggettoLocalServiceUtil.findByIntPratica_TipologiaSoggetto(
intPratica.getIntPraticaId(), TipoSoggettoUtil.COMMITTENTE); intPratica.getIntPraticaId(), TipoSoggettoUtil.COMMITTENTE);
if (lastDettPratica != null) { if (lastDettPratica != null) {
if (Validator.isNotNull(lastDettPratica.getDescLongIntervento())) { if (Validator.isNotNull(lastDettPratica.getDescLongIntervento())) {
document.addText(PortosIndexField.DESC_INTERVENTO, document.addText(PortosIndexField.DESC_INTERVENTO, lastDettPratica.getDescLongIntervento());
lastDettPratica.getDescLongIntervento());
} }
document.addKeyword(PortosIndexField.NUOVA_COSTRUZIONE, lastDettPratica.getTcNuovaCostruzione());
document.addKeyword(PortosIndexField.NUOVA_COSTRUZIONE, document.addKeyword(PortosIndexField.ADEGUAMENTO_SISMICO, lastDettPratica.getTcAdeguamentoSismico());
lastDettPratica.getTcNuovaCostruzione()); document.addKeyword(PortosIndexField.MIGLIORAMENTO_SISMICO, lastDettPratica.getTcMiglioramentoSismico());
document.addKeyword(PortosIndexField.ADEGUAMENTO_SISMICO,
lastDettPratica.getTcAdeguamentoSismico());
document.addKeyword(PortosIndexField.MIGLIORAMENTO_SISMICO,
lastDettPratica.getTcMiglioramentoSismico());
document.addKeyword(PortosIndexField.RIPARAZIONE_INTERVENTO_LOCALE, document.addKeyword(PortosIndexField.RIPARAZIONE_INTERVENTO_LOCALE,
lastDettPratica.getTcRiparazioneInterventoLocale()); lastDettPratica.getTcRiparazioneInterventoLocale());
} }
// Gestione GroupId preso da territorio // Gestione GroupId preso da territorio
Territorio territorio = TerritorioLocalServiceUtil.fetchTerritorio(intPraticaFromDB Territorio territorio = TerritorioLocalServiceUtil.fetchTerritorio(intPraticaFromDB.getTerritorioId());
.getTerritorioId());
if (Validator.isNotNull(territorio)) { if (Validator.isNotNull(territorio)) {
document.addKeyword(Field.GROUP_ID, territorio.getGroupId()); document.addKeyword(Field.GROUP_ID, territorio.getGroupId());
} else { } else {
document.addKeyword(Field.GROUP_ID, intPraticaFromDB.getGroupId()); document.addKeyword(Field.GROUP_ID, intPraticaFromDB.getGroupId());
} }
if (Validator.isNotNull(territorio)) { if (Validator.isNotNull(territorio)) {
if (Validator.isNotNull(territorio.getComuneId())) { if (Validator.isNotNull(territorio.getComuneId())) {
Comune comune = ComuneLocalServiceUtil.fetchComune(territorio.getComuneId()); Comune comune = ComuneLocalServiceUtil.fetchComune(territorio.getComuneId());
if (Validator.isNotNull(comune)) { if (Validator.isNotNull(comune)) {
document.addKeyword(PortosIndexField.COMUNE_ID, comune.getComuneId()); document.addKeyword(PortosIndexField.COMUNE_ID, comune.getComuneId());
document.addKeyword(PortosIndexField.COMUNE_DENOMINAZIONE, comune.getDenominazione()); document.addKeyword(PortosIndexField.COMUNE_DENOMINAZIONE, comune.getDenominazione());
} }
if (Validator.isNotNull(territorio.getCodiceProvincia())) { if (Validator.isNotNull(territorio.getCodiceProvincia())) {
Provincia provincia = ProvinciaLocalServiceUtil.fetchByC_C(territorio.getCompanyId(), Provincia provincia = ProvinciaLocalServiceUtil.fetchByC_C(territorio.getCompanyId(),
territorio.getCodiceProvincia()); territorio.getCodiceProvincia());
if (Validator.isNotNull(provincia)) { if (Validator.isNotNull(provincia)) {
document.addKeyword(PortosIndexField.PROVINCIA_ID, provincia.getProvinciaId()); document.addKeyword(PortosIndexField.PROVINCIA_ID, provincia.getProvinciaId());
document.addKeyword(PortosIndexField.PROVINCIA_CODICE, document.addKeyword(PortosIndexField.PROVINCIA_CODICE, provincia.getCodiceProvincia());
provincia.getCodiceProvincia());
document.addKeyword(PortosIndexField.PROVINCIA_NAME, provincia.getProvincia()); document.addKeyword(PortosIndexField.PROVINCIA_NAME, provincia.getProvincia());
} }
} }
} }
} }
document.addKeyword(PortosIndexField.TIPO_PRATICA, intPraticaFromDB.getTipoPratica()); document.addKeyword(PortosIndexField.TIPO_PRATICA, intPraticaFromDB.getTipoPratica());
document.addKeywordSortable(PortosIndexField.TIPO_PRATICA, intPraticaFromDB.getTipoPratica()); document.addKeywordSortable(PortosIndexField.TIPO_PRATICA, intPraticaFromDB.getTipoPratica());
// Gestione Parere Geologo // Gestione Parere Geologo
List<ParereGeologo> listaParereGeologo = ParereGeologoLocalServiceUtil.findByIntPraticaId( List<ParereGeologo> listaParereGeologo = ParereGeologoLocalServiceUtil.findByIntPraticaId(
intPratica.getIntPraticaId(), -1, 1); intPratica.getIntPraticaId(), -1, 1);
if (Validator.isNotNull(listaParereGeologo) && !listaParereGeologo.isEmpty()) { if (Validator.isNotNull(listaParereGeologo) && !listaParereGeologo.isEmpty()) {
document.addKeyword(PortosIndexField.PARERE_GEOLOGO, "true"); document.addKeyword(PortosIndexField.PARERE_GEOLOGO, "true");
} else { } else {
document.addKeyword(PortosIndexField.PARERE_GEOLOGO, "false"); document.addKeyword(PortosIndexField.PARERE_GEOLOGO, "false");
} }
// Gestione pratica sospesa // Gestione pratica sospesa
document.addKeyword(PortosIndexField.STATUS_SOSPESA, intPraticaFromDB.isSospesa()); document.addKeyword(PortosIndexField.STATUS_SOSPESA, intPraticaFromDB.isSospesa());
// Gestione Diverse tipologie di IntPratica // Gestione Diverse tipologie di IntPratica
// MIEI PROGETTI && ARCHIVIO PROGETTI // MIEI PROGETTI && ARCHIVIO PROGETTI
document.addKeyword(Field.USER_ID, intPraticaFromDB.getUserId()); document.addKeyword(Field.USER_ID, intPraticaFromDB.getUserId());
// ALTRI PROGETTI // ALTRI PROGETTI
if (Validator.isNotNull(committenti) && committenti.size() > 0) { if (Validator.isNotNull(committenti) && committenti.size() > 0) {
// Creo una stringa contenente tutti i codFisc legati alla IntPratica separati da ,
// Creao una stringa contenente tutti i codFisc legati alla
// IntPratica separati da ,
List<String> listaSoggetti = new ArrayList<String>(); List<String> listaSoggetti = new ArrayList<String>();
for (Soggetto soggetto : committenti) { for (Soggetto soggetto : committenti) {
if (Validator.isNotNull(soggetto.getCognome())) { if (Validator.isNotNull(soggetto.getCognome())) {
@ -356,7 +286,6 @@ public class IntPraticaIndexer extends BaseIndexer {
} }
document.addText(PortosIndexField.COMMITTENTI, listaSoggetti.toArray(new String[0])); document.addText(PortosIndexField.COMMITTENTI, listaSoggetti.toArray(new String[0]));
} }
// Prendo la lista dei direttori dei lavori // Prendo la lista dei direttori dei lavori
List<Soggetto> direttoriLavori = SoggettoLocalServiceUtil.findByIntPratica_TipologiaSoggetto( List<Soggetto> direttoriLavori = SoggettoLocalServiceUtil.findByIntPratica_TipologiaSoggetto(
intPratica.getIntPraticaId(), TipoSoggettoUtil.DIRETTORE_LAVORI); intPratica.getIntPraticaId(), TipoSoggettoUtil.DIRETTORE_LAVORI);
@ -367,7 +296,6 @@ public class IntPraticaIndexer extends BaseIndexer {
} }
document.addKeyword(PortosIndexField.DIRETTORE_LAVORI, direttori.toArray(new String[0])); document.addKeyword(PortosIndexField.DIRETTORE_LAVORI, direttori.toArray(new String[0]));
} }
// Prendo la lista dei collaudatori // Prendo la lista dei collaudatori
List<Soggetto> collaudatoriList = SoggettoLocalServiceUtil.findByIntPratica_TipologiaSoggetto( List<Soggetto> collaudatoriList = SoggettoLocalServiceUtil.findByIntPratica_TipologiaSoggetto(
intPratica.getIntPraticaId(), TipoSoggettoUtil.COLLAUDATORE); intPratica.getIntPraticaId(), TipoSoggettoUtil.COLLAUDATORE);
@ -378,45 +306,32 @@ public class IntPraticaIndexer extends BaseIndexer {
} }
document.addKeyword(PortosIndexField.COLLAUDATORI, collaudatori.toArray(new String[0])); document.addKeyword(PortosIndexField.COLLAUDATORI, collaudatori.toArray(new String[0]));
} }
if (intPraticaFromDB.getStatus() != WorkflowConstants.STATUS_ANY if (intPraticaFromDB.getStatus() != WorkflowConstants.STATUS_ANY
&& intPraticaFromDB.getStatus() != WorkflowConstants.STATUS_INCOMPLETE) { && intPraticaFromDB.getStatus() != WorkflowConstants.STATUS_INCOMPLETE) {
String codiceFiscaleTitolare = UserLocalServiceUtil.getUser(intPraticaFromDB.getUserId()) String codiceFiscaleTitolare = UserLocalServiceUtil.getUser(intPraticaFromDB.getUserId())
.getScreenName(); .getScreenName();
List<String> listaSoggetti = new ArrayList<String>(); List<String> listaSoggetti = new ArrayList<String>();
List<Soggetto> soggettiInteressati = SoggettoLocalServiceUtil.getValidByIntPratica(intPratica List<Soggetto> soggettiInteressati = SoggettoLocalServiceUtil.getValidByIntPratica(intPratica
.getIntPraticaId()); .getIntPraticaId());
for (Soggetto soggetto : soggettiInteressati) { for (Soggetto soggetto : soggettiInteressati) {
if (!soggetto.getCodiceFiscale().equalsIgnoreCase(codiceFiscaleTitolare)) { if (!soggetto.getCodiceFiscale().equalsIgnoreCase(codiceFiscaleTitolare)) {
listaSoggetti.add(soggetto.getCodiceFiscale().toUpperCase()); listaSoggetti.add(soggetto.getCodiceFiscale().toUpperCase());
} }
} }
document.addKeyword(PortosIndexField.SOGGETTI_INTERESSATI, listaSoggetti.toArray(new String[0]));
document.addKeyword(PortosIndexField.SOGGETTI_INTERESSATI,
listaSoggetti.toArray(new String[0]));
} }
// Soggetti connessi alla intPratica // Soggetti connessi alla intPratica
List<Soggetto> listSoggettiInterconnessi = SoggettoLocalServiceUtil List<Soggetto> listSoggettiInterconnessi = SoggettoLocalServiceUtil
.getSoggettiByIntPraticaId_DtRimozioneNull(intPraticaFromDB.getIntPraticaId()); .getSoggettiByIntPraticaId_DtRimozioneNull(intPraticaFromDB.getIntPraticaId());
if (listSoggettiInterconnessi != null && !listSoggettiInterconnessi.isEmpty()) { if (listSoggettiInterconnessi != null && !listSoggettiInterconnessi.isEmpty()) {
List<String> listaStringata = new ArrayList<String>(); List<String> listaStringata = new ArrayList<String>();
for (Soggetto sog : listSoggettiInterconnessi) { for (Soggetto sog : listSoggettiInterconnessi) {
if (Validator.isNotNull(sog.getCognome())) if (Validator.isNotNull(sog.getCognome()))
listaStringata.add(sog.getNome() + " " + sog.getCognome()); listaStringata.add(sog.getNome() + " " + sog.getCognome());
if (Validator.isNotNull(sog.getDenominazione())) if (Validator.isNotNull(sog.getDenominazione()))
listaStringata.add(sog.getDenominazione()); listaStringata.add(sog.getDenominazione());
} }
document.addText(PortosIndexField.SOGGETTI_INTERCONNESSI, listaStringata.toArray(new String[0]));
document.addText(PortosIndexField.SOGGETTI_INTERCONNESSI,
listaStringata.toArray(new String[0]));
} }
} else { } else {
_log.warn("Received a null IntPratica in input."); _log.warn("Received a null IntPratica in input.");
@ -429,32 +344,25 @@ public class IntPraticaIndexer extends BaseIndexer {
throws Exception { throws Exception {
if (Validator.isNotNull(document)) { if (Validator.isNotNull(document)) {
String title = document.get(""); String title = document.get("");
String content = document.get(""); String content = document.get("");
String intPraticaId = document.get(PortosIndexField.INT_PRATICA_ID); String intPraticaId = document.get(PortosIndexField.INT_PRATICA_ID);
portletURL.setParameter("struts_action", "/web/TODO"); portletURL.setParameter("struts_action", "/web/TODO");
portletURL.setParameter("intPraticaId", intPraticaId); portletURL.setParameter("intPraticaId", intPraticaId);
return new Summary(title, content, portletURL); return new Summary(title, content, portletURL);
} else { } else {
_log.warn("Received a null document in input."); _log.warn("Received a null document in input.");
return new Summary("---", "---", portletURL); return new Summary("---", "---", portletURL);
} }
} }
@Override @Override
protected Document getBaseModelDocument(String portletId, BaseModel<?> baseModel) throws SystemException { protected Document getBaseModelDocument(String portletId, BaseModel<?> baseModel) throws SystemException {
Document document = newDocument(); Document document = newDocument();
String className = baseModel.getModelClassName(); String className = baseModel.getModelClassName();
long classPK = 0L;
long classPK = 0; long resourcePrimKey = 0L;
long resourcePrimKey = 0;
if (baseModel instanceof ResourcedModel) { if (baseModel instanceof ResourcedModel) {
ResourcedModel resourcedModel = (ResourcedModel) baseModel; ResourcedModel resourcedModel = (ResourcedModel) baseModel;
classPK = resourcedModel.getResourcePrimKey(); classPK = resourcedModel.getResourcePrimKey();
@ -462,65 +370,44 @@ public class IntPraticaIndexer extends BaseIndexer {
} else { } else {
classPK = GetterUtil.getLong(baseModel.getPrimaryKeyObj()); classPK = GetterUtil.getLong(baseModel.getPrimaryKeyObj());
} }
document.addUID(portletId, classPK, className); document.addUID(portletId, classPK, className);
document.addKeyword(Field.ENTRY_CLASS_NAME, className); document.addKeyword(Field.ENTRY_CLASS_NAME, className);
document.addKeyword(Field.ENTRY_CLASS_PK, classPK); document.addKeyword(Field.ENTRY_CLASS_PK, classPK);
document.addKeyword(Field.PORTLET_ID, portletId); document.addKeyword(Field.PORTLET_ID, portletId);
if (resourcePrimKey > 0) { if (resourcePrimKey > 0) {
document.addKeyword(Field.ROOT_ENTRY_CLASS_PK, resourcePrimKey); document.addKeyword(Field.ROOT_ENTRY_CLASS_PK, resourcePrimKey);
} }
if (baseModel instanceof AuditedModel) { if (baseModel instanceof AuditedModel) {
AuditedModel auditedModel = (AuditedModel) baseModel; AuditedModel auditedModel = (AuditedModel) baseModel;
document.addKeyword(Field.COMPANY_ID, auditedModel.getCompanyId()); document.addKeyword(Field.COMPANY_ID, auditedModel.getCompanyId());
document.addDate(Field.CREATE_DATE, auditedModel.getCreateDate()); document.addDate(Field.CREATE_DATE, auditedModel.getCreateDate());
document.addDate(Field.MODIFIED_DATE, auditedModel.getModifiedDate()); document.addDate(Field.MODIFIED_DATE, auditedModel.getModifiedDate());
document.addKeyword(Field.USER_ID, auditedModel.getUserId()); document.addKeyword(Field.USER_ID, auditedModel.getUserId());
String userName = PortalUtil.getUserName(auditedModel.getUserId(), auditedModel.getUserName()); String userName = PortalUtil.getUserName(auditedModel.getUserId(), auditedModel.getUserName());
document.addKeyword(Field.USER_NAME, userName, true); document.addKeyword(Field.USER_NAME, userName, true);
} }
GroupedModel groupedModel = null; GroupedModel groupedModel = null;
if (baseModel instanceof GroupedModel) { if (baseModel instanceof GroupedModel) {
groupedModel = (GroupedModel) baseModel; groupedModel = (GroupedModel) baseModel;
// document.addKeyword(Field.GROUP_ID,
// getSiteGroupId(groupedModel.getGroupId()));
document.addKeyword(Field.SCOPE_GROUP_ID, groupedModel.getGroupId()); document.addKeyword(Field.SCOPE_GROUP_ID, groupedModel.getGroupId());
} }
if ((groupedModel != null) && (baseModel instanceof TrashedModel)) { if ((groupedModel != null) && (baseModel instanceof TrashedModel)) {
TrashedModel trashedModel = (TrashedModel) baseModel; TrashedModel trashedModel = (TrashedModel) baseModel;
if (trashedModel.isInTrash()) { if (trashedModel.isInTrash()) {
addTrashFields(document, trashedModel); addTrashFields(document, trashedModel);
} }
} }
addAssetFields(document, className, classPK); addAssetFields(document, className, classPK);
return document; return document;
} }
@Override @Override
protected void doReindex(Object obj) throws Exception { protected void doReindex(Object obj) throws Exception {
if (Validator.isNotNull(obj)) { if (Validator.isNotNull(obj)) {
IntPratica intPratica = (IntPratica) obj; IntPratica intPratica = (IntPratica) obj;
Document document = getDocument(intPratica); Document document = getDocument(intPratica);
SearchEngineUtil.updateDocument(getSearchEngineId(), intPratica.getCompanyId(), document, false); SearchEngineUtil.updateDocument(getSearchEngineId(), intPratica.getCompanyId(), document, false);
} else { } else {
_log.warn("Received a null IntPratica in input."); _log.warn("Received a null IntPratica in input.");
} }
@ -533,16 +420,15 @@ public class IntPraticaIndexer extends BaseIndexer {
if (ids != null && ids.length > 0) { if (ids != null && ids.length > 0) {
long companyId = GetterUtil.getLong(ids[0]); long companyId = GetterUtil.getLong(ids[0]);
reindexIntPratica(companyId); reindexIntPratica(companyId);
} else { } else {
_log.warn("Received a null or empty set of ids."); _log.warn("Received a null or empty set of ids.");
} }
} }
protected void reindexIntPratica(long companyId) throws PortalException, SystemException { protected void reindexIntPratica(long companyId) throws PortalException, SystemException {
ActionableDynamicQuery actionableDynamicQuery = new IntPraticaActionableDynamicQuery() { ActionableDynamicQuery actionableDynamicQuery = new IntPraticaActionableDynamicQuery() {
@Override @Override
protected void performAction(Object object) throws PortalException { protected void performAction(Object object) throws PortalException {
@ -572,7 +458,6 @@ public class IntPraticaIndexer extends BaseIndexer {
} }
}; };
actionableDynamicQuery.setCompanyId(companyId); actionableDynamicQuery.setCompanyId(companyId);
actionableDynamicQuery.setSearchEngineId(getSearchEngineId()); actionableDynamicQuery.setSearchEngineId(getSearchEngineId());
actionableDynamicQuery.performActions(); actionableDynamicQuery.performActions();
@ -583,7 +468,6 @@ public class IntPraticaIndexer extends BaseIndexer {
IntPratica intPratica = IntPraticaServiceUtil.getIntPratica(id); IntPratica intPratica = IntPraticaServiceUtil.getIntPratica(id);
doReindex(intPratica); doReindex(intPratica);
} }
@Override @Override
@ -595,26 +479,10 @@ public class IntPraticaIndexer extends BaseIndexer {
private boolean checkSottopostaAParere(long intPraticaId) throws SystemException, PortalException { private boolean checkSottopostaAParere(long intPraticaId) throws SystemException, PortalException {
return WorkflowUtil.isWorkflowDisattivabile(intPraticaId); return WorkflowUtil.isWorkflowDisattivabile(intPraticaId);
// List<ControlloPratica> lista =
// ControlloPraticaLocalServiceUtil.findByIntPraticaId_Status(intPraticaId,
// WorkflowConstants.STATUS_APPROVED);
//
// if (Validator.isNotNull(lista) && !lista.isEmpty()) {
// return true;
// } else {
// return false;
// }
} }
private boolean checkLavorazioneSorteggiata(long intPraticaId) throws SystemException { private boolean checkLavorazioneSorteggiata(long intPraticaId) throws SystemException {
Sorteggio sorteggio = SorteggioLocalServiceUtil.findByIntPratica(intPraticaId); return Validator.isNotNull(SorteggioLocalServiceUtil.findByIntPratica(intPraticaId));
if (Validator.isNotNull(sorteggio)) {
return true;
} else {
return false;
}
} }
} }

21
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/AllegatoManualeImpl.java

@ -1,33 +1,32 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
* *
* This library is free software; you can redistribute it and/or modify it under * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* the terms of the GNU Lesser General Public License as published by the Free * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version. * any later version.
* *
* This library is distributed in the hope that it will be useful, but WITHOUT * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details. * details.
*/ */
package it.tref.liferay.portos.bo.model.impl; package it.tref.liferay.portos.bo.model.impl;
/** /**
* The extended model implementation for the AllegatoManuale service. Represents a row in the &quot;portos_bo_AllegatoManuale&quot; database table, with each column mapped to a property of this class. * The extended model implementation for the AllegatoManuale service. Represents a row in the
* &quot;portos_bo_AllegatoManuale&quot; database table, with each column mapped to a property of this class.
* *
* <p> * <p>
* 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.AllegatoManuale} 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.AllegatoManuale} interface.
* </p> * </p>
* *
* @author Davide Barbagallo, 3F Consulting * @author Davide Barbagallo, 3F Consulting
*/ */
public class AllegatoManualeImpl extends AllegatoManualeBaseImpl { public class AllegatoManualeImpl extends AllegatoManualeBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a allegato manuale model
* * instance should use the {@link it.tref.liferay.portos.bo.model.AllegatoManuale} interface instead.
* Never reference this class directly. All methods that expect a allegato manuale model instance should use the {@link it.tref.liferay.portos.bo.model.AllegatoManuale} interface instead.
*/ */
public AllegatoManualeImpl() { public AllegatoManualeImpl() {
} }

34
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/AsseverazioneImpl.java

@ -1,14 +1,12 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
* *
* This library is free software; you can redistribute it and/or modify it under * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* the terms of the GNU Lesser General Public License as published by the Free * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version. * any later version.
* *
* This library is distributed in the hope that it will be useful, but WITHOUT * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details. * details.
*/ */
@ -28,14 +26,12 @@ import com.liferay.portal.kernel.json.JSONFactoryUtil;
import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.kernel.util.Validator;
/** /**
* The extended model implementation for the Asseverazione service. Represents a * The extended model implementation for the Asseverazione service. Represents a row in the
* row in the &quot;portos_bo_Asseverazione&quot; database table, with each * &quot;portos_bo_Asseverazione&quot; database table, with each column mapped to a property of this class.
* column mapped to a property of this class.
* *
* <p> * <p>
* Helper methods and all application logic should be put in this class. * Helper methods and all application logic should be put in this class. Whenever methods are added, rerun
* Whenever methods are added, rerun ServiceBuilder to copy their definitions * ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.bo.model.Asseverazione} interface.
* into the {@link it.tref.liferay.portos.bo.model.Asseverazione} interface.
* </p> * </p>
* *
* @author Davide Barbagallo, 3F Consulting * @author Davide Barbagallo, 3F Consulting
@ -43,15 +39,13 @@ import com.liferay.portal.kernel.util.Validator;
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class AsseverazioneImpl extends AsseverazioneBaseImpl { public class AsseverazioneImpl extends AsseverazioneBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a asseverazione model instance
* * should use the {@link it.tref.liferay.portos.bo.model.Asseverazione} interface instead.
* Never reference this class directly. All methods that expect a
* asseverazione model instance should use the {@link
* it.tref.liferay.portos.bo.model.Asseverazione} interface instead.
*/ */
public AsseverazioneImpl() { public AsseverazioneImpl() {
} }
@Override
public Map<String, Serializable> getDichiarazioniMap() { public Map<String, Serializable> getDichiarazioniMap() {
JSONDeserializer<Map<String, Serializable>> deserializer = JSONFactoryUtil.createJSONDeserializer(); JSONDeserializer<Map<String, Serializable>> deserializer = JSONFactoryUtil.createJSONDeserializer();
String dichiarazioni = getDichiarazioni(); String dichiarazioni = getDichiarazioni();
@ -61,6 +55,7 @@ public class AsseverazioneImpl extends AsseverazioneBaseImpl {
return deserializer.deserialize(dichiarazioni); return deserializer.deserialize(dichiarazioni);
} }
@Override
public String getModello() throws PortalException, SystemException { public String getModello() throws PortalException, SystemException {
String modello = ""; String modello = "";
switch (this.getTipologia()) { switch (this.getTipologia()) {
@ -80,9 +75,8 @@ public class AsseverazioneImpl extends AsseverazioneBaseImpl {
modello = "AS-GEO"; modello = "AS-GEO";
break; break;
case TipoSoggettoUtil.PROGETTISTA: case TipoSoggettoUtil.PROGETTISTA:
Soggetto soggetto = SoggettoLocalServiceUtil Soggetto soggetto = SoggettoLocalServiceUtil.getValidByIntPratica_CodiceFiscale_TipologiaSoggetto(
.getValidByIntPratica_CodiceFiscale_TipologiaSoggetto(this.getIntPraticaId(), this.getIntPraticaId(), this.getCodiceFiscale(), this.getTipologia());
this.getCodiceFiscale(), this.getTipologia());
if (soggetto.getAmbitoProfessione().equals("architettonico")) { if (soggetto.getAmbitoProfessione().equals("architettonico")) {
modello = "AS-PRA"; modello = "AS-PRA";
} else { } else {

98
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. * 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 * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* GNU Lesser General Public License as published by the Free Software Foundation; either version * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* 2.1 of the License, or (at your option) any later version. * any later version.
* *
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* Lesser General Public License for more details. * details.
*/ */
package it.tref.liferay.portos.bo.model.impl; package it.tref.liferay.portos.bo.model.impl;
@ -30,20 +30,19 @@ import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.language.LanguageUtil; import com.liferay.portal.kernel.language.LanguageUtil;
import com.liferay.portal.kernel.repository.model.FileEntry; import com.liferay.portal.kernel.repository.model.FileEntry;
import com.liferay.portal.kernel.util.LocaleUtil; import com.liferay.portal.kernel.util.LocaleUtil;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.theme.ThemeDisplay; import com.liferay.portal.theme.ThemeDisplay;
import com.liferay.portlet.documentlibrary.service.DLAppLocalServiceUtil; import com.liferay.portlet.documentlibrary.service.DLAppLocalServiceUtil;
import com.liferay.portlet.documentlibrary.util.DLUtil; import com.liferay.portlet.documentlibrary.util.DLUtil;
/** /**
* The extended model implementation for the Avviso service. Represents a row in * The extended model implementation for the Avviso service. Represents a row in the &quot;portos_bo_Avviso&quot;
* the &quot;portos_bo_Avviso&quot; database table, with each column mapped to a * database table, with each column mapped to a property of this class.
* property of this class.
* *
* <p> * <p>
* Helper methods and all application logic should be put in this class. * Helper methods and all application logic should be put in this class. Whenever methods are added, rerun
* Whenever methods are added, rerun ServiceBuilder to copy their definitions * ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.bo.model.Avviso} interface.
* into the {@link it.tref.liferay.portos.bo.model.Avviso} interface.
* </p> * </p>
* *
* @author Davide Barbagallo, 3F Consulting * @author Davide Barbagallo, 3F Consulting
@ -55,62 +54,53 @@ public class AvvisoImpl extends AvvisoBaseImpl {
private static final long serialVersionUID = -2350602144741897095L; private static final long serialVersionUID = -2350602144741897095L;
/* /*
* NOTE FOR DEVELOPERS: Never reference this class directly. All methods * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a avviso model instance should
* that expect a avviso model instance should use the {@link * use the {@link it.tref.liferay.portos.bo.model.Avviso} interface instead.
* it.tref.liferay.portos.bo.model.Avviso} interface instead.
*/ */
public AvvisoImpl() { public AvvisoImpl() {
} }
@Override
public String getFullDescription() throws PortalException, SystemException { public String getFullDescription() throws PortalException, SystemException {
String tipoDocumento = AvvisoUtil.getAllTipoDocumento().containsKey(this.getTipoDocumento()) ? AvvisoUtil String tipoDocumento = AvvisoUtil.getAllTipoDocumento().containsKey(this.getTipoDocumento()) ? AvvisoUtil
.getAllTipoDocumento().get(this.getTipoDocumento()) .getAllTipoDocumento().get(this.getTipoDocumento())
: "label.admingeniocivile.avviso.tipoDocumento.avvisomanuale"; : "label.admingeniocivile.avviso.tipoDocumento.avvisomanuale";
String fullDescription = LanguageUtil.get(LocaleUtil.ITALIAN, tipoDocumento); String fullDescription = LanguageUtil.get(LocaleUtil.ITALIAN, tipoDocumento);
if (this.getTipoDocumento().equalsIgnoreCase(StatoPraticaConstants.VIDIMATA)) { if (this.getTipoDocumento().equalsIgnoreCase(StatoPraticaConstants.VIDIMATA)) {
if (this.getClassName().equals(DettPratica.class.getName())) { if (this.getClassName().equals(DettPratica.class.getName())) {
DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(this.getClassPk()); DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(this.getClassPk());
if (TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equalsIgnoreCase(dettPratica if (TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equalsIgnoreCase(dettPratica.getTipoIntegrazione())) {
.getTipoIntegrazione())) { fullDescription += " di <strong>" + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-12")
fullDescription += " di <strong>" + "</strong>";
+ LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-12") + "</strong>";
} else if (TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE.equalsIgnoreCase(dettPratica } else if (TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE.equalsIgnoreCase(dettPratica
.getTipoIntegrazione())) { .getTipoIntegrazione())) {
fullDescription += " di <strong>" fullDescription += " di <strong>" + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-05")
+ LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-05") + " n° " + " n° " + dettPratica.getIntegrazione() + "</strong>";
+ dettPratica.getIntegrazione() + "</strong>";
} else if (TipoIntegrazioneUtil.VARIANTE.equalsIgnoreCase(dettPratica.getTipoIntegrazione())) { } else if (TipoIntegrazioneUtil.VARIANTE.equalsIgnoreCase(dettPratica.getTipoIntegrazione())) {
fullDescription += " di <strong>" fullDescription += " di <strong>" + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-13")
+ LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-13") + " n° " + " n° " + dettPratica.getVarianteNumero() + "</strong>";
+ dettPratica.getVarianteNumero() + "</strong>";
} }
} else if (this.getClassName().equals(FineLavori.class.getName())) { } else if (this.getClassName().equals(FineLavori.class.getName())) {
FineLavori fineLavori = FineLavoriLocalServiceUtil.getFineLavori(this.getClassPk()); FineLavori fineLavori = FineLavoriLocalServiceUtil.getFineLavori(this.getClassPk());
fullDescription += " di <strong>" fullDescription += " di <strong>"
+ LanguageUtil.get(LocaleUtil.ITALIAN, + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-"
"label-integrazione-" + (fineLavori.getParziale() ? "09" : "07")) + " n° " + (fineLavori.getParziale() ? "09" : "07")) + " n° " + fineLavori.getNumero()
+ fineLavori.getNumero() + "</strong>"; + "</strong>";
} else if (this.getClassName().equals(Collaudo.class.getName())) { } else if (this.getClassName().equals(Collaudo.class.getName())) {
Collaudo collaudo = CollaudoLocalServiceUtil.getCollaudo(this.getClassPk()); Collaudo collaudo = CollaudoLocalServiceUtil.getCollaudo(this.getClassPk());
fullDescription += " di <strong>" fullDescription += " di <strong>"
+ LanguageUtil.get(LocaleUtil.ITALIAN, + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-"
"label-integrazione-" + (collaudo.getParziale() ? "10" : "08")) + " n° " + (collaudo.getParziale() ? "10" : "08")) + " n° " + collaudo.getNumero() + "</strong>";
+ collaudo.getNumero() + "</strong>";
} }
} else if (this.getTipoDocumento().equalsIgnoreCase(StatoPraticaConstants.CONFORME)) { } else if (this.getTipoDocumento().equalsIgnoreCase(StatoPraticaConstants.CONFORME)) {
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(this.getIntPraticaId()); IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(this.getIntPraticaId());
return LanguageUtil.get( return LanguageUtil.get(
LocaleUtil.ITALIAN, LocaleUtil.ITALIAN,
AvvisoUtil.getAllTipoDocumento().get( AvvisoUtil.getAllTipoDocumento().get(
PraticaUtil.getStatoPraticaCode(StatoPraticaConstants.CONFORME, intPratica))); PraticaUtil.getStatoPraticaCode(StatoPraticaConstants.CONFORME, intPratica)));
} else if (this.getTipoDocumento().equalsIgnoreCase(StatoPraticaConstants.NON_CONFORME)) { } else if (this.getTipoDocumento().equalsIgnoreCase(StatoPraticaConstants.NON_CONFORME)) {
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(this.getIntPraticaId()); IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(this.getIntPraticaId());
return LanguageUtil.get( return LanguageUtil.get(
@ -118,10 +108,10 @@ public class AvvisoImpl extends AvvisoBaseImpl {
AvvisoUtil.getAllTipoDocumento().get( AvvisoUtil.getAllTipoDocumento().get(
PraticaUtil.getStatoPraticaCode(StatoPraticaConstants.NON_CONFORME, intPratica))); PraticaUtil.getStatoPraticaCode(StatoPraticaConstants.NON_CONFORME, intPratica)));
} }
return fullDescription; return fullDescription;
} }
@Override
public String getDescriptionOggettoProtocollo() throws PortalException, SystemException { public String getDescriptionOggettoProtocollo() throws PortalException, SystemException {
String fullDescription = LanguageUtil.get(LocaleUtil.ITALIAN, String fullDescription = LanguageUtil.get(LocaleUtil.ITALIAN,
@ -132,15 +122,11 @@ public class AvvisoImpl extends AvvisoBaseImpl {
} else if (Validator.isNotNull(this.getDescLong())) { } else if (Validator.isNotNull(this.getDescLong())) {
fullDescription = this.getDescLong(); fullDescription = this.getDescLong();
} }
if (this.getTipoDocumento().equalsIgnoreCase(StatoPraticaConstants.VIDIMATA)) { if (this.getTipoDocumento().equalsIgnoreCase(StatoPraticaConstants.VIDIMATA)) {
if (this.getClassName().equals(DettPratica.class.getName())) { if (this.getClassName().equals(DettPratica.class.getName())) {
DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(this.getClassPk()); DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(this.getClassPk());
if (TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equalsIgnoreCase(dettPratica if (TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equalsIgnoreCase(dettPratica.getTipoIntegrazione())) {
.getTipoIntegrazione())) { fullDescription += " di " + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-12") + "";
fullDescription += " di " + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-12")
+ "";
} else if (TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE.equalsIgnoreCase(dettPratica } else if (TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE.equalsIgnoreCase(dettPratica
.getTipoIntegrazione())) { .getTipoIntegrazione())) {
fullDescription += " di " + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-05"); fullDescription += " di " + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-05");
@ -150,24 +136,20 @@ public class AvvisoImpl extends AvvisoBaseImpl {
} else if (this.getClassName().equals(FineLavori.class.getName())) { } else if (this.getClassName().equals(FineLavori.class.getName())) {
FineLavori fineLavori = FineLavoriLocalServiceUtil.getFineLavori(this.getClassPk()); FineLavori fineLavori = FineLavoriLocalServiceUtil.getFineLavori(this.getClassPk());
fullDescription += " di " fullDescription += " di "
+ LanguageUtil.get(LocaleUtil.ITALIAN, + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-"
"label-integrazione-" + (fineLavori.getParziale() ? "09" : "07")); + (fineLavori.getParziale() ? "09" : "07"));
} else if (this.getClassName().equals(Collaudo.class.getName())) { } else if (this.getClassName().equals(Collaudo.class.getName())) {
Collaudo collaudo = CollaudoLocalServiceUtil.getCollaudo(this.getClassPk()); Collaudo collaudo = CollaudoLocalServiceUtil.getCollaudo(this.getClassPk());
fullDescription += " di " fullDescription += " di "
+ LanguageUtil.get(LocaleUtil.ITALIAN, + LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-"
"label-integrazione-" + (collaudo.getParziale() ? "10" : "08")); + (collaudo.getParziale() ? "10" : "08"));
} }
} else if (this.getTipoDocumento().equalsIgnoreCase(StatoPraticaConstants.CONFORME)) { } else if (this.getTipoDocumento().equalsIgnoreCase(StatoPraticaConstants.CONFORME)) {
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(this.getIntPraticaId()); IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(this.getIntPraticaId());
return LanguageUtil.get( return LanguageUtil.get(
LocaleUtil.ITALIAN, LocaleUtil.ITALIAN,
AvvisoUtil.getAllTipoDocumento().get( AvvisoUtil.getAllTipoDocumento().get(
PraticaUtil.getStatoPraticaCode(StatoPraticaConstants.CONFORME, intPratica))); PraticaUtil.getStatoPraticaCode(StatoPraticaConstants.CONFORME, intPratica)));
} else if (this.getTipoDocumento().equalsIgnoreCase(StatoPraticaConstants.NON_CONFORME)) { } else if (this.getTipoDocumento().equalsIgnoreCase(StatoPraticaConstants.NON_CONFORME)) {
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(this.getIntPraticaId()); IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(this.getIntPraticaId());
return LanguageUtil.get( return LanguageUtil.get(
@ -175,40 +157,34 @@ public class AvvisoImpl extends AvvisoBaseImpl {
AvvisoUtil.getAllTipoDocumento().get( AvvisoUtil.getAllTipoDocumento().get(
PraticaUtil.getStatoPraticaCode(StatoPraticaConstants.NON_CONFORME, intPratica))); PraticaUtil.getStatoPraticaCode(StatoPraticaConstants.NON_CONFORME, intPratica)));
} }
return fullDescription.replace("Avviso di ", StringPool.BLANK);
return fullDescription.replace("Avviso di ", "");
} }
@Override
public String getDownloadUrl(ThemeDisplay themeDisplay) throws PortalException, SystemException { public String getDownloadUrl(ThemeDisplay themeDisplay) throws PortalException, SystemException {
if (Validator.isNotNull(getFileEntryIdInvio())) { if (Validator.isNotNull(getFileEntryIdInvio())) {
FileEntry fileEntry = DLAppLocalServiceUtil.getFileEntry(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; return null;
} }
@Override
public String translateTipoDocumento() throws PortalException, SystemException { public String translateTipoDocumento() throws PortalException, SystemException {
String tipoDocumento = AvvisoUtil.getAllTipoDocumento().containsKey(this.getTipoDocumento()) ? AvvisoUtil String tipoDocumento = AvvisoUtil.getAllTipoDocumento().containsKey(this.getTipoDocumento()) ? AvvisoUtil
.getAllTipoDocumento().get(this.getTipoDocumento()) .getAllTipoDocumento().get(this.getTipoDocumento())
: "label.admingeniocivile.avviso.tipoDocumento.avvisomanuale"; : "label.admingeniocivile.avviso.tipoDocumento.avvisomanuale";
if (this.getTipoDocumento().equalsIgnoreCase(StatoPraticaConstants.CONFORME)) { if (this.getTipoDocumento().equalsIgnoreCase(StatoPraticaConstants.CONFORME)) {
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(this.getIntPraticaId()); IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(this.getIntPraticaId());
tipoDocumento = AvvisoUtil.getAllTipoDocumento().get( tipoDocumento = AvvisoUtil.getAllTipoDocumento().get(
PraticaUtil.getStatoPraticaCode(StatoPraticaConstants.CONFORME, intPratica)); PraticaUtil.getStatoPraticaCode(StatoPraticaConstants.CONFORME, intPratica));
} else if (this.getTipoDocumento().equalsIgnoreCase(StatoPraticaConstants.NON_CONFORME)) { } else if (this.getTipoDocumento().equalsIgnoreCase(StatoPraticaConstants.NON_CONFORME)) {
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(this.getIntPraticaId()); IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(this.getIntPraticaId());
tipoDocumento = AvvisoUtil.getAllTipoDocumento().get( tipoDocumento = AvvisoUtil.getAllTipoDocumento().get(
PraticaUtil.getStatoPraticaCode(StatoPraticaConstants.NON_CONFORME, intPratica)); PraticaUtil.getStatoPraticaCode(StatoPraticaConstants.NON_CONFORME, intPratica));
} }
return tipoDocumento; return tipoDocumento;
} }
} }

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

@ -54,7 +54,6 @@ public class CollaudoImpl extends CollaudoBaseImpl {
public String getTitle(Locale locale) { public String getTitle(Locale locale) {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
try { try {
IntPratica intPratica = IntPraticaLocalServiceUtil.fetchIntPratica(getIntPraticaId()); IntPratica intPratica = IntPraticaLocalServiceUtil.fetchIntPratica(getIntPraticaId());
if (AzioniPraticheUtil.isDeposito(intPratica.getIntPraticaId())) { if (AzioniPraticheUtil.isDeposito(intPratica.getIntPraticaId())) {

3
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/DelegaImpl.java

@ -15,7 +15,6 @@
package it.tref.liferay.portos.bo.model.impl; package it.tref.liferay.portos.bo.model.impl;
import java.io.Serializable; import java.io.Serializable;
import java.util.HashMap;
import java.util.Map; import java.util.Map;
import com.liferay.portal.kernel.json.JSONDeserializer; import com.liferay.portal.kernel.json.JSONDeserializer;
@ -47,7 +46,9 @@ public class DelegaImpl extends DelegaBaseImpl {
public DelegaImpl() { public DelegaImpl() {
} }
@Override
public Map<String, Serializable> getDichiarazioniMap() { public Map<String, Serializable> getDichiarazioniMap() {
JSONDeserializer<Map<String, Serializable>> deserializer = JSONFactoryUtil.createJSONDeserializer(); JSONDeserializer<Map<String, Serializable>> deserializer = JSONFactoryUtil.createJSONDeserializer();
String dichiarazioni = getDichiarazioni(); String dichiarazioni = getDichiarazioni();
if (Validator.isNull(dichiarazioni)) { if (Validator.isNull(dichiarazioni)) {

3
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/DettPraticaImpl.java

@ -70,9 +70,7 @@ public class DettPraticaImpl extends DettPraticaBaseImpl {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
IntPratica intPratica = null; IntPratica intPratica = null;
try { try {
intPratica = IntPraticaLocalServiceUtil.fetchIntPratica(getIntPraticaId()); intPratica = IntPraticaLocalServiceUtil.fetchIntPratica(getIntPraticaId());
if (AzioniPraticheUtil.isDeposito(intPratica.getIntPraticaId())) { if (AzioniPraticheUtil.isDeposito(intPratica.getIntPraticaId())) {
sb.append("Deposito "); sb.append("Deposito ");
@ -778,7 +776,6 @@ public class DettPraticaImpl extends DettPraticaBaseImpl {
Validator.isNull(getIntervFinPubDesc()) ? StringPool.BLANK : LanguageUtil.get( Validator.isNull(getIntervFinPubDesc()) ? StringPool.BLANK : LanguageUtil.get(
LocaleUtil.getSiteDefault(), "interv-fin-pub-desc")); LocaleUtil.getSiteDefault(), "interv-fin-pub-desc"));
attributes.put("dpdc", getDpdc() ? StringPool.TRUE : StringPool.FALSE); attributes.put("dpdc", getDpdc() ? StringPool.TRUE : StringPool.FALSE);
return attributes; return attributes;
} }
} }

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

@ -45,13 +45,13 @@ public class DocAggiuntivaImpl extends DocAggiuntivaBaseImpl {
public DocAggiuntivaImpl() { public DocAggiuntivaImpl() {
} }
@Override
public String getFileName() throws PortalException, SystemException { public String getFileName() throws PortalException, SystemException {
if (getFileEntryId() == 0L && getOldFileEntryId() != 0L) { if (getFileEntryId() == 0L && getOldFileEntryId() != 0L) {
FilesImporter.handleFileImportDocAggiuntiva(this); FilesImporter.handleFileImportDocAggiuntiva(this);
return StringPool.BLANK; return StringPool.BLANK;
} }
DLFileEntry file = DLFileEntryServiceUtil.getFileEntry(getFileEntryId()); DLFileEntry file = DLFileEntryServiceUtil.getFileEntry(getFileEntryId());
return file.getDescription(); return file.getDescription();
} }

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

@ -56,6 +56,7 @@ public class DocPraticaImpl extends DocPraticaBaseImpl {
return file.getTitle(); return file.getTitle();
} }
@Override
public String getDownloadUrl(ThemeDisplay themeDisplay) throws PortalException, SystemException { public String getDownloadUrl(ThemeDisplay themeDisplay) throws PortalException, SystemException {
if (Validator.isNull(getDlFileEntryId())) { if (Validator.isNull(getDlFileEntryId())) {
return "Da importare"; return "Da importare";
@ -63,5 +64,4 @@ public class DocPraticaImpl extends DocPraticaBaseImpl {
FileEntry fileEntry = DLAppLocalServiceUtil.getFileEntry(getDlFileEntryId()); FileEntry fileEntry = DLAppLocalServiceUtil.getFileEntry(getDlFileEntryId());
return DLUtil.getPreviewURL(fileEntry, fileEntry.getFileVersion(), themeDisplay, "&download=true"); return DLUtil.getPreviewURL(fileEntry, fileEntry.getFileVersion(), themeDisplay, "&download=true");
} }
} }

62
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/FineLavoriImpl.java

@ -1,13 +1,13 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * 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 * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* GNU Lesser General Public License as published by the Free Software Foundation; either version * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* 2.1 of the License, or (at your option) any later version. * any later version.
* *
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* Lesser General Public License for more details. * details.
*/ */
package it.tref.liferay.portos.bo.model.impl; package it.tref.liferay.portos.bo.model.impl;
@ -29,82 +29,66 @@ import com.liferay.portal.kernel.util.Validator;
/** /**
* The extended model implementation for the FineLavori service. Represents a row in the * The extended model implementation for the FineLavori service. Represents a row in the
* &quot;portos_bo_FineLavori&quot; database table, with each column mapped to a property of this * &quot;portos_bo_FineLavori&quot; database table, with each column mapped to a property of this class.
* class.
* *
* <p> * <p>
* Helper methods and all application logic should be put in this class. Whenever methods are added, * Helper methods and all application logic should be put in this class. Whenever methods are added, rerun
* rerun ServiceBuilder to copy their definitions into the * ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.bo.model.FineLavori} interface.
* {@link it.tref.liferay.portos.bo.model.FineLavori} interface.
* </p> * </p>
* *
* @author Davide Barbagallo, 3F Consulting * @author Davide Barbagallo, 3F Consulting
*/ */
@SuppressWarnings("serial")
public class FineLavoriImpl extends FineLavoriBaseImpl { public class FineLavoriImpl extends FineLavoriBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a fine lavori model instance
*
* Never reference this class directly. All methods that expect a fine lavori model instance
* should use the {@link it.tref.liferay.portos.bo.model.FineLavori} interface instead. * should use the {@link it.tref.liferay.portos.bo.model.FineLavori} interface instead.
*/ */
private static final Log _log = LogFactoryUtil.getLog(FineLavoriImpl.class); private static final Log _log = LogFactoryUtil.getLog(FineLavoriImpl.class);
public FineLavoriImpl() {} public FineLavoriImpl() {
}
@Override
public String getTitle(Locale locale) { public String getTitle(Locale locale) {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
try { try {
IntPratica intPratica = IntPraticaLocalServiceUtil.fetchIntPratica(getIntPraticaId()); IntPratica intPratica = IntPraticaLocalServiceUtil.fetchIntPratica(getIntPraticaId());
// sb.append("Progetto ");
if (AzioniPraticheUtil.isDeposito(intPratica.getIntPraticaId())) { if (AzioniPraticheUtil.isDeposito(intPratica.getIntPraticaId())) {
sb.append("Deposito "); sb.append("Deposito ");
} else if (AzioniPraticheUtil.isAutorizzazione(intPratica.getIntPraticaId())) { } else if (AzioniPraticheUtil.isAutorizzazione(intPratica.getIntPraticaId())) {
sb.append("Autorizzazione "); sb.append("Autorizzazione ");
} }
sb.append("n. "); sb.append("n. ");
if (Validator.isNotNull(getProtocollo())) { if (Validator.isNotNull(getProtocollo())) {
sb.append(intPratica.getNumeroProgetto());
// TODO da decidere che data, per adesso si mette quella di creazione il numero protocollo // TODO da decidere che data, per adesso si mette quella di creazione il numero protocollo
// sbagliato dovrebbe essere il primo // sbagliato dovrebbe essere il primo
sb.append(" del "); sb.append(intPratica.getNumeroProgetto()).append(" del ")
sb.append(FastDateFormatFactoryUtil.getDate(locale).format(intPratica.getDtPratica())); .append(FastDateFormatFactoryUtil.getDate(locale).format(intPratica.getDtPratica()))
sb.append(StringPool.SPACE + StringPool.DASH + StringPool.SPACE); .append(" - id ").append(intPratica.getIntPraticaId());
sb.append(" id ");
sb.append(intPratica.getIntPraticaId());
} else { } else {
if (Validator.isNotNull(intPratica.getNumeroProgetto())) { if (Validator.isNotNull(intPratica.getNumeroProgetto())) {
sb.append(intPratica.getNumeroProgetto()); sb.append(intPratica.getNumeroProgetto()).append(StringPool.SPACE).append(StringPool.DASH)
sb.append(StringPool.SPACE + StringPool.DASH + StringPool.SPACE); .append(StringPool.SPACE);
} }
sb.append(getFineLavoriId()); sb.append(getFineLavoriId()).append(" (Temporaneo) - id ").append(intPratica.getIntPraticaId());
sb.append(" (Temporaneo) ");
sb.append(StringPool.SPACE + StringPool.DASH + StringPool.SPACE);
sb.append(" id ");
sb.append(intPratica.getIntPraticaId());
} }
} catch (PortalException | SystemException e) {
} catch (PortalException e) {
_log.error(e, e);
} catch (SystemException e) {
_log.error(e, e); _log.error(e, e);
} }
return sb.toString(); return sb.toString();
} }
@Override
public String getTitle() { public String getTitle() {
return getTitle(LocaleUtil.getSiteDefault()); return getTitle(LocaleUtil.getSiteDefault());
} }
@Override
public String getFullDescription() { public String getFullDescription() {
return getTitle(); return getTitle();

27
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/HistoryWorkflowActionImpl.java

@ -1,28 +1,24 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
* *
* This library is free software; you can redistribute it and/or modify it under * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* the terms of the GNU Lesser General Public License as published by the Free * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version. * any later version.
* *
* This library is distributed in the hope that it will be useful, but WITHOUT * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details. * details.
*/ */
package it.tref.liferay.portos.bo.model.impl; package it.tref.liferay.portos.bo.model.impl;
/** /**
* The extended model implementation for the HistoryWorkflowAction service. * The extended model implementation for the HistoryWorkflowAction service. Represents a row in the
* Represents a row in the &quot;portos_bo_HistoryWorkflowAction&quot; database * &quot;portos_bo_HistoryWorkflowAction&quot; database table, with each column mapped to a property of this class.
* table, with each column mapped to a property of this class.
* *
* <p> * <p>
* Helper methods and all application logic should be put in this class. * Helper methods and all application logic should be put in this class. Whenever methods are added, rerun
* Whenever methods are added, rerun ServiceBuilder to copy their definitions * ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.bo.model.HistoryWorkflowAction}
* into the {@link it.tref.liferay.portos.bo.model.HistoryWorkflowAction}
* interface. * interface.
* </p> * </p>
* *
@ -31,11 +27,8 @@ package it.tref.liferay.portos.bo.model.impl;
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class HistoryWorkflowActionImpl extends HistoryWorkflowActionBaseImpl { public class HistoryWorkflowActionImpl extends HistoryWorkflowActionBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a history workflow action model
* * instance should use the {@link it.tref.liferay.portos.bo.model.HistoryWorkflowAction} interface instead.
* Never reference this class directly. All methods that expect a history
* workflow action model instance should use the {@link
* it.tref.liferay.portos.bo.model.HistoryWorkflowAction} interface instead.
*/ */
public HistoryWorkflowActionImpl() { public HistoryWorkflowActionImpl() {
} }

27
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/IUVImpl.java

@ -1,28 +1,24 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
* *
* This library is free software; you can redistribute it and/or modify it under * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* the terms of the GNU Lesser General Public License as published by the Free * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version. * any later version.
* *
* This library is distributed in the hope that it will be useful, but WITHOUT * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details. * details.
*/ */
package it.tref.liferay.portos.bo.model.impl; package it.tref.liferay.portos.bo.model.impl;
/** /**
* The extended model implementation for the IUV service. Represents a row in * The extended model implementation for the IUV service. Represents a row in the &quot;portos_bo_IUV&quot; database
* the &quot;portos_bo_IUV&quot; database table, with each column mapped to a * table, with each column mapped to a property of this class.
* property of this class.
* *
* <p> * <p>
* Helper methods and all application logic should be put in this class. * Helper methods and all application logic should be put in this class. Whenever methods are added, rerun
* Whenever methods are added, rerun ServiceBuilder to copy their definitions * ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.bo.model.IUV} interface.
* into the {@link it.tref.liferay.portos.bo.model.IUV} interface.
* </p> * </p>
* *
* @author Davide Barbagallo, 3F Consulting * @author Davide Barbagallo, 3F Consulting
@ -30,11 +26,8 @@ package it.tref.liferay.portos.bo.model.impl;
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class IUVImpl extends IUVBaseImpl { public class IUVImpl extends IUVBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a i u v model instance should
* * use the {@link it.tref.liferay.portos.bo.model.IUV} interface instead.
* Never reference this class directly. All methods that expect a i u v
* model instance should use the {@link it.tref.liferay.portos.bo.model.IUV}
* interface instead.
*/ */
public IUVImpl() { public IUVImpl() {
} }

27
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/InfoFascicoloImpl.java

@ -1,28 +1,24 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
* *
* This library is free software; you can redistribute it and/or modify it under * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* the terms of the GNU Lesser General Public License as published by the Free * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version. * any later version.
* *
* This library is distributed in the hope that it will be useful, but WITHOUT * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details. * details.
*/ */
package it.tref.liferay.portos.bo.model.impl; package it.tref.liferay.portos.bo.model.impl;
/** /**
* The extended model implementation for the InfoFascicolo service. Represents a * The extended model implementation for the InfoFascicolo service. Represents a row in the
* row in the &quot;portos_bo_InfoFascicolo&quot; database table, with each * &quot;portos_bo_InfoFascicolo&quot; database table, with each column mapped to a property of this class.
* column mapped to a property of this class.
* *
* <p> * <p>
* Helper methods and all application logic should be put in this class. * Helper methods and all application logic should be put in this class. Whenever methods are added, rerun
* Whenever methods are added, rerun ServiceBuilder to copy their definitions * ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.bo.model.InfoFascicolo} interface.
* into the {@link it.tref.liferay.portos.bo.model.InfoFascicolo} interface.
* </p> * </p>
* *
* @author Davide Barbagallo, 3F Consulting * @author Davide Barbagallo, 3F Consulting
@ -30,11 +26,8 @@ package it.tref.liferay.portos.bo.model.impl;
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class InfoFascicoloImpl extends InfoFascicoloBaseImpl { public class InfoFascicoloImpl extends InfoFascicoloBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a info fascicolo model instance
* * should use the {@link it.tref.liferay.portos.bo.model.InfoFascicolo} interface instead.
* Never reference this class directly. All methods that expect a info
* fascicolo model instance should use the {@link
* it.tref.liferay.portos.bo.model.InfoFascicolo} interface instead.
*/ */
public InfoFascicoloImpl() { public InfoFascicoloImpl() {
} }

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

@ -1,13 +1,13 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * 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 * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* GNU Lesser General Public License as published by the Free Software Foundation; either version * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* 2.1 of the License, or (at your option) any later version. * any later version.
* *
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* Lesser General Public License for more details. * details.
*/ */
package it.tref.liferay.portos.bo.model.impl; package it.tref.liferay.portos.bo.model.impl;
@ -21,26 +21,25 @@ import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.log.Log; import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil; import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.util.LocaleUtil; import com.liferay.portal.kernel.util.LocaleUtil;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.kernel.util.Validator;
/** /**
* The extended model implementation for the IntPratica service. Represents a * The extended model implementation for the IntPratica service. Represents a row in the
* row in the &quot;portos_bo_IntPratica&quot; database table, with each column * &quot;portos_bo_IntPratica&quot; database table, with each column mapped to a property of this class.
* mapped to a property of this class.
* *
* <p> * <p>
* Helper methods and all application logic should be put in this class. * Helper methods and all application logic should be put in this class. Whenever methods are added, rerun
* Whenever methods are added, rerun ServiceBuilder to copy their definitions * ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.bo.model.IntPratica} interface.
* into the {@link it.tref.liferay.portos.bo.model.IntPratica} interface.
* </p> * </p>
* *
* @author Davide Barbagallo, 3F Consulting * @author Davide Barbagallo, 3F Consulting
*/ */
@SuppressWarnings("serial")
public class IntPraticaImpl extends IntPraticaBaseImpl { public class IntPraticaImpl extends IntPraticaBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: Never reference this class directly. All methods * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a int pratica model instance
* that expect a int pratica model instance should use the {@link * should use the {@link it.tref.liferay.portos.bo.model.IntPratica} interface instead.
* it.tref.liferay.portos.bo.model.IntPratica} interface instead.
*/ */
private static final Log _log = LogFactoryUtil.getLog(IntPraticaImpl.class); private static final Log _log = LogFactoryUtil.getLog(IntPraticaImpl.class);
@ -49,6 +48,7 @@ public class IntPraticaImpl extends IntPraticaBaseImpl {
} }
@Override
public String getTitle(Locale locale, boolean completed) { public String getTitle(Locale locale, boolean completed) {
DettPratica dettPratica = null; DettPratica dettPratica = null;
@ -56,7 +56,6 @@ public class IntPraticaImpl extends IntPraticaBaseImpl {
if (completed) { if (completed) {
dettPratica = DettPraticaLocalServiceUtil dettPratica = DettPraticaLocalServiceUtil
.getLastCompletedByIntPraticaAndProtocolloNotEmpty(getIntPraticaId()); .getLastCompletedByIntPraticaAndProtocolloNotEmpty(getIntPraticaId());
} else { } else {
dettPratica = DettPraticaLocalServiceUtil.getLastEditableByIntPratica(getIntPraticaId()); dettPratica = DettPraticaLocalServiceUtil.getLastEditableByIntPratica(getIntPraticaId());
if (dettPratica == null) { if (dettPratica == null) {
@ -66,34 +65,31 @@ public class IntPraticaImpl extends IntPraticaBaseImpl {
} catch (SystemException e) { } catch (SystemException e) {
_log.error("Error on intPraticaId=" + getIntPraticaId(), e); _log.error("Error on intPraticaId=" + getIntPraticaId(), e);
} }
return Validator.isNotNull(dettPratica) ? dettPratica.getTitle(locale) : StringPool.DASH;
return Validator.isNotNull(dettPratica) ? dettPratica.getTitle(locale) : "-";
} }
@Override
public String getTitle(boolean completed) { public String getTitle(boolean completed) {
return getTitle(LocaleUtil.getSiteDefault(), completed); return getTitle(LocaleUtil.getSiteDefault(), completed);
} }
@Override
public boolean isAnnullata() { public boolean isAnnullata() {
return Validator.isNotNull(this.getDtAnnullamento()); return Validator.isNotNull(this.getDtAnnullamento());
} }
@Override
public boolean isChiusa() throws SystemException { public boolean isChiusa() throws SystemException {
boolean completata = false; boolean completata = false;
DettPratica lastDettPratica = DettPraticaLocalServiceUtil DettPratica lastDettPratica = DettPraticaLocalServiceUtil.getLastCompletedByIntPratica(getIntPraticaId());
.getLastCompletedByIntPratica(getIntPraticaId());
if (getCollaudoTotale()) { if (getCollaudoTotale()) {
completata = true; completata = true;
} else if (lastDettPratica != null && lastDettPratica.getCollaudoStatico() && getFineLavoriTotale()) { } else if (lastDettPratica != null && lastDettPratica.getCollaudoStatico() && getFineLavoriTotale()) {
completata = true; completata = true;
} else {
completata = false;
} }
return completata; return completata;
} }
} }

38
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/PagamentoImpl.java

@ -1,13 +1,13 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * 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 * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* GNU Lesser General Public License as published by the Free Software Foundation; either version * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* 2.1 of the License, or (at your option) any later version. * any later version.
* *
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* Lesser General Public License for more details. * details.
*/ */
package it.tref.liferay.portos.bo.model.impl; package it.tref.liferay.portos.bo.model.impl;
@ -25,38 +25,38 @@ import com.liferay.portlet.documentlibrary.service.DLAppLocalServiceUtil;
import com.liferay.portlet.documentlibrary.util.DLUtil; import com.liferay.portlet.documentlibrary.util.DLUtil;
/** /**
* The extended model implementation for the Pagamento service. Represents a row in the * The extended model implementation for the Pagamento service. Represents a row in the &quot;portos_bo_Pagamento&quot;
* &quot;portos_bo_Pagamento&quot; database table, with each column mapped to a property of this * database table, with each column mapped to a property of this class.
* class.
* *
* <p> * <p>
* Helper methods and all application logic should be put in this class. Whenever methods are added, * Helper methods and all application logic should be put in this class. Whenever methods are added, rerun
* rerun ServiceBuilder to copy their definitions into the * ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.bo.model.Pagamento} interface.
* {@link it.tref.liferay.portos.bo.model.Pagamento} interface.
* </p> * </p>
* *
* @author Davide Barbagallo, 3F Consulting * @author Davide Barbagallo, 3F Consulting
*/ */
@SuppressWarnings("serial")
public class PagamentoImpl extends PagamentoBaseImpl { public class PagamentoImpl extends PagamentoBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a pagamento model instance
* * should use the {@link it.tref.liferay.portos.bo.model.Pagamento} interface instead.
* Never reference this class directly. All methods that expect a pagamento model instance should
* use the {@link it.tref.liferay.portos.bo.model.Pagamento} interface instead.
*/ */
public PagamentoImpl() {} public PagamentoImpl() {
}
@Override
public String getDownloadUrl(ThemeDisplay themeDisplay) throws PortalException, SystemException { public String getDownloadUrl(ThemeDisplay themeDisplay) throws PortalException, SystemException {
if (Validator.isNull(getFileEntryId())) { if (Validator.isNull(getFileEntryId())) {
return null; return null;
} }
FileEntry fileEntry = DLAppLocalServiceUtil.getFileEntry(getFileEntryId()); FileEntry fileEntry = DLAppLocalServiceUtil.getFileEntry(getFileEntryId());
return DLUtil.getPreviewURL(fileEntry, fileEntry.getFileVersion(), themeDisplay, "&download=true"); return DLUtil.getPreviewURL(fileEntry, fileEntry.getFileVersion(), themeDisplay, "&download=true");
} }
@Override
public String getImportoString() { public String getImportoString() {
String importo = getImporto(); String importo = getImporto();
BigDecimal importoVal; BigDecimal importoVal;
if (Validator.isNotNull(importo)) { if (Validator.isNotNull(importo)) {

22
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/ParereGeologoImpl.java

@ -1,33 +1,33 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
* *
* This library is free software; you can redistribute it and/or modify it under * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* the terms of the GNU Lesser General Public License as published by the Free * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version. * any later version.
* *
* This library is distributed in the hope that it will be useful, but WITHOUT * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details. * details.
*/ */
package it.tref.liferay.portos.bo.model.impl; package it.tref.liferay.portos.bo.model.impl;
/** /**
* The extended model implementation for the ParereGeologo service. Represents a row in the &quot;portos_bo_ParereGeologo&quot; database table, with each column mapped to a property of this class. * The extended model implementation for the ParereGeologo service. Represents a row in the
* &quot;portos_bo_ParereGeologo&quot; database table, with each column mapped to a property of this class.
* *
* <p> * <p>
* 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.ParereGeologo} 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.ParereGeologo} interface.
* </p> * </p>
* *
* @author Davide Barbagallo, 3F Consulting * @author Davide Barbagallo, 3F Consulting
*/ */
@SuppressWarnings("serial")
public class ParereGeologoImpl extends ParereGeologoBaseImpl { public class ParereGeologoImpl extends ParereGeologoBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a parere geologo model instance
* * should use the {@link it.tref.liferay.portos.bo.model.ParereGeologo} interface instead.
* Never reference this class directly. All methods that expect a parere geologo model instance should use the {@link it.tref.liferay.portos.bo.model.ParereGeologo} interface instead.
*/ */
public ParereGeologoImpl() { public ParereGeologoImpl() {
} }

27
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/ProvinciaImpl.java

@ -1,28 +1,24 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
* *
* This library is free software; you can redistribute it and/or modify it under * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* the terms of the GNU Lesser General Public License as published by the Free * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version. * any later version.
* *
* This library is distributed in the hope that it will be useful, but WITHOUT * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details. * details.
*/ */
package it.tref.liferay.portos.bo.model.impl; package it.tref.liferay.portos.bo.model.impl;
/** /**
* The extended model implementation for the Provincia service. Represents a row * The extended model implementation for the Provincia service. Represents a row in the &quot;portos_provincia&quot;
* in the &quot;portos_provincia&quot; database table, with each column mapped * database table, with each column mapped to a property of this class.
* to a property of this class.
* *
* <p> * <p>
* Helper methods and all application logic should be put in this class. * Helper methods and all application logic should be put in this class. Whenever methods are added, rerun
* Whenever methods are added, rerun ServiceBuilder to copy their definitions * ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.bo.model.Provincia} interface.
* into the {@link it.tref.liferay.portos.bo.model.Provincia} interface.
* </p> * </p>
* *
* @author Davide Barbagallo, 3F Consulting * @author Davide Barbagallo, 3F Consulting
@ -30,11 +26,8 @@ package it.tref.liferay.portos.bo.model.impl;
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class ProvinciaImpl extends ProvinciaBaseImpl { public class ProvinciaImpl extends ProvinciaBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a provincia model instance
* * should use the {@link it.tref.liferay.portos.bo.model.Provincia} interface instead.
* Never reference this class directly. All methods that expect a provincia
* model instance should use the {@link
* it.tref.liferay.portos.bo.model.Provincia} interface instead.
*/ */
public ProvinciaImpl() { public ProvinciaImpl() {
} }

41
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/SoggettoImpl.java

@ -1,13 +1,13 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * 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 * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* GNU Lesser General Public License as published by the Free Software Foundation; either version * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* 2.1 of the License, or (at your option) any later version. * any later version.
* *
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* Lesser General Public License for more details. * details.
*/ */
package it.tref.liferay.portos.bo.model.impl; package it.tref.liferay.portos.bo.model.impl;
@ -18,14 +18,12 @@ import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.kernel.util.Validator;
/** /**
* The extended model implementation for the Soggetto service. Represents a row * The extended model implementation for the Soggetto service. Represents a row in the &quot;portos_bo_Soggetto&quot;
* in the &quot;portos_bo_Soggetto&quot; database table, with each column mapped * database table, with each column mapped to a property of this class.
* to a property of this class.
* *
* <p> * <p>
* Helper methods and all application logic should be put in this class. * Helper methods and all application logic should be put in this class. Whenever methods are added, rerun
* Whenever methods are added, rerun ServiceBuilder to copy their definitions * ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.bo.model.Soggetto} interface.
* into the {@link it.tref.liferay.portos.bo.model.Soggetto} interface.
* </p> * </p>
* *
* @author Davide Barbagallo, 3F Consulting * @author Davide Barbagallo, 3F Consulting
@ -33,18 +31,16 @@ import com.liferay.portal.kernel.util.Validator;
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class SoggettoImpl extends SoggettoBaseImpl { public class SoggettoImpl extends SoggettoBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: Never reference this class directly. All methods * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a soggetto model instance
* that expect a soggetto model instance should use the {@link * should use the {@link it.tref.liferay.portos.bo.model.Soggetto} interface instead.
* it.tref.liferay.portos.bo.model.Soggetto} interface instead.
*/ */
public SoggettoImpl() { public SoggettoImpl() {
} }
@Override
public String getFullTipologiaSoggetto() { public String getFullTipologiaSoggetto() {
String tipologia = LanguageUtil.get(LocaleUtil.ITALIAN, "gc-soggetto-" + getTipologiaSoggetto()); String tipologia = LanguageUtil.get(LocaleUtil.ITALIAN, "gc-soggetto-" + getTipologiaSoggetto());
String ambito = StringPool.BLANK; String ambito = StringPool.BLANK;
if (Validator.isNotNull(getAmbitoProfessione())) { if (Validator.isNotNull(getAmbitoProfessione())) {
ambito = StringPool.SPACE + StringPool.DASH + StringPool.SPACE; ambito = StringPool.SPACE + StringPool.DASH + StringPool.SPACE;
@ -57,10 +53,10 @@ public class SoggettoImpl extends SoggettoBaseImpl {
return tipologia + ambito; return tipologia + ambito;
} }
@Override
public String getDescrizioneCompleta() { public String getDescrizioneCompleta() {
String descrizione = getCodiceFiscale().toUpperCase() + StringPool.SPACE + "-"; String descrizione = getCodiceFiscale().toUpperCase() + StringPool.SPACE + StringPool.DASH;
if (Validator.isNotNull(getCognome())) { if (Validator.isNotNull(getCognome())) {
descrizione += StringPool.SPACE + getCognome(); descrizione += StringPool.SPACE + getCognome();
} }
@ -73,10 +69,10 @@ public class SoggettoImpl extends SoggettoBaseImpl {
return descrizione; return descrizione;
} }
@Override
public String getDescrizioneCompletaAccessoAtti() { public String getDescrizioneCompletaAccessoAtti() {
String descrizione = ""; String descrizione = StringPool.BLANK;
if (Validator.isNotNull(getCognome())) { if (Validator.isNotNull(getCognome())) {
descrizione += StringPool.SPACE + getCognome(); descrizione += StringPool.SPACE + getCognome();
} }
@ -87,9 +83,9 @@ public class SoggettoImpl extends SoggettoBaseImpl {
descrizione += StringPool.SPACE + getDenominazione(); descrizione += StringPool.SPACE + getDenominazione();
} }
return descrizione; return descrizione;
} }
@Override
public String getDescrizioneRuolo() { public String getDescrizioneRuolo() {
String descrizione = getDescrizioneCompleta(); String descrizione = getDescrizioneCompleta();
@ -97,6 +93,7 @@ public class SoggettoImpl extends SoggettoBaseImpl {
return descrizione + " - " + ruolo; return descrizione + " - " + ruolo;
} }
@Override
public String getTitle() { public String getTitle() {
if (Validator.isNotNull(getDenominazione())) { if (Validator.isNotNull(getDenominazione())) {

31
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/SorteggioImpl.java

@ -1,13 +1,13 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * 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 * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* GNU Lesser General Public License as published by the Free Software Foundation; either version * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* 2.1 of the License, or (at your option) any later version. * any later version.
* *
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* Lesser General Public License for more details. * details.
*/ */
package it.tref.liferay.portos.bo.model.impl; package it.tref.liferay.portos.bo.model.impl;
@ -15,14 +15,12 @@ package it.tref.liferay.portos.bo.model.impl;
import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.kernel.util.Validator;
/** /**
* The extended model implementation for the Sorteggio service. Represents a row * The extended model implementation for the Sorteggio service. Represents a row in the &quot;portos_bo_Sorteggio&quot;
* in the &quot;portos_bo_Sorteggio&quot; database table, with each column * database table, with each column mapped to a property of this class.
* mapped to a property of this class.
* *
* <p> * <p>
* Helper methods and all application logic should be put in this class. * Helper methods and all application logic should be put in this class. Whenever methods are added, rerun
* Whenever methods are added, rerun ServiceBuilder to copy their definitions * ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.bo.model.Sorteggio} interface.
* into the {@link it.tref.liferay.portos.bo.model.Sorteggio} interface.
* </p> * </p>
* *
* @author Davide Barbagallo, 3F Consulting * @author Davide Barbagallo, 3F Consulting
@ -30,16 +28,15 @@ import com.liferay.portal.kernel.util.Validator;
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class SorteggioImpl extends SorteggioBaseImpl { public class SorteggioImpl extends SorteggioBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a sorteggio model instance
* * should use the {@link it.tref.liferay.portos.bo.model.Sorteggio} interface instead.
* Never reference this class directly. All methods that expect a sorteggio
* model instance should use the {@link
* it.tref.liferay.portos.bo.model.Sorteggio} interface instead.
*/ */
public SorteggioImpl() { public SorteggioImpl() {
} }
@Override
public boolean mesePrecedenteToBoolean() { public boolean mesePrecedenteToBoolean() {
if (Validator.isNull(getMesePrecedente())) { if (Validator.isNull(getMesePrecedente())) {
return false; return false;
} }

28
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/StoricoSoggettoPraticaImpl.java

@ -1,28 +1,24 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
* *
* This library is free software; you can redistribute it and/or modify it under * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* the terms of the GNU Lesser General Public License as published by the Free * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version. * any later version.
* *
* This library is distributed in the hope that it will be useful, but WITHOUT * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details. * details.
*/ */
package it.tref.liferay.portos.bo.model.impl; package it.tref.liferay.portos.bo.model.impl;
/** /**
* The extended model implementation for the StoricoSoggettoPratica service. * The extended model implementation for the StoricoSoggettoPratica service. Represents a row in the
* Represents a row in the &quot;portos_bo_StoricoSoggettoPratica&quot; database * &quot;portos_bo_StoricoSoggettoPratica&quot; database table, with each column mapped to a property of this class.
* table, with each column mapped to a property of this class.
* *
* <p> * <p>
* Helper methods and all application logic should be put in this class. * Helper methods and all application logic should be put in this class. Whenever methods are added, rerun
* Whenever methods are added, rerun ServiceBuilder to copy their definitions * ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.bo.model.StoricoSoggettoPratica}
* into the {@link it.tref.liferay.portos.bo.model.StoricoSoggettoPratica}
* interface. * interface.
* </p> * </p>
* *
@ -31,12 +27,8 @@ package it.tref.liferay.portos.bo.model.impl;
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class StoricoSoggettoPraticaImpl extends StoricoSoggettoPraticaBaseImpl { public class StoricoSoggettoPraticaImpl extends StoricoSoggettoPraticaBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a storico soggetto pratica
* * model instance should use the {@link it.tref.liferay.portos.bo.model.StoricoSoggettoPratica} interface instead.
* Never reference this class directly. All methods that expect a storico
* soggetto pratica model instance should use the {@link
* it.tref.liferay.portos.bo.model.StoricoSoggettoPratica} interface
* instead.
*/ */
public StoricoSoggettoPraticaImpl() { public StoricoSoggettoPraticaImpl() {
} }

22
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/TempisticaImpl.java

@ -1,33 +1,33 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
* *
* This library is free software; you can redistribute it and/or modify it under * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* the terms of the GNU Lesser General Public License as published by the Free * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version. * any later version.
* *
* This library is distributed in the hope that it will be useful, but WITHOUT * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details. * details.
*/ */
package it.tref.liferay.portos.bo.model.impl; package it.tref.liferay.portos.bo.model.impl;
/** /**
* The extended model implementation for the Tempistica service. Represents a row in the &quot;portos_bo_Tempistica&quot; database table, with each column mapped to a property of this class. * The extended model implementation for the Tempistica service. Represents a row in the
* &quot;portos_bo_Tempistica&quot; database table, with each column mapped to a property of this class.
* *
* <p> * <p>
* 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.Tempistica} 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.Tempistica} interface.
* </p> * </p>
* *
* @author Davide Barbagallo, 3F Consulting * @author Davide Barbagallo, 3F Consulting
*/ */
@SuppressWarnings("serial")
public class TempisticaImpl extends TempisticaBaseImpl { public class TempisticaImpl extends TempisticaBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a tempistica model instance
* * should use the {@link it.tref.liferay.portos.bo.model.Tempistica} interface instead.
* Never reference this class directly. All methods that expect a tempistica model instance should use the {@link it.tref.liferay.portos.bo.model.Tempistica} interface instead.
*/ */
public TempisticaImpl() { public TempisticaImpl() {
} }

31
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/TerritorioImpl.java

@ -1,41 +1,38 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * 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 * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* GNU Lesser General Public License as published by the Free Software Foundation; either version * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* 2.1 of the License, or (at your option) any later version. * any later version.
* *
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* Lesser General Public License for more details. * details.
*/ */
package it.tref.liferay.portos.bo.model.impl; package it.tref.liferay.portos.bo.model.impl;
/** /**
* The extended model implementation for the Territorio service. Represents a * The extended model implementation for the Territorio service. Represents a row in the
* row in the &quot;portos_bo_Territorio&quot; database table, with each column * &quot;portos_bo_Territorio&quot; database table, with each column mapped to a property of this class.
* mapped to a property of this class.
* *
* <p> * <p>
* Helper methods and all application logic should be put in this class. * Helper methods and all application logic should be put in this class. Whenever methods are added, rerun
* Whenever methods are added, rerun ServiceBuilder to copy their definitions * ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.bo.model.Territorio} interface.
* into the {@link it.tref.liferay.portos.bo.model.Territorio} interface.
* </p> * </p>
* *
* @author Davide Barbagallo, 3F Consulting * @author Davide Barbagallo, 3F Consulting
*/ */
@SuppressWarnings("serial")
public class TerritorioImpl extends TerritorioBaseImpl { public class TerritorioImpl extends TerritorioBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a territorio model instance
* * should use the {@link it.tref.liferay.portos.bo.model.Territorio} interface instead.
* Never reference this class directly. All methods that expect a territorio
* model instance should use the {@link
* it.tref.liferay.portos.bo.model.Territorio} interface instead.
*/ */
public TerritorioImpl() { public TerritorioImpl() {
} }
@Override
public String getZonaFasciaDesc() { public String getZonaFasciaDesc() {
String ret = "Zona " + getZona(); String ret = "Zona " + getZona();
if (getArticolo61()) if (getArticolo61())

27
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/UtentePortosImpl.java

@ -1,28 +1,24 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
* *
* This library is free software; you can redistribute it and/or modify it under * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* the terms of the GNU Lesser General Public License as published by the Free * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version. * any later version.
* *
* This library is distributed in the hope that it will be useful, but WITHOUT * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details. * details.
*/ */
package it.tref.liferay.portos.bo.model.impl; package it.tref.liferay.portos.bo.model.impl;
/** /**
* The extended model implementation for the UtentePortos service. Represents a * The extended model implementation for the UtentePortos service. Represents a row in the
* row in the &quot;portos_bo_UtentePortos&quot; database table, with each * &quot;portos_bo_UtentePortos&quot; database table, with each column mapped to a property of this class.
* column mapped to a property of this class.
* *
* <p> * <p>
* Helper methods and all application logic should be put in this class. * Helper methods and all application logic should be put in this class. Whenever methods are added, rerun
* Whenever methods are added, rerun ServiceBuilder to copy their definitions * ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.bo.model.UtentePortos} interface.
* into the {@link it.tref.liferay.portos.bo.model.UtentePortos} interface.
* </p> * </p>
* *
* @author Davide Barbagallo, 3F Consulting * @author Davide Barbagallo, 3F Consulting
@ -30,11 +26,8 @@ package it.tref.liferay.portos.bo.model.impl;
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class UtentePortosImpl extends UtentePortosBaseImpl { public class UtentePortosImpl extends UtentePortosBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a utente portos model instance
* * should use the {@link it.tref.liferay.portos.bo.model.UtentePortos} interface instead.
* Never reference this class directly. All methods that expect a utente
* portos model instance should use the {@link
* it.tref.liferay.portos.bo.model.UtentePortos} interface instead.
*/ */
public UtentePortosImpl() { public UtentePortosImpl() {
} }

47
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/scheduler/SchedulerPratiche.java

@ -56,11 +56,10 @@ public class SchedulerPratiche implements MessageListener {
@Override @Override
public void receive(Message message) throws MessageListenerException { public void receive(Message message) throws MessageListenerException {
if (lock.tryLock()) { if (lock.tryLock()) {
try { try {
/* // Fascicoli Senza progetto
* Fascicoli Senza progetto
*/
int count = IntPraticaLocalServiceUtil.countFascicoliNotProgetto(); int count = IntPraticaLocalServiceUtil.countFascicoliNotProgetto();
if (count > 0) { if (count > 0) {
for (int cursor = 0; cursor <= count; cursor += SIZE) { for (int cursor = 0; cursor <= count; cursor += SIZE) {
@ -82,9 +81,7 @@ public class SchedulerPratiche implements MessageListener {
} }
} }
} }
/* // Pratiche gestite ma senza protocollo
* Pratiche gestite ma senza protocollo
*/
count = DettPraticaLocalServiceUtil.countPraticheCompleteNotProtocollo(); count = DettPraticaLocalServiceUtil.countPraticheCompleteNotProtocollo();
if (count > 0) { if (count > 0) {
for (int cursor = 0; cursor <= count; cursor += SIZE) { for (int cursor = 0; cursor <= count; cursor += SIZE) {
@ -106,9 +103,7 @@ public class SchedulerPratiche implements MessageListener {
} }
} }
} }
/* // Fine Lavori complete ma senza protocollo
* Fine Lavori complete ma senza protocollo
*/
count = FineLavoriLocalServiceUtil.countFineLavoriCompleteNotProtocollo(); count = FineLavoriLocalServiceUtil.countFineLavoriCompleteNotProtocollo();
if (count > 0) { if (count > 0) {
for (int cursor = 0; cursor <= count; cursor += SIZE) { for (int cursor = 0; cursor <= count; cursor += SIZE) {
@ -130,9 +125,7 @@ public class SchedulerPratiche implements MessageListener {
} }
} }
} }
/* // Fine Lavori complete con protocollo non gestite
* Fine Lavori complete con protocollo non gestite
*/
count = FineLavoriLocalServiceUtil.countFineLavoriCompleteNotGestite(); count = FineLavoriLocalServiceUtil.countFineLavoriCompleteNotGestite();
if (count > 0) { if (count > 0) {
for (int cursor = 0; cursor <= count; cursor += SIZE) { for (int cursor = 0; cursor <= count; cursor += SIZE) {
@ -158,9 +151,7 @@ public class SchedulerPratiche implements MessageListener {
} }
} }
} }
/* // Collaudi complete ma senza protocollo
* Collaudi complete ma senza protocollo
*/
count = CollaudoLocalServiceUtil.countCollaudiCompletiNotProtocollo(); count = CollaudoLocalServiceUtil.countCollaudiCompletiNotProtocollo();
if (count > 0) { if (count > 0) {
for (int cursor = 0; cursor <= count; cursor += SIZE) { for (int cursor = 0; cursor <= count; cursor += SIZE) {
@ -182,9 +173,7 @@ public class SchedulerPratiche implements MessageListener {
} }
} }
} }
/* // Collaudi complete con protocollo non gestiti
* Collaudi complete con protocollo non gestiti
*/
count = CollaudoLocalServiceUtil.countCollaudiCompletiNotGestiti(); count = CollaudoLocalServiceUtil.countCollaudiCompletiNotGestiti();
if (count > 0) { if (count > 0) {
for (int cursor = 0; cursor <= count; cursor += SIZE) { for (int cursor = 0; cursor <= count; cursor += SIZE) {
@ -267,6 +256,7 @@ public class SchedulerPratiche implements MessageListener {
private void creaAvvisoVidimazione(long companyId, long groupId, long userId, long intPraticaId, long classPk, private void creaAvvisoVidimazione(long companyId, long groupId, long userId, long intPraticaId, long classPk,
String className) throws SystemException, PortalException { String className) throws SystemException, PortalException {
String descLong = StringPool.BLANK; String descLong = StringPool.BLANK;
Date dtAvviso = new Date(); Date dtAvviso = new Date();
String tipoAvviso = AvvisoUtil.TIPO_AVVISO_DIRETTO; String tipoAvviso = AvvisoUtil.TIPO_AVVISO_DIRETTO;
@ -284,18 +274,17 @@ public class SchedulerPratiche implements MessageListener {
} }
String propertiesTemplate = AvvisoUtil.getAllTipoDocumentoFileTemplateProps().get(propertiesTemplateType); String propertiesTemplate = AvvisoUtil.getAllTipoDocumentoFileTemplateProps().get(propertiesTemplateType);
long fileEntryIdTemplate = ConfigurazioneLocalServiceUtil.findByC_ChiaveLong(companyId, propertiesTemplate); long fileEntryIdTemplate = ConfigurazioneLocalServiceUtil.findByC_ChiaveLong(companyId, propertiesTemplate);
long controlloPraticaId = 0L; long controlloPraticaId = 0L;
ServiceContext serviceContext = new ServiceContext(); ServiceContext serviceContext = new ServiceContext();
serviceContext.setCompanyId(companyId); serviceContext.setCompanyId(companyId);
serviceContext.setScopeGroupId(groupId); serviceContext.setScopeGroupId(groupId);
serviceContext.setUserId(userId); serviceContext.setUserId(userId);
AvvisoLocalServiceUtil.addAvviso(intPraticaId, descLong, dtAvviso, tipoAvviso, tipoDocumento, AvvisoLocalServiceUtil.addAvviso(intPraticaId, descLong, dtAvviso, tipoAvviso, tipoDocumento,
fileEntryIdTemplate, classPk, className, controlloPraticaId, serviceContext); fileEntryIdTemplate, classPk, className, controlloPraticaId, serviceContext);
} }
private IntPratica assegnaNumeroProgetto(IntPratica intPratica) throws PortalException, SystemException { private IntPratica assegnaNumeroProgetto(IntPratica intPratica) throws PortalException, SystemException {
// in caso di errore successivo alla protocollazione salto questa operazione // in caso di errore successivo alla protocollazione salto questa operazione
if (Validator.isNull(intPratica.getNumeroProgetto())) { if (Validator.isNull(intPratica.getNumeroProgetto())) {
intPratica = IntPraticaLocalServiceUtil.addNumeroProgetto(intPratica.getIntPraticaId()); intPratica = IntPraticaLocalServiceUtil.addNumeroProgetto(intPratica.getIntPraticaId());
@ -304,13 +293,14 @@ public class SchedulerPratiche implements MessageListener {
} }
public void gestionePratica(DettPratica dettPratica) throws Exception { public void gestionePratica(DettPratica dettPratica) throws Exception {
ServiceContext serviceContext = getServiceContext(dettPratica); ServiceContext serviceContext = getServiceContext(dettPratica);
// protocollazione da servizio remoto // protocollazione da servizio remoto
protocollazione(serviceContext.getCompanyId(), serviceContext.getScopeGroupId(), dettPratica); protocollazione(serviceContext.getCompanyId(), serviceContext.getScopeGroupId(), dettPratica);
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(dettPratica.getIntPraticaId()); IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(dettPratica.getIntPraticaId());
intPratica = assegnaNumeroProgetto(intPratica); intPratica = assegnaNumeroProgetto(intPratica);
String tipoIntegrazione = dettPratica.getTipoIntegrazione(); String tipoIntegrazione = dettPratica.getTipoIntegrazione();
// 1o Avviso di ricezione corretta o in errore della pratica // 1º Avviso di ricezione corretta o in errore della pratica
int count = AvvisoLocalServiceUtil.countAvvisoByClassPk_ClassName(dettPratica.getDettPraticaId(), int count = AvvisoLocalServiceUtil.countAvvisoByClassPk_ClassName(dettPratica.getDettPraticaId(),
DettPratica.class.getName()); DettPratica.class.getName());
// in caso di errore non genere un nuovo avviso // in caso di errore non genere un nuovo avviso
@ -366,10 +356,11 @@ public class SchedulerPratiche implements MessageListener {
} }
private DettPratica protocollazione(long companyId, long groupId, DettPratica dettPratica) throws Exception { private DettPratica protocollazione(long companyId, long groupId, DettPratica dettPratica) throws Exception {
// in caso di errore successivo alla protocollazione salto questa operazione // in caso di errore successivo alla protocollazione salto questa operazione
if (Validator.isNull(dettPratica.getProtocollo())) { if (Validator.isNull(dettPratica.getProtocollo())) {
String protocollo = null; String protocollo = null;
String title = dettPratica.getDettPraticaId() + "_" + System.currentTimeMillis(); String title = dettPratica.getDettPraticaId() + StringPool.UNDERLINE + System.currentTimeMillis();
protocollo = ProtocollazioneUtil.protocollaArrivo(dettPratica, title); protocollo = ProtocollazioneUtil.protocollaArrivo(dettPratica, title);
if (Validator.isNull(protocollo)) { if (Validator.isNull(protocollo)) {
throw new Exception("errore nella protocollazione pratica"); throw new Exception("errore nella protocollazione pratica");
@ -381,12 +372,11 @@ public class SchedulerPratiche implements MessageListener {
} }
private FineLavori protocollazione(long companyId, long groupId, FineLavori fineLavori) throws Exception { private FineLavori protocollazione(long companyId, long groupId, FineLavori fineLavori) throws Exception {
// in caso di errore successivo alla protocollazione salto questa operazione // in caso di errore successivo alla protocollazione salto questa operazione
if (Validator.isNull(fineLavori.getProtocollo())) { if (Validator.isNull(fineLavori.getProtocollo())) {
String protocollo = null; String protocollo = null;
String title = fineLavori.getFineLavoriId() + StringPool.UNDERLINE + System.currentTimeMillis();
String title = fineLavori.getFineLavoriId() + "_" + System.currentTimeMillis();
protocollo = ProtocollazioneUtil.protocollaArrivo(fineLavori, title); protocollo = ProtocollazioneUtil.protocollaArrivo(fineLavori, title);
if (Validator.isNull(protocollo)) { if (Validator.isNull(protocollo)) {
throw new Exception("errore nella protocollazione fine lavori"); throw new Exception("errore nella protocollazione fine lavori");
@ -401,13 +391,12 @@ public class SchedulerPratiche implements MessageListener {
private Collaudo protocollazione(long companyId, long groupId, Collaudo collaudo) throws Exception { private Collaudo protocollazione(long companyId, long groupId, Collaudo collaudo) throws Exception {
// in caso di errore successivo alla protocollazione salto questa // in caso di errore successivo alla protocollazione salto questa operazione
// operazione
if (Validator.isNull(collaudo.getProtocollo())) { if (Validator.isNull(collaudo.getProtocollo())) {
String protocollo = null; String protocollo = null;
String title = collaudo.getCollaudoId() + "_" + System.currentTimeMillis(); String title = collaudo.getCollaudoId() + StringPool.UNDERLINE + System.currentTimeMillis();
protocollo = ProtocollazioneUtil.protocollaArrivo(collaudo, title); protocollo = ProtocollazioneUtil.protocollaArrivo(collaudo, title);
if (Validator.isNull(protocollo)) { if (Validator.isNull(protocollo)) {
throw new Exception("errore nella protocollazione collaudo"); throw new Exception("errore nella protocollazione collaudo");
@ -421,6 +410,7 @@ public class SchedulerPratiche implements MessageListener {
private ControlloPratica avvioWorkflow(DettPratica dettPratica, long userId, ServiceContext serviceContext) private ControlloPratica avvioWorkflow(DettPratica dettPratica, long userId, ServiceContext serviceContext)
throws Exception { throws Exception {
if (dettPratica.isCompleta() && !dettPratica.isGestita()) { if (dettPratica.isCompleta() && !dettPratica.isGestita()) {
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(dettPratica.getIntPraticaId()); IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(dettPratica.getIntPraticaId());
Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId()); Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId());
@ -436,6 +426,7 @@ public class SchedulerPratiche implements MessageListener {
} }
private ServiceContext getServiceContext(DettPratica dettPratica) { private ServiceContext getServiceContext(DettPratica dettPratica) {
ServiceContext serviceContext = new ServiceContext(); ServiceContext serviceContext = new ServiceContext();
serviceContext.setCompanyId(dettPratica.getCompanyId()); serviceContext.setCompanyId(dettPratica.getCompanyId());
serviceContext.setScopeGroupId(dettPratica.getGroupId()); serviceContext.setScopeGroupId(dettPratica.getGroupId());

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

@ -57,41 +57,45 @@ import com.liferay.portlet.documentlibrary.NoSuchFolderException;
*/ */
public class AllegatoManualeLocalServiceImpl extends AllegatoManualeLocalServiceBaseImpl { public class AllegatoManualeLocalServiceImpl extends AllegatoManualeLocalServiceBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link
*
* 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 @Override
public List<AllegatoManuale> findByIntPratica(long intPraticaId) throws SystemException { public List<AllegatoManuale> findByIntPratica(long intPraticaId) throws SystemException {
return allegatoManualePersistence.findByIntPratica(intPraticaId); return allegatoManualePersistence.findByIntPratica(intPraticaId);
} }
@Override @Override
public List<AllegatoManuale> findByIntPratica(long intPraticaId, int start, int end, public List<AllegatoManuale> findByIntPratica(long intPraticaId, int start, int end,
OrderByComparator orderByComparator) throws SystemException { OrderByComparator orderByComparator) throws SystemException {
return allegatoManualePersistence.findByIntPratica(intPraticaId, start, end, orderByComparator); return allegatoManualePersistence.findByIntPratica(intPraticaId, start, end, orderByComparator);
} }
@Override @Override
public int countByIntPratica(long intPraticaId) throws SystemException { public int countByIntPratica(long intPraticaId) throws SystemException {
return allegatoManualePersistence.countByIntPratica(intPraticaId); return allegatoManualePersistence.countByIntPratica(intPraticaId);
} }
@Override @Override
public List<AllegatoManuale> findByDettPratica(long dettPraticaId) throws SystemException { public List<AllegatoManuale> findByDettPratica(long dettPraticaId) throws SystemException {
return allegatoManualePersistence.findByIntPratica(dettPraticaId); return allegatoManualePersistence.findByIntPratica(dettPraticaId);
} }
@Override @Override
public List<AllegatoManuale> findByDettPratica(long dettPraticaId, int start, int end, public List<AllegatoManuale> findByDettPratica(long dettPraticaId, int start, int end,
OrderByComparator orderByComparator) throws SystemException { OrderByComparator orderByComparator) throws SystemException {
return allegatoManualePersistence.findByIntPratica(dettPraticaId, start, end, orderByComparator); return allegatoManualePersistence.findByIntPratica(dettPraticaId, start, end, orderByComparator);
} }
@Override @Override
public int countByDettPratica(long dettPraticaId) throws SystemException { public int countByDettPratica(long dettPraticaId) throws SystemException {
return allegatoManualePersistence.countByIntPratica(dettPraticaId); return allegatoManualePersistence.countByIntPratica(dettPraticaId);
} }
@ -99,13 +103,12 @@ public class AllegatoManualeLocalServiceImpl extends AllegatoManualeLocalService
public AllegatoManuale addAllegatoManuale(long userId, long intPraticaId, long dettPraticaId, String descrizione, public AllegatoManuale addAllegatoManuale(long userId, long intPraticaId, long dettPraticaId, String descrizione,
byte[] content, String sourceFileName, ServiceContext serviceContext) throws SystemException, byte[] content, String sourceFileName, ServiceContext serviceContext) throws SystemException,
PortalException { PortalException {
AllegatoManuale allegatoManuale = allegatoManualePersistence.create(counterLocalService AllegatoManuale allegatoManuale = allegatoManualePersistence.create(counterLocalService
.increment(AllegatoManuale.class.getName())); .increment(AllegatoManuale.class.getName()));
DettPratica dettPratica = dettPraticaLocalService.getDettPratica(dettPraticaId); DettPratica dettPratica = dettPraticaLocalService.getDettPratica(dettPraticaId);
User user = userPersistence.findByPrimaryKey(userId); User user = userPersistence.findByPrimaryKey(userId);
Date now = new Date(); Date now = new Date();
allegatoManuale.setCompanyId(serviceContext.getCompanyId()); allegatoManuale.setCompanyId(serviceContext.getCompanyId());
allegatoManuale.setUserId(user.getUserId()); allegatoManuale.setUserId(user.getUserId());
allegatoManuale.setUserName(user.getFullName()); allegatoManuale.setUserName(user.getFullName());
@ -115,12 +118,9 @@ public class AllegatoManualeLocalServiceImpl extends AllegatoManualeLocalService
allegatoManuale.setIntPraticaId(intPraticaId); allegatoManuale.setIntPraticaId(intPraticaId);
allegatoManuale.setDettPraticaId(dettPraticaId); allegatoManuale.setDettPraticaId(dettPraticaId);
allegatoManuale.setDescrizione(descrizione); allegatoManuale.setDescrizione(descrizione);
long fileEntryId = 0L;
long fileEntryId = 0l;
long defaultFolderId = configurazioneLocalService.findByC_ChiaveLong(serviceContext.getCompanyId(), long defaultFolderId = configurazioneLocalService.findByC_ChiaveLong(serviceContext.getCompanyId(),
ConfigurazioneConstants.ATTACHMENT_FOLDER_ID); ConfigurazioneConstants.ATTACHMENT_FOLDER_ID);
Folder defaultFolder = dlAppLocalService.getFolder(defaultFolderId); Folder defaultFolder = dlAppLocalService.getFolder(defaultFolderId);
String folderName = PraticaUtil.getFolderName(dettPratica.getDettPraticaId()); String folderName = PraticaUtil.getFolderName(dettPratica.getDettPraticaId());
serviceContext.setGroupPermissions(new String[] { ActionKeys.VIEW }); serviceContext.setGroupPermissions(new String[] { ActionKeys.VIEW });
@ -137,16 +137,13 @@ public class AllegatoManualeLocalServiceImpl extends AllegatoManualeLocalService
+ StringPool.UNDERLINE + sourceFileName; + StringPool.UNDERLINE + sourceFileName;
String description = StringPool.BLANK; String description = StringPool.BLANK;
String mimeType = MimeTypesUtil.getContentType(sourceFileName); String mimeType = MimeTypesUtil.getContentType(sourceFileName);
String changeLog = StringPool.BLANK; String changeLog = StringPool.BLANK;
FileEntry fileEntry = dlAppLocalService.addFileEntry(serviceContext.getUserId(), folder.getRepositoryId(), FileEntry fileEntry = dlAppLocalService.addFileEntry(serviceContext.getUserId(), folder.getRepositoryId(),
folder.getFolderId(), now.getTime() + StringPool.UNDERLINE + sourceFileName, mimeType, title, folder.getFolderId(), now.getTime() + StringPool.UNDERLINE + sourceFileName, mimeType, title,
description, changeLog, content, serviceContext); description, changeLog, content, serviceContext);
fileEntryId = fileEntry.getFileEntryId(); fileEntryId = fileEntry.getFileEntryId();
allegatoManuale.setFileEntryId(fileEntryId); allegatoManuale.setFileEntryId(fileEntryId);
String codiceFiscalePrimaFirma = StringPool.BLANK; String codiceFiscalePrimaFirma = StringPool.BLANK;
ServiceContext serviceContextAvvisi = (ServiceContext) serviceContext.clone(); ServiceContext serviceContextAvvisi = (ServiceContext) serviceContext.clone();
IntPratica intPratica = intPraticaLocalService.getIntPratica(intPraticaId); IntPratica intPratica = intPraticaLocalService.getIntPratica(intPraticaId);
Territorio territorio = territorioLocalService.getTerritorio(intPratica.getTerritorioId()); Territorio territorio = territorioLocalService.getTerritorio(intPratica.getTerritorioId());
@ -158,20 +155,20 @@ public class AllegatoManualeLocalServiceImpl extends AllegatoManualeLocalService
Avviso avviso = avvisoLocalService.addAvviso(intPratica.getIntPraticaId(), descrizione, now, Avviso avviso = avvisoLocalService.addAvviso(intPratica.getIntPraticaId(), descrizione, now,
AvvisoUtil.TIPO_AVVISO_FIRMA, "MA", 0L, dettPraticaId, DettPratica.class.getName(), AvvisoUtil.TIPO_AVVISO_FIRMA, "MA", 0L, dettPraticaId, DettPratica.class.getName(),
codiceFiscalePrimaFirma, fileEntryId, 0L, StringPool.BLANK, 0L, serviceContextAvvisi); codiceFiscalePrimaFirma, fileEntryId, 0L, StringPool.BLANK, 0L, serviceContextAvvisi);
allegatoManuale.setAvvisoId(avviso.getAvvisoId()); allegatoManuale.setAvvisoId(avviso.getAvvisoId());
allegatoManuale = allegatoManualePersistence.update(allegatoManuale); allegatoManuale = allegatoManualePersistence.update(allegatoManuale);
return allegatoManuale; return allegatoManuale;
} }
@Override @Override
public AllegatoManuale deleteAllegatoManuale(AllegatoManuale allegatoManuale) throws SystemException { public AllegatoManuale deleteAllegatoManuale(AllegatoManuale allegatoManuale) throws SystemException {
return super.deleteAllegatoManuale(allegatoManuale); return super.deleteAllegatoManuale(allegatoManuale);
} }
@Override @Override
public AllegatoManuale deleteAllegatoManuale(long allegatoManualeId) throws PortalException, SystemException { public AllegatoManuale deleteAllegatoManuale(long allegatoManualeId) throws PortalException, SystemException {
return deleteAllegatoManuale(allegatoManualeLocalService.getAllegatoManuale(allegatoManualeId)); return deleteAllegatoManuale(allegatoManualeLocalService.getAllegatoManuale(allegatoManualeId));
} }
} }

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

@ -1,13 +1,13 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * 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 * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* GNU Lesser General Public License as published by the Free Software Foundation; either version * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* 2.1 of the License, or (at your option) any later version. * any later version.
* *
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* Lesser General Public License for more details. * details.
*/ */
package it.tref.liferay.portos.bo.service.impl; package it.tref.liferay.portos.bo.service.impl;
@ -29,13 +29,12 @@ import com.liferay.portal.service.ServiceContext;
* The implementation of the allegato manuale remote service. * The implementation of the allegato manuale remote service.
* *
* <p> * <p>
* All custom service methods should be put in this class. Whenever methods are added, rerun * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy
* ServiceBuilder to copy their definitions into the * their definitions into the {@link it.tref.liferay.portos.bo.service.AllegatoManualeService} interface.
* {@link it.tref.liferay.portos.bo.service.AllegatoManualeService} interface.
* *
* <p> * <p>
* This is a remote service. Methods of this service are expected to have security checks based on * This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS
* the propagated JAAS credentials because this service can be accessed remotely. * credentials because this service can be accessed remotely.
* </p> * </p>
* *
* @author Davide Barbagallo, 3F Consulting * @author Davide Barbagallo, 3F Consulting
@ -44,54 +43,71 @@ import com.liferay.portal.service.ServiceContext;
*/ */
public class AllegatoManualeServiceImpl extends AllegatoManualeServiceBaseImpl { public class AllegatoManualeServiceImpl extends AllegatoManualeServiceBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link
* * it.tref.liferay.portos.bo.service.AllegatoManualeServiceUtil} to access the allegato manuale remote service.
* Never reference this interface directly. Always use {@link
* it.tref.liferay.portos.bo.service.AllegatoManualeServiceUtil} to access the allegato manuale
* remote service.
*/ */
@Override
public List<AllegatoManuale> findByIntPratica(long intPraticaId) throws SystemException { public List<AllegatoManuale> findByIntPratica(long intPraticaId) throws SystemException {
return allegatoManualeLocalService.findByIntPratica(intPraticaId); return allegatoManualeLocalService.findByIntPratica(intPraticaId);
} }
@Override
public List<AllegatoManuale> findByIntPratica(long intPraticaId, int start, int end, public List<AllegatoManuale> findByIntPratica(long intPraticaId, int start, int end,
OrderByComparator orderByComparator) throws SystemException { OrderByComparator orderByComparator) throws SystemException {
return allegatoManualeLocalService.findByIntPratica(intPraticaId, start, end, orderByComparator); return allegatoManualeLocalService.findByIntPratica(intPraticaId, start, end, orderByComparator);
} }
@Override
public int countByIntPratica(long intPraticaId) throws SystemException { public int countByIntPratica(long intPraticaId) throws SystemException {
return allegatoManualeLocalService.countByIntPratica(intPraticaId); return allegatoManualeLocalService.countByIntPratica(intPraticaId);
} }
@Override
public List<AllegatoManuale> findByDettPratica(long dettPraticaId) throws SystemException { public List<AllegatoManuale> findByDettPratica(long dettPraticaId) throws SystemException {
return allegatoManualeLocalService.findByIntPratica(dettPraticaId); return allegatoManualeLocalService.findByIntPratica(dettPraticaId);
} }
@Override
public List<AllegatoManuale> findByDettPratica(long dettPraticaId, int start, int end, public List<AllegatoManuale> findByDettPratica(long dettPraticaId, int start, int end,
OrderByComparator orderByComparator) throws SystemException { OrderByComparator orderByComparator) throws SystemException {
return allegatoManualeLocalService.findByIntPratica(dettPraticaId, start, end, orderByComparator); return allegatoManualeLocalService.findByIntPratica(dettPraticaId, start, end, orderByComparator);
} }
@Override
public int countByDettPratica(long dettPraticaId) throws SystemException { public int countByDettPratica(long dettPraticaId) throws SystemException {
return allegatoManualeLocalService.countByIntPratica(dettPraticaId); return allegatoManualeLocalService.countByIntPratica(dettPraticaId);
} }
@Override
public AllegatoManuale addAllegatoManuale(long userId, long intPraticaId, long dettPraticaId, String descrizione, public AllegatoManuale addAllegatoManuale(long userId, long intPraticaId, long dettPraticaId, String descrizione,
byte[] content, String sourceFileName, ServiceContext serviceContext) throws SystemException, PortalException { byte[] content, String sourceFileName, ServiceContext serviceContext) throws SystemException,
return allegatoManualeLocalService.addAllegatoManuale(userId, intPraticaId, dettPraticaId, descrizione, content, PortalException {
sourceFileName, serviceContext);
return allegatoManualeLocalService.addAllegatoManuale(userId, intPraticaId, dettPraticaId, descrizione,
content, sourceFileName, serviceContext);
} }
@Override
public AllegatoManuale deleteAllegatoManuale(AllegatoManuale allegatoManuale) throws SystemException { public AllegatoManuale deleteAllegatoManuale(AllegatoManuale allegatoManuale) throws SystemException {
Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(allegatoManuale.getAvvisoId()); Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(allegatoManuale.getAvvisoId());
if (Validator.isNotNull(avviso) && Validator.isNull(avviso.getFileEntryIdInvio())) { if (Validator.isNotNull(avviso) && Validator.isNull(avviso.getFileEntryIdInvio())) {
return allegatoManualeLocalService.deleteAllegatoManuale(allegatoManuale); return allegatoManualeLocalService.deleteAllegatoManuale(allegatoManuale);
} else { } else {
throw new SystemException("allegato manuale #" + allegatoManuale.getAllegatoManualeId() + " non eliminabile"); throw new SystemException("allegato manuale #" + allegatoManuale.getAllegatoManualeId()
+ " non eliminabile");
} }
} }
@Override
public AllegatoManuale deleteAllegatoManuale(long allegatoManualeId) throws PortalException, SystemException { public AllegatoManuale deleteAllegatoManuale(long allegatoManualeId) throws PortalException, SystemException {
return allegatoManualeLocalService.deleteAllegatoManuale(allegatoManualeId); return allegatoManualeLocalService.deleteAllegatoManuale(allegatoManualeId);
} }
} }

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

@ -93,18 +93,21 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
@Override @Override
public String anteprimaAsseverazione(String tipo, User user, DettPratica dettPratica, String relazioni) public String anteprimaAsseverazione(String tipo, User user, DettPratica dettPratica, String relazioni)
throws IOException, SystemException, PortalException { throws IOException, SystemException, PortalException {
return testoAsseverazione(tipo, user.getScreenName(), dettPratica, relazioni, true); return testoAsseverazione(tipo, user.getScreenName(), dettPratica, relazioni, true);
} }
@Override @Override
public String testoAsseverazione(String tipo, User user, long dettPraticaId, String relazioni) public String testoAsseverazione(String tipo, User user, long dettPraticaId, String relazioni)
throws SystemException, PortalException, IOException { throws SystemException, PortalException, IOException {
return testoAsseverazione(tipo, user.getScreenName(), dettPraticaId, relazioni); return testoAsseverazione(tipo, user.getScreenName(), dettPraticaId, relazioni);
} }
@Override @Override
public String testoAsseverazione(String tipo, String codiceFiscale, long dettPraticaId, String relazioni) public String testoAsseverazione(String tipo, String codiceFiscale, long dettPraticaId, String relazioni)
throws PortalException, SystemException, IOException { throws PortalException, SystemException, IOException {
DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(dettPraticaId); DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(dettPraticaId);
return testoAsseverazione(tipo, codiceFiscale, dettPratica, relazioni); return testoAsseverazione(tipo, codiceFiscale, dettPratica, relazioni);
} }
@ -112,18 +115,19 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
@Override @Override
public String testoAsseverazione(String tipo, String codiceFiscale, DettPratica dettPratica, String relazioni) public String testoAsseverazione(String tipo, String codiceFiscale, DettPratica dettPratica, String relazioni)
throws SystemException, PortalException, IOException { throws SystemException, PortalException, IOException {
return testoAsseverazione(tipo, codiceFiscale, dettPratica, relazioni, false); return testoAsseverazione(tipo, codiceFiscale, dettPratica, relazioni, false);
} }
private String testoAsseverazione(String tipo, String codiceFiscale, DettPratica dettPratica, String relazioni, private String testoAsseverazione(String tipo, String codiceFiscale, DettPratica dettPratica, String relazioni,
boolean anteprima) throws SystemException, PortalException, IOException { boolean anteprima) throws SystemException, PortalException, IOException {
List<Soggetto> soggetti = SoggettoLocalServiceUtil.getValidTmpByIntPratica_CodiceFiscale( List<Soggetto> soggetti = SoggettoLocalServiceUtil.getValidTmpByIntPratica_CodiceFiscale(
dettPratica.getIntPraticaId(), codiceFiscale, 0L); dettPratica.getIntPraticaId(), codiceFiscale, 0L);
if (soggetti.size() > 0) { if (soggetti.size() > 0) {
Soggetto soggetto = soggetti.get(0); Soggetto soggetto = soggetti.get(0);
String nome = Validator.isNull(soggetto.getCognome()) ? soggetto.getLegaleRap() : soggetto.getNome(); String nome = Validator.isNull(soggetto.getCognome()) ? soggetto.getLegaleRap() : soggetto.getNome();
String cognome = Validator.isNull(soggetto.getCognome()) ? StringPool.BLANK : soggetto.getCognome(); String cognome = Validator.isNull(soggetto.getCognome()) ? StringPool.BLANK : soggetto.getCognome();
return testoAsseverazione(tipo, nome, cognome, codiceFiscale, soggetto.getAmbitoProfessione(), dettPratica, return testoAsseverazione(tipo, nome, cognome, codiceFiscale, soggetto.getAmbitoProfessione(), dettPratica,
relazioni, false); relazioni, false);
} }
@ -166,7 +170,6 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
default: default:
return null; return null;
} }
InputStream input = getClass().getClassLoader() InputStream input = getClass().getClassLoader()
.getResourceAsStream("/resource/asseverazioni/" + file + ".html"); .getResourceAsStream("/resource/asseverazioni/" + file + ".html");
if (Validator.isNull(input)) { if (Validator.isNull(input)) {
@ -179,20 +182,15 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
} }
scanner.close(); scanner.close();
input.close(); input.close();
String RG = dettPratica.getGeoRischioGeomorfologicoPai(); String RG = dettPratica.getGeoRischioGeomorfologicoPai();
String RI = dettPratica.getGeoRischioIdraulicoPai(); String RI = dettPratica.getGeoRischioIdraulicoPai();
String PG = dettPratica.getGeoPericolositaGeomorfica(); String PG = dettPratica.getGeoPericolositaGeomorfica();
String PI = dettPratica.getGeoPericolositaIdraulica(); String PI = dettPratica.getGeoPericolositaIdraulica();
boolean rischio = (RG.equals("3") || RG.equals("4") || RG.equals("5") || RI.equals("3") || RI.equals("4") boolean rischio = (RG.equals("3") || RG.equals("4") || RG.equals("5") || RI.equals("3") || RI.equals("4")
|| PG.equals("3") || PG.equals("4") || PI.equals("3") || PI.equals("4") || PI.equals("5")); || PG.equals("3") || PG.equals("4") || PI.equals("3") || PI.equals("4") || PI.equals("5"));
boolean coniugio = Validator.isNotNull(relazioni); boolean coniugio = Validator.isNotNull(relazioni);
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(dettPratica.getIntPraticaId()); IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(dettPratica.getIntPraticaId());
Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId()); Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId());
float ag = 0; float ag = 0;
if (Validator.isNotNull(dettPratica.getAg())) { if (Validator.isNotNull(dettPratica.getAg())) {
ag = Float.parseFloat(dettPratica.getAg().replace(',', '.')); ag = Float.parseFloat(dettPratica.getAg().replace(',', '.'));
@ -201,23 +199,17 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
} else if (Validator.isNotNull(territorio.getAgMin())) { } else if (Validator.isNotNull(territorio.getAgMin())) {
ag = Float.parseFloat(territorio.getAgMin().replace(',', '.')); ag = Float.parseFloat(territorio.getAgMin().replace(',', '.'));
} }
boolean agAlto = (dettPratica.getTcAdeguamentoSismico() || dettPratica.getTcMiglioramentoSismico()) boolean agAlto = (dettPratica.getTcAdeguamentoSismico() || dettPratica.getTcMiglioramentoSismico())
&& (territorio.getZona().equals("1") || (territorio.getZona().equals("2") && (ag >= 0.2))); && (territorio.getZona().equals("1") || (territorio.getZona().equals("2") && (ag >= 0.2)));
boolean complesse = dettPratica.getTcNuovaCostruzioneComplessa(); boolean complesse = dettPratica.getTcNuovaCostruzioneComplessa();
boolean strategico = dettPratica.getDestinazione().startsWith("A") boolean strategico = dettPratica.getDestinazione().startsWith("A")
|| dettPratica.getDestinazione().startsWith("B"); || dettPratica.getDestinazione().startsWith("B");
boolean rilevanti = agAlto || complesse || strategico; boolean rilevanti = agAlto || complesse || strategico;
boolean agMedio = false; boolean agMedio = false;
boolean riparazioni = false; boolean riparazioni = false;
boolean nuove = false; boolean nuove = false;
boolean agricoli = false; boolean agricoli = false;
boolean nonRilevanti = false; boolean nonRilevanti = false;
if (!rilevanti) { if (!rilevanti) {
agMedio = (dettPratica.getTcAdeguamentoSismico() || dettPratica.getTcMiglioramentoSismico()) agMedio = (dettPratica.getTcAdeguamentoSismico() || dettPratica.getTcMiglioramentoSismico())
&& ((territorio.getZona().equals("2") && (ag >= 0.15) && (ag <= 0.2)) || territorio.getZona() && ((territorio.getZona().equals("2") && (ag >= 0.15) && (ag <= 0.2)) || territorio.getZona()
@ -225,10 +217,8 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
riparazioni = dettPratica.getTcRiparazioneInterventoLocale(); riparazioni = dettPratica.getTcRiparazioneInterventoLocale();
nuove = dettPratica.getTcNuovaCostruzione(); nuove = dettPratica.getTcNuovaCostruzione();
agricoli = dettPratica.getDestinazione().equals("1"); agricoli = dettPratica.getDestinazione().equals("1");
nonRilevanti = agMedio || riparazioni || nuove || agricoli; nonRilevanti = agMedio || riparazioni || nuove || agricoli;
} }
String html = buffer.toString().replaceAll("##anteprima(.*?)##", anteprima ? StringPool.BLANK : "$1") String html = buffer.toString().replaceAll("##anteprima(.*?)##", anteprima ? StringPool.BLANK : "$1")
.replaceAll("##lavoripubblici(.*?)##", dettPratica.getLavoriPubblici() ? StringPool.BLANK : "$1") .replaceAll("##lavoripubblici(.*?)##", dettPratica.getLavoriPubblici() ? StringPool.BLANK : "$1")
.replace("{{agalto}}", agAlto ? CHECKED : StringPool.SPACE) .replace("{{agalto}}", agAlto ? CHECKED : StringPool.SPACE)
@ -247,9 +237,10 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
html = html.replace("{{coniugio}}", StringPool.SPACE).replace("{{!coniugio}}", StringPool.SPACE) html = html.replace("{{coniugio}}", StringPool.SPACE).replace("{{!coniugio}}", StringPool.SPACE)
.replace("{{relazioni}}", StringPool.BLANK); .replace("{{relazioni}}", StringPool.BLANK);
} else { } else {
html = html.replace("{{coniugio}}", coniugio ? CHECKED : StringPool.SPACE) html = html
.replace("{{coniugio}}", coniugio ? CHECKED : StringPool.SPACE)
.replace("{{!coniugio}}", coniugio ? StringPool.SPACE : CHECKED) .replace("{{!coniugio}}", coniugio ? StringPool.SPACE : CHECKED)
.replace("{{relazioni}}", relazioni.trim().replace(StringPool.NEW_LINE, ", ")); .replace("{{relazioni}}", relazioni.trim().replace(StringPool.NEW_LINE, StringPool.COMMA_AND_SPACE));
} }
return html; return html;
} }
@ -259,19 +250,15 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
String codiceFiscale, ServiceContext serviceContext) throws PortalException, SystemException { String codiceFiscale, ServiceContext serviceContext) throws PortalException, SystemException {
User user = userPersistence.findByPrimaryKey(userId); User user = userPersistence.findByPrimaryKey(userId);
Date now = new Date(); Date now = new Date();
Asseverazione asseverazione = asseverazionePersistence.create(counterLocalService.increment(Asseverazione.class Asseverazione asseverazione = asseverazionePersistence.create(counterLocalService.increment(Asseverazione.class
.getName())); .getName()));
asseverazione.setCompanyId(serviceContext.getCompanyId()); asseverazione.setCompanyId(serviceContext.getCompanyId());
asseverazione.setUserId(user.getUserId()); asseverazione.setUserId(user.getUserId());
asseverazione.setUserName(user.getFullName()); asseverazione.setUserName(user.getFullName());
asseverazione.setCreateDate(serviceContext.getCreateDate(now)); asseverazione.setCreateDate(serviceContext.getCreateDate(now));
asseverazione.setModifiedDate(serviceContext.getModifiedDate(now)); asseverazione.setModifiedDate(serviceContext.getModifiedDate(now));
asseverazione.setGroupId(serviceContext.getScopeGroupId()); asseverazione.setGroupId(serviceContext.getScopeGroupId());
asseverazione.setIntPraticaId(intPraticaId); asseverazione.setIntPraticaId(intPraticaId);
asseverazione.setDettPraticaId(dettPraticaId); asseverazione.setDettPraticaId(dettPraticaId);
asseverazione.setTipologia(tipologia); asseverazione.setTipologia(tipologia);
@ -281,9 +268,7 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
if (!soggetti.isEmpty()) { if (!soggetti.isEmpty()) {
asseverazione.setSoggettoId(soggetti.get(0).getUserId()); asseverazione.setSoggettoId(soggetti.get(0).getUserId());
} }
asseverazione = asseverazionePersistence.update(asseverazione); asseverazione = asseverazionePersistence.update(asseverazione);
return asseverazione; return asseverazione;
} }
@ -297,7 +282,6 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
if (TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE.equalsIgnoreCase(dettPratica.getTipoIntegrazione()) if (TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE.equalsIgnoreCase(dettPratica.getTipoIntegrazione())
|| TipoIntegrazioneUtil.VARIANTE.equalsIgnoreCase(dettPratica.getTipoIntegrazione()) || TipoIntegrazioneUtil.VARIANTE.equalsIgnoreCase(dettPratica.getTipoIntegrazione())
|| TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equalsIgnoreCase(dettPratica.getTipoIntegrazione())) { || TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equalsIgnoreCase(dettPratica.getTipoIntegrazione())) {
List<Soggetto> nuoviSoggetti = new ArrayList<Soggetto>( List<Soggetto> nuoviSoggetti = new ArrayList<Soggetto>(
soggettoLocalService.getValidTmpByDettPratica(dettPraticaId)); soggettoLocalService.getValidTmpByDettPratica(dettPraticaId));
List<String> cfNuoviSoggetti = soggettoLocalService.getCfValidTmpByDettPratica(dettPraticaId); List<String> cfNuoviSoggetti = soggettoLocalService.getCfValidTmpByDettPratica(dettPraticaId);
@ -312,19 +296,8 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
cfDelegato, 0l); cfDelegato, 0l);
GenericUtils.addAllIfnotExist(nuoviSoggetti, delegato); GenericUtils.addAllIfnotExist(nuoviSoggetti, delegato);
} }
if (TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE.equalsIgnoreCase(dettPratica.getTipoIntegrazione())) { if (TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE.equalsIgnoreCase(dettPratica.getTipoIntegrazione())) {
User titolaredigitaleUser = UserLocalServiceUtil.getUser(intPratica.getUserId()); User titolaredigitaleUser = UserLocalServiceUtil.getUser(intPratica.getUserId());
// Soggetto titolareDigitale =
// soggettoLocalService.getValidTmpByIntPratica_CodiceFiscale(intPraticaId,
// titolaredigitaleUser.getScreenName()).get(0);
// addAsseverazione(serviceContext.getUserId(),
// dettPratica.getIntPraticaId(),
// dettPraticaId,
// titolareDigitale.getTipologiaSoggetto(),
// titolareDigitale.getCodiceFiscale(),
// serviceContext);
// il titolare digitale potrebbe avere più ruoli // il titolare digitale potrebbe avere più ruoli
List<Soggetto> titolareDigitali = soggettoLocalService.getValidTmpByIntPratica_CodiceFiscale( List<Soggetto> titolareDigitali = soggettoLocalService.getValidTmpByIntPratica_CodiceFiscale(
intPraticaId, titolaredigitaleUser.getScreenName(), 0l); intPraticaId, titolaredigitaleUser.getScreenName(), 0l);
@ -333,12 +306,9 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
titolareDigitale.getTipologiaSoggetto(), titolareDigitale.getCodiceFiscale(), titolareDigitale.getTipologiaSoggetto(), titolareDigitale.getCodiceFiscale(),
serviceContext); serviceContext);
} }
} else if (TipoIntegrazioneUtil.VARIANTE.equalsIgnoreCase(dettPratica.getTipoIntegrazione())) { } else if (TipoIntegrazioneUtil.VARIANTE.equalsIgnoreCase(dettPratica.getTipoIntegrazione())) {
String[] tipoSoggetti = new String[] { TipoSoggettoUtil.COMMITTENTE, TipoSoggettoUtil.DIRETTORE_LAVORI, String[] tipoSoggetti = new String[] { TipoSoggettoUtil.COMMITTENTE, TipoSoggettoUtil.DIRETTORE_LAVORI,
TipoSoggettoUtil.DITTA, TipoSoggettoUtil.PROGETTISTA }; TipoSoggettoUtil.DITTA, TipoSoggettoUtil.PROGETTISTA };
// if (SoggettiUtil.isTitolareInCommittenti(intPraticaId)) {
if (ValidazionePraticaUtil.isA98Required(dettPratica)) { if (ValidazionePraticaUtil.isA98Required(dettPratica)) {
tipoSoggetti = (String[]) ArrayUtils.removeElement(tipoSoggetti, TipoSoggettoUtil.COMMITTENTE); tipoSoggetti = (String[]) ArrayUtils.removeElement(tipoSoggetti, TipoSoggettoUtil.COMMITTENTE);
} }
@ -346,7 +316,6 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
.getSoggettiPrincipaliValidTmpByDettPratica_TipologiaSoggetto(dettPraticaId, tipoSoggetti); .getSoggettiPrincipaliValidTmpByDettPratica_TipologiaSoggetto(dettPraticaId, tipoSoggetti);
GenericUtils.addAllIfnotExist(nuoviSoggetti, soggettiPrincipali); GenericUtils.addAllIfnotExist(nuoviSoggetti, soggettiPrincipali);
} }
for (Soggetto soggetto : nuoviSoggetti) { for (Soggetto soggetto : nuoviSoggetti) {
if (TipoSoggettoUtil.COMMITTENTE.equalsIgnoreCase(soggetto.getTipologiaSoggetto())) { if (TipoSoggettoUtil.COMMITTENTE.equalsIgnoreCase(soggetto.getTipologiaSoggetto())) {
if (!ValidazionePraticaUtil.isA98Required(dettPratica)) { if (!ValidazionePraticaUtil.isA98Required(dettPratica)) {
@ -357,11 +326,8 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
addAsseverazione(serviceContext.getUserId(), dettPratica.getIntPraticaId(), dettPraticaId, addAsseverazione(serviceContext.getUserId(), dettPratica.getIntPraticaId(), dettPraticaId,
soggetto.getTipologiaSoggetto(), soggetto.getCodiceFiscale(), serviceContext); soggetto.getTipologiaSoggetto(), soggetto.getCodiceFiscale(), serviceContext);
} }
} }
} else { } else {
List<Soggetto> soggetti = soggettoLocalService.getValidTmpByIntPratica(dettPratica.getIntPraticaId()); List<Soggetto> soggetti = soggettoLocalService.getValidTmpByIntPratica(dettPratica.getIntPraticaId());
for (Soggetto soggetto : soggetti) { for (Soggetto soggetto : soggetti) {
if ((TipoSoggettoUtil.COMMITTENTE.equalsIgnoreCase(soggetto.getTipologiaSoggetto()) && !ValidazionePraticaUtil if ((TipoSoggettoUtil.COMMITTENTE.equalsIgnoreCase(soggetto.getTipologiaSoggetto()) && !ValidazionePraticaUtil
@ -375,9 +341,7 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
soggetto.getTipologiaSoggetto(), soggetto.getCodiceFiscale(), serviceContext); soggetto.getTipologiaSoggetto(), soggetto.getCodiceFiscale(), serviceContext);
} }
} }
} }
} }
@Override @Override
@ -390,7 +354,7 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
} }
asseverazione.setEsito(AsseverazioniUtil.STATO_ASSEGNATA); asseverazione.setEsito(AsseverazioniUtil.STATO_ASSEGNATA);
asseverazione.setDtEsito(null); asseverazione.setDtEsito(null);
if (asseverazione.getFileEntryId() != 0) { if (asseverazione.getFileEntryId() != 0L) {
DLAppLocalServiceUtil.deleteFileEntry(asseverazione.getFileEntryId()); DLAppLocalServiceUtil.deleteFileEntry(asseverazione.getFileEntryId());
asseverazione.setFileEntryId(0); asseverazione.setFileEntryId(0);
} }
@ -409,15 +373,12 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
Asseverazione asseverazione = asseverazioneLocalService.getAsseverazione(asseverazioneId); Asseverazione asseverazione = asseverazioneLocalService.getAsseverazione(asseverazioneId);
Date now = new Date(); Date now = new Date();
if (AsseverazioniUtil.STATO_ESEGUITA.equals(stato)) { if (AsseverazioniUtil.STATO_ESEGUITA.equals(stato)) {
asseverazione = generateReportAsseverazione(asseverazione, userId); asseverazione = generateReportAsseverazione(asseverazione, userId);
} }
asseverazione.setEsito(stato); asseverazione.setEsito(stato);
asseverazione.setMezzo(AsseverazioniUtil.ASSEVERAZIONE_DA_APPLICATIVO); asseverazione.setMezzo(AsseverazioniUtil.ASSEVERAZIONE_DA_APPLICATIVO);
asseverazione.setDtEsito(now); asseverazione.setDtEsito(now);
asseverazione = asseverazionePersistence.update(asseverazione); asseverazione = asseverazionePersistence.update(asseverazione);
} }
@ -428,22 +389,18 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
if (Validator.isNotNull(asseverazione.getFileEntryId())) { if (Validator.isNotNull(asseverazione.getFileEntryId())) {
dlAppLocalService.deleteFileEntry(asseverazione.getFileEntryId()); dlAppLocalService.deleteFileEntry(asseverazione.getFileEntryId());
} }
String tipoDocumento = "AS"; String tipoDocumento = "AS";
String propertiesTemplate = AvvisoUtil.getAllTipoDocumentoFileTemplateProps().get(tipoDocumento); String propertiesTemplate = AvvisoUtil.getAllTipoDocumentoFileTemplateProps().get(tipoDocumento);
long fileEntryIdTemplate = configurazioneLocalService.findByC_ChiaveLong(asseverazione.getCompanyId(), long fileEntryIdTemplate = configurazioneLocalService.findByC_ChiaveLong(asseverazione.getCompanyId(),
propertiesTemplate); propertiesTemplate);
String propertiesFolder = AvvisoUtil.getAllTipoDocumentoFolderProps().get(tipoDocumento); String propertiesFolder = AvvisoUtil.getAllTipoDocumentoFolderProps().get(tipoDocumento);
long fileEntryIdFolder = configurazioneLocalService.findByC_ChiaveLong(asseverazione.getCompanyId(), long fileEntryIdFolder = configurazioneLocalService.findByC_ChiaveLong(asseverazione.getCompanyId(),
propertiesFolder); propertiesFolder);
String fileName = StringUtils.leftPad(String.valueOf(asseverazione.getDettPraticaId()), 10, '0') String fileName = StringUtils.leftPad(String.valueOf(asseverazione.getDettPraticaId()), 10, '0')
+ (Validator.isNotNull(tipoDocumento) ? StringPool.UNDERLINE + tipoDocumento : StringPool.BLANK) + (Validator.isNotNull(tipoDocumento) ? StringPool.UNDERLINE + tipoDocumento : StringPool.BLANK)
+ StringPool.UNDERLINE + StringPool.UNDERLINE
+ (Validator.isNotNull(asseverazione.getAsseverazioneId()) ? asseverazione.getAsseverazioneId() + (Validator.isNotNull(asseverazione.getAsseverazioneId()) ? asseverazione.getAsseverazioneId()
: System.currentTimeMillis()); : System.currentTimeMillis());
ReportDto reportDto = new ReportDto(); ReportDto reportDto = new ReportDto();
reportDto.setFileEntryIds(new long[] { fileEntryIdTemplate }); reportDto.setFileEntryIds(new long[] { fileEntryIdTemplate });
reportDto.setFolderId(fileEntryIdFolder); reportDto.setFolderId(fileEntryIdFolder);
@ -453,7 +410,6 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
reportDto.setFooter(StringPool.BLANK); reportDto.setFooter(StringPool.BLANK);
reportDto.setFooterHeight(40); reportDto.setFooterHeight(40);
Map<String, Object> parameters = new HashMap<String, Object>(); Map<String, Object> parameters = new HashMap<String, Object>();
String relazioni = null; String relazioni = null;
Map<String, Serializable> dichiarazioniMap = asseverazione.getDichiarazioniMap(); Map<String, Serializable> dichiarazioniMap = asseverazione.getDichiarazioniMap();
if (dichiarazioniMap.containsKey("coniugio")) { if (dichiarazioniMap.containsKey("coniugio")) {
@ -465,31 +421,24 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
relazioni = StringPool.BLANK; relazioni = StringPool.BLANK;
} }
} }
String testoAsseverazione = testoAsseverazione(asseverazione.getTipologia(), asseverazione.getCodiceFiscale(), String testoAsseverazione = testoAsseverazione(asseverazione.getTipologia(), asseverazione.getCodiceFiscale(),
asseverazione.getDettPraticaId(), relazioni); asseverazione.getDettPraticaId(), relazioni);
if (Validator.isNull(testoAsseverazione)) { if (Validator.isNull(testoAsseverazione)) {
testoAsseverazione = AsseverazioniUtil.retrieveAsseverazioneText(asseverazione, testoAsseverazione = AsseverazioniUtil.retrieveAsseverazioneText(asseverazione,
asseverazione.getCodiceFiscale()); asseverazione.getCodiceFiscale());
} }
parameters.put("html", testoAsseverazione); parameters.put("html", testoAsseverazione);
parameters.put("modello", asseverazione.getModello()); parameters.put("modello", asseverazione.getModello());
reportDto.setParameters(parameters); reportDto.setParameters(parameters);
reportDto.setShowNumberOfPage(true); reportDto.setShowNumberOfPage(true);
reportDto.setType(ReportConstants.ReportType.VELOCITY_TO_PDF.toString()); reportDto.setType(ReportConstants.ReportType.VELOCITY_TO_PDF.toString());
String resourcePath = getClass().getName().replaceAll("\\w+\\.", "../") String resourcePath = getClass().getName().replaceAll("\\w+\\.", "../")
.replace(getClass().getSimpleName(), "resource/asseverazioni"); .replace(getClass().getSimpleName(), "resource/asseverazioni");
reportDto.setPortalURL(getClass().getResource(resourcePath).getPath()); reportDto.setPortalURL(getClass().getResource(resourcePath).getPath());
ReportResultDto result = ReportUtil.generateReport(asseverazione.getCompanyId(), userId, reportDto, null); ReportResultDto result = ReportUtil.generateReport(asseverazione.getCompanyId(), userId, reportDto, null);
long idFileEntry = result.getFileEntryIds()[0]; long idFileEntry = result.getFileEntryIds()[0];
asseverazione.setFileEntryId(idFileEntry); asseverazione.setFileEntryId(idFileEntry);
asseverazione = asseverazionePersistence.update(asseverazione); asseverazione = asseverazionePersistence.update(asseverazione);
return asseverazione; return asseverazione;
} }
@ -526,7 +475,6 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
asseverazione.setFileEntryId(0); asseverazione.setFileEntryId(0);
asseverazionePersistence.update(asseverazione); asseverazionePersistence.update(asseverazione);
} }
} }
@Override @Override
@ -556,14 +504,10 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
// TODO forse dobbiamo mettere i permesssi ma non mi pare sicuro. // TODO forse dobbiamo mettere i permesssi ma non mi pare sicuro.
FileEntry fileEntry = null; FileEntry fileEntry = null;
if (asseverazione.getEsito().equalsIgnoreCase(AsseverazioniUtil.STATO_ASSEGNATA)) { if (asseverazione.getEsito().equalsIgnoreCase(AsseverazioniUtil.STATO_ASSEGNATA)) {
long defaultFolderId = configurazioneLocalService.findByC_ChiaveLong(serviceContext.getCompanyId(), long defaultFolderId = configurazioneLocalService.findByC_ChiaveLong(serviceContext.getCompanyId(),
ConfigurazioneConstants.ATTACHMENT_FOLDER_ID); ConfigurazioneConstants.ATTACHMENT_FOLDER_ID);
Folder defaultFolder = dlAppLocalService.getFolder(defaultFolderId); Folder defaultFolder = dlAppLocalService.getFolder(defaultFolderId);
String folderName = PraticaUtil.getFolderName(dettPratica.getDettPraticaId()); String folderName = PraticaUtil.getFolderName(dettPratica.getDettPraticaId());
serviceContext.setGroupPermissions(new String[] { ActionKeys.VIEW }); serviceContext.setGroupPermissions(new String[] { ActionKeys.VIEW });
Folder folder = null; Folder folder = null;
try { try {
@ -580,7 +524,6 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
+ tipologiaUtente + StringPool.UNDERLINE + sourceFileName; + tipologiaUtente + StringPool.UNDERLINE + sourceFileName;
String description = StringPool.BLANK; String description = StringPool.BLANK;
String mimeType = MimeTypesUtil.getContentType(sourceFileName); String mimeType = MimeTypesUtil.getContentType(sourceFileName);
String changeLog = StringPool.BLANK; String changeLog = StringPool.BLANK;
fileEntry = dlAppLocalService.addFileEntry(serviceContext.getUserId(), folder.getRepositoryId(), fileEntry = dlAppLocalService.addFileEntry(serviceContext.getUserId(), folder.getRepositoryId(),
folder.getFolderId(), now.getTime() + "_" + sourceFileName, mimeType, title, description, folder.getFolderId(), now.getTime() + "_" + sourceFileName, mimeType, title, description,
@ -765,5 +708,4 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
return asseverazionePersistence.countByDettPratica_Tipologia_InEsito(dettPraticaId, tipologia, esiti); return asseverazionePersistence.countByDettPratica_Tipologia_InEsito(dettPraticaId, tipologia, esiti);
} }
} }

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

@ -138,7 +138,6 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
} }
long fileEntryIdTemplate = configurazioneLocalService.findByC_ChiaveLong(serviceContext.getCompanyId(), long fileEntryIdTemplate = configurazioneLocalService.findByC_ChiaveLong(serviceContext.getCompanyId(),
propertiesTemplate); propertiesTemplate);
return addAvviso(intPratica.getIntPraticaId(), StringPool.BLANK, new Date(), tipoAvviso, statoPratica, return addAvviso(intPratica.getIntPraticaId(), StringPool.BLANK, new Date(), tipoAvviso, statoPratica,
fileEntryIdTemplate, classPk, className, userCodiceFiscalePrimaFirma, jsonParameters, fileEntryIdTemplate, classPk, className, userCodiceFiscalePrimaFirma, jsonParameters,
controlloPraticaId, serviceContext); controlloPraticaId, serviceContext);
@ -152,7 +151,6 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
long controlloPraticaId) throws SystemException, PortalException { long controlloPraticaId) throws SystemException, PortalException {
IntPratica intPratica = intPraticaLocalService.getIntPratica(intPraticaId); IntPratica intPratica = intPraticaLocalService.getIntPratica(intPraticaId);
boolean varianteNonSostanziale = false; boolean varianteNonSostanziale = false;
if (className.equals(DettPratica.class.getName())) { if (className.equals(DettPratica.class.getName())) {
DettPratica dettPratica = dettPraticaLocalService.getDettPratica(classPk); DettPratica dettPratica = dettPraticaLocalService.getDettPratica(classPk);
@ -161,10 +159,8 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
} }
String statoPraticaCode = varianteNonSostanziale ? "DPVNS" : PraticaUtil.getStatoPraticaCode(stato, intPratica); String statoPraticaCode = varianteNonSostanziale ? "DPVNS" : PraticaUtil.getStatoPraticaCode(stato, intPratica);
String propertiesTemplate = AvvisoUtil.getAllTipoDocumentoFileTemplateProps().get(statoPraticaCode); String propertiesTemplate = AvvisoUtil.getAllTipoDocumentoFileTemplateProps().get(statoPraticaCode);
long fileEntryIdTemplate = configurazioneLocalService.findByC_ChiaveLong(serviceContext.getCompanyId(), long fileEntryIdTemplate = configurazioneLocalService.findByC_ChiaveLong(serviceContext.getCompanyId(),
propertiesTemplate); propertiesTemplate);
_log.info("debugAvviso: " + propertiesTemplate + " (" + statoPraticaCode + ")" _log.info("debugAvviso: " + propertiesTemplate + " (" + statoPraticaCode + ")"
+ (varianteNonSostanziale ? " non sostanziale" : StringPool.BLANK)); + (varianteNonSostanziale ? " non sostanziale" : StringPool.BLANK));
return addAvviso(intPraticaId, StringPool.BLANK, new Date(), tipoAvviso, stato, fileEntryIdTemplate, classPk, return addAvviso(intPraticaId, StringPool.BLANK, new Date(), tipoAvviso, stato, fileEntryIdTemplate, classPk,
@ -210,14 +206,12 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
User user = userPersistence.fetchByPrimaryKey(serviceContext.getUserId()); User user = userPersistence.fetchByPrimaryKey(serviceContext.getUserId());
Date now = new Date(); Date now = new Date();
Avviso avviso = createAvviso(counterLocalService.increment(Avviso.class.getName())); Avviso avviso = createAvviso(counterLocalService.increment(Avviso.class.getName()));
avviso.setCompanyId(serviceContext.getCompanyId()); avviso.setCompanyId(serviceContext.getCompanyId());
avviso.setGroupId(serviceContext.getScopeGroupId()); avviso.setGroupId(serviceContext.getScopeGroupId());
avviso.setUserId(serviceContext.getUserId()); avviso.setUserId(serviceContext.getUserId());
avviso.setUserName(user.getFullName()); avviso.setUserName(user.getFullName());
avviso.setCreateDate(serviceContext.getCreateDate(now)); avviso.setCreateDate(serviceContext.getCreateDate(now));
avviso.setModifiedDate(serviceContext.getModifiedDate(now)); avviso.setModifiedDate(serviceContext.getModifiedDate(now));
avviso.setDescLong(descLong); avviso.setDescLong(descLong);
avviso.setTipoAvviso(tipoAvviso); avviso.setTipoAvviso(tipoAvviso);
avviso.setDtAvviso(dtAvviso); avviso.setDtAvviso(dtAvviso);
@ -237,7 +231,6 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
avviso.setJsonParameters(jsonParameters); avviso.setJsonParameters(jsonParameters);
avviso.setInviatoTecnico(false); avviso.setInviatoTecnico(false);
avviso.setOldAvvisoId(0L); avviso.setOldAvvisoId(0L);
return addAvviso(avviso); return addAvviso(avviso);
} }
@ -249,7 +242,6 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
Date now = new Date(); Date now = new Date();
Avviso avviso = createAvviso(counterLocalService.increment(Avviso.class.getName())); Avviso avviso = createAvviso(counterLocalService.increment(Avviso.class.getName()));
avviso.setCompanyId(serviceContext.getCompanyId()); avviso.setCompanyId(serviceContext.getCompanyId());
avviso.setGroupId(serviceContext.getScopeGroupId()); avviso.setGroupId(serviceContext.getScopeGroupId());
avviso.setUserId(serviceContext.getUserId()); avviso.setUserId(serviceContext.getUserId());
@ -309,14 +301,13 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
private DynamicQuery searchDynamicQuery(long[] groupIds, Long classPk, String keywords) { private DynamicQuery searchDynamicQuery(long[] groupIds, Long classPk, String keywords) {
DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery(); DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery();
if (Validator.isNotNull(classPk)) { if (Validator.isNotNull(classPk)) {
dynamicQuery.add(PropertyFactoryUtil.forName("classPk").eq(classPk)); dynamicQuery.add(PropertyFactoryUtil.forName("classPk").eq(classPk));
} }
if (groupIds.length > 0) { if (groupIds.length > 0) {
dynamicQuery.add(PropertyFactoryUtil.forName("groupId").in(groupIds)); dynamicQuery.add(PropertyFactoryUtil.forName("groupId").in(groupIds));
} else { } else {
dynamicQuery.add(PropertyFactoryUtil.forName("groupId").eq(0l)); dynamicQuery.add(PropertyFactoryUtil.forName("groupId").eq(0L));
} }
if (Validator.isNotNull(keywords)) { if (Validator.isNotNull(keywords)) {
String[] sqlKeywords = CustomSQLUtil.keywords(keywords); String[] sqlKeywords = CustomSQLUtil.keywords(keywords);
@ -416,11 +407,9 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery(); DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery();
dynamicQuery.add(PropertyFactoryUtil.forName("companyId").eq(companyId)); dynamicQuery.add(PropertyFactoryUtil.forName("companyId").eq(companyId));
dynamicQuery.add(RestrictionsFactoryUtil.ilike("userCodiceFiscalePrimaFirma", cf)); dynamicQuery.add(RestrictionsFactoryUtil.ilike("userCodiceFiscalePrimaFirma", cf));
dynamicQuery.add(PropertyFactoryUtil.forName("fileEntryIdBase").ne(0L)); dynamicQuery.add(PropertyFactoryUtil.forName("fileEntryIdBase").ne(0L));
dynamicQuery.add(PropertyFactoryUtil.forName("inviato").eq(AvvisoUtil.DOCUMENTO_NON_INVIATO)); dynamicQuery.add(PropertyFactoryUtil.forName("inviato").eq(AvvisoUtil.DOCUMENTO_NON_INVIATO));
dynamicQuery.add(PropertyFactoryUtil.forName("tipoAvviso").eq(AvvisoUtil.TIPO_AVVISO_FIRMA)); dynamicQuery.add(PropertyFactoryUtil.forName("tipoAvviso").eq(AvvisoUtil.TIPO_AVVISO_FIRMA));
dynamicQuery.add(PropertyFactoryUtil.forName("errore").eq(false)); dynamicQuery.add(PropertyFactoryUtil.forName("errore").eq(false));
dynamicQuery.add(PropertyFactoryUtil.forName("annullato").eq(false)); dynamicQuery.add(PropertyFactoryUtil.forName("annullato").eq(false));
@ -451,14 +440,13 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
if (groupIds.length > 0) { if (groupIds.length > 0) {
dynamicQuery.add(PropertyFactoryUtil.forName("groupId").in(groupIds)); dynamicQuery.add(PropertyFactoryUtil.forName("groupId").in(groupIds));
} else { } else {
dynamicQuery.add(PropertyFactoryUtil.forName("groupId").eq(0l)); 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.isNotNull("userCodiceFiscalePrimaFirma"));
dynamicQuery.add(RestrictionsFactoryUtil.ne("userCodiceFiscalePrimaFirma", StringPool.BLANK)); dynamicQuery.add(RestrictionsFactoryUtil.ne("userCodiceFiscalePrimaFirma", StringPool.BLANK));
dynamicQuery.add(PropertyFactoryUtil.forName("fileEntryIdBase").ne(0L)); dynamicQuery.add(PropertyFactoryUtil.forName("fileEntryIdBase").ne(0L));
dynamicQuery.add(PropertyFactoryUtil.forName("inviato").eq(AvvisoUtil.DOCUMENTO_NON_INVIATO)); dynamicQuery.add(PropertyFactoryUtil.forName("inviato").eq(AvvisoUtil.DOCUMENTO_NON_INVIATO));
dynamicQuery.add(PropertyFactoryUtil.forName("tipoAvviso").eq(AvvisoUtil.TIPO_AVVISO_FIRMA)); dynamicQuery.add(PropertyFactoryUtil.forName("tipoAvviso").eq(AvvisoUtil.TIPO_AVVISO_FIRMA));
dynamicQuery.add(PropertyFactoryUtil.forName("errore").eq(false)); dynamicQuery.add(PropertyFactoryUtil.forName("errore").eq(false));
dynamicQuery.add(PropertyFactoryUtil.forName("annullato").eq(false)); dynamicQuery.add(PropertyFactoryUtil.forName("annullato").eq(false));
@ -489,20 +477,17 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
if (groupIds.length > 0) { if (groupIds.length > 0) {
dynamicQuery.add(PropertyFactoryUtil.forName("groupId").in(groupIds)); dynamicQuery.add(PropertyFactoryUtil.forName("groupId").in(groupIds));
} else { } else {
dynamicQuery.add(PropertyFactoryUtil.forName("groupId").eq(0l)); dynamicQuery.add(PropertyFactoryUtil.forName("groupId").eq(0L));
} }
dynamicQuery.add(PropertyFactoryUtil.forName("fileEntryIdInvio").eq(0L)); dynamicQuery.add(PropertyFactoryUtil.forName("fileEntryIdInvio").eq(0L));
dynamicQuery.add(PropertyFactoryUtil.forName("inviato").eq(AvvisoUtil.DOCUMENTO_NON_INVIATO)); dynamicQuery.add(PropertyFactoryUtil.forName("inviato").eq(AvvisoUtil.DOCUMENTO_NON_INVIATO));
dynamicQuery.add(PropertyFactoryUtil.forName("tipoAvviso").eq(AvvisoUtil.TIPO_AVVISO_FIRMA)); dynamicQuery.add(PropertyFactoryUtil.forName("tipoAvviso").eq(AvvisoUtil.TIPO_AVVISO_FIRMA));
dynamicQuery.add(PropertyFactoryUtil.forName("errore").eq(false)); dynamicQuery.add(PropertyFactoryUtil.forName("errore").eq(false));
dynamicQuery.add(PropertyFactoryUtil.forName("annullato").eq(false)); dynamicQuery.add(PropertyFactoryUtil.forName("annullato").eq(false));
dynamicQuery.add(PropertyFactoryUtil.forName("rifiutato").eq(false)); dynamicQuery.add(PropertyFactoryUtil.forName("rifiutato").eq(false));
Disjunction disjunction = RestrictionsFactoryUtil.disjunction(); Disjunction disjunction = RestrictionsFactoryUtil.disjunction();
disjunction.add(RestrictionsFactoryUtil.eq("userCodiceFiscalePrimaFirma", StringPool.BLANK)); disjunction.add(RestrictionsFactoryUtil.eq("userCodiceFiscalePrimaFirma", StringPool.BLANK));
disjunction.add(RestrictionsFactoryUtil.isNull("userCodiceFiscalePrimaFirma")); disjunction.add(RestrictionsFactoryUtil.isNull("userCodiceFiscalePrimaFirma"));
dynamicQuery.add(disjunction); dynamicQuery.add(disjunction);
return dynamicQuery; return dynamicQuery;
} }
@ -561,7 +546,6 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
andPrimaFirma.add(PropertyFactoryUtil.forName("fileEntryIdInvio").eq(0L)); andPrimaFirma.add(PropertyFactoryUtil.forName("fileEntryIdInvio").eq(0L));
andPrimaFirma.add(PropertyFactoryUtil.forName("transactionIdPrimaFirma").isNotNull()); andPrimaFirma.add(PropertyFactoryUtil.forName("transactionIdPrimaFirma").isNotNull());
andPrimaFirma.add(PropertyFactoryUtil.forName("transactionIdPrimaFirma").ne(StringPool.BLANK)); andPrimaFirma.add(PropertyFactoryUtil.forName("transactionIdPrimaFirma").ne(StringPool.BLANK));
dynamicQuery.add(andPrimaFirma); dynamicQuery.add(andPrimaFirma);
return dynamicQuery; return dynamicQuery;
} }
@ -605,7 +589,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
DynamicQuery dynamicQuery = dynamicQueryAvvisiInvioSignal(avvisoId); DynamicQuery dynamicQuery = dynamicQueryAvvisiInvioSignal(avvisoId);
List<Avviso> avviso = avvisoPersistence.findWithDynamicQuery(dynamicQuery, 0, 1); List<Avviso> avviso = avvisoPersistence.findWithDynamicQuery(dynamicQuery, 0, 1);
return !avviso.isEmpty() ? avviso.get(0) : null; return avviso.isEmpty() ? null : avviso.get(0);
} }
@Override @Override
@ -624,12 +608,10 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
dynamicQuery.add(PropertyFactoryUtil.forName("dtInvioSignal").isNull()); dynamicQuery.add(PropertyFactoryUtil.forName("dtInvioSignal").isNull());
dynamicQuery.add(PropertyFactoryUtil.forName("errore").eq(false)); dynamicQuery.add(PropertyFactoryUtil.forName("errore").eq(false));
dynamicQuery.add(PropertyFactoryUtil.forName("annullato").eq(false)); dynamicQuery.add(PropertyFactoryUtil.forName("annullato").eq(false));
Disjunction disjunction = RestrictionsFactoryUtil.disjunction(); Disjunction disjunction = RestrictionsFactoryUtil.disjunction();
disjunction.add(PropertyFactoryUtil.forName("inviato").eq(AvvisoUtil.DOCUMENTO_INVIATO)); disjunction.add(PropertyFactoryUtil.forName("inviato").eq(AvvisoUtil.DOCUMENTO_INVIATO));
disjunction.add(PropertyFactoryUtil.forName("rifiutato").eq(true)); disjunction.add(PropertyFactoryUtil.forName("rifiutato").eq(true));
dynamicQuery.add(disjunction); dynamicQuery.add(disjunction);
if (Validator.isNotNull(avvisoId)) { if (Validator.isNotNull(avvisoId)) {
dynamicQuery.add(PropertyFactoryUtil.forName("avvisoId").eq(avvisoId)); dynamicQuery.add(PropertyFactoryUtil.forName("avvisoId").eq(avvisoId));
} }
@ -688,7 +670,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId);
if (Validator.isNotNull(avviso.getTransactionIdPrimaFirma())) { if (Validator.isNotNull(avviso.getTransactionIdPrimaFirma())) {
throw new PortalException("Richiesta firma gia' effettuata"); throw new PortalException("Richiesta firma già effettuata");
} }
avviso.setFirmaInCorso(true); avviso.setFirmaInCorso(true);
avviso.setTransactionIdPrimaFirma(transactionId); avviso.setTransactionIdPrimaFirma(transactionId);
@ -805,15 +787,12 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
public Avviso updateAvvisoProtocollo(long avvisoId, String protocollo) throws SystemException { public Avviso updateAvvisoProtocollo(long avvisoId, String protocollo) throws SystemException {
Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId);
Date now = new Date(); Date now = new Date();
avviso.setModifiedDate(now); avviso.setModifiedDate(now);
avviso.setProtocollo(protocollo); avviso.setProtocollo(protocollo);
avviso.setDtProtocollo(now); avviso.setDtProtocollo(now);
avviso.setOggettoProtocollo(ProtocollazioneUtil.generaOggettoProtocollo(avviso.getClass().getName(), avviso.setOggettoProtocollo(ProtocollazioneUtil.generaOggettoProtocollo(avviso.getClass().getName(),
avviso.getAvvisoId())); avviso.getAvvisoId()));
return avvisoLocalService.updateAvviso(avviso); return avvisoLocalService.updateAvviso(avviso);
} }
@ -925,7 +904,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
if (groupIds.length > 0) { if (groupIds.length > 0) {
dynamicQuery.add(PropertyFactoryUtil.forName("groupId").in(groupIds)); dynamicQuery.add(PropertyFactoryUtil.forName("groupId").in(groupIds));
} else { } else {
dynamicQuery.add(PropertyFactoryUtil.forName("groupId").eq(0l)); dynamicQuery.add(PropertyFactoryUtil.forName("groupId").eq(0L));
} }
Junction or = RestrictionsFactoryUtil.disjunction(); Junction or = RestrictionsFactoryUtil.disjunction();
or.add(PropertyFactoryUtil.forName("fileEntryIdTemplate").eq(fileEntryId)); or.add(PropertyFactoryUtil.forName("fileEntryIdTemplate").eq(fileEntryId));
@ -979,9 +958,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
return avvisoPersistence.fetchByProtocollo(protocollo); 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) { private void updateSignalAndTempistica(Avviso avviso) {
String tipoDocumento = avviso.getTipoDocumento(); String tipoDocumento = avviso.getTipoDocumento();
@ -1026,8 +1003,8 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery(); DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.ilike("userCodiceFiscalePrimaFirma", codFisc)); dynamicQuery.add(RestrictionsFactoryUtil.ilike("userCodiceFiscalePrimaFirma", codFisc));
dynamicQuery.add(RestrictionsFactoryUtil.eq("tipoAvviso", AvvisoUtil.TIPO_AVVISO_FIRMA)); dynamicQuery.add(RestrictionsFactoryUtil.eq("tipoAvviso", AvvisoUtil.TIPO_AVVISO_FIRMA));
dynamicQuery.add(RestrictionsFactoryUtil.eq("fileEntryIdInvio", 0l)); dynamicQuery.add(RestrictionsFactoryUtil.eq("fileEntryIdInvio", 0L));
dynamicQuery.add(RestrictionsFactoryUtil.ne("fileEntryIdBase", 0l)); dynamicQuery.add(RestrictionsFactoryUtil.ne("fileEntryIdBase", 0L));
dynamicQuery.add(RestrictionsFactoryUtil.eq("rifiutato", false)); dynamicQuery.add(RestrictionsFactoryUtil.eq("rifiutato", false));
List<Avviso> avvisi = avvisoPersistence.findWithDynamicQuery(dynamicQuery); List<Avviso> avvisi = avvisoPersistence.findWithDynamicQuery(dynamicQuery);
@ -1057,10 +1034,9 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId);
if (avviso.getFileEntryIdInvio() != 0) { if (avviso.getFileEntryIdInvio() != 0) {
throw new SystemException("File gia' firmato rilascio firma non possibile"); throw new SystemException("File già firmato rilascio firma non possibile");
} }
avviso.setUserCodiceFiscalePrimaFirma(StringPool.BLANK); avviso.setUserCodiceFiscalePrimaFirma(StringPool.BLANK);
return avvisoLocalService.updateAvviso(avviso); return avvisoLocalService.updateAvviso(avviso);
} }
@ -1069,10 +1045,9 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId); Avviso avviso = avvisoPersistence.fetchByPrimaryKey(avvisoId);
if (avviso.getFileEntryIdInvio() != 0) { if (avviso.getFileEntryIdInvio() != 0) {
throw new SystemException("File gia' firmato assegna firma non possibile"); throw new SystemException("File già firmato assegna firma non possibile");
} }
avviso.setUserCodiceFiscalePrimaFirma(cf); avviso.setUserCodiceFiscalePrimaFirma(cf);
return avvisoLocalService.updateAvviso(avviso); return avvisoLocalService.updateAvviso(avviso);
} }
@ -1082,7 +1057,6 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(Avviso.class); DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(Avviso.class);
dynamicQuery.add(PropertyFactoryUtil.forName("oldFileEntryIdInvio").ne(0L)); dynamicQuery.add(PropertyFactoryUtil.forName("oldFileEntryIdInvio").ne(0L));
dynamicQuery.addOrder(OrderFactoryUtil.desc("oldFileEntryIdInvio")); dynamicQuery.addOrder(OrderFactoryUtil.desc("oldFileEntryIdInvio"));
return avvisoLocalService.dynamicQuery(dynamicQuery, start, end); return avvisoLocalService.dynamicQuery(dynamicQuery, start, end);
} }
@ -1092,7 +1066,6 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(Avviso.class); DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(Avviso.class);
dynamicQuery.add(PropertyFactoryUtil.forName("oldFileEntryIdBase").ne(0L)); dynamicQuery.add(PropertyFactoryUtil.forName("oldFileEntryIdBase").ne(0L));
dynamicQuery.addOrder(OrderFactoryUtil.desc("oldFileEntryIdBase")); dynamicQuery.addOrder(OrderFactoryUtil.desc("oldFileEntryIdBase"));
return avvisoLocalService.dynamicQuery(dynamicQuery, start, end); return avvisoLocalService.dynamicQuery(dynamicQuery, start, end);
} }
@ -1102,9 +1075,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(Avviso.class); DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(Avviso.class);
dynamicQuery.add(RestrictionsFactoryUtil.eq("controlloPraticaId", controlloPraticaId)); dynamicQuery.add(RestrictionsFactoryUtil.eq("controlloPraticaId", controlloPraticaId));
dynamicQuery.add(RestrictionsFactoryUtil.eq("rifiutato", true)); dynamicQuery.add(RestrictionsFactoryUtil.eq("rifiutato", true));
dynamicQuery.addOrder(OrderFactoryUtil.desc("avvisoId")); dynamicQuery.addOrder(OrderFactoryUtil.desc("avvisoId"));
return avvisoLocalService.dynamicQuery(dynamicQuery); return avvisoLocalService.dynamicQuery(dynamicQuery);
} }
@ -1113,40 +1084,30 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
throws Exception { throws Exception {
Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(avvisoId); Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(avvisoId);
long folderId = ConfigurazioneLocalServiceUtil.findByC_ChiaveLong(avviso.getCompanyId(), avvisoLocalService long folderId = ConfigurazioneLocalServiceUtil.findByC_ChiaveLong(avviso.getCompanyId(), avvisoLocalService
.getAllTipoDocumentoFolderProps().get(avviso.getTipoDocumento())); .getAllTipoDocumentoFolderProps().get(avviso.getTipoDocumento()));
String fileName = getFileNameAvviso(classPk, avviso.getTipoDocumento(), avviso.getAvvisoId(), "F"); String fileName = getFileNameAvviso(classPk, avviso.getTipoDocumento(), avviso.getAvvisoId(), "F");
if (Validator.isNotNull(folderId)) { if (Validator.isNotNull(folderId)) {
Folder folder = DLAppLocalServiceUtil.getFolder(folderId); Folder folder = DLAppLocalServiceUtil.getFolder(folderId);
if (Validator.isNotNull(folder)) { if (Validator.isNotNull(folder)) {
byte[] bytes = Base64.decode(fileToSave); byte[] bytes = Base64.decode(fileToSave);
serviceContext.setGroupPermissions(new String[] { ActionKeys.VIEW }); serviceContext.setGroupPermissions(new String[] { ActionKeys.VIEW });
FileEntry fileEntry = DLAppLocalServiceUtil.addFileEntry(avviso.getUserId(), folder.getRepositoryId(), FileEntry fileEntry = DLAppLocalServiceUtil.addFileEntry(avviso.getUserId(), folder.getRepositoryId(),
folderId, fileName, MimeTypesUtil.getContentType(fileName + ".p7m"), fileName + ".p7m", folderId, fileName, MimeTypesUtil.getContentType(fileName + ".p7m"), fileName + ".p7m",
StringPool.BLANK, StringPool.BLANK, bytes, serviceContext); StringPool.BLANK, StringPool.BLANK, bytes, serviceContext);
avviso.setFileEntryIdInvio(fileEntry.getFileEntryId()); avviso.setFileEntryIdInvio(fileEntry.getFileEntryId());
avviso = avvisoLocalService.updateAvviso(avviso); avviso = avvisoLocalService.updateAvviso(avviso);
if (Validator.isNull(avviso.getProtocollo())) { 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); avviso = avvisoLocalService.updateAvvisoProtocollo(avviso.getAvvisoId(), protocollo);
} }
} else { } else {
throw new Exception("No folder id exist"); throw new Exception("No folder id exist");
} }
} else { } else {
throw new Exception("No folder id exist"); throw new Exception("No folder id exist");
} }
return avviso; return avviso;
} }
@Override @Override
@ -1190,6 +1151,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
@Override @Override
public int countProtocolliSearch(String dataDa, String dataA, String numeroProtocollo) throws SystemException, public int countProtocolliSearch(String dataDa, String dataA, String numeroProtocollo) throws SystemException,
ParseException { ParseException {
int count = 0; int count = 0;
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
DynamicQuery query = DynamicQueryFactoryUtil.forClass(Avviso.class); DynamicQuery query = DynamicQueryFactoryUtil.forClass(Avviso.class);
@ -1224,6 +1186,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
@Override @Override
public List<Avviso> getAvvisiPerAggiuntaProtocollo(int start, int end) throws SystemException { public List<Avviso> getAvvisiPerAggiuntaProtocollo(int start, int end) throws SystemException {
DynamicQuery dynamicQuery = dynamicQueryAggiuntaProtocollo(); DynamicQuery dynamicQuery = dynamicQueryAggiuntaProtocollo();
dynamicQuery.addOrder(OrderFactoryUtil.asc("dtAvviso")); dynamicQuery.addOrder(OrderFactoryUtil.asc("dtAvviso"));
return avvisoPersistence.findWithDynamicQuery(dynamicQuery, start, end); return avvisoPersistence.findWithDynamicQuery(dynamicQuery, start, end);
@ -1231,6 +1194,7 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
@Override @Override
public DynamicQuery dynamicQueryAggiuntaProtocollo() throws SystemException { public DynamicQuery dynamicQueryAggiuntaProtocollo() throws SystemException {
DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery(); DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery();
dynamicQuery.add(PropertyFactoryUtil.forName("inviato").eq(AvvisoUtil.DOCUMENTO_NON_INVIATO)); dynamicQuery.add(PropertyFactoryUtil.forName("inviato").eq(AvvisoUtil.DOCUMENTO_NON_INVIATO));
dynamicQuery.add(PropertyFactoryUtil.forName("protocollo").ne(StringPool.BLANK)); dynamicQuery.add(PropertyFactoryUtil.forName("protocollo").ne(StringPool.BLANK));
@ -1244,39 +1208,31 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
@Override @Override
public List<Avviso> findByClassPk(long classPk) throws SystemException { public List<Avviso> findByClassPk(long classPk) throws SystemException {
return avvisoPersistence.findByClassPk(classPk); return avvisoPersistence.findByClassPk(classPk);
} }
// NUOVI METODI ADT // NUOVI METODI ADT
/** // ADT
* ADT
*/
@Override @Override
public int countAvvisiInvioTecnicoNew() throws SystemException { public int countAvvisiInvioTecnicoNew() throws SystemException {
DynamicQuery dynamicQuery = dynamicQueryAvvisiInvioTecnicoNew(null); DynamicQuery dynamicQuery = dynamicQueryAvvisiInvioTecnicoNew(null);
return (int) avvisoPersistence.countWithDynamicQuery(dynamicQuery); return (int) avvisoPersistence.countWithDynamicQuery(dynamicQuery);
} }
/** // ADT
* ADT
*
*/
@Override @Override
public List<Avviso> getAvvisiInvioTecnicoNew(int start, int end) throws SystemException { public List<Avviso> getAvvisiInvioTecnicoNew(int start, int end) throws SystemException {
DynamicQuery dynamicQuery = dynamicQueryAvvisiInvioTecnicoNew(null); DynamicQuery dynamicQuery = dynamicQueryAvvisiInvioTecnicoNew(null);
dynamicQuery.addOrder(OrderFactoryUtil.asc("dtAvviso")); dynamicQuery.addOrder(OrderFactoryUtil.asc("dtAvviso"));
return avvisoPersistence.findWithDynamicQuery(dynamicQuery, start, end); return avvisoPersistence.findWithDynamicQuery(dynamicQuery, start, end);
} }
/** // ADT
*
* ADT
*
* @param avvisoId
* @return
* @throws SystemException
*/
private DynamicQuery dynamicQueryAvvisiInvioTecnicoNew(Long avvisoId) throws SystemException { private DynamicQuery dynamicQueryAvvisiInvioTecnicoNew(Long avvisoId) throws SystemException {
DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery(); DynamicQuery dynamicQuery = avvisoLocalService.dynamicQuery();
dynamicQuery.add(PropertyFactoryUtil.forName("inviatoTecnico").eq(false)); dynamicQuery.add(PropertyFactoryUtil.forName("inviatoTecnico").eq(false));
dynamicQuery.add(PropertyFactoryUtil.forName("tipoDocumento").in( dynamicQuery.add(PropertyFactoryUtil.forName("tipoDocumento").in(
@ -1290,22 +1246,16 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
// avvisi // avvisi
Calendar gc = GregorianCalendar.getInstance(); Calendar gc = GregorianCalendar.getInstance();
gc.set(Calendar.YEAR, 2018); gc.set(Calendar.YEAR, 2018);
gc.set(Calendar.MONTH, 10);// NOVEMBRE gc.set(Calendar.MONTH, 10); // NOVEMBRE
gc.set(Calendar.DAY_OF_MONTH, 24); gc.set(Calendar.DAY_OF_MONTH, 24);
dynamicQuery.add(PropertyFactoryUtil.forName("createDate").ge(gc.getTime())); dynamicQuery.add(PropertyFactoryUtil.forName("createDate").ge(gc.getTime()));
return dynamicQuery; return dynamicQuery;
} }
/** // ADT
* ADT
*
* @param intPraticaId
* @param dettPraticaID
* @return
* @throws SystemException
*/
@Override @Override
public Avviso getAvvisoVidimazione(long intPraticaId, long dettPraticaID) throws SystemException { public Avviso getAvvisoVidimazione(long intPraticaId, long dettPraticaID) throws SystemException {
DynamicQuery dynamicQuery = AvvisoLocalServiceUtil.dynamicQuery(); DynamicQuery dynamicQuery = AvvisoLocalServiceUtil.dynamicQuery();
dynamicQuery.add(PropertyFactoryUtil.forName("tipoDocumento").in( dynamicQuery.add(PropertyFactoryUtil.forName("tipoDocumento").in(
new String[] { StatoPraticaConstants.VIDIMATA })); new String[] { StatoPraticaConstants.VIDIMATA }));
@ -1323,15 +1273,9 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
} }
} }
/**
*
*
* @param intPraticaId
* @return
* @throws SystemException
*/
@Override @Override
public Avviso getLastAvvisoIntegrazione(long intPraticaId) throws SystemException { public Avviso getLastAvvisoIntegrazione(long intPraticaId) throws SystemException {
DynamicQuery dynamicQuery = AvvisoLocalServiceUtil.dynamicQuery(); DynamicQuery dynamicQuery = AvvisoLocalServiceUtil.dynamicQuery();
dynamicQuery.add(PropertyFactoryUtil.forName("tipoDocumento").in( dynamicQuery.add(PropertyFactoryUtil.forName("tipoDocumento").in(
new String[] { StatoPraticaConstants.INTEGRAZIONE })); new String[] { StatoPraticaConstants.INTEGRAZIONE }));

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

@ -1,13 +1,13 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * 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 * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* GNU Lesser General Public License as published by the Free Software Foundation; either version * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* 2.1 of the License, or (at your option) any later version. * any later version.
* *
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* Lesser General Public License for more details. * details.
*/ */
package it.tref.liferay.portos.bo.service.impl; package it.tref.liferay.portos.bo.service.impl;
@ -56,14 +56,12 @@ import com.liferay.portal.service.ServiceContext;
* The implementation of the collaudo local service. * The implementation of the collaudo local service.
* *
* <p> * <p>
* All custom service methods should be put in this class. Whenever methods are * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy
* added, rerun ServiceBuilder to copy their definitions into the * their definitions into the {@link it.tref.liferay.portos.bo.service.CollaudoLocalService} interface.
* {@link it.tref.liferay.portos.bo.service.CollaudoLocalService} interface.
* *
* <p> * <p>
* This is a local service. Methods of this service will not have security * This is a local service. Methods of this service will not have security checks based on the propagated JAAS
* checks based on the propagated JAAS credentials because this service can only * credentials because this service can only be accessed from within the same VM.
* be accessed from within the same VM.
* </p> * </p>
* *
* @author Davide Barbagallo, 3F Consulting * @author Davide Barbagallo, 3F Consulting
@ -72,46 +70,37 @@ import com.liferay.portal.service.ServiceContext;
*/ */
public class CollaudoLocalServiceImpl extends CollaudoLocalServiceBaseImpl { public class CollaudoLocalServiceImpl extends CollaudoLocalServiceBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: Never reference this interface directly. Always use * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link
* {@link it.tref.liferay.portos.bo.service.CollaudoLocalServiceUtil} to * it.tref.liferay.portos.bo.service.CollaudoLocalServiceUtil} to access the collaudo local service.
* access the collaudo local service.
*/ */
private Collaudo initCollaudo(ServiceContext serviceContext) throws PortalException, SystemException { private Collaudo initCollaudo(ServiceContext serviceContext) throws PortalException, SystemException {
User user = userLocalService.getUser(serviceContext.getUserId()); User user = userLocalService.getUser(serviceContext.getUserId());
Date now = new Date(); Date now = new Date();
Collaudo collaudo = collaudoPersistence.create(counterLocalService.increment(DettPratica.class.getName()));
Collaudo collaudo = collaudoPersistence.create(counterLocalService.increment(DettPratica.class
.getName()));
collaudo.setCompanyId(serviceContext.getCompanyId()); collaudo.setCompanyId(serviceContext.getCompanyId());
collaudo.setGroupId(serviceContext.getScopeGroupId()); collaudo.setGroupId(serviceContext.getScopeGroupId());
collaudo.setUserId(serviceContext.getUserId()); collaudo.setUserId(serviceContext.getUserId());
collaudo.setUserName(user.getFullName()); collaudo.setUserName(user.getFullName());
collaudo.setCreateDate(serviceContext.getCreateDate(now)); collaudo.setCreateDate(serviceContext.getCreateDate(now));
collaudo.setModifiedDate(serviceContext.getModifiedDate(now)); collaudo.setModifiedDate(serviceContext.getModifiedDate(now));
// setto parametri di default // setto parametri di default
collaudo.setParziale(false); collaudo.setParziale(false);
collaudo.setDataEffettuazione(null); collaudo.setDataEffettuazione(null);
collaudo.setDataCollaudo(null); collaudo.setDataCollaudo(null);
collaudo.setCodiceFiscaleDelegato(StringPool.BLANK); collaudo.setCodiceFiscaleDelegato(StringPool.BLANK);
return collaudo; return collaudo;
} }
@Override
@Indexable(type = IndexableType.REINDEX) @Indexable(type = IndexableType.REINDEX)
public Collaudo addCollaudo(long intPraticaId, ServiceContext serviceContext) throws PortalException, public Collaudo addCollaudo(long intPraticaId, ServiceContext serviceContext) throws PortalException,
SystemException { SystemException {
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId); IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId);
Collaudo collaudo = initCollaudo(serviceContext); Collaudo collaudo = initCollaudo(serviceContext);
collaudo.setGroupId(intPratica.getGroupId()); collaudo.setGroupId(intPratica.getGroupId());
collaudo.setIntPraticaId(intPraticaId); collaudo.setIntPraticaId(intPraticaId);
collaudoPersistence.update(collaudo); collaudoPersistence.update(collaudo);
return collaudo; return collaudo;
} }
@ -125,12 +114,10 @@ public class CollaudoLocalServiceImpl extends CollaudoLocalServiceBaseImpl {
for (DocPratica docPratica : docPraticas) { for (DocPratica docPratica : docPraticas) {
docPraticaLocalService.deleteDocPratica(docPratica); docPraticaLocalService.deleteDocPratica(docPratica);
} }
List<Pagamento> pagamenti = pagamentoLocalService.findByClassPk(collaudo.getCollaudoId()); List<Pagamento> pagamenti = pagamentoLocalService.findByClassPk(collaudo.getCollaudoId());
for (Pagamento pagamento : pagamenti) { for (Pagamento pagamento : pagamenti) {
pagamentoLocalService.deletePagamento(pagamento); pagamentoLocalService.deletePagamento(pagamento);
} }
return super.deleteCollaudo(collaudo); return super.deleteCollaudo(collaudo);
} }
@ -139,29 +126,27 @@ public class CollaudoLocalServiceImpl extends CollaudoLocalServiceBaseImpl {
public Collaudo deleteCollaudo(long collaudoId) throws PortalException, SystemException { public Collaudo deleteCollaudo(long collaudoId) throws PortalException, SystemException {
Collaudo collaudo = collaudoPersistence.findByPrimaryKey(collaudoId); Collaudo collaudo = collaudoPersistence.findByPrimaryKey(collaudoId);
return deleteCollaudo(collaudo); return deleteCollaudo(collaudo);
} }
@Override
@Indexable(type = IndexableType.REINDEX) @Indexable(type = IndexableType.REINDEX)
public Collaudo updateCollaudo(long userId, long collaudoId, long intPraticaId, boolean parziale, public Collaudo updateCollaudo(long userId, long collaudoId, long intPraticaId, boolean parziale,
boolean completata, Date dataCollaudo, String codiceFiscaleDelegato, boolean normEsenteBollo, boolean completata, Date dataCollaudo, String codiceFiscaleDelegato, boolean normEsenteBollo,
String noteCollaudo) throws NoSuchCollaudoException, SystemException { String noteCollaudo) throws NoSuchCollaudoException, SystemException {
Collaudo collaudo = collaudoPersistence.findByPrimaryKey(collaudoId); Collaudo collaudo = collaudoPersistence.findByPrimaryKey(collaudoId);
collaudo.setParziale(parziale); collaudo.setParziale(parziale);
collaudo.setCompletata(completata); collaudo.setCompletata(completata);
collaudo.setDataCollaudo(dataCollaudo); collaudo.setDataCollaudo(dataCollaudo);
collaudo.setCodiceFiscaleDelegato(codiceFiscaleDelegato); collaudo.setCodiceFiscaleDelegato(codiceFiscaleDelegato);
collaudo.setNormEsenteBollo(normEsenteBollo); collaudo.setNormEsenteBollo(normEsenteBollo);
collaudo.setNoteCollaudo(noteCollaudo); collaudo.setNoteCollaudo(noteCollaudo);
collaudo = collaudoPersistence.update(collaudo); collaudo = collaudoPersistence.update(collaudo);
return collaudo; return collaudo;
} }
@Override
public Collaudo getLastEditable(long intPraticaId) throws SystemException { public Collaudo getLastEditable(long intPraticaId) throws SystemException {
DynamicQuery dynamicQuery = dynamicQuery(); DynamicQuery dynamicQuery = dynamicQuery();
@ -174,6 +159,7 @@ public class CollaudoLocalServiceImpl extends CollaudoLocalServiceBaseImpl {
return null; return null;
} }
@Override
public Collaudo getLastCompleted(long intPraticaId) throws SystemException { public Collaudo getLastCompleted(long intPraticaId) throws SystemException {
DynamicQuery dynamicQuery = dynamicQuery(); DynamicQuery dynamicQuery = dynamicQuery();
@ -186,82 +172,68 @@ public class CollaudoLocalServiceImpl extends CollaudoLocalServiceBaseImpl {
return null; return null;
} }
@Override
public void updateEsitoPagamento(long pagamentoId, long collaudoId, String stato) throws SystemException, public void updateEsitoPagamento(long pagamentoId, long collaudoId, String stato) throws SystemException,
PortalException { PortalException {
updateEsitoPagamento(pagamentoId, collaudoId, 0l, stato); updateEsitoPagamento(pagamentoId, collaudoId, 0l, stato);
} }
@Override
public void updateEsitoPagamento(long pagamentoId, long collaudoId, long fileEntryId, String stato) public void updateEsitoPagamento(long pagamentoId, long collaudoId, long fileEntryId, String stato)
throws SystemException, PortalException { throws SystemException, PortalException {
Date now = new Date(); Date now = new Date();
Collaudo collaudo = collaudoPersistence.fetchByPrimaryKey(collaudoId); Collaudo collaudo = collaudoPersistence.fetchByPrimaryKey(collaudoId);
collaudo.setModifiedDate(now); collaudo.setModifiedDate(now);
if (stato.equalsIgnoreCase(PagamentoConstants.UTILIZZATA_PAGATA)) { if (stato.equalsIgnoreCase(PagamentoConstants.UTILIZZATA_PAGATA)) {
collaudo.setCompletata(true); collaudo.setCompletata(true);
collaudo.setDataEffettuazione(now); collaudo.setDataEffettuazione(now);
collaudo.setNumero(collaudoPersistence.countByIntPraticaId_Completata(collaudo.getIntPraticaId(), collaudo.setNumero(collaudoPersistence.countByIntPraticaId_Completata(collaudo.getIntPraticaId(), true) + 1);
true) + 1);
collaudo = updateCollaudo(collaudo); collaudo = updateCollaudo(collaudo);
updateIntPraticaStatus(collaudo, collaudo.getIntPraticaId()); updateIntPraticaStatus(collaudo, collaudo.getIntPraticaId());
docPraticaLocalService.completeInvalidation(collaudo.getIntPraticaId()); docPraticaLocalService.completeInvalidation(collaudo.getIntPraticaId());
IntPratica intPratica = intPraticaLocalService.getIntPratica(collaudo.getIntPraticaId()); IntPratica intPratica = intPraticaLocalService.getIntPratica(collaudo.getIntPraticaId());
if (WorkflowUtil.isWorkflowDisattivabile(collaudo.getIntPraticaId()) if (WorkflowUtil.isWorkflowDisattivabile(collaudo.getIntPraticaId())
&& Validator.isNotNull(intPratica.getStatusByUserId())) { && Validator.isNotNull(intPratica.getStatusByUserId())) {
inviaMailnotifica(collaudoId, intPratica.getStatusByUserId(), now); inviaMailnotifica(collaudoId, intPratica.getStatusByUserId(), now);
} }
pagamentoLocalService.updatePagamentoUtilizzata(pagamentoId, stato); pagamentoLocalService.updatePagamentoUtilizzata(pagamentoId, stato);
} else if (stato.equalsIgnoreCase(PagamentoConstants.UTILIZZATA_NON_PAGABILE) } else if (stato.equalsIgnoreCase(PagamentoConstants.UTILIZZATA_NON_PAGABILE)
|| stato.equalsIgnoreCase(PagamentoConstants.UTILIZZATA_RIFIUTATA) || stato.equalsIgnoreCase(PagamentoConstants.UTILIZZATA_RIFIUTATA)
|| stato.equalsIgnoreCase(PagamentoConstants.UTILIZZATA_ANNULLATO)) { || stato.equalsIgnoreCase(PagamentoConstants.UTILIZZATA_ANNULLATO)) {
pagamentoLocalService.updatePagamentoUtilizzata(pagamentoId, stato); pagamentoLocalService.updatePagamentoUtilizzata(pagamentoId, stato);
} }
} }
@Override
public Collaudo updateEsito(long collaudoId, int stato) throws SystemException, PortalException { public Collaudo updateEsito(long collaudoId, int stato) throws SystemException, PortalException {
Date now = new Date(); Date now = new Date();
Collaudo collaudo = collaudoPersistence.fetchByPrimaryKey(collaudoId); Collaudo collaudo = collaudoPersistence.fetchByPrimaryKey(collaudoId);
collaudo.setModifiedDate(now); collaudo.setModifiedDate(now);
collaudo.setCompletata(true); collaudo.setCompletata(true);
collaudo.setDataEffettuazione(now); collaudo.setDataEffettuazione(now);
collaudo.setNumero(collaudoPersistence.countByIntPraticaId_Completata(collaudo.getIntPraticaId(), collaudo.setNumero(collaudoPersistence.countByIntPraticaId_Completata(collaudo.getIntPraticaId(), true) + 1);
true) + 1);
collaudo = updateCollaudo(collaudo); collaudo = updateCollaudo(collaudo);
updateIntPraticaStatus(collaudo, collaudo.getIntPraticaId()); updateIntPraticaStatus(collaudo, collaudo.getIntPraticaId());
docPraticaLocalService.completeInvalidation(collaudo.getIntPraticaId()); docPraticaLocalService.completeInvalidation(collaudo.getIntPraticaId());
IntPratica intPratica = intPraticaLocalService.getIntPratica(collaudo.getIntPraticaId()); IntPratica intPratica = intPraticaLocalService.getIntPratica(collaudo.getIntPraticaId());
if (WorkflowUtil.isWorkflowDisattivabile(collaudo.getIntPraticaId()) if (WorkflowUtil.isWorkflowDisattivabile(collaudo.getIntPraticaId())
&& Validator.isNotNull(intPratica.getStatusByUserId())) { && Validator.isNotNull(intPratica.getStatusByUserId())) {
inviaMailnotifica(collaudoId, intPratica.getStatusByUserId(), now); inviaMailnotifica(collaudoId, intPratica.getStatusByUserId(), now);
} }
return collaudo; return collaudo;
} }
private void inviaMailnotifica(long collaudoId, long tecnicoIstruttoreId, Date date) private void inviaMailnotifica(long collaudoId, long tecnicoIstruttoreId, Date date) throws SystemException,
throws SystemException, PortalException { PortalException {
Collaudo collaudo = collaudoPersistence.fetchByPrimaryKey(collaudoId); Collaudo collaudo = collaudoPersistence.fetchByPrimaryKey(collaudoId);
User tecnicoIstruttore = userLocalService.getUser(tecnicoIstruttoreId); User tecnicoIstruttore = userLocalService.getUser(tecnicoIstruttoreId);
String[] to = { tecnicoIstruttore.getEmailAddress() }; String[] to = { tecnicoIstruttore.getEmailAddress() };
String[] cc = new String[0]; String[] cc = new String[0];
String[] ccn = new String[0]; String[] ccn = new String[0];
String tipoPratica = StringPool.BLANK; String tipoPratica = StringPool.BLANK;
long intPraticaId = collaudo.getIntPraticaId(); long intPraticaId = collaudo.getIntPraticaId();
if (AzioniPraticheUtil.isDeposito(intPraticaId)) { if (AzioniPraticheUtil.isDeposito(intPraticaId)) {
@ -269,24 +241,19 @@ public class CollaudoLocalServiceImpl extends CollaudoLocalServiceBaseImpl {
} else if (AzioniPraticheUtil.isAutorizzazione(intPraticaId)) { } else if (AzioniPraticheUtil.isAutorizzazione(intPraticaId)) {
tipoPratica = LanguageUtil.get(LocaleUtil.ITALIAN, "tipo-pratica-02"); tipoPratica = LanguageUtil.get(LocaleUtil.ITALIAN, "tipo-pratica-02");
} }
JSONObject templateVariables = JSONFactoryUtil.createJSONObject(); JSONObject templateVariables = JSONFactoryUtil.createJSONObject();
templateVariables.put("receiver", tecnicoIstruttore.getFullName()); templateVariables.put("receiver", tecnicoIstruttore.getFullName());
templateVariables.put("tipoPratica", tipoPratica); templateVariables.put("tipoPratica", tipoPratica);
templateVariables.put( templateVariables.put("tipoOggetto",
"tipoOggetto", LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-" + (collaudo.getParziale() ? "10" : "08")));
LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-" templateVariables.put("dataInvio",
+ (collaudo.getParziale() ? "10" : "08"))); FastDateFormatFactoryUtil.getSimpleDateFormat("dd/MM/yyyy HH:mm").format(date));
templateVariables.put("dataInvio", FastDateFormatFactoryUtil.getSimpleDateFormat("dd/MM/yyyy HH:mm")
.format(date));
ServiceContext serviceContext = new ServiceContext(); ServiceContext serviceContext = new ServiceContext();
serviceContext.setScopeGroupId(collaudo.getGroupId()); serviceContext.setScopeGroupId(collaudo.getGroupId());
serviceContext.setCompanyId(collaudo.getCompanyId()); serviceContext.setCompanyId(collaudo.getCompanyId());
serviceContext.setUserId(collaudo.getUserId()); serviceContext.setUserId(collaudo.getUserId());
MailUtil.invioMailNotifica(collaudo.getIntPraticaId(), 0l, collaudoId, Collaudo.class.getName(), to, cc, ccn,
MailUtil.invioMailNotifica(collaudo.getIntPraticaId(), 0l, collaudoId, Collaudo.class.getName(), to, "NOTIFICA-BO", templateVariables, null, serviceContext);
cc, ccn, "NOTIFICA-BO", templateVariables, null, serviceContext);
} }
private IntPratica updateIntPraticaStatus(Collaudo collaudo, long intPraticaId) throws PortalException, private IntPratica updateIntPraticaStatus(Collaudo collaudo, long intPraticaId) throws PortalException,
@ -302,6 +269,7 @@ public class CollaudoLocalServiceImpl extends CollaudoLocalServiceBaseImpl {
return intPratica; return intPratica;
} }
@Override
public Collaudo updateCollaudoProtocollo(long collaudoId, String protocollo) throws PortalException, public Collaudo updateCollaudoProtocollo(long collaudoId, String protocollo) throws PortalException,
SystemException { SystemException {
@ -310,87 +278,91 @@ public class CollaudoLocalServiceImpl extends CollaudoLocalServiceBaseImpl {
collaudo.setProtocollo(protocollo); collaudo.setProtocollo(protocollo);
collaudo.setDtProtocollo(new Date()); collaudo.setDtProtocollo(new Date());
collaudo = collaudoLocalService.updateCollaudo(collaudo); collaudo = collaudoLocalService.updateCollaudo(collaudo);
return collaudo; return collaudo;
} }
@Override
public Collaudo findByProtocollo(long companyId, long groupId, String protocollo) throws PortalException, public Collaudo findByProtocollo(long companyId, long groupId, String protocollo) throws PortalException,
SystemException { SystemException {
return collaudoPersistence.findByC_G_Protocollo(companyId, groupId, protocollo); return collaudoPersistence.findByC_G_Protocollo(companyId, groupId, protocollo);
} }
@Override
public Collaudo fetchByProtocollo(String protocollo) throws PortalException, SystemException { public Collaudo fetchByProtocollo(String protocollo) throws PortalException, SystemException {
return collaudoPersistence.fetchByProtocollo(protocollo); return collaudoPersistence.fetchByProtocollo(protocollo);
} }
@Override
public Collaudo pagaInvia(long collaudoId, String codiceFiscaleCommittente, String currentURL, public Collaudo pagaInvia(long collaudoId, String codiceFiscaleCommittente, String currentURL,
ServiceContext serviceContext) throws SystemException, PortalException { ServiceContext serviceContext) throws SystemException, PortalException {
Collaudo collaudo = collaudoPersistence.findByPrimaryKey(collaudoId); Collaudo collaudo = collaudoPersistence.findByPrimaryKey(collaudoId);
BigDecimal importoBolli = PagamentiCommonUtil.getImportoBolli(collaudo.getCompanyId(), BigDecimal importoBolli = PagamentiCommonUtil.getImportoBolli(collaudo.getCompanyId(),
collaudo.getCollaudoId(), Collaudo.class.getName(), TipoIntegrazioneUtil.COLLAUDO); collaudo.getCollaudoId(), Collaudo.class.getName(), TipoIntegrazioneUtil.COLLAUDO);
collaudo.setImportoBolli(importoBolli.toString()); collaudo.setImportoBolli(importoBolli.toString());
collaudo = updateCollaudo(collaudo); collaudo = updateCollaudo(collaudo);
PagamentiUtil.nuovoPagamento(currentURL, collaudo.getCollaudoId(), Collaudo.class.getName(), PagamentiUtil.nuovoPagamento(currentURL, collaudo.getCollaudoId(), Collaudo.class.getName(),
PagamentoConstants.PAGAMENTO_BOLLI, importoBolli.toString(), codiceFiscaleCommittente, PagamentoConstants.PAGAMENTO_BOLLI, importoBolli.toString(), codiceFiscaleCommittente, serviceContext);
serviceContext);
return collaudo; return collaudo;
} }
public List<Collaudo> findByIntPraticaId(long intPraticaId, int start, int end, @Override
OrderByComparator orderByComparator) throws SystemException { public List<Collaudo> findByIntPraticaId(long intPraticaId, int start, int end, OrderByComparator orderByComparator)
throws SystemException {
return collaudoPersistence.findByIntPraticaId(intPraticaId, start, end, orderByComparator); return collaudoPersistence.findByIntPraticaId(intPraticaId, start, end, orderByComparator);
} }
@Override
public int countByIntPraticaId(long intPraticaId) throws SystemException { public int countByIntPraticaId(long intPraticaId) throws SystemException {
return collaudoPersistence.countByIntPraticaId(intPraticaId); return collaudoPersistence.countByIntPraticaId(intPraticaId);
} }
public List<Collaudo> findByIntPraticaId_Parziale(long intPraticaId, boolean parziale, int start, @Override
int end, OrderByComparator orderByComparator) throws SystemException { public List<Collaudo> findByIntPraticaId_Parziale(long intPraticaId, boolean parziale, int start, int end,
OrderByComparator orderByComparator) throws SystemException {
return collaudoPersistence.findByIntPraticaId_Parziale(intPraticaId, parziale, start, end, return collaudoPersistence.findByIntPraticaId_Parziale(intPraticaId, parziale, start, end, orderByComparator);
orderByComparator);
} }
@Override
public int countByIntPraticaId_Parziale(long intPraticaId, boolean parziale) throws SystemException { public int countByIntPraticaId_Parziale(long intPraticaId, boolean parziale) throws SystemException {
return collaudoPersistence.countByIntPraticaId_Parziale(intPraticaId, parziale); return collaudoPersistence.countByIntPraticaId_Parziale(intPraticaId, parziale);
} }
public List<Collaudo> findByIntPraticaId_Completata(long intPraticaId, boolean completata, int start, @Override
int end, OrderByComparator orderByComparator) throws SystemException { public List<Collaudo> findByIntPraticaId_Completata(long intPraticaId, boolean completata, int start, int end,
OrderByComparator orderByComparator) throws SystemException {
return collaudoPersistence.findByIntPraticaId_Completata(intPraticaId, completata, start, end, return collaudoPersistence.findByIntPraticaId_Completata(intPraticaId, completata, start, end,
orderByComparator); orderByComparator);
} }
@Override
public int countByIntPraticaId_Completata(long intPraticaId, boolean completata) throws SystemException { public int countByIntPraticaId_Completata(long intPraticaId, boolean completata) throws SystemException {
return collaudoPersistence.countByIntPraticaId_Completata(intPraticaId, completata); return collaudoPersistence.countByIntPraticaId_Completata(intPraticaId, completata);
} }
public List<Collaudo> findByCodiceFiscale_Completata(String codiceFiscaleDelegato, boolean completata, @Override
int start, int end, OrderByComparator orderByComparator) throws SystemException { public List<Collaudo> findByCodiceFiscale_Completata(String codiceFiscaleDelegato, boolean completata, int start,
int end, OrderByComparator orderByComparator) throws SystemException {
return collaudoPersistence.findByCodiceFiscale_Completata(codiceFiscaleDelegato, completata, start, return collaudoPersistence.findByCodiceFiscale_Completata(codiceFiscaleDelegato, completata, start, end,
end, orderByComparator); orderByComparator);
} }
public int countByCodiceFiscale_Completata(String codiceFiscaleDelegato, boolean completata) @Override
throws SystemException { public int countByCodiceFiscale_Completata(String codiceFiscaleDelegato, boolean completata) throws SystemException {
return collaudoPersistence.countByCodiceFiscale_Completata(codiceFiscaleDelegato, completata); return collaudoPersistence.countByCodiceFiscale_Completata(codiceFiscaleDelegato, completata);
} }
@Override
public List<Collaudo> findByIntPraticaId_Parziale_leCollaudoId(long collaudoId, long intPraticaId, public List<Collaudo> findByIntPraticaId_Parziale_leCollaudoId(long collaudoId, long intPraticaId,
boolean parziale, int start, int end, OrderByComparator orderByComparator) throws SystemException { boolean parziale, int start, int end, OrderByComparator orderByComparator) throws SystemException {
@ -398,10 +370,10 @@ public class CollaudoLocalServiceImpl extends CollaudoLocalServiceBaseImpl {
dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId));
dynamicQuery.add(RestrictionsFactoryUtil.lt("collaudoId", collaudoId)); dynamicQuery.add(RestrictionsFactoryUtil.lt("collaudoId", collaudoId));
dynamicQuery.add(RestrictionsFactoryUtil.eq("parziale", parziale)); dynamicQuery.add(RestrictionsFactoryUtil.eq("parziale", parziale));
return dynamicQuery(dynamicQuery, start, end, orderByComparator); return dynamicQuery(dynamicQuery, start, end, orderByComparator);
} }
@Override
public int countByIntPraticaId_Parziale_leCollaudoId(long collaudoId, long intPraticaId, boolean parziale) public int countByIntPraticaId_Parziale_leCollaudoId(long collaudoId, long intPraticaId, boolean parziale)
throws SystemException { throws SystemException {
@ -409,11 +381,11 @@ public class CollaudoLocalServiceImpl extends CollaudoLocalServiceBaseImpl {
dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId));
dynamicQuery.add(RestrictionsFactoryUtil.lt("collaudoId", collaudoId)); dynamicQuery.add(RestrictionsFactoryUtil.lt("collaudoId", collaudoId));
dynamicQuery.add(RestrictionsFactoryUtil.eq("parziale", parziale)); dynamicQuery.add(RestrictionsFactoryUtil.eq("parziale", parziale));
List<Collaudo> results = dynamicQuery(dynamicQuery); List<Collaudo> results = dynamicQuery(dynamicQuery);
return results.isEmpty() ? 0 : results.size(); return results.size();
} }
@Override
public List<Collaudo> findCollaudiCompletiNotProtocollo(int start, int end) throws SystemException { public List<Collaudo> findCollaudiCompletiNotProtocollo(int start, int end) throws SystemException {
DynamicQuery dynamicQuery = getDynamicQueryCollaudiCompletiNotProtocollo(); DynamicQuery dynamicQuery = getDynamicQueryCollaudiCompletiNotProtocollo();
@ -421,6 +393,7 @@ public class CollaudoLocalServiceImpl extends CollaudoLocalServiceBaseImpl {
return collaudoPersistence.findWithDynamicQuery(dynamicQuery, start, end); return collaudoPersistence.findWithDynamicQuery(dynamicQuery, start, end);
} }
@Override
public int countCollaudiCompletiNotProtocollo() throws SystemException { public int countCollaudiCompletiNotProtocollo() throws SystemException {
DynamicQuery dynamicQuery = getDynamicQueryCollaudiCompletiNotProtocollo(); DynamicQuery dynamicQuery = getDynamicQueryCollaudiCompletiNotProtocollo();
@ -439,6 +412,7 @@ public class CollaudoLocalServiceImpl extends CollaudoLocalServiceBaseImpl {
return dynamicQuery; return dynamicQuery;
} }
@Override
public List<Collaudo> findCollaudiCompletiNotGestiti(int start, int end) throws SystemException { public List<Collaudo> findCollaudiCompletiNotGestiti(int start, int end) throws SystemException {
DynamicQuery dynamicQuery = getDynamicQueryCollaudiCompletiNotGestiti(); DynamicQuery dynamicQuery = getDynamicQueryCollaudiCompletiNotGestiti();
@ -446,6 +420,7 @@ public class CollaudoLocalServiceImpl extends CollaudoLocalServiceBaseImpl {
return collaudoPersistence.findWithDynamicQuery(dynamicQuery, start, end); return collaudoPersistence.findWithDynamicQuery(dynamicQuery, start, end);
} }
@Override
public int countCollaudiCompletiNotGestiti() throws SystemException { public int countCollaudiCompletiNotGestiti() throws SystemException {
DynamicQuery dynamicQuery = getDynamicQueryCollaudiCompletiNotGestiti(); DynamicQuery dynamicQuery = getDynamicQueryCollaudiCompletiNotGestiti();

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

@ -1,13 +1,13 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * 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 * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* GNU Lesser General Public License as published by the Free Software Foundation; either version * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* 2.1 of the License, or (at your option) any later version. * any later version.
* *
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* Lesser General Public License for more details. * details.
*/ */
package it.tref.liferay.portos.bo.service.impl; package it.tref.liferay.portos.bo.service.impl;
@ -44,13 +44,12 @@ import com.liferay.portal.service.ServiceContext;
* The implementation of the comunicazione local service. * The implementation of the comunicazione local service.
* *
* <p> * <p>
* All custom service methods should be put in this class. Whenever methods are added, rerun * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy
* ServiceBuilder to copy their definitions into the * their definitions into the {@link it.tref.liferay.portos.bo.service.ComunicazioneLocalService} interface.
* {@link it.tref.liferay.portos.bo.service.ComunicazioneLocalService} interface.
* *
* <p> * <p>
* This is a local service. Methods of this service will not have security checks based on the * This is a local service. Methods of this service will not have security checks based on the propagated JAAS
* propagated JAAS credentials because this service can only be accessed from within the same VM. * credentials because this service can only be accessed from within the same VM.
* </p> * </p>
* *
* @author Davide Barbagallo, 3F Consulting * @author Davide Barbagallo, 3F Consulting
@ -59,132 +58,85 @@ import com.liferay.portal.service.ServiceContext;
*/ */
public class ComunicazioneLocalServiceImpl extends ComunicazioneLocalServiceBaseImpl { public class ComunicazioneLocalServiceImpl extends ComunicazioneLocalServiceBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link
* * it.tref.liferay.portos.bo.service.ComunicazioneLocalServiceUtil} to access the comunicazione local service.
* Never reference this interface directly. Always use {@link
* it.tref.liferay.portos.bo.service.ComunicazioneLocalServiceUtil} to access the comunicazione
* local service.
*/ */
@Override
public Comunicazione addComunicazione(long userId, long intPraticaId, String domanda, ServiceContext serviceContext) public Comunicazione addComunicazione(long userId, long intPraticaId, String domanda, ServiceContext serviceContext)
throws SystemException, PortalException { throws SystemException, PortalException {
Comunicazione comunicazione =
comunicazionePersistence.create(counterLocalService.increment(Comunicazione.class.getName()));
Comunicazione comunicazione = comunicazionePersistence.create(counterLocalService.increment(Comunicazione.class
.getName()));
User user = userPersistence.findByPrimaryKey(userId); User user = userPersistence.findByPrimaryKey(userId);
Date now = new Date(); Date now = new Date();
comunicazione.setCompanyId(serviceContext.getCompanyId()); comunicazione.setCompanyId(serviceContext.getCompanyId());
comunicazione.setUserId(user.getUserId()); comunicazione.setUserId(user.getUserId());
comunicazione.setUserName(user.getFullName()); comunicazione.setUserName(user.getFullName());
comunicazione.setCreateDate(serviceContext.getCreateDate(now)); comunicazione.setCreateDate(serviceContext.getCreateDate(now));
comunicazione.setModifiedDate(serviceContext.getModifiedDate(now)); comunicazione.setModifiedDate(serviceContext.getModifiedDate(now));
comunicazione.setGroupId(serviceContext.getScopeGroupId()); comunicazione.setGroupId(serviceContext.getScopeGroupId());
comunicazione.setIntPraticaId(intPraticaId); comunicazione.setIntPraticaId(intPraticaId);
comunicazione.setDomanda(domanda); comunicazione.setDomanda(domanda);
comunicazione = comunicazionePersistence.update(comunicazione); comunicazione = comunicazionePersistence.update(comunicazione);
// Send notification mail for new Comunicazione Mediata // Send notification mail for new Comunicazione Mediata
this.invioAddMailNotifica(comunicazione.getComunicazioneId(), serviceContext); this.invioAddMailNotifica(comunicazione.getComunicazioneId(), serviceContext);
return comunicazione; return comunicazione;
} }
@Override
public Comunicazione updateComunicazione(long comunicazioneId, String risposta) throws SystemException, public Comunicazione updateComunicazione(long comunicazioneId, String risposta) throws SystemException,
PortalException { PortalException {
Comunicazione comunicazione = comunicazionePersistence.fetchByPrimaryKey(comunicazioneId);
Comunicazione comunicazione = comunicazionePersistence.fetchByPrimaryKey(comunicazioneId);
Date now = new Date(); Date now = new Date();
comunicazione.setDtRisposta(now); comunicazione.setDtRisposta(now);
comunicazione.setRisposta(risposta); comunicazione.setRisposta(risposta);
comunicazione = comunicazionePersistence.update(comunicazione); comunicazione = comunicazionePersistence.update(comunicazione);
// resourceLocalService.updateModelResources(comunicazione, serviceContext); // resourceLocalService.updateModelResources(comunicazione, serviceContext);
IntPratica intPratica = intPraticaLocalService.getIntPratica(comunicazione.getIntPraticaId()); IntPratica intPratica = intPraticaLocalService.getIntPratica(comunicazione.getIntPraticaId());
if (WorkflowUtil.isWorkflowDisattivabile(intPratica.getIntPraticaId()) if (WorkflowUtil.isWorkflowDisattivabile(intPratica.getIntPraticaId())
&& Validator.isNotNull(intPratica.getStatusByUserId())) { && Validator.isNotNull(intPratica.getStatusByUserId())) {
this.invioUpdateMailNotifica(comunicazione.getComunicazioneId(), intPratica.getStatusByUserId(), now); this.invioUpdateMailNotifica(comunicazione.getComunicazioneId(), intPratica.getStatusByUserId(), now);
} }
return comunicazione; return comunicazione;
} }
@Override
public List<Comunicazione> findByIntPratica(long intPraticaId) throws SystemException { public List<Comunicazione> findByIntPratica(long intPraticaId) throws SystemException {
return comunicazionePersistence.findByIntPratica(intPraticaId); return comunicazionePersistence.findByIntPratica(intPraticaId);
} }
public List<Comunicazione> findByIntPratica(long intPraticaId, int start, int end, OrderByComparator orderByComparator) @Override
throws SystemException { public List<Comunicazione> findByIntPratica(long intPraticaId, int start, int end,
OrderByComparator orderByComparator) throws SystemException {
return comunicazionePersistence.findByIntPratica(intPraticaId, start, end, orderByComparator); return comunicazionePersistence.findByIntPratica(intPraticaId, start, end, orderByComparator);
} }
@Override
public int countByIntPratica(long intPraticaId) throws SystemException { public int countByIntPratica(long intPraticaId) throws SystemException {
return comunicazionePersistence.countByIntPratica(intPraticaId); return comunicazionePersistence.countByIntPratica(intPraticaId);
} }
@Override
public int countNotAnsweredByIntPratica(long intPraticaId) throws SystemException { public int countNotAnsweredByIntPratica(long intPraticaId) throws SystemException {
DynamicQuery dynamicQuery = dynamicQuery(); DynamicQuery dynamicQuery = dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId));
dynamicQuery.add(RestrictionsFactoryUtil.isNull("dtRisposta")); dynamicQuery.add(RestrictionsFactoryUtil.isNull("dtRisposta"));
return (int) comunicazionePersistence.countWithDynamicQuery(dynamicQuery); return (int) comunicazionePersistence.countWithDynamicQuery(dynamicQuery);
} }
// private void invioMailNotifica(long comunicazioneId, ServiceContext serviceContext) throws
// PortalException,
// SystemException {
//
// Comunicazione comunicazione = comunicazioneLocalService.getComunicazione(comunicazioneId);
//
// IntPratica intPratica = intPraticaLocalService.getIntPratica(comunicazione.getIntPraticaId());
//
// User titolaredigitaleUser = userLocalService.getUser(intPratica.getUserId());
// List<Soggetto> titolari =
// soggettoLocalService.getValidByIntPratica_CodiceFiscale(intPratica.getIntPraticaId(),
// titolaredigitaleUser.getScreenName());
// String eMail = StringPool.BLANK;
// String title = StringPool.BLANK;
// if (!titolari.isEmpty()) {
// Soggetto titolareDigitale = titolari.get(0);
// eMail = titolareDigitale.getEmail();
// title = titolareDigitale.getDescrizioneCompleta();
// }
//
// String[] to = {eMail};
// String[] cc = new String[0];
// String[] ccn = new String[0];
//
// String queryString = "_" + PortletKeys.FASCICOLOFE + "_toolbarItem=view-comunicazioni";
// String url =
// FascicoloURLUtil.getFascicoloFEViewURL(intPratica.getCompanyId(), intPratica.getIntPraticaId(),
// "/html/fascicolofe/view_fascicolo.jsp", queryString);
//
// JSONObject templateVariables = JSONFactoryUtil.createJSONObject();
// templateVariables.put("receiver", title);
// templateVariables.put("praticaNum", intPratica.getNumeroProgetto());
// templateVariables.put("link", url);
//
// MailManagerUtil.sendMailByTemplatName(Comunicazione.class.getName(), comunicazioneId,
// "NUOVA-COMUNICAZIONE", to,
// cc, ccn, templateVariables, null, serviceContext);
// }
private void invioAddMailNotifica(long comunicazioneId, ServiceContext serviceContext) throws PortalException, private void invioAddMailNotifica(long comunicazioneId, ServiceContext serviceContext) throws PortalException,
SystemException { SystemException {
Comunicazione comunicazione = comunicazioneLocalService.getComunicazione(comunicazioneId); Comunicazione comunicazione = comunicazioneLocalService.getComunicazione(comunicazioneId);
IntPratica intPratica = intPraticaLocalService.getIntPratica(comunicazione.getIntPraticaId()); IntPratica intPratica = intPraticaLocalService.getIntPratica(comunicazione.getIntPraticaId());
User titolaredigitaleUser = userLocalService.getUser(intPratica.getUserId()); User titolaredigitaleUser = userLocalService.getUser(intPratica.getUserId());
List<Soggetto> titolari = List<Soggetto> titolari = soggettoLocalService.getValidByIntPratica_CodiceFiscale(intPratica.getIntPraticaId(),
soggettoLocalService.getValidByIntPratica_CodiceFiscale(intPratica.getIntPraticaId(),
titolaredigitaleUser.getScreenName()); titolaredigitaleUser.getScreenName());
String eMail = StringPool.BLANK; String eMail = StringPool.BLANK;
String receiver = StringPool.BLANK; String receiver = StringPool.BLANK;
@ -193,35 +145,27 @@ public class ComunicazioneLocalServiceImpl extends ComunicazioneLocalServiceBase
eMail = titolareDigitale.getEmail(); eMail = titolareDigitale.getEmail();
receiver = titolareDigitale.getDescrizioneCompleta(); receiver = titolareDigitale.getDescrizioneCompleta();
} }
String[] to = { eMail };
String[] to = {eMail};
String[] cc = new String[0]; String[] cc = new String[0];
String[] ccn = new String[0]; String[] ccn = new String[0];
String queryString = "_" + PortletKeys.FASCICOLOFE + "_toolbarItem=view-comunicazioni"; String queryString = "_" + PortletKeys.FASCICOLOFE + "_toolbarItem=view-comunicazioni";
String url = String url = FascicoloURLUtil.getFascicoloFEViewURL(intPratica.getCompanyId(), intPratica.getIntPraticaId(),
FascicoloURLUtil.getFascicoloFEViewURL(intPratica.getCompanyId(), intPratica.getIntPraticaId(),
"/html/fascicolofe/view_fascicolo.jsp", queryString); "/html/fascicolofe/view_fascicolo.jsp", queryString);
JSONObject templateVariable = JSONFactoryUtil.createJSONObject(); JSONObject templateVariable = JSONFactoryUtil.createJSONObject();
templateVariable.put("receiver", receiver); templateVariable.put("receiver", receiver);
templateVariable.put("link", url); templateVariable.put("link", url);
MailUtil.invioMailNotifica(comunicazione.getIntPraticaId(), 0l, comunicazioneId, Comunicazione.class.getName(),
MailUtil.invioMailNotifica(comunicazione.getIntPraticaId(), 0l, comunicazioneId, Comunicazione.class.getName(), to, to, cc, ccn, "INVIO-RICHIESTA-ASSEVERAZIONE", templateVariable, null, serviceContext);
cc, ccn, "INVIO-RICHIESTA-ASSEVERAZIONE", templateVariable, null, serviceContext);
} }
private void invioUpdateMailNotifica(long comunicazioneId, long tecnicoIstruttoreId, Date date) private void invioUpdateMailNotifica(long comunicazioneId, long tecnicoIstruttoreId, Date date)
throws PortalException, SystemException { throws PortalException, SystemException {
Comunicazione comunicazione = comunicazioneLocalService.getComunicazione(comunicazioneId); Comunicazione comunicazione = comunicazioneLocalService.getComunicazione(comunicazioneId);
User tecnicoIstruttore = userLocalService.getUser(tecnicoIstruttoreId); User tecnicoIstruttore = userLocalService.getUser(tecnicoIstruttoreId);
String[] to = { tecnicoIstruttore.getEmailAddress() };
String[] to = {tecnicoIstruttore.getEmailAddress()};
String[] cc = new String[0]; String[] cc = new String[0];
String[] ccn = new String[0]; String[] ccn = new String[0];
String tipoPratica = StringPool.BLANK; String tipoPratica = StringPool.BLANK;
long intPraticaId = comunicazione.getIntPraticaId(); long intPraticaId = comunicazione.getIntPraticaId();
if (AzioniPraticheUtil.isDeposito(intPraticaId)) { if (AzioniPraticheUtil.isDeposito(intPraticaId)) {
@ -229,20 +173,17 @@ public class ComunicazioneLocalServiceImpl extends ComunicazioneLocalServiceBase
} else if (AzioniPraticheUtil.isAutorizzazione(intPraticaId)) { } else if (AzioniPraticheUtil.isAutorizzazione(intPraticaId)) {
tipoPratica = LanguageUtil.get(LocaleUtil.ITALIAN, "tipo-pratica-02"); tipoPratica = LanguageUtil.get(LocaleUtil.ITALIAN, "tipo-pratica-02");
} }
JSONObject templateVariables = JSONFactoryUtil.createJSONObject(); JSONObject templateVariables = JSONFactoryUtil.createJSONObject();
templateVariables.put("receiver", tecnicoIstruttore.getFullName()); templateVariables.put("receiver", tecnicoIstruttore.getFullName());
templateVariables.put("tipoPratica", tipoPratica); templateVariables.put("tipoPratica", tipoPratica);
templateVariables.put("tipoOggetto", LanguageUtil.get(LocaleUtil.ITALIAN, "label.comunicazione.mediata")); templateVariables.put("tipoOggetto", LanguageUtil.get(LocaleUtil.ITALIAN, "label.comunicazione.mediata"));
templateVariables.put("dataInvio", FastDateFormatFactoryUtil.getSimpleDateFormat("dd/MM/yyyy HH:mm").format(date)); templateVariables.put("dataInvio",
FastDateFormatFactoryUtil.getSimpleDateFormat("dd/MM/yyyy HH:mm").format(date));
ServiceContext serviceContext = new ServiceContext(); ServiceContext serviceContext = new ServiceContext();
serviceContext.setScopeGroupId(comunicazione.getGroupId()); serviceContext.setScopeGroupId(comunicazione.getGroupId());
serviceContext.setCompanyId(comunicazione.getCompanyId()); serviceContext.setCompanyId(comunicazione.getCompanyId());
serviceContext.setUserId(comunicazione.getUserId()); serviceContext.setUserId(comunicazione.getUserId());
MailUtil.invioMailNotifica(comunicazione.getIntPraticaId(), 0l, comunicazioneId, Comunicazione.class.getName(),
MailUtil.invioMailNotifica(comunicazione.getIntPraticaId(), 0l, comunicazioneId, Comunicazione.class.getName(), to, to, cc, ccn, "NOTIFICA-BO", templateVariables, null, serviceContext);
cc, ccn, "NOTIFICA-BO", templateVariables, null, serviceContext);
} }
} }

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

@ -1,13 +1,13 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * 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 * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* GNU Lesser General Public License as published by the Free Software Foundation; either version * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* 2.1 of the License, or (at your option) any later version. * any later version.
* *
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* Lesser General Public License for more details. * details.
*/ */
package it.tref.liferay.portos.bo.service.impl; package it.tref.liferay.portos.bo.service.impl;
@ -29,15 +29,12 @@ import com.liferay.portal.service.ServiceContext;
* The implementation of the configurazione local service. * The implementation of the configurazione local service.
* *
* <p> * <p>
* All custom service methods should be put in this class. Whenever methods are * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy
* added, rerun ServiceBuilder to copy their definitions into the * their definitions into the {@link it.tref.liferay.portos.bo.service.ConfigurazioneLocalService} interface.
* {@link it.tref.liferay.portos.bo.service.ConfigurazioneLocalService}
* interface.
* *
* <p> * <p>
* This is a local service. Methods of this service will not have security * This is a local service. Methods of this service will not have security checks based on the propagated JAAS
* checks based on the propagated JAAS credentials because this service can only * credentials because this service can only be accessed from within the same VM.
* be accessed from within the same VM.
* </p> * </p>
* *
* @author Davide Barbagallo, 3F Consulting * @author Davide Barbagallo, 3F Consulting
@ -46,12 +43,12 @@ import com.liferay.portal.service.ServiceContext;
*/ */
public class ConfigurazioneLocalServiceImpl extends ConfigurazioneLocalServiceBaseImpl { public class ConfigurazioneLocalServiceImpl extends ConfigurazioneLocalServiceBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: Never reference this interface directly. Always use * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link
* {@link it.tref.liferay.portos.bo.service.ConfigurazioneLocalServiceUtil} * it.tref.liferay.portos.bo.service.ConfigurazioneLocalServiceUtil} to access the configurazione local service.
* to access the configurazione local service.
*/ */
private static final Log _log = LogFactoryUtil.getLog(ConfigurazioneLocalServiceImpl.class); private static final Log _log = LogFactoryUtil.getLog(ConfigurazioneLocalServiceImpl.class);
@Override
public long findByC_ChiaveLong(long companyId, String chiave) throws SystemException { public long findByC_ChiaveLong(long companyId, String chiave) throws SystemException {
try { try {
@ -65,6 +62,7 @@ public class ConfigurazioneLocalServiceImpl extends ConfigurazioneLocalServiceBa
} }
} }
@Override
public String findByC_ChiaveString(long companyId, String chiave) throws SystemException { public String findByC_ChiaveString(long companyId, String chiave) throws SystemException {
Configurazione configurazione = configurazionePersistence.fetchByC_Chiave(companyId, chiave); Configurazione configurazione = configurazionePersistence.fetchByC_Chiave(companyId, chiave);
@ -76,6 +74,7 @@ public class ConfigurazioneLocalServiceImpl extends ConfigurazioneLocalServiceBa
return configurazione.getValore(); return configurazione.getValore();
} }
@Override
public Configurazione storeConfig(String chiave, String valore, ServiceContext serviceContext) public Configurazione storeConfig(String chiave, String valore, ServiceContext serviceContext)
throws SystemException, PortalException { throws SystemException, PortalException {
@ -85,8 +84,7 @@ public class ConfigurazioneLocalServiceImpl extends ConfigurazioneLocalServiceBa
} catch (NoSuchConfigurazioneException e) { } catch (NoSuchConfigurazioneException e) {
} }
if (configurazione == null) { if (configurazione == null) {
configurazione = createConfigurazione(counterLocalService.increment(Configurazione.class configurazione = createConfigurazione(counterLocalService.increment(Configurazione.class.getName()));
.getName()));
configurazione.setChiave(chiave); configurazione.setChiave(chiave);
configurazione.setCompanyId(serviceContext.getCompanyId()); configurazione.setCompanyId(serviceContext.getCompanyId());
configurazione.setCreateDate(new Date()); configurazione.setCreateDate(new Date());
@ -98,6 +96,7 @@ public class ConfigurazioneLocalServiceImpl extends ConfigurazioneLocalServiceBa
return configurazioneLocalService.updateConfigurazione(configurazione); return configurazioneLocalService.updateConfigurazione(configurazione);
} }
@Override
public long getAndIncrement(long companyId, String chiave) throws SystemException { public long getAndIncrement(long companyId, String chiave) throws SystemException {
try { try {
@ -107,16 +106,16 @@ public class ConfigurazioneLocalServiceImpl extends ConfigurazioneLocalServiceBa
configurazioneLocalService.updateConfigurazione(configurazione); configurazioneLocalService.updateConfigurazione(configurazione);
return current; return current;
} catch (NoSuchConfigurazioneException e) { } catch (NoSuchConfigurazioneException e) {
Configurazione configurazione = createConfigurazione(counterLocalService Configurazione configurazione = createConfigurazione(counterLocalService.increment(Configurazione.class
.increment(Configurazione.class.getName())); .getName()));
configurazione.setChiave(chiave); configurazione.setChiave(chiave);
configurazione.setCompanyId(companyId); configurazione.setCompanyId(companyId);
configurazione.setCreateDate(new Date()); configurazione.setCreateDate(new Date());
configurazione.setGroupId(-1); configurazione.setGroupId(-1);
configurazione.setUserId(0l); configurazione.setUserId(0L);
configurazione.setValore("2"); configurazione.setValore("2");
configurazioneLocalService.updateConfigurazione(configurazione); configurazioneLocalService.updateConfigurazione(configurazione);
return 1l; return 1L;
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
_log.error("error", e); _log.error("error", e);
throw new SystemException("Errore imprevisto", e); throw new SystemException("Errore imprevisto", e);

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

@ -113,36 +113,25 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi
SystemException { SystemException {
User user = userPersistence.findByPrimaryKey(userId); User user = userPersistence.findByPrimaryKey(userId);
// In creazione del sito viene avviato il workflow sul sito principale // In creazione del sito viene avviato il workflow sul sito principale mentre in update di una issue viene
// mentre in update di una // avviato sul sito specifico per ovviare a bug
// issue viene avviato
// sul sito specifico per ovviare a bug
// long groupId = serviceContext.getScopeGroupId();
Date now = new Date(); Date now = new Date();
long controlloPraticaId = counterLocalService.increment(ControlloPratica.class.getName()); long controlloPraticaId = counterLocalService.increment(ControlloPratica.class.getName());
ControlloPratica entry = controlloPraticaPersistence.create(controlloPraticaId); ControlloPratica entry = controlloPraticaPersistence.create(controlloPraticaId);
entry.setCompanyId(user.getCompanyId()); entry.setCompanyId(user.getCompanyId());
entry.setUserId(user.getUserId()); entry.setUserId(user.getUserId());
entry.setUserName(user.getFullName()); entry.setUserName(user.getFullName());
_log.info("User Full Name: " + user.getFullName()); _log.info("User Full Name: " + user.getFullName());
entry.setCreateDate(serviceContext.getCreateDate(now)); entry.setCreateDate(serviceContext.getCreateDate(now));
entry.setModifiedDate(serviceContext.getModifiedDate(now)); entry.setModifiedDate(serviceContext.getModifiedDate(now));
entry.setGroupId(groupId); entry.setGroupId(groupId);
entry.setIntPraticaId(intPraticaId); entry.setIntPraticaId(intPraticaId);
entry.setDettPraticaId(dettPraticaId); entry.setDettPraticaId(dettPraticaId);
// Workflow // Workflow
entry.setStatus(WorkflowConstants.STATUS_DRAFT); entry.setStatus(WorkflowConstants.STATUS_DRAFT);
controlloPraticaPersistence.update(entry); controlloPraticaPersistence.update(entry);
// Resources // Resources
resourceLocalService.addModelResources(entry, serviceContext); resourceLocalService.addModelResources(entry, serviceContext);
// aggiorno int e dett pratica per avvio workflow // aggiorno int e dett pratica per avvio workflow
IntPratica intPratica = intPraticaLocalService.updateStatoPratica(intPraticaId, IntPratica intPratica = intPraticaLocalService.updateStatoPratica(intPraticaId,
StatoPraticaConstants.SOTTOPOSTA_A_PARERE); StatoPraticaConstants.SOTTOPOSTA_A_PARERE);
@ -150,11 +139,9 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi
intPratica.setControlloObbligatorio(true); intPratica.setControlloObbligatorio(true);
intPratica = intPraticaLocalService.updateIntPratica(intPratica); intPratica = intPraticaLocalService.updateIntPratica(intPratica);
} }
// Asset // Asset
updateAsset(userId, entry, serviceContext.getAssetCategoryIds(), serviceContext.getAssetTagNames(), updateAsset(userId, entry, serviceContext.getAssetCategoryIds(), serviceContext.getAssetTagNames(),
serviceContext.getAssetLinkEntryIds(), now); serviceContext.getAssetLinkEntryIds(), now);
// ADT: BUG BO GESTIONE WORKFLOW // ADT: BUG BO GESTIONE WORKFLOW
Map<String, Serializable> wfContextMap = new HashMap<String, Serializable>(); Map<String, Serializable> wfContextMap = new HashMap<String, Serializable>();
DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(dettPraticaId); DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(dettPraticaId);
@ -162,21 +149,17 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi
wfContextMap.put("wf_variante", "OK"); wfContextMap.put("wf_variante", "OK");
} }
// /////////// // ///////////
// Workflow // Workflow
WorkflowHandlerRegistryUtil.startWorkflowInstance(entry.getCompanyId(), entry.getGroupId(), entry.getUserId(), WorkflowHandlerRegistryUtil.startWorkflowInstance(entry.getCompanyId(), entry.getGroupId(), entry.getUserId(),
ControlloPratica.class.getName(), entry.getPrimaryKey(), entry, serviceContext, wfContextMap); ControlloPratica.class.getName(), entry.getPrimaryKey(), entry, serviceContext, wfContextMap);
Date dtInvio = null; Date dtInvio = null;
if (intPratica.getDtSorteggio() != null) { if (intPratica.getDtSorteggio() != null) {
dtInvio = intPratica.getDtSorteggio(); dtInvio = intPratica.getDtSorteggio();
} else { } else {
dtInvio = entry.getCreateDate(); dtInvio = entry.getCreateDate();
} }
TempisticaLocalServiceUtil.addTempistica(intPraticaId, dettPraticaId, TempisticaConstants.TIPO_PRATICA, TempisticaLocalServiceUtil.addTempistica(intPraticaId, dettPraticaId, TempisticaConstants.TIPO_PRATICA,
dtInvio, serviceContext); dtInvio, serviceContext);
return entry; return entry;
} }

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

@ -1,13 +1,13 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * 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 * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* GNU Lesser General Public License as published by the Free Software Foundation; either version * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* 2.1 of the License, or (at your option) any later version. * any later version.
* *
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* Lesser General Public License for more details. * details.
*/ */
package it.tref.liferay.portos.bo.service.impl; package it.tref.liferay.portos.bo.service.impl;
@ -55,14 +55,12 @@ import com.liferay.portlet.documentlibrary.service.DLFolderLocalServiceUtil;
* The implementation of the delega local service. * The implementation of the delega local service.
* *
* <p> * <p>
* All custom service methods should be put in this class. Whenever methods are * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy
* added, rerun ServiceBuilder to copy their definitions into the * their definitions into the {@link it.tref.liferay.portos.bo.service.DelegaLocalService} interface.
* {@link it.tref.liferay.portos.bo.service.DelegaLocalService} interface.
* *
* <p> * <p>
* This is a local service. Methods of this service will not have security * This is a local service. Methods of this service will not have security checks based on the propagated JAAS
* checks based on the propagated JAAS credentials because this service can only * credentials because this service can only be accessed from within the same VM.
* be accessed from within the same VM.
* </p> * </p>
* *
* @author Davide Barbagallo, 3F Consulting * @author Davide Barbagallo, 3F Consulting
@ -71,42 +69,31 @@ import com.liferay.portlet.documentlibrary.service.DLFolderLocalServiceUtil;
*/ */
public class DelegaLocalServiceImpl extends DelegaLocalServiceBaseImpl { public class DelegaLocalServiceImpl extends DelegaLocalServiceBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link
* * it.tref.liferay.portos.bo.service.DelegaLocalServiceUtil} to access the delega local service.
* Never reference this interface directly. Always use {@link
* it.tref.liferay.portos.bo.service.DelegaLocalServiceUtil} to access the
* delega local service.
*/ */
private Log _log = LogFactoryUtil.getLog(DelegaLocalServiceImpl.class); private Log _log = LogFactoryUtil.getLog(DelegaLocalServiceImpl.class);
@Override @Override
public Delega addDelega(long userId, long intPraticaId, long dettPraticaId, String tipologia, public Delega addDelega(long userId, long intPraticaId, long dettPraticaId, String tipologia, String codiceFiscale,
String codiceFiscale, ServiceContext serviceContext) throws PortalException, SystemException { ServiceContext serviceContext) throws PortalException, SystemException {
User user = userPersistence.findByPrimaryKey(userId); User user = userPersistence.findByPrimaryKey(userId);
Date now = new Date(); Date now = new Date();
validate(tipologia, codiceFiscale);
Delega delega = delegaPersistence.create(counterLocalService.increment(Delega.class.getName())); Delega delega = delegaPersistence.create(counterLocalService.increment(Delega.class.getName()));
delega.setCompanyId(serviceContext.getCompanyId()); delega.setCompanyId(serviceContext.getCompanyId());
delega.setUserId(user.getUserId()); delega.setUserId(user.getUserId());
delega.setUserName(user.getFullName()); delega.setUserName(user.getFullName());
delega.setCreateDate(serviceContext.getCreateDate(now)); delega.setCreateDate(serviceContext.getCreateDate(now));
delega.setModifiedDate(serviceContext.getModifiedDate(now)); delega.setModifiedDate(serviceContext.getModifiedDate(now));
delega.setGroupId(serviceContext.getScopeGroupId()); delega.setGroupId(serviceContext.getScopeGroupId());
delega.setIntPraticaId(intPraticaId); delega.setIntPraticaId(intPraticaId);
delega.setDettPraticaId(dettPraticaId); delega.setDettPraticaId(dettPraticaId);
delega.setTipologia(tipologia); delega.setTipologia(tipologia);
delega.setEsito(DelegheUtil.STATO_ASSEGNATA); delega.setEsito(DelegheUtil.STATO_ASSEGNATA);
delega.setCodiceFiscale(codiceFiscale); delega.setCodiceFiscale(codiceFiscale);
delega = delegaPersistence.update(delega); delega = delegaPersistence.update(delega);
return delega; return delega;
} }
@ -126,6 +113,7 @@ public class DelegaLocalServiceImpl extends DelegaLocalServiceBaseImpl {
@Override @Override
public void concludiDeleghePagamento(long dettPraticaId) throws PortalException, SystemException { public void concludiDeleghePagamento(long dettPraticaId) throws PortalException, SystemException {
List<Delega> deleghe = this.findByDettPratica_Tipologia_InEsito(dettPraticaId, List<Delega> deleghe = this.findByDettPratica_Tipologia_InEsito(dettPraticaId,
new String[] { DelegheUtil.TIPO_PAGAMENTO }, new String[] { DelegheUtil.STATO_ASSEGNATA }); new String[] { DelegheUtil.TIPO_PAGAMENTO }, new String[] { DelegheUtil.STATO_ASSEGNATA });
for (Delega delega : deleghe) { for (Delega delega : deleghe) {
@ -146,115 +134,120 @@ public class DelegaLocalServiceImpl extends DelegaLocalServiceBaseImpl {
return deleteDelega(delega); return deleteDelega(delega);
} }
private void validate(String tipologia, String codiceFiscale) throws PortalException, SystemException {
// TODO Write your own validation code
}
@Override @Override
public List<Delega> findByIntPratica(long intPraticaId, int start, int end, public List<Delega> findByIntPratica(long intPraticaId, int start, int end, OrderByComparator orderByComparator)
OrderByComparator orderByComparator) throws SystemException { throws SystemException {
return delegaPersistence.findByIntPratica(intPraticaId, start, end, orderByComparator); return delegaPersistence.findByIntPratica(intPraticaId, start, end, orderByComparator);
} }
@Override @Override
public List<Delega> findByDettPratica(long dettPraticaId, int start, int end, public List<Delega> findByDettPratica(long dettPraticaId, int start, int end, OrderByComparator orderByComparator)
OrderByComparator orderByComparator) throws SystemException { throws SystemException {
return delegaPersistence.findByDettPratica(dettPraticaId, start, end, orderByComparator); return delegaPersistence.findByDettPratica(dettPraticaId, start, end, orderByComparator);
} }
@Override @Override
public int countByIntPratica(long intPraticaId) throws SystemException { public int countByIntPratica(long intPraticaId) throws SystemException {
return delegaPersistence.countByIntPratica(intPraticaId); return delegaPersistence.countByIntPratica(intPraticaId);
} }
@Override @Override
public int countByDettPratica(long dettPraticaId) throws SystemException { public int countByDettPratica(long dettPraticaId) throws SystemException {
return delegaPersistence.countByIntPratica(dettPraticaId); return delegaPersistence.countByIntPratica(dettPraticaId);
} }
@Override @Override
public List<Delega> findByIntPratica_CodiceFiscale(long intPraticaId, String codiceFiscale, int start, public List<Delega> findByIntPratica_CodiceFiscale(long intPraticaId, String codiceFiscale, int start, int end,
int end, OrderByComparator orderByComparator) throws SystemException { OrderByComparator orderByComparator) throws SystemException {
return delegaPersistence.findByIntPratica_CodiceFiscale(intPraticaId, codiceFiscale, start, end, return delegaPersistence.findByIntPratica_CodiceFiscale(intPraticaId, codiceFiscale, start, end,
orderByComparator); orderByComparator);
} }
@Override @Override
public List<Delega> findByCodiceFiscale(String codiceFiscale) throws SystemException { public List<Delega> findByCodiceFiscale(String codiceFiscale) throws SystemException {
return delegaPersistence.findByCodiceFiscale(codiceFiscale); return delegaPersistence.findByCodiceFiscale(codiceFiscale);
} }
@Override @Override
public int countByIntPratica_CodiceFiscale(long intPraticaId, String codiceFiscale) public int countByIntPratica_CodiceFiscale(long intPraticaId, String codiceFiscale) throws SystemException {
throws SystemException {
return delegaPersistence.countByIntPratica_CodiceFiscale(intPraticaId, codiceFiscale); return delegaPersistence.countByIntPratica_CodiceFiscale(intPraticaId, codiceFiscale);
} }
@Override @Override
public List<Delega> findByCodiceFiscale_InEsito(String codiceFiscale, String[] esiti, int start, int end, public List<Delega> findByCodiceFiscale_InEsito(String codiceFiscale, String[] esiti, int start, int end,
OrderByComparator orderByComparator) throws SystemException { OrderByComparator orderByComparator) throws SystemException {
return delegaPersistence.findByCodiceFiscale_InEsito(codiceFiscale, esiti, start, end,
orderByComparator); return delegaPersistence.findByCodiceFiscale_InEsito(codiceFiscale, esiti, start, end, orderByComparator);
} }
@Override @Override
public int countByCodiceFiscale_InEsito(String codiceFiscale, String[] esiti) throws SystemException { public int countByCodiceFiscale_InEsito(String codiceFiscale, String[] esiti) throws SystemException {
return delegaPersistence.countByCodiceFiscale_InEsito(codiceFiscale, esiti); return delegaPersistence.countByCodiceFiscale_InEsito(codiceFiscale, esiti);
} }
@Override @Override
public List<Delega> findByIntPratica_CodiceFiscale_InEsito(long intPraticaId, String codiceFiscale, public List<Delega> findByIntPratica_CodiceFiscale_InEsito(long intPraticaId, String codiceFiscale, String[] esiti,
String[] esiti, int start, int end, OrderByComparator orderByComparator) throws SystemException { int start, int end, OrderByComparator orderByComparator) throws SystemException {
return delegaPersistence.findByIntPratica_CodiceFiscale_InEsito(intPraticaId, codiceFiscale, esiti,
start, end, orderByComparator); return delegaPersistence.findByIntPratica_CodiceFiscale_InEsito(intPraticaId, codiceFiscale, esiti, start, end,
orderByComparator);
} }
@Override @Override
public int countByIntPratica_CodiceFiscale_InEsito(long intPraticaId, String codiceFiscale, String[] esiti) public int countByIntPratica_CodiceFiscale_InEsito(long intPraticaId, String codiceFiscale, String[] esiti)
throws SystemException { throws SystemException {
return delegaPersistence.countByIntPratica_CodiceFiscale_InEsito(intPraticaId, codiceFiscale, esiti); return delegaPersistence.countByIntPratica_CodiceFiscale_InEsito(intPraticaId, codiceFiscale, esiti);
} }
@Override @Override
public List<Delega> findByDettPratica_CodiceFiscale_InEsito(long dettPraticaId, String codiceFiscale, public List<Delega> findByDettPratica_CodiceFiscale_InEsito(long dettPraticaId, String codiceFiscale,
String[] esiti, int start, int end, OrderByComparator orderByComparator) throws SystemException { String[] esiti, int start, int end, OrderByComparator orderByComparator) throws SystemException {
return delegaPersistence.findByDettPratica_CodiceFiscale_InEsito(dettPraticaId, codiceFiscale, esiti,
start, end, orderByComparator); return delegaPersistence.findByDettPratica_CodiceFiscale_InEsito(dettPraticaId, codiceFiscale, esiti, start,
end, orderByComparator);
} }
@Override @Override
public int countByDettPratica_CodiceFiscale_InEsito(long dettPraticaId, String codiceFiscale, public int countByDettPratica_CodiceFiscale_InEsito(long dettPraticaId, String codiceFiscale, String[] esiti)
String[] esiti) throws SystemException { throws SystemException {
return delegaPersistence
.countByDettPratica_CodiceFiscale_InEsito(dettPraticaId, codiceFiscale, esiti); return delegaPersistence.countByDettPratica_CodiceFiscale_InEsito(dettPraticaId, codiceFiscale, esiti);
} }
@Override @Override
public List<Delega> findByIntPratica_InEsito(long intPraticaId, String[] esiti, int start, int end, public List<Delega> findByIntPratica_InEsito(long intPraticaId, String[] esiti, int start, int end,
OrderByComparator orderByComparator) throws SystemException { OrderByComparator orderByComparator) throws SystemException {
return delegaPersistence.findByIntPratica_InEsito(intPraticaId, esiti, start, end, orderByComparator); return delegaPersistence.findByIntPratica_InEsito(intPraticaId, esiti, start, end, orderByComparator);
} }
@Override @Override
public int countByIntPratica_InEsito(long intPraticaId, String[] esiti) throws SystemException { public int countByIntPratica_InEsito(long intPraticaId, String[] esiti) throws SystemException {
return delegaPersistence.countByIntPratica_InEsito(intPraticaId, esiti); return delegaPersistence.countByIntPratica_InEsito(intPraticaId, esiti);
} }
@Override @Override
public List<Delega> findByDettPratica_InEsito(long dettPraticaId, String[] esiti, int start, int end, public List<Delega> findByDettPratica_InEsito(long dettPraticaId, String[] esiti, int start, int end,
OrderByComparator orderByComparator) throws SystemException { OrderByComparator orderByComparator) throws SystemException {
return delegaPersistence.findByDettPratica_InEsito(dettPraticaId, esiti, start, end,
orderByComparator); return delegaPersistence.findByDettPratica_InEsito(dettPraticaId, esiti, start, end, orderByComparator);
} }
@Override @Override
public List<String> findCfByDettPratica_InEsito(long dettPraticaId, String[] esiti) public List<String> findCfByDettPratica_InEsito(long dettPraticaId, String[] esiti) throws SystemException {
throws SystemException {
DynamicQuery dynamicQuery = createQueryByDettPratica_InEsito(dettPraticaId, esiti); DynamicQuery dynamicQuery = createQueryByDettPratica_InEsito(dettPraticaId, esiti);
dynamicQuery.setProjection(ProjectionFactoryUtil.distinct(ProjectionFactoryUtil dynamicQuery.setProjection(ProjectionFactoryUtil.distinct(ProjectionFactoryUtil.property("codiceFiscale")));
.property("codiceFiscale")));
return delegaPersistence.findWithDynamicQuery(dynamicQuery); return delegaPersistence.findWithDynamicQuery(dynamicQuery);
} }
@ -262,148 +255,148 @@ public class DelegaLocalServiceImpl extends DelegaLocalServiceBaseImpl {
public List<Delega> findByDettPratica_InEsito(long dettPraticaId, String[] esiti) throws SystemException { public List<Delega> findByDettPratica_InEsito(long dettPraticaId, String[] esiti) throws SystemException {
DynamicQuery dynamicQuery = createQueryByDettPratica_InEsito(dettPraticaId, esiti); DynamicQuery dynamicQuery = createQueryByDettPratica_InEsito(dettPraticaId, esiti);
return delegaPersistence.findWithDynamicQuery(dynamicQuery); return delegaPersistence.findWithDynamicQuery(dynamicQuery);
} }
@Override @Override
public List<String> findCfByDettPratica_Tipologia_InEsito(long dettPraticaId, String[] tipologie, public List<String> findCfByDettPratica_Tipologia_InEsito(long dettPraticaId, String[] tipologie, String[] esiti)
String[] esiti) throws SystemException { throws SystemException {
DynamicQuery dynamicQuery = createQueryByDettPratica_InEsito(dettPraticaId, esiti); DynamicQuery dynamicQuery = createQueryByDettPratica_InEsito(dettPraticaId, esiti);
dynamicQuery.add(RestrictionsFactoryUtil.in("tipologia", tipologie)); dynamicQuery.add(RestrictionsFactoryUtil.in("tipologia", tipologie));
dynamicQuery.setProjection(ProjectionFactoryUtil.distinct(ProjectionFactoryUtil dynamicQuery.setProjection(ProjectionFactoryUtil.distinct(ProjectionFactoryUtil.property("codiceFiscale")));
.property("codiceFiscale")));
return delegaPersistence.findWithDynamicQuery(dynamicQuery); return delegaPersistence.findWithDynamicQuery(dynamicQuery);
} }
@Override @Override
public List<Delega> findByDettPratica_Tipologia_InEsito(long dettPraticaId, String[] tipologie, public List<Delega> findByDettPratica_Tipologia_InEsito(long dettPraticaId, String[] tipologie, String[] esiti)
String[] esiti) throws SystemException { throws SystemException {
DynamicQuery dynamicQuery = createQueryByDettPratica_InEsito(dettPraticaId, esiti); DynamicQuery dynamicQuery = createQueryByDettPratica_InEsito(dettPraticaId, esiti);
dynamicQuery.add(RestrictionsFactoryUtil.in("tipologia", tipologie)); dynamicQuery.add(RestrictionsFactoryUtil.in("tipologia", tipologie));
return delegaPersistence.findWithDynamicQuery(dynamicQuery); return delegaPersistence.findWithDynamicQuery(dynamicQuery);
} }
private DynamicQuery createQueryByDettPratica_InEsito(long dettPraticaId, String[] esiti) { private DynamicQuery createQueryByDettPratica_InEsito(long dettPraticaId, String[] esiti) {
DynamicQuery dynamicQuery = dynamicQuery(); DynamicQuery dynamicQuery = dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.eq("dettPraticaId", dettPraticaId)); dynamicQuery.add(RestrictionsFactoryUtil.eq("dettPraticaId", dettPraticaId));
dynamicQuery.add(RestrictionsFactoryUtil.in("esito", esiti)); dynamicQuery.add(RestrictionsFactoryUtil.in("esito", esiti));
return dynamicQuery; return dynamicQuery;
} }
@Override @Override
public int countByDettPratica_InEsito(long dettPraticaId, String[] esiti) throws SystemException { public int countByDettPratica_InEsito(long dettPraticaId, String[] esiti) throws SystemException {
return delegaPersistence.countByDettPratica_InEsito(dettPraticaId, esiti); return delegaPersistence.countByDettPratica_InEsito(dettPraticaId, esiti);
} }
@Override @Override
public List<Delega> findByCodiceFiscale_Tipologia_InEsito(String codiceFiscale, String tipologia, public List<Delega> findByCodiceFiscale_Tipologia_InEsito(String codiceFiscale, String tipologia, String[] esiti,
String[] esiti, int start, int end, OrderByComparator orderByComparator) throws SystemException { int start, int end, OrderByComparator orderByComparator) throws SystemException {
return delegaPersistence.findByCodiceFiscale_Tipologia_InEsito(codiceFiscale, tipologia, esiti,
start, end, orderByComparator); return delegaPersistence.findByCodiceFiscale_Tipologia_InEsito(codiceFiscale, tipologia, esiti, start, end,
orderByComparator);
} }
@Override @Override
public int countByCodiceFiscale_Tipologia_InEsito(String codiceFiscale, String tipologia, String[] esiti) public int countByCodiceFiscale_Tipologia_InEsito(String codiceFiscale, String tipologia, String[] esiti)
throws SystemException { throws SystemException {
return delegaPersistence.countByCodiceFiscale_Tipologia_InEsito(codiceFiscale, tipologia, esiti); return delegaPersistence.countByCodiceFiscale_Tipologia_InEsito(codiceFiscale, tipologia, esiti);
} }
@Override @Override
public List<Delega> findByIntPratica_CodiceFiscale_Tipologia_InEsito(long intPraticaId, public List<Delega> findByIntPratica_CodiceFiscale_Tipologia_InEsito(long intPraticaId, String codiceFiscale,
String codiceFiscale, String tipologia, String[] esiti, int start, int end, String tipologia, String[] esiti, int start, int end, OrderByComparator orderByComparator)
OrderByComparator orderByComparator) throws SystemException { throws SystemException {
return delegaPersistence.findByIntPratica_CodiceFiscale_Tipologia_InEsito(intPraticaId,
codiceFiscale, tipologia, esiti, start, end, orderByComparator); return delegaPersistence.findByIntPratica_CodiceFiscale_Tipologia_InEsito(intPraticaId, codiceFiscale,
tipologia, esiti, start, end, orderByComparator);
} }
@Override @Override
public int countByIntPratica_CodiceFiscale_Tipologia_InEsito(long intPraticaId, String codiceFiscale, public int countByIntPratica_CodiceFiscale_Tipologia_InEsito(long intPraticaId, String codiceFiscale,
String tipologia, String[] esiti) throws SystemException { String tipologia, String[] esiti) throws SystemException {
return delegaPersistence.countByIntPratica_CodiceFiscale_Tipologia_InEsito(intPraticaId,
codiceFiscale, tipologia, esiti); return delegaPersistence.countByIntPratica_CodiceFiscale_Tipologia_InEsito(intPraticaId, codiceFiscale,
tipologia, esiti);
} }
@Override @Override
public List<Delega> findByDettPratica_CodiceFiscale_Tipologia_InEsito(long dettPraticaId, public List<Delega> findByDettPratica_CodiceFiscale_Tipologia_InEsito(long dettPraticaId, String codiceFiscale,
String codiceFiscale, String[] tipologie, String[] esiti, int start, int end, String[] tipologie, String[] esiti, int start, int end, OrderByComparator orderByComparator)
OrderByComparator orderByComparator) throws SystemException { throws SystemException {
return delegaPersistence.findByDettPratica_CodiceFiscale_Tipologia_InEsito(dettPraticaId,
codiceFiscale, tipologie, esiti, start, end, orderByComparator); return delegaPersistence.findByDettPratica_CodiceFiscale_Tipologia_InEsito(dettPraticaId, codiceFiscale,
tipologie, esiti, start, end, orderByComparator);
} }
@Override @Override
public int countByDettPratica_CodiceFiscale_Tipologia_InEsito(long dettPraticaId, String codiceFiscale, public int countByDettPratica_CodiceFiscale_Tipologia_InEsito(long dettPraticaId, String codiceFiscale,
String[] tipologie, String[] esiti) throws SystemException { String[] tipologie, String[] esiti) throws SystemException {
return delegaPersistence.countByDettPratica_CodiceFiscale_Tipologia_InEsito(dettPraticaId,
codiceFiscale, tipologie, esiti); return delegaPersistence.countByDettPratica_CodiceFiscale_Tipologia_InEsito(dettPraticaId, codiceFiscale,
tipologie, esiti);
} }
@Override @Override
public List<Delega> findByIntPratica_Tipologia_InEsito(long intPraticaId, String tipologia, public List<Delega> findByIntPratica_Tipologia_InEsito(long intPraticaId, String tipologia, String[] esiti,
String[] esiti, int start, int end, OrderByComparator orderByComparator) throws SystemException { int start, int end, OrderByComparator orderByComparator) throws SystemException {
return delegaPersistence.findByIntPratica_Tipologia_InEsito(intPraticaId, tipologia, esiti, start,
end, orderByComparator); return delegaPersistence.findByIntPratica_Tipologia_InEsito(intPraticaId, tipologia, esiti, start, end,
orderByComparator);
} }
@Override @Override
public List<Delega> findByDettPratica_Tipologia_InEsito(long dettPraticaId, String tipologia, public List<Delega> findByDettPratica_Tipologia_InEsito(long dettPraticaId, String tipologia, String[] esiti,
String[] esiti, int start, int end, OrderByComparator orderByComparator) throws SystemException { int start, int end, OrderByComparator orderByComparator) throws SystemException {
return delegaPersistence.findByDettPratica_Tipologia_InEsito(dettPraticaId, tipologia, esiti, start,
end, orderByComparator); return delegaPersistence.findByDettPratica_Tipologia_InEsito(dettPraticaId, tipologia, esiti, start, end,
orderByComparator);
} }
@Override @Override
public int countByIntPratica_Tipologia_InEsito(long intPraticaId, String tipologia, String[] esiti) public int countByIntPratica_Tipologia_InEsito(long intPraticaId, String tipologia, String[] esiti)
throws SystemException { throws SystemException {
return delegaPersistence.countByIntPratica_Tipologia_InEsito(intPraticaId, tipologia, esiti); return delegaPersistence.countByIntPratica_Tipologia_InEsito(intPraticaId, tipologia, esiti);
} }
@Override @Override
public List<Delega> findByDettPratica_Tipologia_InEsito(long dettPraticaId, String[] tipologie, public List<Delega> findByDettPratica_Tipologia_InEsito(long dettPraticaId, String[] tipologie, String[] esiti,
String[] esiti, int start, int end, OrderByComparator orderByComparator) throws SystemException { int start, int end, OrderByComparator orderByComparator) throws SystemException {
return delegaPersistence.findByDettPratica_Tipologie_InEsiti(dettPraticaId, tipologie, esiti, start,
end, orderByComparator); return delegaPersistence.findByDettPratica_Tipologie_InEsiti(dettPraticaId, tipologie, esiti, start, end,
orderByComparator);
} }
@Override @Override
public int countByDettPratica_Tipologia_InEsito(long intPraticaId, String[] tipologie, String[] esiti) public int countByDettPratica_Tipologia_InEsito(long intPraticaId, String[] tipologie, String[] esiti)
throws SystemException { throws SystemException {
return delegaPersistence.countByDettPratica_Tipologie_InEsiti(intPraticaId, tipologie, esiti); return delegaPersistence.countByDettPratica_Tipologie_InEsiti(intPraticaId, tipologie, esiti);
} }
/** // ADT: nuovo metodo generazione documento conclusione delega
*
* ADT: nuovo metodo generazione documento conclusione delega
*/
@Override @Override
public void generaDocumentoConcludiDelegaGeologo(long dettPraticaId, Delega delega, public void generaDocumentoConcludiDelegaGeologo(long dettPraticaId, Delega delega, ServiceContext serviceContext)
ServiceContext serviceContext) throws PortalException, SystemException { throws PortalException, SystemException {
try { try {
if (delega.getTipologia().equalsIgnoreCase(DelegheUtil.TIPO_GEOLOGO)) { if (delega.getTipologia().equalsIgnoreCase(DelegheUtil.TIPO_GEOLOGO)) {
String tipoDocumento = "D_GEO_"; String tipoDocumento = "D_GEO_";
long userId = serviceContext.getUserId(); long userId = serviceContext.getUserId();
DLFolder folderTemplate = DLFolderLocalServiceUtil.getFolder(serviceContext.getThemeDisplay() DLFolder folderTemplate = DLFolderLocalServiceUtil.getFolder(serviceContext.getThemeDisplay()
.getCompanyGroupId(), 0L, "Template"); .getCompanyGroupId(), 0L, "Template");
FileEntry fileEntryIdTemplate = DLAppLocalServiceUtil.getFileEntry(serviceContext FileEntry fileEntryIdTemplate = DLAppLocalServiceUtil.getFileEntry(serviceContext.getThemeDisplay()
.getThemeDisplay().getCompanyGroupId(), folderTemplate.getFolderId(), "Modello Asseverazione"); .getCompanyGroupId(), folderTemplate.getFolderId(), "Modello Asseverazione");
DLFolder folderAllegati = DLFolderLocalServiceUtil.getFolder(serviceContext.getThemeDisplay() DLFolder folderAllegati = DLFolderLocalServiceUtil.getFolder(serviceContext.getThemeDisplay()
.getCompanyGroupId(), 0L, "Allegati"); .getCompanyGroupId(), 0L, "Allegati");
String fileName = StringUtils.leftPad(String.valueOf(delega.getIntPraticaId()), 10, '0') String fileName = StringUtils.leftPad(String.valueOf(delega.getIntPraticaId()), 10, '0')
+ (Validator.isNotNull(tipoDocumento) ? StringPool.UNDERLINE + tipoDocumento + (Validator.isNotNull(tipoDocumento) ? StringPool.UNDERLINE + tipoDocumento : StringPool.BLANK)
: StringPool.BLANK) + StringPool.UNDERLINE + System.currentTimeMillis() + StringPool.UNDERLINE + System.currentTimeMillis() + ".pdf";
+ ".pdf";
Map<String, Object> parameters = new HashMap<String, Object>(); Map<String, Object> parameters = new HashMap<String, Object>();
ReportDto reportDto = new ReportDto(); ReportDto reportDto = new ReportDto();
reportDto.setFileEntryIds(new long[] { fileEntryIdTemplate.getFileEntryId() }); reportDto.setFileEntryIds(new long[] { fileEntryIdTemplate.getFileEntryId() });
reportDto.setFolderId(folderAllegati.getFolderId()); reportDto.setFolderId(folderAllegati.getFolderId());
@ -412,46 +405,35 @@ public class DelegaLocalServiceImpl extends DelegaLocalServiceBaseImpl {
reportDto.setHeaderHeight(1); reportDto.setHeaderHeight(1);
reportDto.setFooter(StringPool.BLANK); reportDto.setFooter(StringPool.BLANK);
reportDto.setFooterHeight(40); reportDto.setFooterHeight(40);
reportDto.setParameters(parameters); reportDto.setParameters(parameters);
reportDto.setShowNumberOfPage(true); reportDto.setShowNumberOfPage(true);
reportDto.setType(ReportConstants.ReportType.VELOCITY_TO_PDF.toString()); reportDto.setType(ReportConstants.ReportType.VELOCITY_TO_PDF.toString());
String resourcePath = getClass().getName().replaceAll("\\w+\\.", "../") String resourcePath = getClass().getName().replaceAll("\\w+\\.", "../")
.replace(getClass().getSimpleName(), "resource/asseverazioni"); .replace(getClass().getSimpleName(), "resource/asseverazioni");
reportDto.setPortalURL(getClass().getResource(resourcePath).getPath()); reportDto.setPortalURL(getClass().getResource(resourcePath).getPath());
String relazioni = StringPool.BLANK; String relazioni = StringPool.BLANK;
Map<String, Serializable> dichiarazioniMap = delega.getDichiarazioniMap(); Map<String, Serializable> dichiarazioniMap = delega.getDichiarazioniMap();
if (dichiarazioniMap.containsKey("coniugio") && ((Boolean) dichiarazioniMap.get("coniugio")) if (dichiarazioniMap.containsKey("coniugio") && ((Boolean) dichiarazioniMap.get("coniugio"))
&& dichiarazioniMap.containsKey("relazioni")) { && dichiarazioniMap.containsKey("relazioni")) {
relazioni = (String) dichiarazioniMap.get("relazioni"); relazioni = (String) dichiarazioniMap.get("relazioni");
} }
User user = userLocalService.getUser(userId); User user = userLocalService.getUser(userId);
parameters.put("html", AsseverazioneLocalServiceUtil.testoAsseverazione( parameters.put("html", AsseverazioneLocalServiceUtil.testoAsseverazione(TipoSoggettoUtil.GEOLOGO, user,
TipoSoggettoUtil.GEOLOGO, user, dettPraticaId, relazioni)); dettPraticaId, relazioni));
parameters.put("modello", "AS-GEO"); parameters.put("modello", "AS-GEO");
ReportResultDto result = ReportUtil.generateReport(delega.getCompanyId(), userId, reportDto, null);
ReportResultDto result = ReportUtil.generateReport(delega.getCompanyId(), userId, reportDto,
null);
long fileEntryId = result.getFileEntryIds()[0]; long fileEntryId = result.getFileEntryIds()[0];
String sha256 = StringPool.BLANK; String sha256 = StringPool.BLANK;
try { try {
sha256 = DigestUtils.sha256Hex(dlAppLocalService.getFileEntry(fileEntryId) sha256 = DigestUtils.sha256Hex(dlAppLocalService.getFileEntry(fileEntryId).getContentStream());
.getContentStream());
} catch (Exception e) { } catch (Exception e) {
} }
FirmeBean firmeBean = new FirmeBean(); FirmeBean firmeBean = new FirmeBean();
String jsonFirmatari = FirmeUtil.addFirma(firmeBean, user.getScreenName()); String jsonFirmatari = FirmeUtil.addFirma(firmeBean, user.getScreenName());
docPraticaLocalService.addDocPraticaAnnullamento(userId, Delega.class.getName(), docPraticaLocalService.addDocPraticaAnnullamento(userId, Delega.class.getName(), delega.getDelegaId(),
delega.getDelegaId(), delega.getIntPraticaId(), fileEntryId, fileName, tipoDocumento, delega.getIntPraticaId(), fileEntryId, fileName, tipoDocumento, sha256, jsonFirmatari,
sha256, jsonFirmatari, serviceContext); serviceContext);
_log.info("Documento conclusione delega correttamente generato per delegaid = " _log.info("Documento conclusione delega correttamente generato per delegaid = " + delega.getDelegaId());
+ delega.getDelegaId());
} else { } else {
_log.info("Impossibile generare documento delega - soggetto non trovato"); _log.info("Impossibile generare documento delega - soggetto non trovato");
} }

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

File diff soppresso perché troppo grande Load Diff

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

@ -1,13 +1,13 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * 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 * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* GNU Lesser General Public License as published by the Free Software Foundation; either version * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* 2.1 of the License, or (at your option) any later version. * any later version.
* *
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* Lesser General Public License for more details. * details.
*/ */
package it.tref.liferay.portos.bo.service.impl; package it.tref.liferay.portos.bo.service.impl;
@ -40,15 +40,12 @@ import com.liferay.portlet.documentlibrary.NoSuchFolderException;
* The implementation of the doc aggiuntiva local service. * The implementation of the doc aggiuntiva local service.
* *
* <p> * <p>
* All custom service methods should be put in this class. Whenever methods are * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy
* added, rerun ServiceBuilder to copy their definitions into the * their definitions into the {@link it.tref.liferay.portos.bo.service.DocAggiuntivaLocalService} interface.
* {@link it.tref.liferay.portos.bo.service.DocAggiuntivaLocalService}
* interface.
* *
* <p> * <p>
* This is a local service. Methods of this service will not have security * This is a local service. Methods of this service will not have security checks based on the propagated JAAS
* checks based on the propagated JAAS credentials because this service can only * credentials because this service can only be accessed from within the same VM.
* be accessed from within the same VM.
* </p> * </p>
* *
* @author Davide Barbagallo, 3F Consulting * @author Davide Barbagallo, 3F Consulting
@ -57,100 +54,98 @@ import com.liferay.portlet.documentlibrary.NoSuchFolderException;
*/ */
public class DocAggiuntivaLocalServiceImpl extends DocAggiuntivaLocalServiceBaseImpl { public class DocAggiuntivaLocalServiceImpl extends DocAggiuntivaLocalServiceBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: Never reference this interface directly. Always use * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link
* {@link it.tref.liferay.portos.bo.service.DocAggiuntivaLocalServiceUtil} * it.tref.liferay.portos.bo.service.DocAggiuntivaLocalServiceUtil} to access the doc aggiuntiva local service.
* to access the doc aggiuntiva local service.
*/ */
@Override
public List<DocAggiuntiva> findByIntPratica(long intPraticaId) throws SystemException { public List<DocAggiuntiva> findByIntPratica(long intPraticaId) throws SystemException {
return docAggiuntivaPersistence.findByIntPratica(intPraticaId); return docAggiuntivaPersistence.findByIntPratica(intPraticaId);
} }
@Override
public List<DocAggiuntiva> findByIntPratica(long intPraticaId, int start, int end, public List<DocAggiuntiva> findByIntPratica(long intPraticaId, int start, int end,
OrderByComparator orderByComparator) throws SystemException { OrderByComparator orderByComparator) throws SystemException {
return docAggiuntivaPersistence.findByIntPratica(intPraticaId, start, end, orderByComparator); return docAggiuntivaPersistence.findByIntPratica(intPraticaId, start, end, orderByComparator);
} }
@Override
public int countByIntPratica(long intPraticaId) throws SystemException { public int countByIntPratica(long intPraticaId) throws SystemException {
return docAggiuntivaPersistence.countByIntPratica(intPraticaId); return docAggiuntivaPersistence.countByIntPratica(intPraticaId);
} }
@Override
public List<DocAggiuntiva> findByDettPratica(long dettPraticaId) throws SystemException { public List<DocAggiuntiva> findByDettPratica(long dettPraticaId) throws SystemException {
return docAggiuntivaPersistence.findByIntPratica(dettPraticaId); return docAggiuntivaPersistence.findByIntPratica(dettPraticaId);
} }
@Override
public List<DocAggiuntiva> findByDettPratica(long dettPraticaId, int start, int end, public List<DocAggiuntiva> findByDettPratica(long dettPraticaId, int start, int end,
OrderByComparator orderByComparator) throws SystemException { OrderByComparator orderByComparator) throws SystemException {
return docAggiuntivaPersistence.findByIntPratica(dettPraticaId, start, end, orderByComparator); return docAggiuntivaPersistence.findByIntPratica(dettPraticaId, start, end, orderByComparator);
} }
@Override
public int countByDettPratica(long dettPraticaId) throws SystemException { public int countByDettPratica(long dettPraticaId) throws SystemException {
return docAggiuntivaPersistence.countByIntPratica(dettPraticaId); return docAggiuntivaPersistence.countByIntPratica(dettPraticaId);
} }
public List<DocAggiuntiva> findByIntPraticaFeVisible(long intPraticaId, boolean feVisible) @Override
throws SystemException { public List<DocAggiuntiva> findByIntPraticaFeVisible(long intPraticaId, boolean feVisible) throws SystemException {
return docAggiuntivaPersistence.findByIntPratica_FeVisible(intPraticaId, feVisible); return docAggiuntivaPersistence.findByIntPratica_FeVisible(intPraticaId, feVisible);
} }
public List<DocAggiuntiva> findByIntPraticaFeVisible(long intPraticaId, boolean feVisible, int start, @Override
int end, OrderByComparator orderByComparator) throws SystemException { public List<DocAggiuntiva> findByIntPraticaFeVisible(long intPraticaId, boolean feVisible, int start, int end,
OrderByComparator orderByComparator) throws SystemException {
return docAggiuntivaPersistence.findByIntPratica_FeVisible(intPraticaId, feVisible, start, end, return docAggiuntivaPersistence.findByIntPratica_FeVisible(intPraticaId, feVisible, start, end,
orderByComparator); orderByComparator);
} }
@Override
public int countByIntPraticaFeVisible(long intPraticaId, boolean feVisible) throws SystemException { public int countByIntPraticaFeVisible(long intPraticaId, boolean feVisible) throws SystemException {
return docAggiuntivaPersistence.countByIntPratica_FeVisible(intPraticaId, feVisible); return docAggiuntivaPersistence.countByIntPratica_FeVisible(intPraticaId, feVisible);
} }
public DocAggiuntiva addDocAggiuntiva(long userId, long intPraticaId, long dettPraticaId, @Override
String descrizione, boolean feVisible, byte[] content, String sourceFileName, public DocAggiuntiva addDocAggiuntiva(long userId, long intPraticaId, long dettPraticaId, String descrizione,
ServiceContext serviceContext) throws SystemException, PortalException { boolean feVisible, byte[] content, String sourceFileName, ServiceContext serviceContext)
throws SystemException, PortalException {
DocAggiuntiva docAggiuntiva = docAggiuntivaPersistence.create(counterLocalService
.increment(DocAggiuntiva.class.getName()));
DocAggiuntiva docAggiuntiva = docAggiuntivaPersistence.create(counterLocalService.increment(DocAggiuntiva.class
.getName()));
DettPratica dettPratica = dettPraticaLocalService.getDettPratica(dettPraticaId); DettPratica dettPratica = dettPraticaLocalService.getDettPratica(dettPraticaId);
User user = userPersistence.findByPrimaryKey(userId); User user = userPersistence.findByPrimaryKey(userId);
Date now = new Date(); Date now = new Date();
docAggiuntiva.setCompanyId(serviceContext.getCompanyId()); docAggiuntiva.setCompanyId(serviceContext.getCompanyId());
docAggiuntiva.setUserId(user.getUserId()); docAggiuntiva.setUserId(user.getUserId());
docAggiuntiva.setUserName(user.getFullName()); docAggiuntiva.setUserName(user.getFullName());
docAggiuntiva.setCreateDate(serviceContext.getCreateDate(now)); docAggiuntiva.setCreateDate(serviceContext.getCreateDate(now));
docAggiuntiva.setModifiedDate(serviceContext.getModifiedDate(now)); docAggiuntiva.setModifiedDate(serviceContext.getModifiedDate(now));
docAggiuntiva.setGroupId(serviceContext.getScopeGroupId()); docAggiuntiva.setGroupId(serviceContext.getScopeGroupId());
docAggiuntiva.setIntPraticaId(intPraticaId); docAggiuntiva.setIntPraticaId(intPraticaId);
docAggiuntiva.setDettPraticaId(dettPraticaId); docAggiuntiva.setDettPraticaId(dettPraticaId);
docAggiuntiva.setDescrizione(descrizione); docAggiuntiva.setDescrizione(descrizione);
docAggiuntiva.setFeVisible(feVisible); docAggiuntiva.setFeVisible(feVisible);
long fileEntryId = 0L;
long fileEntryId = 0l;
long defaultFolderId = configurazioneLocalService.findByC_ChiaveLong(serviceContext.getCompanyId(), long defaultFolderId = configurazioneLocalService.findByC_ChiaveLong(serviceContext.getCompanyId(),
ConfigurazioneConstants.ATTACHMENT_FOLDER_ID); ConfigurazioneConstants.ATTACHMENT_FOLDER_ID);
Folder defaultFolder = dlAppLocalService.getFolder(defaultFolderId); Folder defaultFolder = dlAppLocalService.getFolder(defaultFolderId);
String folderName = PraticaUtil.getFolderName(dettPratica.getDettPraticaId()); String folderName = PraticaUtil.getFolderName(dettPratica.getDettPraticaId());
serviceContext.setGroupPermissions(new String[] { ActionKeys.VIEW }); serviceContext.setGroupPermissions(new String[] { ActionKeys.VIEW });
Folder folder = null; Folder folder = null;
try { try {
folder = dlAppLocalService.getFolder(defaultFolder.getRepositoryId(), folder = dlAppLocalService.getFolder(defaultFolder.getRepositoryId(), defaultFolder.getFolderId(),
defaultFolder.getFolderId(), folderName); folderName);
} catch (NoSuchFolderException e) { } catch (NoSuchFolderException e) {
// cartella non presente -> creo cartella // cartella non presente -> creo cartella
folder = dlAppLocalService.addFolder(serviceContext.getUserId(), defaultFolder.getRepositoryId(), folder = dlAppLocalService.addFolder(serviceContext.getUserId(), defaultFolder.getRepositoryId(),
@ -160,16 +155,13 @@ public class DocAggiuntivaLocalServiceImpl extends DocAggiuntivaLocalServiceBase
+ docAggiuntiva.getDocAggiuntivaId() + StringPool.UNDERLINE + sourceFileName; + docAggiuntiva.getDocAggiuntivaId() + StringPool.UNDERLINE + sourceFileName;
String description = sourceFileName; String description = sourceFileName;
String mimeType = MimeTypesUtil.getContentType(sourceFileName); String mimeType = MimeTypesUtil.getContentType(sourceFileName);
String changeLog = StringPool.BLANK; String changeLog = StringPool.BLANK;
FileEntry fileEntry = dlAppLocalService.addFileEntry(serviceContext.getUserId(), FileEntry fileEntry = dlAppLocalService.addFileEntry(serviceContext.getUserId(), folder.getRepositoryId(),
folder.getRepositoryId(), folder.getFolderId(), now.getTime() + "_" + sourceFileName, folder.getFolderId(), now.getTime() + StringPool.UNDERLINE + sourceFileName, mimeType, title,
mimeType, title, description, changeLog, content, serviceContext); description, changeLog, content, serviceContext);
fileEntryId = fileEntry.getFileEntryId(); fileEntryId = fileEntry.getFileEntryId();
docAggiuntiva.setFileEntryId(fileEntryId); docAggiuntiva.setFileEntryId(fileEntryId);
docAggiuntiva = docAggiuntivaPersistence.update(docAggiuntiva); docAggiuntiva = docAggiuntivaPersistence.update(docAggiuntiva);
return docAggiuntiva; return docAggiuntiva;
} }
@ -193,9 +185,9 @@ public class DocAggiuntivaLocalServiceImpl extends DocAggiuntivaLocalServiceBase
return deleteDocAggiuntiva(docAggiuntivaLocalService.getDocAggiuntiva(docAggiuntivaId)); return deleteDocAggiuntiva(docAggiuntivaLocalService.getDocAggiuntiva(docAggiuntivaId));
} }
@Override
public DocAggiuntiva fetchByOldFileEntryId(long oldFileEntryId) throws SystemException { public DocAggiuntiva fetchByOldFileEntryId(long oldFileEntryId) throws SystemException {
return docAggiuntivaPersistence.fetchByoldFileEntryId(oldFileEntryId); return docAggiuntivaPersistence.fetchByoldFileEntryId(oldFileEntryId);
} }
} }

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

@ -1,13 +1,13 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * 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 * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* GNU Lesser General Public License as published by the Free Software Foundation; either version * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* 2.1 of the License, or (at your option) any later version. * any later version.
* *
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* Lesser General Public License for more details. * details.
*/ */
package it.tref.liferay.portos.bo.service.impl; package it.tref.liferay.portos.bo.service.impl;
@ -21,6 +21,7 @@ import it.tref.liferay.portos.bo.shared.util.ConfigurazioneConstants;
import it.tref.liferay.portos.bo.shared.util.FirmeUtil; import it.tref.liferay.portos.bo.shared.util.FirmeUtil;
import it.tref.liferay.portos.bo.util.PraticaUtil; import it.tref.liferay.portos.bo.util.PraticaUtil;
import java.net.HttpURLConnection;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -54,14 +55,12 @@ import com.liferay.portlet.documentlibrary.NoSuchFolderException;
* The implementation of the doc pratica local service. * The implementation of the doc pratica local service.
* *
* <p> * <p>
* All custom service methods should be put in this class. Whenever methods are * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy
* added, rerun ServiceBuilder to copy their definitions into the * their definitions into the {@link it.tref.liferay.portos.bo.service.DocPraticaLocalService} interface.
* {@link it.tref.liferay.portos.bo.service.DocPraticaLocalService} interface.
* *
* <p> * <p>
* This is a local service. Methods of this service will not have security * This is a local service. Methods of this service will not have security checks based on the propagated JAAS
* checks based on the propagated JAAS credentials because this service can only * credentials because this service can only be accessed from within the same VM.
* be accessed from within the same VM.
* </p> * </p>
* *
* @author Davide Barbagallo, 3F Consulting * @author Davide Barbagallo, 3F Consulting
@ -70,9 +69,8 @@ import com.liferay.portlet.documentlibrary.NoSuchFolderException;
*/ */
public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: Never reference this interface directly. Always use * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link
* {@link it.tref.liferay.portos.bo.service.DocPraticaLocalServiceUtil} to * it.tref.liferay.portos.bo.service.DocPraticaLocalServiceUtil} to access the doc pratica local service.
* access the doc pratica local service.
*/ */
@Override @Override
@ -93,32 +91,22 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
return deleteDocPratica(docPraticaLocalService.getDocPratica(docPraticaId)); return deleteDocPratica(docPraticaLocalService.getDocPratica(docPraticaId));
} }
public DocPratica addDocPratica(long userId, String className, long classPk, long intPraticaId, @Override
byte[] dlFileEntry, String fileName, String version, boolean praticaValidata, String descLong, public DocPratica addDocPratica(long userId, String className, long classPk, long intPraticaId, byte[] dlFileEntry,
String tipologia, String sha256, boolean aggiornato, String jsonFirmatari, String fileName, String version, boolean praticaValidata, String descLong, String tipologia, String sha256,
long dettPraticaIdRimozione, Date dtDataRimozione, ServiceContext serviceContext) boolean aggiornato, String jsonFirmatari, long dettPraticaIdRimozione, Date dtDataRimozione,
throws PortalException, SystemException { ServiceContext serviceContext) throws PortalException, SystemException {
User user = userPersistence.findByPrimaryKey(userId); User user = userPersistence.findByPrimaryKey(userId);
Date now = new Date(); Date now = new Date();
DocPratica docPratica = docPraticaPersistence.create(counterLocalService.increment(DocPratica.class.getName()));
validate(serviceContext.getScopeGroupId(), 0L, className, classPk, intPraticaId, dlFileEntry,
fileName, version, praticaValidata, descLong, tipologia, sha256, aggiornato, jsonFirmatari,
dettPraticaIdRimozione, dtDataRimozione);
DocPratica docPratica = docPraticaPersistence.create(counterLocalService.increment(DocPratica.class
.getName()));
FileEntry fileEntry = addAttachment(classPk, intPraticaId, userId, fileName, dlFileEntry, tipologia); FileEntry fileEntry = addAttachment(classPk, intPraticaId, userId, fileName, dlFileEntry, tipologia);
docPratica.setCompanyId(serviceContext.getCompanyId()); docPratica.setCompanyId(serviceContext.getCompanyId());
docPratica.setUserId(user.getUserId()); docPratica.setUserId(user.getUserId());
docPratica.setUserName(user.getFullName()); docPratica.setUserName(user.getFullName());
docPratica.setCreateDate(serviceContext.getCreateDate(now)); docPratica.setCreateDate(serviceContext.getCreateDate(now));
docPratica.setModifiedDate(serviceContext.getModifiedDate(now)); docPratica.setModifiedDate(serviceContext.getModifiedDate(now));
docPratica.setGroupId(serviceContext.getScopeGroupId()); docPratica.setGroupId(serviceContext.getScopeGroupId());
docPratica.setClassName(className); docPratica.setClassName(className);
docPratica.setClassPk(classPk); docPratica.setClassPk(classPk);
docPratica.setIntPraticaId(intPraticaId); docPratica.setIntPraticaId(intPraticaId);
@ -132,34 +120,26 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
docPratica.setJsonFirmatari(jsonFirmatari); docPratica.setJsonFirmatari(jsonFirmatari);
docPratica.setDettPraticaIdRimozione(dettPraticaIdRimozione); docPratica.setDettPraticaIdRimozione(dettPraticaIdRimozione);
docPratica.setDtDataRimozione(dtDataRimozione); docPratica.setDtDataRimozione(dtDataRimozione);
docPratica.setStatus(WorkflowConstants.STATUS_PENDING); docPratica.setStatus(WorkflowConstants.STATUS_PENDING);
docPratica = docPraticaPersistence.update(docPratica); docPratica = docPraticaPersistence.update(docPratica);
return docPratica; return docPratica;
} }
public DocPratica addDocPratica(long userId, String className, long classPk, long intPraticaId, @Override
byte[] dlFileEntry, String fileName, String tipologia, String jsonFirmatari, public DocPratica addDocPratica(long userId, String className, long classPk, long intPraticaId, byte[] dlFileEntry,
ServiceContext serviceContext) throws PortalException, SystemException { String fileName, String tipologia, String jsonFirmatari, ServiceContext serviceContext)
throws PortalException, SystemException {
User user = userPersistence.findByPrimaryKey(userId); User user = userPersistence.findByPrimaryKey(userId);
Date now = new Date(); Date now = new Date();
DocPratica docPratica = docPraticaPersistence.create(counterLocalService.increment(DocPratica.class.getName()));
DocPratica docPratica = docPraticaPersistence.create(counterLocalService.increment(DocPratica.class
.getName()));
FileEntry fileEntry = addAttachment(classPk, intPraticaId, userId, fileName, dlFileEntry, tipologia); FileEntry fileEntry = addAttachment(classPk, intPraticaId, userId, fileName, dlFileEntry, tipologia);
docPratica.setCompanyId(serviceContext.getCompanyId()); docPratica.setCompanyId(serviceContext.getCompanyId());
docPratica.setUserId(user.getUserId()); docPratica.setUserId(user.getUserId());
docPratica.setUserName(user.getFullName()); docPratica.setUserName(user.getFullName());
docPratica.setCreateDate(serviceContext.getCreateDate(now)); docPratica.setCreateDate(serviceContext.getCreateDate(now));
docPratica.setModifiedDate(serviceContext.getModifiedDate(now)); docPratica.setModifiedDate(serviceContext.getModifiedDate(now));
docPratica.setGroupId(serviceContext.getScopeGroupId()); docPratica.setGroupId(serviceContext.getScopeGroupId());
docPratica.setClassName(className); docPratica.setClassName(className);
docPratica.setClassPk(classPk); docPratica.setClassPk(classPk);
docPratica.setIntPraticaId(intPraticaId); docPratica.setIntPraticaId(intPraticaId);
@ -172,32 +152,25 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
docPratica.setJsonFirmatari(jsonFirmatari); docPratica.setJsonFirmatari(jsonFirmatari);
docPratica.setDettPraticaIdRimozione(0l); docPratica.setDettPraticaIdRimozione(0l);
docPratica.setDtDataRimozione(null); docPratica.setDtDataRimozione(null);
docPratica.setStatus(WorkflowConstants.STATUS_PENDING); docPratica.setStatus(WorkflowConstants.STATUS_PENDING);
docPratica = docPraticaPersistence.update(docPratica); docPratica = docPraticaPersistence.update(docPratica);
return docPratica; return docPratica;
} }
public DocPratica addDocPratica(long userId, String className, long classPk, long intPraticaId, @Override
long fileEntryId, String fileName, String tipologia, String jsonFirmatari, public DocPratica addDocPratica(long userId, String className, long classPk, long intPraticaId, long fileEntryId,
ServiceContext serviceContext) throws PortalException, SystemException { String fileName, String tipologia, String jsonFirmatari, ServiceContext serviceContext)
throws PortalException, SystemException {
User user = userPersistence.findByPrimaryKey(userId); User user = userPersistence.findByPrimaryKey(userId);
Date now = new Date(); Date now = new Date();
DocPratica docPratica = docPraticaPersistence.create(counterLocalService.increment(DocPratica.class.getName()));
DocPratica docPratica = docPraticaPersistence.create(counterLocalService.increment(DocPratica.class
.getName()));
docPratica.setCompanyId(serviceContext.getCompanyId()); docPratica.setCompanyId(serviceContext.getCompanyId());
docPratica.setUserId(user.getUserId()); docPratica.setUserId(user.getUserId());
docPratica.setUserName(user.getFullName()); docPratica.setUserName(user.getFullName());
docPratica.setCreateDate(serviceContext.getCreateDate(now)); docPratica.setCreateDate(serviceContext.getCreateDate(now));
docPratica.setModifiedDate(serviceContext.getModifiedDate(now)); docPratica.setModifiedDate(serviceContext.getModifiedDate(now));
docPratica.setGroupId(serviceContext.getScopeGroupId()); docPratica.setGroupId(serviceContext.getScopeGroupId());
docPratica.setClassName(className); docPratica.setClassName(className);
docPratica.setClassPk(classPk); docPratica.setClassPk(classPk);
docPratica.setIntPraticaId(intPraticaId); docPratica.setIntPraticaId(intPraticaId);
@ -210,29 +183,20 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
docPratica.setJsonFirmatari(jsonFirmatari); docPratica.setJsonFirmatari(jsonFirmatari);
docPratica.setDettPraticaIdRimozione(0l); docPratica.setDettPraticaIdRimozione(0l);
docPratica.setDtDataRimozione(null); docPratica.setDtDataRimozione(null);
docPratica.setStatus(WorkflowConstants.STATUS_PENDING); docPratica.setStatus(WorkflowConstants.STATUS_PENDING);
docPratica = docPraticaPersistence.update(docPratica); docPratica = docPraticaPersistence.update(docPratica);
return docPratica; return docPratica;
} }
@Override
public DocPratica addDocPraticaForImport(long userId, String className, long classPk, long intPraticaId, public DocPratica addDocPraticaForImport(long userId, String className, long classPk, long intPraticaId,
byte[] dlFileEntry, String fileName, String version, boolean praticaValidata, String descLong, byte[] dlFileEntry, String fileName, String version, boolean praticaValidata, String descLong,
String tipologia, String sha256, boolean aggiornato, String jsonFirmatari, String tipologia, String sha256, boolean aggiornato, String jsonFirmatari, long dettPraticaIdRimozione,
long dettPraticaIdRimozione, Date dtDataRimozione, long oldDocPraticaId, Date dtDataRimozione, long oldDocPraticaId, ServiceContext serviceContext) throws PortalException,
ServiceContext serviceContext) throws PortalException, SystemException { SystemException {
Date now = new Date(); Date now = new Date();
DocPratica docPratica = docPraticaPersistence.create(counterLocalService.increment(DocPratica.class.getName()));
validate(serviceContext.getScopeGroupId(), 0L, className, classPk, intPraticaId, dlFileEntry,
fileName, version, praticaValidata, descLong, tipologia, sha256, aggiornato, jsonFirmatari,
dettPraticaIdRimozione, dtDataRimozione);
DocPratica docPratica = docPraticaPersistence.create(counterLocalService.increment(DocPratica.class
.getName()));
docPratica.setCompanyId(serviceContext.getCompanyId()); docPratica.setCompanyId(serviceContext.getCompanyId());
docPratica.setUserId(userId); docPratica.setUserId(userId);
if (userId > 0) { if (userId > 0) {
@ -255,85 +219,72 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
docPratica.setDettPraticaIdRimozione(dettPraticaIdRimozione); docPratica.setDettPraticaIdRimozione(dettPraticaIdRimozione);
docPratica.setDtDataRimozione(dtDataRimozione); docPratica.setDtDataRimozione(dtDataRimozione);
docPratica.setOldDocPraticaId(oldDocPraticaId); docPratica.setOldDocPraticaId(oldDocPraticaId);
docPratica.setStatus(WorkflowConstants.STATUS_APPROVED); docPratica.setStatus(WorkflowConstants.STATUS_APPROVED);
return docPraticaPersistence.update(docPratica); return docPraticaPersistence.update(docPratica);
} }
@Override
public FileEntry addAttachment(long classPk, long intPraticaId, long delegaUserId, String sourceFileName, public FileEntry addAttachment(long classPk, long intPraticaId, long delegaUserId, String sourceFileName,
byte[] content, String tipoAllegato) throws SystemException, PortalException { byte[] content, String tipoAllegato) throws SystemException, PortalException {
FileEntry fileEntry = null; FileEntry fileEntry = null;
// DettPratica dettPratica =
// dettPraticaPersistence.fetchByPrimaryKey(dettPraticaId);
IntPratica intPratica = intPraticaPersistence.fetchByPrimaryKey(intPraticaId); IntPratica intPratica = intPraticaPersistence.fetchByPrimaryKey(intPraticaId);
Territorio territorio = territorioPersistence.fetchByPrimaryKey(intPratica.getTerritorioId()); Territorio territorio = territorioPersistence.fetchByPrimaryKey(intPratica.getTerritorioId());
long companyId = territorio.getCompanyId(); long companyId = territorio.getCompanyId();
long groupId = territorio.getGroupId(); long groupId = territorio.getGroupId();
// TODO forse è meglio ragionare con un'altra logica per i permessi // TODO forse è meglio ragionare con un'altra logica per i permessi
User user = UserLocalServiceUtil.getRoleUsers( User user = UserLocalServiceUtil.getRoleUsers(
RoleLocalServiceUtil.getRole(intPratica.getCompanyId(), RoleConstants.ADMINISTRATOR) RoleLocalServiceUtil.getRole(intPratica.getCompanyId(), RoleConstants.ADMINISTRATOR).getRoleId())
.getRoleId()).get(0); .get(0);
try { try {
PermissionThreadLocal.setPermissionChecker(PermissionCheckerFactoryUtil.create(user)); PermissionThreadLocal.setPermissionChecker(PermissionCheckerFactoryUtil.create(user));
} catch (Exception e) { } catch (Exception e) {
throw new SystemException(e); throw new SystemException(e);
} }
long userId = user.getUserId(); long userId = user.getUserId();
ServiceContext serviceContext = new ServiceContext(); ServiceContext serviceContext = new ServiceContext();
serviceContext.setCompanyId(companyId); serviceContext.setCompanyId(companyId);
serviceContext.setScopeGroupId(groupId); serviceContext.setScopeGroupId(groupId);
serviceContext.setUserId(userId); serviceContext.setUserId(userId);
serviceContext.setGroupPermissions(new String[] { ActionKeys.VIEW }); serviceContext.setGroupPermissions(new String[] { ActionKeys.VIEW });
long defaultFolderId = configurazioneLocalService.findByC_ChiaveLong(companyId, long defaultFolderId = configurazioneLocalService.findByC_ChiaveLong(companyId,
ConfigurazioneConstants.ATTACHMENT_FOLDER_ID); ConfigurazioneConstants.ATTACHMENT_FOLDER_ID);
Folder defaultFolder = dlAppLocalService.getFolder(defaultFolderId); Folder defaultFolder = dlAppLocalService.getFolder(defaultFolderId);
String folderName = PraticaUtil.getFolderName(classPk); String folderName = PraticaUtil.getFolderName(classPk);
Folder folder = null; Folder folder = null;
try { try {
folder = dlAppLocalService.getFolder(defaultFolder.getRepositoryId(), folder = dlAppLocalService.getFolder(defaultFolder.getRepositoryId(), defaultFolder.getFolderId(),
defaultFolder.getFolderId(), folderName); folderName);
} catch (NoSuchFolderException e) { } catch (NoSuchFolderException e) {
// cartella non presente -> creo cartella // cartella non presente -> creo cartella
folder = dlAppLocalService.addFolder(userId, defaultFolder.getRepositoryId(), folder = dlAppLocalService.addFolder(userId, defaultFolder.getRepositoryId(), defaultFolder.getFolderId(),
defaultFolder.getFolderId(), folderName, StringPool.BLANK, serviceContext); folderName, StringPool.BLANK, serviceContext);
} }
Date now = new Date(); Date now = new Date();
String title = tipoAllegato + StringPool.UNDERLINE + sourceFileName; String title = tipoAllegato + StringPool.UNDERLINE + sourceFileName;
String description = sourceFileName; String description = sourceFileName;
String mimeType = MimeTypesUtil.getContentType(sourceFileName); String mimeType = MimeTypesUtil.getContentType(sourceFileName);
String changeLog = StringPool.BLANK; String changeLog = StringPool.BLANK;
fileEntry = dlAppLocalService.addFileEntry(userId, folder.getRepositoryId(), folder.getFolderId(), fileEntry = dlAppLocalService.addFileEntry(userId, folder.getRepositoryId(), folder.getFolderId(),
now.getTime() + "_" + sourceFileName, mimeType, title, description, changeLog, content, now.getTime() + StringPool.UNDERLINE + sourceFileName, mimeType, title, description, changeLog,
serviceContext); content, serviceContext);
try { try {
PermissionThreadLocal.setPermissionChecker(PermissionCheckerFactoryUtil PermissionThreadLocal.setPermissionChecker(PermissionCheckerFactoryUtil.create(UserLocalServiceUtil
.create(UserLocalServiceUtil.getUser(delegaUserId))); .getUser(delegaUserId)));
} catch (Exception e) { } catch (Exception e) {
throw new SystemException(e); throw new SystemException(e);
} }
return fileEntry; return fileEntry;
} }
@Override
public FileEntry getAttachment(long classPk) throws SystemException, PortalException { public FileEntry getAttachment(long classPk) throws SystemException, PortalException {
DocPratica fileAllegato = docPraticaPersistence.findByPrimaryKey(classPk); DocPratica fileAllegato = docPraticaPersistence.findByPrimaryKey(classPk);
return dlAppLocalService.getFileEntry(fileAllegato.getDlFileEntryId()); return dlAppLocalService.getFileEntry(fileAllegato.getDlFileEntryId());
} }
@Override
public void addFirma(long docPraticaId, String codiceFiscale) throws PortalException, SystemException { public void addFirma(long docPraticaId, String codiceFiscale) throws PortalException, SystemException {
DocPratica docPratica = docPraticaLocalService.getDocPratica(docPraticaId); DocPratica docPratica = docPraticaLocalService.getDocPratica(docPraticaId);
@ -341,6 +292,7 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
docPraticaLocalService.updateDocPratica(docPratica); docPraticaLocalService.updateDocPratica(docPratica);
} }
@Override
public void addFirmeAndApprova(long docPraticaId, List<String> codiciFiscali) throws PortalException, public void addFirmeAndApprova(long docPraticaId, List<String> codiciFiscali) throws PortalException,
SystemException { SystemException {
@ -355,18 +307,19 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
docPraticaLocalService.updateDocPratica(docPratica); docPraticaLocalService.updateDocPratica(docPratica);
} }
public void addErrorAndApprova(long docPraticaId, String errorCode) throws PortalException, @Override
SystemException { public void addErrorAndApprova(long docPraticaId, String errorCode) throws PortalException, SystemException {
DocPratica docPratica = docPraticaLocalService.getDocPratica(docPraticaId); DocPratica docPratica = docPraticaLocalService.getDocPratica(docPraticaId);
docPratica.setModifiedDate(new Date()); docPratica.setModifiedDate(new Date());
docPratica.setErrorCode(errorCode); docPratica.setErrorCode(errorCode);
if ("400".equalsIgnoreCase(errorCode)) { if (String.valueOf(HttpURLConnection.HTTP_BAD_REQUEST).equals(errorCode)) {
docPratica.setStatus(WorkflowConstants.STATUS_DENIED); docPratica.setStatus(WorkflowConstants.STATUS_DENIED);
} }
docPraticaLocalService.updateDocPratica(docPratica); docPraticaLocalService.updateDocPratica(docPratica);
} }
@Override
public void removeFirma(long docPraticaId, String codiceFiscale) throws PortalException, SystemException { public void removeFirma(long docPraticaId, String codiceFiscale) throws PortalException, SystemException {
DocPratica docPratica = docPraticaLocalService.getDocPratica(docPraticaId); DocPratica docPratica = docPraticaLocalService.getDocPratica(docPraticaId);
@ -374,17 +327,8 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
docPraticaLocalService.updateDocPratica(docPratica); docPraticaLocalService.updateDocPratica(docPratica);
} }
private void validate(long groupId, long docPraticaId, String className, long classPk, long intPraticaId, @Override
byte[] dlFileEntry, String fileName, String version, boolean praticaValidata, String descLong, public DocPratica updateDocPraticaAggiornato(long docPraticaId, boolean aggiornato) throws SystemException {
String tipologia, String sha256, boolean aggiornato, String jsonFirmatari,
long dettPraticaIdRimozione, Date dtDataRimozione) throws PortalException, SystemException {
// TODO Write your own validation code
}
public DocPratica updateDocPraticaAggiornato(long docPraticaId, boolean aggiornato)
throws SystemException {
DocPratica docPratica = docPraticaPersistence.fetchByPrimaryKey(docPraticaId); DocPratica docPratica = docPraticaPersistence.fetchByPrimaryKey(docPraticaId);
docPratica.setAggiornato(aggiornato); docPratica.setAggiornato(aggiornato);
@ -392,18 +336,22 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
return docPraticaLocalService.updateDocPratica(docPratica); return docPraticaLocalService.updateDocPratica(docPratica);
} }
@Override
public int countDocPraticaDaInviareDax() throws SystemException { public int countDocPraticaDaInviareDax() throws SystemException {
DynamicQuery dynamicQuery = dynamicQueryDocPraticaDaInviareDax(); DynamicQuery dynamicQuery = dynamicQueryDocPraticaDaInviareDax();
return (int) docPraticaPersistence.countWithDynamicQuery(dynamicQuery); return (int) docPraticaPersistence.countWithDynamicQuery(dynamicQuery);
} }
@Override
public List<DocPratica> getDocPraticaDaInviareDax(int start, int end) throws SystemException { public List<DocPratica> getDocPraticaDaInviareDax(int start, int end) throws SystemException {
DynamicQuery dynamicQuery = dynamicQueryDocPraticaDaInviareDax(); DynamicQuery dynamicQuery = dynamicQueryDocPraticaDaInviareDax();
return docPraticaPersistence.findWithDynamicQuery(dynamicQuery, start, end); return docPraticaPersistence.findWithDynamicQuery(dynamicQuery, start, end);
} }
private DynamicQuery dynamicQueryDocPraticaDaInviareDax() { private DynamicQuery dynamicQueryDocPraticaDaInviareDax() {
DynamicQuery dynamicQuery = docPraticaLocalService.dynamicQuery(); DynamicQuery dynamicQuery = docPraticaLocalService.dynamicQuery();
dynamicQuery.add(PropertyFactoryUtil.forName("dtInvioDax").isNull()); dynamicQuery.add(PropertyFactoryUtil.forName("dtInvioDax").isNull());
dynamicQuery.add(PropertyFactoryUtil.forName("daxId").eq(0L)); dynamicQuery.add(PropertyFactoryUtil.forName("daxId").eq(0L));
@ -412,47 +360,56 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
return dynamicQuery; return dynamicQuery;
} }
@Override
public int countByClassPk(long classPk) throws SystemException { public int countByClassPk(long classPk) throws SystemException {
return docPraticaPersistence.countByClassPk(classPk); return docPraticaPersistence.countByClassPk(classPk);
} }
@Override
public List<DocPratica> findByClassPk(long classPk, int start, int end) throws SystemException { public List<DocPratica> findByClassPk(long classPk, int start, int end) throws SystemException {
return docPraticaPersistence.findByClassPk(classPk, start, end); return docPraticaPersistence.findByClassPk(classPk, start, end);
} }
@Override
public List<DocPratica> findByIntPratica(long intPraticaId) throws SystemException { public List<DocPratica> findByIntPratica(long intPraticaId) throws SystemException {
return docPraticaPersistence.findByIntPratica(intPraticaId); return docPraticaPersistence.findByIntPratica(intPraticaId);
} }
@Override
public List<DocPratica> findByClassPk(long classPk) throws SystemException { public List<DocPratica> findByClassPk(long classPk) throws SystemException {
return docPraticaPersistence.findByClassPk(classPk); return docPraticaPersistence.findByClassPk(classPk);
} }
public List<DocPratica> findByStaus(int status, int start, int end, OrderByComparator order) @Override
throws SystemException { public List<DocPratica> findByStaus(int status, int start, int end, OrderByComparator order) throws SystemException {
return docPraticaPersistence.findByStatus(status, start, end, order); return docPraticaPersistence.findByStatus(status, start, end, order);
} }
@Override
public int countByStatus(long status) throws SystemException { public int countByStatus(long status) throws SystemException {
return docPraticaPersistence.countByStatus(status); return docPraticaPersistence.countByStatus(status);
} }
@Override
public int countByClassPk_Tipologia(long classPk, String tipologia) throws SystemException { public int countByClassPk_Tipologia(long classPk, String tipologia) throws SystemException {
return docPraticaPersistence.countByClassPk_Tipologia(classPk, tipologia); return docPraticaPersistence.countByClassPk_Tipologia(classPk, tipologia);
} }
@Override
public List<DocPratica> findByClassPk_Tipologia(long classPk, String tipologia, int start, int end) public List<DocPratica> findByClassPk_Tipologia(long classPk, String tipologia, int start, int end)
throws SystemException { throws SystemException {
return docPraticaPersistence.findByClassPk_Tipologia(classPk, tipologia, start, end); return docPraticaPersistence.findByClassPk_Tipologia(classPk, tipologia, start, end);
} }
@Override
public List<DocPratica> findByIntPratica_Tipologia(long intPraticaId, String tipologia, int start, int end) public List<DocPratica> findByIntPratica_Tipologia(long intPraticaId, String tipologia, int start, int end)
throws SystemException { throws SystemException {
@ -463,8 +420,9 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
return soggettoPersistence.findWithDynamicQuery(dynamicQuery, start, end); return soggettoPersistence.findWithDynamicQuery(dynamicQuery, start, end);
} }
public List<DocPratica> findByIntPratica_ClassPk_Tipologia(long intPraticaId, long classPk, @Override
String tipologia, int start, int end) throws SystemException { public List<DocPratica> findByIntPratica_ClassPk_Tipologia(long intPraticaId, long classPk, String tipologia,
int start, int end) throws SystemException {
DynamicQuery dynamicQuery = dynamicQuery(); DynamicQuery dynamicQuery = dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId));
@ -474,8 +432,9 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
return dynamicQuery(dynamicQuery, start, end); return dynamicQuery(dynamicQuery, start, end);
} }
public List<DocPratica> findByIntPratica_ClassPk_Tipologie(long intPraticaId, long classPk, @Override
List<String> tipologie) throws SystemException { public List<DocPratica> findByIntPratica_ClassPk_Tipologie(long intPraticaId, long classPk, List<String> tipologie)
throws SystemException {
DynamicQuery dynamicQuery = dynamicQuery(); DynamicQuery dynamicQuery = dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId));
@ -485,6 +444,7 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
return dynamicQuery(dynamicQuery); return dynamicQuery(dynamicQuery);
} }
@Override
public List<DocPratica> findByIntPratica_ClassPkEqual_Tipologie(long intPraticaId, long classPk, public List<DocPratica> findByIntPratica_ClassPkEqual_Tipologie(long intPraticaId, long classPk,
List<String> tipologie) throws SystemException { List<String> tipologie) throws SystemException {
@ -496,29 +456,31 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
return dynamicQuery(dynamicQuery); return dynamicQuery(dynamicQuery);
} }
public DocPratica fetchByC_Group_DlFileEntry_Version(long dlFileEntryId, String version) @Override
throws SystemException { public DocPratica fetchByC_Group_DlFileEntry_Version(long dlFileEntryId, String version) throws SystemException {
return docPraticaPersistence.fetchByDlFileEntry_Version(dlFileEntryId, version); return docPraticaPersistence.fetchByDlFileEntry_Version(dlFileEntryId, version);
} }
@Override
public DocPratica fetchByOldDocPraticaId(long oldDocPraticaId) throws SystemException { public DocPratica fetchByOldDocPraticaId(long oldDocPraticaId) throws SystemException {
return docPraticaPersistence.fetchByOldDocPratica(oldDocPraticaId); return docPraticaPersistence.fetchByOldDocPratica(oldDocPraticaId);
} }
@Override
public List<Long> findDistinctDlFileEntryId(long classPk, String tipologia, int start, int end) public List<Long> findDistinctDlFileEntryId(long classPk, String tipologia, int start, int end)
throws SystemException { throws SystemException {
return findDistinctDlFileEntryId(new long[] { classPk }, tipologia, start, end); return findDistinctDlFileEntryId(new long[] { classPk }, tipologia, start, end);
} }
@Override
public List<Long> findDistinctDlFileEntryId(long[] classPks, String tipologia, int start, int end) public List<Long> findDistinctDlFileEntryId(long[] classPks, String tipologia, int start, int end)
throws SystemException { throws SystemException {
DynamicQuery dynamicQuery = docPraticaLocalService.dynamicQuery(); DynamicQuery dynamicQuery = docPraticaLocalService.dynamicQuery();
dynamicQuery.setProjection(ProjectionFactoryUtil.distinct(ProjectionFactoryUtil dynamicQuery.setProjection(ProjectionFactoryUtil.distinct(ProjectionFactoryUtil.property("dlFileEntryId")));
.property("dlFileEntryId")));
dynamicQuery.add(PropertyFactoryUtil.forName("tipologia").eq(tipologia)); dynamicQuery.add(PropertyFactoryUtil.forName("tipologia").eq(tipologia));
Junction or = RestrictionsFactoryUtil.disjunction(); Junction or = RestrictionsFactoryUtil.disjunction();
for (long classPk : classPks) { for (long classPk : classPks) {
@ -529,6 +491,7 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
return docPraticaPersistence.findWithDynamicQuery(dynamicQuery, start, end); return docPraticaPersistence.findWithDynamicQuery(dynamicQuery, start, end);
} }
@Override
public List<DocPratica> getValidByIntPratica(long intPraticaId) throws SystemException { public List<DocPratica> getValidByIntPratica(long intPraticaId) throws SystemException {
DynamicQuery dynamicQuery = dynamicQuery(); DynamicQuery dynamicQuery = dynamicQuery();
@ -538,8 +501,9 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
return dynamicQuery(dynamicQuery); return dynamicQuery(dynamicQuery);
} }
public List<DocPratica> getValidByIntPratica_Tipologia(long intPraticaId, String tipologia, int start, @Override
int end) throws SystemException { public List<DocPratica> getValidByIntPratica_Tipologia(long intPraticaId, String tipologia, int start, int end)
throws SystemException {
DynamicQuery dynamicQuery = dynamicQuery(); DynamicQuery dynamicQuery = dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId));
@ -549,53 +513,51 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
return dynamicQuery(dynamicQuery, start, end); return dynamicQuery(dynamicQuery, start, end);
} }
public int countValidTmpByIntPratica_Tipologia(long intPraticaId, String tipologia) @Override
throws SystemException { public int countValidTmpByIntPratica_Tipologia(long intPraticaId, String tipologia) throws SystemException {
DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica(intPraticaId); DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica(intPraticaId);
dynamicQuery.add(RestrictionsFactoryUtil.eq("tipologia", tipologia)); dynamicQuery.add(RestrictionsFactoryUtil.eq("tipologia", tipologia));
return (int) docPraticaPersistence.countWithDynamicQuery(dynamicQuery); return (int) docPraticaPersistence.countWithDynamicQuery(dynamicQuery);
} }
public List<DocPratica> getValidTmpByIntPratica_Tipologia(long intPraticaId, String tipologia, int start, @Override
int end) throws SystemException { public List<DocPratica> getValidTmpByIntPratica_Tipologia(long intPraticaId, String tipologia, int start, int end)
throws SystemException {
DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica(intPraticaId); DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica(intPraticaId);
dynamicQuery.add(RestrictionsFactoryUtil.eq("tipologia", tipologia)); dynamicQuery.add(RestrictionsFactoryUtil.eq("tipologia", tipologia));
dynamicQuery.addOrder(OrderFactoryUtil.asc("dettPraticaIdRimozione")); dynamicQuery.addOrder(OrderFactoryUtil.asc("dettPraticaIdRimozione"));
return dynamicQuery(dynamicQuery, start, end); return dynamicQuery(dynamicQuery, start, end);
} }
public List<DocPratica> getValidTmpByIntPratica_DettPratica_Tipologia(long intPraticaId, @Override
long dettPraticaId, String tipologia, int start, int end) throws SystemException { public List<DocPratica> getValidTmpByIntPratica_DettPratica_Tipologia(long intPraticaId, long dettPraticaId,
String tipologia, int start, int end) throws SystemException {
DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica(intPraticaId); DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica(intPraticaId);
dynamicQuery.add(RestrictionsFactoryUtil.eq("tipologia", tipologia)); dynamicQuery.add(RestrictionsFactoryUtil.eq("tipologia", tipologia));
dynamicQuery.add(RestrictionsFactoryUtil.eq("classPk", dettPraticaId)); dynamicQuery.add(RestrictionsFactoryUtil.eq("classPk", dettPraticaId));
dynamicQuery.add(RestrictionsFactoryUtil.eq("className", DettPratica.class.getName())); dynamicQuery.add(RestrictionsFactoryUtil.eq("className", DettPratica.class.getName()));
dynamicQuery.addOrder(OrderFactoryUtil.asc("dettPraticaIdRimozione")); dynamicQuery.addOrder(OrderFactoryUtil.asc("dettPraticaIdRimozione"));
return dynamicQuery(dynamicQuery, start, end); return dynamicQuery(dynamicQuery, start, end);
} }
public List<DocPratica> getValidTmpByIntPratica_Tipologie(long intPraticaId, String[] tipologie, @Override
int start, int end) throws SystemException { public List<DocPratica> getValidTmpByIntPratica_Tipologie(long intPraticaId, String[] tipologie, int start, int end)
throws SystemException {
DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica(intPraticaId); DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica(intPraticaId);
dynamicQuery.add(RestrictionsFactoryUtil.in("tipologia", tipologie)); dynamicQuery.add(RestrictionsFactoryUtil.in("tipologia", tipologie));
dynamicQuery.addOrder(OrderFactoryUtil.asc("dettPraticaIdRimozione")); dynamicQuery.addOrder(OrderFactoryUtil.asc("dettPraticaIdRimozione"));
return dynamicQuery(dynamicQuery, start, end); return dynamicQuery(dynamicQuery, start, end);
} }
public int countValidTmpByIntPratica_Tipologie(long intPraticaId, String[] tipologie) @Override
throws SystemException { public int countValidTmpByIntPratica_Tipologie(long intPraticaId, String[] tipologie) throws SystemException {
DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica(intPraticaId); DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica(intPraticaId);
dynamicQuery.add(RestrictionsFactoryUtil.in("tipologia", tipologie)); dynamicQuery.add(RestrictionsFactoryUtil.in("tipologia", tipologie));
return (int) docPraticaPersistence.countWithDynamicQuery(dynamicQuery); return (int) docPraticaPersistence.countWithDynamicQuery(dynamicQuery);
} }
@ -604,10 +566,10 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
DynamicQuery dynamicQuery = dynamicQuery(); DynamicQuery dynamicQuery = dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId));
dynamicQuery.add(RestrictionsFactoryUtil.eq("dettPraticaIdRimozione", null)); dynamicQuery.add(RestrictionsFactoryUtil.eq("dettPraticaIdRimozione", null));
return dynamicQuery; return dynamicQuery;
} }
@Override
public List<DocPratica> getInvalidByIntPratica(long intPraticaId) throws SystemException { public List<DocPratica> getInvalidByIntPratica(long intPraticaId) throws SystemException {
DynamicQuery dynamicQuery = dynamicQuery(); DynamicQuery dynamicQuery = dynamicQuery();
@ -617,6 +579,7 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
return dynamicQuery(dynamicQuery); return dynamicQuery(dynamicQuery);
} }
@Override
public List<DocPratica> getInvalidTmpByIntPratica(long intPraticaId) throws SystemException { public List<DocPratica> getInvalidTmpByIntPratica(long intPraticaId) throws SystemException {
DynamicQuery dynamicQuery = dynamicQuery(); DynamicQuery dynamicQuery = dynamicQuery();
@ -626,20 +589,20 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
return dynamicQuery(dynamicQuery); return dynamicQuery(dynamicQuery);
} }
public List<DocPratica> getValidUntilClassPkByIntPratica(long intPraticaId, long classPk, @Override
String tipologia, int start, int end) throws SystemException { public List<DocPratica> getValidUntilClassPkByIntPratica(long intPraticaId, long classPk, String tipologia,
int start, int end) throws SystemException {
DynamicQuery dynamicQuery = dynamicQuery(); DynamicQuery dynamicQuery = dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId));
dynamicQuery.add(RestrictionsFactoryUtil.le("classPk", classPk)); dynamicQuery.add(RestrictionsFactoryUtil.le("classPk", classPk));
dynamicQuery.add(RestrictionsFactoryUtil.eq("tipologia", tipologia)); dynamicQuery.add(RestrictionsFactoryUtil.eq("tipologia", tipologia));
// dynamicQuery.add(RestrictionsFactoryUtil.eq("dettPraticaIdRimozione",
// null));
dynamicQuery.add(RestrictionsFactoryUtil.eq("rimosso", false)); dynamicQuery.add(RestrictionsFactoryUtil.eq("rimosso", false));
dynamicQuery.addOrder(OrderFactoryUtil.desc("classPk")); dynamicQuery.addOrder(OrderFactoryUtil.desc("classPk"));
return dynamicQuery(dynamicQuery, start, end); return dynamicQuery(dynamicQuery, start, end);
} }
@Override
public void completeInvalidation(long intPraticaId) throws SystemException { public void completeInvalidation(long intPraticaId) throws SystemException {
Date now = new Date(); Date now = new Date();
@ -652,34 +615,29 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
} }
} }
@Override
public List<DocPratica> getDocPraticaWithOldFileEntryId(int start, int end) throws SystemException { public List<DocPratica> getDocPraticaWithOldFileEntryId(int start, int end) throws SystemException {
DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(DocPratica.class); DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(DocPratica.class);
dynamicQuery.add(PropertyFactoryUtil.forName("oldDlFileEntryId").ne(0L)); dynamicQuery.add(PropertyFactoryUtil.forName("oldDlFileEntryId").ne(0L));
dynamicQuery.addOrder(OrderFactoryUtil.desc("oldDlFileEntryId")); dynamicQuery.addOrder(OrderFactoryUtil.desc("oldDlFileEntryId"));
return docPraticaLocalService.dynamicQuery(dynamicQuery, start, end); return docPraticaLocalService.dynamicQuery(dynamicQuery, start, end);
} }
// ADT BUG FE ID = 9 @Override
public DocPratica addDocPraticaAnnullamento(long userId, String className, long classPk, public DocPratica addDocPraticaAnnullamento(long userId, String className, long classPk, long intPraticaId,
long intPraticaId, long fileEntryId, String fileName, String tipologia, String sha256, long fileEntryId, String fileName, String tipologia, String sha256, String jsonFirmatari,
String jsonFirmatari, ServiceContext serviceContext) throws PortalException, SystemException { ServiceContext serviceContext) throws PortalException, SystemException {
User user = userPersistence.findByPrimaryKey(userId); User user = userPersistence.findByPrimaryKey(userId);
Date now = new Date(); Date now = new Date();
DocPratica docPratica = docPraticaPersistence.create(counterLocalService.increment(DocPratica.class.getName()));
DocPratica docPratica = docPraticaPersistence.create(counterLocalService.increment(DocPratica.class
.getName()));
docPratica.setCompanyId(serviceContext.getCompanyId()); docPratica.setCompanyId(serviceContext.getCompanyId());
docPratica.setUserId(user.getUserId()); docPratica.setUserId(user.getUserId());
docPratica.setUserName(user.getFullName()); docPratica.setUserName(user.getFullName());
docPratica.setCreateDate(serviceContext.getCreateDate(now)); docPratica.setCreateDate(serviceContext.getCreateDate(now));
docPratica.setModifiedDate(serviceContext.getModifiedDate(now)); docPratica.setModifiedDate(serviceContext.getModifiedDate(now));
docPratica.setGroupId(serviceContext.getScopeGroupId()); docPratica.setGroupId(serviceContext.getScopeGroupId());
docPratica.setClassName(className); docPratica.setClassName(className);
docPratica.setClassPk(classPk); docPratica.setClassPk(classPk);
docPratica.setIntPraticaId(intPraticaId); docPratica.setIntPraticaId(intPraticaId);
@ -693,27 +651,15 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
docPratica.setJsonFirmatari(jsonFirmatari); docPratica.setJsonFirmatari(jsonFirmatari);
docPratica.setDettPraticaIdRimozione(0l); docPratica.setDettPraticaIdRimozione(0l);
docPratica.setDtDataRimozione(null); docPratica.setDtDataRimozione(null);
docPratica.setStatus(WorkflowConstants.STATUS_PENDING); docPratica.setStatus(WorkflowConstants.STATUS_PENDING);
docPratica = docPraticaPersistence.update(docPratica); docPratica = docPraticaPersistence.update(docPratica);
return docPratica; return docPratica;
} }
/** // Metodo nuovo ADT
* Metodo nuovo ADT @Override
* public List<DocPratica> findByIntPratica_ClassPk_TipologiaNew(long intPraticaId, long classPk, String tipologia,
* @param intPraticaId int start, int end) throws SystemException {
* @param classPk
* @param tipologia
* @param start
* @param end
* @return
* @throws SystemException
*/
public List<DocPratica> findByIntPratica_ClassPk_TipologiaNew(long intPraticaId, long classPk,
String tipologia, int start, int end) throws SystemException {
DynamicQuery dynamicQuery = dynamicQuery(); DynamicQuery dynamicQuery = dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId));
@ -722,5 +668,4 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
dynamicQuery.addOrder(OrderFactoryUtil.desc("classPk")); dynamicQuery.addOrder(OrderFactoryUtil.desc("classPk"));
return dynamicQuery(dynamicQuery, start, end); return dynamicQuery(dynamicQuery, start, end);
} }
} }

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

@ -1,13 +1,13 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * 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 * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* GNU Lesser General Public License as published by the Free Software Foundation; either version * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* 2.1 of the License, or (at your option) any later version. * any later version.
* *
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* Lesser General Public License for more details. * details.
*/ */
package it.tref.liferay.portos.bo.service.impl; package it.tref.liferay.portos.bo.service.impl;
@ -26,13 +26,12 @@ import com.liferay.portal.service.ServiceContext;
* The implementation of the doc pratica remote service. * The implementation of the doc pratica remote service.
* *
* <p> * <p>
* All custom service methods should be put in this class. Whenever methods are added, rerun * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy
* ServiceBuilder to copy their definitions into the * their definitions into the {@link it.tref.liferay.portos.bo.service.DocPraticaService} interface.
* {@link it.tref.liferay.portos.bo.service.DocPraticaService} interface.
* *
* <p> * <p>
* This is a remote service. Methods of this service are expected to have security checks based on * This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS
* the propagated JAAS credentials because this service can be accessed remotely. * credentials because this service can be accessed remotely.
* </p> * </p>
* *
* @author Davide Barbagallo, 3F Consulting * @author Davide Barbagallo, 3F Consulting
@ -42,34 +41,35 @@ import com.liferay.portal.service.ServiceContext;
public class DocPraticaServiceImpl extends DocPraticaServiceBaseImpl { public class DocPraticaServiceImpl extends DocPraticaServiceBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link
* it.tref.liferay.portos.bo.service.DocPraticaServiceUtil} to access the doc pratica remote * it.tref.liferay.portos.bo.service.DocPraticaServiceUtil} to access the doc pratica remote service.
* service.
*/ */
@Override
public DocPratica addDocPratica(long userId, String className, long classPk, long intPraticaId, byte[] dlFileEntry, public DocPratica addDocPratica(long userId, String className, long classPk, long intPraticaId, byte[] dlFileEntry,
String fileName, String version, boolean praticaValidata, String descLong, String tipologia, String sha256, String fileName, String version, boolean praticaValidata, String descLong, String tipologia, String sha256,
boolean aggiornato, String jsonFirmatari, long intPraticaIdRimozione, long dettPraticaIdRimozione, boolean aggiornato, String jsonFirmatari, long intPraticaIdRimozione, long dettPraticaIdRimozione,
Date dtDataRimozione, ServiceContext serviceContext) throws PortalException, SystemException { Date dtDataRimozione, ServiceContext serviceContext) throws PortalException, SystemException {
// TODO aggiungere controlli di permessi di aggiutna file!!!! // TODO aggiungere controlli di permessi di aggiunta file!!!!
return docPraticaLocalService.addDocPratica(userId, className, classPk, intPraticaId, dlFileEntry, fileName, return docPraticaLocalService.addDocPratica(userId, className, classPk, intPraticaId, dlFileEntry, fileName,
version, praticaValidata, descLong, tipologia, sha256, aggiornato, jsonFirmatari, dettPraticaIdRimozione, version, praticaValidata, descLong, tipologia, sha256, aggiornato, jsonFirmatari,
dtDataRimozione, serviceContext); dettPraticaIdRimozione, dtDataRimozione, serviceContext);
} }
@Override
public DocPratica getDocPratica(long docPraticaId) throws PortalException, SystemException { public DocPratica getDocPratica(long docPraticaId) throws PortalException, SystemException {
// TODO permessi // TODO permessi
return docPraticaLocalService.getDocPratica(docPraticaId); return docPraticaLocalService.getDocPratica(docPraticaId);
} }
@Override
public int countByClassPk_Tipologia(long classPk, String tipologia) throws SystemException { public int countByClassPk_Tipologia(long classPk, String tipologia) throws SystemException {
// TODO permessi // TODO permessi
return docPraticaLocalService.countByClassPk_Tipologia(classPk, tipologia); return docPraticaLocalService.countByClassPk_Tipologia(classPk, tipologia);
} }
@Override
public List<DocPratica> findByClassPk_Tipologia(long dettPratica, String tipologia, int start, int end) public List<DocPratica> findByClassPk_Tipologia(long dettPratica, String tipologia, int start, int end)
throws SystemException { throws SystemException {
@ -77,6 +77,7 @@ public class DocPraticaServiceImpl extends DocPraticaServiceBaseImpl {
return docPraticaLocalService.findByClassPk_Tipologia(dettPratica, tipologia, start, end); return docPraticaLocalService.findByClassPk_Tipologia(dettPratica, tipologia, start, end);
} }
@Override
public List<DocPratica> findByIntPratica_Tipologia(long intPraticaId, String tipologia, int start, int end) public List<DocPratica> findByIntPratica_Tipologia(long intPraticaId, String tipologia, int start, int end)
throws SystemException { throws SystemException {
@ -84,30 +85,33 @@ public class DocPraticaServiceImpl extends DocPraticaServiceBaseImpl {
return docPraticaLocalService.findByIntPratica_Tipologia(intPraticaId, tipologia, start, end); return docPraticaLocalService.findByIntPratica_Tipologia(intPraticaId, tipologia, start, end);
} }
@Override
public List<DocPratica> findByIntPratica_ClassPk_Tipologia(long intPraticaId, long classPk, String tipologia, public List<DocPratica> findByIntPratica_ClassPk_Tipologia(long intPraticaId, long classPk, String tipologia,
int start, int end) throws SystemException { int start, int end) throws SystemException {
return docPraticaLocalService.findByIntPratica_ClassPk_Tipologia(intPraticaId, classPk, tipologia, start, end); return docPraticaLocalService.findByIntPratica_ClassPk_Tipologia(intPraticaId, classPk, tipologia, start, end);
} }
@Override
public DocPratica deleteDocPratica(DocPratica docPratica) throws PortalException, SystemException { public DocPratica deleteDocPratica(DocPratica docPratica) throws PortalException, SystemException {
return docPraticaLocalService.deleteDocPratica(docPratica); return docPraticaLocalService.deleteDocPratica(docPratica);
} }
@Override
public DocPratica deleteDocPratica(long docPraticaId) throws PortalException, SystemException { public DocPratica deleteDocPratica(long docPraticaId) throws PortalException, SystemException {
return docPraticaLocalService.deleteDocPratica(docPraticaId); return docPraticaLocalService.deleteDocPratica(docPraticaId);
} }
@Override
public List<DocPratica> getValidByIntPratica(long intPraticaId) throws SystemException { public List<DocPratica> getValidByIntPratica(long intPraticaId) throws SystemException {
// TODO permessi // TODO permessi
return docPraticaLocalService.getValidByIntPratica(intPraticaId); return docPraticaLocalService.getValidByIntPratica(intPraticaId);
} }
@Override
public List<DocPratica> getValidByIntPratica_Tipologia(long intPraticaId, String tipologia, int start, int end) public List<DocPratica> getValidByIntPratica_Tipologia(long intPraticaId, String tipologia, int start, int end)
throws SystemException { throws SystemException {
@ -115,6 +119,7 @@ public class DocPraticaServiceImpl extends DocPraticaServiceBaseImpl {
return docPraticaLocalService.getValidByIntPratica_Tipologia(intPraticaId, tipologia, start, end); return docPraticaLocalService.getValidByIntPratica_Tipologia(intPraticaId, tipologia, start, end);
} }
@Override
public List<DocPratica> getValidTmpByIntPratica_Tipologia(long intPraticaId, String tipologia, int start, int end) public List<DocPratica> getValidTmpByIntPratica_Tipologia(long intPraticaId, String tipologia, int start, int end)
throws SystemException { throws SystemException {
@ -122,18 +127,21 @@ public class DocPraticaServiceImpl extends DocPraticaServiceBaseImpl {
return docPraticaLocalService.getValidTmpByIntPratica_Tipologia(intPraticaId, tipologia, start, end); return docPraticaLocalService.getValidTmpByIntPratica_Tipologia(intPraticaId, tipologia, start, end);
} }
@Override
public List<DocPratica> getInvalidByIntPratica(long intPraticaId) throws SystemException { public List<DocPratica> getInvalidByIntPratica(long intPraticaId) throws SystemException {
// TODO permessi // TODO permessi
return docPraticaLocalService.getInvalidByIntPratica(intPraticaId); return docPraticaLocalService.getInvalidByIntPratica(intPraticaId);
} }
@Override
public List<DocPratica> getInvalidTmpByIntPratica(long intPraticaId) throws SystemException { public List<DocPratica> getInvalidTmpByIntPratica(long intPraticaId) throws SystemException {
// TODO permessi // TODO permessi
return docPraticaLocalService.getInvalidTmpByIntPratica(intPraticaId); return docPraticaLocalService.getInvalidTmpByIntPratica(intPraticaId);
} }
@Override
public List<DocPratica> getValidUntilClassPkByIntPratica(long intPraticaId, long classPk, String tipologia, public List<DocPratica> getValidUntilClassPkByIntPratica(long intPraticaId, long classPk, String tipologia,
int start, int end) throws SystemException { int start, int end) throws SystemException {

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

@ -1,13 +1,13 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * 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 * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* GNU Lesser General Public License as published by the Free Software Foundation; either version * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* 2.1 of the License, or (at your option) any later version. * any later version.
* *
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* Lesser General Public License for more details. * details.
*/ */
package it.tref.liferay.portos.bo.service.impl; package it.tref.liferay.portos.bo.service.impl;
@ -57,14 +57,12 @@ import com.liferay.portal.service.ServiceContext;
* The implementation of the fine lavori local service. * The implementation of the fine lavori local service.
* *
* <p> * <p>
* All custom service methods should be put in this class. Whenever methods are * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy
* added, rerun ServiceBuilder to copy their definitions into the * their definitions into the {@link it.tref.liferay.portos.bo.service.FineLavoriLocalService} interface.
* {@link it.tref.liferay.portos.bo.service.FineLavoriLocalService} interface.
* *
* <p> * <p>
* This is a local service. Methods of this service will not have security * This is a local service. Methods of this service will not have security checks based on the propagated JAAS
* checks based on the propagated JAAS credentials because this service can only * credentials because this service can only be accessed from within the same VM.
* be accessed from within the same VM.
* </p> * </p>
* *
* @author Davide Barbagallo, 3F Consulting * @author Davide Barbagallo, 3F Consulting
@ -73,9 +71,8 @@ import com.liferay.portal.service.ServiceContext;
*/ */
public class FineLavoriLocalServiceImpl extends FineLavoriLocalServiceBaseImpl { public class FineLavoriLocalServiceImpl extends FineLavoriLocalServiceBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: Never reference this interface directly. Always use * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link
* {@link it.tref.liferay.portos.bo.service.FineLavoriLocalServiceUtil} to * it.tref.liferay.portos.bo.service.FineLavoriLocalServiceUtil} to access the fine lavori local service.
* access the fine lavori local service.
*/ */
private FineLavori initFineLavori(ServiceContext serviceContext) throws PortalException, SystemException { private FineLavori initFineLavori(ServiceContext serviceContext) throws PortalException, SystemException {
@ -83,17 +80,14 @@ public class FineLavoriLocalServiceImpl extends FineLavoriLocalServiceBaseImpl {
User user = userLocalService.getUser(serviceContext.getUserId()); User user = userLocalService.getUser(serviceContext.getUserId());
Date now = new Date(); Date now = new Date();
FineLavori fineLavori = fineLavoriPersistence
FineLavori fineLavori = fineLavoriPersistence.create(counterLocalService.increment(DettPratica.class .create(counterLocalService.increment(DettPratica.class.getName()));
.getName()));
fineLavori.setCompanyId(serviceContext.getCompanyId()); fineLavori.setCompanyId(serviceContext.getCompanyId());
fineLavori.setGroupId(serviceContext.getScopeGroupId()); fineLavori.setGroupId(serviceContext.getScopeGroupId());
fineLavori.setUserId(serviceContext.getUserId()); fineLavori.setUserId(serviceContext.getUserId());
fineLavori.setUserName(user.getFullName()); fineLavori.setUserName(user.getFullName());
fineLavori.setCreateDate(serviceContext.getCreateDate(now)); fineLavori.setCreateDate(serviceContext.getCreateDate(now));
fineLavori.setModifiedDate(serviceContext.getModifiedDate(now)); fineLavori.setModifiedDate(serviceContext.getModifiedDate(now));
// setto parametri di default // setto parametri di default
fineLavori.setParziale(false); fineLavori.setParziale(false);
fineLavori.setDataEffettuazione(null); fineLavori.setDataEffettuazione(null);
@ -102,20 +96,18 @@ public class FineLavoriLocalServiceImpl extends FineLavoriLocalServiceBaseImpl {
fineLavori.setNormEsenteBollo(false); fineLavori.setNormEsenteBollo(false);
fineLavori.setNormEsenteCollaudo(false); fineLavori.setNormEsenteCollaudo(false);
fineLavori.setComunicazioneDirettoreLavori(StringPool.BLANK); fineLavori.setComunicazioneDirettoreLavori(StringPool.BLANK);
return fineLavori; return fineLavori;
} }
@Override
@Indexable(type = IndexableType.REINDEX) @Indexable(type = IndexableType.REINDEX)
public FineLavori addFineLavori(long intPraticaId, ServiceContext serviceContext) throws PortalException, public FineLavori addFineLavori(long intPraticaId, ServiceContext serviceContext) throws PortalException,
SystemException { SystemException {
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId); IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId);
FineLavori fineLavori = initFineLavori(serviceContext); FineLavori fineLavori = initFineLavori(serviceContext);
fineLavori.setGroupId(intPratica.getGroupId()); fineLavori.setGroupId(intPratica.getGroupId());
fineLavori.setIntPraticaId(intPraticaId); fineLavori.setIntPraticaId(intPraticaId);
fineLavoriPersistence.update(fineLavori); fineLavoriPersistence.update(fineLavori);
return fineLavori; return fineLavori;
} }
@ -129,12 +121,10 @@ public class FineLavoriLocalServiceImpl extends FineLavoriLocalServiceBaseImpl {
for (DocPratica docPratica : docPraticas) { for (DocPratica docPratica : docPraticas) {
docPraticaLocalService.deleteDocPratica(docPratica); docPraticaLocalService.deleteDocPratica(docPratica);
} }
List<Pagamento> pagamenti = pagamentoLocalService.findByClassPk(fineLavori.getFineLavoriId()); List<Pagamento> pagamenti = pagamentoLocalService.findByClassPk(fineLavori.getFineLavoriId());
for (Pagamento pagamento : pagamenti) { for (Pagamento pagamento : pagamenti) {
pagamentoLocalService.deletePagamento(pagamento); pagamentoLocalService.deletePagamento(pagamento);
} }
return super.deleteFineLavori(fineLavori); return super.deleteFineLavori(fineLavori);
} }
@ -143,18 +133,17 @@ public class FineLavoriLocalServiceImpl extends FineLavoriLocalServiceBaseImpl {
public FineLavori deleteFineLavori(long fineLavoriId) throws PortalException, SystemException { public FineLavori deleteFineLavori(long fineLavoriId) throws PortalException, SystemException {
FineLavori fineLavori = fineLavoriPersistence.findByPrimaryKey(fineLavoriId); FineLavori fineLavori = fineLavoriPersistence.findByPrimaryKey(fineLavoriId);
return deleteFineLavori(fineLavori); return deleteFineLavori(fineLavori);
} }
@Override
@Indexable(type = IndexableType.REINDEX) @Indexable(type = IndexableType.REINDEX)
public FineLavori updateFineLavori(long userId, long fineLavoriId, long intPraticaId, boolean parziale, public FineLavori updateFineLavori(long userId, long fineLavoriId, long intPraticaId, boolean parziale,
boolean completata, Date dataFineLavori, String codiceFiscaleDelegato, boolean normEsenteBollo, boolean completata, Date dataFineLavori, String codiceFiscaleDelegato, boolean normEsenteBollo,
boolean normEsenteCollaudo, String comunicazioneDirettoreLavori) boolean normEsenteCollaudo, String comunicazioneDirettoreLavori) throws NoSuchFineLavoriException,
throws NoSuchFineLavoriException, SystemException { SystemException {
FineLavori fineLavori = fineLavoriPersistence.findByPrimaryKey(fineLavoriId); FineLavori fineLavori = fineLavoriPersistence.findByPrimaryKey(fineLavoriId);
fineLavori.setParziale(parziale); fineLavori.setParziale(parziale);
fineLavori.setCompletata(completata); fineLavori.setCompletata(completata);
fineLavori.setDataFineLavori(dataFineLavori); fineLavori.setDataFineLavori(dataFineLavori);
@ -162,12 +151,11 @@ public class FineLavoriLocalServiceImpl extends FineLavoriLocalServiceBaseImpl {
fineLavori.setNormEsenteBollo(normEsenteBollo); fineLavori.setNormEsenteBollo(normEsenteBollo);
fineLavori.setNormEsenteCollaudo(normEsenteCollaudo); fineLavori.setNormEsenteCollaudo(normEsenteCollaudo);
fineLavori.setComunicazioneDirettoreLavori(comunicazioneDirettoreLavori); fineLavori.setComunicazioneDirettoreLavori(comunicazioneDirettoreLavori);
fineLavori = fineLavoriPersistence.update(fineLavori); fineLavori = fineLavoriPersistence.update(fineLavori);
return fineLavori; return fineLavori;
} }
@Override
public FineLavori getLastEditable(long intPraticaId) throws SystemException { public FineLavori getLastEditable(long intPraticaId) throws SystemException {
DynamicQuery dynamicQuery = dynamicQuery(); DynamicQuery dynamicQuery = dynamicQuery();
@ -181,6 +169,7 @@ public class FineLavoriLocalServiceImpl extends FineLavoriLocalServiceBaseImpl {
return null; return null;
} }
@Override
public FineLavori getLastCompleted(long intPraticaId) throws SystemException { public FineLavori getLastCompleted(long intPraticaId) throws SystemException {
DynamicQuery dynamicQuery = dynamicQuery(); DynamicQuery dynamicQuery = dynamicQuery();
@ -194,118 +183,42 @@ public class FineLavoriLocalServiceImpl extends FineLavoriLocalServiceBaseImpl {
return null; return null;
} }
@Override
public FineLavori pagaInvia(long fineLavoriId, String codiceFiscaleCommittente, String currentURL, public FineLavori pagaInvia(long fineLavoriId, String codiceFiscaleCommittente, String currentURL,
ServiceContext serviceContext) throws SystemException, PortalException { ServiceContext serviceContext) throws SystemException, PortalException {
FineLavori fineLavori = fineLavoriPersistence.findByPrimaryKey(fineLavoriId); FineLavori fineLavori = fineLavoriPersistence.findByPrimaryKey(fineLavoriId);
BigDecimal importoBolli = PagamentiCommonUtil.getImportoBolli(fineLavori.getCompanyId(), BigDecimal importoBolli = PagamentiCommonUtil.getImportoBolli(fineLavori.getCompanyId(),
fineLavori.getFineLavoriId(), FineLavori.class.getName(), TipoIntegrazioneUtil.FINE_LAVORI); fineLavori.getFineLavoriId(), FineLavori.class.getName(), TipoIntegrazioneUtil.FINE_LAVORI);
fineLavori.setImportoBolli(importoBolli.toString()); fineLavori.setImportoBolli(importoBolli.toString());
fineLavori = updateFineLavori(fineLavori); fineLavori = updateFineLavori(fineLavori);
PagamentiUtil.nuovoPagamento(currentURL, fineLavori.getFineLavoriId(), FineLavori.class.getName(), PagamentiUtil.nuovoPagamento(currentURL, fineLavori.getFineLavoriId(), FineLavori.class.getName(),
PagamentoConstants.PAGAMENTO_BOLLI, importoBolli.toString(), codiceFiscaleCommittente, PagamentoConstants.PAGAMENTO_BOLLI, importoBolli.toString(), codiceFiscaleCommittente, serviceContext);
serviceContext);
return fineLavori; return fineLavori;
} }
// public void sostituisciPagamento(long pagamentoId, long fineLavoriId, @Override
// String public void updateEsitoPagamento(long pagamentoId, long fineLavoriId, String stato) throws SystemException,
// codiceFiscaleCommittente, String mezzo, PortalException {
// String url, ServiceContext serviceContext) throws PortalException,
// SystemException {
//
// FineLavori fineLavori = getFineLavori(fineLavoriId);
// Pagamento pagamento = pagamentoLocalService.getPagamento(pagamentoId);
// String currentUtilizzata = pagamento.getUtilizzata();
// String currentMezzo = pagamento.getMezzo();
//
// boolean irisEnable =
// PagamentiUtil.irisIsEnable(pagamento.getCompanyId());
// if (fineLavori.getPagamentoId() != pagamentoId) {
// throw new PortalException("Pagamento non abbinato alla Fine Lavori");
// }
// if (mezzo.equalsIgnoreCase(PagamentoConstants.MEZZO_MANUALE)) {
// if (irisEnable) {
// throw new
// PortalException("Creazione pagamento manuale con iris enable non possibile");
// } else if
// (currentUtilizzata.equalsIgnoreCase(PagamentoConstants.UTILIZZATA_NON_PAGABILE)
// ||
// currentUtilizzata.equalsIgnoreCase(PagamentoConstants.UTILIZZATA_RIFIUTATA))
// {
// fineLavori.setPagamentoId(0l);
// fineLavori = updateFineLavori(fineLavori);
//
// pagamento.setUtilizzata(PagamentoConstants.UTILIZZATA_SOSTITUITA);
// pagamentoLocalService.updatePagamento(pagamento);
//
// PagamentiUtil.nuovoPagamento(url, fineLavoriId,
// FineLavori.class.getName(),
// pagamento.getImportoBolli(),
// pagamento.getImportoSpeseIstruttoria(), codiceFiscaleCommittente,
// serviceContext);
// } else {
// throw new PortalException("Creazione pagamento manuale con stato " +
// currentUtilizzata +
// " non possibile");
// }
// } else if (mezzo.equalsIgnoreCase(PagamentoConstants.MEZZO_IRIS)) {
// if (irisEnable
// && (currentMezzo.equalsIgnoreCase(PagamentoConstants.MEZZO_MANUALE) ||
// (currentUtilizzata
// .equalsIgnoreCase(PagamentoConstants.UTILIZZATA_NON_PAGABILE) ||
// currentUtilizzata
// .equalsIgnoreCase(PagamentoConstants.UTILIZZATA_RIFIUTATA)))) {
//
// fineLavori.setPagamentoId(0l);
// fineLavori = updateFineLavori(fineLavori);
//
// pagamento.setUtilizzata(PagamentoConstants.UTILIZZATA_SOSTITUITA);
// pagamentoLocalService.updatePagamento(pagamento);
// PagamentiUtil.nuovoPagamento(url, fineLavoriId,
// FineLavori.class.getName(),
// pagamento.getImportoBolli(),
// pagamento.getImportoSpeseIstruttoria(), codiceFiscaleCommittente,
// serviceContext);
// } else {
// throw new PortalException("Pagamento IRIS non sostituibile");
// }
//
// } else {
// throw new PortalException("Mezzo non presente");
// }
//
// }
public void updateEsitoPagamento(long pagamentoId, long fineLavoriId, String stato)
throws SystemException, PortalException {
updateEsitoPagamento(pagamentoId, fineLavoriId, 0l, stato); updateEsitoPagamento(pagamentoId, fineLavoriId, 0l, stato);
} }
@Override
public void updateEsitoPagamento(long pagamentoId, long fineLavoriId, long fileEntryId, String stato) public void updateEsitoPagamento(long pagamentoId, long fineLavoriId, long fileEntryId, String stato)
throws SystemException, PortalException { throws SystemException, PortalException {
Date now = new Date(); Date now = new Date();
FineLavori fineLavori = fineLavoriPersistence.fetchByPrimaryKey(fineLavoriId); FineLavori fineLavori = fineLavoriPersistence.fetchByPrimaryKey(fineLavoriId);
fineLavori.setModifiedDate(now); fineLavori.setModifiedDate(now);
if (stato.equalsIgnoreCase(PagamentoConstants.UTILIZZATA_PAGATA)) { if (stato.equalsIgnoreCase(PagamentoConstants.UTILIZZATA_PAGATA)) {
fineLavori.setCompletata(true); fineLavori.setCompletata(true);
fineLavori.setDataEffettuazione(now); fineLavori.setDataEffettuazione(now);
fineLavori.setNumero(fineLavoriPersistence.countByIntPraticaId_Completata( fineLavori.setNumero(fineLavoriPersistence.countByIntPraticaId_Completata(fineLavori.getIntPraticaId(),
fineLavori.getIntPraticaId(), true) + 1); true) + 1);
fineLavori = updateFineLavori(fineLavori); fineLavori = updateFineLavori(fineLavori);
updateIntPraticaStatus(fineLavori, fineLavori.getIntPraticaId()); updateIntPraticaStatus(fineLavori, fineLavori.getIntPraticaId());
docPraticaLocalService.completeInvalidation(fineLavori.getIntPraticaId()); docPraticaLocalService.completeInvalidation(fineLavori.getIntPraticaId());
IntPratica intPratica = intPraticaLocalService.getIntPratica(fineLavori.getIntPraticaId()); IntPratica intPratica = intPraticaLocalService.getIntPratica(fineLavori.getIntPraticaId());
if (WorkflowUtil.isWorkflowDisattivabile(fineLavori.getIntPraticaId()) if (WorkflowUtil.isWorkflowDisattivabile(fineLavori.getIntPraticaId())
&& Validator.isNotNull(intPratica.getStatusByUserId())) { && Validator.isNotNull(intPratica.getStatusByUserId())) {
@ -317,45 +230,37 @@ public class FineLavoriLocalServiceImpl extends FineLavoriLocalServiceBaseImpl {
|| stato.equalsIgnoreCase(PagamentoConstants.UTILIZZATA_ANNULLATO)) { || stato.equalsIgnoreCase(PagamentoConstants.UTILIZZATA_ANNULLATO)) {
pagamentoLocalService.updatePagamentoUtilizzata(pagamentoId, stato); pagamentoLocalService.updatePagamentoUtilizzata(pagamentoId, stato);
} }
} }
@Override
public FineLavori updateEsito(long fineLavoriId, int stato) throws SystemException, PortalException { public FineLavori updateEsito(long fineLavoriId, int stato) throws SystemException, PortalException {
Date now = new Date(); Date now = new Date();
FineLavori fineLavori = fineLavoriPersistence.fetchByPrimaryKey(fineLavoriId); FineLavori fineLavori = fineLavoriPersistence.fetchByPrimaryKey(fineLavoriId);
fineLavori.setModifiedDate(now); fineLavori.setModifiedDate(now);
fineLavori.setCompletata(true); fineLavori.setCompletata(true);
fineLavori.setDataEffettuazione(now); fineLavori.setDataEffettuazione(now);
fineLavori.setNumero(fineLavoriPersistence.countByIntPraticaId_Completata( fineLavori
fineLavori.getIntPraticaId(), true) + 1); .setNumero(fineLavoriPersistence.countByIntPraticaId_Completata(fineLavori.getIntPraticaId(), true) + 1);
fineLavori = updateFineLavori(fineLavori); fineLavori = updateFineLavori(fineLavori);
updateIntPraticaStatus(fineLavori, fineLavori.getIntPraticaId()); updateIntPraticaStatus(fineLavori, fineLavori.getIntPraticaId());
docPraticaLocalService.completeInvalidation(fineLavori.getIntPraticaId()); docPraticaLocalService.completeInvalidation(fineLavori.getIntPraticaId());
IntPratica intPratica = intPraticaLocalService.getIntPratica(fineLavori.getIntPraticaId()); IntPratica intPratica = intPraticaLocalService.getIntPratica(fineLavori.getIntPraticaId());
if (WorkflowUtil.isWorkflowDisattivabile(fineLavori.getIntPraticaId()) if (WorkflowUtil.isWorkflowDisattivabile(fineLavori.getIntPraticaId())
&& Validator.isNotNull(intPratica.getStatusByUserId())) { && Validator.isNotNull(intPratica.getStatusByUserId())) {
this.inviaMailnotifica(fineLavoriId, intPratica.getStatusByUserId(), now); this.inviaMailnotifica(fineLavoriId, intPratica.getStatusByUserId(), now);
} }
return fineLavori; return fineLavori;
} }
private void inviaMailnotifica(long fineLavoriId, long tecnicoIstruttoreId, Date date) private void inviaMailnotifica(long fineLavoriId, long tecnicoIstruttoreId, Date date) throws SystemException,
throws SystemException, PortalException { PortalException {
FineLavori fineLavori = fineLavoriPersistence.fetchByPrimaryKey(fineLavoriId); FineLavori fineLavori = fineLavoriPersistence.fetchByPrimaryKey(fineLavoriId);
User tecnicoIstruttore = userLocalService.getUser(tecnicoIstruttoreId); User tecnicoIstruttore = userLocalService.getUser(tecnicoIstruttoreId);
String[] to = { tecnicoIstruttore.getEmailAddress() }; String[] to = { tecnicoIstruttore.getEmailAddress() };
String[] cc = new String[0]; String[] cc = new String[0];
String[] ccn = new String[0]; String[] ccn = new String[0];
String tipoPratica = StringPool.BLANK; String tipoPratica = StringPool.BLANK;
long intPraticaId = fineLavori.getIntPraticaId(); long intPraticaId = fineLavori.getIntPraticaId();
if (AzioniPraticheUtil.isDeposito(intPraticaId)) { if (AzioniPraticheUtil.isDeposito(intPraticaId)) {
@ -363,29 +268,23 @@ public class FineLavoriLocalServiceImpl extends FineLavoriLocalServiceBaseImpl {
} else if (AzioniPraticheUtil.isAutorizzazione(intPraticaId)) { } else if (AzioniPraticheUtil.isAutorizzazione(intPraticaId)) {
tipoPratica = LanguageUtil.get(LocaleUtil.ITALIAN, "tipo-pratica-02"); tipoPratica = LanguageUtil.get(LocaleUtil.ITALIAN, "tipo-pratica-02");
} }
JSONObject templateVariables = JSONFactoryUtil.createJSONObject(); JSONObject templateVariables = JSONFactoryUtil.createJSONObject();
templateVariables.put("receiver", tecnicoIstruttore.getFullName()); templateVariables.put("receiver", tecnicoIstruttore.getFullName());
templateVariables.put("tipoPratica", tipoPratica); templateVariables.put("tipoPratica", tipoPratica);
templateVariables.put( templateVariables.put("tipoOggetto",
"tipoOggetto", LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-" + (fineLavori.getParziale() ? "09" : "07")));
LanguageUtil.get(LocaleUtil.ITALIAN, "label-integrazione-" templateVariables.put("dataInvio",
+ (fineLavori.getParziale() ? "09" : "07"))); FastDateFormatFactoryUtil.getSimpleDateFormat("dd/MM/yyyy HH:mm").format(date));
templateVariables.put("dataInvio", FastDateFormatFactoryUtil.getSimpleDateFormat("dd/MM/yyyy HH:mm")
.format(date));
ServiceContext serviceContext = new ServiceContext(); ServiceContext serviceContext = new ServiceContext();
serviceContext.setScopeGroupId(fineLavori.getGroupId()); serviceContext.setScopeGroupId(fineLavori.getGroupId());
serviceContext.setCompanyId(fineLavori.getCompanyId()); serviceContext.setCompanyId(fineLavori.getCompanyId());
serviceContext.setUserId(fineLavori.getUserId()); serviceContext.setUserId(fineLavori.getUserId());
MailUtil.invioMailNotifica(fineLavori.getIntPraticaId(), 0l, fineLavoriId, FineLavori.class.getName(), to, cc,
MailUtil.invioMailNotifica(fineLavori.getIntPraticaId(), 0l, fineLavoriId, ccn, "NOTIFICA-BO", templateVariables, null, serviceContext);
FineLavori.class.getName(), to, cc, ccn, "NOTIFICA-BO", templateVariables, null,
serviceContext);
} }
private IntPratica updateIntPraticaStatus(FineLavori fineLavori, long intPraticaId) private IntPratica updateIntPraticaStatus(FineLavori fineLavori, long intPraticaId) throws PortalException,
throws PortalException, SystemException { SystemException {
IntPratica intPratica = intPraticaLocalService.getIntPratica(intPraticaId); IntPratica intPratica = intPraticaLocalService.getIntPratica(intPraticaId);
if (fineLavori.isParziale()) { if (fineLavori.isParziale()) {
@ -397,111 +296,123 @@ public class FineLavoriLocalServiceImpl extends FineLavoriLocalServiceBaseImpl {
return intPratica; return intPratica;
} }
public FineLavori updateFineLavoriProtocollo(long fineLavoriId, String protocollo) @Override
throws PortalException, SystemException { public FineLavori updateFineLavoriProtocollo(long fineLavoriId, String protocollo) throws PortalException,
SystemException {
FineLavori fineLavori = fineLavoriLocalService.fetchFineLavori(fineLavoriId); FineLavori fineLavori = fineLavoriLocalService.fetchFineLavori(fineLavoriId);
fineLavori.setModifiedDate(new Date()); fineLavori.setModifiedDate(new Date());
fineLavori.setProtocollo(protocollo); fineLavori.setProtocollo(protocollo);
fineLavori.setDtProtocollo(new Date()); fineLavori.setDtProtocollo(new Date());
fineLavori = fineLavoriLocalService.updateFineLavori(fineLavori); fineLavori = fineLavoriLocalService.updateFineLavori(fineLavori);
return fineLavori; return fineLavori;
} }
public FineLavori findByProtocollo(long companyId, long groupId, String protocollo) @Override
throws PortalException, SystemException { public FineLavori findByProtocollo(long companyId, long groupId, String protocollo) throws PortalException,
SystemException {
return fineLavoriPersistence.findByC_G_Protocollo(companyId, groupId, protocollo); return fineLavoriPersistence.findByC_G_Protocollo(companyId, groupId, protocollo);
} }
public FineLavori fetchByProtocollo(long companyId, long groupId, String protocollo) @Override
throws PortalException, SystemException { public FineLavori fetchByProtocollo(long companyId, long groupId, String protocollo) throws PortalException,
SystemException {
return fineLavoriPersistence.fetchByC_G_Protocollo(companyId, groupId, protocollo); return fineLavoriPersistence.fetchByC_G_Protocollo(companyId, groupId, protocollo);
} }
@Override
public FineLavori fetchByProtocollo(String protocollo) throws PortalException, SystemException { public FineLavori fetchByProtocollo(String protocollo) throws PortalException, SystemException {
return fineLavoriPersistence.fetchByProtocollo(protocollo); return fineLavoriPersistence.fetchByProtocollo(protocollo);
} }
@Override
public List<FineLavori> findByIntPraticaId(long intPraticaId, int start, int end, public List<FineLavori> findByIntPraticaId(long intPraticaId, int start, int end,
OrderByComparator orderByComparator) throws SystemException { OrderByComparator orderByComparator) throws SystemException {
return fineLavoriPersistence.findByIntPraticaId(intPraticaId, start, end, orderByComparator); return fineLavoriPersistence.findByIntPraticaId(intPraticaId, start, end, orderByComparator);
} }
@Override
public int countByIntPraticaId(long intPraticaId) throws SystemException { public int countByIntPraticaId(long intPraticaId) throws SystemException {
return fineLavoriPersistence.countByIntPraticaId(intPraticaId); return fineLavoriPersistence.countByIntPraticaId(intPraticaId);
} }
public List<FineLavori> findByIntPraticaId_Parziale(long intPraticaId, boolean parziale, int start, @Override
int end, OrderByComparator orderByComparator) throws SystemException { public List<FineLavori> findByIntPraticaId_Parziale(long intPraticaId, boolean parziale, int start, int end,
OrderByComparator orderByComparator) throws SystemException {
return fineLavoriPersistence.findByIntPraticaId_Parziale(intPraticaId, parziale, start, end, return fineLavoriPersistence.findByIntPraticaId_Parziale(intPraticaId, parziale, start, end, orderByComparator);
orderByComparator);
} }
@Override
public int countByIntPraticaId_Parziale(long intPraticaId, boolean parziale) throws SystemException { public int countByIntPraticaId_Parziale(long intPraticaId, boolean parziale) throws SystemException {
return fineLavoriPersistence.countByIntPraticaId_Parziale(intPraticaId, parziale); return fineLavoriPersistence.countByIntPraticaId_Parziale(intPraticaId, parziale);
} }
public List<FineLavori> findByIntPraticaId_Completata(long intPraticaId, boolean completata, int start, @Override
int end, OrderByComparator orderByComparator) throws SystemException { public List<FineLavori> findByIntPraticaId_Completata(long intPraticaId, boolean completata, int start, int end,
OrderByComparator orderByComparator) throws SystemException {
return fineLavoriPersistence.findByIntPraticaId_Completata(intPraticaId, completata, start, end, return fineLavoriPersistence.findByIntPraticaId_Completata(intPraticaId, completata, start, end,
orderByComparator); orderByComparator);
} }
@Override
public int countByIntPraticaId_Completata(long intPraticaId, boolean completata) throws SystemException { public int countByIntPraticaId_Completata(long intPraticaId, boolean completata) throws SystemException {
return fineLavoriPersistence.countByIntPraticaId_Completata(intPraticaId, completata); return fineLavoriPersistence.countByIntPraticaId_Completata(intPraticaId, completata);
} }
@Override
public List<FineLavori> findByIntPraticaId_CodiceFiscale(long intPraticaId, String codiceFiscaleDelegato, public List<FineLavori> findByIntPraticaId_CodiceFiscale(long intPraticaId, String codiceFiscaleDelegato,
int start, int end, OrderByComparator orderByComparator) throws SystemException { int start, int end, OrderByComparator orderByComparator) throws SystemException {
return fineLavoriPersistence.findByIntPraticaId_CodiceFiscale(intPraticaId, codiceFiscaleDelegato, return fineLavoriPersistence.findByIntPraticaId_CodiceFiscale(intPraticaId, codiceFiscaleDelegato, start, end,
start, end, orderByComparator); orderByComparator);
} }
@Override
public int countByIntPraticaId_CodiceFiscale(long intPraticaId, String codiceFiscaleDelegato) public int countByIntPraticaId_CodiceFiscale(long intPraticaId, String codiceFiscaleDelegato)
throws SystemException { throws SystemException {
return fineLavoriPersistence.countByIntPraticaId_CodiceFiscale(intPraticaId, codiceFiscaleDelegato); return fineLavoriPersistence.countByIntPraticaId_CodiceFiscale(intPraticaId, codiceFiscaleDelegato);
} }
public List<FineLavori> findByCodiceFiscale_Completata(String codiceFiscaleDelegato, boolean completata, @Override
int start, int end, OrderByComparator orderByComparator) throws SystemException { public List<FineLavori> findByCodiceFiscale_Completata(String codiceFiscaleDelegato, boolean completata, int start,
int end, OrderByComparator orderByComparator) throws SystemException {
return fineLavoriPersistence.findByCodiceFiscale_Completata(codiceFiscaleDelegato, completata, start, return fineLavoriPersistence.findByCodiceFiscale_Completata(codiceFiscaleDelegato, completata, start, end,
end, orderByComparator); orderByComparator);
} }
public int countByCodiceFiscale_Completata(String codiceFiscaleDelegato, boolean completata) @Override
throws SystemException { public int countByCodiceFiscale_Completata(String codiceFiscaleDelegato, boolean completata) throws SystemException {
return fineLavoriPersistence.countByCodiceFiscale_Completata(codiceFiscaleDelegato, completata); return fineLavoriPersistence.countByCodiceFiscale_Completata(codiceFiscaleDelegato, completata);
} }
@Override
public List<FineLavori> findByIntPraticaId_Parziale_Completata(long intPraticaId, boolean parziale, public List<FineLavori> findByIntPraticaId_Parziale_Completata(long intPraticaId, boolean parziale,
boolean completata, int start, int end, OrderByComparator orderByComparator) boolean completata, int start, int end, OrderByComparator orderByComparator) throws SystemException {
throws SystemException {
return fineLavoriPersistence.findByIntPraticaId_Parziale_Completata(intPraticaId, parziale, return fineLavoriPersistence.findByIntPraticaId_Parziale_Completata(intPraticaId, parziale, completata, start,
completata, start, end, orderByComparator); end, orderByComparator);
} }
@Override
public int countByIntPraticaId_Parziale_Completata(long intPraticaId, boolean parziale, boolean completata) public int countByIntPraticaId_Parziale_Completata(long intPraticaId, boolean parziale, boolean completata)
throws SystemException { throws SystemException {
return fineLavoriPersistence.countByIntPraticaId_Parziale_Completata(intPraticaId, parziale, return fineLavoriPersistence.countByIntPraticaId_Parziale_Completata(intPraticaId, parziale, completata);
completata);
} }
@Override
public List<FineLavori> findByIntPraticaId_Parziale_leFineLavoriId(long fineLavoriId, long intPraticaId, public List<FineLavori> findByIntPraticaId_Parziale_leFineLavoriId(long fineLavoriId, long intPraticaId,
boolean parziale, int start, int end, OrderByComparator orderByComparator) throws SystemException { boolean parziale, int start, int end, OrderByComparator orderByComparator) throws SystemException {
@ -509,22 +420,22 @@ public class FineLavoriLocalServiceImpl extends FineLavoriLocalServiceBaseImpl {
dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId));
dynamicQuery.add(RestrictionsFactoryUtil.lt("fineLavoriId", fineLavoriId)); dynamicQuery.add(RestrictionsFactoryUtil.lt("fineLavoriId", fineLavoriId));
dynamicQuery.add(RestrictionsFactoryUtil.eq("parziale", parziale)); dynamicQuery.add(RestrictionsFactoryUtil.eq("parziale", parziale));
return dynamicQuery(dynamicQuery, start, end, orderByComparator); return dynamicQuery(dynamicQuery, start, end, orderByComparator);
} }
public int countByIntPraticaId_Parziale_leFineLavoriId(long fineLavoriId, long intPraticaId, @Override
boolean parziale) throws SystemException { public int countByIntPraticaId_Parziale_leFineLavoriId(long fineLavoriId, long intPraticaId, boolean parziale)
throws SystemException {
DynamicQuery dynamicQuery = dynamicQuery(); DynamicQuery dynamicQuery = dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId));
dynamicQuery.add(RestrictionsFactoryUtil.lt("fineLavoriId", fineLavoriId)); dynamicQuery.add(RestrictionsFactoryUtil.lt("fineLavoriId", fineLavoriId));
dynamicQuery.add(RestrictionsFactoryUtil.eq("parziale", parziale)); dynamicQuery.add(RestrictionsFactoryUtil.eq("parziale", parziale));
List<FineLavori> results = dynamicQuery(dynamicQuery); List<FineLavori> results = dynamicQuery(dynamicQuery);
return results.isEmpty() ? 0 : results.size(); return results.size();
} }
@Override
public List<FineLavori> findFineLavoriCompleteNotProtocollo(int start, int end) throws SystemException { public List<FineLavori> findFineLavoriCompleteNotProtocollo(int start, int end) throws SystemException {
DynamicQuery dynamicQuery = getDynamicQueryFineLavoriCompleteNotProtocollo(); DynamicQuery dynamicQuery = getDynamicQueryFineLavoriCompleteNotProtocollo();
@ -532,6 +443,7 @@ public class FineLavoriLocalServiceImpl extends FineLavoriLocalServiceBaseImpl {
return fineLavoriPersistence.findWithDynamicQuery(dynamicQuery, start, end); return fineLavoriPersistence.findWithDynamicQuery(dynamicQuery, start, end);
} }
@Override
public int countFineLavoriCompleteNotProtocollo() throws SystemException { public int countFineLavoriCompleteNotProtocollo() throws SystemException {
DynamicQuery dynamicQuery = getDynamicQueryFineLavoriCompleteNotProtocollo(); DynamicQuery dynamicQuery = getDynamicQueryFineLavoriCompleteNotProtocollo();
@ -550,6 +462,7 @@ public class FineLavoriLocalServiceImpl extends FineLavoriLocalServiceBaseImpl {
return dynamicQuery; return dynamicQuery;
} }
@Override
public List<FineLavori> findFineLavoriCompleteNotGestite(int start, int end) throws SystemException { public List<FineLavori> findFineLavoriCompleteNotGestite(int start, int end) throws SystemException {
DynamicQuery dynamicQuery = getDynamicQueryFineLavoriCompleteNotGestite(); DynamicQuery dynamicQuery = getDynamicQueryFineLavoriCompleteNotGestite();
@ -557,6 +470,7 @@ public class FineLavoriLocalServiceImpl extends FineLavoriLocalServiceBaseImpl {
return fineLavoriPersistence.findWithDynamicQuery(dynamicQuery, start, end); return fineLavoriPersistence.findWithDynamicQuery(dynamicQuery, start, end);
} }
@Override
public int countFineLavoriCompleteNotGestite() throws SystemException { public int countFineLavoriCompleteNotGestite() throws SystemException {
DynamicQuery dynamicQuery = getDynamicQueryFineLavoriCompleteNotGestite(); DynamicQuery dynamicQuery = getDynamicQueryFineLavoriCompleteNotGestite();
@ -573,28 +487,25 @@ public class FineLavoriLocalServiceImpl extends FineLavoriLocalServiceBaseImpl {
return dynamicQuery; return dynamicQuery;
} }
@Override
public List<Long> findIntPraticaByFineLavori() throws PortalException, SystemException { public List<Long> findIntPraticaByFineLavori() throws PortalException, SystemException {
DynamicQuery dynamicQuery = fineLavoriLocalService.dynamicQuery(); DynamicQuery dynamicQuery = fineLavoriLocalService.dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.eq("completata", true)); dynamicQuery.add(RestrictionsFactoryUtil.eq("completata", true));
dynamicQuery.setProjection(ProjectionFactoryUtil.distinct(ProjectionFactoryUtil dynamicQuery.setProjection(ProjectionFactoryUtil.distinct(ProjectionFactoryUtil.property("intPraticaId")));
.property("intPraticaId")));
List<Long> ids = fineLavoriPersistence.findWithDynamicQuery(dynamicQuery); List<Long> ids = fineLavoriPersistence.findWithDynamicQuery(dynamicQuery);
return ids; return ids;
} }
public List<Long> findIntPraticaByFineLavori(String codiceFiscaleDelegatoCollaudo) @Override
throws PortalException, SystemException { public List<Long> findIntPraticaByFineLavori(String codiceFiscaleDelegatoCollaudo) throws PortalException,
SystemException {
DynamicQuery dynamicQuery = fineLavoriLocalService.dynamicQuery(); DynamicQuery dynamicQuery = fineLavoriLocalService.dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.eq("completata", true)); dynamicQuery.add(RestrictionsFactoryUtil.eq("completata", true));
dynamicQuery.add(RestrictionsFactoryUtil.ilike("codiceFiscaleDelegatoCollaudo", dynamicQuery.add(RestrictionsFactoryUtil.ilike("codiceFiscaleDelegatoCollaudo", codiceFiscaleDelegatoCollaudo));
codiceFiscaleDelegatoCollaudo)); dynamicQuery.setProjection(ProjectionFactoryUtil.distinct(ProjectionFactoryUtil.property("intPraticaId")));
dynamicQuery.setProjection(ProjectionFactoryUtil.distinct(ProjectionFactoryUtil
.property("intPraticaId")));
List<Long> ids = fineLavoriPersistence.findWithDynamicQuery(dynamicQuery); List<Long> ids = fineLavoriPersistence.findWithDynamicQuery(dynamicQuery);
return ids; return ids;
} }
} }

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

@ -1,14 +1,12 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
* *
* This library is free software; you can redistribute it and/or modify it under * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* the terms of the GNU Lesser General Public License as published by the Free * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version. * any later version.
* *
* This library is distributed in the hope that it will be useful, but WITHOUT * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details. * details.
*/ */
@ -30,42 +28,41 @@ import com.liferay.portal.kernel.exception.SystemException;
* The implementation of the history workflow action local service. * The implementation of the history workflow action local service.
* *
* <p> * <p>
* 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.HistoryWorkflowActionLocalService} 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.HistoryWorkflowActionLocalService} interface.
* *
* <p> * <p>
* 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.
* </p> * </p>
* *
* @author Davide Barbagallo, 3F Consulting * @author Davide Barbagallo, 3F Consulting
* @see it.tref.liferay.portos.bo.service.base.HistoryWorkflowActionLocalServiceBaseImpl * @see it.tref.liferay.portos.bo.service.base.HistoryWorkflowActionLocalServiceBaseImpl
* @see it.tref.liferay.portos.bo.service.HistoryWorkflowActionLocalServiceUtil * @see it.tref.liferay.portos.bo.service.HistoryWorkflowActionLocalServiceUtil
*/ */
public class HistoryWorkflowActionLocalServiceImpl public class HistoryWorkflowActionLocalServiceImpl extends HistoryWorkflowActionLocalServiceBaseImpl {
extends HistoryWorkflowActionLocalServiceBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link
* * it.tref.liferay.portos.bo.service.HistoryWorkflowActionLocalServiceUtil} to access the history workflow action
* Never reference this interface directly. Always use {@link it.tref.liferay.portos.bo.service.HistoryWorkflowActionLocalServiceUtil} to access the history workflow action local service. * local service.
*/ */
public List<HistoryWorkflowAction> findByIntPratica(long intPraticaId, int sort) throws SystemException{ @Override
public List<HistoryWorkflowAction> findByIntPratica(long intPraticaId, int sort) throws SystemException {
DynamicQuery query = DynamicQueryFactoryUtil.forClass(HistoryWorkflowAction.class); DynamicQuery query = DynamicQueryFactoryUtil.forClass(HistoryWorkflowAction.class);
query.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); query.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId));
if (sort == 0) if (sort == 0) {
query.addOrder(OrderFactoryUtil.asc("createDate")); query.addOrder(OrderFactoryUtil.asc("createDate"));
else } else {
query.addOrder(OrderFactoryUtil.desc("createDate")); query.addOrder(OrderFactoryUtil.desc("createDate"));
}
return HistoryWorkflowActionLocalServiceUtil.dynamicQuery(query); return HistoryWorkflowActionLocalServiceUtil.dynamicQuery(query);
// return historyWorkflowActionPersistence.findByIntPratica(intPraticaId);
} }
@Override @Override
public List<HistoryWorkflowAction> findByIntPratica(long intPraticaId) public List<HistoryWorkflowAction> findByIntPratica(long intPraticaId) throws SystemException {
throws SystemException {
// TODO Auto-generated method stub
return historyWorkflowActionPersistence.findByIntPratica(intPraticaId); return historyWorkflowActionPersistence.findByIntPratica(intPraticaId);
} }
} }

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

@ -1,13 +1,13 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * 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 * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* GNU Lesser General Public License as published by the Free Software Foundation; either version * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* 2.1 of the License, or (at your option) any later version. * any later version.
* *
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* Lesser General Public License for more details. * details.
*/ */
package it.tref.liferay.portos.bo.service.impl; package it.tref.liferay.portos.bo.service.impl;
@ -27,13 +27,12 @@ import com.liferay.portal.service.ServiceContext;
* The implementation of the info fascicolo local service. * The implementation of the info fascicolo local service.
* *
* <p> * <p>
* All custom service methods should be put in this class. Whenever methods are added, rerun * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy
* ServiceBuilder to copy their definitions into the * their definitions into the {@link it.tref.liferay.portos.bo.service.InfoFascicoloLocalService} interface.
* {@link it.tref.liferay.portos.bo.service.InfoFascicoloLocalService} interface.
* *
* <p> * <p>
* This is a local service. Methods of this service will not have security checks based on the * This is a local service. Methods of this service will not have security checks based on the propagated JAAS
* propagated JAAS credentials because this service can only be accessed from within the same VM. * credentials because this service can only be accessed from within the same VM.
* </p> * </p>
* *
* @author Davide Barbagallo, 3F Consulting * @author Davide Barbagallo, 3F Consulting
@ -42,55 +41,55 @@ import com.liferay.portal.service.ServiceContext;
*/ */
public class InfoFascicoloLocalServiceImpl extends InfoFascicoloLocalServiceBaseImpl { public class InfoFascicoloLocalServiceImpl extends InfoFascicoloLocalServiceBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link
* * it.tref.liferay.portos.bo.service.InfoFascicoloLocalServiceUtil} to access the info fascicolo local service.
* Never reference this interface directly. Always use {@link
* it.tref.liferay.portos.bo.service.InfoFascicoloLocalServiceUtil} to access the info fascicolo
* local service.
*/ */
@Override
public InfoFascicolo addInfoFascicolo(long intPraticaId, String numeroProgetto, ServiceContext serviceContext) public InfoFascicolo addInfoFascicolo(long intPraticaId, String numeroProgetto, ServiceContext serviceContext)
throws SystemException, PortalException { throws SystemException, PortalException {
return addInfoFascicolo(intPraticaId, numeroProgetto, false, serviceContext); return addInfoFascicolo(intPraticaId, numeroProgetto, false, serviceContext);
} }
@Override
public InfoFascicolo addInfoFascicolo(long intPraticaId, String numeroProgetto, boolean alreadyImported, public InfoFascicolo addInfoFascicolo(long intPraticaId, String numeroProgetto, boolean alreadyImported,
ServiceContext serviceContext) throws SystemException, PortalException { ServiceContext serviceContext) throws SystemException, PortalException {
User user = userLocalService.getUser(serviceContext.getUserId()); User user = userLocalService.getUser(serviceContext.getUserId());
Date now = new Date(); Date now = new Date();
InfoFascicolo infoFascicolo = infoFascicoloLocalService.createInfoFascicolo(counterLocalService
InfoFascicolo infoFascicolo = .increment(InfoFascicolo.class.getName()));
infoFascicoloLocalService.createInfoFascicolo(counterLocalService.increment(InfoFascicolo.class.getName()));
infoFascicolo.setCompanyId(serviceContext.getCompanyId()); infoFascicolo.setCompanyId(serviceContext.getCompanyId());
infoFascicolo.setGroupId(serviceContext.getScopeGroupId()); infoFascicolo.setGroupId(serviceContext.getScopeGroupId());
infoFascicolo.setUserId(serviceContext.getUserId()); infoFascicolo.setUserId(serviceContext.getUserId());
infoFascicolo.setUserName(user.getScreenName()); infoFascicolo.setUserName(user.getScreenName());
infoFascicolo.setCreateDate(serviceContext.getCreateDate(now)); infoFascicolo.setCreateDate(serviceContext.getCreateDate(now));
infoFascicolo.setModifiedDate(serviceContext.getModifiedDate(now)); infoFascicolo.setModifiedDate(serviceContext.getModifiedDate(now));
infoFascicolo.setIntPraticaId(intPraticaId); infoFascicolo.setIntPraticaId(intPraticaId);
infoFascicolo.setNumeroProgetto(numeroProgetto); infoFascicolo.setNumeroProgetto(numeroProgetto);
infoFascicolo.setAlreadyImported(alreadyImported); infoFascicolo.setAlreadyImported(alreadyImported);
return infoFascicolo; return infoFascicolo;
} }
@Override
public InfoFascicolo findByIntPratica(long intPraticaId) throws SystemException, NoSuchInfoFascicoloException { public InfoFascicolo findByIntPratica(long intPraticaId) throws SystemException, NoSuchInfoFascicoloException {
return infoFascicoloPersistence.findByIntPratica(intPraticaId); return infoFascicoloPersistence.findByIntPratica(intPraticaId);
} }
@Override
public InfoFascicolo fetchByIntPratica(long intPraticaId) throws SystemException, NoSuchInfoFascicoloException { public InfoFascicolo fetchByIntPratica(long intPraticaId) throws SystemException, NoSuchInfoFascicoloException {
return infoFascicoloPersistence.fetchByIntPratica(intPraticaId); return infoFascicoloPersistence.fetchByIntPratica(intPraticaId);
} }
@Override
public InfoFascicolo updateAlreadyImportedField(long infoFascicoloId) throws NoSuchInfoFascicoloException, public InfoFascicolo updateAlreadyImportedField(long infoFascicoloId) throws NoSuchInfoFascicoloException,
SystemException { SystemException {
InfoFascicolo infoFascicolo = infoFascicoloPersistence.findByPrimaryKey(infoFascicoloId); InfoFascicolo infoFascicolo = infoFascicoloPersistence.findByPrimaryKey(infoFascicoloId);
infoFascicolo.setAlreadyImported(true); infoFascicolo.setAlreadyImported(true);
return infoFascicoloLocalService.updateInfoFascicolo(infoFascicolo); return infoFascicoloLocalService.updateInfoFascicolo(infoFascicolo);
} }
} }

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

File diff soppresso perché troppo grande Load Diff

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

@ -1,13 +1,13 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * 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 * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* GNU Lesser General Public License as published by the Free Software Foundation; either version * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* 2.1 of the License, or (at your option) any later version. * any later version.
* *
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* Lesser General Public License for more details. * details.
*/ */
package it.tref.liferay.portos.bo.service.impl; package it.tref.liferay.portos.bo.service.impl;
@ -51,14 +51,12 @@ import com.liferay.portlet.documentlibrary.service.DLAppLocalServiceUtil;
* The implementation of the pagamento local service. * The implementation of the pagamento local service.
* *
* <p> * <p>
* All custom service methods should be put in this class. Whenever methods are * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy
* added, rerun ServiceBuilder to copy their definitions into the * their definitions into the {@link it.tref.liferay.portos.bo.service.PagamentoLocalService} interface.
* {@link it.tref.liferay.portos.bo.service.PagamentoLocalService} interface.
* *
* <p> * <p>
* This is a local service. Methods of this service will not have security * This is a local service. Methods of this service will not have security checks based on the propagated JAAS
* checks based on the propagated JAAS credentials because this service can only * credentials because this service can only be accessed from within the same VM.
* be accessed from within the same VM.
* </p> * </p>
* *
* @author Davide Barbagallo, 3F Consulting * @author Davide Barbagallo, 3F Consulting
@ -67,9 +65,8 @@ import com.liferay.portlet.documentlibrary.service.DLAppLocalServiceUtil;
*/ */
public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl { public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: Never reference this interface directly. Always use * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link
* {@link it.tref.liferay.portos.bo.service.PagamentoLocalServiceUtil} to * it.tref.liferay.portos.bo.service.PagamentoLocalServiceUtil} to access the pagamento local service.
* access the pagamento local service.
*/ */
@Override @Override
public long createPagamentoId() throws SystemException { public long createPagamentoId() throws SystemException {
@ -78,79 +75,65 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl {
} }
@Override @Override
public Pagamento addPagamento(String codice, String causale, String mezzo, public Pagamento addPagamento(String codice, String causale, String mezzo, String codiceFiscaleCommittente,
String codiceFiscaleCommittente, String tipoPagamento, String importo, String utilizzata, String tipoPagamento, String importo, String utilizzata, long classPk, String className,
long classPk, String className, long oldPagamentoId, ServiceContext serviceContext) long oldPagamentoId, ServiceContext serviceContext) throws PortalException, SystemException {
throws PortalException, SystemException {
return addPagamentoAndUpdate(null, codice, causale, mezzo, codiceFiscaleCommittente, tipoPagamento, return addPagamentoAndUpdate(null, codice, causale, mezzo, codiceFiscaleCommittente, tipoPagamento, importo,
importo, utilizzata, classPk, className, false, oldPagamentoId, StringPool.BLANK, null, utilizzata, classPk, className, false, oldPagamentoId, StringPool.BLANK, null, serviceContext);
serviceContext);
} }
@Override @Override
public Pagamento addPagamentoAndUpdate(String codice, String causale, String mezzo, public Pagamento addPagamentoAndUpdate(String codice, String causale, String mezzo,
String codiceFiscaleCommittente, String tipoPagamento, String importo, String utilizzata, String codiceFiscaleCommittente, String tipoPagamento, String importo, String utilizzata, long classPk,
long classPk, String className, long oldPagamentoId, ServiceContext serviceContext) String className, long oldPagamentoId, ServiceContext serviceContext) throws PortalException,
throws PortalException, SystemException { SystemException {
return addPagamentoAndUpdate(null, codice, causale, mezzo, codiceFiscaleCommittente, tipoPagamento, return addPagamentoAndUpdate(null, codice, causale, mezzo, codiceFiscaleCommittente, tipoPagamento, importo,
importo, utilizzata, classPk, className, true, oldPagamentoId, StringPool.BLANK, null, utilizzata, classPk, className, true, oldPagamentoId, StringPool.BLANK, null, serviceContext);
serviceContext);
} }
@Override @Override
public Pagamento addPagamentoAndUpdate(long pagamentoId, String codice, String causale, String mezzo, public Pagamento addPagamentoAndUpdate(long pagamentoId, String codice, String causale, String mezzo,
String codiceFiscaleCommittente, String tipoPagamento, String importo, String utilizzata, String codiceFiscaleCommittente, String tipoPagamento, String importo, String utilizzata, long classPk,
long classPk, String className, long oldPagamentoId, ServiceContext serviceContext) String className, long oldPagamentoId, ServiceContext serviceContext) throws PortalException,
throws PortalException, SystemException { SystemException {
return addPagamentoAndUpdate(pagamentoId, codice, causale, mezzo, codiceFiscaleCommittente, return addPagamentoAndUpdate(pagamentoId, codice, causale, mezzo, codiceFiscaleCommittente, tipoPagamento,
tipoPagamento, importo, utilizzata, classPk, className, true, oldPagamentoId, importo, utilizzata, classPk, className, true, oldPagamentoId, StringPool.BLANK, null, serviceContext);
StringPool.BLANK, null, serviceContext);
} }
@Override @Override
public Pagamento addPagamentoAndUpdate(long pagamentoId, String codice, String causale, String mezzo, public Pagamento addPagamentoAndUpdate(long pagamentoId, String codice, String causale, String mezzo,
String codiceFiscaleCommittente, String tipoImporto, String importo, String utilizzata, String codiceFiscaleCommittente, String tipoImporto, String importo, String utilizzata, long classPk,
long classPk, String className, long oldPagamentoId, String url, String className, long oldPagamentoId, String url, List<ElencoIdentificativiType> iuvs,
List<ElencoIdentificativiType> iuvs, ServiceContext serviceContext) throws PortalException, ServiceContext serviceContext) throws PortalException, SystemException {
SystemException {
return addPagamentoAndUpdate(pagamentoId, codice, causale, mezzo, codiceFiscaleCommittente, return addPagamentoAndUpdate(pagamentoId, codice, causale, mezzo, codiceFiscaleCommittente, tipoImporto,
tipoImporto, importo, utilizzata, classPk, className, true, oldPagamentoId, url, iuvs, importo, utilizzata, classPk, className, true, oldPagamentoId, url, iuvs, serviceContext);
serviceContext);
} }
private Pagamento addPagamentoAndUpdate(Long pagamentoId, String codice, String causale, String mezzo, private Pagamento addPagamentoAndUpdate(Long pagamentoId, String codice, String causale, String mezzo,
String codiceFiscaleCommittente, String tipoPagamento, String importo, String utilizzata, String codiceFiscaleCommittente, String tipoPagamento, String importo, String utilizzata, long classPk,
long classPk, String className, boolean updateReference, long oldPagamentoId, String url, String className, boolean updateReference, long oldPagamentoId, String url,
List<ElencoIdentificativiType> iuvs, ServiceContext serviceContext) throws PortalException, List<ElencoIdentificativiType> iuvs, ServiceContext serviceContext) throws PortalException, SystemException {
SystemException {
Date now = new Date(); Date now = new Date();
if (Validator.isNull(pagamentoId)) { if (Validator.isNull(pagamentoId)) {
pagamentoId = createPagamentoId(); pagamentoId = createPagamentoId();
} }
Pagamento pagamento = createPagamento(pagamentoId); Pagamento pagamento = createPagamento(pagamentoId);
pagamento.setCompanyId(serviceContext.getCompanyId()); pagamento.setCompanyId(serviceContext.getCompanyId());
pagamento.setUserId(serviceContext.getUserId()); pagamento.setUserId(serviceContext.getUserId());
if (serviceContext.getUserId() > 0) { if (serviceContext.getUserId() > 0) {
User user = userPersistence.findByPrimaryKey(serviceContext.getUserId()); User user = userPersistence.findByPrimaryKey(serviceContext.getUserId());
pagamento.setUserName(user.getFullName()); pagamento.setUserName(user.getFullName());
} }
pagamento.setGroupId(serviceContext.getScopeGroupId()); pagamento.setGroupId(serviceContext.getScopeGroupId());
pagamento.setCreateDate(serviceContext.getCreateDate(now)); pagamento.setCreateDate(serviceContext.getCreateDate(now));
pagamento.setModifiedDate(serviceContext.getModifiedDate(now)); pagamento.setModifiedDate(serviceContext.getModifiedDate(now));
pagamento.setClassPk(classPk); pagamento.setClassPk(classPk);
pagamento.setClassName(className); pagamento.setClassName(className);
pagamento.setTipoPagamento(tipoPagamento); pagamento.setTipoPagamento(tipoPagamento);
pagamento.setUrl(url); pagamento.setUrl(url);
pagamento.setCodice(codice); pagamento.setCodice(codice);
@ -170,8 +153,7 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl {
codiceBolli = StringUtil.replaceLast(codiceBolli, StringPool.PIPE, StringPool.BLANK); codiceBolli = StringUtil.replaceLast(codiceBolli, StringPool.PIPE, StringPool.BLANK);
pagamento.setCodice(codiceBolli); pagamento.setCodice(codiceBolli);
} }
long intPraticaId = 0L;
long intPraticaId = 0l;
if (DettPratica.class.getName().equals(className)) { if (DettPratica.class.getName().equals(className)) {
DettPratica dettPratica = dettPraticaPersistence.findByPrimaryKey(classPk); DettPratica dettPratica = dettPraticaPersistence.findByPrimaryKey(classPk);
intPraticaId = dettPratica.getIntPraticaId(); intPraticaId = dettPratica.getIntPraticaId();
@ -188,10 +170,7 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl {
dettPratica.setCodicePagamentoBolli(pagamento.getCodice()); dettPratica.setCodicePagamentoBolli(pagamento.getCodice());
dettPratica.setCausalePagamentoBolli(pagamento.getCausale()); dettPratica.setCausalePagamentoBolli(pagamento.getCausale());
dettPratica.setMezzoPagamentoBolli(mezzo); dettPratica.setMezzoPagamentoBolli(mezzo);
default:
break;
} }
dettPratica = dettPraticaLocalService.updateDettPratica(dettPratica); dettPratica = dettPraticaLocalService.updateDettPratica(dettPratica);
} }
} else if (FineLavori.class.getName().equals(className)) { } else if (FineLavori.class.getName().equals(className)) {
@ -206,10 +185,7 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl {
fineLavori.setCodicePagamento(pagamento.getCodice()); fineLavori.setCodicePagamento(pagamento.getCodice());
fineLavori.setCausalePagamento(pagamento.getCausale()); fineLavori.setCausalePagamento(pagamento.getCausale());
fineLavori.setMezzoPagamento(mezzo); fineLavori.setMezzoPagamento(mezzo);
default:
break;
} }
fineLavori = fineLavoriLocalService.updateFineLavori(fineLavori); fineLavori = fineLavoriLocalService.updateFineLavori(fineLavori);
} }
} else if (Collaudo.class.getName().equals(className)) { } else if (Collaudo.class.getName().equals(className)) {
@ -224,27 +200,19 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl {
collaudo.setCodicePagamento(pagamento.getCodice()); collaudo.setCodicePagamento(pagamento.getCodice());
collaudo.setCausalePagamento(pagamento.getCausale()); collaudo.setCausalePagamento(pagamento.getCausale());
collaudo.setMezzoPagamento(mezzo); collaudo.setMezzoPagamento(mezzo);
default:
break;
} }
collaudo = collaudoLocalService.updateCollaudo(collaudo); collaudo = collaudoLocalService.updateCollaudo(collaudo);
} }
} else { } else {
throw new PortalException("unable to update pagamento for entity type " + className + " with id " throw new PortalException("unable to update pagamento for entity type " + className + " with id " + classPk);
+ classPk);
} }
pagamento.setIntPraticaId(intPraticaId); pagamento.setIntPraticaId(intPraticaId);
pagamento = addPagamento(pagamento); pagamento = addPagamento(pagamento);
return pagamento; return pagamento;
} }
@Override @Override
public Pagamento updatePagamento(long pagamentoId, String importo) throws PortalException, public Pagamento updatePagamento(long pagamentoId, String importo) throws PortalException, SystemException {
SystemException {
Pagamento pagamento = pagamentoPersistence.findByPrimaryKey(pagamentoId); Pagamento pagamento = pagamentoPersistence.findByPrimaryKey(pagamentoId);
pagamento.setImporto(importo); pagamento.setImporto(importo);
@ -275,16 +243,15 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl {
Pagamento pagamento = pagamentoPersistence.findByPrimaryKey(pagamentoId); Pagamento pagamento = pagamentoPersistence.findByPrimaryKey(pagamentoId);
pagamento.setUtilizzata(PagamentoConstants.UTILIZZATA_ANNULLATO); pagamento.setUtilizzata(PagamentoConstants.UTILIZZATA_ANNULLATO);
return updatePagamento(pagamento); return updatePagamento(pagamento);
} }
@Override @Override
public List<Pagamento> findByCommittente_Mezzo(String codiceFiscaleCommittente, String mezzo, int start, public List<Pagamento> findByCommittente_Mezzo(String codiceFiscaleCommittente, String mezzo, int start, int end)
int end) throws SystemException { throws SystemException {
DynamicQuery dynamicQuery = dynamicQueryFindByCommittente_Mezzo_Utilizzata(codiceFiscaleCommittente, DynamicQuery dynamicQuery = dynamicQueryFindByCommittente_Mezzo_Utilizzata(codiceFiscaleCommittente, mezzo,
mezzo, null); null);
return pagamentoPersistence.findWithDynamicQuery(dynamicQuery, start, end, return pagamentoPersistence.findWithDynamicQuery(dynamicQuery, start, end,
OrderByComparatorFactoryUtil.create(PagamentoModelImpl.TABLE_NAME, "createDate", true)); OrderByComparatorFactoryUtil.create(PagamentoModelImpl.TABLE_NAME, "createDate", true));
} }
@ -292,8 +259,8 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl {
@Override @Override
public int countByCommittente_Mezzo(String codiceFiscaleCommittente, String mezzo) throws SystemException { public int countByCommittente_Mezzo(String codiceFiscaleCommittente, String mezzo) throws SystemException {
DynamicQuery dynamicQuery = dynamicQueryFindByCommittente_Mezzo_Utilizzata(codiceFiscaleCommittente, DynamicQuery dynamicQuery = dynamicQueryFindByCommittente_Mezzo_Utilizzata(codiceFiscaleCommittente, mezzo,
mezzo, null); null);
return (int) pagamentoPersistence.countWithDynamicQuery(dynamicQuery); return (int) pagamentoPersistence.countWithDynamicQuery(dynamicQuery);
} }
@ -301,18 +268,18 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl {
public List<Pagamento> findByCommittente_Mezzo_Utilizzata(String codiceFiscaleCommittente, String mezzo, public List<Pagamento> findByCommittente_Mezzo_Utilizzata(String codiceFiscaleCommittente, String mezzo,
String utilizzata, int start, int end) throws SystemException { String utilizzata, int start, int end) throws SystemException {
DynamicQuery dynamicQuery = dynamicQueryFindByCommittente_Mezzo_Utilizzata(codiceFiscaleCommittente, DynamicQuery dynamicQuery = dynamicQueryFindByCommittente_Mezzo_Utilizzata(codiceFiscaleCommittente, mezzo,
mezzo, utilizzata); utilizzata);
return pagamentoPersistence.findWithDynamicQuery(dynamicQuery, start, end, return pagamentoPersistence.findWithDynamicQuery(dynamicQuery, start, end,
OrderByComparatorFactoryUtil.create(PagamentoModelImpl.TABLE_NAME, "createDate", true)); OrderByComparatorFactoryUtil.create(PagamentoModelImpl.TABLE_NAME, "createDate", true));
} }
@Override @Override
public int countByCommittente_Mezzo_Utilizzata(String codiceFiscaleCommittente, String mezzo, public int countByCommittente_Mezzo_Utilizzata(String codiceFiscaleCommittente, String mezzo, String utilizzata)
String utilizzata) throws SystemException { throws SystemException {
DynamicQuery dynamicQuery = dynamicQueryFindByCommittente_Mezzo_Utilizzata(codiceFiscaleCommittente, DynamicQuery dynamicQuery = dynamicQueryFindByCommittente_Mezzo_Utilizzata(codiceFiscaleCommittente, mezzo,
mezzo, utilizzata); utilizzata);
return (int) pagamentoPersistence.countWithDynamicQuery(dynamicQuery); return (int) pagamentoPersistence.countWithDynamicQuery(dynamicQuery);
} }
@ -337,27 +304,27 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl {
} }
@Override @Override
public List<Pagamento> findByMezzo_Utilizzata_CreateDate(String mezzo, String utilizzata, Date date, public List<Pagamento> findByMezzo_Utilizzata_CreateDate(String mezzo, String utilizzata, Date date, int start,
int start, int end) throws SystemException { int end) throws SystemException {
return pagamentoPersistence.findByMezzo_Utilizzata_CreateDate(mezzo, utilizzata, date, start, end, return pagamentoPersistence.findByMezzo_Utilizzata_CreateDate(mezzo, utilizzata, date, start, end,
OrderByComparatorFactoryUtil.create(PagamentoModelImpl.TABLE_NAME, "createDate", true)); OrderByComparatorFactoryUtil.create(PagamentoModelImpl.TABLE_NAME, "createDate", true));
} }
@Override @Override
public int countByMezzo_Utilizzata_EmailPending_CreateDate(String mezzo, String utilizzata, public int countByMezzo_Utilizzata_EmailPending_CreateDate(String mezzo, String utilizzata, boolean emailPending,
boolean emailPending, Date date) throws SystemException { Date date) throws SystemException {
return pagamentoPersistence.countByMezzo_Utilizzata_EmailPending_CreateDate(mezzo, utilizzata, return pagamentoPersistence.countByMezzo_Utilizzata_EmailPending_CreateDate(mezzo, utilizzata, emailPending,
emailPending, date); date);
} }
@Override @Override
public List<Pagamento> findByMezzo_Utilizzata_EmailPending_CreateDate(String mezzo, String utilizzata, public List<Pagamento> findByMezzo_Utilizzata_EmailPending_CreateDate(String mezzo, String utilizzata,
boolean emailPending, Date date, int start, int end) throws SystemException { boolean emailPending, Date date, int start, int end) throws SystemException {
return pagamentoPersistence.findByMezzo_Utilizzata_EmailPending_CreateDate(mezzo, utilizzata, return pagamentoPersistence.findByMezzo_Utilizzata_EmailPending_CreateDate(mezzo, utilizzata, emailPending,
emailPending, date, start, end, date, start, end,
OrderByComparatorFactoryUtil.create(PagamentoModelImpl.TABLE_NAME, "createDate", true)); OrderByComparatorFactoryUtil.create(PagamentoModelImpl.TABLE_NAME, "createDate", true));
} }
@ -385,8 +352,7 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl {
} }
@Override @Override
public int countByMezzo_Utilizzata_CreateDate(String mezzo, String utilizzata, Date date) public int countByMezzo_Utilizzata_CreateDate(String mezzo, String utilizzata, Date date) throws SystemException {
throws SystemException {
return pagamentoPersistence.countByMezzo_Utilizzata_CreateDate(mezzo, utilizzata, date); return pagamentoPersistence.countByMezzo_Utilizzata_CreateDate(mezzo, utilizzata, date);
} }
@ -412,8 +378,8 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl {
} }
@Override @Override
public Pagamento updateEmailPendingPagamento(long pagamentoId, boolean emailPending) public Pagamento updateEmailPendingPagamento(long pagamentoId, boolean emailPending) throws PortalException,
throws PortalException, SystemException { SystemException {
Pagamento pagamento = pagamentoLocalService.getPagamento(pagamentoId); Pagamento pagamento = pagamentoLocalService.getPagamento(pagamentoId);
pagamento.setModifiedDate(new Date()); pagamento.setModifiedDate(new Date());
@ -423,8 +389,7 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl {
private void deleteDettPraticaPagamento(Pagamento pagamento) throws SystemException { private void deleteDettPraticaPagamento(Pagamento pagamento) throws SystemException {
List<DettPratica> dettPraticas = dettPraticaLocalService List<DettPratica> dettPraticas = dettPraticaLocalService.findByPagamentoId(pagamento.getPagamentoId());
.findByPagamentoId(pagamento.getPagamentoId());
for (DettPratica dettPratica : dettPraticas) { for (DettPratica dettPratica : dettPraticas) {
if (PagamentoConstants.PAGAMENTO_ONERI.equals(pagamento.getTipoPagamento())) { if (PagamentoConstants.PAGAMENTO_ONERI.equals(pagamento.getTipoPagamento())) {
dettPratica.setPagamentoIdOneri(0L); dettPratica.setPagamentoIdOneri(0L);
@ -435,8 +400,8 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl {
} }
} }
private DynamicQuery dynamicQueryFindByCommittente_Mezzo_Utilizzata(String codiceFiscaleCommittente, private DynamicQuery dynamicQueryFindByCommittente_Mezzo_Utilizzata(String codiceFiscaleCommittente, String mezzo,
String mezzo, String utilizzata) { String utilizzata) {
DynamicQuery dynamicQuery = pagamentoLocalService.dynamicQuery(); DynamicQuery dynamicQuery = pagamentoLocalService.dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.ilike("codiceFiscaleCommittente", codiceFiscaleCommittente)); dynamicQuery.add(RestrictionsFactoryUtil.ilike("codiceFiscaleCommittente", codiceFiscaleCommittente));
@ -467,17 +432,20 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl {
@Override @Override
public int countByIntPratica(long intPraticaId) throws SystemException { public int countByIntPratica(long intPraticaId) throws SystemException {
return pagamentoPersistence.countByIntPratica(intPraticaId); return pagamentoPersistence.countByIntPratica(intPraticaId);
} }
@Override @Override
public List<Pagamento> findByIntPratica_Visible(long intPraticaId) throws SystemException { public List<Pagamento> findByIntPratica_Visible(long intPraticaId) throws SystemException {
DynamicQuery dynamicQuery = createPagamentiVisibleByIntPratica(intPraticaId); DynamicQuery dynamicQuery = createPagamentiVisibleByIntPratica(intPraticaId);
return pagamentoPersistence.findWithDynamicQuery(dynamicQuery); return pagamentoPersistence.findWithDynamicQuery(dynamicQuery);
} }
@Override @Override
public int countByIntPratica_Visible(long intPraticaId) throws SystemException { public int countByIntPratica_Visible(long intPraticaId) throws SystemException {
DynamicQuery dynamicQuery = createPagamentiVisibleByIntPratica(intPraticaId); DynamicQuery dynamicQuery = createPagamentiVisibleByIntPratica(intPraticaId);
return (int) pagamentoPersistence.countWithDynamicQuery(dynamicQuery); return (int) pagamentoPersistence.countWithDynamicQuery(dynamicQuery);
} }
@ -485,59 +453,52 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl {
private DynamicQuery createPagamentiVisibleByIntPratica(long intPraticaId) { private DynamicQuery createPagamentiVisibleByIntPratica(long intPraticaId) {
DynamicQuery dynamicQuery = pagamentoLocalService.dynamicQuery(); DynamicQuery dynamicQuery = pagamentoLocalService.dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId)); dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId));
dynamicQuery.add(RestrictionsFactoryUtil.ne("utilizzata", PagamentoConstants.UTILIZZATA_IN_CORSO)); dynamicQuery.add(RestrictionsFactoryUtil.ne("utilizzata", PagamentoConstants.UTILIZZATA_IN_CORSO));
return dynamicQuery; return dynamicQuery;
} }
@Override @Override
public void sostituisciPagamento(long pagamentoId, String codiceFiscaleCommittente, String mezzo, public void sostituisciPagamento(long pagamentoId, String codiceFiscaleCommittente, String mezzo, String url,
String url, ServiceContext serviceContext) throws PortalException, SystemException { ServiceContext serviceContext) throws PortalException, SystemException {
Pagamento pagamento = pagamentoLocalService.getPagamento(pagamentoId); Pagamento pagamento = pagamentoLocalService.getPagamento(pagamentoId);
long intPraticaId = pagamento.getIntPraticaId(); long intPraticaId = pagamento.getIntPraticaId();
String currentUtilizzata = pagamento.getUtilizzata(); String currentUtilizzata = pagamento.getUtilizzata();
String currentMezzo = pagamento.getMezzo(); String currentMezzo = pagamento.getMezzo();
String tipoPagamento = pagamento.getTipoPagamento(); String tipoPagamento = pagamento.getTipoPagamento();
boolean irisEnable = PagamentiCommonUtil.irisIsEnable(pagamento.getCompanyId()); boolean irisEnable = PagamentiCommonUtil.irisIsEnable(pagamento.getCompanyId());
if (mezzo.equalsIgnoreCase(PagamentoConstants.MEZZO_MANUALE)) { if (mezzo.equalsIgnoreCase(PagamentoConstants.MEZZO_MANUALE)) {
if (irisEnable) { if (irisEnable) {
throw new PortalException("Creazione pagamento manuale con iris enable non possibile"); throw new PortalException("Creazione pagamento manuale con iris enable non possibile");
} else if (currentUtilizzata.equalsIgnoreCase(PagamentoConstants.UTILIZZATA_NON_PAGABILE) } else if (currentUtilizzata.equalsIgnoreCase(PagamentoConstants.UTILIZZATA_NON_PAGABILE)
|| currentUtilizzata.equalsIgnoreCase(PagamentoConstants.UTILIZZATA_RIFIUTATA) || currentUtilizzata.equalsIgnoreCase(PagamentoConstants.UTILIZZATA_RIFIUTATA)
|| currentUtilizzata.equalsIgnoreCase(PagamentoConstants.UTILIZZATA_ANNULLATO)) { || currentUtilizzata.equalsIgnoreCase(PagamentoConstants.UTILIZZATA_ANNULLATO)) {
if (DettPratica.class.getName().equals(pagamento.getClassName())) { if (DettPratica.class.getName().equals(pagamento.getClassName())) {
DettPratica dettPratica = dettPraticaLocalService.getDettPratica(pagamento.getClassPk()); DettPratica dettPratica = dettPraticaLocalService.getDettPratica(pagamento.getClassPk());
if (PagamentoConstants.PAGAMENTO_ONERI.equals(tipoPagamento)) { if (PagamentoConstants.PAGAMENTO_ONERI.equals(tipoPagamento)) {
dettPratica.setPagamentoIdOneri(0l); dettPratica.setPagamentoIdOneri(0L);
} else { } else {
dettPratica.setPagamentoIdBolli(0l); dettPratica.setPagamentoIdBolli(0L);
} }
dettPratica = dettPraticaLocalService.updateDettPratica(dettPratica); dettPratica = dettPraticaLocalService.updateDettPratica(dettPratica);
} else if (FineLavori.class.getName().equals(pagamento.getClassName())) { } else if (FineLavori.class.getName().equals(pagamento.getClassName())) {
FineLavori fineLavori = fineLavoriLocalService.getFineLavori(pagamento.getClassPk()); FineLavori fineLavori = fineLavoriLocalService.getFineLavori(pagamento.getClassPk());
fineLavori.setPagamentoId(0l); fineLavori.setPagamentoId(0L);
fineLavori = fineLavoriLocalService.updateFineLavori(fineLavori); fineLavori = fineLavoriLocalService.updateFineLavori(fineLavori);
} else if (Collaudo.class.getName().equals(pagamento.getClassName())) { } else if (Collaudo.class.getName().equals(pagamento.getClassName())) {
Collaudo collaudo = collaudoLocalService.getCollaudo(pagamento.getClassPk()); Collaudo collaudo = collaudoLocalService.getCollaudo(pagamento.getClassPk());
collaudo.setPagamentoId(0l); collaudo.setPagamentoId(0L);
collaudo = collaudoLocalService.updateCollaudo(collaudo); collaudo = collaudoLocalService.updateCollaudo(collaudo);
} else { } else {
throw new RuntimeException("unable to replace pagamento for entity type " throw new RuntimeException("unable to replace pagamento for entity type "
+ pagamento.getClassName() + " with id " + pagamento.getClassPk()); + pagamento.getClassName() + " with id " + pagamento.getClassPk());
} }
pagamento.setUtilizzata(PagamentoConstants.UTILIZZATA_SOSTITUITA); pagamento.setUtilizzata(PagamentoConstants.UTILIZZATA_SOSTITUITA);
pagamento.setUtilizzataSostituita(currentUtilizzata); pagamento.setUtilizzataSostituita(currentUtilizzata);
pagamentoLocalService.updatePagamento(pagamento); pagamentoLocalService.updatePagamento(pagamento);
PagamentiUtil.nuovoPagamento(url, pagamento.getClassPk(), pagamento.getClassName(), tipoPagamento,
PagamentiUtil.nuovoPagamento(url, pagamento.getClassPk(), pagamento.getClassName(), pagamento.getImporto(), codiceFiscaleCommittente, serviceContext);
tipoPagamento, pagamento.getImporto(), codiceFiscaleCommittente, serviceContext);
} else { } else {
throw new PortalException("Creazione pagamento manuale con stato " + currentUtilizzata throw new PortalException("Creazione pagamento manuale con stato " + currentUtilizzata
+ " non possibile"); + " non possibile");
@ -548,43 +509,37 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl {
.equalsIgnoreCase(PagamentoConstants.UTILIZZATA_NON_PAGABILE) .equalsIgnoreCase(PagamentoConstants.UTILIZZATA_NON_PAGABILE)
|| currentUtilizzata.equalsIgnoreCase(PagamentoConstants.UTILIZZATA_RIFIUTATA) || currentUtilizzata || currentUtilizzata.equalsIgnoreCase(PagamentoConstants.UTILIZZATA_RIFIUTATA) || currentUtilizzata
.equalsIgnoreCase(PagamentoConstants.UTILIZZATA_ANNULLATO)))) { .equalsIgnoreCase(PagamentoConstants.UTILIZZATA_ANNULLATO)))) {
if (DettPratica.class.getName().equals(pagamento.getClassName())) { if (DettPratica.class.getName().equals(pagamento.getClassName())) {
DettPratica dettPratica = dettPraticaLocalService.getDettPratica(pagamento.getClassPk()); DettPratica dettPratica = dettPraticaLocalService.getDettPratica(pagamento.getClassPk());
if (PagamentoConstants.PAGAMENTO_ONERI.equals(tipoPagamento)) { if (PagamentoConstants.PAGAMENTO_ONERI.equals(tipoPagamento)) {
dettPratica.setPagamentoIdOneri(0l); dettPratica.setPagamentoIdOneri(0L);
} else { } else {
dettPratica.setPagamentoIdBolli(0l); dettPratica.setPagamentoIdBolli(0L);
} }
dettPratica = dettPraticaLocalService.updateDettPratica(dettPratica); dettPratica = dettPraticaLocalService.updateDettPratica(dettPratica);
} else if (FineLavori.class.getName().equals(pagamento.getClassName())) { } else if (FineLavori.class.getName().equals(pagamento.getClassName())) {
FineLavori fineLavori = fineLavoriLocalService.getFineLavori(pagamento.getClassPk()); FineLavori fineLavori = fineLavoriLocalService.getFineLavori(pagamento.getClassPk());
fineLavori.setPagamentoId(0l); fineLavori.setPagamentoId(0L);
fineLavori = fineLavoriLocalService.updateFineLavori(fineLavori); fineLavori = fineLavoriLocalService.updateFineLavori(fineLavori);
} else if (Collaudo.class.getName().equals(pagamento.getClassName())) { } else if (Collaudo.class.getName().equals(pagamento.getClassName())) {
Collaudo collaudo = collaudoLocalService.getCollaudo(pagamento.getClassPk()); Collaudo collaudo = collaudoLocalService.getCollaudo(pagamento.getClassPk());
collaudo.setPagamentoId(0l); collaudo.setPagamentoId(0L);
collaudo = collaudoLocalService.updateCollaudo(collaudo); collaudo = collaudoLocalService.updateCollaudo(collaudo);
} else { } else {
throw new RuntimeException("unable to replace pagamento for entity type " throw new RuntimeException("unable to replace pagamento for entity type "
+ pagamento.getClassName() + " with id " + pagamento.getClassPk()); + pagamento.getClassName() + " with id " + pagamento.getClassPk());
} }
pagamento.setUtilizzata(PagamentoConstants.UTILIZZATA_SOSTITUITA); pagamento.setUtilizzata(PagamentoConstants.UTILIZZATA_SOSTITUITA);
pagamento.setUtilizzataSostituita(currentUtilizzata); pagamento.setUtilizzataSostituita(currentUtilizzata);
pagamentoLocalService.updatePagamento(pagamento); pagamentoLocalService.updatePagamento(pagamento);
PagamentiUtil.nuovoPagamento(url, pagamento.getClassPk(), pagamento.getClassName(), PagamentiUtil.nuovoPagamento(url, pagamento.getClassPk(), pagamento.getClassName(),
pagamento.getTipoPagamento(), pagamento.getImporto(), codiceFiscaleCommittente, pagamento.getTipoPagamento(), pagamento.getImporto(), codiceFiscaleCommittente, serviceContext);
serviceContext);
} else { } else {
throw new PortalException("Pagamento IRIS non sostituibile per intPratica " + intPraticaId); throw new PortalException("Pagamento IRIS non sostituibile per intPratica " + intPraticaId);
} }
} else { } else {
throw new PortalException("Mezzo non presente"); throw new PortalException("Mezzo non presente");
} }
} }
@Override @Override
@ -592,49 +547,38 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl {
ServiceContext serviceContext) throws IOException, PortalException, SystemException { ServiceContext serviceContext) throws IOException, PortalException, SystemException {
Pagamento pagamento = pagamentoLocalService.getPagamento(pagamentoId); Pagamento pagamento = pagamentoLocalService.getPagamento(pagamentoId);
// if (dettPratica.getPagamentoId() != pagamentoId) {
// throw new PortalException("Pagamento non abbinato al dettpratica");
// }
if (pagamento.getMezzo().equalsIgnoreCase(PagamentoConstants.MEZZO_MANUALE) if (pagamento.getMezzo().equalsIgnoreCase(PagamentoConstants.MEZZO_MANUALE)
&& pagamento.getUtilizzata().equalsIgnoreCase(PagamentoConstants.UTILIZZATA_IN_CORSO)) { && pagamento.getUtilizzata().equalsIgnoreCase(PagamentoConstants.UTILIZZATA_IN_CORSO)) {
long fileEntryId = 0l; long fileEntryId = 0L;
long defaultFolderId = configurazioneLocalService.findByC_ChiaveLong(serviceContext.getCompanyId(),
long defaultFolderId = configurazioneLocalService.findByC_ChiaveLong( ConfigurazioneConstants.ATTACHMENT_FOLDER_ID);
serviceContext.getCompanyId(), ConfigurazioneConstants.ATTACHMENT_FOLDER_ID);
Folder defaultFolder = dlAppLocalService.getFolder(defaultFolderId); Folder defaultFolder = dlAppLocalService.getFolder(defaultFolderId);
String folderName = PraticaUtil.getFolderName(pagamento.getClassPk()); String folderName = PraticaUtil.getFolderName(pagamento.getClassPk());
serviceContext.setGroupPermissions(new String[] { ActionKeys.VIEW }); serviceContext.setGroupPermissions(new String[] { ActionKeys.VIEW });
Folder folder = null; Folder folder = null;
try { try {
folder = dlAppLocalService.getFolder(defaultFolder.getRepositoryId(), folder = dlAppLocalService.getFolder(defaultFolder.getRepositoryId(), defaultFolder.getFolderId(),
defaultFolder.getFolderId(), folderName); folderName);
} catch (NoSuchFolderException e) { } catch (NoSuchFolderException e) {
// cartella non presente -> creo cartella // cartella non presente -> creo cartella
folder = dlAppLocalService.addFolder(serviceContext.getUserId(), folder = dlAppLocalService.addFolder(serviceContext.getUserId(), defaultFolder.getRepositoryId(),
defaultFolder.getRepositoryId(), defaultFolder.getFolderId(), folderName, defaultFolder.getFolderId(), folderName, StringPool.BLANK, serviceContext);
StringPool.BLANK, serviceContext);
} }
Date now = new Date(); Date now = new Date();
String title = now.getTime() + StringPool.UNDERLINE + "pagamento_manuale" + StringPool.UNDERLINE String title = now.getTime() + StringPool.UNDERLINE + "pagamento_manuale" + StringPool.UNDERLINE
+ pagamento.getPagamentoId() + StringPool.UNDERLINE + sourceFileName; + pagamento.getPagamentoId() + StringPool.UNDERLINE + sourceFileName;
String description = ""; String description = StringPool.BLANK;
String mimeType = MimeTypesUtil.getContentType(sourceFileName); String mimeType = MimeTypesUtil.getContentType(sourceFileName);
String changeLog = StringPool.BLANK; String changeLog = StringPool.BLANK;
FileEntry fileEntry = dlAppLocalService.addFileEntry(serviceContext.getUserId(), FileEntry fileEntry = dlAppLocalService.addFileEntry(serviceContext.getUserId(), folder.getRepositoryId(),
folder.getRepositoryId(), folder.getFolderId(), now.getTime() + "_" + sourceFileName, folder.getFolderId(), now.getTime() + StringPool.UNDERLINE + sourceFileName, mimeType, title,
mimeType, title, description, changeLog, content, serviceContext); description, changeLog, content, serviceContext);
fileEntryId = fileEntry.getFileEntryId(); fileEntryId = fileEntry.getFileEntryId();
pagamento.setFileEntryId(fileEntryId); pagamento.setFileEntryId(fileEntryId);
pagamento = pagamentoLocalService.updatePagamento(pagamento); pagamento = pagamentoLocalService.updatePagamento(pagamento);
if (DettPratica.class.getName().equals(pagamento.getClassName())) { if (DettPratica.class.getName().equals(pagamento.getClassName())) {
dettPraticaLocalService.updateEsitoPagamento(pagamentoId, pagamento.getClassPk(), dettPraticaLocalService.updateEsitoPagamento(pagamentoId, pagamento.getClassPk(), fileEntryId,
fileEntryId, PagamentoConstants.UTILIZZATA_PAGATA); PagamentoConstants.UTILIZZATA_PAGATA);
} else if (FineLavori.class.getName().equals(pagamento.getClassName())) { } else if (FineLavori.class.getName().equals(pagamento.getClassName())) {
fineLavoriLocalService.updateEsitoPagamento(pagamentoId, pagamento.getClassPk(), fileEntryId, fineLavoriLocalService.updateEsitoPagamento(pagamentoId, pagamento.getClassPk(), fileEntryId,
PagamentoConstants.UTILIZZATA_PAGATA); PagamentoConstants.UTILIZZATA_PAGATA);
@ -645,7 +589,6 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl {
throw new RuntimeException("unable to update pagamento manuale for entity type " throw new RuntimeException("unable to update pagamento manuale for entity type "
+ pagamento.getClassName() + " with id " + pagamento.getClassPk()); + pagamento.getClassName() + " with id " + pagamento.getClassPk());
} }
} else { } else {
throw new SystemException("pagamento manuale non aggiornabile"); throw new SystemException("pagamento manuale non aggiornabile");
} }
@ -656,43 +599,34 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl {
ServiceContext serviceContext) throws PortalException, SystemException { ServiceContext serviceContext) throws PortalException, SystemException {
Pagamento pagamento = pagamentoLocalService.getPagamento(pagamentoId); Pagamento pagamento = pagamentoLocalService.getPagamento(pagamentoId);
if (pagamento.getMezzo().equalsIgnoreCase(PagamentoConstants.MEZZO_MANUALE)) { if (pagamento.getMezzo().equalsIgnoreCase(PagamentoConstants.MEZZO_MANUALE)) {
long fileEntryId = 0l; long fileEntryId = 0L;
long defaultFolderId = configurazioneLocalService.findByC_ChiaveLong(serviceContext.getCompanyId(),
long defaultFolderId = configurazioneLocalService.findByC_ChiaveLong( ConfigurazioneConstants.ATTACHMENT_FOLDER_ID);
serviceContext.getCompanyId(), ConfigurazioneConstants.ATTACHMENT_FOLDER_ID);
Folder defaultFolder = dlAppLocalService.getFolder(defaultFolderId); Folder defaultFolder = dlAppLocalService.getFolder(defaultFolderId);
String folderName = PraticaUtil.getFolderName(pagamento.getClassPk()); String folderName = PraticaUtil.getFolderName(pagamento.getClassPk());
serviceContext.setGroupPermissions(new String[] { ActionKeys.VIEW }); serviceContext.setGroupPermissions(new String[] { ActionKeys.VIEW });
Folder folder = null; Folder folder = null;
try { try {
folder = dlAppLocalService.getFolder(defaultFolder.getRepositoryId(), folder = dlAppLocalService.getFolder(defaultFolder.getRepositoryId(), defaultFolder.getFolderId(),
defaultFolder.getFolderId(), folderName); folderName);
} catch (NoSuchFolderException e) { } catch (NoSuchFolderException e) {
// cartella non presente -> creo cartella // cartella non presente -> creo cartella
folder = dlAppLocalService.addFolder(serviceContext.getUserId(), folder = dlAppLocalService.addFolder(serviceContext.getUserId(), defaultFolder.getRepositoryId(),
defaultFolder.getRepositoryId(), defaultFolder.getFolderId(), folderName, defaultFolder.getFolderId(), folderName, StringPool.BLANK, serviceContext);
StringPool.BLANK, serviceContext);
} }
Date now = new Date(); Date now = new Date();
String title = now.getTime() + StringPool.UNDERLINE + "pagamento_manuale" + StringPool.UNDERLINE String title = now.getTime() + StringPool.UNDERLINE + "pagamento_manuale" + StringPool.UNDERLINE
+ pagamento.getPagamentoId() + StringPool.UNDERLINE + sourceFileName; + pagamento.getPagamentoId() + StringPool.UNDERLINE + sourceFileName;
String description = ""; String description = StringPool.BLANK;
String mimeType = MimeTypesUtil.getContentType(sourceFileName); String mimeType = MimeTypesUtil.getContentType(sourceFileName);
String changeLog = StringPool.BLANK; String changeLog = StringPool.BLANK;
FileEntry fileEntry = dlAppLocalService.addFileEntry(serviceContext.getUserId(), FileEntry fileEntry = dlAppLocalService.addFileEntry(serviceContext.getUserId(), folder.getRepositoryId(),
folder.getRepositoryId(), folder.getFolderId(), now.getTime() + "_" + sourceFileName, folder.getFolderId(), now.getTime() + StringPool.UNDERLINE + sourceFileName, mimeType, title,
mimeType, title, description, changeLog, content, serviceContext); description, changeLog, content, serviceContext);
fileEntryId = fileEntry.getFileEntryId(); fileEntryId = fileEntry.getFileEntryId();
pagamento.setFileEntryId(fileEntryId); pagamento.setFileEntryId(fileEntryId);
pagamento = pagamentoLocalService.updatePagamento(pagamento); pagamento = pagamentoLocalService.updatePagamento(pagamento);
} else { } else {
throw new SystemException("pagamento manuale non aggiornabile"); throw new SystemException("pagamento manuale non aggiornabile");
} }
@ -706,6 +640,7 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl {
@Override @Override
public Pagamento updateOtf(long pagamentoId, boolean otf) throws PortalException, SystemException { public Pagamento updateOtf(long pagamentoId, boolean otf) throws PortalException, SystemException {
Pagamento pagamento = pagamentoLocalService.getPagamento(pagamentoId); Pagamento pagamento = pagamentoLocalService.getPagamento(pagamentoId);
pagamento.setOtf(otf); pagamento.setOtf(otf);
if (otf) { if (otf) {

3
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/Constants.java

@ -1,7 +1,9 @@
package it.tref.liferay.portos.bo.util; package it.tref.liferay.portos.bo.util;
public class Constants extends it.tref.liferay.portos.bo.shared.util.Constants { public class Constants extends it.tref.liferay.portos.bo.shared.util.Constants {
public static final String NUMERO_PROGETTO_KEY_DB = "numero.progetto.key.db"; public static final String NUMERO_PROGETTO_KEY_DB = "numero.progetto.key.db";
public static final String[] AMMINISTRAZIONE_CSV_HEADERS_COMUNI = { "Codice Regione", public static final String[] AMMINISTRAZIONE_CSV_HEADERS_COMUNI = { "Codice Regione",
"Codice Città Metropolitana", "Codice Provincia (1)", "Progressivo del Comune (2)", "Codice Città Metropolitana", "Codice Provincia (1)", "Progressivo del Comune (2)",
"Codice Comune formato alfanumerico", "Denominazione in italiano", "Denominazione in tedesco", "Codice Comune formato alfanumerico", "Denominazione in italiano", "Denominazione in tedesco",
@ -13,6 +15,7 @@ public class Constants extends it.tref.liferay.portos.bo.shared.util.Constants {
"Codice Comune numerico con 103 province (dal 1995 al 2005)", "Codice Catastale del comune", "Codice Comune numerico con 103 province (dal 1995 al 2005)", "Codice Catastale del comune",
"Popolazione legale 2011 (09/10/2011)", "Codice NUTS1 2010", "Codice NUTS2 2010 (3) ", "Popolazione legale 2011 (09/10/2011)", "Codice NUTS1 2010", "Codice NUTS2 2010 (3) ",
"Codice NUTS3 2010", "Codice NUTS1 2006", "Codice NUTS2 2006 (3)", "Codice NUTS3 2006" }; "Codice NUTS3 2010", "Codice NUTS1 2006", "Codice NUTS2 2006 (3)", "Codice NUTS3 2006" };
public static final String[] AMMINISTRAZIONE_CSV_HEADERS_PROVINCE = { "codice_provincia", "provincia", public static final String[] AMMINISTRAZIONE_CSV_HEADERS_PROVINCE = { "codice_provincia", "provincia",
"regione", "sigla" }; "regione", "sigla" };
} }

5
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/ContentType.java

@ -8,10 +8,12 @@ public enum ContentType {
private String contentType; private String contentType;
ContentType(String contentType) { ContentType(String contentType) {
this.contentType = contentType; this.contentType = contentType;
} }
public String getContentType() { public String getContentType() {
return contentType; return contentType;
} }
@ -22,9 +24,6 @@ public enum ContentType {
return value; return value;
} }
} }
throw new IllegalArgumentException("Invalid value for ContentType: " + contentType); throw new IllegalArgumentException("Invalid value for ContentType: " + contentType);
} }
} }

147
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/FestivitaUtil.java

@ -1,147 +0,0 @@
package it.tref.liferay.portos.bo.util;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import org.apache.commons.lang.time.DateUtils;
public class FestivitaUtil {
public final static boolean isFestivo(Date date) {
int year = DateUtils.toCalendar(date).get(Calendar.YEAR);
boolean isCapodanno = is(date, 1, 1);
boolean isBefana = is(date, 6, 1);
boolean isPasqua = isPasqua(date);
boolean isPasquetta = false;
Date dtPasqua = findPasqua(year);
if (dtPasqua != null) {
Calendar calendar = DateUtils.toCalendar(dtPasqua);
while (calendar.get(Calendar.DAY_OF_WEEK) != Calendar.MONDAY) {
calendar.add(Calendar.DATE, 1);
}
isPasquetta = is(date, calendar.getTime());
}
boolean isFestaDellaLiberazione = is(date, 25, 4);
boolean isFestaDeiLavoratori = is(date, 1, 5);
boolean isFestaDellaRepubblica = is(date, 2, 6);
boolean isFerragosto = is(date, 15, 8);
boolean isOgnissanti = is(date, 1, 11);
boolean isImmacolataConcezione = is(date, 8, 12);
boolean isNatale = is(date, 25, 12);
boolean isSantoStefano = is(date, 26, 12);
return isCapodanno || isBefana || isPasqua || isPasquetta || isFestaDellaLiberazione
|| isFestaDeiLavoratori || isFestaDellaRepubblica || isFerragosto || isOgnissanti
|| isImmacolataConcezione || isNatale || isSantoStefano;
}
private final static boolean isPasqua(Date date) {
Calendar calendar = new GregorianCalendar();
calendar.setTime(date);
int year = calendar.get(Calendar.YEAR);
int dateYMD = year * 10000 + calendar.get(Calendar.MONTH) * 100 + calendar.get(Calendar.DAY_OF_MONTH);
Date pasqua = findPasqua(year);
if (pasqua != null) {
calendar.setTime(pasqua);
int pasquaYMD = year * 10000 + calendar.get(Calendar.MONTH) * 100
+ calendar.get(Calendar.DAY_OF_MONTH);
return (pasquaYMD == dateYMD);
}
return false;
}
private final static boolean is(Date date, int day, int month) {
Calendar calendar = DateUtils.toCalendar(date);
return calendar.get(Calendar.DATE) == day && (calendar.get(Calendar.MONTH) + 1) == month;
}
private final static boolean is(Date date, Date date2) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
Calendar calendar2 = Calendar.getInstance();
calendar2.setTime(date2);
return calendar.get(Calendar.DATE) == calendar2.get(Calendar.DATE)
&& calendar.get(Calendar.MONTH) == calendar2.get(Calendar.MONTH);
}
private final static Date findPasqua(int year) {
if ((year < 1573) || (year > 2499)) {
throw null;
}
int a = year % 19;
int b = year % 4;
int c = year % 7;
int m = 0;
int n = 0;
if ((year >= 1583) && (year <= 1699)) {
m = 22;
n = 2;
}
if ((year >= 1700) && (year <= 1799)) {
m = 23;
n = 3;
}
if ((year >= 1800) && (year <= 1899)) {
m = 23;
n = 4;
}
if ((year >= 1900) && (year <= 2099)) {
m = 24;
n = 5;
}
if ((year >= 2100) && (year <= 2199)) {
m = 24;
n = 6;
}
if ((year >= 2200) && (year <= 2299)) {
m = 25;
n = 0;
}
if ((year >= 2300) && (year <= 2399)) {
m = 26;
n = 1;
}
if ((year >= 2400) && (year <= 2499)) {
m = 25;
n = 1;
}
int d = (19 * a + m) % 30;
int e = (2 * b + 4 * c + 6 * d + n) % 7;
Calendar calendar = new GregorianCalendar();
calendar.set(Calendar.YEAR, year);
if (d + e < 10) {
calendar.set(Calendar.YEAR, year);
calendar.set(Calendar.MONTH, Calendar.MARCH);
calendar.set(Calendar.DAY_OF_MONTH, d + e + 22);
} else {
calendar.set(Calendar.MONTH, Calendar.APRIL);
int day = d + e - 9;
if (26 == day) {
day = 19;
}
if ((25 == day) && (28 == d) && (e == 6) && (a > 10)) {
day = 18;
}
calendar.set(Calendar.DAY_OF_MONTH, day);
}
return calendar.getTime();
}
}

42
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/GenioCivileBaseUtil.java

@ -22,6 +22,7 @@ public class GenioCivileBaseUtil {
public static String getDettPraticaURL(long plid, long resourcePrimKey, int status, String portalURL, public static String getDettPraticaURL(long plid, long resourcePrimKey, int status, String portalURL,
boolean maximized) { boolean maximized) {
return getDettPraticaURL(plid, resourcePrimKey, status, portalURL, maximized, null); return getDettPraticaURL(plid, resourcePrimKey, status, portalURL, maximized, null);
} }
@ -29,63 +30,46 @@ public class GenioCivileBaseUtil {
boolean maximized, String redirect) { boolean maximized, String redirect) {
StringBundler sb = new StringBundler(11); StringBundler sb = new StringBundler(11);
sb.append(portalURL).append(PortalUtil.getPathMain()).append("/portal/dettaglio_pratica/find_entry?p_l_id=")
sb.append(portalURL); .append(String.valueOf(plid)).append(StringPool.AMPERSAND);
sb.append(PortalUtil.getPathMain());
sb.append("/portal/dettaglio_pratica/find_entry");
sb.append(StringPool.QUESTION);
sb.append("p_l_id");
sb.append(StringPool.EQUAL);
sb.append(String.valueOf(plid));
sb.append(StringPool.AMPERSAND);
// control panel // control panel
if (Validator.isNotNull(redirect)) { if (Validator.isNotNull(redirect)) {
sb.append("doAsGroupId"); sb.append("doAsGroupId=").append(HttpUtil.getParameter(redirect, "doAsGroupId", false))
sb.append(StringPool.EQUAL); .append(StringPool.AMPERSAND);
sb.append(HttpUtil.getParameter(redirect, "doAsGroupId", false));
sb.append(StringPool.AMPERSAND);
} }
sb.append("resourcePrimKey"); sb.append("resourcePrimKey=").append(String.valueOf(resourcePrimKey));
sb.append(StringPool.EQUAL);
sb.append(String.valueOf(resourcePrimKey));
String url = sb.toString(); String url = sb.toString();
if (status != WorkflowConstants.STATUS_APPROVED) { if (status != WorkflowConstants.STATUS_APPROVED) {
url = HttpUtil.addParameter(url, "status", String.valueOf(status)); url = HttpUtil.addParameter(url, "status", String.valueOf(status));
} }
if (maximized) { if (maximized) {
url = HttpUtil.addParameter(url, "maximized", String.valueOf(maximized)); url = HttpUtil.addParameter(url, "maximized", String.valueOf(maximized));
} }
if (Validator.isNotNull(redirect)) { if (Validator.isNotNull(redirect)) {
url = HttpUtil.addParameter(url, "redirect", redirect); url = HttpUtil.addParameter(url, "redirect", redirect);
} }
return url; return url;
} }
public static String getDettPraticaURL(HttpServletRequest request, long plid, long resourcePrimKey, public static String getDettPraticaURL(HttpServletRequest request, long plid, long resourcePrimKey, int status)
int status) throws PortletModeException, WindowStateException { throws PortletModeException, WindowStateException {
return getDettPraticaURL(request, plid, resourcePrimKey, status, null); return getDettPraticaURL(request, plid, resourcePrimKey, status, null);
} }
public static String getDettPraticaURL(HttpServletRequest request, long plid, long resourcePrimKey, public static String getDettPraticaURL(HttpServletRequest request, long plid, long resourcePrimKey, int status,
int status, String redirect) throws PortletModeException, WindowStateException { String redirect) throws PortletModeException, WindowStateException {
PortletURL url = PortletURLFactoryUtil.create(request, PortletKeys.FASCICOLO, plid, PortletURL url = PortletURLFactoryUtil
PortletRequest.RENDER_PHASE); .create(request, PortletKeys.FASCICOLO, plid, PortletRequest.RENDER_PHASE);
url.setParameter("mvcPath", "/html/pratichegeniocivile/view.jsp"); url.setParameter("mvcPath", "/html/pratichegeniocivile/view.jsp");
url.setParameter("resourcePrimKey", String.valueOf(resourcePrimKey)); url.setParameter("resourcePrimKey", String.valueOf(resourcePrimKey));
url.setParameter("redirect", redirect); url.setParameter("redirect", redirect);
url.setPortletMode(PortletMode.VIEW); url.setPortletMode(PortletMode.VIEW);
url.setWindowState(LiferayWindowState.POP_UP); url.setWindowState(LiferayWindowState.POP_UP);
if (status != WorkflowConstants.STATUS_APPROVED) { if (status != WorkflowConstants.STATUS_APPROVED) {
url.setParameter("status", String.valueOf(status)); url.setParameter("status", String.valueOf(status));
} }
return url.toString(); return url.toString();
} }
} }

6
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/GestioneFirmeUtil.java

@ -29,22 +29,24 @@ public class GestioneFirmeUtil {
public static boolean hasFirmaPermision(long userId, long groupId) throws PortalException, public static boolean hasFirmaPermision(long userId, long groupId) throws PortalException,
SystemException { SystemException {
return UserGroupRoleLocalServiceUtil.hasUserGroupRole(userId, groupId, Constants.ROLE_NAME_FIRMA, return UserGroupRoleLocalServiceUtil.hasUserGroupRole(userId, groupId, Constants.ROLE_NAME_FIRMA,
true); true);
} }
public static boolean hasFirmaPermisionDirigente(long userId, long groupId) throws PortalException, public static boolean hasFirmaPermisionDirigente(long userId, long groupId) throws PortalException,
SystemException { SystemException {
return UserGroupRoleLocalServiceUtil.hasUserGroupRole(userId, groupId, return UserGroupRoleLocalServiceUtil.hasUserGroupRole(userId, groupId,
Constants.ROLE_NAME_FIRMA_DIRIGENTE, true); Constants.ROLE_NAME_FIRMA_DIRIGENTE, true);
} }
public static boolean userCanSignAvviso(long userId, long groupId, long avvisoId) throws PortalException, public static boolean userCanSignAvviso(long userId, long groupId, long avvisoId) throws PortalException,
SystemException { SystemException {
Avviso avviso = AvvisoLocalServiceUtil.getAvviso(avvisoId); Avviso avviso = AvvisoLocalServiceUtil.getAvviso(avvisoId);
boolean firma = hasFirmaPermision(userId, groupId); boolean firma = hasFirmaPermision(userId, groupId);
boolean firmaDirigente = hasFirmaPermisionDirigente(userId, groupId); boolean firmaDirigente = hasFirmaPermisionDirigente(userId, groupId);
return firmaDirigente || (firma && tipoDocumentoFirmaBase.contains(avviso.getTipoDocumento())); return firmaDirigente || (firma && tipoDocumentoFirmaBase.contains(avviso.getTipoDocumento()));
} }
@ -53,7 +55,6 @@ public class GestioneFirmeUtil {
Role role = RoleLocalServiceUtil.getRole(companyId, Constants.ROLE_NAME_FIRMA_DIRIGENTE); Role role = RoleLocalServiceUtil.getRole(companyId, Constants.ROLE_NAME_FIRMA_DIRIGENTE);
String codiceFiscaleFirma = StringPool.BLANK; String codiceFiscaleFirma = StringPool.BLANK;
if (tipoDocumentoFirmaBase.contains(tipoDocumento)) { if (tipoDocumentoFirmaBase.contains(tipoDocumento)) {
role = RoleLocalServiceUtil.getRole(companyId, Constants.ROLE_NAME_FIRMA_PO); role = RoleLocalServiceUtil.getRole(companyId, Constants.ROLE_NAME_FIRMA_PO);
} else { } else {
@ -61,7 +62,6 @@ public class GestioneFirmeUtil {
} }
List<UserGroupRole> UserGroupRoles = UserGroupRoleLocalServiceUtil.getUserGroupRolesByGroupAndRole( List<UserGroupRole> UserGroupRoles = UserGroupRoleLocalServiceUtil.getUserGroupRolesByGroupAndRole(
groupId, role.getRoleId()); groupId, role.getRoleId());
if (UserGroupRoles.size() == 1) { if (UserGroupRoles.size() == 1) {
User user = UserLocalServiceUtil.getUser(UserGroupRoles.get(0).getUserId()); User user = UserLocalServiceUtil.getUser(UserGroupRoles.get(0).getUserId());
codiceFiscaleFirma = user.getScreenName(); codiceFiscaleFirma = user.getScreenName();

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/MockAllegato.java

@ -5,6 +5,7 @@ public class MockAllegato {
public String status, name, tipo, invalidato; public String status, name, tipo, invalidato;
public MockAllegato(boolean checked, String status, String name, String tipo, String invalidato) { public MockAllegato(boolean checked, String status, String name, String tipo, String invalidato) {
super(); super();
this.checked = checked; this.checked = checked;
this.status = status; this.status = status;

97
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/util/PagamentiUtil.java

@ -49,58 +49,48 @@ public abstract class PagamentiUtil {
private static final Log _log = LogFactoryUtil.getLog(PagamentiUtil.class); private static final Log _log = LogFactoryUtil.getLog(PagamentiUtil.class);
public static void verificaPagamentoIRIS(Pagamento pagamento) throws IOException, SystemException, public static void verificaPagamentoIRIS(Pagamento pagamento) throws IOException, SystemException, PortalException {
PortalException {
String statoPagamento = callVerificaPagamenti(pagamento); String statoPagamento = callVerificaPagamenti(pagamento);
if (Validator.isNotNull(statoPagamento)) { if (Validator.isNotNull(statoPagamento)) {
if (DettPratica.class.getName().equals(pagamento.getClassName())) { if (DettPratica.class.getName().equals(pagamento.getClassName())) {
DettPraticaLocalServiceUtil.updateEsitoPagamento(pagamento.getPagamentoId(), DettPraticaLocalServiceUtil.updateEsitoPagamento(pagamento.getPagamentoId(), pagamento.getClassPk(),
pagamento.getClassPk(), statoPagamento); statoPagamento);
} else if (FineLavori.class.getName().equals(pagamento.getClassName())) { } else if (FineLavori.class.getName().equals(pagamento.getClassName())) {
FineLavoriLocalServiceUtil.updateEsitoPagamento(pagamento.getPagamentoId(), FineLavoriLocalServiceUtil.updateEsitoPagamento(pagamento.getPagamentoId(), pagamento.getClassPk(),
pagamento.getClassPk(), statoPagamento); statoPagamento);
} else if (Collaudo.class.getName().equals(pagamento.getClassName())) { } else if (Collaudo.class.getName().equals(pagamento.getClassName())) {
CollaudoLocalServiceUtil.updateEsitoPagamento(pagamento.getPagamentoId(), CollaudoLocalServiceUtil.updateEsitoPagamento(pagamento.getPagamentoId(), pagamento.getClassPk(),
pagamento.getClassPk(), statoPagamento); statoPagamento);
} else { } else {
throw new RuntimeException("unable to update pagamento esito for entity type " throw new RuntimeException("unable to update pagamento esito for entity type "
+ pagamento.getClassName() + " with id " + pagamento.getClassPk()); + pagamento.getClassName() + " with id " + pagamento.getClassPk());
} }
} }
} }
private static String callVerificaPagamenti(Pagamento pagamento) throws SystemException { private static String callVerificaPagamenti(Pagamento pagamento) throws SystemException {
long companyId = pagamento.getCompanyId(); long companyId = pagamento.getCompanyId();
long groupId = pagamento.getGroupId(); long groupId = pagamento.getGroupId();
if (PagamentoConstants.PAGAMENTO_ONERI.equals(pagamento.getTipoPagamento())) { if (PagamentoConstants.PAGAMENTO_ONERI.equals(pagamento.getTipoPagamento())) {
InformazioniPagamentoType[] statoPagamentiType = IrisVerificaPagamenti.verificaPagamenti( InformazioniPagamentoType[] statoPagamentiType = IrisVerificaPagamenti.verificaPagamenti(companyId,
companyId, groupId, pagamento.getCodice(), pagamento.getTipoPagamento()); groupId, pagamento.getCodice(), pagamento.getTipoPagamento());
return checkStatoPagamento(statoPagamentiType); return checkStatoPagamento(statoPagamentiType);
} else if (PagamentoConstants.PAGAMENTO_BOLLI.equals(pagamento.getTipoPagamento())) { } else if (PagamentoConstants.PAGAMENTO_BOLLI.equals(pagamento.getTipoPagamento())) {
List<IUV> iuvs = IUVLocalServiceUtil.findByPagamento(pagamento.getPagamentoId()); List<IUV> iuvs = IUVLocalServiceUtil.findByPagamento(pagamento.getPagamentoId());
List<String> statiPagamento = new ArrayList<String>(); List<String> statiPagamento = new ArrayList<String>();
for (IUV iuv : iuvs) { for (IUV iuv : iuvs) {
InformazioniPagamentoType[] statoPagamentiType = IrisVerificaPagamenti.verificaPagamenti( InformazioniPagamentoType[] statoPagamentiType = IrisVerificaPagamenti.verificaPagamenti(companyId,
companyId, groupId, iuv.getCodice(), pagamento.getTipoPagamento()); groupId, iuv.getCodice(), pagamento.getTipoPagamento());
GenericUtils.addIfnotExist(statiPagamento, checkStatoPagamento(statoPagamentiType)); GenericUtils.addIfnotExist(statiPagamento, checkStatoPagamento(statoPagamentiType));
} }
if (statiPagamento.size() > 1) { if (statiPagamento.size() > 1) {
// return
// VerificaStatoPagamentoDettagliato._POSIZIONE_CON_PAG_IN_CORSO;
return StringPool.BLANK; return StringPool.BLANK;
} }
return statiPagamento.get(0); return statiPagamento.get(0);
} }
throw new SystemException("error.geniocivile.tipopagamento.notexist"); throw new SystemException("error.geniocivile.tipopagamento.notexist");
} }
private static String checkStatoPagamento(InformazioniPagamentoType[] statoPagamentiType) { private static String checkStatoPagamento(InformazioniPagamentoType[] statoPagamentiType) {
@ -108,10 +98,8 @@ public abstract class PagamentiUtil {
if (statoPagamentiType == null) { if (statoPagamentiType == null) {
return null; return null;
} }
InformazioniPagamentoType statoPagamentoType = statoPagamentiType[0]; InformazioniPagamentoType statoPagamentoType = statoPagamentiType[0];
String statoPendenza = statoPagamentoType.getStato().getValue(); String statoPendenza = statoPagamentoType.getStato().getValue();
String statoPagamento = StringPool.BLANK; String statoPagamento = StringPool.BLANK;
if (statoPendenza.equals(VerificaStatoPagamentoDettagliato._POSIZIONE_NON_PAGATA)) { if (statoPendenza.equals(VerificaStatoPagamentoDettagliato._POSIZIONE_NON_PAGATA)) {
if (statoPagamentoType.getDescrizioneStato().equalsIgnoreCase( if (statoPagamentoType.getDescrizioneStato().equalsIgnoreCase(
@ -127,26 +115,17 @@ public abstract class PagamentiUtil {
} else if (statoPendenza.equals(VerificaStatoPagamentoDettagliato._POSIZIONE_NON_PAGABILE)) { } else if (statoPendenza.equals(VerificaStatoPagamentoDettagliato._POSIZIONE_NON_PAGABILE)) {
// "Posizione non pagabile" -> esito negativo // "Posizione non pagabile" -> esito negativo
statoPagamento = PagamentoConstants.UTILIZZATA_NON_PAGABILE; statoPagamento = PagamentoConstants.UTILIZZATA_NON_PAGABILE;
// } else if (statoPendenza.equals(StatoPagamentoType._value3)) {
// "Pagamento non ancora eseguito" -> si riprova successivamente
// if (!pagamento.getOtf()) {
// return;
// }
// "Pagamento non eseguito" -> esito negativo
// statoPagamento = PagamentoConstants.UTILIZZATA_RIFIUTATA;
_log.debug(statoPagamento); _log.debug(statoPagamento);
} else if (statoPendenza.equals(VerificaStatoPagamentoDettagliato._POSIZIONE_PAGATA) } else if (statoPendenza.equals(VerificaStatoPagamentoDettagliato._POSIZIONE_PAGATA)
|| statoPendenza.equals(VerificaStatoPagamentoDettagliato._POSIZIONE_PAGATA_SBF)) { || statoPendenza.equals(VerificaStatoPagamentoDettagliato._POSIZIONE_PAGATA_SBF)) {
// "Pagamento eseguito" -> esito positivo // "Pagamento eseguito" -> esito positivo
statoPagamento = PagamentoConstants.UTILIZZATA_PAGATA; statoPagamento = PagamentoConstants.UTILIZZATA_PAGATA;
_log.debug(statoPagamento); _log.debug(statoPagamento);
} else if (statoPendenza } else if (statoPendenza.equalsIgnoreCase(VerificaStatoPagamentoDettagliato._POSIZIONE_CON_PAG_IN_CORSO)) {
.equalsIgnoreCase(VerificaStatoPagamentoDettagliato._POSIZIONE_CON_PAG_IN_CORSO)) {
// "Pagamento non eseguito" -> esito in corso // "Pagamento non eseguito" -> esito in corso
statoPagamento = PagamentoConstants.UTILIZZATA_IN_CORSO; statoPagamento = PagamentoConstants.UTILIZZATA_IN_CORSO;
return StringPool.BLANK; return StringPool.BLANK;
} }
return statoPagamento; return statoPagamento;
} }
@ -169,18 +148,16 @@ public abstract class PagamentiUtil {
return pagamento.getCreateDate().compareTo(getScadenzaPending()) < 0; return pagamento.getCreateDate().compareTo(getScadenzaPending()) < 0;
} }
public static Pagamento nuovoPagamento(String currentURL, long classPk, String className, public static Pagamento nuovoPagamento(String currentURL, long classPk, String className, String tipoPagamento,
String tipoPagamento, String importo, String codiceFiscaleCommittente, String importo, String codiceFiscaleCommittente, ServiceContext serviceContext) throws PortalException,
ServiceContext serviceContext) throws PortalException, SystemException { SystemException {
boolean irisDisabled = !PagamentiCommonUtil.irisIsEnable(serviceContext.getCompanyId()); boolean irisDisabled = !PagamentiCommonUtil.irisIsEnable(serviceContext.getCompanyId());
boolean esenzioneBolli = false; boolean esenzioneBolli = false;
boolean esenzioneSpeseIstruttoria = false; boolean esenzioneSpeseIstruttoria = false;
String tipoIntegrazione = StringPool.BLANK; String tipoIntegrazione = StringPool.BLANK;
long pagamentoId = 0l; long pagamentoId = 0L;
long intPraticaId = 0l; long intPraticaId = 0L;
if (DettPratica.class.getName().equals(className)) { if (DettPratica.class.getName().equals(className)) {
DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(classPk); DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(classPk);
esenzioneBolli = dettPratica.isNormEsenteBollo(); esenzioneBolli = dettPratica.isNormEsenteBollo();
@ -217,15 +194,12 @@ public abstract class PagamentiUtil {
} else { } else {
throw new SystemException("error.fields.pratica.pagamento.classPk.invalid"); throw new SystemException("error.fields.pratica.pagamento.classPk.invalid");
} }
List<String> importi = new ArrayList<>(); List<String> importi = new ArrayList<>();
if (esenzioneSpeseIstruttoria && esenzioneBolli) { if (esenzioneSpeseIstruttoria && esenzioneBolli) {
throw new SystemException("error.fields.pratica.pagamento.esente.oneri.bolli"); throw new SystemException("error.fields.pratica.pagamento.esente.oneri.bolli");
} else { } else {
if ((PagamentoConstants.PAGAMENTO_BOLLI.equals(tipoPagamento) && !esenzioneBolli) if ((PagamentoConstants.PAGAMENTO_BOLLI.equals(tipoPagamento) && !esenzioneBolli)
|| (PagamentoConstants.PAGAMENTO_ONERI.equals(tipoPagamento) && !esenzioneSpeseIstruttoria)) { || (PagamentoConstants.PAGAMENTO_ONERI.equals(tipoPagamento) && !esenzioneSpeseIstruttoria)) {
if (Validator.isNotNull(importo)) { if (Validator.isNotNull(importo)) {
importo = importo.replaceAll(StringPool.COMMA, StringPool.PERIOD); importo = importo.replaceAll(StringPool.COMMA, StringPool.PERIOD);
try { try {
@ -240,7 +214,6 @@ public abstract class PagamentiUtil {
} else if (PagamentoConstants.PAGAMENTO_ONERI.equals(tipoPagamento)) { } else if (PagamentoConstants.PAGAMENTO_ONERI.equals(tipoPagamento)) {
importi.add(importo); importi.add(importo);
} }
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
throw new SystemException("error.fields.pratica.pagamento." throw new SystemException("error.fields.pratica.pagamento."
+ (PagamentoConstants.PAGAMENTO_BOLLI.equals(tipoPagamento) ? "bolli" + (PagamentoConstants.PAGAMENTO_BOLLI.equals(tipoPagamento) ? "bolli"
@ -258,10 +231,8 @@ public abstract class PagamentiUtil {
return null; return null;
} }
} }
if (!irisDisabled) { if (!irisDisabled) {
if (Validator.isNull(pagamentoId)) { if (Validator.isNull(pagamentoId)) {
Soggetto committente = SoggettoLocalServiceUtil Soggetto committente = SoggettoLocalServiceUtil
.getValidTmpByIntPratica_CodiceFiscale_TipologiaSoggetto(intPraticaId, .getValidTmpByIntPratica_CodiceFiscale_TipologiaSoggetto(intPraticaId,
codiceFiscaleCommittente, TipoSoggettoUtil.COMMITTENTE); codiceFiscaleCommittente, TipoSoggettoUtil.COMMITTENTE);
@ -270,59 +241,44 @@ public abstract class PagamentiUtil {
if (codiceProvincia.equalsIgnoreCase("ee")) { if (codiceProvincia.equalsIgnoreCase("ee")) {
provincia = "EE"; provincia = "EE";
} else { } else {
Provincia provinciaEntity = ProvinciaLocalServiceUtil.fetchByC_C( Provincia provinciaEntity = ProvinciaLocalServiceUtil.fetchByC_C(serviceContext.getCompanyId(),
serviceContext.getCompanyId(), codiceProvincia); codiceProvincia);
if (Validator.isNotNull(provinciaEntity)) { if (Validator.isNotNull(provinciaEntity)) {
provincia = provinciaEntity.getSigla(); provincia = provinciaEntity.getSigla();
} }
} }
String codice = IrisCommonUtil.createCodicePendenza(); String codice = IrisCommonUtil.createCodicePendenza();
String causale = IrisCommonUtil.getDescrizioneCausale(tipoPagamento); String causale = IrisCommonUtil.getDescrizioneCausale(tipoPagamento);
long irisPagamentoId = PagamentoLocalServiceUtil.createPagamentoId(); long irisPagamentoId = PagamentoLocalServiceUtil.createPagamentoId();
currentURL = StringUtil.replaceLast(currentURL, "/0", StringPool.SLASH + irisPagamentoId); currentURL = StringUtil.replaceLast(currentURL, "/0", StringPool.SLASH + irisPagamentoId);
String auth = HttpUtil.getParameter(currentURL, "p_auth", false); String auth = HttpUtil.getParameter(currentURL, "p_auth", false);
// XXX Se non li rimuovi non funziona più // XXX Se non li rimuovi non funziona più
Map<String, String[]> parameters = HttpUtil.getParameterMap(HttpUtil Map<String, String[]> parameters = HttpUtil.getParameterMap(HttpUtil.getQueryString(currentURL));
.getQueryString(currentURL));
for (String key : parameters.keySet()) { for (String key : parameters.keySet()) {
currentURL = HttpUtil.removeParameter(currentURL, key); currentURL = HttpUtil.removeParameter(currentURL, key);
} }
if (Validator.isNotNull(auth)) { if (Validator.isNotNull(auth)) {
currentURL = HttpUtil.addParameter(currentURL, "p_auth", auth); currentURL = HttpUtil.addParameter(currentURL, "p_auth", auth);
} }
if (Validator.isNull(codiceFiscaleCommittente)) { if (Validator.isNull(codiceFiscaleCommittente)) {
throw new SystemException("error.fields.pratica.pagamento.codicefiscale.richiesto"); throw new SystemException("error.fields.pratica.pagamento.codicefiscale.richiesto");
} }
List<ElencoIdentificativiType> iuvs = new ArrayList<ElencoIdentificativiType>(); List<ElencoIdentificativiType> iuvs = new ArrayList<ElencoIdentificativiType>();
if (PagamentoConstants.PAGAMENTO_BOLLI.equalsIgnoreCase(tipoPagamento)) { if (PagamentoConstants.PAGAMENTO_BOLLI.equalsIgnoreCase(tipoPagamento)) {
iuvs = IrisComunicaPosizioniDebitorie.generaIUV(serviceContext.getCompanyId(), iuvs = IrisComunicaPosizioniDebitorie.generaIUV(serviceContext.getCompanyId(), importi.size());
importi.size());
} }
IdpOTFType idpOTFType = IrisComunicaPosizioniDebitorie.comunicaPosizioniDebitorieOTF( IdpOTFType idpOTFType = IrisComunicaPosizioniDebitorie.comunicaPosizioniDebitorieOTF(
serviceContext.getCompanyId(), serviceContext.getScopeGroupId(), serviceContext.getCompanyId(), serviceContext.getScopeGroupId(), serviceContext.getUserId(),
serviceContext.getUserId(), codice, causale, codiceFiscaleCommittente, tipoPagamento, codice, causale, codiceFiscaleCommittente, tipoPagamento, importi, iuvs, currentURL,
importi, iuvs, currentURL, currentURL, provincia); currentURL, provincia);
String urlPagamento = StringPool.BLANK; String urlPagamento = StringPool.BLANK;
if (idpOTFType == null) { if (idpOTFType == null) {
urlPagamento = currentURL; urlPagamento = currentURL;
throw new SystemException("error.geniocivilefe.pratica.pagamento | intPraticaId=" throw new SystemException("error.geniocivilefe.pratica.pagamento | intPraticaId=" + intPraticaId
+ intPraticaId + " | classPk=" + classPk + " | className=" + className); + " | classPk=" + classPk + " | className=" + className);
} else { } else {
urlPagamento = idpOTFType.getUrlGW().toString(); urlPagamento = idpOTFType.getUrlGW().toString();
} }
return PagamentoLocalServiceUtil.addPagamentoAndUpdate(irisPagamentoId, codice, causale, return PagamentoLocalServiceUtil.addPagamentoAndUpdate(irisPagamentoId, codice, causale,
PagamentoConstants.MEZZO_IRIS, codiceFiscaleCommittente, tipoPagamento, importo, PagamentoConstants.MEZZO_IRIS, codiceFiscaleCommittente, tipoPagamento, importo,
PagamentoConstants.UTILIZZATA_IN_CORSO, classPk, className, 0l, urlPagamento, iuvs, PagamentoConstants.UTILIZZATA_IN_CORSO, classPk, className, 0l, urlPagamento, iuvs,
@ -347,6 +303,5 @@ public abstract class PagamentiUtil {
} }
return null; return null;
} }
} }
} }

76
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/workflow/ControlloPraticaWorkflowHandler.java

@ -26,11 +26,13 @@ public class ControlloPraticaWorkflowHandler extends BaseWorkflowHandler {
@Override @Override
public String getClassName() { public String getClassName() {
return ControlloPratica.class.getName(); return ControlloPratica.class.getName();
} }
@Override @Override
public String getType(Locale locale) { public String getType(Locale locale) {
return "controlloPratica"; return "controlloPratica";
} }
@ -41,91 +43,25 @@ public class ControlloPraticaWorkflowHandler extends BaseWorkflowHandler {
if (Validator.isNull(workflowContext)) { if (Validator.isNull(workflowContext)) {
workflowContext = new HashMap<String, Serializable>(); workflowContext = new HashMap<String, Serializable>();
} }
// ControlloPratica issueEvent = (ControlloPratica) model;
//
//
// Issue issue =
// IssueLocalServiceUtil.getIssue(issueEvent.getIssueId());
//
//
//
// String host = IssueUtil.generateIssueLink(issue);
// // workflowContext.put(WorkflowConstants.ENI_ROLE_LIST,
// issueEvent.getRoleList());
//
// Organization orgSubsi =
// OrganizationLocalServiceUtil.getOrganization(issue.getSubsidiaryOrgId());
// Organization orgHq =
// OrganizationLocalServiceUtil.getOrganization(companyId,
// Constants.EMERGENCY_HQ_ORG);
// List<Organization> orgHqSubsi = new ArrayList<Organization>();
//
// String subsidiaryCountry = (String)
// orgSubsi.getExpandoBridge().getAttribute(Constants.CUSTOM_FIELD_ORG_COUNTRY);
// EniGroupUtil.retriveHqbySubsidiary(companyId, orgHqSubsi,
// subsidiaryCountry);
// String orgList = orgHq.getOrganizationId() + "," +
// orgSubsi.getOrganizationId();
// for (Organization organization : orgHqSubsi) {
// orgList += "," + organization.getOrganizationId();
// }
//
// workflowContext.put(WorkflowConstants.ENI_ORG_LIST, orgList);
//
// workflowContext.put(WorkflowConstants.ENI_ISSUE_VERSION,
// issue.getIssueVersion());
// workflowContext.put(WorkflowConstants.ENI_TRAINING,
// issue.getEmTraining());
// workflowContext.put(WorkflowConstants.ENI_COUNTRY,
// issue.getCountry());
// workflowContext.put(WorkflowConstants.ENI_SUBSIDIARY,
// OrganizationLocalServiceUtil.getOrganization(issue.getSubsidiaryOrgId()).getName());
// workflowContext.put(WorkflowConstants.ENI_SITE_NAME,
// issue.getEmSite());
// workflowContext.put(WorkflowConstants.ENI_SITE_DESCRIPTION,
// issue.getEmSiteDescription());
// workflowContext.put(WorkflowConstants.ENI_SITE_URL, host);
// workflowContext.put(WorkflowConstants.ENI_ISSUE_DATE,
// DateUtil.getLocalTimeString(issue.getEmTimezone(), Locale.US,
// issue.getIssueDate()));
// workflowContext.put(WorkflowConstants.ENI_ISSUE_STATUS,
// issue.getEmStatus());
// workflowContext.put(WorkflowConstants.ENI_ISSUE_GROUP_ID,
// issue.getGroupId());
// workflowContext.put(WorkflowConstants.ENI_ISSUE_EM_LEVEL,
// issue.getEmLevel());
// workflowContext.put(WorkflowConstants.ENI_FILE_ENTRY_ATTACHMENT_ID,
// issue.getFileEntryAttachmentId());
// workflowContext.put(WorkflowConstants.ENI_FILE_ENTRY_ATTACHMENT_WELL_ID,
// issue.getFileEntryQuotedWellSketchId());
super.startWorkflowInstance(companyId, groupId, userId, classPK, model, workflowContext); super.startWorkflowInstance(companyId, groupId, userId, classPK, model, workflowContext);
} }
@Override @Override
public Object updateStatus(int status, Map<String, Serializable> workflowContext) throws PortalException, public Object updateStatus(int status, Map<String, Serializable> workflowContext) throws PortalException,
SystemException { SystemException {
long userId = GetterUtil.getLong(workflowContext.get(WorkflowConstants.CONTEXT_USER_ID));
long resourcePrimKey = GetterUtil.getLong(workflowContext
.get(WorkflowConstants.CONTEXT_ENTRY_CLASS_PK));
ServiceContext serviceContext = (ServiceContext) workflowContext
.get(WorkflowConstants.CONTEXT_SERVICE_CONTEXT);
long userId = GetterUtil.getLong(workflowContext.get(WorkflowConstants.CONTEXT_USER_ID));
long resourcePrimKey = GetterUtil.getLong(workflowContext.get(WorkflowConstants.CONTEXT_ENTRY_CLASS_PK));
ServiceContext serviceContext = (ServiceContext) workflowContext.get(WorkflowConstants.CONTEXT_SERVICE_CONTEXT);
// bug BO id=7 GESTIONE WORKFLOW VARIANTI // bug BO id=7 GESTIONE WORKFLOW VARIANTI
List<ControlloPratica> wfNewListVarianti = new ArrayList<ControlloPratica>(); List<ControlloPratica> wfNewListVarianti = new ArrayList<ControlloPratica>();
ControlloPratica cp = ControlloPraticaLocalServiceUtil.updateStatus(userId, resourcePrimKey, status, ControlloPratica cp = ControlloPraticaLocalServiceUtil.updateStatus(userId, resourcePrimKey, status,
serviceContext, wfNewListVarianti); serviceContext, wfNewListVarianti);
// E richiamiamo il nostro metodo che farà update dello status sul // E richiamiamo il nostro metodo che farà update dello status sul nostro asset!
// nostro asset!
if (wfNewListVarianti.size() > 0) { if (wfNewListVarianti.size() > 0) {
_log.info("wfNewListVarianti size >0" + wfNewListVarianti.size()); _log.info("wfNewListVarianti size >0" + wfNewListVarianti.size());
ControlloPraticaLocalServiceUtil.gestioneWFVarianti(wfNewListVarianti.get(0)); ControlloPraticaLocalServiceUtil.gestioneWFVarianti(wfNewListVarianti.get(0));
} }
return cp; return cp;
} }
} }

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.namespace=portos_bo
build.number=2574 build.number=2575
build.date=1618926051044 build.date=1619174539111
build.auto.upgrade=true build.auto.upgrade=true
## ##

BIN
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/commons-beanutils.jar

File binario non mostrato.

BIN
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/commons-codec.jar

File binario non mostrato.

BIN
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/commons-collections.jar

File binario non mostrato.

BIN
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/commons-digester.jar

File binario non mostrato.

BIN
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/commons-io.jar

File binario non mostrato.

BIN
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/commons-lang.jar

File binario non mostrato.

BIN
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/commons-logging.jar

File binario non mostrato.

BIN
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/jstl-api.jar

File binario non mostrato.

BIN
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/jstl-impl.jar

File binario non mostrato.

BIN
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/log4j.jar

File binario non mostrato.

BIN
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/util-bridges.jar

File binario non mostrato.

BIN
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/lib/util-taglib.jar

File binario non mostrato.

572
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/tld/c.tld

@ -1,572 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<taglib xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd"
version="2.1">
<description>JSTL 1.2 core library</description>
<display-name>JSTL core</display-name>
<tlib-version>1.2</tlib-version>
<short-name>c</short-name>
<uri>http://java.sun.com/jsp/jstl/core</uri>
<validator>
<description>
Provides core validation features for JSTL tags.
</description>
<validator-class>
org.apache.taglibs.standard.tlv.JstlCoreTLV
</validator-class>
</validator>
<tag>
<description>
Catches any Throwable that occurs in its body and optionally
exposes it.
</description>
<name>catch</name>
<tag-class>org.apache.taglibs.standard.tag.common.core.CatchTag</tag-class>
<body-content>JSP</body-content>
<attribute>
<description>
Name of the exported scoped variable for the
exception thrown from a nested action. The type of the
scoped variable is the type of the exception thrown.
</description>
<name>var</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
</tag>
<tag>
<description>
Simple conditional tag that establishes a context for
mutually exclusive conditional operations, marked by
&lt;when&gt; and &lt;otherwise&gt;
</description>
<name>choose</name>
<tag-class>com.liferay.taglib.core.ChooseTag</tag-class>
<body-content>JSP</body-content>
</tag>
<tag>
<description>
Simple conditional tag, which evalutes its body if the
supplied condition is true and optionally exposes a Boolean
scripting variable representing the evaluation of this condition
</description>
<name>if</name>
<tag-class>com.liferay.taglib.core.IfTag</tag-class>
<body-content>JSP</body-content>
<attribute>
<description>
The test condition that determines whether or
not the body content should be processed.
</description>
<name>test</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>boolean</type>
</attribute>
<attribute>
<description>
Name of the exported scoped variable for the
resulting value of the test condition. The type
of the scoped variable is Boolean.
</description>
<name>var</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<description>
Scope for var.
</description>
<name>scope</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
</tag>
<tag>
<description>
Retrieves an absolute or relative URL and exposes its contents
to either the page, a String in 'var', or a Reader in 'varReader'.
</description>
<name>import</name>
<tag-class>org.apache.taglibs.standard.tag.rt.core.ImportTag</tag-class>
<tei-class>org.apache.taglibs.standard.tei.ImportTEI</tei-class>
<body-content>JSP</body-content>
<attribute>
<description>
The URL of the resource to import.
</description>
<name>url</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description>
Name of the exported scoped variable for the
resource's content. The type of the scoped
variable is String.
</description>
<name>var</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<description>
Scope for var.
</description>
<name>scope</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<description>
Name of the exported scoped variable for the
resource's content. The type of the scoped
variable is Reader.
</description>
<name>varReader</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<description>
Name of the context when accessing a relative
URL resource that belongs to a foreign
context.
</description>
<name>context</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description>
Character encoding of the content at the input
resource.
</description>
<name>charEncoding</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
<tag>
<description>
The basic iteration tag, accepting many different
collection types and supporting subsetting and other
functionality
</description>
<name>forEach</name>
<tag-class>org.apache.taglibs.standard.tag.rt.core.ForEachTag</tag-class>
<tei-class>org.apache.taglibs.standard.tei.ForEachTEI</tei-class>
<body-content>JSP</body-content>
<attribute>
<description>
Collection of items to iterate over.
</description>
<name>items</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.Object</type>
<deferred-value>
<type>java.lang.Object</type>
</deferred-value>
</attribute>
<attribute>
<description>
If items specified:
Iteration begins at the item located at the
specified index. First item of the collection has
index 0.
If items not specified:
Iteration begins with index set at the value
specified.
</description>
<name>begin</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>int</type>
</attribute>
<attribute>
<description>
If items specified:
Iteration ends at the item located at the
specified index (inclusive).
If items not specified:
Iteration ends when index reaches the value
specified.
</description>
<name>end</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>int</type>
</attribute>
<attribute>
<description>
Iteration will only process every step items of
the collection, starting with the first one.
</description>
<name>step</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>int</type>
</attribute>
<attribute>
<description>
Name of the exported scoped variable for the
current item of the iteration. This scoped
variable has nested visibility. Its type depends
on the object of the underlying collection.
</description>
<name>var</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<description>
Name of the exported scoped variable for the
status of the iteration. Object exported is of type
javax.servlet.jsp.jstl.core.LoopTagStatus. This scoped variable has nested
visibility.
</description>
<name>varStatus</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
</tag>
<tag>
<description>
Iterates over tokens, separated by the supplied delimeters
</description>
<name>forTokens</name>
<tag-class>org.apache.taglibs.standard.tag.rt.core.ForTokensTag</tag-class>
<body-content>JSP</body-content>
<attribute>
<description>
String of tokens to iterate over.
</description>
<name>items</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
<deferred-value>
<type>java.lang.String</type>
</deferred-value>
</attribute>
<attribute>
<description>
The set of delimiters (the characters that
separate the tokens in the string).
</description>
<name>delims</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<attribute>
<description>
Iteration begins at the token located at the
specified index. First token has index 0.
</description>
<name>begin</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>int</type>
</attribute>
<attribute>
<description>
Iteration ends at the token located at the
specified index (inclusive).
</description>
<name>end</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>int</type>
</attribute>
<attribute>
<description>
Iteration will only process every step tokens
of the string, starting with the first one.
</description>
<name>step</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>int</type>
</attribute>
<attribute>
<description>
Name of the exported scoped variable for the
current item of the iteration. This scoped
variable has nested visibility.
</description>
<name>var</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<description>
Name of the exported scoped variable for the
status of the iteration. Object exported is of
type
javax.servlet.jsp.jstl.core.LoopTag
Status. This scoped variable has nested
visibility.
</description>
<name>varStatus</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
</tag>
<tag>
<description>
Like &lt;%= ... &gt;, but for expressions.
</description>
<name>out</name>
<tag-class>org.apache.taglibs.standard.tag.rt.core.OutTag</tag-class>
<body-content>JSP</body-content>
<attribute>
<description>
Expression to be evaluated.
</description>
<name>value</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description>
Default value if the resulting value is null.
</description>
<name>default</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description>
Determines whether characters &lt;,&gt;,&amp;,'," in the
resulting string should be converted to their
corresponding character entity codes. Default value is
true.
</description>
<name>escapeXml</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
<tag>
<description>
Subtag of &lt;choose&gt; that follows &lt;when&gt; tags
and runs only if all of the prior conditions evaluated to
'false'
</description>
<name>otherwise</name>
<tag-class>com.liferay.taglib.core.OtherwiseTag</tag-class>
<body-content>JSP</body-content>
</tag>
<tag>
<description>
Adds a parameter to a containing 'import' tag's URL.
</description>
<name>param</name>
<tag-class>org.apache.taglibs.standard.tag.rt.core.ParamTag</tag-class>
<body-content>JSP</body-content>
<attribute>
<description>
Name of the query string parameter.
</description>
<name>name</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description>
Value of the parameter.
</description>
<name>value</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
<tag>
<description>
Redirects to a new URL.
</description>
<name>redirect</name>
<tag-class>org.apache.taglibs.standard.tag.rt.core.RedirectTag</tag-class>
<body-content>JSP</body-content>
<attribute>
<description>
The URL of the resource to redirect to.
</description>
<name>url</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description>
Name of the context when redirecting to a relative URL
resource that belongs to a foreign context.
</description>
<name>context</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
<tag>
<description>
Removes a scoped variable (from a particular scope, if specified).
</description>
<name>remove</name>
<tag-class>org.apache.taglibs.standard.tag.common.core.RemoveTag</tag-class>
<body-content>empty</body-content>
<attribute>
<description>
Name of the scoped variable to be removed.
</description>
<name>var</name>
<required>true</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<description>
Scope for var.
</description>
<name>scope</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
</tag>
<tag>
<description>
Sets the result of an expression evaluation in a 'scope'
</description>
<name>set</name>
<tag-class>org.apache.taglibs.standard.tag.rt.core.SetTag</tag-class>
<body-content>JSP</body-content>
<attribute>
<description>
Name of the exported scoped variable to hold the value
specified in the action. The type of the scoped variable is
whatever type the value expression evaluates to.
</description>
<name>var</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<description>
Expression to be evaluated.
</description>
<name>value</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<deferred-value>
<type>java.lang.Object</type>
</deferred-value>
</attribute>
<attribute>
<description>
Target object whose property will be set. Must evaluate to
a JavaBeans object with setter property property, or to a
java.util.Map object.
</description>
<name>target</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description>
Name of the property to be set in the target object.
</description>
<name>property</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description>
Scope for var.
</description>
<name>scope</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
</tag>
<tag>
<description>
Creates a URL with optional query parameters.
</description>
<name>url</name>
<tag-class>org.apache.taglibs.standard.tag.rt.core.UrlTag</tag-class>
<body-content>JSP</body-content>
<attribute>
<description>
Name of the exported scoped variable for the
processed url. The type of the scoped variable is
String.
</description>
<name>var</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<description>
Scope for var.
</description>
<name>scope</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<description>
URL to be processed.
</description>
<name>value</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description>
Name of the context when specifying a relative URL
resource that belongs to a foreign context.
</description>
<name>context</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
<tag>
<description>
Subtag of &lt;choose&gt; that includes its body if its
condition evalutes to 'true'
</description>
<name>when</name>
<tag-class>com.liferay.taglib.core.WhenTag</tag-class>
<body-content>JSP</body-content>
<attribute>
<description>
The test condition that determines whether or not the
body content should be processed.
</description>
<name>test</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>boolean</type>
</attribute>
</tag>
</taglib>

4
liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/service.properties

@ -13,8 +13,8 @@
## ##
build.namespace=Kaleo build.namespace=Kaleo
build.number=28 build.number=29
build.date=1616062122215 build.date=1619174642482
build.auto.upgrade=true build.auto.upgrade=true
## ##

Caricamento…
Annulla
Salva