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

2
liferay-plugins-sdk-6.2/portlets/portos-bo-portlet/docroot/WEB-INF/liferay-plugin-package.properties

@ -21,4 +21,4 @@ portal-dependency-tlds=\
required-deployment-contexts=\
hms-taglib-hook,\
portos-kaleo-portlet,\
portos-mail-manager-portlet
portos-mail-manager-portlet

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());
}

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)
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()]));
}

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

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

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

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

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"%>

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" />
<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>
@ -134,7 +135,7 @@ String dataProssimoSorteggio =
</div>
<%
String tipoAvviso = ParamUtil.getString(renderRequest, "tipoAvviso", "");
String numeroProgetto = ParamUtil.getString(renderRequest, "numeroProgetto", "");
String numeroProgetto = ParamUtil.getString(renderRequest, "numeroProgetto", "");
%>
<div class="span6">
<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>
</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

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 {
private static final Log _log = LogFactoryUtil.getLog(MaintenancePreServletControl.class);
private static final Log _log = LogFactoryUtil.getLog(MaintenancePreServletControl.class);
private static final String[] allowedPortlets = new String[] {PortletKeys.LOGIN};
private static final String[] allowedPortlets = new String[] { PortletKeys.LOGIN };
private static String loginUrlRedirect = null;
private static String loginUrlRedirect = null;
@Override
public void run(HttpServletRequest request, HttpServletResponse response) throws ActionException {
@Override
public void run(HttpServletRequest request, HttpServletResponse response) throws ActionException {
// _log.info("INZIO MaintenancePreServletControl --------------->");
// _log.info("INZIO MaintenancePreServletControl --------------->");
try {
try {
ServiceContext serviceContext = ServiceContextFactory.getInstance(request);
ServiceContext serviceContext = ServiceContextFactory.getInstance(request);
List<MaintenanceSchedule> maintenanceSchedules =
MaintenanceScheduleLocalServiceUtil.findByStatus(MaintenanceStatus.IN_PROGRESS.getCode());
List<MaintenanceSchedule> maintenanceSchedules = MaintenanceScheduleLocalServiceUtil
.findByStatus(MaintenanceStatus.IN_PROGRESS.getCode());
if (!maintenanceSchedules.isEmpty()) {
if (!maintenanceSchedules.isEmpty()) {
MaintenanceType maintenanceType = MaintenanceType.parse(maintenanceSchedules.get(0).getType());
MaintenanceType maintenanceType = MaintenanceType
.parse(maintenanceSchedules.get(0).getType());
if (maintenanceType == MaintenanceType.FULL) {
if (maintenanceType == MaintenanceType.FULL) {
response.sendRedirect("/html/portal/maintenance.jsp");
throw new ActionException("Maintenance mode active");
response.sendRedirect("/html/portal/maintenance.jsp");
throw new ActionException("Maintenance mode active");
} else if (maintenanceType == MaintenanceType.USER) {
} else if (maintenanceType == MaintenanceType.USER) {
User user = UserLocalServiceUtil.fetchUser(serviceContext.getUserId());
User user = UserLocalServiceUtil.fetchUser(serviceContext.getUserId());
// Se request per portlet non consentite (LOGIN)
if (!ArrayUtil.contains(allowedPortlets, ParamUtil.getString(request, "p_p_id"))) {
if (user.isDefaultUser()) {// Se non loggato
response.sendRedirect(getLoginUrlRedirect(request));
throw new ActionException("Maintenance mode active");
} else if (!PortalUtil.isCompanyAdmin(user)) {// Se non admin
response.sendRedirect("/html/portal/maintenance.jsp");
throw new ActionException("Maintenance mode active");
}
} else {
if (!user.isDefaultUser() && !PortalUtil.isCompanyAdmin(user)) {// Se loggato non admin
response.sendRedirect("/html/portal/maintenance.jsp");
throw new ActionException("Maintenance mode active");
}
}
}
// Se request per portlet non consentite (LOGIN)
if (!ArrayUtil.contains(allowedPortlets, ParamUtil.getString(request, "p_p_id"))) {
if (user.isDefaultUser()) {// Se non loggato
response.sendRedirect(getLoginUrlRedirect(request));
throw new ActionException("Maintenance mode active");
} else if (!PortalUtil.isCompanyAdmin(user)) {// Se non
// admin
response.sendRedirect("/html/portal/maintenance.jsp");
throw new ActionException("Maintenance mode active");
}
} else {
if (!user.isDefaultUser() && !PortalUtil.isCompanyAdmin(user)) {// Se
// loggato
// non
// admin
response.sendRedirect("/html/portal/maintenance.jsp");
throw new ActionException("Maintenance mode active");
}
}
}
}
}
} catch (Exception e) {
_log.error(e);
}
} catch (Exception e) {
_log.error(e);
}
}
}
private String getLoginUrlRedirect(HttpServletRequest request) {
private String getLoginUrlRedirect(HttpServletRequest request) {
if (loginUrlRedirect == null) {
loginUrlRedirect = PortalUtil.getPortalURL(request);
loginUrlRedirect = HttpUtil.addParameter(loginUrlRedirect, "p_p_id", PortletKeys.LOGIN);
loginUrlRedirect = HttpUtil.addParameter(loginUrlRedirect, "p_p_state", WindowState.MAXIMIZED.toString());
loginUrlRedirect = HttpUtil.addParameter(loginUrlRedirect, "p_p_lifecycle", "0");
}
if (loginUrlRedirect == null) {
loginUrlRedirect = PortalUtil.getPortalURL(request);
loginUrlRedirect = HttpUtil.addParameter(loginUrlRedirect, "p_p_id", PortletKeys.LOGIN);
loginUrlRedirect = HttpUtil.addParameter(loginUrlRedirect, "p_p_state",
WindowState.MAXIMIZED.toString());
loginUrlRedirect = HttpUtil.addParameter(loginUrlRedirect, "p_p_lifecycle", "0");
}
return loginUrlRedirect;
}
return loginUrlRedirect;
}
}

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

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

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

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 {
private final static Log _log = LogFactoryUtil.getLog(AdminMaintenancePortlet.class);
private final static Log _log = LogFactoryUtil.getLog(AdminMaintenancePortlet.class);
public void maintain(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
public void maintain(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
PortletSession portletSession = actionRequest.getPortletSession();
PortletSession portletSession = actionRequest.getPortletSession();
String message = ParamUtil.getString(actionRequest, "message");
String message = ParamUtil.getString(actionRequest, "message");
String className =
LanguageUtil
.get(LocaleUtil.getDefault(),
"the-sign-in-process-is-temporarily-disabled-because-the-portal-is-undergoing-a-routine-maintenance-upgrade");
String className = LanguageUtil
.get(LocaleUtil.getDefault(),
"the-sign-in-process-is-temporarily-disabled-because-the-portal-is-undergoing-a-routine-maintenance-upgrade");
if (Validator.isNotNull(message)) {
className = message;
}
if (Validator.isNotNull(message)) {
className = message;
}
Class<?> clazz =
ClassResolverUtil.resolve("com.liferay.portal.util.MaintenanceUtil", PortalClassLoaderUtil.getClassLoader());
ReflectionUtil.getDeclaredMethod(clazz, "maintain", String.class, String.class).invoke(null,
portletSession.getId(), className);
Class<?> clazz = ClassResolverUtil.resolve("com.liferay.portal.util.MaintenanceUtil",
PortalClassLoaderUtil.getClassLoader());
ReflectionUtil.getDeclaredMethod(clazz, "maintain", String.class, String.class).invoke(null,
portletSession.getId(), className);
_log.info("Maintenance session id: " + portletSession.getId());
_log.info("Maintenance session id: " + portletSession.getId());
}
}
public void deleteMaintenanceSchedule(ActionRequest actionRequest, ActionResponse actionResponse)
throws Exception {
_log.info("deleteMaintenanceSchedule - Inizio metodo");
public void deleteMaintenanceSchedule(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
_log.info("deleteMaintenanceSchedule - Inizio metodo");
ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest);
long maintenanceScheduleId = ParamUtil.getLong(actionRequest, "maintenanceScheduleId");
ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest);
long maintenanceScheduleId = ParamUtil.getLong(actionRequest, "maintenanceScheduleId");
MaintenanceScheduleServiceUtil.deleteMaintenanceSchedule(maintenanceScheduleId, serviceContext);
MaintenanceScheduleServiceUtil.deleteMaintenanceSchedule(maintenanceScheduleId, serviceContext);
}
}
public void editMaintenanceSchedule(ActionRequest actionRequest, ActionResponse actionResponse)
throws Exception {
_log.info("editMaintenanceSchedule - Inizio metodo");
public void editMaintenanceSchedule(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
_log.info("editMaintenanceSchedule - Inizio metodo");
String cmd = ParamUtil.getString(actionRequest, Constants.CMD);
String cmd = ParamUtil.getString(actionRequest, Constants.CMD);
ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest);
ServiceContext serviceContext = ServiceContextFactory.getInstance(actionRequest);
long maintenanceScheduleId = ParamUtil.getLong(actionRequest, "maintenanceScheduleId");
String type = ParamUtil.getString(actionRequest, "type");
String reason = ParamUtil.getString(actionRequest, "reason");
String portalMessage = ParamUtil.getString(actionRequest, "portalMessage");
long after = ParamUtil.getLong(actionRequest, "after");
String onreboot = ParamUtil.getString(actionRequest, "onreboot");
String status = ParamUtil.getString(actionRequest, "status");
String statusMessage = ParamUtil.getString(actionRequest, "statusMessage");
long maintenanceScheduleId = ParamUtil.getLong(actionRequest, "maintenanceScheduleId");
String type = ParamUtil.getString(actionRequest, "type");
String reason = ParamUtil.getString(actionRequest, "reason");
String portalMessage = ParamUtil.getString(actionRequest, "portalMessage");
long after = ParamUtil.getLong(actionRequest, "after");
String onreboot = ParamUtil.getString(actionRequest, "onreboot");
String status = ParamUtil.getString(actionRequest, "status");
String statusMessage = ParamUtil.getString(actionRequest, "statusMessage");
Calendar calendarEnd = Calendar.getInstance();
calendarEnd.set(ParamUtil.getInteger(actionRequest, "endYear"),
ParamUtil.getInteger(actionRequest, "endMonth") + 1,
ParamUtil.getInteger(actionRequest, "endDay"),
ParamUtil.getInteger(actionRequest, "endHour"),
ParamUtil.getInteger(actionRequest, "endMinute"));
Calendar calendarEnd = Calendar.getInstance();
calendarEnd.set(ParamUtil.getInteger(actionRequest, "endYear"),
ParamUtil.getInteger(actionRequest, "endMonth") + 1, ParamUtil.getInteger(actionRequest, "endDay"),
ParamUtil.getInteger(actionRequest, "endHour"), ParamUtil.getInteger(actionRequest, "endMinute"));
MaintenanceSchedule maintenanceSchedule = null;
MaintenanceSchedule maintenanceSchedule = null;
try {
try {
if (cmd.equals(Constants.ADD)) {
maintenanceSchedule = MaintenanceScheduleServiceUtil.addMaintenanceSchedule(type, reason,
portalMessage, after, calendarEnd.getTime(), onreboot, serviceContext);
} else if (cmd.equals(Constants.UPDATE)) {
maintenanceSchedule = MaintenanceScheduleServiceUtil.updateMaintenanceSchedule(
maintenanceScheduleId, type, reason, portalMessage, after, calendarEnd.getTime(),
onreboot, status, statusMessage, serviceContext);
}
if (cmd.equals(Constants.ADD)) {
maintenanceSchedule =
MaintenanceScheduleServiceUtil.addMaintenanceSchedule(type, reason, portalMessage, after,
calendarEnd.getTime(), onreboot, serviceContext);
} else if (cmd.equals(Constants.UPDATE)) {
maintenanceSchedule =
MaintenanceScheduleServiceUtil.updateMaintenanceSchedule(maintenanceScheduleId, type, reason,
portalMessage, after, calendarEnd.getTime(), onreboot, status, statusMessage, serviceContext);
}
} catch (PortalException e) {
_log.error(e);
SessionErrors.add(actionRequest, e.getClass());
}
} catch (PortalException e) {
_log.error(e);
SessionErrors.add(actionRequest, e.getClass());
}
if (SessionErrors.isEmpty(actionRequest)) {
actionResponse.setRenderParameter("maintenanceScheduleId",
String.valueOf(maintenanceSchedule.getMaintenanceScheduleId()));
actionResponse.setRenderParameter("mvcPath", "/html/admin_maintenance/edit.jsp");
} else {
actionResponse.setRenderParameter("mvcPath", "/html/admin_maintenance/edit.jsp");
PortalUtil.copyRequestParameters(actionRequest, actionResponse);
}
if (SessionErrors.isEmpty(actionRequest)) {
actionResponse.setRenderParameter("maintenanceScheduleId",
String.valueOf(maintenanceSchedule.getMaintenanceScheduleId()));
actionResponse.setRenderParameter("mvcPath", "/html/admin_maintenance/edit.jsp");
} else {
actionResponse.setRenderParameter("mvcPath", "/html/admin_maintenance/edit.jsp");
PortalUtil.copyRequestParameters(actionRequest, actionResponse);
}
}
}
}

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

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.
*
* <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
@ -55,166 +57,172 @@ import java.util.List;
* @see it.tref.liferay.portos.maintenance.service.MaintenanceScheduleLocalServiceUtil
*/
public class MaintenanceScheduleLocalServiceImpl extends MaintenanceScheduleLocalServiceBaseImpl {
/*
* NOTE FOR DEVELOPERS:
*
* Never reference this interface directly. Always use {@link
* it.tref.liferay.portos.maintenance.service.MaintenanceScheduleLocalServiceUtil} to access the
* maintenance schedule local service.
*/
@Override
public MaintenanceSchedule addMaintenanceSchedule(String type, String reason, String portalMessage, long after,
Date end, String onreboot, ServiceContext serviceContext) throws SystemException, PortalException {
MaintenanceSchedule maintenanceSchedule =
MaintenanceScheduleUtil.create(counterLocalService.increment(MaintenanceSchedule.class.getName()));
validate(type, reason, after, end, onreboot);
maintenanceSchedule.setCompanyId(serviceContext.getCompanyId());
maintenanceSchedule.setUserId(serviceContext.getUserId());
User user = userLocalService.fetchUser(serviceContext.getUserId());
maintenanceSchedule.setUserName(Validator.isNotNull(user) ? user.getScreenName() : StringPool.BLANK);
maintenanceSchedule.setCreateDate(DateUtil.newDate());
maintenanceSchedule.setModifiedDate(DateUtil.newDate());
maintenanceSchedule.setType(type);
maintenanceSchedule.setReason(reason);
maintenanceSchedule.setPortalMessage(portalMessage != null ? portalMessage : StringPool.BLANK);
maintenanceSchedule.setAfter(after);
maintenanceSchedule.setEnd(end != null ? DateTimeUtil.scaleToNextMinute(end) : null);
maintenanceSchedule.setOnreboot(onreboot);
maintenanceSchedule.setStatus(MaintenanceStatus.NEW.getCode());
maintenanceSchedule.setCompleted(Boolean.FALSE);
return addMaintenanceSchedule(maintenanceSchedule);
}
@Override
public MaintenanceSchedule updateMaintenanceSchedule(long maintenanceScheduleId, String type, String reason,
String portalMessage, long after, Date end, String onreboot, String status, String statusMessage,
ServiceContext serviceContext) throws SystemException, PortalException {
MaintenanceSchedule maintenanceSchedule = getMaintenanceSchedule(maintenanceScheduleId);
validate(type, reason, after, end, onreboot);
if (Validator.isNotNull(status)) {
maintenanceSchedule = updateStatus(maintenanceSchedule.getMaintenanceScheduleId(), status, statusMessage);
}
maintenanceSchedule.setModifiedDate(DateUtil.newDate());
maintenanceSchedule.setType(type);
maintenanceSchedule.setReason(reason);
maintenanceSchedule.setPortalMessage(portalMessage != null ? portalMessage : StringPool.BLANK);
maintenanceSchedule.setAfter(after);
maintenanceSchedule.setEnd(end != null ? DateTimeUtil.scaleToNextMinute(end) : null);
maintenanceSchedule.setOnreboot(onreboot);
return updateMaintenanceSchedule(maintenanceSchedule);
}
@Override
public MaintenanceSchedule updateStatus(long maintenanceScheduleId, String status) throws PortalException,
SystemException {
return updateStatus(maintenanceScheduleId, status, null);
}
@Override
public MaintenanceSchedule updateStatus(long maintenanceScheduleId, String status, String statusMessage)
throws PortalException, SystemException {
MaintenanceStatus maintenanceStatus = null;
try {
maintenanceStatus = MaintenanceStatus.parse(status);
} catch (IllegalArgumentException e) {
throw new MaintenanceStatusException(status);
}
MaintenanceSchedule maintenanceSchedule = getMaintenanceSchedule(maintenanceScheduleId);
maintenanceSchedule.setStatus(maintenanceStatus.getCode());
maintenanceSchedule.setStatusMessage(statusMessage);
if (maintenanceStatus == MaintenanceStatus.ENDED || maintenanceStatus == MaintenanceStatus.FORCE_ENDED
|| maintenanceStatus == MaintenanceStatus.ERROR) {
maintenanceSchedule.setCompleted(Boolean.TRUE);
} else {
maintenanceSchedule.setCompleted(Boolean.FALSE);
}
return updateMaintenanceSchedule(maintenanceSchedule);
}
@Override
public List<MaintenanceSchedule> findByStatus(String status) throws SystemException {
return maintenanceSchedulePersistence.findByStatus(status);
}
private void validate(String type, String reason, long after, Date end, String onreboot) throws PortalException {
if (Validator.isNull(type)) {
throw new RequiredMaintenanceTypeException();
}
try {
MaintenanceType.parse(type);
} catch (IllegalArgumentException e) {
throw new MaintenanceTypeException(type);
}
if (Validator.isNull(onreboot)) {
throw new RequiredMaintenanceOnRebootException();
}
try {
MaintenanceOnReboot.parse(onreboot);
} catch (IllegalArgumentException e) {
throw new MaintenanceOnRebootException(onreboot);
}
if (Validator.isNull(reason)) {
throw new RequiredMaintenanceReasonException();
}
}
@Override
public List<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 {
return maintenanceSchedulePersistence.findByCompleted_Onreboot(completed, onreboot);
}
@Override
public List<MaintenanceSchedule> findByCompany(long companyId) throws SystemException {
return maintenanceSchedulePersistence.findByCompany(companyId);
}
@Override
public List<MaintenanceSchedule> findByCompany(long companyId, int start, int end) throws SystemException {
return maintenanceSchedulePersistence.findByCompany(companyId, start, end);
}
@Override
public int countByCompany(long companyId) throws SystemException {
return maintenanceSchedulePersistence.countByCompany(companyId);
}
@Override
public List<MaintenanceSchedule> findAll() throws SystemException {
return maintenanceSchedulePersistence.findAll();
}
@Override
public int countAll() throws SystemException {
return maintenanceSchedulePersistence.countAll();
}
/*
* NOTE FOR DEVELOPERS:
*
* Never reference this interface directly. Always use {@link
* it.tref.liferay
* .portos.maintenance.service.MaintenanceScheduleLocalServiceUtil} to
* access the maintenance schedule local service.
*/
@Override
public MaintenanceSchedule addMaintenanceSchedule(String type, String reason, String portalMessage,
long after, Date end, String onreboot, ServiceContext serviceContext) throws SystemException,
PortalException {
MaintenanceSchedule maintenanceSchedule = MaintenanceScheduleUtil.create(counterLocalService
.increment(MaintenanceSchedule.class.getName()));
validate(type, reason, after, end, onreboot);
maintenanceSchedule.setCompanyId(serviceContext.getCompanyId());
maintenanceSchedule.setUserId(serviceContext.getUserId());
User user = userLocalService.fetchUser(serviceContext.getUserId());
maintenanceSchedule.setUserName(Validator.isNotNull(user) ? user.getScreenName() : StringPool.BLANK);
maintenanceSchedule.setCreateDate(DateUtil.newDate());
maintenanceSchedule.setModifiedDate(DateUtil.newDate());
maintenanceSchedule.setType(type);
maintenanceSchedule.setReason(reason);
maintenanceSchedule.setPortalMessage(portalMessage != null ? portalMessage : StringPool.BLANK);
maintenanceSchedule.setAfter(after);
maintenanceSchedule.setEnd(end != null ? DateTimeUtil.scaleToNextMinute(end) : null);
maintenanceSchedule.setOnreboot(onreboot);
maintenanceSchedule.setStatus(MaintenanceStatus.NEW.getCode());
maintenanceSchedule.setCompleted(Boolean.FALSE);
return addMaintenanceSchedule(maintenanceSchedule);
}
@Override
public MaintenanceSchedule updateMaintenanceSchedule(long maintenanceScheduleId, String type,
String reason, String portalMessage, long after, Date end, String onreboot, String status,
String statusMessage, ServiceContext serviceContext) throws SystemException, PortalException {
MaintenanceSchedule maintenanceSchedule = getMaintenanceSchedule(maintenanceScheduleId);
validate(type, reason, after, end, onreboot);
if (Validator.isNotNull(status)) {
maintenanceSchedule = updateStatus(maintenanceSchedule.getMaintenanceScheduleId(), status,
statusMessage);
}
maintenanceSchedule.setModifiedDate(DateUtil.newDate());
maintenanceSchedule.setType(type);
maintenanceSchedule.setReason(reason);
maintenanceSchedule.setPortalMessage(portalMessage != null ? portalMessage : StringPool.BLANK);
maintenanceSchedule.setAfter(after);
maintenanceSchedule.setEnd(end != null ? DateTimeUtil.scaleToNextMinute(end) : null);
maintenanceSchedule.setOnreboot(onreboot);
return updateMaintenanceSchedule(maintenanceSchedule);
}
@Override
public MaintenanceSchedule updateStatus(long maintenanceScheduleId, String status)
throws PortalException, SystemException {
return updateStatus(maintenanceScheduleId, status, null);
}
@Override
public MaintenanceSchedule updateStatus(long maintenanceScheduleId, String status, String statusMessage)
throws PortalException, SystemException {
MaintenanceStatus maintenanceStatus = null;
try {
maintenanceStatus = MaintenanceStatus.parse(status);
} catch (IllegalArgumentException e) {
throw new MaintenanceStatusException(status);
}
MaintenanceSchedule maintenanceSchedule = getMaintenanceSchedule(maintenanceScheduleId);
maintenanceSchedule.setStatus(maintenanceStatus.getCode());
maintenanceSchedule.setStatusMessage(statusMessage);
if (maintenanceStatus == MaintenanceStatus.ENDED
|| maintenanceStatus == MaintenanceStatus.FORCE_ENDED
|| maintenanceStatus == MaintenanceStatus.ERROR) {
maintenanceSchedule.setCompleted(Boolean.TRUE);
} else {
maintenanceSchedule.setCompleted(Boolean.FALSE);
}
return updateMaintenanceSchedule(maintenanceSchedule);
}
@Override
public List<MaintenanceSchedule> findByStatus(String status) throws SystemException {
return maintenanceSchedulePersistence.findByStatus(status);
}
private void validate(String type, String reason, long after, Date end, String onreboot)
throws PortalException {
if (Validator.isNull(type)) {
throw new RequiredMaintenanceTypeException();
}
try {
MaintenanceType.parse(type);
} catch (IllegalArgumentException e) {
throw new MaintenanceTypeException(type);
}
if (Validator.isNull(onreboot)) {
throw new RequiredMaintenanceOnRebootException();
}
try {
MaintenanceOnReboot.parse(onreboot);
} catch (IllegalArgumentException e) {
throw new MaintenanceOnRebootException(onreboot);
}
if (Validator.isNull(reason)) {
throw new RequiredMaintenanceReasonException();
}
}
@Override
public List<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 {
return maintenanceSchedulePersistence.findByCompleted_Onreboot(completed, onreboot);
}
@Override
public List<MaintenanceSchedule> findByCompany(long companyId) throws SystemException {
return maintenanceSchedulePersistence.findByCompany(companyId);
}
@Override
public List<MaintenanceSchedule> findByCompany(long companyId, int start, int end) throws SystemException {
return maintenanceSchedulePersistence.findByCompany(companyId, start, end);
}
@Override
public int countByCompany(long companyId) throws SystemException {
return maintenanceSchedulePersistence.countByCompany(companyId);
}
@Override
public List<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.
*
* <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
@ -39,45 +41,46 @@ import java.util.Date;
* @see it.tref.liferay.portos.maintenance.service.MaintenanceScheduleServiceUtil
*/
public class MaintenanceScheduleServiceImpl extends MaintenanceScheduleServiceBaseImpl {
/*
* NOTE FOR DEVELOPERS:
*
* Never reference this interface directly. Always use {@link
* it.tref.liferay.portos.maintenance.service.MaintenanceScheduleServiceUtil} to access the
* maintenance schedule remote service.
*/
/*
* NOTE FOR DEVELOPERS:
*
* Never reference this interface directly. Always use {@link
* it.tref.liferay
* .portos.maintenance.service.MaintenanceScheduleServiceUtil} to access the
* maintenance schedule remote service.
*/
public MaintenanceSchedule addMaintenanceSchedule(String type, String reason, String portalMessage, long after,
Date end, String onreboot, ServiceContext serviceContext) throws Exception {
public MaintenanceSchedule addMaintenanceSchedule(String type, String reason, String portalMessage,
long after, Date end, String onreboot, ServiceContext serviceContext) throws Exception {
if (!PortalUtil.isCompanyAdmin(getUser())) {
throw new PortalException("Access denied!");
}
if (!PortalUtil.isCompanyAdmin(getUser())) {
throw new PortalException("Access denied!");
}
return maintenanceScheduleLocalService.addMaintenanceSchedule(type, reason, portalMessage, after, end, onreboot,
serviceContext);
}
return maintenanceScheduleLocalService.addMaintenanceSchedule(type, reason, portalMessage, after,
end, onreboot, serviceContext);
}
public MaintenanceSchedule updateMaintenanceSchedule(long maintenanceScheduleId, String type, String reason,
String portalMessage, long after, Date end, String onreboot, String status, String statusMessage,
ServiceContext serviceContext) throws Exception {
public MaintenanceSchedule updateMaintenanceSchedule(long maintenanceScheduleId, String type,
String reason, String portalMessage, long after, Date end, String onreboot, String status,
String statusMessage, ServiceContext serviceContext) throws Exception {
if (!PortalUtil.isCompanyAdmin(getUser())) {
throw new PortalException("Access denied!");
}
if (!PortalUtil.isCompanyAdmin(getUser())) {
throw new PortalException("Access denied!");
}
return maintenanceScheduleLocalService.updateMaintenanceSchedule(maintenanceScheduleId, type, reason,
portalMessage, after, end, onreboot, status, statusMessage, serviceContext);
}
return maintenanceScheduleLocalService.updateMaintenanceSchedule(maintenanceScheduleId, type, reason,
portalMessage, after, end, onreboot, status, statusMessage, serviceContext);
}
public MaintenanceSchedule deleteMaintenanceSchedule(long maintenanceScheduleId, ServiceContext serviceContext)
throws Exception {
public MaintenanceSchedule deleteMaintenanceSchedule(long maintenanceScheduleId,
ServiceContext serviceContext) throws Exception {
if (!PortalUtil.isCompanyAdmin(getUser())) {
throw new PortalException("Access denied!");
}
if (!PortalUtil.isCompanyAdmin(getUser())) {
throw new PortalException("Access denied!");
}
return maintenanceScheduleLocalService.deleteMaintenanceSchedule(maintenanceScheduleId);
}
return maintenanceScheduleLocalService.deleteMaintenanceSchedule(maintenanceScheduleId);
}
}

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

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

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;
public class MaintenanceConstants {
public enum MaintenanceType {
public enum MaintenanceType {
FULL("full", "Full mode"), USER("user", "Only user mode");
FULL("full", "Full mode"), USER("user", "Only user mode");
MaintenanceType(String code, String description) {
this.setCode(code);
this.setDescription(description);
}
MaintenanceType(String code, String description) {
this.setCode(code);
this.setDescription(description);
}
public String getDescription() {
return description;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public void setDescription(String description) {
this.description = description;
}
public String getCode() {
return code;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public void setCode(String code) {
this.code = code;
}
private String code;
private String description;
private String code;
private String description;
public static MaintenanceType parse(String code) {
public static MaintenanceType parse(String code) {
for (MaintenanceType maintenanceType : values()) {
if (maintenanceType.code.equals(code)) {
return maintenanceType;
}
}
for (MaintenanceType maintenanceType : values()) {
if (maintenanceType.code.equals(code)) {
return maintenanceType;
}
}
throw new IllegalArgumentException("Invalid MaintenanceType code: " + code);
}
throw new IllegalArgumentException("Invalid MaintenanceType code: " + code);
}
}
}
public enum MaintenanceOnReboot {
public enum MaintenanceOnReboot {
CONTINUE("continue", "Continue"), TERMINATE("terminate", "Terminate");
CONTINUE("continue", "Continue"), TERMINATE("terminate", "Terminate");
MaintenanceOnReboot(String code, String description) {
this.setCode(code);
this.setDescription(description);
}
MaintenanceOnReboot(String code, String description) {
this.setCode(code);
this.setDescription(description);
}
public String getDescription() {
return description;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public void setDescription(String description) {
this.description = description;
}
public String getCode() {
return code;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public void setCode(String code) {
this.code = code;
}
private String code;
private String description;
private String code;
private String description;
public static MaintenanceOnReboot parse(String code) {
public static MaintenanceOnReboot parse(String code) {
for (MaintenanceOnReboot maintenanceOnReboot : values()) {
if (maintenanceOnReboot.code.equals(code)) {
return maintenanceOnReboot;
}
}
for (MaintenanceOnReboot maintenanceOnReboot : values()) {
if (maintenanceOnReboot.code.equals(code)) {
return maintenanceOnReboot;
}
}
throw new IllegalArgumentException("Invalid MaintenanceOnReboot code: " + code);
}
throw new IllegalArgumentException("Invalid MaintenanceOnReboot code: " + code);
}
}
}
public enum MaintenanceStatus {
public enum MaintenanceStatus {
NEW("N", "New"), IN_PROGRESS("P", "In Progress"), ENDED("E", "Ended"), FORCE_ENDED("FE", "Force Ended"), ERROR(
"ER", "Error");
NEW("N", "New"), IN_PROGRESS("P", "In Progress"), ENDED("E", "Ended"), FORCE_ENDED("FE",
"Force Ended"), ERROR("ER", "Error");
MaintenanceStatus(String code, String description) {
this.setCode(code);
this.setDescription(description);
}
MaintenanceStatus(String code, String description) {
this.setCode(code);
this.setDescription(description);
}
public String getDescription() {
return description;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public void setDescription(String description) {
this.description = description;
}
public String getCode() {
return code;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public void setCode(String code) {
this.code = code;
}
private String code;
private String description;
private String code;
private String description;
public static MaintenanceStatus parse(String code) {
public static MaintenanceStatus parse(String code) {
for (MaintenanceStatus maintenanceStatus : values()) {
if (maintenanceStatus.code.equals(code)) {
return maintenanceStatus;
}
}
for (MaintenanceStatus maintenanceStatus : values()) {
if (maintenanceStatus.code.equals(code)) {
return maintenanceStatus;
}
}
throw new IllegalArgumentException("Invalid MaintenanceStatus code: " + code);
}
throw new IllegalArgumentException("Invalid MaintenanceStatus code: " + code);
}
}
}
}

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

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

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