Salvatore La Manna 4 anni fa
parent
commit
14d32c55d8
  1. 2
      liferay-plugins-sdk-6.2/build.portos.properties
  2. BIN
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/sync-web-service.jar
  3. 212
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/AllegatiUtil.java
  4. 2
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SismicaUtil.java
  5. 790
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SvuotaDatabase.java
  6. 3
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/portlet/SismicaAdministrationPortlet.java
  7. 9
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/AsseverazioneLocalServiceImpl.java
  8. 2
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DelegaLocalServiceImpl.java
  9. 36
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DettPraticaLocalServiceImpl.java
  10. 5
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/DocPraticaLocalServiceImpl.java
  11. 12
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/PagamentoLocalServiceImpl.java
  12. 6
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/bo/service/impl/SoggettoLocalServiceImpl.java
  13. 4
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties
  14. 3
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/gestionefirme/avvisi_da_firmare.jsp
  15. 9
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/sismica_administration/view.jsp
  16. 6
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/ivy.xml
  17. 2
      liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/ivy.xml.MD5
  18. 4
      liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/.settings/org.eclipse.wst.common.component
  19. 1
      liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/.classpath
  20. 1
      liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/.project
  21. BIN
      liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/commons-codec.jar
  22. 0
      liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/httpclient.jar
  23. 0
      liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/httpcore.jar
  24. 0
      liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/httpmime.jar
  25. BIN
      liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/jackson-annotations.jar
  26. 0
      liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/jackson-core.jar
  27. 0
      liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/jackson-databind.jar
  28. 4
      liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/ivy.xml
  29. 2
      liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/ivy.xml.MD5
  30. 1
      liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/.classpath
  31. 1
      liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/.settings/org.eclipse.wst.common.component
  32. 7
      liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/mailmanager/service/impl/EmailAttachmentLocalServiceImpl.java
  33. 1
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/.classpath
  34. 1
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/.project
  35. BIN
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/commons-logging.jar
  36. BIN
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/jstl-api.jar
  37. BIN
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/jstl-impl.jar
  38. BIN
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/log4j.jar
  39. BIN
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/util-bridges.jar
  40. BIN
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/util-taglib.jar
  41. 2
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/content/Language.properties
  42. 100
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/action/MaintenancePreServletControl.java
  43. 30
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/action/MaintenanceStartAction.java
  44. 16
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/control/MantenanceControlPanelEntry.java
  45. 117
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/messaging/MaintenanceScheduleMessageListener.java
  46. 129
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/portlet/AdminMaintenancePortlet.java
  47. 65
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/portlet/MaintenancePollerPortlet.java
  48. 342
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/service/impl/MaintenanceScheduleLocalServiceImpl.java
  49. 75
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/service/impl/MaintenanceScheduleServiceImpl.java
  50. 380
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/servlet/MaintenanceServlet.java
  51. 62
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/util/DateTimeUtil.java
  52. 177
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/util/MaintenanceConstants.java
  53. 22
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/util/MaintenanceDateUtil.java
  54. 39
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/util/PortalMaintenanceUtil.java
  55. 4
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/service.properties
  56. 572
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/tld/c.tld
  57. 20
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/ivy.xml
  58. 1
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/ivy.xml.MD5

2
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.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.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 app.server.parent.dir = /home/portos/bin/liferay-portal-6.2-ce-ga6

BIN
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/lib/sync-web-service.jar

File binario non mostrato.

212
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; 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.DettPratica;
import it.tref.liferay.portos.bo.model.DocPratica; import it.tref.liferay.portos.bo.model.DocPratica;
import it.tref.liferay.portos.bo.model.FineLavori;
import it.tref.liferay.portos.bo.model.IntPratica; import it.tref.liferay.portos.bo.model.IntPratica;
import it.tref.liferay.portos.bo.model.Pagamento; import it.tref.liferay.portos.bo.model.Pagamento;
import it.tref.liferay.portos.bo.model.Soggetto; 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.DocPraticaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.PagamentoLocalServiceUtil; import it.tref.liferay.portos.bo.service.PagamentoLocalServiceUtil;
import it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil; 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.FirmeBean;
import it.tref.liferay.portos.bo.shared.bean.FirmeDetail; 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.ConfigurazioneConstants;
import it.tref.liferay.portos.bo.shared.util.DocumentiPraticaUtil; 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.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.PraticaUtil;
import it.tref.liferay.portos.bo.util.ValidazionePraticaUtil; import it.tref.liferay.portos.bo.util.ValidazionePraticaUtil;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date; import java.util.Date;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; 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.log.LogFactoryUtil;
import com.liferay.portal.kernel.repository.model.FileEntry; import com.liferay.portal.kernel.repository.model.FileEntry;
import com.liferay.portal.kernel.repository.model.Folder; 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.upload.UploadPortletRequest;
import com.liferay.portal.kernel.util.FileUtil; import com.liferay.portal.kernel.util.FileUtil;
import com.liferay.portal.kernel.util.MimeTypesUtil; 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.model.User;
import com.liferay.portal.security.permission.ActionKeys; import com.liferay.portal.security.permission.ActionKeys;
import com.liferay.portal.service.ServiceContext; import com.liferay.portal.service.ServiceContext;
import com.liferay.portal.service.ServiceContextFactory;
import com.liferay.portal.service.UserLocalServiceUtil; import com.liferay.portal.service.UserLocalServiceUtil;
import com.liferay.portal.util.PortalUtil; import com.liferay.portal.util.PortalUtil;
import com.liferay.portlet.documentlibrary.NoSuchFolderException; import com.liferay.portlet.documentlibrary.NoSuchFolderException;
@ -280,208 +272,4 @@ public class AllegatiUtil {
} }
return fileEntry; 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<Soggetto> soggettiValidi = SoggettoServiceUtil.getValidTmpByIntPratica(intPraticaId);
List<String> codiciFiscaliValidi = new ArrayList<String>();
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;
}
}
} }

2
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.OrderByComparatorFactoryUtil;
import com.liferay.portal.kernel.util.ParamUtil; import com.liferay.portal.kernel.util.ParamUtil;
import com.liferay.portal.kernel.util.StringPool; 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.Validator;
import com.liferay.portal.kernel.util.WebKeys; import com.liferay.portal.kernel.util.WebKeys;
import com.liferay.portal.kernel.workflow.WorkflowException; import com.liferay.portal.kernel.workflow.WorkflowException;
@ -118,6 +119,7 @@ public class SismicaUtil {
private final static int SLICE = 1000; private final static int SLICE = 1000;
public static Date[] getWeekInterval(int dow) { public static Date[] getWeekInterval(int dow) {
ThreadUtil.threadDump();
return getWeekInterval(dow, Calendar.getInstance().getTime()); return getWeekInterval(dow, Calendar.getInstance().getTime());
} }

790
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/it/mwg/sismica/bo/util/SvuotaDatabase.java

File diff soppresso perché troppo grande Load Diff

3
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) public void testInterno(ActionRequest actionRequest, ActionResponse actionResponse)
throws PortalException, SystemException { throws PortalException, SystemException {
String mode = ParamUtil.getString(actionRequest, "mode");
ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest); ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest);
List<String> esito = SvuotaDatabase.pulisci(serviceContext); List<String> esito = SvuotaDatabase.pulisci(serviceContext, mode);
actionResponse.setRenderParameter("esito", esito.toArray(new String[esito.size()])); actionResponse.setRenderParameter("esito", esito.toArray(new String[esito.size()]));
} }

9
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 @Override
public Asseverazione deleteAsseverazione(Asseverazione asseverazione) throws SystemException { public Asseverazione deleteAsseverazione(Asseverazione asseverazione) throws SystemException {
try { if (Validator.isNotNull(asseverazione.getFileEntryId())) {
if (Validator.isNotNull(asseverazione.getFileEntryId())) { try {
dlAppLocalService.deleteFileEntry(asseverazione.getFileEntryId()); dlAppLocalService.deleteFileEntry(asseverazione.getFileEntryId());
} catch (PortalException e) {
} }
} catch (NoSuchFileEntryException | NoSuchRepositoryEntryException e) {
} catch (PortalException e) {
throw new SystemException(e);
} }
return super.deleteAsseverazione(asseverazione); return super.deleteAsseverazione(asseverazione);
} }

2
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 @Override
public Delega deleteDelega(Delega delega) throws SystemException { public Delega deleteDelega(Delega delega) throws SystemException {
// TODO cancellare il file quando ci sar�
return super.deleteDelega(delega); return super.deleteDelega(delega);
} }

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

@ -284,8 +284,8 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl
dettPraticaToClone.getNormLTC01(), dettPraticaToClone.getSuap(), dettPraticaToClone.getNormLTC01(), dettPraticaToClone.getSuap(),
dettPraticaToClone.getNormSismaBonus(), dettPraticaToClone.getClRischioPreInt(), dettPraticaToClone.getNormSismaBonus(), dettPraticaToClone.getClRischioPreInt(),
dettPraticaToClone.getClRischioPostInt(), dettPraticaToClone.getIntervFinPub(), dettPraticaToClone.getClRischioPostInt(), dettPraticaToClone.getIntervFinPub(),
dettPraticaToClone.getIntervFinPubDesc(), dettPraticaToClone.getTcNuovaCostruzioneComplessa(), dettPraticaToClone.getIntervFinPubDesc(),
serviceContext, true); dettPraticaToClone.getTcNuovaCostruzioneComplessa(), serviceContext, true);
copy = updateDettPraticaGeologo(copy.getUserId(), copy.getDettPraticaId(), copy.getIntPraticaId(), copy = updateDettPraticaGeologo(copy.getUserId(), copy.getDettPraticaId(), copy.getIntPraticaId(),
dettPraticaToClone.getGeoClasseIndagine(), dettPraticaToClone.getGeoCategoriaSottosuolo(), dettPraticaToClone.getGeoClasseIndagine(), dettPraticaToClone.getGeoCategoriaSottosuolo(),
@ -554,7 +554,10 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl
List<Soggetto> soggetti = soggettoLocalService.findByDettPratica(dettPratica.getDettPraticaId()); List<Soggetto> soggetti = soggettoLocalService.findByDettPratica(dettPratica.getDettPraticaId());
for (Soggetto soggetto : soggetti) { for (Soggetto soggetto : soggetti) {
soggettoLocalService.deleteSoggetto(soggetto); try {
soggettoLocalService.deleteSoggetto(soggetto);
} catch (PortalException e) {
}
} }
List<DocPratica> allegati = docPraticaLocalService.findByClassPk(dettPratica.getDettPraticaId()); List<DocPratica> allegati = docPraticaLocalService.findByClassPk(dettPratica.getDettPraticaId());
@ -576,7 +579,10 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl
List<Pagamento> pagamenti = pagamentoLocalService.findByClassPk(dettPratica.getDettPraticaId()); List<Pagamento> pagamenti = pagamentoLocalService.findByClassPk(dettPratica.getDettPraticaId());
for (Pagamento pagamento : pagamenti) { for (Pagamento pagamento : pagamenti) {
pagamentoLocalService.deletePagamento(pagamento); try {
pagamentoLocalService.deletePagamento(pagamento);
} catch (PortalException e) {
}
} }
return super.deleteDettPratica(dettPratica); return super.deleteDettPratica(dettPratica);
} }
@ -716,8 +722,9 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl
boolean normDprg01, boolean normDprg02, boolean normAnr, boolean normArt3com3, boolean normDprg01, boolean normDprg02, boolean normAnr, boolean normArt3com3,
boolean normArt3com4, boolean normOrd01, boolean normDm04, boolean normDm05, boolean normCI01, boolean normArt3com4, boolean normOrd01, boolean normDm04, boolean normDm05, boolean normCI01,
boolean normLTC01, boolean suap, boolean normSismaBonus, String clRischioPreInt, boolean normLTC01, boolean suap, boolean normSismaBonus, String clRischioPreInt,
String clRischioPostInt, boolean intervFinPub, String intervFinPubDesc, boolean tcNuovaCostruzioneComplessa, String clRischioPostInt, boolean intervFinPub, String intervFinPubDesc,
ServiceContext serviceContext, boolean bozza) throws PortalException, SystemException { boolean tcNuovaCostruzioneComplessa, ServiceContext serviceContext, boolean bozza)
throws PortalException, SystemException {
Date now = new Date(); Date now = new Date();
@ -772,7 +779,8 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl
normEsenteSpese, normDpr01Dep, normDpr02Dep, normDpr01Aut, normDpr02Aut, normDm01, normDm02, normEsenteSpese, normDpr01Dep, normDpr02Dep, normDpr01Aut, normDpr02Aut, normDm01, normDm02,
normDm03, normDm2018, normDprg01, normDprg02, normAnr, normArt3com3, normArt3com4, normOrd01, normDm03, normDm2018, normDprg01, normDprg02, normAnr, normArt3com3, normArt3com4, normOrd01,
normDm04, normDm05, normCI01, normLTC01, suap, normSismaBonus, clRischioPreInt, normDm04, normDm05, normCI01, normLTC01, suap, normSismaBonus, clRischioPreInt,
clRischioPostInt, intervFinPub, intervFinPubDesc, tcNuovaCostruzioneComplessa, serviceContext, bozza); clRischioPostInt, intervFinPub, intervFinPubDesc, tcNuovaCostruzioneComplessa,
serviceContext, bozza);
DettPratica dettPratica = dettPraticaPersistence.fetchByPrimaryKey(dettPraticaId); DettPratica dettPratica = dettPraticaPersistence.fetchByPrimaryKey(dettPraticaId);
@ -1041,8 +1049,8 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl
boolean normDprg02, boolean normAnr, boolean normArt3com3, boolean normArt3com4, boolean normDprg02, boolean normAnr, boolean normArt3com3, boolean normArt3com4,
boolean normOrd01, boolean normDm04, boolean normDm05, boolean normCI01, boolean normLTC01, boolean normOrd01, boolean normDm04, boolean normDm05, boolean normCI01, boolean normLTC01,
boolean suap, boolean normSismaBonus, String clRischioPreInt, String clRischioPostInt, boolean suap, boolean normSismaBonus, String clRischioPreInt, String clRischioPostInt,
boolean intervFinPub, String intervFinPubDesc, boolean tcNuovaCostruzioneComplessa, ServiceContext serviceContext, boolean bozza) boolean intervFinPub, String intervFinPubDesc, boolean tcNuovaCostruzioneComplessa,
throws PortalException, SystemException { ServiceContext serviceContext, boolean bozza) throws PortalException, SystemException {
Date now = new Date(); Date now = new Date();
@ -1076,7 +1084,8 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl
normEsenteSpese, normDpr01Dep, normDpr02Dep, normDpr01Aut, normDpr02Aut, normDm01, normDm02, normEsenteSpese, normDpr01Dep, normDpr02Dep, normDpr01Aut, normDpr02Aut, normDm01, normDm02,
normDm03, normDm2018, normDprg01, normDprg02, normAnr, normArt3com3, normArt3com4, normOrd01, normDm03, normDm2018, normDprg01, normDprg02, normAnr, normArt3com3, normArt3com4, normOrd01,
normDm04, normDm05, normCI01, normLTC01, suap, normSismaBonus, clRischioPreInt, normDm04, normDm05, normCI01, normLTC01, suap, normSismaBonus, clRischioPreInt,
clRischioPostInt, intervFinPub, intervFinPubDesc, tcNuovaCostruzioneComplessa, serviceContext, bozza); clRischioPostInt, intervFinPub, intervFinPubDesc, tcNuovaCostruzioneComplessa,
serviceContext, bozza);
DettPratica dettPratica = dettPraticaPersistence.fetchByPrimaryKey(dettPraticaId); DettPratica dettPratica = dettPraticaPersistence.fetchByPrimaryKey(dettPraticaId);
@ -1281,7 +1290,8 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl
boolean normDprg02, boolean normAnr, boolean normArt3com3, boolean normArt3com4, boolean normDprg02, boolean normAnr, boolean normArt3com3, boolean normArt3com4,
boolean normOrd01, boolean normDm04, boolean normDm05, boolean normCI01, boolean normLTC01, boolean normOrd01, boolean normDm04, boolean normDm05, boolean normCI01, boolean normLTC01,
boolean suap, boolean normSismaBonus, String clRischioPreInt, String clRischioPostInt, 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 // TODO Auto-generated method stub
@ -1745,8 +1755,8 @@ public class DettPraticaLocalServiceImpl extends DettPraticaLocalServiceBaseImpl
boolean normDprg01, boolean normDprg02, boolean normAnr, boolean normArt3com3, boolean normDprg01, boolean normDprg02, boolean normAnr, boolean normArt3com3,
boolean normArt3com4, boolean normOrd01, boolean normDm04, boolean normDm05, boolean normCI01, boolean normArt3com4, boolean normOrd01, boolean normDm04, boolean normDm05, boolean normCI01,
boolean normLTC01, boolean suap, boolean normSismaBonus, String clRischioPreInt, boolean normLTC01, boolean suap, boolean normSismaBonus, String clRischioPreInt,
String clRischioPostInt, boolean intervFinPub, String intervFinPubDesc, boolean tcNuovaCostruzioneComplessa, String clRischioPostInt, boolean intervFinPub, String intervFinPubDesc,
ServiceContext serviceContext, boolean bozza) { boolean tcNuovaCostruzioneComplessa, ServiceContext serviceContext, boolean bozza) {
// TODO Auto-generated method stub // TODO Auto-generated method stub

5
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.Date;
import java.util.List; import java.util.List;
import com.liferay.portal.NoSuchRepositoryEntryException;
import com.liferay.portal.kernel.dao.orm.DynamicQuery; import com.liferay.portal.kernel.dao.orm.DynamicQuery;
import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil; import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
import com.liferay.portal.kernel.dao.orm.Junction; 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.RoleLocalServiceUtil;
import com.liferay.portal.service.ServiceContext; import com.liferay.portal.service.ServiceContext;
import com.liferay.portal.service.UserLocalServiceUtil; import com.liferay.portal.service.UserLocalServiceUtil;
import com.liferay.portlet.documentlibrary.NoSuchFileEntryException;
import com.liferay.portlet.documentlibrary.NoSuchFolderException; import com.liferay.portlet.documentlibrary.NoSuchFolderException;
/** /**
@ -84,10 +82,7 @@ public class DocPraticaLocalServiceImpl extends DocPraticaLocalServiceBaseImpl {
if (Validator.isNotNull(docPratica.getDlFileEntryId())) { if (Validator.isNotNull(docPratica.getDlFileEntryId())) {
dlAppLocalService.deleteFileEntry(docPratica.getDlFileEntryId()); dlAppLocalService.deleteFileEntry(docPratica.getDlFileEntryId());
} }
} catch (NoSuchFileEntryException | NoSuchRepositoryEntryException e) {
} catch (PortalException e) { } catch (PortalException e) {
throw new SystemException(e);
} }
return super.deleteDocPratica(docPratica); return super.deleteDocPratica(docPratica);
} }

12
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 @Override
public Pagamento deletePagamento(long pagamentoId) throws PortalException, SystemException { public Pagamento deletePagamento(long pagamentoId) throws PortalException, SystemException {
return deletePagamento(pagamentoLocalService.getPagamento(pagamentoId));
Pagamento pagamento = super.deletePagamento(pagamentoId);
DLAppLocalServiceUtil.deleteFileEntry(pagamento.getFileEntryId());
deleteDettPraticaPagamento(pagamento);
return pagamento;
} }
@Override @Override
public Pagamento deletePagamento(Pagamento pagamento) throws PortalException, SystemException { public Pagamento deletePagamento(Pagamento pagamento) throws PortalException, SystemException {
pagamento = super.deletePagamento(pagamento);
if (Validator.isNotNull(pagamento.getFileEntryId())) { if (Validator.isNotNull(pagamento.getFileEntryId())) {
try { try {
DLAppLocalServiceUtil.deleteFileEntry(pagamento.getFileEntryId()); DLAppLocalServiceUtil.deleteFileEntry(pagamento.getFileEntryId());
} catch (PortalException | SystemException e) { } catch (PortalException e) {
_log.info("L'allegato del pagamento " + pagamento.getPagamentoId() + " non esisteva.");
} }
} }
if (DettPratica.class.getName().equalsIgnoreCase(pagamento.getClassName())) { if (DettPratica.class.getName().equalsIgnoreCase(pagamento.getClassName())) {
deleteDettPraticaPagamento(pagamento); deleteDettPraticaPagamento(pagamento);
} }
return pagamento; return super.deletePagamento(pagamento);
} }
public Pagamento updateEmailPendingPagamento(long pagamentoId, boolean emailPending) public Pagamento updateEmailPendingPagamento(long pagamentoId, boolean emailPending)

6
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; 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.DettPratica;
import it.tref.liferay.portos.bo.model.DocPratica; import it.tref.liferay.portos.bo.model.DocPratica;
import it.tref.liferay.portos.bo.model.Soggetto; 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.Date;
import java.util.List; import java.util.List;
import com.liferay.portal.NoSuchRepositoryEntryException;
import com.liferay.portal.kernel.dao.orm.Disjunction; import com.liferay.portal.kernel.dao.orm.Disjunction;
import com.liferay.portal.kernel.dao.orm.DynamicQuery; import com.liferay.portal.kernel.dao.orm.DynamicQuery;
import com.liferay.portal.kernel.dao.orm.OrderFactoryUtil; 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.kernel.util.Validator;
import com.liferay.portal.model.User; import com.liferay.portal.model.User;
import com.liferay.portal.service.ServiceContext; import com.liferay.portal.service.ServiceContext;
import com.liferay.portlet.documentlibrary.NoSuchFileEntryException;
/** /**
* The implementation of the soggetto local service. * The implementation of the soggetto local service.
@ -419,8 +416,7 @@ public class SoggettoLocalServiceImpl extends SoggettoLocalServiceBaseImpl {
if (Validator.isNotNull(soggetto.getFileVariazioneId())) { if (Validator.isNotNull(soggetto.getFileVariazioneId())) {
docPraticaLocalService.deleteDocPratica(soggetto.getFileVariazioneId()); docPraticaLocalService.deleteDocPratica(soggetto.getFileVariazioneId());
} }
} catch (NoSuchFileEntryException | NoSuchRepositoryEntryException | NoSuchDocPraticaException e) { } catch (PortalException e) {
} }
return super.deleteSoggetto(soggetto); return super.deleteSoggetto(soggetto);
} }

4
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/src/service.properties

@ -13,8 +13,8 @@
## ##
build.namespace=portos_bo build.namespace=portos_bo
build.number=2518 build.number=2519
build.date=1604412381894 build.date=1604417083352
build.auto.upgrade=true build.auto.upgrade=true
## ##

3
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.service.GroupLocalServiceUtil"%>
<%@page import="com.liferay.portal.util.comparator.GroupIdComparator"%> <%@page import="com.liferay.portal.util.comparator.GroupIdComparator"%>
<%@page import="com.liferay.portal.kernel.util.ArrayUtil"%> <%@page import="com.liferay.portal.kernel.util.ArrayUtil"%>

9
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/html/sismica_administration/view.jsp

@ -100,10 +100,11 @@ String dataProssimoSorteggio =
<liferay-portlet:actionURL name="generaDocumenti" var="generaDocumentiURL" /> <liferay-portlet:actionURL name="generaDocumenti" var="generaDocumentiURL" />
<div class="row-fluid" style="margin-top: 10px;"> <div class="row-fluid" style="margin-top: 10px;">
<div class="span6"> <div class="span6">
<div style="font-weight: bold; font-size: 18px; margin-bottom: 10px;">Test Interno</div> <div style="font-weight: bold; font-size: 18px; margin-bottom: 10px;">Manutenzione database</div>
<aui:form action="<%=testInternoURL%>" method="post" name="fmTI"> <aui:form action="<%=testInternoURL%>" method="post" name="fmTI">
<div> <div>
<aui:button cssClass="btn-danger" type="submit" value="Avvia test" /> <aui:input name="mode" label="Modalità" />
<aui:button cssClass="btn-danger" type="submit" value="Avvia manutenzione" />
</div> </div>
</aui:form> </aui:form>
</div> </div>
@ -134,7 +135,7 @@ String dataProssimoSorteggio =
</div> </div>
<% <%
String tipoAvviso = ParamUtil.getString(renderRequest, "tipoAvviso", ""); String tipoAvviso = ParamUtil.getString(renderRequest, "tipoAvviso", "");
String numeroProgetto = ParamUtil.getString(renderRequest, "numeroProgetto", ""); String numeroProgetto = ParamUtil.getString(renderRequest, "numeroProgetto", "");
%> %>
<div class="span6"> <div class="span6">
<div style="font-weight: bold; font-size: 18px; margin-bottom: 10px;">Invia avviso</div> <div style="font-weight: bold; font-size: 18px; margin-bottom: 10px;">Invia avviso</div>
@ -184,7 +185,7 @@ String dataProssimoSorteggio =
value="<%=Soggetto.class.getName()%>"></aui:option> value="<%=Soggetto.class.getName()%>"></aui:option>
</aui:select> </aui:select>
<aui:input type="file" name="file" label="File" /> <aui:input type="file" name="file" label="File" />
<aui:input name="classPK" label="Id oggetto" value="<%=classPK > 0 ? classPK : \"\"%>"> <aui:input name="classPK" label="Id oggetto" value="<%=classPK > 0 ? classPK :\"\"%>">
<aui:validator name="number" /> <aui:validator name="number" />
</aui:input> </aui:input>
<aui:button type="submit" value="Sostituisci file in DL" /> <aui:button type="submit" value="Sostituisci file in DL" />

6
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/ivy.xml

@ -11,9 +11,9 @@
</info> </info>
<dependencies defaultconf="default"> <dependencies defaultconf="default">
<dependency conf="test->default" name="arquillian-junit-container" org="org.jboss.arquillian.junit" rev="1.1.6.Final" /> <dependency conf="test->default" name="arquillian-junit-container" org="org.jboss.arquillian.junit" rev="1.1.6.Final"/>
<dependency conf="test->default" name="arquillian-tomcat-remote-7" org="org.jboss.arquillian.container" rev="1.0.0.CR6" /> <dependency conf="test->default" name="arquillian-tomcat-remote-7" org="org.jboss.arquillian.container" rev="1.0.0.CR6"/>
<dependency conf="test->default" name="com.liferay.ant.arquillian" org="com.liferay" rev="1.0.0" /> <dependency conf="test->default" name="com.liferay.ant.arquillian" org="com.liferay" rev="1.0.0"/>
<dependency name="commons-codec" org="commons-codec" rev="1.10"/> <dependency name="commons-codec" org="commons-codec" rev="1.10"/>
<dependency name="commons-csv" org="org.apache.commons" rev="1.4"/> <dependency name="commons-csv" org="org.apache.commons" rev="1.4"/>

2
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/ivy.xml.MD5

@ -1 +1 @@
291fbe4be1f094ebfa7c95b6381ba6af 29bdb5e74c39965a8db63e99d25a27ab

4
liferay-plugins-sdk-6.2/portlets/portos-fe-portlet/.settings/org.eclipse.wst.common.component

@ -2,10 +2,10 @@
<wb-module deploy-name="portos-fe-portlet"> <wb-module deploy-name="portos-fe-portlet">
<wb-resource deploy-path="/" source-path="/docroot" tag="defaultRootSource"/> <wb-resource deploy-path="/" source-path="/docroot" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/docroot/WEB-INF/src"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/docroot/WEB-INF/src"/>
<dependent-module archiveName="hms-taglib-hook-service.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/lib/hms-taglib-hook/docroot/WEB-INF/lib/hms-taglib-hook-service.jar"> <dependent-module archiveName="portos-bo-portlet-service.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/lib/portos-bo-portlet/docroot/WEB-INF/lib/portos-bo-portlet-service.jar">
<dependency-type>uses</dependency-type> <dependency-type>uses</dependency-type>
</dependent-module> </dependent-module>
<dependent-module archiveName="portos-bo-portlet-service.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/lib/portos-bo-portlet/docroot/WEB-INF/lib/portos-bo-portlet-service.jar"> <dependent-module archiveName="hms-taglib-hook-service.jar" deploy-path="/WEB-INF/lib" handle="module:/classpath/lib/hms-taglib-hook/docroot/WEB-INF/lib/hms-taglib-hook-service.jar">
<dependency-type>uses</dependency-type> <dependency-type>uses</dependency-type>
</dependent-module> </dependent-module>
<property name="context-root" value="portos-fe-portlet"/> <property name="context-root" value="portos-fe-portlet"/>

1
liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/.classpath

@ -18,5 +18,6 @@
<attribute name="org.eclipse.jst.component.nondependency" value=""/> <attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="con" path="org.apache.ivyde.eclipse.cpcontainer.IVYDE_CONTAINER/?project=portos-firma-portlet&amp;ivyXmlPath=ivy.xml&amp;confs=*"/>
<classpathentry kind="output" path="docroot/WEB-INF/classes"/> <classpathentry kind="output" path="docroot/WEB-INF/classes"/>
</classpath> </classpath>

1
liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/.project

@ -32,5 +32,6 @@
<nature>org.eclipse.wst.common.project.facet.core.nature</nature> <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature> <nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature> <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
<nature>org.apache.ivyde.eclipse.ivynature</nature>
</natures> </natures>
</projectDescription> </projectDescription>

BIN
liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/commons-codec.jar

File binario non mostrato.

0
liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/httpclient-4.5.3.jar → liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/httpclient.jar

0
liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/httpcore-4.4.6.jar → liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/httpcore.jar

0
liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/httpmime-4.5.3.jar → liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/httpmime.jar

BIN
liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/jackson-annotations-2.8.7.jar → liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/jackson-annotations.jar

File binario non mostrato.

0
liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/jackson-core-2.8.7.jar → liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/jackson-core.jar

0
liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/jackson-databind-2.8.7.jar → liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/docroot/WEB-INF/lib/jackson-databind.jar

4
liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/ivy.xml

@ -14,5 +14,9 @@
<dependency conf="test->default" name="arquillian-junit-container" org="org.jboss.arquillian.junit" rev="1.1.6.Final" /> <dependency conf="test->default" name="arquillian-junit-container" org="org.jboss.arquillian.junit" rev="1.1.6.Final" />
<dependency conf="test->default" name="arquillian-tomcat-remote-7" org="org.jboss.arquillian.container" rev="1.0.0.CR6" /> <dependency conf="test->default" name="arquillian-tomcat-remote-7" org="org.jboss.arquillian.container" rev="1.0.0.CR6" />
<dependency conf="test->default" name="com.liferay.ant.arquillian" org="com.liferay" rev="1.0.0" /> <dependency conf="test->default" name="com.liferay.ant.arquillian" org="com.liferay" rev="1.0.0" />
<dependency name="httpclient" org="org.apache.httpcomponents" rev="4.5.3"/>
<dependency name="httpmime" org="org.apache.httpcomponents" rev="4.5.3"/>
<dependency name="jackson-databind" org="com.fasterxml.jackson.core" rev="2.8.7"/>
</dependencies> </dependencies>
</ivy-module> </ivy-module>

2
liferay-plugins-sdk-6.2/portlets/portos-firma-portlet/ivy.xml.MD5

@ -1 +1 @@
5ce14a43480763a02a7a0f47d7f82801 a15636541520cd34beccb182ca342eb1

1
liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/.classpath

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" path="docroot/WEB-INF/src"/> <classpathentry kind="src" path="docroot/WEB-INF/src"/>
<classpathentry kind="src" path="docroot/WEB-INF/service"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.7.0_80"> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.7.0_80">
<attributes> <attributes>
<attribute name="owner.project.facets" value="java"/> <attribute name="owner.project.facets" value="java"/>

1
liferay-plugins-sdk-6.2/portlets/portos-mail-manager-portlet/.settings/org.eclipse.wst.common.component

@ -2,6 +2,7 @@
<wb-module deploy-name="portos-mail-manager-portlet"> <wb-module deploy-name="portos-mail-manager-portlet">
<wb-resource deploy-path="/" source-path="/docroot" tag="defaultRootSource"/> <wb-resource deploy-path="/" source-path="/docroot" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/docroot/WEB-INF/src"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/docroot/WEB-INF/src"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/docroot/WEB-INF/service"/>
<property name="context-root" value="portos-mail-manager-portlet"/> <property name="context-root" value="portos-mail-manager-portlet"/>
<property name="java-output-path" value="/portos-mail-manager-portlet/docroot/WEB-INF/classes"/> <property name="java-output-path" value="/portos-mail-manager-portlet/docroot/WEB-INF/classes"/>
</wb-module> </wb-module>

7
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 @Override
public EmailAttachment deleteEmailAttachment(EmailAttachment emailAttachment) throws SystemException { public EmailAttachment deleteEmailAttachment(EmailAttachment emailAttachment) throws SystemException {
super.deleteEmailAttachment(emailAttachment);
// File Entry
try { try {
dlAppLocalService.deleteFileEntry(emailAttachment.getFileEntryId()); dlAppLocalService.deleteFileEntry(emailAttachment.getFileEntryId());
} catch (PortalException e) { } catch (PortalException e) {
} }
super.deleteEmailAttachment(emailAttachment);
return emailAttachment; return emailAttachment;
} }

1
liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/.classpath

@ -18,5 +18,6 @@
<attribute name="org.eclipse.jst.component.nondependency" value=""/> <attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="con" path="org.apache.ivyde.eclipse.cpcontainer.IVYDE_CONTAINER/?project=portos-maintenance-portlet&amp;ivyXmlPath=ivy.xml&amp;confs=*"/>
<classpathentry kind="output" path="docroot/WEB-INF/classes"/> <classpathentry kind="output" path="docroot/WEB-INF/classes"/>
</classpath> </classpath>

1
liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/.project

@ -32,5 +32,6 @@
<nature>org.eclipse.wst.common.project.facet.core.nature</nature> <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature> <nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature> <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
<nature>org.apache.ivyde.eclipse.ivynature</nature>
</natures> </natures>
</projectDescription> </projectDescription>

BIN
liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/commons-logging.jar

File binario non mostrato.

BIN
liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/jstl-api.jar

File binario non mostrato.

BIN
liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/jstl-impl.jar

File binario non mostrato.

BIN
liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/log4j.jar

File binario non mostrato.

BIN
liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/util-bridges.jar

File binario non mostrato.

BIN
liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/lib/util-taglib.jar

File binario non mostrato.

2
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 ## 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 message-help = Messaggio da visualizzare nella finestra di manutenzione
maintenance-schedule-id=Id maintenance-schedule-id=Id

100
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 { 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 @Override
public void run(HttpServletRequest request, HttpServletResponse response) throws ActionException { 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<MaintenanceSchedule> maintenanceSchedules = List<MaintenanceSchedule> maintenanceSchedules = MaintenanceScheduleLocalServiceUtil
MaintenanceScheduleLocalServiceUtil.findByStatus(MaintenanceStatus.IN_PROGRESS.getCode()); .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"); response.sendRedirect("/html/portal/maintenance.jsp");
throw new ActionException("Maintenance mode active"); 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) // Se request per portlet non consentite (LOGIN)
if (!ArrayUtil.contains(allowedPortlets, ParamUtil.getString(request, "p_p_id"))) { if (!ArrayUtil.contains(allowedPortlets, ParamUtil.getString(request, "p_p_id"))) {
if (user.isDefaultUser()) {// Se non loggato if (user.isDefaultUser()) {// Se non loggato
response.sendRedirect(getLoginUrlRedirect(request)); response.sendRedirect(getLoginUrlRedirect(request));
throw new ActionException("Maintenance mode active"); throw new ActionException("Maintenance mode active");
} else if (!PortalUtil.isCompanyAdmin(user)) {// Se non admin } else if (!PortalUtil.isCompanyAdmin(user)) {// Se non
response.sendRedirect("/html/portal/maintenance.jsp"); // admin
throw new ActionException("Maintenance mode active"); response.sendRedirect("/html/portal/maintenance.jsp");
} throw new ActionException("Maintenance mode active");
} else { }
if (!user.isDefaultUser() && !PortalUtil.isCompanyAdmin(user)) {// Se loggato non admin } else {
response.sendRedirect("/html/portal/maintenance.jsp"); if (!user.isDefaultUser() && !PortalUtil.isCompanyAdmin(user)) {// Se
throw new ActionException("Maintenance mode active"); // loggato
} // non
} // admin
} response.sendRedirect("/html/portal/maintenance.jsp");
throw new ActionException("Maintenance mode active");
}
}
}
} }
} catch (Exception e) { } catch (Exception e) {
_log.error(e); _log.error(e);
} }
} }
private String getLoginUrlRedirect(HttpServletRequest request) { private String getLoginUrlRedirect(HttpServletRequest request) {
if (loginUrlRedirect == null) { if (loginUrlRedirect == null) {
loginUrlRedirect = PortalUtil.getPortalURL(request); loginUrlRedirect = PortalUtil.getPortalURL(request);
loginUrlRedirect = HttpUtil.addParameter(loginUrlRedirect, "p_p_id", PortletKeys.LOGIN); 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_state",
loginUrlRedirect = HttpUtil.addParameter(loginUrlRedirect, "p_p_lifecycle", "0"); WindowState.MAXIMIZED.toString());
} loginUrlRedirect = HttpUtil.addParameter(loginUrlRedirect, "p_p_lifecycle", "0");
}
return loginUrlRedirect; return loginUrlRedirect;
} }
} }

30
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 { public class MaintenanceStartAction extends SimpleAction {
private static final Log _log = LogFactoryUtil.getLog(MaintenanceStartAction.class); private static final Log _log = LogFactoryUtil.getLog(MaintenanceStartAction.class);
@Override @Override
public void run(String[] ids) throws ActionException { public void run(String[] ids) throws ActionException {
try { try {
List<MaintenanceSchedule> maintenanceSchedules = List<MaintenanceSchedule> maintenanceSchedules = MaintenanceScheduleLocalServiceUtil
MaintenanceScheduleLocalServiceUtil.findByCompleted_Onreboot(Boolean.FALSE, .findByCompleted_Onreboot(Boolean.FALSE, MaintenanceOnReboot.TERMINATE.getCode());
MaintenanceOnReboot.TERMINATE.getCode());
for (MaintenanceSchedule maintenanceSchedule : maintenanceSchedules) { for (MaintenanceSchedule maintenanceSchedule : maintenanceSchedules) {
MaintenanceScheduleLocalServiceUtil.updateStatus(maintenanceSchedule.getMaintenanceScheduleId(), MaintenanceScheduleLocalServiceUtil.updateStatus(
MaintenanceStatus.FORCE_ENDED.getCode(), "Ended for server reboot."); maintenanceSchedule.getMaintenanceScheduleId(),
} MaintenanceStatus.FORCE_ENDED.getCode(), "Ended for server reboot.");
}
} catch (Exception e) { } catch (Exception e) {
_log.error("Error updating maintenance settings after reboot.", e); _log.error("Error updating maintenance settings after reboot.", e);
} }
} }
} }

16
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 class MantenanceControlPanelEntry extends BaseControlPanelEntry {
public boolean hasAccessPermission(PermissionChecker permissionChecker, Group group, Portlet portlet) public boolean hasAccessPermission(PermissionChecker permissionChecker, Group group, Portlet portlet)
throws Exception { throws Exception {
long companyId = PortalUtil.getDefaultCompanyId(); long companyId = PortalUtil.getDefaultCompanyId();
if (companyId == permissionChecker.getCompanyId()) { if (companyId == permissionChecker.getCompanyId()) {
return true; return true;
} }
return false; return false;
} }
} }

117
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 { public class MaintenanceScheduleMessageListener implements MessageListener {
private static final Log _log = LogFactoryUtil.getLog(MaintenanceScheduleMessageListener.class); private static final Log _log = LogFactoryUtil.getLog(MaintenanceScheduleMessageListener.class);
@Override @Override
public void receive(Message message) throws MessageListenerException { public void receive(Message message) throws MessageListenerException {
if (_log.isDebugEnabled()) { if (_log.isDebugEnabled()) {
_log.debug("Inizio metodo receive. Begin: " + new SimpleDateFormat("hh:mm:ss").format(new Date())); _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 @Override
protected void addCriteria(DynamicQuery dynamicQuery) { protected void performAction(Object obj) throws PortalException, SystemException {
dynamicQuery.add(PropertyFactoryUtil.forName("completed").eq(false));
}
@Override MaintenanceSchedule maintenanceSchedule = (MaintenanceSchedule) obj;
protected void performAction(Object obj) throws PortalException, SystemException { try {
MaintenanceSchedule maintenanceSchedule = (MaintenanceSchedule) obj; MaintenanceStatus status = MaintenanceStatus.parse(maintenanceSchedule.getStatus());
try {
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()) { if (Validator.isNotNull(maintenanceSchedule.getAfter())
throw new SystemException("Concurrent maintenance scheduled."); && 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)) { } else {
MaintenanceScheduleLocalServiceUtil.updateStatus(maintenanceSchedule.getMaintenanceScheduleId(),
MaintenanceStatus.IN_PROGRESS.getCode());
}
} else { MaintenanceScheduleLocalServiceUtil.updateStatus(
maintenanceSchedule.getMaintenanceScheduleId(),
MaintenanceStatus.IN_PROGRESS.getCode());
}
MaintenanceScheduleLocalServiceUtil.updateStatus(maintenanceSchedule.getMaintenanceScheduleId(), } else if (status == MaintenanceStatus.IN_PROGRESS) {
MaintenanceStatus.IN_PROGRESS.getCode());
}
} 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(), } catch (Exception e) {
MaintenanceStatus.ENDED.getCode()); _log.error("MaintenaceMode error", e);
}
} MaintenanceScheduleLocalServiceUtil.updateStatus(
maintenanceSchedule.getMaintenanceScheduleId(),
MaintenanceStatus.ERROR.getCode(), e.getMessage());
}
}
};
long count = actionableDynamicQuery.performCount();
} catch (Exception e) { if (count > 0) {
_log.error("MaintenaceMode error", e); actionableDynamicQuery.performActions();
}
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);
}
}
} catch (Exception e) {
_log.error(e, e);
}
}
} }

129
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 { 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 = String className = LanguageUtil
LanguageUtil .get(LocaleUtil.getDefault(),
.get(LocaleUtil.getDefault(), "the-sign-in-process-is-temporarily-disabled-because-the-portal-is-undergoing-a-routine-maintenance-upgrade");
"the-sign-in-process-is-temporarily-disabled-because-the-portal-is-undergoing-a-routine-maintenance-upgrade");
if (Validator.isNotNull(message)) { if (Validator.isNotNull(message)) {
className = message; className = message;
} }
Class<?> clazz = Class<?> clazz = ClassResolverUtil.resolve("com.liferay.portal.util.MaintenanceUtil",
ClassResolverUtil.resolve("com.liferay.portal.util.MaintenanceUtil", PortalClassLoaderUtil.getClassLoader()); PortalClassLoaderUtil.getClassLoader());
ReflectionUtil.getDeclaredMethod(clazz, "maintain", String.class, String.class).invoke(null, ReflectionUtil.getDeclaredMethod(clazz, "maintain", String.class, String.class).invoke(null,
portletSession.getId(), className); 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 { ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest);
_log.info("deleteMaintenanceSchedule - Inizio metodo"); long maintenanceScheduleId = ParamUtil.getLong(actionRequest, "maintenanceScheduleId");
ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest); MaintenanceScheduleServiceUtil.deleteMaintenanceSchedule(maintenanceScheduleId, serviceContext);
long maintenanceScheduleId = ParamUtil.getLong(actionRequest, "maintenanceScheduleId");
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 { String cmd = ParamUtil.getString(actionRequest, Constants.CMD);
_log.info("editMaintenanceSchedule - Inizio metodo");
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"); Calendar calendarEnd = Calendar.getInstance();
String type = ParamUtil.getString(actionRequest, "type"); calendarEnd.set(ParamUtil.getInteger(actionRequest, "endYear"),
String reason = ParamUtil.getString(actionRequest, "reason"); ParamUtil.getInteger(actionRequest, "endMonth") + 1,
String portalMessage = ParamUtil.getString(actionRequest, "portalMessage"); ParamUtil.getInteger(actionRequest, "endDay"),
long after = ParamUtil.getLong(actionRequest, "after"); ParamUtil.getInteger(actionRequest, "endHour"),
String onreboot = ParamUtil.getString(actionRequest, "onreboot"); ParamUtil.getInteger(actionRequest, "endMinute"));
String status = ParamUtil.getString(actionRequest, "status");
String statusMessage = ParamUtil.getString(actionRequest, "statusMessage");
Calendar calendarEnd = Calendar.getInstance(); MaintenanceSchedule maintenanceSchedule = null;
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; 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)) { } catch (PortalException e) {
maintenanceSchedule = _log.error(e);
MaintenanceScheduleServiceUtil.addMaintenanceSchedule(type, reason, portalMessage, after, SessionErrors.add(actionRequest, e.getClass());
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) { if (SessionErrors.isEmpty(actionRequest)) {
_log.error(e); actionResponse.setRenderParameter("maintenanceScheduleId",
SessionErrors.add(actionRequest, e.getClass()); 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);
}
}
} }

65
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 { 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 String resourceID = GetterUtil.getString(resourceRequest.getResourceID());
public void serveResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse) throws IOException,
PortletException {
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(); List<MaintenanceSchedule> maintenanceSchedules = MaintenanceScheduleLocalServiceUtil
responseData.put("maintenanceExpected", false); .findByStatus(MaintenanceStatus.NEW.getCode());
for (MaintenanceSchedule maintenanceSchedule : maintenanceSchedules) {
List<MaintenanceSchedule> maintenanceSchedules = Date maintenanceStartDate = DateTimeUtil.scaleToNextMinute(MaintenanceDateUtil
MaintenanceScheduleLocalServiceUtil.findByStatus(MaintenanceStatus.NEW.getCode()); .getStartDate(maintenanceSchedule));
for (MaintenanceSchedule maintenanceSchedule : maintenanceSchedules) { long timeDiff = maintenanceStartDate.getTime() - DateUtil.newDate().getTime();
Date maintenanceStartDate = if (timeDiff < ONE_HOUR) {
DateTimeUtil.scaleToNextMinute(MaintenanceDateUtil.getStartDate(maintenanceSchedule)); 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) { } catch (SystemException e) {
responseData.put("maintenanceExpected", true); e.printStackTrace();
responseData.put("startFrom", timeDiff); }
responseData.put("maintenanceScheduleId", maintenanceSchedule.getMaintenanceScheduleId());
break;
}
}
PrintWriter out = resourceResponse.getWriter(); }
out.println(responseData.toString());
out.flush();
} catch (SystemException e) { super.serveResource(resourceRequest, resourceResponse);
e.printStackTrace(); }
}
}
super.serveResource(resourceRequest, resourceResponse);
}
} }

342
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. * The implementation of the maintenance schedule local service.
* *
* <p> * <p>
* All custom service methods should be put in this class. Whenever methods are added, rerun * All custom service methods should be put in this class. Whenever methods are
* ServiceBuilder to copy their definitions into the * added, rerun ServiceBuilder to copy their definitions into the
* {@link it.tref.liferay.portos.maintenance.service.MaintenanceScheduleLocalService} interface. * {@link it.tref.liferay.portos.maintenance.service.MaintenanceScheduleLocalService}
* interface.
* *
* <p> * <p>
* This is a local service. Methods of this service will not have security checks based on the * This is a local service. Methods of this service will not have security
* propagated JAAS credentials because this service can only be accessed from within the same VM. * checks based on the propagated JAAS credentials because this service can only
* be accessed from within the same VM.
* </p> * </p>
* *
* @author * @author
@ -55,166 +57,172 @@ import java.util.List;
* @see it.tref.liferay.portos.maintenance.service.MaintenanceScheduleLocalServiceUtil * @see it.tref.liferay.portos.maintenance.service.MaintenanceScheduleLocalServiceUtil
*/ */
public class MaintenanceScheduleLocalServiceImpl extends MaintenanceScheduleLocalServiceBaseImpl { public class MaintenanceScheduleLocalServiceImpl extends MaintenanceScheduleLocalServiceBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: * NOTE FOR DEVELOPERS:
* *
* Never reference this interface directly. Always use {@link * Never reference this interface directly. Always use {@link
* it.tref.liferay.portos.maintenance.service.MaintenanceScheduleLocalServiceUtil} to access the * it.tref.liferay
* maintenance schedule local service. * .portos.maintenance.service.MaintenanceScheduleLocalServiceUtil} to
*/ * access the maintenance schedule local service.
*/
@Override
public MaintenanceSchedule addMaintenanceSchedule(String type, String reason, String portalMessage, long after, @Override
Date end, String onreboot, ServiceContext serviceContext) throws SystemException, PortalException { public MaintenanceSchedule addMaintenanceSchedule(String type, String reason, String portalMessage,
long after, Date end, String onreboot, ServiceContext serviceContext) throws SystemException,
MaintenanceSchedule maintenanceSchedule = PortalException {
MaintenanceScheduleUtil.create(counterLocalService.increment(MaintenanceSchedule.class.getName()));
MaintenanceSchedule maintenanceSchedule = MaintenanceScheduleUtil.create(counterLocalService
validate(type, reason, after, end, onreboot); .increment(MaintenanceSchedule.class.getName()));
maintenanceSchedule.setCompanyId(serviceContext.getCompanyId()); validate(type, reason, after, end, onreboot);
maintenanceSchedule.setUserId(serviceContext.getUserId());
User user = userLocalService.fetchUser(serviceContext.getUserId()); maintenanceSchedule.setCompanyId(serviceContext.getCompanyId());
maintenanceSchedule.setUserName(Validator.isNotNull(user) ? user.getScreenName() : StringPool.BLANK); maintenanceSchedule.setUserId(serviceContext.getUserId());
maintenanceSchedule.setCreateDate(DateUtil.newDate()); User user = userLocalService.fetchUser(serviceContext.getUserId());
maintenanceSchedule.setModifiedDate(DateUtil.newDate()); maintenanceSchedule.setUserName(Validator.isNotNull(user) ? user.getScreenName() : StringPool.BLANK);
maintenanceSchedule.setCreateDate(DateUtil.newDate());
maintenanceSchedule.setType(type); maintenanceSchedule.setModifiedDate(DateUtil.newDate());
maintenanceSchedule.setReason(reason);
maintenanceSchedule.setPortalMessage(portalMessage != null ? portalMessage : StringPool.BLANK); maintenanceSchedule.setType(type);
maintenanceSchedule.setAfter(after); maintenanceSchedule.setReason(reason);
maintenanceSchedule.setEnd(end != null ? DateTimeUtil.scaleToNextMinute(end) : null); maintenanceSchedule.setPortalMessage(portalMessage != null ? portalMessage : StringPool.BLANK);
maintenanceSchedule.setOnreboot(onreboot); maintenanceSchedule.setAfter(after);
maintenanceSchedule.setEnd(end != null ? DateTimeUtil.scaleToNextMinute(end) : null);
maintenanceSchedule.setStatus(MaintenanceStatus.NEW.getCode()); maintenanceSchedule.setOnreboot(onreboot);
maintenanceSchedule.setCompleted(Boolean.FALSE);
maintenanceSchedule.setStatus(MaintenanceStatus.NEW.getCode());
return addMaintenanceSchedule(maintenanceSchedule); 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, @Override
ServiceContext serviceContext) throws SystemException, PortalException { public MaintenanceSchedule updateMaintenanceSchedule(long maintenanceScheduleId, String type,
String reason, String portalMessage, long after, Date end, String onreboot, String status,
MaintenanceSchedule maintenanceSchedule = getMaintenanceSchedule(maintenanceScheduleId); String statusMessage, ServiceContext serviceContext) throws SystemException, PortalException {
validate(type, reason, after, end, onreboot); MaintenanceSchedule maintenanceSchedule = getMaintenanceSchedule(maintenanceScheduleId);
if (Validator.isNotNull(status)) { validate(type, reason, after, end, onreboot);
maintenanceSchedule = updateStatus(maintenanceSchedule.getMaintenanceScheduleId(), status, statusMessage);
} if (Validator.isNotNull(status)) {
maintenanceSchedule = updateStatus(maintenanceSchedule.getMaintenanceScheduleId(), status,
maintenanceSchedule.setModifiedDate(DateUtil.newDate()); statusMessage);
}
maintenanceSchedule.setType(type);
maintenanceSchedule.setReason(reason); maintenanceSchedule.setModifiedDate(DateUtil.newDate());
maintenanceSchedule.setPortalMessage(portalMessage != null ? portalMessage : StringPool.BLANK);
maintenanceSchedule.setAfter(after); maintenanceSchedule.setType(type);
maintenanceSchedule.setEnd(end != null ? DateTimeUtil.scaleToNextMinute(end) : null); maintenanceSchedule.setReason(reason);
maintenanceSchedule.setOnreboot(onreboot); maintenanceSchedule.setPortalMessage(portalMessage != null ? portalMessage : StringPool.BLANK);
maintenanceSchedule.setAfter(after);
return updateMaintenanceSchedule(maintenanceSchedule); 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 { @Override
public MaintenanceSchedule updateStatus(long maintenanceScheduleId, String status)
return updateStatus(maintenanceScheduleId, status, null); throws PortalException, SystemException {
}
return updateStatus(maintenanceScheduleId, status, null);
@Override }
public MaintenanceSchedule updateStatus(long maintenanceScheduleId, String status, String statusMessage)
throws PortalException, SystemException { @Override
public MaintenanceSchedule updateStatus(long maintenanceScheduleId, String status, String statusMessage)
MaintenanceStatus maintenanceStatus = null; throws PortalException, SystemException {
try {
maintenanceStatus = MaintenanceStatus.parse(status); MaintenanceStatus maintenanceStatus = null;
} catch (IllegalArgumentException e) { try {
throw new MaintenanceStatusException(status); maintenanceStatus = MaintenanceStatus.parse(status);
} } catch (IllegalArgumentException e) {
throw new MaintenanceStatusException(status);
MaintenanceSchedule maintenanceSchedule = getMaintenanceSchedule(maintenanceScheduleId); }
maintenanceSchedule.setStatus(maintenanceStatus.getCode());
maintenanceSchedule.setStatusMessage(statusMessage); MaintenanceSchedule maintenanceSchedule = getMaintenanceSchedule(maintenanceScheduleId);
maintenanceSchedule.setStatus(maintenanceStatus.getCode());
if (maintenanceStatus == MaintenanceStatus.ENDED || maintenanceStatus == MaintenanceStatus.FORCE_ENDED maintenanceSchedule.setStatusMessage(statusMessage);
|| maintenanceStatus == MaintenanceStatus.ERROR) {
maintenanceSchedule.setCompleted(Boolean.TRUE); if (maintenanceStatus == MaintenanceStatus.ENDED
} else { || maintenanceStatus == MaintenanceStatus.FORCE_ENDED
maintenanceSchedule.setCompleted(Boolean.FALSE); || maintenanceStatus == MaintenanceStatus.ERROR) {
} maintenanceSchedule.setCompleted(Boolean.TRUE);
} else {
return updateMaintenanceSchedule(maintenanceSchedule); maintenanceSchedule.setCompleted(Boolean.FALSE);
} }
@Override return updateMaintenanceSchedule(maintenanceSchedule);
public List<MaintenanceSchedule> findByStatus(String status) throws SystemException { }
return maintenanceSchedulePersistence.findByStatus(status);
} @Override
public List<MaintenanceSchedule> findByStatus(String status) throws SystemException {
private void validate(String type, String reason, long after, Date end, String onreboot) throws PortalException { return maintenanceSchedulePersistence.findByStatus(status);
}
if (Validator.isNull(type)) {
throw new RequiredMaintenanceTypeException(); private void validate(String type, String reason, long after, Date end, String onreboot)
} throws PortalException {
try { if (Validator.isNull(type)) {
MaintenanceType.parse(type); throw new RequiredMaintenanceTypeException();
} catch (IllegalArgumentException e) { }
throw new MaintenanceTypeException(type);
} try {
MaintenanceType.parse(type);
if (Validator.isNull(onreboot)) { } catch (IllegalArgumentException e) {
throw new RequiredMaintenanceOnRebootException(); throw new MaintenanceTypeException(type);
} }
try { if (Validator.isNull(onreboot)) {
MaintenanceOnReboot.parse(onreboot); throw new RequiredMaintenanceOnRebootException();
} catch (IllegalArgumentException e) { }
throw new MaintenanceOnRebootException(onreboot);
} try {
MaintenanceOnReboot.parse(onreboot);
if (Validator.isNull(reason)) { } catch (IllegalArgumentException e) {
throw new RequiredMaintenanceReasonException(); throw new MaintenanceOnRebootException(onreboot);
} }
} if (Validator.isNull(reason)) {
throw new RequiredMaintenanceReasonException();
@Override }
public List<MaintenanceSchedule> findByC_Completed(long companyId, boolean completed) throws SystemException {
return maintenanceSchedulePersistence.findByC_Completed(companyId, completed); }
}
@Override
@Override public List<MaintenanceSchedule> findByC_Completed(long companyId, boolean completed)
public List<MaintenanceSchedule> findByCompleted_Onreboot(boolean completed, String onreboot) throws SystemException { throws SystemException {
return maintenanceSchedulePersistence.findByCompleted_Onreboot(completed, onreboot); return maintenanceSchedulePersistence.findByC_Completed(companyId, completed);
} }
@Override @Override
public List<MaintenanceSchedule> findByCompany(long companyId) throws SystemException { public List<MaintenanceSchedule> findByCompleted_Onreboot(boolean completed, String onreboot)
return maintenanceSchedulePersistence.findByCompany(companyId); throws SystemException {
} return maintenanceSchedulePersistence.findByCompleted_Onreboot(completed, onreboot);
}
@Override
public List<MaintenanceSchedule> findByCompany(long companyId, int start, int end) throws SystemException { @Override
return maintenanceSchedulePersistence.findByCompany(companyId, start, end); public List<MaintenanceSchedule> findByCompany(long companyId) throws SystemException {
} return maintenanceSchedulePersistence.findByCompany(companyId);
}
@Override
public int countByCompany(long companyId) throws SystemException { @Override
return maintenanceSchedulePersistence.countByCompany(companyId); public List<MaintenanceSchedule> findByCompany(long companyId, int start, int end) throws SystemException {
} return maintenanceSchedulePersistence.findByCompany(companyId, start, end);
}
@Override
public List<MaintenanceSchedule> findAll() throws SystemException { @Override
return maintenanceSchedulePersistence.findAll(); public int countByCompany(long companyId) throws SystemException {
} return maintenanceSchedulePersistence.countByCompany(companyId);
}
@Override
public int countAll() throws SystemException { @Override
return maintenanceSchedulePersistence.countAll(); public List<MaintenanceSchedule> findAll() throws SystemException {
} return maintenanceSchedulePersistence.findAll();
}
@Override
public int countAll() throws SystemException {
return maintenanceSchedulePersistence.countAll();
}
} }

75
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. * The implementation of the maintenance schedule remote service.
* *
* <p> * <p>
* All custom service methods should be put in this class. Whenever methods are added, rerun * All custom service methods should be put in this class. Whenever methods are
* ServiceBuilder to copy their definitions into the * added, rerun ServiceBuilder to copy their definitions into the
* {@link it.tref.liferay.portos.maintenance.service.MaintenanceScheduleService} interface. * {@link it.tref.liferay.portos.maintenance.service.MaintenanceScheduleService}
* interface.
* *
* <p> * <p>
* This is a remote service. Methods of this service are expected to have security checks based on * This is a remote service. Methods of this service are expected to have
* the propagated JAAS credentials because this service can be accessed remotely. * security checks based on the propagated JAAS credentials because this service
* can be accessed remotely.
* </p> * </p>
* *
* @author * @author
@ -39,45 +41,46 @@ import java.util.Date;
* @see it.tref.liferay.portos.maintenance.service.MaintenanceScheduleServiceUtil * @see it.tref.liferay.portos.maintenance.service.MaintenanceScheduleServiceUtil
*/ */
public class MaintenanceScheduleServiceImpl extends MaintenanceScheduleServiceBaseImpl { public class MaintenanceScheduleServiceImpl extends MaintenanceScheduleServiceBaseImpl {
/* /*
* NOTE FOR DEVELOPERS: * NOTE FOR DEVELOPERS:
* *
* Never reference this interface directly. Always use {@link * Never reference this interface directly. Always use {@link
* it.tref.liferay.portos.maintenance.service.MaintenanceScheduleServiceUtil} to access the * it.tref.liferay
* maintenance schedule remote service. * .portos.maintenance.service.MaintenanceScheduleServiceUtil} to access the
*/ * maintenance schedule remote service.
*/
public MaintenanceSchedule addMaintenanceSchedule(String type, String reason, String portalMessage, long after, public MaintenanceSchedule addMaintenanceSchedule(String type, String reason, String portalMessage,
Date end, String onreboot, ServiceContext serviceContext) throws Exception { long after, Date end, String onreboot, ServiceContext serviceContext) throws Exception {
if (!PortalUtil.isCompanyAdmin(getUser())) { if (!PortalUtil.isCompanyAdmin(getUser())) {
throw new PortalException("Access denied!"); throw new PortalException("Access denied!");
} }
return maintenanceScheduleLocalService.addMaintenanceSchedule(type, reason, portalMessage, after, end, onreboot, return maintenanceScheduleLocalService.addMaintenanceSchedule(type, reason, portalMessage, after,
serviceContext); end, onreboot, serviceContext);
} }
public MaintenanceSchedule updateMaintenanceSchedule(long maintenanceScheduleId, String type, String reason, public MaintenanceSchedule updateMaintenanceSchedule(long maintenanceScheduleId, String type,
String portalMessage, long after, Date end, String onreboot, String status, String statusMessage, String reason, String portalMessage, long after, Date end, String onreboot, String status,
ServiceContext serviceContext) throws Exception { String statusMessage, ServiceContext serviceContext) throws Exception {
if (!PortalUtil.isCompanyAdmin(getUser())) { if (!PortalUtil.isCompanyAdmin(getUser())) {
throw new PortalException("Access denied!"); throw new PortalException("Access denied!");
} }
return maintenanceScheduleLocalService.updateMaintenanceSchedule(maintenanceScheduleId, type, reason, return maintenanceScheduleLocalService.updateMaintenanceSchedule(maintenanceScheduleId, type, reason,
portalMessage, after, end, onreboot, status, statusMessage, serviceContext); portalMessage, after, end, onreboot, status, statusMessage, serviceContext);
} }
public MaintenanceSchedule deleteMaintenanceSchedule(long maintenanceScheduleId, ServiceContext serviceContext) public MaintenanceSchedule deleteMaintenanceSchedule(long maintenanceScheduleId,
throws Exception { ServiceContext serviceContext) throws Exception {
if (!PortalUtil.isCompanyAdmin(getUser())) { if (!PortalUtil.isCompanyAdmin(getUser())) {
throw new PortalException("Access denied!"); throw new PortalException("Access denied!");
} }
return maintenanceScheduleLocalService.deleteMaintenanceSchedule(maintenanceScheduleId); return maintenanceScheduleLocalService.deleteMaintenanceSchedule(maintenanceScheduleId);
} }
} }

380
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 { 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 END_PARAM = "end";
private static final String STOP_PATH = "/stop"; 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 Object ALLOW_ALL_IP_ADDRESS = "ALL";
private static final String FORCED_MESSAGE = "Forced maintenance mode..."; 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"; @Override
private static final String TYPE_PARAM = "type"; protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException,
private static final String AFTER_PARAM = "after"; IOException {
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"; JSONObject jsonResponse = JSONFactoryUtil.createJSONObject();
private static final Object ALLOW_ALL_IP_ADDRESS = "ALL"; response.setContentType(CONTENT_TYPE_APPLICATION_JSON);
private static final String[] allowedIpAddresses = PropsUtil.getArray("maintenance-allowed-ip-addresses");
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<String, String[]> params = request.getParameterMap();
@Override checkIpAddress(request);
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
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); private MaintenanceSchedule stopMaintenance(Map<String, String[]> params) throws IllegalAccessException,
String pathInfo = request.getPathInfo(); IllegalArgumentException, InvocationTargetException, Exception {
Map<String, String[]> params = request.getParameterMap();
MaintenanceSchedule result = null;
checkIpAddress(request);
boolean force = params.get(FORCE_PARAM) != null && params.get(FORCE_PARAM).length > 0 ? Boolean
if (START_PATH.equals(pathInfo)) { .valueOf(params.get(FORCE_PARAM)[0]) : false;
MaintenanceSchedule maintenanceSchedule = startMaintenance(params, serviceContext);
if (Validator.isNotNull(maintenanceSchedule)) { if (force) {
jsonResponse.put("id", maintenanceSchedule.getMaintenanceScheduleId()); PortalMaintenanceUtil.stopMaintenaceMode();
jsonResponse.put("reason", maintenanceSchedule.getReason()); List<MaintenanceSchedule> maintenanceSchedules = MaintenanceScheduleLocalServiceUtil
jsonResponse.put("startDate", MaintenanceDateUtil.getStartDate(maintenanceSchedule)); .findByStatus(MaintenanceStatus.IN_PROGRESS.getCode());
} for (MaintenanceSchedule maintenanceSchedule : maintenanceSchedules) {
} else if (STOP_PATH.equals(pathInfo)) { MaintenanceScheduleLocalServiceUtil.updateStatus(
MaintenanceSchedule maintenanceSchedule = stopMaintenance(params); maintenanceSchedule.getMaintenanceScheduleId(),
if (Validator.isNotNull(maintenanceSchedule)) { MaintenanceStatus.FORCE_ENDED.getCode(),
jsonResponse.put("id", maintenanceSchedule.getMaintenanceScheduleId()); "Stop forced at " + sdf.format(DateUtil.newDate()));
jsonResponse.put("endDate", sdf.format(maintenanceSchedule.getEnd())); }
} return null;
} else { }
throw new UnsupportedOperationException();
} int stopAfter = params.get(STOP_AFTER_PARAM) != null && params.get(STOP_AFTER_PARAM).length > 0 ? Integer
.valueOf(params.get(STOP_AFTER_PARAM)[0]) : 0;
jsonResponse.put("success", "true");
response.setStatus(HttpServletResponse.SC_OK); List<MaintenanceSchedule> maintenanceSchedules = MaintenanceScheduleLocalServiceUtil
ServletResponseUtil.write(response, jsonResponse.toString()); .findByStatus(MaintenanceStatus.IN_PROGRESS.getCode());
} catch (IllegalAccessException e) { if (!maintenanceSchedules.isEmpty()) {
sendErrorResponse(response, HttpServletResponse.SC_FORBIDDEN, e.getMessage());
} catch (UnsupportedOperationException e) { if (maintenanceSchedules.size() > 1) {
sendErrorResponse(response, HttpServletResponse.SC_NOT_FOUND, e.getMessage()); _log.warn("Multiple maintenance in progress...");
ServletResponseUtil.write(response, jsonResponse.toString()); }
} catch (ParseException | IllegalArgumentException e) {
sendErrorResponse(response, HttpServletResponse.SC_BAD_REQUEST, e.getMessage()); Date end = DateUtil.newDate();
} catch (Exception e) {
_log.error(e); if (stopAfter > 0) {
sendErrorResponse(response, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.getMessage()); Calendar calendar = Calendar.getInstance();
} calendar.add(Calendar.MINUTE, stopAfter);
end = calendar.getTime();
} }
for (MaintenanceSchedule maintenanceSchedule : maintenanceSchedules) {
maintenanceSchedule.setEnd(DateTimeUtil.scaleToNextMinute(end));
private MaintenanceSchedule stopMaintenance(Map<String, String[]> params) throws IllegalAccessException, result = MaintenanceScheduleLocalServiceUtil.updateMaintenanceSchedule(maintenanceSchedule);
IllegalArgumentException, InvocationTargetException, Exception { }
MaintenanceSchedule result = null; }
return result;
boolean force =
params.get(FORCE_PARAM) != null && params.get(FORCE_PARAM).length > 0 ? Boolean }
.valueOf(params.get(FORCE_PARAM)[0]) : false;
private MaintenanceSchedule startMaintenance(Map<String, String[]> params, ServiceContext serviceContext)
if (force) { throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, Exception {
PortalMaintenanceUtil.stopMaintenaceMode();
List<MaintenanceSchedule> maintenanceSchedules = boolean force = params.get(FORCE_PARAM) != null && params.get(FORCE_PARAM).length > 0 ? Boolean
MaintenanceScheduleLocalServiceUtil.findByStatus(MaintenanceStatus.IN_PROGRESS.getCode()); .valueOf(params.get(FORCE_PARAM)[0]) : false;
for (MaintenanceSchedule maintenanceSchedule : maintenanceSchedules) {
MaintenanceScheduleLocalServiceUtil.updateStatus(maintenanceSchedule.getMaintenanceScheduleId(), if (force) {
MaintenanceStatus.FORCE_ENDED.getCode(), "Stop forced at " + sdf.format(DateUtil.newDate())); PortalMaintenanceUtil.startMaintenaceMode(UUID.randomUUID().toString(), FORCED_MESSAGE);
} return null;
return null; }
}
Date end = null;
int stopAfter = String[] endParam = params.get(END_PARAM);
params.get(STOP_AFTER_PARAM) != null && params.get(STOP_AFTER_PARAM).length > 0 ? Integer.valueOf(params if (endParam != null && endParam.length > 0) {
.get(STOP_AFTER_PARAM)[0]) : 0; end = sdf.parse(endParam[0]);
}
List<MaintenanceSchedule> maintenanceSchedules =
MaintenanceScheduleLocalServiceUtil.findByStatus(MaintenanceStatus.IN_PROGRESS.getCode()); String type = params.get(TYPE_PARAM) != null && params.get(TYPE_PARAM).length > 0 ? params
.get(TYPE_PARAM)[0] : null;
if (!maintenanceSchedules.isEmpty()) { String reason = params.get(REASON_PARAM) != null && params.get(REASON_PARAM).length > 0 ? params
.get(REASON_PARAM)[0] : null;
if (maintenanceSchedules.size() > 1) { long after = params.get(AFTER_PARAM) != null && params.get(AFTER_PARAM).length > 0 ? Long
_log.warn("Multiple maintenance in progress..."); .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;
Date end = DateUtil.newDate(); String message = params.get(MESSAGE_PARAM) != null && params.get(MESSAGE_PARAM).length > 0 ? params
.get(MESSAGE_PARAM)[0] : null;
if (stopAfter > 0) {
Calendar calendar = Calendar.getInstance(); return MaintenanceScheduleLocalServiceUtil.addMaintenanceSchedule(type, reason, message, after, end,
calendar.add(Calendar.MINUTE, stopAfter); onreboot, serviceContext);
end = calendar.getTime();
} }
for (MaintenanceSchedule maintenanceSchedule : maintenanceSchedules) { private void checkIpAddress(HttpServletRequest request) throws IllegalAccessException {
maintenanceSchedule.setEnd(DateTimeUtil.scaleToNextMinute(end));
result = MaintenanceScheduleLocalServiceUtil.updateMaintenanceSchedule(maintenanceSchedule); String clientIpAddress = request.getHeader("X-FORWARDED-FOR");
} if (Validator.isNull(clientIpAddress)) {
clientIpAddress = request.getRemoteAddr();
} }
return result; boolean found = false;
for (String ipAddress : allowedIpAddresses) {
}
if (ipAddress.contains("/")) {
private MaintenanceSchedule startMaintenance(Map<String, String[]> params, ServiceContext serviceContext) SubnetUtils subnetUtils = new SubnetUtils(ipAddress);
throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, Exception { SubnetInfo subnetInfo = subnetUtils.getInfo();
if (subnetInfo.isInRange(clientIpAddress)) {
boolean force = found = true;
params.get(FORCE_PARAM) != null && params.get(FORCE_PARAM).length > 0 ? Boolean break;
.valueOf(params.get(FORCE_PARAM)[0]) : false; }
} else if (ipAddress.equals(clientIpAddress) || ipAddress.equals(ALLOW_ALL_IP_ADDRESS)) {
if (force) { found = true;
PortalMaintenanceUtil.startMaintenaceMode(UUID.randomUUID().toString(), FORCED_MESSAGE); break;
return null; }
} }
Date end = null; if (!found) {
String[] endParam = params.get(END_PARAM); throw new IllegalAccessException("Your IP address '" + clientIpAddress + "' is not authorized");
if (endParam != null && endParam.length > 0) { }
end = sdf.parse(endParam[0]);
} }
String type = private void sendErrorResponse(HttpServletResponse response, int scInternalServerError, String message)
params.get(TYPE_PARAM) != null && params.get(TYPE_PARAM).length > 0 ? params.get(TYPE_PARAM)[0] : null; throws IOException {
String reason = JSONObject jsonResponse = JSONFactoryUtil.createJSONObject();
params.get(REASON_PARAM) != null && params.get(REASON_PARAM).length > 0 ? params.get(REASON_PARAM)[0] : null; response.setStatus(scInternalServerError);
long after = jsonResponse.put("success", false);
params.get(AFTER_PARAM) != null && params.get(AFTER_PARAM).length > 0 ? Long jsonResponse.put("message", message);
.valueOf(params.get(AFTER_PARAM)[0]) : 0l; ServletResponseUtil.write(response, jsonResponse.toString());
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());
}
} }

62
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 { public class DateTimeUtil {
/** /**
* This method remove seconds and milliseconds to the input date. * This method remove seconds and milliseconds to the input date.
* *
* @param input * @param input
* @return the input with seconds and milliseconds equal to 0 * @return the input with seconds and milliseconds equal to 0
*/ */
public static Date removeSeconds(Date input) { public static Date removeSeconds(Date input) {
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
calendar.setTime(input); calendar.setTime(input);
calendar.set(Calendar.SECOND, 0); calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0); calendar.set(Calendar.MILLISECOND, 0);
return calendar.getTime(); return calendar.getTime();
} }
/** /**
* This method add a minute , remove seconds and milliseconds to the input date. If seconds and * This method add a minute , remove seconds and milliseconds to the input
* milliseconds are equal to 0, return the input. * date. If seconds and milliseconds are equal to 0, return the input.
* *
* @param input * @param input
* @return the date scaled or the input if doesn't require scaling. * @return the date scaled or the input if doesn't require scaling.
*/ */
public static Date scaleToNextMinute(Date input) { public static Date scaleToNextMinute(Date input) {
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
calendar.setTime(input); calendar.setTime(input);
if (calendar.get(Calendar.SECOND) != 0 || calendar.get(Calendar.MILLISECOND) != 0) { if (calendar.get(Calendar.SECOND) != 0 || calendar.get(Calendar.MILLISECOND) != 0) {
calendar.add(Calendar.MINUTE, 1); calendar.add(Calendar.MINUTE, 1);
calendar.set(Calendar.SECOND, 0); calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0); calendar.set(Calendar.MILLISECOND, 0);
return calendar.getTime(); return calendar.getTime();
} }
return input; return input;
} }
} }

177
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; package it.tref.liferay.portos.maintenance.util;
public class MaintenanceConstants { 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) { MaintenanceType(String code, String description) {
this.setCode(code); this.setCode(code);
this.setDescription(description); this.setDescription(description);
} }
public String getDescription() { public String getDescription() {
return description; return description;
} }
public void setDescription(String description) { public void setDescription(String description) {
this.description = description; this.description = description;
} }
public String getCode() { public String getCode() {
return code; return code;
} }
public void setCode(String code) { public void setCode(String code) {
this.code = code; this.code = code;
} }
private String code; private String code;
private String description; private String description;
public static MaintenanceType parse(String code) { public static MaintenanceType parse(String code) {
for (MaintenanceType maintenanceType : values()) { for (MaintenanceType maintenanceType : values()) {
if (maintenanceType.code.equals(code)) { if (maintenanceType.code.equals(code)) {
return maintenanceType; 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) { MaintenanceOnReboot(String code, String description) {
this.setCode(code); this.setCode(code);
this.setDescription(description); this.setDescription(description);
} }
public String getDescription() { public String getDescription() {
return description; return description;
} }
public void setDescription(String description) { public void setDescription(String description) {
this.description = description; this.description = description;
} }
public String getCode() { public String getCode() {
return code; return code;
} }
public void setCode(String code) { public void setCode(String code) {
this.code = code; this.code = code;
} }
private String code; private String code;
private String description; private String description;
public static MaintenanceOnReboot parse(String code) { public static MaintenanceOnReboot parse(String code) {
for (MaintenanceOnReboot maintenanceOnReboot : values()) { for (MaintenanceOnReboot maintenanceOnReboot : values()) {
if (maintenanceOnReboot.code.equals(code)) { if (maintenanceOnReboot.code.equals(code)) {
return maintenanceOnReboot; 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( NEW("N", "New"), IN_PROGRESS("P", "In Progress"), ENDED("E", "Ended"), FORCE_ENDED("FE",
"ER", "Error"); "Force Ended"), ERROR("ER", "Error");
MaintenanceStatus(String code, String description) { MaintenanceStatus(String code, String description) {
this.setCode(code); this.setCode(code);
this.setDescription(description); this.setDescription(description);
} }
public String getDescription() { public String getDescription() {
return description; return description;
} }
public void setDescription(String description) { public void setDescription(String description) {
this.description = description; this.description = description;
} }
public String getCode() { public String getCode() {
return code; return code;
} }
public void setCode(String code) { public void setCode(String code) {
this.code = code; this.code = code;
} }
private String code; private String code;
private String description; private String description;
public static MaintenanceStatus parse(String code) { public static MaintenanceStatus parse(String code) {
for (MaintenanceStatus maintenanceStatus : values()) { for (MaintenanceStatus maintenanceStatus : values()) {
if (maintenanceStatus.code.equals(code)) { if (maintenanceStatus.code.equals(code)) {
return maintenanceStatus; return maintenanceStatus;
} }
} }
throw new IllegalArgumentException("Invalid MaintenanceStatus code: " + code); throw new IllegalArgumentException("Invalid MaintenanceStatus code: " + code);
} }
} }
} }

22
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 class MaintenanceDateUtil {
public static Date getStartDate(Date createDate, int after) { public static Date getStartDate(Date createDate, int after) {
Calendar calendar = Calendar.getInstance(); Calendar calendar = Calendar.getInstance();
calendar.setTime(createDate); calendar.setTime(createDate);
if (after > 0) { if (after > 0) {
calendar.add(Calendar.MINUTE, after); calendar.add(Calendar.MINUTE, after);
} }
return calendar.getTime(); return calendar.getTime();
} }
public static Date getStartDate(MaintenanceSchedule maintenanceSchedule) { public static Date getStartDate(MaintenanceSchedule maintenanceSchedule) {
return getStartDate(maintenanceSchedule.getCreateDate(), (int) maintenanceSchedule.getAfter()); return getStartDate(maintenanceSchedule.getCreateDate(), (int) maintenanceSchedule.getAfter());
} }
} }

39
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 class PortalMaintenanceUtil {
public static void startMaintenaceMode(String sessionId, String classNameParam) throws IllegalAccessException, public static void startMaintenaceMode(String sessionId, String classNameParam)
IllegalArgumentException, InvocationTargetException, Exception { throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, Exception {
String className = String className = LanguageUtil
LanguageUtil .get(LocaleUtil.getDefault(),
.get(LocaleUtil.getDefault(), "the-sign-in-process-is-temporarily-disabled-because-the-portal-is-undergoing-a-routine-maintenance-upgrade");
"the-sign-in-process-is-temporarily-disabled-because-the-portal-is-undergoing-a-routine-maintenance-upgrade");
if (Validator.isNotNull(classNameParam)) { if (Validator.isNotNull(classNameParam)) {
className = classNameParam; className = classNameParam;
} }
Class<?> clazz = Class<?> clazz = ClassResolverUtil.resolve("com.liferay.portal.util.MaintenanceUtil",
ClassResolverUtil.resolve("com.liferay.portal.util.MaintenanceUtil", PortalClassLoaderUtil.getClassLoader()); PortalClassLoaderUtil.getClassLoader());
ReflectionUtil.getDeclaredMethod(clazz, "maintain", String.class, String.class).invoke(null, sessionId, className); ReflectionUtil.getDeclaredMethod(clazz, "maintain", String.class, String.class).invoke(null,
} sessionId, className);
}
public static void stopMaintenaceMode() throws IllegalAccessException, IllegalArgumentException, public static void stopMaintenaceMode() throws IllegalAccessException, IllegalArgumentException,
InvocationTargetException, Exception { InvocationTargetException, Exception {
Class<?> clazz = Class<?> clazz = ClassResolverUtil.resolve("com.liferay.portal.util.MaintenanceUtil",
ClassResolverUtil.resolve("com.liferay.portal.util.MaintenanceUtil", PortalClassLoaderUtil.getClassLoader()); PortalClassLoaderUtil.getClassLoader());
ReflectionUtil.getDeclaredMethod(clazz, "cancel", new Class<?>[0]).invoke(null, new Object[0]); ReflectionUtil.getDeclaredMethod(clazz, "cancel", new Class<?>[0]).invoke(null, new Object[0]);
}
}
} }

4
liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/service.properties

@ -13,8 +13,8 @@
## ##
build.namespace=portos_maintenance build.namespace=portos_maintenance
build.number=42 build.number=44
build.date=1569596970763 build.date=1605008600382
build.auto.upgrade=true build.auto.upgrade=true
## ##

572
liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/tld/c.tld

@ -1,572 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<taglib xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd"
version="2.1">
<description>JSTL 1.2 core library</description>
<display-name>JSTL core</display-name>
<tlib-version>1.2</tlib-version>
<short-name>c</short-name>
<uri>http://java.sun.com/jsp/jstl/core</uri>
<validator>
<description>
Provides core validation features for JSTL tags.
</description>
<validator-class>
org.apache.taglibs.standard.tlv.JstlCoreTLV
</validator-class>
</validator>
<tag>
<description>
Catches any Throwable that occurs in its body and optionally
exposes it.
</description>
<name>catch</name>
<tag-class>org.apache.taglibs.standard.tag.common.core.CatchTag</tag-class>
<body-content>JSP</body-content>
<attribute>
<description>
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.
</description>
<name>var</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
</tag>
<tag>
<description>
Simple conditional tag that establishes a context for
mutually exclusive conditional operations, marked by
&lt;when&gt; and &lt;otherwise&gt;
</description>
<name>choose</name>
<tag-class>com.liferay.taglib.core.ChooseTag</tag-class>
<body-content>JSP</body-content>
</tag>
<tag>
<description>
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
</description>
<name>if</name>
<tag-class>com.liferay.taglib.core.IfTag</tag-class>
<body-content>JSP</body-content>
<attribute>
<description>
The test condition that determines whether or
not the body content should be processed.
</description>
<name>test</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>boolean</type>
</attribute>
<attribute>
<description>
Name of the exported scoped variable for the
resulting value of the test condition. The type
of the scoped variable is Boolean.
</description>
<name>var</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<description>
Scope for var.
</description>
<name>scope</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
</tag>
<tag>
<description>
Retrieves an absolute or relative URL and exposes its contents
to either the page, a String in 'var', or a Reader in 'varReader'.
</description>
<name>import</name>
<tag-class>org.apache.taglibs.standard.tag.rt.core.ImportTag</tag-class>
<tei-class>org.apache.taglibs.standard.tei.ImportTEI</tei-class>
<body-content>JSP</body-content>
<attribute>
<description>
The URL of the resource to import.
</description>
<name>url</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description>
Name of the exported scoped variable for the
resource's content. The type of the scoped
variable is String.
</description>
<name>var</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<description>
Scope for var.
</description>
<name>scope</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<description>
Name of the exported scoped variable for the
resource's content. The type of the scoped
variable is Reader.
</description>
<name>varReader</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<description>
Name of the context when accessing a relative
URL resource that belongs to a foreign
context.
</description>
<name>context</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description>
Character encoding of the content at the input
resource.
</description>
<name>charEncoding</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
<tag>
<description>
The basic iteration tag, accepting many different
collection types and supporting subsetting and other
functionality
</description>
<name>forEach</name>
<tag-class>org.apache.taglibs.standard.tag.rt.core.ForEachTag</tag-class>
<tei-class>org.apache.taglibs.standard.tei.ForEachTEI</tei-class>
<body-content>JSP</body-content>
<attribute>
<description>
Collection of items to iterate over.
</description>
<name>items</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.Object</type>
<deferred-value>
<type>java.lang.Object</type>
</deferred-value>
</attribute>
<attribute>
<description>
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.
</description>
<name>begin</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>int</type>
</attribute>
<attribute>
<description>
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.
</description>
<name>end</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>int</type>
</attribute>
<attribute>
<description>
Iteration will only process every step items of
the collection, starting with the first one.
</description>
<name>step</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>int</type>
</attribute>
<attribute>
<description>
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.
</description>
<name>var</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<description>
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.
</description>
<name>varStatus</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
</tag>
<tag>
<description>
Iterates over tokens, separated by the supplied delimeters
</description>
<name>forTokens</name>
<tag-class>org.apache.taglibs.standard.tag.rt.core.ForTokensTag</tag-class>
<body-content>JSP</body-content>
<attribute>
<description>
String of tokens to iterate over.
</description>
<name>items</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
<deferred-value>
<type>java.lang.String</type>
</deferred-value>
</attribute>
<attribute>
<description>
The set of delimiters (the characters that
separate the tokens in the string).
</description>
<name>delims</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<attribute>
<description>
Iteration begins at the token located at the
specified index. First token has index 0.
</description>
<name>begin</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>int</type>
</attribute>
<attribute>
<description>
Iteration ends at the token located at the
specified index (inclusive).
</description>
<name>end</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>int</type>
</attribute>
<attribute>
<description>
Iteration will only process every step tokens
of the string, starting with the first one.
</description>
<name>step</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>int</type>
</attribute>
<attribute>
<description>
Name of the exported scoped variable for the
current item of the iteration. This scoped
variable has nested visibility.
</description>
<name>var</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<description>
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.
</description>
<name>varStatus</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
</tag>
<tag>
<description>
Like &lt;%= ... &gt;, but for expressions.
</description>
<name>out</name>
<tag-class>org.apache.taglibs.standard.tag.rt.core.OutTag</tag-class>
<body-content>JSP</body-content>
<attribute>
<description>
Expression to be evaluated.
</description>
<name>value</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description>
Default value if the resulting value is null.
</description>
<name>default</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description>
Determines whether characters &lt;,&gt;,&amp;,'," in the
resulting string should be converted to their
corresponding character entity codes. Default value is
true.
</description>
<name>escapeXml</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
<tag>
<description>
Subtag of &lt;choose&gt; that follows &lt;when&gt; tags
and runs only if all of the prior conditions evaluated to
'false'
</description>
<name>otherwise</name>
<tag-class>com.liferay.taglib.core.OtherwiseTag</tag-class>
<body-content>JSP</body-content>
</tag>
<tag>
<description>
Adds a parameter to a containing 'import' tag's URL.
</description>
<name>param</name>
<tag-class>org.apache.taglibs.standard.tag.rt.core.ParamTag</tag-class>
<body-content>JSP</body-content>
<attribute>
<description>
Name of the query string parameter.
</description>
<name>name</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description>
Value of the parameter.
</description>
<name>value</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
<tag>
<description>
Redirects to a new URL.
</description>
<name>redirect</name>
<tag-class>org.apache.taglibs.standard.tag.rt.core.RedirectTag</tag-class>
<body-content>JSP</body-content>
<attribute>
<description>
The URL of the resource to redirect to.
</description>
<name>url</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description>
Name of the context when redirecting to a relative URL
resource that belongs to a foreign context.
</description>
<name>context</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
<tag>
<description>
Removes a scoped variable (from a particular scope, if specified).
</description>
<name>remove</name>
<tag-class>org.apache.taglibs.standard.tag.common.core.RemoveTag</tag-class>
<body-content>empty</body-content>
<attribute>
<description>
Name of the scoped variable to be removed.
</description>
<name>var</name>
<required>true</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<description>
Scope for var.
</description>
<name>scope</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
</tag>
<tag>
<description>
Sets the result of an expression evaluation in a 'scope'
</description>
<name>set</name>
<tag-class>org.apache.taglibs.standard.tag.rt.core.SetTag</tag-class>
<body-content>JSP</body-content>
<attribute>
<description>
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.
</description>
<name>var</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<description>
Expression to be evaluated.
</description>
<name>value</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<deferred-value>
<type>java.lang.Object</type>
</deferred-value>
</attribute>
<attribute>
<description>
Target object whose property will be set. Must evaluate to
a JavaBeans object with setter property property, or to a
java.util.Map object.
</description>
<name>target</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description>
Name of the property to be set in the target object.
</description>
<name>property</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description>
Scope for var.
</description>
<name>scope</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
</tag>
<tag>
<description>
Creates a URL with optional query parameters.
</description>
<name>url</name>
<tag-class>org.apache.taglibs.standard.tag.rt.core.UrlTag</tag-class>
<body-content>JSP</body-content>
<attribute>
<description>
Name of the exported scoped variable for the
processed url. The type of the scoped variable is
String.
</description>
<name>var</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<description>
Scope for var.
</description>
<name>scope</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
<attribute>
<description>
URL to be processed.
</description>
<name>value</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<description>
Name of the context when specifying a relative URL
resource that belongs to a foreign context.
</description>
<name>context</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
<tag>
<description>
Subtag of &lt;choose&gt; that includes its body if its
condition evalutes to 'true'
</description>
<name>when</name>
<tag-class>com.liferay.taglib.core.WhenTag</tag-class>
<body-content>JSP</body-content>
<attribute>
<description>
The test condition that determines whether or not the
body content should be processed.
</description>
<name>test</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>boolean</type>
</attribute>
</tag>
</taglib>

20
liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/ivy.xml

@ -0,0 +1,20 @@
<?xml version="1.0"?>
<ivy-module
version="2.0"
xmlns:m2="http://ant.apache.org/ivy/maven"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd"
>
<info module="portos-maintenance-portlet" organisation="com.liferay">
<extends extendType="configurations,description,info" location="../../ivy.xml" module="com.liferay.sdk" organisation="com.liferay" revision="latest.integration" />
</info>
<dependencies defaultconf="default">
<dependency conf="test->default" name="arquillian-junit-container" org="org.jboss.arquillian.junit" rev="1.1.6.Final"/>
<dependency conf="test->default" name="arquillian-tomcat-remote-7" org="org.jboss.arquillian.container" rev="1.0.0.CR6"/>
<dependency conf="test->default" name="com.liferay.ant.arquillian" org="com.liferay" rev="1.0.0"/>
<dependency name="commons-net" org="commons-net" rev="3.4"/>
</dependencies>
</ivy-module>

1
liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/ivy.xml.MD5

@ -0,0 +1 @@
5cc166f15f8f11b9ca7581e8a8ee4066
Caricamento…
Annulla
Salva