diff --git a/liferay-plugins-sdk-6.2/build.ture.properties b/liferay-plugins-sdk-6.2/build.ture.properties index f4c5d948..301d707f 100644 --- a/liferay-plugins-sdk-6.2/build.ture.properties +++ b/liferay-plugins-sdk-6.2/build.ture.properties @@ -1,5 +1,3 @@ -# Managed by Liferay IDE (remove this comment to prevent future updates) - app.server.tomcat.lib.global.dir = /home/ture/liferay/portali/paesaggistica/tomcat-7.0.62/lib/ext app.server.tomcat.deploy.dir = /home/ture/liferay/portali/paesaggistica/tomcat-7.0.62/webapps app.server.parent.dir = /home/ture/liferay/portali/paesaggistica diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/portos-kaleo-portlet-service.jar b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/portos-kaleo-portlet-service.jar index 36c9b920..21159b20 100644 Binary files a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/portos-kaleo-portlet-service.jar and b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/portos-kaleo-portlet-service.jar differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/mwg/sismica/bo/util/MappeUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/mwg/sismica/bo/util/MappeUtil.java index d21cb199..4ee0ce78 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/mwg/sismica/bo/util/MappeUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/mwg/sismica/bo/util/MappeUtil.java @@ -30,7 +30,8 @@ import com.liferay.portal.kernel.util.WebKeys; import com.liferay.portal.theme.ThemeDisplay; public class MappeUtil { - private final static Log _log = LogFactoryUtil.getLog(MappeUtil.class); + + private static final Log _log = LogFactoryUtil.getLog(MappeUtil.class); public static String getUrlFe(HttpServletRequest request, DettPratica dettPratica, Comune comune, boolean readOnly) throws UnsupportedEncodingException, PortalException, SystemException { diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/AsseverazioniUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/AsseverazioniUtil.java index 217dc010..e7d1ec31 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/AsseverazioniUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/AsseverazioniUtil.java @@ -38,13 +38,13 @@ import com.liferay.portal.service.UserLocalServiceUtil; public class AsseverazioniUtil { - public final static String STATO_ASSEGNATA = "AS"; - public final static String STATO_ESEGUITA = "ES"; - public final static String STATO_ANNULLATA = "AN"; - public final static String STATO_EXPIRED = "EX"; + public static final String STATO_ASSEGNATA = "AS"; + public static final String STATO_ESEGUITA = "ES"; + public static final String STATO_ANNULLATA = "AN"; + public static final String STATO_EXPIRED = "EX"; - public final static String ASSEVERAZIONE_DA_APPLICATIVO = "AP"; - public final static String ASSEVERAZIONE_DA_ALLEGATO = "AL"; + public static final String ASSEVERAZIONE_DA_APPLICATIVO = "AP"; + public static final String ASSEVERAZIONE_DA_ALLEGATO = "AL"; public static boolean hasAsseverazioniAttive(long dettPraticaId) throws SystemException { diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/AvvisoUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/AvvisoUtil.java index dd625aa0..699037dc 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/AvvisoUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/AvvisoUtil.java @@ -23,17 +23,17 @@ public class AvvisoUtil { private static Log _log = LogFactoryUtil.getLog(AvvisoUtil.class); // Ogni volta che leggo queste due righe mi sale la cattiveria - public final static String DOCUMENTO_INVIATO = "S"; - public final static String DOCUMENTO_NON_INVIATO = "N"; + public static final String DOCUMENTO_INVIATO = "S"; + public static final String DOCUMENTO_NON_INVIATO = "N"; - public final static String TIPO_AVVISO_DIRETTO = "D"; - public final static String TIPO_AVVISO_FIRMA = "S"; + public static final String TIPO_AVVISO_DIRETTO = "D"; + public static final String TIPO_AVVISO_FIRMA = "S"; - public final static String TIPO_REPORT_CONTROLLO_OBBLIGATORIO = "CO"; - public final static String TIPO_REPORT_AUTORIZZAZIONE = "AU"; + public static final String TIPO_REPORT_CONTROLLO_OBBLIGATORIO = "CO"; + public static final String TIPO_REPORT_AUTORIZZAZIONE = "AU"; @SuppressWarnings("serial") - private final static Map allTipoAvviso = new LinkedHashMap() { + private static final Map allTipoAvviso = new LinkedHashMap() { { put(TIPO_AVVISO_DIRETTO, "label.admingeniocivile.avviso.tipoAvviso.diretto"); put(TIPO_AVVISO_FIRMA, "label.admingeniocivile.avviso.tipoAvviso.firma"); @@ -41,7 +41,7 @@ public class AvvisoUtil { }; @SuppressWarnings("serial") - private final static Map ALL_TIPO_DOCUMENTO = new LinkedHashMap() { + private static final Map ALL_TIPO_DOCUMENTO = new LinkedHashMap() { { put(StatoPraticaConstants.CONFORME, "label.admingeniocivile.avviso.tipoDocumento.conforme"); put(StatoPraticaConstants.NON_CONFORME, "label.admingeniocivile.avviso.tipoDocumento.nonconforme"); @@ -68,7 +68,7 @@ public class AvvisoUtil { }; @SuppressWarnings("serial") - private final static Map allTipoDocumentoFolderTemplateProps = new LinkedHashMap() { + private static final Map allTipoDocumentoFolderTemplateProps = new LinkedHashMap() { { put(StatoPraticaConstants.VIDIMATA, "conf.geniocivile.avviso.folder.id.vidimata"); put(StatoPraticaConstants.CONFORME, "conf.geniocivile.avviso.folder.id.conforme"); @@ -94,7 +94,7 @@ public class AvvisoUtil { }; @SuppressWarnings("serial") - private final static Map allTipoDocumentoFileTemplateProps = new LinkedHashMap() { + private static final Map allTipoDocumentoFileTemplateProps = new LinkedHashMap() { { put(StatoPraticaConstants.VARIAZIONE_SOGGETTI, "conf.geniocivile.avviso.template.id.variazionesoggetti"); put(StatoPraticaConstants.FINE_LAVORI, "conf.geniocivile.avviso.template.id.vidimata.finelavori"); 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 89e0c2ee..a17f6ad4 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 @@ -31,21 +31,21 @@ import com.liferay.portal.service.UserLocalServiceUtil; public class DelegheUtil { - public final static String STATO_ASSEGNATA = "AS"; - public final static String STATO_ESEGUITA = "ES"; - public final static String STATO_ANNULLATA = "AN"; - public final static String STATO_RIFIUTATA = "RI"; - - public final static String TIPO_TOTALE = "TT"; - public final static String TIPO_COMPILAZIONE = "CO"; - public final static String TIPO_GEOLOGO = "GE"; - public final static String TIPO_FIRMA_INSERIMENTO_ALLEGATI = "FI"; - public final static String TIPO_PAGAMENTO = "PG"; - public final static String TIPO_VISUALIZZAZIONE = "VI"; - public final static String TIPO_FINE_LAVORI = "FL"; - public final static String TIPO_COLLAUDO = "CL"; - - private final static Log _log = LogFactoryUtil.getLog(DelegheUtil.class); + public static final String STATO_ASSEGNATA = "AS"; + public static final String STATO_ESEGUITA = "ES"; + public static final String STATO_ANNULLATA = "AN"; + public static final String STATO_RIFIUTATA = "RI"; + + public static final String TIPO_TOTALE = "TT"; + public static final String TIPO_COMPILAZIONE = "CO"; + public static final String TIPO_GEOLOGO = "GE"; + public static final String TIPO_FIRMA_INSERIMENTO_ALLEGATI = "FI"; + public static final String TIPO_PAGAMENTO = "PG"; + public static final String TIPO_VISUALIZZAZIONE = "VI"; + public static final String TIPO_FINE_LAVORI = "FL"; + public static final String TIPO_COLLAUDO = "CL"; + + private static final Log _log = LogFactoryUtil.getLog(DelegheUtil.class); public static boolean hasDelegaFirma(long userId, long docPraticaId, boolean sezioneGeologica) throws PortalException, SystemException { diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/WorkflowUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/WorkflowUtil.java index 4f54020a..2d417b2b 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/WorkflowUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/bo/util/WorkflowUtil.java @@ -225,7 +225,7 @@ public class WorkflowUtil { // Verificare corretta corrispondenza con AvvisoUtil.getAllTipoDocumento() @SuppressWarnings("serial") - private final static Map tipoDocumentoToSignal = new HashMap() { + private static final Map TIPO_DOCUMENTO_TO_SIGNAL = new HashMap() { { put(StatoPraticaConstants.SOTTOPOSTA_A_PARERE, WorkflowConstants.WORKFLOW_SIGNAL_ASSEGNAZIONE); put(StatoPraticaConstants.CONFORME, WorkflowConstants.WORKFLOW_SIGNAL_INVIO); @@ -240,7 +240,7 @@ public class WorkflowUtil { }; public static String getSignalByTipoDocumento(String tipoDocumento) { - return tipoDocumentoToSignal.get(tipoDocumento); + return TIPO_DOCUMENTO_TO_SIGNAL.get(tipoDocumento); } public static void assegnaUltimoTask(long companyId, long groupId, long istruttoreId, long assegnatoreUserId, 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 288ea293..bb346182 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 @@ -84,11 +84,12 @@ import com.liferay.portal.workflow.kaleo.service.KaleoTaskInstanceTokenLocalServ import com.liferay.portlet.documentlibrary.service.DLAppServiceUtil; public class SismicaUtil { - private final static Log _log = LogFactoryUtil.getLog(SismicaUtil.class); + + private static final Log _log = LogFactoryUtil.getLog(SismicaUtil.class); private static final SimpleDateFormat dfmt = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss"); public static final SimpleDateFormat sdfGiornoDB = new SimpleDateFormat("yyyy-MM-dd"); - private final static int SLICE = 200; + private static final int SLICE = 200; public static Date[] getWeekInterval(int dow) { diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/PaesaggisticaAdministrationPortlet.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/PaesaggisticaAdministrationPortlet.java index 81b55666..ec05f0ca 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/PaesaggisticaAdministrationPortlet.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/PaesaggisticaAdministrationPortlet.java @@ -27,17 +27,16 @@ import com.liferay.portal.theme.ThemeDisplay; import com.liferay.util.bridges.mvc.MVCPortlet; public class PaesaggisticaAdministrationPortlet extends MVCPortlet { - private final static Log _log = LogFactoryUtil.getLog(PaesaggisticaAdministrationPortlet.class); + + private static final Log _log = LogFactoryUtil.getLog(PaesaggisticaAdministrationPortlet.class); public void impostazioniMappe(ActionRequest actionRequest, ActionResponse actionResponse) throws PortalException, SystemException { + String urlIframeFE = ParamUtil.getString(actionRequest, "urlIframeFE"); String urlIframeBO = ParamUtil.getString(actionRequest, "urlIframeBO"); String urlIframeRicerca = ParamUtil.getString(actionRequest, "urlIframeRicerca"); String sharedSecret = ParamUtil.getString(actionRequest, "sharedSecret"); - - // ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); - // Company company = themeDisplay.getCompany(); ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest); ConfigurazioneLocalServiceUtil.storeConfig(ConfigurazioneConstants.MAPPE_URL_IFRAME_FE, urlIframeFE, serviceContext); @@ -50,6 +49,7 @@ public class PaesaggisticaAdministrationPortlet extends MVCPortlet { } public void mostraConfigurazione(ActionRequest actionRequest, ActionResponse actionResponse) throws SystemException { + List esito = new ArrayList(); esito.add("

Env:

"); for (Map.Entry entry : System.getenv().entrySet()) { 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 c3da17d7..d7ea1916 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 @@ -30,15 +30,16 @@ import it.tref.liferay.portos.kaleo.service.FormLogLocalServiceUtil; import it.tref.liferay.portos.kaleo.shared.util.WorkflowConstants; import java.io.Serializable; +import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.HashMap; -import java.util.HashSet; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Set; import java.util.TreeMap; +import java.util.TreeSet; import com.liferay.portal.NoSuchWorkflowInstanceLinkException; import com.liferay.portal.kernel.bean.PortletBeanLocatorUtil; @@ -411,15 +412,13 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi ControlloPratica controlloPratica = getControlloPratica(controlloPraticaId); int unitaOperativa = intPraticaLocalService.getIntPratica(controlloPratica.getIntPraticaId()) .getUnitaOperativa(); - boolean preassegnazione = (0 == unitaOperativa); long companyId = controlloPratica.getCompanyId(); - long roleId = RoleLocalServiceUtil.getRole(companyId, - preassegnazione ? "portos_assegnatore" : "portos_istruttore").getRoleId(); + long roleId = RoleLocalServiceUtil.getRole(companyId, Constants.ROLE_NAME_ISTRUTTORE).getRoleId(); List userGroupRoles = UserGroupRoleLocalServiceUtil.getUserGroupRolesByGroupAndRole( controlloPratica.getGroupId(), roleId); - Map sorted = new TreeMap<>(); - if (preassegnazione) { - Set unitaOperative = new HashSet<>(); + List istruttori = new ArrayList<>(); + if (unitaOperativa == 0) { + Set unitaOperative = new TreeSet<>(); for (UserGroupRole userGroupRole : userGroupRoles) { User user = userGroupRole.getUser(); unitaOperative.addAll(UnitaOperativeUtil.getUnitaOperative(user)); @@ -427,28 +426,29 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi for (Integer uo : unitaOperative) { if (0 != uo) { JSONObject unita = JSONFactoryUtil.createJSONObject(); - unita.put("label", "Unità operativa " + uo); + unita.put("label", " > Unità operativa " + uo); unita.put("value", "--UO--" + uo); unita.put("default", false); - sorted.put(String.format("%6d", uo), unita); + istruttori.add(unita); } } - } else { - for (UserGroupRole userGroupRole : userGroupRoles) { - User user = userGroupRole.getUser(); - if (UnitaOperativeUtil.getUnitaOperative(user).contains(unitaOperativa)) { - JSONObject istruttore = JSONFactoryUtil.createJSONObject(); - istruttore.put("label", user.getFullName().toUpperCase()); - istruttore.put("value", user.getUserId()); - istruttore.put("default", false); - sorted.put((user.getLastName() + user.getFirstName()).toUpperCase(), istruttore); - } + } + Map ordinati = new TreeMap<>(); + for (UserGroupRole userGroupRole : userGroupRoles) { + User user = userGroupRole.getUser(); + if (UnitaOperativeUtil.getUnitaOperative(user).contains(unitaOperativa)) { + JSONObject istruttore = JSONFactoryUtil.createJSONObject(); + istruttore.put("label", user.getFullName().toUpperCase()); + istruttore.put("value", user.getUserId()); + istruttore.put("default", false); + ordinati.put((user.getLastName() + user.getFirstName()).toUpperCase(), istruttore); } } + istruttori.addAll(ordinati.values()); JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); jsonObject.put("istruttore", jsonArray); - for (JSONObject istruttore : sorted.values()) { + for (JSONObject istruttore : istruttori) { jsonArray.put(istruttore); } return jsonObject.toString(); @@ -484,7 +484,7 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi esito.put(etichettaEsito(StatoPraticaConstants.NO_PARERE)); JSONObject json = JSONFactoryUtil.createJSONObject(); json.put("esito", esito); - jsonAutorizzazione = esito.toString(); + jsonAutorizzazione = json.toString(); } return jsonAutorizzazione; } 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 76cf04c0..57725be6 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=3360 - build.date=1631698031653 + build.number=3361 + build.date=1631701936996 build.auto.upgrade=true ## diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/actions/action_cambio_istruttore.jsp b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/actions/action_cambio_istruttore.jsp index af86a325..2933dcac 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/actions/action_cambio_istruttore.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/actions/action_cambio_istruttore.jsp @@ -13,13 +13,10 @@ long controlloPraticaId = ParamUtil.getLong(request, "controlloPraticaId"); IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId); ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil.getControlloPratica(controlloPraticaId); String buttonIdCambioIstruttore = ParamUtil.getString(request, "buttonIdCambioIstruttore"); -PortletURL iteratorURL = liferayPortletResponse.createRenderURL(); -String orderByType = ParamUtil.getString(request, "orderByType", "asc"); -String orderByCol = ParamUtil.getString(request, "orderByCol", "nome"); String randomId = StringUtil.randomId(); String formNameSelezionaCambioIstruttore = "formNameSelezionaCambioIstruttore_" + randomId; String divIdSelezionaCambioIstruttore = "divIdSelezionaCambioIstruttore_" + randomId; -User istruttore = UserLocalServiceUtil.getUser(intPratica.getStatusByUserId()); +User istruttoreAttuale = UserLocalServiceUtil.getUser(intPratica.getStatusByUserId()); Role role = RoleLocalServiceUtil.getRole(company.getCompanyId(), Constants.ROLE_NAME_ISTRUTTORE); List userGroupRoles = UserGroupRoleLocalServiceUtil.getUserGroupRolesByGroupAndRole( controlloPratica.getGroupId(), role.getRoleId()); @@ -32,22 +29,22 @@ List userGroupRoles = UserGroupRoleLocalServiceUtil.getUserGroupR
- <%= istruttore.getFullName() %> + <%= istruttoreAttuale.getFullName() %>
<% List uoUser = UnitaOperativeUtil.getUnitaOperative(user); for (UserGroupRole userGroupRole: userGroupRoles) { - if (userGroupRole.getUserId() != istruttore.getUserId()) { - User istruttoreTmp = UserLocalServiceUtil.getUser(userGroupRole.getUserId()); - List uoIstruttore = UnitaOperativeUtil.getUnitaOperative(istruttoreTmp); + if (userGroupRole.getUserId() != istruttoreAttuale.getUserId()) { + User istruttore = UserLocalServiceUtil.getUser(userGroupRole.getUserId()); + List uoIstruttore = UnitaOperativeUtil.getUnitaOperative(istruttore); if (CollectionUtils.containsAny(uoUser, uoIstruttore)) { - String nominativo = istruttoreTmp.getFullName() + " - U.O. " + String nominativo = istruttore.getFullName() + " - U.O. " + StringUtils.join(uoIstruttore, StringPool.COMMA_AND_SPACE) + " - " - + istruttoreTmp.getScreenName(); + + istruttore.getScreenName(); %> - + <% } } 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 7b612e0c..df4f6c32 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,26 +1,17 @@ <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> -<%@page import="com.liferay.portal.service.GroupLocalServiceUtil"%> -<%@page import="com.liferay.portal.util.comparator.GroupIdComparator"%> +<%@page import="com.liferay.portal.kernel.exception.PortalException"%> +<%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%> +<%@page import="com.liferay.portal.kernel.repository.model.FileEntry"%> <%@page import="com.liferay.portal.kernel.util.ArrayUtil"%> <%@page import="com.liferay.portal.model.Organization"%> +<%@page import="com.liferay.portal.model.User"%> <%@page import="com.liferay.portal.service.OrganizationLocalServiceUtil"%> <%@page import="com.liferay.portal.service.UserGroupRoleLocalServiceUtil"%> <%@page import="com.liferay.portal.service.UserLocalServiceUtil"%> -<%@page import="com.liferay.portal.model.User"%> -<%@page import="com.liferay.portal.security.permission.ActionKeys"%> -<%@page import="it.tref.liferay.portos.bo.util.GenioCivileBaseUtil"%> -<%@page import="it.tref.liferay.portos.bo.util.Constants"%> -<%@page import="it.tref.liferay.portos.bo.util.AvvisoUtil"%> -<%@page import="com.liferay.portal.kernel.util.HttpUtil"%> -<%@page import="com.liferay.portal.kernel.portlet.LiferayWindowState"%> -<%@page import="com.liferay.portal.kernel.exception.PortalException"%> -<%@page import="com.liferay.portlet.documentlibrary.util.DLUtil"%> -<%@page import="com.liferay.portal.kernel.util.Validator"%> <%@page import="com.liferay.portlet.documentlibrary.service.DLAppLocalServiceUtil"%> -<%@page import="com.liferay.portal.kernel.repository.model.FileEntry"%> -<%@page import="com.liferay.portal.kernel.language.LanguageUtil"%> -<%@page import="com.liferay.portal.kernel.util.StringPool"%> -<%@page import="java.util.List"%> +<%@page import="com.liferay.portlet.documentlibrary.util.DLUtil"%> +<%@page import="it.tref.liferay.portos.bo.shared.util.Constants"%> +<%@page import="it.tref.liferay.portos.bo.util.GenioCivileBaseUtil"%> <%@page import="javax.portlet.PortletURL"%> <%@include file="/html/gestionefirme/init.jsp"%> <% @@ -29,19 +20,18 @@ String mvcPath = ParamUtil.getString(request, "mvcPath"); long[] groupIds = new long[0]; List organizations = OrganizationLocalServiceUtil.getUserOrganizations(user.getUserId()); for (Organization organization:organizations) { - if (UserGroupRoleLocalServiceUtil.hasUserGroupRole(user.getUserId(), organization.getGroupId(), Constants.ROLE_NAME_FIRMA, true)) { + if (UserGroupRoleLocalServiceUtil.hasUserGroupRole(user.getUserId(), organization.getGroupId(), + Constants.ROLE_NAME_FIRMA, true)) { groupIds = ArrayUtil.append(groupIds, organization.getGroupId()); } } +PortletURL primaFirmaURL = renderResponse.createRenderURL(); +primaFirmaURL.setParameter("tabs1", tabs1); +if (Validator.isNotNull(mvcPath)) { + primaFirmaURL.setParameter("mvcPath", mvcPath); +} %>
- <% - PortletURL primaFirmaURL = renderResponse.createRenderURL(); - primaFirmaURL.setParameter("tabs1", tabs1); - if (Validator.isNotNull(mvcPath)) { - primaFirmaURL.setParameter("mvcPath", mvcPath); - } - %>
@@ -52,14 +42,15 @@ for (Organization organization:organizations) { + total="<%= AvvisoLocalServiceUtil.countAvvisiDaFirmarePrimaFirmaByCF( + company.getCompanyId(), user.getScreenName()) %>" /> <% - DettPratica dettPratica = DettPraticaLocalServiceUtil.fetchDettPratica(avviso.getClassPk()); + DettPratica dettPratica = DettPraticaLocalServiceUtil.fetchDettPratica(avviso + .getClassPk()); IntPratica intPratica = null; - if (dettPratica != null) { + if (Validator.isNotNull(dettPratica)) { intPratica = IntPraticaLocalServiceUtil.getIntPratica(dettPratica.getIntPraticaId()); String urlDettaglioPratica = StringPool.BLANK; if (fromPopUp) { @@ -77,17 +68,20 @@ for (Organization organization:organizations) { String tipoProcedura = StringPool.BLANK; if (Validator.isNotNull(intPratica)) { tipoProcedura = LanguageUtil.get(pageContext, "label_procedura_" - + intPratica.getTipoProcedura()) + ") " + + intPratica.getTipoProcedura()) + + ") " + LanguageUtil.get(pageContext, "tipo_procedura_" + intPratica.getTipoProcedura()); } %> + value="<%= Validator.isNull(intPratica) ? StringPool.MINUS + : intPratica.getNumeroProgetto() %>" + cssClass="text-center" /> + value="<%= Validator.isNull(dettPratica) ? StringPool.MINUS + : dettPratica.getProtocollo() %>" + cssClass="text-center" /> @@ -105,16 +99,18 @@ for (Organization organization:organizations) { try { FileEntry fileEntryBase = DLAppLocalServiceUtil.getFileEntry(avviso .getFileEntryIdBase()); - urlFileEntryBase = DLUtil.getPreviewURL(fileEntryBase, fileEntryBase.getFileVersion(), - themeDisplay, StringPool.BLANK, false, true); + urlFileEntryBase = DLUtil.getPreviewURL(fileEntryBase, + fileEntryBase.getFileVersion(), themeDisplay, StringPool.BLANK, false, + true); } catch (PortalException e) {} %> - + <% - String link = "javascript:window.open('" + urlFileEntryBase - + "', '_blank')"; + String link = "javascript:window.open('" + urlFileEntryBase + + "', '_blank')"; %> + value="<%= Validator.isNull(intPratica) ? StringPool.MINUS + : intPratica.getNumeroProgetto() %>" + cssClass="text-center" /> + value="<%= Validator.isNull(dettPratica) ? StringPool.MINUS + : dettPratica.getProtocollo() %>" + cssClass="text-center" /> @@ -214,8 +212,9 @@ for (Organization organization:organizations) { try { FileEntry fileEntryBase = DLAppLocalServiceUtil.getFileEntry(avviso .getFileEntryIdBase()); - urlFileEntryBase = DLUtil.getPreviewURL(fileEntryBase, fileEntryBase.getFileVersion(), - themeDisplay, StringPool.BLANK, false, true); + urlFileEntryBase = DLUtil.getPreviewURL(fileEntryBase, + fileEntryBase.getFileVersion(), themeDisplay, StringPool.BLANK, false, + true); } catch (PortalException e) {} %> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestionefirme/init.jsp b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestionefirme/init.jsp index 3bdea40f..30b4dfda 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestionefirme/init.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestionefirme/init.jsp @@ -1,8 +1,6 @@ <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> -<%@ include file="/html/init.jsp" %> +<%@include file="/html/init.jsp"%> <% String tabNames = "Tab_AvvisiDaFirmare,Tab_AvvisiAltri,Tab_AvvisiFirme"; - String tabs1 = ParamUtil.getString(request, "tabs1", StringUtil.split(tabNames)[0]); - -%> \ No newline at end of file +%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/homebo/init.jsp b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/homebo/init.jsp index 505d90c5..87f4525a 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/homebo/init.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/homebo/init.jsp @@ -1,2 +1,2 @@ <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> -<%@ include file="/html/init.jsp" %> \ No newline at end of file +<%@include file="/html/init.jsp"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/homebo/view.jsp b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/homebo/view.jsp index de5b328b..1af74773 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/homebo/view.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/homebo/view.jsp @@ -1,195 +1,118 @@ <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@include file="/html/homebo/init.jsp" %> - - - <% - -int countPraticheScaduteAutorizzazione = GetterUtil.getInteger(renderRequest.getAttribute("countPraticheScaduteAutorizzazione")); -int countPraticheScaduteSorteggiate = GetterUtil.getInteger(renderRequest.getAttribute("countPraticheScaduteSorteggiate")); -int countPraticheScaduteControlloObbligatorio = GetterUtil.getInteger(renderRequest.getAttribute("countPraticheScaduteControlloObbligatorio")); - -int countPraticheScaduteTotali = countPraticheScaduteAutorizzazione + countPraticheScaduteSorteggiate + countPraticheScaduteControlloObbligatorio; - -int countPraticheInScadenzaAutorizzazioni = GetterUtil.getInteger(renderRequest.getAttribute("countPraticheInScadenzaAutorizzazioni")); -int countPraticheInScadenzaSorteggiate = GetterUtil.getInteger(renderRequest.getAttribute("countPraticheInScadenzaSorteggiate")); -int countPraticheInScadenzaControlloObbligatorio = GetterUtil.getInteger(renderRequest.getAttribute("countPraticheInScadenzaControlloObbligatorio")); - -int countPraticheInScadenzaTotali = countPraticheInScadenzaAutorizzazioni + countPraticheInScadenzaSorteggiate + countPraticheInScadenzaControlloObbligatorio; - -int countAutorizzazioniDaAssegnare = GetterUtil.getInteger(renderRequest.getAttribute("countAutorizzazioniDaAssegnare")); -int countSorteggiateDaAssegnare = GetterUtil.getInteger(renderRequest.getAttribute("countSorteggiateDaAssegnare")); -int countControlloObbligatorioDaAssegnare = GetterUtil.getInteger(renderRequest.getAttribute("countControlloObbligatorioDaAssegnare")); - -int countPraticheDaAssegnareTotali = countAutorizzazioniDaAssegnare + countSorteggiateDaAssegnare + countControlloObbligatorioDaAssegnare; - - -int countAutorizzazioniOrdinarie = GetterUtil.getInteger(renderRequest.getAttribute("countAutorizzazioniOrdinarie")); -int countSorteggiateOrdinarie = GetterUtil.getInteger(renderRequest.getAttribute("countSorteggiateOrdinarie")); -int countControlloObbligatorioOrdinarie = GetterUtil.getInteger(renderRequest.getAttribute("countControlloObbligatorioOrdinarie")); - -int countPraticheOrdinarieTotali = countAutorizzazioniOrdinarie + countSorteggiateOrdinarie + countControlloObbligatorioOrdinarie; - - -int countTotaleAutorizzazioni = countPraticheScaduteAutorizzazione + countPraticheInScadenzaAutorizzazioni + countAutorizzazioniDaAssegnare + countAutorizzazioniOrdinarie; -int countTotaleSorteggiate = countPraticheScaduteSorteggiate + countPraticheInScadenzaSorteggiate + countSorteggiateDaAssegnare + countSorteggiateOrdinarie; -int countTotaleControlloObbligatorio = countPraticheScaduteControlloObbligatorio + countPraticheInScadenzaControlloObbligatorio + countControlloObbligatorioDaAssegnare + countControlloObbligatorioOrdinarie; - +int countPraticheScaduteAutorizzazione = GetterUtil.getInteger(renderRequest.getAttribute( + "countPraticheScaduteAutorizzazione")); +int countPraticheScaduteSorteggiate = GetterUtil.getInteger(renderRequest.getAttribute( + "countPraticheScaduteSorteggiate")); +int countPraticheScaduteControlloObbligatorio = GetterUtil.getInteger(renderRequest.getAttribute( + "countPraticheScaduteControlloObbligatorio")); +int countPraticheScaduteTotali = countPraticheScaduteAutorizzazione + countPraticheScaduteSorteggiate + + countPraticheScaduteControlloObbligatorio; +int countPraticheInScadenzaAutorizzazioni = GetterUtil.getInteger(renderRequest.getAttribute( + "countPraticheInScadenzaAutorizzazioni")); +int countPraticheInScadenzaSorteggiate = GetterUtil.getInteger(renderRequest.getAttribute( + "countPraticheInScadenzaSorteggiate")); +int countPraticheInScadenzaControlloObbligatorio = GetterUtil.getInteger(renderRequest.getAttribute( + "countPraticheInScadenzaControlloObbligatorio")); +int countPraticheInScadenzaTotali = countPraticheInScadenzaAutorizzazioni + countPraticheInScadenzaSorteggiate + + countPraticheInScadenzaControlloObbligatorio; +int countAutorizzazioniDaAssegnare = GetterUtil.getInteger(renderRequest.getAttribute( + "countAutorizzazioniDaAssegnare")); +int countSorteggiateDaAssegnare = GetterUtil.getInteger(renderRequest.getAttribute( + "countSorteggiateDaAssegnare")); +int countControlloObbligatorioDaAssegnare = GetterUtil.getInteger(renderRequest.getAttribute( + "countControlloObbligatorioDaAssegnare")); +int countPraticheDaAssegnareTotali = countAutorizzazioniDaAssegnare + countSorteggiateDaAssegnare + + countControlloObbligatorioDaAssegnare; +int countAutorizzazioniOrdinarie = GetterUtil.getInteger(renderRequest.getAttribute( + "countAutorizzazioniOrdinarie")); +int countSorteggiateOrdinarie = GetterUtil.getInteger(renderRequest.getAttribute( + "countSorteggiateOrdinarie")); +int countControlloObbligatorioOrdinarie = GetterUtil.getInteger(renderRequest.getAttribute( + "countControlloObbligatorioOrdinarie")); +int countPraticheOrdinarieTotali = countAutorizzazioniOrdinarie + countSorteggiateOrdinarie + + countControlloObbligatorioOrdinarie; +int countTotaleAutorizzazioni = countPraticheScaduteAutorizzazione + countPraticheInScadenzaAutorizzazioni + + countAutorizzazioniDaAssegnare + countAutorizzazioniOrdinarie; +int countTotaleSorteggiate = countPraticheScaduteSorteggiate + countPraticheInScadenzaSorteggiate + + countSorteggiateDaAssegnare + countSorteggiateOrdinarie; +int countTotaleControlloObbligatorio = countPraticheScaduteControlloObbligatorio + + countPraticheInScadenzaControlloObbligatorio + countControlloObbligatorioDaAssegnare + + countControlloObbligatorioOrdinarie; int totaleDeiTotali = countTotaleAutorizzazioni + countTotaleSorteggiate + countTotaleControlloObbligatorio; %> - - - -
-
-

PRATICHE IN ISTRUTTORIA

-
-
- +} +
-
- TIPOLOGIA -
- -
+
TOTALI
-
+
PRATICHE DA ASSEGNARE
- -
- <%=countPraticheDaAssegnareTotali %> +
+ <%= countPraticheDaAssegnareTotali %>
-
-
- PRATICHE ORDINARIE -
- -
- <%=countPraticheOrdinarieTotali %> +
+ <%= countPraticheOrdinarieTotali %>
-
-
+
PRATICHE IN SCADENZA
- -
- <%=countPraticheInScadenzaTotali %> +
+ <%= countPraticheInScadenzaTotali %>
-
-
+
PRATICHE SCADUTE
- -
- <%=countPraticheScaduteTotali %> +
+ <%= countPraticheScaduteTotali %>
-
-
+
TOTALI
- -
- <%=totaleDeiTotali %> +
+ <%= totaleDeiTotali %>
- diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/pagamenti/view.jsp b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/pagamenti/view.jsp index e9d699a3..5ead0b50 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/pagamenti/view.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/pagamenti/view.jsp @@ -7,166 +7,153 @@ <%@page import="java.text.NumberFormat"%> <%@page import="java.math.BigDecimal"%> <%@ include file="/html/pagamenti/init.jsp" %> - <% - long intPraticaId = ParamUtil.getLong(request, "intPraticaId"); +long intPraticaId = ParamUtil.getLong(request, "intPraticaId"); %> - - - - + - - - - - - - <% - DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(pagamento.getClassPk()); - %> - - - - - - - - - + total="<%=PagamentoLocalServiceUtil.countByIntPratica_Visible(intPraticaId)%>" /> + + <% - String result = ""; - if(dettPratica.isNormEsenteSpese()){ - result = "Esente"; - } else { - BigDecimal importoSpeseVal; - if( Validator.isNotNull(pagamento.getImporto()) ){ - importoSpeseVal = new BigDecimal(pagamento.getImporto()); - } else{ - importoSpeseVal = new BigDecimal(0.00); - } - result = NumberFormat.getCurrencyInstance(Locale.ITALY).format(importoSpeseVal); - } - out.print(result); + DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(pagamento.getClassPk()); %> - - - - - <% - String result = ""; - if(dettPratica.isNormEsenteBollo()){ - result = "Esente"; - } else { - BigDecimal importoBolliVal; - if( Validator.isNotNull(pagamento.getImporto())){ - importoBolliVal = new BigDecimal(pagamento.getImporto()); - } else{ - importoBolliVal = new BigDecimal(0.00); - } - result = NumberFormat.getCurrencyInstance(Locale.ITALY).format(importoBolliVal); - } - out.print(result); - %> - - - - - <% - String[] notAllowed = new String[]{PagamentoConstants.UTILIZZATA_SOSTITUITA, PagamentoConstants.UTILIZZATA_RIFIUTATA, PagamentoConstants.UTILIZZATA_NON_PAGABILE}; - %> - - <% - String buttonFormId = "pagamentoFormButton_"+index; - String contentFormId = "pagamentoFormContent_"+index; - String formNameBollettino = "fmPagamenti_"+index; - %> - - - -
- - - - - -
- - - - - - - - - -
-
- - <% - String[] notAllowed = new String[]{PagamentoConstants.UTILIZZATA_SOSTITUITA, PagamentoConstants.UTILIZZATA_RIFIUTATA, PagamentoConstants.UTILIZZATA_NON_PAGABILE}; - %> - - <% - String buttonId = "pagamentoButton_"+index; - String contentId = "pagamentoContent_"+index; - %> - - - -
- - - - + + + + + + + + <% + String result; + if (dettPratica.isNormEsenteSpese()) { + result = "Esente"; + } else { + BigDecimal importoSpeseVal; + if (Validator.isNotNull(pagamento.getImporto())) { + importoSpeseVal = new BigDecimal(pagamento.getImporto()); + } else { + importoSpeseVal = new BigDecimal(0.00); + } + result = NumberFormat.getCurrencyInstance(Locale.ITALY).format(importoSpeseVal); + } + out.print(result); + %> + + - - + <% + String result; + if (dettPratica.isNormEsenteBollo()) { + result = "Esente"; + } else { + BigDecimal importoBolliVal; + if (Validator.isNotNull(pagamento.getImporto())) { + importoBolliVal = new BigDecimal(pagamento.getImporto()); + } else { + importoBolliVal = new BigDecimal(0.00); + } + result = NumberFormat.getCurrencyInstance(Locale.ITALY).format(importoBolliVal); + } + out.print(result); + %> + + + + <% + String[] notAllowed = new String[]{PagamentoConstants.UTILIZZATA_SOSTITUITA, + PagamentoConstants.UTILIZZATA_RIFIUTATA, PagamentoConstants.UTILIZZATA_NON_PAGABILE}; + %> + + <% + String buttonFormId = "pagamentoFormButton_" + index; + String contentFormId = "pagamentoFormContent_" + index; + String formNameBollettino = "fmPagamenti_" + index; + %> + + + +
+ + + + + +
+ + + + + + +
- - - +
+ + <% + String[] notAllowed = new String[]{PagamentoConstants.UTILIZZATA_SOSTITUITA, + PagamentoConstants.UTILIZZATA_RIFIUTATA, PagamentoConstants.UTILIZZATA_NON_PAGABILE}; + %> + + <% + String buttonId = "pagamentoButton_" + index; + String contentId = "pagamentoContent_" + index; + %> + + + +
+ + + + + + + + + + + + + + + +
+ + + + +
-
- - - - - - - - +
- - - -
-
- diff --git a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/DisponibilitaLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/DisponibilitaLocalServiceImpl.java index d713bae6..36dbee16 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/DisponibilitaLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/DisponibilitaLocalServiceImpl.java @@ -108,8 +108,8 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase Organization organization = OrganizationLocalServiceUtil.fetchOrganization(presidio); SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); - Disponibilita disponibilita = disponibilitaPersistence.create(counterLocalService.increment(Disponibilita.class - .getName())); + Disponibilita disponibilita = + disponibilitaPersistence.create(counterLocalService.increment(Disponibilita.class.getName())); User user = userPersistence.findByPrimaryKey(userId); Date now = new Date(); disponibilita.setCompanyId(serviceContext.getCompanyId()); @@ -124,7 +124,7 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase disponibilita.setPresidio(presidio); disponibilita.setExactDate(sdf.format(startDate)); disponibilita.setDisponibile(true); - disponibilita = disponibilitaLocalService.updateDisponibilita(disponibilita); + disponibilita = updateDisponibilita(disponibilita); return disponibilita; } @@ -134,8 +134,8 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase Organization organization = OrganizationLocalServiceUtil.fetchOrganization(presidio); SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); - Disponibilita disponibilita = disponibilitaPersistence.create(counterLocalService.increment(Disponibilita.class - .getName())); + Disponibilita disponibilita = + disponibilitaPersistence.create(counterLocalService.increment(Disponibilita.class.getName())); User user = userPersistence.findByPrimaryKey(userId); Date now = new Date(); disponibilita.setCompanyId(serviceContext.getCompanyId()); @@ -150,7 +150,7 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase disponibilita.setPresidio(presidio); disponibilita.setExactDate(sdf.format(startDate)); disponibilita.setDisponibile(false); - disponibilita = disponibilitaLocalService.updateDisponibilita(disponibilita); + disponibilita = updateDisponibilita(disponibilita); return disponibilita; } @@ -166,11 +166,12 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase List users = userLocalService.getOrganizationUsers(presidioId); for (User user : users) { Role portosSupporto = RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_supporto"); - Role portosIstruttore = RoleLocalServiceUtil.getRole(organization.getCompanyId(), - "portos_calendario"); + Role portosIstruttore = + RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_calendario"); if (!userLocalService.hasRoleUser(portosSupporto.getRoleId(), user.getUserId())) { - boolean isIstruttore = UserGroupRoleLocalServiceUtil.hasUserGroupRole(user.getUserId(), - organization.getGroupId(), portosIstruttore.getRoleId()); + boolean isIstruttore = + UserGroupRoleLocalServiceUtil.hasUserGroupRole(user.getUserId(), + organization.getGroupId(), portosIstruttore.getRoleId()); if (isIstruttore) { userDefinitivo.add(user); } @@ -204,7 +205,7 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase for (Iterator iterator = results.iterator(); iterator.hasNext();) { Disponibilita disponibilita = iterator.next(); disponibilita.setDisponibile(true); - disponibilitaLocalService.updateDisponibilita(disponibilita); + updateDisponibilita(disponibilita); } } } @@ -242,7 +243,7 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase for (Iterator iterator = results.iterator(); iterator.hasNext();) { Disponibilita disponibilita = iterator.next(); disponibilita.setDisponibile(true); - disponibilitaLocalService.updateDisponibilita(disponibilita); + updateDisponibilita(disponibilita); } } } @@ -269,8 +270,9 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase Calendar cal2 = Calendar.getInstance(); cal1.setTime(date1); cal2.setTime(date2); - boolean sameDay = cal1.get(Calendar.YEAR) == cal2.get(Calendar.YEAR) - && cal1.get(Calendar.DAY_OF_YEAR) == cal2.get(Calendar.DAY_OF_YEAR); + boolean sameDay = + cal1.get(Calendar.YEAR) == cal2.get(Calendar.YEAR) + && cal1.get(Calendar.DAY_OF_YEAR) == cal2.get(Calendar.DAY_OF_YEAR); return sameDay; } @@ -328,7 +330,7 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase dynamicQuery.add(RestrictionsFactoryUtil.ge("startDate", start)); Order defaultOrder = OrderFactoryUtil.asc("startDate"); dynamicQuery.addOrder(defaultOrder); - return disponibilitaLocalService.dynamicQuery(dynamicQuery, startRow, endRow); + return dynamicQuery(dynamicQuery, startRow, endRow); } @Override @@ -340,7 +342,7 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase dynamicQuery.add(RestrictionsFactoryUtil.ge("startDate", start)); Order defaultOrder = OrderFactoryUtil.asc("startDate"); dynamicQuery.addOrder(defaultOrder); - return disponibilitaLocalService.dynamicQuery(dynamicQuery, QueryUtil.ALL_POS, QueryUtil.ALL_POS).size(); + return dynamicQuery(dynamicQuery, QueryUtil.ALL_POS, QueryUtil.ALL_POS).size(); } @SuppressWarnings("unchecked") @@ -352,11 +354,11 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase List orgIds = new ArrayList(); try { Role dirigenteGenerale = RoleLocalServiceUtil.getRole(user.getCompanyId(), "dirigente_generale"); - boolean isDirigenteGenerale = RoleLocalServiceUtil.hasUserRole(user.getUserId(), - dirigenteGenerale.getRoleId()); + boolean isDirigenteGenerale = + RoleLocalServiceUtil.hasUserRole(user.getUserId(), dirigenteGenerale.getRoleId()); if (isDirigenteGenerale) { - List orgs = OrganizationLocalServiceUtil.getOrganizations(QueryUtil.ALL_POS, - QueryUtil.ALL_POS); + List orgs = + OrganizationLocalServiceUtil.getOrganizations(QueryUtil.ALL_POS, QueryUtil.ALL_POS); for (Organization organization : orgs) { if (organization.getParentOrganization() != null) { orgIds.add(organization.getOrganizationId()); @@ -366,8 +368,9 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase List orgs = OrganizationLocalServiceUtil.getUserOrganizations(funzionarioId); for (Organization organization : orgs) { Role portosPO = RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_po"); - boolean isPO = UserGroupRoleLocalServiceUtil.hasUserGroupRole(funzionarioId, - organization.getGroupId(), portosPO.getRoleId()); + boolean isPO = + UserGroupRoleLocalServiceUtil.hasUserGroupRole(funzionarioId, organization.getGroupId(), + portosPO.getRoleId()); if (isPO) { orgIds.add(organization.getOrganizationId()); } @@ -391,7 +394,7 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase dynamicQuery.add(RestrictionsFactoryUtil.ge("startDate", start)); Order defaultOrder = OrderFactoryUtil.asc("startDate"); dynamicQuery.addOrder(defaultOrder); - return disponibilitaLocalService.dynamicQuery(dynamicQuery, startRow, endRow); + return dynamicQuery(dynamicQuery, startRow, endRow); } @Override @@ -402,11 +405,11 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase List orgIds = new ArrayList(); try { Role dirigenteGenerale = RoleLocalServiceUtil.getRole(user.getCompanyId(), "dirigente_generale"); - boolean isDirigenteGenerale = RoleLocalServiceUtil.hasUserRole(user.getUserId(), - dirigenteGenerale.getRoleId()); + boolean isDirigenteGenerale = + RoleLocalServiceUtil.hasUserRole(user.getUserId(), dirigenteGenerale.getRoleId()); if (isDirigenteGenerale) { - List orgs = OrganizationLocalServiceUtil.getOrganizations(QueryUtil.ALL_POS, - QueryUtil.ALL_POS); + List orgs = + OrganizationLocalServiceUtil.getOrganizations(QueryUtil.ALL_POS, QueryUtil.ALL_POS); for (Organization organization : orgs) { if (organization.getParentOrganization() != null) { orgIds.add(organization.getOrganizationId()); @@ -416,8 +419,9 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase List orgs = OrganizationLocalServiceUtil.getUserOrganizations(funzionarioId); for (Organization organization : orgs) { Role portosPO = RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_po"); - boolean isPO = UserGroupRoleLocalServiceUtil.hasUserGroupRole(funzionarioId, - organization.getGroupId(), portosPO.getRoleId()); + boolean isPO = + UserGroupRoleLocalServiceUtil.hasUserGroupRole(funzionarioId, organization.getGroupId(), + portosPO.getRoleId()); if (isPO) { orgIds.add(organization.getOrganizationId()); } @@ -441,7 +445,7 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase dynamicQuery.add(RestrictionsFactoryUtil.ge("startDate", start)); Order defaultOrder = OrderFactoryUtil.asc("startDate"); dynamicQuery.addOrder(defaultOrder); - return disponibilitaLocalService.dynamicQuery(dynamicQuery, QueryUtil.ALL_POS, QueryUtil.ALL_POS).size(); + return dynamicQuery(dynamicQuery, QueryUtil.ALL_POS, QueryUtil.ALL_POS).size(); } @SuppressWarnings("unchecked") @@ -453,11 +457,11 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase List orgIds = new ArrayList(); try { Role dirigenteGenerale = RoleLocalServiceUtil.getRole(user.getCompanyId(), "dirigente_generale"); - boolean isDirigenteGenerale = RoleLocalServiceUtil.hasUserRole(user.getUserId(), - dirigenteGenerale.getRoleId()); + boolean isDirigenteGenerale = + RoleLocalServiceUtil.hasUserRole(user.getUserId(), dirigenteGenerale.getRoleId()); if (isDirigenteGenerale) { - List orgs = OrganizationLocalServiceUtil.getOrganizations(QueryUtil.ALL_POS, - QueryUtil.ALL_POS); + List orgs = + OrganizationLocalServiceUtil.getOrganizations(QueryUtil.ALL_POS, QueryUtil.ALL_POS); for (Organization organization : orgs) { if (organization.getParentOrganization() != null) { orgIds.add(organization.getOrganizationId()); @@ -467,8 +471,9 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase List orgs = OrganizationLocalServiceUtil.getUserOrganizations(funzionarioId); for (Organization organization : orgs) { Role portosPO = RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_po"); - boolean isPO = UserGroupRoleLocalServiceUtil.hasUserGroupRole(funzionarioId, - organization.getGroupId(), portosPO.getRoleId()); + boolean isPO = + UserGroupRoleLocalServiceUtil.hasUserGroupRole(funzionarioId, organization.getGroupId(), + portosPO.getRoleId()); if (isPO) { orgIds.add(organization.getOrganizationId()); } @@ -484,7 +489,7 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase dynamicQuery.add(RestrictionsFactoryUtil.ge("startDate", start)); Order defaultOrder = OrderFactoryUtil.asc("startDate"); dynamicQuery.addOrder(defaultOrder); - return disponibilitaLocalService.dynamicQuery(dynamicQuery, startRow, endRow); + return dynamicQuery(dynamicQuery, startRow, endRow); } @Override @@ -494,11 +499,11 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase List orgIds = new ArrayList(); try { Role dirigenteGenerale = RoleLocalServiceUtil.getRole(user.getCompanyId(), "dirigente_generale"); - boolean isDirigenteGenerale = RoleLocalServiceUtil.hasUserRole(user.getUserId(), - dirigenteGenerale.getRoleId()); + boolean isDirigenteGenerale = + RoleLocalServiceUtil.hasUserRole(user.getUserId(), dirigenteGenerale.getRoleId()); if (isDirigenteGenerale) { - List orgs = OrganizationLocalServiceUtil.getOrganizations(QueryUtil.ALL_POS, - QueryUtil.ALL_POS); + List orgs = + OrganizationLocalServiceUtil.getOrganizations(QueryUtil.ALL_POS, QueryUtil.ALL_POS); for (Organization organization : orgs) { if (organization.getParentOrganization() != null) { orgIds.add(organization.getOrganizationId()); @@ -508,8 +513,9 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase List orgs = OrganizationLocalServiceUtil.getUserOrganizations(funzionarioId); for (Organization organization : orgs) { Role portosPO = RoleLocalServiceUtil.getRole(organization.getCompanyId(), "portos_po"); - boolean isPO = UserGroupRoleLocalServiceUtil.hasUserGroupRole(funzionarioId, - organization.getGroupId(), portosPO.getRoleId()); + boolean isPO = + UserGroupRoleLocalServiceUtil.hasUserGroupRole(funzionarioId, organization.getGroupId(), + portosPO.getRoleId()); if (isPO) { orgIds.add(organization.getOrganizationId()); } @@ -525,7 +531,7 @@ public class DisponibilitaLocalServiceImpl extends DisponibilitaLocalServiceBase dynamicQuery.add(RestrictionsFactoryUtil.ge("startDate", start)); Order defaultOrder = OrderFactoryUtil.asc("startDate"); dynamicQuery.addOrder(defaultOrder); - return disponibilitaLocalService.dynamicQuery(dynamicQuery, QueryUtil.ALL_POS, QueryUtil.ALL_POS).size(); + return dynamicQuery(dynamicQuery, QueryUtil.ALL_POS, QueryUtil.ALL_POS).size(); } private Date formatDateTime(String orario, Date day) throws ParseException { diff --git a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/PrenotazioneLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/PrenotazioneLocalServiceImpl.java index 284d7f62..b0bb7950 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/PrenotazioneLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/docroot/WEB-INF/src/it/tref/portos/calendar/appointments/service/impl/PrenotazioneLocalServiceImpl.java @@ -60,8 +60,8 @@ public class PrenotazioneLocalServiceImpl extends PrenotazioneLocalServiceBaseIm Date endDate, String descrizione, String telefono, String email, long presidio, ServiceContext serviceContext) throws SystemException, PortalException { - Prenotazione prenotazione = prenotazionePersistence.create(counterLocalService.increment(Prenotazione.class - .getName())); + Prenotazione prenotazione = + prenotazionePersistence.create(counterLocalService.increment(Prenotazione.class.getName())); User user = userPersistence.findByPrimaryKey(userId); Date now = new Date(); prenotazione.setCompanyId(serviceContext.getCompanyId()); @@ -77,7 +77,7 @@ public class PrenotazioneLocalServiceImpl extends PrenotazioneLocalServiceBaseIm prenotazione.setDescLong(descrizione); prenotazione.setTelefono(telefono); prenotazione.setEmail(email); - prenotazione = prenotazioneLocalService.updatePrenotazione(prenotazione); + prenotazione = updatePrenotazione(prenotazione); return prenotazione; } @@ -91,7 +91,7 @@ public class PrenotazioneLocalServiceImpl extends PrenotazioneLocalServiceBaseIm prenotazione.setStartDate(startDate); prenotazione.setEndDate(endDate); prenotazione.setDescLong(descrizione); - prenotazione = prenotazioneLocalService.updatePrenotazione(prenotazione); + prenotazione = updatePrenotazione(prenotazione); return prenotazione; } @@ -185,10 +185,11 @@ public class PrenotazioneLocalServiceImpl extends PrenotazioneLocalServiceBaseIm if (org != null) { List users = userLocalService.getOrganizationUsers(presidioId); for (User user : users) { - boolean isCalendario = UserGroupRoleLocalServiceUtil.hasUserGroupRole(user.getUserId(), - org.getGroupId(), portosCalendario.getRoleId()); + boolean isCalendario = + UserGroupRoleLocalServiceUtil.hasUserGroupRole(user.getUserId(), org.getGroupId(), + portosCalendario.getRoleId()); if (isCalendario) { - DynamicQuery dynamicQuery = dynamicQuery(); + DynamicQuery dynamicQuery = dynamicQuery(); dynamicQuery.add(RestrictionsFactoryUtil.eq("funzionarioId", user.getUserId())); dynamicQuery.add(RestrictionsFactoryUtil.between("startDate", fromCal.getTime(), toCal.getTime())); dynamicQuery.add(RestrictionsFactoryUtil.eq("groupId", org.getGroupId())); diff --git a/liferay-plugins-sdk-6.2/portlets/portos-cookies-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/cookies/action/StartUpAction.java b/liferay-plugins-sdk-6.2/portlets/portos-cookies-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/cookies/action/StartUpAction.java index 0297c7e4..2e85f9bd 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-cookies-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/cookies/action/StartUpAction.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-cookies-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/cookies/action/StartUpAction.java @@ -25,7 +25,7 @@ import com.liferay.portlet.expando.service.ExpandoTableLocalServiceUtil; public class StartUpAction extends SimpleAction { - private final static Log _log = LogFactoryUtil.getLog(StartUpAction.class); + private static final Log _log = LogFactoryUtil.getLog(StartUpAction.class); @Override public void run(String[] companyIds) throws ActionException { diff --git a/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/deployalert/NoSuchNotificationLogException.java b/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/deployalert/NoSuchNotificationLogException.java new file mode 100644 index 00000000..ec4c309e --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/deployalert/NoSuchNotificationLogException.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. + * + * This library is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. + * + * This library is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + */ + +package it.tref.liferay.portos.deployalert; + +import com.liferay.portal.NoSuchModelException; + +/** + * @author Matteo + */ +public class NoSuchNotificationLogException extends NoSuchModelException { + + public NoSuchNotificationLogException() { + super(); + } + + public NoSuchNotificationLogException(String msg) { + super(msg); + } + + public NoSuchNotificationLogException(String msg, Throwable cause) { + super(msg, cause); + } + + public NoSuchNotificationLogException(Throwable cause) { + super(cause); + } + +} \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/deployalert/NoSuchNotificationMailException.java b/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/deployalert/NoSuchNotificationMailException.java new file mode 100644 index 00000000..f9d94c11 --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/deployalert/NoSuchNotificationMailException.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. + * + * This library is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. + * + * This library is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + */ + +package it.tref.liferay.portos.deployalert; + +import com.liferay.portal.NoSuchModelException; + +/** + * @author Matteo + */ +public class NoSuchNotificationMailException extends NoSuchModelException { + + public NoSuchNotificationMailException() { + super(); + } + + public NoSuchNotificationMailException(String msg) { + super(msg); + } + + public NoSuchNotificationMailException(String msg, Throwable cause) { + super(msg, cause); + } + + public NoSuchNotificationMailException(Throwable cause) { + super(cause); + } + +} \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/action/DeployAction.java b/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/action/DeployAction.java index 027b1b69..5297156b 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/action/DeployAction.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/action/DeployAction.java @@ -1,5 +1,14 @@ package it.tref.liferay.portos.deployalert.action; +import it.tref.liferay.portos.deployalert.constants.MailConstants; +import it.tref.liferay.portos.deployalert.model.NotificationMail; +import it.tref.liferay.portos.deployalert.service.NotificationLogLocalServiceUtil; +import it.tref.liferay.portos.deployalert.service.NotificationMailLocalServiceUtil; +import it.tref.liferay.portos.deployalert.util.DeployAlertUtil; +import it.tref.liferay.portos.mailmanager.shared.messaging.util.MailManagerUtil; + +import java.util.List; + import com.liferay.portal.kernel.events.ActionException; import com.liferay.portal.kernel.events.SimpleAction; import com.liferay.portal.kernel.exception.PortalException; @@ -16,30 +25,12 @@ import com.liferay.portal.model.Company; import com.liferay.portal.service.ServiceContext; import com.liferay.portal.util.PortalUtil; -import it.tref.liferay.portos.deployalert.constants.MailConstants; -import it.tref.liferay.portos.deployalert.model.NotificationMail; -import it.tref.liferay.portos.deployalert.service.NotificationLogLocalServiceUtil; -import it.tref.liferay.portos.deployalert.service.NotificationMailLocalServiceUtil; -import it.tref.liferay.portos.deployalert.util.DeployAlertUtil; -import it.tref.liferay.portos.mailmanager.shared.messaging.util.MailManagerUtil; - -import java.util.List; - public class DeployAction extends SimpleAction { - private final static Log _log = LogFactoryUtil.getLog(DeployAction.class); + private static final Log _log = LogFactoryUtil.getLog(DeployAction.class); @Override public void run(final String[] ids) throws ActionException { - /* - * ServiceContext serviceContext = DeployAlertUtil.getServiceContext(); - * try { PermissionThreadLocal - * .setPermissionChecker(PermissionCheckerFactoryUtil - * .create(UserLocalServiceUtil .getUser(serviceContext.getUserId()))); - * } catch (Exception e) { _log.error(e, e); } - * DeployAlertUtil.addDefaultDeployMailTemplate(serviceContext); - * DeployAlertUtil.addDefaultUndeployMailTemplate(serviceContext); - */ MessageBusUtil.registerMessageListener(DestinationNames.HOT_DEPLOY, new MessageListener() { @@ -48,7 +39,6 @@ public class DeployAction extends SimpleAction { String evento = message.getString("command"); String nomePlugin = message.getString("servletContextName"); - if (evento.equals("undeploy") && nomePlugin.equals("portos-deploy-alert-portlet")) { try { NotificationLogLocalServiceUtil.addNotification(nomePlugin, evento); @@ -59,16 +49,12 @@ public class DeployAction extends SimpleAction { } else if (evento.equals("deploy") || evento.equals("undeploy")) { try { List notifications; - NotificationLogLocalServiceUtil.addNotification(nomePlugin, evento); - - notifications = NotificationMailLocalServiceUtil.findNotifications( - PortalUtil.getDefaultCompanyId(), nomePlugin); - + notifications = + NotificationMailLocalServiceUtil.findNotifications(PortalUtil.getDefaultCompanyId(), + nomePlugin); for (int i = 0; i < notifications.size(); i++) { - String templateName = notifications.get(i).getNomeTemplate(); - if (templateName.equals(MailConstants.DEFAULT_TEMPLATE)) { if (evento.equals("deploy")) { templateName = MailConstants.DEFAULT_DEPLOY_TEMPLATE; @@ -76,14 +62,11 @@ public class DeployAction extends SimpleAction { templateName = MailConstants.DEFAULT_UNDEPLOY_TEMPLATE; } } - JSONObject parametri = DeployAlertUtil.getParametri(nomePlugin, evento); - ServiceContext serviceContext = DeployAlertUtil.getServiceContext(); MailManagerUtil.sendMailByTemplateName(Company.class.toString(), serviceContext.getCompanyId(), templateName, parametri, serviceContext); } - } catch (Exception e) { _log.error(e, e); } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/constants/MailConstants.java b/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/constants/MailConstants.java index fbff52dc..da04b75a 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/constants/MailConstants.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/constants/MailConstants.java @@ -2,10 +2,7 @@ package it.tref.liferay.portos.deployalert.constants; public class MailConstants { - public static final String DEFAULT_TEMPLATE = "default"; - - public static final String DEFAULT_DEPLOY_TEMPLATE = "default-deploy"; - - public static final String DEFAULT_UNDEPLOY_TEMPLATE = "default-undeploy"; - + public static final String DEFAULT_TEMPLATE = "default"; + public static final String DEFAULT_DEPLOY_TEMPLATE = "default-deploy"; + public static final String DEFAULT_UNDEPLOY_TEMPLATE = "default-undeploy"; } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/control/DeployAlertControl.java b/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/control/DeployAlertControl.java index daa35ae1..185ccbd7 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/control/DeployAlertControl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/control/DeployAlertControl.java @@ -8,17 +8,14 @@ import com.liferay.portlet.BaseControlPanelEntry; public class DeployAlertControl extends BaseControlPanelEntry { + @Override public boolean hasAccessPermission(PermissionChecker permissionChecker, Group group, Portlet portlet) throws Exception { long companyId = PortalUtil.getDefaultCompanyId(); - if (companyId == permissionChecker.getCompanyId()) { return true; } - return false; - } - } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/model/impl/NotificationLogImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/model/impl/NotificationLogImpl.java index 351c895b..7ca93a29 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/model/impl/NotificationLogImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/model/impl/NotificationLogImpl.java @@ -1,34 +1,29 @@ /** - * Copyright (c) 2000-present Liferay, Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. + * Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software + * Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in + * the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. */ package it.tref.liferay.portos.deployalert.model.impl; /** - * The extended model implementation for the NotificationLog service. Represents a row in the "NO_NotificationLog" database table, with each column mapped to a property of this class. - * + * The extended model implementation for the NotificationLog service. Represents a row in the + * "NO_NotificationLog" database table, with each column mapped to a property of this class. *

- * Helper methods and all application logic should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.deployalert.model.NotificationLog} interface. + * Helper methods and all application logic should be put in this class. Whenever methods are added, rerun + * ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.deployalert.model.NotificationLog} + * interface. *

* * @author Matteo */ +@SuppressWarnings("serial") public class NotificationLogImpl extends NotificationLogBaseImpl { /* - * NOTE FOR DEVELOPERS: - * - * Never reference this class directly. All methods that expect a notification log model instance should use the {@link it.tref.liferay.portos.deployalert.model.NotificationLog} interface instead. + * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a notification log model + * instance should use the {@link it.tref.liferay.portos.deployalert.model.NotificationLog} interface instead. */ - public NotificationLogImpl() { - } -} \ No newline at end of file + public NotificationLogImpl() {} +} diff --git a/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/model/impl/NotificationMailImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/model/impl/NotificationMailImpl.java index 49c30b14..d033b281 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/model/impl/NotificationMailImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/model/impl/NotificationMailImpl.java @@ -1,41 +1,30 @@ /** - * Copyright (c) 2000-present Liferay, Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. + * Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software + * Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in + * the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. */ package it.tref.liferay.portos.deployalert.model.impl; - /** * The extended model implementation for the NotificationMail service. Represents a row in the - * "NO_NotificationMail" database table, with each column mapped to a property of this - * class. + * "NO_NotificationMail" database table, with each column mapped to a property of this class. *

- * Helper methods and all application logic should be put in this class. Whenever methods are added, - * rerun ServiceBuilder to copy their definitions into the - * {@link it.tref.liferay.portos.deployalert.model.NotificationMail} interface. + * Helper methods and all application logic should be put in this class. Whenever methods are added, rerun + * ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.deployalert.model.NotificationMail} + * interface. *

* * @author Matteo */ +@SuppressWarnings("serial") public class NotificationMailImpl extends NotificationMailBaseImpl { - /* - * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a - * notification mail model instance should use the {@link - * it.tref.liferay.portos.deployalert.model.NotificationMail} interface instead. - */ - public NotificationMailImpl() { - - } - + /* + * NOTE FOR DEVELOPERS: Never reference this class directly. All methods that expect a notification mail model + * instance should use the {@link it.tref.liferay.portos.deployalert.model.NotificationMail} interface instead. + */ + public NotificationMailImpl() {} } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/portlet/NotificatorPortlet.java b/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/portlet/NotificatorPortlet.java index 62003a74..79fcadd2 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/portlet/NotificatorPortlet.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/portlet/NotificatorPortlet.java @@ -1,5 +1,11 @@ package it.tref.liferay.portos.deployalert.portlet; +import it.tref.liferay.portos.deployalert.model.NotificationMail; +import it.tref.liferay.portos.deployalert.service.NotificationMailLocalServiceUtil; + +import javax.portlet.ActionRequest; +import javax.portlet.ActionResponse; + import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.kernel.servlet.SessionErrors; @@ -8,61 +14,45 @@ import com.liferay.portal.service.ServiceContext; import com.liferay.portal.service.ServiceContextFactory; import com.liferay.util.bridges.mvc.MVCPortlet; -import it.tref.liferay.portos.deployalert.model.NotificationMail; -import it.tref.liferay.portos.deployalert.service.NotificationMailLocalServiceUtil; - -import javax.portlet.ActionRequest; -import javax.portlet.ActionResponse; - -/** - * Portlet implementation class AdminDeployNotificatorPortlet - */ public class NotificatorPortlet extends MVCPortlet { - public void addNotification(ActionRequest request, ActionResponse response) throws PortalException, SystemException { - - ServiceContext serviceContext = ServiceContextFactory.getInstance(NotificationMail.class.getName(), request); - - String nomePlugin = ParamUtil.getString(request, "nomePlugin"); - String nomeTemplate = ParamUtil.getString(request, "nomeTemplate"); - - try { - NotificationMailLocalServiceUtil.addNotification(nomePlugin, nomeTemplate, serviceContext); - } catch (PortalException e) { - SessionErrors.add(request, e.getClass()); - - response.setRenderParameter("mvcPath", "/html/notificator/edit_notification.jsp"); - } - } - - public void deleteNotification(ActionRequest request, ActionResponse response) throws PortalException, - SystemException { - - long notificationId = ParamUtil.getLong(request, "notificationId"); - - try { - NotificationMailLocalServiceUtil.deleteNotificationMail(notificationId); - - } catch (PortalException pe) { - SessionErrors.add(request, pe.getClass().getName()); - } - } - - public void updateNotification(ActionRequest request, ActionResponse response) throws PortalException, - SystemException { - - ServiceContext serviceContext = ServiceContextFactory.getInstance(NotificationMail.class.getName(), request); - - String nomePlugin = ParamUtil.getString(request, "nomePlugin"); - String nomeTemplate = ParamUtil.getString(request, "nomeTemplate"); - long notificationId = ParamUtil.getLong(request, "notificationId"); - - try { - NotificationMailLocalServiceUtil.updateNotification(nomePlugin, nomeTemplate, serviceContext, notificationId); - } catch (PortalException pe) { - SessionErrors.add(request, pe.getClass()); - - response.setRenderParameter("mvcPath", "/html/notificator/edit_notification.jsp"); - } - } + public void addNotification(ActionRequest request, ActionResponse response) throws PortalException, SystemException { + + ServiceContext serviceContext = ServiceContextFactory.getInstance(NotificationMail.class.getName(), request); + String nomePlugin = ParamUtil.getString(request, "nomePlugin"); + String nomeTemplate = ParamUtil.getString(request, "nomeTemplate"); + try { + NotificationMailLocalServiceUtil.addNotification(nomePlugin, nomeTemplate, serviceContext); + } catch (PortalException e) { + SessionErrors.add(request, e.getClass()); + response.setRenderParameter("mvcPath", "/html/notificator/edit_notification.jsp"); + } + } + + public void deleteNotification(ActionRequest request, ActionResponse response) throws PortalException, + SystemException { + + long notificationId = ParamUtil.getLong(request, "notificationId"); + try { + NotificationMailLocalServiceUtil.deleteNotificationMail(notificationId); + } catch (PortalException pe) { + SessionErrors.add(request, pe.getClass().getName()); + } + } + + public void updateNotification(ActionRequest request, ActionResponse response) throws PortalException, + SystemException { + + ServiceContext serviceContext = ServiceContextFactory.getInstance(NotificationMail.class.getName(), request); + String nomePlugin = ParamUtil.getString(request, "nomePlugin"); + String nomeTemplate = ParamUtil.getString(request, "nomeTemplate"); + long notificationId = ParamUtil.getLong(request, "notificationId"); + try { + NotificationMailLocalServiceUtil.updateNotification(nomePlugin, nomeTemplate, serviceContext, + notificationId); + } catch (PortalException pe) { + SessionErrors.add(request, pe.getClass()); + response.setRenderParameter("mvcPath", "/html/notificator/edit_notification.jsp"); + } + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/service/impl/NotificationLogLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/service/impl/NotificationLogLocalServiceImpl.java index 92f0414f..f581bdc7 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/service/impl/NotificationLogLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/service/impl/NotificationLogLocalServiceImpl.java @@ -1,23 +1,13 @@ /** - * Copyright (c) 2000-present Liferay, Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. + * Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software + * Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in + * the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. */ package it.tref.liferay.portos.deployalert.service.impl; -import com.liferay.portal.kernel.exception.PortalException; -import com.liferay.portal.kernel.exception.SystemException; -import com.liferay.portal.kernel.util.Validator; - import it.tref.liferay.portos.deployalert.NotificationNomePluginException; import it.tref.liferay.portos.deployalert.NotificationTipoException; import it.tref.liferay.portos.deployalert.model.NotificationLog; @@ -25,17 +15,18 @@ import it.tref.liferay.portos.deployalert.service.base.NotificationLogLocalServi import java.util.Date; +import com.liferay.portal.kernel.exception.PortalException; +import com.liferay.portal.kernel.exception.SystemException; +import com.liferay.portal.kernel.util.Validator; + /** * The implementation of the notification log local service. *

- * All custom service methods should be put in this class. Whenever methods are - * added, rerun ServiceBuilder to copy their definitions into the - * {@link it.tref.liferay.portos.deployalert.service.NotificationLogLocalService} - * interface. + * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy + * their definitions into the {@link it.tref.liferay.portos.deployalert.service.NotificationLogLocalService} interface. *

- * 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 Matteo @@ -44,22 +35,17 @@ import java.util.Date; */ public class NotificationLogLocalServiceImpl extends NotificationLogLocalServiceBaseImpl { - public NotificationLog addNotification(String nomePlugin, String tipo) throws SystemException, - PortalException { + @Override + public NotificationLog addNotification(String nomePlugin, String tipo) throws SystemException, PortalException { Date now = new Date(); - validate(nomePlugin, tipo); - long notificationId = counterLocalService.increment(NotificationLog.class.getName()); - NotificationLog notification = notificationLogPersistence.create(notificationId); - notification.setTipo(tipo); notification.setNomePlugin(nomePlugin); notification.setData(now); notificationLogPersistence.update(notification); - return notification; } @@ -72,6 +58,5 @@ public class NotificationLogLocalServiceImpl extends NotificationLogLocalService if (Validator.isNull(tipo)) { throw new NotificationTipoException(); } - } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/service/impl/NotificationLogServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/service/impl/NotificationLogServiceImpl.java index 1b74b122..a8b75ab9 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/service/impl/NotificationLogServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/service/impl/NotificationLogServiceImpl.java @@ -1,15 +1,9 @@ /** - * Copyright (c) 2000-present Liferay, Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. + * Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software + * Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in + * the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. */ package it.tref.liferay.portos.deployalert.service.impl; @@ -18,12 +12,12 @@ import it.tref.liferay.portos.deployalert.service.base.NotificationLogServiceBas /** * The implementation of the notification log remote service. - * *

- * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy their definitions into the {@link it.tref.liferay.portos.deployalert.service.NotificationLogService} interface. - * + * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy + * their definitions into the {@link it.tref.liferay.portos.deployalert.service.NotificationLogService} interface. *

- * 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 Matteo @@ -32,8 +26,8 @@ import it.tref.liferay.portos.deployalert.service.base.NotificationLogServiceBas */ public class NotificationLogServiceImpl extends NotificationLogServiceBaseImpl { /* - * NOTE FOR DEVELOPERS: - * - * Never reference this interface directly. Always use {@link it.tref.liferay.portos.deployalert.service.NotificationLogServiceUtil} to access the notification log remote service. + * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link + * it.tref.liferay.portos.deployalert.service.NotificationLogServiceUtil} to access the notification log remote + * service. */ -} \ No newline at end of file +} diff --git a/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/service/impl/NotificationMailLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/service/impl/NotificationMailLocalServiceImpl.java index 3a82f2ad..1b8d384a 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/service/impl/NotificationMailLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/service/impl/NotificationMailLocalServiceImpl.java @@ -1,19 +1,22 @@ /** - * Copyright (c) 2000-present Liferay, Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. + * Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software + * Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in + * the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. */ package it.tref.liferay.portos.deployalert.service.impl; +import it.tref.liferay.portos.deployalert.NotificationNomePluginException; +import it.tref.liferay.portos.deployalert.NotificationNomeTemplateException; +import it.tref.liferay.portos.deployalert.model.NotificationMail; +import it.tref.liferay.portos.deployalert.service.NotificationMailLocalServiceUtil; +import it.tref.liferay.portos.deployalert.service.base.NotificationMailLocalServiceBaseImpl; + +import java.util.Date; +import java.util.List; + import com.liferay.portal.kernel.dao.orm.Disjunction; import com.liferay.portal.kernel.dao.orm.DynamicQuery; import com.liferay.portal.kernel.dao.orm.OrderFactoryUtil; @@ -25,26 +28,14 @@ import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.model.User; import com.liferay.portal.service.ServiceContext; -import it.tref.liferay.portos.deployalert.NotificationNomePluginException; -import it.tref.liferay.portos.deployalert.NotificationNomeTemplateException; -import it.tref.liferay.portos.deployalert.model.NotificationMail; -import it.tref.liferay.portos.deployalert.service.NotificationMailLocalServiceUtil; -import it.tref.liferay.portos.deployalert.service.base.NotificationMailLocalServiceBaseImpl; - -import java.util.Date; -import java.util.List; - /** * The implementation of the notification mail local service. *

- * All custom service methods should be put in this class. Whenever methods are - * added, rerun ServiceBuilder to copy their definitions into the - * {@link it.tref.liferay.portos.deployalert.service.NotificationMailLocalService} - * interface. + * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy + * their definitions into the {@link it.tref.liferay.portos.deployalert.service.NotificationMailLocalService} interface. *

- * 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 Matteo @@ -53,19 +44,15 @@ import java.util.List; */ public class NotificationMailLocalServiceImpl extends NotificationMailLocalServiceBaseImpl { - public NotificationMail addNotification(String nomePlugin, String nomeTemplate, - ServiceContext serviceContext) throws PortalException, SystemException { + @Override + public NotificationMail addNotification(String nomePlugin, String nomeTemplate, ServiceContext serviceContext) + throws PortalException, SystemException { User user = userPersistence.findByPrimaryKey(serviceContext.getUserId()); - Date now = new Date(); - validate(nomePlugin, nomeTemplate); - long notificationId = counterLocalService.increment(NotificationMail.class.getName()); - NotificationMail notification = notificationMailPersistence.create(notificationId); - notification.setUserId(user.getUserId()); notification.setCompanyId(user.getCompanyId()); notification.setUserName(user.getFullName()); @@ -74,9 +61,7 @@ public class NotificationMailLocalServiceImpl extends NotificationMailLocalServi notification.setExpandoBridgeAttributes(serviceContext); notification.setNomePlugin(nomePlugin); notification.setNomeTemplate(nomeTemplate); - notificationMailPersistence.update(notification); - return notification; } @@ -91,31 +76,25 @@ public class NotificationMailLocalServiceImpl extends NotificationMailLocalServi } } - public NotificationMail updateNotification(String nomePlugin, String nomeTemplate, - ServiceContext serviceContext, long notificationId) throws SystemException, PortalException { + @Override + public NotificationMail updateNotification(String nomePlugin, String nomeTemplate, ServiceContext serviceContext, + long notificationId) throws SystemException, PortalException { Date now = new Date(); - NotificationMail notification = getNotificationMail(notificationId); - validate(nomePlugin, nomeTemplate); - notification.setModifiedDate(serviceContext.getModifiedDate(now)); notification.setNomePlugin(nomePlugin); notification.setNomeTemplate(nomeTemplate); notification.setExpandoBridgeAttributes(serviceContext); - notificationMailPersistence.update(notification); - return notification; } - public List findNotifications(long companyId, int start, int end) - throws SystemException { + @Override + public List findNotifications(long companyId, int start, int end) throws SystemException { - // return notificationMailPersistence.findBycompanyId(companyId, start, - // end); - DynamicQuery query = notificationMailLocalService.dynamicQuery(); + DynamicQuery query = dynamicQuery(); query.addOrder(OrderFactoryUtil.asc("nomePlugin")); List notifications = null; try { @@ -126,31 +105,30 @@ public class NotificationMailLocalServiceImpl extends NotificationMailLocalServi return notifications; } + @Override public List findNotifications(long companyId) throws SystemException { return notificationMailPersistence.findBycompanyId(companyId); } + @Override public int getNotificationCount(long companyId) throws SystemException { return notificationMailPersistence.countBycompanyId(companyId); } - public List findNotifications(long companyId, String servletContextName) - throws SystemException { - - DynamicQuery dynamicQuery = notificationMailLocalService.dynamicQuery(); + @Override + public List findNotifications(long companyId, String servletContextName) throws SystemException { + DynamicQuery dynamicQuery = dynamicQuery(); if (Validator.isNull(servletContextName)) { Disjunction or = RestrictionsFactoryUtil.disjunction(); or.add(RestrictionsFactoryUtil.isNull("nomePlugin")); or.add(RestrictionsFactoryUtil.eq("nomePlugin", StringPool.BLANK)); - dynamicQuery.add(or); } else { dynamicQuery.add(RestrictionsFactoryUtil.eq("nomePlugin", servletContextName)); } - return notificationMailPersistence.findWithDynamicQuery(dynamicQuery); } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/service/impl/NotificationMailServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/service/impl/NotificationMailServiceImpl.java index 69809bad..a26a7135 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/service/impl/NotificationMailServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/service/impl/NotificationMailServiceImpl.java @@ -1,15 +1,9 @@ /** - * Copyright (c) 2000-present Liferay, Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. + * Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software + * Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in + * the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. */ package it.tref.liferay.portos.deployalert.service.impl; @@ -18,17 +12,12 @@ import it.tref.liferay.portos.deployalert.service.base.NotificationMailServiceBa /** * The implementation of the notification mail remote service. - * *

- * All custom service methods should be put in this class. Whenever methods are - * added, rerun ServiceBuilder to copy their definitions into the - * {@link it.tref.liferay.portos.deployalert.service.NotificationMailService} - * interface. - * + * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy + * their definitions into the {@link it.tref.liferay.portos.deployalert.service.NotificationMailService} interface. *

- * 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 Matteo @@ -37,10 +26,8 @@ import it.tref.liferay.portos.deployalert.service.base.NotificationMailServiceBa */ public class NotificationMailServiceImpl extends NotificationMailServiceBaseImpl { /* - * NOTE FOR DEVELOPERS: - * - * Never reference this interface directly. Always use {@link - * it.tref.liferay.portos.deployalert.service.NotificationMailServiceUtil} - * to access the notification mail remote service. + * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link + * it.tref.liferay.portos.deployalert.service.NotificationMailServiceUtil} to access the notification mail remote + * service. */ -} \ No newline at end of file +} diff --git a/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/util/DeployAlertUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/util/DeployAlertUtil.java index c78c5404..f8c8c287 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/util/DeployAlertUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/deployalert/util/DeployAlertUtil.java @@ -1,5 +1,11 @@ package it.tref.liferay.portos.deployalert.util; +import it.tref.liferay.portos.deployalert.constants.MailConstants; +import it.tref.liferay.portos.mailmanager.shared.messaging.util.MailManagerUtil; + +import java.text.SimpleDateFormat; +import java.util.Date; + import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.kernel.json.JSONFactoryUtil; import com.liferay.portal.kernel.json.JSONObject; @@ -16,38 +22,27 @@ import com.liferay.portal.service.ServiceContext; import com.liferay.portal.service.UserLocalServiceUtil; import com.liferay.portal.util.PortalUtil; -import it.tref.liferay.portos.deployalert.constants.MailConstants; -import it.tref.liferay.portos.mailmanager.shared.messaging.util.MailManagerUtil; - -import java.text.SimpleDateFormat; -import java.util.Date; - public class DeployAlertUtil { - private final static Log _log = LogFactoryUtil.getLog(DeployAlertUtil.class); + private static final Log _log = LogFactoryUtil.getLog(DeployAlertUtil.class); public static final ServiceContext getServiceContext() { long companyId = PortalUtil.getDefaultCompanyId(); - ServiceContext serviceContext = new ServiceContext(); Company company; serviceContext.setCompanyId(companyId); - try { company = CompanyLocalServiceUtil.getCompany(companyId); Role role = RoleLocalServiceUtil.getRole(company.getCompanyId(), RoleConstants.ADMINISTRATOR); long userAdminId = UserLocalServiceUtil.getRoleUserIds(role.getRoleId())[0]; - serviceContext.setUserId(userAdminId); serviceContext.setScopeGroupId(company.getGroupId()); - - PermissionThreadLocal.setPermissionChecker(PermissionCheckerFactoryUtil - .create(UserLocalServiceUtil.getUser(userAdminId))); + PermissionThreadLocal.setPermissionChecker(PermissionCheckerFactoryUtil.create(UserLocalServiceUtil + .getUser(userAdminId))); } catch (Exception e) { _log.error(e, e); } - return serviceContext; } @@ -57,10 +52,9 @@ public class DeployAlertUtil { String subject = "Deploy Plugin"; String body = "E' stato effettuato il $evento del plugin $nomePlugin in data $data."; String[] to = { "matteoguggia97@gmail.com" }; - try { - add = MailManagerUtil.addMailTemplate(MailConstants.DEFAULT_DEPLOY_TEMPLATE, - "test@3fconsulting.it", to, null, null, subject, body, false, serviceContext); + add = MailManagerUtil.addMailTemplate(MailConstants.DEFAULT_DEPLOY_TEMPLATE, "test@3fconsulting.it", to, + null, null, subject, body, false, serviceContext); } catch (SystemException e) { _log.error(e, e); } @@ -77,8 +71,8 @@ public class DeployAlertUtil { String[] to = { "matteoguggia97@gmail.com" }; try { - add = MailManagerUtil.addMailTemplate(MailConstants.DEFAULT_UNDEPLOY_TEMPLATE, - "test@3fconsulting.it", to, null, null, subject, body, false, serviceContext); + add = MailManagerUtil.addMailTemplate(MailConstants.DEFAULT_UNDEPLOY_TEMPLATE, "test@3fconsulting.it", to, + null, null, subject, body, false, serviceContext); } catch (SystemException e) { _log.error(e, e); } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/service.properties b/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/service.properties index 4cba4298..06e4866b 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/service.properties +++ b/liferay-plugins-sdk-6.2/portlets/portos-deploy-alert-portlet/docroot/WEB-INF/src/service.properties @@ -13,8 +13,8 @@ ## build.namespace=DA - build.number=10 - build.date=1612446773513 + build.number=11 + build.date=1631869742186 build.auto.upgrade=true ## diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/portlet/RicercaPratichePortlet.java b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/portlet/RicercaPratichePortlet.java index 31f64484..f104f80c 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/portlet/RicercaPratichePortlet.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/portlet/RicercaPratichePortlet.java @@ -31,7 +31,7 @@ import com.liferay.util.bridges.mvc.MVCPortlet; public class RicercaPratichePortlet extends MVCPortlet { - private final static Logger _log = Logger.getLogger(RicercaPratichePortlet.class); + private static final Logger _log = Logger.getLogger(RicercaPratichePortlet.class); public void processAvvisi(ActionRequest actionRequest, ActionResponse actionResponse) throws IOException, PortletException { @@ -112,4 +112,4 @@ public class RicercaPratichePortlet extends MVCPortlet { super.serveResource(resourceRequest, resourceResponse); } } -} \ No newline at end of file +} diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/util/ReportFascicoloUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/util/ReportFascicoloUtil.java index 9448edde..a6f81ca1 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/util/ReportFascicoloUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/util/ReportFascicoloUtil.java @@ -57,7 +57,7 @@ import com.liferay.portal.service.CompanyLocalServiceUtil; public class ReportFascicoloUtil { - private final static SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); + private static final SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); public static Map generateParametersReportFascicolo(long intPraticaId, Locale locale, long companyId) throws PortalException, SystemException { diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/view_fascicolo_dettagli.jsp b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/view_fascicolo_dettagli.jsp index 59b05470..c9f9ada6 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/view_fascicolo_dettagli.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/view_fascicolo_dettagli.jsp @@ -802,15 +802,6 @@
- <% - String copertura = BeanPropertiesUtil.getString(dettPratica, "dccCopertura"); - %> - -
- <%=LanguageUtil.get(pageContext, - "dcc-copertura-"+BeanPropertiesUtil.getString(dettPratica, "dccCopertura"))%> -
-
<%= LanguageUtil.get(pageContext, "dcc-copertura-c-a-acciaio") %> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/view_fascicolo_riepilogo.jsp b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/view_fascicolo_riepilogo.jsp index a0945856..8bc76f2f 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/view_fascicolo_riepilogo.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/view_fascicolo_riepilogo.jsp @@ -1,91 +1,76 @@ <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> - -<%@page import="it.tref.liferay.portos.bo.util.PraticaUtil"%> +<%@page import="com.liferay.portal.kernel.bean.BeanPropertiesUtil"%> +<%@page import="com.liferay.portal.kernel.servlet.ServletContextPool"%> +<%@page import="com.liferay.portal.service.UserLocalServiceUtil"%> +<%@page import="it.tref.liferay.portos.bo.model.DettPratica"%> <%@page import="it.tref.liferay.portos.bo.service.CollaudoLocalServiceUtil"%> -<%@page import="it.tref.liferay.portos.bo.service.FineLavoriLocalServiceUtil"%> -<%@page import="it.tref.liferay.portos.bo.shared.util.TipoIntegrazioneUtil"%> +<%@page import="it.tref.liferay.portos.bo.service.ComuneLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil"%> -<%@page import="it.tref.liferay.portos.bo.service.DettPraticaLocalService"%> -<%@page import="it.tref.liferay.portos.bo.shared.util.StatoPraticaConstants"%> -<%@page import="com.liferay.portal.service.UserLocalServiceUtil"%> -<%@page import="it.tref.liferay.portos.bo.service.SoggettoServiceUtil"%> -<%@page import="com.liferay.portal.kernel.servlet.ServletContextPool"%> -<%@page import="it.tref.liferay.portos.bo.model.Pagamento"%> -<%@page import="it.tref.liferay.portos.bo.shared.util.PagamentoConstants"%> -<%@page import="it.tref.liferay.portos.bo.util.PagamentiCommonUtil"%> -<%@page import="java.math.BigDecimal"%> -<%@page import="java.text.NumberFormat"%> -<%@page import="it.tref.liferay.portos.bo.model.Soggetto"%> -<%@page import="it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil"%> -<%@page import="it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil"%> -<%@page import="it.tref.liferay.portos.bo.shared.util.PortletKeys"%> -<%@page import="java.util.Date"%> -<%@page import="it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.service.DettPraticaServiceUtil"%> -<%@page import="com.liferay.portal.kernel.util.KeyValuePair"%> +<%@page import="it.tref.liferay.portos.bo.service.FineLavoriLocalServiceUtil"%> +<%@page import="it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.service.ProvinciaLocalServiceUtil"%> -<%@page import="it.tref.liferay.portos.bo.service.ComuneLocalServiceUtil"%> +<%@page import="it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil"%> +<%@page import="it.tref.liferay.portos.bo.service.SoggettoServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.service.TerritorioLocalServiceUtil"%> -<%@page import="it.tref.liferay.portos.bo.model.Provincia"%> -<%@page import="it.tref.liferay.portos.bo.model.Comune"%> -<%@page import="it.tref.liferay.portos.bo.model.Territorio"%> -<%@page import="it.tref.liferay.portos.bo.model.IntPratica"%> -<%@page import="it.tref.liferay.portos.bo.model.DettPratica"%> -<%@page import="java.util.ArrayList"%> -<%@page import="java.util.regex.Pattern"%> -<%@page import="com.liferay.portal.kernel.bean.BeanPropertiesUtil"%> -<%@ include file="/html/fascicolofe/init.jsp" %> - +<%@page import="it.tref.liferay.portos.bo.shared.util.TipoIntegrazioneUtil"%> +<%@page import="it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil"%> +<%@page import="it.tref.liferay.portos.bo.util.PraticaUtil"%> +<%@include file="/html/fascicolofe/init.jsp"%> <% - long intPraticaId = ParamUtil.getLong(request, "intPraticaId",0l); - long dettPraticaId = ParamUtil.getLong(request, "dettPraticaId",0l); - - DettPratica dettPratica = null; - IntPratica intPratica = null; - if(intPraticaId!=0l){ - intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId); - dettPratica = DettPraticaServiceUtil.getLastEditableByIntPratica(intPraticaId); - if(dettPratica==null){ - dettPratica = DettPraticaServiceUtil.getLastCompletedByIntPratica(intPraticaId); - } - dettPraticaId = dettPratica.getDettPraticaId(); - } - - Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId()); - Comune comune = ComuneLocalServiceUtil.getComune(territorio.getComuneId()); - Provincia provincia = ProvinciaLocalServiceUtil.fetchByC_C(territorio.getCompanyId(), territorio.getCodiceProvincia()); - String name = StringPool.MINUS; - if(intPratica.getStatusByUserId() != 0) { - name = UserLocalServiceUtil.getUser(intPratica.getStatusByUserId()).getFullName(); +long intPraticaId = ParamUtil.getLong(request, "intPraticaId", 0); +long dettPraticaId = ParamUtil.getLong(request, "dettPraticaId", 0); +DettPratica dettPratica = null; +IntPratica intPratica = null; +if (intPraticaId != 0) { + intPratica = IntPraticaLocalServiceUtil.getIntPratica(intPraticaId); + dettPratica = DettPraticaServiceUtil.getLastEditableByIntPratica(intPraticaId); + if (dettPratica == null) { + dettPratica = DettPraticaServiceUtil.getLastCompletedByIntPratica(intPraticaId); } - - int nVarianti = DettPraticaLocalServiceUtil.countCompletedByIntPraticaAndTipoPratica(intPraticaId, Arrays.asList(new String[]{TipoIntegrazioneUtil.VARIANTE})); - int nCambioSoggetti = DettPraticaLocalServiceUtil.countCompletedByIntPraticaAndTipoPratica(intPraticaId, Arrays.asList(new String[]{TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO})); - int nFineLavori = FineLavoriLocalServiceUtil.countByIntPraticaId_Completata(intPraticaId, true); - int nCollaudo = CollaudoLocalServiceUtil.countByIntPraticaId_Completata(intPraticaId, true); - - String hide1 = (intPratica.getTipoProcedura().equals(Constants.PROCEDURA_Q1) || intPratica.getTipoProcedura().equals(Constants.PROCEDURA_P1) ? "hideSection" : ""); - String hide3 = (intPratica.getTipoProcedura().equals(Constants.PROCEDURA_Q3) || intPratica.getTipoProcedura().equals(Constants.PROCEDURA_P3) ? "hideSection" : ""); - String hide8 = (intPratica.getTipoProcedura().equals(Constants.PROCEDURA_Q8) || intPratica.getTipoProcedura().equals(Constants.PROCEDURA_P8) ? "hideSection" : ""); - String hide9 = (intPratica.getTipoProcedura().equals(Constants.PROCEDURA_Q9) || intPratica.getTipoProcedura().equals(Constants.PROCEDURA_P9) ? "hideSection" : ""); - String hide10 = (intPratica.getTipoProcedura().equals(Constants.PROCEDURA_Q10) || intPratica.getTipoProcedura().equals(Constants.PROCEDURA_P10) ? "hideSection" : ""); + dettPraticaId = dettPratica.getDettPraticaId(); +} +Territorio territorio = TerritorioLocalServiceUtil.getTerritorio(intPratica.getTerritorioId()); +Comune comune = ComuneLocalServiceUtil.getComune(territorio.getComuneId()); +Provincia provincia = ProvinciaLocalServiceUtil.fetchByC_C(territorio.getCompanyId(), territorio.getCodiceProvincia()); +String name = StringPool.MINUS; +if (intPratica.getStatusByUserId() != 0) { + name = UserLocalServiceUtil.getUser(intPratica.getStatusByUserId()).getFullName(); +} +int nVarianti = DettPraticaLocalServiceUtil.countCompletedByIntPraticaAndTipoPratica(intPraticaId, + Arrays.asList(new String[]{ TipoIntegrazioneUtil.VARIANTE })); +int nCambioSoggetti = DettPraticaLocalServiceUtil.countCompletedByIntPraticaAndTipoPratica(intPraticaId, + Arrays.asList(new String[]{ TipoIntegrazioneUtil.VARIAZIONE_SOGGETTO })); +int nFineLavori = FineLavoriLocalServiceUtil.countByIntPraticaId_Completata(intPraticaId, true); +int nCollaudo = CollaudoLocalServiceUtil.countByIntPraticaId_Completata(intPraticaId, true); +String hide1 = (intPratica.getTipoProcedura().equals(Constants.PROCEDURA_Q1) + || intPratica.getTipoProcedura().equals(Constants.PROCEDURA_P1) ? "hideSection" : StringPool.BLANK); +String hide3 = (intPratica.getTipoProcedura().equals(Constants.PROCEDURA_Q3) + || intPratica.getTipoProcedura().equals(Constants.PROCEDURA_P3) ? "hideSection" : StringPool.BLANK); +String hide8 = (intPratica.getTipoProcedura().equals(Constants.PROCEDURA_Q8) + || intPratica.getTipoProcedura().equals(Constants.PROCEDURA_P8) ? "hideSection" : StringPool.BLANK); +String hide9 = (intPratica.getTipoProcedura().equals(Constants.PROCEDURA_Q9) + || intPratica.getTipoProcedura().equals(Constants.PROCEDURA_P9) ? "hideSection" : StringPool.BLANK); +String hide10 = (intPratica.getTipoProcedura().equals(Constants.PROCEDURA_Q10) + || intPratica.getTipoProcedura().equals(Constants.PROCEDURA_P10) ? "hideSection" : StringPool.BLANK); %> -
- - + + A - + D
- +
@@ -93,18 +78,24 @@
- <% if(intPratica.getValidata()) { %> - - <% }else { %> - - <% } %> + <% + if (intPratica.getValidata()) { + %> + + <% + } else { + %> + + <% + } + %>
Istruttore:
- <%=name %> + <%= name %>
@@ -112,13 +103,18 @@ Tipologia:
- <%= LanguageUtil.get(pageContext, "tipo-pratica-"+intPratica.getTipoPratica()) %> + + <%= LanguageUtil.get(pageContext, "tipo-pratica-" + intPratica.getTipoPratica()) %> +
Stato:
- <%= LanguageUtil.get(pageContext, PraticaUtil.getStatoPraticaLabel(intPratica.getStatoPratica(), intPratica.getTipoProcedura())) %> + + <%= LanguageUtil.get(pageContext, PraticaUtil.getStatoPraticaLabel( + intPratica.getStatoPratica(), intPratica.getTipoProcedura())) %> +
@@ -129,110 +125,180 @@
- +
- <% if(nVarianti == 0 ) { %> - Varianti Non presentate - <% } else if(nVarianti == 1 ) { %> - Variante Presentata <%=nVarianti %> volta - <% } else { %> - Varianti Presentate <%=nVarianti %> volte + <% + if (nVarianti == 0) { + %> + Varianti + non presentate + <% + } else if (nVarianti == 1) { %> + Variante + presentata 1 volta + <% + } else { + %> + Varianti + + presentate <%= nVarianti %> volte + <% } %>
-
- <% if(nCambioSoggetti == 0 ) { %> - Cambio soggetti Non presentata - <% } else if(nCambioSoggetti == 1 ) { %> - Cambio soggetti Presentata <%=nCambioSoggetti %> volta - <% } else { %> - Cambio soggetti Presentata <%=nCambioSoggetti %> volte - <% } %> + Cambio soggetti + <% + if (nCambioSoggetti == 0) { + %> + non presentato + <% + } else if (nCambioSoggetti == 1) { + %> + presentato 1 volta + <% + } else { + %> + + + presentato <%= nCambioSoggetti %> volte + + <% + } + %>
- <% if(nFineLavori == 0 ) { %> - Fine Lavori Non presentata - <% } else if(nVarianti == 1 ) { %> - Fine Lavori Presentata <%=nFineLavori %> volta - <% } else { %> - Fine Lavori Presentata <%=nFineLavori %> volte + Fine Lavori + <% + if (nFineLavori == 0) { + %> + non presentata + <% + } else if (nFineLavori == 1 ) { + %> + presentata 1 volta + <% + } else { + %> + + presentata <%= nFineLavori %> volte + <% } %>
- <% if(nCollaudo == 0 ) { %> - Collaudo Non presentato - <% } else if(nCollaudo == 1 ) { %> - Collaudo Presentato <%=nFineLavori %> volta - <% } else { %> - Collaudo Presentato <%=nFineLavori %> volte - <% } %> + Collaudo + <% + if (nCollaudo == 0 ) { + %> + non presentato + <% + } else if (nCollaudo == 1 ) { + %> + presentato 1 volta + <% + } else { + %> + + Presentato <%= nCollaudo %> volte + + <% + } + %>
- -
- +
+
- <%=BeanPropertiesUtil.getString(dettPratica, "descLongIntervento") %> + <%= BeanPropertiesUtil.getString(dettPratica, "descLongIntervento") %>
-
- +
- - <%=LanguageUtil.get(pageContext, "tc-nuova-costruzione") %> + + + + <%= LanguageUtil.get(pageContext, "tc-nuova-costruzione") %>
- - <%=LanguageUtil.get(pageContext, "tc-nuova-costruzione-pertinenza") %> + + + + <%= LanguageUtil.get(pageContext, "tc-nuova-costruzione-pertinenza") %>
- - <%=LanguageUtil.get(pageContext, "tc-costruzioni-esistenti") %> + + + + <%= LanguageUtil.get(pageContext, "tc-costruzioni-esistenti") %>
- - <%=LanguageUtil.get(pageContext, "tc-manut-ord-straord") %> + + + + <%= LanguageUtil.get(pageContext, "tc-manut-ord-straord") %>
- - <%=LanguageUtil.get(pageContext, "tc-intervento-opere-escavazione") %> + + + + <%= LanguageUtil.get(pageContext, "tc-intervento-opere-escavazione") %>
- - <%=LanguageUtil.get(pageContext, "tc-no-opere-escavazione") %> + + + + <%= LanguageUtil.get(pageContext, "tc-no-opere-escavazione") %>
- - <%=LanguageUtil.get(pageContext, "tc-altri-interventi") %> + + + + <%= LanguageUtil.get(pageContext, "tc-altri-interventi") %>
- <%=BeanPropertiesUtil.getString(dettPratica, "tcAltriInterventiDesc") %> + <%= BeanPropertiesUtil.getString(dettPratica, "tcAltriInterventiDesc") %>
-
-
- +
<% - List committenti = SoggettoLocalServiceUtil.getValidByIntPratica_TipologiaSoggetto(intPraticaId, TipoSoggettoUtil.COMMITTENTE); + List committenti = SoggettoLocalServiceUtil.getValidByIntPratica_TipologiaSoggetto( + intPraticaId, TipoSoggettoUtil.COMMITTENTE); %>
-
<%=LanguageUtil.get(pageContext, "gc-soggetto-02") %>:
+
+ <%= LanguageUtil.get(pageContext, "gc-soggetto-02") %>: +
<% - Soggetto committente = committenti.get(0); + Soggetto committente = committenti.get(0); %>
@@ -263,15 +329,18 @@ <%= committente.getCodiceFiscale().toUpperCase() %>
-
+
<% - List progettisti = SoggettoLocalServiceUtil.getValidByIntPratica_TipologiaSoggetto(intPraticaId, TipoSoggettoUtil.PROGETTISTA); + List progettisti = SoggettoLocalServiceUtil.getValidByIntPratica_TipologiaSoggetto( + intPraticaId, TipoSoggettoUtil.PROGETTISTA); %>
-
<%=LanguageUtil.get(pageContext, "gc-soggetto-06") %>:
+
+ <%= LanguageUtil.get(pageContext, "gc-soggetto-06") %>: +
@@ -296,11 +365,14 @@
<% - List direttori = SoggettoServiceUtil.getValidByIntPratica_TipologiaSoggetto(intPraticaId, TipoSoggettoUtil.DIRETTORE_LAVORI); + List direttori = SoggettoServiceUtil.getValidByIntPratica_TipologiaSoggetto( + intPraticaId, TipoSoggettoUtil.DIRETTORE_LAVORI); %>
-
<%=LanguageUtil.get(pageContext, "gc-soggetto-03") %>:
+
+ <%= LanguageUtil.get(pageContext, "gc-soggetto-03") %>: +
@@ -329,16 +401,18 @@
- - - + + +
- +
@@ -370,7 +444,7 @@ <%= LanguageUtil.get(pageContext, "dp-dc-prov") %>
- <%=BeanPropertiesUtil.getString(provincia, "provincia")%> + <%= BeanPropertiesUtil.getString(provincia, "provincia")%>
@@ -378,7 +452,7 @@ <%= LanguageUtil.get(pageContext, "dp-dc-comune") %>
- <%=BeanPropertiesUtil.getString(comune, "denominazione")%> + <%= BeanPropertiesUtil.getString(comune, "denominazione")%>
@@ -386,7 +460,7 @@ <%= LanguageUtil.get(pageContext, "dp-dc-loc") %>
- <%=BeanPropertiesUtil.getString(dettPratica, "localita") %> + <%= BeanPropertiesUtil.getString(dettPratica, "localita") %>
@@ -394,7 +468,7 @@ <%= LanguageUtil.get(pageContext, "dp-dc-via") %>
- <%=BeanPropertiesUtil.getString(dettPratica, "via") %> + <%= BeanPropertiesUtil.getString(dettPratica, "via") %>

@@ -404,13 +478,12 @@
<%= BeanPropertiesUtil.getString(dettPratica, "estremiCatastali") %> -
+
<%= LanguageUtil.get(pageContext, "dc-allegato") %>
- - <%=BeanPropertiesUtil.getString(dettPratica, "dcAllegato") %> + <%= BeanPropertiesUtil.getString(dettPratica, "dcAllegato") %>
@@ -418,7 +491,7 @@ <%= LanguageUtil.get(pageContext, "estremi-prat-com") %>
- <%=BeanPropertiesUtil.getString(dettPratica, "estremiPratCom") %> + <%= BeanPropertiesUtil.getString(dettPratica, "estremiPratCom") %>
@@ -426,5 +499,4 @@
-
\ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/.classpath b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/.classpath index 6de1aafe..b600399e 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/.classpath +++ b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/.classpath @@ -19,5 +19,6 @@ + diff --git a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/.project b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/.project index 59a67b56..6ef6b9ff 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/.project +++ b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-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-kaleo-portlet/build.xml b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/build.xml index 5d0aa042..8dfbe37e 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/build.xml +++ b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/build.xml @@ -2,7 +2,6 @@ - - + \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/WEB-INF/lib/portos-kaleo-portlet-service.jar b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/WEB-INF/lib/portos-kaleo-portlet-service.jar index 36c9b920..21159b20 100644 Binary files a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/WEB-INF/lib/portos-kaleo-portlet-service.jar and b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/WEB-INF/lib/portos-kaleo-portlet-service.jar differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/WEB-INF/lib/util-java.jar b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/WEB-INF/lib/util-java.jar new file mode 100644 index 00000000..6b5d95f8 Binary files /dev/null and b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/WEB-INF/lib/util-java.jar differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/kaleo/NoSuchFormDefinitionLinkException.java b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/kaleo/NoSuchFormDefinitionLinkException.java new file mode 100644 index 00000000..f66df7c5 --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/kaleo/NoSuchFormDefinitionLinkException.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. + * + * This library is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. + * + * This library is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + */ + +package it.tref.liferay.portos.kaleo; + +import com.liferay.portal.NoSuchModelException; + +/** + * @author + */ +public class NoSuchFormDefinitionLinkException extends NoSuchModelException { + + public NoSuchFormDefinitionLinkException() { + super(); + } + + public NoSuchFormDefinitionLinkException(String msg) { + super(msg); + } + + public NoSuchFormDefinitionLinkException(String msg, Throwable cause) { + super(msg, cause); + } + + public NoSuchFormDefinitionLinkException(Throwable cause) { + super(cause); + } + +} \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/kaleo/NoSuchFormLogException.java b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/kaleo/NoSuchFormLogException.java new file mode 100644 index 00000000..61ef2408 --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/kaleo/NoSuchFormLogException.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. + * + * This library is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. + * + * This library is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + */ + +package it.tref.liferay.portos.kaleo; + +import com.liferay.portal.NoSuchModelException; + +/** + * @author + */ +public class NoSuchFormLogException extends NoSuchModelException { + + public NoSuchFormLogException() { + super(); + } + + public NoSuchFormLogException(String msg) { + super(msg); + } + + public NoSuchFormLogException(String msg, Throwable cause) { + super(msg, cause); + } + + public NoSuchFormLogException(Throwable cause) { + super(cause); + } + +} \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/kaleo/NoSuchFormTemplateLinkException.java b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/kaleo/NoSuchFormTemplateLinkException.java new file mode 100644 index 00000000..30d215a2 --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/kaleo/NoSuchFormTemplateLinkException.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. + * + * This library is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. + * + * This library is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + */ + +package it.tref.liferay.portos.kaleo; + +import com.liferay.portal.NoSuchModelException; + +/** + * @author + */ +public class NoSuchFormTemplateLinkException extends NoSuchModelException { + + public NoSuchFormTemplateLinkException() { + super(); + } + + public NoSuchFormTemplateLinkException(String msg) { + super(msg); + } + + public NoSuchFormTemplateLinkException(String msg, Throwable cause) { + super(msg, cause); + } + + public NoSuchFormTemplateLinkException(Throwable cause) { + super(cause); + } + +} \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/portlet/WorkflowFormAdminPortlet.java b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/portlet/WorkflowFormAdminPortlet.java index 227f0491..93390180 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/portlet/WorkflowFormAdminPortlet.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/portlet/WorkflowFormAdminPortlet.java @@ -40,7 +40,7 @@ import com.liferay.util.bridges.mvc.MVCPortlet; public class WorkflowFormAdminPortlet extends MVCPortlet { - private final static Log _log = LogFactoryUtil.getLog(WorkflowFormAdminPortlet.class); + private static final Log _log = LogFactoryUtil.getLog(WorkflowFormAdminPortlet.class); public void editFormDefinitionLink(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { diff --git a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/WEB-INF/src/service.properties b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/WEB-INF/src/service.properties index fe45a085..d8b962c8 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/WEB-INF/src/service.properties +++ b/liferay-plugins-sdk-6.2/portlets/portos-kaleo-portlet/docroot/WEB-INF/src/service.properties @@ -13,8 +13,8 @@ ## build.namespace=portos_Kaleo - build.number=18 - build.date=1604403556778 + build.number=20 + build.date=1631718661033 build.auto.upgrade=true ## diff --git a/liferay-plugins-sdk-6.2/portlets/portos-log-portlet/docroot/WEB-INF/src/it/tref/portos/liferay/log/constants/LogConstants.java b/liferay-plugins-sdk-6.2/portlets/portos-log-portlet/docroot/WEB-INF/src/it/tref/portos/liferay/log/constants/LogConstants.java index 5999d17c..fca1765b 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-log-portlet/docroot/WEB-INF/src/it/tref/portos/liferay/log/constants/LogConstants.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-log-portlet/docroot/WEB-INF/src/it/tref/portos/liferay/log/constants/LogConstants.java @@ -2,17 +2,13 @@ package it.tref.portos.liferay.log.constants; public class LogConstants { - /* - * Message - */ - public enum LogProcessMode { - ASYNC, SYNC - } + public enum LogProcessMode { + ASYNC, SYNC + } - public final static String COMPANY_ID = "companyId"; - public final static String USER_ID = "userId"; - public final static String CONTENT = "payload"; - - public final static String PARAM_PROCESS_MODE = "processMode"; + public static final String COMPANY_ID = "companyId"; + public static final String USER_ID = "userId"; + public static final String CONTENT = "payload"; + public static final String PARAM_PROCESS_MODE = "processMode"; } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-log-portlet/docroot/WEB-INF/src/it/tref/portos/liferay/log/constants/LogDestinationNames.java b/liferay-plugins-sdk-6.2/portlets/portos-log-portlet/docroot/WEB-INF/src/it/tref/portos/liferay/log/constants/LogDestinationNames.java index 4cc8823c..4b8f4d26 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-log-portlet/docroot/WEB-INF/src/it/tref/portos/liferay/log/constants/LogDestinationNames.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-log-portlet/docroot/WEB-INF/src/it/tref/portos/liferay/log/constants/LogDestinationNames.java @@ -2,10 +2,9 @@ package it.tref.portos.liferay.log.constants; public class LogDestinationNames { - public final static String SERIAL = "liferay/tref/portos/monitoring_serial"; - public final static String SYNC = "liferay/tref/portos/monitoring_sync"; - - public final static String REST_SERVICE_URL = "http://rt-saas-tc01-s2.rt.tix.it:9888/logcollector"; - public final static String REST_SERVICE_PORT = "9090"; - + public static final String SERIAL = "liferay/tref/portos/monitoring_serial"; + public static final String SYNC = "liferay/tref/portos/monitoring_sync"; + + public static final String REST_SERVICE_URL = "http://rt-saas-tc01-s2.rt.tix.it:9888/logcollector"; + public static final String REST_SERVICE_PORT = "9090"; } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-log-portlet/docroot/WEB-INF/src/it/tref/portos/liferay/log/constants/LogFormat.java b/liferay-plugins-sdk-6.2/portlets/portos-log-portlet/docroot/WEB-INF/src/it/tref/portos/liferay/log/constants/LogFormat.java index 455a2ebe..177633d1 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-log-portlet/docroot/WEB-INF/src/it/tref/portos/liferay/log/constants/LogFormat.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-log-portlet/docroot/WEB-INF/src/it/tref/portos/liferay/log/constants/LogFormat.java @@ -3,32 +3,31 @@ package it.tref.portos.liferay.log.constants; public class LogFormat { /*** Mandatory ***/ - public final static String HOSTNAME = "host"; - public final static String IP_ADDRESS = "ipAddress"; - public final static String DATA_EVENTO = "requestDate"; - public final static String COD_PROC = "processCode"; - public final static String COD_APP = "serverId"; - public final static String ID_ISTANZA = "instanceId"; - public final static String PROG_EVENTO = "eventProgressive"; - public final static String COD_ATT = "activityCode"; - public final static String COD_ESITO_EVENTO = "status"; - public final static String TIPO_EVENTO = "eventType"; - + public static final String HOSTNAME = "host"; + public static final String IP_ADDRESS = "ipAddress"; + public static final String DATA_EVENTO = "requestDate"; + public static final String COD_PROC = "processCode"; + public static final String COD_APP = "serverId"; + public static final String ID_ISTANZA = "instanceId"; + public static final String PROG_EVENTO = "eventProgressive"; + public static final String COD_ATT = "activityCode"; + public static final String COD_ESITO_EVENTO = "status"; + public static final String TIPO_EVENTO = "eventType"; + /*** Optional ***/ - public final static String ID_OPERATORE = "userId"; - - /*** Labels ***/ - public final static String HOSTNAME_LABEL = "hostname"; - public final static String IP_ADDRESS_LABEL = "ipAddress"; - public final static String DATA_EVENTO_LABEL = "dataEvento"; - public final static String COD_PROC_LABEL = "codProc"; - public final static String COD_APP_LABEL = "codApp"; - public final static String ID_ISTANZA_LABEL = "idIstanza"; - public final static String PROG_EVENTO_LABEL = "progEvento"; - public final static String COD_ATT_LABEL = "codAtt"; - public final static String COD_ESITO_EVENTO_LABEL = "codEsitoEvento"; - public final static String TIPO_EVENTO_LABEL = "tipoEvento"; - public final static String ID_OPERATORE_LABEL = "idOperatore"; - public final static String COMPLEX_DATA_LABEL = "ComplexData"; + public static final String ID_OPERATORE = "userId"; + /*** Labels ***/ + public static final String HOSTNAME_LABEL = "hostname"; + public static final String IP_ADDRESS_LABEL = "ipAddress"; + public static final String DATA_EVENTO_LABEL = "dataEvento"; + public static final String COD_PROC_LABEL = "codProc"; + public static final String COD_APP_LABEL = "codApp"; + public static final String ID_ISTANZA_LABEL = "idIstanza"; + public static final String PROG_EVENTO_LABEL = "progEvento"; + public static final String COD_ATT_LABEL = "codAtt"; + public static final String COD_ESITO_EVENTO_LABEL = "codEsitoEvento"; + public static final String TIPO_EVENTO_LABEL = "tipoEvento"; + public static final String ID_OPERATORE_LABEL = "idOperatore"; + public static final String COMPLEX_DATA_LABEL = "ComplexData"; } 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/docroot/WEB-INF/service/it/tref/liferay/portos/mailmanager/model/EmailConstants.java b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/mailmanager/model/EmailConstants.java index cb829f90..0498ee84 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/mailmanager/model/EmailConstants.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/mailmanager/model/EmailConstants.java @@ -2,6 +2,5 @@ package it.tref.liferay.portos.mailmanager.model; public class EmailConstants { - public final static String DEFAULT_ATTACHMENTS_FOLDER_NAME = "MailManager_EmailAttachments"; - + public static final String DEFAULT_ATTACHMENTS_FOLDER_NAME = "MailManager_EmailAttachments"; } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/hook/events/StartupAction.java b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/hook/events/StartupAction.java index 334e5715..640b866e 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/hook/events/StartupAction.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/hook/events/StartupAction.java @@ -22,63 +22,47 @@ import com.liferay.portlet.documentlibrary.service.DLFolderLocalServiceUtil; public class StartupAction extends SimpleAction { - private final static Log _log = LogFactoryUtil.getLog(StartupAction.class); - - @Override - public void run(String[] ids) throws ActionException { - - for (String id : ids) { - - long companyId = GetterUtil.getLong(id); - - try { - - Company company = CompanyLocalServiceUtil.getCompany(companyId); - - Group companyGroup = company.getGroup(); - User userDefault = company.getDefaultUser(); - - // Folders - - String[] groupActions = {ActionKeys.VIEW}; - String[] guestActions = {ActionKeys.VIEW}; - - addDLFolderIfNotExists(userDefault.getUserId(), companyGroup.getGroupId(), companyGroup.getGroupId(), - DLFolderConstants.DEFAULT_PARENT_FOLDER_ID, EmailConstants.DEFAULT_ATTACHMENTS_FOLDER_NAME, true, - groupActions, guestActions); - - } catch (Exception e) { - _log.error(e, e); - } - } - } - - private DLFolder addDLFolderIfNotExists(long userId, long groupId, long repositoryId, long parentFolderId, - String name, boolean hidden, String[] groupActions, String[] guestActions) throws PortalException, - SystemException { - - DLFolder dlFolder = null; - - try { - dlFolder = DLFolderLocalServiceUtil.getFolder(groupId, parentFolderId, name); - } catch (PortalException e) { - - ServiceContext serviceContext = new ServiceContext(); - - if (groupActions != null) { - serviceContext.setGroupPermissions(groupActions); - } - - if (guestActions != null) { - serviceContext.setGuestPermissions(guestActions); - } - - dlFolder = - DLFolderLocalServiceUtil.addFolder(userId, groupId, repositoryId, false, parentFolderId, name, - StringPool.BLANK, hidden, serviceContext); - } - - return dlFolder; - } - + private static final Log _log = LogFactoryUtil.getLog(StartupAction.class); + + @Override + public void run(String[] ids) throws ActionException { + + for (String id : ids) { + long companyId = GetterUtil.getLong(id); + try { + Company company = CompanyLocalServiceUtil.getCompany(companyId); + Group companyGroup = company.getGroup(); + User userDefault = company.getDefaultUser(); + // Folders + String[] groupActions = { ActionKeys.VIEW }; + String[] guestActions = { ActionKeys.VIEW }; + addDLFolderIfNotExists(userDefault.getUserId(), companyGroup.getGroupId(), companyGroup.getGroupId(), + DLFolderConstants.DEFAULT_PARENT_FOLDER_ID, EmailConstants.DEFAULT_ATTACHMENTS_FOLDER_NAME, + true, groupActions, guestActions); + } catch (Exception e) { + _log.error(e, e); + } + } + } + + private DLFolder addDLFolderIfNotExists(long userId, long groupId, long repositoryId, long parentFolderId, + String name, boolean hidden, String[] groupActions, String[] guestActions) throws PortalException, + SystemException { + + DLFolder dlFolder = null; + try { + dlFolder = DLFolderLocalServiceUtil.getFolder(groupId, parentFolderId, name); + } catch (PortalException e) { + ServiceContext serviceContext = new ServiceContext(); + if (groupActions != null) { + serviceContext.setGroupPermissions(groupActions); + } + if (guestActions != null) { + serviceContext.setGuestPermissions(guestActions); + } + dlFolder = DLFolderLocalServiceUtil.addFolder(userId, groupId, repositoryId, false, parentFolderId, name, + StringPool.BLANK, hidden, serviceContext); + } + return dlFolder; + } } 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 a39c4d08..dcf03919 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 @@ -1,18 +1,21 @@ /** - * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of the Liferay Enterprise Subscription License - * ("License"). You may not use this file except in compliance with the License. You can obtain a - * copy of the License by contacting Liferay, Inc. See the License for the specific language - * governing permissions and limitations under the License, including but not limited to - * distribution rights of the Software. - * - * - * + * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. The contents of this file are subject to the terms of the + * Liferay Enterprise Subscription License ("License"). You may not use this file except in compliance with the License. + * You can obtain a copy of the License by contacting Liferay, Inc. See the License for the specific language governing + * permissions and limitations under the License, including but not limited to distribution rights of the Software. */ package it.tref.liferay.portos.mailmanager.service.impl; +import it.tref.liferay.portos.mailmanager.EmailAttachmentFileException; +import it.tref.liferay.portos.mailmanager.EmailAttachmentTitleException; +import it.tref.liferay.portos.mailmanager.NoSuchEmailException; +import it.tref.liferay.portos.mailmanager.model.EmailAttachment; +import it.tref.liferay.portos.mailmanager.service.base.EmailAttachmentLocalServiceBaseImpl; +import it.tref.liferay.portos.mailmanager.service.persistence.EmailAttachmentPK; + +import java.io.File; +import java.util.List; import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception.SystemException; @@ -27,27 +30,14 @@ import com.liferay.portal.model.User; import com.liferay.portal.security.permission.ActionKeys; import com.liferay.portal.service.ServiceContext; -import it.tref.liferay.portos.mailmanager.EmailAttachmentFileException; -import it.tref.liferay.portos.mailmanager.EmailAttachmentTitleException; -import it.tref.liferay.portos.mailmanager.NoSuchEmailException; -import it.tref.liferay.portos.mailmanager.model.EmailAttachment; -import it.tref.liferay.portos.mailmanager.service.base.EmailAttachmentLocalServiceBaseImpl; -import it.tref.liferay.portos.mailmanager.service.persistence.EmailAttachmentPK; - -import java.io.File; -import java.util.List; - /** * The implementation of the email attachment local service. - * *

- * All custom service methods should be put in this class. Whenever methods are added, rerun - * ServiceBuilder to copy their definitions into the - * {@link it.noovle.azimut.icf.mailmanager.service.EmailAttachmentLocalService} interface. - * + * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy + * their definitions into the {@link it.noovle.azimut.icf.mailmanager.service.EmailAttachmentLocalService} interface. *

- * 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,96 +45,99 @@ import java.util.List; * @see it.noovle.azimut.icf.mailmanager.service.EmailAttachmentLocalServiceUtil */ public class EmailAttachmentLocalServiceImpl extends EmailAttachmentLocalServiceBaseImpl { - /* - * NOTE FOR DEVELOPERS: - * - * Never reference this interface directly. Always use {@link - * it.noovle.azimut.icf.mailmanager.service.EmailAttachmentLocalServiceUtil} to access the - * email attachment local service. - */ - public EmailAttachment addEmailAttachment(long companyId, long emailId, long folderId, String fileName, File file) - throws PortalException, SystemException { + /* + * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link + * it.noovle.azimut.icf.mailmanager.service.EmailAttachmentLocalServiceUtil} to access the email attachment local + * service. + */ + @Override + public EmailAttachment addEmailAttachment(long companyId, long emailId, long folderId, String fileName, File file) + throws PortalException, SystemException { - Company company = companyLocalService.getCompany(companyId); + Company company = companyLocalService.getCompany(companyId); - User defaultUser = company.getDefaultUser(); + User defaultUser = company.getDefaultUser(); - validate(emailId, fileName, file); + validate(emailId, fileName, file); - Folder folder = dlAppLocalService.getFolder(folderId); + Folder folder = dlAppLocalService.getFolder(folderId); - String sourceFileName = file.getName(); - String mimeType = MimeTypesUtil.getContentType(sourceFileName); + String sourceFileName = file.getName(); + String mimeType = MimeTypesUtil.getContentType(sourceFileName); - String title = fileName; - if (Validator.isNull(title)) { - title = file.getName(); - } + String title = fileName; + if (Validator.isNull(title)) { + title = file.getName(); + } - ServiceContext serviceContext = new ServiceContext(); - serviceContext.setGroupPermissions(new String[] {ActionKeys.VIEW}); - serviceContext.setGuestPermissions(new String[] {ActionKeys.VIEW}); + ServiceContext serviceContext = new ServiceContext(); + serviceContext.setGroupPermissions(new String[] { ActionKeys.VIEW }); + serviceContext.setGuestPermissions(new String[] { ActionKeys.VIEW }); - FileEntry fileEntry = - dlAppLocalService.addFileEntry(defaultUser.getUserId(), folder.getRepositoryId(), folder.getFolderId(), - sourceFileName, mimeType, title, StringPool.BLANK, StringPool.BLANK, file, serviceContext); + FileEntry fileEntry = + dlAppLocalService.addFileEntry(defaultUser.getUserId(), folder.getRepositoryId(), folder.getFolderId(), + sourceFileName, mimeType, title, StringPool.BLANK, StringPool.BLANK, file, serviceContext); - EmailAttachment emailAttachment = - emailAttachmentLocalService.createEmailAttachment(new EmailAttachmentPK(emailId, fileEntry.getFileEntryId())); + EmailAttachment emailAttachment = + createEmailAttachment(new EmailAttachmentPK(emailId, fileEntry + .getFileEntryId())); - return emailAttachmentLocalService.addEmailAttachment(emailAttachment); - } + return addEmailAttachment(emailAttachment); + } - @Override - public EmailAttachment deleteEmailAttachment(EmailAttachmentPK emailAttachmentPK) throws PortalException, - SystemException { - EmailAttachment emailAttachment = emailAttachmentLocalService.getEmailAttachment(emailAttachmentPK); - return deleteEmailAttachment(emailAttachment); - } + @Override + public EmailAttachment deleteEmailAttachment(EmailAttachmentPK emailAttachmentPK) throws PortalException, + SystemException { + EmailAttachment emailAttachment = getEmailAttachment(emailAttachmentPK); + return deleteEmailAttachment(emailAttachment); + } - @Override - public EmailAttachment deleteEmailAttachment(EmailAttachment emailAttachment) throws SystemException { + @Override + public EmailAttachment deleteEmailAttachment(EmailAttachment emailAttachment) throws SystemException { - super.deleteEmailAttachment(emailAttachment); + super.deleteEmailAttachment(emailAttachment); - // File Entry + // File Entry - try { - dlAppLocalService.deleteFileEntry(emailAttachment.getFileEntryId()); - } catch (PortalException e) { - } + try { + dlAppLocalService.deleteFileEntry(emailAttachment.getFileEntryId()); + } catch (PortalException e) {} - return emailAttachment; - } + return emailAttachment; + } - public List findByEmailId(long emailId) throws SystemException { - return emailAttachmentPersistence.findByEmailId(emailId); - } + @Override + public List findByEmailId(long emailId) throws SystemException { + return emailAttachmentPersistence.findByEmailId(emailId); + } - public List findByEmailId(long emailId, int start, int end) throws SystemException { - return emailAttachmentPersistence.findByEmailId(emailId); - } + @Override + public List findByEmailId(long emailId, int start, int end) throws SystemException { + return emailAttachmentPersistence.findByEmailId(emailId); + } - public int countByEmailId(long emailId) throws SystemException { - return emailAttachmentPersistence.countByEmailId(emailId); - } + @Override + public int countByEmailId(long emailId) throws SystemException { + return emailAttachmentPersistence.countByEmailId(emailId); + } - public EmailAttachment fetchByFileEntryId(long fileEntryId) throws SystemException { - return emailAttachmentPersistence.fetchByFileEntryId(fileEntryId); - } + @Override + public EmailAttachment fetchByFileEntryId(long fileEntryId) throws SystemException { + return emailAttachmentPersistence.fetchByFileEntryId(fileEntryId); + } - private void validate(long emailId, String fileName, File file) throws PortalException, SystemException { + private void validate(long emailId, String fileName, File file) throws PortalException, SystemException { - if (Validator.isNull(emailId)) { - throw new NoSuchEmailException(); - } + if (Validator.isNull(emailId)) { + throw new NoSuchEmailException(); + } - if (Validator.isNull(fileName) && Validator.isNull(file)) { - throw new EmailAttachmentTitleException(); - } + if (Validator.isNull(fileName) && Validator.isNull(file)) { + throw new EmailAttachmentTitleException(); + } - if (Validator.isNull(file) || (Validator.isNotNull(file) && !FileUtil.exists(file))) { - throw new EmailAttachmentFileException(); - } - } + if (Validator.isNull(file) || (Validator.isNotNull(file) && !FileUtil.exists(file))) { + throw new EmailAttachmentFileException(); + } + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/service/impl/EmailLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/service/impl/EmailLocalServiceImpl.java index fe22d352..75c4fb19 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/service/impl/EmailLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/service/impl/EmailLocalServiceImpl.java @@ -1,36 +1,12 @@ /** - * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of the Liferay Enterprise Subscription License - * ("License"). You may not use this file except in compliance with the License. You can obtain a - * copy of the License by contacting Liferay, Inc. See the License for the specific language - * governing permissions and limitations under the License, including but not limited to - * distribution rights of the Software. - * - * - * + * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. The contents of this file are subject to the terms of the + * Liferay Enterprise Subscription License ("License"). You may not use this file except in compliance with the License. + * You can obtain a copy of the License by contacting Liferay, Inc. See the License for the specific language governing + * permissions and limitations under the License, including but not limited to distribution rights of the Software. */ package it.tref.liferay.portos.mailmanager.service.impl; -import com.liferay.mail.model.FileAttachment; -import com.liferay.portal.kernel.exception.PortalException; -import com.liferay.portal.kernel.exception.SystemException; -import com.liferay.portal.kernel.log.Log; -import com.liferay.portal.kernel.log.LogFactoryUtil; -import com.liferay.portal.kernel.repository.model.Folder; -import com.liferay.portal.kernel.util.FileUtil; -import com.liferay.portal.kernel.util.OrderByComparator; -import com.liferay.portal.kernel.util.StringPool; -import com.liferay.portal.kernel.util.StringUtil; -import com.liferay.portal.kernel.util.Validator; -import com.liferay.portal.model.Company; -import com.liferay.portal.model.Group; -import com.liferay.portal.model.User; -import com.liferay.portal.security.permission.ActionKeys; -import com.liferay.portal.service.ServiceContext; -import com.liferay.portlet.documentlibrary.model.DLFolderConstants; - import it.tref.liferay.portos.mailmanager.EmailBccException; import it.tref.liferay.portos.mailmanager.EmailBulkAddressesException; import it.tref.liferay.portos.mailmanager.EmailCcException; @@ -51,18 +27,30 @@ import java.util.Collections; import java.util.Date; import java.util.List; +import com.liferay.mail.model.FileAttachment; +import com.liferay.portal.kernel.exception.PortalException; +import com.liferay.portal.kernel.exception.SystemException; +import com.liferay.portal.kernel.repository.model.Folder; +import com.liferay.portal.kernel.util.FileUtil; +import com.liferay.portal.kernel.util.OrderByComparator; +import com.liferay.portal.kernel.util.StringPool; +import com.liferay.portal.kernel.util.StringUtil; +import com.liferay.portal.kernel.util.Validator; +import com.liferay.portal.model.Company; +import com.liferay.portal.model.Group; +import com.liferay.portal.model.User; +import com.liferay.portal.security.permission.ActionKeys; +import com.liferay.portal.service.ServiceContext; +import com.liferay.portlet.documentlibrary.model.DLFolderConstants; + /** * The implementation of the email local service. - * *

- * All custom service methods should be put in this class. Whenever methods are - * added, rerun ServiceBuilder to copy their definitions into the - * {@link it.noovle.azimut.icf.mailmanager.service.EmailLocalService} interface. - * + * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy + * their definitions into the {@link it.noovle.azimut.icf.mailmanager.service.EmailLocalService} interface. *

- * 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 @@ -71,70 +59,67 @@ import java.util.List; */ public class EmailLocalServiceImpl extends EmailLocalServiceBaseImpl { /* - * NOTE FOR DEVELOPERS: - * - * Never reference this interface directly. Always use {@link - * it.noovle.azimut.icf.mailmanager.service.EmailLocalServiceUtil} to access - * the email local service. + * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link + * it.noovle.azimut.icf.mailmanager.service.EmailLocalServiceUtil} to access the email local service. */ - private final static Log _log = LogFactoryUtil.getLog(EmailLocalServiceImpl.class); + @Override + public Email addEmail(String className, long classPK, String from, String to[], String cc[], String bcc[], + String subject, String body, boolean htmlFormat, ServiceContext serviceContext) throws Exception { - public Email addEmail(String className, long classPK, String from, String to[], String cc[], - String bcc[], String subject, String body, boolean htmlFormat, ServiceContext serviceContext) - throws Exception { - return addEmail(className, classPK, from, to, cc, bcc, null, subject, body, htmlFormat, null, null, - null, null, 0, false, null, null, Collections. emptyList(), serviceContext); + return addEmail(className, classPK, from, to, cc, bcc, null, subject, body, htmlFormat, null, null, null, null, + 0, false, null, null, Collections. emptyList(), serviceContext); } - public Email addEmail(String className, long classPK, String from, String to[], String cc[], - String bcc[], String subject, String body, boolean htmlFormat, - List fileAttachments, ServiceContext serviceContext) throws Exception { - return addEmail(className, classPK, from, to, cc, bcc, null, subject, body, htmlFormat, null, null, - null, null, 0, false, null, null, fileAttachments, false, null, serviceContext); - } + @Override + public Email addEmail(String className, long classPK, String from, String to[], String cc[], String bcc[], + String subject, String body, boolean htmlFormat, List fileAttachments, + ServiceContext serviceContext) throws Exception { - public Email addEmail(String className, long classPK, String from, String to[], String cc[], - String bcc[], String[] bulkAddresses, String subject, String body, boolean htmlFormat, - String[] replyTo, String messageId, String inReplyTo, String smtpHost, int smtpPort, - boolean smtpSecure, String smtpUsername, String smtpPassword, - List fileAttachments, ServiceContext serviceContext) throws Exception { - return addEmail(className, classPK, from, to, cc, bcc, bulkAddresses, subject, body, htmlFormat, - replyTo, messageId, inReplyTo, smtpHost, smtpPort, smtpSecure, smtpUsername, smtpPassword, - fileAttachments, false, null, serviceContext); + return addEmail(className, classPK, from, to, cc, bcc, null, subject, body, htmlFormat, null, null, null, null, + 0, false, null, null, fileAttachments, false, null, serviceContext); } - public Email addEmail(String className, long classPK, String from, String to[], String cc[], - String bcc[], String subject, String body, boolean htmlFormat, - List fileAttachments, boolean sendSync, ServiceContext serviceContext) - throws Exception { - return addEmail(className, classPK, from, to, cc, bcc, null, subject, body, htmlFormat, null, null, - null, null, 0, false, null, null, fileAttachments, sendSync, null, serviceContext); + @Override + public Email addEmail(String className, long classPK, String from, String to[], String cc[], String bcc[], + String[] bulkAddresses, String subject, String body, boolean htmlFormat, String[] replyTo, + String messageId, String inReplyTo, String smtpHost, int smtpPort, boolean smtpSecure, String smtpUsername, + String smtpPassword, List fileAttachments, ServiceContext serviceContext) throws Exception { + + return addEmail(className, classPK, from, to, cc, bcc, bulkAddresses, subject, body, htmlFormat, replyTo, + messageId, inReplyTo, smtpHost, smtpPort, smtpSecure, smtpUsername, smtpPassword, fileAttachments, + false, null, serviceContext); } - public Email addEmail(String className, long classPK, String from, String to[], String cc[], - String bcc[], String subject, String body, boolean htmlFormat, - List fileAttachments, boolean sendSync, String templateName, + @Override + public Email addEmail(String className, long classPK, String from, String to[], String cc[], String bcc[], + String subject, String body, boolean htmlFormat, List fileAttachments, boolean sendSync, ServiceContext serviceContext) throws Exception { - return addEmail(className, classPK, from, to, cc, bcc, null, subject, body, htmlFormat, null, null, - null, null, 0, false, null, null, fileAttachments, sendSync, templateName, serviceContext); + + return addEmail(className, classPK, from, to, cc, bcc, null, subject, body, htmlFormat, null, null, null, null, + 0, false, null, null, fileAttachments, sendSync, null, serviceContext); } - public Email addEmail(String className, long classPK, String from, String to[], String cc[], - String bcc[], String[] bulkAddresses, String subject, String body, boolean htmlFormat, - String[] replyTo, String messageId, String inReplyTo, String smtpHost, int smtpPort, - boolean smtpSecure, String smtpUsername, String smtpPassword, - List fileAttachments, boolean sendSync, String templateName, + @Override + public Email addEmail(String className, long classPK, String from, String to[], String cc[], String bcc[], + String subject, String body, boolean htmlFormat, List fileAttachments, boolean sendSync, + String templateName, ServiceContext serviceContext) throws Exception { + + return addEmail(className, classPK, from, to, cc, bcc, null, subject, body, htmlFormat, null, null, null, null, + 0, false, null, null, fileAttachments, sendSync, templateName, serviceContext); + } + + @Override + public Email addEmail(String className, long classPK, String from, String to[], String cc[], String bcc[], + String[] bulkAddresses, String subject, String body, boolean htmlFormat, String[] replyTo, + String messageId, String inReplyTo, String smtpHost, int smtpPort, boolean smtpSecure, String smtpUsername, + String smtpPassword, List fileAttachments, boolean sendSync, String templateName, ServiceContext serviceContext) throws Exception { User user = userLocalService.getUser(serviceContext.getUserId()); - Date now = new Date(); - validate(from, to, cc, bcc, bulkAddresses, subject, body, replyTo); - - Email email = emailLocalService.createEmail(counterLocalService.increment(Email.class.getName())); - + Email email = createEmail(counterLocalService.increment(Email.class.getName())); email.setGroupId(serviceContext.getScopeGroupId()); email.setCompanyId(serviceContext.getCompanyId()); email.setCreateDate(serviceContext.getCreateDate(now)); @@ -143,7 +128,6 @@ public class EmailLocalServiceImpl extends EmailLocalServiceBaseImpl { email.setClassPK(classPK); email.setUserId(user.getUserId()); email.setUserName(user.getFullName()); - email.setFrom(from); email.setTo(StringUtil.merge(to, StringPool.COMMA)); email.setCc(StringUtil.merge(cc, StringPool.COMMA)); @@ -151,12 +135,10 @@ public class EmailLocalServiceImpl extends EmailLocalServiceBaseImpl { email.setBulkAddresses(StringUtil.merge(bulkAddresses, StringPool.COMMA)); email.setSubject(subject); email.setBody(body); - email.setHtmlFormat(htmlFormat); email.setReplyTo(StringUtil.merge(replyTo, StringPool.COMMA)); email.setMessageId(messageId); email.setInReplyTo(inReplyTo); - email.setSmtpHost(smtpHost); email.setSmtpPort(smtpPort); email.setSmtpSecure(smtpSecure); @@ -164,47 +146,37 @@ public class EmailLocalServiceImpl extends EmailLocalServiceBaseImpl { email.setSmtpPassword(smtpPassword); email.setCancel(false); email.setTemplateName(templateName); - email = addEmail(email); - // Email Attachments - if (fileAttachments != null && !fileAttachments.isEmpty()) { Folder folder = addEmailAttachmentsFolder(serviceContext.getCompanyId(), email.getEmailId()); for (FileAttachment fileAttachment : fileAttachments) { if (fileAttachment instanceof FileAttachment) { - ((it.tref.liferay.portos.mailmanager.shared.model.FileAttachment) fileAttachment) - .generateFile(); + ((it.tref.liferay.portos.mailmanager.shared.model.FileAttachment) fileAttachment).generateFile(); } - emailAttachmentLocalService.addEmailAttachment(serviceContext.getCompanyId(), - email.getEmailId(), folder.getFolderId(), fileAttachment.getFileName(), - fileAttachment.getFile()); + emailAttachmentLocalService.addEmailAttachment(serviceContext.getCompanyId(), email.getEmailId(), + folder.getFolderId(), fileAttachment.getFileName(), fileAttachment.getFile()); FileUtil.delete(fileAttachment.getFile()); } } - // Manifattura Web Group per Regione Siciliana - // Il valore di ritorno viene ignorato da SchedulerInvioDocumenti, le - // mail impostate per l'invio asincrono si perdono nell'abisso - // dell'oblio. Siccome questo è già un task asincrono, inviamo in - // maniera sincrona e festeggiamo. + // Il valore di ritorno viene ignorato da SchedulerInvioDocumenti, le mail impostate per l'invio asincrono si + // perdono nell'abisso dell'oblio. Siccome questo è già un task asincrono, inviamo in maniera sincrona e + // festeggiamo. sendSync = true; - if (sendSync) { MailSenderUtil.sendMail(email); markAsSent(email.getEmailId(), new Date(), StringPool.BLANK); } - return email; } - public Email updateEmail(long emailId, String from, String to[], String cc[], String bcc[], - String subject, String body, ServiceContext serviceContext) throws Exception { - - Email email = emailLocalService.getEmail(emailId); + @Override + public Email updateEmail(long emailId, String from, String to[], String cc[], String bcc[], String subject, + String body, ServiceContext serviceContext) throws Exception { + Email email = getEmail(emailId); validate(from, to, cc, bcc, null, subject, body, null); - email.setModifiedDate(new Date()); email.setFrom(from); email.setTo(StringUtil.merge(to, StringPool.COMMA)); @@ -212,60 +184,54 @@ public class EmailLocalServiceImpl extends EmailLocalServiceBaseImpl { email.setBcc(StringUtil.merge(bcc, StringPool.COMMA)); email.setSubject(subject); email.setBody(body); - return updateEmail(email); } - public Email markAsSent(long emailId, Date sentDate, String statusMessage) throws PortalException, - SystemException { + @Override + public Email markAsSent(long emailId, Date sentDate, String statusMessage) throws PortalException, SystemException { - Email email = emailLocalService.getEmail(emailId); + Email email = getEmail(emailId); email.setModifiedDate(new Date()); - email.setSent(true); email.setSentDate(sentDate); email.setStatusMessage(statusMessage); - return updateEmail(email); } - public Email updateStatusMessage(long emailId, String statusMessage) throws PortalException, - SystemException { + @Override + public Email updateStatusMessage(long emailId, String statusMessage) throws PortalException, SystemException { - Email email = emailLocalService.getEmail(emailId); + Email email = getEmail(emailId); email.setModifiedDate(new Date()); - email.setStatusMessage(statusMessage); - return updateEmail(email); } + @Override public Email resendEmail(long emailId) throws PortalException, SystemException { - Email email = emailLocalService.getEmail(emailId); + Email email = getEmail(emailId); email.setModifiedDate(new Date()); - email.setStatusMessage(""); email.setSent(false); email.setSentDate(null); email.setCancel(false); - return updateEmail(email); } + @Override public Email cancelEmail(long emailId) throws PortalException, SystemException { - Email email = emailLocalService.getEmail(emailId); + Email email = getEmail(emailId); email.setModifiedDate(new Date()); - email.setCancel(true); - return updateEmail(email); } @Override public Email deleteEmail(long emailId) throws PortalException, SystemException { - Email email = emailLocalService.getEmail(emailId); + + Email email = getEmail(emailId); return deleteEmail(email); } @@ -273,108 +239,126 @@ public class EmailLocalServiceImpl extends EmailLocalServiceBaseImpl { public Email deleteEmail(Email email) throws SystemException { super.deleteEmail(email); - // Email Attachments - - List emailAttachments = emailAttachmentLocalService - .findByEmailId(email.getEmailId()); + List emailAttachments = emailAttachmentLocalService.findByEmailId(email.getEmailId()); for (EmailAttachment emailAttachment : emailAttachments) { emailAttachmentLocalService.deleteEmailAttachment(emailAttachment); } - return email; } + @Override public List findByCompany(long companyId) throws SystemException { + return emailPersistence.findByCompany(companyId); } + @Override public List findByCompany(long companyId, int start, int end) throws SystemException { + return emailPersistence.findByCompany(companyId, start, end); } + @Override public List findByCompany(long companyId, int start, int end, OrderByComparator orderByComparator) throws SystemException { + return emailPersistence.findByCompany(companyId, start, end, orderByComparator); } + @Override public int countByCompany(long companyId) throws SystemException { + return emailPersistence.countByCompany(companyId); } + @Override public List findByC_G(long companyId, long groupId) throws SystemException { + return emailPersistence.findByC_G(companyId, groupId); } + @Override public List findByC_G(long companyId, long groupId, int start, int end) throws SystemException { + return emailPersistence.findByC_G(companyId, groupId, start, end); } - public List findByC_G(long companyId, long groupId, int start, int end, - OrderByComparator orderByComparator) throws SystemException { + @Override + public List findByC_G(long companyId, long groupId, int start, int end, OrderByComparator orderByComparator) + throws SystemException { + return emailPersistence.findByC_G(companyId, groupId, start, end, orderByComparator); } + @Override public int countByC_G(long companyId, long groupId) throws SystemException { + return emailPersistence.countByC_G(companyId, groupId); } + @Override public List findByC_G_T(long companyId, long groupId, String templateName) throws SystemException { + return emailPersistence.findByC_G_T(companyId, groupId, templateName); } + @Override public List findByC_G_T(long companyId, long groupId, String templateName, int start, int end) throws SystemException { + return emailPersistence.findByC_G_T(companyId, groupId, templateName, start, end); } + @Override public int countByC_G_T(long companyId, long groupId, String templateName) throws SystemException { + return emailPersistence.countByC_G_T(companyId, groupId, templateName); } + @Override public List findByC_G_C_C(long companyId, long groupId, long classNameId, long classPK) throws SystemException { + return emailPersistence.findByC_G_C_C(companyId, groupId, classNameId, classPK); } - public List findByC_G_C_C(long companyId, long groupId, long classNameId, long classPK, int start, - int end) throws SystemException { + @Override + public List findByC_G_C_C(long companyId, long groupId, long classNameId, long classPK, int start, int end) + throws SystemException { + return emailPersistence.findByC_G_C_C(companyId, groupId, classNameId, classPK, start, end); } - public int countByC_G_C_C(long companyId, long groupId, long classNameId, long classPK) - throws SystemException { + @Override + public int countByC_G_C_C(long companyId, long groupId, long classNameId, long classPK) throws SystemException { + return emailPersistence.countByC_G_C_C(companyId, groupId, classNameId, classPK); } - private Folder addEmailAttachmentsFolder(long companyId, long emailId) throws PortalException, - SystemException { + private Folder addEmailAttachmentsFolder(long companyId, long emailId) throws PortalException, SystemException { Company company = companyLocalService.getCompany(companyId); - Group companyGroup = company.getGroup(); User defaultUser = company.getDefaultUser(); - - Folder folder = dlAppLocalService.getFolder(companyGroup.getGroupId(), - DLFolderConstants.DEFAULT_PARENT_FOLDER_ID, EmailConstants.DEFAULT_ATTACHMENTS_FOLDER_NAME); - + Folder folder = + dlAppLocalService.getFolder(companyGroup.getGroupId(), DLFolderConstants.DEFAULT_PARENT_FOLDER_ID, + EmailConstants.DEFAULT_ATTACHMENTS_FOLDER_NAME); ServiceContext serviceContext = new ServiceContext(); serviceContext.setGroupPermissions(new String[] { ActionKeys.VIEW }); serviceContext.setGuestPermissions(new String[] { ActionKeys.VIEW }); - - return dlAppLocalService.addFolder(defaultUser.getUserId(), folder.getRepositoryId(), - folder.getFolderId(), String.valueOf(emailId), StringPool.BLANK, serviceContext); + return dlAppLocalService.addFolder(defaultUser.getUserId(), folder.getRepositoryId(), folder.getFolderId(), + String.valueOf(emailId), StringPool.BLANK, serviceContext); } - private void validate(String from, String to[], String cc[], String bcc[], String[] bulkAddresses, - String subject, String body, String[] replyTo) throws PortalException { + private void validate(String from, String to[], String cc[], String bcc[], String[] bulkAddresses, String subject, + String body, String[] replyTo) throws PortalException { if (Validator.isNull(from)) { throw new RequiredEmailFromException(); } else if (!Validator.isEmailAddress(from)) { throw new EmailFromException(); } - if (to == null || (to != null && to.length == 0)) { throw new RequiredEmailToException(); } else { @@ -384,7 +368,6 @@ public class EmailLocalServiceImpl extends EmailLocalServiceBaseImpl { } } } - if (cc != null && cc.length > 0) { for (String emailAddress : cc) { if (!Validator.isEmailAddress(emailAddress)) { @@ -392,7 +375,6 @@ public class EmailLocalServiceImpl extends EmailLocalServiceBaseImpl { } } } - if (bcc != null && bcc.length > 0) { for (String emailAddress : bcc) { if (!Validator.isEmailAddress(emailAddress)) { @@ -400,7 +382,6 @@ public class EmailLocalServiceImpl extends EmailLocalServiceBaseImpl { } } } - if (bulkAddresses != null && bulkAddresses.length > 0) { for (String emailAddress : bulkAddresses) { if (!Validator.isEmailAddress(emailAddress)) { @@ -408,15 +389,12 @@ public class EmailLocalServiceImpl extends EmailLocalServiceBaseImpl { } } } - if (Validator.isNull(subject)) { throw new RequiredEmailSubjectException(); } - if (Validator.isNull(body)) { throw new RequiredEmailBodyException(); } - if (replyTo != null && replyTo.length == 0) { for (String emailAddress : replyTo) { if (!Validator.isEmailAddress(emailAddress)) { diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/service/impl/EmailTemplateLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/service/impl/EmailTemplateLocalServiceImpl.java index b5340703..f929eeef 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/service/impl/EmailTemplateLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/service/impl/EmailTemplateLocalServiceImpl.java @@ -1,27 +1,13 @@ /** - * Copyright (c) 2000-present Liferay, Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * GNU Lesser General Public License as published by the Free Software Foundation; either version - * 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software + * Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in + * the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. */ package it.tref.liferay.portos.mailmanager.service.impl; -import com.liferay.portal.kernel.exception.PortalException; -import com.liferay.portal.kernel.exception.SystemException; -import com.liferay.portal.kernel.util.OrderByComparator; -import com.liferay.portal.kernel.util.StringPool; -import com.liferay.portal.kernel.util.StringUtil; -import com.liferay.portal.kernel.util.Validator; -import com.liferay.portal.model.ResourceConstants; -import com.liferay.portal.model.User; -import com.liferay.portal.service.ServiceContext; - import it.tref.liferay.portos.mailmanager.EmailTemplateCcException; import it.tref.liferay.portos.mailmanager.EmailTemplateCcnException; import it.tref.liferay.portos.mailmanager.EmailTemplateFromException; @@ -37,17 +23,24 @@ import it.tref.liferay.portos.mailmanager.service.base.EmailTemplateLocalService import java.util.Date; import java.util.List; +import com.liferay.portal.kernel.exception.PortalException; +import com.liferay.portal.kernel.exception.SystemException; +import com.liferay.portal.kernel.util.OrderByComparator; +import com.liferay.portal.kernel.util.StringPool; +import com.liferay.portal.kernel.util.StringUtil; +import com.liferay.portal.kernel.util.Validator; +import com.liferay.portal.model.ResourceConstants; +import com.liferay.portal.model.User; +import com.liferay.portal.service.ServiceContext; + /** * The implementation of the email template local service. - * *

- * All custom service methods should be put in this class. Whenever methods are added, rerun - * ServiceBuilder to copy their definitions into the - * {@link it.noovle.azimut.icf.mailmanager.service.EmailTemplateLocalService} interface. - * + * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy + * their definitions into the {@link it.noovle.azimut.icf.mailmanager.service.EmailTemplateLocalService} interface. *

- * 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,191 +48,171 @@ import java.util.List; * @see it.noovle.azimut.icf.mailmanager.service.EmailTemplateLocalServiceUtil */ public class EmailTemplateLocalServiceImpl extends EmailTemplateLocalServiceBaseImpl { - /* - * NOTE FOR DEVELOPERS: - * - * Never reference this interface directly. Always use {@link - * it.noovle.azimut.icf.mailmanager.service.EmailTemplateLocalServiceUtil} to access the email - * template local service. - */ - - @Override - public EmailTemplate addEmailTemplate(String templateName, String from, String[] to, String[] cc, String[] ccn, - String subject, String body, boolean attachmentPermitted, ServiceContext serviceContext) throws SystemException, - PortalException { - - User user = userLocalService.getUser(serviceContext.getUserId()); - - Date now = new Date(); - - validate(templateName, from, to, cc, ccn, subject, body); - - EmailTemplate emailTemplate = - emailTemplateLocalService.createEmailTemplate(counterLocalService.increment(EmailTemplate.class.getName())); - - emailTemplate.setCompanyId(serviceContext.getCompanyId()); - emailTemplate.setUserId(user.getUserId()); - emailTemplate.setUserName(user.getFullName()); - emailTemplate.setCreateDate(serviceContext.getCreateDate(now)); - emailTemplate.setModifiedDate(serviceContext.getModifiedDate(now)); - emailTemplate.setGroupId(serviceContext.getScopeGroupId()); - - emailTemplate.setTemplateName(templateName); - - emailTemplate.setFrom(from); - emailTemplate.setTo(StringUtil.merge(to, StringPool.COMMA)); - emailTemplate.setCc(StringUtil.merge(cc, StringPool.COMMA)); - emailTemplate.setCcn(StringUtil.merge(ccn, StringPool.COMMA)); - emailTemplate.setSubject(subject); - emailTemplate.setBody(body); - - emailTemplate.setAttachmentPermitted(attachmentPermitted); - - emailTemplate = emailTemplateLocalService.addEmailTemplate(emailTemplate); - - // Resource - - resourceLocalService.addResources(emailTemplate.getCompanyId(), emailTemplate.getGroupId(), - emailTemplate.getUserId(), EmailTemplate.class.getName(), emailTemplate.getPrimaryKey(), false, true, true); - - return emailTemplate; - } - - @Override - public EmailTemplate updateEmailTemplate(long emailTemplateId, String templateName, String from, String[] to, - String[] cc, String[] ccn, String subject, String body, boolean attachmentPermitted, ServiceContext serviceContext) - throws SystemException, PortalException { - - EmailTemplate emailTemplate = emailTemplateLocalService.getEmailTemplate(emailTemplateId); - - validate(templateName, from, to, cc, ccn, subject, body); - - emailTemplate.setModifiedDate(serviceContext.getModifiedDate(new Date())); - - emailTemplate.setFrom(from); - emailTemplate.setTo(StringUtil.merge(to, StringPool.COMMA)); - emailTemplate.setCc(StringUtil.merge(cc, StringPool.COMMA)); - emailTemplate.setCcn(StringUtil.merge(ccn, StringPool.COMMA)); - emailTemplate.setSubject(subject); - emailTemplate.setBody(body); - - emailTemplate.setAttachmentPermitted(attachmentPermitted); - - emailTemplate = emailTemplateLocalService.updateEmailTemplate(emailTemplate); - - return emailTemplate; - } - - @Override - public EmailTemplate deleteEmailTemplate(long emailTemplateId) throws PortalException, SystemException { - EmailTemplate emailTemplate = emailTemplateLocalService.getEmailTemplate(emailTemplateId); - return deleteEmailTemplate(emailTemplate); - } - - @Override - public EmailTemplate deleteEmailTemplate(EmailTemplate emailTemplate) throws SystemException { - - super.deleteEmailTemplate(emailTemplate); - - // Resource - - try { - resourceLocalService.deleteResource(emailTemplate.getCompanyId(), EmailTemplate.class.getName(), - ResourceConstants.SCOPE_INDIVIDUAL, emailTemplate.getPrimaryKey()); - } catch (PortalException e) { - } - - return emailTemplate; - } - - @Override - public int countByC_GroupId(long companyId, long groupId) throws SystemException { - return emailTemplatePersistence.countByC_GroupId(companyId, groupId); - } - - @Override - public List findByC_GroupId(long companyId, long groupId, int start, int end, OrderByComparator orderBy) - throws SystemException { - return emailTemplatePersistence.findByC_GroupId(companyId, groupId, start, end, orderBy); - } - - @Override - public EmailTemplate findByC_GroupId_Name(long companyId, long groupId, String templateName) - throws NoSuchEmailTemplateException, SystemException { - return emailTemplatePersistence.findByC_GroupId_Name(companyId, groupId, templateName); - } - - @Override - public EmailTemplate fetchByC_GroupId_Name(long companyId, long groupId, String templateName) throws SystemException { - return emailTemplatePersistence.fetchByC_GroupId_Name(companyId, groupId, templateName); - } - - @Override - public int countByCompany(long companyId) throws SystemException { - return emailTemplatePersistence.countByCompany(companyId); - } - - @Override - public List findByCompany(long companyId, int start, int end, OrderByComparator orderBy) - throws SystemException { - return emailTemplatePersistence.findByCompany(companyId, start, end, orderBy); - } - - @Override - public int countByC_Name(long companyId, String name) throws SystemException { - return emailTemplatePersistence.countByC_Name(companyId, name); - } - - @Override - public EmailTemplate findByC_Name(long companyId, String templateName) throws SystemException, - NoSuchEmailTemplateException { - return emailTemplatePersistence.findByC_Name(companyId, templateName); - } - - private void validate(String templateName, String from, String[] to, String[] cc, String[] ccn, String subject, - String body) throws PortalException { - - if (Validator.isNull(templateName)) { - throw new RequiredEmailTemplateNameException(); - } - - if (Validator.isNull(from)) { - throw new RequiredEmailTemplateFromException(); - } else if (!Validator.isEmailAddress(from)) { - throw new EmailTemplateFromException(); - } - - if (to != null && to.length > 0) { - for (String emailAddress : to) { - if (!Validator.isEmailAddress(emailAddress)) { - throw new EmailTemplateToException(); - } - } - } - - if (cc != null && cc.length > 0) { - for (String emailAddress : cc) { - if (!Validator.isEmailAddress(emailAddress)) { - throw new EmailTemplateCcException(); - } - } - } - - if (ccn != null && ccn.length > 0) { - for (String emailAddress : ccn) { - if (!Validator.isEmailAddress(emailAddress)) { - throw new EmailTemplateCcnException(); - } - } - } - - if (Validator.isNull(subject)) { - throw new RequiredEmailTemplateSubjectException(); - } - - if (Validator.isNull(body)) { - throw new RequiredEmailTemplateBodyException(); - } - - } + /* + * NOTE FOR DEVELOPERS: Never reference this interface directly. Always use {@link + * it.noovle.azimut.icf.mailmanager.service.EmailTemplateLocalServiceUtil} to access the email template local + * service. + */ + + @Override + public EmailTemplate addEmailTemplate(String templateName, String from, String[] to, String[] cc, String[] ccn, + String subject, String body, boolean attachmentPermitted, ServiceContext serviceContext) + throws SystemException, PortalException { + + User user = userLocalService.getUser(serviceContext.getUserId()); + Date now = new Date(); + validate(templateName, from, to, cc, ccn, subject, body); + EmailTemplate emailTemplate = createEmailTemplate(counterLocalService.increment(EmailTemplate.class.getName())); + emailTemplate.setCompanyId(serviceContext.getCompanyId()); + emailTemplate.setUserId(user.getUserId()); + emailTemplate.setUserName(user.getFullName()); + emailTemplate.setCreateDate(serviceContext.getCreateDate(now)); + emailTemplate.setModifiedDate(serviceContext.getModifiedDate(now)); + emailTemplate.setGroupId(serviceContext.getScopeGroupId()); + emailTemplate.setTemplateName(templateName); + emailTemplate.setFrom(from); + emailTemplate.setTo(StringUtil.merge(to, StringPool.COMMA)); + emailTemplate.setCc(StringUtil.merge(cc, StringPool.COMMA)); + emailTemplate.setCcn(StringUtil.merge(ccn, StringPool.COMMA)); + emailTemplate.setSubject(subject); + emailTemplate.setBody(body); + emailTemplate.setAttachmentPermitted(attachmentPermitted); + emailTemplate = addEmailTemplate(emailTemplate); + // Resource + resourceLocalService.addResources(emailTemplate.getCompanyId(), emailTemplate.getGroupId(), + emailTemplate.getUserId(), EmailTemplate.class.getName(), emailTemplate.getPrimaryKey(), false, true, + true); + return emailTemplate; + } + + @Override + public EmailTemplate updateEmailTemplate(long emailTemplateId, String templateName, String from, String[] to, + String[] cc, String[] ccn, String subject, String body, boolean attachmentPermitted, + ServiceContext serviceContext) throws SystemException, PortalException { + + EmailTemplate emailTemplate = getEmailTemplate(emailTemplateId); + validate(templateName, from, to, cc, ccn, subject, body); + emailTemplate.setModifiedDate(serviceContext.getModifiedDate(new Date())); + emailTemplate.setFrom(from); + emailTemplate.setTo(StringUtil.merge(to, StringPool.COMMA)); + emailTemplate.setCc(StringUtil.merge(cc, StringPool.COMMA)); + emailTemplate.setCcn(StringUtil.merge(ccn, StringPool.COMMA)); + emailTemplate.setSubject(subject); + emailTemplate.setBody(body); + emailTemplate.setAttachmentPermitted(attachmentPermitted); + emailTemplate = updateEmailTemplate(emailTemplate); + return emailTemplate; + } + + @Override + public EmailTemplate deleteEmailTemplate(long emailTemplateId) throws PortalException, SystemException { + + EmailTemplate emailTemplate = getEmailTemplate(emailTemplateId); + return deleteEmailTemplate(emailTemplate); + } + + @Override + public EmailTemplate deleteEmailTemplate(EmailTemplate emailTemplate) throws SystemException { + + super.deleteEmailTemplate(emailTemplate); + // Resource + try { + resourceLocalService.deleteResource(emailTemplate.getCompanyId(), EmailTemplate.class.getName(), + ResourceConstants.SCOPE_INDIVIDUAL, emailTemplate.getPrimaryKey()); + } catch (PortalException e) {} + return emailTemplate; + } + + @Override + public int countByC_GroupId(long companyId, long groupId) throws SystemException { + + return emailTemplatePersistence.countByC_GroupId(companyId, groupId); + } + + @Override + public List findByC_GroupId(long companyId, long groupId, int start, int end, + OrderByComparator orderBy) throws SystemException { + + return emailTemplatePersistence.findByC_GroupId(companyId, groupId, start, end, orderBy); + } + + @Override + public EmailTemplate findByC_GroupId_Name(long companyId, long groupId, String templateName) + throws NoSuchEmailTemplateException, SystemException { + + return emailTemplatePersistence.findByC_GroupId_Name(companyId, groupId, templateName); + } + + @Override + public EmailTemplate fetchByC_GroupId_Name(long companyId, long groupId, String templateName) + throws SystemException { + + return emailTemplatePersistence.fetchByC_GroupId_Name(companyId, groupId, templateName); + } + + @Override + public int countByCompany(long companyId) throws SystemException { + + return emailTemplatePersistence.countByCompany(companyId); + } + + @Override + public List findByCompany(long companyId, int start, int end, OrderByComparator orderBy) + throws SystemException { + + return emailTemplatePersistence.findByCompany(companyId, start, end, orderBy); + } + + @Override + public int countByC_Name(long companyId, String name) throws SystemException { + + return emailTemplatePersistence.countByC_Name(companyId, name); + } + + @Override + public EmailTemplate findByC_Name(long companyId, String templateName) throws SystemException, + NoSuchEmailTemplateException { + + return emailTemplatePersistence.findByC_Name(companyId, templateName); + } + + private void validate(String templateName, String from, String[] to, String[] cc, String[] ccn, String subject, + String body) throws PortalException { + + if (Validator.isNull(templateName)) { + throw new RequiredEmailTemplateNameException(); + } + if (Validator.isNull(from)) { + throw new RequiredEmailTemplateFromException(); + } else if (!Validator.isEmailAddress(from)) { + throw new EmailTemplateFromException(); + } + if (to != null && to.length > 0) { + for (String emailAddress : to) { + if (!Validator.isEmailAddress(emailAddress)) { + throw new EmailTemplateToException(); + } + } + } + if (cc != null && cc.length > 0) { + for (String emailAddress : cc) { + if (!Validator.isEmailAddress(emailAddress)) { + throw new EmailTemplateCcException(); + } + } + } + if (ccn != null && ccn.length > 0) { + for (String emailAddress : ccn) { + if (!Validator.isEmailAddress(emailAddress)) { + throw new EmailTemplateCcnException(); + } + } + } + if (Validator.isNull(subject)) { + throw new RequiredEmailTemplateSubjectException(); + } + if (Validator.isNull(body)) { + throw new RequiredEmailTemplateBodyException(); + } + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/maintenance/NoSuchMaintenanceScheduleException.java b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/maintenance/NoSuchMaintenanceScheduleException.java new file mode 100644 index 00000000..1f658b9f --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/service/it/tref/liferay/portos/maintenance/NoSuchMaintenanceScheduleException.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. + * + * This library is free software; you can redistribute it and/or modify it under + * the terms of the GNU Lesser General Public License as published by the Free + * Software Foundation; either version 2.1 of the License, or (at your option) + * any later version. + * + * This library is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more + * details. + */ + +package it.tref.liferay.portos.maintenance; + +import com.liferay.portal.NoSuchModelException; + +/** + * @author + */ +public class NoSuchMaintenanceScheduleException extends NoSuchModelException { + + public NoSuchMaintenanceScheduleException() { + super(); + } + + public NoSuchMaintenanceScheduleException(String msg) { + super(msg); + } + + public NoSuchMaintenanceScheduleException(String msg, Throwable cause) { + super(msg, cause); + } + + public NoSuchMaintenanceScheduleException(Throwable cause) { + super(cause); + } + +} \ No newline at end of file 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..56360468 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 @@ -1,5 +1,14 @@ package it.tref.liferay.portos.maintenance.portlet; +import it.tref.liferay.portos.maintenance.model.MaintenanceSchedule; +import it.tref.liferay.portos.maintenance.service.MaintenanceScheduleServiceUtil; + +import java.util.Calendar; + +import javax.portlet.ActionRequest; +import javax.portlet.ActionResponse; +import javax.portlet.PortletSession; + import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.language.LanguageUtil; import com.liferay.portal.kernel.log.Log; @@ -17,105 +26,73 @@ import com.liferay.portal.service.ServiceContextFactory; import com.liferay.portal.util.PortalUtil; import com.liferay.util.bridges.mvc.MVCPortlet; -import it.tref.liferay.portos.maintenance.model.MaintenanceSchedule; -import it.tref.liferay.portos.maintenance.service.MaintenanceScheduleServiceUtil; - -import java.util.Calendar; - -import javax.portlet.ActionRequest; -import javax.portlet.ActionResponse; -import javax.portlet.PortletSession; - -/** - * Portlet implementation class AdminMaintenancePortlet - */ public class AdminMaintenancePortlet extends MVCPortlet { - private final static Log _log = LogFactoryUtil.getLog(AdminMaintenancePortlet.class); - - public void maintain(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { - - PortletSession portletSession = actionRequest.getPortletSession(); - - String message = ParamUtil.getString(actionRequest, "message"); - - String className = - LanguageUtil - .get(LocaleUtil.getDefault(), - "the-sign-in-process-is-temporarily-disabled-because-the-portal-is-undergoing-a-routine-maintenance-upgrade"); - - if (Validator.isNotNull(message)) { - className = message; - } - - Class clazz = - ClassResolverUtil.resolve("com.liferay.portal.util.MaintenanceUtil", PortalClassLoaderUtil.getClassLoader()); - ReflectionUtil.getDeclaredMethod(clazz, "maintain", String.class, String.class).invoke(null, - portletSession.getId(), className); - - _log.info("Maintenance session id: " + portletSession.getId()); - - - } - - public void deleteMaintenanceSchedule(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { - _log.info("deleteMaintenanceSchedule - Inizio metodo"); - - ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest); - long maintenanceScheduleId = ParamUtil.getLong(actionRequest, "maintenanceScheduleId"); - - MaintenanceScheduleServiceUtil.deleteMaintenanceSchedule(maintenanceScheduleId, serviceContext); - - } - - public void editMaintenanceSchedule(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { - _log.info("editMaintenanceSchedule - Inizio metodo"); - - String cmd = ParamUtil.getString(actionRequest, Constants.CMD); - - ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest); - - long maintenanceScheduleId = ParamUtil.getLong(actionRequest, "maintenanceScheduleId"); - String type = ParamUtil.getString(actionRequest, "type"); - String reason = ParamUtil.getString(actionRequest, "reason"); - String portalMessage = ParamUtil.getString(actionRequest, "portalMessage"); - long after = ParamUtil.getLong(actionRequest, "after"); - String onreboot = ParamUtil.getString(actionRequest, "onreboot"); - String status = ParamUtil.getString(actionRequest, "status"); - String statusMessage = ParamUtil.getString(actionRequest, "statusMessage"); - - Calendar calendarEnd = Calendar.getInstance(); - calendarEnd.set(ParamUtil.getInteger(actionRequest, "endYear"), - ParamUtil.getInteger(actionRequest, "endMonth") + 1, ParamUtil.getInteger(actionRequest, "endDay"), - ParamUtil.getInteger(actionRequest, "endHour"), ParamUtil.getInteger(actionRequest, "endMinute")); - - MaintenanceSchedule maintenanceSchedule = null; - - try { - - if (cmd.equals(Constants.ADD)) { - maintenanceSchedule = - MaintenanceScheduleServiceUtil.addMaintenanceSchedule(type, reason, portalMessage, after, - calendarEnd.getTime(), onreboot, serviceContext); - } else if (cmd.equals(Constants.UPDATE)) { - maintenanceSchedule = - MaintenanceScheduleServiceUtil.updateMaintenanceSchedule(maintenanceScheduleId, type, reason, - portalMessage, after, calendarEnd.getTime(), onreboot, status, statusMessage, serviceContext); - } - - } catch (PortalException e) { - _log.error(e); - SessionErrors.add(actionRequest, e.getClass()); - } - - if (SessionErrors.isEmpty(actionRequest)) { - actionResponse.setRenderParameter("maintenanceScheduleId", - String.valueOf(maintenanceSchedule.getMaintenanceScheduleId())); - actionResponse.setRenderParameter("mvcPath", "/html/admin_maintenance/edit.jsp"); - } else { - actionResponse.setRenderParameter("mvcPath", "/html/admin_maintenance/edit.jsp"); - PortalUtil.copyRequestParameters(actionRequest, actionResponse); - } - - } + private static final Log _log = LogFactoryUtil.getLog(AdminMaintenancePortlet.class); + + public void maintain(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { + + PortletSession portletSession = actionRequest.getPortletSession(); + String message = ParamUtil.getString(actionRequest, "message"); + String className = LanguageUtil + .get(LocaleUtil.getDefault(), + "the-sign-in-process-is-temporarily-disabled-because-the-portal-is-undergoing-a-routine-maintenance-upgrade"); + if (Validator.isNotNull(message)) { + className = message; + } + Class clazz = ClassResolverUtil.resolve("com.liferay.portal.util.MaintenanceUtil", + PortalClassLoaderUtil.getClassLoader()); + ReflectionUtil.getDeclaredMethod(clazz, "maintain", String.class, String.class).invoke(null, + portletSession.getId(), className); + _log.info("Maintenance session id: " + portletSession.getId()); + } + + public void deleteMaintenanceSchedule(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { + + _log.info("deleteMaintenanceSchedule - Inizio metodo"); + ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest); + long maintenanceScheduleId = ParamUtil.getLong(actionRequest, "maintenanceScheduleId"); + MaintenanceScheduleServiceUtil.deleteMaintenanceSchedule(maintenanceScheduleId, serviceContext); + } + + public void editMaintenanceSchedule(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { + + _log.info("editMaintenanceSchedule - Inizio metodo"); + String cmd = ParamUtil.getString(actionRequest, Constants.CMD); + ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest); + long maintenanceScheduleId = ParamUtil.getLong(actionRequest, "maintenanceScheduleId"); + String type = ParamUtil.getString(actionRequest, "type"); + String reason = ParamUtil.getString(actionRequest, "reason"); + String portalMessage = ParamUtil.getString(actionRequest, "portalMessage"); + long after = ParamUtil.getLong(actionRequest, "after"); + String onreboot = ParamUtil.getString(actionRequest, "onreboot"); + String status = ParamUtil.getString(actionRequest, "status"); + String statusMessage = ParamUtil.getString(actionRequest, "statusMessage"); + Calendar calendarEnd = Calendar.getInstance(); + calendarEnd.set(ParamUtil.getInteger(actionRequest, "endYear"), + ParamUtil.getInteger(actionRequest, "endMonth") + 1, ParamUtil.getInteger(actionRequest, "endDay"), + ParamUtil.getInteger(actionRequest, "endHour"), ParamUtil.getInteger(actionRequest, "endMinute")); + MaintenanceSchedule maintenanceSchedule = null; + try { + if (cmd.equals(Constants.ADD)) { + maintenanceSchedule = MaintenanceScheduleServiceUtil.addMaintenanceSchedule(type, reason, + portalMessage, after, calendarEnd.getTime(), onreboot, serviceContext); + } else if (cmd.equals(Constants.UPDATE)) { + maintenanceSchedule = MaintenanceScheduleServiceUtil.updateMaintenanceSchedule(maintenanceScheduleId, + type, reason, portalMessage, after, calendarEnd.getTime(), onreboot, status, statusMessage, + serviceContext); + } + } catch (PortalException e) { + _log.error(e); + SessionErrors.add(actionRequest, e.getClass()); + } + if (SessionErrors.isEmpty(actionRequest)) { + actionResponse.setRenderParameter("maintenanceScheduleId", + String.valueOf(maintenanceSchedule.getMaintenanceScheduleId())); + actionResponse.setRenderParameter("mvcPath", "/html/admin_maintenance/edit.jsp"); + } else { + actionResponse.setRenderParameter("mvcPath", "/html/admin_maintenance/edit.jsp"); + PortalUtil.copyRequestParameters(actionRequest, actionResponse); + } + } } 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..63cc7323 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=43 + build.date=1631870287519 build.auto.upgrade=true ## diff --git a/liferay-plugins-sdk-6.2/portlets/portos-notification-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/notification/action/StartUpAction.java b/liferay-plugins-sdk-6.2/portlets/portos-notification-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/notification/action/StartUpAction.java index 574459b6..1ba15acf 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-notification-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/notification/action/StartUpAction.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-notification-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/notification/action/StartUpAction.java @@ -25,7 +25,7 @@ import com.liferay.portlet.expando.service.ExpandoTableLocalServiceUtil; public class StartUpAction extends SimpleAction { - private final static Log _log = LogFactoryUtil.getLog(StartUpAction.class); + private static final Log _log = LogFactoryUtil.getLog(StartUpAction.class); @Override public void run(String[] companyIds) throws ActionException { diff --git a/liferay-plugins-sdk-6.2/portlets/portos-report-engine-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/service/persistence/KaleoTaskAssignmentInstanceFinderImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-report-engine-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/service/persistence/KaleoTaskAssignmentInstanceFinderImpl.java index a478789a..c4b09bab 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-report-engine-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/service/persistence/KaleoTaskAssignmentInstanceFinderImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-report-engine-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/service/persistence/KaleoTaskAssignmentInstanceFinderImpl.java @@ -16,76 +16,55 @@ import com.liferay.portal.service.persistence.impl.BasePersistenceImpl; import com.liferay.util.dao.orm.CustomSQLUtil; public class KaleoTaskAssignmentInstanceFinderImpl extends BasePersistenceImpl implements - KaleoTaskAssignmentInstanceFinder { - - private final static Log _log = LogFactoryUtil.getLog(KaleoTaskAssignmentInstanceFinderImpl.class); - - private final String DISTINCT_ASSIGNEE_USER = "Report.distinctKaleoAssigneeUser"; - private final String DISTINCT_ASSIGNEE_ID = "Report.distinctKaleoAssigneeId"; - - public List distinctKaleoAssignee() throws SystemException { - - Session session = null; - - try { - - session = openSession(); - - String sql = CustomSQLUtil.get(DISTINCT_ASSIGNEE_USER); - // sql = StringUtil.replace(sql, "[$GROUP_ID$]", "" + groupId); - // sql = StringUtil.replace(sql, "[$GROUP_ID$]", StringUtil.merge(territorioIds)); - // sql = StringUtil.replace(sql, "[$TIPOPRATICA$]", "02"); - - SQLQuery query = session.createSQLQuery(sql); - query.setCacheable(false); - - QueryPos qPos = QueryPos.getInstance(query); - - List list = query.list(); - - return list; - - } catch (ORMException e) { - _log.error("Errore", e); - throw new SystemException(e); - } finally { - if (session != null) { - closeSession(session); - } - } - } - - public List distinctKaleoAssigneeId(long userId) throws SystemException { - - Session session = null; - - try { - - session = openSession(); - - String sql = CustomSQLUtil.get(DISTINCT_ASSIGNEE_ID); - // sql = StringUtil.replace(sql, "[$GROUP_ID$]", "" + groupId); - // sql = StringUtil.replace(sql, "[$GROUP_ID$]", StringUtil.merge(territorioIds)); - // sql = StringUtil.replace(sql, "[$TIPOPRATICA$]", "02"); - - SQLQuery query = session.createSQLQuery(sql); - query.setCacheable(false); - - QueryPos qPos = QueryPos.getInstance(query); - qPos.add(userId); - - List list = query.list(); - - return list; - - } catch (ORMException e) { - _log.error("Errore", e); - throw new SystemException(e); - } finally { - if (session != null) { - closeSession(session); - } - } - } - + KaleoTaskAssignmentInstanceFinder { + + private static final Log _log = LogFactoryUtil.getLog(KaleoTaskAssignmentInstanceFinderImpl.class); + + private static final String DISTINCT_ASSIGNEE_USER = "Report.distinctKaleoAssigneeUser"; + private static final String DISTINCT_ASSIGNEE_ID = "Report.distinctKaleoAssigneeId"; + + @Override + public List distinctKaleoAssignee() throws SystemException { + + Session session = null; + try { + session = openSession(); + String sql = CustomSQLUtil.get(DISTINCT_ASSIGNEE_USER); + SQLQuery query = session.createSQLQuery(sql); + query.setCacheable(false); + QueryPos qPos = QueryPos.getInstance(query); + List list = query.list(); + return list; + } catch (ORMException e) { + _log.error("Errore", e); + throw new SystemException(e); + } finally { + if (session != null) { + closeSession(session); + } + } + } + + @Override + public List distinctKaleoAssigneeId(long userId) throws SystemException { + + Session session = null; + try { + session = openSession(); + String sql = CustomSQLUtil.get(DISTINCT_ASSIGNEE_ID); + SQLQuery query = session.createSQLQuery(sql); + query.setCacheable(false); + QueryPos qPos = QueryPos.getInstance(query); + qPos.add(userId); + List list = query.list(); + return list; + } catch (ORMException e) { + _log.error("Errore", e); + throw new SystemException(e); + } finally { + if (session != null) { + closeSession(session); + } + } + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/messaging/ProtocolloMessageListener.java b/liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/messaging/ProtocolloMessageListener.java index 797c2483..69e16e5a 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/messaging/ProtocolloMessageListener.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/messaging/ProtocolloMessageListener.java @@ -64,16 +64,17 @@ public class ProtocolloMessageListener extends BaseMessageListener { long userId = message.getLong(ReportConstants.USER_ID); @SuppressWarnings("unchecked") Map taskContextMap = (Map) message.get(ReportConstants.PARAMATERS); - User user = UserLocalServiceUtil.getRoleUsers( - RoleLocalServiceUtil.getRole(companyId, RoleConstants.ADMINISTRATOR).getRoleId()).get(0); + User user = + UserLocalServiceUtil.getRoleUsers( + RoleLocalServiceUtil.getRole(companyId, RoleConstants.ADMINISTRATOR).getRoleId()).get(0); try { PermissionThreadLocal.setPermissionChecker(PermissionCheckerFactoryUtil.create(user)); } catch (Exception e) { throw new SystemException(e); } try { - JSONArray jsonArray = JSONFactoryUtil.createJSONArray(MapUtil.getString(taskContextMap, - ReportConstants.PARAM_REPORTS)); + JSONArray jsonArray = + JSONFactoryUtil.createJSONArray(MapUtil.getString(taskContextMap, ReportConstants.PARAM_REPORTS)); JSONObject jsonObject = jsonArray.getJSONObject(0); ReportDto reportDto = JSONFactoryUtil.looseDeserialize(jsonObject.toString(), ReportDto.class); String protocolloToAttach = StringPool.BLANK; @@ -130,22 +131,32 @@ public class ProtocolloMessageListener extends BaseMessageListener { ServiceContext serviceContext = new ServiceContext(); serviceContext.setUserId(userId); serviceContext.setCompanyId(companyId); - FileEntry newFileEntry = null; + long repositoryId = fileEntry.getRepositoryId(); + long folderId = fileEntry.getFolderId(); + String sourceFileName = reportDto.getFileName() + ".pdf"; + String mimeType = ContentTypes.APPLICATION_PDF; + String title = reportDto.getFileName(); + String description = StringPool.BLANK; + String changeLog = StringPool.BLANK; + FileEntry newFileEntry; try { - newFileEntry = DLAppLocalServiceUtil.addFileEntry(userId, fileEntry.getRepositoryId(), - fileEntry.getFolderId(), reportDto.getFileName() + ".pdf", ContentTypes.APPLICATION_PDF, - reportDto.getFileName(), StringPool.BLANK, StringPool.BLANK, outputBytes, serviceContext); + newFileEntry = + DLAppLocalServiceUtil.addFileEntry(userId, repositoryId, folderId, sourceFileName, + mimeType, title, description, changeLog, outputBytes, serviceContext); } catch (DuplicateFileException e) { - FileEntry fe = DLAppServiceUtil.getFileEntry(fileEntry.getGroupId(), fileEntry.getFolderId(), - reportDto.getFileName()); - _log.info("File duplicato : " + fe.getFileEntryId()); - return; + FileEntry fe = + DLAppServiceUtil.getFileEntry(fileEntry.getGroupId(), fileEntry.getFolderId(), + reportDto.getFileName()); + DLAppLocalServiceUtil.deleteFileEntry(fe.getFileEntryId()); + newFileEntry = + DLAppLocalServiceUtil.addFileEntry(userId, repositoryId, folderId, sourceFileName, + mimeType, title, description, changeLog, outputBytes, serviceContext); } if (Validator.isNotNull(newFileEntry)) { long[] fileEntryIds = new long[0]; fileEntryIds = ArrayUtil.append(fileEntryIds, newFileEntry.getFileEntryId()); - ReportResultDto dto = new ReportResultDto(0L, fileEntryIds, ReportResult.SUCCESSFUL.toString(), - null); + ReportResultDto dto = + new ReportResultDto(0L, fileEntryIds, ReportResult.SUCCESSFUL.toString(), null); Message responseMessage = MessageBusUtil.createResponseMessage(message); responseMessage.setPayload(JSONFactoryUtil.looseSerializeDeep(dto)); MessageBusUtil.sendMessage(responseMessage.getDestinationName(), responseMessage); diff --git a/liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/messaging/ReportMessageListener.java b/liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/messaging/ReportMessageListener.java index 08a2dc0b..a126a417 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/messaging/ReportMessageListener.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/messaging/ReportMessageListener.java @@ -29,7 +29,8 @@ import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.service.ServiceContext; public class ReportMessageListener extends BaseMessageListener { - private final static Log _log = LogFactoryUtil.getLog(ReportTaskMessageListener.class); + + private static final Log _log = LogFactoryUtil.getLog(ReportTaskMessageListener.class); @Override protected void doReceive(Message message) throws Exception { diff --git a/liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/portlet/TestPdf.java b/liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/portlet/TestPdf.java index 48655c7c..1a1e3b2e 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/portlet/TestPdf.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/portlet/TestPdf.java @@ -46,7 +46,7 @@ import com.liferay.util.bridges.mvc.MVCPortlet; public class TestPdf extends MVCPortlet { - private final static Log _log = LogFactoryUtil.getLog(TestPdf.class); + private static final Log _log = LogFactoryUtil.getLog(TestPdf.class); @Override public void serveResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse) throws IOException, diff --git a/liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/service/impl/ReportTaskLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/service/impl/ReportTaskLocalServiceImpl.java index 3c6baec9..f5a8f1ae 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/service/impl/ReportTaskLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/service/impl/ReportTaskLocalServiceImpl.java @@ -46,8 +46,7 @@ public class ReportTaskLocalServiceImpl extends ReportTaskLocalServiceBaseImpl { User user = userLocalService.getUser(serviceContext.getUserId()); Date now = new Date(); - ReportTask reportTask = reportTaskLocalService.createReportTask(counterLocalService.increment(ReportTask.class - .getName())); + ReportTask reportTask = createReportTask(counterLocalService.increment(ReportTask.class.getName())); reportTask.setCompanyId(serviceContext.getCompanyId()); reportTask.setUserId(user.getUserId()); reportTask.setUserName(user.getFullName()); @@ -57,16 +56,16 @@ public class ReportTaskLocalServiceImpl extends ReportTaskLocalServiceBaseImpl { String taskContext = JSONFactoryUtil.looseSerializeDeep(taskContextMap); reportTask.setTaskContext(taskContext); } - return reportTaskLocalService.addReportTask(reportTask); + return addReportTask(reportTask); } @Override public ReportTask markAsCompleted(long reportTaskId, Date completionDate) throws PortalException, SystemException { - ReportTask reportTask = reportTaskLocalService.getReportTask(reportTaskId); + ReportTask reportTask = getReportTask(reportTaskId); reportTask.setModifiedDate(new Date()); reportTask.setCompleted(true); reportTask.setCompletionDate(completionDate); - return reportTaskLocalService.updateReportTask(reportTask); + return updateReportTask(reportTask); } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/service/impl/ReportTaskManagerServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/service/impl/ReportTaskManagerServiceImpl.java index d42a2c0e..4fb530c6 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/service/impl/ReportTaskManagerServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/report/service/impl/ReportTaskManagerServiceImpl.java @@ -63,7 +63,7 @@ import com.liferay.portlet.documentlibrary.service.DLFileEntryLocalServiceUtil; */ public class ReportTaskManagerServiceImpl extends ReportTaskManagerServiceBaseImpl { - private final static Log _log = LogFactoryUtil.getLog(ReportTaskManagerServiceImpl.class); + private static final Log _log = LogFactoryUtil.getLog(ReportTaskManagerServiceImpl.class); @Override public long[] doReport(long companyId, long userId, Map taskContextMap, Object dataSource) diff --git a/liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/service.properties b/liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/service.properties index 50edeb59..d91f8d93 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/service.properties +++ b/liferay-plugins-sdk-6.2/portlets/portos-report-portlet/docroot/WEB-INF/src/service.properties @@ -13,8 +13,8 @@ ## build.namespace=portos_rep - build.number=33 - build.date=1630406182776 + build.number=34 + build.date=1631888828391 build.auto.upgrade=true ## diff --git a/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/modellistener/shared/core/ModelListenerInvocationHandler.java b/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/modellistener/shared/core/ModelListenerInvocationHandler.java index c6a58719..c82bdeb5 100644 --- a/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/modellistener/shared/core/ModelListenerInvocationHandler.java +++ b/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/modellistener/shared/core/ModelListenerInvocationHandler.java @@ -136,6 +136,6 @@ public class ModelListenerInvocationHandler implements InvocationHandler { return false; } - private final static String[] MODEL_METHOD_NAMES = { "onAfterCreate", "onAfterRemove", "onAfterUpdate", + private static final String[] MODEL_METHOD_NAMES = { "onAfterCreate", "onAfterRemove", "onAfterUpdate", "onBeforeCreate", "onBeforeRemove", "onBeforeUpdate" }; } diff --git a/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/modellistener/shared/core/ModelListenerPool.java b/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/modellistener/shared/core/ModelListenerPool.java index 8e1e316a..7f0430ae 100644 --- a/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/modellistener/shared/core/ModelListenerPool.java +++ b/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/modellistener/shared/core/ModelListenerPool.java @@ -14,35 +14,34 @@ public class ModelListenerPool { protected static void register(String servletContextName, String modelClassName, ModelListener> modelListener) { - _servletContextNameMap.put(modelClassName, servletContextName); - if (!_modelListenersMap.containsKey(modelClassName)) { - _modelListenersMap.put(modelClassName, new ArrayList>>()); + SERVLET_CONTEXT_NAME_MAP.put(modelClassName, servletContextName); + if (!MODEL_LISTENERS_MAP.containsKey(modelClassName)) { + MODEL_LISTENERS_MAP.put(modelClassName, new ArrayList>>()); } - _modelListenersMap.get(modelClassName).add(modelListener); + MODEL_LISTENERS_MAP.get(modelClassName).add(modelListener); } protected static void unregister(String modelClassName) { - _servletContextNameMap.remove(modelClassName); - _modelListenersMap.remove(modelClassName); + SERVLET_CONTEXT_NAME_MAP.remove(modelClassName); + MODEL_LISTENERS_MAP.remove(modelClassName); } protected static Set getModelClassNames() { - return _modelListenersMap.keySet(); + return MODEL_LISTENERS_MAP.keySet(); } protected static List>> getModelListeners(String modelClassName) { - return _modelListenersMap.get(modelClassName); + return MODEL_LISTENERS_MAP.get(modelClassName); } protected static String getServletContextName(String modelClassName) { - return _servletContextNameMap.get(modelClassName); + return SERVLET_CONTEXT_NAME_MAP.get(modelClassName); } - private final static Map>>> _modelListenersMap = new ConcurrentHashMap>>>(); - - private final static Map _servletContextNameMap = new ConcurrentHashMap(); + private static final Map>>> MODEL_LISTENERS_MAP = new ConcurrentHashMap>>>(); + private static final Map SERVLET_CONTEXT_NAME_MAP = new ConcurrentHashMap(); } diff --git a/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/modellistener/shared/core/ModelListenerUtil.java b/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/modellistener/shared/core/ModelListenerUtil.java index c7fe8fd2..b03919e9 100644 --- a/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/modellistener/shared/core/ModelListenerUtil.java +++ b/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/modellistener/shared/core/ModelListenerUtil.java @@ -73,5 +73,5 @@ public class ModelListenerUtil { return (BasePersistence) PortletBeanLocatorUtil.locate(servletContextName, beanName); } - private final static Log _log = LogFactoryUtil.getLog(ModelListenerUtil.class); + private static final Log _log = LogFactoryUtil.getLog(ModelListenerUtil.class); } diff --git a/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/PagamentoConstants.java b/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/PagamentoConstants.java index 617dfa8e..cc5fb3c0 100644 --- a/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/PagamentoConstants.java +++ b/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/PagamentoConstants.java @@ -9,17 +9,17 @@ public class PagamentoConstants { public static final String PAGAMENTO_BOLLI = "02"; public static final String PAGAMENTO_ONERI_BOLLI = "03"; - public final static String MEZZO_ZERO = "00"; - public final static String MEZZO_MANUALE = "01"; - - public final static String UTILIZZATA_NO = "01"; // Da Portos 1 - serve solo per import - public final static String UTILIZZATA_SI = "02"; // Da Portos 1 - serve solo per import - public final static String UTILIZZATA_IN_CORSO = "03"; - public final static String UTILIZZATA_PAGATA = "04"; - public final static String UTILIZZATA_RIFIUTATA = "05"; - public final static String UTILIZZATA_NON_PAGABILE = "06"; - public final static String UTILIZZATA_SOSTITUITA = "07"; - public final static String UTILIZZATA_ANNULLATO = "08"; + public static final String MEZZO_ZERO = "00"; + public static final String MEZZO_MANUALE = "01"; + + public static final String UTILIZZATA_NO = "01"; // Da Portos 1 - serve solo per import + public static final String UTILIZZATA_SI = "02"; // Da Portos 1 - serve solo per import + public static final String UTILIZZATA_IN_CORSO = "03"; + public static final String UTILIZZATA_PAGATA = "04"; + public static final String UTILIZZATA_RIFIUTATA = "05"; + public static final String UTILIZZATA_NON_PAGABILE = "06"; + public static final String UTILIZZATA_SOSTITUITA = "07"; + public static final String UTILIZZATA_ANNULLATO = "08"; @SuppressWarnings("serial") private static Map mezzoToLabel = new HashMap() { diff --git a/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/PortletKeys.java b/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/PortletKeys.java index e75104ce..5f44fd49 100644 --- a/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/PortletKeys.java +++ b/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/PortletKeys.java @@ -10,9 +10,9 @@ public class PortletKeys extends com.liferay.portal.util.PortletKeys { public static final String CARICHI_LAVORO = "9_WAR_portosboportlet"; public static final String TEMPISTICHE = "10_WAR_portosboportlet"; public static final String PAGAMENTI_PENDING = "12_WAR_portosboportlet"; - public final static String FASCICOLOFE = "1_WAR_portosfeportlet"; - public final static String SOGGETTI = "3_WAR_portosfeportlet"; - public final static String ALLEGATI = "4_WAR_portosfeportlet"; - public final static String COMUNICAZIONI = "1_WAR_portoscomunicazioniportlet"; - public final static String MAPIT = "5_WAR_trefmapitmapportlet"; + public static final String FASCICOLOFE = "1_WAR_portosfeportlet"; + public static final String SOGGETTI = "3_WAR_portosfeportlet"; + public static final String ALLEGATI = "4_WAR_portosfeportlet"; + public static final String COMUNICAZIONI = "1_WAR_portoscomunicazioniportlet"; + public static final String MAPIT = "5_WAR_trefmapitmapportlet"; } diff --git a/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/SezioniUtil.java b/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/SezioniUtil.java index 1bfbfdf3..d4f68b5c 100644 --- a/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/SezioniUtil.java +++ b/liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/SezioniUtil.java @@ -2,9 +2,9 @@ package it.tref.liferay.portos.bo.shared.util; public class SezioniUtil { - public final static String SEZIONE_DETTAGLI_PRINCIPALI = "01"; - public final static String SEZIONE_ANAGRAFE_SOGGETTI = "02"; - public final static String SEZIONE_DESCRIZIONE_EDIFICIO = "03"; - public final static String SEZIONE_GEOLOGICA = "04"; - public final static String SEZIONE_ALLEGATI = "05"; + public static final String SEZIONE_DETTAGLI_PRINCIPALI = "01"; + public static final String SEZIONE_ANAGRAFE_SOGGETTI = "02"; + public static final String SEZIONE_DESCRIZIONE_EDIFICIO = "03"; + public static final String SEZIONE_GEOLOGICA = "04"; + public static final String SEZIONE_ALLEGATI = "05"; } 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 bcd65194..5dc59121 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 @@ -45,7 +45,7 @@ public class StatoPraticaConstants { public static final String INVIO_AVVISO_MANUALE = "MA"; @SuppressWarnings("serial") - private static final Map statusLabel = new HashMap() { + private static final Map STATUS_LABEL = new HashMap() { { put(ANNULLATA, "label.admingeniocivile.statopratica.annullata"); put(CAMBIO_ISTRUTTORE, "label.admingeniocivile.statopratica.cambiIstruttore"); @@ -73,7 +73,7 @@ public class StatoPraticaConstants { }; @SuppressWarnings("serial") - private final static Map esitoAutorizzazione = new HashMap() { + private static final Map ESITO_AUTORIZZAZIONE = new HashMap() { { put(ANNULLATA, getLabel(ANNULLATA)); put(AUTORIZZATA, getLabel(AUTORIZZATA)); @@ -85,34 +85,34 @@ public class StatoPraticaConstants { } }; - private final static Map esitoDeposito; + private static final Map ESITO_DEPOSITO; static { - esitoDeposito = new HashMap<>(); - esitoDeposito.putAll(esitoAutorizzazione); - esitoAutorizzazione.put(CONFORME, getLabel(AUTORIZZATA)); - esitoAutorizzazione.put(NON_CONFORME, getLabel(NON_AUTORIZZATA)); - esitoDeposito.put(CONFORME, getLabel(CONFORME)); - esitoDeposito.put(NON_CONFORME, getLabel(NON_CONFORME)); + ESITO_DEPOSITO = new HashMap<>(); + ESITO_DEPOSITO.putAll(ESITO_AUTORIZZAZIONE); + ESITO_AUTORIZZAZIONE.put(CONFORME, getLabel(AUTORIZZATA)); + ESITO_AUTORIZZAZIONE.put(NON_CONFORME, getLabel(NON_AUTORIZZATA)); + ESITO_DEPOSITO.put(CONFORME, getLabel(CONFORME)); + ESITO_DEPOSITO.put(NON_CONFORME, getLabel(NON_CONFORME)); } public static String getStatusLabel(String statoPratica) { - return statusLabel.get(statoPratica); + return STATUS_LABEL.get(statoPratica); } public static String getEsitoAutorizzazione(String esito) { - if (esitoAutorizzazione.containsKey(esito)) { - return esitoAutorizzazione.get(esito); + if (ESITO_AUTORIZZAZIONE.containsKey(esito)) { + return ESITO_AUTORIZZAZIONE.get(esito); } return StringPool.BLANK; } public static String getEsitoDeposito(String esito) { - if (esitoDeposito.containsKey(esito)) { - return esitoDeposito.get(esito); + if (ESITO_DEPOSITO.containsKey(esito)) { + return ESITO_DEPOSITO.get(esito); } return StringPool.BLANK; } diff --git a/liferay-plugins-sdk-6.2/shared/portos-kaleo-shared/src/it/tref/liferay/portos/kaleo/shared/util/PortletKeys.java b/liferay-plugins-sdk-6.2/shared/portos-kaleo-shared/src/it/tref/liferay/portos/kaleo/shared/util/PortletKeys.java index 1ee44577..bde4792a 100644 --- a/liferay-plugins-sdk-6.2/shared/portos-kaleo-shared/src/it/tref/liferay/portos/kaleo/shared/util/PortletKeys.java +++ b/liferay-plugins-sdk-6.2/shared/portos-kaleo-shared/src/it/tref/liferay/portos/kaleo/shared/util/PortletKeys.java @@ -2,5 +2,5 @@ package it.tref.liferay.portos.kaleo.shared.util; public class PortletKeys extends com.liferay.portal.util.PortletKeys { - public final static String WORKFLOW_FORM_ADMIN = "1_WAR_portoskaleoportlet"; -} \ No newline at end of file + public static final String WORKFLOW_FORM_ADMIN = "1_WAR_portoskaleoportlet"; +} 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 e53992dc..7ee67bfa 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 @@ -29,7 +29,7 @@ import com.liferay.portal.service.ServiceContext; public class MailManagerUtil { - private final static Log _log = LogFactoryUtil.getLog(MailManagerUtil.class); + private static final Log _log = LogFactoryUtil.getLog(MailManagerUtil.class); public static boolean sendMail(String messageId, String inReplyTo, String from, String[] to, String[] cc, String[] bcc, String subject, String body, boolean htmlFormat, boolean async, boolean checkPermission, diff --git a/liferay-plugins-sdk-6.2/shared/portos-report-shared/src/it/tref/liferay/portos/report/shared/constants/ReportConstants.java b/liferay-plugins-sdk-6.2/shared/portos-report-shared/src/it/tref/liferay/portos/report/shared/constants/ReportConstants.java index f2727c4e..957cd6bc 100644 --- a/liferay-plugins-sdk-6.2/shared/portos-report-shared/src/it/tref/liferay/portos/report/shared/constants/ReportConstants.java +++ b/liferay-plugins-sdk-6.2/shared/portos-report-shared/src/it/tref/liferay/portos/report/shared/constants/ReportConstants.java @@ -14,26 +14,26 @@ public class ReportConstants { HTML_TO_PDF, JRXML_TO_PDF, VELOCITY_TO_PDF, ODT_TO_PDF } - public final static String COMPANY_ID = "companyId"; - public final static String USER_ID = "userId"; - public final static String PARAMATERS = "paramaters"; + public static final String COMPANY_ID = "companyId"; + public static final String USER_ID = "userId"; + public static final String PARAMATERS = "paramaters"; - public final static String PARAM_REPORTS = "reports"; - public final static String PARAM_PROCESS_MODE = "processMode"; - public final static String PARAM_RESPONSE_DESTINATION_NAME = "responseDestinationName"; + public static final String PARAM_REPORTS = "reports"; + public static final String PARAM_PROCESS_MODE = "processMode"; + public static final String PARAM_RESPONSE_DESTINATION_NAME = "responseDestinationName"; - public final static String SERVICE_CONTEXT = "serviceContext"; - public final static String FILE_ENTRY_ID_TEMPLATE = "fileEntryIdTemplate"; - public final static String REPORT_PARAMETERS = "reportParameters"; - public final static String REPORT_DATASOURCE = "reportDataSource"; - public final static String REPORT_NAME = "reportName"; - public final static String FOLDER_ID_REPORT = "folderIdReport"; + public static final String SERVICE_CONTEXT = "serviceContext"; + public static final String FILE_ENTRY_ID_TEMPLATE = "fileEntryIdTemplate"; + public static final String REPORT_PARAMETERS = "reportParameters"; + public static final String REPORT_DATASOURCE = "reportDataSource"; + public static final String REPORT_NAME = "reportName"; + public static final String FOLDER_ID_REPORT = "folderIdReport"; /* * Genio Civile */ - public final static String LOGO_REGIONE = "LOGO_REGIONE"; - public final static String LOGO_DIPARTIMENTO = "LOGO_DIPARTIMENTO"; - public final static String PATH_LOGO_REGIONE = "/resource/report/LOGO_REGIONE.png"; - public final static String PATH_LOGO_DIPARTIMENTO = "/resource/report/LOGO_DIPARTIMENTO.png"; + public static final String LOGO_REGIONE = "LOGO_REGIONE"; + public static final String LOGO_DIPARTIMENTO = "LOGO_DIPARTIMENTO"; + public static final String PATH_LOGO_REGIONE = "/resource/report/LOGO_REGIONE.png"; + public static final String PATH_LOGO_DIPARTIMENTO = "/resource/report/LOGO_DIPARTIMENTO.png"; } diff --git a/liferay-plugins-sdk-6.2/shared/portos-report-shared/src/it/tref/liferay/portos/report/shared/constants/ReportDestinationNames.java b/liferay-plugins-sdk-6.2/shared/portos-report-shared/src/it/tref/liferay/portos/report/shared/constants/ReportDestinationNames.java index 2df35ab8..3aa3ad63 100644 --- a/liferay-plugins-sdk-6.2/shared/portos-report-shared/src/it/tref/liferay/portos/report/shared/constants/ReportDestinationNames.java +++ b/liferay-plugins-sdk-6.2/shared/portos-report-shared/src/it/tref/liferay/portos/report/shared/constants/ReportDestinationNames.java @@ -2,7 +2,7 @@ package it.tref.liferay.portos.report.shared.constants; public class ReportDestinationNames { - public final static String SERIAL = "liferay/tref/portos/report_serial"; - public final static String SYNC = "liferay/tref/portos/report_sync"; - public final static String SYNC_PROTOCOLLO = "liferay/tref/portos/protocollo_sync"; + public static final String SERIAL = "liferay/tref/portos/report_serial"; + public static final String SYNC = "liferay/tref/portos/report_sync"; + public static final String SYNC_PROTOCOLLO = "liferay/tref/portos/protocollo_sync"; } diff --git a/liferay-plugins-sdk-6.2/shared/portos-report-shared/src/it/tref/liferay/portos/report/shared/util/PdfUtil.java b/liferay-plugins-sdk-6.2/shared/portos-report-shared/src/it/tref/liferay/portos/report/shared/util/PdfUtil.java index 7680eea0..15900223 100644 --- a/liferay-plugins-sdk-6.2/shared/portos-report-shared/src/it/tref/liferay/portos/report/shared/util/PdfUtil.java +++ b/liferay-plugins-sdk-6.2/shared/portos-report-shared/src/it/tref/liferay/portos/report/shared/util/PdfUtil.java @@ -1,5 +1,13 @@ package it.tref.liferay.portos.report.shared.util; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; + import com.itextpdf.text.Document; import com.itextpdf.text.DocumentException; import com.itextpdf.text.Element; @@ -20,17 +28,9 @@ import com.liferay.portal.kernel.log.Log; import com.liferay.portal.kernel.log.LogFactoryUtil; import com.liferay.portal.kernel.util.Validator; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; - public class PdfUtil { - private final static Log _log = LogFactoryUtil.getLog(PdfUtil.class); + private static final Log _log = LogFactoryUtil.getLog(PdfUtil.class); public static byte[] merge(InputStream pdf1, InputStream pdf2) { @@ -77,8 +77,7 @@ public class PdfUtil { } iteratorPDFReader = readers.iterator(); // Loop through the PDF files and add to the output. - while (iteratorPDFReader.hasNext()) { - } + while (iteratorPDFReader.hasNext()) {} outputStream.flush(); document.close(); @@ -131,9 +130,9 @@ public class PdfUtil { if (showNumberOfPage) { // add page numbers - ColumnText.showTextAligned(stamp.getUnderContent(), Element.ALIGN_CENTER, new Phrase( - String.format("%d / %d", curentPageNumber, totalPage)), pdfImportedPage - .getHeight() / 2, 20, 0); + ColumnText.showTextAligned(stamp.getUnderContent(), Element.ALIGN_CENTER, + new Phrase(String.format("%d / %d", curentPageNumber, totalPage)), + pdfImportedPage.getHeight() / 2, 20, 0); } stamp.alterContents(); diff --git a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/.classpath b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/.classpath index 2f1b9a21..491f947b 100644 --- a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/.classpath +++ b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/.classpath @@ -1,6 +1,7 @@ + @@ -12,18 +13,11 @@ - - - - - - - diff --git a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/.settings/org.eclipse.wst.common.component b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/.settings/org.eclipse.wst.common.component index 6c0f797a..cfa57ce4 100644 --- a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/.settings/org.eclipse.wst.common.component +++ b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/.settings/org.eclipse.wst.common.component @@ -2,9 +2,13 @@ + uses + + uses + diff --git a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/lib/portos-kaleo-portlet-service.jar b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/lib/portos-kaleo-portlet-service.jar index 36c9b920..21159b20 100644 Binary files a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/lib/portos-kaleo-portlet-service.jar and b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/lib/portos-kaleo-portlet-service.jar differ diff --git a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/liferay-plugin-package.properties b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/liferay-plugin-package.properties index 0ec58156..68fef372 100644 --- a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/liferay-plugin-package.properties +++ b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/liferay-plugin-package.properties @@ -8,12 +8,13 @@ page-url=http://www.liferay.com author=Liferay, Inc. licenses=LGPL portal-dependency-jars=\ + commons-codec.jar,\ commons-collections.jar,\ + commons-lang.jar,\ jabsorb.jar,\ json-java.jar,\ slf4j-api.jar,\ - util-slf4j.jar,\ - commons-codec.jar + util-slf4j.jar required-deployment-contexts=\ portos-kaleo-portlet,\ portos-bo-portlet diff --git a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/WorkflowTaskManagerImpl.java b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/WorkflowTaskManagerImpl.java index c0ab5dea..d8a003e4 100644 --- a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/WorkflowTaskManagerImpl.java +++ b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/WorkflowTaskManagerImpl.java @@ -1,13 +1,9 @@ /** - * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General - * Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. + * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. This library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software + * Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in + * the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. */ package com.liferay.portal.workflow.kaleo; diff --git a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/DefaultTaskManagerImpl.java b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/DefaultTaskManagerImpl.java index 1d6221fd..a2cf8a52 100644 --- a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/DefaultTaskManagerImpl.java +++ b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/DefaultTaskManagerImpl.java @@ -1,19 +1,18 @@ /** - * Copyright (c) 2000-present Liferay, Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. + * Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software + * Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in + * the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. */ package com.liferay.portal.workflow.kaleo.runtime; +import java.io.Serializable; +import java.util.Date; +import java.util.List; +import java.util.Map; + import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.kernel.transaction.Isolation; @@ -38,176 +37,126 @@ import com.liferay.portal.workflow.kaleo.runtime.notification.NotificationUtil; import com.liferay.portal.workflow.kaleo.util.WorkflowContextUtil; import com.liferay.portal.workflow.kaleo.util.WorkflowModelUtil; -import java.io.Serializable; - -import java.util.Date; -import java.util.List; -import java.util.Map; - /** * @author Michael C. Han */ -@Transactional( - isolation = Isolation.PORTAL, propagation = Propagation.REQUIRED, - rollbackFor = {Exception.class}) -public class DefaultTaskManagerImpl - extends BaseKaleoBean implements TaskManager { +@Transactional(isolation = Isolation.PORTAL, propagation = Propagation.REQUIRED, rollbackFor = { Exception.class }) +public class DefaultTaskManagerImpl extends BaseKaleoBean implements TaskManager { - - public WorkflowTask assignWorkflowTaskToRole( - long workflowTaskInstanceId, long roleId, String comment, - Date dueDate, Map workflowContext, - ServiceContext serviceContext) - throws WorkflowException { + @Override + public WorkflowTask assignWorkflowTaskToRole(long workflowTaskInstanceId, long roleId, String comment, + Date dueDate, Map workflowContext, ServiceContext serviceContext) + throws WorkflowException { try { - return assignWorkflowTask( - workflowTaskInstanceId, Role.class.getName(), roleId, comment, - dueDate, workflowContext, serviceContext); - } - catch (Exception e) { + return assignWorkflowTask(workflowTaskInstanceId, Role.class.getName(), roleId, comment, dueDate, + workflowContext, serviceContext); + } catch (Exception e) { throw new WorkflowException(e); } } - - public WorkflowTask assignWorkflowTaskToUser( - long workflowTaskInstanceId, long assigneeUserId, String comment, - Date dueDate, Map workflowContext, - ServiceContext serviceContext) - throws WorkflowException { + @Override + public WorkflowTask assignWorkflowTaskToUser(long workflowTaskInstanceId, long assigneeUserId, String comment, + Date dueDate, Map workflowContext, ServiceContext serviceContext) + throws WorkflowException { try { - return assignWorkflowTask( - workflowTaskInstanceId, User.class.getName(), assigneeUserId, - comment, dueDate, workflowContext, serviceContext); - } - catch (Exception e) { + return assignWorkflowTask(workflowTaskInstanceId, User.class.getName(), assigneeUserId, comment, dueDate, + workflowContext, serviceContext); + } catch (Exception e) { throw new WorkflowException(e); } } - - public WorkflowTask completeWorkflowTask( - long workflowTaskInstanceId, String transitionName, String comment, - Map workflowContext, - ServiceContext serviceContext) - throws WorkflowException { + @Override + public WorkflowTask completeWorkflowTask(long workflowTaskInstanceId, String transitionName, String comment, + Map workflowContext, ServiceContext serviceContext) throws WorkflowException { try { - return doCompleteWorkflowTask( - workflowTaskInstanceId, transitionName, comment, - workflowContext, serviceContext); - } - catch (Exception e) { + return doCompleteWorkflowTask(workflowTaskInstanceId, transitionName, comment, workflowContext, + serviceContext); + } catch (Exception e) { throw new WorkflowException(e); } } - - public WorkflowTask updateDueDate( - long workflowTaskInstanceId, String comment, Date dueDate, - ServiceContext serviceContext) - throws WorkflowException { + @Override + public WorkflowTask updateDueDate(long workflowTaskInstanceId, String comment, Date dueDate, + ServiceContext serviceContext) throws WorkflowException { try { - KaleoTaskInstanceToken kaleoTaskInstanceToken = - kaleoTaskInstanceTokenLocalService.getKaleoTaskInstanceToken( - workflowTaskInstanceId); + KaleoTaskInstanceToken kaleoTaskInstanceToken = kaleoTaskInstanceTokenLocalService + .getKaleoTaskInstanceToken(workflowTaskInstanceId); if (kaleoTaskInstanceToken.isCompleted()) { - throw new WorkflowException( - "Cannot update due date for completed task " + - workflowTaskInstanceId); + throw new WorkflowException("Cannot update due date for completed task " + workflowTaskInstanceId); } if (dueDate != null) { - kaleoTaskInstanceTokenLocalService.updateDueDate( - workflowTaskInstanceId, dueDate, serviceContext); + kaleoTaskInstanceTokenLocalService.updateDueDate(workflowTaskInstanceId, dueDate, serviceContext); } - Map workflowContext = - WorkflowContextUtil.convert( - kaleoTaskInstanceToken.getWorkflowContext()); + Map workflowContext = WorkflowContextUtil.convert(kaleoTaskInstanceToken + .getWorkflowContext()); - kaleoLogLocalService.addTaskUpdateKaleoLog( - kaleoTaskInstanceToken, comment, workflowContext, - serviceContext); + kaleoLogLocalService + .addTaskUpdateKaleoLog(kaleoTaskInstanceToken, comment, workflowContext, serviceContext); - return WorkflowModelUtil.toWorkflowTask( - kaleoTaskInstanceToken, workflowContext); - } - catch (Exception e) { + return WorkflowModelUtil.toWorkflowTask(kaleoTaskInstanceToken, workflowContext); + } catch (Exception e) { throw new WorkflowException(e); } } - protected WorkflowTask assignWorkflowTask( - long workflowTaskInstanceId, String assigneeClassName, - long assigneeClassPK, String comment, Date dueDate, - Map workflowContext, - ServiceContext serviceContext) - throws Exception { + protected WorkflowTask assignWorkflowTask(long workflowTaskInstanceId, String assigneeClassName, + long assigneeClassPK, String comment, Date dueDate, Map workflowContext, + ServiceContext serviceContext) throws Exception { - KaleoTaskInstanceToken kaleoTaskInstanceToken = - kaleoTaskInstanceTokenLocalService.getKaleoTaskInstanceToken( - workflowTaskInstanceId); + KaleoTaskInstanceToken kaleoTaskInstanceToken = kaleoTaskInstanceTokenLocalService + .getKaleoTaskInstanceToken(workflowTaskInstanceId); - List previousTaskAssignmentInstances = - kaleoTaskInstanceToken.getKaleoTaskAssignmentInstances(); + List previousTaskAssignmentInstances = kaleoTaskInstanceToken + .getKaleoTaskAssignmentInstances(); - workflowContext = updateWorkflowContext( - workflowContext, kaleoTaskInstanceToken); + workflowContext = updateWorkflowContext(workflowContext, kaleoTaskInstanceToken); if (kaleoTaskInstanceToken.isCompleted()) { - throw new WorkflowException( - "Cannot reassign a completed task " + workflowTaskInstanceId); + throw new WorkflowException("Cannot reassign a completed task " + workflowTaskInstanceId); } if (dueDate != null) { - kaleoTaskInstanceTokenLocalService.updateDueDate( - workflowTaskInstanceId, dueDate, serviceContext); + kaleoTaskInstanceTokenLocalService.updateDueDate(workflowTaskInstanceId, dueDate, serviceContext); } - kaleoTaskInstanceToken = - kaleoTaskInstanceTokenLocalService.assignKaleoTaskInstanceToken( - kaleoTaskInstanceToken.getKaleoTaskInstanceTokenId(), - assigneeClassName, assigneeClassPK, workflowContext, - serviceContext); + kaleoTaskInstanceToken = kaleoTaskInstanceTokenLocalService.assignKaleoTaskInstanceToken( + kaleoTaskInstanceToken.getKaleoTaskInstanceTokenId(), assigneeClassName, assigneeClassPK, + workflowContext, serviceContext); workflowContext.put(WorkflowConstants.CONTEXT_TASK_COMMENTS, comment); - ExecutionContext executionContext = new ExecutionContext( - kaleoTaskInstanceToken.getKaleoInstanceToken(), - kaleoTaskInstanceToken, workflowContext, serviceContext); + ExecutionContext executionContext = new ExecutionContext(kaleoTaskInstanceToken.getKaleoInstanceToken(), + kaleoTaskInstanceToken, workflowContext, serviceContext); KaleoTask kaleoTask = kaleoTaskInstanceToken.getKaleoTask(); - ActionExecutorUtil.executeKaleoActions( - KaleoNode.class.getName(), kaleoTask.getKaleoNodeId(), - ExecutionType.ON_ASSIGNMENT, executionContext); + ActionExecutorUtil.executeKaleoActions(KaleoNode.class.getName(), kaleoTask.getKaleoNodeId(), + ExecutionType.ON_ASSIGNMENT, executionContext); - NotificationUtil.sendKaleoNotifications( - KaleoNode.class.getName(), kaleoTask.getKaleoNodeId(), - ExecutionType.ON_ASSIGNMENT, executionContext); + NotificationUtil.sendKaleoNotifications(KaleoNode.class.getName(), kaleoTask.getKaleoNodeId(), + ExecutionType.ON_ASSIGNMENT, executionContext); - kaleoLogLocalService.addTaskAssignmentKaleoLog( - previousTaskAssignmentInstances, kaleoTaskInstanceToken, comment, - workflowContext, serviceContext); + kaleoLogLocalService.addTaskAssignmentKaleoLog(previousTaskAssignmentInstances, kaleoTaskInstanceToken, + comment, workflowContext, serviceContext); - return WorkflowModelUtil.toWorkflowTask( - kaleoTaskInstanceToken, workflowContext); + return WorkflowModelUtil.toWorkflowTask(kaleoTaskInstanceToken, workflowContext); } - protected WorkflowTask doCompleteWorkflowTask( - long workflowTaskInstanceId, String transitionName, String comment, - Map workflowContext, - ServiceContext serviceContext) - throws Exception { + protected WorkflowTask doCompleteWorkflowTask(long workflowTaskInstanceId, String transitionName, String comment, + Map workflowContext, ServiceContext serviceContext) throws Exception { - KaleoTaskInstanceToken kaleoTaskInstanceToken = - kaleoTaskInstanceTokenLocalService.getKaleoTaskInstanceToken( - workflowTaskInstanceId); + KaleoTaskInstanceToken kaleoTaskInstanceToken = kaleoTaskInstanceTokenLocalService + .getKaleoTaskInstanceToken(workflowTaskInstanceId); if (Validator.isNotNull(transitionName)) { @@ -221,49 +170,37 @@ public class DefaultTaskManagerImpl currentKaleoNode.getKaleoTransition(transitionName); } - workflowContext = updateWorkflowContext( - workflowContext, kaleoTaskInstanceToken); + workflowContext = updateWorkflowContext(workflowContext, kaleoTaskInstanceToken); if (kaleoTaskInstanceToken.isCompleted()) { - throw new WorkflowException( - "Cannot complete an already completed task " + - workflowTaskInstanceId + " for user " + - serviceContext.getUserId()); + throw new WorkflowException("Cannot complete an already completed task " + workflowTaskInstanceId + + " for user " + serviceContext.getUserId()); } serviceContext.setScopeGroupId(kaleoTaskInstanceToken.getGroupId()); - kaleoTaskInstanceToken = - kaleoTaskInstanceTokenLocalService.completeKaleoTaskInstanceToken( - kaleoTaskInstanceToken.getKaleoTaskInstanceTokenId(), - serviceContext); + kaleoTaskInstanceToken = kaleoTaskInstanceTokenLocalService.completeKaleoTaskInstanceToken( + kaleoTaskInstanceToken.getKaleoTaskInstanceTokenId(), serviceContext); - kaleoLogLocalService.addTaskCompletionKaleoLog( - kaleoTaskInstanceToken, comment, workflowContext, serviceContext); + kaleoLogLocalService + .addTaskCompletionKaleoLog(kaleoTaskInstanceToken, comment, workflowContext, serviceContext); - return WorkflowModelUtil.toWorkflowTask( - kaleoTaskInstanceToken, workflowContext); + return WorkflowModelUtil.toWorkflowTask(kaleoTaskInstanceToken, workflowContext); } - protected Map updateWorkflowContext( - Map workflowContext, - KaleoTaskInstanceToken kaleoTaskInstanceToken) - throws PortalException, SystemException { + protected Map updateWorkflowContext(Map workflowContext, + KaleoTaskInstanceToken kaleoTaskInstanceToken) throws PortalException, SystemException { - KaleoInstance kaleoInstance = - kaleoInstanceLocalService.getKaleoInstance( - kaleoTaskInstanceToken.getKaleoInstanceId()); + KaleoInstance kaleoInstance = kaleoInstanceLocalService.getKaleoInstance(kaleoTaskInstanceToken + .getKaleoInstanceId()); if (workflowContext == null) { - workflowContext = WorkflowContextUtil.convert( - kaleoInstance.getWorkflowContext()); - } - else { - Map storedWorkflowContext = - WorkflowContextUtil.convert(kaleoInstance.getWorkflowContext()); + workflowContext = WorkflowContextUtil.convert(kaleoInstance.getWorkflowContext()); + } else { + Map storedWorkflowContext = WorkflowContextUtil.convert(kaleoInstance + .getWorkflowContext()); - for (Map.Entry entry : - storedWorkflowContext.entrySet()) { + for (Map.Entry entry : storedWorkflowContext.entrySet()) { String key = entry.getKey(); @@ -276,4 +213,4 @@ public class DefaultTaskManagerImpl return workflowContext; } -} \ No newline at end of file +} diff --git a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/ConditionNodeExecutor.java b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/ConditionNodeExecutor.java index 4dfa3280..fbe1315c 100644 --- a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/ConditionNodeExecutor.java +++ b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/ConditionNodeExecutor.java @@ -1,19 +1,15 @@ /** - * Copyright (c) 2000-present Liferay, Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. + * Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software + * Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in + * the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. */ package com.liferay.portal.workflow.kaleo.runtime.node; +import java.util.List; + import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.kernel.util.StringUtil; @@ -27,8 +23,6 @@ import com.liferay.portal.workflow.kaleo.runtime.condition.ConditionEvaluator; import com.liferay.portal.workflow.kaleo.runtime.graph.PathElement; import com.liferay.portal.workflow.kaleo.runtime.util.ClassLoaderUtil; -import java.util.List; - /** * @author Michael C. Han */ @@ -38,66 +32,39 @@ public class ConditionNodeExecutor extends BaseNodeExecutor { _conditionEvaluator = conditionEvaluator; } - - protected boolean doEnter( - KaleoNode currentKaleoNode, ExecutionContext executionContext) { + @Override + protected boolean doEnter(KaleoNode currentKaleoNode, ExecutionContext executionContext) { return true; } + @Override + protected void doExecute(KaleoNode currentKaleoNode, ExecutionContext executionContext, + List remainingPathElements) throws PortalException, SystemException { - protected void doExecute( - KaleoNode currentKaleoNode, ExecutionContext executionContext, - List remainingPathElements) - throws PortalException, SystemException { - - KaleoInstanceToken kaleoInstanceToken = - executionContext.getKaleoInstanceToken(); - + KaleoInstanceToken kaleoInstanceToken = executionContext.getKaleoInstanceToken(); KaleoCondition kaleoCondition = - kaleoConditionLocalService.getKaleoNodeKaleoCondition( - currentKaleoNode.getKaleoNodeId()); - - String[] scriptRequiredContexts = StringUtil.split( - kaleoCondition.getScriptRequiredContexts()); - - ClassLoader[] classloaders = ClassLoaderUtil.getClassLoaders( - scriptRequiredContexts); - - String transitionName = _conditionEvaluator.evaluate( - kaleoCondition, executionContext, classloaders); - - kaleoInstanceLocalService.updateKaleoInstance( - kaleoInstanceToken.getKaleoInstanceId(), - executionContext.getWorkflowContext(), - executionContext.getServiceContext()); - - KaleoTransition kaleoTransition = currentKaleoNode.getKaleoTransition( - transitionName); - - ExecutionContext newExecutionContext = new ExecutionContext( - kaleoInstanceToken, executionContext.getWorkflowContext(), - executionContext.getServiceContext()); - - PathElement pathElement = new PathElement( - currentKaleoNode, kaleoTransition.getTargetKaleoNode(), - newExecutionContext); - + kaleoConditionLocalService.getKaleoNodeKaleoCondition(currentKaleoNode.getKaleoNodeId()); + String[] scriptRequiredContexts = StringUtil.split(kaleoCondition.getScriptRequiredContexts()); + ClassLoader[] classloaders = ClassLoaderUtil.getClassLoaders(scriptRequiredContexts); + String transitionName = _conditionEvaluator.evaluate(kaleoCondition, executionContext, classloaders); + kaleoInstanceLocalService.updateKaleoInstance(kaleoInstanceToken.getKaleoInstanceId(), + executionContext.getWorkflowContext(), executionContext.getServiceContext()); + KaleoTransition kaleoTransition = currentKaleoNode.getKaleoTransition(transitionName); + ExecutionContext newExecutionContext = + new ExecutionContext(kaleoInstanceToken, executionContext.getWorkflowContext(), + executionContext.getServiceContext()); + PathElement pathElement = + new PathElement(currentKaleoNode, kaleoTransition.getTargetKaleoNode(), newExecutionContext); remainingPathElements.add(pathElement); } + @Override + protected void doExecuteTimer(KaleoNode currentKaleoNode, KaleoTimer kaleoTimer, ExecutionContext executionContext) {} - protected void doExecuteTimer( - KaleoNode currentKaleoNode, KaleoTimer kaleoTimer, - ExecutionContext executionContext) { - } - - - protected void doExit( - KaleoNode currentKaleoNode, ExecutionContext executionContext, - List remainingPathElements) { - } + @Override + protected void doExit(KaleoNode currentKaleoNode, ExecutionContext executionContext, + List remainingPathElements) {} private ConditionEvaluator _conditionEvaluator; - -} \ No newline at end of file +} diff --git a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/ForkNodeExecutor.java b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/ForkNodeExecutor.java index 576e82fc..d1a52a84 100644 --- a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/ForkNodeExecutor.java +++ b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/ForkNodeExecutor.java @@ -1,19 +1,17 @@ /** - * Copyright (c) 2000-present Liferay, Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. + * Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software + * Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in + * the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. */ package com.liferay.portal.workflow.kaleo.runtime.node; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.workflow.kaleo.model.KaleoInstanceToken; @@ -23,74 +21,46 @@ import com.liferay.portal.workflow.kaleo.model.KaleoTransition; import com.liferay.portal.workflow.kaleo.runtime.ExecutionContext; import com.liferay.portal.workflow.kaleo.runtime.graph.PathElement; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - /** * @author Michael C. Han */ public class ForkNodeExecutor extends BaseNodeExecutor { - - protected boolean doEnter( - KaleoNode currentKaleoNode, ExecutionContext executionContext) { + @Override + protected boolean doEnter(KaleoNode currentKaleoNode, ExecutionContext executionContext) { return true; } + @Override + protected void doExecute(KaleoNode currentKaleoNode, ExecutionContext executionContext, + List remainingPathElements) throws PortalException, SystemException { - protected void doExecute( - KaleoNode currentKaleoNode, ExecutionContext executionContext, - List remainingPathElements) - throws PortalException, SystemException { - - List kaleoTransitions = - currentKaleoNode.getKaleoTransitions(); - - Map childKaleoInstanceTokens = - new HashMap(); - + List kaleoTransitions = currentKaleoNode.getKaleoTransitions(); + Map childKaleoInstanceTokens = new HashMap(); for (KaleoTransition kaleoTransition : kaleoTransitions) { - KaleoInstanceToken parentKaleoInstanceToken = - executionContext.getKaleoInstanceToken(); - + KaleoInstanceToken parentKaleoInstanceToken = executionContext.getKaleoInstanceToken(); KaleoInstanceToken childKaleoInstanceToken = - kaleoInstanceTokenLocalService.addKaleoInstanceToken( - parentKaleoInstanceToken.getKaleoInstanceTokenId(), - executionContext.getWorkflowContext(), - executionContext.getServiceContext()); - - childKaleoInstanceTokens.put( - kaleoTransition.getName(), childKaleoInstanceToken); + kaleoInstanceTokenLocalService.addKaleoInstanceToken( + parentKaleoInstanceToken.getKaleoInstanceTokenId(), executionContext.getWorkflowContext(), + executionContext.getServiceContext()); + childKaleoInstanceTokens.put(kaleoTransition.getName(), childKaleoInstanceToken); } - for (KaleoTransition kaleoTransition : kaleoTransitions) { - KaleoInstanceToken childKaleoInstanceToken = - childKaleoInstanceTokens.get(kaleoTransition.getName()); - - ExecutionContext forkedExecutionContext = new ExecutionContext( - childKaleoInstanceToken, executionContext.getWorkflowContext(), - executionContext.getServiceContext()); - - PathElement pathElement = new PathElement( - currentKaleoNode, kaleoTransition.getTargetKaleoNode(), - forkedExecutionContext); - + KaleoInstanceToken childKaleoInstanceToken = childKaleoInstanceTokens.get(kaleoTransition.getName()); + ExecutionContext forkedExecutionContext = + new ExecutionContext(childKaleoInstanceToken, executionContext.getWorkflowContext(), + executionContext.getServiceContext()); + PathElement pathElement = + new PathElement(currentKaleoNode, kaleoTransition.getTargetKaleoNode(), forkedExecutionContext); remainingPathElements.add(pathElement); } } + @Override + protected void doExecuteTimer(KaleoNode currentKaleoNode, KaleoTimer kaleoTimer, ExecutionContext executionContext) {} - protected void doExecuteTimer( - KaleoNode currentKaleoNode, KaleoTimer kaleoTimer, - ExecutionContext executionContext) { - } - - - protected void doExit( - KaleoNode currentKaleoNode, ExecutionContext executionContext, - List remainingPathElements) { - } - -} \ No newline at end of file + @Override + protected void doExit(KaleoNode currentKaleoNode, ExecutionContext executionContext, + List remainingPathElements) {} +} diff --git a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/JoinNodeExecutor.java b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/JoinNodeExecutor.java index b87cc9dd..64b7a4a8 100644 --- a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/JoinNodeExecutor.java +++ b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/JoinNodeExecutor.java @@ -1,19 +1,15 @@ /** - * Copyright (c) 2000-present Liferay, Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. + * Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software + * Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in + * the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. */ package com.liferay.portal.workflow.kaleo.runtime.node; +import java.util.List; + import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.workflow.kaleo.model.KaleoInstanceToken; @@ -23,74 +19,45 @@ import com.liferay.portal.workflow.kaleo.model.KaleoTransition; import com.liferay.portal.workflow.kaleo.runtime.ExecutionContext; import com.liferay.portal.workflow.kaleo.runtime.graph.PathElement; -import java.util.List; - /** * @author Michael C. Han */ public class JoinNodeExecutor extends BaseNodeExecutor { + @Override + protected boolean doEnter(KaleoNode currentKaleoNode, ExecutionContext executionContext) throws PortalException, + SystemException { - protected boolean doEnter( - KaleoNode currentKaleoNode, ExecutionContext executionContext) - throws PortalException, SystemException { - - KaleoInstanceToken kaleoInstanceToken = - executionContext.getKaleoInstanceToken(); - - kaleoInstanceTokenLocalService.completeKaleoInstanceToken( - kaleoInstanceToken.getKaleoInstanceTokenId()); - + KaleoInstanceToken kaleoInstanceToken = executionContext.getKaleoInstanceToken(); + kaleoInstanceTokenLocalService.completeKaleoInstanceToken(kaleoInstanceToken.getKaleoInstanceTokenId()); return true; } + @Override + protected void doExecute(KaleoNode currentKaleoNode, ExecutionContext executionContext, + List remainingPathElements) throws PortalException, SystemException { - protected void doExecute( - KaleoNode currentKaleoNode, ExecutionContext executionContext, - List remainingPathElements) - throws PortalException, SystemException { - - KaleoInstanceToken kaleoInstanceToken = - executionContext.getKaleoInstanceToken(); - - KaleoInstanceToken parentKaleoInstanceToken = - kaleoInstanceToken.getParentKaleoInstanceToken(); - - if (parentKaleoInstanceToken. - hasIncompleteChildrenKaleoInstanceToken()) { - + KaleoInstanceToken kaleoInstanceToken = executionContext.getKaleoInstanceToken(); + KaleoInstanceToken parentKaleoInstanceToken = kaleoInstanceToken.getParentKaleoInstanceToken(); + if (parentKaleoInstanceToken.hasIncompleteChildrenKaleoInstanceToken()) { return; } - parentKaleoInstanceToken = - kaleoInstanceTokenLocalService.updateKaleoInstanceToken( - parentKaleoInstanceToken.getKaleoInstanceTokenId(), - currentKaleoNode.getKaleoNodeId()); - - KaleoTransition kaleoTransition = - currentKaleoNode.getDefaultKaleoTransition(); - - ExecutionContext newExecutionContext = new ExecutionContext( - parentKaleoInstanceToken, executionContext.getWorkflowContext(), - executionContext.getServiceContext()); - - PathElement pathElement = new PathElement( - currentKaleoNode, kaleoTransition.getTargetKaleoNode(), - newExecutionContext); - + kaleoInstanceTokenLocalService.updateKaleoInstanceToken( + parentKaleoInstanceToken.getKaleoInstanceTokenId(), currentKaleoNode.getKaleoNodeId()); + KaleoTransition kaleoTransition = currentKaleoNode.getDefaultKaleoTransition(); + ExecutionContext newExecutionContext = + new ExecutionContext(parentKaleoInstanceToken, executionContext.getWorkflowContext(), + executionContext.getServiceContext()); + PathElement pathElement = + new PathElement(currentKaleoNode, kaleoTransition.getTargetKaleoNode(), newExecutionContext); remainingPathElements.add(pathElement); } + @Override + protected void doExecuteTimer(KaleoNode currentKaleoNode, KaleoTimer kaleoTimer, ExecutionContext executionContext) {} - protected void doExecuteTimer( - KaleoNode currentKaleoNode, KaleoTimer kaleoTimer, - ExecutionContext executionContext) { - } - - - protected void doExit( - KaleoNode currentKaleoNode, ExecutionContext executionContext, - List remainingPathElements) { - } - -} \ No newline at end of file + @Override + protected void doExit(KaleoNode currentKaleoNode, ExecutionContext executionContext, + List remainingPathElements) {} +} diff --git a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/JoinXorNodeExecutor.java b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/JoinXorNodeExecutor.java index 8bd045b4..23d3adba 100644 --- a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/JoinXorNodeExecutor.java +++ b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/JoinXorNodeExecutor.java @@ -1,19 +1,15 @@ /** - * Copyright (c) 2000-present Liferay, Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. + * Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software + * Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in + * the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. */ package com.liferay.portal.workflow.kaleo.runtime.node; +import java.util.List; + import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.workflow.kaleo.model.KaleoInstanceToken; @@ -23,102 +19,61 @@ import com.liferay.portal.workflow.kaleo.model.KaleoTransition; import com.liferay.portal.workflow.kaleo.runtime.ExecutionContext; import com.liferay.portal.workflow.kaleo.runtime.graph.PathElement; -import java.util.List; - /** * @author Michael C. Han */ public class JoinXorNodeExecutor extends BaseNodeExecutor { + @Override + protected boolean doEnter(KaleoNode currentKaleoNode, ExecutionContext executionContext) throws PortalException, + SystemException { - protected boolean doEnter( - KaleoNode currentKaleoNode, ExecutionContext executionContext) - throws PortalException, SystemException { - - KaleoInstanceToken kaleoInstanceToken = - executionContext.getKaleoInstanceToken(); - + KaleoInstanceToken kaleoInstanceToken = executionContext.getKaleoInstanceToken(); kaleoInstanceToken = - kaleoInstanceTokenLocalService.getKaleoInstanceToken( - kaleoInstanceToken.getKaleoInstanceTokenId()); - + kaleoInstanceTokenLocalService.getKaleoInstanceToken(kaleoInstanceToken.getKaleoInstanceTokenId()); if (kaleoInstanceToken.isCompleted()) { return false; } - kaleoInstanceToken = - kaleoInstanceTokenLocalService.completeKaleoInstanceToken( - kaleoInstanceToken.getKaleoInstanceTokenId()); - - KaleoInstanceToken parentKaleoInstanceToken = - kaleoInstanceToken.getParentKaleoInstanceToken(); - - if (!parentKaleoInstanceToken. - hasIncompleteChildrenKaleoInstanceToken()) { - + kaleoInstanceTokenLocalService.completeKaleoInstanceToken(kaleoInstanceToken.getKaleoInstanceTokenId()); + KaleoInstanceToken parentKaleoInstanceToken = kaleoInstanceToken.getParentKaleoInstanceToken(); + if (!parentKaleoInstanceToken.hasIncompleteChildrenKaleoInstanceToken()) { return false; } - List childrenKaleoInstanceTokens = - parentKaleoInstanceToken.getChildrenKaleoInstanceTokens(); - - for (KaleoInstanceToken childrenKaleoInstanceToken : - childrenKaleoInstanceTokens) { - - kaleoInstanceTokenLocalService.completeKaleoInstanceToken( - childrenKaleoInstanceToken.getKaleoInstanceTokenId()); + parentKaleoInstanceToken.getChildrenKaleoInstanceTokens(); + for (KaleoInstanceToken childrenKaleoInstanceToken : childrenKaleoInstanceTokens) { + kaleoInstanceTokenLocalService.completeKaleoInstanceToken(childrenKaleoInstanceToken + .getKaleoInstanceTokenId()); } - return true; } + @Override + protected void doExecute(KaleoNode currentKaleoNode, ExecutionContext executionContext, + List remainingPathElements) throws PortalException, SystemException { - protected void doExecute( - KaleoNode currentKaleoNode, ExecutionContext executionContext, - List remainingPathElements) - throws PortalException, SystemException { - - KaleoInstanceToken kaleoInstanceToken = - executionContext.getKaleoInstanceToken(); - - KaleoInstanceToken parentKaleoInstanceToken = - kaleoInstanceToken.getParentKaleoInstanceToken(); - - if (parentKaleoInstanceToken.getCurrentKaleoNodeId() == - currentKaleoNode.getKaleoNodeId()) { - + KaleoInstanceToken kaleoInstanceToken = executionContext.getKaleoInstanceToken(); + KaleoInstanceToken parentKaleoInstanceToken = kaleoInstanceToken.getParentKaleoInstanceToken(); + if (parentKaleoInstanceToken.getCurrentKaleoNodeId() == currentKaleoNode.getKaleoNodeId()) { return; } - parentKaleoInstanceToken = - kaleoInstanceTokenLocalService.updateKaleoInstanceToken( - parentKaleoInstanceToken.getKaleoInstanceTokenId(), - currentKaleoNode.getKaleoNodeId()); - - KaleoTransition kaleoTransition = - currentKaleoNode.getDefaultKaleoTransition(); - - ExecutionContext newExecutionContext = new ExecutionContext( - parentKaleoInstanceToken, executionContext.getWorkflowContext(), - executionContext.getServiceContext()); - - PathElement pathElement = new PathElement( - currentKaleoNode, kaleoTransition.getTargetKaleoNode(), - newExecutionContext); - + kaleoInstanceTokenLocalService.updateKaleoInstanceToken( + parentKaleoInstanceToken.getKaleoInstanceTokenId(), currentKaleoNode.getKaleoNodeId()); + KaleoTransition kaleoTransition = currentKaleoNode.getDefaultKaleoTransition(); + ExecutionContext newExecutionContext = + new ExecutionContext(parentKaleoInstanceToken, executionContext.getWorkflowContext(), + executionContext.getServiceContext()); + PathElement pathElement = + new PathElement(currentKaleoNode, kaleoTransition.getTargetKaleoNode(), newExecutionContext); remainingPathElements.add(pathElement); } + @Override + protected void doExecuteTimer(KaleoNode currentKaleoNode, KaleoTimer kaleoTimer, ExecutionContext executionContext) {} - protected void doExecuteTimer( - KaleoNode currentKaleoNode, KaleoTimer kaleoTimer, - ExecutionContext executionContext) { - } - - - protected void doExit( - KaleoNode currentKaleoNode, ExecutionContext executionContext, - List remainingPathElements) { - } - -} \ No newline at end of file + @Override + protected void doExit(KaleoNode currentKaleoNode, ExecutionContext executionContext, + List remainingPathElements) {} +} diff --git a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/NodeExecutor.java b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/NodeExecutor.java index 90add746..ce22581f 100644 --- a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/NodeExecutor.java +++ b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/NodeExecutor.java @@ -1,48 +1,35 @@ /** - * Copyright (c) 2000-present Liferay, Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. + * Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software + * Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in + * the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. */ package com.liferay.portal.workflow.kaleo.runtime.node; +import java.util.List; + import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.workflow.kaleo.model.KaleoNode; import com.liferay.portal.workflow.kaleo.runtime.ExecutionContext; import com.liferay.portal.workflow.kaleo.runtime.graph.PathElement; -import java.util.List; - /** * @author Michael C. Han */ public interface NodeExecutor { - public boolean enter( - KaleoNode currentKaleoNode, ExecutionContext executionContext) - throws PortalException, SystemException; - - public void execute( - KaleoNode currentKaleoNode, ExecutionContext executionContext, - List remainingPathElements) - throws PortalException, SystemException; + public boolean enter(KaleoNode currentKaleoNode, ExecutionContext executionContext) throws PortalException, + SystemException; - public void executeTimer( - KaleoNode currentKaleoNode, ExecutionContext executionContext) - throws PortalException, SystemException; + public void execute(KaleoNode currentKaleoNode, ExecutionContext executionContext, + List remainingPathElements) throws PortalException, SystemException; - public void exit( - KaleoNode currentKaleoNode, ExecutionContext executionContext, - List remainingPathElements) - throws PortalException, SystemException; + public void executeTimer(KaleoNode currentKaleoNode, ExecutionContext executionContext) throws PortalException, + SystemException; -} \ No newline at end of file + public void exit(KaleoNode currentKaleoNode, ExecutionContext executionContext, + List remainingPathElements) throws PortalException, SystemException; +} diff --git a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/NodeExecutorFactory.java b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/NodeExecutorFactory.java index 177c2298..c19c8b34 100644 --- a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/NodeExecutorFactory.java +++ b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/NodeExecutorFactory.java @@ -1,37 +1,32 @@ /** - * Copyright (c) 2000-present Liferay, Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. + * Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software + * Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in + * the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. */ package com.liferay.portal.workflow.kaleo.runtime.node; -import com.liferay.portal.workflow.kaleo.util.NodeTypeDependentObjectRegistry; - import java.util.Map; +import com.liferay.portal.workflow.kaleo.util.NodeTypeDependentObjectRegistry; + /** * @author Michael C. Han */ public class NodeExecutorFactory { public static NodeExecutor getNodeExecutor(String nodeTypeString) { + return _nodeExecutors.getNodeTypeDependentObjects(nodeTypeString); } public void setNodeExectors(Map nodeExecutors) { + _nodeExecutors.setNodeTypeDependentObjects(nodeExecutors); } - private static NodeTypeDependentObjectRegistry - _nodeExecutors = new NodeTypeDependentObjectRegistry(); - -} \ No newline at end of file + private static NodeTypeDependentObjectRegistry _nodeExecutors = + new NodeTypeDependentObjectRegistry(); +} diff --git a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/StateNodeExecutor.java b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/StateNodeExecutor.java index 5ad36e09..15d2d230 100644 --- a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/StateNodeExecutor.java +++ b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/StateNodeExecutor.java @@ -1,17 +1,15 @@ /** - * Copyright (c) 2000-present Liferay, Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or modify it under the terms of the - * GNU Lesser General Public License as published by the Free Software Foundation; either version - * 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software + * Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in + * the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. */ package com.liferay.portal.workflow.kaleo.runtime.node; +import java.util.List; + import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.kernel.util.Validator; @@ -23,93 +21,74 @@ import com.liferay.portal.workflow.kaleo.model.impl.KaleoInstanceTokenImpl; import com.liferay.portal.workflow.kaleo.runtime.ExecutionContext; import com.liferay.portal.workflow.kaleo.runtime.graph.PathElement; -import java.util.List; - /** * @author Michael C. Han */ public class StateNodeExecutor extends BaseNodeExecutor { - private final static String NAME_SIGNAL = "SIGNAL"; - - public static boolean isSignalNode(KaleoNode kaleoNode) { - return kaleoNode.getName().toUpperCase().startsWith(NAME_SIGNAL); - } - - protected boolean doEnter(KaleoNode currentKaleoNode, ExecutionContext executionContext) { - - return true; - } - - - protected void doExecute(KaleoNode currentKaleoNode, ExecutionContext executionContext, - List remainingPathElements) throws PortalException, SystemException { - - if (isSignalNode(currentKaleoNode)) { - return; - } - - KaleoInstanceToken kaleoInstanceToken = executionContext.getKaleoInstanceToken(); - - String transitionName = executionContext.getTransitionName(); - - if (!currentKaleoNode.hasKaleoTransition()) { - kaleoInstanceToken = - kaleoInstanceTokenLocalService.completeKaleoInstanceToken(kaleoInstanceToken.getKaleoInstanceTokenId()); - - if (kaleoInstanceToken.getParentKaleoInstanceTokenId() == KaleoInstanceTokenImpl.DEFAULT_PARENT_KALEO_INSTANCE_TOKEN_ID) { - - kaleoInstanceLocalService.completeKaleoInstance(kaleoInstanceToken.getKaleoInstanceId()); - } - - return; - } - - KaleoTransition kaleoTransition = null; - - if (Validator.isNull(transitionName)) { - kaleoTransition = currentKaleoNode.getDefaultKaleoTransition(); - } else { - kaleoTransition = currentKaleoNode.getKaleoTransition(transitionName); - } - - ExecutionContext newExecutionContext = - new ExecutionContext(kaleoInstanceToken, executionContext.getWorkflowContext(), - executionContext.getServiceContext()); - - PathElement pathElement = - new PathElement(currentKaleoNode, kaleoTransition.getTargetKaleoNode(), newExecutionContext); - - remainingPathElements.add(pathElement); - } - - - protected void doExecuteTimer(KaleoNode currentKaleoNode, KaleoTimer kaleoTimer, ExecutionContext executionContext) {} - - - protected void doExit(KaleoNode currentKaleoNode, ExecutionContext executionContext, - List remainingPathElements) throws PortalException, SystemException { - - if (isSignalNode(currentKaleoNode)) { - - String transitionName = executionContext.getTransitionName(); - - KaleoTransition kaleoTransition = null; - - if (Validator.isNull(transitionName)) { - kaleoTransition = currentKaleoNode.getDefaultKaleoTransition(); - } else { - kaleoTransition = currentKaleoNode.getKaleoTransition(transitionName); - } - - ExecutionContext newExecutionContext = - new ExecutionContext(executionContext.getKaleoInstanceToken(), executionContext.getKaleoTaskInstanceToken(), - executionContext.getWorkflowContext(), executionContext.getServiceContext()); - - PathElement pathElement = new PathElement(null, kaleoTransition.getTargetKaleoNode(), newExecutionContext); - - remainingPathElements.add(pathElement); - } - } - + private static final String NAME_SIGNAL = "SIGNAL"; + + public static boolean isSignalNode(KaleoNode kaleoNode) { + + return kaleoNode.getName().toUpperCase().startsWith(NAME_SIGNAL); + } + + @Override + protected boolean doEnter(KaleoNode currentKaleoNode, ExecutionContext executionContext) { + + return true; + } + + @Override + protected void doExecute(KaleoNode currentKaleoNode, ExecutionContext executionContext, + List remainingPathElements) throws PortalException, SystemException { + + if (isSignalNode(currentKaleoNode)) { + return; + } + KaleoInstanceToken kaleoInstanceToken = executionContext.getKaleoInstanceToken(); + String transitionName = executionContext.getTransitionName(); + if (!currentKaleoNode.hasKaleoTransition()) { + kaleoInstanceToken = kaleoInstanceTokenLocalService.completeKaleoInstanceToken(kaleoInstanceToken + .getKaleoInstanceTokenId()); + if (kaleoInstanceToken.getParentKaleoInstanceTokenId() == KaleoInstanceTokenImpl.DEFAULT_PARENT_KALEO_INSTANCE_TOKEN_ID) { + kaleoInstanceLocalService.completeKaleoInstance(kaleoInstanceToken.getKaleoInstanceId()); + } + return; + } + KaleoTransition kaleoTransition = null; + if (Validator.isNull(transitionName)) { + kaleoTransition = currentKaleoNode.getDefaultKaleoTransition(); + } else { + kaleoTransition = currentKaleoNode.getKaleoTransition(transitionName); + } + ExecutionContext newExecutionContext = new ExecutionContext(kaleoInstanceToken, + executionContext.getWorkflowContext(), executionContext.getServiceContext()); + PathElement pathElement = new PathElement(currentKaleoNode, kaleoTransition.getTargetKaleoNode(), + newExecutionContext); + remainingPathElements.add(pathElement); + } + + @Override + protected void doExecuteTimer(KaleoNode currentKaleoNode, KaleoTimer kaleoTimer, ExecutionContext executionContext) {} + + @Override + protected void doExit(KaleoNode currentKaleoNode, ExecutionContext executionContext, + List remainingPathElements) throws PortalException, SystemException { + + if (isSignalNode(currentKaleoNode)) { + String transitionName = executionContext.getTransitionName(); + KaleoTransition kaleoTransition = null; + if (Validator.isNull(transitionName)) { + kaleoTransition = currentKaleoNode.getDefaultKaleoTransition(); + } else { + kaleoTransition = currentKaleoNode.getKaleoTransition(transitionName); + } + ExecutionContext newExecutionContext = new ExecutionContext(executionContext.getKaleoInstanceToken(), + executionContext.getKaleoTaskInstanceToken(), executionContext.getWorkflowContext(), + executionContext.getServiceContext()); + PathElement pathElement = new PathElement(null, kaleoTransition.getTargetKaleoNode(), newExecutionContext); + remainingPathElements.add(pathElement); + } + } } diff --git a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/TaskNodeExecutor.java b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/TaskNodeExecutor.java index 6b83aef5..52e93a39 100644 --- a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/TaskNodeExecutor.java +++ b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/com/liferay/portal/workflow/kaleo/runtime/node/TaskNodeExecutor.java @@ -1,19 +1,22 @@ /** - * Copyright (c) 2000-present Liferay, Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the Free - * Software Foundation; either version 2.1 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. + * Copyright (c) 2000-present Liferay, Inc. All rights reserved. This library is free software; you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software + * Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in + * the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. */ package com.liferay.portal.workflow.kaleo.runtime.node; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Date; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.TreeSet; + import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.kernel.util.StringUtil; @@ -45,247 +48,150 @@ import com.liferay.portal.workflow.kaleo.runtime.graph.PathElement; import com.liferay.portal.workflow.kaleo.runtime.notification.NotificationUtil; import com.liferay.portal.workflow.kaleo.runtime.util.ClassLoaderUtil; -import java.io.Serializable; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Date; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.TreeSet; - /** * @author Michael C. Han */ public class TaskNodeExecutor extends BaseNodeExecutor { public void setDueDateCalculator(DueDateCalculator dueDateCalculator) { + _dueDateCalculator = dueDateCalculator; } - public void setTaskAssignmentSelector( - TaskAssignmentSelector taskAssignmentSelector) { + public void setTaskAssignmentSelector(TaskAssignmentSelector taskAssignmentSelector) { _taskAssignmentSelector = taskAssignmentSelector; } - protected Date calculateDueDate(KaleoTask kaleoTask) - throws SystemException { - - List kaleoTimers = kaleoTimerLocalService.getKaleoTimers( - KaleoNode.class.getName(), kaleoTask.getKaleoNodeId()); + protected Date calculateDueDate(KaleoTask kaleoTask) throws SystemException { + List kaleoTimers = + kaleoTimerLocalService.getKaleoTimers(KaleoNode.class.getName(), kaleoTask.getKaleoNodeId()); if (kaleoTimers.isEmpty()) { return null; } - TreeSet sortedDueDates = new TreeSet(); - for (KaleoTimer kaleoTimer : kaleoTimers) { - DelayDuration delayDuration = new DelayDuration( - kaleoTimer.getDuration(), - DurationScale.parse(kaleoTimer.getScale())); - - Date dueDate = _dueDateCalculator.getDueDate( - new Date(), delayDuration); - + DelayDuration delayDuration = + new DelayDuration(kaleoTimer.getDuration(), DurationScale.parse(kaleoTimer.getScale())); + Date dueDate = _dueDateCalculator.getDueDate(new Date(), delayDuration); sortedDueDates.add(dueDate); } - return sortedDueDates.first(); } - protected KaleoTaskInstanceToken createTaskInstanceToken( - ExecutionContext executionContext, - Map workflowContext, - ServiceContext serviceContext, - KaleoInstanceToken kaleoInstanceToken, KaleoTask kaleoTask, - Date dueDate) - throws PortalException, SystemException { - - Collection configuredKaleoTaskAssignments = - kaleoTask.getKaleoTaskAssignments(); - - Collection kaleoTaskAssignments = - new ArrayList(); - - for (KaleoTaskAssignment configuredKaleoTaskAssignment : - configuredKaleoTaskAssignments) { - - String[] assigneeScriptRequiredContexts = StringUtil.split( - configuredKaleoTaskAssignment. - getAssigneeScriptRequiredContexts()); - - ClassLoader[] classLoaders = ClassLoaderUtil.getClassLoaders( - assigneeScriptRequiredContexts); - + protected KaleoTaskInstanceToken createTaskInstanceToken(ExecutionContext executionContext, + Map workflowContext, ServiceContext serviceContext, + KaleoInstanceToken kaleoInstanceToken, KaleoTask kaleoTask, Date dueDate) throws PortalException, + SystemException { + + Collection configuredKaleoTaskAssignments = kaleoTask.getKaleoTaskAssignments(); + Collection kaleoTaskAssignments = new ArrayList(); + for (KaleoTaskAssignment configuredKaleoTaskAssignment : configuredKaleoTaskAssignments) { + String[] assigneeScriptRequiredContexts = + StringUtil.split(configuredKaleoTaskAssignment.getAssigneeScriptRequiredContexts()); + ClassLoader[] classLoaders = ClassLoaderUtil.getClassLoaders(assigneeScriptRequiredContexts); Collection calculatedKaleoTaskAssignments = - _taskAssignmentSelector.calculateTaskAssignments( - configuredKaleoTaskAssignment, executionContext, - classLoaders); - + _taskAssignmentSelector.calculateTaskAssignments(configuredKaleoTaskAssignment, executionContext, + classLoaders); kaleoTaskAssignments.addAll(calculatedKaleoTaskAssignments); } - if (kaleoTaskAssignments.isEmpty()) { Collection organizationKaleoTaskAssignments = - getOrganizationKaleoTaskAssignments( - configuredKaleoTaskAssignments, executionContext); - + getOrganizationKaleoTaskAssignments(configuredKaleoTaskAssignments, executionContext); kaleoTaskAssignments.addAll(organizationKaleoTaskAssignments); } - return kaleoTaskInstanceTokenLocalService.addKaleoTaskInstanceToken( - kaleoInstanceToken.getKaleoInstanceTokenId(), - kaleoTask.getKaleoTaskId(), kaleoTask.getName(), - kaleoTaskAssignments, dueDate, workflowContext, serviceContext); + kaleoInstanceToken.getKaleoInstanceTokenId(), kaleoTask.getKaleoTaskId(), kaleoTask.getName(), + kaleoTaskAssignments, dueDate, workflowContext, serviceContext); } + @Override + protected boolean doEnter(KaleoNode currentKaleoNode, ExecutionContext executionContext) throws PortalException, + SystemException { - protected boolean doEnter( - KaleoNode currentKaleoNode, ExecutionContext executionContext) - throws PortalException, SystemException { - - Map workflowContext = - executionContext.getWorkflowContext(); + Map workflowContext = executionContext.getWorkflowContext(); ServiceContext serviceContext = executionContext.getServiceContext(); - - KaleoInstanceToken kaleoInstanceToken = - executionContext.getKaleoInstanceToken(); - - KaleoTask kaleoTask = kaleoTaskLocalService.getKaleoNodeKaleoTask( - currentKaleoNode.getKaleoNodeId()); - + KaleoInstanceToken kaleoInstanceToken = executionContext.getKaleoInstanceToken(); + KaleoTask kaleoTask = kaleoTaskLocalService.getKaleoNodeKaleoTask(currentKaleoNode.getKaleoNodeId()); Date dueDate = calculateDueDate(kaleoTask); - - KaleoTaskInstanceToken kaleoTaskInstanceToken = createTaskInstanceToken( - executionContext, workflowContext, serviceContext, - kaleoInstanceToken, kaleoTask, dueDate); - + KaleoTaskInstanceToken kaleoTaskInstanceToken = + createTaskInstanceToken(executionContext, workflowContext, serviceContext, kaleoInstanceToken, + kaleoTask, dueDate); executionContext.setKaleoTaskInstanceToken(kaleoTaskInstanceToken); - - ActionExecutorUtil.executeKaleoActions( - KaleoNode.class.getName(), currentKaleoNode.getKaleoNodeId(), - ExecutionType.ON_ASSIGNMENT, executionContext); - - NotificationUtil.sendKaleoNotifications( - KaleoNode.class.getName(), currentKaleoNode.getKaleoNodeId(), - ExecutionType.ON_ASSIGNMENT, executionContext); - - kaleoLogLocalService.addTaskAssignmentKaleoLog( - null, kaleoTaskInstanceToken, "Assigned initial task.", - workflowContext, serviceContext); - + ActionExecutorUtil.executeKaleoActions(KaleoNode.class.getName(), currentKaleoNode.getKaleoNodeId(), + ExecutionType.ON_ASSIGNMENT, executionContext); + NotificationUtil.sendKaleoNotifications(KaleoNode.class.getName(), currentKaleoNode.getKaleoNodeId(), + ExecutionType.ON_ASSIGNMENT, executionContext); + kaleoLogLocalService.addTaskAssignmentKaleoLog(null, kaleoTaskInstanceToken, "Assigned initial task.", + workflowContext, serviceContext); return true; } + @Override + protected void doExecute(KaleoNode currentKaleoNode, ExecutionContext executionContext, + List remainingPathElements) {} - protected void doExecute( - KaleoNode currentKaleoNode, ExecutionContext executionContext, - List remainingPathElements) { - } - - - protected void doExecuteTimer( - KaleoNode currentKaleoNode, KaleoTimer kaleoTimer, - ExecutionContext executionContext) - throws PortalException, SystemException { - - List kaleoTaskReassignments = - kaleoTimer.getKaleoTaskReassignments(); + @Override + protected void doExecuteTimer(KaleoNode currentKaleoNode, KaleoTimer kaleoTimer, ExecutionContext executionContext) + throws PortalException, SystemException { + List kaleoTaskReassignments = kaleoTimer.getKaleoTaskReassignments(); if (kaleoTaskReassignments.isEmpty()) { return; } - - TaskAssignerUtil.reassignKaleoTask( - kaleoTaskReassignments, executionContext); + TaskAssignerUtil.reassignKaleoTask(kaleoTaskReassignments, executionContext); } - - protected void doExit( - KaleoNode currentKaleoNode, ExecutionContext executionContext, - List remainingPathElements) - throws PortalException, SystemException { + @Override + protected void doExit(KaleoNode currentKaleoNode, ExecutionContext executionContext, + List remainingPathElements) throws PortalException, SystemException { String transitionName = executionContext.getTransitionName(); - KaleoTransition kaleoTransition = null; - if (Validator.isNull(transitionName)) { kaleoTransition = currentKaleoNode.getDefaultKaleoTransition(); + } else { + kaleoTransition = currentKaleoNode.getKaleoTransition(transitionName); } - else { - kaleoTransition = currentKaleoNode.getKaleoTransition( - transitionName); - } - - ExecutionContext newExecutionContext = new ExecutionContext( - executionContext.getKaleoInstanceToken(), - executionContext.getKaleoTaskInstanceToken(), - executionContext.getWorkflowContext(), - executionContext.getServiceContext()); - - PathElement pathElement = new PathElement( - null, kaleoTransition.getTargetKaleoNode(), newExecutionContext); - + ExecutionContext newExecutionContext = + new ExecutionContext(executionContext.getKaleoInstanceToken(), + executionContext.getKaleoTaskInstanceToken(), executionContext.getWorkflowContext(), + executionContext.getServiceContext()); + PathElement pathElement = new PathElement(null, kaleoTransition.getTargetKaleoNode(), newExecutionContext); remainingPathElements.add(pathElement); } - protected Collection - getOrganizationKaleoTaskAssignments( - Collection kaleoTaskAssignments, - ExecutionContext executionContext) - throws PortalException, SystemException { + protected Collection getOrganizationKaleoTaskAssignments( + Collection kaleoTaskAssignments, ExecutionContext executionContext) + throws PortalException, SystemException { long userId = executionContext.getKaleoInstanceToken().getUserId(); - User user = UserLocalServiceUtil.getUser(userId); - List organizations = user.getOrganizations(); - - Collection organizationKaleoTaskAssignments = - new HashSet(); - + Collection organizationKaleoTaskAssignments = new HashSet(); for (KaleoTaskAssignment kaleoTaskAssignment : kaleoTaskAssignments) { - String assigneeClassName = - kaleoTaskAssignment.getAssigneeClassName(); - + String assigneeClassName = kaleoTaskAssignment.getAssigneeClassName(); if (!assigneeClassName.equals(Role.class.getName())) { continue; } - long roleId = kaleoTaskAssignment.getAssigneeClassPK(); - Role role = RoleLocalServiceUtil.getRole(roleId); - if (role.getType() != RoleConstants.TYPE_ORGANIZATION) { continue; } - for (Organization organization : organizations) { - KaleoTaskAssignment organizationKaleoTaskAssignment = - new KaleoTaskAssignmentImpl(); - - organizationKaleoTaskAssignment.setGroupId( - organization.getGroup().getGroupId()); - organizationKaleoTaskAssignment.setCompanyId( - kaleoTaskAssignment.getCompanyId()); - organizationKaleoTaskAssignment.setAssigneeClassName( - kaleoTaskAssignment.getAssigneeClassName()); - organizationKaleoTaskAssignment.setAssigneeClassPK( - kaleoTaskAssignment.getAssigneeClassPK()); - - organizationKaleoTaskAssignments.add( - organizationKaleoTaskAssignment); + KaleoTaskAssignment organizationKaleoTaskAssignment = new KaleoTaskAssignmentImpl(); + organizationKaleoTaskAssignment.setGroupId(organization.getGroup().getGroupId()); + organizationKaleoTaskAssignment.setCompanyId(kaleoTaskAssignment.getCompanyId()); + organizationKaleoTaskAssignment.setAssigneeClassName(kaleoTaskAssignment.getAssigneeClassName()); + organizationKaleoTaskAssignment.setAssigneeClassPK(kaleoTaskAssignment.getAssigneeClassPK()); + organizationKaleoTaskAssignments.add(organizationKaleoTaskAssignment); } } - return organizationKaleoTaskAssignments; } private DueDateCalculator _dueDateCalculator; private TaskAssignmentSelector _taskAssignmentSelector; - -} \ No newline at end of file +} diff --git a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/hook/struts/EditWorkflowTaskAction.java b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/hook/struts/EditWorkflowTaskAction.java index 7b642561..6dee36df 100644 --- a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/hook/struts/EditWorkflowTaskAction.java +++ b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/hook/struts/EditWorkflowTaskAction.java @@ -89,13 +89,20 @@ import com.liferay.portal.workflow.kaleo.service.KaleoTaskInstanceTokenLocalServ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { - private final static Log _log = LogFactoryUtil.getLog(EditWorkflowTaskAction.class); + private static final Log _log = LogFactoryUtil.getLog(EditWorkflowTaskAction.class); - private final static List valoriAmmessi = Arrays.asList(StatoPraticaConstants.ANNULLATA, + private static final String PARAMETER_ESITO = WorkflowConstants.PREFIX_NAME_ELEMENT_FORM + "esito" + + WorkflowConstants.SUFFIX_NAME_ELEMENT_FORM; + private static final String PARAMETER_ISTRUTTORE = WorkflowConstants.PREFIX_NAME_ELEMENT_FORM + "istruttore" + + WorkflowConstants.SUFFIX_NAME_ELEMENT_FORM; + private static final String PARAMETER_TESTO = WorkflowConstants.PREFIX_NAME_ELEMENT_FORM + "testo_del_documento" + + WorkflowConstants.SUFFIX_NAME_ELEMENT_FORM; + + private static final List VALORI_AMMESSI = Arrays.asList(StatoPraticaConstants.ANNULLATA, StatoPraticaConstants.CONFORME, StatoPraticaConstants.INTEGRAZIONE, StatoPraticaConstants.NON_CONFORME, StatoPraticaConstants.NO_PARERE, StatoPraticaConstants.PREAVVISO_CONTRARIO); - private static final List logTypes = Arrays.asList(WorkflowLog.TASK_ASSIGN, WorkflowLog.TASK_COMPLETION, + private static final List LOG_TYPES = Arrays.asList(WorkflowLog.TASK_ASSIGN, WorkflowLog.TASK_COMPLETION, WorkflowLog.TASK_UPDATE, WorkflowLog.TRANSITION); @Override @@ -159,11 +166,15 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { if (transitionName.equalsIgnoreCase("registra-esito")) { HttpServletRequest httpServletRequest = PortalUtil.getOriginalServletRequest(PortalUtil .getHttpServletRequest(actionRequest)); - String esito = httpServletRequest.getParameter("kaleo--esito--") == null ? StringPool.BLANK - : httpServletRequest.getParameter("kaleo--esito--").trim(); - String testoDocumento = httpServletRequest.getParameter("kaleo--testo_del_documento--") == null ? StringPool.BLANK - : httpServletRequest.getParameter("kaleo--testo_del_documento--"); - if (!valoriAmmessi.contains(esito) + String esito = httpServletRequest.getParameter(PARAMETER_ESITO); + if (esito == null) { + esito = StringPool.BLANK; + } + String testoDocumento = httpServletRequest.getParameter(PARAMETER_TESTO); + if (testoDocumento == null) { + testoDocumento = StringPool.BLANK; + } + if (!VALORI_AMMESSI.contains(esito) || ((esito.equalsIgnoreCase(StatoPraticaConstants.INTEGRAZIONE) || esito .equalsIgnoreCase(StatoPraticaConstants.PREAVVISO_CONTRARIO)) && testoDocumento.isEmpty())) { _log.error("controllo validazione completamento task registra-esito = " + workflowTaskId @@ -175,7 +186,7 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { } else if (transitionName.equalsIgnoreCase("Riassegna") || transitionName.equalsIgnoreCase("assegna")) { HttpServletRequest httpServletRequest = PortalUtil.getOriginalServletRequest(PortalUtil .getHttpServletRequest(actionRequest)); - String istruttore = httpServletRequest.getParameter("kaleo--istruttore--"); + String istruttore = httpServletRequest.getParameter(PARAMETER_ISTRUTTORE); if (Validator.isNull(istruttore)) { _log.error("controllo validazione completamento task = " + transitionName + " - " + workflowTaskId + " non riuscito - istruttore non presente nel workflow"); @@ -355,7 +366,7 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { return portletNamespace.concat(PORTLET_STRUTS_FORWARD); } - private final static String PORTLET_STRUTS_FORWARD = "PORTLET_STRUTS_FORWARD"; + private static final String PORTLET_STRUTS_FORWARD = "PORTLET_STRUTS_FORWARD"; @Override public String render(StrutsPortletAction originalStrutsPortletAction, PortletConfig portletConfig, @@ -442,7 +453,7 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction { Map esitiMapByWorkflowLogID = new HashMap(); try { List workflowLogs = WorkflowLogManagerUtil.getWorkflowLogsByWorkflowInstance( - themeDisplay.getCompanyId(), workflowInstanceId, logTypes, QueryUtil.ALL_POS, QueryUtil.ALL_POS, + themeDisplay.getCompanyId(), workflowInstanceId, LOG_TYPES, QueryUtil.ALL_POS, QueryUtil.ALL_POS, WorkflowComparatorFactoryUtil.getLogCreateDateComparator(true)); for (WorkflowLog workflowLog : workflowLogs) { try { diff --git a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/hook/struts/RenderFormTaskPortletAction.java b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/hook/struts/RenderFormTaskPortletAction.java index 39c6a639..5cdbf00d 100644 --- a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/hook/struts/RenderFormTaskPortletAction.java +++ b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/hook/struts/RenderFormTaskPortletAction.java @@ -29,6 +29,8 @@ import com.liferay.portal.kernel.json.JSONArray; import com.liferay.portal.kernel.json.JSONFactoryUtil; import com.liferay.portal.kernel.json.JSONObject; import com.liferay.portal.kernel.language.LanguageUtil; +import com.liferay.portal.kernel.log.Log; +import com.liferay.portal.kernel.log.LogFactoryUtil; import com.liferay.portal.kernel.servlet.ServletResponseUtil; import com.liferay.portal.kernel.struts.BaseStrutsPortletAction; import com.liferay.portal.kernel.util.ContentTypes; @@ -51,6 +53,8 @@ import com.liferay.portlet.dynamicdatamapping.util.DDMXSDUtil; public class RenderFormTaskPortletAction extends BaseStrutsPortletAction { + private static final Log _log = LogFactoryUtil.getLog(RenderFormTaskPortletAction.class); + @Override public String render(PortletConfig portletConfig, RenderRequest renderRequest, RenderResponse renderResponse) throws Exception { diff --git a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/util/WorkflowUtil.java b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/util/WorkflowUtil.java index a2dee44c..e883e299 100644 --- a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/util/WorkflowUtil.java +++ b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/util/WorkflowUtil.java @@ -19,17 +19,16 @@ import java.util.Map; import javax.portlet.PortletRequest; import javax.servlet.http.HttpServletRequest; +import org.apache.commons.lang.StringUtils; + import com.liferay.portal.NoSuchWorkflowInstanceLinkException; import com.liferay.portal.kernel.dao.orm.QueryUtil; import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.kernel.json.JSONDeserializer; import com.liferay.portal.kernel.json.JSONFactoryUtil; -import com.liferay.portal.kernel.log.Log; -import com.liferay.portal.kernel.log.LogFactoryUtil; import com.liferay.portal.kernel.util.ParamUtil; import com.liferay.portal.kernel.util.StringPool; -import com.liferay.portal.kernel.util.StringUtil; import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.kernel.workflow.WorkflowHandler; import com.liferay.portal.kernel.workflow.WorkflowHandlerRegistryUtil; @@ -48,7 +47,6 @@ import com.liferay.portal.workflow.kaleo.runtime.action.ActionExecutorUtil; import com.liferay.portal.workflow.kaleo.service.KaleoTaskInstanceTokenLocalServiceUtil; public class WorkflowUtil { - private static Log _log = LogFactoryUtil.getLog(WorkflowUtil.class); public static ControlloPratica getControlloPratica(long workflowTaskId) { @@ -59,8 +57,7 @@ public class WorkflowUtil { if (taskInstanceToken.getClassName().equals(ControlloPratica.class.getName())) { controllo = ControlloPraticaLocalServiceUtil.getControlloPratica(taskInstanceToken.getClassPK()); } - } catch (PortalException | SystemException e) { - } + } catch (PortalException | SystemException e) {} return controllo; } @@ -204,11 +201,11 @@ public class WorkflowUtil { if (name.startsWith(WorkflowConstants.PREFIX_NAME_ELEMENT_FORM) && name.endsWith(WorkflowConstants.SUFFIX_NAME_ELEMENT_FORM)) { if (formParameters == null) { - formParameters = new HashMap(); + formParameters = new HashMap<>(); } String parameterName = name.substring(WorkflowConstants.PREFIX_NAME_ELEMENT_FORM.length(), name.length() - WorkflowConstants.SUFFIX_NAME_ELEMENT_FORM.length()); - String value = StringUtil.merge(ParamUtil.getParameterValues(portletRequest, name)); + String value = StringUtils.join(ParamUtil.getParameterValues(portletRequest, name), ','); formParameters.put(parameterName, value); } } @@ -221,11 +218,11 @@ public class WorkflowUtil { if (name.startsWith(WorkflowConstants.PREFIX_NAME_ELEMENT_FORM) && name.endsWith(WorkflowConstants.SUFFIX_NAME_ELEMENT_FORM)) { if (formParameters == null) { - formParameters = new HashMap(); + formParameters = new HashMap<>(); } String parameterName = name.substring(WorkflowConstants.PREFIX_NAME_ELEMENT_FORM.length(), name.length() - WorkflowConstants.SUFFIX_NAME_ELEMENT_FORM.length()); - String value = StringUtil.merge(ParamUtil.getParameterValues(httpServletRequest, name)); + String value = StringUtils.join(ParamUtil.getParameterValues(httpServletRequest, name), ','); formParameters.put(parameterName, value); } } diff --git a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/service.properties b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/service.properties index 63ecff0e..682a7f56 100644 --- a/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/service.properties +++ b/liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/service.properties @@ -13,8 +13,8 @@ ## build.namespace=Kaleo - build.number=57 - build.date=1631548590240 + build.number=63 + build.date=1631785877061 build.auto.upgrade=true ##