Sfoglia il codice sorgente

Assegnazione a istruttori di unità operativa zero

master
Salvatore La Manna 3 anni fa
parent
commit
a92a993e55
  1. 2
      liferay-plugins-sdk-6.2/build.ture.properties
  2. BIN
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/portos-kaleo-portlet-service.jar
  3. 3
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/mwg/sismica/bo/util/MappeUtil.java
  4. 12
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/AsseverazioniUtil.java
  5. 20
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/AvvisoUtil.java
  6. 30
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/DelegheUtil.java
  7. 4
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/WorkflowUtil.java
  8. 5
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SismicaUtil.java
  9. 8
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/PaesaggisticaAdministrationPortlet.java
  10. 28
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ControlloPraticaLocalServiceImpl.java
  11. 4
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties
  12. 19
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/actions/action_cambio_istruttore.jsp
  13. 79
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestionefirme/avvisi_da_firmare.jsp
  14. 2
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestionefirme/init.jsp
  15. 181
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/homebo/view.jsp
  16. 141
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/pagamenti/view.jsp
  17. 90
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/DisponibilitaLocalServiceImpl.java
  18. 13
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/PrenotazioneLocalServiceImpl.java
  19. 2
      liferay-plugins-sdk-6.2/portlets/portos-cookies-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/cookies/action/StartUpAction.java
  20. 40
      liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/deployalert/NoSuchNotificationLogException.java
  21. 40
      liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/deployalert/NoSuchNotificationMailException.java
  22. 43
      liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/action/DeployAction.java
  23. 3
      liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/constants/MailConstants.java
  24. 5
      liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/control/DeployAlertControl.java
  25. 33
      liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/model/impl/NotificationLogImpl.java
  26. 37
      liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/model/impl/NotificationMailImpl.java
  27. 26
      liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/portlet/NotificatorPortlet.java
  28. 45
      liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/service/impl/NotificationLogLocalServiceImpl.java
  29. 30
      liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/service/impl/NotificationLogServiceImpl.java
  30. 86
      liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/service/impl/NotificationMailLocalServiceImpl.java
  31. 37
      liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/service/impl/NotificationMailServiceImpl.java
  32. 32
      liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/util/DeployAlertUtil.java
  33. 4
      liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/service.properties
  34. 2
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/portlet/RicercaPratichePortlet.java
  35. 2
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/util/ReportFascicoloUtil.java
  36. 9
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/view_fascicolo_dettagli.jsp
  37. 288
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/view_fascicolo_riepilogo.jsp
  38. 1
      liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/.classpath
  39. 1
      liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/.project
  40. 3
      liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/build.xml
  41. BIN
      liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/WEB-INF/lib/portos-kaleo-portlet-service.jar
  42. BIN
      liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/WEB-INF/lib/util-java.jar
  43. 40
      liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/kaleo/NoSuchFormDefinitionLinkException.java
  44. 40
      liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/kaleo/NoSuchFormLogException.java
  45. 40
      liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/kaleo/NoSuchFormTemplateLinkException.java
  46. 2
      liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/portlet/WorkflowFormAdminPortlet.java
  47. 4
      liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/WEB-INF/src/service.properties
  48. 12
      liferay-plugins-sdk-6.2/portlets/portos-log-portlet/docroot/WEB-INF/src/it/tref/portos/liferay/log/constants/LogConstants.java
  49. 9
      liferay-plugins-sdk-6.2/portlets/portos-log-portlet/docroot/WEB-INF/src/it/tref/portos/liferay/log/constants/LogDestinationNames.java
  50. 47
      liferay-plugins-sdk-6.2/portlets/portos-log-portlet/docroot/WEB-INF/src/it/tref/portos/liferay/log/constants/LogFormat.java
  51. 1
      liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/.classpath
  52. 1
      liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/.settings/org.eclipse.wst.common.component
  53. 3
      liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/mailmanager/model/EmailConstants.java
  54. 24
      liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/hook/events/StartupAction.java
  55. 67
      liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/service/impl/EmailAttachmentLocalServiceImpl.java
  56. 284
      liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/service/impl/EmailLocalServiceImpl.java
  57. 121
      liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/service/impl/EmailTemplateLocalServiceImpl.java
  58. 40
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/maintenance/NoSuchMaintenanceScheduleException.java
  59. 63
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/portlet/AdminMaintenancePortlet.java
  60. 4
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/service.properties
  61. 2
      liferay-plugins-sdk-6.2/portlets/portos-notification-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/notification/action/StartUpAction.java
  62. 31
      liferay-plugins-sdk-6.2/portlets/portos-report-engine-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/service/persistence/KaleoTaskAssignmentInstanceFinderImpl.java
  63. 35
      liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/messaging/ProtocolloMessageListener.java
  64. 3
      liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/messaging/ReportMessageListener.java
  65. 2
      liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/portlet/TestPdf.java
  66. 9
      liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/service/impl/ReportTaskLocalServiceImpl.java
  67. 2
      liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/service/impl/ReportTaskManagerServiceImpl.java
  68. 4
      liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/service.properties
  69. 2
      liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/modellistener/shared/core/ModelListenerInvocationHandler.java
  70. 23
      liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/modellistener/shared/core/ModelListenerPool.java
  71. 2
      liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/modellistener/shared/core/ModelListenerUtil.java
  72. 22
      liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/PagamentoConstants.java
  73. 10
      liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/PortletKeys.java
  74. 10
      liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/SezioniUtil.java
  75. 28
      liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/StatoPraticaConstants.java
  76. 2
      liferay-plugins-sdk-6.2/shared/portos-kaleo-shared/src/it/tref/liferay/portos/kaleo/shared/util/PortletKeys.java
  77. 2
      liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/messaging/util/MailManagerUtil.java
  78. 32
      liferay-plugins-sdk-6.2/shared/portos-report-shared/src/it/tref/liferay/portos/report/shared/constants/ReportConstants.java
  79. 6
      liferay-plugins-sdk-6.2/shared/portos-report-shared/src/it/tref/liferay/portos/report/shared/constants/ReportDestinationNames.java
  80. 27
      liferay-plugins-sdk-6.2/shared/portos-report-shared/src/it/tref/liferay/portos/report/shared/util/PdfUtil.java
  81. 8
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/.classpath
  82. 4
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/.settings/org.eclipse.wst.common.component
  83. BIN
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/lib/portos-kaleo-portlet-service.jar
  84. 5
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/liferay-plugin-package.properties
  85. 14
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/WorkflowTaskManagerImpl.java
  86. 229
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/DefaultTaskManagerImpl.java
  87. 91
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/ConditionNodeExecutor.java
  88. 88
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/ForkNodeExecutor.java
  89. 91
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/JoinNodeExecutor.java
  90. 115
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/JoinXorNodeExecutor.java
  91. 43
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/NodeExecutor.java
  92. 27
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/NodeExecutorFactory.java
  93. 65
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/StateNodeExecutor.java
  94. 240
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/TaskNodeExecutor.java
  95. 33
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/hook/struts/EditWorkflowTaskAction.java
  96. 4
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/hook/struts/RenderFormTaskPortletAction.java
  97. 17
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/util/WorkflowUtil.java
  98. 4
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/service.properties

2
liferay-plugins-sdk-6.2/build.ture.properties

@ -1,5 +1,3 @@
# Managed by Liferay IDE (remove this comment to prevent future updates)
app.server.tomcat.lib.global.dir = /home/ture/liferay/portali/paesaggistica/tomcat-7.0.62/lib/ext app.server.tomcat.lib.global.dir = /home/ture/liferay/portali/paesaggistica/tomcat-7.0.62/lib/ext
app.server.tomcat.deploy.dir = /home/ture/liferay/portali/paesaggistica/tomcat-7.0.62/webapps app.server.tomcat.deploy.dir = /home/ture/liferay/portali/paesaggistica/tomcat-7.0.62/webapps
app.server.parent.dir = /home/ture/liferay/portali/paesaggistica app.server.parent.dir = /home/ture/liferay/portali/paesaggistica

BIN
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/portos-kaleo-portlet-service.jar

File binario non mostrato.

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

@ -30,7 +30,8 @@ import com.liferay.portal.kernel.util.WebKeys;
import com.liferay.portal.theme.ThemeDisplay; import com.liferay.portal.theme.ThemeDisplay;
public class MappeUtil { public class MappeUtil {
private final static Log _log = LogFactoryUtil.getLog(MappeUtil.class);
private static final Log _log = LogFactoryUtil.getLog(MappeUtil.class);
public static String getUrlFe(HttpServletRequest request, DettPratica dettPratica, Comune comune, boolean readOnly) public static String getUrlFe(HttpServletRequest request, DettPratica dettPratica, Comune comune, boolean readOnly)
throws UnsupportedEncodingException, PortalException, SystemException { throws UnsupportedEncodingException, PortalException, SystemException {

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

@ -38,13 +38,13 @@ import com.liferay.portal.service.UserLocalServiceUtil;
public class AsseverazioniUtil { public class AsseverazioniUtil {
public final static String STATO_ASSEGNATA = "AS"; public static final String STATO_ASSEGNATA = "AS";
public final static String STATO_ESEGUITA = "ES"; public static final String STATO_ESEGUITA = "ES";
public final static String STATO_ANNULLATA = "AN"; public static final String STATO_ANNULLATA = "AN";
public final static String STATO_EXPIRED = "EX"; public static final String STATO_EXPIRED = "EX";
public final static String ASSEVERAZIONE_DA_APPLICATIVO = "AP"; public static final String ASSEVERAZIONE_DA_APPLICATIVO = "AP";
public final static String ASSEVERAZIONE_DA_ALLEGATO = "AL"; public static final String ASSEVERAZIONE_DA_ALLEGATO = "AL";
public static boolean hasAsseverazioniAttive(long dettPraticaId) throws SystemException { public static boolean hasAsseverazioniAttive(long dettPraticaId) throws SystemException {

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

@ -23,17 +23,17 @@ public class AvvisoUtil {
private static Log _log = LogFactoryUtil.getLog(AvvisoUtil.class); private static Log _log = LogFactoryUtil.getLog(AvvisoUtil.class);
// Ogni volta che leggo queste due righe mi sale la cattiveria // Ogni volta che leggo queste due righe mi sale la cattiveria
public final static String DOCUMENTO_INVIATO = "S"; public static final String DOCUMENTO_INVIATO = "S";
public final static String DOCUMENTO_NON_INVIATO = "N"; public static final String DOCUMENTO_NON_INVIATO = "N";
public final static String TIPO_AVVISO_DIRETTO = "D"; public static final String TIPO_AVVISO_DIRETTO = "D";
public final static String TIPO_AVVISO_FIRMA = "S"; public static final String TIPO_AVVISO_FIRMA = "S";
public final static String TIPO_REPORT_CONTROLLO_OBBLIGATORIO = "CO"; public static final String TIPO_REPORT_CONTROLLO_OBBLIGATORIO = "CO";
public final static String TIPO_REPORT_AUTORIZZAZIONE = "AU"; public static final String TIPO_REPORT_AUTORIZZAZIONE = "AU";
@SuppressWarnings("serial") @SuppressWarnings("serial")
private final static Map<String, String> allTipoAvviso = new LinkedHashMap<String, String>() { private static final Map<String, String> allTipoAvviso = new LinkedHashMap<String, String>() {
{ {
put(TIPO_AVVISO_DIRETTO, "label.admingeniocivile.avviso.tipoAvviso.diretto"); put(TIPO_AVVISO_DIRETTO, "label.admingeniocivile.avviso.tipoAvviso.diretto");
put(TIPO_AVVISO_FIRMA, "label.admingeniocivile.avviso.tipoAvviso.firma"); put(TIPO_AVVISO_FIRMA, "label.admingeniocivile.avviso.tipoAvviso.firma");
@ -41,7 +41,7 @@ public class AvvisoUtil {
}; };
@SuppressWarnings("serial") @SuppressWarnings("serial")
private final static Map<String, String> ALL_TIPO_DOCUMENTO = new LinkedHashMap<String, String>() { private static final Map<String, String> ALL_TIPO_DOCUMENTO = new LinkedHashMap<String, String>() {
{ {
put(StatoPraticaConstants.CONFORME, "label.admingeniocivile.avviso.tipoDocumento.conforme"); put(StatoPraticaConstants.CONFORME, "label.admingeniocivile.avviso.tipoDocumento.conforme");
put(StatoPraticaConstants.NON_CONFORME, "label.admingeniocivile.avviso.tipoDocumento.nonconforme"); put(StatoPraticaConstants.NON_CONFORME, "label.admingeniocivile.avviso.tipoDocumento.nonconforme");
@ -68,7 +68,7 @@ public class AvvisoUtil {
}; };
@SuppressWarnings("serial") @SuppressWarnings("serial")
private final static Map<String, String> allTipoDocumentoFolderTemplateProps = new LinkedHashMap<String, String>() { private static final Map<String, String> allTipoDocumentoFolderTemplateProps = new LinkedHashMap<String, String>() {
{ {
put(StatoPraticaConstants.VIDIMATA, "conf.geniocivile.avviso.folder.id.vidimata"); put(StatoPraticaConstants.VIDIMATA, "conf.geniocivile.avviso.folder.id.vidimata");
put(StatoPraticaConstants.CONFORME, "conf.geniocivile.avviso.folder.id.conforme"); put(StatoPraticaConstants.CONFORME, "conf.geniocivile.avviso.folder.id.conforme");
@ -94,7 +94,7 @@ public class AvvisoUtil {
}; };
@SuppressWarnings("serial") @SuppressWarnings("serial")
private final static Map<String, String> allTipoDocumentoFileTemplateProps = new LinkedHashMap<String, String>() { private static final Map<String, String> allTipoDocumentoFileTemplateProps = new LinkedHashMap<String, String>() {
{ {
put(StatoPraticaConstants.VARIAZIONE_SOGGETTI, "conf.geniocivile.avviso.template.id.variazionesoggetti"); put(StatoPraticaConstants.VARIAZIONE_SOGGETTI, "conf.geniocivile.avviso.template.id.variazionesoggetti");
put(StatoPraticaConstants.FINE_LAVORI, "conf.geniocivile.avviso.template.id.vidimata.finelavori"); put(StatoPraticaConstants.FINE_LAVORI, "conf.geniocivile.avviso.template.id.vidimata.finelavori");

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

@ -31,21 +31,21 @@ import com.liferay.portal.service.UserLocalServiceUtil;
public class DelegheUtil { public class DelegheUtil {
public final static String STATO_ASSEGNATA = "AS"; public static final String STATO_ASSEGNATA = "AS";
public final static String STATO_ESEGUITA = "ES"; public static final String STATO_ESEGUITA = "ES";
public final static String STATO_ANNULLATA = "AN"; public static final String STATO_ANNULLATA = "AN";
public final static String STATO_RIFIUTATA = "RI"; public static final String STATO_RIFIUTATA = "RI";
public final static String TIPO_TOTALE = "TT"; public static final String TIPO_TOTALE = "TT";
public final static String TIPO_COMPILAZIONE = "CO"; public static final String TIPO_COMPILAZIONE = "CO";
public final static String TIPO_GEOLOGO = "GE"; public static final String TIPO_GEOLOGO = "GE";
public final static String TIPO_FIRMA_INSERIMENTO_ALLEGATI = "FI"; public static final String TIPO_FIRMA_INSERIMENTO_ALLEGATI = "FI";
public final static String TIPO_PAGAMENTO = "PG"; public static final String TIPO_PAGAMENTO = "PG";
public final static String TIPO_VISUALIZZAZIONE = "VI"; public static final String TIPO_VISUALIZZAZIONE = "VI";
public final static String TIPO_FINE_LAVORI = "FL"; public static final String TIPO_FINE_LAVORI = "FL";
public final static String TIPO_COLLAUDO = "CL"; public static final String TIPO_COLLAUDO = "CL";
private final static Log _log = LogFactoryUtil.getLog(DelegheUtil.class); private static final Log _log = LogFactoryUtil.getLog(DelegheUtil.class);
public static boolean hasDelegaFirma(long userId, long docPraticaId, boolean sezioneGeologica) public static boolean hasDelegaFirma(long userId, long docPraticaId, boolean sezioneGeologica)
throws PortalException, SystemException { throws PortalException, SystemException {

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

@ -225,7 +225,7 @@ public class WorkflowUtil {
// Verificare corretta corrispondenza con AvvisoUtil.getAllTipoDocumento() // Verificare corretta corrispondenza con AvvisoUtil.getAllTipoDocumento()
@SuppressWarnings("serial") @SuppressWarnings("serial")
private final static Map<String, String> tipoDocumentoToSignal = new HashMap<String, String>() { private static final Map<String, String> TIPO_DOCUMENTO_TO_SIGNAL = new HashMap<String, String>() {
{ {
put(StatoPraticaConstants.SOTTOPOSTA_A_PARERE, WorkflowConstants.WORKFLOW_SIGNAL_ASSEGNAZIONE); put(StatoPraticaConstants.SOTTOPOSTA_A_PARERE, WorkflowConstants.WORKFLOW_SIGNAL_ASSEGNAZIONE);
put(StatoPraticaConstants.CONFORME, WorkflowConstants.WORKFLOW_SIGNAL_INVIO); put(StatoPraticaConstants.CONFORME, WorkflowConstants.WORKFLOW_SIGNAL_INVIO);
@ -240,7 +240,7 @@ public class WorkflowUtil {
}; };
public static String getSignalByTipoDocumento(String tipoDocumento) { public static String getSignalByTipoDocumento(String tipoDocumento) {
return tipoDocumentoToSignal.get(tipoDocumento); return TIPO_DOCUMENTO_TO_SIGNAL.get(tipoDocumento);
} }
public static void assegnaUltimoTask(long companyId, long groupId, long istruttoreId, long assegnatoreUserId, public static void assegnaUltimoTask(long companyId, long groupId, long istruttoreId, long assegnatoreUserId,

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

@ -84,11 +84,12 @@ import com.liferay.portal.workflow.kaleo.service.KaleoTaskInstanceTokenLocalServ
import com.liferay.portlet.documentlibrary.service.DLAppServiceUtil; import com.liferay.portlet.documentlibrary.service.DLAppServiceUtil;
public class SismicaUtil { public class SismicaUtil {
private final static Log _log = LogFactoryUtil.getLog(SismicaUtil.class);
private static final Log _log = LogFactoryUtil.getLog(SismicaUtil.class);
private static final SimpleDateFormat dfmt = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss"); private static final SimpleDateFormat dfmt = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss");
public static final SimpleDateFormat sdfGiornoDB = new SimpleDateFormat("yyyy-MM-dd"); public static final SimpleDateFormat sdfGiornoDB = new SimpleDateFormat("yyyy-MM-dd");
private final static int SLICE = 200; private static final int SLICE = 200;
public static Date[] getWeekInterval(int dow) { public static Date[] getWeekInterval(int dow) {

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

@ -27,17 +27,16 @@ import com.liferay.portal.theme.ThemeDisplay;
import com.liferay.util.bridges.mvc.MVCPortlet; import com.liferay.util.bridges.mvc.MVCPortlet;
public class PaesaggisticaAdministrationPortlet extends MVCPortlet { public class PaesaggisticaAdministrationPortlet extends MVCPortlet {
private final static Log _log = LogFactoryUtil.getLog(PaesaggisticaAdministrationPortlet.class);
private static final Log _log = LogFactoryUtil.getLog(PaesaggisticaAdministrationPortlet.class);
public void impostazioniMappe(ActionRequest actionRequest, ActionResponse actionResponse) throws PortalException, public void impostazioniMappe(ActionRequest actionRequest, ActionResponse actionResponse) throws PortalException,
SystemException { SystemException {
String urlIframeFE = ParamUtil.getString(actionRequest, "urlIframeFE"); String urlIframeFE = ParamUtil.getString(actionRequest, "urlIframeFE");
String urlIframeBO = ParamUtil.getString(actionRequest, "urlIframeBO"); String urlIframeBO = ParamUtil.getString(actionRequest, "urlIframeBO");
String urlIframeRicerca = ParamUtil.getString(actionRequest, "urlIframeRicerca"); String urlIframeRicerca = ParamUtil.getString(actionRequest, "urlIframeRicerca");
String sharedSecret = ParamUtil.getString(actionRequest, "sharedSecret"); String sharedSecret = ParamUtil.getString(actionRequest, "sharedSecret");
// ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
// Company company = themeDisplay.getCompany();
ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest); ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest);
ConfigurazioneLocalServiceUtil.storeConfig(ConfigurazioneConstants.MAPPE_URL_IFRAME_FE, urlIframeFE, ConfigurazioneLocalServiceUtil.storeConfig(ConfigurazioneConstants.MAPPE_URL_IFRAME_FE, urlIframeFE,
serviceContext); serviceContext);
@ -50,6 +49,7 @@ public class PaesaggisticaAdministrationPortlet extends MVCPortlet {
} }
public void mostraConfigurazione(ActionRequest actionRequest, ActionResponse actionResponse) throws SystemException { public void mostraConfigurazione(ActionRequest actionRequest, ActionResponse actionResponse) throws SystemException {
List<String> esito = new ArrayList<String>(); List<String> esito = new ArrayList<String>();
esito.add("<h3>Env:</h3>"); esito.add("<h3>Env:</h3>");
for (Map.Entry<String, String> entry : System.getenv().entrySet()) { for (Map.Entry<String, String> entry : System.getenv().entrySet()) {

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

@ -30,15 +30,16 @@ import it.tref.liferay.portos.kaleo.service.FormLogLocalServiceUtil;
import it.tref.liferay.portos.kaleo.shared.util.WorkflowConstants; import it.tref.liferay.portos.kaleo.shared.util.WorkflowConstants;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.TreeMap; import java.util.TreeMap;
import java.util.TreeSet;
import com.liferay.portal.NoSuchWorkflowInstanceLinkException; import com.liferay.portal.NoSuchWorkflowInstanceLinkException;
import com.liferay.portal.kernel.bean.PortletBeanLocatorUtil; import com.liferay.portal.kernel.bean.PortletBeanLocatorUtil;
@ -411,15 +412,13 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi
ControlloPratica controlloPratica = getControlloPratica(controlloPraticaId); ControlloPratica controlloPratica = getControlloPratica(controlloPraticaId);
int unitaOperativa = intPraticaLocalService.getIntPratica(controlloPratica.getIntPraticaId()) int unitaOperativa = intPraticaLocalService.getIntPratica(controlloPratica.getIntPraticaId())
.getUnitaOperativa(); .getUnitaOperativa();
boolean preassegnazione = (0 == unitaOperativa);
long companyId = controlloPratica.getCompanyId(); long companyId = controlloPratica.getCompanyId();
long roleId = RoleLocalServiceUtil.getRole(companyId, long roleId = RoleLocalServiceUtil.getRole(companyId, Constants.ROLE_NAME_ISTRUTTORE).getRoleId();
preassegnazione ? "portos_assegnatore" : "portos_istruttore").getRoleId();
List<UserGroupRole> userGroupRoles = UserGroupRoleLocalServiceUtil.getUserGroupRolesByGroupAndRole( List<UserGroupRole> userGroupRoles = UserGroupRoleLocalServiceUtil.getUserGroupRolesByGroupAndRole(
controlloPratica.getGroupId(), roleId); controlloPratica.getGroupId(), roleId);
Map<String, JSONObject> sorted = new TreeMap<>(); List<JSONObject> istruttori = new ArrayList<>();
if (preassegnazione) { if (unitaOperativa == 0) {
Set<Integer> unitaOperative = new HashSet<>(); Set<Integer> unitaOperative = new TreeSet<>();
for (UserGroupRole userGroupRole : userGroupRoles) { for (UserGroupRole userGroupRole : userGroupRoles) {
User user = userGroupRole.getUser(); User user = userGroupRole.getUser();
unitaOperative.addAll(UnitaOperativeUtil.getUnitaOperative(user)); unitaOperative.addAll(UnitaOperativeUtil.getUnitaOperative(user));
@ -427,13 +426,14 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi
for (Integer uo : unitaOperative) { for (Integer uo : unitaOperative) {
if (0 != uo) { if (0 != uo) {
JSONObject unita = JSONFactoryUtil.createJSONObject(); JSONObject unita = JSONFactoryUtil.createJSONObject();
unita.put("label", "Unità operativa " + uo); unita.put("label", " > Unità operativa " + uo);
unita.put("value", "--UO--" + uo); unita.put("value", "--UO--" + uo);
unita.put("default", false); unita.put("default", false);
sorted.put(String.format("%6d", uo), unita); istruttori.add(unita);
} }
} }
} else { }
Map<String, JSONObject> ordinati = new TreeMap<>();
for (UserGroupRole userGroupRole : userGroupRoles) { for (UserGroupRole userGroupRole : userGroupRoles) {
User user = userGroupRole.getUser(); User user = userGroupRole.getUser();
if (UnitaOperativeUtil.getUnitaOperative(user).contains(unitaOperativa)) { if (UnitaOperativeUtil.getUnitaOperative(user).contains(unitaOperativa)) {
@ -441,14 +441,14 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi
istruttore.put("label", user.getFullName().toUpperCase()); istruttore.put("label", user.getFullName().toUpperCase());
istruttore.put("value", user.getUserId()); istruttore.put("value", user.getUserId());
istruttore.put("default", false); istruttore.put("default", false);
sorted.put((user.getLastName() + user.getFirstName()).toUpperCase(), istruttore); ordinati.put((user.getLastName() + user.getFirstName()).toUpperCase(), istruttore);
}
} }
} }
istruttori.addAll(ordinati.values());
JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
jsonObject.put("istruttore", jsonArray); jsonObject.put("istruttore", jsonArray);
for (JSONObject istruttore : sorted.values()) { for (JSONObject istruttore : istruttori) {
jsonArray.put(istruttore); jsonArray.put(istruttore);
} }
return jsonObject.toString(); return jsonObject.toString();
@ -484,7 +484,7 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi
esito.put(etichettaEsito(StatoPraticaConstants.NO_PARERE)); esito.put(etichettaEsito(StatoPraticaConstants.NO_PARERE));
JSONObject json = JSONFactoryUtil.createJSONObject(); JSONObject json = JSONFactoryUtil.createJSONObject();
json.put("esito", esito); json.put("esito", esito);
jsonAutorizzazione = esito.toString(); jsonAutorizzazione = json.toString();
} }
return jsonAutorizzazione; return jsonAutorizzazione;
} }

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

@ -13,8 +13,8 @@
## ##
build.namespace=portos_bo build.namespace=portos_bo
build.number=3360 build.number=3361
build.date=1631698031653 build.date=1631701936996
build.auto.upgrade=true build.auto.upgrade=true
## ##

19
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/actions/action_cambio_istruttore.jsp

@ -13,13 +13,10 @@ long controlloPraticaId = ParamUtil.getLong(request, "controlloPraticaId");
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId); IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId);
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil.getControlloPratica(controlloPraticaId); ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil.getControlloPratica(controlloPraticaId);
String buttonIdCambioIstruttore = ParamUtil.getString(request, "buttonIdCambioIstruttore"); String buttonIdCambioIstruttore = ParamUtil.getString(request, "buttonIdCambioIstruttore");
PortletURL iteratorURL = liferayPortletResponse.createRenderURL();
String orderByType = ParamUtil.getString(request, "orderByType", "asc");
String orderByCol = ParamUtil.getString(request, "orderByCol", "nome");
String randomId = StringUtil.randomId(); String randomId = StringUtil.randomId();
String formNameSelezionaCambioIstruttore = "formNameSelezionaCambioIstruttore_" + randomId; String formNameSelezionaCambioIstruttore = "formNameSelezionaCambioIstruttore_" + randomId;
String divIdSelezionaCambioIstruttore = "divIdSelezionaCambioIstruttore_" + randomId; String divIdSelezionaCambioIstruttore = "divIdSelezionaCambioIstruttore_" + randomId;
User istruttore = UserLocalServiceUtil.getUser(intPratica.getStatusByUserId()); User istruttoreAttuale = UserLocalServiceUtil.getUser(intPratica.getStatusByUserId());
Role role = RoleLocalServiceUtil.getRole(company.getCompanyId(), Constants.ROLE_NAME_ISTRUTTORE); Role role = RoleLocalServiceUtil.getRole(company.getCompanyId(), Constants.ROLE_NAME_ISTRUTTORE);
List<UserGroupRole> userGroupRoles = UserGroupRoleLocalServiceUtil.getUserGroupRolesByGroupAndRole( List<UserGroupRole> userGroupRoles = UserGroupRoleLocalServiceUtil.getUserGroupRolesByGroupAndRole(
controlloPratica.getGroupId(), role.getRoleId()); controlloPratica.getGroupId(), role.getRoleId());
@ -32,22 +29,22 @@ List<UserGroupRole> userGroupRoles = UserGroupRoleLocalServiceUtil.getUserGroupR
<aui:form name="<%= formNameSelezionaCambioIstruttore %>" method="post" action="<%= cambioIstruttoreUrl %>"> <aui:form name="<%= formNameSelezionaCambioIstruttore %>" method="post" action="<%= cambioIstruttoreUrl %>">
<div id='<%= renderResponse.getNamespace() + divIdSelezionaCambioIstruttore %>' class="hide"> <div id='<%= renderResponse.getNamespace() + divIdSelezionaCambioIstruttore %>' class="hide">
<div> <div>
<liferay-ui:message key="istruttore-attuale" /> <strong> <%= istruttore.getFullName() %> </strong> <liferay-ui:message key="istruttore-attuale" /> <strong> <%= istruttoreAttuale.getFullName() %> </strong>
</div> </div>
<aui:select name="istruttoreId" label=""> <aui:select name="istruttoreId" label="">
<aui:option label="" value="0" /> <aui:option label="" value="0" />
<% <%
List<Integer> uoUser = UnitaOperativeUtil.getUnitaOperative(user); List<Integer> uoUser = UnitaOperativeUtil.getUnitaOperative(user);
for (UserGroupRole userGroupRole: userGroupRoles) { for (UserGroupRole userGroupRole: userGroupRoles) {
if (userGroupRole.getUserId() != istruttore.getUserId()) { if (userGroupRole.getUserId() != istruttoreAttuale.getUserId()) {
User istruttoreTmp = UserLocalServiceUtil.getUser(userGroupRole.getUserId()); User istruttore = UserLocalServiceUtil.getUser(userGroupRole.getUserId());
List<Integer> uoIstruttore = UnitaOperativeUtil.getUnitaOperative(istruttoreTmp); List<Integer> uoIstruttore = UnitaOperativeUtil.getUnitaOperative(istruttore);
if (CollectionUtils.containsAny(uoUser, uoIstruttore)) { if (CollectionUtils.containsAny(uoUser, uoIstruttore)) {
String nominativo = istruttoreTmp.getFullName() + " - U.O. " String nominativo = istruttore.getFullName() + " - U.O. "
+ StringUtils.join(uoIstruttore, StringPool.COMMA_AND_SPACE) + " - " + StringUtils.join(uoIstruttore, StringPool.COMMA_AND_SPACE) + " - "
+ istruttoreTmp.getScreenName(); + istruttore.getScreenName();
%> %>
<aui:option label="<%= nominativo %>" value="<%= istruttoreTmp.getUserId() %>" /> <aui:option label="<%= nominativo %>" value="<%= istruttore.getUserId() %>" />
<% <%
} }
} }

79
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestionefirme/avvisi_da_firmare.jsp

@ -1,26 +1,17 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.liferay.portal.service.GroupLocalServiceUtil"%> <%@page import="com.liferay.portal.kernel.exception.PortalException"%>
<%@page import="com.liferay.portal.util.comparator.GroupIdComparator"%> <%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%>
<%@page import="com.liferay.portal.kernel.repository.model.FileEntry"%>
<%@page import="com.liferay.portal.kernel.util.ArrayUtil"%> <%@page import="com.liferay.portal.kernel.util.ArrayUtil"%>
<%@page import="com.liferay.portal.model.Organization"%> <%@page import="com.liferay.portal.model.Organization"%>
<%@page import="com.liferay.portal.model.User"%>
<%@page import="com.liferay.portal.service.OrganizationLocalServiceUtil"%> <%@page import="com.liferay.portal.service.OrganizationLocalServiceUtil"%>
<%@page import="com.liferay.portal.service.UserGroupRoleLocalServiceUtil"%> <%@page import="com.liferay.portal.service.UserGroupRoleLocalServiceUtil"%>
<%@page import="com.liferay.portal.service.UserLocalServiceUtil"%> <%@page import="com.liferay.portal.service.UserLocalServiceUtil"%>
<%@page import="com.liferay.portal.model.User"%>
<%@page import="com.liferay.portal.security.permission.ActionKeys"%>
<%@page import="it.tref.liferay.portos.bo.util.GenioCivileBaseUtil"%>
<%@page import="it.tref.liferay.portos.bo.util.Constants"%>
<%@page import="it.tref.liferay.portos.bo.util.AvvisoUtil"%>
<%@page import="com.liferay.portal.kernel.util.HttpUtil"%>
<%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%>
<%@page import="com.liferay.portal.kernel.exception.PortalException"%>
<%@page import="com.liferay.portlet.documentlibrary.util.DLUtil"%>
<%@page import="com.liferay.portal.kernel.util.Validator"%>
<%@page import="com.liferay.portlet.documentlibrary.service.DLAppLocalServiceUtil"%> <%@page import="com.liferay.portlet.documentlibrary.service.DLAppLocalServiceUtil"%>
<%@page import="com.liferay.portal.kernel.repository.model.FileEntry"%> <%@page import="com.liferay.portlet.documentlibrary.util.DLUtil"%>
<%@page import="com.liferay.portal.kernel.language.LanguageUtil"%> <%@page import="it.tref.liferay.portos.bo.shared.util.Constants"%>
<%@page import="com.liferay.portal.kernel.util.StringPool"%> <%@page import="it.tref.liferay.portos.bo.util.GenioCivileBaseUtil"%>
<%@page import="java.util.List"%>
<%@page import="javax.portlet.PortletURL"%> <%@page import="javax.portlet.PortletURL"%>
<%@include file="/html/gestionefirme/init.jsp"%> <%@include file="/html/gestionefirme/init.jsp"%>
<% <%
@ -29,19 +20,18 @@ String mvcPath = ParamUtil.getString(request, "mvcPath");
long[] groupIds = new long[0]; long[] groupIds = new long[0];
List<Organization> organizations = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId()); List<Organization> organizations = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId());
for (Organization organization:organizations) { for (Organization organization:organizations) {
if (UserGroupRoleLocalServiceUtil.hasUserGroupRole(user.getUserId(), organization.getGroupId(), Constants.ROLE_NAME_FIRMA, true)) { if (UserGroupRoleLocalServiceUtil.hasUserGroupRole(user.getUserId(), organization.getGroupId(),
Constants.ROLE_NAME_FIRMA, true)) {
groupIds = ArrayUtil.append(groupIds, organization.getGroupId()); groupIds = ArrayUtil.append(groupIds, organization.getGroupId());
} }
} }
%>
<div id="<portlet:namespace/>avvisiDaFirmareContainerId" class="avvisi_da_firmare_tab">
<%
PortletURL primaFirmaURL = renderResponse.createRenderURL(); PortletURL primaFirmaURL = renderResponse.createRenderURL();
primaFirmaURL.setParameter("tabs1", tabs1); primaFirmaURL.setParameter("tabs1", tabs1);
if (Validator.isNotNull(mvcPath)) { if (Validator.isNotNull(mvcPath)) {
primaFirmaURL.setParameter("mvcPath", mvcPath); primaFirmaURL.setParameter("mvcPath", mvcPath);
} }
%> %>
<div id="<portlet:namespace/>avvisiDaFirmareContainerId" class="avvisi_da_firmare_tab">
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">
<div class="module-group"> <div class="module-group">
@ -52,14 +42,15 @@ for (Organization organization:organizations) {
<liferay-ui:search-container-results results="<%= AvvisoLocalServiceUtil <liferay-ui:search-container-results results="<%= AvvisoLocalServiceUtil
.getAvvisiDaFirmarePrimaFirmaByCF(company.getCompanyId(), user.getScreenName(), .getAvvisiDaFirmarePrimaFirmaByCF(company.getCompanyId(), user.getScreenName(),
searchContainer.getStart(), searchContainer.getEnd()) %>" searchContainer.getStart(), searchContainer.getEnd()) %>"
total="<%= AvvisoLocalServiceUtil.countAvvisiDaFirmarePrimaFirmaByCF(company total="<%= AvvisoLocalServiceUtil.countAvvisiDaFirmarePrimaFirmaByCF(
.getCompanyId(), user.getScreenName()) %>" /> company.getCompanyId(), user.getScreenName()) %>" />
<liferay-ui:search-container-row className="it.tref.liferay.portos.bo.model.Avviso" <liferay-ui:search-container-row className="it.tref.liferay.portos.bo.model.Avviso"
modelVar="avviso"> modelVar="avviso">
<% <%
DettPratica dettPratica = DettPraticaLocalServiceUtil.fetchDettPratica(avviso.getClassPk()); DettPratica dettPratica = DettPraticaLocalServiceUtil.fetchDettPratica(avviso
.getClassPk());
IntPratica intPratica = null; IntPratica intPratica = null;
if (dettPratica != null) { if (Validator.isNotNull(dettPratica)) {
intPratica = IntPraticaLocalServiceUtil.getIntPratica(dettPratica.getIntPraticaId()); intPratica = IntPraticaLocalServiceUtil.getIntPratica(dettPratica.getIntPraticaId());
String urlDettaglioPratica = StringPool.BLANK; String urlDettaglioPratica = StringPool.BLANK;
if (fromPopUp) { if (fromPopUp) {
@ -77,17 +68,20 @@ for (Organization organization:organizations) {
String tipoProcedura = StringPool.BLANK; String tipoProcedura = StringPool.BLANK;
if (Validator.isNotNull(intPratica)) { if (Validator.isNotNull(intPratica)) {
tipoProcedura = LanguageUtil.get(pageContext, "label_procedura_" tipoProcedura = LanguageUtil.get(pageContext, "label_procedura_"
+ intPratica.getTipoProcedura()) + ") " + intPratica.getTipoProcedura())
+ ") "
+ LanguageUtil.get(pageContext, "tipo_procedura_" + LanguageUtil.get(pageContext, "tipo_procedura_"
+ intPratica.getTipoProcedura()); + intPratica.getTipoProcedura());
} }
%> %>
<liferay-ui:search-container-column-text name="label.avviso.progetto" <liferay-ui:search-container-column-text name="label.avviso.progetto"
value="<%= intPratica != null ? intPratica.getNumeroProgetto() value="<%= Validator.isNull(intPratica) ? StringPool.MINUS
: StringPool.MINUS %>" cssClass="text-center" /> : intPratica.getNumeroProgetto() %>"
cssClass="text-center" />
<liferay-ui:search-container-column-text name="label.avviso.protocollo" <liferay-ui:search-container-column-text name="label.avviso.protocollo"
value="<%= dettPratica != null ? dettPratica.getProtocollo() value="<%= Validator.isNull(dettPratica) ? StringPool.MINUS
: StringPool.MINUS %>" cssClass="text-center" /> : dettPratica.getProtocollo() %>"
cssClass="text-center" />
<liferay-ui:search-container-column-text name="label.avviso.tipoProcedura" <liferay-ui:search-container-column-text name="label.avviso.tipoProcedura"
value="<%= tipoProcedura %>" /> value="<%= tipoProcedura %>" />
<liferay-ui:search-container-column-text name="U.O."> <liferay-ui:search-container-column-text name="U.O.">
@ -105,11 +99,13 @@ for (Organization organization:organizations) {
try { try {
FileEntry fileEntryBase = DLAppLocalServiceUtil.getFileEntry(avviso FileEntry fileEntryBase = DLAppLocalServiceUtil.getFileEntry(avviso
.getFileEntryIdBase()); .getFileEntryIdBase());
urlFileEntryBase = DLUtil.getPreviewURL(fileEntryBase, fileEntryBase.getFileVersion(), urlFileEntryBase = DLUtil.getPreviewURL(fileEntryBase,
themeDisplay, StringPool.BLANK, false, true); fileEntryBase.getFileVersion(), themeDisplay, StringPool.BLANK, false,
true);
} catch (PortalException e) {} } catch (PortalException e) {}
%> %>
<liferay-ui:search-container-column-text name="label.avviso.documentoBase" align="center"> <liferay-ui:search-container-column-text name="label.avviso.documentoBase"
align="center">
<c:if test="<%= Validator.isNotNull(urlFileEntryBase) %>"> <c:if test="<%= Validator.isNotNull(urlFileEntryBase) %>">
<span class="tooltip-info just-center" title="Download"> <span class="tooltip-info just-center" title="Download">
<% <%
@ -181,8 +177,8 @@ for (Organization organization:organizations) {
dettPratica.getStatus(), currentURL.toString()); dettPratica.getStatus(), currentURL.toString());
} else { } else {
urlDettaglioPratica = GenioCivileBaseUtil.getDettPraticaURL(themeDisplay urlDettaglioPratica = GenioCivileBaseUtil.getDettPraticaURL(themeDisplay
.getPlid(), dettPratica.getDettPraticaId(), dettPratica.getStatus(), .getPlid(), dettPratica.getDettPraticaId(),
themeDisplay.getPortalURL(), true); dettPratica.getStatus(), themeDisplay.getPortalURL(), true);
} }
} }
String tipoProcedura = StringPool.BLANK; String tipoProcedura = StringPool.BLANK;
@ -192,11 +188,13 @@ for (Organization organization:organizations) {
} }
%> %>
<liferay-ui:search-container-column-text name="label.avviso.progetto" <liferay-ui:search-container-column-text name="label.avviso.progetto"
value="<%= intPratica != null ? intPratica.getNumeroProgetto() value="<%= Validator.isNull(intPratica) ? StringPool.MINUS
: StringPool.MINUS %>" cssClass="text-center" /> : intPratica.getNumeroProgetto() %>"
cssClass="text-center" />
<liferay-ui:search-container-column-text name="label.avviso.protocollo" <liferay-ui:search-container-column-text name="label.avviso.protocollo"
value="<%= dettPratica != null ? dettPratica.getProtocollo() value="<%= Validator.isNull(dettPratica) ? StringPool.MINUS
: StringPool.MINUS %>" cssClass="text-center" /> : dettPratica.getProtocollo() %>"
cssClass="text-center" />
<liferay-ui:search-container-column-text name="label.avviso.tipoProcedura" <liferay-ui:search-container-column-text name="label.avviso.tipoProcedura"
value="<%= tipoProcedura %>" /> value="<%= tipoProcedura %>" />
<liferay-ui:search-container-column-text name="U.O."> <liferay-ui:search-container-column-text name="U.O.">
@ -214,8 +212,9 @@ for (Organization organization:organizations) {
try { try {
FileEntry fileEntryBase = DLAppLocalServiceUtil.getFileEntry(avviso FileEntry fileEntryBase = DLAppLocalServiceUtil.getFileEntry(avviso
.getFileEntryIdBase()); .getFileEntryIdBase());
urlFileEntryBase = DLUtil.getPreviewURL(fileEntryBase, fileEntryBase.getFileVersion(), urlFileEntryBase = DLUtil.getPreviewURL(fileEntryBase,
themeDisplay, StringPool.BLANK, false, true); fileEntryBase.getFileVersion(), themeDisplay, StringPool.BLANK, false,
true);
} catch (PortalException e) {} } catch (PortalException e) {}
%> %>
<liferay-ui:search-container-column-text name="label.avviso.documentoBase" align="center"> <liferay-ui:search-container-column-text name="label.avviso.documentoBase" align="center">

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

@ -2,7 +2,5 @@
<%@include file="/html/init.jsp"%> <%@include file="/html/init.jsp"%>
<% <%
String tabNames = "Tab_AvvisiDaFirmare,Tab_AvvisiAltri,Tab_AvvisiFirme"; String tabNames = "Tab_AvvisiDaFirmare,Tab_AvvisiAltri,Tab_AvvisiFirme";
String tabs1 = ParamUtil.getString(request, "tabs1", StringUtil.split(tabNames)[0]); String tabs1 = ParamUtil.getString(request, "tabs1", StringUtil.split(tabNames)[0]);
%> %>

181
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/homebo/view.jsp

@ -1,43 +1,47 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/html/homebo/init.jsp" %> <%@include file="/html/homebo/init.jsp" %>
<% <%
int countPraticheScaduteAutorizzazione = GetterUtil.getInteger(renderRequest.getAttribute(
int countPraticheScaduteAutorizzazione = GetterUtil.getInteger(renderRequest.getAttribute("countPraticheScaduteAutorizzazione")); "countPraticheScaduteAutorizzazione"));
int countPraticheScaduteSorteggiate = GetterUtil.getInteger(renderRequest.getAttribute("countPraticheScaduteSorteggiate")); int countPraticheScaduteSorteggiate = GetterUtil.getInteger(renderRequest.getAttribute(
int countPraticheScaduteControlloObbligatorio = GetterUtil.getInteger(renderRequest.getAttribute("countPraticheScaduteControlloObbligatorio")); "countPraticheScaduteSorteggiate"));
int countPraticheScaduteControlloObbligatorio = GetterUtil.getInteger(renderRequest.getAttribute(
int countPraticheScaduteTotali = countPraticheScaduteAutorizzazione + countPraticheScaduteSorteggiate + countPraticheScaduteControlloObbligatorio; "countPraticheScaduteControlloObbligatorio"));
int countPraticheScaduteTotali = countPraticheScaduteAutorizzazione + countPraticheScaduteSorteggiate
int countPraticheInScadenzaAutorizzazioni = GetterUtil.getInteger(renderRequest.getAttribute("countPraticheInScadenzaAutorizzazioni")); + countPraticheScaduteControlloObbligatorio;
int countPraticheInScadenzaSorteggiate = GetterUtil.getInteger(renderRequest.getAttribute("countPraticheInScadenzaSorteggiate")); int countPraticheInScadenzaAutorizzazioni = GetterUtil.getInteger(renderRequest.getAttribute(
int countPraticheInScadenzaControlloObbligatorio = GetterUtil.getInteger(renderRequest.getAttribute("countPraticheInScadenzaControlloObbligatorio")); "countPraticheInScadenzaAutorizzazioni"));
int countPraticheInScadenzaSorteggiate = GetterUtil.getInteger(renderRequest.getAttribute(
int countPraticheInScadenzaTotali = countPraticheInScadenzaAutorizzazioni + countPraticheInScadenzaSorteggiate + countPraticheInScadenzaControlloObbligatorio; "countPraticheInScadenzaSorteggiate"));
int countPraticheInScadenzaControlloObbligatorio = GetterUtil.getInteger(renderRequest.getAttribute(
int countAutorizzazioniDaAssegnare = GetterUtil.getInteger(renderRequest.getAttribute("countAutorizzazioniDaAssegnare")); "countPraticheInScadenzaControlloObbligatorio"));
int countSorteggiateDaAssegnare = GetterUtil.getInteger(renderRequest.getAttribute("countSorteggiateDaAssegnare")); int countPraticheInScadenzaTotali = countPraticheInScadenzaAutorizzazioni + countPraticheInScadenzaSorteggiate
int countControlloObbligatorioDaAssegnare = GetterUtil.getInteger(renderRequest.getAttribute("countControlloObbligatorioDaAssegnare")); + countPraticheInScadenzaControlloObbligatorio;
int countAutorizzazioniDaAssegnare = GetterUtil.getInteger(renderRequest.getAttribute(
int countPraticheDaAssegnareTotali = countAutorizzazioniDaAssegnare + countSorteggiateDaAssegnare + countControlloObbligatorioDaAssegnare; "countAutorizzazioniDaAssegnare"));
int countSorteggiateDaAssegnare = GetterUtil.getInteger(renderRequest.getAttribute(
"countSorteggiateDaAssegnare"));
int countAutorizzazioniOrdinarie = GetterUtil.getInteger(renderRequest.getAttribute("countAutorizzazioniOrdinarie")); int countControlloObbligatorioDaAssegnare = GetterUtil.getInteger(renderRequest.getAttribute(
int countSorteggiateOrdinarie = GetterUtil.getInteger(renderRequest.getAttribute("countSorteggiateOrdinarie")); "countControlloObbligatorioDaAssegnare"));
int countControlloObbligatorioOrdinarie = GetterUtil.getInteger(renderRequest.getAttribute("countControlloObbligatorioOrdinarie")); int countPraticheDaAssegnareTotali = countAutorizzazioniDaAssegnare + countSorteggiateDaAssegnare
+ countControlloObbligatorioDaAssegnare;
int countPraticheOrdinarieTotali = countAutorizzazioniOrdinarie + countSorteggiateOrdinarie + countControlloObbligatorioOrdinarie; int countAutorizzazioniOrdinarie = GetterUtil.getInteger(renderRequest.getAttribute(
"countAutorizzazioniOrdinarie"));
int countSorteggiateOrdinarie = GetterUtil.getInteger(renderRequest.getAttribute(
int countTotaleAutorizzazioni = countPraticheScaduteAutorizzazione + countPraticheInScadenzaAutorizzazioni + countAutorizzazioniDaAssegnare + countAutorizzazioniOrdinarie; "countSorteggiateOrdinarie"));
int countTotaleSorteggiate = countPraticheScaduteSorteggiate + countPraticheInScadenzaSorteggiate + countSorteggiateDaAssegnare + countSorteggiateOrdinarie; int countControlloObbligatorioOrdinarie = GetterUtil.getInteger(renderRequest.getAttribute(
int countTotaleControlloObbligatorio = countPraticheScaduteControlloObbligatorio + countPraticheInScadenzaControlloObbligatorio + countControlloObbligatorioDaAssegnare + countControlloObbligatorioOrdinarie; "countControlloObbligatorioOrdinarie"));
int countPraticheOrdinarieTotali = countAutorizzazioniOrdinarie + countSorteggiateOrdinarie
+ countControlloObbligatorioOrdinarie;
int countTotaleAutorizzazioni = countPraticheScaduteAutorizzazione + countPraticheInScadenzaAutorizzazioni
+ countAutorizzazioniDaAssegnare + countAutorizzazioniOrdinarie;
int countTotaleSorteggiate = countPraticheScaduteSorteggiate + countPraticheInScadenzaSorteggiate
+ countSorteggiateDaAssegnare + countSorteggiateOrdinarie;
int countTotaleControlloObbligatorio = countPraticheScaduteControlloObbligatorio
+ countPraticheInScadenzaControlloObbligatorio + countControlloObbligatorioDaAssegnare
+ countControlloObbligatorioOrdinarie;
int totaleDeiTotali = countTotaleAutorizzazioni + countTotaleSorteggiate + countTotaleControlloObbligatorio; int totaleDeiTotali = countTotaleAutorizzazioni + countTotaleSorteggiate + countTotaleControlloObbligatorio;
%> %>
<style> <style>
.tabled-head { .tabled-head {
border : 1px solid #ddd; border : 1px solid #ddd;
@ -51,145 +55,64 @@ int totaleDeiTotali = countTotaleAutorizzazioni + countTotaleSorteggiate + count
color: black; color: black;
padding: 8px; padding: 8px;
} }
.tabled-body-second{ .tabled-body-second{
border : 1px solid #ddd; border : 1px solid #ddd;
background-color: #FFFFFF; background-color: #FFFFFF;
color: black; color: black;
padding: 8px; padding: 8px;
} }
</style> </style>
<div class="container-fluid"> <div class="container-fluid">
<div class="col-sm-12 col-md-12 "> <div class="col-sm-12">
<h3 style="margin:2%; text-align: center;">PRATICHE IN ISTRUTTORIA</h3> <h3 style="margin:2%; text-align: center;">PRATICHE IN ISTRUTTORIA</h3>
</div> </div>
</div> </div>
<div class="container-fluid"> <div class="container-fluid">
<div class="col-sm-2 col-md-2 tabled-head"> <div class="col-sm-2 tabled-head">
TIPOLOGIA TIPOLOGIA
</div> </div>
<!--<div class="col-sm-2 col-md-2 tabled-head"> <div class="col-sm-2 tabled-head ">
AUTORIZZAZIONI
</div>
<div class="col-sm-2 col-md-2 tabled-head">
SORTEGGI
</div>
<div class="col-sm-2 col-md-2 tabled-head">
C.O.
</div>
<div class="col-sm-2 col-md-2 tabled-head">
SANATORIE
</div>-->
<div class="col-sm-2 col-md-2 tabled-head ">
TOTALI TOTALI
</div> </div>
</div> </div>
<div class="container-fluid"> <div class="container-fluid">
<div class="col-sm-2 col-md-2 tabled-body-first"> <div class="col-sm-2 tabled-body-first">
<strong>PRATICHE DA ASSEGNARE</strong> <strong>PRATICHE DA ASSEGNARE</strong>
</div> </div>
<!-- <div class="col-sm-2 col-md-2 tabled-body-first"> <div class="col-sm-2 tabled-body-first">
<%=countAutorizzazioniDaAssegnare %>
</div>
<div class="col-sm-2 col-md-2 tabled-body-first">
<%=countSorteggiateDaAssegnare %>
</div>
<div class="col-sm-2 col-md-2 tabled-body-first">
<%=countControlloObbligatorioDaAssegnare %>
</div>
<div class="col-sm-2 col-md-2 tabled-body-first">
0
</div>-->
<div class="col-sm-2 col-md-2 tabled-body-first">
<%= countPraticheDaAssegnareTotali %> <%= countPraticheDaAssegnareTotali %>
</div> </div>
</div> </div>
<div class="container-fluid"> <div class="container-fluid">
<div class="col-sm-2 col-md-2 tabled-body-second"> <div class="col-sm-2 tabled-body-second">
<strong>PRATICHE ORDINARIE</strong> <strong>PRATICHE ORDINARIE</strong>
</div> </div>
<!-- <div class="col-sm-2 col-md-2 tabled-body-second"> <div class="col-sm-2 tabled-body-second">
<%=countAutorizzazioniOrdinarie %>
</div>
<div class="col-sm-2 col-md-2 tabled-body-second">
<%=countSorteggiateOrdinarie %>
</div>
<div class="col-sm-2 col-md-2 tabled-body-second">
<%=countControlloObbligatorioOrdinarie %>
</div>
<div class="col-sm-2 col-md-2 tabled-body-second">
0
</div>-->
<div class="col-sm-2 col-md-2 tabled-body-second">
<%= countPraticheOrdinarieTotali %> <%= countPraticheOrdinarieTotali %>
</div> </div>
</div> </div>
<div class="container-fluid"> <div class="container-fluid">
<div class="col-sm-2 col-md-2 tabled-body-first"> <div class="col-sm-2 tabled-body-first">
<strong>PRATICHE IN SCADENZA</strong> <strong>PRATICHE IN SCADENZA</strong>
</div> </div>
<!-- <div class="col-sm-2 col-md-2 tabled-body-first"> <div class="col-sm-2 tabled-body-first">
<%=countPraticheInScadenzaAutorizzazioni %>
</div>
<div class="col-sm-2 col-md-2 tabled-body-first">
<%=countPraticheInScadenzaSorteggiate %>
</div>
<div class="col-sm-2 col-md-2 tabled-body-first">
<%=countPraticheInScadenzaControlloObbligatorio %>
</div>
<div class="col-sm-2 col-md-2 tabled-body-first">
0
</div>-->
<div class="col-sm-2 col-md-2 tabled-body-first">
<%= countPraticheInScadenzaTotali %> <%= countPraticheInScadenzaTotali %>
</div> </div>
</div> </div>
<div class="container-fluid"> <div class="container-fluid">
<div class="col-sm-2 col-md-2 tabled-body-second"> <div class="col-sm-2 tabled-body-second">
<strong>PRATICHE SCADUTE</strong> <strong>PRATICHE SCADUTE</strong>
</div> </div>
<!-- <div class="col-sm-2 col-md-2 tabled-body-second"> <div class="col-sm-2 tabled-body-second">
<%=countPraticheScaduteAutorizzazione %>
</div>
<div class="col-sm-2 col-md-2 tabled-body-second">
<%=countPraticheScaduteSorteggiate %>
</div>
<div class="col-sm-2 col-md-2 tabled-body-second">
<%=countPraticheScaduteControlloObbligatorio %>
</div>
<div class="col-sm-2 col-md-2 tabled-body-second">
0
</div>-->
<div class="col-sm-2 col-md-2 tabled-body-second">
<%= countPraticheScaduteTotali %> <%= countPraticheScaduteTotali %>
</div> </div>
</div> </div>
<div class="container-fluid"> <div class="container-fluid">
<div class="col-sm-2 col-md-2 tabled-body-first"> <div class="col-sm-2 tabled-body-first">
<strong>TOTALI</strong> <strong>TOTALI</strong>
</div> </div>
<!-- <div class="col-sm-2 col-md-2 tabled-body-first"> <div class="col-sm-2 tabled-body-first">
<%=countTotaleAutorizzazioni %>
</div>
<div class="col-sm-2 col-md-2 tabled-body-first">
<%=countTotaleSorteggiate %>
</div>
<div class="col-sm-2 col-md-2 tabled-body-first">
<%=countTotaleControlloObbligatorio %>
</div>
<div class="col-sm-2 col-md-2 tabled-body-first">
0
</div>-->
<div class="col-sm-2 col-md-2 tabled-body-first">
<%= totaleDeiTotali %> <%= totaleDeiTotali %>
</div> </div>
</div> </div>

141
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/pagamenti/view.jsp

@ -7,44 +7,32 @@
<%@page import="java.text.NumberFormat"%> <%@page import="java.text.NumberFormat"%>
<%@page import="java.math.BigDecimal"%> <%@page import="java.math.BigDecimal"%>
<%@ include file="/html/pagamenti/init.jsp" %> <%@ include file="/html/pagamenti/init.jsp" %>
<% <%
long intPraticaId = ParamUtil.getLong(request, "intPraticaId"); long intPraticaId = ParamUtil.getLong(request, "intPraticaId");
%> %>
<liferay-ui:search-container emptyResultsMessage="no-entries-were-found" orderByType="desc" orderByCol="createDate">
<liferay-ui:search-container
emptyResultsMessage="no-entries-were-found"
orderByType="desc" orderByCol="createDate"
>
<liferay-ui:search-container-results <liferay-ui:search-container-results
results="<%=PagamentoLocalServiceUtil.findByIntPratica_Visible(intPraticaId) %>" results="<%=PagamentoLocalServiceUtil.findByIntPratica_Visible(intPraticaId) %>"
total="<%=PagamentoLocalServiceUtil.countByIntPratica_Visible(intPraticaId)%>" total="<%=PagamentoLocalServiceUtil.countByIntPratica_Visible(intPraticaId)%>" />
> <liferay-ui:search-container-row className="it.tref.liferay.portos.bo.model.Pagamento" modelVar="pagamento">
</liferay-ui:search-container-results>
<liferay-ui:search-container-row
className="it.tref.liferay.portos.bo.model.Pagamento"
modelVar="pagamento"
>
<c:if test="<%= DettPratica.class.getName().equals(pagamento.getClassName()) %>"> <c:if test="<%= DettPratica.class.getName().equals(pagamento.getClassName()) %>">
<% <%
DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(pagamento.getClassPk()); DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(pagamento.getClassPk());
%> %>
<liferay-ui:search-container-column-text cssClass="text-nowrap" name="Data"
<liferay-ui:search-container-column-text cssClass="text-nowrap" name="Data" value="<%= dateFormatDateTime.format(pagamento.getCreateDate()) %>" /> value="<%= dateFormatDateTime.format(pagamento.getCreateDate()) %>" />
<liferay-ui:search-container-column-text name="Pratica" value="<%= dettPratica.getFullDescription() %>"/> <liferay-ui:search-container-column-text name="Pratica" value="<%= dettPratica.getFullDescription() %>"/>
<liferay-ui:search-container-column-text cssClass="text-nowrap" name="Committente" value="<%= pagamento.getCodiceFiscaleCommittente().toUpperCase() %>"/> <liferay-ui:search-container-column-text cssClass="text-nowrap" name="Committente"
<liferay-ui:search-container-column-text cssClass="text-nowrap" name="Mezzo" value='<%= LanguageUtil.get(pageContext, "mezzo-pagamento-"+pagamento.getMezzo()) %>'/> value="<%= pagamento.getCodiceFiscaleCommittente().toUpperCase() %>"/>
<liferay-ui:search-container-column-text cssClass="text-nowrap" name="Stato" value='<%= LanguageUtil.get(pageContext, "pagamento-utilizzata-"+pagamento.getUtilizzata()) %>'/> <liferay-ui:search-container-column-text cssClass="text-nowrap" name="Mezzo"
value='<%= LanguageUtil.get(pageContext, "mezzo-pagamento-" + pagamento.getMezzo()) %>'/>
<liferay-ui:search-container-column-text cssClass="text-nowrap" name="Stato"
value='<%= LanguageUtil.get(pageContext, "pagamento-utilizzata-" + pagamento.getUtilizzata()) %>'/>
<liferay-ui:search-container-column-text cssClass="text-nowrap" name="Spese Istruttoria"> <liferay-ui:search-container-column-text cssClass="text-nowrap" name="Spese Istruttoria">
<c:if test="<%= PagamentoConstants.PAGAMENTO_ONERI.equalsIgnoreCase(pagamento.getTipoPagamento()) || PagamentoConstants.PAGAMENTO_ONERI_BOLLI.equals(pagamento.getTipoPagamento()) %>"> <c:if test="<%= PagamentoConstants.PAGAMENTO_ONERI.equalsIgnoreCase(pagamento.getTipoPagamento())
|| PagamentoConstants.PAGAMENTO_ONERI_BOLLI.equals(pagamento.getTipoPagamento()) %>">
<% <%
String result = ""; String result;
if (dettPratica.isNormEsenteSpese()) { if (dettPratica.isNormEsenteSpese()) {
result = "Esente"; result = "Esente";
} else { } else {
@ -63,7 +51,7 @@
<liferay-ui:search-container-column-text name="Spese Bollo"> <liferay-ui:search-container-column-text name="Spese Bollo">
<c:if test="<%= PagamentoConstants.PAGAMENTO_BOLLI.equalsIgnoreCase(pagamento.getTipoPagamento()) %>"> <c:if test="<%= PagamentoConstants.PAGAMENTO_BOLLI.equalsIgnoreCase(pagamento.getTipoPagamento()) %>">
<% <%
String result = ""; String result;
if (dettPratica.isNormEsenteBollo()) { if (dettPratica.isNormEsenteBollo()) {
result = "Esente"; result = "Esente";
} else { } else {
@ -79,10 +67,10 @@
%> %>
</c:if> </c:if>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text> <liferay-ui:search-container-column-text>
<% <%
String[] notAllowed = new String[]{PagamentoConstants.UTILIZZATA_SOSTITUITA, PagamentoConstants.UTILIZZATA_RIFIUTATA, PagamentoConstants.UTILIZZATA_NON_PAGABILE}; String[] notAllowed = new String[]{PagamentoConstants.UTILIZZATA_SOSTITUITA,
PagamentoConstants.UTILIZZATA_RIFIUTATA, PagamentoConstants.UTILIZZATA_NON_PAGABILE};
%> %>
<c:if test="<%= !Arrays.asList(notAllowed).contains(pagamento.getUtilizzata()) %>"> <c:if test="<%= !Arrays.asList(notAllowed).contains(pagamento.getUtilizzata()) %>">
<% <%
@ -90,83 +78,82 @@
String contentFormId = "pagamentoFormContent_" + index; String contentFormId = "pagamentoFormContent_" + index;
String formNameBollettino = "fmPagamenti_" + index; String formNameBollettino = "fmPagamenti_" + index;
%> %>
<liferay-ui:icon-menu showWhenSingleIcon="false" extended="false" showExpanded="true" cssClass="inline_toolbar" > <liferay-ui:icon-menu showWhenSingleIcon="false" extended="false" showExpanded="true"
<liferay-ui:icon cssClass="inline_toolbar">
id='<%=buttonFormId %>' <liferay-ui:icon id="<%= buttonFormId %>" iconCssClass="fa fa-edit" message=""
iconCssClass="fa fa-edit" url="javascript:void(0)" linkCssClass="btn btn-action" />
message=""
url="javascript:void(0)"
linkCssClass="btn btn-action"
/>
</liferay-ui:icon-menu> </liferay-ui:icon-menu>
<div id="<portlet:namespace /><%= contentFormId %>" class="hide" > <div id="<portlet:namespace /><%= contentFormId %>" class="hide" >
<liferay-util:include page="/html/pagamenti/view_panel_form_bollettino.jsp" servletContext='<%= application %>'> <liferay-util:include page="/html/pagamenti/view_panel_form_bollettino.jsp"
<liferay-util:param name="idPagamento" value="<%= String.valueOf(pagamento.getPagamentoId()) %>"></liferay-util:param> servletContext='<%= application %>'>
<liferay-util:param name="dettPraticaId" value="<%= String.valueOf(pagamento.getClassPk()) %>"></liferay-util:param> <liferay-util:param name="idPagamento"
<liferay-util:param name="formName" value="<%= formNameBollettino %>"></liferay-util:param> value="<%= String.valueOf(pagamento.getPagamentoId()) %>" />
<liferay-util:param name="dettPraticaId"
value="<%= String.valueOf(pagamento.getClassPk()) %>" />
<liferay-util:param name="formName" value="<%= formNameBollettino %>" />
</liferay-util:include> </liferay-util:include>
</div> </div>
<liferay-util:include page="/html/common/submit_form_window.jsp" servletContext="<%= application %>" > <liferay-util:include page="/html/common/submit_form_window.jsp"
<liferay-util:param name="titolo" value="Modifica Pagamento"></liferay-util:param> servletContext="<%= application %>">
<liferay-util:param name="buttonId" value="<%=buttonFormId%>"></liferay-util:param> <liferay-util:param name="titolo" value="Modifica Pagamento" />
<liferay-util:param name="contentDiv" value="<%=contentFormId%>"></liferay-util:param> <liferay-util:param name="buttonId" value="<%= buttonFormId %>" />
<liferay-util:param name="width" value="750"></liferay-util:param> <liferay-util:param name="contentDiv" value="<%= contentFormId %>" />
<liferay-util:param name="formName" value="<%= formNameBollettino %>"></liferay-util:param> <liferay-util:param name="width" value="750" />
<liferay-util:param name="buttonBar" value="true"></liferay-util:param> <liferay-util:param name="formName" value="<%= formNameBollettino %>" />
<liferay-util:param name="buttonBar" value="true" />
</liferay-util:include> </liferay-util:include>
</c:if> </c:if>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text> <liferay-ui:search-container-column-text>
<% <%
String[] notAllowed = new String[]{PagamentoConstants.UTILIZZATA_SOSTITUITA, PagamentoConstants.UTILIZZATA_RIFIUTATA, PagamentoConstants.UTILIZZATA_NON_PAGABILE}; String[] notAllowed = new String[]{PagamentoConstants.UTILIZZATA_SOSTITUITA,
PagamentoConstants.UTILIZZATA_RIFIUTATA, PagamentoConstants.UTILIZZATA_NON_PAGABILE};
%> %>
<c:if test="<%= !Arrays.asList(notAllowed).contains(pagamento.getUtilizzata()) %>"> <c:if test="<%= !Arrays.asList(notAllowed).contains(pagamento.getUtilizzata()) %>">
<% <%
String buttonId = "pagamentoButton_" + index; String buttonId = "pagamentoButton_" + index;
String contentId = "pagamentoContent_" + index; String contentId = "pagamentoContent_" + index;
%> %>
<liferay-ui:icon-menu showWhenSingleIcon="false" extended="false" showExpanded="true" cssClass="inline_toolbar" > <liferay-ui:icon-menu showWhenSingleIcon="false" extended="false" showExpanded="true"
<liferay-ui:icon cssClass="inline_toolbar" >
id='<%=buttonId %>' <liferay-ui:icon id='<%= buttonId %>' iconCssClass="fa fa-info-circle" message="detail"
iconCssClass="fa fa-info-circle" url="javascript:void(0)" linkCssClass="btn btn-action" />
message="detail"
url="javascript:void(0)"
linkCssClass="btn btn-action"
/>
</liferay-ui:icon-menu> </liferay-ui:icon-menu>
<div id="<portlet:namespace /><%= contentId %>" class="hide" > <div id="<portlet:namespace /><%= contentId %>" class="hide" >
<c:if test="<%= PagamentoConstants.PAGAMENTO_ONERI.equalsIgnoreCase(pagamento.getTipoPagamento()) %>"> <c:if test="<%= PagamentoConstants.PAGAMENTO_ONERI.equalsIgnoreCase(
<liferay-util:include page="/html/pagamenti/view_panel_pagamenti_spese.jsp" servletContext='<%= application %>'> pagamento.getTipoPagamento()) %>">
<liferay-util:param name="dettPraticaId" value="<%= String.valueOf(pagamento.getClassPk()) %>"/> <liferay-util:include page="/html/pagamenti/view_panel_pagamenti_spese.jsp"
servletContext='<%= application %>'>
<liferay-util:param name="dettPraticaId"
value="<%= String.valueOf(pagamento.getClassPk()) %>"/>
</liferay-util:include> </liferay-util:include>
</c:if> </c:if>
<c:if test="<%= PagamentoConstants.PAGAMENTO_BOLLI.equalsIgnoreCase(pagamento.getTipoPagamento()) %>"> <c:if test="<%= PagamentoConstants.PAGAMENTO_BOLLI.equalsIgnoreCase(
<liferay-util:include page="/html/pagamenti/view_panel_pagamenti_bolli.jsp" servletContext='<%= application %>'> pagamento.getTipoPagamento()) %>">
<liferay-util:param name="dettPraticaId" value="<%= String.valueOf(pagamento.getClassPk()) %>"/> <liferay-util:include page="/html/pagamenti/view_panel_pagamenti_bolli.jsp"
servletContext='<%= application %>'>
<liferay-util:param name="dettPraticaId"
value="<%= String.valueOf(pagamento.getClassPk()) %>"/>
</liferay-util:include> </liferay-util:include>
</c:if> </c:if>
<c:if test="<%= PagamentoConstants.PAGAMENTO_ONERI_BOLLI.equalsIgnoreCase(pagamento.getTipoPagamento()) %>"> <c:if test="<%= PagamentoConstants.PAGAMENTO_ONERI_BOLLI.equalsIgnoreCase(
<liferay-util:include page="/html/pagamenti/view_panel_pagamenti_spese.jsp" servletContext='<%= application %>'> pagamento.getTipoPagamento()) %>">
<liferay-util:param name="dettPraticaId" value="<%= String.valueOf(pagamento.getClassPk()) %>"/> <liferay-util:include page="/html/pagamenti/view_panel_pagamenti_spese.jsp"
servletContext='<%= application %>'>
<liferay-util:param name="dettPraticaId"
value="<%= String.valueOf(pagamento.getClassPk()) %>"/>
</liferay-util:include> </liferay-util:include>
</c:if> </c:if>
</div> </div>
<liferay-util:include page="/html/common/confirm_window.jsp" servletContext="<%= application %>" > <liferay-util:include page="/html/common/confirm_window.jsp" servletContext="<%= application %>" >
<liferay-util:param name="titolo" value="Dettaglio Pagamento"></liferay-util:param> <liferay-util:param name="titolo" value="Dettaglio Pagamento" />
<liferay-util:param name="buttonId" value="<%=buttonId%>"></liferay-util:param> <liferay-util:param name="buttonId" value="<%= buttonId %>" />
<liferay-util:param name="contentDiv" value="<%=contentId%>"></liferay-util:param> <liferay-util:param name="contentDiv" value="<%= contentId %>" />
<liferay-util:param name="width" value="750"></liferay-util:param> <liferay-util:param name="width" value="750" />
</liferay-util:include> </liferay-util:include>
</c:if> </c:if>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
</c:if> </c:if>
</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>

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

@ -108,8 +108,8 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
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 = disponibilitaPersistence.create(counterLocalService.increment(Disponibilita.class Disponibilita disponibilita =
.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());
@ -124,7 +124,7 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
disponibilita.setPresidio(presidio); disponibilita.setPresidio(presidio);
disponibilita.setExactDate(sdf.format(startDate)); disponibilita.setExactDate(sdf.format(startDate));
disponibilita.setDisponibile(true); disponibilita.setDisponibile(true);
disponibilita = disponibilitaLocalService.updateDisponibilita(disponibilita); disponibilita = updateDisponibilita(disponibilita);
return disponibilita; return disponibilita;
} }
@ -134,8 +134,8 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
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 = disponibilitaPersistence.create(counterLocalService.increment(Disponibilita.class Disponibilita disponibilita =
.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());
@ -150,7 +150,7 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
disponibilita.setPresidio(presidio); disponibilita.setPresidio(presidio);
disponibilita.setExactDate(sdf.format(startDate)); disponibilita.setExactDate(sdf.format(startDate));
disponibilita.setDisponibile(false); disponibilita.setDisponibile(false);
disponibilita = disponibilitaLocalService.updateDisponibilita(disponibilita); disponibilita = updateDisponibilita(disponibilita);
return disponibilita; return disponibilita;
} }
@ -166,10 +166,11 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
List<User> users = userLocalService.getOrganizationUsers(presidioId); List<User> users = userLocalService.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(), Role portosIstruttore =
"portos_calendario"); RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_calendario");
if (!userLocalService.hasRoleUser(portosSupporto.getRoleId(), user.getUserId())) { if (!userLocalService.hasRoleUser(portosSupporto.getRoleId(), user.getUserId())) {
boolean isIstruttore = UserGroupRoleLocalServiceUtil.hasUserGroupRole(user.getUserId(), boolean isIstruttore =
UserGroupRoleLocalServiceUtil.hasUserGroupRole(user.getUserId(),
organization.getGroupId(), portosIstruttore.getRoleId()); organization.getGroupId(), portosIstruttore.getRoleId());
if (isIstruttore) { if (isIstruttore) {
userDefinitivo.add(user); userDefinitivo.add(user);
@ -204,7 +205,7 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
for (Iterator<Disponibilita> iterator = results.iterator(); iterator.hasNext();) { for (Iterator<Disponibilita> iterator = results.iterator(); iterator.hasNext();) {
Disponibilita disponibilita = iterator.next(); Disponibilita disponibilita = iterator.next();
disponibilita.setDisponibile(true); disponibilita.setDisponibile(true);
disponibilitaLocalService.updateDisponibilita(disponibilita); updateDisponibilita(disponibilita);
} }
} }
} }
@ -242,7 +243,7 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
for (Iterator<Disponibilita> iterator = results.iterator(); iterator.hasNext();) { for (Iterator<Disponibilita> iterator = results.iterator(); iterator.hasNext();) {
Disponibilita disponibilita = iterator.next(); Disponibilita disponibilita = iterator.next();
disponibilita.setDisponibile(true); disponibilita.setDisponibile(true);
disponibilitaLocalService.updateDisponibilita(disponibilita); updateDisponibilita(disponibilita);
} }
} }
} }
@ -269,7 +270,8 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
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;
} }
@ -328,7 +330,7 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
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 disponibilitaLocalService.dynamicQuery(dynamicQuery, startRow, endRow); return dynamicQuery(dynamicQuery, startRow, endRow);
} }
@Override @Override
@ -340,7 +342,7 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
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 disponibilitaLocalService.dynamicQuery(dynamicQuery, QueryUtil.ALL_POS, QueryUtil.ALL_POS).size(); return dynamicQuery(dynamicQuery, QueryUtil.ALL_POS, QueryUtil.ALL_POS).size();
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@ -352,11 +354,11 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
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 = RoleLocalServiceUtil.hasUserRole(user.getUserId(), boolean isDirigenteGenerale =
dirigenteGenerale.getRoleId()); RoleLocalServiceUtil.hasUserRole(user.getUserId(), dirigenteGenerale.getRoleId());
if (isDirigenteGenerale) { if (isDirigenteGenerale) {
List<Organization> orgs = OrganizationLocalServiceUtil.getOrganizations(QueryUtil.ALL_POS, List<Organization> orgs =
QueryUtil.ALL_POS); OrganizationLocalServiceUtil.getOrganizations(QueryUtil.ALL_POS, QueryUtil.ALL_POS);
for (Organization organization : orgs) { for (Organization organization : orgs) {
if (organization.getParentOrganization() != null) { if (organization.getParentOrganization() != null) {
orgIds.add(organization.getOrganizationId()); orgIds.add(organization.getOrganizationId());
@ -366,8 +368,9 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
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, boolean isPO =
organization.getGroupId(), portosPO.getRoleId()); UserGroupRoleLocalServiceUtil.hasUserGroupRole(funzionarioId, organization.getGroupId(),
portosPO.getRoleId());
if (isPO) { if (isPO) {
orgIds.add(organization.getOrganizationId()); orgIds.add(organization.getOrganizationId());
} }
@ -391,7 +394,7 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
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 disponibilitaLocalService.dynamicQuery(dynamicQuery, startRow, endRow); return dynamicQuery(dynamicQuery, startRow, endRow);
} }
@Override @Override
@ -402,11 +405,11 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
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 = RoleLocalServiceUtil.hasUserRole(user.getUserId(), boolean isDirigenteGenerale =
dirigenteGenerale.getRoleId()); RoleLocalServiceUtil.hasUserRole(user.getUserId(), dirigenteGenerale.getRoleId());
if (isDirigenteGenerale) { if (isDirigenteGenerale) {
List<Organization> orgs = OrganizationLocalServiceUtil.getOrganizations(QueryUtil.ALL_POS, List<Organization> orgs =
QueryUtil.ALL_POS); OrganizationLocalServiceUtil.getOrganizations(QueryUtil.ALL_POS, QueryUtil.ALL_POS);
for (Organization organization : orgs) { for (Organization organization : orgs) {
if (organization.getParentOrganization() != null) { if (organization.getParentOrganization() != null) {
orgIds.add(organization.getOrganizationId()); orgIds.add(organization.getOrganizationId());
@ -416,8 +419,9 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
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, boolean isPO =
organization.getGroupId(), portosPO.getRoleId()); UserGroupRoleLocalServiceUtil.hasUserGroupRole(funzionarioId, organization.getGroupId(),
portosPO.getRoleId());
if (isPO) { if (isPO) {
orgIds.add(organization.getOrganizationId()); orgIds.add(organization.getOrganizationId());
} }
@ -441,7 +445,7 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
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 disponibilitaLocalService.dynamicQuery(dynamicQuery, QueryUtil.ALL_POS, QueryUtil.ALL_POS).size(); return dynamicQuery(dynamicQuery, QueryUtil.ALL_POS, QueryUtil.ALL_POS).size();
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@ -453,11 +457,11 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
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 = RoleLocalServiceUtil.hasUserRole(user.getUserId(), boolean isDirigenteGenerale =
dirigenteGenerale.getRoleId()); RoleLocalServiceUtil.hasUserRole(user.getUserId(), dirigenteGenerale.getRoleId());
if (isDirigenteGenerale) { if (isDirigenteGenerale) {
List<Organization> orgs = OrganizationLocalServiceUtil.getOrganizations(QueryUtil.ALL_POS, List<Organization> orgs =
QueryUtil.ALL_POS); OrganizationLocalServiceUtil.getOrganizations(QueryUtil.ALL_POS, QueryUtil.ALL_POS);
for (Organization organization : orgs) { for (Organization organization : orgs) {
if (organization.getParentOrganization() != null) { if (organization.getParentOrganization() != null) {
orgIds.add(organization.getOrganizationId()); orgIds.add(organization.getOrganizationId());
@ -467,8 +471,9 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
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, boolean isPO =
organization.getGroupId(), portosPO.getRoleId()); UserGroupRoleLocalServiceUtil.hasUserGroupRole(funzionarioId, organization.getGroupId(),
portosPO.getRoleId());
if (isPO) { if (isPO) {
orgIds.add(organization.getOrganizationId()); orgIds.add(organization.getOrganizationId());
} }
@ -484,7 +489,7 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
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 disponibilitaLocalService.dynamicQuery(dynamicQuery, startRow, endRow); return dynamicQuery(dynamicQuery, startRow, endRow);
} }
@Override @Override
@ -494,11 +499,11 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
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 = RoleLocalServiceUtil.hasUserRole(user.getUserId(), boolean isDirigenteGenerale =
dirigenteGenerale.getRoleId()); RoleLocalServiceUtil.hasUserRole(user.getUserId(), dirigenteGenerale.getRoleId());
if (isDirigenteGenerale) { if (isDirigenteGenerale) {
List<Organization> orgs = OrganizationLocalServiceUtil.getOrganizations(QueryUtil.ALL_POS, List<Organization> orgs =
QueryUtil.ALL_POS); OrganizationLocalServiceUtil.getOrganizations(QueryUtil.ALL_POS, QueryUtil.ALL_POS);
for (Organization organization : orgs) { for (Organization organization : orgs) {
if (organization.getParentOrganization() != null) { if (organization.getParentOrganization() != null) {
orgIds.add(organization.getOrganizationId()); orgIds.add(organization.getOrganizationId());
@ -508,8 +513,9 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
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, boolean isPO =
organization.getGroupId(), portosPO.getRoleId()); UserGroupRoleLocalServiceUtil.hasUserGroupRole(funzionarioId, organization.getGroupId(),
portosPO.getRoleId());
if (isPO) { if (isPO) {
orgIds.add(organization.getOrganizationId()); orgIds.add(organization.getOrganizationId());
} }
@ -525,7 +531,7 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
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 disponibilitaLocalService.dynamicQuery(dynamicQuery, QueryUtil.ALL_POS, QueryUtil.ALL_POS).size(); return dynamicQuery(dynamicQuery, QueryUtil.ALL_POS, QueryUtil.ALL_POS).size();
} }
private Date formatDateTime(String orario, Date day) throws ParseException { private Date formatDateTime(String orario, Date day) throws ParseException {

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

@ -60,8 +60,8 @@ public class PrenotazioneLocalServiceImpl extends PrenotazioneLocalServiceBaseIm
Date endDate, String descrizione, String telefono, String email, long presidio, Date endDate, String descrizione, String telefono, String email, long presidio,
ServiceContext serviceContext) throws SystemException, PortalException { ServiceContext serviceContext) throws SystemException, PortalException {
Prenotazione prenotazione = prenotazionePersistence.create(counterLocalService.increment(Prenotazione.class Prenotazione prenotazione =
.getName())); prenotazionePersistence.create(counterLocalService.increment(Prenotazione.class.getName()));
User user = userPersistence.findByPrimaryKey(userId); User user = userPersistence.findByPrimaryKey(userId);
Date now = new Date(); Date now = new Date();
prenotazione.setCompanyId(serviceContext.getCompanyId()); prenotazione.setCompanyId(serviceContext.getCompanyId());
@ -77,7 +77,7 @@ public class PrenotazioneLocalServiceImpl extends PrenotazioneLocalServiceBaseIm
prenotazione.setDescLong(descrizione); prenotazione.setDescLong(descrizione);
prenotazione.setTelefono(telefono); prenotazione.setTelefono(telefono);
prenotazione.setEmail(email); prenotazione.setEmail(email);
prenotazione = prenotazioneLocalService.updatePrenotazione(prenotazione); prenotazione = updatePrenotazione(prenotazione);
return prenotazione; return prenotazione;
} }
@ -91,7 +91,7 @@ public class PrenotazioneLocalServiceImpl extends PrenotazioneLocalServiceBaseIm
prenotazione.setStartDate(startDate); prenotazione.setStartDate(startDate);
prenotazione.setEndDate(endDate); prenotazione.setEndDate(endDate);
prenotazione.setDescLong(descrizione); prenotazione.setDescLong(descrizione);
prenotazione = prenotazioneLocalService.updatePrenotazione(prenotazione); prenotazione = updatePrenotazione(prenotazione);
return prenotazione; return prenotazione;
} }
@ -185,8 +185,9 @@ public class PrenotazioneLocalServiceImpl extends PrenotazioneLocalServiceBaseIm
if (org != null) { if (org != null) {
List<User> users = userLocalService.getOrganizationUsers(presidioId); List<User> users = userLocalService.getOrganizationUsers(presidioId);
for (User user : users) { for (User user : users) {
boolean isCalendario = UserGroupRoleLocalServiceUtil.hasUserGroupRole(user.getUserId(), boolean isCalendario =
org.getGroupId(), portosCalendario.getRoleId()); UserGroupRoleLocalServiceUtil.hasUserGroupRole(user.getUserId(), org.getGroupId(),
portosCalendario.getRoleId());
if (isCalendario) { if (isCalendario) {
DynamicQuery dynamicQuery = dynamicQuery(); DynamicQuery dynamicQuery = dynamicQuery();
dynamicQuery.add(RestrictionsFactoryUtil.eq("funzionarioId", user.getUserId())); dynamicQuery.add(RestrictionsFactoryUtil.eq("funzionarioId", user.getUserId()));

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

@ -25,7 +25,7 @@ import com.liferay.portlet.expando.service.ExpandoTableLocalServiceUtil;
public class StartUpAction extends SimpleAction { public class StartUpAction extends SimpleAction {
private final static Log _log = LogFactoryUtil.getLog(StartUpAction.class); private static final Log _log = LogFactoryUtil.getLog(StartUpAction.class);
@Override @Override
public void run(String[] companyIds) throws ActionException { public void run(String[] companyIds) throws ActionException {

40
liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/deployalert/NoSuchNotificationLogException.java

@ -0,0 +1,40 @@
/**
* Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is 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;
import com.liferay.portal.NoSuchModelException;
/**
* @author Matteo
*/
public class NoSuchNotificationLogException extends NoSuchModelException {
public NoSuchNotificationLogException() {
super();
}
public NoSuchNotificationLogException(String msg) {
super(msg);
}
public NoSuchNotificationLogException(String msg, Throwable cause) {
super(msg, cause);
}
public NoSuchNotificationLogException(Throwable cause) {
super(cause);
}
}

40
liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/deployalert/NoSuchNotificationMailException.java

@ -0,0 +1,40 @@
/**
* Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is 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;
import com.liferay.portal.NoSuchModelException;
/**
* @author Matteo
*/
public class NoSuchNotificationMailException extends NoSuchModelException {
public NoSuchNotificationMailException() {
super();
}
public NoSuchNotificationMailException(String msg) {
super(msg);
}
public NoSuchNotificationMailException(String msg, Throwable cause) {
super(msg, cause);
}
public NoSuchNotificationMailException(Throwable cause) {
super(cause);
}
}

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

@ -1,5 +1,14 @@
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;
@ -16,30 +25,12 @@ 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 final static Log _log = LogFactoryUtil.getLog(DeployAction.class); private static final Log _log = LogFactoryUtil.getLog(DeployAction.class);
@Override @Override
public void run(final String[] ids) throws ActionException { public void run(final String[] ids) throws ActionException {
/*
* ServiceContext serviceContext = DeployAlertUtil.getServiceContext();
* try { PermissionThreadLocal
* .setPermissionChecker(PermissionCheckerFactoryUtil
* .create(UserLocalServiceUtil .getUser(serviceContext.getUserId())));
* } catch (Exception e) { _log.error(e, e); }
* DeployAlertUtil.addDefaultDeployMailTemplate(serviceContext);
* DeployAlertUtil.addDefaultUndeployMailTemplate(serviceContext);
*/
MessageBusUtil.registerMessageListener(DestinationNames.HOT_DEPLOY, new MessageListener() { MessageBusUtil.registerMessageListener(DestinationNames.HOT_DEPLOY, new MessageListener() {
@ -48,7 +39,6 @@ public class DeployAction extends SimpleAction {
String evento = message.getString("command"); String evento = message.getString("command");
String nomePlugin = message.getString("servletContextName"); String nomePlugin = message.getString("servletContextName");
if (evento.equals("undeploy") && nomePlugin.equals("portos-deploy-alert-portlet")) { if (evento.equals("undeploy") && nomePlugin.equals("portos-deploy-alert-portlet")) {
try { try {
NotificationLogLocalServiceUtil.addNotification(nomePlugin, evento); NotificationLogLocalServiceUtil.addNotification(nomePlugin, evento);
@ -59,16 +49,12 @@ public class DeployAction extends SimpleAction {
} else if (evento.equals("deploy") || evento.equals("undeploy")) { } else if (evento.equals("deploy") || evento.equals("undeploy")) {
try { try {
List<NotificationMail> notifications; List<NotificationMail> notifications;
NotificationLogLocalServiceUtil.addNotification(nomePlugin, evento); NotificationLogLocalServiceUtil.addNotification(nomePlugin, evento);
notifications =
notifications = NotificationMailLocalServiceUtil.findNotifications( NotificationMailLocalServiceUtil.findNotifications(PortalUtil.getDefaultCompanyId(),
PortalUtil.getDefaultCompanyId(), nomePlugin); nomePlugin);
for (int i = 0; i < notifications.size(); i++) { for (int i = 0; i < notifications.size(); i++) {
String templateName = notifications.get(i).getNomeTemplate(); String templateName = notifications.get(i).getNomeTemplate();
if (templateName.equals(MailConstants.DEFAULT_TEMPLATE)) { if (templateName.equals(MailConstants.DEFAULT_TEMPLATE)) {
if (evento.equals("deploy")) { if (evento.equals("deploy")) {
templateName = MailConstants.DEFAULT_DEPLOY_TEMPLATE; templateName = MailConstants.DEFAULT_DEPLOY_TEMPLATE;
@ -76,14 +62,11 @@ public class DeployAction extends SimpleAction {
templateName = MailConstants.DEFAULT_UNDEPLOY_TEMPLATE; templateName = MailConstants.DEFAULT_UNDEPLOY_TEMPLATE;
} }
} }
JSONObject parametri = DeployAlertUtil.getParametri(nomePlugin, evento); JSONObject parametri = DeployAlertUtil.getParametri(nomePlugin, evento);
ServiceContext serviceContext = DeployAlertUtil.getServiceContext(); ServiceContext serviceContext = DeployAlertUtil.getServiceContext();
MailManagerUtil.sendMailByTemplateName(Company.class.toString(), MailManagerUtil.sendMailByTemplateName(Company.class.toString(),
serviceContext.getCompanyId(), templateName, parametri, serviceContext); serviceContext.getCompanyId(), templateName, parametri, serviceContext);
} }
} catch (Exception e) { } catch (Exception e) {
_log.error(e, e); _log.error(e, e);
} }

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

@ -3,9 +3,6 @@ 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_DEPLOY_TEMPLATE = "default-deploy";
public static final String DEFAULT_UNDEPLOY_TEMPLATE = "default-undeploy"; public static final String DEFAULT_UNDEPLOY_TEMPLATE = "default-undeploy";
} }

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

@ -8,17 +8,14 @@ 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;
} }
} }

33
liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/model/impl/NotificationLogImpl.java

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

37
liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/model/impl/NotificationMailImpl.java

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

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

@ -1,5 +1,11 @@
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;
@ -8,29 +14,17 @@ 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 nomePlugin = ParamUtil.getString(request, "nomePlugin");
String nomeTemplate = ParamUtil.getString(request, "nomeTemplate"); String nomeTemplate = ParamUtil.getString(request, "nomeTemplate");
try { try {
NotificationMailLocalServiceUtil.addNotification(nomePlugin, nomeTemplate, serviceContext); NotificationMailLocalServiceUtil.addNotification(nomePlugin, nomeTemplate, serviceContext);
} catch (PortalException e) { } catch (PortalException e) {
SessionErrors.add(request, e.getClass()); SessionErrors.add(request, e.getClass());
response.setRenderParameter("mvcPath", "/html/notificator/edit_notification.jsp"); response.setRenderParameter("mvcPath", "/html/notificator/edit_notification.jsp");
} }
} }
@ -39,10 +33,8 @@ public class NotificatorPortlet extends MVCPortlet {
SystemException { SystemException {
long notificationId = ParamUtil.getLong(request, "notificationId"); long notificationId = ParamUtil.getLong(request, "notificationId");
try { try {
NotificationMailLocalServiceUtil.deleteNotificationMail(notificationId); NotificationMailLocalServiceUtil.deleteNotificationMail(notificationId);
} catch (PortalException pe) { } catch (PortalException pe) {
SessionErrors.add(request, pe.getClass().getName()); SessionErrors.add(request, pe.getClass().getName());
} }
@ -52,16 +44,14 @@ public class NotificatorPortlet extends MVCPortlet {
SystemException { SystemException {
ServiceContext serviceContext = ServiceContextFactory.getInstance(NotificationMail.class.getName(), request); ServiceContext serviceContext = ServiceContextFactory.getInstance(NotificationMail.class.getName(), request);
String nomePlugin = ParamUtil.getString(request, "nomePlugin"); String nomePlugin = ParamUtil.getString(request, "nomePlugin");
String nomeTemplate = ParamUtil.getString(request, "nomeTemplate"); String nomeTemplate = ParamUtil.getString(request, "nomeTemplate");
long notificationId = ParamUtil.getLong(request, "notificationId"); long notificationId = ParamUtil.getLong(request, "notificationId");
try { try {
NotificationMailLocalServiceUtil.updateNotification(nomePlugin, nomeTemplate, serviceContext, notificationId); NotificationMailLocalServiceUtil.updateNotification(nomePlugin, nomeTemplate, serviceContext,
notificationId);
} catch (PortalException pe) { } catch (PortalException pe) {
SessionErrors.add(request, pe.getClass()); SessionErrors.add(request, pe.getClass());
response.setRenderParameter("mvcPath", "/html/notificator/edit_notification.jsp"); response.setRenderParameter("mvcPath", "/html/notificator/edit_notification.jsp");
} }
} }

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

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

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

@ -1,15 +1,9 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it
* * and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software
* This library is free software; you can redistribute it and/or modify it under * Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in
* the terms of the GNU Lesser General Public License as published by the Free * the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* Software Foundation; either version 2.1 of the License, or (at your option) * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
* 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;
@ -18,12 +12,12 @@ import it.tref.liferay.portos.deployalert.service.base.NotificationLogServiceBas
/** /**
* The implementation of the notification log remote service. * The implementation of the notification log remote service.
*
* <p> * <p>
* All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.deployalert.service.NotificationLogService} interface. * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy
* * their definitions into the {@link it.tref.liferay.portos.deployalert.service.NotificationLogService} interface.
* <p> * <p>
* This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS credentials because this service can be accessed remotely. * This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS
* credentials because this service can be accessed remotely.
* </p> * </p>
* *
* @author Matteo * @author Matteo
@ -32,8 +26,8 @@ import it.tref.liferay.portos.deployalert.service.base.NotificationLogServiceBas
*/ */
public class NotificationLogServiceImpl extends NotificationLogServiceBaseImpl { public class NotificationLogServiceImpl extends NotificationLogServiceBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link
* * it.tref.liferay.portos.deployalert.service.NotificationLogServiceUtil} to access the notification log remote
* Never reference this interface directly. Always use {@link it.tref.liferay.portos.deployalert.service.NotificationLogServiceUtil} to access the notification log remote service. * service.
*/ */
} }

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

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

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

@ -1,15 +1,9 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it
* * and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software
* This library is free software; you can redistribute it and/or modify it under * Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in
* the terms of the GNU Lesser General Public License as published by the Free * the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* Software Foundation; either version 2.1 of the License, or (at your option) * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
* 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;
@ -18,17 +12,12 @@ import it.tref.liferay.portos.deployalert.service.base.NotificationMailServiceBa
/** /**
* The implementation of the notification mail remote service. * The implementation of the notification mail remote service.
*
* <p> * <p>
* All custom service methods should be put in this class. Whenever methods are * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy
* added, rerun ServiceBuilder to copy their definitions into the * their definitions into the {@link it.tref.liferay.portos.deployalert.service.NotificationMailService} interface.
* {@link it.tref.liferay.portos.deployalert.service.NotificationMailService}
* interface.
*
* <p> * <p>
* This is a remote service. Methods of this service are expected to have * This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS
* security checks based on the propagated JAAS credentials because this service * credentials because this service can be accessed remotely.
* can be accessed remotely.
* </p> * </p>
* *
* @author Matteo * @author Matteo
@ -37,10 +26,8 @@ import it.tref.liferay.portos.deployalert.service.base.NotificationMailServiceBa
*/ */
public class NotificationMailServiceImpl extends NotificationMailServiceBaseImpl { public class NotificationMailServiceImpl extends NotificationMailServiceBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link
* * it.tref.liferay.portos.deployalert.service.NotificationMailServiceUtil} to access the notification mail remote
* Never reference this interface directly. Always use {@link * service.
* it.tref.liferay.portos.deployalert.service.NotificationMailServiceUtil}
* to access the notification mail remote service.
*/ */
} }

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

@ -1,5 +1,11 @@
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;
@ -16,38 +22,27 @@ 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 final static Log _log = LogFactoryUtil.getLog(DeployAlertUtil.class); private static final 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(); ServiceContext serviceContext = new ServiceContext();
Company company; Company company;
serviceContext.setCompanyId(companyId); serviceContext.setCompanyId(companyId);
try { try {
company = CompanyLocalServiceUtil.getCompany(companyId); company = CompanyLocalServiceUtil.getCompany(companyId);
Role role = RoleLocalServiceUtil.getRole(company.getCompanyId(), RoleConstants.ADMINISTRATOR); Role role = RoleLocalServiceUtil.getRole(company.getCompanyId(), RoleConstants.ADMINISTRATOR);
long userAdminId = UserLocalServiceUtil.getRoleUserIds(role.getRoleId())[0]; long userAdminId = UserLocalServiceUtil.getRoleUserIds(role.getRoleId())[0];
serviceContext.setUserId(userAdminId); serviceContext.setUserId(userAdminId);
serviceContext.setScopeGroupId(company.getGroupId()); serviceContext.setScopeGroupId(company.getGroupId());
PermissionThreadLocal.setPermissionChecker(PermissionCheckerFactoryUtil.create(UserLocalServiceUtil
PermissionThreadLocal.setPermissionChecker(PermissionCheckerFactoryUtil .getUser(userAdminId)));
.create(UserLocalServiceUtil.getUser(userAdminId)));
} catch (Exception e) { } catch (Exception e) {
_log.error(e, e); _log.error(e, e);
} }
return serviceContext; return serviceContext;
} }
@ -57,10 +52,9 @@ public class DeployAlertUtil {
String subject = "Deploy Plugin"; String subject = "Deploy Plugin";
String body = "E' stato effettuato il $evento del plugin $nomePlugin in data $data."; String body = "E' stato effettuato il $evento del plugin $nomePlugin in data $data.";
String[] to = { "matteoguggia97@gmail.com" }; String[] to = { "matteoguggia97@gmail.com" };
try { try {
add = MailManagerUtil.addMailTemplate(MailConstants.DEFAULT_DEPLOY_TEMPLATE, add = MailManagerUtil.addMailTemplate(MailConstants.DEFAULT_DEPLOY_TEMPLATE, "test@3fconsulting.it", to,
"test@3fconsulting.it", to, null, null, subject, body, false, serviceContext); null, null, subject, body, false, serviceContext);
} catch (SystemException e) { } catch (SystemException e) {
_log.error(e, e); _log.error(e, e);
} }
@ -77,8 +71,8 @@ public class DeployAlertUtil {
String[] to = { "matteoguggia97@gmail.com" }; String[] to = { "matteoguggia97@gmail.com" };
try { try {
add = MailManagerUtil.addMailTemplate(MailConstants.DEFAULT_UNDEPLOY_TEMPLATE, add = MailManagerUtil.addMailTemplate(MailConstants.DEFAULT_UNDEPLOY_TEMPLATE, "test@3fconsulting.it", to,
"test@3fconsulting.it", to, null, null, subject, body, false, serviceContext); null, null, subject, body, false, serviceContext);
} catch (SystemException e) { } catch (SystemException e) {
_log.error(e, e); _log.error(e, e);
} }

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

@ -13,8 +13,8 @@
## ##
build.namespace=DA build.namespace=DA
build.number=10 build.number=11
build.date=1612446773513 build.date=1631869742186
build.auto.upgrade=true build.auto.upgrade=true
## ##

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

@ -31,7 +31,7 @@ import com.liferay.util.bridges.mvc.MVCPortlet;
public class RicercaPratichePortlet extends MVCPortlet { public class RicercaPratichePortlet extends MVCPortlet {
private final static Logger _log = Logger.getLogger(RicercaPratichePortlet.class); private static final Logger _log = Logger.getLogger(RicercaPratichePortlet.class);
public void processAvvisi(ActionRequest actionRequest, ActionResponse actionResponse) throws IOException, public void processAvvisi(ActionRequest actionRequest, ActionResponse actionResponse) throws IOException,
PortletException { PortletException {

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

@ -57,7 +57,7 @@ import com.liferay.portal.service.CompanyLocalServiceUtil;
public class ReportFascicoloUtil { public class ReportFascicoloUtil {
private final static SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); private static final SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
public static Map<String, Object> generateParametersReportFascicolo(long intPraticaId, Locale locale, long companyId) public static Map<String, Object> generateParametersReportFascicolo(long intPraticaId, Locale locale, long companyId)
throws PortalException, SystemException { throws PortalException, SystemException {

9
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/view_fascicolo_dettagli.jsp

@ -802,15 +802,6 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<%
String copertura = BeanPropertiesUtil.getString(dettPratica, "dccCopertura");
%>
<c:if test="<%= Validator.isNotNull(copertura) %>">
<div class="col-sm-12 col-md-12" >
<strong><%=LanguageUtil.get(pageContext,
"dcc-copertura-"+BeanPropertiesUtil.getString(dettPratica, "dccCopertura"))%></strong>
</div>
</c:if>
<div class="col-sm-6 col-md-6" > <div class="col-sm-6 col-md-6" >
<strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "dccCoperturaCAAcciaio") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong> <strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "dccCoperturaCAAcciaio") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong>
<%= LanguageUtil.get(pageContext, "dcc-copertura-c-a-acciaio") %> <%= LanguageUtil.get(pageContext, "dcc-copertura-c-a-acciaio") %>

288
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/view_fascicolo_riepilogo.jsp

@ -1,48 +1,28 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.liferay.portal.kernel.bean.BeanPropertiesUtil"%>
<%@page import="it.tref.liferay.portos.bo.util.PraticaUtil"%> <%@page import="com.liferay.portal.kernel.servlet.ServletContextPool"%>
<%@page import="com.liferay.portal.service.UserLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.model.DettPratica"%>
<%@page import="it.tref.liferay.portos.bo.service.CollaudoLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.service.CollaudoLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.FineLavoriLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.service.ComuneLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.TipoIntegrazioneUtil"%>
<%@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.service.DettPraticaLocalService"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants"%>
<%@page import="com.liferay.portal.service.UserLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.SoggettoServiceUtil"%>
<%@page import="com.liferay.portal.kernel.servlet.ServletContextPool"%>
<%@page import="it.tref.liferay.portos.bo.model.Pagamento"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.PagamentoConstants"%>
<%@page import="it.tref.liferay.portos.bo.util.PagamentiCommonUtil"%>
<%@page import="java.math.BigDecimal"%>
<%@page import="java.text.NumberFormat"%>
<%@page import="it.tref.liferay.portos.bo.model.Soggetto"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.PortletKeys"%>
<%@page import="java.util.Date"%>
<%@page import="it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.DettPraticaServiceUtil"%> <%@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.FineLavoriLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil"%>
<%@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.SoggettoLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.SoggettoServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.TerritorioLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.service.TerritorioLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.model.Provincia"%> <%@page import="it.tref.liferay.portos.bo.shared.util.TipoIntegrazioneUtil"%>
<%@page import="it.tref.liferay.portos.bo.model.Comune"%> <%@page import="it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil"%>
<%@page import="it.tref.liferay.portos.bo.model.Territorio"%> <%@page import="it.tref.liferay.portos.bo.util.PraticaUtil"%>
<%@page import="it.tref.liferay.portos.bo.model.IntPratica"%>
<%@page import="it.tref.liferay.portos.bo.model.DettPratica"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.regex.Pattern"%>
<%@page import="com.liferay.portal.kernel.bean.BeanPropertiesUtil"%>
<%@include file="/html/fascicolofe/init.jsp"%> <%@include file="/html/fascicolofe/init.jsp"%>
<% <%
long intPraticaId = ParamUtil.getLong(request, "intPraticaId",0l); long intPraticaId = ParamUtil.getLong(request, "intPraticaId", 0);
long dettPraticaId = ParamUtil.getLong(request, "dettPraticaId",0l); long dettPraticaId = ParamUtil.getLong(request, "dettPraticaId", 0);
DettPratica dettPratica = null; DettPratica dettPratica = null;
IntPratica intPratica = null; IntPratica intPratica = null;
if(intPraticaId!=0l){ if (intPraticaId != 0) {
intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId); intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId);
dettPratica = DettPraticaServiceUtil.getLastEditableByIntPratica(intPraticaId); dettPratica = DettPraticaServiceUtil.getLastEditableByIntPratica(intPraticaId);
if (dettPratica == null) { if (dettPratica == null) {
@ -50,7 +30,6 @@
} }
dettPraticaId = dettPratica.getDettPraticaId(); dettPraticaId = dettPratica.getDettPraticaId();
} }
Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId()); Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId());
Comune comune = ComuneLocalServiceUtil.getComune(territorio.getComuneId()); Comune comune = ComuneLocalServiceUtil.getComune(territorio.getComuneId());
Provincia provincia = ProvinciaLocalServiceUtil.fetchByC_C(territorio.getCompanyId(), territorio.getCodiceProvincia()); Provincia provincia = ProvinciaLocalServiceUtil.fetchByC_C(territorio.getCompanyId(), territorio.getCodiceProvincia());
@ -58,34 +37,40 @@
if (intPratica.getStatusByUserId() != 0) { if (intPratica.getStatusByUserId() != 0) {
name = UserLocalServiceUtil.getUser(intPratica.getStatusByUserId()).getFullName(); name = UserLocalServiceUtil.getUser(intPratica.getStatusByUserId()).getFullName();
} }
int nVarianti = DettPraticaLocalServiceUtil.countCompletedByIntPraticaAndTipoPratica(intPraticaId,
int nVarianti = DettPraticaLocalServiceUtil.countCompletedByIntPraticaAndTipoPratica(intPraticaId, Arrays.asList(new String[]{TipoIntegrazioneUtil.VARIANTE})); Arrays.asList(new String[]{ TipoIntegrazioneUtil.VARIANTE }));
int nCambioSoggetti = DettPraticaLocalServiceUtil.countCompletedByIntPraticaAndTipoPratica(intPraticaId, Arrays.asList(new String[]{TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO})); int nCambioSoggetti = DettPraticaLocalServiceUtil.countCompletedByIntPraticaAndTipoPratica(intPraticaId,
Arrays.asList(new String[]{ TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO }));
int nFineLavori = FineLavoriLocalServiceUtil.countByIntPraticaId_Completata(intPraticaId, true); int nFineLavori = FineLavoriLocalServiceUtil.countByIntPraticaId_Completata(intPraticaId, true);
int nCollaudo = CollaudoLocalServiceUtil.countByIntPraticaId_Completata(intPraticaId, true); int nCollaudo = CollaudoLocalServiceUtil.countByIntPraticaId_Completata(intPraticaId, true);
String hide1 = (intPratica.getTipoProcedura().equals(Constants.PROCEDURA_Q1)
String hide1 = (intPratica.getTipoProcedura().equals(Constants.PROCEDURA_Q1) || intPratica.getTipoProcedura().equals(Constants.PROCEDURA_P1) ? "hideSection" : ""); || intPratica.getTipoProcedura().equals(Constants.PROCEDURA_P1) ? "hideSection" : StringPool.BLANK);
String hide3 = (intPratica.getTipoProcedura().equals(Constants.PROCEDURA_Q3) || intPratica.getTipoProcedura().equals(Constants.PROCEDURA_P3) ? "hideSection" : ""); String hide3 = (intPratica.getTipoProcedura().equals(Constants.PROCEDURA_Q3)
String hide8 = (intPratica.getTipoProcedura().equals(Constants.PROCEDURA_Q8) || intPratica.getTipoProcedura().equals(Constants.PROCEDURA_P8) ? "hideSection" : ""); || intPratica.getTipoProcedura().equals(Constants.PROCEDURA_P3) ? "hideSection" : StringPool.BLANK);
String hide9 = (intPratica.getTipoProcedura().equals(Constants.PROCEDURA_Q9) || intPratica.getTipoProcedura().equals(Constants.PROCEDURA_P9) ? "hideSection" : ""); String hide8 = (intPratica.getTipoProcedura().equals(Constants.PROCEDURA_Q8)
String hide10 = (intPratica.getTipoProcedura().equals(Constants.PROCEDURA_Q10) || intPratica.getTipoProcedura().equals(Constants.PROCEDURA_P10) ? "hideSection" : ""); || intPratica.getTipoProcedura().equals(Constants.PROCEDURA_P8) ? "hideSection" : StringPool.BLANK);
String hide9 = (intPratica.getTipoProcedura().equals(Constants.PROCEDURA_Q9)
|| intPratica.getTipoProcedura().equals(Constants.PROCEDURA_P9) ? "hideSection" : StringPool.BLANK);
String hide10 = (intPratica.getTipoProcedura().equals(Constants.PROCEDURA_Q10)
|| intPratica.getTipoProcedura().equals(Constants.PROCEDURA_P10) ? "hideSection" : StringPool.BLANK);
%> %>
<div class="container-fluid fascicolo-header"> <div class="container-fluid fascicolo-header">
<div class="row"> <div class="row">
<div class="col-sm-2 col-md-2"> <div class="col-sm-2 col-md-2">
<span class="bg-success img-thumbnail" style="width: 80px;height: 80px; font-size: 70px; line-height: 70px; vertical-align: middle; text-align: center;"> <span class="bg-success img-thumbnail"
<c:if test="<%=Constants.TIPO_PRATICA_AUTORIZZAZIONE.equalsIgnoreCase(intPratica.getTipoPratica()) %>"> style="width: 80px;height: 80px; font-size: 70px; line-height: 70px; vertical-align: middle; text-align: center;">
<c:if test="<%= Constants.TIPO_PRATICA_AUTORIZZAZIONE.equals(intPratica.getTipoPratica()) %>">
A A
</c:if> </c:if>
<c:if test="<%=Constants.TIPO_PRATICA_DEPOSITO .equalsIgnoreCase(intPratica.getTipoPratica()) %>"> <c:if test="<%= Constants.TIPO_PRATICA_DEPOSITO .equals(intPratica.getTipoPratica()) %>">
D D
</c:if> </c:if>
</span> </span>
</div> </div>
<div class="col-sm-10 col-md-10"> <div class="col-sm-10 col-md-10">
<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-2 col-md-2"> <div class="col-sm-2 col-md-2">
@ -93,11 +78,17 @@
</div> </div>
<div class="col-sm-4 col-md-4"> <div class="col-sm-4 col-md-4">
<strong> <strong>
<% if(intPratica.getValidata()) { %> <%
if (intPratica.getValidata()) {
%>
<span class="fa fa-check" style="color:green"></span> <span class="fa fa-check" style="color:green"></span>
<% }else { %> <%
} else {
%>
<span class="fa fa-times" style="color:red"></span> <span class="fa fa-times" style="color:red"></span>
<% } %> <%
}
%>
</strong> </strong>
</div> </div>
<div class="col-sm-2 col-md-2"> <div class="col-sm-2 col-md-2">
@ -112,13 +103,18 @@
Tipologia: Tipologia:
</div> </div>
<div class="col-sm-4 col-md-4"> <div class="col-sm-4 col-md-4">
<strong><%= LanguageUtil.get(pageContext, "tipo-pratica-"+intPratica.getTipoPratica()) %></strong> <strong>
<%= LanguageUtil.get(pageContext, "tipo-pratica-" + intPratica.getTipoPratica()) %>
</strong>
</div> </div>
<div class="col-sm-2 col-md-2"> <div class="col-sm-2 col-md-2">
Stato: Stato:
</div> </div>
<div class="col-sm-4 col-md-4"> <div class="col-sm-4 col-md-4">
<strong><%= LanguageUtil.get(pageContext, PraticaUtil.getStatoPraticaLabel(intPratica.getStatoPratica(), intPratica.getTipoProcedura())) %></strong> <strong>
<%= LanguageUtil.get(pageContext, PraticaUtil.getStatoPraticaLabel(
intPratica.getStatoPratica(), intPratica.getTipoProcedura())) %>
</strong>
</div> </div>
</div> </div>
</div> </div>
@ -129,106 +125,176 @@
<div class="row"> <div class="row">
<div class="col-sm-7 col-md-7"> <div class="col-sm-7 col-md-7">
<div class="module-group"> <div class="module-group">
<liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="fascicolo_title_progetti" > <liferay-ui:panel extended="false" defaultState="open" collapsible="false"
title="fascicolo_title_progetti">
<div class="col-sm-6 col-md-3"> <div class="col-sm-6 col-md-3">
<% if(nVarianti == 0 ) { %> <%
Varianti <strong><span class="fa fa-circle-o" style="color:orange"></span> Non presentate</strong> if (nVarianti == 0) {
<% } else if(nVarianti == 1 ) { %> %>
Variante <strong><span class="fa fa-check" style="color:green"></span> Presentata <%=nVarianti %> volta</strong> Varianti
<% } else { %> <strong><span class="fa fa-circle-o" style="color:orange"></span> non presentate</strong>
Varianti <strong><span class="fa fa-check" style="color:green"></span> Presentate <%=nVarianti %> volte</strong> <%
} else if (nVarianti == 1) { %>
Variante
<strong><span class="fa fa-check" style="color:green"></span> presentata 1 volta</strong>
<%
} else {
%>
Varianti
<strong>
<span class="fa fa-check" style="color:green"></span> presentate <%= nVarianti %> volte
</strong>
<% } %> <% } %>
</div> </div>
<div class="col-sm-6 col-md-3"> <div class="col-sm-6 col-md-3">
<% if(nCambioSoggetti == 0 ) { %> Cambio soggetti
Cambio soggetti <strong><span class="fa fa-circle-o" style="color:orange"></span> Non presentata</strong> <%
<% } else if(nCambioSoggetti == 1 ) { %> if (nCambioSoggetti == 0) {
Cambio soggetti <strong><span class="fa fa-check" style="color:green"></span> Presentata <%=nCambioSoggetti %> volta</strong> %>
<% } else { %> <strong><span class="fa fa-circle-o" style="color:orange"></span> non presentato</strong>
Cambio soggetti <strong><span class="fa fa-check" style="color:green"></span> Presentata <%=nCambioSoggetti %> volte</strong> <%
<% } %> } else if (nCambioSoggetti == 1) {
%>
<strong><span class="fa fa-check" style="color:green"></span> presentato 1 volta</strong>
<%
} else {
%>
<strong>
<span class="fa fa-check" style="color:green"></span>
presentato <%= nCambioSoggetti %> volte
</strong>
<%
}
%>
</div> </div>
<div class="col-sm-6 col-md-3"> <div class="col-sm-6 col-md-3">
<% if(nFineLavori == 0 ) { %> Fine Lavori
Fine Lavori <strong><span class="fa fa-close txt-red"></span> Non presentata</strong> <%
<% } else if(nVarianti == 1 ) { %> if (nFineLavori == 0) {
Fine Lavori <strong><span class="fa fa-check txt-green"></span> Presentata <%=nFineLavori %> volta</strong> %>
<% } else { %> <strong><span class="fa fa-close txt-red"></span> non presentata</strong>
Fine Lavori <strong><span class="fa fa-check txt-green"></span> Presentata <%=nFineLavori %> volte</strong> <%
} else if (nFineLavori == 1 ) {
%>
<strong><span class="fa fa-check txt-green"></span> presentata 1 volta</strong>
<%
} else {
%>
<strong>
<span class="fa fa-check txt-green"></span> presentata <%= nFineLavori %> volte
</strong>
<% } %> <% } %>
</div> </div>
<div class="col-sm-6 col-md-3"> <div class="col-sm-6 col-md-3">
<% if(nCollaudo == 0 ) { %> Collaudo
Collaudo <strong><span class="fa fa-close" style="color:red"></span> Non presentato</strong> <%
<% } else if(nCollaudo == 1 ) { %> if (nCollaudo == 0 ) {
Collaudo <strong><span class="fa fa-check" style="color:green"></span> Presentato <%=nFineLavori %> volta</strong> %>
<% } else { %> <strong><span class="fa fa-close" style="color:red"></span> non presentato</strong>
Collaudo <strong><span class="fa fa-check" style="color:green"></span> Presentato <%=nFineLavori %> volte</strong> <%
<% } %> } else if (nCollaudo == 1 ) {
%>
<strong><span class="fa fa-check" style="color:green"></span> presentato 1 volta</strong>
<%
} else {
%>
<strong>
<span class="fa fa-check" style="color:green"></span> Presentato <%= nCollaudo %> volte
</strong>
<%
}
%>
</div> </div>
</liferay-ui:panel> </liferay-ui:panel>
</div> </div>
<div class="module-group <%= hide10 %>"> <div class="module-group <%= hide10 %>">
<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">
<%= BeanPropertiesUtil.getString(dettPratica, "descLongIntervento") %> <%= BeanPropertiesUtil.getString(dettPratica, "descLongIntervento") %>
</div> </div>
</liferay-ui:panel> </liferay-ui:panel>
</div> </div>
<div class="module-group <%= hide1 %> <%= hide10 %>"> <div class="module-group <%= hide1 %> <%= hide10 %>">
<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">
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">
<strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "tcNuovaCostruzione") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong> <strong>
<span class='<%= BeanPropertiesUtil.getBoolean(dettPratica, "tcNuovaCostruzione") ?
"fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span>
</strong>
<%= LanguageUtil.get(pageContext, "tc-nuova-costruzione") %> <%= LanguageUtil.get(pageContext, "tc-nuova-costruzione") %>
</div> </div>
<div class="col-sm-12"> <div class="col-sm-12">
<strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "tcNuovaCostruzionePertinenza") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong> <strong>
<span class='<%= BeanPropertiesUtil.getBoolean(dettPratica,
"tcNuovaCostruzionePertinenza") ? "fa fa-check-circle-o txt-green"
: "fa fa-circle-o" %>'></span>
</strong>
<%= LanguageUtil.get(pageContext, "tc-nuova-costruzione-pertinenza") %> <%= LanguageUtil.get(pageContext, "tc-nuova-costruzione-pertinenza") %>
</div> </div>
<div class="col-sm-12"> <div class="col-sm-12">
<strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "tcCostruzioniEsistenti") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong> <strong>
<span class='<%= BeanPropertiesUtil.getBoolean(dettPratica,
"tcCostruzioniEsistenti") ? "fa fa-check-circle-o txt-green"
: "fa fa-circle-o" %>'></span>
</strong>
<%= LanguageUtil.get(pageContext, "tc-costruzioni-esistenti") %> <%= LanguageUtil.get(pageContext, "tc-costruzioni-esistenti") %>
</div> </div>
<div class="col-sm-12"> <div class="col-sm-12">
<strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "tcManutOrdStraord") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong> <strong>
<span class='<%= BeanPropertiesUtil.getBoolean(dettPratica,
"tcManutOrdStraord") ? "fa fa-check-circle-o txt-green"
: "fa fa-circle-o" %>'></span>
</strong>
<%= LanguageUtil.get(pageContext, "tc-manut-ord-straord") %> <%= LanguageUtil.get(pageContext, "tc-manut-ord-straord") %>
</div> </div>
<div class="col-sm-12"> <div class="col-sm-12">
<strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "tcInterventoOpereEscavazione") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong> <strong>
<span class='<%= BeanPropertiesUtil.getBoolean(dettPratica,
"tcInterventoOpereEscavazione") ? "fa fa-check-circle-o txt-green"
: "fa fa-circle-o" %>'></span>
</strong>
<%= LanguageUtil.get(pageContext, "tc-intervento-opere-escavazione") %> <%= LanguageUtil.get(pageContext, "tc-intervento-opere-escavazione") %>
</div> </div>
<div class="col-sm-12 <%= hide8 %> <%= hide9 %>"> <div class="col-sm-12 <%= hide8 %> <%= hide9 %>">
<strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "tcNoOpereEscavazione") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong> <strong>
<span class='<%= BeanPropertiesUtil.getBoolean(dettPratica,
"tcNoOpereEscavazione") ? "fa fa-check-circle-o txt-green"
: "fa fa-circle-o" %>'></span>
</strong>
<%= LanguageUtil.get(pageContext, "tc-no-opere-escavazione") %> <%= LanguageUtil.get(pageContext, "tc-no-opere-escavazione") %>
</div> </div>
<div class="col-sm-12"> <div class="col-sm-12">
<strong><span class='<%=BeanPropertiesUtil.getBoolean(dettPratica, "tcAltriInterventi") ? "fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span></strong> <strong>
<span class='<%= BeanPropertiesUtil.getBoolean(dettPratica, "tcAltriInterventi") ?
"fa fa-check-circle-o txt-green" : "fa fa-circle-o" %>'></span>
</strong>
<%= LanguageUtil.get(pageContext, "tc-altri-interventi") %> <%= LanguageUtil.get(pageContext, "tc-altri-interventi") %>
</div> </div>
<div class="col-sm-12"> <div class="col-sm-12">
<%= BeanPropertiesUtil.getString(dettPratica, "tcAltriInterventiDesc") %> <%= BeanPropertiesUtil.getString(dettPratica, "tcAltriInterventiDesc") %>
</div> </div>
</div> </div>
</div> </div>
</liferay-ui:panel> </liferay-ui:panel>
</div> </div>
<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="container-fluid"> <div class="container-fluid">
<% <%
List<Soggetto> committenti = SoggettoLocalServiceUtil.getValidByIntPratica_TipologiaSoggetto(intPraticaId, TipoSoggettoUtil.COMMITTENTE); List<Soggetto> committenti = SoggettoLocalServiceUtil.getValidByIntPratica_TipologiaSoggetto(
intPraticaId, TipoSoggettoUtil.COMMITTENTE);
%> %>
<c:if test="<%= !committenti.isEmpty() %>"> <c:if test="<%= !committenti.isEmpty() %>">
<div class="row"> <div class="row">
<div class="col-sm-12 col-md-12"> <div class="col-sm-12 col-md-12">
<div class="fascicolo_header_row"><%=LanguageUtil.get(pageContext, "gc-soggetto-02") %>:</div> <div class="fascicolo_header_row">
<%= LanguageUtil.get(pageContext, "gc-soggetto-02") %>:
</div>
</div> </div>
</div> </div>
<% <%
@ -266,12 +332,15 @@
</div> </div>
</c:if> </c:if>
<% <%
List<Soggetto> progettisti = SoggettoLocalServiceUtil.getValidByIntPratica_TipologiaSoggetto(intPraticaId, TipoSoggettoUtil.PROGETTISTA); List<Soggetto> progettisti = SoggettoLocalServiceUtil.getValidByIntPratica_TipologiaSoggetto(
intPraticaId, TipoSoggettoUtil.PROGETTISTA);
%> %>
<c:if test="<%= !progettisti.isEmpty() %>"> <c:if test="<%= !progettisti.isEmpty() %>">
<div class="row"> <div class="row">
<div class="col-sm-12 col-md-12"> <div class="col-sm-12 col-md-12">
<div class="fascicolo_header_row"><%=LanguageUtil.get(pageContext, "gc-soggetto-06") %>:</div> <div class="fascicolo_header_row">
<%= LanguageUtil.get(pageContext, "gc-soggetto-06") %>:
</div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
@ -296,11 +365,14 @@
</div> </div>
</c:if> </c:if>
<% <%
List<Soggetto> direttori = SoggettoServiceUtil.getValidByIntPratica_TipologiaSoggetto(intPraticaId, TipoSoggettoUtil.DIRETTORE_LAVORI); List<Soggetto> direttori = SoggettoServiceUtil.getValidByIntPratica_TipologiaSoggetto(
intPraticaId, TipoSoggettoUtil.DIRETTORE_LAVORI);
%> %>
<div class="row"> <div class="row">
<div class="col-sm-12 col-md-12"> <div class="col-sm-12 col-md-12">
<div class="fascicolo_header_row"><%=LanguageUtil.get(pageContext, "gc-soggetto-03") %>:</div> <div class="fascicolo_header_row">
<%= LanguageUtil.get(pageContext, "gc-soggetto-03") %>:
</div>
</div> </div>
</div> </div>
<c:if test="<%= !direttori.isEmpty() %>"> <c:if test="<%= !direttori.isEmpty() %>">
@ -330,15 +402,17 @@
</div> </div>
<div class="module-group sezione-pagamenti"> <div class="module-group sezione-pagamenti">
<liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="fascicolo_title_pagamenti"> <liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="fascicolo_title_pagamenti">
<liferay-util:include page="/html/pagamenti/view_panel_pagamenti.jsp" servletContext='<%= ServletContextPool.get("portos-bo-portlet") %>'> <liferay-util:include page="/html/pagamenti/view_panel_pagamenti.jsp"
<liferay-util:param name="dettPraticaId" value="<%= String.valueOf(dettPraticaId) %>"></liferay-util:param> servletContext='<%= ServletContextPool.get("portos-bo-portlet") %>'>
<liferay-util:param name="dettPraticaId" value="<%= String.valueOf(dettPraticaId) %>" />
</liferay-util:include> </liferay-util:include>
</liferay-ui:panel> </liferay-ui:panel>
</div> </div>
</div> </div>
<div class="col-sm-5 col-md-5"> <div class="col-sm-5 col-md-5">
<div class="module-group"> <div class="module-group">
<liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="fascicolo_title_ubicazione" > <liferay-ui:panel extended="false" defaultState="open" collapsible="false"
title="fascicolo_title_ubicazione">
<div class="container-fluid"> <div class="container-fluid">
<div class="row <%= hide1 %>"> <div class="row <%= hide1 %>">
<div class="col-sm-6 col-md-6"> <div class="col-sm-6 col-md-6">
@ -409,7 +483,6 @@
<%= LanguageUtil.get(pageContext, "dc-allegato") %> <%= LanguageUtil.get(pageContext, "dc-allegato") %>
</div> </div>
<div class="col-sm-6 col-md-3"> <div class="col-sm-6 col-md-3">
<strong><%= BeanPropertiesUtil.getString(dettPratica, "dcAllegato") %></strong> <strong><%= BeanPropertiesUtil.getString(dettPratica, "dcAllegato") %></strong>
</div> </div>
</div> </div>
@ -426,5 +499,4 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>

1
liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/.classpath

@ -19,5 +19,6 @@
<attribute name="org.eclipse.jst.component.nondependency" value=""/> <attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="con" path="org.apache.ivyde.eclipse.cpcontainer.IVYDE_CONTAINER/?project=portos-kaleo-portlet&amp;ivyXmlPath=ivy.xml&amp;confs=*"/>
<classpathentry kind="output" path="docroot/WEB-INF/classes"/> <classpathentry kind="output" path="docroot/WEB-INF/classes"/>
</classpath> </classpath>

1
liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/.project

@ -32,5 +32,6 @@
<nature>org.eclipse.wst.common.project.facet.core.nature</nature> <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature> <nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature> <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
<nature>org.apache.ivyde.eclipse.ivynature</nature>
</natures> </natures>
</projectDescription> </projectDescription>

3
liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/build.xml

@ -2,7 +2,6 @@
<!DOCTYPE project> <!DOCTYPE project>
<project name="portos-kaleo-portlet" basedir="." default="deploy"> <project name="portos-kaleo-portlet" basedir="." default="deploy">
<import file="../build-common-portlet.xml" />
<property name="import.shared" value="portos-kaleo-shared" /> <property name="import.shared" value="portos-kaleo-shared" />
<import file="../build-common-portlet.xml" />
</project> </project>

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

File binario non mostrato.

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

File binario non mostrato.

40
liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/kaleo/NoSuchFormDefinitionLinkException.java

@ -0,0 +1,40 @@
/**
* Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is 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;
import com.liferay.portal.NoSuchModelException;
/**
* @author
*/
public class NoSuchFormDefinitionLinkException extends NoSuchModelException {
public NoSuchFormDefinitionLinkException() {
super();
}
public NoSuchFormDefinitionLinkException(String msg) {
super(msg);
}
public NoSuchFormDefinitionLinkException(String msg, Throwable cause) {
super(msg, cause);
}
public NoSuchFormDefinitionLinkException(Throwable cause) {
super(cause);
}
}

40
liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/kaleo/NoSuchFormLogException.java

@ -0,0 +1,40 @@
/**
* Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is 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;
import com.liferay.portal.NoSuchModelException;
/**
* @author
*/
public class NoSuchFormLogException extends NoSuchModelException {
public NoSuchFormLogException() {
super();
}
public NoSuchFormLogException(String msg) {
super(msg);
}
public NoSuchFormLogException(String msg, Throwable cause) {
super(msg, cause);
}
public NoSuchFormLogException(Throwable cause) {
super(cause);
}
}

40
liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/kaleo/NoSuchFormTemplateLinkException.java

@ -0,0 +1,40 @@
/**
* Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is 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;
import com.liferay.portal.NoSuchModelException;
/**
* @author
*/
public class NoSuchFormTemplateLinkException extends NoSuchModelException {
public NoSuchFormTemplateLinkException() {
super();
}
public NoSuchFormTemplateLinkException(String msg) {
super(msg);
}
public NoSuchFormTemplateLinkException(String msg, Throwable cause) {
super(msg, cause);
}
public NoSuchFormTemplateLinkException(Throwable cause) {
super(cause);
}
}

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

@ -40,7 +40,7 @@ import com.liferay.util.bridges.mvc.MVCPortlet;
public class WorkflowFormAdminPortlet extends MVCPortlet { public class WorkflowFormAdminPortlet extends MVCPortlet {
private final static Log _log = LogFactoryUtil.getLog(WorkflowFormAdminPortlet.class); private static final Log _log = LogFactoryUtil.getLog(WorkflowFormAdminPortlet.class);
public void editFormDefinitionLink(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { public void editFormDefinitionLink(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {

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

@ -13,8 +13,8 @@
## ##
build.namespace=portos_Kaleo build.namespace=portos_Kaleo
build.number=18 build.number=20
build.date=1604403556778 build.date=1631718661033
build.auto.upgrade=true build.auto.upgrade=true
## ##

12
liferay-plugins-sdk-6.2/portlets/portos-log-portlet/docroot/WEB-INF/src/it/tref/portos/liferay/log/constants/LogConstants.java

@ -2,17 +2,13 @@ package it.tref.portos.liferay.log.constants;
public class LogConstants { public class LogConstants {
/*
* Message
*/
public enum LogProcessMode { public enum LogProcessMode {
ASYNC, SYNC ASYNC, SYNC
} }
public final static String COMPANY_ID = "companyId"; public static final String COMPANY_ID = "companyId";
public final static String USER_ID = "userId"; public static final String USER_ID = "userId";
public final static String CONTENT = "payload"; public static final String CONTENT = "payload";
public final static String PARAM_PROCESS_MODE = "processMode";
public static final String PARAM_PROCESS_MODE = "processMode";
} }

9
liferay-plugins-sdk-6.2/portlets/portos-log-portlet/docroot/WEB-INF/src/it/tref/portos/liferay/log/constants/LogDestinationNames.java

@ -2,10 +2,9 @@ package it.tref.portos.liferay.log.constants;
public class LogDestinationNames { public class LogDestinationNames {
public final static String SERIAL = "liferay/tref/portos/monitoring_serial"; public static final String SERIAL = "liferay/tref/portos/monitoring_serial";
public final static String SYNC = "liferay/tref/portos/monitoring_sync"; public static final String SYNC = "liferay/tref/portos/monitoring_sync";
public final static String REST_SERVICE_URL = "http://rt-saas-tc01-s2.rt.tix.it:9888/logcollector";
public final static String REST_SERVICE_PORT = "9090";
public static final String REST_SERVICE_URL = "http://rt-saas-tc01-s2.rt.tix.it:9888/logcollector";
public static final String REST_SERVICE_PORT = "9090";
} }

47
liferay-plugins-sdk-6.2/portlets/portos-log-portlet/docroot/WEB-INF/src/it/tref/portos/liferay/log/constants/LogFormat.java

@ -3,32 +3,31 @@ package it.tref.portos.liferay.log.constants;
public class LogFormat { public class LogFormat {
/*** Mandatory ***/ /*** Mandatory ***/
public final static String HOSTNAME = "host"; public static final String HOSTNAME = "host";
public final static String IP_ADDRESS = "ipAddress"; public static final String IP_ADDRESS = "ipAddress";
public final static String DATA_EVENTO = "requestDate"; public static final String DATA_EVENTO = "requestDate";
public final static String COD_PROC = "processCode"; public static final String COD_PROC = "processCode";
public final static String COD_APP = "serverId"; public static final String COD_APP = "serverId";
public final static String ID_ISTANZA = "instanceId"; public static final String ID_ISTANZA = "instanceId";
public final static String PROG_EVENTO = "eventProgressive"; public static final String PROG_EVENTO = "eventProgressive";
public final static String COD_ATT = "activityCode"; public static final String COD_ATT = "activityCode";
public final static String COD_ESITO_EVENTO = "status"; public static final String COD_ESITO_EVENTO = "status";
public final static String TIPO_EVENTO = "eventType"; public static final String TIPO_EVENTO = "eventType";
/*** Optional ***/ /*** Optional ***/
public final static String ID_OPERATORE = "userId"; public static final String ID_OPERATORE = "userId";
/*** Labels ***/ /*** Labels ***/
public final static String HOSTNAME_LABEL = "hostname"; public static final String HOSTNAME_LABEL = "hostname";
public final static String IP_ADDRESS_LABEL = "ipAddress"; public static final String IP_ADDRESS_LABEL = "ipAddress";
public final static String DATA_EVENTO_LABEL = "dataEvento"; public static final String DATA_EVENTO_LABEL = "dataEvento";
public final static String COD_PROC_LABEL = "codProc"; public static final String COD_PROC_LABEL = "codProc";
public final static String COD_APP_LABEL = "codApp"; public static final String COD_APP_LABEL = "codApp";
public final static String ID_ISTANZA_LABEL = "idIstanza"; public static final String ID_ISTANZA_LABEL = "idIstanza";
public final static String PROG_EVENTO_LABEL = "progEvento"; public static final String PROG_EVENTO_LABEL = "progEvento";
public final static String COD_ATT_LABEL = "codAtt"; public static final String COD_ATT_LABEL = "codAtt";
public final static String COD_ESITO_EVENTO_LABEL = "codEsitoEvento"; public static final String COD_ESITO_EVENTO_LABEL = "codEsitoEvento";
public final static String TIPO_EVENTO_LABEL = "tipoEvento"; public static final String TIPO_EVENTO_LABEL = "tipoEvento";
public final static String ID_OPERATORE_LABEL = "idOperatore"; public static final String ID_OPERATORE_LABEL = "idOperatore";
public final static String COMPLEX_DATA_LABEL = "ComplexData"; public static final String COMPLEX_DATA_LABEL = "ComplexData";
} }

1
liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/.classpath

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" path="docroot/WEB-INF/src"/> <classpathentry kind="src" path="docroot/WEB-INF/src"/>
<classpathentry kind="src" path="docroot/WEB-INF/service"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.7.0_80"> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.7.0_80">
<attributes> <attributes>
<attribute name="owner.project.facets" value="java"/> <attribute name="owner.project.facets" value="java"/>

1
liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/.settings/org.eclipse.wst.common.component

@ -2,6 +2,7 @@
<wb-module deploy-name="portos-mail-manager-portlet"> <wb-module deploy-name="portos-mail-manager-portlet">
<wb-resource deploy-path="/" source-path="/docroot" tag="defaultRootSource"/> <wb-resource deploy-path="/" source-path="/docroot" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/docroot/WEB-INF/src"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/docroot/WEB-INF/src"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/docroot/WEB-INF/service"/>
<property name="context-root" value="portos-mail-manager-portlet"/> <property name="context-root" value="portos-mail-manager-portlet"/>
<property name="java-output-path" value="/portos-mail-manager-portlet/docroot/WEB-INF/classes"/> <property name="java-output-path" value="/portos-mail-manager-portlet/docroot/WEB-INF/classes"/>
</wb-module> </wb-module>

3
liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/mailmanager/model/EmailConstants.java

@ -2,6 +2,5 @@ package it.tref.liferay.portos.mailmanager.model;
public class EmailConstants { public class EmailConstants {
public final static String DEFAULT_ATTACHMENTS_FOLDER_NAME = "MailManager_EmailAttachments"; public static final String DEFAULT_ATTACHMENTS_FOLDER_NAME = "MailManager_EmailAttachments";
} }

24
liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/hook/events/StartupAction.java

@ -22,31 +22,23 @@ import com.liferay.portlet.documentlibrary.service.DLFolderLocalServiceUtil;
public class StartupAction extends SimpleAction { public class StartupAction extends SimpleAction {
private final static Log _log = LogFactoryUtil.getLog(StartupAction.class); private static final Log _log = LogFactoryUtil.getLog(StartupAction.class);
@Override @Override
public void run(String[] ids) throws ActionException { public void run(String[] ids) throws ActionException {
for (String id : ids) { for (String id : ids) {
long companyId = GetterUtil.getLong(id); long companyId = GetterUtil.getLong(id);
try { try {
Company company = CompanyLocalServiceUtil.getCompany(companyId); Company company = CompanyLocalServiceUtil.getCompany(companyId);
Group companyGroup = company.getGroup(); Group companyGroup = company.getGroup();
User userDefault = company.getDefaultUser(); User userDefault = company.getDefaultUser();
// Folders // Folders
String[] groupActions = { ActionKeys.VIEW }; String[] groupActions = { ActionKeys.VIEW };
String[] guestActions = { ActionKeys.VIEW }; String[] guestActions = { ActionKeys.VIEW };
addDLFolderIfNotExists(userDefault.getUserId(), companyGroup.getGroupId(), companyGroup.getGroupId(), addDLFolderIfNotExists(userDefault.getUserId(), companyGroup.getGroupId(), companyGroup.getGroupId(),
DLFolderConstants.DEFAULT_PARENT_FOLDER_ID, EmailConstants.DEFAULT_ATTACHMENTS_FOLDER_NAME, true, DLFolderConstants.DEFAULT_PARENT_FOLDER_ID, EmailConstants.DEFAULT_ATTACHMENTS_FOLDER_NAME,
groupActions, guestActions); true, groupActions, guestActions);
} catch (Exception e) { } catch (Exception e) {
_log.error(e, e); _log.error(e, e);
} }
@ -58,27 +50,19 @@ public class StartupAction extends SimpleAction {
SystemException { SystemException {
DLFolder dlFolder = null; DLFolder dlFolder = null;
try { try {
dlFolder = DLFolderLocalServiceUtil.getFolder(groupId, parentFolderId, name); dlFolder = DLFolderLocalServiceUtil.getFolder(groupId, parentFolderId, name);
} catch (PortalException e) { } catch (PortalException e) {
ServiceContext serviceContext = new ServiceContext(); ServiceContext serviceContext = new ServiceContext();
if (groupActions != null) { if (groupActions != null) {
serviceContext.setGroupPermissions(groupActions); serviceContext.setGroupPermissions(groupActions);
} }
if (guestActions != null) { if (guestActions != null) {
serviceContext.setGuestPermissions(guestActions); serviceContext.setGuestPermissions(guestActions);
} }
dlFolder = DLFolderLocalServiceUtil.addFolder(userId, groupId, repositoryId, false, parentFolderId, name,
dlFolder =
DLFolderLocalServiceUtil.addFolder(userId, groupId, repositoryId, false, parentFolderId, name,
StringPool.BLANK, hidden, serviceContext); StringPool.BLANK, hidden, serviceContext);
} }
return dlFolder; return dlFolder;
} }
} }

67
liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/service/impl/EmailAttachmentLocalServiceImpl.java

@ -1,18 +1,21 @@
/** /**
* Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. The contents of this file are subject to the terms of the
* * Liferay Enterprise Subscription License ("License"). You may not use this file except in compliance with the License.
* The contents of this file are subject to the terms of the Liferay Enterprise Subscription License * You can obtain a copy of the License by contacting Liferay, Inc. See the License for the specific language governing
* ("License"). You may not use this file except in compliance with the License. You can obtain a * permissions and limitations under the License, including but not limited to distribution rights of the Software.
* copy of the License by contacting Liferay, Inc. See the License for the specific language
* governing permissions and limitations under the License, including but not limited to
* distribution rights of the Software.
*
*
*
*/ */
package it.tref.liferay.portos.mailmanager.service.impl; package it.tref.liferay.portos.mailmanager.service.impl;
import it.tref.liferay.portos.mailmanager.EmailAttachmentFileException;
import it.tref.liferay.portos.mailmanager.EmailAttachmentTitleException;
import it.tref.liferay.portos.mailmanager.NoSuchEmailException;
import it.tref.liferay.portos.mailmanager.model.EmailAttachment;
import it.tref.liferay.portos.mailmanager.service.base.EmailAttachmentLocalServiceBaseImpl;
import it.tref.liferay.portos.mailmanager.service.persistence.EmailAttachmentPK;
import java.io.File;
import java.util.List;
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;
@ -27,27 +30,14 @@ import com.liferay.portal.model.User;
import com.liferay.portal.security.permission.ActionKeys; import com.liferay.portal.security.permission.ActionKeys;
import com.liferay.portal.service.ServiceContext; import com.liferay.portal.service.ServiceContext;
import it.tref.liferay.portos.mailmanager.EmailAttachmentFileException;
import it.tref.liferay.portos.mailmanager.EmailAttachmentTitleException;
import it.tref.liferay.portos.mailmanager.NoSuchEmailException;
import it.tref.liferay.portos.mailmanager.model.EmailAttachment;
import it.tref.liferay.portos.mailmanager.service.base.EmailAttachmentLocalServiceBaseImpl;
import it.tref.liferay.portos.mailmanager.service.persistence.EmailAttachmentPK;
import java.io.File;
import java.util.List;
/** /**
* The implementation of the email attachment local service. * The implementation of the email attachment local service.
*
* <p> * <p>
* All custom service methods should be put in this class. Whenever methods are added, rerun * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy
* ServiceBuilder to copy their definitions into the * their definitions into the {@link it.noovle.azimut.icf.mailmanager.service.EmailAttachmentLocalService} interface.
* {@link it.noovle.azimut.icf.mailmanager.service.EmailAttachmentLocalService} interface.
*
* <p> * <p>
* This is a local service. Methods of this service will not have security checks based on the * This is a local service. Methods of this service will not have security checks based on the propagated JAAS
* propagated JAAS credentials because this service can only be accessed from within the same VM. * credentials because this service can only be accessed from within the same VM.
* </p> * </p>
* *
* @author * @author
@ -56,12 +46,11 @@ import java.util.List;
*/ */
public class EmailAttachmentLocalServiceImpl extends EmailAttachmentLocalServiceBaseImpl { public class EmailAttachmentLocalServiceImpl extends EmailAttachmentLocalServiceBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link
* * it.noovle.azimut.icf.mailmanager.service.EmailAttachmentLocalServiceUtil} to access the email attachment local
* Never reference this interface directly. Always use {@link * service.
* it.noovle.azimut.icf.mailmanager.service.EmailAttachmentLocalServiceUtil} to access the
* email attachment local service.
*/ */
@Override
public EmailAttachment addEmailAttachment(long companyId, long emailId, long folderId, String fileName, File file) public EmailAttachment addEmailAttachment(long companyId, long emailId, long folderId, String fileName, File file)
throws PortalException, SystemException { throws PortalException, SystemException {
@ -90,15 +79,16 @@ public class EmailAttachmentLocalServiceImpl extends EmailAttachmentLocalService
sourceFileName, mimeType, title, StringPool.BLANK, StringPool.BLANK, file, serviceContext); sourceFileName, mimeType, title, StringPool.BLANK, StringPool.BLANK, file, serviceContext);
EmailAttachment emailAttachment = EmailAttachment emailAttachment =
emailAttachmentLocalService.createEmailAttachment(new EmailAttachmentPK(emailId, fileEntry.getFileEntryId())); createEmailAttachment(new EmailAttachmentPK(emailId, fileEntry
.getFileEntryId()));
return emailAttachmentLocalService.addEmailAttachment(emailAttachment); return addEmailAttachment(emailAttachment);
} }
@Override @Override
public EmailAttachment deleteEmailAttachment(EmailAttachmentPK emailAttachmentPK) throws PortalException, public EmailAttachment deleteEmailAttachment(EmailAttachmentPK emailAttachmentPK) throws PortalException,
SystemException { SystemException {
EmailAttachment emailAttachment = emailAttachmentLocalService.getEmailAttachment(emailAttachmentPK); EmailAttachment emailAttachment = getEmailAttachment(emailAttachmentPK);
return deleteEmailAttachment(emailAttachment); return deleteEmailAttachment(emailAttachment);
} }
@ -111,24 +101,27 @@ public class EmailAttachmentLocalServiceImpl extends EmailAttachmentLocalService
try { try {
dlAppLocalService.deleteFileEntry(emailAttachment.getFileEntryId()); dlAppLocalService.deleteFileEntry(emailAttachment.getFileEntryId());
} catch (PortalException e) { } catch (PortalException e) {}
}
return emailAttachment; return emailAttachment;
} }
@Override
public List<EmailAttachment> findByEmailId(long emailId) throws SystemException { public List<EmailAttachment> findByEmailId(long emailId) throws SystemException {
return emailAttachmentPersistence.findByEmailId(emailId); return emailAttachmentPersistence.findByEmailId(emailId);
} }
@Override
public List<EmailAttachment> findByEmailId(long emailId, int start, int end) throws SystemException { public List<EmailAttachment> findByEmailId(long emailId, int start, int end) throws SystemException {
return emailAttachmentPersistence.findByEmailId(emailId); return emailAttachmentPersistence.findByEmailId(emailId);
} }
@Override
public int countByEmailId(long emailId) throws SystemException { public int countByEmailId(long emailId) throws SystemException {
return emailAttachmentPersistence.countByEmailId(emailId); return emailAttachmentPersistence.countByEmailId(emailId);
} }
@Override
public EmailAttachment fetchByFileEntryId(long fileEntryId) throws SystemException { public EmailAttachment fetchByFileEntryId(long fileEntryId) throws SystemException {
return emailAttachmentPersistence.fetchByFileEntryId(fileEntryId); return emailAttachmentPersistence.fetchByFileEntryId(fileEntryId);
} }

284
liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/service/impl/EmailLocalServiceImpl.java

@ -1,36 +1,12 @@
/** /**
* Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. The contents of this file are subject to the terms of the
* * Liferay Enterprise Subscription License ("License"). You may not use this file except in compliance with the License.
* The contents of this file are subject to the terms of the Liferay Enterprise Subscription License * You can obtain a copy of the License by contacting Liferay, Inc. See the License for the specific language governing
* ("License"). You may not use this file except in compliance with the License. You can obtain a * permissions and limitations under the License, including but not limited to distribution rights of the Software.
* copy of the License by contacting Liferay, Inc. See the License for the specific language
* governing permissions and limitations under the License, including but not limited to
* distribution rights of the Software.
*
*
*
*/ */
package it.tref.liferay.portos.mailmanager.service.impl; package it.tref.liferay.portos.mailmanager.service.impl;
import com.liferay.mail.model.FileAttachment;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.repository.model.Folder;
import com.liferay.portal.kernel.util.FileUtil;
import com.liferay.portal.kernel.util.OrderByComparator;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.StringUtil;
import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.model.Company;
import com.liferay.portal.model.Group;
import com.liferay.portal.model.User;
import com.liferay.portal.security.permission.ActionKeys;
import com.liferay.portal.service.ServiceContext;
import com.liferay.portlet.documentlibrary.model.DLFolderConstants;
import it.tref.liferay.portos.mailmanager.EmailBccException; import it.tref.liferay.portos.mailmanager.EmailBccException;
import it.tref.liferay.portos.mailmanager.EmailBulkAddressesException; import it.tref.liferay.portos.mailmanager.EmailBulkAddressesException;
import it.tref.liferay.portos.mailmanager.EmailCcException; import it.tref.liferay.portos.mailmanager.EmailCcException;
@ -51,18 +27,30 @@ import java.util.Collections;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import com.liferay.mail.model.FileAttachment;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.repository.model.Folder;
import com.liferay.portal.kernel.util.FileUtil;
import com.liferay.portal.kernel.util.OrderByComparator;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.StringUtil;
import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.model.Company;
import com.liferay.portal.model.Group;
import com.liferay.portal.model.User;
import com.liferay.portal.security.permission.ActionKeys;
import com.liferay.portal.service.ServiceContext;
import com.liferay.portlet.documentlibrary.model.DLFolderConstants;
/** /**
* The implementation of the email local service. * The implementation of the email local service.
*
* <p> * <p>
* All custom service methods should be put in this class. Whenever methods are * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy
* added, rerun ServiceBuilder to copy their definitions into the * their definitions into the {@link it.noovle.azimut.icf.mailmanager.service.EmailLocalService} interface.
* {@link it.noovle.azimut.icf.mailmanager.service.EmailLocalService} interface.
*
* <p> * <p>
* This is a local service. Methods of this service will not have security * This is a local service. Methods of this service will not have security checks based on the propagated JAAS
* checks based on the propagated JAAS credentials because this service can only * credentials because this service can only be accessed from within the same VM.
* be accessed from within the same VM.
* </p> * </p>
* *
* @author * @author
@ -71,70 +59,67 @@ import java.util.List;
*/ */
public class EmailLocalServiceImpl extends EmailLocalServiceBaseImpl { public class EmailLocalServiceImpl extends EmailLocalServiceBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link
* * it.noovle.azimut.icf.mailmanager.service.EmailLocalServiceUtil} to access the email local service.
* Never reference this interface directly. Always use {@link
* it.noovle.azimut.icf.mailmanager.service.EmailLocalServiceUtil} to access
* the email local service.
*/ */
private final static Log _log = LogFactoryUtil.getLog(EmailLocalServiceImpl.class); @Override
public Email addEmail(String className, long classPK, String from, String to[], String cc[], String bcc[],
String subject, String body, boolean htmlFormat, ServiceContext serviceContext) throws Exception {
public Email addEmail(String className, long classPK, String from, String to[], String cc[], return addEmail(className, classPK, from, to, cc, bcc, null, subject, body, htmlFormat, null, null, null, null,
String bcc[], String subject, String body, boolean htmlFormat, ServiceContext serviceContext) 0, false, null, null, Collections.<FileAttachment> emptyList(), serviceContext);
throws Exception {
return addEmail(className, classPK, from, to, cc, bcc, null, subject, body, htmlFormat, null, null,
null, null, 0, false, null, null, Collections.<FileAttachment> emptyList(), serviceContext);
} }
public Email addEmail(String className, long classPK, String from, String to[], String cc[], @Override
String bcc[], String subject, String body, boolean htmlFormat, public Email addEmail(String className, long classPK, String from, String to[], String cc[], String bcc[],
List<FileAttachment> fileAttachments, ServiceContext serviceContext) throws Exception { String subject, String body, boolean htmlFormat, List<FileAttachment> fileAttachments,
return addEmail(className, classPK, from, to, cc, bcc, null, subject, body, htmlFormat, null, null, ServiceContext serviceContext) throws Exception {
null, null, 0, false, null, null, fileAttachments, false, null, serviceContext);
}
public Email addEmail(String className, long classPK, String from, String to[], String cc[], return addEmail(className, classPK, from, to, cc, bcc, null, subject, body, htmlFormat, null, null, null, null,
String bcc[], String[] bulkAddresses, String subject, String body, boolean htmlFormat, 0, false, null, null, fileAttachments, false, null, serviceContext);
String[] replyTo, String messageId, String inReplyTo, String smtpHost, int smtpPort,
boolean smtpSecure, String smtpUsername, String smtpPassword,
List<FileAttachment> fileAttachments, ServiceContext serviceContext) throws Exception {
return addEmail(className, classPK, from, to, cc, bcc, bulkAddresses, subject, body, htmlFormat,
replyTo, messageId, inReplyTo, smtpHost, smtpPort, smtpSecure, smtpUsername, smtpPassword,
fileAttachments, false, null, serviceContext);
} }
public Email addEmail(String className, long classPK, String from, String to[], String cc[], @Override
String bcc[], String subject, String body, boolean htmlFormat, public Email addEmail(String className, long classPK, String from, String to[], String cc[], String bcc[],
List<FileAttachment> fileAttachments, boolean sendSync, ServiceContext serviceContext) String[] bulkAddresses, String subject, String body, boolean htmlFormat, String[] replyTo,
throws Exception { String messageId, String inReplyTo, String smtpHost, int smtpPort, boolean smtpSecure, String smtpUsername,
return addEmail(className, classPK, from, to, cc, bcc, null, subject, body, htmlFormat, null, null, String smtpPassword, List<FileAttachment> fileAttachments, ServiceContext serviceContext) throws Exception {
null, null, 0, false, null, null, fileAttachments, sendSync, null, serviceContext);
return addEmail(className, classPK, from, to, cc, bcc, bulkAddresses, subject, body, htmlFormat, replyTo,
messageId, inReplyTo, smtpHost, smtpPort, smtpSecure, smtpUsername, smtpPassword, fileAttachments,
false, null, serviceContext);
} }
public Email addEmail(String className, long classPK, String from, String to[], String cc[], @Override
String bcc[], String subject, String body, boolean htmlFormat, public Email addEmail(String className, long classPK, String from, String to[], String cc[], String bcc[],
List<FileAttachment> fileAttachments, boolean sendSync, String templateName, String subject, String body, boolean htmlFormat, List<FileAttachment> fileAttachments, boolean sendSync,
ServiceContext serviceContext) throws Exception { ServiceContext serviceContext) throws Exception {
return addEmail(className, classPK, from, to, cc, bcc, null, subject, body, htmlFormat, null, null,
null, null, 0, false, null, null, fileAttachments, sendSync, templateName, serviceContext); return addEmail(className, classPK, from, to, cc, bcc, null, subject, body, htmlFormat, null, null, null, null,
0, false, null, null, fileAttachments, sendSync, null, serviceContext);
}
@Override
public Email addEmail(String className, long classPK, String from, String to[], String cc[], String bcc[],
String subject, String body, boolean htmlFormat, List<FileAttachment> fileAttachments, boolean sendSync,
String templateName, ServiceContext serviceContext) throws Exception {
return addEmail(className, classPK, from, to, cc, bcc, null, subject, body, htmlFormat, null, null, null, null,
0, false, null, null, fileAttachments, sendSync, templateName, serviceContext);
} }
public Email addEmail(String className, long classPK, String from, String to[], String cc[], @Override
String bcc[], String[] bulkAddresses, String subject, String body, boolean htmlFormat, public Email addEmail(String className, long classPK, String from, String to[], String cc[], String bcc[],
String[] replyTo, String messageId, String inReplyTo, String smtpHost, int smtpPort, String[] bulkAddresses, String subject, String body, boolean htmlFormat, String[] replyTo,
boolean smtpSecure, String smtpUsername, String smtpPassword, String messageId, String inReplyTo, String smtpHost, int smtpPort, boolean smtpSecure, String smtpUsername,
List<FileAttachment> fileAttachments, boolean sendSync, String templateName, String smtpPassword, List<FileAttachment> fileAttachments, boolean sendSync, String templateName,
ServiceContext serviceContext) throws Exception { ServiceContext serviceContext) throws Exception {
User user = userLocalService.getUser(serviceContext.getUserId()); User user = userLocalService.getUser(serviceContext.getUserId());
Date now = new Date(); Date now = new Date();
validate(from, to, cc, bcc, bulkAddresses, subject, body, replyTo); validate(from, to, cc, bcc, bulkAddresses, subject, body, replyTo);
Email email = createEmail(counterLocalService.increment(Email.class.getName()));
Email email = emailLocalService.createEmail(counterLocalService.increment(Email.class.getName()));
email.setGroupId(serviceContext.getScopeGroupId()); email.setGroupId(serviceContext.getScopeGroupId());
email.setCompanyId(serviceContext.getCompanyId()); email.setCompanyId(serviceContext.getCompanyId());
email.setCreateDate(serviceContext.getCreateDate(now)); email.setCreateDate(serviceContext.getCreateDate(now));
@ -143,7 +128,6 @@ public class EmailLocalServiceImpl extends EmailLocalServiceBaseImpl {
email.setClassPK(classPK); email.setClassPK(classPK);
email.setUserId(user.getUserId()); email.setUserId(user.getUserId());
email.setUserName(user.getFullName()); email.setUserName(user.getFullName());
email.setFrom(from); email.setFrom(from);
email.setTo(StringUtil.merge(to, StringPool.COMMA)); email.setTo(StringUtil.merge(to, StringPool.COMMA));
email.setCc(StringUtil.merge(cc, StringPool.COMMA)); email.setCc(StringUtil.merge(cc, StringPool.COMMA));
@ -151,12 +135,10 @@ public class EmailLocalServiceImpl extends EmailLocalServiceBaseImpl {
email.setBulkAddresses(StringUtil.merge(bulkAddresses, StringPool.COMMA)); email.setBulkAddresses(StringUtil.merge(bulkAddresses, StringPool.COMMA));
email.setSubject(subject); email.setSubject(subject);
email.setBody(body); email.setBody(body);
email.setHtmlFormat(htmlFormat); email.setHtmlFormat(htmlFormat);
email.setReplyTo(StringUtil.merge(replyTo, StringPool.COMMA)); email.setReplyTo(StringUtil.merge(replyTo, StringPool.COMMA));
email.setMessageId(messageId); email.setMessageId(messageId);
email.setInReplyTo(inReplyTo); email.setInReplyTo(inReplyTo);
email.setSmtpHost(smtpHost); email.setSmtpHost(smtpHost);
email.setSmtpPort(smtpPort); email.setSmtpPort(smtpPort);
email.setSmtpSecure(smtpSecure); email.setSmtpSecure(smtpSecure);
@ -164,47 +146,37 @@ public class EmailLocalServiceImpl extends EmailLocalServiceBaseImpl {
email.setSmtpPassword(smtpPassword); email.setSmtpPassword(smtpPassword);
email.setCancel(false); email.setCancel(false);
email.setTemplateName(templateName); email.setTemplateName(templateName);
email = addEmail(email); email = addEmail(email);
// Email Attachments // Email Attachments
if (fileAttachments != null && !fileAttachments.isEmpty()) { if (fileAttachments != null && !fileAttachments.isEmpty()) {
Folder folder = addEmailAttachmentsFolder(serviceContext.getCompanyId(), email.getEmailId()); Folder folder = addEmailAttachmentsFolder(serviceContext.getCompanyId(), email.getEmailId());
for (FileAttachment fileAttachment : fileAttachments) { for (FileAttachment fileAttachment : fileAttachments) {
if (fileAttachment instanceof FileAttachment) { if (fileAttachment instanceof FileAttachment) {
((it.tref.liferay.portos.mailmanager.shared.model.FileAttachment) fileAttachment) ((it.tref.liferay.portos.mailmanager.shared.model.FileAttachment) fileAttachment).generateFile();
.generateFile();
} }
emailAttachmentLocalService.addEmailAttachment(serviceContext.getCompanyId(), emailAttachmentLocalService.addEmailAttachment(serviceContext.getCompanyId(), email.getEmailId(),
email.getEmailId(), folder.getFolderId(), fileAttachment.getFileName(), folder.getFolderId(), fileAttachment.getFileName(), fileAttachment.getFile());
fileAttachment.getFile());
FileUtil.delete(fileAttachment.getFile()); FileUtil.delete(fileAttachment.getFile());
} }
} }
// Manifattura Web Group per Regione Siciliana // Manifattura Web Group per Regione Siciliana
// Il valore di ritorno viene ignorato da SchedulerInvioDocumenti, le // Il valore di ritorno viene ignorato da SchedulerInvioDocumenti, le mail impostate per l'invio asincrono si
// mail impostate per l'invio asincrono si perdono nell'abisso // perdono nell'abisso dell'oblio. Siccome questo è già un task asincrono, inviamo in maniera sincrona e
// dell'oblio. Siccome questo è già un task asincrono, inviamo in // festeggiamo.
// maniera sincrona e festeggiamo.
sendSync = true; sendSync = true;
if (sendSync) { if (sendSync) {
MailSenderUtil.sendMail(email); MailSenderUtil.sendMail(email);
markAsSent(email.getEmailId(), new Date(), StringPool.BLANK); markAsSent(email.getEmailId(), new Date(), StringPool.BLANK);
} }
return email; return email;
} }
public Email updateEmail(long emailId, String from, String to[], String cc[], String bcc[], @Override
String subject, String body, ServiceContext serviceContext) throws Exception { public Email updateEmail(long emailId, String from, String to[], String cc[], String bcc[], String subject,
String body, ServiceContext serviceContext) throws Exception {
Email email = emailLocalService.getEmail(emailId);
Email email = getEmail(emailId);
validate(from, to, cc, bcc, null, subject, body, null); validate(from, to, cc, bcc, null, subject, body, null);
email.setModifiedDate(new Date()); email.setModifiedDate(new Date());
email.setFrom(from); email.setFrom(from);
email.setTo(StringUtil.merge(to, StringPool.COMMA)); email.setTo(StringUtil.merge(to, StringPool.COMMA));
@ -212,60 +184,54 @@ public class EmailLocalServiceImpl extends EmailLocalServiceBaseImpl {
email.setBcc(StringUtil.merge(bcc, StringPool.COMMA)); email.setBcc(StringUtil.merge(bcc, StringPool.COMMA));
email.setSubject(subject); email.setSubject(subject);
email.setBody(body); email.setBody(body);
return updateEmail(email); return updateEmail(email);
} }
public Email markAsSent(long emailId, Date sentDate, String statusMessage) throws PortalException, @Override
SystemException { public Email markAsSent(long emailId, Date sentDate, String statusMessage) throws PortalException, SystemException {
Email email = emailLocalService.getEmail(emailId); Email email = getEmail(emailId);
email.setModifiedDate(new Date()); email.setModifiedDate(new Date());
email.setSent(true); email.setSent(true);
email.setSentDate(sentDate); email.setSentDate(sentDate);
email.setStatusMessage(statusMessage); email.setStatusMessage(statusMessage);
return updateEmail(email); return updateEmail(email);
} }
public Email updateStatusMessage(long emailId, String statusMessage) throws PortalException, @Override
SystemException { public Email updateStatusMessage(long emailId, String statusMessage) throws PortalException, SystemException {
Email email = emailLocalService.getEmail(emailId); Email email = getEmail(emailId);
email.setModifiedDate(new Date()); email.setModifiedDate(new Date());
email.setStatusMessage(statusMessage); email.setStatusMessage(statusMessage);
return updateEmail(email); return updateEmail(email);
} }
@Override
public Email resendEmail(long emailId) throws PortalException, SystemException { public Email resendEmail(long emailId) throws PortalException, SystemException {
Email email = emailLocalService.getEmail(emailId); Email email = getEmail(emailId);
email.setModifiedDate(new Date()); email.setModifiedDate(new Date());
email.setStatusMessage(""); email.setStatusMessage("");
email.setSent(false); email.setSent(false);
email.setSentDate(null); email.setSentDate(null);
email.setCancel(false); email.setCancel(false);
return updateEmail(email); return updateEmail(email);
} }
@Override
public Email cancelEmail(long emailId) throws PortalException, SystemException { public Email cancelEmail(long emailId) throws PortalException, SystemException {
Email email = emailLocalService.getEmail(emailId); Email email = getEmail(emailId);
email.setModifiedDate(new Date()); email.setModifiedDate(new Date());
email.setCancel(true); email.setCancel(true);
return updateEmail(email); return updateEmail(email);
} }
@Override @Override
public Email deleteEmail(long emailId) throws PortalException, SystemException { public Email deleteEmail(long emailId) throws PortalException, SystemException {
Email email = emailLocalService.getEmail(emailId);
Email email = getEmail(emailId);
return deleteEmail(email); return deleteEmail(email);
} }
@ -273,108 +239,126 @@ public class EmailLocalServiceImpl extends EmailLocalServiceBaseImpl {
public Email deleteEmail(Email email) throws SystemException { public Email deleteEmail(Email email) throws SystemException {
super.deleteEmail(email); super.deleteEmail(email);
// Email Attachments // Email Attachments
List<EmailAttachment> emailAttachments = emailAttachmentLocalService.findByEmailId(email.getEmailId());
List<EmailAttachment> emailAttachments = emailAttachmentLocalService
.findByEmailId(email.getEmailId());
for (EmailAttachment emailAttachment : emailAttachments) { for (EmailAttachment emailAttachment : emailAttachments) {
emailAttachmentLocalService.deleteEmailAttachment(emailAttachment); emailAttachmentLocalService.deleteEmailAttachment(emailAttachment);
} }
return email; return email;
} }
@Override
public List<Email> findByCompany(long companyId) throws SystemException { public List<Email> findByCompany(long companyId) throws SystemException {
return emailPersistence.findByCompany(companyId); return emailPersistence.findByCompany(companyId);
} }
@Override
public List<Email> findByCompany(long companyId, int start, int end) throws SystemException { public List<Email> findByCompany(long companyId, int start, int end) throws SystemException {
return emailPersistence.findByCompany(companyId, start, end); return emailPersistence.findByCompany(companyId, start, end);
} }
@Override
public List<Email> findByCompany(long companyId, int start, int end, OrderByComparator orderByComparator) public List<Email> findByCompany(long companyId, int start, int end, OrderByComparator orderByComparator)
throws SystemException { throws SystemException {
return emailPersistence.findByCompany(companyId, start, end, orderByComparator); return emailPersistence.findByCompany(companyId, start, end, orderByComparator);
} }
@Override
public int countByCompany(long companyId) throws SystemException { public int countByCompany(long companyId) throws SystemException {
return emailPersistence.countByCompany(companyId); return emailPersistence.countByCompany(companyId);
} }
@Override
public List<Email> findByC_G(long companyId, long groupId) throws SystemException { public List<Email> findByC_G(long companyId, long groupId) throws SystemException {
return emailPersistence.findByC_G(companyId, groupId); return emailPersistence.findByC_G(companyId, groupId);
} }
@Override
public List<Email> findByC_G(long companyId, long groupId, int start, int end) throws SystemException { public List<Email> findByC_G(long companyId, long groupId, int start, int end) throws SystemException {
return emailPersistence.findByC_G(companyId, groupId, start, end); return emailPersistence.findByC_G(companyId, groupId, start, end);
} }
public List<Email> findByC_G(long companyId, long groupId, int start, int end, @Override
OrderByComparator orderByComparator) throws SystemException { public List<Email> findByC_G(long companyId, long groupId, int start, int end, OrderByComparator orderByComparator)
throws SystemException {
return emailPersistence.findByC_G(companyId, groupId, start, end, orderByComparator); return emailPersistence.findByC_G(companyId, groupId, start, end, orderByComparator);
} }
@Override
public int countByC_G(long companyId, long groupId) throws SystemException { public int countByC_G(long companyId, long groupId) throws SystemException {
return emailPersistence.countByC_G(companyId, groupId); return emailPersistence.countByC_G(companyId, groupId);
} }
@Override
public List<Email> findByC_G_T(long companyId, long groupId, String templateName) throws SystemException { public List<Email> findByC_G_T(long companyId, long groupId, String templateName) throws SystemException {
return emailPersistence.findByC_G_T(companyId, groupId, templateName); return emailPersistence.findByC_G_T(companyId, groupId, templateName);
} }
@Override
public List<Email> findByC_G_T(long companyId, long groupId, String templateName, int start, int end) public List<Email> findByC_G_T(long companyId, long groupId, String templateName, int start, int end)
throws SystemException { throws SystemException {
return emailPersistence.findByC_G_T(companyId, groupId, templateName, start, end); return emailPersistence.findByC_G_T(companyId, groupId, templateName, start, end);
} }
@Override
public int countByC_G_T(long companyId, long groupId, String templateName) throws SystemException { public int countByC_G_T(long companyId, long groupId, String templateName) throws SystemException {
return emailPersistence.countByC_G_T(companyId, groupId, templateName); return emailPersistence.countByC_G_T(companyId, groupId, templateName);
} }
@Override
public List<Email> findByC_G_C_C(long companyId, long groupId, long classNameId, long classPK) public List<Email> findByC_G_C_C(long companyId, long groupId, long classNameId, long classPK)
throws SystemException { throws SystemException {
return emailPersistence.findByC_G_C_C(companyId, groupId, classNameId, classPK); return emailPersistence.findByC_G_C_C(companyId, groupId, classNameId, classPK);
} }
public List<Email> findByC_G_C_C(long companyId, long groupId, long classNameId, long classPK, int start, @Override
int end) throws SystemException { public List<Email> findByC_G_C_C(long companyId, long groupId, long classNameId, long classPK, int start, int end)
throws SystemException {
return emailPersistence.findByC_G_C_C(companyId, groupId, classNameId, classPK, start, end); return emailPersistence.findByC_G_C_C(companyId, groupId, classNameId, classPK, start, end);
} }
public int countByC_G_C_C(long companyId, long groupId, long classNameId, long classPK) @Override
throws SystemException { public int countByC_G_C_C(long companyId, long groupId, long classNameId, long classPK) throws SystemException {
return emailPersistence.countByC_G_C_C(companyId, groupId, classNameId, classPK); return emailPersistence.countByC_G_C_C(companyId, groupId, classNameId, classPK);
} }
private Folder addEmailAttachmentsFolder(long companyId, long emailId) throws PortalException, private Folder addEmailAttachmentsFolder(long companyId, long emailId) throws PortalException, SystemException {
SystemException {
Company company = companyLocalService.getCompany(companyId); Company company = companyLocalService.getCompany(companyId);
Group companyGroup = company.getGroup(); Group companyGroup = company.getGroup();
User defaultUser = company.getDefaultUser(); User defaultUser = company.getDefaultUser();
Folder folder =
Folder folder = dlAppLocalService.getFolder(companyGroup.getGroupId(), dlAppLocalService.getFolder(companyGroup.getGroupId(), DLFolderConstants.DEFAULT_PARENT_FOLDER_ID,
DLFolderConstants.DEFAULT_PARENT_FOLDER_ID, EmailConstants.DEFAULT_ATTACHMENTS_FOLDER_NAME); EmailConstants.DEFAULT_ATTACHMENTS_FOLDER_NAME);
ServiceContext serviceContext = new ServiceContext(); ServiceContext serviceContext = new ServiceContext();
serviceContext.setGroupPermissions(new String[] { ActionKeys.VIEW }); serviceContext.setGroupPermissions(new String[] { ActionKeys.VIEW });
serviceContext.setGuestPermissions(new String[] { ActionKeys.VIEW }); serviceContext.setGuestPermissions(new String[] { ActionKeys.VIEW });
return dlAppLocalService.addFolder(defaultUser.getUserId(), folder.getRepositoryId(), folder.getFolderId(),
return dlAppLocalService.addFolder(defaultUser.getUserId(), folder.getRepositoryId(), String.valueOf(emailId), StringPool.BLANK, serviceContext);
folder.getFolderId(), String.valueOf(emailId), StringPool.BLANK, serviceContext);
} }
private void validate(String from, String to[], String cc[], String bcc[], String[] bulkAddresses, private void validate(String from, String to[], String cc[], String bcc[], String[] bulkAddresses, String subject,
String subject, String body, String[] replyTo) throws PortalException { String body, String[] replyTo) throws PortalException {
if (Validator.isNull(from)) { if (Validator.isNull(from)) {
throw new RequiredEmailFromException(); throw new RequiredEmailFromException();
} else if (!Validator.isEmailAddress(from)) { } else if (!Validator.isEmailAddress(from)) {
throw new EmailFromException(); throw new EmailFromException();
} }
if (to == null || (to != null && to.length == 0)) { if (to == null || (to != null && to.length == 0)) {
throw new RequiredEmailToException(); throw new RequiredEmailToException();
} else { } else {
@ -384,7 +368,6 @@ public class EmailLocalServiceImpl extends EmailLocalServiceBaseImpl {
} }
} }
} }
if (cc != null && cc.length > 0) { if (cc != null && cc.length > 0) {
for (String emailAddress : cc) { for (String emailAddress : cc) {
if (!Validator.isEmailAddress(emailAddress)) { if (!Validator.isEmailAddress(emailAddress)) {
@ -392,7 +375,6 @@ public class EmailLocalServiceImpl extends EmailLocalServiceBaseImpl {
} }
} }
} }
if (bcc != null && bcc.length > 0) { if (bcc != null && bcc.length > 0) {
for (String emailAddress : bcc) { for (String emailAddress : bcc) {
if (!Validator.isEmailAddress(emailAddress)) { if (!Validator.isEmailAddress(emailAddress)) {
@ -400,7 +382,6 @@ public class EmailLocalServiceImpl extends EmailLocalServiceBaseImpl {
} }
} }
} }
if (bulkAddresses != null && bulkAddresses.length > 0) { if (bulkAddresses != null && bulkAddresses.length > 0) {
for (String emailAddress : bulkAddresses) { for (String emailAddress : bulkAddresses) {
if (!Validator.isEmailAddress(emailAddress)) { if (!Validator.isEmailAddress(emailAddress)) {
@ -408,15 +389,12 @@ public class EmailLocalServiceImpl extends EmailLocalServiceBaseImpl {
} }
} }
} }
if (Validator.isNull(subject)) { if (Validator.isNull(subject)) {
throw new RequiredEmailSubjectException(); throw new RequiredEmailSubjectException();
} }
if (Validator.isNull(body)) { if (Validator.isNull(body)) {
throw new RequiredEmailBodyException(); throw new RequiredEmailBodyException();
} }
if (replyTo != null && replyTo.length == 0) { if (replyTo != null && replyTo.length == 0) {
for (String emailAddress : replyTo) { for (String emailAddress : replyTo) {
if (!Validator.isEmailAddress(emailAddress)) { if (!Validator.isEmailAddress(emailAddress)) {

121
liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/service/impl/EmailTemplateLocalServiceImpl.java

@ -1,27 +1,13 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it
* * and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software
* This library is free software; you can redistribute it and/or modify it under the terms of the * Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in
* GNU Lesser General Public License as published by the Free Software Foundation; either version * the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* 2.1 of the License, or (at your option) any later version. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/ */
package it.tref.liferay.portos.mailmanager.service.impl; package it.tref.liferay.portos.mailmanager.service.impl;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.util.OrderByComparator;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.StringUtil;
import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.model.ResourceConstants;
import com.liferay.portal.model.User;
import com.liferay.portal.service.ServiceContext;
import it.tref.liferay.portos.mailmanager.EmailTemplateCcException; import it.tref.liferay.portos.mailmanager.EmailTemplateCcException;
import it.tref.liferay.portos.mailmanager.EmailTemplateCcnException; import it.tref.liferay.portos.mailmanager.EmailTemplateCcnException;
import it.tref.liferay.portos.mailmanager.EmailTemplateFromException; import it.tref.liferay.portos.mailmanager.EmailTemplateFromException;
@ -37,17 +23,24 @@ import it.tref.liferay.portos.mailmanager.service.base.EmailTemplateLocalService
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.kernel.util.OrderByComparator;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.StringUtil;
import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.model.ResourceConstants;
import com.liferay.portal.model.User;
import com.liferay.portal.service.ServiceContext;
/** /**
* The implementation of the email template local service. * The implementation of the email template local service.
*
* <p> * <p>
* All custom service methods should be put in this class. Whenever methods are added, rerun * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy
* ServiceBuilder to copy their definitions into the * their definitions into the {@link it.noovle.azimut.icf.mailmanager.service.EmailTemplateLocalService} interface.
* {@link it.noovle.azimut.icf.mailmanager.service.EmailTemplateLocalService} interface.
*
* <p> * <p>
* This is a local service. Methods of this service will not have security checks based on the * This is a local service. Methods of this service will not have security checks based on the propagated JAAS
* propagated JAAS credentials because this service can only be accessed from within the same VM. * credentials because this service can only be accessed from within the same VM.
* </p> * </p>
* *
* @author * @author
@ -56,83 +49,65 @@ import java.util.List;
*/ */
public class EmailTemplateLocalServiceImpl extends EmailTemplateLocalServiceBaseImpl { public class EmailTemplateLocalServiceImpl extends EmailTemplateLocalServiceBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link
* * it.noovle.azimut.icf.mailmanager.service.EmailTemplateLocalServiceUtil} to access the email template local
* Never reference this interface directly. Always use {@link * service.
* it.noovle.azimut.icf.mailmanager.service.EmailTemplateLocalServiceUtil} to access the email
* template local service.
*/ */
@Override @Override
public EmailTemplate addEmailTemplate(String templateName, String from, String[] to, String[] cc, String[] ccn, public EmailTemplate addEmailTemplate(String templateName, String from, String[] to, String[] cc, String[] ccn,
String subject, String body, boolean attachmentPermitted, ServiceContext serviceContext) throws SystemException, String subject, String body, boolean attachmentPermitted, ServiceContext serviceContext)
PortalException { throws SystemException, PortalException {
User user = userLocalService.getUser(serviceContext.getUserId()); User user = userLocalService.getUser(serviceContext.getUserId());
Date now = new Date(); Date now = new Date();
validate(templateName, from, to, cc, ccn, subject, body); validate(templateName, from, to, cc, ccn, subject, body);
EmailTemplate emailTemplate = createEmailTemplate(counterLocalService.increment(EmailTemplate.class.getName()));
EmailTemplate emailTemplate =
emailTemplateLocalService.createEmailTemplate(counterLocalService.increment(EmailTemplate.class.getName()));
emailTemplate.setCompanyId(serviceContext.getCompanyId()); emailTemplate.setCompanyId(serviceContext.getCompanyId());
emailTemplate.setUserId(user.getUserId()); emailTemplate.setUserId(user.getUserId());
emailTemplate.setUserName(user.getFullName()); emailTemplate.setUserName(user.getFullName());
emailTemplate.setCreateDate(serviceContext.getCreateDate(now)); emailTemplate.setCreateDate(serviceContext.getCreateDate(now));
emailTemplate.setModifiedDate(serviceContext.getModifiedDate(now)); emailTemplate.setModifiedDate(serviceContext.getModifiedDate(now));
emailTemplate.setGroupId(serviceContext.getScopeGroupId()); emailTemplate.setGroupId(serviceContext.getScopeGroupId());
emailTemplate.setTemplateName(templateName); emailTemplate.setTemplateName(templateName);
emailTemplate.setFrom(from); emailTemplate.setFrom(from);
emailTemplate.setTo(StringUtil.merge(to, StringPool.COMMA)); emailTemplate.setTo(StringUtil.merge(to, StringPool.COMMA));
emailTemplate.setCc(StringUtil.merge(cc, StringPool.COMMA)); emailTemplate.setCc(StringUtil.merge(cc, StringPool.COMMA));
emailTemplate.setCcn(StringUtil.merge(ccn, StringPool.COMMA)); emailTemplate.setCcn(StringUtil.merge(ccn, StringPool.COMMA));
emailTemplate.setSubject(subject); emailTemplate.setSubject(subject);
emailTemplate.setBody(body); emailTemplate.setBody(body);
emailTemplate.setAttachmentPermitted(attachmentPermitted); emailTemplate.setAttachmentPermitted(attachmentPermitted);
emailTemplate = addEmailTemplate(emailTemplate);
emailTemplate = emailTemplateLocalService.addEmailTemplate(emailTemplate);
// Resource // Resource
resourceLocalService.addResources(emailTemplate.getCompanyId(), emailTemplate.getGroupId(), resourceLocalService.addResources(emailTemplate.getCompanyId(), emailTemplate.getGroupId(),
emailTemplate.getUserId(), EmailTemplate.class.getName(), emailTemplate.getPrimaryKey(), false, true, true); emailTemplate.getUserId(), EmailTemplate.class.getName(), emailTemplate.getPrimaryKey(), false, true,
true);
return emailTemplate; return emailTemplate;
} }
@Override @Override
public EmailTemplate updateEmailTemplate(long emailTemplateId, String templateName, String from, String[] to, public EmailTemplate updateEmailTemplate(long emailTemplateId, String templateName, String from, String[] to,
String[] cc, String[] ccn, String subject, String body, boolean attachmentPermitted, ServiceContext serviceContext) String[] cc, String[] ccn, String subject, String body, boolean attachmentPermitted,
throws SystemException, PortalException { ServiceContext serviceContext) throws SystemException, PortalException {
EmailTemplate emailTemplate = emailTemplateLocalService.getEmailTemplate(emailTemplateId);
EmailTemplate emailTemplate = getEmailTemplate(emailTemplateId);
validate(templateName, from, to, cc, ccn, subject, body); validate(templateName, from, to, cc, ccn, subject, body);
emailTemplate.setModifiedDate(serviceContext.getModifiedDate(new Date())); emailTemplate.setModifiedDate(serviceContext.getModifiedDate(new Date()));
emailTemplate.setFrom(from); emailTemplate.setFrom(from);
emailTemplate.setTo(StringUtil.merge(to, StringPool.COMMA)); emailTemplate.setTo(StringUtil.merge(to, StringPool.COMMA));
emailTemplate.setCc(StringUtil.merge(cc, StringPool.COMMA)); emailTemplate.setCc(StringUtil.merge(cc, StringPool.COMMA));
emailTemplate.setCcn(StringUtil.merge(ccn, StringPool.COMMA)); emailTemplate.setCcn(StringUtil.merge(ccn, StringPool.COMMA));
emailTemplate.setSubject(subject); emailTemplate.setSubject(subject);
emailTemplate.setBody(body); emailTemplate.setBody(body);
emailTemplate.setAttachmentPermitted(attachmentPermitted); emailTemplate.setAttachmentPermitted(attachmentPermitted);
emailTemplate = updateEmailTemplate(emailTemplate);
emailTemplate = emailTemplateLocalService.updateEmailTemplate(emailTemplate);
return emailTemplate; return emailTemplate;
} }
@Override @Override
public EmailTemplate deleteEmailTemplate(long emailTemplateId) throws PortalException, SystemException { public EmailTemplate deleteEmailTemplate(long emailTemplateId) throws PortalException, SystemException {
EmailTemplate emailTemplate = emailTemplateLocalService.getEmailTemplate(emailTemplateId);
EmailTemplate emailTemplate = getEmailTemplate(emailTemplateId);
return deleteEmailTemplate(emailTemplate); return deleteEmailTemplate(emailTemplate);
} }
@ -140,59 +115,64 @@ public class EmailTemplateLocalServiceImpl extends EmailTemplateLocalServiceBase
public EmailTemplate deleteEmailTemplate(EmailTemplate emailTemplate) throws SystemException { public EmailTemplate deleteEmailTemplate(EmailTemplate emailTemplate) throws SystemException {
super.deleteEmailTemplate(emailTemplate); super.deleteEmailTemplate(emailTemplate);
// Resource // Resource
try { try {
resourceLocalService.deleteResource(emailTemplate.getCompanyId(), EmailTemplate.class.getName(), resourceLocalService.deleteResource(emailTemplate.getCompanyId(), EmailTemplate.class.getName(),
ResourceConstants.SCOPE_INDIVIDUAL, emailTemplate.getPrimaryKey()); ResourceConstants.SCOPE_INDIVIDUAL, emailTemplate.getPrimaryKey());
} catch (PortalException e) { } catch (PortalException e) {}
}
return emailTemplate; return emailTemplate;
} }
@Override @Override
public int countByC_GroupId(long companyId, long groupId) throws SystemException { public int countByC_GroupId(long companyId, long groupId) throws SystemException {
return emailTemplatePersistence.countByC_GroupId(companyId, groupId); return emailTemplatePersistence.countByC_GroupId(companyId, groupId);
} }
@Override @Override
public List<EmailTemplate> findByC_GroupId(long companyId, long groupId, int start, int end, OrderByComparator orderBy) public List<EmailTemplate> findByC_GroupId(long companyId, long groupId, int start, int end,
throws SystemException { OrderByComparator orderBy) throws SystemException {
return emailTemplatePersistence.findByC_GroupId(companyId, groupId, start, end, orderBy); return emailTemplatePersistence.findByC_GroupId(companyId, groupId, start, end, orderBy);
} }
@Override @Override
public EmailTemplate findByC_GroupId_Name(long companyId, long groupId, String templateName) public EmailTemplate findByC_GroupId_Name(long companyId, long groupId, String templateName)
throws NoSuchEmailTemplateException, SystemException { throws NoSuchEmailTemplateException, SystemException {
return emailTemplatePersistence.findByC_GroupId_Name(companyId, groupId, templateName); return emailTemplatePersistence.findByC_GroupId_Name(companyId, groupId, templateName);
} }
@Override @Override
public EmailTemplate fetchByC_GroupId_Name(long companyId, long groupId, String templateName) throws SystemException { public EmailTemplate fetchByC_GroupId_Name(long companyId, long groupId, String templateName)
throws SystemException {
return emailTemplatePersistence.fetchByC_GroupId_Name(companyId, groupId, templateName); return emailTemplatePersistence.fetchByC_GroupId_Name(companyId, groupId, templateName);
} }
@Override @Override
public int countByCompany(long companyId) throws SystemException { public int countByCompany(long companyId) throws SystemException {
return emailTemplatePersistence.countByCompany(companyId); return emailTemplatePersistence.countByCompany(companyId);
} }
@Override @Override
public List<EmailTemplate> findByCompany(long companyId, int start, int end, OrderByComparator orderBy) public List<EmailTemplate> findByCompany(long companyId, int start, int end, OrderByComparator orderBy)
throws SystemException { throws SystemException {
return emailTemplatePersistence.findByCompany(companyId, start, end, orderBy); return emailTemplatePersistence.findByCompany(companyId, start, end, orderBy);
} }
@Override @Override
public int countByC_Name(long companyId, String name) throws SystemException { public int countByC_Name(long companyId, String name) throws SystemException {
return emailTemplatePersistence.countByC_Name(companyId, name); return emailTemplatePersistence.countByC_Name(companyId, name);
} }
@Override @Override
public EmailTemplate findByC_Name(long companyId, String templateName) throws SystemException, public EmailTemplate findByC_Name(long companyId, String templateName) throws SystemException,
NoSuchEmailTemplateException { NoSuchEmailTemplateException {
return emailTemplatePersistence.findByC_Name(companyId, templateName); return emailTemplatePersistence.findByC_Name(companyId, templateName);
} }
@ -202,13 +182,11 @@ public class EmailTemplateLocalServiceImpl extends EmailTemplateLocalServiceBase
if (Validator.isNull(templateName)) { if (Validator.isNull(templateName)) {
throw new RequiredEmailTemplateNameException(); throw new RequiredEmailTemplateNameException();
} }
if (Validator.isNull(from)) { if (Validator.isNull(from)) {
throw new RequiredEmailTemplateFromException(); throw new RequiredEmailTemplateFromException();
} else if (!Validator.isEmailAddress(from)) { } else if (!Validator.isEmailAddress(from)) {
throw new EmailTemplateFromException(); throw new EmailTemplateFromException();
} }
if (to != null && to.length > 0) { if (to != null && to.length > 0) {
for (String emailAddress : to) { for (String emailAddress : to) {
if (!Validator.isEmailAddress(emailAddress)) { if (!Validator.isEmailAddress(emailAddress)) {
@ -216,7 +194,6 @@ public class EmailTemplateLocalServiceImpl extends EmailTemplateLocalServiceBase
} }
} }
} }
if (cc != null && cc.length > 0) { if (cc != null && cc.length > 0) {
for (String emailAddress : cc) { for (String emailAddress : cc) {
if (!Validator.isEmailAddress(emailAddress)) { if (!Validator.isEmailAddress(emailAddress)) {
@ -224,7 +201,6 @@ public class EmailTemplateLocalServiceImpl extends EmailTemplateLocalServiceBase
} }
} }
} }
if (ccn != null && ccn.length > 0) { if (ccn != null && ccn.length > 0) {
for (String emailAddress : ccn) { for (String emailAddress : ccn) {
if (!Validator.isEmailAddress(emailAddress)) { if (!Validator.isEmailAddress(emailAddress)) {
@ -232,14 +208,11 @@ public class EmailTemplateLocalServiceImpl extends EmailTemplateLocalServiceBase
} }
} }
} }
if (Validator.isNull(subject)) { if (Validator.isNull(subject)) {
throw new RequiredEmailTemplateSubjectException(); throw new RequiredEmailTemplateSubjectException();
} }
if (Validator.isNull(body)) { if (Validator.isNull(body)) {
throw new RequiredEmailTemplateBodyException(); throw new RequiredEmailTemplateBodyException();
} }
} }
} }

40
liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/maintenance/NoSuchMaintenanceScheduleException.java

@ -0,0 +1,40 @@
/**
* Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is 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.maintenance;
import com.liferay.portal.NoSuchModelException;
/**
* @author
*/
public class NoSuchMaintenanceScheduleException extends NoSuchModelException {
public NoSuchMaintenanceScheduleException() {
super();
}
public NoSuchMaintenanceScheduleException(String msg) {
super(msg);
}
public NoSuchMaintenanceScheduleException(String msg, Throwable cause) {
super(msg, cause);
}
public NoSuchMaintenanceScheduleException(Throwable cause) {
super(cause);
}
}

63
liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/portlet/AdminMaintenancePortlet.java

@ -1,5 +1,14 @@
package it.tref.liferay.portos.maintenance.portlet; package it.tref.liferay.portos.maintenance.portlet;
import it.tref.liferay.portos.maintenance.model.MaintenanceSchedule;
import it.tref.liferay.portos.maintenance.service.MaintenanceScheduleServiceUtil;
import java.util.Calendar;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
import javax.portlet.PortletSession;
import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.language.LanguageUtil; import com.liferay.portal.kernel.language.LanguageUtil;
import com.liferay.portal.kernel.log.Log; import com.liferay.portal.kernel.log.Log;
@ -17,64 +26,40 @@ import com.liferay.portal.service.ServiceContextFactory;
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;
import it.tref.liferay.portos.maintenance.model.MaintenanceSchedule;
import it.tref.liferay.portos.maintenance.service.MaintenanceScheduleServiceUtil;
import java.util.Calendar;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
import javax.portlet.PortletSession;
/**
* Portlet implementation class AdminMaintenancePortlet
*/
public class AdminMaintenancePortlet extends MVCPortlet { public class AdminMaintenancePortlet extends MVCPortlet {
private final static Log _log = LogFactoryUtil.getLog(AdminMaintenancePortlet.class); private static final Log _log = LogFactoryUtil.getLog(AdminMaintenancePortlet.class);
public void maintain(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { public void maintain(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
PortletSession portletSession = actionRequest.getPortletSession(); PortletSession portletSession = actionRequest.getPortletSession();
String message = ParamUtil.getString(actionRequest, "message"); String message = ParamUtil.getString(actionRequest, "message");
String className = LanguageUtil
String className =
LanguageUtil
.get(LocaleUtil.getDefault(), .get(LocaleUtil.getDefault(),
"the-sign-in-process-is-temporarily-disabled-because-the-portal-is-undergoing-a-routine-maintenance-upgrade"); "the-sign-in-process-is-temporarily-disabled-because-the-portal-is-undergoing-a-routine-maintenance-upgrade");
if (Validator.isNotNull(message)) { if (Validator.isNotNull(message)) {
className = message; className = message;
} }
Class<?> clazz = ClassResolverUtil.resolve("com.liferay.portal.util.MaintenanceUtil",
Class<?> clazz = PortalClassLoaderUtil.getClassLoader());
ClassResolverUtil.resolve("com.liferay.portal.util.MaintenanceUtil", PortalClassLoaderUtil.getClassLoader());
ReflectionUtil.getDeclaredMethod(clazz, "maintain", String.class, String.class).invoke(null, ReflectionUtil.getDeclaredMethod(clazz, "maintain", String.class, String.class).invoke(null,
portletSession.getId(), className); portletSession.getId(), className);
_log.info("Maintenance session id: " + portletSession.getId()); _log.info("Maintenance session id: " + portletSession.getId());
} }
public void deleteMaintenanceSchedule(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { public void deleteMaintenanceSchedule(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
_log.info("deleteMaintenanceSchedule - Inizio metodo");
_log.info("deleteMaintenanceSchedule - Inizio metodo");
ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest); ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest);
long maintenanceScheduleId = ParamUtil.getLong(actionRequest, "maintenanceScheduleId"); long maintenanceScheduleId = ParamUtil.getLong(actionRequest, "maintenanceScheduleId");
MaintenanceScheduleServiceUtil.deleteMaintenanceSchedule(maintenanceScheduleId, serviceContext); MaintenanceScheduleServiceUtil.deleteMaintenanceSchedule(maintenanceScheduleId, serviceContext);
} }
public void editMaintenanceSchedule(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { public void editMaintenanceSchedule(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
_log.info("editMaintenanceSchedule - Inizio metodo");
_log.info("editMaintenanceSchedule - Inizio metodo");
String cmd = ParamUtil.getString(actionRequest, Constants.CMD); String cmd = ParamUtil.getString(actionRequest, Constants.CMD);
ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest); ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest);
long maintenanceScheduleId = ParamUtil.getLong(actionRequest, "maintenanceScheduleId"); long maintenanceScheduleId = ParamUtil.getLong(actionRequest, "maintenanceScheduleId");
String type = ParamUtil.getString(actionRequest, "type"); String type = ParamUtil.getString(actionRequest, "type");
String reason = ParamUtil.getString(actionRequest, "reason"); String reason = ParamUtil.getString(actionRequest, "reason");
@ -83,31 +68,24 @@ public class AdminMaintenancePortlet extends MVCPortlet {
String onreboot = ParamUtil.getString(actionRequest, "onreboot"); String onreboot = ParamUtil.getString(actionRequest, "onreboot");
String status = ParamUtil.getString(actionRequest, "status"); String status = ParamUtil.getString(actionRequest, "status");
String statusMessage = ParamUtil.getString(actionRequest, "statusMessage"); String statusMessage = ParamUtil.getString(actionRequest, "statusMessage");
Calendar calendarEnd = Calendar.getInstance(); Calendar calendarEnd = Calendar.getInstance();
calendarEnd.set(ParamUtil.getInteger(actionRequest, "endYear"), calendarEnd.set(ParamUtil.getInteger(actionRequest, "endYear"),
ParamUtil.getInteger(actionRequest, "endMonth") + 1, ParamUtil.getInteger(actionRequest, "endDay"), ParamUtil.getInteger(actionRequest, "endMonth") + 1, ParamUtil.getInteger(actionRequest, "endDay"),
ParamUtil.getInteger(actionRequest, "endHour"), ParamUtil.getInteger(actionRequest, "endMinute")); ParamUtil.getInteger(actionRequest, "endHour"), ParamUtil.getInteger(actionRequest, "endMinute"));
MaintenanceSchedule maintenanceSchedule = null; MaintenanceSchedule maintenanceSchedule = null;
try { try {
if (cmd.equals(Constants.ADD)) { if (cmd.equals(Constants.ADD)) {
maintenanceSchedule = maintenanceSchedule = MaintenanceScheduleServiceUtil.addMaintenanceSchedule(type, reason,
MaintenanceScheduleServiceUtil.addMaintenanceSchedule(type, reason, portalMessage, after, portalMessage, after, calendarEnd.getTime(), onreboot, serviceContext);
calendarEnd.getTime(), onreboot, serviceContext);
} else if (cmd.equals(Constants.UPDATE)) { } else if (cmd.equals(Constants.UPDATE)) {
maintenanceSchedule = maintenanceSchedule = MaintenanceScheduleServiceUtil.updateMaintenanceSchedule(maintenanceScheduleId,
MaintenanceScheduleServiceUtil.updateMaintenanceSchedule(maintenanceScheduleId, type, reason, type, reason, portalMessage, after, calendarEnd.getTime(), onreboot, status, statusMessage,
portalMessage, after, calendarEnd.getTime(), onreboot, status, statusMessage, serviceContext); serviceContext);
} }
} catch (PortalException e) { } catch (PortalException e) {
_log.error(e); _log.error(e);
SessionErrors.add(actionRequest, e.getClass()); SessionErrors.add(actionRequest, e.getClass());
} }
if (SessionErrors.isEmpty(actionRequest)) { if (SessionErrors.isEmpty(actionRequest)) {
actionResponse.setRenderParameter("maintenanceScheduleId", actionResponse.setRenderParameter("maintenanceScheduleId",
String.valueOf(maintenanceSchedule.getMaintenanceScheduleId())); String.valueOf(maintenanceSchedule.getMaintenanceScheduleId()));
@ -116,6 +94,5 @@ public class AdminMaintenancePortlet extends MVCPortlet {
actionResponse.setRenderParameter("mvcPath", "/html/admin_maintenance/edit.jsp"); actionResponse.setRenderParameter("mvcPath", "/html/admin_maintenance/edit.jsp");
PortalUtil.copyRequestParameters(actionRequest, actionResponse); PortalUtil.copyRequestParameters(actionRequest, actionResponse);
} }
} }
} }

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

@ -13,8 +13,8 @@
## ##
build.namespace=portos_maintenance build.namespace=portos_maintenance
build.number=42 build.number=43
build.date=1569596970763 build.date=1631870287519
build.auto.upgrade=true build.auto.upgrade=true
## ##

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

@ -25,7 +25,7 @@ import com.liferay.portlet.expando.service.ExpandoTableLocalServiceUtil;
public class StartUpAction extends SimpleAction { public class StartUpAction extends SimpleAction {
private final static Log _log = LogFactoryUtil.getLog(StartUpAction.class); private static final Log _log = LogFactoryUtil.getLog(StartUpAction.class);
@Override @Override
public void run(String[] companyIds) throws ActionException { public void run(String[] companyIds) throws ActionException {

31
liferay-plugins-sdk-6.2/portlets/portos-report-engine-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/service/persistence/KaleoTaskAssignmentInstanceFinderImpl.java

@ -18,33 +18,23 @@ import com.liferay.util.dao.orm.CustomSQLUtil;
public class KaleoTaskAssignmentInstanceFinderImpl extends BasePersistenceImpl<KaleoTaskAssignmentInstance> implements public class KaleoTaskAssignmentInstanceFinderImpl extends BasePersistenceImpl<KaleoTaskAssignmentInstance> implements
KaleoTaskAssignmentInstanceFinder { KaleoTaskAssignmentInstanceFinder {
private final static Log _log = LogFactoryUtil.getLog(KaleoTaskAssignmentInstanceFinderImpl.class); private static final Log _log = LogFactoryUtil.getLog(KaleoTaskAssignmentInstanceFinderImpl.class);
private final String DISTINCT_ASSIGNEE_USER = "Report.distinctKaleoAssigneeUser"; private static final String DISTINCT_ASSIGNEE_USER = "Report.distinctKaleoAssigneeUser";
private final String DISTINCT_ASSIGNEE_ID = "Report.distinctKaleoAssigneeId"; private static final String DISTINCT_ASSIGNEE_ID = "Report.distinctKaleoAssigneeId";
@Override
public List<BigInteger> distinctKaleoAssignee() throws SystemException { public List<BigInteger> distinctKaleoAssignee() throws SystemException {
Session session = null; Session session = null;
try { try {
session = openSession(); session = openSession();
String sql = CustomSQLUtil.get(DISTINCT_ASSIGNEE_USER); String sql = CustomSQLUtil.get(DISTINCT_ASSIGNEE_USER);
// sql = StringUtil.replace(sql, "[$GROUP_ID$]", "" + groupId);
// sql = StringUtil.replace(sql, "[$GROUP_ID$]", StringUtil.merge(territorioIds));
// sql = StringUtil.replace(sql, "[$TIPOPRATICA$]", "02");
SQLQuery query = session.createSQLQuery(sql); SQLQuery query = session.createSQLQuery(sql);
query.setCacheable(false); query.setCacheable(false);
QueryPos qPos = QueryPos.getInstance(query); QueryPos qPos = QueryPos.getInstance(query);
List<BigInteger> list = query.list(); List<BigInteger> list = query.list();
return list; return list;
} catch (ORMException e) { } catch (ORMException e) {
_log.error("Errore", e); _log.error("Errore", e);
throw new SystemException(e); throw new SystemException(e);
@ -55,29 +45,19 @@ public class KaleoTaskAssignmentInstanceFinderImpl extends BasePersistenceImpl<K
} }
} }
@Override
public List<BigInteger> distinctKaleoAssigneeId(long userId) throws SystemException { public List<BigInteger> distinctKaleoAssigneeId(long userId) throws SystemException {
Session session = null; Session session = null;
try { try {
session = openSession(); session = openSession();
String sql = CustomSQLUtil.get(DISTINCT_ASSIGNEE_ID); String sql = CustomSQLUtil.get(DISTINCT_ASSIGNEE_ID);
// sql = StringUtil.replace(sql, "[$GROUP_ID$]", "" + groupId);
// sql = StringUtil.replace(sql, "[$GROUP_ID$]", StringUtil.merge(territorioIds));
// sql = StringUtil.replace(sql, "[$TIPOPRATICA$]", "02");
SQLQuery query = session.createSQLQuery(sql); SQLQuery query = session.createSQLQuery(sql);
query.setCacheable(false); query.setCacheable(false);
QueryPos qPos = QueryPos.getInstance(query); QueryPos qPos = QueryPos.getInstance(query);
qPos.add(userId); qPos.add(userId);
List<BigInteger> list = query.list(); List<BigInteger> list = query.list();
return list; return list;
} catch (ORMException e) { } catch (ORMException e) {
_log.error("Errore", e); _log.error("Errore", e);
throw new SystemException(e); throw new SystemException(e);
@ -87,5 +67,4 @@ public class KaleoTaskAssignmentInstanceFinderImpl extends BasePersistenceImpl<K
} }
} }
} }
} }

35
liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/messaging/ProtocolloMessageListener.java

@ -64,7 +64,8 @@ public class ProtocolloMessageListener extends BaseMessageListener {
long userId = message.getLong(ReportConstants.USER_ID); long userId = message.getLong(ReportConstants.USER_ID);
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
Map<String, Serializable> taskContextMap = (Map<String, Serializable>) message.get(ReportConstants.PARAMATERS); Map<String, Serializable> taskContextMap = (Map<String, Serializable>) message.get(ReportConstants.PARAMATERS);
User user = UserLocalServiceUtil.getRoleUsers( User user =
UserLocalServiceUtil.getRoleUsers(
RoleLocalServiceUtil.getRole(companyId, RoleConstants.ADMINISTRATOR).getRoleId()).get(0); RoleLocalServiceUtil.getRole(companyId, RoleConstants.ADMINISTRATOR).getRoleId()).get(0);
try { try {
PermissionThreadLocal.setPermissionChecker(PermissionCheckerFactoryUtil.create(user)); PermissionThreadLocal.setPermissionChecker(PermissionCheckerFactoryUtil.create(user));
@ -72,8 +73,8 @@ public class ProtocolloMessageListener extends BaseMessageListener {
throw new SystemException(e); throw new SystemException(e);
} }
try { try {
JSONArray jsonArray = JSONFactoryUtil.createJSONArray(MapUtil.getString(taskContextMap, JSONArray jsonArray =
ReportConstants.PARAM_REPORTS)); JSONFactoryUtil.createJSONArray(MapUtil.getString(taskContextMap, ReportConstants.PARAM_REPORTS));
JSONObject jsonObject = jsonArray.getJSONObject(0); JSONObject jsonObject = jsonArray.getJSONObject(0);
ReportDto reportDto = JSONFactoryUtil.looseDeserialize(jsonObject.toString(), ReportDto.class); ReportDto reportDto = JSONFactoryUtil.looseDeserialize(jsonObject.toString(), ReportDto.class);
String protocolloToAttach = StringPool.BLANK; String protocolloToAttach = StringPool.BLANK;
@ -130,22 +131,32 @@ public class ProtocolloMessageListener extends BaseMessageListener {
ServiceContext serviceContext = new ServiceContext(); ServiceContext serviceContext = new ServiceContext();
serviceContext.setUserId(userId); serviceContext.setUserId(userId);
serviceContext.setCompanyId(companyId); serviceContext.setCompanyId(companyId);
FileEntry newFileEntry = null; long repositoryId = fileEntry.getRepositoryId();
long folderId = fileEntry.getFolderId();
String sourceFileName = reportDto.getFileName() + ".pdf";
String mimeType = ContentTypes.APPLICATION_PDF;
String title = reportDto.getFileName();
String description = StringPool.BLANK;
String changeLog = StringPool.BLANK;
FileEntry newFileEntry;
try { try {
newFileEntry = DLAppLocalServiceUtil.addFileEntry(userId, fileEntry.getRepositoryId(), newFileEntry =
fileEntry.getFolderId(), reportDto.getFileName() + ".pdf", ContentTypes.APPLICATION_PDF, DLAppLocalServiceUtil.addFileEntry(userId, repositoryId, folderId, sourceFileName,
reportDto.getFileName(), StringPool.BLANK, StringPool.BLANK, outputBytes, serviceContext); mimeType, title, description, changeLog, outputBytes, serviceContext);
} catch (DuplicateFileException e) { } catch (DuplicateFileException e) {
FileEntry fe = DLAppServiceUtil.getFileEntry(fileEntry.getGroupId(), fileEntry.getFolderId(), FileEntry fe =
DLAppServiceUtil.getFileEntry(fileEntry.getGroupId(), fileEntry.getFolderId(),
reportDto.getFileName()); reportDto.getFileName());
_log.info("File duplicato : " + fe.getFileEntryId()); DLAppLocalServiceUtil.deleteFileEntry(fe.getFileEntryId());
return; newFileEntry =
DLAppLocalServiceUtil.addFileEntry(userId, repositoryId, folderId, sourceFileName,
mimeType, title, description, changeLog, outputBytes, serviceContext);
} }
if (Validator.isNotNull(newFileEntry)) { if (Validator.isNotNull(newFileEntry)) {
long[] fileEntryIds = new long[0]; long[] fileEntryIds = new long[0];
fileEntryIds = ArrayUtil.append(fileEntryIds, newFileEntry.getFileEntryId()); fileEntryIds = ArrayUtil.append(fileEntryIds, newFileEntry.getFileEntryId());
ReportResultDto dto = new ReportResultDto(0L, fileEntryIds, ReportResult.SUCCESSFUL.toString(), ReportResultDto dto =
null); new ReportResultDto(0L, fileEntryIds, ReportResult.SUCCESSFUL.toString(), null);
Message responseMessage = MessageBusUtil.createResponseMessage(message); Message responseMessage = MessageBusUtil.createResponseMessage(message);
responseMessage.setPayload(JSONFactoryUtil.looseSerializeDeep(dto)); responseMessage.setPayload(JSONFactoryUtil.looseSerializeDeep(dto));
MessageBusUtil.sendMessage(responseMessage.getDestinationName(), responseMessage); MessageBusUtil.sendMessage(responseMessage.getDestinationName(), responseMessage);

3
liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/messaging/ReportMessageListener.java

@ -29,7 +29,8 @@ import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.service.ServiceContext; import com.liferay.portal.service.ServiceContext;
public class ReportMessageListener extends BaseMessageListener { public class ReportMessageListener extends BaseMessageListener {
private final static Log _log = LogFactoryUtil.getLog(ReportTaskMessageListener.class);
private static final Log _log = LogFactoryUtil.getLog(ReportTaskMessageListener.class);
@Override @Override
protected void doReceive(Message message) throws Exception { protected void doReceive(Message message) throws Exception {

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

@ -46,7 +46,7 @@ import com.liferay.util.bridges.mvc.MVCPortlet;
public class TestPdf extends MVCPortlet { public class TestPdf extends MVCPortlet {
private final static Log _log = LogFactoryUtil.getLog(TestPdf.class); private static final Log _log = LogFactoryUtil.getLog(TestPdf.class);
@Override @Override
public void serveResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse) throws IOException, public void serveResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse) throws IOException,

9
liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/service/impl/ReportTaskLocalServiceImpl.java

@ -46,8 +46,7 @@ public class ReportTaskLocalServiceImpl extends ReportTaskLocalServiceBaseImpl {
User user = userLocalService.getUser(serviceContext.getUserId()); User user = userLocalService.getUser(serviceContext.getUserId());
Date now = new Date(); Date now = new Date();
ReportTask reportTask = reportTaskLocalService.createReportTask(counterLocalService.increment(ReportTask.class ReportTask reportTask = createReportTask(counterLocalService.increment(ReportTask.class.getName()));
.getName()));
reportTask.setCompanyId(serviceContext.getCompanyId()); reportTask.setCompanyId(serviceContext.getCompanyId());
reportTask.setUserId(user.getUserId()); reportTask.setUserId(user.getUserId());
reportTask.setUserName(user.getFullName()); reportTask.setUserName(user.getFullName());
@ -57,16 +56,16 @@ public class ReportTaskLocalServiceImpl extends ReportTaskLocalServiceBaseImpl {
String taskContext = JSONFactoryUtil.looseSerializeDeep(taskContextMap); String taskContext = JSONFactoryUtil.looseSerializeDeep(taskContextMap);
reportTask.setTaskContext(taskContext); reportTask.setTaskContext(taskContext);
} }
return reportTaskLocalService.addReportTask(reportTask); return addReportTask(reportTask);
} }
@Override @Override
public ReportTask markAsCompleted(long reportTaskId, Date completionDate) throws PortalException, SystemException { public ReportTask markAsCompleted(long reportTaskId, Date completionDate) throws PortalException, SystemException {
ReportTask reportTask = reportTaskLocalService.getReportTask(reportTaskId); ReportTask reportTask = getReportTask(reportTaskId);
reportTask.setModifiedDate(new Date()); reportTask.setModifiedDate(new Date());
reportTask.setCompleted(true); reportTask.setCompleted(true);
reportTask.setCompletionDate(completionDate); reportTask.setCompletionDate(completionDate);
return reportTaskLocalService.updateReportTask(reportTask); return updateReportTask(reportTask);
} }
} }

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

@ -63,7 +63,7 @@ import com.liferay.portlet.documentlibrary.service.DLFileEntryLocalServiceUtil;
*/ */
public class ReportTaskManagerServiceImpl extends ReportTaskManagerServiceBaseImpl { public class ReportTaskManagerServiceImpl extends ReportTaskManagerServiceBaseImpl {
private final static Log _log = LogFactoryUtil.getLog(ReportTaskManagerServiceImpl.class); private static final Log _log = LogFactoryUtil.getLog(ReportTaskManagerServiceImpl.class);
@Override @Override
public long[] doReport(long companyId, long userId, Map<String, Serializable> taskContextMap, Object dataSource) public long[] doReport(long companyId, long userId, Map<String, Serializable> taskContextMap, Object dataSource)

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

@ -13,8 +13,8 @@
## ##
build.namespace=portos_rep build.namespace=portos_rep
build.number=33 build.number=34
build.date=1630406182776 build.date=1631888828391
build.auto.upgrade=true build.auto.upgrade=true
## ##

2
liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/modellistener/shared/core/ModelListenerInvocationHandler.java

@ -136,6 +136,6 @@ public class ModelListenerInvocationHandler implements InvocationHandler {
return false; return false;
} }
private final static String[] MODEL_METHOD_NAMES = { "onAfterCreate", "onAfterRemove", "onAfterUpdate", private static final String[] MODEL_METHOD_NAMES = { "onAfterCreate", "onAfterRemove", "onAfterUpdate",
"onBeforeCreate", "onBeforeRemove", "onBeforeUpdate" }; "onBeforeCreate", "onBeforeRemove", "onBeforeUpdate" };
} }

23
liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/modellistener/shared/core/ModelListenerPool.java

@ -14,35 +14,34 @@ public class ModelListenerPool {
protected static void register(String servletContextName, String modelClassName, protected static void register(String servletContextName, String modelClassName,
ModelListener<BaseModel<?>> modelListener) { ModelListener<BaseModel<?>> modelListener) {
_servletContextNameMap.put(modelClassName, servletContextName); SERVLET_CONTEXT_NAME_MAP.put(modelClassName, servletContextName);
if (!_modelListenersMap.containsKey(modelClassName)) { if (!MODEL_LISTENERS_MAP.containsKey(modelClassName)) {
_modelListenersMap.put(modelClassName, new ArrayList<ModelListener<BaseModel<?>>>()); MODEL_LISTENERS_MAP.put(modelClassName, new ArrayList<ModelListener<BaseModel<?>>>());
} }
_modelListenersMap.get(modelClassName).add(modelListener); MODEL_LISTENERS_MAP.get(modelClassName).add(modelListener);
} }
protected static void unregister(String modelClassName) { protected static void unregister(String modelClassName) {
_servletContextNameMap.remove(modelClassName); SERVLET_CONTEXT_NAME_MAP.remove(modelClassName);
_modelListenersMap.remove(modelClassName); MODEL_LISTENERS_MAP.remove(modelClassName);
} }
protected static Set<String> getModelClassNames() { protected static Set<String> getModelClassNames() {
return _modelListenersMap.keySet(); return MODEL_LISTENERS_MAP.keySet();
} }
protected static List<ModelListener<BaseModel<?>>> getModelListeners(String modelClassName) { protected static List<ModelListener<BaseModel<?>>> getModelListeners(String modelClassName) {
return _modelListenersMap.get(modelClassName); return MODEL_LISTENERS_MAP.get(modelClassName);
} }
protected static String getServletContextName(String modelClassName) { protected static String getServletContextName(String modelClassName) {
return _servletContextNameMap.get(modelClassName); return SERVLET_CONTEXT_NAME_MAP.get(modelClassName);
} }
private final static Map<String, List<ModelListener<BaseModel<?>>>> _modelListenersMap = new ConcurrentHashMap<String, List<ModelListener<BaseModel<?>>>>(); private static final Map<String, List<ModelListener<BaseModel<?>>>> MODEL_LISTENERS_MAP = new ConcurrentHashMap<String, List<ModelListener<BaseModel<?>>>>();
private static final Map<String, String> SERVLET_CONTEXT_NAME_MAP = new ConcurrentHashMap<String, String>();
private final static Map<String, String> _servletContextNameMap = new ConcurrentHashMap<String, String>();
} }

2
liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/modellistener/shared/core/ModelListenerUtil.java

@ -73,5 +73,5 @@ public class ModelListenerUtil {
return (BasePersistence<?>) PortletBeanLocatorUtil.locate(servletContextName, beanName); return (BasePersistence<?>) PortletBeanLocatorUtil.locate(servletContextName, beanName);
} }
private final static Log _log = LogFactoryUtil.getLog(ModelListenerUtil.class); private static final Log _log = LogFactoryUtil.getLog(ModelListenerUtil.class);
} }

22
liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/PagamentoConstants.java

@ -9,17 +9,17 @@ public class PagamentoConstants {
public static final String PAGAMENTO_BOLLI = "02"; public static final String PAGAMENTO_BOLLI = "02";
public static final String PAGAMENTO_ONERI_BOLLI = "03"; public static final String PAGAMENTO_ONERI_BOLLI = "03";
public final static String MEZZO_ZERO = "00"; public static final String MEZZO_ZERO = "00";
public final static String MEZZO_MANUALE = "01"; public static final String MEZZO_MANUALE = "01";
public final static String UTILIZZATA_NO = "01"; // Da Portos 1 - serve solo per import public static final String UTILIZZATA_NO = "01"; // Da Portos 1 - serve solo per import
public final static String UTILIZZATA_SI = "02"; // Da Portos 1 - serve solo per import public static final String UTILIZZATA_SI = "02"; // Da Portos 1 - serve solo per import
public final static String UTILIZZATA_IN_CORSO = "03"; public static final String UTILIZZATA_IN_CORSO = "03";
public final static String UTILIZZATA_PAGATA = "04"; public static final String UTILIZZATA_PAGATA = "04";
public final static String UTILIZZATA_RIFIUTATA = "05"; public static final String UTILIZZATA_RIFIUTATA = "05";
public final static String UTILIZZATA_NON_PAGABILE = "06"; public static final String UTILIZZATA_NON_PAGABILE = "06";
public final static String UTILIZZATA_SOSTITUITA = "07"; public static final String UTILIZZATA_SOSTITUITA = "07";
public final static String UTILIZZATA_ANNULLATO = "08"; public static final String UTILIZZATA_ANNULLATO = "08";
@SuppressWarnings("serial") @SuppressWarnings("serial")
private static Map<String, String> mezzoToLabel = new HashMap<String, String>() { private static Map<String, String> mezzoToLabel = new HashMap<String, String>() {

10
liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/PortletKeys.java

@ -10,9 +10,9 @@ public class PortletKeys extends com.liferay.portal.util.PortletKeys {
public static final String CARICHI_LAVORO = "9_WAR_portosboportlet"; public static final String CARICHI_LAVORO = "9_WAR_portosboportlet";
public static final String TEMPISTICHE = "10_WAR_portosboportlet"; public static final String TEMPISTICHE = "10_WAR_portosboportlet";
public static final String PAGAMENTI_PENDING = "12_WAR_portosboportlet"; public static final String PAGAMENTI_PENDING = "12_WAR_portosboportlet";
public final static String FASCICOLOFE = "1_WAR_portosfeportlet"; public static final String FASCICOLOFE = "1_WAR_portosfeportlet";
public final static String SOGGETTI = "3_WAR_portosfeportlet"; public static final String SOGGETTI = "3_WAR_portosfeportlet";
public final static String ALLEGATI = "4_WAR_portosfeportlet"; public static final String ALLEGATI = "4_WAR_portosfeportlet";
public final static String COMUNICAZIONI = "1_WAR_portoscomunicazioniportlet"; public static final String COMUNICAZIONI = "1_WAR_portoscomunicazioniportlet";
public final static String MAPIT = "5_WAR_trefmapitmapportlet"; public static final String MAPIT = "5_WAR_trefmapitmapportlet";
} }

10
liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/SezioniUtil.java

@ -2,9 +2,9 @@ package it.tref.liferay.portos.bo.shared.util;
public class SezioniUtil { public class SezioniUtil {
public final static String SEZIONE_DETTAGLI_PRINCIPALI = "01"; public static final String SEZIONE_DETTAGLI_PRINCIPALI = "01";
public final static String SEZIONE_ANAGRAFE_SOGGETTI = "02"; public static final String SEZIONE_ANAGRAFE_SOGGETTI = "02";
public final static String SEZIONE_DESCRIZIONE_EDIFICIO = "03"; public static final String SEZIONE_DESCRIZIONE_EDIFICIO = "03";
public final static String SEZIONE_GEOLOGICA = "04"; public static final String SEZIONE_GEOLOGICA = "04";
public final static String SEZIONE_ALLEGATI = "05"; public static final String SEZIONE_ALLEGATI = "05";
} }

28
liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/StatoPraticaConstants.java

@ -45,7 +45,7 @@ public class StatoPraticaConstants {
public static final String INVIO_AVVISO_MANUALE = "MA"; public static final String INVIO_AVVISO_MANUALE = "MA";
@SuppressWarnings("serial") @SuppressWarnings("serial")
private static final Map<String, String> statusLabel = new HashMap<String, String>() { private static final Map<String, String> STATUS_LABEL = new HashMap<String, String>() {
{ {
put(ANNULLATA, "label.admingeniocivile.statopratica.annullata"); put(ANNULLATA, "label.admingeniocivile.statopratica.annullata");
put(CAMBIO_ISTRUTTORE, "label.admingeniocivile.statopratica.cambiIstruttore"); put(CAMBIO_ISTRUTTORE, "label.admingeniocivile.statopratica.cambiIstruttore");
@ -73,7 +73,7 @@ public class StatoPraticaConstants {
}; };
@SuppressWarnings("serial") @SuppressWarnings("serial")
private final static Map<String, String> esitoAutorizzazione = new HashMap<String, String>() { private static final Map<String, String> ESITO_AUTORIZZAZIONE = new HashMap<String, String>() {
{ {
put(ANNULLATA, getLabel(ANNULLATA)); put(ANNULLATA, getLabel(ANNULLATA));
put(AUTORIZZATA, getLabel(AUTORIZZATA)); put(AUTORIZZATA, getLabel(AUTORIZZATA));
@ -85,34 +85,34 @@ public class StatoPraticaConstants {
} }
}; };
private final static Map<String, String> esitoDeposito; private static final Map<String, String> ESITO_DEPOSITO;
static { static {
esitoDeposito = new HashMap<>(); ESITO_DEPOSITO = new HashMap<>();
esitoDeposito.putAll(esitoAutorizzazione); ESITO_DEPOSITO.putAll(ESITO_AUTORIZZAZIONE);
esitoAutorizzazione.put(CONFORME, getLabel(AUTORIZZATA)); ESITO_AUTORIZZAZIONE.put(CONFORME, getLabel(AUTORIZZATA));
esitoAutorizzazione.put(NON_CONFORME, getLabel(NON_AUTORIZZATA)); ESITO_AUTORIZZAZIONE.put(NON_CONFORME, getLabel(NON_AUTORIZZATA));
esitoDeposito.put(CONFORME, getLabel(CONFORME)); ESITO_DEPOSITO.put(CONFORME, getLabel(CONFORME));
esitoDeposito.put(NON_CONFORME, getLabel(NON_CONFORME)); ESITO_DEPOSITO.put(NON_CONFORME, getLabel(NON_CONFORME));
} }
public static String getStatusLabel(String statoPratica) { public static String getStatusLabel(String statoPratica) {
return statusLabel.get(statoPratica); return STATUS_LABEL.get(statoPratica);
} }
public static String getEsitoAutorizzazione(String esito) { public static String getEsitoAutorizzazione(String esito) {
if (esitoAutorizzazione.containsKey(esito)) { if (ESITO_AUTORIZZAZIONE.containsKey(esito)) {
return esitoAutorizzazione.get(esito); return ESITO_AUTORIZZAZIONE.get(esito);
} }
return StringPool.BLANK; return StringPool.BLANK;
} }
public static String getEsitoDeposito(String esito) { public static String getEsitoDeposito(String esito) {
if (esitoDeposito.containsKey(esito)) { if (ESITO_DEPOSITO.containsKey(esito)) {
return esitoDeposito.get(esito); return ESITO_DEPOSITO.get(esito);
} }
return StringPool.BLANK; return StringPool.BLANK;
} }

2
liferay-plugins-sdk-6.2/shared/portos-kaleo-shared/src/it/tref/liferay/portos/kaleo/shared/util/PortletKeys.java

@ -2,5 +2,5 @@ package it.tref.liferay.portos.kaleo.shared.util;
public class PortletKeys extends com.liferay.portal.util.PortletKeys { public class PortletKeys extends com.liferay.portal.util.PortletKeys {
public final static String WORKFLOW_FORM_ADMIN = "1_WAR_portoskaleoportlet"; public static final String WORKFLOW_FORM_ADMIN = "1_WAR_portoskaleoportlet";
} }

2
liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/messaging/util/MailManagerUtil.java

@ -29,7 +29,7 @@ import com.liferay.portal.service.ServiceContext;
public class MailManagerUtil { public class MailManagerUtil {
private final static Log _log = LogFactoryUtil.getLog(MailManagerUtil.class); private static final Log _log = LogFactoryUtil.getLog(MailManagerUtil.class);
public static boolean sendMail(String messageId, String inReplyTo, String from, String[] to, String[] cc, public static boolean sendMail(String messageId, String inReplyTo, String from, String[] to, String[] cc,
String[] bcc, String subject, String body, boolean htmlFormat, boolean async, boolean checkPermission, String[] bcc, String subject, String body, boolean htmlFormat, boolean async, boolean checkPermission,

32
liferay-plugins-sdk-6.2/shared/portos-report-shared/src/it/tref/liferay/portos/report/shared/constants/ReportConstants.java

@ -14,26 +14,26 @@ public class ReportConstants {
HTML_TO_PDF, JRXML_TO_PDF, VELOCITY_TO_PDF, ODT_TO_PDF HTML_TO_PDF, JRXML_TO_PDF, VELOCITY_TO_PDF, ODT_TO_PDF
} }
public final static String COMPANY_ID = "companyId"; public static final String COMPANY_ID = "companyId";
public final static String USER_ID = "userId"; public static final String USER_ID = "userId";
public final static String PARAMATERS = "paramaters"; public static final String PARAMATERS = "paramaters";
public final static String PARAM_REPORTS = "reports"; public static final String PARAM_REPORTS = "reports";
public final static String PARAM_PROCESS_MODE = "processMode"; public static final String PARAM_PROCESS_MODE = "processMode";
public final static String PARAM_RESPONSE_DESTINATION_NAME = "responseDestinationName"; public static final String PARAM_RESPONSE_DESTINATION_NAME = "responseDestinationName";
public final static String SERVICE_CONTEXT = "serviceContext"; public static final String SERVICE_CONTEXT = "serviceContext";
public final static String FILE_ENTRY_ID_TEMPLATE = "fileEntryIdTemplate"; public static final String FILE_ENTRY_ID_TEMPLATE = "fileEntryIdTemplate";
public final static String REPORT_PARAMETERS = "reportParameters"; public static final String REPORT_PARAMETERS = "reportParameters";
public final static String REPORT_DATASOURCE = "reportDataSource"; public static final String REPORT_DATASOURCE = "reportDataSource";
public final static String REPORT_NAME = "reportName"; public static final String REPORT_NAME = "reportName";
public final static String FOLDER_ID_REPORT = "folderIdReport"; public static final String FOLDER_ID_REPORT = "folderIdReport";
/* /*
* Genio Civile * Genio Civile
*/ */
public final static String LOGO_REGIONE = "LOGO_REGIONE"; public static final String LOGO_REGIONE = "LOGO_REGIONE";
public final static String LOGO_DIPARTIMENTO = "LOGO_DIPARTIMENTO"; public static final String LOGO_DIPARTIMENTO = "LOGO_DIPARTIMENTO";
public final static String PATH_LOGO_REGIONE = "/resource/report/LOGO_REGIONE.png"; public static final String PATH_LOGO_REGIONE = "/resource/report/LOGO_REGIONE.png";
public final static String PATH_LOGO_DIPARTIMENTO = "/resource/report/LOGO_DIPARTIMENTO.png"; public static final String PATH_LOGO_DIPARTIMENTO = "/resource/report/LOGO_DIPARTIMENTO.png";
} }

6
liferay-plugins-sdk-6.2/shared/portos-report-shared/src/it/tref/liferay/portos/report/shared/constants/ReportDestinationNames.java

@ -2,7 +2,7 @@ package it.tref.liferay.portos.report.shared.constants;
public class ReportDestinationNames { public class ReportDestinationNames {
public final static String SERIAL = "liferay/tref/portos/report_serial"; public static final String SERIAL = "liferay/tref/portos/report_serial";
public final static String SYNC = "liferay/tref/portos/report_sync"; public static final String SYNC = "liferay/tref/portos/report_sync";
public final static String SYNC_PROTOCOLLO = "liferay/tref/portos/protocollo_sync"; public static final String SYNC_PROTOCOLLO = "liferay/tref/portos/protocollo_sync";
} }

27
liferay-plugins-sdk-6.2/shared/portos-report-shared/src/it/tref/liferay/portos/report/shared/util/PdfUtil.java

@ -1,5 +1,13 @@
package it.tref.liferay.portos.report.shared.util; package it.tref.liferay.portos.report.shared.util;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import com.itextpdf.text.Document; import com.itextpdf.text.Document;
import com.itextpdf.text.DocumentException; import com.itextpdf.text.DocumentException;
import com.itextpdf.text.Element; import com.itextpdf.text.Element;
@ -20,17 +28,9 @@ 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.Validator; import com.liferay.portal.kernel.util.Validator;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
public class PdfUtil { public class PdfUtil {
private final static Log _log = LogFactoryUtil.getLog(PdfUtil.class); private static final Log _log = LogFactoryUtil.getLog(PdfUtil.class);
public static byte[] merge(InputStream pdf1, InputStream pdf2) { public static byte[] merge(InputStream pdf1, InputStream pdf2) {
@ -77,8 +77,7 @@ public class PdfUtil {
} }
iteratorPDFReader = readers.iterator(); iteratorPDFReader = readers.iterator();
// Loop through the PDF files and add to the output. // Loop through the PDF files and add to the output.
while (iteratorPDFReader.hasNext()) { while (iteratorPDFReader.hasNext()) {}
}
outputStream.flush(); outputStream.flush();
document.close(); document.close();
@ -131,9 +130,9 @@ public class PdfUtil {
if (showNumberOfPage) { if (showNumberOfPage) {
// add page numbers // add page numbers
ColumnText.showTextAligned(stamp.getUnderContent(), Element.ALIGN_CENTER, new Phrase( ColumnText.showTextAligned(stamp.getUnderContent(), Element.ALIGN_CENTER,
String.format("%d / %d", curentPageNumber, totalPage)), pdfImportedPage new Phrase(String.format("%d / %d", curentPageNumber, totalPage)),
.getHeight() / 2, 20, 0); pdfImportedPage.getHeight() / 2, 20, 0);
} }
stamp.alterContents(); stamp.alterContents();

8
liferay-plugins-sdk-6.2/webs/portos-kaleo-web/.classpath

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" path="docroot/WEB-INF/src"/> <classpathentry kind="src" path="docroot/WEB-INF/src"/>
<classpathentry kind="src" path="docroot/WEB-INF/service"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.7.0_80"> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.7.0_80">
<attributes> <attributes>
<attribute name="owner.project.facets" value="java"/> <attribute name="owner.project.facets" value="java"/>
@ -12,18 +13,11 @@
<attribute name="org.eclipse.jst.component.nondependency" value=""/> <attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="lib" path="docroot/WEB-INF/lib/portos-kaleo-portlet-service.jar"/>
<classpathentry kind="lib" path="docroot/WEB-INF/lib/kaleo-web-service.jar"/>
<classpathentry kind="lib" path="docroot/WEB-INF/lib/portal-compat-shared.jar"/>
<classpathentry kind="lib" path="docroot/WEB-INF/lib/util-java.jar"/>
<classpathentry kind="lib" path="docroot/WEB-INF/lib/portos-bo-portlet-service.jar"/>
<classpathentry kind="lib" path="/home/ture/liferay/portali/paesaggistica/tomcat-7.0.62/lib/ext/portal-service.jar" sourcepath="/home/ture/liferay/src/liferay-patched/liferay-portal"/>
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/com.liferay.ide.eclipse.server.tomcat.runtimeClasspathProvider/Liferay v6.2 CE (Tomcat 7)"> <classpathentry kind="con" path="org.eclipse.jst.server.core.container/com.liferay.ide.eclipse.server.tomcat.runtimeClasspathProvider/Liferay v6.2 CE (Tomcat 7)">
<attributes> <attributes>
<attribute name="owner.project.facets" value="jst.web"/> <attribute name="owner.project.facets" value="jst.web"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/> <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="lib" path="/home/ture/liferay/portali/paesaggistica/tomcat-7.0.62/webapps/ROOT/WEB-INF/lib/portal-impl.jar"/>
<classpathentry kind="output" path="docroot/WEB-INF/classes"/> <classpathentry kind="output" path="docroot/WEB-INF/classes"/>
</classpath> </classpath>

4
liferay-plugins-sdk-6.2/webs/portos-kaleo-web/.settings/org.eclipse.wst.common.component

@ -2,9 +2,13 @@
<wb-module deploy-name="portos-kaleo-web"> <wb-module deploy-name="portos-kaleo-web">
<wb-resource deploy-path="/" source-path="/docroot" tag="defaultRootSource"/> <wb-resource deploy-path="/" source-path="/docroot" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/docroot/WEB-INF/src"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/docroot/WEB-INF/src"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/docroot/WEB-INF/service"/>
<dependent-module archiveName="portos-kaleo-portlet-service.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/lib/portos-kaleo-portlet/docroot/WEB-INF/lib/portos-kaleo-portlet-service.jar"> <dependent-module archiveName="portos-kaleo-portlet-service.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/lib/portos-kaleo-portlet/docroot/WEB-INF/lib/portos-kaleo-portlet-service.jar">
<dependency-type>uses</dependency-type> <dependency-type>uses</dependency-type>
</dependent-module> </dependent-module>
<dependent-module archiveName="portos-bo-portlet-service.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/lib/portos-bo-portlet/docroot/WEB-INF/lib/portos-bo-portlet-service.jar">
<dependency-type>uses</dependency-type>
</dependent-module>
<property name="context-root" value="portos-kaleo-web"/> <property name="context-root" value="portos-kaleo-web"/>
<property name="java-output-path" value="/portos-kaleo-web/docroot/WEB-INF/classes"/> <property name="java-output-path" value="/portos-kaleo-web/docroot/WEB-INF/classes"/>
</wb-module> </wb-module>

BIN
liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/lib/portos-kaleo-portlet-service.jar

File binario non mostrato.

5
liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/liferay-plugin-package.properties

@ -8,12 +8,13 @@ page-url=http://www.liferay.com
author=Liferay, Inc. author=Liferay, Inc.
licenses=LGPL licenses=LGPL
portal-dependency-jars=\ portal-dependency-jars=\
commons-codec.jar,\
commons-collections.jar,\ commons-collections.jar,\
commons-lang.jar,\
jabsorb.jar,\ jabsorb.jar,\
json-java.jar,\ json-java.jar,\
slf4j-api.jar,\ slf4j-api.jar,\
util-slf4j.jar,\ util-slf4j.jar
commons-codec.jar
required-deployment-contexts=\ required-deployment-contexts=\
portos-kaleo-portlet,\ portos-kaleo-portlet,\
portos-bo-portlet portos-bo-portlet

14
liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/WorkflowTaskManagerImpl.java

@ -1,13 +1,9 @@
/** /**
* Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. This library is free software; you can redistribute it
* * and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General * Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in
* Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) * the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* any later version. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/ */
package com.liferay.portal.workflow.kaleo; package com.liferay.portal.workflow.kaleo;

229
liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/DefaultTaskManagerImpl.java

@ -1,19 +1,18 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it
* * and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software
* This library is free software; you can redistribute it and/or modify it under * Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in
* the terms of the GNU Lesser General Public License as published by the Free * the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* Software Foundation; either version 2.1 of the License, or (at your option) * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
* 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 com.liferay.portal.workflow.kaleo.runtime; package com.liferay.portal.workflow.kaleo.runtime;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Map;
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.transaction.Isolation; import com.liferay.portal.kernel.transaction.Isolation;
@ -38,176 +37,126 @@ import com.liferay.portal.workflow.kaleo.runtime.notification.NotificationUtil;
import com.liferay.portal.workflow.kaleo.util.WorkflowContextUtil; import com.liferay.portal.workflow.kaleo.util.WorkflowContextUtil;
import com.liferay.portal.workflow.kaleo.util.WorkflowModelUtil; import com.liferay.portal.workflow.kaleo.util.WorkflowModelUtil;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Map;
/** /**
* @author Michael C. Han * @author Michael C. Han
*/ */
@Transactional( @Transactional(isolation = Isolation.PORTAL, propagation = Propagation.REQUIRED, rollbackFor = { Exception.class })
isolation = Isolation.PORTAL, propagation = Propagation.REQUIRED, public class DefaultTaskManagerImpl extends BaseKaleoBean implements TaskManager {
rollbackFor = {Exception.class})
public class DefaultTaskManagerImpl
extends BaseKaleoBean implements TaskManager {
public WorkflowTask assignWorkflowTaskToRole( @Override
long workflowTaskInstanceId, long roleId, String comment, public WorkflowTask assignWorkflowTaskToRole(long workflowTaskInstanceId, long roleId, String comment,
Date dueDate, Map<String, Serializable> workflowContext, Date dueDate, Map<String, Serializable> workflowContext, ServiceContext serviceContext)
ServiceContext serviceContext)
throws WorkflowException { throws WorkflowException {
try { try {
return assignWorkflowTask( return assignWorkflowTask(workflowTaskInstanceId, Role.class.getName(), roleId, comment, dueDate,
workflowTaskInstanceId, Role.class.getName(), roleId, comment, workflowContext, serviceContext);
dueDate, workflowContext, serviceContext); } catch (Exception e) {
}
catch (Exception e) {
throw new WorkflowException(e); throw new WorkflowException(e);
} }
} }
@Override
public WorkflowTask assignWorkflowTaskToUser( public WorkflowTask assignWorkflowTaskToUser(long workflowTaskInstanceId, long assigneeUserId, String comment,
long workflowTaskInstanceId, long assigneeUserId, String comment, Date dueDate, Map<String, Serializable> workflowContext, ServiceContext serviceContext)
Date dueDate, Map<String, Serializable> workflowContext,
ServiceContext serviceContext)
throws WorkflowException { throws WorkflowException {
try { try {
return assignWorkflowTask( return assignWorkflowTask(workflowTaskInstanceId, User.class.getName(), assigneeUserId, comment, dueDate,
workflowTaskInstanceId, User.class.getName(), assigneeUserId, workflowContext, serviceContext);
comment, dueDate, workflowContext, serviceContext); } catch (Exception e) {
}
catch (Exception e) {
throw new WorkflowException(e); throw new WorkflowException(e);
} }
} }
@Override
public WorkflowTask completeWorkflowTask( public WorkflowTask completeWorkflowTask(long workflowTaskInstanceId, String transitionName, String comment,
long workflowTaskInstanceId, String transitionName, String comment, Map<String, Serializable> workflowContext, ServiceContext serviceContext) throws WorkflowException {
Map<String, Serializable> workflowContext,
ServiceContext serviceContext)
throws WorkflowException {
try { try {
return doCompleteWorkflowTask( return doCompleteWorkflowTask(workflowTaskInstanceId, transitionName, comment, workflowContext,
workflowTaskInstanceId, transitionName, comment, serviceContext);
workflowContext, serviceContext); } catch (Exception e) {
}
catch (Exception e) {
throw new WorkflowException(e); throw new WorkflowException(e);
} }
} }
@Override
public WorkflowTask updateDueDate( public WorkflowTask updateDueDate(long workflowTaskInstanceId, String comment, Date dueDate,
long workflowTaskInstanceId, String comment, Date dueDate, ServiceContext serviceContext) throws WorkflowException {
ServiceContext serviceContext)
throws WorkflowException {
try { try {
KaleoTaskInstanceToken kaleoTaskInstanceToken = KaleoTaskInstanceToken kaleoTaskInstanceToken = kaleoTaskInstanceTokenLocalService
kaleoTaskInstanceTokenLocalService.getKaleoTaskInstanceToken( .getKaleoTaskInstanceToken(workflowTaskInstanceId);
workflowTaskInstanceId);
if (kaleoTaskInstanceToken.isCompleted()) { if (kaleoTaskInstanceToken.isCompleted()) {
throw new WorkflowException( throw new WorkflowException("Cannot update due date for completed task " + workflowTaskInstanceId);
"Cannot update due date for completed task " +
workflowTaskInstanceId);
} }
if (dueDate != null) { if (dueDate != null) {
kaleoTaskInstanceTokenLocalService.updateDueDate( kaleoTaskInstanceTokenLocalService.updateDueDate(workflowTaskInstanceId, dueDate, serviceContext);
workflowTaskInstanceId, dueDate, serviceContext);
} }
Map<String, Serializable> workflowContext = Map<String, Serializable> workflowContext = WorkflowContextUtil.convert(kaleoTaskInstanceToken
WorkflowContextUtil.convert( .getWorkflowContext());
kaleoTaskInstanceToken.getWorkflowContext());
kaleoLogLocalService.addTaskUpdateKaleoLog( kaleoLogLocalService
kaleoTaskInstanceToken, comment, workflowContext, .addTaskUpdateKaleoLog(kaleoTaskInstanceToken, comment, workflowContext, serviceContext);
serviceContext);
return WorkflowModelUtil.toWorkflowTask( return WorkflowModelUtil.toWorkflowTask(kaleoTaskInstanceToken, workflowContext);
kaleoTaskInstanceToken, workflowContext); } catch (Exception e) {
}
catch (Exception e) {
throw new WorkflowException(e); throw new WorkflowException(e);
} }
} }
protected WorkflowTask assignWorkflowTask( protected WorkflowTask assignWorkflowTask(long workflowTaskInstanceId, String assigneeClassName,
long workflowTaskInstanceId, String assigneeClassName, long assigneeClassPK, String comment, Date dueDate, Map<String, Serializable> workflowContext,
long assigneeClassPK, String comment, Date dueDate, ServiceContext serviceContext) throws Exception {
Map<String, Serializable> workflowContext,
ServiceContext serviceContext)
throws Exception {
KaleoTaskInstanceToken kaleoTaskInstanceToken = KaleoTaskInstanceToken kaleoTaskInstanceToken = kaleoTaskInstanceTokenLocalService
kaleoTaskInstanceTokenLocalService.getKaleoTaskInstanceToken( .getKaleoTaskInstanceToken(workflowTaskInstanceId);
workflowTaskInstanceId);
List<KaleoTaskAssignmentInstance> previousTaskAssignmentInstances = List<KaleoTaskAssignmentInstance> previousTaskAssignmentInstances = kaleoTaskInstanceToken
kaleoTaskInstanceToken.getKaleoTaskAssignmentInstances(); .getKaleoTaskAssignmentInstances();
workflowContext = updateWorkflowContext( workflowContext = updateWorkflowContext(workflowContext, kaleoTaskInstanceToken);
workflowContext, kaleoTaskInstanceToken);
if (kaleoTaskInstanceToken.isCompleted()) { if (kaleoTaskInstanceToken.isCompleted()) {
throw new WorkflowException( throw new WorkflowException("Cannot reassign a completed task " + workflowTaskInstanceId);
"Cannot reassign a completed task " + workflowTaskInstanceId);
} }
if (dueDate != null) { if (dueDate != null) {
kaleoTaskInstanceTokenLocalService.updateDueDate( kaleoTaskInstanceTokenLocalService.updateDueDate(workflowTaskInstanceId, dueDate, serviceContext);
workflowTaskInstanceId, dueDate, serviceContext);
} }
kaleoTaskInstanceToken = kaleoTaskInstanceToken = kaleoTaskInstanceTokenLocalService.assignKaleoTaskInstanceToken(
kaleoTaskInstanceTokenLocalService.assignKaleoTaskInstanceToken( kaleoTaskInstanceToken.getKaleoTaskInstanceTokenId(), assigneeClassName, assigneeClassPK,
kaleoTaskInstanceToken.getKaleoTaskInstanceTokenId(), workflowContext, serviceContext);
assigneeClassName, assigneeClassPK, workflowContext,
serviceContext);
workflowContext.put(WorkflowConstants.CONTEXT_TASK_COMMENTS, comment); workflowContext.put(WorkflowConstants.CONTEXT_TASK_COMMENTS, comment);
ExecutionContext executionContext = new ExecutionContext( ExecutionContext executionContext = new ExecutionContext(kaleoTaskInstanceToken.getKaleoInstanceToken(),
kaleoTaskInstanceToken.getKaleoInstanceToken(),
kaleoTaskInstanceToken, workflowContext, serviceContext); kaleoTaskInstanceToken, workflowContext, serviceContext);
KaleoTask kaleoTask = kaleoTaskInstanceToken.getKaleoTask(); KaleoTask kaleoTask = kaleoTaskInstanceToken.getKaleoTask();
ActionExecutorUtil.executeKaleoActions( ActionExecutorUtil.executeKaleoActions(KaleoNode.class.getName(), kaleoTask.getKaleoNodeId(),
KaleoNode.class.getName(), kaleoTask.getKaleoNodeId(),
ExecutionType.ON_ASSIGNMENT, executionContext); ExecutionType.ON_ASSIGNMENT, executionContext);
NotificationUtil.sendKaleoNotifications( NotificationUtil.sendKaleoNotifications(KaleoNode.class.getName(), kaleoTask.getKaleoNodeId(),
KaleoNode.class.getName(), kaleoTask.getKaleoNodeId(),
ExecutionType.ON_ASSIGNMENT, executionContext); ExecutionType.ON_ASSIGNMENT, executionContext);
kaleoLogLocalService.addTaskAssignmentKaleoLog( kaleoLogLocalService.addTaskAssignmentKaleoLog(previousTaskAssignmentInstances, kaleoTaskInstanceToken,
previousTaskAssignmentInstances, kaleoTaskInstanceToken, comment, comment, workflowContext, serviceContext);
workflowContext, serviceContext);
return WorkflowModelUtil.toWorkflowTask( return WorkflowModelUtil.toWorkflowTask(kaleoTaskInstanceToken, workflowContext);
kaleoTaskInstanceToken, workflowContext);
} }
protected WorkflowTask doCompleteWorkflowTask( protected WorkflowTask doCompleteWorkflowTask(long workflowTaskInstanceId, String transitionName, String comment,
long workflowTaskInstanceId, String transitionName, String comment, Map<String, Serializable> workflowContext, ServiceContext serviceContext) throws Exception {
Map<String, Serializable> workflowContext,
ServiceContext serviceContext)
throws Exception {
KaleoTaskInstanceToken kaleoTaskInstanceToken = KaleoTaskInstanceToken kaleoTaskInstanceToken = kaleoTaskInstanceTokenLocalService
kaleoTaskInstanceTokenLocalService.getKaleoTaskInstanceToken( .getKaleoTaskInstanceToken(workflowTaskInstanceId);
workflowTaskInstanceId);
if (Validator.isNotNull(transitionName)) { if (Validator.isNotNull(transitionName)) {
@ -221,49 +170,37 @@ public class DefaultTaskManagerImpl
currentKaleoNode.getKaleoTransition(transitionName); currentKaleoNode.getKaleoTransition(transitionName);
} }
workflowContext = updateWorkflowContext( workflowContext = updateWorkflowContext(workflowContext, kaleoTaskInstanceToken);
workflowContext, kaleoTaskInstanceToken);
if (kaleoTaskInstanceToken.isCompleted()) { if (kaleoTaskInstanceToken.isCompleted()) {
throw new WorkflowException( throw new WorkflowException("Cannot complete an already completed task " + workflowTaskInstanceId
"Cannot complete an already completed task " + + " for user " + serviceContext.getUserId());
workflowTaskInstanceId + " for user " +
serviceContext.getUserId());
} }
serviceContext.setScopeGroupId(kaleoTaskInstanceToken.getGroupId()); serviceContext.setScopeGroupId(kaleoTaskInstanceToken.getGroupId());
kaleoTaskInstanceToken = kaleoTaskInstanceToken = kaleoTaskInstanceTokenLocalService.completeKaleoTaskInstanceToken(
kaleoTaskInstanceTokenLocalService.completeKaleoTaskInstanceToken( kaleoTaskInstanceToken.getKaleoTaskInstanceTokenId(), serviceContext);
kaleoTaskInstanceToken.getKaleoTaskInstanceTokenId(),
serviceContext);
kaleoLogLocalService.addTaskCompletionKaleoLog( kaleoLogLocalService
kaleoTaskInstanceToken, comment, workflowContext, serviceContext); .addTaskCompletionKaleoLog(kaleoTaskInstanceToken, comment, workflowContext, serviceContext);
return WorkflowModelUtil.toWorkflowTask( return WorkflowModelUtil.toWorkflowTask(kaleoTaskInstanceToken, workflowContext);
kaleoTaskInstanceToken, workflowContext);
} }
protected Map<String, Serializable> updateWorkflowContext( protected Map<String, Serializable> updateWorkflowContext(Map<String, Serializable> workflowContext,
Map<String, Serializable> workflowContext, KaleoTaskInstanceToken kaleoTaskInstanceToken) throws PortalException, SystemException {
KaleoTaskInstanceToken kaleoTaskInstanceToken)
throws PortalException, SystemException {
KaleoInstance kaleoInstance = KaleoInstance kaleoInstance = kaleoInstanceLocalService.getKaleoInstance(kaleoTaskInstanceToken
kaleoInstanceLocalService.getKaleoInstance( .getKaleoInstanceId());
kaleoTaskInstanceToken.getKaleoInstanceId());
if (workflowContext == null) { if (workflowContext == null) {
workflowContext = WorkflowContextUtil.convert( workflowContext = WorkflowContextUtil.convert(kaleoInstance.getWorkflowContext());
kaleoInstance.getWorkflowContext()); } else {
} Map<String, Serializable> storedWorkflowContext = WorkflowContextUtil.convert(kaleoInstance
else { .getWorkflowContext());
Map<String, Serializable> storedWorkflowContext =
WorkflowContextUtil.convert(kaleoInstance.getWorkflowContext());
for (Map.Entry<String, Serializable> entry : for (Map.Entry<String, Serializable> entry : storedWorkflowContext.entrySet()) {
storedWorkflowContext.entrySet()) {
String key = entry.getKey(); String key = entry.getKey();

91
liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/ConditionNodeExecutor.java

@ -1,19 +1,15 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it
* * and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software
* This library is free software; you can redistribute it and/or modify it under * Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in
* the terms of the GNU Lesser General Public License as published by the Free * the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* Software Foundation; either version 2.1 of the License, or (at your option) * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
* 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 com.liferay.portal.workflow.kaleo.runtime.node; package com.liferay.portal.workflow.kaleo.runtime.node;
import java.util.List;
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.util.StringUtil; import com.liferay.portal.kernel.util.StringUtil;
@ -27,8 +23,6 @@ import com.liferay.portal.workflow.kaleo.runtime.condition.ConditionEvaluator;
import com.liferay.portal.workflow.kaleo.runtime.graph.PathElement; import com.liferay.portal.workflow.kaleo.runtime.graph.PathElement;
import com.liferay.portal.workflow.kaleo.runtime.util.ClassLoaderUtil; import com.liferay.portal.workflow.kaleo.runtime.util.ClassLoaderUtil;
import java.util.List;
/** /**
* @author Michael C. Han * @author Michael C. Han
*/ */
@ -38,66 +32,39 @@ public class ConditionNodeExecutor extends BaseNodeExecutor {
_conditionEvaluator = conditionEvaluator; _conditionEvaluator = conditionEvaluator;
} }
@Override
protected boolean doEnter( protected boolean doEnter(KaleoNode currentKaleoNode, ExecutionContext executionContext) {
KaleoNode currentKaleoNode, ExecutionContext executionContext) {
return true; return true;
} }
@Override
protected void doExecute(KaleoNode currentKaleoNode, ExecutionContext executionContext,
List<PathElement> remainingPathElements) throws PortalException, SystemException {
protected void doExecute( KaleoInstanceToken kaleoInstanceToken = executionContext.getKaleoInstanceToken();
KaleoNode currentKaleoNode, ExecutionContext executionContext,
List<PathElement> remainingPathElements)
throws PortalException, SystemException {
KaleoInstanceToken kaleoInstanceToken =
executionContext.getKaleoInstanceToken();
KaleoCondition kaleoCondition = KaleoCondition kaleoCondition =
kaleoConditionLocalService.getKaleoNodeKaleoCondition( kaleoConditionLocalService.getKaleoNodeKaleoCondition(currentKaleoNode.getKaleoNodeId());
currentKaleoNode.getKaleoNodeId()); String[] scriptRequiredContexts = StringUtil.split(kaleoCondition.getScriptRequiredContexts());
ClassLoader[] classloaders = ClassLoaderUtil.getClassLoaders(scriptRequiredContexts);
String[] scriptRequiredContexts = StringUtil.split( String transitionName = _conditionEvaluator.evaluate(kaleoCondition, executionContext, classloaders);
kaleoCondition.getScriptRequiredContexts()); kaleoInstanceLocalService.updateKaleoInstance(kaleoInstanceToken.getKaleoInstanceId(),
executionContext.getWorkflowContext(), executionContext.getServiceContext());
ClassLoader[] classloaders = ClassLoaderUtil.getClassLoaders( KaleoTransition kaleoTransition = currentKaleoNode.getKaleoTransition(transitionName);
scriptRequiredContexts); ExecutionContext newExecutionContext =
new ExecutionContext(kaleoInstanceToken, executionContext.getWorkflowContext(),
String transitionName = _conditionEvaluator.evaluate(
kaleoCondition, executionContext, classloaders);
kaleoInstanceLocalService.updateKaleoInstance(
kaleoInstanceToken.getKaleoInstanceId(),
executionContext.getWorkflowContext(),
executionContext.getServiceContext()); executionContext.getServiceContext());
PathElement pathElement =
KaleoTransition kaleoTransition = currentKaleoNode.getKaleoTransition( new PathElement(currentKaleoNode, kaleoTransition.getTargetKaleoNode(), newExecutionContext);
transitionName);
ExecutionContext newExecutionContext = new ExecutionContext(
kaleoInstanceToken, executionContext.getWorkflowContext(),
executionContext.getServiceContext());
PathElement pathElement = new PathElement(
currentKaleoNode, kaleoTransition.getTargetKaleoNode(),
newExecutionContext);
remainingPathElements.add(pathElement); remainingPathElements.add(pathElement);
} }
@Override
protected void doExecuteTimer(KaleoNode currentKaleoNode, KaleoTimer kaleoTimer, ExecutionContext executionContext) {}
protected void doExecuteTimer( @Override
KaleoNode currentKaleoNode, KaleoTimer kaleoTimer, protected void doExit(KaleoNode currentKaleoNode, ExecutionContext executionContext,
ExecutionContext executionContext) { List<PathElement> remainingPathElements) {}
}
protected void doExit(
KaleoNode currentKaleoNode, ExecutionContext executionContext,
List<PathElement> remainingPathElements) {
}
private ConditionEvaluator _conditionEvaluator; private ConditionEvaluator _conditionEvaluator;
} }

88
liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/ForkNodeExecutor.java

@ -1,19 +1,17 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it
* * and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software
* This library is free software; you can redistribute it and/or modify it under * Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in
* the terms of the GNU Lesser General Public License as published by the Free * the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* Software Foundation; either version 2.1 of the License, or (at your option) * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
* 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 com.liferay.portal.workflow.kaleo.runtime.node; package com.liferay.portal.workflow.kaleo.runtime.node;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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.workflow.kaleo.model.KaleoInstanceToken; import com.liferay.portal.workflow.kaleo.model.KaleoInstanceToken;
@ -23,74 +21,46 @@ import com.liferay.portal.workflow.kaleo.model.KaleoTransition;
import com.liferay.portal.workflow.kaleo.runtime.ExecutionContext; import com.liferay.portal.workflow.kaleo.runtime.ExecutionContext;
import com.liferay.portal.workflow.kaleo.runtime.graph.PathElement; import com.liferay.portal.workflow.kaleo.runtime.graph.PathElement;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
* @author Michael C. Han * @author Michael C. Han
*/ */
public class ForkNodeExecutor extends BaseNodeExecutor { public class ForkNodeExecutor extends BaseNodeExecutor {
@Override
protected boolean doEnter( protected boolean doEnter(KaleoNode currentKaleoNode, ExecutionContext executionContext) {
KaleoNode currentKaleoNode, ExecutionContext executionContext) {
return true; return true;
} }
@Override
protected void doExecute(KaleoNode currentKaleoNode, ExecutionContext executionContext,
List<PathElement> remainingPathElements) throws PortalException, SystemException {
protected void doExecute( List<KaleoTransition> kaleoTransitions = currentKaleoNode.getKaleoTransitions();
KaleoNode currentKaleoNode, ExecutionContext executionContext, Map<String, KaleoInstanceToken> childKaleoInstanceTokens = new HashMap<String, KaleoInstanceToken>();
List<PathElement> remainingPathElements)
throws PortalException, SystemException {
List<KaleoTransition> kaleoTransitions =
currentKaleoNode.getKaleoTransitions();
Map<String, KaleoInstanceToken> childKaleoInstanceTokens =
new HashMap<String, KaleoInstanceToken>();
for (KaleoTransition kaleoTransition : kaleoTransitions) { for (KaleoTransition kaleoTransition : kaleoTransitions) {
KaleoInstanceToken parentKaleoInstanceToken = KaleoInstanceToken parentKaleoInstanceToken = executionContext.getKaleoInstanceToken();
executionContext.getKaleoInstanceToken();
KaleoInstanceToken childKaleoInstanceToken = KaleoInstanceToken childKaleoInstanceToken =
kaleoInstanceTokenLocalService.addKaleoInstanceToken( kaleoInstanceTokenLocalService.addKaleoInstanceToken(
parentKaleoInstanceToken.getKaleoInstanceTokenId(), parentKaleoInstanceToken.getKaleoInstanceTokenId(), executionContext.getWorkflowContext(),
executionContext.getWorkflowContext(),
executionContext.getServiceContext()); executionContext.getServiceContext());
childKaleoInstanceTokens.put(kaleoTransition.getName(), childKaleoInstanceToken);
childKaleoInstanceTokens.put(
kaleoTransition.getName(), childKaleoInstanceToken);
} }
for (KaleoTransition kaleoTransition : kaleoTransitions) { for (KaleoTransition kaleoTransition : kaleoTransitions) {
KaleoInstanceToken childKaleoInstanceToken = KaleoInstanceToken childKaleoInstanceToken = childKaleoInstanceTokens.get(kaleoTransition.getName());
childKaleoInstanceTokens.get(kaleoTransition.getName()); ExecutionContext forkedExecutionContext =
new ExecutionContext(childKaleoInstanceToken, executionContext.getWorkflowContext(),
ExecutionContext forkedExecutionContext = new ExecutionContext(
childKaleoInstanceToken, executionContext.getWorkflowContext(),
executionContext.getServiceContext()); executionContext.getServiceContext());
PathElement pathElement =
PathElement pathElement = new PathElement( new PathElement(currentKaleoNode, kaleoTransition.getTargetKaleoNode(), forkedExecutionContext);
currentKaleoNode, kaleoTransition.getTargetKaleoNode(),
forkedExecutionContext);
remainingPathElements.add(pathElement); remainingPathElements.add(pathElement);
} }
} }
@Override
protected void doExecuteTimer(KaleoNode currentKaleoNode, KaleoTimer kaleoTimer, ExecutionContext executionContext) {}
protected void doExecuteTimer( @Override
KaleoNode currentKaleoNode, KaleoTimer kaleoTimer, protected void doExit(KaleoNode currentKaleoNode, ExecutionContext executionContext,
ExecutionContext executionContext) { List<PathElement> remainingPathElements) {}
}
protected void doExit(
KaleoNode currentKaleoNode, ExecutionContext executionContext,
List<PathElement> remainingPathElements) {
}
} }

91
liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/JoinNodeExecutor.java

@ -1,19 +1,15 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it
* * and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software
* This library is free software; you can redistribute it and/or modify it under * Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in
* the terms of the GNU Lesser General Public License as published by the Free * the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* Software Foundation; either version 2.1 of the License, or (at your option) * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
* 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 com.liferay.portal.workflow.kaleo.runtime.node; package com.liferay.portal.workflow.kaleo.runtime.node;
import java.util.List;
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.workflow.kaleo.model.KaleoInstanceToken; import com.liferay.portal.workflow.kaleo.model.KaleoInstanceToken;
@ -23,74 +19,45 @@ import com.liferay.portal.workflow.kaleo.model.KaleoTransition;
import com.liferay.portal.workflow.kaleo.runtime.ExecutionContext; import com.liferay.portal.workflow.kaleo.runtime.ExecutionContext;
import com.liferay.portal.workflow.kaleo.runtime.graph.PathElement; import com.liferay.portal.workflow.kaleo.runtime.graph.PathElement;
import java.util.List;
/** /**
* @author Michael C. Han * @author Michael C. Han
*/ */
public class JoinNodeExecutor extends BaseNodeExecutor { public class JoinNodeExecutor extends BaseNodeExecutor {
@Override
protected boolean doEnter(KaleoNode currentKaleoNode, ExecutionContext executionContext) throws PortalException,
SystemException {
protected boolean doEnter( KaleoInstanceToken kaleoInstanceToken = executionContext.getKaleoInstanceToken();
KaleoNode currentKaleoNode, ExecutionContext executionContext) kaleoInstanceTokenLocalService.completeKaleoInstanceToken(kaleoInstanceToken.getKaleoInstanceTokenId());
throws PortalException, SystemException {
KaleoInstanceToken kaleoInstanceToken =
executionContext.getKaleoInstanceToken();
kaleoInstanceTokenLocalService.completeKaleoInstanceToken(
kaleoInstanceToken.getKaleoInstanceTokenId());
return true; return true;
} }
@Override
protected void doExecute(KaleoNode currentKaleoNode, ExecutionContext executionContext,
List<PathElement> remainingPathElements) throws PortalException, SystemException {
protected void doExecute( KaleoInstanceToken kaleoInstanceToken = executionContext.getKaleoInstanceToken();
KaleoNode currentKaleoNode, ExecutionContext executionContext, KaleoInstanceToken parentKaleoInstanceToken = kaleoInstanceToken.getParentKaleoInstanceToken();
List<PathElement> remainingPathElements) if (parentKaleoInstanceToken.hasIncompleteChildrenKaleoInstanceToken()) {
throws PortalException, SystemException {
KaleoInstanceToken kaleoInstanceToken =
executionContext.getKaleoInstanceToken();
KaleoInstanceToken parentKaleoInstanceToken =
kaleoInstanceToken.getParentKaleoInstanceToken();
if (parentKaleoInstanceToken.
hasIncompleteChildrenKaleoInstanceToken()) {
return; return;
} }
parentKaleoInstanceToken = parentKaleoInstanceToken =
kaleoInstanceTokenLocalService.updateKaleoInstanceToken( kaleoInstanceTokenLocalService.updateKaleoInstanceToken(
parentKaleoInstanceToken.getKaleoInstanceTokenId(), parentKaleoInstanceToken.getKaleoInstanceTokenId(), currentKaleoNode.getKaleoNodeId());
currentKaleoNode.getKaleoNodeId()); KaleoTransition kaleoTransition = currentKaleoNode.getDefaultKaleoTransition();
ExecutionContext newExecutionContext =
KaleoTransition kaleoTransition = new ExecutionContext(parentKaleoInstanceToken, executionContext.getWorkflowContext(),
currentKaleoNode.getDefaultKaleoTransition();
ExecutionContext newExecutionContext = new ExecutionContext(
parentKaleoInstanceToken, executionContext.getWorkflowContext(),
executionContext.getServiceContext()); executionContext.getServiceContext());
PathElement pathElement =
PathElement pathElement = new PathElement( new PathElement(currentKaleoNode, kaleoTransition.getTargetKaleoNode(), newExecutionContext);
currentKaleoNode, kaleoTransition.getTargetKaleoNode(),
newExecutionContext);
remainingPathElements.add(pathElement); remainingPathElements.add(pathElement);
} }
@Override
protected void doExecuteTimer(KaleoNode currentKaleoNode, KaleoTimer kaleoTimer, ExecutionContext executionContext) {}
protected void doExecuteTimer( @Override
KaleoNode currentKaleoNode, KaleoTimer kaleoTimer, protected void doExit(KaleoNode currentKaleoNode, ExecutionContext executionContext,
ExecutionContext executionContext) { List<PathElement> remainingPathElements) {}
}
protected void doExit(
KaleoNode currentKaleoNode, ExecutionContext executionContext,
List<PathElement> remainingPathElements) {
}
} }

115
liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/JoinXorNodeExecutor.java

@ -1,19 +1,15 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it
* * and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software
* This library is free software; you can redistribute it and/or modify it under * Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in
* the terms of the GNU Lesser General Public License as published by the Free * the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* Software Foundation; either version 2.1 of the License, or (at your option) * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
* 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 com.liferay.portal.workflow.kaleo.runtime.node; package com.liferay.portal.workflow.kaleo.runtime.node;
import java.util.List;
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.workflow.kaleo.model.KaleoInstanceToken; import com.liferay.portal.workflow.kaleo.model.KaleoInstanceToken;
@ -23,102 +19,61 @@ import com.liferay.portal.workflow.kaleo.model.KaleoTransition;
import com.liferay.portal.workflow.kaleo.runtime.ExecutionContext; import com.liferay.portal.workflow.kaleo.runtime.ExecutionContext;
import com.liferay.portal.workflow.kaleo.runtime.graph.PathElement; import com.liferay.portal.workflow.kaleo.runtime.graph.PathElement;
import java.util.List;
/** /**
* @author Michael C. Han * @author Michael C. Han
*/ */
public class JoinXorNodeExecutor extends BaseNodeExecutor { public class JoinXorNodeExecutor extends BaseNodeExecutor {
@Override
protected boolean doEnter(KaleoNode currentKaleoNode, ExecutionContext executionContext) throws PortalException,
SystemException {
protected boolean doEnter( KaleoInstanceToken kaleoInstanceToken = executionContext.getKaleoInstanceToken();
KaleoNode currentKaleoNode, ExecutionContext executionContext)
throws PortalException, SystemException {
KaleoInstanceToken kaleoInstanceToken =
executionContext.getKaleoInstanceToken();
kaleoInstanceToken = kaleoInstanceToken =
kaleoInstanceTokenLocalService.getKaleoInstanceToken( kaleoInstanceTokenLocalService.getKaleoInstanceToken(kaleoInstanceToken.getKaleoInstanceTokenId());
kaleoInstanceToken.getKaleoInstanceTokenId());
if (kaleoInstanceToken.isCompleted()) { if (kaleoInstanceToken.isCompleted()) {
return false; return false;
} }
kaleoInstanceToken = kaleoInstanceToken =
kaleoInstanceTokenLocalService.completeKaleoInstanceToken( kaleoInstanceTokenLocalService.completeKaleoInstanceToken(kaleoInstanceToken.getKaleoInstanceTokenId());
kaleoInstanceToken.getKaleoInstanceTokenId()); KaleoInstanceToken parentKaleoInstanceToken = kaleoInstanceToken.getParentKaleoInstanceToken();
if (!parentKaleoInstanceToken.hasIncompleteChildrenKaleoInstanceToken()) {
KaleoInstanceToken parentKaleoInstanceToken =
kaleoInstanceToken.getParentKaleoInstanceToken();
if (!parentKaleoInstanceToken.
hasIncompleteChildrenKaleoInstanceToken()) {
return false; return false;
} }
List<KaleoInstanceToken> childrenKaleoInstanceTokens = List<KaleoInstanceToken> childrenKaleoInstanceTokens =
parentKaleoInstanceToken.getChildrenKaleoInstanceTokens(); parentKaleoInstanceToken.getChildrenKaleoInstanceTokens();
for (KaleoInstanceToken childrenKaleoInstanceToken : childrenKaleoInstanceTokens) {
for (KaleoInstanceToken childrenKaleoInstanceToken : kaleoInstanceTokenLocalService.completeKaleoInstanceToken(childrenKaleoInstanceToken
childrenKaleoInstanceTokens) { .getKaleoInstanceTokenId());
kaleoInstanceTokenLocalService.completeKaleoInstanceToken(
childrenKaleoInstanceToken.getKaleoInstanceTokenId());
} }
return true; return true;
} }
@Override
protected void doExecute(KaleoNode currentKaleoNode, ExecutionContext executionContext,
List<PathElement> remainingPathElements) throws PortalException, SystemException {
protected void doExecute( KaleoInstanceToken kaleoInstanceToken = executionContext.getKaleoInstanceToken();
KaleoNode currentKaleoNode, ExecutionContext executionContext, KaleoInstanceToken parentKaleoInstanceToken = kaleoInstanceToken.getParentKaleoInstanceToken();
List<PathElement> remainingPathElements) if (parentKaleoInstanceToken.getCurrentKaleoNodeId() == currentKaleoNode.getKaleoNodeId()) {
throws PortalException, SystemException {
KaleoInstanceToken kaleoInstanceToken =
executionContext.getKaleoInstanceToken();
KaleoInstanceToken parentKaleoInstanceToken =
kaleoInstanceToken.getParentKaleoInstanceToken();
if (parentKaleoInstanceToken.getCurrentKaleoNodeId() ==
currentKaleoNode.getKaleoNodeId()) {
return; return;
} }
parentKaleoInstanceToken = parentKaleoInstanceToken =
kaleoInstanceTokenLocalService.updateKaleoInstanceToken( kaleoInstanceTokenLocalService.updateKaleoInstanceToken(
parentKaleoInstanceToken.getKaleoInstanceTokenId(), parentKaleoInstanceToken.getKaleoInstanceTokenId(), currentKaleoNode.getKaleoNodeId());
currentKaleoNode.getKaleoNodeId()); KaleoTransition kaleoTransition = currentKaleoNode.getDefaultKaleoTransition();
ExecutionContext newExecutionContext =
KaleoTransition kaleoTransition = new ExecutionContext(parentKaleoInstanceToken, executionContext.getWorkflowContext(),
currentKaleoNode.getDefaultKaleoTransition();
ExecutionContext newExecutionContext = new ExecutionContext(
parentKaleoInstanceToken, executionContext.getWorkflowContext(),
executionContext.getServiceContext()); executionContext.getServiceContext());
PathElement pathElement =
PathElement pathElement = new PathElement( new PathElement(currentKaleoNode, kaleoTransition.getTargetKaleoNode(), newExecutionContext);
currentKaleoNode, kaleoTransition.getTargetKaleoNode(),
newExecutionContext);
remainingPathElements.add(pathElement); remainingPathElements.add(pathElement);
} }
@Override
protected void doExecuteTimer(KaleoNode currentKaleoNode, KaleoTimer kaleoTimer, ExecutionContext executionContext) {}
protected void doExecuteTimer( @Override
KaleoNode currentKaleoNode, KaleoTimer kaleoTimer, protected void doExit(KaleoNode currentKaleoNode, ExecutionContext executionContext,
ExecutionContext executionContext) { List<PathElement> remainingPathElements) {}
}
protected void doExit(
KaleoNode currentKaleoNode, ExecutionContext executionContext,
List<PathElement> remainingPathElements) {
}
} }

43
liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/NodeExecutor.java

@ -1,48 +1,35 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it
* * and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software
* This library is free software; you can redistribute it and/or modify it under * Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in
* the terms of the GNU Lesser General Public License as published by the Free * the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* Software Foundation; either version 2.1 of the License, or (at your option) * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
* 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 com.liferay.portal.workflow.kaleo.runtime.node; package com.liferay.portal.workflow.kaleo.runtime.node;
import java.util.List;
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.workflow.kaleo.model.KaleoNode; import com.liferay.portal.workflow.kaleo.model.KaleoNode;
import com.liferay.portal.workflow.kaleo.runtime.ExecutionContext; import com.liferay.portal.workflow.kaleo.runtime.ExecutionContext;
import com.liferay.portal.workflow.kaleo.runtime.graph.PathElement; import com.liferay.portal.workflow.kaleo.runtime.graph.PathElement;
import java.util.List;
/** /**
* @author Michael C. Han * @author Michael C. Han
*/ */
public interface NodeExecutor { public interface NodeExecutor {
public boolean enter( public boolean enter(KaleoNode currentKaleoNode, ExecutionContext executionContext) throws PortalException,
KaleoNode currentKaleoNode, ExecutionContext executionContext) SystemException;
throws PortalException, SystemException;
public void execute(
KaleoNode currentKaleoNode, ExecutionContext executionContext,
List<PathElement> remainingPathElements)
throws PortalException, SystemException;
public void executeTimer( public void execute(KaleoNode currentKaleoNode, ExecutionContext executionContext,
KaleoNode currentKaleoNode, ExecutionContext executionContext) List<PathElement> remainingPathElements) throws PortalException, SystemException;
throws PortalException, SystemException;
public void exit( public void executeTimer(KaleoNode currentKaleoNode, ExecutionContext executionContext) throws PortalException,
KaleoNode currentKaleoNode, ExecutionContext executionContext, SystemException;
List<PathElement> remainingPathElements)
throws PortalException, SystemException;
public void exit(KaleoNode currentKaleoNode, ExecutionContext executionContext,
List<PathElement> remainingPathElements) throws PortalException, SystemException;
} }

27
liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/NodeExecutorFactory.java

@ -1,37 +1,32 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it
* * and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software
* This library is free software; you can redistribute it and/or modify it under * Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in
* the terms of the GNU Lesser General Public License as published by the Free * the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* Software Foundation; either version 2.1 of the License, or (at your option) * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
* 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 com.liferay.portal.workflow.kaleo.runtime.node; package com.liferay.portal.workflow.kaleo.runtime.node;
import com.liferay.portal.workflow.kaleo.util.NodeTypeDependentObjectRegistry;
import java.util.Map; import java.util.Map;
import com.liferay.portal.workflow.kaleo.util.NodeTypeDependentObjectRegistry;
/** /**
* @author Michael C. Han * @author Michael C. Han
*/ */
public class NodeExecutorFactory { public class NodeExecutorFactory {
public static NodeExecutor getNodeExecutor(String nodeTypeString) { public static NodeExecutor getNodeExecutor(String nodeTypeString) {
return _nodeExecutors.getNodeTypeDependentObjects(nodeTypeString); return _nodeExecutors.getNodeTypeDependentObjects(nodeTypeString);
} }
public void setNodeExectors(Map<String, NodeExecutor> nodeExecutors) { public void setNodeExectors(Map<String, NodeExecutor> nodeExecutors) {
_nodeExecutors.setNodeTypeDependentObjects(nodeExecutors); _nodeExecutors.setNodeTypeDependentObjects(nodeExecutors);
} }
private static NodeTypeDependentObjectRegistry<NodeExecutor> private static NodeTypeDependentObjectRegistry<NodeExecutor> _nodeExecutors =
_nodeExecutors = new NodeTypeDependentObjectRegistry<NodeExecutor>(); new NodeTypeDependentObjectRegistry<NodeExecutor>();
} }

65
liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/StateNodeExecutor.java

@ -1,17 +1,15 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it
* * and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software
* This library is free software; you can redistribute it and/or modify it under the terms of the * Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in
* GNU Lesser General Public License as published by the Free Software Foundation; either version * the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* 2.1 of the License, or (at your option) any later version. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*/ */
package com.liferay.portal.workflow.kaleo.runtime.node; package com.liferay.portal.workflow.kaleo.runtime.node;
import java.util.List;
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.util.Validator; import com.liferay.portal.kernel.util.Validator;
@ -23,93 +21,74 @@ import com.liferay.portal.workflow.kaleo.model.impl.KaleoInstanceTokenImpl;
import com.liferay.portal.workflow.kaleo.runtime.ExecutionContext; import com.liferay.portal.workflow.kaleo.runtime.ExecutionContext;
import com.liferay.portal.workflow.kaleo.runtime.graph.PathElement; import com.liferay.portal.workflow.kaleo.runtime.graph.PathElement;
import java.util.List;
/** /**
* @author Michael C. Han * @author Michael C. Han
*/ */
public class StateNodeExecutor extends BaseNodeExecutor { public class StateNodeExecutor extends BaseNodeExecutor {
private final static String NAME_SIGNAL = "SIGNAL"; private static final String NAME_SIGNAL = "SIGNAL";
public static boolean isSignalNode(KaleoNode kaleoNode) { public static boolean isSignalNode(KaleoNode kaleoNode) {
return kaleoNode.getName().toUpperCase().startsWith(NAME_SIGNAL); return kaleoNode.getName().toUpperCase().startsWith(NAME_SIGNAL);
} }
@Override
protected boolean doEnter(KaleoNode currentKaleoNode, ExecutionContext executionContext) { protected boolean doEnter(KaleoNode currentKaleoNode, ExecutionContext executionContext) {
return true; return true;
} }
@Override
protected void doExecute(KaleoNode currentKaleoNode, ExecutionContext executionContext, protected void doExecute(KaleoNode currentKaleoNode, ExecutionContext executionContext,
List<PathElement> remainingPathElements) throws PortalException, SystemException { List<PathElement> remainingPathElements) throws PortalException, SystemException {
if (isSignalNode(currentKaleoNode)) { if (isSignalNode(currentKaleoNode)) {
return; return;
} }
KaleoInstanceToken kaleoInstanceToken = executionContext.getKaleoInstanceToken(); KaleoInstanceToken kaleoInstanceToken = executionContext.getKaleoInstanceToken();
String transitionName = executionContext.getTransitionName(); String transitionName = executionContext.getTransitionName();
if (!currentKaleoNode.hasKaleoTransition()) { if (!currentKaleoNode.hasKaleoTransition()) {
kaleoInstanceToken = kaleoInstanceToken = kaleoInstanceTokenLocalService.completeKaleoInstanceToken(kaleoInstanceToken
kaleoInstanceTokenLocalService.completeKaleoInstanceToken(kaleoInstanceToken.getKaleoInstanceTokenId()); .getKaleoInstanceTokenId());
if (kaleoInstanceToken.getParentKaleoInstanceTokenId() == KaleoInstanceTokenImpl.DEFAULT_PARENT_KALEO_INSTANCE_TOKEN_ID) { if (kaleoInstanceToken.getParentKaleoInstanceTokenId() == KaleoInstanceTokenImpl.DEFAULT_PARENT_KALEO_INSTANCE_TOKEN_ID) {
kaleoInstanceLocalService.completeKaleoInstance(kaleoInstanceToken.getKaleoInstanceId()); kaleoInstanceLocalService.completeKaleoInstance(kaleoInstanceToken.getKaleoInstanceId());
} }
return; return;
} }
KaleoTransition kaleoTransition = null; KaleoTransition kaleoTransition = null;
if (Validator.isNull(transitionName)) { if (Validator.isNull(transitionName)) {
kaleoTransition = currentKaleoNode.getDefaultKaleoTransition(); kaleoTransition = currentKaleoNode.getDefaultKaleoTransition();
} else { } else {
kaleoTransition = currentKaleoNode.getKaleoTransition(transitionName); kaleoTransition = currentKaleoNode.getKaleoTransition(transitionName);
} }
ExecutionContext newExecutionContext = new ExecutionContext(kaleoInstanceToken,
ExecutionContext newExecutionContext = executionContext.getWorkflowContext(), executionContext.getServiceContext());
new ExecutionContext(kaleoInstanceToken, executionContext.getWorkflowContext(), PathElement pathElement = new PathElement(currentKaleoNode, kaleoTransition.getTargetKaleoNode(),
executionContext.getServiceContext()); newExecutionContext);
PathElement pathElement =
new PathElement(currentKaleoNode, kaleoTransition.getTargetKaleoNode(), newExecutionContext);
remainingPathElements.add(pathElement); remainingPathElements.add(pathElement);
} }
@Override
protected void doExecuteTimer(KaleoNode currentKaleoNode, KaleoTimer kaleoTimer, ExecutionContext executionContext) {} protected void doExecuteTimer(KaleoNode currentKaleoNode, KaleoTimer kaleoTimer, ExecutionContext executionContext) {}
@Override
protected void doExit(KaleoNode currentKaleoNode, ExecutionContext executionContext, protected void doExit(KaleoNode currentKaleoNode, ExecutionContext executionContext,
List<PathElement> remainingPathElements) throws PortalException, SystemException { List<PathElement> remainingPathElements) throws PortalException, SystemException {
if (isSignalNode(currentKaleoNode)) { if (isSignalNode(currentKaleoNode)) {
String transitionName = executionContext.getTransitionName(); String transitionName = executionContext.getTransitionName();
KaleoTransition kaleoTransition = null; KaleoTransition kaleoTransition = null;
if (Validator.isNull(transitionName)) { if (Validator.isNull(transitionName)) {
kaleoTransition = currentKaleoNode.getDefaultKaleoTransition(); kaleoTransition = currentKaleoNode.getDefaultKaleoTransition();
} else { } else {
kaleoTransition = currentKaleoNode.getKaleoTransition(transitionName); kaleoTransition = currentKaleoNode.getKaleoTransition(transitionName);
} }
ExecutionContext newExecutionContext = new ExecutionContext(executionContext.getKaleoInstanceToken(),
ExecutionContext newExecutionContext = executionContext.getKaleoTaskInstanceToken(), executionContext.getWorkflowContext(),
new ExecutionContext(executionContext.getKaleoInstanceToken(), executionContext.getKaleoTaskInstanceToken(), executionContext.getServiceContext());
executionContext.getWorkflowContext(), executionContext.getServiceContext());
PathElement pathElement = new PathElement(null, kaleoTransition.getTargetKaleoNode(), newExecutionContext); PathElement pathElement = new PathElement(null, kaleoTransition.getTargetKaleoNode(), newExecutionContext);
remainingPathElements.add(pathElement); remainingPathElements.add(pathElement);
} }
} }
} }

240
liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/TaskNodeExecutor.java

@ -1,19 +1,22 @@
/** /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. * Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it
* * and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software
* This library is free software; you can redistribute it and/or modify it under * Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in
* the terms of the GNU Lesser General Public License as published by the Free * the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* Software Foundation; either version 2.1 of the License, or (at your option) * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
* 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 com.liferay.portal.workflow.kaleo.runtime.node; package com.liferay.portal.workflow.kaleo.runtime.node;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.TreeSet;
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.util.StringUtil; import com.liferay.portal.kernel.util.StringUtil;
@ -45,247 +48,150 @@ import com.liferay.portal.workflow.kaleo.runtime.graph.PathElement;
import com.liferay.portal.workflow.kaleo.runtime.notification.NotificationUtil; import com.liferay.portal.workflow.kaleo.runtime.notification.NotificationUtil;
import com.liferay.portal.workflow.kaleo.runtime.util.ClassLoaderUtil; import com.liferay.portal.workflow.kaleo.runtime.util.ClassLoaderUtil;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.TreeSet;
/** /**
* @author Michael C. Han * @author Michael C. Han
*/ */
public class TaskNodeExecutor extends BaseNodeExecutor { public class TaskNodeExecutor extends BaseNodeExecutor {
public void setDueDateCalculator(DueDateCalculator dueDateCalculator) { public void setDueDateCalculator(DueDateCalculator dueDateCalculator) {
_dueDateCalculator = dueDateCalculator; _dueDateCalculator = dueDateCalculator;
} }
public void setTaskAssignmentSelector( public void setTaskAssignmentSelector(TaskAssignmentSelector taskAssignmentSelector) {
TaskAssignmentSelector taskAssignmentSelector) {
_taskAssignmentSelector = taskAssignmentSelector; _taskAssignmentSelector = taskAssignmentSelector;
} }
protected Date calculateDueDate(KaleoTask kaleoTask) protected Date calculateDueDate(KaleoTask kaleoTask) throws SystemException {
throws SystemException {
List<KaleoTimer> kaleoTimers = kaleoTimerLocalService.getKaleoTimers(
KaleoNode.class.getName(), kaleoTask.getKaleoNodeId());
List<KaleoTimer> kaleoTimers =
kaleoTimerLocalService.getKaleoTimers(KaleoNode.class.getName(), kaleoTask.getKaleoNodeId());
if (kaleoTimers.isEmpty()) { if (kaleoTimers.isEmpty()) {
return null; return null;
} }
TreeSet<Date> sortedDueDates = new TreeSet<Date>(); TreeSet<Date> sortedDueDates = new TreeSet<Date>();
for (KaleoTimer kaleoTimer : kaleoTimers) { for (KaleoTimer kaleoTimer : kaleoTimers) {
DelayDuration delayDuration = new DelayDuration( DelayDuration delayDuration =
kaleoTimer.getDuration(), new DelayDuration(kaleoTimer.getDuration(), DurationScale.parse(kaleoTimer.getScale()));
DurationScale.parse(kaleoTimer.getScale())); Date dueDate = _dueDateCalculator.getDueDate(new Date(), delayDuration);
Date dueDate = _dueDateCalculator.getDueDate(
new Date(), delayDuration);
sortedDueDates.add(dueDate); sortedDueDates.add(dueDate);
} }
return sortedDueDates.first(); return sortedDueDates.first();
} }
protected KaleoTaskInstanceToken createTaskInstanceToken( protected KaleoTaskInstanceToken createTaskInstanceToken(ExecutionContext executionContext,
ExecutionContext executionContext, Map<String, Serializable> workflowContext, ServiceContext serviceContext,
Map<String, Serializable> workflowContext, KaleoInstanceToken kaleoInstanceToken, KaleoTask kaleoTask, Date dueDate) throws PortalException,
ServiceContext serviceContext, SystemException {
KaleoInstanceToken kaleoInstanceToken, KaleoTask kaleoTask,
Date dueDate)
throws PortalException, SystemException {
Collection<KaleoTaskAssignment> configuredKaleoTaskAssignments =
kaleoTask.getKaleoTaskAssignments();
Collection<KaleoTaskAssignment> kaleoTaskAssignments =
new ArrayList<KaleoTaskAssignment>();
for (KaleoTaskAssignment configuredKaleoTaskAssignment :
configuredKaleoTaskAssignments) {
String[] assigneeScriptRequiredContexts = StringUtil.split(
configuredKaleoTaskAssignment.
getAssigneeScriptRequiredContexts());
ClassLoader[] classLoaders = ClassLoaderUtil.getClassLoaders(
assigneeScriptRequiredContexts);
Collection<KaleoTaskAssignment> configuredKaleoTaskAssignments = kaleoTask.getKaleoTaskAssignments();
Collection<KaleoTaskAssignment> kaleoTaskAssignments = new ArrayList<KaleoTaskAssignment>();
for (KaleoTaskAssignment configuredKaleoTaskAssignment : configuredKaleoTaskAssignments) {
String[] assigneeScriptRequiredContexts =
StringUtil.split(configuredKaleoTaskAssignment.getAssigneeScriptRequiredContexts());
ClassLoader[] classLoaders = ClassLoaderUtil.getClassLoaders(assigneeScriptRequiredContexts);
Collection<KaleoTaskAssignment> calculatedKaleoTaskAssignments = Collection<KaleoTaskAssignment> calculatedKaleoTaskAssignments =
_taskAssignmentSelector.calculateTaskAssignments( _taskAssignmentSelector.calculateTaskAssignments(configuredKaleoTaskAssignment, executionContext,
configuredKaleoTaskAssignment, executionContext,
classLoaders); classLoaders);
kaleoTaskAssignments.addAll(calculatedKaleoTaskAssignments); kaleoTaskAssignments.addAll(calculatedKaleoTaskAssignments);
} }
if (kaleoTaskAssignments.isEmpty()) { if (kaleoTaskAssignments.isEmpty()) {
Collection<KaleoTaskAssignment> organizationKaleoTaskAssignments = Collection<KaleoTaskAssignment> organizationKaleoTaskAssignments =
getOrganizationKaleoTaskAssignments( getOrganizationKaleoTaskAssignments(configuredKaleoTaskAssignments, executionContext);
configuredKaleoTaskAssignments, executionContext);
kaleoTaskAssignments.addAll(organizationKaleoTaskAssignments); kaleoTaskAssignments.addAll(organizationKaleoTaskAssignments);
} }
return kaleoTaskInstanceTokenLocalService.addKaleoTaskInstanceToken( return kaleoTaskInstanceTokenLocalService.addKaleoTaskInstanceToken(
kaleoInstanceToken.getKaleoInstanceTokenId(), kaleoInstanceToken.getKaleoInstanceTokenId(), kaleoTask.getKaleoTaskId(), kaleoTask.getName(),
kaleoTask.getKaleoTaskId(), kaleoTask.getName(),
kaleoTaskAssignments, dueDate, workflowContext, serviceContext); kaleoTaskAssignments, dueDate, workflowContext, serviceContext);
} }
@Override
protected boolean doEnter(KaleoNode currentKaleoNode, ExecutionContext executionContext) throws PortalException,
SystemException {
protected boolean doEnter( Map<String, Serializable> workflowContext = executionContext.getWorkflowContext();
KaleoNode currentKaleoNode, ExecutionContext executionContext)
throws PortalException, SystemException {
Map<String, Serializable> workflowContext =
executionContext.getWorkflowContext();
ServiceContext serviceContext = executionContext.getServiceContext(); ServiceContext serviceContext = executionContext.getServiceContext();
KaleoInstanceToken kaleoInstanceToken = executionContext.getKaleoInstanceToken();
KaleoInstanceToken kaleoInstanceToken = KaleoTask kaleoTask = kaleoTaskLocalService.getKaleoNodeKaleoTask(currentKaleoNode.getKaleoNodeId());
executionContext.getKaleoInstanceToken();
KaleoTask kaleoTask = kaleoTaskLocalService.getKaleoNodeKaleoTask(
currentKaleoNode.getKaleoNodeId());
Date dueDate = calculateDueDate(kaleoTask); Date dueDate = calculateDueDate(kaleoTask);
KaleoTaskInstanceToken kaleoTaskInstanceToken =
KaleoTaskInstanceToken kaleoTaskInstanceToken = createTaskInstanceToken( createTaskInstanceToken(executionContext, workflowContext, serviceContext, kaleoInstanceToken,
executionContext, workflowContext, serviceContext, kaleoTask, dueDate);
kaleoInstanceToken, kaleoTask, dueDate);
executionContext.setKaleoTaskInstanceToken(kaleoTaskInstanceToken); executionContext.setKaleoTaskInstanceToken(kaleoTaskInstanceToken);
ActionExecutorUtil.executeKaleoActions(KaleoNode.class.getName(), currentKaleoNode.getKaleoNodeId(),
ActionExecutorUtil.executeKaleoActions(
KaleoNode.class.getName(), currentKaleoNode.getKaleoNodeId(),
ExecutionType.ON_ASSIGNMENT, executionContext); ExecutionType.ON_ASSIGNMENT, executionContext);
NotificationUtil.sendKaleoNotifications(KaleoNode.class.getName(), currentKaleoNode.getKaleoNodeId(),
NotificationUtil.sendKaleoNotifications(
KaleoNode.class.getName(), currentKaleoNode.getKaleoNodeId(),
ExecutionType.ON_ASSIGNMENT, executionContext); ExecutionType.ON_ASSIGNMENT, executionContext);
kaleoLogLocalService.addTaskAssignmentKaleoLog(null, kaleoTaskInstanceToken, "Assigned initial task.",
kaleoLogLocalService.addTaskAssignmentKaleoLog(
null, kaleoTaskInstanceToken, "Assigned initial task.",
workflowContext, serviceContext); workflowContext, serviceContext);
return true; return true;
} }
@Override
protected void doExecute(KaleoNode currentKaleoNode, ExecutionContext executionContext,
List<PathElement> remainingPathElements) {}
protected void doExecute( @Override
KaleoNode currentKaleoNode, ExecutionContext executionContext, protected void doExecuteTimer(KaleoNode currentKaleoNode, KaleoTimer kaleoTimer, ExecutionContext executionContext)
List<PathElement> remainingPathElements) {
}
protected void doExecuteTimer(
KaleoNode currentKaleoNode, KaleoTimer kaleoTimer,
ExecutionContext executionContext)
throws PortalException, SystemException { throws PortalException, SystemException {
List<KaleoTaskAssignment> kaleoTaskReassignments = List<KaleoTaskAssignment> kaleoTaskReassignments = kaleoTimer.getKaleoTaskReassignments();
kaleoTimer.getKaleoTaskReassignments();
if (kaleoTaskReassignments.isEmpty()) { if (kaleoTaskReassignments.isEmpty()) {
return; return;
} }
TaskAssignerUtil.reassignKaleoTask(kaleoTaskReassignments, executionContext);
TaskAssignerUtil.reassignKaleoTask(
kaleoTaskReassignments, executionContext);
} }
@Override
protected void doExit( protected void doExit(KaleoNode currentKaleoNode, ExecutionContext executionContext,
KaleoNode currentKaleoNode, ExecutionContext executionContext, List<PathElement> remainingPathElements) throws PortalException, SystemException {
List<PathElement> remainingPathElements)
throws PortalException, SystemException {
String transitionName = executionContext.getTransitionName(); String transitionName = executionContext.getTransitionName();
KaleoTransition kaleoTransition = null; KaleoTransition kaleoTransition = null;
if (Validator.isNull(transitionName)) { if (Validator.isNull(transitionName)) {
kaleoTransition = currentKaleoNode.getDefaultKaleoTransition(); kaleoTransition = currentKaleoNode.getDefaultKaleoTransition();
} else {
kaleoTransition = currentKaleoNode.getKaleoTransition(transitionName);
} }
else { ExecutionContext newExecutionContext =
kaleoTransition = currentKaleoNode.getKaleoTransition( new ExecutionContext(executionContext.getKaleoInstanceToken(),
transitionName); executionContext.getKaleoTaskInstanceToken(), executionContext.getWorkflowContext(),
}
ExecutionContext newExecutionContext = new ExecutionContext(
executionContext.getKaleoInstanceToken(),
executionContext.getKaleoTaskInstanceToken(),
executionContext.getWorkflowContext(),
executionContext.getServiceContext()); executionContext.getServiceContext());
PathElement pathElement = new PathElement(null, kaleoTransition.getTargetKaleoNode(), newExecutionContext);
PathElement pathElement = new PathElement(
null, kaleoTransition.getTargetKaleoNode(), newExecutionContext);
remainingPathElements.add(pathElement); remainingPathElements.add(pathElement);
} }
protected Collection<KaleoTaskAssignment> protected Collection<KaleoTaskAssignment> getOrganizationKaleoTaskAssignments(
getOrganizationKaleoTaskAssignments( Collection<KaleoTaskAssignment> kaleoTaskAssignments, ExecutionContext executionContext)
Collection<KaleoTaskAssignment> kaleoTaskAssignments,
ExecutionContext executionContext)
throws PortalException, SystemException { throws PortalException, SystemException {
long userId = executionContext.getKaleoInstanceToken().getUserId(); long userId = executionContext.getKaleoInstanceToken().getUserId();
User user = UserLocalServiceUtil.getUser(userId); User user = UserLocalServiceUtil.getUser(userId);
List<Organization> organizations = user.getOrganizations(); List<Organization> organizations = user.getOrganizations();
Collection<KaleoTaskAssignment> organizationKaleoTaskAssignments = new HashSet<KaleoTaskAssignment>();
Collection<KaleoTaskAssignment> organizationKaleoTaskAssignments =
new HashSet<KaleoTaskAssignment>();
for (KaleoTaskAssignment kaleoTaskAssignment : kaleoTaskAssignments) { for (KaleoTaskAssignment kaleoTaskAssignment : kaleoTaskAssignments) {
String assigneeClassName = String assigneeClassName = kaleoTaskAssignment.getAssigneeClassName();
kaleoTaskAssignment.getAssigneeClassName();
if (!assigneeClassName.equals(Role.class.getName())) { if (!assigneeClassName.equals(Role.class.getName())) {
continue; continue;
} }
long roleId = kaleoTaskAssignment.getAssigneeClassPK(); long roleId = kaleoTaskAssignment.getAssigneeClassPK();
Role role = RoleLocalServiceUtil.getRole(roleId); Role role = RoleLocalServiceUtil.getRole(roleId);
if (role.getType() != RoleConstants.TYPE_ORGANIZATION) { if (role.getType() != RoleConstants.TYPE_ORGANIZATION) {
continue; continue;
} }
for (Organization organization : organizations) { for (Organization organization : organizations) {
KaleoTaskAssignment organizationKaleoTaskAssignment = KaleoTaskAssignment organizationKaleoTaskAssignment = new KaleoTaskAssignmentImpl();
new KaleoTaskAssignmentImpl(); organizationKaleoTaskAssignment.setGroupId(organization.getGroup().getGroupId());
organizationKaleoTaskAssignment.setCompanyId(kaleoTaskAssignment.getCompanyId());
organizationKaleoTaskAssignment.setGroupId( organizationKaleoTaskAssignment.setAssigneeClassName(kaleoTaskAssignment.getAssigneeClassName());
organization.getGroup().getGroupId()); organizationKaleoTaskAssignment.setAssigneeClassPK(kaleoTaskAssignment.getAssigneeClassPK());
organizationKaleoTaskAssignment.setCompanyId( organizationKaleoTaskAssignments.add(organizationKaleoTaskAssignment);
kaleoTaskAssignment.getCompanyId());
organizationKaleoTaskAssignment.setAssigneeClassName(
kaleoTaskAssignment.getAssigneeClassName());
organizationKaleoTaskAssignment.setAssigneeClassPK(
kaleoTaskAssignment.getAssigneeClassPK());
organizationKaleoTaskAssignments.add(
organizationKaleoTaskAssignment);
} }
} }
return organizationKaleoTaskAssignments; return organizationKaleoTaskAssignments;
} }
private DueDateCalculator _dueDateCalculator; private DueDateCalculator _dueDateCalculator;
private TaskAssignmentSelector _taskAssignmentSelector; private TaskAssignmentSelector _taskAssignmentSelector;
} }

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

@ -89,13 +89,20 @@ import com.liferay.portal.workflow.kaleo.service.KaleoTaskInstanceTokenLocalServ
public class EditWorkflowTaskAction extends BaseStrutsPortletAction { public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
private final static Log _log = LogFactoryUtil.getLog(EditWorkflowTaskAction.class); private static final Log _log = LogFactoryUtil.getLog(EditWorkflowTaskAction.class);
private final static List<String> valoriAmmessi = Arrays.asList(StatoPraticaConstants.ANNULLATA, private static final String PARAMETER_ESITO = WorkflowConstants.PREFIX_NAME_ELEMENT_FORM + "esito"
+ WorkflowConstants.SUFFIX_NAME_ELEMENT_FORM;
private static final String PARAMETER_ISTRUTTORE = WorkflowConstants.PREFIX_NAME_ELEMENT_FORM + "istruttore"
+ WorkflowConstants.SUFFIX_NAME_ELEMENT_FORM;
private static final String PARAMETER_TESTO = WorkflowConstants.PREFIX_NAME_ELEMENT_FORM + "testo_del_documento"
+ WorkflowConstants.SUFFIX_NAME_ELEMENT_FORM;
private static final List<String> VALORI_AMMESSI = Arrays.asList(StatoPraticaConstants.ANNULLATA,
StatoPraticaConstants.CONFORME, StatoPraticaConstants.INTEGRAZIONE, StatoPraticaConstants.NON_CONFORME, StatoPraticaConstants.CONFORME, StatoPraticaConstants.INTEGRAZIONE, StatoPraticaConstants.NON_CONFORME,
StatoPraticaConstants.NO_PARERE, StatoPraticaConstants.PREAVVISO_CONTRARIO); StatoPraticaConstants.NO_PARERE, StatoPraticaConstants.PREAVVISO_CONTRARIO);
private static final List<Integer> logTypes = Arrays.asList(WorkflowLog.TASK_ASSIGN, WorkflowLog.TASK_COMPLETION, private static final List<Integer> LOG_TYPES = Arrays.asList(WorkflowLog.TASK_ASSIGN, WorkflowLog.TASK_COMPLETION,
WorkflowLog.TASK_UPDATE, WorkflowLog.TRANSITION); WorkflowLog.TASK_UPDATE, WorkflowLog.TRANSITION);
@Override @Override
@ -159,11 +166,15 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
if (transitionName.equalsIgnoreCase("registra-esito")) { if (transitionName.equalsIgnoreCase("registra-esito")) {
HttpServletRequest httpServletRequest = PortalUtil.getOriginalServletRequest(PortalUtil HttpServletRequest httpServletRequest = PortalUtil.getOriginalServletRequest(PortalUtil
.getHttpServletRequest(actionRequest)); .getHttpServletRequest(actionRequest));
String esito = httpServletRequest.getParameter("kaleo--esito--") == null ? StringPool.BLANK String esito = httpServletRequest.getParameter(PARAMETER_ESITO);
: httpServletRequest.getParameter("kaleo--esito--").trim(); if (esito == null) {
String testoDocumento = httpServletRequest.getParameter("kaleo--testo_del_documento--") == null ? StringPool.BLANK esito = StringPool.BLANK;
: httpServletRequest.getParameter("kaleo--testo_del_documento--"); }
if (!valoriAmmessi.contains(esito) String testoDocumento = httpServletRequest.getParameter(PARAMETER_TESTO);
if (testoDocumento == null) {
testoDocumento = StringPool.BLANK;
}
if (!VALORI_AMMESSI.contains(esito)
|| ((esito.equalsIgnoreCase(StatoPraticaConstants.INTEGRAZIONE) || esito || ((esito.equalsIgnoreCase(StatoPraticaConstants.INTEGRAZIONE) || esito
.equalsIgnoreCase(StatoPraticaConstants.PREAVVISO_CONTRARIO)) && testoDocumento.isEmpty())) { .equalsIgnoreCase(StatoPraticaConstants.PREAVVISO_CONTRARIO)) && testoDocumento.isEmpty())) {
_log.error("controllo validazione completamento task registra-esito = " + workflowTaskId _log.error("controllo validazione completamento task registra-esito = " + workflowTaskId
@ -175,7 +186,7 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
} else if (transitionName.equalsIgnoreCase("Riassegna") || transitionName.equalsIgnoreCase("assegna")) { } else if (transitionName.equalsIgnoreCase("Riassegna") || transitionName.equalsIgnoreCase("assegna")) {
HttpServletRequest httpServletRequest = PortalUtil.getOriginalServletRequest(PortalUtil HttpServletRequest httpServletRequest = PortalUtil.getOriginalServletRequest(PortalUtil
.getHttpServletRequest(actionRequest)); .getHttpServletRequest(actionRequest));
String istruttore = httpServletRequest.getParameter("kaleo--istruttore--"); String istruttore = httpServletRequest.getParameter(PARAMETER_ISTRUTTORE);
if (Validator.isNull(istruttore)) { if (Validator.isNull(istruttore)) {
_log.error("controllo validazione completamento task = " + transitionName + " - " + workflowTaskId _log.error("controllo validazione completamento task = " + transitionName + " - " + workflowTaskId
+ " non riuscito - istruttore non presente nel workflow"); + " non riuscito - istruttore non presente nel workflow");
@ -355,7 +366,7 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
return portletNamespace.concat(PORTLET_STRUTS_FORWARD); return portletNamespace.concat(PORTLET_STRUTS_FORWARD);
} }
private final static String PORTLET_STRUTS_FORWARD = "PORTLET_STRUTS_FORWARD"; private static final String PORTLET_STRUTS_FORWARD = "PORTLET_STRUTS_FORWARD";
@Override @Override
public String render(StrutsPortletAction originalStrutsPortletAction, PortletConfig portletConfig, public String render(StrutsPortletAction originalStrutsPortletAction, PortletConfig portletConfig,
@ -442,7 +453,7 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
Map<Long, String> esitiMapByWorkflowLogID = new HashMap<Long, String>(); Map<Long, String> esitiMapByWorkflowLogID = new HashMap<Long, String>();
try { try {
List<WorkflowLog> workflowLogs = WorkflowLogManagerUtil.getWorkflowLogsByWorkflowInstance( List<WorkflowLog> workflowLogs = WorkflowLogManagerUtil.getWorkflowLogsByWorkflowInstance(
themeDisplay.getCompanyId(), workflowInstanceId, logTypes, QueryUtil.ALL_POS, QueryUtil.ALL_POS, themeDisplay.getCompanyId(), workflowInstanceId, LOG_TYPES, QueryUtil.ALL_POS, QueryUtil.ALL_POS,
WorkflowComparatorFactoryUtil.getLogCreateDateComparator(true)); WorkflowComparatorFactoryUtil.getLogCreateDateComparator(true));
for (WorkflowLog workflowLog : workflowLogs) { for (WorkflowLog workflowLog : workflowLogs) {
try { try {

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

@ -29,6 +29,8 @@ import com.liferay.portal.kernel.json.JSONArray;
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;
import com.liferay.portal.kernel.language.LanguageUtil; import com.liferay.portal.kernel.language.LanguageUtil;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.servlet.ServletResponseUtil; import com.liferay.portal.kernel.servlet.ServletResponseUtil;
import com.liferay.portal.kernel.struts.BaseStrutsPortletAction; import com.liferay.portal.kernel.struts.BaseStrutsPortletAction;
import com.liferay.portal.kernel.util.ContentTypes; import com.liferay.portal.kernel.util.ContentTypes;
@ -51,6 +53,8 @@ import com.liferay.portlet.dynamicdatamapping.util.DDMXSDUtil;
public class RenderFormTaskPortletAction extends BaseStrutsPortletAction { public class RenderFormTaskPortletAction extends BaseStrutsPortletAction {
private static final Log _log = LogFactoryUtil.getLog(RenderFormTaskPortletAction.class);
@Override @Override
public String render(PortletConfig portletConfig, RenderRequest renderRequest, RenderResponse renderResponse) public String render(PortletConfig portletConfig, RenderRequest renderRequest, RenderResponse renderResponse)
throws Exception { throws Exception {

17
liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/util/WorkflowUtil.java

@ -19,17 +19,16 @@ import java.util.Map;
import javax.portlet.PortletRequest; import javax.portlet.PortletRequest;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang.StringUtils;
import com.liferay.portal.NoSuchWorkflowInstanceLinkException; import com.liferay.portal.NoSuchWorkflowInstanceLinkException;
import com.liferay.portal.kernel.dao.orm.QueryUtil; import com.liferay.portal.kernel.dao.orm.QueryUtil;
import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.json.JSONDeserializer; import com.liferay.portal.kernel.json.JSONDeserializer;
import com.liferay.portal.kernel.json.JSONFactoryUtil; import com.liferay.portal.kernel.json.JSONFactoryUtil;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.util.ParamUtil; import com.liferay.portal.kernel.util.ParamUtil;
import com.liferay.portal.kernel.util.StringPool; import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.StringUtil;
import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.kernel.workflow.WorkflowHandler; import com.liferay.portal.kernel.workflow.WorkflowHandler;
import com.liferay.portal.kernel.workflow.WorkflowHandlerRegistryUtil; import com.liferay.portal.kernel.workflow.WorkflowHandlerRegistryUtil;
@ -48,7 +47,6 @@ import com.liferay.portal.workflow.kaleo.runtime.action.ActionExecutorUtil;
import com.liferay.portal.workflow.kaleo.service.KaleoTaskInstanceTokenLocalServiceUtil; import com.liferay.portal.workflow.kaleo.service.KaleoTaskInstanceTokenLocalServiceUtil;
public class WorkflowUtil { public class WorkflowUtil {
private static Log _log = LogFactoryUtil.getLog(WorkflowUtil.class);
public static ControlloPratica getControlloPratica(long workflowTaskId) { public static ControlloPratica getControlloPratica(long workflowTaskId) {
@ -59,8 +57,7 @@ public class WorkflowUtil {
if (taskInstanceToken.getClassName().equals(ControlloPratica.class.getName())) { if (taskInstanceToken.getClassName().equals(ControlloPratica.class.getName())) {
controllo = ControlloPraticaLocalServiceUtil.getControlloPratica(taskInstanceToken.getClassPK()); controllo = ControlloPraticaLocalServiceUtil.getControlloPratica(taskInstanceToken.getClassPK());
} }
} catch (PortalException | SystemException e) { } catch (PortalException | SystemException e) {}
}
return controllo; return controllo;
} }
@ -204,11 +201,11 @@ public class WorkflowUtil {
if (name.startsWith(WorkflowConstants.PREFIX_NAME_ELEMENT_FORM) if (name.startsWith(WorkflowConstants.PREFIX_NAME_ELEMENT_FORM)
&& name.endsWith(WorkflowConstants.SUFFIX_NAME_ELEMENT_FORM)) { && name.endsWith(WorkflowConstants.SUFFIX_NAME_ELEMENT_FORM)) {
if (formParameters == null) { if (formParameters == null) {
formParameters = new HashMap<String, String>(); formParameters = new HashMap<>();
} }
String parameterName = name.substring(WorkflowConstants.PREFIX_NAME_ELEMENT_FORM.length(), String parameterName = name.substring(WorkflowConstants.PREFIX_NAME_ELEMENT_FORM.length(),
name.length() - WorkflowConstants.SUFFIX_NAME_ELEMENT_FORM.length()); name.length() - WorkflowConstants.SUFFIX_NAME_ELEMENT_FORM.length());
String value = StringUtil.merge(ParamUtil.getParameterValues(portletRequest, name)); String value = StringUtils.join(ParamUtil.getParameterValues(portletRequest, name), ',');
formParameters.put(parameterName, value); formParameters.put(parameterName, value);
} }
} }
@ -221,11 +218,11 @@ public class WorkflowUtil {
if (name.startsWith(WorkflowConstants.PREFIX_NAME_ELEMENT_FORM) if (name.startsWith(WorkflowConstants.PREFIX_NAME_ELEMENT_FORM)
&& name.endsWith(WorkflowConstants.SUFFIX_NAME_ELEMENT_FORM)) { && name.endsWith(WorkflowConstants.SUFFIX_NAME_ELEMENT_FORM)) {
if (formParameters == null) { if (formParameters == null) {
formParameters = new HashMap<String, String>(); formParameters = new HashMap<>();
} }
String parameterName = name.substring(WorkflowConstants.PREFIX_NAME_ELEMENT_FORM.length(), String parameterName = name.substring(WorkflowConstants.PREFIX_NAME_ELEMENT_FORM.length(),
name.length() - WorkflowConstants.SUFFIX_NAME_ELEMENT_FORM.length()); name.length() - WorkflowConstants.SUFFIX_NAME_ELEMENT_FORM.length());
String value = StringUtil.merge(ParamUtil.getParameterValues(httpServletRequest, name)); String value = StringUtils.join(ParamUtil.getParameterValues(httpServletRequest, name), ',');
formParameters.put(parameterName, value); formParameters.put(parameterName, value);
} }
} }

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

@ -13,8 +13,8 @@
## ##
build.namespace=Kaleo build.namespace=Kaleo
build.number=57 build.number=63
build.date=1631548590240 build.date=1631785877061
build.auto.upgrade=true build.auto.upgrade=true
## ##

Caricamento…
Annulla
Salva