Merge remote-tracking branch 'origin/develop' into develop
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
package it.integry.ems.dto;
|
package it.integry.ems.dto.info;
|
||||||
|
|
||||||
|
|
||||||
public class ApplicationInfoDTO {
|
public class ApplicationInfoDTO {
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package it.integry.ems.dto;
|
package it.integry.ems.dto.info;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package it.integry.ems.dto;
|
package it.integry.ems.dto.info;
|
||||||
|
|
||||||
public class DatabaseInfoDTO {
|
public class DatabaseInfoDTO {
|
||||||
|
|
||||||
114
ems-core/src/main/java/it/integry/ems/dto/info/PvmInfoDTO.java
Normal file
114
ems-core/src/main/java/it/integry/ems/dto/info/PvmInfoDTO.java
Normal file
@@ -0,0 +1,114 @@
|
|||||||
|
package it.integry.ems.dto.info;
|
||||||
|
|
||||||
|
public class PvmInfoDTO {
|
||||||
|
private String phpVersion;
|
||||||
|
private String timezone;
|
||||||
|
private String imagick;
|
||||||
|
private boolean sodiumMissing;
|
||||||
|
private int maxExecutionTime;
|
||||||
|
private boolean magicQuotesGpc;
|
||||||
|
private String defaultCharset;
|
||||||
|
private String memoryLimit;
|
||||||
|
private String postMaxSize;
|
||||||
|
private String uploadMaxSize;
|
||||||
|
private int maxInputVars;
|
||||||
|
|
||||||
|
public String getPhpVersion() {
|
||||||
|
return phpVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PvmInfoDTO setPhpVersion(String phpVersion) {
|
||||||
|
this.phpVersion = phpVersion;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTimezone() {
|
||||||
|
return timezone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PvmInfoDTO setTimezone(String timezone) {
|
||||||
|
this.timezone = timezone;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getImagick() {
|
||||||
|
return imagick;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PvmInfoDTO setImagick(String imagick) {
|
||||||
|
this.imagick = imagick;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isSodiumMissing() {
|
||||||
|
return sodiumMissing;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PvmInfoDTO setSodiumMissing(boolean sodiumMissing) {
|
||||||
|
this.sodiumMissing = sodiumMissing;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaxExecutionTime() {
|
||||||
|
return maxExecutionTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PvmInfoDTO setMaxExecutionTime(int maxExecutionTime) {
|
||||||
|
this.maxExecutionTime = maxExecutionTime;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isMagicQuotesGpc() {
|
||||||
|
return magicQuotesGpc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PvmInfoDTO setMagicQuotesGpc(boolean magicQuotesGpc) {
|
||||||
|
this.magicQuotesGpc = magicQuotesGpc;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDefaultCharset() {
|
||||||
|
return defaultCharset;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PvmInfoDTO setDefaultCharset(String defaultCharset) {
|
||||||
|
this.defaultCharset = defaultCharset;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMemoryLimit() {
|
||||||
|
return memoryLimit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PvmInfoDTO setMemoryLimit(String memoryLimit) {
|
||||||
|
this.memoryLimit = memoryLimit;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPostMaxSize() {
|
||||||
|
return postMaxSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PvmInfoDTO setPostMaxSize(String postMaxSize) {
|
||||||
|
this.postMaxSize = postMaxSize;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUploadMaxSize() {
|
||||||
|
return uploadMaxSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PvmInfoDTO setUploadMaxSize(String uploadMaxSize) {
|
||||||
|
this.uploadMaxSize = uploadMaxSize;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaxInputVars() {
|
||||||
|
return maxInputVars;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PvmInfoDTO setMaxInputVars(int maxInputVars) {
|
||||||
|
this.maxInputVars = maxInputVars;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -13,6 +13,10 @@ import it.integry.ems.Import.dto.AnomalieDTO;
|
|||||||
import it.integry.ems.Import.dto.ImportRequestDTO;
|
import it.integry.ems.Import.dto.ImportRequestDTO;
|
||||||
import it.integry.ems.Import.enums.EntityImportType;
|
import it.integry.ems.Import.enums.EntityImportType;
|
||||||
import it.integry.ems.dto.*;
|
import it.integry.ems.dto.*;
|
||||||
|
import it.integry.ems.dto.info.ApplicationInfoDTO;
|
||||||
|
import it.integry.ems.dto.info.DatabaseEngineInfoDTO;
|
||||||
|
import it.integry.ems.dto.info.DatabaseInfoDTO;
|
||||||
|
import it.integry.ems.dto.info.PvmInfoDTO;
|
||||||
import it.integry.ems.exception.MissingDataException;
|
import it.integry.ems.exception.MissingDataException;
|
||||||
import it.integry.ems.export.base.EntityExportResponse;
|
import it.integry.ems.export.base.EntityExportResponse;
|
||||||
import it.integry.ems.export.base.EntityExporterUtility;
|
import it.integry.ems.export.base.EntityExporterUtility;
|
||||||
@@ -855,6 +859,7 @@ public class EmsServices {
|
|||||||
|
|
||||||
arguments.put("databaseEngine", getDatabaseEngineInfo(multiDBTransactionManager));
|
arguments.put("databaseEngine", getDatabaseEngineInfo(multiDBTransactionManager));
|
||||||
arguments.put("applicationInfo", getApplicatinInfo(multiDBTransactionManager));
|
arguments.put("applicationInfo", getApplicatinInfo(multiDBTransactionManager));
|
||||||
|
arguments.put("pvmInfo", getPvmInfo(multiDBTransactionManager));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Properties jvmProperties = System.getProperties();
|
Properties jvmProperties = System.getProperties();
|
||||||
@@ -1022,6 +1027,84 @@ public class EmsServices {
|
|||||||
return applicationInfoDTOList;
|
return applicationInfoDTOList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private PvmInfoDTO getPvmInfo(MultiDBTransactionManager mdb) throws Exception {
|
||||||
|
String pvmUrl = setupGest.getSetup(multiDBTransactionManager.getPrimaryConnection(), "DATI_AZIENDA", "URL", "PVM");
|
||||||
|
|
||||||
|
if (UtilityString.isNullOrEmpty(pvmUrl)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
String url = String.format("%sphpinfo.php?get=1", pvmUrl.endsWith("/") ? pvmUrl : pvmUrl + "/");
|
||||||
|
|
||||||
|
StringBuilder srb = new StringBuilder();
|
||||||
|
int status = HttpRestWrapper.callGeneric(url, null, null, null, ContentType.APPLICATION_JSON, srb, null);
|
||||||
|
|
||||||
|
if (status != 200)
|
||||||
|
throw new Exception("La richiesta \"" + url + "\" ha generato status code: " + status + " [" + srb + "]");
|
||||||
|
|
||||||
|
PvmInfoDTO pvmInfoDTO = new PvmInfoDTO();
|
||||||
|
|
||||||
|
try {
|
||||||
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
|
JsonNode jsonNode = mapper.readTree(srb.toString());
|
||||||
|
|
||||||
|
jsonNode.forEach(json -> {
|
||||||
|
String id = json.get("id").asText();
|
||||||
|
|
||||||
|
switch (id) {
|
||||||
|
case "php":
|
||||||
|
pvmInfoDTO.setPhpVersion(json.get("version").asText());
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "timezone":
|
||||||
|
pvmInfoDTO.setTimezone(json.get("version").asText());
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "imagick":
|
||||||
|
pvmInfoDTO.setImagick(json.get("version").asText());
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "sodium":
|
||||||
|
pvmInfoDTO.setSodiumMissing(json.get("is_missing").asBoolean());
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "max_execution_time":
|
||||||
|
pvmInfoDTO.setMaxExecutionTime(json.get("value").asInt());
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "magic_quotes_gpc":
|
||||||
|
pvmInfoDTO.setMagicQuotesGpc(json.get("value").asBoolean());
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "default_charset":
|
||||||
|
pvmInfoDTO.setDefaultCharset(json.get("value").asText());
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "memory_limit":
|
||||||
|
pvmInfoDTO.setMemoryLimit(json.get("value").asText());
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "post_max_size":
|
||||||
|
pvmInfoDTO.setPostMaxSize(json.get("value").asText());
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "upload_max_filesize":
|
||||||
|
pvmInfoDTO.setUploadMaxSize(json.get("value").asText());
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "max_input_vars":
|
||||||
|
pvmInfoDTO.setMaxInputVars(json.get("value").asInt());
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("getPvmInfo", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return pvmInfoDTO;
|
||||||
|
}
|
||||||
|
|
||||||
private void importClientieOrdiniQuore() throws Exception {
|
private void importClientieOrdiniQuore() throws Exception {
|
||||||
try (Connection connection = basicConnectionPool.getConnection(settingsModel.getDefaultProfile())) {
|
try (Connection connection = basicConnectionPool.getConnection(settingsModel.getDefaultProfile())) {
|
||||||
boolean enabled = Boolean.parseBoolean(setupGest.getSetup(connection,
|
boolean enabled = Boolean.parseBoolean(setupGest.getSetup(connection,
|
||||||
|
|||||||
Reference in New Issue
Block a user