Salvatore La Manna 4 anni fa
parent
commit
42b5422ff2
  1. 228
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/ManutenzioneDatabase.java
  2. 1311
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SismicaUtil.java
  3. 6
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/SismicaAdministrationPortlet.java
  4. 12
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/scheduler/SchedulerInvioDocumento.java
  5. 2
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AsseverazioneLocalServiceImpl.java
  6. 5
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/advanced_search.jsp
  7. 2
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/view.jsp
  8. 4
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/sismica_administration/view.jsp
  9. 1
      liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/build.xml
  10. BIN
      liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/firma-application-shared-0.0.1.jar
  11. 1
      liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/.tern-project
  12. 2
      liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/service.xml
  13. 6
      liferay-plugins-sdk-6.2/shared/portos-firma-shared/.classpath
  14. 1
      liferay-plugins-sdk-6.2/shared/portos-firma-shared/.gitignore
  15. 17
      liferay-plugins-sdk-6.2/shared/portos-firma-shared/.project
  16. 8
      liferay-plugins-sdk-6.2/shared/portos-firma-shared/build.xml
  17. 92
      liferay-plugins-sdk-6.2/shared/portos-firma-shared/src/it/tref/firma/shared/RestFile.java
  18. 23
      liferay-plugins-sdk-6.2/shared/portos-firma-shared/src/it/tref/firma/shared/Risposta.java
  19. 13
      liferay-plugins-sdk-6.2/shared/portos-firma-shared/src/it/tref/firma/shared/RispostaCostanti.java
  20. 26
      liferay-plugins-sdk-6.2/shared/portos-firma-shared/src/it/tref/firma/shared/Stile.java
  21. 2
      liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/.classpath
  22. 58
      liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/messaging/dto/MailTemplateMessage.java
  23. 167
      liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/messaging/dto/TemplateMessage.java
  24. 10
      liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/messaging/util/DestinationNames.java
  25. 163
      liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/model/FileAttachment.java
  26. 49
      liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/util/MailManagerConstants.java
  27. 165
      liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/util/MailUtil.java
  28. 15
      liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/util/StringUtil.java

228
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SvuotaDatabase.java → liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/ManutenzioneDatabase.java

@ -149,8 +149,8 @@ import com.liferay.sync.service.SyncDLObjectLocalServiceUtil;
* DELETE FROM "users_groups" WHERE "userid" IN (SELECT DISTINCT "ug"."userid" FROM "users_groups" "ug" LEFT JOIN "user_" "u" ON "ug"."userid"="u"."userid" WHERE "u"."userid" IS NULL); * DELETE FROM "users_groups" WHERE "userid" IN (SELECT DISTINCT "ug"."userid" FROM "users_groups" "ug" LEFT JOIN "user_" "u" ON "ug"."userid"="u"."userid" WHERE "u"."userid" IS NULL);
* *
*/ */
public class SvuotaDatabase { public class ManutenzioneDatabase {
private static final Log _log = LogFactoryUtil.getLog(SvuotaDatabase.class); private static final Log _log = LogFactoryUtil.getLog(ManutenzioneDatabase.class);
private static final int SLICE = 1000; private static final int SLICE = 1000;
// !Run!IntPratica!User!Reset! // !Run!IntPratica!User!Reset!
@ -158,7 +158,7 @@ public class SvuotaDatabase {
public static List<String> pulisci(ServiceContext serviceContext, String mode) throws SystemException, public static List<String> pulisci(ServiceContext serviceContext, String mode) throws SystemException,
PortalException { PortalException {
List<String> esito = new ArrayList<>(); List<String> esito = new ArrayList<>();
if (mode.contains("!Run!")) { if (mode.contains("!Pulisci!")) {
long companyId = serviceContext.getCompanyId(); long companyId = serviceContext.getCompanyId();
esito.addAll(puliziaDocumentLibrary(companyId)); esito.addAll(puliziaDocumentLibrary(companyId));
if (mode.contains("!IntPratica!")) { if (mode.contains("!IntPratica!")) {
@ -180,6 +180,8 @@ public class SvuotaDatabase {
} catch (IllegalStateException e) { } catch (IllegalStateException e) {
} }
_log.info("Elaborazione completata correttamente."); _log.info("Elaborazione completata correttamente.");
} else if (mode.contains("!Integrazioni!")) {
SismicaUtil.integrazioniScadute();
} else { } else {
esitoLog(esito, "Nessun comando"); esitoLog(esito, "Nessun comando");
} }
@ -589,7 +591,7 @@ public class SvuotaDatabase {
int rimossi = 0; int rimossi = 0;
intPratiche = IntPraticaLocalServiceUtil.getIntPraticas(start, start + SLICE); intPratiche = IntPraticaLocalServiceUtil.getIntPraticas(start, start + SLICE);
for (IntPratica intPratica : intPratiche) { for (IntPratica intPratica : intPratiche) {
IntPraticaLocalServiceUtil.deleteIntPratica(intPratica); IntPraticaLocalServiceUtil.deleteIntPratica(intPratica, true);
cancellati++; cancellati++;
rimossi++; rimossi++;
} }
@ -916,118 +918,120 @@ public class SvuotaDatabase {
} }
private static boolean esiste(String className, long classPK, long companyId) throws SystemException { private static boolean esiste(String className, long classPK, long companyId) throws SystemException {
try { if (0 != classPK && Validator.isNotNull(className)) {
if (ALLEGATOMANUALE_CLASS_NAME.equals(className)) { try {
AllegatoManualeLocalServiceUtil.getAllegatoManuale(classPK); if (ALLEGATOMANUALE_CLASS_NAME.equals(className)) {
} else if (ASSETTAG_CLASS_NAME.equals(className)) { AllegatoManualeLocalServiceUtil.getAllegatoManuale(classPK);
AssetTagLocalServiceUtil.getAssetTag(classPK); } else if (ASSETTAG_CLASS_NAME.equals(className)) {
} else if (ASSETVOCABULARY_CLASS_NAME.equals(className)) { AssetTagLocalServiceUtil.getAssetTag(classPK);
AssetVocabularyLocalServiceUtil.getAssetVocabulary(classPK); } else if (ASSETVOCABULARY_CLASS_NAME.equals(className)) {
} else if (ASSEVERAZIONE_CLASS_NAME.equals(className)) { AssetVocabularyLocalServiceUtil.getAssetVocabulary(classPK);
AsseverazioneLocalServiceUtil.getAsseverazione(classPK); } else if (ASSEVERAZIONE_CLASS_NAME.equals(className)) {
} else if (AVVISO_CLASS_NAME.equals(className)) { AsseverazioneLocalServiceUtil.getAsseverazione(classPK);
AvvisoLocalServiceUtil.getAvviso(classPK); } else if (AVVISO_CLASS_NAME.equals(className)) {
} else if (COLLAUDO_CLASS_NAME.equals(className)) { AvvisoLocalServiceUtil.getAvviso(classPK);
CollaudoLocalServiceUtil.getCollaudo(classPK); } else if (COLLAUDO_CLASS_NAME.equals(className)) {
} else if (COMPANY_CLASS_NAME.equals(className)) { CollaudoLocalServiceUtil.getCollaudo(classPK);
CompanyLocalServiceUtil.getCompany(classPK); } else if (COMPANY_CLASS_NAME.equals(className)) {
} else if (CONTROLLOPRATICA_CLASS_NAME.equals(className)) { CompanyLocalServiceUtil.getCompany(classPK);
ControlloPraticaLocalServiceUtil.getControlloPratica(classPK); } else if (CONTROLLOPRATICA_CLASS_NAME.equals(className)) {
} else if (DOCAGGIUNTIVA_CLASS_NAME.equals(className)) { ControlloPraticaLocalServiceUtil.getControlloPratica(classPK);
DocAggiuntivaLocalServiceUtil.getDocAggiuntiva(classPK); } else if (DOCAGGIUNTIVA_CLASS_NAME.equals(className)) {
} else if (DOCPRATICA_CLASS_NAME.equals(className)) { DocAggiuntivaLocalServiceUtil.getDocAggiuntiva(classPK);
DocPraticaLocalServiceUtil.getDocPratica(classPK); } else if (DOCPRATICA_CLASS_NAME.equals(className)) {
} else if (DDMSTRUCTURE_CLASS_NAME.equals(className)) { DocPraticaLocalServiceUtil.getDocPratica(classPK);
DDMStructureLocalServiceUtil.getDDMStructure(classPK); } else if (DDMSTRUCTURE_CLASS_NAME.equals(className)) {
} else if (DDMTEMPLATE_CLASS_NAME.equals(className)) { DDMStructureLocalServiceUtil.getDDMStructure(classPK);
DDMTemplateLocalServiceUtil.getDDMTemplate(classPK); } else if (DDMTEMPLATE_CLASS_NAME.equals(className)) {
} else if (DELEGA_CLASS_NAME.equals(className)) { DDMTemplateLocalServiceUtil.getDDMTemplate(classPK);
DelegaLocalServiceUtil.getDelega(classPK); } else if (DELEGA_CLASS_NAME.equals(className)) {
} else if (DETTPRATICA_CLASS_NAME.equals(className)) { DelegaLocalServiceUtil.getDelega(classPK);
DettPraticaLocalServiceUtil.getDettPratica(classPK); } else if (DETTPRATICA_CLASS_NAME.equals(className)) {
} else if (DLFILEENTRY_CLASS_NAME.equals(className)) { DettPraticaLocalServiceUtil.getDettPratica(classPK);
DLAppLocalServiceUtil.getFileEntry(classPK); } else if (DLFILEENTRY_CLASS_NAME.equals(className)) {
} else if (DLFILEENTRYTYPE_CLASS_NAME.equals(className)) { DLAppLocalServiceUtil.getFileEntry(classPK);
DLFileEntryTypeLocalServiceUtil.getDLFileEntryType(classPK); } else if (DLFILEENTRYTYPE_CLASS_NAME.equals(className)) {
} else if (DLFOLDER_CLASS_NAME.equals(className)) { DLFileEntryTypeLocalServiceUtil.getDLFileEntryType(classPK);
DLAppLocalServiceUtil.getFolder(classPK); } else if (DLFOLDER_CLASS_NAME.equals(className)) {
} else if (EMAIL_CLASS_NAME.equals(className)) { DLAppLocalServiceUtil.getFolder(classPK);
EmailLocalServiceUtil.getEmail(classPK); } else if (EMAIL_CLASS_NAME.equals(className)) {
} else if (EMAILADDRESS_CLASS_NAME.equals(className)) { EmailLocalServiceUtil.getEmail(classPK);
EmailAddressLocalServiceUtil.getEmailAddress(classPK); } else if (EMAILADDRESS_CLASS_NAME.equals(className)) {
} else if (EMAILTEMPLATE_CLASS_NAME.equals(className)) { EmailAddressLocalServiceUtil.getEmailAddress(classPK);
EmailTemplateLocalServiceUtil.getEmailTemplate(classPK); } else if (EMAILTEMPLATE_CLASS_NAME.equals(className)) {
} else if (EXPANDOCOLUMN_CLASS_NAME.equals(className)) { EmailTemplateLocalServiceUtil.getEmailTemplate(classPK);
ExpandoColumnLocalServiceUtil.getExpandoColumn(classPK); } else if (EXPANDOCOLUMN_CLASS_NAME.equals(className)) {
} else if (FINELAVORI_CLASS_NAME.equals(className)) { ExpandoColumnLocalServiceUtil.getExpandoColumn(classPK);
FineLavoriLocalServiceUtil.getFineLavori(classPK); } else if (FINELAVORI_CLASS_NAME.equals(className)) {
} else if (GROUP_CLASS_NAME.equals(className)) { FineLavoriLocalServiceUtil.getFineLavori(classPK);
GroupLocalServiceUtil.getGroup(classPK); } else if (GROUP_CLASS_NAME.equals(className)) {
} else if (INTPRATICA_CLASS_NAME.equals(className)) { GroupLocalServiceUtil.getGroup(classPK);
IntPraticaLocalServiceUtil.getIntPratica(classPK); } else if (INTPRATICA_CLASS_NAME.equals(className)) {
} else if (JOURNALARTICLE_CLASS_NAME.equals(className)) { IntPraticaLocalServiceUtil.getIntPratica(classPK);
JournalArticleLocalServiceUtil.getArticle(classPK); } else if (JOURNALARTICLE_CLASS_NAME.equals(className)) {
} else if (JOURNALARTICLERESOURCE_CLASS_NAME.equals(className)) { JournalArticleLocalServiceUtil.getArticle(classPK);
JournalArticleResourceLocalServiceUtil.getJournalArticleResource(classPK); } else if (JOURNALARTICLERESOURCE_CLASS_NAME.equals(className)) {
} else if (JOURNALFOLDER_CLASS_NAME.equals(className)) { JournalArticleResourceLocalServiceUtil.getJournalArticleResource(classPK);
JournalFolderLocalServiceUtil.getJournalFolder(classPK); } else if (JOURNALFOLDER_CLASS_NAME.equals(className)) {
} else if (LAYOUT_CLASS_NAME.equals(className)) { JournalFolderLocalServiceUtil.getJournalFolder(classPK);
LayoutLocalServiceUtil.getLayout(classPK); } else if (LAYOUT_CLASS_NAME.equals(className)) {
} else if (LAYOUTPROTOTYPE_CLASS_NAME.equals(className)) { LayoutLocalServiceUtil.getLayout(classPK);
LayoutPrototypeLocalServiceUtil.getLayoutPrototype(classPK); } else if (LAYOUTPROTOTYPE_CLASS_NAME.equals(className)) {
} else if (LAYOUTSETPROTOTYPE_CLASS_NAME.equals(className)) { LayoutPrototypeLocalServiceUtil.getLayoutPrototype(classPK);
LayoutSetPrototypeLocalServiceUtil.getLayoutSetPrototype(classPK); } else if (LAYOUTSETPROTOTYPE_CLASS_NAME.equals(className)) {
} else if (MBDISCUSSION_CLASS_NAME.equals(className)) { LayoutSetPrototypeLocalServiceUtil.getLayoutSetPrototype(classPK);
MBDiscussionLocalServiceUtil.getMBDiscussion(classPK); } else if (MBDISCUSSION_CLASS_NAME.equals(className)) {
} else if (MBMESSAGE_CLASS_NAME.equals(className)) { MBDiscussionLocalServiceUtil.getMBDiscussion(classPK);
MBMessageLocalServiceUtil.getMBMessage(classPK); } else if (MBMESSAGE_CLASS_NAME.equals(className)) {
} else if (MBTHREAD_CLASS_NAME.equals(className)) { MBMessageLocalServiceUtil.getMBMessage(classPK);
MBThreadLocalServiceUtil.getMBThread(classPK); } else if (MBTHREAD_CLASS_NAME.equals(className)) {
} else if (ORGANIZATION_CLASS_NAME.equals(className)) { MBThreadLocalServiceUtil.getMBThread(classPK);
OrganizationLocalServiceUtil.getOrganization(classPK); } else if (ORGANIZATION_CLASS_NAME.equals(className)) {
} else if (PAGAMENTO_CLASS_NAME.equals(className)) { OrganizationLocalServiceUtil.getOrganization(classPK);
PagamentoLocalServiceUtil.getPagamento(classPK); } else if (PAGAMENTO_CLASS_NAME.equals(className)) {
} else if (PAREREGEOLOGO_CLASS_NAME.equals(className)) { PagamentoLocalServiceUtil.getPagamento(classPK);
ParereGeologoLocalServiceUtil.getParereGeologo(classPK); } else if (PAREREGEOLOGO_CLASS_NAME.equals(className)) {
} else if (PASSWORDPOLICY_CLASS_NAME.equals(className)) { ParereGeologoLocalServiceUtil.getParereGeologo(classPK);
PasswordPolicyLocalServiceUtil.getPasswordPolicy(classPK); } else if (PASSWORDPOLICY_CLASS_NAME.equals(className)) {
} else if (ROLE_CLASS_NAME.equals(className)) { PasswordPolicyLocalServiceUtil.getPasswordPolicy(classPK);
RoleLocalServiceUtil.getRole(classPK); } else if (ROLE_CLASS_NAME.equals(className)) {
} else if (SOGGETTO_CLASS_NAME.equals(className)) { RoleLocalServiceUtil.getRole(classPK);
SoggettoLocalServiceUtil.getSoggetto(classPK); } else if (SOGGETTO_CLASS_NAME.equals(className)) {
} else if (SORTEGGIO_CLASS_NAME.equals(className)) { SoggettoLocalServiceUtil.getSoggetto(classPK);
SorteggioLocalServiceUtil.getSorteggio(classPK); } else if (SORTEGGIO_CLASS_NAME.equals(className)) {
} else if (USER_CLASS_NAME.equals(className)) { SorteggioLocalServiceUtil.getSorteggio(classPK);
UserLocalServiceUtil.getUser(classPK); } else if (USER_CLASS_NAME.equals(className)) {
} else if (USERPERSONALSITE_CLASS_NAME.equals(className)) { UserLocalServiceUtil.getUser(classPK);
// Nop } else if (USERPERSONALSITE_CLASS_NAME.equals(className)) {
} else if (WIKINODE_CLASS_NAME.equals(className)) { // Nop
WikiNodeLocalServiceUtil.getWikiNode(classPK); } else if (WIKINODE_CLASS_NAME.equals(className)) {
} else if (WORKFLOWINSTANCE_CLASS_NAME.equals(className)) { WikiNodeLocalServiceUtil.getWikiNode(classPK);
if (Validator.isNull(companyId)) { } else if (WORKFLOWINSTANCE_CLASS_NAME.equals(className)) {
_log.info("CompanyId = " + companyId); if (Validator.isNull(companyId)) {
; _log.info("CompanyId = " + companyId);
;
} else {
WorkflowInstanceManagerUtil.getWorkflowInstance(companyId, classPK);
}
} else { } else {
WorkflowInstanceManagerUtil.getWorkflowInstance(companyId, classPK); if (className.contains(".")) {
} switch (className) {
} else { case "com.liferay.portlet.blogs":
if (className.contains(".")) { case "com.liferay.portlet.documentlibrary":
switch (className) { case "com.liferay.portlet.journal":
case "com.liferay.portlet.blogs": case "com.liferay.portlet.messageboards":
case "com.liferay.portlet.documentlibrary": case "com.liferay.portlet.polls":
case "com.liferay.portlet.journal": case "com.liferay.portlet.wiki":
case "com.liferay.portlet.messageboards": case "it.tref.liferay.portos.bo.intpratiche":
case "com.liferay.portlet.polls": break;
case "com.liferay.portlet.wiki": default:
case "it.tref.liferay.portos.bo.intpratiche": _log.info("Classe non supportata: " + className);
break; }
default:
_log.info("Classe non supportata: " + className);
} }
} }
} catch (PortalException e) {
return false;
} }
} catch (PortalException e) {
return false;
} }
return true; return true;
} }

1311
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SismicaUtil.java

File diff soppresso perché troppo grande Load Diff

6
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/SismicaAdministrationPortlet.java

@ -3,7 +3,7 @@ package it.tref.liferay.portos.bo.portlet;
import it.mwg.sismica.bo.util.AllegatiUtil; import it.mwg.sismica.bo.util.AllegatiUtil;
import it.mwg.sismica.bo.util.SismicaUtil; import it.mwg.sismica.bo.util.SismicaUtil;
import it.mwg.sismica.bo.util.SorteggioPraticaUtil; import it.mwg.sismica.bo.util.SorteggioPraticaUtil;
import it.mwg.sismica.bo.util.SvuotaDatabase; import it.mwg.sismica.bo.util.ManutenzioneDatabase;
import it.tref.liferay.portos.bo.service.ConfigurazioneServiceUtil; import it.tref.liferay.portos.bo.service.ConfigurazioneServiceUtil;
import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil; import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil;
@ -116,11 +116,11 @@ public class SismicaAdministrationPortlet extends MVCPortlet {
actionResponse.setRenderParameter("esito", esito.toArray(new String[esito.size()])); actionResponse.setRenderParameter("esito", esito.toArray(new String[esito.size()]));
} }
public void testInterno(ActionRequest actionRequest, ActionResponse actionResponse) public void manutenzioneDatabase(ActionRequest actionRequest, ActionResponse actionResponse)
throws PortalException, SystemException { throws PortalException, SystemException {
String mode = ParamUtil.getString(actionRequest, "mode"); String mode = ParamUtil.getString(actionRequest, "mode");
ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest); ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest);
List<String> esito = SvuotaDatabase.pulisci(serviceContext, mode); List<String> esito = ManutenzioneDatabase.pulisci(serviceContext, mode);
actionResponse.setRenderParameter("esito", esito.toArray(new String[esito.size()])); actionResponse.setRenderParameter("esito", esito.toArray(new String[esito.size()]));
} }

12
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/scheduler/SchedulerInvioDocumento.java

@ -40,8 +40,10 @@ import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set;
import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock; import java.util.concurrent.locks.ReentrantLock;
@ -371,16 +373,16 @@ public class SchedulerInvioDocumento implements MessageListener {
dettPratica.getCodiceFiscalePrincipaleCommittente(), TipoSoggettoUtil.COMMITTENTE); dettPratica.getCodiceFiscalePrincipaleCommittente(), TipoSoggettoUtil.COMMITTENTE);
if (null == committentePrincipale) { if (null == committentePrincipale) {
_log.error("inviaMailNotifica: il committente principale non esiste, intPraticaId = " _log.error("Il committente principale non esiste, intPraticaId = " + intPraticaId);
+ intPraticaId);
} else { } else {
soggetti.remove(committentePrincipale); soggetti.remove(committentePrincipale);
} }
String[] to = new String[soggetti.size()]; Set<String> sTo = new HashSet<>();
for (int i = 0; i < to.length; i++) { for (Soggetto soggetto : soggetti) {
to[i] = soggetti.get(i).getEmail(); sTo.add(soggetto.getEmail());
} }
String[] to = sTo.toArray(new String[sTo.size()]);
String[] cc = new String[0]; String[] cc = new String[0];
String[] ccn = new String[0]; String[] ccn = new String[0];

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

@ -206,7 +206,7 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
} }
boolean agAlto = (dettPratica.getTcAdeguamentoSismico() || dettPratica.getTcMiglioramentoSismico()) boolean agAlto = (dettPratica.getTcAdeguamentoSismico() || dettPratica.getTcMiglioramentoSismico())
&& (territorio.getZona().equals("1") || (territorio.getZona().equals("2") && (ag >= 0.2) && (ag <= 0.25))); && (territorio.getZona().equals("1") || (territorio.getZona().equals("2") && (ag >= 0.2)));
boolean complesse = dettPratica.getTcNuovaCostruzioneComplessa(); boolean complesse = dettPratica.getTcNuovaCostruzioneComplessa();

5
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/advanced_search.jsp

@ -45,11 +45,6 @@
<div class="col-xs-12 col-sm-12 col-md-3 col-lg-3"> <div class="col-xs-12 col-sm-12 col-md-3 col-lg-3">
<aui:select name="statoPratica" label="Stato Procedimento"> <aui:select name="statoPratica" label="Stato Procedimento">
<aui:option value="-1">Stato Pratica</aui:option> <aui:option value="-1">Stato Pratica</aui:option>
<!-- ADT BUG-ID=15 Sezione Ricerca / Filtro Stato Pratica -->
<%-- <aui:option value="VI"><liferay-ui:message key="vidimata"/></aui:option> --%>
<%-- <aui:option value="RI"><liferay-ui:message key="rifiutata"/></aui:option> --%>
<%-- <aui:option value="SO"><liferay-ui:message key="sorteggiata"/></aui:option> --%>
<aui:option value="AL"><liferay-ui:message key="annullata"/></aui:option> <aui:option value="AL"><liferay-ui:message key="annullata"/></aui:option>
<aui:option value="AU"><liferay-ui:message key="autorizzata"/></aui:option> <aui:option value="AU"><liferay-ui:message key="autorizzata"/></aui:option>
<aui:option value="AN"><liferay-ui:message key="non autorizzata"/></aui:option> <aui:option value="AN"><liferay-ui:message key="non autorizzata"/></aui:option>

2
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/view.jsp

@ -219,7 +219,7 @@ String dtSorteggioNullo = "2020-03-05 11:12:18.006";
Le pratiche sottoposte a parere sono quelle che hanno Le pratiche sottoposte a parere sono quelle che hanno
statoPratica == 'SP', non quelle in status di workflow = pending statoPratica == 'SP', non quelle in status di workflow = pending
--> -->
<c:if test="<%= intPratica.getStatoPratica().equalsIgnoreCase(\"SP\") %>"> <c:if test="<%= StatoPraticaConstants.SOTTOPOSTA_A_PARERE.equals(intPratica.getStatoPratica()) %>">
<span class="display-inline-block bordered-2x border-circle bg-green txt-bold tooltip-info" title="Sottoposta a parere" style="padding: 5px;margin-right:5px;"> <span class="display-inline-block bordered-2x border-circle bg-green txt-bold tooltip-info" title="Sottoposta a parere" style="padding: 5px;margin-right:5px;">
SP SP
</span> </span>

4
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/sismica_administration/view.jsp

@ -96,12 +96,12 @@ String dataProssimoSorteggio =
</div> </div>
</div> </div>
<liferay-portlet:actionURL name="testInterno" var="testInternoURL" /> <liferay-portlet:actionURL name="manutenzioneDatabase" var="manutenzioneDatabaseURL" />
<liferay-portlet:actionURL name="generaDocumenti" var="generaDocumentiURL" /> <liferay-portlet:actionURL name="generaDocumenti" var="generaDocumentiURL" />
<div class="row-fluid" style="margin-top: 10px;"> <div class="row-fluid" style="margin-top: 10px;">
<div class="span6"> <div class="span6">
<div style="font-weight: bold; font-size: 18px; margin-bottom: 10px;">Manutenzione database</div> <div style="font-weight: bold; font-size: 18px; margin-bottom: 10px;">Manutenzione database</div>
<aui:form action="<%=testInternoURL%>" method="post" name="fmTI"> <aui:form action="<%=manutenzioneDatabaseURL%>" method="post" name="fmMD">
<div> <div>
<aui:input name="mode" label="Modalità" /> <aui:input name="mode" label="Modalità" />
<aui:button cssClass="btn-danger" type="submit" value="Avvia manutenzione" /> <aui:button cssClass="btn-danger" type="submit" value="Avvia manutenzione" />

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

@ -2,5 +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" />
<import file="../build-common-portlet.xml" /> <import file="../build-common-portlet.xml" />
</project> </project>

BIN
liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/firma-application-shared-0.0.1.jar

File binario non mostrato.

1
liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/.tern-project

@ -0,0 +1 @@
{"ide":{"scriptPaths":[]},"plugins":{"aui":{},"liferay":{},"yui":{}},"libs":["ecma5","browser"]}

2
liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/service.xml

@ -157,7 +157,7 @@
<column name="subject" type="String" /> <column name="subject" type="String" />
<column name="body" type="String" /> <column name="body" type="String" />
<column name="attachmentPermitted" type="Boolean" /> <column name="attachmentPermitted" type="boolean" />
<column name="additionalParameters" type="String" /> <column name="additionalParameters" type="String" />

6
liferay-plugins-sdk-6.2/shared/portos-firma-shared/.classpath

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.7.0_80"/>
<classpathentry kind="output" path="classes"/>
</classpath>

1
liferay-plugins-sdk-6.2/shared/portos-firma-shared/.gitignore vendored

@ -0,0 +1 @@
/classes/

17
liferay-plugins-sdk-6.2/shared/portos-firma-shared/.project

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>portos-firma-shared</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

8
liferay-plugins-sdk-6.2/shared/portos-firma-shared/build.xml

@ -0,0 +1,8 @@
<?xml version="1.0"?>
<!DOCTYPE project>
<project name="portos-firma-shared" basedir="." default="deploy">
<property name="plugin.version" value="1" />
<import file="../build-common-shared.xml" />
</project>

92
liferay-plugins-sdk-6.2/shared/portos-firma-shared/src/it/tref/firma/shared/RestFile.java

@ -0,0 +1,92 @@
package it.tref.firma.shared;
import java.io.Serializable;
import java.util.Date;
public class RestFile implements Serializable {
private static final long serialVersionUID = 560778228734037313L;
private Integer idFile;
private String nomeFile;
private Date dataInvio;
private String documentiType;
private String tipoPratica;
private String file;
public RestFile() {
this.idFile = Integer.valueOf(-1);
this.dataInvio = new Date();
this.nomeFile = "";
this.documentiType = "";
this.tipoPratica = "";
setFile("");
}
public String toString() {
StringBuilder sb = new StringBuilder();
if (this.idFile != null) {
sb.append("Id = ");
sb.append(this.idFile);
sb.append(" ");
}
if (this.documentiType != null) {
sb.append("Documenti type = ");
sb.append(this.documentiType);
sb.append(" ");
}
if (this.tipoPratica != null) {
sb.append("Tipo pratica= ");
sb.append(this.tipoPratica);
sb.append(" ");
}
return sb.toString();
}
public String getNomeFile() {
return nomeFile;
}
public void setNomeFile(String nomeFile) {
this.nomeFile = nomeFile;
}
public Date getDataInvio() {
return dataInvio;
}
public void setDataInvio(Date dataInvio) {
this.dataInvio = dataInvio;
}
public String getDocumentiType() {
return documentiType;
}
public void setDocumentiType(String documentiType) {
this.documentiType = documentiType;
}
public String getTipoPratica() {
return tipoPratica;
}
public void setTipoPratica(String tipoPratica) {
this.tipoPratica = tipoPratica;
}
public Integer getIdFile() {
return idFile;
}
public void setIdFile(Integer idFile) {
this.idFile = idFile;
}
public String getFile() {
return file;
}
public void setFile(String file) {
this.file = file;
}
}

23
liferay-plugins-sdk-6.2/shared/portos-firma-shared/src/it/tref/firma/shared/Risposta.java

@ -0,0 +1,23 @@
package it.tref.firma.shared;
public class Risposta<T> {
private int risposta = -100;
private T obj = null;
public int getRisposta() {
return risposta;
}
public void setRisposta(int risposta) {
this.risposta = risposta;
}
public T getObj() {
return obj;
}
public void setObj(T obj) {
this.obj = obj;
}
}

13
liferay-plugins-sdk-6.2/shared/portos-firma-shared/src/it/tref/firma/shared/RispostaCostanti.java

@ -0,0 +1,13 @@
package it.tref.firma.shared;
public interface RispostaCostanti {
public static final int NO_SET = -100;
public static final int OK = 0;
public static final int NO_CONFIGURATION = 1;
public static final int NO_UTENTE = 2;
public static final int NO_LOGIN = 3;
public static final int NO_FILE = 4;
public static final int NO_PRATICA = 5;
public static final int ERRORE_APPLICAZIONE = 6;
}

26
liferay-plugins-sdk-6.2/shared/portos-firma-shared/src/it/tref/firma/shared/Stile.java

@ -0,0 +1,26 @@
package it.tref.firma.shared;
import java.util.ArrayList;
import java.util.List;
public class Stile {
private String logo = null;
private List<String> listNumrodlfProperty = new ArrayList<>();
public String getLogo() {
return logo;
}
public void setLogo(String logo) {
this.logo = logo;
}
public List<String> getListNumrodlfProperty() {
return listNumrodlfProperty;
}
public void setListNumrodlfProperty(List<String> listNumrodlfProperty) {
this.listNumrodlfProperty = listNumrodlfProperty;
}
}

2
liferay-plugins-sdk-6.2/shared/portos-mail-manager-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/"/>

58
liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/messaging/dto/MailTemplateMessage.java

@ -6,42 +6,42 @@ import java.io.Serializable;
import java.util.List; import java.util.List;
public class MailTemplateMessage implements Serializable { public class MailTemplateMessage implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private long templateId; private long templateId;
private String templateName; private String templateName;
private String templateParam; private String templateParam;
private List<FileAttachment> fileAttachments; private List<FileAttachment> fileAttachments;
public long getTemplateId() { public long getTemplateId() {
return templateId; return templateId;
} }
public void setTemplateId(long templateId) { public void setTemplateId(long templateId) {
this.templateId = templateId; this.templateId = templateId;
} }
public String getTemplateParam() { public String getTemplateParam() {
return templateParam; return templateParam;
} }
public void setTemplateParam(String templateParam) { public void setTemplateParam(String templateParam) {
this.templateParam = templateParam; this.templateParam = templateParam;
} }
public List<FileAttachment> getFileAttachments() { public List<FileAttachment> getFileAttachments() {
return fileAttachments; return fileAttachments;
} }
public void setFileAttachments(List<FileAttachment> fileAttachments) { public void setFileAttachments(List<FileAttachment> fileAttachments) {
this.fileAttachments = fileAttachments; this.fileAttachments = fileAttachments;
} }
public String getTemplateName() { public String getTemplateName() {
return templateName; return templateName;
} }
public void setTemplateName(String templateName) { public void setTemplateName(String templateName) {
this.templateName = templateName; this.templateName = templateName;
} }
} }

167
liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/messaging/dto/TemplateMessage.java

@ -3,89 +3,88 @@ package it.tref.liferay.portos.mailmanager.shared.messaging.dto;
import java.io.Serializable; import java.io.Serializable;
public class TemplateMessage implements Serializable { public class TemplateMessage implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private long templateId; private long templateId;
private String templateName; private String templateName;
private String from; private String from;
private String[] to; private String[] to;
private String[] cc; private String[] cc;
private String[] ccn; private String[] ccn;
private String subject; private String subject;
private String body; private String body;
private boolean attachmentPermitted; private boolean attachmentPermitted;
public long getTemplateId() {
public long getTemplateId() { return templateId;
return templateId; }
}
public void setTemplateId(long templateId) {
public void setTemplateId(long templateId) { this.templateId = templateId;
this.templateId = templateId; }
}
public String getTemplateName() {
public String getTemplateName() { return templateName;
return templateName; }
}
public void setTemplateName(String templateName) {
public void setTemplateName(String templateName) { this.templateName = templateName;
this.templateName = templateName; }
}
public String getFrom() {
public String getFrom() { return from;
return from; }
}
public void setFrom(String from) {
public void setFrom(String from) { this.from = from;
this.from = from; }
}
public String[] getTo() {
public String[] getTo() { return to;
return to; }
}
public void setTo(String[] to) {
public void setTo(String[] to) { this.to = to;
this.to = to; }
}
public String[] getCc() {
public String[] getCc() { return cc;
return cc; }
}
public void setCc(String[] cc) {
public void setCc(String[] cc) { this.cc = cc;
this.cc = cc; }
}
public String[] getCcn() {
public String[] getCcn() { return ccn;
return ccn; }
}
public void setCcn(String[] ccn) {
public void setCcn(String[] ccn) { this.ccn = ccn;
this.ccn = ccn; }
}
public String getBody() {
public String getBody() { return body;
return body; }
}
public void setBody(String body) {
public void setBody(String body) { this.body = body;
this.body = body; }
}
public String getSubject() {
public String getSubject() { return subject;
return subject; }
}
public void setSubject(String subject) {
public void setSubject(String subject) { this.subject = subject;
this.subject = subject; }
}
public boolean isAttachmentPermitted() {
public boolean isAttachmentPermitted() { return attachmentPermitted;
return attachmentPermitted; }
}
public void setAttachmentPermitted(boolean attachmentPermitted) {
public void setAttachmentPermitted(boolean attachmentPermitted) { this.attachmentPermitted = attachmentPermitted;
this.attachmentPermitted = attachmentPermitted; }
}
} }

10
liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/messaging/util/DestinationNames.java

@ -2,12 +2,12 @@ package it.tref.liferay.portos.mailmanager.shared.messaging.util;
public class DestinationNames { public class DestinationNames {
public static final String SEND_MAIL = "liferay/mail_manager/add_email"; public static final String SEND_MAIL = "liferay/mail_manager/add_email";
public static final String SEND_TEMPLATE_MAIL = "liferay/mail_manager/add_email_by_template"; public static final String SEND_TEMPLATE_MAIL = "liferay/mail_manager/add_email_by_template";
public static final String SEND_MAIL_SYNC = "liferay/mail_manager/add_email_sync"; public static final String SEND_MAIL_SYNC = "liferay/mail_manager/add_email_sync";
public static final String SEND_TEMPLATE_MAIL_SYNC = "liferay/mail_manager/add_email_by_template_sync"; public static final String SEND_TEMPLATE_MAIL_SYNC = "liferay/mail_manager/add_email_by_template_sync";
public static final String EDIT_EMAIL_TEMPLATE = "liferay/mail_manager/edit_email_template"; public static final String EDIT_EMAIL_TEMPLATE = "liferay/mail_manager/edit_email_template";
} }

163
liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/model/FileAttachment.java

@ -12,90 +12,87 @@ import com.liferay.portlet.documentlibrary.service.DLFileEntryLocalServiceUtil;
import java.io.File; import java.io.File;
import java.io.InputStream; import java.io.InputStream;
public class FileAttachment extends com.liferay.mail.model.FileAttachment { public class FileAttachment extends com.liferay.mail.model.FileAttachment {
public static final Log _log = LogFactoryUtil.getLog(FileAttachment.class); public static final Log _log = LogFactoryUtil.getLog(FileAttachment.class);
private long fileEntryId; private long fileEntryId;
private byte[] bytes; private byte[] bytes;
private String tipologia; private String tipologia;
private String fileName; private String fileName;
public FileAttachment() { public FileAttachment() {
super(); super();
} }
public FileAttachment(File file, String fileName, String tipologia, long fileEntryId, byte[] bytes) { public FileAttachment(File file, String fileName, String tipologia, long fileEntryId, byte[] bytes) {
super(file, fileName); super(file, fileName);
this.setTipologia(tipologia); this.setTipologia(tipologia);
this.fileEntryId = fileEntryId; this.fileEntryId = fileEntryId;
this.setBytes(bytes); this.setBytes(bytes);
} }
public String getFileName() {
public String getFileName() { return fileName;
return fileName; }
}
public void setFileName(String fileName) {
public void setFileName(String fileName) { this.fileName = fileName;
this.fileName = fileName; super.setFileName(fileName);
super.setFileName(fileName); }
}
public long getFileEntryId() {
return fileEntryId;
public long getFileEntryId() { }
return fileEntryId;
} public void setFileEntryId(long fileEntryId) {
this.fileEntryId = fileEntryId;
public void setFileEntryId(long fileEntryId) { }
this.fileEntryId = fileEntryId;
} public byte[] getBytes() {
return bytes;
public byte[] getBytes() { }
return bytes;
} public void setBytes(byte[] bytes) {
this.bytes = bytes;
public void setBytes(byte[] bytes) { }
this.bytes = bytes;
} public String getTipologia() {
return tipologia;
public String getTipologia() { }
return tipologia;
} public void setTipologia(String tipologia) {
this.tipologia = tipologia;
public void setTipologia(String tipologia) { }
this.tipologia = tipologia;
} public File generateFile() {
public File generateFile() { File result = null;
File result = null; try {
try { if (Validator.isNotNull(super.getFile())) {
result = super.getFile();
if (Validator.isNotNull(super.getFile())) { } else if (Validator.isNotNull(fileEntryId)) {
result = super.getFile(); FileEntry fileEntry = DLAppLocalServiceUtil.getFileEntry(fileEntryId);
} else if (Validator.isNotNull(fileEntryId)) { setFileName(fileEntry.getTitle()
FileEntry fileEntry = DLAppLocalServiceUtil.getFileEntry(fileEntryId); + (Validator.isNotNull(fileEntry.getExtension()) ? "." + fileEntry.getExtension()
setFileName(fileEntry.getTitle() : StringPool.BLANK));
+ (Validator.isNotNull(fileEntry.getExtension()) ? "." + fileEntry.getExtension() : StringPool.BLANK)); InputStream is = DLFileEntryLocalServiceUtil.getFileAsStream(fileEntry.getFileEntryId(),
InputStream is = fileEntry.getVersion(), false);
DLFileEntryLocalServiceUtil.getFileAsStream(fileEntry.getFileEntryId(), fileEntry.getVersion(), false); result = FileUtil.createTempFile(is);
result = FileUtil.createTempFile(is); is.close();
is.close(); result.deleteOnExit();
result.deleteOnExit(); } else if (Validator.isNotNull(bytes)) {
} else if (Validator.isNotNull(bytes)) { result = FileUtil.createTempFile(bytes);
result = FileUtil.createTempFile(bytes); result.deleteOnExit();
result.deleteOnExit(); }
}
} catch (Exception e) {
} catch (Exception e) { _log.error("Error during getFile()", e);
_log.error("Error during getFile()", e); }
} setFile(result);
setFile(result); return result;
return result; }
}
} }

49
liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/util/MailManagerConstants.java

@ -1,38 +1,37 @@
package it.tref.liferay.portos.mailmanager.shared.util; package it.tref.liferay.portos.mailmanager.shared.util;
public class MailManagerConstants { public class MailManagerConstants {
public enum SendTemplateMode { public enum SendTemplateMode {
REVIEW("R"), EDIT("E"); REVIEW("R"), EDIT("E");
private SendTemplateMode(String id) { private SendTemplateMode(String id) {
this.id = id; this.id = id;
} }
private String id; private String id;
public static SendTemplateMode parse(String id) { public static SendTemplateMode parse(String id) {
for (SendTemplateMode item : values()) { for (SendTemplateMode item : values()) {
if (item.id.equals(id)) { if (item.id.equals(id)) {
return item; return item;
} }
} }
throw new IllegalArgumentException("Invalid SendTemplateMode value: " + id); throw new IllegalArgumentException("Invalid SendTemplateMode value: " + id);
} }
public String getId() { public String getId() {
return id; return id;
} }
} }
public static final String TEMPLATE_PARAMETER_VARIABLES_KEY = "variables"; public static final String TEMPLATE_PARAMETER_VARIABLES_KEY = "variables";
public static final String TEMPLATE_PARAMETER_TO_KEY = "to"; public static final String TEMPLATE_PARAMETER_TO_KEY = "to";
public static final String TEMPLATE_PARAMETER_CC_KEY = "cc"; public static final String TEMPLATE_PARAMETER_CC_KEY = "cc";
public static final String TEMPLATE_PARAMETER_CCN_KEY = "ccn"; public static final String TEMPLATE_PARAMETER_CCN_KEY = "ccn";
public static final String MESSAGING_SEND_MODE_SYNC = "sync"; public static final String MESSAGING_SEND_MODE_SYNC = "sync";
public static final String MESSAGING_SEND_MODE_ASYNC = "async"; public static final String MESSAGING_SEND_MODE_ASYNC = "async";
} }

165
liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/util/MailUtil.java

@ -16,117 +16,118 @@ import javax.mail.internet.InternetAddress;
public class MailUtil { public class MailUtil {
public static String fromInternetAddress(InternetAddress internetAddress) { public static String fromInternetAddress(InternetAddress internetAddress) {
if (Validator.isNotNull(internetAddress)) { if (Validator.isNotNull(internetAddress)) {
return internetAddress.getAddress(); return internetAddress.getAddress();
} }
return null; return null;
} }
public static String[] fromInternetAddresses(InternetAddress[] internetAddresses) { public static String[] fromInternetAddresses(InternetAddress[] internetAddresses) {
if (internetAddresses != null && internetAddresses.length > 0) { if (internetAddresses != null && internetAddresses.length > 0) {
String[] addresses = new String[internetAddresses.length]; String[] addresses = new String[internetAddresses.length];
for (int i = 0; i < internetAddresses.length; i++) { for (int i = 0; i < internetAddresses.length; i++) {
addresses[i] = internetAddresses[i].getAddress(); addresses[i] = internetAddresses[i].getAddress();
} }
return addresses; return addresses;
} }
return null; return null;
} }
public static InternetAddress[] fromStringAddress(String[] address) throws AddressException { public static InternetAddress[] fromStringAddress(String[] address) throws AddressException {
InternetAddress[] result = null; InternetAddress[] result = null;
if (address != null && address.length > 0) { if (address != null && address.length > 0) {
result = new InternetAddress[address.length]; result = new InternetAddress[address.length];
for (int i = 0; i < address.length; i++) { for (int i = 0; i < address.length; i++) {
result[i] = new InternetAddress(address[i], true); result[i] = new InternetAddress(address[i], true);
} }
} }
return result; return result;
} }
public static List<FileAttachment> getFileAttachments(UploadPortletRequest uploadPortletRequest) { public static List<FileAttachment> getFileAttachments(UploadPortletRequest uploadPortletRequest) {
return getFileAttachments(uploadPortletRequest, Collections.<FileAttachment>emptyList()); return getFileAttachments(uploadPortletRequest, Collections.<FileAttachment> emptyList());
} }
public static List<FileAttachment> getFileAttachments(UploadPortletRequest uploadPortletRequest, public static List<FileAttachment> getFileAttachments(UploadPortletRequest uploadPortletRequest,
List<FileAttachment> defaultFileAttachments) { List<FileAttachment> defaultFileAttachments) {
String allegatiIndexesString = uploadPortletRequest.getParameter("allegatiIndexes"); String allegatiIndexesString = uploadPortletRequest.getParameter("allegatiIndexes");
if (allegatiIndexesString == null) { if (allegatiIndexesString == null) {
return defaultFileAttachments; return defaultFileAttachments;
} }
List<FileAttachment> fileAttachments = new ArrayList<FileAttachment>(); List<FileAttachment> fileAttachments = new ArrayList<FileAttachment>();
int[] allegatiIndexes = StringUtil.split(allegatiIndexesString, 0); int[] allegatiIndexes = StringUtil.split(allegatiIndexesString, 0);
for (int allegatiIndex : allegatiIndexes) { for (int allegatiIndex : allegatiIndexes) {
long fileEntryId = ParamUtil.getLong(uploadPortletRequest, "fileEntryId" + allegatiIndex); long fileEntryId = ParamUtil.getLong(uploadPortletRequest, "fileEntryId" + allegatiIndex);
String fileName = uploadPortletRequest.getFileName("file" + allegatiIndex); String fileName = uploadPortletRequest.getFileName("file" + allegatiIndex);
File file = uploadPortletRequest.getFile("file" + allegatiIndex); File file = uploadPortletRequest.getFile("file" + allegatiIndex);
if (Validator.isNull(fileEntryId)) { if (Validator.isNull(fileEntryId)) {
if (Validator.isNull(fileName)) { if (Validator.isNull(fileName)) {
continue; continue;
} }
} }
String tipologia = ParamUtil.getString(uploadPortletRequest, "tipologia" + allegatiIndex); String tipologia = ParamUtil.getString(uploadPortletRequest, "tipologia" + allegatiIndex);
FileAttachment fileAttachment = new FileAttachment(); FileAttachment fileAttachment = new FileAttachment();
fileAttachment.setFileEntryId(fileEntryId); fileAttachment.setFileEntryId(fileEntryId);
fileAttachment.setTipologia(tipologia); fileAttachment.setTipologia(tipologia);
fileAttachment.setFileName(fileName); fileAttachment.setFileName(fileName);
fileAttachment.setFile(file); fileAttachment.setFile(file);
fileAttachments.add(fileAttachment); fileAttachments.add(fileAttachment);
} }
return fileAttachments; return fileAttachments;
} }
public static List<com.liferay.mail.model.FileAttachment> getEmailFileAttachments( public static List<com.liferay.mail.model.FileAttachment> getEmailFileAttachments(
UploadPortletRequest uploadPortletRequest) { UploadPortletRequest uploadPortletRequest) {
return getEmailFileAttachments(uploadPortletRequest, Collections.<com.liferay.mail.model.FileAttachment>emptyList()); return getEmailFileAttachments(uploadPortletRequest,
} Collections.<com.liferay.mail.model.FileAttachment> emptyList());
}
public static List<com.liferay.mail.model.FileAttachment> getEmailFileAttachments( public static List<com.liferay.mail.model.FileAttachment> getEmailFileAttachments(
UploadPortletRequest uploadPortletRequest, List<com.liferay.mail.model.FileAttachment> defaultFileAttachments) { UploadPortletRequest uploadPortletRequest,
List<com.liferay.mail.model.FileAttachment> defaultFileAttachments) {
String allegatiIndexesString = uploadPortletRequest.getParameter("allegatiIndexes"); String allegatiIndexesString = uploadPortletRequest.getParameter("allegatiIndexes");
if (allegatiIndexesString == null) { if (allegatiIndexesString == null) {
return defaultFileAttachments; return defaultFileAttachments;
} }
List<com.liferay.mail.model.FileAttachment> fileAttachments = List<com.liferay.mail.model.FileAttachment> fileAttachments = new ArrayList<com.liferay.mail.model.FileAttachment>();
new ArrayList<com.liferay.mail.model.FileAttachment>();
int[] allegatiIndexes = StringUtil.split(allegatiIndexesString, 0); int[] allegatiIndexes = StringUtil.split(allegatiIndexesString, 0);
for (int allegatiIndex : allegatiIndexes) { for (int allegatiIndex : allegatiIndexes) {
String fileName = uploadPortletRequest.getFileName("file" + allegatiIndex); String fileName = uploadPortletRequest.getFileName("file" + allegatiIndex);
File file = uploadPortletRequest.getFile("file" + allegatiIndex); File file = uploadPortletRequest.getFile("file" + allegatiIndex);
if (Validator.isNull(fileName)) { if (Validator.isNull(fileName)) {
continue; continue;
} }
com.liferay.mail.model.FileAttachment fileAttachment = new com.liferay.mail.model.FileAttachment(); com.liferay.mail.model.FileAttachment fileAttachment = new com.liferay.mail.model.FileAttachment();
fileAttachment.setFileName(fileName); fileAttachment.setFileName(fileName);
fileAttachment.setFile(file); fileAttachment.setFile(file);
fileAttachments.add(fileAttachment); fileAttachments.add(fileAttachment);
} }
return fileAttachments; return fileAttachments;
} }
} }

15
liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/util/StringUtil.java

@ -1,14 +1,13 @@
package it.tref.liferay.portos.mailmanager.shared.util; package it.tref.liferay.portos.mailmanager.shared.util;
public class StringUtil extends com.liferay.portal.kernel.util.StringUtil { public class StringUtil extends com.liferay.portal.kernel.util.StringUtil {
public static String[] splitAndTrim(String s) { public static String[] splitAndTrim(String s) {
String[] array = StringUtil.split(s); String[] array = StringUtil.split(s);
for (int i = 0; i < array.length; i++) { for (int i = 0; i < array.length; i++) {
array[i] = StringUtil.trim(array[i]); array[i] = StringUtil.trim(array[i]);
} }
return array; return array;
} }
} }

Caricamento…
Annulla
Salva