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. 2
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/IntPraticaLocalServiceImpl.java
  7. 5
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/advanced_search.jsp
  8. 2
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/fascicolo/view.jsp
  9. 4
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/sismica_administration/view.jsp
  10. 1
      liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/build.xml
  11. BIN
      liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/firma-application-shared-0.0.1.jar
  12. 1
      liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/.tern-project
  13. 2
      liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/service.xml
  14. 6
      liferay-plugins-sdk-6.2/shared/portos-firma-shared/.classpath
  15. 1
      liferay-plugins-sdk-6.2/shared/portos-firma-shared/.gitignore
  16. 17
      liferay-plugins-sdk-6.2/shared/portos-firma-shared/.project
  17. 8
      liferay-plugins-sdk-6.2/shared/portos-firma-shared/build.xml
  18. 92
      liferay-plugins-sdk-6.2/shared/portos-firma-shared/src/it/tref/firma/shared/RestFile.java
  19. 23
      liferay-plugins-sdk-6.2/shared/portos-firma-shared/src/it/tref/firma/shared/Risposta.java
  20. 13
      liferay-plugins-sdk-6.2/shared/portos-firma-shared/src/it/tref/firma/shared/RispostaCostanti.java
  21. 26
      liferay-plugins-sdk-6.2/shared/portos-firma-shared/src/it/tref/firma/shared/Stile.java
  22. 2
      liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/.classpath
  23. 58
      liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/messaging/dto/MailTemplateMessage.java
  24. 167
      liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/messaging/dto/TemplateMessage.java
  25. 10
      liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/messaging/util/DestinationNames.java
  26. 6
      liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/messaging/util/MailManagerUtil.java
  27. 163
      liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/model/FileAttachment.java
  28. 49
      liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/util/MailManagerConstants.java
  29. 165
      liferay-plugins-sdk-6.2/shared/portos-mail-manager-shared/src/it/tref/liferay/portos/mailmanager/shared/util/MailUtil.java
  30. 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);
*
*/
public class SvuotaDatabase {
private static final Log _log = LogFactoryUtil.getLog(SvuotaDatabase.class);
public class ManutenzioneDatabase {
private static final Log _log = LogFactoryUtil.getLog(ManutenzioneDatabase.class);
private static final int SLICE = 1000;
// !Run!IntPratica!User!Reset!
@ -158,7 +158,7 @@ public class SvuotaDatabase {
public static List<String> pulisci(ServiceContext serviceContext, String mode) throws SystemException,
PortalException {
List<String> esito = new ArrayList<>();
if (mode.contains("!Run!")) {
if (mode.contains("!Pulisci!")) {
long companyId = serviceContext.getCompanyId();
esito.addAll(puliziaDocumentLibrary(companyId));
if (mode.contains("!IntPratica!")) {
@ -180,6 +180,8 @@ public class SvuotaDatabase {
} catch (IllegalStateException e) {
}
_log.info("Elaborazione completata correttamente.");
} else if (mode.contains("!Integrazioni!")) {
SismicaUtil.integrazioniScadute();
} else {
esitoLog(esito, "Nessun comando");
}
@ -589,7 +591,7 @@ public class SvuotaDatabase {
int rimossi = 0;
intPratiche = IntPraticaLocalServiceUtil.getIntPraticas(start, start + SLICE);
for (IntPratica intPratica : intPratiche) {
IntPraticaLocalServiceUtil.deleteIntPratica(intPratica);
IntPraticaLocalServiceUtil.deleteIntPratica(intPratica, true);
cancellati++;
rimossi++;
}
@ -916,118 +918,120 @@ public class SvuotaDatabase {
}
private static boolean esiste(String className, long classPK, long companyId) throws SystemException {
try {
if (ALLEGATOMANUALE_CLASS_NAME.equals(className)) {
AllegatoManualeLocalServiceUtil.getAllegatoManuale(classPK);
} else if (ASSETTAG_CLASS_NAME.equals(className)) {
AssetTagLocalServiceUtil.getAssetTag(classPK);
} else if (ASSETVOCABULARY_CLASS_NAME.equals(className)) {
AssetVocabularyLocalServiceUtil.getAssetVocabulary(classPK);
} else if (ASSEVERAZIONE_CLASS_NAME.equals(className)) {
AsseverazioneLocalServiceUtil.getAsseverazione(classPK);
} else if (AVVISO_CLASS_NAME.equals(className)) {
AvvisoLocalServiceUtil.getAvviso(classPK);
} else if (COLLAUDO_CLASS_NAME.equals(className)) {
CollaudoLocalServiceUtil.getCollaudo(classPK);
} else if (COMPANY_CLASS_NAME.equals(className)) {
CompanyLocalServiceUtil.getCompany(classPK);
} else if (CONTROLLOPRATICA_CLASS_NAME.equals(className)) {
ControlloPraticaLocalServiceUtil.getControlloPratica(classPK);
} else if (DOCAGGIUNTIVA_CLASS_NAME.equals(className)) {
DocAggiuntivaLocalServiceUtil.getDocAggiuntiva(classPK);
} else if (DOCPRATICA_CLASS_NAME.equals(className)) {
DocPraticaLocalServiceUtil.getDocPratica(classPK);
} else if (DDMSTRUCTURE_CLASS_NAME.equals(className)) {
DDMStructureLocalServiceUtil.getDDMStructure(classPK);
} else if (DDMTEMPLATE_CLASS_NAME.equals(className)) {
DDMTemplateLocalServiceUtil.getDDMTemplate(classPK);
} else if (DELEGA_CLASS_NAME.equals(className)) {
DelegaLocalServiceUtil.getDelega(classPK);
} else if (DETTPRATICA_CLASS_NAME.equals(className)) {
DettPraticaLocalServiceUtil.getDettPratica(classPK);
} else if (DLFILEENTRY_CLASS_NAME.equals(className)) {
DLAppLocalServiceUtil.getFileEntry(classPK);
} else if (DLFILEENTRYTYPE_CLASS_NAME.equals(className)) {
DLFileEntryTypeLocalServiceUtil.getDLFileEntryType(classPK);
} else if (DLFOLDER_CLASS_NAME.equals(className)) {
DLAppLocalServiceUtil.getFolder(classPK);
} else if (EMAIL_CLASS_NAME.equals(className)) {
EmailLocalServiceUtil.getEmail(classPK);
} else if (EMAILADDRESS_CLASS_NAME.equals(className)) {
EmailAddressLocalServiceUtil.getEmailAddress(classPK);
} else if (EMAILTEMPLATE_CLASS_NAME.equals(className)) {
EmailTemplateLocalServiceUtil.getEmailTemplate(classPK);
} else if (EXPANDOCOLUMN_CLASS_NAME.equals(className)) {
ExpandoColumnLocalServiceUtil.getExpandoColumn(classPK);
} else if (FINELAVORI_CLASS_NAME.equals(className)) {
FineLavoriLocalServiceUtil.getFineLavori(classPK);
} else if (GROUP_CLASS_NAME.equals(className)) {
GroupLocalServiceUtil.getGroup(classPK);
} else if (INTPRATICA_CLASS_NAME.equals(className)) {
IntPraticaLocalServiceUtil.getIntPratica(classPK);
} else if (JOURNALARTICLE_CLASS_NAME.equals(className)) {
JournalArticleLocalServiceUtil.getArticle(classPK);
} else if (JOURNALARTICLERESOURCE_CLASS_NAME.equals(className)) {
JournalArticleResourceLocalServiceUtil.getJournalArticleResource(classPK);
} else if (JOURNALFOLDER_CLASS_NAME.equals(className)) {
JournalFolderLocalServiceUtil.getJournalFolder(classPK);
} else if (LAYOUT_CLASS_NAME.equals(className)) {
LayoutLocalServiceUtil.getLayout(classPK);
} else if (LAYOUTPROTOTYPE_CLASS_NAME.equals(className)) {
LayoutPrototypeLocalServiceUtil.getLayoutPrototype(classPK);
} else if (LAYOUTSETPROTOTYPE_CLASS_NAME.equals(className)) {
LayoutSetPrototypeLocalServiceUtil.getLayoutSetPrototype(classPK);
} else if (MBDISCUSSION_CLASS_NAME.equals(className)) {
MBDiscussionLocalServiceUtil.getMBDiscussion(classPK);
} else if (MBMESSAGE_CLASS_NAME.equals(className)) {
MBMessageLocalServiceUtil.getMBMessage(classPK);
} else if (MBTHREAD_CLASS_NAME.equals(className)) {
MBThreadLocalServiceUtil.getMBThread(classPK);
} else if (ORGANIZATION_CLASS_NAME.equals(className)) {
OrganizationLocalServiceUtil.getOrganization(classPK);
} else if (PAGAMENTO_CLASS_NAME.equals(className)) {
PagamentoLocalServiceUtil.getPagamento(classPK);
} else if (PAREREGEOLOGO_CLASS_NAME.equals(className)) {
ParereGeologoLocalServiceUtil.getParereGeologo(classPK);
} else if (PASSWORDPOLICY_CLASS_NAME.equals(className)) {
PasswordPolicyLocalServiceUtil.getPasswordPolicy(classPK);
} else if (ROLE_CLASS_NAME.equals(className)) {
RoleLocalServiceUtil.getRole(classPK);
} else if (SOGGETTO_CLASS_NAME.equals(className)) {
SoggettoLocalServiceUtil.getSoggetto(classPK);
} else if (SORTEGGIO_CLASS_NAME.equals(className)) {
SorteggioLocalServiceUtil.getSorteggio(classPK);
} else if (USER_CLASS_NAME.equals(className)) {
UserLocalServiceUtil.getUser(classPK);
} else if (USERPERSONALSITE_CLASS_NAME.equals(className)) {
// Nop
} else if (WIKINODE_CLASS_NAME.equals(className)) {
WikiNodeLocalServiceUtil.getWikiNode(classPK);
} else if (WORKFLOWINSTANCE_CLASS_NAME.equals(className)) {
if (Validator.isNull(companyId)) {
_log.info("CompanyId = " + companyId);
;
if (0 != classPK && Validator.isNotNull(className)) {
try {
if (ALLEGATOMANUALE_CLASS_NAME.equals(className)) {
AllegatoManualeLocalServiceUtil.getAllegatoManuale(classPK);
} else if (ASSETTAG_CLASS_NAME.equals(className)) {
AssetTagLocalServiceUtil.getAssetTag(classPK);
} else if (ASSETVOCABULARY_CLASS_NAME.equals(className)) {
AssetVocabularyLocalServiceUtil.getAssetVocabulary(classPK);
} else if (ASSEVERAZIONE_CLASS_NAME.equals(className)) {
AsseverazioneLocalServiceUtil.getAsseverazione(classPK);
} else if (AVVISO_CLASS_NAME.equals(className)) {
AvvisoLocalServiceUtil.getAvviso(classPK);
} else if (COLLAUDO_CLASS_NAME.equals(className)) {
CollaudoLocalServiceUtil.getCollaudo(classPK);
} else if (COMPANY_CLASS_NAME.equals(className)) {
CompanyLocalServiceUtil.getCompany(classPK);
} else if (CONTROLLOPRATICA_CLASS_NAME.equals(className)) {
ControlloPraticaLocalServiceUtil.getControlloPratica(classPK);
} else if (DOCAGGIUNTIVA_CLASS_NAME.equals(className)) {
DocAggiuntivaLocalServiceUtil.getDocAggiuntiva(classPK);
} else if (DOCPRATICA_CLASS_NAME.equals(className)) {
DocPraticaLocalServiceUtil.getDocPratica(classPK);
} else if (DDMSTRUCTURE_CLASS_NAME.equals(className)) {
DDMStructureLocalServiceUtil.getDDMStructure(classPK);
} else if (DDMTEMPLATE_CLASS_NAME.equals(className)) {
DDMTemplateLocalServiceUtil.getDDMTemplate(classPK);
} else if (DELEGA_CLASS_NAME.equals(className)) {
DelegaLocalServiceUtil.getDelega(classPK);
} else if (DETTPRATICA_CLASS_NAME.equals(className)) {
DettPraticaLocalServiceUtil.getDettPratica(classPK);
} else if (DLFILEENTRY_CLASS_NAME.equals(className)) {
DLAppLocalServiceUtil.getFileEntry(classPK);
} else if (DLFILEENTRYTYPE_CLASS_NAME.equals(className)) {
DLFileEntryTypeLocalServiceUtil.getDLFileEntryType(classPK);
} else if (DLFOLDER_CLASS_NAME.equals(className)) {
DLAppLocalServiceUtil.getFolder(classPK);
} else if (EMAIL_CLASS_NAME.equals(className)) {
EmailLocalServiceUtil.getEmail(classPK);
} else if (EMAILADDRESS_CLASS_NAME.equals(className)) {
EmailAddressLocalServiceUtil.getEmailAddress(classPK);
} else if (EMAILTEMPLATE_CLASS_NAME.equals(className)) {
EmailTemplateLocalServiceUtil.getEmailTemplate(classPK);
} else if (EXPANDOCOLUMN_CLASS_NAME.equals(className)) {
ExpandoColumnLocalServiceUtil.getExpandoColumn(classPK);
} else if (FINELAVORI_CLASS_NAME.equals(className)) {
FineLavoriLocalServiceUtil.getFineLavori(classPK);
} else if (GROUP_CLASS_NAME.equals(className)) {
GroupLocalServiceUtil.getGroup(classPK);
} else if (INTPRATICA_CLASS_NAME.equals(className)) {
IntPraticaLocalServiceUtil.getIntPratica(classPK);
} else if (JOURNALARTICLE_CLASS_NAME.equals(className)) {
JournalArticleLocalServiceUtil.getArticle(classPK);
} else if (JOURNALARTICLERESOURCE_CLASS_NAME.equals(className)) {
JournalArticleResourceLocalServiceUtil.getJournalArticleResource(classPK);
} else if (JOURNALFOLDER_CLASS_NAME.equals(className)) {
JournalFolderLocalServiceUtil.getJournalFolder(classPK);
} else if (LAYOUT_CLASS_NAME.equals(className)) {
LayoutLocalServiceUtil.getLayout(classPK);
} else if (LAYOUTPROTOTYPE_CLASS_NAME.equals(className)) {
LayoutPrototypeLocalServiceUtil.getLayoutPrototype(classPK);
} else if (LAYOUTSETPROTOTYPE_CLASS_NAME.equals(className)) {
LayoutSetPrototypeLocalServiceUtil.getLayoutSetPrototype(classPK);
} else if (MBDISCUSSION_CLASS_NAME.equals(className)) {
MBDiscussionLocalServiceUtil.getMBDiscussion(classPK);
} else if (MBMESSAGE_CLASS_NAME.equals(className)) {
MBMessageLocalServiceUtil.getMBMessage(classPK);
} else if (MBTHREAD_CLASS_NAME.equals(className)) {
MBThreadLocalServiceUtil.getMBThread(classPK);
} else if (ORGANIZATION_CLASS_NAME.equals(className)) {
OrganizationLocalServiceUtil.getOrganization(classPK);
} else if (PAGAMENTO_CLASS_NAME.equals(className)) {
PagamentoLocalServiceUtil.getPagamento(classPK);
} else if (PAREREGEOLOGO_CLASS_NAME.equals(className)) {
ParereGeologoLocalServiceUtil.getParereGeologo(classPK);
} else if (PASSWORDPOLICY_CLASS_NAME.equals(className)) {
PasswordPolicyLocalServiceUtil.getPasswordPolicy(classPK);
} else if (ROLE_CLASS_NAME.equals(className)) {
RoleLocalServiceUtil.getRole(classPK);
} else if (SOGGETTO_CLASS_NAME.equals(className)) {
SoggettoLocalServiceUtil.getSoggetto(classPK);
} else if (SORTEGGIO_CLASS_NAME.equals(className)) {
SorteggioLocalServiceUtil.getSorteggio(classPK);
} else if (USER_CLASS_NAME.equals(className)) {
UserLocalServiceUtil.getUser(classPK);
} else if (USERPERSONALSITE_CLASS_NAME.equals(className)) {
// Nop
} else if (WIKINODE_CLASS_NAME.equals(className)) {
WikiNodeLocalServiceUtil.getWikiNode(classPK);
} else if (WORKFLOWINSTANCE_CLASS_NAME.equals(className)) {
if (Validator.isNull(companyId)) {
_log.info("CompanyId = " + companyId);
;
} else {
WorkflowInstanceManagerUtil.getWorkflowInstance(companyId, classPK);
}
} else {
WorkflowInstanceManagerUtil.getWorkflowInstance(companyId, classPK);
}
} else {
if (className.contains(".")) {
switch (className) {
case "com.liferay.portlet.blogs":
case "com.liferay.portlet.documentlibrary":
case "com.liferay.portlet.journal":
case "com.liferay.portlet.messageboards":
case "com.liferay.portlet.polls":
case "com.liferay.portlet.wiki":
case "it.tref.liferay.portos.bo.intpratiche":
break;
default:
_log.info("Classe non supportata: " + className);
if (className.contains(".")) {
switch (className) {
case "com.liferay.portlet.blogs":
case "com.liferay.portlet.documentlibrary":
case "com.liferay.portlet.journal":
case "com.liferay.portlet.messageboards":
case "com.liferay.portlet.polls":
case "com.liferay.portlet.wiki":
case "it.tref.liferay.portos.bo.intpratiche":
break;
default:
_log.info("Classe non supportata: " + className);
}
}
}
} catch (PortalException e) {
return false;
}
} catch (PortalException e) {
return false;
}
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.SismicaUtil;
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.IntPraticaLocalServiceUtil;
@ -116,11 +116,11 @@ public class SismicaAdministrationPortlet extends MVCPortlet {
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 {
String mode = ParamUtil.getString(actionRequest, "mode");
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()]));
}

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

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

@ -242,7 +242,7 @@ public class IntPraticaLocalServiceImpl extends IntPraticaLocalServiceBaseImpl {
}
return ret;
}
public IntPratica addIntPratica(long territorioId, String tipoProcedura, ServiceContext serviceContext)
throws SystemException, PortalException {

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">
<aui:select name="statoPratica" label="Stato Procedimento">
<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="AU"><liferay-ui:message key="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
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;">
SP
</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>
<liferay-portlet:actionURL name="testInterno" var="testInternoURL" />
<liferay-portlet:actionURL name="manutenzioneDatabase" var="manutenzioneDatabaseURL" />
<liferay-portlet:actionURL name="generaDocumenti" var="generaDocumentiURL" />
<div class="row-fluid" style="margin-top: 10px;">
<div class="span6">
<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>
<aui:input name="mode" label="Modalità" />
<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>
<project name="portos-firma-portlet" basedir="." default="deploy">
<property name="import.shared" value="portos-firma-shared" />
<import file="../build-common-portlet.xml" />
</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="body" type="String" />
<column name="attachmentPermitted" type="Boolean" />
<column name="attachmentPermitted" type="boolean" />
<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"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.7.0_80"/>
<classpathentry kind="lib" path="/home/portos/bin/liferay-portal-6.2-ce-ga6/tomcat-7.0.62/lib/ext/portal-service.jar" sourcepath="/home/portos/sources/liferay-portal-src-6.2-ce-ga6">
<attributes>
<attribute name="javadoc_location" value="file:/home/portos/sources/liferay-javadocs-all/"/>

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;
public class MailTemplateMessage implements Serializable {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;
private long templateId;
private String templateName;
private String templateParam;
private List<FileAttachment> fileAttachments;
private long templateId;
private String templateName;
private String templateParam;
private List<FileAttachment> fileAttachments;
public long getTemplateId() {
return templateId;
}
public long getTemplateId() {
return templateId;
}
public void setTemplateId(long templateId) {
this.templateId = templateId;
}
public void setTemplateId(long templateId) {
this.templateId = templateId;
}
public String getTemplateParam() {
return templateParam;
}
public String getTemplateParam() {
return templateParam;
}
public void setTemplateParam(String templateParam) {
this.templateParam = templateParam;
}
public void setTemplateParam(String templateParam) {
this.templateParam = templateParam;
}
public List<FileAttachment> getFileAttachments() {
return fileAttachments;
}
public List<FileAttachment> getFileAttachments() {
return fileAttachments;
}
public void setFileAttachments(List<FileAttachment> fileAttachments) {
this.fileAttachments = fileAttachments;
}
public void setFileAttachments(List<FileAttachment> fileAttachments) {
this.fileAttachments = fileAttachments;
}
public String getTemplateName() {
return templateName;
}
public String getTemplateName() {
return templateName;
}
public void setTemplateName(String templateName) {
this.templateName = templateName;
}
public void setTemplateName(String 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;
public class TemplateMessage implements Serializable {
private static final long serialVersionUID = 1L;
private long templateId;
private String templateName;
private String from;
private String[] to;
private String[] cc;
private String[] ccn;
private String subject;
private String body;
private boolean attachmentPermitted;
public long getTemplateId() {
return templateId;
}
public void setTemplateId(long templateId) {
this.templateId = templateId;
}
public String getTemplateName() {
return templateName;
}
public void setTemplateName(String templateName) {
this.templateName = templateName;
}
public String getFrom() {
return from;
}
public void setFrom(String from) {
this.from = from;
}
public String[] getTo() {
return to;
}
public void setTo(String[] to) {
this.to = to;
}
public String[] getCc() {
return cc;
}
public void setCc(String[] cc) {
this.cc = cc;
}
public String[] getCcn() {
return ccn;
}
public void setCcn(String[] ccn) {
this.ccn = ccn;
}
public String getBody() {
return body;
}
public void setBody(String body) {
this.body = body;
}
public String getSubject() {
return subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
public boolean isAttachmentPermitted() {
return attachmentPermitted;
}
public void setAttachmentPermitted(boolean attachmentPermitted) {
this.attachmentPermitted = attachmentPermitted;
}
private static final long serialVersionUID = 1L;
private long templateId;
private String templateName;
private String from;
private String[] to;
private String[] cc;
private String[] ccn;
private String subject;
private String body;
private boolean attachmentPermitted;
public long getTemplateId() {
return templateId;
}
public void setTemplateId(long templateId) {
this.templateId = templateId;
}
public String getTemplateName() {
return templateName;
}
public void setTemplateName(String templateName) {
this.templateName = templateName;
}
public String getFrom() {
return from;
}
public void setFrom(String from) {
this.from = from;
}
public String[] getTo() {
return to;
}
public void setTo(String[] to) {
this.to = to;
}
public String[] getCc() {
return cc;
}
public void setCc(String[] cc) {
this.cc = cc;
}
public String[] getCcn() {
return ccn;
}
public void setCcn(String[] ccn) {
this.ccn = ccn;
}
public String getBody() {
return body;
}
public void setBody(String body) {
this.body = body;
}
public String getSubject() {
return subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
public boolean isAttachmentPermitted() {
return attachmentPermitted;
}
public void setAttachmentPermitted(boolean 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 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_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_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_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 EDIT_EMAIL_TEMPLATE = "liferay/mail_manager/edit_email_template";
public static final String EDIT_EMAIL_TEMPLATE = "liferay/mail_manager/edit_email_template";
}

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

@ -28,13 +28,13 @@ import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;
public class MailManagerUtil {
private final static Log _log = LogFactoryUtil.getLog(MailManagerUtil.class);
public static boolean sendMail(String messageId, String inReplyTo, String from, String[] to, String[] cc,
String[] bcc, String subject, String body, boolean htmlFormat, boolean async,
boolean checkPermission, ServiceContext serviceContext) throws AddressException, SystemException {
InternetAddress fromInternetAddress = new InternetAddress(from, true);
InternetAddress[] toInternetAddress = MailUtil.fromStringAddress(to);
@ -114,7 +114,7 @@ public class MailManagerUtil {
String templateName, String[] to, String[] cc, String[] ccn, JSONObject templateVariables,
List<FileAttachment> fileAttachments, boolean async, boolean checkPermission,
ServiceContext serviceContext) throws SystemException {
JSONObject templateParam = JSONFactoryUtil.createJSONObject();
templateParam.put(MailManagerConstants.TEMPLATE_PARAMETER_VARIABLES_KEY, templateVariables);

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.InputStream;
public class FileAttachment extends com.liferay.mail.model.FileAttachment {
public static final Log _log = LogFactoryUtil.getLog(FileAttachment.class);
private long fileEntryId;
private byte[] bytes;
private String tipologia;
private String fileName;
public FileAttachment() {
super();
}
public FileAttachment(File file, String fileName, String tipologia, long fileEntryId, byte[] bytes) {
super(file, fileName);
this.setTipologia(tipologia);
this.fileEntryId = fileEntryId;
this.setBytes(bytes);
}
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
super.setFileName(fileName);
}
public long getFileEntryId() {
return fileEntryId;
}
public void setFileEntryId(long fileEntryId) {
this.fileEntryId = fileEntryId;
}
public byte[] getBytes() {
return bytes;
}
public void setBytes(byte[] bytes) {
this.bytes = bytes;
}
public String getTipologia() {
return tipologia;
}
public void setTipologia(String tipologia) {
this.tipologia = tipologia;
}
public File generateFile() {
File result = null;
try {
if (Validator.isNotNull(super.getFile())) {
result = super.getFile();
} else if (Validator.isNotNull(fileEntryId)) {
FileEntry fileEntry = DLAppLocalServiceUtil.getFileEntry(fileEntryId);
setFileName(fileEntry.getTitle()
+ (Validator.isNotNull(fileEntry.getExtension()) ? "." + fileEntry.getExtension() : StringPool.BLANK));
InputStream is =
DLFileEntryLocalServiceUtil.getFileAsStream(fileEntry.getFileEntryId(), fileEntry.getVersion(), false);
result = FileUtil.createTempFile(is);
is.close();
result.deleteOnExit();
} else if (Validator.isNotNull(bytes)) {
result = FileUtil.createTempFile(bytes);
result.deleteOnExit();
}
} catch (Exception e) {
_log.error("Error during getFile()", e);
}
setFile(result);
return result;
}
public static final Log _log = LogFactoryUtil.getLog(FileAttachment.class);
private long fileEntryId;
private byte[] bytes;
private String tipologia;
private String fileName;
public FileAttachment() {
super();
}
public FileAttachment(File file, String fileName, String tipologia, long fileEntryId, byte[] bytes) {
super(file, fileName);
this.setTipologia(tipologia);
this.fileEntryId = fileEntryId;
this.setBytes(bytes);
}
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
super.setFileName(fileName);
}
public long getFileEntryId() {
return fileEntryId;
}
public void setFileEntryId(long fileEntryId) {
this.fileEntryId = fileEntryId;
}
public byte[] getBytes() {
return bytes;
}
public void setBytes(byte[] bytes) {
this.bytes = bytes;
}
public String getTipologia() {
return tipologia;
}
public void setTipologia(String tipologia) {
this.tipologia = tipologia;
}
public File generateFile() {
File result = null;
try {
if (Validator.isNotNull(super.getFile())) {
result = super.getFile();
} else if (Validator.isNotNull(fileEntryId)) {
FileEntry fileEntry = DLAppLocalServiceUtil.getFileEntry(fileEntryId);
setFileName(fileEntry.getTitle()
+ (Validator.isNotNull(fileEntry.getExtension()) ? "." + fileEntry.getExtension()
: StringPool.BLANK));
InputStream is = DLFileEntryLocalServiceUtil.getFileAsStream(fileEntry.getFileEntryId(),
fileEntry.getVersion(), false);
result = FileUtil.createTempFile(is);
is.close();
result.deleteOnExit();
} else if (Validator.isNotNull(bytes)) {
result = FileUtil.createTempFile(bytes);
result.deleteOnExit();
}
} catch (Exception e) {
_log.error("Error during getFile()", e);
}
setFile(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;
public class MailManagerConstants {
public enum SendTemplateMode {
public enum SendTemplateMode {
REVIEW("R"), EDIT("E");
REVIEW("R"), EDIT("E");
private SendTemplateMode(String id) {
this.id = id;
}
private SendTemplateMode(String id) {
this.id = id;
}
private String id;
private String id;
public static SendTemplateMode parse(String id) {
for (SendTemplateMode item : values()) {
if (item.id.equals(id)) {
return item;
}
}
throw new IllegalArgumentException("Invalid SendTemplateMode value: " + id);
}
public static SendTemplateMode parse(String id) {
for (SendTemplateMode item : values()) {
if (item.id.equals(id)) {
return item;
}
}
throw new IllegalArgumentException("Invalid SendTemplateMode value: " + id);
}
public String getId() {
return id;
}
}
public String getId() {
return id;
}
}
public static final String TEMPLATE_PARAMETER_VARIABLES_KEY = "variables";
public static final String TEMPLATE_PARAMETER_TO_KEY = "to";
public static final String TEMPLATE_PARAMETER_CC_KEY = "cc";
public static final String TEMPLATE_PARAMETER_CCN_KEY = "ccn";
public static final String TEMPLATE_PARAMETER_VARIABLES_KEY = "variables";
public static final String TEMPLATE_PARAMETER_TO_KEY = "to";
public static final String TEMPLATE_PARAMETER_CC_KEY = "cc";
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_ASYNC = "async";
public static final String MESSAGING_SEND_MODE_SYNC = "sync";
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 static String fromInternetAddress(InternetAddress internetAddress) {
if (Validator.isNotNull(internetAddress)) {
return internetAddress.getAddress();
}
return null;
}
public static String fromInternetAddress(InternetAddress internetAddress) {
if (Validator.isNotNull(internetAddress)) {
return internetAddress.getAddress();
}
return null;
}
public static String[] fromInternetAddresses(InternetAddress[] internetAddresses) {
if (internetAddresses != null && internetAddresses.length > 0) {
String[] addresses = new String[internetAddresses.length];
for (int i = 0; i < internetAddresses.length; i++) {
addresses[i] = internetAddresses[i].getAddress();
}
return addresses;
}
return null;
}
public static String[] fromInternetAddresses(InternetAddress[] internetAddresses) {
if (internetAddresses != null && internetAddresses.length > 0) {
String[] addresses = new String[internetAddresses.length];
for (int i = 0; i < internetAddresses.length; i++) {
addresses[i] = internetAddresses[i].getAddress();
}
return addresses;
}
return null;
}
public static InternetAddress[] fromStringAddress(String[] address) throws AddressException {
public static InternetAddress[] fromStringAddress(String[] address) throws AddressException {
InternetAddress[] result = null;
if (address != null && address.length > 0) {
result = new InternetAddress[address.length];
for (int i = 0; i < address.length; i++) {
result[i] = new InternetAddress(address[i], true);
}
}
return result;
}
InternetAddress[] result = null;
if (address != null && address.length > 0) {
result = new InternetAddress[address.length];
for (int i = 0; i < address.length; i++) {
result[i] = new InternetAddress(address[i], true);
}
}
return result;
}
public static List<FileAttachment> getFileAttachments(UploadPortletRequest uploadPortletRequest) {
return getFileAttachments(uploadPortletRequest, Collections.<FileAttachment>emptyList());
}
public static List<FileAttachment> getFileAttachments(UploadPortletRequest uploadPortletRequest) {
return getFileAttachments(uploadPortletRequest, Collections.<FileAttachment> emptyList());
}
public static List<FileAttachment> getFileAttachments(UploadPortletRequest uploadPortletRequest,
List<FileAttachment> defaultFileAttachments) {
public static List<FileAttachment> getFileAttachments(UploadPortletRequest uploadPortletRequest,
List<FileAttachment> defaultFileAttachments) {
String allegatiIndexesString = uploadPortletRequest.getParameter("allegatiIndexes");
String allegatiIndexesString = uploadPortletRequest.getParameter("allegatiIndexes");
if (allegatiIndexesString == null) {
return defaultFileAttachments;
}
if (allegatiIndexesString == null) {
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) {
long fileEntryId = ParamUtil.getLong(uploadPortletRequest, "fileEntryId" + allegatiIndex);
for (int allegatiIndex : allegatiIndexes) {
long fileEntryId = ParamUtil.getLong(uploadPortletRequest, "fileEntryId" + allegatiIndex);
String fileName = uploadPortletRequest.getFileName("file" + allegatiIndex);
File file = uploadPortletRequest.getFile("file" + allegatiIndex);
String fileName = uploadPortletRequest.getFileName("file" + allegatiIndex);
File file = uploadPortletRequest.getFile("file" + allegatiIndex);
if (Validator.isNull(fileEntryId)) {
if (Validator.isNull(fileName)) {
continue;
}
}
if (Validator.isNull(fileEntryId)) {
if (Validator.isNull(fileName)) {
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.setTipologia(tipologia);
fileAttachment.setFileName(fileName);
fileAttachment.setFile(file);
fileAttachment.setFileEntryId(fileEntryId);
fileAttachment.setTipologia(tipologia);
fileAttachment.setFileName(fileName);
fileAttachment.setFile(file);
fileAttachments.add(fileAttachment);
}
fileAttachments.add(fileAttachment);
}
return fileAttachments;
}
return fileAttachments;
}
public static List<com.liferay.mail.model.FileAttachment> getEmailFileAttachments(
UploadPortletRequest uploadPortletRequest) {
return getEmailFileAttachments(uploadPortletRequest, Collections.<com.liferay.mail.model.FileAttachment>emptyList());
}
public static List<com.liferay.mail.model.FileAttachment> getEmailFileAttachments(
UploadPortletRequest uploadPortletRequest) {
return getEmailFileAttachments(uploadPortletRequest,
Collections.<com.liferay.mail.model.FileAttachment> emptyList());
}
public static List<com.liferay.mail.model.FileAttachment> getEmailFileAttachments(
UploadPortletRequest uploadPortletRequest, List<com.liferay.mail.model.FileAttachment> defaultFileAttachments) {
public static List<com.liferay.mail.model.FileAttachment> getEmailFileAttachments(
UploadPortletRequest uploadPortletRequest,
List<com.liferay.mail.model.FileAttachment> defaultFileAttachments) {
String allegatiIndexesString = uploadPortletRequest.getParameter("allegatiIndexes");
String allegatiIndexesString = uploadPortletRequest.getParameter("allegatiIndexes");
if (allegatiIndexesString == null) {
return defaultFileAttachments;
}
if (allegatiIndexesString == null) {
return defaultFileAttachments;
}
List<com.liferay.mail.model.FileAttachment> fileAttachments =
new ArrayList<com.liferay.mail.model.FileAttachment>();
List<com.liferay.mail.model.FileAttachment> fileAttachments = 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);
File file = uploadPortletRequest.getFile("file" + allegatiIndex);
String fileName = uploadPortletRequest.getFileName("file" + allegatiIndex);
File file = uploadPortletRequest.getFile("file" + allegatiIndex);
if (Validator.isNull(fileName)) {
continue;
}
if (Validator.isNull(fileName)) {
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.setFile(file);
fileAttachment.setFileName(fileName);
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;
public class StringUtil extends com.liferay.portal.kernel.util.StringUtil {
public static String[] splitAndTrim(String s) {
String[] array = StringUtil.split(s);
for (int i = 0; i < array.length; i++) {
array[i] = StringUtil.trim(array[i]);
}
return array;
}
public static String[] splitAndTrim(String s) {
String[] array = StringUtil.split(s);
for (int i = 0; i < array.length; i++) {
array[i] = StringUtil.trim(array[i]);
}
return array;
}
}

Caricamento…
Annulla
Salva