Salvatore La Manna 4 anni fa
parent
commit
02674cb392
  1. 20
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ControlloPraticaLocalServiceImpl.java
  2. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/AllegatoManualePersistenceImpl.java
  3. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/AsseverazionePersistenceImpl.java
  4. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/AvvisoPersistenceImpl.java
  5. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/CollaudoPersistenceImpl.java
  6. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ComunePersistenceImpl.java
  7. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ComunicazionePersistenceImpl.java
  8. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ConfigurazionePersistenceImpl.java
  9. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ControlloPraticaPersistenceImpl.java
  10. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DelegaPersistenceImpl.java
  11. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DettPraticaPersistenceImpl.java
  12. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DocAggiuntivaPersistenceImpl.java
  13. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DocPraticaPersistenceImpl.java
  14. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/FineLavoriPersistenceImpl.java
  15. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/HistoryWorkflowActionPersistenceImpl.java
  16. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/IUVPersistenceImpl.java
  17. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/InfoFascicoloPersistenceImpl.java
  18. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/IntPraticaPersistenceImpl.java
  19. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/PagamentoPersistenceImpl.java
  20. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ParereGeologoPersistenceImpl.java
  21. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ProvinciaPersistenceImpl.java
  22. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/SoggettoPersistenceImpl.java
  23. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/SorteggioPersistenceImpl.java
  24. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/StoricoSoggettoPraticaPersistenceImpl.java
  25. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/TempisticaPersistenceImpl.java
  26. 1
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/TerritorioPersistenceImpl.java
  27. 4
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties
  28. 2
      liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/ivy.xml
  29. 59
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_tasks/render_form_task.jsp
  30. 174
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/hook/struts/EditWorkflowTaskAction.java
  31. 108
      liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/WEB-INF/src/it/tref/liferay/portos/kaleo/util/WorkflowUtil.java

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

@ -36,10 +36,14 @@ import it.tref.liferay.portos.kaleo.model.FormLog;
import it.tref.liferay.portos.kaleo.service.FormLogLocalServiceUtil; import it.tref.liferay.portos.kaleo.service.FormLogLocalServiceUtil;
import java.io.Serializable; import java.io.Serializable;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.TreeMap;
import com.liferay.portal.kernel.bean.PortletBeanLocatorUtil; import com.liferay.portal.kernel.bean.PortletBeanLocatorUtil;
import com.liferay.portal.kernel.dao.orm.DynamicQuery; import com.liferay.portal.kernel.dao.orm.DynamicQuery;
import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil; import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
@ -491,8 +495,10 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi
public String getJsonListaIstruttori(long controlloPraticaId, Map<String, Serializable> workflowContext) public String getJsonListaIstruttori(long controlloPraticaId, Map<String, Serializable> workflowContext)
throws PortalException, SystemException { throws PortalException, SystemException {
_log.info("Inizio attività");
ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil
.getControlloPratica(controlloPraticaId); .getControlloPratica(controlloPraticaId);
_log.info("Controllo pratica " + controlloPratica.getControlloPraticaId());
JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
@ -502,11 +508,17 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi
List<UserGroupRole> userGroupRoles = UserGroupRoleLocalServiceUtil.getUserGroupRolesByGroupAndRole( List<UserGroupRole> userGroupRoles = UserGroupRoleLocalServiceUtil.getUserGroupRolesByGroupAndRole(
controlloPratica.getGroupId(), role.getRoleId()); controlloPratica.getGroupId(), role.getRoleId());
Map<String, JSONObject> sorted = new TreeMap<>();
for (UserGroupRole userGroupRole : userGroupRoles) { for (UserGroupRole userGroupRole : userGroupRoles) {
User user = userGroupRole.getUser();
JSONObject istruttore = JSONFactoryUtil.createJSONObject(); JSONObject istruttore = JSONFactoryUtil.createJSONObject();
istruttore.put("label", userGroupRole.getUser().getFullName()); istruttore.put("label", user.getFullName());
istruttore.put("value", userGroupRole.getUserId()); istruttore.put("value", user.getUserId());
istruttore.put("default", false); istruttore.put("default", false);
sorted.put((user.getLastName() + user.getFirstName()).toUpperCase(), istruttore);
}
for (JSONObject istruttore : sorted.values()) {
jsonArray.put(istruttore); jsonArray.put(istruttore);
} }
@ -547,12 +559,12 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi
} else if (AzioniPraticheUtil.isAutorizzazione(controlloPratica.getIntPraticaId())) { } else if (AzioniPraticheUtil.isAutorizzazione(controlloPratica.getIntPraticaId())) {
JSONObject etichette = JSONFactoryUtil.createJSONObject(); JSONObject etichette = JSONFactoryUtil.createJSONObject();
etichette.put("label", "Autorizzata"); etichette.put("label", "Autorizzata");
etichette.put("value", "AU"); etichette.put("value", "CO");
etichette.put("default", false); etichette.put("default", false);
jsonArray.put(etichette); jsonArray.put(etichette);
etichette = JSONFactoryUtil.createJSONObject(); etichette = JSONFactoryUtil.createJSONObject();
etichette.put("label", "Non autorizzata"); etichette.put("label", "Non autorizzata");
etichette.put("value", "AN"); etichette.put("value", "NC");
etichette.put("default", false); etichette.put("default", false);
jsonArray.put(etichette); jsonArray.put(etichette);
etichette = JSONFactoryUtil.createJSONObject(); etichette = JSONFactoryUtil.createJSONObject();

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/AllegatoManualePersistenceImpl.java

@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchAllegatoManualeException;
import it.tref.liferay.portos.bo.model.AllegatoManuale; import it.tref.liferay.portos.bo.model.AllegatoManuale;
import it.tref.liferay.portos.bo.model.impl.AllegatoManualeImpl; import it.tref.liferay.portos.bo.model.impl.AllegatoManualeImpl;
import it.tref.liferay.portos.bo.model.impl.AllegatoManualeModelImpl; import it.tref.liferay.portos.bo.model.impl.AllegatoManualeModelImpl;
import it.tref.liferay.portos.bo.service.persistence.AllegatoManualePersistence;
import java.io.Serializable; import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/AsseverazionePersistenceImpl.java

@ -46,6 +46,7 @@ import it.tref.liferay.portos.bo.NoSuchAsseverazioneException;
import it.tref.liferay.portos.bo.model.Asseverazione; import it.tref.liferay.portos.bo.model.Asseverazione;
import it.tref.liferay.portos.bo.model.impl.AsseverazioneImpl; import it.tref.liferay.portos.bo.model.impl.AsseverazioneImpl;
import it.tref.liferay.portos.bo.model.impl.AsseverazioneModelImpl; import it.tref.liferay.portos.bo.model.impl.AsseverazioneModelImpl;
import it.tref.liferay.portos.bo.service.persistence.AsseverazionePersistence;
import java.io.Serializable; import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/AvvisoPersistenceImpl.java

@ -46,6 +46,7 @@ import it.tref.liferay.portos.bo.NoSuchAvvisoException;
import it.tref.liferay.portos.bo.model.Avviso; import it.tref.liferay.portos.bo.model.Avviso;
import it.tref.liferay.portos.bo.model.impl.AvvisoImpl; import it.tref.liferay.portos.bo.model.impl.AvvisoImpl;
import it.tref.liferay.portos.bo.model.impl.AvvisoModelImpl; import it.tref.liferay.portos.bo.model.impl.AvvisoModelImpl;
import it.tref.liferay.portos.bo.service.persistence.AvvisoPersistence;
import java.io.Serializable; import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/CollaudoPersistenceImpl.java

@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchCollaudoException;
import it.tref.liferay.portos.bo.model.Collaudo; import it.tref.liferay.portos.bo.model.Collaudo;
import it.tref.liferay.portos.bo.model.impl.CollaudoImpl; import it.tref.liferay.portos.bo.model.impl.CollaudoImpl;
import it.tref.liferay.portos.bo.model.impl.CollaudoModelImpl; import it.tref.liferay.portos.bo.model.impl.CollaudoModelImpl;
import it.tref.liferay.portos.bo.service.persistence.CollaudoPersistence;
import java.io.Serializable; import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ComunePersistenceImpl.java

@ -46,6 +46,7 @@ import it.tref.liferay.portos.bo.NoSuchComuneException;
import it.tref.liferay.portos.bo.model.Comune; import it.tref.liferay.portos.bo.model.Comune;
import it.tref.liferay.portos.bo.model.impl.ComuneImpl; import it.tref.liferay.portos.bo.model.impl.ComuneImpl;
import it.tref.liferay.portos.bo.model.impl.ComuneModelImpl; import it.tref.liferay.portos.bo.model.impl.ComuneModelImpl;
import it.tref.liferay.portos.bo.service.persistence.ComunePersistence;
import java.io.Serializable; import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ComunicazionePersistenceImpl.java

@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchComunicazioneException;
import it.tref.liferay.portos.bo.model.Comunicazione; import it.tref.liferay.portos.bo.model.Comunicazione;
import it.tref.liferay.portos.bo.model.impl.ComunicazioneImpl; import it.tref.liferay.portos.bo.model.impl.ComunicazioneImpl;
import it.tref.liferay.portos.bo.model.impl.ComunicazioneModelImpl; import it.tref.liferay.portos.bo.model.impl.ComunicazioneModelImpl;
import it.tref.liferay.portos.bo.service.persistence.ComunicazionePersistence;
import java.io.Serializable; import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ConfigurazionePersistenceImpl.java

@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchConfigurazioneException;
import it.tref.liferay.portos.bo.model.Configurazione; import it.tref.liferay.portos.bo.model.Configurazione;
import it.tref.liferay.portos.bo.model.impl.ConfigurazioneImpl; import it.tref.liferay.portos.bo.model.impl.ConfigurazioneImpl;
import it.tref.liferay.portos.bo.model.impl.ConfigurazioneModelImpl; import it.tref.liferay.portos.bo.model.impl.ConfigurazioneModelImpl;
import it.tref.liferay.portos.bo.service.persistence.ConfigurazionePersistence;
import java.io.Serializable; import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ControlloPraticaPersistenceImpl.java

@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchControlloPraticaException;
import it.tref.liferay.portos.bo.model.ControlloPratica; import it.tref.liferay.portos.bo.model.ControlloPratica;
import it.tref.liferay.portos.bo.model.impl.ControlloPraticaImpl; import it.tref.liferay.portos.bo.model.impl.ControlloPraticaImpl;
import it.tref.liferay.portos.bo.model.impl.ControlloPraticaModelImpl; import it.tref.liferay.portos.bo.model.impl.ControlloPraticaModelImpl;
import it.tref.liferay.portos.bo.service.persistence.ControlloPraticaPersistence;
import java.io.Serializable; import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DelegaPersistenceImpl.java

@ -46,6 +46,7 @@ import it.tref.liferay.portos.bo.NoSuchDelegaException;
import it.tref.liferay.portos.bo.model.Delega; import it.tref.liferay.portos.bo.model.Delega;
import it.tref.liferay.portos.bo.model.impl.DelegaImpl; import it.tref.liferay.portos.bo.model.impl.DelegaImpl;
import it.tref.liferay.portos.bo.model.impl.DelegaModelImpl; import it.tref.liferay.portos.bo.model.impl.DelegaModelImpl;
import it.tref.liferay.portos.bo.service.persistence.DelegaPersistence;
import java.io.Serializable; import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DettPraticaPersistenceImpl.java

@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchDettPraticaException;
import it.tref.liferay.portos.bo.model.DettPratica; import it.tref.liferay.portos.bo.model.DettPratica;
import it.tref.liferay.portos.bo.model.impl.DettPraticaImpl; import it.tref.liferay.portos.bo.model.impl.DettPraticaImpl;
import it.tref.liferay.portos.bo.model.impl.DettPraticaModelImpl; import it.tref.liferay.portos.bo.model.impl.DettPraticaModelImpl;
import it.tref.liferay.portos.bo.service.persistence.DettPraticaPersistence;
import java.io.Serializable; import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DocAggiuntivaPersistenceImpl.java

@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchDocAggiuntivaException;
import it.tref.liferay.portos.bo.model.DocAggiuntiva; import it.tref.liferay.portos.bo.model.DocAggiuntiva;
import it.tref.liferay.portos.bo.model.impl.DocAggiuntivaImpl; import it.tref.liferay.portos.bo.model.impl.DocAggiuntivaImpl;
import it.tref.liferay.portos.bo.model.impl.DocAggiuntivaModelImpl; import it.tref.liferay.portos.bo.model.impl.DocAggiuntivaModelImpl;
import it.tref.liferay.portos.bo.service.persistence.DocAggiuntivaPersistence;
import java.io.Serializable; import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/DocPraticaPersistenceImpl.java

@ -46,6 +46,7 @@ import it.tref.liferay.portos.bo.NoSuchDocPraticaException;
import it.tref.liferay.portos.bo.model.DocPratica; import it.tref.liferay.portos.bo.model.DocPratica;
import it.tref.liferay.portos.bo.model.impl.DocPraticaImpl; import it.tref.liferay.portos.bo.model.impl.DocPraticaImpl;
import it.tref.liferay.portos.bo.model.impl.DocPraticaModelImpl; import it.tref.liferay.portos.bo.model.impl.DocPraticaModelImpl;
import it.tref.liferay.portos.bo.service.persistence.DocPraticaPersistence;
import java.io.Serializable; import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/FineLavoriPersistenceImpl.java

@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchFineLavoriException;
import it.tref.liferay.portos.bo.model.FineLavori; import it.tref.liferay.portos.bo.model.FineLavori;
import it.tref.liferay.portos.bo.model.impl.FineLavoriImpl; import it.tref.liferay.portos.bo.model.impl.FineLavoriImpl;
import it.tref.liferay.portos.bo.model.impl.FineLavoriModelImpl; import it.tref.liferay.portos.bo.model.impl.FineLavoriModelImpl;
import it.tref.liferay.portos.bo.service.persistence.FineLavoriPersistence;
import java.io.Serializable; import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/HistoryWorkflowActionPersistenceImpl.java

@ -42,6 +42,7 @@ import it.tref.liferay.portos.bo.NoSuchHistoryWorkflowActionException;
import it.tref.liferay.portos.bo.model.HistoryWorkflowAction; import it.tref.liferay.portos.bo.model.HistoryWorkflowAction;
import it.tref.liferay.portos.bo.model.impl.HistoryWorkflowActionImpl; import it.tref.liferay.portos.bo.model.impl.HistoryWorkflowActionImpl;
import it.tref.liferay.portos.bo.model.impl.HistoryWorkflowActionModelImpl; import it.tref.liferay.portos.bo.model.impl.HistoryWorkflowActionModelImpl;
import it.tref.liferay.portos.bo.service.persistence.HistoryWorkflowActionPersistence;
import java.io.Serializable; import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/IUVPersistenceImpl.java

@ -46,6 +46,7 @@ import it.tref.liferay.portos.bo.NoSuchIUVException;
import it.tref.liferay.portos.bo.model.IUV; import it.tref.liferay.portos.bo.model.IUV;
import it.tref.liferay.portos.bo.model.impl.IUVImpl; import it.tref.liferay.portos.bo.model.impl.IUVImpl;
import it.tref.liferay.portos.bo.model.impl.IUVModelImpl; import it.tref.liferay.portos.bo.model.impl.IUVModelImpl;
import it.tref.liferay.portos.bo.service.persistence.IUVPersistence;
import java.io.Serializable; import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/InfoFascicoloPersistenceImpl.java

@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchInfoFascicoloException;
import it.tref.liferay.portos.bo.model.InfoFascicolo; import it.tref.liferay.portos.bo.model.InfoFascicolo;
import it.tref.liferay.portos.bo.model.impl.InfoFascicoloImpl; import it.tref.liferay.portos.bo.model.impl.InfoFascicoloImpl;
import it.tref.liferay.portos.bo.model.impl.InfoFascicoloModelImpl; import it.tref.liferay.portos.bo.model.impl.InfoFascicoloModelImpl;
import it.tref.liferay.portos.bo.service.persistence.InfoFascicoloPersistence;
import java.io.Serializable; import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/IntPraticaPersistenceImpl.java

@ -48,6 +48,7 @@ import it.tref.liferay.portos.bo.NoSuchIntPraticaException;
import it.tref.liferay.portos.bo.model.IntPratica; import it.tref.liferay.portos.bo.model.IntPratica;
import it.tref.liferay.portos.bo.model.impl.IntPraticaImpl; import it.tref.liferay.portos.bo.model.impl.IntPraticaImpl;
import it.tref.liferay.portos.bo.model.impl.IntPraticaModelImpl; import it.tref.liferay.portos.bo.model.impl.IntPraticaModelImpl;
import it.tref.liferay.portos.bo.service.persistence.IntPraticaPersistence;
import java.io.Serializable; import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/PagamentoPersistenceImpl.java

@ -46,6 +46,7 @@ import it.tref.liferay.portos.bo.NoSuchPagamentoException;
import it.tref.liferay.portos.bo.model.Pagamento; import it.tref.liferay.portos.bo.model.Pagamento;
import it.tref.liferay.portos.bo.model.impl.PagamentoImpl; import it.tref.liferay.portos.bo.model.impl.PagamentoImpl;
import it.tref.liferay.portos.bo.model.impl.PagamentoModelImpl; import it.tref.liferay.portos.bo.model.impl.PagamentoModelImpl;
import it.tref.liferay.portos.bo.service.persistence.PagamentoPersistence;
import java.io.Serializable; import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ParereGeologoPersistenceImpl.java

@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchParereGeologoException;
import it.tref.liferay.portos.bo.model.ParereGeologo; import it.tref.liferay.portos.bo.model.ParereGeologo;
import it.tref.liferay.portos.bo.model.impl.ParereGeologoImpl; import it.tref.liferay.portos.bo.model.impl.ParereGeologoImpl;
import it.tref.liferay.portos.bo.model.impl.ParereGeologoModelImpl; import it.tref.liferay.portos.bo.model.impl.ParereGeologoModelImpl;
import it.tref.liferay.portos.bo.service.persistence.ParereGeologoPersistence;
import java.io.Serializable; import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/ProvinciaPersistenceImpl.java

@ -43,6 +43,7 @@ import it.tref.liferay.portos.bo.NoSuchProvinciaException;
import it.tref.liferay.portos.bo.model.Provincia; import it.tref.liferay.portos.bo.model.Provincia;
import it.tref.liferay.portos.bo.model.impl.ProvinciaImpl; import it.tref.liferay.portos.bo.model.impl.ProvinciaImpl;
import it.tref.liferay.portos.bo.model.impl.ProvinciaModelImpl; import it.tref.liferay.portos.bo.model.impl.ProvinciaModelImpl;
import it.tref.liferay.portos.bo.service.persistence.ProvinciaPersistence;
import java.io.Serializable; import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/SoggettoPersistenceImpl.java

@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchSoggettoException;
import it.tref.liferay.portos.bo.model.Soggetto; import it.tref.liferay.portos.bo.model.Soggetto;
import it.tref.liferay.portos.bo.model.impl.SoggettoImpl; import it.tref.liferay.portos.bo.model.impl.SoggettoImpl;
import it.tref.liferay.portos.bo.model.impl.SoggettoModelImpl; import it.tref.liferay.portos.bo.model.impl.SoggettoModelImpl;
import it.tref.liferay.portos.bo.service.persistence.SoggettoPersistence;
import java.io.Serializable; import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/SorteggioPersistenceImpl.java

@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchSorteggioException;
import it.tref.liferay.portos.bo.model.Sorteggio; import it.tref.liferay.portos.bo.model.Sorteggio;
import it.tref.liferay.portos.bo.model.impl.SorteggioImpl; import it.tref.liferay.portos.bo.model.impl.SorteggioImpl;
import it.tref.liferay.portos.bo.model.impl.SorteggioModelImpl; import it.tref.liferay.portos.bo.model.impl.SorteggioModelImpl;
import it.tref.liferay.portos.bo.service.persistence.SorteggioPersistence;
import java.io.Serializable; import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/StoricoSoggettoPraticaPersistenceImpl.java

@ -42,6 +42,7 @@ import it.tref.liferay.portos.bo.NoSuchStoricoSoggettoPraticaException;
import it.tref.liferay.portos.bo.model.StoricoSoggettoPratica; import it.tref.liferay.portos.bo.model.StoricoSoggettoPratica;
import it.tref.liferay.portos.bo.model.impl.StoricoSoggettoPraticaImpl; import it.tref.liferay.portos.bo.model.impl.StoricoSoggettoPraticaImpl;
import it.tref.liferay.portos.bo.model.impl.StoricoSoggettoPraticaModelImpl; import it.tref.liferay.portos.bo.model.impl.StoricoSoggettoPraticaModelImpl;
import it.tref.liferay.portos.bo.service.persistence.StoricoSoggettoPraticaPersistence;
import java.io.Serializable; import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/TempisticaPersistenceImpl.java

@ -45,6 +45,7 @@ import it.tref.liferay.portos.bo.NoSuchTempisticaException;
import it.tref.liferay.portos.bo.model.Tempistica; import it.tref.liferay.portos.bo.model.Tempistica;
import it.tref.liferay.portos.bo.model.impl.TempisticaImpl; import it.tref.liferay.portos.bo.model.impl.TempisticaImpl;
import it.tref.liferay.portos.bo.model.impl.TempisticaModelImpl; import it.tref.liferay.portos.bo.model.impl.TempisticaModelImpl;
import it.tref.liferay.portos.bo.service.persistence.TempisticaPersistence;
import java.io.Serializable; import java.io.Serializable;

1
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/persistence/TerritorioPersistenceImpl.java

@ -44,6 +44,7 @@ import it.tref.liferay.portos.bo.NoSuchTerritorioException;
import it.tref.liferay.portos.bo.model.Territorio; import it.tref.liferay.portos.bo.model.Territorio;
import it.tref.liferay.portos.bo.model.impl.TerritorioImpl; import it.tref.liferay.portos.bo.model.impl.TerritorioImpl;
import it.tref.liferay.portos.bo.model.impl.TerritorioModelImpl; import it.tref.liferay.portos.bo.model.impl.TerritorioModelImpl;
import it.tref.liferay.portos.bo.service.persistence.TerritorioPersistence;
import java.io.Serializable; import java.io.Serializable;

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

@ -13,8 +13,8 @@
## ##
build.namespace=portos_bo build.namespace=portos_bo
build.number=2756 build.number=2759
build.date=1606726892312 build.date=1606818542516
build.auto.upgrade=true build.auto.upgrade=true
## ##

2
liferay-plugins-sdk-6.2/portlets/portos-calendar-appointments-portlet/ivy.xml

@ -7,7 +7,7 @@
xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd" xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd"
> >
<info module="portos-calendar-appointments-portlet" organisation="com.liferay"> <info module="portos-calendar-appointments-portlet" organisation="com.liferay">
<extends extendType="configurations,description,info" location="${sdk.dir}/ivy.xml" module="com.liferay.sdk" organisation="com.liferay" revision="latest.integration" /> <extends extendType="configurations,description,info" location="../../ivy.xml" module="com.liferay.sdk" organisation="com.liferay" revision="latest.integration" />
</info> </info>
<dependencies defaultconf="default"> <dependencies defaultconf="default">

59
liferay-plugins-sdk-6.2/webs/portos-kaleo-web/docroot/META-INF/custom_jsps/html/portlet/workflow_tasks/render_form_task.jsp

@ -1,3 +1,10 @@
<%@page import="java.io.Serializable"%>
<%@page import="java.nio.file.Files"%>
<%@page import="java.nio.file.Path"%>
<%@page import="java.io.File"%>
<%@page import="com.liferay.portal.kernel.log.LogFactoryUtil"%>
<%@page import="com.liferay.portal.kernel.log.Log"%>
<%@page import="java.nio.file.Paths"%>
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.liferay.portal.kernel.util.MapUtil"%> <%@page import="com.liferay.portal.kernel.util.MapUtil"%>
<%@page import="com.liferay.portlet.dynamicdatamapping.service.DDMStructureLocalServiceUtil"%> <%@page import="com.liferay.portlet.dynamicdatamapping.service.DDMStructureLocalServiceUtil"%>
@ -109,20 +116,54 @@ if (ddmTemplateId > 0) {
/> />
</liferay-util:buffer> </liferay-util:buffer>
<% <%
Log _log = LogFactoryUtil.getLog("kaleo_merda");
String ns = renderResponse.getNamespace();
for (Entry<String, List<Map<String, Serializable>>> entry : fieldNameOptions.entrySet()) { for (Entry<String, List<Map<String, Serializable>>> entry : fieldNameOptions.entrySet()) {
String base = "(?s)\\sname=\"" + renderResponse.getNamespace() + entry.getKey() String name = entry.getKey();
+ "_INSTANCE_[^\"]*\"(.*?)value=\"Value"; _log.info("name = "+ name);
int counter = 1;
for (Map<String, Serializable> option : entry.getValue()) { for (Map<String, Serializable> option : entry.getValue()) {
String regex = base + counter + "\"(.*?)Label" + counter; for (Entry<String, Serializable> x : option.entrySet()) {
String replace = " name=\"" + entry.getKey() + "\"$1value=\"" + option.get("value") + "\""; _log.info(" - " + x.getKey() + " = " + x.getValue());
}
}
String regexSelect = "(?s)(.*?)(<select.*?\\sname=\"" + ns + name + "_INSTANCE_[^\"]+.*?</select>)(.*)";
if (html.matches(regexSelect)) {
String match = html.replaceAll(regexSelect, "$2");
String select = match.replaceAll("(?s)([?>]*>).*", "$1\n");
for (Map<String, Serializable> option : entry.getValue()) {
select += "<option value=\"" + option.get("value") + "\">" + option.get("label") + "</option>\n";
}
html = html.replaceAll(regexSelect, "$1" + select + "</select>\n" + "$3");
} else {
String regexInput = "(?s)<input(.*?)\\sname=\"" + ns + name
+ "_INSTANCE_[^\"]+\"(.*?)value=\"[^\"]*([^>]+).*?</input>";
for (Map<String, Serializable> option : entry.getValue()) {
String replaceInput = "<input$1 name=\"" + prefix + name + suffix + "\"$2value=\"" + option.get("value");
if (MapUtil.getBoolean(option, "default")) { if (MapUtil.getBoolean(option, "default")) {
replace += " checked=\"checked\""; replaceInput += "\" checked=\"checked";
} }
replace += "$2" + option.get("label"); replaceInput += "$3>" + option.get("label");
html = html.replaceAll(regex, replace); html = html.replaceFirst(regexInput, replaceInput);
counter++;
} }
} }
}
html = html.replaceAll("name=\"" + ns + "(.*?)_INSTANCE_[^\"]+\"", "name=\"" + prefix + "$1" + suffix + "\"");
html = html.replace("name=\"" + ns + "_fieldsDisplay\"", "name=\"_fieldsDisplay\"");
%> %>
<%= html %> <%= html %>
<%!
private void salva(String name, String str) {
Log _log = LogFactoryUtil.getLog("render_form_task_jsp_salva");
try {
String debugPath = com.liferay.portal.kernel.util.PropsUtil.get("liferay.home") + "/debug";
_log.info("debugPath = " + debugPath);
File debugFile = new File(debugPath);
if (!debugFile.exists())
debugFile.mkdirs();
Path path = Paths.get(debugPath + "/" + name);
Files.write(path, str.getBytes());
} catch (Exception e) {
_log.error("Errore", e);
}
}
%>

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

@ -126,8 +126,8 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
} }
} }
} else { } else {
originalStrutsPortletAction.processAction(originalStrutsPortletAction, portletConfig, actionRequest, originalStrutsPortletAction.processAction(originalStrutsPortletAction, portletConfig,
actionResponse); actionRequest, actionResponse);
} }
} }
@ -140,14 +140,10 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
long assigneeUserId = ParamUtil.getLong(actionRequest, "assigneeUserId"); long assigneeUserId = ParamUtil.getLong(actionRequest, "assigneeUserId");
String comment = ParamUtil.getString(actionRequest, "comment"); String comment = ParamUtil.getString(actionRequest, "comment");
WorkflowTaskManagerUtil.assignWorkflowTaskToUser(themeDisplay.getCompanyId(), themeDisplay.getUserId(), WorkflowTaskManagerUtil.assignWorkflowTaskToUser(themeDisplay.getCompanyId(),
workflowTaskId, assigneeUserId, comment, null, null); themeDisplay.getUserId(), workflowTaskId, assigneeUserId, comment, null, null);
} }
protected void completeTask(ActionRequest actionRequest) throws Exception { protected void completeTask(ActionRequest actionRequest) throws Exception {
ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY); ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
@ -162,23 +158,32 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
// ADT: BUG ANOMALIA REGISTRA ESITO // ADT: BUG ANOMALIA REGISTRA ESITO
if (transitionName.equalsIgnoreCase("registra-esito")) { if (transitionName.equalsIgnoreCase("registra-esito")) {
HttpServletRequest httpServletRequest =PortalUtil.getOriginalServletRequest(PortalUtil.getHttpServletRequest(actionRequest)); HttpServletRequest httpServletRequest = PortalUtil.getOriginalServletRequest(PortalUtil
String esito=httpServletRequest.getParameter("kaleo--esito--")!=null?httpServletRequest.getParameter("kaleo--esito--").trim():""; .getHttpServletRequest(actionRequest));
String testoDocumento=httpServletRequest.getParameter("kaleo--testo_del_documento--")!=null?httpServletRequest.getParameter("kaleo--testo_del_documento--"):""; String esito = httpServletRequest.getParameter("kaleo--esito--") != null ? httpServletRequest
.getParameter("kaleo--esito--").trim() : "";
String testoDocumento = httpServletRequest.getParameter("kaleo--testo_del_documento--") != null ? httpServletRequest
.getParameter("kaleo--testo_del_documento--") : "";
List<String> valoriAmmessi = Arrays.asList("AL", "NC", "CO", "IN"); List<String> valoriAmmessi = Arrays.asList("AL", "NC", "CO", "IN");
if (!valoriAmmessi.contains(esito) || (esito.equalsIgnoreCase("IN") && testoDocumento.isEmpty())) { if (!valoriAmmessi.contains(esito) || (esito.equalsIgnoreCase("IN") && testoDocumento.isEmpty())) {
_log.error("controllo validazione completamento task registra-esito = "+workflowTaskId+" non riuscito - esito non valorizzato o esito IN con testo del documento vuoto"); _log.error("controllo validazione completamento task registra-esito = " + workflowTaskId
throw new PortalException("controllo validazione completamento task registra-esito non riuscito"); + " non riuscito - esito non valorizzato o esito IN con testo del documento vuoto");
throw new PortalException(
"controllo validazione completamento task registra-esito non riuscito");
} }
} else if (transitionName.equalsIgnoreCase("Riassegna") || transitionName.equalsIgnoreCase("assegna")) { } else if (transitionName.equalsIgnoreCase("Riassegna") || transitionName.equalsIgnoreCase("assegna")) {
HttpServletRequest httpServletRequest =PortalUtil.getOriginalServletRequest(PortalUtil.getHttpServletRequest(actionRequest)); HttpServletRequest httpServletRequest = PortalUtil.getOriginalServletRequest(PortalUtil
String istr=httpServletRequest.getParameter("kaleo--istruttore--")!=null?httpServletRequest.getParameter("kaleo--istruttore--").trim():""; .getHttpServletRequest(actionRequest));
String istr = httpServletRequest.getParameter("kaleo--istruttore--") != null ? httpServletRequest
.getParameter("kaleo--istruttore--").trim() : "";
if (istr.isEmpty()) { if (istr.isEmpty()) {
_log.error("controllo validazione completamento task = "+transitionName +" -"+workflowTaskId+" non riuscito - esito non valorizzato o esito IN con testo del documento vuoto"); _log.error("controllo validazione completamento task = " + transitionName + " -"
throw new PortalException("controllo validazione completamento task registra-esito non riuscito"); + workflowTaskId
+ " non riuscito - esito non valorizzato o esito IN con testo del documento vuoto");
throw new PortalException(
"controllo validazione completamento task registra-esito non riuscito");
} }
} }
/////////////////////////////////////////////////////////
Map<String, Serializable> workflowContext = new HashMap<String, Serializable>(); Map<String, Serializable> workflowContext = new HashMap<String, Serializable>();
@ -186,8 +191,8 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
WorkflowUtil.updateWorkflowContextWithTaskFormParameters(actionRequest, workflowContext); WorkflowUtil.updateWorkflowContextWithTaskFormParameters(actionRequest, workflowContext);
WorkflowTaskManagerUtil.completeWorkflowTask(themeDisplay.getCompanyId(), themeDisplay.getUserId(), workflowTaskId, WorkflowTaskManagerUtil.completeWorkflowTask(themeDisplay.getCompanyId(), themeDisplay.getUserId(),
transitionName, comment, workflowContext); workflowTaskId, transitionName, comment, workflowContext);
} }
protected void relaseTask(ActionRequest actionRequest) throws Exception { protected void relaseTask(ActionRequest actionRequest) throws Exception {
@ -199,8 +204,8 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
long assigneeUserId = ParamUtil.getLong(actionRequest, "assigneeUserId"); long assigneeUserId = ParamUtil.getLong(actionRequest, "assigneeUserId");
String comment = ParamUtil.getString(actionRequest, "comment"); String comment = ParamUtil.getString(actionRequest, "comment");
WorkflowTaskManagerUtil.assignWorkflowTaskToRole(themeDisplay.getCompanyId(), assigneeUserId, workflowTaskId, 0L, WorkflowTaskManagerUtil.assignWorkflowTaskToRole(themeDisplay.getCompanyId(), assigneeUserId,
comment, null, null); workflowTaskId, 0L, comment, null, null);
} }
protected boolean isCheckMethodOnProcessAction() { protected boolean isCheckMethodOnProcessAction() {
@ -227,12 +232,11 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
dueDateHour += 12; dueDateHour += 12;
} }
Date dueDate = Date dueDate = PortalUtil.getDate(dueDateMonth, dueDateDay, dueDateYear, dueDateHour, dueDateMinute,
PortalUtil.getDate(dueDateMonth, dueDateDay, dueDateYear, dueDateHour, dueDateMinute,
WorkflowTaskDueDateException.class); WorkflowTaskDueDateException.class);
WorkflowTaskManagerUtil.updateDueDate(themeDisplay.getCompanyId(), themeDisplay.getUserId(), workflowTaskId, WorkflowTaskManagerUtil.updateDueDate(themeDisplay.getCompanyId(), themeDisplay.getUserId(),
comment, dueDate); workflowTaskId, comment, dueDate);
} }
private static final boolean _CHECK_METHOD_ON_PROCESS_ACTION = false; private static final boolean _CHECK_METHOD_ON_PROCESS_ACTION = false;
@ -243,8 +247,9 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
sendRedirect(null, actionRequest, actionResponse, redirect, null); sendRedirect(null, actionRequest, actionResponse, redirect, null);
} }
protected void sendRedirect(PortletConfig portletConfig, ActionRequest actionRequest, ActionResponse actionResponse, protected void sendRedirect(PortletConfig portletConfig, ActionRequest actionRequest,
String redirect, String closeRedirect) throws IOException, SystemException { ActionResponse actionResponse, String redirect, String closeRedirect) throws IOException,
SystemException {
if (isDisplaySuccessMessage(actionRequest)) { if (isDisplaySuccessMessage(actionRequest)) {
addSuccessMessage(actionRequest, actionResponse); addSuccessMessage(actionRequest, actionResponse);
@ -332,10 +337,11 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
protected void addSuccessMessage(ActionRequest actionRequest, ActionResponse actionResponse) { protected void addSuccessMessage(ActionRequest actionRequest, ActionResponse actionResponse) {
PortletConfig portletConfig = (PortletConfig) actionRequest.getAttribute(JavaConstants.JAVAX_PORTLET_CONFIG); PortletConfig portletConfig = (PortletConfig) actionRequest
.getAttribute(JavaConstants.JAVAX_PORTLET_CONFIG);
boolean addProcessActionSuccessMessage = boolean addProcessActionSuccessMessage = GetterUtil.getBoolean(
GetterUtil.getBoolean(portletConfig.getInitParameter("add-process-action-success-action"), true); portletConfig.getInitParameter("add-process-action-success-action"), true);
if (!addProcessActionSuccessMessage) { if (!addProcessActionSuccessMessage) {
return; return;
@ -373,10 +379,12 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
WorkflowTask workflowTask = null; WorkflowTask workflowTask = null;
if (workflowTaskId > 0) { if (workflowTaskId > 0) {
workflowTask = WorkflowTaskManagerUtil.getWorkflowTask(themeDisplay.getCompanyId(), workflowTaskId); workflowTask = WorkflowTaskManagerUtil.getWorkflowTask(themeDisplay.getCompanyId(),
workflowTaskId);
} }
String valoreTransizioneEsito = getTransitionValue(workflowTask.getWorkflowInstanceId(), "registra-esito"); String valoreTransizioneEsito = getTransitionValue(workflowTask.getWorkflowInstanceId(),
"registra-esito");
String valoreTransizioneAssegna = getTransitionValue(workflowTask.getWorkflowInstanceId(), "assegna"); String valoreTransizioneAssegna = getTransitionValue(workflowTask.getWorkflowInstanceId(), "assegna");
renderRequest.setAttribute("registra-esito-value", valoreTransizioneEsito); renderRequest.setAttribute("registra-esito-value", valoreTransizioneEsito);
@ -386,7 +394,10 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
ControlloPratica controlloPratica = getControlloPratica(workflowTask.getWorkflowInstanceId()); ControlloPratica controlloPratica = getControlloPratica(workflowTask.getWorkflowInstanceId());
// ADT BUG BO ID=33 // ADT BUG BO ID=33
renderRequest.setAttribute("historyWorkflowEsitiLogs", getHistoryWorkfloLogs(themeDisplay,workflowTask.getWorkflowInstanceId(),renderRequest,controlloPratica)); renderRequest.setAttribute(
"historyWorkflowEsitiLogs",
getHistoryWorkfloLogs(themeDisplay, workflowTask.getWorkflowInstanceId(), renderRequest,
controlloPratica));
long groupIdTerritorio = controlloPratica.getGroupId(); long groupIdTerritorio = controlloPratica.getGroupId();
Group group = GroupLocalServiceUtil.getGroup(groupIdTerritorio); Group group = GroupLocalServiceUtil.getGroup(groupIdTerritorio);
@ -394,27 +405,28 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
User user = themeDisplay.getUser(); User user = themeDisplay.getUser();
Organization org = OrganizationLocalServiceUtil.getOrganization(group.getClassPK()); Organization org = OrganizationLocalServiceUtil.getOrganization(group.getClassPK());
boolean canPortosAssegnatore = boolean canPortosAssegnatore = UserGroupRoleLocalServiceUtil.hasUserGroupRole(user.getUserId(),
UserGroupRoleLocalServiceUtil.hasUserGroupRole(user.getUserId(), org.getGroupId(), "portos_assegnatore"); org.getGroupId(), "portos_assegnatore");
boolean canPortosApprovatore = boolean canPortosApprovatore = UserGroupRoleLocalServiceUtil.hasUserGroupRole(user.getUserId(),
UserGroupRoleLocalServiceUtil.hasUserGroupRole(user.getUserId(), org.getGroupId(), "portos_approvatore"); org.getGroupId(), "portos_approvatore");
boolean canPortosIstruttore = boolean canPortosIstruttore = UserGroupRoleLocalServiceUtil.hasUserGroupRole(user.getUserId(),
UserGroupRoleLocalServiceUtil.hasUserGroupRole(user.getUserId(), org.getGroupId(), "portos_istruttore"); org.getGroupId(), "portos_istruttore");
renderRequest.setAttribute("canPortosAssegnatore", canPortosAssegnatore); renderRequest.setAttribute("canPortosAssegnatore", canPortosAssegnatore);
renderRequest.setAttribute("canPortosApprovatore", canPortosApprovatore); renderRequest.setAttribute("canPortosApprovatore", canPortosApprovatore);
renderRequest.setAttribute("canPortosIstruttore", canPortosIstruttore); renderRequest.setAttribute("canPortosIstruttore", canPortosIstruttore);
return originalStrutsPortletAction.render(originalStrutsPortletAction, portletConfig, renderRequest,
return originalStrutsPortletAction.render(originalStrutsPortletAction, portletConfig, renderRequest, renderResponse); renderResponse);
} }
private String getTransitionValue(long taskInstanceId, String transitionName) throws PortalException, SystemException { private String getTransitionValue(long taskInstanceId, String transitionName) throws PortalException,
SystemException {
ClassLoader classLoaderKaleoLog = ClassLoader classLoaderKaleoLog = (ClassLoader) PortletBeanLocatorUtil.locate(
(ClassLoader) PortletBeanLocatorUtil.locate( it.tref.liferay.portos.kaleo.service.ClpSerializer.getServletContextName(),
it.tref.liferay.portos.kaleo.service.ClpSerializer.getServletContextName(), "portletClassLoader"); "portletClassLoader");
DynamicQuery dqKaleoLog = DynamicQueryFactoryUtil.forClass(FormLog.class, classLoaderKaleoLog); DynamicQuery dqKaleoLog = DynamicQueryFactoryUtil.forClass(FormLog.class, classLoaderKaleoLog);
dqKaleoLog.add(RestrictionsFactoryUtil.eq("workflowInstanceId", taskInstanceId)); dqKaleoLog.add(RestrictionsFactoryUtil.eq("workflowInstanceId", taskInstanceId));
@ -426,8 +438,8 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
JSONObject json = JSONFactoryUtil.createJSONObject(formLog.getFormParameters()); JSONObject json = JSONFactoryUtil.createJSONObject(formLog.getFormParameters());
KaleoInstance kaleoInstance = KaleoInstanceLocalServiceUtil.getKaleoInstance(taskInstanceId); KaleoInstance kaleoInstance = KaleoInstanceLocalServiceUtil.getKaleoInstance(taskInstanceId);
ControlloPratica controlloPratica = ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil
ControlloPraticaLocalServiceUtil.getControlloPratica(kaleoInstance.getClassPK()); .getControlloPratica(kaleoInstance.getClassPK());
if (json.has("esito")) { if (json.has("esito")) {
String tipoEsito = ""; String tipoEsito = "";
@ -479,19 +491,17 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
private ControlloPratica getControlloPratica(long taskInstanceId) throws PortalException, SystemException { private ControlloPratica getControlloPratica(long taskInstanceId) throws PortalException, SystemException {
ClassLoader classLoaderKaleoLog = ClassLoader classLoaderKaleoLog = (ClassLoader) PortletBeanLocatorUtil.locate(
(ClassLoader) PortletBeanLocatorUtil.locate( it.tref.liferay.portos.kaleo.service.ClpSerializer.getServletContextName(),
it.tref.liferay.portos.kaleo.service.ClpSerializer.getServletContextName(), "portletClassLoader"); "portletClassLoader");
KaleoInstance kaleoInstance = KaleoInstanceLocalServiceUtil.getKaleoInstance(taskInstanceId); KaleoInstance kaleoInstance = KaleoInstanceLocalServiceUtil.getKaleoInstance(taskInstanceId);
ControlloPratica controlloPratica = ControlloPratica controlloPratica = ControlloPraticaLocalServiceUtil
ControlloPraticaLocalServiceUtil.getControlloPratica(kaleoInstance.getClassPK()); .getControlloPratica(kaleoInstance.getClassPK());
return controlloPratica; return controlloPratica;
} }
/** /**
* ADT BUG BO ID=33 - implementazione nuovo metodo * ADT BUG BO ID=33 - implementazione nuovo metodo
* *
@ -501,7 +511,8 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
* @param controlloPratica * @param controlloPratica
* @return * @return
*/ */
private Map<Long,String> getHistoryWorkfloLogs(ThemeDisplay themeDisplay,long workflowInstanceId, RenderRequest renderRequest,ControlloPratica controlloPratica) { private Map<Long, String> getHistoryWorkfloLogs(ThemeDisplay themeDisplay, long workflowInstanceId,
RenderRequest renderRequest, ControlloPratica controlloPratica) {
Map<Long, String> esitiMapByWorkflowLogID = new HashMap<Long, String>(); Map<Long, String> esitiMapByWorkflowLogID = new HashMap<Long, String>();
try { try {
@ -510,14 +521,18 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
logTypes.add(WorkflowLog.TASK_COMPLETION); logTypes.add(WorkflowLog.TASK_COMPLETION);
logTypes.add(WorkflowLog.TASK_UPDATE); logTypes.add(WorkflowLog.TASK_UPDATE);
logTypes.add(WorkflowLog.TRANSITION); logTypes.add(WorkflowLog.TRANSITION);
List<WorkflowLog> workflowLogs = WorkflowLogManagerUtil.getWorkflowLogsByWorkflowInstance(themeDisplay.getCompanyId(), workflowInstanceId, logTypes,QueryUtil.ALL_POS, QueryUtil.ALL_POS,WorkflowComparatorFactoryUtil.getLogCreateDateComparator(true)); List<WorkflowLog> workflowLogs = WorkflowLogManagerUtil.getWorkflowLogsByWorkflowInstance(
themeDisplay.getCompanyId(), workflowInstanceId, logTypes, QueryUtil.ALL_POS,
QueryUtil.ALL_POS, WorkflowComparatorFactoryUtil.getLogCreateDateComparator(true));
for (WorkflowLog workflowLog : workflowLogs) { for (WorkflowLog workflowLog : workflowLogs) {
try { try {
WorkflowTask wfTask = null; WorkflowTask wfTask = null;
if (workflowLog.getWorkflowTaskId() > 0) { if (workflowLog.getWorkflowTaskId() > 0) {
wfTask = WorkflowTaskManagerUtil.getWorkflowTask(themeDisplay.getCompanyId(),workflowLog.getWorkflowTaskId()); wfTask = WorkflowTaskManagerUtil.getWorkflowTask(themeDisplay.getCompanyId(),
workflowLog.getWorkflowTaskId());
ServiceContext serviceContext = ServiceContextFactory.getInstance(renderRequest); ServiceContext serviceContext = ServiceContextFactory.getInstance(renderRequest);
FormLog formLog = FormLogLocalServiceUtil.findByC_Task(serviceContext.getCompanyId(),wfTask.getWorkflowTaskId()); FormLog formLog = FormLogLocalServiceUtil.findByC_Task(serviceContext.getCompanyId(),
wfTask.getWorkflowTaskId());
if (formLog != null && Validator.isNotNull(formLog.getFormParameters())) { if (formLog != null && Validator.isNotNull(formLog.getFormParameters())) {
JSONObject json = JSONFactoryUtil.createJSONObject(formLog.getFormParameters()); JSONObject json = JSONFactoryUtil.createJSONObject(formLog.getFormParameters());
@ -530,8 +545,7 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
break; break;
case "CO": case "CO":
if (AzioniPraticheUtil.isDeposito(controlloPratica if (AzioniPraticheUtil.isDeposito(controlloPratica.getIntPraticaId())) {
.getIntPraticaId())) {
tipoEsito = "Conforme"; tipoEsito = "Conforme";
} else if (AzioniPraticheUtil.isAutorizzazione(controlloPratica } else if (AzioniPraticheUtil.isAutorizzazione(controlloPratica
.getIntPraticaId())) { .getIntPraticaId())) {
@ -542,7 +556,8 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
case "NC": case "NC":
if (AzioniPraticheUtil.isDeposito(controlloPratica.getIntPraticaId())) { if (AzioniPraticheUtil.isDeposito(controlloPratica.getIntPraticaId())) {
tipoEsito = "Non conforme"; tipoEsito = "Non conforme";
} else if (AzioniPraticheUtil.isAutorizzazione(controlloPratica.getIntPraticaId())) { } else if (AzioniPraticheUtil.isAutorizzazione(controlloPratica
.getIntPraticaId())) {
tipoEsito = "Non autorizzata"; tipoEsito = "Non autorizzata";
} }
break; break;
@ -555,7 +570,9 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
break; break;
} }
//_log.info("WorkflowLogId="+ workflowLog.getWorkflowLogId() + " "+ tipoEsito); // _log.info("WorkflowLogId="+
// workflowLog.getWorkflowLogId() + " "+
// tipoEsito);
esitiMapByWorkflowLogID.put(workflowLog.getWorkflowLogId(), tipoEsito); esitiMapByWorkflowLogID.put(workflowLog.getWorkflowLogId(), tipoEsito);
} }
} }
@ -576,7 +593,6 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
} }
/** /**
* ADT: check congruenza WF - presenza dell'istruttore * ADT: check congruenza WF - presenza dell'istruttore
* *
@ -587,14 +603,20 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
private void checkPresenzaIstruttore(String transitionName, long workflowTaskId) { private void checkPresenzaIstruttore(String transitionName, long workflowTaskId) {
if (transitionName.equalsIgnoreCase("registra-esito")) { if (transitionName.equalsIgnoreCase("registra-esito")) {
try { try {
KaleoTaskInstanceToken kaleoTaskInstanceToken = KaleoTaskInstanceTokenLocalServiceUtil.getKaleoTaskInstanceToken(workflowTaskId); KaleoTaskInstanceToken kaleoTaskInstanceToken = KaleoTaskInstanceTokenLocalServiceUtil
ControlloPratica controlloPratica = getControlloPratica(kaleoTaskInstanceToken.getKaleoInstanceId()); .getKaleoTaskInstanceToken(workflowTaskId);
Map<String, Serializable> wfParameters = it.tref.liferay.portos.bo.util.WorkflowUtil.getFormParameters(controlloPratica); ControlloPratica controlloPratica = getControlloPratica(kaleoTaskInstanceToken
.getKaleoInstanceId());
Map<String, Serializable> wfParameters = it.tref.liferay.portos.bo.util.WorkflowUtil
.getFormParameters(controlloPratica);
String istruttore = (String) wfParameters.get("istruttore"); String istruttore = (String) wfParameters.get("istruttore");
_log.info("checkPresenzaIstruttore - istruttore presente sul workflow= " + istruttore+ " - ControlloPraticaId = " + controlloPratica.getControlloPraticaId()); _log.info("checkPresenzaIstruttore - istruttore presente sul workflow= " + istruttore
+ " - ControlloPraticaId = " + controlloPratica.getControlloPraticaId());
if (istruttore == null) { if (istruttore == null) {
_log.info("checkPresenzaIstruttore - rilevata incongrueza WF - istruttore non presente per controlloPratica = " + controlloPratica.getControlloPraticaId()); _log.info("checkPresenzaIstruttore - rilevata incongrueza WF - istruttore non presente per controlloPratica = "
long istruttoreId = IntPraticaLocalServiceUtil.getIntPratica(controlloPratica.getIntPraticaId()).getStatusByUserId(); + controlloPratica.getControlloPraticaId());
long istruttoreId = IntPraticaLocalServiceUtil.getIntPratica(
controlloPratica.getIntPraticaId()).getStatusByUserId();
if (istruttoreId > 0) { if (istruttoreId > 0) {
String jsonFormParameters = null; String jsonFormParameters = null;
Map<String, Serializable> parametri = new HashMap<String, Serializable>(); Map<String, Serializable> parametri = new HashMap<String, Serializable>();
@ -605,15 +627,19 @@ public class EditWorkflowTaskAction extends BaseStrutsPortletAction {
ServiceContext serviceContext = new ServiceContext(); ServiceContext serviceContext = new ServiceContext();
serviceContext.setCompanyId(controlloPratica.getCompanyId()); serviceContext.setCompanyId(controlloPratica.getCompanyId());
serviceContext.setUserId(controlloPratica.getUserId()); serviceContext.setUserId(controlloPratica.getUserId());
FormLogLocalServiceUtil.addFormLog(kaleoTaskInstanceToken.getKaleoInstanceId(), 0l, "cambio-istruttore", jsonFormParameters, serviceContext); FormLogLocalServiceUtil.addFormLog(kaleoTaskInstanceToken.getKaleoInstanceId(), 0l,
_log.info("checkPresenzaIstruttore correttamente eseguito - ControlloPraticaId = " + controlloPratica.getControlloPraticaId()); "cambio-istruttore", jsonFormParameters, serviceContext);
_log.info("checkPresenzaIstruttore correttamente eseguito - ControlloPraticaId = "
+ controlloPratica.getControlloPraticaId());
} else { } else {
_log.info("checkPresenzaIstruttore KO - istruttore non calcolato - ControlloPraticaId = " + controlloPratica.getControlloPraticaId()); _log.info("checkPresenzaIstruttore KO - istruttore non calcolato - ControlloPraticaId = "
+ controlloPratica.getControlloPraticaId());
} }
} }
} catch (Exception e) { } catch (Exception e) {
_log.error("checkPresenzaIstruttore KO per workflowTaskId = "+ workflowTaskId+" ["+e.getMessage()+" , "+e.getCause()+"]"); _log.error("checkPresenzaIstruttore KO per workflowTaskId = " + workflowTaskId + " ["
+ e.getMessage() + " , " + e.getCause() + "]");
} }
} }
} }

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

@ -41,36 +41,41 @@ import com.liferay.portal.workflow.kaleo.service.KaleoTaskInstanceTokenLocalServ
public class WorkflowUtil { public class WorkflowUtil {
public static Map<String, Serializable> executeOnOpenForm(long companyId, long workflowTaskId, long assigneeUserId, public static Map<String, Serializable> executeOnOpenForm(long companyId, long workflowTaskId,
String transitionName) throws PortalException, SystemException { long assigneeUserId, String transitionName) throws PortalException, SystemException {
ServiceContext serviceContext = new ServiceContext(); ServiceContext serviceContext = new ServiceContext();
serviceContext.setCompanyId(companyId); serviceContext.setCompanyId(companyId);
serviceContext.setUserId(assigneeUserId); serviceContext.setUserId(assigneeUserId);
KaleoTaskInstanceToken kaleoTaskInstanceToken = KaleoTaskInstanceToken kaleoTaskInstanceToken = KaleoTaskInstanceTokenLocalServiceUtil
KaleoTaskInstanceTokenLocalServiceUtil.getKaleoTaskInstanceToken(workflowTaskId); .getKaleoTaskInstanceToken(workflowTaskId);
KaleoTask kaleoTask = kaleoTaskInstanceToken.getKaleoTask(); KaleoTask kaleoTask = kaleoTaskInstanceToken.getKaleoTask();
Map<String, Serializable> workflowContext = new HashMap<String, Serializable>(); Map<String, Serializable> workflowContext = new HashMap<String, Serializable>();
WorkflowHandler workflowHandler = WorkflowHandler workflowHandler = WorkflowHandlerRegistryUtil
WorkflowHandlerRegistryUtil.getWorkflowHandler(kaleoTaskInstanceToken.getClassName()); .getWorkflowHandler(kaleoTaskInstanceToken.getClassName());
if (workflowHandler != null) { if (workflowHandler != null) {
workflowContext.put(WorkflowConstants.CONTEXT_ENTRY_TYPE, workflowHandler.getType(Locale.getDefault())); workflowContext.put(WorkflowConstants.CONTEXT_ENTRY_TYPE,
} workflowHandler.getType(Locale.getDefault()));
}
workflowContext.put(WorkflowConstants.CONTEXT_ENTRY_CLASS_NAME, kaleoTaskInstanceToken.getClassName());
workflowContext.put(WorkflowConstants.CONTEXT_ENTRY_CLASS_PK, String.valueOf(kaleoTaskInstanceToken.getClassPK())); workflowContext
workflowContext.put(WorkflowConstants.CONTEXT_COMPANY_ID, String.valueOf(kaleoTaskInstanceToken.getCompanyId())); .put(WorkflowConstants.CONTEXT_ENTRY_CLASS_NAME, kaleoTaskInstanceToken.getClassName());
workflowContext.put(WorkflowConstants.CONTEXT_GROUP_ID, String.valueOf(kaleoTaskInstanceToken.getGroupId())); workflowContext.put(WorkflowConstants.CONTEXT_ENTRY_CLASS_PK,
String.valueOf(kaleoTaskInstanceToken.getClassPK()));
workflowContext.put(WorkflowConstants.CONTEXT_COMPANY_ID,
String.valueOf(kaleoTaskInstanceToken.getCompanyId()));
workflowContext.put(WorkflowConstants.CONTEXT_GROUP_ID,
String.valueOf(kaleoTaskInstanceToken.getGroupId()));
workflowContext.put(WorkflowConstants.CONTEXT_USER_ID, String.valueOf(assigneeUserId)); workflowContext.put(WorkflowConstants.CONTEXT_USER_ID, String.valueOf(assigneeUserId));
workflowContext.put(WorkflowConstants.CONTEXT_SERVICE_CONTEXT, serviceContext); workflowContext.put(WorkflowConstants.CONTEXT_SERVICE_CONTEXT, serviceContext);
workflowContext.put(WorkflowConstants.CONTEXT_TRANSITION_NAME, transitionName); workflowContext.put(WorkflowConstants.CONTEXT_TRANSITION_NAME, transitionName);
ExecutionContext executionContext = ExecutionContext executionContext = new ExecutionContext(
new ExecutionContext(kaleoTaskInstanceToken.getKaleoInstanceToken(), kaleoTaskInstanceToken, workflowContext, kaleoTaskInstanceToken.getKaleoInstanceToken(), kaleoTaskInstanceToken, workflowContext,
serviceContext); serviceContext);
ActionExecutorUtil.executeKaleoActions(KaleoNode.class.getName(), kaleoTask.getKaleoNodeId(), ActionExecutorUtil.executeKaleoActions(KaleoNode.class.getName(), kaleoTask.getKaleoNodeId(),
@ -79,14 +84,15 @@ public class WorkflowUtil {
return executionContext.getWorkflowContext(); return executionContext.getWorkflowContext();
} }
public static Map<String, Serializable> executeOnValidation(long companyId, long workflowTaskId, long assigneeUserId, public static Map<String, Serializable> executeOnValidation(long companyId, long workflowTaskId,
String transitionName) throws PortalException, SystemException { long assigneeUserId, String transitionName) throws PortalException, SystemException {
return executeOnValidation(companyId, workflowTaskId, assigneeUserId, transitionName, null); return executeOnValidation(companyId, workflowTaskId, assigneeUserId, transitionName, null);
} }
public static Map<String, Serializable> executeOnValidation(long companyId, long workflowTaskId, long assigneeUserId, public static Map<String, Serializable> executeOnValidation(long companyId, long workflowTaskId,
String transitionName, Map<String, Serializable> workflowContext) throws PortalException, SystemException { long assigneeUserId, String transitionName, Map<String, Serializable> workflowContext)
throws PortalException, SystemException {
if (workflowContext == null) { if (workflowContext == null) {
workflowContext = Collections.<String, Serializable> emptyMap(); workflowContext = Collections.<String, Serializable> emptyMap();
@ -96,27 +102,32 @@ public class WorkflowUtil {
serviceContext.setCompanyId(companyId); serviceContext.setCompanyId(companyId);
serviceContext.setUserId(assigneeUserId); serviceContext.setUserId(assigneeUserId);
KaleoTaskInstanceToken kaleoTaskInstanceToken = KaleoTaskInstanceToken kaleoTaskInstanceToken = KaleoTaskInstanceTokenLocalServiceUtil
KaleoTaskInstanceTokenLocalServiceUtil.getKaleoTaskInstanceToken(workflowTaskId); .getKaleoTaskInstanceToken(workflowTaskId);
KaleoTask kaleoTask = kaleoTaskInstanceToken.getKaleoTask(); KaleoTask kaleoTask = kaleoTaskInstanceToken.getKaleoTask();
WorkflowHandler workflowHandler = WorkflowHandler workflowHandler = WorkflowHandlerRegistryUtil
WorkflowHandlerRegistryUtil.getWorkflowHandler(kaleoTaskInstanceToken.getClassName()); .getWorkflowHandler(kaleoTaskInstanceToken.getClassName());
if (workflowHandler != null) { if (workflowHandler != null) {
workflowContext.put(WorkflowConstants.CONTEXT_ENTRY_TYPE, workflowHandler.getType(Locale.getDefault())); workflowContext.put(WorkflowConstants.CONTEXT_ENTRY_TYPE,
} workflowHandler.getType(Locale.getDefault()));
}
workflowContext.put(WorkflowConstants.CONTEXT_ENTRY_CLASS_NAME, kaleoTaskInstanceToken.getClassName());
workflowContext.put(WorkflowConstants.CONTEXT_ENTRY_CLASS_PK, String.valueOf(kaleoTaskInstanceToken.getClassPK())); workflowContext
workflowContext.put(WorkflowConstants.CONTEXT_COMPANY_ID, String.valueOf(kaleoTaskInstanceToken.getCompanyId())); .put(WorkflowConstants.CONTEXT_ENTRY_CLASS_NAME, kaleoTaskInstanceToken.getClassName());
workflowContext.put(WorkflowConstants.CONTEXT_GROUP_ID, String.valueOf(kaleoTaskInstanceToken.getGroupId())); workflowContext.put(WorkflowConstants.CONTEXT_ENTRY_CLASS_PK,
String.valueOf(kaleoTaskInstanceToken.getClassPK()));
workflowContext.put(WorkflowConstants.CONTEXT_COMPANY_ID,
String.valueOf(kaleoTaskInstanceToken.getCompanyId()));
workflowContext.put(WorkflowConstants.CONTEXT_GROUP_ID,
String.valueOf(kaleoTaskInstanceToken.getGroupId()));
workflowContext.put(WorkflowConstants.CONTEXT_USER_ID, String.valueOf(assigneeUserId)); workflowContext.put(WorkflowConstants.CONTEXT_USER_ID, String.valueOf(assigneeUserId));
workflowContext.put(WorkflowConstants.CONTEXT_SERVICE_CONTEXT, serviceContext); workflowContext.put(WorkflowConstants.CONTEXT_SERVICE_CONTEXT, serviceContext);
workflowContext.put(WorkflowConstants.CONTEXT_TRANSITION_NAME, transitionName); workflowContext.put(WorkflowConstants.CONTEXT_TRANSITION_NAME, transitionName);
ExecutionContext executionContext = ExecutionContext executionContext = new ExecutionContext(
new ExecutionContext(kaleoTaskInstanceToken.getKaleoInstanceToken(), kaleoTaskInstanceToken, workflowContext, kaleoTaskInstanceToken.getKaleoInstanceToken(), kaleoTaskInstanceToken, workflowContext,
serviceContext); serviceContext);
ActionExecutorUtil.executeKaleoActions(KaleoNode.class.getName(), kaleoTask.getKaleoNodeId(), ActionExecutorUtil.executeKaleoActions(KaleoNode.class.getName(), kaleoTask.getKaleoNodeId(),
@ -136,8 +147,8 @@ public class WorkflowUtil {
if (Validator.isNotNull(workflowTaskId)) { if (Validator.isNotNull(workflowTaskId)) {
KaleoTaskInstanceToken kaleoTaskInstanceToken = KaleoTaskInstanceToken kaleoTaskInstanceToken = KaleoTaskInstanceTokenLocalServiceUtil
KaleoTaskInstanceTokenLocalServiceUtil.getKaleoTaskInstanceToken(workflowTaskId); .getKaleoTaskInstanceToken(workflowTaskId);
companyId = kaleoTaskInstanceToken.getCompanyId(); companyId = kaleoTaskInstanceToken.getCompanyId();
groupId = kaleoTaskInstanceToken.getGroupId(); groupId = kaleoTaskInstanceToken.getGroupId();
@ -145,8 +156,8 @@ public class WorkflowUtil {
className = kaleoTaskInstanceToken.getClassName(); className = kaleoTaskInstanceToken.getClassName();
} }
WorkflowInstanceLink workflowInstanceLink = WorkflowInstanceLink workflowInstanceLink = WorkflowInstanceLinkLocalServiceUtil
WorkflowInstanceLinkLocalServiceUtil.fetchWorkflowInstanceLink(companyId, groupId, className, classPK); .fetchWorkflowInstanceLink(companyId, groupId, className, classPK);
if (workflowInstanceLink == null) { if (workflowInstanceLink == null) {
throw new NoSuchWorkflowInstanceLinkException(); throw new NoSuchWorkflowInstanceLinkException();
} }
@ -156,13 +167,13 @@ public class WorkflowUtil {
Map<String, Serializable> parameters = new HashMap<String, Serializable>(); Map<String, Serializable> parameters = new HashMap<String, Serializable>();
// order asc // order asc
List<FormLog> formLogs = List<FormLog> formLogs = FormLogLocalServiceUtil.findByC_Instance(companyId, workflowInstanceId,
FormLogLocalServiceUtil.findByC_Instance(companyId, workflowInstanceId, QueryUtil.ALL_POS, QueryUtil.ALL_POS); QueryUtil.ALL_POS, QueryUtil.ALL_POS);
for (FormLog formLog : formLogs) { for (FormLog formLog : formLogs) {
String formParameters = formLog.getFormParameters(); String formParameters = formLog.getFormParameters();
if (Validator.isNotNull(formParameters)) { if (Validator.isNotNull(formParameters)) {
JSONDeserializer<Map<String, Serializable>> jsonDeserializer = JSONDeserializer<Map<String, Serializable>> jsonDeserializer = JSONFactoryUtil
JSONFactoryUtil.<Map<String, Serializable>>createJSONDeserializer(); .<Map<String, Serializable>> createJSONDeserializer();
parameters.putAll(jsonDeserializer.deserialize(formParameters)); parameters.putAll(jsonDeserializer.deserialize(formParameters));
} }
} }
@ -189,17 +200,16 @@ public class WorkflowUtil {
formParameters = new HashMap<String, String>(); formParameters = new HashMap<String, String>();
} }
String parameterName = String parameterName = name.substring(WorkflowConstants.PREFIX_NAME_ELEMENT_FORM.length(),
name.substring(WorkflowConstants.PREFIX_NAME_ELEMENT_FORM.length(), name.length() name.length() - WorkflowConstants.SUFFIX_NAME_ELEMENT_FORM.length());
- WorkflowConstants.SUFFIX_NAME_ELEMENT_FORM.length());
String value = StringUtil.merge(ParamUtil.getParameterValues(portletRequest, name)); String value = StringUtil.merge(ParamUtil.getParameterValues(portletRequest, name));
formParameters.put(parameterName, value); formParameters.put(parameterName, value);
} }
if (formParameters == null) { if (formParameters == null) {
HttpServletRequest httpServletRequest = HttpServletRequest httpServletRequest = PortalUtil.getOriginalServletRequest(PortalUtil
PortalUtil.getOriginalServletRequest(PortalUtil.getHttpServletRequest(portletRequest)); .getHttpServletRequest(portletRequest));
Enumeration<String> enums = httpServletRequest.getParameterNames(); Enumeration<String> enums = httpServletRequest.getParameterNames();
@ -215,16 +225,16 @@ public class WorkflowUtil {
formParameters = new HashMap<String, String>(); formParameters = new HashMap<String, String>();
} }
String parameterName = String parameterName = name.substring(WorkflowConstants.PREFIX_NAME_ELEMENT_FORM.length(),
name.substring(WorkflowConstants.PREFIX_NAME_ELEMENT_FORM.length(), name.length() name.length() - WorkflowConstants.SUFFIX_NAME_ELEMENT_FORM.length());
- WorkflowConstants.SUFFIX_NAME_ELEMENT_FORM.length());
String value = StringUtil.merge(ParamUtil.getParameterValues(httpServletRequest, name)); String value = StringUtil.merge(ParamUtil.getParameterValues(httpServletRequest, name));
formParameters.put(parameterName, value); formParameters.put(parameterName, value);
} }
} }
if (formParameters != null) { if (formParameters != null) {
workflowContext.put(WorkflowConstants.CONTEXT_TASK_FORM_PARAMETERS, (Serializable) formParameters); workflowContext
.put(WorkflowConstants.CONTEXT_TASK_FORM_PARAMETERS, (Serializable) formParameters);
} }
} }

Caricamento…
Annulla
Salva