|
|
@ -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; |
|
|
|
} |
|
|
|
} |