Confronta commit

...

7 Commit

  1. 2
      .gitignore
  2. 75
      liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/WEB-INF/service.xml
  3. 26
      liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/accesso/atti/NoSuchRichiestaAccessoAttiException.java
  4. 8
      liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/accesso/atti/service/RichiestaAccessoAttiLocalService.java
  5. 16
      liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/accesso/atti/service/RichiestaAccessoAttiLocalServiceClp.java
  6. 8
      liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/accesso/atti/service/RichiestaAccessoAttiLocalServiceUtil.java
  7. 8
      liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/accesso/atti/service/RichiestaAccessoAttiLocalServiceWrapper.java
  8. 37
      liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/accesso/atti/model/impl/RichiestaAccessoAttiImpl.java
  9. 395
      liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/accesso/atti/portlet/AccessoAttiBOPortlet.java
  10. 338
      liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/accesso/atti/portlet/AccessoAttiFEPortlet.java
  11. 48
      liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/accesso/atti/portlet/CreazioneAccountPortosPortlet.java
  12. 22
      liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/accesso/atti/service/base/RichiestaAccessoAttiLocalServiceClpInvoker.java
  13. 257
      liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/accesso/atti/service/impl/RichiestaAccessoAttiLocalServiceImpl.java
  14. 37
      liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/accesso/atti/service/impl/RichiestaAccessoAttiServiceImpl.java
  15. 32
      liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/accesso/atti/uti/AccessoAttiAccessTokenUtil.java
  16. 57
      liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/accesso/atti/uti/DocumentLibraryUtil.java
  17. 142
      liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/accesso/atti/uti/EmailSenderUtil.java
  18. 246
      liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_bo/add_richiesta.jsp
  19. 478
      liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_fe/visualizza-atto.jsp
  20. 4
      liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/WEB-INF/liferay-display.xml
  21. 4
      liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/WEB-INF/liferay-hook.xml
  22. 109
      liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/WEB-INF/service.xml
  23. 1
      liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/common/details_column.jsp
  24. 1
      liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/common/relations_column.jsp
  25. 1
      liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/detail/detail.jsp
  26. 1
      liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/detail/view.jsp
  27. 1
      liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/detail/view_list.jsp
  28. 1
      liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/init.jsp
  29. 1
      liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/storicizzazione/edit.jsp
  30. 1
      liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/storicizzazione/view.jsp
  31. 28
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/liferay-display.xml
  32. 2
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/liferay-hook.xml
  33. 2058
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service.xml
  34. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/search/IntPraticaSearch.java
  35. 120
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service.xml
  36. 21
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/DuplicateFunzionarioException.java
  37. 21
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/DuplicatePrenotazioneException.java
  38. 21
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/DuplicateProfessionistaException.java
  39. 21
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/NoSuchDisponibilitaException.java
  40. 21
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/NoSuchFunzionarioException.java
  41. 21
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/NoSuchPrenotazioneException.java
  42. 21
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/NoSuchProfessionistaException.java
  43. 21
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/SlotNotAvailableException.java
  44. 38
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/model/impl/DisponibilitaImpl.java
  45. 48
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/model/impl/FunzionarioImpl.java
  46. 57
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/model/impl/PrenotazioneImpl.java
  47. 38
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/model/impl/ProfessionistaImpl.java
  48. 558
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/DisponibilitaLocalServiceImpl.java
  49. 146
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/DisponibilitaServiceImpl.java
  50. 133
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/FunzionarioLocalServiceImpl.java
  51. 174
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/FunzionarioServiceImpl.java
  52. 314
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/PrenotazioneLocalServiceImpl.java
  53. 146
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/PrenotazioneServiceImpl.java
  54. 37
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/ProfessionistaLocalServiceImpl.java
  55. 34
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/ProfessionistaServiceImpl.java
  56. 244
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/util/CalendarUtil.java
  57. 1
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/init.jsp
  58. 1
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/tabs/amministrazione.jsp
  59. 1
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/tabs/calendar.jsp
  60. 33
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/tabs/gestione_disponibilita.jsp
  61. 1
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/tabs/gestione_disponibilita_action.jsp
  62. 1
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/view.jsp
  63. 1
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/init.jsp
  64. 8
      liferay-plugins-sdk-6.2/portlets/portos-company-configuration-portlet/docroot/WEB-INF/liferay-portlet.xml
  65. 18
      liferay-plugins-sdk-6.2/portlets/portos-company-configuration-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/companyconfig/portlet/CompanyConfigurationPortlet.java
  66. 1
      liferay-plugins-sdk-6.2/portlets/portos-company-configuration-portlet/docroot/html/company_configuration/init.jsp
  67. 29
      liferay-plugins-sdk-6.2/portlets/portos-company-configuration-portlet/docroot/html/company_configuration/view.jsp
  68. 1
      liferay-plugins-sdk-6.2/portlets/portos-company-configuration-portlet/docroot/html/init.jsp
  69. 163
      liferay-plugins-sdk-6.2/portlets/portos-cookies-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/cookies/action/StartUpAction.java
  70. 1
      liferay-plugins-sdk-6.2/portlets/portos-cookies-portlet/docroot/init.jsp
  71. 1
      liferay-plugins-sdk-6.2/portlets/portos-cookies-portlet/docroot/view.jsp
  72. 5
      liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/portlet.xml
  73. 128
      liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/action/DeployAction.java
  74. 9
      liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/constants/MailConstants.java
  75. 23
      liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/control/DeployAlertControl.java
  76. 100
      liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/portlet/NotificatorPortlet.java
  77. 86
      liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/service/impl/NotificationLogLocalServiceImpl.java
  78. 227
      liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/service/impl/NotificationMailLocalServiceImpl.java
  79. 1
      liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/service/persistence/NotificationLogPersistenceImpl.java
  80. 1
      liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/service/persistence/NotificationMailPersistenceImpl.java
  81. 157
      liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/util/DeployAlertUtil.java
  82. 1
      liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/html/init.jsp
  83. 1
      liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/html/notificator/edit_notification.jsp
  84. 1
      liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/html/notificator/init.jsp
  85. 1
      liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/html/notificator/view.jsp
  86. 2
      liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/liferay-hook.xml
  87. 10
      liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/liferay-portlet.xml
  88. 38
      liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/controller/model/impl/KaleoInstanceImpl.java
  89. 38
      liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/controller/model/impl/KaleoNodeImpl.java
  90. 42
      liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/controller/model/impl/KaleoTaskAssignmentInstanceImpl.java
  91. 38
      liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/controller/model/impl/KaleoTaskImpl.java
  92. 39
      liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/controller/model/impl/KaleoTaskInstanceTokenImpl.java
  93. 3
      liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/controller/service/persistence/KaleoInstancePersistenceImpl.java
  94. 3
      liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/controller/service/persistence/KaleoInstanceTokenPersistenceImpl.java
  95. 3
      liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/controller/service/persistence/KaleoLogPersistenceImpl.java
  96. 3
      liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/controller/service/persistence/KaleoNodePersistenceImpl.java
  97. 3
      liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/controller/service/persistence/KaleoTaskAssignmentInstancePersistenceImpl.java
  98. 3
      liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/controller/service/persistence/KaleoTaskInstanceTokenPersistenceImpl.java
  99. 3
      liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/controller/service/persistence/KaleoTaskPersistenceImpl.java
  100. 2
      liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/WEB-INF/liferay-hook.xml
  101. Some files were not shown because too many files have changed in this diff Show More

2
.gitignore vendored

@ -10,3 +10,5 @@ portos-*.jar
**/build/ **/build/
.DS_Store .DS_Store
._* ._*
liferay-plugins-sdk-6.2/.idea/
*.iml

75
liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/WEB-INF/service.xml

@ -1,59 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0"?>
<!DOCTYPE service-builder PUBLIC "-//Liferay//DTD Service Builder 6.1.0//EN" "http://www.liferay.com/dtd/liferay-service-builder_6_1_0.dtd"> <!DOCTYPE service-builder PUBLIC "-//Liferay//DTD Service Builder 6.1.0//EN" "http://www.liferay.com/dtd/liferay-service-builder_6_1_0.dtd">
<service-builder package-path="it.tref.liferay.portos.accesso.atti"> <service-builder package-path="it.tref.liferay.portos.accesso.atti">
<author>3F Consulting + Manifattura Web Group s.r.l.</author> <author>3F Consulting</author>
<namespace>portos_atti</namespace> <namespace>portos_atti</namespace>
<entity name="RichiestaAccessoAtti" local-service="true" remote-service="true"> <entity name="RichiestaAccessoAtti" local-service="true" remote-service="true">
<!-- PK fields --> <!-- PK fields -->
<column name="richiestaAccessoAttiId" type="long" primary="true" /> <column name="richiestaAccessoAttiId" type="long" primary="true"></column>
<!-- Audit fields --> <!-- Audit fields -->
<column name="companyId" type="long" /> <column name="companyId" type="long"></column>
<column name="userId" type="long" /> <column name="userId" type="long"></column>
<column name="userName" type="String" /> <column name="userName" type="String"></column>
<column name="createDate" type="Date" /> <column name="createDate" type="Date"></column>
<column name="modifiedDate" type="Date" /> <column name="modifiedDate" type="Date"></column>
<column name="groupId" type="long" /> <column name="groupId" type="long"></column>
<!-- Other fields --> <!-- Other fields -->
<column name="intPraticaId" type="long" /> <column name="intPraticaId" type="long"></column>
<column name="territorioId" type="long" /> <column name="territorioId" type="long"></column>
<column name="numeroProgetto" type="String" /> <column name="numeroProgetto" type="String"></column>
<column name="emailRicontatto" type="String" /> <column name="emailRicontatto" type="String"></column>
<column name="dtVidimazione" type="Date" /> <column name="dtVidimazione" type="Date"></column>
<column name="sanatoria" type="boolean" /> <column name="sanatoria" type="boolean"></column>
<column name="dtSanatoria" type="Date" /> <column name="dtSanatoria" type="Date"></column>
<column name="tipologiaPersona" type="String" /> <column name="tipologiaPersona" type="String"></column>
<column name="tipologiaRichiesta" type="String" /> <column name="tipologiaRichiesta" type="String"></column>
<column name="tipologiaRichiestaDettaglio" type="String" /> <column name="tipologiaRichiestaDettaglio" type="String"></column>
<column name="motivazioneRichiesta" type="String" /> <column name="motivazioneRichiesta" type="String"></column>
<column name="fileEntryIdPagamento" type="long" /> <column name="fileEntryIdPagamento" type="long"></column>
<column name="fileEntryIdDocumentoIdentita" type="long" /> <column name="fileEntryIdDocumentoIdentita" type="long"></column>
<column name="accettata" type="boolean" /> <column name="accettata" type="boolean"></column>
<column name="dtAccettazione" type="Date" /> <column name="dtAccettazione" type="Date"></column>
<column name="gestita" type="boolean" /> <column name="gestita" type="boolean"></column>
<column name="accessToken" type="String" /> <column name="accessToken" type="String"></column>
<column name="protocolloEntrata" type="String" /> <column name="protocolloEntrata" type="String"></column>
<column name="protocolloUscita" type="String" /> <column name="protocolloUscita" type="String"></column>
<column name="funzionarioId" type="long" /> <column name="funzionarioId" type="long"></column>
<!-- Order --> <!-- Order -->
<order by="asc"> <order by="asc">
<order-column name="gestita" /> <order-column name="gestita"></order-column>
</order> </order>
<!-- Finder --> <!-- Finder -->
<finder name="NumeroProgetto" return-type="Collection"> <finder name="NumeroProgetto" return-type="Collection">
<finder-column name="numeroProgetto" /> <finder-column name="numeroProgetto"></finder-column>
</finder> </finder>
<finder name="Gestita" return-type="Collection"> <finder name="Gestita" return-type="Collection">
<finder-column name="gestita" /> <finder-column name="gestita"></finder-column>
</finder> </finder>
</entity> </entity>
</service-builder> </service-builder>

26
liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/accesso/atti/NoSuchRichiestaAccessoAttiException.java

@ -1,9 +1,15 @@
/** /**
* Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. This library is free software; you can redistribute it * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
* and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software *
* Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in * This library is free software; you can redistribute it and/or modify it under
* the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * the terms of the GNU Lesser General Public License as published by the Free
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. * Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/ */
package it.tref.liferay.portos.accesso.atti; package it.tref.liferay.portos.accesso.atti;
@ -11,28 +17,24 @@ package it.tref.liferay.portos.accesso.atti;
import com.liferay.portal.NoSuchModelException; import com.liferay.portal.NoSuchModelException;
/** /**
* @author 3F Consulting + Manifattura Web Group s.r.l. * @author 3F Consulting
*/ */
@SuppressWarnings("serial")
public class NoSuchRichiestaAccessoAttiException extends NoSuchModelException { public class NoSuchRichiestaAccessoAttiException extends NoSuchModelException {
public NoSuchRichiestaAccessoAttiException() { public NoSuchRichiestaAccessoAttiException() {
super(); super();
} }
public NoSuchRichiestaAccessoAttiException(String msg) { public NoSuchRichiestaAccessoAttiException(String msg) {
super(msg); super(msg);
} }
public NoSuchRichiestaAccessoAttiException(String msg, Throwable cause) { public NoSuchRichiestaAccessoAttiException(String msg, Throwable cause) {
super(msg, cause); super(msg, cause);
} }
public NoSuchRichiestaAccessoAttiException(Throwable cause) { public NoSuchRichiestaAccessoAttiException(Throwable cause) {
super(cause); super(cause);
} }
}
}

8
liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/accesso/atti/service/RichiestaAccessoAttiLocalService.java

@ -30,7 +30,7 @@ import com.liferay.portal.service.PersistedModelLocalService;
* credentials because this service can only be accessed from within the same * credentials because this service can only be accessed from within the same
* VM. * VM.
* *
* @author 3F Consulting + Manifattura Web Group s.r.l. * @author 3F Consulting
* @see RichiestaAccessoAttiLocalServiceUtil * @see RichiestaAccessoAttiLocalServiceUtil
* @see it.tref.liferay.portos.accesso.atti.service.base.RichiestaAccessoAttiLocalServiceBaseImpl * @see it.tref.liferay.portos.accesso.atti.service.base.RichiestaAccessoAttiLocalServiceBaseImpl
* @see it.tref.liferay.portos.accesso.atti.service.impl.RichiestaAccessoAttiLocalServiceImpl * @see it.tref.liferay.portos.accesso.atti.service.impl.RichiestaAccessoAttiLocalServiceImpl
@ -261,12 +261,14 @@ public interface RichiestaAccessoAttiLocalService extends BaseLocalService,
public java.util.List<it.tref.liferay.portos.accesso.atti.model.RichiestaAccessoAtti> findCompletate( public java.util.List<it.tref.liferay.portos.accesso.atti.model.RichiestaAccessoAtti> findCompletate(
java.lang.String numeroProgetto, java.lang.String protocollo, java.lang.String numeroProgetto, java.lang.String protocollo,
java.lang.String dataDal, java.lang.String dataAl, int start, int end) java.lang.String dataDal, java.lang.String dataAl, int start, int end)
throws com.liferay.portal.kernel.exception.SystemException; throws com.liferay.portal.kernel.exception.SystemException,
java.text.ParseException;
public int countCompletate(java.lang.String numeroProgetto, public int countCompletate(java.lang.String numeroProgetto,
java.lang.String protocollo, java.lang.String dataDal, java.lang.String protocollo, java.lang.String dataDal,
java.lang.String dataAl) java.lang.String dataAl)
throws com.liferay.portal.kernel.exception.SystemException; throws com.liferay.portal.kernel.exception.SystemException,
java.text.ParseException;
public it.tref.liferay.portos.accesso.atti.model.RichiestaAccessoAtti findByAccessToken( public it.tref.liferay.portos.accesso.atti.model.RichiestaAccessoAtti findByAccessToken(
java.lang.String accessToken) java.lang.String accessToken)

16
liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/accesso/atti/service/RichiestaAccessoAttiLocalServiceClp.java

@ -17,7 +17,7 @@ package it.tref.liferay.portos.accesso.atti.service;
import com.liferay.portal.service.InvokableLocalService; import com.liferay.portal.service.InvokableLocalService;
/** /**
* @author 3F Consulting + Manifattura Web Group s.r.l. * @author 3F Consulting
* @generated * @generated
*/ */
public class RichiestaAccessoAttiLocalServiceClp public class RichiestaAccessoAttiLocalServiceClp
@ -737,7 +737,8 @@ public class RichiestaAccessoAttiLocalServiceClp
public java.util.List<it.tref.liferay.portos.accesso.atti.model.RichiestaAccessoAtti> findCompletate( public java.util.List<it.tref.liferay.portos.accesso.atti.model.RichiestaAccessoAtti> findCompletate(
java.lang.String numeroProgetto, java.lang.String protocollo, java.lang.String numeroProgetto, java.lang.String protocollo,
java.lang.String dataDal, java.lang.String dataAl, int start, int end) java.lang.String dataDal, java.lang.String dataAl, int start, int end)
throws com.liferay.portal.kernel.exception.SystemException { throws com.liferay.portal.kernel.exception.SystemException,
java.text.ParseException {
Object returnObj = null; Object returnObj = null;
try { try {
@ -764,6 +765,10 @@ public class RichiestaAccessoAttiLocalServiceClp
throw (com.liferay.portal.kernel.exception.SystemException)t; throw (com.liferay.portal.kernel.exception.SystemException)t;
} }
if (t instanceof java.text.ParseException) {
throw (java.text.ParseException)t;
}
if (t instanceof RuntimeException) { if (t instanceof RuntimeException) {
throw (RuntimeException)t; throw (RuntimeException)t;
} }
@ -780,7 +785,8 @@ public class RichiestaAccessoAttiLocalServiceClp
public int countCompletate(java.lang.String numeroProgetto, public int countCompletate(java.lang.String numeroProgetto,
java.lang.String protocollo, java.lang.String dataDal, java.lang.String protocollo, java.lang.String dataDal,
java.lang.String dataAl) java.lang.String dataAl)
throws com.liferay.portal.kernel.exception.SystemException { throws com.liferay.portal.kernel.exception.SystemException,
java.text.ParseException {
Object returnObj = null; Object returnObj = null;
try { try {
@ -803,6 +809,10 @@ public class RichiestaAccessoAttiLocalServiceClp
throw (com.liferay.portal.kernel.exception.SystemException)t; throw (com.liferay.portal.kernel.exception.SystemException)t;
} }
if (t instanceof java.text.ParseException) {
throw (java.text.ParseException)t;
}
if (t instanceof RuntimeException) { if (t instanceof RuntimeException) {
throw (RuntimeException)t; throw (RuntimeException)t;
} }

8
liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/accesso/atti/service/RichiestaAccessoAttiLocalServiceUtil.java

@ -26,7 +26,7 @@ import com.liferay.portal.service.InvokableLocalService;
* based on the propagated JAAS credentials because this service can only be * based on the propagated JAAS credentials because this service can only be
* accessed from within the same VM. * accessed from within the same VM.
* *
* @author 3F Consulting + Manifattura Web Group s.r.l. * @author 3F Consulting
* @see RichiestaAccessoAttiLocalService * @see RichiestaAccessoAttiLocalService
* @see it.tref.liferay.portos.accesso.atti.service.base.RichiestaAccessoAttiLocalServiceBaseImpl * @see it.tref.liferay.portos.accesso.atti.service.base.RichiestaAccessoAttiLocalServiceBaseImpl
* @see it.tref.liferay.portos.accesso.atti.service.impl.RichiestaAccessoAttiLocalServiceImpl * @see it.tref.liferay.portos.accesso.atti.service.impl.RichiestaAccessoAttiLocalServiceImpl
@ -284,7 +284,8 @@ public class RichiestaAccessoAttiLocalServiceUtil {
public static java.util.List<it.tref.liferay.portos.accesso.atti.model.RichiestaAccessoAtti> findCompletate( public static java.util.List<it.tref.liferay.portos.accesso.atti.model.RichiestaAccessoAtti> findCompletate(
java.lang.String numeroProgetto, java.lang.String protocollo, java.lang.String numeroProgetto, java.lang.String protocollo,
java.lang.String dataDal, java.lang.String dataAl, int start, int end) java.lang.String dataDal, java.lang.String dataAl, int start, int end)
throws com.liferay.portal.kernel.exception.SystemException { throws com.liferay.portal.kernel.exception.SystemException,
java.text.ParseException {
return getService() return getService()
.findCompletate(numeroProgetto, protocollo, dataDal, dataAl, .findCompletate(numeroProgetto, protocollo, dataDal, dataAl,
start, end); start, end);
@ -293,7 +294,8 @@ public class RichiestaAccessoAttiLocalServiceUtil {
public static int countCompletate(java.lang.String numeroProgetto, public static int countCompletate(java.lang.String numeroProgetto,
java.lang.String protocollo, java.lang.String dataDal, java.lang.String protocollo, java.lang.String dataDal,
java.lang.String dataAl) java.lang.String dataAl)
throws com.liferay.portal.kernel.exception.SystemException { throws com.liferay.portal.kernel.exception.SystemException,
java.text.ParseException {
return getService() return getService()
.countCompletate(numeroProgetto, protocollo, dataDal, dataAl); .countCompletate(numeroProgetto, protocollo, dataDal, dataAl);
} }

8
liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/accesso/atti/service/RichiestaAccessoAttiLocalServiceWrapper.java

@ -19,7 +19,7 @@ import com.liferay.portal.service.ServiceWrapper;
/** /**
* Provides a wrapper for {@link RichiestaAccessoAttiLocalService}. * Provides a wrapper for {@link RichiestaAccessoAttiLocalService}.
* *
* @author 3F Consulting + Manifattura Web Group s.r.l. * @author 3F Consulting
* @see RichiestaAccessoAttiLocalService * @see RichiestaAccessoAttiLocalService
* @generated * @generated
*/ */
@ -302,7 +302,8 @@ public class RichiestaAccessoAttiLocalServiceWrapper
public java.util.List<it.tref.liferay.portos.accesso.atti.model.RichiestaAccessoAtti> findCompletate( public java.util.List<it.tref.liferay.portos.accesso.atti.model.RichiestaAccessoAtti> findCompletate(
java.lang.String numeroProgetto, java.lang.String protocollo, java.lang.String numeroProgetto, java.lang.String protocollo,
java.lang.String dataDal, java.lang.String dataAl, int start, int end) java.lang.String dataDal, java.lang.String dataAl, int start, int end)
throws com.liferay.portal.kernel.exception.SystemException { throws com.liferay.portal.kernel.exception.SystemException,
java.text.ParseException {
return _richiestaAccessoAttiLocalService.findCompletate(numeroProgetto, return _richiestaAccessoAttiLocalService.findCompletate(numeroProgetto,
protocollo, dataDal, dataAl, start, end); protocollo, dataDal, dataAl, start, end);
} }
@ -311,7 +312,8 @@ public class RichiestaAccessoAttiLocalServiceWrapper
public int countCompletate(java.lang.String numeroProgetto, public int countCompletate(java.lang.String numeroProgetto,
java.lang.String protocollo, java.lang.String dataDal, java.lang.String protocollo, java.lang.String dataDal,
java.lang.String dataAl) java.lang.String dataAl)
throws com.liferay.portal.kernel.exception.SystemException { throws com.liferay.portal.kernel.exception.SystemException,
java.text.ParseException {
return _richiestaAccessoAttiLocalService.countCompletate(numeroProgetto, return _richiestaAccessoAttiLocalService.countCompletate(numeroProgetto,
protocollo, dataDal, dataAl); protocollo, dataDal, dataAl);
} }

37
liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/accesso/atti/model/impl/RichiestaAccessoAttiImpl.java

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

395
liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/accesso/atti/portlet/AccessoAttiBOPortlet.java

@ -52,66 +52,89 @@ import com.liferay.portal.theme.ThemeDisplay;
import com.liferay.portal.util.PortalUtil; import com.liferay.portal.util.PortalUtil;
import com.liferay.util.bridges.mvc.MVCPortlet; import com.liferay.util.bridges.mvc.MVCPortlet;
/**
* Portlet implementation class AccessoAttiBOPortlet
*/
public class AccessoAttiBOPortlet extends MVCPortlet { public class AccessoAttiBOPortlet extends MVCPortlet {
public static final Log _log = LogFactoryUtil.getLog(AccessoAttiBOPortlet.class); public static final Log _log = LogFactoryUtil.getLog(AccessoAttiBOPortlet.class);
public void accettaRichiesta(ActionRequest actionRequest, ActionResponse actionResponse) throws SystemException, public void accettaRichiesta(ActionRequest actionRequest, ActionResponse actionResponse) throws SystemException, AddressException{
AddressException {
ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
long richiestaAccessoAttiId = ParamUtil.getLong(actionRequest, "richiestaAccessoAttiId"); long richiestaAccessoAttiId = ParamUtil.getLong(actionRequest, "richiestaAccessoAttiId");
String testoEmail = ParamUtil.getString(actionRequest, "testoEmail"); String testoEmail = ParamUtil.getString(actionRequest, "testoEmail");
RichiestaAccessoAtti richiestaAccessoAtti = RichiestaAccessoAttiLocalServiceUtil
.fetchRichiestaAccessoAtti(richiestaAccessoAttiId); RichiestaAccessoAtti richiestaAccessoAtti =
if (richiestaAccessoAtti != null) { RichiestaAccessoAttiLocalServiceUtil.fetchRichiestaAccessoAtti(richiestaAccessoAttiId);
String accessToken = AccessoAttiAccessTokenUtil.generateAccessToken(richiestaAccessoAttiId, if(richiestaAccessoAtti != null){
String accessToken = AccessoAttiAccessTokenUtil.generateAccessToken(richiestaAccessoAttiId,
richiestaAccessoAtti.getNumeroProgetto(), richiestaAccessoAtti.getUserId()); richiestaAccessoAtti.getNumeroProgetto(), richiestaAccessoAtti.getUserId());
richiestaAccessoAtti.setFunzionarioId(themeDisplay.getUserId()); richiestaAccessoAtti.setFunzionarioId(themeDisplay.getUserId());
richiestaAccessoAtti.setGestita(true); richiestaAccessoAtti.setGestita(true);
richiestaAccessoAtti.setAccettata(true); richiestaAccessoAtti.setAccettata(true);
richiestaAccessoAtti.setDtAccettazione(new Date()); richiestaAccessoAtti.setDtAccettazione(new Date());
richiestaAccessoAtti.setAccessToken(accessToken); richiestaAccessoAtti.setAccessToken(accessToken);
RichiestaAccessoAttiLocalServiceUtil.updateRichiestaAccessoAtti(richiestaAccessoAtti); RichiestaAccessoAttiLocalServiceUtil.updateRichiestaAccessoAtti(richiestaAccessoAtti);
try { try {
String protocollo = ProtocolloUtil.protocollaArrivoAccessoAtti(richiestaAccessoAtti.getGroupId(), String protocollo = ProtocolloUtil.protocollaArrivoAccessoAtti(richiestaAccessoAtti.getGroupId(),
richiestaAccessoAtti.getCompanyId(), richiestaAccessoAtti.getUserName(), richiestaAccessoAtti.getCompanyId(), richiestaAccessoAtti.getUserName(),
richiestaAccessoAtti.getRichiestaAccessoAttiId(), RichiestaAccessoAtti.class.getName()); richiestaAccessoAtti.getRichiestaAccessoAttiId(), RichiestaAccessoAtti.class.getName());
richiestaAccessoAtti.setProtocolloUscita(protocollo); richiestaAccessoAtti.setProtocolloUscita(protocollo);
RichiestaAccessoAttiLocalServiceUtil.updateRichiestaAccessoAtti(richiestaAccessoAtti); RichiestaAccessoAttiLocalServiceUtil.updateRichiestaAccessoAtti(richiestaAccessoAtti);
} catch (Exception e) { } catch (Exception e) {
_log.error(e); _log.error(e);
} }
EmailSenderUtil.sendAcceptedEmail(richiestaAccessoAttiId, testoEmail); EmailSenderUtil.sendAcceptedEmail(richiestaAccessoAttiId, testoEmail);
} }
} }
public void rifiutaRichiesta(ActionRequest actionRequest, ActionResponse actionResponse) throws SystemException, public void rifiutaRichiesta(ActionRequest actionRequest, ActionResponse actionResponse) throws SystemException, AddressException{
AddressException {
ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
long richiestaAccessoAttiId = ParamUtil.getLong(actionRequest, "richiestaAccessoAttiId"); long richiestaAccessoAttiId = ParamUtil.getLong(actionRequest, "richiestaAccessoAttiId");
String motivoRifiuto = ParamUtil.getString(actionRequest, "motivoRifiuto"); String motivoRifiuto = ParamUtil.getString(actionRequest, "motivoRifiuto");
RichiestaAccessoAtti richiestaAccessoAtti = RichiestaAccessoAttiLocalServiceUtil
.fetchRichiestaAccessoAtti(richiestaAccessoAttiId);
if (richiestaAccessoAtti != null) { RichiestaAccessoAtti richiestaAccessoAtti =
RichiestaAccessoAttiLocalServiceUtil.fetchRichiestaAccessoAtti(richiestaAccessoAttiId);
if(richiestaAccessoAtti != null){
richiestaAccessoAtti.setFunzionarioId(themeDisplay.getUserId()); richiestaAccessoAtti.setFunzionarioId(themeDisplay.getUserId());
richiestaAccessoAtti.setGestita(true); richiestaAccessoAtti.setGestita(true);
richiestaAccessoAtti.setAccettata(false); richiestaAccessoAtti.setAccettata(false);
richiestaAccessoAtti.setDtAccettazione(new Date()); richiestaAccessoAtti.setDtAccettazione(new Date());
richiestaAccessoAtti.setAccessToken("-1"); richiestaAccessoAtti.setAccessToken("-1");
RichiestaAccessoAttiLocalServiceUtil.updateRichiestaAccessoAtti(richiestaAccessoAtti); RichiestaAccessoAttiLocalServiceUtil.updateRichiestaAccessoAtti(richiestaAccessoAtti);
try { try {
String protocollo = ProtocolloUtil.protocollaArrivoAccessoAtti(richiestaAccessoAtti.getGroupId(), String protocollo = ProtocolloUtil.protocollaArrivoAccessoAtti(richiestaAccessoAtti.getGroupId(),
richiestaAccessoAtti.getCompanyId(), richiestaAccessoAtti.getUserName(), richiestaAccessoAtti.getCompanyId(), richiestaAccessoAtti.getUserName(),
richiestaAccessoAtti.getRichiestaAccessoAttiId(), RichiestaAccessoAtti.class.getName()); richiestaAccessoAtti.getRichiestaAccessoAttiId(), RichiestaAccessoAtti.class.getName());
richiestaAccessoAtti.setProtocolloUscita(protocollo); richiestaAccessoAtti.setProtocolloUscita(protocollo);
RichiestaAccessoAttiLocalServiceUtil.updateRichiestaAccessoAtti(richiestaAccessoAtti); RichiestaAccessoAttiLocalServiceUtil.updateRichiestaAccessoAtti(richiestaAccessoAtti);
} catch (Exception e) { } catch (Exception e) {
_log.error(e); _log.error(e);
} }
EmailSenderUtil.sendDeniedEmail(richiestaAccessoAttiId, motivoRifiuto); EmailSenderUtil.sendDeniedEmail(richiestaAccessoAttiId, motivoRifiuto);
} }
} }
public void ricercaGestite(ActionRequest actionRequest, ActionResponse actionResponse) throws SystemException { public void ricercaGestite(ActionRequest actionRequest, ActionResponse actionResponse) throws SystemException {
@ -120,48 +143,65 @@ public class AccessoAttiBOPortlet extends MVCPortlet {
String protocollo = actionRequest.getParameter("protocollo"); String protocollo = actionRequest.getParameter("protocollo");
String dataDal = actionRequest.getParameter("dataDal"); String dataDal = actionRequest.getParameter("dataDal");
String dataAl = actionRequest.getParameter("dataAl"); String dataAl = actionRequest.getParameter("dataAl");
actionResponse.setRenderParameter("numeroProgetto", numeroProgetto); actionResponse.setRenderParameter("numeroProgetto", numeroProgetto);
actionResponse.setRenderParameter("protocollo", protocollo); actionResponse.setRenderParameter("protocollo", protocollo);
actionResponse.setRenderParameter("dataDal", dataDal); actionResponse.setRenderParameter("dataDal", dataDal);
actionResponse.setRenderParameter("dataAl", dataAl); actionResponse.setRenderParameter("dataAl", dataAl);
actionResponse.setRenderParameter("tabs1", "Richieste Concluse"); actionResponse.setRenderParameter("tabs1", "Richieste Concluse");
} }
@Override @Override
public void serveResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse) throws IOException, public void serveResource(ResourceRequest resourceRequest,
ResourceResponse resourceResponse) throws IOException,
PortletException { PortletException {
String id = resourceRequest.getResourceID(); String id = resourceRequest.getResourceID();
if ("exportRicerca".equals(id)) {
if("exportRicerca".equals(id)){
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 csv = StringPool.BLANK; String csv = StringPool.BLANK;
HttpServletRequest request = PortalUtil.getHttpServletRequest(resourceRequest); HttpServletRequest request = PortalUtil.getHttpServletRequest(resourceRequest);
HttpServletResponse response = PortalUtil.getHttpServletResponse(resourceResponse); HttpServletResponse response = PortalUtil.getHttpServletResponse(resourceResponse);
try { try {
csv = exportSearch(locale, resourceRequest, user); csv = exportSearch(locale, resourceRequest, user);
} catch (SystemException | ParseException | PortalException e) { } catch (SystemException | ParseException | PortalException e) {
_log.error(e, e); _log.error(e,e);
} }
ServletResponseUtil.sendFile(request, response, "export_ricerca_accesso_atti_" + new Date().getTime()
+ ".csv", csv.getBytes(StringPool.UTF8), ContentTypes.TEXT_CSV_UTF8); ServletResponseUtil.sendFile(request, response, "export_ricerca_accesso_atti_"+ new Date().getTime() + ".csv", csv.getBytes(StringPool.UTF8),
ContentTypes.TEXT_CSV_UTF8);
} }
super.serveResource(resourceRequest, resourceResponse); super.serveResource(resourceRequest, resourceResponse);
} }
private String exportSearch(Locale locale, ResourceRequest resourceRequest, User user) throws SystemException, private String exportSearch(Locale locale, ResourceRequest resourceRequest, User user) throws SystemException, ParseException, PortalException {
ParseException, PortalException {
ThemeDisplay themeDisplay = (ThemeDisplay) resourceRequest.getAttribute(WebKeys.THEME_DISPLAY); ThemeDisplay themeDisplay = (ThemeDisplay) resourceRequest.getAttribute(WebKeys.THEME_DISPLAY);
HttpServletRequest httpRequest = PortalUtil.getHttpServletRequest(resourceRequest); HttpServletRequest httpRequest = PortalUtil.getHttpServletRequest(resourceRequest);
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
String numeroProgetto = ParamUtil.getString(httpRequest, "numeroProgetto", StringPool.BLANK); String numeroProgetto = ParamUtil.getString(httpRequest, "numeroProgetto", StringPool.BLANK);
String protocollo = ParamUtil.getString(httpRequest, "protocollo", StringPool.BLANK); String protocollo = ParamUtil.getString(httpRequest, "protocollo", StringPool.BLANK);
String dataDal = ParamUtil.getString(httpRequest, "dataDal", StringPool.BLANK); String dataDal = ParamUtil.getString(httpRequest, "dataDal", StringPool.BLANK);
String dataAl = ParamUtil.getString(httpRequest, "dataAl", StringPool.BLANK); String dataAl = ParamUtil.getString(httpRequest, "dataAl", StringPool.BLANK);
List<RichiestaAccessoAtti> lista = RichiestaAccessoAttiLocalServiceUtil.findCompletate(numeroProgetto,
protocollo, dataDal, dataAl, -1, -1); List<RichiestaAccessoAtti> lista =
RichiestaAccessoAttiLocalServiceUtil.findCompletate(numeroProgetto, protocollo, dataDal, dataAl, -1, -1);
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "Utente Richiedente"))); sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "Utente Richiedente")));
sb.append(StringPool.SEMICOLON); sb.append(StringPool.SEMICOLON);
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "Data Gestione"))); sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "Data Gestione")));
@ -182,68 +222,98 @@ public class AccessoAttiBOPortlet extends MVCPortlet {
sb.append(StringPool.SEMICOLON); sb.append(StringPool.SEMICOLON);
sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "Gestita Da"))); sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "Gestita Da")));
sb.append(StringPool.SEMICOLON); sb.append(StringPool.SEMICOLON);
sb.append(StringPool.NEW_LINE); sb.append(StringPool.NEW_LINE);
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
for (RichiestaAccessoAtti atto : lista) { for (RichiestaAccessoAtti atto : lista) {
sb.append(CSVUtil.encode(UserLocalServiceUtil.getUser(atto.getUserId()).getFullName())); sb.append(CSVUtil.encode(UserLocalServiceUtil.getUser(atto.getUserId()).getFullName()));
sb.append(StringPool.SEMICOLON); sb.append(StringPool.SEMICOLON);
sb.append(CSVUtil.encode(sdf.format(atto.getDtAccettazione()))); sb.append(CSVUtil.encode(sdf.format(atto.getDtAccettazione())));
sb.append(StringPool.SEMICOLON); sb.append(StringPool.SEMICOLON);
sb.append(CSVUtil.encode(atto.getProtocolloEntrata())); sb.append(CSVUtil.encode(atto.getProtocolloEntrata()));
sb.append(StringPool.SEMICOLON); sb.append(StringPool.SEMICOLON);
sb.append(CSVUtil.encode(atto.getProtocolloUscita())); sb.append(CSVUtil.encode(atto.getProtocolloUscita()));
sb.append(StringPool.SEMICOLON); sb.append(StringPool.SEMICOLON);
sb.append(CSVUtil.encode(atto.getNumeroProgetto())); sb.append(CSVUtil.encode(atto.getNumeroProgetto()));
sb.append(StringPool.SEMICOLON); sb.append(StringPool.SEMICOLON);
sb.append(CSVUtil.encode(sdf.format(atto.getDtVidimazione()))); sb.append(CSVUtil.encode(sdf.format(atto.getDtVidimazione())));
sb.append(StringPool.SEMICOLON); sb.append(StringPool.SEMICOLON);
sb.append(CSVUtil.encode(atto.getSanatoria() ? "SI" : "NO")); sb.append(CSVUtil.encode(atto.getSanatoria() ? "SI" : "NO"));
sb.append(StringPool.SEMICOLON); sb.append(StringPool.SEMICOLON);
if (atto.getIntPraticaId() != 0L) {
if(atto.getIntPraticaId() != 0L){
Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(atto.getTerritorioId()); Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(atto.getTerritorioId());
Comune comune = ComuneLocalServiceUtil.getComune(territorio.getComuneId()); Comune comune = ComuneLocalServiceUtil.getComune(territorio.getComuneId());
Provincia provincia = ProvinciaLocalServiceUtil.fetchByC_C(themeDisplay.getCompanyId(), Provincia provincia = ProvinciaLocalServiceUtil.fetchByC_C(themeDisplay.getCompanyId(), comune.getCodiceProvincia());
comune.getCodiceProvincia());
sb.append(CSVUtil.encode(provincia.getProvincia())); sb.append(CSVUtil.encode(provincia.getProvincia()));
sb.append(StringPool.SEMICOLON); sb.append(StringPool.SEMICOLON);
} else { } else {
sb.append(CSVUtil.encode("")); sb.append(CSVUtil.encode(""));
sb.append(StringPool.SEMICOLON); sb.append(StringPool.SEMICOLON);
} }
sb.append(CSVUtil.encode(atto.getAccettata() ? "SI" : "NO")); sb.append(CSVUtil.encode(atto.getAccettata() ? "SI" : "NO"));
sb.append(StringPool.SEMICOLON); sb.append(StringPool.SEMICOLON);
sb.append(CSVUtil.encode(UserLocalServiceUtil.getUser(atto.getFunzionarioId()).getFullName())); sb.append(CSVUtil.encode(UserLocalServiceUtil.getUser(atto.getFunzionarioId()).getFullName()));
sb.append(StringPool.SEMICOLON); sb.append(StringPool.SEMICOLON);
sb.append(StringPool.NEW_LINE); sb.append(StringPool.NEW_LINE);
} }
return sb.toString(); return sb.toString();
} }
public void aggiungiRichiestaBO(ActionRequest actionRequest, ActionResponse actionResponse) throws SystemException, public void aggiungiRichiestaBO(ActionRequest actionRequest, ActionResponse actionResponse) throws SystemException, AddressException, ParseException{
AddressException, ParseException {
long accessoAttiId = 0L; long accessoAttiId = 0L;
ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
Date dataCheck = sdf.parse("01/01/2015"); Date dataCheck = sdf.parse("01/01/2015");
boolean isNoCNSUser = ParamUtil.getBoolean(actionRequest, "isNoCNSUser"); boolean isNoCNSUser = ParamUtil.getBoolean(actionRequest, "isNoCNSUser");
String codiceFiscale = ParamUtil.getString(actionRequest, "codiceFiscale"); String codiceFiscale = ParamUtil.getString(actionRequest, "codiceFiscale");
String emailRicontatto = ParamUtil.getString(actionRequest, "emailRicontatto"); String emailRicontatto = ParamUtil.getString(actionRequest, "emailRicontatto");
String numeroProgetto = ParamUtil.getString(actionRequest, "numeroProgetto"); String numeroProgetto = ParamUtil.getString(actionRequest, "numeroProgetto");
Date dataVidimazione = ParamUtil.getDate(actionRequest, "dataVidimazione", sdf); Date dataVidimazione = ParamUtil.getDate(actionRequest, "dataVidimazione", sdf);
String qualitaPersona = ParamUtil.getString(actionRequest, "qualitaPersona"); String qualitaPersona = ParamUtil.getString(actionRequest, "qualitaPersona");
String visione = ParamUtil.getString(actionRequest, "visione"); String visione = ParamUtil.getString(actionRequest, "visione");
String copiaDettaglio = ParamUtil.getString(actionRequest, "copiaDett"); String copiaDettaglio = ParamUtil.getString(actionRequest, "copiaDett");
String motivazione = ParamUtil.getString(actionRequest, "motivazione"); String motivazione = ParamUtil.getString(actionRequest, "motivazione");
boolean sanatoria = ParamUtil.getBoolean(actionRequest, "sanatoria"); boolean sanatoria = ParamUtil.getBoolean(actionRequest, "sanatoria");
if (numeroProgetto != null && !numeroProgetto.equalsIgnoreCase("")) {
if (!dataVidimazione.before(dataCheck) && !sanatoria) { if(numeroProgetto != null && !numeroProgetto.equalsIgnoreCase("")){
if(!dataVidimazione.before(dataCheck) && !sanatoria){
IntPratica intPratica = IntPraticaLocalServiceUtil.findByNumeroProgetto(numeroProgetto); IntPratica intPratica = IntPraticaLocalServiceUtil.findByNumeroProgetto(numeroProgetto);
if (intPratica != null) { if(intPratica != null){
RichiestaAccessoAtti richiestaAccessoAtti = RichiestaAccessoAttiLocalServiceUtil
.createRichiestaAccessoAtti(CounterLocalServiceUtil.increment(RichiestaAccessoAtti.class RichiestaAccessoAtti richiestaAccessoAtti = RichiestaAccessoAttiLocalServiceUtil.createRichiestaAccessoAtti(
.getName())); CounterLocalServiceUtil.increment(RichiestaAccessoAtti.class.getName()));
accessoAttiId = richiestaAccessoAtti.getRichiestaAccessoAttiId(); accessoAttiId = richiestaAccessoAtti.getRichiestaAccessoAttiId();
richiestaAccessoAtti.setCompanyId(themeDisplay.getCompanyId()); richiestaAccessoAtti.setCompanyId(themeDisplay.getCompanyId());
richiestaAccessoAtti.setIntPraticaId(intPratica.getIntPraticaId()); richiestaAccessoAtti.setIntPraticaId(intPratica.getIntPraticaId());
richiestaAccessoAtti.setGroupId(intPratica.getGroupId()); richiestaAccessoAtti.setGroupId(intPratica.getGroupId());
@ -254,139 +324,194 @@ public class AccessoAttiBOPortlet extends MVCPortlet {
richiestaAccessoAtti.setMotivazioneRichiesta(motivazione); richiestaAccessoAtti.setMotivazioneRichiesta(motivazione);
richiestaAccessoAtti.setNumeroProgetto(numeroProgetto); richiestaAccessoAtti.setNumeroProgetto(numeroProgetto);
richiestaAccessoAtti.setSanatoria(sanatoria); richiestaAccessoAtti.setSanatoria(sanatoria);
if (sanatoria) {
if(sanatoria){
Date dataSanatoria = ParamUtil.getDate(actionRequest, "dataSanatoria", sdf); Date dataSanatoria = ParamUtil.getDate(actionRequest, "dataSanatoria", sdf);
richiestaAccessoAtti.setDtSanatoria(dataSanatoria); richiestaAccessoAtti.setDtSanatoria(dataSanatoria);
} }
richiestaAccessoAtti.setTipologiaPersona(qualitaPersona); richiestaAccessoAtti.setTipologiaPersona(qualitaPersona);
if (visione.equalsIgnoreCase("copia")) {
if(visione.equalsIgnoreCase("copia")){
richiestaAccessoAtti.setTipologiaRichiestaDettaglio(copiaDettaglio); richiestaAccessoAtti.setTipologiaRichiestaDettaglio(copiaDettaglio);
} }
richiestaAccessoAtti.setTipologiaRichiesta(visione); richiestaAccessoAtti.setTipologiaRichiesta(visione);
User loggedUser = UserLocalServiceUtil.fetchUserByScreenName(themeDisplay.getCompanyId(),
codiceFiscale.toLowerCase()); User loggedUser =
if (loggedUser != null) { UserLocalServiceUtil.fetchUserByScreenName(themeDisplay.getCompanyId(), codiceFiscale.toLowerCase());
if(loggedUser != null){
richiestaAccessoAtti.setUserId(loggedUser.getUserId()); richiestaAccessoAtti.setUserId(loggedUser.getUserId());
richiestaAccessoAtti.setUserName(loggedUser.getScreenName()); richiestaAccessoAtti.setUserName(loggedUser.getScreenName());
} else { } else {
richiestaAccessoAtti.setUserName(codiceFiscale.toLowerCase()); richiestaAccessoAtti.setUserName(codiceFiscale.toLowerCase());
} }
RichiestaAccessoAttiLocalServiceUtil.updateRichiestaAccessoAtti(richiestaAccessoAtti); RichiestaAccessoAttiLocalServiceUtil.updateRichiestaAccessoAtti(richiestaAccessoAtti);
UploadPortletRequest uploadRequest = PortalUtil.getUploadPortletRequest(actionRequest); UploadPortletRequest uploadRequest = PortalUtil.getUploadPortletRequest(actionRequest);
if (dataVidimazione.before(dataCheck) || sanatoria) {
if (uploadRequest.getSize("allegatoPagamento") != 0) { if(dataVidimazione.before(dataCheck) || sanatoria){
if(uploadRequest.getSize("allegatoPagamento") != 0){
String sourceFileName = uploadRequest.getFileName("allegatoPagamento"); String sourceFileName = uploadRequest.getFileName("allegatoPagamento");
File fileApp = uploadRequest.getFile("allegatoPagamento"); File fileApp = uploadRequest.getFile("allegatoPagamento");
long fileEntryIdPagamento = DocumentLibraryUtil.saveFileEntryAccessoAtti(
themeDisplay.getCompanyGroupId(), richiestaAccessoAtti.getRichiestaAccessoAttiId(), long fileEntryIdPagamento = DocumentLibraryUtil.saveFileEntryAccessoAtti(
sourceFileName, fileApp, true); themeDisplay.getCompanyGroupId(), richiestaAccessoAtti.getRichiestaAccessoAttiId(), sourceFileName, fileApp, true);
RichiestaAccessoAtti richiestaAccessoAttiUpdate = RichiestaAccessoAttiLocalServiceUtil
.fetchRichiestaAccessoAtti(richiestaAccessoAtti.getRichiestaAccessoAttiId()); RichiestaAccessoAtti richiestaAccessoAttiUpdate = RichiestaAccessoAttiLocalServiceUtil.fetchRichiestaAccessoAtti(richiestaAccessoAtti.getRichiestaAccessoAttiId());
richiestaAccessoAttiUpdate.setFileEntryIdPagamento(fileEntryIdPagamento); richiestaAccessoAttiUpdate.setFileEntryIdPagamento(fileEntryIdPagamento);
RichiestaAccessoAttiLocalServiceUtil.updateRichiestaAccessoAtti(richiestaAccessoAttiUpdate); RichiestaAccessoAttiLocalServiceUtil.updateRichiestaAccessoAtti(richiestaAccessoAttiUpdate);
} }
} }
if (isNoCNSUser) {
if (uploadRequest.getSize("documentoIdentita") != 0) { if(isNoCNSUser){
if(uploadRequest.getSize("documentoIdentita") != 0){
String sourceFileName = uploadRequest.getFileName("documentoIdentita"); String sourceFileName = uploadRequest.getFileName("documentoIdentita");
File fileApp = uploadRequest.getFile("documentoIdentita"); File fileApp = uploadRequest.getFile("documentoIdentita");
long fileEntryIdDocumento = DocumentLibraryUtil.saveFileEntryAccessoAtti(
themeDisplay.getCompanyGroupId(), richiestaAccessoAtti.getRichiestaAccessoAttiId(), long fileEntryIdDocumento = DocumentLibraryUtil.saveFileEntryAccessoAtti(
sourceFileName, fileApp, false); themeDisplay.getCompanyGroupId(), richiestaAccessoAtti.getRichiestaAccessoAttiId(), sourceFileName, fileApp, false);
RichiestaAccessoAtti richiestaAccessoAttiUpdate = RichiestaAccessoAttiLocalServiceUtil
.fetchRichiestaAccessoAtti(richiestaAccessoAtti.getRichiestaAccessoAttiId()); RichiestaAccessoAtti richiestaAccessoAttiUpdate = RichiestaAccessoAttiLocalServiceUtil.fetchRichiestaAccessoAtti(richiestaAccessoAtti.getRichiestaAccessoAttiId());
richiestaAccessoAttiUpdate.setFileEntryIdDocumentoIdentita(fileEntryIdDocumento); richiestaAccessoAttiUpdate.setFileEntryIdDocumentoIdentita(fileEntryIdDocumento);
RichiestaAccessoAttiLocalServiceUtil.updateRichiestaAccessoAtti(richiestaAccessoAttiUpdate); RichiestaAccessoAttiLocalServiceUtil.updateRichiestaAccessoAtti(richiestaAccessoAttiUpdate);
} }
} }
RichiestaAccessoAtti richiesta = RichiestaAccessoAttiLocalServiceUtil
.fetchRichiestaAccessoAtti(accessoAttiId); RichiestaAccessoAtti richiesta = RichiestaAccessoAttiLocalServiceUtil.fetchRichiestaAccessoAtti(accessoAttiId);
try { try {
String protocollo = ProtocolloUtil.protocollaPartenzaAccessoAtti(
richiesta.getRichiestaAccessoAttiId(), richiesta.getIntPraticaId(), String protocollo = ProtocolloUtil.protocollaPartenzaAccessoAtti(richiesta.getRichiestaAccessoAttiId(),
richiesta.getGroupId(), RichiestaAccessoAtti.class.getName(), richiesta.getCompanyId(), richiesta.getIntPraticaId(), richiesta.getGroupId(), RichiestaAccessoAtti.class.getName(),
richiesta.getUserName()); richiesta.getCompanyId(), richiesta.getUserName());
richiesta.setProtocolloEntrata(protocollo); richiesta.setProtocolloEntrata(protocollo);
RichiestaAccessoAttiLocalServiceUtil.updateRichiestaAccessoAtti(richiesta); RichiestaAccessoAttiLocalServiceUtil.updateRichiestaAccessoAtti(richiesta);
} catch (Exception e) { } catch (Exception e) {
_log.error(e); _log.error(e);
} }
EmailSenderUtil.sendAcceptedRequest(accessoAttiId); EmailSenderUtil.sendAcceptedRequest(accessoAttiId);
actionResponse.setRenderParameter("jspPage", "/html/accesso_atti_fe/richiesta-inviata-success.jsp"); actionResponse.setRenderParameter("jspPage","/html/accesso_atti_fe/richiesta-inviata-success.jsp");
} else { } else {
SessionErrors.add(actionRequest, "atto-non-esistente"); SessionErrors.add(actionRequest, "atto-non-esistente");
} }
} else { } else {
RichiestaAccessoAtti richiestaAccessoAtti = RichiestaAccessoAttiLocalServiceUtil
.createRichiestaAccessoAtti(CounterLocalServiceUtil.increment(RichiestaAccessoAtti.class RichiestaAccessoAtti richiestaAccessoAtti = RichiestaAccessoAttiLocalServiceUtil.createRichiestaAccessoAtti(
.getName())); CounterLocalServiceUtil.increment(RichiestaAccessoAtti.class.getName()));
accessoAttiId = richiestaAccessoAtti.getRichiestaAccessoAttiId();
richiestaAccessoAtti.setCompanyId(themeDisplay.getCompanyId());
richiestaAccessoAtti.setCreateDate(new Date()); accessoAttiId = richiestaAccessoAtti.getRichiestaAccessoAttiId();
richiestaAccessoAtti.setEmailRicontatto(emailRicontatto);
richiestaAccessoAtti.setDtVidimazione(dataVidimazione); richiestaAccessoAtti.setCompanyId(themeDisplay.getCompanyId());
richiestaAccessoAtti.setMotivazioneRichiesta(motivazione); // richiestaAccessoAtti.setIntPraticaId(intPratica.getIntPraticaId());
richiestaAccessoAtti.setNumeroProgetto(numeroProgetto); // richiestaAccessoAtti.setGroupId(intPratica.getGroupId());
richiestaAccessoAtti.setSanatoria(sanatoria); // richiestaAccessoAtti.setTerritorioId(intPratica.getTerritorioId());
if (sanatoria) { richiestaAccessoAtti.setCreateDate(new Date());
Date dataSanatoria = ParamUtil.getDate(actionRequest, "dataSanatoria", sdf); richiestaAccessoAtti.setEmailRicontatto(emailRicontatto);
richiestaAccessoAtti.setDtSanatoria(dataSanatoria); richiestaAccessoAtti.setDtVidimazione(dataVidimazione);
} richiestaAccessoAtti.setMotivazioneRichiesta(motivazione);
richiestaAccessoAtti.setTipologiaPersona(qualitaPersona); richiestaAccessoAtti.setNumeroProgetto(numeroProgetto);
if (visione.equalsIgnoreCase("copia")) { richiestaAccessoAtti.setSanatoria(sanatoria);
richiestaAccessoAtti.setTipologiaRichiestaDettaglio(copiaDettaglio); if(sanatoria){
} Date dataSanatoria = ParamUtil.getDate(actionRequest, "dataSanatoria", sdf);
richiestaAccessoAtti.setTipologiaRichiesta(visione); richiestaAccessoAtti.setDtSanatoria(dataSanatoria);
User loggedUser = UserLocalServiceUtil.fetchUserByScreenName(themeDisplay.getCompanyId(),
codiceFiscale.toLowerCase());
if (loggedUser != null) {
richiestaAccessoAtti.setUserId(loggedUser.getUserId());
richiestaAccessoAtti.setUserName(loggedUser.getScreenName());
} else {
richiestaAccessoAtti.setUserName(codiceFiscale.toLowerCase());
}
RichiestaAccessoAttiLocalServiceUtil.updateRichiestaAccessoAtti(richiestaAccessoAtti);
UploadPortletRequest uploadRequest = PortalUtil.getUploadPortletRequest(actionRequest);
if (dataVidimazione.before(dataCheck) || sanatoria) {
if (uploadRequest.getSize("allegatoPagamento") != 0) {
String sourceFileName = uploadRequest.getFileName("allegatoPagamento");
File fileApp = uploadRequest.getFile("allegatoPagamento");
long fileEntryIdPagamento = DocumentLibraryUtil.saveFileEntryAccessoAtti(
themeDisplay.getCompanyGroupId(), richiestaAccessoAtti.getRichiestaAccessoAttiId(),
sourceFileName, fileApp, true);
RichiestaAccessoAtti richiestaAccessoAttiUpdate = RichiestaAccessoAttiLocalServiceUtil
.fetchRichiestaAccessoAtti(richiestaAccessoAtti.getRichiestaAccessoAttiId());
richiestaAccessoAttiUpdate.setFileEntryIdPagamento(fileEntryIdPagamento);
RichiestaAccessoAttiLocalServiceUtil.updateRichiestaAccessoAtti(richiestaAccessoAttiUpdate);
} }
} richiestaAccessoAtti.setTipologiaPersona(qualitaPersona);
if (isNoCNSUser) {
if (uploadRequest.getSize("documentoIdentita") != 0) { if(visione.equalsIgnoreCase("copia")){
String sourceFileName = uploadRequest.getFileName("documentoIdentita"); richiestaAccessoAtti.setTipologiaRichiestaDettaglio(copiaDettaglio);
File fileApp = uploadRequest.getFile("documentoIdentita");
long fileEntryIdDocumento = DocumentLibraryUtil.saveFileEntryAccessoAtti(
themeDisplay.getCompanyGroupId(), richiestaAccessoAtti.getRichiestaAccessoAttiId(),
sourceFileName, fileApp, false);
RichiestaAccessoAtti richiestaAccessoAttiUpdate = RichiestaAccessoAttiLocalServiceUtil
.fetchRichiestaAccessoAtti(richiestaAccessoAtti.getRichiestaAccessoAttiId());
richiestaAccessoAttiUpdate.setFileEntryIdDocumentoIdentita(fileEntryIdDocumento);
RichiestaAccessoAttiLocalServiceUtil.updateRichiestaAccessoAtti(richiestaAccessoAttiUpdate);
} }
}
RichiestaAccessoAtti richiesta = RichiestaAccessoAttiLocalServiceUtil richiestaAccessoAtti.setTipologiaRichiesta(visione);
.fetchRichiestaAccessoAtti(accessoAttiId);
try { User loggedUser =
String protocollo = ProtocolloUtil.protocollaPartenzaAccessoAtti( UserLocalServiceUtil.fetchUserByScreenName(themeDisplay.getCompanyId(), codiceFiscale.toLowerCase());
richiesta.getRichiestaAccessoAttiId(), richiesta.getIntPraticaId(), richiesta.getGroupId(), if(loggedUser != null){
RichiestaAccessoAtti.class.getName(), richiesta.getCompanyId(), richiesta.getUserName()); richiestaAccessoAtti.setUserId(loggedUser.getUserId());
richiesta.setProtocolloEntrata(protocollo); richiestaAccessoAtti.setUserName(loggedUser.getScreenName());
RichiestaAccessoAttiLocalServiceUtil.updateRichiestaAccessoAtti(richiesta); } else {
} catch (Exception e) { richiestaAccessoAtti.setUserName(codiceFiscale.toLowerCase());
_log.error(e); }
}
EmailSenderUtil.sendAcceptedRequest(accessoAttiId); RichiestaAccessoAttiLocalServiceUtil.updateRichiestaAccessoAtti(richiestaAccessoAtti);
actionResponse.setRenderParameter("jspPage", "/html/accesso_atti_fe/richiesta-inviata-success.jsp");
UploadPortletRequest uploadRequest = PortalUtil.getUploadPortletRequest(actionRequest);
if(dataVidimazione.before(dataCheck) || sanatoria){
if(uploadRequest.getSize("allegatoPagamento") != 0){
String sourceFileName = uploadRequest.getFileName("allegatoPagamento");
File fileApp = uploadRequest.getFile("allegatoPagamento");
long fileEntryIdPagamento = DocumentLibraryUtil.saveFileEntryAccessoAtti(
themeDisplay.getCompanyGroupId(), richiestaAccessoAtti.getRichiestaAccessoAttiId(), sourceFileName, fileApp, true);
RichiestaAccessoAtti richiestaAccessoAttiUpdate = RichiestaAccessoAttiLocalServiceUtil.fetchRichiestaAccessoAtti(richiestaAccessoAtti.getRichiestaAccessoAttiId());
richiestaAccessoAttiUpdate.setFileEntryIdPagamento(fileEntryIdPagamento);
RichiestaAccessoAttiLocalServiceUtil.updateRichiestaAccessoAtti(richiestaAccessoAttiUpdate);
}
}
if(isNoCNSUser){
if(uploadRequest.getSize("documentoIdentita") != 0){
String sourceFileName = uploadRequest.getFileName("documentoIdentita");
File fileApp = uploadRequest.getFile("documentoIdentita");
long fileEntryIdDocumento = DocumentLibraryUtil.saveFileEntryAccessoAtti(
themeDisplay.getCompanyGroupId(), richiestaAccessoAtti.getRichiestaAccessoAttiId(), sourceFileName, fileApp, false);
RichiestaAccessoAtti richiestaAccessoAttiUpdate = RichiestaAccessoAttiLocalServiceUtil.fetchRichiestaAccessoAtti(richiestaAccessoAtti.getRichiestaAccessoAttiId());
richiestaAccessoAttiUpdate.setFileEntryIdDocumentoIdentita(fileEntryIdDocumento);
RichiestaAccessoAttiLocalServiceUtil.updateRichiestaAccessoAtti(richiestaAccessoAttiUpdate);
}
}
RichiestaAccessoAtti richiesta = RichiestaAccessoAttiLocalServiceUtil.fetchRichiestaAccessoAtti(accessoAttiId);
try {
String protocollo = ProtocolloUtil.protocollaPartenzaAccessoAtti(richiesta.getRichiestaAccessoAttiId(),
richiesta.getIntPraticaId(), richiesta.getGroupId(), RichiestaAccessoAtti.class.getName(),
richiesta.getCompanyId(), richiesta.getUserName());
richiesta.setProtocolloEntrata(protocollo);
RichiestaAccessoAttiLocalServiceUtil.updateRichiestaAccessoAtti(richiesta);
} catch (Exception e) {
_log.error(e);
}
EmailSenderUtil.sendAcceptedRequest(accessoAttiId);
actionResponse.setRenderParameter("jspPage","/html/accesso_atti_fe/richiesta-inviata-success.jsp");
} }
}
}
} }
} }

338
liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/accesso/atti/portlet/AccessoAttiFEPortlet.java

@ -30,34 +30,47 @@ import com.liferay.portal.theme.ThemeDisplay;
import com.liferay.portal.util.PortalUtil; import com.liferay.portal.util.PortalUtil;
import com.liferay.util.bridges.mvc.MVCPortlet; import com.liferay.util.bridges.mvc.MVCPortlet;
/**
* Portlet implementation class AccessoAttiFEPortlet
*/
public class AccessoAttiFEPortlet extends MVCPortlet { public class AccessoAttiFEPortlet extends MVCPortlet {
public static final Log _log = LogFactoryUtil.getLog(AccessoAttiFEPortlet.class); public static final Log _log = LogFactoryUtil.getLog(AccessoAttiFEPortlet.class);
public void inviaRichiestaAccessoAtti(ActionRequest actionRequest, ActionResponse actionResponse) public void inviaRichiestaAccessoAtti(ActionRequest actionRequest, ActionResponse actionResponse) throws ParseException, SystemException, AddressException{
throws ParseException, SystemException, AddressException {
long accessoAttiId = 0L; long accessoAttiId = 0L;
ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
Date dataCheck = sdf.parse("01/01/2015"); Date dataCheck = sdf.parse("01/01/2015");
boolean isNoCNSUser = ParamUtil.getBoolean(actionRequest, "isNoCNSUser"); boolean isNoCNSUser = ParamUtil.getBoolean(actionRequest, "isNoCNSUser");
String emailRicontatto = ParamUtil.getString(actionRequest, "emailRicontatto"); String emailRicontatto = ParamUtil.getString(actionRequest, "emailRicontatto");
String numeroProgetto = ParamUtil.getString(actionRequest, "numeroProgetto"); String numeroProgetto = ParamUtil.getString(actionRequest, "numeroProgetto");
Date dataVidimazione = ParamUtil.getDate(actionRequest, "dataVidimazione", sdf); Date dataVidimazione = ParamUtil.getDate(actionRequest, "dataVidimazione", sdf);
String qualitaPersona = ParamUtil.getString(actionRequest, "qualitaPersona"); String qualitaPersona = ParamUtil.getString(actionRequest, "qualitaPersona");
String visione = ParamUtil.getString(actionRequest, "visione"); String visione = ParamUtil.getString(actionRequest, "visione");
String copiaDettaglio = ParamUtil.getString(actionRequest, "copiaDett"); String copiaDettaglio = ParamUtil.getString(actionRequest, "copiaDett");
String motivazione = ParamUtil.getString(actionRequest, "motivazione"); String motivazione = ParamUtil.getString(actionRequest, "motivazione");
boolean sanatoria = ParamUtil.getBoolean(actionRequest, "sanatoria"); boolean sanatoria = ParamUtil.getBoolean(actionRequest, "sanatoria");
if (numeroProgetto != null && !numeroProgetto.equalsIgnoreCase("")) {
if (!dataVidimazione.before(dataCheck) && !sanatoria) { if(numeroProgetto != null && !numeroProgetto.equalsIgnoreCase("")){
if(!dataVidimazione.before(dataCheck) && !sanatoria){
IntPratica intPratica = IntPraticaLocalServiceUtil.findByNumeroProgetto(numeroProgetto); IntPratica intPratica = IntPraticaLocalServiceUtil.findByNumeroProgetto(numeroProgetto);
if (intPratica != null) { if(intPratica != null){
RichiestaAccessoAtti richiestaAccessoAtti = RichiestaAccessoAttiLocalServiceUtil
.createRichiestaAccessoAtti(CounterLocalServiceUtil.increment(RichiestaAccessoAtti.class RichiestaAccessoAtti richiestaAccessoAtti = RichiestaAccessoAttiLocalServiceUtil.createRichiestaAccessoAtti(
.getName())); CounterLocalServiceUtil.increment(RichiestaAccessoAtti.class.getName()));
accessoAttiId = richiestaAccessoAtti.getRichiestaAccessoAttiId(); accessoAttiId = richiestaAccessoAtti.getRichiestaAccessoAttiId();
richiestaAccessoAtti.setCompanyId(themeDisplay.getCompanyId()); richiestaAccessoAtti.setCompanyId(themeDisplay.getCompanyId());
richiestaAccessoAtti.setIntPraticaId(intPratica.getIntPraticaId()); richiestaAccessoAtti.setIntPraticaId(intPratica.getIntPraticaId());
richiestaAccessoAtti.setGroupId(intPratica.getGroupId()); richiestaAccessoAtti.setGroupId(intPratica.getGroupId());
@ -68,144 +81,202 @@ public class AccessoAttiFEPortlet extends MVCPortlet {
richiestaAccessoAtti.setMotivazioneRichiesta(motivazione); richiestaAccessoAtti.setMotivazioneRichiesta(motivazione);
richiestaAccessoAtti.setNumeroProgetto(numeroProgetto); richiestaAccessoAtti.setNumeroProgetto(numeroProgetto);
richiestaAccessoAtti.setSanatoria(sanatoria); richiestaAccessoAtti.setSanatoria(sanatoria);
if (sanatoria) {
if(sanatoria){
Date dataSanatoria = ParamUtil.getDate(actionRequest, "dataSanatoria", sdf); Date dataSanatoria = ParamUtil.getDate(actionRequest, "dataSanatoria", sdf);
richiestaAccessoAtti.setDtSanatoria(dataSanatoria); richiestaAccessoAtti.setDtSanatoria(dataSanatoria);
} }
richiestaAccessoAtti.setTipologiaPersona(qualitaPersona); richiestaAccessoAtti.setTipologiaPersona(qualitaPersona);
if (visione.equalsIgnoreCase("copia")) {
if(visione.equalsIgnoreCase("copia")){
richiestaAccessoAtti.setTipologiaRichiestaDettaglio(copiaDettaglio); richiestaAccessoAtti.setTipologiaRichiestaDettaglio(copiaDettaglio);
} }
richiestaAccessoAtti.setTipologiaRichiesta(visione); richiestaAccessoAtti.setTipologiaRichiesta(visione);
richiestaAccessoAtti.setUserId(themeDisplay.getUserId()); richiestaAccessoAtti.setUserId(themeDisplay.getUserId());
richiestaAccessoAtti.setUserName(themeDisplay.getUser().getScreenName()); richiestaAccessoAtti.setUserName(themeDisplay.getUser().getScreenName());
RichiestaAccessoAttiLocalServiceUtil.updateRichiestaAccessoAtti(richiestaAccessoAtti); RichiestaAccessoAttiLocalServiceUtil.updateRichiestaAccessoAtti(richiestaAccessoAtti);
UploadPortletRequest uploadRequest = PortalUtil.getUploadPortletRequest(actionRequest); UploadPortletRequest uploadRequest = PortalUtil.getUploadPortletRequest(actionRequest);
if (dataVidimazione.before(dataCheck) || sanatoria) {
if (uploadRequest.getSize("allegatoPagamento") != 0) { if(dataVidimazione.before(dataCheck) || sanatoria){
if(uploadRequest.getSize("allegatoPagamento") != 0){
String sourceFileName = uploadRequest.getFileName("allegatoPagamento"); String sourceFileName = uploadRequest.getFileName("allegatoPagamento");
File fileApp = uploadRequest.getFile("allegatoPagamento"); File fileApp = uploadRequest.getFile("allegatoPagamento");
long fileEntryIdPagamento = DocumentLibraryUtil.saveFileEntryAccessoAtti(
themeDisplay.getCompanyGroupId(), richiestaAccessoAtti.getRichiestaAccessoAttiId(), long fileEntryIdPagamento = DocumentLibraryUtil.saveFileEntryAccessoAtti(
sourceFileName, fileApp, true); themeDisplay.getCompanyGroupId(), richiestaAccessoAtti.getRichiestaAccessoAttiId(), sourceFileName, fileApp, true);
RichiestaAccessoAtti richiestaAccessoAttiUpdate = RichiestaAccessoAttiLocalServiceUtil
.fetchRichiestaAccessoAtti(richiestaAccessoAtti.getRichiestaAccessoAttiId()); RichiestaAccessoAtti richiestaAccessoAttiUpdate = RichiestaAccessoAttiLocalServiceUtil.fetchRichiestaAccessoAtti(richiestaAccessoAtti.getRichiestaAccessoAttiId());
richiestaAccessoAttiUpdate.setFileEntryIdPagamento(fileEntryIdPagamento); richiestaAccessoAttiUpdate.setFileEntryIdPagamento(fileEntryIdPagamento);
RichiestaAccessoAttiLocalServiceUtil.updateRichiestaAccessoAtti(richiestaAccessoAttiUpdate); RichiestaAccessoAttiLocalServiceUtil.updateRichiestaAccessoAtti(richiestaAccessoAttiUpdate);
} }
} }
if (isNoCNSUser) {
if (uploadRequest.getSize("documentoIdentita") != 0) { if(isNoCNSUser){
if(uploadRequest.getSize("documentoIdentita") != 0){
String sourceFileName = uploadRequest.getFileName("documentoIdentita"); String sourceFileName = uploadRequest.getFileName("documentoIdentita");
File fileApp = uploadRequest.getFile("documentoIdentita"); File fileApp = uploadRequest.getFile("documentoIdentita");
long fileEntryIdDocumento = DocumentLibraryUtil.saveFileEntryAccessoAtti(
themeDisplay.getCompanyGroupId(), richiestaAccessoAtti.getRichiestaAccessoAttiId(), long fileEntryIdDocumento = DocumentLibraryUtil.saveFileEntryAccessoAtti(
sourceFileName, fileApp, false); themeDisplay.getCompanyGroupId(), richiestaAccessoAtti.getRichiestaAccessoAttiId(), sourceFileName, fileApp, false);
RichiestaAccessoAtti richiestaAccessoAttiUpdate = RichiestaAccessoAttiLocalServiceUtil
.fetchRichiestaAccessoAtti(richiestaAccessoAtti.getRichiestaAccessoAttiId()); RichiestaAccessoAtti richiestaAccessoAttiUpdate = RichiestaAccessoAttiLocalServiceUtil.fetchRichiestaAccessoAtti(richiestaAccessoAtti.getRichiestaAccessoAttiId());
richiestaAccessoAttiUpdate.setFileEntryIdDocumentoIdentita(fileEntryIdDocumento); richiestaAccessoAttiUpdate.setFileEntryIdDocumentoIdentita(fileEntryIdDocumento);
RichiestaAccessoAttiLocalServiceUtil.updateRichiestaAccessoAtti(richiestaAccessoAttiUpdate); RichiestaAccessoAttiLocalServiceUtil.updateRichiestaAccessoAtti(richiestaAccessoAttiUpdate);
} }
} }
RichiestaAccessoAtti richiesta = RichiestaAccessoAttiLocalServiceUtil
.fetchRichiestaAccessoAtti(accessoAttiId); RichiestaAccessoAtti richiesta = RichiestaAccessoAttiLocalServiceUtil.fetchRichiestaAccessoAtti(accessoAttiId);
try { try {
String protocollo = ProtocolloUtil.protocollaPartenzaAccessoAtti(
richiesta.getRichiestaAccessoAttiId(), richiesta.getIntPraticaId(), String protocollo = ProtocolloUtil.protocollaPartenzaAccessoAtti(richiesta.getRichiestaAccessoAttiId(),
richiesta.getGroupId(), RichiestaAccessoAtti.class.getName(), richiesta.getCompanyId(), richiesta.getIntPraticaId(), richiesta.getGroupId(), RichiestaAccessoAtti.class.getName(),
richiesta.getUserName()); richiesta.getCompanyId(), richiesta.getUserName());
richiesta.setProtocolloEntrata(protocollo); richiesta.setProtocolloEntrata(protocollo);
RichiestaAccessoAttiLocalServiceUtil.updateRichiestaAccessoAtti(richiesta); RichiestaAccessoAttiLocalServiceUtil.updateRichiestaAccessoAtti(richiesta);
} catch (Exception e) { } catch (Exception e) {
_log.error(e); _log.error(e);
} }
EmailSenderUtil.sendAcceptedRequest(accessoAttiId); EmailSenderUtil.sendAcceptedRequest(accessoAttiId);
actionResponse.setRenderParameter("jspPage", "/html/accesso_atti_fe/richiesta-inviata-success.jsp"); actionResponse.setRenderParameter("jspPage","/html/accesso_atti_fe/richiesta-inviata-success.jsp");
} else { } else {
SessionErrors.add(actionRequest, "atto-non-esistente"); SessionErrors.add(actionRequest, "atto-non-esistente");
} }
} else { } else {
RichiestaAccessoAtti richiestaAccessoAtti = RichiestaAccessoAttiLocalServiceUtil
.createRichiestaAccessoAtti(CounterLocalServiceUtil.increment(RichiestaAccessoAtti.class RichiestaAccessoAtti richiestaAccessoAtti = RichiestaAccessoAttiLocalServiceUtil.createRichiestaAccessoAtti(
.getName())); CounterLocalServiceUtil.increment(RichiestaAccessoAtti.class.getName()));
accessoAttiId = richiestaAccessoAtti.getRichiestaAccessoAttiId();
richiestaAccessoAtti.setCompanyId(themeDisplay.getCompanyId());
richiestaAccessoAtti.setCreateDate(new Date()); accessoAttiId = richiestaAccessoAtti.getRichiestaAccessoAttiId();
richiestaAccessoAtti.setEmailRicontatto(emailRicontatto);
richiestaAccessoAtti.setDtVidimazione(dataVidimazione); richiestaAccessoAtti.setCompanyId(themeDisplay.getCompanyId());
richiestaAccessoAtti.setMotivazioneRichiesta(motivazione); // richiestaAccessoAtti.setIntPraticaId(intPratica.getIntPraticaId());
richiestaAccessoAtti.setNumeroProgetto(numeroProgetto); // richiestaAccessoAtti.setGroupId(intPratica.getGroupId());
richiestaAccessoAtti.setSanatoria(sanatoria); // richiestaAccessoAtti.setTerritorioId(intPratica.getTerritorioId());
if (sanatoria) { richiestaAccessoAtti.setCreateDate(new Date());
Date dataSanatoria = ParamUtil.getDate(actionRequest, "dataSanatoria", sdf); richiestaAccessoAtti.setEmailRicontatto(emailRicontatto);
richiestaAccessoAtti.setDtSanatoria(dataSanatoria); richiestaAccessoAtti.setDtVidimazione(dataVidimazione);
} richiestaAccessoAtti.setMotivazioneRichiesta(motivazione);
richiestaAccessoAtti.setTipologiaPersona(qualitaPersona); richiestaAccessoAtti.setNumeroProgetto(numeroProgetto);
if (visione.equalsIgnoreCase("copia")) { richiestaAccessoAtti.setSanatoria(sanatoria);
richiestaAccessoAtti.setTipologiaRichiestaDettaglio(copiaDettaglio); if(sanatoria){
} Date dataSanatoria = ParamUtil.getDate(actionRequest, "dataSanatoria", sdf);
richiestaAccessoAtti.setTipologiaRichiesta(visione); richiestaAccessoAtti.setDtSanatoria(dataSanatoria);
richiestaAccessoAtti.setUserId(themeDisplay.getUserId());
richiestaAccessoAtti.setUserName(themeDisplay.getUser().getScreenName());
RichiestaAccessoAttiLocalServiceUtil.updateRichiestaAccessoAtti(richiestaAccessoAtti);
UploadPortletRequest uploadRequest = PortalUtil.getUploadPortletRequest(actionRequest);
if (dataVidimazione.before(dataCheck) || sanatoria) {
if (uploadRequest.getSize("allegatoPagamento") != 0) {
String sourceFileName = uploadRequest.getFileName("allegatoPagamento");
File fileApp = uploadRequest.getFile("allegatoPagamento");
long fileEntryIdPagamento = DocumentLibraryUtil.saveFileEntryAccessoAtti(
themeDisplay.getCompanyGroupId(), richiestaAccessoAtti.getRichiestaAccessoAttiId(),
sourceFileName, fileApp, true);
RichiestaAccessoAtti richiestaAccessoAttiUpdate = RichiestaAccessoAttiLocalServiceUtil
.fetchRichiestaAccessoAtti(richiestaAccessoAtti.getRichiestaAccessoAttiId());
richiestaAccessoAttiUpdate.setFileEntryIdPagamento(fileEntryIdPagamento);
RichiestaAccessoAttiLocalServiceUtil.updateRichiestaAccessoAtti(richiestaAccessoAttiUpdate);
} }
} richiestaAccessoAtti.setTipologiaPersona(qualitaPersona);
if (isNoCNSUser) {
if (uploadRequest.getSize("documentoIdentita") != 0) { if(visione.equalsIgnoreCase("copia")){
String sourceFileName = uploadRequest.getFileName("documentoIdentita"); richiestaAccessoAtti.setTipologiaRichiestaDettaglio(copiaDettaglio);
File fileApp = uploadRequest.getFile("documentoIdentita");
long fileEntryIdDocumento = DocumentLibraryUtil.saveFileEntryAccessoAtti(
themeDisplay.getCompanyGroupId(), richiestaAccessoAtti.getRichiestaAccessoAttiId(),
sourceFileName, fileApp, false);
RichiestaAccessoAtti richiestaAccessoAttiUpdate = RichiestaAccessoAttiLocalServiceUtil
.fetchRichiestaAccessoAtti(richiestaAccessoAtti.getRichiestaAccessoAttiId());
richiestaAccessoAttiUpdate.setFileEntryIdDocumentoIdentita(fileEntryIdDocumento);
RichiestaAccessoAttiLocalServiceUtil.updateRichiestaAccessoAtti(richiestaAccessoAttiUpdate);
} }
}
RichiestaAccessoAtti richiesta = RichiestaAccessoAttiLocalServiceUtil richiestaAccessoAtti.setTipologiaRichiesta(visione);
.fetchRichiestaAccessoAtti(accessoAttiId);
try { richiestaAccessoAtti.setUserId(themeDisplay.getUserId());
String protocollo = ProtocolloUtil.protocollaPartenzaAccessoAtti( richiestaAccessoAtti.setUserName(themeDisplay.getUser().getScreenName());
richiesta.getRichiestaAccessoAttiId(), richiesta.getIntPraticaId(), richiesta.getGroupId(),
RichiestaAccessoAtti.class.getName(), richiesta.getCompanyId(), richiesta.getUserName()); RichiestaAccessoAttiLocalServiceUtil.updateRichiestaAccessoAtti(richiestaAccessoAtti);
richiesta.setProtocolloEntrata(protocollo);
RichiestaAccessoAttiLocalServiceUtil.updateRichiestaAccessoAtti(richiesta); UploadPortletRequest uploadRequest = PortalUtil.getUploadPortletRequest(actionRequest);
} catch (Exception e) {
_log.error(e); if(dataVidimazione.before(dataCheck) || sanatoria){
}
EmailSenderUtil.sendAcceptedRequest(accessoAttiId); if(uploadRequest.getSize("allegatoPagamento") != 0){
actionResponse.setRenderParameter("jspPage", "/html/accesso_atti_fe/richiesta-inviata-success.jsp");
String sourceFileName = uploadRequest.getFileName("allegatoPagamento");
File fileApp = uploadRequest.getFile("allegatoPagamento");
long fileEntryIdPagamento = DocumentLibraryUtil.saveFileEntryAccessoAtti(
themeDisplay.getCompanyGroupId(), richiestaAccessoAtti.getRichiestaAccessoAttiId(), sourceFileName, fileApp, true);
RichiestaAccessoAtti richiestaAccessoAttiUpdate = RichiestaAccessoAttiLocalServiceUtil.fetchRichiestaAccessoAtti(richiestaAccessoAtti.getRichiestaAccessoAttiId());
richiestaAccessoAttiUpdate.setFileEntryIdPagamento(fileEntryIdPagamento);
RichiestaAccessoAttiLocalServiceUtil.updateRichiestaAccessoAtti(richiestaAccessoAttiUpdate);
}
}
if(isNoCNSUser){
if(uploadRequest.getSize("documentoIdentita") != 0){
String sourceFileName = uploadRequest.getFileName("documentoIdentita");
File fileApp = uploadRequest.getFile("documentoIdentita");
long fileEntryIdDocumento = DocumentLibraryUtil.saveFileEntryAccessoAtti(
themeDisplay.getCompanyGroupId(), richiestaAccessoAtti.getRichiestaAccessoAttiId(), sourceFileName, fileApp, false);
RichiestaAccessoAtti richiestaAccessoAttiUpdate = RichiestaAccessoAttiLocalServiceUtil.fetchRichiestaAccessoAtti(richiestaAccessoAtti.getRichiestaAccessoAttiId());
richiestaAccessoAttiUpdate.setFileEntryIdDocumentoIdentita(fileEntryIdDocumento);
RichiestaAccessoAttiLocalServiceUtil.updateRichiestaAccessoAtti(richiestaAccessoAttiUpdate);
}
}
RichiestaAccessoAtti richiesta = RichiestaAccessoAttiLocalServiceUtil.fetchRichiestaAccessoAtti(accessoAttiId);
try {
String protocollo = ProtocolloUtil.protocollaPartenzaAccessoAtti(richiesta.getRichiestaAccessoAttiId(),
richiesta.getIntPraticaId(), richiesta.getGroupId(), RichiestaAccessoAtti.class.getName(),
richiesta.getCompanyId(), richiesta.getUserName());
richiesta.setProtocolloEntrata(protocollo);
RichiestaAccessoAttiLocalServiceUtil.updateRichiestaAccessoAtti(richiesta);
} catch (Exception e) {
_log.error(e);
}
EmailSenderUtil.sendAcceptedRequest(accessoAttiId);
actionResponse.setRenderParameter("jspPage","/html/accesso_atti_fe/richiesta-inviata-success.jsp");
} }
}
}
} }
public void visualizzaAtto(ActionRequest actionRequest, ActionResponse actionResponse) throws SystemException { public void visualizzaAtto(ActionRequest actionRequest, ActionResponse actionResponse) throws SystemException {
actionResponse.setRenderParameter("tabs1", "Visualizza Atto"); actionResponse.setRenderParameter("tabs1", "Visualizza Atto");
actionRequest.setAttribute("tabs1", "Visualizza Atto"); actionRequest.setAttribute("tabs1", "Visualizza Atto");
String accessToken = ParamUtil.getString(actionRequest, "accessToken"); String accessToken = ParamUtil.getString(actionRequest, "accessToken");
RichiestaAccessoAtti atto = RichiestaAccessoAttiLocalServiceUtil.findByAccessToken(accessToken); RichiestaAccessoAtti atto = RichiestaAccessoAttiLocalServiceUtil.findByAccessToken(accessToken);
if (atto != null) { if(atto != null){
if (atto.isAccettata()) {
if(atto.isAccettata()){
Calendar calApp = Calendar.getInstance(); Calendar calApp = Calendar.getInstance();
calApp.setTime(atto.getDtAccettazione()); calApp.setTime(atto.getDtAccettazione());
calApp.add(Calendar.DATE, 7); calApp.add(Calendar.DATE, 7);
Date checkDate = calApp.getTime(); Date checkDate = calApp.getTime();
if (new Date().before(checkDate)) { if(new Date().before(checkDate) ){
actionResponse.setRenderParameter("accessoAttiId", "" + atto.getRichiestaAccessoAttiId());
actionResponse.setRenderParameter("accessoAttiId", ""+atto.getRichiestaAccessoAttiId());
} else { } else {
SessionErrors.add(actionRequest, "accesso-token-scaduto"); SessionErrors.add(actionRequest, "accesso-token-scaduto");
} }
@ -215,5 +286,56 @@ public class AccessoAttiFEPortlet extends MVCPortlet {
} else { } else {
SessionErrors.add(actionRequest, "no-atto-trovato"); SessionErrors.add(actionRequest, "no-atto-trovato");
} }
} }
} }

48
liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/accesso/atti/portlet/CreazioneAccountPortosPortlet.java

@ -27,69 +27,85 @@ import com.liferay.util.bridges.mvc.MVCPortlet;
*/ */
public class CreazioneAccountPortosPortlet extends MVCPortlet { public class CreazioneAccountPortosPortlet extends MVCPortlet {
public void creaAccount(ActionRequest actionRequest, ActionResponse actionResponse) throws SystemException,
ParseException, PortalException { public void creaAccount(ActionRequest actionRequest, ActionResponse actionResponse) throws SystemException, ParseException, PortalException{
ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
String username = ParamUtil.getString(actionRequest, "codiceFiscale"); String username = ParamUtil.getString(actionRequest, "codiceFiscale");
String password = ParamUtil.getString(actionRequest, "password"); String password = ParamUtil.getString(actionRequest, "password");
String email = ParamUtil.getString(actionRequest, "indirizzoEmail"); String email = ParamUtil.getString(actionRequest, "indirizzoEmail");
String nome = ParamUtil.getString(actionRequest, "nome"); String nome = ParamUtil.getString(actionRequest, "nome");
String cognome = ParamUtil.getString(actionRequest, "cognome"); String cognome = ParamUtil.getString(actionRequest, "cognome");
String dataNascita = ParamUtil.getString(actionRequest, "dataNascita"); String dataNascita = ParamUtil.getString(actionRequest, "dataNascita");
if (username != null) {
User checkUser = UserLocalServiceUtil.fetchUserByScreenName(themeDisplay.getCompanyId(), if(username != null){
username.toLowerCase()); User checkUser = UserLocalServiceUtil.fetchUserByScreenName(themeDisplay.getCompanyId(), username.toLowerCase());
if (checkUser == null) { if(checkUser == null){
Date dateOfBirthday = sdf.parse(dataNascita); Date dateOfBirthday = sdf.parse(dataNascita);
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
cal.setTime(dateOfBirthday); cal.setTime(dateOfBirthday);
int birthdayMonth = cal.get(Calendar.MONTH); int birthdayMonth = cal.get(Calendar.MONTH);
int birthdayDay = cal.get(Calendar.DAY_OF_MONTH); int birthdayDay = cal.get(Calendar.DAY_OF_MONTH);;
; int birthdayYear = cal.get(Calendar.YEAR);;
int birthdayYear = cal.get(Calendar.YEAR);
;
long creatorUserId = 0; long creatorUserId = 0;
long facebookId = 0; long facebookId = 0;
int prefixId = 0; int prefixId = 0;
int suffixId = 0; int suffixId = 0;
long groupIds[] = new long[0]; long groupIds[] = new long[0];
long organizationIds[] = new long[0]; long organizationIds[] = new long[0];
long roleIds[] = new long[0]; long roleIds[] = new long[0];
long userGroupIds[] = new long[0]; long userGroupIds[] = new long[0];
boolean autoPassword = false; boolean autoPassword = false;
boolean autoScreenName = false; boolean autoScreenName = false;
boolean male = true; boolean male = true;
boolean sendEmail = true; boolean sendEmail = true;
String password1 = password; String password1 = password;
String password2 = password; String password2 = password;
String screenName = username; String screenName = username;
String openId = null; String openId = null;
String middleName = null; String middleName = null;
String jobTitle = null; String jobTitle = null;
Date now = new Date(); Date now = new Date();
Locale locale = themeDisplay.getLocale(); Locale locale = themeDisplay.getLocale();
ServiceContext serviceContext = new ServiceContext(); ServiceContext serviceContext = new ServiceContext();
User user = UserLocalServiceUtil.addUser(creatorUserId, themeDisplay.getCompanyId(), autoPassword,
password1, password2, autoScreenName, screenName, email, facebookId, openId, locale, nome, User user = UserLocalServiceUtil.addUser(creatorUserId, themeDisplay.getCompanyId(), autoPassword, password1, password2,
middleName, cognome, prefixId, suffixId, male, birthdayMonth, birthdayDay, birthdayYear, autoScreenName, screenName, email, facebookId, openId, locale, nome, middleName, cognome, prefixId, suffixId, male, birthdayMonth, birthdayDay, birthdayYear, jobTitle, groupIds, organizationIds, roleIds, userGroupIds, sendEmail, serviceContext);
jobTitle, groupIds, organizationIds, roleIds, userGroupIds, sendEmail, serviceContext);
long userId = user.getUserId(); long userId = user.getUserId();
User userCreated = UserLocalServiceUtil.getUser(userId); User userCreated = UserLocalServiceUtil.getUser(userId);
userCreated.setLoginDate(now); userCreated.setLoginDate(now);
userCreated.setLoginIP("127.0.0.1"); userCreated.setLoginIP("127.0.0.1");
userCreated.setLastLoginDate(now); userCreated.setLastLoginDate(now);
userCreated.setModifiedDate(now); userCreated.setModifiedDate(now);
Role roleUserNoCNS = RoleLocalServiceUtil.getRole(themeDisplay.getCompanyId(), "UTENTE_NO_CNS"); Role roleUserNoCNS = RoleLocalServiceUtil.getRole(themeDisplay.getCompanyId(), "UTENTE_NO_CNS");
UserLocalServiceUtil.addRoleUser(roleUserNoCNS.getRoleId(), userId); UserLocalServiceUtil.addRoleUser(roleUserNoCNS.getRoleId(), userId);
UserLocalServiceUtil.updateAgreedToTermsOfUse(userId, true); UserLocalServiceUtil.updateAgreedToTermsOfUse(userId, true);
UserLocalServiceUtil.updateEmailAddressVerified(userId, true); UserLocalServiceUtil.updateEmailAddressVerified(userId, true);
UserLocalServiceUtil.updatePasswordReset(userId, false); UserLocalServiceUtil.updatePasswordReset(userId, false);
} else { } else {
SessionErrors.add(actionRequest, "error-user-exist"); SessionErrors.add(actionRequest, "error-user-exist");
} }
} }
actionResponse.setRenderParameter("jspPage", "/html/creazione_account/success.jsp");
actionResponse.setRenderParameter("jspPage","/html/creazione_account/success.jsp");
} }
} }

22
liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/accesso/atti/service/base/RichiestaAccessoAttiLocalServiceClpInvoker.java

@ -19,7 +19,7 @@ import it.tref.liferay.portos.accesso.atti.service.RichiestaAccessoAttiLocalServ
import java.util.Arrays; import java.util.Arrays;
/** /**
* @author 3F Consulting + Manifattura Web Group s.r.l. * @author 3F Consulting
* @generated * @generated
*/ */
public class RichiestaAccessoAttiLocalServiceClpInvoker { public class RichiestaAccessoAttiLocalServiceClpInvoker {
@ -132,13 +132,13 @@ public class RichiestaAccessoAttiLocalServiceClpInvoker {
"java.lang.String" "java.lang.String"
}; };
_methodName44 = "findByAccessToken"; _methodName43 = "findByAccessToken";
_methodParameterTypes44 = new String[] { "java.lang.String" }; _methodParameterTypes43 = new String[] { "java.lang.String" };
_methodName45 = "findRichiesteByGroup"; _methodName44 = "findRichiesteByGroup";
_methodParameterTypes45 = new String[] { "long", "int", "int" }; _methodParameterTypes44 = new String[] { "long", "int", "int" };
} }
public Object invokeMethod(String name, String[] parameterTypes, public Object invokeMethod(String name, String[] parameterTypes,
@ -265,13 +265,13 @@ public class RichiestaAccessoAttiLocalServiceClpInvoker {
(java.lang.String)arguments[3]); (java.lang.String)arguments[3]);
} }
if (_methodName44.equals(name) && if (_methodName43.equals(name) &&
Arrays.deepEquals(_methodParameterTypes44, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes43, parameterTypes)) {
return RichiestaAccessoAttiLocalServiceUtil.findByAccessToken((java.lang.String)arguments[0]); return RichiestaAccessoAttiLocalServiceUtil.findByAccessToken((java.lang.String)arguments[0]);
} }
if (_methodName45.equals(name) && if (_methodName44.equals(name) &&
Arrays.deepEquals(_methodParameterTypes45, parameterTypes)) { Arrays.deepEquals(_methodParameterTypes44, parameterTypes)) {
return RichiestaAccessoAttiLocalServiceUtil.findRichiesteByGroup(((Long)arguments[0]).longValue(), return RichiestaAccessoAttiLocalServiceUtil.findRichiesteByGroup(((Long)arguments[0]).longValue(),
((Integer)arguments[1]).intValue(), ((Integer)arguments[1]).intValue(),
((Integer)arguments[2]).intValue()); ((Integer)arguments[2]).intValue());
@ -322,8 +322,8 @@ public class RichiestaAccessoAttiLocalServiceClpInvoker {
private String[] _methodParameterTypes41; private String[] _methodParameterTypes41;
private String _methodName42; private String _methodName42;
private String[] _methodParameterTypes42; private String[] _methodParameterTypes42;
private String _methodName43;
private String[] _methodParameterTypes43;
private String _methodName44; private String _methodName44;
private String[] _methodParameterTypes44; private String[] _methodParameterTypes44;
private String _methodName45;
private String[] _methodParameterTypes45;
} }

257
liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/accesso/atti/service/impl/RichiestaAccessoAttiLocalServiceImpl.java

@ -1,9 +1,15 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
* and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software *
* Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in * This library is free software; you can redistribute it and/or modify it under
* the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * the terms of the GNU Lesser General Public License as published by the Free
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. * Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/ */
package it.tref.liferay.portos.accesso.atti.service.impl; package it.tref.liferay.portos.accesso.atti.service.impl;
@ -20,125 +26,222 @@ import java.util.List;
import com.liferay.portal.kernel.dao.orm.Disjunction; import com.liferay.portal.kernel.dao.orm.Disjunction;
import com.liferay.portal.kernel.dao.orm.DynamicQuery; import com.liferay.portal.kernel.dao.orm.DynamicQuery;
import com.liferay.portal.kernel.dao.orm.Property;
import com.liferay.portal.kernel.dao.orm.PropertyFactoryUtil; import com.liferay.portal.kernel.dao.orm.PropertyFactoryUtil;
import com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil; import com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil;
import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.model.Organization; import com.liferay.portal.model.Organization;
import com.liferay.portal.service.OrganizationLocalServiceUtil; import com.liferay.portal.service.OrganizationLocalServiceUtil;
/** /**
* The implementation of the richiesta accesso atti local service. * The implementation of the richiesta accesso atti local service.
*
* <p> * <p>
* All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.accesso.atti.service.RichiestaAccessoAttiLocalService} interface.
* their definitions into the {@link it.tref.liferay.portos.accesso.atti.service.RichiestaAccessoAttiLocalService} *
* interface.
* <p> * <p>
* This is a local service. Methods of this service will not have security checks based on the propagated JAAS * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
* credentials because this service can only be accessed from within the same VM.
* </p> * </p>
* *
* @author 3F Consulting + Manifattura Web Group s.r.l. * @author 3F Consulting
* @see it.tref.liferay.portos.accesso.atti.service.base.RichiestaAccessoAttiLocalServiceBaseImpl * @see it.tref.liferay.portos.accesso.atti.service.base.RichiestaAccessoAttiLocalServiceBaseImpl
* @see it.tref.liferay.portos.accesso.atti.service.RichiestaAccessoAttiLocalServiceUtil * @see it.tref.liferay.portos.accesso.atti.service.RichiestaAccessoAttiLocalServiceUtil
*/ */
public class RichiestaAccessoAttiLocalServiceImpl extends RichiestaAccessoAttiLocalServiceBaseImpl { public class RichiestaAccessoAttiLocalServiceImpl
extends RichiestaAccessoAttiLocalServiceBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link * NOTE FOR DEVELOPERS:
* it.tref.liferay.portos.accesso.atti.service.RichiestaAccessoAttiLocalServiceUtil} to access the richiesta accesso *
* atti local service. * Never reference this interface directly. Always use {@link it.tref.liferay.portos.accesso.atti.service.RichiestaAccessoAttiLocalServiceUtil} to access the richiesta accesso atti local service.
*/ */
private static final SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); public List<RichiestaAccessoAtti> findByGestita(boolean gestita, int start, int end) throws SystemException{
@Override
public List<RichiestaAccessoAtti> findByGestita(boolean gestita, int start, int end) throws SystemException {
return richiestaAccessoAttiPersistence.findByGestita(gestita, start, end); return richiestaAccessoAttiPersistence.findByGestita(gestita, start, end);
} }
@SuppressWarnings("unchecked") public List<RichiestaAccessoAtti> findCompletate(String numeroProgetto, String protocollo, String dataDal, String dataAl, int start, int end) throws SystemException, ParseException{
@Override
public List<RichiestaAccessoAtti> findCompletate(String numeroProgetto, String protocollo, String dataDal,
String dataAl, int start, int end) throws SystemException {
return dynamicQuery(dqCompletate(numeroProgetto, protocollo, dataDal, dataAl), start, end); SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
}
DynamicQuery dq = richiestaAccessoAttiLocalService.dynamicQuery();
dq.add(RestrictionsFactoryUtil.eq("gestita", true));
@Override if(!numeroProgetto.equals("")){
public int countCompletate(String numeroProgetto, String protocollo, String dataDal, String dataAl) dq.add(RestrictionsFactoryUtil.eq("numeroProgetto", numeroProgetto));
throws SystemException { }
return dynamicQuery(dqCompletate(numeroProgetto, protocollo, dataDal, dataAl)).size(); if(!protocollo.equals("")){
}
private DynamicQuery dqCompletate(String numeroProgetto, String protocollo, String dataDal, String dataAl) { Disjunction disjunction = RestrictionsFactoryUtil.disjunction();
disjunction.add(PropertyFactoryUtil.forName("protocolloEntrata").eq(protocollo));
disjunction.add(PropertyFactoryUtil.forName("protocolloUscita").eq(protocollo));
dq.add(disjunction);
}
if(!dataDal.equals("") && !dataAl.equals("")){
Date dateDal = sdf.parse(dataDal);
Calendar calDal = Calendar.getInstance();
calDal.setTime(dateDal);
calDal.set(Calendar.HOUR_OF_DAY, 00);
calDal.set(Calendar.MINUTE, 00);
dateDal = calDal.getTime();
Date dateAl = sdf.parse(dataAl);
Calendar calAl = Calendar.getInstance();
calAl.setTime(dateAl);
calAl.set(Calendar.HOUR_OF_DAY, 23);
calAl.set(Calendar.MINUTE, 59);
dateAl = calAl.getTime();
Property createDateProperty = PropertyFactoryUtil.forName("dtAccettazione");
dq.add(createDateProperty.between(dateDal, dateAl));
}
if(!dataDal.equals("") && dataAl.equals("")){
Date dateDal = sdf.parse(dataDal);
Calendar calDal = Calendar.getInstance();
calDal.setTime(dateDal);
calDal.set(Calendar.HOUR_OF_DAY, 00);
calDal.set(Calendar.MINUTE, 00);
dateDal = calDal.getTime();
Date now = new Date();
Property createDateProperty = PropertyFactoryUtil.forName("dtAccettazione");
dq.add(createDateProperty.between(dateDal, now));
}
if(dataDal.equals("") && !dataAl.equals("")){
Date now = new Date("01/01/2018");
Date dateAl = sdf.parse(dataAl);
Calendar calAl = Calendar.getInstance();
calAl.setTime(dateAl);
calAl.set(Calendar.HOUR_OF_DAY, 23);
calAl.set(Calendar.MINUTE, 59);
dateAl = calAl.getTime();
Property createDateProperty = PropertyFactoryUtil.forName("dtAccettazione");
dq.add(createDateProperty.between(now, dateAl));
}
return richiestaAccessoAttiLocalService.dynamicQuery(dq, start, end);
}
public int countCompletate(String numeroProgetto, String protocollo, String dataDal, String dataAl) throws SystemException, ParseException{
DynamicQuery dq = dynamicQuery(); SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
DynamicQuery dq = richiestaAccessoAttiLocalService.dynamicQuery();
dq.add(RestrictionsFactoryUtil.eq("gestita", true)); dq.add(RestrictionsFactoryUtil.eq("gestita", true));
if (Validator.isNotNull(numeroProgetto)) {
if(!numeroProgetto.equals("")){
dq.add(RestrictionsFactoryUtil.eq("numeroProgetto", numeroProgetto)); dq.add(RestrictionsFactoryUtil.eq("numeroProgetto", numeroProgetto));
} }
if (Validator.isNotNull(protocollo)) {
if(!protocollo.equals("")){
Disjunction disjunction = RestrictionsFactoryUtil.disjunction(); Disjunction disjunction = RestrictionsFactoryUtil.disjunction();
disjunction.add(PropertyFactoryUtil.forName("protocolloEntrata").eq(protocollo)); disjunction.add(PropertyFactoryUtil.forName("protocolloEntrata").eq(protocollo));
disjunction.add(PropertyFactoryUtil.forName("protocolloUscita").eq(protocollo)); disjunction.add(PropertyFactoryUtil.forName("protocolloUscita").eq(protocollo));
dq.add(disjunction); dq.add(disjunction);
} }
dq.add(PropertyFactoryUtil.forName("dtAccettazione").between(parseStartDate(dataDal), parseEndDate(dataAl)));
return dq; if(!dataDal.equals("") && !dataAl.equals("")){
Date dateDal = sdf.parse(dataDal);
Calendar calDal = Calendar.getInstance();
calDal.setTime(dateDal);
calDal.set(Calendar.HOUR_OF_DAY, 00);
calDal.set(Calendar.MINUTE, 00);
dateDal = calDal.getTime();
Date dateAl = sdf.parse(dataAl);
Calendar calAl = Calendar.getInstance();
calAl.setTime(dateAl);
calAl.set(Calendar.HOUR_OF_DAY, 23);
calAl.set(Calendar.MINUTE, 59);
dateAl = calAl.getTime();
Property createDateProperty = PropertyFactoryUtil.forName("dtAccettazione");
dq.add(createDateProperty.between(dateDal, dateAl));
}
if(!dataDal.equals("") && dataAl.equals("")){
Date dateDal = sdf.parse(dataDal);
Calendar calDal = Calendar.getInstance();
calDal.setTime(dateDal);
calDal.set(Calendar.HOUR_OF_DAY, 00);
calDal.set(Calendar.MINUTE, 00);
dateDal = calDal.getTime();
Date now = new Date();
Property createDateProperty = PropertyFactoryUtil.forName("dtAccettazione");
dq.add(createDateProperty.between(dateDal, now));
}
if(dataDal.equals("") && !dataAl.equals("")){
Date now = new Date("01/01/2018");
Date dateAl = sdf.parse(dataAl);
Calendar calAl = Calendar.getInstance();
calAl.setTime(dateAl);
calAl.set(Calendar.HOUR_OF_DAY, 23);
calAl.set(Calendar.MINUTE, 59);
dateAl = calAl.getTime();
Property createDateProperty = PropertyFactoryUtil.forName("dtAccettazione");
dq.add(createDateProperty.between(now, dateAl));
}
List<RichiestaAccessoAtti> lista = richiestaAccessoAttiLocalService.dynamicQuery(dq);
return lista.size();
} }
@Override public RichiestaAccessoAtti findByAccessToken(String accessToken) throws SystemException{
public RichiestaAccessoAtti findByAccessToken(String accessToken) throws SystemException {
DynamicQuery dq = dynamicQuery(); DynamicQuery dq = richiestaAccessoAttiLocalService.dynamicQuery();
dq.add(RestrictionsFactoryUtil.eq("accessToken", accessToken)); dq.add(RestrictionsFactoryUtil.eq("accessToken", accessToken));
@SuppressWarnings("unchecked")
List<RichiestaAccessoAtti> lista = dynamicQuery(dq); List<RichiestaAccessoAtti> lista = richiestaAccessoAttiLocalService.dynamicQuery(dq);
return lista == null || lista.isEmpty() ? null : lista.get(0); if(lista != null && !lista.isEmpty()){
return lista.get(0);
}
return null;
} }
@SuppressWarnings("unchecked") public List<RichiestaAccessoAtti> findRichiesteByGroup(long userId, int start, int end) throws SystemException{
@Override
public List<RichiestaAccessoAtti> findRichiesteByGroup(long userId, int start, int end) throws SystemException { List<Long> listaLong = new ArrayList<Long>();
List<Long> groupIds = new ArrayList<>();
List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrganizations(userId); List<Organization> organizationList = OrganizationLocalServiceUtil.getUserOrganizations(userId);
if (Validator.isNull(organizationList)) { if(organizationList != null && !organizationList.isEmpty()){
for (Organization organization : organizationList) { for (Organization organization : organizationList) {
groupIds.add(organization.getGroupId()); listaLong.add(organization.getGroupId());
} }
} }
DynamicQuery dq = dynamicQuery();
dq.add(RestrictionsFactoryUtil.eq("gestita", false));
if (!groupIds.isEmpty()) {
dq.add(RestrictionsFactoryUtil.in("groupId", groupIds));
}
return dynamicQuery(dq, start, end);
}
private static Date parseEndDate(String input) {
return parseDate(input, false); listaLong.add(0L);
}
private static Date parseStartDate(String input) {
return parseDate(input, true); DynamicQuery dq = richiestaAccessoAttiLocalService.dynamicQuery();
} dq.add(RestrictionsFactoryUtil.eq("gestita", false));
dq.add(RestrictionsFactoryUtil.in("groupId", listaLong));
private static Date parseDate(String input, boolean isStart) { return richiestaAccessoAttiLocalService.dynamicQuery(dq, start, end);
Calendar calendar = Calendar.getInstance();
try {
calendar.setTime(sdf.parse(input));
} catch (ParseException e) {
calendar.setTime(isStart ? new Date(0) : new Date());
}
calendar.set(Calendar.HOUR_OF_DAY, isStart ? 0 : 23);
calendar.set(Calendar.MINUTE, isStart ? 0 : 59);
calendar.set(Calendar.SECOND, isStart ? 0 : 59);
return calendar.getTime();
} }
} }

37
liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/accesso/atti/service/impl/RichiestaAccessoAttiServiceImpl.java

@ -1,9 +1,15 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
* and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software *
* Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in * This library is free software; you can redistribute it and/or modify it under
* the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * the terms of the GNU Lesser General Public License as published by the Free
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. * Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/ */
package it.tref.liferay.portos.accesso.atti.service.impl; package it.tref.liferay.portos.accesso.atti.service.impl;
@ -12,22 +18,23 @@ import it.tref.liferay.portos.accesso.atti.service.base.RichiestaAccessoAttiServ
/** /**
* The implementation of the richiesta accesso atti remote service. * The implementation of the richiesta accesso atti remote service.
*
* <p> * <p>
* All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.accesso.atti.service.RichiestaAccessoAttiService} interface.
* their definitions into the {@link it.tref.liferay.portos.accesso.atti.service.RichiestaAccessoAttiService} interface. *
* <p> * <p>
* This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS * This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS credentials because this service can be accessed remotely.
* credentials because this service can be accessed remotely.
* </p> * </p>
* *
* @author 3F Consulting + Manifattura Web Group s.r.l. * @author 3F Consulting
* @see it.tref.liferay.portos.accesso.atti.service.base.RichiestaAccessoAttiServiceBaseImpl * @see it.tref.liferay.portos.accesso.atti.service.base.RichiestaAccessoAttiServiceBaseImpl
* @see it.tref.liferay.portos.accesso.atti.service.RichiestaAccessoAttiServiceUtil * @see it.tref.liferay.portos.accesso.atti.service.RichiestaAccessoAttiServiceUtil
*/ */
public class RichiestaAccessoAttiServiceImpl extends RichiestaAccessoAttiServiceBaseImpl { public class RichiestaAccessoAttiServiceImpl
extends RichiestaAccessoAttiServiceBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link * NOTE FOR DEVELOPERS:
* it.tref.liferay.portos.accesso.atti.service.RichiestaAccessoAttiServiceUtil} to access the richiesta accesso atti *
* remote service. * Never reference this interface directly. Always use {@link it.tref.liferay.portos.accesso.atti.service.RichiestaAccessoAttiServiceUtil} to access the richiesta accesso atti remote service.
*/ */
} }

32
liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/accesso/atti/uti/AccessoAttiAccessTokenUtil.java

@ -8,24 +8,34 @@ import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.util.StringPool; import com.liferay.portal.kernel.util.StringPool;
public class AccessoAttiAccessTokenUtil { public class AccessoAttiAccessTokenUtil {
private static final Log _log = LogFactoryUtil.getLog(AccessoAttiAccessTokenUtil.class); private static final Log _log = LogFactoryUtil.getLog(AccessoAttiAccessTokenUtil.class);
public static String generateAccessToken(long richiestaAccessoAttiId, String numeroProgetto, long richiedenteUserId) { public static String generateAccessToken(long richiestaAccessoAttiId, String numeroProgetto, long richiedenteUserId){
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
try { try {
String concatString = String.valueOf(richiestaAccessoAttiId) + StringPool.UNDERLINE + numeroProgetto
+ StringPool.UNDERLINE + richiedenteUserId; String concatString = String.valueOf(richiestaAccessoAttiId) + StringPool.UNDERLINE +
numeroProgetto + StringPool.UNDERLINE + richiedenteUserId;
MessageDigest md = MessageDigest.getInstance("MD5"); MessageDigest md = MessageDigest.getInstance("MD5");
md.update(concatString.getBytes()); md.update(concatString.getBytes());
byte byteData[] = md.digest();
for (int i = 0; i < byteData.length; i++) { byte byteData[] = md.digest();
sb.append(Integer.toString((byteData[i] & 0xff) + 0x100, 16).substring(1));
} for (int i = 0; i < byteData.length; i++) {
sb.append(Integer.toString((byteData[i] & 0xff) + 0x100, 16).substring(1));
}
} catch (NoSuchAlgorithmException e) { } catch (NoSuchAlgorithmException e) {
_log.error(e, e); _log.error(e,e);
} }
return sb.toString(); return sb.toString();
} }
} }

57
liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/accesso/atti/uti/DocumentLibraryUtil.java

@ -11,57 +11,68 @@ 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.util.FileUtil; import com.liferay.portal.kernel.util.FileUtil;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.service.ServiceContext; import com.liferay.portal.service.ServiceContext;
import com.liferay.portlet.documentlibrary.model.DLFolder; import com.liferay.portlet.documentlibrary.model.DLFolder;
import com.liferay.portlet.documentlibrary.service.DLAppLocalServiceUtil; import com.liferay.portlet.documentlibrary.service.DLAppLocalServiceUtil;
import com.liferay.portlet.documentlibrary.service.DLFolderLocalServiceUtil; import com.liferay.portlet.documentlibrary.service.DLFolderLocalServiceUtil;
public class DocumentLibraryUtil { public class DocumentLibraryUtil {
public static Log _log = LogFactoryUtil.getLog(DocumentLibraryUtil.class); public static Log _log = LogFactoryUtil.getLog(DocumentLibraryUtil.class);
public static final String RICHIESTA_ATTI_FOLDER_NAME = "RICHIESTA_ATTI"; public static final String RICHIESTA_ATTI_FOLDER_NAME = "RICHIESTA_ATTI";
public static final String PAGAMENTO_CODEC_FILENAME = "PAGAMENTO_"; public static final String PAGAMENTO_CODEC_FILENAME = "PAGAMENTO_";
public static final String DOCUMENTO_CODEC_FILENAME = "DOCUMENTO_"; public static final String DOCUMENTO_CODEC_FILENAME = "DOCUMENTO_";
public static long saveFileEntryAccessoAtti(long companyGroupId, long richiestaAccessoAttiId, public static long saveFileEntryAccessoAtti(long companyGroupId, long richiestaAccessoAttiId, String originFileName,
String originFileName, File file, boolean pagamento) { File file, boolean pagamento) {
long fileEntryId = 0L; long fileEntryId = 0L;
try { try {
DLFolder folder = getRichiestaAttiFolder(companyGroupId); DLFolder folder = getRichiestaAttiFolder(companyGroupId);
if (folder != null) { if(folder != null){
RichiestaAccessoAtti richiestaAccessoAtti = RichiestaAccessoAttiLocalServiceUtil
.fetchRichiestaAccessoAtti(richiestaAccessoAttiId); RichiestaAccessoAtti richiestaAccessoAtti =
if (richiestaAccessoAtti != null) { RichiestaAccessoAttiLocalServiceUtil.fetchRichiestaAccessoAtti(richiestaAccessoAttiId);
if(richiestaAccessoAtti != null){
ServiceContext serviceContext = new ServiceContext(); ServiceContext serviceContext = new ServiceContext();
serviceContext.setCompanyId(richiestaAccessoAtti.getCompanyId()); serviceContext.setCompanyId(richiestaAccessoAtti.getCompanyId());
serviceContext.setUserId(richiestaAccessoAtti.getUserId()); serviceContext.setUserId(richiestaAccessoAtti.getUserId());
String mineType = FileUtil.getExtension(originFileName); String mineType = FileUtil.getExtension(originFileName);
String prefixedFileName = StringPool.BLANK;
if (pagamento) { String prefixedFileName = "";
prefixedFileName = PAGAMENTO_CODEC_FILENAME + richiestaAccessoAttiId + StringPool.PERIOD if(pagamento){
+ mineType; prefixedFileName = PAGAMENTO_CODEC_FILENAME + richiestaAccessoAttiId + "." + mineType;
} else { } else {
prefixedFileName = DOCUMENTO_CODEC_FILENAME + richiestaAccessoAttiId + StringPool.PERIOD prefixedFileName = DOCUMENTO_CODEC_FILENAME + richiestaAccessoAttiId + "." + mineType;
+ mineType;
} }
FileEntry fileEntry = DLAppLocalServiceUtil.addFileEntry(richiestaAccessoAtti.getUserId(),
folder.getRepositoryId(), folder.getFolderId(), prefixedFileName, mineType, FileEntry fileEntry = DLAppLocalServiceUtil.addFileEntry(
prefixedFileName, StringPool.BLANK, StringPool.BLANK, file, serviceContext); richiestaAccessoAtti.getUserId(), folder.getRepositoryId(), folder.getFolderId(),
prefixedFileName, mineType, prefixedFileName, "", "", file, serviceContext);
fileEntryId = fileEntry.getFileEntryId(); fileEntryId = fileEntry.getFileEntryId();
} }
} }
} catch (PortalException | SystemException e) { } catch (PortalException | SystemException e) {
_log.error(e, e); _log.error(e,e);
} }
return fileEntryId; return fileEntryId;
} }
private static DLFolder getRichiestaAttiFolder(long companyGroupId) throws PortalException, SystemException { private static DLFolder getRichiestaAttiFolder(long companyGroupId) throws PortalException, SystemException{
DLFolder folder = DLFolderLocalServiceUtil.getFolder(companyGroupId, 0L, RICHIESTA_ATTI_FOLDER_NAME); DLFolder folder = DLFolderLocalServiceUtil.getFolder(companyGroupId, 0L, RICHIESTA_ATTI_FOLDER_NAME);
return folder; return folder;
} }
} }

142
liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/accesso/atti/uti/EmailSenderUtil.java

@ -12,127 +12,187 @@ import com.liferay.portal.kernel.mail.MailMessage;
public class EmailSenderUtil { public class EmailSenderUtil {
public static void sendAcceptedEmail(long richiestaAccessoAttiId, String testoAggiuntivo) throws SystemException, // private static final Log _log = LogFactoryUtil.getLog(EmailSenderUtil.class);
AddressException {
public static void sendAcceptedEmail(long richiestaAccessoAttiId, String testoAggiuntivo) throws SystemException, AddressException{
RichiestaAccessoAtti richiestaAccessoAtti = RichiestaAccessoAttiLocalServiceUtil
.fetchRichiestaAccessoAtti(richiestaAccessoAttiId); RichiestaAccessoAtti richiestaAccessoAtti = RichiestaAccessoAttiLocalServiceUtil.fetchRichiestaAccessoAtti(richiestaAccessoAttiId);
if (richiestaAccessoAtti != null) { if(richiestaAccessoAtti != null){
InternetAddress toAddress = new InternetAddress(richiestaAccessoAtti.getEmailRicontatto()); InternetAddress toAddress = new InternetAddress(richiestaAccessoAtti.getEmailRicontatto());
InternetAddress fromAddress = new InternetAddress("portos@regione.toscana.it"); InternetAddress fromAddress = new InternetAddress("portos@regione.toscana.it");
MailMessage mailMessage = new MailMessage(); MailMessage mailMessage = new MailMessage();
mailMessage.setTo(toAddress); mailMessage.setTo(toAddress);
mailMessage.setFrom(fromAddress); mailMessage.setFrom(fromAddress);
mailMessage.setSubject("Notifica Accettazione Richiesta Accesso Atti"); mailMessage.setSubject("Notifica Accettazione Richiesta Accesso Atti");
mailMessage.setBody(creaCorpoMailRichiestaAccettata(richiestaAccessoAtti, testoAggiuntivo)); mailMessage.setBody(creaCorpoMailRichiestaAccettata(richiestaAccessoAtti,testoAggiuntivo));
mailMessage.setHTMLFormat(true); mailMessage.setHTMLFormat(true);
/*
* Invio email
*/
MailServiceUtil.sendEmail(mailMessage); MailServiceUtil.sendEmail(mailMessage);
} }
} }
public static void sendDeniedEmail(long richiestaAccessoAttiId, String motivoRifiuto) throws SystemException, public static void sendDeniedEmail(long richiestaAccessoAttiId, String motivoRifiuto) throws SystemException, AddressException{
AddressException {
RichiestaAccessoAtti richiestaAccessoAtti = RichiestaAccessoAttiLocalServiceUtil.fetchRichiestaAccessoAtti(richiestaAccessoAttiId);
RichiestaAccessoAtti richiestaAccessoAtti = RichiestaAccessoAttiLocalServiceUtil if(richiestaAccessoAtti != null){
.fetchRichiestaAccessoAtti(richiestaAccessoAttiId);
if (richiestaAccessoAtti != null) {
InternetAddress toAddress = new InternetAddress(richiestaAccessoAtti.getEmailRicontatto()); InternetAddress toAddress = new InternetAddress(richiestaAccessoAtti.getEmailRicontatto());
InternetAddress fromAddress = new InternetAddress("portos@regione.toscana.it"); InternetAddress fromAddress = new InternetAddress("portos@regione.toscana.it");
MailMessage mailMessage = new MailMessage(); MailMessage mailMessage = new MailMessage();
mailMessage.setTo(toAddress); mailMessage.setTo(toAddress);
mailMessage.setFrom(fromAddress); mailMessage.setFrom(fromAddress);
mailMessage.setSubject("Notifica Rifiuto Richiesta Accesso Atti"); mailMessage.setSubject("Notifica Rifiuto Richiesta Accesso Atti");
mailMessage.setBody(creaCorpoMailRichiestaRifiutata(richiestaAccessoAtti, motivoRifiuto)); mailMessage.setBody(creaCorpoMailRichiestaRifiutata(richiestaAccessoAtti, motivoRifiuto));
mailMessage.setHTMLFormat(true); mailMessage.setHTMLFormat(true);
/*
* Invio email
*/
MailServiceUtil.sendEmail(mailMessage); MailServiceUtil.sendEmail(mailMessage);
} }
} }
public static void sendAcceptedRequest(long richiestaAccessoAttiId) throws SystemException, AddressException { public static void sendAcceptedRequest(long richiestaAccessoAttiId) throws SystemException, AddressException{
RichiestaAccessoAtti richiestaAccessoAtti = RichiestaAccessoAttiLocalServiceUtil RichiestaAccessoAtti richiestaAccessoAtti = RichiestaAccessoAttiLocalServiceUtil.fetchRichiestaAccessoAtti(richiestaAccessoAttiId);
.fetchRichiestaAccessoAtti(richiestaAccessoAttiId); if(richiestaAccessoAtti != null){
if (richiestaAccessoAtti != null) {
InternetAddress toAddress = new InternetAddress(richiestaAccessoAtti.getEmailRicontatto()); InternetAddress toAddress = new InternetAddress(richiestaAccessoAtti.getEmailRicontatto());
InternetAddress fromAddress = new InternetAddress("portos@regione.toscana.it"); InternetAddress fromAddress = new InternetAddress("portos@regione.toscana.it");
MailMessage mailMessage = new MailMessage(); MailMessage mailMessage = new MailMessage();
mailMessage.setTo(toAddress); mailMessage.setTo(toAddress);
mailMessage.setFrom(fromAddress); mailMessage.setFrom(fromAddress);
mailMessage.setSubject("Notifica Presa In Carico Richiesta"); mailMessage.setSubject("Notifica Presa In Carico Richiesta");
mailMessage.setBody(creaCorpoMailRichiestaInCarico(richiestaAccessoAtti)); mailMessage.setBody(creaCorpoMailRichiestaInCarico(richiestaAccessoAtti));
mailMessage.setHTMLFormat(true); mailMessage.setHTMLFormat(true);
/*
* Invio email
*/
MailServiceUtil.sendEmail(mailMessage); MailServiceUtil.sendEmail(mailMessage);
} }
} }
private static String creaCorpoMailRichiestaInCarico(RichiestaAccessoAtti richiestaAccessoAtti) { private static String creaCorpoMailRichiestaInCarico(RichiestaAccessoAtti richiestaAccessoAtti){
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
/*
* Gestione header
*/
sb.append("<html><head><title>Notifica Presa In Carico Richiesta</title></head><body>"); sb.append("<html><head><title>Notifica Presa In Carico Richiesta</title></head><body>");
sb.append("<div style='width:100%;'>"); sb.append("<div style='width:100%;'>");
sb.append("Salve ,"); sb.append("Salve ,");
sb.append("</div>"); sb.append("</div>");
sb.append("<br/>"); sb.append("<br/>");
sb.append("<div style='width:100%;'>"); sb.append("<div style='width:100%;'>");
sb.append("con la seguente email le comunichiamo che la sua richiesta n. "); sb.append("con la seguente email le comunichiamo che la sua richiesta n. ");
sb.append(richiestaAccessoAtti.getProtocolloEntrata()); sb.append(richiestaAccessoAtti.getProtocolloEntrata());
sb.append(" di accedere all'atto numero "); sb.append(" di accedere all'atto numero ");
sb.append(richiestaAccessoAtti.getNumeroProgetto()); sb.append(richiestaAccessoAtti.getNumeroProgetto());
sb.append(" è stata presa in carico dai nostri funzionari. Riceverà successivamente una mail nella quale le verrà indicato l'esito della sua richiesta."); sb.append(" è stata presa in carico dai nostri funzionari. Riceverà successivamente una mail nella quale le verrà indicato l'esito della sua richiesta.");
sb.append("<br/>"); sb.append("<br/>");
sb.append("<br/>"); sb.append("<br/>");
return sb.toString(); return sb.toString();
} }
private static String creaCorpoMailRichiestaAccettata(RichiestaAccessoAtti richiestaAccessoAtti, String testoExtra) { private static String creaCorpoMailRichiestaAccettata(RichiestaAccessoAtti richiestaAccessoAtti, String testoExtra){
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
/*
* Gestione header
*/
sb.append("<html><head><title>Notifica Accettazione Richiesta Accesso Atti</title></head><body>"); sb.append("<html><head><title>Notifica Accettazione Richiesta Accesso Atti</title></head><body>");
sb.append("<div style='width:100%;'>"); sb.append("<div style='width:100%;'>");
sb.append("Salve ,"); sb.append("Salve ,");
sb.append("</div>"); sb.append("</div>");
sb.append("<br/>"); sb.append("<br/>");
sb.append("<div style='width:100%;'>"); sb.append("<div style='width:100%;'>");
sb.append("con la seguente email le comunichiamo che la sua richiesta n. "); sb.append("con la seguente email le comunichiamo che la sua richiesta n. ");
sb.append(richiestaAccessoAtti.getProtocolloUscita()); sb.append(richiestaAccessoAtti.getProtocolloUscita());
sb.append(" di accedere all'atto numero "); sb.append(" di accedere all'atto numero ");
sb.append(richiestaAccessoAtti.getNumeroProgetto()); sb.append(richiestaAccessoAtti.getNumeroProgetto());
sb.append(" è stata accettata."); sb.append(" è stata accettata.");
sb.append("<br/>"); sb.append("<br/>");
sb.append("<div style='width:100%;'>"); sb.append("<div style='width:100%;'>");
sb.append("Il suo codice di accesso al fascicolo è il seguente: <strong>"); sb.append("Il suo codice di accesso al fascicolo è il seguente: <strong>");
sb.append(richiestaAccessoAtti.getAccessToken()); sb.append(richiestaAccessoAtti.getAccessToken());
sb.append("</strong>"); sb.append("</strong>");
sb.append("</div>"); sb.append("</div>");
sb.append("<br/>"); sb.append("<br/>");
sb.append("<div style='width:100%;'>"); sb.append("<div style='width:100%;'>");
sb.append(testoExtra); sb.append(testoExtra);
sb.append("</div>"); sb.append("</div>");
sb.append("<br/>"); sb.append("<br/>");
sb.append("<div style='width:100%;'>"); sb.append("<div style='width:100%;'>");
sb.append("Le ricordiamo che l'accesso avrà una validità di 7 giorni."); sb.append("Le ricordiamo che l'accesso avrà una validità di 7 giorni.");
sb.append("</div>"); sb.append("</div>");
sb.append("<br/>"); sb.append("<br/>");
return sb.toString(); return sb.toString();
} }
private static String creaCorpoMailRichiestaRifiutata(RichiestaAccessoAtti richiestaAccessoAtti, public static void sendDeniedEmail(){
String motivoRifiuto) {
}
private static String creaCorpoMailRichiestaRifiutata(RichiestaAccessoAtti richiestaAccessoAtti, String motivoRifiuto){
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
/*
* Gestione header
*/
sb.append("<html><head><title>Notifica Rifiuto Richiesta Accesso Atti</title></head><body>"); sb.append("<html><head><title>Notifica Rifiuto Richiesta Accesso Atti</title></head><body>");
sb.append("<div style='width:100%;'>"); sb.append("<div style='width:100%;'>");
sb.append("Salve ,"); sb.append("Salve ,");
sb.append("</div>"); sb.append("</div>");
sb.append("<br/>"); sb.append("<br/>");
sb.append("<div style='width:100%;'>"); sb.append("<div style='width:100%;'>");
sb.append("con la seguente email le comunichiamo che la sua richiesta n. "); sb.append("con la seguente email le comunichiamo che la sua richiesta n. ");
sb.append(richiestaAccessoAtti.getProtocolloUscita()); sb.append(richiestaAccessoAtti.getProtocolloUscita());
sb.append(" di accedere all'atto numero "); sb.append(" di accedere all'atto numero ");
sb.append(richiestaAccessoAtti.getNumeroProgetto()); sb.append(richiestaAccessoAtti.getNumeroProgetto());
sb.append(" è stata rifiutata per la seguente motivazione: "); sb.append(" è stata rifiutata per la seguente motivazione: ");
sb.append(motivoRifiuto); sb.append(motivoRifiuto);
sb.append("<br/>"); sb.append("<br/>");
return sb.toString(); return sb.toString();
} }
} }

246
liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_bo/add_richiesta.jsp

@ -1,74 +1,80 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="init.jsp" %> <%@include file="init.jsp" %>
<div style="width: 30%">
<div style="width:30%;">
<liferay-ui:error key="atto-non-esistente" message="Nessun atto trovato per questo numero progetto" /> <liferay-ui:error key="atto-non-esistente" message="Nessun atto trovato per questo numero progetto" />
</div> </div>
<liferay-portlet:actionURL name="aggiungiRichiestaBO" var="aggiungiRichiestaBOURL"> <liferay-portlet:actionURL name="aggiungiRichiestaBO" var="aggiungiRichiestaBOURL">
<liferay-portlet:param name="tabs1" value="Aggiungi Richiesta" /> <liferay-portlet:param name="tabs1" value="Aggiungi Richiesta" />
</liferay-portlet:actionURL> </liferay-portlet:actionURL>
<aui:form name="fmDomande" action="<%= aggiungiRichiestaBOURL %>" method="POST" enctype="multipart/form-data">
<div class="row-fluid" style="margin-top: 10px"> <aui:form name="fmDomande" action="<%=aggiungiRichiestaBOURL %>" method="POST" enctype="multipart/form-data" >
<div class="row-fluid" style="margin-top: 10px;">
<div class="span3"> <div class="span3">
<aui:input name="emailRicontatto" label="Email per il ricontatto"> <aui:input name="emailRicontatto" label="Email per il ricontatto">
<aui:validator name="required" /> <aui:validator name="required" />
<aui:validator name="email" /> <aui:validator name="email"/>
</aui:input> </aui:input>
</div> </div>
<div class="span3"> <div class="span3">
<aui:input name="codiceFiscale" label="Codice Fiscale Utente" max="16" min="16"> <aui:input name="codiceFiscale" label="Codice Fiscale Utente" max="16" min="16">
<aui:validator name="custom" errorMessage="campo-richiesto"> <aui:validator name="custom" errorMessage="campo-richiesto" >
function (val, fieldNode, ruleValue) { function (val, fieldNode, ruleValue) {
return fieldNode.get('disabled') || (val != null && val != ''); return fieldNode.get('disabled') || (val != null && val!='');
}
</aui:validator>
<aui:validator name="custom" errorMessage="campo-non-valido">
function (val, fieldNode, ruleValue) {
if (fieldNode.get('disabled')) {
return true;
} }
var regex = '^[A-Za-z]{6}[0-9]{2}[A-Za-z]{1}[0-9]{2}[A-Za-z]{1}[0-9]{3}[A-Za-z]{1}$'; </aui:validator>
var regex1 = /^(?:[B-DF-HJ-NP-TV-Z](?:[AEIOU]{2}|[AEIOU]X)|[AEIOU]{2}X|[B-DF-HJ-NP-TV-Z]{2}[A-Z]){2}[\dLMNP-V]{2}(?:[A-EHLMPR-T](?:[04LQ][1-9MNP-V]|[1256LMRS][\dLMNP-V])|[DHPS][37PT][0L]|[ACELMRT][37PT][01LM])(?:[A-MZ][1-9MNP-V][\dLMNP-V]{2}|[A-M][0L](?:[\dLMNP-V][1-9MNP-V]|[1-9MNP-V][0L]))[A-Z]$/i;
var regexObj = new RegExp (regex1); <aui:validator name="custom" errorMessage="campo-non-valido" >
var result = regexObj.test(val); function (val, fieldNode, ruleValue) {
return result; if(fieldNode.get('disabled')){
} return true;
</aui:validator> }
</aui:input> var regex = '^[A-Za-z]{6}[0-9]{2}[A-Za-z]{1}[0-9]{2}[A-Za-z]{1}[0-9]{3}[A-Za-z]{1}$';
var regex1 = /^(?:[B-DF-HJ-NP-TV-Z](?:[AEIOU]{2}|[AEIOU]X)|[AEIOU]{2}X|[B-DF-HJ-NP-TV-Z]{2}[A-Z]){2}[\dLMNP-V]{2}(?:[A-EHLMPR-T](?:[04LQ][1-9MNP-V]|[1256LMRS][\dLMNP-V])|[DHPS][37PT][0L]|[ACELMRT][37PT][01LM])(?:[A-MZ][1-9MNP-V][\dLMNP-V]{2}|[A-M][0L](?:[\dLMNP-V][1-9MNP-V]|[1-9MNP-V][0L]))[A-Z]$/i;
var regexObj = new RegExp (regex1);
var result = regexObj.test(val);
return result;
}
</aui:validator>
</aui:input>
</div> </div>
</div> </div>
<div class="row-fluid" style="margin-top: 10px"> <div class="row-fluid" style="margin-top: 10px;">
<div class="span3"> <div class="span3">
<aui:input name="numeroProgetto" label="Numero Progetto" style="width: 50%"> <aui:input name="numeroProgetto" label="Numero Progetto" style="width:50%;">
<aui:validator name="required" /> <aui:validator name="required" />
<aui:validator name="digits" /> <aui:validator name="digits" />
</aui:input> </aui:input>
</div> </div>
<div class="span3"> <div class="span3">
<aui:input name="dataVidimazione" cssClass="calendarDatepicker" label="Data di vidimazione" <aui:input name="dataVidimazione" cssClass="calendarDatepicker" label="Data di vidimazione" style="width:50%;">
style="width: 50%">
<aui:validator name="required" /> <aui:validator name="required" />
</aui:input> </aui:input>
</div> </div>
<div class="span3"> <div class="span3">
<div style="margin-top: 7%"> <div style="margin-top: 7%;">
<aui:input name="sanatoria" type="checkbox" label="Trattasi di Sanatoria" /> <aui:input name="sanatoria" type="checkbox" label="Trattasi di Sanatoria" />
</div> </div>
</div> </div>
<div class="span3"> <div class="span3">
<div style="margin-top: 7%"> <div style="margin-top: 7%;">
<aui:input name="dataSanatoria" cssClass="calendarDatepicker" label="Data Sanatoria" <aui:input name="dataSanatoria" cssClass="calendarDatepicker" label="Data Sanatoria" style="width:50%;" >
style="width: 50%" >
<aui:validator name="custom" errorMessage="campo-richiesto" > <aui:validator name="custom" errorMessage="campo-richiesto" >
function (val, fieldNode, ruleValue) { function (val, fieldNode, ruleValue) {
var A = AUI(); var A = AUI();
var checkValue = true;
var checkValue = true;
var portletNamespace = '<portlet:namespace/>'; var portletNamespace = '<portlet:namespace/>';
var sanatorie = A.one("#" + portletNamespace + "sanatoria").val(); var sanatorie = A.one("#"+portletNamespace + "sanatoria").val();
if (sanatorie == "true") {
if (val == "") { if(sanatorie == "true"){
if(val == ""){
checkValue = false; checkValue = false;
} }
} }
return checkValue; return checkValue;
} }
</aui:validator> </aui:validator>
@ -76,97 +82,100 @@
</div> </div>
</div> </div>
</div> </div>
<div class="row-fluid" style="margin-top: 10px"> <div class="row-fluid" style="margin-top: 10px;">
<div class="span12"> <div class="span12">
<div style="margin-top: 10px;margin-bottom: 10px;font-weight: bold">Tipologia Soggetto</div> <div style="margin-top: 10px;margin-bottom: 10px;font-weight: bold;">Tipologia Soggetto</div>
<div> <div>
<aui:input checked="true" inlineField="true" inlineLabel="right" name="qualitaPersona" type="radio" <aui:input checked="true" inlineField="true" inlineLabel="right" name="qualitaPersona" value="committente" type="radio" label="Proprietario/committente" />
value="committente" label="Proprietario/committente" /> <aui:input inlineField="true" inlineLabel="right" name="qualitaPersona" value="progettista" type="radio" label="Progettista/collaudatore" />
<aui:input inlineField="true" inlineLabel="right" name="qualitaPersona" type="radio" <aui:input inlineField="true" inlineLabel="right" name="qualitaPersona" value="impresa" type="radio" label="Impresa" />
value="progettista" label="Progettista/collaudatore" /> <aui:input inlineField="true" inlineLabel="right" name="qualitaPersona" value="autorita" type="radio" label="Autorità giudiziaria/CTU" />
<aui:input inlineField="true" inlineLabel="right" name="qualitaPersona" type="radio" <aui:input inlineField="true" inlineLabel="right" name="qualitaPersona" value="confinanti" type="radio" label="Confinante/vicini" />
value="impresa" label="Impresa" /> <aui:input inlineField="true" inlineLabel="right" name="qualitaPersona" value="ctp" type="radio" label="CTP" />
<aui:input inlineField="true" inlineLabel="right" name="qualitaPersona" type="radio" <aui:input inlineField="true" inlineLabel="right" name="qualitaPersona" value="altriSoggetti" type="radio" label="Altro soggetto" />
value="autorita" label="Autorità giudiziaria/CTU" />
<aui:input inlineField="true" inlineLabel="right" name="qualitaPersona" type="radio"
value="confinanti" label="Confinante/vicini" />
<aui:input inlineField="true" inlineLabel="right" name="qualitaPersona" type="radio"
value="ctp" label="CTP" />
<aui:input inlineField="true" inlineLabel="right" name="qualitaPersona" type="radio"
value="altriSoggetti" label="Altro soggetto" />
</div> </div>
</div> </div>
</div> </div>
<div class="row-fluid"> <div class="row-fluid">
<div class="span3"> <div class="span3">
<div style="margin-top: 10px;margin-bottom: 10px;font-weight: bold">Tipologia Richiesta</div> <div style="margin-top: 10px;margin-bottom: 10px;font-weight: bold;">Tipologia Richiesta</div>
<div> <div>
<aui:input cssClass="visione" checked="true" inlineField="true" inlineLabel="right" name="visione" <aui:input cssClass="visione" checked="true" inlineField="true" inlineLabel="right" name="visione" value="visione" type="radio" label="Prendere visione" onClick="hideDettaglio();" />
value="visione" type="radio" label="Prendere visione" onClick="hideDettaglio();" /> <aui:input cssClass="visione" inlineField="true" inlineLabel="right" name="visione" value="copia" type="radio" label="Estrarre copia" onClick="showDettaglio();" />
<aui:input cssClass="visione" inlineField="true" inlineLabel="right" name="visione" value="copia"
type="radio" label="Estrarre copia" onClick="showDettaglio();" />
</div> </div>
</div> </div>
<div class="span4" id="optionContainerCopia" style="display: none"> <div class="span4" id="optionContainerCopia" style="display:none;">
<div style="margin-top: 10px;margin-bottom: 10px;font-weight: bold">&nbsp;</div> <div style="margin-top: 10px;margin-bottom: 10px;font-weight: bold;">&nbsp;</div>
<div> <div>
<aui:input checked="true" inlineField="true" inlineLabel="right" name="copiaDett" value="semplice" <aui:input checked="true" inlineField="true" inlineLabel="right" name="copiaDett" value="semplice" type="radio" label="Semplice"/>
type="radio" label="Semplice"/> <aui:input inlineField="true" inlineLabel="right" name="copiaDett" value="autentica" type="radio" label="Autentica (da assoggettare ad imposta di bollo)" />
<aui:input inlineField="true" inlineLabel="right" name="copiaDett" value="autentica" type="radio"
label="Autentica (da assoggettare ad imposta di bollo)" />
</div> </div>
</div> </div>
</div> </div>
<div class="row-fluid" style="margin-top: 10px"> <div class="row-fluid" style="margin-top: 10px;">
<div class="span12"> <div class="span12">
<aui:input name="motivazione" type="textarea" label="Motivazione della richiesta" /> <aui:input name="motivazione" type="textarea" label="Motivazione della richiesta" />
</div> </div>
</div> </div>
<div class="row-fluid" style="margin-top: 10px"> <div class="row-fluid" style="margin-top: 10px;">
<div class="span12"> <div class="span12">
<aui:input name="documentoIdentita" type="file" label="Documento d'identità" > <aui:input name="documentoIdentita" type="file" label="Documento d'identità" >
<aui:validator name="required" /> <aui:validator name="required" />
</aui:input> </aui:input>
</div> </div>
</div> </div>
<div class="row-fluid" style="margin-top: 10px">
<div class="row-fluid" style="margin-top: 10px;">
<div class="span12"> <div class="span12">
<aui:input name="allegatoPagamento" type="file" label="Allegato pagamento" > <aui:input name="allegatoPagamento" type="file" label="Allegato pagamento" >
<aui:validator name="custom" errorMessage="campo-richiesto" > <aui:validator name="custom" errorMessage="campo-richiesto" >
function (val, fieldNode, ruleValue) { function (val, fieldNode, ruleValue) {
var A = AUI(); var A = AUI();
var checkValue = true;
var portletNamespace = '<portlet:namespace/>'; var checkValue = true;
var dataVidimazione = A.one("#" + portletNamespace + "dataVidimazione").val(); var portletNamespace = '<portlet:namespace/>';
var sanatorie = A.one("#"+portletNamespace + "sanatoria").val(); var dataVidimazione = A.one("#"+portletNamespace + "dataVidimazione").val();
if (sanatorie == "true") { var sanatorie = A.one("#"+portletNamespace + "sanatoria").val();
checkValue = false;
} if(sanatorie == "true"){
if (dataVidimazione != "") { checkValue = false;
var checkDateFixed = "01/01/2015"; }
var checkDateFixed = new Date(checkDateFixed);
var vidimazioneDate = new Date(dataVidimazione); if(dataVidimazione != ""){
if (vidimazioneDate <= checkDateFixed) { var checkDateFixed = "01/01/2015";
checkValue = false; var checkDateFixed = new Date(checkDateFixed);
}
} var vidimazioneDate = new Date(dataVidimazione);
if (!checkValue) {
if (val != "") { if(vidimazioneDate <= checkDateFixed){
return true; checkValue = false;
} }
} }
return checkValue;
if(!checkValue){
if(val != ""){
return true;
}
}
return checkValue;
} }
</aui:validator> </aui:validator>
</aui:input> </aui:input>
</div> </div>
</div> </div>
<div class="row-fluid" style="margin-top: 10px">
<div class="row-fluid" style="margin-top: 10px;">
<div class="span12"> <div class="span12">
<aui:button type="submit" value="Richiedi Atto" /> <aui:button type="submit" value="Richiedi Atto" />
</div> </div>
</div> </div>
</aui:form> </aui:form>
<script type="text/javascript"> <script type="text/javascript">
function hideDettaglio(){ function hideDettaglio(){
AUI().one('#optionContainerCopia').hide(); AUI().one('#optionContainerCopia').hide();
@ -175,29 +184,42 @@ function hideDettaglio(){
function showDettaglio(){ function showDettaglio(){
AUI().one('#optionContainerCopia').show(); AUI().one('#optionContainerCopia').show();
} }
</script> </script>
<aui:script use="aui-base"> <aui:script use="aui-base">
YUI().use('aui-datepicker', function(Y) {
var datepicker = new Y.DatePicker({
trigger: '.calendarDatepicker', YUI().use(
calendar: { 'aui-datepicker',
dateFormat: 'dd/MM/yyyy', function(Y) {
}, var datepicker = new Y.DatePicker(
mask: '%d/%m/%Y', {
popover: { trigger: '.calendarDatepicker',
toolbars: { calendar: {
header: [[{ dateFormat: 'dd/MM/yyyy',
icon: 'icon-trash', },
label: Liferay.Language.get("Cancella"), mask: '%d/%m/%Y',
on: { popover: {
click: function() { toolbars: {
datepicker.clearSelection(); header: [[
} {
} icon: 'icon-trash',
}]] label: Liferay.Language.get("Cancella"),
}, on: {
zIndex: 1 click: function() {
} datepicker.clearSelection();
}); }
}); }
</aui:script> }
]]
},
zIndex: 1
}
}
);
}
);
</aui:script>

478
liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_fe/visualizza-atto.jsp

@ -1,13 +1,22 @@
<%@page import="com.liferay.portal.kernel.util.HtmlUtil"%>
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.liferay.portos.bo.util.SoggettiUtil"%>
<%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%> <%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%>
<%@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.accesso.atti.model.RichiestaAccessoAtti"%> <%@page import="it.tref.liferay.portos.accesso.atti.model.RichiestaAccessoAtti"%>
<%@page import="it.tref.liferay.portos.accesso.atti.service.RichiestaAccessoAttiLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.accesso.atti.service.RichiestaAccessoAttiLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.util.AzioniPraticheUtil"%>
<%@page import="com.liferay.portal.kernel.servlet.ServletContextPool"%>
<%@page import="it.tref.liferay.portos.bo.util.PagamentiCommonUtil"%>
<%@page import="java.text.NumberFormat"%>
<%@page import="java.math.BigDecimal"%>
<%@page import="java.util.Date"%> <%@page import="java.util.Date"%>
<%@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.service.SoggettoLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.DettPraticaServiceUtil"%>
<%@page import="com.liferay.portal.kernel.util.KeyValuePair"%>
<%@page import="it.tref.liferay.portos.bo.service.ProvinciaLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.service.ProvinciaLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.ComuneLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.service.ComuneLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.TerritorioLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.service.TerritorioLocalServiceUtil"%>
@ -16,125 +25,135 @@
<%@page import="it.tref.liferay.portos.bo.model.Territorio"%> <%@page import="it.tref.liferay.portos.bo.model.Territorio"%>
<%@page import="it.tref.liferay.portos.bo.model.IntPratica"%> <%@page import="it.tref.liferay.portos.bo.model.IntPratica"%>
<%@page import="it.tref.liferay.portos.bo.model.DettPratica"%> <%@page import="it.tref.liferay.portos.bo.model.DettPratica"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.regex.Pattern"%> <%@page import="java.util.regex.Pattern"%>
<%@page import="com.liferay.portal.kernel.bean.BeanPropertiesUtil"%> <%@page import="com.liferay.portal.kernel.bean.BeanPropertiesUtil"%>
<%@include file="init.jsp" %> <%@include file="init.jsp" %>
<% <%
long accessoAttiId = ParamUtil.getLong(request, "accessoAttiId" , 0L); long accessoAttiId = ParamUtil.getLong(request, "accessoAttiId" , 0L);
%> %>
<div style="width:30%">
<div style="width:30%;">
<liferay-ui:error key="no-atto-trovato" message="Nessun atto trovato per questa richiesta" /> <liferay-ui:error key="no-atto-trovato" message="Nessun atto trovato per questa richiesta" />
<liferay-ui:error key="accesso-token-invalido" message="Access Token non valido" /> <liferay-ui:error key="accesso-token-invalido" message="Access Token non valido" />
<liferay-ui:error key="accesso-token-scaduto" message="Access Token scaduto" /> <liferay-ui:error key="accesso-token-scaduto" message="Access Token scaduto" />
</div> </div>
<c:if test="<%= accessoAttiId == 0L %>">
<c:if test="<%=accessoAttiId == 0L %>">
<liferay-portlet:actionURL name="visualizzaAtto" var="visualizzaAttoURL" /> <liferay-portlet:actionURL name="visualizzaAtto" var="visualizzaAttoURL" />
<aui:form action="<%=visualizzaAttoURL %>"> <aui:form action="<%=visualizzaAttoURL %>">
<div class="row-fluid" style="margin-top: 10px;"> <div class="row-fluid" style="margin-top: 10px;">
<div class="span12"> <div class="span12">
<aui:input name="accessToken" label="Codice di Accesso " style="width:20%"> <aui:input name="accessToken" label="Codice di Accesso " style="width:20%;">
<aui:validator name="required" /> <aui:validator name="required" />
</aui:input> </aui:input>
</div> </div>
</div> </div>
<div class="row-fluid" style="margin-top: 10px"> <div class="row-fluid" style="margin-top: 10px;">
<div class="span12"> <div class="span12">
<aui:button type="submit" value="Visualizza Atto" /> <aui:button type="submit" value="Visualizza Atto" />
</div> </div>
</div> </div>
</aui:form> </aui:form>
</c:if> </c:if>
<c:if test="<%=accessoAttiId != 0L %>"> <c:if test="<%=accessoAttiId != 0L %>">
<% <%
RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichiestaAccessoAtti(accessoAttiId); RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichiestaAccessoAtti(accessoAttiId);
%> %>
<c:if test="<%= accettoAtti.getIntPraticaId() != 0L %>"> <c:if test="<%=accettoAtti.getIntPraticaId() != 0L %>">
<%
long intPraticaId = accettoAtti.getIntPraticaId(); <%
long dettPraticaId = ParamUtil.getLong(request, "dettPraticaId", 0); long intPraticaId = accettoAtti.getIntPraticaId();
DettPratica dettPratica = null; long dettPraticaId = ParamUtil.getLong(request, "dettPraticaId", 0l);
IntPratica intPratica = null;
if (intPraticaId != 0) { DettPratica dettPratica = null;
intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId); IntPratica intPratica = null;
if (dettPraticaId != 0) { if(intPraticaId !=0l ){
dettPratica = DettPraticaLocalServiceUtil.getDettPratica(dettPraticaId); intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId);
} else { if(dettPraticaId != 0l){
dettPratica = DettPraticaLocalServiceUtil.getLastEditableByIntPratica(intPraticaId); dettPratica = DettPraticaLocalServiceUtil.getDettPratica(dettPraticaId);
if (dettPratica == null) { } else {
dettPratica = DettPraticaLocalServiceUtil.getLastCompletedByIntPratica(intPraticaId); dettPratica = DettPraticaLocalServiceUtil.getLastEditableByIntPratica(intPraticaId);
} if(dettPratica==null){
dettPraticaId = dettPratica.getDettPraticaId(); dettPratica = DettPraticaLocalServiceUtil.getLastCompletedByIntPratica(intPraticaId);
}
} }
Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId()); dettPraticaId = dettPratica.getDettPraticaId();
Comune comune = ComuneLocalServiceUtil.getComune(territorio.getComuneId()); }
Provincia provincia = ProvinciaLocalServiceUtil.fetchByC_C(territorio.getCompanyId(), }
territorio.getCodiceProvincia());
%> Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId());
<liferay-ui:error key="error-download-pdf-domanda" message="error-download-pdf-domanda" /> Comune comune = ComuneLocalServiceUtil.getComune(territorio.getComuneId());
<liferay-portlet:actionURL name="salvaStampaPratica" var="salvaStampaPraticaURL"> Provincia provincia = ProvinciaLocalServiceUtil.fetchByC_C(territorio.getCompanyId(), territorio.getCodiceProvincia());
<liferay-portlet:param name="intPraticaId" value="<%= String.valueOf(intPraticaId) %>"/> %>
<liferay-portlet:param name="mvcPath" value="/html/fascicolofe/view_fascicolo_dettagli.jsp"/>
</liferay-portlet:actionURL> <liferay-ui:error key="error-download-pdf-domanda" message="error-download-pdf-domanda" />
<h3><%= intPratica.getTitle(true) %></h3>
<liferay-ui:panel-container extended="true" id="outerPanelContainer"> <liferay-portlet:actionURL name="salvaStampaPratica" var="salvaStampaPraticaURL">
<div class="row"> <liferay-portlet:param name="intPraticaId" value="<%=String.valueOf(intPraticaId) %>"/>
<div class="col-sm-12"> <liferay-portlet:param name="mvcPath" value="/html/fascicolofe/view_fascicolo_dettagli.jsp"/>
<div class="module-group"> </liferay-portlet:actionURL>
<liferay-ui:panel extended="false" defaultState="open" collapsible="false"
title="fascicolo_title_decreto_min"> <%-- <aui:form name="fm_salvaStampa" action="<%=salvaStampaPraticaURL %>" method="post"> --%>
<div class="container-fluid"> <%-- <aui:button cssClass="pull-right" type="submit" value="Stampa" icon="icon-print" iconAlign="left"/> --%>
<div class="row"> <%-- </aui:form> --%>
<div class="col-sm-6 col-md-3">
<%= LanguageUtil.get(pageContext, "dp-zona-sismica") %> <h3><%=intPratica.getTitle(true) %></h3>
</div>
<div class="col-sm-6 col-md-3"> <liferay-ui:panel-container extended="true" id="outerPanelContainer">
<%= BeanPropertiesUtil.getString(territorio, "zona") %> <div class="row">
</div> <div class="col-sm-12 col-md-12">
<div class="col-sm-6 col-md-3"> <div class="module-group">
<%= LanguageUtil.get(pageContext, "dp-fascia-pericolosita") %> <liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="fascicolo_title_decreto_min" >
</div> <div class="container-fluid">
<div class="col-sm-6 col-md-3"> <div class="row">
<%= BeanPropertiesUtil.getString(territorio, "fascia") %> <div class="col-sm-6 col-md-3">
</div> <%= LanguageUtil.get(pageContext, "dp-zona-sismica") %>
</div> </div>
<div class="row"> <div class="col-sm-6 col-md-3">
<div class="col-sm-6 col-md-3"> <%= BeanPropertiesUtil.getString(territorio, "zona") %>
<%= LanguageUtil.get(pageContext, "dp-range-ag") %> </div>
</div> <div class="col-sm-6 col-md-3">
<div class="col-sm-6 col-md-3"> <%= LanguageUtil.get(pageContext, "dp-fascia-pericolosita") %>
<%= BeanPropertiesUtil.getString(territorio, "agMin") %> </div>
- <div class="col-sm-6 col-md-3">
<%= BeanPropertiesUtil.getString(territorio, "agMax") %> <%= BeanPropertiesUtil.getString(territorio, "fascia") %>
</div> </div>
<div class="col-sm-6 col-md-3"> </div>
<%= LanguageUtil.get(pageContext, "ag") %> <div class="row">
</div> <div class="col-sm-6 col-md-3">
<div class="col-sm-6 col-md-3"> <%= LanguageUtil.get(pageContext, "dp-range-ag") %>
<%= BeanPropertiesUtil.getString(dettPratica, "ag") %> </div>
</div> <div class="col-sm-6 col-md-3">
</div> <%= BeanPropertiesUtil.getString(territorio, "agMin") %> - <%= BeanPropertiesUtil.getString(territorio, "agMax") %>
<div class="row"> </div>
<div class="col-sm-12"> <div class="col-sm-6 col-md-3">
<div class="fascicolo_header_row"><%= LanguageUtil.get(pageContext, "dp-sensi") %></div> <%= LanguageUtil.get(pageContext, "ag") %>
</div> </div>
<div class="col-sm-6 col-md-3">
<%= BeanPropertiesUtil.getString(dettPratica, "ag") %>
</div>
</div>
<div class="row">
<div class="col-sm-12 col-md-12">
<div class="fascicolo_header_row"><%= LanguageUtil.get(pageContext, "dp-sensi") %></div>
</div>
</div>
<div class="row">
<c:if test="<%= AzioniPraticheUtil.isDeposito(intPratica.getIntPraticaId()) %>">
<div class="col-sm-6 col-md-6">
<strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "normDpr01Dep") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong>
<%= LanguageUtil.get(pageContext, "norm-dpr01-dep") %>
</div> </div>
<div class="row"> <div class="col-sm-6 col-md-6">
<c:if test="<%= intPratica.isDeposito() %>"> <strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "normDpr02Dep") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong>
<div class="col-sm-6 col-md-6">
<strong><span class='<%= BeanPropertiesUtil
.getBoolean(dettPratica, "normDpr01Dep")
? "fa fa-check-circle-o txt-green"
: "fa fa-circle-o" %>'></span></strong>
<%= LanguageUtil.get(pageContext, "norm-dpr01-dep") %>
</div>
<div class="col-sm-6 col-md-6">
<strong><span class='<%= BeanPropertiesUtil
.getBoolean(dettPratica, "normDpr02Dep") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong>
<%= LanguageUtil.get(pageContext, "norm-dpr02-dep") %> <%= LanguageUtil.get(pageContext, "norm-dpr02-dep") %>
</div> </div>
</c:if> </c:if>
<c:if test="<%= intPratica.isAutorizzazione() %>"> <c:if test="<%= AzioniPraticheUtil.isAutorizzazione(intPratica.getIntPraticaId()) %>">
<div class="col-sm-6 col-md-6"> <div class="col-sm-6 col-md-6">
<strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "normDpr01Aut") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong> <strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "normDpr01Aut") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong>
<%= LanguageUtil.get(pageContext, "norm-dpr01-aut") %> <%= LanguageUtil.get(pageContext, "norm-dpr01-aut") %>
@ -146,8 +165,8 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi
</c:if> </c:if>
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12 col-md-12">
<div class="fascicolo_header_row"><%= LanguageUtil.get(pageContext, "dp-rispetto") %></div> <div class="fascicolo_header_row"><%= LanguageUtil.get(pageContext, "dp-rispetto") %></div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
@ -155,21 +174,41 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi
<strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "normDm2018") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong> <strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "normDm2018") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong>
<%= LanguageUtil.get(pageContext, "norm-dm2018") %> <%= LanguageUtil.get(pageContext, "norm-dm2018") %>
</div> </div>
<div class="col-sm-6 col-md-6">
<strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "normDm01") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong>
<%= LanguageUtil.get(pageContext, "norm-dm01") %>
</div>
<div class="col-sm-6 col-md-6">
<strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "normDm02") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong>
<%= LanguageUtil.get(pageContext, "norm-dm02") %>
</div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12 col-md-12">
<div class="fascicolo_header_row"><%= LanguageUtil.get(pageContext, "dp-normativa") %>:</div> <div class="fascicolo_header_row"><%= LanguageUtil.get(pageContext, "dp-normativa") %>:</div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-6 col-md-6">
<strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "normDm03") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong>
<%= LanguageUtil.get(pageContext, "norm-dm03") %>
</div>
<div class="col-sm-6 col-md-6">
<strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "normDprg01") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong>
<%= LanguageUtil.get(pageContext, "norm-dprg01") %>
</div>
<div class="col-sm-6 col-md-6">
<strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "normDprg02") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong>
<%= LanguageUtil.get(pageContext, "norm-dprg02") %>
</div>
<div class="col-sm-6 col-md-6"> <div class="col-sm-6 col-md-6">
<strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "normAnr") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong> <strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "normAnr") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong>
<%= LanguageUtil.get(pageContext, "norm-anr") %> <%= LanguageUtil.get(pageContext, "norm-anr") %>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12 col-md-12">
<div class="fascicolo_header_row"></div> <div class="fascicolo_header_row"></div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
@ -193,22 +232,22 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi
<strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "collaudoStatico") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong> <strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "collaudoStatico") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong>
<%= LanguageUtil.get(pageContext, "collaudo-statico") %> <%= LanguageUtil.get(pageContext, "collaudo-statico") %>
</div> </div>
<div class="col-sm-12"> <div class="col-sm-12 col-md-12">
<div class="container-regolamento"> <div class="container-regolamento">
<strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "normArt3com3") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>' style="margin-right: 10px;"></span></strong> <strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "normArt3com3") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>' style="margin-right: 10px;"></span></strong>
<p style="display: inline;"><%= LanguageUtil.get(pageContext, "norm-art3com3") %>:</p> <p style="display: inline;"><%= LanguageUtil.get(pageContext, "norm-art3com3") %>:</p>
<ul style="padding-left:20px; list-style: initial;"> <ul style="padding-left:20px; list-style: initial;">
<li><%= LanguageUtil.get(pageContext, "norm-art3com3_1") %>;</li> <li><%= LanguageUtil.get(pageContext, "norm-art3com3_1") %>;</li>
<li><%= LanguageUtil.get(pageContext, "norm-art3com3_2") %>;</li> <li><%= LanguageUtil.get(pageContext, "norm-art3com3_2") %>;</li>
<li><%= LanguageUtil.get(pageContext, "norm-art3com3_3") %>; </li> <li><%= LanguageUtil.get(pageContext, "norm-art3com3_3") %>; </li>
<li><%= LanguageUtil.get(pageContext, "norm-art3com3_4") %>;</li> <li><%= LanguageUtil.get(pageContext, "norm-art3com3_4") %>;</li>
</ul> </ul>
</div> </div>
</div> </div>
<div class="col-sm-12"> <div class="col-sm-12 col-md-12">
<div class="container-regolamento" style="display: inline-block;vertical-align: top;"> <div class="container-regolamento" style="display: inline-block;vertical-align: top;">
<strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "normArt3com4") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>' style="margin-right: 10px;"></span></strong> <strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "normArt3com4") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>' style="margin-right: 10px;"></span></strong>
<p style="display: inline;"><%= LanguageUtil.get(pageContext, "norm-art3com4") %></p> <p style="display: inline;"><%= LanguageUtil.get(pageContext, "norm-art3com4") %></p>
</div> </div>
</div> </div>
</div> </div>
@ -219,11 +258,11 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12 col-md-12">
<div class="module-group"> <div class="module-group">
<liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="fascicolo_title_descrizione" > <liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="fascicolo_title_descrizione" >
<div class="prog-description"> <div class="prog-description">
<%= HtmlUtil.escape(BeanPropertiesUtil.getString(dettPratica, "descLongIntervento")) %> <%=BeanPropertiesUtil.getString(dettPratica, "descLongIntervento") %>
</div> </div>
</liferay-ui:panel> </liferay-ui:panel>
</div> </div>
@ -232,13 +271,13 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12 col-md-12">
<div class="module-group"> <div class="module-group">
<liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="fascicolo_title_dettagli" > <liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="fascicolo_title_dettagli" >
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12 col-md-12">
<div class="fascicolo_header_row">Ubicazione</div> <div class="fascicolo_header_row">Ubicazione</div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
@ -340,36 +379,39 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<% <%
String[] geolocalization = BeanPropertiesUtil.getString(dettPratica, "localizzazioneGeografica","").split(Pattern.quote("|")); String[] geolocalization = BeanPropertiesUtil.getString(dettPratica, "localizzazioneGeografica","").split(Pattern.quote("|"));
%> %>
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6"> <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
<aui:input name="lat" label="" type="hidden" <aui:input name="lat" label="" type="hidden"
value='<%=geolocalization.length>0?geolocalization[0]:StringPool.BLANK %>' /> value='<%=geolocalization.length>0?geolocalization[0]:StringPool.BLANK %>' />
</div> </div>
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6"> <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
<aui:input name="long" label="" type="hidden" <aui:input name="long" label="" type="hidden"
value='<%=geolocalization.length>1?geolocalization[1]:StringPool.BLANK %>'/> value='<%=geolocalization.length>1?geolocalization[1]:StringPool.BLANK %>'/>
</div> </div>
<aui:input type="hidden" name="geoIsEditable" value='<%= false %>' label=""/> <aui:input type="hidden" name="geoIsEditable" value='<%= false %>' label=""/>
<liferay-portlet:runtime portletName="5_WAR_trefmapitmapportlet" />
<liferay-portlet:runtime portletName="5_WAR_trefmapitmapportlet" />
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</liferay-ui:panel> </liferay-ui:panel>
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12 col-md-12">
<div class="module-group"> <div class="module-group">
<liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="destinazione" > <liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="destinazione" >
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12 col-md-12">
<% <%
String label = BeanPropertiesUtil.getString(dettPratica, "destinazione"); String label = BeanPropertiesUtil.getString(dettPratica, "destinazione");
String uso = ""; String uso = "";
String title = ""; String title = "";
if(label.length() > 1){ if(label.length() > 1){
@ -380,7 +422,7 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi
out.print(LanguageUtil.get(pageContext, "destinazione-"+title)+":"); out.print(LanguageUtil.get(pageContext, "destinazione-"+title)+":");
} }
%> %>
<strong><%=LanguageUtil.get(pageContext, <strong><%=LanguageUtil.get(pageContext,
"destinazione-"+BeanPropertiesUtil.getString(dettPratica, "destinazione"))%></strong> "destinazione-"+BeanPropertiesUtil.getString(dettPratica, "destinazione"))%></strong>
</div> </div>
</div> </div>
@ -390,7 +432,7 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12 col-md-12">
<div class="module-group"> <div class="module-group">
<liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="fascicolo_title_intervento" > <liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="fascicolo_title_intervento" >
<div class="container-fluid"> <div class="container-fluid">
@ -400,11 +442,11 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi
<%=LanguageUtil.get(pageContext, "tc-nuova-costruzione") %> <%=LanguageUtil.get(pageContext, "tc-nuova-costruzione") %>
</div> </div>
<% <%
boolean checked = boolean checked =
BeanPropertiesUtil.getBoolean(dettPratica, "tcAdeguamentoSismico") || BeanPropertiesUtil.getBoolean(dettPratica, "tcAdeguamentoSismico") ||
BeanPropertiesUtil.getBoolean(dettPratica, "tcMiglioramentoSismico") || BeanPropertiesUtil.getBoolean(dettPratica, "tcMiglioramentoSismico") ||
BeanPropertiesUtil.getBoolean(dettPratica, "tcRiparazioneInterventoLocale"); BeanPropertiesUtil.getBoolean(dettPratica, "tcRiparazioneInterventoLocale");
%> %>
<div class="col-sm-6 col-md-6"> <div class="col-sm-6 col-md-6">
<strong><span class='<%=checked ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong> <strong><span class='<%=checked ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong>
<%=LanguageUtil.get(pageContext, "tc-interventi-esistenti") %> <%=LanguageUtil.get(pageContext, "tc-interventi-esistenti") %>
@ -412,6 +454,7 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi
<li> <li>
<strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "tcAdeguamentoSismico") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong> <strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "tcAdeguamentoSismico") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong>
<%=LanguageUtil.get(pageContext, "tc-adeguamento-sismico") %> <%=LanguageUtil.get(pageContext, "tc-adeguamento-sismico") %>
</li> </li>
<li> <li>
<strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "tcMiglioramentoSismico") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong> <strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "tcMiglioramentoSismico") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong>
@ -429,15 +472,16 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12 col-md-12">
<div class="module-group"> <div class="module-group">
<liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="fascicolo_title_tipologia_costruttiva" > <liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="fascicolo_title_tipologia_costruttiva" >
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<div class="col-sm-3 col-md-3"> <div class="col-sm-3 col-md-3">
<strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "tcInCA") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong> <strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "tcInCA") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong>
<%=LanguageUtil.get(pageContext, "tc-in-c-a") %> <%=LanguageUtil.get(pageContext, "tc-in-ca") %>
</div> </div>
<div class="col-sm-3 col-md-3"> <div class="col-sm-3 col-md-3">
<strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "tcInOpera") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong> <strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "tcInOpera") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong>
@ -456,8 +500,8 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi
<div class="col-sm-3 col-md-3"> <div class="col-sm-3 col-md-3">
<strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "tcMista") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong> <strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "tcMista") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong>
<%=LanguageUtil.get(pageContext, "tc-mista") %> <%=LanguageUtil.get(pageContext, "tc-mista") %>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-3 col-md-3"> <div class="col-sm-3 col-md-3">
<strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "tcInMuratura") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong> <strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "tcInMuratura") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong>
@ -466,7 +510,7 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi
<div class="col-sm-3 col-md-3"> <div class="col-sm-3 col-md-3">
<strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "tcInMuraturaOrdinaria") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong> <strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "tcInMuraturaOrdinaria") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong>
<%=LanguageUtil.get(pageContext, "tc-in-muratura-ordinaria") %> <%=LanguageUtil.get(pageContext, "tc-in-muratura-ordinaria") %>
</div> </div>
<div class="col-sm-3 col-md-3"> <div class="col-sm-3 col-md-3">
<strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "tcInMuraturaArmata") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong> <strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "tcInMuraturaArmata") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong>
<%=LanguageUtil.get(pageContext, "tc-in-muratura-armata") %> <%=LanguageUtil.get(pageContext, "tc-in-muratura-armata") %>
@ -483,7 +527,7 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12 col-md-12">
<strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "tcAltro") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong> <strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "tcAltro") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong>
<%=LanguageUtil.get(pageContext, "tc-altro") %></br> <%=LanguageUtil.get(pageContext, "tc-altro") %></br>
<span style="margin-left:20px"><strong><%=BeanPropertiesUtil.getString(dettPratica, "tcAltroDescrizione") %></strong></span> <span style="margin-left:20px"><strong><%=BeanPropertiesUtil.getString(dettPratica, "tcAltroDescrizione") %></strong></span>
@ -502,35 +546,40 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-12 anagrafica-soggetti"> <div class="col-sm-12 col-md-12 anagrafica-soggetti">
<div class="module-group"> <div class="module-group">
<liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="fascicolo_title_soggetti" > <liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="fascicolo_title_soggetti" >
<div class="row container-soggetti__bo "> <div class="row container-soggetti__bo ">
<div class="col-sm-12 container-soggetti__bo-dettagli"> <div class="col-sm-12 col-md-12 container-soggetti__bo-dettagli">
<liferay-ui:search-container emptyResultsMessage="no-soggetti-presenti"> <liferay-ui:search-container emptyResultsMessage="no-soggetti-presenti">
<liferay-ui:search-container-results <liferay-ui:search-container-results
results="<%=SoggettoLocalServiceUtil.findByIntPratica(dettPratica.getIntPraticaId())%>" results="<%=SoggettoLocalServiceUtil.findByIntPratica(dettPratica.getIntPraticaId())%>"
total="<%=SoggettoLocalServiceUtil.countByIntPratica(dettPratica.getIntPraticaId())%>" total="<%=SoggettoLocalServiceUtil.countByIntPratica(dettPratica.getIntPraticaId())%>"
/> />
<liferay-ui:search-container-row <liferay-ui:search-container-row
className="it.tref.liferay.portos.bo.model.Soggetto" className="it.tref.liferay.portos.bo.model.Soggetto"
modelVar="soggetto" modelVar="soggetto"
> >
<% <%
boolean isSoggettoPrincipale = dettPratica.isSoggettoPrincipale(soggetto.getSoggettoId()); boolean isSoggettoPrincipale = SoggettiUtil.isSoggettoPrincipale(soggetto.getSoggettoId(), dettPratica.getDettPraticaId());
%> %>
<liferay-portlet:renderURL portletName="<%=PortletKeys.SOGGETTI %>" var="detailsURL" windowState="<%=LiferayWindowState.POP_UP.toString() %>"> <liferay-portlet:renderURL portletName="<%=PortletKeys.SOGGETTI %>" var="detailsURL" windowState="<%=LiferayWindowState.POP_UP.toString() %>">
<liferay-portlet:param name="mvcPath" value="/html/soggettipratica/edit_soggetto.jsp"/> <liferay-portlet:param name="mvcPath" value="/html/soggettipratica/edit_soggetto.jsp"/>
<liferay-portlet:param name="soggettoId" value="<%=String.valueOf(soggetto.getSoggettoId()) %>"/> <liferay-portlet:param name="soggettoId" value="<%=String.valueOf(soggetto.getSoggettoId()) %>"/>
<liferay-portlet:param name="inBO" value="true"/> <liferay-portlet:param name="inBO" value="true"/>
<liferay-portlet:param name="isEditable" value="false"/> <liferay-portlet:param name="isEditable" value="false"/>
</liferay-portlet:renderURL> </liferay-portlet:renderURL>
<liferay-ui:search-container-column-text name="Stato" cssClass="text-center"> <liferay-ui:search-container-column-text name="Stato" cssClass="text-center">
<span class='fa fa-circle <%= soggetto.getRimosso() ? "txt-red" : "txt-green" %>'></span> <span class='fa fa-circle <%= soggetto.getRimosso() ? "txt-red" : "txt-green" %>'></span>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="principale" cssClass="text-center"> <liferay-ui:search-container-column-text name="principale" cssClass="text-center">
<span class='<%= isSoggettoPrincipale ? "fa fa-star txt-orange" : "fa fa-star-o" %>'></span> <span class='<%= isSoggettoPrincipale ? "fa fa-star txt-orange" : "fa fa-star-o" %>'></span>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="ruolo"> <liferay-ui:search-container-column-text name="ruolo">
<%= soggetto.getFullTipologiaSoggetto() %> <%= soggetto.getFullTipologiaSoggetto() %>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
@ -540,44 +589,51 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi
<liferay-ui:search-container-column-text name="albo" cssClass="text-uppercase"> <liferay-ui:search-container-column-text name="albo" cssClass="text-uppercase">
<% <%
if("albo-altro".equalsIgnoreCase(soggetto.getAlbo())){ if("albo-altro".equalsIgnoreCase(soggetto.getAlbo())){
out.print(soggetto.getAlboDescr()); out.print(soggetto.getAlboDescr());
} else { } else {
out.print(soggetto.getAlbo()); out.print(soggetto.getAlbo());
} }
%> %>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="Aggiunto da" > <liferay-ui:search-container-column-text name="Aggiunto da" >
<% <%
DettPratica adding = DettPraticaLocalServiceUtil.fetchDettPratica(soggetto.getDettPraticaId()); DettPratica adding = DettPraticaLocalServiceUtil.fetchDettPratica(soggetto.getDettPraticaId());
if(adding != null){ if(adding != null){
%> %>
<%= adding.getFullDescription() %> <%= adding.getFullDescription() %>
<% <%
} }
%> %>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="Invalidato da"> <liferay-ui:search-container-column-text name="Invalidato da">
<% <%
DettPratica removing = DettPraticaLocalServiceUtil.fetchDettPratica(soggetto.getDettPraticaIdRimozione()); DettPratica removing = DettPraticaLocalServiceUtil.fetchDettPratica(soggetto.getDettPraticaIdRimozione());
if(removing != null){ if(removing != null){
%> %>
<%= removing.getFullDescription() %> <%= removing.getFullDescription() %>
<% <%
} }
%> %>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
</liferay-ui:search-container-row> </liferay-ui:search-container-row>
<liferay-ui:search-iterator paginate="<%= false %>" /> <liferay-ui:search-iterator paginate="<%= false %>" />
</liferay-ui:search-container> </liferay-ui:search-container>
</div> </div>
</div> </div>
</liferay-ui:panel> </liferay-ui:panel>
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12 col-md-12">
<div class="module-group"> <div class="module-group">
<liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="Dati Metrici Descrittivi" > <liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="Dati Metrici Descrittivi" >
<div class="container-fluid"> <div class="container-fluid">
@ -588,7 +644,7 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi
<div class="col-sm-6 col-md-2"> <div class="col-sm-6 col-md-2">
<% String dePiani = BeanPropertiesUtil.getString(dettPratica, "dePiani"); %> <% String dePiani = BeanPropertiesUtil.getString(dettPratica, "dePiani"); %>
<c:if test="<%= Validator.isNotNull(dePiani) %>"> <c:if test="<%= Validator.isNotNull(dePiani) %>">
<strong><%=LanguageUtil.get(pageContext, <strong><%=LanguageUtil.get(pageContext,
"de-piani-"+dePiani)%></strong> "de-piani-"+dePiani)%></strong>
</c:if> </c:if>
</div> </div>
@ -598,7 +654,7 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi
<div class="col-sm-6 col-md-2"> <div class="col-sm-6 col-md-2">
<% String deAltezza = BeanPropertiesUtil.getString(dettPratica, "deAltezza"); %> <% String deAltezza = BeanPropertiesUtil.getString(dettPratica, "deAltezza"); %>
<c:if test="<%= Validator.isNotNull(deAltezza) %>"> <c:if test="<%= Validator.isNotNull(deAltezza) %>">
<strong><%=LanguageUtil.get(pageContext, <strong><%=LanguageUtil.get(pageContext,
"de-altezza-"+deAltezza)%></strong> "de-altezza-"+deAltezza)%></strong>
</c:if> </c:if>
</div> </div>
@ -610,9 +666,10 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi
<div class="col-sm-6 col-md-2"> <div class="col-sm-6 col-md-2">
<% String deInterrati = BeanPropertiesUtil.getString(dettPratica, "deInterrati"); %> <% String deInterrati = BeanPropertiesUtil.getString(dettPratica, "deInterrati"); %>
<c:if test="<%= Validator.isNotNull(deInterrati) %>"> <c:if test="<%= Validator.isNotNull(deInterrati) %>">
<strong><%=LanguageUtil.get(pageContext, <strong><%=LanguageUtil.get(pageContext,
"de-interrati-"+deInterrati)%></strong> "de-interrati-"+deInterrati)%></strong>
</c:if> </c:if>
</div> </div>
<div class="col-sm-6 col-md-4"> <div class="col-sm-6 col-md-4">
<%= LanguageUtil.get(pageContext, "de-superficie") %>: <%= LanguageUtil.get(pageContext, "de-superficie") %>:
@ -620,7 +677,7 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi
<div class="col-sm-6 col-md-2"> <div class="col-sm-6 col-md-2">
<% String deSuperficie = BeanPropertiesUtil.getString(dettPratica, "deSuperficie"); %> <% String deSuperficie = BeanPropertiesUtil.getString(dettPratica, "deSuperficie"); %>
<c:if test="<%= Validator.isNotNull(deSuperficie) %>"> <c:if test="<%= Validator.isNotNull(deSuperficie) %>">
<strong><%=LanguageUtil.get(pageContext, <strong><%=LanguageUtil.get(pageContext,
"de-superficie-"+deSuperficie)%></strong> "de-superficie-"+deSuperficie)%></strong>
</c:if> </c:if>
</div> </div>
@ -632,7 +689,7 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi
<div class="col-sm-6 col-md-2"> <div class="col-sm-6 col-md-2">
<% String deCostruzione = BeanPropertiesUtil.getString(dettPratica, "deCostruzione"); %> <% String deCostruzione = BeanPropertiesUtil.getString(dettPratica, "deCostruzione"); %>
<c:if test="<%= Validator.isNotNull(deCostruzione) %>"> <c:if test="<%= Validator.isNotNull(deCostruzione) %>">
<strong><%=LanguageUtil.get(pageContext, <strong><%=LanguageUtil.get(pageContext,
"de-costruzione-"+deCostruzione)%></strong> "de-costruzione-"+deCostruzione)%></strong>
</c:if> </c:if>
</div> </div>
@ -642,7 +699,7 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi
<div class="col-sm-6 col-md-2"> <div class="col-sm-6 col-md-2">
<% String deRistrutturazione = BeanPropertiesUtil.getString(dettPratica, "deRistrutturazione"); %> <% String deRistrutturazione = BeanPropertiesUtil.getString(dettPratica, "deRistrutturazione"); %>
<c:if test="<%= Validator.isNotNull(deRistrutturazione) %>"> <c:if test="<%= Validator.isNotNull(deRistrutturazione) %>">
<strong><%=LanguageUtil.get(pageContext, <strong><%=LanguageUtil.get(pageContext,
"de-ristrutturazione-"+deRistrutturazione)%></strong> "de-ristrutturazione-"+deRistrutturazione)%></strong>
</c:if> </c:if>
</div> </div>
@ -654,7 +711,7 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi
<div class="col-sm-6 col-md-2"> <div class="col-sm-6 col-md-2">
<% String deUso = BeanPropertiesUtil.getString(dettPratica, "deUso"); %> <% String deUso = BeanPropertiesUtil.getString(dettPratica, "deUso"); %>
<c:if test="<%= Validator.isNotNull(deUso) %>"> <c:if test="<%= Validator.isNotNull(deUso) %>">
<strong><%=LanguageUtil.get(pageContext, <strong><%=LanguageUtil.get(pageContext,
"de-uso-"+deUso)%></strong> "de-uso-"+deUso)%></strong>
</c:if> </c:if>
</div> </div>
@ -664,7 +721,7 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi
<div class="col-sm-6 col-md-2"> <div class="col-sm-6 col-md-2">
<% String deUtilizzazione = BeanPropertiesUtil.getString(dettPratica, "deUtilizzazione"); %> <% String deUtilizzazione = BeanPropertiesUtil.getString(dettPratica, "deUtilizzazione"); %>
<c:if test="<%= Validator.isNotNull(deUtilizzazione) %>"> <c:if test="<%= Validator.isNotNull(deUtilizzazione) %>">
<strong><%=LanguageUtil.get(pageContext, <strong><%=LanguageUtil.get(pageContext,
"de-utilizzazione-"+deUtilizzazione)%></strong> "de-utilizzazione-"+deUtilizzazione)%></strong>
</c:if> </c:if>
</div> </div>
@ -676,7 +733,7 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi
<div class="col-sm-6 col-md-2"> <div class="col-sm-6 col-md-2">
<% String dePosizioneEdificio = BeanPropertiesUtil.getString(dettPratica, "dePosizioneEdificio"); %> <% String dePosizioneEdificio = BeanPropertiesUtil.getString(dettPratica, "dePosizioneEdificio"); %>
<c:if test="<%= Validator.isNotNull(dePosizioneEdificio) %>"> <c:if test="<%= Validator.isNotNull(dePosizioneEdificio) %>">
<strong><%=LanguageUtil.get(pageContext, <strong><%=LanguageUtil.get(pageContext,
"de-posizione-edificio-"+dePosizioneEdificio)%></strong> "de-posizione-edificio-"+dePosizioneEdificio)%></strong>
</c:if> </c:if>
</div> </div>
@ -688,14 +745,14 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi
<div class="col-sm-3 col-md-2"> <div class="col-sm-3 col-md-2">
<% String dePubblica = BeanPropertiesUtil.getString(dettPratica, "dePubblica"); %> <% String dePubblica = BeanPropertiesUtil.getString(dettPratica, "dePubblica"); %>
<c:if test="<%= Validator.isNotNull(dePubblica) %>"> <c:if test="<%= Validator.isNotNull(dePubblica) %>">
<strong><%=BeanPropertiesUtil.getString(dettPratica, "dePubblica")%><%=LanguageUtil.get(pageContext, <strong><%=BeanPropertiesUtil.getString(dettPratica, "dePubblica")%><%=LanguageUtil.get(pageContext,
"de-pubblica")%></strong> "de-pubblica")%></strong>
</c:if> </c:if>
</div> </div>
<div class="col-sm-3 col-md-2"> <div class="col-sm-3 col-md-2">
<% String dePrivata = BeanPropertiesUtil.getString(dettPratica, "dePrivata"); %> <% String dePrivata = BeanPropertiesUtil.getString(dettPratica, "dePrivata"); %>
<c:if test="<%= Validator.isNotNull(dePrivata) %>"> <c:if test="<%= Validator.isNotNull(dePrivata) %>">
<strong><%=BeanPropertiesUtil.getString(dettPratica, "dePrivata")%><%=LanguageUtil.get(pageContext, <strong><%=BeanPropertiesUtil.getString(dettPratica, "dePrivata")%><%=LanguageUtil.get(pageContext,
"de-privata")%></strong> "de-privata")%></strong>
</c:if> </c:if>
</div> </div>
@ -706,7 +763,7 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12 col-md-12">
<div class="module-group"> <div class="module-group">
<liferay-ui:panel extended="false" defaultState="open" collapsible="false" title='<%= LanguageUtil.get(pageContext, "dcc")%>' > <liferay-ui:panel extended="false" defaultState="open" collapsible="false" title='<%= LanguageUtil.get(pageContext, "dcc")%>' >
<div class="container-fluid"> <div class="container-fluid">
@ -716,8 +773,8 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi
%> %>
<c:if test="<%= Validator.isNotNull(fondazioni) %>"> <c:if test="<%= Validator.isNotNull(fondazioni) %>">
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12 col-md-12">
<div class="fascicolo_header_row"><%= LanguageUtil.get(pageContext, "dcc-fondazioni") %></div> <div class="fascicolo_header_row"><%= LanguageUtil.get(pageContext, "dcc-fondazioni") %></div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
@ -725,18 +782,18 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi
<%=LanguageUtil.get(pageContext, "dcc-fondazioni-"+fondazioni_label)%>: <%=LanguageUtil.get(pageContext, "dcc-fondazioni-"+fondazioni_label)%>:
</div> </div>
<div class="col-sm-6 col-md-2"> <div class="col-sm-6 col-md-2">
<strong><%=LanguageUtil.get(pageContext, <strong><%=LanguageUtil.get(pageContext,
"dcc-fondazioni-"+fondazioni)%></strong> "dcc-fondazioni-"+fondazioni)%></strong>
</div> </div>
</div> </div>
</c:if> </c:if>
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12 col-md-12">
<div class="fascicolo_header_row"><%= LanguageUtil.get(pageContext, "dcc-strutture-ele") %></div> <div class="fascicolo_header_row"><%= LanguageUtil.get(pageContext, "dcc-strutture-ele") %></div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-12" > <div class="col-sm-12 col-md-12" >
<%= LanguageUtil.get(pageContext, "dcc-strutture-ele-murature") %>: <%= LanguageUtil.get(pageContext, "dcc-strutture-ele-murature") %>:
</div> </div>
</div> </div>
@ -763,23 +820,23 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi
<div class="separator"></div> <div class="separator"></div>
<div class="row"> <div class="row">
<div class="col-sm-4 col-md-2"> <div class="col-sm-4 col-md-2">
<%= LanguageUtil.get(pageContext, "dcc-strutture-ele-acciaio") %>: <%= LanguageUtil.get(pageContext, "dcc-strutture-ele-acciaio") %>:
</div> </div>
<div class="col-sm-8 col-md-10"> <div class="col-sm-8 col-md-10">
<% String acciaio = BeanPropertiesUtil.getString(dettPratica, "dccStruttureEleAcciaio"); %> <% String acciaio = BeanPropertiesUtil.getString(dettPratica, "dccStruttureEleAcciaio"); %>
<strong><%= Validator.isNotNull(acciaio) ? LanguageUtil.get(pageContext, <strong><%= Validator.isNotNull(acciaio) ? LanguageUtil.get(pageContext,
"dcc-strutture-ele-acciaio-"+acciaio) : ""%></strong> "dcc-strutture-ele-acciaio-"+acciaio) : ""%></strong>
</div> </div>
</div> </div>
<div class="separator"></div> <div class="separator"></div>
<div class="row"> <div class="row">
<div class="col-sm-4 col-md-2"><%= LanguageUtil.get(pageContext, "dcc-strutture-ele-c-a") %>: <div class="col-sm-4 col-md-2"><%= LanguageUtil.get(pageContext, "dcc-strutture-ele-c-a") %>:
</div> </div>
<div class="col-sm-8 col-md-10"> <div class="col-sm-8 col-md-10">
<% String ca = BeanPropertiesUtil.getString(dettPratica, "dccStruttureEleCA"); %> <% String ca = BeanPropertiesUtil.getString(dettPratica, "dccStruttureEleCA"); %>
<strong><%= Validator.isNotNull(ca) ? LanguageUtil.get(pageContext, <strong><%= Validator.isNotNull(ca) ? LanguageUtil.get(pageContext,
"dcc-strutture-ele-c-a-"+ca) : ""%> "dcc-strutture-ele-c-a-"+ca) : ""%>
</strong> </strong>
</div> </div>
</div> </div>
<div class="separator"></div> <div class="separator"></div>
@ -788,14 +845,14 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi
</div> </div>
<div class="col-sm-8 col-md-10"> <div class="col-sm-8 col-md-10">
<% String legno = BeanPropertiesUtil.getString(dettPratica, "dccStruttureEleLegno"); %> <% String legno = BeanPropertiesUtil.getString(dettPratica, "dccStruttureEleLegno"); %>
<strong><%= Validator.isNotNull(legno) ? LanguageUtil.get(pageContext, <strong><%= Validator.isNotNull(legno) ? LanguageUtil.get(pageContext,
"dcc-strutture-ele-legno-"+legno) : ""%></strong> "dcc-strutture-ele-legno-"+legno) : ""%></strong>
</div> </div>
</div> </div>
<div class="separator"></div> <div class="separator"></div>
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12 col-md-12">
<%= LanguageUtil.get(pageContext, "dcc-strutture-ele-misto") %>: <%= LanguageUtil.get(pageContext, "dcc-strutture-ele-misto") %>:
</div> </div>
</div> </div>
<div class="row"> <div class="row">
@ -823,11 +880,12 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi
<strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "dccStruttureEleAltro") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong> <strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "dccStruttureEleAltro") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong>
<%= LanguageUtil.get(pageContext, "dcc-strutture-ele-misto-altro") %> <%= LanguageUtil.get(pageContext, "dcc-strutture-ele-misto-altro") %>
<span style="margin-left:20px"><strong><%=BeanPropertiesUtil.getString(dettPratica, "dccStruttureEleAltroDescrizione") %></strong></span> <span style="margin-left:20px"><strong><%=BeanPropertiesUtil.getString(dettPratica, "dccStruttureEleAltroDescrizione") %></strong></span>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12 col-md-12">
<div class="fascicolo_header_row"><%= LanguageUtil.get(pageContext, "dcc-orizzontamenti") %></div> <div class="fascicolo_header_row"><%= LanguageUtil.get(pageContext, "dcc-orizzontamenti") %></div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
@ -857,18 +915,19 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi
<span style="margin-left:20px"><strong><%=BeanPropertiesUtil.getString(dettPratica, "dccOrizzontamentiAltroDescrizione") %></strong></span> <span style="margin-left:20px"><strong><%=BeanPropertiesUtil.getString(dettPratica, "dccOrizzontamentiAltroDescrizione") %></strong></span>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12 col-md-12">
<div class="fascicolo_header_row"><%= LanguageUtil.get(pageContext, "dcc-copertura") %></div> <div class="fascicolo_header_row"><%= LanguageUtil.get(pageContext, "dcc-copertura") %></div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<% <%
String copertura = BeanPropertiesUtil.getString(dettPratica, "dccCopertura"); String copertura = BeanPropertiesUtil.getString(dettPratica, "dccCopertura");
%> %>
<c:if test="<%= Validator.isNotNull(copertura) %>"> <c:if test="<%= Validator.isNotNull(copertura) %>">
<div class="col-sm-12" > <div class="col-sm-12 col-md-12" >
<strong><%=LanguageUtil.get(pageContext, <strong><%=LanguageUtil.get(pageContext,
"dcc-copertura-"+BeanPropertiesUtil.getString(dettPratica, "dccCopertura"))%></strong> "dcc-copertura-"+BeanPropertiesUtil.getString(dettPratica, "dccCopertura"))%></strong>
</div> </div>
</c:if> </c:if>
@ -906,9 +965,10 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi
<span style="margin-left:20px"><strong><%=BeanPropertiesUtil.getString(dettPratica, "dccCoperturaAltroDesrizione") %></strong></span> <span style="margin-left:20px"><strong><%=BeanPropertiesUtil.getString(dettPratica, "dccCoperturaAltroDesrizione") %></strong></span>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12 col-md-12">
<div class="fascicolo_header_row"><%= LanguageUtil.get(pageContext, "dcc-elem-non-strut") %></div> <div class="fascicolo_header_row"><%= LanguageUtil.get(pageContext, "dcc-elem-non-strut") %></div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
@ -928,15 +988,16 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi
<strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "dccElemNonStrutLegno") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong> <strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "dccElemNonStrutLegno") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong>
<%= LanguageUtil.get(pageContext, "dcc-elem-non-strut-legno") %> <%= LanguageUtil.get(pageContext, "dcc-elem-non-strut-legno") %>
</div> </div>
<div class="col-sm-12" > <div class="col-sm-12 col-md-12" >
<strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "dccElemNonStrutAltro") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong> <strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "dccElemNonStrutAltro") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong>
<%= LanguageUtil.get(pageContext, "dcc-elem-non-strut-altro") %> <%= LanguageUtil.get(pageContext, "dcc-elem-non-strut-altro") %>
<span style="margin-left:20px"><strong><%=BeanPropertiesUtil.getString(dettPratica, "dccElemNonStrutAltroDescrizione") %></strong></span> <span style="margin-left:20px"><strong><%=BeanPropertiesUtil.getString(dettPratica, "dccElemNonStrutAltroDescrizione") %></strong></span>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12 col-md-12">
<div class="fascicolo_header_row"><%= LanguageUtil.get(pageContext, "dcc-opere-di-rinforzo") %></div> <div class="fascicolo_header_row"><%= LanguageUtil.get(pageContext, "dcc-opere-di-rinforzo") %></div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
@ -972,7 +1033,7 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi
<strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "dccOpereDiRinforzoInsRompitratta") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong> <strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "dccOpereDiRinforzoInsRompitratta") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong>
<%= LanguageUtil.get(pageContext, "dcc-opere-di-rinforzo-ins-rompitratta") %> <%= LanguageUtil.get(pageContext, "dcc-opere-di-rinforzo-ins-rompitratta") %>
</div> </div>
<div class="col-sm-12" > <div class="col-sm-12 col-md-12" >
<strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "dccOpereDiRinforzoAltro") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong> <strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "dccOpereDiRinforzoAltro") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong>
<%= LanguageUtil.get(pageContext, "dcc-opere-di-rinforzo-altro") %> <%= LanguageUtil.get(pageContext, "dcc-opere-di-rinforzo-altro") %>
<span style="margin-left:20px"><strong><%=BeanPropertiesUtil.getString(dettPratica, "dccOpereDiRinforzoAltroDescrizione") %></strong></span> <span style="margin-left:20px"><strong><%=BeanPropertiesUtil.getString(dettPratica, "dccOpereDiRinforzoAltroDescrizione") %></strong></span>
@ -984,13 +1045,13 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12 col-md-12">
<div class="module-group"> <div class="module-group">
<liferay-ui:panel extended="false" defaultState="open" collapsible="false" title='<%= LanguageUtil.get(pageContext, "di") %>' > <liferay-ui:panel extended="false" defaultState="open" collapsible="false" title='<%= LanguageUtil.get(pageContext, "di") %>' >
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12 col-md-12">
<div class="fascicolo_header_row"><%= LanguageUtil.get(pageContext, "de-inf") %></div> <div class="fascicolo_header_row"><%= LanguageUtil.get(pageContext, "de-inf") %></div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
@ -1072,7 +1133,7 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12 col-md-12">
<div class="module-group"> <div class="module-group">
<liferay-ui:panel extended="false" defaultState="open" collapsible="false" title='<%= LanguageUtil.get(pageContext, "geo") %>' > <liferay-ui:panel extended="false" defaultState="open" collapsible="false" title='<%= LanguageUtil.get(pageContext, "geo") %>' >
@ -1088,10 +1149,11 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi
<c:if test="<%=Validator.isNotNull(geoDate) %>"> <c:if test="<%=Validator.isNotNull(geoDate) %>">
<strong><%= dateFormatDate.format(geoDate) %></strong> <strong><%= dateFormatDate.format(geoDate) %></strong>
</c:if> </c:if>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12 col-md-12">
<div class="fascicolo_header_row"><%=LanguageUtil.get(pageContext, "geo-scheda-title") %></div> <div class="fascicolo_header_row"><%=LanguageUtil.get(pageContext, "geo-scheda-title") %></div>
</div> </div>
</div> </div>
@ -1126,7 +1188,7 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi
</c:if> </c:if>
</div> </div>
<div class="col-sm-6 col-md-4"> <div class="col-sm-6 col-md-4">
<%=LanguageUtil.get(pageContext, "geo-categoria-topografica") %>: <%=LanguageUtil.get(pageContext, "geo-categoria-topografica") %>:
</div> </div>
<div class="col-sm-6 col-md-2"> <div class="col-sm-6 col-md-2">
<% String geoCategoriaTopografica = BeanPropertiesUtil.getString(dettPratica, "geoCategoriaTopografica"); %> <% String geoCategoriaTopografica = BeanPropertiesUtil.getString(dettPratica, "geoCategoriaTopografica"); %>
@ -1296,7 +1358,7 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12 col-md-12">
<div class="module-group allegati-dettagli"> <div class="module-group allegati-dettagli">
<liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="Allegati Geologici" > <liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="Allegati Geologici" >
<div class="row" id="<portlet:namespace/>allegati-geologica-table"> <div class="row" id="<portlet:namespace/>allegati-geologica-table">
@ -1308,14 +1370,14 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi
<liferay-util:param name="comingFrom" value="view_fascicolo_dettagli"></liferay-util:param> <liferay-util:param name="comingFrom" value="view_fascicolo_dettagli"></liferay-util:param>
<liferay-util:param name="full" value="true"></liferay-util:param> <liferay-util:param name="full" value="true"></liferay-util:param>
</liferay-util:include> </liferay-util:include>
</div> </div>
</div> </div>
</liferay-ui:panel> </liferay-ui:panel>
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12 col-md-12">
<div class="module-group allegati-dettagli"> <div class="module-group allegati-dettagli">
<liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="Allegati Domanda" > <liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="Allegati Domanda" >
<div class="row" id="<portlet:namespace/>allegati-table"> <div class="row" id="<portlet:namespace/>allegati-table">
@ -1338,7 +1400,7 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi
<c:if test="<%=accettoAtti.getIntPraticaId() == 0L %>"> <c:if test="<%=accettoAtti.getIntPraticaId() == 0L %>">
<h3> <h3>
Questo fascicolo non è disponibile sotto forma digitale. Potrà ritirare una copia cartacea presso uno degli Uffici del Settore Sismica. Questo fascicolo non è disponibile sotto forma digitale. Potrà ritirare una copia cartacea presso uno degli Uffici del Settore Sismica.
</h3> </h3>
</c:if> </c:if>

4
liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/WEB-INF/liferay-display.xml

@ -3,11 +3,11 @@
<display> <display>
<category name="category.hidden"> <category name="category.hidden">
<portlet id="1" /> <portlet id="1"></portlet>
</category> </category>
<category name="category.portos"> <category name="category.portos">
<category name="category.tools"> <category name="category.tools">
<portlet id="2" /> <portlet id="2"></portlet>
</category> </category>
</category> </category>
</display> </display>

4
liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/WEB-INF/liferay-hook.xml

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0"?>
<!DOCTYPE hook PUBLIC "-//Liferay//DTD Hook 6.2.0//EN" "http://www.liferay.com/dtd/liferay-hook_6_2_0.dtd"> <!DOCTYPE hook PUBLIC "-//Liferay//DTD Hook 6.2.0//EN" "http://www.liferay.com/dtd/liferay-hook_6_2_0.dtd">
<hook> <hook>
<portal-properties>portal.properties</portal-properties> <portal-properties>portal.properties</portal-properties>
<language-properties>content/Portal.properties</language-properties> <language-properties>content/Portal.properties</language-properties>
</hook> </hook>

109
liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/WEB-INF/service.xml

@ -1,94 +1,81 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0"?>
<!DOCTYPE service-builder PUBLIC "-//Liferay//DTD Service Builder 6.2.0//EN" "http://www.liferay.com/dtd/liferay-service-builder_6_2_0.dtd"> <!DOCTYPE service-builder PUBLIC "-//Liferay//DTD Service Builder 6.2.0//EN" "http://www.liferay.com/dtd/liferay-service-builder_6_2_0.dtd">
<service-builder package-path="it.tref.liferay.portos.audit"> <service-builder package-path="it.tref.liferay.portos.audit">
<author>Marco</author> <author>Marco</author>
<namespace>portos_AUDIT</namespace> <namespace>portos_AUDIT</namespace>
<entity name="AuditEvent" local-service="true" remote-service="false"> <entity name="AuditEvent" local-service="true" remote-service="false">
<column name="auditEventId" type="long" primary="true" /> <column name="auditEventId" type="long" primary="true"></column>
<column name="companyId" type="long"></column>
<column name="companyId" type="long" /> <column name="createDate" type="Date"></column>
<column name="createDate" type="Date" />
<!-- Dati dell'utente che ha effettuato l'operazione --> <!-- Dati dell'utente che ha effettuato l'operazione -->
<column name="userId" type="long" /> <column name="userId" type="long"></column>
<column name="userName" type="String" /> <column name="userName" type="String"></column>
<!-- Questo campo è utilizzato per definire la tipologia di audit STORICO, LOG --> <!-- Questo campo è utilizzato per definire la tipologia di audit STORICO, LOG -->
<column name="auditEventTable" type="String" /> <column name="auditEventTable" type="String"></column>
<!-- 3 Campi utilizzati per categorizzare gli eventi inseriti e migliorare la ricerca --> <!-- 3 Campi utilizzati per categorizzare gli eventi inseriti e migliorare la ricerca -->
<column name="eventType" type="String" /> <column name="eventType" type="String"></column>
<column name="eventCategory" type="String" /> <column name="eventCategory" type="String"></column>
<column name="eventAction" type="String" /> <column name="eventAction" type="String"></column>
<!--3 Campi per stabilire quale è l'oggetto di interesse in caso di urcgroupid= 0 si riferisce ad un evento globale--> <!--3 Campi per stabilire quale è l'oggetto di interesse in caso di urcgroupid= 0 si riferisce ad un evento globale-->
<column name="classNameId" type="long" /> <column name="classNameId" type="long"></column>
<column name="classPK" type="String" /> <column name="classPK" type="String"></column>
<column name="enteGroupId" type="long" /> <column name="enteGroupId" type="long"></column>
<column name="enteCodice" type="String" /> <column name="enteCodice" type="String"></column>
<!--2 Campi per stabilire quale è l'oggetto padre a cui è legato qeullo del log--> <!--2 Campi per stabilire quale è l'oggetto padre a cui è legato qeullo del log-->
<column name="parentClassNameId" type="long" /> <column name="parentClassNameId" type="long"></column>
<column name="parentClassPK" type="String" /> <column name="parentClassPK" type="String"></column>
<!--2 Campi per stabilire quale è l'aggetto a cui è relazionato il log (escluso il parent)--> <!--2 Campi per stabilire quale è l'aggetto a cui è relazionato il log (escluso il parent)-->
<column name="relatedClassNameId" type="long" /> <column name="relatedClassNameId" type="long"></column>
<column name="relatedClassPK" type="String" /> <column name="relatedClassPK" type="String"></column>
<!-- Messaggio testuale dell'evento --> <!-- Messaggio testuale dell'evento -->
<column name="message" type="String" /> <column name="message" type="String"></column>
<!-- Dati per lo storico --> <!-- Dati per lo storico -->
<column name="diff" type="String" /> <column name="diff" type="String"></column>
<!-- Dati generici dell'utente che ha effettuato l'operazione --> <!-- Dati generici dell'utente che ha effettuato l'operazione -->
<column name="clientHost" type="String" /> <column name="clientHost" type="String"></column>
<column name="clientIP" type="String" /> <column name="clientIP" type="String"></column>
<column name="serverName" type="String" /> <column name="serverName" type="String"></column>
<column name="serverPort" type="int" /> <column name="serverPort" type="int"></column>
<column name="sessionID" type="String" /> <column name="sessionID" type="String"></column>
<!-- Informazioni addizionale dell'evento --> <!-- Informazioni addizionale dell'evento -->
<column name="additionalInfo" type="String" /> <column name="additionalInfo" type="String"></column>
<order by="desc"> <order by="desc">
<order-column name="createDate" /> <order-column name="createDate"></order-column>
</order> </order>
<finder name="CompanyId" return-type="Collection"> <finder name="CompanyId" return-type="Collection">
<finder-column name="companyId" /> <finder-column name="companyId"></finder-column>
</finder> </finder>
<finder name="C_ClassNameId" return-type="Collection"> <finder name="C_ClassNameId" return-type="Collection">
<finder-column name="companyId" /> <finder-column name="companyId"></finder-column>
<finder-column name="classNameId" /> <finder-column name="classNameId"></finder-column>
</finder> </finder>
<finder name="C_ClassNameId_ClassPK" return-type="Collection"> <finder name="C_ClassNameId_ClassPK" return-type="Collection">
<finder-column name="companyId" /> <finder-column name="companyId"></finder-column>
<finder-column name="classNameId" /> <finder-column name="classNameId"></finder-column>
<finder-column name="classPK"/> <finder-column name="classPK"></finder-column>
</finder> </finder>
<finder name="C_ClassNameId_AuditEventTable" return-type="Collection"> <finder name="C_ClassNameId_AuditEventTable" return-type="Collection">
<finder-column name="companyId" /> <finder-column name="companyId"></finder-column>
<finder-column name="classNameId" /> <finder-column name="classNameId"></finder-column>
<finder-column name="auditEventTable"/> <finder-column name="auditEventTable"></finder-column>
</finder> </finder>
<finder name="C_ClassNameId_ClassPK_AuditEventTable" return-type="Collection"> <finder name="C_ClassNameId_ClassPK_AuditEventTable" return-type="Collection">
<finder-column name="companyId" /> <finder-column name="companyId"></finder-column>
<finder-column name="classNameId" /> <finder-column name="classNameId"></finder-column>
<finder-column name="classPK"/> <finder-column name="classPK"></finder-column>
<finder-column name="auditEventTable"/> <finder-column name="auditEventTable"></finder-column>
</finder> </finder>
<finder name="C_ParentClassNameId_ParentClassPK" return-type="Collection"> <finder name="C_ParentClassNameId_ParentClassPK" return-type="Collection">
<finder-column name="companyId" /> <finder-column name="companyId"></finder-column>
<finder-column name="parentClassNameId" /> <finder-column name="parentClassNameId"></finder-column>
<finder-column name="parentClassPK"/> <finder-column name="parentClassPK"></finder-column>
</finder> </finder>
<finder name="C_ParentClassNameId_ParentClassPK_ClassNameId" return-type="Collection"> <finder name="C_ParentClassNameId_ParentClassPK_ClassNameId" return-type="Collection">
<finder-column name="companyId" /> <finder-column name="companyId"></finder-column>
<finder-column name="parentClassNameId" /> <finder-column name="parentClassNameId"></finder-column>
<finder-column name="parentClassPK"/> <finder-column name="parentClassPK"></finder-column>
<finder-column name="classNameId" /> <finder-column name="classNameId"></finder-column>
</finder> </finder>
</entity> </entity>
</service-builder> </service-builder>

1
liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/common/details_column.jsp

@ -1,4 +1,3 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.liferay.portal.kernel.util.TextFormatter"%> <%@page import="com.liferay.portal.kernel.util.TextFormatter"%>
<%@page import="com.liferay.portal.kernel.json.JSONArray"%> <%@page import="com.liferay.portal.kernel.json.JSONArray"%>
<%@page import="it.tref.liferay.portos.audit.model.AuditEvent"%> <%@page import="it.tref.liferay.portos.audit.model.AuditEvent"%>

1
liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/common/relations_column.jsp

@ -1,4 +1,3 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.liferay.portal.kernel.util.TextFormatter"%> <%@page import="com.liferay.portal.kernel.util.TextFormatter"%>
<%@page import="com.liferay.portal.kernel.json.JSONArray"%> <%@page import="com.liferay.portal.kernel.json.JSONArray"%>
<%@page import="it.tref.liferay.portos.audit.model.AuditEvent"%> <%@page import="it.tref.liferay.portos.audit.model.AuditEvent"%>

1
liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/detail/detail.jsp

@ -1,4 +1,3 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.liferay.portos.audit.shared.permission.HistoryPermission"%> <%@page import="it.tref.liferay.portos.audit.shared.permission.HistoryPermission"%>
<%@page import="com.liferay.portal.security.permission.ActionKeys"%> <%@page import="com.liferay.portal.security.permission.ActionKeys"%>

1
liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/detail/view.jsp

@ -1,4 +1,3 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.liferay.portos.audit.shared.permission.HistoryPermission"%> <%@page import="it.tref.liferay.portos.audit.shared.permission.HistoryPermission"%>
<%@page import="com.liferay.portal.security.permission.ActionKeys"%> <%@page import="com.liferay.portal.security.permission.ActionKeys"%>

1
liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/detail/view_list.jsp

@ -1,4 +1,3 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.liferay.portos.audit.shared.permission.HistoryPermission"%> <%@page import="it.tref.liferay.portos.audit.shared.permission.HistoryPermission"%>
<%@page import="com.liferay.portal.security.permission.ActionKeys"%> <%@page import="com.liferay.portal.security.permission.ActionKeys"%>

1
liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/init.jsp

@ -1,4 +1,3 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %> <%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

1
liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/storicizzazione/edit.jsp

@ -1,4 +1,3 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/html/init.jsp" %> <%@ include file="/html/init.jsp" %>

1
liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/storicizzazione/view.jsp

@ -1,4 +1,3 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/html/init.jsp" %> <%@ include file="/html/init.jsp" %>

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

@ -4,22 +4,22 @@
<display> <display>
<category name="category.portos"> <category name="category.portos">
<category name="category.bo"> <category name="category.bo">
<portlet id="1" /> <portlet id="1"></portlet>
<portlet id="2" /> <portlet id="2"></portlet>
<portlet id="4" /> <portlet id="4"></portlet>
<portlet id="6" /> <portlet id="6"></portlet>
<portlet id="8" /> <portlet id="8"></portlet>
<portlet id="13" /> <portlet id="13"></portlet>
<portlet id="22" /> <portlet id="22"></portlet>
<portlet id="ricerca-posizione" /> <portlet id="ricerca-posizione"></portlet>
</category> </category>
</category> </category>
<category name="category.hidden"> <category name="category.hidden">
<portlet id="5" /> <portlet id="5"></portlet>
<portlet id="7" /> <portlet id="7"></portlet>
<portlet id="9" /> <portlet id="9"></portlet>
<portlet id="11" /> <portlet id="11"></portlet>
<portlet id="12" /> <portlet id="12"></portlet>
<portlet id="portos-administration" /> <portlet id="portos-administration"></portlet>
</category> </category>
</display> </display>

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

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0"?>
<!DOCTYPE hook PUBLIC "-//Liferay//DTD Hook 6.2.0//EN" "http://www.liferay.com/dtd/liferay-hook_6_2_0.dtd"> <!DOCTYPE hook PUBLIC "-//Liferay//DTD Hook 6.2.0//EN" "http://www.liferay.com/dtd/liferay-hook_6_2_0.dtd">
<hook> <hook>

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

File diff soppresso perché troppo grande Load Diff

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

@ -220,6 +220,7 @@ public class IntPraticaSearch extends BaseSearch {
// Condizioni aggiuntive // Condizioni aggiuntive
fullQuery(request, user, query, searchContext); fullQuery(request, user, query, searchContext);
hits = SearchEngineUtil.search(searchContext, query); hits = SearchEngineUtil.search(searchContext, query);
_log.info(query);
logResults(query, hits); logResults(query, hits);
} catch (ParseException | SearchException | java.text.ParseException e) { } catch (ParseException | SearchException | java.text.ParseException e) {
_log.error(e, e); _log.error(e, e);

120
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service.xml

@ -1,107 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0"?>
<!DOCTYPE service-builder PUBLIC "-//Liferay//DTD Service Builder 6.1.0//EN" "http://www.liferay.com/dtd/liferay-service-builder_6_1_0.dtd"> <!DOCTYPE service-builder PUBLIC "-//Liferay//DTD Service Builder 6.1.0//EN" "http://www.liferay.com/dtd/liferay-service-builder_6_1_0.dtd">
<service-builder package-path="it.tref.portos.calendar.appointments"> <service-builder package-path="it.tref.portos.calendar.appointments">
<author>3F Consulting + Manifattura Web Group s.r.l.</author> <author>3F Consulting</author>
<namespace>portos_calendar_appointments</namespace> <namespace>portos_calendar_appointments</namespace>
<entity name="Funzionario" local-service="true" remote-service="true" uuid="true"> <entity name="Funzionario" local-service="true" remote-service="true" uuid="true">
<!-- PK fields --> <!-- PK fields -->
<column name="funzionarioId" type="long" primary="true" /> <column name="funzionarioId" type="long" primary="true"></column>
<!-- Audit fields --> <!-- Audit fields -->
<column name="companyId" type="long" /> <column name="companyId" type="long"></column>
<column name="userId" type="long" /> <column name="userId" type="long"></column>
<column name="userName" type="String" /> <column name="userName" type="String"></column>
<column name="createDate" type="Date" /> <column name="createDate" type="Date"></column>
<column name="modifiedDate" type="Date" /> <column name="modifiedDate" type="Date"></column>
<column name="groupId" type="long" /> <column name="groupId" type="long"></column>
<!-- Other fields --> <!-- Other fields -->
<column name="nome" type="String" /> <column name="nome" type="String"></column>
<column name="cognome" type="String" /> <column name="cognome" type="String"></column>
<column name="presidio" type="String" /> <column name="presidio" type="String"></column>
<column name="tipologia" type="String" /> <column name="tipologia" type="String"></column>
<!-- Finder --> <!-- Finder -->
<finder return-type="Funzionario" name="Funzionario"> <finder return-type="Funzionario" name="Funzionario">
<finder-column name="funzionarioId" /> <finder-column name="funzionarioId"></finder-column>
</finder> </finder>
<finder return-type="Collection" name="Presidio"> <finder return-type="Collection" name="Presidio">
<finder-column name="presidio" /> <finder-column name="presidio"></finder-column>
</finder> </finder>
</entity> </entity>
<entity name="Professionista" local-service="true" remote-service="true" uuid="true"> <entity name="Professionista" local-service="true" remote-service="true" uuid="true">
<!-- PK fields --> <!-- PK fields -->
<column name="professionistaId" type="long" primary="true" /> <column name="professionistaId" type="long" primary="true"></column>
<!-- Audit fields --> <!-- Audit fields -->
<column name="companyId" type="long" /> <column name="companyId" type="long"></column>
<column name="userId" type="long" /> <column name="userId" type="long"></column>
<column name="userName" type="String" /> <column name="userName" type="String"></column>
<column name="createDate" type="Date" /> <column name="createDate" type="Date"></column>
<column name="modifiedDate" type="Date" /> <column name="modifiedDate" type="Date"></column>
<column name="groupId" type="long" /> <column name="groupId" type="long"></column>
<!-- Other fields --> <!-- Other fields -->
<column name="nome" type="String" /> <column name="nome" type="String"></column>
<column name="cognome" type="String" /> <column name="cognome" type="String"></column>
</entity> </entity>
<entity name="Disponibilita" local-service="true" remote-service="true" uuid="true"> <entity name="Disponibilita" local-service="true" remote-service="true" uuid="true">
<!-- PK fields --> <!-- PK fields -->
<column name="disponibilitaId" type="long" primary="true" /> <column name="disponibilitaId" type="long" primary="true"></column>
<!-- Audit fields --> <!-- Audit fields -->
<column name="companyId" type="long" /> <column name="companyId" type="long"></column>
<column name="userId" type="long" /> <column name="userId" type="long"></column>
<column name="userName" type="String" /> <column name="userName" type="String"></column>
<column name="createDate" type="Date" /> <column name="createDate" type="Date"></column>
<column name="modifiedDate" type="Date" /> <column name="modifiedDate" type="Date"></column>
<column name="groupId" type="long" /> <column name="groupId" type="long"></column>
<!-- Other fields --> <!-- Other fields -->
<column name="funzionarioId" type="long" /> <column name="funzionarioId" type="long"></column>
<column name="startDate" type="Date" /> <column name="startDate" type="Date"></column>
<column name="endDate" type="Date" /> <column name="endDate" type="Date"></column>
<column name="exactDate" type="String" /> <column name="exactDate" type="String"></column>
<column name="presidio" type="long" /> <column name="presidio" type="long"></column>
<column name="disponibile" type="boolean" /> <column name="disponibile" type="boolean"></column>
</entity> </entity>
<entity name="Prenotazione" local-service="true" remote-service="true" uuid="true"> <entity name="Prenotazione" local-service="true" remote-service="true" uuid="true">
<!-- PK fields --> <!-- PK fields -->
<column name="prenotazioneId" type="long" primary="true" /> <column name="prenotazioneId" type="long" primary="true"></column>
<!-- Audit fields --> <!-- Audit fields -->
<column name="companyId" type="long" /> <column name="companyId" type="long"></column>
<column name="userId" type="long" /> <column name="userId" type="long"></column>
<column name="userName" type="String" /> <column name="userName" type="String"></column>
<column name="createDate" type="Date" /> <column name="createDate" type="Date"></column>
<column name="modifiedDate" type="Date" /> <column name="modifiedDate" type="Date"></column>
<column name="groupId" type="long" /> <column name="groupId" type="long"></column>
<!-- Other fields --> <!-- Other fields -->
<column name="funzionarioId" type="long" /> <column name="funzionarioId" type="long"></column>
<column name="professionistaId" type="long" /> <column name="professionistaId" type="long"></column>
<column name="startDate" type="Date" /> <column name="startDate" type="Date"></column>
<column name="endDate" type="Date" /> <column name="endDate" type="Date"></column>
<column name="descLong" type="String" /> <column name="descLong" type="String"></column>
<!-- Product Backlog Item 32934 --> <!-- Product Backlog Item 32934 -->
<column name="telefono" type="String" /> <column name="telefono" type="String"></column>
<column name="email" type="String" /> <column name="email" type="String"></column>
<!-- Finder --> <!-- Finder -->
<finder return-type="Prenotazione" name="prenotazione"> <finder return-type="Prenotazione" name="prenotazione">
<finder-column name="prenotazioneId" /> <finder-column name="prenotazioneId"></finder-column>
</finder> </finder>
<finder return-type="Collection" name="Funzionario_StartDate"> <finder return-type="Collection" name="Funzionario_StartDate">
<finder-column name="funzionarioId" /> <finder-column name="funzionarioId"></finder-column>
<finder-column name="startDate" /> <finder-column name="startDate"></finder-column>
</finder> </finder>
<finder return-type="Collection" name="StartDate"> <finder return-type="Collection" name="StartDate">
<finder-column name="startDate" /> <finder-column name="startDate"></finder-column>
</finder> </finder>
</entity> </entity>
<exceptions> <exceptions>
<exception>DuplicateFunzionario</exception> <exception>DuplicateFunzionario</exception>
<exception>DuplicateProfessionista</exception> <exception>DuplicateProfessionista</exception>
<exception>DuplicatePrenotazione</exception> <exception>DuplicatePrenotazione</exception>
<exception>SlotNotAvailable</exception> <exception>SlotNotAvailable</exception>
</exceptions> </exceptions>
</service-builder> </service-builder>

21
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/DuplicateFunzionarioException.java

@ -1,9 +1,15 @@
/** /**
* Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. This library is free software; you can redistribute it * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
* and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software *
* Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in * This library is free software; you can redistribute it and/or modify it under
* the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * the terms of the GNU Lesser General Public License as published by the Free
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. * Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/ */
package it.tref.portos.calendar.appointments; package it.tref.portos.calendar.appointments;
@ -11,9 +17,8 @@ package it.tref.portos.calendar.appointments;
import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception.PortalException;
/** /**
* @author 3F Consulting + Manifattura Web Group s.r.l. * @author 3F Consulting
*/ */
@SuppressWarnings("serial")
public class DuplicateFunzionarioException extends PortalException { public class DuplicateFunzionarioException extends PortalException {
public DuplicateFunzionarioException() { public DuplicateFunzionarioException() {
@ -32,4 +37,4 @@ public class DuplicateFunzionarioException extends PortalException {
super(cause); super(cause);
} }
} }

21
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/DuplicatePrenotazioneException.java

@ -1,9 +1,15 @@
/** /**
* Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. This library is free software; you can redistribute it * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
* and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software *
* Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in * This library is free software; you can redistribute it and/or modify it under
* the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * the terms of the GNU Lesser General Public License as published by the Free
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. * Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/ */
package it.tref.portos.calendar.appointments; package it.tref.portos.calendar.appointments;
@ -11,9 +17,8 @@ package it.tref.portos.calendar.appointments;
import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception.PortalException;
/** /**
* @author 3F Consulting + Manifattura Web Group s.r.l. * @author 3F Consulting
*/ */
@SuppressWarnings("serial")
public class DuplicatePrenotazioneException extends PortalException { public class DuplicatePrenotazioneException extends PortalException {
public DuplicatePrenotazioneException() { public DuplicatePrenotazioneException() {
@ -32,4 +37,4 @@ public class DuplicatePrenotazioneException extends PortalException {
super(cause); super(cause);
} }
} }

21
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/DuplicateProfessionistaException.java

@ -1,9 +1,15 @@
/** /**
* Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. This library is free software; you can redistribute it * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
* and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software *
* Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in * This library is free software; you can redistribute it and/or modify it under
* the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * the terms of the GNU Lesser General Public License as published by the Free
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. * Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/ */
package it.tref.portos.calendar.appointments; package it.tref.portos.calendar.appointments;
@ -11,9 +17,8 @@ package it.tref.portos.calendar.appointments;
import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception.PortalException;
/** /**
* @author 3F Consulting + Manifattura Web Group s.r.l. * @author 3F Consulting
*/ */
@SuppressWarnings("serial")
public class DuplicateProfessionistaException extends PortalException { public class DuplicateProfessionistaException extends PortalException {
public DuplicateProfessionistaException() { public DuplicateProfessionistaException() {
@ -32,4 +37,4 @@ public class DuplicateProfessionistaException extends PortalException {
super(cause); super(cause);
} }
} }

21
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/NoSuchDisponibilitaException.java

@ -1,9 +1,15 @@
/** /**
* Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. This library is free software; you can redistribute it * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
* and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software *
* Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in * This library is free software; you can redistribute it and/or modify it under
* the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * the terms of the GNU Lesser General Public License as published by the Free
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. * Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/ */
package it.tref.portos.calendar.appointments; package it.tref.portos.calendar.appointments;
@ -11,9 +17,8 @@ package it.tref.portos.calendar.appointments;
import com.liferay.portal.NoSuchModelException; import com.liferay.portal.NoSuchModelException;
/** /**
* @author 3F Consulting + Manifattura Web Group s.r.l. * @author 3F Consulting
*/ */
@SuppressWarnings("serial")
public class NoSuchDisponibilitaException extends NoSuchModelException { public class NoSuchDisponibilitaException extends NoSuchModelException {
public NoSuchDisponibilitaException() { public NoSuchDisponibilitaException() {
@ -32,4 +37,4 @@ public class NoSuchDisponibilitaException extends NoSuchModelException {
super(cause); super(cause);
} }
} }

21
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/NoSuchFunzionarioException.java

@ -1,9 +1,15 @@
/** /**
* Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. This library is free software; you can redistribute it * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
* and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software *
* Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in * This library is free software; you can redistribute it and/or modify it under
* the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * the terms of the GNU Lesser General Public License as published by the Free
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. * Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/ */
package it.tref.portos.calendar.appointments; package it.tref.portos.calendar.appointments;
@ -11,9 +17,8 @@ package it.tref.portos.calendar.appointments;
import com.liferay.portal.NoSuchModelException; import com.liferay.portal.NoSuchModelException;
/** /**
* @author 3F Consulting + Manifattura Web Group s.r.l. * @author 3F Consulting
*/ */
@SuppressWarnings("serial")
public class NoSuchFunzionarioException extends NoSuchModelException { public class NoSuchFunzionarioException extends NoSuchModelException {
public NoSuchFunzionarioException() { public NoSuchFunzionarioException() {
@ -32,4 +37,4 @@ public class NoSuchFunzionarioException extends NoSuchModelException {
super(cause); super(cause);
} }
} }

21
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/NoSuchPrenotazioneException.java

@ -1,9 +1,15 @@
/** /**
* Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. This library is free software; you can redistribute it * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
* and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software *
* Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in * This library is free software; you can redistribute it and/or modify it under
* the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * the terms of the GNU Lesser General Public License as published by the Free
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. * Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/ */
package it.tref.portos.calendar.appointments; package it.tref.portos.calendar.appointments;
@ -11,9 +17,8 @@ package it.tref.portos.calendar.appointments;
import com.liferay.portal.NoSuchModelException; import com.liferay.portal.NoSuchModelException;
/** /**
* @author 3F Consulting + Manifattura Web Group s.r.l. * @author 3F Consulting
*/ */
@SuppressWarnings("serial")
public class NoSuchPrenotazioneException extends NoSuchModelException { public class NoSuchPrenotazioneException extends NoSuchModelException {
public NoSuchPrenotazioneException() { public NoSuchPrenotazioneException() {
@ -32,4 +37,4 @@ public class NoSuchPrenotazioneException extends NoSuchModelException {
super(cause); super(cause);
} }
} }

21
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/NoSuchProfessionistaException.java

@ -1,9 +1,15 @@
/** /**
* Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. This library is free software; you can redistribute it * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
* and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software *
* Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in * This library is free software; you can redistribute it and/or modify it under
* the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * the terms of the GNU Lesser General Public License as published by the Free
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. * Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/ */
package it.tref.portos.calendar.appointments; package it.tref.portos.calendar.appointments;
@ -11,9 +17,8 @@ package it.tref.portos.calendar.appointments;
import com.liferay.portal.NoSuchModelException; import com.liferay.portal.NoSuchModelException;
/** /**
* @author 3F Consulting + Manifattura Web Group s.r.l. * @author 3F Consulting
*/ */
@SuppressWarnings("serial")
public class NoSuchProfessionistaException extends NoSuchModelException { public class NoSuchProfessionistaException extends NoSuchModelException {
public NoSuchProfessionistaException() { public NoSuchProfessionistaException() {
@ -32,4 +37,4 @@ public class NoSuchProfessionistaException extends NoSuchModelException {
super(cause); super(cause);
} }
} }

21
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/service/it/tref/portos/calendar/appointments/SlotNotAvailableException.java

@ -1,9 +1,15 @@
/** /**
* Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. This library is free software; you can redistribute it * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
* and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software *
* Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in * This library is free software; you can redistribute it and/or modify it under
* the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * the terms of the GNU Lesser General Public License as published by the Free
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. * Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/ */
package it.tref.portos.calendar.appointments; package it.tref.portos.calendar.appointments;
@ -11,9 +17,8 @@ package it.tref.portos.calendar.appointments;
import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception.PortalException;
/** /**
* @author 3F Consulting + Manifattura Web Group s.r.l. * @author 3F Consulting
*/ */
@SuppressWarnings("serial")
public class SlotNotAvailableException extends PortalException { public class SlotNotAvailableException extends PortalException {
public SlotNotAvailableException() { public SlotNotAvailableException() {
@ -32,4 +37,4 @@ public class SlotNotAvailableException extends PortalException {
super(cause); super(cause);
} }
} }

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

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

48
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/model/impl/FunzionarioImpl.java

@ -1,9 +1,13 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
* and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software *
* Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in * This library is free software; you can redistribute it and/or modify it under the terms of the
* the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * GNU Lesser General Public License as published by the Free Software Foundation; either version
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. * 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/ */
package it.tref.portos.calendar.appointments.model.impl; package it.tref.portos.calendar.appointments.model.impl;
@ -12,26 +16,28 @@ import com.liferay.portal.kernel.util.StringPool;
/** /**
* The extended model implementation for the Funzionario service. Represents a row in the * The extended model implementation for the Funzionario service. Represents a row in the
* &quot;portos_calendar_appointments_Funzionario&quot; database table, with each column mapped to a property of this * &quot;portos_calendar_appointments_Funzionario&quot; database table, with each column mapped to a
* class. * property of this class.
*
* <p> * <p>
* Helper methods and all application logic should be put in this class. Whenever methods are added, rerun * Helper methods and all application logic should be put in this class. Whenever methods are added,
* ServiceBuilder to copy their definitions into the {@link it.tref.portos.calendar.appointments.model.Funzionario} * rerun ServiceBuilder to copy their definitions into the
* interface. * {@link it.tref.portos.calendar.appointments.model.Funzionario} interface.
* </p> * </p>
* *
* @author 3F Consulting + Manifattura Web Group s.r.l. * @author 3F Consulting
*/ */
@SuppressWarnings("serial")
public class FunzionarioImpl extends FunzionarioBaseImpl { public class FunzionarioImpl extends FunzionarioBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a funzionario model instance * NOTE FOR DEVELOPERS:
* should use the {@link it.tref.portos.calendar.appointments.model.Funzionario} interface instead. *
*/ * Never reference this class directly. All methods that expect a funzionario model instance
public FunzionarioImpl() {} * should use the {@link it.tref.portos.calendar.appointments.model.Funzionario} interface
* instead.
*/
public FunzionarioImpl() {}
@Override public String getFullDescription() {
public String getFullDescription() { return getNome() + StringPool.SPACE + getCognome();
return getNome() + StringPool.SPACE + getCognome(); }
}
} }

57
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/model/impl/PrenotazioneImpl.java

@ -1,9 +1,13 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
* and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software *
* Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in * This library is free software; you can redistribute it and/or modify it under the terms of the
* the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * GNU Lesser General Public License as published by the Free Software Foundation; either version
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. * 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/ */
package it.tref.portos.calendar.appointments.model.impl; package it.tref.portos.calendar.appointments.model.impl;
@ -14,27 +18,38 @@ import org.apache.commons.lang.time.DateUtils;
/** /**
* The extended model implementation for the Prenotazione service. Represents a row in the * The extended model implementation for the Prenotazione service. Represents a row in the
* &quot;portos_calendar_appointments_Prenotazione&quot; database table, with each column mapped to a property of this * &quot;portos_calendar_appointments_Prenotazione&quot; database table, with each column mapped to
* class. * a property of this class.
*
* <p> * <p>
* Helper methods and all application logic should be put in this class. Whenever methods are added, rerun * Helper methods and all application logic should be put in this class. Whenever methods are added,
* ServiceBuilder to copy their definitions into the {@link it.tref.portos.calendar.appointments.model.Prenotazione} * rerun ServiceBuilder to copy their definitions into the
* interface. * {@link it.tref.portos.calendar.appointments.model.Prenotazione} interface.
* </p> * </p>
* *
* @author 3F Consulting + Manifattura Web Group s.r.l. * @author 3F Consulting
*/ */
@SuppressWarnings("serial")
public class PrenotazioneImpl extends PrenotazioneBaseImpl { public class PrenotazioneImpl extends PrenotazioneBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a prenotazione model instance * NOTE FOR DEVELOPERS:
* should use the {@link it.tref.portos.calendar.appointments.model.Prenotazione} interface instead. *
*/ * Never reference this class directly. All methods that expect a prenotazione model instance
public PrenotazioneImpl() {} * should use the {@link it.tref.portos.calendar.appointments.model.Prenotazione} interface
* instead.
*/
public PrenotazioneImpl() {}
public boolean isExpired(Date now) {
if (now.after(getStartDate())) {
return true;
}
if (DateUtils.isSameDay(now, getStartDate())) {
return true;
@Override }
public boolean isExpired(Date now) {
return now.after(getStartDate()) || DateUtils.isSameDay(now, getStartDate()); return false;
} }
} }

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

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

558
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/DisponibilitaLocalServiceImpl.java

@ -1,9 +1,13 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
* and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software *
* Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in * This library is free software; you can redistribute it and/or modify it under the terms of the
* the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * GNU Lesser General Public License as published by the Free Software Foundation; either version
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. * 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/ */
package it.tref.portos.calendar.appointments.service.impl; package it.tref.portos.calendar.appointments.service.impl;
@ -26,13 +30,11 @@ import com.liferay.portal.kernel.dao.orm.DynamicQuery;
import com.liferay.portal.kernel.dao.orm.Order; import com.liferay.portal.kernel.dao.orm.Order;
import com.liferay.portal.kernel.dao.orm.OrderFactoryUtil; import com.liferay.portal.kernel.dao.orm.OrderFactoryUtil;
import com.liferay.portal.kernel.dao.orm.PropertyFactoryUtil; import com.liferay.portal.kernel.dao.orm.PropertyFactoryUtil;
import com.liferay.portal.kernel.dao.orm.QueryUtil;
import com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil; import com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil;
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.util.StringPool;
import com.liferay.portal.model.Organization; import com.liferay.portal.model.Organization;
import com.liferay.portal.model.Role; import com.liferay.portal.model.Role;
import com.liferay.portal.model.User; import com.liferay.portal.model.User;
@ -40,508 +42,650 @@ import com.liferay.portal.service.OrganizationLocalServiceUtil;
import com.liferay.portal.service.RoleLocalServiceUtil; import com.liferay.portal.service.RoleLocalServiceUtil;
import com.liferay.portal.service.ServiceContext; import com.liferay.portal.service.ServiceContext;
import com.liferay.portal.service.UserGroupRoleLocalServiceUtil; import com.liferay.portal.service.UserGroupRoleLocalServiceUtil;
import com.liferay.portal.service.UserLocalServiceUtil;
/** /**
* The implementation of the disponibilita local service. * The implementation of the disponibilita local service.
*
* <p> * <p>
* All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy * All custom service methods should be put in this class. Whenever methods are added, rerun
* their definitions into the {@link it.tref.portos.calendar.appointments.service.DisponibilitaLocalService} interface. * ServiceBuilder to copy their definitions into the
* {@link it.tref.portos.calendar.appointments.service.DisponibilitaLocalService} interface.
*
* <p> * <p>
* This is a local service. Methods of this service will not have security checks based on the propagated JAAS * This is a local service. Methods of this service will not have security checks based on the
* credentials because this service can only be accessed from within the same VM. * propagated JAAS credentials because this service can only be accessed from within the same VM.
* </p> * </p>
* *
* @author 3F Consulting + Manifattura Web Group s.r.l. * @author 3F Consulting
* @see it.tref.portos.calendar.appointments.service.base.DisponibilitaLocalServiceBaseImpl * @see it.tref.portos.calendar.appointments.service.base.DisponibilitaLocalServiceBaseImpl
* @see it.tref.portos.calendar.appointments.service.DisponibilitaLocalServiceUtil * @see it.tref.portos.calendar.appointments.service.DisponibilitaLocalServiceUtil
*/ */
public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBaseImpl { public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link * NOTE FOR DEVELOPERS:
* it.tref.portos.calendar.appointments.service.DisponibilitaLocalServiceUtil} to access the disponibilita local *
* service. * Never reference this interface directly. Always use {@link
* it.tref.portos.calendar.appointments.service.DisponibilitaLocalServiceUtil} to access the
* disponibilita local service.
*/ */
private static Log _log = LogFactoryUtil.getLog(DisponibilitaLocalServiceImpl.class); private static Log _log = LogFactoryUtil.getLog(DisponibilitaLocalServiceImpl.class);
@Override //Bug 32935
public long checkDisponibilitaExist(long funzionarioId, Date startDate, Date endDate) throws SystemException { public long checkDisponibilitaExist(long funzionarioId, Date startDate, Date endDate) throws SystemException{
long exist = 0L; long exist = 0L;
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
DynamicQuery dynamicQuery = dynamicQuery(); DynamicQuery dynamicQuery = dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.eq("funzionarioId", funzionarioId)); dynamicQuery.add(RestrictionsFactoryUtil.eq("funzionarioId", funzionarioId));
dynamicQuery.add(RestrictionsFactoryUtil.eq("exactDate", sdf.format(startDate))); dynamicQuery.add(RestrictionsFactoryUtil.eq("exactDate", sdf.format(startDate)));
dynamicQuery.add(RestrictionsFactoryUtil.eq("startDate", startDate));
dynamicQuery.add(RestrictionsFactoryUtil.eq("endDate", endDate)); //Bug 32935
@SuppressWarnings("unchecked") dynamicQuery.add(RestrictionsFactoryUtil.eq("startDate",startDate));
dynamicQuery.add(RestrictionsFactoryUtil.eq("endDate",endDate));
List<Disponibilita> results = disponibilitaPersistence.findWithDynamicQuery(dynamicQuery); List<Disponibilita> results = disponibilitaPersistence.findWithDynamicQuery(dynamicQuery);
if (!results.isEmpty()) { if(!results.isEmpty()){
exist = results.get(0).getDisponibilitaId(); exist = results.get(0).getDisponibilitaId();
} }
return exist; return exist;
} }
@Override public long checkDisponibilitaExist(long funzionarioId, Date startDate, Date endDate, long presidio) throws SystemException{
public long checkDisponibilitaExist(long funzionarioId, Date startDate, Date endDate, long presidio)
throws SystemException {
long exist = 0L; long exist = 0L;
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
DynamicQuery dynamicQuery = dynamicQuery(); DynamicQuery dynamicQuery = dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.eq("funzionarioId", funzionarioId)); dynamicQuery.add(RestrictionsFactoryUtil.eq("funzionarioId", funzionarioId));
dynamicQuery.add(RestrictionsFactoryUtil.eq("exactDate", sdf.format(startDate))); dynamicQuery.add(RestrictionsFactoryUtil.eq("exactDate", sdf.format(startDate)));
dynamicQuery.add(RestrictionsFactoryUtil.eq("presidio", presidio)); dynamicQuery.add(RestrictionsFactoryUtil.eq("presidio",presidio));
dynamicQuery.add(RestrictionsFactoryUtil.eq("startDate", startDate));
dynamicQuery.add(RestrictionsFactoryUtil.eq("endDate", endDate)); //Bug 32935
@SuppressWarnings("unchecked") dynamicQuery.add(RestrictionsFactoryUtil.eq("startDate",startDate));
dynamicQuery.add(RestrictionsFactoryUtil.eq("endDate",endDate));
List<Disponibilita> results = disponibilitaPersistence.findWithDynamicQuery(dynamicQuery); List<Disponibilita> results = disponibilitaPersistence.findWithDynamicQuery(dynamicQuery);
if (!results.isEmpty()) { if(!results.isEmpty()){
exist = results.get(0).getDisponibilitaId(); exist = results.get(0).getDisponibilitaId();
} }
return exist; return exist;
} }
@Override
public Disponibilita addDisponibilita(long userId, long funzionarioId, Date startDate, Date endDate, long presidio, public Disponibilita addDisponibilita(long userId, long funzionarioId, Date startDate, Date endDate, long presidio,
ServiceContext serviceContext) throws SystemException, PortalException { ServiceContext serviceContext) throws SystemException, PortalException {
Organization organization = OrganizationLocalServiceUtil.fetchOrganization(presidio); Organization organization = OrganizationLocalServiceUtil.fetchOrganization(presidio);
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
Disponibilita disponibilita = Disponibilita disponibilita =
disponibilitaPersistence.create(counterLocalService.increment(Disponibilita.class.getName())); disponibilitaPersistence.create(counterLocalService.increment(Disponibilita.class.getName()));
User user = userPersistence.findByPrimaryKey(userId); User user = userPersistence.findByPrimaryKey(userId);
Date now = new Date(); Date now = new Date();
disponibilita.setCompanyId(serviceContext.getCompanyId()); disponibilita.setCompanyId(serviceContext.getCompanyId());
disponibilita.setUserId(user.getUserId()); disponibilita.setUserId(user.getUserId());
disponibilita.setUserName(user.getFullName()); disponibilita.setUserName(user.getFullName());
disponibilita.setCreateDate(serviceContext.getCreateDate(now)); disponibilita.setCreateDate(serviceContext.getCreateDate(now));
disponibilita.setModifiedDate(serviceContext.getModifiedDate(now)); disponibilita.setModifiedDate(serviceContext.getModifiedDate(now));
disponibilita.setGroupId(organization.getGroupId()); disponibilita.setGroupId(organization.getGroupId());
disponibilita.setFunzionarioId(funzionarioId); disponibilita.setFunzionarioId(funzionarioId);
disponibilita.setStartDate(startDate); disponibilita.setStartDate(startDate);
disponibilita.setEndDate(endDate); disponibilita.setEndDate(endDate);
disponibilita.setPresidio(presidio); disponibilita.setPresidio(presidio);
disponibilita.setExactDate(sdf.format(startDate)); disponibilita.setExactDate(sdf.format(startDate));
disponibilita.setDisponibile(true); disponibilita.setDisponibile(true);
disponibilita = updateDisponibilita(disponibilita);
disponibilita = disponibilitaLocalService.updateDisponibilita(disponibilita);
return disponibilita; return disponibilita;
} }
public Disponibilita addIndisponibilita(long userId, long funzionarioId, Date startDate, Date endDate, long presidio,
ServiceContext serviceContext) throws SystemException, PortalException {
@Override Organization organization = OrganizationLocalServiceUtil.fetchOrganization(presidio);
public Disponibilita addIndisponibilita(long userId, long funzionarioId, Date startDate, Date endDate,
long presidio, ServiceContext serviceContext) throws SystemException, PortalException { SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
Organization organization = OrganizationLocalServiceUtil.fetchOrganization(presidio);
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
Disponibilita disponibilita = Disponibilita disponibilita =
disponibilitaPersistence.create(counterLocalService.increment(Disponibilita.class.getName())); disponibilitaPersistence.create(counterLocalService.increment(Disponibilita.class.getName()));
User user = userPersistence.findByPrimaryKey(userId); User user = userPersistence.findByPrimaryKey(userId);
Date now = new Date(); Date now = new Date();
disponibilita.setCompanyId(serviceContext.getCompanyId()); disponibilita.setCompanyId(serviceContext.getCompanyId());
disponibilita.setUserId(user.getUserId()); disponibilita.setUserId(user.getUserId());
disponibilita.setUserName(user.getFullName()); disponibilita.setUserName(user.getFullName());
disponibilita.setCreateDate(serviceContext.getCreateDate(now)); disponibilita.setCreateDate(serviceContext.getCreateDate(now));
disponibilita.setModifiedDate(serviceContext.getModifiedDate(now)); disponibilita.setModifiedDate(serviceContext.getModifiedDate(now));
disponibilita.setGroupId(organization.getGroupId()); disponibilita.setGroupId(organization.getGroupId());
disponibilita.setFunzionarioId(funzionarioId); disponibilita.setFunzionarioId(funzionarioId);
disponibilita.setStartDate(startDate); disponibilita.setStartDate(startDate);
disponibilita.setEndDate(endDate); disponibilita.setEndDate(endDate);
disponibilita.setPresidio(presidio); disponibilita.setPresidio(presidio);
disponibilita.setExactDate(sdf.format(startDate)); disponibilita.setExactDate(sdf.format(startDate));
disponibilita.setDisponibile(false); disponibilita.setDisponibile(false);
disponibilita = updateDisponibilita(disponibilita);
disponibilita = disponibilitaLocalService.updateDisponibilita(disponibilita);
return disponibilita; return disponibilita;
} }
@Override public void addDisponibilitaGenerale(long userId, Date startDate, Date endDate, long presidioId,
public void addDisponibilitaGenerale(long userId, Date startDate, Date endDate, long presidioId, String oraInizio, String oraInizio, String oraFine, int giornoSettimana, ServiceContext serviceContext) throws SystemException, PortalException, ParseException{
String oraFine, int giornoSettimana, ServiceContext serviceContext) throws SystemException,
PortalException, ParseException {
Organization organization = OrganizationLocalServiceUtil.fetchOrganization(presidioId); Organization organization = OrganizationLocalServiceUtil.fetchOrganization(presidioId);
List<User> userDefinitivo = new ArrayList<User>(); List<User> userDefinitivo = new ArrayList<User>();
try { try {
if (organization != null) {
List<User> users = userLocalService.getOrganizationUsers(presidioId); if(organization != null){
List<User> users = UserLocalServiceUtil.getOrganizationUsers(presidioId);
for (User user : users) { for (User user : users) {
Role portosSupporto = RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_supporto"); Role portosSupporto = RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_supporto");
Role portosIstruttore =
RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_calendario"); Role portosIstruttore = RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_calendario");
if (!userLocalService.hasRoleUser(portosSupporto.getRoleId(), user.getUserId())) {
boolean isIstruttore = if(!UserLocalServiceUtil.hasRoleUser(portosSupporto.getRoleId(), user.getUserId())){
UserGroupRoleLocalServiceUtil.hasUserGroupRole(user.getUserId(),
organization.getGroupId(), portosIstruttore.getRoleId()); boolean isIstruttore = UserGroupRoleLocalServiceUtil.hasUserGroupRole(
if (isIstruttore) { user.getUserId(), organization.getGroupId(), portosIstruttore.getRoleId());
if(isIstruttore){
userDefinitivo.add(user); userDefinitivo.add(user);
} }
} }
} }
} }
} catch (NumberFormatException | SystemException e) { } catch (NumberFormatException | SystemException e) {
_log.error(e, e); _log.error(e,e);
} catch (PortalException e) { } catch (PortalException e) {
_log.error(e, e); _log.error(e,e);
} }
Calendar calendarStartDate = Calendar.getInstance(); Calendar calendarStartDate = Calendar.getInstance();
calendarStartDate.setTime(startDate); calendarStartDate.setTime(startDate);
if (calendarStartDate.get(Calendar.DAY_OF_WEEK) == giornoSettimana) {
if(calendarStartDate.get(Calendar.DAY_OF_WEEK) == giornoSettimana){
Date startDateToInsert = formatDateTime(oraInizio, startDate); Date startDateToInsert = formatDateTime(oraInizio, startDate);
Date endDateToInsert = formatDateTime(oraFine, startDate); Date endDateToInsert = formatDateTime(oraFine, startDate);
for (User user : userDefinitivo) { for (User user : userDefinitivo) {
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
DynamicQuery dynamicQuery = dynamicQuery(); DynamicQuery dynamicQuery = dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.eq("funzionarioId", user.getUserId())); dynamicQuery.add(RestrictionsFactoryUtil.eq("funzionarioId", user.getUserId()));
dynamicQuery.add(RestrictionsFactoryUtil.eq("exactDate", sdf.format(startDateToInsert))); dynamicQuery.add(RestrictionsFactoryUtil.eq("exactDate", sdf.format(startDateToInsert)));
dynamicQuery.add(RestrictionsFactoryUtil.eq("groupId", organization.getGroupId())); dynamicQuery.add(RestrictionsFactoryUtil.eq("groupId", organization.getGroupId()));
dynamicQuery.add(RestrictionsFactoryUtil.eq("startDate", startDateToInsert));
dynamicQuery.add(RestrictionsFactoryUtil.eq("endDate", endDateToInsert)); //Bug 32935
@SuppressWarnings("unchecked") dynamicQuery.add(RestrictionsFactoryUtil.eq("startDate",startDateToInsert));
dynamicQuery.add(RestrictionsFactoryUtil.eq("endDate",endDateToInsert));
List<Disponibilita> results = disponibilitaPersistence.findWithDynamicQuery(dynamicQuery); List<Disponibilita> results = disponibilitaPersistence.findWithDynamicQuery(dynamicQuery);
if (results.isEmpty()) { if(results.isEmpty()){
addDisponibilita(serviceContext.getUserId(), user.getUserId(), startDateToInsert, endDateToInsert, addDisponibilita(serviceContext.getUserId(), user.getUserId(), startDateToInsert, endDateToInsert,
organization.getOrganizationId(), serviceContext); organization.getOrganizationId(), serviceContext);
} else { }
for (Iterator<Disponibilita> iterator = results.iterator(); iterator.hasNext();) { //Bug 32935
Disponibilita disponibilita = iterator.next(); else{
for (Iterator iterator = results.iterator(); iterator.hasNext();) {
Disponibilita disponibilita = (Disponibilita) iterator.next();
disponibilita.setDisponibile(true); disponibilita.setDisponibile(true);
updateDisponibilita(disponibilita); disponibilitaLocalService.updateDisponibilita(disponibilita);
} }
} }
} }
} }
addDayForDisponibilita(startDate, endDate, oraInizio, oraFine, giornoSettimana, userDefinitivo,
organization.getOrganizationId(), serviceContext); addDayForDisponibilita(startDate, endDate, oraInizio, oraFine, giornoSettimana,
userDefinitivo, organization.getOrganizationId(), serviceContext);
} }
private void addDayForDisponibilita(Date date, Date endDate, String oraInizio, String oraFine, int giornoSettimana, private void addDayForDisponibilita(Date date, Date endDate, String oraInizio, String oraFine,int giornoSettimana,List<User> users,
List<User> users, long presidioId, ServiceContext serviceContext) throws ParseException, SystemException, long presidioId, ServiceContext serviceContext)
PortalException { throws ParseException, SystemException, PortalException{
Organization org = OrganizationLocalServiceUtil.fetchOrganization(presidioId); Organization org = OrganizationLocalServiceUtil.fetchOrganization(presidioId);
Date datePlus = datePlusOneDay(date); Date datePlus = datePlusOneDay(date);
if (date.before(datePlus) && (endDate.after(datePlus) || isSameDate(endDate, datePlus))) { if(date.before(datePlus) && (endDate.after(datePlus) || isSameDate(endDate, datePlus))){
Calendar calendarStartDate = Calendar.getInstance(); Calendar calendarStartDate = Calendar.getInstance();
calendarStartDate.setTime(datePlus); calendarStartDate.setTime(datePlus);
if (calendarStartDate.get(Calendar.DAY_OF_WEEK) == giornoSettimana) {
if(calendarStartDate.get(Calendar.DAY_OF_WEEK) == giornoSettimana){
Date startDateToInsert = formatDateTime(oraInizio, datePlus); Date startDateToInsert = formatDateTime(oraInizio, datePlus);
Date endDateToInsert = formatDateTime(oraFine, datePlus); Date endDateToInsert = formatDateTime(oraFine, datePlus);
for (User user : users) { for (User user : users) {
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
DynamicQuery dynamicQuery = dynamicQuery(); DynamicQuery dynamicQuery = dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.eq("funzionarioId", user.getUserId())); dynamicQuery.add(RestrictionsFactoryUtil.eq("funzionarioId", user.getUserId()));
dynamicQuery.add(RestrictionsFactoryUtil.eq("exactDate", sdf.format(startDateToInsert))); dynamicQuery.add(RestrictionsFactoryUtil.eq("exactDate", sdf.format(startDateToInsert)));
dynamicQuery.add(RestrictionsFactoryUtil.eq("groupId", org.getGroupId())); dynamicQuery.add(RestrictionsFactoryUtil.eq("groupId", org.getGroupId()));
dynamicQuery.add(RestrictionsFactoryUtil.eq("startDate", startDateToInsert));
dynamicQuery.add(RestrictionsFactoryUtil.eq("endDate", endDateToInsert)); //Bug 32935
@SuppressWarnings("unchecked") dynamicQuery.add(RestrictionsFactoryUtil.eq("startDate",startDateToInsert));
dynamicQuery.add(RestrictionsFactoryUtil.eq("endDate",endDateToInsert));
List<Disponibilita> results = disponibilitaPersistence.findWithDynamicQuery(dynamicQuery); List<Disponibilita> results = disponibilitaPersistence.findWithDynamicQuery(dynamicQuery);
if (results.isEmpty()) { if(results.isEmpty()){
addDisponibilita(serviceContext.getUserId(), user.getUserId(), startDateToInsert, addDisponibilita(serviceContext.getUserId(), user.getUserId(), startDateToInsert, endDateToInsert,
endDateToInsert, presidioId, serviceContext); presidioId, serviceContext);
} else { }
for (Iterator<Disponibilita> iterator = results.iterator(); iterator.hasNext();) { //Bug 32935
Disponibilita disponibilita = iterator.next(); else{
for (Iterator iterator = results.iterator(); iterator.hasNext();) {
Disponibilita disponibilita = (Disponibilita) iterator.next();
disponibilita.setDisponibile(true); disponibilita.setDisponibile(true);
updateDisponibilita(disponibilita); disponibilitaLocalService.updateDisponibilita(disponibilita);
} }
} }
} }
addDayForDisponibilita(datePlus, endDate, oraInizio, oraFine, giornoSettimana, users, presidioId,
serviceContext); addDayForDisponibilita(datePlus, endDate, oraInizio, oraFine, giornoSettimana, users,
presidioId, serviceContext);
} else { } else {
addDayForDisponibilita(datePlus, endDate, oraInizio, oraFine, giornoSettimana, users, presidioId, addDayForDisponibilita(datePlus, endDate, oraInizio, oraFine, giornoSettimana, users,
serviceContext); presidioId, serviceContext);
} }
} }
} }
private Date datePlusOneDay(Date date) { private Date datePlusOneDay(Date date){
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
calendar.setTime(date); calendar.setTime(date);
calendar.add(Calendar.DATE, 1); calendar.add(Calendar.DATE, 1);
return calendar.getTime(); return calendar.getTime();
} }
private boolean isSameDate(Date date1, Date date2) { private boolean isSameDate(Date date1 , Date date2){
Calendar cal1 = Calendar.getInstance(); Calendar cal1 = Calendar.getInstance();
Calendar cal2 = Calendar.getInstance(); Calendar cal2 = Calendar.getInstance();
cal1.setTime(date1); cal1.setTime(date1);
cal2.setTime(date2); cal2.setTime(date2);
boolean sameDay =
cal1.get(Calendar.YEAR) == cal2.get(Calendar.YEAR) boolean sameDay = cal1.get(Calendar.YEAR) == cal2.get(Calendar.YEAR) &&
&& cal1.get(Calendar.DAY_OF_YEAR) == cal2.get(Calendar.DAY_OF_YEAR); cal1.get(Calendar.DAY_OF_YEAR) == cal2.get(Calendar.DAY_OF_YEAR);
return sameDay; return sameDay;
} }
@SuppressWarnings("unchecked")
@Override
public List<Disponibilita> findByStartDate(Date date) throws SystemException { public List<Disponibilita> findByStartDate(Date date) throws SystemException {
Date start = DateUtils.truncate(date, Calendar.DAY_OF_MONTH); Date start = DateUtils.truncate(date, Calendar.DAY_OF_MONTH);
Date end = DateUtils.addDays(start, 1); Date end = DateUtils.addDays(start, 1);
DynamicQuery dynamicQuery = dynamicQuery(); DynamicQuery dynamicQuery = dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.between("startDate", start, end)); dynamicQuery.add(RestrictionsFactoryUtil.between("startDate", start, end));
dynamicQuery.addOrder(OrderFactoryUtil.desc("funzionarioId")); dynamicQuery.addOrder(OrderFactoryUtil.desc("funzionarioId"));
return disponibilitaPersistence.findWithDynamicQuery(dynamicQuery); return disponibilitaPersistence.findWithDynamicQuery(dynamicQuery);
}
@Override }
public List<Disponibilita> findByFunzionarioStartAndPresidio(long funzionarioId, Date date, long presidio)
throws SystemException {
public List<Disponibilita> findByFunzionarioStartAndPresidio(long funzionarioId, Date date, long presidio) throws SystemException {
Date start = DateUtils.truncate(date, Calendar.DAY_OF_MONTH); Date start = DateUtils.truncate(date, Calendar.DAY_OF_MONTH);
Date end = DateUtils.addHours(start, 22); Date end = DateUtils.addHours(start, 22);
DynamicQuery dynamicQuery = dynamicQuery(); DynamicQuery dynamicQuery = dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.eq("funzionarioId", funzionarioId)); dynamicQuery.add(RestrictionsFactoryUtil.eq("funzionarioId", funzionarioId));
dynamicQuery.add(RestrictionsFactoryUtil.ge("startDate", start)); dynamicQuery.add(RestrictionsFactoryUtil.ge("startDate", start));
dynamicQuery.add(RestrictionsFactoryUtil.lt("endDate", end)); dynamicQuery.add(RestrictionsFactoryUtil.lt("endDate", end));
dynamicQuery.add(RestrictionsFactoryUtil.eq("groupId", presidio)); dynamicQuery.add(RestrictionsFactoryUtil.eq("groupId", presidio));
@SuppressWarnings("unchecked")
List<Disponibilita> results = disponibilitaPersistence.findWithDynamicQuery(dynamicQuery); List<Disponibilita> results = disponibilitaPersistence.findWithDynamicQuery(dynamicQuery);
return results; return results;
}
@SuppressWarnings("unchecked") }
@Override
public List<Disponibilita> findByFunzionario_StartDate(long funzionarioId, Date date, long presidio)
throws SystemException {
public List<Disponibilita> findByFunzionario_StartDate(long funzionarioId, Date date, long presidio) throws SystemException {
Date start = DateUtils.truncate(date, Calendar.DAY_OF_MONTH); Date start = DateUtils.truncate(date, Calendar.DAY_OF_MONTH);
Date end = DateUtils.addHours(start, 22); Date end = DateUtils.addHours(start, 22);
DynamicQuery dynamicQuery = dynamicQuery(); DynamicQuery dynamicQuery = dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.eq("funzionarioId", funzionarioId)); dynamicQuery.add(RestrictionsFactoryUtil.eq("funzionarioId", funzionarioId));
dynamicQuery.add(RestrictionsFactoryUtil.ge("startDate", start)); dynamicQuery.add(RestrictionsFactoryUtil.ge("startDate", start));
dynamicQuery.add(RestrictionsFactoryUtil.lt("endDate", end)); dynamicQuery.add(RestrictionsFactoryUtil.lt("endDate", end));
dynamicQuery.add(RestrictionsFactoryUtil.eq("groupId", presidio)); dynamicQuery.add(RestrictionsFactoryUtil.eq("groupId", presidio));
return disponibilitaPersistence.findWithDynamicQuery(dynamicQuery);
}
@SuppressWarnings("unchecked") List<Disponibilita> results = disponibilitaPersistence.findWithDynamicQuery(dynamicQuery);
@Override return results;
public List<Disponibilita> findByFunzionarioStartDate(long funzionarioId, Date date, int startRow, int endRow)
throws SystemException {
}
public List<Disponibilita> findByFunzionarioStartDate(long funzionarioId, Date date, int startRow, int endRow) throws SystemException {
Date start = DateUtils.truncate(date, Calendar.DAY_OF_MONTH); Date start = DateUtils.truncate(date, Calendar.DAY_OF_MONTH);
Date end = DateUtils.addHours(start, 22);
DynamicQuery dynamicQuery = dynamicQuery(); DynamicQuery dynamicQuery = dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.eq("funzionarioId", funzionarioId)); dynamicQuery.add(RestrictionsFactoryUtil.eq("funzionarioId", funzionarioId));
dynamicQuery.add(RestrictionsFactoryUtil.ge("startDate", start)); dynamicQuery.add(RestrictionsFactoryUtil.ge("startDate", start));
Order defaultOrder = OrderFactoryUtil.asc("startDate"); Order defaultOrder = OrderFactoryUtil.asc("startDate");
dynamicQuery.addOrder(defaultOrder); dynamicQuery.addOrder(defaultOrder);
return dynamicQuery(dynamicQuery, startRow, endRow);
} List<Disponibilita> results = disponibilitaLocalService.dynamicQuery(dynamicQuery, startRow, endRow);
return results;
@Override }
public int countByFunzionarioStartDate(long funzionarioId, Date date) throws SystemException { public int countByFunzionarioStartDate(long funzionarioId, Date date) throws SystemException {
Date start = DateUtils.truncate(date, Calendar.DAY_OF_MONTH); Date start = DateUtils.truncate(date, Calendar.DAY_OF_MONTH);
DynamicQuery dynamicQuery = dynamicQuery(); DynamicQuery dynamicQuery = dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.eq("funzionarioId", funzionarioId)); dynamicQuery.add(RestrictionsFactoryUtil.eq("funzionarioId", funzionarioId));
dynamicQuery.add(RestrictionsFactoryUtil.ge("startDate", start)); dynamicQuery.add(RestrictionsFactoryUtil.ge("startDate", start));
Order defaultOrder = OrderFactoryUtil.asc("startDate"); Order defaultOrder = OrderFactoryUtil.asc("startDate");
dynamicQuery.addOrder(defaultOrder); dynamicQuery.addOrder(defaultOrder);
return dynamicQuery(dynamicQuery, QueryUtil.ALL_POS, QueryUtil.ALL_POS).size();
List<Disponibilita> results = disponibilitaLocalService.dynamicQuery(dynamicQuery, -1, -1);
return results.size();
} }
@SuppressWarnings("unchecked") public List<Disponibilita> findByPOStartDateAndFilters(long funzionarioId, Date date, int startRow, int endRow, String provinciaFilter, String funzionarioIdFilter) throws SystemException {
@Override
public List<Disponibilita> findByPOStartDateAndFilters(long funzionarioId, Date date, int startRow, int endRow, User user = UserLocalServiceUtil.fetchUser(funzionarioId);
String provinciaFilter, String funzionarioIdFilter) throws SystemException {
User user = userLocalService.fetchUser(funzionarioId);
List<Long> orgIds = new ArrayList<Long>(); List<Long> orgIds = new ArrayList<Long>();
try { try {
Role dirigenteGenerale = RoleLocalServiceUtil.getRole(user.getCompanyId(), "dirigente_generale"); Role dirigenteGenerale = RoleLocalServiceUtil.getRole(user.getCompanyId(), "dirigente_generale");
boolean isDirigenteGenerale = boolean isDirigenteGenerale = RoleLocalServiceUtil.hasUserRole(user.getUserId(), dirigenteGenerale.getRoleId());
RoleLocalServiceUtil.hasUserRole(user.getUserId(), dirigenteGenerale.getRoleId());
if (isDirigenteGenerale) { if(isDirigenteGenerale){
List<Organization> orgs =
OrganizationLocalServiceUtil.getOrganizations(QueryUtil.ALL_POS, QueryUtil.ALL_POS); List<Organization> orgs = OrganizationLocalServiceUtil.getOrganizations(-1, -1);
for (Organization organization : orgs) { for (Organization organization : orgs) {
if (organization.getParentOrganization() != null) { if(organization.getParentOrganization() != null){
orgIds.add(organization.getOrganizationId()); orgIds.add(organization.getOrganizationId());
} }
} }
} else { } else {
List<Organization> orgs = OrganizationLocalServiceUtil.getUserOrganizations(funzionarioId); List<Organization> orgs = OrganizationLocalServiceUtil.getUserOrganizations(funzionarioId);
for (Organization organization : orgs) { for (Organization organization : orgs) {
Role portosPO = RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_po"); Role portosPO = RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_po");
boolean isPO =
UserGroupRoleLocalServiceUtil.hasUserGroupRole(funzionarioId, organization.getGroupId(), boolean isPO = UserGroupRoleLocalServiceUtil.hasUserGroupRole(
portosPO.getRoleId()); funzionarioId, organization.getGroupId(), portosPO.getRoleId());
if (isPO) {
if(isPO){
orgIds.add(organization.getOrganizationId()); orgIds.add(organization.getOrganizationId());
} }
} }
} }
} catch (PortalException e) { } catch (PortalException e) {
_log.error(e, e); _log.error(e,e);
} }
Date start = DateUtils.truncate(date, Calendar.DAY_OF_MONTH); Date start = DateUtils.truncate(date, Calendar.DAY_OF_MONTH);
DynamicQuery dynamicQuery = dynamicQuery(); DynamicQuery dynamicQuery = dynamicQuery();
if (provinciaFilter.equals("-1") || provinciaFilter.equals(StringPool.BLANK)) {
dynamicQuery.add(PropertyFactoryUtil.forName("presidio").in(orgIds.toArray())); if(!provinciaFilter.equals("-1") && !provinciaFilter.equals("")){
} else {
dynamicQuery.add(RestrictionsFactoryUtil.eq("presidio", Long.valueOf(provinciaFilter))); dynamicQuery.add(RestrictionsFactoryUtil.eq("presidio", Long.valueOf(provinciaFilter)));
}
if (funzionarioIdFilter.equals("-1") || funzionarioIdFilter.equals(StringPool.BLANK)) {
dynamicQuery.add(RestrictionsFactoryUtil.ne("funzionarioId", funzionarioId));
} else { } else {
dynamicQuery.add(PropertyFactoryUtil.forName("presidio").in(orgIds.toArray()));
}
if(!funzionarioIdFilter.equals("-1") && !funzionarioIdFilter.equals("")){
dynamicQuery.add(RestrictionsFactoryUtil.eq("funzionarioId", Long.valueOf(funzionarioIdFilter))); dynamicQuery.add(RestrictionsFactoryUtil.eq("funzionarioId", Long.valueOf(funzionarioIdFilter)));
} else {
dynamicQuery.add(RestrictionsFactoryUtil.ne("funzionarioId", funzionarioId));
} }
dynamicQuery.add(RestrictionsFactoryUtil.ge("startDate", start)); dynamicQuery.add(RestrictionsFactoryUtil.ge("startDate", start));
Order defaultOrder = OrderFactoryUtil.asc("startDate"); Order defaultOrder = OrderFactoryUtil.asc("startDate");
dynamicQuery.addOrder(defaultOrder); dynamicQuery.addOrder(defaultOrder);
return dynamicQuery(dynamicQuery, startRow, endRow);
List<Disponibilita> results = disponibilitaLocalService.dynamicQuery(dynamicQuery, startRow, endRow);
return results;
} }
@Override public int countByPOStartDateAndFilters(long funzionarioId, Date date, String provinciaFilter, String funzionarioIdFilter) throws SystemException {
public int countByPOStartDateAndFilters(long funzionarioId, Date date, String provinciaFilter,
String funzionarioIdFilter) throws SystemException { User user = UserLocalServiceUtil.fetchUser(funzionarioId);
User user = userLocalService.fetchUser(funzionarioId);
List<Long> orgIds = new ArrayList<Long>(); List<Long> orgIds = new ArrayList<Long>();
try { try {
Role dirigenteGenerale = RoleLocalServiceUtil.getRole(user.getCompanyId(), "dirigente_generale"); Role dirigenteGenerale = RoleLocalServiceUtil.getRole(user.getCompanyId(), "dirigente_generale");
boolean isDirigenteGenerale = boolean isDirigenteGenerale = RoleLocalServiceUtil.hasUserRole(user.getUserId(), dirigenteGenerale.getRoleId());
RoleLocalServiceUtil.hasUserRole(user.getUserId(), dirigenteGenerale.getRoleId());
if (isDirigenteGenerale) { if(isDirigenteGenerale){
List<Organization> orgs =
OrganizationLocalServiceUtil.getOrganizations(QueryUtil.ALL_POS, QueryUtil.ALL_POS); List<Organization> orgs = OrganizationLocalServiceUtil.getOrganizations(-1, -1);
for (Organization organization : orgs) { for (Organization organization : orgs) {
if (organization.getParentOrganization() != null) { if(organization.getParentOrganization() != null){
orgIds.add(organization.getOrganizationId()); orgIds.add(organization.getOrganizationId());
} }
} }
} else { } else {
List<Organization> orgs = OrganizationLocalServiceUtil.getUserOrganizations(funzionarioId); List<Organization> orgs = OrganizationLocalServiceUtil.getUserOrganizations(funzionarioId);
for (Organization organization : orgs) { for (Organization organization : orgs) {
Role portosPO = RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_po"); Role portosPO = RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_po");
boolean isPO =
UserGroupRoleLocalServiceUtil.hasUserGroupRole(funzionarioId, organization.getGroupId(), boolean isPO = UserGroupRoleLocalServiceUtil.hasUserGroupRole(
portosPO.getRoleId()); funzionarioId, organization.getGroupId(), portosPO.getRoleId());
if (isPO) {
if(isPO){
orgIds.add(organization.getOrganizationId()); orgIds.add(organization.getOrganizationId());
} }
} }
} }
} catch (PortalException e) { } catch (PortalException e) {
_log.error(e, e); _log.error(e,e);
} }
Date start = DateUtils.truncate(date, Calendar.DAY_OF_MONTH); Date start = DateUtils.truncate(date, Calendar.DAY_OF_MONTH);
DynamicQuery dynamicQuery = dynamicQuery(); DynamicQuery dynamicQuery = dynamicQuery();
if (provinciaFilter.equals("-1") || provinciaFilter.equals(StringPool.BLANK)) {
dynamicQuery.add(PropertyFactoryUtil.forName("presidio").in(orgIds.toArray())); if(!provinciaFilter.equals("-1") && !provinciaFilter.equals("")){
} else {
dynamicQuery.add(RestrictionsFactoryUtil.eq("presidio", Long.valueOf(provinciaFilter))); dynamicQuery.add(RestrictionsFactoryUtil.eq("presidio", Long.valueOf(provinciaFilter)));
}
if (funzionarioIdFilter.equals("-1") || funzionarioIdFilter.equals(StringPool.BLANK)) {
dynamicQuery.add(RestrictionsFactoryUtil.ne("funzionarioId", funzionarioId));
} else { } else {
dynamicQuery.add(PropertyFactoryUtil.forName("presidio").in(orgIds.toArray()));
}
if(!funzionarioIdFilter.equals("-1") && !funzionarioIdFilter.equals("")){
dynamicQuery.add(RestrictionsFactoryUtil.eq("funzionarioId", Long.valueOf(funzionarioIdFilter))); dynamicQuery.add(RestrictionsFactoryUtil.eq("funzionarioId", Long.valueOf(funzionarioIdFilter)));
} else {
dynamicQuery.add(RestrictionsFactoryUtil.ne("funzionarioId", funzionarioId));
} }
dynamicQuery.add(RestrictionsFactoryUtil.ge("startDate", start)); dynamicQuery.add(RestrictionsFactoryUtil.ge("startDate", start));
Order defaultOrder = OrderFactoryUtil.asc("startDate"); Order defaultOrder = OrderFactoryUtil.asc("startDate");
dynamicQuery.addOrder(defaultOrder); dynamicQuery.addOrder(defaultOrder);
return dynamicQuery(dynamicQuery, QueryUtil.ALL_POS, QueryUtil.ALL_POS).size();
List<Disponibilita> results = disponibilitaLocalService.dynamicQuery(dynamicQuery, -1, -1);
return results.size();
} }
@SuppressWarnings("unchecked") public List<Disponibilita> findByPOStartDate(long funzionarioId, Date date, int startRow, int endRow) throws SystemException {
@Override
public List<Disponibilita> findByPOStartDate(long funzionarioId, Date date, int startRow, int endRow) User user = UserLocalServiceUtil.fetchUser(funzionarioId);
throws SystemException {
User user = userLocalService.fetchUser(funzionarioId);
List<Long> orgIds = new ArrayList<Long>(); List<Long> orgIds = new ArrayList<Long>();
try { try {
Role dirigenteGenerale = RoleLocalServiceUtil.getRole(user.getCompanyId(), "dirigente_generale"); Role dirigenteGenerale = RoleLocalServiceUtil.getRole(user.getCompanyId(), "dirigente_generale");
boolean isDirigenteGenerale = boolean isDirigenteGenerale = RoleLocalServiceUtil.hasUserRole(user.getUserId(), dirigenteGenerale.getRoleId());
RoleLocalServiceUtil.hasUserRole(user.getUserId(), dirigenteGenerale.getRoleId());
if (isDirigenteGenerale) { if(isDirigenteGenerale){
List<Organization> orgs =
OrganizationLocalServiceUtil.getOrganizations(QueryUtil.ALL_POS, QueryUtil.ALL_POS); List<Organization> orgs = OrganizationLocalServiceUtil.getOrganizations(-1, -1);
for (Organization organization : orgs) { for (Organization organization : orgs) {
if (organization.getParentOrganization() != null) { if(organization.getParentOrganization() != null){
orgIds.add(organization.getOrganizationId()); orgIds.add(organization.getOrganizationId());
} }
} }
} else { } else {
List<Organization> orgs = OrganizationLocalServiceUtil.getUserOrganizations(funzionarioId); List<Organization> orgs = OrganizationLocalServiceUtil.getUserOrganizations(funzionarioId);
for (Organization organization : orgs) { for (Organization organization : orgs) {
Role portosPO = RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_po"); Role portosPO = RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_po");
boolean isPO =
UserGroupRoleLocalServiceUtil.hasUserGroupRole(funzionarioId, organization.getGroupId(), boolean isPO = UserGroupRoleLocalServiceUtil.hasUserGroupRole(
portosPO.getRoleId()); funzionarioId, organization.getGroupId(), portosPO.getRoleId());
if (isPO) {
if(isPO){
orgIds.add(organization.getOrganizationId()); orgIds.add(organization.getOrganizationId());
} }
} }
} }
} catch (PortalException e) { } catch (PortalException e) {
_log.error(e, e); _log.error(e,e);
} }
Date start = DateUtils.truncate(date, Calendar.DAY_OF_MONTH); Date start = DateUtils.truncate(date, Calendar.DAY_OF_MONTH);
DynamicQuery dynamicQuery = dynamicQuery(); DynamicQuery dynamicQuery = dynamicQuery();
dynamicQuery.add(PropertyFactoryUtil.forName("presidio").in(orgIds.toArray())); dynamicQuery.add(PropertyFactoryUtil.forName("presidio").in(orgIds.toArray()));
dynamicQuery.add(RestrictionsFactoryUtil.ne("funzionarioId", funzionarioId)); dynamicQuery.add(RestrictionsFactoryUtil.ne("funzionarioId", funzionarioId));
dynamicQuery.add(RestrictionsFactoryUtil.ge("startDate", start)); dynamicQuery.add(RestrictionsFactoryUtil.ge("startDate", start));
Order defaultOrder = OrderFactoryUtil.asc("startDate"); Order defaultOrder = OrderFactoryUtil.asc("startDate");
dynamicQuery.addOrder(defaultOrder); dynamicQuery.addOrder(defaultOrder);
return dynamicQuery(dynamicQuery, startRow, endRow);
} List<Disponibilita> results = disponibilitaLocalService.dynamicQuery(dynamicQuery, startRow, endRow);
return results;
@Override }
public int countByPOStartDate(long funzionarioId, Date date) throws SystemException { public int countByPOStartDate(long funzionarioId, Date date) throws SystemException {
User user = userLocalService.fetchUser(funzionarioId); User user = UserLocalServiceUtil.fetchUser(funzionarioId);
List<Long> orgIds = new ArrayList<Long>(); List<Long> orgIds = new ArrayList<Long>();
try { try {
Role dirigenteGenerale = RoleLocalServiceUtil.getRole(user.getCompanyId(), "dirigente_generale"); Role dirigenteGenerale = RoleLocalServiceUtil.getRole(user.getCompanyId(), "dirigente_generale");
boolean isDirigenteGenerale = boolean isDirigenteGenerale = RoleLocalServiceUtil.hasUserRole(user.getUserId(), dirigenteGenerale.getRoleId());
RoleLocalServiceUtil.hasUserRole(user.getUserId(), dirigenteGenerale.getRoleId());
if (isDirigenteGenerale) { if(isDirigenteGenerale){
List<Organization> orgs =
OrganizationLocalServiceUtil.getOrganizations(QueryUtil.ALL_POS, QueryUtil.ALL_POS); List<Organization> orgs = OrganizationLocalServiceUtil.getOrganizations(-1, -1);
for (Organization organization : orgs) { for (Organization organization : orgs) {
if (organization.getParentOrganization() != null) { if(organization.getParentOrganization() != null){
orgIds.add(organization.getOrganizationId()); orgIds.add(organization.getOrganizationId());
} }
} }
} else { } else {
List<Organization> orgs = OrganizationLocalServiceUtil.getUserOrganizations(funzionarioId); List<Organization> orgs = OrganizationLocalServiceUtil.getUserOrganizations(funzionarioId);
for (Organization organization : orgs) { for (Organization organization : orgs) {
Role portosPO = RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_po"); Role portosPO = RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_po");
boolean isPO =
UserGroupRoleLocalServiceUtil.hasUserGroupRole(funzionarioId, organization.getGroupId(), boolean isPO = UserGroupRoleLocalServiceUtil.hasUserGroupRole(
portosPO.getRoleId()); funzionarioId, organization.getGroupId(), portosPO.getRoleId());
if (isPO) {
if(isPO){
orgIds.add(organization.getOrganizationId()); orgIds.add(organization.getOrganizationId());
} }
} }
} }
} catch (PortalException e) { } catch (PortalException e) {
_log.error(e, e); _log.error(e,e);
} }
Date start = DateUtils.truncate(date, Calendar.DAY_OF_MONTH); Date start = DateUtils.truncate(date, Calendar.DAY_OF_MONTH);
DynamicQuery dynamicQuery = dynamicQuery(); DynamicQuery dynamicQuery = dynamicQuery();
dynamicQuery.add(PropertyFactoryUtil.forName("presidio").in(orgIds.toArray())); dynamicQuery.add(PropertyFactoryUtil.forName("presidio").in(orgIds.toArray()));
dynamicQuery.add(RestrictionsFactoryUtil.ne("funzionarioId", funzionarioId)); dynamicQuery.add(RestrictionsFactoryUtil.ne("funzionarioId", funzionarioId));
dynamicQuery.add(RestrictionsFactoryUtil.ge("startDate", start)); dynamicQuery.add(RestrictionsFactoryUtil.ge("startDate", start));
Order defaultOrder = OrderFactoryUtil.asc("startDate"); Order defaultOrder = OrderFactoryUtil.asc("startDate");
dynamicQuery.addOrder(defaultOrder); dynamicQuery.addOrder(defaultOrder);
return dynamicQuery(dynamicQuery, QueryUtil.ALL_POS, QueryUtil.ALL_POS).size();
List<Disponibilita> results = disponibilitaLocalService.dynamicQuery(dynamicQuery, -1, -1);
return results.size();
} }
private Date formatDateTime(String orario, Date day) throws ParseException { private Date formatDateTime(String orario, Date day) throws ParseException {
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm"); SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
Date data = sdf.parse(orario); Date data = sdf.parse(orario);
Calendar calendar = GregorianCalendar.getInstance(); Calendar calendar = GregorianCalendar.getInstance();
calendar.setTime(data); calendar.setTime(data);
Date date = DateUtils.addHours(day, calendar.get(Calendar.HOUR_OF_DAY)); Date date = DateUtils.addHours(day, calendar.get(Calendar.HOUR_OF_DAY));
date = DateUtils.addMinutes(date, calendar.get(Calendar.MINUTE)); date = DateUtils.addMinutes(date, calendar.get(Calendar.MINUTE));
return date; return date;
} }
} }

146
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/DisponibilitaServiceImpl.java

@ -1,9 +1,13 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
* and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software *
* Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in * This library is free software; you can redistribute it and/or modify it under the terms of the
* the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * GNU Lesser General Public License as published by the Free Software Foundation; either version
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. * 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/ */
package it.tref.portos.calendar.appointments.service.impl; package it.tref.portos.calendar.appointments.service.impl;
@ -11,6 +15,7 @@ package it.tref.portos.calendar.appointments.service.impl;
import it.tref.portos.calendar.appointments.model.Disponibilita; import it.tref.portos.calendar.appointments.model.Disponibilita;
import it.tref.portos.calendar.appointments.model.Funzionario; import it.tref.portos.calendar.appointments.model.Funzionario;
import it.tref.portos.calendar.appointments.model.Prenotazione; import it.tref.portos.calendar.appointments.model.Prenotazione;
import it.tref.portos.calendar.appointments.service.PrenotazioneLocalServiceUtil;
import it.tref.portos.calendar.appointments.service.base.DisponibilitaServiceBaseImpl; import it.tref.portos.calendar.appointments.service.base.DisponibilitaServiceBaseImpl;
import java.text.ParseException; import java.text.ParseException;
@ -37,117 +42,157 @@ import com.liferay.portal.service.OrganizationLocalServiceUtil;
import com.liferay.portal.service.RoleLocalServiceUtil; import com.liferay.portal.service.RoleLocalServiceUtil;
import com.liferay.portal.service.ServiceContext; import com.liferay.portal.service.ServiceContext;
import com.liferay.portal.service.UserGroupRoleLocalServiceUtil; import com.liferay.portal.service.UserGroupRoleLocalServiceUtil;
import com.liferay.portal.service.UserLocalServiceUtil;
/** /**
* The implementation of the disponibilita remote service. * The implementation of the disponibilita remote service.
*
* <p> * <p>
* All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy * All custom service methods should be put in this class. Whenever methods are added, rerun
* their definitions into the {@link it.tref.portos.calendar.appointments.service.DisponibilitaService} interface. * ServiceBuilder to copy their definitions into the
* {@link it.tref.portos.calendar.appointments.service.DisponibilitaService} interface.
*
* <p> * <p>
* This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS * This is a remote service. Methods of this service are expected to have security checks based on
* credentials because this service can be accessed remotely. * the propagated JAAS credentials because this service can be accessed remotely.
* </p> * </p>
* *
* @author 3F Consulting + Manifattura Web Group s.r.l. * @author 3F Consulting
* @see it.tref.portos.calendar.appointments.service.base.DisponibilitaServiceBaseImpl * @see it.tref.portos.calendar.appointments.service.base.DisponibilitaServiceBaseImpl
* @see it.tref.portos.calendar.appointments.service.DisponibilitaServiceUtil * @see it.tref.portos.calendar.appointments.service.DisponibilitaServiceUtil
*/ */
public class DisponibilitaServiceImpl extends DisponibilitaServiceBaseImpl { public class DisponibilitaServiceImpl extends DisponibilitaServiceBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link * NOTE FOR DEVELOPERS:
* it.tref.portos.calendar.appointments.service.DisponibilitaServiceUtil} to access the disponibilita remote *
* service. * Never reference this interface directly. Always use {@link
* it.tref.portos.calendar.appointments.service.DisponibilitaServiceUtil} to access the
* disponibilita remote service.
*/ */
private static Log _log = LogFactoryUtil.getLog(DisponibilitaServiceImpl.class); private static Log _log = LogFactoryUtil.getLog(DisponibilitaServiceImpl.class);
@Override
public Disponibilita addDisponibilita(long userId, long funzionarioId, Date startDate, Date endDate, long presidio, public Disponibilita addDisponibilita(long userId, long funzionarioId, Date startDate, Date endDate, long presidio,
ServiceContext serviceContext) throws SystemException, PortalException { ServiceContext serviceContext) throws SystemException, PortalException {
return disponibilitaLocalService.addDisponibilita(userId, funzionarioId, startDate, endDate, presidio, serviceContext);
return disponibilitaLocalService.addDisponibilita(userId, funzionarioId, startDate, endDate, presidio,
serviceContext);
} }
@Override
public List<Disponibilita> addDisponibilitaGenerale(long presidio, long userId, Date dataInizioDisponibilita, public List<Disponibilita> addDisponibilitaGenerale(long presidio, long userId, Date dataInizioDisponibilita,
Date dataFineDisponibilita, String giornoSettimana, String oraInizioDisponibilita, Date dataFineDisponibilita, String giornoSettimana, String oraInizioDisponibilita, String oraFineDisponibilita,
String oraFineDisponibilita, ServiceContext serviceContext) throws SystemException, PortalException { ServiceContext serviceContext) throws SystemException, PortalException {
// ciclo su tutti i funzionari e chiamo il service su ogniuno di essi // ciclo su tutti i funzionari e chiamo il service su ogniuno di essi
List<Funzionario> funzionari = new ArrayList<Funzionario>(); List<Funzionario> funzionari = new ArrayList<Funzionario>();
// List<Funzionario> funzionari = funzionarioLocalService.findByPresidio(presidio); // List<Funzionario> funzionari = funzionarioLocalService.findByPresidio(presidio);
List<Disponibilita> listDisponibilita = new ArrayList<>(funzionari.size()); List<Disponibilita> listDisponibilita = new ArrayList<>(funzionari.size());
long funzionarioId; long funzionarioId;
for (Funzionario funzionario : funzionari) { for (Funzionario funzionario : funzionari) {
funzionarioId = funzionario.getFunzionarioId(); funzionarioId = funzionario.getFunzionarioId();
listDisponibilita.add(disponibilitaLocalService.addDisponibilita(userId, funzionarioId, listDisponibilita.add(disponibilitaLocalService.addDisponibilita(userId, funzionarioId, dataInizioDisponibilita,
dataInizioDisponibilita, dataFineDisponibilita, presidio, serviceContext)); dataFineDisponibilita, presidio, serviceContext));
} }
return listDisponibilita; return listDisponibilita;
} }
@Override public String verifyDisponibilitaByDateHour(String presidio, String date,String[] oreInizio, String idFunzionario) throws SystemException, ParseException {
public String verifyDisponibilitaByDateHour(String presidio, String date, String[] oreInizio, String idFunzionario)
throws SystemException, ParseException {
JSONObject json = JSONFactoryUtil.createJSONObject(); JSONObject json = JSONFactoryUtil.createJSONObject();
JSONArray array = JSONFactoryUtil.createJSONArray(); JSONArray array = JSONFactoryUtil.createJSONArray();
Organization org = OrganizationLocalServiceUtil.fetchOrganization(Long.parseLong(presidio)); Organization org = OrganizationLocalServiceUtil.fetchOrganization(Long.parseLong(presidio));
SimpleDateFormat sfd = new SimpleDateFormat("dd/MM/yyyy"); SimpleDateFormat sfd = new SimpleDateFormat("dd/MM/yyyy");
Date dateVerifyTemp = sfd.parse(date); Date dateVerifyTemp = sfd.parse(date);
for (int i = 0; i < oreInizio.length; i++) { for (int i = 0; i < oreInizio.length; i++) {
JSONObject jsonFiglio = JSONFactoryUtil.createJSONObject(); JSONObject jsonFiglio = JSONFactoryUtil.createJSONObject();
String oraInizio = oreInizio[i]; String oraInizio = oreInizio[i];
jsonFiglio.put("ora", oraInizio); jsonFiglio.put("ora", oraInizio);
Date dateVerify = formatDateTime(oraInizio, dateVerifyTemp); Date dateVerify = formatDateTime(oraInizio, dateVerifyTemp);
List<Prenotazione> lista = prenotazioneLocalService.findByDateHourFunzionario(dateVerify,
Long.parseLong(idFunzionario), org.getGroupId());
jsonFiglio.put("disponibile", lista.isEmpty()); List<Prenotazione> lista =
PrenotazioneLocalServiceUtil.findByDateHourFunzionario(
dateVerify, Long.parseLong(idFunzionario), org.getGroupId());
if(lista.isEmpty()){
jsonFiglio.put("disponibile", true);
} else {
jsonFiglio.put("disponibile", false);
}
array.put(jsonFiglio); array.put(jsonFiglio);
} }
json.put("slot", array);
json.put("slot",array);
return json.toString(); return json.toString();
} }
@Override
public String getDisponibilitaByDate(String presidio, String date) throws SystemException, ParseException { public String getDisponibilitaByDate(String presidio, String date) throws SystemException, ParseException {
// TODO permessi // TODO permessi
Organization organization = OrganizationLocalServiceUtil.fetchOrganization(Long.valueOf(presidio)); Organization organization = OrganizationLocalServiceUtil.fetchOrganization(Long.valueOf(presidio));
List<User> userDefinitivo = new ArrayList<User>(); List<User> userDefinitivo = new ArrayList<User>();
try { try {
if (organization != null) {
List<User> users = userLocalService.getOrganizationUsers(Long.valueOf(presidio)); if(organization != null){
List<User> users = UserLocalServiceUtil.getOrganizationUsers(Long.valueOf(presidio));
for (User user : users) { for (User user : users) {
Role portosSupporto = RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_supporto"); Role portosSupporto = RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_supporto");
Role portosIstruttore = RoleLocalServiceUtil.getRole(organization.getCompanyId(),
"portos_calendario"); Role portosIstruttore = RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_calendario");
if (!userLocalService.hasRoleUser(portosSupporto.getRoleId(), user.getUserId())) {
boolean isIstruttore = UserGroupRoleLocalServiceUtil.hasUserGroupRole(user.getUserId(), if(!UserLocalServiceUtil.hasRoleUser(portosSupporto.getRoleId(), user.getUserId())){
organization.getGroupId(), portosIstruttore.getRoleId());
if (isIstruttore) { boolean isIstruttore = UserGroupRoleLocalServiceUtil.hasUserGroupRole(
user.getUserId(), organization.getGroupId(), portosIstruttore.getRoleId());
if(isIstruttore){
userDefinitivo.add(user); userDefinitivo.add(user);
} }
} }
} }
} }
} catch (NumberFormatException | PortalException | SystemException e) {
_log.error(e, e); } catch (NumberFormatException | SystemException e) {
} _log.error(e,e);
} catch (PortalException e) {
_log.error(e,e);
}
Date startDate = new SimpleDateFormat("dd/MM/yyyy").parse(date); Date startDate = new SimpleDateFormat("dd/MM/yyyy").parse(date);
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm"); SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
JSONArray json = JSONFactoryUtil.createJSONArray(); JSONArray json = JSONFactoryUtil.createJSONArray();
for (User funzionario : userDefinitivo) { for (User funzionario : userDefinitivo) {
List<Disponibilita> disponibilitaByFunzionario = disponibilitaLocalService
.findByFunzionarioStartAndPresidio(funzionario.getUserId(), startDate, organization.getGroupId()); List<Disponibilita> disponibilitaByFunzionario =
disponibilitaLocalService.findByFunzionarioStartAndPresidio(funzionario.getUserId(), startDate, organization.getGroupId());
if (disponibilitaByFunzionario.isEmpty()) { if (disponibilitaByFunzionario.isEmpty()) {
continue; continue;
} }
JSONObject jsonDisponibilita = JSONFactoryUtil.createJSONObject(); JSONObject jsonDisponibilita = JSONFactoryUtil.createJSONObject();
jsonDisponibilita.put("idFunzionario", funzionario.getUserId()); jsonDisponibilita.put("idFunzionario", funzionario.getUserId());
JSONArray jsonOre = JSONFactoryUtil.createJSONArray(); JSONArray jsonOre = JSONFactoryUtil.createJSONArray();
for (Disponibilita d : disponibilitaByFunzionario) { for (Disponibilita d : disponibilitaByFunzionario) {
JSONObject jsonSlot = JSONFactoryUtil.createJSONObject(); JSONObject jsonSlot = JSONFactoryUtil.createJSONObject();
jsonSlot.put("inizio", sdf.format(d.getStartDate())); jsonSlot.put("inizio", sdf.format(d.getStartDate()));
jsonSlot.put("fine", sdf.format(d.getEndDate())); jsonSlot.put("fine", sdf.format(d.getEndDate()));
@ -156,18 +201,21 @@ public class DisponibilitaServiceImpl extends DisponibilitaServiceBaseImpl {
} }
jsonDisponibilita.put("ore", jsonOre); jsonDisponibilita.put("ore", jsonOre);
json.put(jsonDisponibilita); json.put(jsonDisponibilita);
} }
return json.toString(); return json.toString();
} }
private Date formatDateTime(String orario, Date day) throws ParseException { private Date formatDateTime(String orario, Date day) throws ParseException {
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm"); SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
Date data = sdf.parse(orario); Date data = sdf.parse(orario);
Calendar calendar = GregorianCalendar.getInstance(); Calendar calendar = GregorianCalendar.getInstance();
calendar.setTime(data); calendar.setTime(data);
Date date = DateUtils.addHours(day, calendar.get(Calendar.HOUR_OF_DAY)); Date date = DateUtils.addHours(day, calendar.get(Calendar.HOUR_OF_DAY));
date = DateUtils.addMinutes(date, calendar.get(Calendar.MINUTE)); date = DateUtils.addMinutes(date, calendar.get(Calendar.MINUTE));
return date; return date;
} }
} }

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

@ -1,83 +1,94 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
* and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software *
* Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in * This library is free software; you can redistribute it and/or modify it under the terms of the
* the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * GNU Lesser General Public License as published by the Free Software Foundation; either version
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. * 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/ */
package it.tref.portos.calendar.appointments.service.impl; package it.tref.portos.calendar.appointments.service.impl;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.model.User;
import com.liferay.portal.service.ServiceContext;
import it.tref.portos.calendar.appointments.model.Funzionario; import it.tref.portos.calendar.appointments.model.Funzionario;
import it.tref.portos.calendar.appointments.service.base.FunzionarioLocalServiceBaseImpl; import it.tref.portos.calendar.appointments.service.base.FunzionarioLocalServiceBaseImpl;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.model.User;
import com.liferay.portal.service.ServiceContext;
/** /**
* The implementation of the funzionario local service. * The implementation of the funzionario local service.
*
* <p> * <p>
* All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy * All custom service methods should be put in this class. Whenever methods are added, rerun
* their definitions into the {@link it.tref.portos.calendar.appointments.service.FunzionarioLocalService} interface. * ServiceBuilder to copy their definitions into the
* {@link it.tref.portos.calendar.appointments.service.FunzionarioLocalService} interface.
*
* <p> * <p>
* This is a local service. Methods of this service will not have security checks based on the propagated JAAS * This is a local service. Methods of this service will not have security checks based on the
* credentials because this service can only be accessed from within the same VM. * propagated JAAS credentials because this service can only be accessed from within the same VM.
* </p> * </p>
* *
* @author 3F Consulting + Manifattura Web Group s.r.l. * @author 3F Consulting
* @see it.tref.portos.calendar.appointments.service.base.FunzionarioLocalServiceBaseImpl * @see it.tref.portos.calendar.appointments.service.base.FunzionarioLocalServiceBaseImpl
* @see it.tref.portos.calendar.appointments.service.FunzionarioLocalServiceUtil * @see it.tref.portos.calendar.appointments.service.FunzionarioLocalServiceUtil
*/ */
public class FunzionarioLocalServiceImpl extends FunzionarioLocalServiceBaseImpl { public class FunzionarioLocalServiceImpl extends FunzionarioLocalServiceBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link * NOTE FOR DEVELOPERS:
* it.tref.portos.calendar.appointments.service.FunzionarioLocalServiceUtil} to access the funzionario local *
* service. * Never reference this interface directly. Always use {@link
*/ * it.tref.portos.calendar.appointments.service.FunzionarioLocalServiceUtil} to access the
* funzionario local service.
@Override */
public Funzionario addFunzionario(long userId, String nome, String cognome, String presidio, String tipologia,
ServiceContext serviceContext) throws PortalException, SystemException { public Funzionario addFunzionario(long userId, String nome, String cognome, String presidio, String tipologia,
ServiceContext serviceContext) throws PortalException, SystemException {
User user = userPersistence.findByPrimaryKey(userId);
Date now = new Date(); User user = userPersistence.findByPrimaryKey(userId);
Funzionario funzionario = funzionarioPersistence.create(counterLocalService.increment(Funzionario.class
.getName())); Date now = new Date();
funzionario.setCompanyId(serviceContext.getCompanyId());
funzionario.setUserId(user.getUserId()); Funzionario funzionario = funzionarioPersistence.create(counterLocalService.increment(Funzionario.class.getName()));
funzionario.setUserName(user.getFullName());
funzionario.setCreateDate(serviceContext.getCreateDate(now)); funzionario.setCompanyId(serviceContext.getCompanyId());
funzionario.setModifiedDate(serviceContext.getModifiedDate(now)); funzionario.setUserId(user.getUserId());
funzionario.setGroupId(serviceContext.getScopeGroupId()); funzionario.setUserName(user.getFullName());
funzionario.setNome(nome); funzionario.setCreateDate(serviceContext.getCreateDate(now));
funzionario.setCognome(cognome); funzionario.setModifiedDate(serviceContext.getModifiedDate(now));
funzionario.setPresidio(presidio); funzionario.setGroupId(serviceContext.getScopeGroupId());
funzionario.setTipologia(tipologia);
funzionario = funzionarioPersistence.update(funzionario); funzionario.setNome(nome);
return funzionario; funzionario.setCognome(cognome);
} funzionario.setPresidio(presidio);
funzionario.setTipologia(tipologia);
@Override
public Funzionario deleteFunzionario(Funzionario funzionario) throws SystemException { funzionario = funzionarioPersistence.update(funzionario);
return super.deleteFunzionario(funzionario); return funzionario;
} }
@Override @Override
public Funzionario deleteFunzionario(long funzionarioId) throws PortalException, SystemException { public Funzionario deleteFunzionario(Funzionario funzionario) throws SystemException {
Funzionario funzionario = funzionarioPersistence.findByPrimaryKey(funzionarioId); return super.deleteFunzionario(funzionario);
return this.deleteFunzionario(funzionario); }
}
@Override
@Override public Funzionario deleteFunzionario(long funzionarioId) throws PortalException, SystemException {
public List<Funzionario> findByPresidio(String presidio) throws SystemException { Funzionario funzionario = funzionarioPersistence.findByPrimaryKey(funzionarioId);
return this.deleteFunzionario(funzionario);
return funzionarioPersistence.findByPresidio(presidio); }
}
public List<Funzionario> findByPresidio(String presidio) throws SystemException {
return funzionarioPersistence.findByPresidio(presidio);
}
} }

174
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/FunzionarioServiceImpl.java

@ -1,14 +1,17 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
* and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software *
* Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in * This library is free software; you can redistribute it and/or modify it under the terms of the
* the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * GNU Lesser General Public License as published by the Free Software Foundation; either version
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. * 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/ */
package it.tref.portos.calendar.appointments.service.impl; package it.tref.portos.calendar.appointments.service.impl;
import it.tref.liferay.portos.bo.shared.util.Constants;
import it.tref.portos.calendar.appointments.model.Funzionario; import it.tref.portos.calendar.appointments.model.Funzionario;
import it.tref.portos.calendar.appointments.service.base.FunzionarioServiceBaseImpl; import it.tref.portos.calendar.appointments.service.base.FunzionarioServiceBaseImpl;
@ -23,7 +26,6 @@ import com.liferay.portal.kernel.json.JSONFactoryUtil;
import com.liferay.portal.kernel.json.JSONObject; import com.liferay.portal.kernel.json.JSONObject;
import com.liferay.portal.kernel.log.Log; import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil; import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.model.Organization; import com.liferay.portal.model.Organization;
import com.liferay.portal.model.Role; import com.liferay.portal.model.Role;
@ -32,94 +34,126 @@ import com.liferay.portal.service.OrganizationLocalServiceUtil;
import com.liferay.portal.service.RoleLocalServiceUtil; import com.liferay.portal.service.RoleLocalServiceUtil;
import com.liferay.portal.service.ServiceContext; import com.liferay.portal.service.ServiceContext;
import com.liferay.portal.service.UserGroupRoleLocalServiceUtil; import com.liferay.portal.service.UserGroupRoleLocalServiceUtil;
import com.liferay.portal.service.UserLocalServiceUtil;
import it.tref.liferay.portos.bo.shared.util.Constants;
/** /**
* The implementation of the funzionario remote service. * The implementation of the funzionario remote service.
*
* <p> * <p>
* All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy * All custom service methods should be put in this class. Whenever methods are added, rerun
* their definitions into the {@link it.tref.portos.calendar.appointments.service.FunzionarioService} interface. * ServiceBuilder to copy their definitions into the
* {@link it.tref.portos.calendar.appointments.service.FunzionarioService} interface.
*
* <p> * <p>
* This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS * This is a remote service. Methods of this service are expected to have security checks based on
* credentials because this service can be accessed remotely. * the propagated JAAS credentials because this service can be accessed remotely.
* </p> * </p>
* *
* @author 3F Consulting + Manifattura Web Group s.r.l. * @author 3F Consulting
* @see it.tref.portos.calendar.appointments.service.base.FunzionarioServiceBaseImpl * @see it.tref.portos.calendar.appointments.service.base.FunzionarioServiceBaseImpl
* @see it.tref.portos.calendar.appointments.service.FunzionarioServiceUtil * @see it.tref.portos.calendar.appointments.service.FunzionarioServiceUtil
*/ */
public class FunzionarioServiceImpl extends FunzionarioServiceBaseImpl { public class FunzionarioServiceImpl extends FunzionarioServiceBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link * NOTE FOR DEVELOPERS:
* it.tref.portos.calendar.appointments.service.FunzionarioServiceUtil} to access the funzionario remote service. *
*/ * Never reference this interface directly. Always use {@link
* it.tref.portos.calendar.appointments.service.FunzionarioServiceUtil} to access the funzionario
* remote service.
*/
private static Log _log = LogFactoryUtil.getLog(FunzionarioServiceImpl.class); private static Log _log = LogFactoryUtil.getLog(FunzionarioServiceImpl.class);
@Override public Funzionario addFunzionario(long userId, String nome, String cognome, String presidio, String tipologia,
public Funzionario addFunzionario(long userId, String nome, String cognome, String presidio, String tipologia, ServiceContext serviceContext) throws PortalException, SystemException {
ServiceContext serviceContext) throws PortalException, SystemException {
return funzionarioLocalService.addFunzionario(userId, nome, cognome, presidio, tipologia, serviceContext); return funzionarioLocalService.addFunzionario(userId, nome, cognome, presidio, tipologia, serviceContext);
} }
@Override public String getFunzionariByPresidio(String presidio) {
public String getFunzionariByPresidio(String presidio) {
JSONArray json = JSONFactoryUtil.createJSONArray(); JSONArray json = JSONFactoryUtil.createJSONArray();
try {
Organization organization = OrganizationLocalServiceUtil.fetchOrganization(Long.valueOf(presidio)); try {
if (organization != null) {
List<User> users = userLocalService.getOrganizationUsers(Long.valueOf(presidio)); Organization organization = OrganizationLocalServiceUtil.fetchOrganization(Long.valueOf(presidio));
Collections.sort(users, new UserComparator());
for (User user : users) { if(organization != null){
Role portosSupporto = RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_supporto");
Role portosGeologo = RoleLocalServiceUtil.getRole(organization.getCompanyId(), List<User> users = UserLocalServiceUtil.getOrganizationUsers(Long.valueOf(presidio));
Constants.ROLE_NAME_GEOLOGO);
Role portosCalendario = RoleLocalServiceUtil.getRole(organization.getCompanyId(), //Bug 32935
"portos_calendario"); Collections.sort(users, new UserComparator());
Role portosIstruttore = RoleLocalServiceUtil.getRole(organization.getCompanyId(),
Constants.ROLE_NAME_ISTRUTTORE); for (User user : users) {
if (!userLocalService.hasRoleUser(portosSupporto.getRoleId(), user.getUserId())) {
boolean isCalendario = UserGroupRoleLocalServiceUtil.hasUserGroupRole(user.getUserId(), Role portosSupporto = RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_supporto");
organization.getGroupId(), portosCalendario.getRoleId());
boolean isIstruttore = UserGroupRoleLocalServiceUtil.hasUserGroupRole(user.getUserId(), Role portosGeologo = RoleLocalServiceUtil.getRole(organization.getCompanyId(), Constants.ROLE_NAME_GEOLOGO);
organization.getGroupId(), portosIstruttore.getRoleId());
boolean isGeologo = userLocalService.hasRoleUser(portosGeologo.getRoleId(), Role portosCalendario = RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_calendario");
user.getUserId());
if (isCalendario) { Role portosIstruttore = RoleLocalServiceUtil.getRole(organization.getCompanyId(), Constants.ROLE_NAME_ISTRUTTORE);
JSONObject jsonFunzionario = JSONFactoryUtil.createJSONObject();
jsonFunzionario.put("id", user.getUserId()); if(!UserLocalServiceUtil.hasRoleUser(portosSupporto.getRoleId(), user.getUserId())){
jsonFunzionario.put("nome", user.getFirstName());
jsonFunzionario.put("cognome", user.getLastName()); boolean isCalendario = UserGroupRoleLocalServiceUtil.hasUserGroupRole(
if (isIstruttore) { user.getUserId(), organization.getGroupId(), portosCalendario.getRoleId());
jsonFunzionario.put("tipologia", "Istruttore");
} else if (isGeologo) { boolean isIstruttore = UserGroupRoleLocalServiceUtil.hasUserGroupRole(
jsonFunzionario.put("tipologia", "Geologo"); user.getUserId(), organization.getGroupId(), portosIstruttore.getRoleId());
} else {
jsonFunzionario.put("tipologia", StringPool.BLANK); boolean isGeologo = UserLocalServiceUtil.hasRoleUser(portosGeologo.getRoleId(), user.getUserId());
}
json.put(jsonFunzionario);
if(isCalendario){
JSONObject jsonFunzionario = JSONFactoryUtil.createJSONObject();
jsonFunzionario.put("id", user.getUserId());
jsonFunzionario.put("nome", user.getFirstName());
jsonFunzionario.put("cognome", user.getLastName());
if(isIstruttore){
jsonFunzionario.put("tipologia", "Istruttore");
} else if(isGeologo){
jsonFunzionario.put("tipologia", "Geologo");
} else {
jsonFunzionario.put("tipologia", "");
} }
json.put(jsonFunzionario);
} }
} }
} }
} catch (NumberFormatException | PortalException | SystemException e) {
_log.error(e, e);
} }
return json.toString();
} catch (NumberFormatException | SystemException e) {
_log.error(e,e);
} catch (PortalException e) {
_log.error(e,e);
} }
}
class UserComparator implements Comparator<User> { return json.toString();
}
@Override
public int compare(User o1, User o2) {
int compareLastName = 0; }
if (Validator.isNotNull(o1.getLastName()) && Validator.isNotNull(o2.getLastName()))
compareLastName = o1.getLastName().compareToIgnoreCase(o2.getLastName()); //Bug 32935
if (compareLastName == 0 && Validator.isNotNull(o1.getFirstName()) && Validator.isNotNull(o2.getFirstName())) class UserComparator implements Comparator<User>{
compareLastName = o1.getFirstName().compareToIgnoreCase(o2.getFirstName()); @Override
public int compare(User o1, User o2) {
int compareLastName = 0;
if(Validator.isNotNull(o1.getLastName()) && Validator.isNotNull(o2.getLastName()))
compareLastName = o1.getLastName().compareToIgnoreCase(o2.getLastName());
if(compareLastName == 0 && Validator.isNotNull(o1.getFirstName()) && Validator.isNotNull(o2.getFirstName()))
compareLastName = o1.getFirstName().compareToIgnoreCase(o2.getFirstName());
return compareLastName; return compareLastName;
} }
} }

314
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/PrenotazioneLocalServiceImpl.java

@ -1,9 +1,13 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
* and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software *
* Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in * This library is free software; you can redistribute it and/or modify it under the terms of the
* the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * GNU Lesser General Public License as published by the Free Software Foundation; either version
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. * 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/ */
package it.tref.portos.calendar.appointments.service.impl; package it.tref.portos.calendar.appointments.service.impl;
@ -33,170 +37,196 @@ import com.liferay.portal.service.OrganizationLocalServiceUtil;
import com.liferay.portal.service.RoleLocalServiceUtil; import com.liferay.portal.service.RoleLocalServiceUtil;
import com.liferay.portal.service.ServiceContext; import com.liferay.portal.service.ServiceContext;
import com.liferay.portal.service.UserGroupRoleLocalServiceUtil; import com.liferay.portal.service.UserGroupRoleLocalServiceUtil;
import com.liferay.portal.service.UserLocalServiceUtil;
/** /**
* The implementation of the prenotazione local service. * The implementation of the prenotazione local service.
*
* <p> * <p>
* All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy * All custom service methods should be put in this class. Whenever methods are added, rerun
* their definitions into the {@link it.tref.portos.calendar.appointments.service.PrenotazioneLocalService} interface. * ServiceBuilder to copy their definitions into the
* {@link it.tref.portos.calendar.appointments.service.PrenotazioneLocalService} interface.
*
* <p> * <p>
* This is a local service. Methods of this service will not have security checks based on the propagated JAAS * This is a local service. Methods of this service will not have security checks based on the
* credentials because this service can only be accessed from within the same VM. * propagated JAAS credentials because this service can only be accessed from within the same VM.
* </p> * </p>
* *
* @author 3F Consulting + Manifattura Web Group s.r.l. * @author 3F Consulting
* @see it.tref.portos.calendar.appointments.service.base.PrenotazioneLocalServiceBaseImpl * @see it.tref.portos.calendar.appointments.service.base.PrenotazioneLocalServiceBaseImpl
* @see it.tref.portos.calendar.appointments.service.PrenotazioneLocalServiceUtil * @see it.tref.portos.calendar.appointments.service.PrenotazioneLocalServiceUtil
*/ */
public class PrenotazioneLocalServiceImpl extends PrenotazioneLocalServiceBaseImpl { public class PrenotazioneLocalServiceImpl extends PrenotazioneLocalServiceBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link * NOTE FOR DEVELOPERS:
* it.tref.portos.calendar.appointments.service.PrenotazioneLocalServiceUtil} to access the prenotazione local *
* service. * Never reference this interface directly. Always use {@link
*/ * it.tref.portos.calendar.appointments.service.PrenotazioneLocalServiceUtil} to access the
* prenotazione local service.
@Override */
public Prenotazione addPrenotazione(long userId, long funzionarioId, long professionistaId, Date startDate,
Date endDate, String descrizione, String telefono, String email, long presidio,
ServiceContext serviceContext) throws SystemException, PortalException {
Prenotazione prenotazione =
prenotazionePersistence.create(counterLocalService.increment(Prenotazione.class.getName()));
User user = userPersistence.findByPrimaryKey(userId);
Date now = new Date();
prenotazione.setCompanyId(serviceContext.getCompanyId());
prenotazione.setUserId(user.getUserId());
prenotazione.setUserName(user.getFullName());
prenotazione.setCreateDate(serviceContext.getCreateDate(now));
prenotazione.setModifiedDate(serviceContext.getModifiedDate(now));
prenotazione.setGroupId(presidio);
prenotazione.setFunzionarioId(funzionarioId);
prenotazione.setProfessionistaId(professionistaId);
prenotazione.setStartDate(startDate);
prenotazione.setEndDate(endDate);
prenotazione.setDescLong(descrizione);
prenotazione.setTelefono(telefono);
prenotazione.setEmail(email);
prenotazione = updatePrenotazione(prenotazione);
return prenotazione;
}
@Override //Product Backlog Item 32934
public Prenotazione updatePrenotazione(long prenotazioneId, Date startDate, Date endDate, String descrizione, public Prenotazione addPrenotazione(long userId, long funzionarioId, long professionistaId, Date startDate,
ServiceContext serviceContext) throws SystemException, PortalException { Date endDate, String descrizione, String telefono, String email, long presidio, ServiceContext serviceContext) throws SystemException, PortalException {
Prenotazione prenotazione = prenotazionePersistence.findByPrimaryKey(prenotazioneId);
Date now = new Date();
prenotazione.setModifiedDate(serviceContext.getModifiedDate(now));
prenotazione.setStartDate(startDate);
prenotazione.setEndDate(endDate);
prenotazione.setDescLong(descrizione);
prenotazione = updatePrenotazione(prenotazione);
return prenotazione;
}
@Override Prenotazione prenotazione =
public Prenotazione deletePrenotazione(Prenotazione prenotazione) throws SystemException { prenotazionePersistence.create(counterLocalService.increment(Prenotazione.class.getName()));
return super.deletePrenotazione(prenotazione); User user = userPersistence.findByPrimaryKey(userId);
}
@Override Date now = new Date();
public Prenotazione deletePrenotazione(long prenotazioneId) throws PortalException, SystemException {
Prenotazione prenotazione = prenotazionePersistence.findByPrimaryKey(prenotazioneId); prenotazione.setCompanyId(serviceContext.getCompanyId());
return this.deletePrenotazione(prenotazione); prenotazione.setUserId(user.getUserId());
} prenotazione.setUserName(user.getFullName());
prenotazione.setCreateDate(serviceContext.getCreateDate(now));
prenotazione.setModifiedDate(serviceContext.getModifiedDate(now));
prenotazione.setGroupId(presidio);
@SuppressWarnings("unchecked") prenotazione.setFunzionarioId(funzionarioId);
@Override prenotazione.setProfessionistaId(professionistaId);
public List<Prenotazione> findByStartDate(Date date) throws SystemException { prenotazione.setStartDate(startDate);
prenotazione.setEndDate(endDate);
prenotazione.setDescLong(descrizione);
//Product Backlog Item 32934
prenotazione.setTelefono(telefono);
prenotazione.setEmail(email);
Date start = DateUtils.truncate(date, java.util.Calendar.DAY_OF_MONTH); prenotazione = prenotazioneLocalService.updatePrenotazione(prenotazione);
Date end = DateUtils.addDays(start, 1);
DynamicQuery dynamicQuery = dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.between("startDate", start, end));
dynamicQuery.addOrder(OrderFactoryUtil.desc("funzionarioId"));
return prenotazionePersistence.findWithDynamicQuery(dynamicQuery);
}
@SuppressWarnings("unchecked") return prenotazione;
@Override }
public List<Prenotazione> findByDateHourFunzionario(Date date, long funzionarioId, long groupId)
throws SystemException {
DynamicQuery dynamicQuery = dynamicQuery(); public Prenotazione updatePrenotazione(long prenotazioneId, Date startDate, Date endDate, String descrizione,
dynamicQuery.add(RestrictionsFactoryUtil.eq("funzionarioId", funzionarioId)); ServiceContext serviceContext) throws SystemException, PortalException {
dynamicQuery.add(RestrictionsFactoryUtil.eq("startDate", date));
dynamicQuery.add(RestrictionsFactoryUtil.eq("groupId", groupId));
return prenotazionePersistence.findWithDynamicQuery(dynamicQuery);
}
@Override Prenotazione prenotazione = prenotazionePersistence.findByPrimaryKey(prenotazioneId);
public int getAvailableSlotByStartDate_EndDate(long funzionarioId, Date startDate, Date endDate)
throws SystemException { Date now = new Date();
DynamicQuery dynamicQuery = dynamicQuery(); prenotazione.setModifiedDate(serviceContext.getModifiedDate(now));
dynamicQuery.add(RestrictionsFactoryUtil.eq("funzionarioId", funzionarioId));
Disjunction disjunction = RestrictionsFactoryUtil.disjunction(); prenotazione.setStartDate(startDate);
Conjunction conjunctionStart = RestrictionsFactoryUtil.conjunction(); prenotazione.setEndDate(endDate);
conjunctionStart.add(RestrictionsFactoryUtil.ge("startDate", startDate)); prenotazione.setDescLong(descrizione);
conjunctionStart.add(RestrictionsFactoryUtil.lt("startDate", endDate));
disjunction.add(conjunctionStart); prenotazione = prenotazioneLocalService.updatePrenotazione(prenotazione);
Conjunction conjunctionEnd = RestrictionsFactoryUtil.conjunction();
conjunctionEnd.add(RestrictionsFactoryUtil.gt("endDate", startDate)); return prenotazione;
conjunctionEnd.add(RestrictionsFactoryUtil.le("endDate", endDate)); }
disjunction.add(conjunctionEnd);
dynamicQuery.add(disjunction); @Override
return (int) prenotazionePersistence.countWithDynamicQuery(dynamicQuery); public Prenotazione deletePrenotazione(Prenotazione prenotazione) throws SystemException {
}
return super.deletePrenotazione(prenotazione);
}
@Override
public Prenotazione deletePrenotazione(long prenotazioneId) throws PortalException, SystemException {
Prenotazione prenotazione = prenotazionePersistence.findByPrimaryKey(prenotazioneId);
return this.deletePrenotazione(prenotazione);
}
public List<Prenotazione> findByStartDate(Date date) throws SystemException {
Date start = DateUtils.truncate(date, java.util.Calendar.DAY_OF_MONTH);
Date end = DateUtils.addDays(start, 1);
DynamicQuery dynamicQuery = dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.between("startDate", start, end));
dynamicQuery.addOrder(OrderFactoryUtil.desc("funzionarioId"));
return prenotazionePersistence.findWithDynamicQuery(dynamicQuery);
}
public List<Prenotazione> findByDateHourFunzionario(Date date, long funzionarioId, long groupId) throws SystemException {
DynamicQuery dynamicQuery = dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.eq("funzionarioId", funzionarioId));
dynamicQuery.add(RestrictionsFactoryUtil.eq("startDate", date));
dynamicQuery.add(RestrictionsFactoryUtil.eq("groupId", groupId));
return prenotazionePersistence.findWithDynamicQuery(dynamicQuery);
@SuppressWarnings("unchecked")
@Override
public List<Prenotazione> findByFunzionario_StartDate(long funzionarioId, Date date, long groupId)
throws SystemException {
Date start = DateUtils.truncate(date, Calendar.DAY_OF_MONTH);
Date end = DateUtils.addHours(start, 22);
DynamicQuery dynamicQuery = dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.eq("funzionarioId", funzionarioId));
dynamicQuery.add(RestrictionsFactoryUtil.eq("groupId", groupId));
dynamicQuery.add(RestrictionsFactoryUtil.ge("startDate", start));
dynamicQuery.add(RestrictionsFactoryUtil.lt("endDate", end));
return prenotazionePersistence.findWithDynamicQuery(dynamicQuery);
} }
@Override public int getAvailableSlotByStartDate_EndDate(long funzionarioId, Date startDate, Date endDate)
public int countPrenotazioniPresidioPeriodo(long presidioId, String fromString, String toString) throws SystemException {
throws SystemException, PortalException, ParseException {
DynamicQuery dynamicQuery = dynamicQuery();
int count = 0; dynamicQuery.add(RestrictionsFactoryUtil.eq("funzionarioId", funzionarioId));
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); Disjunction disjunction = RestrictionsFactoryUtil.disjunction();
Date from = sdf.parse(fromString); Conjunction conjunctionStart = RestrictionsFactoryUtil.conjunction();
Date to = sdf.parse(toString); conjunctionStart.add(RestrictionsFactoryUtil.ge("startDate", startDate));
Calendar fromCal = Calendar.getInstance(); conjunctionStart.add(RestrictionsFactoryUtil.lt("startDate", endDate));
fromCal.setTime(from); disjunction.add(conjunctionStart);
fromCal.set(Calendar.HOUR_OF_DAY, 2); Conjunction conjunctionEnd = RestrictionsFactoryUtil.conjunction();
Calendar toCal = Calendar.getInstance(); conjunctionEnd.add(RestrictionsFactoryUtil.gt("endDate", startDate));
toCal.setTime(to); conjunctionEnd.add(RestrictionsFactoryUtil.le("endDate", endDate));
toCal.set(Calendar.HOUR_OF_DAY, 22); disjunction.add(conjunctionEnd);
Organization org = OrganizationLocalServiceUtil.fetchOrganization(presidioId); dynamicQuery.add(disjunction);
Role portosCalendario = RoleLocalServiceUtil.getRole(org.getCompanyId(), "portos_calendario"); return (int) prenotazionePersistence.countWithDynamicQuery(dynamicQuery);
if (org != null) {
List<User> users = userLocalService.getOrganizationUsers(presidioId); }
for (User user : users) {
boolean isCalendario = public List<Prenotazione> findByFunzionario_StartDate(long funzionarioId, Date date, long groupId) throws SystemException {
UserGroupRoleLocalServiceUtil.hasUserGroupRole(user.getUserId(), org.getGroupId(), Date start = DateUtils.truncate(date, Calendar.DAY_OF_MONTH);
portosCalendario.getRoleId()); Date end = DateUtils.addHours(start, 22);
if (isCalendario) {
DynamicQuery dynamicQuery = dynamicQuery(); DynamicQuery dynamicQuery = dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.eq("funzionarioId", funzionarioId));
dynamicQuery.add(RestrictionsFactoryUtil.eq("groupId", groupId));
dynamicQuery.add(RestrictionsFactoryUtil.ge("startDate", start));
dynamicQuery.add(RestrictionsFactoryUtil.lt("endDate", end));
return prenotazionePersistence.findWithDynamicQuery(dynamicQuery);
}
public int countPrenotazioniPresidioPeriodo(long presidioId, String fromString, String toString) throws SystemException, PortalException, ParseException{
int count = 0;
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
Date from = sdf.parse(fromString);
Date to = sdf.parse(toString);
Calendar fromCal = Calendar.getInstance();
fromCal.setTime(from);
fromCal.set(Calendar.HOUR_OF_DAY, 2);
Calendar toCal = Calendar.getInstance();
toCal.setTime(to);
toCal.set(Calendar.HOUR_OF_DAY, 22);
Organization org = OrganizationLocalServiceUtil.fetchOrganization(presidioId);
Role portosCalendario = RoleLocalServiceUtil.getRole(org.getCompanyId(), "portos_calendario");
if (org != null) {
List<User> users = UserLocalServiceUtil.getOrganizationUsers(presidioId);
for (User user : users) {
boolean isCalendario = UserGroupRoleLocalServiceUtil.hasUserGroupRole(
user.getUserId(), org.getGroupId(), portosCalendario.getRoleId());
if(isCalendario){
DynamicQuery dynamicQuery = dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.eq("funzionarioId", user.getUserId())); dynamicQuery.add(RestrictionsFactoryUtil.eq("funzionarioId", user.getUserId()));
dynamicQuery.add(RestrictionsFactoryUtil.between("startDate", fromCal.getTime(), toCal.getTime())); dynamicQuery.add(RestrictionsFactoryUtil.between("startDate", fromCal.getTime(), toCal.getTime()));
dynamicQuery.add(RestrictionsFactoryUtil.eq("groupId", org.getGroupId())); dynamicQuery.add(RestrictionsFactoryUtil.eq("groupId", org.getGroupId()));
count = count + ((int) prenotazionePersistence.countWithDynamicQuery(dynamicQuery));
} count = count + ((int) prenotazionePersistence.countWithDynamicQuery(dynamicQuery));
}
} }
} }
return count;
} return count;
}
} }

146
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/PrenotazioneServiceImpl.java

@ -1,15 +1,20 @@
/** /**
* ù * Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute ù * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
* it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software *
* Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in * This library is free software; you can redistribute it and/or modify it under the terms of the
* the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * GNU Lesser General Public License as published by the Free Software Foundation; either version
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. * 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/ */
package it.tref.portos.calendar.appointments.service.impl; package it.tref.portos.calendar.appointments.service.impl;
import it.tref.portos.calendar.appointments.SlotNotAvailableException; import it.tref.portos.calendar.appointments.SlotNotAvailableException;
import it.tref.portos.calendar.appointments.model.Prenotazione; import it.tref.portos.calendar.appointments.model.Prenotazione;
import it.tref.portos.calendar.appointments.service.PrenotazioneLocalServiceUtil;
import it.tref.portos.calendar.appointments.service.base.PrenotazioneServiceBaseImpl; import it.tref.portos.calendar.appointments.service.base.PrenotazioneServiceBaseImpl;
import java.text.ParseException; import java.text.ParseException;
@ -34,139 +39,190 @@ import com.liferay.portal.service.OrganizationLocalServiceUtil;
import com.liferay.portal.service.RoleLocalServiceUtil; import com.liferay.portal.service.RoleLocalServiceUtil;
import com.liferay.portal.service.ServiceContext; import com.liferay.portal.service.ServiceContext;
import com.liferay.portal.service.UserGroupRoleLocalServiceUtil; import com.liferay.portal.service.UserGroupRoleLocalServiceUtil;
import com.liferay.portal.service.UserLocalServiceUtil;
/** /**
* The implementation of the prenotazione remote service. * The implementation of the prenotazione remote service.
*
* <p> * <p>
* All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy * All custom service methods should be put in this class. Whenever methods are added, rerun
* their definitions into the {@link it.tref.portos.calendar.appointments.service.PrenotazioneService} interface. * ServiceBuilder to copy their definitions into the
* {@link it.tref.portos.calendar.appointments.service.PrenotazioneService} interface.
*
* <p> * <p>
* This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS * This is a remote service. Methods of this service are expected to have security checks based on
* credentials because this service can be accessed remotely. * the propagated JAAS credentials because this service can be accessed remotely.
* </p> * </p>
* *
* @author 3F Consulting + Manifattura Web Group s.r.l. * @author 3F Consulting
* @see it.tref.portos.calendar.appointments.service.base.PrenotazioneServiceBaseImpl * @see it.tref.portos.calendar.appointments.service.base.PrenotazioneServiceBaseImpl
* @see it.tref.portos.calendar.appointments.service.PrenotazioneServiceUtil * @see it.tref.portos.calendar.appointments.service.PrenotazioneServiceUtil
*/ */
public class PrenotazioneServiceImpl extends PrenotazioneServiceBaseImpl { public class PrenotazioneServiceImpl extends PrenotazioneServiceBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link * NOTE FOR DEVELOPERS:
* it.tref.portos.calendar.appointments.service.PrenotazioneServiceUtil} to access the prenotazione remote service. *
* Never reference this interface directly. Always use {@link
* it.tref.portos.calendar.appointments.service.PrenotazioneServiceUtil} to access the
* prenotazione remote service.
*/ */
private static Log _log = LogFactoryUtil.getLog(PrenotazioneServiceImpl.class); private static Log _log = LogFactoryUtil.getLog(PrenotazioneServiceImpl.class);
@Override //Product Backlog Item 32934
public void addPrenotazione(long userId, long funzionarioId, long professionistaId, Date startDate, Date endDate, public void addPrenotazione(long userId, long funzionarioId, long professionistaId, Date startDate, Date endDate,
String descrizione, String telefono, String email, long presidio, ServiceContext serviceContext) String descrizione, String telefono, String email, long presidio, ServiceContext serviceContext) throws SystemException, PortalException {
throws SystemException, PortalException {
if (!isSlotAvailable(funzionarioId, startDate, endDate)) { if (!isSlotAvailable(funzionarioId, startDate, endDate)) {
throw new SlotNotAvailableException("slot not available"); throw new SlotNotAvailableException("slot not available");
} }
prenotazioneLocalService.addPrenotazione(userId, funzionarioId, professionistaId, startDate, endDate, //Product Backlog Item 32934
descrizione, telefono, email, presidio, serviceContext); prenotazioneLocalService.addPrenotazione(userId, funzionarioId, professionistaId, startDate, endDate, descrizione, telefono, email, presidio,
serviceContext);
} }
@Override
public void updatePrenotazione(long prenotazioneId, long userId, Date startDate, Date endDate, String descrizione, public void updatePrenotazione(long prenotazioneId, long userId, Date startDate, Date endDate, String descrizione,
ServiceContext serviceContext) throws SystemException, PortalException { ServiceContext serviceContext) throws SystemException, PortalException {
Prenotazione prenotazione = prenotazioneLocalService.fetchPrenotazione(prenotazioneId); Prenotazione prenotazione = PrenotazioneLocalServiceUtil.fetchPrenotazione(prenotazioneId);
if (prenotazione.getUserId() != userId) { if (prenotazione.getUserId() != userId) {
throw new SystemException("error.calendar.appointments.prenotazione.not.allowed.update " + prenotazioneId throw new SystemException("error.calendar.appointments.prenotazione.not.allowed.update " + prenotazioneId
+ " user " + userId); + " user " + userId);
} }
prenotazioneLocalService.updatePrenotazione(prenotazioneId, startDate, endDate, descrizione, serviceContext); prenotazioneLocalService.updatePrenotazione(prenotazioneId, startDate, endDate, descrizione, serviceContext);
} }
@Override
public void deletePrenotazione(long prenotazioneId, long userId) throws SystemException, PortalException { public void deletePrenotazione(long prenotazioneId, long userId) throws SystemException, PortalException {
Prenotazione prenotazione = PrenotazioneLocalServiceUtil.fetchPrenotazione(prenotazioneId);
//Product Backlog Item 32933
// if (prenotazione.getUserId() != userId) {
// throw new SystemException("error.calendar.appointments.prenotazione.not.allowed.update " + prenotazioneId
// + " user " + userId);
// }
prenotazioneLocalService.deletePrenotazione(prenotazioneId); prenotazioneLocalService.deletePrenotazione(prenotazioneId);
} }
@Override public String getPrenotazioniByDate(String presidio, String date, String userId) throws SystemException, ParseException {
public String getPrenotazioniByDate(String presidio, String date, String userId) throws SystemException,
ParseException {
long loggetUserId = Long.parseLong(userId); long loggetUserId = Long.parseLong(userId);
Organization organization = OrganizationLocalServiceUtil.fetchOrganization(Long.valueOf(presidio)); Organization organization = OrganizationLocalServiceUtil.fetchOrganization(Long.valueOf(presidio));
List<User> userDefinitivo = new ArrayList<User>(); List<User> userDefinitivo = new ArrayList<User>();
try { try {
if (organization != null) {
List<User> users = userLocalService.getOrganizationUsers(Long.valueOf(presidio)); if(organization != null){
List<User> users = UserLocalServiceUtil.getOrganizationUsers(Long.valueOf(presidio));
for (User user : users) { for (User user : users) {
Role portosSupporto = RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_supporto"); Role portosSupporto = RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_supporto");
Role portosIstruttore = RoleLocalServiceUtil.getRole(organization.getCompanyId(),
"portos_calendario"); Role portosIstruttore = RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_calendario");
if (!userLocalService.hasRoleUser(portosSupporto.getRoleId(), user.getUserId())) {
boolean isIstruttore = UserGroupRoleLocalServiceUtil.hasUserGroupRole(user.getUserId(), if(!UserLocalServiceUtil.hasRoleUser(portosSupporto.getRoleId(), user.getUserId())){
organization.getGroupId(), portosIstruttore.getRoleId());
if (isIstruttore) { boolean isIstruttore = UserGroupRoleLocalServiceUtil.hasUserGroupRole(
user.getUserId(), organization.getGroupId(), portosIstruttore.getRoleId());
if(isIstruttore){
userDefinitivo.add(user); userDefinitivo.add(user);
} }
} }
} }
} }
} catch (NumberFormatException | PortalException | SystemException e) {
_log.error(e, e); } catch (NumberFormatException | SystemException e) {
} _log.error(e,e);
} catch (PortalException e) {
_log.error(e,e);
}
Date startDate = new SimpleDateFormat("dd/MM/yyyy").parse(date); Date startDate = new SimpleDateFormat("dd/MM/yyyy").parse(date);
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm"); SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
JSONArray json = JSONFactoryUtil.createJSONArray(); JSONArray json = JSONFactoryUtil.createJSONArray();
for (User funzionario : userDefinitivo) { for (User funzionario : userDefinitivo) {
List<Prenotazione> prenotazioniByFunzionario = prenotazioneLocalService.findByFunzionario_StartDate(
funzionario.getUserId(), startDate, organization.getGroupId()); List<Prenotazione> prenotazioniByFunzionario =
prenotazioneLocalService.findByFunzionario_StartDate(funzionario.getUserId(), startDate, organization.getGroupId());
if (prenotazioniByFunzionario.isEmpty()) { if (prenotazioniByFunzionario.isEmpty()) {
continue; continue;
} }
JSONObject jsonFunzionario = JSONFactoryUtil.createJSONObject(); JSONObject jsonFunzionario = JSONFactoryUtil.createJSONObject();
jsonFunzionario.put("idFunzionario", funzionario.getUserId()); jsonFunzionario.put("idFunzionario", funzionario.getUserId());
jsonFunzionario.put("nomeFunzionario", funzionario.getFullName()); jsonFunzionario.put("nomeFunzionario", funzionario.getFullName());
JSONArray jsonPrenotazioni = JSONFactoryUtil.createJSONArray(); JSONArray jsonPrenotazioni = JSONFactoryUtil.createJSONArray();
for (Prenotazione prenotazione : prenotazioniByFunzionario) { for (Prenotazione prenotazione : prenotazioniByFunzionario) {
JSONObject jsonPrenotazione = JSONFactoryUtil.createJSONObject(); JSONObject jsonPrenotazione = JSONFactoryUtil.createJSONObject();
jsonPrenotazione.put("idPrenotazione", prenotazione.getPrenotazioneId()); jsonPrenotazione.put("idPrenotazione", prenotazione.getPrenotazioneId());
jsonPrenotazione.put("inizio", sdf.format(prenotazione.getStartDate())); jsonPrenotazione.put("inizio", sdf.format(prenotazione.getStartDate()));
jsonPrenotazione.put("fine", sdf.format(prenotazione.getEndDate())); jsonPrenotazione.put("fine", sdf.format(prenotazione.getEndDate()));
User richiedente = userLocalService.fetchUser(prenotazione.getProfessionistaId());
if (loggetUserId == prenotazione.getProfessionistaId()) { User richiedente = UserLocalServiceUtil.fetchUser(prenotazione.getProfessionistaId());
if(loggetUserId == prenotazione.getProfessionistaId()){
jsonPrenotazione.put("visible", true); jsonPrenotazione.put("visible", true);
} else { } else {
jsonPrenotazione.put("visible", canSeeFullInformations(loggetUserId)); jsonPrenotazione.put("visible", canSeeFullInformations(loggetUserId));
} }
jsonPrenotazione.put("richiedente", richiedente.getFullName()); jsonPrenotazione.put("richiedente", richiedente.getFullName());
jsonPrenotazione.put("richiedenteId", prenotazione.getProfessionistaId()); jsonPrenotazione.put("richiedenteId", prenotazione.getProfessionistaId());
jsonPrenotazione.put("descrizione", prenotazione.getDescLong()); jsonPrenotazione.put("descrizione", prenotazione.getDescLong());
//Product Backlog Item 32934
jsonPrenotazione.put("telefono", prenotazione.getTelefono()); jsonPrenotazione.put("telefono", prenotazione.getTelefono());
jsonPrenotazione.put("email", prenotazione.getEmail()); jsonPrenotazione.put("email", prenotazione.getEmail());
jsonPrenotazioni.put(jsonPrenotazione); jsonPrenotazioni.put(jsonPrenotazione);
} }
jsonFunzionario.put("prenotazioni", jsonPrenotazioni); jsonFunzionario.put("prenotazioni", jsonPrenotazioni);
json.put(jsonFunzionario); json.put(jsonFunzionario);
} }
return json.toString(); return json.toString();
}
private boolean canSeeFullInformations(long loggetUserId) throws SystemException {
}
private boolean canSeeFullInformations(long loggetUserId) throws SystemException{
boolean canDo = false; boolean canDo = false;
User user = userLocalService.fetchUser(loggetUserId);
if (user != null) { User user = UserLocalServiceUtil.fetchUser(loggetUserId);
if(user != null){
Group siteBO = GroupLocalServiceUtil.fetchGroup(user.getCompanyId(), "Portos BackOffice"); Group siteBO = GroupLocalServiceUtil.fetchGroup(user.getCompanyId(), "Portos BackOffice");
boolean isBoUser = GroupLocalServiceUtil.hasUserGroup(user.getUserId(), siteBO.getGroupId()); boolean isBoUser = GroupLocalServiceUtil.hasUserGroup(user.getUserId(), siteBO.getGroupId());
if (isBoUser) {
if(isBoUser){
canDo = true; canDo = true;
} }
} }
return canDo; return canDo;
} }
@Override
public boolean isSlotAvailable(long funzionarioId, Date startDate, Date endDate) throws SystemException { public boolean isSlotAvailable(long funzionarioId, Date startDate, Date endDate) throws SystemException {
return prenotazioneLocalService.getAvailableSlotByStartDate_EndDate(funzionarioId, startDate, endDate) == 0; return prenotazioneLocalService.getAvailableSlotByStartDate_EndDate(funzionarioId, startDate, endDate) == 0;
} }
} }

37
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/ProfessionistaLocalServiceImpl.java

@ -1,9 +1,15 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
* and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software *
* Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in * This library is free software; you can redistribute it and/or modify it under
* the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * the terms of the GNU Lesser General Public License as published by the Free
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. * Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/ */
package it.tref.portos.calendar.appointments.service.impl; package it.tref.portos.calendar.appointments.service.impl;
@ -12,22 +18,23 @@ import it.tref.portos.calendar.appointments.service.base.ProfessionistaLocalServ
/** /**
* The implementation of the professionista local service. * The implementation of the professionista local service.
*
* <p> * <p>
* All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy their definitions into the {@link it.tref.portos.calendar.appointments.service.ProfessionistaLocalService} interface.
* their definitions into the {@link it.tref.portos.calendar.appointments.service.ProfessionistaLocalService} interface. *
* <p> * <p>
* This is a local service. Methods of this service will not have security checks based on the propagated JAAS * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
* credentials because this service can only be accessed from within the same VM.
* </p> * </p>
* *
* @author 3F Consulting + Manifattura Web Group s.r.l. * @author 3F Consulting
* @see it.tref.portos.calendar.appointments.service.base.ProfessionistaLocalServiceBaseImpl * @see it.tref.portos.calendar.appointments.service.base.ProfessionistaLocalServiceBaseImpl
* @see it.tref.portos.calendar.appointments.service.ProfessionistaLocalServiceUtil * @see it.tref.portos.calendar.appointments.service.ProfessionistaLocalServiceUtil
*/ */
public class ProfessionistaLocalServiceImpl extends ProfessionistaLocalServiceBaseImpl { public class ProfessionistaLocalServiceImpl
extends ProfessionistaLocalServiceBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link * NOTE FOR DEVELOPERS:
* it.tref.portos.calendar.appointments.service.ProfessionistaLocalServiceUtil} to access the professionista local *
* service. * Never reference this interface directly. Always use {@link it.tref.portos.calendar.appointments.service.ProfessionistaLocalServiceUtil} to access the professionista local service.
*/ */
} }

34
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/ProfessionistaServiceImpl.java

@ -1,9 +1,15 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
* and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software *
* Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in * This library is free software; you can redistribute it and/or modify it under
* the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * the terms of the GNU Lesser General Public License as published by the Free
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. * Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/ */
package it.tref.portos.calendar.appointments.service.impl; package it.tref.portos.calendar.appointments.service.impl;
@ -12,22 +18,22 @@ import it.tref.portos.calendar.appointments.service.base.ProfessionistaServiceBa
/** /**
* The implementation of the professionista remote service. * The implementation of the professionista remote service.
*
* <p> * <p>
* All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy their definitions into the {@link it.tref.portos.calendar.appointments.service.ProfessionistaService} interface.
* their definitions into the {@link it.tref.portos.calendar.appointments.service.ProfessionistaService} interface. *
* <p> * <p>
* This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS * This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS credentials because this service can be accessed remotely.
* credentials because this service can be accessed remotely.
* </p> * </p>
* *
* @author 3F Consulting + Manifattura Web Group s.r.l. * @author 3F Consulting
* @see it.tref.portos.calendar.appointments.service.base.ProfessionistaServiceBaseImpl * @see it.tref.portos.calendar.appointments.service.base.ProfessionistaServiceBaseImpl
* @see it.tref.portos.calendar.appointments.service.ProfessionistaServiceUtil * @see it.tref.portos.calendar.appointments.service.ProfessionistaServiceUtil
*/ */
public class ProfessionistaServiceImpl extends ProfessionistaServiceBaseImpl { public class ProfessionistaServiceImpl extends ProfessionistaServiceBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link * NOTE FOR DEVELOPERS:
* it.tref.portos.calendar.appointments.service.ProfessionistaServiceUtil} to access the professionista remote *
* service. * Never reference this interface directly. Always use {@link it.tref.portos.calendar.appointments.service.ProfessionistaServiceUtil} to access the professionista remote service.
*/ */
} }

244
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/util/CalendarUtil.java

@ -5,6 +5,7 @@ import it.tref.portos.calendar.appointments.model.Prenotazione;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.regex.Matcher; import java.util.regex.Matcher;
@ -13,6 +14,8 @@ import java.util.regex.Pattern;
import javax.mail.internet.AddressException; import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress; import javax.mail.internet.InternetAddress;
import org.apache.log4j.net.TelnetAppender;
import com.liferay.mail.service.MailServiceUtil; import com.liferay.mail.service.MailServiceUtil;
import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.mail.MailMessage; import com.liferay.portal.kernel.mail.MailMessage;
@ -24,178 +27,174 @@ import com.liferay.util.portlet.PortletProps;
public class CalendarUtil { public class CalendarUtil {
public static void inviaEmailRichiestaAppuntamento(long userIdProfessionista, long userIdFunzionario, public static void inviaEmailRichiestaAppuntamento(long userIdProfessionista, long userIdFunzionario, Date startDate, String telefono, String emailFeUser) throws SystemException, AddressException{
Date startDate, String telefono, String emailFeUser) throws SystemException, AddressException {
User professionista = UserLocalServiceUtil.fetchUser(userIdProfessionista); User professionista = UserLocalServiceUtil.fetchUser(userIdProfessionista);
User boUser = UserLocalServiceUtil.fetchUser(userIdFunzionario); User boUser = UserLocalServiceUtil.fetchUser(userIdFunzionario);
InternetAddress fromAddress = new InternetAddress("portos@regione.toscana.it"); InternetAddress fromAddress = new InternetAddress("portos@regione.toscana.it");
InternetAddress toAddress = isAllowedEmailAddress(professionista.getEmailAddress()) ? new InternetAddress( InternetAddress toAddress = isAllowedEmailAddress(professionista.getEmailAddress()) ? new InternetAddress(professionista.getEmailAddress()) : null;
professionista.getEmailAddress()) : null; InternetAddress bccAddress = isAllowedEmailAddress(boUser.getEmailAddress()) ? new InternetAddress(boUser.getEmailAddress()) : null;
InternetAddress bccAddress = isAllowedEmailAddress(boUser.getEmailAddress()) ? new InternetAddress( InternetAddress toAddressToFeUser = isAllowedEmailAddress(emailFeUser) ? new InternetAddress(emailFeUser) : null;
boUser.getEmailAddress()) : null;
InternetAddress toAddressToFeUser = isAllowedEmailAddress(emailFeUser) ? new InternetAddress(
emailFeUser) : null;
MailMessage mailMessage = new MailMessage(); MailMessage mailMessage = new MailMessage();
// Product Backlog Item 32934 //Product Backlog Item 32934
List<InternetAddress> toAddresses = new ArrayList<InternetAddress>(); List<InternetAddress> toAddresses = new ArrayList<InternetAddress>();
if (toAddress != null) if(toAddress != null)
toAddresses.add(toAddress); toAddresses.add(toAddress);
if (toAddressToFeUser != null) if(toAddressToFeUser != null)
toAddresses.add(toAddressToFeUser); toAddresses.add(toAddressToFeUser);
mailMessage.setTo(toAddresses.toArray(new InternetAddress[0])); mailMessage.setTo(toAddresses.toArray(new InternetAddress[0]));
mailMessage.setFrom(fromAddress); mailMessage.setFrom(fromAddress);
if (bccAddress != null) if(bccAddress != null)
mailMessage.setBCC(bccAddress); mailMessage.setBCC(bccAddress);
mailMessage.setSubject("Notifica Richiesta Appuntamento Portos"); mailMessage.setSubject("Notifica Richiesta Appuntamento Portos");
mailMessage.setBody(creaCorpoMailRichiestaAppuntamento(professionista, boUser, startDate, telefono, mailMessage.setBody(creaCorpoMailRichiestaAppuntamento(professionista, boUser, startDate, telefono, emailFeUser));
emailFeUser));
mailMessage.setHTMLFormat(true); mailMessage.setHTMLFormat(true);
/* /*
* Invio email * Invio email
*/ */
MailServiceUtil.sendEmail(mailMessage); MailServiceUtil.sendEmail(mailMessage);
} }
public static void inviaEmailAnnullamentoAppuntamento(Prenotazione prenotazione) throws SystemException, public static void inviaEmailAnnullamentoAppuntamento(Prenotazione prenotazione) throws SystemException, AddressException{
AddressException {
User professionista = UserLocalServiceUtil.fetchUser(prenotazione.getProfessionistaId()); User professionista = UserLocalServiceUtil.fetchUser(prenotazione.getProfessionistaId());
User boUser = UserLocalServiceUtil.fetchUser(prenotazione.getFunzionarioId()); User boUser = UserLocalServiceUtil.fetchUser(prenotazione.getFunzionarioId());
InternetAddress fromAddress = new InternetAddress("portos@regione.toscana.it"); InternetAddress fromAddress = new InternetAddress("portos@regione.toscana.it");
InternetAddress toAddress = isAllowedEmailAddress(professionista.getEmailAddress()) ? new InternetAddress( InternetAddress toAddress = isAllowedEmailAddress(professionista.getEmailAddress()) ? new InternetAddress(professionista.getEmailAddress()) : null;
professionista.getEmailAddress()) : null; InternetAddress bccAddress = isAllowedEmailAddress(boUser.getEmailAddress()) ? new InternetAddress(boUser.getEmailAddress()) : null;
InternetAddress bccAddress = isAllowedEmailAddress(boUser.getEmailAddress()) ? new InternetAddress( InternetAddress toAddressToFeUser = isAllowedEmailAddress(prenotazione.getEmail()) ? new InternetAddress(prenotazione.getEmail()) : null;
boUser.getEmailAddress()) : null;
InternetAddress toAddressToFeUser = isAllowedEmailAddress(prenotazione.getEmail()) ? new InternetAddress(
prenotazione.getEmail()) : null;
MailMessage mailMessage = new MailMessage(); MailMessage mailMessage = new MailMessage();
// Product Backlog Item 32934 //Product Backlog Item 32934
List<InternetAddress> toAddresses = new ArrayList<InternetAddress>(); List<InternetAddress> toAddresses = new ArrayList<InternetAddress>();
if (toAddress != null) if(toAddress != null)
toAddresses.add(toAddress); toAddresses.add(toAddress);
if (toAddressToFeUser != null) if(toAddressToFeUser != null)
toAddresses.add(toAddressToFeUser); toAddresses.add(toAddressToFeUser);
mailMessage.setTo(toAddresses.toArray(new InternetAddress[0])); mailMessage.setTo(toAddresses.toArray(new InternetAddress[0]));
mailMessage.setFrom(fromAddress); mailMessage.setFrom(fromAddress);
if (bccAddress != null) if(bccAddress != null)
mailMessage.setBCC(bccAddress); mailMessage.setBCC(bccAddress);
mailMessage.setSubject("Notifica Annullamento Appuntamento Portos"); mailMessage.setSubject("Notifica Annullamento Appuntamento Portos");
mailMessage.setBody(creaCorpoMailAnnullamento(professionista, boUser, prenotazione.getStartDate())); mailMessage.setBody(creaCorpoMailAnnullamento(professionista, boUser, prenotazione.getStartDate()));
mailMessage.setHTMLFormat(true); mailMessage.setHTMLFormat(true);
/* /*
* Invio email * Invio email
*/ */
MailServiceUtil.sendEmail(mailMessage); MailServiceUtil.sendEmail(mailMessage);
} }
public static void inviaEmailReminderAppuntamenti(List<Prenotazione> lista, User userBo, Date tomorrow)
throws SystemException, AddressException { public static void inviaEmailReminderAppuntamenti(List<Prenotazione> lista, User userBo, Date tomorrow) throws SystemException, AddressException{
InternetAddress toAddress = isAllowedEmailAddress(userBo.getEmailAddress()) ? new InternetAddress( InternetAddress toAddress = isAllowedEmailAddress(userBo.getEmailAddress()) ? new InternetAddress(userBo.getEmailAddress()) : null;
userBo.getEmailAddress()) : null;
InternetAddress fromAddress = new InternetAddress("portos@regione.toscana.it"); InternetAddress fromAddress = new InternetAddress("portos@regione.toscana.it");
MailMessage mailMessage = new MailMessage(); MailMessage mailMessage = new MailMessage();
mailMessage.setTo(toAddress); mailMessage.setTo(toAddress);
mailMessage.setFrom(fromAddress); mailMessage.setFrom(fromAddress);
mailMessage.setSubject("Reminder appuntamenti Portos di domani"); mailMessage.setSubject("Reminder appuntamenti Portos di domani");
mailMessage.setBody(creaCorpoMailReminder(lista, userBo, tomorrow)); mailMessage.setBody(creaCorpoMailReminder(lista,userBo, tomorrow));
mailMessage.setHTMLFormat(true); mailMessage.setHTMLFormat(true);
/* /*
* Invio email * Invio email
*/ */
MailServiceUtil.sendEmail(mailMessage); MailServiceUtil.sendEmail(mailMessage);
} }
private static String creaCorpoMailReminder(List<Prenotazione> lista, User boUser, Date tomorrow)
throws SystemException { private static String creaCorpoMailReminder(List<Prenotazione> lista , User boUser, Date tomorrow) throws SystemException{
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
SimpleDateFormat sdfOra = new SimpleDateFormat("HH:mm"); SimpleDateFormat sdfOra = new SimpleDateFormat("HH:mm");
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
/* /*
* Gestione header * Gestione header
*/ */
sb.append("<html><head><title>Appuntamenti del " + sdf.format(tomorrow) + "</title></head><body>"); sb.append("<html><head><title>Appuntamenti del "
+ sdf.format(tomorrow)
+ "</title></head><body>");
sb.append("<div style='width:100%;'>"); sb.append("<div style='width:100%;'>");
sb.append("Gentile " + boUser.getFullName() + " ,"); sb.append("Gentile " + boUser.getFullName() + " ,");
sb.append("</div>"); sb.append("</div>");
sb.append("<br/>"); sb.append("<br/>");
sb.append("<br/>"); sb.append("<br/>");
sb.append("<div style='width:100%;'>"); sb.append("<div style='width:100%;'>");
sb.append("nella seguente email le ricordiamo i suoi appuntamenti per domani."); sb.append("nella seguente email le ricordiamo i suoi appuntamenti per domani.");
sb.append("</div>"); sb.append("</div>");
sb.append("<br/>"); sb.append("<br/>");
sb.append("<br/>"); sb.append("<br/>");
for (Prenotazione prenotazione : lista) { for (Prenotazione prenotazione : lista) {
User professionistaUser = UserLocalServiceUtil.fetchUser(prenotazione.getProfessionistaId()); User professionistaUser = UserLocalServiceUtil.fetchUser(prenotazione.getProfessionistaId());
sb.append("<div style='width:100%;'>"); sb.append("<div style='width:100%;'>");
sb.append("Ore " + sdfOra.format(prenotazione.getStartDate())); sb.append("Ore " +sdfOra.format(prenotazione.getStartDate()));
sb.append(" : appuntamento con " + professionistaUser.getFullName() + ". Motivo: "); sb.append(" : appuntamento con " + professionistaUser.getFullName() + ". Motivo: ");
sb.append(HtmlUtil.escape(prenotazione.getDescLong())); sb.append(HtmlUtil.escape(prenotazione.getDescLong()));
sb.append("</div>"); sb.append("</div>");
sb.append("<br/>"); sb.append("<br/>");
} }
sb.append("</body></html>"); sb.append("</body></html>");
return sb.toString(); return sb.toString();
} }
private static String creaCorpoMailRichiestaAppuntamento(User professionista, User boUser,
Date dataAppuntamento, String telefono, String mail) { private static String creaCorpoMailRichiestaAppuntamento(User professionista, User boUser, Date dataAppuntamento, String telefono, String mail){
SimpleDateFormat sdfGiorno = new SimpleDateFormat("d MMMMM yyyy"); SimpleDateFormat sdfGiorno = new SimpleDateFormat("d MMMMM yyyy");
SimpleDateFormat sdfOra = new SimpleDateFormat("HH:mm"); SimpleDateFormat sdfOra = new SimpleDateFormat("HH:mm");
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
/* /*
* Gestione header * Gestione header
*/ */
sb.append("<html><head><title>Notifica Richiesta Appuntamento Portos</title></head><body>"); sb.append("<html><head><title>Notifica Richiesta Appuntamento Portos</title></head><body>");
sb.append("<div style='width:100%;'>"); sb.append("<div style='width:100%;'>");
sb.append("Gentile " + professionista.getFullName() + " ,"); sb.append("Gentile " + professionista.getFullName() + " ,");
sb.append("</div>"); sb.append("</div>");
sb.append("<br/>"); sb.append("<br/>");
sb.append("<br/>"); sb.append("<br/>");
sb.append("<div style='width:100%;'>"); sb.append("<div style='width:100%;'>");
sb.append("con la presente mail la informiamo che il suo appuntamento del "); sb.append("con la presente mail la informiamo che il suo appuntamento del ");
sb.append(sdfGiorno.format(dataAppuntamento)); sb.append(sdfGiorno.format(dataAppuntamento));
@ -203,75 +202,74 @@ public class CalendarUtil {
sb.append(" con " + boUser.getFullName()); sb.append(" con " + boUser.getFullName());
sb.append(" &egrave; stato stato prenotato con successo."); sb.append(" &egrave; stato stato prenotato con successo.");
sb.append("</div>"); sb.append("</div>");
// Product Backlog Item 32934 //Product Backlog Item 32934
sb.append("<br/><div>Di seguito i recapiti che ha specificato:</div>"); sb.append("<br/><div>Di seguito i recapiti che ha specificato:</div>");
sb.append("<div>Telefono:&#9;").append(telefono).append("</div>"); sb.append("<div>Telefono:&#9;").append(telefono).append("</div>");
sb.append("<div>Email:&#9;").append(mail).append("</div>"); sb.append("<div>Email:&#9;").append(mail).append("</div>");
sb.append("</body></html>"); sb.append("</body></html>");
return sb.toString(); return sb.toString();
} }
private static String creaCorpoMailAnnullamento(User professionista, User boUser, Date dataAppuntamento) { private static String creaCorpoMailAnnullamento(User professionista, User boUser, Date dataAppuntamento){
SimpleDateFormat sdfGiorno = new SimpleDateFormat("d MMMMM yyyy"); SimpleDateFormat sdfGiorno = new SimpleDateFormat("d MMMMM yyyy");
SimpleDateFormat sdfOra = new SimpleDateFormat("HH:mm"); SimpleDateFormat sdfOra = new SimpleDateFormat("HH:mm");
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
/* /*
* Gestione header * Gestione header
*/ */
sb.append("<html><head><title>Notifica Annullamento Appuntamento Portos</title></head><body>"); sb.append("<html><head><title>Notifica Annullamento Appuntamento Portos</title></head><body>");
sb.append("<div style='width:100%;'>"); sb.append("<div style='width:100%;'>");
sb.append("Gentile " + professionista.getFullName() + " ,"); sb.append("Gentile " + professionista.getFullName() + " ,");
sb.append("</div>"); sb.append("</div>");
sb.append("<br/>"); sb.append("<br/>");
sb.append("<br/>"); sb.append("<br/>");
sb.append("<div style='width:100%;'>"); sb.append("<div style='width:100%;'>");
sb.append("con la presente mail la informiamo che il suo appuntamento del "); sb.append("con la presente mail la informiamo che il suo appuntamento del ");
sb.append(sdfGiorno.format(dataAppuntamento)); sb.append(sdfGiorno.format(dataAppuntamento));
sb.append(" delle ore " + sdfOra.format(dataAppuntamento)); sb.append(" delle ore " + sdfOra.format(dataAppuntamento));
sb.append(" &egrave; stato annullato per sopraggiunti impedimenti del tecnico istruttore."); sb.append(" &egrave; stato annullato per sopraggiunti impedimenti del tecnico istruttore.");
sb.append("</div>"); sb.append("</div>");
sb.append("</body></html>"); sb.append("</body></html>");
return sb.toString(); return sb.toString();
} }
// Bug 32935 //Bug 32935
public static int calculateTimeSlots(Date start, Date end, int slotInterval) { public static int calculateTimeSlots(Date start, Date end, int slotInterval){
Long count = null; Long count = null;
count = (((end.getTime() - start.getTime()) / 1000L) / 60L) / slotInterval + 1; count = (((end.getTime() - start.getTime()) / 1000L) / 60L) / slotInterval + 1;
return count.intValue(); return count.intValue();
} }
private static boolean isAllowedEmailAddress(String emailAddress) { private static boolean isAllowedEmailAddress(String emailAddress){
final String[] NOT_ALLOWED_EMAIL_DOMAINS = PortletProps final String[] NOT_ALLOWED_EMAIL_DOMAINS = PortletProps.getArray(PortletPropsKeys.EMAIL_DOMAINS_NOT_ALLOWED);
.getArray(PortletPropsKeys.EMAIL_DOMAINS_NOT_ALLOWED); final Pattern VALID_EMAIL_ADDRESS_REGEX = Pattern.compile(PortletProps.get(PortletPropsKeys.EMAIL_VALIDATOR_REGEXP), Pattern.CASE_INSENSITIVE);
final Pattern VALID_EMAIL_ADDRESS_REGEX = Pattern.compile(
PortletProps.get(PortletPropsKeys.EMAIL_VALIDATOR_REGEXP), Pattern.CASE_INSENSITIVE);
boolean isAllowed = true; boolean isAllowed = true;
if (Validator.isNotNull(emailAddress)) { if(Validator.isNotNull(emailAddress)){
Matcher matcher = VALID_EMAIL_ADDRESS_REGEX.matcher(emailAddress); Matcher matcher = VALID_EMAIL_ADDRESS_REGEX.matcher(emailAddress);
isAllowed = matcher.find(); isAllowed = matcher.find();
String emailDomain = emailAddress.substring(emailAddress.indexOf("@") + 1); String emailDomain = emailAddress.substring(emailAddress.indexOf("@") + 1);
if (isAllowed && Arrays.asList(NOT_ALLOWED_EMAIL_DOMAINS).contains(emailDomain)) { if(isAllowed && Arrays.asList(NOT_ALLOWED_EMAIL_DOMAINS).contains(emailDomain)){
isAllowed = false; isAllowed = false;
} }
} else { }else{
isAllowed = false; isAllowed = false;
} }
return isAllowed; return isAllowed;
} }
} }

1
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/init.jsp

@ -1,4 +1,3 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="java.util.ArrayList"%> <%@page import="java.util.ArrayList"%>
<%@page import="com.liferay.portal.model.Role"%> <%@page import="com.liferay.portal.model.Role"%>
<%@page import="com.liferay.portal.service.UserGroupRoleLocalServiceUtil"%> <%@page import="com.liferay.portal.service.UserGroupRoleLocalServiceUtil"%>

1
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/tabs/amministrazione.jsp

@ -1,4 +1,3 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.portos.calendar.appointments.service.PrenotazioneLocalServiceUtil"%> <%@page import="it.tref.portos.calendar.appointments.service.PrenotazioneLocalServiceUtil"%>
<%@page import="com.liferay.portal.service.OrganizationLocalServiceUtil"%> <%@page import="com.liferay.portal.service.OrganizationLocalServiceUtil"%>
<%@page import="com.liferay.portal.model.Organization"%> <%@page import="com.liferay.portal.model.Organization"%>

1
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/tabs/calendar.jsp

@ -1,4 +1,3 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.liferay.portal.service.OrganizationLocalServiceUtil"%> <%@page import="com.liferay.portal.service.OrganizationLocalServiceUtil"%>
<%@page import="com.liferay.portal.model.Organization"%> <%@page import="com.liferay.portal.model.Organization"%>
<%@page import="it.tref.portos.calendar.appointments.service.DisponibilitaLocalServiceUtil"%> <%@page import="it.tref.portos.calendar.appointments.service.DisponibilitaLocalServiceUtil"%>

33
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/tabs/gestione_disponibilita.jsp

@ -1,4 +1,3 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.liferay.portal.service.UserLocalServiceUtil"%> <%@page import="com.liferay.portal.service.UserLocalServiceUtil"%>
<%@page import="it.tref.portos.calendar.appointments.service.PrenotazioneLocalServiceUtil"%> <%@page import="it.tref.portos.calendar.appointments.service.PrenotazioneLocalServiceUtil"%>
<%@page import="it.tref.portos.calendar.appointments.service.DisponibilitaLocalServiceUtil"%> <%@page import="it.tref.portos.calendar.appointments.service.DisponibilitaLocalServiceUtil"%>
@ -6,34 +5,46 @@
<%@page import="javax.portlet.PortletURL"%> <%@page import="javax.portlet.PortletURL"%>
<%@page import="java.util.Calendar"%> <%@page import="java.util.Calendar"%>
<%@ include file="/html/calendar_appointments/init.jsp" %> <%@ include file="/html/calendar_appointments/init.jsp" %>
<% <%
Calendar cal = Calendar.getInstance(); // locale-specific Calendar cal = Calendar.getInstance(); // locale-specific
cal.set(Calendar.HOUR_OF_DAY, 8); cal.set(Calendar.HOUR_OF_DAY, 8);
cal.set(Calendar.MINUTE, 0); cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0); cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0); cal.set(Calendar.MILLISECOND, 0);
SimpleDateFormat sdfGiorno = new SimpleDateFormat("d MMMMM yyyy"); SimpleDateFormat sdfGiorno = new SimpleDateFormat("d MMMMM yyyy");
SimpleDateFormat sdfOra = new SimpleDateFormat("HH:mm"); SimpleDateFormat sdfOra = new SimpleDateFormat("HH:mm");
PortletURL iteratorURLMie = liferayPortletResponse.createRenderURL(); PortletURL iteratorURLMie = liferayPortletResponse.createRenderURL();
iteratorURLMie.setParameter("tabs1", tabs1); iteratorURLMie.setParameter("tabs1", tabs1);
String provinciaRicerca = ParamUtil.getString(request, "presidio_user_select", "-1"); String provinciaRicerca = ParamUtil.getString(request, "presidio_user_select", "-1");
String funzionarioIdRicerca = ParamUtil.getString(request, "funzionarioId", "-1"); String funzionarioIdRicerca = ParamUtil.getString(request, "funzionarioId", "-1");
PortletURL iteratorURLAltri = liferayPortletResponse.createRenderURL(); PortletURL iteratorURLAltri = liferayPortletResponse.createRenderURL();
iteratorURLAltri.setParameter("tabs1", tabs1); iteratorURLAltri.setParameter("tabs1", tabs1);
iteratorURLAltri.setParameter("presidio_user_select", provinciaRicerca); iteratorURLAltri.setParameter("presidio_user_select", provinciaRicerca);
iteratorURLAltri.setParameter("funzionarioId", funzionarioIdRicerca); iteratorURLAltri.setParameter("funzionarioId", funzionarioIdRicerca);
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
%> %>
<liferay-portlet:actionURL name="addDisponibilita" var="addDisponibilitaURL"> <liferay-portlet:actionURL name="addDisponibilita" var="addDisponibilitaURL">
<liferay-portlet:param name="tabs1" value="Amministrazione"/> <liferay-portlet:param name="tabs1" value="Amministrazione"/>
<liferay-portlet:param name="funzionarioId" value='<%=""+user.getUserId() %>'/> <liferay-portlet:param name="funzionarioId" value='<%=""+user.getUserId() %>'/>
<liferay-portlet:param name="mvcPath" value="/html/calendar_appointments/view.jsp"/> <liferay-portlet:param name="mvcPath" value="/html/calendar_appointments/view.jsp"/>
</liferay-portlet:actionURL> </liferay-portlet:actionURL>
<c:if test="<%= !isDirigenteGenerale %>">
<c:if test="<%=!isDirigenteGenerale %>">
<div class="module-group fm_user_disponibilita_container" style="margin-top:2%;"> <div class="module-group fm_user_disponibilita_container" style="margin-top:2%;">
<aui:form name="fm_disponibilita_user" method="post" action="<%= addDisponibilitaURL %>"> <aui:form name="fm_disponibilita_user" method="post" action="<%= addDisponibilitaURL %>">
<liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="Aggiungi Disponibilità"> <liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="Aggiungi Disponibilitŕ">
<div class="container-fluid container-presidio-select"> <div class="container-fluid container-presidio-select">
<div class="row"> <div class="row">
<div class="col-xs-12 col-sm-12 col-md-6 col-lg-6"> <div class="col-xs-12 col-sm-12 col-md-6 col-lg-6">
@ -145,7 +156,7 @@ SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
<div class="module-group fm_user_indisponibilita_container" style="margin-top:2%;"> <div class="module-group fm_user_indisponibilita_container" style="margin-top:2%;">
<aui:form name="fm_indisponibilita_user" method="post" action="<%= addIndisponibilitaURL %>"> <aui:form name="fm_indisponibilita_user" method="post" action="<%= addIndisponibilitaURL %>">
<liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="Aggiungi Indisponibilità"> <liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="Aggiungi Indisponibilitŕ">
<div class="container-fluid container-presidio-select"> <div class="container-fluid container-presidio-select">
<div class="row"> <div class="row">
@ -251,7 +262,7 @@ SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
</c:if> </c:if>
<div class="module-group fm_generale_disponibilita_container" style="margin-top:2%;"> <div class="module-group fm_generale_disponibilita_container" style="margin-top:2%;">
<liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="Le mie disponibilità"> <liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="Le mie disponibilitŕ">
<div class="container-fluid container-presidio-select"> <div class="container-fluid container-presidio-select">
<div class="row"> <div class="row">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12"> <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
@ -272,7 +283,7 @@ SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
className="it.tref.portos.calendar.appointments.model.Disponibilita" className="it.tref.portos.calendar.appointments.model.Disponibilita"
modelVar="disponibilita" modelVar="disponibilita"
> >
<liferay-ui:search-container-column-text name="Disponibilità Appuntamento"> <liferay-ui:search-container-column-text name="Disponibilitŕ Appuntamento">
<% <%
out.print(sdfGiorno.format(disponibilita.getStartDate()) + " dalle " + sdfOra.format(disponibilita.getStartDate()) + " alle " + sdfOra.format(disponibilita.getEndDate())); out.print(sdfGiorno.format(disponibilita.getStartDate()) + " dalle " + sdfOra.format(disponibilita.getStartDate()) + " alle " + sdfOra.format(disponibilita.getEndDate()));
%> %>
@ -292,7 +303,7 @@ SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
<liferay-ui:search-container-column-text name="Disponibile"> <liferay-ui:search-container-column-text name="Disponibile">
<% <%
if(disponibilita.isDisponibile()){ if(disponibilita.isDisponibile()){
out.print("Sì"); out.print("Si");
} else { } else {
out.print("No"); out.print("No");
} }
@ -316,7 +327,7 @@ SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
<c:if test="<%=isPO %>"> <c:if test="<%=isPO %>">
<div class="module-group fm_generale_disponibilita_container" style="margin-top:2%;"> <div class="module-group fm_generale_disponibilita_container" style="margin-top:2%;">
<liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="Disponibilità Sotto Controllo"> <liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="Disponibilitŕ Sotto Controllo">
<!-- FILTRO PER PROVINCIA O FUNZIONARIO --> <!-- FILTRO PER PROVINCIA O FUNZIONARIO -->
@ -383,7 +394,7 @@ SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
out.print(funzionario.getFullName()); out.print(funzionario.getFullName());
%> %>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="Disponibilità Appuntamento"> <liferay-ui:search-container-column-text name="Disponibilitŕ Appuntamento">
<% <%
out.print(sdfGiorno.format(disponibilita.getStartDate()) + " dalle " + sdfOra.format(disponibilita.getStartDate()) + " alle " + sdfOra.format(disponibilita.getEndDate())); out.print(sdfGiorno.format(disponibilita.getStartDate()) + " dalle " + sdfOra.format(disponibilita.getStartDate()) + " alle " + sdfOra.format(disponibilita.getEndDate()));
%> %>
@ -403,7 +414,7 @@ SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
<liferay-ui:search-container-column-text name="Disponibile"> <liferay-ui:search-container-column-text name="Disponibile">
<% <%
if(disponibilita.isDisponibile()){ if(disponibilita.isDisponibile()){
out.print("Sì"); out.print("Si");
} else { } else {
out.print("No"); out.print("No");
} }

1
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/tabs/gestione_disponibilita_action.jsp

@ -1,4 +1,3 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.portos.calendar.appointments.model.Disponibilita"%> <%@page import="it.tref.portos.calendar.appointments.model.Disponibilita"%>
<%@ include file="/html/calendar_appointments/init.jsp" %> <%@ include file="/html/calendar_appointments/init.jsp" %>

1
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/view.jsp

@ -1,4 +1,3 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.liferay.portal.service.GroupLocalServiceUtil"%> <%@page import="com.liferay.portal.service.GroupLocalServiceUtil"%>
<%@ include file="/html/calendar_appointments/init.jsp" %> <%@ include file="/html/calendar_appointments/init.jsp" %>
<% <%

1
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/init.jsp

@ -1,4 +1,3 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="java.text.Format"%> <%@page import="java.text.Format"%>
<%@page import="com.liferay.portal.kernel.util.FastDateFormatFactoryUtil"%> <%@page import="com.liferay.portal.kernel.util.FastDateFormatFactoryUtil"%>
<%@page import="com.liferay.portal.kernel.util.StringUtil"%> <%@page import="com.liferay.portal.kernel.util.StringUtil"%>

8
liferay-plugins-sdk-6.2/portlets/portos-company-configuration-portlet/docroot/WEB-INF/liferay-portlet.xml

@ -5,14 +5,10 @@
<portlet> <portlet>
<portlet-name>1</portlet-name> <portlet-name>1</portlet-name>
<icon>/icon.png</icon> <icon>/icon.png</icon>
<control-panel-entry-category> <control-panel-entry-category>configuration</control-panel-entry-category>
configuration
</control-panel-entry-category>
<control-panel-entry-weight>1.5</control-panel-entry-weight> <control-panel-entry-weight>1.5</control-panel-entry-weight>
<header-portlet-css>/css/main.css</header-portlet-css> <header-portlet-css>/css/main.css</header-portlet-css>
<footer-portlet-javascript> <footer-portlet-javascript>/js/main.js</footer-portlet-javascript>
/js/main.js
</footer-portlet-javascript>
<css-class-wrapper>1-portlet</css-class-wrapper> <css-class-wrapper>1-portlet</css-class-wrapper>
</portlet> </portlet>
<role-mapper> <role-mapper>

18
liferay-plugins-sdk-6.2/portlets/portos-company-configuration-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/companyconfig/portlet/CompanyConfigurationPortlet.java

@ -1,24 +1,30 @@
package it.tref.liferay.portos.companyconfig.portlet; package it.tref.liferay.portos.companyconfig.portlet;
import javax.portlet.ActionRequest;
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.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.model.Company; import com.liferay.portal.model.Company;
import com.liferay.portal.service.CompanyLocalServiceUtil; import com.liferay.portal.service.CompanyLocalServiceUtil;
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.util.bridges.mvc.MVCPortlet; import com.liferay.util.bridges.mvc.MVCPortlet;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
public class CompanyConfigurationPortlet extends MVCPortlet { public class CompanyConfigurationPortlet extends MVCPortlet {
public void saveCustomFields(ActionRequest actionRequest, ActionResponse actionResponse) throws PortalException, public void saveCustomFields(ActionRequest actionRequest,
ActionResponse actionResponse) throws PortalException,
SystemException { SystemException {
ServiceContext serviceContext = ServiceContextFactory.getInstance(Company.class.getName(), actionRequest); ServiceContext serviceContext = ServiceContextFactory.getInstance(
Company company = CompanyLocalServiceUtil.getCompany(serviceContext.getCompanyId()); Company.class.getName(), actionRequest);
Company company = CompanyLocalServiceUtil.getCompany(serviceContext
.getCompanyId());
company.setExpandoBridgeAttributes(serviceContext); company.setExpandoBridgeAttributes(serviceContext);
CompanyLocalServiceUtil.updateCompany(company); CompanyLocalServiceUtil.updateCompany(company);
} }
} }

1
liferay-plugins-sdk-6.2/portlets/portos-company-configuration-portlet/docroot/html/company_configuration/init.jsp

@ -1,4 +1,3 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/html/init.jsp" %> <%@include file="/html/init.jsp" %>
<%@page import="com.liferay.portal.kernel.util.ParamUtil"%> <%@page import="com.liferay.portal.kernel.util.ParamUtil"%>

29
liferay-plugins-sdk-6.2/portlets/portos-company-configuration-portlet/docroot/html/company_configuration/view.jsp

@ -1,25 +1,38 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="javax.portlet.PortletURL"%> <%@page import="javax.portlet.PortletURL"%>
<%@page import="javax.portlet.PortletRequest"%> <%@page import="javax.portlet.PortletRequest"%>
<%@page import="com.liferay.portal.util.PortletKeys"%> <%@page import="com.liferay.portal.util.PortletKeys"%>
<%@page import="com.liferay.portlet.PortletURLFactoryUtil"%> <%@page import="com.liferay.portlet.PortletURLFactoryUtil"%>
<%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%> <%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%>
<%@include file="/html/company_configuration/init.jsp"%> <%@include file="/html/company_configuration/init.jsp" %>
<% <%
PortletURL companyCustomFieldsURL = PortletURLFactoryUtil.create(request, PortletKeys.EXPANDO, plid, PortletRequest.RENDER_PHASE); PortletURL companyCustomFieldsURL = PortletURLFactoryUtil.create(request, PortletKeys.EXPANDO, plid, PortletRequest.RENDER_PHASE);
companyCustomFieldsURL.setWindowState(LiferayWindowState.POP_UP); companyCustomFieldsURL.setWindowState(LiferayWindowState.POP_UP);
companyCustomFieldsURL.setParameter("struts_action", "/expando/view_attributes"); companyCustomFieldsURL.setParameter("struts_action", "/expando/view_attributes");
companyCustomFieldsURL.setParameter("modelResource", Company.class.getName()); companyCustomFieldsURL.setParameter("modelResource", Company.class.getName());
%> %>
<liferay-ui:icon message="manage-company-custom-fields" url="<%= companyCustomFieldsURL.toString() %>" label="true"
iconCssClass="icon-edit" linkCssClass="btn" useDialog="true" /> <liferay-ui:icon
<portlet:actionURL name="saveCustomFields" var="saveCustomFieldsURL" /> message="manage-company-custom-fields"
url="<%=companyCustomFieldsURL.toString() %>"
label="true"
iconCssClass="icon-edit"
linkCssClass="btn"
useDialog="true"
/>
<portlet:actionURL name="saveCustomFields" var="saveCustomFieldsURL"></portlet:actionURL>
<div class="separator"></div> <div class="separator"></div>
<aui:form name="fm" action="<%=saveCustomFieldsURL.toString() %>"> <aui:form name="fm" action="<%=saveCustomFieldsURL.toString() %>">
<aui:fieldset> <aui:fieldset>
<liferay-ui:custom-attribute-list className="<%= Company.class.getName() %>" <liferay-ui:custom-attribute-list
classPK="<%= (company != null) ? company.getCompanyId() : 0 %>" className="<%= Company.class.getName() %>"
editable="true" label="true" /> classPK="<%= (company != null) ? company.getCompanyId() : 0 %>"
editable="<%= true %>"
label="<%= true %>"
/>
</aui:fieldset> </aui:fieldset>
<aui:button type="submit" value="btn-save-custom-fields"></aui:button> <aui:button type="submit" value="btn-save-custom-fields"></aui:button>
</aui:form> </aui:form>

1
liferay-plugins-sdk-6.2/portlets/portos-company-configuration-portlet/docroot/html/init.jsp

@ -1,4 +1,3 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %> <%@taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>

163
liferay-plugins-sdk-6.2/portlets/portos-cookies-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/cookies/action/StartUpAction.java

@ -1,5 +1,6 @@
package it.tref.liferay.portos.cookies.action; package it.tref.liferay.portos.cookies.action;
import com.liferay.portal.kernel.events.ActionException; import com.liferay.portal.kernel.events.ActionException;
import com.liferay.portal.kernel.events.SimpleAction; import com.liferay.portal.kernel.events.SimpleAction;
import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception.PortalException;
@ -25,73 +26,97 @@ import com.liferay.portlet.expando.service.ExpandoTableLocalServiceUtil;
public class StartUpAction extends SimpleAction { public class StartUpAction extends SimpleAction {
private static final Log _log = LogFactoryUtil.getLog(StartUpAction.class); private final static Log _log = LogFactoryUtil.getLog(StartUpAction.class);
@Override @Override
public void run(String[] companyIds) throws ActionException { public void run(String[] companyIds) throws ActionException {
for (String id : companyIds) { for (String id : companyIds) {
try { try {
long companyId = GetterUtil.getLong(id); long companyId = GetterUtil.getLong(id);
String[] defaultActions = { ActionKeys.VIEW, ActionKeys.UPDATE };
String[] guestActions = { ActionKeys.VIEW }; String[] defaultActions = {ActionKeys.VIEW, ActionKeys.UPDATE};
// Organization custom fields String[] guestActions = {ActionKeys.VIEW};
addExpandoColumnIfNotExists(companyId, Group.class.getName(), "cookiesJournalarticleId",
ExpandoColumnConstants.STRING, true, false, defaultActions, guestActions); // Organization custom fields
} catch (Exception e) { addExpandoColumnIfNotExists(companyId, Group.class.getName(), "cookiesJournalarticleId",
_log.error("Errore nella procedura automatizzata di configurazione", e); ExpandoColumnConstants.STRING, true, false, defaultActions, guestActions);
} } catch (Exception e) {
} _log.error("Errore nella procedura automatizzata di configurazione", e);
} }
}
private ExpandoColumn addExpandoColumnIfNotExists(long companyId, String className, String name, int type, }
boolean indexed, boolean hidden, String[] defaultActions, String[] guestActions) throws SystemException {
private ExpandoColumn addExpandoColumnIfNotExists(long companyId, String className, String name, int type,
long classNameId = PortalUtil.getClassNameId(className); boolean indexed, boolean hidden, String[] defaultActions, String[] guestActions) throws SystemException {
ExpandoTable expandoTable = null;
try { long classNameId = PortalUtil.getClassNameId(className);
expandoTable = ExpandoTableLocalServiceUtil.getTable(companyId, classNameId,
ExpandoTableConstants.DEFAULT_TABLE_NAME); ExpandoTable expandoTable = null;
} catch (PortalException e) { try {
try { expandoTable =
expandoTable = ExpandoTableLocalServiceUtil.addTable(companyId, classNameId, ExpandoTableLocalServiceUtil.getTable(companyId, classNameId, ExpandoTableConstants.DEFAULT_TABLE_NAME);
ExpandoTableConstants.DEFAULT_TABLE_NAME); } catch (PortalException e) {
} catch (PortalException e1) {} try {
} expandoTable =
ExpandoColumn expandoColumn = ExpandoColumnLocalServiceUtil.getColumn(expandoTable.getTableId(), name); ExpandoTableLocalServiceUtil.addTable(companyId, classNameId, ExpandoTableConstants.DEFAULT_TABLE_NAME);
if (expandoColumn == null) { } catch (PortalException e1) {
try { }
expandoColumn = ExpandoColumnLocalServiceUtil.addColumn(expandoTable.getTableId(), name, type); }
} catch (PortalException e) {} ExpandoColumn expandoColumn = ExpandoColumnLocalServiceUtil.getColumn(expandoTable.getTableId(), name);
}
try { if (expandoColumn == null) {
if (indexed) {
UnicodeProperties typeSettingsProperties = expandoColumn.getTypeSettingsProperties(); try {
typeSettingsProperties.put(ExpandoColumnConstants.INDEX_TYPE, expandoColumn = ExpandoColumnLocalServiceUtil.addColumn(expandoTable.getTableId(), name, type);
String.valueOf(ExpandoColumnConstants.INDEX_TYPE_TEXT));
expandoColumn.setTypeSettingsProperties(typeSettingsProperties); } catch (PortalException e) {
expandoColumn = ExpandoColumnLocalServiceUtil.updateExpandoColumn(expandoColumn); }
} }
if (hidden) {
UnicodeProperties typeSettingsProperties = expandoColumn.getTypeSettingsProperties(); try {
typeSettingsProperties.put(ExpandoColumnConstants.PROPERTY_HIDDEN, String.valueOf(1));
expandoColumn.setTypeSettingsProperties(typeSettingsProperties); if (indexed) {
expandoColumn = ExpandoColumnLocalServiceUtil.updateExpandoColumn(expandoColumn);
} UnicodeProperties typeSettingsProperties = expandoColumn.getTypeSettingsProperties();
Role roleGuest = RoleLocalServiceUtil.getRole(companyId, RoleConstants.GUEST);
Role rolePowerUser = RoleLocalServiceUtil.getRole(companyId, RoleConstants.POWER_USER); typeSettingsProperties.put(ExpandoColumnConstants.INDEX_TYPE,
Role roleUser = RoleLocalServiceUtil.getRole(companyId, RoleConstants.USER); String.valueOf(ExpandoColumnConstants.INDEX_TYPE_TEXT));
ResourcePermissionLocalServiceUtil.setResourcePermissions(companyId, ExpandoColumn.class.getName(),
ResourceConstants.SCOPE_INDIVIDUAL, String.valueOf(expandoColumn.getColumnId()), expandoColumn.setTypeSettingsProperties(typeSettingsProperties);
roleGuest.getRoleId(), guestActions);
ResourcePermissionLocalServiceUtil.setResourcePermissions(companyId, ExpandoColumn.class.getName(), expandoColumn = ExpandoColumnLocalServiceUtil.updateExpandoColumn(expandoColumn);
ResourceConstants.SCOPE_INDIVIDUAL, String.valueOf(expandoColumn.getColumnId()), }
rolePowerUser.getRoleId(), defaultActions);
ResourcePermissionLocalServiceUtil.setResourcePermissions(companyId, ExpandoColumn.class.getName(), if (hidden) {
ResourceConstants.SCOPE_INDIVIDUAL, String.valueOf(expandoColumn.getColumnId()),
roleUser.getRoleId(), defaultActions); UnicodeProperties typeSettingsProperties = expandoColumn.getTypeSettingsProperties();
} catch (PortalException e) {}
return expandoColumn; typeSettingsProperties.put(ExpandoColumnConstants.PROPERTY_HIDDEN, String.valueOf(1));
}
expandoColumn.setTypeSettingsProperties(typeSettingsProperties);
expandoColumn = ExpandoColumnLocalServiceUtil.updateExpandoColumn(expandoColumn);
}
Role roleGuest = RoleLocalServiceUtil.getRole(companyId, RoleConstants.GUEST);
Role rolePowerUser = RoleLocalServiceUtil.getRole(companyId, RoleConstants.POWER_USER);
Role roleUser = RoleLocalServiceUtil.getRole(companyId, RoleConstants.USER);
ResourcePermissionLocalServiceUtil.setResourcePermissions(companyId, ExpandoColumn.class.getName(),
ResourceConstants.SCOPE_INDIVIDUAL, String.valueOf(expandoColumn.getColumnId()), roleGuest.getRoleId(),
guestActions);
ResourcePermissionLocalServiceUtil.setResourcePermissions(companyId, ExpandoColumn.class.getName(),
ResourceConstants.SCOPE_INDIVIDUAL, String.valueOf(expandoColumn.getColumnId()), rolePowerUser.getRoleId(),
defaultActions);
ResourcePermissionLocalServiceUtil.setResourcePermissions(companyId, ExpandoColumn.class.getName(),
ResourceConstants.SCOPE_INDIVIDUAL, String.valueOf(expandoColumn.getColumnId()), roleUser.getRoleId(),
defaultActions);
} catch (PortalException e) {
}
return expandoColumn;
}
} }

1
liferay-plugins-sdk-6.2/portlets/portos-cookies-portlet/docroot/init.jsp

@ -1,4 +1,3 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="java.text.SimpleDateFormat"%> <%@page import="java.text.SimpleDateFormat"%>
<%@page import="com.liferay.portlet.PortletURLUtil"%> <%@page import="com.liferay.portlet.PortletURLUtil"%>

1
liferay-plugins-sdk-6.2/portlets/portos-cookies-portlet/docroot/view.jsp

@ -1,4 +1,3 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.liferay.portal.util.PortalUtil"%> <%@page import="com.liferay.portal.util.PortalUtil"%>
<%@page import="com.liferay.portal.kernel.util.Validator"%> <%@page import="com.liferay.portal.kernel.util.Validator"%>
<%@page import="com.liferay.portal.kernel.util.StringPool"%> <%@page import="com.liferay.portal.kernel.util.StringPool"%>

5
liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/portlet.xml

@ -1,9 +1,6 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" <portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" version="2.0">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
version="2.0">
<portlet> <portlet>
<portlet-name>1</portlet-name> <portlet-name>1</portlet-name>
<display-name>Deploy Alert</display-name> <display-name>Deploy Alert</display-name>

128
liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/action/DeployAction.java

@ -1,14 +1,5 @@
package it.tref.liferay.portos.deployalert.action; package it.tref.liferay.portos.deployalert.action;
import it.tref.liferay.portos.deployalert.constants.MailConstants;
import it.tref.liferay.portos.deployalert.model.NotificationMail;
import it.tref.liferay.portos.deployalert.service.NotificationLogLocalServiceUtil;
import it.tref.liferay.portos.deployalert.service.NotificationMailLocalServiceUtil;
import it.tref.liferay.portos.deployalert.util.DeployAlertUtil;
import it.tref.liferay.portos.mailmanager.shared.messaging.util.MailManagerUtil;
import java.util.List;
import com.liferay.portal.kernel.events.ActionException; import com.liferay.portal.kernel.events.ActionException;
import com.liferay.portal.kernel.events.SimpleAction; import com.liferay.portal.kernel.events.SimpleAction;
import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception.PortalException;
@ -25,53 +16,78 @@ import com.liferay.portal.model.Company;
import com.liferay.portal.service.ServiceContext; import com.liferay.portal.service.ServiceContext;
import com.liferay.portal.util.PortalUtil; import com.liferay.portal.util.PortalUtil;
import it.tref.liferay.portos.deployalert.constants.MailConstants;
import it.tref.liferay.portos.deployalert.model.NotificationMail;
import it.tref.liferay.portos.deployalert.service.NotificationLogLocalServiceUtil;
import it.tref.liferay.portos.deployalert.service.NotificationMailLocalServiceUtil;
import it.tref.liferay.portos.deployalert.util.DeployAlertUtil;
import it.tref.liferay.portos.mailmanager.shared.messaging.util.MailManagerUtil;
import java.util.List;
public class DeployAction extends SimpleAction { public class DeployAction extends SimpleAction {
private static final Log _log = LogFactoryUtil.getLog(DeployAction.class); private final static Log _log = LogFactoryUtil.getLog(DeployAction.class);
@Override @Override
public void run(final String[] ids) throws ActionException { public void run(final String[] ids) throws ActionException {
/*
MessageBusUtil.registerMessageListener(DestinationNames.HOT_DEPLOY, new MessageListener() { * ServiceContext serviceContext = DeployAlertUtil.getServiceContext(); try {
* PermissionThreadLocal
@Override * .setPermissionChecker(PermissionCheckerFactoryUtil.create(UserLocalServiceUtil
public void receive(Message message) throws MessageListenerException { * .getUser(serviceContext.getUserId()))); } catch (Exception e) { _log.error(e, e); }
* DeployAlertUtil.addDefaultDeployMailTemplate(serviceContext);
String evento = message.getString("command"); * DeployAlertUtil.addDefaultUndeployMailTemplate(serviceContext);
String nomePlugin = message.getString("servletContextName"); */
if (evento.equals("undeploy") && nomePlugin.equals("portos-deploy-alert-portlet")) {
try { MessageBusUtil.registerMessageListener(DestinationNames.HOT_DEPLOY, new MessageListener() {
NotificationLogLocalServiceUtil.addNotification(nomePlugin, evento);
} catch (PortalException | SystemException e) { @Override
_log.error(e, e); public void receive(Message message) throws MessageListenerException {
}
MessageBusUtil.unregisterMessageListener(DestinationNames.HOT_DEPLOY, this); String evento = message.getString("command");
} else if (evento.equals("deploy") || evento.equals("undeploy")) { String nomePlugin = message.getString("servletContextName");
try {
List<NotificationMail> notifications; if (evento.equals("undeploy") && nomePlugin.equals("portos-deploy-alert-portlet")) {
NotificationLogLocalServiceUtil.addNotification(nomePlugin, evento); try {
notifications = NotificationLogLocalServiceUtil.addNotification(nomePlugin, evento);
NotificationMailLocalServiceUtil.findNotifications(PortalUtil.getDefaultCompanyId(), } catch (PortalException | SystemException e) {
nomePlugin); _log.error(e, e);
for (int i = 0; i < notifications.size(); i++) { }
String templateName = notifications.get(i).getNomeTemplate(); MessageBusUtil.unregisterMessageListener(DestinationNames.HOT_DEPLOY, this);
if (templateName.equals(MailConstants.DEFAULT_TEMPLATE)) { } else if (evento.equals("deploy") || evento.equals("undeploy")) {
if (evento.equals("deploy")) { try {
templateName = MailConstants.DEFAULT_DEPLOY_TEMPLATE; List<NotificationMail> notifications;
} else {
templateName = MailConstants.DEFAULT_UNDEPLOY_TEMPLATE; NotificationLogLocalServiceUtil.addNotification(nomePlugin, evento);
}
} notifications =
JSONObject parametri = DeployAlertUtil.getParametri(nomePlugin, evento); NotificationMailLocalServiceUtil.findNotifications(PortalUtil.getDefaultCompanyId(), nomePlugin);
ServiceContext serviceContext = DeployAlertUtil.getServiceContext();
MailManagerUtil.sendMailByTemplateName(Company.class.toString(), for (int i = 0; i < notifications.size(); i++) {
serviceContext.getCompanyId(), templateName, parametri, serviceContext);
} String templateName = notifications.get(i).getNomeTemplate();
} catch (Exception e) {
_log.error(e, e); if (templateName.equals(MailConstants.DEFAULT_TEMPLATE)) {
} if (evento.equals("deploy")) {
} templateName = MailConstants.DEFAULT_DEPLOY_TEMPLATE;
} } else {
}); templateName = MailConstants.DEFAULT_UNDEPLOY_TEMPLATE;
} }
}
JSONObject parametri = DeployAlertUtil.getParametri(nomePlugin, evento);
ServiceContext serviceContext = DeployAlertUtil.getServiceContext();
MailManagerUtil.sendMailByTemplateName(Company.class.toString(), serviceContext.getCompanyId(),
templateName, parametri, serviceContext);
}
} catch (Exception e) {
_log.error(e, e);
}
}
}
});
}
} }

9
liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/constants/MailConstants.java

@ -2,7 +2,10 @@ package it.tref.liferay.portos.deployalert.constants;
public class MailConstants { public class MailConstants {
public static final String DEFAULT_TEMPLATE = "default"; public static final String DEFAULT_TEMPLATE = "default";
public static final String DEFAULT_DEPLOY_TEMPLATE = "default-deploy";
public static final String DEFAULT_UNDEPLOY_TEMPLATE = "default-undeploy"; public static final String DEFAULT_DEPLOY_TEMPLATE = "default-deploy";
public static final String DEFAULT_UNDEPLOY_TEMPLATE = "default-undeploy";
} }

23
liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/control/DeployAlertControl.java

@ -8,14 +8,17 @@ import com.liferay.portlet.BaseControlPanelEntry;
public class DeployAlertControl extends BaseControlPanelEntry { public class DeployAlertControl extends BaseControlPanelEntry {
@Override public boolean hasAccessPermission(PermissionChecker permissionChecker, Group group, Portlet portlet)
public boolean hasAccessPermission(PermissionChecker permissionChecker, Group group, Portlet portlet) throws Exception {
throws Exception {
long companyId = PortalUtil.getDefaultCompanyId();
long companyId = PortalUtil.getDefaultCompanyId();
if (companyId == permissionChecker.getCompanyId()) { if (companyId == permissionChecker.getCompanyId()) {
return true; return true;
} }
return false;
} return false;
}
} }

100
liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/portlet/NotificatorPortlet.java

@ -1,11 +1,5 @@
package it.tref.liferay.portos.deployalert.portlet; package it.tref.liferay.portos.deployalert.portlet;
import it.tref.liferay.portos.deployalert.model.NotificationMail;
import it.tref.liferay.portos.deployalert.service.NotificationMailLocalServiceUtil;
import javax.portlet.ActionRequest;
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.servlet.SessionErrors; import com.liferay.portal.kernel.servlet.SessionErrors;
@ -14,45 +8,61 @@ import com.liferay.portal.service.ServiceContext;
import com.liferay.portal.service.ServiceContextFactory; import com.liferay.portal.service.ServiceContextFactory;
import com.liferay.util.bridges.mvc.MVCPortlet; import com.liferay.util.bridges.mvc.MVCPortlet;
import it.tref.liferay.portos.deployalert.model.NotificationMail;
import it.tref.liferay.portos.deployalert.service.NotificationMailLocalServiceUtil;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
/**
* Portlet implementation class AdminDeployNotificatorPortlet
*/
public class NotificatorPortlet extends MVCPortlet { public class NotificatorPortlet extends MVCPortlet {
public void addNotification(ActionRequest request, ActionResponse response) throws PortalException, SystemException { public void addNotification(ActionRequest request, ActionResponse response) throws PortalException, SystemException {
ServiceContext serviceContext = ServiceContextFactory.getInstance(NotificationMail.class.getName(), request); ServiceContext serviceContext = ServiceContextFactory.getInstance(NotificationMail.class.getName(), request);
String nomePlugin = ParamUtil.getString(request, "nomePlugin");
String nomeTemplate = ParamUtil.getString(request, "nomeTemplate"); String nomePlugin = ParamUtil.getString(request, "nomePlugin");
try { String nomeTemplate = ParamUtil.getString(request, "nomeTemplate");
NotificationMailLocalServiceUtil.addNotification(nomePlugin, nomeTemplate, serviceContext);
} catch (PortalException e) { try {
SessionErrors.add(request, e.getClass()); NotificationMailLocalServiceUtil.addNotification(nomePlugin, nomeTemplate, serviceContext);
response.setRenderParameter("mvcPath", "/html/notificator/edit_notification.jsp"); } catch (PortalException e) {
} SessionErrors.add(request, e.getClass());
}
response.setRenderParameter("mvcPath", "/html/notificator/edit_notification.jsp");
public void deleteNotification(ActionRequest request, ActionResponse response) throws PortalException, }
SystemException { }
long notificationId = ParamUtil.getLong(request, "notificationId"); public void deleteNotification(ActionRequest request, ActionResponse response) throws PortalException,
try { SystemException {
NotificationMailLocalServiceUtil.deleteNotificationMail(notificationId);
} catch (PortalException pe) { long notificationId = ParamUtil.getLong(request, "notificationId");
SessionErrors.add(request, pe.getClass().getName());
} try {
} NotificationMailLocalServiceUtil.deleteNotificationMail(notificationId);
public void updateNotification(ActionRequest request, ActionResponse response) throws PortalException, } catch (PortalException pe) {
SystemException { SessionErrors.add(request, pe.getClass().getName());
}
ServiceContext serviceContext = ServiceContextFactory.getInstance(NotificationMail.class.getName(), request); }
String nomePlugin = ParamUtil.getString(request, "nomePlugin");
String nomeTemplate = ParamUtil.getString(request, "nomeTemplate"); public void updateNotification(ActionRequest request, ActionResponse response) throws PortalException,
long notificationId = ParamUtil.getLong(request, "notificationId"); SystemException {
try {
NotificationMailLocalServiceUtil.updateNotification(nomePlugin, nomeTemplate, serviceContext, ServiceContext serviceContext = ServiceContextFactory.getInstance(NotificationMail.class.getName(), request);
notificationId);
} catch (PortalException pe) { String nomePlugin = ParamUtil.getString(request, "nomePlugin");
SessionErrors.add(request, pe.getClass()); String nomeTemplate = ParamUtil.getString(request, "nomeTemplate");
response.setRenderParameter("mvcPath", "/html/notificator/edit_notification.jsp"); long notificationId = ParamUtil.getLong(request, "notificationId");
}
} try {
NotificationMailLocalServiceUtil.updateNotification(nomePlugin, nomeTemplate, serviceContext, notificationId);
} catch (PortalException pe) {
SessionErrors.add(request, pe.getClass());
response.setRenderParameter("mvcPath", "/html/notificator/edit_notification.jsp");
}
}
} }

86
liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/service/impl/NotificationLogLocalServiceImpl.java

@ -1,13 +1,23 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
* and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software *
* Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in * This library is free software; you can redistribute it and/or modify it under
* the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * the terms of the GNU Lesser General Public License as published by the Free
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. * Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/ */
package it.tref.liferay.portos.deployalert.service.impl; package it.tref.liferay.portos.deployalert.service.impl;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.util.Validator;
import it.tref.liferay.portos.deployalert.NotificationNomePluginException; import it.tref.liferay.portos.deployalert.NotificationNomePluginException;
import it.tref.liferay.portos.deployalert.NotificationTipoException; import it.tref.liferay.portos.deployalert.NotificationTipoException;
import it.tref.liferay.portos.deployalert.model.NotificationLog; import it.tref.liferay.portos.deployalert.model.NotificationLog;
@ -15,18 +25,15 @@ import it.tref.liferay.portos.deployalert.service.base.NotificationLogLocalServi
import java.util.Date; import java.util.Date;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.util.Validator;
/** /**
* The implementation of the notification log local service. * The implementation of the notification log local service.
* <p> * <p>
* All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy * All custom service methods should be put in this class. Whenever methods are added, rerun
* their definitions into the {@link it.tref.liferay.portos.deployalert.service.NotificationLogLocalService} interface. * ServiceBuilder to copy their definitions into the
* {@link it.tref.liferay.portos.deployalert.service.NotificationLogLocalService} interface.
* <p> * <p>
* This is a local service. Methods of this service will not have security checks based on the propagated JAAS * This is a local service. Methods of this service will not have security checks based on the
* credentials because this service can only be accessed from within the same VM. * propagated JAAS credentials because this service can only be accessed from within the same VM.
* </p> * </p>
* *
* @author Matteo * @author Matteo
@ -35,28 +42,33 @@ import com.liferay.portal.kernel.util.Validator;
*/ */
public class NotificationLogLocalServiceImpl extends NotificationLogLocalServiceBaseImpl { public class NotificationLogLocalServiceImpl extends NotificationLogLocalServiceBaseImpl {
@Override public NotificationLog addNotification(String nomePlugin, String tipo) throws SystemException, PortalException {
public NotificationLog addNotification(String nomePlugin, String tipo) throws SystemException, PortalException {
Date now = new Date();
Date now = new Date();
validate(nomePlugin, tipo); validate(nomePlugin, tipo);
long notificationId = counterLocalService.increment(NotificationLog.class.getName());
NotificationLog notification = notificationLogPersistence.create(notificationId); long notificationId = counterLocalService.increment(NotificationLog.class.getName());
notification.setTipo(tipo);
notification.setNomePlugin(nomePlugin); NotificationLog notification = notificationLogPersistence.create(notificationId);
notification.setData(now);
notificationLogPersistence.update(notification); notification.setTipo(tipo);
return notification; notification.setNomePlugin(nomePlugin);
} notification.setData(now);
notificationLogPersistence.update(notification);
private void validate(String nomePlugin, String tipo) throws NotificationTipoException,
NotificationNomePluginException { return notification;
}
if (Validator.isNull(nomePlugin)) {
throw new NotificationNomePluginException(); private void validate(String nomePlugin, String tipo) throws NotificationTipoException,
} NotificationNomePluginException {
if (Validator.isNull(tipo)) {
throw new NotificationTipoException(); if (Validator.isNull(nomePlugin)) {
} throw new NotificationNomePluginException();
} }
if (Validator.isNull(tipo)) {
throw new NotificationTipoException();
}
}
} }

227
liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/service/impl/NotificationMailLocalServiceImpl.java

@ -1,22 +1,19 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
* and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software *
* Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in * This library is free software; you can redistribute it and/or modify it under
* the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * the terms of the GNU Lesser General Public License as published by the Free
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. * Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/ */
package it.tref.liferay.portos.deployalert.service.impl; package it.tref.liferay.portos.deployalert.service.impl;
import it.tref.liferay.portos.deployalert.NotificationNomePluginException;
import it.tref.liferay.portos.deployalert.NotificationNomeTemplateException;
import it.tref.liferay.portos.deployalert.model.NotificationMail;
import it.tref.liferay.portos.deployalert.service.NotificationMailLocalServiceUtil;
import it.tref.liferay.portos.deployalert.service.base.NotificationMailLocalServiceBaseImpl;
import java.util.Date;
import java.util.List;
import com.liferay.portal.kernel.dao.orm.Disjunction; import com.liferay.portal.kernel.dao.orm.Disjunction;
import com.liferay.portal.kernel.dao.orm.DynamicQuery; import com.liferay.portal.kernel.dao.orm.DynamicQuery;
import com.liferay.portal.kernel.dao.orm.OrderFactoryUtil; import com.liferay.portal.kernel.dao.orm.OrderFactoryUtil;
@ -28,14 +25,24 @@ import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.model.User; import com.liferay.portal.model.User;
import com.liferay.portal.service.ServiceContext; import com.liferay.portal.service.ServiceContext;
import it.tref.liferay.portos.deployalert.NotificationNomePluginException;
import it.tref.liferay.portos.deployalert.NotificationNomeTemplateException;
import it.tref.liferay.portos.deployalert.model.NotificationMail;
import it.tref.liferay.portos.deployalert.service.NotificationMailLocalServiceUtil;
import it.tref.liferay.portos.deployalert.service.base.NotificationMailLocalServiceBaseImpl;
import java.util.Date;
import java.util.List;
/** /**
* The implementation of the notification mail local service. * The implementation of the notification mail local service.
* <p> * <p>
* All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy * All custom service methods should be put in this class. Whenever methods are added, rerun
* their definitions into the {@link it.tref.liferay.portos.deployalert.service.NotificationMailLocalService} interface. * ServiceBuilder to copy their definitions into the
* {@link it.tref.liferay.portos.deployalert.service.NotificationMailLocalService} interface.
* <p> * <p>
* This is a local service. Methods of this service will not have security checks based on the propagated JAAS * This is a local service. Methods of this service will not have security checks based on the
* credentials because this service can only be accessed from within the same VM. * propagated JAAS credentials because this service can only be accessed from within the same VM.
* </p> * </p>
* *
* @author Matteo * @author Matteo
@ -44,91 +51,101 @@ import com.liferay.portal.service.ServiceContext;
*/ */
public class NotificationMailLocalServiceImpl extends NotificationMailLocalServiceBaseImpl { public class NotificationMailLocalServiceImpl extends NotificationMailLocalServiceBaseImpl {
@Override public NotificationMail addNotification(String nomePlugin, String nomeTemplate, ServiceContext serviceContext)
public NotificationMail addNotification(String nomePlugin, String nomeTemplate, ServiceContext serviceContext) throws PortalException, SystemException {
throws PortalException, SystemException {
User user = userPersistence.findByPrimaryKey(serviceContext.getUserId());
User user = userPersistence.findByPrimaryKey(serviceContext.getUserId());
Date now = new Date(); Date now = new Date();
validate(nomePlugin, nomeTemplate);
long notificationId = counterLocalService.increment(NotificationMail.class.getName()); validate(nomePlugin, nomeTemplate);
NotificationMail notification = notificationMailPersistence.create(notificationId);
notification.setUserId(user.getUserId()); long notificationId = counterLocalService.increment(NotificationMail.class.getName());
notification.setCompanyId(user.getCompanyId());
notification.setUserName(user.getFullName()); NotificationMail notification = notificationMailPersistence.create(notificationId);
notification.setCreateDate(serviceContext.getCreateDate(now));
notification.setModifiedDate(serviceContext.getModifiedDate(now)); notification.setUserId(user.getUserId());
notification.setExpandoBridgeAttributes(serviceContext); notification.setCompanyId(user.getCompanyId());
notification.setNomePlugin(nomePlugin); notification.setUserName(user.getFullName());
notification.setNomeTemplate(nomeTemplate); notification.setCreateDate(serviceContext.getCreateDate(now));
notificationMailPersistence.update(notification); notification.setModifiedDate(serviceContext.getModifiedDate(now));
return notification; notification.setExpandoBridgeAttributes(serviceContext);
} notification.setNomePlugin(nomePlugin);
notification.setNomeTemplate(nomeTemplate);
private void validate(String nomePlugin, String nomeTemplate) throws NotificationNomePluginException,
NotificationNomeTemplateException { notificationMailPersistence.update(notification);
if (Validator.isNull(nomePlugin)) { return notification;
throw new NotificationNomePluginException(); }
}
if (Validator.isNull(nomeTemplate)) { private void validate(String nomePlugin, String nomeTemplate) throws NotificationNomePluginException,
throw new NotificationNomeTemplateException(); NotificationNomeTemplateException {
}
} if (Validator.isNull(nomePlugin)) {
throw new NotificationNomePluginException();
@Override }
public NotificationMail updateNotification(String nomePlugin, String nomeTemplate, ServiceContext serviceContext, if (Validator.isNull(nomeTemplate)) {
long notificationId) throws SystemException, PortalException { throw new NotificationNomeTemplateException();
}
Date now = new Date(); }
NotificationMail notification = getNotificationMail(notificationId);
validate(nomePlugin, nomeTemplate); public NotificationMail updateNotification(String nomePlugin, String nomeTemplate, ServiceContext serviceContext,
notification.setModifiedDate(serviceContext.getModifiedDate(now)); long notificationId) throws SystemException, PortalException {
notification.setNomePlugin(nomePlugin);
notification.setNomeTemplate(nomeTemplate); Date now = new Date();
notification.setExpandoBridgeAttributes(serviceContext);
notificationMailPersistence.update(notification); NotificationMail notification = getNotificationMail(notificationId);
return notification;
} validate(nomePlugin, nomeTemplate);
@Override notification.setModifiedDate(serviceContext.getModifiedDate(now));
public List<NotificationMail> findNotifications(long companyId, int start, int end) throws SystemException { notification.setNomePlugin(nomePlugin);
notification.setNomeTemplate(nomeTemplate);
DynamicQuery query = dynamicQuery(); notification.setExpandoBridgeAttributes(serviceContext);
query.addOrder(OrderFactoryUtil.asc("nomePlugin"));
List<NotificationMail> notifications = null; notificationMailPersistence.update(notification);
try {
notifications = NotificationMailLocalServiceUtil.dynamicQuery(query); return notification;
} catch (SystemException e) { }
e.printStackTrace();
} public List<NotificationMail> findNotifications(long companyId, int start, int end) throws SystemException {
return notifications;
} // return notificationMailPersistence.findBycompanyId(companyId, start, end);
DynamicQuery query = notificationMailLocalService.dynamicQuery();
@Override query.addOrder(OrderFactoryUtil.asc("nomePlugin"));
public List<NotificationMail> findNotifications(long companyId) throws SystemException { List<NotificationMail> notifications = null;
try {
return notificationMailPersistence.findBycompanyId(companyId); notifications = NotificationMailLocalServiceUtil.dynamicQuery(query);
} } catch (SystemException e) {
e.printStackTrace();
@Override }
public int getNotificationCount(long companyId) throws SystemException { return notifications;
}
return notificationMailPersistence.countBycompanyId(companyId);
} public List<NotificationMail> findNotifications(long companyId) throws SystemException {
@Override return notificationMailPersistence.findBycompanyId(companyId);
public List<NotificationMail> findNotifications(long companyId, String servletContextName) throws SystemException { }
DynamicQuery dynamicQuery = dynamicQuery(); public int getNotificationCount(long companyId) throws SystemException {
if (Validator.isNull(servletContextName)) {
Disjunction or = RestrictionsFactoryUtil.disjunction(); return notificationMailPersistence.countBycompanyId(companyId);
or.add(RestrictionsFactoryUtil.isNull("nomePlugin")); }
or.add(RestrictionsFactoryUtil.eq("nomePlugin", StringPool.BLANK));
dynamicQuery.add(or); public List<NotificationMail> findNotifications(long companyId, String servletContextName) throws SystemException {
} else {
dynamicQuery.add(RestrictionsFactoryUtil.eq("nomePlugin", servletContextName)); DynamicQuery dynamicQuery = notificationMailLocalService.dynamicQuery();
}
return notificationMailPersistence.findWithDynamicQuery(dynamicQuery); if (Validator.isNull(servletContextName)) {
} Disjunction or = RestrictionsFactoryUtil.disjunction();
or.add(RestrictionsFactoryUtil.isNull("nomePlugin"));
or.add(RestrictionsFactoryUtil.eq("nomePlugin", StringPool.BLANK));
dynamicQuery.add(or);
} else {
dynamicQuery.add(RestrictionsFactoryUtil.eq("nomePlugin", servletContextName));
}
return notificationMailPersistence.findWithDynamicQuery(dynamicQuery);
}
} }

1
liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/service/persistence/NotificationLogPersistenceImpl.java

@ -45,7 +45,6 @@ import it.tref.liferay.portos.deployalert.NoSuchNotificationLogException;
import it.tref.liferay.portos.deployalert.model.NotificationLog; import it.tref.liferay.portos.deployalert.model.NotificationLog;
import it.tref.liferay.portos.deployalert.model.impl.NotificationLogImpl; import it.tref.liferay.portos.deployalert.model.impl.NotificationLogImpl;
import it.tref.liferay.portos.deployalert.model.impl.NotificationLogModelImpl; import it.tref.liferay.portos.deployalert.model.impl.NotificationLogModelImpl;
import it.tref.liferay.portos.deployalert.service.persistence.NotificationLogPersistence;
import java.io.Serializable; import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/service/persistence/NotificationMailPersistenceImpl.java

@ -45,7 +45,6 @@ import it.tref.liferay.portos.deployalert.NoSuchNotificationMailException;
import it.tref.liferay.portos.deployalert.model.NotificationMail; import it.tref.liferay.portos.deployalert.model.NotificationMail;
import it.tref.liferay.portos.deployalert.model.impl.NotificationMailImpl; import it.tref.liferay.portos.deployalert.model.impl.NotificationMailImpl;
import it.tref.liferay.portos.deployalert.model.impl.NotificationMailModelImpl; import it.tref.liferay.portos.deployalert.model.impl.NotificationMailModelImpl;
import it.tref.liferay.portos.deployalert.service.persistence.NotificationMailPersistence;
import java.io.Serializable; import java.io.Serializable;

157
liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/util/DeployAlertUtil.java

@ -1,11 +1,5 @@
package it.tref.liferay.portos.deployalert.util; package it.tref.liferay.portos.deployalert.util;
import it.tref.liferay.portos.deployalert.constants.MailConstants;
import it.tref.liferay.portos.mailmanager.shared.messaging.util.MailManagerUtil;
import java.text.SimpleDateFormat;
import java.util.Date;
import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.json.JSONFactoryUtil; import com.liferay.portal.kernel.json.JSONFactoryUtil;
import com.liferay.portal.kernel.json.JSONObject; import com.liferay.portal.kernel.json.JSONObject;
@ -22,76 +16,89 @@ import com.liferay.portal.service.ServiceContext;
import com.liferay.portal.service.UserLocalServiceUtil; import com.liferay.portal.service.UserLocalServiceUtil;
import com.liferay.portal.util.PortalUtil; import com.liferay.portal.util.PortalUtil;
import it.tref.liferay.portos.deployalert.constants.MailConstants;
import it.tref.liferay.portos.mailmanager.shared.messaging.util.MailManagerUtil;
import java.text.SimpleDateFormat;
import java.util.Date;
public class DeployAlertUtil { public class DeployAlertUtil {
private static final Log _log = LogFactoryUtil.getLog(DeployAlertUtil.class); private final static Log _log = LogFactoryUtil.getLog(DeployAlertUtil.class);
public static final ServiceContext getServiceContext() { public static final ServiceContext getServiceContext() {
long companyId = PortalUtil.getDefaultCompanyId(); long companyId = PortalUtil.getDefaultCompanyId();
ServiceContext serviceContext = new ServiceContext();
Company company; ServiceContext serviceContext = new ServiceContext();
serviceContext.setCompanyId(companyId); Company company;
try { serviceContext.setCompanyId(companyId);
company = CompanyLocalServiceUtil.getCompany(companyId);
Role role = RoleLocalServiceUtil.getRole(company.getCompanyId(), RoleConstants.ADMINISTRATOR); try {
long userAdminId = UserLocalServiceUtil.getRoleUserIds(role.getRoleId())[0]; company = CompanyLocalServiceUtil.getCompany(companyId);
serviceContext.setUserId(userAdminId); Role role = RoleLocalServiceUtil.getRole(company.getCompanyId(), RoleConstants.ADMINISTRATOR);
serviceContext.setScopeGroupId(company.getGroupId()); long userAdminId = UserLocalServiceUtil.getRoleUserIds(role.getRoleId())[0];
PermissionThreadLocal.setPermissionChecker(PermissionCheckerFactoryUtil.create(UserLocalServiceUtil
.getUser(userAdminId))); serviceContext.setUserId(userAdminId);
} catch (Exception e) { serviceContext.setScopeGroupId(company.getGroupId());
_log.error(e, e);
} PermissionThreadLocal.setPermissionChecker(PermissionCheckerFactoryUtil.create(UserLocalServiceUtil.getUser(userAdminId)));
return serviceContext; } catch (Exception e) {
} _log.error(e, e);
}
public static final boolean addDefaultDeployMailTemplate(ServiceContext serviceContext) {
return serviceContext;
boolean add = false; }
String subject = "Deploy Plugin";
String body = "E' stato effettuato il $evento del plugin $nomePlugin in data $data."; public static final boolean addDefaultDeployMailTemplate(ServiceContext serviceContext) {
String[] to = { "matteoguggia97@gmail.com" };
try { boolean add = false;
add = MailManagerUtil.addMailTemplate(MailConstants.DEFAULT_DEPLOY_TEMPLATE, "test@3fconsulting.it", to, String subject = "Deploy Plugin";
null, null, subject, body, false, serviceContext); String body = "E' stato effettuato il $evento del plugin $nomePlugin in data $data.";
} catch (SystemException e) { String[] to = {"matteoguggia97@gmail.com"};
_log.error(e, e);
} try {
PermissionThreadLocal.setPermissionChecker(null); add =
MailManagerUtil.addMailTemplate(MailConstants.DEFAULT_DEPLOY_TEMPLATE, "test@3fconsulting.it", to, null,
return add; null, subject, body, false, serviceContext);
} } catch (SystemException e) {
_log.error(e, e);
public static final boolean addDefaultUndeployMailTemplate(ServiceContext serviceContext) { }
PermissionThreadLocal.setPermissionChecker(null);
boolean add = false;
String subject = "Undeploy Plugin"; return add;
String body = "E' stato effettuato l'$evento del plugin $nomePlugin in data $data."; }
String[] to = { "matteoguggia97@gmail.com" };
public static final boolean addDefaultUndeployMailTemplate(ServiceContext serviceContext) {
try {
add = MailManagerUtil.addMailTemplate(MailConstants.DEFAULT_UNDEPLOY_TEMPLATE, "test@3fconsulting.it", to, boolean add = false;
null, null, subject, body, false, serviceContext); String subject = "Undeploy Plugin";
} catch (SystemException e) { String body = "E' stato effettuato l'$evento del plugin $nomePlugin in data $data.";
_log.error(e, e); String[] to = {"matteoguggia97@gmail.com"};
}
PermissionThreadLocal.setPermissionChecker(null); try {
add =
return add; MailManagerUtil.addMailTemplate(MailConstants.DEFAULT_UNDEPLOY_TEMPLATE, "test@3fconsulting.it", to, null,
} null, subject, body, false, serviceContext);
} catch (SystemException e) {
public static final JSONObject getParametri(String nomePlugin, String evento) { _log.error(e, e);
}
JSONObject parametri = JSONFactoryUtil.createJSONObject(); PermissionThreadLocal.setPermissionChecker(null);
String data = new SimpleDateFormat("dd/MM/yyyy HH:mm").format(new Date()); return add;
}
parametri.put("data", data);
parametri.put("evento", evento); public static final JSONObject getParametri(String nomePlugin, String evento) {
parametri.put("nomePlugin", nomePlugin);
JSONObject parametri = JSONFactoryUtil.createJSONObject();
return parametri;
} String data = new SimpleDateFormat("dd/MM/yyyy HH:mm").format(new Date());
parametri.put("data", data);
parametri.put("evento", evento);
parametri.put("nomePlugin", nomePlugin);
return parametri;
}
} }

1
liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/html/init.jsp

@ -1,4 +1,3 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

1
liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/html/notificator/edit_notification.jsp

@ -1,4 +1,3 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.liferay.portal.kernel.util.Validator"%> <%@page import="com.liferay.portal.kernel.util.Validator"%>
<%@page import="com.liferay.portal.kernel.util.StringUtil"%> <%@page import="com.liferay.portal.kernel.util.StringUtil"%>
<%@ include file="/html/notificator/init.jsp"%> <%@ include file="/html/notificator/init.jsp"%>

1
liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/html/notificator/init.jsp

@ -1,4 +1,3 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/html/init.jsp"%> <%@ include file="/html/init.jsp"%>
<%@ page <%@ page
import="it.tref.liferay.portos.deployalert.service.NotificationMailLocalServiceUtil"%> import="it.tref.liferay.portos.deployalert.service.NotificationMailLocalServiceUtil"%>

1
liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/html/notificator/view.jsp

@ -1,4 +1,3 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/html/notificator/init.jsp"%> <%@ include file="/html/notificator/init.jsp"%>
<aui:button-row> <aui:button-row>

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

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0"?>
<!DOCTYPE hook PUBLIC "-//Liferay//DTD Hook 6.2.0//EN" "http://www.liferay.com/dtd/liferay-hook_6_2_0.dtd"> <!DOCTYPE hook PUBLIC "-//Liferay//DTD Hook 6.2.0//EN" "http://www.liferay.com/dtd/liferay-hook_6_2_0.dtd">
<hook> <hook>

10
liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/liferay-portlet.xml

@ -2,10 +2,18 @@
<!DOCTYPE liferay-portlet-app PUBLIC "-//Liferay//DTD Portlet Application 6.2.0//EN" "http://www.liferay.com/dtd/liferay-portlet-app_6_2_0.dtd"> <!DOCTYPE liferay-portlet-app PUBLIC "-//Liferay//DTD Portlet Application 6.2.0//EN" "http://www.liferay.com/dtd/liferay-portlet-app_6_2_0.dtd">
<liferay-portlet-app> <liferay-portlet-app>
<portlet> <portlet>
<portlet-name>1</portlet-name> <portlet-name>1</portlet-name>
<icon></icon> <icon></icon>
<scheduler-entry>
<scheduler-event-listener-class>it.tref.liferay.portos.kaleo.controller.scheduler.SchedulerKaleoController</scheduler-event-listener-class>
<trigger>
<simple>
<simple-trigger-value>240</simple-trigger-value>
<time-unit>second</time-unit>
</simple>
</trigger>
</scheduler-entry>
<header-portlet-css></header-portlet-css> <header-portlet-css></header-portlet-css>
<footer-portlet-javascript></footer-portlet-javascript> <footer-portlet-javascript></footer-portlet-javascript>
<css-class-wrapper></css-class-wrapper> <css-class-wrapper></css-class-wrapper>

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

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

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

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

42
liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/controller/model/impl/KaleoTaskAssignmentInstanceImpl.java

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

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

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

39
liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/controller/model/impl/KaleoTaskInstanceTokenImpl.java

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

3
liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/controller/service/persistence/KaleoInstancePersistenceImpl.java

@ -42,6 +42,7 @@ import it.tref.liferay.portos.kaleo.controller.NoSuchKaleoInstanceException;
import it.tref.liferay.portos.kaleo.controller.model.KaleoInstance; import it.tref.liferay.portos.kaleo.controller.model.KaleoInstance;
import it.tref.liferay.portos.kaleo.controller.model.impl.KaleoInstanceImpl; import it.tref.liferay.portos.kaleo.controller.model.impl.KaleoInstanceImpl;
import it.tref.liferay.portos.kaleo.controller.model.impl.KaleoInstanceModelImpl; import it.tref.liferay.portos.kaleo.controller.model.impl.KaleoInstanceModelImpl;
import it.tref.liferay.portos.kaleo.controller.service.persistence.KaleoInstancePersistence;
import java.io.Serializable; import java.io.Serializable;
@ -56,7 +57,7 @@ import java.util.List;
* Caching information and settings can be found in <code>portal.properties</code> * Caching information and settings can be found in <code>portal.properties</code>
* </p> * </p>
* *
* @author 3FC + Manifattura Web Group s.r.l. * @author 3FC
* @see KaleoInstancePersistence * @see KaleoInstancePersistence
* @see KaleoInstanceUtil * @see KaleoInstanceUtil
* @generated * @generated

3
liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/controller/service/persistence/KaleoInstanceTokenPersistenceImpl.java

@ -42,6 +42,7 @@ import it.tref.liferay.portos.kaleo.controller.NoSuchKaleoInstanceTokenException
import it.tref.liferay.portos.kaleo.controller.model.KaleoInstanceToken; import it.tref.liferay.portos.kaleo.controller.model.KaleoInstanceToken;
import it.tref.liferay.portos.kaleo.controller.model.impl.KaleoInstanceTokenImpl; import it.tref.liferay.portos.kaleo.controller.model.impl.KaleoInstanceTokenImpl;
import it.tref.liferay.portos.kaleo.controller.model.impl.KaleoInstanceTokenModelImpl; import it.tref.liferay.portos.kaleo.controller.model.impl.KaleoInstanceTokenModelImpl;
import it.tref.liferay.portos.kaleo.controller.service.persistence.KaleoInstanceTokenPersistence;
import java.io.Serializable; import java.io.Serializable;
@ -56,7 +57,7 @@ import java.util.List;
* Caching information and settings can be found in <code>portal.properties</code> * Caching information and settings can be found in <code>portal.properties</code>
* </p> * </p>
* *
* @author 3FC + Manifattura Web Group s.r.l. * @author 3FC
* @see KaleoInstanceTokenPersistence * @see KaleoInstanceTokenPersistence
* @see KaleoInstanceTokenUtil * @see KaleoInstanceTokenUtil
* @generated * @generated

3
liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/controller/service/persistence/KaleoLogPersistenceImpl.java

@ -43,6 +43,7 @@ import it.tref.liferay.portos.kaleo.controller.NoSuchKaleoLogException;
import it.tref.liferay.portos.kaleo.controller.model.KaleoLog; import it.tref.liferay.portos.kaleo.controller.model.KaleoLog;
import it.tref.liferay.portos.kaleo.controller.model.impl.KaleoLogImpl; import it.tref.liferay.portos.kaleo.controller.model.impl.KaleoLogImpl;
import it.tref.liferay.portos.kaleo.controller.model.impl.KaleoLogModelImpl; import it.tref.liferay.portos.kaleo.controller.model.impl.KaleoLogModelImpl;
import it.tref.liferay.portos.kaleo.controller.service.persistence.KaleoLogPersistence;
import java.io.Serializable; import java.io.Serializable;
@ -58,7 +59,7 @@ import java.util.Set;
* Caching information and settings can be found in <code>portal.properties</code> * Caching information and settings can be found in <code>portal.properties</code>
* </p> * </p>
* *
* @author 3FC + Manifattura Web Group s.r.l. * @author 3FC
* @see KaleoLogPersistence * @see KaleoLogPersistence
* @see KaleoLogUtil * @see KaleoLogUtil
* @generated * @generated

3
liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/controller/service/persistence/KaleoNodePersistenceImpl.java

@ -41,6 +41,7 @@ import it.tref.liferay.portos.kaleo.controller.NoSuchKaleoNodeException;
import it.tref.liferay.portos.kaleo.controller.model.KaleoNode; import it.tref.liferay.portos.kaleo.controller.model.KaleoNode;
import it.tref.liferay.portos.kaleo.controller.model.impl.KaleoNodeImpl; import it.tref.liferay.portos.kaleo.controller.model.impl.KaleoNodeImpl;
import it.tref.liferay.portos.kaleo.controller.model.impl.KaleoNodeModelImpl; import it.tref.liferay.portos.kaleo.controller.model.impl.KaleoNodeModelImpl;
import it.tref.liferay.portos.kaleo.controller.service.persistence.KaleoNodePersistence;
import java.io.Serializable; import java.io.Serializable;
@ -56,7 +57,7 @@ import java.util.Set;
* Caching information and settings can be found in <code>portal.properties</code> * Caching information and settings can be found in <code>portal.properties</code>
* </p> * </p>
* *
* @author 3FC + Manifattura Web Group s.r.l. * @author 3FC
* @see KaleoNodePersistence * @see KaleoNodePersistence
* @see KaleoNodeUtil * @see KaleoNodeUtil
* @generated * @generated

3
liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/controller/service/persistence/KaleoTaskAssignmentInstancePersistenceImpl.java

@ -42,6 +42,7 @@ import it.tref.liferay.portos.kaleo.controller.NoSuchKaleoTaskAssignmentInstance
import it.tref.liferay.portos.kaleo.controller.model.KaleoTaskAssignmentInstance; import it.tref.liferay.portos.kaleo.controller.model.KaleoTaskAssignmentInstance;
import it.tref.liferay.portos.kaleo.controller.model.impl.KaleoTaskAssignmentInstanceImpl; import it.tref.liferay.portos.kaleo.controller.model.impl.KaleoTaskAssignmentInstanceImpl;
import it.tref.liferay.portos.kaleo.controller.model.impl.KaleoTaskAssignmentInstanceModelImpl; import it.tref.liferay.portos.kaleo.controller.model.impl.KaleoTaskAssignmentInstanceModelImpl;
import it.tref.liferay.portos.kaleo.controller.service.persistence.KaleoTaskAssignmentInstancePersistence;
import java.io.Serializable; import java.io.Serializable;
@ -56,7 +57,7 @@ import java.util.List;
* Caching information and settings can be found in <code>portal.properties</code> * Caching information and settings can be found in <code>portal.properties</code>
* </p> * </p>
* *
* @author 3FC + Manifattura Web Group s.r.l. * @author 3FC
* @see KaleoTaskAssignmentInstancePersistence * @see KaleoTaskAssignmentInstancePersistence
* @see KaleoTaskAssignmentInstanceUtil * @see KaleoTaskAssignmentInstanceUtil
* @generated * @generated

3
liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/controller/service/persistence/KaleoTaskInstanceTokenPersistenceImpl.java

@ -42,6 +42,7 @@ import it.tref.liferay.portos.kaleo.controller.NoSuchKaleoTaskInstanceTokenExcep
import it.tref.liferay.portos.kaleo.controller.model.KaleoTaskInstanceToken; import it.tref.liferay.portos.kaleo.controller.model.KaleoTaskInstanceToken;
import it.tref.liferay.portos.kaleo.controller.model.impl.KaleoTaskInstanceTokenImpl; import it.tref.liferay.portos.kaleo.controller.model.impl.KaleoTaskInstanceTokenImpl;
import it.tref.liferay.portos.kaleo.controller.model.impl.KaleoTaskInstanceTokenModelImpl; import it.tref.liferay.portos.kaleo.controller.model.impl.KaleoTaskInstanceTokenModelImpl;
import it.tref.liferay.portos.kaleo.controller.service.persistence.KaleoTaskInstanceTokenPersistence;
import java.io.Serializable; import java.io.Serializable;
@ -56,7 +57,7 @@ import java.util.List;
* Caching information and settings can be found in <code>portal.properties</code> * Caching information and settings can be found in <code>portal.properties</code>
* </p> * </p>
* *
* @author 3FC + Manifattura Web Group s.r.l. * @author 3FC
* @see KaleoTaskInstanceTokenPersistence * @see KaleoTaskInstanceTokenPersistence
* @see KaleoTaskInstanceTokenUtil * @see KaleoTaskInstanceTokenUtil
* @generated * @generated

3
liferay-plugins-sdk-6.2/portlets/portos-kaleo-controller-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/controller/service/persistence/KaleoTaskPersistenceImpl.java

@ -40,6 +40,7 @@ import it.tref.liferay.portos.kaleo.controller.NoSuchKaleoTaskException;
import it.tref.liferay.portos.kaleo.controller.model.KaleoTask; import it.tref.liferay.portos.kaleo.controller.model.KaleoTask;
import it.tref.liferay.portos.kaleo.controller.model.impl.KaleoTaskImpl; import it.tref.liferay.portos.kaleo.controller.model.impl.KaleoTaskImpl;
import it.tref.liferay.portos.kaleo.controller.model.impl.KaleoTaskModelImpl; import it.tref.liferay.portos.kaleo.controller.model.impl.KaleoTaskModelImpl;
import it.tref.liferay.portos.kaleo.controller.service.persistence.KaleoTaskPersistence;
import java.io.Serializable; import java.io.Serializable;
@ -54,7 +55,7 @@ import java.util.List;
* Caching information and settings can be found in <code>portal.properties</code> * Caching information and settings can be found in <code>portal.properties</code>
* </p> * </p>
* *
* @author 3FC + Manifattura Web Group s.r.l. * @author 3FC
* @see KaleoTaskPersistence * @see KaleoTaskPersistence
* @see KaleoTaskUtil * @see KaleoTaskUtil
* @generated * @generated

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

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0"?>
<!DOCTYPE hook PUBLIC "-//Liferay//DTD Hook 6.2.0//EN" "http://www.liferay.com/dtd/liferay-hook_6_2_0.dtd"> <!DOCTYPE hook PUBLIC "-//Liferay//DTD Hook 6.2.0//EN" "http://www.liferay.com/dtd/liferay-hook_6_2_0.dtd">
<hook> <hook>

Some files were not shown because too many files have changed in this diff Show More

Caricamento…
Annulla
Salva