|
|
@ -15,6 +15,7 @@ import it.tref.liferay.portos.bo.model.DettPratica; |
|
|
|
import it.tref.liferay.portos.bo.model.DocAggiuntiva; |
|
|
|
import it.tref.liferay.portos.bo.model.DocAggiuntiva; |
|
|
|
import it.tref.liferay.portos.bo.model.DocPratica; |
|
|
|
import it.tref.liferay.portos.bo.model.DocPratica; |
|
|
|
import it.tref.liferay.portos.bo.model.FineLavori; |
|
|
|
import it.tref.liferay.portos.bo.model.FineLavori; |
|
|
|
|
|
|
|
import it.tref.liferay.portos.bo.model.HistoryWorkflowAction; |
|
|
|
import it.tref.liferay.portos.bo.model.IntPratica; |
|
|
|
import it.tref.liferay.portos.bo.model.IntPratica; |
|
|
|
import it.tref.liferay.portos.bo.model.Pagamento; |
|
|
|
import it.tref.liferay.portos.bo.model.Pagamento; |
|
|
|
import it.tref.liferay.portos.bo.model.ParereGeologo; |
|
|
|
import it.tref.liferay.portos.bo.model.ParereGeologo; |
|
|
@ -33,6 +34,7 @@ import it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil; |
|
|
|
import it.tref.liferay.portos.bo.service.DocAggiuntivaLocalServiceUtil; |
|
|
|
import it.tref.liferay.portos.bo.service.DocAggiuntivaLocalServiceUtil; |
|
|
|
import it.tref.liferay.portos.bo.service.DocPraticaLocalServiceUtil; |
|
|
|
import it.tref.liferay.portos.bo.service.DocPraticaLocalServiceUtil; |
|
|
|
import it.tref.liferay.portos.bo.service.FineLavoriLocalServiceUtil; |
|
|
|
import it.tref.liferay.portos.bo.service.FineLavoriLocalServiceUtil; |
|
|
|
|
|
|
|
import it.tref.liferay.portos.bo.service.HistoryWorkflowActionLocalServiceUtil; |
|
|
|
import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil; |
|
|
|
import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil; |
|
|
|
import it.tref.liferay.portos.bo.service.PagamentoLocalServiceUtil; |
|
|
|
import it.tref.liferay.portos.bo.service.PagamentoLocalServiceUtil; |
|
|
|
import it.tref.liferay.portos.bo.service.ParereGeologoLocalServiceUtil; |
|
|
|
import it.tref.liferay.portos.bo.service.ParereGeologoLocalServiceUtil; |
|
|
@ -91,6 +93,7 @@ import com.liferay.portal.model.RoleConstants; |
|
|
|
import com.liferay.portal.model.SystemEvent; |
|
|
|
import com.liferay.portal.model.SystemEvent; |
|
|
|
import com.liferay.portal.model.User; |
|
|
|
import com.liferay.portal.model.User; |
|
|
|
import com.liferay.portal.model.UserPersonalSite; |
|
|
|
import com.liferay.portal.model.UserPersonalSite; |
|
|
|
|
|
|
|
import com.liferay.portal.model.WorkflowInstanceLink; |
|
|
|
import com.liferay.portal.service.CompanyLocalServiceUtil; |
|
|
|
import com.liferay.portal.service.CompanyLocalServiceUtil; |
|
|
|
import com.liferay.portal.service.ContactLocalServiceUtil; |
|
|
|
import com.liferay.portal.service.ContactLocalServiceUtil; |
|
|
|
import com.liferay.portal.service.EmailAddressLocalServiceUtil; |
|
|
|
import com.liferay.portal.service.EmailAddressLocalServiceUtil; |
|
|
@ -105,6 +108,7 @@ import com.liferay.portal.service.RoleLocalServiceUtil; |
|
|
|
import com.liferay.portal.service.ServiceContext; |
|
|
|
import com.liferay.portal.service.ServiceContext; |
|
|
|
import com.liferay.portal.service.SystemEventLocalServiceUtil; |
|
|
|
import com.liferay.portal.service.SystemEventLocalServiceUtil; |
|
|
|
import com.liferay.portal.service.UserLocalServiceUtil; |
|
|
|
import com.liferay.portal.service.UserLocalServiceUtil; |
|
|
|
|
|
|
|
import com.liferay.portal.service.WorkflowInstanceLinkLocalServiceUtil; |
|
|
|
import com.liferay.portlet.asset.model.AssetEntry; |
|
|
|
import com.liferay.portlet.asset.model.AssetEntry; |
|
|
|
import com.liferay.portlet.asset.model.AssetTag; |
|
|
|
import com.liferay.portlet.asset.model.AssetTag; |
|
|
|
import com.liferay.portlet.asset.model.AssetVocabulary; |
|
|
|
import com.liferay.portlet.asset.model.AssetVocabulary; |
|
|
@ -137,7 +141,9 @@ import com.liferay.portlet.messageboards.model.MBThread; |
|
|
|
import com.liferay.portlet.messageboards.service.MBDiscussionLocalServiceUtil; |
|
|
|
import com.liferay.portlet.messageboards.service.MBDiscussionLocalServiceUtil; |
|
|
|
import com.liferay.portlet.messageboards.service.MBMessageLocalServiceUtil; |
|
|
|
import com.liferay.portlet.messageboards.service.MBMessageLocalServiceUtil; |
|
|
|
import com.liferay.portlet.messageboards.service.MBThreadLocalServiceUtil; |
|
|
|
import com.liferay.portlet.messageboards.service.MBThreadLocalServiceUtil; |
|
|
|
|
|
|
|
import com.liferay.portlet.ratings.model.RatingsEntry; |
|
|
|
import com.liferay.portlet.ratings.model.RatingsStats; |
|
|
|
import com.liferay.portlet.ratings.model.RatingsStats; |
|
|
|
|
|
|
|
import com.liferay.portlet.ratings.service.RatingsEntryLocalServiceUtil; |
|
|
|
import com.liferay.portlet.ratings.service.RatingsStatsLocalServiceUtil; |
|
|
|
import com.liferay.portlet.ratings.service.RatingsStatsLocalServiceUtil; |
|
|
|
import com.liferay.portlet.wiki.model.WikiNode; |
|
|
|
import com.liferay.portlet.wiki.model.WikiNode; |
|
|
|
import com.liferay.portlet.wiki.service.WikiNodeLocalServiceUtil; |
|
|
|
import com.liferay.portlet.wiki.service.WikiNodeLocalServiceUtil; |
|
|
@ -215,18 +221,22 @@ public class ManutenzioneDatabase { |
|
|
|
esitoLog(esito, svuotaEmailAttachment()); |
|
|
|
esitoLog(esito, svuotaEmailAttachment()); |
|
|
|
esitoLog(esito, svuotaFineLavori()); |
|
|
|
esitoLog(esito, svuotaFineLavori()); |
|
|
|
esitoLog(esito, svuotaGroup(companyId)); |
|
|
|
esitoLog(esito, svuotaGroup(companyId)); |
|
|
|
|
|
|
|
esitoLog(esito, svuotaHistoryWorkflowAction()); |
|
|
|
esitoLog(esito, svuotaMBDiscussion(companyId)); |
|
|
|
esitoLog(esito, svuotaMBDiscussion(companyId)); |
|
|
|
esitoLog(esito, svuotaMBMessage(companyId)); |
|
|
|
esitoLog(esito, svuotaMBMessage(companyId)); |
|
|
|
esitoLog(esito, svuotaMBThread()); |
|
|
|
esitoLog(esito, svuotaMBThread()); |
|
|
|
esitoLog(esito, svuotaPagamento(companyId)); |
|
|
|
esitoLog(esito, svuotaPagamento(companyId)); |
|
|
|
esitoLog(esito, svuotaParereGeologo()); |
|
|
|
esitoLog(esito, svuotaParereGeologo()); |
|
|
|
|
|
|
|
esitoLog(esito, svuotaRatingsEntry()); |
|
|
|
esitoLog(esito, svuotaRatingsStats(companyId)); |
|
|
|
esitoLog(esito, svuotaRatingsStats(companyId)); |
|
|
|
esitoLog(esito, svuotaResourcePermission(companyId)); |
|
|
|
esitoLog(esito, svuotaResourcePermission(companyId)); |
|
|
|
esitoLog(esito, svuotaSoggetto()); |
|
|
|
esitoLog(esito, svuotaSoggetto()); |
|
|
|
|
|
|
|
esitoLog(esito, svuotaSorteggio()); |
|
|
|
esitoLog(esito, svuotaStoricoSoggettoPratica()); |
|
|
|
esitoLog(esito, svuotaStoricoSoggettoPratica()); |
|
|
|
esitoLog(esito, svuotaSyncDLObject()); |
|
|
|
esitoLog(esito, svuotaSyncDLObject()); |
|
|
|
esitoLog(esito, svuotaSystemEvent(companyId)); |
|
|
|
esitoLog(esito, svuotaSystemEvent(companyId)); |
|
|
|
esitoLog(esito, svuotaTempistica()); |
|
|
|
esitoLog(esito, svuotaTempistica()); |
|
|
|
|
|
|
|
esitoLog(esito, svuotaWorkflowInstance()); |
|
|
|
return esito; |
|
|
|
return esito; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -333,7 +343,8 @@ public class ManutenzioneDatabase { |
|
|
|
int rimossi = 0; |
|
|
|
int rimossi = 0; |
|
|
|
fileEntries = DLAppServiceUtil.getFileEntries(repositoryId, folderId, start, start + SLICE); |
|
|
|
fileEntries = DLAppServiceUtil.getFileEntries(repositoryId, folderId, start, start + SLICE); |
|
|
|
for (FileEntry fileEntry : fileEntries) { |
|
|
|
for (FileEntry fileEntry : fileEntries) { |
|
|
|
String[] parti = StringUtil.split(fileEntry.getTitle(), '_'); |
|
|
|
String[] parti = StringUtil.split(fileEntry.getTitle() |
|
|
|
|
|
|
|
.replaceAll("\\.p7m$", StringPool.BLANK), '_'); |
|
|
|
String strId1 = parti[0]; |
|
|
|
String strId1 = parti[0]; |
|
|
|
String tipo = StringPool.BLANK; |
|
|
|
String tipo = StringPool.BLANK; |
|
|
|
String strId2 = StringPool.BLANK; |
|
|
|
String strId2 = StringPool.BLANK; |
|
|
@ -346,6 +357,11 @@ public class ManutenzioneDatabase { |
|
|
|
tipo = parti[1] + StringPool.UNDERLINE + parti[2]; |
|
|
|
tipo = parti[1] + StringPool.UNDERLINE + parti[2]; |
|
|
|
strId2 = parti[3]; |
|
|
|
strId2 = parti[3]; |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
case 5: |
|
|
|
|
|
|
|
if (parti[4].equals("protocollato")) { |
|
|
|
|
|
|
|
tipo = parti[1] + StringPool.UNDERLINE + parti[2]; |
|
|
|
|
|
|
|
strId2 = parti[3]; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if ((strId1.length() == 10) && (strId2.length() > 0) && SismicaUtil.isLong(strId1) |
|
|
|
if ((strId1.length() == 10) && (strId2.length() > 0) && SismicaUtil.isLong(strId1) |
|
|
|
&& SismicaUtil.isLong(strId2)) { |
|
|
|
&& SismicaUtil.isLong(strId2)) { |
|
|
@ -358,7 +374,11 @@ public class ManutenzioneDatabase { |
|
|
|
rimossi++; |
|
|
|
rimossi++; |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
case "AI_B": |
|
|
|
case "CO_B": |
|
|
|
case "CO_B": |
|
|
|
|
|
|
|
case "IN_B": |
|
|
|
|
|
|
|
case "IN_F": |
|
|
|
|
|
|
|
case "MA_F": |
|
|
|
if (!avvisiFileEntries.contains(fileEntry.getFileEntryId())) { |
|
|
|
if (!avvisiFileEntries.contains(fileEntry.getFileEntryId())) { |
|
|
|
DLAppLocalServiceUtil.deleteFileEntry(fileEntry.getFileEntryId()); |
|
|
|
DLAppLocalServiceUtil.deleteFileEntry(fileEntry.getFileEntryId()); |
|
|
|
cancellati++; |
|
|
|
cancellati++; |
|
|
@ -366,6 +386,7 @@ public class ManutenzioneDatabase { |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
default: |
|
|
|
default: |
|
|
|
|
|
|
|
_log.info("T " + System.currentTimeMillis()); |
|
|
|
_log.info("Tipo sconosciuto " + tipo + " (" + fileEntry.getTitle() + ")"); |
|
|
|
_log.info("Tipo sconosciuto " + tipo + " (" + fileEntry.getTitle() + ")"); |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
@ -697,6 +718,26 @@ public class ManutenzioneDatabase { |
|
|
|
return "Cancellati " + cancellati + " Group"; |
|
|
|
return "Cancellati " + cancellati + " Group"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static String svuotaHistoryWorkflowAction() throws SystemException { |
|
|
|
|
|
|
|
int start = 0; |
|
|
|
|
|
|
|
int cancellati = 0; |
|
|
|
|
|
|
|
List<HistoryWorkflowAction> actions = null; |
|
|
|
|
|
|
|
do { |
|
|
|
|
|
|
|
int rimossi = 0; |
|
|
|
|
|
|
|
actions = HistoryWorkflowActionLocalServiceUtil.getHistoryWorkflowActions(start, start + SLICE); |
|
|
|
|
|
|
|
for (HistoryWorkflowAction action : actions) { |
|
|
|
|
|
|
|
if (!esiste(INTPRATICA_CLASS_NAME, action.getIntPraticaId()) |
|
|
|
|
|
|
|
|| !esiste(DETTPRATICA_CLASS_NAME, action.getDettPraticaId())) { |
|
|
|
|
|
|
|
HistoryWorkflowActionLocalServiceUtil.deleteHistoryWorkflowAction(action); |
|
|
|
|
|
|
|
cancellati++; |
|
|
|
|
|
|
|
rimossi++; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
start += SLICE - rimossi; |
|
|
|
|
|
|
|
} while (actions.size() > 0); |
|
|
|
|
|
|
|
return "Cancellati " + cancellati + " HistoryWorkflowAction"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static String svuotaMBDiscussion(long companyId) throws SystemException { |
|
|
|
private static String svuotaMBDiscussion(long companyId) throws SystemException { |
|
|
|
int start = 0; |
|
|
|
int start = 0; |
|
|
|
int cancellati = 0; |
|
|
|
int cancellati = 0; |
|
|
@ -801,6 +842,25 @@ public class ManutenzioneDatabase { |
|
|
|
return "Cancellati " + cancellati + " ParereGeologo"; |
|
|
|
return "Cancellati " + cancellati + " ParereGeologo"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static String svuotaRatingsEntry() throws SystemException { |
|
|
|
|
|
|
|
int start = 0; |
|
|
|
|
|
|
|
int cancellati = 0; |
|
|
|
|
|
|
|
List<RatingsEntry> entries = null; |
|
|
|
|
|
|
|
do { |
|
|
|
|
|
|
|
int rimossi = 0; |
|
|
|
|
|
|
|
entries = RatingsEntryLocalServiceUtil.getRatingsEntries(start, start + SLICE); |
|
|
|
|
|
|
|
for (RatingsEntry entry : entries) { |
|
|
|
|
|
|
|
if (!esiste(entry.getClassName(), entry.getClassPK())) { |
|
|
|
|
|
|
|
RatingsEntryLocalServiceUtil.deleteRatingsEntry(entry); |
|
|
|
|
|
|
|
cancellati++; |
|
|
|
|
|
|
|
rimossi++; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
start += SLICE - rimossi; |
|
|
|
|
|
|
|
} while (entries.size() > 0); |
|
|
|
|
|
|
|
return "Cancellati " + cancellati + " RatingsEntry"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static String svuotaRatingsStats(long companyId) throws SystemException { |
|
|
|
private static String svuotaRatingsStats(long companyId) throws SystemException { |
|
|
|
int start = 0; |
|
|
|
int start = 0; |
|
|
|
int cancellati = 0; |
|
|
|
int cancellati = 0; |
|
|
@ -885,6 +945,26 @@ public class ManutenzioneDatabase { |
|
|
|
return "Cancellati " + cancellati + " Soggetto, " + docPraticaCancellati + " DocPratica"; |
|
|
|
return "Cancellati " + cancellati + " Soggetto, " + docPraticaCancellati + " DocPratica"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static String svuotaSorteggio() throws SystemException { |
|
|
|
|
|
|
|
int start = 0; |
|
|
|
|
|
|
|
int cancellati = 0; |
|
|
|
|
|
|
|
List<Sorteggio> sorteggi = null; |
|
|
|
|
|
|
|
do { |
|
|
|
|
|
|
|
int rimossi = 0; |
|
|
|
|
|
|
|
sorteggi = SorteggioLocalServiceUtil.getSorteggios(start, start + SLICE); |
|
|
|
|
|
|
|
for (Sorteggio sorteggio : sorteggi) { |
|
|
|
|
|
|
|
if (!esiste(INTPRATICA_CLASS_NAME, sorteggio.getIntPraticaId()) |
|
|
|
|
|
|
|
|| !esiste(DETTPRATICA_CLASS_NAME, sorteggio.getDettPraticaId())) { |
|
|
|
|
|
|
|
SorteggioLocalServiceUtil.deleteSorteggio(sorteggio); |
|
|
|
|
|
|
|
cancellati++; |
|
|
|
|
|
|
|
rimossi++; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
start += SLICE - rimossi; |
|
|
|
|
|
|
|
} while (sorteggi.size() > 0); |
|
|
|
|
|
|
|
return "Cancellati " + cancellati + " Sorteggio"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static String svuotaStoricoSoggettoPratica() throws SystemException { |
|
|
|
private static String svuotaStoricoSoggettoPratica() throws SystemException { |
|
|
|
int start = 0; |
|
|
|
int start = 0; |
|
|
|
int cancellati = 0; |
|
|
|
int cancellati = 0; |
|
|
@ -991,6 +1071,37 @@ public class ManutenzioneDatabase { |
|
|
|
return "Cancellati " + cancellati + " User"; |
|
|
|
return "Cancellati " + cancellati + " User"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static String svuotaWorkflowInstance() throws SystemException, PortalException { |
|
|
|
|
|
|
|
int start = 0; |
|
|
|
|
|
|
|
int cancellati = 0; |
|
|
|
|
|
|
|
List<WorkflowInstanceLink> links = null; |
|
|
|
|
|
|
|
do { |
|
|
|
|
|
|
|
int rimossi = 0; |
|
|
|
|
|
|
|
links = WorkflowInstanceLinkLocalServiceUtil.getWorkflowInstanceLinks(start, start + SLICE); |
|
|
|
|
|
|
|
for (WorkflowInstanceLink link : links) { |
|
|
|
|
|
|
|
if (!esiste(link.getClassName(), link.getClassPK())) { |
|
|
|
|
|
|
|
_log.info("Manca " + link.getClassName() + " " + link.getClassPK()); |
|
|
|
|
|
|
|
WorkflowInstance instance = null; |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
instance = WorkflowInstanceManagerUtil.getWorkflowInstance(link.getCompanyId(), |
|
|
|
|
|
|
|
link.getWorkflowInstanceId()); |
|
|
|
|
|
|
|
} catch (PortalException e) { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (Validator.isNull(instance)) { |
|
|
|
|
|
|
|
WorkflowInstanceLinkLocalServiceUtil.deleteWorkflowInstanceLink(link); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
WorkflowInstanceManagerUtil.deleteWorkflowInstance(link.getCompanyId(), |
|
|
|
|
|
|
|
instance.getWorkflowInstanceId()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
cancellati++; |
|
|
|
|
|
|
|
rimossi++; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
start += SLICE - rimossi; |
|
|
|
|
|
|
|
} while (links.size() > 0); |
|
|
|
|
|
|
|
return "Cancellati " + cancellati + " WorkflowInstance"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static boolean esiste(String className, long classPK) throws SystemException { |
|
|
|
private static boolean esiste(String className, long classPK) throws SystemException { |
|
|
|
return esiste(className, classPK, 0); |
|
|
|
return esiste(className, classPK, 0); |
|
|
|
} |
|
|
|
} |
|
|
|