Sfoglia il codice sorgente

Cambio branch

master
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. 776
      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. 7
      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. 32
      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. 7
      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. 20
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/action/MaintenancePreServletControl.java
  43. 8
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/action/MaintenanceStartAction.java
  44. 25
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/messaging/MaintenanceScheduleMessageListener.java
  45. 31
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/portlet/AdminMaintenancePortlet.java
  46. 17
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/portlet/MaintenancePollerPortlet.java
  47. 52
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/service/impl/MaintenanceScheduleLocalServiceImpl.java
  48. 33
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/service/impl/MaintenanceScheduleServiceImpl.java
  49. 56
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/servlet/MaintenanceServlet.java
  50. 4
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/util/DateTimeUtil.java
  51. 5
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/util/MaintenanceConstants.java
  52. 19
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/util/PortalMaintenanceUtil.java
  53. 4
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/service.properties
  54. 572
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/tld/c.tld
  55. 20
      liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/ivy.xml
  56. 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.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

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;
import it.tref.liferay.portos.bo.model.Collaudo;
import it.tref.liferay.portos.bo.model.Delega;
import it.tref.liferay.portos.bo.model.DettPratica;
import it.tref.liferay.portos.bo.model.DocPratica;
import it.tref.liferay.portos.bo.model.FineLavori;
import it.tref.liferay.portos.bo.model.IntPratica;
import it.tref.liferay.portos.bo.model.Pagamento;
import it.tref.liferay.portos.bo.model.Soggetto;
@ -13,20 +10,17 @@ import it.tref.liferay.portos.bo.service.DettPraticaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.DocPraticaLocalServiceUtil;
import it.tref.liferay.portos.bo.service.PagamentoLocalServiceUtil;
import it.tref.liferay.portos.bo.service.SoggettoLocalServiceUtil;
import it.tref.liferay.portos.bo.service.SoggettoServiceUtil;
import it.tref.liferay.portos.bo.shared.bean.FirmeBean;
import it.tref.liferay.portos.bo.shared.bean.FirmeDetail;
import it.tref.liferay.portos.bo.shared.util.ConfigurazioneConstants;
import it.tref.liferay.portos.bo.shared.util.DocumentiPraticaUtil;
import it.tref.liferay.portos.bo.shared.util.FirmeUtil;
import it.tref.liferay.portos.bo.shared.util.TipoSoggettoUtil;
import it.tref.liferay.portos.bo.util.PraticaUtil;
import it.tref.liferay.portos.bo.util.ValidazionePraticaUtil;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
@ -43,7 +37,6 @@ import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.repository.model.FileEntry;
import com.liferay.portal.kernel.repository.model.Folder;
import com.liferay.portal.kernel.servlet.SessionErrors;
import com.liferay.portal.kernel.upload.UploadPortletRequest;
import com.liferay.portal.kernel.util.FileUtil;
import com.liferay.portal.kernel.util.MimeTypesUtil;
@ -53,7 +46,6 @@ import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.model.User;
import com.liferay.portal.security.permission.ActionKeys;
import com.liferay.portal.service.ServiceContext;
import com.liferay.portal.service.ServiceContextFactory;
import com.liferay.portal.service.UserLocalServiceUtil;
import com.liferay.portal.util.PortalUtil;
import com.liferay.portlet.documentlibrary.NoSuchFolderException;
@ -280,208 +272,4 @@ public class AllegatiUtil {
}
return fileEntry;
}
public void sostituisciDL2(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
long userId = 0;
String title = null;
String description = null;
String mimeType = null;
String changeLog = StringPool.BLANK;
FileEntry fileEntry = null;
Date now = new Date();
long companyId = 0;
long groupId = 0;
long defaultFolderId = 0;
Folder defaultFolder = null;
String folderName = null;
byte[] bytes = null;
long folderId = 0;
long repositoryId = 0;
ServiceContext serviceContext = new ServiceContext();
String className = ParamUtil.getString(actionRequest, "className");
Long idOggetto = ParamUtil.getLong(actionRequest, "classPK");
UploadPortletRequest uploadRequest = PortalUtil.getUploadPortletRequest(actionRequest);
String sourceFileName = uploadRequest.getFileName("file");
File file = uploadRequest.getFile("file");
Folder folder = null;
switch (className) {
case "it.tref.liferay.portos.bo.model.DocPratica":
DocPratica pratica = DocPraticaLocalServiceUtil.getDocPratica(idOggetto);
userId = pratica.getUserId();
companyId = pratica.getCompanyId();
groupId = pratica.getGroupId();
serviceContext.setCompanyId(companyId);
serviceContext.setScopeGroupId(groupId);
serviceContext.setUserId(userId);
defaultFolderId = ConfigurazioneLocalServiceUtil.findByC_ChiaveLong(companyId,
ConfigurazioneConstants.ATTACHMENT_FOLDER_ID);
defaultFolder = DLAppLocalServiceUtil.getFolder(defaultFolderId);
folderName = PraticaUtil.getFolderName(pratica.getClassPk());
folderId = defaultFolder.getFolderId();
repositoryId = defaultFolder.getRepositoryId();
try {
folder = DLAppLocalServiceUtil.getFolder(repositoryId, folderId, folderName);
} catch (NoSuchFolderException e) {
folder = DLAppLocalServiceUtil.addFolder(userId, repositoryId, folderId, folderName,
StringPool.BLANK, serviceContext);
}
bytes = FileUtil.getBytes(file);
title = pratica.getTipologia() + StringPool.UNDERLINE + sourceFileName;
description = sourceFileName;
mimeType = MimeTypesUtil.getContentType(sourceFileName);
try {
fileEntry = DLAppLocalServiceUtil.getFileEntry(pratica.getDlFileEntryId());
fileEntry = DLAppLocalServiceUtil.updateFileEntry(userId, fileEntry.getFileEntryId(),
now.getTime() + "_" + sourceFileName, mimeType, title, description, changeLog, false,
bytes, serviceContext);
} catch (PortalException e) {
fileEntry = DLAppLocalServiceUtil.addFileEntry(userId, folder.getRepositoryId(),
folder.getFolderId(), now.getTime() + "_" + sourceFileName, mimeType, title,
description, changeLog, bytes, serviceContext);
}
pratica.setDlFileEntryId(fileEntry.getFileEntryId());
pratica.setSha256(DigestUtils.sha256Hex(bytes));
DocPraticaLocalServiceUtil.updateDocPratica(pratica);
break;
case "it.tref.liferay.portos.bo.model.Pagamento":
Pagamento pagamento = PagamentoLocalServiceUtil.getPagamento(idOggetto);
userId = pagamento.getUserId();
companyId = pagamento.getCompanyId();
groupId = pagamento.getGroupId();
serviceContext.setCompanyId(companyId);
serviceContext.setScopeGroupId(groupId);
serviceContext.setUserId(userId);
defaultFolderId = ConfigurazioneLocalServiceUtil.findByC_ChiaveLong(companyId,
ConfigurazioneConstants.ATTACHMENT_FOLDER_ID);
defaultFolder = DLAppLocalServiceUtil.getFolder(defaultFolderId);
folderName = PraticaUtil.getFolderName(pagamento.getClassPk());
folderId = defaultFolder.getFolderId();
repositoryId = defaultFolder.getRepositoryId();
try {
folder = DLAppLocalServiceUtil.getFolder(repositoryId, folderId, folderName);
} catch (NoSuchFolderException e) {
folder = DLAppLocalServiceUtil.addFolder(userId, repositoryId, folderId, folderName,
StringPool.BLANK, serviceContext);
}
bytes = FileUtil.getBytes(file);
title = now.getTime() + StringPool.UNDERLINE + "pagamento_manuale" + StringPool.UNDERLINE
+ pagamento.getPagamentoId() + StringPool.UNDERLINE + sourceFileName;
description = StringPool.BLANK;
mimeType = MimeTypesUtil.getContentType(sourceFileName);
try {
fileEntry = DLAppLocalServiceUtil.getFileEntry(pagamento.getFileEntryId());
fileEntry = DLAppLocalServiceUtil.updateFileEntry(userId, fileEntry.getFileEntryId(),
now.getTime() + "_" + sourceFileName, mimeType, title, description, changeLog, false,
bytes, serviceContext);
} catch (PortalException e) {
fileEntry = DLAppLocalServiceUtil.addFileEntry(userId, folder.getRepositoryId(),
folder.getFolderId(), now.getTime() + "_" + sourceFileName, mimeType, title,
description, changeLog, bytes, serviceContext);
}
pagamento.setFileEntryId(fileEntry.getFileEntryId());
PagamentoLocalServiceUtil.updatePagamento(pagamento);
break;
case "var_soggetti_no_docpratica":
Soggetto soggetto = SoggettoLocalServiceUtil.getSoggetto(idOggetto);
DettPratica dettPratica = DettPraticaLocalServiceUtil.getDettPratica(soggetto.getDettPraticaId());
long intPraticaId = dettPratica.getIntPraticaId();
serviceContext = ServiceContextFactory.getInstance(Soggetto.class.getName(), actionRequest);
byte[] content = null;
String jsonFirmatari = "";
boolean isSigned = false;
FirmeBean firmeBean = new FirmeBean();
User user = UserLocalServiceUtil.getUser(serviceContext.getUserId());
if (!firmeBean.allSignatures().contains(user.getScreenName())) {
jsonFirmatari = FirmeUtil.addFirma(firmeBean, user.getScreenName());
} else {
jsonFirmatari = FirmeUtil.serialize(firmeBean);
}
if (file.exists()) {
if (Validator.isNotNull(sourceFileName) && file != null) {
// validazione: solo alcune estensioni
String ext = FileUtil.getExtension(sourceFileName);
if (!ext.equalsIgnoreCase("p7m") && !ext.equalsIgnoreCase("pdf")) {
SessionErrors.add(actionRequest,
"error.geniocivilefe.variazione-soggetto.allegato.ext.valid");
}
// lunghezza fissata a 200
if (sourceFileName.length() > 200) {
SessionErrors.add(actionRequest,
"error.geniocivilefe.variazione-soggetto.allegato.length.valid");
}
} else if (!TipoSoggettoUtil.COMMITTENTE.equalsIgnoreCase(soggetto.getTipologiaSoggetto())) {
SessionErrors.add(actionRequest,
"error.geniocivilefe.variazione-soggetto.allegato.is.request");
}
if (!SessionErrors.isEmpty(actionRequest)) {
throw new SystemException("error.geniocivilefe.variazione-soggetto.allegato");
} else if (file != null) {
content = FileUtil.getBytes(file);
}
}
if (TipoSoggettoUtil.COMMITTENTE.equals(soggetto.getTipologiaSoggetto())) {
String[] titolare = new String[] { dettPratica.getCodiceFiscaleDelegatoCommittente() };
isSigned = ValidazionePraticaUtil.isAllegatoSignedBySubjects(sourceFileName, content,
serviceContext.getCompanyId(), Arrays.asList(titolare), jsonFirmatari);
} else {
List<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.ParamUtil;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.ThreadUtil;
import com.liferay.portal.kernel.util.Validator;
import com.liferay.portal.kernel.util.WebKeys;
import com.liferay.portal.kernel.workflow.WorkflowException;
@ -118,6 +119,7 @@ public class SismicaUtil {
private final static int SLICE = 1000;
public static Date[] getWeekInterval(int dow) {
ThreadUtil.threadDump();
return getWeekInterval(dow, Calendar.getInstance().getTime());
}

776
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)
throws PortalException, SystemException {
String mode = ParamUtil.getString(actionRequest, "mode");
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()]));
}

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

@ -539,14 +539,11 @@ public class AsseverazioneLocalServiceImpl extends AsseverazioneLocalServiceBase
@Override
public Asseverazione deleteAsseverazione(Asseverazione asseverazione) throws SystemException {
try {
if (Validator.isNotNull(asseverazione.getFileEntryId())) {
try {
dlAppLocalService.deleteFileEntry(asseverazione.getFileEntryId());
}
} catch (NoSuchFileEntryException | NoSuchRepositoryEntryException e) {
} catch (PortalException e) {
throw new SystemException(e);
}
}
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
public Delega deleteDelega(Delega delega) throws SystemException {
// TODO cancellare il file quando ci sar�
return super.deleteDelega(delega);
}

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

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

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

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

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.number=2518
build.date=1604412381894
build.number=2519
build.date=1604417083352
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.util.comparator.GroupIdComparator"%>
<%@page import="com.liferay.portal.kernel.util.ArrayUtil"%>

7
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" />
<div class="row-fluid" style="margin-top: 10px;">
<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">
<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>
</aui:form>
</div>
@ -184,7 +185,7 @@ String dataProssimoSorteggio =
value="<%=Soggetto.class.getName()%>"></aui:option>
</aui:select>
<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:input>
<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>
<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 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-codec" org="commons-codec" rev="1.10"/>
<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-resource deploy-path="/" source-path="/docroot" tag="defaultRootSource"/>
<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>
</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>
</dependent-module>
<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=""/>
</attributes>
</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"/>
</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.jdt.core.javanature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
<nature>org.apache.ivyde.eclipse.ivynature</nature>
</natures>
</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-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="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>
</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"?>
<classpath>
<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">
<attributes>
<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-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/service"/>
<property name="context-root" value="portos-mail-manager-portlet"/>
<property name="java-output-path" value="/portos-mail-manager-portlet/docroot/WEB-INF/classes"/>
</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
public EmailAttachment deleteEmailAttachment(EmailAttachment emailAttachment) throws SystemException {
super.deleteEmailAttachment(emailAttachment);
// File Entry
try {
dlAppLocalService.deleteFileEntry(emailAttachment.getFileEntryId());
} catch (PortalException e) {
}
super.deleteEmailAttachment(emailAttachment);
return emailAttachment;
}

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

@ -18,5 +18,6 @@
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes>
</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"/>
</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.jdt.core.javanature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
<nature>org.apache.ivyde.eclipse.ivynature</nature>
</natures>
</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
url-help = Indirizzo da invocare per la dismissione della modalità di manutenzione
url-help = Indirizzo da invocare per la dismissione della modalità  di manutenzione
message-help = Messaggio da visualizzare nella finestra di manutenzione
maintenance-schedule-id=Id

20
liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/action/MaintenancePreServletControl.java

@ -29,7 +29,7 @@ public class MaintenancePreServletControl extends Action {
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;
@ -42,12 +42,13 @@ public class MaintenancePreServletControl extends Action {
ServiceContext serviceContext = ServiceContextFactory.getInstance(request);
List<MaintenanceSchedule> maintenanceSchedules =
MaintenanceScheduleLocalServiceUtil.findByStatus(MaintenanceStatus.IN_PROGRESS.getCode());
List<MaintenanceSchedule> maintenanceSchedules = MaintenanceScheduleLocalServiceUtil
.findByStatus(MaintenanceStatus.IN_PROGRESS.getCode());
if (!maintenanceSchedules.isEmpty()) {
MaintenanceType maintenanceType = MaintenanceType.parse(maintenanceSchedules.get(0).getType());
MaintenanceType maintenanceType = MaintenanceType
.parse(maintenanceSchedules.get(0).getType());
if (maintenanceType == MaintenanceType.FULL) {
@ -63,12 +64,16 @@ public class MaintenancePreServletControl extends Action {
if (user.isDefaultUser()) {// Se non loggato
response.sendRedirect(getLoginUrlRedirect(request));
throw new ActionException("Maintenance mode active");
} else if (!PortalUtil.isCompanyAdmin(user)) {// Se non admin
} else if (!PortalUtil.isCompanyAdmin(user)) {// Se non
// admin
response.sendRedirect("/html/portal/maintenance.jsp");
throw new ActionException("Maintenance mode active");
}
} else {
if (!user.isDefaultUser() && !PortalUtil.isCompanyAdmin(user)) {// Se loggato non admin
if (!user.isDefaultUser() && !PortalUtil.isCompanyAdmin(user)) {// Se
// loggato
// non
// admin
response.sendRedirect("/html/portal/maintenance.jsp");
throw new ActionException("Maintenance mode active");
}
@ -88,7 +93,8 @@ public class MaintenancePreServletControl extends Action {
if (loginUrlRedirect == null) {
loginUrlRedirect = PortalUtil.getPortalURL(request);
loginUrlRedirect = HttpUtil.addParameter(loginUrlRedirect, "p_p_id", PortletKeys.LOGIN);
loginUrlRedirect = HttpUtil.addParameter(loginUrlRedirect, "p_p_state", WindowState.MAXIMIZED.toString());
loginUrlRedirect = HttpUtil.addParameter(loginUrlRedirect, "p_p_state",
WindowState.MAXIMIZED.toString());
loginUrlRedirect = HttpUtil.addParameter(loginUrlRedirect, "p_p_lifecycle", "0");
}

8
liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/action/MaintenanceStartAction.java

@ -21,12 +21,12 @@ public class MaintenanceStartAction extends SimpleAction {
try {
List<MaintenanceSchedule> maintenanceSchedules =
MaintenanceScheduleLocalServiceUtil.findByCompleted_Onreboot(Boolean.FALSE,
MaintenanceOnReboot.TERMINATE.getCode());
List<MaintenanceSchedule> maintenanceSchedules = MaintenanceScheduleLocalServiceUtil
.findByCompleted_Onreboot(Boolean.FALSE, MaintenanceOnReboot.TERMINATE.getCode());
for (MaintenanceSchedule maintenanceSchedule : maintenanceSchedules) {
MaintenanceScheduleLocalServiceUtil.updateStatus(maintenanceSchedule.getMaintenanceScheduleId(),
MaintenanceScheduleLocalServiceUtil.updateStatus(
maintenanceSchedule.getMaintenanceScheduleId(),
MaintenanceStatus.FORCE_ENDED.getCode(), "Ended for server reboot.");
}

25
liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/messaging/MaintenanceScheduleMessageListener.java

@ -35,7 +35,6 @@ public class MaintenanceScheduleMessageListener implements MessageListener {
try {
ActionableDynamicQuery actionableDynamicQuery = new MaintenanceScheduleActionableDynamicQuery() {
@Override
@ -53,42 +52,47 @@ public class MaintenanceScheduleMessageListener implements MessageListener {
if (status == MaintenanceStatus.NEW) {
if (!MaintenanceScheduleLocalServiceUtil.findByStatus(MaintenanceStatus.IN_PROGRESS.getCode()).isEmpty()) {
if (!MaintenanceScheduleLocalServiceUtil.findByStatus(
MaintenanceStatus.IN_PROGRESS.getCode()).isEmpty()) {
throw new SystemException("Concurrent maintenance scheduled.");
}
if (Validator.isNotNull(maintenanceSchedule.getAfter()) && maintenanceSchedule.getAfter() > 0l) {
if (Validator.isNotNull(maintenanceSchedule.getAfter())
&& maintenanceSchedule.getAfter() > 0l) {
Date maintenanceStartDate = MaintenanceDateUtil.getStartDate(maintenanceSchedule);
Date maintenanceStartDate = MaintenanceDateUtil
.getStartDate(maintenanceSchedule);
if (DateUtil.newDate().after(maintenanceStartDate)) {
MaintenanceScheduleLocalServiceUtil.updateStatus(maintenanceSchedule.getMaintenanceScheduleId(),
MaintenanceScheduleLocalServiceUtil.updateStatus(
maintenanceSchedule.getMaintenanceScheduleId(),
MaintenanceStatus.IN_PROGRESS.getCode());
}
} else {
MaintenanceScheduleLocalServiceUtil.updateStatus(maintenanceSchedule.getMaintenanceScheduleId(),
MaintenanceScheduleLocalServiceUtil.updateStatus(
maintenanceSchedule.getMaintenanceScheduleId(),
MaintenanceStatus.IN_PROGRESS.getCode());
}
} else if (status == MaintenanceStatus.IN_PROGRESS) {
if (Validator.isNotNull(maintenanceSchedule.getEnd())
&& DateUtil.newDate().after(maintenanceSchedule.getEnd())) {
MaintenanceScheduleLocalServiceUtil.updateStatus(maintenanceSchedule.getMaintenanceScheduleId(),
MaintenanceScheduleLocalServiceUtil.updateStatus(
maintenanceSchedule.getMaintenanceScheduleId(),
MaintenanceStatus.ENDED.getCode());
}
}
} catch (Exception e) {
_log.error("MaintenaceMode error", e);
MaintenanceScheduleLocalServiceUtil.updateStatus(maintenanceSchedule.getMaintenanceScheduleId(),
MaintenanceScheduleLocalServiceUtil.updateStatus(
maintenanceSchedule.getMaintenanceScheduleId(),
MaintenanceStatus.ERROR.getCode(), e.getMessage());
}
}
@ -105,5 +109,4 @@ public class MaintenanceScheduleMessageListener implements MessageListener {
}
}
}

31
liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/portlet/AdminMaintenancePortlet.java

@ -39,8 +39,7 @@ public class AdminMaintenancePortlet extends MVCPortlet {
String message = ParamUtil.getString(actionRequest, "message");
String className =
LanguageUtil
String className = LanguageUtil
.get(LocaleUtil.getDefault(),
"the-sign-in-process-is-temporarily-disabled-because-the-portal-is-undergoing-a-routine-maintenance-upgrade");
@ -48,17 +47,17 @@ public class AdminMaintenancePortlet extends MVCPortlet {
className = message;
}
Class<?> clazz =
ClassResolverUtil.resolve("com.liferay.portal.util.MaintenanceUtil", PortalClassLoaderUtil.getClassLoader());
Class<?> clazz = ClassResolverUtil.resolve("com.liferay.portal.util.MaintenanceUtil",
PortalClassLoaderUtil.getClassLoader());
ReflectionUtil.getDeclaredMethod(clazz, "maintain", String.class, String.class).invoke(null,
portletSession.getId(), className);
_log.info("Maintenance session id: " + portletSession.getId());
}
public void deleteMaintenanceSchedule(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
public void deleteMaintenanceSchedule(ActionRequest actionRequest, ActionResponse actionResponse)
throws Exception {
_log.info("deleteMaintenanceSchedule - Inizio metodo");
ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest);
@ -68,7 +67,8 @@ public class AdminMaintenancePortlet extends MVCPortlet {
}
public void editMaintenanceSchedule(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
public void editMaintenanceSchedule(ActionRequest actionRequest, ActionResponse actionResponse)
throws Exception {
_log.info("editMaintenanceSchedule - Inizio metodo");
String cmd = ParamUtil.getString(actionRequest, Constants.CMD);
@ -86,21 +86,22 @@ public class AdminMaintenancePortlet extends MVCPortlet {
Calendar calendarEnd = Calendar.getInstance();
calendarEnd.set(ParamUtil.getInteger(actionRequest, "endYear"),
ParamUtil.getInteger(actionRequest, "endMonth") + 1, ParamUtil.getInteger(actionRequest, "endDay"),
ParamUtil.getInteger(actionRequest, "endHour"), ParamUtil.getInteger(actionRequest, "endMinute"));
ParamUtil.getInteger(actionRequest, "endMonth") + 1,
ParamUtil.getInteger(actionRequest, "endDay"),
ParamUtil.getInteger(actionRequest, "endHour"),
ParamUtil.getInteger(actionRequest, "endMinute"));
MaintenanceSchedule maintenanceSchedule = null;
try {
if (cmd.equals(Constants.ADD)) {
maintenanceSchedule =
MaintenanceScheduleServiceUtil.addMaintenanceSchedule(type, reason, portalMessage, after,
calendarEnd.getTime(), onreboot, serviceContext);
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);
maintenanceSchedule = MaintenanceScheduleServiceUtil.updateMaintenanceSchedule(
maintenanceScheduleId, type, reason, portalMessage, after, calendarEnd.getTime(),
onreboot, status, statusMessage, serviceContext);
}
} catch (PortalException e) {

17
liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/portlet/MaintenancePollerPortlet.java

@ -27,12 +27,11 @@ import javax.portlet.ResourceResponse;
*/
public class MaintenancePollerPortlet extends MVCPortlet {
private static final long ONE_HOUR = 3600000;// ms
@Override
public void serveResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse) throws IOException,
PortletException {
public void serveResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse)
throws IOException, PortletException {
String resourceID = GetterUtil.getString(resourceRequest.getResourceID());
@ -43,21 +42,21 @@ public class MaintenancePollerPortlet extends MVCPortlet {
JSONObject responseData = JSONFactoryUtil.createJSONObject();
responseData.put("maintenanceExpected", false);
List<MaintenanceSchedule> maintenanceSchedules =
MaintenanceScheduleLocalServiceUtil.findByStatus(MaintenanceStatus.NEW.getCode());
List<MaintenanceSchedule> maintenanceSchedules = MaintenanceScheduleLocalServiceUtil
.findByStatus(MaintenanceStatus.NEW.getCode());
for (MaintenanceSchedule maintenanceSchedule : maintenanceSchedules) {
Date maintenanceStartDate =
DateTimeUtil.scaleToNextMinute(MaintenanceDateUtil.getStartDate(maintenanceSchedule));
Date maintenanceStartDate = DateTimeUtil.scaleToNextMinute(MaintenanceDateUtil
.getStartDate(maintenanceSchedule));
long timeDiff = maintenanceStartDate.getTime() - DateUtil.newDate().getTime();
if (timeDiff < ONE_HOUR) {
responseData.put("maintenanceExpected", true);
responseData.put("startFrom", timeDiff);
responseData.put("maintenanceScheduleId", maintenanceSchedule.getMaintenanceScheduleId());
responseData.put("maintenanceScheduleId",
maintenanceSchedule.getMaintenanceScheduleId());
break;
}
}

52
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.
*
* <p>
* All custom service methods should be put in this class. Whenever methods are added, rerun
* ServiceBuilder to copy their definitions into the
* {@link it.tref.liferay.portos.maintenance.service.MaintenanceScheduleLocalService} interface.
* All custom service methods should be put in this class. Whenever methods are
* added, rerun ServiceBuilder to copy their definitions into the
* {@link it.tref.liferay.portos.maintenance.service.MaintenanceScheduleLocalService}
* interface.
*
* <p>
* This is a local service. Methods of this service will not have security checks based on the
* propagated JAAS credentials because this service can only be accessed from within the same VM.
* This is a local service. Methods of this service will not have security
* checks based on the propagated JAAS credentials because this service can only
* be accessed from within the same VM.
* </p>
*
* @author
@ -59,16 +61,18 @@ public class MaintenanceScheduleLocalServiceImpl extends MaintenanceScheduleLoca
* NOTE FOR DEVELOPERS:
*
* Never reference this interface directly. Always use {@link
* it.tref.liferay.portos.maintenance.service.MaintenanceScheduleLocalServiceUtil} to access the
* maintenance schedule local service.
* it.tref.liferay
* .portos.maintenance.service.MaintenanceScheduleLocalServiceUtil} to
* access the maintenance schedule local service.
*/
@Override
public MaintenanceSchedule addMaintenanceSchedule(String type, String reason, String portalMessage, long after,
Date end, String onreboot, ServiceContext serviceContext) throws SystemException, PortalException {
public MaintenanceSchedule addMaintenanceSchedule(String type, String reason, String portalMessage,
long after, Date end, String onreboot, ServiceContext serviceContext) throws SystemException,
PortalException {
MaintenanceSchedule maintenanceSchedule =
MaintenanceScheduleUtil.create(counterLocalService.increment(MaintenanceSchedule.class.getName()));
MaintenanceSchedule maintenanceSchedule = MaintenanceScheduleUtil.create(counterLocalService
.increment(MaintenanceSchedule.class.getName()));
validate(type, reason, after, end, onreboot);
@ -93,16 +97,17 @@ public class MaintenanceScheduleLocalServiceImpl extends MaintenanceScheduleLoca
}
@Override
public MaintenanceSchedule updateMaintenanceSchedule(long maintenanceScheduleId, String type, String reason,
String portalMessage, long after, Date end, String onreboot, String status, String statusMessage,
ServiceContext serviceContext) throws SystemException, PortalException {
public MaintenanceSchedule updateMaintenanceSchedule(long maintenanceScheduleId, String type,
String reason, String portalMessage, long after, Date end, String onreboot, String status,
String statusMessage, ServiceContext serviceContext) throws SystemException, PortalException {
MaintenanceSchedule maintenanceSchedule = getMaintenanceSchedule(maintenanceScheduleId);
validate(type, reason, after, end, onreboot);
if (Validator.isNotNull(status)) {
maintenanceSchedule = updateStatus(maintenanceSchedule.getMaintenanceScheduleId(), status, statusMessage);
maintenanceSchedule = updateStatus(maintenanceSchedule.getMaintenanceScheduleId(), status,
statusMessage);
}
maintenanceSchedule.setModifiedDate(DateUtil.newDate());
@ -117,10 +122,9 @@ public class MaintenanceScheduleLocalServiceImpl extends MaintenanceScheduleLoca
return updateMaintenanceSchedule(maintenanceSchedule);
}
@Override
public MaintenanceSchedule updateStatus(long maintenanceScheduleId, String status) throws PortalException,
SystemException {
public MaintenanceSchedule updateStatus(long maintenanceScheduleId, String status)
throws PortalException, SystemException {
return updateStatus(maintenanceScheduleId, status, null);
}
@ -140,7 +144,8 @@ public class MaintenanceScheduleLocalServiceImpl extends MaintenanceScheduleLoca
maintenanceSchedule.setStatus(maintenanceStatus.getCode());
maintenanceSchedule.setStatusMessage(statusMessage);
if (maintenanceStatus == MaintenanceStatus.ENDED || maintenanceStatus == MaintenanceStatus.FORCE_ENDED
if (maintenanceStatus == MaintenanceStatus.ENDED
|| maintenanceStatus == MaintenanceStatus.FORCE_ENDED
|| maintenanceStatus == MaintenanceStatus.ERROR) {
maintenanceSchedule.setCompleted(Boolean.TRUE);
} else {
@ -155,7 +160,8 @@ public class MaintenanceScheduleLocalServiceImpl extends MaintenanceScheduleLoca
return maintenanceSchedulePersistence.findByStatus(status);
}
private void validate(String type, String reason, long after, Date end, String onreboot) throws PortalException {
private void validate(String type, String reason, long after, Date end, String onreboot)
throws PortalException {
if (Validator.isNull(type)) {
throw new RequiredMaintenanceTypeException();
@ -184,12 +190,14 @@ public class MaintenanceScheduleLocalServiceImpl extends MaintenanceScheduleLoca
}
@Override
public List<MaintenanceSchedule> findByC_Completed(long companyId, boolean completed) throws SystemException {
public List<MaintenanceSchedule> findByC_Completed(long companyId, boolean completed)
throws SystemException {
return maintenanceSchedulePersistence.findByC_Completed(companyId, completed);
}
@Override
public List<MaintenanceSchedule> findByCompleted_Onreboot(boolean completed, String onreboot) throws SystemException {
public List<MaintenanceSchedule> findByCompleted_Onreboot(boolean completed, String onreboot)
throws SystemException {
return maintenanceSchedulePersistence.findByCompleted_Onreboot(completed, onreboot);
}

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

56
liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/servlet/MaintenanceServlet.java

@ -65,7 +65,8 @@ public class MaintenanceServlet extends HttpServlet {
private static final Log _log = LogFactoryUtil.getLog(MaintenanceServlet.class);
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException,
IOException {
JSONObject jsonResponse = JSONFactoryUtil.createJSONObject();
@ -114,35 +115,32 @@ public class MaintenanceServlet extends HttpServlet {
}
private MaintenanceSchedule stopMaintenance(Map<String, String[]> params) throws IllegalAccessException,
IllegalArgumentException, InvocationTargetException, Exception {
MaintenanceSchedule result = null;
boolean force =
params.get(FORCE_PARAM) != null && params.get(FORCE_PARAM).length > 0 ? Boolean
boolean force = params.get(FORCE_PARAM) != null && params.get(FORCE_PARAM).length > 0 ? Boolean
.valueOf(params.get(FORCE_PARAM)[0]) : false;
if (force) {
PortalMaintenanceUtil.stopMaintenaceMode();
List<MaintenanceSchedule> maintenanceSchedules =
MaintenanceScheduleLocalServiceUtil.findByStatus(MaintenanceStatus.IN_PROGRESS.getCode());
List<MaintenanceSchedule> maintenanceSchedules = MaintenanceScheduleLocalServiceUtil
.findByStatus(MaintenanceStatus.IN_PROGRESS.getCode());
for (MaintenanceSchedule maintenanceSchedule : maintenanceSchedules) {
MaintenanceScheduleLocalServiceUtil.updateStatus(maintenanceSchedule.getMaintenanceScheduleId(),
MaintenanceStatus.FORCE_ENDED.getCode(), "Stop forced at " + sdf.format(DateUtil.newDate()));
MaintenanceScheduleLocalServiceUtil.updateStatus(
maintenanceSchedule.getMaintenanceScheduleId(),
MaintenanceStatus.FORCE_ENDED.getCode(),
"Stop forced at " + sdf.format(DateUtil.newDate()));
}
return null;
}
int stopAfter =
params.get(STOP_AFTER_PARAM) != null && params.get(STOP_AFTER_PARAM).length > 0 ? Integer.valueOf(params
.get(STOP_AFTER_PARAM)[0]) : 0;
int stopAfter = params.get(STOP_AFTER_PARAM) != null && params.get(STOP_AFTER_PARAM).length > 0 ? Integer
.valueOf(params.get(STOP_AFTER_PARAM)[0]) : 0;
List<MaintenanceSchedule> maintenanceSchedules =
MaintenanceScheduleLocalServiceUtil.findByStatus(MaintenanceStatus.IN_PROGRESS.getCode());
List<MaintenanceSchedule> maintenanceSchedules = MaintenanceScheduleLocalServiceUtil
.findByStatus(MaintenanceStatus.IN_PROGRESS.getCode());
if (!maintenanceSchedules.isEmpty()) {
@ -172,8 +170,7 @@ public class MaintenanceServlet extends HttpServlet {
private MaintenanceSchedule startMaintenance(Map<String, String[]> params, ServiceContext serviceContext)
throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, Exception {
boolean force =
params.get(FORCE_PARAM) != null && params.get(FORCE_PARAM).length > 0 ? Boolean
boolean force = params.get(FORCE_PARAM) != null && params.get(FORCE_PARAM).length > 0 ? Boolean
.valueOf(params.get(FORCE_PARAM)[0]) : false;
if (force) {
@ -187,21 +184,19 @@ public class MaintenanceServlet extends HttpServlet {
end = sdf.parse(endParam[0]);
}
String type =
params.get(TYPE_PARAM) != null && params.get(TYPE_PARAM).length > 0 ? params.get(TYPE_PARAM)[0] : null;
String reason =
params.get(REASON_PARAM) != null && params.get(REASON_PARAM).length > 0 ? params.get(REASON_PARAM)[0] : null;
long after =
params.get(AFTER_PARAM) != null && params.get(AFTER_PARAM).length > 0 ? Long
String type = params.get(TYPE_PARAM) != null && params.get(TYPE_PARAM).length > 0 ? params
.get(TYPE_PARAM)[0] : null;
String reason = params.get(REASON_PARAM) != null && params.get(REASON_PARAM).length > 0 ? params
.get(REASON_PARAM)[0] : null;
long after = params.get(AFTER_PARAM) != null && params.get(AFTER_PARAM).length > 0 ? Long
.valueOf(params.get(AFTER_PARAM)[0]) : 0l;
String onreboot =
params.get(ONREBOOT_PARAM) != null && params.get(ONREBOOT_PARAM).length > 0 ? params.get(ONREBOOT_PARAM)[0]
: null;
String message =
params.get(MESSAGE_PARAM) != null && params.get(MESSAGE_PARAM).length > 0 ? params.get(MESSAGE_PARAM)[0] : null;
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);
return MaintenanceScheduleLocalServiceUtil.addMaintenanceSchedule(type, reason, message, after, end,
onreboot, serviceContext);
}
@ -234,7 +229,6 @@ public class MaintenanceServlet extends HttpServlet {
}
private void sendErrorResponse(HttpServletResponse response, int scInternalServerError, String message)
throws IOException {
JSONObject jsonResponse = JSONFactoryUtil.createJSONObject();

4
liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/util/DateTimeUtil.java

@ -20,8 +20,8 @@ public class DateTimeUtil {
}
/**
* This method add a minute , remove seconds and milliseconds to the input date. If seconds and
* milliseconds are equal to 0, return the input.
* This method add a minute , remove seconds and milliseconds to the input
* date. If seconds and milliseconds are equal to 0, return the input.
*
* @param input
* @return the date scaled or the input if doesn't require scaling.

5
liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/util/MaintenanceConstants.java

@ -1,6 +1,5 @@
package it.tref.liferay.portos.maintenance.util;
public class MaintenanceConstants {
public enum MaintenanceType {
@ -87,8 +86,8 @@ public class MaintenanceConstants {
public enum MaintenanceStatus {
NEW("N", "New"), IN_PROGRESS("P", "In Progress"), ENDED("E", "Ended"), FORCE_ENDED("FE", "Force Ended"), ERROR(
"ER", "Error");
NEW("N", "New"), IN_PROGRESS("P", "In Progress"), ENDED("E", "Ended"), FORCE_ENDED("FE",
"Force Ended"), ERROR("ER", "Error");
MaintenanceStatus(String code, String description) {
this.setCode(code);

19
liferay-plugins-sdk-6.2/portlets/portos-maintenance-portlet/docroot/WEB-INF/src/it/tref/liferay/portos/maintenance/util/PortalMaintenanceUtil.java

@ -11,11 +11,10 @@ import java.lang.reflect.InvocationTargetException;
public class PortalMaintenanceUtil {
public static void startMaintenaceMode(String sessionId, String classNameParam) throws IllegalAccessException,
IllegalArgumentException, InvocationTargetException, Exception {
public static void startMaintenaceMode(String sessionId, String classNameParam)
throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, Exception {
String className =
LanguageUtil
String className = LanguageUtil
.get(LocaleUtil.getDefault(),
"the-sign-in-process-is-temporarily-disabled-because-the-portal-is-undergoing-a-routine-maintenance-upgrade");
@ -23,19 +22,19 @@ public class PortalMaintenanceUtil {
className = classNameParam;
}
Class<?> clazz =
ClassResolverUtil.resolve("com.liferay.portal.util.MaintenanceUtil", PortalClassLoaderUtil.getClassLoader());
ReflectionUtil.getDeclaredMethod(clazz, "maintain", String.class, String.class).invoke(null, sessionId, className);
Class<?> clazz = ClassResolverUtil.resolve("com.liferay.portal.util.MaintenanceUtil",
PortalClassLoaderUtil.getClassLoader());
ReflectionUtil.getDeclaredMethod(clazz, "maintain", String.class, String.class).invoke(null,
sessionId, className);
}
public static void stopMaintenaceMode() throws IllegalAccessException, IllegalArgumentException,
InvocationTargetException, Exception {
Class<?> clazz =
ClassResolverUtil.resolve("com.liferay.portal.util.MaintenanceUtil", PortalClassLoaderUtil.getClassLoader());
Class<?> clazz = ClassResolverUtil.resolve("com.liferay.portal.util.MaintenanceUtil",
PortalClassLoaderUtil.getClassLoader());
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.number=42
build.date=1569596970763
build.number=44
build.date=1605008600382
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