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. 42
      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. 91
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestionefirme/avvisi_da_firmare.jsp
  14. 6
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestionefirme/init.jsp
  15. 2
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/homebo/init.jsp
  16. 229
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/homebo/view.jsp
  17. 281
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/pagamenti/view.jsp
  18. 94
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/DisponibilitaLocalServiceImpl.java
  19. 15
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/PrenotazioneLocalServiceImpl.java
  20. 2
      liferay-plugins-sdk-6.2/portlets/portos-cookies-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/cookies/action/StartUpAction.java
  21. 40
      liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/deployalert/NoSuchNotificationLogException.java
  22. 40
      liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/deployalert/NoSuchNotificationMailException.java
  23. 43
      liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/action/DeployAction.java
  24. 9
      liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/constants/MailConstants.java
  25. 5
      liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/control/DeployAlertControl.java
  26. 35
      liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/model/impl/NotificationLogImpl.java
  27. 41
      liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/model/impl/NotificationMailImpl.java
  28. 100
      liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/portlet/NotificatorPortlet.java
  29. 45
      liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/service/impl/NotificationLogLocalServiceImpl.java
  30. 32
      liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/service/impl/NotificationLogServiceImpl.java
  31. 86
      liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/service/impl/NotificationMailLocalServiceImpl.java
  32. 39
      liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/service/impl/NotificationMailServiceImpl.java
  33. 32
      liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/util/DeployAlertUtil.java
  34. 4
      liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/service.properties
  35. 4
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/portlet/RicercaPratichePortlet.java
  36. 2
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/util/ReportFascicoloUtil.java
  37. 9
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/view_fascicolo_dettagli.jsp
  38. 370
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/view_fascicolo_riepilogo.jsp
  39. 1
      liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/.classpath
  40. 1
      liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/.project
  41. 3
      liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/build.xml
  42. BIN
      liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/WEB-INF/lib/portos-kaleo-portlet-service.jar
  43. BIN
      liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/WEB-INF/lib/util-java.jar
  44. 40
      liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/kaleo/NoSuchFormDefinitionLinkException.java
  45. 40
      liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/kaleo/NoSuchFormLogException.java
  46. 40
      liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/kaleo/NoSuchFormTemplateLinkException.java
  47. 2
      liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/portlet/WorkflowFormAdminPortlet.java
  48. 4
      liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/WEB-INF/src/service.properties
  49. 18
      liferay-plugins-sdk-6.2/portlets/portos-log-portlet/docroot/WEB-INF/src/it/tref/portos/liferay/log/constants/LogConstants.java
  50. 11
      liferay-plugins-sdk-6.2/portlets/portos-log-portlet/docroot/WEB-INF/src/it/tref/portos/liferay/log/constants/LogDestinationNames.java
  51. 51
      liferay-plugins-sdk-6.2/portlets/portos-log-portlet/docroot/WEB-INF/src/it/tref/portos/liferay/log/constants/LogFormat.java
  52. 1
      liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/.classpath
  53. 1
      liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/.settings/org.eclipse.wst.common.component
  54. 3
      liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/mailmanager/model/EmailConstants.java
  55. 102
      liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/hook/events/StartupAction.java
  56. 183
      liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/service/impl/EmailAttachmentLocalServiceImpl.java
  57. 284
      liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/service/impl/EmailLocalServiceImpl.java
  58. 399
      liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/service/impl/EmailTemplateLocalServiceImpl.java
  59. 40
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/maintenance/NoSuchMaintenanceScheduleException.java
  60. 175
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/portlet/AdminMaintenancePortlet.java
  61. 4
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/service.properties
  62. 2
      liferay-plugins-sdk-6.2/portlets/portos-notification-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/notification/action/StartUpAction.java
  63. 123
      liferay-plugins-sdk-6.2/portlets/portos-report-engine-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/service/persistence/KaleoTaskAssignmentInstanceFinderImpl.java
  64. 39
      liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/messaging/ProtocolloMessageListener.java
  65. 3
      liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/messaging/ReportMessageListener.java
  66. 2
      liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/portlet/TestPdf.java
  67. 9
      liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/service/impl/ReportTaskLocalServiceImpl.java
  68. 2
      liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/service/impl/ReportTaskManagerServiceImpl.java
  69. 4
      liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/service.properties
  70. 2
      liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/modellistener/shared/core/ModelListenerInvocationHandler.java
  71. 23
      liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/modellistener/shared/core/ModelListenerPool.java
  72. 2
      liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/modellistener/shared/core/ModelListenerUtil.java
  73. 22
      liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/PagamentoConstants.java
  74. 10
      liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/PortletKeys.java
  75. 10
      liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/SezioniUtil.java
  76. 28
      liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/StatoPraticaConstants.java
  77. 4
      liferay-plugins-sdk-6.2/shared/portos-kaleo-shared/src/it/tref/liferay/portos/kaleo/shared/util/PortletKeys.java
  78. 2
      liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/messaging/util/MailManagerUtil.java
  79. 32
      liferay-plugins-sdk-6.2/shared/portos-report-shared/src/it/tref/liferay/portos/report/shared/constants/ReportConstants.java
  80. 6
      liferay-plugins-sdk-6.2/shared/portos-report-shared/src/it/tref/liferay/portos/report/shared/constants/ReportDestinationNames.java
  81. 27
      liferay-plugins-sdk-6.2/shared/portos-report-shared/src/it/tref/liferay/portos/report/shared/util/PdfUtil.java
  82. 8
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/.classpath
  83. 4
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/.settings/org.eclipse.wst.common.component
  84. BIN
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/lib/portos-kaleo-portlet-service.jar
  85. 5
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/liferay-plugin-package.properties
  86. 14
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/WorkflowTaskManagerImpl.java
  87. 241
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/DefaultTaskManagerImpl.java
  88. 95
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/ConditionNodeExecutor.java
  89. 96
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/ForkNodeExecutor.java
  90. 97
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/JoinNodeExecutor.java
  91. 123
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/JoinXorNodeExecutor.java
  92. 45
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/NodeExecutor.java
  93. 29
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/NodeExecutorFactory.java
  94. 165
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/StateNodeExecutor.java
  95. 260
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/TaskNodeExecutor.java
  96. 33
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/hook/struts/EditWorkflowTaskAction.java
  97. 4
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/hook/struts/RenderFormTaskPortletAction.java
  98. 17
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/util/WorkflowUtil.java
  99. 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.deploy.dir = /home/ture/liferay/portali/paesaggistica/tomcat-7.0.62/webapps
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;
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)
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 final static String STATO_ASSEGNATA = "AS";
public final static String STATO_ESEGUITA = "ES";
public final static String STATO_ANNULLATA = "AN";
public final static String STATO_EXPIRED = "EX";
public static final String STATO_ASSEGNATA = "AS";
public static final String STATO_ESEGUITA = "ES";
public static final String STATO_ANNULLATA = "AN";
public static final String STATO_EXPIRED = "EX";
public final static String ASSEVERAZIONE_DA_APPLICATIVO = "AP";
public final static String ASSEVERAZIONE_DA_ALLEGATO = "AL";
public static final String ASSEVERAZIONE_DA_APPLICATIVO = "AP";
public static final String ASSEVERAZIONE_DA_ALLEGATO = "AL";
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);
// Ogni volta che leggo queste due righe mi sale la cattiveria
public final static String DOCUMENTO_INVIATO = "S";
public final static String DOCUMENTO_NON_INVIATO = "N";
public static final String DOCUMENTO_INVIATO = "S";
public static final String DOCUMENTO_NON_INVIATO = "N";
public final static String TIPO_AVVISO_DIRETTO = "D";
public final static String TIPO_AVVISO_FIRMA = "S";
public static final String TIPO_AVVISO_DIRETTO = "D";
public static final String TIPO_AVVISO_FIRMA = "S";
public final static String TIPO_REPORT_CONTROLLO_OBBLIGATORIO = "CO";
public final static String TIPO_REPORT_AUTORIZZAZIONE = "AU";
public static final String TIPO_REPORT_CONTROLLO_OBBLIGATORIO = "CO";
public static final String TIPO_REPORT_AUTORIZZAZIONE = "AU";
@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_FIRMA, "label.admingeniocivile.avviso.tipoAvviso.firma");
@ -41,7 +41,7 @@ public class AvvisoUtil {
};
@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.NON_CONFORME, "label.admingeniocivile.avviso.tipoDocumento.nonconforme");
@ -68,7 +68,7 @@ public class AvvisoUtil {
};
@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.CONFORME, "conf.geniocivile.avviso.folder.id.conforme");
@ -94,7 +94,7 @@ public class AvvisoUtil {
};
@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.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 final static String STATO_ASSEGNATA = "AS";
public final static String STATO_ESEGUITA = "ES";
public final static String STATO_ANNULLATA = "AN";
public final static String STATO_RIFIUTATA = "RI";
public final static String TIPO_TOTALE = "TT";
public final static String TIPO_COMPILAZIONE = "CO";
public final static String TIPO_GEOLOGO = "GE";
public final static String TIPO_FIRMA_INSERIMENTO_ALLEGATI = "FI";
public final static String TIPO_PAGAMENTO = "PG";
public final static String TIPO_VISUALIZZAZIONE = "VI";
public final static String TIPO_FINE_LAVORI = "FL";
public final static String TIPO_COLLAUDO = "CL";
private final static Log _log = LogFactoryUtil.getLog(DelegheUtil.class);
public static final String STATO_ASSEGNATA = "AS";
public static final String STATO_ESEGUITA = "ES";
public static final String STATO_ANNULLATA = "AN";
public static final String STATO_RIFIUTATA = "RI";
public static final String TIPO_TOTALE = "TT";
public static final String TIPO_COMPILAZIONE = "CO";
public static final String TIPO_GEOLOGO = "GE";
public static final String TIPO_FIRMA_INSERIMENTO_ALLEGATI = "FI";
public static final String TIPO_PAGAMENTO = "PG";
public static final String TIPO_VISUALIZZAZIONE = "VI";
public static final String TIPO_FINE_LAVORI = "FL";
public static final String TIPO_COLLAUDO = "CL";
private static final Log _log = LogFactoryUtil.getLog(DelegheUtil.class);
public static boolean hasDelegaFirma(long userId, long docPraticaId, boolean sezioneGeologica)
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()
@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.CONFORME, WorkflowConstants.WORKFLOW_SIGNAL_INVIO);
@ -240,7 +240,7 @@ public class WorkflowUtil {
};
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,

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;
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");
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) {

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;
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,
SystemException {
String urlIframeFE = ParamUtil.getString(actionRequest, "urlIframeFE");
String urlIframeBO = ParamUtil.getString(actionRequest, "urlIframeBO");
String urlIframeRicerca = ParamUtil.getString(actionRequest, "urlIframeRicerca");
String sharedSecret = ParamUtil.getString(actionRequest, "sharedSecret");
// ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
// Company company = themeDisplay.getCompany();
ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest);
ConfigurazioneLocalServiceUtil.storeConfig(ConfigurazioneConstants.MAPPE_URL_IFRAME_FE, urlIframeFE,
serviceContext);
@ -50,6 +49,7 @@ public class PaesaggisticaAdministrationPortlet extends MVCPortlet {
}
public void mostraConfigurazione(ActionRequest actionRequest, ActionResponse actionResponse) throws SystemException {
List<String> esito = new ArrayList<String>();
esito.add("<h3>Env:</h3>");
for (Map.Entry<String, String> entry : System.getenv().entrySet()) {

42
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 java.io.Serializable;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;
import com.liferay.portal.NoSuchWorkflowInstanceLinkException;
import com.liferay.portal.kernel.bean.PortletBeanLocatorUtil;
@ -411,15 +412,13 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi
ControlloPratica controlloPratica = getControlloPratica(controlloPraticaId);
int unitaOperativa = intPraticaLocalService.getIntPratica(controlloPratica.getIntPraticaId())
.getUnitaOperativa();
boolean preassegnazione = (0 == unitaOperativa);
long companyId = controlloPratica.getCompanyId();
long roleId = RoleLocalServiceUtil.getRole(companyId,
preassegnazione ? "portos_assegnatore" : "portos_istruttore").getRoleId();
long roleId = RoleLocalServiceUtil.getRole(companyId, Constants.ROLE_NAME_ISTRUTTORE).getRoleId();
List<UserGroupRole> userGroupRoles = UserGroupRoleLocalServiceUtil.getUserGroupRolesByGroupAndRole(
controlloPratica.getGroupId(), roleId);
Map<String, JSONObject> sorted = new TreeMap<>();
if (preassegnazione) {
Set<Integer> unitaOperative = new HashSet<>();
List<JSONObject> istruttori = new ArrayList<>();
if (unitaOperativa == 0) {
Set<Integer> unitaOperative = new TreeSet<>();
for (UserGroupRole userGroupRole : userGroupRoles) {
User user = userGroupRole.getUser();
unitaOperative.addAll(UnitaOperativeUtil.getUnitaOperative(user));
@ -427,28 +426,29 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi
for (Integer uo : unitaOperative) {
if (0 != uo) {
JSONObject unita = JSONFactoryUtil.createJSONObject();
unita.put("label", "Unità operativa " + uo);
unita.put("label", " > Unità operativa " + uo);
unita.put("value", "--UO--" + uo);
unita.put("default", false);
sorted.put(String.format("%6d", uo), unita);
istruttori.add(unita);
}
}
} else {
for (UserGroupRole userGroupRole : userGroupRoles) {
User user = userGroupRole.getUser();
if (UnitaOperativeUtil.getUnitaOperative(user).contains(unitaOperativa)) {
JSONObject istruttore = JSONFactoryUtil.createJSONObject();
istruttore.put("label", user.getFullName().toUpperCase());
istruttore.put("value", user.getUserId());
istruttore.put("default", false);
sorted.put((user.getLastName() + user.getFirstName()).toUpperCase(), istruttore);
}
}
Map<String, JSONObject> ordinati = new TreeMap<>();
for (UserGroupRole userGroupRole : userGroupRoles) {
User user = userGroupRole.getUser();
if (UnitaOperativeUtil.getUnitaOperative(user).contains(unitaOperativa)) {
JSONObject istruttore = JSONFactoryUtil.createJSONObject();
istruttore.put("label", user.getFullName().toUpperCase());
istruttore.put("value", user.getUserId());
istruttore.put("default", false);
ordinati.put((user.getLastName() + user.getFirstName()).toUpperCase(), istruttore);
}
}
istruttori.addAll(ordinati.values());
JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
jsonObject.put("istruttore", jsonArray);
for (JSONObject istruttore : sorted.values()) {
for (JSONObject istruttore : istruttori) {
jsonArray.put(istruttore);
}
return jsonObject.toString();
@ -484,7 +484,7 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi
esito.put(etichettaEsito(StatoPraticaConstants.NO_PARERE));
JSONObject json = JSONFactoryUtil.createJSONObject();
json.put("esito", esito);
jsonAutorizzazione = esito.toString();
jsonAutorizzazione = json.toString();
}
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.number=3360
build.date=1631698031653
build.number=3361
build.date=1631701936996
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);
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil.getControlloPratica(controlloPraticaId);
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 formNameSelezionaCambioIstruttore = "formNameSelezionaCambioIstruttore_" + 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);
List<UserGroupRole> userGroupRoles = UserGroupRoleLocalServiceUtil.getUserGroupRolesByGroupAndRole(
controlloPratica.getGroupId(), role.getRoleId());
@ -32,22 +29,22 @@ List<UserGroupRole> userGroupRoles = UserGroupRoleLocalServiceUtil.getUserGroupR
<aui:form name="<%= formNameSelezionaCambioIstruttore %>" method="post" action="<%= cambioIstruttoreUrl %>">
<div id='<%= renderResponse.getNamespace() + divIdSelezionaCambioIstruttore %>' class="hide">
<div>
<liferay-ui:message key="istruttore-attuale" /> <strong> <%= istruttore.getFullName() %> </strong>
<liferay-ui:message key="istruttore-attuale" /> <strong> <%= istruttoreAttuale.getFullName() %> </strong>
</div>
<aui:select name="istruttoreId" label="">
<aui:option label="" value="0" />
<%
List<Integer> uoUser = UnitaOperativeUtil.getUnitaOperative(user);
for (UserGroupRole userGroupRole: userGroupRoles) {
if (userGroupRole.getUserId() != istruttore.getUserId()) {
User istruttoreTmp = UserLocalServiceUtil.getUser(userGroupRole.getUserId());
List<Integer> uoIstruttore = UnitaOperativeUtil.getUnitaOperative(istruttoreTmp);
if (userGroupRole.getUserId() != istruttoreAttuale.getUserId()) {
User istruttore = UserLocalServiceUtil.getUser(userGroupRole.getUserId());
List<Integer> uoIstruttore = UnitaOperativeUtil.getUnitaOperative(istruttore);
if (CollectionUtils.containsAny(uoUser, uoIstruttore)) {
String nominativo = istruttoreTmp.getFullName() + " - U.O. "
String nominativo = istruttore.getFullName() + " - U.O. "
+ 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() %>" />
<%
}
}

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

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

@ -1,8 +1,6 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/html/init.jsp" %>
<%@include file="/html/init.jsp"%>
<%
String tabNames = "Tab_AvvisiDaFirmare,Tab_AvvisiAltri,Tab_AvvisiFirme";
String tabs1 = ParamUtil.getString(request, "tabs1", StringUtil.split(tabNames)[0]);
%>
%>

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

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

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

@ -1,195 +1,118 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/html/homebo/init.jsp" %>
<%
int countPraticheScaduteAutorizzazione = GetterUtil.getInteger(renderRequest.getAttribute("countPraticheScaduteAutorizzazione"));
int countPraticheScaduteSorteggiate = GetterUtil.getInteger(renderRequest.getAttribute("countPraticheScaduteSorteggiate"));
int countPraticheScaduteControlloObbligatorio = GetterUtil.getInteger(renderRequest.getAttribute("countPraticheScaduteControlloObbligatorio"));
int countPraticheScaduteTotali = countPraticheScaduteAutorizzazione + countPraticheScaduteSorteggiate + countPraticheScaduteControlloObbligatorio;
int countPraticheInScadenzaAutorizzazioni = GetterUtil.getInteger(renderRequest.getAttribute("countPraticheInScadenzaAutorizzazioni"));
int countPraticheInScadenzaSorteggiate = GetterUtil.getInteger(renderRequest.getAttribute("countPraticheInScadenzaSorteggiate"));
int countPraticheInScadenzaControlloObbligatorio = GetterUtil.getInteger(renderRequest.getAttribute("countPraticheInScadenzaControlloObbligatorio"));
int countPraticheInScadenzaTotali = countPraticheInScadenzaAutorizzazioni + countPraticheInScadenzaSorteggiate + countPraticheInScadenzaControlloObbligatorio;
int countAutorizzazioniDaAssegnare = GetterUtil.getInteger(renderRequest.getAttribute("countAutorizzazioniDaAssegnare"));
int countSorteggiateDaAssegnare = GetterUtil.getInteger(renderRequest.getAttribute("countSorteggiateDaAssegnare"));
int countControlloObbligatorioDaAssegnare = GetterUtil.getInteger(renderRequest.getAttribute("countControlloObbligatorioDaAssegnare"));
int countPraticheDaAssegnareTotali = countAutorizzazioniDaAssegnare + countSorteggiateDaAssegnare + countControlloObbligatorioDaAssegnare;
int countAutorizzazioniOrdinarie = GetterUtil.getInteger(renderRequest.getAttribute("countAutorizzazioniOrdinarie"));
int countSorteggiateOrdinarie = GetterUtil.getInteger(renderRequest.getAttribute("countSorteggiateOrdinarie"));
int countControlloObbligatorioOrdinarie = GetterUtil.getInteger(renderRequest.getAttribute("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 countPraticheScaduteAutorizzazione = GetterUtil.getInteger(renderRequest.getAttribute(
"countPraticheScaduteAutorizzazione"));
int countPraticheScaduteSorteggiate = GetterUtil.getInteger(renderRequest.getAttribute(
"countPraticheScaduteSorteggiate"));
int countPraticheScaduteControlloObbligatorio = GetterUtil.getInteger(renderRequest.getAttribute(
"countPraticheScaduteControlloObbligatorio"));
int countPraticheScaduteTotali = countPraticheScaduteAutorizzazione + countPraticheScaduteSorteggiate
+ countPraticheScaduteControlloObbligatorio;
int countPraticheInScadenzaAutorizzazioni = GetterUtil.getInteger(renderRequest.getAttribute(
"countPraticheInScadenzaAutorizzazioni"));
int countPraticheInScadenzaSorteggiate = GetterUtil.getInteger(renderRequest.getAttribute(
"countPraticheInScadenzaSorteggiate"));
int countPraticheInScadenzaControlloObbligatorio = GetterUtil.getInteger(renderRequest.getAttribute(
"countPraticheInScadenzaControlloObbligatorio"));
int countPraticheInScadenzaTotali = countPraticheInScadenzaAutorizzazioni + countPraticheInScadenzaSorteggiate
+ countPraticheInScadenzaControlloObbligatorio;
int countAutorizzazioniDaAssegnare = GetterUtil.getInteger(renderRequest.getAttribute(
"countAutorizzazioniDaAssegnare"));
int countSorteggiateDaAssegnare = GetterUtil.getInteger(renderRequest.getAttribute(
"countSorteggiateDaAssegnare"));
int countControlloObbligatorioDaAssegnare = GetterUtil.getInteger(renderRequest.getAttribute(
"countControlloObbligatorioDaAssegnare"));
int countPraticheDaAssegnareTotali = countAutorizzazioniDaAssegnare + countSorteggiateDaAssegnare
+ countControlloObbligatorioDaAssegnare;
int countAutorizzazioniOrdinarie = GetterUtil.getInteger(renderRequest.getAttribute(
"countAutorizzazioniOrdinarie"));
int countSorteggiateOrdinarie = GetterUtil.getInteger(renderRequest.getAttribute(
"countSorteggiateOrdinarie"));
int countControlloObbligatorioOrdinarie = GetterUtil.getInteger(renderRequest.getAttribute(
"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;
%>
<style>
.tabled-head {
border : 1px solid #ddd;
background-color: #812121;
<style>
.tabled-head {
border : 1px solid #ddd;
background-color: #812121;
color: white;
padding: 8px;
}
.tabled-body-first{
border : 1px solid #ddd;
background-color: #f9f9f9;
}
.tabled-body-first{
border : 1px solid #ddd;
background-color: #f9f9f9;
color: black;
padding: 8px;
}
.tabled-body-second{
border : 1px solid #ddd;
background-color: #FFFFFF;
}
.tabled-body-second{
border : 1px solid #ddd;
background-color: #FFFFFF;
color: black;
padding: 8px;
}
</style>
<div class="container-fluid">
<div class="col-sm-12 col-md-12 ">
<h3 style="margin:2%; text-align: center;">PRATICHE IN ISTRUTTORIA</h3>
</div>
</div>
}
</style>
<div class="container-fluid">
<div class="col-sm-2 col-md-2 tabled-head">
TIPOLOGIA
</div>
<!--<div class="col-sm-2 col-md-2 tabled-head">
AUTORIZZAZIONI
</div>
<div class="col-sm-2 col-md-2 tabled-head">
SORTEGGI
<div class="col-sm-12">
<h3 style="margin:2%; text-align: center;">PRATICHE IN ISTRUTTORIA</h3>
</div>
<div class="col-sm-2 col-md-2 tabled-head">
C.O.
</div>
<div class="container-fluid">
<div class="col-sm-2 tabled-head">
TIPOLOGIA
</div>
<div class="col-sm-2 col-md-2 tabled-head">
SANATORIE
</div>-->
<div class="col-sm-2 col-md-2 tabled-head ">
<div class="col-sm-2 tabled-head ">
TOTALI
</div>
</div>
<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>
</div>
<!-- <div class="col-sm-2 col-md-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 %>
<div class="col-sm-2 tabled-body-first">
<%= countPraticheDaAssegnareTotali %>
</div>
</div>
<div class="container-fluid">
<div class="col-sm-2 col-md-2 tabled-body-second">
<strong>PRATICHE ORDINARIE</strong>
</div>
<!-- <div class="col-sm-2 col-md-2 tabled-body-second">
<%=countAutorizzazioniOrdinarie %>
<div class="col-sm-2 tabled-body-second">
<strong>PRATICHE ORDINARIE</strong>
</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 %>
<div class="col-sm-2 tabled-body-second">
<%= countPraticheOrdinarieTotali %>
</div>
</div>
<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>
</div>
<!-- <div class="col-sm-2 col-md-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 %>
<div class="col-sm-2 tabled-body-first">
<%= countPraticheInScadenzaTotali %>
</div>
</div>
<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>
</div>
<!-- <div class="col-sm-2 col-md-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 %>
<div class="col-sm-2 tabled-body-second">
<%= countPraticheScaduteTotali %>
</div>
</div>
<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>
</div>
<!-- <div class="col-sm-2 col-md-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 %>
<div class="col-sm-2 tabled-body-first">
<%= totaleDeiTotali %>
</div>
</div>

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

@ -7,166 +7,153 @@
<%@page import="java.text.NumberFormat"%>
<%@page import="java.math.BigDecimal"%>
<%@ 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
results="<%=PagamentoLocalServiceUtil.findByIntPratica_Visible(intPraticaId) %>"
total="<%=PagamentoLocalServiceUtil.countByIntPratica_Visible(intPraticaId)%>"
>
</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()) %>">
<%
DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(pagamento.getClassPk());
%>
<liferay-ui:search-container-column-text cssClass="text-nowrap" name="Data" value="<%= dateFormatDateTime.format(pagamento.getCreateDate()) %>" />
<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="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" >
<c:if test="<%= PagamentoConstants.PAGAMENTO_ONERI.equalsIgnoreCase(pagamento.getTipoPagamento()) || PagamentoConstants.PAGAMENTO_ONERI_BOLLI.equals(pagamento.getTipoPagamento()) %>">
total="<%=PagamentoLocalServiceUtil.countByIntPratica_Visible(intPraticaId)%>" />
<liferay-ui:search-container-row className="it.tref.liferay.portos.bo.model.Pagamento" modelVar="pagamento">
<c:if test="<%= DettPratica.class.getName().equals(pagamento.getClassName()) %>">
<%
String result = "";
if(dettPratica.isNormEsenteSpese()){
result = "Esente";
} else {
BigDecimal importoSpeseVal;
if( Validator.isNotNull(pagamento.getImporto()) ){
importoSpeseVal = new BigDecimal(pagamento.getImporto());
} else{
importoSpeseVal = new BigDecimal(0.00);
}
result = NumberFormat.getCurrencyInstance(Locale.ITALY).format(importoSpeseVal);
}
out.print(result);
DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(pagamento.getClassPk());
%>
</c:if>
</liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="Spese Bollo">
<c:if test="<%= PagamentoConstants.PAGAMENTO_BOLLI.equalsIgnoreCase(pagamento.getTipoPagamento()) %>">
<%
String result = "";
if(dettPratica.isNormEsenteBollo()){
result = "Esente";
} else {
BigDecimal importoBolliVal;
if( Validator.isNotNull(pagamento.getImporto())){
importoBolliVal = new BigDecimal(pagamento.getImporto());
} else{
importoBolliVal = new BigDecimal(0.00);
}
result = NumberFormat.getCurrencyInstance(Locale.ITALY).format(importoBolliVal);
}
out.print(result);
%>
</c:if>
</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};
%>
<c:if test="<%= !Arrays.asList(notAllowed).contains(pagamento.getUtilizzata()) %>">
<%
String buttonFormId = "pagamentoFormButton_"+index;
String contentFormId = "pagamentoFormContent_"+index;
String formNameBollettino = "fmPagamenti_"+index;
%>
<liferay-ui:icon-menu showWhenSingleIcon="false" extended="false" showExpanded="true" cssClass="inline_toolbar" >
<liferay-ui:icon
id='<%=buttonFormId %>'
iconCssClass="fa fa-edit"
message=""
url="javascript:void(0)"
linkCssClass="btn btn-action"
/>
</liferay-ui:icon-menu>
<div id="<portlet:namespace /><%= contentFormId %>" class="hide" >
<liferay-util:include page="/html/pagamenti/view_panel_form_bollettino.jsp" servletContext='<%= application %>'>
<liferay-util:param name="idPagamento" value="<%= String.valueOf(pagamento.getPagamentoId()) %>"></liferay-util:param>
<liferay-util:param name="dettPraticaId" value="<%= String.valueOf(pagamento.getClassPk()) %>"></liferay-util:param>
<liferay-util:param name="formName" value="<%= formNameBollettino %>"></liferay-util:param>
</liferay-util:include>
</div>
<liferay-util:include page="/html/common/submit_form_window.jsp" servletContext="<%= application %>" >
<liferay-util:param name="titolo" value="Modifica Pagamento"></liferay-util:param>
<liferay-util:param name="buttonId" value="<%=buttonFormId%>"></liferay-util:param>
<liferay-util:param name="contentDiv" value="<%=contentFormId%>"></liferay-util:param>
<liferay-util:param name="width" value="750"></liferay-util:param>
<liferay-util:param name="formName" value="<%= formNameBollettino %>"></liferay-util:param>
<liferay-util:param name="buttonBar" value="true"></liferay-util:param>
</liferay-util:include>
</c:if>
</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};
%>
<c:if test="<%= !Arrays.asList(notAllowed).contains(pagamento.getUtilizzata()) %>">
<%
String buttonId = "pagamentoButton_"+index;
String contentId = "pagamentoContent_"+index;
%>
<liferay-ui:icon-menu showWhenSingleIcon="false" extended="false" showExpanded="true" cssClass="inline_toolbar" >
<liferay-ui:icon
id='<%=buttonId %>'
iconCssClass="fa fa-info-circle"
message="detail"
url="javascript:void(0)"
linkCssClass="btn btn-action"
/>
</liferay-ui:icon-menu>
<div id="<portlet:namespace /><%= contentId %>" class="hide" >
<c:if test="<%= PagamentoConstants.PAGAMENTO_ONERI.equalsIgnoreCase(pagamento.getTipoPagamento()) %>">
<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-ui:search-container-column-text cssClass="text-nowrap" name="Data"
value="<%= dateFormatDateTime.format(pagamento.getCreateDate()) %>" />
<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="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">
<c:if test="<%= PagamentoConstants.PAGAMENTO_ONERI.equalsIgnoreCase(pagamento.getTipoPagamento())
|| PagamentoConstants.PAGAMENTO_ONERI_BOLLI.equals(pagamento.getTipoPagamento()) %>">
<%
String result;
if (dettPratica.isNormEsenteSpese()) {
result = "Esente";
} else {
BigDecimal importoSpeseVal;
if (Validator.isNotNull(pagamento.getImporto())) {
importoSpeseVal = new BigDecimal(pagamento.getImporto());
} else {
importoSpeseVal = new BigDecimal(0.00);
}
result = NumberFormat.getCurrencyInstance(Locale.ITALY).format(importoSpeseVal);
}
out.print(result);
%>
</c:if>
</liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="Spese Bollo">
<c:if test="<%= PagamentoConstants.PAGAMENTO_BOLLI.equalsIgnoreCase(pagamento.getTipoPagamento()) %>">
<liferay-util:include page="/html/pagamenti/view_panel_pagamenti_bolli.jsp" servletContext='<%= application %>'>
<liferay-util:param name="dettPraticaId" value="<%= String.valueOf(pagamento.getClassPk()) %>"/>
<%
String result;
if (dettPratica.isNormEsenteBollo()) {
result = "Esente";
} else {
BigDecimal importoBolliVal;
if (Validator.isNotNull(pagamento.getImporto())) {
importoBolliVal = new BigDecimal(pagamento.getImporto());
} else {
importoBolliVal = new BigDecimal(0.00);
}
result = NumberFormat.getCurrencyInstance(Locale.ITALY).format(importoBolliVal);
}
out.print(result);
%>
</c:if>
</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};
%>
<c:if test="<%= !Arrays.asList(notAllowed).contains(pagamento.getUtilizzata()) %>">
<%
String buttonFormId = "pagamentoFormButton_" + index;
String contentFormId = "pagamentoFormContent_" + index;
String formNameBollettino = "fmPagamenti_" + index;
%>
<liferay-ui:icon-menu showWhenSingleIcon="false" extended="false" showExpanded="true"
cssClass="inline_toolbar">
<liferay-ui:icon id="<%= buttonFormId %>" iconCssClass="fa fa-edit" message=""
url="javascript:void(0)" linkCssClass="btn btn-action" />
</liferay-ui:icon-menu>
<div id="<portlet:namespace /><%= contentFormId %>" class="hide" >
<liferay-util:include page="/html/pagamenti/view_panel_form_bollettino.jsp"
servletContext='<%= application %>'>
<liferay-util:param name="idPagamento"
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>
</div>
<liferay-util:include page="/html/common/submit_form_window.jsp"
servletContext="<%= application %>">
<liferay-util:param name="titolo" value="Modifica Pagamento" />
<liferay-util:param name="buttonId" value="<%= buttonFormId %>" />
<liferay-util:param name="contentDiv" value="<%= contentFormId %>" />
<liferay-util:param name="width" value="750" />
<liferay-util:param name="formName" value="<%= formNameBollettino %>" />
<liferay-util:param name="buttonBar" value="true" />
</liferay-util:include>
</c:if>
<c:if test="<%= PagamentoConstants.PAGAMENTO_ONERI_BOLLI.equalsIgnoreCase(pagamento.getTipoPagamento()) %>">
<liferay-util:include page="/html/pagamenti/view_panel_pagamenti_spese.jsp" servletContext='<%= application %>'>
<liferay-util:param name="dettPraticaId" value="<%= String.valueOf(pagamento.getClassPk()) %>"/>
</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};
%>
<c:if test="<%= !Arrays.asList(notAllowed).contains(pagamento.getUtilizzata()) %>">
<%
String buttonId = "pagamentoButton_" + index;
String contentId = "pagamentoContent_" + index;
%>
<liferay-ui:icon-menu showWhenSingleIcon="false" extended="false" showExpanded="true"
cssClass="inline_toolbar" >
<liferay-ui:icon id='<%= buttonId %>' iconCssClass="fa fa-info-circle" message="detail"
url="javascript:void(0)" linkCssClass="btn btn-action" />
</liferay-ui:icon-menu>
<div id="<portlet:namespace /><%= contentId %>" class="hide" >
<c:if test="<%= PagamentoConstants.PAGAMENTO_ONERI.equalsIgnoreCase(
pagamento.getTipoPagamento()) %>">
<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>
</c:if>
<c:if test="<%= PagamentoConstants.PAGAMENTO_BOLLI.equalsIgnoreCase(
pagamento.getTipoPagamento()) %>">
<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>
</c:if>
<c:if test="<%= PagamentoConstants.PAGAMENTO_ONERI_BOLLI.equalsIgnoreCase(
pagamento.getTipoPagamento()) %>">
<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>
</c:if>
</div>
<liferay-util:include page="/html/common/confirm_window.jsp" servletContext="<%= application %>" >
<liferay-util:param name="titolo" value="Dettaglio Pagamento" />
<liferay-util:param name="buttonId" value="<%= buttonId %>" />
<liferay-util:param name="contentDiv" value="<%= contentId %>" />
<liferay-util:param name="width" value="750" />
</liferay-util:include>
</c:if>
</div>
<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="buttonId" value="<%=buttonId%>"></liferay-util:param>
<liferay-util:param name="contentDiv" value="<%=contentId%>"></liferay-util:param>
<liferay-util:param name="width" value="750"></liferay-util:param>
</liferay-util:include>
</liferay-ui:search-container-column-text>
</c:if>
</liferay-ui:search-container-column-text>
</c:if>
</liferay-ui:search-container-row>
<liferay-ui:search-iterator paginate="false" />
</liferay-ui:search-container>

94
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);
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
Disponibilita disponibilita = disponibilitaPersistence.create(counterLocalService.increment(Disponibilita.class
.getName()));
Disponibilita disponibilita =
disponibilitaPersistence.create(counterLocalService.increment(Disponibilita.class.getName()));
User user = userPersistence.findByPrimaryKey(userId);
Date now = new Date();
disponibilita.setCompanyId(serviceContext.getCompanyId());
@ -124,7 +124,7 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
disponibilita.setPresidio(presidio);
disponibilita.setExactDate(sdf.format(startDate));
disponibilita.setDisponibile(true);
disponibilita = disponibilitaLocalService.updateDisponibilita(disponibilita);
disponibilita = updateDisponibilita(disponibilita);
return disponibilita;
}
@ -134,8 +134,8 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
Organization organization = OrganizationLocalServiceUtil.fetchOrganization(presidio);
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
Disponibilita disponibilita = disponibilitaPersistence.create(counterLocalService.increment(Disponibilita.class
.getName()));
Disponibilita disponibilita =
disponibilitaPersistence.create(counterLocalService.increment(Disponibilita.class.getName()));
User user = userPersistence.findByPrimaryKey(userId);
Date now = new Date();
disponibilita.setCompanyId(serviceContext.getCompanyId());
@ -150,7 +150,7 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
disponibilita.setPresidio(presidio);
disponibilita.setExactDate(sdf.format(startDate));
disponibilita.setDisponibile(false);
disponibilita = disponibilitaLocalService.updateDisponibilita(disponibilita);
disponibilita = updateDisponibilita(disponibilita);
return disponibilita;
}
@ -166,11 +166,12 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
List<User> users = userLocalService.getOrganizationUsers(presidioId);
for (User user : users) {
Role portosSupporto = RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_supporto");
Role portosIstruttore = RoleLocalServiceUtil.getRole(organization.getCompanyId(),
"portos_calendario");
Role portosIstruttore =
RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_calendario");
if (!userLocalService.hasRoleUser(portosSupporto.getRoleId(), user.getUserId())) {
boolean isIstruttore = UserGroupRoleLocalServiceUtil.hasUserGroupRole(user.getUserId(),
organization.getGroupId(), portosIstruttore.getRoleId());
boolean isIstruttore =
UserGroupRoleLocalServiceUtil.hasUserGroupRole(user.getUserId(),
organization.getGroupId(), portosIstruttore.getRoleId());
if (isIstruttore) {
userDefinitivo.add(user);
}
@ -204,7 +205,7 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
for (Iterator<Disponibilita> iterator = results.iterator(); iterator.hasNext();) {
Disponibilita disponibilita = iterator.next();
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();) {
Disponibilita disponibilita = iterator.next();
disponibilita.setDisponibile(true);
disponibilitaLocalService.updateDisponibilita(disponibilita);
updateDisponibilita(disponibilita);
}
}
}
@ -269,8 +270,9 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
Calendar cal2 = Calendar.getInstance();
cal1.setTime(date1);
cal2.setTime(date2);
boolean sameDay = cal1.get(Calendar.YEAR) == cal2.get(Calendar.YEAR)
&& cal1.get(Calendar.DAY_OF_YEAR) == cal2.get(Calendar.DAY_OF_YEAR);
boolean sameDay =
cal1.get(Calendar.YEAR) == cal2.get(Calendar.YEAR)
&& cal1.get(Calendar.DAY_OF_YEAR) == cal2.get(Calendar.DAY_OF_YEAR);
return sameDay;
}
@ -328,7 +330,7 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
dynamicQuery.add(RestrictionsFactoryUtil.ge("startDate", start));
Order defaultOrder = OrderFactoryUtil.asc("startDate");
dynamicQuery.addOrder(defaultOrder);
return disponibilitaLocalService.dynamicQuery(dynamicQuery, startRow, endRow);
return dynamicQuery(dynamicQuery, startRow, endRow);
}
@Override
@ -340,7 +342,7 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
dynamicQuery.add(RestrictionsFactoryUtil.ge("startDate", start));
Order defaultOrder = OrderFactoryUtil.asc("startDate");
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")
@ -352,11 +354,11 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
List<Long> orgIds = new ArrayList<Long>();
try {
Role dirigenteGenerale = RoleLocalServiceUtil.getRole(user.getCompanyId(), "dirigente_generale");
boolean isDirigenteGenerale = RoleLocalServiceUtil.hasUserRole(user.getUserId(),
dirigenteGenerale.getRoleId());
boolean isDirigenteGenerale =
RoleLocalServiceUtil.hasUserRole(user.getUserId(), dirigenteGenerale.getRoleId());
if (isDirigenteGenerale) {
List<Organization> orgs = OrganizationLocalServiceUtil.getOrganizations(QueryUtil.ALL_POS,
QueryUtil.ALL_POS);
List<Organization> orgs =
OrganizationLocalServiceUtil.getOrganizations(QueryUtil.ALL_POS, QueryUtil.ALL_POS);
for (Organization organization : orgs) {
if (organization.getParentOrganization() != null) {
orgIds.add(organization.getOrganizationId());
@ -366,8 +368,9 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
List<Organization> orgs = OrganizationLocalServiceUtil.getUserOrganizations(funzionarioId);
for (Organization organization : orgs) {
Role portosPO = RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_po");
boolean isPO = UserGroupRoleLocalServiceUtil.hasUserGroupRole(funzionarioId,
organization.getGroupId(), portosPO.getRoleId());
boolean isPO =
UserGroupRoleLocalServiceUtil.hasUserGroupRole(funzionarioId, organization.getGroupId(),
portosPO.getRoleId());
if (isPO) {
orgIds.add(organization.getOrganizationId());
}
@ -391,7 +394,7 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
dynamicQuery.add(RestrictionsFactoryUtil.ge("startDate", start));
Order defaultOrder = OrderFactoryUtil.asc("startDate");
dynamicQuery.addOrder(defaultOrder);
return disponibilitaLocalService.dynamicQuery(dynamicQuery, startRow, endRow);
return dynamicQuery(dynamicQuery, startRow, endRow);
}
@Override
@ -402,11 +405,11 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
List<Long> orgIds = new ArrayList<Long>();
try {
Role dirigenteGenerale = RoleLocalServiceUtil.getRole(user.getCompanyId(), "dirigente_generale");
boolean isDirigenteGenerale = RoleLocalServiceUtil.hasUserRole(user.getUserId(),
dirigenteGenerale.getRoleId());
boolean isDirigenteGenerale =
RoleLocalServiceUtil.hasUserRole(user.getUserId(), dirigenteGenerale.getRoleId());
if (isDirigenteGenerale) {
List<Organization> orgs = OrganizationLocalServiceUtil.getOrganizations(QueryUtil.ALL_POS,
QueryUtil.ALL_POS);
List<Organization> orgs =
OrganizationLocalServiceUtil.getOrganizations(QueryUtil.ALL_POS, QueryUtil.ALL_POS);
for (Organization organization : orgs) {
if (organization.getParentOrganization() != null) {
orgIds.add(organization.getOrganizationId());
@ -416,8 +419,9 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
List<Organization> orgs = OrganizationLocalServiceUtil.getUserOrganizations(funzionarioId);
for (Organization organization : orgs) {
Role portosPO = RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_po");
boolean isPO = UserGroupRoleLocalServiceUtil.hasUserGroupRole(funzionarioId,
organization.getGroupId(), portosPO.getRoleId());
boolean isPO =
UserGroupRoleLocalServiceUtil.hasUserGroupRole(funzionarioId, organization.getGroupId(),
portosPO.getRoleId());
if (isPO) {
orgIds.add(organization.getOrganizationId());
}
@ -441,7 +445,7 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
dynamicQuery.add(RestrictionsFactoryUtil.ge("startDate", start));
Order defaultOrder = OrderFactoryUtil.asc("startDate");
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")
@ -453,11 +457,11 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
List<Long> orgIds = new ArrayList<Long>();
try {
Role dirigenteGenerale = RoleLocalServiceUtil.getRole(user.getCompanyId(), "dirigente_generale");
boolean isDirigenteGenerale = RoleLocalServiceUtil.hasUserRole(user.getUserId(),
dirigenteGenerale.getRoleId());
boolean isDirigenteGenerale =
RoleLocalServiceUtil.hasUserRole(user.getUserId(), dirigenteGenerale.getRoleId());
if (isDirigenteGenerale) {
List<Organization> orgs = OrganizationLocalServiceUtil.getOrganizations(QueryUtil.ALL_POS,
QueryUtil.ALL_POS);
List<Organization> orgs =
OrganizationLocalServiceUtil.getOrganizations(QueryUtil.ALL_POS, QueryUtil.ALL_POS);
for (Organization organization : orgs) {
if (organization.getParentOrganization() != null) {
orgIds.add(organization.getOrganizationId());
@ -467,8 +471,9 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
List<Organization> orgs = OrganizationLocalServiceUtil.getUserOrganizations(funzionarioId);
for (Organization organization : orgs) {
Role portosPO = RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_po");
boolean isPO = UserGroupRoleLocalServiceUtil.hasUserGroupRole(funzionarioId,
organization.getGroupId(), portosPO.getRoleId());
boolean isPO =
UserGroupRoleLocalServiceUtil.hasUserGroupRole(funzionarioId, organization.getGroupId(),
portosPO.getRoleId());
if (isPO) {
orgIds.add(organization.getOrganizationId());
}
@ -484,7 +489,7 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
dynamicQuery.add(RestrictionsFactoryUtil.ge("startDate", start));
Order defaultOrder = OrderFactoryUtil.asc("startDate");
dynamicQuery.addOrder(defaultOrder);
return disponibilitaLocalService.dynamicQuery(dynamicQuery, startRow, endRow);
return dynamicQuery(dynamicQuery, startRow, endRow);
}
@Override
@ -494,11 +499,11 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
List<Long> orgIds = new ArrayList<Long>();
try {
Role dirigenteGenerale = RoleLocalServiceUtil.getRole(user.getCompanyId(), "dirigente_generale");
boolean isDirigenteGenerale = RoleLocalServiceUtil.hasUserRole(user.getUserId(),
dirigenteGenerale.getRoleId());
boolean isDirigenteGenerale =
RoleLocalServiceUtil.hasUserRole(user.getUserId(), dirigenteGenerale.getRoleId());
if (isDirigenteGenerale) {
List<Organization> orgs = OrganizationLocalServiceUtil.getOrganizations(QueryUtil.ALL_POS,
QueryUtil.ALL_POS);
List<Organization> orgs =
OrganizationLocalServiceUtil.getOrganizations(QueryUtil.ALL_POS, QueryUtil.ALL_POS);
for (Organization organization : orgs) {
if (organization.getParentOrganization() != null) {
orgIds.add(organization.getOrganizationId());
@ -508,8 +513,9 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
List<Organization> orgs = OrganizationLocalServiceUtil.getUserOrganizations(funzionarioId);
for (Organization organization : orgs) {
Role portosPO = RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_po");
boolean isPO = UserGroupRoleLocalServiceUtil.hasUserGroupRole(funzionarioId,
organization.getGroupId(), portosPO.getRoleId());
boolean isPO =
UserGroupRoleLocalServiceUtil.hasUserGroupRole(funzionarioId, organization.getGroupId(),
portosPO.getRoleId());
if (isPO) {
orgIds.add(organization.getOrganizationId());
}
@ -525,7 +531,7 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase
dynamicQuery.add(RestrictionsFactoryUtil.ge("startDate", start));
Order defaultOrder = OrderFactoryUtil.asc("startDate");
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 {

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

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 {
private final static Log _log = LogFactoryUtil.getLog(StartUpAction.class);
private static final Log _log = LogFactoryUtil.getLog(StartUpAction.class);
@Override
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;
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.SimpleAction;
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.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 {
private final static Log _log = LogFactoryUtil.getLog(DeployAction.class);
private static final Log _log = LogFactoryUtil.getLog(DeployAction.class);
@Override
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() {
@ -48,7 +39,6 @@ public class DeployAction extends SimpleAction {
String evento = message.getString("command");
String nomePlugin = message.getString("servletContextName");
if (evento.equals("undeploy") && nomePlugin.equals("portos-deploy-alert-portlet")) {
try {
NotificationLogLocalServiceUtil.addNotification(nomePlugin, evento);
@ -59,16 +49,12 @@ public class DeployAction extends SimpleAction {
} else if (evento.equals("deploy") || evento.equals("undeploy")) {
try {
List<NotificationMail> notifications;
NotificationLogLocalServiceUtil.addNotification(nomePlugin, evento);
notifications = NotificationMailLocalServiceUtil.findNotifications(
PortalUtil.getDefaultCompanyId(), nomePlugin);
notifications =
NotificationMailLocalServiceUtil.findNotifications(PortalUtil.getDefaultCompanyId(),
nomePlugin);
for (int i = 0; i < notifications.size(); i++) {
String templateName = notifications.get(i).getNomeTemplate();
if (templateName.equals(MailConstants.DEFAULT_TEMPLATE)) {
if (evento.equals("deploy")) {
templateName = MailConstants.DEFAULT_DEPLOY_TEMPLATE;
@ -76,14 +62,11 @@ public class DeployAction extends SimpleAction {
templateName = MailConstants.DEFAULT_UNDEPLOY_TEMPLATE;
}
}
JSONObject parametri = DeployAlertUtil.getParametri(nomePlugin, evento);
ServiceContext serviceContext = DeployAlertUtil.getServiceContext();
MailManagerUtil.sendMailByTemplateName(Company.class.toString(),
serviceContext.getCompanyId(), templateName, parametri, serviceContext);
}
} catch (Exception e) {
_log.error(e, e);
}

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

@ -2,10 +2,7 @@ package it.tref.liferay.portos.deployalert.constants;
public class MailConstants {
public static final String DEFAULT_TEMPLATE = "default";
public static final String DEFAULT_DEPLOY_TEMPLATE = "default-deploy";
public static final String DEFAULT_UNDEPLOY_TEMPLATE = "default-undeploy";
public static final String DEFAULT_TEMPLATE = "default";
public static final String DEFAULT_DEPLOY_TEMPLATE = "default-deploy";
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 {
@Override
public boolean hasAccessPermission(PermissionChecker permissionChecker, Group group, Portlet portlet)
throws Exception {
long companyId = PortalUtil.getDefaultCompanyId();
if (companyId == permissionChecker.getCompanyId()) {
return true;
}
return false;
}
}

35
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.
*
* 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.
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it
* and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 2.1 of the License, or (at your option) any later version. This library is 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;
/**
* 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>
* 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>
*
* @author Matteo
*/
@SuppressWarnings("serial")
public class NotificationLogImpl extends NotificationLogBaseImpl {
/*
* 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.
* 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.
*/
public NotificationLogImpl() {
}
}
public NotificationLogImpl() {}
}

41
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.
*
* 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.
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it
* and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 2.1 of the License, or (at your option) any later version. This library is 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;
/**
* 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
* class.
* &quot;NO_NotificationMail&quot; database table, with each column mapped to a property of this class.
* <p>
* Helper methods and all application logic should be put in this class. Whenever methods are added,
* rerun ServiceBuilder to copy their definitions into the
* {@link it.tref.liferay.portos.deployalert.model.NotificationMail} 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.NotificationMail}
* interface.
* </p>
*
* @author Matteo
*/
@SuppressWarnings("serial")
public class NotificationMailImpl extends NotificationMailBaseImpl {
/*
* NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a
* notification mail model instance should use the {@link
* it.tref.liferay.portos.deployalert.model.NotificationMail} interface instead.
*/
public NotificationMailImpl() {
}
/*
* NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a notification mail model
* instance should use the {@link it.tref.liferay.portos.deployalert.model.NotificationMail} interface instead.
*/
public NotificationMailImpl() {}
}

100
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;
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.SystemException;
import com.liferay.portal.kernel.servlet.SessionErrors;
@ -8,61 +14,45 @@ import com.liferay.portal.service.ServiceContext;
import com.liferay.portal.service.ServiceContextFactory;
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 void addNotification(ActionRequest request, ActionResponse response) throws PortalException, SystemException {
ServiceContext serviceContext = ServiceContextFactory.getInstance(NotificationMail.class.getName(), request);
String nomePlugin = ParamUtil.getString(request, "nomePlugin");
String nomeTemplate = ParamUtil.getString(request, "nomeTemplate");
try {
NotificationMailLocalServiceUtil.addNotification(nomePlugin, nomeTemplate, serviceContext);
} catch (PortalException e) {
SessionErrors.add(request, e.getClass());
response.setRenderParameter("mvcPath", "/html/notificator/edit_notification.jsp");
}
}
public void deleteNotification(ActionRequest request, ActionResponse response) throws PortalException,
SystemException {
long notificationId = ParamUtil.getLong(request, "notificationId");
try {
NotificationMailLocalServiceUtil.deleteNotificationMail(notificationId);
} catch (PortalException pe) {
SessionErrors.add(request, pe.getClass().getName());
}
}
public void updateNotification(ActionRequest request, ActionResponse response) throws PortalException,
SystemException {
ServiceContext serviceContext = ServiceContextFactory.getInstance(NotificationMail.class.getName(), request);
String nomePlugin = ParamUtil.getString(request, "nomePlugin");
String nomeTemplate = ParamUtil.getString(request, "nomeTemplate");
long notificationId = ParamUtil.getLong(request, "notificationId");
try {
NotificationMailLocalServiceUtil.updateNotification(nomePlugin, nomeTemplate, serviceContext, notificationId);
} catch (PortalException pe) {
SessionErrors.add(request, pe.getClass());
response.setRenderParameter("mvcPath", "/html/notificator/edit_notification.jsp");
}
}
public void addNotification(ActionRequest request, ActionResponse response) throws PortalException, SystemException {
ServiceContext serviceContext = ServiceContextFactory.getInstance(NotificationMail.class.getName(), request);
String nomePlugin = ParamUtil.getString(request, "nomePlugin");
String nomeTemplate = ParamUtil.getString(request, "nomeTemplate");
try {
NotificationMailLocalServiceUtil.addNotification(nomePlugin, nomeTemplate, serviceContext);
} catch (PortalException e) {
SessionErrors.add(request, e.getClass());
response.setRenderParameter("mvcPath", "/html/notificator/edit_notification.jsp");
}
}
public void deleteNotification(ActionRequest request, ActionResponse response) throws PortalException,
SystemException {
long notificationId = ParamUtil.getLong(request, "notificationId");
try {
NotificationMailLocalServiceUtil.deleteNotificationMail(notificationId);
} catch (PortalException pe) {
SessionErrors.add(request, pe.getClass().getName());
}
}
public void updateNotification(ActionRequest request, ActionResponse response) throws PortalException,
SystemException {
ServiceContext serviceContext = ServiceContextFactory.getInstance(NotificationMail.class.getName(), request);
String nomePlugin = ParamUtil.getString(request, "nomePlugin");
String nomeTemplate = ParamUtil.getString(request, "nomeTemplate");
long notificationId = ParamUtil.getLong(request, "notificationId");
try {
NotificationMailLocalServiceUtil.updateNotification(nomePlugin, nomeTemplate, serviceContext,
notificationId);
} catch (PortalException pe) {
SessionErrors.add(request, pe.getClass());
response.setRenderParameter("mvcPath", "/html/notificator/edit_notification.jsp");
}
}
}

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.
*
* 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.
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it
* and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 2.1 of the License, or (at your option) any later version. This library is 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;
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.NotificationTipoException;
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 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.
* <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.NotificationLogLocalService}
* 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.NotificationLogLocalService} interface.
* <p>
* This is a local service. Methods of this service will not have security
* checks based on the propagated JAAS credentials because this service can only
* be accessed from within the same VM.
* This is a local service. Methods of this service will not have security checks based on the propagated JAAS
* credentials because this service can only be accessed from within the same VM.
* </p>
*
* @author Matteo
@ -44,22 +35,17 @@ import java.util.Date;
*/
public class NotificationLogLocalServiceImpl extends NotificationLogLocalServiceBaseImpl {
public NotificationLog addNotification(String nomePlugin, String tipo) throws SystemException,
PortalException {
@Override
public NotificationLog addNotification(String nomePlugin, String tipo) throws SystemException, PortalException {
Date now = new Date();
validate(nomePlugin, tipo);
long notificationId = counterLocalService.increment(NotificationLog.class.getName());
NotificationLog notification = notificationLogPersistence.create(notificationId);
notification.setTipo(tipo);
notification.setNomePlugin(nomePlugin);
notification.setData(now);
notificationLogPersistence.update(notification);
return notification;
}
@ -72,6 +58,5 @@ public class NotificationLogLocalServiceImpl extends NotificationLogLocalService
if (Validator.isNull(tipo)) {
throw new NotificationTipoException();
}
}
}

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

39
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.
*
* 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.
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it
* and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 2.1 of the License, or (at your option) any later version. This library is 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;
@ -18,17 +12,12 @@ import it.tref.liferay.portos.deployalert.service.base.NotificationMailServiceBa
/**
* The implementation of the notification mail remote service.
*
* <p>
* All custom service methods should be put in this class. Whenever methods are
* added, rerun ServiceBuilder to copy their definitions into the
* {@link it.tref.liferay.portos.deployalert.service.NotificationMailService}
* 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.NotificationMailService} interface.
* <p>
* This is a remote service. Methods of this service are expected to have
* security checks based on the propagated JAAS credentials because this service
* can be accessed remotely.
* This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS
* credentials because this service can be accessed remotely.
* </p>
*
* @author Matteo
@ -37,10 +26,8 @@ import it.tref.liferay.portos.deployalert.service.base.NotificationMailServiceBa
*/
public class NotificationMailServiceImpl extends NotificationMailServiceBaseImpl {
/*
* NOTE FOR DEVELOPERS:
*
* Never reference this interface directly. Always use {@link
* it.tref.liferay.portos.deployalert.service.NotificationMailServiceUtil}
* to access the notification mail remote service.
* NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link
* 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;
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.json.JSONFactoryUtil;
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.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 {
private final static Log _log = LogFactoryUtil.getLog(DeployAlertUtil.class);
private static final Log _log = LogFactoryUtil.getLog(DeployAlertUtil.class);
public static final ServiceContext getServiceContext() {
long companyId = PortalUtil.getDefaultCompanyId();
ServiceContext serviceContext = new ServiceContext();
Company company;
serviceContext.setCompanyId(companyId);
try {
company = CompanyLocalServiceUtil.getCompany(companyId);
Role role = RoleLocalServiceUtil.getRole(company.getCompanyId(), RoleConstants.ADMINISTRATOR);
long userAdminId = UserLocalServiceUtil.getRoleUserIds(role.getRoleId())[0];
serviceContext.setUserId(userAdminId);
serviceContext.setScopeGroupId(company.getGroupId());
PermissionThreadLocal.setPermissionChecker(PermissionCheckerFactoryUtil
.create(UserLocalServiceUtil.getUser(userAdminId)));
PermissionThreadLocal.setPermissionChecker(PermissionCheckerFactoryUtil.create(UserLocalServiceUtil
.getUser(userAdminId)));
} catch (Exception e) {
_log.error(e, e);
}
return serviceContext;
}
@ -57,10 +52,9 @@ public class DeployAlertUtil {
String subject = "Deploy Plugin";
String body = "E' stato effettuato il $evento del plugin $nomePlugin in data $data.";
String[] to = { "matteoguggia97@gmail.com" };
try {
add = MailManagerUtil.addMailTemplate(MailConstants.DEFAULT_DEPLOY_TEMPLATE,
"test@3fconsulting.it", to, null, null, subject, body, false, serviceContext);
add = MailManagerUtil.addMailTemplate(MailConstants.DEFAULT_DEPLOY_TEMPLATE, "test@3fconsulting.it", to,
null, null, subject, body, false, serviceContext);
} catch (SystemException e) {
_log.error(e, e);
}
@ -77,8 +71,8 @@ public class DeployAlertUtil {
String[] to = { "matteoguggia97@gmail.com" };
try {
add = MailManagerUtil.addMailTemplate(MailConstants.DEFAULT_UNDEPLOY_TEMPLATE,
"test@3fconsulting.it", to, null, null, subject, body, false, serviceContext);
add = MailManagerUtil.addMailTemplate(MailConstants.DEFAULT_UNDEPLOY_TEMPLATE, "test@3fconsulting.it", to,
null, null, subject, body, false, serviceContext);
} catch (SystemException 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.number=10
build.date=1612446773513
build.number=11
build.date=1631869742186
build.auto.upgrade=true
##

4
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 {
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,
PortletException {
@ -112,4 +112,4 @@ public class RicercaPratichePortlet extends MVCPortlet {
super.serveResource(resourceRequest, resourceResponse);
}
}
}
}

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 {
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)
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 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" >
<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") %>

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

@ -1,91 +1,76 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.liferay.portos.bo.util.PraticaUtil"%>
<%@page import="com.liferay.portal.kernel.bean.BeanPropertiesUtil"%>
<%@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.FineLavoriLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.TipoIntegrazioneUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.ComuneLocalServiceUtil"%>
<%@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="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.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.model.Provincia"%>
<%@page import="it.tref.liferay.portos.bo.model.Comune"%>
<%@page import="it.tref.liferay.portos.bo.model.Territorio"%>
<%@page import="it.tref.liferay.portos.bo.model.IntPratica"%>
<%@page import="it.tref.liferay.portos.bo.model.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" %>
<%@page import="it.tref.liferay.portos.bo.shared.util.TipoIntegrazioneUtil"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil"%>
<%@page import="it.tref.liferay.portos.bo.util.PraticaUtil"%>
<%@include file="/html/fascicolofe/init.jsp"%>
<%
long intPraticaId = ParamUtil.getLong(request, "intPraticaId",0l);
long dettPraticaId = ParamUtil.getLong(request, "dettPraticaId",0l);
DettPratica dettPratica = null;
IntPratica intPratica = null;
if(intPraticaId!=0l){
intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId);
dettPratica = DettPraticaServiceUtil.getLastEditableByIntPratica(intPraticaId);
if(dettPratica==null){
dettPratica = DettPraticaServiceUtil.getLastCompletedByIntPratica(intPraticaId);
}
dettPraticaId = dettPratica.getDettPraticaId();
}
Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId());
Comune comune = ComuneLocalServiceUtil.getComune(territorio.getComuneId());
Provincia provincia = ProvinciaLocalServiceUtil.fetchByC_C(territorio.getCompanyId(), territorio.getCodiceProvincia());
String name = StringPool.MINUS;
if(intPratica.getStatusByUserId() != 0) {
name = UserLocalServiceUtil.getUser(intPratica.getStatusByUserId()).getFullName();
long intPraticaId = ParamUtil.getLong(request, "intPraticaId", 0);
long dettPraticaId = ParamUtil.getLong(request, "dettPraticaId", 0);
DettPratica dettPratica = null;
IntPratica intPratica = null;
if (intPraticaId != 0) {
intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId);
dettPratica = DettPraticaServiceUtil.getLastEditableByIntPratica(intPraticaId);
if (dettPratica == null) {
dettPratica = DettPraticaServiceUtil.getLastCompletedByIntPratica(intPraticaId);
}
int nVarianti = DettPraticaLocalServiceUtil.countCompletedByIntPraticaAndTipoPratica(intPraticaId, Arrays.asList(new String[]{TipoIntegrazioneUtil.VARIANTE}));
int nCambioSoggetti = DettPraticaLocalServiceUtil.countCompletedByIntPraticaAndTipoPratica(intPraticaId, Arrays.asList(new String[]{TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO}));
int nFineLavori = FineLavoriLocalServiceUtil.countByIntPraticaId_Completata(intPraticaId, true);
int nCollaudo = CollaudoLocalServiceUtil.countByIntPraticaId_Completata(intPraticaId, true);
String hide1 = (intPratica.getTipoProcedura().equals(Constants.PROCEDURA_Q1) || intPratica.getTipoProcedura().equals(Constants.PROCEDURA_P1) ? "hideSection" : "");
String hide3 = (intPratica.getTipoProcedura().equals(Constants.PROCEDURA_Q3) || intPratica.getTipoProcedura().equals(Constants.PROCEDURA_P3) ? "hideSection" : "");
String hide8 = (intPratica.getTipoProcedura().equals(Constants.PROCEDURA_Q8) || intPratica.getTipoProcedura().equals(Constants.PROCEDURA_P8) ? "hideSection" : "");
String hide9 = (intPratica.getTipoProcedura().equals(Constants.PROCEDURA_Q9) || intPratica.getTipoProcedura().equals(Constants.PROCEDURA_P9) ? "hideSection" : "");
String hide10 = (intPratica.getTipoProcedura().equals(Constants.PROCEDURA_Q10) || intPratica.getTipoProcedura().equals(Constants.PROCEDURA_P10) ? "hideSection" : "");
dettPraticaId = dettPratica.getDettPraticaId();
}
Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId());
Comune comune = ComuneLocalServiceUtil.getComune(territorio.getComuneId());
Provincia provincia = ProvinciaLocalServiceUtil.fetchByC_C(territorio.getCompanyId(), territorio.getCodiceProvincia());
String name = StringPool.MINUS;
if (intPratica.getStatusByUserId() != 0) {
name = UserLocalServiceUtil.getUser(intPratica.getStatusByUserId()).getFullName();
}
int nVarianti = DettPraticaLocalServiceUtil.countCompletedByIntPraticaAndTipoPratica(intPraticaId,
Arrays.asList(new String[]{ TipoIntegrazioneUtil.VARIANTE }));
int nCambioSoggetti = DettPraticaLocalServiceUtil.countCompletedByIntPraticaAndTipoPratica(intPraticaId,
Arrays.asList(new String[]{ TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO }));
int nFineLavori = FineLavoriLocalServiceUtil.countByIntPraticaId_Completata(intPraticaId, true);
int nCollaudo = CollaudoLocalServiceUtil.countByIntPraticaId_Completata(intPraticaId, true);
String hide1 = (intPratica.getTipoProcedura().equals(Constants.PROCEDURA_Q1)
|| intPratica.getTipoProcedura().equals(Constants.PROCEDURA_P1) ? "hideSection" : StringPool.BLANK);
String hide3 = (intPratica.getTipoProcedura().equals(Constants.PROCEDURA_Q3)
|| intPratica.getTipoProcedura().equals(Constants.PROCEDURA_P3) ? "hideSection" : StringPool.BLANK);
String hide8 = (intPratica.getTipoProcedura().equals(Constants.PROCEDURA_Q8)
|| 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="row">
<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;">
<c:if test="<%=Constants.TIPO_PRATICA_AUTORIZZAZIONE.equalsIgnoreCase(intPratica.getTipoPratica()) %>">
<span class="bg-success img-thumbnail"
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
</c:if>
<c:if test="<%=Constants.TIPO_PRATICA_DEPOSITO .equalsIgnoreCase(intPratica.getTipoPratica()) %>">
<c:if test="<%= Constants.TIPO_PRATICA_DEPOSITO .equals(intPratica.getTipoPratica()) %>">
D
</c:if>
</span>
</div>
<div class="col-sm-10 col-md-10">
<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="row">
<div class="col-sm-2 col-md-2">
@ -93,18 +78,24 @@
</div>
<div class="col-sm-4 col-md-4">
<strong>
<% if(intPratica.getValidata()) { %>
<span class="fa fa-check" style="color:green"></span>
<% }else { %>
<span class="fa fa-times" style="color:red"></span>
<% } %>
<%
if (intPratica.getValidata()) {
%>
<span class="fa fa-check" style="color:green"></span>
<%
} else {
%>
<span class="fa fa-times" style="color:red"></span>
<%
}
%>
</strong>
</div>
<div class="col-sm-2 col-md-2">
Istruttore:
</div>
<div class="col-sm-4 col-md-4">
<strong><%=name %></strong>
<strong><%= name %></strong>
</div>
</div>
<div class="row">
@ -112,13 +103,18 @@
Tipologia:
</div>
<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 class="col-sm-2 col-md-2">
Stato:
</div>
<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>
@ -129,110 +125,180 @@
<div class="row">
<div class="col-sm-7 col-md-7">
<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">
<% if(nVarianti == 0 ) { %>
Varianti <strong><span class="fa fa-circle-o" style="color:orange"></span> Non presentate</strong>
<% } else if(nVarianti == 1 ) { %>
Variante <strong><span class="fa fa-check" style="color:green"></span> Presentata <%=nVarianti %> volta</strong>
<% } else { %>
Varianti <strong><span class="fa fa-check" style="color:green"></span> Presentate <%=nVarianti %> volte</strong>
<%
if (nVarianti == 0) {
%>
Varianti
<strong><span class="fa fa-circle-o" style="color:orange"></span> non presentate</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 class="col-sm-6 col-md-3">
<% if(nCambioSoggetti == 0 ) { %>
Cambio soggetti <strong><span class="fa fa-circle-o" style="color:orange"></span> Non presentata</strong>
<% } else if(nCambioSoggetti == 1 ) { %>
Cambio soggetti <strong><span class="fa fa-check" style="color:green"></span> Presentata <%=nCambioSoggetti %> volta</strong>
<% } else { %>
Cambio soggetti <strong><span class="fa fa-check" style="color:green"></span> Presentata <%=nCambioSoggetti %> volte</strong>
<% } %>
Cambio soggetti
<%
if (nCambioSoggetti == 0) {
%>
<strong><span class="fa fa-circle-o" style="color:orange"></span> non presentato</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 class="col-sm-6 col-md-3">
<% if(nFineLavori == 0 ) { %>
Fine Lavori <strong><span class="fa fa-close txt-red"></span> Non presentata</strong>
<% } else if(nVarianti == 1 ) { %>
Fine Lavori <strong><span class="fa fa-check txt-green"></span> Presentata <%=nFineLavori %> volta</strong>
<% } else { %>
Fine Lavori <strong><span class="fa fa-check txt-green"></span> Presentata <%=nFineLavori %> volte</strong>
Fine Lavori
<%
if (nFineLavori == 0) {
%>
<strong><span class="fa fa-close txt-red"></span> non presentata</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 class="col-sm-6 col-md-3">
<% if(nCollaudo == 0 ) { %>
Collaudo <strong><span class="fa fa-close" style="color:red"></span> Non presentato</strong>
<% } else if(nCollaudo == 1 ) { %>
Collaudo <strong><span class="fa fa-check" style="color:green"></span> Presentato <%=nFineLavori %> volta</strong>
<% } else { %>
Collaudo <strong><span class="fa fa-check" style="color:green"></span> Presentato <%=nFineLavori %> volte</strong>
<% } %>
Collaudo
<%
if (nCollaudo == 0 ) {
%>
<strong><span class="fa fa-close" style="color:red"></span> non presentato</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>
</liferay-ui:panel>
</div>
<div class="module-group <%= hide10 %>">
<liferay-ui:panel extended="false" defaultState="open" collapsible="false" title="fascicolo_title_descrizione" >
<div class="module-group <%= hide10 %>">
<liferay-ui:panel extended="false" defaultState="open" collapsible="false"
title="fascicolo_title_descrizione">
<div class="prog-description">
<%=BeanPropertiesUtil.getString(dettPratica, "descLongIntervento") %>
<%= BeanPropertiesUtil.getString(dettPratica, "descLongIntervento") %>
</div>
</liferay-ui:panel>
</div>
<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="row">
<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>
<%=LanguageUtil.get(pageContext, "tc-nuova-costruzione") %>
<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") %>
</div>
<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>
<%=LanguageUtil.get(pageContext, "tc-nuova-costruzione-pertinenza") %>
<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") %>
</div>
<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>
<%=LanguageUtil.get(pageContext, "tc-costruzioni-esistenti") %>
<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") %>
</div>
<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>
<%=LanguageUtil.get(pageContext, "tc-manut-ord-straord") %>
<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") %>
</div>
<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>
<%=LanguageUtil.get(pageContext, "tc-intervento-opere-escavazione") %>
<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") %>
</div>
<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>
<%=LanguageUtil.get(pageContext, "tc-no-opere-escavazione") %>
<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") %>
</div>
<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>
<%=LanguageUtil.get(pageContext, "tc-altri-interventi") %>
<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") %>
</div>
<div class="col-sm-12">
<%=BeanPropertiesUtil.getString(dettPratica, "tcAltriInterventiDesc") %>
<%= BeanPropertiesUtil.getString(dettPratica, "tcAltriInterventiDesc") %>
</div>
</div>
</div>
</liferay-ui:panel>
</div>
<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">
<%
List<Soggetto> committenti = SoggettoLocalServiceUtil.getValidByIntPratica_TipologiaSoggetto(intPraticaId, TipoSoggettoUtil.COMMITTENTE);
List<Soggetto> committenti = SoggettoLocalServiceUtil.getValidByIntPratica_TipologiaSoggetto(
intPraticaId, TipoSoggettoUtil.COMMITTENTE);
%>
<c:if test="<%= !committenti.isEmpty() %>">
<div class="row">
<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>
<%
Soggetto committente = committenti.get(0);
Soggetto committente = committenti.get(0);
%>
<div class="row">
<c:if test="<%= Validator.isNotNull(committente.getDenominazione()) %>">
@ -263,15 +329,18 @@
<strong><%= committente.getCodiceFiscale().toUpperCase() %></strong>
</div>
</c:if>
</div>
</div>
</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() %>">
<div class="row">
<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 class="row">
@ -296,11 +365,14 @@
</div>
</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="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>
<c:if test="<%= !direttori.isEmpty() %>">
@ -329,16 +401,18 @@
</liferay-ui:panel>
</div>
<div class="module-group sezione-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:param name="dettPraticaId" value="<%= String.valueOf(dettPraticaId) %>"></liferay-util:param>
<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:param name="dettPraticaId" value="<%= String.valueOf(dettPraticaId) %>" />
</liferay-util:include>
</liferay-ui:panel>
</div>
</div>
<div class="col-sm-5 col-md-5">
<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="row <%= hide1 %>">
<div class="col-sm-6 col-md-6">
@ -370,7 +444,7 @@
<%= LanguageUtil.get(pageContext, "dp-dc-prov") %>
</div>
<div class="col-sm-6 col-md-6">
<strong><%=BeanPropertiesUtil.getString(provincia, "provincia")%></strong>
<strong><%= BeanPropertiesUtil.getString(provincia, "provincia")%></strong>
</div>
</div>
<div class="row">
@ -378,7 +452,7 @@
<%= LanguageUtil.get(pageContext, "dp-dc-comune") %>
</div>
<div class="col-sm-6 col-md-6">
<strong><%=BeanPropertiesUtil.getString(comune, "denominazione")%></strong>
<strong><%= BeanPropertiesUtil.getString(comune, "denominazione")%></strong>
</div>
</div>
<div class="row">
@ -386,7 +460,7 @@
<%= LanguageUtil.get(pageContext, "dp-dc-loc") %>
</div>
<div class="col-sm-6 col-md-6">
<strong><%=BeanPropertiesUtil.getString(dettPratica, "localita") %></strong>
<strong><%= BeanPropertiesUtil.getString(dettPratica, "localita") %></strong>
</div>
</div>
<div class="row">
@ -394,7 +468,7 @@
<%= LanguageUtil.get(pageContext, "dp-dc-via") %>
</div>
<div class="col-sm-6 col-md-6">
<strong><%=BeanPropertiesUtil.getString(dettPratica, "via") %></strong>
<strong><%= BeanPropertiesUtil.getString(dettPratica, "via") %></strong>
</div>
</div>
<hr>
@ -404,13 +478,12 @@
</div>
<div class="col-sm-6 col-md-3">
<strong><%= BeanPropertiesUtil.getString(dettPratica, "estremiCatastali") %></strong>
</div>
</div>
<div class="col-sm-6 col-md-3">
<%= LanguageUtil.get(pageContext, "dc-allegato") %>
</div>
<div class="col-sm-6 col-md-3">
<strong><%=BeanPropertiesUtil.getString(dettPratica, "dcAllegato") %></strong>
<strong><%= BeanPropertiesUtil.getString(dettPratica, "dcAllegato") %></strong>
</div>
</div>
<div class="row">
@ -418,7 +491,7 @@
<%= LanguageUtil.get(pageContext, "estremi-prat-com") %>
</div>
<div class="col-sm-6 col-md-6">
<strong><%=BeanPropertiesUtil.getString(dettPratica, "estremiPratCom") %></strong>
<strong><%= BeanPropertiesUtil.getString(dettPratica, "estremiPratCom") %></strong>
</div>
</div>
</div>
@ -426,5 +499,4 @@
</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=""/>
</attributes>
</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"/>
</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.jdt.core.javanature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
<nature>org.apache.ivyde.eclipse.ivynature</nature>
</natures>
</projectDescription>

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

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

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.number=18
build.date=1604403556778
build.number=20
build.date=1631718661033
build.auto.upgrade=true
##

18
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 {
/*
* Message
*/
public enum LogProcessMode {
ASYNC, SYNC
}
public enum LogProcessMode {
ASYNC, SYNC
}
public final static String COMPANY_ID = "companyId";
public final static String USER_ID = "userId";
public final static String CONTENT = "payload";
public final static String PARAM_PROCESS_MODE = "processMode";
public static final String COMPANY_ID = "companyId";
public static final String USER_ID = "userId";
public static final String CONTENT = "payload";
public static final String PARAM_PROCESS_MODE = "processMode";
}

11
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 final static String SERIAL = "liferay/tref/portos/monitoring_serial";
public final static 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 SERIAL = "liferay/tref/portos/monitoring_serial";
public static final String SYNC = "liferay/tref/portos/monitoring_sync";
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";
}

51
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 {
/*** Mandatory ***/
public final static String HOSTNAME = "host";
public final static String IP_ADDRESS = "ipAddress";
public final static String DATA_EVENTO = "requestDate";
public final static String COD_PROC = "processCode";
public final static String COD_APP = "serverId";
public final static String ID_ISTANZA = "instanceId";
public final static String PROG_EVENTO = "eventProgressive";
public final static String COD_ATT = "activityCode";
public final static String COD_ESITO_EVENTO = "status";
public final static String TIPO_EVENTO = "eventType";
public static final String HOSTNAME = "host";
public static final String IP_ADDRESS = "ipAddress";
public static final String DATA_EVENTO = "requestDate";
public static final String COD_PROC = "processCode";
public static final String COD_APP = "serverId";
public static final String ID_ISTANZA = "instanceId";
public static final String PROG_EVENTO = "eventProgressive";
public static final String COD_ATT = "activityCode";
public static final String COD_ESITO_EVENTO = "status";
public static final String TIPO_EVENTO = "eventType";
/*** Optional ***/
public final static String ID_OPERATORE = "userId";
/*** Labels ***/
public final static String HOSTNAME_LABEL = "hostname";
public final static String IP_ADDRESS_LABEL = "ipAddress";
public final static String DATA_EVENTO_LABEL = "dataEvento";
public final static String COD_PROC_LABEL = "codProc";
public final static String COD_APP_LABEL = "codApp";
public final static String ID_ISTANZA_LABEL = "idIstanza";
public final static String PROG_EVENTO_LABEL = "progEvento";
public final static String COD_ATT_LABEL = "codAtt";
public final static String COD_ESITO_EVENTO_LABEL = "codEsitoEvento";
public final static String TIPO_EVENTO_LABEL = "tipoEvento";
public final static String ID_OPERATORE_LABEL = "idOperatore";
public final static String COMPLEX_DATA_LABEL = "ComplexData";
public static final String ID_OPERATORE = "userId";
/*** Labels ***/
public static final String HOSTNAME_LABEL = "hostname";
public static final String IP_ADDRESS_LABEL = "ipAddress";
public static final String DATA_EVENTO_LABEL = "dataEvento";
public static final String COD_PROC_LABEL = "codProc";
public static final String COD_APP_LABEL = "codApp";
public static final String ID_ISTANZA_LABEL = "idIstanza";
public static final String PROG_EVENTO_LABEL = "progEvento";
public static final String COD_ATT_LABEL = "codAtt";
public static final String COD_ESITO_EVENTO_LABEL = "codEsitoEvento";
public static final String TIPO_EVENTO_LABEL = "tipoEvento";
public static final String ID_OPERATORE_LABEL = "idOperatore";
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"?>
<classpath>
<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">
<attributes>
<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-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/service"/>
<property name="context-root" value="portos-mail-manager-portlet"/>
<property name="java-output-path" value="/portos-mail-manager-portlet/docroot/WEB-INF/classes"/>
</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 final static String DEFAULT_ATTACHMENTS_FOLDER_NAME = "MailManager_EmailAttachments";
public static final String DEFAULT_ATTACHMENTS_FOLDER_NAME = "MailManager_EmailAttachments";
}

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

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

183
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.
*
* 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. You can obtain a
* 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.
*
*
*
* 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.
* You can obtain a 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;
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.SystemException;
@ -27,27 +30,14 @@ import com.liferay.portal.model.User;
import com.liferay.portal.security.permission.ActionKeys;
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.
*
* <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.noovle.azimut.icf.mailmanager.service.EmailAttachmentLocalService} 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.noovle.azimut.icf.mailmanager.service.EmailAttachmentLocalService} interface.
* <p>
* This is a local service. Methods of this service will not have security checks based on the
* propagated JAAS credentials because this service can only be accessed from within the same VM.
* This is a local service. Methods of this service will not have security checks based on the propagated JAAS
* credentials because this service can only be accessed from within the same VM.
* </p>
*
* @author
@ -55,96 +45,99 @@ import java.util.List;
* @see it.noovle.azimut.icf.mailmanager.service.EmailAttachmentLocalServiceUtil
*/
public class EmailAttachmentLocalServiceImpl extends EmailAttachmentLocalServiceBaseImpl {
/*
* NOTE FOR DEVELOPERS:
*
* Never reference this interface directly. Always use {@link
* it.noovle.azimut.icf.mailmanager.service.EmailAttachmentLocalServiceUtil} to access the
* email attachment local service.
*/
public EmailAttachment addEmailAttachment(long companyId, long emailId, long folderId, String fileName, File file)
throws PortalException, SystemException {
/*
* NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link
* 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)
throws PortalException, SystemException {
Company company = companyLocalService.getCompany(companyId);
Company company = companyLocalService.getCompany(companyId);
User defaultUser = company.getDefaultUser();
User defaultUser = company.getDefaultUser();
validate(emailId, fileName, file);
validate(emailId, fileName, file);
Folder folder = dlAppLocalService.getFolder(folderId);
Folder folder = dlAppLocalService.getFolder(folderId);
String sourceFileName = file.getName();
String mimeType = MimeTypesUtil.getContentType(sourceFileName);
String sourceFileName = file.getName();
String mimeType = MimeTypesUtil.getContentType(sourceFileName);
String title = fileName;
if (Validator.isNull(title)) {
title = file.getName();
}
String title = fileName;
if (Validator.isNull(title)) {
title = file.getName();
}
ServiceContext serviceContext = new ServiceContext();
serviceContext.setGroupPermissions(new String[] {ActionKeys.VIEW});
serviceContext.setGuestPermissions(new String[] {ActionKeys.VIEW});
ServiceContext serviceContext = new ServiceContext();
serviceContext.setGroupPermissions(new String[] { ActionKeys.VIEW });
serviceContext.setGuestPermissions(new String[] { ActionKeys.VIEW });
FileEntry fileEntry =
dlAppLocalService.addFileEntry(defaultUser.getUserId(), folder.getRepositoryId(), folder.getFolderId(),
sourceFileName, mimeType, title, StringPool.BLANK, StringPool.BLANK, file, serviceContext);
FileEntry fileEntry =
dlAppLocalService.addFileEntry(defaultUser.getUserId(), folder.getRepositoryId(), folder.getFolderId(),
sourceFileName, mimeType, title, StringPool.BLANK, StringPool.BLANK, file, serviceContext);
EmailAttachment emailAttachment =
emailAttachmentLocalService.createEmailAttachment(new EmailAttachmentPK(emailId, fileEntry.getFileEntryId()));
EmailAttachment emailAttachment =
createEmailAttachment(new EmailAttachmentPK(emailId, fileEntry
.getFileEntryId()));
return emailAttachmentLocalService.addEmailAttachment(emailAttachment);
}
return addEmailAttachment(emailAttachment);
}
@Override
public EmailAttachment deleteEmailAttachment(EmailAttachmentPK emailAttachmentPK) throws PortalException,
SystemException {
EmailAttachment emailAttachment = emailAttachmentLocalService.getEmailAttachment(emailAttachmentPK);
return deleteEmailAttachment(emailAttachment);
}
@Override
public EmailAttachment deleteEmailAttachment(EmailAttachmentPK emailAttachmentPK) throws PortalException,
SystemException {
EmailAttachment emailAttachment = getEmailAttachment(emailAttachmentPK);
return deleteEmailAttachment(emailAttachment);
}
@Override
public EmailAttachment deleteEmailAttachment(EmailAttachment emailAttachment) throws SystemException {
@Override
public EmailAttachment deleteEmailAttachment(EmailAttachment emailAttachment) throws SystemException {
super.deleteEmailAttachment(emailAttachment);
super.deleteEmailAttachment(emailAttachment);
// File Entry
// File Entry
try {
dlAppLocalService.deleteFileEntry(emailAttachment.getFileEntryId());
} catch (PortalException e) {
}
try {
dlAppLocalService.deleteFileEntry(emailAttachment.getFileEntryId());
} catch (PortalException e) {}
return emailAttachment;
}
return emailAttachment;
}
public List<EmailAttachment> findByEmailId(long emailId) throws SystemException {
return emailAttachmentPersistence.findByEmailId(emailId);
}
@Override
public List<EmailAttachment> findByEmailId(long emailId) throws SystemException {
return emailAttachmentPersistence.findByEmailId(emailId);
}
public List<EmailAttachment> findByEmailId(long emailId, int start, int end) throws SystemException {
return emailAttachmentPersistence.findByEmailId(emailId);
}
@Override
public List<EmailAttachment> findByEmailId(long emailId, int start, int end) throws SystemException {
return emailAttachmentPersistence.findByEmailId(emailId);
}
public int countByEmailId(long emailId) throws SystemException {
return emailAttachmentPersistence.countByEmailId(emailId);
}
@Override
public int countByEmailId(long emailId) throws SystemException {
return emailAttachmentPersistence.countByEmailId(emailId);
}
public EmailAttachment fetchByFileEntryId(long fileEntryId) throws SystemException {
return emailAttachmentPersistence.fetchByFileEntryId(fileEntryId);
}
@Override
public EmailAttachment fetchByFileEntryId(long fileEntryId) throws SystemException {
return emailAttachmentPersistence.fetchByFileEntryId(fileEntryId);
}
private void validate(long emailId, String fileName, File file) throws PortalException, SystemException {
private void validate(long emailId, String fileName, File file) throws PortalException, SystemException {
if (Validator.isNull(emailId)) {
throw new NoSuchEmailException();
}
if (Validator.isNull(emailId)) {
throw new NoSuchEmailException();
}
if (Validator.isNull(fileName) && Validator.isNull(file)) {
throw new EmailAttachmentTitleException();
}
if (Validator.isNull(fileName) && Validator.isNull(file)) {
throw new EmailAttachmentTitleException();
}
if (Validator.isNull(file) || (Validator.isNotNull(file) && !FileUtil.exists(file))) {
throw new EmailAttachmentFileException();
}
}
if (Validator.isNull(file) || (Validator.isNotNull(file) && !FileUtil.exists(file))) {
throw new EmailAttachmentFileException();
}
}
}

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

399
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.
*
* 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.
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it
* and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 2.1 of the License, or (at your option) any later version. This library is 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;
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.EmailTemplateCcnException;
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.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.
*
* <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.noovle.azimut.icf.mailmanager.service.EmailTemplateLocalService} 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.noovle.azimut.icf.mailmanager.service.EmailTemplateLocalService} interface.
* <p>
* This is a local service. Methods of this service will not have security checks based on the
* propagated JAAS credentials because this service can only be accessed from within the same VM.
* This is a local service. Methods of this service will not have security checks based on the propagated JAAS
* credentials because this service can only be accessed from within the same VM.
* </p>
*
* @author
@ -55,191 +48,171 @@ import java.util.List;
* @see it.noovle.azimut.icf.mailmanager.service.EmailTemplateLocalServiceUtil
*/
public class EmailTemplateLocalServiceImpl extends EmailTemplateLocalServiceBaseImpl {
/*
* NOTE FOR DEVELOPERS:
*
* Never reference this interface directly. Always use {@link
* it.noovle.azimut.icf.mailmanager.service.EmailTemplateLocalServiceUtil} to access the email
* template local service.
*/
@Override
public EmailTemplate addEmailTemplate(String templateName, String from, String[] to, String[] cc, String[] ccn,
String subject, String body, boolean attachmentPermitted, ServiceContext serviceContext) throws SystemException,
PortalException {
User user = userLocalService.getUser(serviceContext.getUserId());
Date now = new Date();
validate(templateName, from, to, cc, ccn, subject, body);
EmailTemplate emailTemplate =
emailTemplateLocalService.createEmailTemplate(counterLocalService.increment(EmailTemplate.class.getName()));
emailTemplate.setCompanyId(serviceContext.getCompanyId());
emailTemplate.setUserId(user.getUserId());
emailTemplate.setUserName(user.getFullName());
emailTemplate.setCreateDate(serviceContext.getCreateDate(now));
emailTemplate.setModifiedDate(serviceContext.getModifiedDate(now));
emailTemplate.setGroupId(serviceContext.getScopeGroupId());
emailTemplate.setTemplateName(templateName);
emailTemplate.setFrom(from);
emailTemplate.setTo(StringUtil.merge(to, StringPool.COMMA));
emailTemplate.setCc(StringUtil.merge(cc, StringPool.COMMA));
emailTemplate.setCcn(StringUtil.merge(ccn, StringPool.COMMA));
emailTemplate.setSubject(subject);
emailTemplate.setBody(body);
emailTemplate.setAttachmentPermitted(attachmentPermitted);
emailTemplate = emailTemplateLocalService.addEmailTemplate(emailTemplate);
// Resource
resourceLocalService.addResources(emailTemplate.getCompanyId(), emailTemplate.getGroupId(),
emailTemplate.getUserId(), EmailTemplate.class.getName(), emailTemplate.getPrimaryKey(), false, true, true);
return emailTemplate;
}
@Override
public EmailTemplate updateEmailTemplate(long emailTemplateId, String templateName, String from, String[] to,
String[] cc, String[] ccn, String subject, String body, boolean attachmentPermitted, ServiceContext serviceContext)
throws SystemException, PortalException {
EmailTemplate emailTemplate = emailTemplateLocalService.getEmailTemplate(emailTemplateId);
validate(templateName, from, to, cc, ccn, subject, body);
emailTemplate.setModifiedDate(serviceContext.getModifiedDate(new Date()));
emailTemplate.setFrom(from);
emailTemplate.setTo(StringUtil.merge(to, StringPool.COMMA));
emailTemplate.setCc(StringUtil.merge(cc, StringPool.COMMA));
emailTemplate.setCcn(StringUtil.merge(ccn, StringPool.COMMA));
emailTemplate.setSubject(subject);
emailTemplate.setBody(body);
emailTemplate.setAttachmentPermitted(attachmentPermitted);
emailTemplate = emailTemplateLocalService.updateEmailTemplate(emailTemplate);
return emailTemplate;
}
@Override
public EmailTemplate deleteEmailTemplate(long emailTemplateId) throws PortalException, SystemException {
EmailTemplate emailTemplate = emailTemplateLocalService.getEmailTemplate(emailTemplateId);
return deleteEmailTemplate(emailTemplate);
}
@Override
public EmailTemplate deleteEmailTemplate(EmailTemplate emailTemplate) throws SystemException {
super.deleteEmailTemplate(emailTemplate);
// Resource
try {
resourceLocalService.deleteResource(emailTemplate.getCompanyId(), EmailTemplate.class.getName(),
ResourceConstants.SCOPE_INDIVIDUAL, emailTemplate.getPrimaryKey());
} catch (PortalException e) {
}
return emailTemplate;
}
@Override
public int countByC_GroupId(long companyId, long groupId) throws SystemException {
return emailTemplatePersistence.countByC_GroupId(companyId, groupId);
}
@Override
public List<EmailTemplate> findByC_GroupId(long companyId, long groupId, int start, int end, OrderByComparator orderBy)
throws SystemException {
return emailTemplatePersistence.findByC_GroupId(companyId, groupId, start, end, orderBy);
}
@Override
public EmailTemplate findByC_GroupId_Name(long companyId, long groupId, String templateName)
throws NoSuchEmailTemplateException, SystemException {
return emailTemplatePersistence.findByC_GroupId_Name(companyId, groupId, templateName);
}
@Override
public EmailTemplate fetchByC_GroupId_Name(long companyId, long groupId, String templateName) throws SystemException {
return emailTemplatePersistence.fetchByC_GroupId_Name(companyId, groupId, templateName);
}
@Override
public int countByCompany(long companyId) throws SystemException {
return emailTemplatePersistence.countByCompany(companyId);
}
@Override
public List<EmailTemplate> findByCompany(long companyId, int start, int end, OrderByComparator orderBy)
throws SystemException {
return emailTemplatePersistence.findByCompany(companyId, start, end, orderBy);
}
@Override
public int countByC_Name(long companyId, String name) throws SystemException {
return emailTemplatePersistence.countByC_Name(companyId, name);
}
@Override
public EmailTemplate findByC_Name(long companyId, String templateName) throws SystemException,
NoSuchEmailTemplateException {
return emailTemplatePersistence.findByC_Name(companyId, templateName);
}
private void validate(String templateName, String from, String[] to, String[] cc, String[] ccn, String subject,
String body) throws PortalException {
if (Validator.isNull(templateName)) {
throw new RequiredEmailTemplateNameException();
}
if (Validator.isNull(from)) {
throw new RequiredEmailTemplateFromException();
} else if (!Validator.isEmailAddress(from)) {
throw new EmailTemplateFromException();
}
if (to != null && to.length > 0) {
for (String emailAddress : to) {
if (!Validator.isEmailAddress(emailAddress)) {
throw new EmailTemplateToException();
}
}
}
if (cc != null && cc.length > 0) {
for (String emailAddress : cc) {
if (!Validator.isEmailAddress(emailAddress)) {
throw new EmailTemplateCcException();
}
}
}
if (ccn != null && ccn.length > 0) {
for (String emailAddress : ccn) {
if (!Validator.isEmailAddress(emailAddress)) {
throw new EmailTemplateCcnException();
}
}
}
if (Validator.isNull(subject)) {
throw new RequiredEmailTemplateSubjectException();
}
if (Validator.isNull(body)) {
throw new RequiredEmailTemplateBodyException();
}
}
/*
* NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link
* it.noovle.azimut.icf.mailmanager.service.EmailTemplateLocalServiceUtil} to access the email template local
* service.
*/
@Override
public EmailTemplate addEmailTemplate(String templateName, String from, String[] to, String[] cc, String[] ccn,
String subject, String body, boolean attachmentPermitted, ServiceContext serviceContext)
throws SystemException, PortalException {
User user = userLocalService.getUser(serviceContext.getUserId());
Date now = new Date();
validate(templateName, from, to, cc, ccn, subject, body);
EmailTemplate emailTemplate = createEmailTemplate(counterLocalService.increment(EmailTemplate.class.getName()));
emailTemplate.setCompanyId(serviceContext.getCompanyId());
emailTemplate.setUserId(user.getUserId());
emailTemplate.setUserName(user.getFullName());
emailTemplate.setCreateDate(serviceContext.getCreateDate(now));
emailTemplate.setModifiedDate(serviceContext.getModifiedDate(now));
emailTemplate.setGroupId(serviceContext.getScopeGroupId());
emailTemplate.setTemplateName(templateName);
emailTemplate.setFrom(from);
emailTemplate.setTo(StringUtil.merge(to, StringPool.COMMA));
emailTemplate.setCc(StringUtil.merge(cc, StringPool.COMMA));
emailTemplate.setCcn(StringUtil.merge(ccn, StringPool.COMMA));
emailTemplate.setSubject(subject);
emailTemplate.setBody(body);
emailTemplate.setAttachmentPermitted(attachmentPermitted);
emailTemplate = addEmailTemplate(emailTemplate);
// Resource
resourceLocalService.addResources(emailTemplate.getCompanyId(), emailTemplate.getGroupId(),
emailTemplate.getUserId(), EmailTemplate.class.getName(), emailTemplate.getPrimaryKey(), false, true,
true);
return emailTemplate;
}
@Override
public EmailTemplate updateEmailTemplate(long emailTemplateId, String templateName, String from, String[] to,
String[] cc, String[] ccn, String subject, String body, boolean attachmentPermitted,
ServiceContext serviceContext) throws SystemException, PortalException {
EmailTemplate emailTemplate = getEmailTemplate(emailTemplateId);
validate(templateName, from, to, cc, ccn, subject, body);
emailTemplate.setModifiedDate(serviceContext.getModifiedDate(new Date()));
emailTemplate.setFrom(from);
emailTemplate.setTo(StringUtil.merge(to, StringPool.COMMA));
emailTemplate.setCc(StringUtil.merge(cc, StringPool.COMMA));
emailTemplate.setCcn(StringUtil.merge(ccn, StringPool.COMMA));
emailTemplate.setSubject(subject);
emailTemplate.setBody(body);
emailTemplate.setAttachmentPermitted(attachmentPermitted);
emailTemplate = updateEmailTemplate(emailTemplate);
return emailTemplate;
}
@Override
public EmailTemplate deleteEmailTemplate(long emailTemplateId) throws PortalException, SystemException {
EmailTemplate emailTemplate = getEmailTemplate(emailTemplateId);
return deleteEmailTemplate(emailTemplate);
}
@Override
public EmailTemplate deleteEmailTemplate(EmailTemplate emailTemplate) throws SystemException {
super.deleteEmailTemplate(emailTemplate);
// Resource
try {
resourceLocalService.deleteResource(emailTemplate.getCompanyId(), EmailTemplate.class.getName(),
ResourceConstants.SCOPE_INDIVIDUAL, emailTemplate.getPrimaryKey());
} catch (PortalException e) {}
return emailTemplate;
}
@Override
public int countByC_GroupId(long companyId, long groupId) throws SystemException {
return emailTemplatePersistence.countByC_GroupId(companyId, groupId);
}
@Override
public List<EmailTemplate> findByC_GroupId(long companyId, long groupId, int start, int end,
OrderByComparator orderBy) throws SystemException {
return emailTemplatePersistence.findByC_GroupId(companyId, groupId, start, end, orderBy);
}
@Override
public EmailTemplate findByC_GroupId_Name(long companyId, long groupId, String templateName)
throws NoSuchEmailTemplateException, SystemException {
return emailTemplatePersistence.findByC_GroupId_Name(companyId, groupId, templateName);
}
@Override
public EmailTemplate fetchByC_GroupId_Name(long companyId, long groupId, String templateName)
throws SystemException {
return emailTemplatePersistence.fetchByC_GroupId_Name(companyId, groupId, templateName);
}
@Override
public int countByCompany(long companyId) throws SystemException {
return emailTemplatePersistence.countByCompany(companyId);
}
@Override
public List<EmailTemplate> findByCompany(long companyId, int start, int end, OrderByComparator orderBy)
throws SystemException {
return emailTemplatePersistence.findByCompany(companyId, start, end, orderBy);
}
@Override
public int countByC_Name(long companyId, String name) throws SystemException {
return emailTemplatePersistence.countByC_Name(companyId, name);
}
@Override
public EmailTemplate findByC_Name(long companyId, String templateName) throws SystemException,
NoSuchEmailTemplateException {
return emailTemplatePersistence.findByC_Name(companyId, templateName);
}
private void validate(String templateName, String from, String[] to, String[] cc, String[] ccn, String subject,
String body) throws PortalException {
if (Validator.isNull(templateName)) {
throw new RequiredEmailTemplateNameException();
}
if (Validator.isNull(from)) {
throw new RequiredEmailTemplateFromException();
} else if (!Validator.isEmailAddress(from)) {
throw new EmailTemplateFromException();
}
if (to != null && to.length > 0) {
for (String emailAddress : to) {
if (!Validator.isEmailAddress(emailAddress)) {
throw new EmailTemplateToException();
}
}
}
if (cc != null && cc.length > 0) {
for (String emailAddress : cc) {
if (!Validator.isEmailAddress(emailAddress)) {
throw new EmailTemplateCcException();
}
}
}
if (ccn != null && ccn.length > 0) {
for (String emailAddress : ccn) {
if (!Validator.isEmailAddress(emailAddress)) {
throw new EmailTemplateCcnException();
}
}
}
if (Validator.isNull(subject)) {
throw new RequiredEmailTemplateSubjectException();
}
if (Validator.isNull(body)) {
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);
}
}

175
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;
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.language.LanguageUtil;
import com.liferay.portal.kernel.log.Log;
@ -17,105 +26,73 @@ import com.liferay.portal.service.ServiceContextFactory;
import com.liferay.portal.util.PortalUtil;
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 {
private final static Log _log = LogFactoryUtil.getLog(AdminMaintenancePortlet.class);
public void maintain(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
PortletSession portletSession = actionRequest.getPortletSession();
String message = ParamUtil.getString(actionRequest, "message");
String className =
LanguageUtil
.get(LocaleUtil.getDefault(),
"the-sign-in-process-is-temporarily-disabled-because-the-portal-is-undergoing-a-routine-maintenance-upgrade");
if (Validator.isNotNull(message)) {
className = message;
}
Class<?> clazz =
ClassResolverUtil.resolve("com.liferay.portal.util.MaintenanceUtil", PortalClassLoaderUtil.getClassLoader());
ReflectionUtil.getDeclaredMethod(clazz, "maintain", String.class, String.class).invoke(null,
portletSession.getId(), className);
_log.info("Maintenance session id: " + portletSession.getId());
}
public void deleteMaintenanceSchedule(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
_log.info("deleteMaintenanceSchedule - Inizio metodo");
ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest);
long maintenanceScheduleId = ParamUtil.getLong(actionRequest, "maintenanceScheduleId");
MaintenanceScheduleServiceUtil.deleteMaintenanceSchedule(maintenanceScheduleId, serviceContext);
}
public void editMaintenanceSchedule(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
_log.info("editMaintenanceSchedule - Inizio metodo");
String cmd = ParamUtil.getString(actionRequest, Constants.CMD);
ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest);
long maintenanceScheduleId = ParamUtil.getLong(actionRequest, "maintenanceScheduleId");
String type = ParamUtil.getString(actionRequest, "type");
String reason = ParamUtil.getString(actionRequest, "reason");
String portalMessage = ParamUtil.getString(actionRequest, "portalMessage");
long after = ParamUtil.getLong(actionRequest, "after");
String onreboot = ParamUtil.getString(actionRequest, "onreboot");
String status = ParamUtil.getString(actionRequest, "status");
String statusMessage = ParamUtil.getString(actionRequest, "statusMessage");
Calendar calendarEnd = Calendar.getInstance();
calendarEnd.set(ParamUtil.getInteger(actionRequest, "endYear"),
ParamUtil.getInteger(actionRequest, "endMonth") + 1, ParamUtil.getInteger(actionRequest, "endDay"),
ParamUtil.getInteger(actionRequest, "endHour"), ParamUtil.getInteger(actionRequest, "endMinute"));
MaintenanceSchedule maintenanceSchedule = null;
try {
if (cmd.equals(Constants.ADD)) {
maintenanceSchedule =
MaintenanceScheduleServiceUtil.addMaintenanceSchedule(type, reason, portalMessage, after,
calendarEnd.getTime(), onreboot, serviceContext);
} else if (cmd.equals(Constants.UPDATE)) {
maintenanceSchedule =
MaintenanceScheduleServiceUtil.updateMaintenanceSchedule(maintenanceScheduleId, type, reason,
portalMessage, after, calendarEnd.getTime(), onreboot, status, statusMessage, serviceContext);
}
} catch (PortalException e) {
_log.error(e);
SessionErrors.add(actionRequest, e.getClass());
}
if (SessionErrors.isEmpty(actionRequest)) {
actionResponse.setRenderParameter("maintenanceScheduleId",
String.valueOf(maintenanceSchedule.getMaintenanceScheduleId()));
actionResponse.setRenderParameter("mvcPath", "/html/admin_maintenance/edit.jsp");
} else {
actionResponse.setRenderParameter("mvcPath", "/html/admin_maintenance/edit.jsp");
PortalUtil.copyRequestParameters(actionRequest, actionResponse);
}
}
private static final Log _log = LogFactoryUtil.getLog(AdminMaintenancePortlet.class);
public void maintain(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
PortletSession portletSession = actionRequest.getPortletSession();
String message = ParamUtil.getString(actionRequest, "message");
String className = LanguageUtil
.get(LocaleUtil.getDefault(),
"the-sign-in-process-is-temporarily-disabled-because-the-portal-is-undergoing-a-routine-maintenance-upgrade");
if (Validator.isNotNull(message)) {
className = message;
}
Class<?> clazz = ClassResolverUtil.resolve("com.liferay.portal.util.MaintenanceUtil",
PortalClassLoaderUtil.getClassLoader());
ReflectionUtil.getDeclaredMethod(clazz, "maintain", String.class, String.class).invoke(null,
portletSession.getId(), className);
_log.info("Maintenance session id: " + portletSession.getId());
}
public void deleteMaintenanceSchedule(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
_log.info("deleteMaintenanceSchedule - Inizio metodo");
ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest);
long maintenanceScheduleId = ParamUtil.getLong(actionRequest, "maintenanceScheduleId");
MaintenanceScheduleServiceUtil.deleteMaintenanceSchedule(maintenanceScheduleId, serviceContext);
}
public void editMaintenanceSchedule(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
_log.info("editMaintenanceSchedule - Inizio metodo");
String cmd = ParamUtil.getString(actionRequest, Constants.CMD);
ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest);
long maintenanceScheduleId = ParamUtil.getLong(actionRequest, "maintenanceScheduleId");
String type = ParamUtil.getString(actionRequest, "type");
String reason = ParamUtil.getString(actionRequest, "reason");
String portalMessage = ParamUtil.getString(actionRequest, "portalMessage");
long after = ParamUtil.getLong(actionRequest, "after");
String onreboot = ParamUtil.getString(actionRequest, "onreboot");
String status = ParamUtil.getString(actionRequest, "status");
String statusMessage = ParamUtil.getString(actionRequest, "statusMessage");
Calendar calendarEnd = Calendar.getInstance();
calendarEnd.set(ParamUtil.getInteger(actionRequest, "endYear"),
ParamUtil.getInteger(actionRequest, "endMonth") + 1, ParamUtil.getInteger(actionRequest, "endDay"),
ParamUtil.getInteger(actionRequest, "endHour"), ParamUtil.getInteger(actionRequest, "endMinute"));
MaintenanceSchedule maintenanceSchedule = null;
try {
if (cmd.equals(Constants.ADD)) {
maintenanceSchedule = MaintenanceScheduleServiceUtil.addMaintenanceSchedule(type, reason,
portalMessage, after, calendarEnd.getTime(), onreboot, serviceContext);
} else if (cmd.equals(Constants.UPDATE)) {
maintenanceSchedule = MaintenanceScheduleServiceUtil.updateMaintenanceSchedule(maintenanceScheduleId,
type, reason, portalMessage, after, calendarEnd.getTime(), onreboot, status, statusMessage,
serviceContext);
}
} catch (PortalException e) {
_log.error(e);
SessionErrors.add(actionRequest, e.getClass());
}
if (SessionErrors.isEmpty(actionRequest)) {
actionResponse.setRenderParameter("maintenanceScheduleId",
String.valueOf(maintenanceSchedule.getMaintenanceScheduleId()));
actionResponse.setRenderParameter("mvcPath", "/html/admin_maintenance/edit.jsp");
} else {
actionResponse.setRenderParameter("mvcPath", "/html/admin_maintenance/edit.jsp");
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.number=42
build.date=1569596970763
build.number=43
build.date=1631870287519
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 {
private final static Log _log = LogFactoryUtil.getLog(StartUpAction.class);
private static final Log _log = LogFactoryUtil.getLog(StartUpAction.class);
@Override
public void run(String[] companyIds) throws ActionException {

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

@ -16,76 +16,55 @@ import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;
import com.liferay.util.dao.orm.CustomSQLUtil;
public class KaleoTaskAssignmentInstanceFinderImpl extends BasePersistenceImpl<KaleoTaskAssignmentInstance> implements
KaleoTaskAssignmentInstanceFinder {
private final static Log _log = LogFactoryUtil.getLog(KaleoTaskAssignmentInstanceFinderImpl.class);
private final String DISTINCT_ASSIGNEE_USER = "Report.distinctKaleoAssigneeUser";
private final String DISTINCT_ASSIGNEE_ID = "Report.distinctKaleoAssigneeId";
public List<BigInteger> distinctKaleoAssignee() throws SystemException {
Session session = null;
try {
session = openSession();
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);
query.setCacheable(false);
QueryPos qPos = QueryPos.getInstance(query);
List<BigInteger> list = query.list();
return list;
} catch (ORMException e) {
_log.error("Errore", e);
throw new SystemException(e);
} finally {
if (session != null) {
closeSession(session);
}
}
}
public List<BigInteger> distinctKaleoAssigneeId(long userId) throws SystemException {
Session session = null;
try {
session = openSession();
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);
query.setCacheable(false);
QueryPos qPos = QueryPos.getInstance(query);
qPos.add(userId);
List<BigInteger> list = query.list();
return list;
} catch (ORMException e) {
_log.error("Errore", e);
throw new SystemException(e);
} finally {
if (session != null) {
closeSession(session);
}
}
}
KaleoTaskAssignmentInstanceFinder {
private static final Log _log = LogFactoryUtil.getLog(KaleoTaskAssignmentInstanceFinderImpl.class);
private static final String DISTINCT_ASSIGNEE_USER = "Report.distinctKaleoAssigneeUser";
private static final String DISTINCT_ASSIGNEE_ID = "Report.distinctKaleoAssigneeId";
@Override
public List<BigInteger> distinctKaleoAssignee() throws SystemException {
Session session = null;
try {
session = openSession();
String sql = CustomSQLUtil.get(DISTINCT_ASSIGNEE_USER);
SQLQuery query = session.createSQLQuery(sql);
query.setCacheable(false);
QueryPos qPos = QueryPos.getInstance(query);
List<BigInteger> list = query.list();
return list;
} catch (ORMException e) {
_log.error("Errore", e);
throw new SystemException(e);
} finally {
if (session != null) {
closeSession(session);
}
}
}
@Override
public List<BigInteger> distinctKaleoAssigneeId(long userId) throws SystemException {
Session session = null;
try {
session = openSession();
String sql = CustomSQLUtil.get(DISTINCT_ASSIGNEE_ID);
SQLQuery query = session.createSQLQuery(sql);
query.setCacheable(false);
QueryPos qPos = QueryPos.getInstance(query);
qPos.add(userId);
List<BigInteger> list = query.list();
return list;
} catch (ORMException e) {
_log.error("Errore", e);
throw new SystemException(e);
} finally {
if (session != null) {
closeSession(session);
}
}
}
}

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

@ -64,16 +64,17 @@ public class ProtocolloMessageListener extends BaseMessageListener {
long userId = message.getLong(ReportConstants.USER_ID);
@SuppressWarnings("unchecked")
Map<String, Serializable> taskContextMap = (Map<String, Serializable>) message.get(ReportConstants.PARAMATERS);
User user = UserLocalServiceUtil.getRoleUsers(
RoleLocalServiceUtil.getRole(companyId, RoleConstants.ADMINISTRATOR).getRoleId()).get(0);
User user =
UserLocalServiceUtil.getRoleUsers(
RoleLocalServiceUtil.getRole(companyId, RoleConstants.ADMINISTRATOR).getRoleId()).get(0);
try {
PermissionThreadLocal.setPermissionChecker(PermissionCheckerFactoryUtil.create(user));
} catch (Exception e) {
throw new SystemException(e);
}
try {
JSONArray jsonArray = JSONFactoryUtil.createJSONArray(MapUtil.getString(taskContextMap,
ReportConstants.PARAM_REPORTS));
JSONArray jsonArray =
JSONFactoryUtil.createJSONArray(MapUtil.getString(taskContextMap, ReportConstants.PARAM_REPORTS));
JSONObject jsonObject = jsonArray.getJSONObject(0);
ReportDto reportDto = JSONFactoryUtil.looseDeserialize(jsonObject.toString(), ReportDto.class);
String protocolloToAttach = StringPool.BLANK;
@ -130,22 +131,32 @@ public class ProtocolloMessageListener extends BaseMessageListener {
ServiceContext serviceContext = new ServiceContext();
serviceContext.setUserId(userId);
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 {
newFileEntry = DLAppLocalServiceUtil.addFileEntry(userId, fileEntry.getRepositoryId(),
fileEntry.getFolderId(), reportDto.getFileName() + ".pdf", ContentTypes.APPLICATION_PDF,
reportDto.getFileName(), StringPool.BLANK, StringPool.BLANK, outputBytes, serviceContext);
newFileEntry =
DLAppLocalServiceUtil.addFileEntry(userId, repositoryId, folderId, sourceFileName,
mimeType, title, description, changeLog, outputBytes, serviceContext);
} catch (DuplicateFileException e) {
FileEntry fe = DLAppServiceUtil.getFileEntry(fileEntry.getGroupId(), fileEntry.getFolderId(),
reportDto.getFileName());
_log.info("File duplicato : " + fe.getFileEntryId());
return;
FileEntry fe =
DLAppServiceUtil.getFileEntry(fileEntry.getGroupId(), fileEntry.getFolderId(),
reportDto.getFileName());
DLAppLocalServiceUtil.deleteFileEntry(fe.getFileEntryId());
newFileEntry =
DLAppLocalServiceUtil.addFileEntry(userId, repositoryId, folderId, sourceFileName,
mimeType, title, description, changeLog, outputBytes, serviceContext);
}
if (Validator.isNotNull(newFileEntry)) {
long[] fileEntryIds = new long[0];
fileEntryIds = ArrayUtil.append(fileEntryIds, newFileEntry.getFileEntryId());
ReportResultDto dto = new ReportResultDto(0L, fileEntryIds, ReportResult.SUCCESSFUL.toString(),
null);
ReportResultDto dto =
new ReportResultDto(0L, fileEntryIds, ReportResult.SUCCESSFUL.toString(), null);
Message responseMessage = MessageBusUtil.createResponseMessage(message);
responseMessage.setPayload(JSONFactoryUtil.looseSerializeDeep(dto));
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;
public class ReportMessageListener extends BaseMessageListener {
private final static Log _log = LogFactoryUtil.getLog(ReportTaskMessageListener.class);
private static final Log _log = LogFactoryUtil.getLog(ReportTaskMessageListener.class);
@Override
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 {
private final static Log _log = LogFactoryUtil.getLog(TestPdf.class);
private static final Log _log = LogFactoryUtil.getLog(TestPdf.class);
@Override
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());
Date now = new Date();
ReportTask reportTask = reportTaskLocalService.createReportTask(counterLocalService.increment(ReportTask.class
.getName()));
ReportTask reportTask = createReportTask(counterLocalService.increment(ReportTask.class.getName()));
reportTask.setCompanyId(serviceContext.getCompanyId());
reportTask.setUserId(user.getUserId());
reportTask.setUserName(user.getFullName());
@ -57,16 +56,16 @@ public class ReportTaskLocalServiceImpl extends ReportTaskLocalServiceBaseImpl {
String taskContext = JSONFactoryUtil.looseSerializeDeep(taskContextMap);
reportTask.setTaskContext(taskContext);
}
return reportTaskLocalService.addReportTask(reportTask);
return addReportTask(reportTask);
}
@Override
public ReportTask markAsCompleted(long reportTaskId, Date completionDate) throws PortalException, SystemException {
ReportTask reportTask = reportTaskLocalService.getReportTask(reportTaskId);
ReportTask reportTask = getReportTask(reportTaskId);
reportTask.setModifiedDate(new Date());
reportTask.setCompleted(true);
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 {
private final static Log _log = LogFactoryUtil.getLog(ReportTaskManagerServiceImpl.class);
private static final Log _log = LogFactoryUtil.getLog(ReportTaskManagerServiceImpl.class);
@Override
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.number=33
build.date=1630406182776
build.number=34
build.date=1631888828391
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;
}
private final static String[] MODEL_METHOD_NAMES = { "onAfterCreate", "onAfterRemove", "onAfterUpdate",
private static final String[] MODEL_METHOD_NAMES = { "onAfterCreate", "onAfterRemove", "onAfterUpdate",
"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,
ModelListener<BaseModel<?>> modelListener) {
_servletContextNameMap.put(modelClassName, servletContextName);
if (!_modelListenersMap.containsKey(modelClassName)) {
_modelListenersMap.put(modelClassName, new ArrayList<ModelListener<BaseModel<?>>>());
SERVLET_CONTEXT_NAME_MAP.put(modelClassName, servletContextName);
if (!MODEL_LISTENERS_MAP.containsKey(modelClassName)) {
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) {
_servletContextNameMap.remove(modelClassName);
_modelListenersMap.remove(modelClassName);
SERVLET_CONTEXT_NAME_MAP.remove(modelClassName);
MODEL_LISTENERS_MAP.remove(modelClassName);
}
protected static Set<String> getModelClassNames() {
return _modelListenersMap.keySet();
return MODEL_LISTENERS_MAP.keySet();
}
protected static List<ModelListener<BaseModel<?>>> getModelListeners(String modelClassName) {
return _modelListenersMap.get(modelClassName);
return MODEL_LISTENERS_MAP.get(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 final static Map<String, String> _servletContextNameMap = new ConcurrentHashMap<String, String>();
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>();
}

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);
}
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_ONERI_BOLLI = "03";
public final static String MEZZO_ZERO = "00";
public final static String MEZZO_MANUALE = "01";
public final static 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 final static String UTILIZZATA_IN_CORSO = "03";
public final static String UTILIZZATA_PAGATA = "04";
public final static String UTILIZZATA_RIFIUTATA = "05";
public final static String UTILIZZATA_NON_PAGABILE = "06";
public final static String UTILIZZATA_SOSTITUITA = "07";
public final static String UTILIZZATA_ANNULLATO = "08";
public static final String MEZZO_ZERO = "00";
public static final String MEZZO_MANUALE = "01";
public static final String UTILIZZATA_NO = "01"; // Da Portos 1 - serve solo per import
public static final String UTILIZZATA_SI = "02"; // Da Portos 1 - serve solo per import
public static final String UTILIZZATA_IN_CORSO = "03";
public static final String UTILIZZATA_PAGATA = "04";
public static final String UTILIZZATA_RIFIUTATA = "05";
public static final String UTILIZZATA_NON_PAGABILE = "06";
public static final String UTILIZZATA_SOSTITUITA = "07";
public static final String UTILIZZATA_ANNULLATO = "08";
@SuppressWarnings("serial")
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 TEMPISTICHE = "10_WAR_portosboportlet";
public static final String PAGAMENTI_PENDING = "12_WAR_portosboportlet";
public final static String FASCICOLOFE = "1_WAR_portosfeportlet";
public final static String SOGGETTI = "3_WAR_portosfeportlet";
public final static String ALLEGATI = "4_WAR_portosfeportlet";
public final static String COMUNICAZIONI = "1_WAR_portoscomunicazioniportlet";
public final static String MAPIT = "5_WAR_trefmapitmapportlet";
public static final String FASCICOLOFE = "1_WAR_portosfeportlet";
public static final String SOGGETTI = "3_WAR_portosfeportlet";
public static final String ALLEGATI = "4_WAR_portosfeportlet";
public static final String COMUNICAZIONI = "1_WAR_portoscomunicazioniportlet";
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 final static String SEZIONE_DETTAGLI_PRINCIPALI = "01";
public final static String SEZIONE_ANAGRAFE_SOGGETTI = "02";
public final static String SEZIONE_DESCRIZIONE_EDIFICIO = "03";
public final static String SEZIONE_GEOLOGICA = "04";
public final static String SEZIONE_ALLEGATI = "05";
public static final String SEZIONE_DETTAGLI_PRINCIPALI = "01";
public static final String SEZIONE_ANAGRAFE_SOGGETTI = "02";
public static final String SEZIONE_DESCRIZIONE_EDIFICIO = "03";
public static final String SEZIONE_GEOLOGICA = "04";
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";
@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(CAMBIO_ISTRUTTORE, "label.admingeniocivile.statopratica.cambiIstruttore");
@ -73,7 +73,7 @@ public class StatoPraticaConstants {
};
@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(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 {
esitoDeposito = new HashMap<>();
esitoDeposito.putAll(esitoAutorizzazione);
esitoAutorizzazione.put(CONFORME, getLabel(AUTORIZZATA));
esitoAutorizzazione.put(NON_CONFORME, getLabel(NON_AUTORIZZATA));
esitoDeposito.put(CONFORME, getLabel(CONFORME));
esitoDeposito.put(NON_CONFORME, getLabel(NON_CONFORME));
ESITO_DEPOSITO = new HashMap<>();
ESITO_DEPOSITO.putAll(ESITO_AUTORIZZAZIONE);
ESITO_AUTORIZZAZIONE.put(CONFORME, getLabel(AUTORIZZATA));
ESITO_AUTORIZZAZIONE.put(NON_CONFORME, getLabel(NON_AUTORIZZATA));
ESITO_DEPOSITO.put(CONFORME, getLabel(CONFORME));
ESITO_DEPOSITO.put(NON_CONFORME, getLabel(NON_CONFORME));
}
public static String getStatusLabel(String statoPratica) {
return statusLabel.get(statoPratica);
return STATUS_LABEL.get(statoPratica);
}
public static String getEsitoAutorizzazione(String esito) {
if (esitoAutorizzazione.containsKey(esito)) {
return esitoAutorizzazione.get(esito);
if (ESITO_AUTORIZZAZIONE.containsKey(esito)) {
return ESITO_AUTORIZZAZIONE.get(esito);
}
return StringPool.BLANK;
}
public static String getEsitoDeposito(String esito) {
if (esitoDeposito.containsKey(esito)) {
return esitoDeposito.get(esito);
if (ESITO_DEPOSITO.containsKey(esito)) {
return ESITO_DEPOSITO.get(esito);
}
return StringPool.BLANK;
}

4
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 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 {
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,
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
}
public final static String COMPANY_ID = "companyId";
public final static String USER_ID = "userId";
public final static String PARAMATERS = "paramaters";
public static final String COMPANY_ID = "companyId";
public static final String USER_ID = "userId";
public static final String PARAMATERS = "paramaters";
public final static String PARAM_REPORTS = "reports";
public final static String PARAM_PROCESS_MODE = "processMode";
public final static String PARAM_RESPONSE_DESTINATION_NAME = "responseDestinationName";
public static final String PARAM_REPORTS = "reports";
public static final String PARAM_PROCESS_MODE = "processMode";
public static final String PARAM_RESPONSE_DESTINATION_NAME = "responseDestinationName";
public final static String SERVICE_CONTEXT = "serviceContext";
public final static String FILE_ENTRY_ID_TEMPLATE = "fileEntryIdTemplate";
public final static String REPORT_PARAMETERS = "reportParameters";
public final static String REPORT_DATASOURCE = "reportDataSource";
public final static String REPORT_NAME = "reportName";
public final static String FOLDER_ID_REPORT = "folderIdReport";
public static final String SERVICE_CONTEXT = "serviceContext";
public static final String FILE_ENTRY_ID_TEMPLATE = "fileEntryIdTemplate";
public static final String REPORT_PARAMETERS = "reportParameters";
public static final String REPORT_DATASOURCE = "reportDataSource";
public static final String REPORT_NAME = "reportName";
public static final String FOLDER_ID_REPORT = "folderIdReport";
/*
* Genio Civile
*/
public final static String LOGO_REGIONE = "LOGO_REGIONE";
public final static String LOGO_DIPARTIMENTO = "LOGO_DIPARTIMENTO";
public final static 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 LOGO_REGIONE = "LOGO_REGIONE";
public static final String LOGO_DIPARTIMENTO = "LOGO_DIPARTIMENTO";
public static final String PATH_LOGO_REGIONE = "/resource/report/LOGO_REGIONE.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 final static String SERIAL = "liferay/tref/portos/report_serial";
public final static String SYNC = "liferay/tref/portos/report_sync";
public final static String SYNC_PROTOCOLLO = "liferay/tref/portos/protocollo_sync";
public static final String SERIAL = "liferay/tref/portos/report_serial";
public static final String SYNC = "liferay/tref/portos/report_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;
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.DocumentException;
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.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 {
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) {
@ -77,8 +77,7 @@ public class PdfUtil {
}
iteratorPDFReader = readers.iterator();
// Loop through the PDF files and add to the output.
while (iteratorPDFReader.hasNext()) {
}
while (iteratorPDFReader.hasNext()) {}
outputStream.flush();
document.close();
@ -131,9 +130,9 @@ public class PdfUtil {
if (showNumberOfPage) {
// add page numbers
ColumnText.showTextAligned(stamp.getUnderContent(), Element.ALIGN_CENTER, new Phrase(
String.format("%d / %d", curentPageNumber, totalPage)), pdfImportedPage
.getHeight() / 2, 20, 0);
ColumnText.showTextAligned(stamp.getUnderContent(), Element.ALIGN_CENTER,
new Phrase(String.format("%d / %d", curentPageNumber, totalPage)),
pdfImportedPage.getHeight() / 2, 20, 0);
}
stamp.alterContents();

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

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<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">
<attributes>
<attribute name="owner.project.facets" value="java"/>
@ -12,18 +13,11 @@
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes>
</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)">
<attributes>
<attribute name="owner.project.facets" value="jst.web"/>
</attributes>
</classpathentry>
<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"/>
</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-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/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">
<dependency-type>uses</dependency-type>
</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="java-output-path" value="/portos-kaleo-web/docroot/WEB-INF/classes"/>
</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.
licenses=LGPL
portal-dependency-jars=\
commons-codec.jar,\
commons-collections.jar,\
commons-lang.jar,\
jabsorb.jar,\
json-java.jar,\
slf4j-api.jar,\
util-slf4j.jar,\
commons-codec.jar
util-slf4j.jar
required-deployment-contexts=\
portos-kaleo-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.
*
* 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.
* 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 com.liferay.portal.workflow.kaleo;

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

95
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.
*
* 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.
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it
* and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 2.1 of the License, or (at your option) any later version. This library is 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;
import java.util.List;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;
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.util.ClassLoaderUtil;
import java.util.List;
/**
* @author Michael C. Han
*/
@ -38,66 +32,39 @@ public class ConditionNodeExecutor extends BaseNodeExecutor {
_conditionEvaluator = conditionEvaluator;
}
protected boolean doEnter(
KaleoNode currentKaleoNode, ExecutionContext executionContext) {
@Override
protected boolean doEnter(KaleoNode currentKaleoNode, ExecutionContext executionContext) {
return true;
}
@Override
protected void doExecute(KaleoNode currentKaleoNode, ExecutionContext executionContext,
List<PathElement> remainingPathElements) throws PortalException, SystemException {
protected void doExecute(
KaleoNode currentKaleoNode, ExecutionContext executionContext,
List<PathElement> remainingPathElements)
throws PortalException, SystemException {
KaleoInstanceToken kaleoInstanceToken =
executionContext.getKaleoInstanceToken();
KaleoInstanceToken kaleoInstanceToken = executionContext.getKaleoInstanceToken();
KaleoCondition kaleoCondition =
kaleoConditionLocalService.getKaleoNodeKaleoCondition(
currentKaleoNode.getKaleoNodeId());
String[] scriptRequiredContexts = StringUtil.split(
kaleoCondition.getScriptRequiredContexts());
ClassLoader[] classloaders = ClassLoaderUtil.getClassLoaders(
scriptRequiredContexts);
String transitionName = _conditionEvaluator.evaluate(
kaleoCondition, executionContext, classloaders);
kaleoInstanceLocalService.updateKaleoInstance(
kaleoInstanceToken.getKaleoInstanceId(),
executionContext.getWorkflowContext(),
executionContext.getServiceContext());
KaleoTransition kaleoTransition = currentKaleoNode.getKaleoTransition(
transitionName);
ExecutionContext newExecutionContext = new ExecutionContext(
kaleoInstanceToken, executionContext.getWorkflowContext(),
executionContext.getServiceContext());
PathElement pathElement = new PathElement(
currentKaleoNode, kaleoTransition.getTargetKaleoNode(),
newExecutionContext);
kaleoConditionLocalService.getKaleoNodeKaleoCondition(currentKaleoNode.getKaleoNodeId());
String[] scriptRequiredContexts = StringUtil.split(kaleoCondition.getScriptRequiredContexts());
ClassLoader[] classloaders = ClassLoaderUtil.getClassLoaders(scriptRequiredContexts);
String transitionName = _conditionEvaluator.evaluate(kaleoCondition, executionContext, classloaders);
kaleoInstanceLocalService.updateKaleoInstance(kaleoInstanceToken.getKaleoInstanceId(),
executionContext.getWorkflowContext(), executionContext.getServiceContext());
KaleoTransition kaleoTransition = currentKaleoNode.getKaleoTransition(transitionName);
ExecutionContext newExecutionContext =
new ExecutionContext(kaleoInstanceToken, executionContext.getWorkflowContext(),
executionContext.getServiceContext());
PathElement pathElement =
new PathElement(currentKaleoNode, kaleoTransition.getTargetKaleoNode(), newExecutionContext);
remainingPathElements.add(pathElement);
}
@Override
protected void doExecuteTimer(KaleoNode currentKaleoNode, KaleoTimer kaleoTimer, ExecutionContext executionContext) {}
protected void doExecuteTimer(
KaleoNode currentKaleoNode, KaleoTimer kaleoTimer,
ExecutionContext executionContext) {
}
protected void doExit(
KaleoNode currentKaleoNode, ExecutionContext executionContext,
List<PathElement> remainingPathElements) {
}
@Override
protected void doExit(KaleoNode currentKaleoNode, ExecutionContext executionContext,
List<PathElement> remainingPathElements) {}
private ConditionEvaluator _conditionEvaluator;
}
}

96
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.
*
* 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.
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it
* and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 2.1 of the License, or (at your option) any later version. This library is 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;
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.SystemException;
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.graph.PathElement;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author Michael C. Han
*/
public class ForkNodeExecutor extends BaseNodeExecutor {
protected boolean doEnter(
KaleoNode currentKaleoNode, ExecutionContext executionContext) {
@Override
protected boolean doEnter(KaleoNode currentKaleoNode, ExecutionContext executionContext) {
return true;
}
@Override
protected void doExecute(KaleoNode currentKaleoNode, ExecutionContext executionContext,
List<PathElement> remainingPathElements) throws PortalException, SystemException {
protected void doExecute(
KaleoNode currentKaleoNode, ExecutionContext executionContext,
List<PathElement> remainingPathElements)
throws PortalException, SystemException {
List<KaleoTransition> kaleoTransitions =
currentKaleoNode.getKaleoTransitions();
Map<String, KaleoInstanceToken> childKaleoInstanceTokens =
new HashMap<String, KaleoInstanceToken>();
List<KaleoTransition> kaleoTransitions = currentKaleoNode.getKaleoTransitions();
Map<String, KaleoInstanceToken> childKaleoInstanceTokens = new HashMap<String, KaleoInstanceToken>();
for (KaleoTransition kaleoTransition : kaleoTransitions) {
KaleoInstanceToken parentKaleoInstanceToken =
executionContext.getKaleoInstanceToken();
KaleoInstanceToken parentKaleoInstanceToken = executionContext.getKaleoInstanceToken();
KaleoInstanceToken childKaleoInstanceToken =
kaleoInstanceTokenLocalService.addKaleoInstanceToken(
parentKaleoInstanceToken.getKaleoInstanceTokenId(),
executionContext.getWorkflowContext(),
executionContext.getServiceContext());
childKaleoInstanceTokens.put(
kaleoTransition.getName(), childKaleoInstanceToken);
kaleoInstanceTokenLocalService.addKaleoInstanceToken(
parentKaleoInstanceToken.getKaleoInstanceTokenId(), executionContext.getWorkflowContext(),
executionContext.getServiceContext());
childKaleoInstanceTokens.put(kaleoTransition.getName(), childKaleoInstanceToken);
}
for (KaleoTransition kaleoTransition : kaleoTransitions) {
KaleoInstanceToken childKaleoInstanceToken =
childKaleoInstanceTokens.get(kaleoTransition.getName());
ExecutionContext forkedExecutionContext = new ExecutionContext(
childKaleoInstanceToken, executionContext.getWorkflowContext(),
executionContext.getServiceContext());
PathElement pathElement = new PathElement(
currentKaleoNode, kaleoTransition.getTargetKaleoNode(),
forkedExecutionContext);
KaleoInstanceToken childKaleoInstanceToken = childKaleoInstanceTokens.get(kaleoTransition.getName());
ExecutionContext forkedExecutionContext =
new ExecutionContext(childKaleoInstanceToken, executionContext.getWorkflowContext(),
executionContext.getServiceContext());
PathElement pathElement =
new PathElement(currentKaleoNode, kaleoTransition.getTargetKaleoNode(), forkedExecutionContext);
remainingPathElements.add(pathElement);
}
}
@Override
protected void doExecuteTimer(KaleoNode currentKaleoNode, KaleoTimer kaleoTimer, ExecutionContext executionContext) {}
protected void doExecuteTimer(
KaleoNode currentKaleoNode, KaleoTimer kaleoTimer,
ExecutionContext executionContext) {
}
protected void doExit(
KaleoNode currentKaleoNode, ExecutionContext executionContext,
List<PathElement> remainingPathElements) {
}
}
@Override
protected void doExit(KaleoNode currentKaleoNode, ExecutionContext executionContext,
List<PathElement> remainingPathElements) {}
}

97
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.
*
* 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.
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it
* and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 2.1 of the License, or (at your option) any later version. This library is 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;
import java.util.List;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;
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.graph.PathElement;
import java.util.List;
/**
* @author Michael C. Han
*/
public class JoinNodeExecutor extends BaseNodeExecutor {
@Override
protected boolean doEnter(KaleoNode currentKaleoNode, ExecutionContext executionContext) throws PortalException,
SystemException {
protected boolean doEnter(
KaleoNode currentKaleoNode, ExecutionContext executionContext)
throws PortalException, SystemException {
KaleoInstanceToken kaleoInstanceToken =
executionContext.getKaleoInstanceToken();
kaleoInstanceTokenLocalService.completeKaleoInstanceToken(
kaleoInstanceToken.getKaleoInstanceTokenId());
KaleoInstanceToken kaleoInstanceToken = executionContext.getKaleoInstanceToken();
kaleoInstanceTokenLocalService.completeKaleoInstanceToken(kaleoInstanceToken.getKaleoInstanceTokenId());
return true;
}
@Override
protected void doExecute(KaleoNode currentKaleoNode, ExecutionContext executionContext,
List<PathElement> remainingPathElements) throws PortalException, SystemException {
protected void doExecute(
KaleoNode currentKaleoNode, ExecutionContext executionContext,
List<PathElement> remainingPathElements)
throws PortalException, SystemException {
KaleoInstanceToken kaleoInstanceToken =
executionContext.getKaleoInstanceToken();
KaleoInstanceToken parentKaleoInstanceToken =
kaleoInstanceToken.getParentKaleoInstanceToken();
if (parentKaleoInstanceToken.
hasIncompleteChildrenKaleoInstanceToken()) {
KaleoInstanceToken kaleoInstanceToken = executionContext.getKaleoInstanceToken();
KaleoInstanceToken parentKaleoInstanceToken = kaleoInstanceToken.getParentKaleoInstanceToken();
if (parentKaleoInstanceToken.hasIncompleteChildrenKaleoInstanceToken()) {
return;
}
parentKaleoInstanceToken =
kaleoInstanceTokenLocalService.updateKaleoInstanceToken(
parentKaleoInstanceToken.getKaleoInstanceTokenId(),
currentKaleoNode.getKaleoNodeId());
KaleoTransition kaleoTransition =
currentKaleoNode.getDefaultKaleoTransition();
ExecutionContext newExecutionContext = new ExecutionContext(
parentKaleoInstanceToken, executionContext.getWorkflowContext(),
executionContext.getServiceContext());
PathElement pathElement = new PathElement(
currentKaleoNode, kaleoTransition.getTargetKaleoNode(),
newExecutionContext);
kaleoInstanceTokenLocalService.updateKaleoInstanceToken(
parentKaleoInstanceToken.getKaleoInstanceTokenId(), currentKaleoNode.getKaleoNodeId());
KaleoTransition kaleoTransition = currentKaleoNode.getDefaultKaleoTransition();
ExecutionContext newExecutionContext =
new ExecutionContext(parentKaleoInstanceToken, executionContext.getWorkflowContext(),
executionContext.getServiceContext());
PathElement pathElement =
new PathElement(currentKaleoNode, kaleoTransition.getTargetKaleoNode(), newExecutionContext);
remainingPathElements.add(pathElement);
}
@Override
protected void doExecuteTimer(KaleoNode currentKaleoNode, KaleoTimer kaleoTimer, ExecutionContext executionContext) {}
protected void doExecuteTimer(
KaleoNode currentKaleoNode, KaleoTimer kaleoTimer,
ExecutionContext executionContext) {
}
protected void doExit(
KaleoNode currentKaleoNode, ExecutionContext executionContext,
List<PathElement> remainingPathElements) {
}
}
@Override
protected void doExit(KaleoNode currentKaleoNode, ExecutionContext executionContext,
List<PathElement> remainingPathElements) {}
}

123
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.
*
* 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.
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it
* and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 2.1 of the License, or (at your option) any later version. This library is 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;
import java.util.List;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;
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.graph.PathElement;
import java.util.List;
/**
* @author Michael C. Han
*/
public class JoinXorNodeExecutor extends BaseNodeExecutor {
@Override
protected boolean doEnter(KaleoNode currentKaleoNode, ExecutionContext executionContext) throws PortalException,
SystemException {
protected boolean doEnter(
KaleoNode currentKaleoNode, ExecutionContext executionContext)
throws PortalException, SystemException {
KaleoInstanceToken kaleoInstanceToken =
executionContext.getKaleoInstanceToken();
KaleoInstanceToken kaleoInstanceToken = executionContext.getKaleoInstanceToken();
kaleoInstanceToken =
kaleoInstanceTokenLocalService.getKaleoInstanceToken(
kaleoInstanceToken.getKaleoInstanceTokenId());
kaleoInstanceTokenLocalService.getKaleoInstanceToken(kaleoInstanceToken.getKaleoInstanceTokenId());
if (kaleoInstanceToken.isCompleted()) {
return false;
}
kaleoInstanceToken =
kaleoInstanceTokenLocalService.completeKaleoInstanceToken(
kaleoInstanceToken.getKaleoInstanceTokenId());
KaleoInstanceToken parentKaleoInstanceToken =
kaleoInstanceToken.getParentKaleoInstanceToken();
if (!parentKaleoInstanceToken.
hasIncompleteChildrenKaleoInstanceToken()) {
kaleoInstanceTokenLocalService.completeKaleoInstanceToken(kaleoInstanceToken.getKaleoInstanceTokenId());
KaleoInstanceToken parentKaleoInstanceToken = kaleoInstanceToken.getParentKaleoInstanceToken();
if (!parentKaleoInstanceToken.hasIncompleteChildrenKaleoInstanceToken()) {
return false;
}
List<KaleoInstanceToken> childrenKaleoInstanceTokens =
parentKaleoInstanceToken.getChildrenKaleoInstanceTokens();
for (KaleoInstanceToken childrenKaleoInstanceToken :
childrenKaleoInstanceTokens) {
kaleoInstanceTokenLocalService.completeKaleoInstanceToken(
childrenKaleoInstanceToken.getKaleoInstanceTokenId());
parentKaleoInstanceToken.getChildrenKaleoInstanceTokens();
for (KaleoInstanceToken childrenKaleoInstanceToken : childrenKaleoInstanceTokens) {
kaleoInstanceTokenLocalService.completeKaleoInstanceToken(childrenKaleoInstanceToken
.getKaleoInstanceTokenId());
}
return true;
}
@Override
protected void doExecute(KaleoNode currentKaleoNode, ExecutionContext executionContext,
List<PathElement> remainingPathElements) throws PortalException, SystemException {
protected void doExecute(
KaleoNode currentKaleoNode, ExecutionContext executionContext,
List<PathElement> remainingPathElements)
throws PortalException, SystemException {
KaleoInstanceToken kaleoInstanceToken =
executionContext.getKaleoInstanceToken();
KaleoInstanceToken parentKaleoInstanceToken =
kaleoInstanceToken.getParentKaleoInstanceToken();
if (parentKaleoInstanceToken.getCurrentKaleoNodeId() ==
currentKaleoNode.getKaleoNodeId()) {
KaleoInstanceToken kaleoInstanceToken = executionContext.getKaleoInstanceToken();
KaleoInstanceToken parentKaleoInstanceToken = kaleoInstanceToken.getParentKaleoInstanceToken();
if (parentKaleoInstanceToken.getCurrentKaleoNodeId() == currentKaleoNode.getKaleoNodeId()) {
return;
}
parentKaleoInstanceToken =
kaleoInstanceTokenLocalService.updateKaleoInstanceToken(
parentKaleoInstanceToken.getKaleoInstanceTokenId(),
currentKaleoNode.getKaleoNodeId());
KaleoTransition kaleoTransition =
currentKaleoNode.getDefaultKaleoTransition();
ExecutionContext newExecutionContext = new ExecutionContext(
parentKaleoInstanceToken, executionContext.getWorkflowContext(),
executionContext.getServiceContext());
PathElement pathElement = new PathElement(
currentKaleoNode, kaleoTransition.getTargetKaleoNode(),
newExecutionContext);
kaleoInstanceTokenLocalService.updateKaleoInstanceToken(
parentKaleoInstanceToken.getKaleoInstanceTokenId(), currentKaleoNode.getKaleoNodeId());
KaleoTransition kaleoTransition = currentKaleoNode.getDefaultKaleoTransition();
ExecutionContext newExecutionContext =
new ExecutionContext(parentKaleoInstanceToken, executionContext.getWorkflowContext(),
executionContext.getServiceContext());
PathElement pathElement =
new PathElement(currentKaleoNode, kaleoTransition.getTargetKaleoNode(), newExecutionContext);
remainingPathElements.add(pathElement);
}
@Override
protected void doExecuteTimer(KaleoNode currentKaleoNode, KaleoTimer kaleoTimer, ExecutionContext executionContext) {}
protected void doExecuteTimer(
KaleoNode currentKaleoNode, KaleoTimer kaleoTimer,
ExecutionContext executionContext) {
}
protected void doExit(
KaleoNode currentKaleoNode, ExecutionContext executionContext,
List<PathElement> remainingPathElements) {
}
}
@Override
protected void doExit(KaleoNode currentKaleoNode, ExecutionContext executionContext,
List<PathElement> remainingPathElements) {}
}

45
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.
*
* 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.
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it
* and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 2.1 of the License, or (at your option) any later version. This library is 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;
import java.util.List;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.workflow.kaleo.model.KaleoNode;
import com.liferay.portal.workflow.kaleo.runtime.ExecutionContext;
import com.liferay.portal.workflow.kaleo.runtime.graph.PathElement;
import java.util.List;
/**
* @author Michael C. Han
*/
public interface NodeExecutor {
public boolean enter(
KaleoNode currentKaleoNode, ExecutionContext executionContext)
throws PortalException, SystemException;
public void execute(
KaleoNode currentKaleoNode, ExecutionContext executionContext,
List<PathElement> remainingPathElements)
throws PortalException, SystemException;
public boolean enter(KaleoNode currentKaleoNode, ExecutionContext executionContext) throws PortalException,
SystemException;
public void executeTimer(
KaleoNode currentKaleoNode, ExecutionContext executionContext)
throws PortalException, SystemException;
public void execute(KaleoNode currentKaleoNode, ExecutionContext executionContext,
List<PathElement> remainingPathElements) throws PortalException, SystemException;
public void exit(
KaleoNode currentKaleoNode, ExecutionContext executionContext,
List<PathElement> remainingPathElements)
throws PortalException, SystemException;
public void executeTimer(KaleoNode currentKaleoNode, ExecutionContext executionContext) throws PortalException,
SystemException;
}
public void exit(KaleoNode currentKaleoNode, ExecutionContext executionContext,
List<PathElement> remainingPathElements) throws PortalException, SystemException;
}

29
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.
*
* 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.
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it
* and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 2.1 of the License, or (at your option) any later version. This library is 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;
import com.liferay.portal.workflow.kaleo.util.NodeTypeDependentObjectRegistry;
import java.util.Map;
import com.liferay.portal.workflow.kaleo.util.NodeTypeDependentObjectRegistry;
/**
* @author Michael C. Han
*/
public class NodeExecutorFactory {
public static NodeExecutor getNodeExecutor(String nodeTypeString) {
return _nodeExecutors.getNodeTypeDependentObjects(nodeTypeString);
}
public void setNodeExectors(Map<String, NodeExecutor> nodeExecutors) {
_nodeExecutors.setNodeTypeDependentObjects(nodeExecutors);
}
private static NodeTypeDependentObjectRegistry<NodeExecutor>
_nodeExecutors = new NodeTypeDependentObjectRegistry<NodeExecutor>();
}
private static NodeTypeDependentObjectRegistry<NodeExecutor> _nodeExecutors =
new NodeTypeDependentObjectRegistry<NodeExecutor>();
}

165
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.
*
* 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.
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it
* and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 2.1 of the License, or (at your option) any later version. This library is 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;
import java.util.List;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;
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.graph.PathElement;
import java.util.List;
/**
* @author Michael C. Han
*/
public class StateNodeExecutor extends BaseNodeExecutor {
private final static String NAME_SIGNAL = "SIGNAL";
public static boolean isSignalNode(KaleoNode kaleoNode) {
return kaleoNode.getName().toUpperCase().startsWith(NAME_SIGNAL);
}
protected boolean doEnter(KaleoNode currentKaleoNode, ExecutionContext executionContext) {
return true;
}
protected void doExecute(KaleoNode currentKaleoNode, ExecutionContext executionContext,
List<PathElement> remainingPathElements) throws PortalException, SystemException {
if (isSignalNode(currentKaleoNode)) {
return;
}
KaleoInstanceToken kaleoInstanceToken = executionContext.getKaleoInstanceToken();
String transitionName = executionContext.getTransitionName();
if (!currentKaleoNode.hasKaleoTransition()) {
kaleoInstanceToken =
kaleoInstanceTokenLocalService.completeKaleoInstanceToken(kaleoInstanceToken.getKaleoInstanceTokenId());
if (kaleoInstanceToken.getParentKaleoInstanceTokenId() == KaleoInstanceTokenImpl.DEFAULT_PARENT_KALEO_INSTANCE_TOKEN_ID) {
kaleoInstanceLocalService.completeKaleoInstance(kaleoInstanceToken.getKaleoInstanceId());
}
return;
}
KaleoTransition kaleoTransition = null;
if (Validator.isNull(transitionName)) {
kaleoTransition = currentKaleoNode.getDefaultKaleoTransition();
} else {
kaleoTransition = currentKaleoNode.getKaleoTransition(transitionName);
}
ExecutionContext newExecutionContext =
new ExecutionContext(kaleoInstanceToken, executionContext.getWorkflowContext(),
executionContext.getServiceContext());
PathElement pathElement =
new PathElement(currentKaleoNode, kaleoTransition.getTargetKaleoNode(), newExecutionContext);
remainingPathElements.add(pathElement);
}
protected void doExecuteTimer(KaleoNode currentKaleoNode, KaleoTimer kaleoTimer, ExecutionContext executionContext) {}
protected void doExit(KaleoNode currentKaleoNode, ExecutionContext executionContext,
List<PathElement> remainingPathElements) throws PortalException, SystemException {
if (isSignalNode(currentKaleoNode)) {
String transitionName = executionContext.getTransitionName();
KaleoTransition kaleoTransition = null;
if (Validator.isNull(transitionName)) {
kaleoTransition = currentKaleoNode.getDefaultKaleoTransition();
} else {
kaleoTransition = currentKaleoNode.getKaleoTransition(transitionName);
}
ExecutionContext newExecutionContext =
new ExecutionContext(executionContext.getKaleoInstanceToken(), executionContext.getKaleoTaskInstanceToken(),
executionContext.getWorkflowContext(), executionContext.getServiceContext());
PathElement pathElement = new PathElement(null, kaleoTransition.getTargetKaleoNode(), newExecutionContext);
remainingPathElements.add(pathElement);
}
}
private static final String NAME_SIGNAL = "SIGNAL";
public static boolean isSignalNode(KaleoNode kaleoNode) {
return kaleoNode.getName().toUpperCase().startsWith(NAME_SIGNAL);
}
@Override
protected boolean doEnter(KaleoNode currentKaleoNode, ExecutionContext executionContext) {
return true;
}
@Override
protected void doExecute(KaleoNode currentKaleoNode, ExecutionContext executionContext,
List<PathElement> remainingPathElements) throws PortalException, SystemException {
if (isSignalNode(currentKaleoNode)) {
return;
}
KaleoInstanceToken kaleoInstanceToken = executionContext.getKaleoInstanceToken();
String transitionName = executionContext.getTransitionName();
if (!currentKaleoNode.hasKaleoTransition()) {
kaleoInstanceToken = kaleoInstanceTokenLocalService.completeKaleoInstanceToken(kaleoInstanceToken
.getKaleoInstanceTokenId());
if (kaleoInstanceToken.getParentKaleoInstanceTokenId() == KaleoInstanceTokenImpl.DEFAULT_PARENT_KALEO_INSTANCE_TOKEN_ID) {
kaleoInstanceLocalService.completeKaleoInstance(kaleoInstanceToken.getKaleoInstanceId());
}
return;
}
KaleoTransition kaleoTransition = null;
if (Validator.isNull(transitionName)) {
kaleoTransition = currentKaleoNode.getDefaultKaleoTransition();
} else {
kaleoTransition = currentKaleoNode.getKaleoTransition(transitionName);
}
ExecutionContext newExecutionContext = new ExecutionContext(kaleoInstanceToken,
executionContext.getWorkflowContext(), executionContext.getServiceContext());
PathElement pathElement = new PathElement(currentKaleoNode, kaleoTransition.getTargetKaleoNode(),
newExecutionContext);
remainingPathElements.add(pathElement);
}
@Override
protected void doExecuteTimer(KaleoNode currentKaleoNode, KaleoTimer kaleoTimer, ExecutionContext executionContext) {}
@Override
protected void doExit(KaleoNode currentKaleoNode, ExecutionContext executionContext,
List<PathElement> remainingPathElements) throws PortalException, SystemException {
if (isSignalNode(currentKaleoNode)) {
String transitionName = executionContext.getTransitionName();
KaleoTransition kaleoTransition = null;
if (Validator.isNull(transitionName)) {
kaleoTransition = currentKaleoNode.getDefaultKaleoTransition();
} else {
kaleoTransition = currentKaleoNode.getKaleoTransition(transitionName);
}
ExecutionContext newExecutionContext = new ExecutionContext(executionContext.getKaleoInstanceToken(),
executionContext.getKaleoTaskInstanceToken(), executionContext.getWorkflowContext(),
executionContext.getServiceContext());
PathElement pathElement = new PathElement(null, kaleoTransition.getTargetKaleoNode(), newExecutionContext);
remainingPathElements.add(pathElement);
}
}
}

260
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.
*
* 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.
* Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it
* and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software
* Foundation; either version 2.1 of the License, or (at your option) any later version. This library is 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;
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.SystemException;
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.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
*/
public class TaskNodeExecutor extends BaseNodeExecutor {
public void setDueDateCalculator(DueDateCalculator dueDateCalculator) {
_dueDateCalculator = dueDateCalculator;
}
public void setTaskAssignmentSelector(
TaskAssignmentSelector taskAssignmentSelector) {
public void setTaskAssignmentSelector(TaskAssignmentSelector taskAssignmentSelector) {
_taskAssignmentSelector = taskAssignmentSelector;
}
protected Date calculateDueDate(KaleoTask kaleoTask)
throws SystemException {
List<KaleoTimer> kaleoTimers = kaleoTimerLocalService.getKaleoTimers(
KaleoNode.class.getName(), kaleoTask.getKaleoNodeId());
protected Date calculateDueDate(KaleoTask kaleoTask) throws SystemException {
List<KaleoTimer> kaleoTimers =
kaleoTimerLocalService.getKaleoTimers(KaleoNode.class.getName(), kaleoTask.getKaleoNodeId());
if (kaleoTimers.isEmpty()) {
return null;
}
TreeSet<Date> sortedDueDates = new TreeSet<Date>();
for (KaleoTimer kaleoTimer : kaleoTimers) {
DelayDuration delayDuration = new DelayDuration(
kaleoTimer.getDuration(),
DurationScale.parse(kaleoTimer.getScale()));
Date dueDate = _dueDateCalculator.getDueDate(
new Date(), delayDuration);
DelayDuration delayDuration =
new DelayDuration(kaleoTimer.getDuration(), DurationScale.parse(kaleoTimer.getScale()));
Date dueDate = _dueDateCalculator.getDueDate(new Date(), delayDuration);
sortedDueDates.add(dueDate);
}
return sortedDueDates.first();
}
protected KaleoTaskInstanceToken createTaskInstanceToken(
ExecutionContext executionContext,
Map<String, Serializable> workflowContext,
ServiceContext serviceContext,
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);
protected KaleoTaskInstanceToken createTaskInstanceToken(ExecutionContext executionContext,
Map<String, Serializable> workflowContext, ServiceContext serviceContext,
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> calculatedKaleoTaskAssignments =
_taskAssignmentSelector.calculateTaskAssignments(
configuredKaleoTaskAssignment, executionContext,
classLoaders);
_taskAssignmentSelector.calculateTaskAssignments(configuredKaleoTaskAssignment, executionContext,
classLoaders);
kaleoTaskAssignments.addAll(calculatedKaleoTaskAssignments);
}
if (kaleoTaskAssignments.isEmpty()) {
Collection<KaleoTaskAssignment> organizationKaleoTaskAssignments =
getOrganizationKaleoTaskAssignments(
configuredKaleoTaskAssignments, executionContext);
getOrganizationKaleoTaskAssignments(configuredKaleoTaskAssignments, executionContext);
kaleoTaskAssignments.addAll(organizationKaleoTaskAssignments);
}
return kaleoTaskInstanceTokenLocalService.addKaleoTaskInstanceToken(
kaleoInstanceToken.getKaleoInstanceTokenId(),
kaleoTask.getKaleoTaskId(), kaleoTask.getName(),
kaleoTaskAssignments, dueDate, workflowContext, serviceContext);
kaleoInstanceToken.getKaleoInstanceTokenId(), kaleoTask.getKaleoTaskId(), kaleoTask.getName(),
kaleoTaskAssignments, dueDate, workflowContext, serviceContext);
}
@Override
protected boolean doEnter(KaleoNode currentKaleoNode, ExecutionContext executionContext) throws PortalException,
SystemException {
protected boolean doEnter(
KaleoNode currentKaleoNode, ExecutionContext executionContext)
throws PortalException, SystemException {
Map<String, Serializable> workflowContext =
executionContext.getWorkflowContext();
Map<String, Serializable> workflowContext = executionContext.getWorkflowContext();
ServiceContext serviceContext = executionContext.getServiceContext();
KaleoInstanceToken kaleoInstanceToken =
executionContext.getKaleoInstanceToken();
KaleoTask kaleoTask = kaleoTaskLocalService.getKaleoNodeKaleoTask(
currentKaleoNode.getKaleoNodeId());
KaleoInstanceToken kaleoInstanceToken = executionContext.getKaleoInstanceToken();
KaleoTask kaleoTask = kaleoTaskLocalService.getKaleoNodeKaleoTask(currentKaleoNode.getKaleoNodeId());
Date dueDate = calculateDueDate(kaleoTask);
KaleoTaskInstanceToken kaleoTaskInstanceToken = createTaskInstanceToken(
executionContext, workflowContext, serviceContext,
kaleoInstanceToken, kaleoTask, dueDate);
KaleoTaskInstanceToken kaleoTaskInstanceToken =
createTaskInstanceToken(executionContext, workflowContext, serviceContext, kaleoInstanceToken,
kaleoTask, dueDate);
executionContext.setKaleoTaskInstanceToken(kaleoTaskInstanceToken);
ActionExecutorUtil.executeKaleoActions(
KaleoNode.class.getName(), currentKaleoNode.getKaleoNodeId(),
ExecutionType.ON_ASSIGNMENT, executionContext);
NotificationUtil.sendKaleoNotifications(
KaleoNode.class.getName(), currentKaleoNode.getKaleoNodeId(),
ExecutionType.ON_ASSIGNMENT, executionContext);
kaleoLogLocalService.addTaskAssignmentKaleoLog(
null, kaleoTaskInstanceToken, "Assigned initial task.",
workflowContext, serviceContext);
ActionExecutorUtil.executeKaleoActions(KaleoNode.class.getName(), currentKaleoNode.getKaleoNodeId(),
ExecutionType.ON_ASSIGNMENT, executionContext);
NotificationUtil.sendKaleoNotifications(KaleoNode.class.getName(), currentKaleoNode.getKaleoNodeId(),
ExecutionType.ON_ASSIGNMENT, executionContext);
kaleoLogLocalService.addTaskAssignmentKaleoLog(null, kaleoTaskInstanceToken, "Assigned initial task.",
workflowContext, serviceContext);
return true;
}
@Override
protected void doExecute(KaleoNode currentKaleoNode, ExecutionContext executionContext,
List<PathElement> remainingPathElements) {}
protected void doExecute(
KaleoNode currentKaleoNode, ExecutionContext executionContext,
List<PathElement> remainingPathElements) {
}
protected void doExecuteTimer(
KaleoNode currentKaleoNode, KaleoTimer kaleoTimer,
ExecutionContext executionContext)
throws PortalException, SystemException {
List<KaleoTaskAssignment> kaleoTaskReassignments =
kaleoTimer.getKaleoTaskReassignments();
@Override
protected void doExecuteTimer(KaleoNode currentKaleoNode, KaleoTimer kaleoTimer, ExecutionContext executionContext)
throws PortalException, SystemException {
List<KaleoTaskAssignment> kaleoTaskReassignments = kaleoTimer.getKaleoTaskReassignments();
if (kaleoTaskReassignments.isEmpty()) {
return;
}
TaskAssignerUtil.reassignKaleoTask(
kaleoTaskReassignments, executionContext);
TaskAssignerUtil.reassignKaleoTask(kaleoTaskReassignments, executionContext);
}
protected void doExit(
KaleoNode currentKaleoNode, ExecutionContext executionContext,
List<PathElement> remainingPathElements)
throws PortalException, SystemException {
@Override
protected void doExit(KaleoNode currentKaleoNode, ExecutionContext executionContext,
List<PathElement> remainingPathElements) throws PortalException, SystemException {
String transitionName = executionContext.getTransitionName();
KaleoTransition kaleoTransition = null;
if (Validator.isNull(transitionName)) {
kaleoTransition = currentKaleoNode.getDefaultKaleoTransition();
} else {
kaleoTransition = currentKaleoNode.getKaleoTransition(transitionName);
}
else {
kaleoTransition = currentKaleoNode.getKaleoTransition(
transitionName);
}
ExecutionContext newExecutionContext = new ExecutionContext(
executionContext.getKaleoInstanceToken(),
executionContext.getKaleoTaskInstanceToken(),
executionContext.getWorkflowContext(),
executionContext.getServiceContext());
PathElement pathElement = new PathElement(
null, kaleoTransition.getTargetKaleoNode(), newExecutionContext);
ExecutionContext newExecutionContext =
new ExecutionContext(executionContext.getKaleoInstanceToken(),
executionContext.getKaleoTaskInstanceToken(), executionContext.getWorkflowContext(),
executionContext.getServiceContext());
PathElement pathElement = new PathElement(null, kaleoTransition.getTargetKaleoNode(), newExecutionContext);
remainingPathElements.add(pathElement);
}
protected Collection<KaleoTaskAssignment>
getOrganizationKaleoTaskAssignments(
Collection<KaleoTaskAssignment> kaleoTaskAssignments,
ExecutionContext executionContext)
throws PortalException, SystemException {
protected Collection<KaleoTaskAssignment> getOrganizationKaleoTaskAssignments(
Collection<KaleoTaskAssignment> kaleoTaskAssignments, ExecutionContext executionContext)
throws PortalException, SystemException {
long userId = executionContext.getKaleoInstanceToken().getUserId();
User user = UserLocalServiceUtil.getUser(userId);
List<Organization> organizations = user.getOrganizations();
Collection<KaleoTaskAssignment> organizationKaleoTaskAssignments =
new HashSet<KaleoTaskAssignment>();
Collection<KaleoTaskAssignment> organizationKaleoTaskAssignments = new HashSet<KaleoTaskAssignment>();
for (KaleoTaskAssignment kaleoTaskAssignment : kaleoTaskAssignments) {
String assigneeClassName =
kaleoTaskAssignment.getAssigneeClassName();
String assigneeClassName = kaleoTaskAssignment.getAssigneeClassName();
if (!assigneeClassName.equals(Role.class.getName())) {
continue;
}
long roleId = kaleoTaskAssignment.getAssigneeClassPK();
Role role = RoleLocalServiceUtil.getRole(roleId);
if (role.getType() != RoleConstants.TYPE_ORGANIZATION) {
continue;
}
for (Organization organization : organizations) {
KaleoTaskAssignment organizationKaleoTaskAssignment =
new KaleoTaskAssignmentImpl();
organizationKaleoTaskAssignment.setGroupId(
organization.getGroup().getGroupId());
organizationKaleoTaskAssignment.setCompanyId(
kaleoTaskAssignment.getCompanyId());
organizationKaleoTaskAssignment.setAssigneeClassName(
kaleoTaskAssignment.getAssigneeClassName());
organizationKaleoTaskAssignment.setAssigneeClassPK(
kaleoTaskAssignment.getAssigneeClassPK());
organizationKaleoTaskAssignments.add(
organizationKaleoTaskAssignment);
KaleoTaskAssignment organizationKaleoTaskAssignment = new KaleoTaskAssignmentImpl();
organizationKaleoTaskAssignment.setGroupId(organization.getGroup().getGroupId());
organizationKaleoTaskAssignment.setCompanyId(kaleoTaskAssignment.getCompanyId());
organizationKaleoTaskAssignment.setAssigneeClassName(kaleoTaskAssignment.getAssigneeClassName());
organizationKaleoTaskAssignment.setAssigneeClassPK(kaleoTaskAssignment.getAssigneeClassPK());
organizationKaleoTaskAssignments.add(organizationKaleoTaskAssignment);
}
}
return organizationKaleoTaskAssignments;
}
private DueDateCalculator _dueDateCalculator;
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 {
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.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);
@Override
@ -159,11 +166,15 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
if (transitionName.equalsIgnoreCase("registra-esito")) {
HttpServletRequest httpServletRequest = PortalUtil.getOriginalServletRequest(PortalUtil
.getHttpServletRequest(actionRequest));
String esito = httpServletRequest.getParameter("kaleo--esito--") == null ? StringPool.BLANK
: httpServletRequest.getParameter("kaleo--esito--").trim();
String testoDocumento = httpServletRequest.getParameter("kaleo--testo_del_documento--") == null ? StringPool.BLANK
: httpServletRequest.getParameter("kaleo--testo_del_documento--");
if (!valoriAmmessi.contains(esito)
String esito = httpServletRequest.getParameter(PARAMETER_ESITO);
if (esito == null) {
esito = StringPool.BLANK;
}
String testoDocumento = httpServletRequest.getParameter(PARAMETER_TESTO);
if (testoDocumento == null) {
testoDocumento = StringPool.BLANK;
}
if (!VALORI_AMMESSI.contains(esito)
|| ((esito.equalsIgnoreCase(StatoPraticaConstants.INTEGRAZIONE) || esito
.equalsIgnoreCase(StatoPraticaConstants.PREAVVISO_CONTRARIO)) && testoDocumento.isEmpty())) {
_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")) {
HttpServletRequest httpServletRequest = PortalUtil.getOriginalServletRequest(PortalUtil
.getHttpServletRequest(actionRequest));
String istruttore = httpServletRequest.getParameter("kaleo--istruttore--");
String istruttore = httpServletRequest.getParameter(PARAMETER_ISTRUTTORE);
if (Validator.isNull(istruttore)) {
_log.error("controllo validazione completamento task = " + transitionName + " - " + workflowTaskId
+ " non riuscito - istruttore non presente nel workflow");
@ -355,7 +366,7 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
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
public String render(StrutsPortletAction originalStrutsPortletAction, PortletConfig portletConfig,
@ -442,7 +453,7 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
Map<Long, String> esitiMapByWorkflowLogID = new HashMap<Long, String>();
try {
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));
for (WorkflowLog workflowLog : workflowLogs) {
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.JSONObject;
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.struts.BaseStrutsPortletAction;
import com.liferay.portal.kernel.util.ContentTypes;
@ -51,6 +53,8 @@ import com.liferay.portlet.dynamicdatamapping.util.DDMXSDUtil;
public class RenderFormTaskPortletAction extends BaseStrutsPortletAction {
private static final Log _log = LogFactoryUtil.getLog(RenderFormTaskPortletAction.class);
@Override
public String render(PortletConfig portletConfig, RenderRequest renderRequest, RenderResponse renderResponse)
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.servlet.http.HttpServletRequest;
import org.apache.commons.lang.StringUtils;
import com.liferay.portal.NoSuchWorkflowInstanceLinkException;
import com.liferay.portal.kernel.dao.orm.QueryUtil;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.json.JSONDeserializer;
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.StringPool;
import com.liferay.portal.kernel.util.StringUtil;
import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.kernel.workflow.WorkflowHandler;
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;
public class WorkflowUtil {
private static Log _log = LogFactoryUtil.getLog(WorkflowUtil.class);
public static ControlloPratica getControlloPratica(long workflowTaskId) {
@ -59,8 +57,7 @@ public class WorkflowUtil {
if (taskInstanceToken.getClassName().equals(ControlloPratica.class.getName())) {
controllo = ControlloPraticaLocalServiceUtil.getControlloPratica(taskInstanceToken.getClassPK());
}
} catch (PortalException | SystemException e) {
}
} catch (PortalException | SystemException e) {}
return controllo;
}
@ -204,11 +201,11 @@ public class WorkflowUtil {
if (name.startsWith(WorkflowConstants.PREFIX_NAME_ELEMENT_FORM)
&& name.endsWith(WorkflowConstants.SUFFIX_NAME_ELEMENT_FORM)) {
if (formParameters == null) {
formParameters = new HashMap<String, String>();
formParameters = new HashMap<>();
}
String parameterName = name.substring(WorkflowConstants.PREFIX_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);
}
}
@ -221,11 +218,11 @@ public class WorkflowUtil {
if (name.startsWith(WorkflowConstants.PREFIX_NAME_ELEMENT_FORM)
&& name.endsWith(WorkflowConstants.SUFFIX_NAME_ELEMENT_FORM)) {
if (formParameters == null) {
formParameters = new HashMap<String, String>();
formParameters = new HashMap<>();
}
String parameterName = name.substring(WorkflowConstants.PREFIX_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);
}
}

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

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

Caricamento…
Annulla
Salva