diff --git a/liferay-plugins-sdk-6.2/build.portos.properties b/liferay-plugins-sdk-6.2/build.portos.properties index 726a9c5f..c7ef7abd 100644 --- a/liferay-plugins-sdk-6.2/build.portos.properties +++ b/liferay-plugins-sdk-6.2/build.portos.properties @@ -1,3 +1,5 @@ +# Managed by Liferay IDE (remove this comment to prevent future updates) + app.server.tomcat.lib.global.dir = /home/portos/bin/liferay-portal-6.2-ce-ga6/tomcat-7.0.62/lib/ext app.server.tomcat.deploy.dir = /home/portos/bin/liferay-portal-6.2-ce-ga6/tomcat-7.0.62/webapps app.server.parent.dir = /home/portos/bin/liferay-portal-6.2-ce-ga6 diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/sync-web-service.jar b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/sync-web-service.jar new file mode 100644 index 00000000..f28d5b0f Binary files /dev/null and b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/sync-web-service.jar differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/liferay-plugin-package.properties b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/liferay-plugin-package.properties index 7c7658ac..7bcb8332 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/liferay-plugin-package.properties +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/liferay-plugin-package.properties @@ -21,4 +21,4 @@ portal-dependency-tlds=\ required-deployment-contexts=\ hms-taglib-hook,\ portos-kaleo-portlet,\ - portos-mail-manager-portlet + portos-mail-manager-portlet \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/AllegatiUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/AllegatiUtil.java index 2416379b..cbb6fc06 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/AllegatiUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/AllegatiUtil.java @@ -1,10 +1,7 @@ package it.mwg.sismica.bo.util; -import it.tref.liferay.portos.bo.model.Collaudo; -import it.tref.liferay.portos.bo.model.Delega; import it.tref.liferay.portos.bo.model.DettPratica; import it.tref.liferay.portos.bo.model.DocPratica; -import it.tref.liferay.portos.bo.model.FineLavori; import it.tref.liferay.portos.bo.model.IntPratica; import it.tref.liferay.portos.bo.model.Pagamento; import it.tref.liferay.portos.bo.model.Soggetto; @@ -13,20 +10,17 @@ import it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil; import it.tref.liferay.portos.bo.service.DocPraticaLocalServiceUtil; import it.tref.liferay.portos.bo.service.PagamentoLocalServiceUtil; import it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil; -import it.tref.liferay.portos.bo.service.SoggettoServiceUtil; import it.tref.liferay.portos.bo.shared.bean.FirmeBean; import it.tref.liferay.portos.bo.shared.bean.FirmeDetail; import it.tref.liferay.portos.bo.shared.util.ConfigurazioneConstants; import it.tref.liferay.portos.bo.shared.util.DocumentiPraticaUtil; import it.tref.liferay.portos.bo.shared.util.FirmeUtil; -import it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil; import it.tref.liferay.portos.bo.util.PraticaUtil; import it.tref.liferay.portos.bo.util.ValidazionePraticaUtil; import java.io.File; import java.io.IOException; import java.util.ArrayList; -import java.util.Arrays; import java.util.Date; import java.util.HashSet; import java.util.List; @@ -43,7 +37,6 @@ import com.liferay.portal.kernel.log.Log; import com.liferay.portal.kernel.log.LogFactoryUtil; import com.liferay.portal.kernel.repository.model.FileEntry; import com.liferay.portal.kernel.repository.model.Folder; -import com.liferay.portal.kernel.servlet.SessionErrors; import com.liferay.portal.kernel.upload.UploadPortletRequest; import com.liferay.portal.kernel.util.FileUtil; import com.liferay.portal.kernel.util.MimeTypesUtil; @@ -53,7 +46,6 @@ import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.model.User; import com.liferay.portal.security.permission.ActionKeys; import com.liferay.portal.service.ServiceContext; -import com.liferay.portal.service.ServiceContextFactory; import com.liferay.portal.service.UserLocalServiceUtil; import com.liferay.portal.util.PortalUtil; import com.liferay.portlet.documentlibrary.NoSuchFolderException; @@ -280,208 +272,4 @@ public class AllegatiUtil { } return fileEntry; } - - public void sostituisciDL2(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { - - long userId = 0; - String title = null; - String description = null; - String mimeType = null; - String changeLog = StringPool.BLANK; - FileEntry fileEntry = null; - Date now = new Date(); - long companyId = 0; - long groupId = 0; - long defaultFolderId = 0; - Folder defaultFolder = null; - String folderName = null; - byte[] bytes = null; - long folderId = 0; - long repositoryId = 0; - ServiceContext serviceContext = new ServiceContext(); - - String className = ParamUtil.getString(actionRequest, "className"); - Long idOggetto = ParamUtil.getLong(actionRequest, "classPK"); - - UploadPortletRequest uploadRequest = PortalUtil.getUploadPortletRequest(actionRequest); - String sourceFileName = uploadRequest.getFileName("file"); - File file = uploadRequest.getFile("file"); - Folder folder = null; - - switch (className) { - case "it.tref.liferay.portos.bo.model.DocPratica": - DocPratica pratica = DocPraticaLocalServiceUtil.getDocPratica(idOggetto); - userId = pratica.getUserId(); - companyId = pratica.getCompanyId(); - groupId = pratica.getGroupId(); - - serviceContext.setCompanyId(companyId); - serviceContext.setScopeGroupId(groupId); - serviceContext.setUserId(userId); - - defaultFolderId = ConfigurazioneLocalServiceUtil.findByC_ChiaveLong(companyId, - ConfigurazioneConstants.ATTACHMENT_FOLDER_ID); - defaultFolder = DLAppLocalServiceUtil.getFolder(defaultFolderId); - folderName = PraticaUtil.getFolderName(pratica.getClassPk()); - folderId = defaultFolder.getFolderId(); - repositoryId = defaultFolder.getRepositoryId(); - - try { - folder = DLAppLocalServiceUtil.getFolder(repositoryId, folderId, folderName); - } catch (NoSuchFolderException e) { - folder = DLAppLocalServiceUtil.addFolder(userId, repositoryId, folderId, folderName, - StringPool.BLANK, serviceContext); - } - - bytes = FileUtil.getBytes(file); - title = pratica.getTipologia() + StringPool.UNDERLINE + sourceFileName; - description = sourceFileName; - mimeType = MimeTypesUtil.getContentType(sourceFileName); - - try { - fileEntry = DLAppLocalServiceUtil.getFileEntry(pratica.getDlFileEntryId()); - fileEntry = DLAppLocalServiceUtil.updateFileEntry(userId, fileEntry.getFileEntryId(), - now.getTime() + "_" + sourceFileName, mimeType, title, description, changeLog, false, - bytes, serviceContext); - } catch (PortalException e) { - fileEntry = DLAppLocalServiceUtil.addFileEntry(userId, folder.getRepositoryId(), - folder.getFolderId(), now.getTime() + "_" + sourceFileName, mimeType, title, - description, changeLog, bytes, serviceContext); - } - - pratica.setDlFileEntryId(fileEntry.getFileEntryId()); - pratica.setSha256(DigestUtils.sha256Hex(bytes)); - DocPraticaLocalServiceUtil.updateDocPratica(pratica); - break; - - case "it.tref.liferay.portos.bo.model.Pagamento": - Pagamento pagamento = PagamentoLocalServiceUtil.getPagamento(idOggetto); - userId = pagamento.getUserId(); - companyId = pagamento.getCompanyId(); - groupId = pagamento.getGroupId(); - - serviceContext.setCompanyId(companyId); - serviceContext.setScopeGroupId(groupId); - serviceContext.setUserId(userId); - - defaultFolderId = ConfigurazioneLocalServiceUtil.findByC_ChiaveLong(companyId, - ConfigurazioneConstants.ATTACHMENT_FOLDER_ID); - defaultFolder = DLAppLocalServiceUtil.getFolder(defaultFolderId); - folderName = PraticaUtil.getFolderName(pagamento.getClassPk()); - folderId = defaultFolder.getFolderId(); - repositoryId = defaultFolder.getRepositoryId(); - - try { - folder = DLAppLocalServiceUtil.getFolder(repositoryId, folderId, folderName); - } catch (NoSuchFolderException e) { - folder = DLAppLocalServiceUtil.addFolder(userId, repositoryId, folderId, folderName, - StringPool.BLANK, serviceContext); - } - - bytes = FileUtil.getBytes(file); - title = now.getTime() + StringPool.UNDERLINE + "pagamento_manuale" + StringPool.UNDERLINE - + pagamento.getPagamentoId() + StringPool.UNDERLINE + sourceFileName; - description = StringPool.BLANK; - mimeType = MimeTypesUtil.getContentType(sourceFileName); - - try { - fileEntry = DLAppLocalServiceUtil.getFileEntry(pagamento.getFileEntryId()); - fileEntry = DLAppLocalServiceUtil.updateFileEntry(userId, fileEntry.getFileEntryId(), - now.getTime() + "_" + sourceFileName, mimeType, title, description, changeLog, false, - bytes, serviceContext); - } catch (PortalException e) { - fileEntry = DLAppLocalServiceUtil.addFileEntry(userId, folder.getRepositoryId(), - folder.getFolderId(), now.getTime() + "_" + sourceFileName, mimeType, title, - description, changeLog, bytes, serviceContext); - } - - pagamento.setFileEntryId(fileEntry.getFileEntryId()); - PagamentoLocalServiceUtil.updatePagamento(pagamento); - break; - - case "var_soggetti_no_docpratica": - Soggetto soggetto = SoggettoLocalServiceUtil.getSoggetto(idOggetto); - DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(soggetto.getDettPraticaId()); - long intPraticaId = dettPratica.getIntPraticaId(); - serviceContext = ServiceContextFactory.getInstance(Soggetto.class.getName(), actionRequest); - - byte[] content = null; - String jsonFirmatari = ""; - boolean isSigned = false; - FirmeBean firmeBean = new FirmeBean(); - - User user = UserLocalServiceUtil.getUser(serviceContext.getUserId()); - - if (!firmeBean.allSignatures().contains(user.getScreenName())) { - jsonFirmatari = FirmeUtil.addFirma(firmeBean, user.getScreenName()); - } else { - jsonFirmatari = FirmeUtil.serialize(firmeBean); - } - - if (file.exists()) { - - if (Validator.isNotNull(sourceFileName) && file != null) { - // validazione: solo alcune estensioni - String ext = FileUtil.getExtension(sourceFileName); - if (!ext.equalsIgnoreCase("p7m") && !ext.equalsIgnoreCase("pdf")) { - SessionErrors.add(actionRequest, - "error.geniocivilefe.variazione-soggetto.allegato.ext.valid"); - } - // lunghezza fissata a 200 - if (sourceFileName.length() > 200) { - SessionErrors.add(actionRequest, - "error.geniocivilefe.variazione-soggetto.allegato.length.valid"); - } - } else if (!TipoSoggettoUtil.COMMITTENTE.equalsIgnoreCase(soggetto.getTipologiaSoggetto())) { - SessionErrors.add(actionRequest, - "error.geniocivilefe.variazione-soggetto.allegato.is.request"); - } - - if (!SessionErrors.isEmpty(actionRequest)) { - throw new SystemException("error.geniocivilefe.variazione-soggetto.allegato"); - } else if (file != null) { - content = FileUtil.getBytes(file); - } - - } - - if (TipoSoggettoUtil.COMMITTENTE.equals(soggetto.getTipologiaSoggetto())) { - String[] titolare = new String[] { dettPratica.getCodiceFiscaleDelegatoCommittente() }; - isSigned = ValidazionePraticaUtil.isAllegatoSignedBySubjects(sourceFileName, content, - serviceContext.getCompanyId(), Arrays.asList(titolare), jsonFirmatari); - } else { - List soggettiValidi = SoggettoServiceUtil.getValidTmpByIntPratica(intPraticaId); - List codiciFiscaliValidi = new ArrayList(); - for (Soggetto valido : soggettiValidi) { - if (!codiciFiscaliValidi.contains(valido.getCodiceFiscale()) - && !valido.getCodiceFiscale().equalsIgnoreCase(soggetto.getCodiceFiscale())) { - codiciFiscaliValidi.add(valido.getCodiceFiscale()); - } - } - isSigned = ValidazionePraticaUtil.isAllegatoSignedBySubjectsAndPerson(sourceFileName, - content, serviceContext.getCompanyId(), codiciFiscaliValidi, - soggetto.getCodiceFiscale(), jsonFirmatari); - } - - if (isSigned) { - userId = PortalUtil.getUserId(actionRequest); - - try { - SoggettoServiceUtil.allegaFileModifica(soggetto.getSoggettoId(), userId, intPraticaId, - content, sourceFileName, jsonFirmatari, serviceContext); - } catch (PortalException e) { - _log.error(e, e); - throw e; - } - } - - break; - - default: - - break; - - } - - } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SismicaUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SismicaUtil.java index 43f44d18..fc9aba66 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SismicaUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SismicaUtil.java @@ -74,6 +74,7 @@ import com.liferay.portal.kernel.util.LocaleUtil; import com.liferay.portal.kernel.util.OrderByComparatorFactoryUtil; import com.liferay.portal.kernel.util.ParamUtil; import com.liferay.portal.kernel.util.StringPool; +import com.liferay.portal.kernel.util.ThreadUtil; import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.kernel.util.WebKeys; import com.liferay.portal.kernel.workflow.WorkflowException; @@ -118,6 +119,7 @@ public class SismicaUtil { private final static int SLICE = 1000; public static Date[] getWeekInterval(int dow) { + ThreadUtil.threadDump(); return getWeekInterval(dow, Calendar.getInstance().getTime()); } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SvuotaDatabase.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SvuotaDatabase.java index a6fe9664..fc3e4f73 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SvuotaDatabase.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SvuotaDatabase.java @@ -19,11 +19,14 @@ import it.tref.liferay.portos.bo.model.IntPratica; import it.tref.liferay.portos.bo.model.Pagamento; import it.tref.liferay.portos.bo.model.ParereGeologo; import it.tref.liferay.portos.bo.model.Soggetto; +import it.tref.liferay.portos.bo.model.Sorteggio; +import it.tref.liferay.portos.bo.model.StoricoSoggettoPratica; import it.tref.liferay.portos.bo.model.Tempistica; import it.tref.liferay.portos.bo.service.AllegatoManualeLocalServiceUtil; import it.tref.liferay.portos.bo.service.AsseverazioneLocalServiceUtil; import it.tref.liferay.portos.bo.service.AvvisoLocalServiceUtil; import it.tref.liferay.portos.bo.service.CollaudoLocalServiceUtil; +import it.tref.liferay.portos.bo.service.ConfigurazioneLocalServiceUtil; import it.tref.liferay.portos.bo.service.ControlloPraticaLocalServiceUtil; import it.tref.liferay.portos.bo.service.DelegaLocalServiceUtil; import it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil; @@ -34,14 +37,23 @@ import it.tref.liferay.portos.bo.service.IntPraticaLocalServiceUtil; import it.tref.liferay.portos.bo.service.PagamentoLocalServiceUtil; import it.tref.liferay.portos.bo.service.ParereGeologoLocalServiceUtil; import it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil; +import it.tref.liferay.portos.bo.service.SorteggioLocalServiceUtil; +import it.tref.liferay.portos.bo.service.StoricoSoggettoPraticaLocalServiceUtil; import it.tref.liferay.portos.bo.service.TempisticaLocalServiceUtil; +import it.tref.liferay.portos.bo.shared.util.ConfigurazioneConstants; +import it.tref.liferay.portos.bo.util.Constants; import it.tref.liferay.portos.mailmanager.model.Email; import it.tref.liferay.portos.mailmanager.model.EmailAttachment; +import it.tref.liferay.portos.mailmanager.model.EmailConstants; +import it.tref.liferay.portos.mailmanager.model.EmailTemplate; import it.tref.liferay.portos.mailmanager.service.EmailAttachmentLocalServiceUtil; import it.tref.liferay.portos.mailmanager.service.EmailLocalServiceUtil; +import it.tref.liferay.portos.mailmanager.service.EmailTemplateLocalServiceUtil; import java.util.ArrayList; +import java.util.HashSet; import java.util.List; +import java.util.Set; import com.liferay.portal.kernel.cache.CacheRegistryUtil; import com.liferay.portal.kernel.cache.MultiVMPoolUtil; @@ -53,78 +65,168 @@ import com.liferay.portal.kernel.log.LogFactoryUtil; import com.liferay.portal.kernel.servlet.DirectServletRegistryUtil; import com.liferay.portal.kernel.util.StringUtil; import com.liferay.portal.kernel.util.Validator; +import com.liferay.portal.kernel.workflow.WorkflowInstance; +import com.liferay.portal.kernel.workflow.WorkflowInstanceManagerUtil; import com.liferay.portal.model.Company; import com.liferay.portal.model.Contact; +import com.liferay.portal.model.EmailAddress; import com.liferay.portal.model.Group; +import com.liferay.portal.model.Layout; import com.liferay.portal.model.LayoutPrototype; import com.liferay.portal.model.LayoutSetPrototype; import com.liferay.portal.model.Organization; +import com.liferay.portal.model.PasswordPolicy; +import com.liferay.portal.model.ResourceConstants; +import com.liferay.portal.model.ResourcePermission; +import com.liferay.portal.model.Role; +import com.liferay.portal.model.RoleConstants; +import com.liferay.portal.model.SystemEvent; import com.liferay.portal.model.User; import com.liferay.portal.model.UserPersonalSite; import com.liferay.portal.service.CompanyLocalServiceUtil; import com.liferay.portal.service.ContactLocalServiceUtil; +import com.liferay.portal.service.EmailAddressLocalServiceUtil; import com.liferay.portal.service.GroupLocalServiceUtil; +import com.liferay.portal.service.LayoutLocalServiceUtil; import com.liferay.portal.service.LayoutPrototypeLocalServiceUtil; import com.liferay.portal.service.LayoutSetPrototypeLocalServiceUtil; import com.liferay.portal.service.OrganizationLocalServiceUtil; +import com.liferay.portal.service.PasswordPolicyLocalServiceUtil; +import com.liferay.portal.service.ResourcePermissionLocalServiceUtil; +import com.liferay.portal.service.RoleLocalServiceUtil; import com.liferay.portal.service.ServiceContext; +import com.liferay.portal.service.SystemEventLocalServiceUtil; import com.liferay.portal.service.UserLocalServiceUtil; +import com.liferay.portlet.asset.model.AssetEntry; +import com.liferay.portlet.asset.model.AssetTag; +import com.liferay.portlet.asset.model.AssetVocabulary; +import com.liferay.portlet.asset.service.AssetEntryLocalServiceUtil; +import com.liferay.portlet.asset.service.AssetTagLocalServiceUtil; +import com.liferay.portlet.asset.service.AssetVocabularyLocalServiceUtil; +import com.liferay.portlet.documentlibrary.model.DLFileEntry; +import com.liferay.portlet.documentlibrary.model.DLFileEntryType; import com.liferay.portlet.documentlibrary.model.DLFolder; +import com.liferay.portlet.documentlibrary.model.DLSyncConstants; import com.liferay.portlet.documentlibrary.service.DLAppLocalServiceUtil; +import com.liferay.portlet.documentlibrary.service.DLFileEntryTypeLocalServiceUtil; import com.liferay.portlet.documentlibrary.service.DLFolderLocalServiceUtil; +import com.liferay.portlet.dynamicdatamapping.model.DDMStructure; +import com.liferay.portlet.dynamicdatamapping.model.DDMTemplate; +import com.liferay.portlet.dynamicdatamapping.service.DDMStructureLocalServiceUtil; +import com.liferay.portlet.dynamicdatamapping.service.DDMTemplateLocalServiceUtil; +import com.liferay.portlet.expando.model.ExpandoColumn; +import com.liferay.portlet.expando.service.ExpandoColumnLocalServiceUtil; +import com.liferay.portlet.journal.model.JournalArticle; +import com.liferay.portlet.journal.model.JournalArticleResource; +import com.liferay.portlet.journal.model.JournalFolder; +import com.liferay.portlet.journal.service.JournalArticleLocalServiceUtil; +import com.liferay.portlet.journal.service.JournalArticleResourceLocalServiceUtil; +import com.liferay.portlet.journal.service.JournalFolderLocalServiceUtil; +import com.liferay.portlet.messageboards.model.MBDiscussion; +import com.liferay.portlet.messageboards.model.MBMessage; +import com.liferay.portlet.messageboards.model.MBThread; +import com.liferay.portlet.messageboards.service.MBDiscussionLocalServiceUtil; +import com.liferay.portlet.messageboards.service.MBMessageLocalServiceUtil; +import com.liferay.portlet.messageboards.service.MBThreadLocalServiceUtil; +import com.liferay.portlet.ratings.model.RatingsStats; +import com.liferay.portlet.ratings.service.RatingsStatsLocalServiceUtil; +import com.liferay.portlet.wiki.model.WikiNode; +import com.liferay.portlet.wiki.service.WikiNodeLocalServiceUtil; +import com.liferay.sync.model.SyncDLObject; +import com.liferay.sync.service.SyncDLObjectLocalServiceUtil; +/* + * + * Operazioni preliminari sul database, eseguire col portale spento: + * + * UPDATE "portos_bo_territorio" SET "dtini"=NULL WHERE "codiceprovincia"<>'089'; + * + * TRUNCATE TABLE "portos_bo_intpratica"; + * DELETE FROM "browsertracker" WHERE "browsertrackerid" IN (SELECT "browsertrackerid" FROM "browsertracker" "t" LEFT JOIN "user_" "u" ON "t"."userid"="u"."userid" WHERE "u"."userid" IS NULL); + * DELETE FROM "dlfileversion" WHERE "fileversionid" IN (SELECT "fileversionid" FROM "dlfileversion" "v" LEFT JOIN "dlfileentry" "f" ON "v"."fileentryid"="f"."fileentryid" WHERE "f"."fileentryid" IS NULL); + * DELETE FROM "layoutset" WHERE "layoutsetid" IN (SELECT "layoutsetid" FROM "layoutset" "l" LEFT JOIN "group_" "g" ON "l"."groupid"="g"."groupid" WHERE "g"."groupid" IS NULL); + * DELETE FROM "usernotificationdelivery" WHERE "usernotificationdeliveryid" IN (SELECT "usernotificationdeliveryid" FROM "usernotificationdelivery" "d" LEFT JOIN "user_" "u" ON "d"."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 { private static final Log _log = LogFactoryUtil.getLog(SvuotaDatabase.class); private static final int SLICE = 1000; - private static int docPraticaCancellati; - - public static List pulisci(ServiceContext serviceContext) throws SystemException, PortalException { + // !Run!IntPratica!User!Reset! + // 115202,115301,115502,115701,115702,115703,115704,115705,115801,115802,116001,116202,117214,126312,126313,133162,136606,139218,139453,139454 + public static List pulisci(ServiceContext serviceContext, String mode) throws SystemException, + PortalException { List esito = new ArrayList<>(); - // esito.addAll(puliziaDocumentLibrary()); - esito.addAll(svuotaDatabase(serviceContext)); - - try { - SingleVMPoolUtil.clear(); - MultiVMPoolUtil.clear(); - CacheRegistryUtil.clear(); - DirectServletRegistryUtil.clearServlets(); - } catch (IllegalStateException e) { + if (mode.contains("!Run!")) { + long companyId = serviceContext.getCompanyId(); + esito.addAll(puliziaDocumentLibrary(companyId)); + if (mode.contains("!IntPratica!")) { + esitoLog(esito, svuotaIntPratica()); + } + if (mode.contains("!User!")) { + esitoLog(esito, svuotaUser(companyId)); + } + esito.addAll(svuotaDatabase(companyId)); + if (mode.contains("!Reset!")) { + ConfigurazioneLocalServiceUtil.storeConfig(Constants.NUMERO_PROGETTO_KEY_DB, "1", + serviceContext); + } + try { + SingleVMPoolUtil.clear(); + MultiVMPoolUtil.clear(); + CacheRegistryUtil.clear(); + DirectServletRegistryUtil.clearServlets(); + } catch (IllegalStateException e) { + } + _log.info("Elaborazione completata correttamente."); + } else { + esitoLog(esito, "Nessun comando"); } - return esito; } - private static List svuotaDatabase(ServiceContext serviceContext) throws SystemException, - PortalException { + private static List svuotaDatabase(long companyId) throws SystemException, PortalException { List esito = new ArrayList<>(); - esitoLog(esito, "Cancellati " + svuotaDettPratica() + " DettPratica"); - - esitoLog(esito, "Cancellati " + svuotaAllegatoManuale() + " AllegatoManuale"); - esitoLog(esito, "Cancellati " + svuotaAsseverazione() + " Asseverazione"); - esitoLog(esito, "Cancellati " + svuotaAvviso() + " Avviso"); - esitoLog(esito, "Cancellati " + svuotaCollaudo() + " Collaudo"); - esitoLog(esito, "Cancellati " + svuotaContact() + " Contacts"); - esitoLog(esito, "Cancellati " + svuotaControlloPratica() + " ControlloPratica"); - esitoLog(esito, "Cancellati " + svuotaDelega() + " Delega"); - esitoLog(esito, "Cancellati " + svuotaDocAggiuntiva() + " DocAggiuntiva"); - esitoLog(esito, "Cancellati " + svuotaDocPratica() + " DocPratica"); - esitoLog(esito, "Cancellati " + svuotaEmail() + " Email"); - esitoLog(esito, "Cancellati " + svuotaEmailAttachment() + " EmailAttachment"); - esitoLog(esito, "Cancellati " + svuotaFineLavori() + " FineLavori"); - esitoLog(esito, "Cancellati " + svuotaGroup() + " Group"); - esitoLog(esito, "Cancellati " + svuotaPagamento() + " Pagamento"); - docPraticaCancellati = 0; - esitoLog(esito, "Cancellati " + svuotaSoggetto() + " Soggetto, cancellati " + docPraticaCancellati - + " DocPratica"); - esitoLog(esito, "Cancellati " + svuotaTempistica() + " Tempistica"); + + esitoLog(esito, svuotaDettPratica()); + + esitoLog(esito, svuotaAllegatoManuale()); + esitoLog(esito, svuotaAssetEntry(companyId)); + esitoLog(esito, svuotaAsseverazione()); + esitoLog(esito, svuotaAvviso(companyId)); + esitoLog(esito, svuotaCollaudo()); + esitoLog(esito, svuotaContact(companyId)); + esitoLog(esito, svuotaControlloPratica()); + esitoLog(esito, svuotaDelega()); + esitoLog(esito, svuotaDocAggiuntiva()); + esitoLog(esito, svuotaDocPratica()); + esitoLog(esito, svuotaEmail(companyId)); + esitoLog(esito, svuotaEmailAttachment()); + esitoLog(esito, svuotaFineLavori()); + esitoLog(esito, svuotaGroup(companyId)); + esitoLog(esito, svuotaMBDiscussion(companyId)); + esitoLog(esito, svuotaMBMessage(companyId)); + esitoLog(esito, svuotaMBThread()); + esitoLog(esito, svuotaPagamento(companyId)); + esitoLog(esito, svuotaParereGeologo()); + esitoLog(esito, svuotaRatingsStats(companyId)); + esitoLog(esito, svuotaResourcePermission(companyId)); + esitoLog(esito, svuotaSoggetto()); + esitoLog(esito, svuotaStoricoSoggettoPratica()); + esitoLog(esito, svuotaSyncDLObject()); + esitoLog(esito, svuotaSystemEvent(companyId)); + esitoLog(esito, svuotaTempistica()); return esito; } - private static List puliziaDocumentLibrary() { + private static List puliziaDocumentLibrary(long companyId) { List esito = new ArrayList<>(); + Set parentFolderNames = new HashSet<>(); try { + long allegatiFolderId = ConfigurazioneLocalServiceUtil.findByC_ChiaveLong(companyId, + ConfigurazioneConstants.ATTACHMENT_FOLDER_ID); int cancellati = 0; int start = 0; int totali = 0; @@ -136,20 +238,49 @@ public class SvuotaDatabase { for (DLFolder folder : folders) { DLFolder parent = folder.getParentFolder(); if (Validator.isNotNull(parent)) { - switch (parent.getName()) { - case "Allegati": + parentFolderNames.add(parent.getName()); + if (parent.getFolderId() == allegatiFolderId) { long[] ids = StringUtil.split(folder.getName(), "_", 0L); if ((ids.length == 2) && (ids[0] == ids[1])) { - try { - DettPraticaLocalServiceUtil.getDettPratica(ids[0]); - } catch (PortalException e) { + if (!esiste(DETTPRATICA_CLASS_NAME, ids[0]) + && !esiste(DOCPRATICA_CLASS_NAME, ids[0]) + && !esiste(ALLEGATOMANUALE_CLASS_NAME, ids[0]) + && !esiste(ASSEVERAZIONE_CLASS_NAME, ids[0]) + && !esiste(AVVISO_CLASS_NAME, ids[0]) + && !esiste(COLLAUDO_CLASS_NAME, ids[0]) + && !esiste(CONTROLLOPRATICA_CLASS_NAME, ids[0]) + && !esiste(DELEGA_CLASS_NAME, ids[0]) + && !esiste(DOCAGGIUNTIVA_CLASS_NAME, ids[0]) + && !esiste(FINELAVORI_CLASS_NAME, ids[0]) + && !esiste(INTPRATICA_CLASS_NAME, ids[0]) + && !esiste(PAGAMENTO_CLASS_NAME, ids[0]) + && !esiste(PAREREGEOLOGO_CLASS_NAME, ids[0]) + && !esiste(SOGGETTO_CLASS_NAME, ids[0]) + && !esiste(SORTEGGIO_CLASS_NAME, ids[0])) { _log.info("Cancello la cartella " + folder.getName()); + DLAppLocalServiceUtil.deleteFolder(folder.getFolderId()); cancellati++; rimossi++; - DLAppLocalServiceUtil.deleteFolder(folder.getFolderId()); } + } else { + _log.info("Mantengo la cartella " + folder.getName()); + } + } else if (parent.getName().equals(EmailConstants.DEFAULT_ATTACHMENTS_FOLDER_NAME)) { + long emailId = 0; + try { + emailId = Long.parseLong(folder.getName()); + } catch (NumberFormatException e) { + } + if (Validator.isNotNull(emailId) + && String.valueOf(emailId).equals(folder.getName()) + && !esiste(EMAIL_CLASS_NAME, emailId)) { + _log.info("Cancello la cartella " + folder.getName()); + DLAppLocalServiceUtil.deleteFolder(folder.getFolderId()); + cancellati++; + rimossi++; } - break; + } else { + _log.info("Non allegato " + folder.getName() + " in " + parent.getName()); } } } @@ -159,10 +290,13 @@ public class SvuotaDatabase { } catch (PortalException | SystemException e) { esitoLog(esito, "Errore durante l'elaborazione. " + e.getMessage()); } + for (String parentFolderName : parentFolderNames) { + _log.info("Parent: " + parentFolderName); + } return esito; } - private static int svuotaAllegatoManuale() throws SystemException { + private static String svuotaAllegatoManuale() throws SystemException { int start = 0; int cancellati = 0; List allegatiManuali = null; @@ -170,9 +304,9 @@ public class SvuotaDatabase { int rimossi = 0; allegatiManuali = AllegatoManualeLocalServiceUtil.getAllegatoManuales(start, start + SLICE); for (AllegatoManuale allegatoManuale : allegatiManuali) { - if (!esiste(IntPratica.class.getName(), allegatoManuale.getIntPraticaId()) - || !esiste(DettPratica.class.getName(), allegatoManuale.getDettPraticaId()) - || !esiste(Avviso.class.getName(), allegatoManuale.getAvvisoId())) { + if (!esiste(INTPRATICA_CLASS_NAME, allegatoManuale.getIntPraticaId()) + || !esiste(DETTPRATICA_CLASS_NAME, allegatoManuale.getDettPraticaId()) + || !esiste(AVVISO_CLASS_NAME, allegatoManuale.getAvvisoId())) { deleteFileEntry(allegatoManuale.getFileEntryId()); AllegatoManualeLocalServiceUtil.deleteAllegatoManuale(allegatoManuale); cancellati++; @@ -181,10 +315,33 @@ public class SvuotaDatabase { } start += SLICE - rimossi; } while (allegatiManuali.size() > 0); - return cancellati; + return "Cancellati " + cancellati + " AllegatoManuale"; + } + + private static String svuotaAssetEntry(long companyId) throws SystemException { + int start = 0; + int cancellati = 0; + List assetEntries = null; + do { + int rimossi = 0; + assetEntries = AssetEntryLocalServiceUtil.getAssetEntries(start, start + SLICE); + for (AssetEntry assetEntry : assetEntries) { + String className = assetEntry.getClassName(); + if (className.equals(JOURNALARTICLE_CLASS_NAME)) { + className = JOURNALARTICLERESOURCE_CLASS_NAME; + } + if (!esiste(className, assetEntry.getClassPK(), companyId)) { + AssetEntryLocalServiceUtil.deleteAssetEntry(assetEntry); + cancellati++; + rimossi++; + } + } + start += SLICE - rimossi; + } while (assetEntries.size() > 0); + return "Cancellati " + cancellati + " AssetEntry"; } - private static int svuotaAsseverazione() throws SystemException { + private static String svuotaAsseverazione() throws SystemException { int start = 0; int cancellati = 0; List asseverazioni = null; @@ -192,8 +349,8 @@ public class SvuotaDatabase { int rimossi = 0; asseverazioni = AsseverazioneLocalServiceUtil.getAsseveraziones(start, start + SLICE); for (Asseverazione asseverazione : asseverazioni) { - if (!esiste(IntPratica.class.getName(), asseverazione.getIntPraticaId()) - || !esiste(DettPratica.class.getName(), asseverazione.getDettPraticaId())) { + if (!esiste(INTPRATICA_CLASS_NAME, asseverazione.getIntPraticaId()) + || !esiste(DETTPRATICA_CLASS_NAME, asseverazione.getDettPraticaId())) { deleteFileEntry(asseverazione.getFileEntryId()); AsseverazioneLocalServiceUtil.deleteAsseverazione(asseverazione); cancellati++; @@ -202,10 +359,10 @@ public class SvuotaDatabase { } start += SLICE - rimossi; } while (asseverazioni.size() > 0); - return cancellati; + return "Cancellati " + cancellati + " Asseverazione"; } - private static int svuotaAvviso() throws SystemException { + private static String svuotaAvviso(long companyId) throws SystemException { int start = 0; int cancellati = 0; List avvisi = null; @@ -213,8 +370,8 @@ public class SvuotaDatabase { int rimossi = 0; avvisi = AvvisoLocalServiceUtil.getAvvisos(start, start + SLICE); for (Avviso avviso : avvisi) { - if (!esiste(avviso.getClassName(), avviso.getClassPk()) - || !esiste(IntPratica.class.getName(), avviso.getIntPraticaId())) { + if (!esiste(avviso.getClassName(), avviso.getClassPk(), companyId) + || !esiste(INTPRATICA_CLASS_NAME, avviso.getIntPraticaId())) { deleteFileEntry(avviso.getFileEntryIdBase()); deleteFileEntry(avviso.getFileEntryIdInvio()); deleteFileEntry(avviso.getFileEntryIdProtocollo()); @@ -225,10 +382,10 @@ public class SvuotaDatabase { } start += SLICE - rimossi; } while (avvisi.size() > 0); - return cancellati; + return "Cancellati " + cancellati + " Avviso"; } - private static int svuotaCollaudo() throws SystemException, PortalException { + private static String svuotaCollaudo() throws SystemException, PortalException { int start = 0; int cancellati = 0; List collaudi = null; @@ -236,7 +393,7 @@ public class SvuotaDatabase { int rimossi = 0; collaudi = CollaudoLocalServiceUtil.getCollaudos(start, start + SLICE); for (Collaudo collaudo : collaudi) { - if (!esiste(IntPratica.class.getName(), collaudo.getIntPraticaId())) { + if (!esiste(INTPRATICA_CLASS_NAME, collaudo.getIntPraticaId())) { CollaudoLocalServiceUtil.deleteCollaudo(collaudo); cancellati++; rimossi++; @@ -244,66 +401,66 @@ public class SvuotaDatabase { } start += SLICE - rimossi; } while (collaudi.size() > 0); - return cancellati; + return "Cancellati " + cancellati + " Collaudo"; } - private static int svuotaControlloPratica() throws SystemException, PortalException { + private static String svuotaContact(long companyId) throws SystemException, PortalException { int start = 0; int cancellati = 0; - List controlliPratiche = null; + List contacts = null; do { int rimossi = 0; - controlliPratiche = ControlloPraticaLocalServiceUtil.getControlloPraticas(start, start + SLICE); - for (ControlloPratica controlloPratica : controlliPratiche) { - if (!esiste(IntPratica.class.getName(), controlloPratica.getIntPraticaId()) - || !esiste(DettPratica.class.getName(), controlloPratica.getDettPraticaId())) { - ControlloPraticaLocalServiceUtil.deleteControlloPratica(controlloPratica); + contacts = ContactLocalServiceUtil.getContacts(start, start + SLICE); + for (Contact contact : contacts) { + if (!esiste(contact.getClassName(), contact.getClassPK(), companyId)) { + ContactLocalServiceUtil.deleteContact(contact); cancellati++; rimossi++; } } start += SLICE - rimossi; - } while (controlliPratiche.size() > 0); - return cancellati; + } while (contacts.size() > 0); + return "Cancellati " + cancellati + " Contact"; } - private static int svuotaDelega() throws SystemException, PortalException { + private static String svuotaControlloPratica() throws SystemException, PortalException { int start = 0; int cancellati = 0; - List deleghe = null; + List controlliPratiche = null; do { int rimossi = 0; - deleghe = DelegaLocalServiceUtil.getDelegas(start, start + SLICE); - for (Delega delega : deleghe) { - if (!esiste(IntPratica.class.getName(), delega.getIntPraticaId()) - || !esiste(DettPratica.class.getName(), delega.getDettPraticaId())) { - DelegaLocalServiceUtil.deleteDelega(delega); + controlliPratiche = ControlloPraticaLocalServiceUtil.getControlloPraticas(start, start + SLICE); + for (ControlloPratica controlloPratica : controlliPratiche) { + if (!esiste(INTPRATICA_CLASS_NAME, controlloPratica.getIntPraticaId()) + || !esiste(DETTPRATICA_CLASS_NAME, controlloPratica.getDettPraticaId())) { + ControlloPraticaLocalServiceUtil.deleteControlloPratica(controlloPratica); cancellati++; rimossi++; } } start += SLICE - rimossi; - } while (deleghe.size() > 0); - return cancellati; + } while (controlliPratiche.size() > 0); + return "Cancellati " + cancellati + " ControlloPratica"; } - private static int svuotaContact() throws SystemException, PortalException { + private static String svuotaDelega() throws SystemException, PortalException { int start = 0; int cancellati = 0; - List contacts = null; + List deleghe = null; do { int rimossi = 0; - contacts = ContactLocalServiceUtil.getContacts(start, start + SLICE); - for (Contact contact : contacts) { - if (!esiste(contact.getClassName(), contact.getClassPK())) { - ContactLocalServiceUtil.deleteContact(contact); + deleghe = DelegaLocalServiceUtil.getDelegas(start, start + SLICE); + for (Delega delega : deleghe) { + if (!esiste(INTPRATICA_CLASS_NAME, delega.getIntPraticaId()) + || !esiste(DETTPRATICA_CLASS_NAME, delega.getDettPraticaId())) { + DelegaLocalServiceUtil.deleteDelega(delega); cancellati++; rimossi++; } } start += SLICE - rimossi; - } while (contacts.size() > 0); - return cancellati; + } while (deleghe.size() > 0); + return "Cancellati " + cancellati + " Delega"; } private static String svuotaDettPratica() throws SystemException, PortalException { @@ -314,7 +471,7 @@ public class SvuotaDatabase { int rimossi = 0; dettPratiche = DettPraticaLocalServiceUtil.getDettPraticas(start, start + SLICE); for (DettPratica dettPratica : dettPratiche) { - if (!esiste(IntPratica.class.getName(), dettPratica.getIntPraticaId())) { + if (!esiste(INTPRATICA_CLASS_NAME, dettPratica.getIntPraticaId())) { DettPraticaLocalServiceUtil.deleteDettPratica(dettPratica); cancellati++; rimossi++; @@ -325,7 +482,7 @@ public class SvuotaDatabase { return "Cancellati " + cancellati + " DettPratica"; } - private static int svuotaDocAggiuntiva() throws SystemException, PortalException { + private static String svuotaDocAggiuntiva() throws SystemException, PortalException { int start = 0; int cancellati = 0; List docAggiuntive = null; @@ -333,8 +490,8 @@ public class SvuotaDatabase { int rimossi = 0; docAggiuntive = DocAggiuntivaLocalServiceUtil.getDocAggiuntivas(start, start + SLICE); for (DocAggiuntiva docAggiuntiva : docAggiuntive) { - if (!esiste(IntPratica.class.getName(), docAggiuntiva.getIntPraticaId()) - || !esiste(DettPratica.class.getName(), docAggiuntiva.getDettPraticaId())) { + if (!esiste(INTPRATICA_CLASS_NAME, docAggiuntiva.getIntPraticaId()) + || !esiste(DETTPRATICA_CLASS_NAME, docAggiuntiva.getDettPraticaId())) { deleteFileEntry(docAggiuntiva.getFileEntryId()); DocAggiuntivaLocalServiceUtil.deleteDocAggiuntiva(docAggiuntiva); cancellati++; @@ -343,10 +500,10 @@ public class SvuotaDatabase { } start += SLICE - rimossi; } while (docAggiuntive.size() > 0); - return cancellati; + return "Cancellati " + cancellati + " DocAggiuntiva"; } - private static int svuotaDocPratica() throws SystemException, PortalException { + private static String svuotaDocPratica() throws SystemException, PortalException { int start = 0; int cancellati = 0; List docPratiche = null; @@ -354,7 +511,7 @@ public class SvuotaDatabase { int rimossi = 0; docPratiche = DocPraticaLocalServiceUtil.getDocPraticas(start, start + SLICE); for (DocPratica docPratica : docPratiche) { - if (!esiste(IntPratica.class.getName(), docPratica.getIntPraticaId())) { + if (!esiste(INTPRATICA_CLASS_NAME, docPratica.getIntPraticaId())) { deleteFileEntry(docPratica.getDlFileEntryId()); DocPraticaLocalServiceUtil.deleteDocPratica(docPratica); cancellati++; @@ -363,10 +520,10 @@ public class SvuotaDatabase { } start += SLICE - rimossi; } while (docPratiche.size() > 0); - return cancellati; + return "Cancellati " + cancellati + " DocPratica"; } - private static int svuotaEmail() throws SystemException, PortalException { + private static String svuotaEmail(long companyId) throws SystemException, PortalException { int start = 0; int cancellati = 0; List emails = null; @@ -374,7 +531,7 @@ public class SvuotaDatabase { int rimossi = 0; emails = EmailLocalServiceUtil.getEmails(start, start + SLICE); for (Email email : emails) { - if (!esiste(email.getClassName(), email.getClassPK())) { + if (!esiste(email.getClassName(), email.getClassPK(), companyId)) { EmailLocalServiceUtil.deleteEmail(email); cancellati++; rimossi++; @@ -382,10 +539,10 @@ public class SvuotaDatabase { } start += SLICE - rimossi; } while (emails.size() > 0); - return cancellati; + return "Cancellati " + cancellati + " Email"; } - private static int svuotaEmailAttachment() throws SystemException, PortalException { + private static String svuotaEmailAttachment() throws SystemException, PortalException { int start = 0; int cancellati = 0; List emailAttachments = null; @@ -393,7 +550,7 @@ public class SvuotaDatabase { int rimossi = 0; emailAttachments = EmailAttachmentLocalServiceUtil.getEmailAttachments(start, start + SLICE); for (EmailAttachment emailAttachment : emailAttachments) { - if (!esiste(Email.class.getName(), emailAttachment.getEmailId())) { + if (!esiste(EMAIL_CLASS_NAME, emailAttachment.getEmailId())) { deleteFileEntry(emailAttachment.getFileEntryId()); EmailAttachmentLocalServiceUtil.deleteEmailAttachment(emailAttachment); cancellati++; @@ -402,10 +559,10 @@ public class SvuotaDatabase { } start += SLICE - rimossi; } while (emailAttachments.size() > 0); - return cancellati; + return "Cancellati " + cancellati + " EmailAttachment"; } - private static int svuotaFineLavori() throws SystemException, PortalException { + private static String svuotaFineLavori() throws SystemException, PortalException { int start = 0; int cancellati = 0; List finiLavori = null; @@ -413,7 +570,7 @@ public class SvuotaDatabase { int rimossi = 0; finiLavori = FineLavoriLocalServiceUtil.getFineLavoris(start, start + SLICE); for (FineLavori fineLavori : finiLavori) { - if (!esiste(IntPratica.class.getName(), fineLavori.getIntPraticaId())) { + if (!esiste(INTPRATICA_CLASS_NAME, fineLavori.getIntPraticaId())) { FineLavoriLocalServiceUtil.deleteFineLavori(fineLavori); cancellati++; rimossi++; @@ -421,10 +578,27 @@ public class SvuotaDatabase { } start += SLICE - rimossi; } while (finiLavori.size() > 0); - return cancellati; + return "Cancellati " + cancellati + " FineLavori"; + } + + private static String svuotaIntPratica() throws SystemException, PortalException { + int start = 0; + int cancellati = 0; + List intPratiche = null; + do { + int rimossi = 0; + intPratiche = IntPraticaLocalServiceUtil.getIntPraticas(start, start + SLICE); + for (IntPratica intPratica : intPratiche) { + IntPraticaLocalServiceUtil.deleteIntPratica(intPratica); + cancellati++; + rimossi++; + } + start += SLICE - rimossi; + } while (intPratiche.size() > 0); + return "Cancellati " + cancellati + " IntPratica"; } - private static int svuotaGroup() throws SystemException, PortalException { + private static String svuotaGroup(long companyId) throws SystemException, PortalException { int start = 0; int cancellati = 0; List groups = null; @@ -432,7 +606,7 @@ public class SvuotaDatabase { int rimossi = 0; groups = GroupLocalServiceUtil.getGroups(start, start + SLICE); for (Group group : groups) { - if (!esiste(group.getClassName(), group.getClassPK())) { + if (!esiste(group.getClassName(), group.getClassPK(), companyId)) { GroupLocalServiceUtil.deleteGroup(group); cancellati++; rimossi++; @@ -440,10 +614,72 @@ public class SvuotaDatabase { } start += SLICE - rimossi; } while (groups.size() > 0); - return cancellati; + return "Cancellati " + cancellati + " Group"; } - private static int svuotaPagamento() throws SystemException, PortalException { + private static String svuotaMBDiscussion(long companyId) throws SystemException { + int start = 0; + int cancellati = 0; + List mbDiscussions = null; + do { + int rimossi = 0; + mbDiscussions = MBDiscussionLocalServiceUtil.getMBDiscussions(start, start + SLICE); + for (MBDiscussion mbDiscussion : mbDiscussions) { + if (!esiste(mbDiscussion.getClassName(), mbDiscussion.getClassPK(), companyId) + || !esiste(MBTHREAD_CLASS_NAME, mbDiscussion.getThreadId()) + || !esiste(GROUP_CLASS_NAME, mbDiscussion.getGroupId())) { + MBDiscussionLocalServiceUtil.deleteMBDiscussion(mbDiscussion); + cancellati++; + rimossi++; + } + } + start += SLICE - rimossi; + } while (mbDiscussions.size() > 0); + return "Cancellati " + cancellati + " MBDiscussion"; + } + + private static String svuotaMBMessage(long companyId) throws SystemException { + int start = 0; + int cancellati = 0; + List mbMessages = null; + do { + int rimossi = 0; + mbMessages = MBMessageLocalServiceUtil.getMBMessages(start, start + SLICE); + for (MBMessage mbMessage : mbMessages) { + if (!esiste(mbMessage.getClassName(), mbMessage.getClassPK(), companyId) + || !esiste(MBTHREAD_CLASS_NAME, mbMessage.getThreadId()) + || !esiste(GROUP_CLASS_NAME, mbMessage.getGroupId())) { + MBMessageLocalServiceUtil.deleteMBMessage(mbMessage); + cancellati++; + rimossi++; + } + } + start += SLICE - rimossi; + } while (mbMessages.size() > 0); + return "Cancellati " + cancellati + " MBMessage"; + } + + private static String svuotaMBThread() throws SystemException { + int start = 0; + int cancellati = 0; + List mbThreads = null; + do { + int rimossi = 0; + mbThreads = MBThreadLocalServiceUtil.getMBThreads(start, start + SLICE); + for (MBThread mbThread : mbThreads) { + if (!esiste(MBMESSAGE_CLASS_NAME, mbThread.getRootMessageId()) + || !esiste(GROUP_CLASS_NAME, mbThread.getGroupId())) { + MBThreadLocalServiceUtil.deleteMBThread(mbThread); + cancellati++; + rimossi++; + } + } + start += SLICE - rimossi; + } while (mbThreads.size() > 0); + return "Cancellati " + cancellati + " MBThread"; + } + + private static String svuotaPagamento(long companyId) throws SystemException, PortalException { int start = 0; int cancellati = 0; List pagamenti = null; @@ -451,8 +687,8 @@ public class SvuotaDatabase { int rimossi = 0; pagamenti = PagamentoLocalServiceUtil.getPagamentos(start, start + SLICE); for (Pagamento pagamento : pagamenti) { - if (!esiste(pagamento.getClassName(), pagamento.getClassPk()) - || !esiste(IntPratica.class.getName(), pagamento.getIntPraticaId())) { + if (!esiste(pagamento.getClassName(), pagamento.getClassPk(), companyId) + || !esiste(INTPRATICA_CLASS_NAME, pagamento.getIntPraticaId())) { deleteFileEntry(pagamento.getFileEntryId()); PagamentoLocalServiceUtil.deletePagamento(pagamento); cancellati++; @@ -461,19 +697,94 @@ public class SvuotaDatabase { } start += SLICE - rimossi; } while (pagamenti.size() > 0); - return cancellati; + return "Cancellati " + cancellati + " Pagamento"; + } + + private static String svuotaParereGeologo() throws SystemException { + int start = 0; + int cancellati = 0; + List pareriGeologo = null; + do { + int rimossi = 0; + pareriGeologo = ParereGeologoLocalServiceUtil.getParereGeologos(start, start + SLICE); + for (ParereGeologo parereGeologo : pareriGeologo) { + if (!esiste(INTPRATICA_CLASS_NAME, parereGeologo.getIntPraticaId()) + || !esiste(DETTPRATICA_CLASS_NAME, parereGeologo.getDettPraticaId())) { + deleteFileEntry(parereGeologo.getFileEntryId()); + ParereGeologoLocalServiceUtil.deleteParereGeologo(parereGeologo); + cancellati++; + rimossi++; + } + } + start += SLICE - rimossi; + } while (pareriGeologo.size() > 0); + return "Cancellati " + cancellati + " ParereGeologo"; + } + + private static String svuotaRatingsStats(long companyId) throws SystemException { + int start = 0; + int cancellati = 0; + List ratingsStatses = null; + do { + int rimossi = 0; + ratingsStatses = RatingsStatsLocalServiceUtil.getRatingsStatses(start, start + SLICE); + for (RatingsStats ratingsStats : ratingsStatses) { + if (!esiste(ratingsStats.getClassName(), ratingsStats.getClassPK(), companyId)) { + RatingsStatsLocalServiceUtil.deleteRatingsStats(ratingsStats); + cancellati++; + rimossi++; + } + } + start += SLICE - rimossi; + } while (ratingsStatses.size() > 0); + return "Cancellati " + cancellati + " RatingsStats"; + } + + private static String svuotaResourcePermission(long companyId) throws SystemException { + int start = 0; + int cancellati = 0; + List resourcePermissions = null; + do { + int rimossi = 0; + resourcePermissions = ResourcePermissionLocalServiceUtil.getResourcePermissions(start, start + + SLICE); + for (ResourcePermission resourcePermission : resourcePermissions) { + long classPK = 0; + try { + classPK = Long.parseLong(resourcePermission.getPrimKey()); + if (!String.valueOf(classPK).equals(resourcePermission.getPrimKey())) { + classPK = 0; + } + } catch (NumberFormatException e) { + } + if (Validator.isNotNull(classPK)) { + switch (resourcePermission.getScope()) { + case ResourceConstants.SCOPE_INDIVIDUAL: + if (!esiste(resourcePermission.getName(), classPK)) { + ResourcePermissionLocalServiceUtil.deleteResourcePermission(resourcePermission); + cancellati++; + rimossi++; + } + break; + } + } + } + start += SLICE - rimossi; + } while (resourcePermissions.size() > 0); + return "Cancellati " + cancellati + " ResourcePermission"; } - private static int svuotaSoggetto() throws SystemException, PortalException { + private static String svuotaSoggetto() throws SystemException, PortalException { int start = 0; int cancellati = 0; + int docPraticaCancellati = 0; List soggetti = null; do { int rimossi = 0; soggetti = SoggettoLocalServiceUtil.getSoggettos(start, start + SLICE); for (Soggetto soggetto : soggetti) { - if (!esiste(IntPratica.class.getName(), soggetto.getIntPraticaId()) - || !esiste(DettPratica.class.getName(), soggetto.getDettPraticaId())) { + if (!esiste(INTPRATICA_CLASS_NAME, soggetto.getIntPraticaId()) + || !esiste(DETTPRATICA_CLASS_NAME, soggetto.getDettPraticaId())) { if (Validator.isNotNull(soggetto.getFileVariazioneId())) { try { DocPratica docPratica = DocPraticaLocalServiceUtil.getDocPratica(soggetto @@ -491,10 +802,78 @@ public class SvuotaDatabase { } start += SLICE - rimossi; } while (soggetti.size() > 0); - return cancellati; + return "Cancellati " + cancellati + " Soggetto, " + docPraticaCancellati + " DocPratica"; } - private static int svuotaTempistica() throws SystemException, PortalException { + private static String svuotaStoricoSoggettoPratica() throws SystemException { + int start = 0; + int cancellati = 0; + List storicoSoggettiPratiche = null; + do { + int rimossi = 0; + storicoSoggettiPratiche = StoricoSoggettoPraticaLocalServiceUtil.getStoricoSoggettoPraticas( + start, start + SLICE); + for (StoricoSoggettoPratica storicoSoggettoPratica : storicoSoggettiPratiche) { + if (!esiste(INTPRATICA_CLASS_NAME, storicoSoggettoPratica.getIntPraticaId())) { + StoricoSoggettoPraticaLocalServiceUtil + .deleteStoricoSoggettoPratica(storicoSoggettoPratica); + cancellati++; + rimossi++; + } + } + start += SLICE - rimossi; + } while (storicoSoggettiPratiche.size() > 0); + return "Cancellati " + cancellati + " StoricoSoggettoPratica"; + } + + private static String svuotaSystemEvent(long companyId) throws SystemException { + int start = 0; + int cancellati = 0; + List systemEvents = null; + do { + int rimossi = 0; + systemEvents = SystemEventLocalServiceUtil.getSystemEvents(start, start + SLICE); + for (SystemEvent systemEvent : systemEvents) { + if (!esiste(systemEvent.getClassName(), systemEvent.getClassPK(), companyId)) { + SystemEventLocalServiceUtil.deleteSystemEvent(systemEvent); + cancellati++; + rimossi++; + } + } + start += SLICE - rimossi; + } while (systemEvents.size() > 0); + return "Cancellati " + cancellati + " SystemEvent"; + } + + private static String svuotaSyncDLObject() throws SystemException { + int start = 0; + int cancellati = 0; + List syncDLObjects = null; + do { + int rimossi = 0; + syncDLObjects = SyncDLObjectLocalServiceUtil.getSyncDLObjects(start, start + SLICE); + for (SyncDLObject syncDLObject : syncDLObjects) { + String className = null; + switch (syncDLObject.getType()) { + case DLSyncConstants.TYPE_FILE: + className = DLFILEENTRY_CLASS_NAME; + break; + case DLSyncConstants.TYPE_FOLDER: + className = DLFOLDER_CLASS_NAME; + break; + } + if (!esiste(className, syncDLObject.getTypePK())) { + SyncDLObjectLocalServiceUtil.deleteSyncDLObject(syncDLObject); + cancellati++; + rimossi++; + } + } + start += SLICE - rimossi; + } while (syncDLObjects.size() > 0); + return "Cancellati " + cancellati + " SyncDLObject"; + } + + private static String svuotaTempistica() throws SystemException, PortalException { int start = 0; int cancellati = 0; List tempistiche = null; @@ -502,8 +881,8 @@ public class SvuotaDatabase { int rimossi = 0; tempistiche = TempisticaLocalServiceUtil.getTempisticas(start, start + SLICE); for (Tempistica tempistica : tempistiche) { - if (!esiste(IntPratica.class.getName(), tempistica.getIntPraticaId()) - || !esiste(DettPratica.class.getName(), tempistica.getDettPraticaId())) { + if (!esiste(INTPRATICA_CLASS_NAME, tempistica.getIntPraticaId()) + || !esiste(DETTPRATICA_CLASS_NAME, tempistica.getDettPraticaId())) { TempisticaLocalServiceUtil.deleteTempistica(tempistica); cancellati++; rimossi++; @@ -511,47 +890,141 @@ public class SvuotaDatabase { } start += SLICE - rimossi; } while (tempistiche.size() > 0); - return cancellati; + return "Cancellati " + cancellati + " Tempistica"; + } + + private static String svuotaUser(long companyId) throws SystemException, PortalException { + int start = 0; + int cancellati = 0; + List users = null; + Role adminRole = RoleLocalServiceUtil.getRole(companyId, RoleConstants.ADMINISTRATOR); + do { + int rimossi = 0; + users = UserLocalServiceUtil.getUsers(start, start + SLICE); + for (User user : users) { + if (user.getRoles().contains(adminRole)) { + _log.info("Non cancello utente " + user.getFullName()); + } + } + start += SLICE - rimossi; + } while (users.size() > 0); + return "Cancellati " + cancellati + " User"; } private static boolean esiste(String className, long classPK) throws SystemException { + return esiste(className, classPK, 0); + } + + private static boolean esiste(String className, long classPK, long companyId) throws SystemException { try { - if (className.equalsIgnoreCase(Asseverazione.class.getName())) { + 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 (className.equalsIgnoreCase(Avviso.class.getName())) { + } else if (AVVISO_CLASS_NAME.equals(className)) { AvvisoLocalServiceUtil.getAvviso(classPK); - } else if (className.equalsIgnoreCase(Collaudo.class.getName())) { + } else if (COLLAUDO_CLASS_NAME.equals(className)) { CollaudoLocalServiceUtil.getCollaudo(classPK); - } else if (className.equalsIgnoreCase(Company.class.getName())) { + } else if (COMPANY_CLASS_NAME.equals(className)) { CompanyLocalServiceUtil.getCompany(classPK); - } else if (className.equalsIgnoreCase(Delega.class.getName())) { + } 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 (className.equalsIgnoreCase(DettPratica.class.getName())) { + } else if (DETTPRATICA_CLASS_NAME.equals(className)) { DettPraticaLocalServiceUtil.getDettPratica(classPK); - } else if (className.equalsIgnoreCase(Email.class.getName())) { + } 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 (className.equalsIgnoreCase(FineLavori.class.getName())) { + } 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 (className.equalsIgnoreCase(Group.class.getName())) { + } else if (GROUP_CLASS_NAME.equals(className)) { GroupLocalServiceUtil.getGroup(classPK); - } else if (className.equalsIgnoreCase(IntPratica.class.getName())) { + } else if (INTPRATICA_CLASS_NAME.equals(className)) { IntPraticaLocalServiceUtil.getIntPratica(classPK); - } else if (className.equalsIgnoreCase(LayoutPrototype.class.getName())) { + } 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 (className.equalsIgnoreCase(LayoutSetPrototype.class.getName())) { + } else if (LAYOUTSETPROTOTYPE_CLASS_NAME.equals(className)) { LayoutSetPrototypeLocalServiceUtil.getLayoutSetPrototype(classPK); - } else if (className.equalsIgnoreCase(ParereGeologo.class.getName())) { - ParereGeologoLocalServiceUtil.getParereGeologo(classPK); - } else if (className.equalsIgnoreCase(Organization.class.getName())) { + } 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 (className.equalsIgnoreCase(Soggetto.class.getName())) { + } 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 (className.equalsIgnoreCase(User.class.getName())) { + } else if (SORTEGGIO_CLASS_NAME.equals(className)) { + SorteggioLocalServiceUtil.getSorteggio(classPK); + } else if (USER_CLASS_NAME.equals(className)) { UserLocalServiceUtil.getUser(classPK); - } else if (className.equalsIgnoreCase(UserPersonalSite.class.getName())) { + } 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 { - _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; @@ -570,4 +1043,49 @@ public class SvuotaDatabase { _log.info(msg); esito.add(msg); } + + private static final String ALLEGATOMANUALE_CLASS_NAME = AllegatoManuale.class.getName(); + private static final String ASSETTAG_CLASS_NAME = AssetTag.class.getName(); + private static final String ASSETVOCABULARY_CLASS_NAME = AssetVocabulary.class.getName(); + private static final String ASSEVERAZIONE_CLASS_NAME = Asseverazione.class.getName(); + private static final String AVVISO_CLASS_NAME = Avviso.class.getName(); + private static final String COLLAUDO_CLASS_NAME = Collaudo.class.getName(); + private static final String COMPANY_CLASS_NAME = Company.class.getName(); + private static final String CONTROLLOPRATICA_CLASS_NAME = ControlloPratica.class.getName(); + private static final String DDMSTRUCTURE_CLASS_NAME = DDMStructure.class.getName(); + private static final String DDMTEMPLATE_CLASS_NAME = DDMTemplate.class.getName(); + private static final String DELEGA_CLASS_NAME = Delega.class.getName(); + private static final String DETTPRATICA_CLASS_NAME = DettPratica.class.getName(); + private static final String DLFILEENTRY_CLASS_NAME = DLFileEntry.class.getName(); + private static final String DLFILEENTRYTYPE_CLASS_NAME = DLFileEntryType.class.getName(); + private static final String DLFOLDER_CLASS_NAME = DLFolder.class.getName(); + private static final String DOCAGGIUNTIVA_CLASS_NAME = DocAggiuntiva.class.getName(); + private static final String DOCPRATICA_CLASS_NAME = DocPratica.class.getName(); + private static final String EMAIL_CLASS_NAME = Email.class.getName(); + private static final String EMAILADDRESS_CLASS_NAME = EmailAddress.class.getName(); + private static final String EMAILTEMPLATE_CLASS_NAME = EmailTemplate.class.getName(); + private static final String EXPANDOCOLUMN_CLASS_NAME = ExpandoColumn.class.getName(); + private static final String FINELAVORI_CLASS_NAME = FineLavori.class.getName(); + private static final String GROUP_CLASS_NAME = Group.class.getName(); + private static final String INTPRATICA_CLASS_NAME = IntPratica.class.getName(); + private static final String JOURNALARTICLE_CLASS_NAME = JournalArticle.class.getName(); + private static final String JOURNALARTICLERESOURCE_CLASS_NAME = JournalArticleResource.class.getName(); + private static final String JOURNALFOLDER_CLASS_NAME = JournalFolder.class.getName(); + private static final String LAYOUT_CLASS_NAME = Layout.class.getName(); + private static final String LAYOUTPROTOTYPE_CLASS_NAME = LayoutPrototype.class.getName(); + private static final String LAYOUTSETPROTOTYPE_CLASS_NAME = LayoutSetPrototype.class.getName(); + private static final String MBDISCUSSION_CLASS_NAME = MBDiscussion.class.getName(); + private static final String MBMESSAGE_CLASS_NAME = MBMessage.class.getName(); + private static final String MBTHREAD_CLASS_NAME = MBThread.class.getName(); + private static final String ORGANIZATION_CLASS_NAME = Organization.class.getName(); + private static final String PAGAMENTO_CLASS_NAME = Pagamento.class.getName(); + private static final String PAREREGEOLOGO_CLASS_NAME = ParereGeologo.class.getName(); + private static final String PASSWORDPOLICY_CLASS_NAME = PasswordPolicy.class.getName(); + private static final String ROLE_CLASS_NAME = Role.class.getName(); + private static final String SOGGETTO_CLASS_NAME = Soggetto.class.getName(); + private static final String SORTEGGIO_CLASS_NAME = Sorteggio.class.getName(); + private static final String USER_CLASS_NAME = User.class.getName(); + private static final String USERPERSONALSITE_CLASS_NAME = UserPersonalSite.class.getName(); + private static final String WIKINODE_CLASS_NAME = WikiNode.class.getName(); + private static final String WORKFLOWINSTANCE_CLASS_NAME = WorkflowInstance.class.getName(); } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/SismicaAdministrationPortlet.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/SismicaAdministrationPortlet.java index 96f449ac..1f06cfcf 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/SismicaAdministrationPortlet.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/SismicaAdministrationPortlet.java @@ -118,8 +118,9 @@ public class SismicaAdministrationPortlet extends MVCPortlet { public void testInterno(ActionRequest actionRequest, ActionResponse actionResponse) throws PortalException, SystemException { + String mode = ParamUtil.getString(actionRequest, "mode"); ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest); - List esito = SvuotaDatabase.pulisci(serviceContext); + List esito = SvuotaDatabase.pulisci(serviceContext, mode); actionResponse.setRenderParameter("esito", esito.toArray(new String[esito.size()])); } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AsseverazioneLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AsseverazioneLocalServiceImpl.java index f9dc9c0c..ddc5101e 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AsseverazioneLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AsseverazioneLocalServiceImpl.java @@ -539,14 +539,11 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase @Override public Asseverazione deleteAsseverazione(Asseverazione asseverazione) throws SystemException { - try { - if (Validator.isNotNull(asseverazione.getFileEntryId())) { + if (Validator.isNotNull(asseverazione.getFileEntryId())) { + try { dlAppLocalService.deleteFileEntry(asseverazione.getFileEntryId()); + } catch (PortalException e) { } - } catch (NoSuchFileEntryException | NoSuchRepositoryEntryException e) { - - } catch (PortalException e) { - throw new SystemException(e); } return super.deleteAsseverazione(asseverazione); } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DelegaLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DelegaLocalServiceImpl.java index b211e1c8..6085ee90 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DelegaLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DelegaLocalServiceImpl.java @@ -133,8 +133,6 @@ public class DelegaLocalServiceImpl extends DelegaLocalServiceBaseImpl { @Override public Delega deleteDelega(Delega delega) throws SystemException { - // TODO cancellare il file quando ci sar� - return super.deleteDelega(delega); } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DettPraticaLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DettPraticaLocalServiceImpl.java index ec1bb5f4..1c56a916 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DettPraticaLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DettPraticaLocalServiceImpl.java @@ -113,7 +113,7 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl User user = userLocalService.getUser(serviceContext.getUserId()); Date now = new Date(); - + DettPratica dettPratica = dettPraticaLocalService.createDettPratica(counterLocalService .increment(DettPratica.class.getName())); @@ -179,7 +179,7 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl String tipoIntegrazione, ServiceContext serviceContext) throws PortalException, SystemException { IntPratica intPratica = intPraticaLocalService.getIntPratica(intPraticaId); - + DettPratica dettPratica = initDettPratica(serviceContext); dettPratica = dettPraticaPersistence.update(dettPratica); DettPratica dettPraticaToClone = dettPraticaPersistence.findByPrimaryKey(dettPraticaToCloneId); @@ -284,8 +284,8 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl dettPraticaToClone.getNormLTC01(), dettPraticaToClone.getSuap(), dettPraticaToClone.getNormSismaBonus(), dettPraticaToClone.getClRischioPreInt(), dettPraticaToClone.getClRischioPostInt(), dettPraticaToClone.getIntervFinPub(), - dettPraticaToClone.getIntervFinPubDesc(), dettPraticaToClone.getTcNuovaCostruzioneComplessa(), - serviceContext, true); + dettPraticaToClone.getIntervFinPubDesc(), + dettPraticaToClone.getTcNuovaCostruzioneComplessa(), serviceContext, true); copy = updateDettPraticaGeologo(copy.getUserId(), copy.getDettPraticaId(), copy.getIntPraticaId(), dettPraticaToClone.getGeoClasseIndagine(), dettPraticaToClone.getGeoCategoriaSottosuolo(), @@ -554,7 +554,10 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl List soggetti = soggettoLocalService.findByDettPratica(dettPratica.getDettPraticaId()); for (Soggetto soggetto : soggetti) { - soggettoLocalService.deleteSoggetto(soggetto); + try { + soggettoLocalService.deleteSoggetto(soggetto); + } catch (PortalException e) { + } } List allegati = docPraticaLocalService.findByClassPk(dettPratica.getDettPraticaId()); @@ -576,7 +579,10 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl List pagamenti = pagamentoLocalService.findByClassPk(dettPratica.getDettPraticaId()); for (Pagamento pagamento : pagamenti) { - pagamentoLocalService.deletePagamento(pagamento); + try { + pagamentoLocalService.deletePagamento(pagamento); + } catch (PortalException e) { + } } return super.deleteDettPratica(dettPratica); } @@ -716,8 +722,9 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl boolean normDprg01, boolean normDprg02, boolean normAnr, boolean normArt3com3, boolean normArt3com4, boolean normOrd01, boolean normDm04, boolean normDm05, boolean normCI01, boolean normLTC01, boolean suap, boolean normSismaBonus, String clRischioPreInt, - String clRischioPostInt, boolean intervFinPub, String intervFinPubDesc, boolean tcNuovaCostruzioneComplessa, - ServiceContext serviceContext, boolean bozza) throws PortalException, SystemException { + String clRischioPostInt, boolean intervFinPub, String intervFinPubDesc, + boolean tcNuovaCostruzioneComplessa, ServiceContext serviceContext, boolean bozza) + throws PortalException, SystemException { Date now = new Date(); @@ -772,7 +779,8 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl normEsenteSpese, normDpr01Dep, normDpr02Dep, normDpr01Aut, normDpr02Aut, normDm01, normDm02, normDm03, normDm2018, normDprg01, normDprg02, normAnr, normArt3com3, normArt3com4, normOrd01, normDm04, normDm05, normCI01, normLTC01, suap, normSismaBonus, clRischioPreInt, - clRischioPostInt, intervFinPub, intervFinPubDesc, tcNuovaCostruzioneComplessa, serviceContext, bozza); + clRischioPostInt, intervFinPub, intervFinPubDesc, tcNuovaCostruzioneComplessa, + serviceContext, bozza); DettPratica dettPratica = dettPraticaPersistence.fetchByPrimaryKey(dettPraticaId); @@ -1041,8 +1049,8 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl boolean normDprg02, boolean normAnr, boolean normArt3com3, boolean normArt3com4, boolean normOrd01, boolean normDm04, boolean normDm05, boolean normCI01, boolean normLTC01, boolean suap, boolean normSismaBonus, String clRischioPreInt, String clRischioPostInt, - boolean intervFinPub, String intervFinPubDesc, boolean tcNuovaCostruzioneComplessa, ServiceContext serviceContext, boolean bozza) - throws PortalException, SystemException { + boolean intervFinPub, String intervFinPubDesc, boolean tcNuovaCostruzioneComplessa, + ServiceContext serviceContext, boolean bozza) throws PortalException, SystemException { Date now = new Date(); @@ -1076,7 +1084,8 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl normEsenteSpese, normDpr01Dep, normDpr02Dep, normDpr01Aut, normDpr02Aut, normDm01, normDm02, normDm03, normDm2018, normDprg01, normDprg02, normAnr, normArt3com3, normArt3com4, normOrd01, normDm04, normDm05, normCI01, normLTC01, suap, normSismaBonus, clRischioPreInt, - clRischioPostInt, intervFinPub, intervFinPubDesc, tcNuovaCostruzioneComplessa, serviceContext, bozza); + clRischioPostInt, intervFinPub, intervFinPubDesc, tcNuovaCostruzioneComplessa, + serviceContext, bozza); DettPratica dettPratica = dettPraticaPersistence.fetchByPrimaryKey(dettPraticaId); @@ -1281,7 +1290,8 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl boolean normDprg02, boolean normAnr, boolean normArt3com3, boolean normArt3com4, boolean normOrd01, boolean normDm04, boolean normDm05, boolean normCI01, boolean normLTC01, boolean suap, boolean normSismaBonus, String clRischioPreInt, String clRischioPostInt, - boolean intervFinPub, String intervFinPubDesc, boolean tcNuovaCostruzioneComplessa, ServiceContext serviceContext, boolean bozza) { + boolean intervFinPub, String intervFinPubDesc, boolean tcNuovaCostruzioneComplessa, + ServiceContext serviceContext, boolean bozza) { // TODO Auto-generated method stub @@ -1745,8 +1755,8 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl boolean normDprg01, boolean normDprg02, boolean normAnr, boolean normArt3com3, boolean normArt3com4, boolean normOrd01, boolean normDm04, boolean normDm05, boolean normCI01, boolean normLTC01, boolean suap, boolean normSismaBonus, String clRischioPreInt, - String clRischioPostInt, boolean intervFinPub, String intervFinPubDesc, boolean tcNuovaCostruzioneComplessa, - ServiceContext serviceContext, boolean bozza) { + String clRischioPostInt, boolean intervFinPub, String intervFinPubDesc, + boolean tcNuovaCostruzioneComplessa, ServiceContext serviceContext, boolean bozza) { // TODO Auto-generated method stub diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DocPraticaLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DocPraticaLocalServiceImpl.java index 739e1bd4..77ff18d6 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DocPraticaLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DocPraticaLocalServiceImpl.java @@ -24,7 +24,6 @@ import it.tref.liferay.portos.bo.util.PraticaUtil; import java.util.Date; import java.util.List; -import com.liferay.portal.NoSuchRepositoryEntryException; import com.liferay.portal.kernel.dao.orm.DynamicQuery; import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil; import com.liferay.portal.kernel.dao.orm.Junction; @@ -49,7 +48,6 @@ import com.liferay.portal.security.permission.PermissionThreadLocal; import com.liferay.portal.service.RoleLocalServiceUtil; import com.liferay.portal.service.ServiceContext; import com.liferay.portal.service.UserLocalServiceUtil; -import com.liferay.portlet.documentlibrary.NoSuchFileEntryException; import com.liferay.portlet.documentlibrary.NoSuchFolderException; /** @@ -84,10 +82,7 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl { if (Validator.isNotNull(docPratica.getDlFileEntryId())) { dlAppLocalService.deleteFileEntry(docPratica.getDlFileEntryId()); } - } catch (NoSuchFileEntryException | NoSuchRepositoryEntryException e) { - } catch (PortalException e) { - throw new SystemException(e); } return super.deleteDocPratica(docPratica); } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/PagamentoLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/PagamentoLocalServiceImpl.java index 9669c7ba..2cf49c55 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/PagamentoLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/PagamentoLocalServiceImpl.java @@ -375,28 +375,22 @@ public class PagamentoLocalServiceImpl extends PagamentoLocalServiceBaseImpl { @Override public Pagamento deletePagamento(long pagamentoId) throws PortalException, SystemException { - - Pagamento pagamento = super.deletePagamento(pagamentoId); - DLAppLocalServiceUtil.deleteFileEntry(pagamento.getFileEntryId()); - deleteDettPraticaPagamento(pagamento); - return pagamento; + return deletePagamento(pagamentoLocalService.getPagamento(pagamentoId)); } @Override public Pagamento deletePagamento(Pagamento pagamento) throws PortalException, SystemException { - pagamento = super.deletePagamento(pagamento); if (Validator.isNotNull(pagamento.getFileEntryId())) { try { DLAppLocalServiceUtil.deleteFileEntry(pagamento.getFileEntryId()); - } catch (PortalException | SystemException e) { - _log.info("L'allegato del pagamento " + pagamento.getPagamentoId() + " non esisteva."); + } catch (PortalException e) { } } if (DettPratica.class.getName().equalsIgnoreCase(pagamento.getClassName())) { deleteDettPraticaPagamento(pagamento); } - return pagamento; + return super.deletePagamento(pagamento); } public Pagamento updateEmailPendingPagamento(long pagamentoId, boolean emailPending) diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/SoggettoLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/SoggettoLocalServiceImpl.java index b0d64d8e..48028f4d 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/SoggettoLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/SoggettoLocalServiceImpl.java @@ -12,7 +12,6 @@ package it.tref.liferay.portos.bo.service.impl; -import it.tref.liferay.portos.bo.NoSuchDocPraticaException; import it.tref.liferay.portos.bo.model.DettPratica; import it.tref.liferay.portos.bo.model.DocPratica; import it.tref.liferay.portos.bo.model.Soggetto; @@ -24,7 +23,6 @@ import it.tref.liferay.portos.bo.util.WorkflowConstants; import java.util.Date; import java.util.List; -import com.liferay.portal.NoSuchRepositoryEntryException; import com.liferay.portal.kernel.dao.orm.Disjunction; import com.liferay.portal.kernel.dao.orm.DynamicQuery; import com.liferay.portal.kernel.dao.orm.OrderFactoryUtil; @@ -39,7 +37,6 @@ import com.liferay.portal.kernel.util.StringPool; import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.model.User; import com.liferay.portal.service.ServiceContext; -import com.liferay.portlet.documentlibrary.NoSuchFileEntryException; /** * The implementation of the soggetto local service. @@ -419,8 +416,7 @@ public class SoggettoLocalServiceImpl extends SoggettoLocalServiceBaseImpl { if (Validator.isNotNull(soggetto.getFileVariazioneId())) { docPraticaLocalService.deleteDocPratica(soggetto.getFileVariazioneId()); } - } catch (NoSuchFileEntryException | NoSuchRepositoryEntryException | NoSuchDocPraticaException e) { - + } catch (PortalException e) { } return super.deleteSoggetto(soggetto); } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties index 5eed29c1..1d29b3cc 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties @@ -13,8 +13,8 @@ ## build.namespace=portos_bo - build.number=2518 - build.date=1604412381894 + build.number=2519 + build.date=1604417083352 build.auto.upgrade=true ## diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestionefirme/avvisi_da_firmare.jsp b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestionefirme/avvisi_da_firmare.jsp index da6e7057..0cde9c39 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestionefirme/avvisi_da_firmare.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestionefirme/avvisi_da_firmare.jsp @@ -1,6 +1,3 @@ -<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> - - <%@page import="com.liferay.portal.service.GroupLocalServiceUtil"%> <%@page import="com.liferay.portal.util.comparator.GroupIdComparator"%> <%@page import="com.liferay.portal.kernel.util.ArrayUtil"%> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/sismica_administration/view.jsp b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/sismica_administration/view.jsp index c3b83248..342a8313 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/sismica_administration/view.jsp +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/sismica_administration/view.jsp @@ -100,10 +100,11 @@ String dataProssimoSorteggio =
-
Test Interno
+
Manutenzione database
- + +
@@ -134,7 +135,7 @@ String dataProssimoSorteggio =
<% String tipoAvviso = ParamUtil.getString(renderRequest, "tipoAvviso", ""); - String numeroProgetto = ParamUtil.getString(renderRequest, "numeroProgetto", ""); + String numeroProgetto = ParamUtil.getString(renderRequest, "numeroProgetto", ""); %>
Invia avviso
@@ -184,7 +185,7 @@ String dataProssimoSorteggio = value="<%=Soggetto.class.getName()%>"> - "> + "> diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/ivy.xml b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/ivy.xml index a1178fa6..d60f0a25 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/ivy.xml +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/ivy.xml @@ -11,9 +11,9 @@ - - - + + + diff --git a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/ivy.xml.MD5 b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/ivy.xml.MD5 index dfda30f8..3c5dfa07 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/ivy.xml.MD5 +++ b/liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/ivy.xml.MD5 @@ -1 +1 @@ -291fbe4be1f094ebfa7c95b6381ba6af +29bdb5e74c39965a8db63e99d25a27ab diff --git a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/.settings/org.eclipse.wst.common.component b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/.settings/org.eclipse.wst.common.component index e1d846ac..26b0e067 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/.settings/org.eclipse.wst.common.component +++ b/liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/.settings/org.eclipse.wst.common.component @@ -2,10 +2,10 @@ - + uses - + uses diff --git a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/.classpath b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/.classpath index 9975372f..fcf44f2b 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/.classpath +++ b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/.classpath @@ -18,5 +18,6 @@ + diff --git a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/.project b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/.project index 6e24c69e..65a765ba 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/.project +++ b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/.project @@ -32,5 +32,6 @@ org.eclipse.wst.common.project.facet.core.nature org.eclipse.jdt.core.javanature org.eclipse.wst.jsdt.core.jsNature + org.apache.ivyde.eclipse.ivynature diff --git a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/commons-codec.jar b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/commons-codec.jar new file mode 100644 index 00000000..ef35f1c5 Binary files /dev/null and b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/commons-codec.jar differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/httpclient-4.5.3.jar b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/httpclient.jar similarity index 100% rename from liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/httpclient-4.5.3.jar rename to liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/httpclient.jar diff --git a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/httpcore-4.4.6.jar b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/httpcore.jar similarity index 100% rename from liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/httpcore-4.4.6.jar rename to liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/httpcore.jar diff --git a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/httpmime-4.5.3.jar b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/httpmime.jar similarity index 100% rename from liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/httpmime-4.5.3.jar rename to liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/httpmime.jar diff --git a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/jackson-annotations-2.8.7.jar b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/jackson-annotations.jar similarity index 74% rename from liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/jackson-annotations-2.8.7.jar rename to liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/jackson-annotations.jar index be2008f5..d19b67b0 100644 Binary files a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/jackson-annotations-2.8.7.jar and b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/jackson-annotations.jar differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/jackson-core-2.8.7.jar b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/jackson-core.jar similarity index 100% rename from liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/jackson-core-2.8.7.jar rename to liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/jackson-core.jar diff --git a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/jackson-databind-2.8.7.jar b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/jackson-databind.jar similarity index 100% rename from liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/jackson-databind-2.8.7.jar rename to liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/jackson-databind.jar diff --git a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/ivy.xml b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/ivy.xml index 12a2dd41..c90498c1 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/ivy.xml +++ b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/ivy.xml @@ -14,5 +14,9 @@ + + + + \ No newline at end of file diff --git a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/ivy.xml.MD5 b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/ivy.xml.MD5 index 5492befa..ddcc2b49 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/ivy.xml.MD5 +++ b/liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/ivy.xml.MD5 @@ -1 +1 @@ -5ce14a43480763a02a7a0f47d7f82801 +a15636541520cd34beccb182ca342eb1 diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/.classpath b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/.classpath index 130677e9..502539e1 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/.classpath +++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/.classpath @@ -1,6 +1,7 @@ + diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/.settings/org.eclipse.wst.common.component b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/.settings/org.eclipse.wst.common.component index 04dff753..d3bd6d76 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/.settings/org.eclipse.wst.common.component +++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/.settings/org.eclipse.wst.common.component @@ -2,6 +2,7 @@ + diff --git a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/service/impl/EmailAttachmentLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/service/impl/EmailAttachmentLocalServiceImpl.java index b8680503..d5adec65 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/service/impl/EmailAttachmentLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/service/impl/EmailAttachmentLocalServiceImpl.java @@ -105,16 +105,11 @@ public class EmailAttachmentLocalServiceImpl extends EmailAttachmentLocalService @Override public EmailAttachment deleteEmailAttachment(EmailAttachment emailAttachment) throws SystemException { - - super.deleteEmailAttachment(emailAttachment); - - // File Entry - try { dlAppLocalService.deleteFileEntry(emailAttachment.getFileEntryId()); } catch (PortalException e) { } - + super.deleteEmailAttachment(emailAttachment); return emailAttachment; } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/.classpath b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/.classpath index 9975372f..af45f53a 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/.classpath +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/.classpath @@ -18,5 +18,6 @@ + diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/.project b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/.project index d40dfb40..79065197 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/.project +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/.project @@ -32,5 +32,6 @@ org.eclipse.wst.common.project.facet.core.nature org.eclipse.jdt.core.javanature org.eclipse.wst.jsdt.core.jsNature + org.apache.ivyde.eclipse.ivynature diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/commons-logging.jar b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/commons-logging.jar deleted file mode 100644 index 8758a96b..00000000 Binary files a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/commons-logging.jar and /dev/null differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/jstl-api.jar b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/jstl-api.jar deleted file mode 100644 index 80a5737f..00000000 Binary files a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/jstl-api.jar and /dev/null differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/jstl-impl.jar b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/jstl-impl.jar deleted file mode 100644 index e5a9342f..00000000 Binary files a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/jstl-impl.jar and /dev/null differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/log4j.jar b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/log4j.jar deleted file mode 100644 index 068867eb..00000000 Binary files a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/log4j.jar and /dev/null differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/util-bridges.jar b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/util-bridges.jar deleted file mode 100644 index 7d7435fe..00000000 Binary files a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/util-bridges.jar and /dev/null differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/util-taglib.jar b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/util-taglib.jar deleted file mode 100644 index fbba5f0a..00000000 Binary files a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/util-taglib.jar and /dev/null differ diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/content/Language.properties b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/content/Language.properties index 1356264e..bb37af71 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/content/Language.properties +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/content/Language.properties @@ -9,7 +9,7 @@ javax.portlet.title.1_WAR_portosmaintenanceportlet = Manutenzione ## Label -url-help = Indirizzo da invocare per la dismissione della modalità di manutenzione +url-help = Indirizzo da invocare per la dismissione della modalità  di manutenzione message-help = Messaggio da visualizzare nella finestra di manutenzione maintenance-schedule-id=Id diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/action/MaintenancePreServletControl.java b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/action/MaintenancePreServletControl.java index 7644804c..f4f93fec 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/action/MaintenancePreServletControl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/action/MaintenancePreServletControl.java @@ -27,71 +27,77 @@ import javax.servlet.http.HttpServletResponse; public class MaintenancePreServletControl extends Action { - private static final Log _log = LogFactoryUtil.getLog(MaintenancePreServletControl.class); + private static final Log _log = LogFactoryUtil.getLog(MaintenancePreServletControl.class); - private static final String[] allowedPortlets = new String[] {PortletKeys.LOGIN}; + private static final String[] allowedPortlets = new String[] { PortletKeys.LOGIN }; - private static String loginUrlRedirect = null; + private static String loginUrlRedirect = null; - @Override - public void run(HttpServletRequest request, HttpServletResponse response) throws ActionException { + @Override + public void run(HttpServletRequest request, HttpServletResponse response) throws ActionException { - // _log.info("INZIO MaintenancePreServletControl --------------->"); + // _log.info("INZIO MaintenancePreServletControl --------------->"); - try { + try { - ServiceContext serviceContext = ServiceContextFactory.getInstance(request); + ServiceContext serviceContext = ServiceContextFactory.getInstance(request); - List maintenanceSchedules = - MaintenanceScheduleLocalServiceUtil.findByStatus(MaintenanceStatus.IN_PROGRESS.getCode()); + List maintenanceSchedules = MaintenanceScheduleLocalServiceUtil + .findByStatus(MaintenanceStatus.IN_PROGRESS.getCode()); - if (!maintenanceSchedules.isEmpty()) { + if (!maintenanceSchedules.isEmpty()) { - MaintenanceType maintenanceType = MaintenanceType.parse(maintenanceSchedules.get(0).getType()); + MaintenanceType maintenanceType = MaintenanceType + .parse(maintenanceSchedules.get(0).getType()); - if (maintenanceType == MaintenanceType.FULL) { + if (maintenanceType == MaintenanceType.FULL) { - response.sendRedirect("/html/portal/maintenance.jsp"); - throw new ActionException("Maintenance mode active"); + response.sendRedirect("/html/portal/maintenance.jsp"); + throw new ActionException("Maintenance mode active"); - } else if (maintenanceType == MaintenanceType.USER) { + } else if (maintenanceType == MaintenanceType.USER) { - User user = UserLocalServiceUtil.fetchUser(serviceContext.getUserId()); + User user = UserLocalServiceUtil.fetchUser(serviceContext.getUserId()); - // Se request per portlet non consentite (LOGIN) - if (!ArrayUtil.contains(allowedPortlets, ParamUtil.getString(request, "p_p_id"))) { - if (user.isDefaultUser()) {// Se non loggato - response.sendRedirect(getLoginUrlRedirect(request)); - throw new ActionException("Maintenance mode active"); - } else if (!PortalUtil.isCompanyAdmin(user)) {// Se non admin - response.sendRedirect("/html/portal/maintenance.jsp"); - throw new ActionException("Maintenance mode active"); - } - } else { - if (!user.isDefaultUser() && !PortalUtil.isCompanyAdmin(user)) {// Se loggato non admin - response.sendRedirect("/html/portal/maintenance.jsp"); - throw new ActionException("Maintenance mode active"); - } - } - } + // Se request per portlet non consentite (LOGIN) + if (!ArrayUtil.contains(allowedPortlets, ParamUtil.getString(request, "p_p_id"))) { + if (user.isDefaultUser()) {// Se non loggato + response.sendRedirect(getLoginUrlRedirect(request)); + throw new ActionException("Maintenance mode active"); + } else if (!PortalUtil.isCompanyAdmin(user)) {// Se non + // admin + response.sendRedirect("/html/portal/maintenance.jsp"); + throw new ActionException("Maintenance mode active"); + } + } else { + if (!user.isDefaultUser() && !PortalUtil.isCompanyAdmin(user)) {// Se + // loggato + // non + // admin + response.sendRedirect("/html/portal/maintenance.jsp"); + throw new ActionException("Maintenance mode active"); + } + } + } - } + } - } catch (Exception e) { - _log.error(e); - } + } catch (Exception e) { + _log.error(e); + } - } + } - private String getLoginUrlRedirect(HttpServletRequest request) { + private String getLoginUrlRedirect(HttpServletRequest request) { - if (loginUrlRedirect == null) { - loginUrlRedirect = PortalUtil.getPortalURL(request); - loginUrlRedirect = HttpUtil.addParameter(loginUrlRedirect, "p_p_id", PortletKeys.LOGIN); - loginUrlRedirect = HttpUtil.addParameter(loginUrlRedirect, "p_p_state", WindowState.MAXIMIZED.toString()); - loginUrlRedirect = HttpUtil.addParameter(loginUrlRedirect, "p_p_lifecycle", "0"); - } + if (loginUrlRedirect == null) { + loginUrlRedirect = PortalUtil.getPortalURL(request); + loginUrlRedirect = HttpUtil.addParameter(loginUrlRedirect, "p_p_id", PortletKeys.LOGIN); + loginUrlRedirect = HttpUtil.addParameter(loginUrlRedirect, "p_p_state", + WindowState.MAXIMIZED.toString()); + loginUrlRedirect = HttpUtil.addParameter(loginUrlRedirect, "p_p_lifecycle", "0"); + } - return loginUrlRedirect; - } + return loginUrlRedirect; + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/action/MaintenanceStartAction.java b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/action/MaintenanceStartAction.java index 62aebb4e..b8b7d0ec 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/action/MaintenanceStartAction.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/action/MaintenanceStartAction.java @@ -14,25 +14,25 @@ import java.util.List; public class MaintenanceStartAction extends SimpleAction { - private static final Log _log = LogFactoryUtil.getLog(MaintenanceStartAction.class); + private static final Log _log = LogFactoryUtil.getLog(MaintenanceStartAction.class); - @Override - public void run(String[] ids) throws ActionException { + @Override + public void run(String[] ids) throws ActionException { - try { + try { - List maintenanceSchedules = - MaintenanceScheduleLocalServiceUtil.findByCompleted_Onreboot(Boolean.FALSE, - MaintenanceOnReboot.TERMINATE.getCode()); + List maintenanceSchedules = MaintenanceScheduleLocalServiceUtil + .findByCompleted_Onreboot(Boolean.FALSE, MaintenanceOnReboot.TERMINATE.getCode()); - for (MaintenanceSchedule maintenanceSchedule : maintenanceSchedules) { - MaintenanceScheduleLocalServiceUtil.updateStatus(maintenanceSchedule.getMaintenanceScheduleId(), - MaintenanceStatus.FORCE_ENDED.getCode(), "Ended for server reboot."); - } + for (MaintenanceSchedule maintenanceSchedule : maintenanceSchedules) { + MaintenanceScheduleLocalServiceUtil.updateStatus( + maintenanceSchedule.getMaintenanceScheduleId(), + MaintenanceStatus.FORCE_ENDED.getCode(), "Ended for server reboot."); + } - } catch (Exception e) { - _log.error("Error updating maintenance settings after reboot.", e); - } + } catch (Exception e) { + _log.error("Error updating maintenance settings after reboot.", e); + } - } + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/control/MantenanceControlPanelEntry.java b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/control/MantenanceControlPanelEntry.java index 2ebb0ed0..ec11e98d 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/control/MantenanceControlPanelEntry.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/control/MantenanceControlPanelEntry.java @@ -8,17 +8,17 @@ import com.liferay.portlet.BaseControlPanelEntry; public class MantenanceControlPanelEntry extends BaseControlPanelEntry { - public boolean hasAccessPermission(PermissionChecker permissionChecker, Group group, Portlet portlet) - throws Exception { + public boolean hasAccessPermission(PermissionChecker permissionChecker, Group group, Portlet portlet) + throws Exception { - long companyId = PortalUtil.getDefaultCompanyId(); + long companyId = PortalUtil.getDefaultCompanyId(); - if (companyId == permissionChecker.getCompanyId()) { - return true; - } + if (companyId == permissionChecker.getCompanyId()) { + return true; + } - return false; + return false; - } + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/messaging/MaintenanceScheduleMessageListener.java b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/messaging/MaintenanceScheduleMessageListener.java index e188e589..117bb159 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/messaging/MaintenanceScheduleMessageListener.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/messaging/MaintenanceScheduleMessageListener.java @@ -24,86 +24,89 @@ import java.util.Date; public class MaintenanceScheduleMessageListener implements MessageListener { - private static final Log _log = LogFactoryUtil.getLog(MaintenanceScheduleMessageListener.class); + private static final Log _log = LogFactoryUtil.getLog(MaintenanceScheduleMessageListener.class); - @Override - public void receive(Message message) throws MessageListenerException { + @Override + public void receive(Message message) throws MessageListenerException { - if (_log.isDebugEnabled()) { - _log.debug("Inizio metodo receive. Begin: " + new SimpleDateFormat("hh:mm:ss").format(new Date())); - } + if (_log.isDebugEnabled()) { + _log.debug("Inizio metodo receive. Begin: " + new SimpleDateFormat("hh:mm:ss").format(new Date())); + } - try { + try { + ActionableDynamicQuery actionableDynamicQuery = new MaintenanceScheduleActionableDynamicQuery() { - ActionableDynamicQuery actionableDynamicQuery = new MaintenanceScheduleActionableDynamicQuery() { + @Override + protected void addCriteria(DynamicQuery dynamicQuery) { + dynamicQuery.add(PropertyFactoryUtil.forName("completed").eq(false)); + } - @Override - protected void addCriteria(DynamicQuery dynamicQuery) { - dynamicQuery.add(PropertyFactoryUtil.forName("completed").eq(false)); - } + @Override + protected void performAction(Object obj) throws PortalException, SystemException { - @Override - protected void performAction(Object obj) throws PortalException, SystemException { + MaintenanceSchedule maintenanceSchedule = (MaintenanceSchedule) obj; + try { - MaintenanceSchedule maintenanceSchedule = (MaintenanceSchedule) obj; - try { + MaintenanceStatus status = MaintenanceStatus.parse(maintenanceSchedule.getStatus()); - MaintenanceStatus status = MaintenanceStatus.parse(maintenanceSchedule.getStatus()); + if (status == MaintenanceStatus.NEW) { - if (status == MaintenanceStatus.NEW) { + if (!MaintenanceScheduleLocalServiceUtil.findByStatus( + MaintenanceStatus.IN_PROGRESS.getCode()).isEmpty()) { + throw new SystemException("Concurrent maintenance scheduled."); + } - if (!MaintenanceScheduleLocalServiceUtil.findByStatus(MaintenanceStatus.IN_PROGRESS.getCode()).isEmpty()) { - throw new SystemException("Concurrent maintenance scheduled."); - } + if (Validator.isNotNull(maintenanceSchedule.getAfter()) + && maintenanceSchedule.getAfter() > 0l) { - if (Validator.isNotNull(maintenanceSchedule.getAfter()) && maintenanceSchedule.getAfter() > 0l) { + Date maintenanceStartDate = MaintenanceDateUtil + .getStartDate(maintenanceSchedule); - Date maintenanceStartDate = MaintenanceDateUtil.getStartDate(maintenanceSchedule); + if (DateUtil.newDate().after(maintenanceStartDate)) { + MaintenanceScheduleLocalServiceUtil.updateStatus( + maintenanceSchedule.getMaintenanceScheduleId(), + MaintenanceStatus.IN_PROGRESS.getCode()); + } - if (DateUtil.newDate().after(maintenanceStartDate)) { - MaintenanceScheduleLocalServiceUtil.updateStatus(maintenanceSchedule.getMaintenanceScheduleId(), - MaintenanceStatus.IN_PROGRESS.getCode()); - } + } else { - } else { + MaintenanceScheduleLocalServiceUtil.updateStatus( + maintenanceSchedule.getMaintenanceScheduleId(), + MaintenanceStatus.IN_PROGRESS.getCode()); + } - MaintenanceScheduleLocalServiceUtil.updateStatus(maintenanceSchedule.getMaintenanceScheduleId(), - MaintenanceStatus.IN_PROGRESS.getCode()); - } + } else if (status == MaintenanceStatus.IN_PROGRESS) { - } else if (status == MaintenanceStatus.IN_PROGRESS) { + if (Validator.isNotNull(maintenanceSchedule.getEnd()) + && DateUtil.newDate().after(maintenanceSchedule.getEnd())) { + MaintenanceScheduleLocalServiceUtil.updateStatus( + maintenanceSchedule.getMaintenanceScheduleId(), + MaintenanceStatus.ENDED.getCode()); + } - if (Validator.isNotNull(maintenanceSchedule.getEnd()) - && DateUtil.newDate().after(maintenanceSchedule.getEnd())) { + } - MaintenanceScheduleLocalServiceUtil.updateStatus(maintenanceSchedule.getMaintenanceScheduleId(), - MaintenanceStatus.ENDED.getCode()); - } + } catch (Exception e) { + _log.error("MaintenaceMode error", e); - } + MaintenanceScheduleLocalServiceUtil.updateStatus( + maintenanceSchedule.getMaintenanceScheduleId(), + MaintenanceStatus.ERROR.getCode(), e.getMessage()); + } + } + }; + long count = actionableDynamicQuery.performCount(); - } catch (Exception e) { - _log.error("MaintenaceMode error", e); - - MaintenanceScheduleLocalServiceUtil.updateStatus(maintenanceSchedule.getMaintenanceScheduleId(), - MaintenanceStatus.ERROR.getCode(), e.getMessage()); - } - } - }; - - long count = actionableDynamicQuery.performCount(); - - if (count > 0) { - actionableDynamicQuery.performActions(); - } - - } catch (Exception e) { - _log.error(e, e); - } - } + if (count > 0) { + actionableDynamicQuery.performActions(); + } + } catch (Exception e) { + _log.error(e, e); + } + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/portlet/AdminMaintenancePortlet.java b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/portlet/AdminMaintenancePortlet.java index 18d61763..62b296f8 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/portlet/AdminMaintenancePortlet.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/portlet/AdminMaintenancePortlet.java @@ -31,91 +31,92 @@ import javax.portlet.PortletSession; */ public class AdminMaintenancePortlet extends MVCPortlet { - private final static Log _log = LogFactoryUtil.getLog(AdminMaintenancePortlet.class); + private final static Log _log = LogFactoryUtil.getLog(AdminMaintenancePortlet.class); - public void maintain(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { + public void maintain(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { - PortletSession portletSession = actionRequest.getPortletSession(); + PortletSession portletSession = actionRequest.getPortletSession(); - String message = ParamUtil.getString(actionRequest, "message"); + String message = ParamUtil.getString(actionRequest, "message"); - String className = - LanguageUtil - .get(LocaleUtil.getDefault(), - "the-sign-in-process-is-temporarily-disabled-because-the-portal-is-undergoing-a-routine-maintenance-upgrade"); + String className = LanguageUtil + .get(LocaleUtil.getDefault(), + "the-sign-in-process-is-temporarily-disabled-because-the-portal-is-undergoing-a-routine-maintenance-upgrade"); - if (Validator.isNotNull(message)) { - className = message; - } + if (Validator.isNotNull(message)) { + className = message; + } - Class clazz = - ClassResolverUtil.resolve("com.liferay.portal.util.MaintenanceUtil", PortalClassLoaderUtil.getClassLoader()); - ReflectionUtil.getDeclaredMethod(clazz, "maintain", String.class, String.class).invoke(null, - portletSession.getId(), className); + Class clazz = ClassResolverUtil.resolve("com.liferay.portal.util.MaintenanceUtil", + PortalClassLoaderUtil.getClassLoader()); + ReflectionUtil.getDeclaredMethod(clazz, "maintain", String.class, String.class).invoke(null, + portletSession.getId(), className); - _log.info("Maintenance session id: " + portletSession.getId()); + _log.info("Maintenance session id: " + portletSession.getId()); + } - } + public void deleteMaintenanceSchedule(ActionRequest actionRequest, ActionResponse actionResponse) + throws Exception { + _log.info("deleteMaintenanceSchedule - Inizio metodo"); - public void deleteMaintenanceSchedule(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { - _log.info("deleteMaintenanceSchedule - Inizio metodo"); + ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest); + long maintenanceScheduleId = ParamUtil.getLong(actionRequest, "maintenanceScheduleId"); - ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest); - long maintenanceScheduleId = ParamUtil.getLong(actionRequest, "maintenanceScheduleId"); + MaintenanceScheduleServiceUtil.deleteMaintenanceSchedule(maintenanceScheduleId, serviceContext); - MaintenanceScheduleServiceUtil.deleteMaintenanceSchedule(maintenanceScheduleId, serviceContext); + } - } + public void editMaintenanceSchedule(ActionRequest actionRequest, ActionResponse actionResponse) + throws Exception { + _log.info("editMaintenanceSchedule - Inizio metodo"); - public void editMaintenanceSchedule(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception { - _log.info("editMaintenanceSchedule - Inizio metodo"); + String cmd = ParamUtil.getString(actionRequest, Constants.CMD); - String cmd = ParamUtil.getString(actionRequest, Constants.CMD); + ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest); - ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest); + long maintenanceScheduleId = ParamUtil.getLong(actionRequest, "maintenanceScheduleId"); + String type = ParamUtil.getString(actionRequest, "type"); + String reason = ParamUtil.getString(actionRequest, "reason"); + String portalMessage = ParamUtil.getString(actionRequest, "portalMessage"); + long after = ParamUtil.getLong(actionRequest, "after"); + String onreboot = ParamUtil.getString(actionRequest, "onreboot"); + String status = ParamUtil.getString(actionRequest, "status"); + String statusMessage = ParamUtil.getString(actionRequest, "statusMessage"); - long maintenanceScheduleId = ParamUtil.getLong(actionRequest, "maintenanceScheduleId"); - String type = ParamUtil.getString(actionRequest, "type"); - String reason = ParamUtil.getString(actionRequest, "reason"); - String portalMessage = ParamUtil.getString(actionRequest, "portalMessage"); - long after = ParamUtil.getLong(actionRequest, "after"); - String onreboot = ParamUtil.getString(actionRequest, "onreboot"); - String status = ParamUtil.getString(actionRequest, "status"); - String statusMessage = ParamUtil.getString(actionRequest, "statusMessage"); + Calendar calendarEnd = Calendar.getInstance(); + calendarEnd.set(ParamUtil.getInteger(actionRequest, "endYear"), + ParamUtil.getInteger(actionRequest, "endMonth") + 1, + ParamUtil.getInteger(actionRequest, "endDay"), + ParamUtil.getInteger(actionRequest, "endHour"), + ParamUtil.getInteger(actionRequest, "endMinute")); - Calendar calendarEnd = Calendar.getInstance(); - calendarEnd.set(ParamUtil.getInteger(actionRequest, "endYear"), - ParamUtil.getInteger(actionRequest, "endMonth") + 1, ParamUtil.getInteger(actionRequest, "endDay"), - ParamUtil.getInteger(actionRequest, "endHour"), ParamUtil.getInteger(actionRequest, "endMinute")); + MaintenanceSchedule maintenanceSchedule = null; - MaintenanceSchedule maintenanceSchedule = null; + try { - try { + if (cmd.equals(Constants.ADD)) { + maintenanceSchedule = MaintenanceScheduleServiceUtil.addMaintenanceSchedule(type, reason, + portalMessage, after, calendarEnd.getTime(), onreboot, serviceContext); + } else if (cmd.equals(Constants.UPDATE)) { + maintenanceSchedule = MaintenanceScheduleServiceUtil.updateMaintenanceSchedule( + maintenanceScheduleId, type, reason, portalMessage, after, calendarEnd.getTime(), + onreboot, status, statusMessage, serviceContext); + } - if (cmd.equals(Constants.ADD)) { - maintenanceSchedule = - MaintenanceScheduleServiceUtil.addMaintenanceSchedule(type, reason, portalMessage, after, - calendarEnd.getTime(), onreboot, serviceContext); - } else if (cmd.equals(Constants.UPDATE)) { - maintenanceSchedule = - MaintenanceScheduleServiceUtil.updateMaintenanceSchedule(maintenanceScheduleId, type, reason, - portalMessage, after, calendarEnd.getTime(), onreboot, status, statusMessage, serviceContext); - } + } catch (PortalException e) { + _log.error(e); + SessionErrors.add(actionRequest, e.getClass()); + } - } catch (PortalException e) { - _log.error(e); - SessionErrors.add(actionRequest, e.getClass()); - } + if (SessionErrors.isEmpty(actionRequest)) { + actionResponse.setRenderParameter("maintenanceScheduleId", + String.valueOf(maintenanceSchedule.getMaintenanceScheduleId())); + actionResponse.setRenderParameter("mvcPath", "/html/admin_maintenance/edit.jsp"); + } else { + actionResponse.setRenderParameter("mvcPath", "/html/admin_maintenance/edit.jsp"); + PortalUtil.copyRequestParameters(actionRequest, actionResponse); + } - if (SessionErrors.isEmpty(actionRequest)) { - actionResponse.setRenderParameter("maintenanceScheduleId", - String.valueOf(maintenanceSchedule.getMaintenanceScheduleId())); - actionResponse.setRenderParameter("mvcPath", "/html/admin_maintenance/edit.jsp"); - } else { - actionResponse.setRenderParameter("mvcPath", "/html/admin_maintenance/edit.jsp"); - PortalUtil.copyRequestParameters(actionRequest, actionResponse); - } - - } + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/portlet/MaintenancePollerPortlet.java b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/portlet/MaintenancePollerPortlet.java index de74995a..b0d4c3f3 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/portlet/MaintenancePollerPortlet.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/portlet/MaintenancePollerPortlet.java @@ -27,51 +27,50 @@ import javax.portlet.ResourceResponse; */ public class MaintenancePollerPortlet extends MVCPortlet { + private static final long ONE_HOUR = 3600000;// ms - private static final long ONE_HOUR = 3600000;// ms + @Override + public void serveResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse) + throws IOException, PortletException { - @Override - public void serveResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse) throws IOException, - PortletException { + String resourceID = GetterUtil.getString(resourceRequest.getResourceID()); - String resourceID = GetterUtil.getString(resourceRequest.getResourceID()); + if ("maintenancePoller".equals(resourceID)) { - if ("maintenancePoller".equals(resourceID)) { + try { - try { + JSONObject responseData = JSONFactoryUtil.createJSONObject(); + responseData.put("maintenanceExpected", false); - JSONObject responseData = JSONFactoryUtil.createJSONObject(); - responseData.put("maintenanceExpected", false); + List maintenanceSchedules = MaintenanceScheduleLocalServiceUtil + .findByStatus(MaintenanceStatus.NEW.getCode()); + for (MaintenanceSchedule maintenanceSchedule : maintenanceSchedules) { - List maintenanceSchedules = - MaintenanceScheduleLocalServiceUtil.findByStatus(MaintenanceStatus.NEW.getCode()); + Date maintenanceStartDate = DateTimeUtil.scaleToNextMinute(MaintenanceDateUtil + .getStartDate(maintenanceSchedule)); - for (MaintenanceSchedule maintenanceSchedule : maintenanceSchedules) { + long timeDiff = maintenanceStartDate.getTime() - DateUtil.newDate().getTime(); - Date maintenanceStartDate = - DateTimeUtil.scaleToNextMinute(MaintenanceDateUtil.getStartDate(maintenanceSchedule)); + if (timeDiff < ONE_HOUR) { + responseData.put("maintenanceExpected", true); + responseData.put("startFrom", timeDiff); + responseData.put("maintenanceScheduleId", + maintenanceSchedule.getMaintenanceScheduleId()); + break; + } + } - long timeDiff = maintenanceStartDate.getTime() - DateUtil.newDate().getTime(); + PrintWriter out = resourceResponse.getWriter(); + out.println(responseData.toString()); + out.flush(); - if (timeDiff < ONE_HOUR) { - responseData.put("maintenanceExpected", true); - responseData.put("startFrom", timeDiff); - responseData.put("maintenanceScheduleId", maintenanceSchedule.getMaintenanceScheduleId()); - break; - } - } + } catch (SystemException e) { + e.printStackTrace(); + } - PrintWriter out = resourceResponse.getWriter(); - out.println(responseData.toString()); - out.flush(); + } - } catch (SystemException e) { - e.printStackTrace(); - } - - } - - super.serveResource(resourceRequest, resourceResponse); - } + super.serveResource(resourceRequest, resourceResponse); + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/service/impl/MaintenanceScheduleLocalServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/service/impl/MaintenanceScheduleLocalServiceImpl.java index 25b32f70..69777e24 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/service/impl/MaintenanceScheduleLocalServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/service/impl/MaintenanceScheduleLocalServiceImpl.java @@ -41,13 +41,15 @@ import java.util.List; * The implementation of the maintenance schedule local service. * *

- * All custom service methods should be put in this class. Whenever methods are added, rerun - * ServiceBuilder to copy their definitions into the - * {@link it.tref.liferay.portos.maintenance.service.MaintenanceScheduleLocalService} interface. + * All custom service methods should be put in this class. Whenever methods are + * added, rerun ServiceBuilder to copy their definitions into the + * {@link it.tref.liferay.portos.maintenance.service.MaintenanceScheduleLocalService} + * interface. * *

- * This is a local service. Methods of this service will not have security checks based on the - * propagated JAAS credentials because this service can only be accessed from within the same VM. + * This is a local service. Methods of this service will not have security + * checks based on the propagated JAAS credentials because this service can only + * be accessed from within the same VM. *

* * @author @@ -55,166 +57,172 @@ import java.util.List; * @see it.tref.liferay.portos.maintenance.service.MaintenanceScheduleLocalServiceUtil */ public class MaintenanceScheduleLocalServiceImpl extends MaintenanceScheduleLocalServiceBaseImpl { - /* - * NOTE FOR DEVELOPERS: - * - * Never reference this interface directly. Always use {@link - * it.tref.liferay.portos.maintenance.service.MaintenanceScheduleLocalServiceUtil} to access the - * maintenance schedule local service. - */ - - @Override - public MaintenanceSchedule addMaintenanceSchedule(String type, String reason, String portalMessage, long after, - Date end, String onreboot, ServiceContext serviceContext) throws SystemException, PortalException { - - MaintenanceSchedule maintenanceSchedule = - MaintenanceScheduleUtil.create(counterLocalService.increment(MaintenanceSchedule.class.getName())); - - validate(type, reason, after, end, onreboot); - - maintenanceSchedule.setCompanyId(serviceContext.getCompanyId()); - maintenanceSchedule.setUserId(serviceContext.getUserId()); - User user = userLocalService.fetchUser(serviceContext.getUserId()); - maintenanceSchedule.setUserName(Validator.isNotNull(user) ? user.getScreenName() : StringPool.BLANK); - maintenanceSchedule.setCreateDate(DateUtil.newDate()); - maintenanceSchedule.setModifiedDate(DateUtil.newDate()); - - maintenanceSchedule.setType(type); - maintenanceSchedule.setReason(reason); - maintenanceSchedule.setPortalMessage(portalMessage != null ? portalMessage : StringPool.BLANK); - maintenanceSchedule.setAfter(after); - maintenanceSchedule.setEnd(end != null ? DateTimeUtil.scaleToNextMinute(end) : null); - maintenanceSchedule.setOnreboot(onreboot); - - maintenanceSchedule.setStatus(MaintenanceStatus.NEW.getCode()); - maintenanceSchedule.setCompleted(Boolean.FALSE); - - return addMaintenanceSchedule(maintenanceSchedule); - } - - @Override - public MaintenanceSchedule updateMaintenanceSchedule(long maintenanceScheduleId, String type, String reason, - String portalMessage, long after, Date end, String onreboot, String status, String statusMessage, - ServiceContext serviceContext) throws SystemException, PortalException { - - MaintenanceSchedule maintenanceSchedule = getMaintenanceSchedule(maintenanceScheduleId); - - validate(type, reason, after, end, onreboot); - - if (Validator.isNotNull(status)) { - maintenanceSchedule = updateStatus(maintenanceSchedule.getMaintenanceScheduleId(), status, statusMessage); - } - - maintenanceSchedule.setModifiedDate(DateUtil.newDate()); - - maintenanceSchedule.setType(type); - maintenanceSchedule.setReason(reason); - maintenanceSchedule.setPortalMessage(portalMessage != null ? portalMessage : StringPool.BLANK); - maintenanceSchedule.setAfter(after); - maintenanceSchedule.setEnd(end != null ? DateTimeUtil.scaleToNextMinute(end) : null); - maintenanceSchedule.setOnreboot(onreboot); - - return updateMaintenanceSchedule(maintenanceSchedule); - } - - - @Override - public MaintenanceSchedule updateStatus(long maintenanceScheduleId, String status) throws PortalException, - SystemException { - - return updateStatus(maintenanceScheduleId, status, null); - } - - @Override - public MaintenanceSchedule updateStatus(long maintenanceScheduleId, String status, String statusMessage) - throws PortalException, SystemException { - - MaintenanceStatus maintenanceStatus = null; - try { - maintenanceStatus = MaintenanceStatus.parse(status); - } catch (IllegalArgumentException e) { - throw new MaintenanceStatusException(status); - } - - MaintenanceSchedule maintenanceSchedule = getMaintenanceSchedule(maintenanceScheduleId); - maintenanceSchedule.setStatus(maintenanceStatus.getCode()); - maintenanceSchedule.setStatusMessage(statusMessage); - - if (maintenanceStatus == MaintenanceStatus.ENDED || maintenanceStatus == MaintenanceStatus.FORCE_ENDED - || maintenanceStatus == MaintenanceStatus.ERROR) { - maintenanceSchedule.setCompleted(Boolean.TRUE); - } else { - maintenanceSchedule.setCompleted(Boolean.FALSE); - } - - return updateMaintenanceSchedule(maintenanceSchedule); - } - - @Override - public List findByStatus(String status) throws SystemException { - return maintenanceSchedulePersistence.findByStatus(status); - } - - private void validate(String type, String reason, long after, Date end, String onreboot) throws PortalException { - - if (Validator.isNull(type)) { - throw new RequiredMaintenanceTypeException(); - } - - try { - MaintenanceType.parse(type); - } catch (IllegalArgumentException e) { - throw new MaintenanceTypeException(type); - } - - if (Validator.isNull(onreboot)) { - throw new RequiredMaintenanceOnRebootException(); - } - - try { - MaintenanceOnReboot.parse(onreboot); - } catch (IllegalArgumentException e) { - throw new MaintenanceOnRebootException(onreboot); - } - - if (Validator.isNull(reason)) { - throw new RequiredMaintenanceReasonException(); - } - - } - - @Override - public List findByC_Completed(long companyId, boolean completed) throws SystemException { - return maintenanceSchedulePersistence.findByC_Completed(companyId, completed); - } - - @Override - public List findByCompleted_Onreboot(boolean completed, String onreboot) throws SystemException { - return maintenanceSchedulePersistence.findByCompleted_Onreboot(completed, onreboot); - } - - @Override - public List findByCompany(long companyId) throws SystemException { - return maintenanceSchedulePersistence.findByCompany(companyId); - } - - @Override - public List findByCompany(long companyId, int start, int end) throws SystemException { - return maintenanceSchedulePersistence.findByCompany(companyId, start, end); - } - - @Override - public int countByCompany(long companyId) throws SystemException { - return maintenanceSchedulePersistence.countByCompany(companyId); - } - - @Override - public List findAll() throws SystemException { - return maintenanceSchedulePersistence.findAll(); - } - - @Override - public int countAll() throws SystemException { - return maintenanceSchedulePersistence.countAll(); - } + /* + * NOTE FOR DEVELOPERS: + * + * Never reference this interface directly. Always use {@link + * it.tref.liferay + * .portos.maintenance.service.MaintenanceScheduleLocalServiceUtil} to + * access the maintenance schedule local service. + */ + + @Override + public MaintenanceSchedule addMaintenanceSchedule(String type, String reason, String portalMessage, + long after, Date end, String onreboot, ServiceContext serviceContext) throws SystemException, + PortalException { + + MaintenanceSchedule maintenanceSchedule = MaintenanceScheduleUtil.create(counterLocalService + .increment(MaintenanceSchedule.class.getName())); + + validate(type, reason, after, end, onreboot); + + maintenanceSchedule.setCompanyId(serviceContext.getCompanyId()); + maintenanceSchedule.setUserId(serviceContext.getUserId()); + User user = userLocalService.fetchUser(serviceContext.getUserId()); + maintenanceSchedule.setUserName(Validator.isNotNull(user) ? user.getScreenName() : StringPool.BLANK); + maintenanceSchedule.setCreateDate(DateUtil.newDate()); + maintenanceSchedule.setModifiedDate(DateUtil.newDate()); + + maintenanceSchedule.setType(type); + maintenanceSchedule.setReason(reason); + maintenanceSchedule.setPortalMessage(portalMessage != null ? portalMessage : StringPool.BLANK); + maintenanceSchedule.setAfter(after); + maintenanceSchedule.setEnd(end != null ? DateTimeUtil.scaleToNextMinute(end) : null); + maintenanceSchedule.setOnreboot(onreboot); + + maintenanceSchedule.setStatus(MaintenanceStatus.NEW.getCode()); + maintenanceSchedule.setCompleted(Boolean.FALSE); + + return addMaintenanceSchedule(maintenanceSchedule); + } + + @Override + public MaintenanceSchedule updateMaintenanceSchedule(long maintenanceScheduleId, String type, + String reason, String portalMessage, long after, Date end, String onreboot, String status, + String statusMessage, ServiceContext serviceContext) throws SystemException, PortalException { + + MaintenanceSchedule maintenanceSchedule = getMaintenanceSchedule(maintenanceScheduleId); + + validate(type, reason, after, end, onreboot); + + if (Validator.isNotNull(status)) { + maintenanceSchedule = updateStatus(maintenanceSchedule.getMaintenanceScheduleId(), status, + statusMessage); + } + + maintenanceSchedule.setModifiedDate(DateUtil.newDate()); + + maintenanceSchedule.setType(type); + maintenanceSchedule.setReason(reason); + maintenanceSchedule.setPortalMessage(portalMessage != null ? portalMessage : StringPool.BLANK); + maintenanceSchedule.setAfter(after); + maintenanceSchedule.setEnd(end != null ? DateTimeUtil.scaleToNextMinute(end) : null); + maintenanceSchedule.setOnreboot(onreboot); + + return updateMaintenanceSchedule(maintenanceSchedule); + } + + @Override + public MaintenanceSchedule updateStatus(long maintenanceScheduleId, String status) + throws PortalException, SystemException { + + return updateStatus(maintenanceScheduleId, status, null); + } + + @Override + public MaintenanceSchedule updateStatus(long maintenanceScheduleId, String status, String statusMessage) + throws PortalException, SystemException { + + MaintenanceStatus maintenanceStatus = null; + try { + maintenanceStatus = MaintenanceStatus.parse(status); + } catch (IllegalArgumentException e) { + throw new MaintenanceStatusException(status); + } + + MaintenanceSchedule maintenanceSchedule = getMaintenanceSchedule(maintenanceScheduleId); + maintenanceSchedule.setStatus(maintenanceStatus.getCode()); + maintenanceSchedule.setStatusMessage(statusMessage); + + if (maintenanceStatus == MaintenanceStatus.ENDED + || maintenanceStatus == MaintenanceStatus.FORCE_ENDED + || maintenanceStatus == MaintenanceStatus.ERROR) { + maintenanceSchedule.setCompleted(Boolean.TRUE); + } else { + maintenanceSchedule.setCompleted(Boolean.FALSE); + } + + return updateMaintenanceSchedule(maintenanceSchedule); + } + + @Override + public List findByStatus(String status) throws SystemException { + return maintenanceSchedulePersistence.findByStatus(status); + } + + private void validate(String type, String reason, long after, Date end, String onreboot) + throws PortalException { + + if (Validator.isNull(type)) { + throw new RequiredMaintenanceTypeException(); + } + + try { + MaintenanceType.parse(type); + } catch (IllegalArgumentException e) { + throw new MaintenanceTypeException(type); + } + + if (Validator.isNull(onreboot)) { + throw new RequiredMaintenanceOnRebootException(); + } + + try { + MaintenanceOnReboot.parse(onreboot); + } catch (IllegalArgumentException e) { + throw new MaintenanceOnRebootException(onreboot); + } + + if (Validator.isNull(reason)) { + throw new RequiredMaintenanceReasonException(); + } + + } + + @Override + public List findByC_Completed(long companyId, boolean completed) + throws SystemException { + return maintenanceSchedulePersistence.findByC_Completed(companyId, completed); + } + + @Override + public List findByCompleted_Onreboot(boolean completed, String onreboot) + throws SystemException { + return maintenanceSchedulePersistence.findByCompleted_Onreboot(completed, onreboot); + } + + @Override + public List findByCompany(long companyId) throws SystemException { + return maintenanceSchedulePersistence.findByCompany(companyId); + } + + @Override + public List findByCompany(long companyId, int start, int end) throws SystemException { + return maintenanceSchedulePersistence.findByCompany(companyId, start, end); + } + + @Override + public int countByCompany(long companyId) throws SystemException { + return maintenanceSchedulePersistence.countByCompany(companyId); + } + + @Override + public List findAll() throws SystemException { + return maintenanceSchedulePersistence.findAll(); + } + + @Override + public int countAll() throws SystemException { + return maintenanceSchedulePersistence.countAll(); + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/service/impl/MaintenanceScheduleServiceImpl.java b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/service/impl/MaintenanceScheduleServiceImpl.java index 15482be3..bfebc7c7 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/service/impl/MaintenanceScheduleServiceImpl.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/service/impl/MaintenanceScheduleServiceImpl.java @@ -25,13 +25,15 @@ import java.util.Date; * The implementation of the maintenance schedule remote service. * *

- * All custom service methods should be put in this class. Whenever methods are added, rerun - * ServiceBuilder to copy their definitions into the - * {@link it.tref.liferay.portos.maintenance.service.MaintenanceScheduleService} interface. + * All custom service methods should be put in this class. Whenever methods are + * added, rerun ServiceBuilder to copy their definitions into the + * {@link it.tref.liferay.portos.maintenance.service.MaintenanceScheduleService} + * interface. * *

- * This is a remote service. Methods of this service are expected to have security checks based on - * the propagated JAAS credentials because this service can be accessed remotely. + * This is a remote service. Methods of this service are expected to have + * security checks based on the propagated JAAS credentials because this service + * can be accessed remotely. *

* * @author @@ -39,45 +41,46 @@ import java.util.Date; * @see it.tref.liferay.portos.maintenance.service.MaintenanceScheduleServiceUtil */ public class MaintenanceScheduleServiceImpl extends MaintenanceScheduleServiceBaseImpl { - /* - * NOTE FOR DEVELOPERS: - * - * Never reference this interface directly. Always use {@link - * it.tref.liferay.portos.maintenance.service.MaintenanceScheduleServiceUtil} to access the - * maintenance schedule remote service. - */ + /* + * NOTE FOR DEVELOPERS: + * + * Never reference this interface directly. Always use {@link + * it.tref.liferay + * .portos.maintenance.service.MaintenanceScheduleServiceUtil} to access the + * maintenance schedule remote service. + */ - public MaintenanceSchedule addMaintenanceSchedule(String type, String reason, String portalMessage, long after, - Date end, String onreboot, ServiceContext serviceContext) throws Exception { + public MaintenanceSchedule addMaintenanceSchedule(String type, String reason, String portalMessage, + long after, Date end, String onreboot, ServiceContext serviceContext) throws Exception { - if (!PortalUtil.isCompanyAdmin(getUser())) { - throw new PortalException("Access denied!"); - } + if (!PortalUtil.isCompanyAdmin(getUser())) { + throw new PortalException("Access denied!"); + } - return maintenanceScheduleLocalService.addMaintenanceSchedule(type, reason, portalMessage, after, end, onreboot, - serviceContext); - } + return maintenanceScheduleLocalService.addMaintenanceSchedule(type, reason, portalMessage, after, + end, onreboot, serviceContext); + } - public MaintenanceSchedule updateMaintenanceSchedule(long maintenanceScheduleId, String type, String reason, - String portalMessage, long after, Date end, String onreboot, String status, String statusMessage, - ServiceContext serviceContext) throws Exception { + public MaintenanceSchedule updateMaintenanceSchedule(long maintenanceScheduleId, String type, + String reason, String portalMessage, long after, Date end, String onreboot, String status, + String statusMessage, ServiceContext serviceContext) throws Exception { - if (!PortalUtil.isCompanyAdmin(getUser())) { - throw new PortalException("Access denied!"); - } + if (!PortalUtil.isCompanyAdmin(getUser())) { + throw new PortalException("Access denied!"); + } - return maintenanceScheduleLocalService.updateMaintenanceSchedule(maintenanceScheduleId, type, reason, - portalMessage, after, end, onreboot, status, statusMessage, serviceContext); - } + return maintenanceScheduleLocalService.updateMaintenanceSchedule(maintenanceScheduleId, type, reason, + portalMessage, after, end, onreboot, status, statusMessage, serviceContext); + } - public MaintenanceSchedule deleteMaintenanceSchedule(long maintenanceScheduleId, ServiceContext serviceContext) - throws Exception { + public MaintenanceSchedule deleteMaintenanceSchedule(long maintenanceScheduleId, + ServiceContext serviceContext) throws Exception { - if (!PortalUtil.isCompanyAdmin(getUser())) { - throw new PortalException("Access denied!"); - } + if (!PortalUtil.isCompanyAdmin(getUser())) { + throw new PortalException("Access denied!"); + } - return maintenanceScheduleLocalService.deleteMaintenanceSchedule(maintenanceScheduleId); - } + return maintenanceScheduleLocalService.deleteMaintenanceSchedule(maintenanceScheduleId); + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/servlet/MaintenanceServlet.java b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/servlet/MaintenanceServlet.java index 4cf8de49..e8b061d2 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/servlet/MaintenanceServlet.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/servlet/MaintenanceServlet.java @@ -38,210 +38,204 @@ import org.apache.commons.net.util.SubnetUtils.SubnetInfo; public class MaintenanceServlet extends HttpServlet { - private static final long serialVersionUID = 4568712977896061068L; + private static final long serialVersionUID = 4568712977896061068L; + + private static final String CONTENT_TYPE_APPLICATION_JSON = "application/json"; + + private static final String START_PATH = "/start"; + private static final String STOP_PATH = "/stop"; - private static final String CONTENT_TYPE_APPLICATION_JSON = "application/json"; + private static final String FORCE_PARAM = "force"; + private static final String FORCED_MESSAGE = "Forced maintenance mode..."; - private static final String START_PATH = "/start"; - private static final String STOP_PATH = "/stop"; + private static final String END_PARAM = "end"; + private static final String TYPE_PARAM = "type"; + private static final String AFTER_PARAM = "after"; + private static final String REASON_PARAM = "reason"; + private static final String MESSAGE_PARAM = "message"; + private static final String ONREBOOT_PARAM = "onreboot"; + + private static final String STOP_AFTER_PARAM = "stopAfter"; - private static final String FORCE_PARAM = "force"; - private static final String FORCED_MESSAGE = "Forced maintenance mode..."; + private static final Object ALLOW_ALL_IP_ADDRESS = "ALL"; + private static final String[] allowedIpAddresses = PropsUtil.getArray("maintenance-allowed-ip-addresses"); + + private static final SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy hh:mm:ss"); + + private static final Log _log = LogFactoryUtil.getLog(MaintenanceServlet.class); - private static final String END_PARAM = "end"; - private static final String TYPE_PARAM = "type"; - private static final String AFTER_PARAM = "after"; - private static final String REASON_PARAM = "reason"; - private static final String MESSAGE_PARAM = "message"; - private static final String ONREBOOT_PARAM = "onreboot"; + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, + IOException { - private static final String STOP_AFTER_PARAM = "stopAfter"; + JSONObject jsonResponse = JSONFactoryUtil.createJSONObject(); - private static final Object ALLOW_ALL_IP_ADDRESS = "ALL"; - private static final String[] allowedIpAddresses = PropsUtil.getArray("maintenance-allowed-ip-addresses"); + response.setContentType(CONTENT_TYPE_APPLICATION_JSON); - private static final SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy hh:mm:ss"); + try { - private static final Log _log = LogFactoryUtil.getLog(MaintenanceServlet.class); + ServiceContext serviceContext = ServiceContextFactory.getInstance(request); + String pathInfo = request.getPathInfo(); + Map params = request.getParameterMap(); - @Override - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + checkIpAddress(request); - JSONObject jsonResponse = JSONFactoryUtil.createJSONObject(); + if (START_PATH.equals(pathInfo)) { + MaintenanceSchedule maintenanceSchedule = startMaintenance(params, serviceContext); + if (Validator.isNotNull(maintenanceSchedule)) { + jsonResponse.put("id", maintenanceSchedule.getMaintenanceScheduleId()); + jsonResponse.put("reason", maintenanceSchedule.getReason()); + jsonResponse.put("startDate", MaintenanceDateUtil.getStartDate(maintenanceSchedule)); + } + } else if (STOP_PATH.equals(pathInfo)) { + MaintenanceSchedule maintenanceSchedule = stopMaintenance(params); + if (Validator.isNotNull(maintenanceSchedule)) { + jsonResponse.put("id", maintenanceSchedule.getMaintenanceScheduleId()); + jsonResponse.put("endDate", sdf.format(maintenanceSchedule.getEnd())); + } + } else { + throw new UnsupportedOperationException(); + } + + jsonResponse.put("success", "true"); + response.setStatus(HttpServletResponse.SC_OK); + ServletResponseUtil.write(response, jsonResponse.toString()); - response.setContentType(CONTENT_TYPE_APPLICATION_JSON); + } catch (IllegalAccessException e) { + sendErrorResponse(response, HttpServletResponse.SC_FORBIDDEN, e.getMessage()); + } catch (UnsupportedOperationException e) { + sendErrorResponse(response, HttpServletResponse.SC_NOT_FOUND, e.getMessage()); + ServletResponseUtil.write(response, jsonResponse.toString()); + } catch (ParseException | IllegalArgumentException e) { + sendErrorResponse(response, HttpServletResponse.SC_BAD_REQUEST, e.getMessage()); + } catch (Exception e) { + _log.error(e); + sendErrorResponse(response, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.getMessage()); + } - try { - - ServiceContext serviceContext = ServiceContextFactory.getInstance(request); - String pathInfo = request.getPathInfo(); - Map params = request.getParameterMap(); - - checkIpAddress(request); - - if (START_PATH.equals(pathInfo)) { - MaintenanceSchedule maintenanceSchedule = startMaintenance(params, serviceContext); - if (Validator.isNotNull(maintenanceSchedule)) { - jsonResponse.put("id", maintenanceSchedule.getMaintenanceScheduleId()); - jsonResponse.put("reason", maintenanceSchedule.getReason()); - jsonResponse.put("startDate", MaintenanceDateUtil.getStartDate(maintenanceSchedule)); - } - } else if (STOP_PATH.equals(pathInfo)) { - MaintenanceSchedule maintenanceSchedule = stopMaintenance(params); - if (Validator.isNotNull(maintenanceSchedule)) { - jsonResponse.put("id", maintenanceSchedule.getMaintenanceScheduleId()); - jsonResponse.put("endDate", sdf.format(maintenanceSchedule.getEnd())); - } - } else { - throw new UnsupportedOperationException(); - } - - jsonResponse.put("success", "true"); - response.setStatus(HttpServletResponse.SC_OK); - ServletResponseUtil.write(response, jsonResponse.toString()); - - } catch (IllegalAccessException e) { - sendErrorResponse(response, HttpServletResponse.SC_FORBIDDEN, e.getMessage()); - } catch (UnsupportedOperationException e) { - sendErrorResponse(response, HttpServletResponse.SC_NOT_FOUND, e.getMessage()); - ServletResponseUtil.write(response, jsonResponse.toString()); - } catch (ParseException | IllegalArgumentException e) { - sendErrorResponse(response, HttpServletResponse.SC_BAD_REQUEST, e.getMessage()); - } catch (Exception e) { - _log.error(e); - sendErrorResponse(response, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.getMessage()); - } - - } - - - - private MaintenanceSchedule stopMaintenance(Map params) throws IllegalAccessException, - IllegalArgumentException, InvocationTargetException, Exception { - - MaintenanceSchedule result = null; - - - boolean force = - params.get(FORCE_PARAM) != null && params.get(FORCE_PARAM).length > 0 ? Boolean - .valueOf(params.get(FORCE_PARAM)[0]) : false; - - if (force) { - PortalMaintenanceUtil.stopMaintenaceMode(); - List maintenanceSchedules = - MaintenanceScheduleLocalServiceUtil.findByStatus(MaintenanceStatus.IN_PROGRESS.getCode()); - for (MaintenanceSchedule maintenanceSchedule : maintenanceSchedules) { - MaintenanceScheduleLocalServiceUtil.updateStatus(maintenanceSchedule.getMaintenanceScheduleId(), - MaintenanceStatus.FORCE_ENDED.getCode(), "Stop forced at " + sdf.format(DateUtil.newDate())); - } - return null; - } - - int stopAfter = - params.get(STOP_AFTER_PARAM) != null && params.get(STOP_AFTER_PARAM).length > 0 ? Integer.valueOf(params - .get(STOP_AFTER_PARAM)[0]) : 0; - - List maintenanceSchedules = - MaintenanceScheduleLocalServiceUtil.findByStatus(MaintenanceStatus.IN_PROGRESS.getCode()); - - if (!maintenanceSchedules.isEmpty()) { - - if (maintenanceSchedules.size() > 1) { - _log.warn("Multiple maintenance in progress..."); - } - - Date end = DateUtil.newDate(); - - if (stopAfter > 0) { - Calendar calendar = Calendar.getInstance(); - calendar.add(Calendar.MINUTE, stopAfter); - end = calendar.getTime(); - } - - for (MaintenanceSchedule maintenanceSchedule : maintenanceSchedules) { - maintenanceSchedule.setEnd(DateTimeUtil.scaleToNextMinute(end)); - result = MaintenanceScheduleLocalServiceUtil.updateMaintenanceSchedule(maintenanceSchedule); - } - - } - - return result; - - } - - private MaintenanceSchedule startMaintenance(Map params, ServiceContext serviceContext) - throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, Exception { - - boolean force = - params.get(FORCE_PARAM) != null && params.get(FORCE_PARAM).length > 0 ? Boolean - .valueOf(params.get(FORCE_PARAM)[0]) : false; - - if (force) { - PortalMaintenanceUtil.startMaintenaceMode(UUID.randomUUID().toString(), FORCED_MESSAGE); - return null; - } - - Date end = null; - String[] endParam = params.get(END_PARAM); - if (endParam != null && endParam.length > 0) { - end = sdf.parse(endParam[0]); - } - - String type = - params.get(TYPE_PARAM) != null && params.get(TYPE_PARAM).length > 0 ? params.get(TYPE_PARAM)[0] : null; - String reason = - params.get(REASON_PARAM) != null && params.get(REASON_PARAM).length > 0 ? params.get(REASON_PARAM)[0] : null; - long after = - params.get(AFTER_PARAM) != null && params.get(AFTER_PARAM).length > 0 ? Long - .valueOf(params.get(AFTER_PARAM)[0]) : 0l; - String onreboot = - params.get(ONREBOOT_PARAM) != null && params.get(ONREBOOT_PARAM).length > 0 ? params.get(ONREBOOT_PARAM)[0] - : null; - String message = - params.get(MESSAGE_PARAM) != null && params.get(MESSAGE_PARAM).length > 0 ? params.get(MESSAGE_PARAM)[0] : null; - - return MaintenanceScheduleLocalServiceUtil.addMaintenanceSchedule(type, reason, message, after, end, onreboot, - serviceContext); - - } - - private void checkIpAddress(HttpServletRequest request) throws IllegalAccessException { - - String clientIpAddress = request.getHeader("X-FORWARDED-FOR"); - if (Validator.isNull(clientIpAddress)) { - clientIpAddress = request.getRemoteAddr(); - } - - boolean found = false; - for (String ipAddress : allowedIpAddresses) { - - if (ipAddress.contains("/")) { - SubnetUtils subnetUtils = new SubnetUtils(ipAddress); - SubnetInfo subnetInfo = subnetUtils.getInfo(); - if (subnetInfo.isInRange(clientIpAddress)) { - found = true; - break; - } - } else if (ipAddress.equals(clientIpAddress) || ipAddress.equals(ALLOW_ALL_IP_ADDRESS)) { - found = true; - break; - } - } - - if (!found) { - throw new IllegalAccessException("Your IP address '" + clientIpAddress + "' is not authorized"); - } - - } - - - private void sendErrorResponse(HttpServletResponse response, int scInternalServerError, String message) - throws IOException { - JSONObject jsonResponse = JSONFactoryUtil.createJSONObject(); - response.setStatus(scInternalServerError); - jsonResponse.put("success", false); - jsonResponse.put("message", message); - ServletResponseUtil.write(response, jsonResponse.toString()); - } + } + + private MaintenanceSchedule stopMaintenance(Map params) throws IllegalAccessException, + IllegalArgumentException, InvocationTargetException, Exception { + + MaintenanceSchedule result = null; + + boolean force = params.get(FORCE_PARAM) != null && params.get(FORCE_PARAM).length > 0 ? Boolean + .valueOf(params.get(FORCE_PARAM)[0]) : false; + + if (force) { + PortalMaintenanceUtil.stopMaintenaceMode(); + List maintenanceSchedules = MaintenanceScheduleLocalServiceUtil + .findByStatus(MaintenanceStatus.IN_PROGRESS.getCode()); + for (MaintenanceSchedule maintenanceSchedule : maintenanceSchedules) { + MaintenanceScheduleLocalServiceUtil.updateStatus( + maintenanceSchedule.getMaintenanceScheduleId(), + MaintenanceStatus.FORCE_ENDED.getCode(), + "Stop forced at " + sdf.format(DateUtil.newDate())); + } + return null; + } + + int stopAfter = params.get(STOP_AFTER_PARAM) != null && params.get(STOP_AFTER_PARAM).length > 0 ? Integer + .valueOf(params.get(STOP_AFTER_PARAM)[0]) : 0; + + List maintenanceSchedules = MaintenanceScheduleLocalServiceUtil + .findByStatus(MaintenanceStatus.IN_PROGRESS.getCode()); + + if (!maintenanceSchedules.isEmpty()) { + + if (maintenanceSchedules.size() > 1) { + _log.warn("Multiple maintenance in progress..."); + } + + Date end = DateUtil.newDate(); + + if (stopAfter > 0) { + Calendar calendar = Calendar.getInstance(); + calendar.add(Calendar.MINUTE, stopAfter); + end = calendar.getTime(); + } + + for (MaintenanceSchedule maintenanceSchedule : maintenanceSchedules) { + maintenanceSchedule.setEnd(DateTimeUtil.scaleToNextMinute(end)); + result = MaintenanceScheduleLocalServiceUtil.updateMaintenanceSchedule(maintenanceSchedule); + } + + } + + return result; + + } + + private MaintenanceSchedule startMaintenance(Map params, ServiceContext serviceContext) + throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, Exception { + + boolean force = params.get(FORCE_PARAM) != null && params.get(FORCE_PARAM).length > 0 ? Boolean + .valueOf(params.get(FORCE_PARAM)[0]) : false; + + if (force) { + PortalMaintenanceUtil.startMaintenaceMode(UUID.randomUUID().toString(), FORCED_MESSAGE); + return null; + } + + Date end = null; + String[] endParam = params.get(END_PARAM); + if (endParam != null && endParam.length > 0) { + end = sdf.parse(endParam[0]); + } + + String type = params.get(TYPE_PARAM) != null && params.get(TYPE_PARAM).length > 0 ? params + .get(TYPE_PARAM)[0] : null; + String reason = params.get(REASON_PARAM) != null && params.get(REASON_PARAM).length > 0 ? params + .get(REASON_PARAM)[0] : null; + long after = params.get(AFTER_PARAM) != null && params.get(AFTER_PARAM).length > 0 ? Long + .valueOf(params.get(AFTER_PARAM)[0]) : 0l; + String onreboot = params.get(ONREBOOT_PARAM) != null && params.get(ONREBOOT_PARAM).length > 0 ? params + .get(ONREBOOT_PARAM)[0] : null; + String message = params.get(MESSAGE_PARAM) != null && params.get(MESSAGE_PARAM).length > 0 ? params + .get(MESSAGE_PARAM)[0] : null; + + return MaintenanceScheduleLocalServiceUtil.addMaintenanceSchedule(type, reason, message, after, end, + onreboot, serviceContext); + + } + + private void checkIpAddress(HttpServletRequest request) throws IllegalAccessException { + + String clientIpAddress = request.getHeader("X-FORWARDED-FOR"); + if (Validator.isNull(clientIpAddress)) { + clientIpAddress = request.getRemoteAddr(); + } + + boolean found = false; + for (String ipAddress : allowedIpAddresses) { + + if (ipAddress.contains("/")) { + SubnetUtils subnetUtils = new SubnetUtils(ipAddress); + SubnetInfo subnetInfo = subnetUtils.getInfo(); + if (subnetInfo.isInRange(clientIpAddress)) { + found = true; + break; + } + } else if (ipAddress.equals(clientIpAddress) || ipAddress.equals(ALLOW_ALL_IP_ADDRESS)) { + found = true; + break; + } + } + + if (!found) { + throw new IllegalAccessException("Your IP address '" + clientIpAddress + "' is not authorized"); + } + + } + + private void sendErrorResponse(HttpServletResponse response, int scInternalServerError, String message) + throws IOException { + JSONObject jsonResponse = JSONFactoryUtil.createJSONObject(); + response.setStatus(scInternalServerError); + jsonResponse.put("success", false); + jsonResponse.put("message", message); + ServletResponseUtil.write(response, jsonResponse.toString()); + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/util/DateTimeUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/util/DateTimeUtil.java index 9424eda6..3fd21345 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/util/DateTimeUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/util/DateTimeUtil.java @@ -5,37 +5,37 @@ import java.util.Date; public class DateTimeUtil { - /** - * This method remove seconds and milliseconds to the input date. - * - * @param input - * @return the input with seconds and milliseconds equal to 0 - */ - public static Date removeSeconds(Date input) { - Calendar calendar = Calendar.getInstance(); - calendar.setTime(input); - calendar.set(Calendar.SECOND, 0); - calendar.set(Calendar.MILLISECOND, 0); - return calendar.getTime(); - } + /** + * This method remove seconds and milliseconds to the input date. + * + * @param input + * @return the input with seconds and milliseconds equal to 0 + */ + public static Date removeSeconds(Date input) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(input); + calendar.set(Calendar.SECOND, 0); + calendar.set(Calendar.MILLISECOND, 0); + return calendar.getTime(); + } - /** - * This method add a minute , remove seconds and milliseconds to the input date. If seconds and - * milliseconds are equal to 0, return the input. - * - * @param input - * @return the date scaled or the input if doesn't require scaling. - */ - public static Date scaleToNextMinute(Date input) { - Calendar calendar = Calendar.getInstance(); - calendar.setTime(input); - if (calendar.get(Calendar.SECOND) != 0 || calendar.get(Calendar.MILLISECOND) != 0) { - calendar.add(Calendar.MINUTE, 1); - calendar.set(Calendar.SECOND, 0); - calendar.set(Calendar.MILLISECOND, 0); - return calendar.getTime(); - } - return input; - } + /** + * This method add a minute , remove seconds and milliseconds to the input + * date. If seconds and milliseconds are equal to 0, return the input. + * + * @param input + * @return the date scaled or the input if doesn't require scaling. + */ + public static Date scaleToNextMinute(Date input) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(input); + if (calendar.get(Calendar.SECOND) != 0 || calendar.get(Calendar.MILLISECOND) != 0) { + calendar.add(Calendar.MINUTE, 1); + calendar.set(Calendar.SECOND, 0); + calendar.set(Calendar.MILLISECOND, 0); + return calendar.getTime(); + } + return input; + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/util/MaintenanceConstants.java b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/util/MaintenanceConstants.java index 014d9ace..993e0601 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/util/MaintenanceConstants.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/util/MaintenanceConstants.java @@ -1,130 +1,129 @@ package it.tref.liferay.portos.maintenance.util; - public class MaintenanceConstants { - public enum MaintenanceType { + public enum MaintenanceType { - FULL("full", "Full mode"), USER("user", "Only user mode"); + FULL("full", "Full mode"), USER("user", "Only user mode"); - MaintenanceType(String code, String description) { - this.setCode(code); - this.setDescription(description); - } + MaintenanceType(String code, String description) { + this.setCode(code); + this.setDescription(description); + } - public String getDescription() { - return description; - } + public String getDescription() { + return description; + } - public void setDescription(String description) { - this.description = description; - } + public void setDescription(String description) { + this.description = description; + } - public String getCode() { - return code; - } + public String getCode() { + return code; + } - public void setCode(String code) { - this.code = code; - } + public void setCode(String code) { + this.code = code; + } - private String code; - private String description; + private String code; + private String description; - public static MaintenanceType parse(String code) { + public static MaintenanceType parse(String code) { - for (MaintenanceType maintenanceType : values()) { - if (maintenanceType.code.equals(code)) { - return maintenanceType; - } - } + for (MaintenanceType maintenanceType : values()) { + if (maintenanceType.code.equals(code)) { + return maintenanceType; + } + } - throw new IllegalArgumentException("Invalid MaintenanceType code: " + code); - } + throw new IllegalArgumentException("Invalid MaintenanceType code: " + code); + } - } + } - public enum MaintenanceOnReboot { + public enum MaintenanceOnReboot { - CONTINUE("continue", "Continue"), TERMINATE("terminate", "Terminate"); + CONTINUE("continue", "Continue"), TERMINATE("terminate", "Terminate"); - MaintenanceOnReboot(String code, String description) { - this.setCode(code); - this.setDescription(description); - } + MaintenanceOnReboot(String code, String description) { + this.setCode(code); + this.setDescription(description); + } - public String getDescription() { - return description; - } + public String getDescription() { + return description; + } - public void setDescription(String description) { - this.description = description; - } + public void setDescription(String description) { + this.description = description; + } - public String getCode() { - return code; - } + public String getCode() { + return code; + } - public void setCode(String code) { - this.code = code; - } + public void setCode(String code) { + this.code = code; + } - private String code; - private String description; + private String code; + private String description; - public static MaintenanceOnReboot parse(String code) { + public static MaintenanceOnReboot parse(String code) { - for (MaintenanceOnReboot maintenanceOnReboot : values()) { - if (maintenanceOnReboot.code.equals(code)) { - return maintenanceOnReboot; - } - } + for (MaintenanceOnReboot maintenanceOnReboot : values()) { + if (maintenanceOnReboot.code.equals(code)) { + return maintenanceOnReboot; + } + } - throw new IllegalArgumentException("Invalid MaintenanceOnReboot code: " + code); - } + throw new IllegalArgumentException("Invalid MaintenanceOnReboot code: " + code); + } - } + } - public enum MaintenanceStatus { + public enum MaintenanceStatus { - NEW("N", "New"), IN_PROGRESS("P", "In Progress"), ENDED("E", "Ended"), FORCE_ENDED("FE", "Force Ended"), ERROR( - "ER", "Error"); + NEW("N", "New"), IN_PROGRESS("P", "In Progress"), ENDED("E", "Ended"), FORCE_ENDED("FE", + "Force Ended"), ERROR("ER", "Error"); - MaintenanceStatus(String code, String description) { - this.setCode(code); - this.setDescription(description); - } + MaintenanceStatus(String code, String description) { + this.setCode(code); + this.setDescription(description); + } - public String getDescription() { - return description; - } + public String getDescription() { + return description; + } - public void setDescription(String description) { - this.description = description; - } + public void setDescription(String description) { + this.description = description; + } - public String getCode() { - return code; - } + public String getCode() { + return code; + } - public void setCode(String code) { - this.code = code; - } + public void setCode(String code) { + this.code = code; + } - private String code; - private String description; + private String code; + private String description; - public static MaintenanceStatus parse(String code) { + public static MaintenanceStatus parse(String code) { - for (MaintenanceStatus maintenanceStatus : values()) { - if (maintenanceStatus.code.equals(code)) { - return maintenanceStatus; - } - } + for (MaintenanceStatus maintenanceStatus : values()) { + if (maintenanceStatus.code.equals(code)) { + return maintenanceStatus; + } + } - throw new IllegalArgumentException("Invalid MaintenanceStatus code: " + code); - } + throw new IllegalArgumentException("Invalid MaintenanceStatus code: " + code); + } - } + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/util/MaintenanceDateUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/util/MaintenanceDateUtil.java index d36bc30b..7b4fa06a 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/util/MaintenanceDateUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/util/MaintenanceDateUtil.java @@ -7,20 +7,20 @@ import java.util.Date; public class MaintenanceDateUtil { - public static Date getStartDate(Date createDate, int after) { + public static Date getStartDate(Date createDate, int after) { - Calendar calendar = Calendar.getInstance(); - calendar.setTime(createDate); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(createDate); - if (after > 0) { - calendar.add(Calendar.MINUTE, after); - } + if (after > 0) { + calendar.add(Calendar.MINUTE, after); + } - return calendar.getTime(); - } + return calendar.getTime(); + } - public static Date getStartDate(MaintenanceSchedule maintenanceSchedule) { - return getStartDate(maintenanceSchedule.getCreateDate(), (int) maintenanceSchedule.getAfter()); - } + public static Date getStartDate(MaintenanceSchedule maintenanceSchedule) { + return getStartDate(maintenanceSchedule.getCreateDate(), (int) maintenanceSchedule.getAfter()); + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/util/PortalMaintenanceUtil.java b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/util/PortalMaintenanceUtil.java index 5d543ea0..a0eed203 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/util/PortalMaintenanceUtil.java +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/util/PortalMaintenanceUtil.java @@ -11,31 +11,30 @@ import java.lang.reflect.InvocationTargetException; public class PortalMaintenanceUtil { - public static void startMaintenaceMode(String sessionId, String classNameParam) throws IllegalAccessException, - IllegalArgumentException, InvocationTargetException, Exception { + public static void startMaintenaceMode(String sessionId, String classNameParam) + throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, Exception { - String className = - LanguageUtil - .get(LocaleUtil.getDefault(), - "the-sign-in-process-is-temporarily-disabled-because-the-portal-is-undergoing-a-routine-maintenance-upgrade"); + String className = LanguageUtil + .get(LocaleUtil.getDefault(), + "the-sign-in-process-is-temporarily-disabled-because-the-portal-is-undergoing-a-routine-maintenance-upgrade"); - if (Validator.isNotNull(classNameParam)) { - className = classNameParam; - } + if (Validator.isNotNull(classNameParam)) { + className = classNameParam; + } - Class clazz = - ClassResolverUtil.resolve("com.liferay.portal.util.MaintenanceUtil", PortalClassLoaderUtil.getClassLoader()); - ReflectionUtil.getDeclaredMethod(clazz, "maintain", String.class, String.class).invoke(null, sessionId, className); - } + Class clazz = ClassResolverUtil.resolve("com.liferay.portal.util.MaintenanceUtil", + PortalClassLoaderUtil.getClassLoader()); + ReflectionUtil.getDeclaredMethod(clazz, "maintain", String.class, String.class).invoke(null, + sessionId, className); + } - public static void stopMaintenaceMode() throws IllegalAccessException, IllegalArgumentException, - InvocationTargetException, Exception { + public static void stopMaintenaceMode() throws IllegalAccessException, IllegalArgumentException, + InvocationTargetException, Exception { - Class clazz = - ClassResolverUtil.resolve("com.liferay.portal.util.MaintenanceUtil", PortalClassLoaderUtil.getClassLoader()); - ReflectionUtil.getDeclaredMethod(clazz, "cancel", new Class[0]).invoke(null, new Object[0]); + Class clazz = ClassResolverUtil.resolve("com.liferay.portal.util.MaintenanceUtil", + PortalClassLoaderUtil.getClassLoader()); + ReflectionUtil.getDeclaredMethod(clazz, "cancel", new Class[0]).invoke(null, new Object[0]); - - } + } } diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/service.properties b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/service.properties index 5f3c460f..df8d6518 100644 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/service.properties +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/service.properties @@ -13,8 +13,8 @@ ## build.namespace=portos_maintenance - build.number=42 - build.date=1569596970763 + build.number=44 + build.date=1605008600382 build.auto.upgrade=true ## diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/tld/c.tld b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/tld/c.tld deleted file mode 100644 index 98efa6a6..00000000 --- a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/tld/c.tld +++ /dev/null @@ -1,572 +0,0 @@ - - - - - JSTL 1.2 core library - JSTL core - 1.2 - c - http://java.sun.com/jsp/jstl/core - - - - Provides core validation features for JSTL tags. - - - org.apache.taglibs.standard.tlv.JstlCoreTLV - - - - - - Catches any Throwable that occurs in its body and optionally - exposes it. - - catch - org.apache.taglibs.standard.tag.common.core.CatchTag - JSP - - -Name of the exported scoped variable for the -exception thrown from a nested action. The type of the -scoped variable is the type of the exception thrown. - - var - false - false - - - - - - Simple conditional tag that establishes a context for - mutually exclusive conditional operations, marked by - <when> and <otherwise> - - choose - com.liferay.taglib.core.ChooseTag - JSP - - - - - Simple conditional tag, which evalutes its body if the - supplied condition is true and optionally exposes a Boolean - scripting variable representing the evaluation of this condition - - if - com.liferay.taglib.core.IfTag - JSP - - -The test condition that determines whether or -not the body content should be processed. - - test - true - true - boolean - - - -Name of the exported scoped variable for the -resulting value of the test condition. The type -of the scoped variable is Boolean. - - var - false - false - - - -Scope for var. - - scope - false - false - - - - - - Retrieves an absolute or relative URL and exposes its contents - to either the page, a String in 'var', or a Reader in 'varReader'. - - import - org.apache.taglibs.standard.tag.rt.core.ImportTag - org.apache.taglibs.standard.tei.ImportTEI - JSP - - -The URL of the resource to import. - - url - true - true - - - -Name of the exported scoped variable for the -resource's content. The type of the scoped -variable is String. - - var - false - false - - - -Scope for var. - - scope - false - false - - - -Name of the exported scoped variable for the -resource's content. The type of the scoped -variable is Reader. - - varReader - false - false - - - -Name of the context when accessing a relative -URL resource that belongs to a foreign -context. - - context - false - true - - - -Character encoding of the content at the input -resource. - - charEncoding - false - true - - - - - - The basic iteration tag, accepting many different - collection types and supporting subsetting and other - functionality - - forEach - org.apache.taglibs.standard.tag.rt.core.ForEachTag - org.apache.taglibs.standard.tei.ForEachTEI - JSP - - -Collection of items to iterate over. - - items - false - true - java.lang.Object - - java.lang.Object - - - - -If items specified: -Iteration begins at the item located at the -specified index. First item of the collection has -index 0. -If items not specified: -Iteration begins with index set at the value -specified. - - begin - false - true - int - - - -If items specified: -Iteration ends at the item located at the -specified index (inclusive). -If items not specified: -Iteration ends when index reaches the value -specified. - - end - false - true - int - - - -Iteration will only process every step items of -the collection, starting with the first one. - - step - false - true - int - - - -Name of the exported scoped variable for the -current item of the iteration. This scoped -variable has nested visibility. Its type depends -on the object of the underlying collection. - - var - false - false - - - -Name of the exported scoped variable for the -status of the iteration. Object exported is of type -javax.servlet.jsp.jstl.core.LoopTagStatus. This scoped variable has nested -visibility. - - varStatus - false - false - - - - - - Iterates over tokens, separated by the supplied delimeters - - forTokens - org.apache.taglibs.standard.tag.rt.core.ForTokensTag - JSP - - -String of tokens to iterate over. - - items - true - true - java.lang.String - - java.lang.String - - - - -The set of delimiters (the characters that -separate the tokens in the string). - - delims - true - true - java.lang.String - - - -Iteration begins at the token located at the -specified index. First token has index 0. - - begin - false - true - int - - - -Iteration ends at the token located at the -specified index (inclusive). - - end - false - true - int - - - -Iteration will only process every step tokens -of the string, starting with the first one. - - step - false - true - int - - - -Name of the exported scoped variable for the -current item of the iteration. This scoped -variable has nested visibility. - - var - false - false - - - -Name of the exported scoped variable for the -status of the iteration. Object exported is of -type -javax.servlet.jsp.jstl.core.LoopTag -Status. This scoped variable has nested -visibility. - - varStatus - false - false - - - - - - Like <%= ... >, but for expressions. - - out - org.apache.taglibs.standard.tag.rt.core.OutTag - JSP - - -Expression to be evaluated. - - value - true - true - - - -Default value if the resulting value is null. - - default - false - true - - - -Determines whether characters <,>,&,'," in the -resulting string should be converted to their -corresponding character entity codes. Default value is -true. - - escapeXml - false - true - - - - - - - Subtag of <choose> that follows <when> tags - and runs only if all of the prior conditions evaluated to - 'false' - - otherwise - com.liferay.taglib.core.OtherwiseTag - JSP - - - - - Adds a parameter to a containing 'import' tag's URL. - - param - org.apache.taglibs.standard.tag.rt.core.ParamTag - JSP - - -Name of the query string parameter. - - name - true - true - - - -Value of the parameter. - - value - false - true - - - - - - Redirects to a new URL. - - redirect - org.apache.taglibs.standard.tag.rt.core.RedirectTag - JSP - - -The URL of the resource to redirect to. - - url - false - true - - - -Name of the context when redirecting to a relative URL -resource that belongs to a foreign context. - - context - false - true - - - - - - Removes a scoped variable (from a particular scope, if specified). - - remove - org.apache.taglibs.standard.tag.common.core.RemoveTag - empty - - -Name of the scoped variable to be removed. - - var - true - false - - - -Scope for var. - - scope - false - false - - - - - - Sets the result of an expression evaluation in a 'scope' - - set - org.apache.taglibs.standard.tag.rt.core.SetTag - JSP - - -Name of the exported scoped variable to hold the value -specified in the action. The type of the scoped variable is -whatever type the value expression evaluates to. - - var - false - false - - - -Expression to be evaluated. - - value - false - true - - java.lang.Object - - - - -Target object whose property will be set. Must evaluate to -a JavaBeans object with setter property property, or to a -java.util.Map object. - - target - false - true - - - -Name of the property to be set in the target object. - - property - false - true - - - -Scope for var. - - scope - false - false - - - - - - Creates a URL with optional query parameters. - - url - org.apache.taglibs.standard.tag.rt.core.UrlTag - JSP - - -Name of the exported scoped variable for the -processed url. The type of the scoped variable is -String. - - var - false - false - - - -Scope for var. - - scope - false - false - - - -URL to be processed. - - value - false - true - - - -Name of the context when specifying a relative URL -resource that belongs to a foreign context. - - context - false - true - - - - - - Subtag of <choose> that includes its body if its - condition evalutes to 'true' - - when - com.liferay.taglib.core.WhenTag - JSP - - -The test condition that determines whether or not the -body content should be processed. - - test - true - true - boolean - - - - diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/ivy.xml b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/ivy.xml new file mode 100644 index 00000000..2a8225b7 --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/ivy.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + diff --git a/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/ivy.xml.MD5 b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/ivy.xml.MD5 new file mode 100644 index 00000000..34e7e1e9 --- /dev/null +++ b/liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/ivy.xml.MD5 @@ -0,0 +1 @@ +5cc166f15f8f11b9ca7581e8a8ee4066