diff --git a/liferay-plugins-sdk-6.2/build.portos.properties b/liferay-plugins-sdk-6.2/build.portos.properties index 726a9c5f..c7ef7abd 100644 --- a/liferay-plugins-sdk-6.2/build.portos.properties +++ b/liferay-plugins-sdk-6.2/build.portos.properties @@ -1,3 +1,5 @@ +# Managed by Liferay IDE (remove this comment to prevent future updates) + app.server.tomcat.lib.global.dir = /home/portos/bin/liferay-portal-6.2-ce-ga6/tomcat-7.0.62/lib/ext app.server.tomcat.deploy.dir = /home/portos/bin/liferay-portal-6.2-ce-ga6/tomcat-7.0.62/webapps app.server.parent.dir = /home/portos/bin/liferay-portal-6.2-ce-ga6 diff --git a/liferay-plugins-sdk-6.2/build.root.properties b/liferay-plugins-sdk-6.2/build.root.properties deleted file mode 100644 index 786f1534..00000000 --- a/liferay-plugins-sdk-6.2/build.root.properties +++ /dev/null @@ -1,11 +0,0 @@ -# Managed by Liferay IDE (remove this comment to prevent future updates) - -#Managed by Liferay IDE (remove this comment to prevent future updates) -#Fri Sep 27 09:42:25 CEST 2019 -app.server.tomcat.lib.global.dir = /Users/mattiagosetto/Documents/mntpoint/sicilia/liferay-portal-6.2-ce-ga6/tomcat-7.0.62/lib/ext -app.server.tomcat.deploy.dir = /Users/mattiagosetto/Documents/mntpoint/sicilia/liferay-portal-6.2-ce-ga6/tomcat-7.0.62/webapps -app.server.parent.dir = /Users/mattiagosetto/Documents/mntpoint/sicilia/liferay-portal-6.2-ce-ga6 -app.server.tomcat.dir = /Users/mattiagosetto/Documents/mntpoint/sicilia/liferay-portal-6.2-ce-ga6/tomcat-7.0.62 -app.server.type = tomcat -app.server.tomcat.portal.dir = /Users/mattiagosetto/Documents/mntpoint/sicilia/liferay-portal-6.2-ce-ga6/tomcat-7.0.62/webapps/ROOT -javac.encoding = UTF-8 diff --git a/liferay-plugins-sdk-6.2/hooks/hms-taglib-hook/docroot/META-INF/custom_jsps/html/taglib/hms/input_date/page.jsp b/liferay-plugins-sdk-6.2/hooks/hms-taglib-hook/docroot/META-INF/custom_jsps/html/taglib/hms/input_date/page.jsp index 64b8fdcf..23eecb4f 100644 --- a/liferay-plugins-sdk-6.2/hooks/hms-taglib-hook/docroot/META-INF/custom_jsps/html/taglib/hms/input_date/page.jsp +++ b/liferay-plugins-sdk-6.2/hooks/hms-taglib-hook/docroot/META-INF/custom_jsps/html/taglib/hms/input_date/page.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="com.liferay.portal.kernel.util.StringPool"%> <%@page import="java.io.File"%> diff --git a/liferay-plugins-sdk-6.2/hooks/lr-arpa-al-hook/docroot/META-INF/custom_jsps/html/portlet/portal_settings/authentication/arpa.jsp b/liferay-plugins-sdk-6.2/hooks/lr-arpa-al-hook/docroot/META-INF/custom_jsps/html/portlet/portal_settings/authentication/arpa.jsp index d03b9fb4..79766e4a 100644 --- a/liferay-plugins-sdk-6.2/hooks/lr-arpa-al-hook/docroot/META-INF/custom_jsps/html/portlet/portal_settings/authentication/arpa.jsp +++ b/liferay-plugins-sdk-6.2/hooks/lr-arpa-al-hook/docroot/META-INF/custom_jsps/html/portlet/portal_settings/authentication/arpa.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%-- /** * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. diff --git a/liferay-plugins-sdk-6.2/hooks/portos-p7m-preview-hook/docroot/WEB-INF/lib/commons-logging.jar b/liferay-plugins-sdk-6.2/hooks/portos-p7m-preview-hook/docroot/WEB-INF/lib/commons-logging.jar deleted file mode 100644 index 8758a96b..00000000 Binary files a/liferay-plugins-sdk-6.2/hooks/portos-p7m-preview-hook/docroot/WEB-INF/lib/commons-logging.jar and /dev/null differ diff --git a/liferay-plugins-sdk-6.2/hooks/portos-p7m-preview-hook/docroot/WEB-INF/lib/log4j.jar b/liferay-plugins-sdk-6.2/hooks/portos-p7m-preview-hook/docroot/WEB-INF/lib/log4j.jar deleted file mode 100644 index 068867eb..00000000 Binary files a/liferay-plugins-sdk-6.2/hooks/portos-p7m-preview-hook/docroot/WEB-INF/lib/log4j.jar and /dev/null differ diff --git a/liferay-plugins-sdk-6.2/hooks/portos-p7m-preview-hook/docroot/WEB-INF/lib/util-bridges.jar b/liferay-plugins-sdk-6.2/hooks/portos-p7m-preview-hook/docroot/WEB-INF/lib/util-bridges.jar deleted file mode 100644 index 7d7435fe..00000000 Binary files a/liferay-plugins-sdk-6.2/hooks/portos-p7m-preview-hook/docroot/WEB-INF/lib/util-bridges.jar and /dev/null differ diff --git a/liferay-plugins-sdk-6.2/hooks/portos-p7m-preview-hook/docroot/WEB-INF/lib/util-taglib.jar b/liferay-plugins-sdk-6.2/hooks/portos-p7m-preview-hook/docroot/WEB-INF/lib/util-taglib.jar deleted file mode 100644 index fbba5f0a..00000000 Binary files a/liferay-plugins-sdk-6.2/hooks/portos-p7m-preview-hook/docroot/WEB-INF/lib/util-taglib.jar and /dev/null differ diff --git a/liferay-plugins-sdk-6.2/hooks/portos-p7m-preview-hook/docroot/WEB-INF/src/it/tref/liferay/portlet/p7mpreview/P7mPreview.java b/liferay-plugins-sdk-6.2/hooks/portos-p7m-preview-hook/docroot/WEB-INF/src/it/tref/liferay/portlet/p7mpreview/P7mPreview.java index 39ed7ce9..c1c6c68d 100644 --- a/liferay-plugins-sdk-6.2/hooks/portos-p7m-preview-hook/docroot/WEB-INF/src/it/tref/liferay/portlet/p7mpreview/P7mPreview.java +++ b/liferay-plugins-sdk-6.2/hooks/portos-p7m-preview-hook/docroot/WEB-INF/src/it/tref/liferay/portlet/p7mpreview/P7mPreview.java @@ -1,6 +1,8 @@ package it.tref.liferay.portlet.p7mpreview; import com.liferay.portal.kernel.lar.PortletDataContext; +import com.liferay.portal.kernel.log.Log; +import com.liferay.portal.kernel.log.LogFactoryUtil; import com.liferay.portal.kernel.repository.model.FileEntry; import com.liferay.portal.kernel.repository.model.FileVersion; import com.liferay.portal.kernel.xml.Element; @@ -8,35 +10,34 @@ import com.liferay.portlet.documentlibrary.util.DLPreviewableProcessor; import java.util.List; -public class P7mPreview extends DLPreviewableProcessor{ +public class P7mPreview extends DLPreviewableProcessor { + Log _log = LogFactoryUtil.getLog(P7mPreview.class); @Override public void afterPropertiesSet() throws Exception { // TODO Auto-generated method stub - + } @Override public boolean isSupported(String mimeType) { + _log.info("isSupported(\"" + mimeType + "\""); // TODO Auto-generated method stub return false; } @Override - protected void doExportGeneratedFiles( - PortletDataContext portletDataContext, FileEntry fileEntry, + protected void doExportGeneratedFiles(PortletDataContext portletDataContext, FileEntry fileEntry, Element fileEntryElement) throws Exception { // TODO Auto-generated method stub - + } @Override - protected void doImportGeneratedFiles( - PortletDataContext portletDataContext, FileEntry fileEntry, - FileEntry importedFileEntry, Element fileEntryElement) - throws Exception { + protected void doImportGeneratedFiles(PortletDataContext portletDataContext, FileEntry fileEntry, + FileEntry importedFileEntry, Element fileEntryElement) throws Exception { // TODO Auto-generated method stub - + } @Override diff --git a/liferay-plugins-sdk-6.2/hooks/portos-p7m-preview-hook/ivy.xml.MD5 b/liferay-plugins-sdk-6.2/hooks/portos-p7m-preview-hook/ivy.xml.MD5 index 3b053b72..65d421b8 100644 --- a/liferay-plugins-sdk-6.2/hooks/portos-p7m-preview-hook/ivy.xml.MD5 +++ b/liferay-plugins-sdk-6.2/hooks/portos-p7m-preview-hook/ivy.xml.MD5 @@ -1 +1 @@ -875e1c4437fb71ef78ec054720f63e50 +2c267788e15963b22e4e720e12f5611c diff --git a/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_bo/action_button.jsp b/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_bo/action_button.jsp index b6e680b7..66343e7c 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_bo/action_button.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_bo/action_button.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%> <%@page import="com.liferay.portal.kernel.util.HtmlUtil"%> <%@include file="init.jsp" %> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_bo/add_richiesta.jsp b/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_bo/add_richiesta.jsp index 5d699aaa..c10be4dd 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_bo/add_richiesta.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_bo/add_richiesta.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@include file="init.jsp" %>
@@ -88,7 +89,7 @@ - + @@ -118,7 +119,7 @@
- +
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_bo/init.jsp b/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_bo/init.jsp index 1cea714d..07568df7 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_bo/init.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_bo/init.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@include file="../init.jsp" %> <%@page import="javax.portlet.PortletURL"%> <%@page import="java.util.ArrayList"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_bo/show_completed_request.jsp b/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_bo/show_completed_request.jsp index e30ed433..0f46630b 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_bo/show_completed_request.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_bo/show_completed_request.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="com.liferay.portal.model.User"%> <%@page import="it.tref.liferay.portos.bo.model.Territorio"%> <%@page import="it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_bo/show_richieste.jsp b/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_bo/show_richieste.jsp index f58c558b..c19b360e 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_bo/show_richieste.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_bo/show_richieste.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.model.DettPratica"%> <%@page import="it.tref.liferay.portos.bo.service.ProvinciaLocalServiceUtil"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_bo/view.jsp b/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_bo/view.jsp index e6acbac2..a6b6232a 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_bo/view.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_bo/view.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@include file="init.jsp" %>
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_bo/view_richiesta_popup.jsp b/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_bo/view_richiesta_popup.jsp index c6c17bd7..0da26304 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_bo/view_richiesta_popup.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_bo/view_richiesta_popup.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="com.liferay.portlet.documentlibrary.util.DLUtil"%> <%@page import="com.liferay.portlet.documentlibrary.service.DLAppLocalServiceUtil"%> <%@page import="com.liferay.portlet.documentlibrary.service.DLFileEntryLocalServiceUtil"%> @@ -78,7 +79,7 @@ String docUrl = DLUtil.getPreviewURL(fileEntryDoc, fileEntryDoc.getFileVersion(), themeDisplay, StringPool.BLANK, false, true); %>
- Documento di identit: <%=fileEntryDoc.getTitle() %> + Documento di identità: <%=fileEntryDoc.getTitle() %>
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_fe/init.jsp b/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_fe/init.jsp index 69d433f3..5e1eafd9 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_fe/init.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_fe/init.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="javax.portlet.PortletURL"%> <%@page import="com.liferay.portal.model.User"%> <%@page import="com.liferay.portal.service.UserLocalServiceUtil"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_fe/richiedi-atto.jsp b/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_fe/richiedi-atto.jsp index 3c804481..d6ce6dcc 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_fe/richiedi-atto.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_fe/richiedi-atto.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@include file="init.jsp" %> <% @@ -72,7 +73,7 @@ boolean isNoCNSUser = UserLocalServiceUtil.hasRoleUser(roleNoCNS.getRoleId(), th - + @@ -103,7 +104,7 @@ boolean isNoCNSUser = UserLocalServiceUtil.hasRoleUser(roleNoCNS.getRoleId(), th
- +
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_fe/richiesta-inviata-success.jsp b/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_fe/richiesta-inviata-success.jsp index 9dffe647..8fdf5c93 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_fe/richiesta-inviata-success.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_fe/richiesta-inviata-success.jsp @@ -1,9 +1,10 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@include file="init.jsp" %>
-

La tua richiesta stata acquisita con successo. Verrai contattato alla mail da te indicata non appena la tua richiesta verr presa in gestione.

+

La tua richiesta è stata acquisita con successo. Verrai contattato alla mail da te indicata non appena la tua richiesta verrà presa in gestione.

diff --git a/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_fe/view.jsp b/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_fe/view.jsp index d6c4b299..ea877692 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_fe/view.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_fe/view.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@include file="init.jsp" %> <% @@ -9,7 +10,7 @@ boolean loggedUser = themeDisplay.isSignedIn();
- Per accedere a questa funzionalit bisogna essere loggati al portale. + Per accedere a questa funzionalità bisogna essere loggati al portale.
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_fe/visualizza-atto.jsp b/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_fe/visualizza-atto.jsp index 2768cc48..b6d6f3ec 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_fe/visualizza-atto.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/accesso_atti_fe/visualizza-atto.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="it.tref.liferay.portos.bo.util.SoggettiUtil"%> <%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%> <%@page import="it.tref.liferay.portos.bo.shared.util.PortletKeys"%> @@ -1399,7 +1400,7 @@ RichiestaAccessoAtti accettoAtti = RichiestaAccessoAttiLocalServiceUtil.getRichi

- Questo fascicolo non disponibile sotto forma digitale. Potr ritirare una copia cartacea presso uno degli Uffici del Settore Sismica. + Questo fascicolo non è disponibile sotto forma digitale. Potrà ritirare una copia cartacea presso uno degli Uffici del Settore Sismica.

diff --git a/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/creazione_account/success.jsp b/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/creazione_account/success.jsp index cc0ba11f..481185a6 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/creazione_account/success.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/creazione_account/success.jsp @@ -1,9 +1,10 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@include file="../init.jsp" %>
-

La tua registrazione andata a buon fine. Clicca qui per autenticarti al sistema.

+

La tua registrazione è andata a buon fine. Clicca qui per autenticarti al sistema.

diff --git a/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/creazione_account/view.jsp b/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/creazione_account/view.jsp index 2e3681d6..b78222b5 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/creazione_account/view.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/creazione_account/view.jsp @@ -1,7 +1,8 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@include file="../init.jsp" %> - + diff --git a/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/init.jsp b/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/init.jsp index f3db762d..11c883c0 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/init.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-accesso-atti-portlet/docroot/html/init.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="java.text.Format"%> <%@page import="com.liferay.portal.kernel.util.FastDateFormatFactoryUtil"%> <%@page import="com.liferay.portal.kernel.util.StringUtil"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/common/details_column.jsp b/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/common/details_column.jsp index 851b5a30..3b091aab 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/common/details_column.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/common/details_column.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="com.liferay.portal.kernel.util.TextFormatter"%> <%@page import="com.liferay.portal.kernel.json.JSONArray"%> <%@page import="it.tref.liferay.portos.audit.model.AuditEvent"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/common/relations_column.jsp b/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/common/relations_column.jsp index f5287023..72b2cb90 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/common/relations_column.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/common/relations_column.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="com.liferay.portal.kernel.util.TextFormatter"%> <%@page import="com.liferay.portal.kernel.json.JSONArray"%> <%@page import="it.tref.liferay.portos.audit.model.AuditEvent"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/detail/detail.jsp b/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/detail/detail.jsp index ffc929c3..94e694cc 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/detail/detail.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/detail/detail.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="it.tref.liferay.portos.audit.shared.permission.HistoryPermission"%> <%@page import="com.liferay.portal.security.permission.ActionKeys"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/detail/view.jsp b/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/detail/view.jsp index 3d6b7058..3c18f252 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/detail/view.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/detail/view.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="it.tref.liferay.portos.audit.shared.permission.HistoryPermission"%> <%@page import="com.liferay.portal.security.permission.ActionKeys"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/detail/view_list.jsp b/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/detail/view_list.jsp index f77b3e2e..ff21f2e4 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/detail/view_list.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/detail/view_list.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="it.tref.liferay.portos.audit.shared.permission.HistoryPermission"%> <%@page import="com.liferay.portal.security.permission.ActionKeys"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/init.jsp b/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/init.jsp index f6d6d4c6..71379d79 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/init.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/init.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/storicizzazione/edit.jsp b/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/storicizzazione/edit.jsp index cb89ae81..646951b9 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/storicizzazione/edit.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/storicizzazione/edit.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ include file="/html/init.jsp" %> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/storicizzazione/view.jsp b/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/storicizzazione/view.jsp index 8447c350..ff47f72b 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/storicizzazione/view.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-audit-portlet/docroot/html/storicizzazione/view.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ include file="/html/init.jsp" %> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/META-INF/custom_jsps/html/portlet/dockbar/view_user_account.jspf b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/META-INF/custom_jsps/html/portlet/dockbar/view_user_account.jspf index 060925dd..a2e9308e 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/META-INF/custom_jsps/html/portlet/dockbar/view_user_account.jspf +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/META-INF/custom_jsps/html/portlet/dockbar/view_user_account.jspf @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%-- /** * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/META-INF/custom_jsps/html/taglib/ui/form_navigator/page.jsp b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/META-INF/custom_jsps/html/taglib/ui/form_navigator/page.jsp index 1d236eb8..6c4ef8c8 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/META-INF/custom_jsps/html/taglib/ui/form_navigator/page.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/META-INF/custom_jsps/html/taglib/ui/form_navigator/page.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%-- /** * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/sync-web-service.jar b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/sync-web-service.jar new file mode 100644 index 00000000..f28d5b0f Binary files /dev/null and b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/sync-web-service.jar differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/liferay-plugin-package.properties b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/liferay-plugin-package.properties index 7c7658ac..7bcb8332 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/liferay-plugin-package.properties +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/liferay-plugin-package.properties @@ -21,4 +21,4 @@ portal-dependency-tlds=\ required-deployment-contexts=\ hms-taglib-hook,\ portos-kaleo-portlet,\ - portos-mail-manager-portlet + portos-mail-manager-portlet \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/DelegheUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/DelegheUtil.java index 3b7c9d5f..c20b4b7e 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/DelegheUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/DelegheUtil.java @@ -259,8 +259,7 @@ public class DelegheUtil { public static Soggetto getPersonaDelegaCompilazioneDomanda(long dettPraticaId) throws SystemException, PortalException { Soggetto soggetto = null; - boolean praticaIsEditable = ValidazionePraticaUtil.praticaIsEditable(dettPraticaId); - if (praticaIsEditable) { + if (ValidazionePraticaUtil.praticaIsEditable(dettPraticaId)) { DettPratica dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId); List deleghe = DelegaLocalServiceUtil.findByIntPratica_Tipologia_InEsito( dettPratica.getIntPraticaId(), DelegheUtil.TIPO_COMPILAZIONE, diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/ValidazionePraticaUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/ValidazionePraticaUtil.java index 87d2ccc6..cb2378b4 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/ValidazionePraticaUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/ValidazionePraticaUtil.java @@ -64,16 +64,12 @@ import com.liferay.portal.service.CompanyLocalServiceUtil; public class ValidazionePraticaUtil { - private static Log _log = LogFactoryUtil - .getLog(ValidazionePraticaUtil.class); + private static Log _log = LogFactoryUtil.getLog(ValidazionePraticaUtil.class); - public static boolean praticaIsEditable(long dettPraticaId) - throws PortalException, SystemException { + public static boolean praticaIsEditable(long dettPraticaId) throws PortalException, SystemException { - DettPratica dettPratica = DettPraticaServiceUtil - .getDettPratica(dettPraticaId); - IntPratica intPratica = IntPraticaServiceUtil.getIntPratica(dettPratica - .getIntPraticaId()); + DettPratica dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId); + IntPratica intPratica = IntPraticaServiceUtil.getIntPratica(dettPratica.getIntPraticaId()); return !intPratica.getSospesa() && !intPratica.isAnnullata() && !AsseverazioniUtil.hasAsseverazioniAttive(dettPraticaId) @@ -81,48 +77,36 @@ public class ValidazionePraticaUtil { && dettPratica.getStatus() == WorkflowConstants.STATUS_DRAFT; } - public static boolean praticaIsCompleta(long dettPraticaId) - throws SystemException, PortalException { + public static boolean praticaIsCompleta(long dettPraticaId) throws SystemException, PortalException { - return isDettagliPrincipaliCompleta(dettPraticaId) - && isAnagrafeSoggettiCompleta(dettPraticaId) - && isDescrizioneEdificioCompleta(dettPraticaId) - && isSezioneGeologicaCompleta(dettPraticaId) + return isDettagliPrincipaliCompleta(dettPraticaId) && isAnagrafeSoggettiCompleta(dettPraticaId) + && isDescrizioneEdificioCompleta(dettPraticaId) && isSezioneGeologicaCompleta(dettPraticaId) && isSezioneAllegatiCompleta(dettPraticaId); } - public static boolean canEditPratica(long intPraticaId) - throws PortalException, SystemException { + public static boolean canEditPratica(long intPraticaId) throws PortalException, SystemException { - IntPratica intPratica = IntPraticaServiceUtil - .getIntPratica(intPraticaId); + IntPratica intPratica = IntPraticaServiceUtil.getIntPratica(intPraticaId); - return (intPratica.getStatus() == WorkflowConstants.STATUS_ANY || intPratica - .getStatus() == WorkflowConstants.STATUS_INCOMPLETE); + return (intPratica.getStatus() == WorkflowConstants.STATUS_ANY || intPratica.getStatus() == WorkflowConstants.STATUS_INCOMPLETE); } - public static boolean canDeletePratica(long intPraticaId, long userId) - throws PortalException, SystemException { + public static boolean canDeletePratica(long intPraticaId, long userId) throws PortalException, + SystemException { - IntPratica intPratica = IntPraticaServiceUtil - .getIntPratica(intPraticaId); - DettPratica dettPratica = DettPraticaServiceUtil - .getLastEditableByIntPratica(intPraticaId); + IntPratica intPratica = IntPraticaServiceUtil.getIntPratica(intPraticaId); + DettPratica dettPratica = DettPraticaServiceUtil.getLastEditableByIntPratica(intPraticaId); return (intPratica.getStatus() == WorkflowConstants.STATUS_ANY || (dettPratica != null && dettPratica .getStatus() == WorkflowConstants.STATUS_DRAFT) - && Validator.isNull(dettPratica.getTipoIntegrazione())) - && intPratica.getUserId() == userId; + && Validator.isNull(dettPratica.getTipoIntegrazione())) && intPratica.getUserId() == userId; } - public static boolean canEditUsers(long intPraticaId) - throws PortalException, SystemException { + public static boolean canEditUsers(long intPraticaId) throws PortalException, SystemException { - IntPratica intPratica = IntPraticaServiceUtil - .getIntPratica(intPraticaId); + IntPratica intPratica = IntPraticaServiceUtil.getIntPratica(intPraticaId); - return !intPratica.isSospesa() && !intPratica.isAnnullata() - && !canEditPratica(intPraticaId) + return !intPratica.isSospesa() && !intPratica.isAnnullata() && !canEditPratica(intPraticaId) && !praticaHasVarianteInProgress(intPraticaId) && !praticaHasRichiestaIntegrazioneAttiva(intPraticaId) && !praticaHasIntegrazioneInProgress(intPraticaId) @@ -130,155 +114,127 @@ public class ValidazionePraticaUtil { && !praticaHasCollaudoInProgress(intPraticaId); } - public static boolean canCompleteUserEditing(long dettPraticaId) - throws SystemException, PortalException { + public static boolean canCompleteUserEditing(long dettPraticaId) throws SystemException, PortalException { - DettPratica dettPratica = DettPraticaServiceUtil - .getDettPratica(dettPraticaId); - IntPratica intPratica = IntPraticaServiceUtil.getIntPratica(dettPratica - .getIntPraticaId()); + DettPratica dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId); + IntPratica intPratica = IntPraticaServiceUtil.getIntPratica(dettPratica.getIntPraticaId()); return isAnagrafeSoggettiCompleta(dettPraticaId) && intPratica.getStatus() != WorkflowConstants.STATUS_ANY && intPratica.getStatus() != WorkflowConstants.STATUS_INCOMPLETE - && TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equals(dettPratica - .getTipoIntegrazione()); + && TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equals(dettPratica.getTipoIntegrazione()); } - public static boolean canAddPagamento(long intPraticaId, long userId) - throws SystemException, PortalException { + public static boolean canAddPagamento(long intPraticaId, long userId) throws SystemException, + PortalException { - DettPratica dettPratica = DettPraticaServiceUtil - .getLastEditableByIntPratica(intPraticaId); + DettPratica dettPratica = DettPraticaServiceUtil.getLastEditableByIntPratica(intPraticaId); if (Validator.isNull(dettPratica)) { return false; } return pagamentoIsEnable(dettPratica.getDettPraticaId()) - && DelegheUtil.hasDelegaPagamento(userId, - dettPratica.getDettPraticaId()); + && DelegheUtil.hasDelegaPagamento(userId, dettPratica.getDettPraticaId()); } - public static boolean praticaInProgress(long intPraticaId) - throws SystemException, PortalException { + public static boolean praticaInProgress(long intPraticaId) throws SystemException, PortalException { - IntPratica intPratica = IntPraticaServiceUtil - .getIntPratica(intPraticaId); - DettPratica dettPratica = DettPraticaServiceUtil - .getLastEditabledByIntPraticaAndTipoPratica(intPraticaId, - Arrays.asList(TipoIntegrazioneUtil.VARIANTE, - TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE, + IntPratica intPratica = IntPraticaServiceUtil.getIntPratica(intPraticaId); + DettPratica dettPratica = DettPraticaServiceUtil.getLastEditabledByIntPraticaAndTipoPratica( + intPraticaId, Arrays + .asList(TipoIntegrazioneUtil.VARIANTE, TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE, TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO)); - return Validator.isNotNull(dettPratica) - || intPratica.getStatus() == WorkflowConstants.STATUS_ANY + return Validator.isNotNull(dettPratica) || intPratica.getStatus() == WorkflowConstants.STATUS_ANY || intPratica.getStatus() == WorkflowConstants.STATUS_INCOMPLETE; } - public static boolean praticaCanAddVariante(long intPraticaId) - throws SystemException, PortalException { + public static boolean praticaCanAddVariante(long intPraticaId) throws SystemException, PortalException { - IntPratica intPratica = IntPraticaServiceUtil - .getIntPratica(intPraticaId); - DettPratica dettPratica = DettPraticaServiceUtil - .getLastEditabledByIntPraticaAndTipoPratica(intPraticaId, - Arrays.asList(TipoIntegrazioneUtil.VARIANTE)); + IntPratica intPratica = IntPraticaServiceUtil.getIntPratica(intPraticaId); + DettPratica dettPratica = DettPraticaServiceUtil.getLastEditabledByIntPraticaAndTipoPratica( + intPraticaId, Arrays.asList(TipoIntegrazioneUtil.VARIANTE)); if (Validator.isNotNull(dettPratica)) { return false; } return intPratica.getStatus() != WorkflowConstants.STATUS_ANY && intPratica.getStatus() != WorkflowConstants.STATUS_INCOMPLETE - && !intPratica.getStatoPratica().equals( - StatoPraticaConstants.INTEGRAZIONE) + && !intPratica.getStatoPratica().equals(StatoPraticaConstants.INTEGRAZIONE) && !praticaHasIntegrazioneInProgress(intPraticaId); } - public static boolean praticaCanEditVariante(long intPraticaId) - throws SystemException, PortalException { + public static boolean praticaCanEditVariante(long intPraticaId) throws SystemException, PortalException { return praticaHasVarianteInProgress(intPraticaId); } - public static boolean praticaCanDeleteVariante(long intPraticaId) - throws SystemException, PortalException { + public static boolean praticaCanDeleteVariante(long intPraticaId) throws SystemException, PortalException { return praticaHasVarianteInProgress(intPraticaId); } - public static boolean praticaHasVarianteInProgress(long intPraticaId) - throws SystemException, PortalException { + public static boolean praticaHasVarianteInProgress(long intPraticaId) throws SystemException, + PortalException { - DettPratica dettPratica = DettPraticaServiceUtil - .getLastEditabledByIntPraticaAndTipoPratica(intPraticaId, - Arrays.asList(TipoIntegrazioneUtil.VARIANTE)); + DettPratica dettPratica = DettPraticaServiceUtil.getLastEditabledByIntPraticaAndTipoPratica( + intPraticaId, Arrays.asList(TipoIntegrazioneUtil.VARIANTE)); if (Validator.isNotNull(dettPratica)) { return true; } return false; } - public static boolean praticaCanAddIntegrazione(long intPraticaId) - throws SystemException, PortalException { + public static boolean praticaCanAddIntegrazione(long intPraticaId) throws SystemException, + PortalException { - IntPratica intPratica = IntPraticaServiceUtil - .getIntPratica(intPraticaId); - DettPratica dettPratica = DettPraticaServiceUtil - .getLastEditabledByIntPraticaAndTipoPratica( - intPraticaId, - Arrays.asList(TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE)); + IntPratica intPratica = IntPraticaServiceUtil.getIntPratica(intPraticaId); + DettPratica dettPratica = DettPraticaServiceUtil.getLastEditabledByIntPraticaAndTipoPratica( + intPraticaId, Arrays.asList(TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE)); if (Validator.isNotNull(dettPratica)) { return false; } return intPratica.getStatus() != WorkflowConstants.STATUS_ANY && intPratica.getStatus() != WorkflowConstants.STATUS_INCOMPLETE - && intPratica.getStatoPratica().equals( - StatoPraticaConstants.INTEGRAZIONE); + && intPratica.getStatoPratica().equals(StatoPraticaConstants.INTEGRAZIONE); } - public static boolean praticaCanEditIntegrazione(long intPraticaId) - throws SystemException, PortalException { + public static boolean praticaCanEditIntegrazione(long intPraticaId) throws SystemException, + PortalException { return praticaHasIntegrazioneInProgress(intPraticaId); } - public static boolean praticaCanDeleteIntegrazione(long intPraticaId) - throws SystemException, PortalException { + public static boolean praticaCanDeleteIntegrazione(long intPraticaId) throws SystemException, + PortalException { return praticaHasIntegrazioneInProgress(intPraticaId); } - public static boolean praticaHasRichiestaIntegrazioneAttiva( - long intPraticaId) throws SystemException, PortalException { + public static boolean praticaHasRichiestaIntegrazioneAttiva(long intPraticaId) throws SystemException, + PortalException { - IntPratica intPratica = IntPraticaServiceUtil - .getIntPratica(intPraticaId); - return intPratica.getStatoPratica().equals( - StatoPraticaConstants.INTEGRAZIONE); + IntPratica intPratica = IntPraticaServiceUtil.getIntPratica(intPraticaId); + return intPratica.getStatoPratica().equals(StatoPraticaConstants.INTEGRAZIONE); } - public static boolean praticaHasIntegrazioneInProgress(long intPraticaId) - throws SystemException, PortalException { + public static boolean praticaHasIntegrazioneInProgress(long intPraticaId) throws SystemException, + PortalException { - DettPratica dettPratica = DettPraticaServiceUtil - .getLastEditabledByIntPraticaAndTipoPratica( - intPraticaId, - Arrays.asList(TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE)); + DettPratica dettPratica = DettPraticaServiceUtil.getLastEditabledByIntPraticaAndTipoPratica( + intPraticaId, Arrays.asList(TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE)); return Validator.isNotNull(dettPratica); } - public static boolean praticaHasAnnullamento(long intPraticaId) - throws SystemException, PortalException { + public static boolean praticaHasAnnullamento(long intPraticaId) throws SystemException, PortalException { - IntPratica intPratica = IntPraticaServiceUtil - .getIntPratica(intPraticaId); + IntPratica intPratica = IntPraticaServiceUtil.getIntPratica(intPraticaId); return Validator.isNotNull(intPratica) && intPratica.isAnnullata(); } - public static boolean praticaCanAddFineLavori(long intPraticaId, - String userScreenName) throws SystemException, PortalException { + public static boolean praticaCanAddFineLavori(long intPraticaId, String userScreenName) + throws SystemException, PortalException { - DettPratica dettPratica = DettPraticaServiceUtil - .getLastCompletedByIntPratica(intPraticaId); + DettPratica dettPratica = DettPraticaServiceUtil.getLastCompletedByIntPratica(intPraticaId); // return Validator.isNotNull(dettPratica) // && @@ -291,43 +247,35 @@ public class ValidazionePraticaUtil { // && !praticaHasIntegrazioneInProgress(intPraticaId); return Validator.isNotNull(dettPratica) - && userScreenName.equalsIgnoreCase(dettPratica - .getCodiceFiscaleDelegatoFineLavori()) - && FineLavoriLocalServiceUtil - .countByIntPraticaId_Parziale_Completata(intPraticaId, - false, true) == 0 - && !praticaHasFineLavoriInProgress(intPraticaId) + && userScreenName.equalsIgnoreCase(dettPratica.getCodiceFiscaleDelegatoFineLavori()) + && FineLavoriLocalServiceUtil.countByIntPraticaId_Parziale_Completata(intPraticaId, false, + true) == 0 && !praticaHasFineLavoriInProgress(intPraticaId) && !praticaHasVarianteInProgress(intPraticaId) && !praticaHasIntegrazioneInProgress(intPraticaId); } - public static boolean praticaCanEditFineLavori(long intPraticaId, - String userScreenName) throws SystemException, PortalException { + public static boolean praticaCanEditFineLavori(long intPraticaId, String userScreenName) + throws SystemException, PortalException { - DettPratica dettPratica = DettPraticaServiceUtil - .getLastCompletedByIntPratica(intPraticaId); + DettPratica dettPratica = DettPraticaServiceUtil.getLastCompletedByIntPratica(intPraticaId); return Validator.isNotNull(dettPratica) - && userScreenName.equalsIgnoreCase(dettPratica - .getCodiceFiscaleDelegatoFineLavori()) + && userScreenName.equalsIgnoreCase(dettPratica.getCodiceFiscaleDelegatoFineLavori()) && praticaHasFineLavoriInProgress(intPraticaId); } - public static boolean praticaCanDeleteFineLavori(long intPraticaId, - String userScreenName) throws SystemException, PortalException { + public static boolean praticaCanDeleteFineLavori(long intPraticaId, String userScreenName) + throws SystemException, PortalException { - DettPratica dettPratica = DettPraticaServiceUtil - .getLastCompletedByIntPratica(intPraticaId); + DettPratica dettPratica = DettPraticaServiceUtil.getLastCompletedByIntPratica(intPraticaId); return Validator.isNotNull(dettPratica) - && userScreenName.equalsIgnoreCase(dettPratica - .getCodiceFiscaleDelegatoFineLavori()) + && userScreenName.equalsIgnoreCase(dettPratica.getCodiceFiscaleDelegatoFineLavori()) && praticaHasFineLavoriPaymentPending(intPraticaId); } - public static boolean praticaHasFineLavoriInProgress(long intPraticaId) - throws SystemException, PortalException { + public static boolean praticaHasFineLavoriInProgress(long intPraticaId) throws SystemException, + PortalException { - FineLavori fineLavori = FineLavoriServiceUtil - .getLastEditable(intPraticaId); + FineLavori fineLavori = FineLavoriServiceUtil.getLastEditable(intPraticaId); return Validator.isNotNull(fineLavori); // if (Validator.isNotNull(fineLavori) && // Validator.isNull(fineLavori.getPagamentoId())) { @@ -336,59 +284,49 @@ public class ValidazionePraticaUtil { // return false; } - public static boolean praticaHasFineLavoriPaymentPending(long intPraticaId) - throws SystemException, PortalException { + public static boolean praticaHasFineLavoriPaymentPending(long intPraticaId) throws SystemException, + PortalException { - FineLavori fineLavori = FineLavoriServiceUtil - .getLastEditable(intPraticaId); - if (Validator.isNotNull(fineLavori) - && Validator.isNull(fineLavori.getPagamentoId())) { + FineLavori fineLavori = FineLavoriServiceUtil.getLastEditable(intPraticaId); + if (Validator.isNotNull(fineLavori) && Validator.isNull(fineLavori.getPagamentoId())) { return true; } return false; } - public static boolean praticaCanAddCollaudo(long intPraticaId, - String userScreenName) throws SystemException, PortalException { + public static boolean praticaCanAddCollaudo(long intPraticaId, String userScreenName) + throws SystemException, PortalException { - DettPratica dettPratica = DettPraticaServiceUtil - .getLastCompletedByIntPratica(intPraticaId); + DettPratica dettPratica = DettPraticaServiceUtil.getLastCompletedByIntPratica(intPraticaId); return Validator.isNotNull(dettPratica) - && userScreenName.equalsIgnoreCase(dettPratica - .getCodiceFiscaleDelegatoCollaudo()) + && userScreenName.equalsIgnoreCase(dettPratica.getCodiceFiscaleDelegatoCollaudo()) && FineLavoriLocalServiceUtil.countByIntPraticaId(intPraticaId) > 0 - && CollaudoLocalServiceUtil.countByIntPraticaId_Completata( - intPraticaId, false) == 0 - && !praticaHasCollaudoInProgress(intPraticaId) - && !praticaHasVarianteInProgress(intPraticaId) + && CollaudoLocalServiceUtil.countByIntPraticaId_Completata(intPraticaId, false) == 0 + && !praticaHasCollaudoInProgress(intPraticaId) && !praticaHasVarianteInProgress(intPraticaId) && !praticaHasIntegrazioneInProgress(intPraticaId); } - public static boolean praticaCanEditCollaudo(long intPraticaId, - String userScreenName) throws SystemException, PortalException { + public static boolean praticaCanEditCollaudo(long intPraticaId, String userScreenName) + throws SystemException, PortalException { - DettPratica dettPratica = DettPraticaServiceUtil - .getLastCompletedByIntPratica(intPraticaId); + DettPratica dettPratica = DettPraticaServiceUtil.getLastCompletedByIntPratica(intPraticaId); return Validator.isNotNull(dettPratica) - && userScreenName.equalsIgnoreCase(dettPratica - .getCodiceFiscaleDelegatoCollaudo()) + && userScreenName.equalsIgnoreCase(dettPratica.getCodiceFiscaleDelegatoCollaudo()) && praticaHasCollaudoInProgress(intPraticaId); } - public static boolean praticaCanDeleteCollaudo(long intPraticaId, - String userScreenName) throws SystemException, PortalException { + public static boolean praticaCanDeleteCollaudo(long intPraticaId, String userScreenName) + throws SystemException, PortalException { - DettPratica dettPratica = DettPraticaServiceUtil - .getLastCompletedByIntPratica(intPraticaId); + DettPratica dettPratica = DettPraticaServiceUtil.getLastCompletedByIntPratica(intPraticaId); return Validator.isNotNull(dettPratica) - && userScreenName.equalsIgnoreCase(dettPratica - .getCodiceFiscaleDelegatoCollaudo()) + && userScreenName.equalsIgnoreCase(dettPratica.getCodiceFiscaleDelegatoCollaudo()) && praticaHasCollaudoPaymentPending(intPraticaId); } - public static boolean praticaHasCollaudoInProgress(long intPraticaId) - throws SystemException, PortalException { + public static boolean praticaHasCollaudoInProgress(long intPraticaId) throws SystemException, + PortalException { Collaudo collaudo = CollaudoServiceUtil.getLastEditable(intPraticaId); return Validator.isNotNull(collaudo); @@ -399,141 +337,109 @@ public class ValidazionePraticaUtil { // return false; } - public static boolean praticaHasCollaudoPaymentPending(long intPraticaId) - throws SystemException, PortalException { + public static boolean praticaHasCollaudoPaymentPending(long intPraticaId) throws SystemException, + PortalException { Collaudo collaudo = CollaudoServiceUtil.getLastEditable(intPraticaId); - if (Validator.isNotNull(collaudo) - && Validator.isNull(collaudo.getPagamentoId())) { + if (Validator.isNotNull(collaudo) && Validator.isNull(collaudo.getPagamentoId())) { return true; } return false; } - public static boolean asseverazioniIsEnable(long dettPraticaId) - throws SystemException, PortalException { + public static boolean asseverazioniIsEnable(long dettPraticaId) throws SystemException, PortalException { - DettPratica dettPratica = DettPraticaServiceUtil - .getDettPratica(dettPraticaId); + DettPratica dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId); return AsseverazioniUtil.hasAsseverazioniAttive(dettPraticaId) || (dettPratica.getStatus() == WorkflowConstants.STATUS_DRAFT - && SoggettoLocalServiceUtil - .countValidTmpByIntPratica(dettPratica - .getIntPraticaId()) > 0 + && SoggettoLocalServiceUtil.countValidTmpByIntPratica(dettPratica.getIntPraticaId()) > 0 && praticaIsCompleta(dettPraticaId) && !DelegheUtil .hasDelegheCompilazioneAttive(dettPraticaId)); } - public static boolean pagamentoIsEnable(long dettPraticaId) - throws SystemException, PortalException { + public static boolean pagamentoIsEnable(long dettPraticaId) throws SystemException, PortalException { - DettPratica dettPratica = DettPraticaServiceUtil - .getDettPratica(dettPraticaId); - IntPratica intPratica = IntPraticaServiceUtil.getIntPratica(dettPratica - .getIntPraticaId()); + DettPratica dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId); + IntPratica intPratica = IntPraticaServiceUtil.getIntPratica(dettPratica.getIntPraticaId()); // && asseverazioniIsCompleted(dettPraticaId); - return praticaIsCompleta(dettPraticaId) - && !DelegheUtil.hasDelegheCompilazioneAttive(dettPraticaId) + return praticaIsCompleta(dettPraticaId) && !DelegheUtil.hasDelegheCompilazioneAttive(dettPraticaId) && AsseverazioniUtil.allAsseverazioniCompleted(dettPraticaId) // se è un'integrazione non si paga - && !intPratica.getStatoPratica().equals( - StatoPraticaConstants.INTEGRAZIONE); + && !intPratica.getStatoPratica().equals(StatoPraticaConstants.INTEGRAZIONE); } - public static boolean canCompleteDettPraticaEsente(long dettPraticaId) - throws SystemException, PortalException { + public static boolean canCompleteDettPraticaEsente(long dettPraticaId) throws SystemException, + PortalException { - DettPratica dettPratica = DettPraticaServiceUtil - .getDettPratica(dettPraticaId); - IntPratica intPratica = IntPraticaServiceUtil.getIntPratica(dettPratica - .getIntPraticaId()); + DettPratica dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId); + IntPratica intPratica = IntPraticaServiceUtil.getIntPratica(dettPratica.getIntPraticaId()); - return praticaIsCompleta(dettPraticaId) - && !DelegheUtil.hasDelegheCompilazioneAttive(dettPraticaId) - && AsseverazioniUtil.allAsseverazioniCompleted(dettPraticaId) - && !dettPratica.isCompleta() - && !intPratica.getStatoPratica().equals( - StatoPraticaConstants.INTEGRAZIONE); + return praticaIsCompleta(dettPraticaId) && !DelegheUtil.hasDelegheCompilazioneAttive(dettPraticaId) + && AsseverazioniUtil.allAsseverazioniCompleted(dettPraticaId) && !dettPratica.isCompleta() + && !intPratica.getStatoPratica().equals(StatoPraticaConstants.INTEGRAZIONE); } - public static boolean canCompleteIntegrazione(long dettPraticaId) - throws SystemException, PortalException { + public static boolean canCompleteIntegrazione(long dettPraticaId) throws SystemException, PortalException { - DettPratica dettPratica = DettPraticaServiceUtil - .getDettPratica(dettPraticaId); - IntPratica intPratica = IntPraticaServiceUtil.getIntPratica(dettPratica - .getIntPraticaId()); + DettPratica dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId); + IntPratica intPratica = IntPraticaServiceUtil.getIntPratica(dettPratica.getIntPraticaId()); return praticaIsCompleta(dettPraticaId) && !DelegheUtil.hasDelegheCompilazioneAttive(dettPraticaId) && AsseverazioniUtil.allAsseverazioniCompleted(dettPraticaId) - && (intPratica.getStatoPratica().equals( - StatoPraticaConstants.INTEGRAZIONE) || dettPratica - .getTipoIntegrazione().equals( - TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE)) + && (intPratica.getStatoPratica().equals(StatoPraticaConstants.INTEGRAZIONE) || dettPratica + .getTipoIntegrazione().equals(TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE)) && dettPratica.getStatus() != WorkflowConstants.STATUS_APPROVED; } - public static boolean praticaCanAbort(long intPraticaId, long userId) - throws SystemException, PortalException { + public static boolean praticaCanAbort(long intPraticaId, long userId) throws SystemException, + PortalException { - IntPratica intPratica = IntPraticaServiceUtil - .getIntPratica(intPraticaId); + IntPratica intPratica = IntPraticaServiceUtil.getIntPratica(intPraticaId); - return Validator.isNotNull(intPratica) - && intPratica.getUserId() == userId + return Validator.isNotNull(intPratica) && intPratica.getUserId() == userId && intPratica.getStatus() != WorkflowConstants.STATUS_ANY && intPratica.getStatus() != WorkflowConstants.STATUS_INCOMPLETE && !praticaHasRichiestaIntegrazioneAttiva(intPraticaId) - && !praticaHasIntegrazioneInProgress(intPraticaId) - && !praticaHasAnnullamento(intPraticaId); + && !praticaHasIntegrazioneInProgress(intPraticaId) && !praticaHasAnnullamento(intPraticaId); } - public static boolean pagamentoFineLavoriIsEnable(long fineLavoriId) - throws SystemException, PortalException { + public static boolean pagamentoFineLavoriIsEnable(long fineLavoriId) throws SystemException, + PortalException { - return isFineLavoriDatiCompleted(fineLavoriId) - && isFineLavoriAllegatiCompleted(fineLavoriId); + return isFineLavoriDatiCompleted(fineLavoriId) && isFineLavoriAllegatiCompleted(fineLavoriId); } - public static boolean canCompleteFineLavoriEsente(long fineLavoriId) - throws SystemException, PortalException { + public static boolean canCompleteFineLavoriEsente(long fineLavoriId) throws SystemException, + PortalException { - FineLavori fineLavori = FineLavoriServiceUtil - .getFineLavori(fineLavoriId); - return pagamentoFineLavoriIsEnable(fineLavoriId) - && fineLavori.getNormEsenteBollo(); + FineLavori fineLavori = FineLavoriServiceUtil.getFineLavori(fineLavoriId); + return pagamentoFineLavoriIsEnable(fineLavoriId) && fineLavori.getNormEsenteBollo(); } - public static boolean pagamentoCollaudoIsEnable(long collaudoId) - throws SystemException, PortalException { + public static boolean pagamentoCollaudoIsEnable(long collaudoId) throws SystemException, PortalException { - return isCollaudoDatiCompleted(collaudoId) - && isCollaudoAllegatiCompleted(collaudoId); + return isCollaudoDatiCompleted(collaudoId) && isCollaudoAllegatiCompleted(collaudoId); } - public static boolean canCompleteCollaudoEsente(long collaudoId) - throws SystemException, PortalException { + public static boolean canCompleteCollaudoEsente(long collaudoId) throws SystemException, PortalException { Collaudo collaudo = CollaudoServiceUtil.getCollaudo(collaudoId); - return pagamentoCollaudoIsEnable(collaudoId) - && collaudo.getNormEsenteBollo(); + return pagamentoCollaudoIsEnable(collaudoId) && collaudo.getNormEsenteBollo(); } - public static boolean delegheCompilazioneIsEnable(long dettPraticaId) - throws SystemException, PortalException { + public static boolean delegheCompilazioneIsEnable(long dettPraticaId) throws SystemException, + PortalException { - DettPratica dettPratica = DettPraticaServiceUtil - .getDettPratica(dettPraticaId); - return SoggettoLocalServiceUtil.countValidTmpByIntPratica(dettPratica - .getIntPraticaId()) > 0 + DettPratica dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId); + return SoggettoLocalServiceUtil.countValidTmpByIntPratica(dettPratica.getIntPraticaId()) > 0 && !AsseverazioniUtil.hasAsseverazioniAttive(dettPraticaId); // && asseverazioniIsCompleted(dettPraticaId); } - public static boolean isSectionCompleted(String section, long dettPraticaId) - throws PortalException, SystemException { + public static boolean isSectionCompleted(String section, long dettPraticaId) throws PortalException, + SystemException { switch (section) { case SezioniUtil.SEZIONE_DETTAGLI_PRINCIPALI: @@ -552,8 +458,8 @@ public class ValidazionePraticaUtil { } - public static List notCompletedSection(String section, - long dettPraticaId) throws PortalException, SystemException { + public static List notCompletedSection(String section, long dettPraticaId) + throws PortalException, SystemException { switch (section) { case SezioniUtil.SEZIONE_DETTAGLI_PRINCIPALI: @@ -572,58 +478,47 @@ public class ValidazionePraticaUtil { } - public static boolean isDelegaGeologoCompleted(long dettPraticaId) - throws PortalException, SystemException { + public static boolean isDelegaGeologoCompleted(long dettPraticaId) throws PortalException, + SystemException { return hasDelegaGeologoCompleted(dettPraticaId).isEmpty(); } - public static List hasDelegaGeologoCompleted(long dettPraticaId) - throws PortalException, SystemException { + public static List hasDelegaGeologoCompleted(long dettPraticaId) throws PortalException, + SystemException { List notCompleted = notCompletedDatiSezionGeologica(dettPraticaId); - notCompleted - .addAll(notCompletedAllegatiSezionGeologicaDelega(dettPraticaId)); + notCompleted.addAll(notCompletedAllegatiSezionGeologicaDelega(dettPraticaId)); return notCompleted; } - private static boolean isDettagliPrincipaliCompleta(long dettPraticaId) - throws PortalException, SystemException { + private static boolean isDettagliPrincipaliCompleta(long dettPraticaId) throws PortalException, + SystemException { - DettPratica dettPratica = DettPraticaServiceUtil - .getDettPratica(dettPraticaId); - IntPratica intPratica = IntPraticaServiceUtil.getIntPratica(dettPratica - .getIntPraticaId()); - Territorio territorio = TerritorioLocalServiceUtil - .getTerritorio(intPratica.getTerritorioId()); + DettPratica dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId); + IntPratica intPratica = IntPraticaServiceUtil.getIntPratica(dettPratica.getIntPraticaId()); + Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId()); boolean ag = true; - if (!territorio.getZona().equals("2") - && !territorio.getZona().equals("4")) { + if (!territorio.getZona().equals("2") && !territorio.getZona().equals("4")) { ag = Validator.isNotNull(dettPratica.getAg()); } - boolean aiSensi = AzioniPraticheUtil.isDeposito(intPratica - .getIntPraticaId()) ? (dettPratica.getNormDpr01Dep() || dettPratica - .getNormDpr02Dep()) - : (dettPratica.getNormDpr01Aut() || dettPratica - .getNormDpr02Aut()); + boolean aiSensi = AzioniPraticheUtil.isDeposito(intPratica.getIntPraticaId()) ? (dettPratica + .getNormDpr01Dep() || dettPratica.getNormDpr02Dep()) + : (dettPratica.getNormDpr01Aut() || dettPratica.getNormDpr02Aut()); - boolean nelRispetto = dettPratica.getNormDm01() - || dettPratica.getNormDm02() || dettPratica.getNormDm2018(); + boolean nelRispetto = dettPratica.getNormDm01() || dettPratica.getNormDm02() + || dettPratica.getNormDm2018(); boolean sismaBonus = !dettPratica.getNormSismaBonus() - || (Validator.isNotNull(dettPratica.getClRischioPreInt()) || Validator - .isNotNull(dettPratica.getClRischioPostInt())); + || (Validator.isNotNull(dettPratica.getClRischioPreInt()) || Validator.isNotNull(dettPratica + .getClRischioPostInt())); // ADT BUG ID = 17 - boolean tipologiaCostruttiva = intPratica.getTipoProcedura() - .equalsIgnoreCase(Constants.PROCEDURA_C) - || dettPratica.getTcInCA() - || dettPratica.getTcInAcciaio() - || dettPratica.getTcInMuratura() - || dettPratica.getTcInLegno() - || dettPratica.getTcAltro(); + boolean tipologiaCostruttiva = intPratica.getTipoProcedura().equalsIgnoreCase(Constants.PROCEDURA_C) + || dettPratica.getTcInCA() || dettPratica.getTcInAcciaio() || dettPratica.getTcInMuratura() + || dettPratica.getTcInLegno() || dettPratica.getTcAltro(); boolean intervFinPub = !dettPratica.getIntervFinPub() || Validator.isNotNull(dettPratica.getIntervFinPubDesc()); boolean controllo = ag @@ -634,55 +529,44 @@ public class ValidazionePraticaUtil { && intervFinPub && Validator.isNotNull(dettPratica.getDescLongIntervento()) && Validator.isNotNull(dettPratica.getDestinazione()) - && (dettPratica.getTcNuovaCostruzione() - || dettPratica.getTcMiglioramentoSismico() - || dettPratica.getTcAdeguamentoSismico() || dettPratica - .getTcRiparazioneInterventoLocale() - || dettPratica.getTcNuovaCostruzioneComplessa() - ) && Validator.isNotNull(dettPratica.getVia()); - - boolean coordinateGeografiche = Validator.isNotNull(dettPratica - .getLocalizzazioneGeografica()) - && !("|||".equalsIgnoreCase(dettPratica - .getLocalizzazioneGeografica())); + && (dettPratica.getTcNuovaCostruzione() || dettPratica.getTcMiglioramentoSismico() + || dettPratica.getTcAdeguamentoSismico() + || dettPratica.getTcRiparazioneInterventoLocale() || dettPratica + .getTcNuovaCostruzioneComplessa()) && Validator.isNotNull(dettPratica.getVia()); + + boolean coordinateGeografiche = Validator.isNotNull(dettPratica.getLocalizzazioneGeografica()) + && !("|||".equalsIgnoreCase(dettPratica.getLocalizzazioneGeografica())); return controllo && coordinateGeografiche; } - private static List notCompletedDettagliPrincipali( - long dettPraticaId) throws PortalException, SystemException { + private static List notCompletedDettagliPrincipali(long dettPraticaId) throws PortalException, + SystemException { - DettPratica dettPratica = DettPraticaServiceUtil - .getDettPratica(dettPraticaId); + DettPratica dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId); List notCompleted = new ArrayList<>(); - IntPratica intPratica = IntPraticaServiceUtil.getIntPratica(dettPratica - .getIntPraticaId()); - Territorio territorio = TerritorioLocalServiceUtil - .getTerritorio(intPratica.getTerritorioId()); - if (!territorio.getZona().equals("2") - && !territorio.getZona().equals("4") + IntPratica intPratica = IntPraticaServiceUtil.getIntPratica(dettPratica.getIntPraticaId()); + Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId()); + if (!territorio.getZona().equals("2") && !territorio.getZona().equals("4") && Validator.isNull(dettPratica.getAg())) { notCompleted.add("ag"); } - boolean aiSensi = AzioniPraticheUtil.isDeposito(intPratica - .getIntPraticaId()) ? (dettPratica.getNormDpr01Dep() || dettPratica - .getNormDpr02Dep()) - : (dettPratica.getNormDpr01Aut() || dettPratica - .getNormDpr02Aut()); + boolean aiSensi = AzioniPraticheUtil.isDeposito(intPratica.getIntPraticaId()) ? (dettPratica + .getNormDpr01Dep() || dettPratica.getNormDpr02Dep()) + : (dettPratica.getNormDpr01Aut() || dettPratica.getNormDpr02Aut()); if (!aiSensi) { notCompleted.add("at-least-aiSensi"); } - boolean nelRispetto = dettPratica.getNormDm01() - || dettPratica.getNormDm02() || dettPratica.getNormDm2018(); + boolean nelRispetto = dettPratica.getNormDm01() || dettPratica.getNormDm02() + || dettPratica.getNormDm2018(); if (!nelRispetto) { notCompleted.add("at-least-nelRispetto"); } - if (dettPratica.getNormSismaBonus() - && Validator.isNull(dettPratica.getClRischioPreInt()) + if (dettPratica.getNormSismaBonus() && Validator.isNull(dettPratica.getClRischioPreInt()) && Validator.isNull(dettPratica.getClRischioPostInt())) { if (Validator.isNull(dettPratica.getClRischioPreInt())) { notCompleted.add("cl-rischio-pre-int"); @@ -692,8 +576,7 @@ public class ValidazionePraticaUtil { } } - if (dettPratica.getIntervFinPub() - && Validator.isNull(dettPratica.getIntervFinPubDesc())) { + if (dettPratica.getIntervFinPub() && Validator.isNull(dettPratica.getIntervFinPubDesc())) { notCompleted.add("interv-fin-pub-desc"); } @@ -701,10 +584,8 @@ public class ValidazionePraticaUtil { notCompleted.add("desc-long-intervento"); } - if (!(dettPratica.getTcNuovaCostruzione() - || dettPratica.getTcMiglioramentoSismico() - || dettPratica.getTcAdeguamentoSismico() || dettPratica - .getTcRiparazioneInterventoLocale())) { + if (!(dettPratica.getTcNuovaCostruzione() || dettPratica.getTcMiglioramentoSismico() + || dettPratica.getTcAdeguamentoSismico() || dettPratica.getTcRiparazioneInterventoLocale())) { notCompleted.add("fascicolo_title_intervento"); } @@ -732,13 +613,9 @@ public class ValidazionePraticaUtil { notCompleted.add("Localizzazione geografica mancante"); } // ADT BUG ID = 17 - boolean tipologiaCostruttiva = intPratica.getTipoProcedura() - .equalsIgnoreCase(Constants.PROCEDURA_C) - || dettPratica.getTcInCA() - || dettPratica.getTcInAcciaio() - || dettPratica.getTcInMuratura() - || dettPratica.getTcInLegno() - || dettPratica.getTcAltro(); + boolean tipologiaCostruttiva = intPratica.getTipoProcedura().equalsIgnoreCase(Constants.PROCEDURA_C) + || dettPratica.getTcInCA() || dettPratica.getTcInAcciaio() || dettPratica.getTcInMuratura() + || dettPratica.getTcInLegno() || dettPratica.getTcAltro(); if (!tipologiaCostruttiva) { notCompleted.add("Tipologia Costruttiva Mancante"); } @@ -753,10 +630,8 @@ public class ValidazionePraticaUtil { * @return */ public static boolean isRiparazioneLocale(DettPratica dettPratica) { - boolean isRiparazioneLocale = dettPratica - .getTcRiparazioneInterventoLocale() - && !dettPratica.getTcNuovaCostruzione() - && !dettPratica.getTcAdeguamentoSismico() + boolean isRiparazioneLocale = dettPratica.getTcRiparazioneInterventoLocale() + && !dettPratica.getTcNuovaCostruzione() && !dettPratica.getTcAdeguamentoSismico() && !dettPratica.getTcMiglioramentoSismico(); return isRiparazioneLocale; @@ -770,16 +645,14 @@ public class ValidazionePraticaUtil { */ public static boolean isCollaudatoreRequired(DettPratica dettPratica) { - return !dettPratica.getCollaudoStatico() - && !dettPratica.getLavoriPubblici() + return !dettPratica.getCollaudoStatico() && !dettPratica.getLavoriPubblici() && !isRiparazioneLocale(dettPratica); } - private static boolean isAnagrafeSoggettiCompleta(long dettPraticaId) - throws PortalException, SystemException { + private static boolean isAnagrafeSoggettiCompleta(long dettPraticaId) throws PortalException, + SystemException { - DettPratica dettPratica = DettPraticaServiceUtil - .getDettPratica(dettPraticaId); + DettPratica dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId); long intPraticaId = dettPratica.getIntPraticaId(); boolean titolare = SoggettiUtil.isTitolareInSoggetti(intPraticaId); @@ -787,23 +660,19 @@ public class ValidazionePraticaUtil { boolean collaudatoreNotRequired = !isCollaudatoreRequired(dettPratica); boolean direttoreLavoriNotRequired = dettPratica.getLavoriPubblici(); - boolean dittaNotRequired = dettPratica.getNormLavoriInProprio() - || dettPratica.getLavoriPubblici(); + boolean dittaNotRequired = dettPratica.getNormLavoriInProprio() || dettPratica.getLavoriPubblici(); boolean collaudatore = true; - boolean ditta = dettPratica.getNormLavoriInProprio() - || dettPratica.getLavoriPubblici(); + boolean ditta = dettPratica.getNormLavoriInProprio() || dettPratica.getLavoriPubblici(); boolean committente = false; boolean progettista = false; boolean direttore = dettPratica.getLavoriPubblici(); boolean geologo = false; - List soggetti = SoggettoLocalServiceUtil - .getValidTmpByIntPratica(intPraticaId); + List soggetti = SoggettoLocalServiceUtil.getValidTmpByIntPratica(intPraticaId); for (Soggetto soggetto : soggetti) { - if (!TipoSoggettoUtil.validaCodiceFiscale( - soggetto.getCodiceFiscale(), true)) { + if (!TipoSoggettoUtil.validaCodiceFiscale(soggetto.getCodiceFiscale(), true)) { return false; } @@ -831,19 +700,14 @@ public class ValidazionePraticaUtil { } } - boolean isDelegaCommittente = SoggettiUtil - .isTitolareInCommittenti(intPraticaId) - || Validator.isNotNull(dettPratica - .getCodiceFiscaleDelegatoCommittente()); + boolean isDelegaCommittente = SoggettiUtil.isTitolareInCommittenti(intPraticaId) + || Validator.isNotNull(dettPratica.getCodiceFiscaleDelegatoCommittente()); boolean isDelegaFineLavori = direttoreLavoriNotRequired - || Validator.isNotNull(dettPratica - .getCodiceFiscaleDelegatoFineLavori()); + || Validator.isNotNull(dettPratica.getCodiceFiscaleDelegatoFineLavori()); boolean isDelegaCollaudo = collaudatoreNotRequired - || Validator.isNotNull(dettPratica - .getCodiceFiscaleDelegatoCollaudo()); + || Validator.isNotNull(dettPratica.getCodiceFiscaleDelegatoCollaudo()); - boolean deleghe = isDelegaCommittente && isDelegaFineLavori - && isDelegaCollaudo; + boolean deleghe = isDelegaCommittente && isDelegaFineLavori && isDelegaCollaudo; boolean collaudatorePrincipale = true; boolean committentePrincipale = true; @@ -852,63 +716,47 @@ public class ValidazionePraticaUtil { boolean geologoPrincipale = true; boolean progettistaPrincipale = true; - if (!collaudatoreNotRequired - && collaudatore - && Validator.isNull(dettPratica - .getCodiceFiscalePrincipaleCollaudatore())) { + if (!collaudatoreNotRequired && collaudatore + && Validator.isNull(dettPratica.getCodiceFiscalePrincipaleCollaudatore())) { collaudatorePrincipale = false; } - if (committente - && Validator.isNull(dettPratica - .getCodiceFiscalePrincipaleCommittente())) { + if (committente && Validator.isNull(dettPratica.getCodiceFiscalePrincipaleCommittente())) { committentePrincipale = false; } - if (!direttoreLavoriNotRequired - && direttore - && Validator.isNull(dettPratica - .getCodiceFiscalePrincipaleDirettoreLavori())) { + if (!direttoreLavoriNotRequired && direttore + && Validator.isNull(dettPratica.getCodiceFiscalePrincipaleDirettoreLavori())) { direttorePrincipale = false; } - if (!dittaNotRequired - && ditta - && Validator.isNull(dettPratica - .getCodiceFiscalePrincipaleDitta())) { + if (!dittaNotRequired && ditta && Validator.isNull(dettPratica.getCodiceFiscalePrincipaleDitta())) { dittaPrincipale = false; } - if (geologo - && Validator.isNull(dettPratica - .getCodiceFiscalePrincipaleGeologo())) { + if (geologo && Validator.isNull(dettPratica.getCodiceFiscalePrincipaleGeologo())) { geologoPrincipale = false; } - if (progettista - && Validator.isNull(dettPratica - .getCodiceFiscalePrincipaleProgettista())) { + if (progettista && Validator.isNull(dettPratica.getCodiceFiscalePrincipaleProgettista())) { progettistaPrincipale = false; } - boolean principali = collaudatorePrincipale & committentePrincipale - & direttorePrincipale & dittaPrincipale & geologoPrincipale - & progettistaPrincipale; + boolean principali = collaudatorePrincipale & committentePrincipale & direttorePrincipale + & dittaPrincipale & geologoPrincipale & progettistaPrincipale; if (dettPratica.getNormArt3com3()) { geologo = true; } - int soggettiIncompleti = SoggettoLocalServiceUtil - .countTmpNotCompletedByDettPratica(dettPraticaId); + int soggettiIncompleti = SoggettoLocalServiceUtil.countTmpNotCompletedByDettPratica(dettPraticaId); if (soggettiIncompleti > 0) { return false; } - return titolare && collaudatore && ditta && committente && progettista - && direttore && geologo && deleghe && principali; + return titolare && collaudatore && ditta && committente && progettista && direttore && geologo + && deleghe && principali; } - private static List notCompletedAnagrafeSoggetti(long dettPraticaId) - throws PortalException, SystemException { + private static List notCompletedAnagrafeSoggetti(long dettPraticaId) throws PortalException, + SystemException { - DettPratica dettPratica = DettPraticaServiceUtil - .getDettPratica(dettPraticaId); + DettPratica dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId); long intPraticaId = dettPratica.getIntPraticaId(); List notCompleted = new ArrayList<>(); @@ -918,31 +766,25 @@ public class ValidazionePraticaUtil { } // ADT BUG ID = 17 - boolean isRiparazioneLocale = dettPratica - .getTcRiparazioneInterventoLocale() - && !dettPratica.getTcNuovaCostruzione() - && !dettPratica.getTcAdeguamentoSismico() + boolean isRiparazioneLocale = dettPratica.getTcRiparazioneInterventoLocale() + && !dettPratica.getTcNuovaCostruzione() && !dettPratica.getTcAdeguamentoSismico() && !dettPratica.getTcMiglioramentoSismico(); - boolean collaudatoreNotRequired = dettPratica.getCollaudoStatico() - || dettPratica.getLavoriPubblici() || isRiparazioneLocale; + boolean collaudatoreNotRequired = dettPratica.getCollaudoStatico() || dettPratica.getLavoriPubblici() + || isRiparazioneLocale; boolean direttoreLavoriNotRequired = dettPratica.getLavoriPubblici(); - boolean dittaNotRequired = dettPratica.getNormLavoriInProprio() - || dettPratica.getLavoriPubblici(); + boolean dittaNotRequired = dettPratica.getNormLavoriInProprio() || dettPratica.getLavoriPubblici(); boolean collaudatore = false; - boolean ditta = dettPratica.getNormLavoriInProprio() - || dettPratica.getLavoriPubblici(); + boolean ditta = dettPratica.getNormLavoriInProprio() || dettPratica.getLavoriPubblici(); boolean committente = false; boolean progettista = false; boolean direttore = dettPratica.getLavoriPubblici(); boolean geologo = false; - List soggetti = SoggettoLocalServiceUtil - .getValidTmpByIntPratica(intPraticaId); + List soggetti = SoggettoLocalServiceUtil.getValidTmpByIntPratica(intPraticaId); for (Soggetto soggetto : soggetti) { - if (!TipoSoggettoUtil.validaCodiceFiscale( - soggetto.getCodiceFiscale(), true)) { + if (!TipoSoggettoUtil.validaCodiceFiscale(soggetto.getCodiceFiscale(), true)) { String tipoSoggetto = LanguageUtil.get(LocaleUtil.ITALIAN, "gc-soggetto-" + soggetto.getTipologiaSoggetto()); notCompleted.add(LanguageUtil.format(LocaleUtil.ITALIAN, @@ -973,96 +815,66 @@ public class ValidazionePraticaUtil { } } - boolean isDelegaCommittente = SoggettiUtil - .isTitolareInCommittenti(intPraticaId) - || Validator.isNotNull(dettPratica - .getCodiceFiscaleDelegatoCommittente()); + boolean isDelegaCommittente = SoggettiUtil.isTitolareInCommittenti(intPraticaId) + || Validator.isNotNull(dettPratica.getCodiceFiscaleDelegatoCommittente()); if (!isDelegaCommittente) { notCompleted.add("delega-committente"); } boolean isDelegaFinelavori = direttoreLavoriNotRequired - || Validator.isNotNull(dettPratica - .getCodiceFiscaleDelegatoFineLavori()); + || Validator.isNotNull(dettPratica.getCodiceFiscaleDelegatoFineLavori()); if (!isDelegaFinelavori) { notCompleted.add("delega-direttoreLavori"); } boolean isDelegaCollaudo = collaudatoreNotRequired - || Validator.isNotNull(dettPratica - .getCodiceFiscaleDelegatoCollaudo()); + || Validator.isNotNull(dettPratica.getCodiceFiscaleDelegatoCollaudo()); if (!isDelegaCollaudo) { notCompleted.add("delega-collaudatore"); } - if (!collaudatoreNotRequired - && collaudatore - && Validator.isNull(dettPratica - .getCodiceFiscalePrincipaleCollaudatore())) { - notCompleted.add("gc-soggetto-" + TipoSoggettoUtil.COLLAUDATORE - + "-principale-not-present"); - } - if (committente - && Validator.isNull(dettPratica - .getCodiceFiscalePrincipaleCommittente())) { - notCompleted.add("gc-soggetto-" + TipoSoggettoUtil.COMMITTENTE - + "-principale-not-present"); - } - if (!direttoreLavoriNotRequired - && direttore - && Validator.isNull(dettPratica - .getCodiceFiscalePrincipaleDirettoreLavori())) { - notCompleted.add("gc-soggetto-" + TipoSoggettoUtil.DIRETTORE_LAVORI - + "-principale-not-present"); - } - if (!dittaNotRequired - && ditta - && Validator.isNull(dettPratica - .getCodiceFiscalePrincipaleDitta())) { - notCompleted.add("gc-soggetto-" + TipoSoggettoUtil.DITTA - + "-principale-not-present"); - } - if (geologo - && Validator.isNull(dettPratica - .getCodiceFiscalePrincipaleGeologo())) { - notCompleted.add("gc-soggetto-" + TipoSoggettoUtil.GEOLOGO - + "-principale-not-present"); - } - if (progettista - && Validator.isNull(dettPratica - .getCodiceFiscalePrincipaleProgettista())) { - notCompleted.add("gc-soggetto-" + TipoSoggettoUtil.PROGETTISTA - + "-principale-not-present"); + if (!collaudatoreNotRequired && collaudatore + && Validator.isNull(dettPratica.getCodiceFiscalePrincipaleCollaudatore())) { + notCompleted.add("gc-soggetto-" + TipoSoggettoUtil.COLLAUDATORE + "-principale-not-present"); + } + if (committente && Validator.isNull(dettPratica.getCodiceFiscalePrincipaleCommittente())) { + notCompleted.add("gc-soggetto-" + TipoSoggettoUtil.COMMITTENTE + "-principale-not-present"); + } + if (!direttoreLavoriNotRequired && direttore + && Validator.isNull(dettPratica.getCodiceFiscalePrincipaleDirettoreLavori())) { + notCompleted.add("gc-soggetto-" + TipoSoggettoUtil.DIRETTORE_LAVORI + "-principale-not-present"); + } + if (!dittaNotRequired && ditta && Validator.isNull(dettPratica.getCodiceFiscalePrincipaleDitta())) { + notCompleted.add("gc-soggetto-" + TipoSoggettoUtil.DITTA + "-principale-not-present"); + } + if (geologo && Validator.isNull(dettPratica.getCodiceFiscalePrincipaleGeologo())) { + notCompleted.add("gc-soggetto-" + TipoSoggettoUtil.GEOLOGO + "-principale-not-present"); + } + if (progettista && Validator.isNull(dettPratica.getCodiceFiscalePrincipaleProgettista())) { + notCompleted.add("gc-soggetto-" + TipoSoggettoUtil.PROGETTISTA + "-principale-not-present"); } if (!collaudatoreNotRequired && !collaudatore) { - notCompleted.add("gc-soggetto-" + TipoSoggettoUtil.COLLAUDATORE - + "-not-present"); + notCompleted.add("gc-soggetto-" + TipoSoggettoUtil.COLLAUDATORE + "-not-present"); } if (!committente) { - notCompleted.add("gc-soggetto-" + TipoSoggettoUtil.COMMITTENTE - + "-not-present"); + notCompleted.add("gc-soggetto-" + TipoSoggettoUtil.COMMITTENTE + "-not-present"); } if (!direttoreLavoriNotRequired && !direttore) { - notCompleted.add("gc-soggetto-" + TipoSoggettoUtil.DIRETTORE_LAVORI - + "-not-present"); + notCompleted.add("gc-soggetto-" + TipoSoggettoUtil.DIRETTORE_LAVORI + "-not-present"); } if (!dittaNotRequired && !ditta) { - notCompleted.add("gc-soggetto-" + TipoSoggettoUtil.DITTA - + "-not-present"); + notCompleted.add("gc-soggetto-" + TipoSoggettoUtil.DITTA + "-not-present"); } if (dettPratica.getNormArt3com3()) { geologo = true; } if (!geologo) { - notCompleted.add("gc-soggetto-" + TipoSoggettoUtil.GEOLOGO - + "-not-present"); + notCompleted.add("gc-soggetto-" + TipoSoggettoUtil.GEOLOGO + "-not-present"); } if (!progettista) { - notCompleted.add("gc-soggetto-" + TipoSoggettoUtil.PROGETTISTA - + "-not-present"); + notCompleted.add("gc-soggetto-" + TipoSoggettoUtil.PROGETTISTA + "-not-present"); } - int soggettiIncompleti = SoggettoLocalServiceUtil - .countTmpNotCompletedByDettPratica(dettPraticaId); + int soggettiIncompleti = SoggettoLocalServiceUtil.countTmpNotCompletedByDettPratica(dettPraticaId); if (soggettiIncompleti > 0) { notCompleted.add("gc-soggetti-not-completed"); } @@ -1070,35 +882,26 @@ public class ValidazionePraticaUtil { return notCompleted; } - private static boolean isDescrizioneEdificioCompleta(long dettPraticaId) - throws PortalException, SystemException { + private static boolean isDescrizioneEdificioCompleta(long dettPraticaId) throws PortalException, + SystemException { - DettPratica dettPratica = DettPraticaServiceUtil - .getDettPratica(dettPraticaId); - IntPratica intPratica = IntPraticaLocalServiceUtil - .getIntPratica(dettPratica.getIntPraticaId()); + DettPratica dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId); + IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(dettPratica.getIntPraticaId()); - if (intPratica.getTipoProcedura().equalsIgnoreCase( - Constants.PROCEDURA_C)) { + if (intPratica.getTipoProcedura().equalsIgnoreCase(Constants.PROCEDURA_C)) { return true; } - List infrastrutture = Arrays.asList("1A", "2A", "A4A", "A4B", - "A4C", "A4D", "A4E", "A4F", "A5A", "B4A", "B4B", "B4C", "B5A"); + List infrastrutture = Arrays.asList("1A", "2A", "A4A", "A4B", "A4C", "A4D", "A4E", "A4F", + "A5A", "B4A", "B4B", "B4C", "B5A"); // se infrastruttura controllo solo DATI INFRASTRUTTURA - boolean infrastruttura = infrastrutture.contains(dettPratica - .getDestinazione()); + boolean infrastruttura = infrastrutture.contains(dettPratica.getDestinazione()); if (infrastruttura) { - return dettPratica.getDeInfStradaleStrada() - || dettPratica.getDeInfStradalePonte() - || dettPratica.getDeInfStradaleAltro() - || dettPratica.getDeInfIdraulicaLong() - || dettPratica.getDeInfIdraulicaTrasv() - || dettPratica.getDeInfIdraulicaAltro() - || dettPratica.getDeInfOperaAccStradale() - || dettPratica.getDeInfOperaAccIdraulica() - || dettPratica.getDeInfOperaAccAltro() - || dettPratica.getDeInfAltraInfrastruttura() + return dettPratica.getDeInfStradaleStrada() || dettPratica.getDeInfStradalePonte() + || dettPratica.getDeInfStradaleAltro() || dettPratica.getDeInfIdraulicaLong() + || dettPratica.getDeInfIdraulicaTrasv() || dettPratica.getDeInfIdraulicaAltro() + || dettPratica.getDeInfOperaAccStradale() || dettPratica.getDeInfOperaAccIdraulica() + || dettPratica.getDeInfOperaAccAltro() || dettPratica.getDeInfAltraInfrastruttura() || Validator.isNotNull(dettPratica.getDeInfAltroDesc()); } @@ -1113,127 +916,88 @@ public class ValidazionePraticaUtil { && Validator.isNotNull(dettPratica.getDePrivata()) && Validator.isNotNull(dettPratica.getDePubblica()); - boolean isComponentiCostruttiveDisabled = !dettPratica - .getTcNuovaCostruzione() + boolean isComponentiCostruttiveDisabled = !dettPratica.getTcNuovaCostruzione() && dettPratica.getTcRiparazioneInterventoLocale(); if (isComponentiCostruttiveDisabled) { return controllo; } - boolean fondazioni = Validator - .isNotNull(dettPratica.getDccFondazioni()); - boolean elevazioni = (Validator.isNotNull(dettPratica - .getDccStruttureEleMuraturePietrame()) - || Validator.isNotNull(dettPratica - .getDccStruttureEleMuratureLaterizio()) - || Validator.isNotNull(dettPratica - .getDccStruttureEleMuratureMisto()) || Validator + boolean fondazioni = Validator.isNotNull(dettPratica.getDccFondazioni()); + boolean elevazioni = (Validator.isNotNull(dettPratica.getDccStruttureEleMuraturePietrame()) + || Validator.isNotNull(dettPratica.getDccStruttureEleMuratureLaterizio()) + || Validator.isNotNull(dettPratica.getDccStruttureEleMuratureMisto()) || Validator .isNotNull(dettPratica.getDccStruttureEleMuratureStoriche())) || Validator.isNotNull(dettPratica.getDccStruttureEleAcciaio()) || Validator.isNotNull(dettPratica.getDccStruttureEleCA()) || Validator.isNotNull(dettPratica.getDccStruttureEleLegno()) - || (Validator - .isNotNull(dettPratica.getDccStruttureEleMistoCA()) - || Validator.isNotNull(dettPratica - .getDccStruttureEleMistoAcciaio()) - || Validator.isNotNull(dettPratica - .getDccStruttureEleMistoMuratura()) || Validator - .isNotNull(dettPratica - .getDccStruttureEleMistoLegno())) - || Validator.isNotNull(dettPratica - .getDccStruttureElePrefabbricato()) + || (Validator.isNotNull(dettPratica.getDccStruttureEleMistoCA()) + || Validator.isNotNull(dettPratica.getDccStruttureEleMistoAcciaio()) + || Validator.isNotNull(dettPratica.getDccStruttureEleMistoMuratura()) || Validator + .isNotNull(dettPratica.getDccStruttureEleMistoLegno())) + || Validator.isNotNull(dettPratica.getDccStruttureElePrefabbricato()) || (Validator.isNotNull(dettPratica.getDccStruttureEleAltro()) && Validator - .isNotNull(dettPratica - .getDccStruttureEleAltroDescrizione())); + .isNotNull(dettPratica.getDccStruttureEleAltroDescrizione())); - boolean orizzontamenti = Validator.isNotNull(dettPratica - .getDccOrizzontamentiCAAcciaio()) - || Validator.isNotNull(dettPratica - .getDccOrizzontamentiLamieraGrecata()) + boolean orizzontamenti = Validator.isNotNull(dettPratica.getDccOrizzontamentiCAAcciaio()) + || Validator.isNotNull(dettPratica.getDccOrizzontamentiLamieraGrecata()) || Validator.isNotNull(dettPratica.getDccOrizzontamentiLegno()) - || Validator.isNotNull(dettPratica - .getDccOrizzontamentiLegnoCA()) + || Validator.isNotNull(dettPratica.getDccOrizzontamentiLegnoCA()) || Validator.isNotNull(dettPratica.getDccOrizzontamentiVolte()) - || (Validator - .isNotNull(dettPratica.getDccOrizzontamentiAltro()) && Validator - .isNotNull(dettPratica - .getDccOrizzontamentiAltroDescrizione())); + || (Validator.isNotNull(dettPratica.getDccOrizzontamentiAltro()) && Validator + .isNotNull(dettPratica.getDccOrizzontamentiAltroDescrizione())); boolean coperture = Validator.isNotNull(dettPratica.getDccCopertura()) || Validator.isNotNull(dettPratica.getDccCoperturaCAAcciaio()) - || Validator.isNotNull(dettPratica - .getDccCoperturaLamieraGrecata()) + || Validator.isNotNull(dettPratica.getDccCoperturaLamieraGrecata()) || Validator.isNotNull(dettPratica.getDccCoperturaLeggere()) || Validator.isNotNull(dettPratica.getDccCoperturaLegno()) || Validator.isNotNull(dettPratica.getDccCoperturaLegnoCA()) || Validator.isNotNull(dettPratica.getDccCoperturaPannelli()) - || Validator - .isNotNull(dettPratica.getDccCoperturaPVCTelonati()) + || Validator.isNotNull(dettPratica.getDccCoperturaPVCTelonati()) || (Validator.isNotNull(dettPratica.getDccCoperturaAltro()) && Validator .isNotNull(dettPratica.getDccCoperturaAltroDesrizione())); - boolean non_strutturali = Validator.isNotNull(dettPratica - .getDccElemNonStrutLaterizio()) - || Validator.isNotNull(dettPratica - .getDccElemNonStrutCalcestruzzo()) - || Validator.isNotNull(dettPratica - .getDccElemNonStrutCartongesso()) + boolean non_strutturali = Validator.isNotNull(dettPratica.getDccElemNonStrutLaterizio()) + || Validator.isNotNull(dettPratica.getDccElemNonStrutCalcestruzzo()) + || Validator.isNotNull(dettPratica.getDccElemNonStrutCartongesso()) || Validator.isNotNull(dettPratica.getDccElemNonStrutLegno()) || (Validator.isNotNull(dettPratica.getDccElemNonStrutAltro()) && Validator - .isNotNull(dettPratica - .getDccElemNonStrutAltroDescrizione())); - - boolean rinforzo = Validator.isNotNull(dettPratica - .getDccOpereDiRinforzoInsCatene()) - || Validator.isNotNull(dettPratica - .getDccOpereDiRinforzoInsCordoli()) - || Validator.isNotNull(dettPratica - .getDccOpereDiRinforzoIniArmate()) - || Validator.isNotNull(dettPratica - .getDccOpereDiRinforzoPlaccaggi()) - || Validator.isNotNull(dettPratica - .getDccOpereDiRinforzoIrrSolai()) - || Validator.isNotNull(dettPratica - .getDccOpereDiRinforzoRinforziFRP()) - || Validator.isNotNull(dettPratica - .getDccOpereDiRinforzoTelaiECerchiature()) - || Validator.isNotNull(dettPratica - .getDccOpereDiRinforzoInsRompitratta()) - || (Validator.isNotNull(dettPratica - .getDccOpereDiRinforzoAltro()) && Validator - .isNotNull(dettPratica - .getDccOpereDiRinforzoAltroDescrizione())); - - return controllo && fondazioni && elevazioni && orizzontamenti - && coperture && non_strutturali && rinforzo; - } - - private static List notCompletedDescrizioneEdificio( - long dettPraticaId) throws PortalException, SystemException { - - DettPratica dettPratica = DettPraticaServiceUtil - .getDettPratica(dettPraticaId); + .isNotNull(dettPratica.getDccElemNonStrutAltroDescrizione())); + + boolean rinforzo = Validator.isNotNull(dettPratica.getDccOpereDiRinforzoInsCatene()) + || Validator.isNotNull(dettPratica.getDccOpereDiRinforzoInsCordoli()) + || Validator.isNotNull(dettPratica.getDccOpereDiRinforzoIniArmate()) + || Validator.isNotNull(dettPratica.getDccOpereDiRinforzoPlaccaggi()) + || Validator.isNotNull(dettPratica.getDccOpereDiRinforzoIrrSolai()) + || Validator.isNotNull(dettPratica.getDccOpereDiRinforzoRinforziFRP()) + || Validator.isNotNull(dettPratica.getDccOpereDiRinforzoTelaiECerchiature()) + || Validator.isNotNull(dettPratica.getDccOpereDiRinforzoInsRompitratta()) + || (Validator.isNotNull(dettPratica.getDccOpereDiRinforzoAltro()) && Validator + .isNotNull(dettPratica.getDccOpereDiRinforzoAltroDescrizione())); + + return controllo && fondazioni && elevazioni && orizzontamenti && coperture && non_strutturali + && rinforzo; + } + + private static List notCompletedDescrizioneEdificio(long dettPraticaId) throws PortalException, + SystemException { + + DettPratica dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId); List notCompleted = new ArrayList<>(); - List infrastrutture = Arrays.asList("1A", "2A", "A4A", "A4B", - "A4C", "A4D", "A4E", "A4F", "A5A", "B4A", "B4B", "B4C", "B5A"); + List infrastrutture = Arrays.asList("1A", "2A", "A4A", "A4B", "A4C", "A4D", "A4E", "A4F", + "A5A", "B4A", "B4B", "B4C", "B5A"); // se infrastruttura controllo solo DATI INFRASTRUTTURA - boolean infrastruttura = infrastrutture.contains(dettPratica - .getDestinazione()); + boolean infrastruttura = infrastrutture.contains(dettPratica.getDestinazione()); if (infrastruttura) { - boolean isCompleted = dettPratica.getDeInfStradaleStrada() - || dettPratica.getDeInfStradalePonte() - || dettPratica.getDeInfStradaleAltro() - || dettPratica.getDeInfIdraulicaLong() - || dettPratica.getDeInfIdraulicaTrasv() - || dettPratica.getDeInfIdraulicaAltro() - || dettPratica.getDeInfOperaAccStradale() - || dettPratica.getDeInfOperaAccIdraulica() - || dettPratica.getDeInfOperaAccAltro() - || dettPratica.getDeInfAltraInfrastruttura() + boolean isCompleted = dettPratica.getDeInfStradaleStrada() || dettPratica.getDeInfStradalePonte() + || dettPratica.getDeInfStradaleAltro() || dettPratica.getDeInfIdraulicaLong() + || dettPratica.getDeInfIdraulicaTrasv() || dettPratica.getDeInfIdraulicaAltro() + || dettPratica.getDeInfOperaAccStradale() || dettPratica.getDeInfOperaAccIdraulica() + || dettPratica.getDeInfOperaAccAltro() || dettPratica.getDeInfAltraInfrastruttura() || Validator.isNotNull(dettPratica.getDeInfAltroDesc()); if (!isCompleted) { @@ -1273,8 +1037,7 @@ public class ValidazionePraticaUtil { notCompleted.add("de-pubblica"); } - boolean isComponentiCostruttiveDisabled = !dettPratica - .getTcNuovaCostruzione() + boolean isComponentiCostruttiveDisabled = !dettPratica.getTcNuovaCostruzione() && dettPratica.getTcRiparazioneInterventoLocale(); if (isComponentiCostruttiveDisabled) { @@ -1285,45 +1048,31 @@ public class ValidazionePraticaUtil { notCompleted.add("dcc-fondazioni"); } - boolean elevazioni = (Validator.isNotNull(dettPratica - .getDccStruttureEleMuraturePietrame()) - || Validator.isNotNull(dettPratica - .getDccStruttureEleMuratureLaterizio()) - || Validator.isNotNull(dettPratica - .getDccStruttureEleMuratureMisto()) || Validator + boolean elevazioni = (Validator.isNotNull(dettPratica.getDccStruttureEleMuraturePietrame()) + || Validator.isNotNull(dettPratica.getDccStruttureEleMuratureLaterizio()) + || Validator.isNotNull(dettPratica.getDccStruttureEleMuratureMisto()) || Validator .isNotNull(dettPratica.getDccStruttureEleMuratureStoriche())) || Validator.isNotNull(dettPratica.getDccStruttureEleAcciaio()) || Validator.isNotNull(dettPratica.getDccStruttureEleCA()) || Validator.isNotNull(dettPratica.getDccStruttureEleLegno()) - || (Validator - .isNotNull(dettPratica.getDccStruttureEleMistoCA()) - || Validator.isNotNull(dettPratica - .getDccStruttureEleMistoAcciaio()) - || Validator.isNotNull(dettPratica - .getDccStruttureEleMistoMuratura()) || Validator - .isNotNull(dettPratica - .getDccStruttureEleMistoLegno())) - || Validator.isNotNull(dettPratica - .getDccStruttureElePrefabbricato()) + || (Validator.isNotNull(dettPratica.getDccStruttureEleMistoCA()) + || Validator.isNotNull(dettPratica.getDccStruttureEleMistoAcciaio()) + || Validator.isNotNull(dettPratica.getDccStruttureEleMistoMuratura()) || Validator + .isNotNull(dettPratica.getDccStruttureEleMistoLegno())) + || Validator.isNotNull(dettPratica.getDccStruttureElePrefabbricato()) || (Validator.isNotNull(dettPratica.getDccStruttureEleAltro()) && Validator - .isNotNull(dettPratica - .getDccStruttureEleAltroDescrizione())); + .isNotNull(dettPratica.getDccStruttureEleAltroDescrizione())); if (!elevazioni) { notCompleted.add("dcc-strutture-ele"); } - boolean orizzontamenti = Validator.isNotNull(dettPratica - .getDccOrizzontamentiCAAcciaio()) - || Validator.isNotNull(dettPratica - .getDccOrizzontamentiLamieraGrecata()) + boolean orizzontamenti = Validator.isNotNull(dettPratica.getDccOrizzontamentiCAAcciaio()) + || Validator.isNotNull(dettPratica.getDccOrizzontamentiLamieraGrecata()) || Validator.isNotNull(dettPratica.getDccOrizzontamentiLegno()) - || Validator.isNotNull(dettPratica - .getDccOrizzontamentiLegnoCA()) + || Validator.isNotNull(dettPratica.getDccOrizzontamentiLegnoCA()) || Validator.isNotNull(dettPratica.getDccOrizzontamentiVolte()) - || (Validator - .isNotNull(dettPratica.getDccOrizzontamentiAltro()) && Validator - .isNotNull(dettPratica - .getDccOrizzontamentiAltroDescrizione())); + || (Validator.isNotNull(dettPratica.getDccOrizzontamentiAltro()) && Validator + .isNotNull(dettPratica.getDccOrizzontamentiAltroDescrizione())); if (!orizzontamenti) { notCompleted.add("dcc-orizzontamenti"); @@ -1331,14 +1080,12 @@ public class ValidazionePraticaUtil { boolean coperture = Validator.isNotNull(dettPratica.getDccCopertura()) || Validator.isNotNull(dettPratica.getDccCoperturaCAAcciaio()) - || Validator.isNotNull(dettPratica - .getDccCoperturaLamieraGrecata()) + || Validator.isNotNull(dettPratica.getDccCoperturaLamieraGrecata()) || Validator.isNotNull(dettPratica.getDccCoperturaLeggere()) || Validator.isNotNull(dettPratica.getDccCoperturaLegno()) || Validator.isNotNull(dettPratica.getDccCoperturaLegnoCA()) || Validator.isNotNull(dettPratica.getDccCoperturaPannelli()) - || Validator - .isNotNull(dettPratica.getDccCoperturaPVCTelonati()) + || Validator.isNotNull(dettPratica.getDccCoperturaPVCTelonati()) || (Validator.isNotNull(dettPratica.getDccCoperturaAltro()) && Validator .isNotNull(dettPratica.getDccCoperturaAltroDesrizione())); @@ -1346,41 +1093,27 @@ public class ValidazionePraticaUtil { notCompleted.add("dcc-copertura"); } - boolean non_strutturali = Validator.isNotNull(dettPratica - .getDccElemNonStrutLaterizio()) - || Validator.isNotNull(dettPratica - .getDccElemNonStrutCalcestruzzo()) - || Validator.isNotNull(dettPratica - .getDccElemNonStrutCartongesso()) + boolean non_strutturali = Validator.isNotNull(dettPratica.getDccElemNonStrutLaterizio()) + || Validator.isNotNull(dettPratica.getDccElemNonStrutCalcestruzzo()) + || Validator.isNotNull(dettPratica.getDccElemNonStrutCartongesso()) || Validator.isNotNull(dettPratica.getDccElemNonStrutLegno()) || (Validator.isNotNull(dettPratica.getDccElemNonStrutAltro()) && Validator - .isNotNull(dettPratica - .getDccElemNonStrutAltroDescrizione())); + .isNotNull(dettPratica.getDccElemNonStrutAltroDescrizione())); if (!non_strutturali) { notCompleted.add("dcc-non_strutturali"); } - boolean rinforzo = Validator.isNotNull(dettPratica - .getDccOpereDiRinforzoInsCatene()) - || Validator.isNotNull(dettPratica - .getDccOpereDiRinforzoInsCordoli()) - || Validator.isNotNull(dettPratica - .getDccOpereDiRinforzoIniArmate()) - || Validator.isNotNull(dettPratica - .getDccOpereDiRinforzoPlaccaggi()) - || Validator.isNotNull(dettPratica - .getDccOpereDiRinforzoIrrSolai()) - || Validator.isNotNull(dettPratica - .getDccOpereDiRinforzoRinforziFRP()) - || Validator.isNotNull(dettPratica - .getDccOpereDiRinforzoTelaiECerchiature()) - || Validator.isNotNull(dettPratica - .getDccOpereDiRinforzoInsRompitratta()) - || (Validator.isNotNull(dettPratica - .getDccOpereDiRinforzoAltro()) && Validator - .isNotNull(dettPratica - .getDccOpereDiRinforzoAltroDescrizione())); + boolean rinforzo = Validator.isNotNull(dettPratica.getDccOpereDiRinforzoInsCatene()) + || Validator.isNotNull(dettPratica.getDccOpereDiRinforzoInsCordoli()) + || Validator.isNotNull(dettPratica.getDccOpereDiRinforzoIniArmate()) + || Validator.isNotNull(dettPratica.getDccOpereDiRinforzoPlaccaggi()) + || Validator.isNotNull(dettPratica.getDccOpereDiRinforzoIrrSolai()) + || Validator.isNotNull(dettPratica.getDccOpereDiRinforzoRinforziFRP()) + || Validator.isNotNull(dettPratica.getDccOpereDiRinforzoTelaiECerchiature()) + || Validator.isNotNull(dettPratica.getDccOpereDiRinforzoInsRompitratta()) + || (Validator.isNotNull(dettPratica.getDccOpereDiRinforzoAltro()) && Validator + .isNotNull(dettPratica.getDccOpereDiRinforzoAltroDescrizione())); if (!rinforzo) { notCompleted.add("dcc-opere-di-rinforzo"); @@ -1389,11 +1122,10 @@ public class ValidazionePraticaUtil { return notCompleted; } - private static boolean isSezioneGeologicaCompleta(long dettPraticaId) - throws PortalException, SystemException { + private static boolean isSezioneGeologicaCompleta(long dettPraticaId) throws PortalException, + SystemException { - DettPratica dettPratica = DettPraticaServiceUtil - .getDettPratica(dettPraticaId); + DettPratica dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId); // Se check NormArt3com3 sez. geologica non obbligatoria if (dettPratica.getNormArt3com3()) { @@ -1405,48 +1137,35 @@ public class ValidazionePraticaUtil { && Validator.isNotNull(dettPratica.getGeoClasseIndagine()) && Validator.isNotNull(dettPratica.getGeoOperaRilevante()) && Validator.isNotNull(dettPratica.getGeoCategoriaSottosuolo()) - && Validator - .isNotNull(dettPratica.getGeoCategoriaTopografica()) + && Validator.isNotNull(dettPratica.getGeoCategoriaTopografica()) && Validator.isNotNull(dettPratica.getGeoOpereDiSostegno()) && Validator.isNotNull(dettPratica.getGeoConsolidamento()) && Validator.isNotNull(dettPratica.getGeoOpereInSotterranea()) - && Validator.isNotNull(dettPratica - .getGeoPericolositaGeologica()) - && Validator.isNotNull(dettPratica - .getGeoPericolositaGeomorfica()) - && Validator.isNotNull(dettPratica - .getGeoRischioGeomorfologicoPai()) - && Validator.isNotNull(dettPratica - .getGeoPericolositaIdraulicaPai()) + && Validator.isNotNull(dettPratica.getGeoPericolositaGeologica()) + && Validator.isNotNull(dettPratica.getGeoPericolositaGeomorfica()) + && Validator.isNotNull(dettPratica.getGeoRischioGeomorfologicoPai()) + && Validator.isNotNull(dettPratica.getGeoPericolositaIdraulicaPai()) && Validator.isNotNull(dettPratica.getGeoRischioIdraulicoPai()) && Validator.isNotNull(dettPratica.getGeoPericolositaSismica()) && Validator.isNotNull(dettPratica.getGeoFattibilitaSismica()) - && Validator.isNotNull(dettPratica - .getGeoPericolositaIdraulica()) - && Validator - .isNotNull(dettPratica.getGeoFattibilitaIdraulica()) - && Validator - .isNotNull(dettPratica.getGeoFattibilitaGeologica()) - && Validator - .isNotNull(dettPratica.getGeoPresenzaPrescrizioni()) + && Validator.isNotNull(dettPratica.getGeoPericolositaIdraulica()) + && Validator.isNotNull(dettPratica.getGeoFattibilitaIdraulica()) + && Validator.isNotNull(dettPratica.getGeoFattibilitaGeologica()) + && Validator.isNotNull(dettPratica.getGeoPresenzaPrescrizioni()) && Validator.isNotNull(dettPratica.getGeoEvidenzeGeologiche()) && Validator.isNotNull(dettPratica.getGeoEvidenzeGeomorfiche()); - List delegheGeologo = DelegaLocalServiceUtil - .findByDettPratica_Tipologia_InEsito(dettPraticaId, - DelegheUtil.TIPO_GEOLOGO, - new String[] { DelegheUtil.STATO_ESEGUITA }, - QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); + List delegheGeologo = DelegaLocalServiceUtil.findByDettPratica_Tipologia_InEsito( + dettPraticaId, DelegheUtil.TIPO_GEOLOGO, new String[] { DelegheUtil.STATO_ESEGUITA }, + QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); boolean allegatiGeologo = dettPratica.getNormArt3com3(); if (!allegatiGeologo) { long intPraticaId = dettPratica.getIntPraticaId(); - List a14Docs = DocPraticaLocalServiceUtil - .getValidTmpByIntPratica_Tipologia( - dettPratica.getIntPraticaId(), - DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A14, - QueryUtil.ALL_POS, QueryUtil.ALL_POS); + List a14Docs = DocPraticaLocalServiceUtil.getValidTmpByIntPratica_Tipologia( + dettPratica.getIntPraticaId(), DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A14, + QueryUtil.ALL_POS, QueryUtil.ALL_POS); boolean a14 = !a14Docs.isEmpty() || !delegheGeologo.isEmpty(); if (!a14) { for (DocPratica doc : a14Docs) { @@ -1456,15 +1175,12 @@ public class ValidazionePraticaUtil { continue; } else { - FirmeBean firme = FirmeUtil.deserialize(doc - .getJsonFirmatari()); + FirmeBean firme = FirmeUtil.deserialize(doc.getJsonFirmatari()); List signatures = firme.allSignatures(); - if (!isAllRequiredValid(doc.getTipologia(), - dettPratica.getIntPraticaId(), signatures, - AsseverazioniUtil - .getRequiredSubjectsByCodiceDoc(doc - .getTipologia()), doc)) { + if (!isAllRequiredValid(doc.getTipologia(), dettPratica.getIntPraticaId(), + signatures, + AsseverazioniUtil.getRequiredSubjectsByCodiceDoc(doc.getTipologia()), doc)) { return false; } @@ -1472,11 +1188,9 @@ public class ValidazionePraticaUtil { } } - List a05Docs = DocPraticaLocalServiceUtil - .getValidTmpByIntPratica_Tipologia( - dettPratica.getIntPraticaId(), - DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A05, - QueryUtil.ALL_POS, QueryUtil.ALL_POS); + List a05Docs = DocPraticaLocalServiceUtil.getValidTmpByIntPratica_Tipologia( + dettPratica.getIntPraticaId(), DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A05, + QueryUtil.ALL_POS, QueryUtil.ALL_POS); // ADT BUG ID=20 (A05 SEMPRE OBBLIGATORIO SE NON SETTATO IL CHECK // SULLA SEZIONE GEOLOGICA boolean a05 = !a05Docs.isEmpty(); @@ -1495,14 +1209,12 @@ public class ValidazionePraticaUtil { if (Validator.isNotNull(doc.getOldDocPraticaId())) { continue; } else { - FirmeBean firme = FirmeUtil.deserialize(doc - .getJsonFirmatari()); + FirmeBean firme = FirmeUtil.deserialize(doc.getJsonFirmatari()); List signatures = firme.allSignatures(); // ADT BUG ID = 19 - List firmeRichieste = AsseverazioniUtil - .getRequiredSubjectsByCodiceDoc(doc - .getTipologia()); + List firmeRichieste = AsseverazioniUtil.getRequiredSubjectsByCodiceDoc(doc + .getTipologia()); List soggettiInseriti = SoggettoLocalServiceUtil .findByIntPratica(dettPratica.getIntPraticaId()); List firmeFiltrate = new ArrayList(); @@ -1512,18 +1224,15 @@ public class ValidazionePraticaUtil { boolean DLPresente = false; for (Soggetto soggetto : soggettiInseriti) { - if (soggetto.getTipologiaSoggetto().equals( - TipoSoggettoUtil.DIRETTORE_LAVORI)) { + if (soggetto.getTipologiaSoggetto().equals(TipoSoggettoUtil.DIRETTORE_LAVORI)) { DLPresente = true; } } if (!DLPresente || !dettPratica.isLavoriPubblici()) { - firmeFiltrate - .remove(TipoSoggettoUtil.DIRETTORE_LAVORI); + firmeFiltrate.remove(TipoSoggettoUtil.DIRETTORE_LAVORI); } - if (!isAllRequiredValid(doc.getTipologia(), - dettPratica.getIntPraticaId(), signatures, - firmeFiltrate, doc)) { + if (!isAllRequiredValid(doc.getTipologia(), dettPratica.getIntPraticaId(), + signatures, firmeFiltrate, doc)) { return false; } @@ -1531,11 +1240,9 @@ public class ValidazionePraticaUtil { } } - List a06Docs = DocPraticaLocalServiceUtil - .getValidTmpByIntPratica_Tipologia( - dettPratica.getIntPraticaId(), - DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A06, - QueryUtil.ALL_POS, QueryUtil.ALL_POS); + List a06Docs = DocPraticaLocalServiceUtil.getValidTmpByIntPratica_Tipologia( + dettPratica.getIntPraticaId(), DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A06, + QueryUtil.ALL_POS, QueryUtil.ALL_POS); boolean a06 = !a06Docs.isEmpty(); if (!a06Docs.isEmpty()) { for (DocPratica doc : a06Docs) { @@ -1552,11 +1259,9 @@ public class ValidazionePraticaUtil { if (Validator.isNotNull(doc.getOldDocPraticaId())) { continue; } else { - FirmeBean firme = FirmeUtil.deserialize(doc - .getJsonFirmatari()); + FirmeBean firme = FirmeUtil.deserialize(doc.getJsonFirmatari()); List signatures = firme.allSignatures(); - if (!isA06Valid(dettPratica, - dettPratica.getIntPraticaId(), signatures, doc)) { + if (!isA06Valid(dettPratica, dettPratica.getIntPraticaId(), signatures, doc)) { // Return false if A06 doesn't contain (Progettista // OR Geologo ) AND Direttore_Lavori return false; @@ -1565,11 +1270,9 @@ public class ValidazionePraticaUtil { } } - List a15Docs = DocPraticaLocalServiceUtil - .getValidTmpByIntPratica_Tipologia( - dettPratica.getIntPraticaId(), - DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A15, - QueryUtil.ALL_POS, QueryUtil.ALL_POS); + List a15Docs = DocPraticaLocalServiceUtil.getValidTmpByIntPratica_Tipologia( + dettPratica.getIntPraticaId(), DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A15, + QueryUtil.ALL_POS, QueryUtil.ALL_POS); boolean a15 = true; if (!a15Docs.isEmpty()) { for (DocPratica doc : a15Docs) { @@ -1586,23 +1289,19 @@ public class ValidazionePraticaUtil { if (Validator.isNotNull(doc.getOldDocPraticaId())) { continue; } else { - FirmeBean firme = FirmeUtil.deserialize(doc - .getJsonFirmatari()); + FirmeBean firme = FirmeUtil.deserialize(doc.getJsonFirmatari()); List signatures = firme.allSignatures(); - if (!isA07A15Valid(dettPratica, intPraticaId, - signatures, doc)) { + if (!isA07A15Valid(dettPratica, intPraticaId, signatures, doc)) { return false; } } } } - List tipologiaAllegati = DocumentiPraticaUtil - .getIndaginiGeologiche(); - List a16Docs = DocPraticaLocalServiceUtil - .getValidTmpByIntPratica_Tipologie(intPraticaId, - tipologiaAllegati.toArray(new String[0]), - QueryUtil.ALL_POS, QueryUtil.ALL_POS); + List tipologiaAllegati = DocumentiPraticaUtil.getIndaginiGeologiche(); + List a16Docs = DocPraticaLocalServiceUtil.getValidTmpByIntPratica_Tipologie( + intPraticaId, tipologiaAllegati.toArray(new String[0]), QueryUtil.ALL_POS, + QueryUtil.ALL_POS); boolean a16 = !a16Docs.isEmpty(); if (!a16Docs.isEmpty()) { for (DocPratica doc : a16Docs) { @@ -1611,12 +1310,10 @@ public class ValidazionePraticaUtil { if (Validator.isNotNull(doc.getOldDocPraticaId())) { continue; } else { - FirmeBean firme = FirmeUtil.deserialize(doc - .getJsonFirmatari()); + FirmeBean firme = FirmeUtil.deserialize(doc.getJsonFirmatari()); List signatures = firme.allSignatures(); - List signaturesPerSubject = getSignaturePerSubject( - intPraticaId, signatures, + List signaturesPerSubject = getSignaturePerSubject(intPraticaId, signatures, TipoSoggettoUtil.GEOLOGO, doc.getClassPk()); if (signaturesPerSubject.isEmpty()) { return false; @@ -1638,11 +1335,10 @@ public class ValidazionePraticaUtil { return formGeologo && allegatiGeologo; } - private static List notCompletedSezioneGeologica(long dettPraticaId) - throws PortalException, SystemException { + private static List notCompletedSezioneGeologica(long dettPraticaId) throws PortalException, + SystemException { - DettPratica dettPratica = DettPraticaServiceUtil - .getDettPratica(dettPraticaId); + DettPratica dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId); List notCompleted = new ArrayList<>(); // Se check NormArt3com3 sez. geologica non obbligatoria @@ -1654,42 +1350,29 @@ public class ValidazionePraticaUtil { if (!dettPratica.getNormArt3com3()) { long intPraticaId = dettPratica.getIntPraticaId(); - List a14 = DocPraticaLocalServiceUtil - .getValidTmpByIntPratica_Tipologia( - dettPratica.getIntPraticaId(), - DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A14, - QueryUtil.ALL_POS, QueryUtil.ALL_POS); - List a05 = DocPraticaLocalServiceUtil - .getValidTmpByIntPratica_Tipologia( - dettPratica.getIntPraticaId(), - DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A05, - QueryUtil.ALL_POS, QueryUtil.ALL_POS); - List a06 = DocPraticaLocalServiceUtil - .getValidTmpByIntPratica_Tipologia( - dettPratica.getIntPraticaId(), - DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A06, - QueryUtil.ALL_POS, QueryUtil.ALL_POS); - List a15 = DocPraticaLocalServiceUtil - .getValidTmpByIntPratica_Tipologia( - dettPratica.getIntPraticaId(), - DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A15, - QueryUtil.ALL_POS, QueryUtil.ALL_POS); - List a16 = DocPraticaLocalServiceUtil - .getValidTmpByIntPratica_Tipologie(intPraticaId, - DocumentiPraticaUtil.getIndaginiGeologiche() - .toArray(new String[0]), QueryUtil.ALL_POS, - QueryUtil.ALL_POS); - - List delegheGeologo = DelegaLocalServiceUtil - .findByDettPratica_Tipologia_InEsito(dettPraticaId, - DelegheUtil.TIPO_GEOLOGO, - new String[] { DelegheUtil.STATO_ESEGUITA }, - QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); + List a14 = DocPraticaLocalServiceUtil.getValidTmpByIntPratica_Tipologia( + dettPratica.getIntPraticaId(), DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A14, + QueryUtil.ALL_POS, QueryUtil.ALL_POS); + List a05 = DocPraticaLocalServiceUtil.getValidTmpByIntPratica_Tipologia( + dettPratica.getIntPraticaId(), DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A05, + QueryUtil.ALL_POS, QueryUtil.ALL_POS); + List a06 = DocPraticaLocalServiceUtil.getValidTmpByIntPratica_Tipologia( + dettPratica.getIntPraticaId(), DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A06, + QueryUtil.ALL_POS, QueryUtil.ALL_POS); + List a15 = DocPraticaLocalServiceUtil.getValidTmpByIntPratica_Tipologia( + dettPratica.getIntPraticaId(), DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A15, + QueryUtil.ALL_POS, QueryUtil.ALL_POS); + List a16 = DocPraticaLocalServiceUtil.getValidTmpByIntPratica_Tipologie(intPraticaId, + DocumentiPraticaUtil.getIndaginiGeologiche().toArray(new String[0]), QueryUtil.ALL_POS, + QueryUtil.ALL_POS); + + List delegheGeologo = DelegaLocalServiceUtil.findByDettPratica_Tipologia_InEsito( + dettPraticaId, DelegheUtil.TIPO_GEOLOGO, new String[] { DelegheUtil.STATO_ESEGUITA }, + QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); if (a14.isEmpty() && delegheGeologo.isEmpty()) { - notCompleted.add(LanguageUtil.get(LocaleUtil.getDefault(), - "label-documenti-tipologia-" - + DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A14) + notCompleted.add(LanguageUtil.get(LocaleUtil.getDefault(), "label-documenti-tipologia-" + + DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A14) + " non presente"); } else { for (DocPratica doc : a14) { @@ -1698,18 +1381,14 @@ public class ValidazionePraticaUtil { if (Validator.isNotNull(doc.getOldDocPraticaId())) { continue; } else { - FirmeBean firme = FirmeUtil.deserialize(doc - .getJsonFirmatari()); + FirmeBean firme = FirmeUtil.deserialize(doc.getJsonFirmatari()); List signatures = firme.allSignatures(); - if (!isAllRequiredValid(doc.getTipologia(), - dettPratica.getIntPraticaId(), signatures, - AsseverazioniUtil - .getRequiredSubjectsByCodiceDoc(doc - .getTipologia()), doc)) { - GenericUtils.addIfnotExist(notCompleted, - doc.getTipologia() - + " firme obbligatorie mancanti"); + if (!isAllRequiredValid(doc.getTipologia(), dettPratica.getIntPraticaId(), + signatures, + AsseverazioniUtil.getRequiredSubjectsByCodiceDoc(doc.getTipologia()), doc)) { + GenericUtils.addIfnotExist(notCompleted, doc.getTipologia() + + " firme obbligatorie mancanti"); } } @@ -1727,14 +1406,12 @@ public class ValidazionePraticaUtil { if (Validator.isNotNull(doc.getOldDocPraticaId())) { continue; } else { - FirmeBean firme = FirmeUtil.deserialize(doc - .getJsonFirmatari()); + FirmeBean firme = FirmeUtil.deserialize(doc.getJsonFirmatari()); List signatures = firme.allSignatures(); // ADT BUG ID = 19 - List firmeRichieste = AsseverazioniUtil - .getRequiredSubjectsByCodiceDoc(doc - .getTipologia()); + List firmeRichieste = AsseverazioniUtil.getRequiredSubjectsByCodiceDoc(doc + .getTipologia()); List soggettiInseriti = SoggettoLocalServiceUtil .findByIntPratica(dettPratica.getIntPraticaId()); @@ -1744,23 +1421,19 @@ public class ValidazionePraticaUtil { } boolean DLPresente = false; for (Soggetto soggetto : soggettiInseriti) { - if (soggetto.getTipologiaSoggetto().equals( - TipoSoggettoUtil.DIRETTORE_LAVORI)) { + if (soggetto.getTipologiaSoggetto().equals(TipoSoggettoUtil.DIRETTORE_LAVORI)) { DLPresente = true; } } if (!DLPresente || !dettPratica.isLavoriPubblici()) { - firmeFiltrate - .remove(TipoSoggettoUtil.DIRETTORE_LAVORI); + firmeFiltrate.remove(TipoSoggettoUtil.DIRETTORE_LAVORI); } - if (!isAllRequiredValid(doc.getTipologia(), - dettPratica.getIntPraticaId(), signatures, - firmeFiltrate, doc)) { + if (!isAllRequiredValid(doc.getTipologia(), dettPratica.getIntPraticaId(), + signatures, firmeFiltrate, doc)) { - GenericUtils.addIfnotExist(notCompleted, - doc.getTipologia() - + " firme obbligatorie mancanti"); + GenericUtils.addIfnotExist(notCompleted, doc.getTipologia() + + " firme obbligatorie mancanti"); } } } @@ -1775,14 +1448,11 @@ public class ValidazionePraticaUtil { if (Validator.isNotNull(doc.getOldDocPraticaId())) { continue; } else { - FirmeBean firme = FirmeUtil.deserialize(doc - .getJsonFirmatari()); + FirmeBean firme = FirmeUtil.deserialize(doc.getJsonFirmatari()); List signatures = firme.allSignatures(); - if (!isA06Valid(dettPratica, - dettPratica.getIntPraticaId(), signatures, doc)) { + if (!isA06Valid(dettPratica, dettPratica.getIntPraticaId(), signatures, doc)) { // ADT: bug id=22 - notCompleted - .add("A06 firme obbligatorie mancanti "); + notCompleted.add("A06 firme obbligatorie mancanti "); } } } @@ -1799,11 +1469,9 @@ public class ValidazionePraticaUtil { if (Validator.isNotNull(doc.getOldDocPraticaId())) { continue; } else { - FirmeBean firme = FirmeUtil.deserialize(doc - .getJsonFirmatari()); + FirmeBean firme = FirmeUtil.deserialize(doc.getJsonFirmatari()); List signatures = firme.allSignatures(); - if (!isA07A15Valid(dettPratica, intPraticaId, - signatures, doc)) { + if (!isA07A15Valid(dettPratica, intPraticaId, signatures, doc)) { // ADT: bug id=22 notCompleted.add("A15 firme obbligatorie mancanti"); } @@ -1821,18 +1489,14 @@ public class ValidazionePraticaUtil { if (Validator.isNotNull(doc.getOldDocPraticaId())) { continue; } else { - FirmeBean firme = FirmeUtil.deserialize(doc - .getJsonFirmatari()); + FirmeBean firme = FirmeUtil.deserialize(doc.getJsonFirmatari()); List signatures = firme.allSignatures(); - List signaturesPerSubject = getSignaturePerSubject( - intPraticaId, signatures, + List signaturesPerSubject = getSignaturePerSubject(intPraticaId, signatures, TipoSoggettoUtil.GEOLOGO, doc.getClassPk()); if (signaturesPerSubject.isEmpty()) { - notCompleted.add(LanguageUtil.get( - LocaleUtil.getDefault(), - "label-documenti-tipologia-" - + doc.getTipologia()) + notCompleted.add(LanguageUtil.get(LocaleUtil.getDefault(), + "label-documenti-tipologia-" + doc.getTipologia()) + " non firmato dal Geologo"); } } @@ -1845,11 +1509,10 @@ public class ValidazionePraticaUtil { return notCompleted; } - private static List notCompletedDatiSezionGeologica( - long dettPraticaId) throws PortalException, SystemException { + private static List notCompletedDatiSezionGeologica(long dettPraticaId) throws PortalException, + SystemException { - DettPratica dettPratica = DettPraticaServiceUtil - .getDettPratica(dettPraticaId); + DettPratica dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId); List notCompleted = new ArrayList<>(); if (Validator.isNull(dettPratica.getGeoDtRelazione())) { @@ -1919,22 +1582,18 @@ public class ValidazionePraticaUtil { return notCompleted; } - private static List notCompletedAllegatiSezionGeologicaDelega( - long dettPraticaId) throws PortalException, SystemException { + private static List notCompletedAllegatiSezionGeologicaDelega(long dettPraticaId) + throws PortalException, SystemException { - DettPratica dettPratica = DettPraticaServiceUtil - .getDettPratica(dettPraticaId); + DettPratica dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId); List notCompleted = new ArrayList<>(); // Allegati obbligatori devono essere presenti - int a05 = DocPraticaLocalServiceUtil - .countValidTmpByIntPratica_Tipologia( - dettPratica.getIntPraticaId(), - DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A05); + int a05 = DocPraticaLocalServiceUtil.countValidTmpByIntPratica_Tipologia( + dettPratica.getIntPraticaId(), DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A05); if (a05 == 0) { - notCompleted.add(LanguageUtil.get(LocaleUtil.getDefault(), - "label-documenti-tipologia-" - + DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A05) + notCompleted.add(LanguageUtil.get(LocaleUtil.getDefault(), "label-documenti-tipologia-" + + DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A05) + " non presente"); } // int a06 = @@ -1948,31 +1607,25 @@ public class ValidazionePraticaUtil { // } if (!dettPratica.getNormArt3com3()) { - int a14 = DocPraticaLocalServiceUtil - .countValidTmpByIntPratica_Tipologia( - dettPratica.getIntPraticaId(), - DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A14); + int a14 = DocPraticaLocalServiceUtil.countValidTmpByIntPratica_Tipologia( + dettPratica.getIntPraticaId(), DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A14); if (a14 == 0) { - notCompleted.add(LanguageUtil.get(LocaleUtil.getDefault(), - "label-documenti-tipologia-" - + DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A14) + notCompleted.add(LanguageUtil.get(LocaleUtil.getDefault(), "label-documenti-tipologia-" + + DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A14) + " non presente"); } } - int indaginiGeologiche = DocPraticaLocalServiceUtil - .countValidTmpByIntPratica_Tipologie(dettPratica - .getIntPraticaId(), DocumentiPraticaUtil - .getIndaginiGeologiche().toArray(new String[0])); + int indaginiGeologiche = DocPraticaLocalServiceUtil.countValidTmpByIntPratica_Tipologie( + dettPratica.getIntPraticaId(), + DocumentiPraticaUtil.getIndaginiGeologiche().toArray(new String[0])); if (indaginiGeologiche == 0) { notCompleted.add("Indagini Geologoche non presenti"); } - List allegatiGeologici = DocPraticaLocalServiceUtil - .getValidTmpByIntPratica_Tipologie(dettPratica - .getIntPraticaId(), DocumentiPraticaUtil - .getDocGeologo().toArray(new String[0]), - QueryUtil.ALL_POS, QueryUtil.ALL_POS); + List allegatiGeologici = DocPraticaLocalServiceUtil.getValidTmpByIntPratica_Tipologie( + dettPratica.getIntPraticaId(), DocumentiPraticaUtil.getDocGeologo().toArray(new String[0]), + QueryUtil.ALL_POS, QueryUtil.ALL_POS); long intPraticaId = dettPratica.getIntPraticaId(); for (DocPratica doc : allegatiGeologici) { @@ -1987,13 +1640,12 @@ public class ValidazionePraticaUtil { FirmeBean firme = FirmeUtil.deserialize(doc.getJsonFirmatari()); List signatures = firme.allSignatures(); - List signaturesPerSubject = getSignaturePerSubject( - intPraticaId, signatures, TipoSoggettoUtil.GEOLOGO, - doc.getClassPk()); + List signaturesPerSubject = getSignaturePerSubject(intPraticaId, signatures, + TipoSoggettoUtil.GEOLOGO, doc.getClassPk()); // ADT : BUG FE ID=14 : CONTROLLO firma geologo A6 disabilitato if (signaturesPerSubject.isEmpty() && (!checkA06)) { - notCompleted.add(LanguageUtil.get(LocaleUtil.getDefault(), - "label-documenti-tipologia-" + doc.getTipologia()) + notCompleted.add(LanguageUtil.get(LocaleUtil.getDefault(), "label-documenti-tipologia-" + + doc.getTipologia()) + " non firmato dal Geologo"); } @@ -2003,36 +1655,30 @@ public class ValidazionePraticaUtil { return notCompleted; } - private static boolean isSezioneAllegatiCompleta(long dettPraticaId) - throws PortalException, SystemException { + private static boolean isSezioneAllegatiCompleta(long dettPraticaId) throws PortalException, + SystemException { - DettPratica dettPratica = DettPraticaServiceUtil - .getDettPratica(dettPraticaId); + DettPratica dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId); long intPraticaId = dettPratica.getIntPraticaId(); - IntPratica intPratica = IntPraticaLocalServiceUtil - .getIntPratica(intPraticaId); + IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId); - List tipologiaAllegati = DocumentiPraticaUtil - .getDocObbligatoriDomanda(intPratica.getTipoProcedura()); + List tipologiaAllegati = DocumentiPraticaUtil.getDocObbligatoriDomanda(intPratica + .getTipoProcedura()); // ASD List appTipologiaSoggetti = TipoSoggettoUtil.getAllSubjects(); List tipologiaSoggetti = new ArrayList(); - boolean collaudatoreNotRequired = dettPratica.getCollaudoStatico() - || dettPratica.getLavoriPubblici(); + boolean collaudatoreNotRequired = dettPratica.getCollaudoStatico() || dettPratica.getLavoriPubblici(); boolean direttoreLavoriNotRequired = dettPratica.getLavoriPubblici(); - boolean dittaNotRequired = dettPratica.getNormLavoriInProprio() - || dettPratica.getLavoriPubblici(); + boolean dittaNotRequired = dettPratica.getNormLavoriInProprio() || dettPratica.getLavoriPubblici(); for (String tipSoggetto : appTipologiaSoggetti) { - if (tipSoggetto.equals(TipoSoggettoUtil.COLLAUDATORE) - && collaudatoreNotRequired) { + if (tipSoggetto.equals(TipoSoggettoUtil.COLLAUDATORE) && collaudatoreNotRequired) { continue; } - if (tipSoggetto.equals(TipoSoggettoUtil.DIRETTORE_LAVORI) - && direttoreLavoriNotRequired) { + if (tipSoggetto.equals(TipoSoggettoUtil.DIRETTORE_LAVORI) && direttoreLavoriNotRequired) { continue; } @@ -2048,9 +1694,8 @@ public class ValidazionePraticaUtil { for (String codiceDoc : tipologiaAllegati) { if (isDocPraticaRequired(dettPratica, codiceDoc)) { - List docs = DocPraticaLocalServiceUtil - .getValidTmpByIntPratica_Tipologia(intPraticaId, - codiceDoc, QueryUtil.ALL_POS, QueryUtil.ALL_POS); + List docs = DocPraticaLocalServiceUtil.getValidTmpByIntPratica_Tipologia( + intPraticaId, codiceDoc, QueryUtil.ALL_POS, QueryUtil.ALL_POS); if (docs.isEmpty()) { // Ci dev'essere almeno un allegato per ogni tipologia // obbligatoria @@ -2066,62 +1711,48 @@ public class ValidazionePraticaUtil { // Se il documento proviene da una dett precedente non viene // controllato perche si presuppone che sia stata gia // verificato - if (!doc.getClassName().equalsIgnoreCase( - DettPratica.class.getName()) + if (!doc.getClassName().equalsIgnoreCase(DettPratica.class.getName()) || doc.getClassPk() != dettPraticaId) { continue; } contieneDocumenti = true; - FirmeBean firme = FirmeUtil.deserialize(doc - .getJsonFirmatari()); + FirmeBean firme = FirmeUtil.deserialize(doc.getJsonFirmatari()); List signatures = firme.allSignatures(); GenericUtils.addAllIfnotExist(firmeTotali, signatures); - boolean isEnoughOne = AsseverazioniUtil - .isEnoughOne(codiceDoc); + boolean isEnoughOne = AsseverazioniUtil.isEnoughOne(codiceDoc); - if (codiceDoc - .equalsIgnoreCase(DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A00)) { + if (codiceDoc.equalsIgnoreCase(DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A00)) { if (!isA00Valid(dettPratica, signatures)) { return false; } - } else if (codiceDoc - .equalsIgnoreCase(DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A06)) { - if (!isA06Valid(dettPratica, intPraticaId, signatures, - doc)) { + } else if (codiceDoc.equalsIgnoreCase(DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A06)) { + if (!isA06Valid(dettPratica, intPraticaId, signatures, doc)) { // Return false if A06 doesn't contain (Progettista // OR Geologo ) AND Direttore_Lavori return false; } - } else if (DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A07 - .equals(codiceDoc)) { - if (!isA07A15Valid(dettPratica, intPraticaId, - signatures, doc)) { + } else if (DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A07.equals(codiceDoc)) { + if (!isA07A15Valid(dettPratica, intPraticaId, signatures, doc)) { // Return false if A07 doesn't contain Progettista // AND Direttore_Lavori return false; } - } else if (codiceDoc - .equalsIgnoreCase(DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A09)) { - if (!isA09Valid(dettPratica, intPraticaId, signatures, - doc)) { + } else if (codiceDoc.equalsIgnoreCase(DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A09)) { + if (!isA09Valid(dettPratica, intPraticaId, signatures, doc)) { // Return false if A09 doesn't contain Progettista // AND Direttore_Lavori return false; } - } else if (codiceDoc - .equalsIgnoreCase(DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A15)) { - if (!isA07A15Valid(dettPratica, intPraticaId, - signatures, doc)) { + } else if (codiceDoc.equalsIgnoreCase(DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A15)) { + if (!isA07A15Valid(dettPratica, intPraticaId, signatures, doc)) { return false; } - } else if (codiceDoc - .equalsIgnoreCase(DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A17)) { + } else if (codiceDoc.equalsIgnoreCase(DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A17)) { if (!isA17Valid(dettPratica, signatures)) { return false; } - } else if (codiceDoc - .equalsIgnoreCase(DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_DELEGA)) { + } else if (codiceDoc.equalsIgnoreCase(DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_DELEGA)) { if (!isA98Valid(dettPratica, intPraticaId, signatures)) { return false; } @@ -2130,8 +1761,7 @@ public class ValidazionePraticaUtil { // signs for this subjectType return false; } else { - if (!isAllRequiredValid(codiceDoc, intPraticaId, - signatures, tipologiaSoggetti, doc)) { + if (!isAllRequiredValid(codiceDoc, intPraticaId, signatures, tipologiaSoggetti, doc)) { // Return false if is required per this subjectType // but it is not present return false; @@ -2145,13 +1775,11 @@ public class ValidazionePraticaUtil { // Ogni progettista e direttore dei lavori deve avere apposto almeno una // firma sulla totalità degli allegati if (contieneDocumenti) { - List progettisti = SoggettoLocalServiceUtil - .getValidTmpByIntPratica_TipologiaSoggetto(intPraticaId, - TipoSoggettoUtil.PROGETTISTA); + List progettisti = SoggettoLocalServiceUtil.getValidTmpByIntPratica_TipologiaSoggetto( + intPraticaId, TipoSoggettoUtil.PROGETTISTA); for (Soggetto progettista : progettisti) { if (progettista.getDettPraticaId() == dettPraticaId) { - if (!firmeTotali.contains(progettista.getCodiceFiscale() - .toLowerCase())) { + if (!firmeTotali.contains(progettista.getCodiceFiscale().toLowerCase())) { return false; } } @@ -2161,8 +1789,7 @@ public class ValidazionePraticaUtil { TipoSoggettoUtil.DIRETTORE_LAVORI); for (Soggetto direttore : direttoriLavori) { if (direttore.getDettPraticaId() == dettPraticaId) { - if (!firmeTotali.contains(direttore.getCodiceFiscale() - .toLowerCase())) { + if (!firmeTotali.contains(direttore.getCodiceFiscale().toLowerCase())) { return false; } } @@ -2172,19 +1799,17 @@ public class ValidazionePraticaUtil { return true; } - private static List notCompletedSezioniAllegati(long dettPraticaId) - throws PortalException, SystemException { + private static List notCompletedSezioniAllegati(long dettPraticaId) throws PortalException, + SystemException { - DettPratica dettPratica = DettPraticaServiceUtil - .getDettPratica(dettPraticaId); + DettPratica dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId); long intPraticaId = dettPratica.getIntPraticaId(); - IntPratica intPratica = IntPraticaLocalServiceUtil - .getIntPratica(intPraticaId); + IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId); List notCompleted = new ArrayList<>(); - List tipologiaAllegati = DocumentiPraticaUtil - .getDocObbligatoriDomanda(intPratica.getTipoProcedura()); + List tipologiaAllegati = DocumentiPraticaUtil.getDocObbligatoriDomanda(intPratica + .getTipoProcedura()); List tipologiaSoggettiApp = TipoSoggettoUtil.getAllSubjects(); List tipologiaSoggetti = new ArrayList(); @@ -2202,16 +1827,15 @@ public class ValidazionePraticaUtil { for (String codiceDoc : tipologiaAllegati) { if (isDocPraticaRequired(dettPratica, codiceDoc)) { - List docs = DocPraticaLocalServiceUtil - .getValidTmpByIntPratica_Tipologia(intPraticaId, - codiceDoc, QueryUtil.ALL_POS, QueryUtil.ALL_POS); + List docs = DocPraticaLocalServiceUtil.getValidTmpByIntPratica_Tipologia( + intPraticaId, codiceDoc, QueryUtil.ALL_POS, QueryUtil.ALL_POS); if (docs.isEmpty()) { // Ci dev'essere almeno un allegato per ogni tipologia // obbligatoria notCompleted.add("Nessun Allegato per " - + LanguageUtil.get(LocaleUtil.getDefault(), - "label-documenti-tipologia-" + codiceDoc)); + + LanguageUtil.get(LocaleUtil.getDefault(), "label-documenti-tipologia-" + + codiceDoc)); } for (DocPratica doc : docs) { @@ -2223,30 +1847,24 @@ public class ValidazionePraticaUtil { // Se il documento proviene da una dett precedente non viene // controllato // perche si presuppone che sia stata gia verificato - if (!doc.getClassName().equalsIgnoreCase( - DettPratica.class.getName()) + if (!doc.getClassName().equalsIgnoreCase(DettPratica.class.getName()) || doc.getClassPk() != dettPraticaId) { continue; } - FirmeBean firme = FirmeUtil.deserialize(doc - .getJsonFirmatari()); + FirmeBean firme = FirmeUtil.deserialize(doc.getJsonFirmatari()); List signatures = firme.allSignatures(); GenericUtils.addAllIfnotExist(firmeTotali, signatures); - boolean isEnoughOne = AsseverazioniUtil - .isEnoughOne(codiceDoc); + boolean isEnoughOne = AsseverazioniUtil.isEnoughOne(codiceDoc); - if (codiceDoc - .equalsIgnoreCase(DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A00)) { + if (codiceDoc.equalsIgnoreCase(DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A00)) { if (!isA00Valid(dettPratica, signatures)) { // Return false if not esente spese + bolli // ADT: bug id=22 notCompleted.add("A00 firme obbligatorie mancanti"); } - } else if (codiceDoc - .equalsIgnoreCase(DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A06)) { - if (!isA06Valid(dettPratica, intPraticaId, signatures, - doc)) { + } else if (codiceDoc.equalsIgnoreCase(DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A06)) { + if (!isA06Valid(dettPratica, intPraticaId, signatures, doc)) { // Return false if A06 doesn't contain (Progettista // OR Geologo ) AND Direttore_Lavori // ADT: bug id=22 @@ -2260,51 +1878,41 @@ public class ValidazionePraticaUtil { // if (!isA07A15A16Valid(dettPratica, signatures)) { // notCompleted.add("A07 invalido"); // } - } else if (DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A07 - .equals(codiceDoc)) { - if (!isA07A15Valid(dettPratica, intPraticaId, - signatures, doc)) { + } else if (DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A07.equals(codiceDoc)) { + if (!isA07A15Valid(dettPratica, intPraticaId, signatures, doc)) { // Return false if A07 doesn't contain Progettista // AND Direttore_Lavori // ADT: bug id=22 notCompleted.add("A07 firme obbligatorie mancanti"); } - } else if (codiceDoc - .equalsIgnoreCase(DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A09)) { - if (!isA09Valid(dettPratica, intPraticaId, signatures, - doc)) { + } else if (codiceDoc.equalsIgnoreCase(DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A09)) { + if (!isA09Valid(dettPratica, intPraticaId, signatures, doc)) { // Return false if A09 doesn't contain Progettista // AND Direttore_Lavori // ADT: bug id=22 notCompleted.add("A09 firme obbligatorie mancanti"); } - } else if (codiceDoc - .equalsIgnoreCase(DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A15)) { - if (!isA07A15Valid(dettPratica, intPraticaId, - signatures, doc)) { + } else if (codiceDoc.equalsIgnoreCase(DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A15)) { + if (!isA07A15Valid(dettPratica, intPraticaId, signatures, doc)) { // ADT: bug id=22 notCompleted.add("A15 firme obbligatorie mancanti"); } - } else if (codiceDoc - .equalsIgnoreCase(DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A17)) { + } else if (codiceDoc.equalsIgnoreCase(DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A17)) { if (!isA17Valid(dettPratica, signatures)) { // ADT: bug id=22 notCompleted.add("A17 firme obbligatorie mancanti"); } - } else if (codiceDoc - .equalsIgnoreCase(DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_DELEGA)) { + } else if (codiceDoc.equalsIgnoreCase(DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_DELEGA)) { if (!isA98Valid(dettPratica, intPraticaId, signatures)) { // ADT: bug id=22 - notCompleted - .add("Allegato Delega firme obbligatorie mancanti"); + notCompleted.add("Allegato Delega firme obbligatorie mancanti"); } } else if (isEnoughOne && signatures.isEmpty()) { // Return false if one sign is enought but there are no // signs for this subjectType notCompleted.add(codiceDoc + " non firmato"); } else { - if (!isAllRequiredValid(codiceDoc, intPraticaId, - signatures, tipologiaSoggetti, doc)) { + if (!isAllRequiredValid(codiceDoc, intPraticaId, signatures, tipologiaSoggetti, doc)) { // Return false if is required per this subjectType // but it is not present GenericUtils.addIfnotExist(notCompleted, codiceDoc @@ -2318,30 +1926,23 @@ public class ValidazionePraticaUtil { // Ogni progettista e direttore dei lavori deve avere apposto almeno una // firma sulla totalità // degli allegati - List progettisti = SoggettoLocalServiceUtil - .getValidTmpByIntPratica_TipologiaSoggetto(intPraticaId, - TipoSoggettoUtil.PROGETTISTA); + List progettisti = SoggettoLocalServiceUtil.getValidTmpByIntPratica_TipologiaSoggetto( + intPraticaId, TipoSoggettoUtil.PROGETTISTA); for (Soggetto progettista : progettisti) { if (progettista.getDettPraticaId() == dettPraticaId) { - if (!firmeTotali.contains(progettista.getCodiceFiscale() - .toLowerCase())) { - notCompleted.add("Firma del progettista " - + progettista.getDescrizioneCompleta() + if (!firmeTotali.contains(progettista.getCodiceFiscale().toLowerCase())) { + notCompleted.add("Firma del progettista " + progettista.getDescrizioneCompleta() + " richiesta"); } } } - List direttoriLavori = SoggettoLocalServiceUtil - .getValidTmpByIntPratica_TipologiaSoggetto(intPraticaId, - TipoSoggettoUtil.DIRETTORE_LAVORI); + List direttoriLavori = SoggettoLocalServiceUtil.getValidTmpByIntPratica_TipologiaSoggetto( + intPraticaId, TipoSoggettoUtil.DIRETTORE_LAVORI); for (Soggetto direttore : direttoriLavori) { if (direttore.getDettPraticaId() == dettPraticaId) { - if (!firmeTotali.contains(direttore.getCodiceFiscale() - .toLowerCase())) { - notCompleted - .add("Firma del direttore dei lavori " - + direttore.getDescrizioneCompleta() - + " richiesta"); + if (!firmeTotali.contains(direttore.getCodiceFiscale().toLowerCase())) { + notCompleted.add("Firma del direttore dei lavori " + direttore.getDescrizioneCompleta() + + " richiesta"); } } } @@ -2349,15 +1950,13 @@ public class ValidazionePraticaUtil { return notCompleted; } - private static List getSignaturePerSubject(long intPraticaId, - List signatures, String tipoSoggetto, long docPraticaClassPk) - throws SystemException { + private static List getSignaturePerSubject(long intPraticaId, List signatures, + String tipoSoggetto, long docPraticaClassPk) throws SystemException { List signaturesPerSubject = new ArrayList(); for (String sign : signatures) { - List soggetti = SoggettoLocalServiceUtil - .getValidTmpByIntPratica_CodiceFiscale(intPraticaId, sign, - docPraticaClassPk); + List soggetti = SoggettoLocalServiceUtil.getValidTmpByIntPratica_CodiceFiscale( + intPraticaId, sign, docPraticaClassPk); for (Soggetto soggetto : soggetti) { if (soggetto.getTipologiaSoggetto().equals(tipoSoggetto) && !signaturesPerSubject.contains(sign)) { @@ -2368,8 +1967,8 @@ public class ValidazionePraticaUtil { return signaturesPerSubject; } - private static boolean isDocPraticaRequired(DettPratica dettPratica, - String codiceDoc) throws SystemException, PortalException { + private static boolean isDocPraticaRequired(DettPratica dettPratica, String codiceDoc) + throws SystemException, PortalException { boolean required = true; @@ -2402,9 +2001,8 @@ public class ValidazionePraticaUtil { } - public static boolean isA06Valid(DettPratica dettPratica, - long intPraticaId, List signatures, DocPratica docPratica) - throws SystemException { + public static boolean isA06Valid(DettPratica dettPratica, long intPraticaId, List signatures, + DocPratica docPratica) throws SystemException { boolean isProgettista = false; boolean isGeologo = false; @@ -2419,18 +2017,14 @@ public class ValidazionePraticaUtil { // List soggetti = // SoggettoLocalServiceUtil.findByIntPratica_CodiceFiscale(intPraticaId, // sign); - List soggetti = SoggettoLocalServiceUtil - .getValidTmpByIntPratica_CodiceFiscale(intPraticaId, sign, - docPratica.getClassPk()); + List soggetti = SoggettoLocalServiceUtil.getValidTmpByIntPratica_CodiceFiscale( + intPraticaId, sign, docPratica.getClassPk()); for (Soggetto soggetto : soggetti) { - if (TipoSoggettoUtil.PROGETTISTA.equals(soggetto - .getTipologiaSoggetto())) { + if (TipoSoggettoUtil.PROGETTISTA.equals(soggetto.getTipologiaSoggetto())) { isProgettista = true; - } else if (TipoSoggettoUtil.GEOLOGO.equals(soggetto - .getTipologiaSoggetto())) { + } else if (TipoSoggettoUtil.GEOLOGO.equals(soggetto.getTipologiaSoggetto())) { isGeologo = true; - } else if (TipoSoggettoUtil.DIRETTORE_LAVORI.equals(soggetto - .getTipologiaSoggetto())) { + } else if (TipoSoggettoUtil.DIRETTORE_LAVORI.equals(soggetto.getTipologiaSoggetto())) { isDirettoreLavori = true; } } @@ -2443,14 +2037,11 @@ public class ValidazionePraticaUtil { return isDirettoreLavori && (isProgettista || isGeologo); } - public static boolean isA00Valid(DettPratica dettPratica, - List signatures) throws SystemException { + public static boolean isA00Valid(DettPratica dettPratica, List signatures) throws SystemException { // Se esente contributi A00 non obbligatorio - boolean isEsente = dettPratica.getNormEsenteBollo() - && dettPratica.getNormEsenteSpese(); - boolean isRiparazioneLocale = dettPratica - .getTcRiparazioneInterventoLocale() + boolean isEsente = dettPratica.getNormEsenteBollo() && dettPratica.getNormEsenteSpese(); + boolean isRiparazioneLocale = dettPratica.getTcRiparazioneInterventoLocale() && !dettPratica.getTcNuovaCostruzione(); return isEsente || isRiparazioneLocale || !signatures.isEmpty(); } @@ -2462,12 +2053,11 @@ public class ValidazionePraticaUtil { // return dettPratica.getNormArt3com3() || !signatures.isEmpty(); // } - public static boolean isA07A15Valid(DettPratica dettPratica, - long intPraticaId, List signatures, DocPratica doc) - throws SystemException { + public static boolean isA07A15Valid(DettPratica dettPratica, long intPraticaId, List signatures, + DocPratica doc) throws SystemException { - List requiredSubjectsApp = AsseverazioniUtil - .getRequiredSubjectsByCodiceDoc(doc.getTipologia()); + List requiredSubjectsApp = AsseverazioniUtil.getRequiredSubjectsByCodiceDoc(doc + .getTipologia()); List requiredSubjects = new ArrayList(); if (dettPratica.getLavoriPubblici()) { @@ -2481,14 +2071,12 @@ public class ValidazionePraticaUtil { } return dettPratica.getNormArt3com3() - || isAllRequiredValid(doc.getTipologia(), intPraticaId, - signatures, requiredSubjects, doc); + || isAllRequiredValid(doc.getTipologia(), intPraticaId, signatures, requiredSubjects, doc); } - public static boolean isA09Valid(DettPratica dettPratica, - long intPraticaId, List signatures, DocPratica docPratica) - throws SystemException { + public static boolean isA09Valid(DettPratica dettPratica, long intPraticaId, List signatures, + DocPratica docPratica) throws SystemException { if (dettPratica.getNormArt3com4()) { return true; @@ -2499,14 +2087,12 @@ public class ValidazionePraticaUtil { if (dettPratica.getLavoriPubblici()) { tipoSoggetti = Arrays.asList(TipoSoggettoUtil.PROGETTISTA); } else { - tipoSoggetti = Arrays.asList(TipoSoggettoUtil.PROGETTISTA, - TipoSoggettoUtil.DIRETTORE_LAVORI); + tipoSoggetti = Arrays.asList(TipoSoggettoUtil.PROGETTISTA, TipoSoggettoUtil.DIRETTORE_LAVORI); } for (String tipoSoggetto : tipoSoggetti) { - List signaturesPerSubject = getSignaturePerSubject( - intPraticaId, signatures, tipoSoggetto, - docPratica.getClassPk()); + List signaturesPerSubject = getSignaturePerSubject(intPraticaId, signatures, + tipoSoggetto, docPratica.getClassPk()); if (signaturesPerSubject.isEmpty()) { return false; } @@ -2517,8 +2103,7 @@ public class ValidazionePraticaUtil { // A17 richiesto se CF ditta = CF committente e in quel caso dev'essere // firmato da almeno un soggetto - public static boolean isA17Valid(DettPratica dettPratica, - List signatures) throws SystemException { + public static boolean isA17Valid(DettPratica dettPratica, List signatures) throws SystemException { boolean isRequired = isA17Required(dettPratica); if (isRequired && signatures.isEmpty()) { @@ -2528,35 +2113,27 @@ public class ValidazionePraticaUtil { return true; } - private static boolean isA17Required(DettPratica dettPratica) - throws SystemException { + private static boolean isA17Required(DettPratica dettPratica) throws SystemException { - List ditte = SoggettoLocalServiceUtil - .findByDettPratica_TipologiaSoggetto( - dettPratica.getDettPraticaId(), TipoSoggettoUtil.DITTA); - List committenti = SoggettoLocalServiceUtil - .findByDettPratica_TipologiaSoggetto( - dettPratica.getDettPraticaId(), - TipoSoggettoUtil.COMMITTENTE); - boolean isRequired = AsseverazioniUtil.isRequiredTerna( - DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A17, ditte, - committenti, dettPratica); + List ditte = SoggettoLocalServiceUtil.findByDettPratica_TipologiaSoggetto( + dettPratica.getDettPraticaId(), TipoSoggettoUtil.DITTA); + List committenti = SoggettoLocalServiceUtil.findByDettPratica_TipologiaSoggetto( + dettPratica.getDettPraticaId(), TipoSoggettoUtil.COMMITTENTE); + boolean isRequired = AsseverazioniUtil.isRequiredTerna(DocumentiPraticaUtil.TIPOLOGIA_ALLEGATO_A17, + ditte, committenti, dettPratica); return isRequired; } // Allegato Delega richiesto se il titolare Digitale pratica non è fra i // committenti - public static boolean isA98Required(DettPratica dettPratica) - throws SystemException, PortalException { + public static boolean isA98Required(DettPratica dettPratica) throws SystemException, PortalException { - return !SoggettiUtil.isTitolareInCommittenti(dettPratica - .getIntPraticaId()); + return !SoggettiUtil.isTitolareInCommittenti(dettPratica.getIntPraticaId()); } - public static boolean isA98Valid(DettPratica dettPratica, - long intPraticaId, List signatures) throws SystemException, - PortalException { + public static boolean isA98Valid(DettPratica dettPratica, long intPraticaId, List signatures) + throws SystemException, PortalException { if (SoggettiUtil.isTitolareInCommittenti(intPraticaId)) { return true; @@ -2569,18 +2146,15 @@ public class ValidazionePraticaUtil { } - public static boolean isAllRequiredValid(String codiceDoc, - long intPraticaId, List signatures, - List tipologiaSoggetti, DocPratica docPratica) - throws SystemException { + public static boolean isAllRequiredValid(String codiceDoc, long intPraticaId, List signatures, + List tipologiaSoggetti, DocPratica docPratica) throws SystemException { for (String tipoSoggetto : tipologiaSoggetti) { boolean isRequired = AsseverazioniUtil .isAsseverazioneRequiredByCodiceDoc(codiceDoc, tipoSoggetto); if (isRequired) { - List signaturesPerSubject = getSignaturePerSubject( - intPraticaId, signatures, tipoSoggetto, - docPratica.getClassPk()); + List signaturesPerSubject = getSignaturePerSubject(intPraticaId, signatures, + tipoSoggetto, docPratica.getClassPk()); if (signaturesPerSubject.isEmpty()) { return false; } @@ -2589,18 +2163,15 @@ public class ValidazionePraticaUtil { return true; } - public static boolean isOneRequiredValid(String codiceDoc, - long intPraticaId, List signatures, - List tipologiaSoggetti, DocPratica docPratica) - throws SystemException { + public static boolean isOneRequiredValid(String codiceDoc, long intPraticaId, List signatures, + List tipologiaSoggetti, DocPratica docPratica) throws SystemException { for (String tipoSoggetto : tipologiaSoggetti) { boolean isRequired = AsseverazioniUtil .isAsseverazioneRequiredByCodiceDoc(codiceDoc, tipoSoggetto); if (isRequired) { - List signaturesPerSubject = getSignaturePerSubject( - intPraticaId, signatures, tipoSoggetto, - docPratica.getClassPk()); + List signaturesPerSubject = getSignaturePerSubject(intPraticaId, signatures, + tipoSoggetto, docPratica.getClassPk()); if (!signaturesPerSubject.isEmpty()) { return true; } @@ -2609,36 +2180,33 @@ public class ValidazionePraticaUtil { return false; } - public static boolean isFineLavoriDatiCompleted(long fineLavoriId) - throws PortalException, SystemException { + public static boolean isFineLavoriDatiCompleted(long fineLavoriId) throws PortalException, + SystemException { return notCompletedFineLavoriDati(fineLavoriId).isEmpty(); } - public static List notCompletedFineLavoriDati(long fineLavoriId) - throws PortalException, SystemException { + public static List notCompletedFineLavoriDati(long fineLavoriId) throws PortalException, + SystemException { - FineLavori fineLavori = FineLavoriServiceUtil - .getFineLavori(fineLavoriId); + FineLavori fineLavori = FineLavoriServiceUtil.getFineLavori(fineLavoriId); List notCompleted = new ArrayList<>(); if (Validator.isNull(fineLavori.getParziale())) { notCompleted.add("fl-tipo"); } if (fineLavori.getParziale() - && FineLavoriLocalServiceUtil.countByIntPraticaId_Parziale( - fineLavori.getIntPraticaId(), false) > 0) { + && FineLavoriLocalServiceUtil.countByIntPraticaId_Parziale(fineLavori.getIntPraticaId(), + false) > 0) { notCompleted.add("fl-parziale-not-possibile"); } if (Validator.isNull(fineLavori.getDataFineLavori())) { notCompleted.add("fl-data-fine"); } - IntPratica intPratica = IntPraticaLocalServiceUtil - .getIntPratica(fineLavori.getIntPraticaId()); + IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(fineLavori.getIntPraticaId()); if (Validator.isNull(fineLavori.getDataFineLavori()) - || fineLavori.getDataFineLavori().before( - intPratica.getDtPratica())) { + || fineLavori.getDataFineLavori().before(intPratica.getDtPratica())) { notCompleted.add("fl-data-fine-early"); } @@ -2649,15 +2217,13 @@ public class ValidazionePraticaUtil { return notCompleted; } - private static boolean isFineLavoriAllegatiCompleted(long fineLavoriId) - throws PortalException, SystemException { + private static boolean isFineLavoriAllegatiCompleted(long fineLavoriId) throws PortalException, + SystemException { - FineLavori fineLavori = FineLavoriServiceUtil - .getFineLavori(fineLavoriId); + FineLavori fineLavori = FineLavoriServiceUtil.getFineLavori(fineLavoriId); long intPraticaId = fineLavori.getIntPraticaId(); - List tipologiaAllegati = DocumentiPraticaUtil - .getDocObbligatoriFineLavori(); + List tipologiaAllegati = DocumentiPraticaUtil.getDocObbligatoriFineLavori(); List tipologiaSoggetti = TipoSoggettoUtil.getAllSubjects(); for (String codiceDoc : tipologiaAllegati) { @@ -2667,9 +2233,8 @@ public class ValidazionePraticaUtil { // codiceDoc, QueryUtil.ALL_POS, // QueryUtil.ALL_POS); // ADT BUG FE ID = 13 - List docs = DocPraticaLocalServiceUtil - .findByClassPk_Tipologia(fineLavoriId, codiceDoc, - QueryUtil.ALL_POS, QueryUtil.ALL_POS); + List docs = DocPraticaLocalServiceUtil.findByClassPk_Tipologia(fineLavoriId, + codiceDoc, QueryUtil.ALL_POS, QueryUtil.ALL_POS); if (docs.isEmpty()) { return false; // Ci dev'essere almeno un allegato per tipo // obbligatorio @@ -2679,8 +2244,7 @@ public class ValidazionePraticaUtil { FirmeBean firme = FirmeUtil.deserialize(doc.getJsonFirmatari()); List signatures = firme.allSignatures(); - if (!isAllRequiredValid(codiceDoc, intPraticaId, signatures, - tipologiaSoggetti, doc)) { + if (!isAllRequiredValid(codiceDoc, intPraticaId, signatures, tipologiaSoggetti, doc)) { return false; // Return false if is required per this // subjectType but it is not present } @@ -2691,14 +2255,13 @@ public class ValidazionePraticaUtil { return true; } - public static boolean isCollaudoDatiCompleted(long collaudoId) - throws PortalException, SystemException { + public static boolean isCollaudoDatiCompleted(long collaudoId) throws PortalException, SystemException { return notCompletedCollaudoDati(collaudoId).isEmpty(); } - public static List notCompletedCollaudoDati(long collaudoId) - throws PortalException, SystemException { + public static List notCompletedCollaudoDati(long collaudoId) throws PortalException, + SystemException { Collaudo collaudo = CollaudoServiceUtil.getCollaudo(collaudoId); List notCompleted = new ArrayList<>(); @@ -2707,14 +2270,12 @@ public class ValidazionePraticaUtil { notCompleted.add("col-tipo"); } if (collaudo.getParziale() - && CollaudoLocalServiceUtil.countByIntPraticaId_Parziale( - collaudo.getIntPraticaId(), false) > 0) { + && CollaudoLocalServiceUtil.countByIntPraticaId_Parziale(collaudo.getIntPraticaId(), false) > 0) { notCompleted.add("col-parziale-not-possibile"); } if (!collaudo.getParziale() - && FineLavoriLocalServiceUtil - .countByIntPraticaId_Parziale_Completata( - collaudo.getIntPraticaId(), false, true) == 0) { + && FineLavoriLocalServiceUtil.countByIntPraticaId_Parziale_Completata( + collaudo.getIntPraticaId(), false, true) == 0) { notCompleted.add("col-totale-not-possibile"); } if (Validator.isNull(collaudo.getDataCollaudo())) { @@ -2727,21 +2288,19 @@ public class ValidazionePraticaUtil { return notCompleted; } - private static boolean isCollaudoAllegatiCompleted(long collaudoId) - throws PortalException, SystemException { + private static boolean isCollaudoAllegatiCompleted(long collaudoId) throws PortalException, + SystemException { Collaudo collaudo = CollaudoServiceUtil.getCollaudo(collaudoId); long intPraticaId = collaudo.getIntPraticaId(); - List tipologiaAllegati = DocumentiPraticaUtil - .getDocObbligatoriCollaudo(); + List tipologiaAllegati = DocumentiPraticaUtil.getDocObbligatoriCollaudo(); List tipologiaSoggetti = TipoSoggettoUtil.getAllSubjects(); for (String codiceDoc : tipologiaAllegati) { - List docs = DocPraticaLocalServiceUtil - .getValidTmpByIntPratica_Tipologia(intPraticaId, codiceDoc, - QueryUtil.ALL_POS, QueryUtil.ALL_POS); + List docs = DocPraticaLocalServiceUtil.getValidTmpByIntPratica_Tipologia( + intPraticaId, codiceDoc, QueryUtil.ALL_POS, QueryUtil.ALL_POS); if (docs.isEmpty()) { return false; // Ci dev'essere almeno un allegato per tipo // obbligatorio @@ -2751,8 +2310,7 @@ public class ValidazionePraticaUtil { FirmeBean firme = FirmeUtil.deserialize(doc.getJsonFirmatari()); List signatures = firme.allSignatures(); - if (!isAllRequiredValid(codiceDoc, intPraticaId, signatures, - tipologiaSoggetti, doc)) { + if (!isAllRequiredValid(codiceDoc, intPraticaId, signatures, tipologiaSoggetti, doc)) { return false; // Return false if is required per this // subjectType but it is not present } @@ -2763,12 +2321,10 @@ public class ValidazionePraticaUtil { return true; } - public static boolean isAsseverazioneSignedByOwner(String fileName, - byte[] fileBytes, long companyId, String codiceFiscaleOwner, - String jsonFirmatariApplicativo) throws Exception { + public static boolean isAsseverazioneSignedByOwner(String fileName, byte[] fileBytes, long companyId, + String codiceFiscaleOwner, String jsonFirmatariApplicativo) throws Exception { - List signatures = gatherSignatures(fileName, fileBytes, - companyId, jsonFirmatariApplicativo); + List signatures = gatherSignatures(fileName, fileBytes, companyId, jsonFirmatariApplicativo); for (String cfSoggetto : signatures) { if (cfSoggetto.equalsIgnoreCase(codiceFiscaleOwner)) { @@ -2779,12 +2335,10 @@ public class ValidazionePraticaUtil { return false; } - public static boolean isAllegatoSignedBySubjects(String fileName, - byte[] fileBytes, long companyId, List cfSoggetti, - String jsonFirmatariApplicativo) throws Exception { + public static boolean isAllegatoSignedBySubjects(String fileName, byte[] fileBytes, long companyId, + List cfSoggetti, String jsonFirmatariApplicativo) throws Exception { - List signatures = gatherSignatures(fileName, fileBytes, - companyId, jsonFirmatariApplicativo); + List signatures = gatherSignatures(fileName, fileBytes, companyId, jsonFirmatariApplicativo); for (String cfSign : signatures) { for (String cfSoggetto : cfSoggetti) { @@ -2797,13 +2351,11 @@ public class ValidazionePraticaUtil { return false; } - public static boolean isAllegatoSignedBySubjectsAndPerson(String fileName, - byte[] fileBytes, long companyId, List cfSoggetti, - String codiceFiscalePersona, String jsonFirmatariApplicativo) - throws Exception { + public static boolean isAllegatoSignedBySubjectsAndPerson(String fileName, byte[] fileBytes, + long companyId, List cfSoggetti, String codiceFiscalePersona, + String jsonFirmatariApplicativo) throws Exception { - List signatures = gatherSignatures(fileName, fileBytes, - companyId, jsonFirmatariApplicativo); + List signatures = gatherSignatures(fileName, fileBytes, companyId, jsonFirmatariApplicativo); boolean isSignedPersona = false; boolean isSignedSoggetti = false; @@ -2826,9 +2378,8 @@ public class ValidazionePraticaUtil { return isSignedPersona && isSignedSoggetti; } - public static List gatherSignatures(String fileName, - byte[] fileBytes, long companyId, String jsonFirmatariApplicativo) - throws PortalException, SystemException, IOException { + public static List gatherSignatures(String fileName, byte[] fileBytes, long companyId, + String jsonFirmatariApplicativo) throws PortalException, SystemException, IOException { List signatures = new ArrayList<>(); if (Validator.isNotNull(jsonFirmatariApplicativo)) { @@ -2843,13 +2394,11 @@ public class ValidazionePraticaUtil { return signatures; } - private static List extractSigns(long companyId, String fileName, - byte[] fileBytes) throws IOException, PortalException, - SystemException { + private static List extractSigns(long companyId, String fileName, byte[] fileBytes) + throws IOException, PortalException, SystemException { Company company = CompanyLocalServiceUtil.getCompany(companyId); - String urlPdfExtractor = (String) company.getExpandoBridge() - .getAttribute("url_pdf_extractor", false); + String urlPdfExtractor = (String) company.getExpandoBridge().getAttribute("url_pdf_extractor", false); HttpPost request = new HttpPost(urlPdfExtractor); MultipartEntityBuilder builder = MultipartEntityBuilder.create(); @@ -2859,14 +2408,11 @@ public class ValidazionePraticaUtil { CloseableHttpClient client = HttpClientBuilder.create().build(); HttpResponse httpResponse = client.execute(request); int statusCode = httpResponse.getStatusLine().getStatusCode(); - String responseBody = EntityUtils.toString(httpResponse.getEntity(), - StringPool.UTF8); + String responseBody = EntityUtils.toString(httpResponse.getEntity(), StringPool.UTF8); client.close(); - if (statusCode == HttpServletResponse.SC_OK - || statusCode == HttpServletResponse.SC_CREATED) { - JSONArray arrayFirme = JSONFactoryUtil.createJSONObject( - responseBody).getJSONArray("cf"); + if (statusCode == HttpServletResponse.SC_OK || statusCode == HttpServletResponse.SC_CREATED) { + JSONArray arrayFirme = JSONFactoryUtil.createJSONObject(responseBody).getJSONArray("cf"); List cf = new UniqueList(); for (int i = 0; i < arrayFirme.length(); i++) { cf.add(arrayFirme.getString(i)); @@ -2874,8 +2420,7 @@ public class ValidazionePraticaUtil { return cf; } else { - _log.warn("P7M REST extractor error. Response: " - + new String(responseBody)); + _log.warn("P7M REST extractor error. Response: " + new String(responseBody)); } return Collections.emptyList(); diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/AllegatiUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/AllegatiUtil.java index 2416379b..cbb6fc06 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/AllegatiUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/AllegatiUtil.java @@ -1,10 +1,7 @@ package it.mwg.sismica.bo.util; -import it.tref.liferay.portos.bo.model.Collaudo; -import it.tref.liferay.portos.bo.model.Delega; import it.tref.liferay.portos.bo.model.DettPratica; import it.tref.liferay.portos.bo.model.DocPratica; -import it.tref.liferay.portos.bo.model.FineLavori; import it.tref.liferay.portos.bo.model.IntPratica; import it.tref.liferay.portos.bo.model.Pagamento; import it.tref.liferay.portos.bo.model.Soggetto; @@ -13,20 +10,17 @@ import it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil; import it.tref.liferay.portos.bo.service.DocPraticaLocalServiceUtil; import it.tref.liferay.portos.bo.service.PagamentoLocalServiceUtil; import it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil; -import it.tref.liferay.portos.bo.service.SoggettoServiceUtil; import it.tref.liferay.portos.bo.shared.bean.FirmeBean; import it.tref.liferay.portos.bo.shared.bean.FirmeDetail; import it.tref.liferay.portos.bo.shared.util.ConfigurazioneConstants; import it.tref.liferay.portos.bo.shared.util.DocumentiPraticaUtil; import it.tref.liferay.portos.bo.shared.util.FirmeUtil; -import it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil; import it.tref.liferay.portos.bo.util.PraticaUtil; import it.tref.liferay.portos.bo.util.ValidazionePraticaUtil; import java.io.File; import java.io.IOException; import java.util.ArrayList; -import java.util.Arrays; import java.util.Date; import java.util.HashSet; import java.util.List; @@ -43,7 +37,6 @@ import com.liferay.portal.kernel.log.Log; import com.liferay.portal.kernel.log.LogFactoryUtil; import com.liferay.portal.kernel.repository.model.FileEntry; import com.liferay.portal.kernel.repository.model.Folder; -import com.liferay.portal.kernel.servlet.SessionErrors; import com.liferay.portal.kernel.upload.UploadPortletRequest; import com.liferay.portal.kernel.util.FileUtil; import com.liferay.portal.kernel.util.MimeTypesUtil; @@ -53,7 +46,6 @@ import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.model.User; import com.liferay.portal.security.permission.ActionKeys; import com.liferay.portal.service.ServiceContext; -import com.liferay.portal.service.ServiceContextFactory; import com.liferay.portal.service.UserLocalServiceUtil; import com.liferay.portal.util.PortalUtil; import com.liferay.portlet.documentlibrary.NoSuchFolderException; @@ -280,208 +272,4 @@ public class AllegatiUtil { } return fileEntry; } - - public void sostituisciDL2(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { - - long userId = 0; - String title = null; - String description = null; - String mimeType = null; - String changeLog = StringPool.BLANK; - FileEntry fileEntry = null; - Date now = new Date(); - long companyId = 0; - long groupId = 0; - long defaultFolderId = 0; - Folder defaultFolder = null; - String folderName = null; - byte[] bytes = null; - long folderId = 0; - long repositoryId = 0; - ServiceContext serviceContext = new ServiceContext(); - - String className = ParamUtil.getString(actionRequest, "className"); - Long idOggetto = ParamUtil.getLong(actionRequest, "classPK"); - - UploadPortletRequest uploadRequest = PortalUtil.getUploadPortletRequest(actionRequest); - String sourceFileName = uploadRequest.getFileName("file"); - File file = uploadRequest.getFile("file"); - Folder folder = null; - - switch (className) { - case "it.tref.liferay.portos.bo.model.DocPratica": - DocPratica pratica = DocPraticaLocalServiceUtil.getDocPratica(idOggetto); - userId = pratica.getUserId(); - companyId = pratica.getCompanyId(); - groupId = pratica.getGroupId(); - - serviceContext.setCompanyId(companyId); - serviceContext.setScopeGroupId(groupId); - serviceContext.setUserId(userId); - - defaultFolderId = ConfigurazioneLocalServiceUtil.findByC_ChiaveLong(companyId, - ConfigurazioneConstants.ATTACHMENT_FOLDER_ID); - defaultFolder = DLAppLocalServiceUtil.getFolder(defaultFolderId); - folderName = PraticaUtil.getFolderName(pratica.getClassPk()); - folderId = defaultFolder.getFolderId(); - repositoryId = defaultFolder.getRepositoryId(); - - try { - folder = DLAppLocalServiceUtil.getFolder(repositoryId, folderId, folderName); - } catch (NoSuchFolderException e) { - folder = DLAppLocalServiceUtil.addFolder(userId, repositoryId, folderId, folderName, - StringPool.BLANK, serviceContext); - } - - bytes = FileUtil.getBytes(file); - title = pratica.getTipologia() + StringPool.UNDERLINE + sourceFileName; - description = sourceFileName; - mimeType = MimeTypesUtil.getContentType(sourceFileName); - - try { - fileEntry = DLAppLocalServiceUtil.getFileEntry(pratica.getDlFileEntryId()); - fileEntry = DLAppLocalServiceUtil.updateFileEntry(userId, fileEntry.getFileEntryId(), - now.getTime() + "_" + sourceFileName, mimeType, title, description, changeLog, false, - bytes, serviceContext); - } catch (PortalException e) { - fileEntry = DLAppLocalServiceUtil.addFileEntry(userId, folder.getRepositoryId(), - folder.getFolderId(), now.getTime() + "_" + sourceFileName, mimeType, title, - description, changeLog, bytes, serviceContext); - } - - pratica.setDlFileEntryId(fileEntry.getFileEntryId()); - pratica.setSha256(DigestUtils.sha256Hex(bytes)); - DocPraticaLocalServiceUtil.updateDocPratica(pratica); - break; - - case "it.tref.liferay.portos.bo.model.Pagamento": - Pagamento pagamento = PagamentoLocalServiceUtil.getPagamento(idOggetto); - userId = pagamento.getUserId(); - companyId = pagamento.getCompanyId(); - groupId = pagamento.getGroupId(); - - serviceContext.setCompanyId(companyId); - serviceContext.setScopeGroupId(groupId); - serviceContext.setUserId(userId); - - defaultFolderId = ConfigurazioneLocalServiceUtil.findByC_ChiaveLong(companyId, - ConfigurazioneConstants.ATTACHMENT_FOLDER_ID); - defaultFolder = DLAppLocalServiceUtil.getFolder(defaultFolderId); - folderName = PraticaUtil.getFolderName(pagamento.getClassPk()); - folderId = defaultFolder.getFolderId(); - repositoryId = defaultFolder.getRepositoryId(); - - try { - folder = DLAppLocalServiceUtil.getFolder(repositoryId, folderId, folderName); - } catch (NoSuchFolderException e) { - folder = DLAppLocalServiceUtil.addFolder(userId, repositoryId, folderId, folderName, - StringPool.BLANK, serviceContext); - } - - bytes = FileUtil.getBytes(file); - title = now.getTime() + StringPool.UNDERLINE + "pagamento_manuale" + StringPool.UNDERLINE - + pagamento.getPagamentoId() + StringPool.UNDERLINE + sourceFileName; - description = StringPool.BLANK; - mimeType = MimeTypesUtil.getContentType(sourceFileName); - - try { - fileEntry = DLAppLocalServiceUtil.getFileEntry(pagamento.getFileEntryId()); - fileEntry = DLAppLocalServiceUtil.updateFileEntry(userId, fileEntry.getFileEntryId(), - now.getTime() + "_" + sourceFileName, mimeType, title, description, changeLog, false, - bytes, serviceContext); - } catch (PortalException e) { - fileEntry = DLAppLocalServiceUtil.addFileEntry(userId, folder.getRepositoryId(), - folder.getFolderId(), now.getTime() + "_" + sourceFileName, mimeType, title, - description, changeLog, bytes, serviceContext); - } - - pagamento.setFileEntryId(fileEntry.getFileEntryId()); - PagamentoLocalServiceUtil.updatePagamento(pagamento); - break; - - case "var_soggetti_no_docpratica": - Soggetto soggetto = SoggettoLocalServiceUtil.getSoggetto(idOggetto); - DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(soggetto.getDettPraticaId()); - long intPraticaId = dettPratica.getIntPraticaId(); - serviceContext = ServiceContextFactory.getInstance(Soggetto.class.getName(), actionRequest); - - byte[] content = null; - String jsonFirmatari = ""; - boolean isSigned = false; - FirmeBean firmeBean = new FirmeBean(); - - User user = UserLocalServiceUtil.getUser(serviceContext.getUserId()); - - if (!firmeBean.allSignatures().contains(user.getScreenName())) { - jsonFirmatari = FirmeUtil.addFirma(firmeBean, user.getScreenName()); - } else { - jsonFirmatari = FirmeUtil.serialize(firmeBean); - } - - if (file.exists()) { - - if (Validator.isNotNull(sourceFileName) && file != null) { - // validazione: solo alcune estensioni - String ext = FileUtil.getExtension(sourceFileName); - if (!ext.equalsIgnoreCase("p7m") && !ext.equalsIgnoreCase("pdf")) { - SessionErrors.add(actionRequest, - "error.geniocivilefe.variazione-soggetto.allegato.ext.valid"); - } - // lunghezza fissata a 200 - if (sourceFileName.length() > 200) { - SessionErrors.add(actionRequest, - "error.geniocivilefe.variazione-soggetto.allegato.length.valid"); - } - } else if (!TipoSoggettoUtil.COMMITTENTE.equalsIgnoreCase(soggetto.getTipologiaSoggetto())) { - SessionErrors.add(actionRequest, - "error.geniocivilefe.variazione-soggetto.allegato.is.request"); - } - - if (!SessionErrors.isEmpty(actionRequest)) { - throw new SystemException("error.geniocivilefe.variazione-soggetto.allegato"); - } else if (file != null) { - content = FileUtil.getBytes(file); - } - - } - - if (TipoSoggettoUtil.COMMITTENTE.equals(soggetto.getTipologiaSoggetto())) { - String[] titolare = new String[] { dettPratica.getCodiceFiscaleDelegatoCommittente() }; - isSigned = ValidazionePraticaUtil.isAllegatoSignedBySubjects(sourceFileName, content, - serviceContext.getCompanyId(), Arrays.asList(titolare), jsonFirmatari); - } else { - List soggettiValidi = SoggettoServiceUtil.getValidTmpByIntPratica(intPraticaId); - List codiciFiscaliValidi = new ArrayList(); - for (Soggetto valido : soggettiValidi) { - if (!codiciFiscaliValidi.contains(valido.getCodiceFiscale()) - && !valido.getCodiceFiscale().equalsIgnoreCase(soggetto.getCodiceFiscale())) { - codiciFiscaliValidi.add(valido.getCodiceFiscale()); - } - } - isSigned = ValidazionePraticaUtil.isAllegatoSignedBySubjectsAndPerson(sourceFileName, - content, serviceContext.getCompanyId(), codiciFiscaliValidi, - soggetto.getCodiceFiscale(), jsonFirmatari); - } - - if (isSigned) { - userId = PortalUtil.getUserId(actionRequest); - - try { - SoggettoServiceUtil.allegaFileModifica(soggetto.getSoggettoId(), userId, intPraticaId, - content, sourceFileName, jsonFirmatari, serviceContext); - } catch (PortalException e) { - _log.error(e, e); - throw e; - } - } - - break; - - default: - - break; - - } - - } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/ManutenzioneDatabase.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/ManutenzioneDatabase.java new file mode 100644 index 00000000..858d18ba --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/ManutenzioneDatabase.java @@ -0,0 +1,1284 @@ +/** + * + * @author Salvatore La Manna, Manifattura Web Group per Regione Siciliana + * + */ +package it.mwg.sismica.bo.util; + +import it.tref.liferay.portos.bo.model.AllegatoManuale; +import it.tref.liferay.portos.bo.model.Asseverazione; +import it.tref.liferay.portos.bo.model.Avviso; +import it.tref.liferay.portos.bo.model.Collaudo; +import it.tref.liferay.portos.bo.model.ControlloPratica; +import it.tref.liferay.portos.bo.model.Delega; +import it.tref.liferay.portos.bo.model.DettPratica; +import it.tref.liferay.portos.bo.model.DocAggiuntiva; +import it.tref.liferay.portos.bo.model.DocPratica; +import it.tref.liferay.portos.bo.model.FineLavori; +import it.tref.liferay.portos.bo.model.HistoryWorkflowAction; +import it.tref.liferay.portos.bo.model.IntPratica; +import it.tref.liferay.portos.bo.model.Pagamento; +import it.tref.liferay.portos.bo.model.ParereGeologo; +import it.tref.liferay.portos.bo.model.Soggetto; +import it.tref.liferay.portos.bo.model.Sorteggio; +import it.tref.liferay.portos.bo.model.StoricoSoggettoPratica; +import it.tref.liferay.portos.bo.model.Tempistica; +import it.tref.liferay.portos.bo.service.AllegatoManualeLocalServiceUtil; +import it.tref.liferay.portos.bo.service.AsseverazioneLocalServiceUtil; +import it.tref.liferay.portos.bo.service.AvvisoLocalServiceUtil; +import it.tref.liferay.portos.bo.service.CollaudoLocalServiceUtil; +import it.tref.liferay.portos.bo.service.ConfigurazioneLocalServiceUtil; +import it.tref.liferay.portos.bo.service.ControlloPraticaLocalServiceUtil; +import it.tref.liferay.portos.bo.service.DelegaLocalServiceUtil; +import it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil; +import it.tref.liferay.portos.bo.service.DocAggiuntivaLocalServiceUtil; +import it.tref.liferay.portos.bo.service.DocPraticaLocalServiceUtil; +import it.tref.liferay.portos.bo.service.FineLavoriLocalServiceUtil; +import it.tref.liferay.portos.bo.service.HistoryWorkflowActionLocalServiceUtil; +import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil; +import it.tref.liferay.portos.bo.service.PagamentoLocalServiceUtil; +import it.tref.liferay.portos.bo.service.ParereGeologoLocalServiceUtil; +import it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil; +import it.tref.liferay.portos.bo.service.SorteggioLocalServiceUtil; +import it.tref.liferay.portos.bo.service.StoricoSoggettoPraticaLocalServiceUtil; +import it.tref.liferay.portos.bo.service.TempisticaLocalServiceUtil; +import it.tref.liferay.portos.bo.shared.util.ConfigurazioneConstants; +import it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants; +import it.tref.liferay.portos.bo.util.AvvisoUtil; +import it.tref.liferay.portos.bo.util.Constants; +import it.tref.liferay.portos.mailmanager.model.Email; +import it.tref.liferay.portos.mailmanager.model.EmailAttachment; +import it.tref.liferay.portos.mailmanager.model.EmailConstants; +import it.tref.liferay.portos.mailmanager.model.EmailTemplate; +import it.tref.liferay.portos.mailmanager.service.EmailAttachmentLocalServiceUtil; +import it.tref.liferay.portos.mailmanager.service.EmailLocalServiceUtil; +import it.tref.liferay.portos.mailmanager.service.EmailTemplateLocalServiceUtil; + +import java.sql.Connection; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import com.liferay.portal.kernel.cache.CacheRegistryUtil; +import com.liferay.portal.kernel.cache.MultiVMPoolUtil; +import com.liferay.portal.kernel.cache.SingleVMPoolUtil; +import com.liferay.portal.kernel.dao.jdbc.DataAccess; +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.FileEntry; +import com.liferay.portal.kernel.servlet.DirectServletRegistryUtil; +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.WorkflowInstance; +import com.liferay.portal.kernel.workflow.WorkflowInstanceManagerUtil; +import com.liferay.portal.model.Company; +import com.liferay.portal.model.Contact; +import com.liferay.portal.model.EmailAddress; +import com.liferay.portal.model.Group; +import com.liferay.portal.model.Layout; +import com.liferay.portal.model.LayoutPrototype; +import com.liferay.portal.model.LayoutSetPrototype; +import com.liferay.portal.model.Organization; +import com.liferay.portal.model.PasswordPolicy; +import com.liferay.portal.model.ResourceConstants; +import com.liferay.portal.model.ResourcePermission; +import com.liferay.portal.model.Role; +import com.liferay.portal.model.RoleConstants; +import com.liferay.portal.model.SystemEvent; +import com.liferay.portal.model.User; +import com.liferay.portal.model.UserPersonalSite; +import com.liferay.portal.model.WorkflowInstanceLink; +import com.liferay.portal.service.CompanyLocalServiceUtil; +import com.liferay.portal.service.ContactLocalServiceUtil; +import com.liferay.portal.service.EmailAddressLocalServiceUtil; +import com.liferay.portal.service.GroupLocalServiceUtil; +import com.liferay.portal.service.LayoutLocalServiceUtil; +import com.liferay.portal.service.LayoutPrototypeLocalServiceUtil; +import com.liferay.portal.service.LayoutSetPrototypeLocalServiceUtil; +import com.liferay.portal.service.OrganizationLocalServiceUtil; +import com.liferay.portal.service.PasswordPolicyLocalServiceUtil; +import com.liferay.portal.service.ResourcePermissionLocalServiceUtil; +import com.liferay.portal.service.RoleLocalServiceUtil; +import com.liferay.portal.service.ServiceContext; +import com.liferay.portal.service.SystemEventLocalServiceUtil; +import com.liferay.portal.service.UserLocalServiceUtil; +import com.liferay.portal.service.WorkflowInstanceLinkLocalServiceUtil; +import com.liferay.portlet.asset.model.AssetEntry; +import com.liferay.portlet.asset.model.AssetTag; +import com.liferay.portlet.asset.model.AssetVocabulary; +import com.liferay.portlet.asset.service.AssetEntryLocalServiceUtil; +import com.liferay.portlet.asset.service.AssetTagLocalServiceUtil; +import com.liferay.portlet.asset.service.AssetVocabularyLocalServiceUtil; +import com.liferay.portlet.documentlibrary.model.DLFileEntry; +import com.liferay.portlet.documentlibrary.model.DLFileEntryType; +import com.liferay.portlet.documentlibrary.model.DLFolder; +import com.liferay.portlet.documentlibrary.model.DLSyncConstants; +import com.liferay.portlet.documentlibrary.service.DLAppLocalServiceUtil; +import com.liferay.portlet.documentlibrary.service.DLAppServiceUtil; +import com.liferay.portlet.documentlibrary.service.DLFileEntryTypeLocalServiceUtil; +import com.liferay.portlet.documentlibrary.service.DLFolderLocalServiceUtil; +import com.liferay.portlet.dynamicdatamapping.model.DDMStructure; +import com.liferay.portlet.dynamicdatamapping.model.DDMTemplate; +import com.liferay.portlet.dynamicdatamapping.service.DDMStructureLocalServiceUtil; +import com.liferay.portlet.dynamicdatamapping.service.DDMTemplateLocalServiceUtil; +import com.liferay.portlet.expando.model.ExpandoColumn; +import com.liferay.portlet.expando.service.ExpandoColumnLocalServiceUtil; +import com.liferay.portlet.journal.model.JournalArticle; +import com.liferay.portlet.journal.model.JournalArticleResource; +import com.liferay.portlet.journal.model.JournalFolder; +import com.liferay.portlet.journal.service.JournalArticleLocalServiceUtil; +import com.liferay.portlet.journal.service.JournalArticleResourceLocalServiceUtil; +import com.liferay.portlet.journal.service.JournalFolderLocalServiceUtil; +import com.liferay.portlet.messageboards.model.MBDiscussion; +import com.liferay.portlet.messageboards.model.MBMessage; +import com.liferay.portlet.messageboards.model.MBThread; +import com.liferay.portlet.messageboards.service.MBDiscussionLocalServiceUtil; +import com.liferay.portlet.messageboards.service.MBMessageLocalServiceUtil; +import com.liferay.portlet.messageboards.service.MBThreadLocalServiceUtil; +import com.liferay.portlet.ratings.model.RatingsEntry; +import com.liferay.portlet.ratings.model.RatingsStats; +import com.liferay.portlet.ratings.service.RatingsEntryLocalServiceUtil; +import com.liferay.portlet.ratings.service.RatingsStatsLocalServiceUtil; +import com.liferay.portlet.wiki.model.WikiNode; +import com.liferay.portlet.wiki.service.WikiNodeLocalServiceUtil; +import com.liferay.sync.model.SyncDLObject; +import com.liferay.sync.service.SyncDLObjectLocalServiceUtil; + +public class ManutenzioneDatabase { + private static final Log _log = LogFactoryUtil.getLog(ManutenzioneDatabase.class); + private static final int SLICE = 1000; + + public static List pulisci(ServiceContext serviceContext, String mode) throws SystemException, + PortalException { + List esito = new ArrayList<>(); + long companyId = serviceContext.getCompanyId(); + if (mode.contains("!Pulisci!")) { + esito.addAll(puliziaDocumentLibrary(companyId)); + esitoLog( + esito, + puliziaAllegati(companyId, ConfigurazioneLocalServiceUtil.findByC_ChiaveLong(companyId, + ConfigurazioneConstants.ATTACHMENT_FOLDER_ID))); + esitoLog( + esito, + puliziaAllegati(companyId, ConfigurazioneLocalServiceUtil.findByC_ChiaveLong(companyId, + AvvisoUtil.getAllTipoDocumentoFolderProps().get(StatoPraticaConstants.CONFORME)))); + if (mode.contains("!IntPratica!")) { + esitoLog(esito, svuotaIntPraticaDettPratica()); + } + if (mode.contains("!User!")) { + esitoLog(esito, svuotaUser(companyId)); + } + esito.addAll(svuotaDatabase(companyId)); + if (mode.contains("!Reset!")) { + ConfigurazioneLocalServiceUtil.storeConfig(Constants.NUMERO_PROGETTO_KEY_DB, "1", + serviceContext); + } + clearCache(); + _log.info("Elaborazione completata correttamente."); + } + if (mode.contains("!Integrazioni!")) { + SismicaUtil.integrazioniScadute(); + } + if (mode.startsWith("!Workflow!")) { + String[] pezzi = StringUtil.split(mode, '!'); + esito.addAll(SismicaUtil.aggiungiWorkflow(pezzi[2], pezzi[3])); + } + return esito; + } + + private static void clearCache() { + try { + SingleVMPoolUtil.clear(); + MultiVMPoolUtil.clear(); + CacheRegistryUtil.clear(); + DirectServletRegistryUtil.clearServlets(); + } catch (IllegalStateException e) { + } + } + + private static List svuotaDatabase(long companyId) throws SystemException, PortalException { + List esito = new ArrayList<>(); + + esitoLog(esito, svuotaDettPratica()); + + esitoLog(esito, svuotaAllegatoManuale()); + esitoLog(esito, svuotaAssetEntry(companyId)); + esitoLog(esito, svuotaAsseverazione()); + esitoLog(esito, svuotaAvviso(companyId)); + esitoLog(esito, svuotaCollaudo()); + esitoLog(esito, svuotaContact(companyId)); + esitoLog(esito, svuotaControlloPratica()); + esitoLog(esito, svuotaDelega()); + esitoLog(esito, svuotaDocAggiuntiva()); + esitoLog(esito, svuotaDocPratica()); + esitoLog(esito, svuotaEmail(companyId)); + esitoLog(esito, svuotaEmailAttachment()); + esitoLog(esito, svuotaFineLavori()); + esitoLog(esito, svuotaGroup(companyId)); + esitoLog(esito, svuotaHistoryWorkflowAction()); + esitoLog(esito, svuotaMBDiscussion(companyId)); + esitoLog(esito, svuotaMBMessage(companyId)); + esitoLog(esito, svuotaMBThread()); + esitoLog(esito, svuotaPagamento(companyId)); + esitoLog(esito, svuotaParereGeologo()); + esitoLog(esito, svuotaRatingsEntry()); + esitoLog(esito, svuotaRatingsStats(companyId)); + esitoLog(esito, svuotaResourcePermission(companyId)); + esitoLog(esito, svuotaSoggetto()); + esitoLog(esito, svuotaSorteggio()); + esitoLog(esito, svuotaStoricoSoggettoPratica()); + esitoLog(esito, svuotaSyncDLObject()); + esitoLog(esito, svuotaSystemEvent(companyId)); + esitoLog(esito, svuotaTempistica()); + esitoLog(esito, svuotaWorkflowInstance()); + return esito; + } + + private static List puliziaDocumentLibrary(long companyId) { + List esito = new ArrayList<>(); + Set parentFolderNames = new HashSet<>(); + + try { + long allegatiFolderId = ConfigurazioneLocalServiceUtil.findByC_ChiaveLong(companyId, + ConfigurazioneConstants.ATTACHMENT_FOLDER_ID); + int cancellati = 0; + int start = 0; + int totali = 0; + List folders; + do { + folders = DLFolderLocalServiceUtil.getDLFolders(start, start + SLICE); + int rimossi = 0; + totali += folders.size(); + for (DLFolder folder : folders) { + DLFolder parent = folder.getParentFolder(); + if (Validator.isNotNull(parent)) { + parentFolderNames.add(parent.getName()); + if (parent.getFolderId() == allegatiFolderId) { + long[] ids = StringUtil.split(folder.getName(), "_", 0L); + if ((ids.length == 2) && (ids[0] == ids[1])) { + if (!esiste(DETTPRATICA_CLASS_NAME, ids[0]) + && !esiste(DOCPRATICA_CLASS_NAME, ids[0]) + && !esiste(ALLEGATOMANUALE_CLASS_NAME, ids[0]) + && !esiste(ASSEVERAZIONE_CLASS_NAME, ids[0]) + && !esiste(AVVISO_CLASS_NAME, ids[0]) + && !esiste(COLLAUDO_CLASS_NAME, ids[0]) + && !esiste(CONTROLLOPRATICA_CLASS_NAME, ids[0]) + && !esiste(DELEGA_CLASS_NAME, ids[0]) + && !esiste(DOCAGGIUNTIVA_CLASS_NAME, ids[0]) + && !esiste(FINELAVORI_CLASS_NAME, ids[0]) + && !esiste(INTPRATICA_CLASS_NAME, ids[0]) + && !esiste(PAGAMENTO_CLASS_NAME, ids[0]) + && !esiste(PAREREGEOLOGO_CLASS_NAME, ids[0]) + && !esiste(SOGGETTO_CLASS_NAME, ids[0]) + && !esiste(SORTEGGIO_CLASS_NAME, ids[0])) { + _log.info("Cancello la cartella " + folder.getName()); + DLAppLocalServiceUtil.deleteFolder(folder.getFolderId()); + cancellati++; + rimossi++; + } + } else { + _log.info("Mantengo la cartella " + folder.getName()); + } + } else if (parent.getName().equals(EmailConstants.DEFAULT_ATTACHMENTS_FOLDER_NAME)) { + long emailId = 0; + try { + emailId = Long.parseLong(folder.getName()); + } catch (NumberFormatException e) { + } + if (Validator.isNotNull(emailId) + && String.valueOf(emailId).equals(folder.getName()) + && !esiste(EMAIL_CLASS_NAME, emailId)) { + _log.info("Cancello la cartella " + folder.getName()); + DLAppLocalServiceUtil.deleteFolder(folder.getFolderId()); + cancellati++; + rimossi++; + } + } else { + _log.info("Non allegato " + folder.getName() + " in " + parent.getName()); + } + } + } + start += folders.size() - rimossi; + } while (folders.size() > 0); + esitoLog(esito, "Analizzate " + totali + " cartelle, cancellate " + cancellati); + } catch (PortalException | SystemException e) { + esitoLog(esito, "Errore durante l'elaborazione. " + e.getMessage()); + } + for (String parentFolderName : parentFolderNames) { + _log.info("Parent: " + parentFolderName); + } + return esito; + } + + private static List avvisiFileEntries() throws SystemException { + List result = new ArrayList<>(); + int start = 0; + List avvisi = null; + do { + avvisi = AvvisoLocalServiceUtil.getAvvisos(start, start + SLICE); + for (Avviso avviso : avvisi) { + result.add(avviso.getFileEntryIdBase()); + result.add(avviso.getFileEntryIdProtocollo()); + result.add(avviso.getFileEntryIdInvio()); + } + start += SLICE; + } while (avvisi.size() > 0); + return result; + } + + private static String puliziaAllegati(long companyId, long folderId) throws SystemException, + PortalException { + List avvisiFileEntries = avvisiFileEntries(); + long repositoryId = DLAppLocalServiceUtil.getFolder(folderId).getRepositoryId(); + int start = 0; + int cancellati = 0; + List fileEntries = null; + do { + int rimossi = 0; + fileEntries = DLAppServiceUtil.getFileEntries(repositoryId, folderId, start, start + SLICE); + for (FileEntry fileEntry : fileEntries) { + String[] parti = StringUtil.split(fileEntry.getTitle() + .replaceAll("\\.p7m$", StringPool.BLANK), '_'); + String strId1 = parti[0]; + String tipo = StringPool.BLANK; + String strId2 = StringPool.BLANK; + switch (parti.length) { + case 3: + tipo = parti[1]; + strId2 = parti[2]; + break; + case 4: + tipo = parti[1] + StringPool.UNDERLINE + parti[2]; + strId2 = parti[3]; + break; + case 5: + if (parti[4].equals("protocollato")) { + tipo = parti[1] + StringPool.UNDERLINE + parti[2]; + strId2 = parti[3]; + } + } + if ((strId1.length() == 10) && (strId2.length() > 0) && SismicaUtil.isLong(strId1) + && SismicaUtil.isLong(strId2)) { + long id1 = Long.parseLong(strId1); + switch (tipo) { + case "AS": + if (!esiste(DETTPRATICA_CLASS_NAME, id1)) { + DLAppLocalServiceUtil.deleteFileEntry(fileEntry.getFileEntryId()); + cancellati++; + rimossi++; + } + break; + case "AI_B": + case "CO_B": + case "IN_B": + case "IN_F": + case "MA_F": + if (!avvisiFileEntries.contains(fileEntry.getFileEntryId())) { + DLAppLocalServiceUtil.deleteFileEntry(fileEntry.getFileEntryId()); + cancellati++; + rimossi++; + } + break; + default: + _log.info("T " + System.currentTimeMillis()); + _log.info("Tipo sconosciuto " + tipo + " (" + fileEntry.getTitle() + ")"); + break; + } + } else { + _log.info("Nome sconosciuto " + fileEntry.getTitle()); + } + } + start += SLICE - rimossi; + } while (fileEntries.size() > 0); + return "Cancellati " + cancellati + " File orfani"; + } + + private static String svuotaAllegatoManuale() throws SystemException { + int start = 0; + int cancellati = 0; + List allegatiManuali = null; + do { + int rimossi = 0; + allegatiManuali = AllegatoManualeLocalServiceUtil.getAllegatoManuales(start, start + SLICE); + for (AllegatoManuale allegatoManuale : allegatiManuali) { + if (!esiste(INTPRATICA_CLASS_NAME, allegatoManuale.getIntPraticaId()) + || !esiste(DETTPRATICA_CLASS_NAME, allegatoManuale.getDettPraticaId()) + || !esiste(AVVISO_CLASS_NAME, allegatoManuale.getAvvisoId())) { + deleteFileEntry(allegatoManuale.getFileEntryId()); + AllegatoManualeLocalServiceUtil.deleteAllegatoManuale(allegatoManuale); + cancellati++; + rimossi++; + } + } + start += SLICE - rimossi; + } while (allegatiManuali.size() > 0); + return "Cancellati " + cancellati + " AllegatoManuale"; + } + + private static String svuotaAssetEntry(long companyId) throws SystemException { + int start = 0; + int cancellati = 0; + List assetEntries = null; + do { + int rimossi = 0; + assetEntries = AssetEntryLocalServiceUtil.getAssetEntries(start, start + SLICE); + for (AssetEntry assetEntry : assetEntries) { + String className = assetEntry.getClassName(); + if (className.equals(JOURNALARTICLE_CLASS_NAME)) { + className = JOURNALARTICLERESOURCE_CLASS_NAME; + } + if (!esiste(className, assetEntry.getClassPK(), companyId)) { + AssetEntryLocalServiceUtil.deleteAssetEntry(assetEntry); + cancellati++; + rimossi++; + } + } + start += SLICE - rimossi; + } while (assetEntries.size() > 0); + return "Cancellati " + cancellati + " AssetEntry"; + } + + private static String svuotaAsseverazione() throws SystemException { + int start = 0; + int cancellati = 0; + List asseverazioni = null; + do { + int rimossi = 0; + asseverazioni = AsseverazioneLocalServiceUtil.getAsseveraziones(start, start + SLICE); + for (Asseverazione asseverazione : asseverazioni) { + if (!esiste(INTPRATICA_CLASS_NAME, asseverazione.getIntPraticaId()) + || !esiste(DETTPRATICA_CLASS_NAME, asseverazione.getDettPraticaId())) { + deleteFileEntry(asseverazione.getFileEntryId()); + AsseverazioneLocalServiceUtil.deleteAsseverazione(asseverazione); + cancellati++; + rimossi++; + } + } + start += SLICE - rimossi; + } while (asseverazioni.size() > 0); + return "Cancellati " + cancellati + " Asseverazione"; + } + + private static String svuotaAvviso(long companyId) throws SystemException { + int start = 0; + int cancellati = 0; + List avvisi = null; + do { + int rimossi = 0; + avvisi = AvvisoLocalServiceUtil.getAvvisos(start, start + SLICE); + for (Avviso avviso : avvisi) { + if (!esiste(avviso.getClassName(), avviso.getClassPk(), companyId) + || !esiste(INTPRATICA_CLASS_NAME, avviso.getIntPraticaId())) { + deleteFileEntry(avviso.getFileEntryIdBase()); + deleteFileEntry(avviso.getFileEntryIdInvio()); + deleteFileEntry(avviso.getFileEntryIdProtocollo()); + AvvisoLocalServiceUtil.deleteAvviso(avviso); + cancellati++; + rimossi++; + } + } + start += SLICE - rimossi; + } while (avvisi.size() > 0); + return "Cancellati " + cancellati + " Avviso"; + } + + private static String svuotaCollaudo() throws SystemException, PortalException { + int start = 0; + int cancellati = 0; + List collaudi = null; + do { + int rimossi = 0; + collaudi = CollaudoLocalServiceUtil.getCollaudos(start, start + SLICE); + for (Collaudo collaudo : collaudi) { + if (!esiste(INTPRATICA_CLASS_NAME, collaudo.getIntPraticaId())) { + CollaudoLocalServiceUtil.deleteCollaudo(collaudo); + cancellati++; + rimossi++; + } + } + start += SLICE - rimossi; + } while (collaudi.size() > 0); + return "Cancellati " + cancellati + " Collaudo"; + } + + private static String svuotaContact(long companyId) throws SystemException, PortalException { + int start = 0; + int cancellati = 0; + List contacts = null; + do { + int rimossi = 0; + contacts = ContactLocalServiceUtil.getContacts(start, start + SLICE); + for (Contact contact : contacts) { + if (!esiste(contact.getClassName(), contact.getClassPK(), companyId)) { + ContactLocalServiceUtil.deleteContact(contact); + cancellati++; + rimossi++; + } + } + start += SLICE - rimossi; + } while (contacts.size() > 0); + return "Cancellati " + cancellati + " Contact"; + } + + private static String svuotaControlloPratica() throws SystemException, PortalException { + int start = 0; + int cancellati = 0; + List controlliPratiche = null; + do { + int rimossi = 0; + controlliPratiche = ControlloPraticaLocalServiceUtil.getControlloPraticas(start, start + SLICE); + for (ControlloPratica controlloPratica : controlliPratiche) { + if (!esiste(INTPRATICA_CLASS_NAME, controlloPratica.getIntPraticaId()) + || !esiste(DETTPRATICA_CLASS_NAME, controlloPratica.getDettPraticaId())) { + ControlloPraticaLocalServiceUtil.deleteControlloPratica(controlloPratica); + cancellati++; + rimossi++; + } + } + start += SLICE - rimossi; + } while (controlliPratiche.size() > 0); + return "Cancellati " + cancellati + " ControlloPratica"; + } + + private static String svuotaDelega() throws SystemException, PortalException { + int start = 0; + int cancellati = 0; + List deleghe = null; + do { + int rimossi = 0; + deleghe = DelegaLocalServiceUtil.getDelegas(start, start + SLICE); + for (Delega delega : deleghe) { + if (!esiste(INTPRATICA_CLASS_NAME, delega.getIntPraticaId()) + || !esiste(DETTPRATICA_CLASS_NAME, delega.getDettPraticaId())) { + DelegaLocalServiceUtil.deleteDelega(delega); + cancellati++; + rimossi++; + } + } + start += SLICE - rimossi; + } while (deleghe.size() > 0); + return "Cancellati " + cancellati + " Delega"; + } + + private static String svuotaDettPratica() throws SystemException, PortalException { + int start = 0; + int cancellati = 0; + List dettPratiche = null; + do { + int rimossi = 0; + dettPratiche = DettPraticaLocalServiceUtil.getDettPraticas(start, start + SLICE); + for (DettPratica dettPratica : dettPratiche) { + if (!esiste(INTPRATICA_CLASS_NAME, dettPratica.getIntPraticaId())) { + DettPraticaLocalServiceUtil.deleteDettPratica(dettPratica); + cancellati++; + rimossi++; + } + } + start += SLICE - rimossi; + } while (dettPratiche.size() > 0); + return "Cancellati " + cancellati + " DettPratica"; + } + + private static String svuotaDocAggiuntiva() throws SystemException, PortalException { + int start = 0; + int cancellati = 0; + List docAggiuntive = null; + do { + int rimossi = 0; + docAggiuntive = DocAggiuntivaLocalServiceUtil.getDocAggiuntivas(start, start + SLICE); + for (DocAggiuntiva docAggiuntiva : docAggiuntive) { + if (!esiste(INTPRATICA_CLASS_NAME, docAggiuntiva.getIntPraticaId()) + || !esiste(DETTPRATICA_CLASS_NAME, docAggiuntiva.getDettPraticaId())) { + deleteFileEntry(docAggiuntiva.getFileEntryId()); + DocAggiuntivaLocalServiceUtil.deleteDocAggiuntiva(docAggiuntiva); + cancellati++; + rimossi++; + } + } + start += SLICE - rimossi; + } while (docAggiuntive.size() > 0); + return "Cancellati " + cancellati + " DocAggiuntiva"; + } + + private static String svuotaDocPratica() throws SystemException, PortalException { + int start = 0; + int cancellati = 0; + List docPratiche = null; + do { + int rimossi = 0; + docPratiche = DocPraticaLocalServiceUtil.getDocPraticas(start, start + SLICE); + for (DocPratica docPratica : docPratiche) { + if (!esiste(INTPRATICA_CLASS_NAME, docPratica.getIntPraticaId())) { + deleteFileEntry(docPratica.getDlFileEntryId()); + DocPraticaLocalServiceUtil.deleteDocPratica(docPratica); + cancellati++; + rimossi++; + } + } + start += SLICE - rimossi; + } while (docPratiche.size() > 0); + return "Cancellati " + cancellati + " DocPratica"; + } + + private static String svuotaEmail(long companyId) throws SystemException, PortalException { + int start = 0; + int cancellati = 0; + List emails = null; + do { + int rimossi = 0; + emails = EmailLocalServiceUtil.getEmails(start, start + SLICE); + for (Email email : emails) { + if (!esiste(email.getClassName(), email.getClassPK(), companyId)) { + EmailLocalServiceUtil.deleteEmail(email); + cancellati++; + rimossi++; + } + } + start += SLICE - rimossi; + } while (emails.size() > 0); + return "Cancellati " + cancellati + " Email"; + } + + private static String svuotaEmailAttachment() throws SystemException, PortalException { + int start = 0; + int cancellati = 0; + List emailAttachments = null; + do { + int rimossi = 0; + emailAttachments = EmailAttachmentLocalServiceUtil.getEmailAttachments(start, start + SLICE); + for (EmailAttachment emailAttachment : emailAttachments) { + if (!esiste(EMAIL_CLASS_NAME, emailAttachment.getEmailId())) { + deleteFileEntry(emailAttachment.getFileEntryId()); + EmailAttachmentLocalServiceUtil.deleteEmailAttachment(emailAttachment); + cancellati++; + rimossi++; + } + } + start += SLICE - rimossi; + } while (emailAttachments.size() > 0); + return "Cancellati " + cancellati + " EmailAttachment"; + } + + private static String svuotaFineLavori() throws SystemException, PortalException { + int start = 0; + int cancellati = 0; + List finiLavori = null; + do { + int rimossi = 0; + finiLavori = FineLavoriLocalServiceUtil.getFineLavoris(start, start + SLICE); + for (FineLavori fineLavori : finiLavori) { + if (!esiste(INTPRATICA_CLASS_NAME, fineLavori.getIntPraticaId())) { + FineLavoriLocalServiceUtil.deleteFineLavori(fineLavori); + cancellati++; + rimossi++; + } + } + start += SLICE - rimossi; + } while (finiLavori.size() > 0); + return "Cancellati " + cancellati + " FineLavori"; + } + + // Troncare le tabelle è l'unico modo possibile + private static String svuotaIntPraticaDettPratica() { + int i = 0; + int d = 0; + try { + Connection connection = DataAccess.getUpgradeOptimizedConnection(); + Statement s = connection.createStatement(); + i = s.executeUpdate("DELETE FROM portos_bo_intpratica"); + d = s.executeUpdate("DELETE FROM portos_bo_dettpratica"); + } catch (SQLException e) { + } + clearCache(); + return "Cancellati " + i + " IntPratica, " + d + " DettPratica"; + } + + private static String svuotaGroup(long companyId) throws SystemException, PortalException { + int start = 0; + int cancellati = 0; + List groups = null; + do { + int rimossi = 0; + groups = GroupLocalServiceUtil.getGroups(start, start + SLICE); + for (Group group : groups) { + if (!esiste(group.getClassName(), group.getClassPK(), companyId)) { + GroupLocalServiceUtil.deleteGroup(group); + cancellati++; + rimossi++; + } + } + start += SLICE - rimossi; + } while (groups.size() > 0); + return "Cancellati " + cancellati + " Group"; + } + + private static String svuotaHistoryWorkflowAction() throws SystemException { + int start = 0; + int cancellati = 0; + List actions = null; + do { + int rimossi = 0; + actions = HistoryWorkflowActionLocalServiceUtil.getHistoryWorkflowActions(start, start + SLICE); + for (HistoryWorkflowAction action : actions) { + if (!esiste(INTPRATICA_CLASS_NAME, action.getIntPraticaId()) + || !esiste(DETTPRATICA_CLASS_NAME, action.getDettPraticaId())) { + HistoryWorkflowActionLocalServiceUtil.deleteHistoryWorkflowAction(action); + cancellati++; + rimossi++; + } + } + start += SLICE - rimossi; + } while (actions.size() > 0); + return "Cancellati " + cancellati + " HistoryWorkflowAction"; + } + + private static String svuotaMBDiscussion(long companyId) throws SystemException { + int start = 0; + int cancellati = 0; + List mbDiscussions = null; + do { + int rimossi = 0; + mbDiscussions = MBDiscussionLocalServiceUtil.getMBDiscussions(start, start + SLICE); + for (MBDiscussion mbDiscussion : mbDiscussions) { + if (!esiste(mbDiscussion.getClassName(), mbDiscussion.getClassPK(), companyId) + || !esiste(MBTHREAD_CLASS_NAME, mbDiscussion.getThreadId()) + || !esiste(GROUP_CLASS_NAME, mbDiscussion.getGroupId())) { + MBDiscussionLocalServiceUtil.deleteMBDiscussion(mbDiscussion); + cancellati++; + rimossi++; + } + } + start += SLICE - rimossi; + } while (mbDiscussions.size() > 0); + return "Cancellati " + cancellati + " MBDiscussion"; + } + + private static String svuotaMBMessage(long companyId) throws SystemException { + int start = 0; + int cancellati = 0; + List mbMessages = null; + do { + int rimossi = 0; + mbMessages = MBMessageLocalServiceUtil.getMBMessages(start, start + SLICE); + for (MBMessage mbMessage : mbMessages) { + if (!esiste(mbMessage.getClassName(), mbMessage.getClassPK(), companyId) + || !esiste(MBTHREAD_CLASS_NAME, mbMessage.getThreadId()) + || !esiste(GROUP_CLASS_NAME, mbMessage.getGroupId())) { + MBMessageLocalServiceUtil.deleteMBMessage(mbMessage); + cancellati++; + rimossi++; + } + } + start += SLICE - rimossi; + } while (mbMessages.size() > 0); + return "Cancellati " + cancellati + " MBMessage"; + } + + private static String svuotaMBThread() throws SystemException { + int start = 0; + int cancellati = 0; + List mbThreads = null; + do { + int rimossi = 0; + mbThreads = MBThreadLocalServiceUtil.getMBThreads(start, start + SLICE); + for (MBThread mbThread : mbThreads) { + if (!esiste(MBMESSAGE_CLASS_NAME, mbThread.getRootMessageId()) + || !esiste(GROUP_CLASS_NAME, mbThread.getGroupId())) { + MBThreadLocalServiceUtil.deleteMBThread(mbThread); + cancellati++; + rimossi++; + } + } + start += SLICE - rimossi; + } while (mbThreads.size() > 0); + return "Cancellati " + cancellati + " MBThread"; + } + + private static String svuotaPagamento(long companyId) throws SystemException, PortalException { + int start = 0; + int cancellati = 0; + List pagamenti = null; + do { + int rimossi = 0; + pagamenti = PagamentoLocalServiceUtil.getPagamentos(start, start + SLICE); + for (Pagamento pagamento : pagamenti) { + if (!esiste(pagamento.getClassName(), pagamento.getClassPk(), companyId) + || !esiste(INTPRATICA_CLASS_NAME, pagamento.getIntPraticaId())) { + deleteFileEntry(pagamento.getFileEntryId()); + PagamentoLocalServiceUtil.deletePagamento(pagamento); + cancellati++; + rimossi++; + } + } + start += SLICE - rimossi; + } while (pagamenti.size() > 0); + return "Cancellati " + cancellati + " Pagamento"; + } + + private static String svuotaParereGeologo() throws SystemException { + int start = 0; + int cancellati = 0; + List pareriGeologo = null; + do { + int rimossi = 0; + pareriGeologo = ParereGeologoLocalServiceUtil.getParereGeologos(start, start + SLICE); + for (ParereGeologo parereGeologo : pareriGeologo) { + if (!esiste(INTPRATICA_CLASS_NAME, parereGeologo.getIntPraticaId()) + || !esiste(DETTPRATICA_CLASS_NAME, parereGeologo.getDettPraticaId())) { + deleteFileEntry(parereGeologo.getFileEntryId()); + ParereGeologoLocalServiceUtil.deleteParereGeologo(parereGeologo); + cancellati++; + rimossi++; + } + } + start += SLICE - rimossi; + } while (pareriGeologo.size() > 0); + return "Cancellati " + cancellati + " ParereGeologo"; + } + + private static String svuotaRatingsEntry() throws SystemException { + int start = 0; + int cancellati = 0; + List entries = null; + do { + int rimossi = 0; + entries = RatingsEntryLocalServiceUtil.getRatingsEntries(start, start + SLICE); + for (RatingsEntry entry : entries) { + if (!esiste(entry.getClassName(), entry.getClassPK())) { + RatingsEntryLocalServiceUtil.deleteRatingsEntry(entry); + cancellati++; + rimossi++; + } + } + start += SLICE - rimossi; + } while (entries.size() > 0); + return "Cancellati " + cancellati + " RatingsEntry"; + } + + private static String svuotaRatingsStats(long companyId) throws SystemException { + int start = 0; + int cancellati = 0; + List ratingsStatses = null; + do { + int rimossi = 0; + ratingsStatses = RatingsStatsLocalServiceUtil.getRatingsStatses(start, start + SLICE); + for (RatingsStats ratingsStats : ratingsStatses) { + if (!esiste(ratingsStats.getClassName(), ratingsStats.getClassPK(), companyId)) { + RatingsStatsLocalServiceUtil.deleteRatingsStats(ratingsStats); + cancellati++; + rimossi++; + } + } + start += SLICE - rimossi; + } while (ratingsStatses.size() > 0); + return "Cancellati " + cancellati + " RatingsStats"; + } + + private static String svuotaResourcePermission(long companyId) throws SystemException { + int start = 0; + int cancellati = 0; + List resourcePermissions = null; + do { + int rimossi = 0; + resourcePermissions = ResourcePermissionLocalServiceUtil.getResourcePermissions(start, start + + SLICE); + for (ResourcePermission resourcePermission : resourcePermissions) { + long classPK = 0; + try { + classPK = Long.parseLong(resourcePermission.getPrimKey()); + if (!String.valueOf(classPK).equals(resourcePermission.getPrimKey())) { + classPK = 0; + } + } catch (NumberFormatException e) { + } + if (Validator.isNotNull(classPK)) { + switch (resourcePermission.getScope()) { + case ResourceConstants.SCOPE_INDIVIDUAL: + if (!esiste(resourcePermission.getName(), classPK)) { + ResourcePermissionLocalServiceUtil.deleteResourcePermission(resourcePermission); + cancellati++; + rimossi++; + } + break; + } + } + } + start += SLICE - rimossi; + } while (resourcePermissions.size() > 0); + return "Cancellati " + cancellati + " ResourcePermission"; + } + + private static String svuotaSoggetto() throws SystemException, PortalException { + int start = 0; + int cancellati = 0; + int docPraticaCancellati = 0; + List soggetti = null; + do { + int rimossi = 0; + soggetti = SoggettoLocalServiceUtil.getSoggettos(start, start + SLICE); + for (Soggetto soggetto : soggetti) { + if (!esiste(INTPRATICA_CLASS_NAME, soggetto.getIntPraticaId()) + || !esiste(DETTPRATICA_CLASS_NAME, soggetto.getDettPraticaId())) { + if (Validator.isNotNull(soggetto.getFileVariazioneId())) { + try { + DocPratica docPratica = DocPraticaLocalServiceUtil.getDocPratica(soggetto + .getFileVariazioneId()); + deleteFileEntry(docPratica.getDlFileEntryId()); + DocPraticaLocalServiceUtil.deleteDocPratica(docPratica); + docPraticaCancellati++; + } catch (PortalException e) { + } + } + SoggettoLocalServiceUtil.deleteSoggetto(soggetto); + cancellati++; + rimossi++; + } + } + start += SLICE - rimossi; + } while (soggetti.size() > 0); + return "Cancellati " + cancellati + " Soggetto, " + docPraticaCancellati + " DocPratica"; + } + + private static String svuotaSorteggio() throws SystemException { + int start = 0; + int cancellati = 0; + List sorteggi = null; + do { + int rimossi = 0; + sorteggi = SorteggioLocalServiceUtil.getSorteggios(start, start + SLICE); + for (Sorteggio sorteggio : sorteggi) { + if (!esiste(INTPRATICA_CLASS_NAME, sorteggio.getIntPraticaId()) + || !esiste(DETTPRATICA_CLASS_NAME, sorteggio.getDettPraticaId())) { + SorteggioLocalServiceUtil.deleteSorteggio(sorteggio); + cancellati++; + rimossi++; + } + } + start += SLICE - rimossi; + } while (sorteggi.size() > 0); + return "Cancellati " + cancellati + " Sorteggio"; + } + + private static String svuotaStoricoSoggettoPratica() throws SystemException { + int start = 0; + int cancellati = 0; + List storicoSoggettiPratiche = null; + do { + int rimossi = 0; + storicoSoggettiPratiche = StoricoSoggettoPraticaLocalServiceUtil.getStoricoSoggettoPraticas( + start, start + SLICE); + for (StoricoSoggettoPratica storicoSoggettoPratica : storicoSoggettiPratiche) { + if (!esiste(INTPRATICA_CLASS_NAME, storicoSoggettoPratica.getIntPraticaId())) { + StoricoSoggettoPraticaLocalServiceUtil + .deleteStoricoSoggettoPratica(storicoSoggettoPratica); + cancellati++; + rimossi++; + } + } + start += SLICE - rimossi; + } while (storicoSoggettiPratiche.size() > 0); + return "Cancellati " + cancellati + " StoricoSoggettoPratica"; + } + + private static String svuotaSystemEvent(long companyId) throws SystemException { + int start = 0; + int cancellati = 0; + List systemEvents = null; + do { + int rimossi = 0; + systemEvents = SystemEventLocalServiceUtil.getSystemEvents(start, start + SLICE); + for (SystemEvent systemEvent : systemEvents) { + if (!esiste(systemEvent.getClassName(), systemEvent.getClassPK(), companyId)) { + SystemEventLocalServiceUtil.deleteSystemEvent(systemEvent); + cancellati++; + rimossi++; + } + } + start += SLICE - rimossi; + } while (systemEvents.size() > 0); + return "Cancellati " + cancellati + " SystemEvent"; + } + + private static String svuotaSyncDLObject() throws SystemException { + int start = 0; + int cancellati = 0; + List syncDLObjects = null; + do { + int rimossi = 0; + syncDLObjects = SyncDLObjectLocalServiceUtil.getSyncDLObjects(start, start + SLICE); + for (SyncDLObject syncDLObject : syncDLObjects) { + String className = null; + switch (syncDLObject.getType()) { + case DLSyncConstants.TYPE_FILE: + className = DLFILEENTRY_CLASS_NAME; + break; + case DLSyncConstants.TYPE_FOLDER: + className = DLFOLDER_CLASS_NAME; + break; + } + if (!esiste(className, syncDLObject.getTypePK())) { + SyncDLObjectLocalServiceUtil.deleteSyncDLObject(syncDLObject); + cancellati++; + rimossi++; + } + } + start += SLICE - rimossi; + } while (syncDLObjects.size() > 0); + return "Cancellati " + cancellati + " SyncDLObject"; + } + + private static String svuotaTempistica() throws SystemException, PortalException { + int start = 0; + int cancellati = 0; + List tempistiche = null; + do { + int rimossi = 0; + tempistiche = TempisticaLocalServiceUtil.getTempisticas(start, start + SLICE); + for (Tempistica tempistica : tempistiche) { + if (!esiste(INTPRATICA_CLASS_NAME, tempistica.getIntPraticaId()) + || !esiste(DETTPRATICA_CLASS_NAME, tempistica.getDettPraticaId())) { + TempisticaLocalServiceUtil.deleteTempistica(tempistica); + cancellati++; + rimossi++; + } + } + start += SLICE - rimossi; + } while (tempistiche.size() > 0); + return "Cancellati " + cancellati + " Tempistica"; + } + + private static String svuotaUser(long companyId) throws SystemException, PortalException { + int start = 0; + int cancellati = 0; + List users = null; + Role adminRole = RoleLocalServiceUtil.getRole(companyId, RoleConstants.ADMINISTRATOR); + do { + int rimossi = 0; + users = UserLocalServiceUtil.getUsers(start, start + SLICE); + for (User user : users) { + if (user.getRoles().contains(adminRole)) { + _log.info("Non cancello utente " + user.getFullName()); + } + } + start += SLICE - rimossi; + } while (users.size() > 0); + return "Cancellati " + cancellati + " User"; + } + + private static String svuotaWorkflowInstance() throws SystemException, PortalException { + int start = 0; + int cancellati = 0; + List links = null; + do { + int rimossi = 0; + links = WorkflowInstanceLinkLocalServiceUtil.getWorkflowInstanceLinks(start, start + SLICE); + for (WorkflowInstanceLink link : links) { + if (!esiste(link.getClassName(), link.getClassPK())) { + _log.info("Manca " + link.getClassName() + " " + link.getClassPK()); + WorkflowInstance instance = null; + try { + instance = WorkflowInstanceManagerUtil.getWorkflowInstance(link.getCompanyId(), + link.getWorkflowInstanceId()); + } catch (PortalException e) { + } + if (Validator.isNull(instance)) { + WorkflowInstanceLinkLocalServiceUtil.deleteWorkflowInstanceLink(link); + } else { + WorkflowInstanceManagerUtil.deleteWorkflowInstance(link.getCompanyId(), + instance.getWorkflowInstanceId()); + } + cancellati++; + rimossi++; + } + } + start += SLICE - rimossi; + } while (links.size() > 0); + return "Cancellati " + cancellati + " WorkflowInstance"; + } + + private static boolean esiste(String className, long classPK) throws SystemException { + return esiste(className, classPK, 0); + } + + private static boolean esiste(String className, long classPK, long companyId) throws SystemException { + if (0 != classPK && Validator.isNotNull(className)) { + try { + if (ALLEGATOMANUALE_CLASS_NAME.equals(className)) { + AllegatoManualeLocalServiceUtil.getAllegatoManuale(classPK); + } else if (ASSETTAG_CLASS_NAME.equals(className)) { + AssetTagLocalServiceUtil.getAssetTag(classPK); + } else if (ASSETVOCABULARY_CLASS_NAME.equals(className)) { + AssetVocabularyLocalServiceUtil.getAssetVocabulary(classPK); + } else if (ASSEVERAZIONE_CLASS_NAME.equals(className)) { + AsseverazioneLocalServiceUtil.getAsseverazione(classPK); + } else if (AVVISO_CLASS_NAME.equals(className)) { + AvvisoLocalServiceUtil.getAvviso(classPK); + } else if (COLLAUDO_CLASS_NAME.equals(className)) { + CollaudoLocalServiceUtil.getCollaudo(classPK); + } else if (COMPANY_CLASS_NAME.equals(className)) { + CompanyLocalServiceUtil.getCompany(classPK); + } else if (CONTROLLOPRATICA_CLASS_NAME.equals(className)) { + ControlloPraticaLocalServiceUtil.getControlloPratica(classPK); + } else if (DOCAGGIUNTIVA_CLASS_NAME.equals(className)) { + DocAggiuntivaLocalServiceUtil.getDocAggiuntiva(classPK); + } else if (DOCPRATICA_CLASS_NAME.equals(className)) { + DocPraticaLocalServiceUtil.getDocPratica(classPK); + } else if (DDMSTRUCTURE_CLASS_NAME.equals(className)) { + DDMStructureLocalServiceUtil.getDDMStructure(classPK); + } else if (DDMTEMPLATE_CLASS_NAME.equals(className)) { + DDMTemplateLocalServiceUtil.getDDMTemplate(classPK); + } else if (DELEGA_CLASS_NAME.equals(className)) { + DelegaLocalServiceUtil.getDelega(classPK); + } else if (DETTPRATICA_CLASS_NAME.equals(className)) { + DettPraticaLocalServiceUtil.getDettPratica(classPK); + } else if (DLFILEENTRY_CLASS_NAME.equals(className)) { + DLAppLocalServiceUtil.getFileEntry(classPK); + } else if (DLFILEENTRYTYPE_CLASS_NAME.equals(className)) { + DLFileEntryTypeLocalServiceUtil.getDLFileEntryType(classPK); + } else if (DLFOLDER_CLASS_NAME.equals(className)) { + DLAppLocalServiceUtil.getFolder(classPK); + } else if (EMAIL_CLASS_NAME.equals(className)) { + EmailLocalServiceUtil.getEmail(classPK); + } else if (EMAILADDRESS_CLASS_NAME.equals(className)) { + EmailAddressLocalServiceUtil.getEmailAddress(classPK); + } else if (EMAILTEMPLATE_CLASS_NAME.equals(className)) { + EmailTemplateLocalServiceUtil.getEmailTemplate(classPK); + } else if (EXPANDOCOLUMN_CLASS_NAME.equals(className)) { + ExpandoColumnLocalServiceUtil.getExpandoColumn(classPK); + } else if (FINELAVORI_CLASS_NAME.equals(className)) { + FineLavoriLocalServiceUtil.getFineLavori(classPK); + } else if (GROUP_CLASS_NAME.equals(className)) { + GroupLocalServiceUtil.getGroup(classPK); + } else if (INTPRATICA_CLASS_NAME.equals(className)) { + IntPraticaLocalServiceUtil.getIntPratica(classPK); + } else if (JOURNALARTICLE_CLASS_NAME.equals(className)) { + JournalArticleLocalServiceUtil.getArticle(classPK); + } else if (JOURNALARTICLERESOURCE_CLASS_NAME.equals(className)) { + JournalArticleResourceLocalServiceUtil.getJournalArticleResource(classPK); + } else if (JOURNALFOLDER_CLASS_NAME.equals(className)) { + JournalFolderLocalServiceUtil.getJournalFolder(classPK); + } else if (LAYOUT_CLASS_NAME.equals(className)) { + LayoutLocalServiceUtil.getLayout(classPK); + } else if (LAYOUTPROTOTYPE_CLASS_NAME.equals(className)) { + LayoutPrototypeLocalServiceUtil.getLayoutPrototype(classPK); + } else if (LAYOUTSETPROTOTYPE_CLASS_NAME.equals(className)) { + LayoutSetPrototypeLocalServiceUtil.getLayoutSetPrototype(classPK); + } else if (MBDISCUSSION_CLASS_NAME.equals(className)) { + MBDiscussionLocalServiceUtil.getMBDiscussion(classPK); + } else if (MBMESSAGE_CLASS_NAME.equals(className)) { + MBMessageLocalServiceUtil.getMBMessage(classPK); + } else if (MBTHREAD_CLASS_NAME.equals(className)) { + MBThreadLocalServiceUtil.getMBThread(classPK); + } else if (ORGANIZATION_CLASS_NAME.equals(className)) { + OrganizationLocalServiceUtil.getOrganization(classPK); + } else if (PAGAMENTO_CLASS_NAME.equals(className)) { + PagamentoLocalServiceUtil.getPagamento(classPK); + } else if (PAREREGEOLOGO_CLASS_NAME.equals(className)) { + ParereGeologoLocalServiceUtil.getParereGeologo(classPK); + } else if (PASSWORDPOLICY_CLASS_NAME.equals(className)) { + PasswordPolicyLocalServiceUtil.getPasswordPolicy(classPK); + } else if (ROLE_CLASS_NAME.equals(className)) { + RoleLocalServiceUtil.getRole(classPK); + } else if (SOGGETTO_CLASS_NAME.equals(className)) { + SoggettoLocalServiceUtil.getSoggetto(classPK); + } else if (SORTEGGIO_CLASS_NAME.equals(className)) { + SorteggioLocalServiceUtil.getSorteggio(classPK); + } else if (USER_CLASS_NAME.equals(className)) { + UserLocalServiceUtil.getUser(classPK); + } else if (USERPERSONALSITE_CLASS_NAME.equals(className)) { + // Nop + } else if (WIKINODE_CLASS_NAME.equals(className)) { + WikiNodeLocalServiceUtil.getWikiNode(classPK); + } else if (WORKFLOWINSTANCE_CLASS_NAME.equals(className)) { + if (Validator.isNull(companyId)) { + _log.info("CompanyId = " + companyId); + ; + } else { + WorkflowInstanceManagerUtil.getWorkflowInstance(companyId, classPK); + } + } else { + if (className.contains(".")) { + switch (className) { + case "com.liferay.portlet.blogs": + case "com.liferay.portlet.documentlibrary": + case "com.liferay.portlet.journal": + case "com.liferay.portlet.messageboards": + case "com.liferay.portlet.polls": + case "com.liferay.portlet.wiki": + case "it.tref.liferay.portos.bo.intpratiche": + break; + default: + _log.info("Classe non supportata: " + className); + } + } + } + } catch (PortalException e) { + return false; + } + } + return true; + } + + private static void deleteFileEntry(long fileEntryId) throws SystemException { + try { + DLAppLocalServiceUtil.deleteFileEntry(fileEntryId); + } catch (PortalException e) { + } + } + + private static void esitoLog(List esito, String msg) { + _log.info(msg); + esito.add(msg); + } + + private static final String ALLEGATOMANUALE_CLASS_NAME = AllegatoManuale.class.getName(); + private static final String ASSETTAG_CLASS_NAME = AssetTag.class.getName(); + private static final String ASSETVOCABULARY_CLASS_NAME = AssetVocabulary.class.getName(); + private static final String ASSEVERAZIONE_CLASS_NAME = Asseverazione.class.getName(); + private static final String AVVISO_CLASS_NAME = Avviso.class.getName(); + private static final String COLLAUDO_CLASS_NAME = Collaudo.class.getName(); + private static final String COMPANY_CLASS_NAME = Company.class.getName(); + private static final String CONTROLLOPRATICA_CLASS_NAME = ControlloPratica.class.getName(); + private static final String DDMSTRUCTURE_CLASS_NAME = DDMStructure.class.getName(); + private static final String DDMTEMPLATE_CLASS_NAME = DDMTemplate.class.getName(); + private static final String DELEGA_CLASS_NAME = Delega.class.getName(); + private static final String DETTPRATICA_CLASS_NAME = DettPratica.class.getName(); + private static final String DLFILEENTRY_CLASS_NAME = DLFileEntry.class.getName(); + private static final String DLFILEENTRYTYPE_CLASS_NAME = DLFileEntryType.class.getName(); + private static final String DLFOLDER_CLASS_NAME = DLFolder.class.getName(); + private static final String DOCAGGIUNTIVA_CLASS_NAME = DocAggiuntiva.class.getName(); + private static final String DOCPRATICA_CLASS_NAME = DocPratica.class.getName(); + private static final String EMAIL_CLASS_NAME = Email.class.getName(); + private static final String EMAILADDRESS_CLASS_NAME = EmailAddress.class.getName(); + private static final String EMAILTEMPLATE_CLASS_NAME = EmailTemplate.class.getName(); + private static final String EXPANDOCOLUMN_CLASS_NAME = ExpandoColumn.class.getName(); + private static final String FINELAVORI_CLASS_NAME = FineLavori.class.getName(); + private static final String GROUP_CLASS_NAME = Group.class.getName(); + private static final String INTPRATICA_CLASS_NAME = IntPratica.class.getName(); + private static final String JOURNALARTICLE_CLASS_NAME = JournalArticle.class.getName(); + private static final String JOURNALARTICLERESOURCE_CLASS_NAME = JournalArticleResource.class.getName(); + private static final String JOURNALFOLDER_CLASS_NAME = JournalFolder.class.getName(); + private static final String LAYOUT_CLASS_NAME = Layout.class.getName(); + private static final String LAYOUTPROTOTYPE_CLASS_NAME = LayoutPrototype.class.getName(); + private static final String LAYOUTSETPROTOTYPE_CLASS_NAME = LayoutSetPrototype.class.getName(); + private static final String MBDISCUSSION_CLASS_NAME = MBDiscussion.class.getName(); + private static final String MBMESSAGE_CLASS_NAME = MBMessage.class.getName(); + private static final String MBTHREAD_CLASS_NAME = MBThread.class.getName(); + private static final String ORGANIZATION_CLASS_NAME = Organization.class.getName(); + private static final String PAGAMENTO_CLASS_NAME = Pagamento.class.getName(); + private static final String PAREREGEOLOGO_CLASS_NAME = ParereGeologo.class.getName(); + private static final String PASSWORDPOLICY_CLASS_NAME = PasswordPolicy.class.getName(); + private static final String ROLE_CLASS_NAME = Role.class.getName(); + private static final String SOGGETTO_CLASS_NAME = Soggetto.class.getName(); + private static final String SORTEGGIO_CLASS_NAME = Sorteggio.class.getName(); + private static final String USER_CLASS_NAME = User.class.getName(); + private static final String USERPERSONALSITE_CLASS_NAME = UserPersonalSite.class.getName(); + private static final String WIKINODE_CLASS_NAME = WikiNode.class.getName(); + private static final String WORKFLOWINSTANCE_CLASS_NAME = WorkflowInstance.class.getName(); +} diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/PuliziaDatabase.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/PuliziaDatabase.java deleted file mode 100644 index 9654e360..00000000 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/PuliziaDatabase.java +++ /dev/null @@ -1,254 +0,0 @@ -/** - * - * @author Salvatore La Manna, Manifattura Web Group per Regione Siciliana - * - */ -package it.mwg.sismica.bo.util; - -import flexjson.JSONSerializer; -import it.tref.liferay.portos.bo.model.Avviso; -import it.tref.liferay.portos.bo.model.ControlloPratica; -import it.tref.liferay.portos.bo.model.DettPratica; -import it.tref.liferay.portos.bo.model.IntPratica; -import it.tref.liferay.portos.bo.model.Sorteggio; -import it.tref.liferay.portos.bo.service.AvvisoLocalServiceUtil; -import it.tref.liferay.portos.bo.service.ConfigurazioneLocalServiceUtil; -import it.tref.liferay.portos.bo.service.ControlloPraticaLocalServiceUtil; -import it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil; -import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil; -import it.tref.liferay.portos.bo.service.SorteggioLocalServiceUtil; -import it.tref.liferay.portos.bo.shared.util.ConfigurazioneConstants; -import it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants; -import it.tref.liferay.portos.bo.util.AvvisoUtil; -import it.tref.liferay.portos.bo.util.WorkflowConstants; - -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.liferay.portal.kernel.cache.CacheRegistryUtil; -import com.liferay.portal.kernel.cache.MultiVMPoolUtil; -import com.liferay.portal.kernel.cache.SingleVMPoolUtil; -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.FileEntry; -import com.liferay.portal.kernel.repository.model.Folder; -import com.liferay.portal.kernel.servlet.DirectServletRegistryUtil; -import com.liferay.portal.kernel.util.StringPool; -import com.liferay.portal.kernel.util.UniqueList; -import com.liferay.portal.kernel.util.Validator; -import com.liferay.portal.security.permission.ActionKeys; -import com.liferay.portal.service.ServiceContext; -import com.liferay.portlet.documentlibrary.service.DLAppLocalServiceUtil; - -public class PuliziaDatabase { - private static final Log _log = LogFactoryUtil.getLog(PuliziaDatabase.class); - private static final int SLICE = 1000; - - public static List pulisci(ServiceContext serviceContext) throws SystemException { - List esito = new ArrayList<>(); - - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - Date min = null; - Date max = null; - try { - min = sdf.parse("2020-09-25 18:40:00"); - max = sdf.parse("2020-09-25 18:50:00"); - } catch (ParseException e) { - esitoLog(esito, "Errore date: " + e.getMessage()); - return esito; - } - - long companyId = serviceContext.getCompanyId(); - long folderId = ConfigurazioneLocalServiceUtil.findByC_ChiaveLong(companyId, - ConfigurazioneConstants.TEMPLATE_FOLDER_ID); - - long templateAnnullamentoId = 0; - try { - Folder folder = DLAppLocalServiceUtil.getFolder(folderId); - FileEntry template = DLAppLocalServiceUtil.getFileEntry(folder.getGroupId(), folderId, "ATAP"); - templateAnnullamentoId = template.getFileEntryId(); - } catch (PortalException e1) { - } - if (Validator.isNull(templateAnnullamentoId)) { - esitoLog(esito, "Template ATAP non trovato"); - return esito; - } - String descLongAnnullamento = "Annullamento d'ufficio"; - - long templateConformitaId = ConfigurazioneLocalServiceUtil.findByC_ChiaveLong(companyId, - "conf.geniocivile.avviso.template.id.deposito.B2"); - String descLongConformita = "Avviso di conformità"; - - List sbagliati = new ArrayList<>(); - List inviate = new UniqueList<>(); - List conformi = new UniqueList<>(); - int start = 0; - List avvisi = new ArrayList<>(); - do { - avvisi = AvvisoLocalServiceUtil.getAvvisos(start, start + SLICE); - for (Avviso avviso : avvisi) { - if (avviso.getDtAvviso().after(min) && avviso.getDtAvviso().before(max) - && avviso.getTipoDocumento().equalsIgnoreCase(StatoPraticaConstants.CONFORME)) { - sbagliati.add(avviso); - } else if (avviso.getFileEntryIdTemplate() == templateAnnullamentoId) { - inviate.add(avviso.getIntPraticaId()); - } else if (avviso.getFileEntryIdTemplate() == templateConformitaId) { - conformi.add(avviso.getIntPraticaId()); - } - } - start += SLICE; - } while (avvisi.size() > 0); - - SimpleDateFormat dfmt = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss"); - JSONSerializer jsonSerializer = new JSONSerializer(); - - int noIntPratica = 0; - int annullatiA = 0; - int annullatiB = 0; - int annullatiC = 0; - for (Avviso avviso : sbagliati) { - long intPraticaId = avviso.getIntPraticaId(); - if (!inviate.contains(intPraticaId)) { - IntPratica intPratica = null; - try { - intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId); - } catch (PortalException e) { - } - if (Validator.isNull(intPratica)) { - noIntPratica++; - } else { - Map parameters = new HashMap<>(); - parameters.put("dataProtocolloAnnullato", dfmt.format(avviso.getDtProtocollo())); - parameters.put("numeroProtocolloAnnullato", avviso.getProtocollo()); - - DettPratica dettPratica = DettPraticaLocalServiceUtil - .getLastCompletedByIntPratica(intPraticaId); - List controlli = ControlloPraticaLocalServiceUtil - .findByIntPraticaId_Status(intPraticaId, WorkflowConstants.STATUS_PENDING); - long controlloPraticaId = 0; - if (controlli.size() > 0) { - controlloPraticaId = controlli.get(controlli.size() - 1).getPrimaryKey(); - } - ServiceContext ctx = new ServiceContext(); - ctx.setCompanyId(intPratica.getCompanyId()); - ctx.setScopeGroupId(intPratica.getGroupId()); - ctx.setUserId(intPratica.getUserId()); - ctx.setGroupPermissions(new String[] { ActionKeys.VIEW }); - - String jsonParameters = StringPool.BLANK; - - switch (intPratica.getTipoProcedura().toUpperCase()) { - case "A": - annullatiA++; - break; - case "B": - case "B1": - Sorteggio sorteggio = SorteggioLocalServiceUtil.findByIntPratica(intPratica - .getIntPraticaId()); - jsonParameters = jsonSerializer.serialize(parameters); - try { - if (Validator.isNull(sorteggio)) { - AvvisoLocalServiceUtil.addAvviso(intPraticaId, descLongAnnullamento, - new Date(), AvvisoUtil.TIPO_AVVISO_DIRETTO, "MA", - templateAnnullamentoId, dettPratica.getPrimaryKey(), - DettPratica.class.getName(), StringPool.BLANK, jsonParameters, - controlloPraticaId, serviceContext); - } - if (!conformi.contains(intPraticaId)) { - AvvisoLocalServiceUtil.addAvviso(intPratica.getIntPraticaId(), - descLongConformita, new Date(), AvvisoUtil.TIPO_AVVISO_DIRETTO, - StatoPraticaConstants.CONFORME, templateConformitaId, - dettPratica.getDettPraticaId(), DettPratica.class.getName(), - controlloPraticaId, serviceContext); - } - } catch (PortalException e) { - esitoLog(esito, "Errore nell'invio per pratica " + intPratica.getNumeroProgetto() - + ", " + e.getMessage()); - } - String logStr = "Pratica " + intPratica.getNumeroProgetto() + " (" + intPraticaId - + "), procedura " + intPratica.getTipoProcedura(); - if (Validator.isNull(sorteggio)) { - logStr += ", invio annullamento"; - } else { - logStr += ", non invio annullamento perché sorteggiata"; - } - if (conformi.contains(intPraticaId)) { - logStr += ", conformità già inviata"; - } else { - logStr += ", invio conformità"; - } - esitoLog(esito, logStr); - annullatiB++; - break; - case "C": - Avviso valido = null; - avvisi = AvvisoLocalServiceUtil.findByIntPraticaId_tipoDocumento(intPraticaId, - StatoPraticaConstants.VIDIMATA); - for (Avviso presente : avvisi) { - if (presente.getPrimaryKey() != avviso.getPrimaryKey()) { - if ((presente.getPrimaryKey() <= avviso.getPrimaryKey()) - && (Validator.isNull(valido) || (valido.getPrimaryKey() > presente - .getPrimaryKey()))) { - valido = presente; - } - } - } - if (Validator.isNotNull(valido)) { - parameters.put("dataProtocolloValido", dfmt.format(valido.getDtProtocollo())); - parameters.put("numeroProtocolloValido", valido.getProtocollo()); - jsonParameters = jsonSerializer.serialize(parameters); - try { - AvvisoLocalServiceUtil.addAvviso(intPraticaId, descLongAnnullamento, - new Date(), AvvisoUtil.TIPO_AVVISO_DIRETTO, "MA", - templateAnnullamentoId, dettPratica.getPrimaryKey(), - DettPratica.class.getName(), StringPool.BLANK, jsonParameters, - controlloPraticaId, serviceContext); - } catch (PortalException e) { - esitoLog(esito, - "Errore nell'invio per pratica " + intPratica.getNumeroProgetto() - + ", " + e.getMessage()); - } - } - esitoLog(esito, "Pratica " + intPratica.getNumeroProgetto() + " (" + intPraticaId - + "), procedura " + intPratica.getTipoProcedura() + ", " + jsonParameters); - annullatiC++; - break; - } - } - } - } - _log.info(sbagliati.size() + " avvisi"); - _log.info("Procedura A = " + annullatiA); - _log.info("Procedura B = " + annullatiB); - _log.info("Procedura C = " + annullatiC); - _log.info("IntPratica non esistente = " + noIntPratica); - return esito; - } - - public static List pulisci2(ServiceContext serviceContext) { - List esito = new ArrayList<>(); - - try { - SingleVMPoolUtil.clear(); - MultiVMPoolUtil.clear(); - CacheRegistryUtil.clear(); - DirectServletRegistryUtil.clearServlets(); - // WebCachePoolUtil.clear(); - } catch (IllegalStateException e) { - } - - return esito; - } - - private static void esitoLog(List esito, String msg) { - _log.info(msg); - esito.add(msg); - } -} diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SismicaUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SismicaUtil.java index 24bf28ac..794e4c1e 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SismicaUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SismicaUtil.java @@ -5,7 +5,6 @@ */ package it.mwg.sismica.bo.util; -import flexjson.JSONSerializer; import it.tref.liferay.portos.bo.model.AllegatoManuale; import it.tref.liferay.portos.bo.model.Asseverazione; import it.tref.liferay.portos.bo.model.Avviso; @@ -60,9 +59,12 @@ import javax.portlet.ActionResponse; import com.liferay.counter.service.CounterLocalServiceUtil; import com.liferay.portal.NoSuchResourcePermissionException; +import com.liferay.portal.kernel.dao.orm.DynamicQuery; import com.liferay.portal.kernel.dao.orm.QueryUtil; +import com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil; import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception.SystemException; +import com.liferay.portal.kernel.json.JSONFactoryUtil; import com.liferay.portal.kernel.language.LanguageUtil; import com.liferay.portal.kernel.log.Log; import com.liferay.portal.kernel.log.LogFactoryUtil; @@ -74,6 +76,7 @@ import com.liferay.portal.kernel.util.LocaleUtil; import com.liferay.portal.kernel.util.OrderByComparatorFactoryUtil; import com.liferay.portal.kernel.util.ParamUtil; import com.liferay.portal.kernel.util.StringPool; +import com.liferay.portal.kernel.util.ThreadUtil; import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.kernel.util.WebKeys; import com.liferay.portal.kernel.workflow.WorkflowException; @@ -86,8 +89,10 @@ import com.liferay.portal.model.Organization; import com.liferay.portal.model.ResourceAction; import com.liferay.portal.model.ResourceConstants; import com.liferay.portal.model.ResourcePermission; +import com.liferay.portal.model.Role; import com.liferay.portal.model.RoleConstants; import com.liferay.portal.model.User; +import com.liferay.portal.model.WorkflowInstanceLink; import com.liferay.portal.security.permission.ActionKeys; import com.liferay.portal.security.permission.PermissionChecker; import com.liferay.portal.security.permission.PermissionCheckerFactoryUtil; @@ -97,11 +102,18 @@ import com.liferay.portal.service.ResourcePermissionLocalServiceUtil; import com.liferay.portal.service.RoleLocalServiceUtil; import com.liferay.portal.service.ServiceContext; import com.liferay.portal.service.UserLocalServiceUtil; +import com.liferay.portal.service.WorkflowInstanceLinkLocalServiceUtil; import com.liferay.portal.theme.ThemeDisplay; +import com.liferay.portal.workflow.kaleo.definition.LogType; +import com.liferay.portal.workflow.kaleo.model.KaleoInstance; import com.liferay.portal.workflow.kaleo.model.KaleoInstanceToken; +import com.liferay.portal.workflow.kaleo.model.KaleoLog; +import com.liferay.portal.workflow.kaleo.model.KaleoNode; import com.liferay.portal.workflow.kaleo.model.KaleoTaskAssignmentInstance; import com.liferay.portal.workflow.kaleo.model.KaleoTaskInstanceToken; +import com.liferay.portal.workflow.kaleo.service.KaleoInstanceLocalServiceUtil; import com.liferay.portal.workflow.kaleo.service.KaleoInstanceTokenLocalServiceUtil; +import com.liferay.portal.workflow.kaleo.service.KaleoLogLocalServiceUtil; import com.liferay.portal.workflow.kaleo.service.KaleoTaskAssignmentInstanceLocalServiceUtil; import com.liferay.portal.workflow.kaleo.service.KaleoTaskInstanceTokenLocalServiceUtil; import com.liferay.portlet.documentlibrary.model.DLFileEntry; @@ -111,13 +123,12 @@ import com.liferay.portlet.documentlibrary.service.DLAppServiceUtil; public class SismicaUtil { private final static Log _log = LogFactoryUtil.getLog(SismicaUtil.class); - private static final SimpleDateFormat dfmt = new SimpleDateFormat( - "dd/MM/yyyy hh:mm:ss"); - private static final SimpleDateFormat sdfGiornoDB = new SimpleDateFormat( - "yyyy-MM-dd"); + private static final SimpleDateFormat dfmt = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss"); + private static final SimpleDateFormat sdfGiornoDB = new SimpleDateFormat("yyyy-MM-dd"); private final static int SLICE = 1000; public static Date[] getWeekInterval(int dow) { + ThreadUtil.threadDump(); return getWeekInterval(dow, Calendar.getInstance().getTime()); } @@ -129,8 +140,7 @@ public class SismicaUtil { reference.set(Calendar.SECOND, 0); reference.set(Calendar.MILLISECOND, 0); - reference.add(Calendar.DAY_OF_WEEK, - Calendar.MONDAY - reference.get(Calendar.DAY_OF_WEEK)); + reference.add(Calendar.DAY_OF_WEEK, Calendar.MONDAY - reference.get(Calendar.DAY_OF_WEEK)); reference.add(Calendar.MILLISECOND, -1); Date end = reference.getTime(); @@ -165,26 +175,207 @@ public class SismicaUtil { return null; } - public static Long daysBetween(String start, String end) { - Long diff = null; - try { - diff = daysBetween(sdfGiornoDB.parse(start), sdfGiornoDB.parse(end)); - } catch (ParseException e) { + public static List integrazioniScadute() throws SystemException, PortalException { + List esito = new ArrayList<>(); + + final int giorniScadenza = 30; + final long taskId = 21642; + final String taskName = "Esito"; + final long nodeId = 21639; + final String nodeName = "Esito"; + final String validCurrentNodeName = "signal_cittadino"; + final String comment = "Pratica riassegnata automaticamente dal sistema per scadenza dei termini di integrazione"; + + Calendar calendar = Calendar.getInstance(); + + calendar.set(Calendar.HOUR, 0); + calendar.set(Calendar.MINUTE, 0); + calendar.set(Calendar.SECOND, 0); + calendar.add(Calendar.DAY_OF_YEAR, -giorniScadenza); + Date inizio = calendar.getTime(); + + int scadute = 0; + DynamicQuery dynamicQuery = IntPraticaLocalServiceUtil.dynamicQuery(); + dynamicQuery.add(RestrictionsFactoryUtil.eq("statoPratica", StatoPraticaConstants.INTEGRAZIONE)); + List pratiche = IntPraticaLocalServiceUtil.dynamicQuery(dynamicQuery); + for (IntPratica pratica : pratiche) { + Date dtUltimoAvviso = null; + List avvisi = AvvisoLocalServiceUtil.findByIntPraticaId_tipoDocumento( + pratica.getIntPraticaId(), StatoPraticaConstants.INTEGRAZIONE); + for (Avviso avviso : avvisi) { + if (avviso.getTipoAvviso().equalsIgnoreCase(AvvisoUtil.TIPO_AVVISO_FIRMA) + && avviso.getInviato().equalsIgnoreCase(AvvisoUtil.DOCUMENTO_INVIATO) + && !avviso.getAnnullato() && !avviso.getRifiutato() && !avviso.getErrore() + && (Validator.isNull(dtUltimoAvviso) || dtUltimoAvviso.before(avviso.getDtInvio()))) { + dtUltimoAvviso = avviso.getDtInvio(); + } + } + if (Validator.isNotNull(dtUltimoAvviso) && dtUltimoAvviso.before(inizio)) { + scadute++; + esito.addAll(riassegnaAlTecnico(pratica, comment, validCurrentNodeName, taskId, taskName, + nodeId, nodeName)); + } } - return diff; + esitoLog(esito, "Pratiche con richiesta di integrazione " + pratiche.size() + ", scadute " + scadute); + return esito; } - public static Long daysPast(Date start) { - return daysBetween(start, new Date()); + private static List riassegnaAlTecnico(IntPratica pratica, String comment, + String validCurrentNodeName, long taskId, String taskName, long nodeId, String nodeName) + throws SystemException, PortalException { + List esito = new ArrayList<>(); + List controlli = ControlloPraticaLocalServiceUtil.findByIntPraticaId_Status( + pratica.getIntPraticaId(), WorkflowConstants.STATUS_TASK_APPROVAZIONE_ESITO_ISTRUTTORIA); + if (1 == controlli.size()) { + ControlloPratica controllo = controlli.get(0); + long companyId = controllo.getCompanyId(); + long groupId = controllo.getGroupId(); + long tecnicoUserId = pratica.getStatusByUserId(); + + WorkflowInstanceLink instanceLink = WorkflowInstanceLinkLocalServiceUtil.getWorkflowInstanceLink( + companyId, groupId, ControlloPratica.class.getName(), controllo.getPrimaryKey()); + KaleoInstance instance = KaleoInstanceLocalServiceUtil.getKaleoInstance(instanceLink + .getWorkflowInstanceId()); + KaleoInstanceToken instanceToken = KaleoInstanceTokenLocalServiceUtil + .getKaleoInstanceToken(instance.getRootKaleoInstanceTokenId()); + + if (Validator.isNull(validCurrentNodeName) + || validCurrentNodeName.equals(instanceToken.getCurrentKaleoNodeName())) { + Date adesso = new Date(); + + Role adminRole = RoleLocalServiceUtil.getRole(companyId, RoleConstants.ADMINISTRATOR); + User adminUser = UserLocalServiceUtil.getRoleUsers(adminRole.getRoleId(), 0, 1).get(0); + + ServiceContext scAdmin = new ServiceContext(); + scAdmin.setCompanyId(companyId); + scAdmin.setScopeGroupId(groupId); + scAdmin.setUserId(adminUser.getUserId()); + + ServiceContext scTecnico = new ServiceContext(); + scTecnico.setCompanyId(companyId); + scTecnico.setScopeGroupId(groupId); + scTecnico.setUserId(tecnicoUserId); + + List taskInstanceTokens = KaleoTaskInstanceTokenLocalServiceUtil + .getKaleoTaskInstanceTokens(instance.getKaleoInstanceId(), true, 0, 1, + OrderByComparatorFactoryUtil.create("KaleoTaskInstanceToken", + "kaleoTaskInstanceTokenId", false), scTecnico); + if (taskInstanceTokens.size() > 0) { + @SuppressWarnings("unchecked") + Map workflowContext = (Map) JSONFactoryUtil + .deserialize(taskInstanceTokens.get(0).getWorkflowContext()); + long definitionId = taskInstanceTokens.get(0).getKaleoDefinitionId(); + User tecnicoUser = UserLocalServiceUtil.getUser(tecnicoUserId); + + KaleoTaskInstanceToken taskInstanceToken = KaleoTaskInstanceTokenLocalServiceUtil + .createKaleoTaskInstanceToken(CounterLocalServiceUtil.increment()); + taskInstanceToken.setGroupId(groupId); + taskInstanceToken.setCompanyId(companyId); + taskInstanceToken.setUserId(adminUser.getUserId()); + taskInstanceToken.setUserName(adminUser.getFullName()); + taskInstanceToken.setCreateDate(adesso); + taskInstanceToken.setModifiedDate(adesso); + taskInstanceToken.setKaleoDefinitionId(definitionId); + taskInstanceToken.setKaleoInstanceId(instance.getKaleoInstanceId()); + taskInstanceToken.setKaleoInstanceTokenId(instanceToken.getKaleoInstanceTokenId()); + taskInstanceToken.setKaleoTaskId(taskId); + taskInstanceToken.setKaleoTaskName(taskName); + taskInstanceToken.setClassName(ControlloPratica.class.getName()); + taskInstanceToken.setClassPK(controllo.getPrimaryKey()); + taskInstanceToken.setWorkflowContext(JSONFactoryUtil.serialize(workflowContext)); + + KaleoTaskAssignmentInstanceLocalServiceUtil.addKaleoTaskAssignmentInstance(groupId, + taskInstanceToken, User.class.getName(), tecnicoUserId, scAdmin); + KaleoTaskInstanceTokenLocalServiceUtil.updateKaleoTaskInstanceToken(taskInstanceToken); + + KaleoLog log = KaleoLogLocalServiceUtil.createKaleoLog(CounterLocalServiceUtil + .increment()); + log.setUserId(adminUser.getUserId()); + log.setUserName(adminUser.getFullName()); + log.setCompanyId(companyId); + log.setCreateDate(adesso); + log.setModifiedDate(adesso); + log.setKaleoClassName(KaleoNode.class.getName()); + log.setKaleoClassPK(nodeId); + log.setKaleoDefinitionId(definitionId); + log.setKaleoInstanceId(instance.getKaleoInstanceId()); + log.setKaleoInstanceTokenId(instanceToken.getKaleoInstanceTokenId()); + log.setKaleoTaskInstanceTokenId(taskInstanceToken.getKaleoTaskInstanceTokenId()); + log.setKaleoNodeName(nodeName); + log.setCurrentAssigneeClassName(User.class.getName()); + log.setCurrentAssigneeClassPK(tecnicoUserId); + log.setType(LogType.TASK_ASSIGNMENT.name()); + log.setComment(comment); + log.setStartDate(adesso); + log.setWorkflowContext(JSONFactoryUtil.serialize(workflowContext)); + KaleoLogLocalServiceUtil.updateKaleoLog(log); + + instanceToken.setCurrentKaleoNodeId(nodeId); + instanceToken.setCurrentKaleoNodeName(nodeName); + KaleoInstanceTokenLocalServiceUtil.updateKaleoInstanceToken(instanceToken); + + esitoLog( + esito, + "Riassegnato workflow instance " + instance.getKaleoInstanceId() + + " per pratica " + pratica.getNumeroProgetto() + " (" + + pratica.getIntPraticaId() + "), istruttore " + + tecnicoUser.getFullName()); + } else { + esitoLog(esito, "Errore su integrazione. Pratica " + pratica.getNumeroProgetto() + " (" + + pratica.getIntPraticaId() + "), controllo " + controllo.getControlloPraticaId() + + ", taskInstanceToken = " + taskInstanceTokens.size()); + } + } else { + esitoLog(esito, "Nome nodo corrente non valido: " + instanceToken.getCurrentKaleoNodeName()); + } + } else { + esitoLog( + esito, + "Errore su integrazione. Pratica " + pratica.getNumeroProgetto() + " (" + + pratica.getIntPraticaId() + "), numero di controlli = " + controlli.size()); + } + return esito; } - public static Long daysPast(String start) { - Long diff = null; - try { - diff = daysBetween(sdfGiornoDB.parse(start), new Date()); - } catch (ParseException e) { + public static List aggiungiWorkflow(String numeroProgetto, String mode) throws SystemException, + PortalException { + List esito = new ArrayList<>(); + + IntPratica pratica = IntPraticaLocalServiceUtil.findByNumeroProgetto(numeroProgetto); + if (Validator.isNull(pratica)) { + esitoLog(esito, "Progetto " + numeroProgetto + " non trovato"); + } else { + String comment = "Workflow riassegnato dal sistema"; + long taskId; + String taskName; + long nodeId; + String nodeName; + + switch (mode) { + case "Esito": + taskId = 21642; + taskName = "Esito"; + nodeId = 21639; + nodeName = "Esito"; + break; + default: + return esitoLog(esito, "Nome nodo non corretto: " + mode); + } + esito.addAll(riassegnaAlTecnico(pratica, comment, null, taskId, taskName, nodeId, nodeName)); } - return diff; + return esito; + } + + public static long daysBetween(String start, String end) throws ParseException { + return daysBetween(sdfGiornoDB.parse(start), sdfGiornoDB.parse(end)); + } + + public static long daysPast(Date start) { + return daysBetween(start, new Date()); + } + + public static long daysPast(String start) throws ParseException { + return daysBetween(sdfGiornoDB.parse(start), new Date()); } public static boolean isLong(String s) { @@ -199,13 +390,11 @@ public class SismicaUtil { public static List reIndexFascicoli(long companyId) { List esito = new ArrayList<>(); - int start = 0; int totale = 0; List pratiche = null; do { try { - pratiche = IntPraticaLocalServiceUtil.getIntPraticas(start, - start + SLICE); + pratiche = IntPraticaLocalServiceUtil.getIntPraticas(totale, totale + SLICE); } catch (SystemException e) { pratiche = new ArrayList<>(); } @@ -213,42 +402,35 @@ public class SismicaUtil { IntPraticaLocalServiceUtil.reIndexFascicolo(pratica, companyId); } totale += pratiche.size(); - start += SLICE; - _log.info("Reindicizzate " + start + " pratiche"); + _log.info("Reindicizzate " + totale + " pratiche"); } while (pratiche.size() > 0); esito.add("" + totale + " pratiche reindicizzate."); return esito; } - public static void inviaAvviso(ActionRequest actionRequest, - ActionResponse actionResponse) throws SystemException { + public static void inviaAvviso(ActionRequest actionRequest, ActionResponse actionResponse) + throws SystemException { List esito = new ArrayList<>(); - ThemeDisplay td = (ThemeDisplay) actionRequest - .getAttribute(WebKeys.THEME_DISPLAY); + ThemeDisplay td = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); long companyId = td.getCompanyId(); String tipoAvviso = ParamUtil.getString(actionRequest, "tipoAvviso"); actionResponse.setRenderParameter("tipoAvviso", tipoAvviso); if (Validator.isNull(tipoAvviso)) { SessionErrors.add(actionRequest, "invia-avviso-tipo-obbligatorio"); } - String numeroProgetto = ParamUtil.getString(actionRequest, - "numeroProgetto"); + String numeroProgetto = ParamUtil.getString(actionRequest, "numeroProgetto"); actionResponse.setRenderParameter("numeroProgetto", numeroProgetto); if (Validator.isNull(numeroProgetto)) { - SessionErrors.add(actionRequest, - "invia-avviso-progetto-obbligatorio"); + SessionErrors.add(actionRequest, "invia-avviso-progetto-obbligatorio"); } - IntPratica intPratica = IntPraticaLocalServiceUtil - .findByNumeroProgetto(numeroProgetto); + IntPratica intPratica = IntPraticaLocalServiceUtil.findByNumeroProgetto(numeroProgetto); if (Validator.isNull(intPratica)) { - SessionErrors.add(actionRequest, - "invia-avviso-progetto-inesistente"); + SessionErrors.add(actionRequest, "invia-avviso-progetto-inesistente"); return; } long intPraticaId = intPratica.getIntPraticaId(); - List controlli = ControlloPraticaLocalServiceUtil - .findByIntPratica(intPraticaId); + List controlli = ControlloPraticaLocalServiceUtil.findByIntPratica(intPraticaId); long controlloPraticaId = 0; for (ControlloPratica controllo : controlli) { controlloPraticaId = controllo.getControlloPraticaId(); @@ -260,12 +442,9 @@ public class SismicaUtil { switch (tipoAvviso) { case StatoPraticaConstants.COLLAUDO: - List collaudi = CollaudoLocalServiceUtil - .findByIntPraticaId_Completata(intPraticaId, true, - QueryUtil.ALL_POS, QueryUtil.ALL_POS, - OrderByComparatorFactoryUtil.create( - CollaudoImpl.TABLE_NAME, "dtProtocollo", - true)); + List collaudi = CollaudoLocalServiceUtil.findByIntPraticaId_Completata(intPraticaId, + true, QueryUtil.ALL_POS, QueryUtil.ALL_POS, + OrderByComparatorFactoryUtil.create(CollaudoImpl.TABLE_NAME, "dtProtocollo", true)); Collaudo collaudo = null; for (Collaudo el : collaudi) { if (Validator.isNotNull(el.getDtProtocollo())) { @@ -273,8 +452,7 @@ public class SismicaUtil { } } if (Validator.isNull(collaudo)) { - SessionErrors.add(actionRequest, - "invia-avviso-collaudo-non-trovato"); + SessionErrors.add(actionRequest, "invia-avviso-collaudo-non-trovato"); return; } tipoDocumento = StatoPraticaConstants.VIDIMATA; @@ -284,12 +462,9 @@ public class SismicaUtil { break; case StatoPraticaConstants.FINE_LAVORI: - List fineLavori = FineLavoriLocalServiceUtil - .findByIntPraticaId_Completata(intPraticaId, true, - QueryUtil.ALL_POS, QueryUtil.ALL_POS, - OrderByComparatorFactoryUtil.create( - FineLavoriImpl.TABLE_NAME, "dtProtocollo", - true)); + List fineLavori = FineLavoriLocalServiceUtil.findByIntPraticaId_Completata( + intPraticaId, true, QueryUtil.ALL_POS, QueryUtil.ALL_POS, + OrderByComparatorFactoryUtil.create(FineLavoriImpl.TABLE_NAME, "dtProtocollo", true)); FineLavori fineLavoro = null; for (FineLavori el : fineLavori) { if (Validator.isNotNull(el.getDtProtocollo())) { @@ -297,8 +472,7 @@ public class SismicaUtil { } } if (Validator.isNull(fineLavoro)) { - SessionErrors.add(actionRequest, - "invia-avviso-finelavori-non-trovato"); + SessionErrors.add(actionRequest, "invia-avviso-finelavori-non-trovato"); return; } tipoDocumento = StatoPraticaConstants.VIDIMATA; @@ -370,23 +544,18 @@ public class SismicaUtil { return; } - String templateName = AvvisoUtil.getAllTipoDocumentoFileTemplateProps() - .get(tipoAvviso); - long template = ConfigurazioneLocalServiceUtil.findByC_ChiaveLong( - companyId, templateName); + String templateName = AvvisoUtil.getAllTipoDocumentoFileTemplateProps().get(tipoAvviso); + long template = ConfigurazioneLocalServiceUtil.findByC_ChiaveLong(companyId, templateName); esito.add("template = " + templateName); try { - AvvisoLocalServiceUtil.addAvviso(intPraticaId, StringPool.BLANK, - new Date(), AvvisoUtil.TIPO_AVVISO_DIRETTO, tipoDocumento, - template, classPk, className, controlloPraticaId, - getServiceContextbyIntPratica(intPratica)); + AvvisoLocalServiceUtil.addAvviso(intPraticaId, StringPool.BLANK, new Date(), + AvvisoUtil.TIPO_AVVISO_DIRETTO, tipoDocumento, template, classPk, className, + controlloPraticaId, getServiceContextbyIntPratica(intPratica)); } catch (PortalException e) { SessionErrors.add(actionRequest, "errore-generico"); - esito.add("Errore durante la generazione dell'avviso: " - + e.getMessage()); + esito.add("Errore durante la generazione dell'avviso: " + e.getMessage()); } - actionResponse.setRenderParameter("esito", - esito.toArray(new String[esito.size()])); + actionResponse.setRenderParameter("esito", esito.toArray(new String[esito.size()])); } public static List riparaWorkflow(long companyId, long userId) { @@ -404,8 +573,7 @@ public class SismicaUtil { return esito; } - private static List riparaAssegnazioniAlRuolo(long companyId, - long userId) { + private static List riparaAssegnazioniAlRuolo(long companyId, long userId) { List esito = new ArrayList<>(); esito.add("Controllo assegnazioni al ruolo"); @@ -413,19 +581,18 @@ public class SismicaUtil { List tasks = null; do { try { - tasks = WorkflowTaskManagerUtil.getWorkflowTasks(companyId, - false, start, start + SLICE, null); + tasks = WorkflowTaskManagerUtil + .getWorkflowTasks(companyId, false, start, start + SLICE, null); } catch (WorkflowException e) { - esito.add("Errore durante il recupero dei task: " - + e.getMessage()); + esito.add("Errore durante il recupero dei task: " + e.getMessage()); tasks = new ArrayList<>(); } start += SLICE; for (WorkflowTask task : tasks) { WorkflowInstance instance; try { - instance = WorkflowInstanceManagerUtil.getWorkflowInstance( - companyId, task.getWorkflowInstanceId()); + instance = WorkflowInstanceManagerUtil.getWorkflowInstance(companyId, + task.getWorkflowInstanceId()); } catch (WorkflowException e) { esito.add("Errore durante il recupero di WorkflowInstance per WorkflowTask " + task.getWorkflowTaskId() + ": " + e.getMessage()); @@ -435,70 +602,46 @@ public class SismicaUtil { long assigneeId = task.getAssigneeUserId(); boolean nonAssegnato = ((assigneeId == 0) || (assigneeId == -1)); if (nonAssegnato && (instance.getState().equals("Esito"))) { - Map attributes = task - .getOptionalAttributes(); - String taskClass = (String) attributes - .get(WorkflowConstants.CONTEXT_ENTRY_CLASS_NAME); + Map attributes = task.getOptionalAttributes(); + String taskClass = (String) attributes.get(WorkflowConstants.CONTEXT_ENTRY_CLASS_NAME); if (taskClass.equals(ControlloPratica.class.getName())) { long classPK = GetterUtil.getLong((String) attributes .get(WorkflowConstants.CONTEXT_ENTRY_CLASS_PK)); ControlloPratica controllo; try { - controllo = ControlloPraticaLocalServiceUtil - .getControlloPratica(classPK); + controllo = ControlloPraticaLocalServiceUtil.getControlloPratica(classPK); } catch (PortalException | SystemException e) { - esito.add("Errore durante il recupero del ControlloPratica " - + classPK - + ", WorkflowTask " - + task.getWorkflowTaskId() - + ": " - + e.getMessage()); + esito.add("Errore durante il recupero del ControlloPratica " + classPK + + ", WorkflowTask " + task.getWorkflowTaskId() + ": " + e.getMessage()); return esito; } IntPratica pratica; try { - pratica = IntPraticaLocalServiceUtil - .getIntPratica(controllo.getIntPraticaId()); + pratica = IntPraticaLocalServiceUtil.getIntPratica(controllo.getIntPraticaId()); } catch (PortalException | SystemException e) { esito.add("Errore durante il recupero di IntPratica " - + controllo.getIntPraticaId() - + ", ControlloPratica " - + classPK - + ", WorkflowTask " - + task.getWorkflowTaskId() - + ": " - + e.getMessage()); + + controllo.getIntPraticaId() + ", ControlloPratica " + classPK + + ", WorkflowTask " + task.getWorkflowTaskId() + ": " + e.getMessage()); return esito; } User user = null; try { - user = UserLocalServiceUtil.getUser(pratica - .getStatusByUserId()); + user = UserLocalServiceUtil.getUser(pratica.getStatusByUserId()); } catch (PortalException | SystemException e) { - esito.add("Errore durante il recupero dell'utente " - + pratica.getStatusByUserId()); + esito.add("Errore durante il recupero dell'utente " + pratica.getStatusByUserId()); return esito; } - esito.add("Pratica non assegnabile " - + pratica.getNumeroProgetto() + " (" - + pratica.getIntPraticaId() - + ") - Kaleo disallineato WorkflowInstance " - + instance.getWorkflowInstanceId() - + ", riassegno a " + user.getFirstName() + " " - + user.getLastName()); + esito.add("Pratica non assegnabile " + pratica.getNumeroProgetto() + " (" + + pratica.getIntPraticaId() + ") - Kaleo disallineato WorkflowInstance " + + instance.getWorkflowInstanceId() + ", riassegno a " + user.getFirstName() + + " " + user.getLastName()); try { - WorkflowTaskManagerUtil - .assignWorkflowTaskToUser( - companyId, - userId, - task.getWorkflowTaskId(), - pratica.getStatusByUserId(), - "Riassegnazione automatica da sistema per recupero workflow", - task.getDueDate(), - instance.getWorkflowContext()); + WorkflowTaskManagerUtil.assignWorkflowTaskToUser(companyId, userId, + task.getWorkflowTaskId(), pratica.getStatusByUserId(), + "Riassegnazione automatica da sistema per recupero workflow", + task.getDueDate(), instance.getWorkflowContext()); } catch (WorkflowException e) { - esito.add("Errore durante la riassegnazione: " - + e.getMessage()); + esito.add("Errore durante la riassegnazione: " + e.getMessage()); } } else { esito.add("La classe del task è " + taskClass); @@ -516,16 +659,12 @@ public class SismicaUtil { int dow; Date data; try { - dow = Integer.parseInt(ConfigurazioneLocalServiceUtil - .findByC_ChiaveString(companyId, - ConfigurazioneConstants.DAY_OF_WEEK_SORTEGGIO)); - data = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss") - .parse(ConfigurazioneLocalServiceUtil.findByC_ChiaveString( - companyId, - ConfigurazioneConstants.DATE_ULTIMO_SORTEGGIO)); + dow = Integer.parseInt(ConfigurazioneLocalServiceUtil.findByC_ChiaveString(companyId, + ConfigurazioneConstants.DAY_OF_WEEK_SORTEGGIO)); + data = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss").parse(ConfigurazioneLocalServiceUtil + .findByC_ChiaveString(companyId, ConfigurazioneConstants.DATE_ULTIMO_SORTEGGIO)); } catch (ParseException | NumberFormatException | SystemException e) { - esito.add("Errore nel recupero della configurazione sorteggio: " - + e.getMessage()); + esito.add("Errore nel recupero della configurazione sorteggio: " + e.getMessage()); return esito; } data = getWeekInterval(dow, data)[1]; @@ -534,73 +673,52 @@ public class SismicaUtil { int start = 0; do { try { - pratiche = IntPraticaLocalServiceUtil.getIntPraticas(start, - start + SLICE); + pratiche = IntPraticaLocalServiceUtil.getIntPraticas(start, start + SLICE); start += SLICE; for (IntPratica pratica : pratiche) { int numeroAvvisi = 0; - numeroAvvisi = AvvisoLocalServiceUtil - .findByIntPratica_Inviato( - pratica.getIntPraticaId(), "S", - QueryUtil.ALL_POS, QueryUtil.ALL_POS, null) - .size(); - if (pratica.getTipoProcedura().equalsIgnoreCase( - Constants.PROCEDURA_B1) + numeroAvvisi = AvvisoLocalServiceUtil.findByIntPratica_Inviato(pratica.getIntPraticaId(), + "S", QueryUtil.ALL_POS, QueryUtil.ALL_POS, null).size(); + if (pratica.getTipoProcedura().equalsIgnoreCase(Constants.PROCEDURA_B1) && Validator.isNull(pratica.getDtSorteggio()) - && pratica.getStatoPratica().equalsIgnoreCase( - StatoPraticaConstants.VIDIMATA) - && (numeroAvvisi < 2) - && (pratica.getDtPratica().compareTo(data) <= 0)) { - esito.add(" Pratica " + pratica.getNumeroProgetto() - + " (" + pratica.getIntPraticaId() + ") - " - + pratica.getUserName() + ", " + numeroAvvisi - + " avvisi"); + && pratica.getStatoPratica().equalsIgnoreCase(StatoPraticaConstants.VIDIMATA) + && (numeroAvvisi < 2) && (pratica.getDtPratica().compareTo(data) <= 0)) { + esito.add(" Pratica " + pratica.getNumeroProgetto() + " (" + + pratica.getIntPraticaId() + ") - " + pratica.getUserName() + ", " + + numeroAvvisi + " avvisi"); DettPratica dettPratica = DettPraticaLocalServiceUtil - .getLastCompletedByIntPratica(pratica - .getIntPraticaId()); - long fileEntryIdTemplate = ConfigurazioneLocalServiceUtil - .findByC_ChiaveLong(companyId, - "conf.geniocivile.avviso.template.id.deposito.B2"); + .getLastCompletedByIntPratica(pratica.getIntPraticaId()); + long fileEntryIdTemplate = ConfigurazioneLocalServiceUtil.findByC_ChiaveLong( + companyId, "conf.geniocivile.avviso.template.id.deposito.B2"); ServiceContext serviceContext = new ServiceContext(); serviceContext.setCompanyId(dettPratica.getCompanyId()); - serviceContext - .setScopeGroupId(dettPratica.getGroupId()); + serviceContext.setScopeGroupId(dettPratica.getGroupId()); serviceContext.setUserId(dettPratica.getUserId()); ControlloPratica controllo = null; try { List controlli = ControlloPraticaLocalServiceUtil - .findByIntPraticaId_Status( - pratica.getIntPraticaId(), + .findByIntPraticaId_Status(pratica.getIntPraticaId(), WorkflowConstants.STATUS_PENDING); controllo = controlli.get(controlli.size() - 1); } catch (Exception e1) { try { - controllo = ControlloPraticaLocalServiceUtil - .addControlloPratica( - dettPratica.getGroupId(), - dettPratica.getUserId(), - pratica.getIntPraticaId(), - dettPratica.getDettPraticaId(), - false, serviceContext); + controllo = ControlloPraticaLocalServiceUtil.addControlloPratica( + dettPratica.getGroupId(), dettPratica.getUserId(), + pratica.getIntPraticaId(), dettPratica.getDettPraticaId(), false, + serviceContext); } catch (PortalException | SystemException e2) { esito.add("Errore durante la creazione di un controllo pratica per progetto " - + pratica.getNumeroProgetto() - + ": " - + e2.getMessage()); + + pratica.getNumeroProgetto() + ": " + e2.getMessage()); } } controllo.setStatus(WorkflowConstants.STATUS_APPROVED); - AvvisoLocalServiceUtil.addAvviso( - pratica.getIntPraticaId(), - "Attestazione di deposito progetto", - new Date(), AvvisoUtil.TIPO_AVVISO_DIRETTO, - StatoPraticaConstants.CONFORME, - fileEntryIdTemplate, - dettPratica.getDettPraticaId(), - DettPratica.class.getName(), - controllo.getControlloPraticaId(), + AvvisoLocalServiceUtil.addAvviso(pratica.getIntPraticaId(), + "Attestazione di deposito progetto", new Date(), + AvvisoUtil.TIPO_AVVISO_DIRETTO, StatoPraticaConstants.CONFORME, + fileEntryIdTemplate, dettPratica.getDettPraticaId(), + DettPratica.class.getName(), controllo.getControlloPraticaId(), serviceContext); pratica.setStatoPratica(StatoPraticaConstants.CONFORME); IntPraticaLocalServiceUtil.updateIntPratica(pratica); @@ -621,8 +739,7 @@ public class SismicaUtil { int start = 0; do { try { - pratiche = IntPraticaLocalServiceUtil.getIntPraticas(start, - start + SLICE); + pratiche = IntPraticaLocalServiceUtil.getIntPraticas(start, start + SLICE); } catch (SystemException e) { esito.add("Errore caricamento intPratiche: " + e.getMessage()); } @@ -630,85 +747,63 @@ public class SismicaUtil { List avvisi = null; for (IntPratica pratica : pratiche) { String stato = pratica.getStatoPratica(); - if (Validator.isNotNull(stato) - && Validator.isNotNull(pratica.getTipoProcedura()) - && pratica.getTipoPratica().equalsIgnoreCase( - Constants.TIPO_PRATICA_DEPOSITO)) { + if (Validator.isNotNull(stato) && Validator.isNotNull(pratica.getTipoProcedura()) + && pratica.getTipoPratica().equalsIgnoreCase(Constants.TIPO_PRATICA_DEPOSITO)) { try { - avvisi = AvvisoLocalServiceUtil - .findByIntPraticaId_tipoDocumento( - pratica.getIntPraticaId(), - StatoPraticaConstants.CONFORME); + avvisi = AvvisoLocalServiceUtil.findByIntPraticaId_tipoDocumento( + pratica.getIntPraticaId(), StatoPraticaConstants.CONFORME); } catch (SystemException e) { - esito.add("Errore caricamento avvisi: " - + e.getMessage()); + esito.add("Errore caricamento avvisi: " + e.getMessage()); } List totali = null; try { - totali = AvvisoLocalServiceUtil.findByIntPratica( - pratica.getIntPraticaId(), QueryUtil.ALL_POS, - QueryUtil.ALL_POS, null); + totali = AvvisoLocalServiceUtil.findByIntPratica(pratica.getIntPraticaId(), + QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); } catch (SystemException e) { totali = new ArrayList<>(); } - if ((avvisi.size() == 0) - && stato.equalsIgnoreCase(StatoPraticaConstants.VIDIMATA)) { + if ((avvisi.size() == 0) && stato.equalsIgnoreCase(StatoPraticaConstants.VIDIMATA)) { List controlli = null; try { - controlli = ControlloPraticaLocalServiceUtil - .findByIntPratica(pratica.getIntPraticaId()); + controlli = ControlloPraticaLocalServiceUtil.findByIntPratica(pratica + .getIntPraticaId()); } catch (SystemException e) { controlli = new ArrayList<>(); } - if (pratica.getStatoPratica().equals( - StatoPraticaConstants.VIDIMATA) + if (pratica.getStatoPratica().equals(StatoPraticaConstants.VIDIMATA) && (controlli.size() == 0)) { - esito.add("Progetto: " - + pratica.getNumeroProgetto() + " (" - + pratica.getIntPraticaId() - + "), procedura=" - + pratica.getTipoProcedura() + ", avvisi=" - + totali.size() + ", stato=" - + pratica.getStatoPratica() - + ", controlli=" + controlli.size()); + esito.add("Progetto: " + pratica.getNumeroProgetto() + " (" + + pratica.getIntPraticaId() + "), procedura=" + + pratica.getTipoProcedura() + ", avvisi=" + totali.size() + ", stato=" + + pratica.getStatoPratica() + ", controlli=" + controlli.size()); DettPratica dettPratica; try { dettPratica = DettPraticaLocalServiceUtil - .getLastCompletedByIntPratica(pratica - .getIntPraticaId()); + .getLastCompletedByIntPratica(pratica.getIntPraticaId()); } catch (SystemException e) { dettPratica = null; } if (Validator.isNotNull(dettPratica)) { ServiceContext serviceContext = new ServiceContext(); - serviceContext.setCompanyId(dettPratica - .getCompanyId()); - serviceContext.setScopeGroupId(dettPratica - .getGroupId()); - serviceContext.setUserId(dettPratica - .getUserId()); + serviceContext.setCompanyId(dettPratica.getCompanyId()); + serviceContext.setScopeGroupId(dettPratica.getGroupId()); + serviceContext.setUserId(dettPratica.getUserId()); ControlloPratica controllo; try { - controllo = ControlloPraticaLocalServiceUtil - .addControlloPratica( - dettPratica.getGroupId(), - dettPratica.getUserId(), - pratica.getIntPraticaId(), - dettPratica - .getDettPraticaId(), - false, serviceContext); + controllo = ControlloPraticaLocalServiceUtil.addControlloPratica( + dettPratica.getGroupId(), dettPratica.getUserId(), + pratica.getIntPraticaId(), dettPratica.getDettPraticaId(), false, + serviceContext); } catch (PortalException | SystemException e) { controllo = null; } if (Validator.isNotNull(controllo)) { - controllo - .setStatus(WorkflowConstants.STATUS_APPROVED); + controllo.setStatus(WorkflowConstants.STATUS_APPROVED); try { - ControlloPraticaLocalServiceUtil - .updateControlloPratica(controllo); + ControlloPraticaLocalServiceUtil.updateControlloPratica(controllo); } catch (SystemException e) { } @@ -721,48 +816,32 @@ public class SismicaUtil { fileEntryIdTemplate = 0; } - if (Validator - .isNotNull(fileEntryIdTemplate)) { + if (Validator.isNotNull(fileEntryIdTemplate)) { try { - if (!pratica - .getTipoProcedura() - .equalsIgnoreCase( - Constants.PROCEDURA_C)) { - AvvisoLocalServiceUtil - .addAvviso( - pratica.getIntPraticaId(), - "Attestazione di deposito progetto", - new Date(), - AvvisoUtil.TIPO_AVVISO_DIRETTO, - StatoPraticaConstants.CONFORME, - fileEntryIdTemplate, - dettPratica - .getDettPraticaId(), - DettPratica.class - .getName(), - controllo - .getControlloPraticaId(), - serviceContext); + if (!pratica.getTipoProcedura().equalsIgnoreCase( + Constants.PROCEDURA_C)) { + AvvisoLocalServiceUtil.addAvviso(pratica.getIntPraticaId(), + "Attestazione di deposito progetto", new Date(), + AvvisoUtil.TIPO_AVVISO_DIRETTO, + StatoPraticaConstants.CONFORME, fileEntryIdTemplate, + dettPratica.getDettPraticaId(), + DettPratica.class.getName(), + controllo.getControlloPraticaId(), serviceContext); } pratica.setStatoPratica(StatoPraticaConstants.CONFORME); - IntPraticaLocalServiceUtil - .updateIntPratica(pratica); - } catch (PortalException - | SystemException e) { + IntPraticaLocalServiceUtil.updateIntPratica(pratica); + } catch (PortalException | SystemException e) { } } } } } - } else if ((totali.size() == 2) - && (avvisi.size() > 0) + } else if ((totali.size() == 2) && (avvisi.size() > 0) && stato.equalsIgnoreCase(StatoPraticaConstants.SOTTOPOSTA_A_PARERE)) { - esito.add("Rendo conforme: " - + pratica.getNumeroProgetto()); + esito.add("Rendo conforme: " + pratica.getNumeroProgetto()); pratica.setStatoPratica(StatoPraticaConstants.CONFORME); try { - IntPraticaLocalServiceUtil - .updateIntPratica(pratica); + IntPraticaLocalServiceUtil.updateIntPratica(pratica); } catch (SystemException e) { } } @@ -780,11 +859,10 @@ public class SismicaUtil { List tasks = null; do { try { - tasks = WorkflowTaskManagerUtil.getWorkflowTasks(companyId, - false, start, start + SLICE, null); + tasks = WorkflowTaskManagerUtil + .getWorkflowTasks(companyId, false, start, start + SLICE, null); } catch (WorkflowException e) { - esito.add("Errore durante il recupero dei task: " - + e.getMessage()); + esito.add("Errore durante il recupero dei task: " + e.getMessage()); tasks = new ArrayList<>(); } start += SLICE; @@ -795,27 +873,19 @@ public class SismicaUtil { return esito; } - private static List checkWorkflow(long companyId, - WorkflowTask workflowTask) { + private static List checkWorkflow(long companyId, WorkflowTask workflowTask) { List esito = new ArrayList<>(); try { - WorkflowInstance workflowInstance = WorkflowInstanceManagerUtil - .getWorkflowInstance(companyId, - workflowTask.getWorkflowInstanceId()); - Map workflowContext = workflowInstance - .getWorkflowContext(); - String className = (String) workflowContext - .get(WorkflowConstants.CONTEXT_ENTRY_CLASS_NAME); + WorkflowInstance workflowInstance = WorkflowInstanceManagerUtil.getWorkflowInstance(companyId, + workflowTask.getWorkflowInstanceId()); + Map workflowContext = workflowInstance.getWorkflowContext(); + String className = (String) workflowContext.get(WorkflowConstants.CONTEXT_ENTRY_CLASS_NAME); if (Validator.isNull(className)) { - esito.add("WorkflowInstance " - + workflowInstance.getWorkflowInstanceId() - + ", WorkflowTask " + workflowTask.getWorkflowTaskId() - + " non ha la classe"); - Map attributes = workflowTask - .getOptionalAttributes(); - String taskClass = (String) attributes - .get(WorkflowConstants.CONTEXT_ENTRY_CLASS_NAME); + esito.add("WorkflowInstance " + workflowInstance.getWorkflowInstanceId() + ", WorkflowTask " + + workflowTask.getWorkflowTaskId() + " non ha la classe"); + Map attributes = workflowTask.getOptionalAttributes(); + String taskClass = (String) attributes.get(WorkflowConstants.CONTEXT_ENTRY_CLASS_NAME); if (taskClass.equals(ControlloPratica.class.getName())) { long classPK = GetterUtil.getLong((String) attributes .get(WorkflowConstants.CONTEXT_ENTRY_CLASS_PK)); @@ -823,36 +893,29 @@ public class SismicaUtil { ControlloPratica controllo = ControlloPraticaLocalServiceUtil .getControlloPratica(classPK); try { - IntPratica pratica = IntPraticaLocalServiceUtil - .getIntPratica(controllo.getIntPraticaId()); - esito.add("La pratica numero " - + pratica.getNumeroProgetto() + IntPratica pratica = IntPraticaLocalServiceUtil.getIntPratica(controllo + .getIntPraticaId()); + esito.add("La pratica numero " + pratica.getNumeroProgetto() + " non è lavorabile"); try { - WorkflowInstanceManagerUtil - .updateWorkflowContext( - companyId, - workflowInstance - .getWorkflowInstanceId(), - attributes); + WorkflowInstanceManagerUtil.updateWorkflowContext(companyId, + workflowInstance.getWorkflowInstanceId(), attributes); esito.add("> Riparazione riuscita"); } catch (WorkflowException e) { esito.add("> Errore durante riparazione."); } } catch (PortalException | SystemException e) { - esito.add("Errore di caricamento IntPratica " - + controllo.getIntPraticaId() + " (" - + e.getMessage() + ")"); + esito.add("Errore di caricamento IntPratica " + controllo.getIntPraticaId() + + " (" + e.getMessage() + ")"); } } catch (PortalException | SystemException e) { - esito.add("Errore di caricamento ControlloPratica " - + classPK + " (" + e.getMessage() + ")"); + esito.add("Errore di caricamento ControlloPratica " + classPK + " (" + e.getMessage() + + ")"); } } } } catch (WorkflowException e) { - esito.add("WorkflowInstance non caricato: " - + workflowTask.getWorkflowInstanceId() + " (" + esito.add("WorkflowInstance non caricato: " + workflowTask.getWorkflowInstanceId() + " (" + e.getMessage() + ")"); } return esito; @@ -865,10 +928,8 @@ public class SismicaUtil { List tokens = new ArrayList<>(); try { for (KaleoTaskInstanceToken token : KaleoTaskInstanceTokenLocalServiceUtil - .getKaleoTaskInstanceTokens(QueryUtil.ALL_POS, - QueryUtil.ALL_POS)) { - if (token.getClassName().equals( - ControlloPratica.class.getName())) + .getKaleoTaskInstanceTokens(QueryUtil.ALL_POS, QueryUtil.ALL_POS)) { + if (token.getClassName().equals(ControlloPratica.class.getName())) tokens.add(token.getClassPK()); } } catch (SystemException e) { @@ -878,21 +939,19 @@ public class SismicaUtil { List pratiche = null; do { try { - pratiche = IntPraticaLocalServiceUtil.getIntPraticas(start, - start + SLICE); + pratiche = IntPraticaLocalServiceUtil.getIntPraticas(start, start + SLICE); } catch (SystemException e) { pratiche = new ArrayList<>(); } start += SLICE; for (IntPratica pratica : pratiche) { if (Validator.isNotNull(pratica.getNumeroProgetto()) - && pratica.getStatoPratica().equals( - StatoPraticaConstants.SOTTOPOSTA_A_PARERE) + && pratica.getStatoPratica().equals(StatoPraticaConstants.SOTTOPOSTA_A_PARERE) && (pratica.getStatus() == WorkflowConstants.STATUS_PENDING)) { List controlli = null; try { - controlli = ControlloPraticaLocalServiceUtil - .findByIntPratica(pratica.getIntPraticaId()); + controlli = ControlloPraticaLocalServiceUtil.findByIntPratica(pratica + .getIntPraticaId()); } catch (SystemException e) { controlli = new ArrayList<>(); } @@ -911,15 +970,12 @@ public class SismicaUtil { Map workflowContext = new HashMap(); - esito.add("id: " + pratica.getIntPraticaId() - + ", numero: " + pratica.getNumeroProgetto()); + esito.add("id: " + pratica.getIntPraticaId() + ", numero: " + + pratica.getNumeroProgetto()); try { - WorkflowHandlerRegistryUtil.startWorkflowInstance( - last.getCompanyId(), last.getGroupId(), - last.getUserId(), - ControlloPratica.class.getName(), - last.getPrimaryKey(), last, serviceContext, - workflowContext); + WorkflowHandlerRegistryUtil.startWorkflowInstance(last.getCompanyId(), + last.getGroupId(), last.getUserId(), ControlloPratica.class.getName(), + last.getPrimaryKey(), last, serviceContext, workflowContext); } catch (PortalException | SystemException e) { esito.add("Errore " + e.getMessage()); } @@ -931,75 +987,12 @@ public class SismicaUtil { return esito; } - public static List testInterno(ServiceContext serviceContext) - throws PortalException, SystemException { - List esito = new ArrayList<>(); - long intPraticaId = 124101; - String descLong = "Richiesta di integrazione"; - Date dtAvviso = new Date(); - String tipoAvviso = AvvisoUtil.TIPO_AVVISO_DIRETTO; - String tipoDocumento = StatoPraticaConstants.INTEGRAZIONE; - long fileEntryIdTemplate = ConfigurazioneLocalServiceUtil - .findByC_ChiaveLong(serviceContext.getCompanyId(), - "conf.geniocivile.avviso.template.id.integrazione"); - long classPk = DettPraticaLocalServiceUtil - .getLastCompletedByIntPratica(intPraticaId).getPrimaryKey(); - String className = DettPratica.class.getName(); - String userCodiceFiscalePrimaFirma = StringPool.BLANK; - Map parameters = new HashMap<>(); - parameters - .put("testo_del_documento", - "Dall'esame del progetto per i lavori di riparazione o intervento locale (8.4.1 D.M. " - + "17/01/2018) dei danni causati dal sisma del 6 ottobre 2018 nella Chiesa Madre " - + "di Maria SS. Assunta,piazza Umberto n. 62,Comune di Adrano,è emerso che lo " - + "stesso è carente e pertanto necessita di integrazioni. Più precisamente,si è " - + "riscontrato che:\r\n1)\tManca la copia del documento di riconoscimento di " - + "tutti i soggetti interessati al progetto;\r\n2)\tManca la dichiarazione del " - + "Tecnico Progettista - Direttore dei Lavori (Legge 64/74 art. 17),scaricabile " - + "dal sito del Genio Civile – Catania;\r\n3)\tNella Tav. 2 “Rilievo – Piante – " - + "Localizzazione dei danni e delle criticità”: \r\nZONA D – Cartiglio " - + "nell’arco trionfale: non risulta verificato il permanere delle condizioni di " - + "stabilità del cartiglio in stucco e la solidità degli agganci con la " - + "muratura portante; \r\nZONA G – Aree esterna: non risulta verificata la " - + "stabilità di alcune porzioni del prospetto,in particolare di alcune sfere " - + "lapidee poste in cima a delle cuspidi,nonché degli elementi di laterizio " - + "costituenti la parte sommitale delle cornici della fabbrica incompleta del " - + "campanile di Sada;\r\n4)\t Nella Tav. A.1 “Relazione tecnica” non è definito " - + "il Livello di Conoscenza raggiunto (C.8.5.4 Circolare 21 gennaio 2019 n. 7); " - + "Per la modifica di aperture,accompagnata da opportuni rinforzi,deve " - + "dimostrarsi che l’insieme degli interventi non modifichino significativamente " - + "rigidezza,resistenza nei confronti delle azioni orizzontali e capacità di " - + "deformazione della struttura. Inoltre nel caso di rafforzamento locale " - + "finalizzato al miglioramento del funzionamento di elementi strutturali o alla " - + "limitazione di meccanismi di collasso,è richiesta la valutazione della " - + "variazione del livello locale di sicurezza (C8.4.1. Circolare 21 gennaio 2019 " - + "n. 7);\r\n5)\tNon esiste una Scheda Tecnica,con chiara identificazione " - + "prestazionale e di qualificazione (C11 Circolare 21 gennaio 2019 n. 7); della " - + "fibra in carbonio e dei materiali da utilizzare per i rinforzi;\r\n" - + "6)\tOccorre ritrasmettere,tramite il portale “PORTOS” tutti gli elaborati di " - + "progetto,avendo cura di apporre digitalmente,in ogni singolo allegato,la " - + "firma da parte dei tecnici interessati alla progettazione.\r\nIl Funzionario " - + "direttivo\t\t\t\t\t\tIl Dirigente Capo U.O.7\r\nArch. Pianif. Rosario Di " - + "Mauro\t\t\t\tArch. Giovanni Patti\r\nFirmata digitalmente\t\t\t\t\t\tFirmata " - + "digitalmente"); - JSONSerializer jsonSerializer = new JSONSerializer(); - String jsonParameters = jsonSerializer.serialize(parameters); - long controlloPraticaId = 0; - - AvvisoLocalServiceUtil.addAvviso(intPraticaId, descLong, dtAvviso, - tipoAvviso, tipoDocumento, fileEntryIdTemplate, classPk, - className, userCodiceFiscalePrimaFirma, jsonParameters, - controlloPraticaId, serviceContext); - return esito; - } - private static Map templateByKey; private static Map templateById; private static Map templateIdByKey; private static final Date inizio = stringToDate("2019-12-31"); - private static List riparaDocumenti(long companyId) - throws SystemException, PortalException { + private static List riparaDocumenti(long companyId) throws SystemException, PortalException { List esito = new ArrayList(); esito.add("Riparazione generazione documenti"); @@ -1008,8 +1001,7 @@ public class SismicaUtil { int index = 0; do { try { - intPratiche = IntPraticaLocalServiceUtil.getIntPraticas(index, - index + SLICE); + intPratiche = IntPraticaLocalServiceUtil.getIntPraticas(index, index + SLICE); } catch (SystemException e) { esito.add("Errore caricamento intPratiche: " + e.getMessage()); } @@ -1021,19 +1013,16 @@ public class SismicaUtil { return esito; } - private static void initTemplate(long companyId) throws SystemException, - PortalException { + private static void initTemplate(long companyId) throws SystemException, PortalException { templateById = new LinkedHashMap<>(); templateByKey = new LinkedHashMap<>(); templateIdByKey = new LinkedHashMap<>(); - Map elenco = AvvisoUtil - .getAllTipoDocumentoFileTemplateProps(); + Map elenco = AvvisoUtil.getAllTipoDocumentoFileTemplateProps(); for (Entry template : elenco.entrySet()) { - long fileEntryId = ConfigurazioneLocalServiceUtil - .findByC_ChiaveLong(companyId, template.getValue()); + long fileEntryId = ConfigurazioneLocalServiceUtil.findByC_ChiaveLong(companyId, + template.getValue()); if (fileEntryId != 0) { - FileEntry fileEntry = DLAppServiceUtil - .getFileEntry(fileEntryId); + FileEntry fileEntry = DLAppServiceUtil.getFileEntry(fileEntryId); templateById.put(fileEntryId, fileEntry.getTitle()); templateByKey.put(template.getKey(), fileEntry.getTitle()); templateIdByKey.put(template.getKey(), fileEntryId); @@ -1044,14 +1033,12 @@ public class SismicaUtil { private static List verificaAvvisi(IntPratica intPratica) { List esito = new ArrayList(); if (Validator.isNotNull(intPratica.getStatoPratica()) - && !intPratica.getStatoPratica().equalsIgnoreCase( - StatoPraticaConstants.ANNULLATA)) { + && !intPratica.getStatoPratica().equalsIgnoreCase(StatoPraticaConstants.ANNULLATA)) { long intPraticaId = intPratica.getIntPraticaId(); List controlli = null; try { - controlli = ControlloPraticaLocalServiceUtil - .findByIntPratica(intPraticaId); + controlli = ControlloPraticaLocalServiceUtil.findByIntPratica(intPraticaId); } catch (SystemException e) { controlli = new ArrayList(); } @@ -1068,9 +1055,8 @@ public class SismicaUtil { serviceContext = new ServiceContext(); serviceContext.setCompanyId(intPratica.getCompanyId()); try { - serviceContext.setScopeGroupId(TerritorioLocalServiceUtil - .getTerritorio(intPratica.getTerritorioId()) - .getGroupId()); + serviceContext.setScopeGroupId(TerritorioLocalServiceUtil.getTerritorio( + intPratica.getTerritorioId()).getGroupId()); } catch (PortalException | SystemException e) { } serviceContext.setUserId(intPratica.getUserId()); @@ -1082,39 +1068,29 @@ public class SismicaUtil { Date ultimaData = null; for (Avviso avviso : avvisi) { - if ((ultimaData == null) - || avviso.getModifiedDate().after(ultimaData)) + if ((ultimaData == null) || avviso.getModifiedDate().after(ultimaData)) ultimaData = avviso.getModifiedDate(); if (!avviso.getAnnullato()) { - String template = templateById.get(avviso - .getFileEntryIdTemplate()); - if (avviso.getDtAvviso().after(inizio) - && !avviso.getAnnullato() - && (avviso.getInviato() - .equalsIgnoreCase(AvvisoUtil.DOCUMENTO_NON_INVIATO))) { + String template = templateById.get(avviso.getFileEntryIdTemplate()); + if (avviso.getDtAvviso().after(inizio) && !avviso.getAnnullato() + && (avviso.getInviato().equalsIgnoreCase(AvvisoUtil.DOCUMENTO_NON_INVIATO))) { avvisiFermi.add(avviso); if (template == null) - template = templateByKey.get(avviso - .getTipoDocumento()); - } else if (avviso.getInviato().equalsIgnoreCase( - AvvisoUtil.DOCUMENTO_INVIATO)) { + template = templateByKey.get(avviso.getTipoDocumento()); + } else if (avviso.getInviato().equalsIgnoreCase(AvvisoUtil.DOCUMENTO_INVIATO)) { avvisiInviati.add(template); } } } - if ((ultimaData != null) - && (new Date().getTime() - ultimaData.getTime() > 7200000)) { + if ((ultimaData != null) && (new Date().getTime() - ultimaData.getTime() > 7200000)) { for (Avviso avviso : avvisiFermi) { long templateId = avviso.getFileEntryIdTemplate(); String template = templateById.get(templateId); - if (Validator.isNull(template) - && templateByKey.containsKey(avviso - .getTipoDocumento())) { + if (Validator.isNull(template) && templateByKey.containsKey(avviso.getTipoDocumento())) { template = templateByKey.get(avviso.getTipoDocumento()); - templateId = templateIdByKey.get(avviso - .getTipoDocumento()); + templateId = templateIdByKey.get(avviso.getTipoDocumento()); } if (!avvisiInviati.contains(template)) { switch (avviso.getTipoDocumento()) { @@ -1124,45 +1100,32 @@ public class SismicaUtil { break; case StatoPraticaConstants.AUTORIZZATA: case StatoPraticaConstants.CONFORME: + case StatoPraticaConstants.SOTTOPOSTA_A_PARERE: case StatoPraticaConstants.VIDIMATA: - if (avviso.getTipoAvviso().equals( - AvvisoUtil.TIPO_AVVISO_DIRETTO)) { - esito.addAll(addStoricoAvvisi(intPratica, - avvisi)); - esito.add("Invio " + template + " (" - + controlli.size() + " controlli)"); + if (avviso.getTipoAvviso().equals(AvvisoUtil.TIPO_AVVISO_DIRETTO)) { + esito.addAll(addStoricoAvvisi(intPratica, avvisi)); + esito.add("Invio " + template + " (" + controlli.size() + " controlli)"); try { if (Validator.isNull(controllo)) { controllo = aggiungiControlloPratica(intPratica); - esito.add(intPratica - .getNumeroProgetto() + esito.add(intPratica.getNumeroProgetto() + " aggiunto ControlloPratica " - + controllo - .getControlloPraticaId()); + + controllo.getControlloPraticaId()); } - AvvisoLocalServiceUtil.addAvviso( - intPraticaId, "", - avviso.getDtAvviso(), - AvvisoUtil.TIPO_AVVISO_DIRETTO, - avviso.getTipoDocumento(), - templateId, - controllo.getDettPraticaId(), - DettPratica.class.getName(), - controllo.getControlloPraticaId(), + AvvisoLocalServiceUtil.addAvviso(intPraticaId, "", avviso.getDtAvviso(), + AvvisoUtil.TIPO_AVVISO_DIRETTO, avviso.getTipoDocumento(), + templateId, controllo.getDettPraticaId(), + DettPratica.class.getName(), controllo.getControlloPraticaId(), serviceContext); } catch (Exception e) { - esito.add("Errore durante l'invio: " - + e.getMessage()); + esito.add("Errore durante l'invio: " + e.getMessage()); } } break; default: - if (avviso.getTipoAvviso().equals( - AvvisoUtil.TIPO_AVVISO_DIRETTO)) { - esito.addAll(addStoricoAvvisi(intPratica, - avvisi)); - esito.add("Procederei all'invio di avviso " - + template); + if (avviso.getTipoAvviso().equals(AvvisoUtil.TIPO_AVVISO_DIRETTO)) { + esito.addAll(addStoricoAvvisi(intPratica, avvisi)); + esito.add("Procederei all'invio di avviso " + template); } break; } @@ -1173,30 +1136,31 @@ public class SismicaUtil { return esito; } - private static ControlloPratica aggiungiControlloPratica( - IntPratica intPratica) throws PortalException, SystemException { - DettPratica dettPratica = DettPraticaLocalServiceUtil - .getLastCompletedByIntPratica(intPratica.getIntPraticaId()); + private static ControlloPratica aggiungiControlloPratica(IntPratica intPratica) throws PortalException, + SystemException { + DettPratica dettPratica = DettPraticaLocalServiceUtil.getLastCompletedByIntPratica(intPratica + .getIntPraticaId()); ServiceContext serviceContext = new ServiceContext(); serviceContext.setCompanyId(dettPratica.getCompanyId()); serviceContext.setScopeGroupId(dettPratica.getGroupId()); serviceContext.setUserId(dettPratica.getUserId()); - ControlloPratica controllo = ControlloPraticaLocalServiceUtil - .addControlloPratica(intPratica.getGroupId(), - intPratica.getUserId(), intPratica.getIntPraticaId(), - dettPratica.getDettPraticaId(), false, serviceContext); + ControlloPratica controllo = ControlloPraticaLocalServiceUtil.addControlloPratica( + intPratica.getGroupId(), intPratica.getUserId(), intPratica.getIntPraticaId(), + dettPratica.getDettPraticaId(), false, serviceContext); return controllo; } private static List getAvvisiPratica(long intPraticaId) { List avvisi = null; try { - avvisi = AvvisoLocalServiceUtil.findByIntPratica(intPraticaId, - QueryUtil.ALL_POS, QueryUtil.ALL_POS, - OrderByComparatorFactoryUtil.getOrderByComparatorFactory() - .create("portos_bo_Avviso", "dtAvviso", true)); + avvisi = AvvisoLocalServiceUtil.findByIntPratica( + intPraticaId, + QueryUtil.ALL_POS, + QueryUtil.ALL_POS, + OrderByComparatorFactoryUtil.getOrderByComparatorFactory().create("portos_bo_Avviso", + "dtAvviso", true)); } catch (SystemException e) { _log.error("Errore recupero avvisi" + e.getMessage()); avvisi = new ArrayList(); @@ -1204,142 +1168,112 @@ public class SismicaUtil { return avvisi; } - private static List addStoricoAvvisi(IntPratica intPratica, - List avvisi) { + private static List addStoricoAvvisi(IntPratica intPratica, List avvisi) { List esito = new ArrayList(); String tipoPratica = LanguageUtil.get(LocaleUtil.ITALIAN, "tipo-pratica-" + intPratica.getTipoPratica()); - esito.add("* intPraticaId=" + intPratica.getIntPraticaId() - + ", numeroProgetto=" + intPratica.getNumeroProgetto() - + ", procedura=" + intPratica.getTipoProcedura() + ", stato=" - + intPratica.getStatoPratica() + ", tipo=" + tipoPratica - + ", data=" + dfmt.format(intPratica.getCreateDate()) - + ", modificata=" + dfmt.format(intPratica.getModifiedDate())); + esito.add("* intPraticaId=" + intPratica.getIntPraticaId() + ", numeroProgetto=" + + intPratica.getNumeroProgetto() + ", procedura=" + intPratica.getTipoProcedura() + + ", stato=" + intPratica.getStatoPratica() + ", tipo=" + tipoPratica + ", data=" + + dfmt.format(intPratica.getCreateDate()) + ", modificata=" + + dfmt.format(intPratica.getModifiedDate())); for (Avviso avviso : avvisi) { String template = templateById.get(avviso.getFileEntryIdTemplate()); if (template == null) template = templateByKey.get(avviso.getTipoDocumento()); ; - boolean inviato = avviso.getInviato().equalsIgnoreCase( - AvvisoUtil.DOCUMENTO_INVIATO); - esito.add(dfmt.format(avviso.getDtAvviso()) - + " Avviso " - + template - + (inviato ? "inviato " + dfmt.format(avviso.getDtInvio()) - : "non inviato") + " - tipo avviso " - + avviso.getTipoAvviso() + " - tipo documento " + boolean inviato = avviso.getInviato().equalsIgnoreCase(AvvisoUtil.DOCUMENTO_INVIATO); + esito.add(dfmt.format(avviso.getDtAvviso()) + " Avviso " + template + " " + + (inviato ? "inviato " + dfmt.format(avviso.getDtInvio()) : "non inviato") + + " - tipo avviso " + avviso.getTipoAvviso() + " - tipo documento " + avviso.getTipoDocumento()); } return esito; } - public static List resetFirme(long companyId, String numeroProgetto) - throws SystemException, PortalException { + public static List resetFirme(long companyId, String numeroProgetto) throws SystemException, + PortalException { List esito = new ArrayList<>(); if (Validator.isNull(numeroProgetto)) { esito.addAll(firmeBloccate(companyId)); } else { - IntPratica pratica = IntPraticaLocalServiceUtil - .findByNumeroProgetto(numeroProgetto); - ControlloPratica controllo = getLastControlloPratica(pratica - .getIntPraticaId()); - KaleoInstanceToken instanceToken = findInstanceToken(controllo - .getControlloPraticaId()); + IntPratica pratica = IntPraticaLocalServiceUtil.findByNumeroProgetto(numeroProgetto); + ControlloPratica controllo = getLastControlloPratica(pratica.getIntPraticaId()); + KaleoInstanceToken instanceToken = findInstanceToken(controllo.getControlloPraticaId()); if (Validator.isNotNull(instanceToken)) { - esito.add("Trovato KaleoInstanceToken " - + instanceToken.getKaleoInstanceTokenId() - + ", currentKaleoNodeName = \"" - + instanceToken.getCurrentKaleoNodeName() + "\""); - if (instanceToken.getCurrentKaleoNodeName().equalsIgnoreCase( - "signal_ff")) { + esito.add("Trovato KaleoInstanceToken " + instanceToken.getKaleoInstanceTokenId() + + ", currentKaleoNodeName = \"" + instanceToken.getCurrentKaleoNodeName() + "\""); + if (instanceToken.getCurrentKaleoNodeName().equalsIgnoreCase("signal_ff")) { List taskInstanceTokens = findTaskInstanceTokens(instanceToken .getKaleoInstanceTokenId()); - esito.add("Trovati " + taskInstanceTokens.size() - + " KaleoTaskInstanceToken"); + esito.add("Trovati " + taskInstanceTokens.size() + " KaleoTaskInstanceToken"); List taskAssignmentInstances = findTaskAssignmentInstances(instanceToken .getKaleoInstanceId()); - esito.add("Trovati " + taskAssignmentInstances.size() - + " KaleoTaskAssignmentInstance"); + esito.add("Trovati " + taskAssignmentInstances.size() + " KaleoTaskAssignmentInstance"); - KaleoTaskInstanceToken taskInstanceToken = taskInstanceTokens - .get(taskInstanceTokens.size() - 1); + KaleoTaskInstanceToken taskInstanceToken = taskInstanceTokens.get(taskInstanceTokens + .size() - 1); KaleoTaskAssignmentInstance taskAssignmentInstance = taskAssignmentInstances .get(taskAssignmentInstances.size() - 1); esito.add("Cancello KaleoTaskInstanceToken " + taskInstanceToken.getKaleoTaskInstanceTokenId()); - KaleoTaskInstanceTokenLocalServiceUtil - .deleteKaleoTaskInstanceToken(taskInstanceToken); + KaleoTaskInstanceTokenLocalServiceUtil.deleteKaleoTaskInstanceToken(taskInstanceToken); esito.add("Cancello KaleoTaskAssignmentInstance " - + taskAssignmentInstance - .getKaleoTaskAssignmentInstanceId()); + + taskAssignmentInstance.getKaleoTaskAssignmentInstanceId()); KaleoTaskAssignmentInstanceLocalServiceUtil .deleteKaleoTaskAssignmentInstance(taskAssignmentInstance); - taskInstanceToken = taskInstanceTokens - .get(taskInstanceTokens.size() - 2); + taskInstanceToken = taskInstanceTokens.get(taskInstanceTokens.size() - 2); esito.add("Aggiorno KaleoTaskInstanceToken " + taskInstanceToken.getKaleoTaskInstanceTokenId()); taskInstanceToken.setCompleted(false); taskInstanceToken.setCompletionUserId(0); taskInstanceToken.setCompletionDate(null); - KaleoTaskInstanceTokenLocalServiceUtil - .updateKaleoTaskInstanceToken(taskInstanceToken); + KaleoTaskInstanceTokenLocalServiceUtil.updateKaleoTaskInstanceToken(taskInstanceToken); - esito.add("Aggiorno KaleoInstanceToken " - + instanceToken.getKaleoInstanceTokenId()); + esito.add("Aggiorno KaleoInstanceToken " + instanceToken.getKaleoInstanceTokenId()); instanceToken.setCurrentKaleoNodeId(21639); instanceToken.setCurrentKaleoNodeName("Esito"); - KaleoInstanceTokenLocalServiceUtil - .updateKaleoInstanceToken(instanceToken); + KaleoInstanceTokenLocalServiceUtil.updateKaleoInstanceToken(instanceToken); } } } return esito; } - private static List firmeBloccate(long companyId) - throws SystemException, PortalException { + private static List firmeBloccate(long companyId) throws SystemException, PortalException { List esito = new ArrayList<>(); int start = 0; int totali = 0; List instanceTokens = null; do { - instanceTokens = KaleoInstanceTokenLocalServiceUtil - .getKaleoInstanceTokens(start, start + SLICE); + instanceTokens = KaleoInstanceTokenLocalServiceUtil.getKaleoInstanceTokens(start, start + SLICE); for (KaleoInstanceToken instanceToken : instanceTokens) { if (!instanceToken.getCompleted() - && instanceToken - .getCurrentKaleoNodeName() - .equalsIgnoreCase( - WorkflowConstants.WORKFLOW_SIGNAL_INVIO)) { - if (ControlloPratica.class.getName().equals( - instanceToken.getClassName())) { + && instanceToken.getCurrentKaleoNodeName().equalsIgnoreCase( + WorkflowConstants.WORKFLOW_SIGNAL_INVIO)) { + if (ControlloPratica.class.getName().equals(instanceToken.getClassName())) { ControlloPratica controllo = ControlloPraticaLocalServiceUtil .getControlloPratica(instanceToken.getClassPK()); boolean firmaInviata = false; - for (Avviso avviso : AvvisoLocalServiceUtil - .findByIntPratica(controllo.getIntPraticaId(), - QueryUtil.ALL_POS, QueryUtil.ALL_POS, - null)) { - if (avviso.getInviato().equalsIgnoreCase( - AvvisoUtil.DOCUMENTO_NON_INVIATO) - && avviso.getTipoAvviso().equalsIgnoreCase( - AvvisoUtil.TIPO_AVVISO_FIRMA) + for (Avviso avviso : AvvisoLocalServiceUtil.findByIntPratica( + controllo.getIntPraticaId(), QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) { + if (avviso.getInviato().equalsIgnoreCase(AvvisoUtil.DOCUMENTO_NON_INVIATO) + && avviso.getTipoAvviso().equalsIgnoreCase(AvvisoUtil.TIPO_AVVISO_FIRMA) && !avviso.getRifiutato()) { firmaInviata = true; } } - IntPratica pratica = IntPraticaLocalServiceUtil - .getIntPratica(controllo.getIntPraticaId()); + IntPratica pratica = IntPraticaLocalServiceUtil.getIntPratica(controllo + .getIntPraticaId()); if (!firmaInviata) { - esito.add(" fermo " + pratica.getNumeroProgetto() - + " (" + pratica.getIntPraticaId() + ")"); + esito.add(" fermo " + pratica.getNumeroProgetto() + " (" + + pratica.getIntPraticaId() + ")"); } } else { - esito.add("Classe non gestita " - + instanceToken.getClassName() + ", id " + esito.add("Classe non gestita " + instanceToken.getClassName() + ", id " + instanceToken.getKaleoInstanceTokenId()); } } @@ -1353,43 +1287,36 @@ public class SismicaUtil { return esito; } - private static KaleoInstanceToken findInstanceToken(long controlloPraticaId) - throws SystemException { - for (KaleoInstanceToken instanceToken : KaleoInstanceTokenLocalServiceUtil - .getKaleoInstanceTokens(QueryUtil.ALL_POS, QueryUtil.ALL_POS)) { + private static KaleoInstanceToken findInstanceToken(long controlloPraticaId) throws SystemException { + for (KaleoInstanceToken instanceToken : KaleoInstanceTokenLocalServiceUtil.getKaleoInstanceTokens( + QueryUtil.ALL_POS, QueryUtil.ALL_POS)) { if ((instanceToken.getClassPK() == controlloPraticaId) - && instanceToken.getClassName().equals( - ControlloPratica.class.getName())) { + && instanceToken.getClassName().equals(ControlloPratica.class.getName())) { return instanceToken; } } return null; } - private static List findTaskInstanceTokens( - long instanceTokenId) throws SystemException { + private static List findTaskInstanceTokens(long instanceTokenId) + throws SystemException { Map sorted = new TreeMap<>(); for (KaleoTaskInstanceToken taskInstanceToken : KaleoTaskInstanceTokenLocalServiceUtil - .getKaleoTaskInstanceTokens(QueryUtil.ALL_POS, - QueryUtil.ALL_POS)) { + .getKaleoTaskInstanceTokens(QueryUtil.ALL_POS, QueryUtil.ALL_POS)) { if (taskInstanceToken.getKaleoInstanceTokenId() == instanceTokenId) { - sorted.put(taskInstanceToken.getKaleoTaskInstanceTokenId(), - taskInstanceToken); + sorted.put(taskInstanceToken.getKaleoTaskInstanceTokenId(), taskInstanceToken); } } return new ArrayList<>(sorted.values()); } - private static List findTaskAssignmentInstances( - long instanceId) throws SystemException { + private static List findTaskAssignmentInstances(long instanceId) + throws SystemException { Map sorted = new TreeMap<>(); for (KaleoTaskAssignmentInstance taskAssignmentInstance : KaleoTaskAssignmentInstanceLocalServiceUtil - .getKaleoTaskAssignmentInstances(QueryUtil.ALL_POS, - QueryUtil.ALL_POS)) { + .getKaleoTaskAssignmentInstances(QueryUtil.ALL_POS, QueryUtil.ALL_POS)) { if (taskAssignmentInstance.getKaleoInstanceId() == instanceId) { - sorted.put(taskAssignmentInstance - .getKaleoTaskAssignmentInstanceId(), - taskAssignmentInstance); + sorted.put(taskAssignmentInstance.getKaleoTaskAssignmentInstanceId(), taskAssignmentInstance); } } return new ArrayList<>(sorted.values()); @@ -1400,16 +1327,14 @@ public class SismicaUtil { private static ResourceAction raFileEntry; private static ResourceAction raFolder; - public static List generaDocumenti(long companyId) - throws PortalException, SystemException { + public static List generaDocumenti(long companyId) throws PortalException, SystemException { List esito = new ArrayList<>(); orgPc = new HashMap<>(); - for (Organization org : OrganizationLocalServiceUtil.getOrganizations( - QueryUtil.ALL_POS, QueryUtil.ALL_POS)) { + for (Organization org : OrganizationLocalServiceUtil.getOrganizations(QueryUtil.ALL_POS, + QueryUtil.ALL_POS)) { if (0 == org.getSuborganizationsSize()) { - List users = UserLocalServiceUtil - .getOrganizationUsers(org.getOrganizationId()); + List users = UserLocalServiceUtil.getOrganizationUsers(org.getOrganizationId()); User user = users.get(users.size() * 2 / 3); PermissionChecker pc = null; try { @@ -1421,12 +1346,11 @@ public class SismicaUtil { } } - userRoleId = RoleLocalServiceUtil - .getRole(companyId, RoleConstants.USER).getRoleId(); - raFileEntry = ResourceActionLocalServiceUtil.getResourceAction( - DLFileEntry.class.getName(), ActionKeys.VIEW); - raFolder = ResourceActionLocalServiceUtil.getResourceAction( - DLFolder.class.getName(), ActionKeys.VIEW); + userRoleId = RoleLocalServiceUtil.getRole(companyId, RoleConstants.USER).getRoleId(); + raFileEntry = ResourceActionLocalServiceUtil.getResourceAction(DLFileEntry.class.getName(), + ActionKeys.VIEW); + raFolder = ResourceActionLocalServiceUtil + .getResourceAction(DLFolder.class.getName(), ActionKeys.VIEW); esito.addAll(riparaPermessiAllegatiManuali(companyId)); esito.addAll(riparaPermessiAsseverazioni(companyId)); @@ -1438,8 +1362,8 @@ public class SismicaUtil { return esito; } - public static List riparaPermessiAllegatiManuali(long companyId) - throws SystemException, PortalException { + public static List riparaPermessiAllegatiManuali(long companyId) throws SystemException, + PortalException { List esito = new ArrayList<>(); int inizio = 0; @@ -1448,37 +1372,28 @@ public class SismicaUtil { List documenti = null; String tipoDocumento = null; do { - documenti = AllegatoManualeLocalServiceUtil.getAllegatoManuales( - inizio, inizio + SLICE); + documenti = AllegatoManualeLocalServiceUtil.getAllegatoManuales(inizio, inizio + SLICE); for (AllegatoManuale documento : documenti) { if (Validator.isNull(tipoDocumento)) { tipoDocumento = documento.getClass().getSimpleName(); } IntPratica pratica = null; try { - pratica = IntPraticaLocalServiceUtil - .getIntPratica(documento.getIntPraticaId()); + pratica = IntPraticaLocalServiceUtil.getIntPratica(documento.getIntPraticaId()); } catch (PortalException e) { } - if (Validator.isNotNull(pratica) - && (documento.getFileEntryId() != 0)) { - Territorio territorio = TerritorioLocalServiceUtil - .getTerritorio(pratica.getTerritorioId()); + if (Validator.isNotNull(pratica) && (documento.getFileEntryId() != 0)) { + Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(pratica + .getTerritorioId()); FileEntry fileEntry = null; try { - fileEntry = DLAppServiceUtil.getFileEntry(documento - .getFileEntryId()); + fileEntry = DLAppServiceUtil.getFileEntry(documento.getFileEntryId()); } catch (Exception e) { // _log.info(e.getClass() + ": " + e.getMessage()); } - corretti += riparaPermessiFileEntry( - companyId, - territorio.getGroupId(), - fileEntry, - "Pratica " + pratica.getNumeroProgetto() + " (" - + pratica.getIntPraticaId() + "), " - + tipoDocumento + " " - + documento.getPrimaryKey()); + corretti += riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry, + "Pratica " + pratica.getNumeroProgetto() + " (" + pratica.getIntPraticaId() + + "), " + tipoDocumento + " " + documento.getPrimaryKey()); } } inizio += SLICE; @@ -1491,8 +1406,8 @@ public class SismicaUtil { return esito; } - public static List riparaPermessiAsseverazioni(long companyId) - throws SystemException, PortalException { + public static List riparaPermessiAsseverazioni(long companyId) throws SystemException, + PortalException { List esito = new ArrayList<>(); int inizio = 0; @@ -1501,37 +1416,28 @@ public class SismicaUtil { List documenti = null; String tipoDocumento = null; do { - documenti = AsseverazioneLocalServiceUtil.getAsseveraziones(inizio, - inizio + SLICE); + documenti = AsseverazioneLocalServiceUtil.getAsseveraziones(inizio, inizio + SLICE); for (Asseverazione documento : documenti) { if (Validator.isNull(tipoDocumento)) { tipoDocumento = documento.getClass().getSimpleName(); } IntPratica pratica = null; try { - pratica = IntPraticaLocalServiceUtil - .getIntPratica(documento.getIntPraticaId()); + pratica = IntPraticaLocalServiceUtil.getIntPratica(documento.getIntPraticaId()); } catch (PortalException e) { } - if (Validator.isNotNull(pratica) - && (documento.getFileEntryId() != 0)) { - Territorio territorio = TerritorioLocalServiceUtil - .getTerritorio(pratica.getTerritorioId()); + if (Validator.isNotNull(pratica) && (documento.getFileEntryId() != 0)) { + Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(pratica + .getTerritorioId()); FileEntry fileEntry = null; try { - fileEntry = DLAppServiceUtil.getFileEntry(documento - .getFileEntryId()); + fileEntry = DLAppServiceUtil.getFileEntry(documento.getFileEntryId()); } catch (Exception e) { // _log.info(e.getClass() + ": " + e.getMessage()); } - corretti += riparaPermessiFileEntry( - companyId, - territorio.getGroupId(), - fileEntry, - "Pratica " + pratica.getNumeroProgetto() + " (" - + pratica.getIntPraticaId() + "), " - + tipoDocumento + " " - + documento.getPrimaryKey()); + corretti += riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry, + "Pratica " + pratica.getNumeroProgetto() + " (" + pratica.getIntPraticaId() + + "), " + tipoDocumento + " " + documento.getPrimaryKey()); } } inizio += SLICE; @@ -1544,8 +1450,7 @@ public class SismicaUtil { return esito; } - public static List riparaPermessiAvvisi(long companyId) - throws SystemException, PortalException { + public static List riparaPermessiAvvisi(long companyId) throws SystemException, PortalException { List esito = new ArrayList<>(); int inizio = 0; @@ -1554,78 +1459,55 @@ public class SismicaUtil { List documenti = null; String tipoDocumento = null; do { - documenti = AvvisoLocalServiceUtil.getAvvisos(inizio, inizio - + SLICE); + documenti = AvvisoLocalServiceUtil.getAvvisos(inizio, inizio + SLICE); for (Avviso documento : documenti) { if (Validator.isNull(tipoDocumento)) { tipoDocumento = documento.getClass().getSimpleName(); } IntPratica pratica = null; try { - pratica = IntPraticaLocalServiceUtil - .getIntPratica(documento.getIntPraticaId()); + pratica = IntPraticaLocalServiceUtil.getIntPratica(documento.getIntPraticaId()); } catch (PortalException e) { } - if (Validator.isNotNull(pratica) - && (documento.getFileEntryIdBase() != 0)) { - Territorio territorio = TerritorioLocalServiceUtil - .getTerritorio(pratica.getTerritorioId()); + if (Validator.isNotNull(pratica) && (documento.getFileEntryIdBase() != 0)) { + Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(pratica + .getTerritorioId()); FileEntry fileEntry = null; try { - fileEntry = DLAppServiceUtil.getFileEntry(documento - .getFileEntryIdBase()); + fileEntry = DLAppServiceUtil.getFileEntry(documento.getFileEntryIdBase()); } catch (Exception e) { // _log.info(e.getClass() + ": " + e.getMessage()); } - corretti += riparaPermessiFileEntry( - companyId, - territorio.getGroupId(), - fileEntry, - "Pratica " + pratica.getNumeroProgetto() + " (" - + pratica.getIntPraticaId() + "), " - + tipoDocumento + " " - + documento.getPrimaryKey()); + corretti += riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry, + "Pratica " + pratica.getNumeroProgetto() + " (" + pratica.getIntPraticaId() + + "), " + tipoDocumento + " " + documento.getPrimaryKey()); } - if (Validator.isNotNull(pratica) - && (documento.getFileEntryIdInvio() != 0)) { - Territorio territorio = TerritorioLocalServiceUtil - .getTerritorio(pratica.getTerritorioId()); + if (Validator.isNotNull(pratica) && (documento.getFileEntryIdInvio() != 0)) { + Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(pratica + .getTerritorioId()); FileEntry fileEntry = null; try { - fileEntry = DLAppServiceUtil.getFileEntry(documento - .getFileEntryIdInvio()); + fileEntry = DLAppServiceUtil.getFileEntry(documento.getFileEntryIdInvio()); } catch (Exception e) { // _log.info(e.getClass() + ": " + e.getMessage()); } - corretti += riparaPermessiFileEntry( - companyId, - territorio.getGroupId(), - fileEntry, - "Pratica " + pratica.getNumeroProgetto() + " (" - + pratica.getIntPraticaId() + "), " - + tipoDocumento + " " - + documento.getPrimaryKey()); + corretti += riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry, + "Pratica " + pratica.getNumeroProgetto() + " (" + pratica.getIntPraticaId() + + "), " + tipoDocumento + " " + documento.getPrimaryKey()); } - if (Validator.isNotNull(pratica) - && (documento.getFileEntryIdProtocollo() != 0)) { - Territorio territorio = TerritorioLocalServiceUtil - .getTerritorio(pratica.getTerritorioId()); + if (Validator.isNotNull(pratica) && (documento.getFileEntryIdProtocollo() != 0)) { + Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(pratica + .getTerritorioId()); FileEntry fileEntry = null; try { - fileEntry = DLAppServiceUtil.getFileEntry(documento - .getFileEntryIdProtocollo()); + fileEntry = DLAppServiceUtil.getFileEntry(documento.getFileEntryIdProtocollo()); } catch (Exception e) { // _log.info(e.getClass() + ": " + e.getMessage()); } - corretti += riparaPermessiFileEntry( - companyId, - territorio.getGroupId(), - fileEntry, - "Pratica " + pratica.getNumeroProgetto() + " (" - + pratica.getIntPraticaId() + "), " - + tipoDocumento + " " - + documento.getPrimaryKey()); + corretti += riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry, + "Pratica " + pratica.getNumeroProgetto() + " (" + pratica.getIntPraticaId() + + "), " + tipoDocumento + " " + documento.getPrimaryKey()); } } inizio += SLICE; @@ -1638,8 +1520,8 @@ public class SismicaUtil { return esito; } - public static List riparaPermessiDocAggiuntive(long companyId) - throws SystemException, PortalException { + public static List riparaPermessiDocAggiuntive(long companyId) throws SystemException, + PortalException { List esito = new ArrayList<>(); int inizio = 0; @@ -1648,37 +1530,28 @@ public class SismicaUtil { List documenti = null; String tipoDocumento = null; do { - documenti = DocAggiuntivaLocalServiceUtil.getDocAggiuntivas(inizio, - inizio + SLICE); + documenti = DocAggiuntivaLocalServiceUtil.getDocAggiuntivas(inizio, inizio + SLICE); for (DocAggiuntiva documento : documenti) { if (Validator.isNull(tipoDocumento)) { tipoDocumento = documento.getClass().getSimpleName(); } IntPratica pratica = null; try { - pratica = IntPraticaLocalServiceUtil - .getIntPratica(documento.getIntPraticaId()); + pratica = IntPraticaLocalServiceUtil.getIntPratica(documento.getIntPraticaId()); } catch (PortalException e) { } - if (Validator.isNotNull(pratica) - && (documento.getFileEntryId() != 0)) { - Territorio territorio = TerritorioLocalServiceUtil - .getTerritorio(pratica.getTerritorioId()); + if (Validator.isNotNull(pratica) && (documento.getFileEntryId() != 0)) { + Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(pratica + .getTerritorioId()); FileEntry fileEntry = null; try { - fileEntry = DLAppServiceUtil.getFileEntry(documento - .getFileEntryId()); + fileEntry = DLAppServiceUtil.getFileEntry(documento.getFileEntryId()); } catch (Exception e) { // _log.info(e.getClass() + ": " + e.getMessage()); } - corretti += riparaPermessiFileEntry( - companyId, - territorio.getGroupId(), - fileEntry, - "Pratica " + pratica.getNumeroProgetto() + " (" - + pratica.getIntPraticaId() + "), " - + tipoDocumento + " " - + documento.getPrimaryKey()); + corretti += riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry, + "Pratica " + pratica.getNumeroProgetto() + " (" + pratica.getIntPraticaId() + + "), " + tipoDocumento + " " + documento.getPrimaryKey()); } } inizio += SLICE; @@ -1691,8 +1564,8 @@ public class SismicaUtil { return esito; } - public static List riparaPermessiDocPratica(long companyId) - throws SystemException, PortalException { + public static List riparaPermessiDocPratica(long companyId) throws SystemException, + PortalException { List esito = new ArrayList<>(); int inizio = 0; @@ -1701,37 +1574,28 @@ public class SismicaUtil { List documenti = null; String tipoDocumento = null; do { - documenti = DocPraticaLocalServiceUtil.getDocPraticas(inizio, - inizio + SLICE); + documenti = DocPraticaLocalServiceUtil.getDocPraticas(inizio, inizio + SLICE); for (DocPratica documento : documenti) { if (Validator.isNull(tipoDocumento)) { tipoDocumento = documento.getClass().getSimpleName(); } IntPratica pratica = null; try { - pratica = IntPraticaLocalServiceUtil - .getIntPratica(documento.getIntPraticaId()); + pratica = IntPraticaLocalServiceUtil.getIntPratica(documento.getIntPraticaId()); } catch (PortalException e) { } - if (Validator.isNotNull(pratica) - && (documento.getDlFileEntryId() != 0)) { - Territorio territorio = TerritorioLocalServiceUtil - .getTerritorio(pratica.getTerritorioId()); + if (Validator.isNotNull(pratica) && (documento.getDlFileEntryId() != 0)) { + Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(pratica + .getTerritorioId()); FileEntry fileEntry = null; try { - fileEntry = DLAppServiceUtil.getFileEntry(documento - .getDlFileEntryId()); + fileEntry = DLAppServiceUtil.getFileEntry(documento.getDlFileEntryId()); } catch (Exception e) { // _log.info(e.getClass() + ": " + e.getMessage()); } - corretti += riparaPermessiFileEntry( - companyId, - territorio.getGroupId(), - fileEntry, - "Pratica " + pratica.getNumeroProgetto() + " (" - + pratica.getIntPraticaId() + "), " - + tipoDocumento + " " - + documento.getPrimaryKey()); + corretti += riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry, + "Pratica " + pratica.getNumeroProgetto() + " (" + pratica.getIntPraticaId() + + "), " + tipoDocumento + " " + documento.getPrimaryKey()); } } inizio += SLICE; @@ -1744,8 +1608,8 @@ public class SismicaUtil { return esito; } - public static List riparaPermessiPagamenti(long companyId) - throws SystemException, PortalException { + public static List riparaPermessiPagamenti(long companyId) throws SystemException, + PortalException { List esito = new ArrayList<>(); int inizio = 0; @@ -1754,37 +1618,28 @@ public class SismicaUtil { List documenti = null; String tipoDocumento = null; do { - documenti = PagamentoLocalServiceUtil.getPagamentos(inizio, inizio - + SLICE); + documenti = PagamentoLocalServiceUtil.getPagamentos(inizio, inizio + SLICE); for (Pagamento documento : documenti) { if (Validator.isNull(tipoDocumento)) { tipoDocumento = documento.getClass().getSimpleName(); } IntPratica pratica = null; try { - pratica = IntPraticaLocalServiceUtil - .getIntPratica(documento.getIntPraticaId()); + pratica = IntPraticaLocalServiceUtil.getIntPratica(documento.getIntPraticaId()); } catch (PortalException e) { } - if (Validator.isNotNull(pratica) - && (documento.getFileEntryId() != 0)) { - Territorio territorio = TerritorioLocalServiceUtil - .getTerritorio(pratica.getTerritorioId()); + if (Validator.isNotNull(pratica) && (documento.getFileEntryId() != 0)) { + Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(pratica + .getTerritorioId()); FileEntry fileEntry = null; try { - fileEntry = DLAppServiceUtil.getFileEntry(documento - .getFileEntryId()); + fileEntry = DLAppServiceUtil.getFileEntry(documento.getFileEntryId()); } catch (Exception e) { // _log.info(e.getClass() + ": " + e.getMessage()); } - corretti += riparaPermessiFileEntry( - companyId, - territorio.getGroupId(), - fileEntry, - "Pratica " + pratica.getNumeroProgetto() + " (" - + pratica.getIntPraticaId() + "), " - + tipoDocumento + " " - + documento.getPrimaryKey()); + corretti += riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry, + "Pratica " + pratica.getNumeroProgetto() + " (" + pratica.getIntPraticaId() + + "), " + tipoDocumento + " " + documento.getPrimaryKey()); } } inizio += SLICE; @@ -1797,8 +1652,8 @@ public class SismicaUtil { return esito; } - public static List riparaPermessiPareriGeologi(long companyId) - throws SystemException, PortalException { + public static List riparaPermessiPareriGeologi(long companyId) throws SystemException, + PortalException { List esito = new ArrayList<>(); int inizio = 0; @@ -1807,37 +1662,28 @@ public class SismicaUtil { List documenti = null; String tipoDocumento = null; do { - documenti = ParereGeologoLocalServiceUtil.getParereGeologos(inizio, - inizio + SLICE); + documenti = ParereGeologoLocalServiceUtil.getParereGeologos(inizio, inizio + SLICE); for (ParereGeologo documento : documenti) { if (Validator.isNull(tipoDocumento)) { tipoDocumento = documento.getClass().getSimpleName(); } IntPratica pratica = null; try { - pratica = IntPraticaLocalServiceUtil - .getIntPratica(documento.getIntPraticaId()); + pratica = IntPraticaLocalServiceUtil.getIntPratica(documento.getIntPraticaId()); } catch (PortalException e) { } - if (Validator.isNotNull(pratica) - && (documento.getFileEntryId() != 0)) { - Territorio territorio = TerritorioLocalServiceUtil - .getTerritorio(pratica.getTerritorioId()); + if (Validator.isNotNull(pratica) && (documento.getFileEntryId() != 0)) { + Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(pratica + .getTerritorioId()); FileEntry fileEntry = null; try { - fileEntry = DLAppServiceUtil.getFileEntry(documento - .getFileEntryId()); + fileEntry = DLAppServiceUtil.getFileEntry(documento.getFileEntryId()); } catch (Exception e) { // _log.info(e.getClass() + ": " + e.getMessage()); } - corretti += riparaPermessiFileEntry( - companyId, - territorio.getGroupId(), - fileEntry, - "Pratica " + pratica.getNumeroProgetto() + " (" - + pratica.getIntPraticaId() + "), " - + tipoDocumento + " " - + documento.getPrimaryKey()); + corretti += riparaPermessiFileEntry(companyId, territorio.getGroupId(), fileEntry, + "Pratica " + pratica.getNumeroProgetto() + " (" + pratica.getIntPraticaId() + + "), " + tipoDocumento + " " + documento.getPrimaryKey()); } } inizio += SLICE; @@ -1850,9 +1696,8 @@ public class SismicaUtil { return esito; } - private static int riparaPermessiFileEntry(long companyId, long groupId, - FileEntry fileEntry, String datiDocumento) throws PortalException, - SystemException { + private static int riparaPermessiFileEntry(long companyId, long groupId, FileEntry fileEntry, + String datiDocumento) throws PortalException, SystemException { int corretti = 0; if (Validator.isNotNull(fileEntry)) { PermissionChecker pc = orgPc.get(groupId); @@ -1860,65 +1705,44 @@ public class SismicaUtil { // _log.info(datiDocumento + " non ha i permessi"); ResourcePermission resourcePermission = null; try { - resourcePermission = ResourcePermissionLocalServiceUtil - .getResourcePermission(companyId, - DLFileEntry.class.getName(), - ResourceConstants.SCOPE_INDIVIDUAL, - String.valueOf(fileEntry.getPrimaryKey()), - userRoleId); + resourcePermission = ResourcePermissionLocalServiceUtil.getResourcePermission(companyId, + DLFileEntry.class.getName(), ResourceConstants.SCOPE_INDIVIDUAL, + String.valueOf(fileEntry.getPrimaryKey()), userRoleId); } catch (NoSuchResourcePermissionException e) { resourcePermission = ResourcePermissionLocalServiceUtil - .createResourcePermission(CounterLocalServiceUtil - .increment()); + .createResourcePermission(CounterLocalServiceUtil.increment()); resourcePermission.setCompanyId(companyId); resourcePermission.setName(DLFileEntry.class.getName()); - resourcePermission - .setScope(ResourceConstants.SCOPE_INDIVIDUAL); - resourcePermission.setPrimKey(String.valueOf(fileEntry - .getPrimaryKey())); + resourcePermission.setScope(ResourceConstants.SCOPE_INDIVIDUAL); + resourcePermission.setPrimKey(String.valueOf(fileEntry.getPrimaryKey())); resourcePermission.setRoleId(userRoleId); - resourcePermission.setActionIds(raFileEntry - .getBitwiseValue()); - ResourcePermissionLocalServiceUtil - .addResourcePermission(resourcePermission); + resourcePermission.setActionIds(raFileEntry.getBitwiseValue()); + ResourcePermissionLocalServiceUtil.addResourcePermission(resourcePermission); } resourcePermission.setActionIds(raFileEntry.getBitwiseValue()); - ResourcePermissionLocalServiceUtil - .updateResourcePermission(resourcePermission); + ResourcePermissionLocalServiceUtil.updateResourcePermission(resourcePermission); Folder folder = fileEntry.getFolder(); while (Validator.isNotNull(folder)) { if (!folder.containsPermission(pc, ActionKeys.VIEW)) { // _log.info("folder " + folder.getName() + // " non ha i permessi"); try { - resourcePermission = ResourcePermissionLocalServiceUtil - .getResourcePermission(companyId, - DLFolder.class.getName(), - ResourceConstants.SCOPE_INDIVIDUAL, - String.valueOf(folder - .getPrimaryKey()), - userRoleId); + resourcePermission = ResourcePermissionLocalServiceUtil.getResourcePermission( + companyId, DLFolder.class.getName(), ResourceConstants.SCOPE_INDIVIDUAL, + String.valueOf(folder.getPrimaryKey()), userRoleId); } catch (NoSuchResourcePermissionException e) { resourcePermission = ResourcePermissionLocalServiceUtil - .createResourcePermission(CounterLocalServiceUtil - .increment()); + .createResourcePermission(CounterLocalServiceUtil.increment()); resourcePermission.setCompanyId(companyId); - resourcePermission - .setName(DLFolder.class.getName()); - resourcePermission - .setScope(ResourceConstants.SCOPE_INDIVIDUAL); - resourcePermission.setPrimKey(String.valueOf(folder - .getPrimaryKey())); + resourcePermission.setName(DLFolder.class.getName()); + resourcePermission.setScope(ResourceConstants.SCOPE_INDIVIDUAL); + resourcePermission.setPrimKey(String.valueOf(folder.getPrimaryKey())); resourcePermission.setRoleId(userRoleId); - resourcePermission.setActionIds(raFolder - .getBitwiseValue()); - ResourcePermissionLocalServiceUtil - .addResourcePermission(resourcePermission); + resourcePermission.setActionIds(raFolder.getBitwiseValue()); + ResourcePermissionLocalServiceUtil.addResourcePermission(resourcePermission); } - resourcePermission.setActionIds(raFolder - .getBitwiseValue()); - ResourcePermissionLocalServiceUtil - .updateResourcePermission(resourcePermission); + resourcePermission.setActionIds(raFolder.getBitwiseValue()); + ResourcePermissionLocalServiceUtil.updateResourcePermission(resourcePermission); } folder = folder.getParentFolder(); } @@ -1945,12 +1769,17 @@ public class SismicaUtil { return result; } - private static ServiceContext getServiceContextbyIntPratica( - IntPratica intPratica) { + private static ServiceContext getServiceContextbyIntPratica(IntPratica intPratica) { ServiceContext serviceContext = new ServiceContext(); serviceContext.setCompanyId(intPratica.getCompanyId()); serviceContext.setScopeGroupId(intPratica.getGroupId()); serviceContext.setUserId(intPratica.getUserId()); return serviceContext; } + + private static List esitoLog(List esito, String msg) { + esito.add(msg); + _log.info(msg); + return esito; + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SvuotaDatabase.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SvuotaDatabase.java deleted file mode 100644 index a6fe9664..00000000 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SvuotaDatabase.java +++ /dev/null @@ -1,573 +0,0 @@ -/** - * - * @author Salvatore La Manna, Manifattura Web Group per Regione Siciliana - * - */ -package it.mwg.sismica.bo.util; - -import it.tref.liferay.portos.bo.model.AllegatoManuale; -import it.tref.liferay.portos.bo.model.Asseverazione; -import it.tref.liferay.portos.bo.model.Avviso; -import it.tref.liferay.portos.bo.model.Collaudo; -import it.tref.liferay.portos.bo.model.ControlloPratica; -import it.tref.liferay.portos.bo.model.Delega; -import it.tref.liferay.portos.bo.model.DettPratica; -import it.tref.liferay.portos.bo.model.DocAggiuntiva; -import it.tref.liferay.portos.bo.model.DocPratica; -import it.tref.liferay.portos.bo.model.FineLavori; -import it.tref.liferay.portos.bo.model.IntPratica; -import it.tref.liferay.portos.bo.model.Pagamento; -import it.tref.liferay.portos.bo.model.ParereGeologo; -import it.tref.liferay.portos.bo.model.Soggetto; -import it.tref.liferay.portos.bo.model.Tempistica; -import it.tref.liferay.portos.bo.service.AllegatoManualeLocalServiceUtil; -import it.tref.liferay.portos.bo.service.AsseverazioneLocalServiceUtil; -import it.tref.liferay.portos.bo.service.AvvisoLocalServiceUtil; -import it.tref.liferay.portos.bo.service.CollaudoLocalServiceUtil; -import it.tref.liferay.portos.bo.service.ControlloPraticaLocalServiceUtil; -import it.tref.liferay.portos.bo.service.DelegaLocalServiceUtil; -import it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil; -import it.tref.liferay.portos.bo.service.DocAggiuntivaLocalServiceUtil; -import it.tref.liferay.portos.bo.service.DocPraticaLocalServiceUtil; -import it.tref.liferay.portos.bo.service.FineLavoriLocalServiceUtil; -import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil; -import it.tref.liferay.portos.bo.service.PagamentoLocalServiceUtil; -import it.tref.liferay.portos.bo.service.ParereGeologoLocalServiceUtil; -import it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil; -import it.tref.liferay.portos.bo.service.TempisticaLocalServiceUtil; -import it.tref.liferay.portos.mailmanager.model.Email; -import it.tref.liferay.portos.mailmanager.model.EmailAttachment; -import it.tref.liferay.portos.mailmanager.service.EmailAttachmentLocalServiceUtil; -import it.tref.liferay.portos.mailmanager.service.EmailLocalServiceUtil; - -import java.util.ArrayList; -import java.util.List; - -import com.liferay.portal.kernel.cache.CacheRegistryUtil; -import com.liferay.portal.kernel.cache.MultiVMPoolUtil; -import com.liferay.portal.kernel.cache.SingleVMPoolUtil; -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.servlet.DirectServletRegistryUtil; -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.Contact; -import com.liferay.portal.model.Group; -import com.liferay.portal.model.LayoutPrototype; -import com.liferay.portal.model.LayoutSetPrototype; -import com.liferay.portal.model.Organization; -import com.liferay.portal.model.User; -import com.liferay.portal.model.UserPersonalSite; -import com.liferay.portal.service.CompanyLocalServiceUtil; -import com.liferay.portal.service.ContactLocalServiceUtil; -import com.liferay.portal.service.GroupLocalServiceUtil; -import com.liferay.portal.service.LayoutPrototypeLocalServiceUtil; -import com.liferay.portal.service.LayoutSetPrototypeLocalServiceUtil; -import com.liferay.portal.service.OrganizationLocalServiceUtil; -import com.liferay.portal.service.ServiceContext; -import com.liferay.portal.service.UserLocalServiceUtil; -import com.liferay.portlet.documentlibrary.model.DLFolder; -import com.liferay.portlet.documentlibrary.service.DLAppLocalServiceUtil; -import com.liferay.portlet.documentlibrary.service.DLFolderLocalServiceUtil; - -public class SvuotaDatabase { - private static final Log _log = LogFactoryUtil.getLog(SvuotaDatabase.class); - private static final int SLICE = 1000; - - private static int docPraticaCancellati; - - public static List pulisci(ServiceContext serviceContext) throws SystemException, PortalException { - List esito = new ArrayList<>(); - // esito.addAll(puliziaDocumentLibrary()); - esito.addAll(svuotaDatabase(serviceContext)); - - try { - SingleVMPoolUtil.clear(); - MultiVMPoolUtil.clear(); - CacheRegistryUtil.clear(); - DirectServletRegistryUtil.clearServlets(); - } catch (IllegalStateException e) { - } - - return esito; - } - - private static List svuotaDatabase(ServiceContext serviceContext) throws SystemException, - PortalException { - List esito = new ArrayList<>(); - esitoLog(esito, "Cancellati " + svuotaDettPratica() + " DettPratica"); - - esitoLog(esito, "Cancellati " + svuotaAllegatoManuale() + " AllegatoManuale"); - esitoLog(esito, "Cancellati " + svuotaAsseverazione() + " Asseverazione"); - esitoLog(esito, "Cancellati " + svuotaAvviso() + " Avviso"); - esitoLog(esito, "Cancellati " + svuotaCollaudo() + " Collaudo"); - esitoLog(esito, "Cancellati " + svuotaContact() + " Contacts"); - esitoLog(esito, "Cancellati " + svuotaControlloPratica() + " ControlloPratica"); - esitoLog(esito, "Cancellati " + svuotaDelega() + " Delega"); - esitoLog(esito, "Cancellati " + svuotaDocAggiuntiva() + " DocAggiuntiva"); - esitoLog(esito, "Cancellati " + svuotaDocPratica() + " DocPratica"); - esitoLog(esito, "Cancellati " + svuotaEmail() + " Email"); - esitoLog(esito, "Cancellati " + svuotaEmailAttachment() + " EmailAttachment"); - esitoLog(esito, "Cancellati " + svuotaFineLavori() + " FineLavori"); - esitoLog(esito, "Cancellati " + svuotaGroup() + " Group"); - esitoLog(esito, "Cancellati " + svuotaPagamento() + " Pagamento"); - docPraticaCancellati = 0; - esitoLog(esito, "Cancellati " + svuotaSoggetto() + " Soggetto, cancellati " + docPraticaCancellati - + " DocPratica"); - esitoLog(esito, "Cancellati " + svuotaTempistica() + " Tempistica"); - return esito; - } - - private static List puliziaDocumentLibrary() { - List esito = new ArrayList<>(); - - try { - int cancellati = 0; - int start = 0; - int totali = 0; - List folders; - do { - folders = DLFolderLocalServiceUtil.getDLFolders(start, start + SLICE); - int rimossi = 0; - totali += folders.size(); - for (DLFolder folder : folders) { - DLFolder parent = folder.getParentFolder(); - if (Validator.isNotNull(parent)) { - switch (parent.getName()) { - case "Allegati": - long[] ids = StringUtil.split(folder.getName(), "_", 0L); - if ((ids.length == 2) && (ids[0] == ids[1])) { - try { - DettPraticaLocalServiceUtil.getDettPratica(ids[0]); - } catch (PortalException e) { - _log.info("Cancello la cartella " + folder.getName()); - cancellati++; - rimossi++; - DLAppLocalServiceUtil.deleteFolder(folder.getFolderId()); - } - } - break; - } - } - } - start += folders.size() - rimossi; - } while (folders.size() > 0); - esitoLog(esito, "Analizzate " + totali + " cartelle, cancellate " + cancellati); - } catch (PortalException | SystemException e) { - esitoLog(esito, "Errore durante l'elaborazione. " + e.getMessage()); - } - return esito; - } - - private static int svuotaAllegatoManuale() throws SystemException { - int start = 0; - int cancellati = 0; - List allegatiManuali = null; - do { - int rimossi = 0; - allegatiManuali = AllegatoManualeLocalServiceUtil.getAllegatoManuales(start, start + SLICE); - for (AllegatoManuale allegatoManuale : allegatiManuali) { - if (!esiste(IntPratica.class.getName(), allegatoManuale.getIntPraticaId()) - || !esiste(DettPratica.class.getName(), allegatoManuale.getDettPraticaId()) - || !esiste(Avviso.class.getName(), allegatoManuale.getAvvisoId())) { - deleteFileEntry(allegatoManuale.getFileEntryId()); - AllegatoManualeLocalServiceUtil.deleteAllegatoManuale(allegatoManuale); - cancellati++; - rimossi++; - } - } - start += SLICE - rimossi; - } while (allegatiManuali.size() > 0); - return cancellati; - } - - private static int svuotaAsseverazione() throws SystemException { - int start = 0; - int cancellati = 0; - List asseverazioni = null; - do { - int rimossi = 0; - asseverazioni = AsseverazioneLocalServiceUtil.getAsseveraziones(start, start + SLICE); - for (Asseverazione asseverazione : asseverazioni) { - if (!esiste(IntPratica.class.getName(), asseverazione.getIntPraticaId()) - || !esiste(DettPratica.class.getName(), asseverazione.getDettPraticaId())) { - deleteFileEntry(asseverazione.getFileEntryId()); - AsseverazioneLocalServiceUtil.deleteAsseverazione(asseverazione); - cancellati++; - rimossi++; - } - } - start += SLICE - rimossi; - } while (asseverazioni.size() > 0); - return cancellati; - } - - private static int svuotaAvviso() throws SystemException { - int start = 0; - int cancellati = 0; - List avvisi = null; - do { - int rimossi = 0; - avvisi = AvvisoLocalServiceUtil.getAvvisos(start, start + SLICE); - for (Avviso avviso : avvisi) { - if (!esiste(avviso.getClassName(), avviso.getClassPk()) - || !esiste(IntPratica.class.getName(), avviso.getIntPraticaId())) { - deleteFileEntry(avviso.getFileEntryIdBase()); - deleteFileEntry(avviso.getFileEntryIdInvio()); - deleteFileEntry(avviso.getFileEntryIdProtocollo()); - AvvisoLocalServiceUtil.deleteAvviso(avviso); - cancellati++; - rimossi++; - } - } - start += SLICE - rimossi; - } while (avvisi.size() > 0); - return cancellati; - } - - private static int svuotaCollaudo() throws SystemException, PortalException { - int start = 0; - int cancellati = 0; - List collaudi = null; - do { - int rimossi = 0; - collaudi = CollaudoLocalServiceUtil.getCollaudos(start, start + SLICE); - for (Collaudo collaudo : collaudi) { - if (!esiste(IntPratica.class.getName(), collaudo.getIntPraticaId())) { - CollaudoLocalServiceUtil.deleteCollaudo(collaudo); - cancellati++; - rimossi++; - } - } - start += SLICE - rimossi; - } while (collaudi.size() > 0); - return cancellati; - } - - private static int svuotaControlloPratica() throws SystemException, PortalException { - int start = 0; - int cancellati = 0; - List controlliPratiche = null; - do { - int rimossi = 0; - controlliPratiche = ControlloPraticaLocalServiceUtil.getControlloPraticas(start, start + SLICE); - for (ControlloPratica controlloPratica : controlliPratiche) { - if (!esiste(IntPratica.class.getName(), controlloPratica.getIntPraticaId()) - || !esiste(DettPratica.class.getName(), controlloPratica.getDettPraticaId())) { - ControlloPraticaLocalServiceUtil.deleteControlloPratica(controlloPratica); - cancellati++; - rimossi++; - } - } - start += SLICE - rimossi; - } while (controlliPratiche.size() > 0); - return cancellati; - } - - private static int svuotaDelega() throws SystemException, PortalException { - int start = 0; - int cancellati = 0; - List deleghe = null; - do { - int rimossi = 0; - deleghe = DelegaLocalServiceUtil.getDelegas(start, start + SLICE); - for (Delega delega : deleghe) { - if (!esiste(IntPratica.class.getName(), delega.getIntPraticaId()) - || !esiste(DettPratica.class.getName(), delega.getDettPraticaId())) { - DelegaLocalServiceUtil.deleteDelega(delega); - cancellati++; - rimossi++; - } - } - start += SLICE - rimossi; - } while (deleghe.size() > 0); - return cancellati; - } - - private static int svuotaContact() throws SystemException, PortalException { - int start = 0; - int cancellati = 0; - List contacts = null; - do { - int rimossi = 0; - contacts = ContactLocalServiceUtil.getContacts(start, start + SLICE); - for (Contact contact : contacts) { - if (!esiste(contact.getClassName(), contact.getClassPK())) { - ContactLocalServiceUtil.deleteContact(contact); - cancellati++; - rimossi++; - } - } - start += SLICE - rimossi; - } while (contacts.size() > 0); - return cancellati; - } - - private static String svuotaDettPratica() throws SystemException, PortalException { - int start = 0; - int cancellati = 0; - List dettPratiche = null; - do { - int rimossi = 0; - dettPratiche = DettPraticaLocalServiceUtil.getDettPraticas(start, start + SLICE); - for (DettPratica dettPratica : dettPratiche) { - if (!esiste(IntPratica.class.getName(), dettPratica.getIntPraticaId())) { - DettPraticaLocalServiceUtil.deleteDettPratica(dettPratica); - cancellati++; - rimossi++; - } - } - start += SLICE - rimossi; - } while (dettPratiche.size() > 0); - return "Cancellati " + cancellati + " DettPratica"; - } - - private static int svuotaDocAggiuntiva() throws SystemException, PortalException { - int start = 0; - int cancellati = 0; - List docAggiuntive = null; - do { - int rimossi = 0; - docAggiuntive = DocAggiuntivaLocalServiceUtil.getDocAggiuntivas(start, start + SLICE); - for (DocAggiuntiva docAggiuntiva : docAggiuntive) { - if (!esiste(IntPratica.class.getName(), docAggiuntiva.getIntPraticaId()) - || !esiste(DettPratica.class.getName(), docAggiuntiva.getDettPraticaId())) { - deleteFileEntry(docAggiuntiva.getFileEntryId()); - DocAggiuntivaLocalServiceUtil.deleteDocAggiuntiva(docAggiuntiva); - cancellati++; - rimossi++; - } - } - start += SLICE - rimossi; - } while (docAggiuntive.size() > 0); - return cancellati; - } - - private static int svuotaDocPratica() throws SystemException, PortalException { - int start = 0; - int cancellati = 0; - List docPratiche = null; - do { - int rimossi = 0; - docPratiche = DocPraticaLocalServiceUtil.getDocPraticas(start, start + SLICE); - for (DocPratica docPratica : docPratiche) { - if (!esiste(IntPratica.class.getName(), docPratica.getIntPraticaId())) { - deleteFileEntry(docPratica.getDlFileEntryId()); - DocPraticaLocalServiceUtil.deleteDocPratica(docPratica); - cancellati++; - rimossi++; - } - } - start += SLICE - rimossi; - } while (docPratiche.size() > 0); - return cancellati; - } - - private static int svuotaEmail() throws SystemException, PortalException { - int start = 0; - int cancellati = 0; - List emails = null; - do { - int rimossi = 0; - emails = EmailLocalServiceUtil.getEmails(start, start + SLICE); - for (Email email : emails) { - if (!esiste(email.getClassName(), email.getClassPK())) { - EmailLocalServiceUtil.deleteEmail(email); - cancellati++; - rimossi++; - } - } - start += SLICE - rimossi; - } while (emails.size() > 0); - return cancellati; - } - - private static int svuotaEmailAttachment() throws SystemException, PortalException { - int start = 0; - int cancellati = 0; - List emailAttachments = null; - do { - int rimossi = 0; - emailAttachments = EmailAttachmentLocalServiceUtil.getEmailAttachments(start, start + SLICE); - for (EmailAttachment emailAttachment : emailAttachments) { - if (!esiste(Email.class.getName(), emailAttachment.getEmailId())) { - deleteFileEntry(emailAttachment.getFileEntryId()); - EmailAttachmentLocalServiceUtil.deleteEmailAttachment(emailAttachment); - cancellati++; - rimossi++; - } - } - start += SLICE - rimossi; - } while (emailAttachments.size() > 0); - return cancellati; - } - - private static int svuotaFineLavori() throws SystemException, PortalException { - int start = 0; - int cancellati = 0; - List finiLavori = null; - do { - int rimossi = 0; - finiLavori = FineLavoriLocalServiceUtil.getFineLavoris(start, start + SLICE); - for (FineLavori fineLavori : finiLavori) { - if (!esiste(IntPratica.class.getName(), fineLavori.getIntPraticaId())) { - FineLavoriLocalServiceUtil.deleteFineLavori(fineLavori); - cancellati++; - rimossi++; - } - } - start += SLICE - rimossi; - } while (finiLavori.size() > 0); - return cancellati; - } - - private static int svuotaGroup() throws SystemException, PortalException { - int start = 0; - int cancellati = 0; - List groups = null; - do { - int rimossi = 0; - groups = GroupLocalServiceUtil.getGroups(start, start + SLICE); - for (Group group : groups) { - if (!esiste(group.getClassName(), group.getClassPK())) { - GroupLocalServiceUtil.deleteGroup(group); - cancellati++; - rimossi++; - } - } - start += SLICE - rimossi; - } while (groups.size() > 0); - return cancellati; - } - - private static int svuotaPagamento() throws SystemException, PortalException { - int start = 0; - int cancellati = 0; - List pagamenti = null; - do { - int rimossi = 0; - pagamenti = PagamentoLocalServiceUtil.getPagamentos(start, start + SLICE); - for (Pagamento pagamento : pagamenti) { - if (!esiste(pagamento.getClassName(), pagamento.getClassPk()) - || !esiste(IntPratica.class.getName(), pagamento.getIntPraticaId())) { - deleteFileEntry(pagamento.getFileEntryId()); - PagamentoLocalServiceUtil.deletePagamento(pagamento); - cancellati++; - rimossi++; - } - } - start += SLICE - rimossi; - } while (pagamenti.size() > 0); - return cancellati; - } - - private static int svuotaSoggetto() throws SystemException, PortalException { - int start = 0; - int cancellati = 0; - List soggetti = null; - do { - int rimossi = 0; - soggetti = SoggettoLocalServiceUtil.getSoggettos(start, start + SLICE); - for (Soggetto soggetto : soggetti) { - if (!esiste(IntPratica.class.getName(), soggetto.getIntPraticaId()) - || !esiste(DettPratica.class.getName(), soggetto.getDettPraticaId())) { - if (Validator.isNotNull(soggetto.getFileVariazioneId())) { - try { - DocPratica docPratica = DocPraticaLocalServiceUtil.getDocPratica(soggetto - .getFileVariazioneId()); - deleteFileEntry(docPratica.getDlFileEntryId()); - DocPraticaLocalServiceUtil.deleteDocPratica(docPratica); - docPraticaCancellati++; - } catch (PortalException e) { - } - } - SoggettoLocalServiceUtil.deleteSoggetto(soggetto); - cancellati++; - rimossi++; - } - } - start += SLICE - rimossi; - } while (soggetti.size() > 0); - return cancellati; - } - - private static int svuotaTempistica() throws SystemException, PortalException { - int start = 0; - int cancellati = 0; - List tempistiche = null; - do { - int rimossi = 0; - tempistiche = TempisticaLocalServiceUtil.getTempisticas(start, start + SLICE); - for (Tempistica tempistica : tempistiche) { - if (!esiste(IntPratica.class.getName(), tempistica.getIntPraticaId()) - || !esiste(DettPratica.class.getName(), tempistica.getDettPraticaId())) { - TempisticaLocalServiceUtil.deleteTempistica(tempistica); - cancellati++; - rimossi++; - } - } - start += SLICE - rimossi; - } while (tempistiche.size() > 0); - return cancellati; - } - - private static boolean esiste(String className, long classPK) throws SystemException { - try { - if (className.equalsIgnoreCase(Asseverazione.class.getName())) { - AsseverazioneLocalServiceUtil.getAsseverazione(classPK); - } else if (className.equalsIgnoreCase(Avviso.class.getName())) { - AvvisoLocalServiceUtil.getAvviso(classPK); - } else if (className.equalsIgnoreCase(Collaudo.class.getName())) { - CollaudoLocalServiceUtil.getCollaudo(classPK); - } else if (className.equalsIgnoreCase(Company.class.getName())) { - CompanyLocalServiceUtil.getCompany(classPK); - } else if (className.equalsIgnoreCase(Delega.class.getName())) { - DelegaLocalServiceUtil.getDelega(classPK); - } else if (className.equalsIgnoreCase(DettPratica.class.getName())) { - DettPraticaLocalServiceUtil.getDettPratica(classPK); - } else if (className.equalsIgnoreCase(Email.class.getName())) { - EmailLocalServiceUtil.getEmail(classPK); - } else if (className.equalsIgnoreCase(FineLavori.class.getName())) { - FineLavoriLocalServiceUtil.getFineLavori(classPK); - } else if (className.equalsIgnoreCase(Group.class.getName())) { - GroupLocalServiceUtil.getGroup(classPK); - } else if (className.equalsIgnoreCase(IntPratica.class.getName())) { - IntPraticaLocalServiceUtil.getIntPratica(classPK); - } else if (className.equalsIgnoreCase(LayoutPrototype.class.getName())) { - LayoutPrototypeLocalServiceUtil.getLayoutPrototype(classPK); - } else if (className.equalsIgnoreCase(LayoutSetPrototype.class.getName())) { - LayoutSetPrototypeLocalServiceUtil.getLayoutSetPrototype(classPK); - } else if (className.equalsIgnoreCase(ParereGeologo.class.getName())) { - ParereGeologoLocalServiceUtil.getParereGeologo(classPK); - } else if (className.equalsIgnoreCase(Organization.class.getName())) { - OrganizationLocalServiceUtil.getOrganization(classPK); - } else if (className.equalsIgnoreCase(Soggetto.class.getName())) { - SoggettoLocalServiceUtil.getSoggetto(classPK); - } else if (className.equalsIgnoreCase(User.class.getName())) { - UserLocalServiceUtil.getUser(classPK); - } else if (className.equalsIgnoreCase(UserPersonalSite.class.getName())) { - // Nop - } else { - _log.info("Classe non supportata: " + className); - } - } catch (PortalException e) { - return false; - } - return true; - } - - private static void deleteFileEntry(long fileEntryId) throws SystemException { - try { - DLAppLocalServiceUtil.deleteFileEntry(fileEntryId); - } catch (PortalException e) { - } - } - - private static void esitoLog(List esito, String msg) { - _log.info(msg); - esito.add(msg); - } -} diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/hook/CfOrganizationMembershipPolicy.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/hook/CfOrganizationMembershipPolicy.java index 8ac1f3b4..45e6c75f 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/hook/CfOrganizationMembershipPolicy.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/hook/CfOrganizationMembershipPolicy.java @@ -24,57 +24,62 @@ import com.liferay.portlet.asset.model.AssetTag; public class CfOrganizationMembershipPolicy extends BaseOrganizationMembershipPolicy { - private static Log _log = LogFactoryUtil.getLog(CfOrganizationMembershipPolicy.class); - - @Override - public void checkMembership(long[] userIds, long[] addOrganizationIds, long[] removeOrganizationIds) {} - - @Override - public boolean isMembershipAllowed(long userId, long groupId) { - - try { - Group group = GroupLocalServiceUtil.getGroup(groupId); - Company company = CompanyLocalServiceUtil.getCompany(group.getCompanyId()); - String allowedCF = (String) company.getExpandoBridge().getAttribute(Constants.CF_ORGANIZATION_MEMBERSHIP, false); - - List allowedCFs = Arrays.asList(allowedCF.split("\\,")); - - User user = UserLocalServiceUtil.getUser(userId); - if (allowedCFs.contains(user.getScreenName())) { - return true; - } - - } catch (PortalException | SystemException e) { - _log.error(e, e); - } - - return false; - } - - @Override - public boolean isMembershipRequired(long userId, long groupId) { - return false; - } - - @Override - public boolean isRoleAllowed(long userId, long groupId, long roleId) { - return true; - } - - @Override - public boolean isRoleRequired(long userId, long groupId, long roleId) { - return false; - } - - @Override - public void propagateMembership(long[] userIds, long[] addOrganizationIds, long[] removeOrganizationIds) {} - - @Override - public void verifyPolicy(Organization organization) {} - - @Override - public void verifyPolicy(Organization organization, Organization oldOrganization, - List oldAssetCategories, List oldAssetTags, - Map oldExpandoAttributes) {} + private static Log _log = LogFactoryUtil.getLog(CfOrganizationMembershipPolicy.class); + + @Override + public void checkMembership(long[] userIds, long[] addOrganizationIds, long[] removeOrganizationIds) { + } + + @Override + public boolean isMembershipAllowed(long userId, long groupId) { + + try { + Group group = GroupLocalServiceUtil.getGroup(groupId); + Company company = CompanyLocalServiceUtil.getCompany(group.getCompanyId()); + String allowedCF = (String) company.getExpandoBridge().getAttribute( + Constants.CF_ORGANIZATION_MEMBERSHIP, false); + + List allowedCFs = Arrays.asList(allowedCF.split("\\,")); + + User user = UserLocalServiceUtil.getUser(userId); + if (allowedCFs.contains(user.getScreenName())) { + return true; + } + + } catch (PortalException | SystemException e) { + _log.error(e, e); + } + + return false; + } + + @Override + public boolean isMembershipRequired(long userId, long groupId) { + return false; + } + + @Override + public boolean isRoleAllowed(long userId, long groupId, long roleId) { + return true; + } + + @Override + public boolean isRoleRequired(long userId, long groupId, long roleId) { + return false; + } + + @Override + public void propagateMembership(long[] userIds, long[] addOrganizationIds, long[] removeOrganizationIds) { + } + + @Override + public void verifyPolicy(Organization organization) { + } + + @Override + public void verifyPolicy(Organization organization, Organization oldOrganization, + List oldAssetCategories, List oldAssetTags, + Map oldExpandoAttributes) { + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneAttivitaPortlet.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneAttivitaPortlet.java index f5078e34..d3ea3d80 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneAttivitaPortlet.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/GestioneAttivitaPortlet.java @@ -88,7 +88,7 @@ public class GestioneAttivitaPortlet extends MVCPortlet { String statoPratica = ParamUtil.getString(actionRequest, "statoPratica"); String committente = ParamUtil.getString(actionRequest, "committente"); String soggettiInterconnessi = ParamUtil.getString(actionRequest, "soggettiInterconnessi"); - //ADT BUG BO ID = 8 + // ADT BUG BO ID = 8 String istruttore = ParamUtil.getString(actionRequest, "istruttore"); String dataRichiestaInizio = ParamUtil.getString(actionRequest, "dataRichiestaInizio"); String dataRichiestaFine = ParamUtil.getString(actionRequest, "dataRichiestaFine"); @@ -102,20 +102,20 @@ public class GestioneAttivitaPortlet extends MVCPortlet { actionResponse.setRenderParameter("tabs1", tabs1); actionResponse.setRenderParameter("numeroProgetto", numeroProgetto); actionResponse.setRenderParameter("protocollo", protocollo); - - //ADT - BUG-11 Aggiunta filtro ricerca - if(Validator.isNotNull(tipoPratica)){ - if("co".equalsIgnoreCase(tipoPratica)){ + + // ADT - BUG-11 Aggiunta filtro ricerca + if (Validator.isNotNull(tipoPratica)) { + if ("co".equalsIgnoreCase(tipoPratica)) { tipoPratica = Constants.TIPO_PRATICA_DEPOSITO; actionResponse.setRenderParameter("controlloObbligatorio", Boolean.TRUE.toString()); - } else if("sorteggio".equalsIgnoreCase(tipoPratica)){ + } else if ("sorteggio".equalsIgnoreCase(tipoPratica)) { tipoPratica = Constants.TIPO_PRATICA_DEPOSITO; actionResponse.setRenderParameter("sorteggiata", Boolean.TRUE.toString()); } - + actionResponse.setRenderParameter("tipoPratica", tipoPratica); } - + actionResponse.setRenderParameter("statoPratica", statoPratica); actionResponse.setRenderParameter("committente", committente); actionResponse.setRenderParameter("soggettiInterconnessi", soggettiInterconnessi); @@ -126,20 +126,20 @@ public class GestioneAttivitaPortlet extends MVCPortlet { if (dataRichiestaInizio != null && !dataRichiestaInizio.equals("")) { String[] dataRichiestaInizioSplitted = dataRichiestaInizio.split("/"); - int mounth = Integer.valueOf(dataRichiestaInizioSplitted[1]) -1; + int mounth = Integer.valueOf(dataRichiestaInizioSplitted[1]) - 1; actionResponse.setRenderParameter("dataRichiestaInizioDay", dataRichiestaInizioSplitted[0]); - actionResponse.setRenderParameter("dataRichiestaInizioMonth", mounth+""); + actionResponse.setRenderParameter("dataRichiestaInizioMonth", mounth + ""); actionResponse.setRenderParameter("dataRichiestaInizioYear", dataRichiestaInizioSplitted[2]); } if (dataRichiestaFine != null && !dataRichiestaFine.equals("")) { String[] dataRichiestaFineSplitted = dataRichiestaFine.split("/"); - int mounth = Integer.valueOf(dataRichiestaFineSplitted[1]) -1; + int mounth = Integer.valueOf(dataRichiestaFineSplitted[1]) - 1; actionResponse.setRenderParameter("dataRichiestaFineDay", dataRichiestaFineSplitted[0]); - actionResponse.setRenderParameter("dataRichiestaFineMonth", mounth+""); + actionResponse.setRenderParameter("dataRichiestaFineMonth", mounth + ""); actionResponse.setRenderParameter("dataRichiestaFineYear", dataRichiestaFineSplitted[2]); } @@ -158,7 +158,8 @@ public class GestioneAttivitaPortlet extends MVCPortlet { long istruttoreId = ParamUtil.getLong(actionRequest, "istruttoreId"); try { IntPratica intPratica = IntPraticaServiceUtil.getIntPratica(intPraticaId); - if (Validator.isNotNull(intPratica.getStatusByUserId()) && intPratica.getStatusByUserId() != istruttoreId) { + if (Validator.isNotNull(intPratica.getStatusByUserId()) + && intPratica.getStatusByUserId() != istruttoreId) { IntPraticaServiceUtil.cambiaIstruttore(intPraticaId, controlloPraticaId, istruttoreId); } else { throw new SystemException("cambio istruttore non possibile"); @@ -169,35 +170,45 @@ public class GestioneAttivitaPortlet extends MVCPortlet { } } - // public void assegnamiTask(ActionRequest actionRequest, ActionResponse actionResponse) { + // public void assegnamiTask(ActionRequest actionRequest, ActionResponse + // actionResponse) { // - // long controlloPraticaId = ParamUtil.getLong(actionRequest, "controlloPraticaId"); + // long controlloPraticaId = ParamUtil.getLong(actionRequest, + // "controlloPraticaId"); // long workflowTaskId = ParamUtil.getLong(actionRequest, "workflowTaskId"); // // // try { - // ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest); + // ServiceContext serviceContext = + // ServiceContextFactory.getInstance(actionRequest); // ControlloPratica controlloPratica = // ControlloPraticaLocalServiceUtil.getControlloPratica(controlloPraticaId); // // IntPratica intPratica = // IntPraticaLocalServiceUtil.getIntPratica(controlloPratica.getIntPraticaId()); - // Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId()); + // Territorio territorio = + // TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId()); // IntPraticaPermission.check(PermissionThreadLocal.getPermissionChecker(), // territorio.getGroupId(), // ActionKeys.ASSEGNA_A_ME); // // // WorkflowTask lastWorkflowTask = - // WorkflowUtil.getLastTask(controlloPratica.getCompanyId(), controlloPratica.getGroupId(), null, + // WorkflowUtil.getLastTask(controlloPratica.getCompanyId(), + // controlloPratica.getGroupId(), null, // controlloPratica); - // if (lastWorkflowTask != null && lastWorkflowTask.getWorkflowTaskId() == workflowTaskId + // if (lastWorkflowTask != null && lastWorkflowTask.getWorkflowTaskId() == + // workflowTaskId // && !lastWorkflowTask.getWorkflowTaskAssignees().isEmpty()) { // boolean assegnazionePossibile = false; - // for (WorkflowTaskAssignee workflowTaskAssignee : lastWorkflowTask.getWorkflowTaskAssignees()) { - // if (workflowTaskAssignee.getAssigneeClassName().equalsIgnoreCase(Role.class.getName()) - // && UserGroupRoleLocalServiceUtil.hasUserGroupRole(serviceContext.getUserId(), - // controlloPratica.getGroupId(), workflowTaskAssignee.getAssigneeClassPK(), true)) { + // for (WorkflowTaskAssignee workflowTaskAssignee : + // lastWorkflowTask.getWorkflowTaskAssignees()) { + // if + // (workflowTaskAssignee.getAssigneeClassName().equalsIgnoreCase(Role.class.getName()) + // && + // UserGroupRoleLocalServiceUtil.hasUserGroupRole(serviceContext.getUserId(), + // controlloPratica.getGroupId(), workflowTaskAssignee.getAssigneeClassPK(), + // true)) { // assegnazionePossibile = true; // } // } @@ -207,7 +218,8 @@ public class GestioneAttivitaPortlet extends MVCPortlet { // workflowTaskId, serviceContext.getUserId(), StringPool.BLANK, null, // WorkflowUtil.getWorkflowContext(controlloPratica)); // } else { - // throw new SystemException("assegnazione task non possibile per il ruolo"); + // throw new + // SystemException("assegnazione task non possibile per il ruolo"); // } // } else { // throw new SystemException("assegnazione task non possibile"); @@ -225,14 +237,15 @@ public class GestioneAttivitaPortlet extends MVCPortlet { try { ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest); - ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil.getControlloPratica(controlloPraticaId); - IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(controlloPratica.getIntPraticaId()); + ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil + .getControlloPratica(controlloPraticaId); + IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(controlloPratica + .getIntPraticaId()); Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId()); IntPraticaPermission.check(PermissionThreadLocal.getPermissionChecker(), territorio.getGroupId(), ActionKeys.ASSEGNA_AL_RUOLO); - WorkflowTask lastWorkflowTask = - WorkflowUtil.getLastTask(controlloPratica.getCompanyId(), controlloPratica.getGroupId(), null, - controlloPratica); + WorkflowTask lastWorkflowTask = WorkflowUtil.getLastTask(controlloPratica.getCompanyId(), + controlloPratica.getGroupId(), null, controlloPratica); if (lastWorkflowTask != null && lastWorkflowTask.getWorkflowTaskId() == workflowTaskId && !lastWorkflowTask.getWorkflowTaskAssignees().isEmpty()) { Role role = null; @@ -251,8 +264,9 @@ public class GestioneAttivitaPortlet extends MVCPortlet { break; } - WorkflowTaskManagerUtil.assignWorkflowTaskToRole(controlloPratica.getCompanyId(), serviceContext.getUserId(), - workflowTaskId, role.getRoleId(), StringPool.BLANK, null, WorkflowUtil.getWorkflowContext(controlloPratica)); + WorkflowTaskManagerUtil.assignWorkflowTaskToRole(controlloPratica.getCompanyId(), + serviceContext.getUserId(), workflowTaskId, role.getRoleId(), StringPool.BLANK, null, + WorkflowUtil.getWorkflowContext(controlloPratica)); } else { throw new SystemException("riassegnare al ruolo non possibile"); } @@ -293,8 +307,9 @@ public class GestioneAttivitaPortlet extends MVCPortlet { serviceContext.setCreateDate(new Date()); serviceContext.setModifiedDate(new Date()); if (ParereGeologoLocalServiceUtil.countByIntPraticaIdParereVuoto(intPraticaId) == 0) { - ParereGeologo parereGeologo=ParereGeologoServiceUtil.addParereGeologo(geologoId, intPraticaId, dettPraticaId, serviceContext); - //ADT: aggiunta notifica geologo + ParereGeologo parereGeologo = ParereGeologoServiceUtil.addParereGeologo(geologoId, + intPraticaId, dettPraticaId, serviceContext); + // ADT: aggiunta notifica geologo MailUtil.invioNotificaGeologo(parereGeologo, serviceContext); } else { throw new PortalException("parere geologo gia presente"); @@ -312,20 +327,22 @@ public class GestioneAttivitaPortlet extends MVCPortlet { long intPraticaId = ParamUtil.getLong(actionRequest, "intPraticaId"); long controlloPraticaId = ParamUtil.getLong(actionRequest, "controlloPraticaId"); long lastDettPraticaId = ParamUtil.getLong(actionRequest, "lastDettPraticaId"); - ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil.getControlloPratica(controlloPraticaId); + ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil + .getControlloPratica(controlloPraticaId); IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId); if (lastDettPraticaId != controlloPratica.getDettPraticaId() && intPratica.getStatusByUserId() == serviceContext.getUserId()) { - //ADT: BUG ID=5 - ControlloPraticaLocalServiceUtil.addPraticheAlControlloVarianti(controlloPraticaId, lastDettPraticaId,serviceContext); + // ADT: BUG ID=5 + ControlloPraticaLocalServiceUtil.addPraticheAlControlloVarianti(controlloPraticaId, + lastDettPraticaId, serviceContext); } else { SessionErrors.add(actionRequest, "error-aggiunta-pratiche-al-controllo"); } } @Override - public void serveResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse) throws IOException, - PortletException { + public void serveResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse) + throws IOException, PortletException { ThemeDisplay themeDisplay = (ThemeDisplay) resourceRequest.getAttribute(WebKeys.THEME_DISPLAY); Locale locale = themeDisplay.getLocale(); @@ -344,19 +361,21 @@ public class GestioneAttivitaPortlet extends MVCPortlet { csv = exportToCSV(locale, resourceRequest, true, user); } else if (cmd.equals("po")) { csv = exportToCSV(locale, resourceRequest, false, user); - } else if (cmd.equals("exportRicercaMieAttivita") || cmd.equals("exportRicercaMieiRuoli") || cmd.equals("exportRicercaAltreAttivita") || cmd.equals("exportRicercaAttivitaConcluse")) { + } else if (cmd.equals("exportRicercaMieAttivita") || cmd.equals("exportRicercaMieiRuoli") + || cmd.equals("exportRicercaAltreAttivita") || cmd.equals("exportRicercaAttivitaConcluse")) { csv = exportSearch(locale, resourceRequest, user, cmd); - } - //ADT BUG BO ID= 1 SEZIONE ATTIVIT� + } + // ADT BUG BO ID= 1 SEZIONE ATTIVITÀ if ("comuniForUfficio".equals(id)) { String ufficio = ParamUtil.getString(resourceRequest, "ufficioId"); JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); List comuni; if (Validator.isNotNull(ufficio) && !ufficio.equals("0")) { try { - if(!ufficio.equals("-1")){ + if (!ufficio.equals("-1")) { long ufficioId = Long.parseLong(ufficio); - comuni = ComuneLocalServiceUtil.getComuniForOrganizationByUserIdUfficioId(user.getUserId(), ufficioId); + comuni = ComuneLocalServiceUtil.getComuniForOrganizationByUserIdUfficioId( + user.getUserId(), ufficioId); for (Comune comune : comuni) { JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); jsonObject.put("comuneId", comune.getComuneId()); @@ -379,13 +398,12 @@ public class GestioneAttivitaPortlet extends MVCPortlet { } - catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } - } + } } ServletResponseUtil.sendFile(request, response, "export_pratiche.csv", csv.getBytes(StringPool.UTF8), @@ -394,7 +412,6 @@ public class GestioneAttivitaPortlet extends MVCPortlet { // super.serveResource(resourceRequest, resourceResponse); } - private String exportSearch(Locale locale, ResourceRequest resourceRequest, User user, String cmd) { HttpServletRequest httpRequest = PortalUtil.getHttpServletRequest(resourceRequest); @@ -406,14 +423,14 @@ public class GestioneAttivitaPortlet extends MVCPortlet { Hits hits = null; - if(cmd.equals("exportRicercaMieAttivita")){ - hits = ControlloPraticaAdvancedSearch.searchMieiTask(httpRequest, user, -1, -1); - } else if(cmd.equals("exportRicercaMieiRuoli")){ - hits = ControlloPraticaAdvancedSearch.searchTaskMieiRuoli(httpRequest, user, -1, -1); - } else if(cmd.equals("exportRicercaAltreAttivita")){ - hits = ControlloPraticaAdvancedSearch.searchAltriTask(httpRequest, user, -1, -1); - } else if(cmd.equals("exportRicercaAttivitaConcluse")){ - hits = ControlloPraticaAdvancedSearch.searchTaskConclusi(httpRequest, user, -1, -1); + if (cmd.equals("exportRicercaMieAttivita")) { + hits = ControlloPraticaAdvancedSearch.searchMieiTask(httpRequest, user, -1, -1); + } else if (cmd.equals("exportRicercaMieiRuoli")) { + hits = ControlloPraticaAdvancedSearch.searchTaskMieiRuoli(httpRequest, user, -1, -1); + } else if (cmd.equals("exportRicercaAltreAttivita")) { + hits = ControlloPraticaAdvancedSearch.searchAltriTask(httpRequest, user, -1, -1); + } else if (cmd.equals("exportRicercaAttivitaConcluse")) { + hits = ControlloPraticaAdvancedSearch.searchTaskConclusi(httpRequest, user, -1, -1); } for (Document doc : hits.toList()) { @@ -421,8 +438,8 @@ public class GestioneAttivitaPortlet extends MVCPortlet { String controlloPraticaId = doc.get("controlloPraticaId"); if (Validator.isNotNull(controlloPraticaId)) { - ControlloPratica controlloPratica = - ControlloPraticaLocalServiceUtil.fetchControlloPratica(GetterUtil.getLong(controlloPraticaId)); + ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil + .fetchControlloPratica(GetterUtil.getLong(controlloPraticaId)); if (Validator.isNotNull(controlloPratica)) { lista.add(controlloPratica); } @@ -430,60 +447,72 @@ public class GestioneAttivitaPortlet extends MVCPortlet { } - sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.attivita"))); + sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, + "label.scadenzegeniocivile.attivita"))); sb.append(StringPool.SEMICOLON); - sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.esito"))); + sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, + "label.scadenzegeniocivile.esito"))); sb.append(StringPool.SEMICOLON); - - //ADT - BUG-13 Aggiunta colonna Data Esito - //Bug 33264 - if(cmd.equals("exportRicercaAttivitaConcluse")){ - sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.dataesito"))); + + // ADT - BUG-13 Aggiunta colonna Data Esito + // Bug 33264 + if (cmd.equals("exportRicercaAttivitaConcluse")) { + sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, + "label.scadenzegeniocivile.dataesito"))); sb.append(StringPool.SEMICOLON); } - - sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.sorteggiata"))); + + sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, + "label.scadenzegeniocivile.sorteggiata"))); sb.append(StringPool.SEMICOLON); - sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.pratica"))); + sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, + "label.scadenzegeniocivile.pratica"))); sb.append(StringPool.SEMICOLON); - sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.istruttore"))); + sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, + "label.scadenzegeniocivile.istruttore"))); sb.append(StringPool.SEMICOLON); - sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.provenienza"))); + sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, + "label.scadenzegeniocivile.provenienza"))); sb.append(StringPool.SEMICOLON); - sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.avvioprocedimento"))); + sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, + "label.scadenzegeniocivile.avvioprocedimento"))); sb.append(StringPool.SEMICOLON); - sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.provincia"))); + sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, + "label.scadenzegeniocivile.provincia"))); sb.append(StringPool.SEMICOLON); - sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.gg"))); + sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, + "label.scadenzegeniocivile.gg"))); sb.append(StringPool.SEMICOLON); sb.append(StringPool.NEW_LINE); - SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); for (ControlloPratica controlloPratica : lista) { - IntPratica intPratica = IntPraticaLocalServiceUtil.fetchIntPratica(controlloPratica.getIntPraticaId()); + IntPratica intPratica = IntPraticaLocalServiceUtil.fetchIntPratica(controlloPratica + .getIntPraticaId()); - Territorio territorio = TerritorioLocalServiceUtil.fetchTerritorio(intPratica.getTerritorioId()); + Territorio territorio = TerritorioLocalServiceUtil.fetchTerritorio(intPratica + .getTerritorioId()); Comune comune = ComuneLocalServiceUtil.fetchComune(territorio.getComuneId()); - Provincia provincia = - ProvinciaLocalServiceUtil.fetchByC_C(territorio.getCompanyId(), territorio.getCodiceProvincia()); + Provincia provincia = ProvinciaLocalServiceUtil.fetchByC_C(territorio.getCompanyId(), + territorio.getCodiceProvincia()); // Informazioni relative al workflow - WorkflowInstanceLink workflowInstanceLink = - WorkflowInstanceLinkLocalServiceUtil.fetchWorkflowInstanceLink(controlloPratica.getCompanyId(), - controlloPratica.getGroupId(), ControlloPratica.class.getName(), controlloPratica.getPrimaryKey()); + WorkflowInstanceLink workflowInstanceLink = WorkflowInstanceLinkLocalServiceUtil + .fetchWorkflowInstanceLink(controlloPratica.getCompanyId(), + controlloPratica.getGroupId(), ControlloPratica.class.getName(), + controlloPratica.getPrimaryKey()); long workflowInstanceId = workflowInstanceLink.getWorkflowInstanceId(); - WorkflowInstance workflowInstance = - WorkflowInstanceManagerUtil.getWorkflowInstance(controlloPratica.getCompanyId(), workflowInstanceId); + WorkflowInstance workflowInstance = WorkflowInstanceManagerUtil.getWorkflowInstance( + controlloPratica.getCompanyId(), workflowInstanceId); - List listaTask = - WorkflowTaskManagerUtil.getWorkflowTasksByWorkflowInstance(controlloPratica.getCompanyId(), null, - workflowInstance.getWorkflowInstanceId(), false, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); + List listaTask = WorkflowTaskManagerUtil.getWorkflowTasksByWorkflowInstance( + controlloPratica.getCompanyId(), null, workflowInstance.getWorkflowInstanceId(), + false, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); WorkflowTask task = null; if (listaTask != null && !listaTask.isEmpty()) { @@ -493,30 +522,33 @@ public class GestioneAttivitaPortlet extends MVCPortlet { String taskName = StringPool.BLANK; if (task != null) { User userTask = UserLocalServiceUtil.fetchUser(task.getAssigneeUserId()); - //Bug 33264 + // Bug 33264 taskName = LanguageUtil.get(getPortletConfig(), locale, task.getName()); if (userTask != null) { taskName += " (" + userTask.getFullName() + ")"; } } else { - //Bug 33264 + // Bug 33264 taskName = LanguageUtil.get(getPortletConfig(), locale, workflowInstance.getState()); } sb.append(CSVUtil.encode(taskName)); sb.append(StringPool.SEMICOLON); - String tipoEsito = ControlloPraticaLocalServiceUtil.getTipoEsito(controlloPratica.getControlloPraticaId()); + String tipoEsito = ControlloPraticaLocalServiceUtil.getTipoEsito(controlloPratica + .getControlloPraticaId()); sb.append(CSVUtil.encode(tipoEsito)); sb.append(StringPool.SEMICOLON); - - //ADT - BUG-13 Aggiunta colonna Data Esito - //Bug 33264 - if(cmd.equals("exportRicercaAttivitaConcluse")){ - sb.append(CSVUtil.encode(controlloPratica.getStatusDate() != null ? sdf.format(controlloPratica.getStatusDate()) : "" )); + + // ADT - BUG-13 Aggiunta colonna Data Esito + // Bug 33264 + if (cmd.equals("exportRicercaAttivitaConcluse")) { + sb.append(CSVUtil.encode(controlloPratica.getStatusDate() != null ? sdf + .format(controlloPratica.getStatusDate()) : "")); sb.append(StringPool.SEMICOLON); } - boolean sorteggiata = SorteggioLocalServiceUtil.findByIntPratica(intPratica.getIntPraticaId()) != null; + boolean sorteggiata = SorteggioLocalServiceUtil + .findByIntPratica(intPratica.getIntPraticaId()) != null; sb.append(CSVUtil.encode((sorteggiata) ? "Si" : "No")); sb.append(StringPool.SEMICOLON); @@ -537,9 +569,9 @@ public class GestioneAttivitaPortlet extends MVCPortlet { sb.append(StringPool.SEMICOLON); StringBuilder provenienzaLabel = new StringBuilder(); - WorkflowTask workflowTask = - WorkflowUtil.getLastCompletedTask(controlloPratica.getCompanyId(), controlloPratica.getGroupId(), null, - controlloPratica); + WorkflowTask workflowTask = WorkflowUtil.getLastCompletedTask( + controlloPratica.getCompanyId(), controlloPratica.getGroupId(), null, + controlloPratica); if (workflowTask != null) { User approvatore = UserLocalServiceUtil.fetchUser(workflowTask.getAssigneeUserId()); @@ -597,38 +629,45 @@ public class GestioneAttivitaPortlet extends MVCPortlet { List listaControlloPratica = new ArrayList(); if (dirigente) { - listaControlloPratica = - ControlloPraticaAdvancedSearch.searchTaskPerEsportazioneDirigente(httpRequest, user, QueryUtil.ALL_POS, - QueryUtil.ALL_POS); + listaControlloPratica = ControlloPraticaAdvancedSearch.searchTaskPerEsportazioneDirigente( + httpRequest, user, QueryUtil.ALL_POS, QueryUtil.ALL_POS); } else { - listaControlloPratica = - ControlloPraticaAdvancedSearch.searchTaskPerEsportazionePO(httpRequest, user, QueryUtil.ALL_POS, - QueryUtil.ALL_POS); + listaControlloPratica = ControlloPraticaAdvancedSearch.searchTaskPerEsportazionePO(httpRequest, + user, QueryUtil.ALL_POS, QueryUtil.ALL_POS); } - sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.attivita"))); + sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, + "label.scadenzegeniocivile.attivita"))); sb.append(StringPool.SEMICOLON); - sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.esito"))); + sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, + "label.scadenzegeniocivile.esito"))); sb.append(StringPool.SEMICOLON); - - //ADT - BUG-13 Aggiunta colonna Data Esito - //Bug 33264 - if("Tab_TaskCompletati".equals(currentTab)){ - sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.dataesito"))); + + // ADT - BUG-13 Aggiunta colonna Data Esito + // Bug 33264 + if ("Tab_TaskCompletati".equals(currentTab)) { + sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, + "label.scadenzegeniocivile.dataesito"))); sb.append(StringPool.SEMICOLON); } - - sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.sorteggiata"))); + + sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, + "label.scadenzegeniocivile.sorteggiata"))); sb.append(StringPool.SEMICOLON); - sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.pratica"))); + sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, + "label.scadenzegeniocivile.pratica"))); sb.append(StringPool.SEMICOLON); - sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.istruttore"))); + sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, + "label.scadenzegeniocivile.istruttore"))); sb.append(StringPool.SEMICOLON); - sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.provenienza"))); + sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, + "label.scadenzegeniocivile.provenienza"))); sb.append(StringPool.SEMICOLON); - sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.avvioprocedimento"))); + sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, + "label.scadenzegeniocivile.avvioprocedimento"))); sb.append(StringPool.SEMICOLON); - sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.provincia"))); + sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, + "label.scadenzegeniocivile.provincia"))); sb.append(StringPool.SEMICOLON); sb.append(CSVUtil.encode(LanguageUtil.get(getPortletConfig(), locale, "label.scadenzegeniocivile.gg"))); sb.append(StringPool.SEMICOLON); @@ -641,26 +680,29 @@ public class GestioneAttivitaPortlet extends MVCPortlet { for (ControlloPratica controlloPratica : listaControlloPratica) { - IntPratica intPratica = IntPraticaLocalServiceUtil.fetchIntPratica(controlloPratica.getIntPraticaId()); + IntPratica intPratica = IntPraticaLocalServiceUtil.fetchIntPratica(controlloPratica + .getIntPraticaId()); - Territorio territorio = TerritorioLocalServiceUtil.fetchTerritorio(intPratica.getTerritorioId()); + Territorio territorio = TerritorioLocalServiceUtil.fetchTerritorio(intPratica + .getTerritorioId()); Comune comune = ComuneLocalServiceUtil.fetchComune(territorio.getComuneId()); - Provincia provincia = - ProvinciaLocalServiceUtil.fetchByC_C(territorio.getCompanyId(), territorio.getCodiceProvincia()); + Provincia provincia = ProvinciaLocalServiceUtil.fetchByC_C(territorio.getCompanyId(), + territorio.getCodiceProvincia()); // Informazioni relative al workflow - WorkflowInstanceLink workflowInstanceLink = - WorkflowInstanceLinkLocalServiceUtil.fetchWorkflowInstanceLink(controlloPratica.getCompanyId(), - controlloPratica.getGroupId(), ControlloPratica.class.getName(), controlloPratica.getPrimaryKey()); + WorkflowInstanceLink workflowInstanceLink = WorkflowInstanceLinkLocalServiceUtil + .fetchWorkflowInstanceLink(controlloPratica.getCompanyId(), + controlloPratica.getGroupId(), ControlloPratica.class.getName(), + controlloPratica.getPrimaryKey()); long workflowInstanceId = workflowInstanceLink.getWorkflowInstanceId(); - WorkflowInstance workflowInstance = - WorkflowInstanceManagerUtil.getWorkflowInstance(controlloPratica.getCompanyId(), workflowInstanceId); + WorkflowInstance workflowInstance = WorkflowInstanceManagerUtil.getWorkflowInstance( + controlloPratica.getCompanyId(), workflowInstanceId); - List listaTask = - WorkflowTaskManagerUtil.getWorkflowTasksByWorkflowInstance(controlloPratica.getCompanyId(), null, - workflowInstance.getWorkflowInstanceId(), false, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); + List listaTask = WorkflowTaskManagerUtil.getWorkflowTasksByWorkflowInstance( + controlloPratica.getCompanyId(), null, workflowInstance.getWorkflowInstanceId(), + false, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); WorkflowTask task = null; if (listaTask != null && !listaTask.isEmpty()) { @@ -680,18 +722,20 @@ public class GestioneAttivitaPortlet extends MVCPortlet { sb.append(CSVUtil.encode(taskName)); sb.append(StringPool.SEMICOLON); - String tipoEsito = ControlloPraticaLocalServiceUtil.getTipoEsito(controlloPratica.getControlloPraticaId()); + String tipoEsito = ControlloPraticaLocalServiceUtil.getTipoEsito(controlloPratica + .getControlloPraticaId()); sb.append(CSVUtil.encode(tipoEsito)); sb.append(StringPool.SEMICOLON); - //ADT - BUG-13 Aggiunta colonna Data Esito - //Bug 33264 - if("Tab_TaskCompletati".equals(currentTab)){ + // ADT - BUG-13 Aggiunta colonna Data Esito + // Bug 33264 + if ("Tab_TaskCompletati".equals(currentTab)) { sb.append(CSVUtil.encode(sdf.format(controlloPratica.getStatusDate()))); sb.append(StringPool.SEMICOLON); } - - boolean sorteggiata = SorteggioLocalServiceUtil.findByIntPratica(intPratica.getIntPraticaId()) != null; + + boolean sorteggiata = SorteggioLocalServiceUtil + .findByIntPratica(intPratica.getIntPraticaId()) != null; sb.append(CSVUtil.encode((sorteggiata) ? "Si" : "No")); sb.append(StringPool.SEMICOLON); @@ -712,9 +756,9 @@ public class GestioneAttivitaPortlet extends MVCPortlet { sb.append(StringPool.SEMICOLON); StringBuilder provenienzaLabel = new StringBuilder(); - WorkflowTask workflowTask = - WorkflowUtil.getLastCompletedTask(controlloPratica.getCompanyId(), controlloPratica.getGroupId(), null, - controlloPratica); + WorkflowTask workflowTask = WorkflowUtil.getLastCompletedTask( + controlloPratica.getCompanyId(), controlloPratica.getGroupId(), null, + controlloPratica); if (workflowTask != null) { User approvatore = UserLocalServiceUtil.fetchUser(workflowTask.getAssigneeUserId()); diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/SismicaAdministrationPortlet.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/SismicaAdministrationPortlet.java index 96f449ac..46f39ea6 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/SismicaAdministrationPortlet.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/SismicaAdministrationPortlet.java @@ -3,7 +3,7 @@ package it.tref.liferay.portos.bo.portlet; import it.mwg.sismica.bo.util.AllegatiUtil; import it.mwg.sismica.bo.util.SismicaUtil; import it.mwg.sismica.bo.util.SorteggioPraticaUtil; -import it.mwg.sismica.bo.util.SvuotaDatabase; +import it.mwg.sismica.bo.util.ManutenzioneDatabase; import it.tref.liferay.portos.bo.service.ConfigurazioneServiceUtil; import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil; @@ -116,10 +116,11 @@ public class SismicaAdministrationPortlet extends MVCPortlet { actionResponse.setRenderParameter("esito", esito.toArray(new String[esito.size()])); } - public void testInterno(ActionRequest actionRequest, ActionResponse actionResponse) + public void manutenzioneDatabase(ActionRequest actionRequest, ActionResponse actionResponse) throws PortalException, SystemException { + String mode = ParamUtil.getString(actionRequest, "mode"); ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest); - List esito = SvuotaDatabase.pulisci(serviceContext); + List esito = ManutenzioneDatabase.pulisci(serviceContext, mode); actionResponse.setRenderParameter("esito", esito.toArray(new String[esito.size()])); } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/scheduler/SchedulerInvioDocumento.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/scheduler/SchedulerInvioDocumento.java index 5cee6adc..cedad8d6 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/scheduler/SchedulerInvioDocumento.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/scheduler/SchedulerInvioDocumento.java @@ -40,8 +40,10 @@ import java.io.Serializable; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Set; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; @@ -371,16 +373,16 @@ public class SchedulerInvioDocumento implements MessageListener { dettPratica.getCodiceFiscalePrincipaleCommittente(), TipoSoggettoUtil.COMMITTENTE); if (null == committentePrincipale) { - _log.error("inviaMailNotifica: il committente principale non esiste, intPraticaId = " - + intPraticaId); + _log.error("Il committente principale non esiste, intPraticaId = " + intPraticaId); } else { soggetti.remove(committentePrincipale); } - String[] to = new String[soggetti.size()]; - for (int i = 0; i < to.length; i++) { - to[i] = soggetti.get(i).getEmail(); + Set sTo = new HashSet<>(); + for (Soggetto soggetto : soggetti) { + sTo.add(soggetto.getEmail()); } + String[] to = sTo.toArray(new String[sTo.size()]); String[] cc = new String[0]; String[] ccn = new String[0]; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AsseverazioneLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AsseverazioneLocalServiceImpl.java index f9dc9c0c..23954c94 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AsseverazioneLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AsseverazioneLocalServiceImpl.java @@ -206,7 +206,7 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase } boolean agAlto = (dettPratica.getTcAdeguamentoSismico() || dettPratica.getTcMiglioramentoSismico()) - && (territorio.getZona().equals("1") || (territorio.getZona().equals("2") && (ag >= 0.2) && (ag <= 0.25))); + && (territorio.getZona().equals("1") || (territorio.getZona().equals("2") && (ag >= 0.2))); boolean complesse = dettPratica.getTcNuovaCostruzioneComplessa(); @@ -539,14 +539,11 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase @Override public Asseverazione deleteAsseverazione(Asseverazione asseverazione) throws SystemException { - try { - if (Validator.isNotNull(asseverazione.getFileEntryId())) { + if (Validator.isNotNull(asseverazione.getFileEntryId())) { + try { dlAppLocalService.deleteFileEntry(asseverazione.getFileEntryId()); + } catch (PortalException e) { } - } catch (NoSuchFileEntryException | NoSuchRepositoryEntryException e) { - - } catch (PortalException e) { - throw new SystemException(e); } return super.deleteAsseverazione(asseverazione); } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AvvisoLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AvvisoLocalServiceImpl.java index 4bbe83b1..370a211d 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AvvisoLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AvvisoLocalServiceImpl.java @@ -995,16 +995,6 @@ public class AvvisoLocalServiceImpl extends AvvisoLocalServiceBaseImpl { public String getFileNameAvviso(long classPk, String tipoDocumento, Long idAvviso, String doc) { - // boolean docBase, boolean docFirma, boolean docControfirma - // String doc = StringPool.BLANK; - // if (docBase) { - // doc = "B"; - // } else if (docFirma) { - // doc = "F"; - // } else if (docControfirma) { - // doc = "C"; - // } - String filename = StringUtils.leftPad(String.valueOf(classPk), 10, '0') + (Validator.isNotNull(tipoDocumento) ? StringPool.UNDERLINE + tipoDocumento : StringPool.BLANK) + StringPool.UNDERLINE + doc + StringPool.UNDERLINE diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ComuneLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ComuneLocalServiceImpl.java index 40782a75..e73c32cc 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ComuneLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ComuneLocalServiceImpl.java @@ -332,7 +332,7 @@ public class ComuneLocalServiceImpl extends ComuneLocalServiceBaseImpl { return comuni; } - //ADT BUG BO ID = 1 SEZIONE ATTIVIT� + //ADT BUG BO ID = 1 SEZIONE ATTIVITÀ public List getComuniForOrganizationByUserIdUfficioId(long userId, long ufficioId) throws SystemException { List comuni = new ArrayList(); diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ControlloPraticaLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ControlloPraticaLocalServiceImpl.java index 0d7231cd..f6ef59b2 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ControlloPraticaLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ControlloPraticaLocalServiceImpl.java @@ -746,13 +746,19 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi public Long calculateDateAvvioProcedimento(long controlloPraticaId) throws SystemException, PortalException { + ControlloPratica controllo = ControlloPraticaLocalServiceUtil .fetchControlloPratica(controlloPraticaId); + IntPratica pratica = IntPraticaLocalServiceUtil.fetchIntPratica(controllo.getIntPraticaId()); + + if (pratica.getStatoPratica().equalsIgnoreCase(StatoPraticaConstants.AUTORIZZATA)) { + return 0L; + } Date apertura = pratica.getDtPratica(); Date chiusura = null; - long stop = 0; + long stop = 0L; List avvisi = AvvisoLocalServiceUtil.findByIntPratica(pratica.getIntPraticaId(), QueryUtil.ALL_POS, QueryUtil.ALL_POS, OrderByComparatorFactoryUtil @@ -764,35 +770,39 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi for (Avviso avviso : avvisi) { if (!avviso.isAnnullato()) { String tipo = avviso.getTipoDocumento().toUpperCase(); - _log.debug("Avviso " + avviso.getTipoDocumento() + " " + avviso.getDtAvviso() + " " - + avviso.getCreateDate()); - if (tipo.equals(StatoPraticaConstants.INTEGRAZIONE)) { + _log.debug("Avviso " + tipo + " " + avviso.getDtAvviso() + " " + avviso.getCreateDate()); + switch (tipo) { + case StatoPraticaConstants.INTEGRAZIONE: start = avviso.getCreateDate(); end = null; if (Validator.isNotNull(chiusura)) { apertura = avviso.getDtAvviso(); chiusura = null; - stop = 0; + stop = 0L; _log.debug("Reset apertura al " + apertura); } _log.debug("IN start = " + start + ", pratica " + pratica.getNumeroProgetto()); - } else if (tipo.equals(StatoPraticaConstants.VIDIMATA)) { + break; + case StatoPraticaConstants.VIDIMATA: if (Validator.isNull(chiusura)) { end = avviso.getCreateDate(); _log.debug(tipo + " end = " + end + ", pratica " + pratica.getNumeroProgetto()); } else { apertura = avviso.getDtAvviso(); chiusura = start = end = null; - stop = 0; + stop = 0L; _log.debug("Reset apertura al " + apertura); } - } else if (tipo.equals(StatoPraticaConstants.INTEGRAZIONE_ACCETTATA)) { + break; + case StatoPraticaConstants.INTEGRAZIONE_ACCETTATA: end = avviso.getCreateDate(); _log.debug(tipo + " end = " + end + ", pratica " + pratica.getNumeroProgetto()); - } else if (tipo.equals(StatoPraticaConstants.AUTORIZZATA) - || tipo.equals(StatoPraticaConstants.NON_AUTORIZZATA)) { + break; + case StatoPraticaConstants.AUTORIZZATA: + case StatoPraticaConstants.NON_AUTORIZZATA: chiusura = avviso.getCreateDate(); _log.debug("Chiusura al " + chiusura); + break; } } if (Validator.isNotNull(start) && Validator.isNotNull(end)) { diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DelegaLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DelegaLocalServiceImpl.java index b211e1c8..6085ee90 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DelegaLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DelegaLocalServiceImpl.java @@ -133,8 +133,6 @@ public class DelegaLocalServiceImpl extends DelegaLocalServiceBaseImpl { @Override public Delega deleteDelega(Delega delega) throws SystemException { - // TODO cancellare il file quando ci sar� - return super.deleteDelega(delega); } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DettPraticaLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DettPraticaLocalServiceImpl.java index ec1bb5f4..ee273c97 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DettPraticaLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DettPraticaLocalServiceImpl.java @@ -113,7 +113,7 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl User user = userLocalService.getUser(serviceContext.getUserId()); Date now = new Date(); - + DettPratica dettPratica = dettPraticaLocalService.createDettPratica(counterLocalService .increment(DettPratica.class.getName())); @@ -179,7 +179,7 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl String tipoIntegrazione, ServiceContext serviceContext) throws PortalException, SystemException { IntPratica intPratica = intPraticaLocalService.getIntPratica(intPraticaId); - + DettPratica dettPratica = initDettPratica(serviceContext); dettPratica = dettPraticaPersistence.update(dettPratica); DettPratica dettPraticaToClone = dettPraticaPersistence.findByPrimaryKey(dettPraticaToCloneId); @@ -284,8 +284,8 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl dettPraticaToClone.getNormLTC01(), dettPraticaToClone.getSuap(), dettPraticaToClone.getNormSismaBonus(), dettPraticaToClone.getClRischioPreInt(), dettPraticaToClone.getClRischioPostInt(), dettPraticaToClone.getIntervFinPub(), - dettPraticaToClone.getIntervFinPubDesc(), dettPraticaToClone.getTcNuovaCostruzioneComplessa(), - serviceContext, true); + dettPraticaToClone.getIntervFinPubDesc(), + dettPraticaToClone.getTcNuovaCostruzioneComplessa(), serviceContext, true); copy = updateDettPraticaGeologo(copy.getUserId(), copy.getDettPraticaId(), copy.getIntPraticaId(), dettPraticaToClone.getGeoClasseIndagine(), dettPraticaToClone.getGeoCategoriaSottosuolo(), @@ -554,7 +554,10 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl List soggetti = soggettoLocalService.findByDettPratica(dettPratica.getDettPraticaId()); for (Soggetto soggetto : soggetti) { - soggettoLocalService.deleteSoggetto(soggetto); + try { + soggettoLocalService.deleteSoggetto(soggetto); + } catch (PortalException e) { + } } List allegati = docPraticaLocalService.findByClassPk(dettPratica.getDettPraticaId()); @@ -576,7 +579,10 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl List pagamenti = pagamentoLocalService.findByClassPk(dettPratica.getDettPraticaId()); for (Pagamento pagamento : pagamenti) { - pagamentoLocalService.deletePagamento(pagamento); + try { + pagamentoLocalService.deletePagamento(pagamento); + } catch (PortalException e) { + } } return super.deleteDettPratica(dettPratica); } @@ -716,8 +722,9 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl boolean normDprg01, boolean normDprg02, boolean normAnr, boolean normArt3com3, boolean normArt3com4, boolean normOrd01, boolean normDm04, boolean normDm05, boolean normCI01, boolean normLTC01, boolean suap, boolean normSismaBonus, String clRischioPreInt, - String clRischioPostInt, boolean intervFinPub, String intervFinPubDesc, boolean tcNuovaCostruzioneComplessa, - ServiceContext serviceContext, boolean bozza) throws PortalException, SystemException { + String clRischioPostInt, boolean intervFinPub, String intervFinPubDesc, + boolean tcNuovaCostruzioneComplessa, ServiceContext serviceContext, boolean bozza) + throws PortalException, SystemException { Date now = new Date(); @@ -772,7 +779,8 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl normEsenteSpese, normDpr01Dep, normDpr02Dep, normDpr01Aut, normDpr02Aut, normDm01, normDm02, normDm03, normDm2018, normDprg01, normDprg02, normAnr, normArt3com3, normArt3com4, normOrd01, normDm04, normDm05, normCI01, normLTC01, suap, normSismaBonus, clRischioPreInt, - clRischioPostInt, intervFinPub, intervFinPubDesc, tcNuovaCostruzioneComplessa, serviceContext, bozza); + clRischioPostInt, intervFinPub, intervFinPubDesc, tcNuovaCostruzioneComplessa, + serviceContext, bozza); DettPratica dettPratica = dettPraticaPersistence.fetchByPrimaryKey(dettPraticaId); @@ -1041,8 +1049,8 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl boolean normDprg02, boolean normAnr, boolean normArt3com3, boolean normArt3com4, boolean normOrd01, boolean normDm04, boolean normDm05, boolean normCI01, boolean normLTC01, boolean suap, boolean normSismaBonus, String clRischioPreInt, String clRischioPostInt, - boolean intervFinPub, String intervFinPubDesc, boolean tcNuovaCostruzioneComplessa, ServiceContext serviceContext, boolean bozza) - throws PortalException, SystemException { + boolean intervFinPub, String intervFinPubDesc, boolean tcNuovaCostruzioneComplessa, + ServiceContext serviceContext, boolean bozza) throws PortalException, SystemException { Date now = new Date(); @@ -1076,7 +1084,8 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl normEsenteSpese, normDpr01Dep, normDpr02Dep, normDpr01Aut, normDpr02Aut, normDm01, normDm02, normDm03, normDm2018, normDprg01, normDprg02, normAnr, normArt3com3, normArt3com4, normOrd01, normDm04, normDm05, normCI01, normLTC01, suap, normSismaBonus, clRischioPreInt, - clRischioPostInt, intervFinPub, intervFinPubDesc, tcNuovaCostruzioneComplessa, serviceContext, bozza); + clRischioPostInt, intervFinPub, intervFinPubDesc, tcNuovaCostruzioneComplessa, + serviceContext, bozza); DettPratica dettPratica = dettPraticaPersistence.fetchByPrimaryKey(dettPraticaId); @@ -1281,7 +1290,8 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl boolean normDprg02, boolean normAnr, boolean normArt3com3, boolean normArt3com4, boolean normOrd01, boolean normDm04, boolean normDm05, boolean normCI01, boolean normLTC01, boolean suap, boolean normSismaBonus, String clRischioPreInt, String clRischioPostInt, - boolean intervFinPub, String intervFinPubDesc, boolean tcNuovaCostruzioneComplessa, ServiceContext serviceContext, boolean bozza) { + boolean intervFinPub, String intervFinPubDesc, boolean tcNuovaCostruzioneComplessa, + ServiceContext serviceContext, boolean bozza) { // TODO Auto-generated method stub @@ -1745,8 +1755,8 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl boolean normDprg01, boolean normDprg02, boolean normAnr, boolean normArt3com3, boolean normArt3com4, boolean normOrd01, boolean normDm04, boolean normDm05, boolean normCI01, boolean normLTC01, boolean suap, boolean normSismaBonus, String clRischioPreInt, - String clRischioPostInt, boolean intervFinPub, String intervFinPubDesc, boolean tcNuovaCostruzioneComplessa, - ServiceContext serviceContext, boolean bozza) { + String clRischioPostInt, boolean intervFinPub, String intervFinPubDesc, + boolean tcNuovaCostruzioneComplessa, ServiceContext serviceContext, boolean bozza) { // TODO Auto-generated method stub @@ -2003,7 +2013,7 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl // } else { // tagNames.add(TagsPraticaValue.getTagsLabelMap().get(StatoPraticaConstants.RIFIUTATA)); // } - // // pratica indica se � stata variata + // // pratica indica se è stata variata // if (intPratica.getVariataDa() != 0l) { // tagNames.add(TagsPraticaValue.getTagsLabelMap().get(StatoPraticaConstants.VARIATA)); // } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DettPraticaServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DettPraticaServiceImpl.java index e8d11184..1ea652fd 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DettPraticaServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DettPraticaServiceImpl.java @@ -184,12 +184,11 @@ public class DettPraticaServiceImpl extends DettPraticaServiceBaseImpl { boolean normDprg01, boolean normDprg02, boolean normAnr, boolean normArt3com3, boolean normArt3com4, boolean normOrd01, boolean normDm04, boolean normDm05, boolean normCI01, boolean normLTC01, boolean suap, boolean normSismaBonus, String clRischioPreInt, - String clRischioPostInt, boolean intervFinPub, String intervFinPubDesc, boolean tcNuovaCostruzioneComplessa, - ServiceContext serviceContext, boolean bozza, boolean disabledSubmit, boolean geoDisabledSubmit) - throws PortalException, SystemException { + String clRischioPostInt, boolean intervFinPub, String intervFinPubDesc, + boolean tcNuovaCostruzioneComplessa, ServiceContext serviceContext, boolean bozza, + boolean disabledSubmit, boolean geoDisabledSubmit) throws PortalException, SystemException { DettPratica dettPratica = null; - if (!disabledSubmit && DelegheUtil.hasDelegaCompilazioneDomanda(userId, dettPraticaId)) { dettPratica = dettPraticaLocalService.updateDettPraticaDatiDomanda(userId, dettPraticaId, @@ -227,8 +226,8 @@ public class DettPraticaServiceImpl extends DettPraticaServiceBaseImpl { normEsenteSpese, normDpr01Dep, normDpr02Dep, normDpr01Aut, normDpr02Aut, normDm01, normDm02, normDm03, normDm2018, normDprg01, normDprg02, normAnr, normArt3com3, normArt3com4, normOrd01, normDm04, normDm05, normCI01, normLTC01, suap, normSismaBonus, - clRischioPreInt, clRischioPostInt, intervFinPub, intervFinPubDesc, tcNuovaCostruzioneComplessa, - serviceContext, bozza); + clRischioPreInt, clRischioPostInt, intervFinPub, intervFinPubDesc, + tcNuovaCostruzioneComplessa, serviceContext, bozza); } if (!geoDisabledSubmit && DelegheUtil.hasDelegaCompilazioneSezioneGeologica(userId, dettPraticaId)) { diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DocPraticaLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DocPraticaLocalServiceImpl.java index 739e1bd4..77ff18d6 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DocPraticaLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DocPraticaLocalServiceImpl.java @@ -24,7 +24,6 @@ import it.tref.liferay.portos.bo.util.PraticaUtil; import java.util.Date; import java.util.List; -import com.liferay.portal.NoSuchRepositoryEntryException; import com.liferay.portal.kernel.dao.orm.DynamicQuery; import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil; import com.liferay.portal.kernel.dao.orm.Junction; @@ -49,7 +48,6 @@ import com.liferay.portal.security.permission.PermissionThreadLocal; import com.liferay.portal.service.RoleLocalServiceUtil; import com.liferay.portal.service.ServiceContext; import com.liferay.portal.service.UserLocalServiceUtil; -import com.liferay.portlet.documentlibrary.NoSuchFileEntryException; import com.liferay.portlet.documentlibrary.NoSuchFolderException; /** @@ -84,10 +82,7 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { if (Validator.isNotNull(docPratica.getDlFileEntryId())) { dlAppLocalService.deleteFileEntry(docPratica.getDlFileEntryId()); } - } catch (NoSuchFileEntryException | NoSuchRepositoryEntryException e) { - } catch (PortalException e) { - throw new SystemException(e); } return super.deleteDocPratica(docPratica); } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/IntPraticaLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/IntPraticaLocalServiceImpl.java index fa00d6df..dcd14437 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/IntPraticaLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/IntPraticaLocalServiceImpl.java @@ -242,7 +242,7 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl { } return ret; } - + public IntPratica addIntPratica(long territorioId, String tipoProcedura, ServiceContext serviceContext) throws SystemException, PortalException { diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/PagamentoLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/PagamentoLocalServiceImpl.java index 9669c7ba..2cf49c55 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/PagamentoLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/PagamentoLocalServiceImpl.java @@ -375,28 +375,22 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl { @Override public Pagamento deletePagamento(long pagamentoId) throws PortalException, SystemException { - - Pagamento pagamento = super.deletePagamento(pagamentoId); - DLAppLocalServiceUtil.deleteFileEntry(pagamento.getFileEntryId()); - deleteDettPraticaPagamento(pagamento); - return pagamento; + return deletePagamento(pagamentoLocalService.getPagamento(pagamentoId)); } @Override public Pagamento deletePagamento(Pagamento pagamento) throws PortalException, SystemException { - pagamento = super.deletePagamento(pagamento); if (Validator.isNotNull(pagamento.getFileEntryId())) { try { DLAppLocalServiceUtil.deleteFileEntry(pagamento.getFileEntryId()); - } catch (PortalException | SystemException e) { - _log.info("L'allegato del pagamento " + pagamento.getPagamentoId() + " non esisteva."); + } catch (PortalException e) { } } if (DettPratica.class.getName().equalsIgnoreCase(pagamento.getClassName())) { deleteDettPraticaPagamento(pagamento); } - return pagamento; + return super.deletePagamento(pagamento); } public Pagamento updateEmailPendingPagamento(long pagamentoId, boolean emailPending) diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/SoggettoLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/SoggettoLocalServiceImpl.java index b0d64d8e..48028f4d 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/SoggettoLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/SoggettoLocalServiceImpl.java @@ -12,7 +12,6 @@ package it.tref.liferay.portos.bo.service.impl; -import it.tref.liferay.portos.bo.NoSuchDocPraticaException; import it.tref.liferay.portos.bo.model.DettPratica; import it.tref.liferay.portos.bo.model.DocPratica; import it.tref.liferay.portos.bo.model.Soggetto; @@ -24,7 +23,6 @@ import it.tref.liferay.portos.bo.util.WorkflowConstants; import java.util.Date; import java.util.List; -import com.liferay.portal.NoSuchRepositoryEntryException; import com.liferay.portal.kernel.dao.orm.Disjunction; import com.liferay.portal.kernel.dao.orm.DynamicQuery; import com.liferay.portal.kernel.dao.orm.OrderFactoryUtil; @@ -39,7 +37,6 @@ import com.liferay.portal.kernel.util.StringPool; import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.model.User; import com.liferay.portal.service.ServiceContext; -import com.liferay.portlet.documentlibrary.NoSuchFileEntryException; /** * The implementation of the soggetto local service. @@ -419,8 +416,7 @@ public class SoggettoLocalServiceImpl extends SoggettoLocalServiceBaseImpl { if (Validator.isNotNull(soggetto.getFileVariazioneId())) { docPraticaLocalService.deleteDocPratica(soggetto.getFileVariazioneId()); } - } catch (NoSuchFileEntryException | NoSuchRepositoryEntryException | NoSuchDocPraticaException e) { - + } catch (PortalException e) { } return super.deleteSoggetto(soggetto); } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/AllegatoManualePersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/AllegatoManualePersistenceImpl.java index b040f227..5c96356f 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/AllegatoManualePersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/AllegatoManualePersistenceImpl.java @@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchAllegatoManualeException; import it.tref.liferay.portos.bo.model.AllegatoManuale; import it.tref.liferay.portos.bo.model.impl.AllegatoManualeImpl; import it.tref.liferay.portos.bo.model.impl.AllegatoManualeModelImpl; +import it.tref.liferay.portos.bo.service.persistence.AllegatoManualePersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/AsseverazionePersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/AsseverazionePersistenceImpl.java index 63caa01d..15633d6f 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/AsseverazionePersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/AsseverazionePersistenceImpl.java @@ -46,6 +46,7 @@ import it.tref.liferay.portos.bo.NoSuchAsseverazioneException; import it.tref.liferay.portos.bo.model.Asseverazione; import it.tref.liferay.portos.bo.model.impl.AsseverazioneImpl; import it.tref.liferay.portos.bo.model.impl.AsseverazioneModelImpl; +import it.tref.liferay.portos.bo.service.persistence.AsseverazionePersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/AvvisoPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/AvvisoPersistenceImpl.java index b95c271d..38e33edc 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/AvvisoPersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/AvvisoPersistenceImpl.java @@ -46,6 +46,7 @@ import it.tref.liferay.portos.bo.NoSuchAvvisoException; import it.tref.liferay.portos.bo.model.Avviso; import it.tref.liferay.portos.bo.model.impl.AvvisoImpl; import it.tref.liferay.portos.bo.model.impl.AvvisoModelImpl; +import it.tref.liferay.portos.bo.service.persistence.AvvisoPersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/CollaudoPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/CollaudoPersistenceImpl.java index 0b546e1a..02dcaba3 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/CollaudoPersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/CollaudoPersistenceImpl.java @@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchCollaudoException; import it.tref.liferay.portos.bo.model.Collaudo; import it.tref.liferay.portos.bo.model.impl.CollaudoImpl; import it.tref.liferay.portos.bo.model.impl.CollaudoModelImpl; +import it.tref.liferay.portos.bo.service.persistence.CollaudoPersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ComunePersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ComunePersistenceImpl.java index b0b64b21..4a23bffd 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ComunePersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ComunePersistenceImpl.java @@ -46,6 +46,7 @@ import it.tref.liferay.portos.bo.NoSuchComuneException; import it.tref.liferay.portos.bo.model.Comune; import it.tref.liferay.portos.bo.model.impl.ComuneImpl; import it.tref.liferay.portos.bo.model.impl.ComuneModelImpl; +import it.tref.liferay.portos.bo.service.persistence.ComunePersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ComunicazionePersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ComunicazionePersistenceImpl.java index 0b7f9ee2..f5b8166f 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ComunicazionePersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ComunicazionePersistenceImpl.java @@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchComunicazioneException; import it.tref.liferay.portos.bo.model.Comunicazione; import it.tref.liferay.portos.bo.model.impl.ComunicazioneImpl; import it.tref.liferay.portos.bo.model.impl.ComunicazioneModelImpl; +import it.tref.liferay.portos.bo.service.persistence.ComunicazionePersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ConfigurazionePersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ConfigurazionePersistenceImpl.java index 66507dd0..32809343 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ConfigurazionePersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ConfigurazionePersistenceImpl.java @@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchConfigurazioneException; import it.tref.liferay.portos.bo.model.Configurazione; import it.tref.liferay.portos.bo.model.impl.ConfigurazioneImpl; import it.tref.liferay.portos.bo.model.impl.ConfigurazioneModelImpl; +import it.tref.liferay.portos.bo.service.persistence.ConfigurazionePersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ControlloPraticaPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ControlloPraticaPersistenceImpl.java index 48cf51eb..a4fa6f91 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ControlloPraticaPersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ControlloPraticaPersistenceImpl.java @@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchControlloPraticaException; import it.tref.liferay.portos.bo.model.ControlloPratica; import it.tref.liferay.portos.bo.model.impl.ControlloPraticaImpl; import it.tref.liferay.portos.bo.model.impl.ControlloPraticaModelImpl; +import it.tref.liferay.portos.bo.service.persistence.ControlloPraticaPersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DelegaPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DelegaPersistenceImpl.java index 402cecd0..8c56fb32 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DelegaPersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DelegaPersistenceImpl.java @@ -46,6 +46,7 @@ import it.tref.liferay.portos.bo.NoSuchDelegaException; import it.tref.liferay.portos.bo.model.Delega; import it.tref.liferay.portos.bo.model.impl.DelegaImpl; import it.tref.liferay.portos.bo.model.impl.DelegaModelImpl; +import it.tref.liferay.portos.bo.service.persistence.DelegaPersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DettPraticaPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DettPraticaPersistenceImpl.java index bf34f897..f35bff1b 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DettPraticaPersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DettPraticaPersistenceImpl.java @@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchDettPraticaException; import it.tref.liferay.portos.bo.model.DettPratica; import it.tref.liferay.portos.bo.model.impl.DettPraticaImpl; import it.tref.liferay.portos.bo.model.impl.DettPraticaModelImpl; +import it.tref.liferay.portos.bo.service.persistence.DettPraticaPersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DocAggiuntivaPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DocAggiuntivaPersistenceImpl.java index 649a5476..c25ae1dc 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DocAggiuntivaPersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DocAggiuntivaPersistenceImpl.java @@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchDocAggiuntivaException; import it.tref.liferay.portos.bo.model.DocAggiuntiva; import it.tref.liferay.portos.bo.model.impl.DocAggiuntivaImpl; import it.tref.liferay.portos.bo.model.impl.DocAggiuntivaModelImpl; +import it.tref.liferay.portos.bo.service.persistence.DocAggiuntivaPersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DocPraticaPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DocPraticaPersistenceImpl.java index 42630357..255330f7 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DocPraticaPersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DocPraticaPersistenceImpl.java @@ -46,6 +46,7 @@ import it.tref.liferay.portos.bo.NoSuchDocPraticaException; import it.tref.liferay.portos.bo.model.DocPratica; import it.tref.liferay.portos.bo.model.impl.DocPraticaImpl; import it.tref.liferay.portos.bo.model.impl.DocPraticaModelImpl; +import it.tref.liferay.portos.bo.service.persistence.DocPraticaPersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/FineLavoriPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/FineLavoriPersistenceImpl.java index 41c1b2be..15f0504f 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/FineLavoriPersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/FineLavoriPersistenceImpl.java @@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchFineLavoriException; import it.tref.liferay.portos.bo.model.FineLavori; import it.tref.liferay.portos.bo.model.impl.FineLavoriImpl; import it.tref.liferay.portos.bo.model.impl.FineLavoriModelImpl; +import it.tref.liferay.portos.bo.service.persistence.FineLavoriPersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/HistoryWorkflowActionPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/HistoryWorkflowActionPersistenceImpl.java index ad50d7ea..f80406ab 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/HistoryWorkflowActionPersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/HistoryWorkflowActionPersistenceImpl.java @@ -42,6 +42,7 @@ import it.tref.liferay.portos.bo.NoSuchHistoryWorkflowActionException; import it.tref.liferay.portos.bo.model.HistoryWorkflowAction; import it.tref.liferay.portos.bo.model.impl.HistoryWorkflowActionImpl; import it.tref.liferay.portos.bo.model.impl.HistoryWorkflowActionModelImpl; +import it.tref.liferay.portos.bo.service.persistence.HistoryWorkflowActionPersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/IUVPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/IUVPersistenceImpl.java index a6ba54ac..6f469f0e 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/IUVPersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/IUVPersistenceImpl.java @@ -46,6 +46,7 @@ import it.tref.liferay.portos.bo.NoSuchIUVException; import it.tref.liferay.portos.bo.model.IUV; import it.tref.liferay.portos.bo.model.impl.IUVImpl; import it.tref.liferay.portos.bo.model.impl.IUVModelImpl; +import it.tref.liferay.portos.bo.service.persistence.IUVPersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/InfoFascicoloPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/InfoFascicoloPersistenceImpl.java index 12f22a0a..b85535de 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/InfoFascicoloPersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/InfoFascicoloPersistenceImpl.java @@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchInfoFascicoloException; import it.tref.liferay.portos.bo.model.InfoFascicolo; import it.tref.liferay.portos.bo.model.impl.InfoFascicoloImpl; import it.tref.liferay.portos.bo.model.impl.InfoFascicoloModelImpl; +import it.tref.liferay.portos.bo.service.persistence.InfoFascicoloPersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/IntPraticaPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/IntPraticaPersistenceImpl.java index 97842225..bb4019f2 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/IntPraticaPersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/IntPraticaPersistenceImpl.java @@ -48,6 +48,7 @@ import it.tref.liferay.portos.bo.NoSuchIntPraticaException; import it.tref.liferay.portos.bo.model.IntPratica; import it.tref.liferay.portos.bo.model.impl.IntPraticaImpl; import it.tref.liferay.portos.bo.model.impl.IntPraticaModelImpl; +import it.tref.liferay.portos.bo.service.persistence.IntPraticaPersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/PagamentoPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/PagamentoPersistenceImpl.java index 8dbf29df..ee3b3b9b 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/PagamentoPersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/PagamentoPersistenceImpl.java @@ -46,6 +46,7 @@ import it.tref.liferay.portos.bo.NoSuchPagamentoException; import it.tref.liferay.portos.bo.model.Pagamento; import it.tref.liferay.portos.bo.model.impl.PagamentoImpl; import it.tref.liferay.portos.bo.model.impl.PagamentoModelImpl; +import it.tref.liferay.portos.bo.service.persistence.PagamentoPersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ParereGeologoPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ParereGeologoPersistenceImpl.java index c6ce3907..e4133c60 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ParereGeologoPersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ParereGeologoPersistenceImpl.java @@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchParereGeologoException; import it.tref.liferay.portos.bo.model.ParereGeologo; import it.tref.liferay.portos.bo.model.impl.ParereGeologoImpl; import it.tref.liferay.portos.bo.model.impl.ParereGeologoModelImpl; +import it.tref.liferay.portos.bo.service.persistence.ParereGeologoPersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ProvinciaPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ProvinciaPersistenceImpl.java index daa33e1b..2c7a846f 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ProvinciaPersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ProvinciaPersistenceImpl.java @@ -43,6 +43,7 @@ import it.tref.liferay.portos.bo.NoSuchProvinciaException; import it.tref.liferay.portos.bo.model.Provincia; import it.tref.liferay.portos.bo.model.impl.ProvinciaImpl; import it.tref.liferay.portos.bo.model.impl.ProvinciaModelImpl; +import it.tref.liferay.portos.bo.service.persistence.ProvinciaPersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/SoggettoPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/SoggettoPersistenceImpl.java index 29c4a390..ef2db5f2 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/SoggettoPersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/SoggettoPersistenceImpl.java @@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchSoggettoException; import it.tref.liferay.portos.bo.model.Soggetto; import it.tref.liferay.portos.bo.model.impl.SoggettoImpl; import it.tref.liferay.portos.bo.model.impl.SoggettoModelImpl; +import it.tref.liferay.portos.bo.service.persistence.SoggettoPersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/SorteggioPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/SorteggioPersistenceImpl.java index ec8a983f..fc566b28 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/SorteggioPersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/SorteggioPersistenceImpl.java @@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchSorteggioException; import it.tref.liferay.portos.bo.model.Sorteggio; import it.tref.liferay.portos.bo.model.impl.SorteggioImpl; import it.tref.liferay.portos.bo.model.impl.SorteggioModelImpl; +import it.tref.liferay.portos.bo.service.persistence.SorteggioPersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/StoricoSoggettoPraticaPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/StoricoSoggettoPraticaPersistenceImpl.java index 78333501..0c095d3d 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/StoricoSoggettoPraticaPersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/StoricoSoggettoPraticaPersistenceImpl.java @@ -42,6 +42,7 @@ import it.tref.liferay.portos.bo.NoSuchStoricoSoggettoPraticaException; import it.tref.liferay.portos.bo.model.StoricoSoggettoPratica; import it.tref.liferay.portos.bo.model.impl.StoricoSoggettoPraticaImpl; import it.tref.liferay.portos.bo.model.impl.StoricoSoggettoPraticaModelImpl; +import it.tref.liferay.portos.bo.service.persistence.StoricoSoggettoPraticaPersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/TempisticaPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/TempisticaPersistenceImpl.java index 720078c4..252fc452 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/TempisticaPersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/TempisticaPersistenceImpl.java @@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchTempisticaException; import it.tref.liferay.portos.bo.model.Tempistica; import it.tref.liferay.portos.bo.model.impl.TempisticaImpl; import it.tref.liferay.portos.bo.model.impl.TempisticaModelImpl; +import it.tref.liferay.portos.bo.service.persistence.TempisticaPersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/TerritorioPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/TerritorioPersistenceImpl.java index a9c7f7d5..c8e0dee9 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/TerritorioPersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/TerritorioPersistenceImpl.java @@ -44,6 +44,7 @@ import it.tref.liferay.portos.bo.NoSuchTerritorioException; import it.tref.liferay.portos.bo.model.Territorio; import it.tref.liferay.portos.bo.model.impl.TerritorioImpl; import it.tref.liferay.portos.bo.model.impl.TerritorioModelImpl; +import it.tref.liferay.portos.bo.service.persistence.TerritorioPersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/UtentePortosPersistenceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/UtentePortosPersistenceImpl.java index 89f06b61..83b7ed61 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/UtentePortosPersistenceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/UtentePortosPersistenceImpl.java @@ -43,6 +43,7 @@ import it.tref.liferay.portos.bo.NoSuchUtentePortosException; import it.tref.liferay.portos.bo.model.UtentePortos; import it.tref.liferay.portos.bo.model.impl.UtentePortosImpl; import it.tref.liferay.portos.bo.model.impl.UtentePortosModelImpl; +import it.tref.liferay.portos.bo.service.persistence.UtentePortosPersistence; import java.io.Serializable; diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties index e10b134e..017b16da 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties +++ b/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=2519 - build.date=1606917366187 + build.number=2533 + build.date=1608199554355 build.auto.upgrade=true ## @@ -38,4 +38,4 @@ \ WEB-INF/classes/META-INF/shard-data-source-spring.xml,\ \ - WEB-INF/classes/META-INF/ext-spring.xml \ No newline at end of file + WEB-INF/classes/META-INF/ext-spring.xml diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/common/preview_file_entry.jsp b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/common/preview_file_entry.jsp index e16a3d06..b010c000 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/common/preview_file_entry.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/common/preview_file_entry.jsp @@ -216,6 +216,8 @@ boolean enableCommentRatings = false;
+
+
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/doc_aggiuntiva/view.jsp b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/doc_aggiuntiva/view.jsp index 1592023e..4ebc0b05 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/doc_aggiuntiva/view.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/doc_aggiuntiva/view.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="it.tref.liferay.portos.bo.shared.util.ActionKeys"%> <%@page import="it.tref.liferay.portos.bo.service.permission.IntPraticaPermission"%> <%@page import="java.util.ArrayList"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/advanced_search.jsp b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/advanced_search.jsp index ec8e7716..d29a4cb5 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/advanced_search.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/advanced_search.jsp @@ -45,11 +45,6 @@
Stato Pratica - -<%-- --%> -<%-- --%> -<%-- --%> - diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/html_top.jspf b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/html_top.jspf index ef248e32..4ecea85c 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/html_top.jspf +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/html_top.jspf @@ -1 +1,2 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/navigator/page_riepilogo.jsp b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/navigator/page_riepilogo.jsp index bb40c6c1..e3eef794 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/navigator/page_riepilogo.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/navigator/page_riepilogo.jsp @@ -138,6 +138,42 @@
+
+
+
+ +
+
+
+ <%= LanguageUtil.get(pageContext, "dp-dc-prov") %> +
+
+ <%=BeanPropertiesUtil.getString(provincia, "provincia")%> +
+
+ <%= LanguageUtil.get(pageContext, "dp-dc-comune") %> +
+
+ <%=BeanPropertiesUtil.getString(comune, "denominazione")%> +
+
+ <%= LanguageUtil.get(pageContext, "dp-dc-loc") %> +
+
+ <%=BeanPropertiesUtil.getString(dettPratica, "localita") %> +
+
+ <%= LanguageUtil.get(pageContext, "dp-dc-via") %> +
+
+ <%=BeanPropertiesUtil.getString(dettPratica, "via") %> +
+
+
+
+
+
+
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/view.jsp b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/view.jsp index 689971a5..10ab0c34 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/view.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/view.jsp @@ -219,7 +219,7 @@ String dtSorteggioNullo = "2020-03-05 11:12:18.006"; Le pratiche sottoposte a parere sono quelle che hanno statoPratica == 'SP', non quelle in status di workflow = pending --> - "> + SP diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/view_columns.jspf b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/view_columns.jspf index 59b651c0..0f02300e 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/view_columns.jspf +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/view_columns.jspf @@ -60,7 +60,8 @@ DettPratica lastDettPratica = DettPraticaLocalServiceUtil.getLastCompletedByIntP } //Informazioni relative al workflow WorkflowInstanceLink workflowInstanceLink = WorkflowInstanceLinkLocalServiceUtil.fetchWorkflowInstanceLink( - controlloPratica.getCompanyId(),controlloPratica.getGroupId(), ControlloPratica.class.getName(),controlloPratica.getPrimaryKey()); + controlloPratica.getCompanyId(), controlloPratica.getGroupId(), ControlloPratica.class.getName(), + controlloPratica.getPrimaryKey()); List listaTask = null; WorkflowInstance workflowInstance = null; @@ -209,14 +210,16 @@ DettPratica lastDettPratica = DettPraticaLocalServiceUtil.getLastCompletedByIntP - <%=provincia.getProvincia()+" - "+comune.getDenominazione() %> + <%= provincia.getProvincia() + " - " + comune.getDenominazione() %> <% long days = ControlloPraticaLocalServiceUtil.calculateDateAvvioProcedimento(controlloPratica.getControlloPraticaId()); + if (days > 0) { + out.print(days); + } %> - <%=days %> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestionefirme/avvisi_da_firmare.jsp b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestionefirme/avvisi_da_firmare.jsp index da6e7057..bc73599d 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestionefirme/avvisi_da_firmare.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestionefirme/avvisi_da_firmare.jsp @@ -1,6 +1,4 @@ <%@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.util.ArrayUtil"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/sismica_administration/view.jsp b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/sismica_administration/view.jsp index bfa27a9b..feee19df 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/sismica_administration/view.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/sismica_administration/view.jsp @@ -1,5 +1,5 @@ -<%@page import="it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@page import="it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants"%> <%@page import="org.apache.commons.lang.time.DateUtils"%> <%@page import="java.util.Calendar"%> <%@page import="it.tref.liferay.portos.bo.shared.util.ConfigurazioneConstants"%> @@ -96,14 +96,15 @@ String dataProssimoSorteggio =
- +
-
Test Interno
- +
Manutenzione database
+
- + +
@@ -134,7 +135,7 @@ String dataProssimoSorteggio =
<% String tipoAvviso = ParamUtil.getString(renderRequest, "tipoAvviso", ""); - String numeroProgetto = ParamUtil.getString(renderRequest, "numeroProgetto", ""); + String numeroProgetto = ParamUtil.getString(renderRequest, "numeroProgetto", ""); %>
Invia avviso
@@ -190,7 +191,7 @@ String dataProssimoSorteggio = value="<%=Soggetto.class.getName()%>"> - "> + "> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/ivy.xml b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/ivy.xml index a1178fa6..d60f0a25 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/ivy.xml +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/ivy.xml @@ -11,9 +11,9 @@ - - - + + + diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/ivy.xml.MD5 b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/ivy.xml.MD5 index dfda30f8..3c5dfa07 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/ivy.xml.MD5 +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/ivy.xml.MD5 @@ -1 +1 @@ -291fbe4be1f094ebfa7c95b6381ba6af +29bdb5e74c39965a8db63e99d25a27ab diff --git a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/init.jsp b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/init.jsp index d654039d..8e7e7acd 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/init.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/init.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="java.util.ArrayList"%> <%@page import="com.liferay.portal.model.Role"%> <%@page import="com.liferay.portal.service.UserGroupRoleLocalServiceUtil"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/tabs/amministrazione.jsp b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/tabs/amministrazione.jsp index 41d1262f..3dae128a 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/tabs/amministrazione.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/tabs/amministrazione.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="it.tref.portos.calendar.appointments.service.PrenotazioneLocalServiceUtil"%> <%@page import="com.liferay.portal.service.OrganizationLocalServiceUtil"%> <%@page import="com.liferay.portal.model.Organization"%> @@ -244,11 +245,11 @@ String dataFine = ParamUtil.getString(request, "dataFineRicerca","");
- - - - - + + + + + diff --git a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/tabs/calendar.jsp b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/tabs/calendar.jsp index ac84ed62..93fcfaca 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/tabs/calendar.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/tabs/calendar.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="com.liferay.portal.service.OrganizationLocalServiceUtil"%> <%@page import="com.liferay.portal.model.Organization"%> <%@page import="it.tref.portos.calendar.appointments.service.DisponibilitaLocalServiceUtil"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/tabs/gestione_disponibilita.jsp b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/tabs/gestione_disponibilita.jsp index dfc31ced..329151a3 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/tabs/gestione_disponibilita.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/tabs/gestione_disponibilita.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="com.liferay.portal.service.UserLocalServiceUtil"%> <%@page import="it.tref.portos.calendar.appointments.service.PrenotazioneLocalServiceUtil"%> <%@page import="it.tref.portos.calendar.appointments.service.DisponibilitaLocalServiceUtil"%> @@ -43,7 +44,7 @@ SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
- +
@@ -156,7 +157,7 @@ SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
- +
@@ -262,7 +263,7 @@ SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
- +
@@ -283,7 +284,7 @@ SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); className="it.tref.portos.calendar.appointments.model.Disponibilita" modelVar="disponibilita" > - + <% out.print(sdfGiorno.format(disponibilita.getStartDate()) + " dalle " + sdfOra.format(disponibilita.getStartDate()) + " alle " + sdfOra.format(disponibilita.getEndDate())); %> @@ -327,7 +328,7 @@ SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
- + @@ -394,7 +395,7 @@ SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); out.print(funzionario.getFullName()); %> - + <% out.print(sdfGiorno.format(disponibilita.getStartDate()) + " dalle " + sdfOra.format(disponibilita.getStartDate()) + " alle " + sdfOra.format(disponibilita.getEndDate())); %> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/tabs/gestione_disponibilita_action.jsp b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/tabs/gestione_disponibilita_action.jsp index c732457f..5815f9f3 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/tabs/gestione_disponibilita_action.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/tabs/gestione_disponibilita_action.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="it.tref.portos.calendar.appointments.model.Disponibilita"%> <%@ include file="/html/calendar_appointments/init.jsp" %> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/view.jsp b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/view.jsp index 161d8081..b8d77306 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/view.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/calendar_appointments/view.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="com.liferay.portal.service.GroupLocalServiceUtil"%> <%@ include file="/html/calendar_appointments/init.jsp" %> <% diff --git a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/init.jsp b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/init.jsp index f3db762d..11c883c0 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/init.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/html/init.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="java.text.Format"%> <%@page import="com.liferay.portal.kernel.util.FastDateFormatFactoryUtil"%> <%@page import="com.liferay.portal.kernel.util.StringUtil"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/view.jsp b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/view.jsp index 8a21a366..07d5fcb0 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/view.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/view.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <% /** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. diff --git a/liferay-plugins-sdk-6.2/portlets/portos-company-configuration-portlet/docroot/html/company_configuration/init.jsp b/liferay-plugins-sdk-6.2/portlets/portos-company-configuration-portlet/docroot/html/company_configuration/init.jsp index 7ab610cb..4866d541 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-company-configuration-portlet/docroot/html/company_configuration/init.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-company-configuration-portlet/docroot/html/company_configuration/init.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@include file="/html/init.jsp" %> <%@page import="com.liferay.portal.kernel.util.ParamUtil"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-company-configuration-portlet/docroot/html/company_configuration/view.jsp b/liferay-plugins-sdk-6.2/portlets/portos-company-configuration-portlet/docroot/html/company_configuration/view.jsp index 821789a6..df8076e1 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-company-configuration-portlet/docroot/html/company_configuration/view.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-company-configuration-portlet/docroot/html/company_configuration/view.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="javax.portlet.PortletURL"%> <%@page import="javax.portlet.PortletRequest"%> <%@page import="com.liferay.portal.util.PortletKeys"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-company-configuration-portlet/docroot/html/init.jsp b/liferay-plugins-sdk-6.2/portlets/portos-company-configuration-portlet/docroot/html/init.jsp index 065d3d8b..0afcda91 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-company-configuration-portlet/docroot/html/init.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-company-configuration-portlet/docroot/html/init.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-comunicazioni-portlet/docroot/html/common/submit_text_window.jsp b/liferay-plugins-sdk-6.2/portlets/portos-comunicazioni-portlet/docroot/html/common/submit_text_window.jsp index 1dc5dd21..d0b387c8 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-comunicazioni-portlet/docroot/html/common/submit_text_window.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-comunicazioni-portlet/docroot/html/common/submit_text_window.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ include file="/html/init.jsp" %> <% diff --git a/liferay-plugins-sdk-6.2/portlets/portos-comunicazioni-portlet/docroot/html/comunicazionemediata/init.jsp b/liferay-plugins-sdk-6.2/portlets/portos-comunicazioni-portlet/docroot/html/comunicazionemediata/init.jsp index ce630d4b..505d90c5 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-comunicazioni-portlet/docroot/html/comunicazionemediata/init.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-comunicazioni-portlet/docroot/html/comunicazionemediata/init.jsp @@ -1 +1,2 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ include file="/html/init.jsp" %> \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/portos-comunicazioni-portlet/docroot/html/comunicazionemediata/view.jsp b/liferay-plugins-sdk-6.2/portlets/portos-comunicazioni-portlet/docroot/html/comunicazionemediata/view.jsp index 13ba98b7..212fff46 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-comunicazioni-portlet/docroot/html/comunicazionemediata/view.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-comunicazioni-portlet/docroot/html/comunicazionemediata/view.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="it.tref.liferay.portos.bo.service.TerritorioLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.model.Territorio"%> <%@page import="it.tref.liferay.portos.bo.shared.util.ActionKeys"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-comunicazioni-portlet/docroot/html/init.jsp b/liferay-plugins-sdk-6.2/portlets/portos-comunicazioni-portlet/docroot/html/init.jsp index 7195cb85..82b20551 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-comunicazioni-portlet/docroot/html/init.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-comunicazioni-portlet/docroot/html/init.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="java.text.Format"%> <%@page import="java.text.MessageFormat"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-comunicazioni-portlet/docroot/view.jsp b/liferay-plugins-sdk-6.2/portlets/portos-comunicazioni-portlet/docroot/view.jsp index d9b0efec..baf916d9 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-comunicazioni-portlet/docroot/view.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-comunicazioni-portlet/docroot/view.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <% /** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. diff --git a/liferay-plugins-sdk-6.2/portlets/portos-cookies-portlet/docroot/init.jsp b/liferay-plugins-sdk-6.2/portlets/portos-cookies-portlet/docroot/init.jsp index ab7501ce..0deaecc7 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-cookies-portlet/docroot/init.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-cookies-portlet/docroot/init.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="java.text.SimpleDateFormat"%> <%@page import="com.liferay.portlet.PortletURLUtil"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-cookies-portlet/docroot/view.jsp b/liferay-plugins-sdk-6.2/portlets/portos-cookies-portlet/docroot/view.jsp index 492629d1..8f7517bc 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-cookies-portlet/docroot/view.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-cookies-portlet/docroot/view.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="com.liferay.portal.util.PortalUtil"%> <%@page import="com.liferay.portal.kernel.util.Validator"%> <%@page import="com.liferay.portal.kernel.util.StringPool"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/html/init.jsp b/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/html/init.jsp index bb88947c..0ae60c99 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/html/init.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/html/init.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/html/notificator/edit_notification.jsp b/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/html/notificator/edit_notification.jsp index 425e8af6..e2cef758 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/html/notificator/edit_notification.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/html/notificator/edit_notification.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="com.liferay.portal.kernel.util.Validator"%> <%@page import="com.liferay.portal.kernel.util.StringUtil"%> <%@ include file="/html/notificator/init.jsp"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/html/notificator/init.jsp b/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/html/notificator/init.jsp index ea913f23..dd526767 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/html/notificator/init.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/html/notificator/init.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ include file="/html/init.jsp"%> <%@ page import="it.tref.liferay.portos.deployalert.service.NotificationMailLocalServiceUtil"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/html/notificator/view.jsp b/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/html/notificator/view.jsp index 78964c30..eb713391 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/html/notificator/view.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/html/notificator/view.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ include file="/html/notificator/init.jsp"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/.settings/org.eclipse.wst.common.component b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/.settings/org.eclipse.wst.common.component index e1d846ac..26b0e067 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/.settings/org.eclipse.wst.common.component +++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/.settings/org.eclipse.wst.common.component @@ -2,10 +2,10 @@ - + uses - + uses diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/portlet/FascicoloFePortlet.java b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/portlet/FascicoloFePortlet.java index 99fa7300..dd9102c4 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/portlet/FascicoloFePortlet.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/portlet/FascicoloFePortlet.java @@ -713,7 +713,7 @@ public class FascicoloFePortlet extends MVCPortlet { DettPratica dettPratica = DettPraticaServiceUtil.addDettPraticaClonedToIntPratica(intPraticaId, lastDettPratica.getDettPraticaId(), TipoIntegrazioneUtil.VARIANTE, serviceContext); - // successURL gia'� presente in actionResponse + // successURL già presente in actionResponse // successURL = // HttpUtil.addParameter(successURL, actionResponse.getNamespace() + // "mvcPath", @@ -909,7 +909,6 @@ public class FascicoloFePortlet extends MVCPortlet { } public void saveDettPratica(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { - ServiceContext serviceContext = ServiceContextFactory.getInstance(DettPratica.class.getName(), actionRequest); long dettPraticaId = ParamUtil.getLong(actionRequest, "dettPraticaId"); @@ -1341,7 +1340,8 @@ public class FascicoloFePortlet extends MVCPortlet { boolean tcMiglioramentoSismico = ParamUtil.getBoolean(actionRequest, "tcMiglioramentoSismico"); boolean tcRiparazioneInterventoLocale = ParamUtil.getBoolean(actionRequest, "tcRiparazioneInterventoLocale"); - boolean tcNuovaCostruzioneComplessa = ParamUtil.getBoolean(actionRequest, "tcNuovaCostruzioneComplessa"); + boolean tcNuovaCostruzioneComplessa = ParamUtil.getBoolean(actionRequest, + "tcNuovaCostruzioneComplessa"); boolean tcInCA = ParamUtil.getBoolean(actionRequest, "tcInCA"); boolean tcInOpera = ParamUtil.getBoolean(actionRequest, "tcInOpera"); @@ -1590,7 +1590,8 @@ public class FascicoloFePortlet extends MVCPortlet { normDpr02Dep, normDpr01Aut, normDpr02Aut, normDm01, normDm02, normDm03, normDm2018, normDprg01, normDprg02, normAnr, normArt3com3, normArt3com4, normOrd01, normDm04, normDm05, normCI01, normLTC01, suap, normSismaBonus, clRischioPreInt, clRischioPostInt, - intervFinPub, intervFinPubDesc, tcNuovaCostruzioneComplessa, serviceContext, bozza, disabledSubmit, geoDisabledSubmit); + intervFinPub, intervFinPubDesc, tcNuovaCostruzioneComplessa, serviceContext, bozza, + disabledSubmit, geoDisabledSubmit); String redirect = ParamUtil.getString(actionRequest, "redirect"); if (Validator.isNull(redirect)) { @@ -1800,7 +1801,8 @@ public class FascicoloFePortlet extends MVCPortlet { boolean tcMiglioramentoSismico = ParamUtil.getBoolean(actionRequest, "tcMiglioramentoSismico"); boolean tcRiparazioneInterventoLocale = ParamUtil.getBoolean(actionRequest, "tcRiparazioneInterventoLocale"); - boolean tcNuovaCostruzioneComplessa = ParamUtil.getBoolean(actionRequest, "tcNuovaCostruzioneComplessa"); + boolean tcNuovaCostruzioneComplessa = ParamUtil.getBoolean(actionRequest, + "tcNuovaCostruzioneComplessa"); boolean tcInCA = ParamUtil.getBoolean(actionRequest, "tcInCA"); boolean tcInOpera = ParamUtil.getBoolean(actionRequest, "tcInOpera"); @@ -2059,7 +2061,8 @@ public class FascicoloFePortlet extends MVCPortlet { normDpr02Dep, normDpr01Aut, normDpr02Aut, normDm01, normDm02, normDm03, normDm2018, normDprg01, normDprg02, normAnr, normArt3com3, normArt3com4, normOrd01, normDm04, normDm05, normCI01, normLTC01, suap, normSismaBonus, clRischioPreInt, clRischioPostInt, - intervFinPub, intervFinPubDesc, tcNuovaCostruzioneComplessa, serviceContext, bozza, disabledSubmit, geoDisabledSubmit); + intervFinPub, intervFinPubDesc, tcNuovaCostruzioneComplessa, serviceContext, bozza, + disabledSubmit, geoDisabledSubmit); String redirect = ParamUtil.getString(actionRequest, "redirect"); if (Validator.isNull(redirect)) { diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/allegatipratica/allegati_action.jsp b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/allegatipratica/allegati_action.jsp index abe623e7..52abdb9a 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/allegatipratica/allegati_action.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/allegatipratica/allegati_action.jsp @@ -1,5 +1,4 @@ <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> - <%@page import="it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.model.IntPratica"%> @@ -21,38 +20,37 @@ <%@include file="/html/allegatipratica/init.jsp"%> <% - - String redirect = ParamUtil.getString(request, "backUrl"); - String comingFrom = ParamUtil.getString(request, "comingFrom"); - long classPk = ParamUtil.getLong(request, "classPk"); - String className = ParamUtil.getString(request, "className"); +String redirect = ParamUtil.getString(request, "backUrl"); +String comingFrom = ParamUtil.getString(request, "comingFrom"); +long classPk = ParamUtil.getLong(request, "classPk"); +String className = ParamUtil.getString(request, "className"); - String refresh="Liferay.fire('allegati-"+comingFrom+"-open');Liferay.Portlet.refresh('#p_p_id_"+PortletKeys.ALLEGATI+"_INSTANCE_page_allegati_');Liferay.Portlet.refresh('#p_p_id_"+PortletKeys.ALLEGATI+"_INSTANCE_page_geologica_');"; +String refresh="Liferay.fire('allegati-"+comingFrom+"-open');Liferay.Portlet.refresh('#p_p_id_"+PortletKeys.ALLEGATI+"_INSTANCE_page_allegati_');Liferay.Portlet.refresh('#p_p_id_"+PortletKeys.ALLEGATI+"_INSTANCE_page_geologica_');"; - long docPraticaId = ParamUtil.getLong(request, "docPraticaId"); - DocPratica docPratica = DocPraticaServiceUtil.getDocPratica(docPraticaId); - FirmeBean firme = FirmeUtil.deserialize(docPratica.getJsonFirmatari()); +long docPraticaId = ParamUtil.getLong(request, "docPraticaId"); +DocPratica docPratica = DocPraticaServiceUtil.getDocPratica(docPraticaId); +FirmeBean firme = FirmeUtil.deserialize(docPratica.getJsonFirmatari()); - boolean disabledInput = ParamUtil.getBoolean(request,"disabledInput", false); +boolean disabledInput = ParamUtil.getBoolean(request,"disabledInput", false); - boolean hasDelegaFirma = DelegheUtil.hasDelegaFirma(user.getUserId(), docPraticaId, "page_geologica".equalsIgnoreCase(comingFrom)); - boolean canSignGeoDocs = "page_geologica".equalsIgnoreCase(comingFrom) && hasDelegaFirma; +boolean hasDelegaFirma = DelegheUtil.hasDelegaFirma(user.getUserId(), docPraticaId, "page_geologica".equalsIgnoreCase(comingFrom)); +boolean canSignGeoDocs = "page_geologica".equalsIgnoreCase(comingFrom) && hasDelegaFirma; %> - <% - if(firme.firmaIsPresent(user.getScreenName())){ - if(firme.firmaIsAnnullabile(user.getScreenName())){ - %> +<% + if (firme.firmaIsPresent(user.getScreenName())) { + if (firme.firmaIsAnnullabile(user.getScreenName())) { +%> - - + +
- +
@@ -89,8 +87,8 @@ <% - } - }else{ + } + } else { %> @@ -133,14 +131,14 @@ <% - } + } %>
- +
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/allegatipratica/view.jsp b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/allegatipratica/view.jsp index 32167b08..352b204f 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/allegatipratica/view.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/allegatipratica/view.jsp @@ -1,4 +1,7 @@ <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@page import="it.tref.liferay.portos.bo.shared.util.SessionUtil"%> +<%@page import="java.util.HashMap"%> +<%@page import="java.util.Map"%> <%@page import="it.tref.liferay.portos.bo.shared.util.TipoIntegrazioneUtil"%> <%@page import="it.tref.liferay.portos.bo.service.FineLavoriLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.service.CollaudoLocalServiceUtil"%> @@ -30,102 +33,109 @@ <%@page import="it.tref.liferay.portos.bo.service.persistence.SoggettoUtil"%> <%@page import="java.util.ArrayList"%> -<%@ include file="/html/soggettipratica/init.jsp" %> +<%@ include file="/html/soggettipratica/init.jsp"%> <% - String comingFrom = ParamUtil.getString(request,"comingFrom", - GetterUtil.getString( - PortalUtil.getOriginalServletRequest(request).getParameter("comingFrom"), - "page_allegati") - ); +String comingFrom = ParamUtil.getString( + request, + "comingFrom", + GetterUtil.getString(PortalUtil.getOriginalServletRequest(request).getParameter("comingFrom"), "page_allegati") +); - long classPk = ParamUtil.getLong(request, "classPk"); - String className = ParamUtil.getString(request, "className"); - long intPraticaId = ParamUtil.getLong(request, "intPraticaId"); +long classPk = ParamUtil.getLong(request, "classPk"); +String className = ParamUtil.getString(request, "className"); +long intPraticaId = ParamUtil.getLong(request, "intPraticaId"); - - if(FineLavori.class.getName().equalsIgnoreCase(className)){ - FineLavori fineLavori = FineLavoriServiceUtil.getFineLavori(classPk); - intPraticaId = fineLavori.getIntPraticaId(); - } else if(Collaudo.class.getName().equalsIgnoreCase(className)){ - Collaudo collaudo = CollaudoServiceUtil.getCollaudo(classPk); - intPraticaId = collaudo.getIntPraticaId(); - }else{ - DettPratica dettPratica = (DettPratica)request.getAttribute("bean.dettPratica"); - HttpServletRequest httpServletRequest = PortalUtil.getOriginalServletRequest(request); - if(dettPratica==null){ - long dettPraticaIdParam = ParamUtil.getLong(request, "classPk"); - if(dettPraticaIdParam==0){ - dettPraticaIdParam = GetterUtil.getLong( httpServletRequest.getParameter("classPk")); - } - dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaIdParam); - } - if(dettPratica == null){ - dettPratica = DettPraticaServiceUtil.getDettPratica(classPk); +if (FineLavori.class.getName().equalsIgnoreCase(className)) { + FineLavori fineLavori = FineLavoriServiceUtil.getFineLavori(classPk); + intPraticaId = fineLavori.getIntPraticaId(); +} else if (Collaudo.class.getName().equalsIgnoreCase(className)) { + Collaudo collaudo = CollaudoServiceUtil.getCollaudo(classPk); + intPraticaId = collaudo.getIntPraticaId(); +} else { + DettPratica dettPratica = (DettPratica)request.getAttribute("bean.dettPratica"); + HttpServletRequest httpServletRequest = PortalUtil.getOriginalServletRequest(request); + if (dettPratica == null) { + long dettPraticaIdParam = ParamUtil.getLong(request, "classPk"); + if (dettPraticaIdParam == 0) { + dettPraticaIdParam = GetterUtil.getLong(httpServletRequest.getParameter("classPk")); } - - request.setAttribute("bean.dettPratica",dettPratica); - classPk = dettPratica.getDettPraticaId(); - intPraticaId = dettPratica.getIntPraticaId(); + dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaIdParam); } - + if (dettPratica == null) { + dettPratica = DettPraticaServiceUtil.getDettPratica(classPk); + } + + request.setAttribute("bean.dettPratica", dettPratica); + classPk = dettPratica.getDettPraticaId(); + intPraticaId = dettPratica.getIntPraticaId(); +} +Map cfNome = new HashMap(); +for (Soggetto soggetto : SoggettoLocalServiceUtil.findByIntPratica(intPraticaId)) { + cfNome.put(soggetto.getCodiceFiscale(), soggetto.getNome() + StringPool.SPACE + soggetto.getCognome()); +} +Map dettPraticas = new HashMap(); - boolean inBO = ParamUtil.getBoolean(request,"inBO",false); - boolean disabled = ParamUtil.getBoolean(request,"disabled"); +boolean inBO = ParamUtil.getBoolean(request, "inBO", false); +boolean disabled = ParamUtil.getBoolean(request, "disabled"); - IntPratica intPratica = IntPraticaServiceUtil.getIntPratica(intPraticaId); - Soggetto soggettoDelegato = null; +IntPratica intPratica = IntPraticaServiceUtil.getIntPratica(intPraticaId); +Soggetto soggettoDelegato = null; - boolean disabledInput = true; - boolean canSignGeoDocs = false; - if(Validator.isNotNull(request.getParameter("disabled"))){ - disabledInput = disabled; - } else if("page_allegati".equalsIgnoreCase(comingFrom)){ - disabledInput = !DelegheUtil.hasDelegaCompilazioneDomanda(user.getUserId(),classPk) - && !DelegheUtil.hasDelegaFirmaAllegati(user.getUserId(),classPk); - soggettoDelegato = DelegheUtil.getPersonaDelegaCompilazioneDomanda(classPk); - } else if ("page_geologica".equalsIgnoreCase(comingFrom)) { - disabledInput = !DelegheUtil.hasDelegaCompilazioneSezioneGeologica(user.getUserId(),classPk); - soggettoDelegato = DelegheUtil.getPersonaDelegaCompilazioneSezioneGeologica(classPk); - canSignGeoDocs = true; - } else if ("page_fine_lavori".equalsIgnoreCase(comingFrom)) { - disabledInput = disabled; - } else if ("page_collaudo".equalsIgnoreCase(comingFrom)) { - disabledInput = disabled; +boolean disabledInput = true; +boolean canSignGeoDocs = false; +if (Validator.isNotNull(request.getParameter("disabled"))) { + disabledInput = disabled; +} else if ("page_allegati".equalsIgnoreCase(comingFrom)) { + Boolean hasDelegaCompilazioneDomanda = (Boolean) SessionUtil.getDettPraticaObject(request, classPk, "hasDelegaCompilazioneDomanda"); + if (null == hasDelegaCompilazioneDomanda) { + hasDelegaCompilazioneDomanda = DelegheUtil.hasDelegaCompilazioneDomanda(user.getUserId(),classPk); } -%> - - - - - - - - - + disabledInput = !hasDelegaCompilazioneDomanda + && !DelegheUtil.hasDelegaFirmaAllegati(user.getUserId(),classPk); + soggettoDelegato = DelegheUtil.getPersonaDelegaCompilazioneDomanda(classPk); +} else if ("page_geologica".equalsIgnoreCase(comingFrom)) { + disabledInput = !DelegheUtil.hasDelegaCompilazioneSezioneGeologica(user.getUserId(),classPk); + soggettoDelegato = DelegheUtil.getPersonaDelegaCompilazioneSezioneGeologica(classPk); + canSignGeoDocs = true; +} else if ("page_fine_lavori".equalsIgnoreCase(comingFrom)) { + disabledInput = disabled; +} else if ("page_collaudo".equalsIgnoreCase(comingFrom)) { + disabledInput = disabled; +} +%> + + + + + + + + - - - - - - - + + + + + + + <% - String refresh="Liferay.fire('allegati-"+comingFrom+"-open');Liferay.Portlet.refresh('#p_p_id"+renderResponse.getNamespace()+"');"; +String refresh = "Liferay.fire('allegati-" + comingFrom + "-open');Liferay.Portlet.refresh('#p_p_id" + + renderResponse.getNamespace() + "');"; %> - +
<% - List tipologiaAllegati = new ArrayList(); - if("page_geologica".equals(comingFrom)){ - tipologiaAllegati = DocumentiPraticaUtil.getDocGeologo(); - }else if("page_allegati".equals(comingFrom)){ - tipologiaAllegati = DocumentiPraticaUtil.getDocDomanda(); - }else if("page_fine_lavori".equals(comingFrom)){ - tipologiaAllegati = DocumentiPraticaUtil.getDocFineLavori(); - }else if("page_collaudo".equals(comingFrom)){ - tipologiaAllegati = DocumentiPraticaUtil.getDocCollaudo(); - } - +List tipologiaAllegati = new ArrayList(); +if ("page_geologica".equals(comingFrom)) { + tipologiaAllegati = DocumentiPraticaUtil.getDocGeologo(); +}else if ("page_allegati".equals(comingFrom)) { + tipologiaAllegati = DocumentiPraticaUtil.getDocDomanda(); +}else if ("page_fine_lavori".equals(comingFrom)) { + tipologiaAllegati = DocumentiPraticaUtil.getDocFineLavori(); +}else if ("page_collaudo".equals(comingFrom)) { + tipologiaAllegati = DocumentiPraticaUtil.getDocCollaudo(); +} %>
- -
+ +
Descrizione
@@ -182,7 +187,7 @@
Rimosso da
Firme -
+
Presenti
Le tue firme
@@ -192,297 +197,282 @@
- - -
-
- Descrizione -
-
- Firme presenti -
+ + +
+
Descrizione
+
Firme presenti
Azioni
- -
-
- Descrizione -
-
- Provenienza -
-
- Firme presenti -
+ +
+
Descrizione
+
Provenienza
+
Firme presenti
Azioni
- - - - <% - for(String codiceDoc:tipologiaAllegati){ - List docPraticas = new ArrayList(); - if(FineLavori.class.getName().equalsIgnoreCase(className) || Collaudo.class.getName().equalsIgnoreCase(className)){ - docPraticas = DocPraticaServiceUtil.findByClassPk_Tipologia(classPk, codiceDoc, QueryUtil.ALL_POS,QueryUtil.ALL_POS); - } else { - docPraticas = DocPraticaServiceUtil.findByIntPratica_ClassPk_Tipologia(intPratica.getIntPraticaId(), classPk, codiceDoc, QueryUtil.ALL_POS,QueryUtil.ALL_POS); - } - %> -
- <%=docPraticas.size()%> - + - <% - /* List docPraticas = DocPraticaServiceUtil.findByIntPratica_Tipologia(intPratica.getIntPraticaId(),codiceDoc, - QueryUtil.ALL_POS,QueryUtil.ALL_POS, OrderByComparatorFactoryUtil.create("portos_bo_DocPratica", "dettPraticaIdRimozione", true)); */ +<% +for (String codiceDoc:tipologiaAllegati) { + List docPraticas = new ArrayList(); - if(docPraticas.isEmpty()){ - %> + if(FineLavori.class.getName().equals(className) || Collaudo.class.getName().equals(className)) { + docPraticas = DocPraticaServiceUtil.findByClassPk_Tipologia(classPk, codiceDoc, QueryUtil.ALL_POS,QueryUtil.ALL_POS); + } else { + docPraticas = DocPraticaServiceUtil.findByIntPratica_ClassPk_Tipologia(intPraticaId, classPk, codiceDoc, QueryUtil.ALL_POS,QueryUtil.ALL_POS); + } +%> +
+ <%=docPraticas.size()%> + + <% + if (docPraticas.isEmpty()) { + %>
-
- Nessun allegato presente per la tipologia -
+
Nessun allegato presente per la + tipologia
- <% - } else { - for(DocPratica docPratica:docPraticas){ - - FirmeBean firme = FirmeUtil.deserialize(docPratica.getJsonFirmatari()); - - StringBuilder title = new StringBuilder(); - - String cssIcon = StringPool.BLANK; - String cssColor= StringPool.BLANK; - String testoFirme = "Non ci sono firme sul file"; - if(firme.getFirmeDigitali().size()> 0){ - cssIcon = "fa-check"; - cssColor= "txt-green"; - testoFirme=""; - } else if(docPratica.getStatus() == 1){ - cssIcon= "fa-cog fa-spin"; - cssColor= "txt-orange"; - testoFirme="Estrazione firme in corso"; - }else if(docPratica.getStatus() == 4){ - cssIcon= "fa-alert"; - cssColor= "txt-red"; - testoFirme="Errore nell'estrazione delle firme"; + <% } else { - cssIcon = "fa-close"; - testoFirme="Nessuna firma digitale rilevata"; - if(firme.numeroFirme()>0){ - cssColor= "txt-green"; + for (DocPratica docPratica : docPraticas) { + FirmeBean firme = FirmeUtil.deserialize(docPratica.getJsonFirmatari()); + + StringBuilder title = new StringBuilder(); + String cssIcon = StringPool.BLANK; + String cssColor= StringPool.BLANK; + String testoFirme = "Non ci sono firme sul file"; + if (firme.getFirmeDigitali().size() > 0) { + cssIcon = "fa-check"; + cssColor= "txt-green"; + testoFirme = StringPool.BLANK; + } else if (docPratica.getStatus() == 1) { + cssIcon= "fa-cog fa-spin"; + cssColor= "txt-orange"; + testoFirme = "Estrazione firme in corso"; + } else if (docPratica.getStatus() == 4) { + cssIcon= "fa-alert"; + cssColor= "txt-red"; + testoFirme = "Errore nell'estrazione delle firme"; + } else { + cssIcon = "fa-close"; + testoFirme = "Nessuna firma digitale rilevata"; + if (firme.numeroFirme() > 0) { + cssColor= "txt-green"; + } + } + if (firme.numeroFirme() > 0) { + cssIcon = "fa-check"; + } + title.append("Firma sul file:
    "); + title.append("
  • " + testoFirme + "
  • "); + if (!firme.getFirmeDigitali().isEmpty()) { + for (FirmeDetail firma: firme.getFirmeDigitali()) { + if (cfNome.containsKey(firma.getCfFirmatario())) { + title.append("
  • " + cfNome.get(firma.getCfFirmatario()) + "
  • "); + } + title.append("
  • " + firma.getCfFirmatario()); + if (Validator.isNotNull(firma.getDtFirma())) { + title.append(" del " + dateFormatDate.format(firma.getDtFirma())); + } + title.append("
  • "); + } + } + title.append("
"); + if (!firme.getFirmeApplicativo().isEmpty()) { + title.append("Firme da applicativo:
    "); + for (FirmeDetail firma: firme.getFirmeApplicativo()) { + if (cfNome.containsKey(firma.getCfFirmatario())) { + title.append("
  • " + cfNome.get(firma.getCfFirmatario()) + "
  • "); + } + title.append("
  • "+firma.getCfFirmatario()); + if (Validator.isNotNull(firma.getDtFirma())) { + title.append(" del "+dateFormatDate.format(firma.getDtFirma())); + } + title.append("
  • "); + } + title.append("
"); + } + %> +
+ +
+ + +
+ + <% + String color = "txt-red"; + if (Validator.isNull(docPratica.getDettPraticaIdRimozione())) { + color = "txt-green"; } - } - if(firme.numeroFirme()>0){ - cssIcon = "fa-check"; - } + %> + + <%= docPratica.getDescLong() %> +
- //if(firme.numeroFirme()>0){ - title.append("Firma sul file:
    "); - title.append("
  • "+testoFirme+"
  • "); - if(!firme.getFirmeDigitali().isEmpty()){ +
    + <% + String adding = StringPool.BLANK; + if (FineLavori.class.getName().equals(className)) { + FineLavori fineLavori = FineLavoriLocalServiceUtil.fetchFineLavori(docPratica.getClassPk()); + if (fineLavori != null) { + adding = fineLavori.getFullDescription(); + } + } else if (Collaudo.class.getName().equalsIgnoreCase(className)) { + Collaudo collaudo = CollaudoLocalServiceUtil.fetchCollaudo(docPratica.getClassPk()); + if (collaudo != null) { + adding = collaudo.getFullDescription(); + } + } else { + long pk = docPratica.getClassPk(); + if (!dettPraticas.containsKey(pk)) { + dettPraticas.put(pk, DettPraticaLocalServiceUtil.fetchDettPratica(pk)); + } + DettPratica dettPratica = dettPraticas.get(pk); + if (Validator.isNotNull(dettPratica)) { + adding = dettPratica.getFullDescription(); + } + } + out.print(adding); + %> +
    - for(FirmeDetail firma: firme.getFirmeDigitali()){ - //TODO nome e cognome - List soggetti = SoggettoLocalServiceUtil.findByIntPratica_CodiceFiscale(docPratica.getIntPraticaId(), firma.getCfFirmatario()); - if (soggetti.size() > 0 ){ - title.append("
  • "+soggetti.get(0).getNome() + " " + soggetti.get(0).getCognome()+"
  • "); - } - title.append("
  • "+firma.getCfFirmatario()); - if(Validator.isNotNull(firma.getDtFirma())){ - title.append(" del "+dateFormatDate.format(firma.getDtFirma())); - } - title.append("
  • "); - } - } - title.append("
"); - if(!firme.getFirmeApplicativo().isEmpty()){ - title.append("Firme da applicativo:
    "); - for(FirmeDetail firma: firme.getFirmeApplicativo()){ - //TODO nome e cognome - List soggetti = SoggettoLocalServiceUtil.findByIntPratica_CodiceFiscale(docPratica.getIntPraticaId(), firma.getCfFirmatario()); - if (soggetti.size() > 0 ){ - title.append("
  • "+soggetti.get(0).getNome() + " " + soggetti.get(0).getCognome()+"
  • "); - } - title.append("
  • "+firma.getCfFirmatario()); - if(Validator.isNotNull(firma.getDtFirma())){ - title.append(" del "+dateFormatDate.format(firma.getDtFirma())); - } - title.append("
  • "); - } - title.append("
"); - } - //} +
+ <% + //Lasciato solo dettpratica perche' fine lavori e collaudo non possono rimuovere gli allegati + long pk = docPratica.getDettPraticaIdRimozione(); + if (0 != pk) { + if (!dettPraticas.containsKey(pk)) { + dettPraticas.put(pk, DettPraticaLocalServiceUtil.fetchDettPratica(pk)); + } + DettPratica dettPratica = dettPraticas.get(pk); + if (Validator.isNotNull(dettPratica)) { + out.print(dettPratica.getFullDescription()); + } + } + %> +
- %> -
- -
- - -
- - <% - String color = ""; - if( Validator.isNotNull(docPratica.getDettPraticaIdRimozione()) ){ - color = "txt-red"; + +
+ + <% + if (className.equals(DettPratica.class.getName())) { + pk = docPratica.getClassPk(); + if (!dettPraticas.containsKey(pk)) { + dettPraticas.put(pk, DettPraticaLocalServiceUtil.fetchDettPratica(pk)); + } + DettPratica dett = dettPraticas.get(pk); + if (Validator.isNotNull(dett)) { + if (dett.getIntegrazione() == 0) { + out.print("Pratica Originale"); } else { - color = "txt-green"; - } - %> - <%=docPratica.getDescLong() %> -
- -
- <% - String adding = StringPool.BLANK; - if(FineLavori.class.getName().equalsIgnoreCase(className)){ - FineLavori fineLavori = FineLavoriLocalServiceUtil.fetchFineLavori(docPratica.getClassPk()); - if(fineLavori!=null){ - adding = fineLavori.getFullDescription(); - } - } else if(Collaudo.class.getName().equalsIgnoreCase(className)){ - Collaudo collaudo = CollaudoLocalServiceUtil.fetchCollaudo(docPratica.getClassPk()); - if(collaudo!=null){ - adding = collaudo.getFullDescription(); - } - }else{ - DettPratica dettPratica = DettPraticaLocalServiceUtil.fetchDettPratica(docPratica.getClassPk()); - if(dettPratica!=null){ - adding = dettPratica.getFullDescription(); - } + if (dett.getTipoIntegrazione().equals(TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE)) { + out.print("Ric Integrazione # " + dett.getIntegrazione()); + } else if (dett.getTipoIntegrazione().equals(TipoIntegrazioneUtil.VARIANTE)) { + out.print("Variante # " + dett.getVarianteNumero()); + } } + } + } + %> + +
+
- out.print(adding); - %> -
- -
- <% - //Lasciato solo dettpratica perche' fine lavori e collaudo non possono rimuovere gli allegati - DettPratica removing = DettPraticaLocalServiceUtil.fetchDettPratica(docPratica.getDettPraticaIdRimozione()); - if(removing != null){ - out.print(removing.getFullDescription()); - } - %> -
- - -
- - <% - StringBuilder sbProvenienza = new StringBuilder(); - - if(className.equals(DettPratica.class.getName())){ - DettPratica dett = DettPraticaLocalServiceUtil.fetchDettPratica(docPratica.getClassPk()); - if(dett != null){ - if(dett.getIntegrazione() == 0){ - sbProvenienza.append("Pratica Originale"); - } else { - if(dett.getTipoIntegrazione().equals(TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE)){ - sbProvenienza.append("Ric Integrazione # " + dett.getIntegrazione()); - } else if(dett.getTipoIntegrazione().equals(TipoIntegrazioneUtil.VARIANTE)){ - sbProvenienza.append("Variante # " + dett.getVarianteNumero()); - } - } - } - } - %> - <%=sbProvenienza.toString() %> - - -
- -
+ + + +
+ + +
+ + + - - -
- - -
- - - - -
- + +
+ -
- - - <%= firme.numeroFirme() %> - - -
-
- <% - if(firme.firmaIsPresent(user.getScreenName())){ - %> - - <% - }else{ - %> - - <% - } - %> -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
+
+ + + <%= firme.numeroFirme() %> + + +
+
+ + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + - <% - } - } - %> - + + + + +
- <% - } - %>
+ + <% + } + } + %> +
- +<% + } +%> +
+
+
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/edit_fascicolo.jsp b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/edit_fascicolo.jsp index 2783b8b0..cfb1a8a8 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/edit_fascicolo.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/edit_fascicolo.jsp @@ -1,3 +1,5 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@page import="it.tref.liferay.portos.bo.shared.util.SessionUtil"%> <%@page import="com.liferay.portal.kernel.util.HttpUtil"%> <%@page import="it.tref.liferay.portos.bo.shared.util.PortletKeys"%> <%@page import="it.tref.liferay.portos.bo.shared.util.TipoIntegrazioneUtil"%> @@ -14,88 +16,91 @@ <%@ include file="/html/fascicolofe/init.jsp" %> <% - String backURL = ParamUtil.getString(request, "backURL"); - long dettPraticaId = ParamUtil.getLong(request, "dettPraticaId",0l); - long intPraticaId = ParamUtil.getLong(request, "intPraticaId",0l); - String current_tab = ParamUtil.getString(request, "current_tab",StringPool.BLANK); - - boolean openVerifyUrl = ParamUtil.getBoolean(request, "openVerifyUrl"); - String verifyArea = ParamUtil.getString(request, "verifyArea", StringPool.BLANK); - DettPratica dettPratica = null; - IntPratica intPratica = null; - if(dettPraticaId!=0l){ - dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId); - intPratica = IntPraticaLocalServiceUtil.getIntPratica(dettPratica.getIntPraticaId()); - intPraticaId = dettPratica.getIntPraticaId(); - }else{ - intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId); - dettPratica = DettPraticaServiceUtil.getLastEditableByIntPratica(intPraticaId); - if(dettPratica==null){ - dettPratica = DettPraticaServiceUtil.getLastCompletedByIntPratica(intPraticaId); - } - dettPraticaId = dettPratica.getDettPraticaId(); +String backURL = ParamUtil.getString(request, "backURL"); +long dettPraticaId = ParamUtil.getLong(request, "dettPraticaId", 0l); +long intPraticaId = ParamUtil.getLong(request, "intPraticaId", 0l); +String current_tab = ParamUtil.getString(request, "current_tab", StringPool.BLANK); + +boolean openVerifyUrl = ParamUtil.getBoolean(request, "openVerifyUrl"); +String verifyArea = ParamUtil.getString(request, "verifyArea", StringPool.BLANK); +DettPratica dettPratica = null; +IntPratica intPratica = null; +if (dettPraticaId != 0l) { + dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId); + intPraticaId = dettPratica.getIntPraticaId(); + intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId); +} else { + intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId); + dettPratica = DettPraticaServiceUtil.getLastEditableByIntPratica(intPraticaId); + if (dettPratica == null) { + dettPratica = DettPraticaServiceUtil.getLastCompletedByIntPratica(intPraticaId); } + dettPraticaId = dettPratica.getDettPraticaId(); +} - request.setAttribute("bean.dettPratica", dettPratica); +request.setAttribute("bean.dettPratica", dettPratica); - String tipoIntegrazione = dettPratica.getTipoIntegrazione(); - request.setAttribute("bean.tipoIntegrazione", tipoIntegrazione); - - boolean disabledInput = !DelegheUtil.hasDelegaCompilazioneDomanda(user.getUserId(),dettPratica.getDettPraticaId()); - boolean geoDisabledInput = !DelegheUtil.hasDelegaCompilazioneSezioneGeologica(user.getUserId(),dettPratica.getDettPraticaId()) - || !ValidazionePraticaUtil.praticaIsEditable(dettPratica.getDettPraticaId()); - - String[] pageDatiDomanda = new String[] {"page_dettagli_principali", "page_soggetti", "page_desc_edificio", - "page_geologica", "page_allegati", "page_asseverazioni_riepilogo"}; - - if(TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equals(tipoIntegrazione)){ - pageDatiDomanda = Arrays.copyOf(pageDatiDomanda, pageDatiDomanda.length-1); - } +String tipoIntegrazione = dettPratica.getTipoIntegrazione(); +request.setAttribute("bean.tipoIntegrazione", tipoIntegrazione); + +Soggetto soggettoDelegato = DelegheUtil.getPersonaDelegaCompilazioneDomanda(dettPraticaId); +SessionUtil.setDettPraticaObject(request, dettPraticaId, "soggettoDelegato", soggettoDelegato); +Boolean hasDelegaCompilazioneDomanda = DelegheUtil.hasDelegaCompilazioneDomanda(user.getUserId(), dettPraticaId); +SessionUtil.setDettPraticaObject(request, dettPraticaId, "hasDelegaCompilazioneDomanda", hasDelegaCompilazioneDomanda); +Boolean praticaIsEditable = ValidazionePraticaUtil.praticaIsEditable(dettPraticaId); +SessionUtil.setDettPraticaObject(request, dettPraticaId, "praticaIsEditable", praticaIsEditable); +Boolean pagamentoIsEnable = ValidazionePraticaUtil.pagamentoIsEnable(dettPraticaId); +SessionUtil.setDettPraticaObject(request, dettPraticaId, "pagamentoIsEnable", pagamentoIsEnable); - String[][] categorySections = {pageDatiDomanda}; +boolean disabledInput = !DelegheUtil.hasDelegaCompilazioneDomanda(user.getUserId(), dettPraticaId); +boolean geoDisabledInput = !DelegheUtil.hasDelegaCompilazioneSezioneGeologica(user.getUserId(), dettPraticaId) + || !praticaIsEditable; - String[] _CATEGORY_NAMES = {"cat_dati_domanda"}; +String[] pageDatiDomanda = new String[] { + "page_dettagli_principali", "page_soggetti", "page_desc_edificio", + "page_geologica", "page_allegati", "page_asseverazioni_riepilogo" +}; +if (TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equals(tipoIntegrazione)) { + pageDatiDomanda = Arrays.copyOf(pageDatiDomanda, pageDatiDomanda.length-1); +} +String[][] categorySections = { pageDatiDomanda }; +String[] _CATEGORY_NAMES = { "cat_dati_domanda" }; %> - - - - + + + + - - - - + + + + - - - - + - + - - + <%@ include file="/html/fascicolofe/navigator/common/html_top.jspf" %> - + <%@ include file="/html/fascicolofe/navigator/common/html_top_pagamento.jspf" %> - + <%@ include file="/html/fascicolofe/navigator/common/html_bottom.jspf" %> - - - - + @@ -291,3 +294,4 @@ document.location.hash='_1_WAR_portosfeportlet_tab=<%=current_tab%>'; } +<% SessionUtil.cleanDettPraticaObjects(request, dettPraticaId); %> \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/fascicolo_action.jsp b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/fascicolo_action.jsp index d5a28bac..dfde69cd 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/fascicolo_action.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/fascicolo_action.jsp @@ -225,7 +225,7 @@ boolean canAddIntegrazione = ValidazionePraticaUtil.praticaCanAddIntegrazione(intPratica.getIntPraticaId()); boolean canEditIntegrazione = ValidazionePraticaUtil.praticaCanEditIntegrazione(intPratica.getIntPraticaId()); boolean canDeleteIntegrazione = ValidazionePraticaUtil.praticaCanDeleteIntegrazione(intPratica.getIntPraticaId()); - %> + %>
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/common/html_top_pagamento.jspf b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/common/html_top_pagamento.jspf index 599977cb..4a3b7e06 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/common/html_top_pagamento.jspf +++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/common/html_top_pagamento.jspf @@ -1,8 +1,6 @@ <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> - <%@page import="com.liferay.portal.kernel.util.StringPool"%> <%@page import="com.liferay.portal.kernel.language.LanguageUtil"%> - <%@page import="it.tref.liferay.portos.bo.service.PagamentoLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.util.ValidazionePraticaUtil"%> <%@page import="it.tref.liferay.portos.bo.model.Asseverazione"%> @@ -38,11 +36,11 @@
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/common/save_actions.jspf b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/common/save_actions.jspf index 63698e4a..7d36a88c 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/common/save_actions.jspf +++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/common/save_actions.jspf @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="it.tref.liferay.portos.bo.shared.util.PortletKeys"%> <%@page import="com.liferay.portal.kernel.language.LanguageUtil"%> <%@page import="it.tref.liferay.portos.bo.model.Delega"%> @@ -28,38 +29,30 @@ <%@page import="it.tref.liferay.portos.bo.util.DelegheUtil"%>
<% - Log _log = LogFactoryUtil.getLog("save_actions.jspf"); +String randomId = StringUtil.randomId(); +String formName = "fmDomande"; +String buttonId = "fmbuttonsalvaconferma_" + randomId; +String buttonAsseverazioneId = "fmbuttonasseverazione_" + randomId; +String script = + "var el_relazioni = $('textarea[name=_" + PortletKeys.FASCICOLOFE + "_{{prefix}}Relazioni]');" + + "if (el_relazioni.length) {" + + " var el_coniugio = $('input[name=_" + PortletKeys.FASCICOLOFE + "_{{prefix}}Coniugio]');" + + " var el_coniugiochk = $('input[name=_" + PortletKeys.FASCICOLOFE + "_{{prefix}}Coniugio]:checked');" + + " console.log('length: ' + el_relazioni.length);" + + " var err_coniugio = (el_coniugiochk.length == 0);" + + " var err_relazioni = ((el_relazioni.val().replace(/\\s*/g, '').length < 10) && (el_coniugiochk.val() == 1));" + + " el_coniugio.parent().css({color:(err_coniugio ? '#a94442' : '#333')});" + + " el_relazioni.css({'border-color':(err_relazioni ?'#a94442' : '#ccc')});" + + " if (err_coniugio || err_relazioni) {" + + " $('#" + renderResponse.getNamespace() + "{{prefix}}SaveAndCloseDiv_" + randomId + "').parent().scrollTop(0);" + + " return false;" + + " }" + + "}" + + "saveDettPratica(false, '{{type}}');"; - String randomId = StringUtil.randomId(); - String formName = "fmDomande"; - String buttonId = "fmbuttonsalvaconferma_" + randomId; - String buttonAsseverazioneId = "fmbuttonasseverazione_" + randomId; - String script = "var el_relazioni = $('textarea[name=_" - + PortletKeys.FASCICOLOFE - + "_{{prefix}}Relazioni]');" - + "if (el_relazioni.length) {" - + "var el_coniugio = $('input[name=_" - + PortletKeys.FASCICOLOFE - + "_{{prefix}}Coniugio]');" - + "var el_coniugiochk = $('input[name=_" - + PortletKeys.FASCICOLOFE - + "_{{prefix}}Coniugio]:checked');" - + - - "console.log('length: ' + el_relazioni.length);" - + - - "var err_coniugio = (el_coniugiochk.length == 0);" - + "var err_relazioni = ((el_relazioni.val().replace(/\\s*/g, '').length < 10) && (el_coniugiochk.val() == 1));" - + - - "el_coniugio.parent().css({color:(err_coniugio ? '#a94442' : '#333')});" - + "el_relazioni.css({'border-color':(err_relazioni ?'#a94442' : '#ccc')});" + - - "if (err_coniugio || err_relazioni) {" + "$('#" + renderResponse.getNamespace() - + "{{prefix}}SaveAndCloseDiv_" + randomId + "').parent().scrollTop(0);" + "return false;" - + "}" + "}" + "saveDettPratica(false, '{{type}}');"; - %> +boolean hasDelegaAttiva = DelegheUtil.hasDelegaAttiva(user.getUserId(), dettPraticaId); +boolean hasAsseverazioneAttiva = AsseverazioniUtil.hasAsseverazioneAttiva(user.getUserId(), intPraticaId); +%> - - + @@ -94,16 +83,7 @@ && dettPratica.getNormEsenteSpese(); boolean isIntegrazione = dettPratica.getTipoIntegrazione().equals( TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE); - %> - <%-- - - --%> - <% + Map dataMap = new HashMap(); dataMap.put("id", renderResponse.getNamespace() + "openVerificaFascicolo"); %> @@ -142,8 +122,7 @@ - + <% long delegaId = ParamUtil.getLong(request, "delegaId"); - if (delegaId == 0) { - _log.error("Errore pratica id " + intPratica.getIntPraticaId() + ", utente " - + user.getScreenName() + ", delegaId = 0"); - } Delega delega = DelegaLocalServiceUtil.getDelega(delegaId); boolean validated = true; StringBuilder tooltipSection = new StringBuilder(); @@ -354,7 +327,7 @@ - +
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_allegati.jsp b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_allegati.jsp index 9a64f2eb..a211d480 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_allegati.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_allegati.jsp @@ -8,18 +8,15 @@ <%@ include file="/html/fascicolofe/init.jsp" %> <% - String comingFrom = ParamUtil.getString(request,"comingFrom","page_allegati"); - DettPratica dettPratica = (DettPratica)request.getAttribute("bean.dettPratica"); - long dettPraticaId = ParamUtil.getLong(request, "dettPraticaId"); - if(dettPratica==null){ - dettPraticaId = ParamUtil.getLong(request, "dettPraticaId"); - dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId); - }else{ - dettPraticaId = dettPratica.getDettPraticaId(); - } - - String tipoIntegrazione = (String)request.getAttribute("bean.tipoIntegrazione"); - +String comingFrom = ParamUtil.getString(request,"comingFrom", "page_allegati"); +DettPratica dettPratica = (DettPratica)request.getAttribute("bean.dettPratica"); +long dettPraticaId = ParamUtil.getLong(request, "dettPraticaId"); +if (dettPratica == null) { + dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId); +} else { + dettPraticaId = dettPratica.getDettPraticaId(); +} +String tipoIntegrazione = (String)request.getAttribute("bean.tipoIntegrazione"); %> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_asseverazioni_riepilogo.jsp b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_asseverazioni_riepilogo.jsp index 77a06858..1c6766ca 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_asseverazioni_riepilogo.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_asseverazioni_riepilogo.jsp @@ -1,4 +1,5 @@ <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@page import="it.tref.liferay.portos.bo.shared.util.SessionUtil"%> <%@page import="com.liferay.portal.service.UserLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.util.AsseverazioniUtil"%> @@ -13,13 +14,12 @@ <%@page import="it.tref.liferay.portos.bo.model.DettPratica"%> <%@ include file="/html/fascicolofe/init.jsp"%> <% - DettPratica dettPratica = (DettPratica)request.getAttribute("bean.dettPratica"); - long dettPraticaId = dettPratica.getDettPraticaId(); - - long intPraticaId = dettPratica.getIntPraticaId(); - - boolean disabledInput = !DelegheUtil.hasDelegaCompilazioneDomanda(user.getUserId(),dettPratica.getDettPraticaId()); - Soggetto soggettoDelegato = DelegheUtil.getPersonaDelegaCompilazioneDomanda(dettPratica.getDettPraticaId()); +DettPratica dettPratica = (DettPratica)request.getAttribute("bean.dettPratica"); +long dettPraticaId = dettPratica.getDettPraticaId(); +long intPraticaId = dettPratica.getIntPraticaId(); +boolean hasDelegaCompilazioneDomanda = (Boolean) SessionUtil.getDettPraticaObject(request, dettPraticaId, "hasDelegaCompilazioneDomanda"); +boolean disabledInput = !hasDelegaCompilazioneDomanda; +Soggetto soggettoDelegato = (Soggetto) SessionUtil.getDettPraticaObject(request, dettPraticaId, "soggettoDelegato"); %> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_desc_edificio.jsp b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_desc_edificio.jsp index c5af173e..ff11cf5b 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_desc_edificio.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_desc_edificio.jsp @@ -1,4 +1,5 @@ <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@page import="it.tref.liferay.portos.bo.shared.util.SessionUtil"%> <%@page import="it.tref.liferay.portos.bo.shared.util.TipoIntegrazioneUtil"%> <%@page import="com.liferay.portal.kernel.workflow.WorkflowConstants"%> <%@page import="it.tref.liferay.portos.bo.util.DelegheUtil"%> @@ -12,15 +13,15 @@ <%@page import="it.tref.liferay.portos.bo.model.DettPratica"%> <%@ include file="/html/fascicolofe/init.jsp" %> <% - DettPratica dettPratica = (DettPratica)request.getAttribute("bean.dettPratica"); - IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(dettPratica.getIntPraticaId()); - Soggetto soggettoDelegato = DelegheUtil.getPersonaDelegaCompilazioneDomanda(dettPratica.getDettPraticaId()); - request.setAttribute("bean.dettPratica",dettPratica); - - boolean disabledInput = !DelegheUtil.hasDelegaCompilazioneDomanda(user.getUserId(),dettPratica.getDettPraticaId()) - || TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equals(dettPratica.getTipoIntegrazione()); +DettPratica dettPratica = (DettPratica) request.getAttribute("bean.dettPratica"); +IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(dettPratica.getIntPraticaId()); +Soggetto soggettoDelegato = (Soggetto) SessionUtil.getDettPraticaObject(request, dettPratica.getDettPraticaId(), "soggettoDelegato"); +request.setAttribute("bean.dettPratica",dettPratica); + +boolean hasDelegaCompilazioneDomanda = (Boolean) SessionUtil.getDettPraticaObject(request, dettPratica.getDettPraticaId(), "hasDelegaCompilazioneDomanda"); +boolean disabledInput = !hasDelegaCompilazioneDomanda || TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equals(dettPratica.getTipoIntegrazione()); - boolean disabledByIntegrazione = TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE.equals(dettPratica.getTipoIntegrazione()); +boolean disabledByIntegrazione = TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE.equals(dettPratica.getTipoIntegrazione()); %> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_dettagli_principali.jsp b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_dettagli_principali.jsp index 89c90d35..5d182129 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_dettagli_principali.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_dettagli_principali.jsp @@ -1,8 +1,9 @@ <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@page import="java.util.Map"%> +<%@page import="it.tref.liferay.portos.bo.shared.util.SessionUtil"%> <%@page import="it.tref.liferay.portos.bo.util.AzioniPraticheUtil"%> <%@page import="it.tref.liferay.portos.bo.shared.util.PortletKeys"%> -<%@page - import="it.tref.liferay.portos.bo.shared.util.TipoIntegrazioneUtil"%> +<%@page import="it.tref.liferay.portos.bo.shared.util.TipoIntegrazioneUtil"%> <%@page import="it.tref.liferay.portos.bo.service.SoggettoServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.util.SoggettiUtil"%> <%@page import="it.tref.liferay.portos.bo.util.DelegheUtil"%> @@ -11,65 +12,58 @@ <%@page import="java.util.regex.Pattern"%> <%@page import="com.liferay.portal.kernel.bean.BeanParamUtil"%> <%@page import="it.tref.liferay.portos.bo.model.Comune"%> -<%@page - import="it.tref.liferay.portos.bo.service.ProvinciaLocalServiceUtil"%> +<%@page import="it.tref.liferay.portos.bo.service.ProvinciaLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.model.Provincia"%> -<%@page - import="it.tref.liferay.portos.bo.service.ComuneLocalServiceUtil"%> +<%@page import="it.tref.liferay.portos.bo.service.ComuneLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.service.ComuneLocalService"%> <%@page import="it.tref.liferay.portos.bo.model.Territorio"%> -<%@page - import="it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil"%> +<%@page import="it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.model.IntPratica"%> -<%@page - import="it.tref.liferay.portos.bo.service.TerritorioLocalServiceUtil"%> +<%@page import="it.tref.liferay.portos.bo.service.TerritorioLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.model.DettPratica"%> <%@page import="java.util.ArrayList"%> <%@page import="com.liferay.portal.kernel.util.KeyValuePair"%> <%@ include file="/html/fascicolofe/init.jsp"%> <% - DettPratica dettPratica = (DettPratica)request.getAttribute("bean.dettPratica"); - IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(dettPratica.getIntPraticaId()); - Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId()); - Comune comune = ComuneLocalServiceUtil.getComune(territorio.getComuneId()); - Provincia provincia = ProvinciaLocalServiceUtil.fetchByC_C(territorio.getCompanyId(), territorio.getCodiceProvincia()); - - Soggetto soggettoDelegato = DelegheUtil.getPersonaDelegaCompilazioneDomanda(dettPratica.getDettPraticaId()); - request.setAttribute("bean.dettPratica",dettPratica); - - boolean proceduraA = Validator.isNull(intPratica.getTipoProcedura()) || intPratica.getTipoProcedura().equalsIgnoreCase(Constants.PROCEDURA_A); - boolean proceduraC = intPratica.getTipoProcedura().equalsIgnoreCase(Constants.PROCEDURA_C); - boolean alertClassi = !proceduraA && (territorio.getZona().equals("1") || territorio.getZona().equals("2")); + +DettPratica dettPratica = (DettPratica) request.getAttribute("bean.dettPratica"); +IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(dettPratica.getIntPraticaId()); +Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId()); +Comune comune = ComuneLocalServiceUtil.getComune(territorio.getComuneId()); +Provincia provincia = ProvinciaLocalServiceUtil.fetchByC_C(territorio.getCompanyId(), territorio.getCodiceProvincia()); + +Soggetto soggettoDelegato = (Soggetto) SessionUtil.getDettPraticaObject(request, dettPratica.getDettPraticaId(), "soggettoDelegato"); +request.setAttribute("bean.dettPratica",dettPratica); - boolean disabledInput = !DelegheUtil.hasDelegaCompilazioneDomanda(user.getUserId(),dettPratica.getDettPraticaId()) - || TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equals(dettPratica.getTipoIntegrazione()); +boolean proceduraA = Validator.isNull(intPratica.getTipoProcedura()) || intPratica.getTipoProcedura().equalsIgnoreCase(Constants.PROCEDURA_A); +boolean proceduraC = intPratica.getTipoProcedura().equalsIgnoreCase(Constants.PROCEDURA_C); +boolean alertClassi = !proceduraA && (territorio.getZona().equals("1") || territorio.getZona().equals("2")); + +boolean hasDelegaCompilazioneDomanda = (Boolean) SessionUtil.getDettPraticaObject(request, dettPratica.getDettPraticaId(), "hasDelegaCompilazioneDomanda"); +boolean disabledInput = !hasDelegaCompilazioneDomanda || TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equals(dettPratica.getTipoIntegrazione()); - boolean disabledCollaudoStatico = SoggettiUtil.isCommittenteAndDitta(dettPratica.getIntPraticaId()); +boolean disabledCollaudoStatico = SoggettiUtil.isCommittenteAndDitta(dettPratica.getIntPraticaId()); - boolean isGeoEditable = TipoIntegrazioneUtil.VARIANTE.equalsIgnoreCase(dettPratica.getTipoIntegrazione()); - isGeoEditable = false; +boolean isGeoEditable = TipoIntegrazioneUtil.VARIANTE.equalsIgnoreCase(dettPratica.getTipoIntegrazione()); +isGeoEditable = false; - boolean enabledByIntegrazione = DelegheUtil.hasDelegaCompilazioneDomanda(user.getUserId(),dettPratica.getDettPraticaId()) - && TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE.equals(dettPratica.getTipoIntegrazione()); +boolean enabledByIntegrazione = hasDelegaCompilazioneDomanda + && TipoIntegrazioneUtil.RICHIESTA_INTEGRAZIONE.equals(dettPratica.getTipoIntegrazione()); - boolean isNewVariante = ParamUtil.getBoolean(request, "isNewVariante"); +boolean isNewVariante = ParamUtil.getBoolean(request, "isNewVariante"); - String displayStyle = proceduraC ? "display:none" : ""; +String displayStyle = proceduraC ? "display:none" : ""; %> - - - - + + + + - +
@@ -77,24 +71,21 @@
- +
<% - if(isNewVariante){ - dettPratica.setVarianteSostanziale(isNewVariante); - } + if (isNewVariante) { + dettPratica.setVarianteSostanziale(isNewVariante); + } %> - -
@@ -105,89 +96,68 @@
- +
-
- +
- +
-
- + Sito istituzionale del Consiglio - superiore dei Lavori pubblici dove è possibile scaricare il - software per il calcolo dell'ag (Spettri-NTC) + target="_blank" title="(Opens New Window)" id="aui_3_4_0_1_1778"> Sito istituzionale del + Consiglio superiore dei Lavori pubblici dove è possibile scaricare il software per il calcolo dell'ag + (Spettri-NTC)
- +
-
+

Ai Sensi:

- - - + + + - - - + + +

Nel Rispetto di:

- - - + + +
-

Normativa tecnica di - riferimento

- +

Normativa tecnica di riferimento

+ <%-- --%> <%-- --%> - +
@@ -196,57 +166,45 @@
- +
- +
-
+
-
-
+
-
-
+
- - + + checked="<%=dettPratica.getCollaudoStatico()%>" label="collaudo-statico" disabled="<%=true%>" />
-
+
-
@@ -256,18 +214,15 @@
  • <%=LanguageUtil.get(pageContext, "norm-art3com3_1")%>;
  • <%=LanguageUtil.get(pageContext, "norm-art3com3_2")%>;
  • -
  • <%=LanguageUtil.get(pageContext, "norm-art3com3_3")%>; -
  • +
  • <%=LanguageUtil.get(pageContext, "norm-art3com3_3")%>;
  • <%=LanguageUtil.get(pageContext, "norm-art3com3_4")%>;
-
+
-
@@ -285,8 +240,7 @@
- +
@@ -297,8 +251,7 @@
- +
@@ -306,83 +259,67 @@ <%=LanguageUtil.get(pageContext, "cl-rischio-pre-int")%>
- - - - - - - - - - - - - - - - @@ -393,83 +330,67 @@ <%=LanguageUtil.get(pageContext, "cl-rischio-post-int")%>
- - - - - - - - - - - - - - - - @@ -483,15 +404,13 @@
- +
+ disabled="<%=!dettPratica.getIntervFinPub() || disabledInput%>" label="">
@@ -503,64 +422,48 @@
- +
- +
- +
- +
- +
- +
- +
- +
- +
@@ -573,28 +476,20 @@
- +
- +
- +
- +
- +
- +
- +
@@ -630,27 +524,22 @@ + value='<%=geolocalization.length>0?geolocalization[0]:StringPool.BLANK%>' label="dp-lat" />
+ value='<%=geolocalization.length>1?geolocalization[1]:StringPool.BLANK%>' label="dp-long" />
- +
- +
@@ -660,46 +549,30 @@
-
- - + - + - + + name="destinazione" bean="<%=dettPratica%>" value="2A" label="destinazione-2A" />
-
+

<%=LanguageUtil.get(pageContext, "titolo-destinazione")%>

- -
- ATTENZIONE - <%=LanguageUtil.get(pageContext, "avviso-destinazione")%> + +
+ ATTENZIONE <%=LanguageUtil.get(pageContext, "avviso-destinazione")%>
@@ -708,91 +581,61 @@

<%=LanguageUtil.get(pageContext, "destinazione-A")%>

 

<%=LanguageUtil.get(pageContext, "destinazione-A1")%>

- - -

 

<%=LanguageUtil.get(pageContext, "destinazione-A2")%>

 

- - - -

 

<%=LanguageUtil.get(pageContext, "destinazione-A3")%>

 

-

 

<%=LanguageUtil.get(pageContext, "destinazione-A4")%>

 

- - - - - -

 

<%=LanguageUtil.get(pageContext, "destinazione-A5")%>

 

-

 

@@ -802,112 +645,74 @@

<%=LanguageUtil.get(pageContext, "destinazione-B")%>

 

<%=LanguageUtil.get(pageContext, "destinazione-B1")%>

- - -

 

<%=LanguageUtil.get(pageContext, "destinazione-B2")%>

 

- - - - - - - - - -

 

<%=LanguageUtil.get(pageContext, "destinazione-B3")%>

 

- -

 

<%=LanguageUtil.get(pageContext, "destinazione-B4")%>

 

- - -

 

<%=LanguageUtil.get(pageContext, "destinazione-B5")%>

 

-

 

@@ -919,44 +724,36 @@
- +
    -
  • +
  • <% boolean checked = - BeanParamUtil.getBoolean(dettPratica, request, "tcAdeguamentoSismico") || - BeanParamUtil.getBoolean(dettPratica, request, "tcMiglioramentoSismico") || - BeanParamUtil.getBoolean(dettPratica, request, "tcRiparazioneInterventoLocale"); - %> + BeanParamUtil.getBoolean(dettPratica, request, "tcAdeguamentoSismico") || + BeanParamUtil.getBoolean(dettPratica, request, "tcMiglioramentoSismico") || + BeanParamUtil.getBoolean(dettPratica, request, "tcRiparazioneInterventoLocale"); + %>
    • + name="tcAdeguamentoSismico" label="tc-adeguamento-sismico" />
    • + name="tcMiglioramentoSismico" label="tc-miglioramento-sismico" />
    • + name="tcRiparazioneInterventoLocale" label="tc-riparazione-intervento-locale" />
@@ -967,28 +764,22 @@
-
- +
+
<% boolean tcInCA = dettPratica.getTcInCA(); %>
- +
-
- +
+
-
- +
+
@@ -998,13 +789,10 @@ boolean tcInAcciaio = dettPratica.getTcInAcciaio(); %>
- +
-
- +
+
@@ -1013,51 +801,42 @@ boolean tcInMuratura = dettPratica.getTcInMuratura(); %>
- +
-
- +
-
- +
+
-
- +
+
- +
- +
+ disabled="<%=!dettPratica.getTcAltro() || disabledInput%>" label="">
- +
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_geologica.jsp b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_geologica.jsp index c67152a1..5f316ccc 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_geologica.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_geologica.jsp @@ -1,5 +1,5 @@ <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> - +<%@page import="it.tref.liferay.portos.bo.shared.util.SessionUtil"%> <%@page import="com.liferay.portal.kernel.bean.BeanParamUtil"%> <%@page import="com.liferay.portal.kernel.workflow.WorkflowConstants"%> <%@page import="it.tref.liferay.portos.bo.model.DettPratica"%> @@ -12,32 +12,31 @@ <%@ include file="/html/fascicolofe/init.jsp"%> <% - DettPratica dettPratica = (DettPratica) request.getAttribute("bean.dettPratica"); - IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(dettPratica.getIntPraticaId()); +DettPratica dettPratica = (DettPratica) request.getAttribute("bean.dettPratica"); +IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(dettPratica.getIntPraticaId()); - List responsabiliCompilazione = DelegheUtil.getGeologi(intPratica.getIntPraticaId()); +List responsabiliCompilazione = DelegheUtil.getGeologi(intPratica.getIntPraticaId()); - if (responsabiliCompilazione.size() > 0) - request.setAttribute("responsabiliCompilazione", responsabiliCompilazione); +if (responsabiliCompilazione.size() > 0) { + request.setAttribute("responsabiliCompilazione", responsabiliCompilazione); +} - boolean isGeologo = true; - if (responsabiliCompilazione.size() > 0) { - isGeologo = false; - for (Soggetto soggetto : responsabiliCompilazione) { - if (user.getScreenName().equalsIgnoreCase(soggetto.getCodiceFiscale())) - isGeologo = true; - } +boolean isGeologo = true; +if (responsabiliCompilazione.size() > 0) { + isGeologo = false; + for (Soggetto soggetto : responsabiliCompilazione) { + if (user.getScreenName().equalsIgnoreCase(soggetto.getCodiceFiscale())) + isGeologo = true; } +} - boolean disabledInput = !DelegheUtil.hasDelegaCompilazioneSezioneGeologica(user.getUserId(), - dettPratica.getDettPraticaId()) - || !ValidazionePraticaUtil.praticaIsEditable(dettPratica.getDettPraticaId()) +boolean praticaIsEditable = (Boolean) SessionUtil.getDettPraticaObject(request, dettPratica.getDettPraticaId(), "praticaIsEditable"); +boolean disabledInput = !DelegheUtil.hasDelegaCompilazioneSezioneGeologica(user.getUserId(), dettPratica.getDettPraticaId()) + || !praticaIsEditable || TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equals(dettPratica.getTipoIntegrazione()) || !isGeologo; - ; - Soggetto soggettoDelegato = DelegheUtil.getPersonaDelegaCompilazioneSezioneGeologica(dettPratica - .getDettPraticaId()); +Soggetto soggettoDelegato = DelegheUtil.getPersonaDelegaCompilazioneSezioneGeologica(dettPratica.getDettPraticaId()); %> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_soggetti.jsp b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_soggetti.jsp index 8e519dcb..210dc1c1 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_soggetti.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/domanda/page_soggetti.jsp @@ -1,4 +1,5 @@ <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@page import="it.tref.liferay.portos.bo.shared.util.SessionUtil"%> <%@page import="it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil"%> <%@page import="it.tref.liferay.portos.bo.shared.util.TipoIntegrazioneUtil"%> <%@page import="it.tref.liferay.portos.bo.util.ValidazionePraticaUtil"%> @@ -19,28 +20,27 @@ <%@ include file="/html/fascicolofe/init.jsp" %> <% - DettPratica dettPratica = (DettPratica)request.getAttribute("bean.dettPratica"); - if(dettPratica==null){ - long dettPraticaId = ParamUtil.getLong(request, "dettPraticaId"); - dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId); - } - IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(dettPratica.getIntPraticaId()); - - String tipoIntegrazione = (String)request.getAttribute("bean.tipoIntegrazione"); - - boolean disabledInput = !DelegheUtil.hasDelegaCompilazioneDomanda(user.getUserId(),dettPratica.getDettPraticaId()) || ( - TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equals(tipoIntegrazione) && dettPratica.isCompleta() - ); +DettPratica dettPratica = (DettPratica) request.getAttribute("bean.dettPratica"); +if (dettPratica == null) { + long dettPraticaId = ParamUtil.getLong(request, "dettPraticaId"); + dettPratica = DettPraticaServiceUtil.getDettPratica(dettPraticaId); +} +IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(dettPratica.getIntPraticaId()); +String tipoIntegrazione = (String)request.getAttribute("bean.tipoIntegrazione"); + +boolean hasDelegaCompilazioneDomanda = (Boolean) SessionUtil.getDettPraticaObject(request, dettPratica.getDettPraticaId(), "hasDelegaCompilazioneDomanda"); +boolean disabledInput = !hasDelegaCompilazioneDomanda || (TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO.equals(tipoIntegrazione) + && dettPratica.isCompleta()); - Soggetto soggettoDelegato = DelegheUtil.getPersonaDelegaCompilazioneDomanda(dettPratica.getDettPraticaId()); - boolean inBO = ParamUtil.getBoolean(request,"inBO",false); +Soggetto soggettoDelegato = (Soggetto) SessionUtil.getDettPraticaObject(request, dettPratica.getDettPraticaId(), "soggettoDelegato"); +boolean inBO = ParamUtil.getBoolean(request, "inBO", false); %> - - - - - + + + + + @@ -50,17 +50,17 @@ var modalName = event._event.details[0].windowName; var modalWin = Liferay.Util.Window.getById(modalName); modalWin.after('visibleChange', function(event) { - if(event.prevVal && soggettiEdit){ + if (event.prevVal && soggettiEdit) { Liferay.Portlet.refresh("#p_p_id_<%=PortletKeys.SOGGETTI%>_"); } }); modalWin.after('hide', function(event) { - if(soggettiEdit){ + if (soggettiEdit) { Liferay.Portlet.refresh("#p_p_id_<%=PortletKeys.SOGGETTI%>_"); } }); modalWin.after('destroy', function(event) { - if(soggettiEdit){ + if (soggettiEdit) { Liferay.Portlet.refresh("#p_p_id_<%=PortletKeys.SOGGETTI%>_"); } }); @@ -93,5 +93,4 @@ } }); -<%-- --%> - \ No newline at end of file + diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/header.jsp b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/header.jsp index ae00c6f6..f57888a2 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/header.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/header.jsp @@ -1,4 +1,5 @@ <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@page import="it.tref.liferay.portos.bo.shared.util.SessionUtil"%> <%@page import="org.apache.commons.lang.StringUtils"%> <%@page import="it.tref.liferay.portos.bo.util.PagamentiCommonUtil"%> <%@page import="it.tref.liferay.portos.bo.util.ValidazionePraticaUtil"%> @@ -12,25 +13,30 @@ <%@page import="it.tref.liferay.portos.bo.model.DettPratica"%> <%@ include file="/html/fascicolofe/init.jsp"%> <% - DettPratica dettPratica = (DettPratica) request.getAttribute("bean.dettPratica"); - IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(dettPratica.getIntPraticaId()); - request.setAttribute("bean.dettPratica", dettPratica); - long soggettoId = ParamUtil.getLong(request, "soggettoId"); - boolean disabledInput = ParamUtil.getBoolean(request, "disabledInput"); - boolean inBO = ParamUtil.getBoolean(request, "inBO", false); +DettPratica dettPratica = (DettPratica) request.getAttribute("bean.dettPratica"); +IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(dettPratica.getIntPraticaId()); +request.setAttribute("bean.dettPratica", dettPratica); + +long soggettoId = ParamUtil.getLong(request, "soggettoId"); +boolean disabledInput = ParamUtil.getBoolean(request, "disabledInput"); +boolean inBO = ParamUtil.getBoolean(request, "inBO", false); +Boolean praticaIsEditable = (Boolean) SessionUtil.getDettPraticaObject(request, dettPratica.getDettPraticaId(), "praticaIsEditable"); +if (null == praticaIsEditable) { + praticaIsEditable = ValidazionePraticaUtil.praticaIsEditable(dettPratica.getDettPraticaId()); +} +boolean hasAsseverazioniAttive = AsseverazioniUtil.hasAsseverazioniAttive(dettPratica.getDettPraticaId()); %> - +
+ test="<%=disabledInput && !hasAsseverazioniAttive%>">
<% String descrizioneSoggetto = ""; @@ -61,7 +67,7 @@ : <%=descrizioneSoggetto%>
- +
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/verify_fascicolo.jsp b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/verify_fascicolo.jsp index 7f5af85d..1b3df8b4 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/verify_fascicolo.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/verify_fascicolo.jsp @@ -169,7 +169,6 @@
<% List sections = Arrays.asList(SezioniUtil.SEZIONE_DETTAGLI_PRINCIPALI, SezioniUtil.SEZIONE_ANAGRAFE_SOGGETTI, SezioniUtil.SEZIONE_DESCRIZIONE_EDIFICIO, SezioniUtil.SEZIONE_GEOLOGICA, SezioniUtil.SEZIONE_ALLEGATI); - List tipologiaAllegati = DocumentiPraticaUtil.getDocObbligatori(); List tipologiaSoggetti = Arrays.asList(TipoSoggettoUtil.COMMITTENTE, TipoSoggettoUtil.DITTA, TipoSoggettoUtil.PROGETTISTA, TipoSoggettoUtil.DIRETTORE_LAVORI, TipoSoggettoUtil.GEOLOGO, TipoSoggettoUtil.COLLAUDATORE); %> @@ -193,28 +192,28 @@
- <% - for(String section:sections){ - %> +<% + for (String section : sections) { +%>
<%=LanguageUtil.get(pageContext, "sezione-"+section) %>
- <% - boolean isSectionCompleted = ValidazionePraticaUtil.isSectionCompleted(section,dettPraticaId); - StringBuilder tooltipSection = new StringBuilder(); - if(!isSectionCompleted){ - List notCompleted = ValidazionePraticaUtil.notCompletedSection(section, dettPraticaId); - if(!notCompleted.isEmpty()){ - tooltipSection.append("
    "); - for(String incomplete : notCompleted){ - tooltipSection.append("
  • "+LanguageUtil.get(pageContext, incomplete)+"
  • "); - } - tooltipSection.append("
"); - } +<% + List notCompleted = ValidazionePraticaUtil.notCompletedSection(section, dettPraticaId); + boolean isSectionCompleted = (notCompleted.size() == 0); + StringBuilder tooltipSection = new StringBuilder(); + if (!isSectionCompleted) { + if (!notCompleted.isEmpty()) { + tooltipSection.append("
    "); + for (String incomplete : notCompleted) { + tooltipSection.append("
  • "+LanguageUtil.get(pageContext, incomplete)+"
  • "); } - %> + tooltipSection.append("
"); + } + } +%>
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/sorgenti/form.jsp b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/sorgenti/form.jsp index d058fd10..18dd7fc7 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/sorgenti/form.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/sorgenti/form.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ include file="/html/sorgenti/header.jsp"%>
diff --git a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/.classpath b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/.classpath index 9975372f..fcf44f2b 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/.classpath +++ b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/.classpath @@ -18,5 +18,6 @@ + diff --git a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/.project b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/.project index 6e24c69e..65a765ba 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/.project +++ b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/.project @@ -32,5 +32,6 @@ org.eclipse.wst.common.project.facet.core.nature org.eclipse.jdt.core.javanature org.eclipse.wst.jsdt.core.jsNature + org.apache.ivyde.eclipse.ivynature diff --git a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/build.xml b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/build.xml index 9e64b9e2..ae43446a 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/build.xml +++ b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/build.xml @@ -2,5 +2,6 @@ + diff --git a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/commons-codec.jar b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/commons-codec.jar new file mode 100644 index 00000000..ef35f1c5 Binary files /dev/null and b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/commons-codec.jar differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/firma-application-shared-0.0.1.jar b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/firma-application-shared-0.0.1.jar deleted file mode 100644 index dfbfe2cf..00000000 Binary files a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/firma-application-shared-0.0.1.jar and /dev/null differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/httpclient-4.5.3.jar b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/httpclient.jar similarity index 100% rename from liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/httpclient-4.5.3.jar rename to liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/httpclient.jar diff --git a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/httpcore-4.4.6.jar b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/httpcore.jar similarity index 100% rename from liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/httpcore-4.4.6.jar rename to liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/httpcore.jar diff --git a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/httpmime-4.5.3.jar b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/httpmime.jar similarity index 100% rename from liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/httpmime-4.5.3.jar rename to liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/httpmime.jar diff --git a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/jackson-annotations-2.8.7.jar b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/jackson-annotations.jar similarity index 74% rename from liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/jackson-annotations-2.8.7.jar rename to liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/jackson-annotations.jar index be2008f5..d19b67b0 100644 Binary files a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/jackson-annotations-2.8.7.jar and b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/jackson-annotations.jar differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/jackson-core-2.8.7.jar b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/jackson-core.jar similarity index 100% rename from liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/jackson-core-2.8.7.jar rename to liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/jackson-core.jar diff --git a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/jackson-databind-2.8.7.jar b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/jackson-databind.jar similarity index 100% rename from liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/jackson-databind-2.8.7.jar rename to liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/jackson-databind.jar diff --git a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/action/StartUpAction.java b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/action/StartUpAction.java index 6f081627..806f1700 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/action/StartUpAction.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/action/StartUpAction.java @@ -1,6 +1,5 @@ package it.tref.liferay.portos.firma.action; - import com.liferay.portal.kernel.events.ActionException; import com.liferay.portal.kernel.events.SimpleAction; import com.liferay.portal.kernel.exception.PortalException; @@ -26,99 +25,103 @@ import com.liferay.portlet.expando.service.ExpandoTableLocalServiceUtil; public class StartUpAction extends SimpleAction { - private final static Log _log = LogFactoryUtil.getLog(StartUpAction.class); + private final static Log _log = LogFactoryUtil.getLog(StartUpAction.class); - @Override - public void run(String[] companyIds) throws ActionException { + @Override + public void run(String[] companyIds) throws ActionException { - for (String id : companyIds) { - try { - long companyId = GetterUtil.getLong(id); + for (String id : companyIds) { + try { + long companyId = GetterUtil.getLong(id); - String[] defaultActions = {ActionKeys.VIEW, ActionKeys.UPDATE}; - String[] guestActions = {ActionKeys.VIEW}; + String[] defaultActions = { ActionKeys.VIEW, ActionKeys.UPDATE }; + String[] guestActions = { ActionKeys.VIEW }; - // Organization custom fields - addExpandoColumnIfNotExists(companyId, Company.class.getName(), "url_pdf_extractor", - ExpandoColumnConstants.STRING, true, false, defaultActions, guestActions); - addExpandoColumnIfNotExists(companyId, Company.class.getName(), "url-bo-gestione-pratica-firma", - ExpandoColumnConstants.STRING, true, false, defaultActions, guestActions); - } catch (Exception e) { - _log.error("Errore nella procedura automatizzata di configurazione", e); - } - } - } + // Organization custom fields + addExpandoColumnIfNotExists(companyId, Company.class.getName(), "url_pdf_extractor", + ExpandoColumnConstants.STRING, true, false, defaultActions, guestActions); + addExpandoColumnIfNotExists(companyId, Company.class.getName(), + "url-bo-gestione-pratica-firma", ExpandoColumnConstants.STRING, true, false, + defaultActions, guestActions); + } catch (Exception e) { + _log.error("Errore nella procedura automatizzata di configurazione", e); + } + } + } - private ExpandoColumn addExpandoColumnIfNotExists(long companyId, String className, String name, int type, - boolean indexed, boolean hidden, String[] defaultActions, String[] guestActions) throws SystemException { + private ExpandoColumn addExpandoColumnIfNotExists(long companyId, String className, String name, + int type, boolean indexed, boolean hidden, String[] defaultActions, String[] guestActions) + throws SystemException { - long classNameId = PortalUtil.getClassNameId(className); + long classNameId = PortalUtil.getClassNameId(className); - ExpandoTable expandoTable = null; - try { - expandoTable = - ExpandoTableLocalServiceUtil.getTable(companyId, classNameId, ExpandoTableConstants.DEFAULT_TABLE_NAME); - } catch (PortalException e) { - try { - expandoTable = - ExpandoTableLocalServiceUtil.addTable(companyId, classNameId, ExpandoTableConstants.DEFAULT_TABLE_NAME); - } catch (PortalException e1) { - } - } + ExpandoTable expandoTable = null; + try { + expandoTable = ExpandoTableLocalServiceUtil.getTable(companyId, classNameId, + ExpandoTableConstants.DEFAULT_TABLE_NAME); + } catch (PortalException e) { + try { + expandoTable = ExpandoTableLocalServiceUtil.addTable(companyId, classNameId, + ExpandoTableConstants.DEFAULT_TABLE_NAME); + } catch (PortalException e1) { + } + } - ExpandoColumn expandoColumn = ExpandoColumnLocalServiceUtil.getColumn(expandoTable.getTableId(), name); + ExpandoColumn expandoColumn = ExpandoColumnLocalServiceUtil + .getColumn(expandoTable.getTableId(), name); - if (expandoColumn == null) { + if (expandoColumn == null) { - try { - expandoColumn = ExpandoColumnLocalServiceUtil.addColumn(expandoTable.getTableId(), name, type); + try { + expandoColumn = ExpandoColumnLocalServiceUtil + .addColumn(expandoTable.getTableId(), name, type); - } catch (PortalException e) { - } - } + } catch (PortalException e) { + } + } - try { + try { - if (indexed) { + if (indexed) { - UnicodeProperties typeSettingsProperties = expandoColumn.getTypeSettingsProperties(); + UnicodeProperties typeSettingsProperties = expandoColumn.getTypeSettingsProperties(); - typeSettingsProperties.put(ExpandoColumnConstants.INDEX_TYPE, - String.valueOf(ExpandoColumnConstants.INDEX_TYPE_TEXT)); + typeSettingsProperties.put(ExpandoColumnConstants.INDEX_TYPE, + String.valueOf(ExpandoColumnConstants.INDEX_TYPE_TEXT)); - expandoColumn.setTypeSettingsProperties(typeSettingsProperties); + expandoColumn.setTypeSettingsProperties(typeSettingsProperties); - expandoColumn = ExpandoColumnLocalServiceUtil.updateExpandoColumn(expandoColumn); - } + expandoColumn = ExpandoColumnLocalServiceUtil.updateExpandoColumn(expandoColumn); + } - if (hidden) { + if (hidden) { - UnicodeProperties typeSettingsProperties = expandoColumn.getTypeSettingsProperties(); + UnicodeProperties typeSettingsProperties = expandoColumn.getTypeSettingsProperties(); - typeSettingsProperties.put(ExpandoColumnConstants.PROPERTY_HIDDEN, String.valueOf(1)); + typeSettingsProperties.put(ExpandoColumnConstants.PROPERTY_HIDDEN, String.valueOf(1)); - expandoColumn.setTypeSettingsProperties(typeSettingsProperties); + expandoColumn.setTypeSettingsProperties(typeSettingsProperties); - expandoColumn = ExpandoColumnLocalServiceUtil.updateExpandoColumn(expandoColumn); - } + expandoColumn = ExpandoColumnLocalServiceUtil.updateExpandoColumn(expandoColumn); + } - Role roleGuest = RoleLocalServiceUtil.getRole(companyId, RoleConstants.GUEST); - Role rolePowerUser = RoleLocalServiceUtil.getRole(companyId, RoleConstants.POWER_USER); - Role roleUser = RoleLocalServiceUtil.getRole(companyId, RoleConstants.USER); + Role roleGuest = RoleLocalServiceUtil.getRole(companyId, RoleConstants.GUEST); + Role rolePowerUser = RoleLocalServiceUtil.getRole(companyId, RoleConstants.POWER_USER); + Role roleUser = RoleLocalServiceUtil.getRole(companyId, RoleConstants.USER); - ResourcePermissionLocalServiceUtil.setResourcePermissions(companyId, ExpandoColumn.class.getName(), - ResourceConstants.SCOPE_INDIVIDUAL, String.valueOf(expandoColumn.getColumnId()), roleGuest.getRoleId(), - guestActions); - ResourcePermissionLocalServiceUtil.setResourcePermissions(companyId, ExpandoColumn.class.getName(), - ResourceConstants.SCOPE_INDIVIDUAL, String.valueOf(expandoColumn.getColumnId()), rolePowerUser.getRoleId(), - defaultActions); - ResourcePermissionLocalServiceUtil.setResourcePermissions(companyId, ExpandoColumn.class.getName(), - ResourceConstants.SCOPE_INDIVIDUAL, String.valueOf(expandoColumn.getColumnId()), roleUser.getRoleId(), - defaultActions); - } catch (PortalException e) { - } + ResourcePermissionLocalServiceUtil.setResourcePermissions(companyId, + ExpandoColumn.class.getName(), ResourceConstants.SCOPE_INDIVIDUAL, + String.valueOf(expandoColumn.getColumnId()), roleGuest.getRoleId(), guestActions); + ResourcePermissionLocalServiceUtil.setResourcePermissions(companyId, + ExpandoColumn.class.getName(), ResourceConstants.SCOPE_INDIVIDUAL, + String.valueOf(expandoColumn.getColumnId()), rolePowerUser.getRoleId(), defaultActions); + ResourcePermissionLocalServiceUtil.setResourcePermissions(companyId, + ExpandoColumn.class.getName(), ResourceConstants.SCOPE_INDIVIDUAL, + String.valueOf(expandoColumn.getColumnId()), roleUser.getRoleId(), defaultActions); + } catch (PortalException e) { + } - return expandoColumn; - } + return expandoColumn; + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/servlet/FirmaServlet.java b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/servlet/FirmaServlet.java index 65058fa5..af4c8de1 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/servlet/FirmaServlet.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/servlet/FirmaServlet.java @@ -33,156 +33,161 @@ import javax.servlet.http.HttpServletResponse; public class FirmaServlet extends HttpServlet { - private static final long serialVersionUID = 1L; - - private static final String GET_CONFIGURATION = "get-configuration"; // get - private static final String GET_FILE_LIST = "get-file-list"; // post - private static final String GET_FILE = "get-file"; // post - private static final String GET_TYPE = "get-type"; // get - private static final String GET_TYPE_VERBALE = "get-type-verbale"; // get - private static final String LOGIN = "login"; // get - private static final String OPEN_PRATICA = "open-pratica"; // post - private static final String RIFIUTA = "rifiuta"; // post - private static final String SET_FILE = "set-file"; // post - private static final String VERSION = "version"; // get - private static final String GET_STILE = "get-stile"; // get - - private static final Log _log = LogFactoryUtil.getLog(FirmaServlet.class); - - /** - * @see HttpServlet#HttpServlet() - */ - public FirmaServlet() { - - super(); - } - - /** - * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) - */ - @Override - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - - String pathInfo = request.getPathInfo().substring(1); - String[] pathArray = StringUtil.split(pathInfo, "/"); - FirmaGetUtil firmaGetUtil = new FirmaGetUtil(); - String metodo = pathArray[0]; - Risposta risposta = new Risposta<>(); - - switch (metodo) { - case GET_CONFIGURATION: - risposta = firmaGetUtil.getConfiguration(); - break; - - case GET_TYPE: - risposta = firmaGetUtil.getType(); - break; - - case GET_TYPE_VERBALE: - risposta = firmaGetUtil.getTypeVerbale(); - break; - - case LOGIN: - if (pathArray.length == 2) { - String codiceFiscale = pathArray[1]; - risposta = firmaGetUtil.loginCodiceFiscale(codiceFiscale); - } - if (pathArray.length == 3) { - String nome = pathArray[1]; - String cognome = pathArray[2]; - risposta = firmaGetUtil.loginNomeCognome(nome, cognome); - } - break; - - case VERSION: - risposta = firmaGetUtil.version(); - break; - - case GET_STILE: - risposta = firmaGetUtil.getStile(); - break; - - } - JSONSerializer jsonSerializer = JSONFactoryUtil.createJSONSerializer(); - jsonSerializer.exclude("*.class"); - String jsonResponse = jsonSerializer.serializeDeep(risposta); - - response.setContentType("application/json; charset=UTF-8"); - ServletResponseUtil.write(response, jsonResponse); - - } - - /** - * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) - */ - @Override - protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - - String pathInfo = request.getPathInfo().substring(1); - String[] pathArray = StringUtil.split(pathInfo, "/"); - - ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - StreamUtil.transfer(request.getInputStream(), outputStream); - String token = new String(outputStream.toByteArray(), StandardCharsets.UTF_8); - - FirmaPostUtil firmaPostUtil = new FirmaPostUtil(); - String metodo = pathArray[0]; - Risposta risposta = new Risposta<>(); - - switch (metodo) { - case GET_FILE: - if (pathArray.length == 3) { - String tipo = pathArray[1]; - String id = pathArray[2]; - risposta = firmaPostUtil.getFile(token, tipo, id); - } - break; - - case GET_FILE_LIST: - risposta = firmaPostUtil.getFileList(token); - break; - - case OPEN_PRATICA: - if (pathArray.length == 2) { - String idFile = pathArray[1]; - risposta = firmaPostUtil.openPratica(token, idFile); - } - break; - - case RIFIUTA: - if (pathArray.length == 5) { - String idFile = pathArray[1]; - String messaggio = pathArray[2]; - String cambiaFase = pathArray[3]; - String assegna = pathArray[4]; - risposta = firmaPostUtil.rifiuta(token, idFile, messaggio, cambiaFase, assegna); - } - break; - - case SET_FILE: - if (pathArray.length == 3) { - String tipo = pathArray[1]; - String idFile = pathArray[2]; - JSONDeserializer> jsonDeserializer = JSONFactoryUtil.createJSONDeserializer(); - Map map = jsonDeserializer.deserialize(token); - - ServiceContext serviceContext = null; - try { - serviceContext = ServiceContextFactory.getInstance(request); - } catch (PortalException | SystemException e) { - _log.error(e.getMessage()); - } - - risposta = firmaPostUtil.setFile(map.get("token"), map.get("file"), tipo, idFile, serviceContext); - } - break; - } - - JSONSerializer jsonSerializer = JSONFactoryUtil.createJSONSerializer(); - jsonSerializer.exclude("*.class"); - String jsonResponse = jsonSerializer.serialize(risposta); - - response.setContentType("application/json; charset=UTF-8"); - ServletResponseUtil.write(response, jsonResponse); - } + private static final long serialVersionUID = 1L; + + private static final String GET_CONFIGURATION = "get-configuration"; // get + private static final String GET_FILE_LIST = "get-file-list"; // post + private static final String GET_FILE = "get-file"; // post + private static final String GET_TYPE = "get-type"; // get + private static final String GET_TYPE_VERBALE = "get-type-verbale"; // get + private static final String LOGIN = "login"; // get + private static final String OPEN_PRATICA = "open-pratica"; // post + private static final String RIFIUTA = "rifiuta"; // post + private static final String SET_FILE = "set-file"; // post + private static final String VERSION = "version"; // get + private static final String GET_STILE = "get-stile"; // get + + private static final Log _log = LogFactoryUtil.getLog(FirmaServlet.class); + + /** + * @see HttpServlet#HttpServlet() + */ + public FirmaServlet() { + super(); + } + + /** + * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse + * response) + */ + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, + IOException { + + String pathInfo = request.getPathInfo().substring(1); + String[] pathArray = StringUtil.split(pathInfo, "/"); + FirmaGetUtil firmaGetUtil = new FirmaGetUtil(); + String metodo = pathArray[0]; + Risposta risposta = new Risposta<>(); + + switch (metodo) { + case GET_CONFIGURATION: + risposta = firmaGetUtil.getConfiguration(); + break; + + case GET_TYPE: + risposta = firmaGetUtil.getType(); + break; + + case GET_TYPE_VERBALE: + risposta = firmaGetUtil.getTypeVerbale(); + break; + + case LOGIN: + if (pathArray.length == 2) { + String codiceFiscale = pathArray[1]; + risposta = firmaGetUtil.loginCodiceFiscale(codiceFiscale); + } + if (pathArray.length == 3) { + String nome = pathArray[1]; + String cognome = pathArray[2]; + risposta = firmaGetUtil.loginNomeCognome(nome, cognome); + } + break; + + case VERSION: + risposta = firmaGetUtil.version(); + break; + + case GET_STILE: + risposta = firmaGetUtil.getStile(); + break; + + } + JSONSerializer jsonSerializer = JSONFactoryUtil.createJSONSerializer(); + jsonSerializer.exclude("*.class"); + String jsonResponse = jsonSerializer.serializeDeep(risposta); + + response.setContentType("application/json; charset=UTF-8"); + ServletResponseUtil.write(response, jsonResponse); + + } + + /** + * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse + * response) + */ + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, + IOException { + + String pathInfo = request.getPathInfo().substring(1); + String[] pathArray = StringUtil.split(pathInfo, "/"); + + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + StreamUtil.transfer(request.getInputStream(), outputStream); + String token = new String(outputStream.toByteArray(), StandardCharsets.UTF_8); + + FirmaPostUtil firmaPostUtil = new FirmaPostUtil(); + String metodo = pathArray[0]; + Risposta risposta = new Risposta<>(); + + switch (metodo) { + case GET_FILE: + if (pathArray.length == 3) { + String tipo = pathArray[1]; + String id = pathArray[2]; + risposta = firmaPostUtil.getFile(token, tipo, id); + } + break; + + case GET_FILE_LIST: + risposta = firmaPostUtil.getFileList(token); + break; + + case OPEN_PRATICA: + if (pathArray.length == 2) { + String idFile = pathArray[1]; + risposta = firmaPostUtil.openPratica(token, idFile); + } + break; + + case RIFIUTA: + if (pathArray.length == 5) { + String idFile = pathArray[1]; + String messaggio = pathArray[2]; + String cambiaFase = pathArray[3]; + String assegna = pathArray[4]; + risposta = firmaPostUtil.rifiuta(token, idFile, messaggio, cambiaFase, assegna); + } + break; + + case SET_FILE: + if (pathArray.length == 3) { + String tipo = pathArray[1]; + String idFile = pathArray[2]; + JSONDeserializer> jsonDeserializer = JSONFactoryUtil + .createJSONDeserializer(); + Map map = jsonDeserializer.deserialize(token); + + ServiceContext serviceContext = null; + try { + serviceContext = ServiceContextFactory.getInstance(request); + } catch (PortalException | SystemException e) { + _log.error(e.getMessage()); + } + + risposta = firmaPostUtil.setFile(map.get("token"), map.get("file"), tipo, idFile, + serviceContext); + } + break; + } + + JSONSerializer jsonSerializer = JSONFactoryUtil.createJSONSerializer(); + jsonSerializer.exclude("*.class"); + String jsonResponse = jsonSerializer.serialize(risposta); + + response.setContentType("application/json; charset=UTF-8"); + ServletResponseUtil.write(response, jsonResponse); + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/util/ExtractorResponse.java b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/util/ExtractorResponse.java index 9eb9bc21..2618ea7a 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/util/ExtractorResponse.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/util/ExtractorResponse.java @@ -3,19 +3,14 @@ package it.tref.liferay.portos.firma.util; import java.util.List; public class ExtractorResponse { + private boolean success; + private List cf; - private boolean success; - private List cf; - - public boolean isSuccess() { - - return success; - } - - public List getCf() { - - return cf; - } - + public boolean isSuccess() { + return success; + } + public List getCf() { + return cf; + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/util/FirmaGetUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/util/FirmaGetUtil.java index b49f216a..596e07ff 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/util/FirmaGetUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/util/FirmaGetUtil.java @@ -6,188 +6,187 @@ import com.liferay.portal.kernel.util.Validator; import it.tref.firma.shared.Risposta; import it.tref.firma.shared.RispostaCostanti; import it.tref.firma.shared.Stile; +import it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; +@SuppressWarnings("serial") public class FirmaGetUtil { - - public Risposta> getConfiguration() { - - Risposta> risposta = new Risposta<>(); - - Map configurazione = new HashMap<>(); - configurazione.put("MESSAGGIO_FIRMA_ERRORE_RECUPERO_FILE", "Errore durante il recupero del file"); - configurazione.put("MESSAGGIO_FIRMA_FILE_OK", "File caricato e salvato correttamente"); - configurazione.put("MESSAGGIO_EFFETTUARE_LOGIN", "Effettuare il login per continuare"); - configurazione.put("ERRORE_TOKEN_SCADUTO", "Effettuare il login, sessione scaduta"); - configurazione.put("MESSAGGIO_RIFIUTO_ERRORE", "Si è verificato un errore durante il tentativo di rifiuto del file"); - configurazione.put("RIFIUTA", "true"); - configurazione.put("APRI_PRATICA_DISABILITATO_PER_DOCUMENTO", "v"); - configurazione.put("MESSAGGIO_FIRMA_ATTESA", "Attesa"); - configurazione.put("MESSAGGIO_NO_UTENTE", "Controllare di aver inserito la corretta smart card nel lettore"); - configurazione.put("MESSAGGIO_ERRORE_APPLICAZIONE", "Errore imprevisto, riprovare ad eseguire l'operazione; se l'errore persiste contattare l'assistenza"); - configurazione.put("TITOLO_APPLICAZIONE_FIRMA", "Applicazione di firma"); - configurazione.put("MESSAGGIO_FIRMA", "Inizio firma del file in corso"); - configurazione.put("MESSAGGIO_FILE_FIRMA_NON_PRESENTI", "Nessuno dei file selezionati è più disponibile"); - configurazione.put("SMART_CARD_LETTURA_CF", "SERIALNUMBER"); - configurazione.put("RIFIUTA_ASSEGNA_PER_PRATICA", " - "); - configurazione.put("RIFIUTA_CAMBIA_FASE", "false"); - configurazione.put("MESSAGGIO_SCELTA_CERTIFICATO_VALIDO", "Scelta del certificato non valido"); - configurazione.put("MESSAGGIO_NO_FILE", "Impossibile recuperare il file"); - configurazione.put("MESSAGGIO_NO_PRATICA", "Impossibile accedere alla pratica"); - configurazione.put("MESSAGGIO_RIFIUTO_OK", "Rifiuto del file avvenuto con successo"); - configurazione.put("MESSAGGIO_FIRMA_RECUPERO_FILE_OK", "Recupero file avvenuto con successo"); - configurazione.put("MESSAGGIO_NO_CARTA_IMPOSTATA", "Carta non impostata, procedere con la configurazione prima di proseguire"); - configurazione.put("MESSAGGIO_SELEZIONARE_FILE_FIRMA", "Selezionare almeno un file prima di premere firma"); - configurazione.put("MODALITA_VISIONE_FILE_ALLA_FIRMA", "documento"); - configurazione.put("MESSAGGIO_NO_CERTIFICATI_VALIDI", "Non è stato trovato alcun certificato o i certificati non sono validi"); - configurazione.put("MESSAGGIO_FIRMA_ERRORE_FIRMA", "Errore durante il tentativo di firma"); - configurazione.put("CARTELLA_FILE_VISUALIZZATI", "/file-firma-tmp/"); - configurazione.put("RIFIUTA_CAMBIA_FASE_PER_PRATICA", " - "); - configurazione.put("MODALITA_VISIONE_FILE_ALLA_FIRMA_PER_DOCUMENTO", "v"); - configurazione.put("RIFIUTA_ASSEGNA_PER_DOCUMENTO", " - "); - configurazione.put("VISUALIZZA_FILE_DISABILITATO_PER_PRATICA", " - "); - configurazione.put("INFORMAZIONI", "Applicazione firma è stata realizzata da 3FConsulting e distribuito sotto licenze GPL v.2. Il codice è basato sul prodotto j4sign (http://j4sign.sourceforge.net/) per il quale si ringraziano gli autori per il loro contributo."); - configurazione.put("RIFIUTA_DISABILITATO_PER_PRATICA", " - "); - configurazione.put("NO_FILE", "Nessun file da firmare presente"); - configurazione.put("MESSAGGIO_SELEZIONARE_FILE_RIFIUTA", "Selezionare almeno un file prima di premere rifiuta"); - configurazione.put("MODALITA_LOGIN", "codice_fiscale"); - configurazione.put("VISUALIZZA_FILE", "true"); - configurazione.put("APRI_PRATICA_DISABILITATO_PER_PRATICA", " - "); - configurazione.put("SMART_CARD_LETTURA_NOME", "GIVENNAME"); - configurazione.put("VISUALIZZA_FILE_DISABILITATO_PER_DOCUMENTO", " - "); - configurazione.put("MESSAGGIO_FIRMA_TOKEN_ERRORE_FIRMA", "Errore durante il tentativo di firma del file necessario al login, controllare di aver inserito correttamente la smart card"); - configurazione.put("RIFIUTA_ASSEGNA", "false"); - configurazione.put("MESSAGGIO_FILE_RIFIUTA_NON_PRESENTI", "Nessuno dei file selezionati è più disponibile"); - configurazione.put("RIFIUTA_CAMBIA_FASE_PER_DOCUMENTO", "a, ap, v"); - configurazione.put("APRI_PRATICA", "true"); - configurazione.put("MESSAGGIO_FIRMA_RECUPERO_FILE", "Recupero file in corso"); - configurazione.put("SMART_CARD_LETTURA_COGNOME", "SURNAME"); - configurazione.put("RIFIUTA_DISABILITATO_PER_DOCUMENTO", "v"); - configurazione.put("MESSAGGIO_FIRMA_COPLETATA", "Procedura di firma completata con successo"); - configurazione.put("MESSAGGIO_RIFIUTO_COPLETATA", "Procedura di rifiuto completata con successo"); - configurazione.put("MESSAGGIO_FIRMA_ERRORE_BLOCCANTE", "Attenzione errore imprevisto durante la procedura di firma"); - configurazione.put("MESSAGGIO_RIFIUTO_ERRORE_BLOCCANTE", "Attenzione errore imprevisto durante la procedura di rifiuto"); - configurazione.put("MESSAGGIO_FIRMA_IN_CORSO", "Firma dei file in corso..."); - configurazione.put("SELEZIONA_DOCUMENTO_SENZA_VISUALIZZAZIONE", "Documento senza visualizzazione"); - risposta.setRisposta(RispostaCostanti.OK); - risposta.setObj(configurazione); - - return risposta; - } - - public Risposta> getType() { - - Risposta> risposta = new Risposta<>(); - - Map mappa = new HashMap<>(); - - mappa.put("CO", "CONFORMITÀ"); - mappa.put("AU", "AUTORIZZAZIONE"); - mappa.put("NC", "NON CONFORMITÀ"); - mappa.put("AN", "AUTORIZZAZIONE NEGATA"); - mappa.put("IN", "RICHIESTE INTEGRAZIONI"); - mappa.put("AL", "ANNULLAMENTO"); - mappa.put("SP", "AVVIO PROCEDIMENTO"); - mappa.put("MA", "AVVISO MANUALE"); - mappa.put("CI", "CAMBIO ISTRUTTORE"); - - risposta.setRisposta(RispostaCostanti.OK); - risposta.setObj(mappa); - - return risposta; - } - - public Risposta> getTypeVerbale() { - - Risposta> risposta = new Risposta<>(); - - Map mappa = new HashMap<>(); - - risposta.setRisposta(RispostaCostanti.OK); - risposta.setObj(mappa); - - return risposta; - } - - public Risposta loginCodiceFiscale(String codiceFiscale) { - - javax.portlet.PortletPreferences jxPortletPreferences = FirmaUtil.getPortletPreferences(); - - String codiceFiscaleTest = jxPortletPreferences.getValue("codiceFiscaleTest", StringPool.BLANK); - - Risposta risposta = new Risposta<>(); - - if (codiceFiscale.equals(codiceFiscaleTest)) { - String tokenTest = jxPortletPreferences.getValue("tokenTest", StringPool.BLANK); - risposta.setObj(tokenTest); - risposta.setRisposta(RispostaCostanti.OK); - } else { - // TODO da migliorare per sicurezza e poi modificare a giro - risposta.setObj(codiceFiscale); - risposta.setRisposta(RispostaCostanti.OK); - } - return risposta; - } - - public Risposta loginNomeCognome(String nome, String cognome) { - - javax.portlet.PortletPreferences jxPortletPreferences = FirmaUtil.getPortletPreferences(); - - String nomeTest = jxPortletPreferences.getValue("nomeTest", StringPool.BLANK); - String cognomeTest = jxPortletPreferences.getValue("cognomeTest", StringPool.BLANK); - - Risposta risposta = new Risposta<>(); - - if (nome.equals(nomeTest) && cognome.equals(cognomeTest)) { - String tokenTest = jxPortletPreferences.getValue("tokenTest", StringPool.BLANK); - risposta.setObj(tokenTest); - risposta.setRisposta(RispostaCostanti.OK); - } else { - // TODO - } - return risposta; - } - - public Risposta version() { - - javax.portlet.PortletPreferences jxPortletPreferences = FirmaUtil.getPortletPreferences(); - - String versione = jxPortletPreferences.getValue("versione", StringPool.BLANK); - - Risposta risposta = new Risposta<>(); - - if (!Validator.isBlank(versione)) { - risposta.setObj(versione); - risposta.setRisposta(RispostaCostanti.OK); - } - - return risposta; - } - - public Risposta getStile() { - - Risposta risposta = new Risposta<>(); - Stile stile = new Stile(); - - stile.setLogo("iVBORw0KGgoAAAANSUhEUgAAAIAAAAAyCAYAAACUPNO1AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAADIGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IFdpbmRvd3MiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MkUwMEMwODBFQjkyMTFFMUIzMjlDRkZBQTk4MUY4NjEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MkUwMEMwODFFQjkyMTFFMUIzMjlDRkZBQTk4MUY4NjEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDoyRTAwQzA3RUVCOTIxMUUxQjMyOUNGRkFBOTgxRjg2MSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDoyRTAwQzA3RkVCOTIxMUUxQjMyOUNGRkFBOTgxRjg2MSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PlqPyScAABO9SURBVHhe7V0JXFRV+35mYRj2HQEBZVPBFQRNcwHcRch9+aBMrdTU0sz6zDIt99zSvqzMzK1MM8V9TUQMlUUUlUVAQEj2bRgYhhnm/54z8M8v/QxDSWsef9e5c9cz933O8z7vufeqINM7QKNXXAGNUIBnEZrKKhhNGQeLFQvrl+jwKBDcsWqrqSsuoVmhdskzBg0qYTJtGiw3ra5fosOjQAgRC7wIgmd0Ym2H4Nkk79MA3ZX7h6MZCaCpn3R4mtBMBNCQXNfSJ5t0JHia0AwE0EAMNa5PHI6CUUOhBwVfdu+khxqaqokkdfRdh+ZEsyiAGCpkGxpgq58nItxbwYScuwGU0KfAm9J80pAAXJg4msJfS5ZOXb+XDs2BZiKAALK7eSjIyobM3Azn57yOdSF9cWGQP96bFooZFfkoDh6EdevfR5lQSI3SKUFz4YkTQETBrNQzRAqdqSA1Ddss9PFF9m14/GssSqeMh1BqAL2qasRs2gyf2KswrdPQHs/moNSziCdKAAHP/0ps/GgapK4uqCwpQ1VhMZLj4vD9lm+REHUBkRGRUIspSdjb4ZKFKe2l6/3NiSdKAAnl/lPdu+BSdAwEtUrYUZCdWzlDKBKhpLQUckUNvFxaY7KJOVzzCvDO/nP1fV+nAM2FRhNAQ8HUkGljAq11738E1vvrkOnmBFsTU5SXluH53s/D0dER/Qf0h1wuR1TKTSyIuoFXfo7B66djIczJoz3E9fvr0BxoFAFY8AUerhAH9Ka+qaTv5bRUTlNDbU/rUcXXsZKuod6vNTTDDY0KPbv5ITf3V7Rr2w5ubm5wd3fH0s83YEVGMRwKC+loEtpbTHuwoV0dmhONIoCANtPcSkPFD5sgyYqDaONaCELHQ93SAUJ7ewitLaGeOgnlbT0Q0a8H6pwdiQilqJRKkFteBgWZvPLycqSkpOD1GdPRrbsfRvgHoMO3n6EEMjoDUxSd7P8VEL1lZLNII1fQ5X94AETUu8uS0qlcGwgZ5XJlUH8oJo5ERehwXH+uC6462cFyzmtwHj8aRWOGoNjRGe0iLuN4GycolEoU5OUjPS0dJqbGCBo6lB/TivL/FYEA9hEnqfo3oCWPTgING0/w84VB0ID6JTo8ChpBABVNTNZFMEuNRbXUDJVeHnA2NoGMXH1uZjakBgYQUpCvXY5FCwtzxF24hERhHYyH+KMmJwe3a2pgIJHAxc0Fe37Yg1IygL179+JHd/Tvg3Pbf4RzWRnl/0dPAToCNA1/QAAVVGTiakcHQ1GrQbWjCyTUk2VWZsiuUUIuk6G8rBwnjp+Aubk5HCglhB8IR3JyEn45cxa2Xb3hScZPViGDBRFDXilHQEAA9u7Zx9PBoEEDechzXRxgsHs3pQ19+vZoKqAjQNPwBwQg+1elQOGmpRDMmYqc7t6o6OmLu2o1aqurUFtbC2sbK4hEYqSlpXGDZ9eiBfT0qABUq7B96zZabwupVB9VtH1efj5KSoqxYuVynDlzhqazCAoaghw6dfmJ87AuKaUzPpoK6AjQNPyBCRRBn+TboWtfpCxZCzHlb41QCFdnZ9Sp61BGsn316jVYWlogMDAAKckp0JCf69ChA1xdXSm4Qdi1cxe6dOkMP18/GBsZQyzSw4L3FuCDhe/jzdmzkJSUDFVFBZLNjUgBdINAzY1GeAAhrZHALToOdVnZEA7qizoTE1iRB3Bq2RJmJP3GxsaoIJk3NDJEGbn+X6nkCxoWBAEZPF/qnVFRF+Dt0wXubTzw6quTUatUw97BDp6e7WBrY4MqmRxni++iZ3QsmUE9oh0bDSin3l1FE+Moe/rnwe3TKUDT0MgqQEiBEcD4VgosN2+BIiMXqc72MHNxhkRfCkszMzhQZeDl6QUrKyuUU4++ePEi8u7mwdTUFIH9AvHTvv10HA0U1TX4btcu8goHKTUY8PLQhxRCZG2F6Lgr8Ll7B7cMjXEzcj+s570F05hE1OYm0b761IL7BauxBMjMzCJylnMDqlDUwMTEuH5N4xAbGweJRB+Ghob1S/48ZOSdcnJy+Sf7/UXFRbwTiUTNPw7SqHEALdg9OgOyheawP34KfV//EIYffgLRf7Yg+04W1u3aib3HjiGnoACOpAys1LOzs0PM5Rj8fOZn+HT1QWxMHKKjo2FPZtGYVMTUzJQTZsmSpTCh8J5ztIGqpQtOvhGGhIhofH/oGGK2rIb1li20lqlBw7MEjw4XKjk923ihcydvODjYIyR4eP2ah6O4pARnI85hWFAItm/bXr+0adi8+Wu4u7uhdetWfPJwd8epk6fq1zYvBHdsPTV1BaUP7F0Cfm+eDQGzdWyI9l6VUNFSJd9GQL2zyrcLslrb44xUBGn7dnC2c0B+YT7fknmFUjJ4YrEYcnk1ZJUyZJBpFJKfaE9+Yd68uWjf3gsrV6+Bl3dnXEu4BusyGfpeT0F5QA/cbt0aA5/zg7pnMKrTb9L5zOio2rbUsaeCp0+F5eer+Pf/BbFQgk83fooZM6bjWwrkpJcnclNqa2uD2W/OhVqlwierV8KAStqk5GSsXLEKNtY2lL6iMGrMKDqbAD179kCPHs9h+/btOBh+GFNemYIhQwZhx/adMDI2QmJiIpQ1tVi67GN+zi+++ApnTp/Bu+/O46mwAcw86+np4bnuPWFJHeDo0UN8+fLlK3Hj+g0s/uhDbqhzc3Ox6MOPIBAKsG7dGhgZGSEjI4NvZ0Opc9myJXy/s2cj8M03W4nYDrTvIqTduoXDh4/yEdejR49izZrVvAo7EB6O3d//AHc3dyxavJDH438ogAZS6m0KkuiKwN5QtXWn8Ffy5b+B7SyhPyJUS40gTLkN918S8JqROVzataPA1KG4qBjJZPJYqWhMniE/P48kr5RSw10EvxCCt+sDv3jxR9j67TZkk0xfioiCh5MzpHTOlNlTYTZqJIZRQ7/ctBm7NyyE8ayZRL0KOv+jKYGeWI9kPBbnIiOx94e90BPqo4WtLZzsKY1JxLwnOjm2IhOroVTmicGDB6Fjpw64eCkab899C6tWrkJqSiq140u8Mvk1vDgxDEOHDsbF6Es4TmXwhHH/QllpOZYtX0IX/RiR+l2sIULPfXsO/Lp1x/XE6/UtobZQ8Bnq6uroGmp/R9DQYOwkIvWmspkFrqqqit836dS5I1xdXKgN8/j2jBhKKsGPHz2OLp18cDszE4MHDsG4cWNx9meqqoYMw53sO5g//12cPHkSBynVzpwxE5cuXcbEsJcxnTrLTjLm48ZO4Od9wJ0X9ohWLSJ6+OD62CB4d/ODVUt7iD5eC9ctO2mNNgcaogbJZOSSwkagrr0HiiifWdjZ8xs/XZ2d4EkkYFAoFPhmy1YIxSKoVLW4eTOJep0tdn/3PU8RFhYWeI561ZgxozFwQH9q9Gl09fOBnH7kqxMnoYObK6y7+WJFdjHWxG+HLHwvVCnpEJ88S0eX8nM0Buyix1yORfSFaKTcSsJ16mkpqanIzcvBjRtJVM0kktwXIj7+CrzadUD0L9GoIa/QoDTMr0gNpPjqq80IeykML4SEoHevPtiwcSMsLSzRp28frFu/Bvv27eP5/cjhI1xN1qxeD4lYgq/pGqyn9feCVUzklPn80WOHKTA7ERoaipkz38CB/eGwNLfGimUriYgdsZSItenzLyERSbFt+1bUKJV8LMWF1HH7jm1cadgNNmNSCVaWGxuaUlu/4NUaK9G7d++Gzz7fyMdg2CmVFBeG+xSA3cOvpHItYeRAGFIDE87/gg3zFqB6zlQUODjSDmoKvhLRvh2x6aVgqDw94OXRBu8Ry6aPGoVRAwfwntUAqVTKx/9HjBjB562sLFFDpWW//v0wY+brvKft378fa9eu5wNJo0lu5dUKLHp/IXbEZ2PD98fheeI8Vgb4YnrL1ojYvRuiscF0ZKX2BI0E61FvvDkLyak3+ffDFCBWljIsIsk9EP4TdhEpHR1bQlmrRP8BAxAyPISCpH1Era5Ozfsqk80SSmcMcnkVDIgYrGcK6t9NqKvT0DZEdqUKg+i37f1xN/YfPICXJ73E19+He4SslBSEQaVWUoBrkJGVTmlrPezJYPfp5Y9a6kBqaoeSjbpS+c1I8h21efyEcZi/YD76+velVKZtr1CoNZSqWhXvZJu4cr2KTzesg4+3Nx1HW3LfRwARtSjX1BA5ZH5aUn3fOfEmatRqOtkB5BsacBsY7+KEtR4OqM3MRrfOndGrRw+UlJbwwKZTjmL3+wuLiqg0ZFLNmK4hUtgQuyeQGXMhyZUgjlz111RRuLi6YPTo0Tzvs7y1dOlyvPfpesyOvAoLysslpEdjTsfgxvGTOEGKFLT+G9TNXUpHNeLHbizUpF15eXl8nsntv//9DloS4foFDsCYkWMwoN9ALP5wMeVbIZfQSaQ+s6gn+vl2x7VriaiurkZpcQnlzkUIJ7JMfGkS4q/EYhX5hpycHO7oGUpoGzb/3gfzsXr1aoROCKPzDYaYeuXvwSqA4pJiPv8+EX7B/AXcnNpYtcCECRNgbmaBPZSuCguK4OXlidmz3+BViJurB7p164ZqIrWaYsOw5pM1OHLoCPdXrK0VlVqSlleUU2rSzitVCixY8AGlioj/b+99JpB5fSWxfGpIN4QOHozQ12ZiVKA/QqZORs/Qt2FPDHtt2gsoTE2HPm23c9cOMieGZKDWYuEHC5BMslReXgE/v64Q1veKYydOoKiwiAeeGcIsyvWsCmBpwNvHG1dIdlvYtUBAYCCKxUJ0PHgawVFx5PsltLeA8pQCeeRFXtKrwbt9+mLwgo9QTdUIW9dYE8jydNu2bXk1cJeIEE8lp79/H26sDpEa1CprMXLkcOzduw8fL/oYh48dogtZhTGjxqEV+YPlK5ZRSWsCZ2dnpKen88ogJHgYT2eJRBAFkd+PjF5ERCTl7Nb8wRdGnLi4OATTdtbW1vUt+Q2XLl/mcu1LFRL/Tnn61q00jB8/lisNC2R4+EF+3UaOHMG3YSn1wIFwbvj69OnNl7HfxnTdx7sLyX0G/c42SLhyhatsInkPVvayeLD9mHlk3qKwqJDO2/X3BGB6xO7LyRFHKz/z88J3P0bglc6tMGBSGPqHTUMqydrJ570RQeaihmr60BfDqDfNw0+kEIWFhdxdl1KQPyFGdvXxwdCgITAzNSXHnUcX7jZOnzqNK9Q4JksF+QVo26k9Onq2R+yVeBjYt4Bv7HUM/PEotYDl94aqQ0NlYg3eDx2KKSRhJa5+8CyvppbyJw4bRYDGIi4ungzSeBgSMdhAlpRq/wOH9sOe/MrfEf+VAvQor54b1geFidFwWrIATk6OKKGyrX2pDL2GDEGrO8lQvzcbdeTqNZTrWE46dPAQ5dUUjBwxHL16PU8l0k4e8BXLl/IS6sWwiZhLDvbsz+dgZWlJpdNkKqV6wNHJCY7tPaG+mYrwI0fQgdzu6LXbEHhf8LVQkhpILc2RSwarVl/yu7WPD12pN6alpyIhIY6MYTwuxUT/bYPP8F8jgexpXLe8MlwjebwqqEWvcjkcz0ejQ74cH+el4WaNAsWRUbDr1Im2ieM9JJfyX3p6Jmxb2FK+9IUPSfpxkvz4+ASMohJOVlnJy6/IyPN0URO4y9aQvFVIROhcVonpOw8i6OavcAs/Dkt5DWVqrez/Hqys7JOagy8lSow4eZmWMO4yy/pkhoLZb/sn4AEDQWw0ng3yqGhOQH8b0DwbF6ghsRXBEjL89MoUnBCqkUgllVKhJHOh5GUQK1dCQoLRxsMDc+bM5blTSbk19koCLMkEFlBqEEol6EBHDDx+AZ5Z2XRUA554tHjYRWevlzHRZ3UI+6Zt7+NOAf80POBeALOB7GUuCX2yAQvWy9ibfez1DhEFTB9tUu8gM8Qfl8m5W5Lcs1qzknp6fl4+su5kwcTEFFHno5BxOxNZhflEGg1al8ngnZyJsMtJ8I+MhSWpC5N1bdAbpoeBrW94ZeS3zKW7GdQ0PHQo+MFgfU9N5sgAs573wK8GUlgbGMKASkRm6qytrfit4O49uuP81asYv3wzXGXlRCBGJCF9sr218v04oFOApqGxUb8HzCuQEiirsSo6DZaUK3+tkvPn/tw93Kl80eM3UFwoDShuJMGO6k0ZqUY19XYFVxY2QPF4gq9D0/EnCMDAsrEYIkU1/nMsDqGFFVDpiZHPRq9uZ+AKlVLf7tkDv7hknjhYCtEGXRf4pw1/kgBaqKg3q6kcHBebjB07w7HxVAyCXgylgIM/LDKAanXmLnR4etEkAjCw3l1NZrEUxhBnXsOgth5wcHbmTwQpub1nL5KwcfR7Br11eGrQZAI0gFm7PAsXnMjPg7mlBaLOnsPd5e9AYmIJkaGUwi+jiZFBR4SnCY+NAMwY2pQWYcCOcLSg72cOhuOEqgbmFekQyzNhsnkjRE5OdMJqHQmeIjTymcDGgY0fmKXeQo+4m/C/lomChAT8VJoHaysbWPcPQM2cyZAVlkEaG01bs3cAmg7dOEDT8FgJ0FAislKPHa19hRxdIy/iUHYG0iRiGKoAo85tobf5O1r7eMpBHQGahseWAn4DC6p20IfV/WwQecrRSPjMWojzSddh59cddwcF0lr2BrEOfzWeAAHuRQMRpHApLMHAt5Yiw6kT7E9dIqXQPhenw1+LJ0yABmj/5QDb/FLY5OSTWWC3c5rp1Do8FM0YBa0/YP9uiC74Tw90kfiHQwg1u8HKRuqezYm1HfVPuOrw6Pgb/IcRcujPehk2C9+pX6JD4wH8H30gjYp5yZ8LAAAAAElFTkSuQmCC"); - stile.setListNumrodlfProperty(new ArrayList()); - stile.getListNumrodlfProperty().add("nimrodlf.p1=#CE0006"); - stile.getListNumrodlfProperty().add("nimrodlf.p2=#D80010"); - stile.getListNumrodlfProperty().add("nimrodlf.p3=#E2001A"); - stile.getListNumrodlfProperty().add("nimrodlf.s1=#D6D6D6"); - stile.getListNumrodlfProperty().add("nimrodlf.s2=#E0E0E0"); - stile.getListNumrodlfProperty().add("nimrodlf.s3=#EAEAEA"); - stile.getListNumrodlfProperty().add("nimrodlf.w=#FFFFFF"); - stile.getListNumrodlfProperty().add("nimrodlf.b=#000000"); - stile.getListNumrodlfProperty().add("nimrodlf.menuOpacity=195"); - stile.getListNumrodlfProperty().add("nimrodlf.frameOpacity=180"); - - risposta.setRisposta(RispostaCostanti.OK); - risposta.setObj(stile); - - return risposta; - } -} + private static final Map configurazione = new HashMap() { + { + put("MESSAGGIO_FIRMA_ERRORE_RECUPERO_FILE", "Errore durante il recupero del file"); + put("MESSAGGIO_FIRMA_FILE_OK", "File caricato e salvato correttamente"); + put("MESSAGGIO_EFFETTUARE_LOGIN", "Effettuare il login per continuare"); + put("ERRORE_TOKEN_SCADUTO", "Effettuare il login, sessione scaduta"); + put("MESSAGGIO_RIFIUTO_ERRORE", + "Si è verificato un errore durante il tentativo di rifiuto del file"); + put("RIFIUTA", "true"); + put("APRI_PRATICA_DISABILITATO_PER_DOCUMENTO", "v"); + put("MESSAGGIO_FIRMA_ATTESA", "Attesa"); + put("MESSAGGIO_NO_UTENTE", "Controllare di aver inserito la corretta smart card nel lettore"); + put("MESSAGGIO_ERRORE_APPLICAZIONE", + "Errore imprevisto, riprovare ad eseguire l'operazione; se l'errore persiste contattare l'assistenza"); + put("TITOLO_APPLICAZIONE_FIRMA", "Applicazione di firma"); + put("MESSAGGIO_FIRMA", "Inizio firma del file in corso"); + put("MESSAGGIO_FILE_FIRMA_NON_PRESENTI", "Nessuno dei file selezionati è più disponibile"); + put("SMART_CARD_LETTURA_CF", "SERIALNUMBER"); + put("RIFIUTA_ASSEGNA_PER_PRATICA", " - "); + put("RIFIUTA_CAMBIA_FASE", "false"); + put("MESSAGGIO_SCELTA_CERTIFICATO_VALIDO", "Scelta del certificato non valido"); + put("MESSAGGIO_NO_FILE", "Impossibile recuperare il file"); + put("MESSAGGIO_NO_PRATICA", "Impossibile accedere alla pratica"); + put("MESSAGGIO_RIFIUTO_OK", "Rifiuto del file avvenuto con successo"); + put("MESSAGGIO_FIRMA_RECUPERO_FILE_OK", "Recupero file avvenuto con successo"); + put("MESSAGGIO_NO_CARTA_IMPOSTATA", + "Carta non impostata, procedere con la configurazione prima di proseguire"); + put("MESSAGGIO_SELEZIONARE_FILE_FIRMA", "Selezionare almeno un file prima di premere firma"); + put("MODALITA_VISIONE_FILE_ALLA_FIRMA", "documento"); + put("MESSAGGIO_NO_CERTIFICATI_VALIDI", + "Non è stato trovato alcun certificato o i certificati non sono validi"); + put("MESSAGGIO_FIRMA_ERRORE_FIRMA", "Errore durante il tentativo di firma"); + put("CARTELLA_FILE_VISUALIZZATI", "/file-firma-tmp/"); + put("RIFIUTA_CAMBIA_FASE_PER_PRATICA", " - "); + put("MODALITA_VISIONE_FILE_ALLA_FIRMA_PER_DOCUMENTO", "v"); + put("RIFIUTA_ASSEGNA_PER_DOCUMENTO", " - "); + put("VISUALIZZA_FILE_DISABILITATO_PER_PRATICA", " - "); + put("INFORMAZIONI", + "Applicazione firma è stata realizzata da 3FConsulting e distribuito sotto licenze GPL v.2." + + " Modificata da Manifattura Web Group Srl per conto di Regione Siciliana." + + " Il codice è basato sul prodotto j4sign (http://j4sign.sourceforge.net/)" + + " del quale si ringraziano gli autori per il loro contributo."); + put("RIFIUTA_DISABILITATO_PER_PRATICA", " - "); + put("NO_FILE", "Nessun file da firmare presente"); + put("MESSAGGIO_SELEZIONARE_FILE_RIFIUTA", "Selezionare almeno un file prima di premere rifiuta"); + put("MODALITA_LOGIN", "codice_fiscale"); + put("VISUALIZZA_FILE", "true"); + put("APRI_PRATICA_DISABILITATO_PER_PRATICA", " - "); + put("SMART_CARD_LETTURA_NOME", "GIVENNAME"); + put("VISUALIZZA_FILE_DISABILITATO_PER_DOCUMENTO", " - "); + put("MESSAGGIO_FIRMA_TOKEN_ERRORE_FIRMA", + "Errore durante il tentativo di firma del file necessario al login, controllare di aver inserito correttamente la smart card"); + put("RIFIUTA_ASSEGNA", "false"); + put("MESSAGGIO_FILE_RIFIUTA_NON_PRESENTI", "Nessuno dei file selezionati è più disponibile"); + put("RIFIUTA_CAMBIA_FASE_PER_DOCUMENTO", "a, ap, v"); + put("APRI_PRATICA", "true"); + put("MESSAGGIO_FIRMA_RECUPERO_FILE", "Recupero file in corso"); + put("SMART_CARD_LETTURA_COGNOME", "SURNAME"); + put("RIFIUTA_DISABILITATO_PER_DOCUMENTO", "v"); + put("MESSAGGIO_FIRMA_COPLETATA", "Procedura di firma completata con successo"); + put("MESSAGGIO_RIFIUTO_COPLETATA", "Procedura di rifiuto completata con successo"); + put("MESSAGGIO_FIRMA_ERRORE_BLOCCANTE", + "Attenzione errore imprevisto durante la procedura di firma"); + put("MESSAGGIO_RIFIUTO_ERRORE_BLOCCANTE", + "Attenzione errore imprevisto durante la procedura di rifiuto"); + put("MESSAGGIO_FIRMA_IN_CORSO", "Firma dei file in corso..."); + put("SELEZIONA_DOCUMENTO_SENZA_VISUALIZZAZIONE", "Documento senza visualizzazione"); + } + }; + + private static final Map mappa = new HashMap() { + { + put(StatoPraticaConstants.CONFORME, "CONFORMITÀ"); + put(StatoPraticaConstants.AUTORIZZATA, "AUTORIZZAZIONE"); + put(StatoPraticaConstants.NON_CONFORME, "NON CONFORMITÀ"); + put(StatoPraticaConstants.NON_AUTORIZZATA, "AUTORIZZAZIONE NEGATA"); + put(StatoPraticaConstants.INTEGRAZIONE, "RICHIESTE INTEGRAZIONI"); + put(StatoPraticaConstants.ANNULLATA, "ANNULLAMENTO"); + put(StatoPraticaConstants.SOTTOPOSTA_A_PARERE, "AVVIO PROCEDIMENTO"); + put(StatoPraticaConstants.INVIO_AVVISO_MANUALE, "AVVISO MANUALE"); + put(StatoPraticaConstants.CAMBIO_ISTRUTTORE, "CAMBIO ISTRUTTORE"); + } + }; + + private static final Stile stile = new Stile() { + { + setLogo("iVBORw0KGgoAAAANSUhEUgAAAUoAAAAyCAIAAAC1TQVKAAAi8UlEQVR42u2dCVxNW/vHd1zh4qrc6+W9RaFzqtOkIoRSlMgYIrpSyCxDyCVuKFFJA5EhJYmEyJWZUNKkaNag8Qwls2T4/87ZOvY9nXMq1y33/Z/nsz7ns/c+a6+99t7ru57nWXvtZxPW+lK+Qzp4t/2xJdOGth1CDh36JBGJtIhU6apWaqmyGHSWukqVCr1ajUw0XqJTfmkCy1WqNA6SCq1Smcai06rU6FWqdI5q/e6qvPSlBOqCQPncfVkMVQ6NzupLY6rQn65e0QInTuzZLPUirGOphlyJdLcWS/HtZCIkeEukpaRCncFUUuYoKnN6K7N60dgKyp9TL0oS2KKgzKlPVQrKrN68pIjduYmXhyyH1qAEmpACFXjH7Y064F86W5H2dIVjS+Ad6EV8KJeq8elU2kNOgrdE/ieFrU4H2GwlGpOhwqHToUI5NBrvV2iifVlAZl7+KmUkWhVvgaP8eWN9UZQFmrAtWFZjcPQHsZH667BAeO8WxPtTFfGhuE2Va5fSXyR4S+R/UFjqNE4vGlNN9dX1S3UF+XWP8+sKHn9JjylbyAX+lvqFdwX577i/nxN133eUJFgyL70jS3hSXPuk+OW5M0x1LXaflsUb6X1OG/aqriWdJXhL5H9N4C3DNubQVeoKC5u148ePH9+9e1ddXV1YWJienp6SkpKampqZmVlaWvrixYv3798jQ7MKfHM/gampxeml/KyF8f7EId6l/MC0lin5sUmIFkp3y5eWK5TgLZHvXqrVuP4wjOS6woImUg16Hz58FBYWtmzpUsNhwwbq6fXX0tbR1sZvfy2twfr6ZqamLi6bzp8/X1RcXFv7rul4sxmawLumpfHmEf72unSFqWxJ+0b4zJCW3auguHzMmD19lQG5BG+JfPd403h4FzYKNofDiY4+ZzvbdtBAfVU63XqG9e+/b/D09PT399+7N3DPnj2+vr4e2z1Wrlw1zmJcP6U+xkZG69atS0pKevXqVeN4JwFvrarerYI3Ept4fal9ma6cKMKfSHdLk5bdpK4ZdepUUVFR1MmTkTTVJxK8JfKv0N5F4vAGn5cuXbKxsVFTUZliOSVwb2B6ekZNTc3b2toPHz7wzXB0ATDLX79+w2azb8XF/bF580gTEz0d3dWrVmdlZ9fV1X3HeFcRH5nEi/COZWrCdXKqtKyLKuNIcPDr16+xP07eZ/Hi/PYSvCXyL8YbxJaVlW/atEmDwZg0ceKZM2eALpBuSuFwzgsKCn18dg/WHzR86LDjx4+LUeNvWx1vLuElUjUBnUp7CertuPZyLoaGMefPk2xDcAkO+PrekO1B5imW7pYsLZshLfdEgrdEvkfjvEAo2w8epM+0ngm/2tt7V0VFRXMHzCBQ2unp6UuXLtVQY2zZsoXJYgnNVsvDm92rVfHmPioraFO1qUvJL1/YvtJeduMcu7t37uJMYJxUV1eTdkhebm64hhbJc1I72Tlt2m9s27FIgrdEviO86Z/xbqC9QXJi4v0x5mOMjUbAMq+trf3qo6CoqurqAP8ALXUNBweHsrIyoXhzvge8kepy2rKX/FTSmcv2xR+7rbW3z87OBtiZmZknT55cu3YtuiucEuzzAFvbHJ7GDvyhc982bY1VVC50kG0i3tD/8+bNI3jSpUsXHR0dFxeXrKysrzgZGEWamppTp05FJf+Ji1VYWLht27ZBgwahnqht9+7dcSkaPSg1A2TYsGE4x7dv3/7TtZVIo8Y5Wm9qaupos9GTJ026f/9+E61x8YI7GxYWBkNgwYIFbDZHuPZW+A7w5j4qS/uh8jeZ6x1k182fn5OdjfN//Pixm5vblClTGGpqDx8+xAVCh3ciOPhBO9l86W5O/5UfOGCAOoPh3a5TYfPx5ouamlppael3hXdVVRXAplYSeONqSPD+9+JdWlo2Y8aMkSYmYPsrDHJRAiJCQ0N1tft7eOx48+bN94o3nHA2kR7efsPMqVDUH3iSnJx85MiRgZqay5cvf/bsGVnKnbi4+B69LrfrOqpfPyNDw2FDh1p1lU1rJ9t0vPv06cNkMrEKrx7dB+A5c+YMVtlstqenJ7gyMzM7fPgwf9ACDhKygRMDA4NJkyaBmd27dwsAgwKxrwFPvLy8UBQfNiMjIx8fH/xOmzYtPj6eLFPUsUhJSkpCrbZu3SqwXeCgqJirqyu2oBCo+pcvXzYFbzSI8PDwZcuWGRsbI8P+/fvJZiGqtqLyS6QRvCm+N67thg0btDW1rl69+k30NlVwOzw8PDQZ6mfPnqUW3mp4f2ATBalEYSpRW1HPNofISpBa62gYf/cumiBqibZ74sSJuQYGszvLnD9/nl/v+4mJYVo6f0rLjNLWBkvq6uoWv3RP/Sq8Ibdu3QJIAAy+/cKFC6kKMyAgAL0suoDp06cLKPxdu3ZRgXn37p2AUYCiUCCZh7odsD19+lTUsfhXCqYKbHKUCccBhQvFG9vt7e2pNgh6wKbg3bBW165d4xfesLai8ktEJN4KymzaF7xxZy9evAj8fHf7Uu/mNxRoi7n2c4cPHVZQUCDoe7c83rWVxJqlHaZM1A7eY3rljFrSNaWTh2lrVlpev34duuLJkyfhYWEb5s3z+qXnvXYyK3UHwJ7hl5KRkeE5wji5nawtjT5x4sT+WlpLu8o+qp/uUizdLVda7mJ3+RM9FG60l30sFm+y20N7RfcB0xcGsLe3N27A8+fPoaUHDBiADLm5uSBt/fr1WMa1w74bN27EDaMCk5+fj33h/7x48QKM2draYhWZyTzm5ua4+th9zZo1KAroijoWdWjU39+f9LrBGNRpXl6eAN4oH4XY2dlVV1ejPmBYoFai8Cb7LBwaV+P27dtk78YvvGFtReWXSBO1N4vFmjplqtU0q8rKSoEBcPxVU1PTXFu9YX5suXv3rp6Ozvbt2/k9SKvh/Z5FXD0ttchhYmJi4tUrsRf/PHfpUmxxcRF0RVxc3JIFEyLW/vdRT1lyLupGq+kAnl8Klt2mzyiQllvfRXachcVvAwZGSnfN4eFdJN0tqusvWxcuPLx//xJ7++2yv2RLyzXqe8MQ5XA4qElDnxz1yc7OFsAbihflUIFJSEhA/mPHjpFHQevHKgoUsKUjIiKwHZlFHUvgepWUlMDcwuFQAZAMTU4tEJ5LQ9Ka6HvDMoIGPnnyJOx/FB4UFNTQ8ufXVlR+iYjBG9r7HQ9vgBcZeUpdjRETEyOAZXZ2zoTx43fs2NH0eaZoeEVFRcHBwdA6AsMo0IuurlsGDRiYlZXdyngjvaskzhztsmLZrIAAvzt37qByaEAHDx5c42iaHidVm9+maluX0u7dEtvJbl60GArqTb1AVW6ysgL5nj90Gqav70NXdW7b8Va7rpekZQLke2/ftBm68cb16ztGjUrnMS8ebzTWtLQ0/NUQORIMOLRQaNTtqKQADELxhsUhAExUVBS2o5cVdSxRFw5OCvKcOnWKWiDpn38F3riA6KTQoUA/r1y5UhTe/NqKyi8R4Xir/mVoDdbctKlTrWdYow0L5Lx8+bIqnW5vZ9eUGaboGp7W1KDPNR89up+ikpGhYUhICNQStct4kJ4+QFcPth55B0nfm9VaQ2sgPC+JOH6grcvaoX/++WdqauqWP5ziYzvCM+e9VdaWtfSn2B+7mtNo8H4nT548bdo0LMydO9emV2+oZbcucv169TLt0Mnyxy7LpTuvdHCIPHkSpk5mZqaLqdmDenNdjHF+9OhRtGAoJSyTRjhsG9JIRk7+Y8nw8HD8haZvbGy8Z88emNMCMJDG+fz580njfPbs2VTjvCEwYo5FCvJXVVXhX9LqhmeOHWNjY6kFkhY+HAGofZTQdOMcnghKO336NPZCH4GawBEQg7eo/BIRob3pVLxTUlL1dPUOHw4WUN3vP3xAW1JW6jNYX58/EiTmARhuxAIHB3QH8LHPno1etmyZlrrGTOuZV69e5bt1WFi8aLHVtGlkV/KW90pJK4+cf+QQZY8Ij009F9gPv3K6/Ztyoo7JTbUVxNWAtvYMutXUqePGjVNRUdHT0zMwMFBUVNSTl3ft0MWiq6y8vLxKz56BHX7a0/6noH37yCa+z8/vTOcmDa3BzkcJY8eOhW+JS4OWTdWo8KV5s38/wiLlP52aMGECdBcwpsIAJ2rRokXUfZcuXcofWmsIjKhj8a9UeXk5KknNMGjQINRZYAAc/chXDK3BViK9er7gL/QmomorKr+E5EbwLizAPd2/P4hBV8nJyeErYdI3xk1xdnbuq6ikokx7lJkppkDcjoCAPZoM9dFmZlBFuPIoBPf6/PmYCeMnaDAY3t7epOlHOgLoMu4nJbU+3q9KieIHRH4SUZRGpN+Wclwov9OVcfxgn5OH+54K0QwOaGdh1l1bWxuoqKurjx49Gmxv3Lixf//+aIIqffuq0Gijhg934znYme1kF5iMLC4uxhkGeXllUl4sE4M3Vp2cnNB2SQ8Tu6N8cIIDrVq1Kjo6mnzSvmXLFhqNBhOd38phLQvAgIsOo4h8MObr60t2n6KAEXUs6nNvWN1LlizB7uAT/Ush7/UjgQJLS0vJQszMzFDJJj4YQ+cC9YvVWbNmQScfOnRo1KhRqLCYzkhofgnJjeKNK/+bzW/z5s7DranvuCuio8+h4YFPi7FjgWI/JSX+k4hnz5+XlZXxM5OC7mDZ0qXGRsYwS6k6AMuwEGGlL1q4iG/eox8ZamAAu4DbdJMSWK1lnL9jEnf+lLKeIjfGTG/S2B5Oy3qbjNA1MBiiqalhbj56pIkJlCqUNmgcPnw48O7bt6+cnJyWlhaAR1OTkZFRlpf3UlDMrh9UOyTbPSYmBk0z0Ns7Xlr2W01KTUlJAdUHDhwggbly5QpWYS1L2rFEGsUbWgS2N7wwcko1uN28efOSxUtAY1FRESxteNEgHK0LNALXsLBjo0xGXr585a941y1fvtxirAWngcWEnnechQXUAP+9DA6natLEiehQoJbqn3v3a2m8YZCnxxETzOUsLMYaGRlBw0D/rFphO22inOkow1kzp4aGhvr5+f36668whoG3qakptAocbzAPM1VBQaFfv34456NeXsmdu5MYX+rUbdeOHejqwkJDg3sqfCu88/LyYJMLTCBLTk6WtGOJCJUqNRpL4fPIOfStjpb2jh07ampqnj59CkMdSGsyGOnpGQkJ92h9+5mZjVZXVVu/fn0tIK6rc3V17afUB/mpo+LYzsN7rHC8x1osWrSYr71hLzg4ONjNsaupeQbjnMXQZLU83nlJhLNjW10djfHjx8P7hXk5bIhybGS7fbuIc8ekvNwnpaamrl27tmvXrpMmTfL09MQqejuYIvHx8Y6OjjDUsQsuCnSp/3BDckbqrU4/+7m741rk5+d7DzZ4/I3wRrd648aNZcuW4YiwGtatWwd9LmnEEhElHFUu3kw67d3j/Dt37mppaA7WHzRr5szpVlZaDHV1NTUAvHq107p1zgP1Bty4edNhPpfG58+fA9GpllOgz7GFap/XvX/vuNxxDG8+ggi8vxjnaK6lpTDwywDCGx7elfItiDf0dnUBsX8Xoa3xH3V1VS1NTSWlXiZGvQJ2tHlZwvXGk69JWU7Uh3cHnOAkQ7c7OzsD6cTERHi8K1asgLepqqoqKysLcx3Lq2xsEjt+xtvffTs5oLVx/vykevtc8saYRFoUb572ZtFobx89uHT5ysIFC9B6V61ctXLFCuiGu3fjZ8+erUqjI8EDhfXu7e090pi7ACZ1tLWB96CB+nDRSe+aHCuB9h47ZgyLxRZqnM+fNw+mAezWWtgA9cJ95nI/gdnCQ2vA+2kBER9L7HYnfLd3DPZvs8+buHuRANvsXOJYEN1muta0adNGjBgB1a2oqDhw4ECcP5xwLy8vWOm6uro2NjYaGhowkuGKW1tbr12x4mT3X4Hxza7/ORUWRo5jnzp58krHz++BS/CWSEsKG3j3UmbTucY5+CTfaOYLqDt7Nhr+NtIc2zlva2tPnYqCPs/MzEpNTdNQYwBvrN5LTHzx4oWHx47ff/995cqVcODHmI9p+PwMpjjwZqiowmM3G2U62tTMzNTU3Mz8N5vfkJk0zlvB9/7A4T70RqpjcsfYaiuJnMQ2m5wtwsPD7O3tYWwMHToUfgj0NoPBuHjxYmRk5O3bt2GNx8bGRkREYOO8efNmzpwJ+FevWuXdU/6xtNxN2R6xZ8+STktGRoa3KqNQgrdEWsv35uEN7VpeXi7wlKGkpAR6GwwHBQWBfxjwQD0uLi429hJAHTxoML2fckhISEbGQzW6yvBhw6xnzJg1c9bSJUtZDcI2AG8nJyewAGrm2tvb2dnZzraFCzB+3HgmiwW8Oa3+xth7FpF0rf1qR8u0tDS4tXPnzt22bRv4RO8FZxsAu7u7Z2ZmhoaGXrp0KS8vz8XFZdiwYbdu3YIxk5CQgNVp5uY+fZVjOv8ctGsX+VAR13SLvf3jBrPWJCKRf1qq6/Gu4w6tZY01H3PwwEHqU0800Q2/b1Cl069eu4btubm5sMZXrXJavtxRXVXNbfsOED5p4qRly5ZrMtRv3Lj5nCfAoeGrZtj9JU/wL/kL/3zG9OlI/KG11gzn8J5NJF9vv2GdXX5+Pt/TqK2tJS8HDAwbm1l6errwsYH9mjVr0FeZmpqGh4eTYwnkc2k4Hmeiopx1dFeMG0e+MYOignx8ktpL8JZIy+P9ZdZaZSUT6LrzRnypeSoqKrKzs8npj2jkFmMteDGPtYcOGVJaWoZ2Dn2uokwbOsSgsrEJbYK2Q3W15eTJ8+fN5z4Ya91pLfDDn6R3cN1oS32LjYQWkKelpQb47zjk3/ewv9S4sUPhkMP20NLSgivOf/eb2iNGRUUZqDG8PD3RjaGEY6GhJ3ooNMSbGq3F2NjYzc2NP6PoH4158D8ZUOGfOCnqbJx/40nx3xgjjfOpU6aiyYmZVf7q9WvrGdZwuWl9+61e7YSO4MyZM6RzDmXW3BdI8/LyDQYP8fPz4w+tMVve9yZt8txEmb2+jmCb1NU4MfRkWE1MTNzuvtnHXT/jTgf458+KiJ1/dFdSUgLhk8f393HX3hPgVVxcLNAj4lLCRd/h4UG+enXzxo0AhsYT0Xg3jNbybRsrTgrdtry8PPm6WwvgLXDE/w94/xOn/DdPqkqVO7TGqR9aCwzcBwUO6kTlR54NGzZwR9QUlYKCDmA1PT1duU9f4B0REdGsd0WROTr6HPa9dy/xE29SKrNVnntDb+ckSru5LiS5ApmxsbG+vrsdHObPmDbCz6NnZjz3ORm/Izgd0r1z5849e/Z0mN2ZlUM8vNPed8fkY2HBT54U8y35T7x34sgZueQAhrOx8cO/vhBK4s2flArriHzfG9a+wH0ll9HOdu7caWBgMH/+fFz0T6JDl5D5LS0t0Tdt3boVphf53hh/kjaOKFC4kZHRrl27ULitre3ly5cDAwPJUDAhISH8nktoUBdRYVUEjghPTGgMGYF2TK3zpxYMWSPqSgrgLT6sTcNTFlN/oZFtGlas0ZA4os70s/b+6xtjSUlJOlrauKdiQIXh2U+JO33twoULyEaa67r9dZo7wwKXdPmy5VMsp5BvBPAmpWqyevVrhXAOntsm5ubmkudcXV0Nk3vd2pV2dnMmTxzuvKJb5l2ptxVfVP2lU1I///yzjIwMQ1U+OqxNHZN4W04kXvnloL/JvoDtaWlpgJk/L48UrG5duSpRWlYM3pBHjx7BSt+8ebPA61YNQ5QMGDCA/96F+FAnKDAzM7NRvAkRgt3BG2nOCA3qIiqsisARcVWFxpARwJta55YMWSPqSlLxbjSsTcNTFppfTGQbURUTExJH1JkK4s1737umhvtCqI2NTcP3+flyLzFRuU8fHW3tBw8e8JruG19fv/Xr1wuEf2hUHj58OEBXD/eFrAxvUqomuxXwriACfFZTo7ejUwQ86ClhnMfFxTmvXXTisNLzYq6eR/4b0VKajF9kZWX09PTsbPTDg9oUpnIjOqGcwoQfLlgruFlaBrhvDw8NvXH9Oux2NMe8vDwnK6vkxvAuLCzs3r27o6OjQIQGfugSEmmYT7iLd+7cER/qBF3A1atXcVc+8kSUcc4vnMPhoDSYBqDr3r17uCvnzp1DmcHBwdhFVFAXMWFVqEcUFUNGAG9qnVsyZI2oK0nFu9GwNgKnLCq/mMg2DSvWaEgc8Re2WpVOxZv3FlekCo0eE3NBlALPy89nqKoaDjcsKirieyh1dc1zDXDKuBRwBDIePvz82Ox+K71SUsciTh3p7b/bJf5uHJoOqKZqFdzvmpqa06cjPVzNk69JV2ZJvSkjLp4gls3/6T/dZfooyS+Z1/VyVBt2LneW2ycO8Tq+XfFomUft5c516xnE0PA3NNo2duy64YYRXbjfHhSPN3n/VqxYIRRvvoUGAPgRF5sS6kS87y2QGRoG5ZC2cU5ODpZ9fX0/CYswQQZ1ERVWReCIomLIiHEyWzJkjagrScW70bA2AqcsKn+jkW2oFWs0JI74C/slznl9MKbKSubkSZOhw0V9b4DN5syYPgNHRLP/arqSkpIH6ult2bKFHzvgs3HeKiPnsL1LMtpk3+t0KkTN3XXOwQN+0dGnoUvJHh23jZw9fuzY0Y3rJgZ604MD9KLDfnCw7Tx48KDQkEM73RzWOtLcNkjdPEfUlhGvznUo05fjfwUhW1ruobTwWWsCeMOwR8OCVynUOOffe/jGZEiDJoY6aRbeKIG0jfkqF/bVJ9EBZES9udkUvKlR65qC9z8XskbUlRSPt8CQW6N4k/kbjWxDrVijIXHEX1iBcA5kJWNiYjQZ6oGBgUJHwnEgWE+VTOZXB0iGcbHAwWGEoRGU5ZdJL7wHY6xWGTn/8gEDFlcJ5ye3jT2lcOzAcI+tNocOBuI+QUugVaErAlp+fn7o5gO9+1yIkBpv3tV2tpWZmRmDwfjvf3vq67Y7e5SofSL1IqxjmYZco18poeINw3vdunUkt0IJhHWHCqDHcXFxIY3zJoY6IW/qzp07wSqplr8Cb1FBXcTgTT2iqBgyYvBuyZA1oq4kFe9Gw9oInLKo/I1GthGFt9AdxV9YoXHO0ZKdnZ2hXW/cuPENg5zzR9T8/fy1NbWOH4+gjvZ/9r2/kzjn5Ig6K0cq937by1Fd3DcP9/XZBqsYLYmccH9kj2r1Y+L2BWK3e3vlfr/S6XSA2qNHj9EmHWOOE++KpGq8OpXKN463QAc/aNAg6hivqNEvAwMD9JFNDHVCChnsidQh2Le5eIsK6iImSgT1iGh8QmPIiMG7JUPWiLqSVLwbDWsjcMqAUGj+RiPbiMJb6I6izlQM3p94oYGmWFqONBmZkpLyDQnHcSMjT+loa8N1EogD0ZqhFMWnD2yu9f44uU2gN2O3jwfYAIH7fdRfl3EnugHyVYu76vRnKMj/2qtXr27duk0ZR+QkEu+L2lRt6FLStUl4k9NaPDw8Cuu/w9wQb1h9yIObCiVPmj1NDHVS73RVwqtHIUJHzhvF+5OIoC5i8KYekRytbBhDRvwD3hYLWSPqSgo8GBMf1qbhKYvKLz6yjSi8he4o6kxFGed8QwNgjzYzgx8OP/mbfMyAnAMzWF/fbo5dWXk5VmFpov7k0+IPz57dCQo6umDB68f5X1E4Wiz8jqZH3SL2enUnR8Kbnl6XQlf3vHAhBnivWWlVlc9X8sTlKMJrC2Fh+sME87ZOS4gHt7gD6XW5bVgrupb89Be8jzd/Uqrkqz1UkYSsaeasNeFfCAVyCQn3TEeZjjQxgVla+/c+aQDrCfhBb8+xtS0qKiovL4dWMDI0NBg8ZN3atWfPngXkkZGRWBZ4ZtxEycnJsZ4xA+5JU/H297J5WtA8vJEqsoilCy2h1pYtsWbn/UXD11YSrFwCKh2qHqsfyW+VpfzAnClTUv8Z8Lh2MqcjIiR4/x2RhKxpDt502MNiPgCcmpo2cfwEuMp+fn7MrxpOe//hQ15evtNqJ02GOiyXktJS6G3f3b6D9PXv37//8OHDgwcPwrb6wM2Why3gnPxi371799IfPADtWM3KzEROVAAZsBHGFPoLLKckJ5NzgTgcDhwo0m9F+dnZ2dgdNiY5OojM2VncLRkZGaSdRYSF+Bc9aDbe0MlHAuQPHAgK9KaB5MZ3gWF/o12FuSxJ+FWZ/9zjPYaR4P13prtKQtY0Q3sr0KgfIWp4MUtKSjb8vgFwWk6eHBMTw59q2TjY79/DWYDSNjE2Hqint39/EPn+BZBzdXXV0e6flJSELfx3y0OOhNjOnv38+fPbcXEmI4wXL15MfjgBzdvdzc189Gj8O3fuXC0Nzd27d2/bunX+vHkoBBm4nxB/8GCAnl5qaioKh6UGo2D58uVmpqZ79+7lRkzhveWFArEdPQvyEwkJ8fev9mmufc6btdZm9nSlwrQ2Td2FTbw6275MR65QuluI+diiwkJJs5NICxrnIrU3VX9cuHDByspKja4yY/r04OAjWVlZ4JB8KkzNSY7Yk0/vd+7cOXbMGA0GA10tVqmP2aCKZ1rPBJw2s2bt37ePxWLx8a6pqQGT2F5aUlpZWVnO89KB9/Chw4qLuJ8GWr1qNUhGlw2dvGfPHhwCWp2PNxZQ7Pnz51HnEp6gSszKysLCQuwOtsE8VgnsExSwiD+ZvOkJLndRGtGsfuEjk3gR3jFXRXa/mzsqLWl2Emk541zY0JpQNQ7TNyoqarqV1QBdPXBuO9v2jz/+8PHxgWl97tx5+M8hISHeXt7r16+fNnWaslIfALlo4aKbt241fGkSyAFUmMoHDhyANnZ0dIQRztfeT4qLwbC9nZ2npyesdO4UNzc3uOVkB+Ht7Q3dTmJy+fLlUSYjy8rK+HjHnI+BS0/9SPbLly/R0cAzRwLbyF9RUUFwP3R2J+70UYMm2dh/O9UWSoVvHJjYfMtcIhL5erwZNFZvelV/nbonxU10fJ49ew6HHFjOnGE9dIjBAF1deOZI/bW4v3o6utgIqiMiTuTk5AgdJ4N3DQihPsmICSAZ1MHm5+ONv8AkzFhY4A4ODugdgPd6Z2cq3uRDgYZ4x8fHYyEhIQE9CIqqrq6GCwA/n/zOWURExGe8P/HCx1y5fOH4QWNOXpc65j/I9tty4s6ffU5HhX7dsKFEJPJ1wlSjs/rQOfqD60pLmrUjaYQzmazsnJzk5JSEhHuQ1LQ0KFsQ1dBopwpInv3bb9CxcJt37doFGv18fcEeiTf+3e7ujoX9+/fD93ZxcQHJTccbWt3JyQk+9r7AfVDXmzZtevToEemKc+MgWlh8wZschXv06GHwQc+z4RMy47sXpHC/VSIqMbO/fAOc/2WypwVcc11o4uQRJRlE5t0uJ45Ynzt3SmKWS6SFhQXfW4nG1BvwJjGhrrzsPTWVlYpJdQIL5dxUJyybsI0lz3Ozbx05tGvqRKS7YaEv8vNqiwoveXoGTrZ8lpWFDgKuvr+/f2RkJDQw+ak5+AXkbJyLFy/CXX/Lm+oHqoOCgjgcDlQ9PHZyNh60PawD7H769Gly6A6ef0BAQGxs7P3795Ef5RPUqwClWlxcnJR0P/bimeizYcLTmdCT4btC9lneuUh7VcqNpnojmhZ+cPrJY1uuXw6+dT3s1rWjf57bE3F0y/FQVzJFhu+IPhNy6+a1kpISgXgPEpFICwhbVQXGOVtRmTlsaLXJiGpjSjIyFJOq6n+r6pc5SIafV9lGw6kZ2PV5hCa2sWGVoSFz4EC2IncYv4VmrQl1PMj5jKIExgM6htiL5w/6mYUGzbp06QIsDXga1Ay1fxVs/CZTgiQika8xzlVV2ErK7N40Di+Bc3ZvZe6vIu+73yISi5eY9Qvs+uWKXv0EtlAXRCZFGkuRVqnEnWDDVGo9vJsoIDYlJSUrM1PyFFoi37lw+qty6HS2Kp2jQquii0l0XuIvf/mL8znRq1Tof/lXhf55LxWBfT+vcviFKPMSuYsK/emqFS1w4v8HAP08pG3KN4QAAAAASUVORK5CYII="); + setListNumrodlfProperty(new ArrayList() { + { + add("nimrodlf.p1=#CE0006"); + add("nimrodlf.p2=#D80010"); + add("nimrodlf.p3=#E2001A"); + add("nimrodlf.s1=#D6D6D6"); + add("nimrodlf.s2=#E0E0E0"); + add("nimrodlf.s3=#EAEAEA"); + add("nimrodlf.w=#FFFFFF"); + add("nimrodlf.b=#000000"); + add("nimrodlf.menuOpacity=195"); + add("nimrodlf.frameOpacity=180"); + } + }); + } + }; + + public Risposta> getConfiguration() { + Risposta> risposta = new Risposta<>(); + risposta.setRisposta(RispostaCostanti.OK); + risposta.setObj(configurazione); + return risposta; + } + + public Risposta> getType() { + Risposta> risposta = new Risposta<>(); + risposta.setRisposta(RispostaCostanti.OK); + risposta.setObj(mappa); + return risposta; + } + + public Risposta> getTypeVerbale() { + Risposta> risposta = new Risposta<>(); + Map mappa = new HashMap<>(); + risposta.setRisposta(RispostaCostanti.OK); + risposta.setObj(mappa); + return risposta; + } + + public Risposta loginCodiceFiscale(String codiceFiscale) { + javax.portlet.PortletPreferences jxPortletPreferences = FirmaUtil.getPortletPreferences(); + String codiceFiscaleTest = jxPortletPreferences.getValue("codiceFiscaleTest", StringPool.BLANK); + + Risposta risposta = new Risposta<>(); + if (codiceFiscale.equals(codiceFiscaleTest)) { + String tokenTest = jxPortletPreferences.getValue("tokenTest", StringPool.BLANK); + risposta.setObj(tokenTest); + risposta.setRisposta(RispostaCostanti.OK); + } else { + // TODO da migliorare per sicurezza e poi modificare a giro + risposta.setObj(codiceFiscale); + risposta.setRisposta(RispostaCostanti.OK); + } + return risposta; + } + + public Risposta loginNomeCognome(String nome, String cognome) { + javax.portlet.PortletPreferences jxPortletPreferences = FirmaUtil.getPortletPreferences(); + String nomeTest = jxPortletPreferences.getValue("nomeTest", StringPool.BLANK); + String cognomeTest = jxPortletPreferences.getValue("cognomeTest", StringPool.BLANK); + Risposta risposta = new Risposta<>(); + if (nome.equals(nomeTest) && cognome.equals(cognomeTest)) { + String tokenTest = jxPortletPreferences.getValue("tokenTest", StringPool.BLANK); + risposta.setObj(tokenTest); + risposta.setRisposta(RispostaCostanti.OK); + } else { + // TODO + } + return risposta; + } + + public Risposta version() { + javax.portlet.PortletPreferences jxPortletPreferences = FirmaUtil.getPortletPreferences(); + String versione = jxPortletPreferences.getValue("versione", StringPool.BLANK); + Risposta risposta = new Risposta<>(); + if (!Validator.isBlank(versione)) { + risposta.setObj(versione); + risposta.setRisposta(RispostaCostanti.OK); + } + return risposta; + } + + public Risposta getStile() { + Risposta risposta = new Risposta<>(); + risposta.setRisposta(RispostaCostanti.OK); + risposta.setObj(stile); + return risposta; + } +} \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/util/FirmaPostUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/util/FirmaPostUtil.java index 4d241107..fb99e891 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/util/FirmaPostUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/util/FirmaPostUtil.java @@ -40,268 +40,248 @@ import org.apache.commons.io.IOUtils; public class FirmaPostUtil { - private static final Log _log = LogFactoryUtil.getLog(FirmaPostUtil.class); - - public Risposta> getFileList(String token) { - - /** - * Verificare che il token sia il codice fiscale altrimenti c e un metodo che estre il cod fisc - * dal token userCodiceFiscalePrimaFirma = al cod fisc di Avviso...tipoAvviso = S && - * fileEntryIdInvio = 0 && fileEntryIdBase != 0 && !rifiutato ( aggiungere campo al service e - * anche campo dtRifiuto) con il fileEntryIdBase prendo il file e uso per riempire lista di - * ritorno - * - * NEL RITORNO "tipoDocumento" è documenttype con intPraticaId faccio fetch su tabella - * intPratica e prendo campo tipopratica - * - */ - long[] companyIds = PortalUtil.getCompanyIds(); - Risposta> risposta = new Risposta>(); - for (long companyId : companyIds) { - - - Company company = null; - try { - company = CompanyLocalServiceUtil.getCompany(companyId); - } catch (Exception e) { - _log.error(e, e); - } - String urlPdfExtractor = (String) company.getExpandoBridge().getAttribute("url_pdf_extractor", false); - if (Validator.isNotNull(urlPdfExtractor)) { - byte[] fileArray = Base64.decode(token); - - List listaCodiciFiscali = FirmaUtil.getCodiceFiscale(fileArray, urlPdfExtractor); - String cf = listaCodiciFiscali.get(0); - - List listaFile = new ArrayList(); - - // Ricordarsi di verificare che nel token ci sia il cod fisc in chiaro altrimenti va - // estratto - try { - - // List listaAvvisi = AvvisoLocalServiceUtil.findByIntPratica(1001, -1, -1, null); - - List listaAvvisi = AvvisoLocalServiceUtil.getListaAvvisiPerApplet(cf); - if (Validator.isNotNull(listaAvvisi) && listaAvvisi.size() > 0) { - - for (Avviso avviso : listaAvvisi) { - - if (Validator.isNotNull(avviso.getFileEntryIdBase())) { - DLFileEntry fileEntry = DLFileEntryLocalServiceUtil.fetchDLFileEntry(avviso.getFileEntryIdBase()); - IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(avviso.getIntPraticaId()); - if (Validator.isNotNull(fileEntry)) { - - RestFile restFile = new RestFile(); - restFile.setIdFile(GetterUtil.getInteger(avviso.getAvvisoId())); - restFile.setDataInvio(new Date()); - - String tipoDocumento = avviso.translateTipoDocumento(); - - restFile.setDocumentiType(avviso.getTipoDocumento()); // TO-VERIFY - restFile.setNomeFile(LanguageUtil.get(Locale.ITALIAN, tipoDocumento) + StringPool.SPACE - + StringPool.DASH + StringPool.SPACE + intPratica.getTitle(Locale.ITALIAN, true)); - restFile.setFile(""); - - Group group = GroupLocalServiceUtil.getGroup(avviso.getGroupId()); - Organization organization = OrganizationLocalServiceUtil.getOrganization(group.getOrganizationId()); - restFile.setTipoPratica(organization.getName()); - - listaFile.add(restFile); - } - } - } - } - - risposta.setObj(listaFile); - risposta.setRisposta(RispostaCostanti.OK); - - } catch (Exception e) { - _log.error(e.getMessage(), e); - risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE); - } - } - } - return risposta; - } - - public Risposta getFile(String token, String tipo, String id) { - - /* - * verra passato l avviso id facciamo query per riprendere file entry e ritorniamo quel file con - * il contenuto - */ - - Risposta risposta = new Risposta(); - - try { - - Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(GetterUtil.getLong(id)); - if (Validator.isNotNull(avviso)) { - - if (Validator.isNotNull(avviso.getFileEntryIdBase())) { - DLFileEntry fileEntry = DLFileEntryLocalServiceUtil.fetchDLFileEntry(avviso.getFileEntryIdBase()); - if (Validator.isNotNull(fileEntry)) { - - RestFile restFile = new RestFile(); - restFile.setIdFile(GetterUtil.getInteger(avviso.getAvvisoId())); - restFile.setDataInvio(new Date()); - restFile.setDocumentiType(avviso.getTipoDocumento()); // TO-VERIFY - restFile.setNomeFile(fileEntry.getTitle() + StringPool.PERIOD + fileEntry.getExtension()); - restFile.setTipoPratica(StringPool.BLANK); - // Recupero il tipo di pratica - /* - * if (Validator.isNotNull(avviso.getIntPraticaId())) { IntPratica intPratica = - * IntPraticaLocalServiceUtil.fetchIntPratica(avviso.getIntPraticaId()); if - * (Validator.isNotNull(intPratica)) { - * restFile.setTipoPratica(intPratica.getTipoPratica()); } } - */ - - // Inserisco il contenuto del file in Base64 - - InputStream fileInputStream = - DLFileEntryLocalServiceUtil.getFileAsStream(fileEntry.getFileEntryId(), fileEntry.getVersion()); - - ByteArrayOutputStream bao = new ByteArrayOutputStream(); - IOUtils.copy(fileInputStream, bao); - restFile.setFile(Base64.encode(bao.toByteArray())); - - risposta.setRisposta(RispostaCostanti.OK); - risposta.setObj(restFile); - - } - } - } - - } catch (SystemException e) { - _log.error(e.getMessage(), e); - risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE); - } catch (PortalException e) { - _log.error(e.getMessage(), e); - risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE); - } catch (IOException e) { - _log.error(e.getMessage(), e); - risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE); - } - - return risposta; - } - - public Risposta openPratica(String token, String idFile) { - - /** - * mi arriva l'avviso id e mi recupero l intpraticaid bisogna ritornare ad una pagina privata di - * bo con la view sistemata per gestire direttamente la pratica portos-bo-portlet fascicolo - * portlet ..... intpraticaid - */ - Risposta risposta = new Risposta(); - - try { - - Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(GetterUtil.getLong(idFile)); - if (Validator.isNotNull(avviso)) { - - // Prendo la url della pagina da ritornare settata nel expando custom field della company - // di riferimento e ci aggiungo nella url l attributo relativo all id della intPratica - Company company = CompanyLocalServiceUtil.fetchCompany(avviso.getCompanyId()); - if (Validator.isNotNull(company)) { - - String urlToBack = - GetterUtil.getString(company.getExpandoBridge().getAttribute("url-bo-gestione-pratica-firma", false)); - - urlToBack = urlToBack + "&_1_WAR_portosboportlet_intPraticaId=" + avviso.getIntPraticaId(); - risposta.setObj(urlToBack); - risposta.setRisposta(RispostaCostanti.OK); - } - - } - - - } catch (SystemException e) { - _log.error(e.getMessage(), e); - risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE); - } - - return risposta; - - } - - public Risposta rifiuta(String token, String idFile, String messaggio, String cambiaFase, String assegna) { - - /** - * mi arriva l'avviso id lo recupero e setto rifiutato e dtRifiuto e aggiorno - * - * - */ - Risposta risposta = new Risposta(); - - - try { - - Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(GetterUtil.getLong(idFile)); - if (Validator.isNotNull(avviso)) { - avviso.setRifiutato(true); - avviso.setDtRifiuto(new Date()); - avviso.setCommentoRifiuto(Validator.isNotNull(messaggio) ? messaggio : StringPool.BLANK); - - AvvisoLocalServiceUtil.updateAvviso(avviso); - risposta.setObj(true); - risposta.setRisposta(RispostaCostanti.OK); - - } - - } catch (SystemException e) { - _log.error(e.getMessage(), e); - risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE); - } - - return risposta; - } - - public Risposta setFile(String token, String fileToSave, String tipo, String idFile, - ServiceContext serviceContext) { - - /** - * Mi arriverà l avviso id e il contenuto e creero un file entry e aggiornero l avviso con il - * fileEntryIdInvio - * - * per la creazione del fileentry devo vedere SchedulerGeneraDocumento per creare il filename e - * la folder - * - */ - Risposta risposta = new Risposta(); - - try { - - Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(GetterUtil.getLong(idFile)); - if (Validator.isNotNull(avviso)) { - - // CREO IL FILE - serviceContext.setCompanyId(avviso.getCompanyId()); - serviceContext.setScopeGroupId(avviso.getGroupId()); - serviceContext.setUserId(avviso.getUserId()); - - avviso = - AvvisoLocalServiceUtil - .addFileFirmato(avviso.getAvvisoId(), avviso.getClassPk(), fileToSave, serviceContext); - - risposta.setObj(true); - risposta.setRisposta(RispostaCostanti.OK); - } - - } catch (SystemException e) { - _log.error(e.getMessage(), e); - risposta.setObj(false); - risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE); - } catch (PortalException e) { - _log.error(e.getMessage(), e); - risposta.setObj(false); - risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE); - } catch (Exception e) { - _log.error(e.getMessage(), e); - risposta.setObj(false); - risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE); - } - - return risposta; - } + private static final Log _log = LogFactoryUtil.getLog(FirmaPostUtil.class); + + public Risposta> getFileList(String token) { + + /** + * Verificare che il token sia il codice fiscale altrimenti c e un + * metodo che estre il cod fisc dal token userCodiceFiscalePrimaFirma = + * al cod fisc di Avviso...tipoAvviso = S && fileEntryIdInvio = 0 && + * fileEntryIdBase != 0 && !rifiutato ( aggiungere campo al service e + * anche campo dtRifiuto) con il fileEntryIdBase prendo il file e uso + * per riempire lista di ritorno + * + * NEL RITORNO "tipoDocumento" è documenttype con intPraticaId faccio + * fetch su tabella intPratica e prendo campo tipopratica + * + */ + long[] companyIds = PortalUtil.getCompanyIds(); + Risposta> risposta = new Risposta>(); + for (long companyId : companyIds) { + + Company company = null; + try { + company = CompanyLocalServiceUtil.getCompany(companyId); + } catch (Exception e) { + _log.error(e, e); + } + String urlPdfExtractor = (String) company.getExpandoBridge().getAttribute("url_pdf_extractor", + false); + if (Validator.isNotNull(urlPdfExtractor)) { + byte[] fileArray = Base64.decode(token); + + List listaCodiciFiscali = FirmaUtil.getCodiceFiscale(fileArray, urlPdfExtractor); + String cf = listaCodiciFiscali.get(0); + + List listaFile = new ArrayList(); + + try { + List listaAvvisi = AvvisoLocalServiceUtil.getListaAvvisiPerApplet(cf); + if (Validator.isNotNull(listaAvvisi) && listaAvvisi.size() > 0) { + + for (Avviso avviso : listaAvvisi) { + + if (Validator.isNotNull(avviso.getFileEntryIdBase())) { + DLFileEntry fileEntry = DLFileEntryLocalServiceUtil.fetchDLFileEntry(avviso + .getFileEntryIdBase()); + IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(avviso + .getIntPraticaId()); + if (Validator.isNotNull(fileEntry)) { + + RestFile restFile = new RestFile(); + restFile.setIdFile(GetterUtil.getInteger(avviso.getAvvisoId())); + restFile.setDataInvio(new Date()); + + String tipoDocumento = avviso.translateTipoDocumento(); + + restFile.setDocumentiType(avviso.getTipoDocumento()); // TO-VERIFY + restFile.setNomeFile(LanguageUtil.get(Locale.ITALIAN, tipoDocumento) + + StringPool.SPACE + StringPool.DASH + StringPool.SPACE + + intPratica.getTitle(Locale.ITALIAN, true)); + restFile.setFile(""); + + Group group = GroupLocalServiceUtil.getGroup(avviso.getGroupId()); + Organization organization = OrganizationLocalServiceUtil + .getOrganization(group.getOrganizationId()); + restFile.setTipoPratica(organization.getName()); + + listaFile.add(restFile); + } + } + } + } + + risposta.setObj(listaFile); + risposta.setRisposta(RispostaCostanti.OK); + + } catch (Exception e) { + _log.error(e.getMessage(), e); + risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE); + } + } + } + return risposta; + } + + public Risposta getFile(String token, String tipo, String id) { + + /* + * verra passato l avviso id facciamo query per riprendere file entry e + * ritorniamo quel file con il contenuto + */ + + Risposta risposta = new Risposta(); + + try { + + Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(GetterUtil.getLong(id)); + if (Validator.isNotNull(avviso)) { + + if (Validator.isNotNull(avviso.getFileEntryIdBase())) { + DLFileEntry fileEntry = DLFileEntryLocalServiceUtil.fetchDLFileEntry(avviso + .getFileEntryIdBase()); + if (Validator.isNotNull(fileEntry)) { + + RestFile restFile = new RestFile(); + restFile.setIdFile(GetterUtil.getInteger(avviso.getAvvisoId())); + restFile.setDataInvio(new Date()); + restFile.setDocumentiType(avviso.getTipoDocumento()); // TO-VERIFY + restFile.setNomeFile(fileEntry.getTitle() + StringPool.PERIOD + + fileEntry.getExtension()); + restFile.setTipoPratica(StringPool.BLANK); + + // Inserisco il contenuto del file in Base64 + InputStream fileInputStream = DLFileEntryLocalServiceUtil.getFileAsStream( + fileEntry.getFileEntryId(), fileEntry.getVersion()); + ByteArrayOutputStream bao = new ByteArrayOutputStream(); + IOUtils.copy(fileInputStream, bao); + restFile.setFile(Base64.encode(bao.toByteArray())); + + risposta.setRisposta(RispostaCostanti.OK); + risposta.setObj(restFile); + + } + } + } + + } catch (SystemException | PortalException | IOException e) { + _log.error(e.getMessage(), e); + risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE); + } + + return risposta; + } + + public Risposta openPratica(String token, String idFile) { + + /** + * mi arriva l'avviso id e mi recupero l intpraticaid bisogna ritornare + * ad una pagina privata di bo con la view sistemata per gestire + * direttamente la pratica portos-bo-portlet fascicolo portlet ..... + * intpraticaid + */ + Risposta risposta = new Risposta(); + + try { + + Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(GetterUtil.getLong(idFile)); + if (Validator.isNotNull(avviso)) { + + // Prendo la url della pagina da ritornare settata nel expando + // custom field della company + // di riferimento e ci aggiungo nella url l attributo relativo + // all id della intPratica + Company company = CompanyLocalServiceUtil.fetchCompany(avviso.getCompanyId()); + if (Validator.isNotNull(company)) { + + String urlToBack = GetterUtil.getString(company.getExpandoBridge().getAttribute( + "url-bo-gestione-pratica-firma", false)); + + urlToBack = urlToBack + "&_1_WAR_portosboportlet_intPraticaId=" + + avviso.getIntPraticaId(); + risposta.setObj(urlToBack); + risposta.setRisposta(RispostaCostanti.OK); + } + + } + + } catch (SystemException e) { + _log.error(e.getMessage(), e); + risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE); + } + + return risposta; + + } + + public Risposta rifiuta(String token, String idFile, String messaggio, String cambiaFase, + String assegna) { + + /** + * mi arriva l'avviso id lo recupero e setto rifiutato e dtRifiuto e + * aggiorno + * + * + */ + Risposta risposta = new Risposta(); + + try { + + Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(GetterUtil.getLong(idFile)); + if (Validator.isNotNull(avviso)) { + avviso.setRifiutato(true); + avviso.setDtRifiuto(new Date()); + avviso.setCommentoRifiuto(Validator.isNotNull(messaggio) ? messaggio : StringPool.BLANK); + + AvvisoLocalServiceUtil.updateAvviso(avviso); + risposta.setObj(true); + risposta.setRisposta(RispostaCostanti.OK); + + } + + } catch (SystemException e) { + _log.error(e.getMessage(), e); + risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE); + } + + return risposta; + } + + public Risposta setFile(String token, String fileToSave, String tipo, String idFile, + ServiceContext serviceContext) { + + /** + * Mi arriverà l avviso id e il contenuto e creero un file entry e + * aggiornero l avviso con il fileEntryIdInvio + * + * per la creazione del fileentry devo vedere SchedulerGeneraDocumento + * per creare il filename e la folder + * + */ + Risposta risposta = new Risposta(); + + try { + Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(GetterUtil.getLong(idFile)); + if (Validator.isNotNull(avviso)) { + + // CREO IL FILE + serviceContext.setCompanyId(avviso.getCompanyId()); + serviceContext.setScopeGroupId(avviso.getGroupId()); + serviceContext.setUserId(avviso.getUserId()); + + avviso = AvvisoLocalServiceUtil.addFileFirmato(avviso.getAvvisoId(), avviso.getClassPk(), + fileToSave, serviceContext); + + risposta.setObj(true); + risposta.setRisposta(RispostaCostanti.OK); + } + } catch (Exception e) { + _log.error(e.getMessage(), e); + risposta.setObj(false); + risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE); + } + + return risposta; + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/util/FirmaUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/util/FirmaUtil.java index 741f2cc6..4a8308e3 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/util/FirmaUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/util/FirmaUtil.java @@ -25,65 +25,64 @@ import org.apache.http.impl.client.DefaultHttpClient; public class FirmaUtil { - private static final Log _log = LogFactoryUtil.getLog(FirmaUtil.class); + private static final Log _log = LogFactoryUtil.getLog(FirmaUtil.class); - public static javax.portlet.PortletPreferences getPortletPreferences() { + public static javax.portlet.PortletPreferences getPortletPreferences() { - List pr = null; - String preferencesXML; - javax.portlet.PortletPreferences jxPortletPreferences = null; - try { - pr = - PortletPreferencesLocalServiceUtil.getPortletPreferences(PortletKeys.PREFS_OWNER_TYPE_COMPANY, 0, - "firma_WAR_portosfirmaportlet"); - preferencesXML = pr.get(0).getPreferences(); - jxPortletPreferences = PortletPreferencesFactoryUtil.fromDefaultXML(preferencesXML); - } catch (SystemException e) { - _log.error(e.getMessage()); - } + List pr = null; + String preferencesXML; + javax.portlet.PortletPreferences jxPortletPreferences = null; + try { + pr = PortletPreferencesLocalServiceUtil.getPortletPreferences( + PortletKeys.PREFS_OWNER_TYPE_COMPANY, 0, "firma_WAR_portosfirmaportlet"); + preferencesXML = pr.get(0).getPreferences(); + jxPortletPreferences = PortletPreferencesFactoryUtil.fromDefaultXML(preferencesXML); + } catch (SystemException e) { + _log.error(e.getMessage()); + } - return jxPortletPreferences; - } + return jxPortletPreferences; + } - public static List getCodiceFiscale(byte[] fileArray, String urlPdfExtractor) { + public static List getCodiceFiscale(byte[] fileArray, String urlPdfExtractor) { - List listaCodiciFiscali = null; - try { + List listaCodiciFiscali = null; + try { - File file = File.createTempFile("codicefiscale", ".p7m"); - FileUtils.writeByteArrayToFile(file, fileArray); + File file = File.createTempFile("codicefiscale", ".p7m"); + FileUtils.writeByteArrayToFile(file, fileArray); - ObjectMapper mapper = new ObjectMapper(); + ObjectMapper mapper = new ObjectMapper(); - // long companyId = CompanyThreadLocal.getCompanyId(); + // long companyId = CompanyThreadLocal.getCompanyId(); + ContentBody body = new FileBody(file); - ContentBody body = new FileBody(file); + MultipartEntity entity = new MultipartEntity(); + entity.addPart("file", body); - MultipartEntity entity = new MultipartEntity(); - entity.addPart("file", body); - - HttpPost request = new HttpPost(urlPdfExtractor); - request.setEntity(entity); + HttpPost request = new HttpPost(urlPdfExtractor); + request.setEntity(entity); - HttpClient client = new DefaultHttpClient(); - HttpResponse response = client.execute(request); + HttpClient client = new DefaultHttpClient(); + HttpResponse response = client.execute(request); - if (response.getStatusLine().getStatusCode() != 200) { - throw new RuntimeException("Failed : HTTP error code : " + response.getStatusLine().getStatusCode()); - } - InputStream inputStream = response.getEntity().getContent(); + if (response.getStatusLine().getStatusCode() != 200) { + throw new RuntimeException("Failed : HTTP error code : " + + response.getStatusLine().getStatusCode()); + } + InputStream inputStream = response.getEntity().getContent(); - ExtractorResponse extractorResponse = mapper.readValue(inputStream, ExtractorResponse.class); + ExtractorResponse extractorResponse = mapper.readValue(inputStream, ExtractorResponse.class); - if (extractorResponse.isSuccess()) { - listaCodiciFiscali = extractorResponse.getCf(); - } + if (extractorResponse.isSuccess()) { + listaCodiciFiscali = extractorResponse.getCf(); + } - } catch (IOException e) { - _log.error(e.getMessage()); - } + } catch (IOException e) { + _log.error(e.getMessage()); + } - return listaCodiciFiscali; - } + return listaCodiciFiscali; + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/ivy.xml b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/ivy.xml index 12a2dd41..c90498c1 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/ivy.xml +++ b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/ivy.xml @@ -14,5 +14,9 @@ + + + + \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/ivy.xml.MD5 b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/ivy.xml.MD5 index 5492befa..ddcc2b49 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/ivy.xml.MD5 +++ b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/ivy.xml.MD5 @@ -1 +1 @@ -5ce14a43480763a02a7a0f47d7f82801 +a15636541520cd34beccb182ca342eb1 diff --git a/liferay-plugins-sdk-6.2/portlets/portos-jbpm-log-task-portlet/docroot/html/jbpmlog/init.jsp b/liferay-plugins-sdk-6.2/portlets/portos-jbpm-log-task-portlet/docroot/html/jbpmlog/init.jsp index 5a1f78c4..da182251 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-jbpm-log-task-portlet/docroot/html/jbpmlog/init.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-jbpm-log-task-portlet/docroot/html/jbpmlog/init.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="java.text.Format"%> <%@page import="com.liferay.portal.kernel.util.FastDateFormatFactoryUtil"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-jbpm-log-task-portlet/docroot/html/jbpmlog/view.jsp b/liferay-plugins-sdk-6.2/portlets/portos-jbpm-log-task-portlet/docroot/html/jbpmlog/view.jsp index 9062792c..ddc8beea 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-jbpm-log-task-portlet/docroot/html/jbpmlog/view.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-jbpm-log-task-portlet/docroot/html/jbpmlog/view.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="com.liferay.portal.kernel.util.KeyValuePair"%> <%@page import="java.util.Iterator"%> <%@page import="com.liferay.portal.kernel.json.JSONObject"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/init.jsp b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/init.jsp index f48c6d2d..1c412f4a 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/init.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/init.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="com.liferay.portal.kernel.util.StringUtil"%> <%@page import="java.util.Arrays"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/workflow_form_admin/edit_form_definition_link.jsp b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/workflow_form_admin/edit_form_definition_link.jsp index 79ab159f..7c27449c 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/workflow_form_admin/edit_form_definition_link.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/workflow_form_admin/edit_form_definition_link.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="com.liferay.portal.workflow.kaleo.definition.NodeType"%> <%@page import="com.liferay.portal.workflow.kaleo.model.KaleoTransition"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/workflow_form_admin/form_definition_link_action.jsp b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/workflow_form_admin/form_definition_link_action.jsp index cc24d1b3..1df8200b 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/workflow_form_admin/form_definition_link_action.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/workflow_form_admin/form_definition_link_action.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="it.tref.liferay.portos.kaleo.model.FormDefinitionLink"%> <%@page import="com.liferay.portal.kernel.util.Validator"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/workflow_form_admin/init.jsp b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/workflow_form_admin/init.jsp index 2a47faca..771a9225 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/workflow_form_admin/init.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/workflow_form_admin/init.jsp @@ -1,2 +1,3 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ include file="/html/init.jsp" %> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/workflow_form_admin/select_workflow_definition.jsp b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/workflow_form_admin/select_workflow_definition.jsp index 4a484421..fcdf48fb 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/workflow_form_admin/select_workflow_definition.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/workflow_form_admin/select_workflow_definition.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="com.liferay.portal.kernel.util.HtmlUtil"%> <%@page import="com.liferay.portal.kernel.language.LanguageUtil"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/workflow_form_admin/template/edit_form_template_link.jsp b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/workflow_form_admin/template/edit_form_template_link.jsp index ebdf9125..b299e5d0 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/workflow_form_admin/template/edit_form_template_link.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/workflow_form_admin/template/edit_form_template_link.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="it.tref.liferay.portos.kaleo.service.FormDefinitionLinkLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.kaleo.FormTemplateLinkKaleoNodeIdException"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/workflow_form_admin/template/form_template_link_action.jsp b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/workflow_form_admin/template/form_template_link_action.jsp index bf3646b2..bee31ed9 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/workflow_form_admin/template/form_template_link_action.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/workflow_form_admin/template/form_template_link_action.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="it.tref.liferay.portos.kaleo.model.FormTemplateLink"%> <%@page import="com.liferay.portal.kernel.util.Validator"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/workflow_form_admin/template/template_toolbar.jsp b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/workflow_form_admin/template/template_toolbar.jsp index 7ed5a235..5b28a987 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/workflow_form_admin/template/template_toolbar.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/workflow_form_admin/template/template_toolbar.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="javax.portlet.PortletRequest"%> <%@page import="com.liferay.portal.kernel.language.UnicodeLanguageUtil"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/workflow_form_admin/template/view_form_template_links.jsp b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/workflow_form_admin/template/view_form_template_links.jsp index d362e95f..5935af2d 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/workflow_form_admin/template/view_form_template_links.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/workflow_form_admin/template/view_form_template_links.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="com.liferay.portal.kernel.language.UnicodeLanguageUtil"%> <%@page import="com.liferay.portal.kernel.dao.search.RowChecker"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/workflow_form_admin/toolbar.jsp b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/workflow_form_admin/toolbar.jsp index a71783d3..29837573 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/workflow_form_admin/toolbar.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/workflow_form_admin/toolbar.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="com.liferay.portlet.dynamicdatamapping.model.DDMStructure"%> <%@page import="javax.portlet.PortletRequest"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/workflow_form_admin/view.jsp b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/workflow_form_admin/view.jsp index 86a69556..ad2dc99a 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/workflow_form_admin/view.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/html/workflow_form_admin/view.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="com.liferay.portlet.dynamicdatamapping.service.DDMStructureLocalServiceUtil"%> <%@page import="com.liferay.portlet.dynamicdatamapping.model.DDMStructure"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-log-portlet/docroot/html/init.jsp b/liferay-plugins-sdk-6.2/portlets/portos-log-portlet/docroot/html/init.jsp index bce00918..d43a95e8 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-log-portlet/docroot/html/init.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-log-portlet/docroot/html/init.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-log-portlet/docroot/view.jsp b/liferay-plugins-sdk-6.2/portlets/portos-log-portlet/docroot/view.jsp index 486845c9..27251fd3 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-log-portlet/docroot/view.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-log-portlet/docroot/view.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <% /** * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/.classpath b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/.classpath index 130677e9..502539e1 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/.classpath +++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/.classpath @@ -1,6 +1,7 @@ + diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/.settings/org.eclipse.wst.common.component b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/.settings/org.eclipse.wst.common.component index 04dff753..d3bd6d76 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/.settings/org.eclipse.wst.common.component +++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/.settings/org.eclipse.wst.common.component @@ -2,6 +2,7 @@ + diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/.tern-project b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/.tern-project new file mode 100644 index 00000000..a185ba0d --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/.tern-project @@ -0,0 +1 @@ +{"ide":{"scriptPaths":[]},"plugins":{"aui":{},"liferay":{},"yui":{}},"libs":["ecma5","browser"]} \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/service.xml b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/service.xml index f326de8a..ac025c86 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/service.xml +++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/service.xml @@ -157,7 +157,7 @@ - + diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/service/impl/EmailAttachmentLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/service/impl/EmailAttachmentLocalServiceImpl.java index b8680503..d5adec65 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/service/impl/EmailAttachmentLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/service/impl/EmailAttachmentLocalServiceImpl.java @@ -105,16 +105,11 @@ public class EmailAttachmentLocalServiceImpl extends EmailAttachmentLocalService @Override public EmailAttachment deleteEmailAttachment(EmailAttachment emailAttachment) throws SystemException { - - super.deleteEmailAttachment(emailAttachment); - - // File Entry - try { dlAppLocalService.deleteFileEntry(emailAttachment.getFileEntryId()); } catch (PortalException e) { } - + super.deleteEmailAttachment(emailAttachment); return emailAttachment; } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/util/MailEngine.java b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/util/MailEngine.java index ed938df1..170b06b4 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/util/MailEngine.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/util/MailEngine.java @@ -59,7 +59,7 @@ import javax.mail.internet.MimeMultipart; * @author Brian Wing Shun Chan * @author Brian Myunghun Kim * @author Jorge Ferrer - * @author Neil Griffin + * @author Neil Griffin<< * @author Thiago Moreira * @author Brett Swaim */ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/common/email_dialog_attachment.jsp b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/common/email_dialog_attachment.jsp index a4859bbe..39f77085 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/common/email_dialog_attachment.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/common/email_dialog_attachment.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@include file="/html/init.jsp" %> <% diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/email_templates/edit.jsp b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/email_templates/edit.jsp index fdde85d0..114d25d0 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/email_templates/edit.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/email_templates/edit.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@include file="/html/email_templates/init.jsp" %> <% diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/email_templates/email_send_popup_button.jsp b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/email_templates/email_send_popup_button.jsp index 7e89ec84..25082e4d 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/email_templates/email_send_popup_button.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/email_templates/email_send_popup_button.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@include file="/html/email_templates/init.jsp" %> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/email_templates/email_template_action.jsp b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/email_templates/email_template_action.jsp index d451e1e9..f69c6d61 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/email_templates/email_template_action.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/email_templates/email_template_action.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@include file="/html/email_templates/init.jsp" %> <% diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/email_templates/init.jsp b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/email_templates/init.jsp index 291e245a..79168c4b 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/email_templates/init.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/email_templates/init.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@include file="/html/init.jsp" %> <%@page import="org.apache.log4j.Logger"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/email_templates/send_popup/close_popup.jsp b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/email_templates/send_popup/close_popup.jsp index 73bfc8be..67111b66 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/email_templates/send_popup/close_popup.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/email_templates/send_popup/close_popup.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@include file="/html/email_templates/send_popup/init.jsp" %> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/email_templates/send_popup/init.jsp b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/email_templates/send_popup/init.jsp index ea4e3093..5ce28676 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/email_templates/send_popup/init.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/email_templates/send_popup/init.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@include file="/html/email_templates/init.jsp" %> <% String className = ParamUtil.getString(request, "className"); diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/email_templates/send_popup/view.jsp b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/email_templates/send_popup/view.jsp index e84a3723..0450532b 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/email_templates/send_popup/view.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/email_templates/send_popup/view.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@include file="/html/email_templates/send_popup/init.jsp" %> <% diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/email_templates/toolbar.jsp b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/email_templates/toolbar.jsp index 490715d3..57316f64 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/email_templates/toolbar.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/email_templates/toolbar.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@include file="/html/email_templates/init.jsp"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/email_templates/view.jsp b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/email_templates/view.jsp index ca92fe43..f513b796 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/email_templates/view.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/email_templates/view.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@include file="/html/email_templates/init.jsp" %> <%@page import="it.tref.liferay.portos.mailmanager.service.EmailTemplateLocalServiceUtil"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/init.jsp b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/init.jsp index 191d09e8..51c865d9 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/init.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/init.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="com.liferay.portal.util.PortalUtil"%> <%@page import="com.liferay.portlet.PortletURLUtil"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/mail_manager/edit.jsp b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/mail_manager/edit.jsp index 72c4f394..89ef8581 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/mail_manager/edit.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/mail_manager/edit.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@include file="/html/mail_manager/init.jsp" %> <% diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/mail_manager/email_action.jsp b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/mail_manager/email_action.jsp index 03f22413..43de79f2 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/mail_manager/email_action.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/mail_manager/email_action.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@include file="/html/mail_manager/init.jsp" %> <% diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/mail_manager/email_history_popup_button.jsp b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/mail_manager/email_history_popup_button.jsp index 96e85b6f..08210e78 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/mail_manager/email_history_popup_button.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/mail_manager/email_history_popup_button.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@include file="/html/mail_manager/init.jsp" %> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/mail_manager/init.jsp b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/mail_manager/init.jsp index 8936f925..e1014604 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/mail_manager/init.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/mail_manager/init.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@include file="/html/init.jsp" %> <%@page import="com.liferay.portal.kernel.util.TextFormatter"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/mail_manager/view.jsp b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/mail_manager/view.jsp index 8057dbba..5a3f7523 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/mail_manager/view.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/html/mail_manager/view.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@include file="/html/mail_manager/init.jsp" %> <% diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/.classpath b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/.classpath index 9975372f..af45f53a 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/.classpath +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/.classpath @@ -18,5 +18,6 @@ + diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/.project b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/.project index d40dfb40..79065197 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/.project +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/.project @@ -32,5 +32,6 @@ org.eclipse.wst.common.project.facet.core.nature org.eclipse.jdt.core.javanature org.eclipse.wst.jsdt.core.jsNature + org.apache.ivyde.eclipse.ivynature diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/commons-logging.jar b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/commons-logging.jar deleted file mode 100644 index 8758a96b..00000000 Binary files a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/commons-logging.jar and /dev/null differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/jstl-api.jar b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/jstl-api.jar deleted file mode 100644 index 80a5737f..00000000 Binary files a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/jstl-api.jar and /dev/null differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/jstl-impl.jar b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/jstl-impl.jar deleted file mode 100644 index e5a9342f..00000000 Binary files a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/jstl-impl.jar and /dev/null differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/log4j.jar b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/log4j.jar deleted file mode 100644 index 068867eb..00000000 Binary files a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/log4j.jar and /dev/null differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/util-bridges.jar b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/util-bridges.jar deleted file mode 100644 index 7d7435fe..00000000 Binary files a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/util-bridges.jar and /dev/null differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/util-taglib.jar b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/util-taglib.jar deleted file mode 100644 index fbba5f0a..00000000 Binary files a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/util-taglib.jar and /dev/null differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/content/Language.properties b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/content/Language.properties index 1356264e..bb37af71 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/content/Language.properties +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/content/Language.properties @@ -9,7 +9,7 @@ javax.portlet.title.1_WAR_portosmaintenanceportlet = Manutenzione ## Label -url-help = Indirizzo da invocare per la dismissione della modalità di manutenzione +url-help = Indirizzo da invocare per la dismissione della modalità  di manutenzione message-help = Messaggio da visualizzare nella finestra di manutenzione maintenance-schedule-id=Id diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/action/MaintenancePreServletControl.java b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/action/MaintenancePreServletControl.java index 7644804c..f4f93fec 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/action/MaintenancePreServletControl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/action/MaintenancePreServletControl.java @@ -27,71 +27,77 @@ import javax.servlet.http.HttpServletResponse; public class MaintenancePreServletControl extends Action { - private static final Log _log = LogFactoryUtil.getLog(MaintenancePreServletControl.class); + private static final Log _log = LogFactoryUtil.getLog(MaintenancePreServletControl.class); - private static final String[] allowedPortlets = new String[] {PortletKeys.LOGIN}; + private static final String[] allowedPortlets = new String[] { PortletKeys.LOGIN }; - private static String loginUrlRedirect = null; + private static String loginUrlRedirect = null; - @Override - public void run(HttpServletRequest request, HttpServletResponse response) throws ActionException { + @Override + public void run(HttpServletRequest request, HttpServletResponse response) throws ActionException { - // _log.info("INZIO MaintenancePreServletControl --------------->"); + // _log.info("INZIO MaintenancePreServletControl --------------->"); - try { + try { - ServiceContext serviceContext = ServiceContextFactory.getInstance(request); + ServiceContext serviceContext = ServiceContextFactory.getInstance(request); - List maintenanceSchedules = - MaintenanceScheduleLocalServiceUtil.findByStatus(MaintenanceStatus.IN_PROGRESS.getCode()); + List maintenanceSchedules = MaintenanceScheduleLocalServiceUtil + .findByStatus(MaintenanceStatus.IN_PROGRESS.getCode()); - if (!maintenanceSchedules.isEmpty()) { + if (!maintenanceSchedules.isEmpty()) { - MaintenanceType maintenanceType = MaintenanceType.parse(maintenanceSchedules.get(0).getType()); + MaintenanceType maintenanceType = MaintenanceType + .parse(maintenanceSchedules.get(0).getType()); - if (maintenanceType == MaintenanceType.FULL) { + if (maintenanceType == MaintenanceType.FULL) { - response.sendRedirect("/html/portal/maintenance.jsp"); - throw new ActionException("Maintenance mode active"); + response.sendRedirect("/html/portal/maintenance.jsp"); + throw new ActionException("Maintenance mode active"); - } else if (maintenanceType == MaintenanceType.USER) { + } else if (maintenanceType == MaintenanceType.USER) { - User user = UserLocalServiceUtil.fetchUser(serviceContext.getUserId()); + User user = UserLocalServiceUtil.fetchUser(serviceContext.getUserId()); - // Se request per portlet non consentite (LOGIN) - if (!ArrayUtil.contains(allowedPortlets, ParamUtil.getString(request, "p_p_id"))) { - if (user.isDefaultUser()) {// Se non loggato - response.sendRedirect(getLoginUrlRedirect(request)); - throw new ActionException("Maintenance mode active"); - } else if (!PortalUtil.isCompanyAdmin(user)) {// Se non admin - response.sendRedirect("/html/portal/maintenance.jsp"); - throw new ActionException("Maintenance mode active"); - } - } else { - if (!user.isDefaultUser() && !PortalUtil.isCompanyAdmin(user)) {// Se loggato non admin - response.sendRedirect("/html/portal/maintenance.jsp"); - throw new ActionException("Maintenance mode active"); - } - } - } + // Se request per portlet non consentite (LOGIN) + if (!ArrayUtil.contains(allowedPortlets, ParamUtil.getString(request, "p_p_id"))) { + if (user.isDefaultUser()) {// Se non loggato + response.sendRedirect(getLoginUrlRedirect(request)); + throw new ActionException("Maintenance mode active"); + } else if (!PortalUtil.isCompanyAdmin(user)) {// Se non + // admin + response.sendRedirect("/html/portal/maintenance.jsp"); + throw new ActionException("Maintenance mode active"); + } + } else { + if (!user.isDefaultUser() && !PortalUtil.isCompanyAdmin(user)) {// Se + // loggato + // non + // admin + response.sendRedirect("/html/portal/maintenance.jsp"); + throw new ActionException("Maintenance mode active"); + } + } + } - } + } - } catch (Exception e) { - _log.error(e); - } + } catch (Exception e) { + _log.error(e); + } - } + } - private String getLoginUrlRedirect(HttpServletRequest request) { + private String getLoginUrlRedirect(HttpServletRequest request) { - if (loginUrlRedirect == null) { - loginUrlRedirect = PortalUtil.getPortalURL(request); - loginUrlRedirect = HttpUtil.addParameter(loginUrlRedirect, "p_p_id", PortletKeys.LOGIN); - loginUrlRedirect = HttpUtil.addParameter(loginUrlRedirect, "p_p_state", WindowState.MAXIMIZED.toString()); - loginUrlRedirect = HttpUtil.addParameter(loginUrlRedirect, "p_p_lifecycle", "0"); - } + if (loginUrlRedirect == null) { + loginUrlRedirect = PortalUtil.getPortalURL(request); + loginUrlRedirect = HttpUtil.addParameter(loginUrlRedirect, "p_p_id", PortletKeys.LOGIN); + loginUrlRedirect = HttpUtil.addParameter(loginUrlRedirect, "p_p_state", + WindowState.MAXIMIZED.toString()); + loginUrlRedirect = HttpUtil.addParameter(loginUrlRedirect, "p_p_lifecycle", "0"); + } - return loginUrlRedirect; - } + return loginUrlRedirect; + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/action/MaintenanceStartAction.java b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/action/MaintenanceStartAction.java index 62aebb4e..b8b7d0ec 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/action/MaintenanceStartAction.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/action/MaintenanceStartAction.java @@ -14,25 +14,25 @@ import java.util.List; public class MaintenanceStartAction extends SimpleAction { - private static final Log _log = LogFactoryUtil.getLog(MaintenanceStartAction.class); + private static final Log _log = LogFactoryUtil.getLog(MaintenanceStartAction.class); - @Override - public void run(String[] ids) throws ActionException { + @Override + public void run(String[] ids) throws ActionException { - try { + try { - List maintenanceSchedules = - MaintenanceScheduleLocalServiceUtil.findByCompleted_Onreboot(Boolean.FALSE, - MaintenanceOnReboot.TERMINATE.getCode()); + List maintenanceSchedules = MaintenanceScheduleLocalServiceUtil + .findByCompleted_Onreboot(Boolean.FALSE, MaintenanceOnReboot.TERMINATE.getCode()); - for (MaintenanceSchedule maintenanceSchedule : maintenanceSchedules) { - MaintenanceScheduleLocalServiceUtil.updateStatus(maintenanceSchedule.getMaintenanceScheduleId(), - MaintenanceStatus.FORCE_ENDED.getCode(), "Ended for server reboot."); - } + for (MaintenanceSchedule maintenanceSchedule : maintenanceSchedules) { + MaintenanceScheduleLocalServiceUtil.updateStatus( + maintenanceSchedule.getMaintenanceScheduleId(), + MaintenanceStatus.FORCE_ENDED.getCode(), "Ended for server reboot."); + } - } catch (Exception e) { - _log.error("Error updating maintenance settings after reboot.", e); - } + } catch (Exception e) { + _log.error("Error updating maintenance settings after reboot.", e); + } - } + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/control/MantenanceControlPanelEntry.java b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/control/MantenanceControlPanelEntry.java index 2ebb0ed0..ec11e98d 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/control/MantenanceControlPanelEntry.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/control/MantenanceControlPanelEntry.java @@ -8,17 +8,17 @@ import com.liferay.portlet.BaseControlPanelEntry; public class MantenanceControlPanelEntry extends BaseControlPanelEntry { - public boolean hasAccessPermission(PermissionChecker permissionChecker, Group group, Portlet portlet) - throws Exception { + public boolean hasAccessPermission(PermissionChecker permissionChecker, Group group, Portlet portlet) + throws Exception { - long companyId = PortalUtil.getDefaultCompanyId(); + long companyId = PortalUtil.getDefaultCompanyId(); - if (companyId == permissionChecker.getCompanyId()) { - return true; - } + if (companyId == permissionChecker.getCompanyId()) { + return true; + } - return false; + return false; - } + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/messaging/MaintenanceScheduleMessageListener.java b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/messaging/MaintenanceScheduleMessageListener.java index e188e589..117bb159 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/messaging/MaintenanceScheduleMessageListener.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/messaging/MaintenanceScheduleMessageListener.java @@ -24,86 +24,89 @@ import java.util.Date; public class MaintenanceScheduleMessageListener implements MessageListener { - private static final Log _log = LogFactoryUtil.getLog(MaintenanceScheduleMessageListener.class); + private static final Log _log = LogFactoryUtil.getLog(MaintenanceScheduleMessageListener.class); - @Override - public void receive(Message message) throws MessageListenerException { + @Override + public void receive(Message message) throws MessageListenerException { - if (_log.isDebugEnabled()) { - _log.debug("Inizio metodo receive. Begin: " + new SimpleDateFormat("hh:mm:ss").format(new Date())); - } + if (_log.isDebugEnabled()) { + _log.debug("Inizio metodo receive. Begin: " + new SimpleDateFormat("hh:mm:ss").format(new Date())); + } - try { + try { + ActionableDynamicQuery actionableDynamicQuery = new MaintenanceScheduleActionableDynamicQuery() { - ActionableDynamicQuery actionableDynamicQuery = new MaintenanceScheduleActionableDynamicQuery() { + @Override + protected void addCriteria(DynamicQuery dynamicQuery) { + dynamicQuery.add(PropertyFactoryUtil.forName("completed").eq(false)); + } - @Override - protected void addCriteria(DynamicQuery dynamicQuery) { - dynamicQuery.add(PropertyFactoryUtil.forName("completed").eq(false)); - } + @Override + protected void performAction(Object obj) throws PortalException, SystemException { - @Override - protected void performAction(Object obj) throws PortalException, SystemException { + MaintenanceSchedule maintenanceSchedule = (MaintenanceSchedule) obj; + try { - MaintenanceSchedule maintenanceSchedule = (MaintenanceSchedule) obj; - try { + MaintenanceStatus status = MaintenanceStatus.parse(maintenanceSchedule.getStatus()); - MaintenanceStatus status = MaintenanceStatus.parse(maintenanceSchedule.getStatus()); + if (status == MaintenanceStatus.NEW) { - if (status == MaintenanceStatus.NEW) { + if (!MaintenanceScheduleLocalServiceUtil.findByStatus( + MaintenanceStatus.IN_PROGRESS.getCode()).isEmpty()) { + throw new SystemException("Concurrent maintenance scheduled."); + } - if (!MaintenanceScheduleLocalServiceUtil.findByStatus(MaintenanceStatus.IN_PROGRESS.getCode()).isEmpty()) { - throw new SystemException("Concurrent maintenance scheduled."); - } + if (Validator.isNotNull(maintenanceSchedule.getAfter()) + && maintenanceSchedule.getAfter() > 0l) { - if (Validator.isNotNull(maintenanceSchedule.getAfter()) && maintenanceSchedule.getAfter() > 0l) { + Date maintenanceStartDate = MaintenanceDateUtil + .getStartDate(maintenanceSchedule); - Date maintenanceStartDate = MaintenanceDateUtil.getStartDate(maintenanceSchedule); + if (DateUtil.newDate().after(maintenanceStartDate)) { + MaintenanceScheduleLocalServiceUtil.updateStatus( + maintenanceSchedule.getMaintenanceScheduleId(), + MaintenanceStatus.IN_PROGRESS.getCode()); + } - if (DateUtil.newDate().after(maintenanceStartDate)) { - MaintenanceScheduleLocalServiceUtil.updateStatus(maintenanceSchedule.getMaintenanceScheduleId(), - MaintenanceStatus.IN_PROGRESS.getCode()); - } + } else { - } else { + MaintenanceScheduleLocalServiceUtil.updateStatus( + maintenanceSchedule.getMaintenanceScheduleId(), + MaintenanceStatus.IN_PROGRESS.getCode()); + } - MaintenanceScheduleLocalServiceUtil.updateStatus(maintenanceSchedule.getMaintenanceScheduleId(), - MaintenanceStatus.IN_PROGRESS.getCode()); - } + } else if (status == MaintenanceStatus.IN_PROGRESS) { - } else if (status == MaintenanceStatus.IN_PROGRESS) { + if (Validator.isNotNull(maintenanceSchedule.getEnd()) + && DateUtil.newDate().after(maintenanceSchedule.getEnd())) { + MaintenanceScheduleLocalServiceUtil.updateStatus( + maintenanceSchedule.getMaintenanceScheduleId(), + MaintenanceStatus.ENDED.getCode()); + } - if (Validator.isNotNull(maintenanceSchedule.getEnd()) - && DateUtil.newDate().after(maintenanceSchedule.getEnd())) { + } - MaintenanceScheduleLocalServiceUtil.updateStatus(maintenanceSchedule.getMaintenanceScheduleId(), - MaintenanceStatus.ENDED.getCode()); - } + } catch (Exception e) { + _log.error("MaintenaceMode error", e); - } + MaintenanceScheduleLocalServiceUtil.updateStatus( + maintenanceSchedule.getMaintenanceScheduleId(), + MaintenanceStatus.ERROR.getCode(), e.getMessage()); + } + } + }; + long count = actionableDynamicQuery.performCount(); - } catch (Exception e) { - _log.error("MaintenaceMode error", e); - - MaintenanceScheduleLocalServiceUtil.updateStatus(maintenanceSchedule.getMaintenanceScheduleId(), - MaintenanceStatus.ERROR.getCode(), e.getMessage()); - } - } - }; - - long count = actionableDynamicQuery.performCount(); - - if (count > 0) { - actionableDynamicQuery.performActions(); - } - - } catch (Exception e) { - _log.error(e, e); - } - } + if (count > 0) { + actionableDynamicQuery.performActions(); + } + } catch (Exception e) { + _log.error(e, e); + } + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/portlet/AdminMaintenancePortlet.java b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/portlet/AdminMaintenancePortlet.java index 18d61763..62b296f8 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/portlet/AdminMaintenancePortlet.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/portlet/AdminMaintenancePortlet.java @@ -31,91 +31,92 @@ import javax.portlet.PortletSession; */ public class AdminMaintenancePortlet extends MVCPortlet { - private final static Log _log = LogFactoryUtil.getLog(AdminMaintenancePortlet.class); + private final static Log _log = LogFactoryUtil.getLog(AdminMaintenancePortlet.class); - public void maintain(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { + public void maintain(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { - PortletSession portletSession = actionRequest.getPortletSession(); + PortletSession portletSession = actionRequest.getPortletSession(); - String message = ParamUtil.getString(actionRequest, "message"); + String message = ParamUtil.getString(actionRequest, "message"); - String className = - LanguageUtil - .get(LocaleUtil.getDefault(), - "the-sign-in-process-is-temporarily-disabled-because-the-portal-is-undergoing-a-routine-maintenance-upgrade"); + 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; - } + 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); + 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()); + _log.info("Maintenance session id: " + portletSession.getId()); + } - } + public void deleteMaintenanceSchedule(ActionRequest actionRequest, ActionResponse actionResponse) + throws Exception { + _log.info("deleteMaintenanceSchedule - Inizio metodo"); - 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"); - ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest); - long maintenanceScheduleId = ParamUtil.getLong(actionRequest, "maintenanceScheduleId"); + MaintenanceScheduleServiceUtil.deleteMaintenanceSchedule(maintenanceScheduleId, serviceContext); - MaintenanceScheduleServiceUtil.deleteMaintenanceSchedule(maintenanceScheduleId, serviceContext); + } - } + public void editMaintenanceSchedule(ActionRequest actionRequest, ActionResponse actionResponse) + throws Exception { + _log.info("editMaintenanceSchedule - Inizio metodo"); - public void editMaintenanceSchedule(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { - _log.info("editMaintenanceSchedule - Inizio metodo"); + String cmd = ParamUtil.getString(actionRequest, Constants.CMD); - String cmd = ParamUtil.getString(actionRequest, Constants.CMD); + ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest); - ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest); + long maintenanceScheduleId = ParamUtil.getLong(actionRequest, "maintenanceScheduleId"); + 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"); - 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")); - 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; - MaintenanceSchedule maintenanceSchedule = null; + try { - 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); + } - 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()); + } - } 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); + } - 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); - } - - } + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/portlet/MaintenancePollerPortlet.java b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/portlet/MaintenancePollerPortlet.java index de74995a..b0d4c3f3 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/portlet/MaintenancePollerPortlet.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/portlet/MaintenancePollerPortlet.java @@ -27,51 +27,50 @@ import javax.portlet.ResourceResponse; */ public class MaintenancePollerPortlet extends MVCPortlet { + private static final long ONE_HOUR = 3600000;// ms - private static final long ONE_HOUR = 3600000;// ms + @Override + public void serveResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse) + throws IOException, PortletException { - @Override - public void serveResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse) throws IOException, - PortletException { + String resourceID = GetterUtil.getString(resourceRequest.getResourceID()); - String resourceID = GetterUtil.getString(resourceRequest.getResourceID()); + if ("maintenancePoller".equals(resourceID)) { - if ("maintenancePoller".equals(resourceID)) { + try { - try { + JSONObject responseData = JSONFactoryUtil.createJSONObject(); + responseData.put("maintenanceExpected", false); - JSONObject responseData = JSONFactoryUtil.createJSONObject(); - responseData.put("maintenanceExpected", false); + List maintenanceSchedules = MaintenanceScheduleLocalServiceUtil + .findByStatus(MaintenanceStatus.NEW.getCode()); + for (MaintenanceSchedule maintenanceSchedule : maintenanceSchedules) { - List maintenanceSchedules = - MaintenanceScheduleLocalServiceUtil.findByStatus(MaintenanceStatus.NEW.getCode()); + Date maintenanceStartDate = DateTimeUtil.scaleToNextMinute(MaintenanceDateUtil + .getStartDate(maintenanceSchedule)); - for (MaintenanceSchedule maintenanceSchedule : maintenanceSchedules) { + long timeDiff = maintenanceStartDate.getTime() - DateUtil.newDate().getTime(); - Date maintenanceStartDate = - DateTimeUtil.scaleToNextMinute(MaintenanceDateUtil.getStartDate(maintenanceSchedule)); + if (timeDiff < ONE_HOUR) { + responseData.put("maintenanceExpected", true); + responseData.put("startFrom", timeDiff); + responseData.put("maintenanceScheduleId", + maintenanceSchedule.getMaintenanceScheduleId()); + break; + } + } - long timeDiff = maintenanceStartDate.getTime() - DateUtil.newDate().getTime(); + PrintWriter out = resourceResponse.getWriter(); + out.println(responseData.toString()); + out.flush(); - if (timeDiff < ONE_HOUR) { - responseData.put("maintenanceExpected", true); - responseData.put("startFrom", timeDiff); - responseData.put("maintenanceScheduleId", maintenanceSchedule.getMaintenanceScheduleId()); - break; - } - } + } catch (SystemException e) { + e.printStackTrace(); + } - PrintWriter out = resourceResponse.getWriter(); - out.println(responseData.toString()); - out.flush(); + } - } catch (SystemException e) { - e.printStackTrace(); - } - - } - - super.serveResource(resourceRequest, resourceResponse); - } + super.serveResource(resourceRequest, resourceResponse); + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/service/impl/MaintenanceScheduleLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/service/impl/MaintenanceScheduleLocalServiceImpl.java index 25b32f70..69777e24 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/service/impl/MaintenanceScheduleLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/service/impl/MaintenanceScheduleLocalServiceImpl.java @@ -41,13 +41,15 @@ import java.util.List; * The implementation of the maintenance schedule local service. * *

- * 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.maintenance.service.MaintenanceScheduleLocalService} 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.maintenance.service.MaintenanceScheduleLocalService} + * interface. * *

- * 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. *

* * @author @@ -55,166 +57,172 @@ import java.util.List; * @see it.tref.liferay.portos.maintenance.service.MaintenanceScheduleLocalServiceUtil */ public class MaintenanceScheduleLocalServiceImpl extends MaintenanceScheduleLocalServiceBaseImpl { - /* - * NOTE FOR DEVELOPERS: - * - * Never reference this interface directly. Always use {@link - * it.tref.liferay.portos.maintenance.service.MaintenanceScheduleLocalServiceUtil} to access the - * maintenance schedule local service. - */ - - @Override - public MaintenanceSchedule addMaintenanceSchedule(String type, String reason, String portalMessage, long after, - Date end, String onreboot, ServiceContext serviceContext) throws SystemException, PortalException { - - MaintenanceSchedule maintenanceSchedule = - MaintenanceScheduleUtil.create(counterLocalService.increment(MaintenanceSchedule.class.getName())); - - validate(type, reason, after, end, onreboot); - - maintenanceSchedule.setCompanyId(serviceContext.getCompanyId()); - maintenanceSchedule.setUserId(serviceContext.getUserId()); - User user = userLocalService.fetchUser(serviceContext.getUserId()); - maintenanceSchedule.setUserName(Validator.isNotNull(user) ? user.getScreenName() : StringPool.BLANK); - maintenanceSchedule.setCreateDate(DateUtil.newDate()); - maintenanceSchedule.setModifiedDate(DateUtil.newDate()); - - maintenanceSchedule.setType(type); - maintenanceSchedule.setReason(reason); - maintenanceSchedule.setPortalMessage(portalMessage != null ? portalMessage : StringPool.BLANK); - maintenanceSchedule.setAfter(after); - maintenanceSchedule.setEnd(end != null ? DateTimeUtil.scaleToNextMinute(end) : null); - maintenanceSchedule.setOnreboot(onreboot); - - maintenanceSchedule.setStatus(MaintenanceStatus.NEW.getCode()); - maintenanceSchedule.setCompleted(Boolean.FALSE); - - return addMaintenanceSchedule(maintenanceSchedule); - } - - @Override - public MaintenanceSchedule updateMaintenanceSchedule(long maintenanceScheduleId, String type, String reason, - String portalMessage, long after, Date end, String onreboot, String status, String statusMessage, - ServiceContext serviceContext) throws SystemException, PortalException { - - MaintenanceSchedule maintenanceSchedule = getMaintenanceSchedule(maintenanceScheduleId); - - validate(type, reason, after, end, onreboot); - - if (Validator.isNotNull(status)) { - maintenanceSchedule = updateStatus(maintenanceSchedule.getMaintenanceScheduleId(), status, statusMessage); - } - - maintenanceSchedule.setModifiedDate(DateUtil.newDate()); - - maintenanceSchedule.setType(type); - maintenanceSchedule.setReason(reason); - maintenanceSchedule.setPortalMessage(portalMessage != null ? portalMessage : StringPool.BLANK); - maintenanceSchedule.setAfter(after); - maintenanceSchedule.setEnd(end != null ? DateTimeUtil.scaleToNextMinute(end) : null); - maintenanceSchedule.setOnreboot(onreboot); - - return updateMaintenanceSchedule(maintenanceSchedule); - } - - - @Override - public MaintenanceSchedule updateStatus(long maintenanceScheduleId, String status) throws PortalException, - SystemException { - - return updateStatus(maintenanceScheduleId, status, null); - } - - @Override - public MaintenanceSchedule updateStatus(long maintenanceScheduleId, String status, String statusMessage) - throws PortalException, SystemException { - - MaintenanceStatus maintenanceStatus = null; - try { - maintenanceStatus = MaintenanceStatus.parse(status); - } catch (IllegalArgumentException e) { - throw new MaintenanceStatusException(status); - } - - MaintenanceSchedule maintenanceSchedule = getMaintenanceSchedule(maintenanceScheduleId); - maintenanceSchedule.setStatus(maintenanceStatus.getCode()); - maintenanceSchedule.setStatusMessage(statusMessage); - - if (maintenanceStatus == MaintenanceStatus.ENDED || maintenanceStatus == MaintenanceStatus.FORCE_ENDED - || maintenanceStatus == MaintenanceStatus.ERROR) { - maintenanceSchedule.setCompleted(Boolean.TRUE); - } else { - maintenanceSchedule.setCompleted(Boolean.FALSE); - } - - return updateMaintenanceSchedule(maintenanceSchedule); - } - - @Override - public List findByStatus(String status) throws SystemException { - return maintenanceSchedulePersistence.findByStatus(status); - } - - private void validate(String type, String reason, long after, Date end, String onreboot) throws PortalException { - - if (Validator.isNull(type)) { - throw new RequiredMaintenanceTypeException(); - } - - try { - MaintenanceType.parse(type); - } catch (IllegalArgumentException e) { - throw new MaintenanceTypeException(type); - } - - if (Validator.isNull(onreboot)) { - throw new RequiredMaintenanceOnRebootException(); - } - - try { - MaintenanceOnReboot.parse(onreboot); - } catch (IllegalArgumentException e) { - throw new MaintenanceOnRebootException(onreboot); - } - - if (Validator.isNull(reason)) { - throw new RequiredMaintenanceReasonException(); - } - - } - - @Override - public List findByC_Completed(long companyId, boolean completed) throws SystemException { - return maintenanceSchedulePersistence.findByC_Completed(companyId, completed); - } - - @Override - public List findByCompleted_Onreboot(boolean completed, String onreboot) throws SystemException { - return maintenanceSchedulePersistence.findByCompleted_Onreboot(completed, onreboot); - } - - @Override - public List findByCompany(long companyId) throws SystemException { - return maintenanceSchedulePersistence.findByCompany(companyId); - } - - @Override - public List findByCompany(long companyId, int start, int end) throws SystemException { - return maintenanceSchedulePersistence.findByCompany(companyId, start, end); - } - - @Override - public int countByCompany(long companyId) throws SystemException { - return maintenanceSchedulePersistence.countByCompany(companyId); - } - - @Override - public List findAll() throws SystemException { - return maintenanceSchedulePersistence.findAll(); - } - - @Override - public int countAll() throws SystemException { - return maintenanceSchedulePersistence.countAll(); - } + /* + * NOTE FOR DEVELOPERS: + * + * Never reference this interface directly. Always use {@link + * it.tref.liferay + * .portos.maintenance.service.MaintenanceScheduleLocalServiceUtil} to + * access the maintenance schedule local service. + */ + + @Override + public MaintenanceSchedule addMaintenanceSchedule(String type, String reason, String portalMessage, + long after, Date end, String onreboot, ServiceContext serviceContext) throws SystemException, + PortalException { + + MaintenanceSchedule maintenanceSchedule = MaintenanceScheduleUtil.create(counterLocalService + .increment(MaintenanceSchedule.class.getName())); + + validate(type, reason, after, end, onreboot); + + maintenanceSchedule.setCompanyId(serviceContext.getCompanyId()); + maintenanceSchedule.setUserId(serviceContext.getUserId()); + User user = userLocalService.fetchUser(serviceContext.getUserId()); + maintenanceSchedule.setUserName(Validator.isNotNull(user) ? user.getScreenName() : StringPool.BLANK); + maintenanceSchedule.setCreateDate(DateUtil.newDate()); + maintenanceSchedule.setModifiedDate(DateUtil.newDate()); + + maintenanceSchedule.setType(type); + maintenanceSchedule.setReason(reason); + maintenanceSchedule.setPortalMessage(portalMessage != null ? portalMessage : StringPool.BLANK); + maintenanceSchedule.setAfter(after); + maintenanceSchedule.setEnd(end != null ? DateTimeUtil.scaleToNextMinute(end) : null); + maintenanceSchedule.setOnreboot(onreboot); + + maintenanceSchedule.setStatus(MaintenanceStatus.NEW.getCode()); + maintenanceSchedule.setCompleted(Boolean.FALSE); + + return addMaintenanceSchedule(maintenanceSchedule); + } + + @Override + public MaintenanceSchedule updateMaintenanceSchedule(long maintenanceScheduleId, String type, + String reason, String portalMessage, long after, Date end, String onreboot, String status, + String statusMessage, ServiceContext serviceContext) throws SystemException, PortalException { + + MaintenanceSchedule maintenanceSchedule = getMaintenanceSchedule(maintenanceScheduleId); + + validate(type, reason, after, end, onreboot); + + if (Validator.isNotNull(status)) { + maintenanceSchedule = updateStatus(maintenanceSchedule.getMaintenanceScheduleId(), status, + statusMessage); + } + + maintenanceSchedule.setModifiedDate(DateUtil.newDate()); + + maintenanceSchedule.setType(type); + maintenanceSchedule.setReason(reason); + maintenanceSchedule.setPortalMessage(portalMessage != null ? portalMessage : StringPool.BLANK); + maintenanceSchedule.setAfter(after); + maintenanceSchedule.setEnd(end != null ? DateTimeUtil.scaleToNextMinute(end) : null); + maintenanceSchedule.setOnreboot(onreboot); + + return updateMaintenanceSchedule(maintenanceSchedule); + } + + @Override + public MaintenanceSchedule updateStatus(long maintenanceScheduleId, String status) + throws PortalException, SystemException { + + return updateStatus(maintenanceScheduleId, status, null); + } + + @Override + public MaintenanceSchedule updateStatus(long maintenanceScheduleId, String status, String statusMessage) + throws PortalException, SystemException { + + MaintenanceStatus maintenanceStatus = null; + try { + maintenanceStatus = MaintenanceStatus.parse(status); + } catch (IllegalArgumentException e) { + throw new MaintenanceStatusException(status); + } + + MaintenanceSchedule maintenanceSchedule = getMaintenanceSchedule(maintenanceScheduleId); + maintenanceSchedule.setStatus(maintenanceStatus.getCode()); + maintenanceSchedule.setStatusMessage(statusMessage); + + if (maintenanceStatus == MaintenanceStatus.ENDED + || maintenanceStatus == MaintenanceStatus.FORCE_ENDED + || maintenanceStatus == MaintenanceStatus.ERROR) { + maintenanceSchedule.setCompleted(Boolean.TRUE); + } else { + maintenanceSchedule.setCompleted(Boolean.FALSE); + } + + return updateMaintenanceSchedule(maintenanceSchedule); + } + + @Override + public List findByStatus(String status) throws SystemException { + return maintenanceSchedulePersistence.findByStatus(status); + } + + private void validate(String type, String reason, long after, Date end, String onreboot) + throws PortalException { + + if (Validator.isNull(type)) { + throw new RequiredMaintenanceTypeException(); + } + + try { + MaintenanceType.parse(type); + } catch (IllegalArgumentException e) { + throw new MaintenanceTypeException(type); + } + + if (Validator.isNull(onreboot)) { + throw new RequiredMaintenanceOnRebootException(); + } + + try { + MaintenanceOnReboot.parse(onreboot); + } catch (IllegalArgumentException e) { + throw new MaintenanceOnRebootException(onreboot); + } + + if (Validator.isNull(reason)) { + throw new RequiredMaintenanceReasonException(); + } + + } + + @Override + public List findByC_Completed(long companyId, boolean completed) + throws SystemException { + return maintenanceSchedulePersistence.findByC_Completed(companyId, completed); + } + + @Override + public List findByCompleted_Onreboot(boolean completed, String onreboot) + throws SystemException { + return maintenanceSchedulePersistence.findByCompleted_Onreboot(completed, onreboot); + } + + @Override + public List findByCompany(long companyId) throws SystemException { + return maintenanceSchedulePersistence.findByCompany(companyId); + } + + @Override + public List findByCompany(long companyId, int start, int end) throws SystemException { + return maintenanceSchedulePersistence.findByCompany(companyId, start, end); + } + + @Override + public int countByCompany(long companyId) throws SystemException { + return maintenanceSchedulePersistence.countByCompany(companyId); + } + + @Override + public List findAll() throws SystemException { + return maintenanceSchedulePersistence.findAll(); + } + + @Override + public int countAll() throws SystemException { + return maintenanceSchedulePersistence.countAll(); + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/service/impl/MaintenanceScheduleServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/service/impl/MaintenanceScheduleServiceImpl.java index 15482be3..bfebc7c7 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/service/impl/MaintenanceScheduleServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/service/impl/MaintenanceScheduleServiceImpl.java @@ -25,13 +25,15 @@ import java.util.Date; * The implementation of the maintenance schedule remote service. * *

- * 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.maintenance.service.MaintenanceScheduleService} 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.maintenance.service.MaintenanceScheduleService} + * interface. * *

- * 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. *

* * @author @@ -39,45 +41,46 @@ import java.util.Date; * @see it.tref.liferay.portos.maintenance.service.MaintenanceScheduleServiceUtil */ public class MaintenanceScheduleServiceImpl extends MaintenanceScheduleServiceBaseImpl { - /* - * NOTE FOR DEVELOPERS: - * - * Never reference this interface directly. Always use {@link - * it.tref.liferay.portos.maintenance.service.MaintenanceScheduleServiceUtil} to access the - * maintenance schedule remote service. - */ + /* + * NOTE FOR DEVELOPERS: + * + * Never reference this interface directly. Always use {@link + * it.tref.liferay + * .portos.maintenance.service.MaintenanceScheduleServiceUtil} to access the + * maintenance schedule remote service. + */ - public MaintenanceSchedule addMaintenanceSchedule(String type, String reason, String portalMessage, long after, - Date end, String onreboot, ServiceContext serviceContext) throws Exception { + public MaintenanceSchedule addMaintenanceSchedule(String type, String reason, String portalMessage, + long after, Date end, String onreboot, ServiceContext serviceContext) throws Exception { - if (!PortalUtil.isCompanyAdmin(getUser())) { - throw new PortalException("Access denied!"); - } + if (!PortalUtil.isCompanyAdmin(getUser())) { + throw new PortalException("Access denied!"); + } - return maintenanceScheduleLocalService.addMaintenanceSchedule(type, reason, portalMessage, after, end, onreboot, - serviceContext); - } + return maintenanceScheduleLocalService.addMaintenanceSchedule(type, reason, portalMessage, after, + end, onreboot, serviceContext); + } - public MaintenanceSchedule updateMaintenanceSchedule(long maintenanceScheduleId, String type, String reason, - String portalMessage, long after, Date end, String onreboot, String status, String statusMessage, - ServiceContext serviceContext) throws Exception { + public MaintenanceSchedule updateMaintenanceSchedule(long maintenanceScheduleId, String type, + String reason, String portalMessage, long after, Date end, String onreboot, String status, + String statusMessage, ServiceContext serviceContext) throws Exception { - if (!PortalUtil.isCompanyAdmin(getUser())) { - throw new PortalException("Access denied!"); - } + if (!PortalUtil.isCompanyAdmin(getUser())) { + throw new PortalException("Access denied!"); + } - return maintenanceScheduleLocalService.updateMaintenanceSchedule(maintenanceScheduleId, type, reason, - portalMessage, after, end, onreboot, status, statusMessage, serviceContext); - } + return maintenanceScheduleLocalService.updateMaintenanceSchedule(maintenanceScheduleId, type, reason, + portalMessage, after, end, onreboot, status, statusMessage, serviceContext); + } - public MaintenanceSchedule deleteMaintenanceSchedule(long maintenanceScheduleId, ServiceContext serviceContext) - throws Exception { + public MaintenanceSchedule deleteMaintenanceSchedule(long maintenanceScheduleId, + ServiceContext serviceContext) throws Exception { - if (!PortalUtil.isCompanyAdmin(getUser())) { - throw new PortalException("Access denied!"); - } + if (!PortalUtil.isCompanyAdmin(getUser())) { + throw new PortalException("Access denied!"); + } - return maintenanceScheduleLocalService.deleteMaintenanceSchedule(maintenanceScheduleId); - } + return maintenanceScheduleLocalService.deleteMaintenanceSchedule(maintenanceScheduleId); + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/servlet/MaintenanceServlet.java b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/servlet/MaintenanceServlet.java index 4cf8de49..e8b061d2 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/servlet/MaintenanceServlet.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/servlet/MaintenanceServlet.java @@ -38,210 +38,204 @@ import org.apache.commons.net.util.SubnetUtils.SubnetInfo; public class MaintenanceServlet extends HttpServlet { - private static final long serialVersionUID = 4568712977896061068L; + private static final long serialVersionUID = 4568712977896061068L; + + private static final String CONTENT_TYPE_APPLICATION_JSON = "application/json"; + + private static final String START_PATH = "/start"; + private static final String STOP_PATH = "/stop"; - private static final String CONTENT_TYPE_APPLICATION_JSON = "application/json"; + private static final String FORCE_PARAM = "force"; + private static final String FORCED_MESSAGE = "Forced maintenance mode..."; - private static final String START_PATH = "/start"; - private static final String STOP_PATH = "/stop"; + private static final String END_PARAM = "end"; + private static final String TYPE_PARAM = "type"; + private static final String AFTER_PARAM = "after"; + private static final String REASON_PARAM = "reason"; + private static final String MESSAGE_PARAM = "message"; + private static final String ONREBOOT_PARAM = "onreboot"; + + private static final String STOP_AFTER_PARAM = "stopAfter"; - private static final String FORCE_PARAM = "force"; - private static final String FORCED_MESSAGE = "Forced maintenance mode..."; + private static final Object ALLOW_ALL_IP_ADDRESS = "ALL"; + private static final String[] allowedIpAddresses = PropsUtil.getArray("maintenance-allowed-ip-addresses"); + + private static final SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy hh:mm:ss"); + + private static final Log _log = LogFactoryUtil.getLog(MaintenanceServlet.class); - private static final String END_PARAM = "end"; - private static final String TYPE_PARAM = "type"; - private static final String AFTER_PARAM = "after"; - private static final String REASON_PARAM = "reason"; - private static final String MESSAGE_PARAM = "message"; - private static final String ONREBOOT_PARAM = "onreboot"; + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, + IOException { - private static final String STOP_AFTER_PARAM = "stopAfter"; + JSONObject jsonResponse = JSONFactoryUtil.createJSONObject(); - private static final Object ALLOW_ALL_IP_ADDRESS = "ALL"; - private static final String[] allowedIpAddresses = PropsUtil.getArray("maintenance-allowed-ip-addresses"); + response.setContentType(CONTENT_TYPE_APPLICATION_JSON); - private static final SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy hh:mm:ss"); + try { - private static final Log _log = LogFactoryUtil.getLog(MaintenanceServlet.class); + ServiceContext serviceContext = ServiceContextFactory.getInstance(request); + String pathInfo = request.getPathInfo(); + Map params = request.getParameterMap(); - @Override - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + checkIpAddress(request); - JSONObject jsonResponse = JSONFactoryUtil.createJSONObject(); + if (START_PATH.equals(pathInfo)) { + MaintenanceSchedule maintenanceSchedule = startMaintenance(params, serviceContext); + if (Validator.isNotNull(maintenanceSchedule)) { + jsonResponse.put("id", maintenanceSchedule.getMaintenanceScheduleId()); + jsonResponse.put("reason", maintenanceSchedule.getReason()); + jsonResponse.put("startDate", MaintenanceDateUtil.getStartDate(maintenanceSchedule)); + } + } else if (STOP_PATH.equals(pathInfo)) { + MaintenanceSchedule maintenanceSchedule = stopMaintenance(params); + if (Validator.isNotNull(maintenanceSchedule)) { + jsonResponse.put("id", maintenanceSchedule.getMaintenanceScheduleId()); + jsonResponse.put("endDate", sdf.format(maintenanceSchedule.getEnd())); + } + } else { + throw new UnsupportedOperationException(); + } + + jsonResponse.put("success", "true"); + response.setStatus(HttpServletResponse.SC_OK); + ServletResponseUtil.write(response, jsonResponse.toString()); - response.setContentType(CONTENT_TYPE_APPLICATION_JSON); + } catch (IllegalAccessException e) { + sendErrorResponse(response, HttpServletResponse.SC_FORBIDDEN, e.getMessage()); + } catch (UnsupportedOperationException e) { + sendErrorResponse(response, HttpServletResponse.SC_NOT_FOUND, e.getMessage()); + ServletResponseUtil.write(response, jsonResponse.toString()); + } catch (ParseException | IllegalArgumentException e) { + sendErrorResponse(response, HttpServletResponse.SC_BAD_REQUEST, e.getMessage()); + } catch (Exception e) { + _log.error(e); + sendErrorResponse(response, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.getMessage()); + } - try { - - ServiceContext serviceContext = ServiceContextFactory.getInstance(request); - String pathInfo = request.getPathInfo(); - Map params = request.getParameterMap(); - - checkIpAddress(request); - - if (START_PATH.equals(pathInfo)) { - MaintenanceSchedule maintenanceSchedule = startMaintenance(params, serviceContext); - if (Validator.isNotNull(maintenanceSchedule)) { - jsonResponse.put("id", maintenanceSchedule.getMaintenanceScheduleId()); - jsonResponse.put("reason", maintenanceSchedule.getReason()); - jsonResponse.put("startDate", MaintenanceDateUtil.getStartDate(maintenanceSchedule)); - } - } else if (STOP_PATH.equals(pathInfo)) { - MaintenanceSchedule maintenanceSchedule = stopMaintenance(params); - if (Validator.isNotNull(maintenanceSchedule)) { - jsonResponse.put("id", maintenanceSchedule.getMaintenanceScheduleId()); - jsonResponse.put("endDate", sdf.format(maintenanceSchedule.getEnd())); - } - } else { - throw new UnsupportedOperationException(); - } - - jsonResponse.put("success", "true"); - response.setStatus(HttpServletResponse.SC_OK); - ServletResponseUtil.write(response, jsonResponse.toString()); - - } catch (IllegalAccessException e) { - sendErrorResponse(response, HttpServletResponse.SC_FORBIDDEN, e.getMessage()); - } catch (UnsupportedOperationException e) { - sendErrorResponse(response, HttpServletResponse.SC_NOT_FOUND, e.getMessage()); - ServletResponseUtil.write(response, jsonResponse.toString()); - } catch (ParseException | IllegalArgumentException e) { - sendErrorResponse(response, HttpServletResponse.SC_BAD_REQUEST, e.getMessage()); - } catch (Exception e) { - _log.error(e); - sendErrorResponse(response, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.getMessage()); - } - - } - - - - private MaintenanceSchedule stopMaintenance(Map params) throws IllegalAccessException, - IllegalArgumentException, InvocationTargetException, Exception { - - MaintenanceSchedule result = null; - - - boolean force = - params.get(FORCE_PARAM) != null && params.get(FORCE_PARAM).length > 0 ? Boolean - .valueOf(params.get(FORCE_PARAM)[0]) : false; - - if (force) { - PortalMaintenanceUtil.stopMaintenaceMode(); - List maintenanceSchedules = - MaintenanceScheduleLocalServiceUtil.findByStatus(MaintenanceStatus.IN_PROGRESS.getCode()); - for (MaintenanceSchedule maintenanceSchedule : maintenanceSchedules) { - MaintenanceScheduleLocalServiceUtil.updateStatus(maintenanceSchedule.getMaintenanceScheduleId(), - MaintenanceStatus.FORCE_ENDED.getCode(), "Stop forced at " + sdf.format(DateUtil.newDate())); - } - return null; - } - - int stopAfter = - params.get(STOP_AFTER_PARAM) != null && params.get(STOP_AFTER_PARAM).length > 0 ? Integer.valueOf(params - .get(STOP_AFTER_PARAM)[0]) : 0; - - List maintenanceSchedules = - MaintenanceScheduleLocalServiceUtil.findByStatus(MaintenanceStatus.IN_PROGRESS.getCode()); - - if (!maintenanceSchedules.isEmpty()) { - - if (maintenanceSchedules.size() > 1) { - _log.warn("Multiple maintenance in progress..."); - } - - Date end = DateUtil.newDate(); - - if (stopAfter > 0) { - Calendar calendar = Calendar.getInstance(); - calendar.add(Calendar.MINUTE, stopAfter); - end = calendar.getTime(); - } - - for (MaintenanceSchedule maintenanceSchedule : maintenanceSchedules) { - maintenanceSchedule.setEnd(DateTimeUtil.scaleToNextMinute(end)); - result = MaintenanceScheduleLocalServiceUtil.updateMaintenanceSchedule(maintenanceSchedule); - } - - } - - return result; - - } - - private MaintenanceSchedule startMaintenance(Map params, ServiceContext serviceContext) - throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, Exception { - - boolean force = - params.get(FORCE_PARAM) != null && params.get(FORCE_PARAM).length > 0 ? Boolean - .valueOf(params.get(FORCE_PARAM)[0]) : false; - - if (force) { - PortalMaintenanceUtil.startMaintenaceMode(UUID.randomUUID().toString(), FORCED_MESSAGE); - return null; - } - - Date end = null; - String[] endParam = params.get(END_PARAM); - if (endParam != null && endParam.length > 0) { - end = sdf.parse(endParam[0]); - } - - String type = - params.get(TYPE_PARAM) != null && params.get(TYPE_PARAM).length > 0 ? params.get(TYPE_PARAM)[0] : null; - String reason = - params.get(REASON_PARAM) != null && params.get(REASON_PARAM).length > 0 ? params.get(REASON_PARAM)[0] : null; - long after = - params.get(AFTER_PARAM) != null && params.get(AFTER_PARAM).length > 0 ? Long - .valueOf(params.get(AFTER_PARAM)[0]) : 0l; - String onreboot = - params.get(ONREBOOT_PARAM) != null && params.get(ONREBOOT_PARAM).length > 0 ? params.get(ONREBOOT_PARAM)[0] - : null; - String message = - params.get(MESSAGE_PARAM) != null && params.get(MESSAGE_PARAM).length > 0 ? params.get(MESSAGE_PARAM)[0] : null; - - return MaintenanceScheduleLocalServiceUtil.addMaintenanceSchedule(type, reason, message, after, end, onreboot, - serviceContext); - - } - - private void checkIpAddress(HttpServletRequest request) throws IllegalAccessException { - - String clientIpAddress = request.getHeader("X-FORWARDED-FOR"); - if (Validator.isNull(clientIpAddress)) { - clientIpAddress = request.getRemoteAddr(); - } - - boolean found = false; - for (String ipAddress : allowedIpAddresses) { - - if (ipAddress.contains("/")) { - SubnetUtils subnetUtils = new SubnetUtils(ipAddress); - SubnetInfo subnetInfo = subnetUtils.getInfo(); - if (subnetInfo.isInRange(clientIpAddress)) { - found = true; - break; - } - } else if (ipAddress.equals(clientIpAddress) || ipAddress.equals(ALLOW_ALL_IP_ADDRESS)) { - found = true; - break; - } - } - - if (!found) { - throw new IllegalAccessException("Your IP address '" + clientIpAddress + "' is not authorized"); - } - - } - - - private void sendErrorResponse(HttpServletResponse response, int scInternalServerError, String message) - throws IOException { - JSONObject jsonResponse = JSONFactoryUtil.createJSONObject(); - response.setStatus(scInternalServerError); - jsonResponse.put("success", false); - jsonResponse.put("message", message); - ServletResponseUtil.write(response, jsonResponse.toString()); - } + } + + private MaintenanceSchedule stopMaintenance(Map params) throws IllegalAccessException, + IllegalArgumentException, InvocationTargetException, Exception { + + MaintenanceSchedule result = null; + + boolean force = params.get(FORCE_PARAM) != null && params.get(FORCE_PARAM).length > 0 ? Boolean + .valueOf(params.get(FORCE_PARAM)[0]) : false; + + if (force) { + PortalMaintenanceUtil.stopMaintenaceMode(); + List maintenanceSchedules = MaintenanceScheduleLocalServiceUtil + .findByStatus(MaintenanceStatus.IN_PROGRESS.getCode()); + for (MaintenanceSchedule maintenanceSchedule : maintenanceSchedules) { + MaintenanceScheduleLocalServiceUtil.updateStatus( + maintenanceSchedule.getMaintenanceScheduleId(), + MaintenanceStatus.FORCE_ENDED.getCode(), + "Stop forced at " + sdf.format(DateUtil.newDate())); + } + return null; + } + + int stopAfter = params.get(STOP_AFTER_PARAM) != null && params.get(STOP_AFTER_PARAM).length > 0 ? Integer + .valueOf(params.get(STOP_AFTER_PARAM)[0]) : 0; + + List maintenanceSchedules = MaintenanceScheduleLocalServiceUtil + .findByStatus(MaintenanceStatus.IN_PROGRESS.getCode()); + + if (!maintenanceSchedules.isEmpty()) { + + if (maintenanceSchedules.size() > 1) { + _log.warn("Multiple maintenance in progress..."); + } + + Date end = DateUtil.newDate(); + + if (stopAfter > 0) { + Calendar calendar = Calendar.getInstance(); + calendar.add(Calendar.MINUTE, stopAfter); + end = calendar.getTime(); + } + + for (MaintenanceSchedule maintenanceSchedule : maintenanceSchedules) { + maintenanceSchedule.setEnd(DateTimeUtil.scaleToNextMinute(end)); + result = MaintenanceScheduleLocalServiceUtil.updateMaintenanceSchedule(maintenanceSchedule); + } + + } + + return result; + + } + + private MaintenanceSchedule startMaintenance(Map params, ServiceContext serviceContext) + throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, Exception { + + boolean force = params.get(FORCE_PARAM) != null && params.get(FORCE_PARAM).length > 0 ? Boolean + .valueOf(params.get(FORCE_PARAM)[0]) : false; + + if (force) { + PortalMaintenanceUtil.startMaintenaceMode(UUID.randomUUID().toString(), FORCED_MESSAGE); + return null; + } + + Date end = null; + String[] endParam = params.get(END_PARAM); + if (endParam != null && endParam.length > 0) { + end = sdf.parse(endParam[0]); + } + + String type = params.get(TYPE_PARAM) != null && params.get(TYPE_PARAM).length > 0 ? params + .get(TYPE_PARAM)[0] : null; + String reason = params.get(REASON_PARAM) != null && params.get(REASON_PARAM).length > 0 ? params + .get(REASON_PARAM)[0] : null; + long after = params.get(AFTER_PARAM) != null && params.get(AFTER_PARAM).length > 0 ? Long + .valueOf(params.get(AFTER_PARAM)[0]) : 0l; + String onreboot = params.get(ONREBOOT_PARAM) != null && params.get(ONREBOOT_PARAM).length > 0 ? params + .get(ONREBOOT_PARAM)[0] : null; + String message = params.get(MESSAGE_PARAM) != null && params.get(MESSAGE_PARAM).length > 0 ? params + .get(MESSAGE_PARAM)[0] : null; + + return MaintenanceScheduleLocalServiceUtil.addMaintenanceSchedule(type, reason, message, after, end, + onreboot, serviceContext); + + } + + private void checkIpAddress(HttpServletRequest request) throws IllegalAccessException { + + String clientIpAddress = request.getHeader("X-FORWARDED-FOR"); + if (Validator.isNull(clientIpAddress)) { + clientIpAddress = request.getRemoteAddr(); + } + + boolean found = false; + for (String ipAddress : allowedIpAddresses) { + + if (ipAddress.contains("/")) { + SubnetUtils subnetUtils = new SubnetUtils(ipAddress); + SubnetInfo subnetInfo = subnetUtils.getInfo(); + if (subnetInfo.isInRange(clientIpAddress)) { + found = true; + break; + } + } else if (ipAddress.equals(clientIpAddress) || ipAddress.equals(ALLOW_ALL_IP_ADDRESS)) { + found = true; + break; + } + } + + if (!found) { + throw new IllegalAccessException("Your IP address '" + clientIpAddress + "' is not authorized"); + } + + } + + private void sendErrorResponse(HttpServletResponse response, int scInternalServerError, String message) + throws IOException { + JSONObject jsonResponse = JSONFactoryUtil.createJSONObject(); + response.setStatus(scInternalServerError); + jsonResponse.put("success", false); + jsonResponse.put("message", message); + ServletResponseUtil.write(response, jsonResponse.toString()); + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/util/DateTimeUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/util/DateTimeUtil.java index 9424eda6..3fd21345 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/util/DateTimeUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/util/DateTimeUtil.java @@ -5,37 +5,37 @@ import java.util.Date; public class DateTimeUtil { - /** - * This method remove seconds and milliseconds to the input date. - * - * @param input - * @return the input with seconds and milliseconds equal to 0 - */ - public static Date removeSeconds(Date input) { - Calendar calendar = Calendar.getInstance(); - calendar.setTime(input); - calendar.set(Calendar.SECOND, 0); - calendar.set(Calendar.MILLISECOND, 0); - return calendar.getTime(); - } + /** + * This method remove seconds and milliseconds to the input date. + * + * @param input + * @return the input with seconds and milliseconds equal to 0 + */ + public static Date removeSeconds(Date input) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(input); + calendar.set(Calendar.SECOND, 0); + calendar.set(Calendar.MILLISECOND, 0); + return calendar.getTime(); + } - /** - * This method add a minute , remove seconds and milliseconds to the input date. If seconds and - * milliseconds are equal to 0, return the input. - * - * @param input - * @return the date scaled or the input if doesn't require scaling. - */ - public static Date scaleToNextMinute(Date input) { - Calendar calendar = Calendar.getInstance(); - calendar.setTime(input); - if (calendar.get(Calendar.SECOND) != 0 || calendar.get(Calendar.MILLISECOND) != 0) { - calendar.add(Calendar.MINUTE, 1); - calendar.set(Calendar.SECOND, 0); - calendar.set(Calendar.MILLISECOND, 0); - return calendar.getTime(); - } - return input; - } + /** + * This method add a minute , remove seconds and milliseconds to the input + * date. If seconds and milliseconds are equal to 0, return the input. + * + * @param input + * @return the date scaled or the input if doesn't require scaling. + */ + public static Date scaleToNextMinute(Date input) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(input); + if (calendar.get(Calendar.SECOND) != 0 || calendar.get(Calendar.MILLISECOND) != 0) { + calendar.add(Calendar.MINUTE, 1); + calendar.set(Calendar.SECOND, 0); + calendar.set(Calendar.MILLISECOND, 0); + return calendar.getTime(); + } + return input; + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/util/MaintenanceConstants.java b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/util/MaintenanceConstants.java index 014d9ace..993e0601 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/util/MaintenanceConstants.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/util/MaintenanceConstants.java @@ -1,130 +1,129 @@ package it.tref.liferay.portos.maintenance.util; - public class MaintenanceConstants { - public enum MaintenanceType { + public enum MaintenanceType { - FULL("full", "Full mode"), USER("user", "Only user mode"); + FULL("full", "Full mode"), USER("user", "Only user mode"); - MaintenanceType(String code, String description) { - this.setCode(code); - this.setDescription(description); - } + MaintenanceType(String code, String description) { + this.setCode(code); + this.setDescription(description); + } - public String getDescription() { - return description; - } + public String getDescription() { + return description; + } - public void setDescription(String description) { - this.description = description; - } + public void setDescription(String description) { + this.description = description; + } - public String getCode() { - return code; - } + public String getCode() { + return code; + } - public void setCode(String code) { - this.code = code; - } + public void setCode(String code) { + this.code = code; + } - private String code; - private String description; + private String code; + private String description; - public static MaintenanceType parse(String code) { + public static MaintenanceType parse(String code) { - for (MaintenanceType maintenanceType : values()) { - if (maintenanceType.code.equals(code)) { - return maintenanceType; - } - } + for (MaintenanceType maintenanceType : values()) { + if (maintenanceType.code.equals(code)) { + return maintenanceType; + } + } - throw new IllegalArgumentException("Invalid MaintenanceType code: " + code); - } + throw new IllegalArgumentException("Invalid MaintenanceType code: " + code); + } - } + } - public enum MaintenanceOnReboot { + public enum MaintenanceOnReboot { - CONTINUE("continue", "Continue"), TERMINATE("terminate", "Terminate"); + CONTINUE("continue", "Continue"), TERMINATE("terminate", "Terminate"); - MaintenanceOnReboot(String code, String description) { - this.setCode(code); - this.setDescription(description); - } + MaintenanceOnReboot(String code, String description) { + this.setCode(code); + this.setDescription(description); + } - public String getDescription() { - return description; - } + public String getDescription() { + return description; + } - public void setDescription(String description) { - this.description = description; - } + public void setDescription(String description) { + this.description = description; + } - public String getCode() { - return code; - } + public String getCode() { + return code; + } - public void setCode(String code) { - this.code = code; - } + public void setCode(String code) { + this.code = code; + } - private String code; - private String description; + private String code; + private String description; - public static MaintenanceOnReboot parse(String code) { + public static MaintenanceOnReboot parse(String code) { - for (MaintenanceOnReboot maintenanceOnReboot : values()) { - if (maintenanceOnReboot.code.equals(code)) { - return maintenanceOnReboot; - } - } + for (MaintenanceOnReboot maintenanceOnReboot : values()) { + if (maintenanceOnReboot.code.equals(code)) { + return maintenanceOnReboot; + } + } - throw new IllegalArgumentException("Invalid MaintenanceOnReboot code: " + code); - } + throw new IllegalArgumentException("Invalid MaintenanceOnReboot code: " + code); + } - } + } - public enum MaintenanceStatus { + public enum MaintenanceStatus { - NEW("N", "New"), IN_PROGRESS("P", "In Progress"), ENDED("E", "Ended"), FORCE_ENDED("FE", "Force Ended"), ERROR( - "ER", "Error"); + NEW("N", "New"), IN_PROGRESS("P", "In Progress"), ENDED("E", "Ended"), FORCE_ENDED("FE", + "Force Ended"), ERROR("ER", "Error"); - MaintenanceStatus(String code, String description) { - this.setCode(code); - this.setDescription(description); - } + MaintenanceStatus(String code, String description) { + this.setCode(code); + this.setDescription(description); + } - public String getDescription() { - return description; - } + public String getDescription() { + return description; + } - public void setDescription(String description) { - this.description = description; - } + public void setDescription(String description) { + this.description = description; + } - public String getCode() { - return code; - } + public String getCode() { + return code; + } - public void setCode(String code) { - this.code = code; - } + public void setCode(String code) { + this.code = code; + } - private String code; - private String description; + private String code; + private String description; - public static MaintenanceStatus parse(String code) { + public static MaintenanceStatus parse(String code) { - for (MaintenanceStatus maintenanceStatus : values()) { - if (maintenanceStatus.code.equals(code)) { - return maintenanceStatus; - } - } + for (MaintenanceStatus maintenanceStatus : values()) { + if (maintenanceStatus.code.equals(code)) { + return maintenanceStatus; + } + } - throw new IllegalArgumentException("Invalid MaintenanceStatus code: " + code); - } + throw new IllegalArgumentException("Invalid MaintenanceStatus code: " + code); + } - } + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/util/MaintenanceDateUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/util/MaintenanceDateUtil.java index d36bc30b..7b4fa06a 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/util/MaintenanceDateUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/util/MaintenanceDateUtil.java @@ -7,20 +7,20 @@ import java.util.Date; public class MaintenanceDateUtil { - public static Date getStartDate(Date createDate, int after) { + public static Date getStartDate(Date createDate, int after) { - Calendar calendar = Calendar.getInstance(); - calendar.setTime(createDate); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(createDate); - if (after > 0) { - calendar.add(Calendar.MINUTE, after); - } + if (after > 0) { + calendar.add(Calendar.MINUTE, after); + } - return calendar.getTime(); - } + return calendar.getTime(); + } - public static Date getStartDate(MaintenanceSchedule maintenanceSchedule) { - return getStartDate(maintenanceSchedule.getCreateDate(), (int) maintenanceSchedule.getAfter()); - } + public static Date getStartDate(MaintenanceSchedule maintenanceSchedule) { + return getStartDate(maintenanceSchedule.getCreateDate(), (int) maintenanceSchedule.getAfter()); + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/util/PortalMaintenanceUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/util/PortalMaintenanceUtil.java index 5d543ea0..a0eed203 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/util/PortalMaintenanceUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/util/PortalMaintenanceUtil.java @@ -11,31 +11,30 @@ import java.lang.reflect.InvocationTargetException; public class PortalMaintenanceUtil { - public static void startMaintenaceMode(String sessionId, String classNameParam) throws IllegalAccessException, - IllegalArgumentException, InvocationTargetException, Exception { + public static void startMaintenaceMode(String sessionId, String classNameParam) + throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, Exception { - String className = - LanguageUtil - .get(LocaleUtil.getDefault(), - "the-sign-in-process-is-temporarily-disabled-because-the-portal-is-undergoing-a-routine-maintenance-upgrade"); + 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(classNameParam)) { - className = classNameParam; - } + if (Validator.isNotNull(classNameParam)) { + className = classNameParam; + } - Class clazz = - ClassResolverUtil.resolve("com.liferay.portal.util.MaintenanceUtil", PortalClassLoaderUtil.getClassLoader()); - ReflectionUtil.getDeclaredMethod(clazz, "maintain", String.class, String.class).invoke(null, sessionId, className); - } + Class clazz = ClassResolverUtil.resolve("com.liferay.portal.util.MaintenanceUtil", + PortalClassLoaderUtil.getClassLoader()); + ReflectionUtil.getDeclaredMethod(clazz, "maintain", String.class, String.class).invoke(null, + sessionId, className); + } - public static void stopMaintenaceMode() throws IllegalAccessException, IllegalArgumentException, - InvocationTargetException, Exception { + public static void stopMaintenaceMode() throws IllegalAccessException, IllegalArgumentException, + InvocationTargetException, Exception { - Class clazz = - ClassResolverUtil.resolve("com.liferay.portal.util.MaintenanceUtil", PortalClassLoaderUtil.getClassLoader()); - ReflectionUtil.getDeclaredMethod(clazz, "cancel", new Class[0]).invoke(null, new Object[0]); + Class clazz = ClassResolverUtil.resolve("com.liferay.portal.util.MaintenanceUtil", + PortalClassLoaderUtil.getClassLoader()); + ReflectionUtil.getDeclaredMethod(clazz, "cancel", new Class[0]).invoke(null, new Object[0]); - - } + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/service.properties b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/service.properties index 5f3c460f..df8d6518 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/service.properties +++ b/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=44 + build.date=1605008600382 build.auto.upgrade=true ## diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/tld/c.tld b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/tld/c.tld deleted file mode 100644 index 98efa6a6..00000000 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/tld/c.tld +++ /dev/null @@ -1,572 +0,0 @@ - - - - - JSTL 1.2 core library - JSTL core - 1.2 - c - http://java.sun.com/jsp/jstl/core - - - - Provides core validation features for JSTL tags. - - - org.apache.taglibs.standard.tlv.JstlCoreTLV - - - - - - Catches any Throwable that occurs in its body and optionally - exposes it. - - catch - org.apache.taglibs.standard.tag.common.core.CatchTag - JSP - - -Name of the exported scoped variable for the -exception thrown from a nested action. The type of the -scoped variable is the type of the exception thrown. - - var - false - false - - - - - - Simple conditional tag that establishes a context for - mutually exclusive conditional operations, marked by - <when> and <otherwise> - - choose - com.liferay.taglib.core.ChooseTag - JSP - - - - - Simple conditional tag, which evalutes its body if the - supplied condition is true and optionally exposes a Boolean - scripting variable representing the evaluation of this condition - - if - com.liferay.taglib.core.IfTag - JSP - - -The test condition that determines whether or -not the body content should be processed. - - test - true - true - boolean - - - -Name of the exported scoped variable for the -resulting value of the test condition. The type -of the scoped variable is Boolean. - - var - false - false - - - -Scope for var. - - scope - false - false - - - - - - Retrieves an absolute or relative URL and exposes its contents - to either the page, a String in 'var', or a Reader in 'varReader'. - - import - org.apache.taglibs.standard.tag.rt.core.ImportTag - org.apache.taglibs.standard.tei.ImportTEI - JSP - - -The URL of the resource to import. - - url - true - true - - - -Name of the exported scoped variable for the -resource's content. The type of the scoped -variable is String. - - var - false - false - - - -Scope for var. - - scope - false - false - - - -Name of the exported scoped variable for the -resource's content. The type of the scoped -variable is Reader. - - varReader - false - false - - - -Name of the context when accessing a relative -URL resource that belongs to a foreign -context. - - context - false - true - - - -Character encoding of the content at the input -resource. - - charEncoding - false - true - - - - - - The basic iteration tag, accepting many different - collection types and supporting subsetting and other - functionality - - forEach - org.apache.taglibs.standard.tag.rt.core.ForEachTag - org.apache.taglibs.standard.tei.ForEachTEI - JSP - - -Collection of items to iterate over. - - items - false - true - java.lang.Object - - java.lang.Object - - - - -If items specified: -Iteration begins at the item located at the -specified index. First item of the collection has -index 0. -If items not specified: -Iteration begins with index set at the value -specified. - - begin - false - true - int - - - -If items specified: -Iteration ends at the item located at the -specified index (inclusive). -If items not specified: -Iteration ends when index reaches the value -specified. - - end - false - true - int - - - -Iteration will only process every step items of -the collection, starting with the first one. - - step - false - true - int - - - -Name of the exported scoped variable for the -current item of the iteration. This scoped -variable has nested visibility. Its type depends -on the object of the underlying collection. - - var - false - false - - - -Name of the exported scoped variable for the -status of the iteration. Object exported is of type -javax.servlet.jsp.jstl.core.LoopTagStatus. This scoped variable has nested -visibility. - - varStatus - false - false - - - - - - Iterates over tokens, separated by the supplied delimeters - - forTokens - org.apache.taglibs.standard.tag.rt.core.ForTokensTag - JSP - - -String of tokens to iterate over. - - items - true - true - java.lang.String - - java.lang.String - - - - -The set of delimiters (the characters that -separate the tokens in the string). - - delims - true - true - java.lang.String - - - -Iteration begins at the token located at the -specified index. First token has index 0. - - begin - false - true - int - - - -Iteration ends at the token located at the -specified index (inclusive). - - end - false - true - int - - - -Iteration will only process every step tokens -of the string, starting with the first one. - - step - false - true - int - - - -Name of the exported scoped variable for the -current item of the iteration. This scoped -variable has nested visibility. - - var - false - false - - - -Name of the exported scoped variable for the -status of the iteration. Object exported is of -type -javax.servlet.jsp.jstl.core.LoopTag -Status. This scoped variable has nested -visibility. - - varStatus - false - false - - - - - - Like <%= ... >, but for expressions. - - out - org.apache.taglibs.standard.tag.rt.core.OutTag - JSP - - -Expression to be evaluated. - - value - true - true - - - -Default value if the resulting value is null. - - default - false - true - - - -Determines whether characters <,>,&,'," in the -resulting string should be converted to their -corresponding character entity codes. Default value is -true. - - escapeXml - false - true - - - - - - - Subtag of <choose> that follows <when> tags - and runs only if all of the prior conditions evaluated to - 'false' - - otherwise - com.liferay.taglib.core.OtherwiseTag - JSP - - - - - Adds a parameter to a containing 'import' tag's URL. - - param - org.apache.taglibs.standard.tag.rt.core.ParamTag - JSP - - -Name of the query string parameter. - - name - true - true - - - -Value of the parameter. - - value - false - true - - - - - - Redirects to a new URL. - - redirect - org.apache.taglibs.standard.tag.rt.core.RedirectTag - JSP - - -The URL of the resource to redirect to. - - url - false - true - - - -Name of the context when redirecting to a relative URL -resource that belongs to a foreign context. - - context - false - true - - - - - - Removes a scoped variable (from a particular scope, if specified). - - remove - org.apache.taglibs.standard.tag.common.core.RemoveTag - empty - - -Name of the scoped variable to be removed. - - var - true - false - - - -Scope for var. - - scope - false - false - - - - - - Sets the result of an expression evaluation in a 'scope' - - set - org.apache.taglibs.standard.tag.rt.core.SetTag - JSP - - -Name of the exported scoped variable to hold the value -specified in the action. The type of the scoped variable is -whatever type the value expression evaluates to. - - var - false - false - - - -Expression to be evaluated. - - value - false - true - - java.lang.Object - - - - -Target object whose property will be set. Must evaluate to -a JavaBeans object with setter property property, or to a -java.util.Map object. - - target - false - true - - - -Name of the property to be set in the target object. - - property - false - true - - - -Scope for var. - - scope - false - false - - - - - - Creates a URL with optional query parameters. - - url - org.apache.taglibs.standard.tag.rt.core.UrlTag - JSP - - -Name of the exported scoped variable for the -processed url. The type of the scoped variable is -String. - - var - false - false - - - -Scope for var. - - scope - false - false - - - -URL to be processed. - - value - false - true - - - -Name of the context when specifying a relative URL -resource that belongs to a foreign context. - - context - false - true - - - - - - Subtag of <choose> that includes its body if its - condition evalutes to 'true' - - when - com.liferay.taglib.core.WhenTag - JSP - - -The test condition that determines whether or not the -body content should be processed. - - test - true - true - boolean - - - - diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/custom_jsps/html/portlet/login/login.jsp b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/custom_jsps/html/portlet/login/login.jsp index dce6f59c..0025417d 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/custom_jsps/html/portlet/login/login.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/custom_jsps/html/portlet/login/login.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%-- /** * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/html/admin_maintenance/edit.jsp b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/html/admin_maintenance/edit.jsp index 828aeff3..e6211f90 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/html/admin_maintenance/edit.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/html/admin_maintenance/edit.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="it.tref.liferay.portos.maintenance.util.MaintenanceConstants.MaintenanceType"%> <%@page import="it.tref.liferay.portos.maintenance.util.MaintenanceConstants.MaintenanceOnReboot"%> <%@include file="/html/admin_maintenance/init.jsp"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/html/admin_maintenance/init.jsp b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/html/admin_maintenance/init.jsp index bc3709cb..eb4f843f 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/html/admin_maintenance/init.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/html/admin_maintenance/init.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ include file="/html/init.jsp" %> <%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%> <%@page import="it.tref.liferay.portos.maintenance.model.MaintenanceSchedule"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/html/admin_maintenance/login_alert.jsp b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/html/admin_maintenance/login_alert.jsp index f9fd8c27..03471ada 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/html/admin_maintenance/login_alert.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/html/admin_maintenance/login_alert.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ include file="/html/admin_maintenance/init.jsp" %> <% diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/html/admin_maintenance/maintenance_action.jsp b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/html/admin_maintenance/maintenance_action.jsp index 4fe2697a..de935915 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/html/admin_maintenance/maintenance_action.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/html/admin_maintenance/maintenance_action.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@include file="/html/admin_maintenance/init.jsp"%> <% diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/html/admin_maintenance/toolbar.jsp b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/html/admin_maintenance/toolbar.jsp index fc9c070f..a2ce1bd1 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/html/admin_maintenance/toolbar.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/html/admin_maintenance/toolbar.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@include file="/html/admin_maintenance/init.jsp"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/html/admin_maintenance/view.jsp b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/html/admin_maintenance/view.jsp index 9d478468..bf3879d1 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/html/admin_maintenance/view.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/html/admin_maintenance/view.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ include file="/html/admin_maintenance/init.jsp" %> <% diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/html/init.jsp b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/html/init.jsp index 17ee0431..62f983fd 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/html/init.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/html/init.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="java.text.SimpleDateFormat"%> <%@page import="com.liferay.portlet.PortletURLUtil"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/html/poller_maintenance/init.jsp b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/html/poller_maintenance/init.jsp index 3d749f84..fc2ebbf3 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/html/poller_maintenance/init.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/html/poller_maintenance/init.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ include file="/html/init.jsp" %> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/html/poller_maintenance/view.jsp b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/html/poller_maintenance/view.jsp index c2f4fef2..64293d88 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/html/poller_maintenance/view.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/html/poller_maintenance/view.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ include file="/html/poller_maintenance/init.jsp" %> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/ivy.xml b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/ivy.xml new file mode 100644 index 00000000..2a8225b7 --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/ivy.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/ivy.xml.MD5 b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/ivy.xml.MD5 new file mode 100644 index 00000000..34e7e1e9 --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/ivy.xml.MD5 @@ -0,0 +1 @@ +5cc166f15f8f11b9ca7581e8a8ee4066 diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mapit-plugin-portlet/docroot/html/fascicolomap/view.jsp b/liferay-plugins-sdk-6.2/portlets/portos-mapit-plugin-portlet/docroot/html/fascicolomap/view.jsp index 0d7187ac..73846011 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-mapit-plugin-portlet/docroot/html/fascicolomap/view.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-mapit-plugin-portlet/docroot/html/fascicolomap/view.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mapit-plugin-portlet/docroot/html/init.jsp b/liferay-plugins-sdk-6.2/portlets/portos-mapit-plugin-portlet/docroot/html/init.jsp index 0ed21100..7e4b2740 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-mapit-plugin-portlet/docroot/html/init.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-mapit-plugin-portlet/docroot/html/init.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="com.liferay.portlet.PortletURLUtil"%> <%@page import="javax.portlet.PortletURL"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mapit-plugin-portlet/docroot/html/plugin/init.jsp b/liferay-plugins-sdk-6.2/portlets/portos-mapit-plugin-portlet/docroot/html/plugin/init.jsp index f3b2be04..a45de3b9 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-mapit-plugin-portlet/docroot/html/plugin/init.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-mapit-plugin-portlet/docroot/html/plugin/init.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="it.tref.liferay.mapit.constants.WebKeys"%> <%@page import="javax.portlet.PortletPreferences"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mapit-plugin-portlet/docroot/html/plugin/top.jsp b/liferay-plugins-sdk-6.2/portlets/portos-mapit-plugin-portlet/docroot/html/plugin/top.jsp index b39fd5c1..948ee585 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-mapit-plugin-portlet/docroot/html/plugin/top.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-mapit-plugin-portlet/docroot/html/plugin/top.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="com.liferay.portal.security.permission.ResourceActionsUtil"%> <%@page import="com.liferay.portal.util.PortalUtil"%> <%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mapit-plugin-portlet/docroot/view.jsp b/liferay-plugins-sdk-6.2/portlets/portos-mapit-plugin-portlet/docroot/view.jsp index 73ccf13b..e28deb24 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-mapit-plugin-portlet/docroot/view.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-mapit-plugin-portlet/docroot/view.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <% /** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. diff --git a/liferay-plugins-sdk-6.2/portlets/portos-notification-portlet/docroot/html/init.jsp b/liferay-plugins-sdk-6.2/portlets/portos-notification-portlet/docroot/html/init.jsp index 17ee0431..62f983fd 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-notification-portlet/docroot/html/init.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-notification-portlet/docroot/html/init.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="java.text.SimpleDateFormat"%> <%@page import="com.liferay.portlet.PortletURLUtil"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-notification-portlet/docroot/html/notification/view.jsp b/liferay-plugins-sdk-6.2/portlets/portos-notification-portlet/docroot/html/notification/view.jsp index 58c1d33f..6931693b 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-notification-portlet/docroot/html/notification/view.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-notification-portlet/docroot/html/notification/view.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="com.liferay.portal.model.Role"%> <%@page import="com.liferay.portal.service.UserLocalServiceUtil"%> <%@page import="com.liferay.portal.service.RoleLocalServiceUtil"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-report-engine-portlet/docroot/html/reports/init.jsp b/liferay-plugins-sdk-6.2/portlets/portos-report-engine-portlet/docroot/html/reports/init.jsp index 9968f679..17a823fe 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-report-engine-portlet/docroot/html/reports/init.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-report-engine-portlet/docroot/html/reports/init.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="com.liferay.portal.kernel.util.ParamUtil"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-report-engine-portlet/docroot/html/reports/reportsBody.jsp b/liferay-plugins-sdk-6.2/portlets/portos-report-engine-portlet/docroot/html/reports/reportsBody.jsp index f4740f74..be3567b3 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-report-engine-portlet/docroot/html/reports/reportsBody.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-report-engine-portlet/docroot/html/reports/reportsBody.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ include file="/html/reports/init.jsp" %> <% diff --git a/liferay-plugins-sdk-6.2/portlets/portos-report-engine-portlet/docroot/html/reports/view.jsp b/liferay-plugins-sdk-6.2/portlets/portos-report-engine-portlet/docroot/html/reports/view.jsp index e49d231d..7fc2bce9 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-report-engine-portlet/docroot/html/reports/view.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-report-engine-portlet/docroot/html/reports/view.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ include file="/html/reports/init.jsp" %> <% diff --git a/liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/html/init.jsp b/liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/html/init.jsp index f48c6d2d..1c412f4a 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/html/init.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/html/init.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="com.liferay.portal.kernel.util.StringUtil"%> <%@page import="java.util.Arrays"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/html/testpdf/view.jsp b/liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/html/testpdf/view.jsp index 715d1ce2..4f1bd30e 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/html/testpdf/view.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/html/testpdf/view.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="it.tref.liferay.portos.report.shared.constants.ReportConstants.ReportType"%> <%@include file="/html/init.jsp" %> diff --git a/liferay-plugins-sdk-6.2/shared/portos-audit-shared/.classpath b/liferay-plugins-sdk-6.2/shared/portos-audit-shared/.classpath index 20614503..ab48b570 100644 --- a/liferay-plugins-sdk-6.2/shared/portos-audit-shared/.classpath +++ b/liferay-plugins-sdk-6.2/shared/portos-audit-shared/.classpath @@ -1,6 +1,11 @@ - + + + + + + diff --git a/liferay-plugins-sdk-6.2/shared/portos-audit-shared/src/it/tref/liferay/portos/audit/shared/AttributesBuilder.java b/liferay-plugins-sdk-6.2/shared/portos-audit-shared/src/it/tref/liferay/portos/audit/shared/AttributesBuilder.java index 5436320b..60a5ea6f 100644 --- a/liferay-plugins-sdk-6.2/shared/portos-audit-shared/src/it/tref/liferay/portos/audit/shared/AttributesBuilder.java +++ b/liferay-plugins-sdk-6.2/shared/portos-audit-shared/src/it/tref/liferay/portos/audit/shared/AttributesBuilder.java @@ -19,139 +19,140 @@ import com.liferay.portal.kernel.util.Validator; public class AttributesBuilder { - private List _attributes = new ArrayList(); - private T _newBean; - private T _oldBean; - - public AttributesBuilder(T newBean, T oldBean) { - - _newBean = newBean; - _oldBean = oldBean; - } - - public void add(String name) { - - DateFormat format = DateFormatFactoryUtil.getSimpleDateFormat("yyyy/MM/dd HH:mm z", TimeZone.getTimeZone("UTC")); - Object newValueObj = BeanPropertiesUtil.getObject(_newBean, name); - Object oldValueObj = BeanPropertiesUtil.getObject(_oldBean, name); - - String newValue = null; - String oldValue = null; - if (Validator.isNotNull(newValueObj)) { - newValue = newValueObj instanceof Date ? format.format(newValueObj) : newValueObj.toString(); - } - if (Validator.isNotNull(oldValueObj)) { - oldValue = oldValueObj instanceof Date ? format.format(oldValueObj) : oldValueObj.toString(); - } - if (!Validator.equals(newValue, oldValue)) { - Attribute attribute = new Attribute(name, newValue, oldValue); - - _attributes.add(attribute); - } - } - - public void addLocalized(String name) { - - DateFormat format = DateFormatFactoryUtil.getSimpleDateFormat("yyyy/MM/dd HH:mm z", TimeZone.getTimeZone("UTC")); - Object newValueObj = BeanPropertiesUtil.getObject(_newBean, name); - Object oldValueObj = BeanPropertiesUtil.getObject(_oldBean, name); - - String newValue = null; - String oldValue = null; - if (Validator.isNotNull(newValueObj)) { - newValue = newValueObj instanceof Date ? format.format(newValueObj) : newValueObj.toString(); - } - if (Validator.isNotNull(oldValueObj)) { - oldValue = oldValueObj instanceof Date ? format.format(oldValueObj) : oldValueObj.toString(); - } - - if (!Validator.equals(newValue, oldValue)) { - boolean createAttribute = false; - - Map newValueMap = LocalizationUtil.getLocalizationMap(newValue); - Map oldValueMap = LocalizationUtil.getLocalizationMap(oldValue); - - if (Validator.isNull(newValueMap) && Validator.isNotNull(oldValueMap)) { - createAttribute = true; - } else if (Validator.isNotNull(newValueMap) && Validator.isNull(oldValueMap)) { - createAttribute = true; - } else if (newValueMap.keySet().size() != oldValueMap.keySet().size()) { - createAttribute = true; - } else { - for (Locale locale : newValueMap.keySet()) { - if (!oldValueMap.keySet().contains(locale)) { - createAttribute = true; - break; - } - - String newLocalizedValue = newValueMap.get(locale); - String oldLocalizedValue = oldValueMap.get(locale); - if (!Validator.equals(newLocalizedValue, oldLocalizedValue)) { - createAttribute = true; - break; - } - } - } - - if (createAttribute) { - Attribute attribute = new Attribute(name, newValue, oldValue); - _attributes.add(attribute); - } - } - } - - public JSONObject getAttributesJSON() { - - JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); - - for (Attribute attribute : _attributes) { - JSONObject attributeJSONObject = JSONFactoryUtil.createJSONObject(); - - attributeJSONObject.put("name", attribute.getName()); - attributeJSONObject.put("newValue", attribute.getNewValue()); - attributeJSONObject.put("oldValue", attribute.getOldValue()); - - jsonArray.put(attributeJSONObject); - } - - JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); - jsonObject.put("attributes", jsonArray); - - return jsonObject; - } + private List _attributes = new ArrayList(); + private T _newBean; + private T _oldBean; + + public AttributesBuilder(T newBean, T oldBean) { + + _newBean = newBean; + _oldBean = oldBean; + } + + public void add(String name) { + + DateFormat format = DateFormatFactoryUtil.getSimpleDateFormat("yyyy/MM/dd HH:mm z", + TimeZone.getTimeZone("UTC")); + Object newValueObj = BeanPropertiesUtil.getObject(_newBean, name); + Object oldValueObj = BeanPropertiesUtil.getObject(_oldBean, name); + + String newValue = null; + String oldValue = null; + if (Validator.isNotNull(newValueObj)) { + newValue = newValueObj instanceof Date ? format.format(newValueObj) : newValueObj.toString(); + } + if (Validator.isNotNull(oldValueObj)) { + oldValue = oldValueObj instanceof Date ? format.format(oldValueObj) : oldValueObj.toString(); + } + if (!Validator.equals(newValue, oldValue)) { + Attribute attribute = new Attribute(name, newValue, oldValue); + + _attributes.add(attribute); + } + } + + public void addLocalized(String name) { + + DateFormat format = DateFormatFactoryUtil.getSimpleDateFormat("yyyy/MM/dd HH:mm z", + TimeZone.getTimeZone("UTC")); + Object newValueObj = BeanPropertiesUtil.getObject(_newBean, name); + Object oldValueObj = BeanPropertiesUtil.getObject(_oldBean, name); + + String newValue = null; + String oldValue = null; + if (Validator.isNotNull(newValueObj)) { + newValue = newValueObj instanceof Date ? format.format(newValueObj) : newValueObj.toString(); + } + if (Validator.isNotNull(oldValueObj)) { + oldValue = oldValueObj instanceof Date ? format.format(oldValueObj) : oldValueObj.toString(); + } + + if (!Validator.equals(newValue, oldValue)) { + boolean createAttribute = false; + + Map newValueMap = LocalizationUtil.getLocalizationMap(newValue); + Map oldValueMap = LocalizationUtil.getLocalizationMap(oldValue); + + if (Validator.isNull(newValueMap) && Validator.isNotNull(oldValueMap)) { + createAttribute = true; + } else if (Validator.isNotNull(newValueMap) && Validator.isNull(oldValueMap)) { + createAttribute = true; + } else if (newValueMap.keySet().size() != oldValueMap.keySet().size()) { + createAttribute = true; + } else { + for (Locale locale : newValueMap.keySet()) { + if (!oldValueMap.keySet().contains(locale)) { + createAttribute = true; + break; + } + + String newLocalizedValue = newValueMap.get(locale); + String oldLocalizedValue = oldValueMap.get(locale); + if (!Validator.equals(newLocalizedValue, oldLocalizedValue)) { + createAttribute = true; + break; + } + } + } + + if (createAttribute) { + Attribute attribute = new Attribute(name, newValue, oldValue); + _attributes.add(attribute); + } + } + } + + public JSONObject getAttributesJSON() { + + JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); + + for (Attribute attribute : _attributes) { + JSONObject attributeJSONObject = JSONFactoryUtil.createJSONObject(); + + attributeJSONObject.put("name", attribute.getName()); + attributeJSONObject.put("newValue", attribute.getNewValue()); + attributeJSONObject.put("oldValue", attribute.getOldValue()); + + jsonArray.put(attributeJSONObject); + } + + JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); + jsonObject.put("attributes", jsonArray); + + return jsonObject; + } } - class Attribute { - private String _name; - private String _newValue; - private String _oldValue; + private String _name; + private String _newValue; + private String _oldValue; - public Attribute(String name) { + public Attribute(String name) { - this(name, StringPool.BLANK, StringPool.BLANK); - } + this(name, StringPool.BLANK, StringPool.BLANK); + } - public Attribute(String name, String newValue, String oldValue) { + public Attribute(String name, String newValue, String oldValue) { - _name = name; - _newValue = newValue; - _oldValue = oldValue; - } + _name = name; + _newValue = newValue; + _oldValue = oldValue; + } - public String getName() { + public String getName() { - return _name; - } + return _name; + } - public String getNewValue() { + public String getNewValue() { - return _newValue; - } + return _newValue; + } - public String getOldValue() { + public String getOldValue() { - return _oldValue; - } + return _oldValue; + } } diff --git a/liferay-plugins-sdk-6.2/shared/portos-audit-shared/src/it/tref/liferay/portos/audit/shared/AuditModelListener.java b/liferay-plugins-sdk-6.2/shared/portos-audit-shared/src/it/tref/liferay/portos/audit/shared/AuditModelListener.java index 2c3f7f16..2d381562 100644 --- a/liferay-plugins-sdk-6.2/shared/portos-audit-shared/src/it/tref/liferay/portos/audit/shared/AuditModelListener.java +++ b/liferay-plugins-sdk-6.2/shared/portos-audit-shared/src/it/tref/liferay/portos/audit/shared/AuditModelListener.java @@ -16,158 +16,164 @@ import com.liferay.portal.model.BaseModelListener; public abstract class AuditModelListener> extends BaseModelListener { - - @Override - public void onBeforeCreate(T model) throws ModelListenerException { - - routeAuditMessage(Constants.ADD.toUpperCase(), model, getMessage(model), null, false); - } - - @Override - public void onBeforeRemove(T model) throws ModelListenerException { - - routeAuditMessage(Constants.DELETE.toUpperCase(), model, getMessage(model), null, false); - } - - @Override - public void onBeforeUpdate(T newModel) throws ModelListenerException { - - try { - - T oldModel = getOldModel(newModel); - - JSONObject attributes = getModifiedAttributes(newModel, oldModel); - JSONArray array = attributes.getJSONArray("attributes"); - boolean isUpdate = true; - if (array != null) { - for (int i = 0; i < array.length(); i++) { - String name = array.getJSONObject(i).getString("name"); - String newValue = array.getJSONObject(i).getString("newValue"); - if (name.equalsIgnoreCase(getStatoAttributesName())) { - - routeAuditMessage(convertStatoToEventString(newValue), newModel, getMessage(newModel), attributes, true); - - if (array.length() == 1) { - isUpdate = false; - } - - } - attributes.remove(getStatoAttributesName()); - - } - } - if (isUpdate) { - boolean sended = - routeAuditMessage(Constants.UPDATE.toUpperCase(), newModel, getMessage(newModel), attributes, false); - if (sended) { - onBeforeRealUpdate(newModel, oldModel); - } - } - } catch (Exception e) { - throw new ModelListenerException(e); - } - } - - protected String convertStatoToEventString(String newValue) { - if ("1".equalsIgnoreCase(newValue) || "true".equalsIgnoreCase(newValue)) { - return Constants.ATTIVA.toUpperCase(); - } else { - return Constants.DISATTIVA.toUpperCase(); - } - } - - protected String getStatoAttributesName() { - return "valido"; - } - - protected String getStatoAttivaString() { - return "1"; - } - - protected abstract T getOldModel(T newModel) throws ModelListenerException; - - protected List getExcludedFields() { - List esclusioni = new ArrayList() { - { - add("modifiedDate"); - add("createDate"); - } - }; - return esclusioni; - } - - protected JSONObject getModifiedAttributes(T newRelazioniAnagrafiche, T oldRelazioniAnagrafiche) { - - AttributesBuilder attributesBuilder = new AttributesBuilder(newRelazioniAnagrafiche, oldRelazioniAnagrafiche); - - Map model = newRelazioniAnagrafiche.getModelAttributes(); - Iterator modelList = model.keySet().iterator(); - while (modelList.hasNext()) { - String name = (String) modelList.next(); - if (!getExcludedFields().contains(name)) { - attributesBuilder.add(name); - } - } - - return attributesBuilder.getAttributesJSON(); - } - - protected boolean routeAuditMessage(String eventAction, T model, String message, JSONObject additionalInfo, - boolean cambiostato) throws ModelListenerException { - String className = getClassName(model); - if (cambiostato) { - AuditUtil.doCambioStato(getEventType(model), className, (Long) model.getPrimaryKeyObj(), message, - getEventCategory(model), eventAction); - onBeforeCambioStato(model); - return true; - } else if (additionalInfo == null) { - AuditUtil.doLog(getEventType(model), className, (Long) model.getPrimaryKeyObj(), message, - getEventCategory(model), eventAction, getParentClassName(model), getParentClassPk(model), - getRelatedClassName(model), getRelatedClassPk(model), getAdditionalInfoForLogEvent(eventAction, model)); - onBeforeLog(model); - return true; - } else { - return AuditUtil.doStorico(getEventType(model), className, (Long) model.getPrimaryKeyObj(), message, - getEventCategory(model), eventAction, getParentClassName(model), getParentClassPk(model), - getRelatedClassName(model), getRelatedClassPk(model), additionalInfo, null); - } - - } - - protected JSONObject getAdditionalInfoForLogEvent(String eventAction, T model) { - - return null; - } - - protected void onBeforeRealUpdate(T newModel, T oldModel) throws ModelListenerException {} - - protected void onBeforeLog(T model) throws ModelListenerException {} - - protected void onBeforeCambioStato(T model) throws ModelListenerException {} - - protected Long getParentClassPk(T model) { - return 0l; - } - - protected String getParentClassName(T model) { - return StringPool.BLANK; - } - - protected Long getRelatedClassPk(T model) { - return 0l; - } - - protected String getRelatedClassName(T model) { - return StringPool.BLANK; - } - - protected String getMessage(T model) { - return StringPool.BLANK; - } - - protected abstract String getClassName(T model); - - protected abstract String getEventType(T model); - - protected abstract String getEventCategory(T model); + @Override + public void onBeforeCreate(T model) throws ModelListenerException { + + routeAuditMessage(Constants.ADD.toUpperCase(), model, getMessage(model), null, false); + } + + @Override + public void onBeforeRemove(T model) throws ModelListenerException { + + routeAuditMessage(Constants.DELETE.toUpperCase(), model, getMessage(model), null, false); + } + + @Override + public void onBeforeUpdate(T newModel) throws ModelListenerException { + + try { + + T oldModel = getOldModel(newModel); + + JSONObject attributes = getModifiedAttributes(newModel, oldModel); + JSONArray array = attributes.getJSONArray("attributes"); + boolean isUpdate = true; + if (array != null) { + for (int i = 0; i < array.length(); i++) { + String name = array.getJSONObject(i).getString("name"); + String newValue = array.getJSONObject(i).getString("newValue"); + if (name.equalsIgnoreCase(getStatoAttributesName())) { + + routeAuditMessage(convertStatoToEventString(newValue), newModel, + getMessage(newModel), attributes, true); + + if (array.length() == 1) { + isUpdate = false; + } + + } + attributes.remove(getStatoAttributesName()); + + } + } + if (isUpdate) { + boolean sended = routeAuditMessage(Constants.UPDATE.toUpperCase(), newModel, + getMessage(newModel), attributes, false); + if (sended) { + onBeforeRealUpdate(newModel, oldModel); + } + } + } catch (Exception e) { + throw new ModelListenerException(e); + } + } + + protected String convertStatoToEventString(String newValue) { + if ("1".equalsIgnoreCase(newValue) || "true".equalsIgnoreCase(newValue)) { + return Constants.ATTIVA.toUpperCase(); + } else { + return Constants.DISATTIVA.toUpperCase(); + } + } + + protected String getStatoAttributesName() { + return "valido"; + } + + protected String getStatoAttivaString() { + return "1"; + } + + protected abstract T getOldModel(T newModel) throws ModelListenerException; + + protected List getExcludedFields() { + List esclusioni = new ArrayList() { + { + add("modifiedDate"); + add("createDate"); + } + }; + return esclusioni; + } + + protected JSONObject getModifiedAttributes(T newRelazioniAnagrafiche, T oldRelazioniAnagrafiche) { + + AttributesBuilder attributesBuilder = new AttributesBuilder(newRelazioniAnagrafiche, + oldRelazioniAnagrafiche); + + Map model = newRelazioniAnagrafiche.getModelAttributes(); + Iterator modelList = model.keySet().iterator(); + while (modelList.hasNext()) { + String name = (String) modelList.next(); + if (!getExcludedFields().contains(name)) { + attributesBuilder.add(name); + } + } + + return attributesBuilder.getAttributesJSON(); + } + + protected boolean routeAuditMessage(String eventAction, T model, String message, + JSONObject additionalInfo, boolean cambiostato) throws ModelListenerException { + String className = getClassName(model); + if (cambiostato) { + AuditUtil.doCambioStato(getEventType(model), className, (Long) model.getPrimaryKeyObj(), message, + getEventCategory(model), eventAction); + onBeforeCambioStato(model); + return true; + } else if (additionalInfo == null) { + AuditUtil.doLog(getEventType(model), className, (Long) model.getPrimaryKeyObj(), message, + getEventCategory(model), eventAction, getParentClassName(model), getParentClassPk(model), + getRelatedClassName(model), getRelatedClassPk(model), + getAdditionalInfoForLogEvent(eventAction, model)); + onBeforeLog(model); + return true; + } else { + return AuditUtil.doStorico(getEventType(model), className, (Long) model.getPrimaryKeyObj(), + message, getEventCategory(model), eventAction, getParentClassName(model), + getParentClassPk(model), getRelatedClassName(model), getRelatedClassPk(model), + additionalInfo, null); + } + + } + + protected JSONObject getAdditionalInfoForLogEvent(String eventAction, T model) { + + return null; + } + + protected void onBeforeRealUpdate(T newModel, T oldModel) throws ModelListenerException { + } + + protected void onBeforeLog(T model) throws ModelListenerException { + } + + protected void onBeforeCambioStato(T model) throws ModelListenerException { + } + + protected Long getParentClassPk(T model) { + return 0l; + } + + protected String getParentClassName(T model) { + return StringPool.BLANK; + } + + protected Long getRelatedClassPk(T model) { + return 0l; + } + + protected String getRelatedClassName(T model) { + return StringPool.BLANK; + } + + protected String getMessage(T model) { + return StringPool.BLANK; + } + + protected abstract String getClassName(T model); + + protected abstract String getEventType(T model); + + protected abstract String getEventCategory(T model); } diff --git a/liferay-plugins-sdk-6.2/shared/portos-audit-shared/src/it/tref/liferay/portos/audit/shared/AuditUtil.java b/liferay-plugins-sdk-6.2/shared/portos-audit-shared/src/it/tref/liferay/portos/audit/shared/AuditUtil.java index 241c6de2..fde213f7 100644 --- a/liferay-plugins-sdk-6.2/shared/portos-audit-shared/src/it/tref/liferay/portos/audit/shared/AuditUtil.java +++ b/liferay-plugins-sdk-6.2/shared/portos-audit-shared/src/it/tref/liferay/portos/audit/shared/AuditUtil.java @@ -16,99 +16,102 @@ import com.liferay.portal.util.PortalUtil; public class AuditUtil { - public static void doLog(String eventType, String className, long classPK) throws ModelListenerException { - - doLog(eventType, className, classPK, StringPool.BLANK); - } - - public static void doLog(String eventType, String className, long classPK, String message) - throws ModelListenerException { - - doLog(eventType, className, classPK, message, StringPool.BLANK, StringPool.BLANK, StringPool.BLANK, 0l, - StringPool.BLANK, 0l, null); - } - - public static void doLog(String eventType, String className, long classPK, String message, String eventCategory, - String eventAction, String parentClassName, Long parentClassPK, String relatedClassName, Long relatedClassPK, - JSONObject additionalInfo) throws ModelListenerException { - - doAudit(eventType, className, classPK, message, AuditKey.EVENT_TABLE_LOG, eventCategory, eventAction, - parentClassName, parentClassPK, relatedClassName, relatedClassPK, null, additionalInfo); - } - - public static boolean doStorico(String eventType, String className, long classPK, String message, - String eventCategory, String eventAction, String parentClassName, Long parentClassPK, String relatedClassName, - Long relatedClassPK, JSONObject diff, JSONObject additionalInfo) throws ModelListenerException { - if (diff != null && !diff.isNull("attributes") && diff.getJSONArray("attributes").length() > 0) { - doAudit(eventType, className, classPK, message, AuditKey.EVENT_TABLE_STORICO, eventCategory, eventAction, - parentClassName, parentClassPK, relatedClassName, relatedClassPK, diff, additionalInfo); - return true; - } else { - return false; - } - } - - public static void doCambioStato(String eventType, String className, long classPK, String message, - String eventCategory, String eventAction) throws ModelListenerException { - doAudit(eventType, className, classPK, message, AuditKey.EVENT_TABLE_CAMBIO_STATO, eventCategory, eventAction, - StringPool.BLANK, 0l, StringPool.BLANK, 0l, null, null); - - } - - private static void doAudit(String eventType, String className, long classPK, String message, String auditEventTable, - String eventCategory, String eventAction, String parentClassName, Long parentClassPK, String relatedClassName, - Long relatedClassPK, JSONObject diff, JSONObject additionalInfo) throws ModelListenerException { - - try { - if (additionalInfo == null) - additionalInfo = JSONFactoryUtil.createJSONObject(); - - addIfNotNull(additionalInfo, AuditKey.FIELD_AUDIT_EVENT_TABLE, auditEventTable); - addIfNotNull(additionalInfo, AuditKey.FIELD_EVENT_CATEGORY, eventCategory); - addIfNotNull(additionalInfo, AuditKey.FIELD_EVENT_ACTION, eventAction); - addIfNotNull(additionalInfo, AuditKey.FIELD_PARENT_CLASS_NAME, parentClassName); - addIfNotNull(additionalInfo, AuditKey.FIELD_PARENT_CLASS_PK, parentClassPK); - addIfNotNull(additionalInfo, AuditKey.FIELD_RELATED_CLASS_NAME, relatedClassName); - addIfNotNull(additionalInfo, AuditKey.FIELD_RELATED_CLASS_PK, relatedClassPK); - if (diff != null) { - additionalInfo.put(AuditKey.FIELD_DIFF, diff); - } - - long companyId = CompanyThreadLocal.getCompanyId(); - - long userId = 0; - if (PrincipalThreadLocal.getName() != null) { - userId = GetterUtil.getLong(PrincipalThreadLocal.getName()); - } - - AuditRequestThreadLocal auditRequestThreadLocal = AuditRequestThreadLocal.getAuditThreadLocal(); - long realUserId = auditRequestThreadLocal.getRealUserId(); - String realUserName = PortalUtil.getUserName(realUserId, StringPool.BLANK); - - if ((realUserId > 0) && (userId != realUserId)) { - additionalInfo.put("doAsUserId", String.valueOf(userId)); - additionalInfo.put("doAsUserName", PortalUtil.getUserName(userId, StringPool.BLANK)); - } - - AuditMessage auditMessage = - new AuditMessage(eventType, companyId, realUserId, realUserName, className, String.valueOf(classPK), message, - additionalInfo); - - AuditRouterUtil.route(auditMessage); - } catch (PortalException e) { - throw new ModelListenerException(e); - } - } - - private static void addIfNotNull(JSONObject additionalInfo, String key, String value) { - if (Validator.isNotNull(value)) { - additionalInfo.put(key, value); - } - } - - private static void addIfNotNull(JSONObject additionalInfo, String key, Long value) { - if (Validator.isNotNull(value)) { - additionalInfo.put(key, value); - } - } + public static void doLog(String eventType, String className, long classPK) throws ModelListenerException { + + doLog(eventType, className, classPK, StringPool.BLANK); + } + + public static void doLog(String eventType, String className, long classPK, String message) + throws ModelListenerException { + + doLog(eventType, className, classPK, message, StringPool.BLANK, StringPool.BLANK, StringPool.BLANK, + 0l, StringPool.BLANK, 0l, null); + } + + public static void doLog(String eventType, String className, long classPK, String message, + String eventCategory, String eventAction, String parentClassName, Long parentClassPK, + String relatedClassName, Long relatedClassPK, JSONObject additionalInfo) + throws ModelListenerException { + + doAudit(eventType, className, classPK, message, AuditKey.EVENT_TABLE_LOG, eventCategory, eventAction, + parentClassName, parentClassPK, relatedClassName, relatedClassPK, null, additionalInfo); + } + + public static boolean doStorico(String eventType, String className, long classPK, String message, + String eventCategory, String eventAction, String parentClassName, Long parentClassPK, + String relatedClassName, Long relatedClassPK, JSONObject diff, JSONObject additionalInfo) + throws ModelListenerException { + if (diff != null && !diff.isNull("attributes") && diff.getJSONArray("attributes").length() > 0) { + doAudit(eventType, className, classPK, message, AuditKey.EVENT_TABLE_STORICO, eventCategory, + eventAction, parentClassName, parentClassPK, relatedClassName, relatedClassPK, diff, + additionalInfo); + return true; + } else { + return false; + } + } + + public static void doCambioStato(String eventType, String className, long classPK, String message, + String eventCategory, String eventAction) throws ModelListenerException { + doAudit(eventType, className, classPK, message, AuditKey.EVENT_TABLE_CAMBIO_STATO, eventCategory, + eventAction, StringPool.BLANK, 0l, StringPool.BLANK, 0l, null, null); + + } + + private static void doAudit(String eventType, String className, long classPK, String message, + String auditEventTable, String eventCategory, String eventAction, String parentClassName, + Long parentClassPK, String relatedClassName, Long relatedClassPK, JSONObject diff, + JSONObject additionalInfo) throws ModelListenerException { + + try { + if (additionalInfo == null) + additionalInfo = JSONFactoryUtil.createJSONObject(); + + addIfNotNull(additionalInfo, AuditKey.FIELD_AUDIT_EVENT_TABLE, auditEventTable); + addIfNotNull(additionalInfo, AuditKey.FIELD_EVENT_CATEGORY, eventCategory); + addIfNotNull(additionalInfo, AuditKey.FIELD_EVENT_ACTION, eventAction); + addIfNotNull(additionalInfo, AuditKey.FIELD_PARENT_CLASS_NAME, parentClassName); + addIfNotNull(additionalInfo, AuditKey.FIELD_PARENT_CLASS_PK, parentClassPK); + addIfNotNull(additionalInfo, AuditKey.FIELD_RELATED_CLASS_NAME, relatedClassName); + addIfNotNull(additionalInfo, AuditKey.FIELD_RELATED_CLASS_PK, relatedClassPK); + if (diff != null) { + additionalInfo.put(AuditKey.FIELD_DIFF, diff); + } + + long companyId = CompanyThreadLocal.getCompanyId(); + + long userId = 0; + if (PrincipalThreadLocal.getName() != null) { + userId = GetterUtil.getLong(PrincipalThreadLocal.getName()); + } + + AuditRequestThreadLocal auditRequestThreadLocal = AuditRequestThreadLocal.getAuditThreadLocal(); + long realUserId = auditRequestThreadLocal.getRealUserId(); + String realUserName = PortalUtil.getUserName(realUserId, StringPool.BLANK); + + if ((realUserId > 0) && (userId != realUserId)) { + additionalInfo.put("doAsUserId", String.valueOf(userId)); + additionalInfo.put("doAsUserName", PortalUtil.getUserName(userId, StringPool.BLANK)); + } + + AuditMessage auditMessage = new AuditMessage(eventType, companyId, realUserId, realUserName, + className, String.valueOf(classPK), message, additionalInfo); + + AuditRouterUtil.route(auditMessage); + } catch (PortalException e) { + throw new ModelListenerException(e); + } + } + + private static void addIfNotNull(JSONObject additionalInfo, String key, String value) { + if (Validator.isNotNull(value)) { + additionalInfo.put(key, value); + } + } + + private static void addIfNotNull(JSONObject additionalInfo, String key, Long value) { + if (Validator.isNotNull(value)) { + additionalInfo.put(key, value); + } + } } diff --git a/liferay-plugins-sdk-6.2/shared/portos-audit-shared/src/it/tref/liferay/portos/audit/shared/permission/HistoryPermission.java b/liferay-plugins-sdk-6.2/shared/portos-audit-shared/src/it/tref/liferay/portos/audit/shared/permission/HistoryPermission.java index 63671cac..cca32903 100644 --- a/liferay-plugins-sdk-6.2/shared/portos-audit-shared/src/it/tref/liferay/portos/audit/shared/permission/HistoryPermission.java +++ b/liferay-plugins-sdk-6.2/shared/portos-audit-shared/src/it/tref/liferay/portos/audit/shared/permission/HistoryPermission.java @@ -9,25 +9,25 @@ import com.liferay.portal.security.permission.PermissionChecker; public class HistoryPermission { - public static final String RESOURCE_NAME = "it.tref.liferay.portos.audit.history"; + public static final String RESOURCE_NAME = "it.tref.liferay.portos.audit.history"; - public static void check(PermissionChecker permissionChecker, long groupId, String actionId) throws PortalException { + public static void check(PermissionChecker permissionChecker, long groupId, String actionId) + throws PortalException { - if (!contains(permissionChecker, groupId, actionId)) { - throw new PrincipalException(); - } - } + if (!contains(permissionChecker, groupId, actionId)) { + throw new PrincipalException(); + } + } - public static boolean contains(PermissionChecker permissionChecker, long groupId, String actionId) { + public static boolean contains(PermissionChecker permissionChecker, long groupId, String actionId) { - Boolean hasPermission = - StagingPermissionUtil.hasPermission(permissionChecker, groupId, RESOURCE_NAME, groupId, - PortletKeys.AUDIT_DETAIL, actionId); + Boolean hasPermission = StagingPermissionUtil.hasPermission(permissionChecker, groupId, + RESOURCE_NAME, groupId, PortletKeys.AUDIT_DETAIL, actionId); - if (hasPermission != null) { - return hasPermission.booleanValue(); - } + if (hasPermission != null) { + return hasPermission.booleanValue(); + } - return permissionChecker.hasPermission(groupId, RESOURCE_NAME, groupId, actionId); - } + return permissionChecker.hasPermission(groupId, RESOURCE_NAME, groupId, actionId); + } } diff --git a/liferay-plugins-sdk-6.2/shared/portos-audit-shared/src/it/tref/liferay/portos/audit/shared/util/Constants.java b/liferay-plugins-sdk-6.2/shared/portos-audit-shared/src/it/tref/liferay/portos/audit/shared/util/Constants.java index 5e872449..07770b2d 100644 --- a/liferay-plugins-sdk-6.2/shared/portos-audit-shared/src/it/tref/liferay/portos/audit/shared/util/Constants.java +++ b/liferay-plugins-sdk-6.2/shared/portos-audit-shared/src/it/tref/liferay/portos/audit/shared/util/Constants.java @@ -1,8 +1,6 @@ package it.tref.liferay.portos.audit.shared.util; public class Constants implements com.liferay.portal.kernel.util.Constants { - - public static final String ATTIVA = "ATTIVA"; - public static final String DISATTIVA = "DISATTIVA"; - + public static final String ATTIVA = "ATTIVA"; + public static final String DISATTIVA = "DISATTIVA"; } diff --git a/liferay-plugins-sdk-6.2/shared/portos-audit-shared/src/it/tref/liferay/portos/audit/shared/util/PortletKeys.java b/liferay-plugins-sdk-6.2/shared/portos-audit-shared/src/it/tref/liferay/portos/audit/shared/util/PortletKeys.java index e324eed5..a71e9228 100644 --- a/liferay-plugins-sdk-6.2/shared/portos-audit-shared/src/it/tref/liferay/portos/audit/shared/util/PortletKeys.java +++ b/liferay-plugins-sdk-6.2/shared/portos-audit-shared/src/it/tref/liferay/portos/audit/shared/util/PortletKeys.java @@ -1,9 +1,6 @@ package it.tref.liferay.portos.audit.shared.util; public class PortletKeys extends com.liferay.portal.util.PortletKeys { - - public static final String AUDIT = "1_WAR_portosauditportlet"; - - public static final String AUDIT_DETAIL = "2_WAR_portosauditportlet"; - + public static final String AUDIT = "1_WAR_portosauditportlet"; + public static final String AUDIT_DETAIL = "2_WAR_portosauditportlet"; } diff --git a/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/bean/FirmeBean.java b/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/bean/FirmeBean.java index 041b1874..58a2b997 100644 --- a/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/bean/FirmeBean.java +++ b/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/bean/FirmeBean.java @@ -8,87 +8,87 @@ import java.util.List; public class FirmeBean implements Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - private List firmeDigitali = new UniqueList(); - private List firmeApplicativo = new UniqueList(); + private List firmeDigitali = new UniqueList(); + private List firmeApplicativo = new UniqueList(); - public List getFirmeDigitali() { - return new UnmodifiableList<>(firmeDigitali); - } + public List getFirmeDigitali() { + return new UnmodifiableList<>(firmeDigitali); + } - public void setFirmeDigitali(List firmeDigitali) { - this.firmeDigitali = new UniqueList(); - for (FirmeDetail firmaDigitale : firmeDigitali) { - this.firmeDigitali.add(firmaDigitale); - } - } + public void setFirmeDigitali(List firmeDigitali) { + this.firmeDigitali = new UniqueList(); + for (FirmeDetail firmaDigitale : firmeDigitali) { + this.firmeDigitali.add(firmaDigitale); + } + } - public List getFirmeApplicativo() { - return new UnmodifiableList<>(firmeApplicativo); - } + public List getFirmeApplicativo() { + return new UnmodifiableList<>(firmeApplicativo); + } - public void setFirmeApplicativo(List firmeApplicativo) { - this.firmeApplicativo = new UniqueList(); - for (FirmeDetail firmaApplicativo : firmeApplicativo) { - this.firmeApplicativo.add(firmaApplicativo); - } - } + public void setFirmeApplicativo(List firmeApplicativo) { + this.firmeApplicativo = new UniqueList(); + for (FirmeDetail firmaApplicativo : firmeApplicativo) { + this.firmeApplicativo.add(firmaApplicativo); + } + } - public boolean firmaIsPresent(String codiceFiscale) { - for (FirmeDetail firmaDigitale : firmeDigitali) { - if (firmaDigitale.getCfFirmatario().equalsIgnoreCase(codiceFiscale)) { - return true; - } - } - for (FirmeDetail firmaApplicativo : firmeApplicativo) { - if (firmaApplicativo.getCfFirmatario().equalsIgnoreCase(codiceFiscale)) { - return true; - } - } - return false; - } + public boolean firmaIsPresent(String codiceFiscale) { + for (FirmeDetail firmaDigitale : firmeDigitali) { + if (firmaDigitale.getCfFirmatario().equalsIgnoreCase(codiceFiscale)) { + return true; + } + } + for (FirmeDetail firmaApplicativo : firmeApplicativo) { + if (firmaApplicativo.getCfFirmatario().equalsIgnoreCase(codiceFiscale)) { + return true; + } + } + return false; + } - public boolean firmaIsAnnullabile(String codiceFiscale) { - for (FirmeDetail firmaApplicativo : firmeApplicativo) { - if (firmaApplicativo.getCfFirmatario().equalsIgnoreCase(codiceFiscale)) { - return true; - } - } - return false; - } + public boolean firmaIsAnnullabile(String codiceFiscale) { + for (FirmeDetail firmaApplicativo : firmeApplicativo) { + if (firmaApplicativo.getCfFirmatario().equalsIgnoreCase(codiceFiscale)) { + return true; + } + } + return false; + } - public int numeroFirme() { - List allSignatures = allSignatures(); - return allSignatures.size(); - } + public int numeroFirme() { + List allSignatures = allSignatures(); + return allSignatures.size(); + } - public List allSignatures() { - List all = new UniqueList(); - for (FirmeDetail firmaDigitale : firmeDigitali) { - all.add(firmaDigitale.getCfFirmatario().toLowerCase()); - } - for (FirmeDetail firmaApplicativo : firmeApplicativo) { - all.add(firmaApplicativo.getCfFirmatario().toLowerCase()); - } - return all; - } + public List allSignatures() { + List all = new UniqueList(); + for (FirmeDetail firmaDigitale : firmeDigitali) { + all.add(firmaDigitale.getCfFirmatario().toLowerCase()); + } + for (FirmeDetail firmaApplicativo : firmeApplicativo) { + all.add(firmaApplicativo.getCfFirmatario().toLowerCase()); + } + return all; + } - public List allFirmeDetails() { - List all = new UniqueList(); - all.addAll(firmeDigitali); - all.addAll(firmeApplicativo); - return all; - } + public List allFirmeDetails() { + List all = new UniqueList(); + all.addAll(firmeDigitali); + all.addAll(firmeApplicativo); + return all; + } - public void removeFirmeApplicativo(String codiceFiscale) { - FirmeDetail firmeDetailToRemove = null; - for (FirmeDetail firmeDetail : firmeApplicativo) { - if (codiceFiscale.equalsIgnoreCase(firmeDetail.getCfFirmatario())) { - firmeDetailToRemove = firmeDetail; - break; - } - } - firmeApplicativo.remove(firmeDetailToRemove); - } + public void removeFirmeApplicativo(String codiceFiscale) { + FirmeDetail firmeDetailToRemove = null; + for (FirmeDetail firmeDetail : firmeApplicativo) { + if (codiceFiscale.equalsIgnoreCase(firmeDetail.getCfFirmatario())) { + firmeDetailToRemove = firmeDetail; + break; + } + } + firmeApplicativo.remove(firmeDetailToRemove); + } } diff --git a/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/protocollo/model/Fascicolo.java b/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/protocollo/model/Fascicolo.java index c6ad64d8..5c78e0fa 100644 --- a/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/protocollo/model/Fascicolo.java +++ b/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/protocollo/model/Fascicolo.java @@ -3,7 +3,6 @@ package it.tref.liferay.portos.bo.shared.protocollo.model; public class Fascicolo { private int anno; - private int numero; public Fascicolo() {} diff --git a/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/protocollo/model/Protocollo.java b/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/protocollo/model/Protocollo.java index 7666e045..946eda2f 100644 --- a/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/protocollo/model/Protocollo.java +++ b/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/protocollo/model/Protocollo.java @@ -5,105 +5,80 @@ import java.util.List; public class Protocollo { - public enum TipoProtocollo { - INGRESSO, - USCITA - } - - private Date dataInserimento; - - private boolean chiuso; - - private String ufficioId; - - private String praticaId; - - private String utenteId; - - private String oggetto; - - private TipoProtocollo tipo; - - private List files; - - public boolean isChiuso() { - - return chiuso; - } - - public void setChiuso(boolean chiuso) { - - this.chiuso = chiuso; - } - - public String getUfficioId() { - - return ufficioId; - } - - public void setUfficioId(String ufficioId) { - - this.ufficioId = ufficioId; - } - - public String getUtenteId() { - - return utenteId; - } - - public void setUtenteId(String utenteId) { - - this.utenteId = utenteId; - } - - public String getOggetto() { - - return oggetto; - } - - public void setOggetto(String oggetto) { - - this.oggetto = oggetto; - } - - public TipoProtocollo getTipo() { - - return tipo; - } - - public void setTipo(TipoProtocollo tipo) { - - this.tipo = tipo; - } - - public List getFiles() { - - return files; - } - - public void setFiles(List files) { - - this.files = files; - } - - public String getPraticaId() { - - return praticaId; - } - - public void setPraticaId(String praticaId) { - - this.praticaId = praticaId; - } - - public Date getDataInserimento() { - - return dataInserimento; - } - - public void setDataInserimento(Date dataInserimento) { - - this.dataInserimento = dataInserimento; - } - + public enum TipoProtocollo { + INGRESSO, USCITA + } + + private Date dataInserimento; + private boolean chiuso; + private String ufficioId; + private String praticaId; + private String utenteId; + private String oggetto; + private TipoProtocollo tipo; + private List files; + + public boolean isChiuso() { + return chiuso; + } + + public void setChiuso(boolean chiuso) { + this.chiuso = chiuso; + } + + public String getUfficioId() { + return ufficioId; + } + + public void setUfficioId(String ufficioId) { + this.ufficioId = ufficioId; + } + + public String getUtenteId() { + return utenteId; + } + + public void setUtenteId(String utenteId) { + this.utenteId = utenteId; + } + + public String getOggetto() { + return oggetto; + } + + public void setOggetto(String oggetto) { + this.oggetto = oggetto; + } + + public TipoProtocollo getTipo() { + return tipo; + } + + public void setTipo(TipoProtocollo tipo) { + this.tipo = tipo; + } + + public List getFiles() { + return files; + } + + public void setFiles(List files) { + this.files = files; + } + + public String getPraticaId() { + return praticaId; + } + + public void setPraticaId(String praticaId) { + this.praticaId = praticaId; + } + + public Date getDataInserimento() { + return dataInserimento; + } + + public void setDataInserimento(Date dataInserimento) { + this.dataInserimento = dataInserimento; + } } diff --git a/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/FirmeUtil.java b/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/FirmeUtil.java index 9d5edb97..06e96a3a 100644 --- a/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/FirmeUtil.java +++ b/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/FirmeUtil.java @@ -6,8 +6,6 @@ import com.liferay.portal.kernel.json.JSONSerializer; import com.liferay.portal.kernel.util.UniqueList; import it.tref.liferay.portos.bo.shared.bean.FirmeBean; - - import it.tref.liferay.portos.bo.shared.bean.FirmeDetail; import java.util.Date; @@ -16,58 +14,59 @@ import java.util.Map; public class FirmeUtil { - public static String addFirma(FirmeBean firmeBean, String codiceFiscale) { - Date now = new Date(); - List firme = new UniqueList(); - firme.addAll(firmeBean.getFirmeApplicativo()); - firme.add(new FirmeDetail(codiceFiscale.toLowerCase(), now)); - firmeBean.setFirmeApplicativo(firme); - return serialize(firmeBean); - } + public static String addFirma(FirmeBean firmeBean, String codiceFiscale) { + Date now = new Date(); + List firme = new UniqueList(); + firme.addAll(firmeBean.getFirmeApplicativo()); + firme.add(new FirmeDetail(codiceFiscale.toLowerCase(), now)); + firmeBean.setFirmeApplicativo(firme); + return serialize(firmeBean); + } - public static String addFirmaDigitale(FirmeBean firmeBean, String codiceFiscale) { - Date now = null; - List firme = new UniqueList(); - firme.addAll(firmeBean.getFirmeDigitali()); - firme.add(new FirmeDetail(codiceFiscale.toLowerCase(), now)); - firmeBean.setFirmeDigitali(firme); - return serialize(firmeBean); - } + public static String addFirmaDigitale(FirmeBean firmeBean, String codiceFiscale) { + Date now = null; + List firme = new UniqueList(); + firme.addAll(firmeBean.getFirmeDigitali()); + firme.add(new FirmeDetail(codiceFiscale.toLowerCase(), now)); + firmeBean.setFirmeDigitali(firme); + return serialize(firmeBean); + } - public static String addFirma(String jsonFirmatari, String codiceFiscale) { - FirmeBean firmeBean = deserialize(jsonFirmatari); - return addFirma(firmeBean, codiceFiscale); - } + public static String addFirma(String jsonFirmatari, String codiceFiscale) { + FirmeBean firmeBean = deserialize(jsonFirmatari); + return addFirma(firmeBean, codiceFiscale); + } - public static String addFirmaDigitale(String jsonFirmatari, String codiceFiscale) { - FirmeBean firmeBean = deserialize(jsonFirmatari); - return addFirmaDigitale(firmeBean, codiceFiscale); + public static String addFirmaDigitale(String jsonFirmatari, String codiceFiscale) { + FirmeBean firmeBean = deserialize(jsonFirmatari); + return addFirmaDigitale(firmeBean, codiceFiscale); - } + } - public static String removeFirma(FirmeBean firmeBean, String codiceFiscale) { - firmeBean.removeFirmeApplicativo(codiceFiscale); - JSONSerializer jsonSerializer = JSONFactoryUtil.createJSONSerializer().exclude("class"); - return jsonSerializer.serializeDeep(firmeBean); - } + public static String removeFirma(FirmeBean firmeBean, String codiceFiscale) { + firmeBean.removeFirmeApplicativo(codiceFiscale); + JSONSerializer jsonSerializer = JSONFactoryUtil.createJSONSerializer().exclude("class"); + return jsonSerializer.serializeDeep(firmeBean); + } - public static String removeFirma(String jsonFirmatari, String codiceFiscale) { - FirmeBean firmeBean = deserialize(jsonFirmatari); - return removeFirma(firmeBean, codiceFiscale); - } + public static String removeFirma(String jsonFirmatari, String codiceFiscale) { + FirmeBean firmeBean = deserialize(jsonFirmatari); + return removeFirma(firmeBean, codiceFiscale); + } - public static String serialize(FirmeBean firmeBean) { - JSONSerializer jsonSerializer = JSONFactoryUtil.createJSONSerializer().exclude("class"); - return jsonSerializer.serializeDeep(firmeBean); - } + public static String serialize(FirmeBean firmeBean) { + JSONSerializer jsonSerializer = JSONFactoryUtil.createJSONSerializer().exclude("class"); + return jsonSerializer.serializeDeep(firmeBean); + } - public static FirmeBean deserialize(String jsonFirmatari) { - JSONDeserializer jsonSerializer = JSONFactoryUtil.createJSONDeserializer(); - Map> deserialized = - (Map>) jsonSerializer.deserialize(jsonFirmatari); - FirmeBean firmeBean = new FirmeBean(); - firmeBean.setFirmeApplicativo(deserialized.get("firmeApplicativo")); - firmeBean.setFirmeDigitali(deserialized.get("firmeDigitali")); - return firmeBean; - } + public static FirmeBean deserialize(String jsonFirmatari) { + JSONDeserializer jsonSerializer = JSONFactoryUtil.createJSONDeserializer(); + @SuppressWarnings("unchecked") + Map> deserialized = (Map>) jsonSerializer + .deserialize(jsonFirmatari); + FirmeBean firmeBean = new FirmeBean(); + firmeBean.setFirmeApplicativo(deserialized.get("firmeApplicativo")); + firmeBean.setFirmeDigitali(deserialized.get("firmeDigitali")); + return firmeBean; + } } diff --git a/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/SessionUtil.java b/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/SessionUtil.java new file mode 100644 index 00000000..b0fe0594 --- /dev/null +++ b/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/SessionUtil.java @@ -0,0 +1,66 @@ +package it.tref.liferay.portos.bo.shared.util; + +import java.util.Enumeration; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpSession; + +import com.liferay.portal.kernel.log.Log; +import com.liferay.portal.kernel.log.LogFactoryUtil; +import com.liferay.portal.kernel.util.StringPool; + +public class SessionUtil { + private final static String PREFIX = "SessionUtil."; + private final static String DETTPRATICA_CLASSNAME = "DettPratica."; + + private final static Log _log = LogFactoryUtil.getLog(SessionUtil.class); + + public static void setDettPraticaObject(HttpServletRequest request, long dettPraticaId, String label, + Object object) { + setObject(request, getLabel(DETTPRATICA_CLASSNAME, dettPraticaId, label), object); + } + + public static Object getDettPraticaObject(HttpServletRequest request, long dettPraticaId, String label) { + return getObject(request, getLabel(DETTPRATICA_CLASSNAME, dettPraticaId, label)); + } + + public static void cleanDettPraticaObjects(HttpServletRequest request, long dettPraticaId) { + cleanDettPraticaObjects(request.getSession(), dettPraticaId); + } + + public static void cleanDettPraticaObjects(HttpSession session, long dettPraticaId) { + String prefix = getPrefix(DETTPRATICA_CLASSNAME, dettPraticaId); + Enumeration names = session.getAttributeNames(); + while (names.hasMoreElements()) { + String name = names.nextElement(); + if (name.startsWith(prefix)) { + session.removeAttribute(name); + } + } + } + + public static Object getObject(HttpServletRequest request, String label) { + return getObject(request.getSession(), label); + } + + public static Object getObject(HttpSession session, String label) { + Object object = session.getAttribute(label); + return object; + } + + public static void setObject(HttpServletRequest request, String label, Object object) { + setObject(request.getSession(), label, object); + } + + public static void setObject(HttpSession session, String label, Object object) { + session.setAttribute(label, object); + } + + private static String getLabel(String className, long classPK, String label) { + return getPrefix(className, classPK) + StringPool.PERIOD + label; + } + + private static String getPrefix(String className, long classPK) { + return PREFIX + className + classPK; + } +} diff --git a/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/StatoPraticaConstants.java b/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/StatoPraticaConstants.java index f0e0df4a..0bc33032 100644 --- a/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/StatoPraticaConstants.java +++ b/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/StatoPraticaConstants.java @@ -3,91 +3,84 @@ package it.tref.liferay.portos.bo.shared.util; import java.util.LinkedHashMap; import java.util.Map; - public class StatoPraticaConstants { - public final static String SORTEGGIATA = "SO"; - - public final static String SOTTOPOSTA_A_PARERE = "SP"; - - public final static String RIFIUTATA = "RI"; - public final static String VIDIMATA = "VI"; - - public final static String CONFORME = "CO"; - public final static String NON_CONFORME = "NC"; - - public final static String INTEGRAZIONE = "IN"; - - public final static String VARIATA = "VA"; - - public static final String FINE_LAVORI = "FL"; - public static final String COLLAUDO = "CL"; - public static final String FINE_LAVORI_PARZIALE = "FP"; - public static final String COLLAUDO_PARZIALE = "CP"; - - public static final String ANNULLATA = "AL"; - - // public static final String INTEGRAZIONE_RIFIUTATA = "NI"; - public static final String INTEGRAZIONE_ACCETTATA = "SI"; - - /* Stati "virtuali" */ - public static final String CAMBIO_ISTRUTTORE = "CI"; - public final static String AUTORIZZATA = "AU"; - public final static String NON_AUTORIZZATA = "AN"; - public final static String ANNULLA_ISTANZA = "AI"; - public final static String VARIAZIONE_SOGGETTI = "VS"; - // public static final String ASSEGNATA = "AS"; - // public static final String ATTESA_FIRMA = "AF"; - // public static final String APPROVAZIONE = "AP"; - // public static final String FINE_LAVORI_CON_ANOMALIA = "FA"; - - private static final Map statusLabel; - private static final Map statusFilterLabel; - - static { - statusLabel = new LinkedHashMap(); - statusLabel.put(StatoPraticaConstants.SORTEGGIATA, "label.admingeniocivile.statopratica.sorteggiata"); - statusLabel.put(StatoPraticaConstants.SOTTOPOSTA_A_PARERE, "label.admingeniocivile.statopratica.sottopostaaparere"); - statusLabel.put(StatoPraticaConstants.VIDIMATA, "label.admingeniocivile.statopratica.vidimata"); - statusLabel.put(StatoPraticaConstants.CONFORME, "label.admingeniocivile.statopratica.conforme"); - statusLabel.put(StatoPraticaConstants.NON_CONFORME, "label.admingeniocivile.statopratica.nonconforme"); - statusLabel.put(StatoPraticaConstants.AUTORIZZATA, "label.admingeniocivile.statopratica.autorizzazione"); - statusLabel.put(StatoPraticaConstants.NON_AUTORIZZATA, "label.admingeniocivile.statopratica.autorizzazionenegata"); - statusLabel.put(StatoPraticaConstants.INTEGRAZIONE, "label.admingeniocivile.statopratica.integrazione"); - statusLabel.put(StatoPraticaConstants.RIFIUTATA, "label.admingeniocivile.statopratica.rifiutata"); - statusLabel.put(StatoPraticaConstants.FINE_LAVORI, "label.admingeniocivile.statopratica.finelavori"); - statusLabel.put(StatoPraticaConstants.COLLAUDO, "label.admingeniocivile.statopratica.collaudo"); - statusLabel.put(StatoPraticaConstants.FINE_LAVORI_PARZIALE, - "label.admingeniocivile.statopratica.finelavoriparziale"); - statusLabel.put(StatoPraticaConstants.COLLAUDO_PARZIALE, "label.admingeniocivile.statopratica.collaudoparziale"); - statusLabel.put(StatoPraticaConstants.ANNULLATA, "label.admingeniocivile.statopratica.annullata"); - statusLabel.put(StatoPraticaConstants.CAMBIO_ISTRUTTORE, "label.admingeniocivile.statopratica.cambiIstruttore"); - // statusLabel.put(StatoPraticaConstants.ASSEGNATA, - // "label.admingeniocivile.statopratica.assegnata"); - // statusLabel.put(StatoPraticaConstants.ATTESA_FIRMA, - // "label.admingeniocivile.statopratica.attesafirma"); - // statusLabel.put(StatoPraticaConstants.APPROVAZIONE, - // "label.admingeniocivile.statopratica.approvazione"); - // statusLabel.put(StatoPraticaConstants.FINE_LAVORI_CON_ANOMALIA, - // "label.admingeniocivile.statopratica.finelavorianomalia"); - - statusFilterLabel = new LinkedHashMap(); - for (String statoPratica : statusLabel.keySet()) { - if (/* !statoPratica.equals(StatoPraticaConstants.FINE_LAVORI_CON_ANOMALIA) && */ - !statoPratica.equals(StatoPraticaConstants.SORTEGGIATA)) { - statusFilterLabel.put(statoPratica, statusLabel.get(statoPratica)); - } - } - } - - public static String getStatusLabel(String statoPratica) { - - return getStatusLabelMap().get(statoPratica); - } - - public static Map getStatusLabelMap() { - - return statusLabel; - } + public final static String SORTEGGIATA = "SO"; + + public final static String SOTTOPOSTA_A_PARERE = "SP"; + + public final static String RIFIUTATA = "RI"; + public final static String VIDIMATA = "VI"; + + public final static String CONFORME = "CO"; + public final static String NON_CONFORME = "NC"; + + public final static String INTEGRAZIONE = "IN"; + + public final static String VARIATA = "VA"; + + public static final String FINE_LAVORI = "FL"; + public static final String COLLAUDO = "CL"; + public static final String FINE_LAVORI_PARZIALE = "FP"; + public static final String COLLAUDO_PARZIALE = "CP"; + + public static final String ANNULLATA = "AL"; + + public static final String INTEGRAZIONE_ACCETTATA = "SI"; + + /* Stati "virtuali" */ + public static final String CAMBIO_ISTRUTTORE = "CI"; + public final static String AUTORIZZATA = "AU"; + public final static String NON_AUTORIZZATA = "AN"; + public final static String ANNULLA_ISTANZA = "AI"; + public final static String VARIAZIONE_SOGGETTI = "VS"; + public static final String INVIO_AVVISO_MANUALE = "MA"; + + private static final Map statusLabel; + private static final Map statusFilterLabel; + + static { + statusLabel = new LinkedHashMap(); + statusLabel.put(StatoPraticaConstants.SORTEGGIATA, "label.admingeniocivile.statopratica.sorteggiata"); + statusLabel.put(StatoPraticaConstants.SOTTOPOSTA_A_PARERE, + "label.admingeniocivile.statopratica.sottopostaaparere"); + statusLabel.put(StatoPraticaConstants.VIDIMATA, "label.admingeniocivile.statopratica.vidimata"); + statusLabel.put(StatoPraticaConstants.CONFORME, "label.admingeniocivile.statopratica.conforme"); + statusLabel + .put(StatoPraticaConstants.NON_CONFORME, "label.admingeniocivile.statopratica.nonconforme"); + statusLabel.put(StatoPraticaConstants.AUTORIZZATA, + "label.admingeniocivile.statopratica.autorizzazione"); + statusLabel.put(StatoPraticaConstants.NON_AUTORIZZATA, + "label.admingeniocivile.statopratica.autorizzazionenegata"); + statusLabel.put(StatoPraticaConstants.INTEGRAZIONE, + "label.admingeniocivile.statopratica.integrazione"); + statusLabel.put(StatoPraticaConstants.RIFIUTATA, "label.admingeniocivile.statopratica.rifiutata"); + statusLabel.put(StatoPraticaConstants.FINE_LAVORI, "label.admingeniocivile.statopratica.finelavori"); + statusLabel.put(StatoPraticaConstants.COLLAUDO, "label.admingeniocivile.statopratica.collaudo"); + statusLabel.put(StatoPraticaConstants.FINE_LAVORI_PARZIALE, + "label.admingeniocivile.statopratica.finelavoriparziale"); + statusLabel.put(StatoPraticaConstants.COLLAUDO_PARZIALE, + "label.admingeniocivile.statopratica.collaudoparziale"); + statusLabel.put(StatoPraticaConstants.ANNULLATA, "label.admingeniocivile.statopratica.annullata"); + statusLabel.put(StatoPraticaConstants.CAMBIO_ISTRUTTORE, + "label.admingeniocivile.statopratica.cambiIstruttore"); + + statusFilterLabel = new LinkedHashMap(); + for (String statoPratica : statusLabel.keySet()) { + if (!statoPratica.equals(StatoPraticaConstants.SORTEGGIATA)) { + statusFilterLabel.put(statoPratica, statusLabel.get(statoPratica)); + } + } + } + + public static String getStatusLabel(String statoPratica) { + + return getStatusLabelMap().get(statoPratica); + } + + public static Map getStatusLabelMap() { + + return statusLabel; + } } diff --git a/liferay-plugins-sdk-6.2/shared/portos-firma-shared/.classpath b/liferay-plugins-sdk-6.2/shared/portos-firma-shared/.classpath new file mode 100644 index 00000000..b079ea96 --- /dev/null +++ b/liferay-plugins-sdk-6.2/shared/portos-firma-shared/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/liferay-plugins-sdk-6.2/shared/portos-firma-shared/.gitignore b/liferay-plugins-sdk-6.2/shared/portos-firma-shared/.gitignore new file mode 100644 index 00000000..840e7d31 --- /dev/null +++ b/liferay-plugins-sdk-6.2/shared/portos-firma-shared/.gitignore @@ -0,0 +1 @@ +/classes/ diff --git a/liferay-plugins-sdk-6.2/shared/portos-firma-shared/.project b/liferay-plugins-sdk-6.2/shared/portos-firma-shared/.project new file mode 100644 index 00000000..1b9b333c --- /dev/null +++ b/liferay-plugins-sdk-6.2/shared/portos-firma-shared/.project @@ -0,0 +1,17 @@ + + + portos-firma-shared + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + diff --git a/liferay-plugins-sdk-6.2/shared/portos-firma-shared/build.xml b/liferay-plugins-sdk-6.2/shared/portos-firma-shared/build.xml new file mode 100644 index 00000000..9c2b94ef --- /dev/null +++ b/liferay-plugins-sdk-6.2/shared/portos-firma-shared/build.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/liferay-plugins-sdk-6.2/shared/portos-firma-shared/src/it/tref/firma/shared/RestFile.java b/liferay-plugins-sdk-6.2/shared/portos-firma-shared/src/it/tref/firma/shared/RestFile.java new file mode 100644 index 00000000..d09f4f45 --- /dev/null +++ b/liferay-plugins-sdk-6.2/shared/portos-firma-shared/src/it/tref/firma/shared/RestFile.java @@ -0,0 +1,92 @@ +package it.tref.firma.shared; + +import java.io.Serializable; +import java.util.Date; + +public class RestFile implements Serializable { + private static final long serialVersionUID = 560778228734037313L; + + private Integer idFile; + private String nomeFile; + private Date dataInvio; + private String documentiType; + private String tipoPratica; + private String file; + + public RestFile() { + this.idFile = Integer.valueOf(-1); + this.dataInvio = new Date(); + this.nomeFile = ""; + this.documentiType = ""; + this.tipoPratica = ""; + setFile(""); + } + + public String toString() { + StringBuilder sb = new StringBuilder(); + if (this.idFile != null) { + sb.append("Id = "); + sb.append(this.idFile); + sb.append(" "); + } + if (this.documentiType != null) { + sb.append("Documenti type = "); + sb.append(this.documentiType); + sb.append(" "); + } + if (this.tipoPratica != null) { + sb.append("Tipo pratica= "); + sb.append(this.tipoPratica); + sb.append(" "); + } + return sb.toString(); + } + + public String getNomeFile() { + return nomeFile; + } + + public void setNomeFile(String nomeFile) { + this.nomeFile = nomeFile; + } + + public Date getDataInvio() { + return dataInvio; + } + + public void setDataInvio(Date dataInvio) { + this.dataInvio = dataInvio; + } + + public String getDocumentiType() { + return documentiType; + } + + public void setDocumentiType(String documentiType) { + this.documentiType = documentiType; + } + + public String getTipoPratica() { + return tipoPratica; + } + + public void setTipoPratica(String tipoPratica) { + this.tipoPratica = tipoPratica; + } + + public Integer getIdFile() { + return idFile; + } + + public void setIdFile(Integer idFile) { + this.idFile = idFile; + } + + public String getFile() { + return file; + } + + public void setFile(String file) { + this.file = file; + } +} diff --git a/liferay-plugins-sdk-6.2/shared/portos-firma-shared/src/it/tref/firma/shared/Risposta.java b/liferay-plugins-sdk-6.2/shared/portos-firma-shared/src/it/tref/firma/shared/Risposta.java new file mode 100644 index 00000000..4d396140 --- /dev/null +++ b/liferay-plugins-sdk-6.2/shared/portos-firma-shared/src/it/tref/firma/shared/Risposta.java @@ -0,0 +1,23 @@ +package it.tref.firma.shared; + +public class Risposta { + private int risposta = -100; + + private T obj = null; + + public int getRisposta() { + return risposta; + } + + public void setRisposta(int risposta) { + this.risposta = risposta; + } + + public T getObj() { + return obj; + } + + public void setObj(T obj) { + this.obj = obj; + } +} diff --git a/liferay-plugins-sdk-6.2/shared/portos-firma-shared/src/it/tref/firma/shared/RispostaCostanti.java b/liferay-plugins-sdk-6.2/shared/portos-firma-shared/src/it/tref/firma/shared/RispostaCostanti.java new file mode 100644 index 00000000..743d6a8a --- /dev/null +++ b/liferay-plugins-sdk-6.2/shared/portos-firma-shared/src/it/tref/firma/shared/RispostaCostanti.java @@ -0,0 +1,13 @@ +package it.tref.firma.shared; + +public interface RispostaCostanti { + public static final int NO_SET = -100; + + public static final int OK = 0; + public static final int NO_CONFIGURATION = 1; + public static final int NO_UTENTE = 2; + public static final int NO_LOGIN = 3; + public static final int NO_FILE = 4; + public static final int NO_PRATICA = 5; + public static final int ERRORE_APPLICAZIONE = 6; +} diff --git a/liferay-plugins-sdk-6.2/shared/portos-firma-shared/src/it/tref/firma/shared/Stile.java b/liferay-plugins-sdk-6.2/shared/portos-firma-shared/src/it/tref/firma/shared/Stile.java new file mode 100644 index 00000000..489209ad --- /dev/null +++ b/liferay-plugins-sdk-6.2/shared/portos-firma-shared/src/it/tref/firma/shared/Stile.java @@ -0,0 +1,26 @@ +package it.tref.firma.shared; + +import java.util.ArrayList; +import java.util.List; + +public class Stile { + private String logo = null; + + private List listNumrodlfProperty = new ArrayList<>(); + + public String getLogo() { + return logo; + } + + public void setLogo(String logo) { + this.logo = logo; + } + + public List getListNumrodlfProperty() { + return listNumrodlfProperty; + } + + public void setListNumrodlfProperty(List listNumrodlfProperty) { + this.listNumrodlfProperty = listNumrodlfProperty; + } +} \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/shared/portos-kaleo-shared/.classpath b/liferay-plugins-sdk-6.2/shared/portos-kaleo-shared/.classpath index 625fb07b..ab48b570 100644 --- a/liferay-plugins-sdk-6.2/shared/portos-kaleo-shared/.classpath +++ b/liferay-plugins-sdk-6.2/shared/portos-kaleo-shared/.classpath @@ -1,7 +1,7 @@ - + diff --git a/liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/.classpath b/liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/.classpath index 18005a46..70c5584d 100644 --- a/liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/.classpath +++ b/liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/.classpath @@ -1,7 +1,7 @@ - + diff --git a/liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/messaging/dto/MailTemplateMessage.java b/liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/messaging/dto/MailTemplateMessage.java index 4552f85b..7c6b62fc 100644 --- a/liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/messaging/dto/MailTemplateMessage.java +++ b/liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/messaging/dto/MailTemplateMessage.java @@ -6,42 +6,42 @@ import java.io.Serializable; import java.util.List; public class MailTemplateMessage implements Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - private long templateId; - private String templateName; - private String templateParam; - private List fileAttachments; + private long templateId; + private String templateName; + private String templateParam; + private List fileAttachments; - public long getTemplateId() { - return templateId; - } + public long getTemplateId() { + return templateId; + } - public void setTemplateId(long templateId) { - this.templateId = templateId; - } + public void setTemplateId(long templateId) { + this.templateId = templateId; + } - public String getTemplateParam() { - return templateParam; - } + public String getTemplateParam() { + return templateParam; + } - public void setTemplateParam(String templateParam) { - this.templateParam = templateParam; - } + public void setTemplateParam(String templateParam) { + this.templateParam = templateParam; + } - public List getFileAttachments() { - return fileAttachments; - } + public List getFileAttachments() { + return fileAttachments; + } - public void setFileAttachments(List fileAttachments) { - this.fileAttachments = fileAttachments; - } + public void setFileAttachments(List fileAttachments) { + this.fileAttachments = fileAttachments; + } - public String getTemplateName() { - return templateName; - } + public String getTemplateName() { + return templateName; + } - public void setTemplateName(String templateName) { - this.templateName = templateName; - } + public void setTemplateName(String templateName) { + this.templateName = templateName; + } } diff --git a/liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/messaging/dto/TemplateMessage.java b/liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/messaging/dto/TemplateMessage.java index 293fa983..2cdcd969 100644 --- a/liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/messaging/dto/TemplateMessage.java +++ b/liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/messaging/dto/TemplateMessage.java @@ -3,89 +3,88 @@ package it.tref.liferay.portos.mailmanager.shared.messaging.dto; import java.io.Serializable; public class TemplateMessage implements Serializable { - private static final long serialVersionUID = 1L; - - private long templateId; - private String templateName; - private String from; - private String[] to; - private String[] cc; - private String[] ccn; - private String subject; - private String body; - private boolean attachmentPermitted; - - - public long getTemplateId() { - return templateId; - } - - public void setTemplateId(long templateId) { - this.templateId = templateId; - } - - public String getTemplateName() { - return templateName; - } - - public void setTemplateName(String templateName) { - this.templateName = templateName; - } - - public String getFrom() { - return from; - } - - public void setFrom(String from) { - this.from = from; - } - - public String[] getTo() { - return to; - } - - public void setTo(String[] to) { - this.to = to; - } - - public String[] getCc() { - return cc; - } - - public void setCc(String[] cc) { - this.cc = cc; - } - - public String[] getCcn() { - return ccn; - } - - public void setCcn(String[] ccn) { - this.ccn = ccn; - } - - public String getBody() { - return body; - } - - public void setBody(String body) { - this.body = body; - } - - public String getSubject() { - return subject; - } - - public void setSubject(String subject) { - this.subject = subject; - } - - public boolean isAttachmentPermitted() { - return attachmentPermitted; - } - - public void setAttachmentPermitted(boolean attachmentPermitted) { - this.attachmentPermitted = attachmentPermitted; - } + private static final long serialVersionUID = 1L; + + private long templateId; + private String templateName; + private String from; + private String[] to; + private String[] cc; + private String[] ccn; + private String subject; + private String body; + private boolean attachmentPermitted; + + public long getTemplateId() { + return templateId; + } + + public void setTemplateId(long templateId) { + this.templateId = templateId; + } + + public String getTemplateName() { + return templateName; + } + + public void setTemplateName(String templateName) { + this.templateName = templateName; + } + + public String getFrom() { + return from; + } + + public void setFrom(String from) { + this.from = from; + } + + public String[] getTo() { + return to; + } + + public void setTo(String[] to) { + this.to = to; + } + + public String[] getCc() { + return cc; + } + + public void setCc(String[] cc) { + this.cc = cc; + } + + public String[] getCcn() { + return ccn; + } + + public void setCcn(String[] ccn) { + this.ccn = ccn; + } + + public String getBody() { + return body; + } + + public void setBody(String body) { + this.body = body; + } + + public String getSubject() { + return subject; + } + + public void setSubject(String subject) { + this.subject = subject; + } + + public boolean isAttachmentPermitted() { + return attachmentPermitted; + } + + public void setAttachmentPermitted(boolean attachmentPermitted) { + this.attachmentPermitted = attachmentPermitted; + } } diff --git a/liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/messaging/util/DestinationNames.java b/liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/messaging/util/DestinationNames.java index 9c9401ae..32c98502 100644 --- a/liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/messaging/util/DestinationNames.java +++ b/liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/messaging/util/DestinationNames.java @@ -2,12 +2,12 @@ package it.tref.liferay.portos.mailmanager.shared.messaging.util; public class DestinationNames { - public static final String SEND_MAIL = "liferay/mail_manager/add_email"; - public static final String SEND_TEMPLATE_MAIL = "liferay/mail_manager/add_email_by_template"; + public static final String SEND_MAIL = "liferay/mail_manager/add_email"; + public static final String SEND_TEMPLATE_MAIL = "liferay/mail_manager/add_email_by_template"; - public static final String SEND_MAIL_SYNC = "liferay/mail_manager/add_email_sync"; - public static final String SEND_TEMPLATE_MAIL_SYNC = "liferay/mail_manager/add_email_by_template_sync"; + public static final String SEND_MAIL_SYNC = "liferay/mail_manager/add_email_sync"; + public static final String SEND_TEMPLATE_MAIL_SYNC = "liferay/mail_manager/add_email_by_template_sync"; - public static final String EDIT_EMAIL_TEMPLATE = "liferay/mail_manager/edit_email_template"; + public static final String EDIT_EMAIL_TEMPLATE = "liferay/mail_manager/edit_email_template"; } diff --git a/liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/messaging/util/MailManagerUtil.java b/liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/messaging/util/MailManagerUtil.java index bddabc13..9e835c37 100644 --- a/liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/messaging/util/MailManagerUtil.java +++ b/liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/messaging/util/MailManagerUtil.java @@ -28,13 +28,13 @@ import javax.mail.internet.AddressException; import javax.mail.internet.InternetAddress; public class MailManagerUtil { - + private final static 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, ServiceContext serviceContext) throws AddressException, SystemException { - + InternetAddress fromInternetAddress = new InternetAddress(from, true); InternetAddress[] toInternetAddress = MailUtil.fromStringAddress(to); @@ -114,7 +114,7 @@ public class MailManagerUtil { String templateName, String[] to, String[] cc, String[] ccn, JSONObject templateVariables, List fileAttachments, boolean async, boolean checkPermission, ServiceContext serviceContext) throws SystemException { - + JSONObject templateParam = JSONFactoryUtil.createJSONObject(); templateParam.put(MailManagerConstants.TEMPLATE_PARAMETER_VARIABLES_KEY, templateVariables); diff --git a/liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/model/FileAttachment.java b/liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/model/FileAttachment.java index 43c558ce..9fcb4adf 100644 --- a/liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/model/FileAttachment.java +++ b/liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/model/FileAttachment.java @@ -12,90 +12,87 @@ import com.liferay.portlet.documentlibrary.service.DLFileEntryLocalServiceUtil; import java.io.File; import java.io.InputStream; - public class FileAttachment extends com.liferay.mail.model.FileAttachment { - public static final Log _log = LogFactoryUtil.getLog(FileAttachment.class); - - private long fileEntryId; - private byte[] bytes; - private String tipologia; - private String fileName; - - public FileAttachment() { - super(); - } - - public FileAttachment(File file, String fileName, String tipologia, long fileEntryId, byte[] bytes) { - super(file, fileName); - this.setTipologia(tipologia); - this.fileEntryId = fileEntryId; - this.setBytes(bytes); - } - - - public String getFileName() { - return fileName; - } - - public void setFileName(String fileName) { - this.fileName = fileName; - super.setFileName(fileName); - } - - - public long getFileEntryId() { - return fileEntryId; - } - - public void setFileEntryId(long fileEntryId) { - this.fileEntryId = fileEntryId; - } - - public byte[] getBytes() { - return bytes; - } - - public void setBytes(byte[] bytes) { - this.bytes = bytes; - } - - public String getTipologia() { - return tipologia; - } - - public void setTipologia(String tipologia) { - this.tipologia = tipologia; - } - - public File generateFile() { - - File result = null; - - try { - - if (Validator.isNotNull(super.getFile())) { - result = super.getFile(); - } else if (Validator.isNotNull(fileEntryId)) { - FileEntry fileEntry = DLAppLocalServiceUtil.getFileEntry(fileEntryId); - setFileName(fileEntry.getTitle() - + (Validator.isNotNull(fileEntry.getExtension()) ? "." + fileEntry.getExtension() : StringPool.BLANK)); - InputStream is = - DLFileEntryLocalServiceUtil.getFileAsStream(fileEntry.getFileEntryId(), fileEntry.getVersion(), false); - result = FileUtil.createTempFile(is); - is.close(); - result.deleteOnExit(); - } else if (Validator.isNotNull(bytes)) { - result = FileUtil.createTempFile(bytes); - result.deleteOnExit(); - } - - } catch (Exception e) { - _log.error("Error during getFile()", e); - } - setFile(result); - return result; - } - + public static final Log _log = LogFactoryUtil.getLog(FileAttachment.class); + + private long fileEntryId; + private byte[] bytes; + private String tipologia; + private String fileName; + + public FileAttachment() { + super(); + } + + public FileAttachment(File file, String fileName, String tipologia, long fileEntryId, byte[] bytes) { + super(file, fileName); + this.setTipologia(tipologia); + this.fileEntryId = fileEntryId; + this.setBytes(bytes); + } + + public String getFileName() { + return fileName; + } + + public void setFileName(String fileName) { + this.fileName = fileName; + super.setFileName(fileName); + } + + public long getFileEntryId() { + return fileEntryId; + } + + public void setFileEntryId(long fileEntryId) { + this.fileEntryId = fileEntryId; + } + + public byte[] getBytes() { + return bytes; + } + + public void setBytes(byte[] bytes) { + this.bytes = bytes; + } + + public String getTipologia() { + return tipologia; + } + + public void setTipologia(String tipologia) { + this.tipologia = tipologia; + } + + public File generateFile() { + + File result = null; + + try { + + if (Validator.isNotNull(super.getFile())) { + result = super.getFile(); + } else if (Validator.isNotNull(fileEntryId)) { + FileEntry fileEntry = DLAppLocalServiceUtil.getFileEntry(fileEntryId); + setFileName(fileEntry.getTitle() + + (Validator.isNotNull(fileEntry.getExtension()) ? "." + fileEntry.getExtension() + : StringPool.BLANK)); + InputStream is = DLFileEntryLocalServiceUtil.getFileAsStream(fileEntry.getFileEntryId(), + fileEntry.getVersion(), false); + result = FileUtil.createTempFile(is); + is.close(); + result.deleteOnExit(); + } else if (Validator.isNotNull(bytes)) { + result = FileUtil.createTempFile(bytes); + result.deleteOnExit(); + } + + } catch (Exception e) { + _log.error("Error during getFile()", e); + } + setFile(result); + return result; + } } diff --git a/liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/util/MailManagerConstants.java b/liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/util/MailManagerConstants.java index 6812e53f..a296e245 100644 --- a/liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/util/MailManagerConstants.java +++ b/liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/util/MailManagerConstants.java @@ -1,38 +1,37 @@ package it.tref.liferay.portos.mailmanager.shared.util; - public class MailManagerConstants { - public enum SendTemplateMode { + public enum SendTemplateMode { - REVIEW("R"), EDIT("E"); + REVIEW("R"), EDIT("E"); - private SendTemplateMode(String id) { - this.id = id; - } + private SendTemplateMode(String id) { + this.id = id; + } - private String id; + private String id; - public static SendTemplateMode parse(String id) { - for (SendTemplateMode item : values()) { - if (item.id.equals(id)) { - return item; - } - } - throw new IllegalArgumentException("Invalid SendTemplateMode value: " + id); - } + public static SendTemplateMode parse(String id) { + for (SendTemplateMode item : values()) { + if (item.id.equals(id)) { + return item; + } + } + throw new IllegalArgumentException("Invalid SendTemplateMode value: " + id); + } - public String getId() { - return id; - } - } + public String getId() { + return id; + } + } - public static final String TEMPLATE_PARAMETER_VARIABLES_KEY = "variables"; - public static final String TEMPLATE_PARAMETER_TO_KEY = "to"; - public static final String TEMPLATE_PARAMETER_CC_KEY = "cc"; - public static final String TEMPLATE_PARAMETER_CCN_KEY = "ccn"; + public static final String TEMPLATE_PARAMETER_VARIABLES_KEY = "variables"; + public static final String TEMPLATE_PARAMETER_TO_KEY = "to"; + public static final String TEMPLATE_PARAMETER_CC_KEY = "cc"; + public static final String TEMPLATE_PARAMETER_CCN_KEY = "ccn"; - public static final String MESSAGING_SEND_MODE_SYNC = "sync"; - public static final String MESSAGING_SEND_MODE_ASYNC = "async"; + public static final String MESSAGING_SEND_MODE_SYNC = "sync"; + public static final String MESSAGING_SEND_MODE_ASYNC = "async"; } diff --git a/liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/util/MailUtil.java b/liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/util/MailUtil.java index 0870629b..ca3ccd79 100644 --- a/liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/util/MailUtil.java +++ b/liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/util/MailUtil.java @@ -16,117 +16,118 @@ import javax.mail.internet.InternetAddress; public class MailUtil { - public static String fromInternetAddress(InternetAddress internetAddress) { - if (Validator.isNotNull(internetAddress)) { - return internetAddress.getAddress(); - } - return null; - } + public static String fromInternetAddress(InternetAddress internetAddress) { + if (Validator.isNotNull(internetAddress)) { + return internetAddress.getAddress(); + } + return null; + } - public static String[] fromInternetAddresses(InternetAddress[] internetAddresses) { - if (internetAddresses != null && internetAddresses.length > 0) { - String[] addresses = new String[internetAddresses.length]; - for (int i = 0; i < internetAddresses.length; i++) { - addresses[i] = internetAddresses[i].getAddress(); - } - return addresses; - } - return null; - } + public static String[] fromInternetAddresses(InternetAddress[] internetAddresses) { + if (internetAddresses != null && internetAddresses.length > 0) { + String[] addresses = new String[internetAddresses.length]; + for (int i = 0; i < internetAddresses.length; i++) { + addresses[i] = internetAddresses[i].getAddress(); + } + return addresses; + } + return null; + } - public static InternetAddress[] fromStringAddress(String[] address) throws AddressException { + public static InternetAddress[] fromStringAddress(String[] address) throws AddressException { - InternetAddress[] result = null; - if (address != null && address.length > 0) { - result = new InternetAddress[address.length]; - for (int i = 0; i < address.length; i++) { - result[i] = new InternetAddress(address[i], true); - } - } - return result; - } + InternetAddress[] result = null; + if (address != null && address.length > 0) { + result = new InternetAddress[address.length]; + for (int i = 0; i < address.length; i++) { + result[i] = new InternetAddress(address[i], true); + } + } + return result; + } - public static List getFileAttachments(UploadPortletRequest uploadPortletRequest) { - return getFileAttachments(uploadPortletRequest, Collections.emptyList()); - } + public static List getFileAttachments(UploadPortletRequest uploadPortletRequest) { + return getFileAttachments(uploadPortletRequest, Collections. emptyList()); + } - public static List getFileAttachments(UploadPortletRequest uploadPortletRequest, - List defaultFileAttachments) { + public static List getFileAttachments(UploadPortletRequest uploadPortletRequest, + List defaultFileAttachments) { - String allegatiIndexesString = uploadPortletRequest.getParameter("allegatiIndexes"); + String allegatiIndexesString = uploadPortletRequest.getParameter("allegatiIndexes"); - if (allegatiIndexesString == null) { - return defaultFileAttachments; - } + if (allegatiIndexesString == null) { + return defaultFileAttachments; + } - List fileAttachments = new ArrayList(); + List fileAttachments = new ArrayList(); - int[] allegatiIndexes = StringUtil.split(allegatiIndexesString, 0); + int[] allegatiIndexes = StringUtil.split(allegatiIndexesString, 0); - for (int allegatiIndex : allegatiIndexes) { - long fileEntryId = ParamUtil.getLong(uploadPortletRequest, "fileEntryId" + allegatiIndex); + for (int allegatiIndex : allegatiIndexes) { + long fileEntryId = ParamUtil.getLong(uploadPortletRequest, "fileEntryId" + allegatiIndex); - String fileName = uploadPortletRequest.getFileName("file" + allegatiIndex); - File file = uploadPortletRequest.getFile("file" + allegatiIndex); + String fileName = uploadPortletRequest.getFileName("file" + allegatiIndex); + File file = uploadPortletRequest.getFile("file" + allegatiIndex); - if (Validator.isNull(fileEntryId)) { - if (Validator.isNull(fileName)) { - continue; - } - } + if (Validator.isNull(fileEntryId)) { + if (Validator.isNull(fileName)) { + continue; + } + } - String tipologia = ParamUtil.getString(uploadPortletRequest, "tipologia" + allegatiIndex); + String tipologia = ParamUtil.getString(uploadPortletRequest, "tipologia" + allegatiIndex); - FileAttachment fileAttachment = new FileAttachment(); + FileAttachment fileAttachment = new FileAttachment(); - fileAttachment.setFileEntryId(fileEntryId); - fileAttachment.setTipologia(tipologia); - fileAttachment.setFileName(fileName); - fileAttachment.setFile(file); + fileAttachment.setFileEntryId(fileEntryId); + fileAttachment.setTipologia(tipologia); + fileAttachment.setFileName(fileName); + fileAttachment.setFile(file); - fileAttachments.add(fileAttachment); - } + fileAttachments.add(fileAttachment); + } - return fileAttachments; - } + return fileAttachments; + } - public static List getEmailFileAttachments( - UploadPortletRequest uploadPortletRequest) { - return getEmailFileAttachments(uploadPortletRequest, Collections.emptyList()); - } + public static List getEmailFileAttachments( + UploadPortletRequest uploadPortletRequest) { + return getEmailFileAttachments(uploadPortletRequest, + Collections. emptyList()); + } - public static List getEmailFileAttachments( - UploadPortletRequest uploadPortletRequest, List defaultFileAttachments) { + public static List getEmailFileAttachments( + UploadPortletRequest uploadPortletRequest, + List defaultFileAttachments) { - String allegatiIndexesString = uploadPortletRequest.getParameter("allegatiIndexes"); + String allegatiIndexesString = uploadPortletRequest.getParameter("allegatiIndexes"); - if (allegatiIndexesString == null) { - return defaultFileAttachments; - } + if (allegatiIndexesString == null) { + return defaultFileAttachments; + } - List fileAttachments = - new ArrayList(); + List fileAttachments = new ArrayList(); - int[] allegatiIndexes = StringUtil.split(allegatiIndexesString, 0); + int[] allegatiIndexes = StringUtil.split(allegatiIndexesString, 0); - for (int allegatiIndex : allegatiIndexes) { + for (int allegatiIndex : allegatiIndexes) { - String fileName = uploadPortletRequest.getFileName("file" + allegatiIndex); - File file = uploadPortletRequest.getFile("file" + allegatiIndex); + String fileName = uploadPortletRequest.getFileName("file" + allegatiIndex); + File file = uploadPortletRequest.getFile("file" + allegatiIndex); - if (Validator.isNull(fileName)) { - continue; - } + if (Validator.isNull(fileName)) { + continue; + } - com.liferay.mail.model.FileAttachment fileAttachment = new com.liferay.mail.model.FileAttachment(); + com.liferay.mail.model.FileAttachment fileAttachment = new com.liferay.mail.model.FileAttachment(); - fileAttachment.setFileName(fileName); - fileAttachment.setFile(file); + fileAttachment.setFileName(fileName); + fileAttachment.setFile(file); - fileAttachments.add(fileAttachment); - } + fileAttachments.add(fileAttachment); + } - return fileAttachments; - } + return fileAttachments; + } } diff --git a/liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/util/StringUtil.java b/liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/util/StringUtil.java index 2bb47066..a462ca05 100644 --- a/liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/util/StringUtil.java +++ b/liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/util/StringUtil.java @@ -1,14 +1,13 @@ package it.tref.liferay.portos.mailmanager.shared.util; - public class StringUtil extends com.liferay.portal.kernel.util.StringUtil { - public static String[] splitAndTrim(String s) { - String[] array = StringUtil.split(s); - for (int i = 0; i < array.length; i++) { - array[i] = StringUtil.trim(array[i]); - } - return array; - } + public static String[] splitAndTrim(String s) { + String[] array = StringUtil.split(s); + for (int i = 0; i < array.length; i++) { + array[i] = StringUtil.trim(array[i]); + } + return array; + } } diff --git a/liferay-plugins-sdk-6.2/tools/templates/portlet_spring_mvc_tmpl/docroot/WEB-INF/jsp/view.jsp b/liferay-plugins-sdk-6.2/tools/templates/portlet_spring_mvc_tmpl/docroot/WEB-INF/jsp/view.jsp index 9b667012..76d59438 100644 --- a/liferay-plugins-sdk-6.2/tools/templates/portlet_spring_mvc_tmpl/docroot/WEB-INF/jsp/view.jsp +++ b/liferay-plugins-sdk-6.2/tools/templates/portlet_spring_mvc_tmpl/docroot/WEB-INF/jsp/view.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%-- /** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. diff --git a/liferay-plugins-sdk-6.2/tools/templates/portlet_tmpl/docroot/view.jsp b/liferay-plugins-sdk-6.2/tools/templates/portlet_tmpl/docroot/view.jsp index 1b3ecefb..bc87ec0e 100644 --- a/liferay-plugins-sdk-6.2/tools/templates/portlet_tmpl/docroot/view.jsp +++ b/liferay-plugins-sdk-6.2/tools/templates/portlet_tmpl/docroot/view.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <% /** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. diff --git a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_instances/render_history_form_task.jsp b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_instances/render_history_form_task.jsp index 054e3171..4a6c12ed 100644 --- a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_instances/render_history_form_task.jsp +++ b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_instances/render_history_form_task.jsp @@ -1,38 +1,38 @@ - -<%@page import="com.liferay.portal.kernel.language.LanguageUtil"%> -<%@page import="java.io.Serializable"%> -<%@page import="java.util.Map.Entry"%> -<%@page import="java.util.ArrayList"%> - -<%@ include file="/html/portlet/workflow_instances/init.jsp" %> - -<% - -Map parameters = (Map) renderRequest.getAttribute("parameters"); - -%> - - - - - - - - - <%=LanguageUtil.get(pageContext, (String)entry.getKey()) %> - - - - <%= entry.getValue() %> - - - - - - +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@page import="com.liferay.portal.kernel.language.LanguageUtil"%> +<%@page import="java.io.Serializable"%> +<%@page import="java.util.Map.Entry"%> +<%@page import="java.util.ArrayList"%> + +<%@ include file="/html/portlet/workflow_instances/init.jsp" %> + +<% + +Map parameters = (Map) renderRequest.getAttribute("parameters"); + +%> + + + + + + + + + <%=LanguageUtil.get(pageContext, (String)entry.getKey()) %> + + + + <%= entry.getValue() %> + + + + + + \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_instances/workflow_logs.jspf b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_instances/workflow_logs.jspf index 2a652389..8a372bc5 100644 --- a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_instances/workflow_logs.jspf +++ b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_instances/workflow_logs.jspf @@ -1,316 +1,317 @@ -<%-- -/** - * 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. - */ ---%> - - -<%@page import="com.liferay.portal.kernel.json.JSONException"%> -<%@page import="com.liferay.portal.kernel.util.Validator"%> -<%@page import="com.liferay.portal.kernel.json.JSONFactoryUtil"%> -<%@page import="com.liferay.portal.kernel.json.JSONObject"%> -<%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%> - - - -> - - - - - - - - - -<% - -//ADT: bug bo id=33 -Map historyWorkflowEsitiLogs = (Map)request.getAttribute("historyWorkflowEsitiLogs"); - -for (WorkflowLog workflowLog : workflowLogs) { - Role curRole = null; - User curUser = null; - String actorName = null; - - if (workflowLog.getRoleId() != 0) { - curRole = RoleLocalServiceUtil.getRole(workflowLog.getRoleId()); - actorName = curRole.getDescriptiveName(); - } - else if (workflowLog.getUserId() != 0) { - curUser = UserLocalServiceUtil.getUser(workflowLog.getUserId()); - actorName = curUser.getFullName(); - } - String kaleoNodeName = null; - String transitionName = null; - - try { - JSONObject jsonObject = JSONFactoryUtil.createJSONObject(workflowLog.getState()); - kaleoNodeName = jsonObject.getString("kaleoNodeName"); - transitionName = jsonObject.getString("transitionName"); - } catch (JSONException e) { - kaleoNodeName = workflowLog.getState(); - } - -%> - - - - - - - - - - - - - - - - - <%--
- - - - -
- -
-
--%> - -<% -} -%> - -
DataDescrizioneAttivitCommento
- <%= dateFormatDateTime.format(workflowLog.getCreateDate()) %> - - - - -
- - - - - - - <% - //ADT: bug bo id=33 - String esito = (String)request.getAttribute("registra-esito-value"); - if (historyWorkflowEsitiLogs!=null&& historyWorkflowEsitiLogs.containsKey(workflowLog.getWorkflowLogId()) ){ - esito=historyWorkflowEsitiLogs.get(workflowLog.getWorkflowLogId()); - } - %> - - - - <% - String assegna = (String)request.getAttribute("assegna-value"); - %> - - - - - - - - - - - - - - -   - - - -
-
- -
- -
-
- -
- -
-
- - - -
- -
-
- - - <% - if (curRole == null) { - String assignerName = PortalUtil.getUserName(workflowLog.getAuditUserId(), StringPool.BLANK); - %> - -
- - - - - -
- - <% - } - else { - %> - -
- -
- - <% - } - %> - -
-
-
-
-
- <% - if(Validator.isNotNull(kaleoNodeName)){ - out.print(kaleoNodeName); - if(Validator.isNotNull(transitionName)){ - if("registra-esito".equalsIgnoreCase(transitionName)){ - //out.print(" ( " + (String)request.getAttribute("registra-esito-value") + " ) "); - //ADT BUG BO ID=33 - String esito = (String)request.getAttribute("registra-esito-value"); - if (historyWorkflowEsitiLogs!=null&& historyWorkflowEsitiLogs.containsKey(workflowLog.getWorkflowLogId()) ){ - esito=historyWorkflowEsitiLogs.get(workflowLog.getWorkflowLogId()); - } - out.print(" ( " + esito + " ) "); - - - } else if("assegna".equalsIgnoreCase(transitionName)){ - out.print(" ( " + (String)request.getAttribute("assegna-value") + " ) "); - } - - } - } - %> - - - -
-
-

<%= dateFormatDateTime.format(workflowLog.getCreateDate()) %>

-

- - <%= curUser.getFullName() %> - -

-
-
- <%= HtmlUtil.escape(workflowLog.getComment()) %> -
-
-
- -
- - - - \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_instances/workflow_task_action.jsp b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_instances/workflow_task_action.jsp index 86754a63..2e5b3094 100644 --- a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_instances/workflow_task_action.jsp +++ b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_instances/workflow_task_action.jsp @@ -1,259 +1,260 @@ -<%-- -/** - * 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. - */ ---%> - -<%@ include file="/html/portlet/workflow_instances/init.jsp" %> - -<% -String randomId = StringUtil.randomId(); - -ResultRow row = (ResultRow)request.getAttribute(WebKeys.SEARCH_CONTAINER_RESULT_ROW); - -WorkflowTask workflowTask = (WorkflowTask)row.getObject(); -%> - - - - - - - - - - - - - - - - - <% - List transitionNames = WorkflowTaskManagerUtil.getNextTransitionNames(company.getCompanyId(), user.getUserId(), workflowTask.getWorkflowTaskId()); - - for (String transitionName : transitionNames) { - String message = "proceed"; - - if (Validator.isNotNull(transitionName)) { - message = transitionName; - } - %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <% - Map data = new HashMap(); - - data.put("href-validation", validationURL); - data.put("href-render-form", renderFormURL); - %> - - - - <% - } - %> - - - -
- <%-- hook tref-ekaleo --%> -
-
- -
- - - var showPopup = function(url, title, renderFormURL, validationURL) { - var form = A.Node.create('
'); - - form.setAttribute('action', url); - form.setAttribute('method', 'POST'); - - var comments = A.one('#<%= randomId %>updateComments'); - - if (comments) { - form.append(comments); - - comments.show(); - } - - // reset - var formDiv = A.one('#<%= randomId %>form'); - if (formDiv) { - formDiv.empty(); - } - var formErrorDiv = A.one('#<%= randomId %>formError'); - if (formErrorDiv) { - formErrorDiv.empty(); - } - - var dialog = Liferay.Util.Window.getWindow( - { - dialog: { - bodyContent: form, - height: 620, - toolbars: { - footer: [ - { - label: Liferay.Language.get('ok'), - on: { - click: function() { - if (!validationURL) { - submitForm(form); - } else { - A.one('#<%= randomId %>formError').empty(); - A.io.request(validationURL, { - method: 'POST', - dataType: 'json', - on: { - start: function() { - A.one('#<%= randomId %>updateComments').loadingmask.show(); - A.all('.modal-footer').each(function(item, index, collection) { - item.all('button').each(function(item, index, collection) { - item.set('disabled', true); - item.setStyle('opacity', 0.5); - }); - }); - }, - complete: function() { - A.one('#<%= randomId %>updateComments').loadingmask.hide(); - }, - success: function() { - var responseData = this.get('responseData'); - if (responseData.valid) { - submitForm(form); - } else { - var message = "
" + Liferay.Language.get(responseData.message) + "
"; - A.one('#<%= randomId %>formError').html(message); - } - A.all('.modal-footer').each(function(item, index, collection) { - item.all('button').each(function(item, index, collection) { - item.set('disabled', false); - item.setStyle('opacity', 1); - }); - }); - } - } - }); - } - } - } - }, - { - label: Liferay.Language.get('cancel'), - on: { - click: function() { - dialog.hide(); - } - } - } - ] - }, - width: 550 - }, - title: title - } - ); - - A.one('#<%= randomId %>updateComments').plug(A.LoadingMask, {}); - - A.io.request(renderFormURL, { - dataType: 'html', - on: { - start: function() { - A.one('#<%= randomId %>updateComments').loadingmask.show(); - A.all('.modal-footer').each(function(item, index, collection) { - item.all('button').each(function(item, index, collection) { - item.set('disabled', true); - item.setStyle('opacity', 0.5); - }); - }); - }, - complete: function() { - A.one('#<%= randomId %>updateComments').loadingmask.hide(); - }, - success: function() { - var contentNode = A.one('#<%= randomId %>form'); - contentNode.html(this.get('responseData')); - A.all('.modal-footer').each(function(item, index, collection) { - item.all('button').each(function(item, index, collection) { - item.set('disabled', false); - item.setStyle('opacity', 1); - }); - }); - } - } - }); - }; - - A.all('.workflow-task-<%= randomId %> a').on( - 'click', - function(event) { - event.preventDefault(); - - var icon = event.currentTarget; - var title = icon.text(); - - var renderFormURL = icon.attr('data-href-render-form'); - var validationURL = icon.attr('data-href-validation'); - - showPopup(icon.attr('href'), title, renderFormURL, validationURL); - } - ); +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%-- +/** + * 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. + */ +--%> + +<%@ include file="/html/portlet/workflow_instances/init.jsp" %> + +<% +String randomId = StringUtil.randomId(); + +ResultRow row = (ResultRow)request.getAttribute(WebKeys.SEARCH_CONTAINER_RESULT_ROW); + +WorkflowTask workflowTask = (WorkflowTask)row.getObject(); +%> + + + + + + + + + + + + + + + + + <% + List transitionNames = WorkflowTaskManagerUtil.getNextTransitionNames(company.getCompanyId(), user.getUserId(), workflowTask.getWorkflowTaskId()); + + for (String transitionName : transitionNames) { + String message = "proceed"; + + if (Validator.isNotNull(transitionName)) { + message = transitionName; + } + %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <% + Map data = new HashMap(); + + data.put("href-validation", validationURL); + data.put("href-render-form", renderFormURL); + %> + + + + <% + } + %> + + + +
+ <%-- hook tref-ekaleo --%> +
+
+ +
+ + + var showPopup = function(url, title, renderFormURL, validationURL) { + var form = A.Node.create(''); + + form.setAttribute('action', url); + form.setAttribute('method', 'POST'); + + var comments = A.one('#<%= randomId %>updateComments'); + + if (comments) { + form.append(comments); + + comments.show(); + } + + // reset + var formDiv = A.one('#<%= randomId %>form'); + if (formDiv) { + formDiv.empty(); + } + var formErrorDiv = A.one('#<%= randomId %>formError'); + if (formErrorDiv) { + formErrorDiv.empty(); + } + + var dialog = Liferay.Util.Window.getWindow( + { + dialog: { + bodyContent: form, + height: 620, + toolbars: { + footer: [ + { + label: Liferay.Language.get('ok'), + on: { + click: function() { + if (!validationURL) { + submitForm(form); + } else { + A.one('#<%= randomId %>formError').empty(); + A.io.request(validationURL, { + method: 'POST', + dataType: 'json', + on: { + start: function() { + A.one('#<%= randomId %>updateComments').loadingmask.show(); + A.all('.modal-footer').each(function(item, index, collection) { + item.all('button').each(function(item, index, collection) { + item.set('disabled', true); + item.setStyle('opacity', 0.5); + }); + }); + }, + complete: function() { + A.one('#<%= randomId %>updateComments').loadingmask.hide(); + }, + success: function() { + var responseData = this.get('responseData'); + if (responseData.valid) { + submitForm(form); + } else { + var message = "
" + Liferay.Language.get(responseData.message) + "
"; + A.one('#<%= randomId %>formError').html(message); + } + A.all('.modal-footer').each(function(item, index, collection) { + item.all('button').each(function(item, index, collection) { + item.set('disabled', false); + item.setStyle('opacity', 1); + }); + }); + } + } + }); + } + } + } + }, + { + label: Liferay.Language.get('cancel'), + on: { + click: function() { + dialog.hide(); + } + } + } + ] + }, + width: 550 + }, + title: title + } + ); + + A.one('#<%= randomId %>updateComments').plug(A.LoadingMask, {}); + + A.io.request(renderFormURL, { + dataType: 'html', + on: { + start: function() { + A.one('#<%= randomId %>updateComments').loadingmask.show(); + A.all('.modal-footer').each(function(item, index, collection) { + item.all('button').each(function(item, index, collection) { + item.set('disabled', true); + item.setStyle('opacity', 0.5); + }); + }); + }, + complete: function() { + A.one('#<%= randomId %>updateComments').loadingmask.hide(); + }, + success: function() { + var contentNode = A.one('#<%= randomId %>form'); + contentNode.html(this.get('responseData')); + A.all('.modal-footer').each(function(item, index, collection) { + item.all('button').each(function(item, index, collection) { + item.set('disabled', false); + item.setStyle('opacity', 1); + }); + }); + } + } + }); + }; + + A.all('.workflow-task-<%= randomId %> a').on( + 'click', + function(event) { + event.preventDefault(); + + var icon = event.currentTarget; + var title = icon.text(); + + var renderFormURL = icon.attr('data-href-render-form'); + var validationURL = icon.attr('data-href-validation'); + + showPopup(icon.attr('href'), title, renderFormURL, validationURL); + } + );
\ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_tasks/edit_workflow_task.jsp b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_tasks/edit_workflow_task.jsp index 9220df05..24a42078 100644 --- a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_tasks/edit_workflow_task.jsp +++ b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_tasks/edit_workflow_task.jsp @@ -1,350 +1,351 @@ -<%-- -/** - * 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. - */ ---%> - -<%@page import="com.liferay.portal.kernel.util.ParamUtil"%> -<%@ include file="/html/portlet/workflow_tasks/init.jsp" %> - -<% -String randomId = StringUtil.randomId(); - -String redirect = ParamUtil.getString(request, "redirect"); - - -WorkflowTask workflowTask = (WorkflowTask)request.getAttribute(WebKeys.WORKFLOW_TASK); - -WorkflowInstance workflowInstance = WorkflowInstanceManagerUtil.getWorkflowInstance(company.getCompanyId(), workflowTask.getWorkflowInstanceId()); - -Map workflowContext = workflowInstance.getWorkflowContext(); - -long companyId = GetterUtil.getLong((String)workflowContext.get(WorkflowConstants.CONTEXT_COMPANY_ID)); -long groupId = GetterUtil.getLong((String)workflowContext.get(WorkflowConstants.CONTEXT_GROUP_ID)); -String className = (String)workflowContext.get(WorkflowConstants.CONTEXT_ENTRY_CLASS_NAME); -long classPK = GetterUtil.getLong((String)workflowContext.get(WorkflowConstants.CONTEXT_ENTRY_CLASS_PK)); - -WorkflowHandler workflowHandler = WorkflowHandlerRegistryUtil.getWorkflowHandler(className); - -AssetRenderer assetRenderer = workflowHandler.getAssetRenderer(classPK); -AssetRendererFactory assetRendererFactory = workflowHandler.getAssetRendererFactory(); - -AssetEntry assetEntry = null; - -if (assetRenderer != null) { - assetEntry = assetRendererFactory.getAssetEntry(assetRendererFactory.getClassName(), assetRenderer.getClassPK()); -} - -String headerTitle = LanguageUtil.get(pageContext, workflowTask.getName()); - -headerTitle = headerTitle.concat(StringPool.COLON + StringPool.SPACE + workflowHandler.getTitle(classPK, locale)); - -boolean showEditURL = false; - -if ((workflowTask.getAssigneeUserId() == user.getUserId()) && !workflowTask.isCompleted()) { - showEditURL = true; -} - -PortletURL editPortletURL = workflowHandler.getURLEdit(classPK, liferayPortletRequest, liferayPortletResponse); - -String viewFullContentURLString = null; - -if (assetRenderer.isPreviewInContext()) { - viewFullContentURLString = assetRenderer.getURLViewInContext((LiferayPortletRequest)renderRequest, (LiferayPortletResponse)renderResponse, null); -} -else { - PortletURL viewFullContentURL = renderResponse.createRenderURL(); - - viewFullContentURL.setParameter("struts_action", "/workflow_tasks/view_content"); - viewFullContentURL.setParameter("redirect", currentURL); - - if (assetEntry != null) { - viewFullContentURL.setParameter("assetEntryId", String.valueOf(assetEntry.getEntryId())); - viewFullContentURL.setParameter("assetEntryVersionId", String.valueOf(classPK)); - } - - if (assetRendererFactory != null) { - viewFullContentURL.setParameter("type", assetRendererFactory.getType()); - } - - viewFullContentURL.setParameter("showEditURL", String.valueOf(showEditURL)); - viewFullContentURL.setParameter("workflowAssetPreview", Boolean.TRUE.toString()); - - viewFullContentURLString = viewFullContentURL.toString(); -} - -request.setAttribute(WebKeys.WORKFLOW_ASSET_PREVIEW, Boolean.TRUE); -%> - -<%-- - - - ---%> - -
-
-

Gestione Attivit

-
- -
-
- - -
- - - -
- - - - - - - - - - - -
- -
- - - - - -
-
- - - - -
- -
- - - - - -
- - - <%= workflowTask.getDescription() %> - -
-
- - - - - <% - String path = workflowHandler.render(classPK, renderRequest, renderResponse, AssetRenderer.TEMPLATE_ABSTRACT); - - request.setAttribute(WebKeys.ASSET_RENDERER, assetRenderer); - request.setAttribute(WebKeys.ASSET_PUBLISHER_ABSTRACT_LENGTH, 200); - %> - - - - <%= workflowHandler.getSummary(classPK, locale) %> - - - - - - - - - - - <% - List logTypes = new ArrayList(); - - logTypes.add(WorkflowLog.TASK_ASSIGN); - logTypes.add(WorkflowLog.TASK_COMPLETION); - logTypes.add(WorkflowLog.TASK_UPDATE); - logTypes.add(WorkflowLog.TRANSITION); - - List workflowLogs = WorkflowLogManagerUtil.getWorkflowLogsByWorkflowInstance(company.getCompanyId(), workflowTask.getWorkflowInstanceId(), logTypes, QueryUtil.ALL_POS, QueryUtil.ALL_POS, WorkflowComparatorFactoryUtil.getLogCreateDateComparator(true)); - %> - - <%@ include file="/html/portlet/workflow_instances/workflow_logs.jspf" %> - - - - - - -
- -
-
- -
- -

Azioni

-
-
- - <% - request.removeAttribute(WebKeys.SEARCH_CONTAINER_RESULT_ROW); - %> - - - - - - - -
-
- - - - - - - - - - - var onTaskClickFn = A.rbind('onTaskClick', Liferay.WorkflowTasks, ''); - - Liferay.delegateClick('<%= randomId %>taskAssignToMeLink', onTaskClickFn); - Liferay.delegateClick('<%= randomId %>taskAssignLink', onTaskClickFn); -<%-- Liferay.delegateClick('<%= randomId %>taskDueDateLink', onTaskClickFn); --%> - - -<% -PortalUtil.addPortletBreadcrumbEntry(request, headerTitle, currentURL); +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%-- +/** + * 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. + */ +--%> + +<%@page import="com.liferay.portal.kernel.util.ParamUtil"%> +<%@ include file="/html/portlet/workflow_tasks/init.jsp" %> + +<% +String randomId = StringUtil.randomId(); + +String redirect = ParamUtil.getString(request, "redirect"); + + +WorkflowTask workflowTask = (WorkflowTask)request.getAttribute(WebKeys.WORKFLOW_TASK); + +WorkflowInstance workflowInstance = WorkflowInstanceManagerUtil.getWorkflowInstance(company.getCompanyId(), workflowTask.getWorkflowInstanceId()); + +Map workflowContext = workflowInstance.getWorkflowContext(); + +long companyId = GetterUtil.getLong((String)workflowContext.get(WorkflowConstants.CONTEXT_COMPANY_ID)); +long groupId = GetterUtil.getLong((String)workflowContext.get(WorkflowConstants.CONTEXT_GROUP_ID)); +String className = (String)workflowContext.get(WorkflowConstants.CONTEXT_ENTRY_CLASS_NAME); +long classPK = GetterUtil.getLong((String)workflowContext.get(WorkflowConstants.CONTEXT_ENTRY_CLASS_PK)); + +WorkflowHandler workflowHandler = WorkflowHandlerRegistryUtil.getWorkflowHandler(className); + +AssetRenderer assetRenderer = workflowHandler.getAssetRenderer(classPK); +AssetRendererFactory assetRendererFactory = workflowHandler.getAssetRendererFactory(); + +AssetEntry assetEntry = null; + +if (assetRenderer != null) { + assetEntry = assetRendererFactory.getAssetEntry(assetRendererFactory.getClassName(), assetRenderer.getClassPK()); +} + +String headerTitle = LanguageUtil.get(pageContext, workflowTask.getName()); + +headerTitle = headerTitle.concat(StringPool.COLON + StringPool.SPACE + workflowHandler.getTitle(classPK, locale)); + +boolean showEditURL = false; + +if ((workflowTask.getAssigneeUserId() == user.getUserId()) && !workflowTask.isCompleted()) { + showEditURL = true; +} + +PortletURL editPortletURL = workflowHandler.getURLEdit(classPK, liferayPortletRequest, liferayPortletResponse); + +String viewFullContentURLString = null; + +if (assetRenderer.isPreviewInContext()) { + viewFullContentURLString = assetRenderer.getURLViewInContext((LiferayPortletRequest)renderRequest, (LiferayPortletResponse)renderResponse, null); +} +else { + PortletURL viewFullContentURL = renderResponse.createRenderURL(); + + viewFullContentURL.setParameter("struts_action", "/workflow_tasks/view_content"); + viewFullContentURL.setParameter("redirect", currentURL); + + if (assetEntry != null) { + viewFullContentURL.setParameter("assetEntryId", String.valueOf(assetEntry.getEntryId())); + viewFullContentURL.setParameter("assetEntryVersionId", String.valueOf(classPK)); + } + + if (assetRendererFactory != null) { + viewFullContentURL.setParameter("type", assetRendererFactory.getType()); + } + + viewFullContentURL.setParameter("showEditURL", String.valueOf(showEditURL)); + viewFullContentURL.setParameter("workflowAssetPreview", Boolean.TRUE.toString()); + + viewFullContentURLString = viewFullContentURL.toString(); +} + +request.setAttribute(WebKeys.WORKFLOW_ASSET_PREVIEW, Boolean.TRUE); +%> + +<%-- + + + +--%> + +
+
+

Gestione Attività

+
+ +
+
+ + +
+ + + +
+ + + + + + + + + + + +
+ +
+ + + + + +
+
+ + + + +
+ +
+ + + + + +
+ + + <%= workflowTask.getDescription() %> + +
+
+ + + + + <% + String path = workflowHandler.render(classPK, renderRequest, renderResponse, AssetRenderer.TEMPLATE_ABSTRACT); + + request.setAttribute(WebKeys.ASSET_RENDERER, assetRenderer); + request.setAttribute(WebKeys.ASSET_PUBLISHER_ABSTRACT_LENGTH, 200); + %> + + + + <%= workflowHandler.getSummary(classPK, locale) %> + + + + + + + + + + + <% + List logTypes = new ArrayList(); + + logTypes.add(WorkflowLog.TASK_ASSIGN); + logTypes.add(WorkflowLog.TASK_COMPLETION); + logTypes.add(WorkflowLog.TASK_UPDATE); + logTypes.add(WorkflowLog.TRANSITION); + + List workflowLogs = WorkflowLogManagerUtil.getWorkflowLogsByWorkflowInstance(company.getCompanyId(), workflowTask.getWorkflowInstanceId(), logTypes, QueryUtil.ALL_POS, QueryUtil.ALL_POS, WorkflowComparatorFactoryUtil.getLogCreateDateComparator(true)); + %> + + <%@ include file="/html/portlet/workflow_instances/workflow_logs.jspf" %> + + + + + + +
+ +
+
+ +
+ +

Azioni

+
+
+ + <% + request.removeAttribute(WebKeys.SEARCH_CONTAINER_RESULT_ROW); + %> + + + + + + + +
+
+ + + + + + + + + + + var onTaskClickFn = A.rbind('onTaskClick', Liferay.WorkflowTasks, ''); + + Liferay.delegateClick('<%= randomId %>taskAssignToMeLink', onTaskClickFn); + Liferay.delegateClick('<%= randomId %>taskAssignLink', onTaskClickFn); +<%-- Liferay.delegateClick('<%= randomId %>taskDueDateLink', onTaskClickFn); --%> + + +<% +PortalUtil.addPortletBreadcrumbEntry(request, headerTitle, currentURL); %> \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_tasks/render_form_task.jsp b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_tasks/render_form_task.jsp index c7b3072a..5cbea706 100644 --- a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_tasks/render_form_task.jsp +++ b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_tasks/render_form_task.jsp @@ -1,342 +1,342 @@ - -<%@page import="com.liferay.portal.kernel.util.MapUtil"%> -<%@page import="java.io.UnsupportedEncodingException"%> -<%@page import="org.apache.commons.codec.binary.Hex"%> -<%@page import="com.liferay.portal.kernel.util.UnicodeFormatter"%> -<%@page import="com.liferay.portlet.dynamicdatamapping.service.DDMStructureLocalServiceUtil"%> -<%@page import="com.liferay.portal.kernel.util.StringUtil"%> -<%@page import="org.htmlparser.Node"%> -<%@page import="org.htmlparser.tags.OptionTag"%> -<%@page import="org.htmlparser.tags.TextareaTag"%> -<%@page import="org.htmlparser.tags.InputTag"%> -<%@page import="org.htmlparser.tags.SelectTag"%> -<%@page import="org.htmlparser.tags.Div" %> -<%@page import="org.htmlparser.tags.LabelTag" %> -<%@page import="org.htmlparser.nodes.TagNode"%> -<%@page import="org.htmlparser.nodes.TextNode"%> -<%@page import="org.htmlparser.util.NodeList"%> -<%@page import="org.htmlparser.Parser"%> -<%@page import="org.htmlparser.util.ParserException"%> -<%@page import="javax.portlet.RenderResponse"%> -<%@page import="java.util.Iterator"%> -<%@page import="java.util.Map.Entry"%> -<%@page import="com.liferay.portal.kernel.util.LocaleUtil"%> -<%@page import="com.liferay.portal.kernel.util.Validator"%> -<%@page import="com.liferay.portal.kernel.util.ParamUtil"%> -<%@page import="java.util.Set"%> -<%@page import="java.util.Locale"%> -<%@page import="com.liferay.portlet.dynamicdatamapping.storage.StorageEngineUtil"%> -<%@page import="com.liferay.portlet.dynamicdatamapping.storage.Fields"%> -<%@page import="com.liferay.portlet.dynamicdatalists.model.DDLRecordSet"%> -<%@page import="com.liferay.portlet.dynamicdatalists.service.DDLRecordSetServiceUtil"%> -<%@page import="com.liferay.portlet.dynamicdatalists.model.DDLRecordVersion"%> -<%@page import="com.liferay.portal.kernel.bean.BeanParamUtil"%> -<%@page import="com.liferay.portlet.dynamicdatalists.model.DDLRecord"%> -<%@page import="com.liferay.portal.kernel.util.StringPool"%> -<%@page import="com.liferay.portlet.dynamicdatamapping.model.DDMStructure"%> -<%@page import="com.liferay.portlet.dynamicdatamapping.model.DDMTemplate"%> - -<%@ include file="/html/portlet/workflow_tasks/init.jsp" %> - - -<% - String classPkForCarichiLavoro = (String) renderRequest.getAttribute("classPkForCarichiLavoro"); -%> - -
- - - - - Visualizza Carichi di Lavoro Istruttori -
-
- -<% - -long ddmTemplateId = (Long) renderRequest.getAttribute("ddmTemplateId"); -long ddmStructureId = (Long) renderRequest.getAttribute("ddmStructureId"); -Map parameters = (Map) renderRequest.getAttribute("parameters"); -String prefix = (String) renderRequest.getAttribute("prefix"); -String suffix = (String) renderRequest.getAttribute("suffix"); -Map>> fieldNameOptions - = (Map>>) renderRequest.getAttribute("fieldNameOptions"); - -String redirect = StringPool.BLANK; - -DDLRecord record = null; - -long recordId = BeanParamUtil.getLong(record, request, "recordId"); - -DDLRecordVersion recordVersion = null; - -if (record != null) { - recordVersion = record.getLatestRecordVersion(); -} - -DDMStructure ddmStructure = DDMStructureLocalServiceUtil.getDDMStructure(ddmStructureId); - -Fields fields = null; - -if (recordVersion != null) { - fields = StorageEngineUtil.getFields(recordVersion.getDDMStorageId()); -} - -Locale[] availableLocales = new Locale[0]; - -if (fields != null) { - Set availableLocalesSet = fields.getAvailableLocales(); - - availableLocales = availableLocalesSet.toArray(new Locale[availableLocalesSet.size()]); -} - -String defaultLanguageId = StringPool.BLANK; - -if (Validator.isNull(defaultLanguageId)) { - defaultLanguageId = themeDisplay.getLanguageId(); - - if (fields != null) { - defaultLanguageId = LocaleUtil.toLanguageId(fields.getDefaultLocale()); - } -} - -String languageId = defaultLanguageId; - -boolean translating = false; - -if (!defaultLanguageId.equals(languageId)) { - translating = true; -} - -if (translating) { - redirect = currentURL; -} - -long classNameId = PortalUtil.getClassNameId(DDMStructure.class); - -long classPK = ddmStructure.getStructureId(); - -if (ddmTemplateId > 0) { - classNameId = PortalUtil.getClassNameId(DDMTemplate.class); - - classPK = ddmTemplateId; -} -%> - - - - - -<%= normalize(html, parameters, fieldNameOptions, renderResponse, prefix, suffix) %> - -<%! -private String normalize(String html, Map parameters, - Map>> fieldNameOptions, - RenderResponse renderResponse, String prefix, String suffix) { - - if (Validator.isNull(html)) { - return StringPool.BLANK; - } - - // replace portlet namespace + random namespace - html = html.replaceAll("name=\"" + renderResponse.getNamespace(), "name=\""); - - try { - - Parser parser = Parser.createParser(html, StringPool.UTF8); - NodeList nodeList = (NodeList) parser.parse(null); - - for (int i = 0; i < nodeList.size(); i++) { - filter(nodeList.elementAt(i), parameters, fieldNameOptions, prefix, suffix); - } - - html = nodeList.toHtml(); - - } catch (ParserException e) { - } - - // add prefix + suffix - html = html.replaceAll("name=\"(.*?)\"", "name=\"" + prefix + "$1" + suffix + "\""); - - // ignore ddm fields display - html = html.replaceAll("name=\"" + prefix + "_fieldsDisplay" + suffix, "name=\"_fieldsDisplay\""); - - return html; -} - -private void filter(Node node, Map parameters, - Map>> fieldNameOptions, - String prefix, String suffix) { - - if (node != null) { - - if (node instanceof SelectTag || node instanceof InputTag || node instanceof TextareaTag) { - - TagNode tag = (TagNode) node; - - String name = tag.getAttribute("name"); - - String namespace = getNamespace(node); - if (Validator.isNotNull(namespace)) { - name = name.replaceAll(namespace, StringPool.BLANK); - tag.setAttribute("name", name); - } - - String value = null; - - if (parameters.containsKey(name)) { - - value = parameters.get(name).toString(); - - if (node instanceof TextareaTag) { - if (node.getChildren() != null && node.getChildren().size() > 0) { - TextNode text = (TextNode) node.getChildren().elementAt(0); - text.setText(value); - } else { - NodeList nodeList = new NodeList(); - nodeList.add(new TextNode(value)); - node.setChildren(nodeList); - } - } else if (tag instanceof SelectTag) { - if (node.getChildren() != null && node.getChildren().size() > 0) { - for (int i = 0; i < node.getChildren().size(); i++) { - if (node.getChildren().elementAt(i) instanceof OptionTag) { - TagNode optionTag = (TagNode) node.getChildren().elementAt(i); - String optionValue = optionTag.getAttribute("value"); - optionValue = replaceHex(optionValue); - String[] values = StringUtil.split(value, StringPool.COMMA); - for (String v : values) { - if (StringUtil.trim(v).equals(optionValue)) { - optionTag.setAttribute("selected", "selected"); - } - } - } - } - } - } else { - String type = tag.getAttribute("type"); - if (type.equals("checkbox")) { - value = parameters.get( - StringUtil.replace(name, "Checkbox", StringPool.BLANK)).toString(); - if (value.equalsIgnoreCase("true")) { - tag.setAttribute("checked", "checked"); - } - } else if (type.equals("radio")) { - String valueInput = tag.getAttribute("value"); - valueInput = replaceHex(valueInput); - if (value.equals(valueInput)) { - tag.setAttribute("checked", "checked"); - } - } else { - tag.setAttribute("value", value, '"'); - } - } - } - - // select singolo o multiplo senza opzioni fisse - if (tag instanceof SelectTag) { - List> options = fieldNameOptions.get(name); - if (options != null && !options.isEmpty()) { - NodeList optionsTag = new NodeList(); - for (Map option : options) { - String label = MapUtil.getString(option, "label"); - String valueOption = MapUtil.getString(option, "value"); - boolean defaultValue = MapUtil.getBoolean(option, "default"); - // new option - OptionTag optionTag = new OptionTag(); - optionTag.setAttribute("value", valueOption, '"'); - if (defaultValue && !parameters.containsKey(name)) { - optionTag.setAttribute("selected", "selected"); - } else if (Validator.isNotNull(value) && value.equals(valueOption)) { - optionTag.setAttribute("selected", "selected"); - } - TextNode textNode = new TextNode(label); - NodeList nodeList = new NodeList(); - nodeList.add(textNode); - optionTag.setChildren(nodeList); - optionsTag.add(optionTag); - } - tag.setChildren(optionsTag); - } - } else if ("radio".equals(tag.getAttribute("type"))) { - List> options = fieldNameOptions.get(name); - if(options!=null){ - for (Map option : options) { - String label = MapUtil.getString(option, "label"); - String valueOption = MapUtil.getString(option, "value"); - boolean defaultValue = MapUtil.getBoolean(option, "default"); - if(tag.getAttribute("value").equals(valueOption)){ - tag.getNextSibling().setText(label); - } - } - } - } - } - - if (node.getChildren() != null) { - for (int i = 0; i < node.getChildren().size(); i++) { - filter(node.getChildren().elementAt(i), parameters, fieldNameOptions, prefix, suffix); - } - } - } -} - -private String getNamespace(Node node) { - - String namespace = null; - boolean trovato = false; - Node parent = node.getParent(); - - while (!trovato && parent != null) { - if (parent instanceof TagNode) { - TagNode tag = (TagNode) parent; - String dataFieldNamespace = tag.getAttribute("data-fieldnamespace"); - if (Validator.isNotNull(dataFieldNamespace)) { - trovato = true; - namespace = dataFieldNamespace; - } - } - if (!trovato) { - parent = parent.getParent(); - } - } - - return namespace; -} - -private String replaceHex(String s) { - - final String prefix = "&#x"; - final String suffix = ";"; - - int index = 0; - - while (true) { - int i = s.indexOf(prefix, index); - if (i < 0) { - break; - } else { - int j = s.indexOf(suffix, i); - if (j < 0) { - break; - } else { - String hexCode = s.substring(i, (j + 1)); - String hex = hexCode.substring(prefix.length(), hexCode.length() - 1); - try { - s = StringUtil.replace(s, hexCode, - new String(Hex.decodeHex(hex.toCharArray()), StringPool.UTF8)); - } catch (Exception e) {} - index = i; - } - } - } - - return s; -} +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@page import="com.liferay.portal.kernel.util.MapUtil"%> +<%@page import="java.io.UnsupportedEncodingException"%> +<%@page import="org.apache.commons.codec.binary.Hex"%> +<%@page import="com.liferay.portal.kernel.util.UnicodeFormatter"%> +<%@page import="com.liferay.portlet.dynamicdatamapping.service.DDMStructureLocalServiceUtil"%> +<%@page import="com.liferay.portal.kernel.util.StringUtil"%> +<%@page import="org.htmlparser.Node"%> +<%@page import="org.htmlparser.tags.OptionTag"%> +<%@page import="org.htmlparser.tags.TextareaTag"%> +<%@page import="org.htmlparser.tags.InputTag"%> +<%@page import="org.htmlparser.tags.SelectTag"%> +<%@page import="org.htmlparser.tags.Div" %> +<%@page import="org.htmlparser.tags.LabelTag" %> +<%@page import="org.htmlparser.nodes.TagNode"%> +<%@page import="org.htmlparser.nodes.TextNode"%> +<%@page import="org.htmlparser.util.NodeList"%> +<%@page import="org.htmlparser.Parser"%> +<%@page import="org.htmlparser.util.ParserException"%> +<%@page import="javax.portlet.RenderResponse"%> +<%@page import="java.util.Iterator"%> +<%@page import="java.util.Map.Entry"%> +<%@page import="com.liferay.portal.kernel.util.LocaleUtil"%> +<%@page import="com.liferay.portal.kernel.util.Validator"%> +<%@page import="com.liferay.portal.kernel.util.ParamUtil"%> +<%@page import="java.util.Set"%> +<%@page import="java.util.Locale"%> +<%@page import="com.liferay.portlet.dynamicdatamapping.storage.StorageEngineUtil"%> +<%@page import="com.liferay.portlet.dynamicdatamapping.storage.Fields"%> +<%@page import="com.liferay.portlet.dynamicdatalists.model.DDLRecordSet"%> +<%@page import="com.liferay.portlet.dynamicdatalists.service.DDLRecordSetServiceUtil"%> +<%@page import="com.liferay.portlet.dynamicdatalists.model.DDLRecordVersion"%> +<%@page import="com.liferay.portal.kernel.bean.BeanParamUtil"%> +<%@page import="com.liferay.portlet.dynamicdatalists.model.DDLRecord"%> +<%@page import="com.liferay.portal.kernel.util.StringPool"%> +<%@page import="com.liferay.portlet.dynamicdatamapping.model.DDMStructure"%> +<%@page import="com.liferay.portlet.dynamicdatamapping.model.DDMTemplate"%> + +<%@ include file="/html/portlet/workflow_tasks/init.jsp" %> + + +<% + String classPkForCarichiLavoro = (String) renderRequest.getAttribute("classPkForCarichiLavoro"); +%> + +
+ + + + + Visualizza Carichi di Lavoro Istruttori +
+
+ +<% + +long ddmTemplateId = (Long) renderRequest.getAttribute("ddmTemplateId"); +long ddmStructureId = (Long) renderRequest.getAttribute("ddmStructureId"); +Map parameters = (Map) renderRequest.getAttribute("parameters"); +String prefix = (String) renderRequest.getAttribute("prefix"); +String suffix = (String) renderRequest.getAttribute("suffix"); +Map>> fieldNameOptions + = (Map>>) renderRequest.getAttribute("fieldNameOptions"); + +String redirect = StringPool.BLANK; + +DDLRecord record = null; + +long recordId = BeanParamUtil.getLong(record, request, "recordId"); + +DDLRecordVersion recordVersion = null; + +if (record != null) { + recordVersion = record.getLatestRecordVersion(); +} + +DDMStructure ddmStructure = DDMStructureLocalServiceUtil.getDDMStructure(ddmStructureId); + +Fields fields = null; + +if (recordVersion != null) { + fields = StorageEngineUtil.getFields(recordVersion.getDDMStorageId()); +} + +Locale[] availableLocales = new Locale[0]; + +if (fields != null) { + Set availableLocalesSet = fields.getAvailableLocales(); + + availableLocales = availableLocalesSet.toArray(new Locale[availableLocalesSet.size()]); +} + +String defaultLanguageId = StringPool.BLANK; + +if (Validator.isNull(defaultLanguageId)) { + defaultLanguageId = themeDisplay.getLanguageId(); + + if (fields != null) { + defaultLanguageId = LocaleUtil.toLanguageId(fields.getDefaultLocale()); + } +} + +String languageId = defaultLanguageId; + +boolean translating = false; + +if (!defaultLanguageId.equals(languageId)) { + translating = true; +} + +if (translating) { + redirect = currentURL; +} + +long classNameId = PortalUtil.getClassNameId(DDMStructure.class); + +long classPK = ddmStructure.getStructureId(); + +if (ddmTemplateId > 0) { + classNameId = PortalUtil.getClassNameId(DDMTemplate.class); + + classPK = ddmTemplateId; +} +%> + + + + + +<%= normalize(html, parameters, fieldNameOptions, renderResponse, prefix, suffix) %> + +<%! +private String normalize(String html, Map parameters, + Map>> fieldNameOptions, + RenderResponse renderResponse, String prefix, String suffix) { + + if (Validator.isNull(html)) { + return StringPool.BLANK; + } + + // replace portlet namespace + random namespace + html = html.replaceAll("name=\"" + renderResponse.getNamespace(), "name=\""); + + try { + + Parser parser = Parser.createParser(html, StringPool.UTF8); + NodeList nodeList = (NodeList) parser.parse(null); + + for (int i = 0; i < nodeList.size(); i++) { + filter(nodeList.elementAt(i), parameters, fieldNameOptions, prefix, suffix); + } + + html = nodeList.toHtml(); + + } catch (ParserException e) { + } + + // add prefix + suffix + html = html.replaceAll("name=\"(.*?)\"", "name=\"" + prefix + "$1" + suffix + "\""); + + // ignore ddm fields display + html = html.replaceAll("name=\"" + prefix + "_fieldsDisplay" + suffix, "name=\"_fieldsDisplay\""); + + return html; +} + +private void filter(Node node, Map parameters, + Map>> fieldNameOptions, + String prefix, String suffix) { + + if (node != null) { + + if (node instanceof SelectTag || node instanceof InputTag || node instanceof TextareaTag) { + + TagNode tag = (TagNode) node; + + String name = tag.getAttribute("name"); + + String namespace = getNamespace(node); + if (Validator.isNotNull(namespace)) { + name = name.replaceAll(namespace, StringPool.BLANK); + tag.setAttribute("name", name); + } + + String value = null; + + if (parameters.containsKey(name)) { + + value = parameters.get(name).toString(); + + if (node instanceof TextareaTag) { + if (node.getChildren() != null && node.getChildren().size() > 0) { + TextNode text = (TextNode) node.getChildren().elementAt(0); + text.setText(value); + } else { + NodeList nodeList = new NodeList(); + nodeList.add(new TextNode(value)); + node.setChildren(nodeList); + } + } else if (tag instanceof SelectTag) { + if (node.getChildren() != null && node.getChildren().size() > 0) { + for (int i = 0; i < node.getChildren().size(); i++) { + if (node.getChildren().elementAt(i) instanceof OptionTag) { + TagNode optionTag = (TagNode) node.getChildren().elementAt(i); + String optionValue = optionTag.getAttribute("value"); + optionValue = replaceHex(optionValue); + String[] values = StringUtil.split(value, StringPool.COMMA); + for (String v : values) { + if (StringUtil.trim(v).equals(optionValue)) { + optionTag.setAttribute("selected", "selected"); + } + } + } + } + } + } else { + String type = tag.getAttribute("type"); + if (type.equals("checkbox")) { + value = parameters.get( + StringUtil.replace(name, "Checkbox", StringPool.BLANK)).toString(); + if (value.equalsIgnoreCase("true")) { + tag.setAttribute("checked", "checked"); + } + } else if (type.equals("radio")) { + String valueInput = tag.getAttribute("value"); + valueInput = replaceHex(valueInput); + if (value.equals(valueInput)) { + tag.setAttribute("checked", "checked"); + } + } else { + tag.setAttribute("value", value, '"'); + } + } + } + + // select singolo o multiplo senza opzioni fisse + if (tag instanceof SelectTag) { + List> options = fieldNameOptions.get(name); + if (options != null && !options.isEmpty()) { + NodeList optionsTag = new NodeList(); + for (Map option : options) { + String label = MapUtil.getString(option, "label"); + String valueOption = MapUtil.getString(option, "value"); + boolean defaultValue = MapUtil.getBoolean(option, "default"); + // new option + OptionTag optionTag = new OptionTag(); + optionTag.setAttribute("value", valueOption, '"'); + if (defaultValue && !parameters.containsKey(name)) { + optionTag.setAttribute("selected", "selected"); + } else if (Validator.isNotNull(value) && value.equals(valueOption)) { + optionTag.setAttribute("selected", "selected"); + } + TextNode textNode = new TextNode(label); + NodeList nodeList = new NodeList(); + nodeList.add(textNode); + optionTag.setChildren(nodeList); + optionsTag.add(optionTag); + } + tag.setChildren(optionsTag); + } + } else if ("radio".equals(tag.getAttribute("type"))) { + List> options = fieldNameOptions.get(name); + if(options!=null){ + for (Map option : options) { + String label = MapUtil.getString(option, "label"); + String valueOption = MapUtil.getString(option, "value"); + boolean defaultValue = MapUtil.getBoolean(option, "default"); + if(tag.getAttribute("value").equals(valueOption)){ + tag.getNextSibling().setText(label); + } + } + } + } + } + + if (node.getChildren() != null) { + for (int i = 0; i < node.getChildren().size(); i++) { + filter(node.getChildren().elementAt(i), parameters, fieldNameOptions, prefix, suffix); + } + } + } +} + +private String getNamespace(Node node) { + + String namespace = null; + boolean trovato = false; + Node parent = node.getParent(); + + while (!trovato && parent != null) { + if (parent instanceof TagNode) { + TagNode tag = (TagNode) parent; + String dataFieldNamespace = tag.getAttribute("data-fieldnamespace"); + if (Validator.isNotNull(dataFieldNamespace)) { + trovato = true; + namespace = dataFieldNamespace; + } + } + if (!trovato) { + parent = parent.getParent(); + } + } + + return namespace; +} + +private String replaceHex(String s) { + + final String prefix = "&#x"; + final String suffix = ";"; + + int index = 0; + + while (true) { + int i = s.indexOf(prefix, index); + if (i < 0) { + break; + } else { + int j = s.indexOf(suffix, i); + if (j < 0) { + break; + } else { + String hexCode = s.substring(i, (j + 1)); + String hex = hexCode.substring(prefix.length(), hexCode.length() - 1); + try { + s = StringUtil.replace(s, hexCode, + new String(Hex.decodeHex(hex.toCharArray()), StringPool.UTF8)); + } catch (Exception e) {} + index = i; + } + } + } + + return s; +} %> \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_tasks/workflow_task_action.jsp b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_tasks/workflow_task_action.jsp index aebc957e..83c046be 100644 --- a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_tasks/workflow_task_action.jsp +++ b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_tasks/workflow_task_action.jsp @@ -1,296 +1,297 @@ -<%-- -/** - * 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; eitheistrr 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. - */ ---%> - -<%@page import="com.liferay.portal.kernel.util.ParamUtil"%> -<%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%> - -<%@ include file="/html/portlet/workflow_tasks/init.jsp" %> - -<% -String randomId = StringPool.BLANK; - -String closeRedirect = ParamUtil.getString(request, "closeRedirect"); - -//boolean canPortosAssegnatore = ParamUtil.getBoolean(request, "canPortosAssegnatore", false); -//boolean canPortosApprovatore = ParamUtil.getBoolean(request, "canPortosApprovatore", false); -//boolean canPortosIstruttore = ParamUtil.getBoolean(request, "canPortosIstruttore", false); -boolean canPortosAssegnatore = (Boolean)request.getAttribute("canPortosAssegnatore"); -boolean canPortosApprovatore = (Boolean)request.getAttribute("canPortosApprovatore"); -boolean canPortosIstruttore = (Boolean)request.getAttribute("canPortosIstruttore"); - - - -ResultRow row = (ResultRow)request.getAttribute(WebKeys.SEARCH_CONTAINER_RESULT_ROW); - -String viewFullContentURLString = ParamUtil.getString(request, "viewFullContentURLString"); - -// ADT BUG BO ID= 27 -String classPkForCarichiLavoro=ParamUtil.getString(request, "classPkForCarichiLavoro"); - -WorkflowTask workflowTask = null; - -if (row != null) { - randomId = StringUtil.randomId(); - - workflowTask = (WorkflowTask)row.getParameter("workflowTask"); -} -else { - workflowTask = (WorkflowTask)request.getAttribute(WebKeys.WORKFLOW_TASK); -} - -long[] pooledActorsIds = WorkflowTaskManagerUtil.getPooledActorsIds(company.getCompanyId(), workflowTask.getWorkflowTaskId()); -%> - - - -
- - - -
- - - - <% - List transitionNames = WorkflowTaskManagerUtil.getNextTransitionNames(company.getCompanyId(), user.getUserId(), workflowTask.getWorkflowTaskId()); - - for (String transitionName : transitionNames) { - String message = "proceed"; - - if (Validator.isNotNull(transitionName)) { - message = transitionName; - } - %> - - <% - - //Non fa nulla ma forse tornera comodo - boolean canCose = true; - if(transitionName.equals("registra-esito") && !canPortosIstruttore){ - canCose = false; - } else if(transitionName.equals("approva") && !canPortosApprovatore){ - canCose = false; - } - - %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <% - Map data = new HashMap(); - - data.put("href-validation", validationURL); - data.put("href-render-form", renderFormURL); - %> - - - - <% - } - %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <%-- - - - - - - - - - --%> -
- -<%--
- - - - <% - for (long pooledActorId : pooledActorsIds) { - if (pooledActorId == user.getUserId()) { - continue; - } - %> - - - - <% - } - %> - - - -
--%> - -
- -
- -
- -
-
- <%-- hook tref-ekaleo --%> -
-
- -
- -<%-- hook tref-ekaleo --%> - - var onTaskClickFn = A.rbind('onTaskClick', Liferay.WorkflowTasks, '<%= randomId %>'); - - - - var renderFormFn = A.rbind('renderForm', Liferay.WorkflowTasks, '<%= randomId %>'); - - <% - List transitionNames = WorkflowTaskManagerUtil.getNextTransitionNames(company.getCompanyId(), user.getUserId(), workflowTask.getWorkflowTaskId()); - - for (String transitionName : transitionNames) { - String message = "proceed"; - - if (Validator.isNotNull(transitionName)) { - message = transitionName; - } - %> - - Liferay.delegateClick('<%= randomId + transitionName %>taskChangeStatusLink', renderFormFn); - - <% - } - %> - - - - Liferay.delegateClick('<%= randomId %>taskAssignToMeLink', onTaskClickFn); - Liferay.delegateClick('<%= randomId %>taskAssignLink', onTaskClickFn); - Liferay.delegateClick('<%= randomId %>taskDueDateLink', onTaskClickFn); - - - - \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/webs/resources-importer-web/docroot/META-INF/custom_jsps/html/portlet/journal/article_toolbar.jsp b/liferay-plugins-sdk-6.2/webs/resources-importer-web/docroot/META-INF/custom_jsps/html/portlet/journal/article_toolbar.jsp index ce194d62..ad9e19d8 100644 --- a/liferay-plugins-sdk-6.2/webs/resources-importer-web/docroot/META-INF/custom_jsps/html/portlet/journal/article_toolbar.jsp +++ b/liferay-plugins-sdk-6.2/webs/resources-importer-web/docroot/META-INF/custom_jsps/html/portlet/journal/article_toolbar.jsp @@ -1,3 +1,4 @@ +<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%-- /** * Copyright (c) 2000-present Liferay, Inc. All rights reserved.