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; package it.tref.liferay.portlet.p7mpreview;
import com.liferay.portal.kernel.lar.PortletDataContext; 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.FileEntry;
import com.liferay.portal.kernel.repository.model.FileVersion; import com.liferay.portal.kernel.repository.model.FileVersion;
import com.liferay.portal.kernel.xml.Element; import com.liferay.portal.kernel.xml.Element;
@ -8,35 +10,34 @@ import com.liferay.portlet.documentlibrary.util.DLPreviewableProcessor;
import java.util.List; import java.util.List;
public class P7mPreview extends DLPreviewableProcessor{ public class P7mPreview extends DLPreviewableProcessor {
Log _log = LogFactoryUtil.getLog(P7mPreview.class);
@Override @Override
public void afterPropertiesSet() throws Exception { public void afterPropertiesSet() throws Exception {
// TODO Auto-generated method stub // TODO Auto-generated method stub
} }
@Override @Override
public boolean isSupported(String mimeType) { public boolean isSupported(String mimeType) {
_log.info("isSupported(\"" + mimeType + "\"");
// TODO Auto-generated method stub // TODO Auto-generated method stub
return false; return false;
} }
@Override @Override
protected void doExportGeneratedFiles( protected void doExportGeneratedFiles(PortletDataContext portletDataContext, FileEntry fileEntry,
PortletDataContext portletDataContext, FileEntry fileEntry,
Element fileEntryElement) throws Exception { Element fileEntryElement) throws Exception {
// TODO Auto-generated method stub // TODO Auto-generated method stub
} }
@Override @Override
protected void doImportGeneratedFiles( protected void doImportGeneratedFiles(PortletDataContext portletDataContext, FileEntry fileEntry,
PortletDataContext portletDataContext, FileEntry fileEntry, FileEntry importedFileEntry, Element fileEntryElement) throws Exception {
FileEntry importedFileEntry, Element fileEntryElement)
throws Exception {
// TODO Auto-generated method stub // TODO Auto-generated method stub
} }
@Override @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 { public class CfOrganizationMembershipPolicy extends BaseOrganizationMembershipPolicy {
private static Log _log = LogFactoryUtil.getLog(CfOrganizationMembershipPolicy.class); private static Log _log = LogFactoryUtil.getLog(CfOrganizationMembershipPolicy.class);
@Override @Override
public void checkMembership(long[] userIds, long[] addOrganizationIds, long[] removeOrganizationIds) {} public void checkMembership(long[] userIds, long[] addOrganizationIds, long[] removeOrganizationIds) {
}
@Override
public boolean isMembershipAllowed(long userId, long groupId) { @Override
public boolean isMembershipAllowed(long userId, long groupId) {
try {
Group group = GroupLocalServiceUtil.getGroup(groupId); try {
Company company = CompanyLocalServiceUtil.getCompany(group.getCompanyId()); Group group = GroupLocalServiceUtil.getGroup(groupId);
String allowedCF = (String) company.getExpandoBridge().getAttribute(Constants.CF_ORGANIZATION_MEMBERSHIP, false); Company company = CompanyLocalServiceUtil.getCompany(group.getCompanyId());
String allowedCF = (String) company.getExpandoBridge().getAttribute(
List<String> allowedCFs = Arrays.asList(allowedCF.split("\\,")); Constants.CF_ORGANIZATION_MEMBERSHIP, false);
User user = UserLocalServiceUtil.getUser(userId); List<String> allowedCFs = Arrays.asList(allowedCF.split("\\,"));
if (allowedCFs.contains(user.getScreenName())) {
return true; User user = UserLocalServiceUtil.getUser(userId);
} if (allowedCFs.contains(user.getScreenName())) {
return true;
} catch (PortalException | SystemException e) { }
_log.error(e, e);
} } catch (PortalException | SystemException e) {
_log.error(e, e);
return false; }
}
return false;
@Override }
public boolean isMembershipRequired(long userId, long groupId) {
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 isRoleAllowed(long userId, long groupId, long roleId) {
return true;
@Override }
public boolean isRoleRequired(long userId, long groupId, long roleId) {
return false; @Override
} public boolean isRoleRequired(long userId, long groupId, long roleId) {
return false;
@Override }
public void propagateMembership(long[] userIds, long[] addOrganizationIds, long[] removeOrganizationIds) {}
@Override
@Override public void propagateMembership(long[] userIds, long[] addOrganizationIds, long[] removeOrganizationIds) {
public void verifyPolicy(Organization organization) {} }
@Override @Override
public void verifyPolicy(Organization organization, Organization oldOrganization, public void verifyPolicy(Organization organization) {
List<AssetCategory> oldAssetCategories, List<AssetTag> oldAssetTags, }
Map<String, Serializable> oldExpandoAttributes) {}
@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, public Long calculateDateAvvioProcedimento(long controlloPraticaId) throws SystemException,
PortalException { PortalException {
ControlloPratica controllo = ControlloPraticaLocalServiceUtil ControlloPratica controllo = ControlloPraticaLocalServiceUtil
.fetchControlloPratica(controlloPraticaId); .fetchControlloPratica(controlloPraticaId);
IntPratica pratica = IntPraticaLocalServiceUtil.fetchIntPratica(controllo.getIntPraticaId()); IntPratica pratica = IntPraticaLocalServiceUtil.fetchIntPratica(controllo.getIntPraticaId());
if (pratica.getStatoPratica().equalsIgnoreCase(StatoPraticaConstants.AUTORIZZATA)) {
return 0L;
}
Date apertura = pratica.getDtPratica(); Date apertura = pratica.getDtPratica();
Date chiusura = null; Date chiusura = null;
long stop = 0; long stop = 0L;
List<Avviso> avvisi = AvvisoLocalServiceUtil.findByIntPratica(pratica.getIntPraticaId(), List<Avviso> avvisi = AvvisoLocalServiceUtil.findByIntPratica(pratica.getIntPraticaId(),
QueryUtil.ALL_POS, QueryUtil.ALL_POS, OrderByComparatorFactoryUtil QueryUtil.ALL_POS, QueryUtil.ALL_POS, OrderByComparatorFactoryUtil
@ -764,35 +770,39 @@ public class ControlloPraticaLocalServiceImpl extends ControlloPraticaLocalServi
for (Avviso avviso : avvisi) { for (Avviso avviso : avvisi) {
if (!avviso.isAnnullato()) { if (!avviso.isAnnullato()) {
String tipo = avviso.getTipoDocumento().toUpperCase(); String tipo = avviso.getTipoDocumento().toUpperCase();
_log.debug("Avviso " + avviso.getTipoDocumento() + " " + avviso.getDtAvviso() + " " _log.debug("Avviso " + tipo + " " + avviso.getDtAvviso() + " " + avviso.getCreateDate());
+ avviso.getCreateDate()); switch (tipo) {
if (tipo.equals(StatoPraticaConstants.INTEGRAZIONE)) { case StatoPraticaConstants.INTEGRAZIONE:
start = avviso.getCreateDate(); start = avviso.getCreateDate();
end = null; end = null;
if (Validator.isNotNull(chiusura)) { if (Validator.isNotNull(chiusura)) {
apertura = avviso.getDtAvviso(); apertura = avviso.getDtAvviso();
chiusura = null; chiusura = null;
stop = 0; stop = 0L;
_log.debug("Reset apertura al " + apertura); _log.debug("Reset apertura al " + apertura);
} }
_log.debug("IN start = " + start + ", pratica " + pratica.getNumeroProgetto()); _log.debug("IN start = " + start + ", pratica " + pratica.getNumeroProgetto());
} else if (tipo.equals(StatoPraticaConstants.VIDIMATA)) { break;
case StatoPraticaConstants.VIDIMATA:
if (Validator.isNull(chiusura)) { if (Validator.isNull(chiusura)) {
end = avviso.getCreateDate(); end = avviso.getCreateDate();
_log.debug(tipo + " end = " + end + ", pratica " + pratica.getNumeroProgetto()); _log.debug(tipo + " end = " + end + ", pratica " + pratica.getNumeroProgetto());
} else { } else {
apertura = avviso.getDtAvviso(); apertura = avviso.getDtAvviso();
chiusura = start = end = null; chiusura = start = end = null;
stop = 0; stop = 0L;
_log.debug("Reset apertura al " + apertura); _log.debug("Reset apertura al " + apertura);
} }
} else if (tipo.equals(StatoPraticaConstants.INTEGRAZIONE_ACCETTATA)) { break;
case StatoPraticaConstants.INTEGRAZIONE_ACCETTATA:
end = avviso.getCreateDate(); end = avviso.getCreateDate();
_log.debug(tipo + " end = " + end + ", pratica " + pratica.getNumeroProgetto()); _log.debug(tipo + " end = " + end + ", pratica " + pratica.getNumeroProgetto());
} else if (tipo.equals(StatoPraticaConstants.AUTORIZZATA) break;
|| tipo.equals(StatoPraticaConstants.NON_AUTORIZZATA)) { case StatoPraticaConstants.AUTORIZZATA:
case StatoPraticaConstants.NON_AUTORIZZATA:
chiusura = avviso.getCreateDate(); chiusura = avviso.getCreateDate();
_log.debug("Chiusura al " + chiusura); _log.debug("Chiusura al " + chiusura);
break;
} }
} }
if (Validator.isNotNull(start) && Validator.isNotNull(end)) { 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 normDprg01, boolean normDprg02, boolean normAnr, boolean normArt3com3,
boolean normArt3com4, boolean normOrd01, boolean normDm04, boolean normDm05, boolean normCI01, boolean normArt3com4, boolean normOrd01, boolean normDm04, boolean normDm05, boolean normCI01,
boolean normLTC01, boolean suap, boolean normSismaBonus, String clRischioPreInt, boolean normLTC01, boolean suap, boolean normSismaBonus, String clRischioPreInt,
String clRischioPostInt, boolean intervFinPub, String intervFinPubDesc, boolean tcNuovaCostruzioneComplessa, String clRischioPostInt, boolean intervFinPub, String intervFinPubDesc,
ServiceContext serviceContext, boolean bozza, boolean disabledSubmit, boolean geoDisabledSubmit) boolean tcNuovaCostruzioneComplessa, ServiceContext serviceContext, boolean bozza,
throws PortalException, SystemException { boolean disabledSubmit, boolean geoDisabledSubmit) throws PortalException, SystemException {
DettPratica dettPratica = null; DettPratica dettPratica = null;
if (!disabledSubmit && DelegheUtil.hasDelegaCompilazioneDomanda(userId, dettPraticaId)) { if (!disabledSubmit && DelegheUtil.hasDelegaCompilazioneDomanda(userId, dettPraticaId)) {
dettPratica = dettPraticaLocalService.updateDettPraticaDatiDomanda(userId, dettPraticaId, dettPratica = dettPraticaLocalService.updateDettPraticaDatiDomanda(userId, dettPraticaId,
@ -227,8 +226,8 @@ public class DettPraticaServiceImpl extends DettPraticaServiceBaseImpl {
normEsenteSpese, normDpr01Dep, normDpr02Dep, normDpr01Aut, normDpr02Aut, normDm01, normEsenteSpese, normDpr01Dep, normDpr02Dep, normDpr01Aut, normDpr02Aut, normDm01,
normDm02, normDm03, normDm2018, normDprg01, normDprg02, normAnr, normArt3com3, normDm02, normDm03, normDm2018, normDprg01, normDprg02, normAnr, normArt3com3,
normArt3com4, normOrd01, normDm04, normDm05, normCI01, normLTC01, suap, normSismaBonus, normArt3com4, normOrd01, normDm04, normDm05, normCI01, normLTC01, suap, normSismaBonus,
clRischioPreInt, clRischioPostInt, intervFinPub, intervFinPubDesc, tcNuovaCostruzioneComplessa, clRischioPreInt, clRischioPostInt, intervFinPub, intervFinPubDesc,
serviceContext, bozza); tcNuovaCostruzioneComplessa, serviceContext, bozza);
} }
if (!geoDisabledSubmit && DelegheUtil.hasDelegaCompilazioneSezioneGeologica(userId, dettPraticaId)) { 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.namespace=portos_bo
build.number=2526 build.number=2533
build.date=1608047904204 build.date=1608199554355
build.auto.upgrade=true 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 //Informazioni relative al workflow
WorkflowInstanceLink workflowInstanceLink = WorkflowInstanceLinkLocalServiceUtil.fetchWorkflowInstanceLink( 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; List<WorkflowTask> listaTask = null;
WorkflowInstance workflowInstance = 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="data-inizio-procedimento" value="<%= dateFormatDate.format(controlloPratica.getCreateDate()) %>" />
<liferay-ui:search-container-column-text name="provincia" > <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>
<liferay-ui:search-container-column-text name="GG*" cssClass="text-center"> <liferay-ui:search-container-column-text name="GG*" cssClass="text-center">
<% <%
long days = ControlloPraticaLocalServiceUtil.calculateDateAvvioProcedimento(controlloPratica.getControlloPraticaId()); long days = ControlloPraticaLocalServiceUtil.calculateDateAvvioProcedimento(controlloPratica.getControlloPraticaId());
if (days > 0) {
out.print(days);
}
%> %>
<%=days %>
</liferay-ui:search-container-column-text> </liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-jsp path="/html/gestioneattivita/action_button.jsp" align="right" cssClass="text-center"/> <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 { public void saveDettPratica(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
ServiceContext serviceContext = ServiceContextFactory.getInstance(DettPratica.class.getName(), ServiceContext serviceContext = ServiceContextFactory.getInstance(DettPratica.class.getName(),
actionRequest); actionRequest);
long dettPraticaId = ParamUtil.getLong(actionRequest, "dettPraticaId"); long dettPraticaId = ParamUtil.getLong(actionRequest, "dettPraticaId");
@ -1341,7 +1340,8 @@ public class FascicoloFePortlet extends MVCPortlet {
boolean tcMiglioramentoSismico = ParamUtil.getBoolean(actionRequest, "tcMiglioramentoSismico"); boolean tcMiglioramentoSismico = ParamUtil.getBoolean(actionRequest, "tcMiglioramentoSismico");
boolean tcRiparazioneInterventoLocale = ParamUtil.getBoolean(actionRequest, boolean tcRiparazioneInterventoLocale = ParamUtil.getBoolean(actionRequest,
"tcRiparazioneInterventoLocale"); "tcRiparazioneInterventoLocale");
boolean tcNuovaCostruzioneComplessa = ParamUtil.getBoolean(actionRequest, "tcNuovaCostruzioneComplessa"); boolean tcNuovaCostruzioneComplessa = ParamUtil.getBoolean(actionRequest,
"tcNuovaCostruzioneComplessa");
boolean tcInCA = ParamUtil.getBoolean(actionRequest, "tcInCA"); boolean tcInCA = ParamUtil.getBoolean(actionRequest, "tcInCA");
boolean tcInOpera = ParamUtil.getBoolean(actionRequest, "tcInOpera"); boolean tcInOpera = ParamUtil.getBoolean(actionRequest, "tcInOpera");
@ -1590,7 +1590,8 @@ public class FascicoloFePortlet extends MVCPortlet {
normDpr02Dep, normDpr01Aut, normDpr02Aut, normDm01, normDm02, normDm03, normDm2018, normDpr02Dep, normDpr01Aut, normDpr02Aut, normDm01, normDm02, normDm03, normDm2018,
normDprg01, normDprg02, normAnr, normArt3com3, normArt3com4, normOrd01, normDm04, normDprg01, normDprg02, normAnr, normArt3com3, normArt3com4, normOrd01, normDm04,
normDm05, normCI01, normLTC01, suap, normSismaBonus, clRischioPreInt, clRischioPostInt, 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"); String redirect = ParamUtil.getString(actionRequest, "redirect");
if (Validator.isNull(redirect)) { if (Validator.isNull(redirect)) {
@ -1800,7 +1801,8 @@ public class FascicoloFePortlet extends MVCPortlet {
boolean tcMiglioramentoSismico = ParamUtil.getBoolean(actionRequest, "tcMiglioramentoSismico"); boolean tcMiglioramentoSismico = ParamUtil.getBoolean(actionRequest, "tcMiglioramentoSismico");
boolean tcRiparazioneInterventoLocale = ParamUtil.getBoolean(actionRequest, boolean tcRiparazioneInterventoLocale = ParamUtil.getBoolean(actionRequest,
"tcRiparazioneInterventoLocale"); "tcRiparazioneInterventoLocale");
boolean tcNuovaCostruzioneComplessa = ParamUtil.getBoolean(actionRequest, "tcNuovaCostruzioneComplessa"); boolean tcNuovaCostruzioneComplessa = ParamUtil.getBoolean(actionRequest,
"tcNuovaCostruzioneComplessa");
boolean tcInCA = ParamUtil.getBoolean(actionRequest, "tcInCA"); boolean tcInCA = ParamUtil.getBoolean(actionRequest, "tcInCA");
boolean tcInOpera = ParamUtil.getBoolean(actionRequest, "tcInOpera"); boolean tcInOpera = ParamUtil.getBoolean(actionRequest, "tcInOpera");
@ -2059,7 +2061,8 @@ public class FascicoloFePortlet extends MVCPortlet {
normDpr02Dep, normDpr01Aut, normDpr02Aut, normDm01, normDm02, normDm03, normDm2018, normDpr02Dep, normDpr01Aut, normDpr02Aut, normDm01, normDm02, normDm03, normDm2018,
normDprg01, normDprg02, normAnr, normArt3com3, normArt3com4, normOrd01, normDm04, normDprg01, normDprg02, normAnr, normArt3com3, normArt3com4, normOrd01, normDm04,
normDm05, normCI01, normLTC01, suap, normSismaBonus, clRischioPreInt, clRischioPostInt, 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"); String redirect = ParamUtil.getString(actionRequest, "redirect");
if (Validator.isNull(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 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.DettPraticaLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.model.IntPratica"%> <%@page import="it.tref.liferay.portos.bo.model.IntPratica"%>
@ -21,38 +20,37 @@
<%@include file="/html/allegatipratica/init.jsp"%> <%@include file="/html/allegatipratica/init.jsp"%>
<% <%
String redirect = ParamUtil.getString(request, "backUrl");
String redirect = ParamUtil.getString(request, "backUrl"); String comingFrom = ParamUtil.getString(request, "comingFrom");
String comingFrom = ParamUtil.getString(request, "comingFrom"); long classPk = ParamUtil.getLong(request, "classPk");
long classPk = ParamUtil.getLong(request, "classPk"); String className = ParamUtil.getString(request, "className");
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"); long docPraticaId = ParamUtil.getLong(request, "docPraticaId");
DocPratica docPratica = DocPraticaServiceUtil.getDocPratica(docPraticaId); DocPratica docPratica = DocPraticaServiceUtil.getDocPratica(docPraticaId);
FirmeBean firme = FirmeUtil.deserialize(docPratica.getJsonFirmatari()); 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 hasDelegaFirma = DelegheUtil.hasDelegaFirma(user.getUserId(), docPraticaId, "page_geologica".equalsIgnoreCase(comingFrom));
boolean canSignGeoDocs = "page_geologica".equalsIgnoreCase(comingFrom) && hasDelegaFirma; boolean canSignGeoDocs = "page_geologica".equalsIgnoreCase(comingFrom) && hasDelegaFirma;
%> %>
<liferay-ui:icon-menu icon="" showExpanded="<%=true %>" showWhenSingleIcon="<%=true%>"> <liferay-ui:icon-menu icon="" showExpanded="<%=true %>" showWhenSingleIcon="<%=true%>">
<c:if test="<%= docPratica.getClassPk()==classPk && hasDelegaFirma && (!disabledInput || canSignGeoDocs)%>"> <c:if test="<%= docPratica.getClassPk()==classPk && hasDelegaFirma && (!disabledInput || canSignGeoDocs)%>">
<% <%
if(firme.firmaIsPresent(user.getScreenName())){ if (firme.firmaIsPresent(user.getScreenName())) {
if(firme.firmaIsAnnullabile(user.getScreenName())){ if (firme.firmaIsAnnullabile(user.getScreenName())) {
%> %>
<portlet:actionURL name="rimuoviFirma" var="rimuoviFirmaURL"> <portlet:actionURL name="rimuoviFirma" var="rimuoviFirmaURL">
<portlet:param name="docPraticaId" value="<%=String.valueOf(docPraticaId) %>" /> <portlet:param name="docPraticaId" value="<%= String.valueOf(docPraticaId) %>" />
<portlet:param name="comingFrom" value="<%=comingFrom %>" /> <portlet:param name="comingFrom" value="<%= comingFrom %>" />
</portlet:actionURL> </portlet:actionURL>
<div title="Rimuovi firma" class="tooltip-info"> <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> </div>
<aui:script use="aui-base,aui-io-request"> <aui:script use="aui-base,aui-io-request">
@ -89,8 +87,8 @@
</aui:script> </aui:script>
<% <%
} }
}else{ } else {
%> %>
<portlet:actionURL name="aggiungiFirma" var="aggiungiFirmaURL"> <portlet:actionURL name="aggiungiFirma" var="aggiungiFirmaURL">
<portlet:param name="docPraticaId" value="<%=String.valueOf(docPraticaId) %>" /> <portlet:param name="docPraticaId" value="<%=String.valueOf(docPraticaId) %>" />
@ -133,14 +131,14 @@
</aui:script> </aui:script>
<% <%
} }
%> %>
</c:if> </c:if>
<c:choose> <c:choose>
<c:when test="<%= Validator.isNotNull(docPratica.getDlFileEntryId()) %>"> <c:when test="<%= Validator.isNotNull(docPratica.getDlFileEntryId()) %>">
<div title="Scarica" class="tooltip-info"> <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> </div>
</c:when> </c:when>
<c:otherwise> <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"); Boolean hasDelegaCompilazioneDomanda = (Boolean) SessionUtil.getDettPraticaObject(request, classPk, "hasDelegaCompilazioneDomanda");
if (null == hasDelegaCompilazioneDomanda) { if (null == hasDelegaCompilazioneDomanda) {
hasDelegaCompilazioneDomanda = DelegheUtil.hasDelegaCompilazioneDomanda(user.getUserId(),classPk); hasDelegaCompilazioneDomanda = DelegheUtil.hasDelegaCompilazioneDomanda(user.getUserId(),classPk);
SessionUtil.setDettPraticaObject(request, classPk, "hasDelegaCompilazioneDomanda", hasDelegaCompilazioneDomanda);
} }
disabledInput = !hasDelegaCompilazioneDomanda disabledInput = !hasDelegaCompilazioneDomanda
&& !DelegheUtil.hasDelegaFirmaAllegati(user.getUserId(),classPk); && !DelegheUtil.hasDelegaFirmaAllegati(user.getUserId(),classPk);
@ -429,7 +428,7 @@ for (String codiceDoc:tipologiaAllegati) {
<c:otherwise> <c:otherwise>
<c:if test="<%= !inBO %>"> <c:if test="<%= !inBO %>">
<c:if test="<%= !disabledInput || canSignGeoDocs %>"> <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 %>"> servletContext="<%= application %>">
<liferay-util:param name="backUrl" value="<%= currentURL %>" /> <liferay-util:param name="backUrl" value="<%= currentURL %>" />
<liferay-util:param name="comingFrom" value="<%= comingFrom %>" /> <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 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.shared.util.PortletKeys"%>
<%@page import="it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil"%> <%@page import="it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil"%>
<%@page import="it.tref.liferay.portos.bo.service.IntPraticaLocalService"%> <%@page import="it.tref.liferay.portos.bo.service.IntPraticaLocalService"%>
@ -43,7 +41,6 @@
<%@ include file="/html/allegatipratica/init.jsp"%> <%@ include file="/html/allegatipratica/init.jsp"%>
<% <%
Log _log = LogFactoryUtil.getLog("view_accordion.jsp");
String comingFrom = ParamUtil.getString(request,"comingFrom", String comingFrom = ParamUtil.getString(request,"comingFrom",
GetterUtil.getString( GetterUtil.getString(
PortalUtil.getOriginalServletRequest(request).getParameter("page_allegati"), PortalUtil.getOriginalServletRequest(request).getParameter("page_allegati"),
@ -151,7 +148,6 @@
<% <%
for(DocPratica docPratica:docPraticas){ for(DocPratica docPratica:docPraticas){
long docPraticaId = docPratica.getDocPraticaId(); long docPraticaId = docPratica.getDocPraticaId();
_log.info("Processo docPratica id = "+docPraticaId);
%> %>
<tr> <tr>
<td class="text-center"><span <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); SessionUtil.setDettPraticaObject(request, dettPraticaId, "pagamentoIsEnable", pagamentoIsEnable);
boolean disabledInput = !DelegheUtil.hasDelegaCompilazioneDomanda(user.getUserId(), dettPraticaId); boolean disabledInput = !DelegheUtil.hasDelegaCompilazioneDomanda(user.getUserId(), dettPraticaId);
boolean geoDisabledInput = !hasDelegaCompilazioneDomanda || !praticaIsEditable; boolean geoDisabledInput = !DelegheUtil.hasDelegaCompilazioneSezioneGeologica(user.getUserId(), dettPraticaId)
|| !praticaIsEditable;
String[] pageDatiDomanda = new String[] { String[] pageDatiDomanda = new String[] {
"page_dettagli_principali", "page_soggetti", "page_desc_edificio", "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"); long soggettoId = ParamUtil.getLong(request, "soggettoId");
boolean disabledInput = ParamUtil.getBoolean(request, "disabledInput"); boolean disabledInput = ParamUtil.getBoolean(request, "disabledInput");
boolean inBO = ParamUtil.getBoolean(request, "inBO", false); 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()); boolean hasAsseverazioniAttive = AsseverazioniUtil.hasAsseverazioniAttive(dettPratica.getDettPraticaId());
%> %>

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

@ -2,6 +2,6 @@
<!DOCTYPE project> <!DOCTYPE project>
<project name="portos-firma-portlet" basedir="." default="deploy"> <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" /> <import file="../build-common-portlet.xml" />
</project> </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; package it.tref.liferay.portos.firma.action;
import com.liferay.portal.kernel.events.ActionException; import com.liferay.portal.kernel.events.ActionException;
import com.liferay.portal.kernel.events.SimpleAction; import com.liferay.portal.kernel.events.SimpleAction;
import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception.PortalException;
@ -26,99 +25,103 @@ import com.liferay.portlet.expando.service.ExpandoTableLocalServiceUtil;
public class StartUpAction extends SimpleAction { public class StartUpAction extends SimpleAction {
private final static Log _log = LogFactoryUtil.getLog(StartUpAction.class); private final static Log _log = LogFactoryUtil.getLog(StartUpAction.class);
@Override @Override
public void run(String[] companyIds) throws ActionException { public void run(String[] companyIds) throws ActionException {
for (String id : companyIds) { for (String id : companyIds) {
try { try {
long companyId = GetterUtil.getLong(id); long companyId = GetterUtil.getLong(id);
String[] defaultActions = {ActionKeys.VIEW, ActionKeys.UPDATE}; String[] defaultActions = { ActionKeys.VIEW, ActionKeys.UPDATE };
String[] guestActions = {ActionKeys.VIEW}; String[] guestActions = { ActionKeys.VIEW };
// Organization custom fields // Organization custom fields
addExpandoColumnIfNotExists(companyId, Company.class.getName(), "url_pdf_extractor", addExpandoColumnIfNotExists(companyId, Company.class.getName(), "url_pdf_extractor",
ExpandoColumnConstants.STRING, true, false, defaultActions, guestActions); ExpandoColumnConstants.STRING, true, false, defaultActions, guestActions);
addExpandoColumnIfNotExists(companyId, Company.class.getName(), "url-bo-gestione-pratica-firma", addExpandoColumnIfNotExists(companyId, Company.class.getName(),
ExpandoColumnConstants.STRING, true, false, defaultActions, guestActions); "url-bo-gestione-pratica-firma", ExpandoColumnConstants.STRING, true, false,
} catch (Exception e) { defaultActions, guestActions);
_log.error("Errore nella procedura automatizzata di configurazione", e); } catch (Exception e) {
} _log.error("Errore nella procedura automatizzata di configurazione", e);
} }
} }
}
private ExpandoColumn addExpandoColumnIfNotExists(long companyId, String className, String name, int type, private ExpandoColumn addExpandoColumnIfNotExists(long companyId, String className, String name,
boolean indexed, boolean hidden, String[] defaultActions, String[] guestActions) throws SystemException { 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; ExpandoTable expandoTable = null;
try { try {
expandoTable = expandoTable = ExpandoTableLocalServiceUtil.getTable(companyId, classNameId,
ExpandoTableLocalServiceUtil.getTable(companyId, classNameId, ExpandoTableConstants.DEFAULT_TABLE_NAME); ExpandoTableConstants.DEFAULT_TABLE_NAME);
} catch (PortalException e) { } catch (PortalException e) {
try { try {
expandoTable = expandoTable = ExpandoTableLocalServiceUtil.addTable(companyId, classNameId,
ExpandoTableLocalServiceUtil.addTable(companyId, classNameId, ExpandoTableConstants.DEFAULT_TABLE_NAME); ExpandoTableConstants.DEFAULT_TABLE_NAME);
} catch (PortalException e1) { } catch (PortalException e1) {
} }
} }
ExpandoColumn expandoColumn = ExpandoColumnLocalServiceUtil.getColumn(expandoTable.getTableId(), name); ExpandoColumn expandoColumn = ExpandoColumnLocalServiceUtil
.getColumn(expandoTable.getTableId(), name);
if (expandoColumn == null) { if (expandoColumn == null) {
try { try {
expandoColumn = ExpandoColumnLocalServiceUtil.addColumn(expandoTable.getTableId(), name, type); 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, typeSettingsProperties.put(ExpandoColumnConstants.INDEX_TYPE,
String.valueOf(ExpandoColumnConstants.INDEX_TYPE_TEXT)); 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 roleGuest = RoleLocalServiceUtil.getRole(companyId, RoleConstants.GUEST);
Role rolePowerUser = RoleLocalServiceUtil.getRole(companyId, RoleConstants.POWER_USER); Role rolePowerUser = RoleLocalServiceUtil.getRole(companyId, RoleConstants.POWER_USER);
Role roleUser = RoleLocalServiceUtil.getRole(companyId, RoleConstants.USER); Role roleUser = RoleLocalServiceUtil.getRole(companyId, RoleConstants.USER);
ResourcePermissionLocalServiceUtil.setResourcePermissions(companyId, ExpandoColumn.class.getName(), ResourcePermissionLocalServiceUtil.setResourcePermissions(companyId,
ResourceConstants.SCOPE_INDIVIDUAL, String.valueOf(expandoColumn.getColumnId()), roleGuest.getRoleId(), ExpandoColumn.class.getName(), ResourceConstants.SCOPE_INDIVIDUAL,
guestActions); String.valueOf(expandoColumn.getColumnId()), roleGuest.getRoleId(), guestActions);
ResourcePermissionLocalServiceUtil.setResourcePermissions(companyId, ExpandoColumn.class.getName(), ResourcePermissionLocalServiceUtil.setResourcePermissions(companyId,
ResourceConstants.SCOPE_INDIVIDUAL, String.valueOf(expandoColumn.getColumnId()), rolePowerUser.getRoleId(), ExpandoColumn.class.getName(), ResourceConstants.SCOPE_INDIVIDUAL,
defaultActions); String.valueOf(expandoColumn.getColumnId()), rolePowerUser.getRoleId(), defaultActions);
ResourcePermissionLocalServiceUtil.setResourcePermissions(companyId, ExpandoColumn.class.getName(), ResourcePermissionLocalServiceUtil.setResourcePermissions(companyId,
ResourceConstants.SCOPE_INDIVIDUAL, String.valueOf(expandoColumn.getColumnId()), roleUser.getRoleId(), ExpandoColumn.class.getName(), ResourceConstants.SCOPE_INDIVIDUAL,
defaultActions); String.valueOf(expandoColumn.getColumnId()), roleUser.getRoleId(), defaultActions);
} catch (PortalException e) { } 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 { public class FirmaServlet extends HttpServlet {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private static final String GET_CONFIGURATION = "get-configuration"; // get 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_LIST = "get-file-list"; // post
private static final String GET_FILE = "get-file"; // 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 = "get-type"; // get
private static final String GET_TYPE_VERBALE = "get-type-verbale"; // get private static final String GET_TYPE_VERBALE = "get-type-verbale"; // get
private static final String LOGIN = "login"; // get private static final String LOGIN = "login"; // get
private static final String OPEN_PRATICA = "open-pratica"; // post private static final String OPEN_PRATICA = "open-pratica"; // post
private static final String RIFIUTA = "rifiuta"; // post private static final String RIFIUTA = "rifiuta"; // post
private static final String SET_FILE = "set-file"; // post private static final String SET_FILE = "set-file"; // post
private static final String VERSION = "version"; // get private static final String VERSION = "version"; // get
private static final String GET_STILE = "get-stile"; // get private static final String GET_STILE = "get-stile"; // get
private static final Log _log = LogFactoryUtil.getLog(FirmaServlet.class); private static final Log _log = LogFactoryUtil.getLog(FirmaServlet.class);
/** /**
* @see HttpServlet#HttpServlet() * @see HttpServlet#HttpServlet()
*/ */
public FirmaServlet() { public FirmaServlet() {
super();
super(); }
}
/**
/** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) * response)
*/ */
@Override @Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException,
IOException {
String pathInfo = request.getPathInfo().substring(1);
String[] pathArray = StringUtil.split(pathInfo, "/"); String pathInfo = request.getPathInfo().substring(1);
FirmaGetUtil firmaGetUtil = new FirmaGetUtil(); String[] pathArray = StringUtil.split(pathInfo, "/");
String metodo = pathArray[0]; FirmaGetUtil firmaGetUtil = new FirmaGetUtil();
Risposta<?> risposta = new Risposta<>(); String metodo = pathArray[0];
Risposta<?> risposta = new Risposta<>();
switch (metodo) {
case GET_CONFIGURATION: switch (metodo) {
risposta = firmaGetUtil.getConfiguration(); case GET_CONFIGURATION:
break; risposta = firmaGetUtil.getConfiguration();
break;
case GET_TYPE:
risposta = firmaGetUtil.getType(); case GET_TYPE:
break; risposta = firmaGetUtil.getType();
break;
case GET_TYPE_VERBALE:
risposta = firmaGetUtil.getTypeVerbale(); case GET_TYPE_VERBALE:
break; risposta = firmaGetUtil.getTypeVerbale();
break;
case LOGIN:
if (pathArray.length == 2) { case LOGIN:
String codiceFiscale = pathArray[1]; if (pathArray.length == 2) {
risposta = firmaGetUtil.loginCodiceFiscale(codiceFiscale); String codiceFiscale = pathArray[1];
} risposta = firmaGetUtil.loginCodiceFiscale(codiceFiscale);
if (pathArray.length == 3) { }
String nome = pathArray[1]; if (pathArray.length == 3) {
String cognome = pathArray[2]; String nome = pathArray[1];
risposta = firmaGetUtil.loginNomeCognome(nome, cognome); String cognome = pathArray[2];
} risposta = firmaGetUtil.loginNomeCognome(nome, cognome);
break; }
break;
case VERSION:
risposta = firmaGetUtil.version(); case VERSION:
break; risposta = firmaGetUtil.version();
break;
case GET_STILE:
risposta = firmaGetUtil.getStile(); case GET_STILE:
break; risposta = firmaGetUtil.getStile();
break;
}
JSONSerializer jsonSerializer = JSONFactoryUtil.createJSONSerializer(); }
jsonSerializer.exclude("*.class"); JSONSerializer jsonSerializer = JSONFactoryUtil.createJSONSerializer();
String jsonResponse = jsonSerializer.serializeDeep(risposta); jsonSerializer.exclude("*.class");
String jsonResponse = jsonSerializer.serializeDeep(risposta);
response.setContentType("application/json; charset=UTF-8");
ServletResponseUtil.write(response, jsonResponse); response.setContentType("application/json; charset=UTF-8");
ServletResponseUtil.write(response, jsonResponse);
}
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) /**
*/ * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
@Override * response)
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { */
@Override
String pathInfo = request.getPathInfo().substring(1); protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException,
String[] pathArray = StringUtil.split(pathInfo, "/"); IOException {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); String pathInfo = request.getPathInfo().substring(1);
StreamUtil.transfer(request.getInputStream(), outputStream); String[] pathArray = StringUtil.split(pathInfo, "/");
String token = new String(outputStream.toByteArray(), StandardCharsets.UTF_8);
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
FirmaPostUtil firmaPostUtil = new FirmaPostUtil(); StreamUtil.transfer(request.getInputStream(), outputStream);
String metodo = pathArray[0]; String token = new String(outputStream.toByteArray(), StandardCharsets.UTF_8);
Risposta<?> risposta = new Risposta<>();
FirmaPostUtil firmaPostUtil = new FirmaPostUtil();
switch (metodo) { String metodo = pathArray[0];
case GET_FILE: Risposta<?> risposta = new Risposta<>();
if (pathArray.length == 3) {
String tipo = pathArray[1]; switch (metodo) {
String id = pathArray[2]; case GET_FILE:
risposta = firmaPostUtil.getFile(token, tipo, id); if (pathArray.length == 3) {
} String tipo = pathArray[1];
break; String id = pathArray[2];
risposta = firmaPostUtil.getFile(token, tipo, id);
case GET_FILE_LIST: }
risposta = firmaPostUtil.getFileList(token); break;
break;
case GET_FILE_LIST:
case OPEN_PRATICA: risposta = firmaPostUtil.getFileList(token);
if (pathArray.length == 2) { break;
String idFile = pathArray[1];
risposta = firmaPostUtil.openPratica(token, idFile); case OPEN_PRATICA:
} if (pathArray.length == 2) {
break; String idFile = pathArray[1];
risposta = firmaPostUtil.openPratica(token, idFile);
case RIFIUTA: }
if (pathArray.length == 5) { break;
String idFile = pathArray[1];
String messaggio = pathArray[2]; case RIFIUTA:
String cambiaFase = pathArray[3]; if (pathArray.length == 5) {
String assegna = pathArray[4]; String idFile = pathArray[1];
risposta = firmaPostUtil.rifiuta(token, idFile, messaggio, cambiaFase, assegna); String messaggio = pathArray[2];
} String cambiaFase = pathArray[3];
break; String assegna = pathArray[4];
risposta = firmaPostUtil.rifiuta(token, idFile, messaggio, cambiaFase, assegna);
case SET_FILE: }
if (pathArray.length == 3) { break;
String tipo = pathArray[1];
String idFile = pathArray[2]; case SET_FILE:
JSONDeserializer<Map<String, String>> jsonDeserializer = JSONFactoryUtil.createJSONDeserializer(); if (pathArray.length == 3) {
Map<String, String> map = jsonDeserializer.deserialize(token); String tipo = pathArray[1];
String idFile = pathArray[2];
ServiceContext serviceContext = null; JSONDeserializer<Map<String, String>> jsonDeserializer = JSONFactoryUtil
try { .createJSONDeserializer();
serviceContext = ServiceContextFactory.getInstance(request); Map<String, String> map = jsonDeserializer.deserialize(token);
} catch (PortalException | SystemException e) {
_log.error(e.getMessage()); ServiceContext serviceContext = null;
} try {
serviceContext = ServiceContextFactory.getInstance(request);
risposta = firmaPostUtil.setFile(map.get("token"), map.get("file"), tipo, idFile, serviceContext); } catch (PortalException | SystemException e) {
} _log.error(e.getMessage());
break; }
}
risposta = firmaPostUtil.setFile(map.get("token"), map.get("file"), tipo, idFile,
JSONSerializer jsonSerializer = JSONFactoryUtil.createJSONSerializer(); serviceContext);
jsonSerializer.exclude("*.class"); }
String jsonResponse = jsonSerializer.serialize(risposta); break;
}
response.setContentType("application/json; charset=UTF-8");
ServletResponseUtil.write(response, jsonResponse); 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; import java.util.List;
public class ExtractorResponse { public class ExtractorResponse {
private boolean success;
private List<String> cf;
private boolean success; public boolean isSuccess() {
private List<String> cf; return success;
}
public boolean isSuccess() {
return success;
}
public List<String> getCf() {
return cf;
}
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 { public class FirmaPostUtil {
private static final Log _log = LogFactoryUtil.getLog(FirmaPostUtil.class); private static final Log _log = LogFactoryUtil.getLog(FirmaPostUtil.class);
public Risposta<List<RestFile>> getFileList(String token) { 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 * Verificare che il token sia il codice fiscale altrimenti c e un
* dal token userCodiceFiscalePrimaFirma = al cod fisc di Avviso...tipoAvviso = S && * metodo che estre il cod fisc dal token userCodiceFiscalePrimaFirma =
* fileEntryIdInvio = 0 && fileEntryIdBase != 0 && !rifiutato ( aggiungere campo al service e * al cod fisc di Avviso...tipoAvviso = S && fileEntryIdInvio = 0 &&
* anche campo dtRifiuto) con il fileEntryIdBase prendo il file e uso per riempire lista di * fileEntryIdBase != 0 && !rifiutato ( aggiungere campo al service e
* ritorno * 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 * 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>>(); long[] companyIds = PortalUtil.getCompanyIds();
for (long companyId : companyIds) { Risposta<List<RestFile>> risposta = new Risposta<List<RestFile>>();
for (long companyId : companyIds) {
Company company = null; Company company = null;
try { try {
company = CompanyLocalServiceUtil.getCompany(companyId); company = CompanyLocalServiceUtil.getCompany(companyId);
} catch (Exception e) { } catch (Exception e) {
_log.error(e, e); _log.error(e, e);
} }
String urlPdfExtractor = (String) company.getExpandoBridge().getAttribute("url_pdf_extractor", false); String urlPdfExtractor = (String) company.getExpandoBridge().getAttribute("url_pdf_extractor",
if (Validator.isNotNull(urlPdfExtractor)) { false);
byte[] fileArray = Base64.decode(token); if (Validator.isNotNull(urlPdfExtractor)) {
byte[] fileArray = Base64.decode(token);
List<String> listaCodiciFiscali = FirmaUtil.getCodiceFiscale(fileArray, urlPdfExtractor);
String cf = listaCodiciFiscali.get(0); List<String> listaCodiciFiscali = FirmaUtil.getCodiceFiscale(fileArray, urlPdfExtractor);
String cf = listaCodiciFiscali.get(0);
List<RestFile> listaFile = new ArrayList<RestFile>();
List<RestFile> listaFile = new ArrayList<RestFile>();
// Ricordarsi di verificare che nel token ci sia il cod fisc in chiaro altrimenti va
// estratto try {
try { List<Avviso> listaAvvisi = AvvisoLocalServiceUtil.getListaAvvisiPerApplet(cf);
if (Validator.isNotNull(listaAvvisi) && listaAvvisi.size() > 0) {
// List<Avviso> listaAvvisi = AvvisoLocalServiceUtil.findByIntPratica(1001, -1, -1, null);
for (Avviso avviso : listaAvvisi) {
List<Avviso> listaAvvisi = AvvisoLocalServiceUtil.getListaAvvisiPerApplet(cf);
if (Validator.isNotNull(listaAvvisi) && listaAvvisi.size() > 0) { if (Validator.isNotNull(avviso.getFileEntryIdBase())) {
DLFileEntry fileEntry = DLFileEntryLocalServiceUtil.fetchDLFileEntry(avviso
for (Avviso avviso : listaAvvisi) { .getFileEntryIdBase());
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(avviso
if (Validator.isNotNull(avviso.getFileEntryIdBase())) { .getIntPraticaId());
DLFileEntry fileEntry = DLFileEntryLocalServiceUtil.fetchDLFileEntry(avviso.getFileEntryIdBase()); if (Validator.isNotNull(fileEntry)) {
IntPratica intPratica = IntPraticaLocalServiceUtil.getIntPratica(avviso.getIntPraticaId());
if (Validator.isNotNull(fileEntry)) { RestFile restFile = new RestFile();
restFile.setIdFile(GetterUtil.getInteger(avviso.getAvvisoId()));
RestFile restFile = new RestFile(); restFile.setDataInvio(new Date());
restFile.setIdFile(GetterUtil.getInteger(avviso.getAvvisoId()));
restFile.setDataInvio(new Date()); String tipoDocumento = avviso.translateTipoDocumento();
String tipoDocumento = avviso.translateTipoDocumento(); restFile.setDocumentiType(avviso.getTipoDocumento()); // TO-VERIFY
restFile.setNomeFile(LanguageUtil.get(Locale.ITALIAN, tipoDocumento)
restFile.setDocumentiType(avviso.getTipoDocumento()); // TO-VERIFY + StringPool.SPACE + StringPool.DASH + StringPool.SPACE
restFile.setNomeFile(LanguageUtil.get(Locale.ITALIAN, tipoDocumento) + StringPool.SPACE + intPratica.getTitle(Locale.ITALIAN, true));
+ StringPool.DASH + StringPool.SPACE + intPratica.getTitle(Locale.ITALIAN, true)); restFile.setFile("");
restFile.setFile("");
Group group = GroupLocalServiceUtil.getGroup(avviso.getGroupId());
Group group = GroupLocalServiceUtil.getGroup(avviso.getGroupId()); Organization organization = OrganizationLocalServiceUtil
Organization organization = OrganizationLocalServiceUtil.getOrganization(group.getOrganizationId()); .getOrganization(group.getOrganizationId());
restFile.setTipoPratica(organization.getName()); restFile.setTipoPratica(organization.getName());
listaFile.add(restFile); listaFile.add(restFile);
} }
} }
} }
} }
risposta.setObj(listaFile); risposta.setObj(listaFile);
risposta.setRisposta(RispostaCostanti.OK); risposta.setRisposta(RispostaCostanti.OK);
} catch (Exception e) { } catch (Exception e) {
_log.error(e.getMessage(), e); _log.error(e.getMessage(), e);
risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE); risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE);
} }
} }
} }
return risposta; return risposta;
} }
public Risposta<RestFile> getFile(String token, String tipo, String id) { 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 * verra passato l avviso id facciamo query per riprendere file entry e
* il contenuto * ritorniamo quel file con il contenuto
*/ */
Risposta<RestFile> risposta = new Risposta<RestFile>(); Risposta<RestFile> risposta = new Risposta<RestFile>();
try { try {
Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(GetterUtil.getLong(id)); Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(GetterUtil.getLong(id));
if (Validator.isNotNull(avviso)) { if (Validator.isNotNull(avviso)) {
if (Validator.isNotNull(avviso.getFileEntryIdBase())) { if (Validator.isNotNull(avviso.getFileEntryIdBase())) {
DLFileEntry fileEntry = DLFileEntryLocalServiceUtil.fetchDLFileEntry(avviso.getFileEntryIdBase()); DLFileEntry fileEntry = DLFileEntryLocalServiceUtil.fetchDLFileEntry(avviso
if (Validator.isNotNull(fileEntry)) { .getFileEntryIdBase());
if (Validator.isNotNull(fileEntry)) {
RestFile restFile = new RestFile();
restFile.setIdFile(GetterUtil.getInteger(avviso.getAvvisoId())); RestFile restFile = new RestFile();
restFile.setDataInvio(new Date()); restFile.setIdFile(GetterUtil.getInteger(avviso.getAvvisoId()));
restFile.setDocumentiType(avviso.getTipoDocumento()); // TO-VERIFY restFile.setDataInvio(new Date());
restFile.setNomeFile(fileEntry.getTitle() + StringPool.PERIOD + fileEntry.getExtension()); restFile.setDocumentiType(avviso.getTipoDocumento()); // TO-VERIFY
restFile.setTipoPratica(StringPool.BLANK); restFile.setNomeFile(fileEntry.getTitle() + StringPool.PERIOD
// Recupero il tipo di pratica + fileEntry.getExtension());
/* restFile.setTipoPratica(StringPool.BLANK);
* if (Validator.isNotNull(avviso.getIntPraticaId())) { IntPratica intPratica =
* IntPraticaLocalServiceUtil.fetchIntPratica(avviso.getIntPraticaId()); if // Inserisco il contenuto del file in Base64
* (Validator.isNotNull(intPratica)) { InputStream fileInputStream = DLFileEntryLocalServiceUtil.getFileAsStream(
* restFile.setTipoPratica(intPratica.getTipoPratica()); } } fileEntry.getFileEntryId(), fileEntry.getVersion());
*/ ByteArrayOutputStream bao = new ByteArrayOutputStream();
IOUtils.copy(fileInputStream, bao);
// Inserisco il contenuto del file in Base64 restFile.setFile(Base64.encode(bao.toByteArray()));
InputStream fileInputStream = risposta.setRisposta(RispostaCostanti.OK);
DLFileEntryLocalServiceUtil.getFileAsStream(fileEntry.getFileEntryId(), fileEntry.getVersion()); risposta.setObj(restFile);
ByteArrayOutputStream bao = new ByteArrayOutputStream(); }
IOUtils.copy(fileInputStream, bao); }
restFile.setFile(Base64.encode(bao.toByteArray())); }
risposta.setRisposta(RispostaCostanti.OK); } catch (SystemException | PortalException | IOException e) {
risposta.setObj(restFile); _log.error(e.getMessage(), e);
risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE);
} }
}
} return risposta;
}
} catch (SystemException e) {
_log.error(e.getMessage(), e); public Risposta<String> openPratica(String token, String idFile) {
risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE);
} catch (PortalException e) { /**
_log.error(e.getMessage(), e); * mi arriva l'avviso id e mi recupero l intpraticaid bisogna ritornare
risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE); * ad una pagina privata di bo con la view sistemata per gestire
} catch (IOException e) { * direttamente la pratica portos-bo-portlet fascicolo portlet .....
_log.error(e.getMessage(), e); * intpraticaid
risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE); */
} Risposta<String> risposta = new Risposta<String>();
return risposta; try {
}
Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(GetterUtil.getLong(idFile));
public Risposta<String> openPratica(String token, String idFile) { if (Validator.isNotNull(avviso)) {
/** // Prendo la url della pagina da ritornare settata nel expando
* mi arriva l'avviso id e mi recupero l intpraticaid bisogna ritornare ad una pagina privata di // custom field della company
* bo con la view sistemata per gestire direttamente la pratica portos-bo-portlet fascicolo // di riferimento e ci aggiungo nella url l attributo relativo
* portlet ..... intpraticaid // all id della intPratica
*/ Company company = CompanyLocalServiceUtil.fetchCompany(avviso.getCompanyId());
Risposta<String> risposta = new Risposta<String>(); if (Validator.isNotNull(company)) {
try { String urlToBack = GetterUtil.getString(company.getExpandoBridge().getAttribute(
"url-bo-gestione-pratica-firma", false));
Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(GetterUtil.getLong(idFile));
if (Validator.isNotNull(avviso)) { urlToBack = urlToBack + "&_1_WAR_portosboportlet_intPraticaId="
+ avviso.getIntPraticaId();
// Prendo la url della pagina da ritornare settata nel expando custom field della company risposta.setObj(urlToBack);
// di riferimento e ci aggiungo nella url l attributo relativo all id della intPratica risposta.setRisposta(RispostaCostanti.OK);
Company company = CompanyLocalServiceUtil.fetchCompany(avviso.getCompanyId()); }
if (Validator.isNotNull(company)) {
}
String urlToBack =
GetterUtil.getString(company.getExpandoBridge().getAttribute("url-bo-gestione-pratica-firma", false)); } catch (SystemException e) {
_log.error(e.getMessage(), e);
urlToBack = urlToBack + "&_1_WAR_portosboportlet_intPraticaId=" + avviso.getIntPraticaId(); risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE);
risposta.setObj(urlToBack); }
risposta.setRisposta(RispostaCostanti.OK);
} return risposta;
} }
public Risposta<Boolean> rifiuta(String token, String idFile, String messaggio, String cambiaFase,
} catch (SystemException e) { String assegna) {
_log.error(e.getMessage(), e);
risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE); /**
} * mi arriva l'avviso id lo recupero e setto rifiutato e dtRifiuto e
* aggiorno
return risposta; *
*
} */
Risposta<Boolean> risposta = new Risposta<Boolean>();
public Risposta<Boolean> rifiuta(String token, String idFile, String messaggio, String cambiaFase, String assegna) {
try {
/**
* mi arriva l'avviso id lo recupero e setto rifiutato e dtRifiuto e aggiorno Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(GetterUtil.getLong(idFile));
* if (Validator.isNotNull(avviso)) {
* avviso.setRifiutato(true);
*/ avviso.setDtRifiuto(new Date());
Risposta<Boolean> risposta = new Risposta<Boolean>(); avviso.setCommentoRifiuto(Validator.isNotNull(messaggio) ? messaggio : StringPool.BLANK);
AvvisoLocalServiceUtil.updateAvviso(avviso);
try { risposta.setObj(true);
risposta.setRisposta(RispostaCostanti.OK);
Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(GetterUtil.getLong(idFile));
if (Validator.isNotNull(avviso)) { }
avviso.setRifiutato(true);
avviso.setDtRifiuto(new Date()); } catch (SystemException e) {
avviso.setCommentoRifiuto(Validator.isNotNull(messaggio) ? messaggio : StringPool.BLANK); _log.error(e.getMessage(), e);
risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE);
AvvisoLocalServiceUtil.updateAvviso(avviso); }
risposta.setObj(true);
risposta.setRisposta(RispostaCostanti.OK); return risposta;
}
}
public Risposta<Boolean> setFile(String token, String fileToSave, String tipo, String idFile,
} catch (SystemException e) { ServiceContext serviceContext) {
_log.error(e.getMessage(), e);
risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE); /**
} * Mi arriverà l avviso id e il contenuto e creero un file entry e
* aggiornero l avviso con il fileEntryIdInvio
return risposta; *
} * per la creazione del fileentry devo vedere SchedulerGeneraDocumento
* per creare il filename e la folder
public Risposta<Boolean> setFile(String token, String fileToSave, String tipo, String idFile, *
ServiceContext serviceContext) { */
Risposta<Boolean> risposta = new Risposta<Boolean>();
/**
* Mi arriverà l avviso id e il contenuto e creero un file entry e aggiornero l avviso con il try {
* fileEntryIdInvio Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(GetterUtil.getLong(idFile));
* if (Validator.isNotNull(avviso)) {
* per la creazione del fileentry devo vedere SchedulerGeneraDocumento per creare il filename e
* la folder // CREO IL FILE
* serviceContext.setCompanyId(avviso.getCompanyId());
*/ serviceContext.setScopeGroupId(avviso.getGroupId());
Risposta<Boolean> risposta = new Risposta<Boolean>(); serviceContext.setUserId(avviso.getUserId());
try { avviso = AvvisoLocalServiceUtil.addFileFirmato(avviso.getAvvisoId(), avviso.getClassPk(),
fileToSave, serviceContext);
Avviso avviso = AvvisoLocalServiceUtil.fetchAvviso(GetterUtil.getLong(idFile));
if (Validator.isNotNull(avviso)) { risposta.setObj(true);
risposta.setRisposta(RispostaCostanti.OK);
// CREO IL FILE }
serviceContext.setCompanyId(avviso.getCompanyId()); } catch (Exception e) {
serviceContext.setScopeGroupId(avviso.getGroupId()); _log.error(e.getMessage(), e);
serviceContext.setUserId(avviso.getUserId()); risposta.setObj(false);
risposta.setRisposta(RispostaCostanti.ERRORE_APPLICAZIONE);
avviso = }
AvvisoLocalServiceUtil
.addFileFirmato(avviso.getAvvisoId(), avviso.getClassPk(), fileToSave, serviceContext); return risposta;
}
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;
}
} }

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 { 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; List<PortletPreferences> pr = null;
String preferencesXML; String preferencesXML;
javax.portlet.PortletPreferences jxPortletPreferences = null; javax.portlet.PortletPreferences jxPortletPreferences = null;
try { try {
pr = pr = PortletPreferencesLocalServiceUtil.getPortletPreferences(
PortletPreferencesLocalServiceUtil.getPortletPreferences(PortletKeys.PREFS_OWNER_TYPE_COMPANY, 0, PortletKeys.PREFS_OWNER_TYPE_COMPANY, 0, "firma_WAR_portosfirmaportlet");
"firma_WAR_portosfirmaportlet"); preferencesXML = pr.get(0).getPreferences();
preferencesXML = pr.get(0).getPreferences(); jxPortletPreferences = PortletPreferencesFactoryUtil.fromDefaultXML(preferencesXML);
jxPortletPreferences = PortletPreferencesFactoryUtil.fromDefaultXML(preferencesXML); } catch (SystemException e) {
} catch (SystemException e) { _log.error(e.getMessage());
_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; List<String> listaCodiciFiscali = null;
try { try {
File file = File.createTempFile("codicefiscale", ".p7m"); File file = File.createTempFile("codicefiscale", ".p7m");
FileUtils.writeByteArrayToFile(file, fileArray); 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(); HttpPost request = new HttpPost(urlPdfExtractor);
entity.addPart("file", body); request.setEntity(entity);
HttpPost request = new HttpPost(urlPdfExtractor);
request.setEntity(entity);
HttpClient client = new DefaultHttpClient(); HttpClient client = new DefaultHttpClient();
HttpResponse response = client.execute(request); HttpResponse response = client.execute(request);
if (response.getStatusLine().getStatusCode() != 200) { if (response.getStatusLine().getStatusCode() != 200) {
throw new RuntimeException("Failed : HTTP error code : " + response.getStatusLine().getStatusCode()); throw new RuntimeException("Failed : HTTP error code : "
} + response.getStatusLine().getStatusCode());
InputStream inputStream = response.getEntity().getContent(); }
InputStream inputStream = response.getEntity().getContent();
ExtractorResponse extractorResponse = mapper.readValue(inputStream, ExtractorResponse.class); ExtractorResponse extractorResponse = mapper.readValue(inputStream, ExtractorResponse.class);
if (extractorResponse.isSuccess()) { if (extractorResponse.isSuccess()) {
listaCodiciFiscali = extractorResponse.getCf(); listaCodiciFiscali = extractorResponse.getCf();
} }
} catch (IOException e) { } catch (IOException e) {
_log.error(e.getMessage()); _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 Wing Shun Chan
* @author Brian Myunghun Kim * @author Brian Myunghun Kim
* @author Jorge Ferrer * @author Jorge Ferrer
* @author Neil Griffin * @author Neil Griffin<<
* @author Thiago Moreira * @author Thiago Moreira
* @author Brett Swaim * @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"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" path="src"/> <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"/> <classpathentry kind="output" path="classes"/>
</classpath> </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> { public class AttributesBuilder<T> {
private List<Attribute> _attributes = new ArrayList<Attribute>(); private List<Attribute> _attributes = new ArrayList<Attribute>();
private T _newBean; private T _newBean;
private T _oldBean; private T _oldBean;
public AttributesBuilder(T newBean, T oldBean) { public AttributesBuilder(T newBean, T oldBean) {
_newBean = newBean; _newBean = newBean;
_oldBean = oldBean; _oldBean = oldBean;
} }
public void add(String name) { public void add(String name) {
DateFormat format = DateFormatFactoryUtil.getSimpleDateFormat("yyyy/MM/dd HH:mm z", TimeZone.getTimeZone("UTC")); DateFormat format = DateFormatFactoryUtil.getSimpleDateFormat("yyyy/MM/dd HH:mm z",
Object newValueObj = BeanPropertiesUtil.getObject(_newBean, name); TimeZone.getTimeZone("UTC"));
Object oldValueObj = BeanPropertiesUtil.getObject(_oldBean, name); Object newValueObj = BeanPropertiesUtil.getObject(_newBean, name);
Object oldValueObj = BeanPropertiesUtil.getObject(_oldBean, name);
String newValue = null;
String oldValue = null; String newValue = null;
if (Validator.isNotNull(newValueObj)) { String oldValue = null;
newValue = newValueObj instanceof Date ? format.format(newValueObj) : newValueObj.toString(); 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.isNotNull(oldValueObj)) {
} oldValue = oldValueObj instanceof Date ? format.format(oldValueObj) : oldValueObj.toString();
if (!Validator.equals(newValue, oldValue)) { }
Attribute attribute = new Attribute(name, newValue, oldValue); if (!Validator.equals(newValue, oldValue)) {
Attribute attribute = new Attribute(name, newValue, oldValue);
_attributes.add(attribute);
} _attributes.add(attribute);
} }
}
public void addLocalized(String name) {
public void addLocalized(String name) {
DateFormat format = DateFormatFactoryUtil.getSimpleDateFormat("yyyy/MM/dd HH:mm z", TimeZone.getTimeZone("UTC"));
Object newValueObj = BeanPropertiesUtil.getObject(_newBean, name); DateFormat format = DateFormatFactoryUtil.getSimpleDateFormat("yyyy/MM/dd HH:mm z",
Object oldValueObj = BeanPropertiesUtil.getObject(_oldBean, name); TimeZone.getTimeZone("UTC"));
Object newValueObj = BeanPropertiesUtil.getObject(_newBean, name);
String newValue = null; Object oldValueObj = BeanPropertiesUtil.getObject(_oldBean, name);
String oldValue = null;
if (Validator.isNotNull(newValueObj)) { String newValue = null;
newValue = newValueObj instanceof Date ? format.format(newValueObj) : newValueObj.toString(); String oldValue = null;
} if (Validator.isNotNull(newValueObj)) {
if (Validator.isNotNull(oldValueObj)) { newValue = newValueObj instanceof Date ? format.format(newValueObj) : newValueObj.toString();
oldValue = oldValueObj instanceof Date ? format.format(oldValueObj) : oldValueObj.toString(); }
} if (Validator.isNotNull(oldValueObj)) {
oldValue = oldValueObj instanceof Date ? format.format(oldValueObj) : oldValueObj.toString();
if (!Validator.equals(newValue, oldValue)) { }
boolean createAttribute = false;
if (!Validator.equals(newValue, oldValue)) {
Map<Locale, String> newValueMap = LocalizationUtil.getLocalizationMap(newValue); boolean createAttribute = false;
Map<Locale, String> oldValueMap = LocalizationUtil.getLocalizationMap(oldValue);
Map<Locale, String> newValueMap = LocalizationUtil.getLocalizationMap(newValue);
if (Validator.isNull(newValueMap) && Validator.isNotNull(oldValueMap)) { Map<Locale, String> oldValueMap = LocalizationUtil.getLocalizationMap(oldValue);
createAttribute = true;
} else if (Validator.isNotNull(newValueMap) && Validator.isNull(oldValueMap)) { if (Validator.isNull(newValueMap) && Validator.isNotNull(oldValueMap)) {
createAttribute = true; createAttribute = true;
} else if (newValueMap.keySet().size() != oldValueMap.keySet().size()) { } else if (Validator.isNotNull(newValueMap) && Validator.isNull(oldValueMap)) {
createAttribute = true; createAttribute = true;
} else { } else if (newValueMap.keySet().size() != oldValueMap.keySet().size()) {
for (Locale locale : newValueMap.keySet()) { createAttribute = true;
if (!oldValueMap.keySet().contains(locale)) { } else {
createAttribute = true; for (Locale locale : newValueMap.keySet()) {
break; if (!oldValueMap.keySet().contains(locale)) {
} createAttribute = true;
break;
String newLocalizedValue = newValueMap.get(locale); }
String oldLocalizedValue = oldValueMap.get(locale);
if (!Validator.equals(newLocalizedValue, oldLocalizedValue)) { String newLocalizedValue = newValueMap.get(locale);
createAttribute = true; String oldLocalizedValue = oldValueMap.get(locale);
break; if (!Validator.equals(newLocalizedValue, oldLocalizedValue)) {
} createAttribute = true;
} break;
} }
}
if (createAttribute) { }
Attribute attribute = new Attribute(name, newValue, oldValue);
_attributes.add(attribute); if (createAttribute) {
} Attribute attribute = new Attribute(name, newValue, oldValue);
} _attributes.add(attribute);
} }
}
public JSONObject getAttributesJSON() { }
JSONArray jsonArray = JSONFactoryUtil.createJSONArray(); public JSONObject getAttributesJSON() {
for (Attribute attribute : _attributes) { JSONArray jsonArray = JSONFactoryUtil.createJSONArray();
JSONObject attributeJSONObject = JSONFactoryUtil.createJSONObject();
for (Attribute attribute : _attributes) {
attributeJSONObject.put("name", attribute.getName()); JSONObject attributeJSONObject = JSONFactoryUtil.createJSONObject();
attributeJSONObject.put("newValue", attribute.getNewValue());
attributeJSONObject.put("oldValue", attribute.getOldValue()); attributeJSONObject.put("name", attribute.getName());
attributeJSONObject.put("newValue", attribute.getNewValue());
jsonArray.put(attributeJSONObject); attributeJSONObject.put("oldValue", attribute.getOldValue());
}
jsonArray.put(attributeJSONObject);
JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); }
jsonObject.put("attributes", jsonArray);
JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
return jsonObject; jsonObject.put("attributes", jsonArray);
}
return jsonObject;
}
} }
class Attribute { class Attribute {
private String _name; private String _name;
private String _newValue; private String _newValue;
private String _oldValue; 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; _name = name;
_newValue = newValue; _newValue = newValue;
_oldValue = oldValue; _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> { public abstract class AuditModelListener<T extends BaseModel<T>> extends BaseModelListener<T> {
@Override
@Override public void onBeforeCreate(T model) throws ModelListenerException {
public void onBeforeCreate(T model) throws ModelListenerException {
routeAuditMessage(Constants.ADD.toUpperCase(), model, getMessage(model), null, false);
routeAuditMessage(Constants.ADD.toUpperCase(), model, getMessage(model), null, false); }
}
@Override
@Override public void onBeforeRemove(T model) throws ModelListenerException {
public void onBeforeRemove(T model) throws ModelListenerException {
routeAuditMessage(Constants.DELETE.toUpperCase(), model, getMessage(model), null, false);
routeAuditMessage(Constants.DELETE.toUpperCase(), model, getMessage(model), null, false); }
}
@Override
@Override public void onBeforeUpdate(T newModel) throws ModelListenerException {
public void onBeforeUpdate(T newModel) throws ModelListenerException {
try {
try {
T oldModel = getOldModel(newModel);
T oldModel = getOldModel(newModel);
JSONObject attributes = getModifiedAttributes(newModel, oldModel);
JSONObject attributes = getModifiedAttributes(newModel, oldModel); JSONArray array = attributes.getJSONArray("attributes");
JSONArray array = attributes.getJSONArray("attributes"); boolean isUpdate = true;
boolean isUpdate = true; if (array != null) {
if (array != null) { for (int i = 0; i < array.length(); i++) {
for (int i = 0; i < array.length(); i++) { String name = array.getJSONObject(i).getString("name");
String name = array.getJSONObject(i).getString("name"); String newValue = array.getJSONObject(i).getString("newValue");
String newValue = array.getJSONObject(i).getString("newValue"); if (name.equalsIgnoreCase(getStatoAttributesName())) {
if (name.equalsIgnoreCase(getStatoAttributesName())) {
routeAuditMessage(convertStatoToEventString(newValue), newModel,
routeAuditMessage(convertStatoToEventString(newValue), newModel, getMessage(newModel), attributes, true); getMessage(newModel), attributes, true);
if (array.length() == 1) { if (array.length() == 1) {
isUpdate = false; isUpdate = false;
} }
} }
attributes.remove(getStatoAttributesName()); attributes.remove(getStatoAttributesName());
} }
} }
if (isUpdate) { if (isUpdate) {
boolean sended = boolean sended = routeAuditMessage(Constants.UPDATE.toUpperCase(), newModel,
routeAuditMessage(Constants.UPDATE.toUpperCase(), newModel, getMessage(newModel), attributes, false); getMessage(newModel), attributes, false);
if (sended) { if (sended) {
onBeforeRealUpdate(newModel, oldModel); onBeforeRealUpdate(newModel, oldModel);
} }
} }
} catch (Exception e) { } catch (Exception e) {
throw new ModelListenerException(e); throw new ModelListenerException(e);
} }
} }
protected String convertStatoToEventString(String newValue) { protected String convertStatoToEventString(String newValue) {
if ("1".equalsIgnoreCase(newValue) || "true".equalsIgnoreCase(newValue)) { if ("1".equalsIgnoreCase(newValue) || "true".equalsIgnoreCase(newValue)) {
return Constants.ATTIVA.toUpperCase(); return Constants.ATTIVA.toUpperCase();
} else { } else {
return Constants.DISATTIVA.toUpperCase(); return Constants.DISATTIVA.toUpperCase();
} }
} }
protected String getStatoAttributesName() { protected String getStatoAttributesName() {
return "valido"; return "valido";
} }
protected String getStatoAttivaString() { protected String getStatoAttivaString() {
return "1"; return "1";
} }
protected abstract T getOldModel(T newModel) throws ModelListenerException; protected abstract T getOldModel(T newModel) throws ModelListenerException;
protected List<String> getExcludedFields() { protected List<String> getExcludedFields() {
List<String> esclusioni = new ArrayList<String>() { List<String> esclusioni = new ArrayList<String>() {
{ {
add("modifiedDate"); add("modifiedDate");
add("createDate"); add("createDate");
} }
}; };
return esclusioni; return esclusioni;
} }
protected JSONObject getModifiedAttributes(T newRelazioniAnagrafiche, T oldRelazioniAnagrafiche) { protected JSONObject getModifiedAttributes(T newRelazioniAnagrafiche, T oldRelazioniAnagrafiche) {
AttributesBuilder<T> attributesBuilder = new AttributesBuilder<T>(newRelazioniAnagrafiche, oldRelazioniAnagrafiche); AttributesBuilder<T> attributesBuilder = new AttributesBuilder<T>(newRelazioniAnagrafiche,
oldRelazioniAnagrafiche);
Map<String, Object> model = newRelazioniAnagrafiche.getModelAttributes();
Iterator<String> modelList = model.keySet().iterator(); Map<String, Object> model = newRelazioniAnagrafiche.getModelAttributes();
while (modelList.hasNext()) { Iterator<String> modelList = model.keySet().iterator();
String name = (String) modelList.next(); while (modelList.hasNext()) {
if (!getExcludedFields().contains(name)) { String name = (String) modelList.next();
attributesBuilder.add(name); if (!getExcludedFields().contains(name)) {
} attributesBuilder.add(name);
} }
}
return attributesBuilder.getAttributesJSON();
} return attributesBuilder.getAttributesJSON();
}
protected boolean routeAuditMessage(String eventAction, T model, String message, JSONObject additionalInfo,
boolean cambiostato) throws ModelListenerException { protected boolean routeAuditMessage(String eventAction, T model, String message,
String className = getClassName(model); JSONObject additionalInfo, boolean cambiostato) throws ModelListenerException {
if (cambiostato) { String className = getClassName(model);
AuditUtil.doCambioStato(getEventType(model), className, (Long) model.getPrimaryKeyObj(), message, if (cambiostato) {
getEventCategory(model), eventAction); AuditUtil.doCambioStato(getEventType(model), className, (Long) model.getPrimaryKeyObj(), message,
onBeforeCambioStato(model); getEventCategory(model), eventAction);
return true; onBeforeCambioStato(model);
} else if (additionalInfo == null) { return true;
AuditUtil.doLog(getEventType(model), className, (Long) model.getPrimaryKeyObj(), message, } else if (additionalInfo == null) {
getEventCategory(model), eventAction, getParentClassName(model), getParentClassPk(model), AuditUtil.doLog(getEventType(model), className, (Long) model.getPrimaryKeyObj(), message,
getRelatedClassName(model), getRelatedClassPk(model), getAdditionalInfoForLogEvent(eventAction, model)); getEventCategory(model), eventAction, getParentClassName(model), getParentClassPk(model),
onBeforeLog(model); getRelatedClassName(model), getRelatedClassPk(model),
return true; getAdditionalInfoForLogEvent(eventAction, model));
} else { onBeforeLog(model);
return AuditUtil.doStorico(getEventType(model), className, (Long) model.getPrimaryKeyObj(), message, return true;
getEventCategory(model), eventAction, getParentClassName(model), getParentClassPk(model), } else {
getRelatedClassName(model), getRelatedClassPk(model), additionalInfo, null); 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 JSONObject getAdditionalInfoForLogEvent(String eventAction, T model) {
protected void onBeforeRealUpdate(T newModel, T oldModel) throws ModelListenerException {} return null;
}
protected void onBeforeLog(T model) throws ModelListenerException {}
protected void onBeforeRealUpdate(T newModel, T oldModel) throws ModelListenerException {
protected void onBeforeCambioStato(T model) throws ModelListenerException {} }
protected Long getParentClassPk(T model) { protected void onBeforeLog(T model) throws ModelListenerException {
return 0l; }
}
protected void onBeforeCambioStato(T model) throws ModelListenerException {
protected String getParentClassName(T model) { }
return StringPool.BLANK;
} protected Long getParentClassPk(T model) {
return 0l;
protected Long getRelatedClassPk(T model) { }
return 0l;
} protected String getParentClassName(T model) {
return StringPool.BLANK;
protected String getRelatedClassName(T model) { }
return StringPool.BLANK;
} protected Long getRelatedClassPk(T model) {
return 0l;
protected String getMessage(T model) { }
return StringPool.BLANK;
} protected String getRelatedClassName(T model) {
return StringPool.BLANK;
protected abstract String getClassName(T model); }
protected abstract String getEventType(T model); protected String getMessage(T model) {
return StringPool.BLANK;
protected abstract String getEventCategory(T model); }
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 class AuditUtil {
public static void doLog(String eventType, String className, long classPK) throws ModelListenerException { public static void doLog(String eventType, String className, long classPK) throws ModelListenerException {
doLog(eventType, className, classPK, StringPool.BLANK); doLog(eventType, className, classPK, StringPool.BLANK);
} }
public static void doLog(String eventType, String className, long classPK, String message) public static void doLog(String eventType, String className, long classPK, String message)
throws ModelListenerException { throws ModelListenerException {
doLog(eventType, className, classPK, message, StringPool.BLANK, StringPool.BLANK, StringPool.BLANK, 0l, doLog(eventType, className, classPK, message, StringPool.BLANK, StringPool.BLANK, StringPool.BLANK,
StringPool.BLANK, 0l, null); 0l, StringPool.BLANK, 0l, null);
} }
public static void doLog(String eventType, String className, long classPK, String message, String eventCategory, public static void doLog(String eventType, String className, long classPK, String message,
String eventAction, String parentClassName, Long parentClassPK, String relatedClassName, Long relatedClassPK, String eventCategory, String eventAction, String parentClassName, Long parentClassPK,
JSONObject additionalInfo) throws ModelListenerException { 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); 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, public static boolean doStorico(String eventType, String className, long classPK, String message,
Long relatedClassPK, JSONObject diff, JSONObject additionalInfo) throws ModelListenerException { String eventCategory, String eventAction, String parentClassName, Long parentClassPK,
if (diff != null && !diff.isNull("attributes") && diff.getJSONArray("attributes").length() > 0) { String relatedClassName, Long relatedClassPK, JSONObject diff, JSONObject additionalInfo)
doAudit(eventType, className, classPK, message, AuditKey.EVENT_TABLE_STORICO, eventCategory, eventAction, throws ModelListenerException {
parentClassName, parentClassPK, relatedClassName, relatedClassPK, diff, additionalInfo); if (diff != null && !diff.isNull("attributes") && diff.getJSONArray("attributes").length() > 0) {
return true; doAudit(eventType, className, classPK, message, AuditKey.EVENT_TABLE_STORICO, eventCategory,
} else { eventAction, parentClassName, parentClassPK, relatedClassName, relatedClassPK, diff,
return false; 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); 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 {
private static void doAudit(String eventType, String className, long classPK, String message,
try { String auditEventTable, String eventCategory, String eventAction, String parentClassName,
if (additionalInfo == null) Long parentClassPK, String relatedClassName, Long relatedClassPK, JSONObject diff,
additionalInfo = JSONFactoryUtil.createJSONObject(); JSONObject additionalInfo) throws ModelListenerException {
addIfNotNull(additionalInfo, AuditKey.FIELD_AUDIT_EVENT_TABLE, auditEventTable); try {
addIfNotNull(additionalInfo, AuditKey.FIELD_EVENT_CATEGORY, eventCategory); if (additionalInfo == null)
addIfNotNull(additionalInfo, AuditKey.FIELD_EVENT_ACTION, eventAction); additionalInfo = JSONFactoryUtil.createJSONObject();
addIfNotNull(additionalInfo, AuditKey.FIELD_PARENT_CLASS_NAME, parentClassName);
addIfNotNull(additionalInfo, AuditKey.FIELD_PARENT_CLASS_PK, parentClassPK); addIfNotNull(additionalInfo, AuditKey.FIELD_AUDIT_EVENT_TABLE, auditEventTable);
addIfNotNull(additionalInfo, AuditKey.FIELD_RELATED_CLASS_NAME, relatedClassName); addIfNotNull(additionalInfo, AuditKey.FIELD_EVENT_CATEGORY, eventCategory);
addIfNotNull(additionalInfo, AuditKey.FIELD_RELATED_CLASS_PK, relatedClassPK); addIfNotNull(additionalInfo, AuditKey.FIELD_EVENT_ACTION, eventAction);
if (diff != null) { addIfNotNull(additionalInfo, AuditKey.FIELD_PARENT_CLASS_NAME, parentClassName);
additionalInfo.put(AuditKey.FIELD_DIFF, diff); addIfNotNull(additionalInfo, AuditKey.FIELD_PARENT_CLASS_PK, parentClassPK);
} addIfNotNull(additionalInfo, AuditKey.FIELD_RELATED_CLASS_NAME, relatedClassName);
addIfNotNull(additionalInfo, AuditKey.FIELD_RELATED_CLASS_PK, relatedClassPK);
long companyId = CompanyThreadLocal.getCompanyId(); if (diff != null) {
additionalInfo.put(AuditKey.FIELD_DIFF, diff);
long userId = 0; }
if (PrincipalThreadLocal.getName() != null) {
userId = GetterUtil.getLong(PrincipalThreadLocal.getName()); long companyId = CompanyThreadLocal.getCompanyId();
}
long userId = 0;
AuditRequestThreadLocal auditRequestThreadLocal = AuditRequestThreadLocal.getAuditThreadLocal(); if (PrincipalThreadLocal.getName() != null) {
long realUserId = auditRequestThreadLocal.getRealUserId(); userId = GetterUtil.getLong(PrincipalThreadLocal.getName());
String realUserName = PortalUtil.getUserName(realUserId, StringPool.BLANK); }
if ((realUserId > 0) && (userId != realUserId)) { AuditRequestThreadLocal auditRequestThreadLocal = AuditRequestThreadLocal.getAuditThreadLocal();
additionalInfo.put("doAsUserId", String.valueOf(userId)); long realUserId = auditRequestThreadLocal.getRealUserId();
additionalInfo.put("doAsUserName", PortalUtil.getUserName(userId, StringPool.BLANK)); String realUserName = PortalUtil.getUserName(realUserId, StringPool.BLANK);
}
if ((realUserId > 0) && (userId != realUserId)) {
AuditMessage auditMessage = additionalInfo.put("doAsUserId", String.valueOf(userId));
new AuditMessage(eventType, companyId, realUserId, realUserName, className, String.valueOf(classPK), message, additionalInfo.put("doAsUserName", PortalUtil.getUserName(userId, StringPool.BLANK));
additionalInfo); }
AuditRouterUtil.route(auditMessage); AuditMessage auditMessage = new AuditMessage(eventType, companyId, realUserId, realUserName,
} catch (PortalException e) { className, String.valueOf(classPK), message, additionalInfo);
throw new ModelListenerException(e);
} 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, 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);
} 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 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)) { if (!contains(permissionChecker, groupId, actionId)) {
throw new PrincipalException(); 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 = Boolean hasPermission = StagingPermissionUtil.hasPermission(permissionChecker, groupId,
StagingPermissionUtil.hasPermission(permissionChecker, groupId, RESOURCE_NAME, groupId, RESOURCE_NAME, groupId, PortletKeys.AUDIT_DETAIL, actionId);
PortletKeys.AUDIT_DETAIL, actionId);
if (hasPermission != null) { if (hasPermission != null) {
return hasPermission.booleanValue(); 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; package it.tref.liferay.portos.audit.shared.util;
public class Constants implements com.liferay.portal.kernel.util.Constants { public class Constants implements com.liferay.portal.kernel.util.Constants {
public static final String ATTIVA = "ATTIVA";
public static final String ATTIVA = "ATTIVA"; public static final String DISATTIVA = "DISATTIVA";
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; package it.tref.liferay.portos.audit.shared.util;
public class PortletKeys extends com.liferay.portal.util.PortletKeys { public class PortletKeys extends com.liferay.portal.util.PortletKeys {
public static final String AUDIT = "1_WAR_portosauditportlet";
public static final String AUDIT = "1_WAR_portosauditportlet"; public static final String AUDIT_DETAIL = "2_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 { 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> firmeDigitali = new UniqueList<FirmeDetail>();
private List<FirmeDetail> firmeApplicativo = new UniqueList<FirmeDetail>(); private List<FirmeDetail> firmeApplicativo = new UniqueList<FirmeDetail>();
public List<FirmeDetail> getFirmeDigitali() { public List<FirmeDetail> getFirmeDigitali() {
return new UnmodifiableList<>(firmeDigitali); return new UnmodifiableList<>(firmeDigitali);
} }
public void setFirmeDigitali(List<FirmeDetail> firmeDigitali) { public void setFirmeDigitali(List<FirmeDetail> firmeDigitali) {
this.firmeDigitali = new UniqueList<FirmeDetail>(); this.firmeDigitali = new UniqueList<FirmeDetail>();
for (FirmeDetail firmaDigitale : firmeDigitali) { for (FirmeDetail firmaDigitale : firmeDigitali) {
this.firmeDigitali.add(firmaDigitale); this.firmeDigitali.add(firmaDigitale);
} }
} }
public List<FirmeDetail> getFirmeApplicativo() { public List<FirmeDetail> getFirmeApplicativo() {
return new UnmodifiableList<>(firmeApplicativo); return new UnmodifiableList<>(firmeApplicativo);
} }
public void setFirmeApplicativo(List<FirmeDetail> firmeApplicativo) { public void setFirmeApplicativo(List<FirmeDetail> firmeApplicativo) {
this.firmeApplicativo = new UniqueList<FirmeDetail>(); this.firmeApplicativo = new UniqueList<FirmeDetail>();
for (FirmeDetail firmaApplicativo : firmeApplicativo) { for (FirmeDetail firmaApplicativo : firmeApplicativo) {
this.firmeApplicativo.add(firmaApplicativo); this.firmeApplicativo.add(firmaApplicativo);
} }
} }
public boolean firmaIsPresent(String codiceFiscale) { public boolean firmaIsPresent(String codiceFiscale) {
for (FirmeDetail firmaDigitale : firmeDigitali) { for (FirmeDetail firmaDigitale : firmeDigitali) {
if (firmaDigitale.getCfFirmatario().equalsIgnoreCase(codiceFiscale)) { if (firmaDigitale.getCfFirmatario().equalsIgnoreCase(codiceFiscale)) {
return true; return true;
} }
} }
for (FirmeDetail firmaApplicativo : firmeApplicativo) { for (FirmeDetail firmaApplicativo : firmeApplicativo) {
if (firmaApplicativo.getCfFirmatario().equalsIgnoreCase(codiceFiscale)) { if (firmaApplicativo.getCfFirmatario().equalsIgnoreCase(codiceFiscale)) {
return true; return true;
} }
} }
return false; return false;
} }
public boolean firmaIsAnnullabile(String codiceFiscale) { public boolean firmaIsAnnullabile(String codiceFiscale) {
for (FirmeDetail firmaApplicativo : firmeApplicativo) { for (FirmeDetail firmaApplicativo : firmeApplicativo) {
if (firmaApplicativo.getCfFirmatario().equalsIgnoreCase(codiceFiscale)) { if (firmaApplicativo.getCfFirmatario().equalsIgnoreCase(codiceFiscale)) {
return true; return true;
} }
} }
return false; return false;
} }
public int numeroFirme() { public int numeroFirme() {
List<String> allSignatures = allSignatures(); List<String> allSignatures = allSignatures();
return allSignatures.size(); return allSignatures.size();
} }
public List<String> allSignatures() { public List<String> allSignatures() {
List<String> all = new UniqueList<String>(); List<String> all = new UniqueList<String>();
for (FirmeDetail firmaDigitale : firmeDigitali) { for (FirmeDetail firmaDigitale : firmeDigitali) {
all.add(firmaDigitale.getCfFirmatario().toLowerCase()); all.add(firmaDigitale.getCfFirmatario().toLowerCase());
} }
for (FirmeDetail firmaApplicativo : firmeApplicativo) { for (FirmeDetail firmaApplicativo : firmeApplicativo) {
all.add(firmaApplicativo.getCfFirmatario().toLowerCase()); all.add(firmaApplicativo.getCfFirmatario().toLowerCase());
} }
return all; return all;
} }
public List<FirmeDetail> allFirmeDetails() { public List<FirmeDetail> allFirmeDetails() {
List<FirmeDetail> all = new UniqueList<FirmeDetail>(); List<FirmeDetail> all = new UniqueList<FirmeDetail>();
all.addAll(firmeDigitali); all.addAll(firmeDigitali);
all.addAll(firmeApplicativo); all.addAll(firmeApplicativo);
return all; return all;
} }
public void removeFirmeApplicativo(String codiceFiscale) { public void removeFirmeApplicativo(String codiceFiscale) {
FirmeDetail firmeDetailToRemove = null; FirmeDetail firmeDetailToRemove = null;
for (FirmeDetail firmeDetail : firmeApplicativo) { for (FirmeDetail firmeDetail : firmeApplicativo) {
if (codiceFiscale.equalsIgnoreCase(firmeDetail.getCfFirmatario())) { if (codiceFiscale.equalsIgnoreCase(firmeDetail.getCfFirmatario())) {
firmeDetailToRemove = firmeDetail; firmeDetailToRemove = firmeDetail;
break; break;
} }
} }
firmeApplicativo.remove(firmeDetailToRemove); 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 { public class Fascicolo {
private int anno; private int anno;
private int numero; private int numero;
public Fascicolo() {} 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 class Protocollo {
public enum TipoProtocollo { public enum TipoProtocollo {
INGRESSO, INGRESSO, USCITA
USCITA }
}
private Date dataInserimento;
private Date dataInserimento; private boolean chiuso;
private String ufficioId;
private boolean chiuso; private String praticaId;
private String utenteId;
private String ufficioId; private String oggetto;
private TipoProtocollo tipo;
private String praticaId; private List<File> files;
private String utenteId; public boolean isChiuso() {
return chiuso;
private String oggetto; }
private TipoProtocollo tipo; public void setChiuso(boolean chiuso) {
this.chiuso = chiuso;
private List<File> files; }
public boolean isChiuso() { public String getUfficioId() {
return ufficioId;
return chiuso; }
}
public void setUfficioId(String ufficioId) {
public void setChiuso(boolean chiuso) { this.ufficioId = ufficioId;
}
this.chiuso = chiuso;
} public String getUtenteId() {
return utenteId;
public String getUfficioId() { }
return ufficioId; public void setUtenteId(String utenteId) {
} this.utenteId = utenteId;
}
public void setUfficioId(String ufficioId) {
public String getOggetto() {
this.ufficioId = ufficioId; return oggetto;
} }
public String getUtenteId() { public void setOggetto(String oggetto) {
this.oggetto = oggetto;
return utenteId; }
}
public TipoProtocollo getTipo() {
public void setUtenteId(String utenteId) { return tipo;
}
this.utenteId = utenteId;
} public void setTipo(TipoProtocollo tipo) {
this.tipo = tipo;
public String getOggetto() { }
return oggetto; public List<File> getFiles() {
} return files;
}
public void setOggetto(String oggetto) {
public void setFiles(List<File> files) {
this.oggetto = oggetto; this.files = files;
} }
public TipoProtocollo getTipo() { public String getPraticaId() {
return praticaId;
return tipo; }
}
public void setPraticaId(String praticaId) {
public void setTipo(TipoProtocollo tipo) { this.praticaId = praticaId;
}
this.tipo = tipo;
} public Date getDataInserimento() {
return dataInserimento;
public List<File> getFiles() { }
return files; public void setDataInserimento(Date dataInserimento) {
} this.dataInserimento = dataInserimento;
}
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.LinkedHashMap;
import java.util.Map; import java.util.Map;
public class StatoPraticaConstants { public class StatoPraticaConstants {
public final static String SORTEGGIATA = "SO"; public final static String SORTEGGIATA = "SO";
public final static String SOTTOPOSTA_A_PARERE = "SP"; public final static String SOTTOPOSTA_A_PARERE = "SP";
public final static String RIFIUTATA = "RI"; public final static String RIFIUTATA = "RI";
public final static String VIDIMATA = "VI"; public final static String VIDIMATA = "VI";
public final static String CONFORME = "CO"; public final static String CONFORME = "CO";
public final static String NON_CONFORME = "NC"; public final static String NON_CONFORME = "NC";
public final static String INTEGRAZIONE = "IN"; public final static String INTEGRAZIONE = "IN";
public final static String VARIATA = "VA"; public final static String VARIATA = "VA";
public static final String FINE_LAVORI = "FL"; public static final String FINE_LAVORI = "FL";
public static final String COLLAUDO = "CL"; public static final String COLLAUDO = "CL";
public static final String FINE_LAVORI_PARZIALE = "FP"; public static final String FINE_LAVORI_PARZIALE = "FP";
public static final String COLLAUDO_PARZIALE = "CP"; public static final String COLLAUDO_PARZIALE = "CP";
public static final String ANNULLATA = "AL"; public static final String ANNULLATA = "AL";
// public static final String INTEGRAZIONE_RIFIUTATA = "NI"; public static final String INTEGRAZIONE_ACCETTATA = "SI";
public static final String INTEGRAZIONE_ACCETTATA = "SI";
/* Stati "virtuali" */
/* Stati "virtuali" */ public static final String CAMBIO_ISTRUTTORE = "CI";
public static final String CAMBIO_ISTRUTTORE = "CI"; public final static String AUTORIZZATA = "AU";
public final static String AUTORIZZATA = "AU"; public final static String NON_AUTORIZZATA = "AN";
public final static String NON_AUTORIZZATA = "AN"; public final static String ANNULLA_ISTANZA = "AI";
public final static String ANNULLA_ISTANZA = "AI"; public final static String VARIAZIONE_SOGGETTI = "VS";
public final static String VARIAZIONE_SOGGETTI = "VS"; public static final String INVIO_AVVISO_MANUALE = "MA";
// public static final String ASSEGNATA = "AS";
// public static final String ATTESA_FIRMA = "AF"; private static final Map<String, String> statusLabel;
// public static final String APPROVAZIONE = "AP"; private static final Map<String, String> statusFilterLabel;
// public static final String FINE_LAVORI_CON_ANOMALIA = "FA";
static {
private static final Map<String, String> statusLabel; statusLabel = new LinkedHashMap<String, String>();
private static final Map<String, String> statusFilterLabel; statusLabel.put(StatoPraticaConstants.SORTEGGIATA, "label.admingeniocivile.statopratica.sorteggiata");
statusLabel.put(StatoPraticaConstants.SOTTOPOSTA_A_PARERE,
static { "label.admingeniocivile.statopratica.sottopostaaparere");
statusLabel = new LinkedHashMap<String, String>(); statusLabel.put(StatoPraticaConstants.VIDIMATA, "label.admingeniocivile.statopratica.vidimata");
statusLabel.put(StatoPraticaConstants.SORTEGGIATA, "label.admingeniocivile.statopratica.sorteggiata"); statusLabel.put(StatoPraticaConstants.CONFORME, "label.admingeniocivile.statopratica.conforme");
statusLabel.put(StatoPraticaConstants.SOTTOPOSTA_A_PARERE, "label.admingeniocivile.statopratica.sottopostaaparere"); statusLabel
statusLabel.put(StatoPraticaConstants.VIDIMATA, "label.admingeniocivile.statopratica.vidimata"); .put(StatoPraticaConstants.NON_CONFORME, "label.admingeniocivile.statopratica.nonconforme");
statusLabel.put(StatoPraticaConstants.CONFORME, "label.admingeniocivile.statopratica.conforme"); statusLabel.put(StatoPraticaConstants.AUTORIZZATA,
statusLabel.put(StatoPraticaConstants.NON_CONFORME, "label.admingeniocivile.statopratica.nonconforme"); "label.admingeniocivile.statopratica.autorizzazione");
statusLabel.put(StatoPraticaConstants.AUTORIZZATA, "label.admingeniocivile.statopratica.autorizzazione"); statusLabel.put(StatoPraticaConstants.NON_AUTORIZZATA,
statusLabel.put(StatoPraticaConstants.NON_AUTORIZZATA, "label.admingeniocivile.statopratica.autorizzazionenegata"); "label.admingeniocivile.statopratica.autorizzazionenegata");
statusLabel.put(StatoPraticaConstants.INTEGRAZIONE, "label.admingeniocivile.statopratica.integrazione"); statusLabel.put(StatoPraticaConstants.INTEGRAZIONE,
statusLabel.put(StatoPraticaConstants.RIFIUTATA, "label.admingeniocivile.statopratica.rifiutata"); "label.admingeniocivile.statopratica.integrazione");
statusLabel.put(StatoPraticaConstants.FINE_LAVORI, "label.admingeniocivile.statopratica.finelavori"); statusLabel.put(StatoPraticaConstants.RIFIUTATA, "label.admingeniocivile.statopratica.rifiutata");
statusLabel.put(StatoPraticaConstants.COLLAUDO, "label.admingeniocivile.statopratica.collaudo"); statusLabel.put(StatoPraticaConstants.FINE_LAVORI, "label.admingeniocivile.statopratica.finelavori");
statusLabel.put(StatoPraticaConstants.FINE_LAVORI_PARZIALE, statusLabel.put(StatoPraticaConstants.COLLAUDO, "label.admingeniocivile.statopratica.collaudo");
"label.admingeniocivile.statopratica.finelavoriparziale"); statusLabel.put(StatoPraticaConstants.FINE_LAVORI_PARZIALE,
statusLabel.put(StatoPraticaConstants.COLLAUDO_PARZIALE, "label.admingeniocivile.statopratica.collaudoparziale"); "label.admingeniocivile.statopratica.finelavoriparziale");
statusLabel.put(StatoPraticaConstants.ANNULLATA, "label.admingeniocivile.statopratica.annullata"); statusLabel.put(StatoPraticaConstants.COLLAUDO_PARZIALE,
statusLabel.put(StatoPraticaConstants.CAMBIO_ISTRUTTORE, "label.admingeniocivile.statopratica.cambiIstruttore"); "label.admingeniocivile.statopratica.collaudoparziale");
// statusLabel.put(StatoPraticaConstants.ASSEGNATA, statusLabel.put(StatoPraticaConstants.ANNULLATA, "label.admingeniocivile.statopratica.annullata");
// "label.admingeniocivile.statopratica.assegnata"); statusLabel.put(StatoPraticaConstants.CAMBIO_ISTRUTTORE,
// statusLabel.put(StatoPraticaConstants.ATTESA_FIRMA, "label.admingeniocivile.statopratica.cambiIstruttore");
// "label.admingeniocivile.statopratica.attesafirma");
// statusLabel.put(StatoPraticaConstants.APPROVAZIONE, statusFilterLabel = new LinkedHashMap<String, String>();
// "label.admingeniocivile.statopratica.approvazione"); for (String statoPratica : statusLabel.keySet()) {
// statusLabel.put(StatoPraticaConstants.FINE_LAVORI_CON_ANOMALIA, if (!statoPratica.equals(StatoPraticaConstants.SORTEGGIATA)) {
// "label.admingeniocivile.statopratica.finelavorianomalia"); statusFilterLabel.put(statoPratica, statusLabel.get(statoPratica));
}
statusFilterLabel = new LinkedHashMap<String, String>(); }
for (String statoPratica : statusLabel.keySet()) { }
if (/* !statoPratica.equals(StatoPraticaConstants.FINE_LAVORI_CON_ANOMALIA) && */
!statoPratica.equals(StatoPraticaConstants.SORTEGGIATA)) { public static String getStatusLabel(String statoPratica) {
statusFilterLabel.put(statoPratica, statusLabel.get(statoPratica));
} return getStatusLabelMap().get(statoPratica);
} }
}
public static Map<String, String> getStatusLabelMap() {
public static String getStatusLabel(String statoPratica) {
return statusLabel;
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"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" path="src"/> <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"> <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> <attributes>
<attribute name="javadoc_location" value="file:/home/portos/sources/liferay-javadocs-all/"/> <attribute name="javadoc_location" value="file:/home/portos/sources/liferay-javadocs-all/"/>

Caricamento…
Annulla
Salva