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