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

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

@ -1,7 +1,7 @@
/**
*
* @author Salvatore La Manna, Manifattura Web Group per Regione Siciliana
*
*
*/
package it.mwg.sismica.bo.util;
@ -156,8 +156,12 @@ public class ManutenzioneDatabase {
public static List<String> pulisci(ServiceContext serviceContext, String mode) throws SystemException,
PortalException {
List<String> esito = new ArrayList<>();
long companyId = serviceContext.getCompanyId();
if (mode.contains("!Workflow=")) {
esito.addAll(SismicaUtil.riparaWorkflow(mode.replaceAll(".*?!Workflow=([^!]*)!", "$1")));
}
if (mode.contains("!Pulisci!")) {
esito.addAll(puliziaDocumentLibrary(companyId));
esitoLog(
@ -166,8 +170,8 @@ public class ManutenzioneDatabase {
ConfigurazioneConstants.ATTACHMENT_FOLDER_ID)));
esitoLog(
esito,
puliziaAllegati(companyId, ConfigurazioneLocalServiceUtil.findByC_ChiaveLong(companyId,
AvvisoUtil.getAllTipoDocumentoFolderProps().get(StatoPraticaConstants.CONFORME))));
puliziaAllegati(companyId, ConfigurazioneLocalServiceUtil.findByC_ChiaveLong(companyId, AvvisoUtil
.getAllTipoDocumentoFolderProps().get(StatoPraticaConstants.CONFORME))));
if (mode.contains("!IntPratica!")) {
esitoLog(esito, svuotaIntPraticaDettPratica());
}
@ -176,8 +180,7 @@ public class ManutenzioneDatabase {
}
esito.addAll(svuotaDatabase(companyId));
if (mode.contains("!Reset!")) {
ConfigurazioneLocalServiceUtil.storeConfig(Constants.NUMERO_PROGETTO_KEY_DB, "1",
serviceContext);
ConfigurazioneLocalServiceUtil.storeConfig(Constants.NUMERO_PROGETTO_KEY_DB, "1", serviceContext);
}
clearCache();
_log.info("Elaborazione completata correttamente.");
@ -185,10 +188,6 @@ public class ManutenzioneDatabase {
if (mode.contains("!Integrazioni!")) {
SismicaUtil.integrazioniScadute();
}
if (mode.startsWith("!Workflow!")) {
String[] pezzi = StringUtil.split(mode, '!');
esito.addAll(SismicaUtil.aggiungiWorkflow(pezzi[2], pezzi[3]));
}
return esito;
}
@ -262,12 +261,10 @@ public class ManutenzioneDatabase {
if (parent.getFolderId() == allegatiFolderId) {
long[] ids = StringUtil.split(folder.getName(), "_", 0L);
if ((ids.length == 2) && (ids[0] == ids[1])) {
if (!esiste(DETTPRATICA_CLASS_NAME, ids[0])
&& !esiste(DOCPRATICA_CLASS_NAME, ids[0])
if (!esiste(DETTPRATICA_CLASS_NAME, ids[0]) && !esiste(DOCPRATICA_CLASS_NAME, ids[0])
&& !esiste(ALLEGATOMANUALE_CLASS_NAME, ids[0])
&& !esiste(ASSEVERAZIONE_CLASS_NAME, ids[0])
&& !esiste(AVVISO_CLASS_NAME, ids[0])
&& !esiste(COLLAUDO_CLASS_NAME, ids[0])
&& !esiste(AVVISO_CLASS_NAME, ids[0]) && !esiste(COLLAUDO_CLASS_NAME, ids[0])
&& !esiste(CONTROLLOPRATICA_CLASS_NAME, ids[0])
&& !esiste(DELEGA_CLASS_NAME, ids[0])
&& !esiste(DOCAGGIUNTIVA_CLASS_NAME, ids[0])
@ -291,8 +288,7 @@ public class ManutenzioneDatabase {
emailId = Long.parseLong(folder.getName());
} catch (NumberFormatException e) {
}
if (Validator.isNotNull(emailId)
&& String.valueOf(emailId).equals(folder.getName())
if (Validator.isNotNull(emailId) && String.valueOf(emailId).equals(folder.getName())
&& !esiste(EMAIL_CLASS_NAME, emailId)) {
_log.info("Cancello la cartella " + folder.getName());
DLAppLocalServiceUtil.deleteFolder(folder.getFolderId());
@ -332,8 +328,7 @@ public class ManutenzioneDatabase {
return result;
}
private static String puliziaAllegati(long companyId, long folderId) throws SystemException,
PortalException {
private static String puliziaAllegati(long companyId, long folderId) throws SystemException, PortalException {
List<Long> avvisiFileEntries = avvisiFileEntries();
long repositoryId = DLAppLocalServiceUtil.getFolder(folderId).getRepositoryId();
int start = 0;
@ -343,8 +338,7 @@ public class ManutenzioneDatabase {
int rimossi = 0;
fileEntries = DLAppServiceUtil.getFileEntries(repositoryId, folderId, start, start + SLICE);
for (FileEntry fileEntry : fileEntries) {
String[] parti = StringUtil.split(fileEntry.getTitle()
.replaceAll("\\.p7m$", StringPool.BLANK), '_');
String[] parti = StringUtil.split(fileEntry.getTitle().replaceAll("\\.p7m$", StringPool.BLANK), '_');
String strId1 = parti[0];
String tipo = StringPool.BLANK;
String strId2 = StringPool.BLANK;
@ -886,8 +880,7 @@ public class ManutenzioneDatabase {
List<ResourcePermission> resourcePermissions = null;
do {
int rimossi = 0;
resourcePermissions = ResourcePermissionLocalServiceUtil.getResourcePermissions(start, start
+ SLICE);
resourcePermissions = ResourcePermissionLocalServiceUtil.getResourcePermissions(start, start + SLICE);
for (ResourcePermission resourcePermission : resourcePermissions) {
long classPK = 0;
try {
@ -971,12 +964,11 @@ public class ManutenzioneDatabase {
List<StoricoSoggettoPratica> storicoSoggettiPratiche = null;
do {
int rimossi = 0;
storicoSoggettiPratiche = StoricoSoggettoPraticaLocalServiceUtil.getStoricoSoggettoPraticas(
start, start + SLICE);
storicoSoggettiPratiche = StoricoSoggettoPraticaLocalServiceUtil.getStoricoSoggettoPraticas(start, start
+ SLICE);
for (StoricoSoggettoPratica storicoSoggettoPratica : storicoSoggettiPratiche) {
if (!esiste(INTPRATICA_CLASS_NAME, storicoSoggettoPratica.getIntPraticaId())) {
StoricoSoggettoPraticaLocalServiceUtil
.deleteStoricoSoggettoPratica(storicoSoggettoPratica);
StoricoSoggettoPraticaLocalServiceUtil.deleteStoricoSoggettoPratica(storicoSoggettoPratica);
cancellati++;
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;
}
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,
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);
public ControlloPraticaIndexer() {
setPermissionAware(true);
}
@Override
public String[] getClassNames() {
return CLASS_NAMES;
}
@Override
public String getPortletId() {
return PORTLET_ID;
}
@Override
protected void doDelete(Object obj) throws Exception {
if (Validator.isNotNull(obj)) {
ControlloPratica controlloPratica = (ControlloPratica) obj;
deleteDocument(controlloPratica.getCompanyId(), controlloPratica.getControlloPraticaId());
@ -96,6 +100,7 @@ public class ControlloPraticaIndexer extends BaseIndexer {
@Override
protected Document doGetDocument(Object obj) throws Exception {
Document document = null;
if (Validator.isNotNull(obj)) {
ControlloPratica controlloPratica = (ControlloPratica) obj;
@ -323,6 +328,7 @@ public class ControlloPraticaIndexer extends BaseIndexer {
@Override
protected Document getBaseModelDocument(String portletId, BaseModel<?> baseModel) throws SystemException {
Document document = newDocument();
String className = baseModel.getModelClassName();
long classPK = 0;
@ -385,6 +391,7 @@ public class ControlloPraticaIndexer extends BaseIndexer {
@Override
protected void doReindex(Object obj) throws Exception {
if (Validator.isNotNull(obj)) {
ControlloPratica controlloPratica = (ControlloPratica) obj;
Document document = getDocument(controlloPratica);
@ -406,9 +413,12 @@ public class ControlloPraticaIndexer extends BaseIndexer {
}
protected void reindexControlloPratica(long companyId) throws PortalException, SystemException {
ActionableDynamicQuery actionableDynamicQuery = new ControlloPraticaActionableDynamicQuery() {
@Override
protected void performAction(Object object) throws PortalException {
if (object != null) {
ControlloPratica controlloPratica = (ControlloPratica) object;
if (controlloPratica != null) {
@ -438,15 +448,18 @@ public class ControlloPraticaIndexer extends BaseIndexer {
@Override
protected void doReindex(String className, long id) throws Exception {
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil.getControlloPratica(id);
doReindex(controlloPratica);
}
private boolean checkSottopostaAParere(long intPraticaId) throws SystemException, PortalException {
return WorkflowUtil.isWorkflowDisattivabile(intPraticaId);
}
private boolean checkLavorazioneSorteggiata(long intPraticaId) throws SystemException {
Sorteggio sorteggio = SorteggioLocalServiceUtil.findByIntPratica(intPraticaId);
if (Validator.isNotNull(sorteggio)) {
return true;
@ -457,6 +470,7 @@ public class ControlloPraticaIndexer extends BaseIndexer {
@Override
protected String getPortletId(SearchContext searchContext) {
return PORTLET_ID;
}
}

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

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.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package it.tref.liferay.portos.bo.model.impl;
/**
* 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>
* 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>
*
* @author Davide Barbagallo, 3F Consulting
*/
public class AllegatoManualeImpl extends AllegatoManualeBaseImpl {
/*
* 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.
* 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.
*/
public AllegatoManualeImpl() {
}

36
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.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
@ -28,14 +26,12 @@ import com.liferay.portal.kernel.json.JSONFactoryUtil;
import com.liferay.portal.kernel.util.Validator;
/**
* The extended model implementation for the Asseverazione service. Represents a
* row in the &quot;portos_bo_Asseverazione&quot; database table, with each
* column mapped to a property of this class.
* The extended model implementation for the Asseverazione service. Represents a row in the
* &quot;portos_bo_Asseverazione&quot; database table, with each column mapped to a property of this class.
*
* <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.Asseverazione} 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.Asseverazione} interface.
* </p>
*
* @author Davide Barbagallo, 3F Consulting
@ -43,15 +39,13 @@ import com.liferay.portal.kernel.util.Validator;
@SuppressWarnings("serial")
public class AsseverazioneImpl extends AsseverazioneBaseImpl {
/*
* 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.
* 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.
*/
public AsseverazioneImpl() {
}
@Override
public Map<String, Serializable> getDichiarazioniMap() {
JSONDeserializer<Map<String, Serializable>> deserializer = JSONFactoryUtil.createJSONDeserializer();
String dichiarazioni = getDichiarazioni();
@ -61,6 +55,7 @@ public class AsseverazioneImpl extends AsseverazioneBaseImpl {
return deserializer.deserialize(dichiarazioni);
}
@Override
public String getModello() throws PortalException, SystemException {
String modello = "";
switch (this.getTipologia()) {
@ -80,9 +75,8 @@ public class AsseverazioneImpl extends AsseverazioneBaseImpl {
modello = "AS-GEO";
break;
case TipoSoggettoUtil.PROGETTISTA:
Soggetto soggetto = SoggettoLocalServiceUtil
.getValidByIntPratica_CodiceFiscale_TipologiaSoggetto(this.getIntPraticaId(),
this.getCodiceFiscale(), this.getTipologia());
Soggetto soggetto = SoggettoLocalServiceUtil.getValidByIntPratica_CodiceFiscale_TipologiaSoggetto(
this.getIntPraticaId(), this.getCodiceFiscale(), this.getTipologia());
if (soggetto.getAmbitoProfessione().equals("architettonico")) {
modello = "AS-PRA";
} else {
@ -92,4 +86,4 @@ public class AsseverazioneImpl extends AsseverazioneBaseImpl {
}
return modello;
}
}
}

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

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

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

@ -31,11 +31,11 @@ package it.tref.liferay.portos.bo.model.impl;
public class ComuneImpl extends ComuneBaseImpl {
/*
* NOTE FOR DEVELOPERS:
*
*
* Never reference this class directly. All methods that expect a comune
* model instance should use the {@link
* it.tref.liferay.portos.bo.model.Comune} interface instead.
*/
public ComuneImpl() {
}
}
}

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

@ -31,4 +31,4 @@ public class ComunicazioneImpl extends ComunicazioneBaseImpl {
*/
public ComunicazioneImpl() {
}
}
}

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

@ -31,4 +31,4 @@ public class ConfigurazioneImpl extends ConfigurazioneBaseImpl {
*/
public ConfigurazioneImpl() {
}
}
}

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

@ -31,11 +31,11 @@ package it.tref.liferay.portos.bo.model.impl;
public class ControlloPraticaImpl extends ControlloPraticaBaseImpl {
/*
* NOTE FOR DEVELOPERS:
*
*
* Never reference this class directly. All methods that expect a controllo
* pratica model instance should use the {@link
* it.tref.liferay.portos.bo.model.ControlloPratica} interface instead.
*/
public ControlloPraticaImpl() {
}
}
}

7
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;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import com.liferay.portal.kernel.json.JSONDeserializer;
@ -39,7 +38,7 @@ import com.liferay.portal.kernel.util.Validator;
public class DelegaImpl extends DelegaBaseImpl {
/*
* NOTE FOR DEVELOPERS:
*
*
* Never reference this class directly. All methods that expect a delega
* model instance should use the {@link
* it.tref.liferay.portos.bo.model.Delega} interface instead.
@ -47,7 +46,9 @@ public class DelegaImpl extends DelegaBaseImpl {
public DelegaImpl() {
}
@Override
public Map<String, Serializable> getDichiarazioniMap() {
JSONDeserializer<Map<String, Serializable>> deserializer = JSONFactoryUtil.createJSONDeserializer();
String dichiarazioni = getDichiarazioni();
if (Validator.isNull(dichiarazioni)) {
@ -55,4 +56,4 @@ public class DelegaImpl extends DelegaBaseImpl {
}
return deserializer.deserialize(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();
IntPratica intPratica = null;
try {
intPratica = IntPraticaLocalServiceUtil.fetchIntPratica(getIntPraticaId());
if (AzioniPraticheUtil.isDeposito(intPratica.getIntPraticaId())) {
sb.append("Deposito ");
@ -778,7 +776,6 @@ public class DettPraticaImpl extends DettPraticaBaseImpl {
Validator.isNull(getIntervFinPubDesc()) ? StringPool.BLANK : LanguageUtil.get(
LocaleUtil.getSiteDefault(), "interv-fin-pub-desc"));
attributes.put("dpdc", getDpdc() ? StringPool.TRUE : StringPool.FALSE);
return attributes;
}
}

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

@ -37,7 +37,7 @@ import com.liferay.portlet.documentlibrary.service.DLFileEntryServiceUtil;
public class DocAggiuntivaImpl extends DocAggiuntivaBaseImpl {
/*
* NOTE FOR DEVELOPERS:
*
*
* Never reference this class directly. All methods that expect a doc
* aggiuntiva model instance should use the {@link
* it.tref.liferay.portos.bo.model.DocAggiuntiva} interface instead.
@ -45,13 +45,13 @@ public class DocAggiuntivaImpl extends DocAggiuntivaBaseImpl {
public DocAggiuntivaImpl() {
}
@Override
public String getFileName() throws PortalException, SystemException {
if (getFileEntryId() == 0L && getOldFileEntryId() != 0L) {
FilesImporter.handleFileImportDocAggiuntiva(this);
return StringPool.BLANK;
}
DLFileEntry file = DLFileEntryServiceUtil.getFileEntry(getFileEntryId());
return file.getDescription();
}

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

@ -39,7 +39,7 @@ import com.liferay.portlet.documentlibrary.util.DLUtil;
public class DocPraticaImpl extends DocPraticaBaseImpl {
/*
* NOTE FOR DEVELOPERS:
*
*
* Never reference this class directly. All methods that expect a doc
* pratica model instance should use the {@link
* it.tref.liferay.portos.bo.model.DocPratica} interface instead.
@ -56,6 +56,7 @@ public class DocPraticaImpl extends DocPraticaBaseImpl {
return file.getTitle();
}
@Override
public String getDownloadUrl(ThemeDisplay themeDisplay) throws PortalException, SystemException {
if (Validator.isNull(getDlFileEntryId())) {
return "Da importare";
@ -63,5 +64,4 @@ public class DocPraticaImpl extends DocPraticaBaseImpl {
FileEntry fileEntry = DLAppLocalServiceUtil.getFileEntry(getDlFileEntryId());
return DLUtil.getPreviewURL(fileEntry, fileEntry.getFileVersion(), themeDisplay, "&download=true");
}
}

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

29
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.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package it.tref.liferay.portos.bo.model.impl;
/**
* The extended model implementation for the HistoryWorkflowAction service.
* Represents a row in the &quot;portos_bo_HistoryWorkflowAction&quot; database
* table, with each column mapped to a property of this class.
* The extended model implementation for the HistoryWorkflowAction service. Represents a row in the
* &quot;portos_bo_HistoryWorkflowAction&quot; database table, with each column mapped to a property of this class.
*
* <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.HistoryWorkflowAction}
* 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.HistoryWorkflowAction}
* interface.
* </p>
*
@ -31,12 +27,9 @@ package it.tref.liferay.portos.bo.model.impl;
@SuppressWarnings("serial")
public class HistoryWorkflowActionImpl extends HistoryWorkflowActionBaseImpl {
/*
* 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.
* 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.
*/
public HistoryWorkflowActionImpl() {
}
}
}

29
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.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package it.tref.liferay.portos.bo.model.impl;
/**
* The extended model implementation for the IUV service. Represents a row in
* the &quot;portos_bo_IUV&quot; database table, with each column mapped to a
* property of this class.
* The extended model implementation for the IUV service. Represents a row in the &quot;portos_bo_IUV&quot; database
* table, with each column mapped to a property of this class.
*
* <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.IUV} 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.IUV} interface.
* </p>
*
* @author Davide Barbagallo, 3F Consulting
@ -30,12 +26,9 @@ package it.tref.liferay.portos.bo.model.impl;
@SuppressWarnings("serial")
public class IUVImpl extends IUVBaseImpl {
/*
* 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.
* 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.
*/
public IUVImpl() {
}
}
}

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

72
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.
*
* This library is free software; you can redistribute it and/or modify it under the terms of the
* GNU Lesser General Public License as published by the Free Software Foundation; either version
* 2.1 of the License, or (at your option) any later version.
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package it.tref.liferay.portos.bo.model.impl;
@ -25,45 +25,45 @@ import com.liferay.portlet.documentlibrary.service.DLAppLocalServiceUtil;
import com.liferay.portlet.documentlibrary.util.DLUtil;
/**
* The extended model implementation for the Pagamento service. Represents a row in the
* &quot;portos_bo_Pagamento&quot; database table, with each column mapped to a property of this
* class.
* The extended model implementation for the Pagamento service. Represents a row in the &quot;portos_bo_Pagamento&quot;
* database table, with each column mapped to a property of this class.
*
* <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.Pagamento} 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.Pagamento} interface.
* </p>
*
* @author Davide Barbagallo, 3F Consulting
*/
@SuppressWarnings("serial")
public class PagamentoImpl extends PagamentoBaseImpl {
/*
* 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.
*/
public PagamentoImpl() {}
/*
* 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.
*/
public PagamentoImpl() {
}
public String getDownloadUrl(ThemeDisplay themeDisplay) throws PortalException, SystemException {
if (Validator.isNull(getFileEntryId())) {
return null;
}
@Override
public String getDownloadUrl(ThemeDisplay themeDisplay) throws PortalException, SystemException {
FileEntry fileEntry = DLAppLocalServiceUtil.getFileEntry(getFileEntryId());
return DLUtil.getPreviewURL(fileEntry, fileEntry.getFileVersion(), themeDisplay, "&download=true");
if (Validator.isNull(getFileEntryId())) {
return null;
}
FileEntry fileEntry = DLAppLocalServiceUtil.getFileEntry(getFileEntryId());
return DLUtil.getPreviewURL(fileEntry, fileEntry.getFileVersion(), themeDisplay, "&download=true");
}
}
@Override
public String getImportoString() {
public String getImportoString() {
String importo = getImporto();
BigDecimal importoVal;
if (Validator.isNotNull(importo)) {
importoVal = new BigDecimal(importo);
} else {
importoVal = new BigDecimal(0.00);
}
return NumberFormat.getCurrencyInstance(Locale.ITALY).format(importoVal);
}
String importo = getImporto();
BigDecimal importoVal;
if (Validator.isNotNull(importo)) {
importoVal = new BigDecimal(importo);
} else {
importoVal = new BigDecimal(0.00);
}
return NumberFormat.getCurrencyInstance(Locale.ITALY).format(importoVal);
}
}

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

@ -1,34 +1,34 @@
/**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package it.tref.liferay.portos.bo.model.impl;
/**
* 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>
* 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>
*
* @author Davide Barbagallo, 3F Consulting
*/
@SuppressWarnings("serial")
public class ParereGeologoImpl extends ParereGeologoBaseImpl {
/*
* 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.
* 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.
*/
public ParereGeologoImpl() {
}
}
}

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

30
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.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package it.tref.liferay.portos.bo.model.impl;
/**
* The extended model implementation for the StoricoSoggettoPratica service.
* Represents a row in the &quot;portos_bo_StoricoSoggettoPratica&quot; database
* table, with each column mapped to a property of this class.
* The extended model implementation for the StoricoSoggettoPratica service. Represents a row in the
* &quot;portos_bo_StoricoSoggettoPratica&quot; database table, with each column mapped to a property of this class.
*
* <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.StoricoSoggettoPratica}
* 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.StoricoSoggettoPratica}
* interface.
* </p>
*
@ -31,13 +27,9 @@ package it.tref.liferay.portos.bo.model.impl;
@SuppressWarnings("serial")
public class StoricoSoggettoPraticaImpl extends StoricoSoggettoPraticaBaseImpl {
/*
* 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.
* 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.
*/
public StoricoSoggettoPraticaImpl() {
}
}
}

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

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

29
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.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package it.tref.liferay.portos.bo.model.impl;
/**
* The extended model implementation for the UtentePortos service. Represents a
* row in the &quot;portos_bo_UtentePortos&quot; database table, with each
* column mapped to a property of this class.
* The extended model implementation for the UtentePortos service. Represents a row in the
* &quot;portos_bo_UtentePortos&quot; database table, with each column mapped to a property of this class.
*
* <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.UtentePortos} 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.UtentePortos} interface.
* </p>
*
* @author Davide Barbagallo, 3F Consulting
@ -30,12 +26,9 @@ package it.tref.liferay.portos.bo.model.impl;
@SuppressWarnings("serial")
public class UtentePortosImpl extends UtentePortosBaseImpl {
/*
* 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.
* 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.
*/
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
public void receive(Message message) throws MessageListenerException {
if (lock.tryLock()) {
try {
/*
* Fascicoli Senza progetto
*/
// Fascicoli Senza progetto
int count = IntPraticaLocalServiceUtil.countFascicoliNotProgetto();
if (count > 0) {
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();
if (count > 0) {
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();
if (count > 0) {
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();
if (count > 0) {
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();
if (count > 0) {
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();
if (count > 0) {
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,
String className) throws SystemException, PortalException {
String descLong = StringPool.BLANK;
Date dtAvviso = new Date();
String tipoAvviso = AvvisoUtil.TIPO_AVVISO_DIRETTO;
@ -284,18 +274,17 @@ public class SchedulerPratiche implements MessageListener {
}
String propertiesTemplate = AvvisoUtil.getAllTipoDocumentoFileTemplateProps().get(propertiesTemplateType);
long fileEntryIdTemplate = ConfigurazioneLocalServiceUtil.findByC_ChiaveLong(companyId, propertiesTemplate);
long controlloPraticaId = 0L;
ServiceContext serviceContext = new ServiceContext();
serviceContext.setCompanyId(companyId);
serviceContext.setScopeGroupId(groupId);
serviceContext.setUserId(userId);
AvvisoLocalServiceUtil.addAvviso(intPraticaId, descLong, dtAvviso, tipoAvviso, tipoDocumento,
fileEntryIdTemplate, classPk, className, controlloPraticaId, serviceContext);
}
private IntPratica assegnaNumeroProgetto(IntPratica intPratica) throws PortalException, SystemException {
// in caso di errore successivo alla protocollazione salto questa operazione
if (Validator.isNull(intPratica.getNumeroProgetto())) {
intPratica = IntPraticaLocalServiceUtil.addNumeroProgetto(intPratica.getIntPraticaId());
@ -304,13 +293,14 @@ public class SchedulerPratiche implements MessageListener {
}
public void gestionePratica(DettPratica dettPratica) throws Exception {
ServiceContext serviceContext = getServiceContext(dettPratica);
// protocollazione da servizio remoto
protocollazione(serviceContext.getCompanyId(), serviceContext.getScopeGroupId(), dettPratica);
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(dettPratica.getIntPraticaId());
intPratica = assegnaNumeroProgetto(intPratica);
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(),
DettPratica.class.getName());
// 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 {
// in caso di errore successivo alla protocollazione salto questa operazione
if (Validator.isNull(dettPratica.getProtocollo())) {
String protocollo = null;
String title = dettPratica.getDettPraticaId() + "_" + System.currentTimeMillis();
String title = dettPratica.getDettPraticaId() + StringPool.UNDERLINE + System.currentTimeMillis();
protocollo = ProtocollazioneUtil.protocollaArrivo(dettPratica, title);
if (Validator.isNull(protocollo)) {
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 {
// in caso di errore successivo alla protocollazione salto questa operazione
if (Validator.isNull(fineLavori.getProtocollo())) {
String protocollo = null;
String title = fineLavori.getFineLavoriId() + "_" + System.currentTimeMillis();
String title = fineLavori.getFineLavoriId() + StringPool.UNDERLINE + System.currentTimeMillis();
protocollo = ProtocollazioneUtil.protocollaArrivo(fineLavori, title);
if (Validator.isNull(protocollo)) {
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 {
// in caso di errore successivo alla protocollazione salto questa
// operazione
// in caso di errore successivo alla protocollazione salto questa operazione
if (Validator.isNull(collaudo.getProtocollo())) {
String protocollo = null;
String title = collaudo.getCollaudoId() + "_" + System.currentTimeMillis();
String title = collaudo.getCollaudoId() + StringPool.UNDERLINE + System.currentTimeMillis();
protocollo = ProtocollazioneUtil.protocollaArrivo(collaudo, title);
if (Validator.isNull(protocollo)) {
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)
throws Exception {
if (dettPratica.isCompleta() && !dettPratica.isGestita()) {
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(dettPratica.getIntPraticaId());
Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId());
@ -436,6 +426,7 @@ public class SchedulerPratiche implements MessageListener {
}
private ServiceContext getServiceContext(DettPratica dettPratica) {
ServiceContext serviceContext = new ServiceContext();
serviceContext.setCompanyId(dettPratica.getCompanyId());
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 {
/*
* 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.AllegatoManualeLocalServiceUtil} to access the allegato manuale local service.
*/
@Override
public List<AllegatoManuale> findByIntPratica(long intPraticaId) throws SystemException {
return allegatoManualePersistence.findByIntPratica(intPraticaId);
}
@Override
public List<AllegatoManuale> findByIntPratica(long intPraticaId, int start, int end,
OrderByComparator orderByComparator) throws SystemException {
return allegatoManualePersistence.findByIntPratica(intPraticaId, start, end, orderByComparator);
}
@Override
public int countByIntPratica(long intPraticaId) throws SystemException {
return allegatoManualePersistence.countByIntPratica(intPraticaId);
}
@Override
public List<AllegatoManuale> findByDettPratica(long dettPraticaId) throws SystemException {
return allegatoManualePersistence.findByIntPratica(dettPraticaId);
}
@Override
public List<AllegatoManuale> findByDettPratica(long dettPraticaId, int start, int end,
OrderByComparator orderByComparator) throws SystemException {
return allegatoManualePersistence.findByIntPratica(dettPraticaId, start, end, orderByComparator);
}
@Override
public int countByDettPratica(long dettPraticaId) throws SystemException {
return allegatoManualePersistence.countByIntPratica(dettPraticaId);
}
@ -99,13 +103,12 @@ public class AllegatoManualeLocalServiceImpl extends AllegatoManualeLocalService
public AllegatoManuale addAllegatoManuale(long userId, long intPraticaId, long dettPraticaId, String descrizione,
byte[] content, String sourceFileName, ServiceContext serviceContext) throws SystemException,
PortalException {
AllegatoManuale allegatoManuale = allegatoManualePersistence.create(counterLocalService
.increment(AllegatoManuale.class.getName()));
DettPratica dettPratica = dettPraticaLocalService.getDettPratica(dettPraticaId);
User user = userPersistence.findByPrimaryKey(userId);
Date now = new Date();
allegatoManuale.setCompanyId(serviceContext.getCompanyId());
allegatoManuale.setUserId(user.getUserId());
allegatoManuale.setUserName(user.getFullName());
@ -115,12 +118,9 @@ public class AllegatoManualeLocalServiceImpl extends AllegatoManualeLocalService
allegatoManuale.setIntPraticaId(intPraticaId);
allegatoManuale.setDettPraticaId(dettPraticaId);
allegatoManuale.setDescrizione(descrizione);
long fileEntryId = 0l;
long fileEntryId = 0L;
long defaultFolderId = configurazioneLocalService.findByC_ChiaveLong(serviceContext.getCompanyId(),
ConfigurazioneConstants.ATTACHMENT_FOLDER_ID);
Folder defaultFolder = dlAppLocalService.getFolder(defaultFolderId);
String folderName = PraticaUtil.getFolderName(dettPratica.getDettPraticaId());
serviceContext.setGroupPermissions(new String[] { ActionKeys.VIEW });
@ -137,16 +137,13 @@ public class AllegatoManualeLocalServiceImpl extends AllegatoManualeLocalService
+ StringPool.UNDERLINE + sourceFileName;
String description = StringPool.BLANK;
String mimeType = MimeTypesUtil.getContentType(sourceFileName);
String changeLog = StringPool.BLANK;
FileEntry fileEntry = dlAppLocalService.addFileEntry(serviceContext.getUserId(), folder.getRepositoryId(),
folder.getFolderId(), now.getTime() + StringPool.UNDERLINE + sourceFileName, mimeType, title,
description, changeLog, content, serviceContext);
fileEntryId = fileEntry.getFileEntryId();
allegatoManuale.setFileEntryId(fileEntryId);
String codiceFiscalePrimaFirma = StringPool.BLANK;
ServiceContext serviceContextAvvisi = (ServiceContext) serviceContext.clone();
IntPratica intPratica = intPraticaLocalService.getIntPratica(intPraticaId);
Territorio territorio = territorioLocalService.getTerritorio(intPratica.getTerritorioId());
@ -158,20 +155,20 @@ public class AllegatoManualeLocalServiceImpl extends AllegatoManualeLocalService
Avviso avviso = avvisoLocalService.addAvviso(intPratica.getIntPraticaId(), descrizione, now,
AvvisoUtil.TIPO_AVVISO_FIRMA, "MA", 0L, dettPraticaId, DettPratica.class.getName(),
codiceFiscalePrimaFirma, fileEntryId, 0L, StringPool.BLANK, 0L, serviceContextAvvisi);
allegatoManuale.setAvvisoId(avviso.getAvvisoId());
allegatoManuale = allegatoManualePersistence.update(allegatoManuale);
return allegatoManuale;
}
@Override
public AllegatoManuale deleteAllegatoManuale(AllegatoManuale allegatoManuale) throws SystemException {
return super.deleteAllegatoManuale(allegatoManuale);
}
@Override
public AllegatoManuale deleteAllegatoManuale(long allegatoManualeId) throws PortalException, SystemException {
return deleteAllegatoManuale(allegatoManualeLocalService.getAllegatoManuale(allegatoManualeId));
}
}

140
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.
*
* This library is free software; you can redistribute it and/or modify it under the terms of the
* GNU Lesser General Public License as published by the Free Software Foundation; either version
* 2.1 of the License, or (at your option) any later version.
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package it.tref.liferay.portos.bo.service.impl;
@ -29,13 +29,12 @@ import com.liferay.portal.service.ServiceContext;
* The implementation of the allegato manuale remote service.
*
* <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.AllegatoManualeService} 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.AllegatoManualeService} interface.
*
* <p>
* This is a remote service. Methods of this service are expected to have security checks based on
* the propagated JAAS credentials because this service can be accessed remotely.
* This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS
* credentials because this service can be accessed remotely.
* </p>
*
* @author Davide Barbagallo, 3F Consulting
@ -43,55 +42,72 @@ import com.liferay.portal.service.ServiceContext;
* @see it.tref.liferay.portos.bo.service.AllegatoManualeServiceUtil
*/
public class AllegatoManualeServiceImpl extends AllegatoManualeServiceBaseImpl {
/*
* 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.
*/
public List<AllegatoManuale> findByIntPratica(long intPraticaId) throws SystemException {
return allegatoManualeLocalService.findByIntPratica(intPraticaId);
}
public List<AllegatoManuale> findByIntPratica(long intPraticaId, int start, int end,
OrderByComparator orderByComparator) throws SystemException {
return allegatoManualeLocalService.findByIntPratica(intPraticaId, start, end, orderByComparator);
}
public int countByIntPratica(long intPraticaId) throws SystemException {
return allegatoManualeLocalService.countByIntPratica(intPraticaId);
}
public List<AllegatoManuale> findByDettPratica(long dettPraticaId) throws SystemException {
return allegatoManualeLocalService.findByIntPratica(dettPraticaId);
}
public List<AllegatoManuale> findByDettPratica(long dettPraticaId, int start, int end,
OrderByComparator orderByComparator) throws SystemException {
return allegatoManualeLocalService.findByIntPratica(dettPraticaId, start, end, orderByComparator);
}
public int countByDettPratica(long dettPraticaId) throws SystemException {
return allegatoManualeLocalService.countByIntPratica(dettPraticaId);
}
public AllegatoManuale addAllegatoManuale(long userId, long intPraticaId, long dettPraticaId, String descrizione,
byte[] content, String sourceFileName, ServiceContext serviceContext) throws SystemException, PortalException {
return allegatoManualeLocalService.addAllegatoManuale(userId, intPraticaId, dettPraticaId, descrizione, content,
sourceFileName, serviceContext);
}
public AllegatoManuale deleteAllegatoManuale(AllegatoManuale allegatoManuale) throws SystemException {
Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(allegatoManuale.getAvvisoId());
if (Validator.isNotNull(avviso) && Validator.isNull(avviso.getFileEntryIdInvio())) {
return allegatoManualeLocalService.deleteAllegatoManuale(allegatoManuale);
} else {
throw new SystemException("allegato manuale #" + allegatoManuale.getAllegatoManualeId() + " non eliminabile");
}
}
public AllegatoManuale deleteAllegatoManuale(long allegatoManualeId) throws PortalException, SystemException {
return allegatoManualeLocalService.deleteAllegatoManuale(allegatoManualeId);
}
/*
* 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.
*/
@Override
public List<AllegatoManuale> findByIntPratica(long intPraticaId) throws SystemException {
return allegatoManualeLocalService.findByIntPratica(intPraticaId);
}
@Override
public List<AllegatoManuale> findByIntPratica(long intPraticaId, int start, int end,
OrderByComparator orderByComparator) throws SystemException {
return allegatoManualeLocalService.findByIntPratica(intPraticaId, start, end, orderByComparator);
}
@Override
public int countByIntPratica(long intPraticaId) throws SystemException {
return allegatoManualeLocalService.countByIntPratica(intPraticaId);
}
@Override
public List<AllegatoManuale> findByDettPratica(long dettPraticaId) throws SystemException {
return allegatoManualeLocalService.findByIntPratica(dettPraticaId);
}
@Override
public List<AllegatoManuale> findByDettPratica(long dettPraticaId, int start, int end,
OrderByComparator orderByComparator) throws SystemException {
return allegatoManualeLocalService.findByIntPratica(dettPraticaId, start, end, orderByComparator);
}
@Override
public int countByDettPratica(long dettPraticaId) throws SystemException {
return allegatoManualeLocalService.countByIntPratica(dettPraticaId);
}
@Override
public AllegatoManuale addAllegatoManuale(long userId, long intPraticaId, long dettPraticaId, String descrizione,
byte[] content, String sourceFileName, ServiceContext serviceContext) throws SystemException,
PortalException {
return allegatoManualeLocalService.addAllegatoManuale(userId, intPraticaId, dettPraticaId, descrizione,
content, sourceFileName, serviceContext);
}
@Override
public AllegatoManuale deleteAllegatoManuale(AllegatoManuale allegatoManuale) throws SystemException {
Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(allegatoManuale.getAvvisoId());
if (Validator.isNotNull(avviso) && Validator.isNull(avviso.getFileEntryIdInvio())) {
return allegatoManualeLocalService.deleteAllegatoManuale(allegatoManuale);
} else {
throw new SystemException("allegato manuale #" + allegatoManuale.getAllegatoManualeId()
+ " non eliminabile");
}
}
@Override
public AllegatoManuale deleteAllegatoManuale(long allegatoManualeId) throws PortalException, SystemException {
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
public String anteprimaAsseverazione(String tipo, User user, DettPratica dettPratica, String relazioni)
throws IOException, SystemException, PortalException {
return testoAsseverazione(tipo, user.getScreenName(), dettPratica, relazioni, true);
}
@Override
public String testoAsseverazione(String tipo, User user, long dettPraticaId, String relazioni)
throws SystemException, PortalException, IOException {
return testoAsseverazione(tipo, user.getScreenName(), dettPraticaId, relazioni);
}
@Override
public String testoAsseverazione(String tipo, String codiceFiscale, long dettPraticaId, String relazioni)
throws PortalException, SystemException, IOException {
DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(dettPraticaId);
return testoAsseverazione(tipo, codiceFiscale, dettPratica, relazioni);
}
@ -112,18 +115,19 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
@Override
public String testoAsseverazione(String tipo, String codiceFiscale, DettPratica dettPratica, String relazioni)
throws SystemException, PortalException, IOException {
return testoAsseverazione(tipo, codiceFiscale, dettPratica, relazioni, false);
}
private String testoAsseverazione(String tipo, String codiceFiscale, DettPratica dettPratica, String relazioni,
boolean anteprima) throws SystemException, PortalException, IOException {
List<Soggetto> soggetti = SoggettoLocalServiceUtil.getValidTmpByIntPratica_CodiceFiscale(
dettPratica.getIntPraticaId(), codiceFiscale, 0L);
if (soggetti.size() > 0) {
Soggetto soggetto = soggetti.get(0);
String nome = Validator.isNull(soggetto.getCognome()) ? soggetto.getLegaleRap() : soggetto.getNome();
String cognome = Validator.isNull(soggetto.getCognome()) ? StringPool.BLANK : soggetto.getCognome();
return testoAsseverazione(tipo, nome, cognome, codiceFiscale, soggetto.getAmbitoProfessione(), dettPratica,
relazioni, false);
}
@ -166,7 +170,6 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
default:
return null;
}
InputStream input = getClass().getClassLoader()
.getResourceAsStream("/resource/asseverazioni/" + file + ".html");
if (Validator.isNull(input)) {
@ -179,20 +182,15 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
}
scanner.close();
input.close();
String RG = dettPratica.getGeoRischioGeomorfologicoPai();
String RI = dettPratica.getGeoRischioIdraulicoPai();
String PG = dettPratica.getGeoPericolositaGeomorfica();
String PI = dettPratica.getGeoPericolositaIdraulica();
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"));
boolean coniugio = Validator.isNotNull(relazioni);
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(dettPratica.getIntPraticaId());
Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId());
float ag = 0;
if (Validator.isNotNull(dettPratica.getAg())) {
ag = Float.parseFloat(dettPratica.getAg().replace(',', '.'));
@ -201,23 +199,17 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
} else if (Validator.isNotNull(territorio.getAgMin())) {
ag = Float.parseFloat(territorio.getAgMin().replace(',', '.'));
}
boolean agAlto = (dettPratica.getTcAdeguamentoSismico() || dettPratica.getTcMiglioramentoSismico())
&& (territorio.getZona().equals("1") || (territorio.getZona().equals("2") && (ag >= 0.2)));
boolean complesse = dettPratica.getTcNuovaCostruzioneComplessa();
boolean strategico = dettPratica.getDestinazione().startsWith("A")
|| dettPratica.getDestinazione().startsWith("B");
boolean rilevanti = agAlto || complesse || strategico;
boolean agMedio = false;
boolean riparazioni = false;
boolean nuove = false;
boolean agricoli = false;
boolean nonRilevanti = false;
if (!rilevanti) {
agMedio = (dettPratica.getTcAdeguamentoSismico() || dettPratica.getTcMiglioramentoSismico())
&& ((territorio.getZona().equals("2") && (ag >= 0.15) && (ag <= 0.2)) || territorio.getZona()
@ -225,10 +217,8 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
riparazioni = dettPratica.getTcRiparazioneInterventoLocale();
nuove = dettPratica.getTcNuovaCostruzione();
agricoli = dettPratica.getDestinazione().equals("1");
nonRilevanti = agMedio || riparazioni || nuove || agricoli;
}
String html = buffer.toString().replaceAll("##anteprima(.*?)##", anteprima ? StringPool.BLANK : "$1")
.replaceAll("##lavoripubblici(.*?)##", dettPratica.getLavoriPubblici() ? StringPool.BLANK : "$1")
.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)
.replace("{{relazioni}}", StringPool.BLANK);
} else {
html = html.replace("{{coniugio}}", coniugio ? CHECKED : StringPool.SPACE)
html = html
.replace("{{coniugio}}", coniugio ? CHECKED : StringPool.SPACE)
.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;
}
@ -259,19 +250,15 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
String codiceFiscale, ServiceContext serviceContext) throws PortalException, SystemException {
User user = userPersistence.findByPrimaryKey(userId);
Date now = new Date();
Asseverazione asseverazione = asseverazionePersistence.create(counterLocalService.increment(Asseverazione.class
.getName()));
asseverazione.setCompanyId(serviceContext.getCompanyId());
asseverazione.setUserId(user.getUserId());
asseverazione.setUserName(user.getFullName());
asseverazione.setCreateDate(serviceContext.getCreateDate(now));
asseverazione.setModifiedDate(serviceContext.getModifiedDate(now));
asseverazione.setGroupId(serviceContext.getScopeGroupId());
asseverazione.setIntPraticaId(intPraticaId);
asseverazione.setDettPraticaId(dettPraticaId);
asseverazione.setTipologia(tipologia);
@ -281,9 +268,7 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
if (!soggetti.isEmpty()) {
asseverazione.setSoggettoId(soggetti.get(0).getUserId());
}
asseverazione = asseverazionePersistence.update(asseverazione);
return asseverazione;
}
@ -297,7 +282,6 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
if (TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE.equalsIgnoreCase(dettPratica.getTipoIntegrazione())
|| TipoIntegrazioneUtil.VARIANTE.equalsIgnoreCase(dettPratica.getTipoIntegrazione())
|| TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equalsIgnoreCase(dettPratica.getTipoIntegrazione())) {
List<Soggetto> nuoviSoggetti = new ArrayList<Soggetto>(
soggettoLocalService.getValidTmpByDettPratica(dettPraticaId));
List<String> cfNuoviSoggetti = soggettoLocalService.getCfValidTmpByDettPratica(dettPraticaId);
@ -312,19 +296,8 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
cfDelegato, 0l);
GenericUtils.addAllIfnotExist(nuoviSoggetti, delegato);
}
if (TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE.equalsIgnoreCase(dettPratica.getTipoIntegrazione())) {
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
List<Soggetto> titolareDigitali = soggettoLocalService.getValidTmpByIntPratica_CodiceFiscale(
intPraticaId, titolaredigitaleUser.getScreenName(), 0l);
@ -333,12 +306,9 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
titolareDigitale.getTipologiaSoggetto(), titolareDigitale.getCodiceFiscale(),
serviceContext);
}
} else if (TipoIntegrazioneUtil.VARIANTE.equalsIgnoreCase(dettPratica.getTipoIntegrazione())) {
String[] tipoSoggetti = new String[] { TipoSoggettoUtil.COMMITTENTE, TipoSoggettoUtil.DIRETTORE_LAVORI,
TipoSoggettoUtil.DITTA, TipoSoggettoUtil.PROGETTISTA };
// if (SoggettiUtil.isTitolareInCommittenti(intPraticaId)) {
if (ValidazionePraticaUtil.isA98Required(dettPratica)) {
tipoSoggetti = (String[]) ArrayUtils.removeElement(tipoSoggetti, TipoSoggettoUtil.COMMITTENTE);
}
@ -346,7 +316,6 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
.getSoggettiPrincipaliValidTmpByDettPratica_TipologiaSoggetto(dettPraticaId, tipoSoggetti);
GenericUtils.addAllIfnotExist(nuoviSoggetti, soggettiPrincipali);
}
for (Soggetto soggetto : nuoviSoggetti) {
if (TipoSoggettoUtil.COMMITTENTE.equalsIgnoreCase(soggetto.getTipologiaSoggetto())) {
if (!ValidazionePraticaUtil.isA98Required(dettPratica)) {
@ -357,11 +326,8 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
addAsseverazione(serviceContext.getUserId(), dettPratica.getIntPraticaId(), dettPraticaId,
soggetto.getTipologiaSoggetto(), soggetto.getCodiceFiscale(), serviceContext);
}
}
} else {
List<Soggetto> soggetti = soggettoLocalService.getValidTmpByIntPratica(dettPratica.getIntPraticaId());
for (Soggetto soggetto : soggetti) {
if ((TipoSoggettoUtil.COMMITTENTE.equalsIgnoreCase(soggetto.getTipologiaSoggetto()) && !ValidazionePraticaUtil
@ -375,9 +341,7 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
soggetto.getTipologiaSoggetto(), soggetto.getCodiceFiscale(), serviceContext);
}
}
}
}
@Override
@ -390,7 +354,7 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
}
asseverazione.setEsito(AsseverazioniUtil.STATO_ASSEGNATA);
asseverazione.setDtEsito(null);
if (asseverazione.getFileEntryId() != 0) {
if (asseverazione.getFileEntryId() != 0L) {
DLAppLocalServiceUtil.deleteFileEntry(asseverazione.getFileEntryId());
asseverazione.setFileEntryId(0);
}
@ -409,15 +373,12 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
Asseverazione asseverazione = asseverazioneLocalService.getAsseverazione(asseverazioneId);
Date now = new Date();
if (AsseverazioniUtil.STATO_ESEGUITA.equals(stato)) {
asseverazione = generateReportAsseverazione(asseverazione, userId);
}
asseverazione.setEsito(stato);
asseverazione.setMezzo(AsseverazioniUtil.ASSEVERAZIONE_DA_APPLICATIVO);
asseverazione.setDtEsito(now);
asseverazione = asseverazionePersistence.update(asseverazione);
}
@ -428,22 +389,18 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
if (Validator.isNotNull(asseverazione.getFileEntryId())) {
dlAppLocalService.deleteFileEntry(asseverazione.getFileEntryId());
}
String tipoDocumento = "AS";
String propertiesTemplate = AvvisoUtil.getAllTipoDocumentoFileTemplateProps().get(tipoDocumento);
long fileEntryIdTemplate = configurazioneLocalService.findByC_ChiaveLong(asseverazione.getCompanyId(),
propertiesTemplate);
String propertiesFolder = AvvisoUtil.getAllTipoDocumentoFolderProps().get(tipoDocumento);
long fileEntryIdFolder = configurazioneLocalService.findByC_ChiaveLong(asseverazione.getCompanyId(),
propertiesFolder);
String fileName = StringUtils.leftPad(String.valueOf(asseverazione.getDettPraticaId()), 10, '0')
+ (Validator.isNotNull(tipoDocumento) ? StringPool.UNDERLINE + tipoDocumento : StringPool.BLANK)
+ StringPool.UNDERLINE
+ (Validator.isNotNull(asseverazione.getAsseverazioneId()) ? asseverazione.getAsseverazioneId()
: System.currentTimeMillis());
ReportDto reportDto = new ReportDto();
reportDto.setFileEntryIds(new long[] { fileEntryIdTemplate });
reportDto.setFolderId(fileEntryIdFolder);
@ -453,7 +410,6 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
reportDto.setFooter(StringPool.BLANK);
reportDto.setFooterHeight(40);
Map<String, Object> parameters = new HashMap<String, Object>();
String relazioni = null;
Map<String, Serializable> dichiarazioniMap = asseverazione.getDichiarazioniMap();
if (dichiarazioniMap.containsKey("coniugio")) {
@ -465,31 +421,24 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
relazioni = StringPool.BLANK;
}
}
String testoAsseverazione = testoAsseverazione(asseverazione.getTipologia(), asseverazione.getCodiceFiscale(),
asseverazione.getDettPraticaId(), relazioni);
if (Validator.isNull(testoAsseverazione)) {
testoAsseverazione = AsseverazioniUtil.retrieveAsseverazioneText(asseverazione,
asseverazione.getCodiceFiscale());
}
parameters.put("html", testoAsseverazione);
parameters.put("modello", asseverazione.getModello());
reportDto.setParameters(parameters);
reportDto.setShowNumberOfPage(true);
reportDto.setType(ReportConstants.ReportType.VELOCITY_TO_PDF.toString());
String resourcePath = getClass().getName().replaceAll("\\w+\\.", "../")
.replace(getClass().getSimpleName(), "resource/asseverazioni");
reportDto.setPortalURL(getClass().getResource(resourcePath).getPath());
ReportResultDto result = ReportUtil.generateReport(asseverazione.getCompanyId(), userId, reportDto, null);
long idFileEntry = result.getFileEntryIds()[0];
asseverazione.setFileEntryId(idFileEntry);
asseverazione = asseverazionePersistence.update(asseverazione);
return asseverazione;
}
@ -526,7 +475,6 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
asseverazione.setFileEntryId(0);
asseverazionePersistence.update(asseverazione);
}
}
@Override
@ -556,14 +504,10 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
// TODO forse dobbiamo mettere i permesssi ma non mi pare sicuro.
FileEntry fileEntry = null;
if (asseverazione.getEsito().equalsIgnoreCase(AsseverazioniUtil.STATO_ASSEGNATA)) {
long defaultFolderId = configurazioneLocalService.findByC_ChiaveLong(serviceContext.getCompanyId(),
ConfigurazioneConstants.ATTACHMENT_FOLDER_ID);
Folder defaultFolder = dlAppLocalService.getFolder(defaultFolderId);
String folderName = PraticaUtil.getFolderName(dettPratica.getDettPraticaId());
serviceContext.setGroupPermissions(new String[] { ActionKeys.VIEW });
Folder folder = null;
try {
@ -580,7 +524,6 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
+ tipologiaUtente + StringPool.UNDERLINE + sourceFileName;
String description = StringPool.BLANK;
String mimeType = MimeTypesUtil.getContentType(sourceFileName);
String changeLog = StringPool.BLANK;
fileEntry = dlAppLocalService.addFileEntry(serviceContext.getUserId(), folder.getRepositoryId(),
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);
}
}

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

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

337
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.
*
* This library is free software; you can redistribute it and/or modify it under the terms of the
* GNU Lesser General Public License as published by the Free Software Foundation; either version
* 2.1 of the License, or (at your option) any later version.
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package it.tref.liferay.portos.bo.service.impl;
@ -44,13 +44,12 @@ import com.liferay.portal.service.ServiceContext;
* The implementation of the comunicazione local service.
*
* <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.ComunicazioneLocalService} 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.ComunicazioneLocalService} interface.
*
* <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>
*
* @author Davide Barbagallo, 3F Consulting
@ -58,191 +57,133 @@ import com.liferay.portal.service.ServiceContext;
* @see it.tref.liferay.portos.bo.service.ComunicazioneLocalServiceUtil
*/
public class ComunicazioneLocalServiceImpl extends ComunicazioneLocalServiceBaseImpl {
/*
* NOTE FOR DEVELOPERS:
*
* Never reference this interface directly. Always use {@link
* it.tref.liferay.portos.bo.service.ComunicazioneLocalServiceUtil} to access the comunicazione
* local service.
*/
public Comunicazione addComunicazione(long userId, long intPraticaId, String domanda, ServiceContext serviceContext)
throws SystemException, PortalException {
Comunicazione comunicazione =
comunicazionePersistence.create(counterLocalService.increment(Comunicazione.class.getName()));
User user = userPersistence.findByPrimaryKey(userId);
Date now = new Date();
comunicazione.setCompanyId(serviceContext.getCompanyId());
comunicazione.setUserId(user.getUserId());
comunicazione.setUserName(user.getFullName());
comunicazione.setCreateDate(serviceContext.getCreateDate(now));
comunicazione.setModifiedDate(serviceContext.getModifiedDate(now));
comunicazione.setGroupId(serviceContext.getScopeGroupId());
comunicazione.setIntPraticaId(intPraticaId);
comunicazione.setDomanda(domanda);
comunicazione = comunicazionePersistence.update(comunicazione);
// Send notification mail for new Comunicazione Mediata
this.invioAddMailNotifica(comunicazione.getComunicazioneId(), serviceContext);
return comunicazione;
}
public Comunicazione updateComunicazione(long comunicazioneId, String risposta) throws SystemException,
PortalException {
Comunicazione comunicazione = comunicazionePersistence.fetchByPrimaryKey(comunicazioneId);
Date now = new Date();
comunicazione.setDtRisposta(now);
comunicazione.setRisposta(risposta);
comunicazione = comunicazionePersistence.update(comunicazione);
// resourceLocalService.updateModelResources(comunicazione, serviceContext);
IntPratica intPratica = intPraticaLocalService.getIntPratica(comunicazione.getIntPraticaId());
if (WorkflowUtil.isWorkflowDisattivabile(intPratica.getIntPraticaId())
&& Validator.isNotNull(intPratica.getStatusByUserId())) {
this.invioUpdateMailNotifica(comunicazione.getComunicazioneId(), intPratica.getStatusByUserId(), now);
}
return comunicazione;
}
public List<Comunicazione> findByIntPratica(long intPraticaId) throws SystemException {
return comunicazionePersistence.findByIntPratica(intPraticaId);
}
public List<Comunicazione> findByIntPratica(long intPraticaId, int start, int end, OrderByComparator orderByComparator)
throws SystemException {
return comunicazionePersistence.findByIntPratica(intPraticaId, start, end, orderByComparator);
}
public int countByIntPratica(long intPraticaId) throws SystemException {
return comunicazionePersistence.countByIntPratica(intPraticaId);
}
public int countNotAnsweredByIntPratica(long intPraticaId) throws SystemException {
DynamicQuery dynamicQuery = dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId));
dynamicQuery.add(RestrictionsFactoryUtil.isNull("dtRisposta"));
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,
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 receiver = StringPool.BLANK;
if (!titolari.isEmpty()) {
Soggetto titolareDigitale = titolari.get(0);
eMail = titolareDigitale.getEmail();
receiver = 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 templateVariable = JSONFactoryUtil.createJSONObject();
templateVariable.put("receiver", receiver);
templateVariable.put("link", url);
MailUtil.invioMailNotifica(comunicazione.getIntPraticaId(), 0l, comunicazioneId, Comunicazione.class.getName(), to,
cc, ccn, "INVIO-RICHIESTA-ASSEVERAZIONE", templateVariable, null, serviceContext);
}
private void invioUpdateMailNotifica(long comunicazioneId, long tecnicoIstruttoreId, Date date)
throws PortalException, SystemException {
Comunicazione comunicazione = comunicazioneLocalService.getComunicazione(comunicazioneId);
User tecnicoIstruttore = userLocalService.getUser(tecnicoIstruttoreId);
String[] to = {tecnicoIstruttore.getEmailAddress()};
String[] cc = new String[0];
String[] ccn = new String[0];
String tipoPratica = StringPool.BLANK;
long intPraticaId = comunicazione.getIntPraticaId();
if (AzioniPraticheUtil.isDeposito(intPraticaId)) {
tipoPratica = LanguageUtil.get(LocaleUtil.ITALIAN, "tipo-pratica-01");
} else if (AzioniPraticheUtil.isAutorizzazione(intPraticaId)) {
tipoPratica = LanguageUtil.get(LocaleUtil.ITALIAN, "tipo-pratica-02");
}
JSONObject templateVariables = JSONFactoryUtil.createJSONObject();
templateVariables.put("receiver", tecnicoIstruttore.getFullName());
templateVariables.put("tipoPratica", tipoPratica);
templateVariables.put("tipoOggetto", LanguageUtil.get(LocaleUtil.ITALIAN, "label.comunicazione.mediata"));
templateVariables.put("dataInvio", FastDateFormatFactoryUtil.getSimpleDateFormat("dd/MM/yyyy HH:mm").format(date));
ServiceContext serviceContext = new ServiceContext();
serviceContext.setScopeGroupId(comunicazione.getGroupId());
serviceContext.setCompanyId(comunicazione.getCompanyId());
serviceContext.setUserId(comunicazione.getUserId());
MailUtil.invioMailNotifica(comunicazione.getIntPraticaId(), 0l, comunicazioneId, Comunicazione.class.getName(), to,
cc, ccn, "NOTIFICA-BO", templateVariables, null, serviceContext);
}
/*
* NOTE FOR DEVELOPERS: 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)
throws SystemException, PortalException {
Comunicazione comunicazione = comunicazionePersistence.create(counterLocalService.increment(Comunicazione.class
.getName()));
User user = userPersistence.findByPrimaryKey(userId);
Date now = new Date();
comunicazione.setCompanyId(serviceContext.getCompanyId());
comunicazione.setUserId(user.getUserId());
comunicazione.setUserName(user.getFullName());
comunicazione.setCreateDate(serviceContext.getCreateDate(now));
comunicazione.setModifiedDate(serviceContext.getModifiedDate(now));
comunicazione.setGroupId(serviceContext.getScopeGroupId());
comunicazione.setIntPraticaId(intPraticaId);
comunicazione.setDomanda(domanda);
comunicazione = comunicazionePersistence.update(comunicazione);
// Send notification mail for new Comunicazione Mediata
this.invioAddMailNotifica(comunicazione.getComunicazioneId(), serviceContext);
return comunicazione;
}
@Override
public Comunicazione updateComunicazione(long comunicazioneId, String risposta) throws SystemException,
PortalException {
Comunicazione comunicazione = comunicazionePersistence.fetchByPrimaryKey(comunicazioneId);
Date now = new Date();
comunicazione.setDtRisposta(now);
comunicazione.setRisposta(risposta);
comunicazione = comunicazionePersistence.update(comunicazione);
// resourceLocalService.updateModelResources(comunicazione, serviceContext);
IntPratica intPratica = intPraticaLocalService.getIntPratica(comunicazione.getIntPraticaId());
if (WorkflowUtil.isWorkflowDisattivabile(intPratica.getIntPraticaId())
&& Validator.isNotNull(intPratica.getStatusByUserId())) {
this.invioUpdateMailNotifica(comunicazione.getComunicazioneId(), intPratica.getStatusByUserId(), now);
}
return comunicazione;
}
@Override
public List<Comunicazione> findByIntPratica(long intPraticaId) throws SystemException {
return comunicazionePersistence.findByIntPratica(intPraticaId);
}
@Override
public List<Comunicazione> findByIntPratica(long intPraticaId, int start, int end,
OrderByComparator orderByComparator) throws SystemException {
return comunicazionePersistence.findByIntPratica(intPraticaId, start, end, orderByComparator);
}
@Override
public int countByIntPratica(long intPraticaId) throws SystemException {
return comunicazionePersistence.countByIntPratica(intPraticaId);
}
@Override
public int countNotAnsweredByIntPratica(long intPraticaId) throws SystemException {
DynamicQuery dynamicQuery = dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId));
dynamicQuery.add(RestrictionsFactoryUtil.isNull("dtRisposta"));
return (int) comunicazionePersistence.countWithDynamicQuery(dynamicQuery);
}
private void invioAddMailNotifica(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 receiver = StringPool.BLANK;
if (!titolari.isEmpty()) {
Soggetto titolareDigitale = titolari.get(0);
eMail = titolareDigitale.getEmail();
receiver = 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 templateVariable = JSONFactoryUtil.createJSONObject();
templateVariable.put("receiver", receiver);
templateVariable.put("link", url);
MailUtil.invioMailNotifica(comunicazione.getIntPraticaId(), 0l, comunicazioneId, Comunicazione.class.getName(),
to, cc, ccn, "INVIO-RICHIESTA-ASSEVERAZIONE", templateVariable, null, serviceContext);
}
private void invioUpdateMailNotifica(long comunicazioneId, long tecnicoIstruttoreId, Date date)
throws PortalException, SystemException {
Comunicazione comunicazione = comunicazioneLocalService.getComunicazione(comunicazioneId);
User tecnicoIstruttore = userLocalService.getUser(tecnicoIstruttoreId);
String[] to = { tecnicoIstruttore.getEmailAddress() };
String[] cc = new String[0];
String[] ccn = new String[0];
String tipoPratica = StringPool.BLANK;
long intPraticaId = comunicazione.getIntPraticaId();
if (AzioniPraticheUtil.isDeposito(intPraticaId)) {
tipoPratica = LanguageUtil.get(LocaleUtil.ITALIAN, "tipo-pratica-01");
} else if (AzioniPraticheUtil.isAutorizzazione(intPraticaId)) {
tipoPratica = LanguageUtil.get(LocaleUtil.ITALIAN, "tipo-pratica-02");
}
JSONObject templateVariables = JSONFactoryUtil.createJSONObject();
templateVariables.put("receiver", tecnicoIstruttore.getFullName());
templateVariables.put("tipoPratica", tipoPratica);
templateVariables.put("tipoOggetto", LanguageUtil.get(LocaleUtil.ITALIAN, "label.comunicazione.mediata"));
templateVariables.put("dataInvio",
FastDateFormatFactoryUtil.getSimpleDateFormat("dd/MM/yyyy HH:mm").format(date));
ServiceContext serviceContext = new ServiceContext();
serviceContext.setScopeGroupId(comunicazione.getGroupId());
serviceContext.setCompanyId(comunicazione.getCompanyId());
serviceContext.setUserId(comunicazione.getUserId());
MailUtil.invioMailNotifica(comunicazione.getIntPraticaId(), 0l, comunicazioneId, Comunicazione.class.getName(),
to, 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.
*
* This library is free software; you can redistribute it and/or modify it under the terms of the
* GNU Lesser General Public License as published by the Free Software Foundation; either version
* 2.1 of the License, or (at your option) any later version.
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package it.tref.liferay.portos.bo.service.impl;
@ -29,15 +29,12 @@ import com.liferay.portal.service.ServiceContext;
* The implementation of the configurazione local service.
*
* <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.ConfigurazioneLocalService}
* 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.ConfigurazioneLocalService} interface.
*
* <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>
*
* @author Davide Barbagallo, 3F Consulting
@ -46,12 +43,12 @@ import com.liferay.portal.service.ServiceContext;
*/
public class ConfigurazioneLocalServiceImpl extends ConfigurazioneLocalServiceBaseImpl {
/*
* NOTE FOR DEVELOPERS: Never reference this interface directly. Always use
* {@link it.tref.liferay.portos.bo.service.ConfigurazioneLocalServiceUtil}
* to access the configurazione local service.
* NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link
* it.tref.liferay.portos.bo.service.ConfigurazioneLocalServiceUtil} to access the configurazione local service.
*/
private static final Log _log = LogFactoryUtil.getLog(ConfigurazioneLocalServiceImpl.class);
@Override
public long findByC_ChiaveLong(long companyId, String chiave) throws SystemException {
try {
@ -65,6 +62,7 @@ public class ConfigurazioneLocalServiceImpl extends ConfigurazioneLocalServiceBa
}
}
@Override
public String findByC_ChiaveString(long companyId, String chiave) throws SystemException {
Configurazione configurazione = configurazionePersistence.fetchByC_Chiave(companyId, chiave);
@ -76,6 +74,7 @@ public class ConfigurazioneLocalServiceImpl extends ConfigurazioneLocalServiceBa
return configurazione.getValore();
}
@Override
public Configurazione storeConfig(String chiave, String valore, ServiceContext serviceContext)
throws SystemException, PortalException {
@ -85,8 +84,7 @@ public class ConfigurazioneLocalServiceImpl extends ConfigurazioneLocalServiceBa
} catch (NoSuchConfigurazioneException e) {
}
if (configurazione == null) {
configurazione = createConfigurazione(counterLocalService.increment(Configurazione.class
.getName()));
configurazione = createConfigurazione(counterLocalService.increment(Configurazione.class.getName()));
configurazione.setChiave(chiave);
configurazione.setCompanyId(serviceContext.getCompanyId());
configurazione.setCreateDate(new Date());
@ -98,6 +96,7 @@ public class ConfigurazioneLocalServiceImpl extends ConfigurazioneLocalServiceBa
return configurazioneLocalService.updateConfigurazione(configurazione);
}
@Override
public long getAndIncrement(long companyId, String chiave) throws SystemException {
try {
@ -107,16 +106,16 @@ public class ConfigurazioneLocalServiceImpl extends ConfigurazioneLocalServiceBa
configurazioneLocalService.updateConfigurazione(configurazione);
return current;
} catch (NoSuchConfigurazioneException e) {
Configurazione configurazione = createConfigurazione(counterLocalService
.increment(Configurazione.class.getName()));
Configurazione configurazione = createConfigurazione(counterLocalService.increment(Configurazione.class
.getName()));
configurazione.setChiave(chiave);
configurazione.setCompanyId(companyId);
configurazione.setCreateDate(new Date());
configurazione.setGroupId(-1);
configurazione.setUserId(0l);
configurazione.setUserId(0L);
configurazione.setValore("2");
configurazioneLocalService.updateConfigurazione(configurazione);
return 1l;
return 1L;
} catch (NumberFormatException e) {
_log.error("error", 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 {
User user = userPersistence.findByPrimaryKey(userId);
// In creazione del sito viene avviato il workflow sul sito principale
// mentre in update di una
// issue viene avviato
// sul sito specifico per ovviare a bug
// long groupId = serviceContext.getScopeGroupId();
// In creazione del sito viene avviato il workflow sul sito principale mentre in update di una issue viene
// avviato sul sito specifico per ovviare a bug
Date now = new Date();
long controlloPraticaId = counterLocalService.increment(ControlloPratica.class.getName());
ControlloPratica entry = controlloPraticaPersistence.create(controlloPraticaId);
entry.setCompanyId(user.getCompanyId());
entry.setUserId(user.getUserId());
entry.setUserName(user.getFullName());
_log.info("User Full Name: " + user.getFullName());
entry.setCreateDate(serviceContext.getCreateDate(now));
entry.setModifiedDate(serviceContext.getModifiedDate(now));
entry.setGroupId(groupId);
entry.setIntPraticaId(intPraticaId);
entry.setDettPraticaId(dettPraticaId);
// Workflow
entry.setStatus(WorkflowConstants.STATUS_DRAFT);
controlloPraticaPersistence.update(entry);
// Resources
resourceLocalService.addModelResources(entry, serviceContext);
// aggiorno int e dett pratica per avvio workflow
IntPratica intPratica = intPraticaLocalService.updateStatoPratica(intPraticaId,
StatoPraticaConstants.SOTTOPOSTA_A_PARERE);
@ -150,11 +139,9 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi
intPratica.setControlloObbligatorio(true);
intPratica = intPraticaLocalService.updateIntPratica(intPratica);
}
// Asset
updateAsset(userId, entry, serviceContext.getAssetCategoryIds(), serviceContext.getAssetTagNames(),
serviceContext.getAssetLinkEntryIds(), now);
// ADT: BUG BO GESTIONE WORKFLOW
Map<String, Serializable> wfContextMap = new HashMap<String, Serializable>();
DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(dettPraticaId);
@ -162,21 +149,17 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi
wfContextMap.put("wf_variante", "OK");
}
// ///////////
// Workflow
WorkflowHandlerRegistryUtil.startWorkflowInstance(entry.getCompanyId(), entry.getGroupId(), entry.getUserId(),
ControlloPratica.class.getName(), entry.getPrimaryKey(), entry, serviceContext, wfContextMap);
Date dtInvio = null;
if (intPratica.getDtSorteggio() != null) {
dtInvio = intPratica.getDtSorteggio();
} else {
dtInvio = entry.getCreateDate();
}
TempisticaLocalServiceUtil.addTempistica(intPraticaId, dettPraticaId, TempisticaConstants.TIPO_PRATICA,
dtInvio, serviceContext);
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.
*
* This library is free software; you can redistribute it and/or modify it under the terms of the
* GNU Lesser General Public License as published by the Free Software Foundation; either version
* 2.1 of the License, or (at your option) any later version.
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package it.tref.liferay.portos.bo.service.impl;
@ -55,14 +55,12 @@ import com.liferay.portlet.documentlibrary.service.DLFolderLocalServiceUtil;
* The implementation of the delega local service.
*
* <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.DelegaLocalService} 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.DelegaLocalService} interface.
*
* <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>
*
* @author Davide Barbagallo, 3F Consulting
@ -71,42 +69,31 @@ import com.liferay.portlet.documentlibrary.service.DLFolderLocalServiceUtil;
*/
public class DelegaLocalServiceImpl extends DelegaLocalServiceBaseImpl {
/*
* NOTE FOR DEVELOPERS:
*
* Never reference this interface directly. Always use {@link
* it.tref.liferay.portos.bo.service.DelegaLocalServiceUtil} to access the
* delega local service.
* NOTE FOR DEVELOPERS: 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);
@Override
public Delega addDelega(long userId, long intPraticaId, long dettPraticaId, String tipologia,
String codiceFiscale, ServiceContext serviceContext) throws PortalException, SystemException {
public Delega addDelega(long userId, long intPraticaId, long dettPraticaId, String tipologia, String codiceFiscale,
ServiceContext serviceContext) throws PortalException, SystemException {
User user = userPersistence.findByPrimaryKey(userId);
Date now = new Date();
validate(tipologia, codiceFiscale);
Delega delega = delegaPersistence.create(counterLocalService.increment(Delega.class.getName()));
delega.setCompanyId(serviceContext.getCompanyId());
delega.setUserId(user.getUserId());
delega.setUserName(user.getFullName());
delega.setCreateDate(serviceContext.getCreateDate(now));
delega.setModifiedDate(serviceContext.getModifiedDate(now));
delega.setGroupId(serviceContext.getScopeGroupId());
delega.setIntPraticaId(intPraticaId);
delega.setDettPraticaId(dettPraticaId);
delega.setTipologia(tipologia);
delega.setEsito(DelegheUtil.STATO_ASSEGNATA);
delega.setCodiceFiscale(codiceFiscale);
delega = delegaPersistence.update(delega);
return delega;
}
@ -126,6 +113,7 @@ public class DelegaLocalServiceImpl extends DelegaLocalServiceBaseImpl {
@Override
public void concludiDeleghePagamento(long dettPraticaId) throws PortalException, SystemException {
List<Delega> deleghe = this.findByDettPratica_Tipologia_InEsito(dettPraticaId,
new String[] { DelegheUtil.TIPO_PAGAMENTO }, new String[] { DelegheUtil.STATO_ASSEGNATA });
for (Delega delega : deleghe) {
@ -146,115 +134,120 @@ public class DelegaLocalServiceImpl extends DelegaLocalServiceBaseImpl {
return deleteDelega(delega);
}
private void validate(String tipologia, String codiceFiscale) throws PortalException, SystemException {
// TODO Write your own validation code
}
@Override
public List<Delega> findByIntPratica(long intPraticaId, int start, int end,
OrderByComparator orderByComparator) throws SystemException {
public List<Delega> findByIntPratica(long intPraticaId, int start, int end, OrderByComparator orderByComparator)
throws SystemException {
return delegaPersistence.findByIntPratica(intPraticaId, start, end, orderByComparator);
}
@Override
public List<Delega> findByDettPratica(long dettPraticaId, int start, int end,
OrderByComparator orderByComparator) throws SystemException {
public List<Delega> findByDettPratica(long dettPraticaId, int start, int end, OrderByComparator orderByComparator)
throws SystemException {
return delegaPersistence.findByDettPratica(dettPraticaId, start, end, orderByComparator);
}
@Override
public int countByIntPratica(long intPraticaId) throws SystemException {
return delegaPersistence.countByIntPratica(intPraticaId);
}
@Override
public int countByDettPratica(long dettPraticaId) throws SystemException {
return delegaPersistence.countByIntPratica(dettPraticaId);
}
@Override
public List<Delega> findByIntPratica_CodiceFiscale(long intPraticaId, String codiceFiscale, int start,
int end, OrderByComparator orderByComparator) throws SystemException {
public List<Delega> findByIntPratica_CodiceFiscale(long intPraticaId, String codiceFiscale, int start, int end,
OrderByComparator orderByComparator) throws SystemException {
return delegaPersistence.findByIntPratica_CodiceFiscale(intPraticaId, codiceFiscale, start, end,
orderByComparator);
}
@Override
public List<Delega> findByCodiceFiscale(String codiceFiscale) throws SystemException {
return delegaPersistence.findByCodiceFiscale(codiceFiscale);
}
@Override
public int countByIntPratica_CodiceFiscale(long intPraticaId, String codiceFiscale)
throws SystemException {
public int countByIntPratica_CodiceFiscale(long intPraticaId, String codiceFiscale) throws SystemException {
return delegaPersistence.countByIntPratica_CodiceFiscale(intPraticaId, codiceFiscale);
}
@Override
public List<Delega> findByCodiceFiscale_InEsito(String codiceFiscale, String[] esiti, int start, int end,
OrderByComparator orderByComparator) throws SystemException {
return delegaPersistence.findByCodiceFiscale_InEsito(codiceFiscale, esiti, start, end,
orderByComparator);
return delegaPersistence.findByCodiceFiscale_InEsito(codiceFiscale, esiti, start, end, orderByComparator);
}
@Override
public int countByCodiceFiscale_InEsito(String codiceFiscale, String[] esiti) throws SystemException {
return delegaPersistence.countByCodiceFiscale_InEsito(codiceFiscale, esiti);
}
@Override
public List<Delega> findByIntPratica_CodiceFiscale_InEsito(long intPraticaId, String codiceFiscale,
String[] esiti, int start, int end, OrderByComparator orderByComparator) throws SystemException {
return delegaPersistence.findByIntPratica_CodiceFiscale_InEsito(intPraticaId, codiceFiscale, esiti,
start, end, orderByComparator);
public List<Delega> findByIntPratica_CodiceFiscale_InEsito(long intPraticaId, String codiceFiscale, String[] esiti,
int start, int end, OrderByComparator orderByComparator) throws SystemException {
return delegaPersistence.findByIntPratica_CodiceFiscale_InEsito(intPraticaId, codiceFiscale, esiti, start, end,
orderByComparator);
}
@Override
public int countByIntPratica_CodiceFiscale_InEsito(long intPraticaId, String codiceFiscale, String[] esiti)
throws SystemException {
return delegaPersistence.countByIntPratica_CodiceFiscale_InEsito(intPraticaId, codiceFiscale, esiti);
}
@Override
public List<Delega> findByDettPratica_CodiceFiscale_InEsito(long dettPraticaId, String codiceFiscale,
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
public int countByDettPratica_CodiceFiscale_InEsito(long dettPraticaId, String codiceFiscale,
String[] esiti) throws SystemException {
return delegaPersistence
.countByDettPratica_CodiceFiscale_InEsito(dettPraticaId, codiceFiscale, esiti);
public int countByDettPratica_CodiceFiscale_InEsito(long dettPraticaId, String codiceFiscale, String[] esiti)
throws SystemException {
return delegaPersistence.countByDettPratica_CodiceFiscale_InEsito(dettPraticaId, codiceFiscale, esiti);
}
@Override
public List<Delega> findByIntPratica_InEsito(long intPraticaId, String[] esiti, int start, int end,
OrderByComparator orderByComparator) throws SystemException {
return delegaPersistence.findByIntPratica_InEsito(intPraticaId, esiti, start, end, orderByComparator);
}
@Override
public int countByIntPratica_InEsito(long intPraticaId, String[] esiti) throws SystemException {
return delegaPersistence.countByIntPratica_InEsito(intPraticaId, esiti);
}
@Override
public List<Delega> findByDettPratica_InEsito(long dettPraticaId, String[] esiti, int start, int end,
OrderByComparator orderByComparator) throws SystemException {
return delegaPersistence.findByDettPratica_InEsito(dettPraticaId, esiti, start, end,
orderByComparator);
return delegaPersistence.findByDettPratica_InEsito(dettPraticaId, esiti, start, end, orderByComparator);
}
@Override
public List<String> findCfByDettPratica_InEsito(long dettPraticaId, String[] esiti)
throws SystemException {
public List<String> findCfByDettPratica_InEsito(long dettPraticaId, String[] esiti) throws SystemException {
DynamicQuery dynamicQuery = createQueryByDettPratica_InEsito(dettPraticaId, esiti);
dynamicQuery.setProjection(ProjectionFactoryUtil.distinct(ProjectionFactoryUtil
.property("codiceFiscale")));
dynamicQuery.setProjection(ProjectionFactoryUtil.distinct(ProjectionFactoryUtil.property("codiceFiscale")));
return delegaPersistence.findWithDynamicQuery(dynamicQuery);
}
@ -262,148 +255,148 @@ public class DelegaLocalServiceImpl extends DelegaLocalServiceBaseImpl {
public List<Delega> findByDettPratica_InEsito(long dettPraticaId, String[] esiti) throws SystemException {
DynamicQuery dynamicQuery = createQueryByDettPratica_InEsito(dettPraticaId, esiti);
return delegaPersistence.findWithDynamicQuery(dynamicQuery);
}
@Override
public List<String> findCfByDettPratica_Tipologia_InEsito(long dettPraticaId, String[] tipologie,
String[] esiti) throws SystemException {
public List<String> findCfByDettPratica_Tipologia_InEsito(long dettPraticaId, String[] tipologie, String[] esiti)
throws SystemException {
DynamicQuery dynamicQuery = createQueryByDettPratica_InEsito(dettPraticaId, esiti);
dynamicQuery.add(RestrictionsFactoryUtil.in("tipologia", tipologie));
dynamicQuery.setProjection(ProjectionFactoryUtil.distinct(ProjectionFactoryUtil
.property("codiceFiscale")));
dynamicQuery.setProjection(ProjectionFactoryUtil.distinct(ProjectionFactoryUtil.property("codiceFiscale")));
return delegaPersistence.findWithDynamicQuery(dynamicQuery);
}
@Override
public List<Delega> findByDettPratica_Tipologia_InEsito(long dettPraticaId, String[] tipologie,
String[] esiti) throws SystemException {
public List<Delega> findByDettPratica_Tipologia_InEsito(long dettPraticaId, String[] tipologie, String[] esiti)
throws SystemException {
DynamicQuery dynamicQuery = createQueryByDettPratica_InEsito(dettPraticaId, esiti);
dynamicQuery.add(RestrictionsFactoryUtil.in("tipologia", tipologie));
return delegaPersistence.findWithDynamicQuery(dynamicQuery);
}
private DynamicQuery createQueryByDettPratica_InEsito(long dettPraticaId, String[] esiti) {
DynamicQuery dynamicQuery = dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.eq("dettPraticaId", dettPraticaId));
dynamicQuery.add(RestrictionsFactoryUtil.in("esito", esiti));
return dynamicQuery;
}
@Override
public int countByDettPratica_InEsito(long dettPraticaId, String[] esiti) throws SystemException {
return delegaPersistence.countByDettPratica_InEsito(dettPraticaId, esiti);
}
@Override
public List<Delega> findByCodiceFiscale_Tipologia_InEsito(String codiceFiscale, String tipologia,
String[] esiti, int start, int end, OrderByComparator orderByComparator) throws SystemException {
return delegaPersistence.findByCodiceFiscale_Tipologia_InEsito(codiceFiscale, tipologia, esiti,
start, end, orderByComparator);
public List<Delega> findByCodiceFiscale_Tipologia_InEsito(String codiceFiscale, String tipologia, String[] esiti,
int start, int end, OrderByComparator orderByComparator) throws SystemException {
return delegaPersistence.findByCodiceFiscale_Tipologia_InEsito(codiceFiscale, tipologia, esiti, start, end,
orderByComparator);
}
@Override
public int countByCodiceFiscale_Tipologia_InEsito(String codiceFiscale, String tipologia, String[] esiti)
throws SystemException {
return delegaPersistence.countByCodiceFiscale_Tipologia_InEsito(codiceFiscale, tipologia, esiti);
}
@Override
public List<Delega> findByIntPratica_CodiceFiscale_Tipologia_InEsito(long intPraticaId,
String codiceFiscale, String tipologia, String[] esiti, int start, int end,
OrderByComparator orderByComparator) throws SystemException {
return delegaPersistence.findByIntPratica_CodiceFiscale_Tipologia_InEsito(intPraticaId,
codiceFiscale, tipologia, esiti, start, end, orderByComparator);
public List<Delega> findByIntPratica_CodiceFiscale_Tipologia_InEsito(long intPraticaId, String codiceFiscale,
String tipologia, String[] esiti, int start, int end, OrderByComparator orderByComparator)
throws SystemException {
return delegaPersistence.findByIntPratica_CodiceFiscale_Tipologia_InEsito(intPraticaId, codiceFiscale,
tipologia, esiti, start, end, orderByComparator);
}
@Override
public int countByIntPratica_CodiceFiscale_Tipologia_InEsito(long intPraticaId, String codiceFiscale,
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
public List<Delega> findByDettPratica_CodiceFiscale_Tipologia_InEsito(long dettPraticaId,
String codiceFiscale, String[] tipologie, String[] esiti, int start, int end,
OrderByComparator orderByComparator) throws SystemException {
return delegaPersistence.findByDettPratica_CodiceFiscale_Tipologia_InEsito(dettPraticaId,
codiceFiscale, tipologie, esiti, start, end, orderByComparator);
public List<Delega> findByDettPratica_CodiceFiscale_Tipologia_InEsito(long dettPraticaId, String codiceFiscale,
String[] tipologie, String[] esiti, int start, int end, OrderByComparator orderByComparator)
throws SystemException {
return delegaPersistence.findByDettPratica_CodiceFiscale_Tipologia_InEsito(dettPraticaId, codiceFiscale,
tipologie, esiti, start, end, orderByComparator);
}
@Override
public int countByDettPratica_CodiceFiscale_Tipologia_InEsito(long dettPraticaId, String codiceFiscale,
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
public List<Delega> findByIntPratica_Tipologia_InEsito(long intPraticaId, String tipologia,
String[] esiti, int start, int end, OrderByComparator orderByComparator) throws SystemException {
return delegaPersistence.findByIntPratica_Tipologia_InEsito(intPraticaId, tipologia, esiti, start,
end, orderByComparator);
public List<Delega> findByIntPratica_Tipologia_InEsito(long intPraticaId, String tipologia, String[] esiti,
int start, int end, OrderByComparator orderByComparator) throws SystemException {
return delegaPersistence.findByIntPratica_Tipologia_InEsito(intPraticaId, tipologia, esiti, start, end,
orderByComparator);
}
@Override
public List<Delega> findByDettPratica_Tipologia_InEsito(long dettPraticaId, String tipologia,
String[] esiti, int start, int end, OrderByComparator orderByComparator) throws SystemException {
return delegaPersistence.findByDettPratica_Tipologia_InEsito(dettPraticaId, tipologia, esiti, start,
end, orderByComparator);
public List<Delega> findByDettPratica_Tipologia_InEsito(long dettPraticaId, String tipologia, String[] esiti,
int start, int end, OrderByComparator orderByComparator) throws SystemException {
return delegaPersistence.findByDettPratica_Tipologia_InEsito(dettPraticaId, tipologia, esiti, start, end,
orderByComparator);
}
@Override
public int countByIntPratica_Tipologia_InEsito(long intPraticaId, String tipologia, String[] esiti)
throws SystemException {
return delegaPersistence.countByIntPratica_Tipologia_InEsito(intPraticaId, tipologia, esiti);
}
@Override
public List<Delega> findByDettPratica_Tipologia_InEsito(long dettPraticaId, String[] tipologie,
String[] esiti, int start, int end, OrderByComparator orderByComparator) throws SystemException {
return delegaPersistence.findByDettPratica_Tipologie_InEsiti(dettPraticaId, tipologie, esiti, start,
end, orderByComparator);
public List<Delega> findByDettPratica_Tipologia_InEsito(long dettPraticaId, String[] tipologie, String[] esiti,
int start, int end, OrderByComparator orderByComparator) throws SystemException {
return delegaPersistence.findByDettPratica_Tipologie_InEsiti(dettPraticaId, tipologie, esiti, start, end,
orderByComparator);
}
@Override
public int countByDettPratica_Tipologia_InEsito(long intPraticaId, String[] tipologie, String[] esiti)
throws SystemException {
return delegaPersistence.countByDettPratica_Tipologie_InEsiti(intPraticaId, tipologie, esiti);
}
/**
*
* ADT: nuovo metodo generazione documento conclusione delega
*/
// ADT: nuovo metodo generazione documento conclusione delega
@Override
public void generaDocumentoConcludiDelegaGeologo(long dettPraticaId, Delega delega,
ServiceContext serviceContext) throws PortalException, SystemException {
public void generaDocumentoConcludiDelegaGeologo(long dettPraticaId, Delega delega, ServiceContext serviceContext)
throws PortalException, SystemException {
try {
if (delega.getTipologia().equalsIgnoreCase(DelegheUtil.TIPO_GEOLOGO)) {
String tipoDocumento = "D_GEO_";
long userId = serviceContext.getUserId();
DLFolder folderTemplate = DLFolderLocalServiceUtil.getFolder(serviceContext.getThemeDisplay()
.getCompanyGroupId(), 0L, "Template");
FileEntry fileEntryIdTemplate = DLAppLocalServiceUtil.getFileEntry(serviceContext
.getThemeDisplay().getCompanyGroupId(), folderTemplate.getFolderId(), "Modello Asseverazione");
FileEntry fileEntryIdTemplate = DLAppLocalServiceUtil.getFileEntry(serviceContext.getThemeDisplay()
.getCompanyGroupId(), folderTemplate.getFolderId(), "Modello Asseverazione");
DLFolder folderAllegati = DLFolderLocalServiceUtil.getFolder(serviceContext.getThemeDisplay()
.getCompanyGroupId(), 0L, "Allegati");
String fileName = StringUtils.leftPad(String.valueOf(delega.getIntPraticaId()), 10, '0')
+ (Validator.isNotNull(tipoDocumento) ? StringPool.UNDERLINE + tipoDocumento
: StringPool.BLANK) + StringPool.UNDERLINE + System.currentTimeMillis()
+ ".pdf";
+ (Validator.isNotNull(tipoDocumento) ? StringPool.UNDERLINE + tipoDocumento : StringPool.BLANK)
+ StringPool.UNDERLINE + System.currentTimeMillis() + ".pdf";
Map<String, Object> parameters = new HashMap<String, Object>();
ReportDto reportDto = new ReportDto();
reportDto.setFileEntryIds(new long[] { fileEntryIdTemplate.getFileEntryId() });
reportDto.setFolderId(folderAllegati.getFolderId());
@ -412,46 +405,35 @@ public class DelegaLocalServiceImpl extends DelegaLocalServiceBaseImpl {
reportDto.setHeaderHeight(1);
reportDto.setFooter(StringPool.BLANK);
reportDto.setFooterHeight(40);
reportDto.setParameters(parameters);
reportDto.setShowNumberOfPage(true);
reportDto.setType(ReportConstants.ReportType.VELOCITY_TO_PDF.toString());
String resourcePath = getClass().getName().replaceAll("\\w+\\.", "../")
.replace(getClass().getSimpleName(), "resource/asseverazioni");
reportDto.setPortalURL(getClass().getResource(resourcePath).getPath());
String relazioni = StringPool.BLANK;
Map<String, Serializable> dichiarazioniMap = delega.getDichiarazioniMap();
if (dichiarazioniMap.containsKey("coniugio") && ((Boolean) dichiarazioniMap.get("coniugio"))
&& dichiarazioniMap.containsKey("relazioni")) {
relazioni = (String) dichiarazioniMap.get("relazioni");
}
User user = userLocalService.getUser(userId);
parameters.put("html", AsseverazioneLocalServiceUtil.testoAsseverazione(
TipoSoggettoUtil.GEOLOGO, user, dettPraticaId, relazioni));
parameters.put("html", AsseverazioneLocalServiceUtil.testoAsseverazione(TipoSoggettoUtil.GEOLOGO, user,
dettPraticaId, relazioni));
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];
String sha256 = StringPool.BLANK;
try {
sha256 = DigestUtils.sha256Hex(dlAppLocalService.getFileEntry(fileEntryId)
.getContentStream());
sha256 = DigestUtils.sha256Hex(dlAppLocalService.getFileEntry(fileEntryId).getContentStream());
} catch (Exception e) {
}
FirmeBean firmeBean = new FirmeBean();
String jsonFirmatari = FirmeUtil.addFirma(firmeBean, user.getScreenName());
docPraticaLocalService.addDocPraticaAnnullamento(userId, Delega.class.getName(),
delega.getDelegaId(), delega.getIntPraticaId(), fileEntryId, fileName, tipoDocumento,
sha256, jsonFirmatari, serviceContext);
_log.info("Documento conclusione delega correttamente generato per delegaid = "
+ delega.getDelegaId());
docPraticaLocalService.addDocPraticaAnnullamento(userId, Delega.class.getName(), delega.getDelegaId(),
delega.getIntPraticaId(), fileEntryId, fileName, tipoDocumento, sha256, jsonFirmatari,
serviceContext);
_log.info("Documento conclusione delega correttamente generato per delegaid = " + delega.getDelegaId());
} else {
_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.
*
* This library is free software; you can redistribute it and/or modify it under the terms of the
* GNU Lesser General Public License as published by the Free Software Foundation; either version
* 2.1 of the License, or (at your option) any later version.
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package it.tref.liferay.portos.bo.service.impl;
@ -40,15 +40,12 @@ import com.liferay.portlet.documentlibrary.NoSuchFolderException;
* The implementation of the doc aggiuntiva local service.
*
* <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.DocAggiuntivaLocalService}
* 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.DocAggiuntivaLocalService} interface.
*
* <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>
*
* @author Davide Barbagallo, 3F Consulting
@ -57,100 +54,98 @@ import com.liferay.portlet.documentlibrary.NoSuchFolderException;
*/
public class DocAggiuntivaLocalServiceImpl extends DocAggiuntivaLocalServiceBaseImpl {
/*
* NOTE FOR DEVELOPERS: Never reference this interface directly. Always use
* {@link it.tref.liferay.portos.bo.service.DocAggiuntivaLocalServiceUtil}
* to access the doc aggiuntiva local service.
* NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link
* it.tref.liferay.portos.bo.service.DocAggiuntivaLocalServiceUtil} to access the doc aggiuntiva local service.
*/
@Override
public List<DocAggiuntiva> findByIntPratica(long intPraticaId) throws SystemException {
return docAggiuntivaPersistence.findByIntPratica(intPraticaId);
}
@Override
public List<DocAggiuntiva> findByIntPratica(long intPraticaId, int start, int end,
OrderByComparator orderByComparator) throws SystemException {
return docAggiuntivaPersistence.findByIntPratica(intPraticaId, start, end, orderByComparator);
}
@Override
public int countByIntPratica(long intPraticaId) throws SystemException {
return docAggiuntivaPersistence.countByIntPratica(intPraticaId);
}
@Override
public List<DocAggiuntiva> findByDettPratica(long dettPraticaId) throws SystemException {
return docAggiuntivaPersistence.findByIntPratica(dettPraticaId);
}
@Override
public List<DocAggiuntiva> findByDettPratica(long dettPraticaId, int start, int end,
OrderByComparator orderByComparator) throws SystemException {
return docAggiuntivaPersistence.findByIntPratica(dettPraticaId, start, end, orderByComparator);
}
@Override
public int countByDettPratica(long dettPraticaId) throws SystemException {
return docAggiuntivaPersistence.countByIntPratica(dettPraticaId);
}
public List<DocAggiuntiva> findByIntPraticaFeVisible(long intPraticaId, boolean feVisible)
throws SystemException {
@Override
public List<DocAggiuntiva> findByIntPraticaFeVisible(long intPraticaId, boolean feVisible) throws SystemException {
return docAggiuntivaPersistence.findByIntPratica_FeVisible(intPraticaId, feVisible);
}
public List<DocAggiuntiva> findByIntPraticaFeVisible(long intPraticaId, boolean feVisible, int start,
int end, OrderByComparator orderByComparator) throws SystemException {
@Override
public List<DocAggiuntiva> findByIntPraticaFeVisible(long intPraticaId, boolean feVisible, int start, int end,
OrderByComparator orderByComparator) throws SystemException {
return docAggiuntivaPersistence.findByIntPratica_FeVisible(intPraticaId, feVisible, start, end,
orderByComparator);
}
@Override
public int countByIntPraticaFeVisible(long intPraticaId, boolean feVisible) throws SystemException {
return docAggiuntivaPersistence.countByIntPratica_FeVisible(intPraticaId, feVisible);
}
public DocAggiuntiva addDocAggiuntiva(long userId, long intPraticaId, long dettPraticaId,
String descrizione, boolean feVisible, byte[] content, String sourceFileName,
ServiceContext serviceContext) throws SystemException, PortalException {
DocAggiuntiva docAggiuntiva = docAggiuntivaPersistence.create(counterLocalService
.increment(DocAggiuntiva.class.getName()));
@Override
public DocAggiuntiva addDocAggiuntiva(long userId, long intPraticaId, long dettPraticaId, String descrizione,
boolean feVisible, byte[] content, String sourceFileName, ServiceContext serviceContext)
throws SystemException, PortalException {
DocAggiuntiva docAggiuntiva = docAggiuntivaPersistence.create(counterLocalService.increment(DocAggiuntiva.class
.getName()));
DettPratica dettPratica = dettPraticaLocalService.getDettPratica(dettPraticaId);
User user = userPersistence.findByPrimaryKey(userId);
Date now = new Date();
docAggiuntiva.setCompanyId(serviceContext.getCompanyId());
docAggiuntiva.setUserId(user.getUserId());
docAggiuntiva.setUserName(user.getFullName());
docAggiuntiva.setCreateDate(serviceContext.getCreateDate(now));
docAggiuntiva.setModifiedDate(serviceContext.getModifiedDate(now));
docAggiuntiva.setGroupId(serviceContext.getScopeGroupId());
docAggiuntiva.setIntPraticaId(intPraticaId);
docAggiuntiva.setDettPraticaId(dettPraticaId);
docAggiuntiva.setDescrizione(descrizione);
docAggiuntiva.setFeVisible(feVisible);
long fileEntryId = 0l;
long fileEntryId = 0L;
long defaultFolderId = configurazioneLocalService.findByC_ChiaveLong(serviceContext.getCompanyId(),
ConfigurazioneConstants.ATTACHMENT_FOLDER_ID);
Folder defaultFolder = dlAppLocalService.getFolder(defaultFolderId);
String folderName = PraticaUtil.getFolderName(dettPratica.getDettPraticaId());
serviceContext.setGroupPermissions(new String[] { ActionKeys.VIEW });
Folder folder = null;
try {
folder = dlAppLocalService.getFolder(defaultFolder.getRepositoryId(),
defaultFolder.getFolderId(), folderName);
folder = dlAppLocalService.getFolder(defaultFolder.getRepositoryId(), defaultFolder.getFolderId(),
folderName);
} catch (NoSuchFolderException e) {
// cartella non presente -> creo cartella
folder = dlAppLocalService.addFolder(serviceContext.getUserId(), defaultFolder.getRepositoryId(),
@ -160,16 +155,13 @@ public class DocAggiuntivaLocalServiceImpl extends DocAggiuntivaLocalServiceBase
+ docAggiuntiva.getDocAggiuntivaId() + StringPool.UNDERLINE + sourceFileName;
String description = sourceFileName;
String mimeType = MimeTypesUtil.getContentType(sourceFileName);
String changeLog = StringPool.BLANK;
FileEntry fileEntry = dlAppLocalService.addFileEntry(serviceContext.getUserId(),
folder.getRepositoryId(), folder.getFolderId(), now.getTime() + "_" + sourceFileName,
mimeType, title, description, changeLog, content, serviceContext);
FileEntry fileEntry = dlAppLocalService.addFileEntry(serviceContext.getUserId(), folder.getRepositoryId(),
folder.getFolderId(), now.getTime() + StringPool.UNDERLINE + sourceFileName, mimeType, title,
description, changeLog, content, serviceContext);
fileEntryId = fileEntry.getFileEntryId();
docAggiuntiva.setFileEntryId(fileEntryId);
docAggiuntiva = docAggiuntivaPersistence.update(docAggiuntiva);
return docAggiuntiva;
}
@ -193,9 +185,9 @@ public class DocAggiuntivaLocalServiceImpl extends DocAggiuntivaLocalServiceBase
return deleteDocAggiuntiva(docAggiuntivaLocalService.getDocAggiuntiva(docAggiuntivaId));
}
@Override
public DocAggiuntiva fetchByOldFileEntryId(long oldFileEntryId) throws SystemException {
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.
*
* This library is free software; you can redistribute it and/or modify it under the terms of the
* GNU Lesser General Public License as published by the Free Software Foundation; either version
* 2.1 of the License, or (at your option) any later version.
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package it.tref.liferay.portos.bo.service.impl;
@ -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.util.PraticaUtil;
import java.net.HttpURLConnection;
import java.util.Date;
import java.util.List;
@ -54,14 +55,12 @@ import com.liferay.portlet.documentlibrary.NoSuchFolderException;
* The implementation of the doc pratica local service.
*
* <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.DocPraticaLocalService} 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.DocPraticaLocalService} interface.
*
* <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>
*
* @author Davide Barbagallo, 3F Consulting
@ -70,9 +69,8 @@ import com.liferay.portlet.documentlibrary.NoSuchFolderException;
*/
public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
/*
* NOTE FOR DEVELOPERS: Never reference this interface directly. Always use
* {@link it.tref.liferay.portos.bo.service.DocPraticaLocalServiceUtil} to
* access the doc pratica local service.
* NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link
* it.tref.liferay.portos.bo.service.DocPraticaLocalServiceUtil} to access the doc pratica local service.
*/
@Override
@ -93,32 +91,22 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
return deleteDocPratica(docPraticaLocalService.getDocPratica(docPraticaId));
}
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, boolean aggiornato, String jsonFirmatari,
long dettPraticaIdRimozione, Date dtDataRimozione, ServiceContext serviceContext)
throws PortalException, SystemException {
@Override
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,
boolean aggiornato, String jsonFirmatari, long dettPraticaIdRimozione, Date dtDataRimozione,
ServiceContext serviceContext) throws PortalException, SystemException {
User user = userPersistence.findByPrimaryKey(userId);
Date now = new Date();
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 docPratica = docPraticaPersistence.create(counterLocalService.increment(DocPratica.class.getName()));
FileEntry fileEntry = addAttachment(classPk, intPraticaId, userId, fileName, dlFileEntry, tipologia);
docPratica.setCompanyId(serviceContext.getCompanyId());
docPratica.setUserId(user.getUserId());
docPratica.setUserName(user.getFullName());
docPratica.setCreateDate(serviceContext.getCreateDate(now));
docPratica.setModifiedDate(serviceContext.getModifiedDate(now));
docPratica.setGroupId(serviceContext.getScopeGroupId());
docPratica.setClassName(className);
docPratica.setClassPk(classPk);
docPratica.setIntPraticaId(intPraticaId);
@ -132,34 +120,26 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
docPratica.setJsonFirmatari(jsonFirmatari);
docPratica.setDettPraticaIdRimozione(dettPraticaIdRimozione);
docPratica.setDtDataRimozione(dtDataRimozione);
docPratica.setStatus(WorkflowConstants.STATUS_PENDING);
docPratica = docPraticaPersistence.update(docPratica);
return docPratica;
}
public DocPratica addDocPratica(long userId, String className, long classPk, long intPraticaId,
byte[] dlFileEntry, String fileName, String tipologia, String jsonFirmatari,
ServiceContext serviceContext) throws PortalException, SystemException {
@Override
public DocPratica addDocPratica(long userId, String className, long classPk, long intPraticaId, byte[] dlFileEntry,
String fileName, String tipologia, String jsonFirmatari, ServiceContext serviceContext)
throws PortalException, SystemException {
User user = userPersistence.findByPrimaryKey(userId);
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);
docPratica.setCompanyId(serviceContext.getCompanyId());
docPratica.setUserId(user.getUserId());
docPratica.setUserName(user.getFullName());
docPratica.setCreateDate(serviceContext.getCreateDate(now));
docPratica.setModifiedDate(serviceContext.getModifiedDate(now));
docPratica.setGroupId(serviceContext.getScopeGroupId());
docPratica.setClassName(className);
docPratica.setClassPk(classPk);
docPratica.setIntPraticaId(intPraticaId);
@ -172,32 +152,25 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
docPratica.setJsonFirmatari(jsonFirmatari);
docPratica.setDettPraticaIdRimozione(0l);
docPratica.setDtDataRimozione(null);
docPratica.setStatus(WorkflowConstants.STATUS_PENDING);
docPratica = docPraticaPersistence.update(docPratica);
return docPratica;
}
public DocPratica addDocPratica(long userId, String className, long classPk, long intPraticaId,
long fileEntryId, String fileName, String tipologia, String jsonFirmatari,
ServiceContext serviceContext) throws PortalException, SystemException {
@Override
public DocPratica addDocPratica(long userId, String className, long classPk, long intPraticaId, long fileEntryId,
String fileName, String tipologia, String jsonFirmatari, ServiceContext serviceContext)
throws PortalException, SystemException {
User user = userPersistence.findByPrimaryKey(userId);
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.setUserId(user.getUserId());
docPratica.setUserName(user.getFullName());
docPratica.setCreateDate(serviceContext.getCreateDate(now));
docPratica.setModifiedDate(serviceContext.getModifiedDate(now));
docPratica.setGroupId(serviceContext.getScopeGroupId());
docPratica.setClassName(className);
docPratica.setClassPk(classPk);
docPratica.setIntPraticaId(intPraticaId);
@ -210,29 +183,20 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
docPratica.setJsonFirmatari(jsonFirmatari);
docPratica.setDettPraticaIdRimozione(0l);
docPratica.setDtDataRimozione(null);
docPratica.setStatus(WorkflowConstants.STATUS_PENDING);
docPratica = docPraticaPersistence.update(docPratica);
return docPratica;
}
@Override
public DocPratica addDocPraticaForImport(long userId, String className, long classPk, long intPraticaId,
byte[] dlFileEntry, String fileName, String version, boolean praticaValidata, String descLong,
String tipologia, String sha256, boolean aggiornato, String jsonFirmatari,
long dettPraticaIdRimozione, Date dtDataRimozione, long oldDocPraticaId,
ServiceContext serviceContext) throws PortalException, SystemException {
String tipologia, String sha256, boolean aggiornato, String jsonFirmatari, long dettPraticaIdRimozione,
Date dtDataRimozione, long oldDocPraticaId, ServiceContext serviceContext) throws PortalException,
SystemException {
Date now = new Date();
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 docPratica = docPraticaPersistence.create(counterLocalService.increment(DocPratica.class.getName()));
docPratica.setCompanyId(serviceContext.getCompanyId());
docPratica.setUserId(userId);
if (userId > 0) {
@ -255,85 +219,72 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
docPratica.setDettPraticaIdRimozione(dettPraticaIdRimozione);
docPratica.setDtDataRimozione(dtDataRimozione);
docPratica.setOldDocPraticaId(oldDocPraticaId);
docPratica.setStatus(WorkflowConstants.STATUS_APPROVED);
return docPraticaPersistence.update(docPratica);
}
@Override
public FileEntry addAttachment(long classPk, long intPraticaId, long delegaUserId, String sourceFileName,
byte[] content, String tipoAllegato) throws SystemException, PortalException {
FileEntry fileEntry = null;
// DettPratica dettPratica =
// dettPraticaPersistence.fetchByPrimaryKey(dettPraticaId);
IntPratica intPratica = intPraticaPersistence.fetchByPrimaryKey(intPraticaId);
Territorio territorio = territorioPersistence.fetchByPrimaryKey(intPratica.getTerritorioId());
long companyId = territorio.getCompanyId();
long groupId = territorio.getGroupId();
// TODO forse è meglio ragionare con un'altra logica per i permessi
User user = UserLocalServiceUtil.getRoleUsers(
RoleLocalServiceUtil.getRole(intPratica.getCompanyId(), RoleConstants.ADMINISTRATOR)
.getRoleId()).get(0);
RoleLocalServiceUtil.getRole(intPratica.getCompanyId(), RoleConstants.ADMINISTRATOR).getRoleId())
.get(0);
try {
PermissionThreadLocal.setPermissionChecker(PermissionCheckerFactoryUtil.create(user));
} catch (Exception e) {
throw new SystemException(e);
}
long userId = user.getUserId();
ServiceContext serviceContext = new ServiceContext();
serviceContext.setCompanyId(companyId);
serviceContext.setScopeGroupId(groupId);
serviceContext.setUserId(userId);
serviceContext.setGroupPermissions(new String[] { ActionKeys.VIEW });
long defaultFolderId = configurazioneLocalService.findByC_ChiaveLong(companyId,
ConfigurazioneConstants.ATTACHMENT_FOLDER_ID);
Folder defaultFolder = dlAppLocalService.getFolder(defaultFolderId);
String folderName = PraticaUtil.getFolderName(classPk);
Folder folder = null;
try {
folder = dlAppLocalService.getFolder(defaultFolder.getRepositoryId(),
defaultFolder.getFolderId(), folderName);
folder = dlAppLocalService.getFolder(defaultFolder.getRepositoryId(), defaultFolder.getFolderId(),
folderName);
} catch (NoSuchFolderException e) {
// cartella non presente -> creo cartella
folder = dlAppLocalService.addFolder(userId, defaultFolder.getRepositoryId(),
defaultFolder.getFolderId(), folderName, StringPool.BLANK, serviceContext);
folder = dlAppLocalService.addFolder(userId, defaultFolder.getRepositoryId(), defaultFolder.getFolderId(),
folderName, StringPool.BLANK, serviceContext);
}
Date now = new Date();
String title = tipoAllegato + StringPool.UNDERLINE + sourceFileName;
String description = sourceFileName;
String mimeType = MimeTypesUtil.getContentType(sourceFileName);
String changeLog = StringPool.BLANK;
fileEntry = dlAppLocalService.addFileEntry(userId, folder.getRepositoryId(), folder.getFolderId(),
now.getTime() + "_" + sourceFileName, mimeType, title, description, changeLog, content,
serviceContext);
now.getTime() + StringPool.UNDERLINE + sourceFileName, mimeType, title, description, changeLog,
content, serviceContext);
try {
PermissionThreadLocal.setPermissionChecker(PermissionCheckerFactoryUtil
.create(UserLocalServiceUtil.getUser(delegaUserId)));
PermissionThreadLocal.setPermissionChecker(PermissionCheckerFactoryUtil.create(UserLocalServiceUtil
.getUser(delegaUserId)));
} catch (Exception e) {
throw new SystemException(e);
}
return fileEntry;
}
@Override
public FileEntry getAttachment(long classPk) throws SystemException, PortalException {
DocPratica fileAllegato = docPraticaPersistence.findByPrimaryKey(classPk);
return dlAppLocalService.getFileEntry(fileAllegato.getDlFileEntryId());
}
@Override
public void addFirma(long docPraticaId, String codiceFiscale) throws PortalException, SystemException {
DocPratica docPratica = docPraticaLocalService.getDocPratica(docPraticaId);
@ -341,6 +292,7 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
docPraticaLocalService.updateDocPratica(docPratica);
}
@Override
public void addFirmeAndApprova(long docPraticaId, List<String> codiciFiscali) throws PortalException,
SystemException {
@ -355,18 +307,19 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
docPraticaLocalService.updateDocPratica(docPratica);
}
public void addErrorAndApprova(long docPraticaId, String errorCode) throws PortalException,
SystemException {
@Override
public void addErrorAndApprova(long docPraticaId, String errorCode) throws PortalException, SystemException {
DocPratica docPratica = docPraticaLocalService.getDocPratica(docPraticaId);
docPratica.setModifiedDate(new Date());
docPratica.setErrorCode(errorCode);
if ("400".equalsIgnoreCase(errorCode)) {
if (String.valueOf(HttpURLConnection.HTTP_BAD_REQUEST).equals(errorCode)) {
docPratica.setStatus(WorkflowConstants.STATUS_DENIED);
}
docPraticaLocalService.updateDocPratica(docPratica);
}
@Override
public void removeFirma(long docPraticaId, String codiceFiscale) throws PortalException, SystemException {
DocPratica docPratica = docPraticaLocalService.getDocPratica(docPraticaId);
@ -374,17 +327,8 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
docPraticaLocalService.updateDocPratica(docPratica);
}
private void validate(long groupId, long docPraticaId, String className, long classPk, long intPraticaId,
byte[] dlFileEntry, String fileName, String version, boolean praticaValidata, String descLong,
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 {
@Override
public DocPratica updateDocPraticaAggiornato(long docPraticaId, boolean aggiornato) throws SystemException {
DocPratica docPratica = docPraticaPersistence.fetchByPrimaryKey(docPraticaId);
docPratica.setAggiornato(aggiornato);
@ -392,18 +336,22 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
return docPraticaLocalService.updateDocPratica(docPratica);
}
@Override
public int countDocPraticaDaInviareDax() throws SystemException {
DynamicQuery dynamicQuery = dynamicQueryDocPraticaDaInviareDax();
return (int) docPraticaPersistence.countWithDynamicQuery(dynamicQuery);
}
@Override
public List<DocPratica> getDocPraticaDaInviareDax(int start, int end) throws SystemException {
DynamicQuery dynamicQuery = dynamicQueryDocPraticaDaInviareDax();
return docPraticaPersistence.findWithDynamicQuery(dynamicQuery, start, end);
}
private DynamicQuery dynamicQueryDocPraticaDaInviareDax() {
DynamicQuery dynamicQuery = docPraticaLocalService.dynamicQuery();
dynamicQuery.add(PropertyFactoryUtil.forName("dtInvioDax").isNull());
dynamicQuery.add(PropertyFactoryUtil.forName("daxId").eq(0L));
@ -412,47 +360,56 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
return dynamicQuery;
}
@Override
public int countByClassPk(long classPk) throws SystemException {
return docPraticaPersistence.countByClassPk(classPk);
}
@Override
public List<DocPratica> findByClassPk(long classPk, int start, int end) throws SystemException {
return docPraticaPersistence.findByClassPk(classPk, start, end);
}
@Override
public List<DocPratica> findByIntPratica(long intPraticaId) throws SystemException {
return docPraticaPersistence.findByIntPratica(intPraticaId);
}
@Override
public List<DocPratica> findByClassPk(long classPk) throws SystemException {
return docPraticaPersistence.findByClassPk(classPk);
}
public List<DocPratica> findByStaus(int status, int start, int end, OrderByComparator order)
throws SystemException {
@Override
public List<DocPratica> findByStaus(int status, int start, int end, OrderByComparator order) throws SystemException {
return docPraticaPersistence.findByStatus(status, start, end, order);
}
@Override
public int countByStatus(long status) throws SystemException {
return docPraticaPersistence.countByStatus(status);
}
@Override
public int countByClassPk_Tipologia(long classPk, String tipologia) throws SystemException {
return docPraticaPersistence.countByClassPk_Tipologia(classPk, tipologia);
}
@Override
public List<DocPratica> findByClassPk_Tipologia(long classPk, String tipologia, int start, int end)
throws SystemException {
return docPraticaPersistence.findByClassPk_Tipologia(classPk, tipologia, start, end);
}
@Override
public List<DocPratica> findByIntPratica_Tipologia(long intPraticaId, String tipologia, int start, int end)
throws SystemException {
@ -463,8 +420,9 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
return soggettoPersistence.findWithDynamicQuery(dynamicQuery, start, end);
}
public List<DocPratica> findByIntPratica_ClassPk_Tipologia(long intPraticaId, long classPk,
String tipologia, int start, int end) throws SystemException {
@Override
public List<DocPratica> findByIntPratica_ClassPk_Tipologia(long intPraticaId, long classPk, String tipologia,
int start, int end) throws SystemException {
DynamicQuery dynamicQuery = dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId));
@ -474,8 +432,9 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
return dynamicQuery(dynamicQuery, start, end);
}
public List<DocPratica> findByIntPratica_ClassPk_Tipologie(long intPraticaId, long classPk,
List<String> tipologie) throws SystemException {
@Override
public List<DocPratica> findByIntPratica_ClassPk_Tipologie(long intPraticaId, long classPk, List<String> tipologie)
throws SystemException {
DynamicQuery dynamicQuery = dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId));
@ -485,6 +444,7 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
return dynamicQuery(dynamicQuery);
}
@Override
public List<DocPratica> findByIntPratica_ClassPkEqual_Tipologie(long intPraticaId, long classPk,
List<String> tipologie) throws SystemException {
@ -496,29 +456,31 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
return dynamicQuery(dynamicQuery);
}
public DocPratica fetchByC_Group_DlFileEntry_Version(long dlFileEntryId, String version)
throws SystemException {
@Override
public DocPratica fetchByC_Group_DlFileEntry_Version(long dlFileEntryId, String version) throws SystemException {
return docPraticaPersistence.fetchByDlFileEntry_Version(dlFileEntryId, version);
}
@Override
public DocPratica fetchByOldDocPraticaId(long oldDocPraticaId) throws SystemException {
return docPraticaPersistence.fetchByOldDocPratica(oldDocPraticaId);
}
@Override
public List<Long> findDistinctDlFileEntryId(long classPk, String tipologia, int start, int end)
throws SystemException {
return findDistinctDlFileEntryId(new long[] { classPk }, tipologia, start, end);
}
@Override
public List<Long> findDistinctDlFileEntryId(long[] classPks, String tipologia, int start, int end)
throws SystemException {
DynamicQuery dynamicQuery = docPraticaLocalService.dynamicQuery();
dynamicQuery.setProjection(ProjectionFactoryUtil.distinct(ProjectionFactoryUtil
.property("dlFileEntryId")));
dynamicQuery.setProjection(ProjectionFactoryUtil.distinct(ProjectionFactoryUtil.property("dlFileEntryId")));
dynamicQuery.add(PropertyFactoryUtil.forName("tipologia").eq(tipologia));
Junction or = RestrictionsFactoryUtil.disjunction();
for (long classPk : classPks) {
@ -529,6 +491,7 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
return docPraticaPersistence.findWithDynamicQuery(dynamicQuery, start, end);
}
@Override
public List<DocPratica> getValidByIntPratica(long intPraticaId) throws SystemException {
DynamicQuery dynamicQuery = dynamicQuery();
@ -538,8 +501,9 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
return dynamicQuery(dynamicQuery);
}
public List<DocPratica> getValidByIntPratica_Tipologia(long intPraticaId, String tipologia, int start,
int end) throws SystemException {
@Override
public List<DocPratica> getValidByIntPratica_Tipologia(long intPraticaId, String tipologia, int start, int end)
throws SystemException {
DynamicQuery dynamicQuery = dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId));
@ -549,53 +513,51 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
return dynamicQuery(dynamicQuery, start, end);
}
public int countValidTmpByIntPratica_Tipologia(long intPraticaId, String tipologia)
throws SystemException {
@Override
public int countValidTmpByIntPratica_Tipologia(long intPraticaId, String tipologia) throws SystemException {
DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica(intPraticaId);
dynamicQuery.add(RestrictionsFactoryUtil.eq("tipologia", tipologia));
return (int) docPraticaPersistence.countWithDynamicQuery(dynamicQuery);
}
public List<DocPratica> getValidTmpByIntPratica_Tipologia(long intPraticaId, String tipologia, int start,
int end) throws SystemException {
@Override
public List<DocPratica> getValidTmpByIntPratica_Tipologia(long intPraticaId, String tipologia, int start, int end)
throws SystemException {
DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica(intPraticaId);
dynamicQuery.add(RestrictionsFactoryUtil.eq("tipologia", tipologia));
dynamicQuery.addOrder(OrderFactoryUtil.asc("dettPraticaIdRimozione"));
return dynamicQuery(dynamicQuery, start, end);
}
public List<DocPratica> getValidTmpByIntPratica_DettPratica_Tipologia(long intPraticaId,
long dettPraticaId, String tipologia, int start, int end) throws SystemException {
@Override
public List<DocPratica> getValidTmpByIntPratica_DettPratica_Tipologia(long intPraticaId, long dettPraticaId,
String tipologia, int start, int end) throws SystemException {
DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica(intPraticaId);
dynamicQuery.add(RestrictionsFactoryUtil.eq("tipologia", tipologia));
dynamicQuery.add(RestrictionsFactoryUtil.eq("classPk", dettPraticaId));
dynamicQuery.add(RestrictionsFactoryUtil.eq("className", DettPratica.class.getName()));
dynamicQuery.addOrder(OrderFactoryUtil.asc("dettPraticaIdRimozione"));
return dynamicQuery(dynamicQuery, start, end);
}
public List<DocPratica> getValidTmpByIntPratica_Tipologie(long intPraticaId, String[] tipologie,
int start, int end) throws SystemException {
@Override
public List<DocPratica> getValidTmpByIntPratica_Tipologie(long intPraticaId, String[] tipologie, int start, int end)
throws SystemException {
DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica(intPraticaId);
dynamicQuery.add(RestrictionsFactoryUtil.in("tipologia", tipologie));
dynamicQuery.addOrder(OrderFactoryUtil.asc("dettPraticaIdRimozione"));
return dynamicQuery(dynamicQuery, start, end);
}
public int countValidTmpByIntPratica_Tipologie(long intPraticaId, String[] tipologie)
throws SystemException {
@Override
public int countValidTmpByIntPratica_Tipologie(long intPraticaId, String[] tipologie) throws SystemException {
DynamicQuery dynamicQuery = createvalidTmpQueryByIntPratica(intPraticaId);
dynamicQuery.add(RestrictionsFactoryUtil.in("tipologia", tipologie));
return (int) docPraticaPersistence.countWithDynamicQuery(dynamicQuery);
}
@ -604,10 +566,10 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
DynamicQuery dynamicQuery = dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId));
dynamicQuery.add(RestrictionsFactoryUtil.eq("dettPraticaIdRimozione", null));
return dynamicQuery;
}
@Override
public List<DocPratica> getInvalidByIntPratica(long intPraticaId) throws SystemException {
DynamicQuery dynamicQuery = dynamicQuery();
@ -617,6 +579,7 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
return dynamicQuery(dynamicQuery);
}
@Override
public List<DocPratica> getInvalidTmpByIntPratica(long intPraticaId) throws SystemException {
DynamicQuery dynamicQuery = dynamicQuery();
@ -626,20 +589,20 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
return dynamicQuery(dynamicQuery);
}
public List<DocPratica> getValidUntilClassPkByIntPratica(long intPraticaId, long classPk,
String tipologia, int start, int end) throws SystemException {
@Override
public List<DocPratica> getValidUntilClassPkByIntPratica(long intPraticaId, long classPk, String tipologia,
int start, int end) throws SystemException {
DynamicQuery dynamicQuery = dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId));
dynamicQuery.add(RestrictionsFactoryUtil.le("classPk", classPk));
dynamicQuery.add(RestrictionsFactoryUtil.eq("tipologia", tipologia));
// dynamicQuery.add(RestrictionsFactoryUtil.eq("dettPraticaIdRimozione",
// null));
dynamicQuery.add(RestrictionsFactoryUtil.eq("rimosso", false));
dynamicQuery.addOrder(OrderFactoryUtil.desc("classPk"));
return dynamicQuery(dynamicQuery, start, end);
}
@Override
public void completeInvalidation(long intPraticaId) throws SystemException {
Date now = new Date();
@ -652,34 +615,29 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
}
}
@Override
public List<DocPratica> getDocPraticaWithOldFileEntryId(int start, int end) throws SystemException {
DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(DocPratica.class);
dynamicQuery.add(PropertyFactoryUtil.forName("oldDlFileEntryId").ne(0L));
dynamicQuery.addOrder(OrderFactoryUtil.desc("oldDlFileEntryId"));
return docPraticaLocalService.dynamicQuery(dynamicQuery, start, end);
}
// ADT BUG FE ID = 9
public DocPratica addDocPraticaAnnullamento(long userId, String className, long classPk,
long intPraticaId, long fileEntryId, String fileName, String tipologia, String sha256,
String jsonFirmatari, ServiceContext serviceContext) throws PortalException, SystemException {
@Override
public DocPratica addDocPraticaAnnullamento(long userId, String className, long classPk, long intPraticaId,
long fileEntryId, String fileName, String tipologia, String sha256, String jsonFirmatari,
ServiceContext serviceContext) throws PortalException, SystemException {
User user = userPersistence.findByPrimaryKey(userId);
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.setUserId(user.getUserId());
docPratica.setUserName(user.getFullName());
docPratica.setCreateDate(serviceContext.getCreateDate(now));
docPratica.setModifiedDate(serviceContext.getModifiedDate(now));
docPratica.setGroupId(serviceContext.getScopeGroupId());
docPratica.setClassName(className);
docPratica.setClassPk(classPk);
docPratica.setIntPraticaId(intPraticaId);
@ -693,27 +651,15 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
docPratica.setJsonFirmatari(jsonFirmatari);
docPratica.setDettPraticaIdRimozione(0l);
docPratica.setDtDataRimozione(null);
docPratica.setStatus(WorkflowConstants.STATUS_PENDING);
docPratica = docPraticaPersistence.update(docPratica);
return docPratica;
}
/**
* Metodo nuovo ADT
*
* @param intPraticaId
* @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 {
// Metodo nuovo ADT
@Override
public List<DocPratica> findByIntPratica_ClassPk_TipologiaNew(long intPraticaId, long classPk, String tipologia,
int start, int end) throws SystemException {
DynamicQuery dynamicQuery = dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId));
@ -722,5 +668,4 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
dynamicQuery.addOrder(OrderFactoryUtil.desc("classPk"));
return dynamicQuery(dynamicQuery, start, end);
}
}

174
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.
*
* This library is free software; you can redistribute it and/or modify it under the terms of the
* GNU Lesser General Public License as published by the Free Software Foundation; either version
* 2.1 of the License, or (at your option) any later version.
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package it.tref.liferay.portos.bo.service.impl;
@ -26,13 +26,12 @@ import com.liferay.portal.service.ServiceContext;
* The implementation of the doc pratica remote service.
*
* <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.DocPraticaService} 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.DocPraticaService} interface.
*
* <p>
* This is a remote service. Methods of this service are expected to have security checks based on
* the propagated JAAS credentials because this service can be accessed remotely.
* This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS
* credentials because this service can be accessed remotely.
* </p>
*
* @author Davide Barbagallo, 3F Consulting
@ -40,103 +39,112 @@ import com.liferay.portal.service.ServiceContext;
* @see it.tref.liferay.portos.bo.service.DocPraticaServiceUtil
*/
public class DocPraticaServiceImpl extends DocPraticaServiceBaseImpl {
/*
* NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link
* it.tref.liferay.portos.bo.service.DocPraticaServiceUtil} to access the doc pratica remote
* service.
*/
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,
boolean aggiornato, String jsonFirmatari, long intPraticaIdRimozione, long dettPraticaIdRimozione,
Date dtDataRimozione, ServiceContext serviceContext) throws PortalException, SystemException {
/*
* NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link
* it.tref.liferay.portos.bo.service.DocPraticaServiceUtil} to access the doc pratica remote service.
*/
@Override
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,
boolean aggiornato, String jsonFirmatari, long intPraticaIdRimozione, long dettPraticaIdRimozione,
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,
version, praticaValidata, descLong, tipologia, sha256, aggiornato, jsonFirmatari,
dettPraticaIdRimozione, dtDataRimozione, serviceContext);
}
return docPraticaLocalService.addDocPratica(userId, className, classPk, intPraticaId, dlFileEntry, fileName,
version, praticaValidata, descLong, tipologia, sha256, aggiornato, jsonFirmatari, dettPraticaIdRimozione,
dtDataRimozione, serviceContext);
@Override
public DocPratica getDocPratica(long docPraticaId) throws PortalException, SystemException {
}
// TODO permessi
return docPraticaLocalService.getDocPratica(docPraticaId);
}
public DocPratica getDocPratica(long docPraticaId) throws PortalException, SystemException {
@Override
public int countByClassPk_Tipologia(long classPk, String tipologia) throws SystemException {
// TODO permessi
return docPraticaLocalService.getDocPratica(docPraticaId);
}
// TODO permessi
return docPraticaLocalService.countByClassPk_Tipologia(classPk, tipologia);
}
public int countByClassPk_Tipologia(long classPk, String tipologia) throws SystemException {
@Override
public List<DocPratica> findByClassPk_Tipologia(long dettPratica, String tipologia, int start, int end)
throws SystemException {
// TODO permessi
return docPraticaLocalService.countByClassPk_Tipologia(classPk, tipologia);
}
// TODO permessi
return docPraticaLocalService.findByClassPk_Tipologia(dettPratica, tipologia, start, end);
}
public List<DocPratica> findByClassPk_Tipologia(long dettPratica, String tipologia, int start, int end)
throws SystemException {
@Override
public List<DocPratica> findByIntPratica_Tipologia(long intPraticaId, String tipologia, int start, int end)
throws SystemException {
// TODO permessi
return docPraticaLocalService.findByClassPk_Tipologia(dettPratica, tipologia, start, end);
}
// TODO permessi
return docPraticaLocalService.findByIntPratica_Tipologia(intPraticaId, tipologia, start, end);
}
public List<DocPratica> findByIntPratica_Tipologia(long intPraticaId, String tipologia, int start, int end)
throws SystemException {
@Override
public List<DocPratica> findByIntPratica_ClassPk_Tipologia(long intPraticaId, long classPk, String tipologia,
int start, int end) throws SystemException {
// TODO permessi
return docPraticaLocalService.findByIntPratica_Tipologia(intPraticaId, tipologia, start, end);
}
return docPraticaLocalService.findByIntPratica_ClassPk_Tipologia(intPraticaId, classPk, tipologia, start, end);
}
public List<DocPratica> findByIntPratica_ClassPk_Tipologia(long intPraticaId, long classPk, String tipologia,
int start, int end) throws SystemException {
@Override
public DocPratica deleteDocPratica(DocPratica docPratica) throws PortalException, SystemException {
return docPraticaLocalService.findByIntPratica_ClassPk_Tipologia(intPraticaId, classPk, tipologia, start, end);
}
return docPraticaLocalService.deleteDocPratica(docPratica);
}
public DocPratica deleteDocPratica(DocPratica docPratica) throws PortalException, SystemException {
@Override
public DocPratica deleteDocPratica(long docPraticaId) throws PortalException, SystemException {
return docPraticaLocalService.deleteDocPratica(docPraticaId);
}
return docPraticaLocalService.deleteDocPratica(docPratica);
}
@Override
public List<DocPratica> getValidByIntPratica(long intPraticaId) throws SystemException {
public DocPratica deleteDocPratica(long docPraticaId) throws PortalException, SystemException {
// TODO permessi
return docPraticaLocalService.getValidByIntPratica(intPraticaId);
}
@Override
public List<DocPratica> getValidByIntPratica_Tipologia(long intPraticaId, String tipologia, int start, int end)
throws SystemException {
return docPraticaLocalService.deleteDocPratica(docPraticaId);
}
// TODO permessi
return docPraticaLocalService.getValidByIntPratica_Tipologia(intPraticaId, tipologia, start, end);
}
public List<DocPratica> getValidByIntPratica(long intPraticaId) throws SystemException {
@Override
public List<DocPratica> getValidTmpByIntPratica_Tipologia(long intPraticaId, String tipologia, int start, int end)
throws SystemException {
// TODO permessi
return docPraticaLocalService.getValidByIntPratica(intPraticaId);
}
// TODO permessi
return docPraticaLocalService.getValidTmpByIntPratica_Tipologia(intPraticaId, tipologia, start, end);
}
public List<DocPratica> getValidByIntPratica_Tipologia(long intPraticaId, String tipologia, int start, int end)
throws SystemException {
@Override
public List<DocPratica> getInvalidByIntPratica(long intPraticaId) throws SystemException {
// TODO permessi
return docPraticaLocalService.getValidByIntPratica_Tipologia(intPraticaId, tipologia, start, end);
}
// TODO permessi
return docPraticaLocalService.getInvalidByIntPratica(intPraticaId);
}
public List<DocPratica> getValidTmpByIntPratica_Tipologia(long intPraticaId, String tipologia, int start, int end)
throws SystemException {
@Override
public List<DocPratica> getInvalidTmpByIntPratica(long intPraticaId) throws SystemException {
// TODO permessi
return docPraticaLocalService.getValidTmpByIntPratica_Tipologia(intPraticaId, tipologia, start, end);
}
// TODO permessi
return docPraticaLocalService.getInvalidTmpByIntPratica(intPraticaId);
}
public List<DocPratica> getInvalidByIntPratica(long intPraticaId) throws SystemException {
@Override
public List<DocPratica> getValidUntilClassPkByIntPratica(long intPraticaId, long classPk, String tipologia,
int start, int end) throws SystemException {
// TODO permessi
return docPraticaLocalService.getInvalidByIntPratica(intPraticaId);
}
public List<DocPratica> getInvalidTmpByIntPratica(long intPraticaId) throws SystemException {
// TODO permessi
return docPraticaLocalService.getInvalidTmpByIntPratica(intPraticaId);
}
public List<DocPratica> getValidUntilClassPkByIntPratica(long intPraticaId, long classPk, String tipologia,
int start, int end) throws SystemException {
return docPraticaLocalService.getValidUntilClassPkByIntPratica(intPraticaId, classPk, tipologia, start, end);
}
return docPraticaLocalService.getValidUntilClassPkByIntPratica(intPraticaId, classPk, tipologia, start, end);
}
}

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

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

125
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.
*
* This library is free software; you can redistribute it and/or modify it under the terms of the
* GNU Lesser General Public License as published by the Free Software Foundation; either version
* 2.1 of the License, or (at your option) any later version.
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package it.tref.liferay.portos.bo.service.impl;
@ -27,13 +27,12 @@ import com.liferay.portal.service.ServiceContext;
* The implementation of the info fascicolo local service.
*
* <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.InfoFascicoloLocalService} 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.InfoFascicoloLocalService} interface.
*
* <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>
*
* @author Davide Barbagallo, 3F Consulting
@ -41,56 +40,56 @@ import com.liferay.portal.service.ServiceContext;
* @see it.tref.liferay.portos.bo.service.InfoFascicoloLocalServiceUtil
*/
public class InfoFascicoloLocalServiceImpl extends InfoFascicoloLocalServiceBaseImpl {
/*
* 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.
*/
public InfoFascicolo addInfoFascicolo(long intPraticaId, String numeroProgetto, ServiceContext serviceContext)
throws SystemException, PortalException {
return addInfoFascicolo(intPraticaId, numeroProgetto, false, serviceContext);
}
public InfoFascicolo addInfoFascicolo(long intPraticaId, String numeroProgetto, boolean alreadyImported,
ServiceContext serviceContext) throws SystemException, PortalException {
User user = userLocalService.getUser(serviceContext.getUserId());
Date now = new Date();
InfoFascicolo infoFascicolo =
infoFascicoloLocalService.createInfoFascicolo(counterLocalService.increment(InfoFascicolo.class.getName()));
infoFascicolo.setCompanyId(serviceContext.getCompanyId());
infoFascicolo.setGroupId(serviceContext.getScopeGroupId());
infoFascicolo.setUserId(serviceContext.getUserId());
infoFascicolo.setUserName(user.getScreenName());
infoFascicolo.setCreateDate(serviceContext.getCreateDate(now));
infoFascicolo.setModifiedDate(serviceContext.getModifiedDate(now));
infoFascicolo.setIntPraticaId(intPraticaId);
infoFascicolo.setNumeroProgetto(numeroProgetto);
infoFascicolo.setAlreadyImported(alreadyImported);
return infoFascicolo;
}
public InfoFascicolo findByIntPratica(long intPraticaId) throws SystemException, NoSuchInfoFascicoloException {
return infoFascicoloPersistence.findByIntPratica(intPraticaId);
}
public InfoFascicolo fetchByIntPratica(long intPraticaId) throws SystemException, NoSuchInfoFascicoloException {
return infoFascicoloPersistence.fetchByIntPratica(intPraticaId);
}
public InfoFascicolo updateAlreadyImportedField(long infoFascicoloId) throws NoSuchInfoFascicoloException,
SystemException {
InfoFascicolo infoFascicolo = infoFascicoloPersistence.findByPrimaryKey(infoFascicoloId);
infoFascicolo.setAlreadyImported(true);
return infoFascicoloLocalService.updateInfoFascicolo(infoFascicolo);
}
/*
* 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.
*/
@Override
public InfoFascicolo addInfoFascicolo(long intPraticaId, String numeroProgetto, ServiceContext serviceContext)
throws SystemException, PortalException {
return addInfoFascicolo(intPraticaId, numeroProgetto, false, serviceContext);
}
@Override
public InfoFascicolo addInfoFascicolo(long intPraticaId, String numeroProgetto, boolean alreadyImported,
ServiceContext serviceContext) throws SystemException, PortalException {
User user = userLocalService.getUser(serviceContext.getUserId());
Date now = new Date();
InfoFascicolo infoFascicolo = infoFascicoloLocalService.createInfoFascicolo(counterLocalService
.increment(InfoFascicolo.class.getName()));
infoFascicolo.setCompanyId(serviceContext.getCompanyId());
infoFascicolo.setGroupId(serviceContext.getScopeGroupId());
infoFascicolo.setUserId(serviceContext.getUserId());
infoFascicolo.setUserName(user.getScreenName());
infoFascicolo.setCreateDate(serviceContext.getCreateDate(now));
infoFascicolo.setModifiedDate(serviceContext.getModifiedDate(now));
infoFascicolo.setIntPraticaId(intPraticaId);
infoFascicolo.setNumeroProgetto(numeroProgetto);
infoFascicolo.setAlreadyImported(alreadyImported);
return infoFascicolo;
}
@Override
public InfoFascicolo findByIntPratica(long intPraticaId) throws SystemException, NoSuchInfoFascicoloException {
return infoFascicoloPersistence.findByIntPratica(intPraticaId);
}
@Override
public InfoFascicolo fetchByIntPratica(long intPraticaId) throws SystemException, NoSuchInfoFascicoloException {
return infoFascicoloPersistence.fetchByIntPratica(intPraticaId);
}
@Override
public InfoFascicolo updateAlreadyImportedField(long infoFascicoloId) throws NoSuchInfoFascicoloException,
SystemException {
InfoFascicolo infoFascicolo = infoFascicoloPersistence.findByPrimaryKey(infoFascicoloId);
infoFascicolo.setAlreadyImported(true);
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.
*
* This library is free software; you can redistribute it and/or modify it under the terms of the
* GNU Lesser General Public License as published by the Free Software Foundation; either version
* 2.1 of the License, or (at your option) any later version.
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General
* Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package it.tref.liferay.portos.bo.service.impl;
@ -51,14 +51,12 @@ import com.liferay.portlet.documentlibrary.service.DLAppLocalServiceUtil;
* The implementation of the pagamento local service.
*
* <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.PagamentoLocalService} 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.PagamentoLocalService} interface.
*
* <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>
*
* @author Davide Barbagallo, 3F Consulting
@ -67,9 +65,8 @@ import com.liferay.portlet.documentlibrary.service.DLAppLocalServiceUtil;
*/
public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl {
/*
* NOTE FOR DEVELOPERS: Never reference this interface directly. Always use
* {@link it.tref.liferay.portos.bo.service.PagamentoLocalServiceUtil} to
* access the pagamento local service.
* NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link
* it.tref.liferay.portos.bo.service.PagamentoLocalServiceUtil} to access the pagamento local service.
*/
@Override
public long createPagamentoId() throws SystemException {
@ -78,79 +75,65 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl {
}
@Override
public Pagamento addPagamento(String codice, String causale, String mezzo,
String codiceFiscaleCommittente, String tipoPagamento, String importo, String utilizzata,
long classPk, String className, long oldPagamentoId, ServiceContext serviceContext)
throws PortalException, SystemException {
public Pagamento addPagamento(String codice, String causale, String mezzo, String codiceFiscaleCommittente,
String tipoPagamento, String importo, String utilizzata, long classPk, String className,
long oldPagamentoId, ServiceContext serviceContext) throws PortalException, SystemException {
return addPagamentoAndUpdate(null, codice, causale, mezzo, codiceFiscaleCommittente, tipoPagamento,
importo, utilizzata, classPk, className, false, oldPagamentoId, StringPool.BLANK, null,
serviceContext);
return addPagamentoAndUpdate(null, codice, causale, mezzo, codiceFiscaleCommittente, tipoPagamento, importo,
utilizzata, classPk, className, false, oldPagamentoId, StringPool.BLANK, null, serviceContext);
}
@Override
public Pagamento addPagamentoAndUpdate(String codice, String causale, String mezzo,
String codiceFiscaleCommittente, String tipoPagamento, String importo, String utilizzata,
long classPk, String className, long oldPagamentoId, ServiceContext serviceContext)
throws PortalException, SystemException {
String codiceFiscaleCommittente, String tipoPagamento, String importo, String utilizzata, long classPk,
String className, long oldPagamentoId, ServiceContext serviceContext) throws PortalException,
SystemException {
return addPagamentoAndUpdate(null, codice, causale, mezzo, codiceFiscaleCommittente, tipoPagamento,
importo, utilizzata, classPk, className, true, oldPagamentoId, StringPool.BLANK, null,
serviceContext);
return addPagamentoAndUpdate(null, codice, causale, mezzo, codiceFiscaleCommittente, tipoPagamento, importo,
utilizzata, classPk, className, true, oldPagamentoId, StringPool.BLANK, null, serviceContext);
}
@Override
public Pagamento addPagamentoAndUpdate(long pagamentoId, String codice, String causale, String mezzo,
String codiceFiscaleCommittente, String tipoPagamento, String importo, String utilizzata,
long classPk, String className, long oldPagamentoId, ServiceContext serviceContext)
throws PortalException, SystemException {
String codiceFiscaleCommittente, String tipoPagamento, String importo, String utilizzata, long classPk,
String className, long oldPagamentoId, ServiceContext serviceContext) throws PortalException,
SystemException {
return addPagamentoAndUpdate(pagamentoId, codice, causale, mezzo, codiceFiscaleCommittente,
tipoPagamento, importo, utilizzata, classPk, className, true, oldPagamentoId,
StringPool.BLANK, null, serviceContext);
return addPagamentoAndUpdate(pagamentoId, codice, causale, mezzo, codiceFiscaleCommittente, tipoPagamento,
importo, utilizzata, classPk, className, true, oldPagamentoId, StringPool.BLANK, null, serviceContext);
}
@Override
public Pagamento addPagamentoAndUpdate(long pagamentoId, String codice, String causale, String mezzo,
String codiceFiscaleCommittente, String tipoImporto, String importo, String utilizzata,
long classPk, String className, long oldPagamentoId, String url,
List<ElencoIdentificativiType> iuvs, ServiceContext serviceContext) throws PortalException,
SystemException {
String codiceFiscaleCommittente, String tipoImporto, String importo, String utilizzata, long classPk,
String className, long oldPagamentoId, String url, List<ElencoIdentificativiType> iuvs,
ServiceContext serviceContext) throws PortalException, SystemException {
return addPagamentoAndUpdate(pagamentoId, codice, causale, mezzo, codiceFiscaleCommittente,
tipoImporto, importo, utilizzata, classPk, className, true, oldPagamentoId, url, iuvs,
serviceContext);
return addPagamentoAndUpdate(pagamentoId, codice, causale, mezzo, codiceFiscaleCommittente, tipoImporto,
importo, utilizzata, classPk, className, true, oldPagamentoId, url, iuvs, serviceContext);
}
private Pagamento addPagamentoAndUpdate(Long pagamentoId, String codice, String causale, String mezzo,
String codiceFiscaleCommittente, String tipoPagamento, String importo, String utilizzata,
long classPk, String className, boolean updateReference, long oldPagamentoId, String url,
List<ElencoIdentificativiType> iuvs, ServiceContext serviceContext) throws PortalException,
SystemException {
String codiceFiscaleCommittente, String tipoPagamento, String importo, String utilizzata, long classPk,
String className, boolean updateReference, long oldPagamentoId, String url,
List<ElencoIdentificativiType> iuvs, ServiceContext serviceContext) throws PortalException, SystemException {
Date now = new Date();
if (Validator.isNull(pagamentoId)) {
pagamentoId = createPagamentoId();
}
Pagamento pagamento = createPagamento(pagamentoId);
pagamento.setCompanyId(serviceContext.getCompanyId());
pagamento.setUserId(serviceContext.getUserId());
if (serviceContext.getUserId() > 0) {
User user = userPersistence.findByPrimaryKey(serviceContext.getUserId());
pagamento.setUserName(user.getFullName());
}
pagamento.setGroupId(serviceContext.getScopeGroupId());
pagamento.setCreateDate(serviceContext.getCreateDate(now));
pagamento.setModifiedDate(serviceContext.getModifiedDate(now));
pagamento.setClassPk(classPk);
pagamento.setClassName(className);
pagamento.setTipoPagamento(tipoPagamento);
pagamento.setUrl(url);
pagamento.setCodice(codice);
@ -170,8 +153,7 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl {
codiceBolli = StringUtil.replaceLast(codiceBolli, StringPool.PIPE, StringPool.BLANK);
pagamento.setCodice(codiceBolli);
}
long intPraticaId = 0l;
long intPraticaId = 0L;
if (DettPratica.class.getName().equals(className)) {
DettPratica dettPratica = dettPraticaPersistence.findByPrimaryKey(classPk);
intPraticaId = dettPratica.getIntPraticaId();
@ -188,10 +170,7 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl {
dettPratica.setCodicePagamentoBolli(pagamento.getCodice());
dettPratica.setCausalePagamentoBolli(pagamento.getCausale());
dettPratica.setMezzoPagamentoBolli(mezzo);
default:
break;
}
dettPratica = dettPraticaLocalService.updateDettPratica(dettPratica);
}
} else if (FineLavori.class.getName().equals(className)) {
@ -206,10 +185,7 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl {
fineLavori.setCodicePagamento(pagamento.getCodice());
fineLavori.setCausalePagamento(pagamento.getCausale());
fineLavori.setMezzoPagamento(mezzo);
default:
break;
}
fineLavori = fineLavoriLocalService.updateFineLavori(fineLavori);
}
} else if (Collaudo.class.getName().equals(className)) {
@ -224,27 +200,19 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl {
collaudo.setCodicePagamento(pagamento.getCodice());
collaudo.setCausalePagamento(pagamento.getCausale());
collaudo.setMezzoPagamento(mezzo);
default:
break;
}
collaudo = collaudoLocalService.updateCollaudo(collaudo);
}
} else {
throw new PortalException("unable to update pagamento for entity type " + className + " with id "
+ classPk);
throw new PortalException("unable to update pagamento for entity type " + className + " with id " + classPk);
}
pagamento.setIntPraticaId(intPraticaId);
pagamento = addPagamento(pagamento);
return pagamento;
}
@Override
public Pagamento updatePagamento(long pagamentoId, String importo) throws PortalException,
SystemException {
public Pagamento updatePagamento(long pagamentoId, String importo) throws PortalException, SystemException {
Pagamento pagamento = pagamentoPersistence.findByPrimaryKey(pagamentoId);
pagamento.setImporto(importo);
@ -275,16 +243,15 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl {
Pagamento pagamento = pagamentoPersistence.findByPrimaryKey(pagamentoId);
pagamento.setUtilizzata(PagamentoConstants.UTILIZZATA_ANNULLATO);
return updatePagamento(pagamento);
}
@Override
public List<Pagamento> findByCommittente_Mezzo(String codiceFiscaleCommittente, String mezzo, int start,
int end) throws SystemException {
public List<Pagamento> findByCommittente_Mezzo(String codiceFiscaleCommittente, String mezzo, int start, int end)
throws SystemException {
DynamicQuery dynamicQuery = dynamicQueryFindByCommittente_Mezzo_Utilizzata(codiceFiscaleCommittente,
mezzo, null);
DynamicQuery dynamicQuery = dynamicQueryFindByCommittente_Mezzo_Utilizzata(codiceFiscaleCommittente, mezzo,
null);
return pagamentoPersistence.findWithDynamicQuery(dynamicQuery, start, end,
OrderByComparatorFactoryUtil.create(PagamentoModelImpl.TABLE_NAME, "createDate", true));
}
@ -292,8 +259,8 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl {
@Override
public int countByCommittente_Mezzo(String codiceFiscaleCommittente, String mezzo) throws SystemException {
DynamicQuery dynamicQuery = dynamicQueryFindByCommittente_Mezzo_Utilizzata(codiceFiscaleCommittente,
mezzo, null);
DynamicQuery dynamicQuery = dynamicQueryFindByCommittente_Mezzo_Utilizzata(codiceFiscaleCommittente, mezzo,
null);
return (int) pagamentoPersistence.countWithDynamicQuery(dynamicQuery);
}
@ -301,18 +268,18 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl {
public List<Pagamento> findByCommittente_Mezzo_Utilizzata(String codiceFiscaleCommittente, String mezzo,
String utilizzata, int start, int end) throws SystemException {
DynamicQuery dynamicQuery = dynamicQueryFindByCommittente_Mezzo_Utilizzata(codiceFiscaleCommittente,
mezzo, utilizzata);
DynamicQuery dynamicQuery = dynamicQueryFindByCommittente_Mezzo_Utilizzata(codiceFiscaleCommittente, mezzo,
utilizzata);
return pagamentoPersistence.findWithDynamicQuery(dynamicQuery, start, end,
OrderByComparatorFactoryUtil.create(PagamentoModelImpl.TABLE_NAME, "createDate", true));
}
@Override
public int countByCommittente_Mezzo_Utilizzata(String codiceFiscaleCommittente, String mezzo,
String utilizzata) throws SystemException {
public int countByCommittente_Mezzo_Utilizzata(String codiceFiscaleCommittente, String mezzo, String utilizzata)
throws SystemException {
DynamicQuery dynamicQuery = dynamicQueryFindByCommittente_Mezzo_Utilizzata(codiceFiscaleCommittente,
mezzo, utilizzata);
DynamicQuery dynamicQuery = dynamicQueryFindByCommittente_Mezzo_Utilizzata(codiceFiscaleCommittente, mezzo,
utilizzata);
return (int) pagamentoPersistence.countWithDynamicQuery(dynamicQuery);
}
@ -337,27 +304,27 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl {
}
@Override
public List<Pagamento> findByMezzo_Utilizzata_CreateDate(String mezzo, String utilizzata, Date date,
int start, int end) throws SystemException {
public List<Pagamento> findByMezzo_Utilizzata_CreateDate(String mezzo, String utilizzata, Date date, int start,
int end) throws SystemException {
return pagamentoPersistence.findByMezzo_Utilizzata_CreateDate(mezzo, utilizzata, date, start, end,
OrderByComparatorFactoryUtil.create(PagamentoModelImpl.TABLE_NAME, "createDate", true));
}
@Override
public int countByMezzo_Utilizzata_EmailPending_CreateDate(String mezzo, String utilizzata,
boolean emailPending, Date date) throws SystemException {
public int countByMezzo_Utilizzata_EmailPending_CreateDate(String mezzo, String utilizzata, boolean emailPending,
Date date) throws SystemException {
return pagamentoPersistence.countByMezzo_Utilizzata_EmailPending_CreateDate(mezzo, utilizzata,
emailPending, date);
return pagamentoPersistence.countByMezzo_Utilizzata_EmailPending_CreateDate(mezzo, utilizzata, emailPending,
date);
}
@Override
public List<Pagamento> findByMezzo_Utilizzata_EmailPending_CreateDate(String mezzo, String utilizzata,
boolean emailPending, Date date, int start, int end) throws SystemException {
return pagamentoPersistence.findByMezzo_Utilizzata_EmailPending_CreateDate(mezzo, utilizzata,
emailPending, date, start, end,
return pagamentoPersistence.findByMezzo_Utilizzata_EmailPending_CreateDate(mezzo, utilizzata, emailPending,
date, start, end,
OrderByComparatorFactoryUtil.create(PagamentoModelImpl.TABLE_NAME, "createDate", true));
}
@ -385,8 +352,7 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl {
}
@Override
public int countByMezzo_Utilizzata_CreateDate(String mezzo, String utilizzata, Date date)
throws SystemException {
public int countByMezzo_Utilizzata_CreateDate(String mezzo, String utilizzata, Date date) throws SystemException {
return pagamentoPersistence.countByMezzo_Utilizzata_CreateDate(mezzo, utilizzata, date);
}
@ -412,8 +378,8 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl {
}
@Override
public Pagamento updateEmailPendingPagamento(long pagamentoId, boolean emailPending)
throws PortalException, SystemException {
public Pagamento updateEmailPendingPagamento(long pagamentoId, boolean emailPending) throws PortalException,
SystemException {
Pagamento pagamento = pagamentoLocalService.getPagamento(pagamentoId);
pagamento.setModifiedDate(new Date());
@ -423,8 +389,7 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl {
private void deleteDettPraticaPagamento(Pagamento pagamento) throws SystemException {
List<DettPratica> dettPraticas = dettPraticaLocalService
.findByPagamentoId(pagamento.getPagamentoId());
List<DettPratica> dettPraticas = dettPraticaLocalService.findByPagamentoId(pagamento.getPagamentoId());
for (DettPratica dettPratica : dettPraticas) {
if (PagamentoConstants.PAGAMENTO_ONERI.equals(pagamento.getTipoPagamento())) {
dettPratica.setPagamentoIdOneri(0L);
@ -435,8 +400,8 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl {
}
}
private DynamicQuery dynamicQueryFindByCommittente_Mezzo_Utilizzata(String codiceFiscaleCommittente,
String mezzo, String utilizzata) {
private DynamicQuery dynamicQueryFindByCommittente_Mezzo_Utilizzata(String codiceFiscaleCommittente, String mezzo,
String utilizzata) {
DynamicQuery dynamicQuery = pagamentoLocalService.dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.ilike("codiceFiscaleCommittente", codiceFiscaleCommittente));
@ -467,17 +432,20 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl {
@Override
public int countByIntPratica(long intPraticaId) throws SystemException {
return pagamentoPersistence.countByIntPratica(intPraticaId);
}
@Override
public List<Pagamento> findByIntPratica_Visible(long intPraticaId) throws SystemException {
DynamicQuery dynamicQuery = createPagamentiVisibleByIntPratica(intPraticaId);
return pagamentoPersistence.findWithDynamicQuery(dynamicQuery);
}
@Override
public int countByIntPratica_Visible(long intPraticaId) throws SystemException {
DynamicQuery dynamicQuery = createPagamentiVisibleByIntPratica(intPraticaId);
return (int) pagamentoPersistence.countWithDynamicQuery(dynamicQuery);
}
@ -485,59 +453,52 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl {
private DynamicQuery createPagamentiVisibleByIntPratica(long intPraticaId) {
DynamicQuery dynamicQuery = pagamentoLocalService.dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.eq("intPraticaId", intPraticaId));
dynamicQuery.add(RestrictionsFactoryUtil.ne("utilizzata", PagamentoConstants.UTILIZZATA_IN_CORSO));
return dynamicQuery;
}
@Override
public void sostituisciPagamento(long pagamentoId, String codiceFiscaleCommittente, String mezzo,
String url, ServiceContext serviceContext) throws PortalException, SystemException {
public void sostituisciPagamento(long pagamentoId, String codiceFiscaleCommittente, String mezzo, String url,
ServiceContext serviceContext) throws PortalException, SystemException {
Pagamento pagamento = pagamentoLocalService.getPagamento(pagamentoId);
long intPraticaId = pagamento.getIntPraticaId();
String currentUtilizzata = pagamento.getUtilizzata();
String currentMezzo = pagamento.getMezzo();
String tipoPagamento = pagamento.getTipoPagamento();
boolean irisEnable = PagamentiCommonUtil.irisIsEnable(pagamento.getCompanyId());
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)
|| currentUtilizzata.equalsIgnoreCase(PagamentoConstants.UTILIZZATA_ANNULLATO)) {
if (DettPratica.class.getName().equals(pagamento.getClassName())) {
DettPratica dettPratica = dettPraticaLocalService.getDettPratica(pagamento.getClassPk());
if (PagamentoConstants.PAGAMENTO_ONERI.equals(tipoPagamento)) {
dettPratica.setPagamentoIdOneri(0l);
dettPratica.setPagamentoIdOneri(0L);
} else {
dettPratica.setPagamentoIdBolli(0l);
dettPratica.setPagamentoIdBolli(0L);
}
dettPratica = dettPraticaLocalService.updateDettPratica(dettPratica);
} else if (FineLavori.class.getName().equals(pagamento.getClassName())) {
FineLavori fineLavori = fineLavoriLocalService.getFineLavori(pagamento.getClassPk());
fineLavori.setPagamentoId(0l);
fineLavori.setPagamentoId(0L);
fineLavori = fineLavoriLocalService.updateFineLavori(fineLavori);
} else if (Collaudo.class.getName().equals(pagamento.getClassName())) {
Collaudo collaudo = collaudoLocalService.getCollaudo(pagamento.getClassPk());
collaudo.setPagamentoId(0l);
collaudo.setPagamentoId(0L);
collaudo = collaudoLocalService.updateCollaudo(collaudo);
} else {
throw new RuntimeException("unable to replace pagamento for entity type "
+ pagamento.getClassName() + " with id " + pagamento.getClassPk());
}
pagamento.setUtilizzata(PagamentoConstants.UTILIZZATA_SOSTITUITA);
pagamento.setUtilizzataSostituita(currentUtilizzata);
pagamentoLocalService.updatePagamento(pagamento);
PagamentiUtil.nuovoPagamento(url, pagamento.getClassPk(), pagamento.getClassName(),
tipoPagamento, pagamento.getImporto(), codiceFiscaleCommittente, serviceContext);
PagamentiUtil.nuovoPagamento(url, pagamento.getClassPk(), pagamento.getClassName(), tipoPagamento,
pagamento.getImporto(), codiceFiscaleCommittente, serviceContext);
} else {
throw new PortalException("Creazione pagamento manuale con stato " + currentUtilizzata
+ " non possibile");
@ -548,43 +509,37 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl {
.equalsIgnoreCase(PagamentoConstants.UTILIZZATA_NON_PAGABILE)
|| currentUtilizzata.equalsIgnoreCase(PagamentoConstants.UTILIZZATA_RIFIUTATA) || currentUtilizzata
.equalsIgnoreCase(PagamentoConstants.UTILIZZATA_ANNULLATO)))) {
if (DettPratica.class.getName().equals(pagamento.getClassName())) {
DettPratica dettPratica = dettPraticaLocalService.getDettPratica(pagamento.getClassPk());
if (PagamentoConstants.PAGAMENTO_ONERI.equals(tipoPagamento)) {
dettPratica.setPagamentoIdOneri(0l);
dettPratica.setPagamentoIdOneri(0L);
} else {
dettPratica.setPagamentoIdBolli(0l);
dettPratica.setPagamentoIdBolli(0L);
}
dettPratica = dettPraticaLocalService.updateDettPratica(dettPratica);
} else if (FineLavori.class.getName().equals(pagamento.getClassName())) {
FineLavori fineLavori = fineLavoriLocalService.getFineLavori(pagamento.getClassPk());
fineLavori.setPagamentoId(0l);
fineLavori.setPagamentoId(0L);
fineLavori = fineLavoriLocalService.updateFineLavori(fineLavori);
} else if (Collaudo.class.getName().equals(pagamento.getClassName())) {
Collaudo collaudo = collaudoLocalService.getCollaudo(pagamento.getClassPk());
collaudo.setPagamentoId(0l);
collaudo.setPagamentoId(0L);
collaudo = collaudoLocalService.updateCollaudo(collaudo);
} else {
throw new RuntimeException("unable to replace pagamento for entity type "
+ pagamento.getClassName() + " with id " + pagamento.getClassPk());
}
pagamento.setUtilizzata(PagamentoConstants.UTILIZZATA_SOSTITUITA);
pagamento.setUtilizzataSostituita(currentUtilizzata);
pagamentoLocalService.updatePagamento(pagamento);
PagamentiUtil.nuovoPagamento(url, pagamento.getClassPk(), pagamento.getClassName(),
pagamento.getTipoPagamento(), pagamento.getImporto(), codiceFiscaleCommittente,
serviceContext);
pagamento.getTipoPagamento(), pagamento.getImporto(), codiceFiscaleCommittente, serviceContext);
} else {
throw new PortalException("Pagamento IRIS non sostituibile per intPratica " + intPraticaId);
}
} else {
throw new PortalException("Mezzo non presente");
}
}
@Override
@ -592,49 +547,38 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl {
ServiceContext serviceContext) throws IOException, PortalException, SystemException {
Pagamento pagamento = pagamentoLocalService.getPagamento(pagamentoId);
// if (dettPratica.getPagamentoId() != pagamentoId) {
// throw new PortalException("Pagamento non abbinato al dettpratica");
// }
if (pagamento.getMezzo().equalsIgnoreCase(PagamentoConstants.MEZZO_MANUALE)
&& pagamento.getUtilizzata().equalsIgnoreCase(PagamentoConstants.UTILIZZATA_IN_CORSO)) {
long fileEntryId = 0l;
long defaultFolderId = configurazioneLocalService.findByC_ChiaveLong(
serviceContext.getCompanyId(), ConfigurazioneConstants.ATTACHMENT_FOLDER_ID);
long fileEntryId = 0L;
long defaultFolderId = configurazioneLocalService.findByC_ChiaveLong(serviceContext.getCompanyId(),
ConfigurazioneConstants.ATTACHMENT_FOLDER_ID);
Folder defaultFolder = dlAppLocalService.getFolder(defaultFolderId);
String folderName = PraticaUtil.getFolderName(pagamento.getClassPk());
serviceContext.setGroupPermissions(new String[] { ActionKeys.VIEW });
Folder folder = null;
try {
folder = dlAppLocalService.getFolder(defaultFolder.getRepositoryId(),
defaultFolder.getFolderId(), folderName);
folder = dlAppLocalService.getFolder(defaultFolder.getRepositoryId(), defaultFolder.getFolderId(),
folderName);
} catch (NoSuchFolderException e) {
// cartella non presente -> creo cartella
folder = dlAppLocalService.addFolder(serviceContext.getUserId(),
defaultFolder.getRepositoryId(), defaultFolder.getFolderId(), folderName,
StringPool.BLANK, serviceContext);
folder = dlAppLocalService.addFolder(serviceContext.getUserId(), defaultFolder.getRepositoryId(),
defaultFolder.getFolderId(), folderName, StringPool.BLANK, serviceContext);
}
Date now = new Date();
String title = now.getTime() + StringPool.UNDERLINE + "pagamento_manuale" + StringPool.UNDERLINE
+ pagamento.getPagamentoId() + StringPool.UNDERLINE + sourceFileName;
String description = "";
String description = StringPool.BLANK;
String mimeType = MimeTypesUtil.getContentType(sourceFileName);
String changeLog = StringPool.BLANK;
FileEntry fileEntry = dlAppLocalService.addFileEntry(serviceContext.getUserId(),
folder.getRepositoryId(), folder.getFolderId(), now.getTime() + "_" + sourceFileName,
mimeType, title, description, changeLog, content, serviceContext);
FileEntry fileEntry = dlAppLocalService.addFileEntry(serviceContext.getUserId(), folder.getRepositoryId(),
folder.getFolderId(), now.getTime() + StringPool.UNDERLINE + sourceFileName, mimeType, title,
description, changeLog, content, serviceContext);
fileEntryId = fileEntry.getFileEntryId();
pagamento.setFileEntryId(fileEntryId);
pagamento = pagamentoLocalService.updatePagamento(pagamento);
if (DettPratica.class.getName().equals(pagamento.getClassName())) {
dettPraticaLocalService.updateEsitoPagamento(pagamentoId, pagamento.getClassPk(),
fileEntryId, PagamentoConstants.UTILIZZATA_PAGATA);
dettPraticaLocalService.updateEsitoPagamento(pagamentoId, pagamento.getClassPk(), fileEntryId,
PagamentoConstants.UTILIZZATA_PAGATA);
} else if (FineLavori.class.getName().equals(pagamento.getClassName())) {
fineLavoriLocalService.updateEsitoPagamento(pagamentoId, pagamento.getClassPk(), fileEntryId,
PagamentoConstants.UTILIZZATA_PAGATA);
@ -645,7 +589,6 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl {
throw new RuntimeException("unable to update pagamento manuale for entity type "
+ pagamento.getClassName() + " with id " + pagamento.getClassPk());
}
} else {
throw new SystemException("pagamento manuale non aggiornabile");
}
@ -656,43 +599,34 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl {
ServiceContext serviceContext) throws PortalException, SystemException {
Pagamento pagamento = pagamentoLocalService.getPagamento(pagamentoId);
if (pagamento.getMezzo().equalsIgnoreCase(PagamentoConstants.MEZZO_MANUALE)) {
long fileEntryId = 0l;
long defaultFolderId = configurazioneLocalService.findByC_ChiaveLong(
serviceContext.getCompanyId(), ConfigurazioneConstants.ATTACHMENT_FOLDER_ID);
long fileEntryId = 0L;
long defaultFolderId = configurazioneLocalService.findByC_ChiaveLong(serviceContext.getCompanyId(),
ConfigurazioneConstants.ATTACHMENT_FOLDER_ID);
Folder defaultFolder = dlAppLocalService.getFolder(defaultFolderId);
String folderName = PraticaUtil.getFolderName(pagamento.getClassPk());
serviceContext.setGroupPermissions(new String[] { ActionKeys.VIEW });
Folder folder = null;
try {
folder = dlAppLocalService.getFolder(defaultFolder.getRepositoryId(),
defaultFolder.getFolderId(), folderName);
folder = dlAppLocalService.getFolder(defaultFolder.getRepositoryId(), defaultFolder.getFolderId(),
folderName);
} catch (NoSuchFolderException e) {
// cartella non presente -> creo cartella
folder = dlAppLocalService.addFolder(serviceContext.getUserId(),
defaultFolder.getRepositoryId(), defaultFolder.getFolderId(), folderName,
StringPool.BLANK, serviceContext);
folder = dlAppLocalService.addFolder(serviceContext.getUserId(), defaultFolder.getRepositoryId(),
defaultFolder.getFolderId(), folderName, StringPool.BLANK, serviceContext);
}
Date now = new Date();
String title = now.getTime() + StringPool.UNDERLINE + "pagamento_manuale" + StringPool.UNDERLINE
+ pagamento.getPagamentoId() + StringPool.UNDERLINE + sourceFileName;
String description = "";
String description = StringPool.BLANK;
String mimeType = MimeTypesUtil.getContentType(sourceFileName);
String changeLog = StringPool.BLANK;
FileEntry fileEntry = dlAppLocalService.addFileEntry(serviceContext.getUserId(),
folder.getRepositoryId(), folder.getFolderId(), now.getTime() + "_" + sourceFileName,
mimeType, title, description, changeLog, content, serviceContext);
FileEntry fileEntry = dlAppLocalService.addFileEntry(serviceContext.getUserId(), folder.getRepositoryId(),
folder.getFolderId(), now.getTime() + StringPool.UNDERLINE + sourceFileName, mimeType, title,
description, changeLog, content, serviceContext);
fileEntryId = fileEntry.getFileEntryId();
pagamento.setFileEntryId(fileEntryId);
pagamento = pagamentoLocalService.updatePagamento(pagamento);
} else {
throw new SystemException("pagamento manuale non aggiornabile");
}
@ -706,6 +640,7 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl {
@Override
public Pagamento updateOtf(long pagamentoId, boolean otf) throws PortalException, SystemException {
Pagamento pagamento = pagamentoLocalService.getPagamento(pagamentoId);
pagamento.setOtf(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;
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[] AMMINISTRAZIONE_CSV_HEADERS_COMUNI = { "Codice Regione",
"Codice Città Metropolitana", "Codice Provincia (1)", "Progressivo del Comune (2)",
"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",
"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" };
public static final String[] AMMINISTRAZIONE_CSV_HEADERS_PROVINCE = { "codice_provincia", "provincia",
"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;
ContentType(String contentType) {
this.contentType = contentType;
}
public String getContentType() {
return contentType;
}
@ -22,9 +24,6 @@ public enum ContentType {
return value;
}
}
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,
boolean maximized) {
return getDettPraticaURL(plid, resourcePrimKey, status, portalURL, maximized, null);
}
@ -29,63 +30,46 @@ public class GenioCivileBaseUtil {
boolean maximized, String redirect) {
StringBundler sb = new StringBundler(11);
sb.append(portalURL);
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);
sb.append(portalURL).append(PortalUtil.getPathMain()).append("/portal/dettaglio_pratica/find_entry?p_l_id=")
.append(String.valueOf(plid)).append(StringPool.AMPERSAND);
// control panel
if (Validator.isNotNull(redirect)) {
sb.append("doAsGroupId");
sb.append(StringPool.EQUAL);
sb.append(HttpUtil.getParameter(redirect, "doAsGroupId", false));
sb.append(StringPool.AMPERSAND);
sb.append("doAsGroupId=").append(HttpUtil.getParameter(redirect, "doAsGroupId", false))
.append(StringPool.AMPERSAND);
}
sb.append("resourcePrimKey");
sb.append(StringPool.EQUAL);
sb.append(String.valueOf(resourcePrimKey));
sb.append("resourcePrimKey=").append(String.valueOf(resourcePrimKey));
String url = sb.toString();
if (status != WorkflowConstants.STATUS_APPROVED) {
url = HttpUtil.addParameter(url, "status", String.valueOf(status));
}
if (maximized) {
url = HttpUtil.addParameter(url, "maximized", String.valueOf(maximized));
}
if (Validator.isNotNull(redirect)) {
url = HttpUtil.addParameter(url, "redirect", redirect);
}
return url;
}
public static String getDettPraticaURL(HttpServletRequest request, long plid, long resourcePrimKey,
int status) throws PortletModeException, WindowStateException {
public static String getDettPraticaURL(HttpServletRequest request, long plid, long resourcePrimKey, int status)
throws PortletModeException, WindowStateException {
return getDettPraticaURL(request, plid, resourcePrimKey, status, null);
}
public static String getDettPraticaURL(HttpServletRequest request, long plid, long resourcePrimKey,
int status, String redirect) throws PortletModeException, WindowStateException {
public static String getDettPraticaURL(HttpServletRequest request, long plid, long resourcePrimKey, int status,
String redirect) throws PortletModeException, WindowStateException {
PortletURL url = PortletURLFactoryUtil.create(request, PortletKeys.FASCICOLO, plid,
PortletRequest.RENDER_PHASE);
PortletURL url = PortletURLFactoryUtil
.create(request, PortletKeys.FASCICOLO, plid, PortletRequest.RENDER_PHASE);
url.setParameter("mvcPath", "/html/pratichegeniocivile/view.jsp");
url.setParameter("resourcePrimKey", String.valueOf(resourcePrimKey));
url.setParameter("redirect", redirect);
url.setPortletMode(PortletMode.VIEW);
url.setWindowState(LiferayWindowState.POP_UP);
if (status != WorkflowConstants.STATUS_APPROVED) {
url.setParameter("status", String.valueOf(status));
}
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,
SystemException {
return UserGroupRoleLocalServiceUtil.hasUserGroupRole(userId, groupId, Constants.ROLE_NAME_FIRMA,
true);
}
public static boolean hasFirmaPermisionDirigente(long userId, long groupId) throws PortalException,
SystemException {
return UserGroupRoleLocalServiceUtil.hasUserGroupRole(userId, groupId,
Constants.ROLE_NAME_FIRMA_DIRIGENTE, true);
}
public static boolean userCanSignAvviso(long userId, long groupId, long avvisoId) throws PortalException,
SystemException {
Avviso avviso = AvvisoLocalServiceUtil.getAvviso(avvisoId);
boolean firma = hasFirmaPermision(userId, groupId);
boolean firmaDirigente = hasFirmaPermisionDirigente(userId, groupId);
return firmaDirigente || (firma && tipoDocumentoFirmaBase.contains(avviso.getTipoDocumento()));
}
@ -53,7 +55,6 @@ public class GestioneFirmeUtil {
Role role = RoleLocalServiceUtil.getRole(companyId, Constants.ROLE_NAME_FIRMA_DIRIGENTE);
String codiceFiscaleFirma = StringPool.BLANK;
if (tipoDocumentoFirmaBase.contains(tipoDocumento)) {
role = RoleLocalServiceUtil.getRole(companyId, Constants.ROLE_NAME_FIRMA_PO);
} else {
@ -61,7 +62,6 @@ public class GestioneFirmeUtil {
}
List<UserGroupRole> UserGroupRoles = UserGroupRoleLocalServiceUtil.getUserGroupRolesByGroupAndRole(
groupId, role.getRoleId());
if (UserGroupRoles.size() == 1) {
User user = UserLocalServiceUtil.getUser(UserGroupRoles.get(0).getUserId());
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 MockAllegato(boolean checked, String status, String name, String tipo, String invalidato) {
super();
this.checked = checked;
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);
public static void verificaPagamentoIRIS(Pagamento pagamento) throws IOException, SystemException,
PortalException {
public static void verificaPagamentoIRIS(Pagamento pagamento) throws IOException, SystemException, PortalException {
String statoPagamento = callVerificaPagamenti(pagamento);
if (Validator.isNotNull(statoPagamento)) {
if (DettPratica.class.getName().equals(pagamento.getClassName())) {
DettPraticaLocalServiceUtil.updateEsitoPagamento(pagamento.getPagamentoId(),
pagamento.getClassPk(), statoPagamento);
DettPraticaLocalServiceUtil.updateEsitoPagamento(pagamento.getPagamentoId(), pagamento.getClassPk(),
statoPagamento);
} else if (FineLavori.class.getName().equals(pagamento.getClassName())) {
FineLavoriLocalServiceUtil.updateEsitoPagamento(pagamento.getPagamentoId(),
pagamento.getClassPk(), statoPagamento);
FineLavoriLocalServiceUtil.updateEsitoPagamento(pagamento.getPagamentoId(), pagamento.getClassPk(),
statoPagamento);
} else if (Collaudo.class.getName().equals(pagamento.getClassName())) {
CollaudoLocalServiceUtil.updateEsitoPagamento(pagamento.getPagamentoId(),
pagamento.getClassPk(), statoPagamento);
CollaudoLocalServiceUtil.updateEsitoPagamento(pagamento.getPagamentoId(), pagamento.getClassPk(),
statoPagamento);
} else {
throw new RuntimeException("unable to update pagamento esito for entity type "
+ pagamento.getClassName() + " with id " + pagamento.getClassPk());
}
}
}
private static String callVerificaPagamenti(Pagamento pagamento) throws SystemException {
long companyId = pagamento.getCompanyId();
long groupId = pagamento.getGroupId();
if (PagamentoConstants.PAGAMENTO_ONERI.equals(pagamento.getTipoPagamento())) {
InformazioniPagamentoType[] statoPagamentiType = IrisVerificaPagamenti.verificaPagamenti(
companyId, groupId, pagamento.getCodice(), pagamento.getTipoPagamento());
InformazioniPagamentoType[] statoPagamentiType = IrisVerificaPagamenti.verificaPagamenti(companyId,
groupId, pagamento.getCodice(), pagamento.getTipoPagamento());
return checkStatoPagamento(statoPagamentiType);
} else if (PagamentoConstants.PAGAMENTO_BOLLI.equals(pagamento.getTipoPagamento())) {
List<IUV> iuvs = IUVLocalServiceUtil.findByPagamento(pagamento.getPagamentoId());
List<String> statiPagamento = new ArrayList<String>();
for (IUV iuv : iuvs) {
InformazioniPagamentoType[] statoPagamentiType = IrisVerificaPagamenti.verificaPagamenti(
companyId, groupId, iuv.getCodice(), pagamento.getTipoPagamento());
InformazioniPagamentoType[] statoPagamentiType = IrisVerificaPagamenti.verificaPagamenti(companyId,
groupId, iuv.getCodice(), pagamento.getTipoPagamento());
GenericUtils.addIfnotExist(statiPagamento, checkStatoPagamento(statoPagamentiType));
}
if (statiPagamento.size() > 1) {
// return
// VerificaStatoPagamentoDettagliato._POSIZIONE_CON_PAG_IN_CORSO;
return StringPool.BLANK;
}
return statiPagamento.get(0);
}
throw new SystemException("error.geniocivile.tipopagamento.notexist");
}
private static String checkStatoPagamento(InformazioniPagamentoType[] statoPagamentiType) {
@ -108,10 +98,8 @@ public abstract class PagamentiUtil {
if (statoPagamentiType == null) {
return null;
}
InformazioniPagamentoType statoPagamentoType = statoPagamentiType[0];
String statoPendenza = statoPagamentoType.getStato().getValue();
String statoPagamento = StringPool.BLANK;
if (statoPendenza.equals(VerificaStatoPagamentoDettagliato._POSIZIONE_NON_PAGATA)) {
if (statoPagamentoType.getDescrizioneStato().equalsIgnoreCase(
@ -127,26 +115,17 @@ public abstract class PagamentiUtil {
} else if (statoPendenza.equals(VerificaStatoPagamentoDettagliato._POSIZIONE_NON_PAGABILE)) {
// "Posizione non pagabile" -> esito negativo
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);
} else if (statoPendenza.equals(VerificaStatoPagamentoDettagliato._POSIZIONE_PAGATA)
|| statoPendenza.equals(VerificaStatoPagamentoDettagliato._POSIZIONE_PAGATA_SBF)) {
// "Pagamento eseguito" -> esito positivo
statoPagamento = PagamentoConstants.UTILIZZATA_PAGATA;
_log.debug(statoPagamento);
} else if (statoPendenza
.equalsIgnoreCase(VerificaStatoPagamentoDettagliato._POSIZIONE_CON_PAG_IN_CORSO)) {
} else if (statoPendenza.equalsIgnoreCase(VerificaStatoPagamentoDettagliato._POSIZIONE_CON_PAG_IN_CORSO)) {
// "Pagamento non eseguito" -> esito in corso
statoPagamento = PagamentoConstants.UTILIZZATA_IN_CORSO;
return StringPool.BLANK;
}
return statoPagamento;
}
@ -169,18 +148,16 @@ public abstract class PagamentiUtil {
return pagamento.getCreateDate().compareTo(getScadenzaPending()) < 0;
}
public static Pagamento nuovoPagamento(String currentURL, long classPk, String className,
String tipoPagamento, String importo, String codiceFiscaleCommittente,
ServiceContext serviceContext) throws PortalException, SystemException {
public static Pagamento nuovoPagamento(String currentURL, long classPk, String className, String tipoPagamento,
String importo, String codiceFiscaleCommittente, ServiceContext serviceContext) throws PortalException,
SystemException {
boolean irisDisabled = !PagamentiCommonUtil.irisIsEnable(serviceContext.getCompanyId());
boolean esenzioneBolli = false;
boolean esenzioneSpeseIstruttoria = false;
String tipoIntegrazione = StringPool.BLANK;
long pagamentoId = 0l;
long intPraticaId = 0l;
long pagamentoId = 0L;
long intPraticaId = 0L;
if (DettPratica.class.getName().equals(className)) {
DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(classPk);
esenzioneBolli = dettPratica.isNormEsenteBollo();
@ -217,15 +194,12 @@ public abstract class PagamentiUtil {
} else {
throw new SystemException("error.fields.pratica.pagamento.classPk.invalid");
}
List<String> importi = new ArrayList<>();
if (esenzioneSpeseIstruttoria && esenzioneBolli) {
throw new SystemException("error.fields.pratica.pagamento.esente.oneri.bolli");
} else {
if ((PagamentoConstants.PAGAMENTO_BOLLI.equals(tipoPagamento) && !esenzioneBolli)
|| (PagamentoConstants.PAGAMENTO_ONERI.equals(tipoPagamento) && !esenzioneSpeseIstruttoria)) {
if (Validator.isNotNull(importo)) {
importo = importo.replaceAll(StringPool.COMMA, StringPool.PERIOD);
try {
@ -240,7 +214,6 @@ public abstract class PagamentiUtil {
} else if (PagamentoConstants.PAGAMENTO_ONERI.equals(tipoPagamento)) {
importi.add(importo);
}
} catch (NumberFormatException e) {
throw new SystemException("error.fields.pratica.pagamento."
+ (PagamentoConstants.PAGAMENTO_BOLLI.equals(tipoPagamento) ? "bolli"
@ -258,10 +231,8 @@ public abstract class PagamentiUtil {
return null;
}
}
if (!irisDisabled) {
if (Validator.isNull(pagamentoId)) {
Soggetto committente = SoggettoLocalServiceUtil
.getValidTmpByIntPratica_CodiceFiscale_TipologiaSoggetto(intPraticaId,
codiceFiscaleCommittente, TipoSoggettoUtil.COMMITTENTE);
@ -270,59 +241,44 @@ public abstract class PagamentiUtil {
if (codiceProvincia.equalsIgnoreCase("ee")) {
provincia = "EE";
} else {
Provincia provinciaEntity = ProvinciaLocalServiceUtil.fetchByC_C(
serviceContext.getCompanyId(), codiceProvincia);
Provincia provinciaEntity = ProvinciaLocalServiceUtil.fetchByC_C(serviceContext.getCompanyId(),
codiceProvincia);
if (Validator.isNotNull(provinciaEntity)) {
provincia = provinciaEntity.getSigla();
}
}
String codice = IrisCommonUtil.createCodicePendenza();
String causale = IrisCommonUtil.getDescrizioneCausale(tipoPagamento);
long irisPagamentoId = PagamentoLocalServiceUtil.createPagamentoId();
currentURL = StringUtil.replaceLast(currentURL, "/0", StringPool.SLASH + irisPagamentoId);
String auth = HttpUtil.getParameter(currentURL, "p_auth", false);
// XXX Se non li rimuovi non funziona più
Map<String, String[]> parameters = HttpUtil.getParameterMap(HttpUtil
.getQueryString(currentURL));
Map<String, String[]> parameters = HttpUtil.getParameterMap(HttpUtil.getQueryString(currentURL));
for (String key : parameters.keySet()) {
currentURL = HttpUtil.removeParameter(currentURL, key);
}
if (Validator.isNotNull(auth)) {
currentURL = HttpUtil.addParameter(currentURL, "p_auth", auth);
}
if (Validator.isNull(codiceFiscaleCommittente)) {
throw new SystemException("error.fields.pratica.pagamento.codicefiscale.richiesto");
}
List<ElencoIdentificativiType> iuvs = new ArrayList<ElencoIdentificativiType>();
if (PagamentoConstants.PAGAMENTO_BOLLI.equalsIgnoreCase(tipoPagamento)) {
iuvs = IrisComunicaPosizioniDebitorie.generaIUV(serviceContext.getCompanyId(),
importi.size());
iuvs = IrisComunicaPosizioniDebitorie.generaIUV(serviceContext.getCompanyId(), importi.size());
}
IdpOTFType idpOTFType = IrisComunicaPosizioniDebitorie.comunicaPosizioniDebitorieOTF(
serviceContext.getCompanyId(), serviceContext.getScopeGroupId(),
serviceContext.getUserId(), codice, causale, codiceFiscaleCommittente, tipoPagamento,
importi, iuvs, currentURL, currentURL, provincia);
serviceContext.getCompanyId(), serviceContext.getScopeGroupId(), serviceContext.getUserId(),
codice, causale, codiceFiscaleCommittente, tipoPagamento, importi, iuvs, currentURL,
currentURL, provincia);
String urlPagamento = StringPool.BLANK;
if (idpOTFType == null) {
urlPagamento = currentURL;
throw new SystemException("error.geniocivilefe.pratica.pagamento | intPraticaId="
+ intPraticaId + " | classPk=" + classPk + " | className=" + className);
throw new SystemException("error.geniocivilefe.pratica.pagamento | intPraticaId=" + intPraticaId
+ " | classPk=" + classPk + " | className=" + className);
} else {
urlPagamento = idpOTFType.getUrlGW().toString();
}
return PagamentoLocalServiceUtil.addPagamentoAndUpdate(irisPagamentoId, codice, causale,
PagamentoConstants.MEZZO_IRIS, codiceFiscaleCommittente, tipoPagamento, importo,
PagamentoConstants.UTILIZZATA_IN_CORSO, classPk, className, 0l, urlPagamento, iuvs,
@ -347,6 +303,5 @@ public abstract class PagamentiUtil {
}
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
public String getClassName() {
return ControlloPratica.class.getName();
}
@Override
public String getType(Locale locale) {
return "controlloPratica";
}
@ -41,91 +43,25 @@ public class ControlloPraticaWorkflowHandler extends BaseWorkflowHandler {
if (Validator.isNull(workflowContext)) {
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);
}
@Override
public Object updateStatus(int status, Map<String, Serializable> workflowContext) throws PortalException,
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
List<ControlloPratica> wfNewListVarianti = new ArrayList<ControlloPratica>();
ControlloPratica cp = ControlloPraticaLocalServiceUtil.updateStatus(userId, resourcePrimKey, status,
serviceContext, wfNewListVarianti);
// E richiamiamo il nostro metodo che farà update dello status sul
// nostro asset!
// E richiamiamo il nostro metodo che farà update dello status sul nostro asset!
if (wfNewListVarianti.size() > 0) {
_log.info("wfNewListVarianti size >0" + wfNewListVarianti.size());
ControlloPraticaLocalServiceUtil.gestioneWFVarianti(wfNewListVarianti.get(0));
}
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.number=2574
build.date=1618926051044
build.number=2575
build.date=1619174539111
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.number=28
build.date=1616062122215
build.number=29
build.date=1619174642482
build.auto.upgrade=true
##

Caricamento…
Annulla
Salva