Sfoglia il codice sorgente

Corretta indicizzazione e ricerca

master 22.06
Salvatore La Manna 2 anni fa
parent
commit
44f9a2cc32
  1. 2
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/.settings/org.eclipse.core.resources.prefs
  2. 7
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/mwg/sismica/bo/util/HttpServiceUtil.java
  3. 5
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/IntPraticaLocalService.java
  4. 429
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/IntPraticaLocalServiceClp.java
  5. 8
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/IntPraticaLocalServiceUtil.java
  6. 9
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/IntPraticaLocalServiceWrapper.java
  7. 3
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/ProtocolloUtil.java
  8. 4
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/content/Portal.properties
  9. 266
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/indexer/ControlloPraticaIndexer.java
  10. 196
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/indexer/IndexerUtil.java
  11. 275
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/indexer/IntPraticaIndexer.java
  12. 272
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/search/BaseSearch.java
  13. 707
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/search/ControlloPraticaAdvancedSearch.java
  14. 478
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/search/ControlloPraticaSearch.java
  15. 583
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/search/IntPraticaAdvancedSearch.java
  16. 258
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/search/IntPraticaSearch.java
  17. 3
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/servlet/MappeServlet.java
  18. 120
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/ManutenzioneDatabase.java
  19. 32
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SismicaUtil.java
  20. 17
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/DettPraticaImpl.java
  21. 4
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/IntPraticaImpl.java
  22. 19
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/model/impl/SoggettoImpl.java
  23. 6
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/DocAggiuntivaPortlet.java
  24. 197
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/FascicoloPortlet.java
  25. 3
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GenerateProtocolloCSVPortlet.java
  26. 125
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneAttivitaIstruttorePortlet.java
  27. 85
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneAttivitaPortlet.java
  28. 6
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneFirmePortlet.java
  29. 14
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/PaesaggisticaAdministrationPortlet.java
  30. 11
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/RicercaProtocolloPortlet.java
  31. 20
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/report/builder/builder/ReportAvvisoBeanBuilder.java
  32. 445
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/base/IntPraticaLocalServiceClpInvoker.java
  33. 6
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AvvisoLocalServiceImpl.java
  34. 15
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DettPraticaLocalServiceImpl.java
  35. 58
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/IntPraticaLocalServiceImpl.java
  36. 4
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties
  37. 10
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/carichilavoro/view.jsp
  38. 131
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/search.jsp
  39. 89
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/view.jsp
  40. 266
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/advanced_search.jsp
  41. 3
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/altri_task.jsp
  42. 5
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/init.jsp
  43. 69
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/miei_task.jsp
  44. 339
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/search.jsp
  45. 3
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/task_completati.jsp
  46. 2
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/task_miei_ruoli.jsp
  47. 81
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/view.jsp
  48. 2
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestionefirme/avvisi_actions.jsp
  49. 2
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/content/Language.properties
  50. 22
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/portlet/FascicoloFePortlet.java
  51. 1
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/portlet/ParereGeologoPortlet.java
  52. 2
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/portlet/SoggettiPraticaPortlet.java
  53. 206
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/util/ReportFascicoloUtil.java
  54. 35
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/soggettipratica/view.jsp
  55. 37
      liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/mwg/sismica/bo/shared/util/IndexField.java
  56. 70
      liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/mwg/sismica/bo/shared/util/PortosIndexField.java
  57. 6
      liferay-plugins-sdk-6.2/shared/portos-firma-shared/src/it/tref/firma/shared/RestFile.java
  58. 5
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/hook/struts/EditWorkflowTaskAction.java

2
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/.settings/org.eclipse.core.resources.prefs

@ -4,6 +4,6 @@ encoding//docroot/html/common/import_window.jsp=UTF-8
encoding//docroot/html/fascicolo/actions/action_toggle_sospensione.jsp=UTF-8 encoding//docroot/html/fascicolo/actions/action_toggle_sospensione.jsp=UTF-8
encoding//docroot/html/fascicolo/navigator/header.jsp=UTF-8 encoding//docroot/html/fascicolo/navigator/header.jsp=UTF-8
encoding//docroot/html/fascicolo/soggetto_details.jsp=UTF-8 encoding//docroot/html/fascicolo/soggetto_details.jsp=UTF-8
encoding//docroot/html/gestioneattivita/advanced_search.jsp=UTF-8 encoding//docroot/html/gestioneattivita/search.jsp=UTF-8
encoding//docroot/html/paesaggistica_administration/init.jsp=UTF-8 encoding//docroot/html/paesaggistica_administration/init.jsp=UTF-8
encoding//docroot/html/paesaggistica_administration/view.jsp=UTF-8 encoding//docroot/html/paesaggistica_administration/view.jsp=UTF-8

7
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/mwg/sismica/bo/util/HttpServiceUtil.java

@ -51,15 +51,14 @@ public class HttpServiceUtil {
int statusCode = response.getStatusLine().getStatusCode(); int statusCode = response.getStatusLine().getStatusCode();
String responseBody = EntityUtils.toString(response.getEntity(), StringPool.UTF8); String responseBody = EntityUtils.toString(response.getEntity(), StringPool.UTF8);
try { try {
client.close(); client.close();
} catch (IOException e) { } catch (IOException e) {}
}
if (statusCode == HttpServletResponse.SC_OK || statusCode == HttpServletResponse.SC_CREATED) { if (statusCode == HttpServletResponse.SC_OK || statusCode == HttpServletResponse.SC_CREATED) {
risposta = JSONFactoryUtil.createJSONObject(responseBody); risposta = JSONFactoryUtil.createJSONObject(responseBody);
_log.info(url + " || " + json + " || " + risposta); _log.info(url + " || " + json + " || " + risposta);
} else { } else {
_log.info(url + " || " + json + " || " + statusCode + ": " + responseBody); _log.info(url + " || " + json + " || " + statusCode + ": " + responseBody);
throw new PortalException(statusCode + StringPool.SPACE + responseBody); throw new PortalException(statusCode + ' ' + responseBody);
} }
return risposta; return risposta;
} }

5
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/IntPraticaLocalService.java

@ -320,6 +320,9 @@ public interface IntPraticaLocalService extends BaseLocalService,
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true) @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public java.util.Map<java.lang.String, java.lang.String> getTipiProcedure(); public java.util.Map<java.lang.String, java.lang.String> getTipiProcedure();
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public java.util.Map<java.lang.String, java.lang.String> getVecchieProcedure();
@com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX) @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX)
public it.tref.liferay.portos.bo.model.IntPratica addIntPratica( public it.tref.liferay.portos.bo.model.IntPratica addIntPratica(
long territorioId, java.lang.String tipoProcedura, long territorioId, java.lang.String tipoProcedura,
@ -520,7 +523,7 @@ public interface IntPraticaLocalService extends BaseLocalService,
it.tref.liferay.portos.bo.NoSuchIntPraticaException; it.tref.liferay.portos.bo.NoSuchIntPraticaException;
public void reIndexFascicolo( public void reIndexFascicolo(
it.tref.liferay.portos.bo.model.IntPratica intPratica, long companyId); it.tref.liferay.portos.bo.model.IntPratica pratica, long companyId);
public void reIndexFasciolo(java.lang.String numeroProgetto, long companyId) public void reIndexFasciolo(java.lang.String numeroProgetto, long companyId)
throws com.liferay.portal.kernel.exception.SystemException; throws com.liferay.portal.kernel.exception.SystemException;

429
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/IntPraticaLocalServiceClp.java

@ -135,251 +135,255 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
_methodParameterTypes23 = new String[] { }; _methodParameterTypes23 = new String[] { };
_methodName24 = "addIntPratica"; _methodName24 = "getVecchieProcedure";
_methodParameterTypes24 = new String[] { _methodParameterTypes24 = new String[] { };
_methodName25 = "addIntPratica";
_methodParameterTypes25 = new String[] {
"long", "java.lang.String", "long", "java.lang.String",
"com.liferay.portal.service.ServiceContext" "com.liferay.portal.service.ServiceContext"
}; };
_methodName25 = "addIntPratica"; _methodName26 = "addIntPratica";
_methodParameterTypes25 = new String[] { _methodParameterTypes26 = new String[] {
"long", "java.lang.String", "java.lang.String", "long", "long", "java.lang.String", "java.lang.String", "long",
"java.lang.String", "java.lang.String", "java.lang.String", "java.lang.String", "java.lang.String", "java.lang.String",
"boolean", "int", "java.util.Date", "boolean", "int", "java.util.Date",
"com.liferay.portal.service.ServiceContext" "com.liferay.portal.service.ServiceContext"
}; };
_methodName26 = "deleteIntPratica"; _methodName27 = "deleteIntPratica";
_methodParameterTypes26 = new String[] { _methodParameterTypes27 = new String[] {
"it.tref.liferay.portos.bo.model.IntPratica", "boolean" "it.tref.liferay.portos.bo.model.IntPratica", "boolean"
}; };
_methodName27 = "cloneIntPratica"; _methodName28 = "cloneIntPratica";
_methodParameterTypes27 = new String[] { _methodParameterTypes28 = new String[] {
"long", "com.liferay.portal.service.ServiceContext" "long", "com.liferay.portal.service.ServiceContext"
}; };
_methodName28 = "updateDelegati"; _methodName29 = "updateDelegati";
_methodParameterTypes28 = new String[] { _methodParameterTypes29 = new String[] {
"long", "java.lang.String", "java.lang.String", "boolean" "long", "java.lang.String", "java.lang.String", "boolean"
}; };
_methodName29 = "findFascicoliNotProgetto"; _methodName30 = "findFascicoliNotProgetto";
_methodParameterTypes29 = new String[] { "int", "int" };
_methodName30 = "countFascicoliNotProgetto"; _methodParameterTypes30 = new String[] { "int", "int" };
_methodParameterTypes30 = new String[] { }; _methodName31 = "countFascicoliNotProgetto";
_methodName31 = "countByPosizione"; _methodParameterTypes31 = new String[] { };
_methodParameterTypes31 = new String[] { "double", "double", "int" }; _methodName32 = "countByPosizione";
_methodName32 = "findByPosizione";
_methodParameterTypes32 = new String[] { "double", "double", "int" }; _methodParameterTypes32 = new String[] { "double", "double", "int" };
_methodName33 = "findByPosizione"; _methodName33 = "findByPosizione";
_methodParameterTypes33 = new String[] { _methodParameterTypes33 = new String[] { "double", "double", "int" };
_methodName34 = "findByPosizione";
_methodParameterTypes34 = new String[] {
"double", "double", "int", "int", "int" "double", "double", "int", "int", "int"
}; };
_methodName34 = "addNumeroProgetto"; _methodName35 = "addNumeroProgetto";
_methodParameterTypes34 = new String[] { "long" }; _methodParameterTypes35 = new String[] { "long" };
_methodName35 = "sospendiPratica"; _methodName36 = "sospendiPratica";
_methodParameterTypes35 = new String[] { "long", "boolean" }; _methodParameterTypes36 = new String[] { "long", "boolean" };
_methodName36 = "cambiaTitolare"; _methodName37 = "cambiaTitolare";
_methodParameterTypes36 = new String[] { _methodParameterTypes37 = new String[] {
"long", "long", "com.liferay.portal.service.ServiceContext" "long", "long", "com.liferay.portal.service.ServiceContext"
}; };
_methodName37 = "updateStatoPratica"; _methodName38 = "updateStatoPratica";
_methodParameterTypes37 = new String[] { "long", "java.lang.String" }; _methodParameterTypes38 = new String[] { "long", "java.lang.String" };
_methodName38 = "findByC_UserId"; _methodName39 = "findByC_UserId";
_methodParameterTypes38 = new String[] { "long", "long", "int", "int" }; _methodParameterTypes39 = new String[] { "long", "long", "int", "int" };
_methodName39 = "countByC_UserId"; _methodName40 = "countByC_UserId";
_methodParameterTypes39 = new String[] { "long", "long" }; _methodParameterTypes40 = new String[] { "long", "long" };
_methodName40 = "updateStatus"; _methodName41 = "updateStatus";
_methodParameterTypes40 = new String[] { "long", "int" }; _methodParameterTypes41 = new String[] { "long", "int" };
_methodName41 = "findByCompanyIdSoggettoProgetti"; _methodName42 = "findByCompanyIdSoggettoProgetti";
_methodParameterTypes41 = new String[] { "long", "long" };
_methodName42 = "countByCompanyIdSoggettoProgetti";
_methodParameterTypes42 = new String[] { "long", "long" }; _methodParameterTypes42 = new String[] { "long", "long" };
_methodName43 = "findByCompanyIdSoggettoArchivio"; _methodName43 = "countByCompanyIdSoggettoProgetti";
_methodParameterTypes43 = new String[] { "long", "long" }; _methodParameterTypes43 = new String[] { "long", "long" };
_methodName44 = "countByCompanyIdSoggettoArchivio"; _methodName44 = "findByCompanyIdSoggettoArchivio";
_methodParameterTypes44 = new String[] { "long", "long" }; _methodParameterTypes44 = new String[] { "long", "long" };
_methodName45 = "findByCompanyIdSoggettoAltriProgetti"; _methodName45 = "countByCompanyIdSoggettoArchivio";
_methodParameterTypes45 = new String[] { "long", "long" };
_methodParameterTypes45 = new String[] { "long", "long", "int", "int" }; _methodName46 = "findByCompanyIdSoggettoAltriProgetti";
_methodName46 = "countByCompanyIdSoggettoAltriProgetti"; _methodParameterTypes46 = new String[] { "long", "long", "int", "int" };
_methodParameterTypes46 = new String[] { "long", "long" }; _methodName47 = "countByCompanyIdSoggettoAltriProgetti";
_methodName47 = "findByCanAddFineLavori"; _methodParameterTypes47 = new String[] { "long", "long" };
_methodParameterTypes47 = new String[] { _methodName48 = "findByCanAddFineLavori";
_methodParameterTypes48 = new String[] {
"long", "java.lang.String", "int", "int" "long", "java.lang.String", "int", "int"
}; };
_methodName48 = "countByCanAddFineLavori"; _methodName49 = "countByCanAddFineLavori";
_methodParameterTypes48 = new String[] { "long", "java.lang.String" }; _methodParameterTypes49 = new String[] { "long", "java.lang.String" };
_methodName49 = "findByCanAddCollaudo"; _methodName50 = "findByCanAddCollaudo";
_methodParameterTypes49 = new String[] { _methodParameterTypes50 = new String[] {
"long", "java.lang.String", "int", "int" "long", "java.lang.String", "int", "int"
}; };
_methodName50 = "countByCanAddCollaudo"; _methodName51 = "countByCanAddCollaudo";
_methodParameterTypes50 = new String[] { "long", "java.lang.String" }; _methodParameterTypes51 = new String[] { "long", "java.lang.String" };
_methodName51 = "search"; _methodName52 = "search";
_methodParameterTypes51 = new String[] { "java.util.List", "int", "int" }; _methodParameterTypes52 = new String[] { "java.util.List", "int", "int" };
_methodName52 = "countSearch"; _methodName53 = "countSearch";
_methodParameterTypes52 = new String[] { "java.util.List" }; _methodParameterTypes53 = new String[] { "java.util.List" };
_methodName53 = "searchWithIntPraticaId"; _methodName54 = "searchWithIntPraticaId";
_methodParameterTypes53 = new String[] { _methodParameterTypes54 = new String[] {
"java.util.List", "long", "int", "int" "java.util.List", "long", "int", "int"
}; };
_methodName54 = "allegaFileAnnullamento"; _methodName55 = "allegaFileAnnullamento";
_methodParameterTypes54 = new String[] { _methodParameterTypes55 = new String[] {
"long", "byte[][]", "java.lang.String", "java.lang.String", "long", "byte[][]", "java.lang.String", "java.lang.String",
"com.liferay.portal.service.ServiceContext" "com.liferay.portal.service.ServiceContext"
}; };
_methodName55 = "generateFileAnnullamento"; _methodName56 = "generateFileAnnullamento";
_methodParameterTypes55 = new String[] { _methodParameterTypes56 = new String[] {
"long", "com.liferay.portal.service.ServiceContext" "long", "com.liferay.portal.service.ServiceContext"
}; };
_methodName56 = "deleteFileAnnullamento"; _methodName57 = "deleteFileAnnullamento";
_methodParameterTypes56 = new String[] { "long" }; _methodParameterTypes57 = new String[] { "long" };
_methodName57 = "completeAnnullamento"; _methodName58 = "completeAnnullamento";
_methodParameterTypes57 = new String[] { "long" }; _methodParameterTypes58 = new String[] { "long" };
_methodName58 = "cambiaIstruttore"; _methodName59 = "cambiaIstruttore";
_methodParameterTypes58 = new String[] { "long", "long", "long" }; _methodParameterTypes59 = new String[] { "long", "long", "long" };
_methodName59 = "countCaricoLavoroCF"; _methodName60 = "countCaricoLavoroCF";
_methodParameterTypes59 = new String[] { _methodParameterTypes60 = new String[] {
"long", "java.lang.String", "java.lang.Long[][]" "long", "java.lang.String", "java.lang.Long[][]"
}; };
_methodName60 = "countCaricoLavoroIstruttore"; _methodName61 = "countCaricoLavoroIstruttore";
_methodParameterTypes60 = new String[] { "long", "java.lang.String" }; _methodParameterTypes61 = new String[] { "long", "java.lang.String" };
_methodName61 = "generateReportPratica"; _methodName62 = "generateReportPratica";
_methodParameterTypes61 = new String[] { _methodParameterTypes62 = new String[] {
"it.tref.liferay.portos.bo.model.IntPratica", "long" "it.tref.liferay.portos.bo.model.IntPratica", "long"
}; };
_methodName62 = "updateModifiedDate"; _methodName63 = "updateModifiedDate";
_methodParameterTypes62 = new String[] { "long", "java.util.Date" }; _methodParameterTypes63 = new String[] { "long", "java.util.Date" };
_methodName63 = "reIndexFascicolo"; _methodName64 = "reIndexFascicolo";
_methodParameterTypes63 = new String[] { _methodParameterTypes64 = new String[] {
"it.tref.liferay.portos.bo.model.IntPratica", "long" "it.tref.liferay.portos.bo.model.IntPratica", "long"
}; };
_methodName64 = "reIndexFasciolo";
_methodParameterTypes64 = new String[] { "java.lang.String", "long" };
_methodName65 = "reIndexFasciolo"; _methodName65 = "reIndexFasciolo";
_methodParameterTypes65 = new String[] { "long", "long" }; _methodParameterTypes65 = new String[] { "java.lang.String", "long" };
_methodName66 = "findByNumeroProgetto"; _methodName66 = "reIndexFasciolo";
_methodParameterTypes66 = new String[] { "java.lang.String" }; _methodParameterTypes66 = new String[] { "long", "long" };
_methodName67 = "findByTerritorioId"; _methodName67 = "findByNumeroProgetto";
_methodParameterTypes67 = new String[] { "long" }; _methodParameterTypes67 = new String[] { "java.lang.String" };
_methodName68 = "getOrganizationByIntPraticaId"; _methodName68 = "findByTerritorioId";
_methodParameterTypes68 = new String[] { "long" }; _methodParameterTypes68 = new String[] { "long" };
_methodName69 = "hasRichiestaIntegrazioneAttiva"; _methodName69 = "getOrganizationByIntPraticaId";
_methodParameterTypes69 = new String[] { "long" }; _methodParameterTypes69 = new String[] { "long" };
_methodName70 = "invioMailNotifica"; _methodName70 = "hasRichiestaIntegrazioneAttiva";
_methodParameterTypes70 = new String[] { "long" };
_methodParameterTypes70 = new String[] { _methodName71 = "invioMailNotifica";
_methodParameterTypes71 = new String[] {
"long", "long", "java.lang.String", "java.lang.String[][]", "long", "long", "java.lang.String", "java.lang.String[][]",
"java.lang.String[][]", "java.lang.String[][]", "java.lang.String[][]", "java.lang.String[][]",
"java.lang.String", "com.liferay.portal.kernel.json.JSONObject", "java.lang.String", "com.liferay.portal.kernel.json.JSONObject",
"java.util.List", "com.liferay.portal.service.ServiceContext" "java.util.List", "com.liferay.portal.service.ServiceContext"
}; };
_methodName71 = "searchAltriProgetti"; _methodName72 = "searchAltriProgetti";
_methodParameterTypes71 = new String[] { _methodParameterTypes72 = new String[] {
"javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletRequest",
"com.liferay.portal.model.User", "int", "int" "com.liferay.portal.model.User", "int", "int"
}; };
_methodName72 = "searchArchivioProgetti"; _methodName73 = "searchArchivioProgetti";
_methodParameterTypes72 = new String[] { _methodParameterTypes73 = new String[] {
"javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletRequest",
"com.liferay.portal.model.User", "int", "int" "com.liferay.portal.model.User", "int", "int"
}; };
_methodName73 = "searchMieiProgetti"; _methodName74 = "searchMieiProgetti";
_methodParameterTypes73 = new String[] { _methodParameterTypes74 = new String[] {
"javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletRequest",
"com.liferay.portal.model.User", "int", "int" "com.liferay.portal.model.User", "int", "int"
}; };
@ -1108,6 +1112,29 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
return (java.util.Map<java.lang.String, java.lang.String>)ClpSerializer.translateOutput(returnObj); return (java.util.Map<java.lang.String, java.lang.String>)ClpSerializer.translateOutput(returnObj);
} }
@Override
public java.util.Map<java.lang.String, java.lang.String> getVecchieProcedure() {
Object returnObj = null;
try {
returnObj = _invokableLocalService.invokeMethod(_methodName24,
_methodParameterTypes24, new Object[] { });
}
catch (Throwable t) {
t = ClpSerializer.translateThrowable(t);
if (t instanceof RuntimeException) {
throw (RuntimeException)t;
}
else {
throw new RuntimeException(t.getClass().getName() +
" is not a valid exception");
}
}
return (java.util.Map<java.lang.String, java.lang.String>)ClpSerializer.translateOutput(returnObj);
}
@Override @Override
public it.tref.liferay.portos.bo.model.IntPratica addIntPratica( public it.tref.liferay.portos.bo.model.IntPratica addIntPratica(
long territorioId, java.lang.String tipoProcedura, long territorioId, java.lang.String tipoProcedura,
@ -1117,8 +1144,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName24, returnObj = _invokableLocalService.invokeMethod(_methodName25,
_methodParameterTypes24, _methodParameterTypes25,
new Object[] { new Object[] {
territorioId, territorioId,
@ -1162,8 +1189,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName25, returnObj = _invokableLocalService.invokeMethod(_methodName26,
_methodParameterTypes25, _methodParameterTypes26,
new Object[] { new Object[] {
userId, userId,
@ -1219,8 +1246,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName26, returnObj = _invokableLocalService.invokeMethod(_methodName27,
_methodParameterTypes26, _methodParameterTypes27,
new Object[] { new Object[] {
ClpSerializer.translateInput(intPratica), ClpSerializer.translateInput(intPratica),
@ -1259,8 +1286,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName27, returnObj = _invokableLocalService.invokeMethod(_methodName28,
_methodParameterTypes27, _methodParameterTypes28,
new Object[] { new Object[] {
intPraticaId, intPraticaId,
@ -1300,8 +1327,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName28, returnObj = _invokableLocalService.invokeMethod(_methodName29,
_methodParameterTypes28, _methodParameterTypes29,
new Object[] { new Object[] {
intPraticaId, intPraticaId,
@ -1343,8 +1370,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName29, returnObj = _invokableLocalService.invokeMethod(_methodName30,
_methodParameterTypes29, new Object[] { start, end }); _methodParameterTypes30, new Object[] { start, end });
} }
catch (Throwable t) { catch (Throwable t) {
t = ClpSerializer.translateThrowable(t); t = ClpSerializer.translateThrowable(t);
@ -1371,8 +1398,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName30, returnObj = _invokableLocalService.invokeMethod(_methodName31,
_methodParameterTypes30, new Object[] { }); _methodParameterTypes31, new Object[] { });
} }
catch (Throwable t) { catch (Throwable t) {
t = ClpSerializer.translateThrowable(t); t = ClpSerializer.translateThrowable(t);
@ -1399,8 +1426,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName31, returnObj = _invokableLocalService.invokeMethod(_methodName32,
_methodParameterTypes31, new Object[] { lat, lng, raggio }); _methodParameterTypes32, new Object[] { lat, lng, raggio });
} }
catch (Throwable t) { catch (Throwable t) {
t = ClpSerializer.translateThrowable(t); t = ClpSerializer.translateThrowable(t);
@ -1428,8 +1455,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName32, returnObj = _invokableLocalService.invokeMethod(_methodName33,
_methodParameterTypes32, new Object[] { lat, lng, raggio }); _methodParameterTypes33, new Object[] { lat, lng, raggio });
} }
catch (Throwable t) { catch (Throwable t) {
t = ClpSerializer.translateThrowable(t); t = ClpSerializer.translateThrowable(t);
@ -1457,8 +1484,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName33, returnObj = _invokableLocalService.invokeMethod(_methodName34,
_methodParameterTypes33, _methodParameterTypes34,
new Object[] { lat, lng, raggio, start, end }); new Object[] { lat, lng, raggio, start, end });
} }
catch (Throwable t) { catch (Throwable t) {
@ -1488,8 +1515,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName34, returnObj = _invokableLocalService.invokeMethod(_methodName35,
_methodParameterTypes34, new Object[] { intPraticaId }); _methodParameterTypes35, new Object[] { intPraticaId });
} }
catch (Throwable t) { catch (Throwable t) {
t = ClpSerializer.translateThrowable(t); t = ClpSerializer.translateThrowable(t);
@ -1522,8 +1549,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName35, returnObj = _invokableLocalService.invokeMethod(_methodName36,
_methodParameterTypes35, _methodParameterTypes36,
new Object[] { intPraticaId, sospesa }); new Object[] { intPraticaId, sospesa });
} }
catch (Throwable t) { catch (Throwable t) {
@ -1558,8 +1585,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName36, returnObj = _invokableLocalService.invokeMethod(_methodName37,
_methodParameterTypes36, _methodParameterTypes37,
new Object[] { new Object[] {
intPraticaId, intPraticaId,
@ -1599,8 +1626,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName37, returnObj = _invokableLocalService.invokeMethod(_methodName38,
_methodParameterTypes37, _methodParameterTypes38,
new Object[] { new Object[] {
intPraticaId, intPraticaId,
@ -1637,8 +1664,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName38, returnObj = _invokableLocalService.invokeMethod(_methodName39,
_methodParameterTypes38, _methodParameterTypes39,
new Object[] { companyId, userId, start, end }); new Object[] { companyId, userId, start, end });
} }
catch (Throwable t) { catch (Throwable t) {
@ -1666,8 +1693,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName39, returnObj = _invokableLocalService.invokeMethod(_methodName40,
_methodParameterTypes39, new Object[] { companyId, userId }); _methodParameterTypes40, new Object[] { companyId, userId });
} }
catch (Throwable t) { catch (Throwable t) {
t = ClpSerializer.translateThrowable(t); t = ClpSerializer.translateThrowable(t);
@ -1693,8 +1720,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
throws com.liferay.portal.kernel.exception.PortalException, throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException { com.liferay.portal.kernel.exception.SystemException {
try { try {
_invokableLocalService.invokeMethod(_methodName40, _invokableLocalService.invokeMethod(_methodName41,
_methodParameterTypes40, new Object[] { intPraticaId, status }); _methodParameterTypes41, new Object[] { intPraticaId, status });
} }
catch (Throwable t) { catch (Throwable t) {
t = ClpSerializer.translateThrowable(t); t = ClpSerializer.translateThrowable(t);
@ -1725,8 +1752,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName41, returnObj = _invokableLocalService.invokeMethod(_methodName42,
_methodParameterTypes41, _methodParameterTypes42,
new Object[] { companyId, soggettoId }); new Object[] { companyId, soggettoId });
} }
catch (Throwable t) { catch (Throwable t) {
@ -1759,8 +1786,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName42, returnObj = _invokableLocalService.invokeMethod(_methodName43,
_methodParameterTypes42, _methodParameterTypes43,
new Object[] { companyId, soggettoId }); new Object[] { companyId, soggettoId });
} }
catch (Throwable t) { catch (Throwable t) {
@ -1794,8 +1821,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName43, returnObj = _invokableLocalService.invokeMethod(_methodName44,
_methodParameterTypes43, _methodParameterTypes44,
new Object[] { companyId, soggettoId }); new Object[] { companyId, soggettoId });
} }
catch (Throwable t) { catch (Throwable t) {
@ -1828,8 +1855,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName44, returnObj = _invokableLocalService.invokeMethod(_methodName45,
_methodParameterTypes44, _methodParameterTypes45,
new Object[] { companyId, soggettoId }); new Object[] { companyId, soggettoId });
} }
catch (Throwable t) { catch (Throwable t) {
@ -1863,8 +1890,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName45, returnObj = _invokableLocalService.invokeMethod(_methodName46,
_methodParameterTypes45, _methodParameterTypes46,
new Object[] { companyId, soggettoId, start, end }); new Object[] { companyId, soggettoId, start, end });
} }
catch (Throwable t) { catch (Throwable t) {
@ -1898,8 +1925,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName46, returnObj = _invokableLocalService.invokeMethod(_methodName47,
_methodParameterTypes46, _methodParameterTypes47,
new Object[] { companyId, soggettoId }); new Object[] { companyId, soggettoId });
} }
catch (Throwable t) { catch (Throwable t) {
@ -1933,8 +1960,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName47, returnObj = _invokableLocalService.invokeMethod(_methodName48,
_methodParameterTypes47, _methodParameterTypes48,
new Object[] { new Object[] {
companyId, companyId,
@ -1976,8 +2003,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName48, returnObj = _invokableLocalService.invokeMethod(_methodName49,
_methodParameterTypes48, _methodParameterTypes49,
new Object[] { new Object[] {
companyId, companyId,
@ -2015,8 +2042,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName49, returnObj = _invokableLocalService.invokeMethod(_methodName50,
_methodParameterTypes49, _methodParameterTypes50,
new Object[] { new Object[] {
companyId, companyId,
@ -2058,8 +2085,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName50, returnObj = _invokableLocalService.invokeMethod(_methodName51,
_methodParameterTypes50, _methodParameterTypes51,
new Object[] { new Object[] {
companyId, companyId,
@ -2096,8 +2123,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName51, returnObj = _invokableLocalService.invokeMethod(_methodName52,
_methodParameterTypes51, _methodParameterTypes52,
new Object[] { new Object[] {
ClpSerializer.translateInput(groupIds), ClpSerializer.translateInput(groupIds),
@ -2131,8 +2158,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName52, returnObj = _invokableLocalService.invokeMethod(_methodName53,
_methodParameterTypes52, _methodParameterTypes53,
new Object[] { ClpSerializer.translateInput(groupIds) }); new Object[] { ClpSerializer.translateInput(groupIds) });
} }
catch (Throwable t) { catch (Throwable t) {
@ -2161,8 +2188,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName53, returnObj = _invokableLocalService.invokeMethod(_methodName54,
_methodParameterTypes53, _methodParameterTypes54,
new Object[] { new Object[] {
ClpSerializer.translateInput(groupIds), ClpSerializer.translateInput(groupIds),
@ -2203,8 +2230,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName54, returnObj = _invokableLocalService.invokeMethod(_methodName55,
_methodParameterTypes54, _methodParameterTypes55,
new Object[] { new Object[] {
intPraticaId, intPraticaId,
@ -2254,8 +2281,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName55, returnObj = _invokableLocalService.invokeMethod(_methodName56,
_methodParameterTypes55, _methodParameterTypes56,
new Object[] { new Object[] {
intPraticaId, intPraticaId,
@ -2294,8 +2321,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
throws com.liferay.portal.kernel.exception.PortalException, throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException { com.liferay.portal.kernel.exception.SystemException {
try { try {
_invokableLocalService.invokeMethod(_methodName56, _invokableLocalService.invokeMethod(_methodName57,
_methodParameterTypes56, _methodParameterTypes57,
new Object[] { docPraticaAnnullamentoId }); new Object[] { docPraticaAnnullamentoId });
} }
catch (Throwable t) { catch (Throwable t) {
@ -2324,8 +2351,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
throws com.liferay.portal.kernel.exception.PortalException, throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException { com.liferay.portal.kernel.exception.SystemException {
try { try {
_invokableLocalService.invokeMethod(_methodName57, _invokableLocalService.invokeMethod(_methodName58,
_methodParameterTypes57, new Object[] { intPraticaId }); _methodParameterTypes58, new Object[] { intPraticaId });
} }
catch (Throwable t) { catch (Throwable t) {
t = ClpSerializer.translateThrowable(t); t = ClpSerializer.translateThrowable(t);
@ -2354,8 +2381,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
throws com.liferay.portal.kernel.exception.PortalException, throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException { com.liferay.portal.kernel.exception.SystemException {
try { try {
_invokableLocalService.invokeMethod(_methodName58, _invokableLocalService.invokeMethod(_methodName59,
_methodParameterTypes58, _methodParameterTypes59,
new Object[] { intPraticaId, controlloPraticaId, istruttoreId }); new Object[] { intPraticaId, controlloPraticaId, istruttoreId });
} }
catch (Throwable t) { catch (Throwable t) {
@ -2387,8 +2414,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName59, returnObj = _invokableLocalService.invokeMethod(_methodName60,
_methodParameterTypes59, _methodParameterTypes60,
new Object[] { new Object[] {
ispettoreId, ispettoreId,
@ -2427,8 +2454,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName60, returnObj = _invokableLocalService.invokeMethod(_methodName61,
_methodParameterTypes60, _methodParameterTypes61,
new Object[] { new Object[] {
ispettoreId, ispettoreId,
@ -2462,8 +2489,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName61, returnObj = _invokableLocalService.invokeMethod(_methodName62,
_methodParameterTypes61, _methodParameterTypes62,
new Object[] { new Object[] {
ClpSerializer.translateInput(intPratica), ClpSerializer.translateInput(intPratica),
@ -2501,8 +2528,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName62, returnObj = _invokableLocalService.invokeMethod(_methodName63,
_methodParameterTypes62, _methodParameterTypes63,
new Object[] { new Object[] {
intPraticaId, intPraticaId,
@ -2534,11 +2561,11 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
@Override @Override
public void reIndexFascicolo( public void reIndexFascicolo(
it.tref.liferay.portos.bo.model.IntPratica intPratica, long companyId) { it.tref.liferay.portos.bo.model.IntPratica pratica, long companyId) {
try { try {
_invokableLocalService.invokeMethod(_methodName63, _invokableLocalService.invokeMethod(_methodName64,
_methodParameterTypes63, _methodParameterTypes64,
new Object[] { ClpSerializer.translateInput(intPratica), companyId }); new Object[] { ClpSerializer.translateInput(pratica), companyId });
} }
catch (Throwable t) { catch (Throwable t) {
t = ClpSerializer.translateThrowable(t); t = ClpSerializer.translateThrowable(t);
@ -2557,8 +2584,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
public void reIndexFasciolo(java.lang.String numeroProgetto, long companyId) public void reIndexFasciolo(java.lang.String numeroProgetto, long companyId)
throws com.liferay.portal.kernel.exception.SystemException { throws com.liferay.portal.kernel.exception.SystemException {
try { try {
_invokableLocalService.invokeMethod(_methodName64, _invokableLocalService.invokeMethod(_methodName65,
_methodParameterTypes64, _methodParameterTypes65,
new Object[] { new Object[] {
ClpSerializer.translateInput(numeroProgetto), ClpSerializer.translateInput(numeroProgetto),
@ -2587,8 +2614,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
throws com.liferay.portal.kernel.exception.PortalException, throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException { com.liferay.portal.kernel.exception.SystemException {
try { try {
_invokableLocalService.invokeMethod(_methodName65, _invokableLocalService.invokeMethod(_methodName66,
_methodParameterTypes65, _methodParameterTypes66,
new Object[] { intPraticaId, companyId }); new Object[] { intPraticaId, companyId });
} }
catch (Throwable t) { catch (Throwable t) {
@ -2619,8 +2646,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName66, returnObj = _invokableLocalService.invokeMethod(_methodName67,
_methodParameterTypes66, _methodParameterTypes67,
new Object[] { ClpSerializer.translateInput(numeroProgetto) }); new Object[] { ClpSerializer.translateInput(numeroProgetto) });
} }
catch (Throwable t) { catch (Throwable t) {
@ -2649,8 +2676,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName67, returnObj = _invokableLocalService.invokeMethod(_methodName68,
_methodParameterTypes67, new Object[] { territorioId }); _methodParameterTypes68, new Object[] { territorioId });
} }
catch (Throwable t) { catch (Throwable t) {
t = ClpSerializer.translateThrowable(t); t = ClpSerializer.translateThrowable(t);
@ -2679,8 +2706,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName68, returnObj = _invokableLocalService.invokeMethod(_methodName69,
_methodParameterTypes68, new Object[] { intPraticaId }); _methodParameterTypes69, new Object[] { intPraticaId });
} }
catch (Throwable t) { catch (Throwable t) {
t = ClpSerializer.translateThrowable(t); t = ClpSerializer.translateThrowable(t);
@ -2710,8 +2737,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName69, returnObj = _invokableLocalService.invokeMethod(_methodName70,
_methodParameterTypes69, new Object[] { intPraticaId }); _methodParameterTypes70, new Object[] { intPraticaId });
} }
catch (Throwable t) { catch (Throwable t) {
t = ClpSerializer.translateThrowable(t); t = ClpSerializer.translateThrowable(t);
@ -2739,8 +2766,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
throws com.liferay.portal.kernel.exception.PortalException, throws com.liferay.portal.kernel.exception.PortalException,
com.liferay.portal.kernel.exception.SystemException { com.liferay.portal.kernel.exception.SystemException {
try { try {
_invokableLocalService.invokeMethod(_methodName70, _invokableLocalService.invokeMethod(_methodName71,
_methodParameterTypes70, _methodParameterTypes71,
new Object[] { new Object[] {
dettPraticaId, dettPraticaId,
@ -2791,8 +2818,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName71, returnObj = _invokableLocalService.invokeMethod(_methodName72,
_methodParameterTypes71, _methodParameterTypes72,
new Object[] { new Object[] {
ClpSerializer.translateInput(request), ClpSerializer.translateInput(request),
@ -2825,8 +2852,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName72, returnObj = _invokableLocalService.invokeMethod(_methodName73,
_methodParameterTypes72, _methodParameterTypes73,
new Object[] { new Object[] {
ClpSerializer.translateInput(request), ClpSerializer.translateInput(request),
@ -2859,8 +2886,8 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
Object returnObj = null; Object returnObj = null;
try { try {
returnObj = _invokableLocalService.invokeMethod(_methodName73, returnObj = _invokableLocalService.invokeMethod(_methodName74,
_methodParameterTypes73, _methodParameterTypes74,
new Object[] { new Object[] {
ClpSerializer.translateInput(request), ClpSerializer.translateInput(request),
@ -3033,4 +3060,6 @@ public class IntPraticaLocalServiceClp implements IntPraticaLocalService {
private String[] _methodParameterTypes72; private String[] _methodParameterTypes72;
private String _methodName73; private String _methodName73;
private String[] _methodParameterTypes73; private String[] _methodParameterTypes73;
private String _methodName74;
private String[] _methodParameterTypes74;
} }

8
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/IntPraticaLocalServiceUtil.java

@ -346,6 +346,10 @@ public class IntPraticaLocalServiceUtil {
return getService().getTipiProcedure(); return getService().getTipiProcedure();
} }
public static java.util.Map<java.lang.String, java.lang.String> getVecchieProcedure() {
return getService().getVecchieProcedure();
}
public static it.tref.liferay.portos.bo.model.IntPratica addIntPratica( public static it.tref.liferay.portos.bo.model.IntPratica addIntPratica(
long territorioId, java.lang.String tipoProcedura, long territorioId, java.lang.String tipoProcedura,
com.liferay.portal.service.ServiceContext serviceContext) com.liferay.portal.service.ServiceContext serviceContext)
@ -639,8 +643,8 @@ public class IntPraticaLocalServiceUtil {
} }
public static void reIndexFascicolo( public static void reIndexFascicolo(
it.tref.liferay.portos.bo.model.IntPratica intPratica, long companyId) { it.tref.liferay.portos.bo.model.IntPratica pratica, long companyId) {
getService().reIndexFascicolo(intPratica, companyId); getService().reIndexFascicolo(pratica, companyId);
} }
public static void reIndexFasciolo(java.lang.String numeroProgetto, public static void reIndexFasciolo(java.lang.String numeroProgetto,

9
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/service/IntPraticaLocalServiceWrapper.java

@ -367,6 +367,11 @@ public class IntPraticaLocalServiceWrapper implements IntPraticaLocalService,
return _intPraticaLocalService.getTipiProcedure(); return _intPraticaLocalService.getTipiProcedure();
} }
@Override
public java.util.Map<java.lang.String, java.lang.String> getVecchieProcedure() {
return _intPraticaLocalService.getVecchieProcedure();
}
@Override @Override
public it.tref.liferay.portos.bo.model.IntPratica addIntPratica( public it.tref.liferay.portos.bo.model.IntPratica addIntPratica(
long territorioId, java.lang.String tipoProcedura, long territorioId, java.lang.String tipoProcedura,
@ -702,8 +707,8 @@ public class IntPraticaLocalServiceWrapper implements IntPraticaLocalService,
@Override @Override
public void reIndexFascicolo( public void reIndexFascicolo(
it.tref.liferay.portos.bo.model.IntPratica intPratica, long companyId) { it.tref.liferay.portos.bo.model.IntPratica pratica, long companyId) {
_intPraticaLocalService.reIndexFascicolo(intPratica, companyId); _intPraticaLocalService.reIndexFascicolo(pratica, companyId);
} }
@Override @Override

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

@ -16,7 +16,6 @@ import org.apache.commons.codec.digest.DigestUtils;
import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.json.JSONObject; import com.liferay.portal.kernel.json.JSONObject;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.kernel.util.Validator;
public class ProtocolloUtil { public class ProtocolloUtil {
@ -75,6 +74,6 @@ public class ProtocolloUtil {
} catch (SystemException | PortalException e) { } catch (SystemException | PortalException e) {
e.printStackTrace(); e.printStackTrace();
} }
return "Oggetto: " + className + StringPool.SPACE + classPk; return "Oggetto: " + className + ' ' + classPk;
} }
} }

4
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/content/Portal.properties

@ -859,6 +859,10 @@ fl-ulteriore-documentazione = Si allega ulteriore documentazioneutile alla dichi
##RICERCA PRATICHE ##RICERCA PRATICHE
ricercapratiche.numeroProgetto = Numero Progetto ricercapratiche.numeroProgetto = Numero Progetto
ricercapratiche.uuid = UUID ricercapratiche.uuid = UUID
ricercapratiche.workflowState = Attività
ricercapratiche.protocollo = Protocollo
ricercapratiche.dataRichiesta = Data Richiesta
ricercapratiche.tipoProcedura = Tipo Pratica
this-select-x-is-required = <span class="text-danger">il campo <strong>{0}</strong> è richiesto</span> this-select-x-is-required = <span class="text-danger">il campo <strong>{0}</strong> è richiesto</span>

266
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/indexer/ControlloPraticaIndexer.java

@ -1,36 +1,18 @@
package it.mwg.sismica.bo.indexer; package it.mwg.sismica.bo.indexer;
import it.mwg.sismica.bo.shared.util.PortosIndexField; import it.mwg.sismica.bo.shared.util.IndexField;
import it.tref.liferay.portos.bo.model.Comune;
import it.tref.liferay.portos.bo.model.ControlloPratica; import it.tref.liferay.portos.bo.model.ControlloPratica;
import it.tref.liferay.portos.bo.model.DettPratica;
import it.tref.liferay.portos.bo.model.IntPratica; 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.Territorio;
import it.tref.liferay.portos.bo.service.ComuneLocalServiceUtil;
import it.tref.liferay.portos.bo.service.ControlloPraticaLocalServiceUtil; import it.tref.liferay.portos.bo.service.ControlloPraticaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil; import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.ParereGeologoLocalServiceUtil;
import it.tref.liferay.portos.bo.service.ProvinciaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil;
import it.tref.liferay.portos.bo.service.TerritorioLocalServiceUtil;
import it.tref.liferay.portos.bo.service.persistence.ControlloPraticaActionableDynamicQuery; import it.tref.liferay.portos.bo.service.persistence.ControlloPraticaActionableDynamicQuery;
import it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants;
import it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil;
import it.tref.liferay.portos.bo.util.WorkflowUtil;
import java.text.Format; import java.text.Format;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale; import java.util.Locale;
import javax.portlet.PortletURL; import javax.portlet.PortletURL;
import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery; import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
import com.liferay.portal.kernel.dao.orm.QueryUtil;
import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.log.Log; import com.liferay.portal.kernel.log.Log;
@ -46,21 +28,11 @@ import com.liferay.portal.kernel.util.FastDateFormatFactoryUtil;
import com.liferay.portal.kernel.util.GetterUtil; import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.StringPool; import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.kernel.workflow.WorkflowInstance;
import com.liferay.portal.kernel.workflow.WorkflowInstanceManagerUtil;
import com.liferay.portal.kernel.workflow.WorkflowTask;
import com.liferay.portal.kernel.workflow.WorkflowTaskAssignee;
import com.liferay.portal.kernel.workflow.WorkflowTaskManagerUtil;
import com.liferay.portal.model.AuditedModel; import com.liferay.portal.model.AuditedModel;
import com.liferay.portal.model.BaseModel; import com.liferay.portal.model.BaseModel;
import com.liferay.portal.model.GroupedModel; import com.liferay.portal.model.GroupedModel;
import com.liferay.portal.model.ResourcedModel; import com.liferay.portal.model.ResourcedModel;
import com.liferay.portal.model.Role;
import com.liferay.portal.model.TrashedModel; import com.liferay.portal.model.TrashedModel;
import com.liferay.portal.model.User;
import com.liferay.portal.model.WorkflowInstanceLink;
import com.liferay.portal.service.UserLocalServiceUtil;
import com.liferay.portal.service.WorkflowInstanceLinkLocalServiceUtil;
import com.liferay.portal.util.PortalUtil; import com.liferay.portal.util.PortalUtil;
public class ControlloPraticaIndexer extends BaseIndexer { public class ControlloPraticaIndexer extends BaseIndexer {
@ -103,229 +75,14 @@ public class ControlloPraticaIndexer extends BaseIndexer {
Document document = null; Document document = null;
if (Validator.isNotNull(obj)) { if (Validator.isNotNull(obj)) {
ControlloPratica controlloPratica = (ControlloPratica) obj; ControlloPratica cpObj = (ControlloPratica) obj;
ControlloPratica controlloPraticaFromDB = ControlloPraticaLocalServiceUtil document = getBaseModelDocument(PORTLET_ID, cpObj);
.getControlloPratica(controlloPratica.getControlloPraticaId()); ControlloPratica cp = ControlloPraticaLocalServiceUtil.getControlloPratica(cpObj.getControlloPraticaId());
if (_log.isDebugEnabled()) { document.addKeyword(Field.ENTRY_CLASS_NAME, ControlloPratica.class.getName());
_log.debug("Indexing ControlloPratica: " + controlloPratica.getControlloPraticaId()); document.addNumber(IndexField.CONTROLLO_PRATICA_ID, cp.getControlloPraticaId());
}
document = getBaseModelDocument(PORTLET_ID, controlloPratica);
document.addKeyword("entryClassName", ControlloPratica.class.getName());
document.addKeyword(PortosIndexField.CONTROLLO_PRATICA_ID, controlloPraticaFromDB.getControlloPraticaId());
document.addKeyword(PortosIndexField.DETT_PRATICA_ID, controlloPraticaFromDB.getDettPraticaId());
//document.addKeyword(PortosIndexField.PARERE_GEOLOGO, controlloPraticaFromDB.getParereGeologo());
document.addKeyword(PortosIndexField.STATUS, controlloPraticaFromDB.getStatus());
document.addKeyword(PortosIndexField.STATUS_BY_USERID, controlloPraticaFromDB.getStatusByUserId());
document.addKeyword(PortosIndexField.STATUS_BY_USERNAME, controlloPraticaFromDB.getStatusByUserName());
if (controlloPraticaFromDB.getStatusDate() != null) {
document.addKeyword(PortosIndexField.STATUS_DATE,
DATE_FORMAT.format(controlloPraticaFromDB.getStatusDate()));
} else {
document.addKeyword(PortosIndexField.STATUS_DATE, 0);
}
List<ParereGeologo> listaParereGeologo = ParereGeologoLocalServiceUtil.findByIntPraticaId(
controlloPraticaFromDB.getIntPraticaId(), QueryUtil.ALL_POS, QueryUtil.ALL_POS);
List<Long> idGeologi = new ArrayList<Long>();
for(ParereGeologo geo : listaParereGeologo){
idGeologi.add(geo.getGeologoUserId());
}
if (Validator.isNotNull(listaParereGeologo) && !listaParereGeologo.isEmpty()) {
document.addKeyword(PortosIndexField.PARERE_GEOLOGO, 1L);
} else {
document.addKeyword(PortosIndexField.PARERE_GEOLOGO, 0L);
}
document.addNumber(PortosIndexField.GEOLOGI, idGeologi.toArray(new Long[0]));
document.addKeyword(PortosIndexField.DATA_INIZIO_PROCEDIMENTO,
DATE_FORMAT.format(controlloPraticaFromDB.getCreateDate()));
document.addKeywordSortable(PortosIndexField.DATA_INIZIO_PROCEDIMENTO,
DATE_FORMAT.format(controlloPraticaFromDB.getCreateDate()));
document.addDate(PortosIndexField.DATA_INIZIO_PROCEDIMENTO, controlloPraticaFromDB.getCreateDate());
// Indicizzo i campi relarivi a IntPratica // Indicizzo i campi relarivi a IntPratica
document.addKeyword(PortosIndexField.INT_PRATICA_ID, controlloPraticaFromDB.getIntPraticaId()); IntPratica ip = IntPraticaLocalServiceUtil.fetchIntPratica(cp.getIntPraticaId());
IntPratica intPratica = IntPraticaLocalServiceUtil IndexerUtil.fillDocument(document, ip, cp);
.fetchIntPratica(controlloPraticaFromDB.getIntPraticaId());
if (Validator.isNotNull(intPratica)) {
if (intPratica.getStatusByUserId() != 0L) {
document.addKeyword(PortosIndexField.ISTRUTTORE_USER_ID, intPratica.getStatusByUserId());
User userIstruttore = UserLocalServiceUtil.fetchUser(intPratica.getStatusByUserId());
if (Validator.isNotNull(userIstruttore)) {
document.addKeyword(PortosIndexField.ISTRUTTORE_FULL_NAME, userIstruttore.getFullName()
.toUpperCase());
}
document.addKeyword(PortosIndexField.ASSEGNATA_AD_ISTRUTTORE, 1L);
}else{
document.addKeyword(PortosIndexField.ASSEGNATA_AD_ISTRUTTORE, 0L);
}
if (intPratica.getUserId() != 0L) {
User proprietarioDigitale = UserLocalServiceUtil.fetchUser(intPratica.getUserId());
if (Validator.isNotNull(proprietarioDigitale)) {
document.addKeyword(PortosIndexField.PROPRIETARIO_DIGITALE_FULL_NAME, proprietarioDigitale
.getFullName().toUpperCase());
}
}
// Informazioni sullo stato della pratica
boolean variata = DettPraticaLocalServiceUtil.countVariateByIntPratica(intPratica.getIntPraticaId()) > 0;
document.addKeyword(PortosIndexField.VARIATA, variata);
document.addKeyword(PortosIndexField.COLLAUDO_COMPLETATO, intPratica.getCollaudoTotale());
document.addKeyword(PortosIndexField.COLLAUDO_PARZIALE, intPratica.getCollaudoParziale());
document.addKeyword(PortosIndexField.FINE_LAVORI_COMPLETATI, intPratica.getFineLavoriTotale());
document.addKeyword(PortosIndexField.FINE_LAVORI_PARZIALI, intPratica.getFineLavoriParziale());
document.addKeyword(PortosIndexField.SOTTOPOSTO_A_PARERE,
checkSottopostaAParere(intPratica.getIntPraticaId()));
document.addKeyword(PortosIndexField.TIPO_PRATICA, intPratica.getTipoPratica());
document.addKeywordSortable(PortosIndexField.TIPO_PRATICA, intPratica.getTipoPratica());
document.addKeyword(PortosIndexField.NUMERO_PROGETTO, Integer.valueOf(intPratica.getNumeroProgetto()));
document.addNumber(PortosIndexField.NUMERO_PROGETTO, Integer.valueOf(intPratica.getNumeroProgetto()));
document.addNumberSortable(PortosIndexField.NUMERO_PROGETTO,
Integer.valueOf(intPratica.getNumeroProgetto()));
document.addKeyword(PortosIndexField.STATO_PRATICA, intPratica.getStatoPratica());
document.addKeyword("controlloObbligatorio", intPratica.isControlloObbligatorio());
if (Validator.isNotNull(intPratica.getTipoProcedura())) {
document.addKeyword(PortosIndexField.TIPO_PROCEDURA, intPratica.getTipoProcedura());
}
document.addKeyword(PortosIndexField.UNITA_OPERATIVA, intPratica.getUnitaOperativa());
// Prendo l ultimo DettPratica legato a IntPratica
DettPratica lastDettPratica = DettPraticaLocalServiceUtil
.getLastCompletedByIntPraticaAndProtocolloNotEmpty(intPratica.getIntPraticaId());
if (Validator.isNull(lastDettPratica)) {
lastDettPratica = DettPraticaLocalServiceUtil.getLastCompletedByIntPratica(intPratica
.getIntPraticaId());
}
if (Validator.isNotNull(lastDettPratica)) {
document.addKeyword("nuovaCostruzione", lastDettPratica.getTcNuovaCostruzione());
document.addKeyword("adeguamentoSismico", lastDettPratica.getTcAdeguamentoSismico());
document.addKeyword("miglioramentoSismico", lastDettPratica.getTcMiglioramentoSismico());
document.addKeyword("interventoLocale", lastDettPratica.getTcRiparazioneInterventoLocale());
if (Validator.isNotNull(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 (Validator.isNotNull(lastDettPratica.getVia())) {
document.addKeyword(PortosIndexField.INDIRIZZO, lastDettPratica.getVia());
}
if (Validator.isNotNull(lastDettPratica.getLocalita())) {
document.addKeyword(PortosIndexField.LOCALITA, lastDettPratica.getLocalita());
}
if (Validator.isNotNull(lastDettPratica.getDescLongIntervento())) {
document.addText(PortosIndexField.DESC_INTERVENTO, lastDettPratica.getDescLongIntervento());
document.addKeyword(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.RIPARAZIONE_INTERVENTO_LOCALE,
lastDettPratica.getTcRiparazioneInterventoLocale());
}
}
// Gestione pratica aperta/chiusa fine lavori
if (intPratica.getCollaudoTotale()) {
document.addKeyword(PortosIndexField.PRATICA_APERTA, false);
} else if (lastDettPratica != null && lastDettPratica.getCollaudoStatico()
&& intPratica.getFineLavoriTotale()) {
document.addKeyword(PortosIndexField.PRATICA_APERTA, false);
} else if (intPratica.isAnnullata()
|| intPratica.getStatoPratica().equals(StatoPraticaConstants.ANNULLATA)) {
document.addKeyword(PortosIndexField.PRATICA_APERTA, false);
} else {
document.addKeyword(PortosIndexField.PRATICA_APERTA, true);
}
if (intPratica.hasRichiestaIntegrazioneAttiva()) {
document.addKeyword(PortosIndexField.PRATICA_APERTA, true);
}
// Prendo la lista dei soggetti committenti legati a IntPratica
List<Soggetto> committenti = SoggettoLocalServiceUtil.findByIntPratica_TipologiaSoggetto(
intPratica.getIntPraticaId(), TipoSoggettoUtil.COMMITTENTE);
if (Validator.isNotNull(committenti) && committenti.size() > 0) {
// Creo una stringa contenente tutti i codFisc legati alla IntPratica separati da ,
List<String> listaSoggetti = new ArrayList<String>();
for (Soggetto soggetto : committenti) {
listaSoggetti.add(soggetto.getNome().toUpperCase() + StringPool.SPACE
+ soggetto.getCognome().toUpperCase());
}
document.addKeyword(PortosIndexField.SOGGETTI_INTERESSATI, listaSoggetti.toArray(new String[0]));
document.addKeyword(PortosIndexField.COMMITTENTI, listaSoggetti.toArray(new String[0]));
}
// Soggetti Interconnessi
List<Soggetto> listSoggettiInterconnessi = SoggettoLocalServiceUtil
.getSoggettiByIntPraticaId_DtRimozioneNull(intPratica.getIntPraticaId());
if (listSoggettiInterconnessi != null && !listSoggettiInterconnessi.isEmpty()) {
List<String> listaStringata = new ArrayList<String>();
for (Soggetto sog : listSoggettiInterconnessi) {
listaStringata.add(sog.getNome().toUpperCase() + StringPool.SPACE
+ sog.getCognome().toUpperCase());
}
document.addKeyword(PortosIndexField.SOGGETTI_INTERCONNESSI, listaStringata.toArray(new String[0]));
}
// Prendo dati relativi al Territorio
if (Validator.isNotNull(intPratica.getTerritorioId())) {
Territorio territorio = TerritorioLocalServiceUtil.fetchTerritorio(intPratica.getTerritorioId());
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_NAME, provincia.getProvincia());
}
}
}
}
}
}
// Indicizzazione campi da Kaleo
WorkflowInstanceLink workflowInstanceLink = WorkflowInstanceLinkLocalServiceUtil.fetchWorkflowInstanceLink(
controlloPraticaFromDB.getCompanyId(), controlloPraticaFromDB.getGroupId(),
ControlloPratica.class.getName(), controlloPraticaFromDB.getPrimaryKey());
if (Validator.isNotNull(workflowInstanceLink)) {
long workflowInstanceId = workflowInstanceLink.getWorkflowInstanceId();
WorkflowInstance workflowInstance = WorkflowInstanceManagerUtil.getWorkflowInstance(
controlloPraticaFromDB.getCompanyId(), workflowInstanceId);
if (Validator.isNotNull(workflowInstance)) {
document.addKeyword(PortosIndexField.WORKFLOW_STATE, workflowInstance.getState());
List<WorkflowTask> listaTask = WorkflowTaskManagerUtil.getWorkflowTasksByWorkflowInstance(
controlloPraticaFromDB.getCompanyId(), null, workflowInstance.getWorkflowInstanceId(),
false, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
if (Validator.isNotNull(listaTask) && !listaTask.isEmpty()) {
WorkflowTask task = listaTask.get(0);
if (task.getAssigneeUserId() != 0L && task.getAssigneeUserId() != -1) {
document.addKeyword(PortosIndexField.TASK_ASSIGNEE_USER_ID, task.getAssigneeUserId());
} else if (workflowInstance.getState().equals("Esito")) {
_log.warn("Fascicolo Disallineato su Kaleo : assenza assegnazione istruttore | kaleoInstanceId="
+ workflowInstance.getWorkflowInstanceId());
}
if (Validator.isNotNull(task.getWorkflowTaskAssignees())
&& !task.getWorkflowTaskAssignees().isEmpty()) {
List<String> roleIdsAssignee = new ArrayList<String>();
for (WorkflowTaskAssignee taskAssignee : task.getWorkflowTaskAssignees()) {
if (taskAssignee.getAssigneeClassName().equals(Role.class.getName())) {
roleIdsAssignee.add("R" + taskAssignee.getAssigneeClassPK() + "G"
+ controlloPraticaFromDB.getGroupId());
}
}
document.addKeyword(PortosIndexField.TASK_ASSIGNEE_ROLE_IDS,
roleIdsAssignee.toArray(new String[0]));
}
document.addKeyword(PortosIndexField.WORKFLOW_DEFINITION_NAME,
workflowInstance.getWorkflowDefinitionName());
document.addKeyword(PortosIndexField.WORKFLOW_DEFINITION_VERSION,
workflowInstance.getWorkflowDefinitionVersion());
document.addKeyword(PortosIndexField.TASK_NAME, task.getName());
document.addKeywordSortable(PortosIndexField.TASK_NAME, task.getName());
}
}
}
} else { } else {
_log.warn("Received a null ControlloPratica in input."); _log.warn("Received a null ControlloPratica in input.");
} }
@ -385,9 +142,7 @@ public class ControlloPraticaIndexer extends BaseIndexer {
if (Validator.isNotNull(document)) { if (Validator.isNotNull(document)) {
String title = document.get(StringPool.BLANK); String title = document.get(StringPool.BLANK);
String content = document.get(StringPool.BLANK); String content = document.get(StringPool.BLANK);
String controlloPraticaId = document.get(PortosIndexField.CONTROLLO_PRATICA_ID);
portletURL.setParameter("struts_action", "/web/TODO"); portletURL.setParameter("struts_action", "/web/TODO");
portletURL.setParameter("intPraticaId", controlloPraticaId);
return new Summary(title, content, portletURL); return new Summary(title, content, portletURL);
} else { } else {
_log.warn("Received a null document in input."); _log.warn("Received a null document in input.");
@ -458,11 +213,6 @@ public class ControlloPraticaIndexer extends BaseIndexer {
doReindex(controlloPratica); doReindex(controlloPratica);
} }
private boolean checkSottopostaAParere(long intPraticaId) throws SystemException, PortalException {
return WorkflowUtil.isWorkflowDisattivabile(intPraticaId);
}
@Override @Override
protected String getPortletId(SearchContext searchContext) { protected String getPortletId(SearchContext searchContext) {

196
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/indexer/IndexerUtil.java

@ -0,0 +1,196 @@
package it.mwg.sismica.bo.indexer;
import it.mwg.sismica.bo.shared.util.IndexField;
import it.tref.liferay.portos.bo.model.Comune;
import it.tref.liferay.portos.bo.model.ControlloPratica;
import it.tref.liferay.portos.bo.model.IntPratica;
import it.tref.liferay.portos.bo.model.ParereGeologo;
import it.tref.liferay.portos.bo.model.Soggetto;
import it.tref.liferay.portos.bo.model.Territorio;
import it.tref.liferay.portos.bo.service.ComuneLocalServiceUtil;
import it.tref.liferay.portos.bo.service.ParereGeologoLocalServiceUtil;
import it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil;
import it.tref.liferay.portos.bo.service.TerritorioLocalServiceUtil;
import it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants;
import it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil;
import java.text.Format;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import com.liferay.portal.kernel.dao.orm.QueryUtil;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.search.Document;
import com.liferay.portal.kernel.search.Field;
import com.liferay.portal.kernel.util.FastDateFormatFactoryUtil;
import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.kernel.workflow.WorkflowException;
import com.liferay.portal.kernel.workflow.WorkflowInstance;
import com.liferay.portal.kernel.workflow.WorkflowInstanceManagerUtil;
import com.liferay.portal.kernel.workflow.WorkflowTask;
import com.liferay.portal.kernel.workflow.WorkflowTaskAssignee;
import com.liferay.portal.kernel.workflow.WorkflowTaskManagerUtil;
import com.liferay.portal.model.Role;
import com.liferay.portal.model.User;
import com.liferay.portal.model.WorkflowInstanceLink;
import com.liferay.portal.service.UserLocalServiceUtil;
import com.liferay.portal.service.WorkflowInstanceLinkLocalServiceUtil;
public class IndexerUtil {
public static final Format DATE_FORMAT = FastDateFormatFactoryUtil.getSimpleDateFormat("yyyyMMdd");
// Manifattura Web Group per Regione Siciliana Modifiche per rendere i campi di testo ricercabili per parole
// contenute e non per corrispondenza esatta.
public static Document fillDocument(Document document, IntPratica ip, ControlloPratica cp) throws SystemException,
WorkflowException {
document.addKeyword(Field.USER_ID, ip.getUserId());
User titolare = UserLocalServiceUtil.fetchUser(ip.getUserId());
if (Validator.isNotNull(titolare)) {
document.addText(IndexField.TITOLARE, new String[] { titolare.getFullName().toLowerCase(),
titolare.getScreenName().toLowerCase() });
}
document.addKeyword(IndexField.TIPO_PROCEDURA, ip.getTipoProcedura());
document.addKeyword(IndexField.IN_LAVORAZIONE_SUE, ip.getInLavorazioneSue());
switch (ip.getStatoPratica()) {
case StatoPraticaConstants.ANNULLATA:
document.addKeyword(IndexField.PRATICA_APERTA, false);
break;
default:
document.addKeyword(IndexField.PRATICA_APERTA, true);
}
document.addKeyword(IndexField.IN_COMPILAZIONE, Validator.isNull(ip.getStatoPratica()));
Territorio territorio = TerritorioLocalServiceUtil.fetchTerritorio(ip.getTerritorioId());
if (Validator.isNull(territorio)) {
document.addKeyword(Field.GROUP_ID, ip.getGroupId());
} else {
document.addKeyword(Field.GROUP_ID, territorio.getGroupId());
Comune comune = ComuneLocalServiceUtil.fetchComune(territorio.getComuneId());
if (Validator.isNotNull(comune)) {
document.addKeyword(IndexField.COMUNE_ID, comune.getComuneId());
document.addKeyword(IndexField.CODICE_PROVINCIA, comune.getCodiceProvincia());
}
}
if (Validator.isNotNull(ip.getStatoPratica())) {
document.addKeyword(IndexField.STATO_PRATICA, ip.getStatoPratica());
}
if (Validator.isNotNull(ip.getDtPratica())) {
document.addKeywordSortable(IndexField.DATA_RICHIESTA, DATE_FORMAT.format(ip.getDtPratica()));
}
if (Validator.isNotNull(ip.getNumeroProgetto())) {
document.addKeywordSortable(IndexField.NUMERO_PROGETTO, ip.getNumeroProgetto());
}
document.addKeyword(IndexField.UNITA_OPERATIVA, ip.getUnitaOperativa());
List<ParereGeologo> pareri = ParereGeologoLocalServiceUtil.findByIntPraticaId(ip.getIntPraticaId(),
QueryUtil.ALL_POS, QueryUtil.ALL_POS);
List<Long> idGeologi = new ArrayList<>();
boolean pareriForniti = false;
for (ParereGeologo geo : pareri) {
idGeologi.add(geo.getGeologoUserId());
if (((Validator.isNull(geo.getDtAssegnazione()) && Validator.isNotNull(geo.getDtCompilazione())) || (Validator
.isNotNull(geo.getDtAssegnazione()) && Validator.isNotNull(geo.getDtApprovazione())))
&& Validator.isNull(geo.getDtAnnullamento())) {
pareriForniti = true;
}
}
document.addKeyword(IndexField.PARERI_FORNITI, pareriForniti);
if (idGeologi.size() > 0) {
document.addKeyword(IndexField.GEOLOGO_ID, idGeologi.toArray(new Long[0]));
}
User istruttore = UserLocalServiceUtil.fetchUser(ip.getStatusByUserId());
if (Validator.isNotNull(istruttore)) {
document.addKeyword(IndexField.ISTRUTTORE, new String[] { istruttore.getFullName().toLowerCase(),
istruttore.getScreenName().toLowerCase() });
}
document.addNumber(IndexField.ISTRUTTORE_ID, ip.getStatusByUserId());
List<Soggetto> listaCommittenti = SoggettoLocalServiceUtil.findByIntPratica_TipologiaSoggetto(
ip.getIntPraticaId(), TipoSoggettoUtil.COMMITTENTE);
if (Validator.isNotNull(listaCommittenti) && listaCommittenti.size() > 0) {
Set<String> committenti = new HashSet<>();
for (Soggetto committente : listaCommittenti) {
if (Validator.isNotNull(committente.getCognome())) {
committenti.add(committente.getNome().toLowerCase() + ' ' + committente.getCognome().toLowerCase());
}
if (Validator.isNotNull(committente.getDenominazione())) {
committenti.add(committente.getDenominazione().toLowerCase());
}
if (Validator.isNotNull(committente.getCodiceFiscale())) {
committenti.add(committente.getCodiceFiscale().toLowerCase());
}
if (Validator.isNotNull(committente.getCodiceFiscaleDelegato())) {
committenti.add(committente.getCodiceFiscaleDelegato().toLowerCase());
}
}
document.addText(IndexField.COMMITTENTE, committenti.toArray(new String[0]));
}
// Soggetti connessi alla intPratica
List<Soggetto> listaSoggetti = SoggettoLocalServiceUtil.getSoggettiByIntPraticaId_DtRimozioneNull(ip
.getIntPraticaId());
if (!listaSoggetti.isEmpty()) {
Set<String> soggetti = new HashSet<>();
for (Soggetto soggetto : listaSoggetti) {
if (Validator.isNotNull(soggetto.getCognome())) {
soggetti.add(soggetto.getNome().toLowerCase() + ' ' + soggetto.getCognome().toLowerCase());
}
if (Validator.isNotNull(soggetto.getDenominazione())) {
soggetti.add(soggetto.getDenominazione().toLowerCase());
}
if (Validator.isNotNull(soggetto.getCodiceFiscale())) {
soggetti.add(soggetto.getCodiceFiscale().toLowerCase());
}
if (Validator.isNotNull(soggetto.getCodiceFiscaleDelegato())) {
soggetti.add(soggetto.getCodiceFiscaleDelegato().toLowerCase());
}
}
document.addText(IndexField.SOGGETTO, soggetti.toArray(new String[0]));
}
// Indicizzazione campi da Kaleo
if (Validator.isNotNull(cp)) {
document.addNumber(IndexField.STATUS, cp.getStatus());
if (Validator.isNotNull(cp.getStatusDate())) {
document.addKeyword(IndexField.DATA_ESITO, DATE_FORMAT.format(cp.getStatusDate()));
}
WorkflowInstanceLink workflowInstanceLink = WorkflowInstanceLinkLocalServiceUtil.fetchWorkflowInstanceLink(
cp.getCompanyId(), cp.getGroupId(), ControlloPratica.class.getName(), cp.getPrimaryKey());
if (Validator.isNotNull(workflowInstanceLink)) {
WorkflowInstance workflowInstance = WorkflowInstanceManagerUtil.getWorkflowInstance(cp.getCompanyId(),
workflowInstanceLink.getWorkflowInstanceId());
if (Validator.isNotNull(workflowInstance)) {
document.addKeyword(IndexField.WORKFLOW_STATE, workflowInstance.getState());
List<WorkflowTask> tasks = WorkflowTaskManagerUtil.getWorkflowTasksByWorkflowInstance(
cp.getCompanyId(), null, workflowInstance.getWorkflowInstanceId(), false,
QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
if (Validator.isNotNull(tasks) && !tasks.isEmpty()) {
WorkflowTask task = tasks.get(0);
if (task.getAssigneeUserId() != 0L && task.getAssigneeUserId() != -1) {
document.addKeyword(IndexField.TASK_ASSIGNEE_USER_ID, task.getAssigneeUserId());
}
if (Validator.isNotNull(task.getWorkflowTaskAssignees())
&& !task.getWorkflowTaskAssignees().isEmpty()) {
List<String> roleIdsAssignee = new ArrayList<String>();
for (WorkflowTaskAssignee taskAssignee : task.getWorkflowTaskAssignees()) {
if (taskAssignee.getAssigneeClassName().equals(Role.class.getName())) {
roleIdsAssignee
.add("R" + taskAssignee.getAssigneeClassPK() + "G" + cp.getGroupId());
}
}
document.addKeyword(IndexField.TASK_ASSIGNEE_ROLE_IDS,
roleIdsAssignee.toArray(new String[0]));
}
document.addKeyword(IndexField.TASK, task.getName());
}
}
}
}
// Prendo l'ultimo DettPratica legato a IntPratica
// DettPratica dp = DettPraticaLocalServiceUtil.getLastCompletedByIntPraticaAndProtocolloNotEmpty(ip
// .getIntPraticaId());
// if (Validator.isNull(dp)) {
// dp = DettPraticaLocalServiceUtil.getLastCompletedByIntPratica(ip.getIntPraticaId());
// }
return document;
}
}

275
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/indexer/IntPraticaIndexer.java

@ -1,35 +1,15 @@
package it.mwg.sismica.bo.indexer; package it.mwg.sismica.bo.indexer;
import it.mwg.sismica.bo.shared.util.PortosIndexField; import it.mwg.sismica.bo.shared.util.IndexField;
import it.mwg.sismica.bo.shared.util.WorkflowConstants;
import it.tref.liferay.portos.bo.model.Comune;
import it.tref.liferay.portos.bo.model.DettPratica;
import it.tref.liferay.portos.bo.model.IntPratica; 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.Territorio;
import it.tref.liferay.portos.bo.service.ComuneLocalServiceUtil;
import it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.IntPraticaServiceUtil; import it.tref.liferay.portos.bo.service.IntPraticaServiceUtil;
import it.tref.liferay.portos.bo.service.ParereGeologoLocalServiceUtil;
import it.tref.liferay.portos.bo.service.ProvinciaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil;
import it.tref.liferay.portos.bo.service.TerritorioLocalServiceUtil;
import it.tref.liferay.portos.bo.service.persistence.IntPraticaActionableDynamicQuery; import it.tref.liferay.portos.bo.service.persistence.IntPraticaActionableDynamicQuery;
import it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants;
import it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil;
import it.tref.liferay.portos.bo.util.WorkflowUtil;
import java.text.Format;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale; import java.util.Locale;
import javax.portlet.PortletURL; import javax.portlet.PortletURL;
import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery; import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
import com.liferay.portal.kernel.dao.orm.QueryUtil;
import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.log.Log; import com.liferay.portal.kernel.log.Log;
@ -41,7 +21,6 @@ import com.liferay.portal.kernel.search.SearchContext;
import com.liferay.portal.kernel.search.SearchEngineUtil; import com.liferay.portal.kernel.search.SearchEngineUtil;
import com.liferay.portal.kernel.search.SearchException; import com.liferay.portal.kernel.search.SearchException;
import com.liferay.portal.kernel.search.Summary; import com.liferay.portal.kernel.search.Summary;
import com.liferay.portal.kernel.util.FastDateFormatFactoryUtil;
import com.liferay.portal.kernel.util.GetterUtil; import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.StringPool; import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.kernel.util.Validator;
@ -50,15 +29,12 @@ import com.liferay.portal.model.BaseModel;
import com.liferay.portal.model.GroupedModel; import com.liferay.portal.model.GroupedModel;
import com.liferay.portal.model.ResourcedModel; import com.liferay.portal.model.ResourcedModel;
import com.liferay.portal.model.TrashedModel; import com.liferay.portal.model.TrashedModel;
import com.liferay.portal.model.User;
import com.liferay.portal.service.UserLocalServiceUtil;
import com.liferay.portal.util.PortalUtil; import com.liferay.portal.util.PortalUtil;
public class IntPraticaIndexer extends BaseIndexer { public class IntPraticaIndexer extends BaseIndexer {
public static final String[] CLASS_NAMES = { IntPratica.class.getName() }; public static final String[] CLASS_NAMES = { IntPratica.class.getName() };
public static final String PORTLET_ID = "1_WAR_portosfeportlet"; public static final String PORTLET_ID = "1_WAR_portosfeportlet";
public static final Format DATE_FORMAT = FastDateFormatFactoryUtil.getSimpleDateFormat("yyyyMMdd");
private static final Log _log = LogFactoryUtil.getLog(IntPraticaIndexer.class); private static final Log _log = LogFactoryUtil.getLog(IntPraticaIndexer.class);
public IntPraticaIndexer() { public IntPraticaIndexer() {
@ -89,249 +65,23 @@ 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.
@Override @Override
protected Document doGetDocument(Object obj) throws Exception { protected Document doGetDocument(Object obj) throws Exception {
Document document = null; Document document = null;
if (Validator.isNotNull(obj)) { if (Validator.isNotNull(obj)) {
IntPratica intPratica = (IntPratica) obj; IntPratica intPratica = (IntPratica) obj;
IntPratica intPraticaFromDB = IntPraticaServiceUtil.getIntPratica(intPratica.getIntPraticaId()); IntPratica ip = IntPraticaServiceUtil.getIntPratica(intPratica.getIntPraticaId());
if (_log.isDebugEnabled()) { if (_log.isDebugEnabled()) {
_log.debug("Indicizzo la pratica " _log.debug("Indicizzo la pratica "
+ (Validator.isNull(intPratica.getNumeroProgetto()) ? StringPool.BLANK : intPratica + (Validator.isNull(ip.getNumeroProgetto()) ? StringPool.BLANK : ip.getNumeroProgetto()
.getNumeroProgetto() + StringPool.COMMA_AND_SPACE) + "id " + StringPool.COMMA_AND_SPACE) + "id " + ip.getIntPraticaId());
+ intPratica.getIntPraticaId());
} }
document = getBaseModelDocument(PORTLET_ID, intPratica); document = getBaseModelDocument(PORTLET_ID, intPratica);
document.addKeyword("entryClassName", IntPratica.class.getName()); document.addKeyword("entryClassName", IntPratica.class.getName());
// Prendo l'ultimo DettPratica legato a IntPratica
DettPratica lastDettPratica = DettPraticaLocalServiceUtil
.getLastCompletedByIntPraticaAndProtocolloNotEmpty(intPraticaFromDB.getIntPraticaId());
if (Validator.isNull(lastDettPratica)) {
lastDettPratica = DettPraticaLocalServiceUtil
.getLastCompletedByIntPratica(intPratica.getIntPraticaId());
}
// Aggiunta field custom per la ricerca
document.addKeyword(Field.PORTLET_ID, getPortletId()); document.addKeyword(Field.PORTLET_ID, getPortletId());
if (Validator.isNotNull(intPraticaFromDB.getDtPratica())) { document.addNumber(IndexField.INT_PRATICA_ID, ip.getIntPraticaId());
document.addKeyword(PortosIndexField.DATA_RICHIESTA, IndexerUtil.fillDocument(document, ip, null);
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 (Validator.isNotNull(intPraticaFromDB.getNumeroProgetto())) {
document.addKeyword(PortosIndexField.NUMERO_PROGETTO,
Integer.valueOf(intPraticaFromDB.getNumeroProgetto()));
document.addNumber(PortosIndexField.NUMERO_PROGETTO,
Integer.valueOf(intPraticaFromDB.getNumeroProgetto()));
document.addNumberSortable(PortosIndexField.NUMERO_PROGETTO,
Integer.valueOf(intPraticaFromDB.getNumeroProgetto()));
}
document.addKeyword(PortosIndexField.TIPO_PROCEDURA, intPraticaFromDB.getTipoProcedura());
document.addKeyword(PortosIndexField.IN_LAVORAZIONE_SUE, intPraticaFromDB.getInLavorazioneSue());
if (lastDettPratica != null) {
document.addKeyword("nuovaCostruzione", lastDettPratica.getTcNuovaCostruzione());
document.addKeyword("adeguamentoSismico", lastDettPratica.getTcAdeguamentoSismico());
document.addKeyword("miglioramentoSismico", lastDettPratica.getTcMiglioramentoSismico());
document.addKeyword("interventoLocale", lastDettPratica.getTcRiparazioneInterventoLocale());
if (Validator.isNotNull(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 (Validator.isNotNull(lastDettPratica.getVia())) {
document.addText(PortosIndexField.INDIRIZZO, lastDettPratica.getVia());
}
if (Validator.isNotNull(lastDettPratica.getLocalita())) {
document.addText(PortosIndexField.LOCALITA, lastDettPratica.getLocalita());
}
}
document.addKeyword("controlloObbligatorio", intPraticaFromDB.isControlloObbligatorio());
// Gestione pratica aperta/chiusa fine lavori
if (intPraticaFromDB.getCollaudoTotale()) {
document.addKeyword(PortosIndexField.PRATICA_APERTA, false);
} else if (lastDettPratica != null && lastDettPratica.getCollaudoStatico()
&& intPraticaFromDB.getFineLavoriTotale()) {
document.addKeyword(PortosIndexField.PRATICA_APERTA, false);
} else if (intPraticaFromDB.isAnnullata()
|| intPraticaFromDB.getStatoPratica().equals(StatoPraticaConstants.ANNULLATA)) {
document.addKeyword(PortosIndexField.PRATICA_APERTA, false);
} else {
document.addKeyword(PortosIndexField.PRATICA_APERTA, true);
}
if (intPraticaFromDB.hasRichiestaIntegrazioneAttiva()) {
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()));
}
// LAVORAZIONE STATO PRATICA
if (Validator.isNotNull(intPraticaFromDB.getStatoPratica())) {
document.addKeyword(PortosIndexField.STATO_PRATICA, intPraticaFromDB.getStatoPratica());
}
boolean variata = DettPraticaLocalServiceUtil.countVariateByIntPratica(intPratica.getIntPraticaId()) > 0;
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.SOTTOPOSTO_A_PARERE,
checkSottopostaAParere(intPraticaFromDB.getIntPraticaId()));
// Gestione Istruttore
if (Validator.isNotNull(intPraticaFromDB.getStatusByUserId())) {
document.addKeyword(PortosIndexField.ISTRUTTORE_USER_ID, intPraticaFromDB.getStatusByUserId());
document.addKeyword(PortosIndexField.ISTRUTTORE_USERNAME,
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.getStatoPratica().equals(StatoPraticaConstants.SOTTOPOSTA_A_PARERE))
document.addKeyword(PortosIndexField.ASSEGNATA_AD_ISTRUTTORE, 1L);
else
document.addKeyword(PortosIndexField.ASSEGNATA_AD_ISTRUTTORE, 0L);
} else {
document.addKeyword(PortosIndexField.ASSEGNATA_AD_ISTRUTTORE, 0L);
}
if (intPratica.getUserId() != 0L) {
User proprietarioDigitale = UserLocalServiceUtil.fetchUser(intPratica.getUserId());
if (proprietarioDigitale != null) {
document.addText(PortosIndexField.PROPRIETARIO_DIGITALE_FULL_NAME,
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.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());
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_NAME, provincia.getProvincia());
}
}
}
}
document.addKeyword(PortosIndexField.TIPO_PRATICA, intPraticaFromDB.getTipoPratica());
document.addKeywordSortable(PortosIndexField.TIPO_PRATICA, intPraticaFromDB.getTipoPratica());
document.addKeyword(PortosIndexField.UNITA_OPERATIVA, intPraticaFromDB.getUnitaOperativa());
// Gestione Parere Geologo
List<ParereGeologo> listaParereGeologo = ParereGeologoLocalServiceUtil.findByIntPraticaId(
intPratica.getIntPraticaId(), QueryUtil.ALL_POS, QueryUtil.ALL_POS);
List<Long> idGeologi = new ArrayList<Long>();
for (ParereGeologo geo : listaParereGeologo) {
idGeologi.add(geo.getGeologoUserId());
}
document.addNumber(PortosIndexField.GEOLOGI, idGeologi.toArray(new Long[0]));
if (Validator.isNotNull(listaParereGeologo) && !listaParereGeologo.isEmpty()) {
document.addKeyword(PortosIndexField.PARERE_GEOLOGO, 1L);
} else {
document.addKeyword(PortosIndexField.PARERE_GEOLOGO, 0L);
}
// 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) {
// 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())) {
listaSoggetti.add(soggetto.getNome() + StringPool.SPACE + soggetto.getCognome());
}
if (Validator.isNotNull(soggetto.getDenominazione())) {
listaSoggetti.add(soggetto.getDenominazione());
}
}
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);
if (Validator.isNotNull(direttoriLavori) && !direttoriLavori.isEmpty()) {
List<String> direttori = new ArrayList<String>();
for (Soggetto direttore : direttoriLavori) {
direttori.add(direttore.getCodiceFiscale().toUpperCase());
}
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);
if (Validator.isNotNull(collaudatoriList) && !collaudatoriList.isEmpty()) {
List<String> collaudatori = new ArrayList<String>();
for (Soggetto collaudatore : collaudatoriList) {
collaudatori.add(collaudatore.getCodiceFiscale().toUpperCase());
}
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]));
}
// 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() + StringPool.SPACE + sog.getCognome());
if (Validator.isNotNull(sog.getDenominazione()))
listaStringata.add(sog.getDenominazione());
}
document.addText(PortosIndexField.SOGGETTI_INTERCONNESSI, listaStringata.toArray(new String[0]));
}
} else { } else {
_log.warn("Received a null IntPratica in input."); _log.warn("Received a null IntPratica in input.");
} }
@ -343,11 +93,11 @@ public class IntPraticaIndexer extends BaseIndexer {
throws Exception { throws Exception {
if (Validator.isNotNull(document)) { if (Validator.isNotNull(document)) {
String title = document.get(StringPool.BLANK); String title = document.get("");
String content = document.get(StringPool.BLANK); String content = document.get("");
String intPraticaId = document.get(PortosIndexField.INT_PRATICA_ID); String intPraticaId = document.get(IndexField.INT_PRATICA_ID);
portletURL.setParameter("struts_action", "/web/TODO"); portletURL.setParameter("struts_action", "/web/TODO");
portletURL.setParameter("intPraticaId", intPraticaId); portletURL.setParameter(IndexField.INT_PRATICA_ID, intPraticaId);
return new Summary(title, content, portletURL); return new Summary(title, content, portletURL);
} else { } else {
_log.warn("Received a null document in input."); _log.warn("Received a null document in input.");
@ -472,9 +222,4 @@ public class IntPraticaIndexer extends BaseIndexer {
return PORTLET_ID; return PORTLET_ID;
} }
private boolean checkSottopostaAParere(long intPraticaId) throws SystemException, PortalException {
return WorkflowUtil.isWorkflowDisattivabile(intPraticaId);
}
} }

272
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/search/BaseSearch.java

@ -0,0 +1,272 @@
package it.mwg.sismica.bo.search;
import it.mwg.sismica.bo.shared.util.IndexField;
import it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants;
import java.text.DateFormat;
import java.text.Format;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang.StringUtils;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.search.BooleanClauseOccur;
import com.liferay.portal.kernel.search.BooleanQuery;
import com.liferay.portal.kernel.search.BooleanQueryFactoryUtil;
import com.liferay.portal.kernel.search.ParseException;
import com.liferay.portal.kernel.search.SearchContext;
import com.liferay.portal.kernel.search.Sort;
import com.liferay.portal.kernel.search.TermQuery;
import com.liferay.portal.kernel.search.TermQueryFactoryUtil;
import com.liferay.portal.kernel.search.TermRangeQuery;
import com.liferay.portal.kernel.search.TermRangeQueryFactoryUtil;
import com.liferay.portal.kernel.util.FastDateFormatFactoryUtil;
import com.liferay.portal.kernel.util.ParamUtil;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.StringUtil;
import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.model.User;
public class BaseSearch {
private static final Format DATE_FORMAT_LUCENE = FastDateFormatFactoryUtil.getSimpleDateFormat("yyyyMMdd");
private static final DateFormat DATE_FORMAT_STRING = new SimpleDateFormat("dd/MM/yyyy");
private static final Log _log = LogFactoryUtil.getLog(BaseSearch.class);
public static List<String> getFields() {
return Arrays.asList(IndexField.NUMERO_PROGETTO, IndexField.TIPO_PROCEDURA, IndexField.CODICE_PROVINCIA,
IndexField.COMUNE_ID, IndexField.TITOLARE, IndexField.ISTRUTTORE, IndexField.ISTRUTTORE_ID,
IndexField.COMMITTENTE, IndexField.SOGGETTO, IndexField.UNITA_OPERATIVA, IndexField.GEOLOGO_ID,
IndexField.PARERI_FORNITI, IndexField.TASK, IndexField.DATA_RICHIESTA_DA, IndexField.DATA_RICHIESTA_A,
IndexField.DATA_ESITO_DA, IndexField.DATA_ESITO_A, IndexField.STATO_PRATICA, IndexField.WORKFLOW_STATE);
}
protected static Sort[] getOrderedQuery(HttpServletRequest request) {
Sort[] sortes = new Sort[1];
String orderField = ParamUtil.getString(request, "orderByCol", "numeroProgetto");
String orderType = ParamUtil.getString(request, "orderByType", "dec");
sortes[0] = new Sort();
if (Validator.isNotNull(orderField)) {
sortes[0].setFieldName(orderField + "_sortable");
}
switch (orderField) {
case IndexField.NUMERO_PROGETTO:
sortes[0].setType(Sort.LONG_TYPE);
break;
default:
sortes[0].setType(Sort.STRING_TYPE);
}
sortes[0].setReverse(!"asc".equals(orderType));
return sortes;
}
protected static void fullQuery(HttpServletRequest request, User user, BooleanQuery query,
SearchContext searchContext) throws ParseException, java.text.ParseException {
queryComune(request, query, searchContext);
queryDate(request, query, searchContext);
queryGeologo(request, query, searchContext);
queryIstruttoreId(request, query, searchContext);
queryKeywords(query, request, IndexField.COMMITTENTE);
queryKeywords(query, request, IndexField.ISTRUTTORE);
queryKeywords(query, request, IndexField.SOGGETTO);
queryKeywords(query, request, IndexField.TITOLARE);
queryNumeroProgetto(request, query, searchContext);
queryPareriForniti(request, query, searchContext);
queryPraticaAperta(request, query, searchContext);
queryProvincia(request, query, searchContext);
queryStatoPratica(request, query, searchContext);
queryTipoProcedura(request, query, searchContext);
queryUnitaOperativa(request, query, searchContext);
queryWorkflowState(request, query, searchContext);
}
private static void queryComune(HttpServletRequest request, BooleanQuery query, SearchContext searchContext)
throws ParseException {
String comune = ParamUtil.getString(request, IndexField.COMUNE_ID);
if (Validator.isNotNull(comune) && !comune.equals("0")) {
TermQuery term = TermQueryFactoryUtil.create(searchContext, IndexField.COMUNE_ID, comune);
query.add(term, BooleanClauseOccur.MUST);
}
}
/*
* Manifattura Web Group per Regione Siciliana Rimosse numerose righe di codice che trattavano separatamente i 3
* casi: entrambe le date inserite, inserita solo la data iniziale, inserita solo la data finale. Le funzioni
* seguenti sono state create per ridurre la duplicazione di codice.
*/
private static void queryDate(HttpServletRequest request, BooleanQuery query, SearchContext searchContext)
throws ParseException, java.text.ParseException {
String daReq = ParamUtil.getString(request, IndexField.DATA_RICHIESTA_DA);
String aReq = ParamUtil.getString(request, IndexField.DATA_RICHIESTA_A);
if (Validator.isNotNull(daReq) || Validator.isNotNull(aReq)) {
String da = Validator.isNull(daReq) ? "00000000" : DATE_FORMAT_LUCENE.format(DATE_FORMAT_STRING
.parse(daReq));
String a = DATE_FORMAT_LUCENE.format(Validator.isNull(aReq) ? new Date() : DATE_FORMAT_STRING.parse(aReq));
TermRangeQuery termRangeQuery = TermRangeQueryFactoryUtil.create(searchContext, IndexField.DATA_RICHIESTA,
da, a, true, true);
query.add(termRangeQuery, BooleanClauseOccur.MUST);
}
daReq = ParamUtil.getString(request, IndexField.DATA_ESITO_DA);
aReq = ParamUtil.getString(request, IndexField.DATA_ESITO_A);
if (Validator.isNotNull(daReq) || Validator.isNotNull(aReq)) {
String da = Validator.isNull(daReq) ? "00000000" : DATE_FORMAT_LUCENE.format(DATE_FORMAT_STRING
.parse(daReq));
String a = DATE_FORMAT_LUCENE.format(Validator.isNull(aReq) ? new Date() : DATE_FORMAT_STRING.parse(aReq));
TermRangeQuery termRangeQuery = TermRangeQueryFactoryUtil.create(searchContext, IndexField.DATA_ESITO,
da, a, true, true);
query.add(termRangeQuery, BooleanClauseOccur.MUST);
}
}
private static void queryGeologo(HttpServletRequest request, BooleanQuery query, SearchContext searchContext)
throws ParseException {
long geologo = ParamUtil.getLong(request, IndexField.GEOLOGO_ID);
if (geologo != 0) {
TermQuery term = TermQueryFactoryUtil.create(searchContext, IndexField.GEOLOGO_ID, geologo);
query.add(term, BooleanClauseOccur.MUST);
}
}
private static void queryIstruttoreId(HttpServletRequest request, BooleanQuery query, SearchContext searchContext)
throws ParseException {
long istruttoreId = ParamUtil.getLong(request, IndexField.ISTRUTTORE_ID);
if (istruttoreId != 0) {
TermQuery term = TermQueryFactoryUtil.create(searchContext, IndexField.ISTRUTTORE_ID, istruttoreId);
query.add(term, BooleanClauseOccur.MUST);
}
}
/*
* Manifattura Web Group per Regione Siciliana Modifiche per rendere i campi di testo ricercabili per parole
* contenute e non per corrispondenza esatta.
*/
private static void queryKeywords(BooleanQuery query, HttpServletRequest request, String field) {
String terms = ParamUtil.getString(request, field);
if (Validator.isNotNull(terms)) {
for (String term : StringUtil.split(terms, ' ')) {
if (Validator.isNotNull(term)) {
query.addRequiredTerm(field, term);
}
}
}
}
private static void
queryNumeroProgetto(HttpServletRequest request, BooleanQuery query, SearchContext searchContext)
throws ParseException {
String numeroProgetto = ParamUtil.getString(request, IndexField.NUMERO_PROGETTO);
if (Validator.isNotNull(numeroProgetto)) {
TermQuery term = TermQueryFactoryUtil.create(searchContext, IndexField.NUMERO_PROGETTO, numeroProgetto);
query.add(term, BooleanClauseOccur.MUST);
}
}
private static void queryPareriForniti(HttpServletRequest request, BooleanQuery query, SearchContext searchContext)
throws ParseException {
String pareriForniti = ParamUtil.getString(request, IndexField.PARERI_FORNITI);
if (Validator.isNotNull(pareriForniti)) {
TermQuery term = TermQueryFactoryUtil.create(searchContext, IndexField.PARERI_FORNITI, pareriForniti);
query.add(term, BooleanClauseOccur.MUST);
}
}
private static void queryPraticaAperta(HttpServletRequest request, BooleanQuery query, SearchContext searchContext)
throws ParseException {
String praticaAperta = ParamUtil.getString(request, IndexField.PRATICA_APERTA);
if (Validator.isNotNull(praticaAperta)) {
TermQuery term = null;
if (praticaAperta.equals("aperta")) {
term = TermQueryFactoryUtil.create(searchContext, IndexField.PRATICA_APERTA, StringPool.TRUE);
} else if (praticaAperta.equals("chiusa")) {
term = TermQueryFactoryUtil.create(searchContext, IndexField.PRATICA_APERTA, StringPool.FALSE);
}
if (Validator.isNotNull(term)) {
query.add(term, BooleanClauseOccur.MUST);
}
}
}
private static void queryProvincia(HttpServletRequest request, BooleanQuery query, SearchContext searchContext)
throws ParseException {
String provincia = ParamUtil.getString(request, IndexField.CODICE_PROVINCIA);
if (Validator.isNotNull(provincia) && !provincia.equals("0")) {
TermQuery term = TermQueryFactoryUtil.create(searchContext, IndexField.CODICE_PROVINCIA, provincia);
query.add(term, BooleanClauseOccur.MUST);
}
}
private static void queryStatoPratica(HttpServletRequest request, BooleanQuery query, SearchContext searchContext)
throws ParseException {
String statoPratica = ParamUtil.getString(request, IndexField.STATO_PRATICA);
if (Validator.isNotNull(statoPratica)) {
TermQuery term = null;
if (statoPratica.equals("IC")) {
term = TermQueryFactoryUtil.create(searchContext, "dtPratica", "0");
} else if (statoPratica.equals(StatoPraticaConstants.VARIATA)) {
term = TermQueryFactoryUtil.create(searchContext, "variata", StringPool.TRUE);
} else if (!statoPratica.equals("-1")) {
term = TermQueryFactoryUtil.create(searchContext, IndexField.STATO_PRATICA, statoPratica);
}
if (Validator.isNotNull(term)) {
query.add(term, BooleanClauseOccur.MUST);
}
}
}
private static void queryTipoProcedura(HttpServletRequest request, BooleanQuery query, SearchContext searchContext)
throws ParseException {
String tipoProcedura = ParamUtil.getString(request, IndexField.TIPO_PROCEDURA);
if (Validator.isNotNull(tipoProcedura)) {
String[] procSplit = StringUtils.split(tipoProcedura, "|");
if (procSplit.length > 0) {
for (String proc : procSplit) {
BooleanQuery bq = BooleanQueryFactoryUtil.create(searchContext);
TermQuery term = TermQueryFactoryUtil.create(searchContext, IndexField.TIPO_PROCEDURA, proc);
bq.add(term, BooleanClauseOccur.SHOULD);
query.add(bq, BooleanClauseOccur.MUST);
}
}
}
}
private static void
queryUnitaOperativa(HttpServletRequest request, BooleanQuery query, SearchContext searchContext)
throws ParseException {
int unitaOperativa = ParamUtil.getInteger(request, IndexField.UNITA_OPERATIVA);
if (unitaOperativa != 0) {
TermQuery term = TermQueryFactoryUtil.create(searchContext, IndexField.UNITA_OPERATIVA, unitaOperativa);
query.add(term, BooleanClauseOccur.MUST);
}
}
private static void queryWorkflowState(HttpServletRequest request, BooleanQuery query, SearchContext searchContext)
throws ParseException {
String state = ParamUtil.getString(request, IndexField.WORKFLOW_STATE);
if (Validator.isNotNull(state)) {
TermQuery term = TermQueryFactoryUtil.create(searchContext, IndexField.WORKFLOW_STATE, state);
query.add(term, BooleanClauseOccur.MUST);
}
}
}

707
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/search/ControlloPraticaAdvancedSearch.java

@ -1,707 +0,0 @@
package it.mwg.sismica.bo.search;
import it.mwg.sismica.bo.shared.util.PortosIndexField;
import it.mwg.sismica.bo.shared.util.UserUtil;
import it.mwg.sismica.bo.shared.util.WorkflowConstants;
import it.tref.liferay.portos.bo.model.ControlloPratica;
import it.tref.liferay.portos.bo.service.ControlloPraticaLocalServiceUtil;
import it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants;
import java.text.DateFormat;
import java.text.Format;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Properties;
import java.util.Set;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang.StringUtils;
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.search.BooleanClauseOccur;
import com.liferay.portal.kernel.search.BooleanQuery;
import com.liferay.portal.kernel.search.BooleanQueryFactoryUtil;
import com.liferay.portal.kernel.search.Document;
import com.liferay.portal.kernel.search.Hits;
import com.liferay.portal.kernel.search.ParseException;
import com.liferay.portal.kernel.search.SearchContext;
import com.liferay.portal.kernel.search.SearchContextFactory;
import com.liferay.portal.kernel.search.SearchEngineUtil;
import com.liferay.portal.kernel.search.SearchException;
import com.liferay.portal.kernel.search.Sort;
import com.liferay.portal.kernel.search.TermQuery;
import com.liferay.portal.kernel.search.TermQueryFactoryUtil;
import com.liferay.portal.kernel.search.TermRangeQuery;
import com.liferay.portal.kernel.search.TermRangeQueryFactoryUtil;
import com.liferay.portal.kernel.util.FastDateFormatFactoryUtil;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.ParamUtil;
import com.liferay.portal.kernel.util.PropsKeys;
import com.liferay.portal.kernel.util.PropsUtil;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.model.Organization;
import com.liferay.portal.model.Role;
import com.liferay.portal.model.User;
import com.liferay.portal.service.OrganizationLocalServiceUtil;
import com.liferay.portal.service.RoleLocalServiceUtil;
public class ControlloPraticaAdvancedSearch {
private static final Log _log = LogFactoryUtil.getLog(ControlloPraticaAdvancedSearch.class);
public static final String[] OVERRIDE_KEYWORDS = { "controlloPraticaId", "numeroProgetto", "tipoPratica",
"statoPratica", "dataRichiesta", "committente", "soggettiInteressati", "status", "entryClassName",
"userId", "descIntervento", "tipoProcedura" };
public static final Format DATE_FORMAT_LUCENE = FastDateFormatFactoryUtil.getSimpleDateFormat("yyyyMMdd");
public static final DateFormat DATE_FORMAT_STRING = new SimpleDateFormat("dd/MM/yyyy");
public static Hits searchMieiTask(HttpServletRequest request, User user, int start, int end) {
SearchContext searchContext = SearchContextFactory.getInstance(request);
searchContext.setKeywords(OVERRIDE_KEYWORDS.toString());
if (ParamUtil.getBoolean(request, "searchForExport", false)) {
int maxEnd = GetterUtil.getInteger(PropsUtil.get(PropsKeys.INDEX_FILTER_SEARCH_LIMIT));
searchContext.setStart(0);
searchContext.setEnd(maxEnd);
searchContext.setAttribute("paginationType", "none");
} else {
searchContext.setAttribute("paginationType", "more");
searchContext.setStart(start);
searchContext.setEnd(end);
}
// Gestione Ordinamento
searchContext.setSorts(getOrderedQuery(request));
Hits hits = null;
try {
// Condizioni necessarie per questa ricerca : entryClassName=ControlloPratica & userId=taskAssigneeUserId
TermQuery entryClassNameTermQuery = TermQueryFactoryUtil.create(searchContext, "entryClassName",
ControlloPratica.class.getName());
TermQuery userIdTermQuery = TermQueryFactoryUtil.create(searchContext, "taskAssigneeUserId",
user.getUserId());
TermQuery statusTermQuery = TermQueryFactoryUtil.create(searchContext, "status",
WorkflowConstants.STATUS_PENDING);
BooleanQuery booleanQuery = BooleanQueryFactoryUtil.create(searchContext);
booleanQuery.add(entryClassNameTermQuery, BooleanClauseOccur.MUST);
booleanQuery.add(userIdTermQuery, BooleanClauseOccur.MUST);
booleanQuery.add(statusTermQuery, BooleanClauseOccur.MUST);
// Ricavo i groupId relativi all utente che effettua la ricerca per filtrare
long ufficio = ParamUtil.getLong(request, "ufficio");
if (ufficio != 0 && ufficio != -1) {
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "groupId", ufficio);
booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST);
} else {
List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user
.getUserId());
BooleanQuery groupIdsQuery = BooleanQueryFactoryUtil.create(searchContext);
if (Validator.isNotNull(organizationList) && !organizationList.isEmpty()) {
for (Organization org : organizationList) {
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "groupId",
org.getGroupId());
groupIdsQuery.add(singleGroupIdQuery, BooleanClauseOccur.SHOULD);
}
booleanQuery.add(groupIdsQuery, BooleanClauseOccur.MUST);
} else {
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "groupId", 0L);
booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST);
}
}
// Condizioni aggiuntive
retrieveQuery(request, user, booleanQuery, searchContext);
if (_log.isDebugEnabled()) {
_log.debug("User " + user.getScreenName() + " Request query : " + booleanQuery.toString());
}
hits = SearchEngineUtil.search(searchContext, booleanQuery);
if (_log.isDebugEnabled()) {
_log.debug("Number of hint find : " + hits.getLength());
}
} catch (ParseException | SearchException | SystemException e) {
_log.error(e, e);
}
return hits;
}
public static Hits searchTaskMieiRuoli(HttpServletRequest request, User user, int start, int end) {
SearchContext searchContext = SearchContextFactory.getInstance(request);
searchContext.setKeywords(OVERRIDE_KEYWORDS.toString());
if (ParamUtil.getBoolean(request, "searchForExport", false)) {
int maxEnd = GetterUtil.getInteger(PropsUtil.get(PropsKeys.INDEX_FILTER_SEARCH_LIMIT));
searchContext.setStart(0);
searchContext.setEnd(maxEnd);
searchContext.setAttribute("paginationType", "none");
} else {
searchContext.setAttribute("paginationType", "more");
searchContext.setStart(start);
searchContext.setEnd(end);
}
// Gestione Ordinamento
searchContext.setSorts(getOrderedQuery(request));
Hits hits = null;
try {
// Condizioni necessarie per questa ricerca: entryClassName=ControlloPratica & roleIds tra i taskAssigneeIds
TermQuery entryClassNameTermQuery = TermQueryFactoryUtil.create(searchContext, "entryClassName",
ControlloPratica.class.getName());
TermQuery statusTermQuery = TermQueryFactoryUtil.create(searchContext, "status",
WorkflowConstants.STATUS_PENDING);
BooleanQuery booleanQueryRoleIds = BooleanQueryFactoryUtil.create(searchContext);
List<Organization> organizationUserList = OrganizationLocalServiceUtil.getUserOrganizations(user
.getUserId());
List<Role> organizationRoleList = null;
for (Organization org : organizationUserList) {
organizationRoleList = RoleLocalServiceUtil.getUserGroupRoles(user.getUserId(), org.getGroupId());
for (Role role : organizationRoleList) {
TermQuery roleIdTerm = TermQueryFactoryUtil.create(searchContext, "taskAssigneeRoleIds", ("R"
+ role.getRoleId() + "G" + org.getGroupId()));
booleanQueryRoleIds.add(roleIdTerm, BooleanClauseOccur.SHOULD);
}
}
BooleanQuery booleanQuery = BooleanQueryFactoryUtil.create(searchContext);
booleanQuery.add(entryClassNameTermQuery, BooleanClauseOccur.MUST);
if (organizationUserList != null && !organizationUserList.isEmpty() && organizationRoleList != null
&& !organizationRoleList.isEmpty()) {
booleanQuery.add(booleanQueryRoleIds, BooleanClauseOccur.MUST);
} else {
TermQuery roleIdTerm = TermQueryFactoryUtil.create(searchContext, "taskAssigneeRoleIds", "R0G0");
booleanQueryRoleIds.add(roleIdTerm, BooleanClauseOccur.SHOULD);
booleanQuery.add(booleanQueryRoleIds, BooleanClauseOccur.MUST);
}
booleanQuery.add(statusTermQuery, BooleanClauseOccur.MUST);
// Ricavo i groupId relativi all utente che effettua la ricerca per filtrare
long ufficio = ParamUtil.getLong(request, "ufficio");
if (ufficio != 0 && ufficio != -1) {
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "groupId", ufficio);
booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST);
} else {
List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user
.getUserId());
BooleanQuery groupIdsQuery = BooleanQueryFactoryUtil.create(searchContext);
if (Validator.isNotNull(organizationList) && !organizationList.isEmpty()) {
for (Organization org : organizationList) {
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "groupId",
org.getGroupId());
groupIdsQuery.add(singleGroupIdQuery, BooleanClauseOccur.SHOULD);
}
booleanQuery.add(groupIdsQuery, BooleanClauseOccur.MUST);
} else {
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "groupId", 0L);
booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST);
}
}
Set<Integer> uos = UserUtil.getUnitaOperative(user);
if ((uos.size() > 0) && !uos.contains(0)) {
BooleanQuery uoQuery = BooleanQueryFactoryUtil.create(searchContext);
for (int uo : uos) {
TermQuery tq = TermQueryFactoryUtil.create(searchContext, PortosIndexField.UNITA_OPERATIVA, uo);
uoQuery.add(tq, BooleanClauseOccur.SHOULD);
}
booleanQuery.add(uoQuery, BooleanClauseOccur.MUST);
}
// Condizioni aggiuntive
retrieveQuery(request, user, booleanQuery, searchContext);
if (_log.isDebugEnabled()) {
_log.debug("User " + user.getScreenName() + " Request query : " + booleanQuery.toString());
}
hits = SearchEngineUtil.search(searchContext, booleanQuery);
if (_log.isDebugEnabled()) {
_log.debug("Number of hint find : " + hits.getLength());
}
} catch (ParseException | SearchException | SystemException e) {
_log.error(e, e);
}
return hits;
}
public static Hits searchAltriTask(HttpServletRequest request, User user, int start, int end) {
SearchContext searchContext = SearchContextFactory.getInstance(request);
searchContext.setKeywords(OVERRIDE_KEYWORDS.toString());
boolean searchForExport = ParamUtil.getBoolean(request, "searchForExport", false);
if (searchForExport) {
int maxEnd = GetterUtil.getInteger(PropsUtil.get(PropsKeys.INDEX_FILTER_SEARCH_LIMIT));
searchContext.setStart(0);
searchContext.setEnd(maxEnd);
searchContext.setAttribute("paginationType", "none");
} else {
searchContext.setAttribute("paginationType", "more");
searchContext.setStart(start);
searchContext.setEnd(end);
}
// Gestione Ordinamento
searchContext.setSorts(getOrderedQuery(request));
Hits hits = null;
try {
// Condizioni necessarie per questa ricerca: entryClassName=ControlloPratica & roleIds non e tra i
// taskAssigneeIds userId non e tra taskAssigneeId
TermQuery entryClassNameTermQuery = TermQueryFactoryUtil.create(searchContext, "entryClassName",
ControlloPratica.class.getName());
TermQuery userIdTermQuery = TermQueryFactoryUtil.create(searchContext, "taskAssigneeUserId",
user.getUserId());
BooleanQuery booleanQueryRoleIds = BooleanQueryFactoryUtil.create(searchContext);
List<Organization> organizationUserList = OrganizationLocalServiceUtil.getUserOrganizations(user
.getUserId());
List<Role> organizationRoleList = null;
for (Organization org : organizationUserList) {
organizationRoleList = RoleLocalServiceUtil.getUserGroupRoles(user.getUserId(), org.getGroupId());
for (Role role : organizationRoleList) {
TermQuery roleIdTerm = TermQueryFactoryUtil.create(searchContext, "taskAssigneeRoleIds",
(role.getRoleId() + StringPool.DASH + org.getGroupId()));
booleanQueryRoleIds.add(roleIdTerm, BooleanClauseOccur.SHOULD);
}
}
TermQuery statusTermQuery = TermQueryFactoryUtil.create(searchContext, "status",
WorkflowConstants.STATUS_PENDING);
BooleanQuery booleanQuery = BooleanQueryFactoryUtil.create(searchContext);
booleanQuery.add(entryClassNameTermQuery, BooleanClauseOccur.MUST);
if (organizationUserList != null && !organizationUserList.isEmpty() && organizationRoleList != null
&& !organizationRoleList.isEmpty()) {
booleanQuery.add(booleanQueryRoleIds, BooleanClauseOccur.MUST_NOT);
}
booleanQuery.add(userIdTermQuery, BooleanClauseOccur.MUST_NOT);
booleanQuery.add(statusTermQuery, BooleanClauseOccur.MUST);
// Ricavo i groupId relativi all utente che effettua la ricerca per filtrare
long ufficio = ParamUtil.getLong(request, "ufficio");
if (ufficio != 0 && ufficio != -1) {
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "groupId", ufficio);
booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST);
} else {
List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user
.getUserId());
BooleanQuery groupIdsQuery = BooleanQueryFactoryUtil.create(searchContext);
if (Validator.isNotNull(organizationList) && !organizationList.isEmpty()) {
for (Organization org : organizationList) {
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "groupId",
org.getGroupId());
groupIdsQuery.add(singleGroupIdQuery, BooleanClauseOccur.SHOULD);
}
booleanQuery.add(groupIdsQuery, BooleanClauseOccur.MUST);
} else {
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "groupId", 0L);
booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST);
}
}
// Condizioni aggiuntive
retrieveQuery(request, user, booleanQuery, searchContext);
if (_log.isDebugEnabled()) {
_log.debug("User " + user.getScreenName() + " Request query : " + booleanQuery.toString());
}
hits = SearchEngineUtil.search(searchContext, booleanQuery);
if (_log.isDebugEnabled()) {
_log.debug("Number of hint find : " + hits.getLength());
}
} catch (ParseException | SearchException | SystemException e) {
_log.error(e, e);
}
return hits;
}
public static List<ControlloPratica> searchTaskPerEsportazioneDirigente(HttpServletRequest request, User user,
int start, int end) {
List<ControlloPratica> lista = new ArrayList<ControlloPratica>();
SearchContext searchContext = SearchContextFactory.getInstance(request);
searchContext.setKeywords(OVERRIDE_KEYWORDS.toString());
int maxEnd = GetterUtil.getInteger(PropsUtil.get(PropsKeys.INDEX_FILTER_SEARCH_LIMIT));
searchContext.setStart(0);
searchContext.setEnd(maxEnd);
searchContext.setAttribute("paginationType", "none");
// Gestione Ordinamento
searchContext.setSorts(getOrderedQuery(request));
Hits hits = null;
try {
TermQuery entryClassNameTermQuery = TermQueryFactoryUtil.create(searchContext, "entryClassName",
ControlloPratica.class.getName());
TermQuery statusTermQuery = TermQueryFactoryUtil.create(searchContext, "status",
WorkflowConstants.STATUS_PENDING);
BooleanQuery booleanQuery = BooleanQueryFactoryUtil.create(searchContext);
booleanQuery.add(entryClassNameTermQuery, BooleanClauseOccur.MUST);
booleanQuery.add(statusTermQuery, BooleanClauseOccur.MUST);
String dataDa = ParamUtil.getString(request, "dataRichiestaInizio");
String dataAl = ParamUtil.getString(request, "dataRichiestaFine");
if (Validator.isNotNull(dataDa) || Validator.isNotNull(dataAl)) {
if (Validator.isNull(dataDa)) {
dataDa = "00000000";
} else {
dataDa = DATE_FORMAT_LUCENE.format(DATE_FORMAT_STRING.parse(dataDa));
}
if (Validator.isNull(dataAl)) {
dataAl = DATE_FORMAT_LUCENE.format(new Date());
} else {
dataAl = DATE_FORMAT_LUCENE.format(DATE_FORMAT_STRING.parse(dataAl));
}
TermRangeQuery dateSearchTermRangeQuery = TermRangeQueryFactoryUtil.create(searchContext,
"dataInizioProcedimento", dataDa, dataAl, true, true);
booleanQuery.add(dateSearchTermRangeQuery, BooleanClauseOccur.MUST);
}
if (_log.isDebugEnabled()) {
_log.debug("User " + user.getScreenName() + " Request query : " + booleanQuery.toString());
}
hits = SearchEngineUtil.search(searchContext, booleanQuery);
if (_log.isDebugEnabled()) {
_log.debug("Number of hints found : " + hits.getLength());
}
for (Document doc : hits.toList()) {
String controlloPraticaId = doc.get("controlloPraticaId");
if (Validator.isNotNull(controlloPraticaId)) {
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil
.fetchControlloPratica(GetterUtil.getLong(controlloPraticaId));
if (Validator.isNotNull(controlloPratica)) {
lista.add(controlloPratica);
}
}
}
} catch (ParseException | SearchException | SystemException | java.text.ParseException e) {
_log.error(e, e);
}
return lista;
}
public static List<ControlloPratica> searchTaskPerEsportazionePO(HttpServletRequest request, User user, int start,
int end) {
List<ControlloPratica> lista = new ArrayList<ControlloPratica>();
SearchContext searchContext = SearchContextFactory.getInstance(request);
searchContext.setKeywords(OVERRIDE_KEYWORDS.toString());
int maxEnd = GetterUtil.getInteger(PropsUtil.get(PropsKeys.INDEX_FILTER_SEARCH_LIMIT));
searchContext.setStart(0);
searchContext.setEnd(maxEnd);
searchContext.setAttribute("paginationType", "none");
// Gestione Ordinamento
searchContext.setSorts(getOrderedQuery(request));
Hits hits = null;
try {
TermQuery entryClassNameTermQuery = TermQueryFactoryUtil.create(searchContext, "entryClassName",
ControlloPratica.class.getName());
TermQuery userIdTermQuery = TermQueryFactoryUtil.create(searchContext, "taskAssigneeUserId",
user.getUserId());
TermQuery statusTermQuery = TermQueryFactoryUtil.create(searchContext, "status",
WorkflowConstants.STATUS_PENDING);
BooleanQuery booleanQuery = BooleanQueryFactoryUtil.create(searchContext);
booleanQuery.add(entryClassNameTermQuery, BooleanClauseOccur.MUST);
booleanQuery.add(userIdTermQuery, BooleanClauseOccur.MUST);
booleanQuery.add(statusTermQuery, BooleanClauseOccur.MUST);
String dataDa = ParamUtil.getString(request, "dataRichiestaInizio");
String dataAl = ParamUtil.getString(request, "dataRichiestaFine");
if (Validator.isNotNull(dataDa) || Validator.isNotNull(dataAl)) {
if (Validator.isNull(dataDa)) {
dataDa = "00000000";
} else {
dataDa = DATE_FORMAT_LUCENE.format(DATE_FORMAT_STRING.parse(dataDa));
}
if (Validator.isNull(dataAl)) {
dataAl = DATE_FORMAT_LUCENE.format(new Date());
} else {
dataAl = DATE_FORMAT_LUCENE.format(DATE_FORMAT_STRING.parse(dataAl));
}
TermRangeQuery dateSearchTermRangeQuery = TermRangeQueryFactoryUtil.create(searchContext,
"dataInizioProcedimento", dataDa, dataAl, true, true);
booleanQuery.add(dateSearchTermRangeQuery, BooleanClauseOccur.MUST);
}
if (_log.isDebugEnabled()) {
_log.debug("User " + user.getScreenName() + " Request query : " + booleanQuery.toString());
}
hits = SearchEngineUtil.search(searchContext, booleanQuery);
if (_log.isDebugEnabled()) {
_log.debug("Number of hint find : " + hits.getLength());
}
for (Document doc : hits.toList()) {
String controlloPraticaId = doc.get("controlloPraticaId");
if (Validator.isNotNull(controlloPraticaId)) {
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil
.fetchControlloPratica(GetterUtil.getLong(controlloPraticaId));
if (Validator.isNotNull(controlloPratica)) {
lista.add(controlloPratica);
}
}
}
} catch (ParseException | SearchException | SystemException | java.text.ParseException e) {
_log.error(e, e);
}
return lista;
}
public static Hits searchTaskConclusi(HttpServletRequest request, User user, int start, int end) {
SearchContext searchContext = SearchContextFactory.getInstance(request);
searchContext.setKeywords(OVERRIDE_KEYWORDS.toString());
if (ParamUtil.getBoolean(request, "searchForExport", false)) {
int maxEnd = GetterUtil.getInteger(PropsUtil.get(PropsKeys.INDEX_FILTER_SEARCH_LIMIT));
searchContext.setStart(0);
searchContext.setEnd(maxEnd);
searchContext.setAttribute("paginationType", "none");
} else {
searchContext.setAttribute("paginationType", "more");
searchContext.setStart(start);
searchContext.setEnd(end);
}
// Gestione Ordinamento
searchContext.setSorts(getOrderedQuery(request));
Hits hits = null;
try {
// Condizioni necessarie per questa ricerca: entryClassName=ControlloPratica & roleIds non e tra i
// taskAssigneeIds userId non e tra taskAssigneeId
TermQuery entryClassNameTermQuery = TermQueryFactoryUtil.create(searchContext, "entryClassName",
ControlloPratica.class.getName());
BooleanQuery booleanQueryRoleIds = BooleanQueryFactoryUtil.create(searchContext);
List<Organization> organizationUserList = OrganizationLocalServiceUtil.getUserOrganizations(user
.getUserId());
List<Role> organizationRoleList = null;
for (Organization org : organizationUserList) {
organizationRoleList = RoleLocalServiceUtil.getUserGroupRoles(user.getUserId(), org.getGroupId());
for (Role role : organizationRoleList) {
TermQuery roleIdTerm = TermQueryFactoryUtil.create(searchContext, "taskAssigneeRoleIds",
(role.getRoleId() + StringPool.DASH + org.getGroupId()));
booleanQueryRoleIds.add(roleIdTerm, BooleanClauseOccur.SHOULD);
}
}
BooleanQuery booleanQueryStatus = BooleanQueryFactoryUtil.create(searchContext);
TermQuery statusDenied = TermQueryFactoryUtil.create(searchContext, "status",
WorkflowConstants.STATUS_DENIED);
booleanQueryStatus.add(statusDenied, BooleanClauseOccur.SHOULD);
TermQuery statusApproved = TermQueryFactoryUtil.create(searchContext, "status",
WorkflowConstants.STATUS_APPROVED);
booleanQueryStatus.add(statusApproved, BooleanClauseOccur.SHOULD);
TermQuery statusIncomplete = TermQueryFactoryUtil.create(searchContext, "status",
WorkflowConstants.STATUS_INCOMPLETE);
booleanQueryStatus.add(statusIncomplete, BooleanClauseOccur.SHOULD);
BooleanQuery booleanQuery = BooleanQueryFactoryUtil.create(searchContext);
booleanQuery.add(entryClassNameTermQuery, BooleanClauseOccur.MUST);
if (organizationUserList != null && !organizationUserList.isEmpty() && organizationRoleList != null
&& !organizationRoleList.isEmpty()) {
booleanQuery.add(booleanQueryRoleIds, BooleanClauseOccur.MUST_NOT);
}
booleanQuery.add(booleanQueryStatus, BooleanClauseOccur.MUST);
// Ricavo i groupId relativi all utente che effettua la ricerca per filtrare
List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId());
BooleanQuery groupIdsQuery = BooleanQueryFactoryUtil.create(searchContext);
if (Validator.isNotNull(organizationList) && !organizationList.isEmpty()) {
for (Organization org : organizationList) {
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "groupId",
org.getGroupId());
groupIdsQuery.add(singleGroupIdQuery, BooleanClauseOccur.SHOULD);
}
booleanQuery.add(groupIdsQuery, BooleanClauseOccur.MUST);
} else {
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "groupId", 0L);
booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST);
}
// Condizioni aggiuntive
retrieveQuery(request, user, booleanQuery, searchContext);
if (_log.isDebugEnabled()) {
_log.debug("User " + user.getScreenName() + " Request query : " + booleanQuery.toString());
}
hits = SearchEngineUtil.search(searchContext, booleanQuery);
if (_log.isDebugEnabled()) {
_log.debug("Number of hint find : " + hits.getLength());
}
} catch (ParseException | SearchException | SystemException e) {
_log.error(e, e);
}
return hits;
}
private static void retrieveQuery(HttpServletRequest request, User user, BooleanQuery booleanQuery,
SearchContext searchContext) {
// Search Param
String numeroProgettoSearch = ParamUtil.getString(request, "numeroProgetto");
String protocolloSearch = ParamUtil.getString(request, "protocollo");
String tipoPraticaSearch = ParamUtil.getString(request, "tipoPratica");
String statoPraticaSearch = ParamUtil.getString(request, "statoPratica");
String committenteSearch = ParamUtil.getString(request, "committente");
String soggettiInterconnessiSearch = ParamUtil.getString(request, "soggettiInterconnessi");
String istruttoreId = ParamUtil.getString(request, "istruttore");
String unitaOperativa = ParamUtil.getString(request, "unitaOperativa");
String dataDa = ParamUtil.getString(request, "dataRichiestaInizio");
String dataAl = ParamUtil.getString(request, "dataRichiestaFine");
String comune = ParamUtil.getString(request, "comune");
String tipoAttivita = ParamUtil.getString(request, "tipoAttivita");
Long geologi = ParamUtil.getLong(request, "geologi");
Long parereGeologo = ParamUtil.getLong(request, "parereGeologo");
// ADT - BUG-11 Aggiunta filtro ricerca
String controlloObbligatorioSearch = ParamUtil.getString(request, "controlloObbligatorio");
try {
if (Validator.isNotNull(tipoAttivita) && !tipoAttivita.equals("-1")) {
TermQuery tipoAttivitaTermQuery = TermQueryFactoryUtil.create(searchContext, "workflowState",
tipoAttivita);
booleanQuery.add(tipoAttivitaTermQuery, BooleanClauseOccur.MUST);
}
if (Validator.isNotNull(numeroProgettoSearch)) {
TermQuery numeroProgettoTermQuery = TermQueryFactoryUtil.create(searchContext, "numeroProgetto",
numeroProgettoSearch);
booleanQuery.add(numeroProgettoTermQuery, BooleanClauseOccur.MUST);
}
if (Validator.isNotNull(protocolloSearch)) {
TermQuery protocolloSearchTermQuery = TermQueryFactoryUtil.create(searchContext, "protocollo",
protocolloSearch);
booleanQuery.add(protocolloSearchTermQuery, BooleanClauseOccur.MUST);
}
if (Validator.isNotNull(tipoPraticaSearch) && !tipoPraticaSearch.equals("-1")) {
TermQuery tipoPraticaSearchTermQuery = TermQueryFactoryUtil.create(searchContext, "tipoPratica",
tipoPraticaSearch);
booleanQuery.add(tipoPraticaSearchTermQuery, BooleanClauseOccur.MUST);
}
// Gestione StatoPratica
if (Validator.isNotNull(statoPraticaSearch) && !statoPraticaSearch.equals("-1")) {
if (statoPraticaSearch.equals(StatoPraticaConstants.COLLAUDO_PARZIALE)) {
TermQuery collaudoParzialeSearchTermQuery = TermQueryFactoryUtil.create(searchContext,
"collaudoParziale", StringPool.TRUE);
booleanQuery.add(collaudoParzialeSearchTermQuery, BooleanClauseOccur.MUST);
} else if (statoPraticaSearch.equals(StatoPraticaConstants.COLLAUDO)) {
TermQuery collaudoSearchTermQuery = TermQueryFactoryUtil.create(searchContext,
"collaudoCompletato", StringPool.TRUE);
booleanQuery.add(collaudoSearchTermQuery, BooleanClauseOccur.MUST);
} else if (statoPraticaSearch.equals(StatoPraticaConstants.FINE_LAVORI)) {
TermQuery fineLavoriSearchTermQuery = TermQueryFactoryUtil.create(searchContext,
"fineLavoriCompletati", StringPool.TRUE);
booleanQuery.add(fineLavoriSearchTermQuery, BooleanClauseOccur.MUST);
} else if (statoPraticaSearch.equals(StatoPraticaConstants.FINE_LAVORI_PARZIALE)) {
TermQuery fineLavoriParzialiSearchTermQuery = TermQueryFactoryUtil.create(searchContext,
"fineLavoriParziali", StringPool.TRUE);
booleanQuery.add(fineLavoriParzialiSearchTermQuery, BooleanClauseOccur.MUST);
} else if (statoPraticaSearch.equals(StatoPraticaConstants.SOTTOPOSTA_A_PARERE)) {
TermQuery sottopostaParereSearchTermQuery = TermQueryFactoryUtil.create(searchContext,
"sottopostoAParere", StringPool.TRUE);
booleanQuery.add(sottopostaParereSearchTermQuery, BooleanClauseOccur.MUST);
} else if (statoPraticaSearch.equals(StatoPraticaConstants.VARIATA)) {
TermQuery sottopostaParereSearchTermQuery = TermQueryFactoryUtil.create(searchContext, "variata",
StringPool.TRUE);
booleanQuery.add(sottopostaParereSearchTermQuery, BooleanClauseOccur.MUST);
} else {
TermQuery statoPraticaSearchTermQuery = TermQueryFactoryUtil.create(searchContext, "statoPratica",
statoPraticaSearch);
booleanQuery.add(statoPraticaSearchTermQuery, BooleanClauseOccur.MUST);
}
}
queryTipoProcedura(request, booleanQuery, searchContext);
if (Validator.isNotNull(committenteSearch)) {
TermQuery committenteSearchTermQuery = TermQueryFactoryUtil.create(searchContext, "committenti",
committenteSearch.toUpperCase());
booleanQuery.add(committenteSearchTermQuery, BooleanClauseOccur.MUST);
}
if (Validator.isNotNull(soggettiInterconnessiSearch)) {
TermQuery soggettiInterconnessiSearchTermQuery = TermQueryFactoryUtil.create(searchContext,
"soggettiInterconnessi", soggettiInterconnessiSearch.toUpperCase());
booleanQuery.add(soggettiInterconnessiSearchTermQuery, BooleanClauseOccur.MUST);
}
if (Validator.isNotNull(istruttoreId) && !istruttoreId.equals("-1") && !istruttoreId.equals("0")) {
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "istruttoreUserId",
istruttoreId);
booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST);
}
if (Validator.isNotNull(geologi) && !geologi.equals(-1L) && !geologi.equals(0L)) {
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "geologi", geologi);
booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST);
}
if (Validator.isNotNull(parereGeologo) && !parereGeologo.equals(-1L)) {
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "parereGeologo",
parereGeologo);
booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST);
}
if (Validator.isNotNull(unitaOperativa) && !unitaOperativa.equals("-1")) {
TermQuery uoQuery = TermQueryFactoryUtil.create(searchContext, "unitaOperativa", unitaOperativa);
booleanQuery.add(uoQuery, BooleanClauseOccur.MUST);
}
if (Validator.isNotNull(dataDa) && Validator.isNotNull(dataAl)) {
Date dataDaApp = DATE_FORMAT_STRING.parse(dataDa);
Date dataAlApp = DATE_FORMAT_STRING.parse(dataAl);
TermRangeQuery dateSearchTermRangeQuery = TermRangeQueryFactoryUtil.create(searchContext,
"dataInizioProcedimento", DATE_FORMAT_LUCENE.format(dataDaApp),
DATE_FORMAT_LUCENE.format(dataAlApp), true, true);
booleanQuery.add(dateSearchTermRangeQuery, BooleanClauseOccur.MUST);
} else if (Validator.isNull(dataDa) && Validator.isNotNull(dataAl)) {
Date dataAlApp = DATE_FORMAT_STRING.parse(dataAl);
TermRangeQuery dateSearchTermRangeQuery = TermRangeQueryFactoryUtil.create(searchContext,
"dataInizioProcedimento", "00000000", DATE_FORMAT_LUCENE.format(dataAlApp), true, true);
booleanQuery.add(dateSearchTermRangeQuery, BooleanClauseOccur.MUST);
} else if (Validator.isNotNull(dataDa) && Validator.isNull(dataAl)) {
Date dataDaApp = DATE_FORMAT_STRING.parse(dataDa);
TermRangeQuery dateSearchTermRangeQuery = TermRangeQueryFactoryUtil.create(searchContext,
"dataInizioProcedimento", DATE_FORMAT_LUCENE.format(dataDaApp),
DATE_FORMAT_LUCENE.format(new Date()), true, true);
booleanQuery.add(dateSearchTermRangeQuery, BooleanClauseOccur.MUST);
}
if (Validator.isNotNull(comune) && !comune.equals("-1")) {
TermQuery comuneTermQuery = TermQueryFactoryUtil.create(searchContext, "comuneId", comune);
booleanQuery.add(comuneTermQuery, BooleanClauseOccur.MUST);
}
// ADT - BUG-11 Aggiunta filtro ricerca
if (Validator.isNotNull(controlloObbligatorioSearch)) {
TermQuery controlloObbligatorioTermQuery = TermQueryFactoryUtil.create(searchContext,
"controlloObbligatorio", controlloObbligatorioSearch);
booleanQuery.add(controlloObbligatorioTermQuery, BooleanClauseOccur.MUST);
}
} catch (ParseException | java.text.ParseException e) {
_log.error(e, e);
}
}
private static void queryTipoProcedura(HttpServletRequest request, BooleanQuery booleanQuery,
SearchContext searchContext) throws ParseException {
String tipoProcedura = ParamUtil.getString(request, PortosIndexField.TIPO_PROCEDURA);
if (Validator.isNotNull(tipoProcedura) && !tipoProcedura.equals("-1")) {
String[] procSplit = StringUtils.split(tipoProcedura, "|");
if (procSplit.length > 0) {
for (String proc : procSplit) {
BooleanQuery bq = BooleanQueryFactoryUtil.create(searchContext);
TermQuery termQuery = TermQueryFactoryUtil.create(searchContext, PortosIndexField.TIPO_PROCEDURA,
proc);
bq.add(termQuery, BooleanClauseOccur.SHOULD);
booleanQuery.add(bq, BooleanClauseOccur.MUST);
}
}
}
}
private static Sort[] getOrderedQuery(HttpServletRequest request) {
Properties properties = PropsUtil.getProperties("elasticsearch.", true);
String orderField = ParamUtil.getString(request, "ordinaPer", "numeroProgetto");
String orderType = ParamUtil.getString(request, "ordinaTipo", "desc");
List<Sort> sortes = new ArrayList<Sort>();
Sort sort = new Sort();
if (Validator.isNotNull(orderField) && !orderField.equals("-1")) {
if (properties.size() > 0) {
sort.setFieldName(orderField + "_sortable");
} else {
sort.setFieldName(orderField);
}
if (orderField.equals("numeroProgetto")) {
sort.setType(Sort.INT_TYPE);
} else if (orderField.equals(PortosIndexField.PROTOCOLLO)) {
sort.setType(Sort.INT_TYPE);
} else if (orderField.equals("dtPratica") ||
orderField.equals("dataCreazione") ||
orderField.equals("createDate")
) {
sort.setType(Sort.LONG_TYPE);
}
}
if (Validator.isNotNull(orderType) && !orderType.equals("-1")) {
if (orderType.equals("asc")) {
sort.setReverse(false);
} else {
sort.setReverse(true);
}
}
sortes.add(sort);
return sortes.toArray(new Sort[0]);
}
}

478
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/search/ControlloPraticaSearch.java

@ -0,0 +1,478 @@
package it.mwg.sismica.bo.search;
import it.mwg.sismica.bo.shared.util.IndexField;
import it.mwg.sismica.bo.shared.util.UserUtil;
import it.mwg.sismica.bo.shared.util.WorkflowConstants;
import it.tref.liferay.portos.bo.model.ControlloPratica;
import it.tref.liferay.portos.bo.service.ControlloPraticaLocalServiceUtil;
import java.text.DateFormat;
import java.text.Format;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Set;
import javax.servlet.http.HttpServletRequest;
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.search.BooleanClauseOccur;
import com.liferay.portal.kernel.search.BooleanQuery;
import com.liferay.portal.kernel.search.BooleanQueryFactoryUtil;
import com.liferay.portal.kernel.search.Document;
import com.liferay.portal.kernel.search.Field;
import com.liferay.portal.kernel.search.Hits;
import com.liferay.portal.kernel.search.ParseException;
import com.liferay.portal.kernel.search.SearchContext;
import com.liferay.portal.kernel.search.SearchContextFactory;
import com.liferay.portal.kernel.search.SearchEngineUtil;
import com.liferay.portal.kernel.search.SearchException;
import com.liferay.portal.kernel.search.TermQuery;
import com.liferay.portal.kernel.search.TermQueryFactoryUtil;
import com.liferay.portal.kernel.search.TermRangeQuery;
import com.liferay.portal.kernel.search.TermRangeQueryFactoryUtil;
import com.liferay.portal.kernel.util.FastDateFormatFactoryUtil;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.ParamUtil;
import com.liferay.portal.kernel.util.PropsKeys;
import com.liferay.portal.kernel.util.PropsUtil;
import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.model.Organization;
import com.liferay.portal.model.Role;
import com.liferay.portal.model.User;
import com.liferay.portal.service.OrganizationLocalServiceUtil;
import com.liferay.portal.service.RoleLocalServiceUtil;
public class ControlloPraticaSearch extends BaseSearch {
private static final Log _log = LogFactoryUtil.getLog(ControlloPraticaSearch.class);
public static final Format DATE_FORMAT_LUCENE = FastDateFormatFactoryUtil.getSimpleDateFormat("yyyyMMdd");
public static final DateFormat DATE_FORMAT_STRING = new SimpleDateFormat("dd/MM/yyyy");
public static Hits searchMieiTask(HttpServletRequest request, User user, int start, int end) {
SearchContext searchContext = SearchContextFactory.getInstance(request);
if (ParamUtil.getBoolean(request, "searchForExport", false)) {
int maxEnd = GetterUtil.getInteger(PropsUtil.get(PropsKeys.INDEX_FILTER_SEARCH_LIMIT));
searchContext.setStart(0);
searchContext.setEnd(maxEnd);
searchContext.setAttribute("paginationType", "none");
} else {
searchContext.setAttribute("paginationType", "more");
searchContext.setStart(start);
searchContext.setEnd(end);
}
// Gestione Ordinamento
searchContext.setSorts(getOrderedQuery(request));
Hits hits = null;
try {
// Condizioni necessarie per questa ricerca : entryClassName=ControlloPratica & userId=taskAssigneeUserId
BooleanQuery query = BooleanQueryFactoryUtil.create(searchContext);
TermQuery term = TermQueryFactoryUtil.create(searchContext, Field.ENTRY_CLASS_NAME,
ControlloPratica.class.getName());
query.add(term, BooleanClauseOccur.MUST);
term = TermQueryFactoryUtil.create(searchContext, IndexField.TASK_ASSIGNEE_USER_ID, user.getUserId());
query.add(term, BooleanClauseOccur.MUST);
term = TermQueryFactoryUtil.create(searchContext, IndexField.STATUS, WorkflowConstants.STATUS_PENDING);
query.add(term, BooleanClauseOccur.MUST);
// Ricavo i groupId relativi all utente che effettua la ricerca per filtrare
List<Organization> orgs = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId());
BooleanQuery groupQuery = BooleanQueryFactoryUtil.create(searchContext);
if (Validator.isNotNull(orgs) && !orgs.isEmpty()) {
for (Organization org : orgs) {
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "groupId",
org.getGroupId());
groupQuery.add(singleGroupIdQuery, BooleanClauseOccur.SHOULD);
}
query.add(groupQuery, BooleanClauseOccur.MUST);
} else {
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "groupId", 0L);
query.add(singleGroupIdQuery, BooleanClauseOccur.MUST);
}
// Condizioni aggiuntive
query(request, user, query, searchContext);
if (_log.isDebugEnabled()) {
_log.debug("User " + user.getScreenName() + " Request query : " + query.toString());
}
hits = SearchEngineUtil.search(searchContext, query);
if (_log.isDebugEnabled()) {
_log.debug("Number of hint find : " + hits.getLength());
}
} catch (ParseException | SearchException | SystemException e) {
_log.error(e, e);
}
return hits;
}
public static Hits searchTaskMieiRuoli(HttpServletRequest request, User user, int start, int end) {
SearchContext searchContext = SearchContextFactory.getInstance(request);
if (ParamUtil.getBoolean(request, "searchForExport", false)) {
int maxEnd = GetterUtil.getInteger(PropsUtil.get(PropsKeys.INDEX_FILTER_SEARCH_LIMIT));
searchContext.setStart(0);
searchContext.setEnd(maxEnd);
searchContext.setAttribute("paginationType", "none");
} else {
searchContext.setAttribute("paginationType", "more");
searchContext.setStart(start);
searchContext.setEnd(end);
}
// Gestione Ordinamento
searchContext.setSorts(getOrderedQuery(request));
Hits hits = null;
try {
// Condizioni necessarie per questa ricerca: entryClassName=ControlloPratica & roleIds tra i taskAssigneeIds
TermQuery entryClassNameTermQuery = TermQueryFactoryUtil.create(searchContext, Field.ENTRY_CLASS_NAME,
ControlloPratica.class.getName());
TermQuery statusTermQuery = TermQueryFactoryUtil.create(searchContext, IndexField.STATUS,
WorkflowConstants.STATUS_PENDING);
BooleanQuery booleanQueryRoleIds = BooleanQueryFactoryUtil.create(searchContext);
List<Organization> organizationUserList = OrganizationLocalServiceUtil.getUserOrganizations(user
.getUserId());
List<Role> organizationRoleList = null;
for (Organization org : organizationUserList) {
organizationRoleList = RoleLocalServiceUtil.getUserGroupRoles(user.getUserId(), org.getGroupId());
for (Role role : organizationRoleList) {
TermQuery roleIdTerm = TermQueryFactoryUtil.create(searchContext,
IndexField.TASK_ASSIGNEE_ROLE_IDS, "R" + role.getRoleId() + "G" + org.getGroupId());
booleanQueryRoleIds.add(roleIdTerm, BooleanClauseOccur.SHOULD);
}
}
BooleanQuery query = BooleanQueryFactoryUtil.create(searchContext);
query.add(entryClassNameTermQuery, BooleanClauseOccur.MUST);
if (organizationUserList != null && !organizationUserList.isEmpty() && organizationRoleList != null
&& !organizationRoleList.isEmpty()) {
query.add(booleanQueryRoleIds, BooleanClauseOccur.MUST);
} else {
TermQuery roleIdTerm = TermQueryFactoryUtil.create(searchContext, IndexField.TASK_ASSIGNEE_ROLE_IDS,
"R0G0");
booleanQueryRoleIds.add(roleIdTerm, BooleanClauseOccur.SHOULD);
query.add(booleanQueryRoleIds, BooleanClauseOccur.MUST);
}
query.add(statusTermQuery, BooleanClauseOccur.MUST);
// Ricavo i groupId relativi all utente che effettua la ricerca per filtrare
long ufficio = ParamUtil.getLong(request, "ufficio");
if (ufficio != 0 && ufficio != -1) {
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "groupId", ufficio);
query.add(singleGroupIdQuery, BooleanClauseOccur.MUST);
} else {
List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user
.getUserId());
BooleanQuery groupIdsQuery = BooleanQueryFactoryUtil.create(searchContext);
if (Validator.isNotNull(organizationList) && !organizationList.isEmpty()) {
for (Organization org : organizationList) {
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "groupId",
org.getGroupId());
groupIdsQuery.add(singleGroupIdQuery, BooleanClauseOccur.SHOULD);
}
query.add(groupIdsQuery, BooleanClauseOccur.MUST);
} else {
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "groupId", 0L);
query.add(singleGroupIdQuery, BooleanClauseOccur.MUST);
}
}
Set<Integer> uos = UserUtil.getUnitaOperative(user);
if ((uos.size() > 0) && !uos.contains(0)) {
BooleanQuery uoQuery = BooleanQueryFactoryUtil.create(searchContext);
for (int uo : uos) {
TermQuery tq = TermQueryFactoryUtil.create(searchContext, IndexField.UNITA_OPERATIVA, uo);
uoQuery.add(tq, BooleanClauseOccur.SHOULD);
}
query.add(uoQuery, BooleanClauseOccur.MUST);
}
// Condizioni aggiuntive
query(request, user, query, searchContext);
if (_log.isDebugEnabled()) {
_log.debug("User " + user.getScreenName() + " Request query : " + query.toString());
}
hits = SearchEngineUtil.search(searchContext, query);
if (_log.isDebugEnabled()) {
_log.debug("Number of hint find : " + hits.getLength());
}
} catch (ParseException | SearchException | SystemException e) {
_log.error(e, e);
}
return hits;
}
public static Hits searchAltriTask(HttpServletRequest request, User user, int start, int end) {
SearchContext searchContext = SearchContextFactory.getInstance(request);
boolean searchForExport = ParamUtil.getBoolean(request, "searchForExport", false);
if (searchForExport) {
int maxEnd = GetterUtil.getInteger(PropsUtil.get(PropsKeys.INDEX_FILTER_SEARCH_LIMIT));
searchContext.setStart(0);
searchContext.setEnd(maxEnd);
searchContext.setAttribute("paginationType", "none");
} else {
searchContext.setAttribute("paginationType", "more");
searchContext.setStart(start);
searchContext.setEnd(end);
}
// Gestione Ordinamento
searchContext.setSorts(getOrderedQuery(request));
Hits hits = null;
try {
BooleanQuery query = BooleanQueryFactoryUtil.create(searchContext);
// Condizioni necessarie per questa ricerca: entryClassName=ControlloPratica & roleIds non e tra i
// taskAssigneeIds userId non e tra taskAssigneeId
TermQuery term = TermQueryFactoryUtil.create(searchContext, Field.ENTRY_CLASS_NAME,
ControlloPratica.class.getName());
query.add(term, BooleanClauseOccur.MUST);
term = TermQueryFactoryUtil.create(searchContext, IndexField.TASK_ASSIGNEE_USER_ID, user.getUserId());
query.add(term, BooleanClauseOccur.MUST_NOT);
BooleanQuery subQuery = BooleanQueryFactoryUtil.create(searchContext);
List<Organization> orgs = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId());
List<Role> roles = null;
for (Organization org : orgs) {
roles = RoleLocalServiceUtil.getUserGroupRoles(user.getUserId(), org.getGroupId());
for (Role role : roles) {
term = TermQueryFactoryUtil.create(searchContext, IndexField.TASK_ASSIGNEE_ROLE_IDS,
"R" + role.getRoleId() + "G" + org.getGroupId());
subQuery.add(term, BooleanClauseOccur.SHOULD);
}
}
if (subQuery.clauses().size() > 0) {
query.add(subQuery, BooleanClauseOccur.MUST_NOT);
}
term = TermQueryFactoryUtil.create(searchContext, IndexField.STATUS, WorkflowConstants.STATUS_PENDING);
query.add(term, BooleanClauseOccur.MUST);
// Ricavo i groupId relativi all utente che effettua la ricerca per filtrare
orgs = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId());
subQuery = BooleanQueryFactoryUtil.create(searchContext);
if (Validator.isNull(orgs)) {
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, Field.GROUP_ID, 0L);
query.add(singleGroupIdQuery, BooleanClauseOccur.MUST);
} else {
for (Organization org : orgs) {
term = TermQueryFactoryUtil.create(searchContext, Field.GROUP_ID, org.getGroupId());
subQuery.add(term, BooleanClauseOccur.SHOULD);
}
query.add(subQuery, BooleanClauseOccur.MUST);
}
// Condizioni aggiuntive
query(request, user, query, searchContext);
if (_log.isDebugEnabled()) {
_log.debug("User " + user.getScreenName() + " Request query : " + query.toString());
}
hits = SearchEngineUtil.search(searchContext, query);
if (_log.isDebugEnabled()) {
_log.debug("Number of hint find : " + hits.getLength());
}
} catch (ParseException | SearchException | SystemException e) {
_log.error(e, e);
}
return hits;
}
public static List<ControlloPratica> searchTaskPerEsportazioneDirigente(HttpServletRequest request, User user,
int start, int end) {
List<ControlloPratica> lista = new ArrayList<ControlloPratica>();
SearchContext searchContext = SearchContextFactory.getInstance(request);
int maxEnd = GetterUtil.getInteger(PropsUtil.get(PropsKeys.INDEX_FILTER_SEARCH_LIMIT));
searchContext.setStart(0);
searchContext.setEnd(maxEnd);
searchContext.setAttribute("paginationType", "none");
// Gestione Ordinamento
searchContext.setSorts(getOrderedQuery(request));
Hits hits = null;
try {
TermQuery entryClassNameTermQuery = TermQueryFactoryUtil.create(searchContext, "entryClassName",
ControlloPratica.class.getName());
TermQuery statusTermQuery = TermQueryFactoryUtil.create(searchContext, IndexField.STATUS,
WorkflowConstants.STATUS_PENDING);
BooleanQuery booleanQuery = BooleanQueryFactoryUtil.create(searchContext);
booleanQuery.add(entryClassNameTermQuery, BooleanClauseOccur.MUST);
booleanQuery.add(statusTermQuery, BooleanClauseOccur.MUST);
String dataDa = ParamUtil.getString(request, "dataRichiestaInizio");
String dataAl = ParamUtil.getString(request, "dataRichiestaFine");
if (Validator.isNotNull(dataDa) || Validator.isNotNull(dataAl)) {
if (Validator.isNull(dataDa)) {
dataDa = "00000000";
} else {
dataDa = DATE_FORMAT_LUCENE.format(DATE_FORMAT_STRING.parse(dataDa));
}
if (Validator.isNull(dataAl)) {
dataAl = DATE_FORMAT_LUCENE.format(new Date());
} else {
dataAl = DATE_FORMAT_LUCENE.format(DATE_FORMAT_STRING.parse(dataAl));
}
TermRangeQuery dateSearchTermRangeQuery = TermRangeQueryFactoryUtil.create(searchContext,
"dataInizioProcedimento", dataDa, dataAl, true, true);
booleanQuery.add(dateSearchTermRangeQuery, BooleanClauseOccur.MUST);
}
if (_log.isDebugEnabled()) {
_log.debug("User " + user.getScreenName() + " Request query : " + booleanQuery.toString());
}
hits = SearchEngineUtil.search(searchContext, booleanQuery);
if (_log.isDebugEnabled()) {
_log.debug("Number of hints found : " + hits.getLength());
}
for (Document doc : hits.toList()) {
String controlloPraticaId = doc.get("controlloPraticaId");
if (Validator.isNotNull(controlloPraticaId)) {
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil
.fetchControlloPratica(GetterUtil.getLong(controlloPraticaId));
if (Validator.isNotNull(controlloPratica)) {
lista.add(controlloPratica);
}
}
}
} catch (ParseException | SearchException | SystemException | java.text.ParseException e) {
_log.error(e, e);
}
return lista;
}
public static List<ControlloPratica> searchTaskPerEsportazionePO(HttpServletRequest request, User user, int start,
int end) {
List<ControlloPratica> lista = new ArrayList<ControlloPratica>();
SearchContext searchContext = SearchContextFactory.getInstance(request);
int maxEnd = GetterUtil.getInteger(PropsUtil.get(PropsKeys.INDEX_FILTER_SEARCH_LIMIT));
searchContext.setStart(0);
searchContext.setEnd(maxEnd);
searchContext.setAttribute("paginationType", "none");
// Gestione Ordinamento
searchContext.setSorts(getOrderedQuery(request));
Hits hits = null;
try {
TermQuery entryClassNameTermQuery = TermQueryFactoryUtil.create(searchContext, "entryClassName",
ControlloPratica.class.getName());
TermQuery userIdTermQuery = TermQueryFactoryUtil.create(searchContext, "taskAssigneeUserId",
user.getUserId());
TermQuery statusTermQuery = TermQueryFactoryUtil.create(searchContext, IndexField.STATUS,
WorkflowConstants.STATUS_PENDING);
BooleanQuery booleanQuery = BooleanQueryFactoryUtil.create(searchContext);
booleanQuery.add(entryClassNameTermQuery, BooleanClauseOccur.MUST);
booleanQuery.add(userIdTermQuery, BooleanClauseOccur.MUST);
booleanQuery.add(statusTermQuery, BooleanClauseOccur.MUST);
String dataDa = ParamUtil.getString(request, "dataRichiestaInizio");
String dataAl = ParamUtil.getString(request, "dataRichiestaFine");
if (Validator.isNotNull(dataDa) || Validator.isNotNull(dataAl)) {
if (Validator.isNull(dataDa)) {
dataDa = "00000000";
} else {
dataDa = DATE_FORMAT_LUCENE.format(DATE_FORMAT_STRING.parse(dataDa));
}
if (Validator.isNull(dataAl)) {
dataAl = DATE_FORMAT_LUCENE.format(new Date());
} else {
dataAl = DATE_FORMAT_LUCENE.format(DATE_FORMAT_STRING.parse(dataAl));
}
TermRangeQuery dateSearchTermRangeQuery = TermRangeQueryFactoryUtil.create(searchContext,
"dataInizioProcedimento", dataDa, dataAl, true, true);
booleanQuery.add(dateSearchTermRangeQuery, BooleanClauseOccur.MUST);
}
if (_log.isDebugEnabled()) {
_log.debug("User " + user.getScreenName() + " Request query : " + booleanQuery.toString());
}
hits = SearchEngineUtil.search(searchContext, booleanQuery);
if (_log.isDebugEnabled()) {
_log.debug("Number of hint find : " + hits.getLength());
}
for (Document doc : hits.toList()) {
String controlloPraticaId = doc.get("controlloPraticaId");
if (Validator.isNotNull(controlloPraticaId)) {
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil
.fetchControlloPratica(GetterUtil.getLong(controlloPraticaId));
if (Validator.isNotNull(controlloPratica)) {
lista.add(controlloPratica);
}
}
}
} catch (ParseException | SearchException | SystemException | java.text.ParseException e) {
_log.error(e, e);
}
return lista;
}
public static Hits searchTaskConclusi(HttpServletRequest request, User user, int start, int end) {
SearchContext searchContext = SearchContextFactory.getInstance(request);
if (ParamUtil.getBoolean(request, "searchForExport", false)) {
int maxEnd = GetterUtil.getInteger(PropsUtil.get(PropsKeys.INDEX_FILTER_SEARCH_LIMIT));
searchContext.setStart(0);
searchContext.setEnd(maxEnd);
searchContext.setAttribute("paginationType", "none");
} else {
searchContext.setAttribute("paginationType", "more");
searchContext.setStart(start);
searchContext.setEnd(end);
}
// Gestione Ordinamento
searchContext.setSorts(getOrderedQuery(request));
Hits hits = null;
try {
// Condizioni necessarie per questa ricerca: entryClassName=ControlloPratica & roleIds non e tra i
// taskAssigneeIds userId non e tra taskAssigneeId
BooleanQuery query = BooleanQueryFactoryUtil.create(searchContext);
TermQuery term = TermQueryFactoryUtil.create(searchContext, Field.ENTRY_CLASS_NAME,
ControlloPratica.class.getName());
query.add(term, BooleanClauseOccur.MUST);
BooleanQuery subQuery = BooleanQueryFactoryUtil.create(searchContext);
List<Organization> orgs = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId());
List<Role> roles = null;
for (Organization org : orgs) {
roles = RoleLocalServiceUtil.getUserGroupRoles(user.getUserId(), org.getGroupId());
for (Role role : roles) {
term = TermQueryFactoryUtil.create(searchContext, IndexField.TASK_ASSIGNEE_ROLE_IDS,
"R" + role.getRoleId() + "G" + org.getGroupId());
subQuery.add(term, BooleanClauseOccur.SHOULD);
}
}
if (Validator.isNotNull(roles)) {
query.add(subQuery, BooleanClauseOccur.MUST_NOT);
}
subQuery = BooleanQueryFactoryUtil.create(searchContext);
term = TermQueryFactoryUtil.create(searchContext, IndexField.STATUS, WorkflowConstants.STATUS_DENIED);
subQuery.add(term, BooleanClauseOccur.SHOULD);
term = TermQueryFactoryUtil.create(searchContext, IndexField.STATUS, WorkflowConstants.STATUS_APPROVED);
subQuery.add(term, BooleanClauseOccur.SHOULD);
term = TermQueryFactoryUtil.create(searchContext, IndexField.STATUS, WorkflowConstants.STATUS_INCOMPLETE);
subQuery.add(term, BooleanClauseOccur.SHOULD);
query.add(subQuery, BooleanClauseOccur.MUST);
// Ricavo i groupId relativi all utente che effettua la ricerca per filtrare
orgs = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId());
subQuery = BooleanQueryFactoryUtil.create(searchContext);
if (Validator.isNotNull(orgs) && !orgs.isEmpty()) {
for (Organization org : orgs) {
term = TermQueryFactoryUtil.create(searchContext, "groupId", org.getGroupId());
subQuery.add(term, BooleanClauseOccur.SHOULD);
}
query.add(subQuery, BooleanClauseOccur.MUST);
} else {
term = TermQueryFactoryUtil.create(searchContext, "groupId", 0L);
query.add(term, BooleanClauseOccur.MUST);
}
// Condizioni aggiuntive
query(request, user, query, searchContext);
if (_log.isDebugEnabled()) {
_log.debug("User " + user.getScreenName() + " Request query : " + query.toString());
}
hits = SearchEngineUtil.search(searchContext, query);
if (_log.isDebugEnabled()) {
_log.debug("Number of hint find : " + hits.getLength());
}
} catch (ParseException | SearchException | SystemException e) {
_log.error(e, e);
}
return hits;
}
private static void query(HttpServletRequest request, User user, BooleanQuery query, SearchContext searchContext) {
try {
fullQuery(request, user, query, searchContext);
} catch (ParseException | java.text.ParseException e) {
_log.error(e, e);
}
}
}

583
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/search/IntPraticaAdvancedSearch.java

@ -1,583 +0,0 @@
package it.mwg.sismica.bo.search;
import it.mwg.sismica.bo.shared.util.PortosIndexField;
import it.tref.liferay.portos.bo.model.IntPratica;
import it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants;
import java.text.DateFormat;
import java.text.Format;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Properties;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang.StringUtils;
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.search.BooleanClauseOccur;
import com.liferay.portal.kernel.search.BooleanQuery;
import com.liferay.portal.kernel.search.BooleanQueryFactoryUtil;
import com.liferay.portal.kernel.search.Field;
import com.liferay.portal.kernel.search.Hits;
import com.liferay.portal.kernel.search.ParseException;
import com.liferay.portal.kernel.search.SearchContext;
import com.liferay.portal.kernel.search.SearchContextFactory;
import com.liferay.portal.kernel.search.SearchEngineUtil;
import com.liferay.portal.kernel.search.SearchException;
import com.liferay.portal.kernel.search.Sort;
import com.liferay.portal.kernel.search.TermQuery;
import com.liferay.portal.kernel.search.TermQueryFactoryUtil;
import com.liferay.portal.kernel.search.TermRangeQuery;
import com.liferay.portal.kernel.search.TermRangeQueryFactoryUtil;
import com.liferay.portal.kernel.util.FastDateFormatFactoryUtil;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.ParamUtil;
import com.liferay.portal.kernel.util.PropsKeys;
import com.liferay.portal.kernel.util.PropsUtil;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.StringUtil;
import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.model.Organization;
import com.liferay.portal.model.User;
import com.liferay.portal.service.OrganizationLocalServiceUtil;
public class IntPraticaAdvancedSearch {
private static final Log _log = LogFactoryUtil.getLog(IntPraticaAdvancedSearch.class);
public static final String[] OVERRIDE_KEYWORDS = { PortosIndexField.INT_PRATICA_ID,
PortosIndexField.NUMERO_PROGETTO, PortosIndexField.TIPO_PRATICA, PortosIndexField.STATO_PRATICA,
PortosIndexField.DATA_RICHIESTA, PortosIndexField.COMMITTENTE, PortosIndexField.SOGGETTI_INTERESSATI,
PortosIndexField.STATUS, Field.ENTRY_CLASS_NAME, Field.USER_ID, PortosIndexField.DESC_INTERVENTO,
PortosIndexField.TIPO_PROCEDURA };
public static final Format DATE_FORMAT_LUCENE = FastDateFormatFactoryUtil.getSimpleDateFormat("yyyyMMdd");
public static final DateFormat DATE_FORMAT_STRING = new SimpleDateFormat("dd/MM/yyyy");
public static Hits searchMieiProgetti(HttpServletRequest request, User user, int start, int end) {
SearchContext searchContext = SearchContextFactory.getInstance(request);
searchContext.setKeywords(OVERRIDE_KEYWORDS.toString());
searchContext.setAttribute("paginationType", "more");
searchContext.setStart(start);
searchContext.setEnd(end);
// Gestione Ordinamento
searchContext.setSorts(getOrderedQuery(request));
Hits hits = null;
try {
BooleanQuery booleanQuery = BooleanQueryFactoryUtil.create(searchContext);
// Condizioni necessarie per questa ricerca: entryClassName=IntPratica & userId=userId e stato!=chiuso ??
TermQuery termQuery = TermQueryFactoryUtil.create(searchContext, Field.ENTRY_CLASS_NAME,
IntPratica.class.getName());
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
termQuery = TermQueryFactoryUtil.create(searchContext, Field.USER_ID, user.getUserId());
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
termQuery = TermQueryFactoryUtil.create(searchContext, PortosIndexField.PRATICA_APERTA, StringPool.TRUE);
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
termQuery = TermQueryFactoryUtil.create(searchContext, PortosIndexField.IN_LAVORAZIONE_SUE, StringPool.FALSE);
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
// Condizioni aggiuntive
query(request, user, booleanQuery, searchContext);
hits = SearchEngineUtil.search(searchContext, booleanQuery);
logResults(user, booleanQuery, hits);
} catch (SearchException | ParseException e) {
_log.error(e, e);
}
return hits;
}
public static Hits searchAltriProgetti(HttpServletRequest request, User user, int start, int end) {
SearchContext searchContext = SearchContextFactory.getInstance(request);
searchContext.setKeywords(OVERRIDE_KEYWORDS.toString());
searchContext.setAttribute("paginationType", "more");
searchContext.setStart(start);
searchContext.setEnd(end);
// Gestione Ordinamento
searchContext.setSorts(getOrderedQuery(request));
Hits hits = null;
try {
BooleanQuery booleanQuery = BooleanQueryFactoryUtil.create(searchContext);
// Condizioni necessarie per questa ricerca: entryClassName=IntPratica & soggettiInteressati=userScreenName
// e userId!=myUserId e stato!=chiuso ??
TermQuery termQuery = TermQueryFactoryUtil.create(searchContext, Field.ENTRY_CLASS_NAME,
IntPratica.class.getName());
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
termQuery = TermQueryFactoryUtil.create(searchContext, PortosIndexField.SOGGETTI_INTERESSATI, user
.getScreenName().toUpperCase());
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
termQuery = TermQueryFactoryUtil.create(searchContext, PortosIndexField.PRATICA_APERTA, StringPool.TRUE);
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
termQuery = TermQueryFactoryUtil.create(searchContext, PortosIndexField.IN_LAVORAZIONE_SUE, StringPool.FALSE);
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
// Condizioni aggiuntive
query(request, user, booleanQuery, searchContext);
hits = SearchEngineUtil.search(searchContext, booleanQuery);
logResults(user, booleanQuery, hits);
} catch (ParseException | SearchException e) {
_log.error(e, e);
}
return hits;
}
public static Hits searchArchivioProgetti(HttpServletRequest request, User user, int start, int end) {
SearchContext searchContext = SearchContextFactory.getInstance(request);
searchContext.setKeywords(OVERRIDE_KEYWORDS.toString());
searchContext.setAttribute("paginationType", "more");
searchContext.setStart(start);
searchContext.setEnd(end);
// Gestione Ordinamento
searchContext.setSorts(getOrderedQuery(request));
Hits hits = null;
try {
// Condizioni necessarie per questa ricerca: entryClassName=IntPratica & soggettiInteressati=userScreenName
// e stato==chiuso
BooleanQuery booleanQuery = BooleanQueryFactoryUtil.create(searchContext);
BooleanQuery altriProgettiBooleanQuery = BooleanQueryFactoryUtil.create(searchContext);
TermQuery termQuery = TermQueryFactoryUtil.create(searchContext, PortosIndexField.SOGGETTI_INTERESSATI,
user.getScreenName().toUpperCase());
altriProgettiBooleanQuery.add(termQuery, BooleanClauseOccur.SHOULD);
termQuery = TermQueryFactoryUtil.create(searchContext, Field.USER_ID, user.getUserId());
altriProgettiBooleanQuery.add(termQuery, BooleanClauseOccur.SHOULD);
termQuery = TermQueryFactoryUtil.create(searchContext, Field.ENTRY_CLASS_NAME, IntPratica.class.getName());
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
termQuery = TermQueryFactoryUtil.create(searchContext, PortosIndexField.PRATICA_APERTA, StringPool.FALSE);
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
booleanQuery.add(altriProgettiBooleanQuery, BooleanClauseOccur.MUST);
termQuery = TermQueryFactoryUtil.create(searchContext, PortosIndexField.IN_LAVORAZIONE_SUE, StringPool.FALSE);
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
// Condizioni aggiuntive
query(request, user, booleanQuery, searchContext);
hits = SearchEngineUtil.search(searchContext, booleanQuery);
logResults(user, booleanQuery, hits);
} catch (ParseException | SearchException e) {
_log.error(e, e);
}
return hits;
}
public static Hits searchProgettiBO(HttpServletRequest request, User user, int start, int end) {
SearchContext searchContext = SearchContextFactory.getInstance(request);
searchContext.setKeywords(OVERRIDE_KEYWORDS.toString());
boolean searchForExport = ParamUtil.getBoolean(request, "searchForExport", false);
if (searchForExport) {
int maxEnd = GetterUtil.getInteger(PropsUtil.get(PropsKeys.INDEX_FILTER_SEARCH_LIMIT));
searchContext.setStart(0);
searchContext.setEnd(maxEnd);
searchContext.setAttribute("paginationType", "none");
} else {
searchContext.setAttribute("paginationType", "more");
searchContext.setStart(start);
searchContext.setEnd(end);
}
// Gestione Ordinamento
searchContext.setSorts(getOrderedQuery(request));
Hits hits = null;
try {
BooleanQuery booleanQuery = BooleanQueryFactoryUtil.create(searchContext);
// Condizioni necessarie per questa ricerca: entryClassName=IntPratica & dtPratica valorizzato & GroupId
// facente parte dei miei gruopId delle mie organizzazioni
TermQuery termQuery = TermQueryFactoryUtil.create(searchContext, Field.ENTRY_CLASS_NAME,
IntPratica.class.getName());
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
termQuery = TermQueryFactoryUtil.create(searchContext, "dtPratica", 0);
booleanQuery.add(termQuery, BooleanClauseOccur.MUST_NOT);
// Ricavo i groupId legati all utente che effettua la ricerca
int ufficio = ParamUtil.getInteger(request, "ufficio");
if (ufficio != 0 && ufficio != -1) {
termQuery = TermQueryFactoryUtil.create(searchContext, Field.GROUP_ID, ufficio);
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
} else {
List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user
.getUserId());
BooleanQuery groupIdsQuery = BooleanQueryFactoryUtil.create(searchContext);
if (Validator.isNotNull(organizationList)) {
for (Organization org : organizationList) {
termQuery = TermQueryFactoryUtil.create(searchContext, Field.GROUP_ID, org.getGroupId());
groupIdsQuery.add(termQuery, BooleanClauseOccur.SHOULD);
}
booleanQuery.add(groupIdsQuery, BooleanClauseOccur.MUST);
} else {
termQuery = TermQueryFactoryUtil.create(searchContext, Field.GROUP_ID, 0L);
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
}
}
// Condizioni aggiuntive
query(request, user, booleanQuery, searchContext);
hits = SearchEngineUtil.search(searchContext, booleanQuery);
logResults(user, booleanQuery, hits);
} catch (ParseException | SearchException | SystemException e) {
_log.error(e, e);
}
return hits;
}
// ADT BUG-ID=16 Sezione Pratiche Assegnate / Export CSV - Esportazione tutte i record
public static Hits searchAttivitaIstruttore(HttpServletRequest request, User user, int start, int end) {
return searchAttivitaIstruttore(request, user, start, end, false);
}
// ADT BUG-ID=16 Sezione Pratiche Assegnate / Export CSV - Esportazione tutte i record
public static Hits searchAttivitaIstruttore(HttpServletRequest request, User user, int start, int end,
boolean isExport) {
SearchContext searchContext = SearchContextFactory.getInstance(request);
searchContext.setKeywords(OVERRIDE_KEYWORDS.toString());
// ADT BUG-ID=16 Sezione Pratiche Assegnate / Export CSV - Esportazione tutte i record
if (!isExport) {
searchContext.setAttribute("paginationType", "more");
} else {
searchContext.setAttribute("paginationType", "none");
}
searchContext.setStart(start);
searchContext.setEnd(end);
// Gestione Ordinamento
searchContext.setSorts(getOrderedQuery(request));
Hits hits = null;
try {
BooleanQuery booleanQuery = BooleanQueryFactoryUtil.create(searchContext);
// Condizioni necessarie per questa ricerca: entryClassName=IntPratica & statusByUserId = myUserId
TermQuery termQuery = TermQueryFactoryUtil.create(searchContext, Field.ENTRY_CLASS_NAME,
IntPratica.class.getName());
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
termQuery = TermQueryFactoryUtil.create(searchContext, "istruttoreUserId", user.getUserId());
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
// Condizioni aggiuntive
queryForIstruttore(request, user, booleanQuery, searchContext);
hits = SearchEngineUtil.search(searchContext, booleanQuery);
logResults(user, booleanQuery, hits);
} catch (ParseException | SearchException e) {
_log.error(e, e);
}
return hits;
}
/*
* Manifattura Web Group per Regione Siciliana Modifiche per rendere i campi di testo ricercabili per parole
* contenute e non per corrispondenza esatta.
*/
private static void query(HttpServletRequest request, User user, BooleanQuery booleanQuery,
SearchContext searchContext) {
String istruttoreId = ParamUtil.getString(request, "istruttore");
String unitaOperativa = ParamUtil.getString(request, "unitaOperativa");
Long geologi = ParamUtil.getLong(request, "geologi");
Long parereGeologo = ParamUtil.getLong(request, "parereGeologo");
try {
TermQuery termQuery;
queryPraticaAperta(request, booleanQuery, searchContext);
queryNumeroProgetto(request, booleanQuery, searchContext);
String protocollo = ParamUtil.getString(request, PortosIndexField.PROTOCOLLO);
if (Validator.isNotNull(protocollo)) {
termQuery = TermQueryFactoryUtil.create(searchContext, PortosIndexField.PROTOCOLLO, protocollo);
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
}
queryTipoPratica(request, booleanQuery, searchContext);
queryTipoProcedura(request, booleanQuery, searchContext);
String tipoIntervento = ParamUtil.getString(request, "tipoIntervento");
if (Validator.isNotNull(tipoIntervento)) {
if (tipoIntervento.equals("interventoLocale")) {
termQuery = TermQueryFactoryUtil.create(searchContext, "interventoLocale", StringPool.TRUE);
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
} else if (tipoIntervento.equals("miglioramento")) {
termQuery = TermQueryFactoryUtil.create(searchContext, PortosIndexField.MIGLIORAMENTO_SISMICO,
StringPool.TRUE);
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
} else if (tipoIntervento.equals("adeguamento")) {
termQuery = TermQueryFactoryUtil.create(searchContext, PortosIndexField.ADEGUAMENTO_SISMICO,
StringPool.TRUE);
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
} else if (tipoIntervento.equals(PortosIndexField.NUOVA_COSTRUZIONE)) {
termQuery = TermQueryFactoryUtil.create(searchContext, PortosIndexField.NUOVA_COSTRUZIONE,
StringPool.TRUE);
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
}
}
queryStatoPratica(request, booleanQuery, searchContext);
addRequiredTerms(booleanQuery, PortosIndexField.COMMITTENTI, ParamUtil.getString(request, "committente"));
addRequiredTerms(booleanQuery, PortosIndexField.ISTRUTTORE_FULL_NAME,
ParamUtil.getString(request, "tecnicoIstruttore"));
addRequiredTerms(booleanQuery, PortosIndexField.PROPRIETARIO_DIGITALE_FULL_NAME,
ParamUtil.getString(request, "titolareDigitale"));
for (String field : new String[] { PortosIndexField.SOGGETTI_INTERCONNESSI,
PortosIndexField.DESC_INTERVENTO, PortosIndexField.INDIRIZZO })
addRequiredTerms(booleanQuery, field, ParamUtil.getString(request, field));
String provincia = ParamUtil.getString(request, PortosIndexField.PROVINCIA);
if (Validator.isNotNull(provincia) && !provincia.equals("000")) {
termQuery = TermQueryFactoryUtil.create(searchContext, PortosIndexField.PROVINCIA_CODICE, provincia);
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
}
queryComune(request, booleanQuery, searchContext);
queryDate(request, booleanQuery, searchContext);
if (Validator.isNotNull(istruttoreId) && !istruttoreId.equals("-1") && !istruttoreId.equals("0")) {
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "istruttoreUserId",
istruttoreId);
booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST);
}
if (Validator.isNotNull(unitaOperativa) && !unitaOperativa.equals("-1")) {
TermQuery uoQuery = TermQueryFactoryUtil.create(searchContext, "unitaOperativa",
unitaOperativa);
booleanQuery.add(uoQuery, BooleanClauseOccur.MUST);
}
if (Validator.isNotNull(geologi) && !geologi.equals(-1L) && !geologi.equals(0L)) {
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "geologi",
geologi);
booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST);
}
if (Validator.isNotNull(parereGeologo) && !parereGeologo.equals(-1L)) {
TermQuery singleGroupIdQuery = TermQueryFactoryUtil.create(searchContext, "parereGeologo",
parereGeologo);
booleanQuery.add(singleGroupIdQuery, BooleanClauseOccur.MUST);
}
} catch (ParseException | java.text.ParseException e) {
_log.error(e, e);
}
}
private static void queryForIstruttore(HttpServletRequest request, User user, BooleanQuery booleanQuery,
SearchContext searchContext) {
try {
queryNumeroProgetto(request, booleanQuery, searchContext);
queryPraticaAperta(request, booleanQuery, searchContext);
queryTipoPratica(request, booleanQuery, searchContext);
if (!ParamUtil.getBoolean(request, "interventoTutti")) {
if (ParamUtil.getBoolean(request, "interventoNuovaCostruzione")) {
TermQuery termQuery = TermQueryFactoryUtil.create(searchContext,
PortosIndexField.NUOVA_COSTRUZIONE, StringPool.TRUE);
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
}
if (ParamUtil.getBoolean(request, "interventoAdeguamentoSismico")) {
TermQuery termQuery = TermQueryFactoryUtil.create(searchContext,
PortosIndexField.ADEGUAMENTO_SISMICO, StringPool.TRUE);
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
}
if (ParamUtil.getBoolean(request, "interventoMiglioramentoSismico")) {
TermQuery termQuery = TermQueryFactoryUtil.create(searchContext,
PortosIndexField.MIGLIORAMENTO_SISMICO, StringPool.TRUE);
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
}
if (ParamUtil.getBoolean(request, "interventoRiparazioneInterventoLocale")) {
TermQuery termQuery = TermQueryFactoryUtil.create(searchContext,
PortosIndexField.RIPARAZIONE_INTERVENTO_LOCALE, StringPool.TRUE);
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
}
}
queryStatoPratica(request, booleanQuery, searchContext);
for (String field : new String[] { PortosIndexField.COMMITTENTI, PortosIndexField.SOGGETTI_INTERCONNESSI,
PortosIndexField.DIRETTORE_LAVORI })
addRequiredTerms(booleanQuery, field, ParamUtil.getString(request, field));
queryDate(request, booleanQuery, searchContext);
queryComune(request, booleanQuery, searchContext);
String ufficio = ParamUtil.getString(request, "ufficio");
if (Validator.isNotNull(ufficio) && !ufficio.equals("-1")) {
TermQuery termQuery = TermQueryFactoryUtil.create(searchContext, Field.GROUP_ID, ufficio);
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
}
} catch (ParseException | java.text.ParseException e) {
_log.error(e, e);
}
}
private static void addRequiredTerms(BooleanQuery booleanQuery, String field, String terms) {
if (Validator.isNotNull(terms))
for (String term : StringUtil.split(terms, StringPool.SPACE))
if (Validator.isNotNull(term))
booleanQuery.addRequiredTerm(field, term);
}
private static Sort[] getOrderedQuery(HttpServletRequest request) {
Properties properties = PropsUtil.getProperties("elasticsearch.", true);
String orderField = ParamUtil.getString(request, "ordinaPer");
String orderType = ParamUtil.getString(request, "ordinaTipo");
List<Sort> sortes = new ArrayList<Sort>();
Sort sort = new Sort();
if (Validator.isNotNull(orderField) && !orderField.equals("-1")) {
if (properties.size() > 0) {
sort.setFieldName(orderField + "_sortable");
} else {
sort.setFieldName(orderField);
}
if (orderField.equals(PortosIndexField.NUMERO_PROGETTO)) {
sort.setType(Sort.INT_TYPE);
} else if (orderField.equals(PortosIndexField.PROTOCOLLO)) {
sort.setType(Sort.INT_TYPE);
} else if (orderField.equals("dtPratica") ||
orderField.equals("dataCreazione") ||
orderField.equals("createDate")
) {
sort.setType(Sort.LONG_TYPE);
}
}
if (Validator.isNotNull(orderType) && !orderType.equals("-1")) {
if (orderType.equals("asc")) {
sort.setReverse(false);
} else {
sort.setReverse(true);
}
}
sortes.add(sort);
return sortes.toArray(new Sort[0]);
}
/*
* Manifattura Web Group per Regione Siciliana
*
* Rimosse numerose righe di codice che trattavano separatamente i 3 casi: entrambe le date inserite, inserita solo
* la data iniziale, inserita solo la data finale. Le funzioni seguenti sono state create per ridurre la
* duplicazione di codice.
*/
private static void queryDate(HttpServletRequest request, BooleanQuery booleanQuery, SearchContext searchContext)
throws ParseException, java.text.ParseException {
String dataDaSearch = ParamUtil.getString(request, "dataRichiestaInizio");
String dataASearch = ParamUtil.getString(request, "dataRichiestaFine");
if (Validator.isNotNull(dataDaSearch) || Validator.isNotNull(dataASearch)) {
String dataDa = Validator.isNull(dataDaSearch) ? "00000000" : DATE_FORMAT_LUCENE.format(DATE_FORMAT_STRING
.parse(dataDaSearch));
String dataA = DATE_FORMAT_LUCENE.format(Validator.isNull(dataASearch) ? new Date() : DATE_FORMAT_STRING
.parse(dataASearch));
TermRangeQuery termRangeQuery = TermRangeQueryFactoryUtil.create(searchContext,
PortosIndexField.DATA_RICHIESTA, dataDa, dataA, true, true);
booleanQuery.add(termRangeQuery, BooleanClauseOccur.MUST);
}
}
private static void queryComune(HttpServletRequest request, BooleanQuery booleanQuery, SearchContext searchContext)
throws ParseException {
String comune = ParamUtil.getString(request, PortosIndexField.COMUNE);
if (Validator.isNotNull(comune) && !comune.equals("000")) {
TermQuery termQuery = TermQueryFactoryUtil.create(searchContext, PortosIndexField.COMUNE_ID, comune);
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
}
}
private static void queryNumeroProgetto(HttpServletRequest request, BooleanQuery booleanQuery,
SearchContext searchContext) throws ParseException {
String numeroProgetto = ParamUtil.getString(request, PortosIndexField.NUMERO_PROGETTO);
if (Validator.isNotNull(numeroProgetto)) {
TermQuery termQuery = TermQueryFactoryUtil.create(searchContext, PortosIndexField.NUMERO_PROGETTO,
numeroProgetto);
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
}
}
private static void queryTipoProcedura(HttpServletRequest request, BooleanQuery booleanQuery,
SearchContext searchContext) throws ParseException {
String tipoProcedura = ParamUtil.getString(request, PortosIndexField.TIPO_PROCEDURA);
if (Validator.isNotNull(tipoProcedura) && !tipoProcedura.equals("-1")) {
String[] procSplit = StringUtils.split(tipoProcedura, "|");
if(procSplit.length > 0){
for(String proc : procSplit){
BooleanQuery bq = BooleanQueryFactoryUtil.create(searchContext);
TermQuery termQuery = TermQueryFactoryUtil.create(searchContext, PortosIndexField.TIPO_PROCEDURA, proc);
bq.add(termQuery, BooleanClauseOccur.SHOULD);
booleanQuery.add(bq, BooleanClauseOccur.MUST);
}
}
}
}
private static void queryStatoPratica(HttpServletRequest request, BooleanQuery booleanQuery,
SearchContext searchContext) throws ParseException {
String statoPratica = ParamUtil.getString(request, PortosIndexField.STATO_PRATICA);
if (Validator.isNotNull(statoPratica)) {
TermQuery termQuery = null;
if (statoPratica.equals(StatoPraticaConstants.COLLAUDO_PARZIALE))
termQuery = TermQueryFactoryUtil.create(searchContext, PortosIndexField.COLLAUDO_PARZIALE,
StringPool.TRUE);
else if (statoPratica.equals(StatoPraticaConstants.COLLAUDO))
termQuery = TermQueryFactoryUtil.create(searchContext, PortosIndexField.COLLAUDO_COMPLETATO,
StringPool.TRUE);
else if (statoPratica.equals(StatoPraticaConstants.FINE_LAVORI))
termQuery = TermQueryFactoryUtil.create(searchContext, PortosIndexField.FINE_LAVORI_COMPLETATI,
StringPool.TRUE);
else if (statoPratica.equals(StatoPraticaConstants.FINE_LAVORI_PARZIALE))
termQuery = TermQueryFactoryUtil.create(searchContext, PortosIndexField.FINE_LAVORI_PARZIALI,
StringPool.TRUE);
else if (statoPratica.equals(StatoPraticaConstants.SOTTOPOSTA_A_PARERE))
termQuery = TermQueryFactoryUtil.create(searchContext, PortosIndexField.SOTTOPOSTO_A_PARERE,
StringPool.TRUE);
else if (statoPratica.equals(PortosIndexField.STATUS_SOSPESA))
termQuery = TermQueryFactoryUtil
.create(searchContext, PortosIndexField.STATUS_SOSPESA, StringPool.TRUE);
else if (statoPratica.equals("IC"))
termQuery = TermQueryFactoryUtil.create(searchContext, "dtPratica", "0");
else if (statoPratica.equals(StatoPraticaConstants.VARIATA))
termQuery = TermQueryFactoryUtil.create(searchContext, "variata", StringPool.TRUE);
else if(statoPratica.equals(PortosIndexField.ASSEGNATA_AD_ISTRUTTORE))
termQuery = TermQueryFactoryUtil.create(searchContext, PortosIndexField.ASSEGNATA_AD_ISTRUTTORE, 1L);
else if (!statoPratica.equals("-1"))
termQuery = TermQueryFactoryUtil.create(searchContext, PortosIndexField.STATO_PRATICA, statoPratica);
if (Validator.isNotNull(termQuery))
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
}
}
private static void queryPraticaAperta(HttpServletRequest request, BooleanQuery booleanQuery,
SearchContext searchContext) throws ParseException {
String praticaAperta = ParamUtil.getString(request, PortosIndexField.PRATICA_APERTA);
if (Validator.isNotNull(praticaAperta)) {
TermQuery termQuery = null;
if (praticaAperta.equals("aperta"))
termQuery = TermQueryFactoryUtil
.create(searchContext, PortosIndexField.PRATICA_APERTA, StringPool.TRUE);
else if (praticaAperta.equals("chiusa"))
termQuery = TermQueryFactoryUtil.create(searchContext, PortosIndexField.PRATICA_APERTA,
StringPool.FALSE);
if (Validator.isNotNull(termQuery))
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
}
}
private static void queryTipoPratica(HttpServletRequest request, BooleanQuery booleanQuery,
SearchContext searchContext) throws ParseException {
String tipoPratica = ParamUtil.getString(request, PortosIndexField.TIPO_PRATICA);
if (Validator.isNotNull(tipoPratica)) {
TermQuery termQuery = null;
if (tipoPratica.equals("co"))
termQuery = TermQueryFactoryUtil.create(searchContext, "controlloObbligatorio", StringPool.TRUE);
else if (!tipoPratica.equals("-1"))
termQuery = TermQueryFactoryUtil.create(searchContext, PortosIndexField.TIPO_PRATICA, tipoPratica);
if (Validator.isNotNull(termQuery))
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
}
}
private static void logResults(User user, BooleanQuery booleanQuery, Hits hits) {
if (_log.isDebugEnabled()) {
_log.debug("Utente " + user.getScreenName() + " query : " + booleanQuery.toString());
_log.debug("Number of hint find : " + hits.getLength());
}
}
}

258
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/search/IntPraticaSearch.java

@ -0,0 +1,258 @@
package it.mwg.sismica.bo.search;
import it.mwg.sismica.bo.shared.util.IndexField;
import it.tref.liferay.portos.bo.model.IntPratica;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
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.search.BooleanClauseOccur;
import com.liferay.portal.kernel.search.BooleanQuery;
import com.liferay.portal.kernel.search.BooleanQueryFactoryUtil;
import com.liferay.portal.kernel.search.Field;
import com.liferay.portal.kernel.search.Hits;
import com.liferay.portal.kernel.search.ParseException;
import com.liferay.portal.kernel.search.SearchContext;
import com.liferay.portal.kernel.search.SearchContextFactory;
import com.liferay.portal.kernel.search.SearchEngineUtil;
import com.liferay.portal.kernel.search.SearchException;
import com.liferay.portal.kernel.search.TermQuery;
import com.liferay.portal.kernel.search.TermQueryFactoryUtil;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.ParamUtil;
import com.liferay.portal.kernel.util.PropsKeys;
import com.liferay.portal.kernel.util.PropsUtil;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.model.Organization;
import com.liferay.portal.model.User;
import com.liferay.portal.service.OrganizationLocalServiceUtil;
public class IntPraticaSearch extends BaseSearch {
private static final Log _log = LogFactoryUtil.getLog(IntPraticaSearch.class);
public static Hits searchMieiProgetti(HttpServletRequest request, User user, int start, int end) {
SearchContext searchContext = SearchContextFactory.getInstance(request);
searchContext.setAttribute("paginationType", "more");
searchContext.setStart(start);
searchContext.setEnd(end);
// Gestione Ordinamento
searchContext.setSorts(getOrderedQuery(request));
Hits hits = null;
try {
BooleanQuery booleanQuery = BooleanQueryFactoryUtil.create(searchContext);
// Condizioni necessarie per questa ricerca: entryClassName=IntPratica & userId=userId e stato!=chiuso ??
TermQuery termQuery = TermQueryFactoryUtil.create(searchContext, Field.ENTRY_CLASS_NAME,
IntPratica.class.getName());
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
termQuery = TermQueryFactoryUtil.create(searchContext, Field.USER_ID, user.getUserId());
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
termQuery = TermQueryFactoryUtil.create(searchContext, IndexField.IN_LAVORAZIONE_SUE, StringPool.FALSE);
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
// Condizioni aggiuntive
query(request, user, booleanQuery, searchContext);
hits = SearchEngineUtil.search(searchContext, booleanQuery);
logResults(user, booleanQuery, hits);
} catch (SearchException | ParseException e) {
_log.error(e, e);
}
return hits;
}
public static Hits searchAltriProgetti(HttpServletRequest request, User user, int start, int end) {
SearchContext searchContext = SearchContextFactory.getInstance(request);
searchContext.setAttribute("paginationType", "more");
searchContext.setStart(start);
searchContext.setEnd(end);
// Gestione Ordinamento
searchContext.setSorts(getOrderedQuery(request));
Hits hits = null;
try {
BooleanQuery booleanQuery = BooleanQueryFactoryUtil.create(searchContext);
// Condizioni necessarie per questa ricerca: entryClassName=IntPratica & soggettiInteressati=userScreenName
// e userId!=myUserId e stato!=chiuso ??
TermQuery termQuery = TermQueryFactoryUtil.create(searchContext, Field.ENTRY_CLASS_NAME,
IntPratica.class.getName());
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
termQuery = TermQueryFactoryUtil.create(searchContext, IndexField.SOGGETTO, user.getScreenName());
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
termQuery = TermQueryFactoryUtil.create(searchContext, IndexField.PRATICA_APERTA, StringPool.TRUE);
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
termQuery = TermQueryFactoryUtil.create(searchContext, IndexField.IN_LAVORAZIONE_SUE, StringPool.FALSE);
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
// Condizioni aggiuntive
query(request, user, booleanQuery, searchContext);
hits = SearchEngineUtil.search(searchContext, booleanQuery);
logResults(user, booleanQuery, hits);
} catch (ParseException | SearchException e) {
_log.error(e, e);
}
return hits;
}
public static Hits searchArchivioProgetti(HttpServletRequest request, User user, int start, int end) {
SearchContext searchContext = SearchContextFactory.getInstance(request);
searchContext.setAttribute("paginationType", "more");
searchContext.setStart(start);
searchContext.setEnd(end);
// Gestione Ordinamento
searchContext.setSorts(getOrderedQuery(request));
Hits hits = null;
try {
// Condizioni necessarie per questa ricerca: entryClassName=IntPratica & soggettiInteressati=userScreenName
// e stato==chiuso
BooleanQuery booleanQuery = BooleanQueryFactoryUtil.create(searchContext);
BooleanQuery altriProgettiBooleanQuery = BooleanQueryFactoryUtil.create(searchContext);
TermQuery termQuery = TermQueryFactoryUtil.create(searchContext, IndexField.SOGGETTO, user.getScreenName());
altriProgettiBooleanQuery.add(termQuery, BooleanClauseOccur.SHOULD);
termQuery = TermQueryFactoryUtil.create(searchContext, Field.USER_ID, user.getUserId());
altriProgettiBooleanQuery.add(termQuery, BooleanClauseOccur.SHOULD);
termQuery = TermQueryFactoryUtil.create(searchContext, Field.ENTRY_CLASS_NAME, IntPratica.class.getName());
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
termQuery = TermQueryFactoryUtil.create(searchContext, IndexField.PRATICA_APERTA, StringPool.FALSE);
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
booleanQuery.add(altriProgettiBooleanQuery, BooleanClauseOccur.MUST);
termQuery = TermQueryFactoryUtil.create(searchContext, IndexField.IN_LAVORAZIONE_SUE, StringPool.FALSE);
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
// Condizioni aggiuntive
query(request, user, booleanQuery, searchContext);
hits = SearchEngineUtil.search(searchContext, booleanQuery);
logResults(user, booleanQuery, hits);
} catch (ParseException | SearchException e) {
_log.error(e, e);
}
return hits;
}
public static Hits searchProgettiBO(HttpServletRequest request, User user, int start, int end) {
SearchContext searchContext = SearchContextFactory.getInstance(request);
boolean searchForExport = ParamUtil.getBoolean(request, "searchForExport", false);
if (searchForExport) {
int maxEnd = GetterUtil.getInteger(PropsUtil.get(PropsKeys.INDEX_FILTER_SEARCH_LIMIT));
searchContext.setStart(0);
searchContext.setEnd(maxEnd);
searchContext.setAttribute("paginationType", "none");
} else {
searchContext.setAttribute("paginationType", "more");
searchContext.setStart(start);
searchContext.setEnd(end);
}
// Gestione Ordinamento
searchContext.setSorts(getOrderedQuery(request));
Hits hits = null;
try {
BooleanQuery query = BooleanQueryFactoryUtil.create(searchContext);
// Condizioni necessarie per questa ricerca: entryClassName=IntPratica & groupId tra quelli delle mie
// organizzazioni
TermQuery term = TermQueryFactoryUtil.create(searchContext, Field.ENTRY_CLASS_NAME,
IntPratica.class.getName());
query.add(term, BooleanClauseOccur.MUST);
// Ricavo i groupId legati all utente che effettua la ricerca
int ufficio = ParamUtil.getInteger(request, "ufficio");
if (ufficio != 0 && ufficio != -1) {
term = TermQueryFactoryUtil.create(searchContext, Field.GROUP_ID, ufficio);
query.add(term, BooleanClauseOccur.MUST);
} else {
List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user
.getUserId());
BooleanQuery groups = BooleanQueryFactoryUtil.create(searchContext);
if (Validator.isNotNull(organizationList)) {
for (Organization org : organizationList) {
term = TermQueryFactoryUtil.create(searchContext, Field.GROUP_ID, org.getGroupId());
groups.add(term, BooleanClauseOccur.SHOULD);
}
query.add(groups, BooleanClauseOccur.MUST);
} else {
term = TermQueryFactoryUtil.create(searchContext, Field.GROUP_ID, 0L);
query.add(term, BooleanClauseOccur.MUST);
}
}
// Condizioni aggiuntive
query(request, user, query, searchContext);
hits = SearchEngineUtil.search(searchContext, query);
logResults(user, query, hits);
} catch (ParseException | SearchException | SystemException e) {
_log.error(e, e);
}
return hits;
}
// ADT BUG-ID=16 Sezione Pratiche Assegnate / Export CSV - Esportazione tutte i record
public static Hits searchAttivitaIstruttore(HttpServletRequest request, User user, int start, int end) {
return searchAttivitaIstruttore(request, user, start, end, false);
}
// ADT BUG-ID=16 Sezione Pratiche Assegnate / Export CSV - Esportazione tutte i record
public static Hits searchAttivitaIstruttore(HttpServletRequest request, User user, int start, int end,
boolean isExport) {
SearchContext searchContext = SearchContextFactory.getInstance(request);
// ADT BUG-ID=16 Sezione Pratiche Assegnate / Export CSV - Esportazione tutte i record
if (!isExport) {
searchContext.setAttribute("paginationType", "more");
} else {
searchContext.setAttribute("paginationType", "none");
}
searchContext.setStart(start);
searchContext.setEnd(end);
// Gestione Ordinamento
searchContext.setSorts(getOrderedQuery(request));
Hits hits = null;
try {
BooleanQuery booleanQuery = BooleanQueryFactoryUtil.create(searchContext);
// Condizioni necessarie per questa ricerca: entryClassName=IntPratica & statusByUserId = myUserId
TermQuery termQuery = TermQueryFactoryUtil.create(searchContext, Field.ENTRY_CLASS_NAME,
IntPratica.class.getName());
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
termQuery = TermQueryFactoryUtil.create(searchContext, "istruttoreUserId", user.getUserId());
booleanQuery.add(termQuery, BooleanClauseOccur.MUST);
// Condizioni aggiuntive
queryForIstruttore(request, user, booleanQuery, searchContext);
hits = SearchEngineUtil.search(searchContext, booleanQuery);
logResults(user, booleanQuery, hits);
} catch (ParseException | SearchException e) {
_log.error(e, e);
}
return hits;
}
private static void queryForIstruttore(HttpServletRequest request, User user, BooleanQuery query,
SearchContext searchContext) {
try {
fullQuery(request, user, query, searchContext);
} catch (ParseException | java.text.ParseException e) {
_log.error(e, e);
}
}
private static void query(HttpServletRequest request, User user, BooleanQuery query, SearchContext searchContext) {
try {
fullQuery(request, user, query, searchContext);
TermQuery term = TermQueryFactoryUtil.create(searchContext, IndexField.IN_COMPILAZIONE, StringPool.FALSE);
query.add(term, BooleanClauseOccur.MUST);
} catch (ParseException | java.text.ParseException e) {
_log.error(e, e);
}
}
private static void logResults(User user, BooleanQuery booleanQuery, Hits hits) {
if (_log.isDebugEnabled()) {
_log.debug("Utente " + user.getScreenName() + " query : " + booleanQuery);
_log.debug("Number of hint find : " + hits.getLength());
}
}
}

3
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/servlet/MappeServlet.java

@ -69,8 +69,7 @@ public class MappeServlet extends HttpServlet {
response.setContentType(ContentTypes.APPLICATION_JSON); response.setContentType(ContentTypes.APPLICATION_JSON);
response.setCharacterEncoding(StringPool.UTF8); response.setCharacterEncoding(StringPool.UTF8);
String filename = (0 == comuneId ? "P-" + codiceProvincia : "C-" + comuneId) + ".json"; String filename = (0 == comuneId ? "P-" + codiceProvincia : "C-" + comuneId) + ".json";
response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "inline; filename=\"" + filename response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "inline; filename=\"" + filename + '"');
+ StringPool.QUOTE);
ServletResponseUtil.write(response, ServletResponseUtil.write(response,
serializer.serializeDeep(getPratiche(companyId, codiceProvincia, comuneId))); serializer.serializeDeep(getPratiche(companyId, codiceProvincia, comuneId)));
} }

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

@ -4,6 +4,7 @@
package it.mwg.sismica.bo.util; package it.mwg.sismica.bo.util;
import it.mwg.sismica.bo.shared.util.AvvisoUtil; import it.mwg.sismica.bo.shared.util.AvvisoUtil;
import it.mwg.sismica.bo.shared.util.IndexField;
import it.mwg.sismica.bo.shared.util.UserUtil; import it.mwg.sismica.bo.shared.util.UserUtil;
import it.tref.liferay.portos.bo.model.AllegatoManuale; import it.tref.liferay.portos.bo.model.AllegatoManuale;
import it.tref.liferay.portos.bo.model.Asseverazione; import it.tref.liferay.portos.bo.model.Asseverazione;
@ -62,13 +63,31 @@ import com.liferay.portal.kernel.cache.CacheRegistryUtil;
import com.liferay.portal.kernel.cache.MultiVMPoolUtil; import com.liferay.portal.kernel.cache.MultiVMPoolUtil;
import com.liferay.portal.kernel.cache.SingleVMPoolUtil; import com.liferay.portal.kernel.cache.SingleVMPoolUtil;
import com.liferay.portal.kernel.dao.jdbc.DataAccess; import com.liferay.portal.kernel.dao.jdbc.DataAccess;
import com.liferay.portal.kernel.dao.orm.DynamicQuery;
import com.liferay.portal.kernel.dao.orm.Order;
import com.liferay.portal.kernel.dao.orm.OrderFactoryUtil;
import com.liferay.portal.kernel.dao.orm.QueryUtil; import com.liferay.portal.kernel.dao.orm.QueryUtil;
import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.log.Log; import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil; import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.repository.model.FileEntry; import com.liferay.portal.kernel.repository.model.FileEntry;
import com.liferay.portal.kernel.search.BooleanClauseOccur;
import com.liferay.portal.kernel.search.BooleanQuery;
import com.liferay.portal.kernel.search.BooleanQueryFactoryUtil;
import com.liferay.portal.kernel.search.Document;
import com.liferay.portal.kernel.search.Field;
import com.liferay.portal.kernel.search.Hits;
import com.liferay.portal.kernel.search.Indexer;
import com.liferay.portal.kernel.search.IndexerRegistryUtil;
import com.liferay.portal.kernel.search.SearchContext;
import com.liferay.portal.kernel.search.SearchEngineUtil;
import com.liferay.portal.kernel.search.TermQuery;
import com.liferay.portal.kernel.search.TermQueryFactoryUtil;
import com.liferay.portal.kernel.search.TermRangeQuery;
import com.liferay.portal.kernel.search.TermRangeQueryFactoryUtil;
import com.liferay.portal.kernel.servlet.DirectServletRegistryUtil; import com.liferay.portal.kernel.servlet.DirectServletRegistryUtil;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.StringPool; import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.StringUtil; import com.liferay.portal.kernel.util.StringUtil;
import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.kernel.util.Validator;
@ -155,8 +174,8 @@ public class ManutenzioneDatabase {
private static final Log _log = LogFactoryUtil.getLog(ManutenzioneDatabase.class); private static final Log _log = LogFactoryUtil.getLog(ManutenzioneDatabase.class);
public static List<String> pulisci(ServiceContext serviceContext, String mode) throws SystemException, public static List<String> pulisci(ServiceContext serviceContext, SearchContext searchContext, String mode)
PortalException, SQLException { throws SystemException, PortalException, SQLException {
List<String> esito = new ArrayList<>(); List<String> esito = new ArrayList<>();
long companyId = serviceContext.getCompanyId(); long companyId = serviceContext.getCompanyId();
@ -204,8 +223,101 @@ public class ManutenzioneDatabase {
if (mode.contains("!Integrazioni!")) { if (mode.contains("!Integrazioni!")) {
esito.addAll(SismicaUtil.integrazioniScadute()); esito.addAll(SismicaUtil.integrazioniScadute());
} }
// if(mode.startsWith("!Workflow!")){String[] pezzi=StringUtil.split(mode, if (mode.contains("!Indici!")) {
// '!');esito.addAll(SismicaUtil.aggiungiWorkflow(pezzi[2],pezzi[3]));} esito.addAll(puliziaIndici(companyId, searchContext));
}
return esito;
}
private static List<String> puliziaIndici(long companyId, SearchContext searchContext) {
List<String> esito = new ArrayList<>();
esitoLog(esito, "Inizio pulizia indici di ricerca");
int praticheTotali = 0;
int praticheCancellate = 0;
int controlliTotali = 0;
int controlliCancellati = 0;
searchContext.setStart(0);
searchContext.setEnd(100000);
try {
DynamicQuery dq = IntPraticaLocalServiceUtil.dynamicQuery();
Order order = OrderFactoryUtil.desc("intPraticaId");
dq.addOrder(order);
@SuppressWarnings("unchecked")
long maxPratica = ((List<IntPratica>) IntPraticaLocalServiceUtil.dynamicQuery(dq, 0, 1)).get(0)
.getIntPraticaId() + 1000;
Indexer indexerPratica = IndexerRegistryUtil.getIndexer(IntPratica.class);
for (int i = -1000; i <= maxPratica; i += 1000) {
BooleanQuery query = BooleanQueryFactoryUtil.create(searchContext);
TermQuery term = TermQueryFactoryUtil.create(searchContext, Field.ENTRY_CLASS_NAME,
IntPratica.class.getName());
query.add(term, BooleanClauseOccur.MUST);
if (i > 0) {
TermRangeQuery range = TermRangeQueryFactoryUtil.create(searchContext, IndexField.INT_PRATICA_ID,
String.valueOf(i), String.valueOf(i + 1000), false, true);
query.add(range, BooleanClauseOccur.MUST);
} else {
TermRangeQuery range = TermRangeQueryFactoryUtil.create(searchContext, IndexField.INT_PRATICA_ID,
"0", "999999999999999", true, true);
query.add(range, BooleanClauseOccur.MUST_NOT);
}
Hits hits = SearchEngineUtil.search(searchContext, query);
for (Document doc : hits.toList()) {
praticheTotali++;
IntPratica pratica = IntPraticaLocalServiceUtil.fetchIntPratica(GetterUtil.getLong(doc
.get(IndexField.INT_PRATICA_ID)));
if (null == pratica) {
indexerPratica.delete(companyId, doc.getUID());
praticheCancellate++;
}
if ((praticheTotali > 0) && (praticheTotali % 200 == 0)) {
_log.info("Cancellate " + praticheCancellate + '/' + praticheTotali + " IntPratica");
}
}
}
esitoLog(esito, "Cancellate " + praticheCancellate + '/' + praticheTotali + " IntPratica");
dq = ControlloPraticaLocalServiceUtil.dynamicQuery();
order = OrderFactoryUtil.desc("controlloPraticaId");
dq.addOrder(order);
@SuppressWarnings("unchecked")
long maxControllo = ((List<ControlloPratica>) ControlloPraticaLocalServiceUtil.dynamicQuery(dq, 0, 1)).get(
0).getControlloPraticaId() + 1000;
Indexer indexerControllo = IndexerRegistryUtil.getIndexer(ControlloPratica.class);
for (int i = -1000; i <= maxControllo; i += 1000) {
BooleanQuery query = BooleanQueryFactoryUtil.create(searchContext);
TermQuery term = TermQueryFactoryUtil.create(searchContext, Field.ENTRY_CLASS_NAME,
ControlloPratica.class.getName());
query.add(term, BooleanClauseOccur.MUST);
if (i > 0) {
TermRangeQuery range = TermRangeQueryFactoryUtil.create(searchContext,
IndexField.CONTROLLO_PRATICA_ID, String.valueOf(i), String.valueOf(i + 1000), false, true);
query.add(range, BooleanClauseOccur.MUST);
} else {
TermRangeQuery range = TermRangeQueryFactoryUtil.create(searchContext,
IndexField.CONTROLLO_PRATICA_ID, "0", "999999999999999", true, true);
query.add(range, BooleanClauseOccur.MUST_NOT);
}
Hits hits = SearchEngineUtil.search(searchContext, query);
for (Document doc : hits.toList()) {
controlliTotali++;
ControlloPratica controllo = ControlloPraticaLocalServiceUtil.fetchControlloPratica(GetterUtil
.getLong(doc.get(IndexField.CONTROLLO_PRATICA_ID)));
if (null == controllo) {
indexerControllo.delete(companyId, doc.getUID());
controlliCancellati++;
}
if ((controlliTotali > 0) && (controlliTotali % 200 == 0)) {
_log.info("Cancellati " + controlliCancellati + '/' + controlliTotali + " ControlloPratica");
}
}
}
esitoLog(esito, "Cancellati " + controlliCancellati + '/' + controlliTotali + " ControlloPratica");
} catch (Exception e) {
esitoLog(esito, "Errore durante la pulizia degli indici: " + e.getMessage());
return esito;
}
esitoLog(esito, "Fine pulizia indici di ricerca");
return esito; return esito;
} }

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

@ -377,26 +377,24 @@ public class SismicaUtil {
return true; return true;
} }
public static List<String> reIndexFascicoli(long companyId) { public static List<String> reIndexFascicoli(long companyId) throws SystemException {
List<String> esito = new ArrayList<>(); List<String> esito = new ArrayList<>();
int start = 0;
List<IntPratica> pratiche = null; List<IntPratica> pratiche = null;
int start = IntPraticaLocalServiceUtil.getIntPraticasCount() - SLICE;
int conteggio = 0;
do { do {
try { pratiche = IntPraticaLocalServiceUtil.getIntPraticas(start, start + SLICE);
pratiche = IntPraticaLocalServiceUtil.getIntPraticas(start, start + SLICE);
} catch (SystemException e) {
pratiche = new ArrayList<>();
}
if (pratiche.size() > 0) { if (pratiche.size() > 0) {
for (IntPratica pratica : pratiche) { for (IntPratica pratica : pratiche) {
IntPraticaLocalServiceUtil.reIndexFascicolo(pratica, companyId); IntPraticaLocalServiceUtil.reIndexFascicolo(pratica, companyId);
} }
start += pratiche.size(); start -= pratiche.size();
_log.info("Reindicizzate " + start + " pratiche"); conteggio += pratiche.size();
_log.info("Reindicizzate " + conteggio + " pratiche");
} }
} while (pratiche.size() > 0); } while (start > 0);
esitoLog(esito, start + " pratiche reindicizzate."); esitoLog(esito, conteggio + " pratiche reindicizzate.");
return esito; return esito;
} }
@ -514,7 +512,7 @@ public class SismicaUtil {
"Pratica non assegnabile " + pratica.getNumeroProgetto() + " (" "Pratica non assegnabile " + pratica.getNumeroProgetto() + " ("
+ pratica.getIntPraticaId() + ") - Kaleo disallineato WorkflowInstance " + pratica.getIntPraticaId() + ") - Kaleo disallineato WorkflowInstance "
+ instance.getWorkflowInstanceId() + ", riassegno a " + user.getFirstName() + instance.getWorkflowInstanceId() + ", riassegno a " + user.getFirstName()
+ StringPool.SPACE + user.getLastName()); + ' ' + user.getLastName());
try { try {
WorkflowTaskManagerUtil.assignWorkflowTaskToUser(companyId, userId, WorkflowTaskManagerUtil.assignWorkflowTaskToUser(companyId, userId,
task.getWorkflowTaskId(), pratica.getStatusByUserId(), task.getWorkflowTaskId(), pratica.getStatusByUserId(),
@ -688,18 +686,18 @@ public class SismicaUtil {
} }
} catch (PortalException | SystemException e) { } catch (PortalException | SystemException e) {
esitoLog(esito, "Errore di caricamento IntPratica " + controllo.getIntPraticaId() + " (" esitoLog(esito, "Errore di caricamento IntPratica " + controllo.getIntPraticaId() + " ("
+ e.getMessage() + StringPool.CLOSE_PARENTHESIS); + e.getMessage() + ')');
} }
} catch (PortalException | SystemException e) { } catch (PortalException | SystemException e) {
esitoLog(esito, "Errore di caricamento ControlloPratica " + classPK + " (" + e.getMessage() esitoLog(esito, "Errore di caricamento ControlloPratica " + classPK + " (" + e.getMessage()
+ StringPool.CLOSE_PARENTHESIS); + ')');
} }
} }
} }
} catch (WorkflowException e) { } catch (WorkflowException e) {
esitoLog(esito, esitoLog(esito,
"WorkflowInstance non caricato: " + workflowTask.getWorkflowInstanceId() + " (" + e.getMessage() "WorkflowInstance non caricato: " + workflowTask.getWorkflowInstanceId() + " (" + e.getMessage()
+ StringPool.CLOSE_PARENTHESIS); + ')');
} }
return esito; return esito;
} }
@ -1024,8 +1022,8 @@ public class SismicaUtil {
List<ControlloPratica> controlli = ControlloPraticaLocalServiceUtil.findByIntPratica(pratica List<ControlloPratica> controlli = ControlloPraticaLocalServiceUtil.findByIntPratica(pratica
.getIntPraticaId()); .getIntPraticaId());
if (controlli.size() > 0) { if (controlli.size() > 0) {
esitoLog(esito, "Pratica " + tipoPratica + StringPool.SPACE + pratica.getNumeroProgetto() esitoLog(esito, "Pratica " + tipoPratica + ' ' + pratica.getNumeroProgetto() + " ("
+ " (" + pratica.getIntPraticaId() + ") invio vidimazione per " + varianti.size() + pratica.getIntPraticaId() + ") invio vidimazione per " + varianti.size()
+ " varianti non sostanziali, già inviate " + inviate); + " varianti non sostanziali, già inviate " + inviate);
for (Avviso avviso : varianti) { for (Avviso avviso : varianti) {
DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(avviso DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(avviso

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

@ -101,8 +101,7 @@ public class DettPraticaImpl extends DettPraticaBaseImpl {
sb.append(intPratica.getNumeroProgetto()).append(" del ").append(sdf.format(intPratica.getDtPratica())); sb.append(intPratica.getNumeroProgetto()).append(" del ").append(sdf.format(intPratica.getDtPratica()));
} else { } else {
if (Validator.isNotNull(intPratica.getNumeroProgetto())) { if (Validator.isNotNull(intPratica.getNumeroProgetto())) {
sb.append(intPratica.getNumeroProgetto()).append(StringPool.SPACE).append(StringPool.DASH) sb.append(intPratica.getNumeroProgetto()).append(' ').append('-').append(' ');
.append(StringPool.SPACE);
} }
sb.append(getDettPraticaId()).append(" (Temporaneo) "); sb.append(getDettPraticaId()).append(" (Temporaneo) ");
} }
@ -129,9 +128,9 @@ public class DettPraticaImpl extends DettPraticaBaseImpl {
sb.append(LanguageUtil.get(LocaleUtil.getSiteDefault(), "label-integrazione-" + getTipoIntegrazione())); sb.append(LanguageUtil.get(LocaleUtil.getSiteDefault(), "label-integrazione-" + getTipoIntegrazione()));
} }
if (Validator.isNotNull(getVarianteNumero())) { if (Validator.isNotNull(getVarianteNumero())) {
sb.append(StringPool.SPACE).append(StringPool.POUND).append(getVarianteNumero()); sb.append(' ').append('#').append(getVarianteNumero());
} else if (Validator.isNotNull(getIntegrazione())) { } else if (Validator.isNotNull(getIntegrazione())) {
sb.append(StringPool.SPACE).append(StringPool.POUND).append(getIntegrazione()); sb.append(' ').append('#').append(getIntegrazione());
} }
if (Validator.isNotNull(getProtocollo())) { if (Validator.isNotNull(getProtocollo())) {
sb.append(" protocollo ") sb.append(" protocollo ")
@ -140,8 +139,7 @@ public class DettPraticaImpl extends DettPraticaBaseImpl {
.append(FastDateFormatFactoryUtil.getDate(LocaleUtil.getSiteDefault()).format( .append(FastDateFormatFactoryUtil.getDate(LocaleUtil.getSiteDefault()).format(
getDataEffettuazione())); getDataEffettuazione()));
} }
sb.append(StringPool.SPACE).append(StringPool.OPEN_PARENTHESIS).append(getTitle()) sb.append(' ').append('(').append(getTitle()).append(')');
.append(StringPool.CLOSE_PARENTHESIS);
return sb.toString(); return sb.toString();
} }
@ -155,12 +153,11 @@ public class DettPraticaImpl extends DettPraticaBaseImpl {
sb.append(LanguageUtil.get(LocaleUtil.getSiteDefault(), "label-integrazione-" + getTipoIntegrazione())); sb.append(LanguageUtil.get(LocaleUtil.getSiteDefault(), "label-integrazione-" + getTipoIntegrazione()));
} }
if (Validator.isNotNull(getVarianteNumero())) { if (Validator.isNotNull(getVarianteNumero())) {
sb.append(StringPool.SPACE).append(StringPool.POUND).append(getVarianteNumero()); sb.append(' ').append('#').append(getVarianteNumero());
} else if (Validator.isNotNull(getIntegrazione())) { } else if (Validator.isNotNull(getIntegrazione())) {
sb.append(StringPool.SPACE).append(StringPool.POUND).append(getIntegrazione()); sb.append(' ').append('#').append(getIntegrazione());
} }
sb.append(StringPool.SPACE).append(StringPool.OPEN_PARENTHESIS).append(getTitle()) sb.append(' ').append('(').append(getTitle()).append(')');
.append(StringPool.CLOSE_PARENTHESIS);
return sb.toString(); return sb.toString();
} }

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

@ -696,8 +696,8 @@ public class IntPraticaImpl extends IntPraticaBaseImpl {
User istruttoreUser = null; User istruttoreUser = null;
if (Validator.isNotNull(statusByUserId) && getStatus() != WorkflowConstants.STATUS_DRAFT) { if (Validator.isNotNull(statusByUserId) && getStatus() != WorkflowConstants.STATUS_DRAFT) {
istruttoreUser = UserLocalServiceUtil.getUser(statusByUserId); istruttoreUser = UserLocalServiceUtil.getUser(statusByUserId);
_log.info("istruttore pratica id=" + getIntPraticaId() + StringPool.COLON + istruttoreUser.getScreenName() _log.info("istruttore pratica id=" + getIntPraticaId() + ':' + istruttoreUser.getScreenName() + ' '
+ StringPool.SPACE + istruttoreUser.getEmailAddress()); + istruttoreUser.getEmailAddress());
} }
return istruttoreUser; return istruttoreUser;
} }

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

@ -10,7 +10,6 @@ package it.tref.liferay.portos.bo.model.impl;
import com.liferay.portal.kernel.language.LanguageUtil; import com.liferay.portal.kernel.language.LanguageUtil;
import com.liferay.portal.kernel.util.LocaleUtil; import com.liferay.portal.kernel.util.LocaleUtil;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.kernel.util.Validator;
/** /**
@ -39,7 +38,7 @@ public class SoggettoImpl extends SoggettoBaseImpl {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append(LanguageUtil.get(LocaleUtil.ITALIAN, "gc-soggetto-" + getTipologiaSoggetto())); sb.append(LanguageUtil.get(LocaleUtil.ITALIAN, "gc-soggetto-" + getTipologiaSoggetto()));
if (Validator.isNotNull(getAmbitoProfessione())) { if (Validator.isNotNull(getAmbitoProfessione())) {
sb.append(StringPool.SPACE).append(StringPool.DASH).append(StringPool.SPACE); sb.append(SEP);
if (getAmbitoProfessione().equalsIgnoreCase("ambitoProf-altro")) { if (getAmbitoProfessione().equalsIgnoreCase("ambitoProf-altro")) {
sb.append(getAmbitoAttivita()); sb.append(getAmbitoAttivita());
} else { } else {
@ -53,15 +52,15 @@ public class SoggettoImpl extends SoggettoBaseImpl {
public String getDescrizioneCompleta() { public String getDescrizioneCompleta() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append(getCodiceFiscale().toUpperCase()).append(StringPool.SPACE).append(StringPool.DASH); sb.append(getCodiceFiscale().toUpperCase()).append(' ').append('-');
if (Validator.isNotNull(getCognome())) { if (Validator.isNotNull(getCognome())) {
sb.append(StringPool.SPACE).append(getCognome()); sb.append(' ').append(getCognome());
} }
if (Validator.isNotNull(getNome())) { if (Validator.isNotNull(getNome())) {
sb.append(StringPool.SPACE).append(getNome()); sb.append(' ').append(getNome());
} }
if (Validator.isNotNull(getDenominazione())) { if (Validator.isNotNull(getDenominazione())) {
sb.append(StringPool.SPACE).append(getDenominazione()); sb.append(' ').append(getDenominazione());
} }
return sb.toString(); return sb.toString();
} }
@ -71,13 +70,13 @@ public class SoggettoImpl extends SoggettoBaseImpl {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
if (Validator.isNotNull(getCognome())) { if (Validator.isNotNull(getCognome())) {
sb.append(getCognome()).append(StringPool.SPACE); sb.append(getCognome()).append(' ');
} }
if (Validator.isNotNull(getNome())) { if (Validator.isNotNull(getNome())) {
sb.append(getNome()).append(StringPool.SPACE); sb.append(getNome()).append(' ');
} }
if (Validator.isNotNull(getDenominazione())) { if (Validator.isNotNull(getDenominazione())) {
sb.append(getDenominazione()).append(StringPool.SPACE); sb.append(getDenominazione()).append(' ');
} }
if (sb.length() > 0) { if (sb.length() > 0) {
sb.setLength(sb.length() - 1); sb.setLength(sb.length() - 1);
@ -99,6 +98,6 @@ public class SoggettoImpl extends SoggettoBaseImpl {
if (Validator.isNotNull(getDenominazione())) { if (Validator.isNotNull(getDenominazione())) {
return getDenominazione(); return getDenominazione();
} }
return getNome() + StringPool.SPACE + getCognome(); return getNome() + ' ' + getCognome();
} }
} }

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

@ -30,7 +30,6 @@ import com.liferay.portal.kernel.util.ContentTypes;
import com.liferay.portal.kernel.util.FileUtil; import com.liferay.portal.kernel.util.FileUtil;
import com.liferay.portal.kernel.util.ParamUtil; import com.liferay.portal.kernel.util.ParamUtil;
import com.liferay.portal.kernel.util.StreamUtil; import com.liferay.portal.kernel.util.StreamUtil;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.kernel.zip.ZipWriter; import com.liferay.portal.kernel.zip.ZipWriter;
import com.liferay.portal.kernel.zip.ZipWriterFactoryUtil; import com.liferay.portal.kernel.zip.ZipWriterFactoryUtil;
@ -110,8 +109,7 @@ public class DocAggiuntivaPortlet extends MVCPortlet {
fileEntry.getVersion(), false); fileEntry.getVersion(), false);
String s = new String(fileEntry.getTitle().getBytes(StandardCharsets.UTF_8)); String s = new String(fileEntry.getTitle().getBytes(StandardCharsets.UTF_8));
byte[] b = s.getBytes(StandardCharsets.ISO_8859_1); byte[] b = s.getBytes(StandardCharsets.ISO_8859_1);
String name = new String(b, StandardCharsets.ISO_8859_1) + StringPool.PERIOD String name = new String(b, StandardCharsets.ISO_8859_1) + '.' + fileEntry.getExtension();
+ fileEntry.getExtension();
zipWriter.addEntry(name, inputStream); zipWriter.addEntry(name, inputStream);
} finally { } finally {
StreamUtil.cleanUp(inputStream); StreamUtil.cleanUp(inputStream);
@ -128,7 +126,7 @@ public class DocAggiuntivaPortlet extends MVCPortlet {
resourceResponse.addProperty(HttpHeaders.CACHE_CONTROL, "no-store"); resourceResponse.addProperty(HttpHeaders.CACHE_CONTROL, "no-store");
} }
resourceResponse.addProperty(HttpHeaders.CONTENT_DISPOSITION, resourceResponse.addProperty(HttpHeaders.CONTENT_DISPOSITION,
"attachment; filename=\"" + file.getName() + StringPool.QUOTE); "attachment; filename=\"" + file.getName() + '"');
resourceResponse.setContentLength(data.length); resourceResponse.setContentLength(data.length);
resourceResponse.getPortletOutputStream().write(data); resourceResponse.getPortletOutputStream().write(data);
resourceResponse.getPortletOutputStream().flush(); resourceResponse.getPortletOutputStream().flush();

197
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/FascicoloPortlet.java

@ -1,7 +1,9 @@
package it.tref.liferay.portos.bo.portlet; package it.tref.liferay.portos.bo.portlet;
import it.mwg.sismica.bo.search.IntPraticaAdvancedSearch; import it.mwg.sismica.bo.search.IntPraticaSearch;
import it.mwg.sismica.bo.shared.util.DocumentiPraticaUtil; import it.mwg.sismica.bo.shared.util.DocumentiPraticaUtil;
import it.mwg.sismica.bo.shared.util.Generics;
import it.mwg.sismica.bo.shared.util.IndexField;
import it.mwg.sismica.bo.shared.util.UserUtil; import it.mwg.sismica.bo.shared.util.UserUtil;
import it.tref.liferay.portos.bo.model.Comune; import it.tref.liferay.portos.bo.model.Comune;
import it.tref.liferay.portos.bo.model.DettPratica; import it.tref.liferay.portos.bo.model.DettPratica;
@ -23,7 +25,6 @@ import it.tref.liferay.portos.bo.service.PagamentoLocalServiceUtil;
import it.tref.liferay.portos.bo.service.ProvinciaLocalServiceUtil; import it.tref.liferay.portos.bo.service.ProvinciaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil; import it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil;
import it.tref.liferay.portos.bo.service.TerritorioLocalServiceUtil; import it.tref.liferay.portos.bo.service.TerritorioLocalServiceUtil;
import it.tref.liferay.portos.bo.shared.bean.IstruttoreBean;
import it.tref.liferay.portos.bo.shared.util.Constants; import it.tref.liferay.portos.bo.shared.util.Constants;
import it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants; import it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants;
import it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil; import it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil;
@ -39,9 +40,13 @@ import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
import java.util.Date; import java.util.Date;
import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set; import java.util.Set;
import java.util.TreeMap;
import javax.portlet.ActionRequest; import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse; import javax.portlet.ActionResponse;
@ -232,72 +237,13 @@ public class FascicoloPortlet extends MVCPortlet {
public void searchURL(ActionRequest request, ActionResponse response) { public void searchURL(ActionRequest request, ActionResponse response) {
String numeroProgetto = request.getParameter("numeroProgetto"); for (String field : IntPraticaSearch.getFields()) {
String statoPratica = request.getParameter("statoPratica"); String value = ParamUtil.getString(request, field, StringPool.BLANK);
String committente = request.getParameter("committente"); response.setRenderParameter(field, value);
String tecnicoIstruttore = request.getParameter("tecnicoIstruttore");
String titolareDigitale = request.getParameter("titolareDigitale");
String soggettiInterconnessi = request.getParameter("soggettiInterconnessi");
String dataRichiestaInizio = request.getParameter("dataRichiestaInizio");
String dataRichiestaFine = request.getParameter("dataRichiestaFine");
String provincia = request.getParameter("provincia");
String comune = request.getParameter("comune");
String tipoIntervento = request.getParameter("tipoIntervento");
String tipoProcedura = ParamUtil.getString(request, "tipoProcedura");
String unitaOperativa = ParamUtil.getString(request, "unitaOperativa");
String geologi = ParamUtil.getString(request, "geologi");
String parereGeologo = ParamUtil.getString(request, "parereGeologo");
String istruttore = ParamUtil.getString(request, "istruttore");
if (Validator.isNotNull(dataRichiestaInizio)) {
String[] dataRichiestaInizioSplitted = dataRichiestaInizio.split(StringPool.FORWARD_SLASH);
response.setRenderParameter("dataRichiestaInizioDay", dataRichiestaInizioSplitted[0]);
int month = Integer.valueOf(dataRichiestaInizioSplitted[1]) - 1;
response.setRenderParameter("dataRichiestaInizioMonth", String.valueOf(month));
response.setRenderParameter("dataRichiestaInizioYear", dataRichiestaInizioSplitted[2]);
} }
if (Validator.isNotNull(dataRichiestaFine)) { response.setRenderParameter("orderByCol",
String[] dataRichiestaFineSplitted = dataRichiestaFine.split(StringPool.FORWARD_SLASH); ParamUtil.getString(request, "orderByCol", IndexField.NUMERO_PROGETTO));
response.setRenderParameter("dataRichiestaFineDay", dataRichiestaFineSplitted[0]); response.setRenderParameter("orderByType", ParamUtil.getString(request, "orderByType", "asc"));
int month = Integer.valueOf(dataRichiestaFineSplitted[1]) - 1;
response.setRenderParameter("dataRichiestaFineMonth", String.valueOf(month));
response.setRenderParameter("dataRichiestaFineYear", dataRichiestaFineSplitted[2]);
}
String ufficio = request.getParameter("ufficio");
String ordinaPer = request.getParameter("ordinaPer");
String ordinaTipo = request.getParameter("ordinaTipo");
if (Validator.isNotNull(tipoIntervento)) {
response.setRenderParameter("tipoIntervento", tipoIntervento);
}
response.setRenderParameter("numeroProgetto", numeroProgetto);
response.setRenderParameter("statoPratica", statoPratica);
response.setRenderParameter("committente", committente);
if (Validator.isNotNull(provincia)) {
response.setRenderParameter("provincia", provincia);
}
if (Validator.isNotNull(comune)) {
response.setRenderParameter("comune", comune);
}
if (Validator.isNull(tecnicoIstruttore)) {
response.setRenderParameter("tecnicoIstruttore", StringPool.BLANK);
} else {
response.setRenderParameter("tecnicoIstruttore", tecnicoIstruttore);
}
response.setRenderParameter("titolareDigitale", titolareDigitale);
response.setRenderParameter("soggettiInterconnessi", soggettiInterconnessi);
response.setRenderParameter("dataRichiestaInizio", dataRichiestaInizio);
response.setRenderParameter("dataRichiestaFine", dataRichiestaFine);
if (Validator.isNull(ufficio)) {
response.setRenderParameter("ufficio", "-1");
} else {
response.setRenderParameter("ufficio", ufficio);
}
response.setRenderParameter("ordinaPer", ordinaPer);
response.setRenderParameter("ordinaTipo", ordinaTipo);
response.setRenderParameter("tipoProcedura", tipoProcedura);
response.setRenderParameter("unitaOperativa", unitaOperativa);
response.setRenderParameter("geologi", geologi);
response.setRenderParameter("parereGeologo", parereGeologo);
response.setRenderParameter("istruttore", istruttore);
} }
@Override @Override
@ -305,10 +251,8 @@ public class FascicoloPortlet extends MVCPortlet {
PortletException { PortletException {
ThemeDisplay themeDisplay = (ThemeDisplay) resourceRequest.getAttribute(WebKeys.THEME_DISPLAY); ThemeDisplay themeDisplay = (ThemeDisplay) resourceRequest.getAttribute(WebKeys.THEME_DISPLAY);
Locale locale = themeDisplay.getLocale(); Locale locale = themeDisplay.getLocale();
User user = themeDisplay.getUser(); User user = themeDisplay.getUser();
String id = resourceRequest.getResourceID(); String id = resourceRequest.getResourceID();
try { try {
if ("downloadAllDocPratica".equals(id)) { if ("downloadAllDocPratica".equals(id)) {
@ -412,69 +356,41 @@ public class FascicoloPortlet extends MVCPortlet {
} }
writeJSON(resourceRequest, resourceResponse, jsonArray); writeJSON(resourceRequest, resourceResponse, jsonArray);
} else if ("istruttore".equals(id)) { } else if ("istruttore".equals(id)) {
Integer uoId = ParamUtil.getInteger(resourceRequest, "uoId"); int uoId = ParamUtil.getInteger(resourceRequest, "uoId");
JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); List<Organization> orgs = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId());
if (Validator.isNotNull(uoId) && !uoId.equals("-1")) { Set<UserGroupRole> tecnici = new HashSet<>();
List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user for (Organization org : orgs) {
.getUserId()); Role role = RoleLocalServiceUtil.getRole(org.getCompanyId(), Constants.ROLE_NAME_ISTRUTTORE);
List<UserGroupRole> tecniciIstruttori = new ArrayList<UserGroupRole>(); List<UserGroupRole> istruttori = UserGroupRoleLocalServiceUtil.getUserGroupRolesByGroupAndRole(
org.getGroupId(), role.getRoleId());
for (Organization org : organizationList) { for (UserGroupRole userGroupRole : istruttori) {
Role role = RoleLocalServiceUtil.getRole(org.getCompanyId(), Constants.ROLE_NAME_ISTRUTTORE); User istruttore = userGroupRole.getUser();
List<UserGroupRole> istruttori = UserGroupRoleLocalServiceUtil.getUserGroupRolesByGroupAndRole( Set<Integer> unitaOperativeIstruttore = UserUtil.getUnitaOperative(istruttore);
org.getGroupId(), role.getRoleId()); if (unitaOperativeIstruttore.contains(uoId) || (uoId == 0)) {
for (UserGroupRole userGroupRole : istruttori) { tecnici.add(userGroupRole);
User istruttore = userGroupRole.getUser();
Set<Integer> unitaOperativeIstruttore = UserUtil.getUnitaOperative(istruttore);
if (unitaOperativeIstruttore.contains(uoId)) {
if (tecniciIstruttori.isEmpty()) {
tecniciIstruttori.add(userGroupRole);
} else {
boolean isPresent = false;
for (UserGroupRole tecnico : tecniciIstruttori) {
if (tecnico.getUserId() == userGroupRole.getUserId()) {
isPresent = true;
break;
}
}
if (!isPresent) {
tecniciIstruttori.add(userGroupRole);
}
}
}
} }
} }
List<IstruttoreBean> tecniciIstruttoriSorted = new ArrayList<IstruttoreBean>();
for (UserGroupRole tecnico : tecniciIstruttori) {
IstruttoreBean istruttore = new IstruttoreBean();
istruttore.setIdIstruttore(tecnico.getUserId());
istruttore.setDenominazione(tecnico.getUser().getFullName());
tecniciIstruttoriSorted.add(istruttore);
}
Collections.sort(tecniciIstruttoriSorted);
for (IstruttoreBean istruttore : tecniciIstruttoriSorted) {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
jsonObject.put("istruttoreId", istruttore.getIdIstruttore());
jsonObject.put("descLong", istruttore.getDenominazione());
jsonArray.put(jsonObject);
}
} }
Map<String, Long> istruttori = new TreeMap<>();
for (UserGroupRole tecnico : tecnici) {
istruttori.put(Generics.capitalizeFull(tecnico.getUser().getFullName()), tecnico.getUserId());
}
JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
for (Entry<String, Long> istruttore : istruttori.entrySet()) {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
jsonObject.put("istruttoreId", istruttore.getValue());
jsonObject.put("descLong", istruttore.getKey());
jsonArray.put(jsonObject);
}
writeJSON(resourceRequest, resourceResponse, jsonArray); writeJSON(resourceRequest, resourceResponse, jsonArray);
} else if ("geologo".equals(id)) { } else if ("geologo".equals(id)) {
JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user
.getUserId()); .getUserId());
List<User> geologi = new ArrayList<User>(); List<User> geologi = new ArrayList<User>();
for (Organization org : organizationList) { for (Organization org : organizationList) {
Role role = RoleLocalServiceUtil.getRole(org.getCompanyId(), "portos_geologo"); Role role = RoleLocalServiceUtil.getRole(org.getCompanyId(), "portos_geologo");
List<User> geologiUsers = UserLocalServiceUtil.getRoleUsers(role.getRoleId()); List<User> geologiUsers = UserLocalServiceUtil.getRoleUsers(role.getRoleId());
for (User userGroupRole : geologiUsers) { for (User userGroupRole : geologiUsers) {
if (geologi.isEmpty()) { if (geologi.isEmpty()) {
geologi.add(userGroupRole); geologi.add(userGroupRole);
@ -492,16 +408,13 @@ public class FascicoloPortlet extends MVCPortlet {
} }
} }
} }
for (User geo : geologi) { for (User geo : geologi) {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
jsonObject.put("geologoId", geo.getUserId()); jsonObject.put("geologoId", geo.getUserId());
jsonObject.put("descLong", geo.getFullName()); jsonObject.put("descLong", geo.getFullName());
jsonArray.put(jsonObject); jsonArray.put(jsonObject);
} }
writeJSON(resourceRequest, resourceResponse, jsonArray); writeJSON(resourceRequest, resourceResponse, jsonArray);
} else if ("exportRicerca".equals(id)) { } else if ("exportRicerca".equals(id)) {
String csv = StringPool.BLANK; String csv = StringPool.BLANK;
HttpServletRequest request = PortalUtil.getHttpServletRequest(resourceRequest); HttpServletRequest request = PortalUtil.getHttpServletRequest(resourceRequest);
@ -524,7 +437,7 @@ public class FascicoloPortlet extends MVCPortlet {
HttpServletRequest httpRequest = PortalUtil.getHttpServletRequest(resourceRequest); HttpServletRequest httpRequest = PortalUtil.getHttpServletRequest(resourceRequest);
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
List<IntPratica> lista = new ArrayList<IntPratica>(); List<IntPratica> lista = new ArrayList<IntPratica>();
Hits hits = IntPraticaAdvancedSearch.searchProgettiBO(httpRequest, user, QueryUtil.ALL_POS, QueryUtil.ALL_POS); Hits hits = IntPraticaSearch.searchProgettiBO(httpRequest, user, QueryUtil.ALL_POS, QueryUtil.ALL_POS);
for (Document doc : hits.toList()) { for (Document doc : hits.toList()) {
String intPraticaId = doc.get("intPraticaId"); String intPraticaId = doc.get("intPraticaId");
try { try {
@ -539,30 +452,29 @@ public class FascicoloPortlet extends MVCPortlet {
_log.error(method + " IntPraticaLocalServiceUtil.fetchIntPratica IntPraticaId: " + intPraticaId, e); _log.error(method + " IntPraticaLocalServiceUtil.fetchIntPratica IntPraticaId: " + intPraticaId, e);
} }
} }
sb.append(StringPool.SEMICOLON) sb.append(':')
.append(CSVUtil.encode(LanguageUtil .append(CSVUtil.encode(LanguageUtil
.get(getPortletConfig(), locale, "label.scadenzegeniocivile.pratica"))) .get(getPortletConfig(), locale, "label.scadenzegeniocivile.pratica")))
.append(StringPool.SEMICOLON) .append(':')
.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, .append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale,
"label.scadenzegeniocivile.titolare"))) "label.scadenzegeniocivile.titolare")))
.append(StringPool.SEMICOLON) .append(':')
.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, .append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale,
"label.scadenzegeniocivile.committenti"))) "label.scadenzegeniocivile.committenti")))
.append(StringPool.SEMICOLON) .append(':')
.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, .append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale,
"label.scadenzegeniocivile.istruttore"))) "label.scadenzegeniocivile.istruttore")))
.append(StringPool.SEMICOLON) .append(':')
.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, .append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale,
"label.scadenzegeniocivile.statoPratica"))) "label.scadenzegeniocivile.statoPratica")))
.append(StringPool.SEMICOLON) .append(':')
.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, .append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale,
"label.scadenzegeniocivile.provincia"))) "label.scadenzegeniocivile.provincia")))
.append(StringPool.SEMICOLON) .append(':')
.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.comune"))) .append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.comune")))
.append(StringPool.SEMICOLON) .append(':')
.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, .append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale,
"label.scadenzegeniocivile.descrizioneIntervento"))).append(StringPool.SEMICOLON) "label.scadenzegeniocivile.descrizioneIntervento"))).append(':').append(StringPool.NEW_LINE);
.append(StringPool.NEW_LINE);
for (IntPratica intPratica : lista) { for (IntPratica intPratica : lista) {
try { try {
long intPraticaId = intPratica.getIntPraticaId(); long intPraticaId = intPratica.getIntPraticaId();
@ -572,8 +484,7 @@ public class FascicoloPortlet extends MVCPortlet {
Provincia provincia = ProvinciaLocalServiceUtil.fetchByC_C(territorio.getCompanyId(), Provincia provincia = ProvinciaLocalServiceUtil.fetchByC_C(territorio.getCompanyId(),
territorio.getCodiceProvincia()); territorio.getCodiceProvincia());
String praticaLabel = intPratica.getTitle(locale, true); String praticaLabel = intPratica.getTitle(locale, true);
sb.append("No").append(StringPool.SEMICOLON).append(CSVUtil.encode(praticaLabel)) sb.append("No:").append(CSVUtil.encode(praticaLabel)).append(':');
.append(StringPool.SEMICOLON);
List<Soggetto> titolari = SoggettoLocalServiceUtil.getValidByIntPratica_CodiceFiscale( List<Soggetto> titolari = SoggettoLocalServiceUtil.getValidByIntPratica_CodiceFiscale(
lastDettPratica.getIntPraticaId(), lastDettPratica.getCodiceFiscaleDelegatoCommittente()); lastDettPratica.getIntPraticaId(), lastDettPratica.getCodiceFiscaleDelegatoCommittente());
Soggetto titolare = null; Soggetto titolare = null;
@ -583,7 +494,7 @@ public class FascicoloPortlet extends MVCPortlet {
if (titolare != null) { if (titolare != null) {
sb.append(titolare.getTitle()).append(" - ").append(titolare.getCodiceFiscale()); sb.append(titolare.getTitle()).append(" - ").append(titolare.getCodiceFiscale());
} }
sb.append(StringPool.SEMICOLON); sb.append(':');
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
List<Soggetto> committenti = SoggettoLocalServiceUtil.findByIntPratica_TipologiaSoggetto( List<Soggetto> committenti = SoggettoLocalServiceUtil.findByIntPratica_TipologiaSoggetto(
lastDettPratica.getIntPraticaId(), TipoSoggettoUtil.COMMITTENTE); lastDettPratica.getIntPraticaId(), TipoSoggettoUtil.COMMITTENTE);
@ -593,30 +504,30 @@ public class FascicoloPortlet extends MVCPortlet {
} }
if (builder.length() > 0) if (builder.length() > 0)
builder.setLength(builder.length() - 12); builder.setLength(builder.length() - 12);
sb.append(builder.toString()).append(StringPool.SEMICOLON); sb.append(builder.toString()).append(':');
User istruttore = UserLocalServiceUtil.fetchUser(intPratica.getStatusByUserId()); User istruttore = UserLocalServiceUtil.fetchUser(intPratica.getStatusByUserId());
if (istruttore != null) { if (istruttore != null) {
sb.append(istruttore.getFullName()); sb.append(istruttore.getFullName());
} }
sb.append(StringPool.SEMICOLON) sb.append(':')
.append(LanguageUtil.get( .append(LanguageUtil.get(
locale, locale,
PraticaUtil.getStatoPraticaLabel(intPratica.getStatoPratica(), PraticaUtil.getStatoPraticaLabel(intPratica.getStatoPratica(),
intPratica.getTipoProcedura()))).append(StringPool.SEMICOLON); intPratica.getTipoProcedura()))).append(':');
if (Validator.isNotNull(provincia)) { if (Validator.isNotNull(provincia)) {
sb.append(provincia.getProvincia()); sb.append(provincia.getProvincia());
} }
sb.append(StringPool.SEMICOLON); sb.append(':');
if (Validator.isNotNull(comune)) { if (Validator.isNotNull(comune)) {
sb.append(comune.getDenominazione()); sb.append(comune.getDenominazione());
} }
sb.append(StringPool.SEMICOLON); sb.append(':');
int MAX_LENGHT_DESCR_INTERVENTO = 30; int MAX_LENGHT_DESCR_INTERVENTO = 30;
sb.append( sb.append(
lastDettPratica.getDescLongIntervento() == null ? StringPool.BLANK : lastDettPratica lastDettPratica.getDescLongIntervento() == null ? StringPool.BLANK : lastDettPratica
.getDescLongIntervento().length() > MAX_LENGHT_DESCR_INTERVENTO ? lastDettPratica .getDescLongIntervento().length() > MAX_LENGHT_DESCR_INTERVENTO ? lastDettPratica
.getDescLongIntervento().substring(0, MAX_LENGHT_DESCR_INTERVENTO) : lastDettPratica .getDescLongIntervento().substring(0, MAX_LENGHT_DESCR_INTERVENTO) : lastDettPratica
.getDescLongIntervento()).append(StringPool.SEMICOLON); .getDescLongIntervento()).append(':');
} catch (Throwable e) { } catch (Throwable e) {
_log.error(method + " IntPraticaId: " + intPratica != null ? intPratica.getIntPraticaId() : "", e); _log.error(method + " IntPraticaId: " + intPratica != null ? intPratica.getIntPraticaId() : "", e);
} finally { } finally {

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

@ -94,8 +94,7 @@ public class GenerateProtocolloCSVPortlet extends MVCPortlet {
bos.write(bytes, 0, bytes.length); bos.write(bytes, 0, bytes.length);
resourceResponse.setContentType(contentType); resourceResponse.setContentType(contentType);
resourceResponse.addProperty(HttpHeaders.CACHE_CONTROL, "max-age=3600, must-revalidate"); resourceResponse.addProperty(HttpHeaders.CACHE_CONTROL, "max-age=3600, must-revalidate");
resourceResponse.addProperty(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + fileName resourceResponse.addProperty(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + fileName + '"');
+ StringPool.QUOTE);
resourceResponse.setContentLength(bos.size()); resourceResponse.setContentLength(bos.size());
OutputStream out = resourceResponse.getPortletOutputStream(); OutputStream out = resourceResponse.getPortletOutputStream();
bos.writeTo(out); bos.writeTo(out);

125
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneAttivitaIstruttorePortlet.java

@ -1,6 +1,6 @@
package it.tref.liferay.portos.bo.portlet; package it.tref.liferay.portos.bo.portlet;
import it.mwg.sismica.bo.search.IntPraticaAdvancedSearch; import it.mwg.sismica.bo.search.IntPraticaSearch;
import it.mwg.sismica.bo.shared.util.UserUtil; import it.mwg.sismica.bo.shared.util.UserUtil;
import it.tref.liferay.portos.bo.model.Comune; import it.tref.liferay.portos.bo.model.Comune;
import it.tref.liferay.portos.bo.model.DettPratica; import it.tref.liferay.portos.bo.model.DettPratica;
@ -25,6 +25,7 @@ import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
import java.util.Date; import java.util.Date;
@ -55,7 +56,6 @@ import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.ParamUtil; import com.liferay.portal.kernel.util.ParamUtil;
import com.liferay.portal.kernel.util.PropsKeys; import com.liferay.portal.kernel.util.PropsKeys;
import com.liferay.portal.kernel.util.PropsUtil; import com.liferay.portal.kernel.util.PropsUtil;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.kernel.util.WebKeys; import com.liferay.portal.kernel.util.WebKeys;
import com.liferay.portal.model.Organization; import com.liferay.portal.model.Organization;
@ -78,62 +78,18 @@ public class GestioneAttivitaIstruttorePortlet extends MVCPortlet {
"Provincia", "Stato Pratica", "Committenti", "Direttore Lavori", "Tipologia Intervento", "Aperta", "Provincia", "Stato Pratica", "Committenti", "Direttore Lavori", "Tipologia Intervento", "Aperta",
"Collaudo Previsto", "Data Assegnazione" }; "Collaudo Previsto", "Data Assegnazione" };
private static final SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); private static final SimpleDateFormat SDF = new SimpleDateFormat("dd/MM/yyyy");
public void searchURL(ActionRequest actionRequest, ActionResponse actionResponse) { public void searchURL(ActionRequest actionRequest, ActionResponse actionResponse) {
String numeroProgetto = ParamUtil.getString(actionRequest, "numeroProgetto"); for (String param : Arrays
String tipoPratica = ParamUtil.getString(actionRequest, "tipoPratica"); .asList("numeroProgetto", "tipoPratica", "statoPratica", "committente", "soggettiInterconnessi",
String statoPratica = ParamUtil.getString(actionRequest, "statoPratica"); "direttoreLavori", "dataRichiestaInizio", "dataRichiestaFine", "ufficio", "ordinaPer",
String committente = ParamUtil.getString(actionRequest, "committente"); "ordinaTipo", "comune", "praticaAperta", "interventoTutti", "interventoNuovaCostruzione",
String soggettiInterconnessi = ParamUtil.getString(actionRequest, "soggettiInterconnessi"); "interventoAdeguamentoSismico", "interventoMiglioramentoSismico",
String direttoreLavori = ParamUtil.getString(actionRequest, "direttoreLavori"); "interventoRiparazioneInterventoLocale", "tipoAttivita", "tipoProcedura", "unitaOperativa",
String dataRichiestaInizio = ParamUtil.getString(actionRequest, "dataRichiestaInizio"); "provincia", "geologi", "parereGeologo", "istruttore")) {
String dataRichiestaFine = ParamUtil.getString(actionRequest, "dataRichiestaFine"); actionResponse.setRenderParameter(param, ParamUtil.getString(actionRequest, param));
String ufficio = ParamUtil.getString(actionRequest, "ufficio"); }
String ordinaPer = ParamUtil.getString(actionRequest, "ordinaPer");
String ordinaTipo = ParamUtil.getString(actionRequest, "ordinaTipo");
String praticaAperta = ParamUtil.getString(actionRequest, "praticaAperta");
String interventoTutti = ParamUtil.getString(actionRequest, "interventoTutti");
String interventoNuovaCostruzione = ParamUtil.getString(actionRequest, "interventoNuovaCostruzione");
String interventoAdeguamentoSismico = ParamUtil.getString(actionRequest, "interventoAdeguamentoSismico");
String interventoMiglioramentoSismico = ParamUtil.getString(actionRequest, "interventoMiglioramentoSismico");
String interventoRiparazioneInterventoLocale = ParamUtil.getString(actionRequest,
"interventoRiparazioneInterventoLocale");
String comune = ParamUtil.getString(actionRequest, "comune");
String tipoAttivita = ParamUtil.getString(actionRequest, "tipoAttivita");
String tipoProcedura = ParamUtil.getString(actionRequest, "tipoProcedura");
String unitaOperativa = ParamUtil.getString(actionRequest, "unitaOperativa");
String provincia = ParamUtil.getString(actionRequest, "provincia");
String geologi = ParamUtil.getString(actionRequest, "geologi");
String parereGeologo = ParamUtil.getString(actionRequest, "parereGeologo");
String istruttore = ParamUtil.getString(actionRequest, "istruttore");
actionResponse.setRenderParameter("numeroProgetto", numeroProgetto);
actionResponse.setRenderParameter("tipoPratica", tipoPratica);
actionResponse.setRenderParameter("statoPratica", statoPratica);
actionResponse.setRenderParameter("committente", committente);
actionResponse.setRenderParameter("soggettiInterconnessi", soggettiInterconnessi);
actionResponse.setRenderParameter("direttoreLavori", direttoreLavori);
actionResponse.setRenderParameter("dataRichiestaInizio", dataRichiestaInizio);
actionResponse.setRenderParameter("dataRichiestaFine", dataRichiestaFine);
actionResponse.setRenderParameter("ufficio", ufficio);
actionResponse.setRenderParameter("ordinaPer", ordinaPer);
actionResponse.setRenderParameter("ordinaTipo", ordinaTipo);
actionResponse.setRenderParameter("comune", comune);
actionResponse.setRenderParameter("praticaAperta", praticaAperta);
actionResponse.setRenderParameter("interventoTutti", interventoTutti);
actionResponse.setRenderParameter("interventoNuovaCostruzione", interventoNuovaCostruzione);
actionResponse.setRenderParameter("interventoAdeguamentoSismico", interventoAdeguamentoSismico);
actionResponse.setRenderParameter("interventoMiglioramentoSismico", interventoMiglioramentoSismico);
actionResponse.setRenderParameter("interventoRiparazioneInterventoLocale",
interventoRiparazioneInterventoLocale);
actionResponse.setRenderParameter("tipoAttivita", tipoAttivita);
actionResponse.setRenderParameter("tipoProcedura", tipoProcedura);
actionResponse.setRenderParameter("unitaOperativa", unitaOperativa);
actionResponse.setRenderParameter("provincia", provincia);
actionResponse.setRenderParameter("geologi", geologi);
actionResponse.setRenderParameter("parereGeologo", parereGeologo);
actionResponse.setRenderParameter("istruttore", istruttore);
} }
@Override @Override
@ -146,7 +102,7 @@ public class GestioneAttivitaIstruttorePortlet extends MVCPortlet {
boolean isExport = "exportCVS".equals(resourceId); boolean isExport = "exportCVS".equals(resourceId);
HttpServletRequest request = PortalUtil.getHttpServletRequest(resourceRequest); HttpServletRequest request = PortalUtil.getHttpServletRequest(resourceRequest);
List<IntPratica> lista = new ArrayList<>(); List<IntPratica> lista = new ArrayList<>();
Hits hits = IntPraticaAdvancedSearch.searchAttivitaIstruttore(request, themeDisplay.getUser(), 0, Hits hits = IntPraticaSearch.searchAttivitaIstruttore(request, themeDisplay.getUser(), 0,
// ADT BUG-ID=16 Sezione Pratiche Assegnate / Export CSV - Esportazione tutte i record // ADT BUG-ID=16 Sezione Pratiche Assegnate / Export CSV - Esportazione tutte i record
GetterUtil.getInteger(PropsUtil.get(PropsKeys.INDEX_FILTER_SEARCH_LIMIT)), isExport); GetterUtil.getInteger(PropsUtil.get(PropsKeys.INDEX_FILTER_SEARCH_LIMIT)), isExport);
try { try {
@ -166,7 +122,7 @@ public class GestioneAttivitaIstruttorePortlet extends MVCPortlet {
if (isExport && Validator.isNotNull(lista) && !lista.isEmpty()) { if (isExport && Validator.isNotNull(lista) && !lista.isEmpty()) {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
for (String columnName : FIELD_NAMES) { for (String columnName : FIELD_NAMES) {
sb.append(columnName).append(StringPool.SEMICOLON); sb.append(columnName).append(':');
} }
sb.append(CharPool.NEW_LINE).append(CharPool.NEW_LINE); sb.append(CharPool.NEW_LINE).append(CharPool.NEW_LINE);
for (IntPratica pratica : lista) { for (IntPratica pratica : lista) {
@ -195,55 +151,53 @@ public class GestioneAttivitaIstruttorePortlet extends MVCPortlet {
if (collaudatori != null && !collaudatori.isEmpty()) { if (collaudatori != null && !collaudatori.isEmpty()) {
collaudoPrevisto = true; collaudoPrevisto = true;
} }
sb.append(pratica.getTipoPratica()).append(StringPool.SEMICOLON) sb.append(pratica.getTipoPratica()).append(':').append(pratica.getNumeroProgetto()).append(':');
.append(pratica.getNumeroProgetto()).append(StringPool.SEMICOLON);
if (Validator.isNotNull(pratica.getDtPratica())) { if (Validator.isNotNull(pratica.getDtPratica())) {
sb.append(sdf.format(pratica.getDtPratica())); sb.append(SDF.format(pratica.getDtPratica()));
} }
sb.append(StringPool.SEMICOLON).append(comune.getDenominazione()).append(StringPool.SEMICOLON) sb.append(':').append(comune.getDenominazione()).append(':').append(provincia.getProvincia())
.append(provincia.getProvincia()).append(StringPool.SEMICOLON) .append(':').append(pratica.getStatoPratica()).append(':');
.append(pratica.getStatoPratica()).append(StringPool.SEMICOLON);
for (Soggetto soggetto : committenti) { for (Soggetto soggetto : committenti) {
// ADT BUG-ID=16 Sezione Pratiche Assegnate / Export CSV // ADT BUG-ID=16 Sezione Pratiche Assegnate / Export CSV
sb.append(soggetto.getDescrizioneCompleta().toUpperCase()).append(StringPool.SPACE); sb.append(soggetto.getDescrizioneCompleta().toUpperCase()).append(' ');
} }
sb.append(StringPool.SEMICOLON); sb.append(':');
for (Soggetto soggetto : direttoreLavori) { for (Soggetto soggetto : direttoreLavori) {
// ADT BUG-ID=16 Sezione Pratiche Assegnate / Export CSV // ADT BUG-ID=16 Sezione Pratiche Assegnate / Export CSV
sb.append(soggetto.getDescrizioneCompleta().toUpperCase()).append(StringPool.SPACE); sb.append(soggetto.getDescrizioneCompleta().toUpperCase()).append(' ');
} }
sb.append(StringPool.SEMICOLON); sb.append(':');
if (Validator.isNotNull(lastDettPratica)) { if (Validator.isNotNull(lastDettPratica)) {
if (lastDettPratica.getTcNuovaCostruzione()) { if (lastDettPratica.getTcNuovaCostruzione()) {
sb.append("Nuova Costruzione").append(StringPool.SPACE); sb.append("Nuova Costruzione").append(' ');
} }
if (lastDettPratica.getTcAdeguamentoSismico()) { if (lastDettPratica.getTcAdeguamentoSismico()) {
sb.append("Adeguamento Sismico").append(StringPool.SPACE); sb.append("Adeguamento Sismico").append(' ');
} }
if (lastDettPratica.getTcMiglioramentoSismico()) { if (lastDettPratica.getTcMiglioramentoSismico()) {
sb.append("Miglioramento Sismico").append(StringPool.SPACE); sb.append("Miglioramento Sismico").append(' ');
} }
if (lastDettPratica.getTcRiparazioneInterventoLocale()) { if (lastDettPratica.getTcRiparazioneInterventoLocale()) {
sb.append("Riparazione Intervento Locale").append(StringPool.SPACE); sb.append("Riparazione Intervento Locale").append(' ');
} }
} }
sb.append(StringPool.SEMICOLON); sb.append(':');
if (compleatata) { if (compleatata) {
sb.append("SÌ"); sb.append("SÌ");
} else { } else {
sb.append("NO"); sb.append("NO");
} }
sb.append(StringPool.SEMICOLON); sb.append(':');
if (collaudoPrevisto) { if (collaudoPrevisto) {
sb.append("SÌ"); sb.append("SÌ");
} else { } else {
sb.append("NO"); sb.append("NO");
} }
sb.append(StringPool.SEMICOLON); sb.append(':');
if (Validator.isNotNull(pratica.getStatusDate())) { if (Validator.isNotNull(pratica.getStatusDate())) {
sb.append(sdf.format(pratica.getStatusDate())); sb.append(SDF.format(pratica.getStatusDate()));
} }
sb.append(StringPool.SEMICOLON); sb.append(':');
} catch (SystemException e) { } catch (SystemException e) {
_log.error(e, e); _log.error(e, e);
} }
@ -256,8 +210,7 @@ public class GestioneAttivitaIstruttorePortlet extends MVCPortlet {
baos.write(bytes, 0, bytes.length); baos.write(bytes, 0, bytes.length);
resourceResponse.setContentType(contentType); resourceResponse.setContentType(contentType);
resourceResponse.addProperty(HttpHeaders.CACHE_CONTROL, "max-age=3600, must-revalidate"); resourceResponse.addProperty(HttpHeaders.CACHE_CONTROL, "max-age=3600, must-revalidate");
resourceResponse.addProperty(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + fileName resourceResponse.addProperty(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + fileName + ':');
+ StringPool.QUOTE);
resourceResponse.setContentLength(baos.size()); resourceResponse.setContentLength(baos.size());
OutputStream out = resourceResponse.getPortletOutputStream(); OutputStream out = resourceResponse.getPortletOutputStream();
baos.writeTo(out); baos.writeTo(out);
@ -310,14 +263,12 @@ public class GestioneAttivitaIstruttorePortlet extends MVCPortlet {
writeJSON(resourceRequest, resourceResponse, jsonArray); writeJSON(resourceRequest, resourceResponse, jsonArray);
} else if ("unitaOperative".equals(resourceId)) { } else if ("unitaOperative".equals(resourceId)) {
JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
for (int i = 1; i < 11; i++) { for (int i = 1; i < 11; i++) {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
jsonObject.put("uoId", i); jsonObject.put("uoId", i);
jsonObject.put("descLong", i); jsonObject.put("descLong", i);
jsonArray.put(jsonObject); jsonArray.put(jsonObject);
} }
writeJSON(resourceRequest, resourceResponse, jsonArray); writeJSON(resourceRequest, resourceResponse, jsonArray);
} else if ("comuni".equals(resourceId)) { } else if ("comuni".equals(resourceId)) {
String provinciaId = ParamUtil.getString(resourceRequest, "provinciaId"); String provinciaId = ParamUtil.getString(resourceRequest, "provinciaId");
@ -350,7 +301,6 @@ public class GestioneAttivitaIstruttorePortlet extends MVCPortlet {
List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user
.getUserId()); .getUserId());
List<UserGroupRole> tecniciIstruttori = new ArrayList<UserGroupRole>(); List<UserGroupRole> tecniciIstruttori = new ArrayList<UserGroupRole>();
for (Organization org : organizationList) { for (Organization org : organizationList) {
Role role = RoleLocalServiceUtil.getRole(org.getCompanyId(), Constants.ROLE_NAME_ISTRUTTORE); Role role = RoleLocalServiceUtil.getRole(org.getCompanyId(), Constants.ROLE_NAME_ISTRUTTORE);
List<UserGroupRole> istruttori = UserGroupRoleLocalServiceUtil.getUserGroupRolesByGroupAndRole( List<UserGroupRole> istruttori = UserGroupRoleLocalServiceUtil.getUserGroupRolesByGroupAndRole(
@ -376,7 +326,6 @@ public class GestioneAttivitaIstruttorePortlet extends MVCPortlet {
} }
} }
} }
List<IstruttoreBean> tecniciIstruttoriSorted = new ArrayList<IstruttoreBean>(); List<IstruttoreBean> tecniciIstruttoriSorted = new ArrayList<IstruttoreBean>();
for (UserGroupRole tecnico : tecniciIstruttori) { for (UserGroupRole tecnico : tecniciIstruttori) {
IstruttoreBean istruttore = new IstruttoreBean(); IstruttoreBean istruttore = new IstruttoreBean();
@ -384,9 +333,7 @@ public class GestioneAttivitaIstruttorePortlet extends MVCPortlet {
istruttore.setDenominazione(tecnico.getUser().getFullName()); istruttore.setDenominazione(tecnico.getUser().getFullName());
tecniciIstruttoriSorted.add(istruttore); tecniciIstruttoriSorted.add(istruttore);
} }
Collections.sort(tecniciIstruttoriSorted); Collections.sort(tecniciIstruttoriSorted);
for (IstruttoreBean istruttore : tecniciIstruttoriSorted) { for (IstruttoreBean istruttore : tecniciIstruttoriSorted) {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
jsonObject.put("istruttoreId", istruttore.getIdIstruttore()); jsonObject.put("istruttoreId", istruttore.getIdIstruttore());
@ -394,19 +341,15 @@ public class GestioneAttivitaIstruttorePortlet extends MVCPortlet {
jsonArray.put(jsonObject); jsonArray.put(jsonObject);
} }
} }
writeJSON(resourceRequest, resourceResponse, jsonArray); writeJSON(resourceRequest, resourceResponse, jsonArray);
} else if ("geologo".equals(resourceId)) { } else if ("geologo".equals(resourceId)) {
JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrganizations(user
.getUserId()); .getUserId());
List<User> geologi = new ArrayList<User>(); List<User> geologi = new ArrayList<User>();
for (Organization org : organizationList) { for (Organization org : organizationList) {
Role role = RoleLocalServiceUtil.getRole(org.getCompanyId(), "portos_geologo"); Role role = RoleLocalServiceUtil.getRole(org.getCompanyId(), "portos_geologo");
List<User> geologiUsers = UserLocalServiceUtil.getRoleUsers(role.getRoleId()); List<User> geologiUsers = UserLocalServiceUtil.getRoleUsers(role.getRoleId());
for (User userGroupRole : geologiUsers) { for (User userGroupRole : geologiUsers) {
if (geologi.isEmpty()) { if (geologi.isEmpty()) {
geologi.add(userGroupRole); geologi.add(userGroupRole);
@ -424,22 +367,18 @@ public class GestioneAttivitaIstruttorePortlet extends MVCPortlet {
} }
} }
} }
for (User geo : geologi) { for (User geo : geologi) {
JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
jsonObject.put("geologoId", geo.getUserId()); jsonObject.put("geologoId", geo.getUserId());
jsonObject.put("descLong", geo.getFullName()); jsonObject.put("descLong", geo.getFullName());
jsonArray.put(jsonObject); jsonArray.put(jsonObject);
} }
writeJSON(resourceRequest, resourceResponse, jsonArray); writeJSON(resourceRequest, resourceResponse, jsonArray);
} }
} catch (Exception e) { } catch (Exception e) {
_log.error(e, e); _log.error(e, e);
throw new IOException(e); throw new IOException(e);
} }
super.serveResource(resourceRequest, resourceResponse); super.serveResource(resourceRequest, resourceResponse);
} }
} }

85
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneAttivitaPortlet.java

@ -1,7 +1,6 @@
package it.tref.liferay.portos.bo.portlet; package it.tref.liferay.portos.bo.portlet;
import it.mwg.sismica.bo.search.ControlloPraticaAdvancedSearch; import it.mwg.sismica.bo.search.ControlloPraticaSearch;
import it.mwg.sismica.bo.shared.util.AvvisoUtil;
import it.mwg.sismica.bo.shared.util.UserUtil; import it.mwg.sismica.bo.shared.util.UserUtil;
import it.tref.liferay.portos.bo.model.Comune; import it.tref.liferay.portos.bo.model.Comune;
import it.tref.liferay.portos.bo.model.ControlloPratica; import it.tref.liferay.portos.bo.model.ControlloPratica;
@ -91,67 +90,13 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
public void search2URL(ActionRequest request, ActionResponse response) { public void search2URL(ActionRequest request, ActionResponse response) {
String tabs1 = ParamUtil.getString(request, "tabs1"); for (String field : ControlloPraticaSearch.getFields()) {
String numeroProgetto = ParamUtil.getString(request, "numeroProgetto"); String value = ParamUtil.getString(request, field, StringPool.BLANK);
String protocollo = ParamUtil.getString(request, "protocollo"); response.setRenderParameter(field, value);
String tipoPratica = ParamUtil.getString(request, "tipoPratica");
String statoPratica = ParamUtil.getString(request, "statoPratica");
String committente = ParamUtil.getString(request, "committente");
String soggettiInterconnessi = ParamUtil.getString(request, "soggettiInterconnessi");
String istruttore = ParamUtil.getString(request, "istruttore");
String dataRichiestaInizio = ParamUtil.getString(request, "dataRichiestaInizio");
String dataRichiestaFine = ParamUtil.getString(request, "dataRichiestaFine");
String ufficio = ParamUtil.getString(request, "ufficio");
String ordinaPer = ParamUtil.getString(request, "ordinaPer");
String ordinaTipo = ParamUtil.getString(request, "ordinaTipo");
String comune = ParamUtil.getString(request, "comune");
String tipoAttivita = ParamUtil.getString(request, "tipoAttivita");
String tipoProcedura = ParamUtil.getString(request, "tipoProcedura");
String unitaOperativa = ParamUtil.getString(request, "unitaOperativa");
String provincia = ParamUtil.getString(request, "provincia");
String geologi = ParamUtil.getString(request, "geologi");
String parereGeologo = ParamUtil.getString(request, "parereGeologo");
response.setRenderParameter("tabs1", tabs1);
response.setRenderParameter("numeroProgetto", numeroProgetto);
response.setRenderParameter("protocollo", protocollo);
// ADT - BUG-11 Aggiunta filtro ricerca
if (Validator.isNotNull(tipoPratica)) {
if (AvvisoUtil.TIPO_REPORT_CONTROLLO_OBBLIGATORIO.equalsIgnoreCase(tipoPratica)) {
tipoPratica = Constants.TIPO_PRATICA_DEPOSITO;
response.setRenderParameter("controlloObbligatorio", StringPool.TRUE);
}
response.setRenderParameter("tipoPratica", tipoPratica);
}
response.setRenderParameter("statoPratica", statoPratica);
response.setRenderParameter("committente", committente);
response.setRenderParameter("soggettiInterconnessi", soggettiInterconnessi);
response.setRenderParameter("istruttore", istruttore);
response.setRenderParameter("dataRichiestaInizio", dataRichiestaInizio);
response.setRenderParameter("dataRichiestaFine", dataRichiestaFine);
if (Validator.isNotNull(dataRichiestaInizio)) {
String[] dataRichiestaInizioSplitted = dataRichiestaInizio.split(StringPool.FORWARD_SLASH);
response.setRenderParameter("dataRichiestaInizioDay", dataRichiestaInizioSplitted[0]);
int month = Integer.valueOf(dataRichiestaInizioSplitted[1]) - 1;
response.setRenderParameter("dataRichiestaInizioMonth", String.valueOf(month));
response.setRenderParameter("dataRichiestaInizioYear", dataRichiestaInizioSplitted[2]);
}
if (Validator.isNotNull(dataRichiestaFine)) {
String[] dataRichiestaFineSplitted = dataRichiestaFine.split(StringPool.FORWARD_SLASH);
response.setRenderParameter("dataRichiestaFineDay", dataRichiestaFineSplitted[0]);
int month = Integer.valueOf(dataRichiestaFineSplitted[1]) - 1;
response.setRenderParameter("dataRichiestaFineMonth", String.valueOf(month));
response.setRenderParameter("dataRichiestaFineYear", dataRichiestaFineSplitted[2]);
} }
response.setRenderParameter("ufficio", ufficio); response.setRenderParameter("tabs1", ParamUtil.getString(request, "tabs1"));
response.setRenderParameter("ordinaPer", ordinaPer); response.setRenderParameter("orderByCol", ParamUtil.getString(request, "orderByCol"));
response.setRenderParameter("ordinaTipo", ordinaTipo); response.setRenderParameter("orderByType", ParamUtil.getString(request, "orderByType"));
response.setRenderParameter("comune", comune);
response.setRenderParameter("tipoAttivita", tipoAttivita);
response.setRenderParameter("tipoProcedura", tipoProcedura);
response.setRenderParameter("unitaOperativa", unitaOperativa);
response.setRenderParameter("provincia", provincia);
response.setRenderParameter("geologi", geologi);
response.setRenderParameter("parereGeologo", parereGeologo);
} }
public void cambioIstruttore(ActionRequest request, ActionResponse response) { public void cambioIstruttore(ActionRequest request, ActionResponse response) {
@ -474,16 +419,14 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
try { try {
Hits hits = null; Hits hits = null;
if (cmd.equals("exportRicercaMieAttivita")) { if (cmd.equals("exportRicercaMieAttivita")) {
hits = ControlloPraticaAdvancedSearch.searchMieiTask(httpRequest, user, QueryUtil.ALL_POS, hits = ControlloPraticaSearch.searchMieiTask(httpRequest, user, QueryUtil.ALL_POS, QueryUtil.ALL_POS);
QueryUtil.ALL_POS);
} else if (cmd.equals("exportRicercaMieiRuoli")) { } else if (cmd.equals("exportRicercaMieiRuoli")) {
hits = ControlloPraticaAdvancedSearch.searchTaskMieiRuoli(httpRequest, user, QueryUtil.ALL_POS, hits = ControlloPraticaSearch.searchTaskMieiRuoli(httpRequest, user, QueryUtil.ALL_POS,
QueryUtil.ALL_POS); QueryUtil.ALL_POS);
} else if (cmd.equals("exportRicercaAltreAttivita")) { } else if (cmd.equals("exportRicercaAltreAttivita")) {
hits = ControlloPraticaAdvancedSearch.searchAltriTask(httpRequest, user, QueryUtil.ALL_POS, hits = ControlloPraticaSearch.searchAltriTask(httpRequest, user, QueryUtil.ALL_POS, QueryUtil.ALL_POS);
QueryUtil.ALL_POS);
} else if (cmd.equals("exportRicercaAttivitaConcluse")) { } else if (cmd.equals("exportRicercaAttivitaConcluse")) {
hits = ControlloPraticaAdvancedSearch.searchTaskConclusi(httpRequest, user, QueryUtil.ALL_POS, hits = ControlloPraticaSearch.searchTaskConclusi(httpRequest, user, QueryUtil.ALL_POS,
QueryUtil.ALL_POS); QueryUtil.ALL_POS);
} }
for (Document doc : hits.toList()) { for (Document doc : hits.toList()) {
@ -623,10 +566,10 @@ public class GestioneAttivitaPortlet extends MVCPortlet {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
List<ControlloPratica> listaControlloPratica = new ArrayList<ControlloPratica>(); List<ControlloPratica> listaControlloPratica = new ArrayList<ControlloPratica>();
if (dirigente) { if (dirigente) {
listaControlloPratica = ControlloPraticaAdvancedSearch.searchTaskPerEsportazioneDirigente(httpRequest, listaControlloPratica = ControlloPraticaSearch.searchTaskPerEsportazioneDirigente(httpRequest, user,
user, QueryUtil.ALL_POS, QueryUtil.ALL_POS); QueryUtil.ALL_POS, QueryUtil.ALL_POS);
} else { } else {
listaControlloPratica = ControlloPraticaAdvancedSearch.searchTaskPerEsportazionePO(httpRequest, user, listaControlloPratica = ControlloPraticaSearch.searchTaskPerEsportazionePO(httpRequest, user,
QueryUtil.ALL_POS, QueryUtil.ALL_POS); QueryUtil.ALL_POS, QueryUtil.ALL_POS);
} }
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.attivita"))) sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.attivita")))

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

@ -81,11 +81,11 @@ public class GestioneFirmePortlet extends MVCPortlet {
public void simulaFirma(ActionRequest request, ActionResponse response) throws Exception { public void simulaFirma(ActionRequest request, ActionResponse response) throws Exception {
ServiceContext serviceContext = ServiceContextFactory.getInstance(request); ServiceContext serviceContext = ServiceContextFactory.getInstance(request);
if (ConfigurazioneLocalServiceUtil.isDeveloper(serviceContext.getUserId())) { if (ConfigurazioneLocalServiceUtil.isProduction()) {
throw new PortletException("Firma simulata non permessa");
} else {
long avvisoId = ParamUtil.getLong(request, "avvisoId"); long avvisoId = ParamUtil.getLong(request, "avvisoId");
AvvisoLocalServiceUtil.simulaFirma(avvisoId, serviceContext); AvvisoLocalServiceUtil.simulaFirma(avvisoId, serviceContext);
} else {
throw new PortletException("Firma simulata non permessa");
} }
} }

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

@ -14,12 +14,15 @@ import javax.portlet.ActionResponse;
import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.search.SearchContext;
import com.liferay.portal.kernel.search.SearchContextFactory;
import com.liferay.portal.kernel.util.ParamUtil; import com.liferay.portal.kernel.util.ParamUtil;
import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.kernel.util.WebKeys; import com.liferay.portal.kernel.util.WebKeys;
import com.liferay.portal.service.ServiceContext; import com.liferay.portal.service.ServiceContext;
import com.liferay.portal.service.ServiceContextFactory; import com.liferay.portal.service.ServiceContextFactory;
import com.liferay.portal.theme.ThemeDisplay; import com.liferay.portal.theme.ThemeDisplay;
import com.liferay.portal.util.PortalUtil;
import com.liferay.util.bridges.mvc.MVCPortlet; import com.liferay.util.bridges.mvc.MVCPortlet;
public class PaesaggisticaAdministrationPortlet extends MVCPortlet { public class PaesaggisticaAdministrationPortlet extends MVCPortlet {
@ -51,13 +54,11 @@ public class PaesaggisticaAdministrationPortlet extends MVCPortlet {
} }
} }
public void reIndexFascicoli(ActionRequest request, ActionResponse response) { public void reIndexFascicoli(ActionRequest request, ActionResponse response) throws SystemException {
ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY); ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);
List<String> esito = null; List<String> esito = SismicaUtil.reIndexFascicoli(themeDisplay.getCompanyId());
esito = SismicaUtil.reIndexFascicoli(themeDisplay.getCompanyId()); response.setRenderParameter("esito", esito.toArray(new String[esito.size()]));
if (esito != null)
response.setRenderParameter("esito", esito.toArray(new String[esito.size()]));
} }
public void manutenzioneDatabase(ActionRequest request, ActionResponse response) throws PortalException, public void manutenzioneDatabase(ActionRequest request, ActionResponse response) throws PortalException,
@ -65,7 +66,8 @@ public class PaesaggisticaAdministrationPortlet extends MVCPortlet {
String mode = ParamUtil.getString(request, "mode"); String mode = ParamUtil.getString(request, "mode");
ServiceContext serviceContext = ServiceContextFactory.getInstance(request); ServiceContext serviceContext = ServiceContextFactory.getInstance(request);
List<String> esito = ManutenzioneDatabase.pulisci(serviceContext, mode); SearchContext searchContext = SearchContextFactory.getInstance(PortalUtil.getHttpServletRequest(request));
List<String> esito = ManutenzioneDatabase.pulisci(serviceContext, searchContext, mode);
response.setRenderParameter("esito", esito.toArray(new String[esito.size()])); response.setRenderParameter("esito", esito.toArray(new String[esito.size()]));
} }
} }

11
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/RicercaProtocolloPortlet.java

@ -1,5 +1,7 @@
package it.tref.liferay.portos.bo.portlet; package it.tref.liferay.portos.bo.portlet;
import java.util.Arrays;
import javax.portlet.ActionRequest; import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse; import javax.portlet.ActionResponse;
@ -11,11 +13,8 @@ public class RicercaProtocolloPortlet extends MVCPortlet {
public void search(ActionRequest actionRequest, ActionResponse actionResponse) { public void search(ActionRequest actionRequest, ActionResponse actionResponse) {
String dataDa = ParamUtil.getString(actionRequest, "dataDa", StringPool.BLANK); for (String param : Arrays.asList("dataDa", "dataA", "numeroProtocollo")) {
String dataA = ParamUtil.getString(actionRequest, "dataA", StringPool.BLANK); actionResponse.setRenderParameter(param, ParamUtil.getString(actionRequest, param, StringPool.BLANK));
String numeroProtocollo = ParamUtil.getString(actionRequest, "numeroProtocollo", StringPool.BLANK); }
actionResponse.setRenderParameter("dataDa", dataDa);
actionResponse.setRenderParameter("dataA", dataA);
actionResponse.setRenderParameter("numeroProtocollo", numeroProtocollo);
} }
} }

20
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/report/builder/builder/ReportAvvisoBeanBuilder.java

@ -53,8 +53,7 @@ import com.liferay.portal.service.UserLocalServiceUtil;
public class ReportAvvisoBeanBuilder { public class ReportAvvisoBeanBuilder {
private ReportAvvisoBeanBuilder() { private ReportAvvisoBeanBuilder() {}
}
public static ReportAvvisoBean build(Avviso avviso, Map<String, Object> parameters) throws SystemException, public static ReportAvvisoBean build(Avviso avviso, Map<String, Object> parameters) throws SystemException,
PortalException { PortalException {
@ -176,8 +175,10 @@ public class ReportAvvisoBeanBuilder {
bean.setDataAvviso(avviso.getModifiedDate()); bean.setDataAvviso(avviso.getModifiedDate());
bean.setTipoPratica(intPratica.getTipoPratica()); bean.setTipoPratica(intPratica.getTipoPratica());
bean.setTipoProcedura(intPratica.getTipoProcedura()); bean.setTipoProcedura(intPratica.getTipoProcedura());
bean.setTipoAutorizzazione(LanguageUtil.get(LocaleUtil.getSiteDefault(), "label_procedura_" + intPratica.getTipoProcedura()) + ") " + bean.setTipoAutorizzazione(LanguageUtil.get(LocaleUtil.getSiteDefault(),
LanguageUtil.get(LocaleUtil.getSiteDefault(), "tipo_procedura_" + intPratica.getTipoProcedura())); "label_procedura_" + intPratica.getTipoProcedura())
+ ") "
+ LanguageUtil.get(LocaleUtil.getSiteDefault(), "tipo_procedura_" + intPratica.getTipoProcedura()));
bean.setCodiceUnivoco(uuid); bean.setCodiceUnivoco(uuid);
bean.setLavoriDi(dettPratica.getDescLongIntervento()); bean.setLavoriDi(dettPratica.getDescLongIntervento());
bean.setNumeroProgetto(intPratica.getNumeroProgetto()); bean.setNumeroProgetto(intPratica.getNumeroProgetto());
@ -215,14 +216,13 @@ public class ReportAvvisoBeanBuilder {
intPraticaId, dettPratica.getCodiceFiscalePrincipaleDirettoreLavori(), intPraticaId, dettPratica.getCodiceFiscalePrincipaleDirettoreLavori(),
TipoSoggettoUtil.DIRETTORE_LAVORI); TipoSoggettoUtil.DIRETTORE_LAVORI);
if (Validator.isNotNull(direttoreLavoriBean)) { if (Validator.isNotNull(direttoreLavoriBean)) {
String direttoreLavori = direttoreLavoriBean.getNome() + StringPool.SPACE String direttoreLavori = direttoreLavoriBean.getNome() + ' ' + direttoreLavoriBean.getCognome();
+ direttoreLavoriBean.getCognome();
bean.setDirettoreLavori(direttoreLavori); bean.setDirettoreLavori(direttoreLavori);
} }
Soggetto collaudatoreBean = SoggettoLocalServiceUtil.getValidByIntPratica_CodiceFiscale_TipologiaSoggetto( Soggetto collaudatoreBean = SoggettoLocalServiceUtil.getValidByIntPratica_CodiceFiscale_TipologiaSoggetto(
intPraticaId, dettPratica.getCodiceFiscalePrincipaleCollaudatore(), TipoSoggettoUtil.COLLAUDATORE); intPraticaId, dettPratica.getCodiceFiscalePrincipaleCollaudatore(), TipoSoggettoUtil.COLLAUDATORE);
if (Validator.isNotNull(collaudatoreBean)) { if (Validator.isNotNull(collaudatoreBean)) {
String collaudatore = collaudatoreBean.getNome() + StringPool.SPACE + collaudatoreBean.getCognome(); String collaudatore = collaudatoreBean.getNome() + ' ' + collaudatoreBean.getCognome();
bean.setCollaudatore(collaudatore); bean.setCollaudatore(collaudatore);
} }
if (WorkflowUtil.isWorkflowDisattivabile(intPraticaId)) { if (WorkflowUtil.isWorkflowDisattivabile(intPraticaId)) {
@ -240,8 +240,7 @@ public class ReportAvvisoBeanBuilder {
if (parameters.containsKey("dataProtocolloAnnullato")) { if (parameters.containsKey("dataProtocolloAnnullato")) {
try { try {
bean.setDataProtocolloAnnullato(dfmt.parse((String) parameters.get("dataProtocolloAnnullato"))); bean.setDataProtocolloAnnullato(dfmt.parse((String) parameters.get("dataProtocolloAnnullato")));
} catch (ParseException e) { } catch (ParseException e) {}
}
} }
if (parameters.containsKey("numeroProtocolloAnnullato")) { if (parameters.containsKey("numeroProtocolloAnnullato")) {
bean.setNumeroProtocolloAnnullato((String) parameters.get("numeroProtocolloAnnullato")); bean.setNumeroProtocolloAnnullato((String) parameters.get("numeroProtocolloAnnullato"));
@ -252,8 +251,7 @@ public class ReportAvvisoBeanBuilder {
if (parameters.containsKey("dataProtocolloValido")) { if (parameters.containsKey("dataProtocolloValido")) {
try { try {
bean.setDataProtocolloValido(dfmt.parse((String) parameters.get("dataProtocolloValido"))); bean.setDataProtocolloValido(dfmt.parse((String) parameters.get("dataProtocolloValido")));
} catch (ParseException e) { } catch (ParseException e) {}
}
} }
if (parameters.containsKey("numeroProtocolloValido")) { if (parameters.containsKey("numeroProtocolloValido")) {
bean.setNumeroProtocolloValido((String) parameters.get("numeroProtocolloValido")); bean.setNumeroProtocolloValido((String) parameters.get("numeroProtocolloValido"));

445
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/base/IntPraticaLocalServiceClpInvoker.java

@ -134,261 +134,265 @@ public class IntPraticaLocalServiceClpInvoker {
_methodParameterTypes176 = new String[] { }; _methodParameterTypes176 = new String[] { };
_methodName177 = "addIntPratica"; _methodName177 = "getVecchieProcedure";
_methodParameterTypes177 = new String[] { _methodParameterTypes177 = new String[] { };
_methodName178 = "addIntPratica";
_methodParameterTypes178 = new String[] {
"long", "java.lang.String", "long", "java.lang.String",
"com.liferay.portal.service.ServiceContext" "com.liferay.portal.service.ServiceContext"
}; };
_methodName178 = "addIntPratica"; _methodName179 = "addIntPratica";
_methodParameterTypes178 = new String[] { _methodParameterTypes179 = new String[] {
"long", "java.lang.String", "java.lang.String", "long", "long", "java.lang.String", "java.lang.String", "long",
"java.lang.String", "java.lang.String", "java.lang.String", "java.lang.String", "java.lang.String", "java.lang.String",
"boolean", "int", "java.util.Date", "boolean", "int", "java.util.Date",
"com.liferay.portal.service.ServiceContext" "com.liferay.portal.service.ServiceContext"
}; };
_methodName179 = "deleteIntPratica"; _methodName180 = "deleteIntPratica";
_methodParameterTypes179 = new String[] { _methodParameterTypes180 = new String[] {
"it.tref.liferay.portos.bo.model.IntPratica", "boolean" "it.tref.liferay.portos.bo.model.IntPratica", "boolean"
}; };
_methodName180 = "deleteIntPratica"; _methodName181 = "deleteIntPratica";
_methodParameterTypes180 = new String[] { _methodParameterTypes181 = new String[] {
"it.tref.liferay.portos.bo.model.IntPratica" "it.tref.liferay.portos.bo.model.IntPratica"
}; };
_methodName181 = "cloneIntPratica"; _methodName182 = "cloneIntPratica";
_methodParameterTypes181 = new String[] { _methodParameterTypes182 = new String[] {
"long", "com.liferay.portal.service.ServiceContext" "long", "com.liferay.portal.service.ServiceContext"
}; };
_methodName183 = "updateDelegati"; _methodName184 = "updateDelegati";
_methodParameterTypes183 = new String[] { _methodParameterTypes184 = new String[] {
"long", "java.lang.String", "java.lang.String", "boolean" "long", "java.lang.String", "java.lang.String", "boolean"
}; };
_methodName184 = "fetchIntPratica"; _methodName185 = "fetchIntPratica";
_methodParameterTypes184 = new String[] { "long" }; _methodParameterTypes185 = new String[] { "long" };
_methodName185 = "findFascicoliNotProgetto"; _methodName186 = "findFascicoliNotProgetto";
_methodParameterTypes185 = new String[] { "int", "int" }; _methodParameterTypes186 = new String[] { "int", "int" };
_methodName186 = "countFascicoliNotProgetto"; _methodName187 = "countFascicoliNotProgetto";
_methodParameterTypes186 = new String[] { }; _methodParameterTypes187 = new String[] { };
_methodName188 = "countByPosizione"; _methodName189 = "countByPosizione";
_methodParameterTypes188 = new String[] { "double", "double", "int" };
_methodName189 = "findByPosizione";
_methodParameterTypes189 = new String[] { "double", "double", "int" }; _methodParameterTypes189 = new String[] { "double", "double", "int" };
_methodName190 = "findByPosizione"; _methodName190 = "findByPosizione";
_methodParameterTypes190 = new String[] { _methodParameterTypes190 = new String[] { "double", "double", "int" };
_methodName191 = "findByPosizione";
_methodParameterTypes191 = new String[] {
"double", "double", "int", "int", "int" "double", "double", "int", "int", "int"
}; };
_methodName192 = "addNumeroProgetto"; _methodName193 = "addNumeroProgetto";
_methodParameterTypes192 = new String[] { "long" }; _methodParameterTypes193 = new String[] { "long" };
_methodName193 = "sospendiPratica"; _methodName194 = "sospendiPratica";
_methodParameterTypes193 = new String[] { "long", "boolean" }; _methodParameterTypes194 = new String[] { "long", "boolean" };
_methodName194 = "cambiaTitolare"; _methodName195 = "cambiaTitolare";
_methodParameterTypes194 = new String[] { _methodParameterTypes195 = new String[] {
"long", "long", "com.liferay.portal.service.ServiceContext" "long", "long", "com.liferay.portal.service.ServiceContext"
}; };
_methodName195 = "updateStatoPratica"; _methodName196 = "updateStatoPratica";
_methodParameterTypes195 = new String[] { "long", "java.lang.String" }; _methodParameterTypes196 = new String[] { "long", "java.lang.String" };
_methodName196 = "findByC_UserId"; _methodName197 = "findByC_UserId";
_methodParameterTypes196 = new String[] { "long", "long", "int", "int" }; _methodParameterTypes197 = new String[] { "long", "long", "int", "int" };
_methodName197 = "countByC_UserId"; _methodName198 = "countByC_UserId";
_methodParameterTypes197 = new String[] { "long", "long" }; _methodParameterTypes198 = new String[] { "long", "long" };
_methodName198 = "updateStatus"; _methodName199 = "updateStatus";
_methodParameterTypes198 = new String[] { "long", "int" }; _methodParameterTypes199 = new String[] { "long", "int" };
_methodName199 = "findByCompanyIdSoggettoProgetti"; _methodName200 = "findByCompanyIdSoggettoProgetti";
_methodParameterTypes199 = new String[] { "long", "long" };
_methodName200 = "countByCompanyIdSoggettoProgetti";
_methodParameterTypes200 = new String[] { "long", "long" }; _methodParameterTypes200 = new String[] { "long", "long" };
_methodName202 = "findByCompanyIdSoggettoArchivio"; _methodName201 = "countByCompanyIdSoggettoProgetti";
_methodParameterTypes202 = new String[] { "long", "long" }; _methodParameterTypes201 = new String[] { "long", "long" };
_methodName203 = "countByCompanyIdSoggettoArchivio"; _methodName203 = "findByCompanyIdSoggettoArchivio";
_methodParameterTypes203 = new String[] { "long", "long" }; _methodParameterTypes203 = new String[] { "long", "long" };
_methodName205 = "findByCompanyIdSoggettoAltriProgetti"; _methodName204 = "countByCompanyIdSoggettoArchivio";
_methodParameterTypes204 = new String[] { "long", "long" };
_methodParameterTypes205 = new String[] { "long", "long", "int", "int" }; _methodName206 = "findByCompanyIdSoggettoAltriProgetti";
_methodName206 = "countByCompanyIdSoggettoAltriProgetti"; _methodParameterTypes206 = new String[] { "long", "long", "int", "int" };
_methodParameterTypes206 = new String[] { "long", "long" }; _methodName207 = "countByCompanyIdSoggettoAltriProgetti";
_methodName208 = "findByCanAddFineLavori"; _methodParameterTypes207 = new String[] { "long", "long" };
_methodParameterTypes208 = new String[] { _methodName209 = "findByCanAddFineLavori";
_methodParameterTypes209 = new String[] {
"long", "java.lang.String", "int", "int" "long", "java.lang.String", "int", "int"
}; };
_methodName209 = "countByCanAddFineLavori"; _methodName210 = "countByCanAddFineLavori";
_methodParameterTypes209 = new String[] { "long", "java.lang.String" }; _methodParameterTypes210 = new String[] { "long", "java.lang.String" };
_methodName211 = "findByCanAddCollaudo"; _methodName212 = "findByCanAddCollaudo";
_methodParameterTypes211 = new String[] { _methodParameterTypes212 = new String[] {
"long", "java.lang.String", "int", "int" "long", "java.lang.String", "int", "int"
}; };
_methodName212 = "countByCanAddCollaudo"; _methodName213 = "countByCanAddCollaudo";
_methodParameterTypes212 = new String[] { "long", "java.lang.String" }; _methodParameterTypes213 = new String[] { "long", "java.lang.String" };
_methodName213 = "search"; _methodName214 = "search";
_methodParameterTypes213 = new String[] { "java.util.List", "int", "int" }; _methodParameterTypes214 = new String[] { "java.util.List", "int", "int" };
_methodName214 = "countSearch"; _methodName215 = "countSearch";
_methodParameterTypes214 = new String[] { "java.util.List" }; _methodParameterTypes215 = new String[] { "java.util.List" };
_methodName215 = "searchWithIntPraticaId"; _methodName216 = "searchWithIntPraticaId";
_methodParameterTypes215 = new String[] { _methodParameterTypes216 = new String[] {
"java.util.List", "long", "int", "int" "java.util.List", "long", "int", "int"
}; };
_methodName216 = "allegaFileAnnullamento"; _methodName217 = "allegaFileAnnullamento";
_methodParameterTypes216 = new String[] { _methodParameterTypes217 = new String[] {
"long", "byte[][]", "java.lang.String", "java.lang.String", "long", "byte[][]", "java.lang.String", "java.lang.String",
"com.liferay.portal.service.ServiceContext" "com.liferay.portal.service.ServiceContext"
}; };
_methodName217 = "generateFileAnnullamento"; _methodName218 = "generateFileAnnullamento";
_methodParameterTypes217 = new String[] { _methodParameterTypes218 = new String[] {
"long", "com.liferay.portal.service.ServiceContext" "long", "com.liferay.portal.service.ServiceContext"
}; };
_methodName218 = "deleteFileAnnullamento"; _methodName219 = "deleteFileAnnullamento";
_methodParameterTypes218 = new String[] { "long" }; _methodParameterTypes219 = new String[] { "long" };
_methodName219 = "completeAnnullamento"; _methodName220 = "completeAnnullamento";
_methodParameterTypes219 = new String[] { "long" }; _methodParameterTypes220 = new String[] { "long" };
_methodName220 = "cambiaIstruttore"; _methodName221 = "cambiaIstruttore";
_methodParameterTypes220 = new String[] { "long", "long", "long" }; _methodParameterTypes221 = new String[] { "long", "long", "long" };
_methodName221 = "countCaricoLavoroCF"; _methodName222 = "countCaricoLavoroCF";
_methodParameterTypes221 = new String[] { _methodParameterTypes222 = new String[] {
"long", "java.lang.String", "java.lang.Long[][]" "long", "java.lang.String", "java.lang.Long[][]"
}; };
_methodName222 = "countCaricoLavoroIstruttore"; _methodName223 = "countCaricoLavoroIstruttore";
_methodParameterTypes222 = new String[] { "long", "java.lang.String" }; _methodParameterTypes223 = new String[] { "long", "java.lang.String" };
_methodName223 = "generateReportPratica"; _methodName224 = "generateReportPratica";
_methodParameterTypes223 = new String[] { _methodParameterTypes224 = new String[] {
"it.tref.liferay.portos.bo.model.IntPratica", "long" "it.tref.liferay.portos.bo.model.IntPratica", "long"
}; };
_methodName224 = "updateModifiedDate"; _methodName225 = "updateModifiedDate";
_methodParameterTypes224 = new String[] { "long", "java.util.Date" }; _methodParameterTypes225 = new String[] { "long", "java.util.Date" };
_methodName225 = "reIndexFascicolo"; _methodName226 = "reIndexFascicolo";
_methodParameterTypes225 = new String[] { _methodParameterTypes226 = new String[] {
"it.tref.liferay.portos.bo.model.IntPratica", "long" "it.tref.liferay.portos.bo.model.IntPratica", "long"
}; };
_methodName226 = "reIndexFasciolo";
_methodParameterTypes226 = new String[] { "java.lang.String", "long" };
_methodName227 = "reIndexFasciolo"; _methodName227 = "reIndexFasciolo";
_methodParameterTypes227 = new String[] { "long", "long" }; _methodParameterTypes227 = new String[] { "java.lang.String", "long" };
_methodName228 = "findByNumeroProgetto"; _methodName228 = "reIndexFasciolo";
_methodParameterTypes228 = new String[] { "java.lang.String" }; _methodParameterTypes228 = new String[] { "long", "long" };
_methodName229 = "findByTerritorioId"; _methodName229 = "findByNumeroProgetto";
_methodParameterTypes229 = new String[] { "long" }; _methodParameterTypes229 = new String[] { "java.lang.String" };
_methodName230 = "getOrganizationByIntPraticaId"; _methodName230 = "findByTerritorioId";
_methodParameterTypes230 = new String[] { "long" }; _methodParameterTypes230 = new String[] { "long" };
_methodName231 = "hasRichiestaIntegrazioneAttiva"; _methodName231 = "getOrganizationByIntPraticaId";
_methodParameterTypes231 = new String[] { "long" }; _methodParameterTypes231 = new String[] { "long" };
_methodName232 = "invioMailNotifica"; _methodName232 = "hasRichiestaIntegrazioneAttiva";
_methodParameterTypes232 = new String[] { "long" };
_methodParameterTypes232 = new String[] { _methodName233 = "invioMailNotifica";
_methodParameterTypes233 = new String[] {
"long", "long", "java.lang.String", "java.lang.String[][]", "long", "long", "java.lang.String", "java.lang.String[][]",
"java.lang.String[][]", "java.lang.String[][]", "java.lang.String[][]", "java.lang.String[][]",
"java.lang.String", "com.liferay.portal.kernel.json.JSONObject", "java.lang.String", "com.liferay.portal.kernel.json.JSONObject",
"java.util.List", "com.liferay.portal.service.ServiceContext" "java.util.List", "com.liferay.portal.service.ServiceContext"
}; };
_methodName233 = "searchAltriProgetti"; _methodName234 = "searchAltriProgetti";
_methodParameterTypes233 = new String[] { _methodParameterTypes234 = new String[] {
"javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletRequest",
"com.liferay.portal.model.User", "int", "int" "com.liferay.portal.model.User", "int", "int"
}; };
_methodName234 = "searchArchivioProgetti"; _methodName235 = "searchArchivioProgetti";
_methodParameterTypes234 = new String[] { _methodParameterTypes235 = new String[] {
"javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletRequest",
"com.liferay.portal.model.User", "int", "int" "com.liferay.portal.model.User", "int", "int"
}; };
_methodName235 = "searchMieiProgetti"; _methodName236 = "searchMieiProgetti";
_methodParameterTypes235 = new String[] { _methodParameterTypes236 = new String[] {
"javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletRequest",
"com.liferay.portal.model.User", "int", "int" "com.liferay.portal.model.User", "int", "int"
}; };
@ -526,13 +530,18 @@ public class IntPraticaLocalServiceClpInvoker {
if (_methodName177.equals(name) && if (_methodName177.equals(name) &&
Arrays.deepEquals(_methodParameterTypes177, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes177, parameterTypes)) {
return IntPraticaLocalServiceUtil.getVecchieProcedure();
}
if (_methodName178.equals(name) &&
Arrays.deepEquals(_methodParameterTypes178, parameterTypes)) {
return IntPraticaLocalServiceUtil.addIntPratica(((Long)arguments[0]).longValue(), return IntPraticaLocalServiceUtil.addIntPratica(((Long)arguments[0]).longValue(),
(java.lang.String)arguments[1], (java.lang.String)arguments[1],
(com.liferay.portal.service.ServiceContext)arguments[2]); (com.liferay.portal.service.ServiceContext)arguments[2]);
} }
if (_methodName178.equals(name) && if (_methodName179.equals(name) &&
Arrays.deepEquals(_methodParameterTypes178, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes179, parameterTypes)) {
return IntPraticaLocalServiceUtil.addIntPratica(((Long)arguments[0]).longValue(), return IntPraticaLocalServiceUtil.addIntPratica(((Long)arguments[0]).longValue(),
(java.lang.String)arguments[1], (java.lang.String)arguments[2], (java.lang.String)arguments[1], (java.lang.String)arguments[2],
((Long)arguments[3]).longValue(), ((Long)arguments[3]).longValue(),
@ -544,62 +553,62 @@ public class IntPraticaLocalServiceClpInvoker {
(com.liferay.portal.service.ServiceContext)arguments[10]); (com.liferay.portal.service.ServiceContext)arguments[10]);
} }
if (_methodName179.equals(name) && if (_methodName180.equals(name) &&
Arrays.deepEquals(_methodParameterTypes179, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes180, parameterTypes)) {
return IntPraticaLocalServiceUtil.deleteIntPratica((it.tref.liferay.portos.bo.model.IntPratica)arguments[0], return IntPraticaLocalServiceUtil.deleteIntPratica((it.tref.liferay.portos.bo.model.IntPratica)arguments[0],
((Boolean)arguments[1]).booleanValue()); ((Boolean)arguments[1]).booleanValue());
} }
if (_methodName180.equals(name) && if (_methodName181.equals(name) &&
Arrays.deepEquals(_methodParameterTypes180, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes181, parameterTypes)) {
return IntPraticaLocalServiceUtil.deleteIntPratica((it.tref.liferay.portos.bo.model.IntPratica)arguments[0]); return IntPraticaLocalServiceUtil.deleteIntPratica((it.tref.liferay.portos.bo.model.IntPratica)arguments[0]);
} }
if (_methodName181.equals(name) && if (_methodName182.equals(name) &&
Arrays.deepEquals(_methodParameterTypes181, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes182, parameterTypes)) {
return IntPraticaLocalServiceUtil.cloneIntPratica(((Long)arguments[0]).longValue(), return IntPraticaLocalServiceUtil.cloneIntPratica(((Long)arguments[0]).longValue(),
(com.liferay.portal.service.ServiceContext)arguments[1]); (com.liferay.portal.service.ServiceContext)arguments[1]);
} }
if (_methodName183.equals(name) && if (_methodName184.equals(name) &&
Arrays.deepEquals(_methodParameterTypes183, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes184, parameterTypes)) {
return IntPraticaLocalServiceUtil.updateDelegati(((Long)arguments[0]).longValue(), return IntPraticaLocalServiceUtil.updateDelegati(((Long)arguments[0]).longValue(),
(java.lang.String)arguments[1], (java.lang.String)arguments[2], (java.lang.String)arguments[1], (java.lang.String)arguments[2],
((Boolean)arguments[3]).booleanValue()); ((Boolean)arguments[3]).booleanValue());
} }
if (_methodName184.equals(name) && if (_methodName185.equals(name) &&
Arrays.deepEquals(_methodParameterTypes184, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes185, parameterTypes)) {
return IntPraticaLocalServiceUtil.fetchIntPratica(((Long)arguments[0]).longValue()); return IntPraticaLocalServiceUtil.fetchIntPratica(((Long)arguments[0]).longValue());
} }
if (_methodName185.equals(name) && if (_methodName186.equals(name) &&
Arrays.deepEquals(_methodParameterTypes185, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes186, parameterTypes)) {
return IntPraticaLocalServiceUtil.findFascicoliNotProgetto(((Integer)arguments[0]).intValue(), return IntPraticaLocalServiceUtil.findFascicoliNotProgetto(((Integer)arguments[0]).intValue(),
((Integer)arguments[1]).intValue()); ((Integer)arguments[1]).intValue());
} }
if (_methodName186.equals(name) && if (_methodName187.equals(name) &&
Arrays.deepEquals(_methodParameterTypes186, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes187, parameterTypes)) {
return IntPraticaLocalServiceUtil.countFascicoliNotProgetto(); return IntPraticaLocalServiceUtil.countFascicoliNotProgetto();
} }
if (_methodName188.equals(name) && if (_methodName189.equals(name) &&
Arrays.deepEquals(_methodParameterTypes188, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes189, parameterTypes)) {
return IntPraticaLocalServiceUtil.countByPosizione(((Double)arguments[0]).doubleValue(), return IntPraticaLocalServiceUtil.countByPosizione(((Double)arguments[0]).doubleValue(),
((Double)arguments[1]).doubleValue(), ((Double)arguments[1]).doubleValue(),
((Integer)arguments[2]).intValue()); ((Integer)arguments[2]).intValue());
} }
if (_methodName189.equals(name) && if (_methodName190.equals(name) &&
Arrays.deepEquals(_methodParameterTypes189, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes190, parameterTypes)) {
return IntPraticaLocalServiceUtil.findByPosizione(((Double)arguments[0]).doubleValue(), return IntPraticaLocalServiceUtil.findByPosizione(((Double)arguments[0]).doubleValue(),
((Double)arguments[1]).doubleValue(), ((Double)arguments[1]).doubleValue(),
((Integer)arguments[2]).intValue()); ((Integer)arguments[2]).intValue());
} }
if (_methodName190.equals(name) && if (_methodName191.equals(name) &&
Arrays.deepEquals(_methodParameterTypes190, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes191, parameterTypes)) {
return IntPraticaLocalServiceUtil.findByPosizione(((Double)arguments[0]).doubleValue(), return IntPraticaLocalServiceUtil.findByPosizione(((Double)arguments[0]).doubleValue(),
((Double)arguments[1]).doubleValue(), ((Double)arguments[1]).doubleValue(),
((Integer)arguments[2]).intValue(), ((Integer)arguments[2]).intValue(),
@ -607,168 +616,168 @@ public class IntPraticaLocalServiceClpInvoker {
((Integer)arguments[4]).intValue()); ((Integer)arguments[4]).intValue());
} }
if (_methodName192.equals(name) && if (_methodName193.equals(name) &&
Arrays.deepEquals(_methodParameterTypes192, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes193, parameterTypes)) {
return IntPraticaLocalServiceUtil.addNumeroProgetto(((Long)arguments[0]).longValue()); return IntPraticaLocalServiceUtil.addNumeroProgetto(((Long)arguments[0]).longValue());
} }
if (_methodName193.equals(name) && if (_methodName194.equals(name) &&
Arrays.deepEquals(_methodParameterTypes193, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes194, parameterTypes)) {
return IntPraticaLocalServiceUtil.sospendiPratica(((Long)arguments[0]).longValue(), return IntPraticaLocalServiceUtil.sospendiPratica(((Long)arguments[0]).longValue(),
((Boolean)arguments[1]).booleanValue()); ((Boolean)arguments[1]).booleanValue());
} }
if (_methodName194.equals(name) && if (_methodName195.equals(name) &&
Arrays.deepEquals(_methodParameterTypes194, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes195, parameterTypes)) {
return IntPraticaLocalServiceUtil.cambiaTitolare(((Long)arguments[0]).longValue(), return IntPraticaLocalServiceUtil.cambiaTitolare(((Long)arguments[0]).longValue(),
((Long)arguments[1]).longValue(), ((Long)arguments[1]).longValue(),
(com.liferay.portal.service.ServiceContext)arguments[2]); (com.liferay.portal.service.ServiceContext)arguments[2]);
} }
if (_methodName195.equals(name) && if (_methodName196.equals(name) &&
Arrays.deepEquals(_methodParameterTypes195, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes196, parameterTypes)) {
return IntPraticaLocalServiceUtil.updateStatoPratica(((Long)arguments[0]).longValue(), return IntPraticaLocalServiceUtil.updateStatoPratica(((Long)arguments[0]).longValue(),
(java.lang.String)arguments[1]); (java.lang.String)arguments[1]);
} }
if (_methodName196.equals(name) && if (_methodName197.equals(name) &&
Arrays.deepEquals(_methodParameterTypes196, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes197, parameterTypes)) {
return IntPraticaLocalServiceUtil.findByC_UserId(((Long)arguments[0]).longValue(), return IntPraticaLocalServiceUtil.findByC_UserId(((Long)arguments[0]).longValue(),
((Long)arguments[1]).longValue(), ((Long)arguments[1]).longValue(),
((Integer)arguments[2]).intValue(), ((Integer)arguments[2]).intValue(),
((Integer)arguments[3]).intValue()); ((Integer)arguments[3]).intValue());
} }
if (_methodName197.equals(name) && if (_methodName198.equals(name) &&
Arrays.deepEquals(_methodParameterTypes197, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes198, parameterTypes)) {
return IntPraticaLocalServiceUtil.countByC_UserId(((Long)arguments[0]).longValue(), return IntPraticaLocalServiceUtil.countByC_UserId(((Long)arguments[0]).longValue(),
((Long)arguments[1]).longValue()); ((Long)arguments[1]).longValue());
} }
if (_methodName198.equals(name) && if (_methodName199.equals(name) &&
Arrays.deepEquals(_methodParameterTypes198, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes199, parameterTypes)) {
IntPraticaLocalServiceUtil.updateStatus(((Long)arguments[0]).longValue(), IntPraticaLocalServiceUtil.updateStatus(((Long)arguments[0]).longValue(),
((Integer)arguments[1]).intValue()); ((Integer)arguments[1]).intValue());
return null; return null;
} }
if (_methodName199.equals(name) && if (_methodName200.equals(name) &&
Arrays.deepEquals(_methodParameterTypes199, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes200, parameterTypes)) {
return IntPraticaLocalServiceUtil.findByCompanyIdSoggettoProgetti(((Long)arguments[0]).longValue(), return IntPraticaLocalServiceUtil.findByCompanyIdSoggettoProgetti(((Long)arguments[0]).longValue(),
((Long)arguments[1]).longValue()); ((Long)arguments[1]).longValue());
} }
if (_methodName200.equals(name) && if (_methodName201.equals(name) &&
Arrays.deepEquals(_methodParameterTypes200, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes201, parameterTypes)) {
return IntPraticaLocalServiceUtil.countByCompanyIdSoggettoProgetti(((Long)arguments[0]).longValue(), return IntPraticaLocalServiceUtil.countByCompanyIdSoggettoProgetti(((Long)arguments[0]).longValue(),
((Long)arguments[1]).longValue()); ((Long)arguments[1]).longValue());
} }
if (_methodName202.equals(name) && if (_methodName203.equals(name) &&
Arrays.deepEquals(_methodParameterTypes202, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes203, parameterTypes)) {
return IntPraticaLocalServiceUtil.findByCompanyIdSoggettoArchivio(((Long)arguments[0]).longValue(), return IntPraticaLocalServiceUtil.findByCompanyIdSoggettoArchivio(((Long)arguments[0]).longValue(),
((Long)arguments[1]).longValue()); ((Long)arguments[1]).longValue());
} }
if (_methodName203.equals(name) && if (_methodName204.equals(name) &&
Arrays.deepEquals(_methodParameterTypes203, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes204, parameterTypes)) {
return IntPraticaLocalServiceUtil.countByCompanyIdSoggettoArchivio(((Long)arguments[0]).longValue(), return IntPraticaLocalServiceUtil.countByCompanyIdSoggettoArchivio(((Long)arguments[0]).longValue(),
((Long)arguments[1]).longValue()); ((Long)arguments[1]).longValue());
} }
if (_methodName205.equals(name) && if (_methodName206.equals(name) &&
Arrays.deepEquals(_methodParameterTypes205, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes206, parameterTypes)) {
return IntPraticaLocalServiceUtil.findByCompanyIdSoggettoAltriProgetti(((Long)arguments[0]).longValue(), return IntPraticaLocalServiceUtil.findByCompanyIdSoggettoAltriProgetti(((Long)arguments[0]).longValue(),
((Long)arguments[1]).longValue(), ((Long)arguments[1]).longValue(),
((Integer)arguments[2]).intValue(), ((Integer)arguments[2]).intValue(),
((Integer)arguments[3]).intValue()); ((Integer)arguments[3]).intValue());
} }
if (_methodName206.equals(name) && if (_methodName207.equals(name) &&
Arrays.deepEquals(_methodParameterTypes206, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes207, parameterTypes)) {
return IntPraticaLocalServiceUtil.countByCompanyIdSoggettoAltriProgetti(((Long)arguments[0]).longValue(), return IntPraticaLocalServiceUtil.countByCompanyIdSoggettoAltriProgetti(((Long)arguments[0]).longValue(),
((Long)arguments[1]).longValue()); ((Long)arguments[1]).longValue());
} }
if (_methodName208.equals(name) && if (_methodName209.equals(name) &&
Arrays.deepEquals(_methodParameterTypes208, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes209, parameterTypes)) {
return IntPraticaLocalServiceUtil.findByCanAddFineLavori(((Long)arguments[0]).longValue(), return IntPraticaLocalServiceUtil.findByCanAddFineLavori(((Long)arguments[0]).longValue(),
(java.lang.String)arguments[1], (java.lang.String)arguments[1],
((Integer)arguments[2]).intValue(), ((Integer)arguments[2]).intValue(),
((Integer)arguments[3]).intValue()); ((Integer)arguments[3]).intValue());
} }
if (_methodName209.equals(name) && if (_methodName210.equals(name) &&
Arrays.deepEquals(_methodParameterTypes209, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes210, parameterTypes)) {
return IntPraticaLocalServiceUtil.countByCanAddFineLavori(((Long)arguments[0]).longValue(), return IntPraticaLocalServiceUtil.countByCanAddFineLavori(((Long)arguments[0]).longValue(),
(java.lang.String)arguments[1]); (java.lang.String)arguments[1]);
} }
if (_methodName211.equals(name) && if (_methodName212.equals(name) &&
Arrays.deepEquals(_methodParameterTypes211, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes212, parameterTypes)) {
return IntPraticaLocalServiceUtil.findByCanAddCollaudo(((Long)arguments[0]).longValue(), return IntPraticaLocalServiceUtil.findByCanAddCollaudo(((Long)arguments[0]).longValue(),
(java.lang.String)arguments[1], (java.lang.String)arguments[1],
((Integer)arguments[2]).intValue(), ((Integer)arguments[2]).intValue(),
((Integer)arguments[3]).intValue()); ((Integer)arguments[3]).intValue());
} }
if (_methodName212.equals(name) && if (_methodName213.equals(name) &&
Arrays.deepEquals(_methodParameterTypes212, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes213, parameterTypes)) {
return IntPraticaLocalServiceUtil.countByCanAddCollaudo(((Long)arguments[0]).longValue(), return IntPraticaLocalServiceUtil.countByCanAddCollaudo(((Long)arguments[0]).longValue(),
(java.lang.String)arguments[1]); (java.lang.String)arguments[1]);
} }
if (_methodName213.equals(name) && if (_methodName214.equals(name) &&
Arrays.deepEquals(_methodParameterTypes213, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes214, parameterTypes)) {
return IntPraticaLocalServiceUtil.search((java.util.List<java.lang.Long>)arguments[0], return IntPraticaLocalServiceUtil.search((java.util.List<java.lang.Long>)arguments[0],
((Integer)arguments[1]).intValue(), ((Integer)arguments[1]).intValue(),
((Integer)arguments[2]).intValue()); ((Integer)arguments[2]).intValue());
} }
if (_methodName214.equals(name) && if (_methodName215.equals(name) &&
Arrays.deepEquals(_methodParameterTypes214, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes215, parameterTypes)) {
return IntPraticaLocalServiceUtil.countSearch((java.util.List<java.lang.Long>)arguments[0]); return IntPraticaLocalServiceUtil.countSearch((java.util.List<java.lang.Long>)arguments[0]);
} }
if (_methodName215.equals(name) && if (_methodName216.equals(name) &&
Arrays.deepEquals(_methodParameterTypes215, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes216, parameterTypes)) {
return IntPraticaLocalServiceUtil.searchWithIntPraticaId((java.util.List<java.lang.Long>)arguments[0], return IntPraticaLocalServiceUtil.searchWithIntPraticaId((java.util.List<java.lang.Long>)arguments[0],
((Long)arguments[1]).longValue(), ((Long)arguments[1]).longValue(),
((Integer)arguments[2]).intValue(), ((Integer)arguments[2]).intValue(),
((Integer)arguments[3]).intValue()); ((Integer)arguments[3]).intValue());
} }
if (_methodName216.equals(name) && if (_methodName217.equals(name) &&
Arrays.deepEquals(_methodParameterTypes216, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes217, parameterTypes)) {
return IntPraticaLocalServiceUtil.allegaFileAnnullamento(((Long)arguments[0]).longValue(), return IntPraticaLocalServiceUtil.allegaFileAnnullamento(((Long)arguments[0]).longValue(),
(byte[])arguments[1], (java.lang.String)arguments[2], (byte[])arguments[1], (java.lang.String)arguments[2],
(java.lang.String)arguments[3], (java.lang.String)arguments[3],
(com.liferay.portal.service.ServiceContext)arguments[4]); (com.liferay.portal.service.ServiceContext)arguments[4]);
} }
if (_methodName217.equals(name) && if (_methodName218.equals(name) &&
Arrays.deepEquals(_methodParameterTypes217, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes218, parameterTypes)) {
return IntPraticaLocalServiceUtil.generateFileAnnullamento(((Long)arguments[0]).longValue(), return IntPraticaLocalServiceUtil.generateFileAnnullamento(((Long)arguments[0]).longValue(),
(com.liferay.portal.service.ServiceContext)arguments[1]); (com.liferay.portal.service.ServiceContext)arguments[1]);
} }
if (_methodName218.equals(name) && if (_methodName219.equals(name) &&
Arrays.deepEquals(_methodParameterTypes218, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes219, parameterTypes)) {
IntPraticaLocalServiceUtil.deleteFileAnnullamento(((Long)arguments[0]).longValue()); IntPraticaLocalServiceUtil.deleteFileAnnullamento(((Long)arguments[0]).longValue());
return null; return null;
} }
if (_methodName219.equals(name) && if (_methodName220.equals(name) &&
Arrays.deepEquals(_methodParameterTypes219, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes220, parameterTypes)) {
IntPraticaLocalServiceUtil.completeAnnullamento(((Long)arguments[0]).longValue()); IntPraticaLocalServiceUtil.completeAnnullamento(((Long)arguments[0]).longValue());
return null; return null;
} }
if (_methodName220.equals(name) && if (_methodName221.equals(name) &&
Arrays.deepEquals(_methodParameterTypes220, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes221, parameterTypes)) {
IntPraticaLocalServiceUtil.cambiaIstruttore(((Long)arguments[0]).longValue(), IntPraticaLocalServiceUtil.cambiaIstruttore(((Long)arguments[0]).longValue(),
((Long)arguments[1]).longValue(), ((Long)arguments[1]).longValue(),
((Long)arguments[2]).longValue()); ((Long)arguments[2]).longValue());
@ -776,41 +785,33 @@ public class IntPraticaLocalServiceClpInvoker {
return null; return null;
} }
if (_methodName221.equals(name) &&
Arrays.deepEquals(_methodParameterTypes221, parameterTypes)) {
return IntPraticaLocalServiceUtil.countCaricoLavoroCF(((Long)arguments[0]).longValue(),
(java.lang.String)arguments[1], (java.lang.Long[])arguments[2]);
}
if (_methodName222.equals(name) && if (_methodName222.equals(name) &&
Arrays.deepEquals(_methodParameterTypes222, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes222, parameterTypes)) {
return IntPraticaLocalServiceUtil.countCaricoLavoroIstruttore(((Long)arguments[0]).longValue(), return IntPraticaLocalServiceUtil.countCaricoLavoroCF(((Long)arguments[0]).longValue(),
(java.lang.String)arguments[1]); (java.lang.String)arguments[1], (java.lang.Long[])arguments[2]);
} }
if (_methodName223.equals(name) && if (_methodName223.equals(name) &&
Arrays.deepEquals(_methodParameterTypes223, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes223, parameterTypes)) {
return IntPraticaLocalServiceUtil.generateReportPratica((it.tref.liferay.portos.bo.model.IntPratica)arguments[0], return IntPraticaLocalServiceUtil.countCaricoLavoroIstruttore(((Long)arguments[0]).longValue(),
((Long)arguments[1]).longValue()); (java.lang.String)arguments[1]);
} }
if (_methodName224.equals(name) && if (_methodName224.equals(name) &&
Arrays.deepEquals(_methodParameterTypes224, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes224, parameterTypes)) {
return IntPraticaLocalServiceUtil.updateModifiedDate(((Long)arguments[0]).longValue(), return IntPraticaLocalServiceUtil.generateReportPratica((it.tref.liferay.portos.bo.model.IntPratica)arguments[0],
(java.util.Date)arguments[1]); ((Long)arguments[1]).longValue());
} }
if (_methodName225.equals(name) && if (_methodName225.equals(name) &&
Arrays.deepEquals(_methodParameterTypes225, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes225, parameterTypes)) {
IntPraticaLocalServiceUtil.reIndexFascicolo((it.tref.liferay.portos.bo.model.IntPratica)arguments[0], return IntPraticaLocalServiceUtil.updateModifiedDate(((Long)arguments[0]).longValue(),
((Long)arguments[1]).longValue()); (java.util.Date)arguments[1]);
return null;
} }
if (_methodName226.equals(name) && if (_methodName226.equals(name) &&
Arrays.deepEquals(_methodParameterTypes226, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes226, parameterTypes)) {
IntPraticaLocalServiceUtil.reIndexFasciolo((java.lang.String)arguments[0], IntPraticaLocalServiceUtil.reIndexFascicolo((it.tref.liferay.portos.bo.model.IntPratica)arguments[0],
((Long)arguments[1]).longValue()); ((Long)arguments[1]).longValue());
return null; return null;
@ -818,7 +819,7 @@ public class IntPraticaLocalServiceClpInvoker {
if (_methodName227.equals(name) && if (_methodName227.equals(name) &&
Arrays.deepEquals(_methodParameterTypes227, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes227, parameterTypes)) {
IntPraticaLocalServiceUtil.reIndexFasciolo(((Long)arguments[0]).longValue(), IntPraticaLocalServiceUtil.reIndexFasciolo((java.lang.String)arguments[0],
((Long)arguments[1]).longValue()); ((Long)arguments[1]).longValue());
return null; return null;
@ -826,26 +827,34 @@ public class IntPraticaLocalServiceClpInvoker {
if (_methodName228.equals(name) && if (_methodName228.equals(name) &&
Arrays.deepEquals(_methodParameterTypes228, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes228, parameterTypes)) {
return IntPraticaLocalServiceUtil.findByNumeroProgetto((java.lang.String)arguments[0]); IntPraticaLocalServiceUtil.reIndexFasciolo(((Long)arguments[0]).longValue(),
((Long)arguments[1]).longValue());
return null;
} }
if (_methodName229.equals(name) && if (_methodName229.equals(name) &&
Arrays.deepEquals(_methodParameterTypes229, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes229, parameterTypes)) {
return IntPraticaLocalServiceUtil.findByTerritorioId(((Long)arguments[0]).longValue()); return IntPraticaLocalServiceUtil.findByNumeroProgetto((java.lang.String)arguments[0]);
} }
if (_methodName230.equals(name) && if (_methodName230.equals(name) &&
Arrays.deepEquals(_methodParameterTypes230, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes230, parameterTypes)) {
return IntPraticaLocalServiceUtil.getOrganizationByIntPraticaId(((Long)arguments[0]).longValue()); return IntPraticaLocalServiceUtil.findByTerritorioId(((Long)arguments[0]).longValue());
} }
if (_methodName231.equals(name) && if (_methodName231.equals(name) &&
Arrays.deepEquals(_methodParameterTypes231, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes231, parameterTypes)) {
return IntPraticaLocalServiceUtil.hasRichiestaIntegrazioneAttiva(((Long)arguments[0]).longValue()); return IntPraticaLocalServiceUtil.getOrganizationByIntPraticaId(((Long)arguments[0]).longValue());
} }
if (_methodName232.equals(name) && if (_methodName232.equals(name) &&
Arrays.deepEquals(_methodParameterTypes232, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes232, parameterTypes)) {
return IntPraticaLocalServiceUtil.hasRichiestaIntegrazioneAttiva(((Long)arguments[0]).longValue());
}
if (_methodName233.equals(name) &&
Arrays.deepEquals(_methodParameterTypes233, parameterTypes)) {
IntPraticaLocalServiceUtil.invioMailNotifica(((Long)arguments[0]).longValue(), IntPraticaLocalServiceUtil.invioMailNotifica(((Long)arguments[0]).longValue(),
((Long)arguments[1]).longValue(), ((Long)arguments[1]).longValue(),
(java.lang.String)arguments[2], (java.lang.String)arguments[2],
@ -860,24 +869,24 @@ public class IntPraticaLocalServiceClpInvoker {
return null; return null;
} }
if (_methodName233.equals(name) && if (_methodName234.equals(name) &&
Arrays.deepEquals(_methodParameterTypes233, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes234, parameterTypes)) {
return IntPraticaLocalServiceUtil.searchAltriProgetti((javax.servlet.http.HttpServletRequest)arguments[0], return IntPraticaLocalServiceUtil.searchAltriProgetti((javax.servlet.http.HttpServletRequest)arguments[0],
(com.liferay.portal.model.User)arguments[1], (com.liferay.portal.model.User)arguments[1],
((Integer)arguments[2]).intValue(), ((Integer)arguments[2]).intValue(),
((Integer)arguments[3]).intValue()); ((Integer)arguments[3]).intValue());
} }
if (_methodName234.equals(name) && if (_methodName235.equals(name) &&
Arrays.deepEquals(_methodParameterTypes234, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes235, parameterTypes)) {
return IntPraticaLocalServiceUtil.searchArchivioProgetti((javax.servlet.http.HttpServletRequest)arguments[0], return IntPraticaLocalServiceUtil.searchArchivioProgetti((javax.servlet.http.HttpServletRequest)arguments[0],
(com.liferay.portal.model.User)arguments[1], (com.liferay.portal.model.User)arguments[1],
((Integer)arguments[2]).intValue(), ((Integer)arguments[2]).intValue(),
((Integer)arguments[3]).intValue()); ((Integer)arguments[3]).intValue());
} }
if (_methodName235.equals(name) && if (_methodName236.equals(name) &&
Arrays.deepEquals(_methodParameterTypes235, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes236, parameterTypes)) {
return IntPraticaLocalServiceUtil.searchMieiProgetti((javax.servlet.http.HttpServletRequest)arguments[0], return IntPraticaLocalServiceUtil.searchMieiProgetti((javax.servlet.http.HttpServletRequest)arguments[0],
(com.liferay.portal.model.User)arguments[1], (com.liferay.portal.model.User)arguments[1],
((Integer)arguments[2]).intValue(), ((Integer)arguments[2]).intValue(),
@ -943,22 +952,22 @@ public class IntPraticaLocalServiceClpInvoker {
private String[] _methodParameterTypes180; private String[] _methodParameterTypes180;
private String _methodName181; private String _methodName181;
private String[] _methodParameterTypes181; private String[] _methodParameterTypes181;
private String _methodName183; private String _methodName182;
private String[] _methodParameterTypes183; private String[] _methodParameterTypes182;
private String _methodName184; private String _methodName184;
private String[] _methodParameterTypes184; private String[] _methodParameterTypes184;
private String _methodName185; private String _methodName185;
private String[] _methodParameterTypes185; private String[] _methodParameterTypes185;
private String _methodName186; private String _methodName186;
private String[] _methodParameterTypes186; private String[] _methodParameterTypes186;
private String _methodName188; private String _methodName187;
private String[] _methodParameterTypes188; private String[] _methodParameterTypes187;
private String _methodName189; private String _methodName189;
private String[] _methodParameterTypes189; private String[] _methodParameterTypes189;
private String _methodName190; private String _methodName190;
private String[] _methodParameterTypes190; private String[] _methodParameterTypes190;
private String _methodName192; private String _methodName191;
private String[] _methodParameterTypes192; private String[] _methodParameterTypes191;
private String _methodName193; private String _methodName193;
private String[] _methodParameterTypes193; private String[] _methodParameterTypes193;
private String _methodName194; private String _methodName194;
@ -975,20 +984,20 @@ public class IntPraticaLocalServiceClpInvoker {
private String[] _methodParameterTypes199; private String[] _methodParameterTypes199;
private String _methodName200; private String _methodName200;
private String[] _methodParameterTypes200; private String[] _methodParameterTypes200;
private String _methodName202; private String _methodName201;
private String[] _methodParameterTypes202; private String[] _methodParameterTypes201;
private String _methodName203; private String _methodName203;
private String[] _methodParameterTypes203; private String[] _methodParameterTypes203;
private String _methodName205; private String _methodName204;
private String[] _methodParameterTypes205; private String[] _methodParameterTypes204;
private String _methodName206; private String _methodName206;
private String[] _methodParameterTypes206; private String[] _methodParameterTypes206;
private String _methodName208; private String _methodName207;
private String[] _methodParameterTypes208; private String[] _methodParameterTypes207;
private String _methodName209; private String _methodName209;
private String[] _methodParameterTypes209; private String[] _methodParameterTypes209;
private String _methodName211; private String _methodName210;
private String[] _methodParameterTypes211; private String[] _methodParameterTypes210;
private String _methodName212; private String _methodName212;
private String[] _methodParameterTypes212; private String[] _methodParameterTypes212;
private String _methodName213; private String _methodName213;
@ -1037,4 +1046,6 @@ public class IntPraticaLocalServiceClpInvoker {
private String[] _methodParameterTypes234; private String[] _methodParameterTypes234;
private String _methodName235; private String _methodName235;
private String[] _methodParameterTypes235; private String[] _methodParameterTypes235;
private String _methodName236;
private String[] _methodParameterTypes236;
} }

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

@ -957,7 +957,9 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
@Override @Override
public Avviso simulaFirma(long avvisoId, ServiceContext serviceContext) throws Exception { public Avviso simulaFirma(long avvisoId, ServiceContext serviceContext) throws Exception {
if (configurazioneLocalService.isDeveloper(serviceContext.getUserId())) { if (configurazioneLocalService.isProduction()) {
throw new PortalException("Firma simulata non permessa");
} else {
Avviso avviso = fetchAvviso(avvisoId); Avviso avviso = fetchAvviso(avvisoId);
avviso.setFileEntryIdInvio(avviso.getFileEntryIdBase()); avviso.setFileEntryIdInvio(avviso.getFileEntryIdBase());
avviso = updateAvviso(avviso); avviso = updateAvviso(avviso);
@ -966,8 +968,6 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl {
avviso = updateAvvisoProtocollo(avviso.getAvvisoId(), protocollo); avviso = updateAvvisoProtocollo(avviso.getAvvisoId(), protocollo);
} }
return avviso; return avviso;
} else {
throw new PortalException("Firma simulata non permessa");
} }
} }

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

@ -855,14 +855,15 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl
pagamentoLocalService.nuovoPagamento(currentURL, dettPraticaId, DettPratica.class.getName(), pagamentoLocalService.nuovoPagamento(currentURL, dettPraticaId, DettPratica.class.getName(),
PagamentoConstants.PAGAMENTO_ONERI, importoSpeseIstruttoria, codiceFiscaleCommittente, serviceContext); PagamentoConstants.PAGAMENTO_ONERI, importoSpeseIstruttoria, codiceFiscaleCommittente, serviceContext);
dettPratica = updateDettPraticaPagamento(dettPraticaId, request, response); dettPratica = updateDettPraticaPagamento(dettPraticaId, request, response);
long intPraticaid = dettPratica.getIntPraticaId(); if (!dettPratica.getTipoIntegrazione().equals(TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE)) {
IntPratica intPratica = intPraticaLocalService.getIntPratica(intPraticaid); long intPraticaid = dettPratica.getIntPraticaId();
if (intPratica.getStatus() == WorkflowConstants.STATUS_ANY) { IntPratica intPratica = intPraticaLocalService.getIntPratica(intPraticaid);
intPraticaLocalService.updateStatus(intPraticaid, WorkflowConstants.STATUS_INCOMPLETE); if (intPratica.getStatus() == WorkflowConstants.STATUS_ANY) {
intPraticaLocalService.updateStatus(intPraticaid, WorkflowConstants.STATUS_INCOMPLETE);
}
updateStatus(dettPraticaId, WorkflowConstants.STATUS_INCOMPLETE);
} }
dettPratica = updateDettPratica(dettPratica); updateDettPratica(dettPratica);
updateStatus(dettPraticaId, WorkflowConstants.STATUS_INCOMPLETE);
dettPratica = getDettPratica(dettPraticaId);
return dettPratica; return dettPratica;
} }

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

@ -8,7 +8,7 @@
package it.tref.liferay.portos.bo.service.impl; package it.tref.liferay.portos.bo.service.impl;
import it.mwg.sismica.bo.search.IntPraticaAdvancedSearch; import it.mwg.sismica.bo.search.IntPraticaSearch;
import it.mwg.sismica.bo.shared.util.AvvisoUtil; import it.mwg.sismica.bo.shared.util.AvvisoUtil;
import it.mwg.sismica.bo.shared.util.DocumentiPraticaUtil; import it.mwg.sismica.bo.shared.util.DocumentiPraticaUtil;
import it.mwg.sismica.bo.shared.util.UserUtil; import it.mwg.sismica.bo.shared.util.UserUtil;
@ -126,9 +126,12 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl {
* it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil} to access the int pratica local service. * it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil} to access the int pratica local service.
*/ */
private static Log _log = LogFactoryUtil.getLog(IntPraticaLocalServiceImpl.class); private static Indexer intIndexer = null;
private static Indexer controlloIndexer = null;
private static Map<String, String> tipiProcedure = null; private static Map<String, String> tipiProcedure = null;
private static Map<String, String> vecchieProcedure = null;
private static final Log _log = LogFactoryUtil.getLog(IntPraticaLocalServiceImpl.class);
@Override @Override
public Map<String, String> getTipiProcedure() { public Map<String, String> getTipiProcedure() {
@ -144,6 +147,20 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl {
return tipiProcedure; return tipiProcedure;
} }
@Override
public Map<String, String> getVecchieProcedure() {
if (null == vecchieProcedure) {
vecchieProcedure = new LinkedHashMap<>();
for (String tipo : Arrays.asList(Constants.PROCEDURA_P0, Constants.PROCEDURA_P1, Constants.PROCEDURA_P2,
Constants.PROCEDURA_P3, Constants.PROCEDURA_P4, Constants.PROCEDURA_P5, Constants.PROCEDURA_P6,
Constants.PROCEDURA_P7, Constants.PROCEDURA_P8, Constants.PROCEDURA_P9, Constants.PROCEDURA_P10)) {
vecchieProcedure.put(tipo, LanguageUtil.get(LocaleUtil.ITALIAN, "tipo_procedura_" + tipo));
}
}
return vecchieProcedure;
}
@Override @Override
@Indexable(type = IndexableType.REINDEX) @Indexable(type = IndexableType.REINDEX)
public IntPratica addIntPratica(long territorioId, String tipoProcedura, ServiceContext serviceContext) public IntPratica addIntPratica(long territorioId, String tipoProcedura, ServiceContext serviceContext)
@ -1133,23 +1150,26 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl {
} }
@Override @Override
public void reIndexFascicolo(IntPratica intPratica, long companyId) { public void reIndexFascicolo(IntPratica pratica, long companyId) {
if (null == intIndexer) {
intIndexer = IndexerRegistryUtil.getIndexer(IntPratica.class);
}
if (null == controlloIndexer) {
controlloIndexer = IndexerRegistryUtil.getIndexer(ControlloPratica.class);
}
try { try {
Indexer intIndexer = IndexerRegistryUtil.getIndexer(IntPratica.class); if (pratica != null) {
Indexer controlloIndexer = IndexerRegistryUtil.getIndexer(ControlloPratica.class); intIndexer.delete(companyId, pratica.getUuid());
if (intPratica != null) { intIndexer.reindex(IntPratica.class.getName(), pratica.getIntPraticaId());
intIndexer.delete(companyId, intPratica.getUuid());
intIndexer.reindex(IntPratica.class.getName(), intPratica.getIntPraticaId());
DynamicQuery queryCP = DynamicQueryFactoryUtil.forClass(ControlloPratica.class); DynamicQuery queryCP = DynamicQueryFactoryUtil.forClass(ControlloPratica.class);
queryCP.add(RestrictionsFactoryUtil.eq("intPraticaId", intPratica.getIntPraticaId())); queryCP.add(RestrictionsFactoryUtil.eq("intPraticaId", pratica.getIntPraticaId()));
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
List<ControlloPratica> appList = controlloPraticaLocalService.dynamicQuery(queryCP, QueryUtil.ALL_POS, List<ControlloPratica> controlli = controlloPraticaLocalService.dynamicQuery(queryCP,
QueryUtil.ALL_POS); QueryUtil.ALL_POS, QueryUtil.ALL_POS);
for (ControlloPratica controlloPratica : appList) { for (ControlloPratica controllo : controlli) {
controlloIndexer.delete(companyId, controlloPratica.getUuid()); controlloIndexer.delete(companyId, controllo.getUuid());
controlloIndexer controlloIndexer.reindex(ControlloPratica.class.getName(), controllo.getControlloPraticaId());
.reindex(ControlloPratica.class.getName(), controlloPratica.getControlloPraticaId());
} }
} }
} catch (PortalException | SystemException e) { } catch (PortalException | SystemException e) {
@ -1263,19 +1283,19 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl {
@Override @Override
public Hits searchAltriProgetti(HttpServletRequest request, User user, int start, int end) { public Hits searchAltriProgetti(HttpServletRequest request, User user, int start, int end) {
return IntPraticaAdvancedSearch.searchAltriProgetti(request, user, start, end); return IntPraticaSearch.searchAltriProgetti(request, user, start, end);
} }
@Override @Override
public Hits searchArchivioProgetti(HttpServletRequest request, User user, int start, int end) { public Hits searchArchivioProgetti(HttpServletRequest request, User user, int start, int end) {
return IntPraticaAdvancedSearch.searchArchivioProgetti(request, user, start, end); return IntPraticaSearch.searchArchivioProgetti(request, user, start, end);
} }
@Override @Override
public Hits searchMieiProgetti(HttpServletRequest request, User user, int start, int end) { public Hits searchMieiProgetti(HttpServletRequest request, User user, int start, int end) {
return IntPraticaAdvancedSearch.searchMieiProgetti(request, user, start, end); return IntPraticaSearch.searchMieiProgetti(request, user, start, end);
} }
} }

4
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties

@ -13,8 +13,8 @@
## ##
build.namespace=portos_bo build.namespace=portos_bo
build.number=3606 build.number=3608
build.date=1651494929385 build.date=1653567453540
build.auto.upgrade=true build.auto.upgrade=true
## ##

10
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/carichilavoro/view.jsp

@ -46,12 +46,12 @@ for (Entry<String, CarichiLavoroBean> entry : carichi.entrySet()) {
String utente = entry.getKey(); String utente = entry.getKey();
CarichiLavoroBean carico = entry.getValue(); CarichiLavoroBean carico = entry.getValue();
if (elencoUtenti.length() != 0) { if (elencoUtenti.length() != 0) {
elencoUtenti.append(StringPool.COMMA); elencoUtenti.append(',');
elencoTotali.append(StringPool.COMMA); elencoTotali.append(',');
elencoConclusi.append(StringPool.COMMA); elencoConclusi.append(',');
elencoInCorso.append(StringPool.COMMA); elencoInCorso.append(',');
} }
elencoUtenti.append(StringPool.QUOTE).append(utente).append(StringPool.QUOTE); elencoUtenti.append('"').append(utente).append('"');
elencoTotali.append(carico.getTotali()); elencoTotali.append(carico.getTotali());
elencoConclusi.append(carico.getConclusi()); elencoConclusi.append(carico.getConclusi());
elencoInCorso.append(carico.getInCorso()); elencoInCorso.append(carico.getInCorso());

131
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/advanced_search.jsp → liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/search.jsp

@ -1,10 +1,10 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.mwg.sismica.bo.shared.util.IndexField"%>
<%@page import="it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants"%> <%@page import="it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants"%>
<%@page import="java.text.DateFormat"%>
<%@page import="java.util.Map.Entry"%> <%@page import="java.util.Map.Entry"%>
<%@page import="java.util.ArrayList"%> <%@page import="java.util.Calendar"%>
<%@page import="java.util.Collections"%>
<%@page import="java.util.Comparator"%>
<%@include file="/html/fascicolo/init.jsp"%> <%@include file="/html/fascicolo/init.jsp"%>
<style> <style>
.praticaApertaContainer{ .praticaApertaContainer{
@ -12,74 +12,103 @@
} }
</style> </style>
<% <%
String provinciaSelect = ParamUtil.getString(renderRequest, "provincia"); String provinciaSelect = ParamUtil.getString(renderRequest, IndexField.CODICE_PROVINCIA);
String comuneSelect = ParamUtil.getString(renderRequest, "comune"); String comuneSelect = ParamUtil.getString(renderRequest, IndexField.COMUNE_ID);
String istruttoreSelect = ParamUtil.getString(renderRequest, "istruttore"); String istruttoreSelect = ParamUtil.getString(renderRequest, IndexField.ISTRUTTORE_ID);
String uoSelect = ParamUtil.getString(renderRequest, "unitaOperativa"); String uoSelect = ParamUtil.getString(renderRequest, IndexField.UNITA_OPERATIVA);
String geologoSelect = ParamUtil.getString(renderRequest, "geologi"); String geologoSelect = ParamUtil.getString(renderRequest, IndexField.GEOLOGO_ID);
String pareriFornitiSelect = ParamUtil.getString(renderRequest, IndexField.PARERI_FORNITI);
String statoPraticaSelect = ParamUtil.getString(renderRequest, IndexField.STATO_PRATICA);
String orderByColSelect = ParamUtil.getString(renderRequest, "orderByCol", IndexField.NUMERO_PROGETTO);
String orderByTypeSelect = ParamUtil.getString(renderRequest, "orderByType", "dec");
DateFormat format = new SimpleDateFormat("dd/MM/yyyy");
Calendar calDa = null;
String data = ParamUtil.getString(renderRequest, IndexField.DATA_RICHIESTA_DA);
if (Validator.isNotNull(data)) {
calDa = Calendar.getInstance();
calDa.setTime(format.parse(data));
}
Calendar calA = null;
data = ParamUtil.getString(renderRequest, IndexField.DATA_RICHIESTA_A);
if (Validator.isNotNull(data)) {
calA = Calendar.getInstance();
calA.setTime(format.parse(data));
}
%> %>
<liferay-ui:panel title="filters" defaultState="closed" collapsible="true" extended="false" persistState="true" <liferay-ui:panel title="filters" defaultState="closed" collapsible="true" extended="false" persistState="true"
id='<%= renderResponse.getNamespace() + scopeGroupId + "ricercaSaiPanel" %>'> id='<%= renderResponse.getNamespace() + scopeGroupId + "ricercaSaiPanel" %>'>
<div class="container-fluid" style="padding: 15px;"> <div class="container-fluid" style="padding: 15px;">
<div class="row"> <div class="row">
<div class="col-xs-12 col-md-3"> <div class="col-xs-12 col-md-3">
<aui:input type="text" name="numeroProgetto" label="Numero Progetto" /> <aui:input type="text" name="<%= IndexField.NUMERO_PROGETTO %>" label="Numero Progetto" />
</div> </div>
<div class="col-xs-12 col-md-3"> <div class="col-xs-12 col-md-3">
<aui:select name="tipoProcedura" label="Tipo Pratica"> <aui:select name="<%= IndexField.TIPO_PROCEDURA %>" label="Tipo Pratica">
<aui:option value="-1">Seleziona il tipo di pratica</aui:option> <aui:option value="">Seleziona il tipo di pratica</aui:option>
<% <%
for (Entry<String, String> procedura : IntPraticaLocalServiceUtil.getTipiProcedure().entrySet()) { for (Entry<String, String> procedura : IntPraticaLocalServiceUtil.getTipiProcedure().entrySet()) {
String tipo = procedura.getKey(); String tipo = procedura.getKey();
String label = procedura.getValue(); String label = procedura.getValue();
String nomeProcedura = LanguageUtil.get(pageContext, "label_procedura_"+tipo) + ") " + label; String nomeProcedura = LanguageUtil.get(pageContext, "label_procedura_" + tipo) + ") " + label;
if (nomeProcedura.length() > 90) { if (nomeProcedura.length() > 120) {
nomeProcedura = nomeProcedura.substring(0, 90) + "..."; nomeProcedura = nomeProcedura.substring(0, 117) + "...";
} }
%> %>
<aui:option value="<%= tipo %>"><%= nomeProcedura %></aui:option> <aui:option value="<%= tipo %>"><%= nomeProcedura %></aui:option>
<% <%
} }
for (Entry<String, String> procedura : IntPraticaLocalServiceUtil.getVecchieProcedure().entrySet()) {
String tipo = procedura.getKey();
String label = procedura.getValue();
String nomeProcedura = LanguageUtil.get(pageContext, "label_procedura_" + tipo) + ") " + label;
if (nomeProcedura.length() > 120) {
nomeProcedura = nomeProcedura.substring(0, 117) + "...";
}
%>
<aui:option style="color:#888888;font-style:italic"
value="<%= tipo %>"><i><%= nomeProcedura %></i></aui:option>
<%
}
%> %>
</aui:select> </aui:select>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-xs-12 col-md-3"> <div class="col-xs-12 col-md-3">
<aui:select name="provincia" label="Provincia" cssClass="provinciaSelect" /> <aui:select name="<%= IndexField.CODICE_PROVINCIA %>" label="Provincia" cssClass="provinciaSelect" />
</div> </div>
<div class="col-sm-12 col-md-3 add-new-project__comune"> <div class="col-sm-12 col-md-3 add-new-project__comune">
<aui:select name="comune" label="Comune" /> <aui:select name="<%= IndexField.COMUNE_ID %>" label="Comune" />
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-xs-12 col-md-3"> <div class="col-xs-12 col-md-3">
<aui:input type="text" name="titolareDigitale" label="Titolare Digitale" /> <aui:input type="text" name="<%= IndexField.TITOLARE %>" label="Titolare Digitale" />
</div> </div>
<div class="col-xs-12 col-md-3"> <div class="col-xs-12 col-md-3">
<aui:input type="text" name="committente" label="Committente" /> <aui:input type="text" name="<%= IndexField.COMMITTENTE %>" label="Committente" />
</div> </div>
<div class="col-xs-12 col-md-3"> <div class="col-xs-12 col-md-3">
<aui:input type="text" name="soggettiInterconnessi" label="Soggetti Interconnessi" /> <aui:input type="text" name="<%= IndexField.SOGGETTO %>" label="Soggetti Interconnessi" />
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-xs-12 col-md-1"> <div class="col-xs-12 col-md-1">
<aui:select name="unitaOperativa" label="unita-operativa" cssClass="uoSelect" /> <aui:select name="<%= IndexField.UNITA_OPERATIVA %>" label="unita-operativa" cssClass="uoSelect" />
</div> </div>
<div class="col-xs-12 col-md-2"> <div class="col-xs-12 col-md-2">
<aui:select name="istruttore" label="Istruttore" cssClass="istruttoreSelect" /> <aui:select name="<%= IndexField.ISTRUTTORE_ID %>" label="Istruttore" cssClass="istruttoreSelect" />
</div> </div>
<div class="col-xs-12 col-md-3"> <div class="col-xs-12 col-md-3">
<aui:select name="geologi" label="Parere endoprocedimentale" cssClass="geologoSelect" /> <aui:select name="<%= IndexField.GEOLOGO_ID %>" label="Parere endoprocedimentale" cssClass="geologoSelect" />
</div> </div>
<div class="col-xs-12 col-md-3"> <div class="col-xs-12 col-md-3">
<aui:select name="parereGeologo" label="Parere fornito"> <aui:select name="<%= IndexField.PARERI_FORNITI %>" label="Parere fornito">
<aui:option value="-1">Tutte</aui:option> <aui:option value="">Tutte</aui:option>
<aui:option value="1">Si</aui:option> <aui:option selected='<%= "true".equals(pareriFornitiSelect) %>' value="true">Sì</aui:option>
<aui:option value="0">No</aui:option> <aui:option selected='<%= "false".equals(pareriFornitiSelect) %>' value="false">No</aui:option>
</aui:select> </aui:select>
</div> </div>
@ -88,12 +117,24 @@ String geologoSelect = ParamUtil.getString(renderRequest, "geologi");
<div class="col-xs-12 col-md-12"> <div class="col-xs-12 col-md-12">
<aui:field-wrapper label="Data richiesta da" inlineField="true"> <aui:field-wrapper label="Data richiesta da" inlineField="true">
<liferay-util:include page="/html/common/input_date_time.jsp" servletContext="<%= application %>"> <liferay-util:include page="/html/common/input_date_time.jsp" servletContext="<%= application %>">
<liferay-util:param name="field" value="dataRichiestaInizio" /> <liferay-util:param name="field" value="<%= IndexField.DATA_RICHIESTA_DA %>" />
<c:if test="<%= Validator.isNotNull(calDa) %>">
<liferay-util:param name="fieldParam" value="Set" />
<liferay-util:param name="SetYear" value="<%= String.valueOf(calDa.get(Calendar.YEAR)) %>" />
<liferay-util:param name="SetMonth" value="<%= String.valueOf(calDa.get(Calendar.MONTH)) %>" />
<liferay-util:param name="SetDay" value="<%= String.valueOf(calDa.get(Calendar.DAY_OF_MONTH)) %>" />
</c:if>
</liferay-util:include> </liferay-util:include>
</aui:field-wrapper> </aui:field-wrapper>
<aui:field-wrapper label="a" inlineField="true"> <aui:field-wrapper label="a" inlineField="true">
<liferay-util:include page="/html/common/input_date_time.jsp" servletContext="<%= application %>"> <liferay-util:include page="/html/common/input_date_time.jsp" servletContext="<%= application %>">
<liferay-util:param name="field" value="dataRichiestaFine" /> <liferay-util:param name="field" value="<%= IndexField.DATA_RICHIESTA_A %>" />
<c:if test="<%= Validator.isNotNull(calA) %>">
<liferay-util:param name="fieldParam" value="Set" />
<liferay-util:param name="SetYear" value="<%= String.valueOf(calA.get(Calendar.YEAR)) %>" />
<liferay-util:param name="SetMonth" value="<%= String.valueOf(calA.get(Calendar.MONTH)) %>" />
<liferay-util:param name="SetDay" value="<%= String.valueOf(calA.get(Calendar.DAY_OF_MONTH)) %>" />
</c:if>
</liferay-util:include> </liferay-util:include>
</aui:field-wrapper> </aui:field-wrapper>
</div> </div>
@ -101,7 +142,7 @@ String geologoSelect = ParamUtil.getString(renderRequest, "geologi");
<div class="row"> <div class="row">
<div class="col-xs-12 col-md-3"> <div class="col-xs-12 col-md-3">
<aui:select name="tipoAttivita" label="Attività"> <aui:select name="tipoAttivita" label="Attività">
<aui:option value="-1">Tutte</aui:option> <aui:option value="">Tutte</aui:option>
<aui:option value="Assegnazione">Assegnazione</aui:option> <aui:option value="Assegnazione">Assegnazione</aui:option>
<aui:option value="Approvazione">Approvazione</aui:option> <aui:option value="Approvazione">Approvazione</aui:option>
<aui:option value="Annullato">Annullato</aui:option> <aui:option value="Annullato">Annullato</aui:option>
@ -112,8 +153,8 @@ String geologoSelect = ParamUtil.getString(renderRequest, "geologi");
</aui:select> </aui:select>
</div> </div>
<div class="col-xs-12 col-md-3"> <div class="col-xs-12 col-md-3">
<aui:select name="statoPratica" label="Esito"> <aui:select name="<%= IndexField.STATO_PRATICA %>" label="Esito">
<aui:option value="-1">Tutti</aui:option> <aui:option value="">Tutti</aui:option>
<% <%
for (String esito : new String[] { for (String esito : new String[] {
StatoPraticaConstants.AUTORIZZATA, StatoPraticaConstants.AUTORIZZATA,
@ -124,9 +165,10 @@ String geologoSelect = ParamUtil.getString(renderRequest, "geologi");
StatoPraticaConstants.PREAVVISO_CONTRARIO, StatoPraticaConstants.PREAVVISO_CONTRARIO,
StatoPraticaConstants.PERIZIA_SANZIONE, StatoPraticaConstants.PERIZIA_SANZIONE,
StatoPraticaConstants.DECRETO_SANZIONE, StatoPraticaConstants.DECRETO_SANZIONE,
}) { }) {
%> %>
<aui:option value="<%= esito %>" label='<%= "stato-pratica-" + esito %>' /> <aui:option selected="<%= statoPraticaSelect.equals(esito) %>" value="<%= esito %>"
label='<%= "stato-pratica-" + esito %>' />
<% <%
} }
%> %>
@ -137,16 +179,15 @@ String geologoSelect = ParamUtil.getString(renderRequest, "geologi");
<div class="col-xs-12 col-md-12"> <div class="col-xs-12 col-md-12">
<div class="row"> <div class="row">
<div class="col-xs-12 col-md-3"> <div class="col-xs-12 col-md-3">
<aui:select name="ordinaPer" label="Ordina Per"> <aui:select name="orderByCol" label="Ordina Per">
<aui:option selected="true" value="numeroProgetto">Numero Progetto</aui:option> <aui:option value="numeroProgetto">Numero Progetto</aui:option>
<aui:option value="protocollo">Protocollo</aui:option> <aui:option selected='<%= "dataCreazione".equals(orderByColSelect) %>' value="dataCreazione">Data Invio</aui:option>
<aui:option value="dataCreazione">Data Invio</aui:option>
</aui:select> </aui:select>
</div> </div>
<div class="col-xs-12 col-md-3"> <div class="col-xs-12 col-md-3">
<aui:select name="ordinaTipo" label="Tipo Ordine"> <aui:select name="orderByType" label="Tipo Ordine">
<aui:option selected="true" value="dec">Dec</aui:option> <aui:option value="asc">Crescente</aui:option>
<aui:option value="asc">Asc</aui:option> <aui:option selected='<%= "dec".equals(orderByTypeSelect) %>' value="dec">Decrescente</aui:option>
</aui:select> </aui:select>
</div> </div>
</div> </div>
@ -224,7 +265,7 @@ var getGeologo = function (callback) {
new Liferay.DynamicSelect([ new Liferay.DynamicSelect([
{ {
select: '<portlet:namespace />provincia', select: '<portlet:namespace /><%= IndexField.CODICE_PROVINCIA %>',
selectData: getProvince, selectData: getProvince,
selectDesc: 'descLong', selectDesc: 'descLong',
selectId: 'provinciaId', selectId: 'provinciaId',
@ -232,7 +273,7 @@ new Liferay.DynamicSelect([
selectVal: '<%= Validator.isNull(provinciaSelect) ? StringPool.BLANK : provinciaSelect %>', selectVal: '<%= Validator.isNull(provinciaSelect) ? StringPool.BLANK : provinciaSelect %>',
}, },
{ {
select: '<portlet:namespace />comune', select: '<portlet:namespace /><%= IndexField.COMUNE_ID %>',
selectData: getComuni, selectData: getComuni,
selectDesc: 'descLong', selectDesc: 'descLong',
selectId: 'comuneId', selectId: 'comuneId',
@ -240,7 +281,7 @@ new Liferay.DynamicSelect([
selectVal: '<%= Validator.isNull(comuneSelect) ? StringPool.BLANK : comuneSelect %>', selectVal: '<%= Validator.isNull(comuneSelect) ? StringPool.BLANK : comuneSelect %>',
}, },
{ {
select: '<portlet:namespace />unitaOperativa', select: '<portlet:namespace /><%= IndexField.UNITA_OPERATIVA %>',
selectData: getUnitaOperative, selectData: getUnitaOperative,
selectDesc: 'descLong', selectDesc: 'descLong',
selectId: 'uoId', selectId: 'uoId',
@ -248,7 +289,7 @@ new Liferay.DynamicSelect([
selectVal: '<%= Validator.isNull(uoSelect) ? StringPool.BLANK : uoSelect %>', selectVal: '<%= Validator.isNull(uoSelect) ? StringPool.BLANK : uoSelect %>',
}, },
{ {
select: '<portlet:namespace />istruttore', select: '<portlet:namespace /><%= IndexField.ISTRUTTORE_ID %>',
selectData: getIstruttori, selectData: getIstruttori,
selectDesc: 'descLong', selectDesc: 'descLong',
selectId: 'istruttoreId', selectId: 'istruttoreId',
@ -256,7 +297,7 @@ new Liferay.DynamicSelect([
selectVal: '<%= Validator.isNull(istruttoreSelect) ? StringPool.BLANK : istruttoreSelect %>', selectVal: '<%= Validator.isNull(istruttoreSelect) ? StringPool.BLANK : istruttoreSelect %>',
}, },
{ {
select: '<portlet:namespace />geologi', select: '<portlet:namespace /><%= IndexField.GEOLOGO_ID %>',
selectData: getGeologo, selectData: getGeologo,
selectDesc: 'descLong', selectDesc: 'descLong',
selectId: 'geologoId', selectId: 'geologoId',

89
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/view.jsp

@ -6,7 +6,8 @@
<%@page import="com.liferay.portal.kernel.util.HtmlUtil"%> <%@page import="com.liferay.portal.kernel.util.HtmlUtil"%>
<%@page import="com.liferay.portal.model.User"%> <%@page import="com.liferay.portal.model.User"%>
<%@page import="com.liferay.portal.service.UserLocalServiceUtil"%> <%@page import="com.liferay.portal.service.UserLocalServiceUtil"%>
<%@page import="it.mwg.sismica.bo.search.IntPraticaAdvancedSearch"%> <%@page import="it.mwg.sismica.bo.search.IntPraticaSearch"%>
<%@page import="it.mwg.sismica.bo.shared.util.IndexField"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.PortletKeys"%> <%@page import="it.tref.liferay.portos.bo.shared.util.PortletKeys"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants"%> <%@page import="it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.TipoIntegrazioneUtil"%> <%@page import="it.tref.liferay.portos.bo.shared.util.TipoIntegrazioneUtil"%>
@ -18,50 +19,16 @@
<%@include file="/html/fascicolo/init.jsp"%> <%@include file="/html/fascicolo/init.jsp"%>
<liferay-portlet:actionURL varImpl="searchURL" name="searchURL" /> <liferay-portlet:actionURL varImpl="searchURL" name="searchURL" />
<% <%
//GESTIONE RICERCA CON PAGINATORE SEARCH CONTAINER
String numeroProgettoSearch = ParamUtil.getString(request, "numeroProgetto");
String protocolloSearch = ParamUtil.getString(request, "protocollo");
String tipoPraticaSearch = ParamUtil.getString(request, "tipoPratica");
String statoPraticaSearch = ParamUtil.getString(request, "statoPratica");
String descInterventoSearch = ParamUtil.getString(request, "descIntervento");
String committenteSearch = ParamUtil.getString(request, "committente");
String tecnicoIstruttoreSearch = ParamUtil.getString(request, "tecnicoIstruttore");
String titolareDigitaleSearch = ParamUtil.getString(request, "titolareDigitale");
String soggettiInterconnessiSearch = ParamUtil.getString(request, "soggettiInterconnessi");
String dataDaSearch = ParamUtil.getString(request, "dataRichiestaInizio");
String dataAlSearch = ParamUtil.getString(request, "dataRichiestaFine");
String ufficioSearch = ParamUtil.getString(request, "ufficio");
String provinciaSearch = ParamUtil.getString(request, "provincia");
String comuneSearch = ParamUtil.getString(request, "comune");
String praticaAperta = ParamUtil.getString(request, "praticaAperta");
String tipoIntervento = ParamUtil.getString(request, "tipoIntervento", StringPool.BLANK);
String indirizzo = ParamUtil.getString(request, "indirizzo");
String ordinaPer = ParamUtil.getString(request, "ordinaPer", StringPool.BLANK);
String ordinaTipo = ParamUtil.getString(request, "ordinaTipo", StringPool.BLANK);
boolean doSearch = true;
PortletURL iteratorURL = liferayPortletResponse.createRenderURL(); PortletURL iteratorURL = liferayPortletResponse.createRenderURL();
iteratorURL.setParameter("numeroProgetto", numeroProgettoSearch); for (String field:IntPraticaSearch.getFields()) {
iteratorURL.setParameter("protocollo", protocolloSearch); String value = ParamUtil.getString(request, field);
iteratorURL.setParameter("tipoPratica", tipoPraticaSearch); iteratorURL.setParameter(field, value);
iteratorURL.setParameter("statoPratica", statoPraticaSearch); }
iteratorURL.setParameter("descIntervento", descInterventoSearch); //GESTIONE RICERCA CON PAGINATORE SEARCH CONTAINER
iteratorURL.setParameter("committente", committenteSearch);
iteratorURL.setParameter("tecnicoIstruttore", tecnicoIstruttoreSearch);
iteratorURL.setParameter("titolareDigitale", titolareDigitaleSearch);
iteratorURL.setParameter("soggettiInterconnessi", soggettiInterconnessiSearch);
iteratorURL.setParameter("dataRichiestaInizio", dataDaSearch);
iteratorURL.setParameter("dataRichiestaFine", dataAlSearch);
iteratorURL.setParameter("ufficio", ufficioSearch);
iteratorURL.setParameter("provincia", provinciaSearch);
iteratorURL.setParameter("tipoIntervento", tipoIntervento);
iteratorURL.setParameter("comune", comuneSearch);
iteratorURL.setParameter("praticaAperta", praticaAperta);
iteratorURL.setParameter("indirizzo", indirizzo);
iteratorURL.setParameter("ordinaPer", ordinaPer);
iteratorURL.setParameter("ordinaTipo", ordinaTipo);
String orderByType = ParamUtil.getString(request, "orderByType", "asc"); String orderByType = ParamUtil.getString(request, "orderByType", "asc");
String orderByCol = ParamUtil.getString(request, "orderByCol", "nome"); iteratorURL.setParameter("orderByType", orderByType);
String keywords = StringPool.BLANK; String orderByCol = ParamUtil.getString(request, "orderByCol", IndexField.NUMERO_PROGETTO);
iteratorURL.setParameter("orderByCol", orderByCol);
%> %>
<liferay-ui:success key="success-sospesa" message="message-success-pratica-sospesa" /> <liferay-ui:success key="success-sospesa" message="message-success-pratica-sospesa" />
<liferay-ui:success key="success-ripresa" message="message-success-pratica-ripresa" /> <liferay-ui:success key="success-ripresa" message="message-success-pratica-ripresa" />
@ -82,33 +49,21 @@ String keywords = StringPool.BLANK;
message="message-error-cambio-titolare-pratica-in-progress" /> message="message-error-cambio-titolare-pratica-in-progress" />
<div class="navbar-container"> <div class="navbar-container">
<aui:form action="<%= searchURL.toString() %>" method="POST" name="fm"> <aui:form action="<%= searchURL.toString() %>" method="POST" name="fm">
<liferay-ui:search-form page="/html/fascicolo/advanced_search.jsp" servletContext="<%= application %>" > <liferay-ui:search-form page="/html/fascicolo/search.jsp" servletContext="<%= application %>" />
<liferay-portlet:param name="comune" value="<%= comuneSearch %>"/>
<liferay-portlet:param name="provinciaJS" value="<%= provinciaSearch %>"/>
</liferay-ui:search-form>
</aui:form> </aui:form>
</div> </div>
<!-- Funzione per esportare la ricerca --> <!-- Funzione per esportare la ricerca -->
<liferay-portlet:resourceURL id="exportRicerca" var="exportRicercaURL"> <liferay-portlet:resourceURL id="exportRicerca" var="exportRicercaURL">
<liferay-portlet:param name="dataRichiestaInizio" value="<%= dataDaSearch %>" /> <%
<liferay-portlet:param name="dataRichiestaFine" value="<%= dataAlSearch %>" /> for (String field : IntPraticaSearch.getFields()) {
<liferay-portlet:param name="numeroProgetto" value="<%= numeroProgettoSearch %>" /> String value = ParamUtil.getString(request, field);
<liferay-portlet:param name="protocollo" value="<%= protocolloSearch %>" /> %>
<liferay-portlet:param name="tipoPratica" value="<%= tipoPraticaSearch %>" /> <liferay-portlet:param name="<%= field %>" value="<%= value %>" />
<liferay-portlet:param name="descIntervento" value="<%= descInterventoSearch %>" /> <%
<liferay-portlet:param name="statoPratica" value="<%= statoPraticaSearch %>" /> }
<liferay-portlet:param name="committente" value="<%= committenteSearch %>" /> %>
<liferay-portlet:param name="tecnicoIstruttore" value="<%= tecnicoIstruttoreSearch %>" /> <liferay-portlet:param name="orderByType" value="<%= orderByType %>" />
<liferay-portlet:param name="titolareDigitale" value="<%= titolareDigitaleSearch %>" /> <liferay-portlet:param name="orderByCol" value="<%= orderByCol %>" />
<liferay-portlet:param name="soggettiInterconnessi" value="<%= soggettiInterconnessiSearch %>" />
<liferay-portlet:param name="ufficio" value="<%= ufficioSearch %>" />
<liferay-portlet:param name="comune" value="<%= comuneSearch %>" />
<liferay-portlet:param name="provincia" value="<%= provinciaSearch %>" />
<liferay-portlet:param name="tipoIntervento" value="<%= tipoIntervento %>" />
<liferay-portlet:param name="praticaAperta" value="<%= praticaAperta %>" />
<liferay-portlet:param name="indirizzo" value="<%= indirizzo %>" />
<liferay-portlet:param name="ordinaPer" value="<%= ordinaPer %>" />
<liferay-portlet:param name="ordinaTipo" value="<%= ordinaTipo %>" />
<liferay-portlet:param name="searchForExport" value="true" /> <liferay-portlet:param name="searchForExport" value="true" />
<liferay-portlet:param name="<%= Constants.CMD %>" value="exportRicerca" /> <liferay-portlet:param name="<%= Constants.CMD %>" value="exportRicerca" />
</liferay-portlet:resourceURL> </liferay-portlet:resourceURL>
@ -125,7 +80,7 @@ String keywords = StringPool.BLANK;
orderByType="<%= orderByType %>" orderByCol="<%= orderByCol %>"> orderByType="<%= orderByType %>" orderByCol="<%= orderByCol %>">
<% <%
List<IntPratica> listaIntPratica = new ArrayList<IntPratica>(); List<IntPratica> listaIntPratica = new ArrayList<IntPratica>();
Hits hits = IntPraticaAdvancedSearch.searchProgettiBO(request, user, searchContainer.getStart(), searchContainer.getEnd()); Hits hits = IntPraticaSearch.searchProgettiBO(request, user, searchContainer.getStart(), searchContainer.getEnd());
for (Document doc : hits.toList()) { for (Document doc : hits.toList()) {
String intPraticaId = doc.get("intPraticaId"); String intPraticaId = doc.get("intPraticaId");
if (Validator.isNotNull(intPraticaId)) { if (Validator.isNotNull(intPraticaId)) {

266
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/advanced_search.jsp

@ -1,266 +0,0 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants"%>
<%@page import="com.liferay.portal.service.UserLocalServiceUtil"%>
<%@page import="com.liferay.portal.kernel.json.JSONFactoryUtil"%>
<%@page import="com.liferay.portal.kernel.json.JSONObject"%>
<%@page import="com.liferay.portal.service.UserGroupRoleLocalServiceUtil"%>
<%@page import="com.liferay.portal.model.UserGroupRole"%>
<%@page import="com.liferay.portal.service.RoleLocalServiceUtil"%>
<%@page import="com.liferay.portal.model.Role"%>
<%@page import="java.util.Map.Entry"%>
<%@page import="java.util.ArrayList"%>
<%@page import="com.liferay.portal.model.Organization"%>
<%@page import="com.liferay.portal.service.OrganizationLocalServiceUtil"%>
<%@include file="/html/fascicolo/init.jsp"%>
<%
String provinciaSelect = ParamUtil.getString(renderRequest, "provincia");
String comuneSelect = ParamUtil.getString(renderRequest, "comune");
String istruttoreSelect = ParamUtil.getString(renderRequest, "istruttore");
String uoSelect = ParamUtil.getString(renderRequest, "unitaOperativa");
String geologoSelect = ParamUtil.getString(renderRequest, "geologi");
%>
<liferay-ui:panel title="filters" defaultState="closed"
id='<%= renderResponse.getNamespace() + scopeGroupId + "ricercaSaiPanel" %>' collapsible="true" extended="false"
persistState="true">
<div class="container-fluid" style="padding: 15px;">
<div class="row">
<div class="col-xs-12 col-md-3">
<aui:input type="text" name="numeroProgetto" label="Numero Progetto" />
</div>
<div class="col-xs-12 col-md-3">
<aui:select name="tipoProcedura" label="Tipo Pratica">
<aui:option value="-1">Seleziona il tipo di pratica</aui:option>
<%
for (Entry<String, String> procedura : IntPraticaLocalServiceUtil.getTipiProcedure().entrySet()) {
String tipo = procedura.getKey();
String label = procedura.getValue();
String nomeProcedura = LanguageUtil.get(pageContext, "label_procedura_"+tipo) + ") " + label;
if(nomeProcedura.length() > 90)
nomeProcedura = nomeProcedura.substring(0, 90) + "...";
%>
<aui:option value="<%= tipo %>"><%= nomeProcedura %></aui:option>
<%
}
%>
</aui:select>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-3">
<aui:select name="provincia" label="Provincia" cssClass="provinciaSelect" />
</div>
<div class="col-sm-12 col-md-3 add-new-project__comune">
<aui:select name="comune" label="Comune" />
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-3">
<aui:input type="text" name="titolareDigitale" label="Titolare Digitale" />
</div>
<div class="col-xs-12 col-md-3">
<aui:input type="text" name="committente" label="Committente" />
</div>
<div class="col-xs-12 col-md-3">
<aui:input type="text" name="soggettiInterconnessi" label="Soggetti Interconnessi" />
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-1">
<aui:select name="unitaOperativa" label="unita-operativa" cssClass="uoSelect" />
</div>
<div class="col-xs-12 col-md-2">
<aui:select name="istruttore" label="Istruttore" cssClass="istruttoreSelect" />
</div>
<div class="col-xs-12 col-md-3">
<aui:select name="geologi" label="Parere endoprocedimentale" cssClass="geologoSelect" />
</div>
<div class="col-xs-12 col-md-3">
<aui:select name="parereGeologo" label="Parere fornito">
<aui:option value="-1">Tutte</aui:option>
<aui:option value="1">Si</aui:option>
<aui:option value="0">No</aui:option>
</aui:select>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-12">
<aui:field-wrapper label="Data richiesta da" inlineField="true">
<liferay-util:include page="/html/common/input_date_time.jsp" servletContext="<%= application %>">
<liferay-util:param name="field" value="dataRichiestaInizio" />
</liferay-util:include>
</aui:field-wrapper>
<aui:field-wrapper label="a" inlineField="true">
<liferay-util:include page="/html/common/input_date_time.jsp" servletContext="<%= application %>">
<liferay-util:param name="field" value="dataRichiestaFine" />
</liferay-util:include>
</aui:field-wrapper>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-3">
<aui:select name="tipoAttivita" label="Attività">
<aui:option value="-1">Tutte</aui:option>
<aui:option value="Assegnazione">Assegnazione</aui:option>
<aui:option value="Approvazione">Approvazione</aui:option>
<aui:option value="Annullato">Annullato</aui:option>
<aui:option value="Esito">Esito</aui:option>
<aui:option value="NonApprovato">Non Approvato</aui:option>
<aui:option value="signal_cittadino">Richiesta Integrazione</aui:option>
<aui:option value="signal_ff">Firma</aui:option>
</aui:select>
</div>
<div class="col-xs-12 col-md-3">
<aui:select name="statoPratica" label="Esito">
<aui:option value="-1">Tutti</aui:option>
<%
for (String esito : new String[] {
StatoPraticaConstants.AUTORIZZATA,
StatoPraticaConstants.ANNULLATA,
StatoPraticaConstants.INTEGRAZIONE,
StatoPraticaConstants.NO_PARERE,
StatoPraticaConstants.NON_AUTORIZZATA,
StatoPraticaConstants.PREAVVISO_CONTRARIO,
StatoPraticaConstants.PERIZIA_SANZIONE,
StatoPraticaConstants.DECRETO_SANZIONE,
}) {
%>
<aui:option value="<%= esito %>" label='<%= "stato-pratica-" + esito %>' />
<%
}
%>
</aui:select>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-3">
<aui:select name="ordinaPer" label="Ordina Per">
<aui:option value="taskName">Nome Task</aui:option>
<aui:option selected="true" value="numeroProgetto">Numero Progetto</aui:option>
<aui:option value="protocollo">Protocollo</aui:option>
<aui:option value="createDate">Data Invio</aui:option>
<aui:option value="tipoPratica">Tipo Pratica</aui:option>
</aui:select>
</div>
<div class="col-xs-12 col-md-3">
<aui:select name="ordinaTipo" label="Tipo Ordine">
<aui:option selected="true" value="dec">Dec</aui:option>
<aui:option value="asc">Asc</aui:option>
</aui:select>
</div>
</div>
<aui:button type="submit" value="search" />
</div>
</liferay-ui:panel>
<liferay-portlet:resourceURL id="unitaOperative" var="getUnitaOperativeUrl" />
<liferay-portlet:resourceURL id="province" var="getProvinceURL" />
<liferay-portlet:resourceURL id="comuni" var="getComuniURL" />
<liferay-portlet:resourceURL id="istruttore" var="getIstruttoriUrl" />
<liferay-portlet:resourceURL id="geologo" var="getGeologoUrl" />
<aui:script use="aui-io-request,liferay-dynamic-select">
var getUnitaOperative = function(callback) {
A.io.request('<%= getUnitaOperativeUrl %>', {
dataType: 'json',
on: {
success: function() {
callback(this.get('responseData'));
},
},
});
};
var getProvince = function(callback) {
A.io.request('<%= getProvinceURL %>', {
dataType: 'json',
on: {
success: function() {
callback(this.get('responseData'));
},
},
});
};
var getComuni = function(callback, provinciaId) {
A.io.request('<%= getComuniURL %>', {
data: {
<portlet:namespace />provinciaId: provinciaId,
},
dataType: 'json',
on: {
success: function() {
callback(this.get('responseData'));
},
},
});
};
var getIstruttori = function(callback, uoId) {
A.io.request('<%= getIstruttoriUrl %>', {
data: {
<portlet:namespace />uoId: uoId,
},
dataType: 'json',
on: {
success: function() {
callback(this.get('responseData'));
},
},
});
};
var getGeologo = function(callback) {
A.io.request('<%= getGeologoUrl %>', {
dataType: 'json',
on: {
success: function() {
callback(this.get('responseData'));
},
},
});
};
new Liferay.DynamicSelect([
{
select: '<portlet:namespace />provincia',
selectData: getProvince,
selectDesc: 'descLong',
selectId: 'provinciaId',
selectSort: true,
selectVal: '<%= Validator.isNull(provinciaSelect) ? StringPool.BLANK : provinciaSelect %>',
},
{
select: '<portlet:namespace />comune',
selectData: getComuni,
selectDesc: 'descLong',
selectId: 'comuneId',
selectSort: true,
selectVal: '<%= Validator.isNull(comuneSelect) ? StringPool.BLANK : comuneSelect %>',
},
{
select: '<portlet:namespace />unitaOperativa',
selectData: getUnitaOperative,
selectDesc: 'descLong',
selectId: 'uoId',
selectSort: false,
selectVal: '<%= Validator.isNull(uoSelect) ? StringPool.BLANK : uoSelect %>',
},
{
select: '<portlet:namespace />istruttore',
selectData: getIstruttori,
selectDesc: 'descLong',
selectId: 'istruttoreId',
selectSort: true,
selectVal: '<%= Validator.isNull(istruttoreSelect) ? StringPool.BLANK : istruttoreSelect %>',
},
{
select: '<portlet:namespace />geologi',
selectData: getGeologo,
selectDesc: 'descLong',
selectId: 'geologoId',
selectSort: true,
selectVal: '<%= Validator.isNull(geologoSelect) ? StringPool.BLANK : geologoSelect %>',
},
]);
</aui:script>

3
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/altri_task.jsp

@ -1,7 +1,6 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.liferay.portal.kernel.search.Document"%> <%@page import="com.liferay.portal.kernel.search.Document"%>
<%@page import="com.liferay.portal.kernel.search.Hits"%> <%@page import="com.liferay.portal.kernel.search.Hits"%>
<%@page import="it.mwg.sismica.bo.search.ControlloPraticaAdvancedSearch"%>
<%@page import="it.tref.liferay.portos.bo.util.Constants"%> <%@page import="it.tref.liferay.portos.bo.util.Constants"%>
<%@page import="java.util.ArrayList"%> <%@page import="java.util.ArrayList"%>
<%@ include file="/html/gestioneattivita/init.jsp" %> <%@ include file="/html/gestioneattivita/init.jsp" %>
@ -76,7 +75,7 @@ request.setAttribute("tabs1", "Tab_AtriTask");
orderByType="<%= orderByType %>" orderByCol="<%= orderByCol %>"> orderByType="<%= orderByType %>" orderByCol="<%= orderByCol %>">
<% <%
List<ControlloPratica> listaControlloPratica = new ArrayList<ControlloPratica>(); List<ControlloPratica> listaControlloPratica = new ArrayList<ControlloPratica>();
Hits hits = ControlloPraticaAdvancedSearch.searchAltriTask(request, user, searchContainer.getStart(), Hits hits = ControlloPraticaSearch.searchAltriTask(request, user, searchContainer.getStart(),
searchContainer.getEnd()); searchContainer.getEnd());
for (Document doc : hits.toList()) { for (Document doc : hits.toList()) {
String controlloPraticaId = doc.get("controlloPraticaId"); String controlloPraticaId = doc.get("controlloPraticaId");

5
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/init.jsp

@ -3,12 +3,13 @@
<%@page import="com.liferay.portal.service.UserGroupRoleLocalServiceUtil"%> <%@page import="com.liferay.portal.service.UserGroupRoleLocalServiceUtil"%>
<%@page import="com.liferay.portal.model.Role"%> <%@page import="com.liferay.portal.model.Role"%>
<%@page import="com.liferay.portal.service.RoleLocalServiceUtil"%> <%@page import="com.liferay.portal.service.RoleLocalServiceUtil"%>
<%@page import="it.mwg.sismica.bo.search.ControlloPraticaAdvancedSearch"%> <%@page import="it.mwg.sismica.bo.search.ControlloPraticaSearch"%>
<%@page import="javax.portlet.PortletURL"%> <%@page import="javax.portlet.PortletURL"%>
<%@ include file="/html/init.jsp" %> <%@ include file="/html/init.jsp" %>
<% <%
String tabNames = "Tab_MieiTask,Tab_TaskMieiRuoli,Tab_AtriTask,Tab_TaskCompletati"; String tabNames = "Tab_MieiTask,Tab_TaskMieiRuoli,Tab_AtriTask,Tab_TaskCompletati";
String tabs1 = ParamUtil.getString(request, "tabs1", StringUtil.split(tabNames)[0]); String[] tabs = StringUtil.split(tabNames);
String tabs1 = ParamUtil.getString(request, "tabs1", tabs[0]);
Role ruoloDirigente = RoleLocalServiceUtil.getRole(company.getCompanyId(), "dirigente_generale"); Role ruoloDirigente = RoleLocalServiceUtil.getRole(company.getCompanyId(), "dirigente_generale");
boolean isPortosPo = false; boolean isPortosPo = false;
List<Organization> organizationList = user.getOrganizations(); List<Organization> organizationList = user.getOrganizations();

69
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/miei_task.jsp

@ -3,6 +3,7 @@
<%@page import="com.liferay.portal.kernel.search.Indexer"%> <%@page import="com.liferay.portal.kernel.search.Indexer"%>
<%@page import="com.liferay.portal.kernel.search.Hits"%> <%@page import="com.liferay.portal.kernel.search.Hits"%>
<%@page import="com.liferay.portal.kernel.search.Document"%> <%@page import="com.liferay.portal.kernel.search.Document"%>
<%@page import="it.mwg.sismica.bo.shared.util.IndexField"%>
<%@page import="it.tref.liferay.portos.bo.util.Constants"%> <%@page import="it.tref.liferay.portos.bo.util.Constants"%>
<%@page import="java.util.ArrayList"%> <%@page import="java.util.ArrayList"%>
<%@include file="/html/gestioneattivita/init.jsp"%> <%@include file="/html/gestioneattivita/init.jsp"%>
@ -10,57 +11,21 @@
boolean doSearch = true; boolean doSearch = true;
PortletURL iteratorURL = liferayPortletResponse.createRenderURL(); PortletURL iteratorURL = liferayPortletResponse.createRenderURL();
//GESTIONE RICERCA CON PAGINATORE SEARCH CONTAINER //GESTIONE RICERCA CON PAGINATORE SEARCH CONTAINER
String numeroProgetto = ParamUtil.getString(request, "numeroProgetto", StringPool.BLANK);
String protocollo = ParamUtil.getString(request, "protocollo", StringPool.BLANK);
String tipoPratica = ParamUtil.getString(request, "tipoPratica", StringPool.BLANK);
String statoPratica = ParamUtil.getString(request, "statoPratica", StringPool.BLANK);
String committente = ParamUtil.getString(request, "committente", StringPool.BLANK);
String soggettiInterconnessi = ParamUtil.getString(request, "soggettiInterconnessi", StringPool.BLANK);
String istruttore = ParamUtil.getString(request, "istruttore", StringPool.BLANK);
String ufficio = ParamUtil.getString(request, "ufficio", StringPool.BLANK);
String ordinaPer = ParamUtil.getString(request, "ordinaPer", StringPool.BLANK);
String ordinaTipo = ParamUtil.getString(request, "ordinaTipo", StringPool.BLANK);
String comuneSearch = ParamUtil.getString(request, "comune", StringPool.BLANK);
String tipoAttivita = ParamUtil.getString(request, "tipoAttivita", StringPool.BLANK);
String tipoProcedura = ParamUtil.getString(request, "tipoProcedura", StringPool.BLANK);
iteratorURL.setParameter("numeroProgetto", numeroProgetto);
iteratorURL.setParameter("protocollo", protocollo);
iteratorURL.setParameter("tipoPratica", tipoPratica);
iteratorURL.setParameter("statoPratica", statoPratica);
iteratorURL.setParameter("committente", committente);
iteratorURL.setParameter("soggettiInterconnessi", soggettiInterconnessi);
iteratorURL.setParameter("istruttore", istruttore);
iteratorURL.setParameter("dataRichiestaInizio", dataRichiestaInizio);
iteratorURL.setParameter("dataRichiestaFine", dataRichiestaFine);
iteratorURL.setParameter("ufficio", ufficio);
iteratorURL.setParameter("comune", comuneSearch);
iteratorURL.setParameter("tipoAttivita", tipoAttivita);
iteratorURL.setParameter("tipoProcedura", tipoProcedura);
iteratorURL.setParameter("ordinaPer", ordinaPer);
iteratorURL.setParameter("ordinaTipo", ordinaTipo);
iteratorURL.setParameter("tabs1", tabs1); iteratorURL.setParameter("tabs1", tabs1);
String orderByType = ParamUtil.getString(request, "orderByType", "asc"); request.setAttribute("tabs1", tabs1);
String orderByCol = ParamUtil.getString(request, "orderByCol", "nome"); String orderByCol = ParamUtil.getString(request, "orderByCol", IndexField.NUMERO_PROGETTO);
String keywords = StringPool.BLANK; String orderByType = ParamUtil.getString(request, "orderByType", "dec");
request.setAttribute("tabs1", "Tab_MieiTask");
%> %>
<!-- Funzione per esportare la ricerca --> <!-- Funzione per esportare la ricerca -->
<liferay-portlet:resourceURL id="exportRicercaMieAttivita" var="exportRicercaMieAttivitaURL"> <liferay-portlet:resourceURL id="exportRicercaMieAttivita" var="exportRicercaMieAttivitaURL">
<liferay-portlet:param name="dataRichiestaInizio" value="<%= dataRichiestaInizio %>"/> <%
<liferay-portlet:param name="dataRichiestaFine" value="<%= dataRichiestaFine %>"/> for (String param : ControlloPraticaSearch.getFields()) {
<liferay-portlet:param name="numeroProgetto" value="<%= numeroProgetto %>"/> %>
<liferay-portlet:param name="protocollo" value="<%= protocollo %>"/> <liferay-portlet:param name="<%= param %>"
<liferay-portlet:param name="tipoPratica" value="<%= tipoPratica %>"/> value="<%= ParamUtil.getString(request, param, StringPool.BLANK) %>"/>
<liferay-portlet:param name="statoPratica" value="<%= statoPratica %>"/> <%
<liferay-portlet:param name="committente" value="<%= committente %>"/> }
<liferay-portlet:param name="soggettiInterconnessi" value="<%= soggettiInterconnessi %>"/> %>
<liferay-portlet:param name="istruttore" value="<%= istruttore %>"/>
<liferay-portlet:param name="ufficio" value="<%= ufficio %>"/>
<liferay-portlet:param name="comune" value="<%= comuneSearch %>"/>
<liferay-portlet:param name="tipoAttivita" value="<%= tipoAttivita %>"/>
<liferay-portlet:param name="tipoProcedura" value="<%= tipoProcedura %>"/>
<liferay-portlet:param name="ordinaPer" value="<%= ordinaPer %>"/>
<liferay-portlet:param name="ordinaTipo" value="<%= ordinaTipo %>"/>
<liferay-portlet:param name="searchForExport" value="true"/> <liferay-portlet:param name="searchForExport" value="true"/>
<liferay-portlet:param name="<%= Constants.CMD %>" value="exportRicercaMieAttivita"/> <liferay-portlet:param name="<%= Constants.CMD %>" value="exportRicercaMieAttivita"/>
</liferay-portlet:resourceURL> </liferay-portlet:resourceURL>
@ -77,18 +42,18 @@ request.setAttribute("tabs1", "Tab_MieiTask");
orderByType="<%= orderByType %>" orderByCol="<%= orderByCol %>"> orderByType="<%= orderByType %>" orderByCol="<%= orderByCol %>">
<% <%
List<ControlloPratica> listaControlloPratica = new ArrayList<ControlloPratica>(); List<ControlloPratica> listaControlloPratica = new ArrayList<ControlloPratica>();
Hits hits = ControlloPraticaAdvancedSearch.searchMieiTask(request, user, searchContainer.getStart(), Hits hits = ControlloPraticaSearch.searchMieiTask(request, user, searchContainer.getStart(),
searchContainer.getEnd()); searchContainer.getEnd());
for (Document doc : hits.toList()) { for (Document doc : hits.toList()) {
String controlloPraticaId = doc.get("controlloPraticaId"); String controlloPraticaId = doc.get("controlloPraticaId");
if (Validator.isNotNull(controlloPraticaId)) { if (Validator.isNull(controlloPraticaId)) {
Indexer indexer = IndexerRegistryUtil.getIndexer(IntPratica.class);
indexer.delete(company.getCompanyId(), doc.getUID());
} else {
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil.fetchControlloPratica( ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil.fetchControlloPratica(
GetterUtil.getLong(controlloPraticaId)); GetterUtil.getLong(controlloPraticaId));
if (Validator.isNotNull(controlloPratica)) { if (Validator.isNotNull(controlloPratica)) {
listaControlloPratica.add(controlloPratica); listaControlloPratica.add(controlloPratica);
} else {
Indexer indexer = IndexerRegistryUtil.getIndexer(IntPratica.class);
indexer.delete(company.getCompanyId(), doc.getUID());
} }
} }
} }

339
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/search.jsp

@ -0,0 +1,339 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.mwg.sismica.bo.shared.util.IndexField"%>
<%@page import="it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants"%>
<%@page import="java.util.Calendar"%>
<%@page import="java.text.DateFormat"%>
<%@page import="java.util.Map.Entry"%>
<%@include file="/html/gestioneattivita/init.jsp"%>
<%
String provinciaSelect = ParamUtil.getString(renderRequest, IndexField.CODICE_PROVINCIA);
String comuneSelect = ParamUtil.getString(renderRequest, IndexField.COMUNE_ID);
String istruttoreSelect = ParamUtil.getString(renderRequest, IndexField.ISTRUTTORE_ID);
String uoSelect = ParamUtil.getString(renderRequest, IndexField.UNITA_OPERATIVA);
String geologoSelect = ParamUtil.getString(renderRequest, IndexField.GEOLOGO_ID);
String pareriFornitiSelect = ParamUtil.getString(renderRequest, IndexField.PARERI_FORNITI);
String orderByColSelect = ParamUtil.getString(renderRequest, "orderByCol", IndexField.NUMERO_PROGETTO);
String orderByTypeSelect = ParamUtil.getString(renderRequest, "orderByType", "dec");
DateFormat format = new SimpleDateFormat("dd/MM/yyyy");
Calendar richiestaDa = null;
String data = ParamUtil.getString(renderRequest, IndexField.DATA_RICHIESTA_DA);
if (Validator.isNotNull(data)) {
richiestaDa = Calendar.getInstance();
richiestaDa.setTime(format.parse(data));
}
Calendar richiestaA = null;
data = ParamUtil.getString(renderRequest, IndexField.DATA_RICHIESTA_A);
if (Validator.isNotNull(data)) {
richiestaA = Calendar.getInstance();
richiestaA.setTime(format.parse(data));
}
Calendar esitoDa = null;
data = ParamUtil.getString(renderRequest, IndexField.DATA_ESITO_DA);
if (Validator.isNotNull(data)) {
esitoDa = Calendar.getInstance();
esitoDa.setTime(format.parse(data));
}
Calendar esitoA = null;
data = ParamUtil.getString(renderRequest, IndexField.DATA_ESITO_A);
if (Validator.isNotNull(data)) {
esitoA = Calendar.getInstance();
esitoA.setTime(format.parse(data));
}
%>
<liferay-ui:panel title="filters" defaultState="closed"
id='<%= renderResponse.getNamespace() + scopeGroupId + "ricercaSaiPanel" %>' collapsible="true"
extended="false" persistState="true">
<div class="container-fluid" style="padding: 15px;">
<div class="row">
<div class="col-xs-12 col-md-3">
<aui:input type="text" name="numeroProgetto" label="ricercapratiche.numeroProgetto" />
</div>
<div class="col-xs-12 col-md-3">
<aui:select name="tipoProcedura" label="ricercapratiche.tipoProcedura">
<aui:option value="">Seleziona il tipo di pratica</aui:option>
<%
for (Entry<String, String> procedura : IntPraticaLocalServiceUtil.getTipiProcedure().entrySet()) {
String tipo = procedura.getKey();
String label = procedura.getValue();
String nomeProcedura = LanguageUtil.get(pageContext, "label_procedura_" + tipo) + ") " + label;
if (nomeProcedura.length() > 120) {
nomeProcedura = nomeProcedura.substring(0, 117) + "...";
}
%>
<aui:option value="<%= tipo %>"><%= nomeProcedura %></aui:option>
<%
}
for (Entry<String, String> procedura : IntPraticaLocalServiceUtil.getVecchieProcedure().entrySet()) {
String tipo = procedura.getKey();
String label = procedura.getValue();
String nomeProcedura = LanguageUtil.get(pageContext, "label_procedura_" + tipo) + ") " + label;
if (nomeProcedura.length() > 120) {
nomeProcedura = nomeProcedura.substring(0, 117) + "...";
}
%>
<aui:option style="color:#888888;font-style:italic"
value="<%= tipo %>"><i><%= nomeProcedura %></i></aui:option>
<%
}
%>
</aui:select>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-3">
<aui:select name="<%= IndexField.CODICE_PROVINCIA %>" label="Provincia" cssClass="provinciaSelect" />
</div>
<div class="col-sm-12 col-md-3 add-new-project__comune">
<aui:select name="<%= IndexField.COMUNE_ID %>" label="Comune" />
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-3">
<aui:input type="text" name="<%= IndexField.TITOLARE %>" label="Titolare Digitale" />
</div>
<div class="col-xs-12 col-md-3">
<aui:input type="text" name="<%= IndexField.COMMITTENTE %>" label="Committente" />
</div>
<div class="col-xs-12 col-md-3">
<aui:input type="text" name="<%= IndexField.SOGGETTO %>" label="Soggetti Interconnessi" />
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-1">
<aui:select name="<%= IndexField.UNITA_OPERATIVA %>" label="unita-operativa" cssClass="uoSelect" />
</div>
<div class="col-xs-12 col-md-2">
<aui:select name="<%= IndexField.ISTRUTTORE_ID %>" label="Istruttore" cssClass="istruttoreSelect"
disabled="<%= tabs1.equals(tabs[0]) %>"/>
</div>
<div class="col-xs-12 col-md-3">
<aui:select name="<%= IndexField.GEOLOGO_ID %>" label="Parere endoprocedimentale" cssClass="geologoSelect" />
</div>
<div class="col-xs-12 col-md-3">
<aui:select name="<%= IndexField.PARERI_FORNITI %>" label="Parere fornito">
<aui:option value="">Tutte</aui:option>
<aui:option selected='<%= "true".equals(pareriFornitiSelect) %>' value="true">Sì</aui:option>
<aui:option selected='<%= "false".equals(pareriFornitiSelect) %>' value="false">No</aui:option>
</aui:select>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-12">
<aui:field-wrapper label="Data richiesta da" inlineField="true">
<liferay-util:include page="/html/common/input_date_time.jsp" servletContext="<%= application %>">
<liferay-util:param name="field" value="<%= IndexField.DATA_RICHIESTA_DA %>" />
<c:if test="<%= Validator.isNotNull(richiestaDa) %>">
<liferay-util:param name="fieldParam" value="Set" />
<liferay-util:param name="SetYear" value="<%= String.valueOf(richiestaDa.get(Calendar.YEAR)) %>" />
<liferay-util:param name="SetMonth" value="<%= String.valueOf(richiestaDa.get(Calendar.MONTH)) %>" />
<liferay-util:param name="SetDay" value="<%= String.valueOf(richiestaDa.get(Calendar.DAY_OF_MONTH)) %>" />
</c:if>
</liferay-util:include>
</aui:field-wrapper>
<aui:field-wrapper label="a" inlineField="true">
<liferay-util:include page="/html/common/input_date_time.jsp" servletContext="<%= application %>">
<liferay-util:param name="field" value="<%= IndexField.DATA_RICHIESTA_A %>" />
<c:if test="<%= Validator.isNotNull(richiestaA) %>">
<liferay-util:param name="fieldParam" value="Set" />
<liferay-util:param name="SetYear" value="<%= String.valueOf(richiestaA.get(Calendar.YEAR)) %>" />
<liferay-util:param name="SetMonth" value="<%= String.valueOf(richiestaA.get(Calendar.MONTH)) %>" />
<liferay-util:param name="SetDay" value="<%= String.valueOf(richiestaA.get(Calendar.DAY_OF_MONTH)) %>" />
</c:if>
</liferay-util:include>
</aui:field-wrapper>
<aui:field-wrapper label="Data esito da" inlineField="true">
<liferay-util:include page="/html/common/input_date_time.jsp" servletContext="<%= application %>">
<liferay-util:param name="field" value="<%= IndexField.DATA_ESITO_DA %>" />
<c:if test="<%= Validator.isNotNull(esitoDa) %>">
<liferay-util:param name="fieldParam" value="Set" />
<liferay-util:param name="SetYear" value="<%= String.valueOf(esitoDa.get(Calendar.YEAR)) %>" />
<liferay-util:param name="SetMonth" value="<%= String.valueOf(esitoDa.get(Calendar.MONTH)) %>" />
<liferay-util:param name="SetDay" value="<%= String.valueOf(esitoDa.get(Calendar.DAY_OF_MONTH)) %>" />
</c:if>
</liferay-util:include>
</aui:field-wrapper>
<aui:field-wrapper label="a" inlineField="true">
<liferay-util:include page="/html/common/input_date_time.jsp" servletContext="<%= application %>">
<liferay-util:param name="field" value="<%= IndexField.DATA_ESITO_A %>" />
<c:if test="<%= Validator.isNotNull(esitoA) %>">
<liferay-util:param name="fieldParam" value="Set" />
<liferay-util:param name="SetYear" value="<%= String.valueOf(esitoA.get(Calendar.YEAR)) %>" />
<liferay-util:param name="SetMonth" value="<%= String.valueOf(esitoA.get(Calendar.MONTH)) %>" />
<liferay-util:param name="SetDay" value="<%= String.valueOf(esitoA.get(Calendar.DAY_OF_MONTH)) %>" />
</c:if>
</liferay-util:include>
</aui:field-wrapper>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-3">
<aui:select name="<%= IndexField.WORKFLOW_STATE %>" label="Attività">
<aui:option value="">Tutte</aui:option>
<aui:option value="Assegnazione">Assegnazione</aui:option>
<aui:option value="Approvazione">Approvazione</aui:option>
<aui:option value="Annullato">Annullato</aui:option>
<aui:option value="Esito">Esito</aui:option>
<aui:option value="NonApprovato">Non Approvato</aui:option>
<aui:option value="signal_cittadino">Richiesta Integrazione</aui:option>
<aui:option value="signal_ff">Firma</aui:option>
</aui:select>
</div>
<div class="col-xs-12 col-md-3">
<aui:select name="<%= IndexField.STATO_PRATICA %>" label="Esito">
<aui:option value="">Tutti</aui:option>
<%
for (String esito : new String[] {
StatoPraticaConstants.AUTORIZZATA,
StatoPraticaConstants.ANNULLATA,
StatoPraticaConstants.INTEGRAZIONE,
StatoPraticaConstants.NO_PARERE,
StatoPraticaConstants.NON_AUTORIZZATA,
StatoPraticaConstants.PREAVVISO_CONTRARIO,
StatoPraticaConstants.PERIZIA_SANZIONE,
StatoPraticaConstants.DECRETO_SANZIONE,
}) {
%>
<aui:option value="<%= esito %>" label='<%= "stato-pratica-" + esito %>' />
<%
}
%>
</aui:select>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-3">
<aui:select name="orderByCol" label="Ordina Per">
<%
for (String col : Arrays.asList(IndexField.WORKFLOW_STATE, IndexField.NUMERO_PROGETTO,
IndexField.DATA_RICHIESTA, IndexField.TIPO_PROCEDURA)) {
%>
<aui:option selected="<%= col.equalsIgnoreCase(orderByColSelect) %>" value="<%= col %>"
label='<%= "ricercapratiche." + col %>' />
<%
}
%>
</aui:select>
</div>
<div class="col-xs-12 col-md-3">
<aui:select name="orderByType" label="Tipo Ordine">
<aui:option value="asc">Crescente</aui:option>
<aui:option selected='<%= "dec".equals(orderByTypeSelect) %>' value="dec">Decrescente</aui:option>
</aui:select>
</div>
</div>
<aui:button type="submit" value="search" />
</div>
</liferay-ui:panel>
<liferay-portlet:resourceURL id="unitaOperative" var="getUnitaOperativeUrl" />
<liferay-portlet:resourceURL id="province" var="getProvinceURL" />
<liferay-portlet:resourceURL id="comuni" var="getComuniURL" />
<liferay-portlet:resourceURL id="istruttore" var="getIstruttoriUrl" />
<liferay-portlet:resourceURL id="geologo" var="getGeologoUrl" />
<aui:script use="aui-io-request,liferay-dynamic-select">
var getUnitaOperative = function (callback) {
A.io.request('<%= getUnitaOperativeUrl %>', {
dataType: 'json',
on: {
success: function () {
callback(this.get('responseData'));
},
},
});
};
var getProvince = function (callback) {
A.io.request('<%= getProvinceURL %>', {
dataType: 'json',
on: {
success: function () {
callback(this.get('responseData'));
},
},
});
};
var getComuni = function (callback, provinciaId) {
A.io.request('<%= getComuniURL %>', {
data: {
<portlet:namespace />provinciaId: provinciaId,
},
dataType: 'json',
on: {
success: function () {
callback(this.get('responseData'));
},
},
});
};
var getIstruttori = function (callback, uoId) {
A.io.request('<%= getIstruttoriUrl %>', {
data: {
<portlet:namespace />uoId: uoId,
},
dataType: 'json',
on: {
success: function () {
callback(this.get('responseData'));
},
},
});
};
var getGeologo = function (callback) {
A.io.request('<%= getGeologoUrl %>', {
dataType: 'json',
on: {
success: function () {
callback(this.get('responseData'));
},
},
});
};
new Liferay.DynamicSelect([
{
select: '<portlet:namespace /><%= IndexField.CODICE_PROVINCIA %>',
selectData: getProvince,
selectDesc: 'descLong',
selectId: 'provinciaId',
selectSort: true,
selectVal: '<%= Validator.isNull(provinciaSelect) ? StringPool.BLANK : provinciaSelect %>',
},
{
select: '<portlet:namespace /><%= IndexField.COMUNE_ID %>',
selectData: getComuni,
selectDesc: 'descLong',
selectId: 'comuneId',
selectSort: true,
selectVal: '<%= Validator.isNull(comuneSelect) ? StringPool.BLANK : comuneSelect %>',
},
{
select: '<portlet:namespace /><%= IndexField.UNITA_OPERATIVA %>',
selectData: getUnitaOperative,
selectDesc: 'descLong',
selectId: 'uoId',
selectSort: false,
selectVal: '<%= Validator.isNull(uoSelect) ? StringPool.BLANK : uoSelect %>',
},
{
select: '<portlet:namespace /><%= IndexField.ISTRUTTORE_ID %>',
selectData: getIstruttori,
selectDesc: 'descLong',
selectId: 'istruttoreId',
selectSort: true,
selectVal: '<%= Validator.isNull(istruttoreSelect) ? StringPool.BLANK : istruttoreSelect %>',
},
{
select: '<portlet:namespace /><%= IndexField.GEOLOGO_ID %>',
selectData: getGeologo,
selectDesc: 'descLong',
selectId: 'geologoId',
selectSort: true,
selectVal: '<%= Validator.isNull(geologoSelect) ? StringPool.BLANK : geologoSelect %>',
},
]);
</aui:script>

3
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/task_completati.jsp

@ -1,7 +1,6 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.liferay.portal.kernel.search.Document"%> <%@page import="com.liferay.portal.kernel.search.Document"%>
<%@page import="com.liferay.portal.kernel.search.Hits"%> <%@page import="com.liferay.portal.kernel.search.Hits"%>
<%@page import="it.mwg.sismica.bo.search.ControlloPraticaAdvancedSearch"%>
<%@page import="it.tref.liferay.portos.bo.util.Constants"%> <%@page import="it.tref.liferay.portos.bo.util.Constants"%>
<%@page import="java.util.ArrayList"%> <%@page import="java.util.ArrayList"%>
<%@include file="/html/gestioneattivita/init.jsp"%> <%@include file="/html/gestioneattivita/init.jsp"%>
@ -76,7 +75,7 @@ request.setAttribute("tabs1", "Tab_TaskCompletati");
orderByType="<%= orderByType %>" orderByCol="<%= orderByCol %>"> orderByType="<%= orderByType %>" orderByCol="<%= orderByCol %>">
<% <%
List<ControlloPratica> listaControlloPratica = new ArrayList<ControlloPratica>(); List<ControlloPratica> listaControlloPratica = new ArrayList<ControlloPratica>();
Hits hits = ControlloPraticaAdvancedSearch.searchTaskConclusi(request, user, searchContainer.getStart(), Hits hits = ControlloPraticaSearch.searchTaskConclusi(request, user, searchContainer.getStart(),
searchContainer.getEnd()); searchContainer.getEnd());
for (Document doc : hits.toList()) { for (Document doc : hits.toList()) {
long controlloPraticaId = Long.parseLong(doc.get("controlloPraticaId")); long controlloPraticaId = Long.parseLong(doc.get("controlloPraticaId"));

2
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/task_miei_ruoli.jsp

@ -77,7 +77,7 @@ request.setAttribute("tabs1", "Tab_TaskMieiRuoli");
orderByType="<%= orderByType %>" orderByCol="<%= orderByCol %>"> orderByType="<%= orderByType %>" orderByCol="<%= orderByCol %>">
<% <%
List<ControlloPratica> listaControlloPratica = new ArrayList<ControlloPratica>(); List<ControlloPratica> listaControlloPratica = new ArrayList<ControlloPratica>();
Hits hits = ControlloPraticaAdvancedSearch.searchTaskMieiRuoli(request, user, searchContainer.getStart(), Hits hits = ControlloPraticaSearch.searchTaskMieiRuoli(request, user, searchContainer.getStart(),
searchContainer.getEnd()); searchContainer.getEnd());
for (Document doc : hits.toList()) { for (Document doc : hits.toList()) {
String controlloPraticaId = doc.get("controlloPraticaId"); String controlloPraticaId = doc.get("controlloPraticaId");

81
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/view.jsp

@ -3,75 +3,60 @@
<%@page import="com.liferay.portal.service.UserLocalServiceUtil"%> <%@page import="com.liferay.portal.service.UserLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.util.Constants"%> <%@page import="it.tref.liferay.portos.bo.util.Constants"%>
<%@ include file="/html/gestioneattivita/init.jsp" %> <%@ include file="/html/gestioneattivita/init.jsp" %>
<liferay-portlet:actionURL varImpl="search2URL" name="search2URL" /> <liferay-portlet:actionURL varImpl="search2URL" name="search2URL" />
<% <%
PortletURL portletURL = renderResponse.createRenderURL(); PortletURL portletURL = renderResponse.createRenderURL();
search2URL.setParameter("tabs1", tabs1); search2URL.setParameter("tabs1", tabs1);
%> %>
<div class="navbar-container"> <div class="navbar-container">
<aui:form action="<%= search2URL.toString() %>" method="POST" name="fm"> <aui:form action="<%= search2URL.toString() %>" method="POST" name="fm">
<liferay-ui:search-form page="/html/gestioneattivita/advanced_search.jsp" servletContext="<%= application %>" /> <liferay-ui:search-form page="/html/gestioneattivita/search.jsp" servletContext="<%= application %>" />
</aui:form> </aui:form>
</div> </div>
<liferay-portlet:resourceURL id="exportCSVDirigente" var="exportCSVDirigente"> <liferay-portlet:resourceURL id="exportCSVDirigente" var="exportCSVDirigente">
<liferay-portlet:param name="dataRichiestaInizio" value="<%=dataRichiestaInizio %>"/> <liferay-portlet:param name="dataRichiestaInizio" value="<%= dataRichiestaInizio %>"/>
<liferay-portlet:param name="dataRichiestaFine" value="<%=dataRichiestaFine %>"/> <liferay-portlet:param name="dataRichiestaFine" value="<%= dataRichiestaFine %>"/>
<liferay-portlet:param name="<%= Constants.CMD %>" value="dirigente"/> <liferay-portlet:param name="<%= Constants.CMD %>" value="dirigente"/>
</liferay-portlet:resourceURL> </liferay-portlet:resourceURL>
<liferay-portlet:resourceURL id="exportCSVPO" var="exportCSVPO"> <liferay-portlet:resourceURL id="exportCSVPO" var="exportCSVPO">
<liferay-portlet:param name="dataRichiestaInizio" value="<%=dataRichiestaInizio %>"/> <liferay-portlet:param name="dataRichiestaInizio" value="<%= dataRichiestaInizio %>"/>
<liferay-portlet:param name="dataRichiestaFine" value="<%=dataRichiestaFine %>"/> <liferay-portlet:param name="dataRichiestaFine" value="<%= dataRichiestaFine %>"/>
<liferay-portlet:param name="<%= Constants.CMD %>" value="po"/> <liferay-portlet:param name="<%= Constants.CMD %>" value="po"/>
</liferay-portlet:resourceURL> </liferay-portlet:resourceURL>
<c:if test="<%= RoleLocalServiceUtil.hasUserRole(user.getUserId(), ruoloDirigente.getRoleId()) %>">
<c:if test="<%=RoleLocalServiceUtil.hasUserRole(user.getUserId(), ruoloDirigente.getRoleId()) %>">
<div class="row-fluid"> <div class="row-fluid">
<div class="span10"> <div class="span10"></div>
</div>
<div class="span2"> <div class="span2">
<aui:button-row cssClass="margin-top-0"> <aui:button-row cssClass="margin-top-0">
<liferay-ui:icon linkCssClass="btn btn-action btn-primary pull-right" iconCssClass="fa fa-floppy-o" message="export" label="<%= true %>" url="<%= exportCSVDirigente %>" target="_blank" /> <liferay-ui:icon linkCssClass="btn btn-action btn-primary pull-right" iconCssClass="fa fa-floppy-o"
message="export" label="true" url="<%= exportCSVDirigente %>" target="_blank" />
</aui:button-row> </aui:button-row>
</div> </div>
</div> </div>
</c:if> </c:if>
<c:if test="<%= isPortosPo && tabs1.equals(tabs[0]) %>">
<c:if test="<%=isPortosPo && tabs1.equals(StringUtil.split(tabNames)[0]) %>">
<div class="row-fluid"> <div class="row-fluid">
<div class="span10"> <div class="span10"></div>
</div>
<div class="span2"> <div class="span2">
<aui:button-row cssClass="margin-top-0"> <aui:button-row cssClass="margin-top-0">
<liferay-ui:icon linkCssClass="btn btn-action btn-primary pull-right" iconCssClass="fa fa-floppy-o" message="export" label="<%= true %>" url="<%= exportCSVPO %>" target="_blank" /> <liferay-ui:icon linkCssClass="btn btn-action btn-primary pull-right" iconCssClass="fa fa-floppy-o"
message="export" label="true" url="<%= exportCSVPO %>" target="_blank" />
</aui:button-row> </aui:button-row>
</div> </div>
</div> </div>
</c:if> </c:if>
<div id="<portlet:namespace/>gestioneAttivitaId"> <div id="<portlet:namespace/>gestioneAttivitaId">
<liferay-ui:tabs <liferay-ui:tabs names="<%= tabNames %>" url="<%= portletURL.toString() %>" />
names="<%= tabNames %>" <c:if test='<%= tabs1.equals(tabs[0]) %>'>
url="<%= portletURL.toString() %>"
/>
<c:if test='<%= tabs1.equals(StringUtil.split(tabNames)[0]) %>'>
<jsp:include page='/html/gestioneattivita/miei_task.jsp' /> <jsp:include page='/html/gestioneattivita/miei_task.jsp' />
</c:if> </c:if>
<c:if test='<%= tabs1.equals(StringUtil.split(tabNames)[1]) %>'> <c:if test='<%= tabs1.equals(tabs[1]) %>'>
<jsp:include page='/html/gestioneattivita/task_miei_ruoli.jsp'/> <jsp:include page='/html/gestioneattivita/task_miei_ruoli.jsp'/>
</c:if> </c:if>
<c:if test='<%= tabs1.equals(StringUtil.split(tabNames)[2]) %>'> <c:if test='<%= tabs1.equals(tabs[2]) %>'>
<jsp:include page='/html/gestioneattivita/altri_task.jsp'/> <jsp:include page='/html/gestioneattivita/altri_task.jsp'/>
</c:if> </c:if>
<c:if test='<%= tabs1.equals(StringUtil.split(tabNames)[3]) %>'> <c:if test='<%= tabs1.equals(tabs[3]) %>'>
<jsp:include page='/html/gestioneattivita/task_completati.jsp'/> <jsp:include page='/html/gestioneattivita/task_completati.jsp'/>
</c:if> </c:if>
</div> </div>
@ -79,21 +64,19 @@ search2URL.setParameter("tabs1", tabs1);
*giorni trascorsi da inizio del procedimento *giorni trascorsi da inizio del procedimento
</div> </div>
<aui:script use="aui-base"> <aui:script use="aui-base">
Liferay.on('popupReady', function (event) {
Liferay.on('popupReady',function(event) { var modalName = event._event.details[0].windowName;
var modalName = event._event.details[0].windowName; var modalWin = Liferay.Util.Window.getById(modalName);
var modalWin = Liferay.Util.Window.getById(modalName); modalWin.after('visibleChange', function (event) {
modalWin.after('visibleChange', function(event) { if(event.prevVal){
if(event.prevVal){ Liferay.Portlet.refresh('#p_p_id<portlet:namespace />');
Liferay.Portlet.refresh('#p_p_id<portlet:namespace />'); }
} });
}); modalWin.after('hide', function(event) {
modalWin.after('hide', function(event) { Liferay.Portlet.refresh('#p_p_id<portlet:namespace />');
Liferay.Portlet.refresh('#p_p_id<portlet:namespace />'); });
}); modalWin.after('destroy', function(event) {
modalWin.after('destroy', function(event) { Liferay.Portlet.refresh('#p_p_id<portlet:namespace />');
Liferay.Portlet.refresh('#p_p_id<portlet:namespace />');
});
}); });
});
</aui:script> </aui:script>

2
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestionefirme/avvisi_actions.jsp

@ -29,7 +29,7 @@ boolean inUnitaOperativa = unitaOperativeUtente.contains(intPratica.getUnitaOper
<portlet:param name="backURL" value="<%= redirect %>" /> <portlet:param name="backURL" value="<%= redirect %>" />
<portlet:param name="tabs1" value="<%= tabs1 %>" /> <portlet:param name="tabs1" value="<%= tabs1 %>" />
</portlet:actionURL> </portlet:actionURL>
<c:if test="<%= ConfigurazioneLocalServiceUtil.isDeveloper(user) <c:if test="<%= !ConfigurazioneLocalServiceUtil.isProduction()
&& avviso.getUserCodiceFiscalePrimaFirma().equalsIgnoreCase(user.getScreenName()) %>"> && avviso.getUserCodiceFiscalePrimaFirma().equalsIgnoreCase(user.getScreenName()) %>">
<portlet:actionURL name="simulaFirma" var="simulaFirmaURL"> <portlet:actionURL name="simulaFirma" var="simulaFirmaURL">
<portlet:param name="mvcPath" value="/html/gestionefirme/view.jsp" /> <portlet:param name="mvcPath" value="/html/gestionefirme/view.jsp" />

2
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/content/Language.properties

@ -91,7 +91,7 @@ at-least-nelRispetto = Almeno un decreto necessario per "Nel rispetto di"
no-asseverazioni-archivio = Nessuna asseverazione in archivio no-asseverazioni-archivio = Nessuna asseverazione in archivio
no-deleghe-archivio = Nessuna delega in archivio no-deleghe-archivio = Nessuna delega in archivio
label-documenti-tipologia-AI = Allegati obbligatori annullamento label-documenti-tipologia-AI=Allegati obbligatori annullamento
persona-responsabile-compilazione-sezione=Responsabile della compilazione di questa sezione persona-responsabile-compilazione-sezione=Responsabile della compilazione di questa sezione
persone-responsabili-compilazione-sezione=Responsabili della compilazione di questa sezione persone-responsabili-compilazione-sezione=Responsabili della compilazione di questa sezione

22
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/portlet/FascicoloFePortlet.java

@ -198,8 +198,7 @@ public class FascicoloFePortlet extends MVCPortlet {
JRDataSource dataSource = new JREmptyDataSource(); JRDataSource dataSource = new JREmptyDataSource();
JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, dataSource); JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, dataSource);
// Export to PDF. // Export to PDF.
String titleDoc = "fine_lavori_" + intPratica.getNumeroProgetto() + StringPool.UNDERLINE String titleDoc = "fine_lavori_" + intPratica.getNumeroProgetto() + '_' + new Date().getTime() + ".pdf";
+ new Date().getTime() + ".pdf";
jasperPrint.setName(titleDoc); jasperPrint.setName(titleDoc);
HttpServletRequest httpRequest = PortalUtil.getHttpServletRequest(request); HttpServletRequest httpRequest = PortalUtil.getHttpServletRequest(request);
HttpServletResponse httpResponse = PortalUtil.getHttpServletResponse(response); HttpServletResponse httpResponse = PortalUtil.getHttpServletResponse(response);
@ -277,8 +276,7 @@ public class FascicoloFePortlet extends MVCPortlet {
JRDataSource dataSource = new JREmptyDataSource(); JRDataSource dataSource = new JREmptyDataSource();
JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, dataSource); JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, dataSource);
// Export to PDF. // Export to PDF.
String titleDoc = "collaudo_" + intPratica.getNumeroProgetto() + StringPool.UNDERLINE String titleDoc = "collaudo_" + intPratica.getNumeroProgetto() + '_' + new Date().getTime() + ".pdf";
+ new Date().getTime() + ".pdf";
jasperPrint.setName(titleDoc); jasperPrint.setName(titleDoc);
HttpServletRequest httpRequest = PortalUtil.getHttpServletRequest(request); HttpServletRequest httpRequest = PortalUtil.getHttpServletRequest(request);
HttpServletResponse httpResponse = PortalUtil.getHttpServletResponse(response); HttpServletResponse httpResponse = PortalUtil.getHttpServletResponse(response);
@ -310,7 +308,7 @@ public class FascicoloFePortlet extends MVCPortlet {
JRDataSource dataSource = new JREmptyDataSource(); JRDataSource dataSource = new JREmptyDataSource();
JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, dataSource); JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, dataSource);
// Export to PDF. // Export to PDF.
String titleDoc = intPratica.getNumeroProgetto() + StringPool.UNDERLINE + new Date().getTime() + ".pdf"; String titleDoc = intPratica.getNumeroProgetto() + '_' + new Date().getTime() + ".pdf";
jasperPrint.setName(titleDoc); jasperPrint.setName(titleDoc);
HttpServletRequest httpRequest = PortalUtil.getHttpServletRequest(request); HttpServletRequest httpRequest = PortalUtil.getHttpServletRequest(request);
HttpServletResponse httpResponse = PortalUtil.getHttpServletResponse(response); HttpServletResponse httpResponse = PortalUtil.getHttpServletResponse(response);
@ -343,8 +341,7 @@ public class FascicoloFePortlet extends MVCPortlet {
JRDataSource dataSource = new JREmptyDataSource(); JRDataSource dataSource = new JREmptyDataSource();
JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, dataSource); JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, dataSource);
// Export to PDF. // Export to PDF.
String titleDoc = "variante_" + intPratica.getNumeroProgetto() + StringPool.UNDERLINE String titleDoc = "variante_" + intPratica.getNumeroProgetto() + '_' + new Date().getTime() + ".pdf";
+ new Date().getTime() + ".pdf";
jasperPrint.setName(titleDoc); jasperPrint.setName(titleDoc);
HttpServletRequest httpRequest = PortalUtil.getHttpServletRequest(request); HttpServletRequest httpRequest = PortalUtil.getHttpServletRequest(request);
HttpServletResponse httpResponse = PortalUtil.getHttpServletResponse(response); HttpServletResponse httpResponse = PortalUtil.getHttpServletResponse(response);
@ -465,7 +462,7 @@ public class FascicoloFePortlet extends MVCPortlet {
String.valueOf(lastDettPraticaEditableVS.getDettPraticaId())); String.valueOf(lastDettPraticaEditableVS.getDettPraticaId()));
String fragmentURL = "_1_WAR_portosfeportlet_page_soggetti"; String fragmentURL = "_1_WAR_portosfeportlet_page_soggetti";
if (successURL.contains(StringPool.POUND)) { if (successURL.contains(StringPool.POUND)) {
successURL = successURL.substring(0, successURL.lastIndexOf(StringPool.POUND)); successURL = successURL.substring(0, successURL.lastIndexOf('#'));
} }
successURL += "#_1_WAR_portosfeportlet_tab=" + fragmentURL; successURL += "#_1_WAR_portosfeportlet_tab=" + fragmentURL;
@ -967,7 +964,7 @@ public class FascicoloFePortlet extends MVCPortlet {
successURL = HttpUtil.addParameter(successURL, response.getNamespace() + "historyKey", successURL = HttpUtil.addParameter(successURL, response.getNamespace() + "historyKey",
"_1_WAR_portosfeportlet_tab=" + fragmentURL); "_1_WAR_portosfeportlet_tab=" + fragmentURL);
if (successURL.contains(StringPool.POUND)) { if (successURL.contains(StringPool.POUND)) {
successURL = successURL.substring(0, successURL.lastIndexOf(StringPool.POUND)); successURL = successURL.substring(0, successURL.lastIndexOf('#'));
} }
successURL += "#_1_WAR_portosfeportlet_tab=" + fragmentURL; successURL += "#_1_WAR_portosfeportlet_tab=" + fragmentURL;
} }
@ -1027,7 +1024,7 @@ public class FascicoloFePortlet extends MVCPortlet {
String.valueOf(verifyArea)); String.valueOf(verifyArea));
String fragmentURL = "_1_WAR_portosfeportlet_page_soggetti"; String fragmentURL = "_1_WAR_portosfeportlet_page_soggetti";
if (successURL.contains(StringPool.POUND)) { if (successURL.contains(StringPool.POUND)) {
successURL = successURL.substring(0, successURL.lastIndexOf(StringPool.POUND)); successURL = successURL.substring(0, successURL.lastIndexOf('#'));
} }
successURL += "#_1_WAR_portosfeportlet_tab=" + fragmentURL; successURL += "#_1_WAR_portosfeportlet_tab=" + fragmentURL;
response.sendRedirect(successURL); response.sendRedirect(successURL);
@ -1226,7 +1223,7 @@ public class FascicoloFePortlet extends MVCPortlet {
serviceContext.getCompanyId(), StringPool.BLANK); serviceContext.getCompanyId(), StringPool.BLANK);
String firme = StringUtils.join(firmatari, StringPool.COMMA_AND_SPACE).toLowerCase(); String firme = StringUtils.join(firmatari, StringPool.COMMA_AND_SPACE).toLowerCase();
dettagliFirme = "<br>Firma richiesta [" + asseverazione.getCodiceFiscale() + "]<br>Firme trovate [" dettagliFirme = "<br>Firma richiesta [" + asseverazione.getCodiceFiscale() + "]<br>Firme trovate ["
+ firme + StringPool.CLOSE_BRACKET; + firme + ']';
} }
} }
if (!SessionErrors.isEmpty(request)) { if (!SessionErrors.isEmpty(request)) {
@ -1382,8 +1379,7 @@ public class FascicoloFePortlet extends MVCPortlet {
Soggetto soggetto = soggetti.get(0); Soggetto soggetto = soggetti.get(0);
String roles = StringPool.BLANK; String roles = StringPool.BLANK;
for (Soggetto role : soggetti) { for (Soggetto role : soggetti) {
roles += LanguageUtil.get(LocaleUtil.ITALIAN, "gc-soggetto-" + role.getTipologiaSoggetto()) roles += LanguageUtil.get(LocaleUtil.ITALIAN, "gc-soggetto-" + role.getTipologiaSoggetto()) + ' ';
+ StringPool.SPACE;
} }
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(delega.getIntPraticaId()); IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(delega.getIntPraticaId());
String[] to = { soggetto.getEmail() }; String[] to = { soggetto.getEmail() };

1
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/portlet/ParereGeologoPortlet.java

@ -49,7 +49,6 @@ public class ParereGeologoPortlet extends MVCPortlet {
String testo = ParamUtil.getString(request, "parere"); String testo = ParamUtil.getString(request, "parere");
long parereId = ParamUtil.getLong(request, "parereId"); long parereId = ParamUtil.getLong(request, "parereId");
Date now = new Date();
UploadPortletRequest uploadRequest = PortalUtil.getUploadPortletRequest(request); UploadPortletRequest uploadRequest = PortalUtil.getUploadPortletRequest(request);
ServiceContext serviceContext; ServiceContext serviceContext;
try { try {

2
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/portlet/SoggettiPraticaPortlet.java

@ -102,11 +102,9 @@ public class SoggettiPraticaPortlet extends MVCPortlet {
long soggettoId = ParamUtil.getLong(actionRequest, "soggettoId"); long soggettoId = ParamUtil.getLong(actionRequest, "soggettoId");
long dettPraticaId = ParamUtil.getLong(actionRequest, "dettPraticaId"); long dettPraticaId = ParamUtil.getLong(actionRequest, "dettPraticaId");
Soggetto soggetto = SoggettoServiceUtil.getSoggetto(soggettoId); Soggetto soggetto = SoggettoServiceUtil.getSoggetto(soggettoId);
_log.info(dettPraticaId); _log.info(dettPraticaId);
_log.info(soggetto.getCodiceFiscale()); _log.info(soggetto.getCodiceFiscale());
_log.info(soggetto.getTipologiaSoggetto()); _log.info(soggetto.getTipologiaSoggetto());
SoggettoServiceUtil.updatePrincipale(dettPraticaId, soggetto.getCodiceFiscale(), SoggettoServiceUtil.updatePrincipale(dettPraticaId, soggetto.getCodiceFiscale(),
soggetto.getTipologiaSoggetto()); soggetto.getTipologiaSoggetto());
} catch (PortalException | SystemException e) { } catch (PortalException | SystemException e) {

206
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/util/ReportFascicoloUtil.java

@ -92,35 +92,35 @@ public class ReportFascicoloUtil {
if (intPratica.isDeposito()) { if (intPratica.isDeposito()) {
if (BeanPropertiesUtil.getBoolean(lastDettPratica, "normDpr01Dep")) { if (BeanPropertiesUtil.getBoolean(lastDettPratica, "normDpr01Dep")) {
ReportFascicoloBean bean = new ReportFascicoloBean("- " + LanguageUtil.get(locale, "dp-sensi") ReportFascicoloBean bean = new ReportFascicoloBean("- " + LanguageUtil.get(locale, "dp-sensi")
+ StringPool.SPACE + LanguageUtil.get(locale, "norm-dpr01-dep")); + ' ' + LanguageUtil.get(locale, "norm-dpr01-dep"));
listaDettagliPrincipali.add(bean); listaDettagliPrincipali.add(bean);
} }
if (BeanPropertiesUtil.getBoolean(lastDettPratica, "normDpr02Dep")) { if (BeanPropertiesUtil.getBoolean(lastDettPratica, "normDpr02Dep")) {
ReportFascicoloBean bean = new ReportFascicoloBean("- " + LanguageUtil.get(locale, "dp-sensi") ReportFascicoloBean bean = new ReportFascicoloBean("- " + LanguageUtil.get(locale, "dp-sensi")
+ StringPool.SPACE + LanguageUtil.get(locale, "norm-dpr02-dep")); + ' ' + LanguageUtil.get(locale, "norm-dpr02-dep"));
listaDettagliPrincipali.add(bean); listaDettagliPrincipali.add(bean);
} }
} else if (intPratica.isAutorizzazione()) { } else if (intPratica.isAutorizzazione()) {
if (BeanPropertiesUtil.getBoolean(lastDettPratica, "normDpr01Aut")) { if (BeanPropertiesUtil.getBoolean(lastDettPratica, "normDpr01Aut")) {
ReportFascicoloBean bean = new ReportFascicoloBean("- " + LanguageUtil.get(locale, "dp-sensi") ReportFascicoloBean bean = new ReportFascicoloBean("- " + LanguageUtil.get(locale, "dp-sensi")
+ StringPool.SPACE + LanguageUtil.get(locale, "norm-dpr01-aut")); + ' ' + LanguageUtil.get(locale, "norm-dpr01-aut"));
listaDettagliPrincipali.add(bean); listaDettagliPrincipali.add(bean);
} }
if (BeanPropertiesUtil.getBoolean(lastDettPratica, "normDpr02Aut")) { if (BeanPropertiesUtil.getBoolean(lastDettPratica, "normDpr02Aut")) {
ReportFascicoloBean bean = new ReportFascicoloBean("- " + LanguageUtil.get(locale, "dp-sensi") ReportFascicoloBean bean = new ReportFascicoloBean("- " + LanguageUtil.get(locale, "dp-sensi")
+ StringPool.SPACE + LanguageUtil.get(locale, "norm-dpr02-aut")); + ' ' + LanguageUtil.get(locale, "norm-dpr02-aut"));
listaDettagliPrincipali.add(bean); listaDettagliPrincipali.add(bean);
} }
} }
if (BeanPropertiesUtil.getBoolean(lastDettPratica, "normDm2018")) { if (BeanPropertiesUtil.getBoolean(lastDettPratica, "normDm2018")) {
ReportFascicoloBean bean = new ReportFascicoloBean("- " + LanguageUtil.get(locale, "dp-rispetto") ReportFascicoloBean bean = new ReportFascicoloBean("- " + LanguageUtil.get(locale, "dp-rispetto")
+ StringPool.SPACE + LanguageUtil.get(locale, "norm-dm2018")); + ' ' + LanguageUtil.get(locale, "norm-dm2018"));
listaDettagliPrincipali.add(bean); listaDettagliPrincipali.add(bean);
} }
if (BeanPropertiesUtil.getBoolean(lastDettPratica, "normAnr")) { if (BeanPropertiesUtil.getBoolean(lastDettPratica, "normAnr")) {
ReportFascicoloBean bean = new ReportFascicoloBean("- " + LanguageUtil.get(locale, "dp-normativa") ReportFascicoloBean bean = new ReportFascicoloBean("- " + LanguageUtil.get(locale, "dp-normativa")
+ StringPool.SPACE + LanguageUtil.get(locale, "norm-anr")); + ' ' + LanguageUtil.get(locale, "norm-anr"));
listaDettagliPrincipali.add(bean); listaDettagliPrincipali.add(bean);
} }
if (BeanPropertiesUtil.getBoolean(lastDettPratica, "normLavoriInProprio")) { if (BeanPropertiesUtil.getBoolean(lastDettPratica, "normLavoriInProprio")) {
@ -208,18 +208,16 @@ public class ReportFascicoloUtil {
parameters.put("VALUES_PRATICA_INDIRIZZO", listaIndirizzo); parameters.put("VALUES_PRATICA_INDIRIZZO", listaIndirizzo);
// VALORE SISMICO // VALORE SISMICO
StringBuilder valoreSismico1 = new StringBuilder(); StringBuilder valoreSismico1 = new StringBuilder();
valoreSismico1.append("Zona Sismica: ").append(StringPool.TAB).append(StringPool.TAB) valoreSismico1.append("Zona Sismica: \t\t").append(BeanPropertiesUtil.getString(territorio, "zona"))
.append(BeanPropertiesUtil.getString(territorio, "zona")).append(StringPool.TAB) .append("\t\tFascia Pericolosità: \t\t")
.append(StringPool.TAB).append("Fascia Pericolosità: ").append(StringPool.TAB) .append(BeanPropertiesUtil.getString(territorio, "fascia"));
.append(StringPool.TAB).append(BeanPropertiesUtil.getString(territorio, "fascia"));
parameters.put("VALORE_SISMICO_1", valoreSismico1.toString()); parameters.put("VALORE_SISMICO_1", valoreSismico1.toString());
StringBuilder valoreSismico2 = new StringBuilder(); StringBuilder valoreSismico2 = new StringBuilder();
valoreSismico2.append("Range Ag: ").append(StringPool.TAB).append(StringPool.TAB) valoreSismico2.append("Range Ag: \t\t")
.append(Validator.isNull(territorio.getAgMin()) ? StringPool.BLANK : territorio.getAgMin()) .append(Validator.isNull(territorio.getAgMin()) ? StringPool.BLANK : territorio.getAgMin())
.append(" - ") .append(" - ")
.append((Validator.isNull(territorio.getAgMax()) ? StringPool.BLANK : territorio.getAgMax())) .append((Validator.isNull(territorio.getAgMax()) ? StringPool.BLANK : territorio.getAgMax()))
.append(StringPool.TAB).append(StringPool.TAB).append("Valore di Ag: ").append(StringPool.TAB) .append("\t\tValore di Ag: \t\t").append(BeanPropertiesUtil.getString(lastDettPratica, "ag"));
.append(StringPool.TAB).append(BeanPropertiesUtil.getString(lastDettPratica, "ag"));
parameters.put("VALORE_SISMICO_2", valoreSismico2.toString()); parameters.put("VALORE_SISMICO_2", valoreSismico2.toString());
// TIPOLOGIA INTERVENTO // TIPOLOGIA INTERVENTO
StringBuilder sbTipInt = new StringBuilder(); StringBuilder sbTipInt = new StringBuilder();
@ -231,7 +229,7 @@ public class ReportFascicoloUtil {
|| BeanPropertiesUtil.getBoolean(lastDettPratica, "tcRiparazioneInterventoLocale"); || BeanPropertiesUtil.getBoolean(lastDettPratica, "tcRiparazioneInterventoLocale");
if (checked) { if (checked) {
if (sbTipInt.length() > 0) { if (sbTipInt.length() > 0) {
sbTipInt.append(StringPool.TAB).append(StringPool.TAB); sbTipInt.append("\t\t");
} }
sbTipInt.append(LanguageUtil.get(locale, "tc-interventi-esistenti")); sbTipInt.append(LanguageUtil.get(locale, "tc-interventi-esistenti"));
if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcAdeguamentoSismico")) { if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcAdeguamentoSismico")) {
@ -252,61 +250,61 @@ public class ReportFascicoloUtil {
} }
if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcInOpera")) { if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcInOpera")) {
if (sbTipCos.length() > 0) { if (sbTipCos.length() > 0) {
sbTipCos.append(StringPool.TAB); sbTipCos.append('\t');
} }
sbTipCos.append(LanguageUtil.get(locale, "tc-in-opera")); sbTipCos.append(LanguageUtil.get(locale, "tc-in-opera"));
} }
if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcPrefabbricato")) { if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcPrefabbricato")) {
if (sbTipCos.length() > 0) { if (sbTipCos.length() > 0) {
sbTipCos.append(StringPool.TAB); sbTipCos.append('\t');
} }
sbTipCos.append(LanguageUtil.get(locale, "tc-prefabbricato")); sbTipCos.append(LanguageUtil.get(locale, "tc-prefabbricato"));
} }
if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcInAcciaio")) { if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcInAcciaio")) {
if (sbTipCos.length() > 0) { if (sbTipCos.length() > 0) {
sbTipCos.append(StringPool.TAB); sbTipCos.append('\t');
} }
sbTipCos.append(LanguageUtil.get(locale, "tc-in-acciaio")); sbTipCos.append(LanguageUtil.get(locale, "tc-in-acciaio"));
} }
if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcMista")) { if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcMista")) {
if (sbTipCos.length() > 0) { if (sbTipCos.length() > 0) {
sbTipCos.append(StringPool.TAB); sbTipCos.append('\t');
} }
sbTipCos.append(LanguageUtil.get(locale, "tc-mista")); sbTipCos.append(LanguageUtil.get(locale, "tc-mista"));
} }
if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcInMuratura")) { if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcInMuratura")) {
if (sbTipCos.length() > 0) { if (sbTipCos.length() > 0) {
sbTipCos.append(StringPool.TAB); sbTipCos.append('\t');
} }
sbTipCos.append(LanguageUtil.get(locale, "tc-in-muratura")); sbTipCos.append(LanguageUtil.get(locale, "tc-in-muratura"));
} }
if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcInMuraturaOrdinaria")) { if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcInMuraturaOrdinaria")) {
if (sbTipCos.length() > 0) { if (sbTipCos.length() > 0) {
sbTipCos.append(StringPool.TAB); sbTipCos.append('\t');
} }
sbTipCos.append(LanguageUtil.get(locale, "tc-in-muratura-ordinaria")); sbTipCos.append(LanguageUtil.get(locale, "tc-in-muratura-ordinaria"));
} }
if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcInMuraturaArmata")) { if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcInMuraturaArmata")) {
if (sbTipCos.length() > 0) { if (sbTipCos.length() > 0) {
sbTipCos.append(StringPool.TAB); sbTipCos.append('\t');
} }
sbTipCos.append(LanguageUtil.get(locale, "tc-in-muratura-armata")); sbTipCos.append(LanguageUtil.get(locale, "tc-in-muratura-armata"));
} }
if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcInMuraturaMista")) { if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcInMuraturaMista")) {
if (sbTipCos.length() > 0) { if (sbTipCos.length() > 0) {
sbTipCos.append(StringPool.TAB); sbTipCos.append('\t');
} }
sbTipCos.append(LanguageUtil.get(locale, "tc-in-muratura-mista")); sbTipCos.append(LanguageUtil.get(locale, "tc-in-muratura-mista"));
} }
if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcInLegno")) { if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcInLegno")) {
if (sbTipCos.length() > 0) { if (sbTipCos.length() > 0) {
sbTipCos.append(StringPool.TAB); sbTipCos.append('\t');
} }
sbTipCos.append(LanguageUtil.get(locale, "tc-in-legno")); sbTipCos.append(LanguageUtil.get(locale, "tc-in-legno"));
} }
if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcAltro")) { if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcAltro")) {
if (sbTipCos.length() > 0) { if (sbTipCos.length() > 0) {
sbTipCos.append(StringPool.TAB); sbTipCos.append('\t');
} }
sbTipCos.append(LanguageUtil.get(locale, "tc-altro")); sbTipCos.append(LanguageUtil.get(locale, "tc-altro"));
} }
@ -316,26 +314,26 @@ public class ReportFascicoloUtil {
List<Soggetto> committenti = SoggettoLocalServiceUtil.findByDettPratica_TipologiaSoggetto( List<Soggetto> committenti = SoggettoLocalServiceUtil.findByDettPratica_TipologiaSoggetto(
lastDettPratica.getDettPraticaId(), TipoSoggettoUtil.COMMITTENTE); lastDettPratica.getDettPraticaId(), TipoSoggettoUtil.COMMITTENTE);
for (Soggetto soggetto : committenti) { for (Soggetto soggetto : committenti) {
ReportFascicoloBean bean1 = new ReportFascicoloBean("- Committente: " + soggetto.getNome() ReportFascicoloBean bean1 = new ReportFascicoloBean("- Committente: " + soggetto.getNome() + ' '
+ StringPool.SPACE + soggetto.getCognome()); + soggetto.getCognome());
listaSoggetti.add(bean1); listaSoggetti.add(bean1);
} }
List<Soggetto> progettisti = SoggettoLocalServiceUtil.findByDettPratica_TipologiaSoggetto( List<Soggetto> progettisti = SoggettoLocalServiceUtil.findByDettPratica_TipologiaSoggetto(
lastDettPratica.getDettPraticaId(), TipoSoggettoUtil.PROGETTISTA); lastDettPratica.getDettPraticaId(), TipoSoggettoUtil.PROGETTISTA);
for (Soggetto soggetto : progettisti) { for (Soggetto soggetto : progettisti) {
ReportFascicoloBean bean1 = new ReportFascicoloBean("- Progettista: " + soggetto.getNome() ReportFascicoloBean bean1 = new ReportFascicoloBean("- Progettista: " + soggetto.getNome() + ' '
+ StringPool.SPACE + soggetto.getCognome() + " - albo " + soggetto.getAlbo() + " di " + soggetto.getCognome() + " - albo " + soggetto.getAlbo() + " di "
+ soggetto.getProvinciaAlbo() + " (iscr. num. " + soggetto.getNumIscrAlbo() + soggetto.getProvinciaAlbo() + " (iscr. num. " + soggetto.getNumIscrAlbo()
+ StringPool.CLOSE_PARENTHESIS + " - ambito: " + soggetto.getAmbitoProfessione()); + ") - ambito: " + soggetto.getAmbitoProfessione());
listaSoggetti.add(bean1); listaSoggetti.add(bean1);
} }
List<Soggetto> dirLavori = SoggettoLocalServiceUtil.findByDettPratica_TipologiaSoggetto( List<Soggetto> dirLavori = SoggettoLocalServiceUtil.findByDettPratica_TipologiaSoggetto(
lastDettPratica.getDettPraticaId(), TipoSoggettoUtil.DIRETTORE_LAVORI); lastDettPratica.getDettPraticaId(), TipoSoggettoUtil.DIRETTORE_LAVORI);
for (Soggetto soggetto : dirLavori) { for (Soggetto soggetto : dirLavori) {
ReportFascicoloBean bean1 = new ReportFascicoloBean("- Direttore Lavori: " + soggetto.getNome() ReportFascicoloBean bean1 = new ReportFascicoloBean("- Direttore Lavori: " + soggetto.getNome()
+ StringPool.SPACE + soggetto.getCognome() + " - albo " + soggetto.getAlbo() + " di " + ' ' + soggetto.getCognome() + " - albo " + soggetto.getAlbo() + " di "
+ soggetto.getProvinciaAlbo() + " (iscr. num. " + soggetto.getNumIscrAlbo() + soggetto.getProvinciaAlbo() + " (iscr. num. " + soggetto.getNumIscrAlbo()
+ StringPool.CLOSE_PARENTHESIS + " - ambito: " + soggetto.getAmbitoProfessione()); + ") - ambito: " + soggetto.getAmbitoProfessione());
listaSoggetti.add(bean1); listaSoggetti.add(bean1);
} }
List<Soggetto> ditta = SoggettoLocalServiceUtil.findByDettPratica_TipologiaSoggetto( List<Soggetto> ditta = SoggettoLocalServiceUtil.findByDettPratica_TipologiaSoggetto(
@ -347,19 +345,19 @@ public class ReportFascicoloUtil {
List<Soggetto> gelologi = SoggettoLocalServiceUtil.findByDettPratica_TipologiaSoggetto( List<Soggetto> gelologi = SoggettoLocalServiceUtil.findByDettPratica_TipologiaSoggetto(
lastDettPratica.getDettPraticaId(), TipoSoggettoUtil.GEOLOGO); lastDettPratica.getDettPraticaId(), TipoSoggettoUtil.GEOLOGO);
for (Soggetto soggetto : gelologi) { for (Soggetto soggetto : gelologi) {
ReportFascicoloBean bean1 = new ReportFascicoloBean("- Geologo: " + soggetto.getNome() ReportFascicoloBean bean1 = new ReportFascicoloBean("- Geologo: " + soggetto.getNome() + ' '
+ StringPool.SPACE + soggetto.getCognome() + " - albo " + soggetto.getAlbo() + " di " + soggetto.getCognome() + " - albo " + soggetto.getAlbo() + " di "
+ soggetto.getProvinciaAlbo() + " (iscr. num. " + soggetto.getNumIscrAlbo() + soggetto.getProvinciaAlbo() + " (iscr. num. " + soggetto.getNumIscrAlbo()
+ StringPool.CLOSE_PARENTHESIS + " - ambito: " + soggetto.getAmbitoProfessione()); + ") - ambito: " + soggetto.getAmbitoProfessione());
listaSoggetti.add(bean1); listaSoggetti.add(bean1);
} }
List<Soggetto> collaudo = SoggettoLocalServiceUtil.findByDettPratica_TipologiaSoggetto( List<Soggetto> collaudo = SoggettoLocalServiceUtil.findByDettPratica_TipologiaSoggetto(
lastDettPratica.getDettPraticaId(), TipoSoggettoUtil.COLLAUDATORE); lastDettPratica.getDettPraticaId(), TipoSoggettoUtil.COLLAUDATORE);
for (Soggetto soggetto : collaudo) { for (Soggetto soggetto : collaudo) {
ReportFascicoloBean bean1 = new ReportFascicoloBean("- Collaudatore: " + soggetto.getNome() ReportFascicoloBean bean1 = new ReportFascicoloBean("- Collaudatore: " + soggetto.getNome() + ' '
+ StringPool.SPACE + soggetto.getCognome() + " - albo " + soggetto.getAlbo() + " di " + soggetto.getCognome() + " - albo " + soggetto.getAlbo() + " di "
+ soggetto.getProvinciaAlbo() + " (iscr. num. " + soggetto.getNumIscrAlbo() + soggetto.getProvinciaAlbo() + " (iscr. num. " + soggetto.getNumIscrAlbo()
+ StringPool.CLOSE_PARENTHESIS + " - ambito: " + soggetto.getAmbitoProfessione()); + ") - ambito: " + soggetto.getAmbitoProfessione());
listaSoggetti.add(bean1); listaSoggetti.add(bean1);
} }
parameters.put("ANAGRAFICA_SOGGETTI", listaSoggetti); parameters.put("ANAGRAFICA_SOGGETTI", listaSoggetti);
@ -372,8 +370,8 @@ public class ReportFascicoloUtil {
QueryUtil.ALL_POS); QueryUtil.ALL_POS);
if (docPraticas != null && !docPraticas.isEmpty()) { if (docPraticas != null && !docPraticas.isEmpty()) {
ReportFascicoloBean bean1 = new ReportFascicoloBean(stringa + " - " ReportFascicoloBean bean1 = new ReportFascicoloBean(stringa + " - "
+ LanguageUtil.get(locale, "label-documenti-tipologia-" + stringa) + StringPool.TAB + LanguageUtil.get(locale, "label-documenti-tipologia-" + stringa)
+ " - num. documenti presentati: " + docPraticas.size()); + "\t - num. documenti presentati: " + docPraticas.size());
listaAllegatiGeo.add(bean1); listaAllegatiGeo.add(bean1);
} }
} }
@ -387,8 +385,8 @@ public class ReportFascicoloUtil {
QueryUtil.ALL_POS); QueryUtil.ALL_POS);
if (docPraticas != null && !docPraticas.isEmpty()) { if (docPraticas != null && !docPraticas.isEmpty()) {
ReportFascicoloBean bean1 = new ReportFascicoloBean(stringa + " - " ReportFascicoloBean bean1 = new ReportFascicoloBean(stringa + " - "
+ LanguageUtil.get(locale, "label-documenti-tipologia-" + stringa) + StringPool.TAB + LanguageUtil.get(locale, "label-documenti-tipologia-" + stringa)
+ " - num. documenti presentati: " + docPraticas.size()); + "\t - num. documenti presentati: " + docPraticas.size());
listaAllegatiDomanda.add(bean1); listaAllegatiDomanda.add(bean1);
} }
} }
@ -451,34 +449,34 @@ public class ReportFascicoloUtil {
if (intPratica.isDeposito()) { if (intPratica.isDeposito()) {
if (BeanPropertiesUtil.getBoolean(lastDettPratica, "normDpr01Dep")) { if (BeanPropertiesUtil.getBoolean(lastDettPratica, "normDpr01Dep")) {
ReportFascicoloBean bean = new ReportFascicoloBean("- " + LanguageUtil.get(locale, "dp-sensi") ReportFascicoloBean bean = new ReportFascicoloBean("- " + LanguageUtil.get(locale, "dp-sensi")
+ StringPool.SPACE + LanguageUtil.get(locale, "norm-dpr01-dep")); + ' ' + LanguageUtil.get(locale, "norm-dpr01-dep"));
listaDettagliPrincipali.add(bean); listaDettagliPrincipali.add(bean);
} }
if (BeanPropertiesUtil.getBoolean(lastDettPratica, "normDpr02Dep")) { if (BeanPropertiesUtil.getBoolean(lastDettPratica, "normDpr02Dep")) {
ReportFascicoloBean bean = new ReportFascicoloBean("- " + LanguageUtil.get(locale, "dp-sensi") ReportFascicoloBean bean = new ReportFascicoloBean("- " + LanguageUtil.get(locale, "dp-sensi")
+ StringPool.SPACE + LanguageUtil.get(locale, "norm-dpr02-dep")); + ' ' + LanguageUtil.get(locale, "norm-dpr02-dep"));
listaDettagliPrincipali.add(bean); listaDettagliPrincipali.add(bean);
} }
} else if (intPratica.isAutorizzazione()) { } else if (intPratica.isAutorizzazione()) {
if (BeanPropertiesUtil.getBoolean(lastDettPratica, "normDpr01Aut")) { if (BeanPropertiesUtil.getBoolean(lastDettPratica, "normDpr01Aut")) {
ReportFascicoloBean bean = new ReportFascicoloBean("- " + LanguageUtil.get(locale, "dp-sensi") ReportFascicoloBean bean = new ReportFascicoloBean("- " + LanguageUtil.get(locale, "dp-sensi")
+ StringPool.SPACE + LanguageUtil.get(locale, "norm-dpr01-aut")); + ' ' + LanguageUtil.get(locale, "norm-dpr01-aut"));
listaDettagliPrincipali.add(bean); listaDettagliPrincipali.add(bean);
} }
if (BeanPropertiesUtil.getBoolean(lastDettPratica, "normDpr02Aut")) { if (BeanPropertiesUtil.getBoolean(lastDettPratica, "normDpr02Aut")) {
ReportFascicoloBean bean = new ReportFascicoloBean("- " + LanguageUtil.get(locale, "dp-sensi") ReportFascicoloBean bean = new ReportFascicoloBean("- " + LanguageUtil.get(locale, "dp-sensi")
+ StringPool.SPACE + LanguageUtil.get(locale, "norm-dpr02-aut")); + ' ' + LanguageUtil.get(locale, "norm-dpr02-aut"));
listaDettagliPrincipali.add(bean); listaDettagliPrincipali.add(bean);
} }
} }
if (BeanPropertiesUtil.getBoolean(lastDettPratica, "normDm2018")) { if (BeanPropertiesUtil.getBoolean(lastDettPratica, "normDm2018")) {
ReportFascicoloBean bean = new ReportFascicoloBean("- " + LanguageUtil.get(locale, "dp-rispetto") ReportFascicoloBean bean = new ReportFascicoloBean("- " + LanguageUtil.get(locale, "dp-rispetto")
+ StringPool.SPACE + LanguageUtil.get(locale, "norm-dm2018")); + ' ' + LanguageUtil.get(locale, "norm-dm2018"));
listaDettagliPrincipali.add(bean); listaDettagliPrincipali.add(bean);
} }
if (BeanPropertiesUtil.getBoolean(lastDettPratica, "normAnr")) { if (BeanPropertiesUtil.getBoolean(lastDettPratica, "normAnr")) {
ReportFascicoloBean bean = new ReportFascicoloBean("- " + LanguageUtil.get(locale, "dp-normativa") ReportFascicoloBean bean = new ReportFascicoloBean("- " + LanguageUtil.get(locale, "dp-normativa")
+ StringPool.SPACE + LanguageUtil.get(locale, "norm-anr")); + ' ' + LanguageUtil.get(locale, "norm-anr"));
listaDettagliPrincipali.add(bean); listaDettagliPrincipali.add(bean);
} }
if (BeanPropertiesUtil.getBoolean(lastDettPratica, "normLavoriInProprio")) { if (BeanPropertiesUtil.getBoolean(lastDettPratica, "normLavoriInProprio")) {
@ -566,18 +564,16 @@ public class ReportFascicoloUtil {
parameters.put("VALUES_PRATICA_INDIRIZZO", listaIndirizzo); parameters.put("VALUES_PRATICA_INDIRIZZO", listaIndirizzo);
// VALORE SISMICO // VALORE SISMICO
StringBuilder valoreSismico1 = new StringBuilder(); StringBuilder valoreSismico1 = new StringBuilder();
valoreSismico1.append("Zona Sismica: ").append(StringPool.TAB).append(StringPool.TAB) valoreSismico1.append("Zona Sismica: \t\t").append(BeanPropertiesUtil.getString(territorio, "zona"))
.append(BeanPropertiesUtil.getString(territorio, "zona")).append(StringPool.TAB) .append("\t\tFascia Pericolosità: \t\t")
.append(StringPool.TAB).append("Fascia Pericolosità: ").append(StringPool.TAB) .append(BeanPropertiesUtil.getString(territorio, "fascia"));
.append(StringPool.TAB).append(BeanPropertiesUtil.getString(territorio, "fascia"));
parameters.put("VALORE_SISMICO_1", valoreSismico1.toString()); parameters.put("VALORE_SISMICO_1", valoreSismico1.toString());
StringBuilder valoreSismico2 = new StringBuilder(); StringBuilder valoreSismico2 = new StringBuilder();
valoreSismico2.append("Range Ag: ").append(StringPool.TAB).append(StringPool.TAB) valoreSismico2.append("Range Ag: \t\t")
.append(Validator.isNull(territorio.getAgMin()) ? StringPool.BLANK : territorio.getAgMin()) .append(Validator.isNull(territorio.getAgMin()) ? StringPool.BLANK : territorio.getAgMin())
.append(" - ") .append(" - ")
.append(Validator.isNull(territorio.getAgMax()) ? StringPool.BLANK : territorio.getAgMax()) .append(Validator.isNull(territorio.getAgMax()) ? StringPool.BLANK : territorio.getAgMax())
.append(StringPool.TAB).append(StringPool.TAB).append("Valore di Ag: ").append(StringPool.TAB) .append("\t\tValore di Ag: \t\t").append(BeanPropertiesUtil.getString(lastDettPratica, "ag"));
.append(StringPool.TAB).append(BeanPropertiesUtil.getString(lastDettPratica, "ag"));
parameters.put("VALORE_SISMICO_2", valoreSismico2.toString()); parameters.put("VALORE_SISMICO_2", valoreSismico2.toString());
// TIPOLOGIA INTERVENTO // TIPOLOGIA INTERVENTO
StringBuilder sbTipInt = new StringBuilder(); StringBuilder sbTipInt = new StringBuilder();
@ -589,7 +585,7 @@ public class ReportFascicoloUtil {
|| BeanPropertiesUtil.getBoolean(lastDettPratica, "tcRiparazioneInterventoLocale"); || BeanPropertiesUtil.getBoolean(lastDettPratica, "tcRiparazioneInterventoLocale");
if (checked) { if (checked) {
if (sbTipInt.length() > 0) { if (sbTipInt.length() > 0) {
sbTipInt.append(StringPool.TAB).append(StringPool.TAB); sbTipInt.append("\t\t");
} }
sbTipInt.append(LanguageUtil.get(locale, "tc-interventi-esistenti")); sbTipInt.append(LanguageUtil.get(locale, "tc-interventi-esistenti"));
if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcAdeguamentoSismico")) { if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcAdeguamentoSismico")) {
@ -610,61 +606,61 @@ public class ReportFascicoloUtil {
} }
if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcInOpera")) { if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcInOpera")) {
if (sbTipCos.length() > 0) { if (sbTipCos.length() > 0) {
sbTipCos.append(StringPool.TAB); sbTipCos.append('\t');
} }
sbTipCos.append(LanguageUtil.get(locale, "tc-in-opera")); sbTipCos.append(LanguageUtil.get(locale, "tc-in-opera"));
} }
if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcPrefabbricato")) { if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcPrefabbricato")) {
if (sbTipCos.length() > 0) { if (sbTipCos.length() > 0) {
sbTipCos.append(StringPool.TAB); sbTipCos.append('\t');
} }
sbTipCos.append(LanguageUtil.get(locale, "tc-prefabbricato")); sbTipCos.append(LanguageUtil.get(locale, "tc-prefabbricato"));
} }
if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcInAcciaio")) { if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcInAcciaio")) {
if (sbTipCos.length() > 0) { if (sbTipCos.length() > 0) {
sbTipCos.append(StringPool.TAB); sbTipCos.append('\t');
} }
sbTipCos.append(LanguageUtil.get(locale, "tc-in-acciaio")); sbTipCos.append(LanguageUtil.get(locale, "tc-in-acciaio"));
} }
if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcMista")) { if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcMista")) {
if (sbTipCos.length() > 0) { if (sbTipCos.length() > 0) {
sbTipCos.append(StringPool.TAB); sbTipCos.append('\t');
} }
sbTipCos.append(LanguageUtil.get(locale, "tc-mista")); sbTipCos.append(LanguageUtil.get(locale, "tc-mista"));
} }
if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcInMuratura")) { if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcInMuratura")) {
if (sbTipCos.length() > 0) { if (sbTipCos.length() > 0) {
sbTipCos.append(StringPool.TAB); sbTipCos.append('\t');
} }
sbTipCos.append(LanguageUtil.get(locale, "tc-in-muratura")); sbTipCos.append(LanguageUtil.get(locale, "tc-in-muratura"));
} }
if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcInMuraturaOrdinaria")) { if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcInMuraturaOrdinaria")) {
if (sbTipCos.length() > 0) { if (sbTipCos.length() > 0) {
sbTipCos.append(StringPool.TAB); sbTipCos.append('\t');
} }
sbTipCos.append(LanguageUtil.get(locale, "tc-in-muratura-ordinaria")); sbTipCos.append(LanguageUtil.get(locale, "tc-in-muratura-ordinaria"));
} }
if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcInMuraturaArmata")) { if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcInMuraturaArmata")) {
if (sbTipCos.length() > 0) { if (sbTipCos.length() > 0) {
sbTipCos.append(StringPool.TAB); sbTipCos.append('\t');
} }
sbTipCos.append(LanguageUtil.get(locale, "tc-in-muratura-armata")); sbTipCos.append(LanguageUtil.get(locale, "tc-in-muratura-armata"));
} }
if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcInMuraturaMista")) { if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcInMuraturaMista")) {
if (sbTipCos.length() > 0) { if (sbTipCos.length() > 0) {
sbTipCos.append(StringPool.TAB); sbTipCos.append('\t');
} }
sbTipCos.append(LanguageUtil.get(locale, "tc-in-muratura-mista")); sbTipCos.append(LanguageUtil.get(locale, "tc-in-muratura-mista"));
} }
if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcInLegno")) { if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcInLegno")) {
if (sbTipCos.length() > 0) { if (sbTipCos.length() > 0) {
sbTipCos.append(StringPool.TAB); sbTipCos.append('\t');
} }
sbTipCos.append(LanguageUtil.get(locale, "tc-in-legno")); sbTipCos.append(LanguageUtil.get(locale, "tc-in-legno"));
} }
if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcAltro")) { if (BeanPropertiesUtil.getBoolean(lastDettPratica, "tcAltro")) {
if (sbTipCos.length() > 0) { if (sbTipCos.length() > 0) {
sbTipCos.append(StringPool.TAB); sbTipCos.append('\t');
} }
sbTipCos.append(LanguageUtil.get(locale, "tc-altro")); sbTipCos.append(LanguageUtil.get(locale, "tc-altro"));
} }
@ -674,26 +670,26 @@ public class ReportFascicoloUtil {
List<Soggetto> committenti = SoggettoLocalServiceUtil.findByIntPratica_TipologiaSoggetto(intPraticaId, List<Soggetto> committenti = SoggettoLocalServiceUtil.findByIntPratica_TipologiaSoggetto(intPraticaId,
TipoSoggettoUtil.COMMITTENTE); TipoSoggettoUtil.COMMITTENTE);
for (Soggetto soggetto : committenti) { for (Soggetto soggetto : committenti) {
ReportFascicoloBean bean1 = new ReportFascicoloBean("- Committente: " + soggetto.getNome() ReportFascicoloBean bean1 = new ReportFascicoloBean("- Committente: " + soggetto.getNome() + ' '
+ StringPool.SPACE + soggetto.getCognome()); + soggetto.getCognome());
listaSoggetti.add(bean1); listaSoggetti.add(bean1);
} }
List<Soggetto> progettisti = SoggettoLocalServiceUtil.findByIntPratica_TipologiaSoggetto(intPraticaId, List<Soggetto> progettisti = SoggettoLocalServiceUtil.findByIntPratica_TipologiaSoggetto(intPraticaId,
TipoSoggettoUtil.PROGETTISTA); TipoSoggettoUtil.PROGETTISTA);
for (Soggetto soggetto : progettisti) { for (Soggetto soggetto : progettisti) {
ReportFascicoloBean bean1 = new ReportFascicoloBean("- Progettista: " + soggetto.getNome() ReportFascicoloBean bean1 = new ReportFascicoloBean("- Progettista: " + soggetto.getNome() + ' '
+ StringPool.SPACE + soggetto.getCognome() + " - albo " + soggetto.getAlbo() + " di " + soggetto.getCognome() + " - albo " + soggetto.getAlbo() + " di "
+ soggetto.getProvinciaAlbo() + " (iscr. num. " + soggetto.getNumIscrAlbo() + soggetto.getProvinciaAlbo() + " (iscr. num. " + soggetto.getNumIscrAlbo()
+ StringPool.CLOSE_PARENTHESIS + " - ambito: " + soggetto.getAmbitoProfessione()); + ") - ambito: " + soggetto.getAmbitoProfessione());
listaSoggetti.add(bean1); listaSoggetti.add(bean1);
} }
List<Soggetto> dirLavori = SoggettoLocalServiceUtil.findByIntPratica_TipologiaSoggetto(intPraticaId, List<Soggetto> dirLavori = SoggettoLocalServiceUtil.findByIntPratica_TipologiaSoggetto(intPraticaId,
TipoSoggettoUtil.DIRETTORE_LAVORI); TipoSoggettoUtil.DIRETTORE_LAVORI);
for (Soggetto soggetto : dirLavori) { for (Soggetto soggetto : dirLavori) {
ReportFascicoloBean bean1 = new ReportFascicoloBean("- Direttore Lavori: " + soggetto.getNome() ReportFascicoloBean bean1 = new ReportFascicoloBean("- Direttore Lavori: " + soggetto.getNome()
+ StringPool.SPACE + soggetto.getCognome() + " - albo " + soggetto.getAlbo() + " di " + ' ' + soggetto.getCognome() + " - albo " + soggetto.getAlbo() + " di "
+ soggetto.getProvinciaAlbo() + " (iscr. num. " + soggetto.getNumIscrAlbo() + soggetto.getProvinciaAlbo() + " (iscr. num. " + soggetto.getNumIscrAlbo()
+ StringPool.CLOSE_PARENTHESIS + " - ambito: " + soggetto.getAmbitoProfessione()); + ") - ambito: " + soggetto.getAmbitoProfessione());
listaSoggetti.add(bean1); listaSoggetti.add(bean1);
} }
List<Soggetto> ditta = SoggettoLocalServiceUtil.findByIntPratica_TipologiaSoggetto(intPraticaId, List<Soggetto> ditta = SoggettoLocalServiceUtil.findByIntPratica_TipologiaSoggetto(intPraticaId,
@ -705,19 +701,19 @@ public class ReportFascicoloUtil {
List<Soggetto> gelologi = SoggettoLocalServiceUtil.findByIntPratica_TipologiaSoggetto(intPraticaId, List<Soggetto> gelologi = SoggettoLocalServiceUtil.findByIntPratica_TipologiaSoggetto(intPraticaId,
TipoSoggettoUtil.GEOLOGO); TipoSoggettoUtil.GEOLOGO);
for (Soggetto soggetto : gelologi) { for (Soggetto soggetto : gelologi) {
ReportFascicoloBean bean1 = new ReportFascicoloBean("- Geologo: " + soggetto.getNome() ReportFascicoloBean bean1 = new ReportFascicoloBean("- Geologo: " + soggetto.getNome() + ' '
+ StringPool.SPACE + soggetto.getCognome() + " - albo " + soggetto.getAlbo() + " di " + soggetto.getCognome() + " - albo " + soggetto.getAlbo() + " di "
+ soggetto.getProvinciaAlbo() + " (iscr. num. " + soggetto.getNumIscrAlbo() + soggetto.getProvinciaAlbo() + " (iscr. num. " + soggetto.getNumIscrAlbo()
+ StringPool.CLOSE_PARENTHESIS + " - ambito: " + soggetto.getAmbitoProfessione()); + ") - ambito: " + soggetto.getAmbitoProfessione());
listaSoggetti.add(bean1); listaSoggetti.add(bean1);
} }
List<Soggetto> collaudo = SoggettoLocalServiceUtil.findByIntPratica_TipologiaSoggetto(intPraticaId, List<Soggetto> collaudo = SoggettoLocalServiceUtil.findByIntPratica_TipologiaSoggetto(intPraticaId,
TipoSoggettoUtil.COLLAUDATORE); TipoSoggettoUtil.COLLAUDATORE);
for (Soggetto soggetto : collaudo) { for (Soggetto soggetto : collaudo) {
ReportFascicoloBean bean1 = new ReportFascicoloBean("- Collaudatore: " + soggetto.getNome() ReportFascicoloBean bean1 = new ReportFascicoloBean("- Collaudatore: " + soggetto.getNome() + ' '
+ StringPool.SPACE + soggetto.getCognome() + " - albo " + soggetto.getAlbo() + " di " + soggetto.getCognome() + " - albo " + soggetto.getAlbo() + " di "
+ soggetto.getProvinciaAlbo() + " (iscr. num. " + soggetto.getNumIscrAlbo() + soggetto.getProvinciaAlbo() + " (iscr. num. " + soggetto.getNumIscrAlbo()
+ StringPool.CLOSE_PARENTHESIS + " - ambito: " + soggetto.getAmbitoProfessione()); + ") - ambito: " + soggetto.getAmbitoProfessione());
listaSoggetti.add(bean1); listaSoggetti.add(bean1);
} }
parameters.put("ANAGRAFICA_SOGGETTI", listaSoggetti); parameters.put("ANAGRAFICA_SOGGETTI", listaSoggetti);
@ -730,8 +726,8 @@ public class ReportFascicoloUtil {
QueryUtil.ALL_POS); QueryUtil.ALL_POS);
if (docPraticas != null && !docPraticas.isEmpty()) { if (docPraticas != null && !docPraticas.isEmpty()) {
ReportFascicoloBean bean1 = new ReportFascicoloBean(stringa + " - " ReportFascicoloBean bean1 = new ReportFascicoloBean(stringa + " - "
+ LanguageUtil.get(locale, "label-documenti-tipologia-" + stringa) + StringPool.TAB + LanguageUtil.get(locale, "label-documenti-tipologia-" + stringa)
+ " - num. documenti presentati: " + docPraticas.size()); + "\t - num. documenti presentati: " + docPraticas.size());
listaAllegatiGeo.add(bean1); listaAllegatiGeo.add(bean1);
} }
} }
@ -745,8 +741,8 @@ public class ReportFascicoloUtil {
QueryUtil.ALL_POS); QueryUtil.ALL_POS);
if (docPraticas != null && !docPraticas.isEmpty()) { if (docPraticas != null && !docPraticas.isEmpty()) {
ReportFascicoloBean bean1 = new ReportFascicoloBean(stringa + " - " ReportFascicoloBean bean1 = new ReportFascicoloBean(stringa + " - "
+ LanguageUtil.get(locale, "label-documenti-tipologia-" + stringa) + StringPool.TAB + LanguageUtil.get(locale, "label-documenti-tipologia-" + stringa)
+ " - num. documenti presentati: " + docPraticas.size()); + "\t - num. documenti presentati: " + docPraticas.size());
listaAllegatiDomanda.add(bean1); listaAllegatiDomanda.add(bean1);
} }
} }
@ -881,18 +877,15 @@ public class ReportFascicoloUtil {
} }
} }
if (!direttoreLavori.getNumIscrAlbo().equals(StringPool.BLANK)) { if (!direttoreLavori.getNumIscrAlbo().equals(StringPool.BLANK)) {
sbLavori.append(" (iscr. num. ").append(direttoreLavori.getNumIscrAlbo()) sbLavori.append(" (iscr. num. ").append(direttoreLavori.getNumIscrAlbo()).append(')');
.append(StringPool.CLOSE_PARENTHESIS);
} }
if (!direttoreLavori.getAmbitoProfessione().equals(StringPool.BLANK)) { if (!direttoreLavori.getAmbitoProfessione().equals(StringPool.BLANK)) {
sbLavori.append(" - ambito: ").append(direttoreLavori.getAmbitoProfessione()); sbLavori.append(" - ambito: ").append(direttoreLavori.getAmbitoProfessione());
} }
} }
parameters.put( parameters.put("DIRETTORE_LAVORI", direttoreLavori.getNome() + ' ' + direttoreLavori.getCognome()
"DIRETTORE_LAVORI", + sbLavori.toString());
direttoreLavori.getNome() + StringPool.SPACE + direttoreLavori.getCognome()
+ sbLavori.toString());
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
List<Soggetto> committenti = SoggettoLocalServiceUtil.findByIntPratica_TipologiaSoggetto(intPraticaId, List<Soggetto> committenti = SoggettoLocalServiceUtil.findByIntPratica_TipologiaSoggetto(intPraticaId,
TipoSoggettoUtil.COMMITTENTE); TipoSoggettoUtil.COMMITTENTE);
@ -901,7 +894,7 @@ public class ReportFascicoloUtil {
if (sb.length() > 0) { if (sb.length() > 0) {
sb.append(" , "); sb.append(" , ");
} }
sb.append(soggetto.getNome()).append(StringPool.SPACE).append(soggetto.getCognome()); sb.append(soggetto.getNome()).append(' ').append(soggetto.getCognome());
} }
} }
parameters.put("COMMITTENTE", sb.toString()); parameters.put("COMMITTENTE", sb.toString());
@ -915,7 +908,7 @@ public class ReportFascicoloUtil {
for (DettPratica dett : listasDett) { for (DettPratica dett : listasDett) {
if (dett.getDataEffettuazione() != null) { if (dett.getDataEffettuazione() != null) {
ReportFascicoloBean bean1 = new ReportFascicoloBean("- " ReportFascicoloBean bean1 = new ReportFascicoloBean("- "
+ sdf.format(dett.getDataEffettuazione()) + StringPool.SPACE + sdf.format(dett.getDataEffettuazione()) + ' '
+ LanguageUtil.get(locale, "label-integrazione-" + dett.getTipoIntegrazione())); + LanguageUtil.get(locale, "label-integrazione-" + dett.getTipoIntegrazione()));
listaDettBeans.add(bean1); listaDettBeans.add(bean1);
} }
@ -960,9 +953,8 @@ public class ReportFascicoloUtil {
if (pagamenti != null) { if (pagamenti != null) {
for (Pagamento pagamento : pagamenti) { for (Pagamento pagamento : pagamenti) {
ReportFascicoloBean bean1 = new ReportFascicoloBean(" - Data Pagamento: " ReportFascicoloBean bean1 = new ReportFascicoloBean(" - Data Pagamento: "
+ sdf.format(pagamento.getModifiedDate()) + StringPool.TAB + sdf.format(pagamento.getModifiedDate()) + "\t Mezzo di Pagamento: IRIS "
+ " Mezzo di Pagamento: IRIS " + StringPool.TAB + " Importo Bolli: " + "\t Importo Bolli: " + pagamento.getImportoString());
+ pagamento.getImportoString());
pagamentiList.add(bean1); pagamentiList.add(bean1);
} }
} }
@ -1064,17 +1056,14 @@ public class ReportFascicoloUtil {
} }
} }
if (!direttoreLavori.getNumIscrAlbo().equals(StringPool.BLANK)) { if (!direttoreLavori.getNumIscrAlbo().equals(StringPool.BLANK)) {
sbLavori.append(" (iscr. num. ").append( sbLavori.append(" (iscr. num. ").append(direttoreLavori.getNumIscrAlbo() + ')');
direttoreLavori.getNumIscrAlbo() + StringPool.CLOSE_PARENTHESIS);
} }
if (!direttoreLavori.getAmbitoProfessione().equals(StringPool.BLANK)) { if (!direttoreLavori.getAmbitoProfessione().equals(StringPool.BLANK)) {
sbLavori.append(" - ambito: ").append(direttoreLavori.getAmbitoProfessione()); sbLavori.append(" - ambito: ").append(direttoreLavori.getAmbitoProfessione());
} }
} }
parameters.put( parameters.put("DIRETTORE_LAVORI", direttoreLavori.getNome() + ' ' + direttoreLavori.getCognome()
"DIRETTORE_LAVORI", + sbLavori.toString());
direttoreLavori.getNome() + StringPool.SPACE + direttoreLavori.getCognome()
+ sbLavori.toString());
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
List<Soggetto> committenti = SoggettoLocalServiceUtil.findByIntPratica_TipologiaSoggetto(intPraticaId, List<Soggetto> committenti = SoggettoLocalServiceUtil.findByIntPratica_TipologiaSoggetto(intPraticaId,
TipoSoggettoUtil.COMMITTENTE); TipoSoggettoUtil.COMMITTENTE);
@ -1083,7 +1072,7 @@ public class ReportFascicoloUtil {
if (sb.length() > 0) { if (sb.length() > 0) {
sb.append(" , "); sb.append(" , ");
} }
sb.append(soggetto.getNome()).append(StringPool.SPACE).append(soggetto.getCognome()); sb.append(soggetto.getNome()).append(' ').append(soggetto.getCognome());
} }
} }
parameters.put("COMMITTENTE", sb.toString()); parameters.put("COMMITTENTE", sb.toString());
@ -1097,7 +1086,7 @@ public class ReportFascicoloUtil {
for (DettPratica dett : listasDett) { for (DettPratica dett : listasDett) {
if (dett.getDataEffettuazione() != null) { if (dett.getDataEffettuazione() != null) {
ReportFascicoloBean bean1 = new ReportFascicoloBean("- " ReportFascicoloBean bean1 = new ReportFascicoloBean("- "
+ sdf.format(dett.getDataEffettuazione()) + StringPool.SPACE + sdf.format(dett.getDataEffettuazione()) + ' '
+ LanguageUtil.get(locale, "label-integrazione-" + dett.getTipoIntegrazione())); + LanguageUtil.get(locale, "label-integrazione-" + dett.getTipoIntegrazione()));
listaDettBeans.add(bean1); listaDettBeans.add(bean1);
} }
@ -1113,7 +1102,7 @@ public class ReportFascicoloUtil {
stringaPlus = "Fine Lavori Totale"; stringaPlus = "Fine Lavori Totale";
} }
ReportFascicoloBean bean1 = new ReportFascicoloBean("- " ReportFascicoloBean bean1 = new ReportFascicoloBean("- "
+ sdf.format(fineLavoriApp.getDataEffettuazione()) + StringPool.SPACE + stringaPlus); + sdf.format(fineLavoriApp.getDataEffettuazione()) + ' ' + stringaPlus);
listaDettBeans.add(bean1); listaDettBeans.add(bean1);
} }
} }
@ -1127,8 +1116,8 @@ public class ReportFascicoloUtil {
intPraticaId, collaudoId, stringa, QueryUtil.ALL_POS, QueryUtil.ALL_POS); intPraticaId, collaudoId, stringa, QueryUtil.ALL_POS, QueryUtil.ALL_POS);
if (docPraticas != null && !docPraticas.isEmpty()) { if (docPraticas != null && !docPraticas.isEmpty()) {
ReportFascicoloBean bean1 = new ReportFascicoloBean(stringa + " - " ReportFascicoloBean bean1 = new ReportFascicoloBean(stringa + " - "
+ LanguageUtil.get(locale, "label-documenti-tipologia-" + stringa) + StringPool.TAB + LanguageUtil.get(locale, "label-documenti-tipologia-" + stringa)
+ " - num. documenti presentati: " + docPraticas.size()); + "\t - num. documenti presentati: " + docPraticas.size());
listaAllegatiDomanda.add(bean1); listaAllegatiDomanda.add(bean1);
} }
} }
@ -1149,9 +1138,8 @@ public class ReportFascicoloUtil {
if (pagamenti != null) { if (pagamenti != null) {
for (Pagamento pagamento : pagamenti) { for (Pagamento pagamento : pagamenti) {
ReportFascicoloBean bean1 = new ReportFascicoloBean(" - Data Pagamento: " ReportFascicoloBean bean1 = new ReportFascicoloBean(" - Data Pagamento: "
+ sdf.format(pagamento.getModifiedDate()) + StringPool.TAB + sdf.format(pagamento.getModifiedDate())
+ " Mezzo di Pagamento: IRIS " + StringPool.TAB + " Importo Bolli: " + "\t Mezzo di Pagamento: IRIS \t Importo Bolli: " + pagamento.getImportoString());
+ pagamento.getImportoString());
pagamentiList.add(bean1); pagamentiList.add(bean1);
} }
} }
@ -1187,9 +1175,9 @@ public class ReportFascicoloUtil {
sb.append( sb.append(
(String) company.getExpandoBridge().getAttribute( (String) company.getExpandoBridge().getAttribute(
Constants.COMPANY_CUSTOM_FIELD_PROTOCOLLO_CODICE_INIZIALE_LABEL, false)) Constants.COMPANY_CUSTOM_FIELD_PROTOCOLLO_CODICE_INIZIALE_LABEL, false))
.append(StringPool.SLASH) .append('/')
.append(protocollo) .append(protocollo)
.append(StringPool.SLASH) .append('/')
.append((String) company.getExpandoBridge().getAttribute( .append((String) company.getExpandoBridge().getAttribute(
Constants.COMPANY_CUSTOM_FIELD_PROTOCOLLO_CODICE_SEGUENTE_LABEL, false)).append(" del "); Constants.COMPANY_CUSTOM_FIELD_PROTOCOLLO_CODICE_SEGUENTE_LABEL, false)).append(" del ");
if (dtProtocollo != null) if (dtProtocollo != null)

35
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/soggettipratica/view.jsp

@ -426,9 +426,8 @@ dataMap.put("id", PortletKeys.SOGGETTI + "_dialogEditSoggetto");
.findByIntPratica_CodiceFiscale(pratica.getIntPraticaId(), .findByIntPratica_CodiceFiscale(pratica.getIntPraticaId(),
firma.getCfFirmatario()); firma.getCfFirmatario());
if (soggetti.size() > 0) { if (soggetti.size() > 0) {
title.append("<li>").append(soggetti.get(0).getNome()) title.append("<li>").append(soggetti.get(0).getNome()).append(' ')
.append(StringPool.SPACE).append(soggetti.get(0).getCognome()) .append(soggetti.get(0).getCognome()).append("</li>");
.append("</li>");
} }
title.append("<li>").append(firma.getCfFirmatario()); title.append("<li>").append(firma.getCfFirmatario());
if (Validator.isNotNull(firma.getDtFirma())) { if (Validator.isNotNull(firma.getDtFirma())) {
@ -446,9 +445,8 @@ dataMap.put("id", PortletKeys.SOGGETTI + "_dialogEditSoggetto");
.findByIntPratica_CodiceFiscale(pratica.getIntPraticaId(), .findByIntPratica_CodiceFiscale(pratica.getIntPraticaId(),
firma.getCfFirmatario()); firma.getCfFirmatario());
if (soggetti.size() > 0) { if (soggetti.size() > 0) {
title.append("<li>").append(soggetti.get(0).getNome()) title.append("<li>").append(soggetti.get(0).getNome()).append(' ')
.append(StringPool.SPACE).append(soggetti.get(0).getCognome()) .append(soggetti.get(0).getCognome()).append("</li>");
.append("</li>");
} }
title.append("<li>").append(firma.getCfFirmatario()); title.append("<li>").append(firma.getCfFirmatario());
if (Validator.isNotNull(firma.getDtFirma())) { if (Validator.isNotNull(firma.getDtFirma())) {
@ -515,18 +513,19 @@ dataMap.put("id", PortletKeys.SOGGETTI + "_dialogEditSoggetto");
<% <%
User titolareUser = UserLocalServiceUtil.getUserById(intPratica.getUserId()); User titolareUser = UserLocalServiceUtil.getUserById(intPratica.getUserId());
%> %>
<aui:input type="hidden" useNamespace="false" name='<%= StringPool.UNDERLINE <aui:input type="hidden" useNamespace="false" name='<%= \'_\'
+ PortletKeys.FASCICOLOFE + "_codiceFiscaleDelegatoCommittente" %>' + PortletKeys.FASCICOLOFE
+ "_codiceFiscaleDelegatoCommittente" %>'
value='<%= titolareUser.getScreenName() %>' /> value='<%= titolareUser.getScreenName() %>' />
<c:if test="<%= !inBO %>"> <c:if test="<%= !inBO %>">
<aui:input disabled="<%= disabledInput || inBO %>" type="checkbox" <aui:input disabled="<%= disabledInput || inBO %>" type="checkbox"
name='<%= StringPool.UNDERLINE + PortletKeys.FASCICOLOFE name='<%= \'_\' + PortletKeys.FASCICOLOFE
+ "_codiceFiscaleDelegatoCommittenteEnabled" %>' + "_codiceFiscaleDelegatoCommittenteEnabled" %>'
checked="<%= Validator.isNotNull(dettPratica checked="<%= Validator.isNotNull(dettPratica
.getCodiceFiscaleDelegatoCommittente()) %>" .getCodiceFiscaleDelegatoCommittente()) %>"
label='<%= MessageFormat.format(LanguageUtil.get( label='<%= MessageFormat.format(LanguageUtil.get(
pageContext, "text-delega-committente"), pageContext, "text-delega-committente"),
user.getFirstName() + StringPool.SPACE + user.getMiddleName(), user.getFirstName(),
user.getLastName()) %>' user.getLastName()) %>'
inlineField="true" useNamespace="false" /> inlineField="true" useNamespace="false" />
</c:if> </c:if>
@ -542,7 +541,7 @@ dataMap.put("id", PortletKeys.SOGGETTI + "_dialogEditSoggetto");
%> %>
<c:if test="<%= Validator.isNotNull(titolare) %>"> <c:if test="<%= Validator.isNotNull(titolare) %>">
<aui:input disabled="<%= disabledInput || inBO %>" type="checkbox" <aui:input disabled="<%= disabledInput || inBO %>" type="checkbox"
name='<%= StringPool.UNDERLINE + PortletKeys.FASCICOLOFE name='<%= \'_\' + PortletKeys.FASCICOLOFE
+ "_codiceFiscaleDelegatoCommittenteEnabled" %>' + "_codiceFiscaleDelegatoCommittenteEnabled" %>'
checked="<%= Validator.isNotNull(dettPratica checked="<%= Validator.isNotNull(dettPratica
.getCodiceFiscaleDelegatoCommittente()) %>" .getCodiceFiscaleDelegatoCommittente()) %>"
@ -582,8 +581,8 @@ dataMap.put("id", PortletKeys.SOGGETTI + "_dialogEditSoggetto");
</div> </div>
</c:if> </c:if>
<c:if test="<%= !direttoriLavori.isEmpty() %>"> <c:if test="<%= !direttoriLavori.isEmpty() %>">
<aui:select label="Scegli Soggetto" name='<%= StringPool.UNDERLINE <aui:select label="Scegli Soggetto" name='<%= \'_\' + PortletKeys.FASCICOLOFE
+ PortletKeys.FASCICOLOFE + "_codiceFiscaleDelegatoFineLavori" %>' + "_codiceFiscaleDelegatoFineLavori" %>'
showEmptyOption="true" useNamespace="false" showEmptyOption="true" useNamespace="false"
disabled="<%= disabledInput || inBO %>"> disabled="<%= disabledInput || inBO %>">
<% <%
@ -594,7 +593,7 @@ dataMap.put("id", PortletKeys.SOGGETTI + "_dialogEditSoggetto");
} }
%> %>
<aui:option label='<%= direttoreLavori.getCodiceFiscale().toUpperCase() <aui:option label='<%= direttoreLavori.getCodiceFiscale().toUpperCase()
+ " - " + direttoreLavori.getNome() + StringPool.SPACE + " - " + direttoreLavori.getNome() + \' \'
+ direttoreLavori.getCognome() %>' + direttoreLavori.getCognome() %>'
value="<%= direttoreLavori.getCodiceFiscale() %>" value="<%= direttoreLavori.getCodiceFiscale() %>"
selected="<%= dettPratica.getCodiceFiscaleDelegatoFineLavori() selected="<%= dettPratica.getCodiceFiscaleDelegatoFineLavori()
@ -616,7 +615,7 @@ dataMap.put("id", PortletKeys.SOGGETTI + "_dialogEditSoggetto");
} }
%> %>
<aui:input disabled="<%= disabledInput || inBO %>" type="checkbox" <aui:input disabled="<%= disabledInput || inBO %>" type="checkbox"
name='<%= StringPool.UNDERLINE + PortletKeys.FASCICOLOFE name='<%= \'_\' + PortletKeys.FASCICOLOFE
+ "_codiceFiscaleDelegatoFineLavoriEnabled" %>' + "_codiceFiscaleDelegatoFineLavoriEnabled" %>'
checked="<%= enabledDelegatoFineLavori %>" checked="<%= enabledDelegatoFineLavori %>"
label='<%= MessageFormat.format(LanguageUtil.get(pageContext, label='<%= MessageFormat.format(LanguageUtil.get(pageContext,
@ -659,7 +658,7 @@ dataMap.put("id", PortletKeys.SOGGETTI + "_dialogEditSoggetto");
</div> </div>
</c:if> </c:if>
<c:if test="<%= !collaudatori.isEmpty() %>"> <c:if test="<%= !collaudatori.isEmpty() %>">
<aui:select label="Scegli Soggetto" name='<%= StringPool.UNDERLINE <aui:select label="Scegli Soggetto" name='<%= \'_\'
+ PortletKeys.FASCICOLOFE + "_codiceFiscaleDelegatoCollaudo" %>' + PortletKeys.FASCICOLOFE + "_codiceFiscaleDelegatoCollaudo" %>'
showEmptyOption="true" useNamespace="false" showEmptyOption="true" useNamespace="false"
disabled="<%= disabledInput || inBO %>"> disabled="<%= disabledInput || inBO %>">
@ -671,7 +670,7 @@ dataMap.put("id", PortletKeys.SOGGETTI + "_dialogEditSoggetto");
} }
%> %>
<aui:option label='<%= collaudatore.getCodiceFiscale().toUpperCase() + " - " <aui:option label='<%= collaudatore.getCodiceFiscale().toUpperCase() + " - "
+ collaudatore.getNome() + StringPool.SPACE + collaudatore.getNome() + \' \'
+ collaudatore.getCognome() %>' + collaudatore.getCognome() %>'
value="<%= collaudatore.getCodiceFiscale() %>" value="<%= collaudatore.getCodiceFiscale() %>"
selected="<%= dettPratica.getCodiceFiscaleDelegatoCollaudo() selected="<%= dettPratica.getCodiceFiscaleDelegatoCollaudo()
@ -693,7 +692,7 @@ dataMap.put("id", PortletKeys.SOGGETTI + "_dialogEditSoggetto");
} }
%> %>
<aui:input disabled="<%= disabledInput || inBO %>" type="checkbox" <aui:input disabled="<%= disabledInput || inBO %>" type="checkbox"
name='<%= StringPool.UNDERLINE + PortletKeys.FASCICOLOFE name='<%= \'_\' + PortletKeys.FASCICOLOFE
+ "_codiceFiscaleDelegatoCollaudoEnabled" %>' + "_codiceFiscaleDelegatoCollaudoEnabled" %>'
checked="<%= enabledDelegatoCollaudo %>" checked="<%= enabledDelegatoCollaudo %>"
label='<%= MessageFormat.format(LanguageUtil.get(pageContext, label='<%= MessageFormat.format(LanguageUtil.get(pageContext,

37
liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/mwg/sismica/bo/shared/util/IndexField.java

@ -0,0 +1,37 @@
package it.mwg.sismica.bo.shared.util;
import java.io.Serializable;
@SuppressWarnings("serial")
public class IndexField implements Serializable {
public static final String CODICE_PROVINCIA = "codiceProvincia";
public static final String COMMITTENTE = "committente";
public static final String COMUNE_ID = "comuneId";
public static final String CONTROLLO_PRATICA_ID = "controlloPraticaId";
public static final String DATA_ESITO = "dataEsito";
public static final String DATA_ESITO_A = "dataEsitoA";
public static final String DATA_ESITO_DA = "dataEsitoDa";
public static final String DATA_RICHIESTA = "dataRichiesta";
public static final String DATA_RICHIESTA_A = "dataRichiestaA";
public static final String DATA_RICHIESTA_DA = "dataRichiestaDa";
public static final String GEOLOGO_ID = "geologoId";
public static final String IN_COMPILAZIONE = "inCompilazione";
public static final String IN_LAVORAZIONE_SUE = "inLavorazioneSue";
public static final String INT_PRATICA_ID = "intPraticaId";
public static final String ISTRUTTORE = "istruttore";
public static final String ISTRUTTORE_ID = "istruttoreId";
public static final String NUMERO_PROGETTO = "numeroProgetto";
public static final String PARERI_FORNITI = "pareriForniti";
public static final String PRATICA_APERTA = "praticaAperta";
public static final String SOGGETTO = "soggetto";
public static final String STATO_PRATICA = "statoPratica";
public static final String STATUS = "status";
public static final String TASK = "task";
public static final String TASK_ASSIGNEE_ROLE_IDS = "taskAssigneeRoleIds";
public static final String TASK_ASSIGNEE_USER_ID = "taskAssigneeUserId";
public static final String TIPO_PROCEDURA = "tipoProcedura";
public static final String TITOLARE = "titolare";
public static final String UNITA_OPERATIVA = "unitaOperativa";
public static final String WORKFLOW_STATE = "workflowState";
}

70
liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/mwg/sismica/bo/shared/util/PortosIndexField.java

@ -1,70 +0,0 @@
package it.mwg.sismica.bo.shared.util;
import java.io.Serializable;
@SuppressWarnings("serial")
public class PortosIndexField implements Serializable {
public static final String INT_PRATICA_ID = "intPraticaId";
public static final String CONTROLLO_PRATICA_ID = "controlloPraticaId";
public static final String DETT_PRATICA_ID = "dettPraticaId";
public static final String NUMERO_PROGETTO = "numeroProgetto";
public static final String PROTOCOLLO = "protocollo";
public static final String TIPO_PRATICA = "tipoPratica";
public static final String DETT_PRATICA = "dettPratica";
public static final String STATO_PRATICA = "statoPratica";
public static final String DESC_INTERVENTO = "descIntervento";
public static final String COMMITTENTE = "committente";
public static final String COMMITTENTI = "committenti";
public static final String DIRETTORE_LAVORI = "direttoreLavori";
public static final String COLLAUDATORI = "collaudatori";
public static final String DATA_RICHIESTA = "dataRichiesta";
public static final String DT_PRATICA = "dtPratica";
public static final String DATA_RICHIESTA_DA = "dataRichiestaDa";
public static final String DATA_RICHIESTA_AL = "dataRichiestaAl";
public static final String STATUS = "status";
public static final String STATUS_SOSPESA = "sospesa";
public static final String PRATICA_APERTA = "praticaAperta";
public static final String STATUS_BY_USERID = "statusByUserId";
public static final String STATUS_BY_USERNAME = "statusByUsername";
public static final String STATUS_DATE = "statusDate";
public static final String SOGGETTI_INTERCONNESSI = "soggettiInterconnessi";
public static final String SOGGETTI_INTERESSATI = "soggettiInteressati";
public static final String SOTTOPOSTO_A_PARERE = "sottopostoAParere";
public static final String FINE_LAVORI_COMPLETATI = "fineLavoriCompletati";
public static final String COLLAUDO_COMPLETATO = "collaudoCompletato";
public static final String FINE_LAVORI_PARZIALI = "fineLavoriParziali";
public static final String VARIATA = "variata";
public static final String VIDIMATA = "vidimata";
public static final String COLLAUDO_PARZIALE = "collaudoParziale";
public static final String ISTRUTTORE_USER_ID = "istruttoreUserId";
public static final String ISTRUTTORE_FULL_NAME = "istruttoreFullName";
public static final String PROPRIETARIO_DIGITALE_FULL_NAME = "proprietarioDigitaleFullName";
public static final String ISTRUTTORE_USERNAME = "istruttoreUsername";
public static final String PARERE_GEOLOGO = "parereGeologo";
public static final String GEOLOGI = "geologi";
public static final String COMUNE_ID = "comuneId";
public static final String COMUNE_DENOMINAZIONE = "comuneDenominazione";
public static final String PROVINCIA_ID = "provinciaId";
public static final String PROVINCIA_CODICE = "codiceProvincia";
public static final String PROVINCIA_NAME = "nomeProvincia";
public static final String DATA_INIZIO_PROCEDIMENTO = "dataInizioProcedimento";
public static final String TASK_ASSIGNEE_USER_ID = "taskAssigneeUserId";
public static final String TASK_ASSIGNEE_ROLE_IDS = "taskAssigneeRoleIds";
public static final String WORKFLOW_DEFINITION_NAME = "workflowDefinitionName";
public static final String WORKFLOW_DEFINITION_VERSION = "workflowDefinitionVersion";
public static final String TASK_NAME = "taskName";
public static final String WORKFLOW_STATE = "workflowState";
public static final String NUOVA_COSTRUZIONE = "nuovaCostruzione";
public static final String ADEGUAMENTO_SISMICO = "adeguamentoSismico";
public static final String MIGLIORAMENTO_SISMICO = "miglioramentoSismico";
public static final String RIPARAZIONE_INTERVENTO_LOCALE = "riparazioneInterventoLocale";
public static final String INDIRIZZO = "indirizzo";
public static final String LOCALITA = "localita";
public static final String PROVINCIA = "provincia";
public static final String COMUNE = "comune";
public static final String TIPO_PROCEDURA = "tipoProcedura";
public static final String UNITA_OPERATIVA = "unitaOperativa";
public static final String IN_LAVORAZIONE_SUE = "inLavorazioneSue";
public static final String ASSEGNATA_AD_ISTRUTTORE = "assegnataAdIstruttore";
}

6
liferay-plugins-sdk-6.2/shared/portos-firma-shared/src/it/tref/firma/shared/RestFile.java

@ -30,13 +30,13 @@ public class RestFile implements Serializable {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
if (idFile != null) { if (idFile != null) {
sb.append("Id = ").append(idFile).append(StringPool.SPACE); sb.append("Id = ").append(idFile).append(' ');
} }
if (documentiType != null) { if (documentiType != null) {
sb.append("Documenti type = ").append(documentiType).append(StringPool.SPACE); sb.append("Documenti type = ").append(documentiType).append(' ');
} }
if (tipoPratica != null) { if (tipoPratica != null) {
sb.append("Tipo pratica= ").append(tipoPratica).append(StringPool.SPACE); sb.append("Tipo pratica= ").append(tipoPratica).append(' ');
} }
return sb.toString(); return sb.toString();
} }

5
liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/hook/struts/EditWorkflowTaskAction.java

@ -409,13 +409,16 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
long intPraticaId = controllo.getIntPraticaId(); long intPraticaId = controllo.getIntPraticaId();
boolean canRegistraEsito = true; boolean canRegistraEsito = true;
for (ParereGeologo parere : ParereGeologoLocalServiceUtil.findByIntPraticaId(intPraticaId, QueryUtil.ALL_POS, QueryUtil.ALL_POS)) { for (ParereGeologo parere : ParereGeologoLocalServiceUtil.findByIntPraticaId(intPraticaId, QueryUtil.ALL_POS,
QueryUtil.ALL_POS)) {
if (Validator.isNull(parere.getDtCompilazione()) && Validator.isNull(parere.getDtAnnullamento())) { if (Validator.isNull(parere.getDtCompilazione()) && Validator.isNull(parere.getDtAnnullamento())) {
canRegistraEsito = false; canRegistraEsito = false;
break; break;
} }
} }
renderRequest.setAttribute("canRegistraEsito", canRegistraEsito); renderRequest.setAttribute("canRegistraEsito", canRegistraEsito);
_log.info("canPortosAssegnatore = " + canPortosAssegnatore + ", canRemoveUO = " + canRemoveUO
+ ", canRegistraEsito = " + canRegistraEsito);
return originalStrutsPortletAction.render(originalStrutsPortletAction, portletConfig, renderRequest, return originalStrutsPortletAction.render(originalStrutsPortletAction, portletConfig, renderRequest,
renderResponse); renderResponse);
} }

Caricamento…
Annulla
Salva