Sfoglia il codice sorgente

Fix salvataggio geologo

Salvatore La Manna 4 anni fa
parent
commit
bf3a4a1f81
  1. BIN
      liferay-plugins-sdk-6.2/hooks/portos-p7m-preview-hook/docroot/WEB-INF/lib/commons-logging.jar
  2. BIN
      liferay-plugins-sdk-6.2/hooks/portos-p7m-preview-hook/docroot/WEB-INF/lib/log4j.jar
  3. BIN
      liferay-plugins-sdk-6.2/hooks/portos-p7m-preview-hook/docroot/WEB-INF/lib/util-bridges.jar
  4. BIN
      liferay-plugins-sdk-6.2/hooks/portos-p7m-preview-hook/docroot/WEB-INF/lib/util-taglib.jar
  5. 21
      liferay-plugins-sdk-6.2/hooks/portos-p7m-preview-hook/docroot/WEB-INF/src/it/tref/liferay/portlet/p7mpreview/P7mPreview.java
  6. 2
      liferay-plugins-sdk-6.2/hooks/portos-p7m-preview-hook/ivy.xml.MD5
  7. 109
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/hook/CfOrganizationMembershipPolicy.java
  8. 30
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/ControlloPraticaLocalServiceImpl.java
  9. 11
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DettPraticaServiceImpl.java
  10. 4
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties
  11. 9
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/view_columns.jspf
  12. 13
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/fe/portlet/FascicoloFePortlet.java
  13. 46
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/allegatipratica/allegati_action.jsp
  14. 3
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/allegatipratica/view.jsp
  15. 4
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/allegatipratica/view_accordion.jsp
  16. 3
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/edit_fascicolo.jsp
  17. 5
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/header.jsp
  18. 2
      liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/build.xml
  19. 143
      liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/action/StartUpAction.java
  20. 309
      liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/servlet/FirmaServlet.java
  21. 21
      liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/util/ExtractorResponse.java
  22. 508
      liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/util/FirmaPostUtil.java
  23. 87
      liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/util/FirmaUtil.java
  24. 2
      liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/util/MailEngine.java
  25. 7
      liferay-plugins-sdk-6.2/shared/portos-audit-shared/.classpath
  26. 243
      liferay-plugins-sdk-6.2/shared/portos-audit-shared/src/it/tref/liferay/portos/audit/shared/AttributesBuilder.java
  27. 314
      liferay-plugins-sdk-6.2/shared/portos-audit-shared/src/it/tref/liferay/portos/audit/shared/AuditModelListener.java
  28. 193
      liferay-plugins-sdk-6.2/shared/portos-audit-shared/src/it/tref/liferay/portos/audit/shared/AuditUtil.java
  29. 30
      liferay-plugins-sdk-6.2/shared/portos-audit-shared/src/it/tref/liferay/portos/audit/shared/permission/HistoryPermission.java
  30. 6
      liferay-plugins-sdk-6.2/shared/portos-audit-shared/src/it/tref/liferay/portos/audit/shared/util/Constants.java
  31. 7
      liferay-plugins-sdk-6.2/shared/portos-audit-shared/src/it/tref/liferay/portos/audit/shared/util/PortletKeys.java
  32. 140
      liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/bean/FirmeBean.java
  33. 1
      liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/protocollo/model/Fascicolo.java
  34. 177
      liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/protocollo/model/Protocollo.java
  35. 161
      liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/util/StatoPraticaConstants.java
  36. 2
      liferay-plugins-sdk-6.2/shared/portos-kaleo-shared/.classpath

BIN
liferay-plugins-sdk-6.2/hooks/portos-p7m-preview-hook/docroot/WEB-INF/lib/commons-logging.jar

File binario non mostrato.

BIN
liferay-plugins-sdk-6.2/hooks/portos-p7m-preview-hook/docroot/WEB-INF/lib/log4j.jar

File binario non mostrato.

BIN
liferay-plugins-sdk-6.2/hooks/portos-p7m-preview-hook/docroot/WEB-INF/lib/util-bridges.jar

File binario non mostrato.

BIN
liferay-plugins-sdk-6.2/hooks/portos-p7m-preview-hook/docroot/WEB-INF/lib/util-taglib.jar

File binario non mostrato.

21
liferay-plugins-sdk-6.2/hooks/portos-p7m-preview-hook/docroot/WEB-INF/src/it/tref/liferay/portlet/p7mpreview/P7mPreview.java

@ -1,6 +1,8 @@
package it.tref.liferay.portlet.p7mpreview;
import com.liferay.portal.kernel.lar.PortletDataContext;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.repository.model.FileEntry;
import com.liferay.portal.kernel.repository.model.FileVersion;
import com.liferay.portal.kernel.xml.Element;
@ -8,35 +10,34 @@ import com.liferay.portlet.documentlibrary.util.DLPreviewableProcessor;
import java.util.List;
public class P7mPreview extends DLPreviewableProcessor{
public class P7mPreview extends DLPreviewableProcessor {
Log _log = LogFactoryUtil.getLog(P7mPreview.class);
@Override
public void afterPropertiesSet() throws Exception {
// TODO Auto-generated method stub
}
@Override
public boolean isSupported(String mimeType) {
_log.info("isSupported(\"" + mimeType + "\"");
// TODO Auto-generated method stub
return false;
}
@Override
protected void doExportGeneratedFiles(
PortletDataContext portletDataContext, FileEntry fileEntry,
protected void doExportGeneratedFiles(PortletDataContext portletDataContext, FileEntry fileEntry,
Element fileEntryElement) throws Exception {
// TODO Auto-generated method stub
}
@Override
protected void doImportGeneratedFiles(
PortletDataContext portletDataContext, FileEntry fileEntry,
FileEntry importedFileEntry, Element fileEntryElement)
throws Exception {
protected void doImportGeneratedFiles(PortletDataContext portletDataContext, FileEntry fileEntry,
FileEntry importedFileEntry, Element fileEntryElement) throws Exception {
// TODO Auto-generated method stub
}
@Override

2
liferay-plugins-sdk-6.2/hooks/portos-p7m-preview-hook/ivy.xml.MD5

@ -1 +1 @@
875e1c4437fb71ef78ec054720f63e50
2c267788e15963b22e4e720e12f5611c

109
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/hook/CfOrganizationMembershipPolicy.java

@ -24,57 +24,62 @@ import com.liferay.portlet.asset.model.AssetTag;
public class CfOrganizationMembershipPolicy extends BaseOrganizationMembershipPolicy {
private static Log _log = LogFactoryUtil.getLog(CfOrganizationMembershipPolicy.class);
@Override
public void checkMembership(long[] userIds, long[] addOrganizationIds, long[] removeOrganizationIds) {}
@Override
public boolean isMembershipAllowed(long userId, long groupId) {
try {
Group group = GroupLocalServiceUtil.getGroup(groupId);
Company company = CompanyLocalServiceUtil.getCompany(group.getCompanyId());
String allowedCF = (String) company.getExpandoBridge().getAttribute(Constants.CF_ORGANIZATION_MEMBERSHIP, false);
List<String> allowedCFs = Arrays.asList(allowedCF.split("\\,"));
User user = UserLocalServiceUtil.getUser(userId);
if (allowedCFs.contains(user.getScreenName())) {
return true;
}
} catch (PortalException | SystemException e) {
_log.error(e, e);
}
return false;
}
@Override
public boolean isMembershipRequired(long userId, long groupId) {
return false;
}
@Override
public boolean isRoleAllowed(long userId, long groupId, long roleId) {
return true;
}
@Override
public boolean isRoleRequired(long userId, long groupId, long roleId) {
return false;
}
@Override
public void propagateMembership(long[] userIds, long[] addOrganizationIds, long[] removeOrganizationIds) {}
@Override
public void verifyPolicy(Organization organization) {}
@Override
public void verifyPolicy(Organization organization, Organization oldOrganization,
List<AssetCategory> oldAssetCategories, List<AssetTag> oldAssetTags,
Map<String, Serializable> oldExpandoAttributes) {}
private static Log _log = LogFactoryUtil.getLog(CfOrganizationMembershipPolicy.class);
@Override
public void checkMembership(long[] userIds, long[] addOrganizationIds, long[] removeOrganizationIds) {
}
@Override
public boolean isMembershipAllowed(long userId, long groupId) {
try {
Group group = GroupLocalServiceUtil.getGroup(groupId);
Company company = CompanyLocalServiceUtil.getCompany(group.getCompanyId());
String allowedCF = (String) company.getExpandoBridge().getAttribute(
Constants.CF_ORGANIZATION_MEMBERSHIP, false);
List<String> allowedCFs = Arrays.asList(allowedCF.split("\\,"));
User user = UserLocalServiceUtil.getUser(userId);
if (allowedCFs.contains(user.getScreenName())) {
return true;
}
} catch (PortalException | SystemException e) {
_log.error(e, e);
}
return false;
}
@Override
public boolean isMembershipRequired(long userId, long groupId) {
return false;
}
@Override
public boolean isRoleAllowed(long userId, long groupId, long roleId) {
return true;
}
@Override
public boolean isRoleRequired(long userId, long groupId, long roleId) {
return false;
}
@Override
public void propagateMembership(long[] userIds, long[] addOrganizationIds, long[] removeOrganizationIds) {
}
@Override
public void verifyPolicy(Organization organization) {
}
@Override
public void verifyPolicy(Organization organization, Organization oldOrganization,
List<AssetCategory> oldAssetCategories, List<AssetTag> oldAssetTags,
Map<String, Serializable> oldExpandoAttributes) {
}
}

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

@ -746,13 +746,19 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi
public Long calculateDateAvvioProcedimento(long controlloPraticaId) throws SystemException,
PortalException {
ControlloPratica controllo = ControlloPraticaLocalServiceUtil
.fetchControlloPratica(controlloPraticaId);
IntPratica pratica = IntPraticaLocalServiceUtil.fetchIntPratica(controllo.getIntPraticaId());
if (pratica.getStatoPratica().equalsIgnoreCase(StatoPraticaConstants.AUTORIZZATA)) {
return 0L;
}
Date apertura = pratica.getDtPratica();
Date chiusura = null;
long stop = 0;
long stop = 0L;
List<Avviso> avvisi = AvvisoLocalServiceUtil.findByIntPratica(pratica.getIntPraticaId(),
QueryUtil.ALL_POS, QueryUtil.ALL_POS, OrderByComparatorFactoryUtil
@ -764,35 +770,39 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi
for (Avviso avviso : avvisi) {
if (!avviso.isAnnullato()) {
String tipo = avviso.getTipoDocumento().toUpperCase();
_log.debug("Avviso " + avviso.getTipoDocumento() + " " + avviso.getDtAvviso() + " "
+ avviso.getCreateDate());
if (tipo.equals(StatoPraticaConstants.INTEGRAZIONE)) {
_log.debug("Avviso " + tipo + " " + avviso.getDtAvviso() + " " + avviso.getCreateDate());
switch (tipo) {
case StatoPraticaConstants.INTEGRAZIONE:
start = avviso.getCreateDate();
end = null;
if (Validator.isNotNull(chiusura)) {
apertura = avviso.getDtAvviso();
chiusura = null;
stop = 0;
stop = 0L;
_log.debug("Reset apertura al " + apertura);
}
_log.debug("IN start = " + start + ", pratica " + pratica.getNumeroProgetto());
} else if (tipo.equals(StatoPraticaConstants.VIDIMATA)) {
break;
case StatoPraticaConstants.VIDIMATA:
if (Validator.isNull(chiusura)) {
end = avviso.getCreateDate();
_log.debug(tipo + " end = " + end + ", pratica " + pratica.getNumeroProgetto());
} else {
apertura = avviso.getDtAvviso();
chiusura = start = end = null;
stop = 0;
stop = 0L;
_log.debug("Reset apertura al " + apertura);
}
} else if (tipo.equals(StatoPraticaConstants.INTEGRAZIONE_ACCETTATA)) {
break;
case StatoPraticaConstants.INTEGRAZIONE_ACCETTATA:
end = avviso.getCreateDate();
_log.debug(tipo + " end = " + end + ", pratica " + pratica.getNumeroProgetto());
} else if (tipo.equals(StatoPraticaConstants.AUTORIZZATA)
|| tipo.equals(StatoPraticaConstants.NON_AUTORIZZATA)) {
break;
case StatoPraticaConstants.AUTORIZZATA:
case StatoPraticaConstants.NON_AUTORIZZATA:
chiusura = avviso.getCreateDate();
_log.debug("Chiusura al " + chiusura);
break;
}
}
if (Validator.isNotNull(start) && Validator.isNotNull(end)) {

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

@ -184,12 +184,11 @@ public class DettPraticaServiceImpl extends DettPraticaServiceBaseImpl {
boolean normDprg01, boolean normDprg02, boolean normAnr, boolean normArt3com3,
boolean normArt3com4, boolean normOrd01, boolean normDm04, boolean normDm05, boolean normCI01,
boolean normLTC01, boolean suap, boolean normSismaBonus, String clRischioPreInt,
String clRischioPostInt, boolean intervFinPub, String intervFinPubDesc, boolean tcNuovaCostruzioneComplessa,
ServiceContext serviceContext, boolean bozza, boolean disabledSubmit, boolean geoDisabledSubmit)
throws PortalException, SystemException {
String clRischioPostInt, boolean intervFinPub, String intervFinPubDesc,
boolean tcNuovaCostruzioneComplessa, ServiceContext serviceContext, boolean bozza,
boolean disabledSubmit, boolean geoDisabledSubmit) throws PortalException, SystemException {
DettPratica dettPratica = null;
if (!disabledSubmit && DelegheUtil.hasDelegaCompilazioneDomanda(userId, dettPraticaId)) {
dettPratica = dettPraticaLocalService.updateDettPraticaDatiDomanda(userId, dettPraticaId,
@ -227,8 +226,8 @@ public class DettPraticaServiceImpl extends DettPraticaServiceBaseImpl {
normEsenteSpese, normDpr01Dep, normDpr02Dep, normDpr01Aut, normDpr02Aut, normDm01,
normDm02, normDm03, normDm2018, normDprg01, normDprg02, normAnr, normArt3com3,
normArt3com4, normOrd01, normDm04, normDm05, normCI01, normLTC01, suap, normSismaBonus,
clRischioPreInt, clRischioPostInt, intervFinPub, intervFinPubDesc, tcNuovaCostruzioneComplessa,
serviceContext, bozza);
clRischioPreInt, clRischioPostInt, intervFinPub, intervFinPubDesc,
tcNuovaCostruzioneComplessa, serviceContext, bozza);
}
if (!geoDisabledSubmit && DelegheUtil.hasDelegaCompilazioneSezioneGeologica(userId, dettPraticaId)) {

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

@ -13,8 +13,8 @@
##
build.namespace=portos_bo
build.number=2526
build.date=1608047904204
build.number=2533
build.date=1608199554355
build.auto.upgrade=true
##

9
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestioneattivita/view_columns.jspf

@ -60,7 +60,8 @@ DettPratica lastDettPratica = DettPraticaLocalServiceUtil.getLastCompletedByIntP
}
//Informazioni relative al workflow
WorkflowInstanceLink workflowInstanceLink = WorkflowInstanceLinkLocalServiceUtil.fetchWorkflowInstanceLink(
controlloPratica.getCompanyId(),controlloPratica.getGroupId(), ControlloPratica.class.getName(),controlloPratica.getPrimaryKey());
controlloPratica.getCompanyId(), controlloPratica.getGroupId(), ControlloPratica.class.getName(),
controlloPratica.getPrimaryKey());
List<WorkflowTask> listaTask = null;
WorkflowInstance workflowInstance = null;
@ -209,14 +210,16 @@ DettPratica lastDettPratica = DettPraticaLocalServiceUtil.getLastCompletedByIntP
<liferay-ui:search-container-column-text name="data-inizio-procedimento" value="<%= dateFormatDate.format(controlloPratica.getCreateDate()) %>" />
<liferay-ui:search-container-column-text name="provincia" >
<%=provincia.getProvincia()+" - "+comune.getDenominazione() %>
<%= provincia.getProvincia() + " - " + comune.getDenominazione() %>
</liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="GG*" cssClass="text-center">
<%
long days = ControlloPraticaLocalServiceUtil.calculateDateAvvioProcedimento(controlloPratica.getControlloPraticaId());
if (days > 0) {
out.print(days);
}
%>
<%=days %>
</liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-jsp path="/html/gestioneattivita/action_button.jsp" align="right" cssClass="text-center"/>

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

@ -909,7 +909,6 @@ public class FascicoloFePortlet extends MVCPortlet {
}
public void saveDettPratica(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
ServiceContext serviceContext = ServiceContextFactory.getInstance(DettPratica.class.getName(),
actionRequest);
long dettPraticaId = ParamUtil.getLong(actionRequest, "dettPraticaId");
@ -1341,7 +1340,8 @@ public class FascicoloFePortlet extends MVCPortlet {
boolean tcMiglioramentoSismico = ParamUtil.getBoolean(actionRequest, "tcMiglioramentoSismico");
boolean tcRiparazioneInterventoLocale = ParamUtil.getBoolean(actionRequest,
"tcRiparazioneInterventoLocale");
boolean tcNuovaCostruzioneComplessa = ParamUtil.getBoolean(actionRequest, "tcNuovaCostruzioneComplessa");
boolean tcNuovaCostruzioneComplessa = ParamUtil.getBoolean(actionRequest,
"tcNuovaCostruzioneComplessa");
boolean tcInCA = ParamUtil.getBoolean(actionRequest, "tcInCA");
boolean tcInOpera = ParamUtil.getBoolean(actionRequest, "tcInOpera");
@ -1590,7 +1590,8 @@ public class FascicoloFePortlet extends MVCPortlet {
normDpr02Dep, normDpr01Aut, normDpr02Aut, normDm01, normDm02, normDm03, normDm2018,
normDprg01, normDprg02, normAnr, normArt3com3, normArt3com4, normOrd01, normDm04,
normDm05, normCI01, normLTC01, suap, normSismaBonus, clRischioPreInt, clRischioPostInt,
intervFinPub, intervFinPubDesc, tcNuovaCostruzioneComplessa, serviceContext, bozza, disabledSubmit, geoDisabledSubmit);
intervFinPub, intervFinPubDesc, tcNuovaCostruzioneComplessa, serviceContext, bozza,
disabledSubmit, geoDisabledSubmit);
String redirect = ParamUtil.getString(actionRequest, "redirect");
if (Validator.isNull(redirect)) {
@ -1800,7 +1801,8 @@ public class FascicoloFePortlet extends MVCPortlet {
boolean tcMiglioramentoSismico = ParamUtil.getBoolean(actionRequest, "tcMiglioramentoSismico");
boolean tcRiparazioneInterventoLocale = ParamUtil.getBoolean(actionRequest,
"tcRiparazioneInterventoLocale");
boolean tcNuovaCostruzioneComplessa = ParamUtil.getBoolean(actionRequest, "tcNuovaCostruzioneComplessa");
boolean tcNuovaCostruzioneComplessa = ParamUtil.getBoolean(actionRequest,
"tcNuovaCostruzioneComplessa");
boolean tcInCA = ParamUtil.getBoolean(actionRequest, "tcInCA");
boolean tcInOpera = ParamUtil.getBoolean(actionRequest, "tcInOpera");
@ -2059,7 +2061,8 @@ public class FascicoloFePortlet extends MVCPortlet {
normDpr02Dep, normDpr01Aut, normDpr02Aut, normDm01, normDm02, normDm03, normDm2018,
normDprg01, normDprg02, normAnr, normArt3com3, normArt3com4, normOrd01, normDm04,
normDm05, normCI01, normLTC01, suap, normSismaBonus, clRischioPreInt, clRischioPostInt,
intervFinPub, intervFinPubDesc, tcNuovaCostruzioneComplessa, serviceContext, bozza, disabledSubmit, geoDisabledSubmit);
intervFinPub, intervFinPubDesc, tcNuovaCostruzioneComplessa, serviceContext, bozza,
disabledSubmit, geoDisabledSubmit);
String redirect = ParamUtil.getString(actionRequest, "redirect");
if (Validator.isNull(redirect)) {

46
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/allegatipratica/allegati_action.jsp

@ -1,5 +1,4 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.model.IntPratica"%>
@ -21,38 +20,37 @@
<%@include file="/html/allegatipratica/init.jsp"%>
<%
String redirect = ParamUtil.getString(request, "backUrl");
String comingFrom = ParamUtil.getString(request, "comingFrom");
long classPk = ParamUtil.getLong(request, "classPk");
String className = ParamUtil.getString(request, "className");
String redirect = ParamUtil.getString(request, "backUrl");
String comingFrom = ParamUtil.getString(request, "comingFrom");
long classPk = ParamUtil.getLong(request, "classPk");
String className = ParamUtil.getString(request, "className");
String refresh="Liferay.fire('allegati-"+comingFrom+"-open');Liferay.Portlet.refresh('#p_p_id_"+PortletKeys.ALLEGATI+"_INSTANCE_page_allegati_');Liferay.Portlet.refresh('#p_p_id_"+PortletKeys.ALLEGATI+"_INSTANCE_page_geologica_');";
String refresh="Liferay.fire('allegati-"+comingFrom+"-open');Liferay.Portlet.refresh('#p_p_id_"+PortletKeys.ALLEGATI+"_INSTANCE_page_allegati_');Liferay.Portlet.refresh('#p_p_id_"+PortletKeys.ALLEGATI+"_INSTANCE_page_geologica_');";
long docPraticaId = ParamUtil.getLong(request, "docPraticaId");
DocPratica docPratica = DocPraticaServiceUtil.getDocPratica(docPraticaId);
FirmeBean firme = FirmeUtil.deserialize(docPratica.getJsonFirmatari());
long docPraticaId = ParamUtil.getLong(request, "docPraticaId");
DocPratica docPratica = DocPraticaServiceUtil.getDocPratica(docPraticaId);
FirmeBean firme = FirmeUtil.deserialize(docPratica.getJsonFirmatari());
boolean disabledInput = ParamUtil.getBoolean(request,"disabledInput", false);
boolean disabledInput = ParamUtil.getBoolean(request,"disabledInput", false);
boolean hasDelegaFirma = DelegheUtil.hasDelegaFirma(user.getUserId(), docPraticaId, "page_geologica".equalsIgnoreCase(comingFrom));
boolean canSignGeoDocs = "page_geologica".equalsIgnoreCase(comingFrom) && hasDelegaFirma;
boolean hasDelegaFirma = DelegheUtil.hasDelegaFirma(user.getUserId(), docPraticaId, "page_geologica".equalsIgnoreCase(comingFrom));
boolean canSignGeoDocs = "page_geologica".equalsIgnoreCase(comingFrom) && hasDelegaFirma;
%>
<liferay-ui:icon-menu icon="" showExpanded="<%=true %>" showWhenSingleIcon="<%=true%>">
<c:if test="<%= docPratica.getClassPk()==classPk && hasDelegaFirma && (!disabledInput || canSignGeoDocs)%>">
<%
if(firme.firmaIsPresent(user.getScreenName())){
if(firme.firmaIsAnnullabile(user.getScreenName())){
%>
<%
if (firme.firmaIsPresent(user.getScreenName())) {
if (firme.firmaIsAnnullabile(user.getScreenName())) {
%>
<portlet:actionURL name="rimuoviFirma" var="rimuoviFirmaURL">
<portlet:param name="docPraticaId" value="<%=String.valueOf(docPraticaId) %>" />
<portlet:param name="comingFrom" value="<%=comingFrom %>" />
<portlet:param name="docPraticaId" value="<%= String.valueOf(docPraticaId) %>" />
<portlet:param name="comingFrom" value="<%= comingFrom %>" />
</portlet:actionURL>
<div title="Rimuovi firma" class="tooltip-info">
<liferay-ui:icon id='<%="remove_"+docPraticaId %>' linkCssClass="btn btn-danger" iconCssClass="fa fa-close" message="Rimuovi firma" url="javascript:void(0)"/>
<liferay-ui:icon id='<%="remove_" + docPraticaId %>' linkCssClass="btn btn-danger" iconCssClass="fa fa-close" message="Rimuovi firma" url="javascript:void(0)"/>
</div>
<aui:script use="aui-base,aui-io-request">
@ -89,8 +87,8 @@
</aui:script>
<%
}
}else{
}
} else {
%>
<portlet:actionURL name="aggiungiFirma" var="aggiungiFirmaURL">
<portlet:param name="docPraticaId" value="<%=String.valueOf(docPraticaId) %>" />
@ -133,14 +131,14 @@
</aui:script>
<%
}
}
%>
</c:if>
<c:choose>
<c:when test="<%= Validator.isNotNull(docPratica.getDlFileEntryId()) %>">
<div title="Scarica" class="tooltip-info">
<liferay-ui:icon message="Download" id='<%="download_"+docPraticaId %>' linkCssClass="btn btn-primary" iconCssClass="fa fa-download" url="<%=docPratica.getDownloadUrl(themeDisplay)%>"/>
<liferay-ui:icon message="Download" id='<%="download_" + docPraticaId %>' linkCssClass="btn btn-primary" iconCssClass="fa fa-download" url="<%=docPratica.getDownloadUrl(themeDisplay)%>"/>
</div>
</c:when>
<c:otherwise>

3
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/allegatipratica/view.jsp

@ -90,7 +90,6 @@ if (Validator.isNotNull(request.getParameter("disabled"))) {
Boolean hasDelegaCompilazioneDomanda = (Boolean) SessionUtil.getDettPraticaObject(request, classPk, "hasDelegaCompilazioneDomanda");
if (null == hasDelegaCompilazioneDomanda) {
hasDelegaCompilazioneDomanda = DelegheUtil.hasDelegaCompilazioneDomanda(user.getUserId(),classPk);
SessionUtil.setDettPraticaObject(request, classPk, "hasDelegaCompilazioneDomanda", hasDelegaCompilazioneDomanda);
}
disabledInput = !hasDelegaCompilazioneDomanda
&& !DelegheUtil.hasDelegaFirmaAllegati(user.getUserId(),classPk);
@ -429,7 +428,7 @@ for (String codiceDoc:tipologiaAllegati) {
<c:otherwise>
<c:if test="<%= !inBO %>">
<c:if test="<%= !disabledInput || canSignGeoDocs %>">
<liferay-util:include page="/html/allegatipratica/allegatWi_action.jsp"
<liferay-util:include page="/html/allegatipratica/allegati_action.jsp"
servletContext="<%= application %>">
<liferay-util:param name="backUrl" value="<%= currentURL %>" />
<liferay-util:param name="comingFrom" value="<%= comingFrom %>" />

4
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/allegatipratica/view_accordion.jsp

@ -1,6 +1,4 @@
<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.liferay.portal.kernel.log.LogFactoryUtil"%>
<%@page import="com.liferay.portal.kernel.log.Log"%>
<%@page import="it.tref.liferay.portos.bo.shared.util.PortletKeys"%>
<%@page import="it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.IntPraticaLocalService"%>
@ -43,7 +41,6 @@
<%@ include file="/html/allegatipratica/init.jsp"%>
<%
Log _log = LogFactoryUtil.getLog("view_accordion.jsp");
String comingFrom = ParamUtil.getString(request,"comingFrom",
GetterUtil.getString(
PortalUtil.getOriginalServletRequest(request).getParameter("page_allegati"),
@ -151,7 +148,6 @@
<%
for(DocPratica docPratica:docPraticas){
long docPraticaId = docPratica.getDocPraticaId();
_log.info("Processo docPratica id = "+docPraticaId);
%>
<tr>
<td class="text-center"><span

3
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/edit_fascicolo.jsp

@ -53,7 +53,8 @@ Boolean pagamentoIsEnable = ValidazionePraticaUtil.pagamentoIsEnable(dettPratica
SessionUtil.setDettPraticaObject(request, dettPraticaId, "pagamentoIsEnable", pagamentoIsEnable);
boolean disabledInput = !DelegheUtil.hasDelegaCompilazioneDomanda(user.getUserId(), dettPraticaId);
boolean geoDisabledInput = !hasDelegaCompilazioneDomanda || !praticaIsEditable;
boolean geoDisabledInput = !DelegheUtil.hasDelegaCompilazioneSezioneGeologica(user.getUserId(), dettPraticaId)
|| !praticaIsEditable;
String[] pageDatiDomanda = new String[] {
"page_dettagli_principali", "page_soggetti", "page_desc_edificio",

5
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/docroot/html/fascicolofe/navigator/header.jsp

@ -21,7 +21,10 @@ request.setAttribute("bean.dettPratica", dettPratica);
long soggettoId = ParamUtil.getLong(request, "soggettoId");
boolean disabledInput = ParamUtil.getBoolean(request, "disabledInput");
boolean inBO = ParamUtil.getBoolean(request, "inBO", false);
boolean praticaIsEditable = (Boolean) SessionUtil.getDettPraticaObject(request, dettPratica.getDettPraticaId(), "praticaIsEditable");
Boolean praticaIsEditable = (Boolean) SessionUtil.getDettPraticaObject(request, dettPratica.getDettPraticaId(), "praticaIsEditable");
if (null == praticaIsEditable) {
praticaIsEditable = ValidazionePraticaUtil.praticaIsEditable(dettPratica.getDettPraticaId());
}
boolean hasAsseverazioniAttive = AsseverazioniUtil.hasAsseverazioniAttive(dettPratica.getDettPraticaId());
%>

2
liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/build.xml

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

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

@ -1,6 +1,5 @@
package it.tref.liferay.portos.firma.action;
import com.liferay.portal.kernel.events.ActionException;
import com.liferay.portal.kernel.events.SimpleAction;
import com.liferay.portal.kernel.exception.PortalException;
@ -26,99 +25,103 @@ import com.liferay.portlet.expando.service.ExpandoTableLocalServiceUtil;
public class StartUpAction extends SimpleAction {
private final static Log _log = LogFactoryUtil.getLog(StartUpAction.class);
private final static Log _log = LogFactoryUtil.getLog(StartUpAction.class);
@Override
public void run(String[] companyIds) throws ActionException {
@Override
public void run(String[] companyIds) throws ActionException {
for (String id : companyIds) {
try {
long companyId = GetterUtil.getLong(id);
for (String id : companyIds) {
try {
long companyId = GetterUtil.getLong(id);
String[] defaultActions = {ActionKeys.VIEW, ActionKeys.UPDATE};
String[] guestActions = {ActionKeys.VIEW};
String[] defaultActions = { ActionKeys.VIEW, ActionKeys.UPDATE };
String[] guestActions = { ActionKeys.VIEW };
// Organization custom fields
addExpandoColumnIfNotExists(companyId, Company.class.getName(), "url_pdf_extractor",
ExpandoColumnConstants.STRING, true, false, defaultActions, guestActions);
addExpandoColumnIfNotExists(companyId, Company.class.getName(), "url-bo-gestione-pratica-firma",
ExpandoColumnConstants.STRING, true, false, defaultActions, guestActions);
} catch (Exception e) {
_log.error("Errore nella procedura automatizzata di configurazione", e);
}
}
}
// Organization custom fields
addExpandoColumnIfNotExists(companyId, Company.class.getName(), "url_pdf_extractor",
ExpandoColumnConstants.STRING, true, false, defaultActions, guestActions);
addExpandoColumnIfNotExists(companyId, Company.class.getName(),
"url-bo-gestione-pratica-firma", ExpandoColumnConstants.STRING, true, false,
defaultActions, guestActions);
} catch (Exception e) {
_log.error("Errore nella procedura automatizzata di configurazione", e);
}
}
}
private ExpandoColumn addExpandoColumnIfNotExists(long companyId, String className, String name, int type,
boolean indexed, boolean hidden, String[] defaultActions, String[] guestActions) throws SystemException {
private ExpandoColumn addExpandoColumnIfNotExists(long companyId, String className, String name,
int type, boolean indexed, boolean hidden, String[] defaultActions, String[] guestActions)
throws SystemException {
long classNameId = PortalUtil.getClassNameId(className);
long classNameId = PortalUtil.getClassNameId(className);
ExpandoTable expandoTable = null;
try {
expandoTable =
ExpandoTableLocalServiceUtil.getTable(companyId, classNameId, ExpandoTableConstants.DEFAULT_TABLE_NAME);
} catch (PortalException e) {
try {
expandoTable =
ExpandoTableLocalServiceUtil.addTable(companyId, classNameId, ExpandoTableConstants.DEFAULT_TABLE_NAME);
} catch (PortalException e1) {
}
}
ExpandoTable expandoTable = null;
try {
expandoTable = ExpandoTableLocalServiceUtil.getTable(companyId, classNameId,
ExpandoTableConstants.DEFAULT_TABLE_NAME);
} catch (PortalException e) {
try {
expandoTable = ExpandoTableLocalServiceUtil.addTable(companyId, classNameId,
ExpandoTableConstants.DEFAULT_TABLE_NAME);
} catch (PortalException e1) {
}
}
ExpandoColumn expandoColumn = ExpandoColumnLocalServiceUtil.getColumn(expandoTable.getTableId(), name);
ExpandoColumn expandoColumn = ExpandoColumnLocalServiceUtil
.getColumn(expandoTable.getTableId(), name);
if (expandoColumn == null) {
if (expandoColumn == null) {
try {
expandoColumn = ExpandoColumnLocalServiceUtil.addColumn(expandoTable.getTableId(), name, type);
try {
expandoColumn = ExpandoColumnLocalServiceUtil
.addColumn(expandoTable.getTableId(), name, type);
} catch (PortalException e) {
}
}
} catch (PortalException e) {
}
}
try {
try {
if (indexed) {
if (indexed) {
UnicodeProperties typeSettingsProperties = expandoColumn.getTypeSettingsProperties();
UnicodeProperties typeSettingsProperties = expandoColumn.getTypeSettingsProperties();
typeSettingsProperties.put(ExpandoColumnConstants.INDEX_TYPE,
String.valueOf(ExpandoColumnConstants.INDEX_TYPE_TEXT));
typeSettingsProperties.put(ExpandoColumnConstants.INDEX_TYPE,
String.valueOf(ExpandoColumnConstants.INDEX_TYPE_TEXT));
expandoColumn.setTypeSettingsProperties(typeSettingsProperties);
expandoColumn.setTypeSettingsProperties(typeSettingsProperties);
expandoColumn = ExpandoColumnLocalServiceUtil.updateExpandoColumn(expandoColumn);
}
expandoColumn = ExpandoColumnLocalServiceUtil.updateExpandoColumn(expandoColumn);
}
if (hidden) {
if (hidden) {
UnicodeProperties typeSettingsProperties = expandoColumn.getTypeSettingsProperties();
UnicodeProperties typeSettingsProperties = expandoColumn.getTypeSettingsProperties();
typeSettingsProperties.put(ExpandoColumnConstants.PROPERTY_HIDDEN, String.valueOf(1));
typeSettingsProperties.put(ExpandoColumnConstants.PROPERTY_HIDDEN, String.valueOf(1));
expandoColumn.setTypeSettingsProperties(typeSettingsProperties);
expandoColumn.setTypeSettingsProperties(typeSettingsProperties);
expandoColumn = ExpandoColumnLocalServiceUtil.updateExpandoColumn(expandoColumn);
}
expandoColumn = ExpandoColumnLocalServiceUtil.updateExpandoColumn(expandoColumn);
}
Role roleGuest = RoleLocalServiceUtil.getRole(companyId, RoleConstants.GUEST);
Role rolePowerUser = RoleLocalServiceUtil.getRole(companyId, RoleConstants.POWER_USER);
Role roleUser = RoleLocalServiceUtil.getRole(companyId, RoleConstants.USER);
Role roleGuest = RoleLocalServiceUtil.getRole(companyId, RoleConstants.GUEST);
Role rolePowerUser = RoleLocalServiceUtil.getRole(companyId, RoleConstants.POWER_USER);
Role roleUser = RoleLocalServiceUtil.getRole(companyId, RoleConstants.USER);
ResourcePermissionLocalServiceUtil.setResourcePermissions(companyId, ExpandoColumn.class.getName(),
ResourceConstants.SCOPE_INDIVIDUAL, String.valueOf(expandoColumn.getColumnId()), roleGuest.getRoleId(),
guestActions);
ResourcePermissionLocalServiceUtil.setResourcePermissions(companyId, ExpandoColumn.class.getName(),
ResourceConstants.SCOPE_INDIVIDUAL, String.valueOf(expandoColumn.getColumnId()), rolePowerUser.getRoleId(),
defaultActions);
ResourcePermissionLocalServiceUtil.setResourcePermissions(companyId, ExpandoColumn.class.getName(),
ResourceConstants.SCOPE_INDIVIDUAL, String.valueOf(expandoColumn.getColumnId()), roleUser.getRoleId(),
defaultActions);
} catch (PortalException e) {
}
ResourcePermissionLocalServiceUtil.setResourcePermissions(companyId,
ExpandoColumn.class.getName(), ResourceConstants.SCOPE_INDIVIDUAL,
String.valueOf(expandoColumn.getColumnId()), roleGuest.getRoleId(), guestActions);
ResourcePermissionLocalServiceUtil.setResourcePermissions(companyId,
ExpandoColumn.class.getName(), ResourceConstants.SCOPE_INDIVIDUAL,
String.valueOf(expandoColumn.getColumnId()), rolePowerUser.getRoleId(), defaultActions);
ResourcePermissionLocalServiceUtil.setResourcePermissions(companyId,
ExpandoColumn.class.getName(), ResourceConstants.SCOPE_INDIVIDUAL,
String.valueOf(expandoColumn.getColumnId()), roleUser.getRoleId(), defaultActions);
} catch (PortalException e) {
}
return expandoColumn;
}
return expandoColumn;
}
}

309
liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/servlet/FirmaServlet.java

@ -33,156 +33,161 @@ import javax.servlet.http.HttpServletResponse;
public class FirmaServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
private static final String GET_CONFIGURATION = "get-configuration"; // get
private static final String GET_FILE_LIST = "get-file-list"; // post
private static final String GET_FILE = "get-file"; // post
private static final String GET_TYPE = "get-type"; // get
private static final String GET_TYPE_VERBALE = "get-type-verbale"; // get
private static final String LOGIN = "login"; // get
private static final String OPEN_PRATICA = "open-pratica"; // post
private static final String RIFIUTA = "rifiuta"; // post
private static final String SET_FILE = "set-file"; // post
private static final String VERSION = "version"; // get
private static final String GET_STILE = "get-stile"; // get
private static final Log _log = LogFactoryUtil.getLog(FirmaServlet.class);
/**
* @see HttpServlet#HttpServlet()
*/
public FirmaServlet() {
super();
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String pathInfo = request.getPathInfo().substring(1);
String[] pathArray = StringUtil.split(pathInfo, "/");
FirmaGetUtil firmaGetUtil = new FirmaGetUtil();
String metodo = pathArray[0];
Risposta<?> risposta = new Risposta<>();
switch (metodo) {
case GET_CONFIGURATION:
risposta = firmaGetUtil.getConfiguration();
break;
case GET_TYPE:
risposta = firmaGetUtil.getType();
break;
case GET_TYPE_VERBALE:
risposta = firmaGetUtil.getTypeVerbale();
break;
case LOGIN:
if (pathArray.length == 2) {
String codiceFiscale = pathArray[1];
risposta = firmaGetUtil.loginCodiceFiscale(codiceFiscale);
}
if (pathArray.length == 3) {
String nome = pathArray[1];
String cognome = pathArray[2];
risposta = firmaGetUtil.loginNomeCognome(nome, cognome);
}
break;
case VERSION:
risposta = firmaGetUtil.version();
break;
case GET_STILE:
risposta = firmaGetUtil.getStile();
break;
}
JSONSerializer jsonSerializer = JSONFactoryUtil.createJSONSerializer();
jsonSerializer.exclude("*.class");
String jsonResponse = jsonSerializer.serializeDeep(risposta);
response.setContentType("application/json; charset=UTF-8");
ServletResponseUtil.write(response, jsonResponse);
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String pathInfo = request.getPathInfo().substring(1);
String[] pathArray = StringUtil.split(pathInfo, "/");
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
StreamUtil.transfer(request.getInputStream(), outputStream);
String token = new String(outputStream.toByteArray(), StandardCharsets.UTF_8);
FirmaPostUtil firmaPostUtil = new FirmaPostUtil();
String metodo = pathArray[0];
Risposta<?> risposta = new Risposta<>();
switch (metodo) {
case GET_FILE:
if (pathArray.length == 3) {
String tipo = pathArray[1];
String id = pathArray[2];
risposta = firmaPostUtil.getFile(token, tipo, id);
}
break;
case GET_FILE_LIST:
risposta = firmaPostUtil.getFileList(token);
break;
case OPEN_PRATICA:
if (pathArray.length == 2) {
String idFile = pathArray[1];
risposta = firmaPostUtil.openPratica(token, idFile);
}
break;
case RIFIUTA:
if (pathArray.length == 5) {
String idFile = pathArray[1];
String messaggio = pathArray[2];
String cambiaFase = pathArray[3];
String assegna = pathArray[4];
risposta = firmaPostUtil.rifiuta(token, idFile, messaggio, cambiaFase, assegna);
}
break;
case SET_FILE:
if (pathArray.length == 3) {
String tipo = pathArray[1];
String idFile = pathArray[2];
JSONDeserializer<Map<String, String>> jsonDeserializer = JSONFactoryUtil.createJSONDeserializer();
Map<String, String> map = jsonDeserializer.deserialize(token);
ServiceContext serviceContext = null;
try {
serviceContext = ServiceContextFactory.getInstance(request);
} catch (PortalException | SystemException e) {
_log.error(e.getMessage());
}
risposta = firmaPostUtil.setFile(map.get("token"), map.get("file"), tipo, idFile, serviceContext);
}
break;
}
JSONSerializer jsonSerializer = JSONFactoryUtil.createJSONSerializer();
jsonSerializer.exclude("*.class");
String jsonResponse = jsonSerializer.serialize(risposta);
response.setContentType("application/json; charset=UTF-8");
ServletResponseUtil.write(response, jsonResponse);
}
private static final long serialVersionUID = 1L;
private static final String GET_CONFIGURATION = "get-configuration"; // get
private static final String GET_FILE_LIST = "get-file-list"; // post
private static final String GET_FILE = "get-file"; // post
private static final String GET_TYPE = "get-type"; // get
private static final String GET_TYPE_VERBALE = "get-type-verbale"; // get
private static final String LOGIN = "login"; // get
private static final String OPEN_PRATICA = "open-pratica"; // post
private static final String RIFIUTA = "rifiuta"; // post
private static final String SET_FILE = "set-file"; // post
private static final String VERSION = "version"; // get
private static final String GET_STILE = "get-stile"; // get
private static final Log _log = LogFactoryUtil.getLog(FirmaServlet.class);
/**
* @see HttpServlet#HttpServlet()
*/
public FirmaServlet() {
super();
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse
* response)
*/
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException,
IOException {
String pathInfo = request.getPathInfo().substring(1);
String[] pathArray = StringUtil.split(pathInfo, "/");
FirmaGetUtil firmaGetUtil = new FirmaGetUtil();
String metodo = pathArray[0];
Risposta<?> risposta = new Risposta<>();
switch (metodo) {
case GET_CONFIGURATION:
risposta = firmaGetUtil.getConfiguration();
break;
case GET_TYPE:
risposta = firmaGetUtil.getType();
break;
case GET_TYPE_VERBALE:
risposta = firmaGetUtil.getTypeVerbale();
break;
case LOGIN:
if (pathArray.length == 2) {
String codiceFiscale = pathArray[1];
risposta = firmaGetUtil.loginCodiceFiscale(codiceFiscale);
}
if (pathArray.length == 3) {
String nome = pathArray[1];
String cognome = pathArray[2];
risposta = firmaGetUtil.loginNomeCognome(nome, cognome);
}
break;
case VERSION:
risposta = firmaGetUtil.version();
break;
case GET_STILE:
risposta = firmaGetUtil.getStile();
break;
}
JSONSerializer jsonSerializer = JSONFactoryUtil.createJSONSerializer();
jsonSerializer.exclude("*.class");
String jsonResponse = jsonSerializer.serializeDeep(risposta);
response.setContentType("application/json; charset=UTF-8");
ServletResponseUtil.write(response, jsonResponse);
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
* response)
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException,
IOException {
String pathInfo = request.getPathInfo().substring(1);
String[] pathArray = StringUtil.split(pathInfo, "/");
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
StreamUtil.transfer(request.getInputStream(), outputStream);
String token = new String(outputStream.toByteArray(), StandardCharsets.UTF_8);
FirmaPostUtil firmaPostUtil = new FirmaPostUtil();
String metodo = pathArray[0];
Risposta<?> risposta = new Risposta<>();
switch (metodo) {
case GET_FILE:
if (pathArray.length == 3) {
String tipo = pathArray[1];
String id = pathArray[2];
risposta = firmaPostUtil.getFile(token, tipo, id);
}
break;
case GET_FILE_LIST:
risposta = firmaPostUtil.getFileList(token);
break;
case OPEN_PRATICA:
if (pathArray.length == 2) {
String idFile = pathArray[1];
risposta = firmaPostUtil.openPratica(token, idFile);
}
break;
case RIFIUTA:
if (pathArray.length == 5) {
String idFile = pathArray[1];
String messaggio = pathArray[2];
String cambiaFase = pathArray[3];
String assegna = pathArray[4];
risposta = firmaPostUtil.rifiuta(token, idFile, messaggio, cambiaFase, assegna);
}
break;
case SET_FILE:
if (pathArray.length == 3) {
String tipo = pathArray[1];
String idFile = pathArray[2];
JSONDeserializer<Map<String, String>> jsonDeserializer = JSONFactoryUtil
.createJSONDeserializer();
Map<String, String> map = jsonDeserializer.deserialize(token);
ServiceContext serviceContext = null;
try {
serviceContext = ServiceContextFactory.getInstance(request);
} catch (PortalException | SystemException e) {
_log.error(e.getMessage());
}
risposta = firmaPostUtil.setFile(map.get("token"), map.get("file"), tipo, idFile,
serviceContext);
}
break;
}
JSONSerializer jsonSerializer = JSONFactoryUtil.createJSONSerializer();
jsonSerializer.exclude("*.class");
String jsonResponse = jsonSerializer.serialize(risposta);
response.setContentType("application/json; charset=UTF-8");
ServletResponseUtil.write(response, jsonResponse);
}
}

21
liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/util/ExtractorResponse.java

@ -3,19 +3,14 @@ package it.tref.liferay.portos.firma.util;
import java.util.List;
public class ExtractorResponse {
private boolean success;
private List<String> cf;
private boolean success;
private List<String> cf;
public boolean isSuccess() {
return success;
}
public List<String> getCf() {
return cf;
}
public boolean isSuccess() {
return success;
}
public List<String> getCf() {
return cf;
}
}

508
liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/util/FirmaPostUtil.java

@ -40,268 +40,248 @@ import org.apache.commons.io.IOUtils;
public class FirmaPostUtil {
private static final Log _log = LogFactoryUtil.getLog(FirmaPostUtil.class);
public Risposta<List<RestFile>> getFileList(String token) {
/**
* Verificare che il token sia il codice fiscale altrimenti c e un metodo che estre il cod fisc
* dal token userCodiceFiscalePrimaFirma = al cod fisc di Avviso...tipoAvviso = S &&
* fileEntryIdInvio = 0 && fileEntryIdBase != 0 && !rifiutato ( aggiungere campo al service e
* anche campo dtRifiuto) con il fileEntryIdBase prendo il file e uso per riempire lista di
* ritorno
*
* NEL RITORNO "tipoDocumento" è documenttype con intPraticaId faccio fetch su tabella
* intPratica e prendo campo tipopratica
*
*/
long[] companyIds = PortalUtil.getCompanyIds();
Risposta<List<RestFile>> risposta = new Risposta<List<RestFile>>();
for (long companyId : companyIds) {
Company company = null;
try {
company = CompanyLocalServiceUtil.getCompany(companyId);
} catch (Exception e) {
_log.error(e, e);
}
String urlPdfExtractor = (String) company.getExpandoBridge().getAttribute("url_pdf_extractor", false);
if (Validator.isNotNull(urlPdfExtractor)) {
byte[] fileArray = Base64.decode(token);
List<String> listaCodiciFiscali = FirmaUtil.getCodiceFiscale(fileArray, urlPdfExtractor);
String cf = listaCodiciFiscali.get(0);
List<RestFile> listaFile = new ArrayList<RestFile>();
// Ricordarsi di verificare che nel token ci sia il cod fisc in chiaro altrimenti va
// estratto
try {
// List<Avviso> listaAvvisi = AvvisoLocalServiceUtil.findByIntPratica(1001, -1, -1, null);
List<Avviso> listaAvvisi = AvvisoLocalServiceUtil.getListaAvvisiPerApplet(cf);
if (Validator.isNotNull(listaAvvisi) && listaAvvisi.size() > 0) {
for (Avviso avviso : listaAvvisi) {
if (Validator.isNotNull(avviso.getFileEntryIdBase())) {
DLFileEntry fileEntry = DLFileEntryLocalServiceUtil.fetchDLFileEntry(avviso.getFileEntryIdBase());
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(avviso.getIntPraticaId());
if (Validator.isNotNull(fileEntry)) {
RestFile restFile = new RestFile();
restFile.setIdFile(GetterUtil.getInteger(avviso.getAvvisoId()));
restFile.setDataInvio(new Date());
String tipoDocumento = avviso.translateTipoDocumento();
restFile.setDocumentiType(avviso.getTipoDocumento()); // TO-VERIFY
restFile.setNomeFile(LanguageUtil.get(Locale.ITALIAN, tipoDocumento) + StringPool.SPACE
+ StringPool.DASH + StringPool.SPACE + intPratica.getTitle(Locale.ITALIAN, true));
restFile.setFile("");
Group group = GroupLocalServiceUtil.getGroup(avviso.getGroupId());
Organization organization = OrganizationLocalServiceUtil.getOrganization(group.getOrganizationId());
restFile.setTipoPratica(organization.getName());
listaFile.add(restFile);
}
}
}
}
risposta.setObj(listaFile);
risposta.setRisposta(RispostaCostanti.OK);
} catch (Exception e) {
_log.error(e.getMessage(), e);
risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE);
}
}
}
return risposta;
}
public Risposta<RestFile> getFile(String token, String tipo, String id) {
/*
* verra passato l avviso id facciamo query per riprendere file entry e ritorniamo quel file con
* il contenuto
*/
Risposta<RestFile> risposta = new Risposta<RestFile>();
try {
Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(GetterUtil.getLong(id));
if (Validator.isNotNull(avviso)) {
if (Validator.isNotNull(avviso.getFileEntryIdBase())) {
DLFileEntry fileEntry = DLFileEntryLocalServiceUtil.fetchDLFileEntry(avviso.getFileEntryIdBase());
if (Validator.isNotNull(fileEntry)) {
RestFile restFile = new RestFile();
restFile.setIdFile(GetterUtil.getInteger(avviso.getAvvisoId()));
restFile.setDataInvio(new Date());
restFile.setDocumentiType(avviso.getTipoDocumento()); // TO-VERIFY
restFile.setNomeFile(fileEntry.getTitle() + StringPool.PERIOD + fileEntry.getExtension());
restFile.setTipoPratica(StringPool.BLANK);
// Recupero il tipo di pratica
/*
* if (Validator.isNotNull(avviso.getIntPraticaId())) { IntPratica intPratica =
* IntPraticaLocalServiceUtil.fetchIntPratica(avviso.getIntPraticaId()); if
* (Validator.isNotNull(intPratica)) {
* restFile.setTipoPratica(intPratica.getTipoPratica()); } }
*/
// Inserisco il contenuto del file in Base64
InputStream fileInputStream =
DLFileEntryLocalServiceUtil.getFileAsStream(fileEntry.getFileEntryId(), fileEntry.getVersion());
ByteArrayOutputStream bao = new ByteArrayOutputStream();
IOUtils.copy(fileInputStream, bao);
restFile.setFile(Base64.encode(bao.toByteArray()));
risposta.setRisposta(RispostaCostanti.OK);
risposta.setObj(restFile);
}
}
}
} catch (SystemException e) {
_log.error(e.getMessage(), e);
risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE);
} catch (PortalException e) {
_log.error(e.getMessage(), e);
risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE);
} catch (IOException e) {
_log.error(e.getMessage(), e);
risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE);
}
return risposta;
}
public Risposta<String> openPratica(String token, String idFile) {
/**
* mi arriva l'avviso id e mi recupero l intpraticaid bisogna ritornare ad una pagina privata di
* bo con la view sistemata per gestire direttamente la pratica portos-bo-portlet fascicolo
* portlet ..... intpraticaid
*/
Risposta<String> risposta = new Risposta<String>();
try {
Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(GetterUtil.getLong(idFile));
if (Validator.isNotNull(avviso)) {
// Prendo la url della pagina da ritornare settata nel expando custom field della company
// di riferimento e ci aggiungo nella url l attributo relativo all id della intPratica
Company company = CompanyLocalServiceUtil.fetchCompany(avviso.getCompanyId());
if (Validator.isNotNull(company)) {
String urlToBack =
GetterUtil.getString(company.getExpandoBridge().getAttribute("url-bo-gestione-pratica-firma", false));
urlToBack = urlToBack + "&_1_WAR_portosboportlet_intPraticaId=" + avviso.getIntPraticaId();
risposta.setObj(urlToBack);
risposta.setRisposta(RispostaCostanti.OK);
}
}
} catch (SystemException e) {
_log.error(e.getMessage(), e);
risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE);
}
return risposta;
}
public Risposta<Boolean> rifiuta(String token, String idFile, String messaggio, String cambiaFase, String assegna) {
/**
* mi arriva l'avviso id lo recupero e setto rifiutato e dtRifiuto e aggiorno
*
*
*/
Risposta<Boolean> risposta = new Risposta<Boolean>();
try {
Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(GetterUtil.getLong(idFile));
if (Validator.isNotNull(avviso)) {
avviso.setRifiutato(true);
avviso.setDtRifiuto(new Date());
avviso.setCommentoRifiuto(Validator.isNotNull(messaggio) ? messaggio : StringPool.BLANK);
AvvisoLocalServiceUtil.updateAvviso(avviso);
risposta.setObj(true);
risposta.setRisposta(RispostaCostanti.OK);
}
} catch (SystemException e) {
_log.error(e.getMessage(), e);
risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE);
}
return risposta;
}
public Risposta<Boolean> setFile(String token, String fileToSave, String tipo, String idFile,
ServiceContext serviceContext) {
/**
* Mi arriverà l avviso id e il contenuto e creero un file entry e aggiornero l avviso con il
* fileEntryIdInvio
*
* per la creazione del fileentry devo vedere SchedulerGeneraDocumento per creare il filename e
* la folder
*
*/
Risposta<Boolean> risposta = new Risposta<Boolean>();
try {
Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(GetterUtil.getLong(idFile));
if (Validator.isNotNull(avviso)) {
// CREO IL FILE
serviceContext.setCompanyId(avviso.getCompanyId());
serviceContext.setScopeGroupId(avviso.getGroupId());
serviceContext.setUserId(avviso.getUserId());
avviso =
AvvisoLocalServiceUtil
.addFileFirmato(avviso.getAvvisoId(), avviso.getClassPk(), fileToSave, serviceContext);
risposta.setObj(true);
risposta.setRisposta(RispostaCostanti.OK);
}
} catch (SystemException e) {
_log.error(e.getMessage(), e);
risposta.setObj(false);
risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE);
} catch (PortalException e) {
_log.error(e.getMessage(), e);
risposta.setObj(false);
risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE);
} catch (Exception e) {
_log.error(e.getMessage(), e);
risposta.setObj(false);
risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE);
}
return risposta;
}
private static final Log _log = LogFactoryUtil.getLog(FirmaPostUtil.class);
public Risposta<List<RestFile>> getFileList(String token) {
/**
* Verificare che il token sia il codice fiscale altrimenti c e un
* metodo che estre il cod fisc dal token userCodiceFiscalePrimaFirma =
* al cod fisc di Avviso...tipoAvviso = S && fileEntryIdInvio = 0 &&
* fileEntryIdBase != 0 && !rifiutato ( aggiungere campo al service e
* anche campo dtRifiuto) con il fileEntryIdBase prendo il file e uso
* per riempire lista di ritorno
*
* NEL RITORNO "tipoDocumento" è documenttype con intPraticaId faccio
* fetch su tabella intPratica e prendo campo tipopratica
*
*/
long[] companyIds = PortalUtil.getCompanyIds();
Risposta<List<RestFile>> risposta = new Risposta<List<RestFile>>();
for (long companyId : companyIds) {
Company company = null;
try {
company = CompanyLocalServiceUtil.getCompany(companyId);
} catch (Exception e) {
_log.error(e, e);
}
String urlPdfExtractor = (String) company.getExpandoBridge().getAttribute("url_pdf_extractor",
false);
if (Validator.isNotNull(urlPdfExtractor)) {
byte[] fileArray = Base64.decode(token);
List<String> listaCodiciFiscali = FirmaUtil.getCodiceFiscale(fileArray, urlPdfExtractor);
String cf = listaCodiciFiscali.get(0);
List<RestFile> listaFile = new ArrayList<RestFile>();
try {
List<Avviso> listaAvvisi = AvvisoLocalServiceUtil.getListaAvvisiPerApplet(cf);
if (Validator.isNotNull(listaAvvisi) && listaAvvisi.size() > 0) {
for (Avviso avviso : listaAvvisi) {
if (Validator.isNotNull(avviso.getFileEntryIdBase())) {
DLFileEntry fileEntry = DLFileEntryLocalServiceUtil.fetchDLFileEntry(avviso
.getFileEntryIdBase());
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(avviso
.getIntPraticaId());
if (Validator.isNotNull(fileEntry)) {
RestFile restFile = new RestFile();
restFile.setIdFile(GetterUtil.getInteger(avviso.getAvvisoId()));
restFile.setDataInvio(new Date());
String tipoDocumento = avviso.translateTipoDocumento();
restFile.setDocumentiType(avviso.getTipoDocumento()); // TO-VERIFY
restFile.setNomeFile(LanguageUtil.get(Locale.ITALIAN, tipoDocumento)
+ StringPool.SPACE + StringPool.DASH + StringPool.SPACE
+ intPratica.getTitle(Locale.ITALIAN, true));
restFile.setFile("");
Group group = GroupLocalServiceUtil.getGroup(avviso.getGroupId());
Organization organization = OrganizationLocalServiceUtil
.getOrganization(group.getOrganizationId());
restFile.setTipoPratica(organization.getName());
listaFile.add(restFile);
}
}
}
}
risposta.setObj(listaFile);
risposta.setRisposta(RispostaCostanti.OK);
} catch (Exception e) {
_log.error(e.getMessage(), e);
risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE);
}
}
}
return risposta;
}
public Risposta<RestFile> getFile(String token, String tipo, String id) {
/*
* verra passato l avviso id facciamo query per riprendere file entry e
* ritorniamo quel file con il contenuto
*/
Risposta<RestFile> risposta = new Risposta<RestFile>();
try {
Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(GetterUtil.getLong(id));
if (Validator.isNotNull(avviso)) {
if (Validator.isNotNull(avviso.getFileEntryIdBase())) {
DLFileEntry fileEntry = DLFileEntryLocalServiceUtil.fetchDLFileEntry(avviso
.getFileEntryIdBase());
if (Validator.isNotNull(fileEntry)) {
RestFile restFile = new RestFile();
restFile.setIdFile(GetterUtil.getInteger(avviso.getAvvisoId()));
restFile.setDataInvio(new Date());
restFile.setDocumentiType(avviso.getTipoDocumento()); // TO-VERIFY
restFile.setNomeFile(fileEntry.getTitle() + StringPool.PERIOD
+ fileEntry.getExtension());
restFile.setTipoPratica(StringPool.BLANK);
// Inserisco il contenuto del file in Base64
InputStream fileInputStream = DLFileEntryLocalServiceUtil.getFileAsStream(
fileEntry.getFileEntryId(), fileEntry.getVersion());
ByteArrayOutputStream bao = new ByteArrayOutputStream();
IOUtils.copy(fileInputStream, bao);
restFile.setFile(Base64.encode(bao.toByteArray()));
risposta.setRisposta(RispostaCostanti.OK);
risposta.setObj(restFile);
}
}
}
} catch (SystemException | PortalException | IOException e) {
_log.error(e.getMessage(), e);
risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE);
}
return risposta;
}
public Risposta<String> openPratica(String token, String idFile) {
/**
* mi arriva l'avviso id e mi recupero l intpraticaid bisogna ritornare
* ad una pagina privata di bo con la view sistemata per gestire
* direttamente la pratica portos-bo-portlet fascicolo portlet .....
* intpraticaid
*/
Risposta<String> risposta = new Risposta<String>();
try {
Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(GetterUtil.getLong(idFile));
if (Validator.isNotNull(avviso)) {
// Prendo la url della pagina da ritornare settata nel expando
// custom field della company
// di riferimento e ci aggiungo nella url l attributo relativo
// all id della intPratica
Company company = CompanyLocalServiceUtil.fetchCompany(avviso.getCompanyId());
if (Validator.isNotNull(company)) {
String urlToBack = GetterUtil.getString(company.getExpandoBridge().getAttribute(
"url-bo-gestione-pratica-firma", false));
urlToBack = urlToBack + "&_1_WAR_portosboportlet_intPraticaId="
+ avviso.getIntPraticaId();
risposta.setObj(urlToBack);
risposta.setRisposta(RispostaCostanti.OK);
}
}
} catch (SystemException e) {
_log.error(e.getMessage(), e);
risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE);
}
return risposta;
}
public Risposta<Boolean> rifiuta(String token, String idFile, String messaggio, String cambiaFase,
String assegna) {
/**
* mi arriva l'avviso id lo recupero e setto rifiutato e dtRifiuto e
* aggiorno
*
*
*/
Risposta<Boolean> risposta = new Risposta<Boolean>();
try {
Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(GetterUtil.getLong(idFile));
if (Validator.isNotNull(avviso)) {
avviso.setRifiutato(true);
avviso.setDtRifiuto(new Date());
avviso.setCommentoRifiuto(Validator.isNotNull(messaggio) ? messaggio : StringPool.BLANK);
AvvisoLocalServiceUtil.updateAvviso(avviso);
risposta.setObj(true);
risposta.setRisposta(RispostaCostanti.OK);
}
} catch (SystemException e) {
_log.error(e.getMessage(), e);
risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE);
}
return risposta;
}
public Risposta<Boolean> setFile(String token, String fileToSave, String tipo, String idFile,
ServiceContext serviceContext) {
/**
* Mi arriverà l avviso id e il contenuto e creero un file entry e
* aggiornero l avviso con il fileEntryIdInvio
*
* per la creazione del fileentry devo vedere SchedulerGeneraDocumento
* per creare il filename e la folder
*
*/
Risposta<Boolean> risposta = new Risposta<Boolean>();
try {
Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(GetterUtil.getLong(idFile));
if (Validator.isNotNull(avviso)) {
// CREO IL FILE
serviceContext.setCompanyId(avviso.getCompanyId());
serviceContext.setScopeGroupId(avviso.getGroupId());
serviceContext.setUserId(avviso.getUserId());
avviso = AvvisoLocalServiceUtil.addFileFirmato(avviso.getAvvisoId(), avviso.getClassPk(),
fileToSave, serviceContext);
risposta.setObj(true);
risposta.setRisposta(RispostaCostanti.OK);
}
} catch (Exception e) {
_log.error(e.getMessage(), e);
risposta.setObj(false);
risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE);
}
return risposta;
}
}

87
liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/firma/util/FirmaUtil.java

@ -25,65 +25,64 @@ import org.apache.http.impl.client.DefaultHttpClient;
public class FirmaUtil {
private static final Log _log = LogFactoryUtil.getLog(FirmaUtil.class);
private static final Log _log = LogFactoryUtil.getLog(FirmaUtil.class);
public static javax.portlet.PortletPreferences getPortletPreferences() {
public static javax.portlet.PortletPreferences getPortletPreferences() {
List<PortletPreferences> pr = null;
String preferencesXML;
javax.portlet.PortletPreferences jxPortletPreferences = null;
try {
pr =
PortletPreferencesLocalServiceUtil.getPortletPreferences(PortletKeys.PREFS_OWNER_TYPE_COMPANY, 0,
"firma_WAR_portosfirmaportlet");
preferencesXML = pr.get(0).getPreferences();
jxPortletPreferences = PortletPreferencesFactoryUtil.fromDefaultXML(preferencesXML);
} catch (SystemException e) {
_log.error(e.getMessage());
}
List<PortletPreferences> pr = null;
String preferencesXML;
javax.portlet.PortletPreferences jxPortletPreferences = null;
try {
pr = PortletPreferencesLocalServiceUtil.getPortletPreferences(
PortletKeys.PREFS_OWNER_TYPE_COMPANY, 0, "firma_WAR_portosfirmaportlet");
preferencesXML = pr.get(0).getPreferences();
jxPortletPreferences = PortletPreferencesFactoryUtil.fromDefaultXML(preferencesXML);
} catch (SystemException e) {
_log.error(e.getMessage());
}
return jxPortletPreferences;
}
return jxPortletPreferences;
}
public static List<String> getCodiceFiscale(byte[] fileArray, String urlPdfExtractor) {
public static List<String> getCodiceFiscale(byte[] fileArray, String urlPdfExtractor) {
List<String> listaCodiciFiscali = null;
try {
List<String> listaCodiciFiscali = null;
try {
File file = File.createTempFile("codicefiscale", ".p7m");
FileUtils.writeByteArrayToFile(file, fileArray);
File file = File.createTempFile("codicefiscale", ".p7m");
FileUtils.writeByteArrayToFile(file, fileArray);
ObjectMapper mapper = new ObjectMapper();
ObjectMapper mapper = new ObjectMapper();
// long companyId = CompanyThreadLocal.getCompanyId();
// long companyId = CompanyThreadLocal.getCompanyId();
ContentBody body = new FileBody(file);
ContentBody body = new FileBody(file);
MultipartEntity entity = new MultipartEntity();
entity.addPart("file", body);
MultipartEntity entity = new MultipartEntity();
entity.addPart("file", body);
HttpPost request = new HttpPost(urlPdfExtractor);
request.setEntity(entity);
HttpPost request = new HttpPost(urlPdfExtractor);
request.setEntity(entity);
HttpClient client = new DefaultHttpClient();
HttpResponse response = client.execute(request);
HttpClient client = new DefaultHttpClient();
HttpResponse response = client.execute(request);
if (response.getStatusLine().getStatusCode() != 200) {
throw new RuntimeException("Failed : HTTP error code : " + response.getStatusLine().getStatusCode());
}
InputStream inputStream = response.getEntity().getContent();
if (response.getStatusLine().getStatusCode() != 200) {
throw new RuntimeException("Failed : HTTP error code : "
+ response.getStatusLine().getStatusCode());
}
InputStream inputStream = response.getEntity().getContent();
ExtractorResponse extractorResponse = mapper.readValue(inputStream, ExtractorResponse.class);
ExtractorResponse extractorResponse = mapper.readValue(inputStream, ExtractorResponse.class);
if (extractorResponse.isSuccess()) {
listaCodiciFiscali = extractorResponse.getCf();
}
if (extractorResponse.isSuccess()) {
listaCodiciFiscali = extractorResponse.getCf();
}
} catch (IOException e) {
_log.error(e.getMessage());
}
} catch (IOException e) {
_log.error(e.getMessage());
}
return listaCodiciFiscali;
}
return listaCodiciFiscali;
}
}

2
liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/util/MailEngine.java

@ -59,7 +59,7 @@ import javax.mail.internet.MimeMultipart;
* @author Brian Wing Shun Chan
* @author Brian Myunghun Kim
* @author Jorge Ferrer
* @author Neil Griffin
* @author Neil Griffin<<
* @author Thiago Moreira
* @author Brett Swaim
*/

7
liferay-plugins-sdk-6.2/shared/portos-audit-shared/.classpath

@ -1,6 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.7.0_80"/>
<classpathentry kind="lib" path="/home/portos/bin/liferay-portal-6.2-ce-ga6/tomcat-7.0.62/lib/ext/portal-service.jar" sourcepath="/home/portos/sources/liferay-portal-src-6.2-ce-ga6">
<attributes>
<attribute name="javadoc_location" value="file:/home/portos/sources/liferay-javadocs-all/"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="classes"/>
</classpath>

243
liferay-plugins-sdk-6.2/shared/portos-audit-shared/src/it/tref/liferay/portos/audit/shared/AttributesBuilder.java

@ -19,139 +19,140 @@ import com.liferay.portal.kernel.util.Validator;
public class AttributesBuilder<T> {
private List<Attribute> _attributes = new ArrayList<Attribute>();
private T _newBean;
private T _oldBean;
public AttributesBuilder(T newBean, T oldBean) {
_newBean = newBean;
_oldBean = oldBean;
}
public void add(String name) {
DateFormat format = DateFormatFactoryUtil.getSimpleDateFormat("yyyy/MM/dd HH:mm z", TimeZone.getTimeZone("UTC"));
Object newValueObj = BeanPropertiesUtil.getObject(_newBean, name);
Object oldValueObj = BeanPropertiesUtil.getObject(_oldBean, name);
String newValue = null;
String oldValue = null;
if (Validator.isNotNull(newValueObj)) {
newValue = newValueObj instanceof Date ? format.format(newValueObj) : newValueObj.toString();
}
if (Validator.isNotNull(oldValueObj)) {
oldValue = oldValueObj instanceof Date ? format.format(oldValueObj) : oldValueObj.toString();
}
if (!Validator.equals(newValue, oldValue)) {
Attribute attribute = new Attribute(name, newValue, oldValue);
_attributes.add(attribute);
}
}
public void addLocalized(String name) {
DateFormat format = DateFormatFactoryUtil.getSimpleDateFormat("yyyy/MM/dd HH:mm z", TimeZone.getTimeZone("UTC"));
Object newValueObj = BeanPropertiesUtil.getObject(_newBean, name);
Object oldValueObj = BeanPropertiesUtil.getObject(_oldBean, name);
String newValue = null;
String oldValue = null;
if (Validator.isNotNull(newValueObj)) {
newValue = newValueObj instanceof Date ? format.format(newValueObj) : newValueObj.toString();
}
if (Validator.isNotNull(oldValueObj)) {
oldValue = oldValueObj instanceof Date ? format.format(oldValueObj) : oldValueObj.toString();
}
if (!Validator.equals(newValue, oldValue)) {
boolean createAttribute = false;
Map<Locale, String> newValueMap = LocalizationUtil.getLocalizationMap(newValue);
Map<Locale, String> oldValueMap = LocalizationUtil.getLocalizationMap(oldValue);
if (Validator.isNull(newValueMap) && Validator.isNotNull(oldValueMap)) {
createAttribute = true;
} else if (Validator.isNotNull(newValueMap) && Validator.isNull(oldValueMap)) {
createAttribute = true;
} else if (newValueMap.keySet().size() != oldValueMap.keySet().size()) {
createAttribute = true;
} else {
for (Locale locale : newValueMap.keySet()) {
if (!oldValueMap.keySet().contains(locale)) {
createAttribute = true;
break;
}
String newLocalizedValue = newValueMap.get(locale);
String oldLocalizedValue = oldValueMap.get(locale);
if (!Validator.equals(newLocalizedValue, oldLocalizedValue)) {
createAttribute = true;
break;
}
}
}
if (createAttribute) {
Attribute attribute = new Attribute(name, newValue, oldValue);
_attributes.add(attribute);
}
}
}
public JSONObject getAttributesJSON() {
JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
for (Attribute attribute : _attributes) {
JSONObject attributeJSONObject = JSONFactoryUtil.createJSONObject();
attributeJSONObject.put("name", attribute.getName());
attributeJSONObject.put("newValue", attribute.getNewValue());
attributeJSONObject.put("oldValue", attribute.getOldValue());
jsonArray.put(attributeJSONObject);
}
JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
jsonObject.put("attributes", jsonArray);
return jsonObject;
}
private List<Attribute> _attributes = new ArrayList<Attribute>();
private T _newBean;
private T _oldBean;
public AttributesBuilder(T newBean, T oldBean) {
_newBean = newBean;
_oldBean = oldBean;
}
public void add(String name) {
DateFormat format = DateFormatFactoryUtil.getSimpleDateFormat("yyyy/MM/dd HH:mm z",
TimeZone.getTimeZone("UTC"));
Object newValueObj = BeanPropertiesUtil.getObject(_newBean, name);
Object oldValueObj = BeanPropertiesUtil.getObject(_oldBean, name);
String newValue = null;
String oldValue = null;
if (Validator.isNotNull(newValueObj)) {
newValue = newValueObj instanceof Date ? format.format(newValueObj) : newValueObj.toString();
}
if (Validator.isNotNull(oldValueObj)) {
oldValue = oldValueObj instanceof Date ? format.format(oldValueObj) : oldValueObj.toString();
}
if (!Validator.equals(newValue, oldValue)) {
Attribute attribute = new Attribute(name, newValue, oldValue);
_attributes.add(attribute);
}
}
public void addLocalized(String name) {
DateFormat format = DateFormatFactoryUtil.getSimpleDateFormat("yyyy/MM/dd HH:mm z",
TimeZone.getTimeZone("UTC"));
Object newValueObj = BeanPropertiesUtil.getObject(_newBean, name);
Object oldValueObj = BeanPropertiesUtil.getObject(_oldBean, name);
String newValue = null;
String oldValue = null;
if (Validator.isNotNull(newValueObj)) {
newValue = newValueObj instanceof Date ? format.format(newValueObj) : newValueObj.toString();
}
if (Validator.isNotNull(oldValueObj)) {
oldValue = oldValueObj instanceof Date ? format.format(oldValueObj) : oldValueObj.toString();
}
if (!Validator.equals(newValue, oldValue)) {
boolean createAttribute = false;
Map<Locale, String> newValueMap = LocalizationUtil.getLocalizationMap(newValue);
Map<Locale, String> oldValueMap = LocalizationUtil.getLocalizationMap(oldValue);
if (Validator.isNull(newValueMap) && Validator.isNotNull(oldValueMap)) {
createAttribute = true;
} else if (Validator.isNotNull(newValueMap) && Validator.isNull(oldValueMap)) {
createAttribute = true;
} else if (newValueMap.keySet().size() != oldValueMap.keySet().size()) {
createAttribute = true;
} else {
for (Locale locale : newValueMap.keySet()) {
if (!oldValueMap.keySet().contains(locale)) {
createAttribute = true;
break;
}
String newLocalizedValue = newValueMap.get(locale);
String oldLocalizedValue = oldValueMap.get(locale);
if (!Validator.equals(newLocalizedValue, oldLocalizedValue)) {
createAttribute = true;
break;
}
}
}
if (createAttribute) {
Attribute attribute = new Attribute(name, newValue, oldValue);
_attributes.add(attribute);
}
}
}
public JSONObject getAttributesJSON() {
JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
for (Attribute attribute : _attributes) {
JSONObject attributeJSONObject = JSONFactoryUtil.createJSONObject();
attributeJSONObject.put("name", attribute.getName());
attributeJSONObject.put("newValue", attribute.getNewValue());
attributeJSONObject.put("oldValue", attribute.getOldValue());
jsonArray.put(attributeJSONObject);
}
JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
jsonObject.put("attributes", jsonArray);
return jsonObject;
}
}
class Attribute {
private String _name;
private String _newValue;
private String _oldValue;
private String _name;
private String _newValue;
private String _oldValue;
public Attribute(String name) {
public Attribute(String name) {
this(name, StringPool.BLANK, StringPool.BLANK);
}
this(name, StringPool.BLANK, StringPool.BLANK);
}
public Attribute(String name, String newValue, String oldValue) {
public Attribute(String name, String newValue, String oldValue) {
_name = name;
_newValue = newValue;
_oldValue = oldValue;
}
_name = name;
_newValue = newValue;
_oldValue = oldValue;
}
public String getName() {
public String getName() {
return _name;
}
return _name;
}
public String getNewValue() {
public String getNewValue() {
return _newValue;
}
return _newValue;
}
public String getOldValue() {
public String getOldValue() {
return _oldValue;
}
return _oldValue;
}
}

314
liferay-plugins-sdk-6.2/shared/portos-audit-shared/src/it/tref/liferay/portos/audit/shared/AuditModelListener.java

@ -16,158 +16,164 @@ import com.liferay.portal.model.BaseModelListener;
public abstract class AuditModelListener<T extends BaseModel<T>> extends BaseModelListener<T> {
@Override
public void onBeforeCreate(T model) throws ModelListenerException {
routeAuditMessage(Constants.ADD.toUpperCase(), model, getMessage(model), null, false);
}
@Override
public void onBeforeRemove(T model) throws ModelListenerException {
routeAuditMessage(Constants.DELETE.toUpperCase(), model, getMessage(model), null, false);
}
@Override
public void onBeforeUpdate(T newModel) throws ModelListenerException {
try {
T oldModel = getOldModel(newModel);
JSONObject attributes = getModifiedAttributes(newModel, oldModel);
JSONArray array = attributes.getJSONArray("attributes");
boolean isUpdate = true;
if (array != null) {
for (int i = 0; i < array.length(); i++) {
String name = array.getJSONObject(i).getString("name");
String newValue = array.getJSONObject(i).getString("newValue");
if (name.equalsIgnoreCase(getStatoAttributesName())) {
routeAuditMessage(convertStatoToEventString(newValue), newModel, getMessage(newModel), attributes, true);
if (array.length() == 1) {
isUpdate = false;
}
}
attributes.remove(getStatoAttributesName());
}
}
if (isUpdate) {
boolean sended =
routeAuditMessage(Constants.UPDATE.toUpperCase(), newModel, getMessage(newModel), attributes, false);
if (sended) {
onBeforeRealUpdate(newModel, oldModel);
}
}
} catch (Exception e) {
throw new ModelListenerException(e);
}
}
protected String convertStatoToEventString(String newValue) {
if ("1".equalsIgnoreCase(newValue) || "true".equalsIgnoreCase(newValue)) {
return Constants.ATTIVA.toUpperCase();
} else {
return Constants.DISATTIVA.toUpperCase();
}
}
protected String getStatoAttributesName() {
return "valido";
}
protected String getStatoAttivaString() {
return "1";
}
protected abstract T getOldModel(T newModel) throws ModelListenerException;
protected List<String> getExcludedFields() {
List<String> esclusioni = new ArrayList<String>() {
{
add("modifiedDate");
add("createDate");
}
};
return esclusioni;
}
protected JSONObject getModifiedAttributes(T newRelazioniAnagrafiche, T oldRelazioniAnagrafiche) {
AttributesBuilder<T> attributesBuilder = new AttributesBuilder<T>(newRelazioniAnagrafiche, oldRelazioniAnagrafiche);
Map<String, Object> model = newRelazioniAnagrafiche.getModelAttributes();
Iterator<String> modelList = model.keySet().iterator();
while (modelList.hasNext()) {
String name = (String) modelList.next();
if (!getExcludedFields().contains(name)) {
attributesBuilder.add(name);
}
}
return attributesBuilder.getAttributesJSON();
}
protected boolean routeAuditMessage(String eventAction, T model, String message, JSONObject additionalInfo,
boolean cambiostato) throws ModelListenerException {
String className = getClassName(model);
if (cambiostato) {
AuditUtil.doCambioStato(getEventType(model), className, (Long) model.getPrimaryKeyObj(), message,
getEventCategory(model), eventAction);
onBeforeCambioStato(model);
return true;
} else if (additionalInfo == null) {
AuditUtil.doLog(getEventType(model), className, (Long) model.getPrimaryKeyObj(), message,
getEventCategory(model), eventAction, getParentClassName(model), getParentClassPk(model),
getRelatedClassName(model), getRelatedClassPk(model), getAdditionalInfoForLogEvent(eventAction, model));
onBeforeLog(model);
return true;
} else {
return AuditUtil.doStorico(getEventType(model), className, (Long) model.getPrimaryKeyObj(), message,
getEventCategory(model), eventAction, getParentClassName(model), getParentClassPk(model),
getRelatedClassName(model), getRelatedClassPk(model), additionalInfo, null);
}
}
protected JSONObject getAdditionalInfoForLogEvent(String eventAction, T model) {
return null;
}
protected void onBeforeRealUpdate(T newModel, T oldModel) throws ModelListenerException {}
protected void onBeforeLog(T model) throws ModelListenerException {}
protected void onBeforeCambioStato(T model) throws ModelListenerException {}
protected Long getParentClassPk(T model) {
return 0l;
}
protected String getParentClassName(T model) {
return StringPool.BLANK;
}
protected Long getRelatedClassPk(T model) {
return 0l;
}
protected String getRelatedClassName(T model) {
return StringPool.BLANK;
}
protected String getMessage(T model) {
return StringPool.BLANK;
}
protected abstract String getClassName(T model);
protected abstract String getEventType(T model);
protected abstract String getEventCategory(T model);
@Override
public void onBeforeCreate(T model) throws ModelListenerException {
routeAuditMessage(Constants.ADD.toUpperCase(), model, getMessage(model), null, false);
}
@Override
public void onBeforeRemove(T model) throws ModelListenerException {
routeAuditMessage(Constants.DELETE.toUpperCase(), model, getMessage(model), null, false);
}
@Override
public void onBeforeUpdate(T newModel) throws ModelListenerException {
try {
T oldModel = getOldModel(newModel);
JSONObject attributes = getModifiedAttributes(newModel, oldModel);
JSONArray array = attributes.getJSONArray("attributes");
boolean isUpdate = true;
if (array != null) {
for (int i = 0; i < array.length(); i++) {
String name = array.getJSONObject(i).getString("name");
String newValue = array.getJSONObject(i).getString("newValue");
if (name.equalsIgnoreCase(getStatoAttributesName())) {
routeAuditMessage(convertStatoToEventString(newValue), newModel,
getMessage(newModel), attributes, true);
if (array.length() == 1) {
isUpdate = false;
}
}
attributes.remove(getStatoAttributesName());
}
}
if (isUpdate) {
boolean sended = routeAuditMessage(Constants.UPDATE.toUpperCase(), newModel,
getMessage(newModel), attributes, false);
if (sended) {
onBeforeRealUpdate(newModel, oldModel);
}
}
} catch (Exception e) {
throw new ModelListenerException(e);
}
}
protected String convertStatoToEventString(String newValue) {
if ("1".equalsIgnoreCase(newValue) || "true".equalsIgnoreCase(newValue)) {
return Constants.ATTIVA.toUpperCase();
} else {
return Constants.DISATTIVA.toUpperCase();
}
}
protected String getStatoAttributesName() {
return "valido";
}
protected String getStatoAttivaString() {
return "1";
}
protected abstract T getOldModel(T newModel) throws ModelListenerException;
protected List<String> getExcludedFields() {
List<String> esclusioni = new ArrayList<String>() {
{
add("modifiedDate");
add("createDate");
}
};
return esclusioni;
}
protected JSONObject getModifiedAttributes(T newRelazioniAnagrafiche, T oldRelazioniAnagrafiche) {
AttributesBuilder<T> attributesBuilder = new AttributesBuilder<T>(newRelazioniAnagrafiche,
oldRelazioniAnagrafiche);
Map<String, Object> model = newRelazioniAnagrafiche.getModelAttributes();
Iterator<String> modelList = model.keySet().iterator();
while (modelList.hasNext()) {
String name = (String) modelList.next();
if (!getExcludedFields().contains(name)) {
attributesBuilder.add(name);
}
}
return attributesBuilder.getAttributesJSON();
}
protected boolean routeAuditMessage(String eventAction, T model, String message,
JSONObject additionalInfo, boolean cambiostato) throws ModelListenerException {
String className = getClassName(model);
if (cambiostato) {
AuditUtil.doCambioStato(getEventType(model), className, (Long) model.getPrimaryKeyObj(), message,
getEventCategory(model), eventAction);
onBeforeCambioStato(model);
return true;
} else if (additionalInfo == null) {
AuditUtil.doLog(getEventType(model), className, (Long) model.getPrimaryKeyObj(), message,
getEventCategory(model), eventAction, getParentClassName(model), getParentClassPk(model),
getRelatedClassName(model), getRelatedClassPk(model),
getAdditionalInfoForLogEvent(eventAction, model));
onBeforeLog(model);
return true;
} else {
return AuditUtil.doStorico(getEventType(model), className, (Long) model.getPrimaryKeyObj(),
message, getEventCategory(model), eventAction, getParentClassName(model),
getParentClassPk(model), getRelatedClassName(model), getRelatedClassPk(model),
additionalInfo, null);
}
}
protected JSONObject getAdditionalInfoForLogEvent(String eventAction, T model) {
return null;
}
protected void onBeforeRealUpdate(T newModel, T oldModel) throws ModelListenerException {
}
protected void onBeforeLog(T model) throws ModelListenerException {
}
protected void onBeforeCambioStato(T model) throws ModelListenerException {
}
protected Long getParentClassPk(T model) {
return 0l;
}
protected String getParentClassName(T model) {
return StringPool.BLANK;
}
protected Long getRelatedClassPk(T model) {
return 0l;
}
protected String getRelatedClassName(T model) {
return StringPool.BLANK;
}
protected String getMessage(T model) {
return StringPool.BLANK;
}
protected abstract String getClassName(T model);
protected abstract String getEventType(T model);
protected abstract String getEventCategory(T model);
}

193
liferay-plugins-sdk-6.2/shared/portos-audit-shared/src/it/tref/liferay/portos/audit/shared/AuditUtil.java

@ -16,99 +16,102 @@ import com.liferay.portal.util.PortalUtil;
public class AuditUtil {
public static void doLog(String eventType, String className, long classPK) throws ModelListenerException {
doLog(eventType, className, classPK, StringPool.BLANK);
}
public static void doLog(String eventType, String className, long classPK, String message)
throws ModelListenerException {
doLog(eventType, className, classPK, message, StringPool.BLANK, StringPool.BLANK, StringPool.BLANK, 0l,
StringPool.BLANK, 0l, null);
}
public static void doLog(String eventType, String className, long classPK, String message, String eventCategory,
String eventAction, String parentClassName, Long parentClassPK, String relatedClassName, Long relatedClassPK,
JSONObject additionalInfo) throws ModelListenerException {
doAudit(eventType, className, classPK, message, AuditKey.EVENT_TABLE_LOG, eventCategory, eventAction,
parentClassName, parentClassPK, relatedClassName, relatedClassPK, null, additionalInfo);
}
public static boolean doStorico(String eventType, String className, long classPK, String message,
String eventCategory, String eventAction, String parentClassName, Long parentClassPK, String relatedClassName,
Long relatedClassPK, JSONObject diff, JSONObject additionalInfo) throws ModelListenerException {
if (diff != null && !diff.isNull("attributes") && diff.getJSONArray("attributes").length() > 0) {
doAudit(eventType, className, classPK, message, AuditKey.EVENT_TABLE_STORICO, eventCategory, eventAction,
parentClassName, parentClassPK, relatedClassName, relatedClassPK, diff, additionalInfo);
return true;
} else {
return false;
}
}
public static void doCambioStato(String eventType, String className, long classPK, String message,
String eventCategory, String eventAction) throws ModelListenerException {
doAudit(eventType, className, classPK, message, AuditKey.EVENT_TABLE_CAMBIO_STATO, eventCategory, eventAction,
StringPool.BLANK, 0l, StringPool.BLANK, 0l, null, null);
}
private static void doAudit(String eventType, String className, long classPK, String message, String auditEventTable,
String eventCategory, String eventAction, String parentClassName, Long parentClassPK, String relatedClassName,
Long relatedClassPK, JSONObject diff, JSONObject additionalInfo) throws ModelListenerException {
try {
if (additionalInfo == null)
additionalInfo = JSONFactoryUtil.createJSONObject();
addIfNotNull(additionalInfo, AuditKey.FIELD_AUDIT_EVENT_TABLE, auditEventTable);
addIfNotNull(additionalInfo, AuditKey.FIELD_EVENT_CATEGORY, eventCategory);
addIfNotNull(additionalInfo, AuditKey.FIELD_EVENT_ACTION, eventAction);
addIfNotNull(additionalInfo, AuditKey.FIELD_PARENT_CLASS_NAME, parentClassName);
addIfNotNull(additionalInfo, AuditKey.FIELD_PARENT_CLASS_PK, parentClassPK);
addIfNotNull(additionalInfo, AuditKey.FIELD_RELATED_CLASS_NAME, relatedClassName);
addIfNotNull(additionalInfo, AuditKey.FIELD_RELATED_CLASS_PK, relatedClassPK);
if (diff != null) {
additionalInfo.put(AuditKey.FIELD_DIFF, diff);
}
long companyId = CompanyThreadLocal.getCompanyId();
long userId = 0;
if (PrincipalThreadLocal.getName() != null) {
userId = GetterUtil.getLong(PrincipalThreadLocal.getName());
}
AuditRequestThreadLocal auditRequestThreadLocal = AuditRequestThreadLocal.getAuditThreadLocal();
long realUserId = auditRequestThreadLocal.getRealUserId();
String realUserName = PortalUtil.getUserName(realUserId, StringPool.BLANK);
if ((realUserId > 0) && (userId != realUserId)) {
additionalInfo.put("doAsUserId", String.valueOf(userId));
additionalInfo.put("doAsUserName", PortalUtil.getUserName(userId, StringPool.BLANK));
}
AuditMessage auditMessage =
new AuditMessage(eventType, companyId, realUserId, realUserName, className, String.valueOf(classPK), message,
additionalInfo);
AuditRouterUtil.route(auditMessage);
} catch (PortalException e) {
throw new ModelListenerException(e);
}
}
private static void addIfNotNull(JSONObject additionalInfo, String key, String value) {
if (Validator.isNotNull(value)) {
additionalInfo.put(key, value);
}
}
private static void addIfNotNull(JSONObject additionalInfo, String key, Long value) {
if (Validator.isNotNull(value)) {
additionalInfo.put(key, value);
}
}
public static void doLog(String eventType, String className, long classPK) throws ModelListenerException {
doLog(eventType, className, classPK, StringPool.BLANK);
}
public static void doLog(String eventType, String className, long classPK, String message)
throws ModelListenerException {
doLog(eventType, className, classPK, message, StringPool.BLANK, StringPool.BLANK, StringPool.BLANK,
0l, StringPool.BLANK, 0l, null);
}
public static void doLog(String eventType, String className, long classPK, String message,
String eventCategory, String eventAction, String parentClassName, Long parentClassPK,
String relatedClassName, Long relatedClassPK, JSONObject additionalInfo)
throws ModelListenerException {
doAudit(eventType, className, classPK, message, AuditKey.EVENT_TABLE_LOG, eventCategory, eventAction,
parentClassName, parentClassPK, relatedClassName, relatedClassPK, null, additionalInfo);
}
public static boolean doStorico(String eventType, String className, long classPK, String message,
String eventCategory, String eventAction, String parentClassName, Long parentClassPK,
String relatedClassName, Long relatedClassPK, JSONObject diff, JSONObject additionalInfo)
throws ModelListenerException {
if (diff != null && !diff.isNull("attributes") && diff.getJSONArray("attributes").length() > 0) {
doAudit(eventType, className, classPK, message, AuditKey.EVENT_TABLE_STORICO, eventCategory,
eventAction, parentClassName, parentClassPK, relatedClassName, relatedClassPK, diff,
additionalInfo);
return true;
} else {
return false;
}
}
public static void doCambioStato(String eventType, String className, long classPK, String message,
String eventCategory, String eventAction) throws ModelListenerException {
doAudit(eventType, className, classPK, message, AuditKey.EVENT_TABLE_CAMBIO_STATO, eventCategory,
eventAction, StringPool.BLANK, 0l, StringPool.BLANK, 0l, null, null);
}
private static void doAudit(String eventType, String className, long classPK, String message,
String auditEventTable, String eventCategory, String eventAction, String parentClassName,
Long parentClassPK, String relatedClassName, Long relatedClassPK, JSONObject diff,
JSONObject additionalInfo) throws ModelListenerException {
try {
if (additionalInfo == null)
additionalInfo = JSONFactoryUtil.createJSONObject();
addIfNotNull(additionalInfo, AuditKey.FIELD_AUDIT_EVENT_TABLE, auditEventTable);
addIfNotNull(additionalInfo, AuditKey.FIELD_EVENT_CATEGORY, eventCategory);
addIfNotNull(additionalInfo, AuditKey.FIELD_EVENT_ACTION, eventAction);
addIfNotNull(additionalInfo, AuditKey.FIELD_PARENT_CLASS_NAME, parentClassName);
addIfNotNull(additionalInfo, AuditKey.FIELD_PARENT_CLASS_PK, parentClassPK);
addIfNotNull(additionalInfo, AuditKey.FIELD_RELATED_CLASS_NAME, relatedClassName);
addIfNotNull(additionalInfo, AuditKey.FIELD_RELATED_CLASS_PK, relatedClassPK);
if (diff != null) {
additionalInfo.put(AuditKey.FIELD_DIFF, diff);
}
long companyId = CompanyThreadLocal.getCompanyId();
long userId = 0;
if (PrincipalThreadLocal.getName() != null) {
userId = GetterUtil.getLong(PrincipalThreadLocal.getName());
}
AuditRequestThreadLocal auditRequestThreadLocal = AuditRequestThreadLocal.getAuditThreadLocal();
long realUserId = auditRequestThreadLocal.getRealUserId();
String realUserName = PortalUtil.getUserName(realUserId, StringPool.BLANK);
if ((realUserId > 0) && (userId != realUserId)) {
additionalInfo.put("doAsUserId", String.valueOf(userId));
additionalInfo.put("doAsUserName", PortalUtil.getUserName(userId, StringPool.BLANK));
}
AuditMessage auditMessage = new AuditMessage(eventType, companyId, realUserId, realUserName,
className, String.valueOf(classPK), message, additionalInfo);
AuditRouterUtil.route(auditMessage);
} catch (PortalException e) {
throw new ModelListenerException(e);
}
}
private static void addIfNotNull(JSONObject additionalInfo, String key, String value) {
if (Validator.isNotNull(value)) {
additionalInfo.put(key, value);
}
}
private static void addIfNotNull(JSONObject additionalInfo, String key, Long value) {
if (Validator.isNotNull(value)) {
additionalInfo.put(key, value);
}
}
}

30
liferay-plugins-sdk-6.2/shared/portos-audit-shared/src/it/tref/liferay/portos/audit/shared/permission/HistoryPermission.java

@ -9,25 +9,25 @@ import com.liferay.portal.security.permission.PermissionChecker;
public class HistoryPermission {
public static final String RESOURCE_NAME = "it.tref.liferay.portos.audit.history";
public static final String RESOURCE_NAME = "it.tref.liferay.portos.audit.history";
public static void check(PermissionChecker permissionChecker, long groupId, String actionId) throws PortalException {
public static void check(PermissionChecker permissionChecker, long groupId, String actionId)
throws PortalException {
if (!contains(permissionChecker, groupId, actionId)) {
throw new PrincipalException();
}
}
if (!contains(permissionChecker, groupId, actionId)) {
throw new PrincipalException();
}
}
public static boolean contains(PermissionChecker permissionChecker, long groupId, String actionId) {
public static boolean contains(PermissionChecker permissionChecker, long groupId, String actionId) {
Boolean hasPermission =
StagingPermissionUtil.hasPermission(permissionChecker, groupId, RESOURCE_NAME, groupId,
PortletKeys.AUDIT_DETAIL, actionId);
Boolean hasPermission = StagingPermissionUtil.hasPermission(permissionChecker, groupId,
RESOURCE_NAME, groupId, PortletKeys.AUDIT_DETAIL, actionId);
if (hasPermission != null) {
return hasPermission.booleanValue();
}
if (hasPermission != null) {
return hasPermission.booleanValue();
}
return permissionChecker.hasPermission(groupId, RESOURCE_NAME, groupId, actionId);
}
return permissionChecker.hasPermission(groupId, RESOURCE_NAME, groupId, actionId);
}
}

6
liferay-plugins-sdk-6.2/shared/portos-audit-shared/src/it/tref/liferay/portos/audit/shared/util/Constants.java

@ -1,8 +1,6 @@
package it.tref.liferay.portos.audit.shared.util;
public class Constants implements com.liferay.portal.kernel.util.Constants {
public static final String ATTIVA = "ATTIVA";
public static final String DISATTIVA = "DISATTIVA";
public static final String ATTIVA = "ATTIVA";
public static final String DISATTIVA = "DISATTIVA";
}

7
liferay-plugins-sdk-6.2/shared/portos-audit-shared/src/it/tref/liferay/portos/audit/shared/util/PortletKeys.java

@ -1,9 +1,6 @@
package it.tref.liferay.portos.audit.shared.util;
public class PortletKeys extends com.liferay.portal.util.PortletKeys {
public static final String AUDIT = "1_WAR_portosauditportlet";
public static final String AUDIT_DETAIL = "2_WAR_portosauditportlet";
public static final String AUDIT = "1_WAR_portosauditportlet";
public static final String AUDIT_DETAIL = "2_WAR_portosauditportlet";
}

140
liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/bean/FirmeBean.java

@ -8,87 +8,87 @@ import java.util.List;
public class FirmeBean implements Serializable {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
private List<FirmeDetail> firmeDigitali = new UniqueList<FirmeDetail>();
private List<FirmeDetail> firmeApplicativo = new UniqueList<FirmeDetail>();
private List<FirmeDetail> firmeDigitali = new UniqueList<FirmeDetail>();
private List<FirmeDetail> firmeApplicativo = new UniqueList<FirmeDetail>();
public List<FirmeDetail> getFirmeDigitali() {
return new UnmodifiableList<>(firmeDigitali);
}
public List<FirmeDetail> getFirmeDigitali() {
return new UnmodifiableList<>(firmeDigitali);
}
public void setFirmeDigitali(List<FirmeDetail> firmeDigitali) {
this.firmeDigitali = new UniqueList<FirmeDetail>();
for (FirmeDetail firmaDigitale : firmeDigitali) {
this.firmeDigitali.add(firmaDigitale);
}
}
public void setFirmeDigitali(List<FirmeDetail> firmeDigitali) {
this.firmeDigitali = new UniqueList<FirmeDetail>();
for (FirmeDetail firmaDigitale : firmeDigitali) {
this.firmeDigitali.add(firmaDigitale);
}
}
public List<FirmeDetail> getFirmeApplicativo() {
return new UnmodifiableList<>(firmeApplicativo);
}
public List<FirmeDetail> getFirmeApplicativo() {
return new UnmodifiableList<>(firmeApplicativo);
}
public void setFirmeApplicativo(List<FirmeDetail> firmeApplicativo) {
this.firmeApplicativo = new UniqueList<FirmeDetail>();
for (FirmeDetail firmaApplicativo : firmeApplicativo) {
this.firmeApplicativo.add(firmaApplicativo);
}
}
public void setFirmeApplicativo(List<FirmeDetail> firmeApplicativo) {
this.firmeApplicativo = new UniqueList<FirmeDetail>();
for (FirmeDetail firmaApplicativo : firmeApplicativo) {
this.firmeApplicativo.add(firmaApplicativo);
}
}
public boolean firmaIsPresent(String codiceFiscale) {
for (FirmeDetail firmaDigitale : firmeDigitali) {
if (firmaDigitale.getCfFirmatario().equalsIgnoreCase(codiceFiscale)) {
return true;
}
}
for (FirmeDetail firmaApplicativo : firmeApplicativo) {
if (firmaApplicativo.getCfFirmatario().equalsIgnoreCase(codiceFiscale)) {
return true;
}
}
return false;
}
public boolean firmaIsPresent(String codiceFiscale) {
for (FirmeDetail firmaDigitale : firmeDigitali) {
if (firmaDigitale.getCfFirmatario().equalsIgnoreCase(codiceFiscale)) {
return true;
}
}
for (FirmeDetail firmaApplicativo : firmeApplicativo) {
if (firmaApplicativo.getCfFirmatario().equalsIgnoreCase(codiceFiscale)) {
return true;
}
}
return false;
}
public boolean firmaIsAnnullabile(String codiceFiscale) {
for (FirmeDetail firmaApplicativo : firmeApplicativo) {
if (firmaApplicativo.getCfFirmatario().equalsIgnoreCase(codiceFiscale)) {
return true;
}
}
return false;
}
public boolean firmaIsAnnullabile(String codiceFiscale) {
for (FirmeDetail firmaApplicativo : firmeApplicativo) {
if (firmaApplicativo.getCfFirmatario().equalsIgnoreCase(codiceFiscale)) {
return true;
}
}
return false;
}
public int numeroFirme() {
List<String> allSignatures = allSignatures();
return allSignatures.size();
}
public int numeroFirme() {
List<String> allSignatures = allSignatures();
return allSignatures.size();
}
public List<String> allSignatures() {
List<String> all = new UniqueList<String>();
for (FirmeDetail firmaDigitale : firmeDigitali) {
all.add(firmaDigitale.getCfFirmatario().toLowerCase());
}
for (FirmeDetail firmaApplicativo : firmeApplicativo) {
all.add(firmaApplicativo.getCfFirmatario().toLowerCase());
}
return all;
}
public List<String> allSignatures() {
List<String> all = new UniqueList<String>();
for (FirmeDetail firmaDigitale : firmeDigitali) {
all.add(firmaDigitale.getCfFirmatario().toLowerCase());
}
for (FirmeDetail firmaApplicativo : firmeApplicativo) {
all.add(firmaApplicativo.getCfFirmatario().toLowerCase());
}
return all;
}
public List<FirmeDetail> allFirmeDetails() {
List<FirmeDetail> all = new UniqueList<FirmeDetail>();
all.addAll(firmeDigitali);
all.addAll(firmeApplicativo);
return all;
}
public List<FirmeDetail> allFirmeDetails() {
List<FirmeDetail> all = new UniqueList<FirmeDetail>();
all.addAll(firmeDigitali);
all.addAll(firmeApplicativo);
return all;
}
public void removeFirmeApplicativo(String codiceFiscale) {
FirmeDetail firmeDetailToRemove = null;
for (FirmeDetail firmeDetail : firmeApplicativo) {
if (codiceFiscale.equalsIgnoreCase(firmeDetail.getCfFirmatario())) {
firmeDetailToRemove = firmeDetail;
break;
}
}
public void removeFirmeApplicativo(String codiceFiscale) {
FirmeDetail firmeDetailToRemove = null;
for (FirmeDetail firmeDetail : firmeApplicativo) {
if (codiceFiscale.equalsIgnoreCase(firmeDetail.getCfFirmatario())) {
firmeDetailToRemove = firmeDetail;
break;
}
}
firmeApplicativo.remove(firmeDetailToRemove);
}
}

1
liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/protocollo/model/Fascicolo.java

@ -3,7 +3,6 @@ package it.tref.liferay.portos.bo.shared.protocollo.model;
public class Fascicolo {
private int anno;
private int numero;
public Fascicolo() {}

177
liferay-plugins-sdk-6.2/shared/portos-bo-shared/src/it/tref/liferay/portos/bo/shared/protocollo/model/Protocollo.java

@ -5,105 +5,80 @@ import java.util.List;
public class Protocollo {
public enum TipoProtocollo {
INGRESSO,
USCITA
}
private Date dataInserimento;
private boolean chiuso;
private String ufficioId;
private String praticaId;
private String utenteId;
private String oggetto;
private TipoProtocollo tipo;
private List<File> files;
public boolean isChiuso() {
return chiuso;
}
public void setChiuso(boolean chiuso) {
this.chiuso = chiuso;
}
public String getUfficioId() {
return ufficioId;
}
public void setUfficioId(String ufficioId) {
this.ufficioId = ufficioId;
}
public String getUtenteId() {
return utenteId;
}
public void setUtenteId(String utenteId) {
this.utenteId = utenteId;
}
public String getOggetto() {
return oggetto;
}
public void setOggetto(String oggetto) {
this.oggetto = oggetto;
}
public TipoProtocollo getTipo() {
return tipo;
}
public void setTipo(TipoProtocollo tipo) {
this.tipo = tipo;
}
public List<File> getFiles() {
return files;
}
public void setFiles(List<File> files) {
this.files = files;
}
public String getPraticaId() {
return praticaId;
}
public void setPraticaId(String praticaId) {
this.praticaId = praticaId;
}
public Date getDataInserimento() {
return dataInserimento;
}
public void setDataInserimento(Date dataInserimento) {
this.dataInserimento = dataInserimento;
}
public enum TipoProtocollo {
INGRESSO, USCITA
}
private Date dataInserimento;
private boolean chiuso;
private String ufficioId;
private String praticaId;
private String utenteId;
private String oggetto;
private TipoProtocollo tipo;
private List<File> files;
public boolean isChiuso() {
return chiuso;
}
public void setChiuso(boolean chiuso) {
this.chiuso = chiuso;
}
public String getUfficioId() {
return ufficioId;
}
public void setUfficioId(String ufficioId) {
this.ufficioId = ufficioId;
}
public String getUtenteId() {
return utenteId;
}
public void setUtenteId(String utenteId) {
this.utenteId = utenteId;
}
public String getOggetto() {
return oggetto;
}
public void setOggetto(String oggetto) {
this.oggetto = oggetto;
}
public TipoProtocollo getTipo() {
return tipo;
}
public void setTipo(TipoProtocollo tipo) {
this.tipo = tipo;
}
public List<File> getFiles() {
return files;
}
public void setFiles(List<File> files) {
this.files = files;
}
public String getPraticaId() {
return praticaId;
}
public void setPraticaId(String praticaId) {
this.praticaId = praticaId;
}
public Date getDataInserimento() {
return dataInserimento;
}
public void setDataInserimento(Date dataInserimento) {
this.dataInserimento = dataInserimento;
}
}

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

@ -3,91 +3,84 @@ package it.tref.liferay.portos.bo.shared.util;
import java.util.LinkedHashMap;
import java.util.Map;
public class StatoPraticaConstants {
public final static String SORTEGGIATA = "SO";
public final static String SOTTOPOSTA_A_PARERE = "SP";
public final static String RIFIUTATA = "RI";
public final static String VIDIMATA = "VI";
public final static String CONFORME = "CO";
public final static String NON_CONFORME = "NC";
public final static String INTEGRAZIONE = "IN";
public final static String VARIATA = "VA";
public static final String FINE_LAVORI = "FL";
public static final String COLLAUDO = "CL";
public static final String FINE_LAVORI_PARZIALE = "FP";
public static final String COLLAUDO_PARZIALE = "CP";
public static final String ANNULLATA = "AL";
// public static final String INTEGRAZIONE_RIFIUTATA = "NI";
public static final String INTEGRAZIONE_ACCETTATA = "SI";
/* Stati "virtuali" */
public static final String CAMBIO_ISTRUTTORE = "CI";
public final static String AUTORIZZATA = "AU";
public final static String NON_AUTORIZZATA = "AN";
public final static String ANNULLA_ISTANZA = "AI";
public final static String VARIAZIONE_SOGGETTI = "VS";
// public static final String ASSEGNATA = "AS";
// public static final String ATTESA_FIRMA = "AF";
// public static final String APPROVAZIONE = "AP";
// public static final String FINE_LAVORI_CON_ANOMALIA = "FA";
private static final Map<String, String> statusLabel;
private static final Map<String, String> statusFilterLabel;
static {
statusLabel = new LinkedHashMap<String, String>();
statusLabel.put(StatoPraticaConstants.SORTEGGIATA, "label.admingeniocivile.statopratica.sorteggiata");
statusLabel.put(StatoPraticaConstants.SOTTOPOSTA_A_PARERE, "label.admingeniocivile.statopratica.sottopostaaparere");
statusLabel.put(StatoPraticaConstants.VIDIMATA, "label.admingeniocivile.statopratica.vidimata");
statusLabel.put(StatoPraticaConstants.CONFORME, "label.admingeniocivile.statopratica.conforme");
statusLabel.put(StatoPraticaConstants.NON_CONFORME, "label.admingeniocivile.statopratica.nonconforme");
statusLabel.put(StatoPraticaConstants.AUTORIZZATA, "label.admingeniocivile.statopratica.autorizzazione");
statusLabel.put(StatoPraticaConstants.NON_AUTORIZZATA, "label.admingeniocivile.statopratica.autorizzazionenegata");
statusLabel.put(StatoPraticaConstants.INTEGRAZIONE, "label.admingeniocivile.statopratica.integrazione");
statusLabel.put(StatoPraticaConstants.RIFIUTATA, "label.admingeniocivile.statopratica.rifiutata");
statusLabel.put(StatoPraticaConstants.FINE_LAVORI, "label.admingeniocivile.statopratica.finelavori");
statusLabel.put(StatoPraticaConstants.COLLAUDO, "label.admingeniocivile.statopratica.collaudo");
statusLabel.put(StatoPraticaConstants.FINE_LAVORI_PARZIALE,
"label.admingeniocivile.statopratica.finelavoriparziale");
statusLabel.put(StatoPraticaConstants.COLLAUDO_PARZIALE, "label.admingeniocivile.statopratica.collaudoparziale");
statusLabel.put(StatoPraticaConstants.ANNULLATA, "label.admingeniocivile.statopratica.annullata");
statusLabel.put(StatoPraticaConstants.CAMBIO_ISTRUTTORE, "label.admingeniocivile.statopratica.cambiIstruttore");
// statusLabel.put(StatoPraticaConstants.ASSEGNATA,
// "label.admingeniocivile.statopratica.assegnata");
// statusLabel.put(StatoPraticaConstants.ATTESA_FIRMA,
// "label.admingeniocivile.statopratica.attesafirma");
// statusLabel.put(StatoPraticaConstants.APPROVAZIONE,
// "label.admingeniocivile.statopratica.approvazione");
// statusLabel.put(StatoPraticaConstants.FINE_LAVORI_CON_ANOMALIA,
// "label.admingeniocivile.statopratica.finelavorianomalia");
statusFilterLabel = new LinkedHashMap<String, String>();
for (String statoPratica : statusLabel.keySet()) {
if (/* !statoPratica.equals(StatoPraticaConstants.FINE_LAVORI_CON_ANOMALIA) && */
!statoPratica.equals(StatoPraticaConstants.SORTEGGIATA)) {
statusFilterLabel.put(statoPratica, statusLabel.get(statoPratica));
}
}
}
public static String getStatusLabel(String statoPratica) {
return getStatusLabelMap().get(statoPratica);
}
public static Map<String, String> getStatusLabelMap() {
return statusLabel;
}
public final static String SORTEGGIATA = "SO";
public final static String SOTTOPOSTA_A_PARERE = "SP";
public final static String RIFIUTATA = "RI";
public final static String VIDIMATA = "VI";
public final static String CONFORME = "CO";
public final static String NON_CONFORME = "NC";
public final static String INTEGRAZIONE = "IN";
public final static String VARIATA = "VA";
public static final String FINE_LAVORI = "FL";
public static final String COLLAUDO = "CL";
public static final String FINE_LAVORI_PARZIALE = "FP";
public static final String COLLAUDO_PARZIALE = "CP";
public static final String ANNULLATA = "AL";
public static final String INTEGRAZIONE_ACCETTATA = "SI";
/* Stati "virtuali" */
public static final String CAMBIO_ISTRUTTORE = "CI";
public final static String AUTORIZZATA = "AU";
public final static String NON_AUTORIZZATA = "AN";
public final static String ANNULLA_ISTANZA = "AI";
public final static String VARIAZIONE_SOGGETTI = "VS";
public static final String INVIO_AVVISO_MANUALE = "MA";
private static final Map<String, String> statusLabel;
private static final Map<String, String> statusFilterLabel;
static {
statusLabel = new LinkedHashMap<String, String>();
statusLabel.put(StatoPraticaConstants.SORTEGGIATA, "label.admingeniocivile.statopratica.sorteggiata");
statusLabel.put(StatoPraticaConstants.SOTTOPOSTA_A_PARERE,
"label.admingeniocivile.statopratica.sottopostaaparere");
statusLabel.put(StatoPraticaConstants.VIDIMATA, "label.admingeniocivile.statopratica.vidimata");
statusLabel.put(StatoPraticaConstants.CONFORME, "label.admingeniocivile.statopratica.conforme");
statusLabel
.put(StatoPraticaConstants.NON_CONFORME, "label.admingeniocivile.statopratica.nonconforme");
statusLabel.put(StatoPraticaConstants.AUTORIZZATA,
"label.admingeniocivile.statopratica.autorizzazione");
statusLabel.put(StatoPraticaConstants.NON_AUTORIZZATA,
"label.admingeniocivile.statopratica.autorizzazionenegata");
statusLabel.put(StatoPraticaConstants.INTEGRAZIONE,
"label.admingeniocivile.statopratica.integrazione");
statusLabel.put(StatoPraticaConstants.RIFIUTATA, "label.admingeniocivile.statopratica.rifiutata");
statusLabel.put(StatoPraticaConstants.FINE_LAVORI, "label.admingeniocivile.statopratica.finelavori");
statusLabel.put(StatoPraticaConstants.COLLAUDO, "label.admingeniocivile.statopratica.collaudo");
statusLabel.put(StatoPraticaConstants.FINE_LAVORI_PARZIALE,
"label.admingeniocivile.statopratica.finelavoriparziale");
statusLabel.put(StatoPraticaConstants.COLLAUDO_PARZIALE,
"label.admingeniocivile.statopratica.collaudoparziale");
statusLabel.put(StatoPraticaConstants.ANNULLATA, "label.admingeniocivile.statopratica.annullata");
statusLabel.put(StatoPraticaConstants.CAMBIO_ISTRUTTORE,
"label.admingeniocivile.statopratica.cambiIstruttore");
statusFilterLabel = new LinkedHashMap<String, String>();
for (String statoPratica : statusLabel.keySet()) {
if (!statoPratica.equals(StatoPraticaConstants.SORTEGGIATA)) {
statusFilterLabel.put(statoPratica, statusLabel.get(statoPratica));
}
}
}
public static String getStatusLabel(String statoPratica) {
return getStatusLabelMap().get(statoPratica);
}
public static Map<String, String> getStatusLabelMap() {
return statusLabel;
}
}

2
liferay-plugins-sdk-6.2/shared/portos-kaleo-shared/.classpath

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.7.0_80"/>
<classpathentry kind="lib" path="/home/portos/bin/liferay-portal-6.2-ce-ga6/tomcat-7.0.62/lib/ext/portal-service.jar" sourcepath="/home/portos/sources/liferay-portal-src-6.2-ce-ga6">
<attributes>
<attribute name="javadoc_location" value="file:/home/portos/sources/liferay-javadocs-all/"/>

Caricamento…
Annulla
Salva