Reduced/Optimized some LOGs, done [#25539]
This commit is contained in:
parent
5def5c98fe
commit
f819b0f10a
|
@ -4,6 +4,10 @@
|
|||
All notable changes to this project will be documented in this file.
|
||||
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [v2.2.1-SNAPSHOT]
|
||||
|
||||
- Reduced/Optimized some LOGs [#25539]
|
||||
|
||||
## [v2.2.0]
|
||||
|
||||
- Integrated the cross-filtering configuration [#25074]
|
||||
|
|
2
pom.xml
2
pom.xml
|
@ -10,7 +10,7 @@
|
|||
|
||||
<groupId>org.gcube.application</groupId>
|
||||
<artifactId>geoportal-data-common</artifactId>
|
||||
<version>2.2.0</version>
|
||||
<version>2.2.1-SNAPSHOT</version>
|
||||
<description>GeoPortal Data Common is common library used by GUI components developed for GeoNA</description>
|
||||
|
||||
<scm>
|
||||
|
|
|
@ -66,6 +66,7 @@ import org.gcube.application.geoportalcommon.shared.geoportal.ucd.HandlerDeclara
|
|||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.RelationshipDefinitionDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescriptorDV;
|
||||
import org.gcube.application.geoportalcommon.util.DateUtils;
|
||||
import org.gcube.application.geoportalcommon.util.StringUtil;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -94,6 +95,8 @@ import com.jayway.jsonpath.Option;
|
|||
*/
|
||||
public class ConvertToDataValueObjectModel {
|
||||
|
||||
public static final int _MAX_LENGHT_STRING_AT_INFO = 200;
|
||||
|
||||
private static Logger LOG = LoggerFactory.getLogger(ConvertToDataValueObjectModel.class);
|
||||
|
||||
private static final String NO_TIME = "T00:00";
|
||||
|
@ -174,7 +177,9 @@ public class ConvertToDataValueObjectModel {
|
|||
}
|
||||
|
||||
ucdVO.setHandlers(listHandlersDV);
|
||||
LOG.info("returning {}", ucdVO);
|
||||
LOG.info("returning {}", StringUtil.ellipsize(ucdVO.toString(), _MAX_LENGHT_STRING_AT_INFO));
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("returning {}", ucdVO);
|
||||
return ucdVO;
|
||||
|
||||
}
|
||||
|
@ -313,7 +318,10 @@ public class ConvertToDataValueObjectModel {
|
|||
dDV.setConfiguration(listGcubeProfiles);
|
||||
dDV.setConfigurationType(geoportalConfigType); // -> GEOPORTAL_CONFIGURATION_TYPE.gcube_profiles
|
||||
hdDV.setConfiguration(dDV);
|
||||
LOG.info("returning {}", hdDV);
|
||||
LOG.info("Found config {}", GEOPORTAL_CONFIGURATION_TYPE.gcube_profiles);
|
||||
LOG.info("returning {}", StringUtil.ellipsize(hdDV.toString(), _MAX_LENGHT_STRING_AT_INFO));
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("returning {}", hdDV);
|
||||
return hdDV;
|
||||
}
|
||||
case item_fields: {
|
||||
|
@ -332,7 +340,10 @@ public class ConvertToDataValueObjectModel {
|
|||
dDV.setConfiguration(listItemFields);
|
||||
dDV.setConfigurationType(geoportalConfigType); // -> GEOPORTAL_CONFIGURATION_TYPE.item_fields
|
||||
hdDV.setConfiguration(dDV);
|
||||
LOG.info("returning {}", hdDV);
|
||||
LOG.info("Found config {}", GEOPORTAL_CONFIGURATION_TYPE.item_fields);
|
||||
LOG.info("returning {}", StringUtil.ellipsize(hdDV.toString(), _MAX_LENGHT_STRING_AT_INFO));
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("returning {}", hdDV);
|
||||
return hdDV;
|
||||
}
|
||||
|
||||
|
@ -375,7 +386,10 @@ public class ConvertToDataValueObjectModel {
|
|||
dDV.setConfiguration(listActionsDef);
|
||||
dDV.setConfigurationType(geoportalConfigType); // -> GEOPORTAL_CONFIGURATION_TYPE.actions_definition
|
||||
hdDV.setConfiguration(dDV);
|
||||
LOG.info("returning {}", hdDV);
|
||||
LOG.info("Found config {}", GEOPORTAL_CONFIGURATION_TYPE.actions_definition);
|
||||
LOG.info("returning {}", StringUtil.ellipsize(hdDV.toString(), _MAX_LENGHT_STRING_AT_INFO));
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("returning {}", hdDV);
|
||||
return hdDV;
|
||||
}
|
||||
|
||||
|
@ -388,7 +402,8 @@ public class ConvertToDataValueObjectModel {
|
|||
ObjectMapper mapper = new ObjectMapper();
|
||||
for (String asJSONString : jsonConfigurations) {
|
||||
LOG.debug(++i + ") the " + GroupedLayersDV.class.getSimpleName() + " is: " + asJSONString);
|
||||
TypeReference<GroupedLayersDV<ConfiguredLayerDV>> typeRef = new TypeReference<GroupedLayersDV<ConfiguredLayerDV>>() {};
|
||||
TypeReference<GroupedLayersDV<ConfiguredLayerDV>> typeRef = new TypeReference<GroupedLayersDV<ConfiguredLayerDV>>() {
|
||||
};
|
||||
GroupedLayersDV<ConfiguredLayerDV> profile = mapper.readValue(asJSONString, typeRef);
|
||||
// GroupedLayersDV<ConfiguredLayerDV> profile = org.gcube.application.geoportal.client.utils.Serialization
|
||||
// .read(asJSONString, typeRef);
|
||||
|
@ -401,7 +416,10 @@ public class ConvertToDataValueObjectModel {
|
|||
dDV.setConfiguration(listGroupedCL);
|
||||
dDV.setConfigurationType(geoportalConfigType);
|
||||
hdDV.setConfiguration(dDV);
|
||||
LOG.info("returning {}", hdDV);
|
||||
LOG.info("Found config {}", GEOPORTAL_CONFIGURATION_TYPE.grouped_overlay_layers);
|
||||
LOG.info("returning {}", StringUtil.ellipsize(hdDV.toString(), _MAX_LENGHT_STRING_AT_INFO));
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("returning {}", hdDV);
|
||||
return hdDV;
|
||||
}
|
||||
|
||||
|
@ -414,7 +432,8 @@ public class ConvertToDataValueObjectModel {
|
|||
ObjectMapper mapper = new ObjectMapper();
|
||||
for (String asJSONString : jsonConfigurations) {
|
||||
LOG.debug(++i + ") the " + GroupedLayersDV.class.getSimpleName() + " is: " + asJSONString);
|
||||
TypeReference<GroupedLayersDV<CrossFilteringLayerDV>> typeRef = new TypeReference<GroupedLayersDV<CrossFilteringLayerDV>>() {};
|
||||
TypeReference<GroupedLayersDV<CrossFilteringLayerDV>> typeRef = new TypeReference<GroupedLayersDV<CrossFilteringLayerDV>>() {
|
||||
};
|
||||
GroupedLayersDV<CrossFilteringLayerDV> profile = mapper.readValue(asJSONString, typeRef);
|
||||
// GroupedLayersDV<CrossFilteringLayerDV> profile = org.gcube.application.geoportal.client.utils.Serialization
|
||||
// .read(asJSONString, GroupedLayersDV.class);
|
||||
|
@ -427,7 +446,10 @@ public class ConvertToDataValueObjectModel {
|
|||
dDV.setConfiguration(listGroupedCL);
|
||||
dDV.setConfigurationType(geoportalConfigType);
|
||||
hdDV.setConfiguration(dDV);
|
||||
LOG.info("returning {}", hdDV);
|
||||
LOG.info("Found config {}", GEOPORTAL_CONFIGURATION_TYPE.grouped_cross_filtering_layers);
|
||||
LOG.info("returning {}", StringUtil.ellipsize(hdDV.toString(), _MAX_LENGHT_STRING_AT_INFO));
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("returning {}", hdDV);
|
||||
return hdDV;
|
||||
|
||||
}
|
||||
|
@ -457,7 +479,7 @@ public class ConvertToDataValueObjectModel {
|
|||
LOG.trace("toGcubeProfileDV called");
|
||||
|
||||
if (gCubeProfile == null) {
|
||||
LOG.warn(GcubeProfile.class.getSimpleName() + " is null");
|
||||
LOG.info(GcubeProfile.class.getSimpleName() + " is null");
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -481,7 +503,9 @@ public class ConvertToDataValueObjectModel {
|
|||
gpVO.setFilePaths(filePathsVO);
|
||||
}
|
||||
|
||||
LOG.info("returning: " + gpVO);
|
||||
LOG.info("returning {}", StringUtil.ellipsize(gpVO.toString(), _MAX_LENGHT_STRING_AT_INFO));
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("returning {}", gpVO);
|
||||
return gpVO;
|
||||
}
|
||||
|
||||
|
@ -495,7 +519,7 @@ public class ConvertToDataValueObjectModel {
|
|||
LOG.trace("toItemFieldDV called");
|
||||
|
||||
if (itemField == null) {
|
||||
LOG.warn(ItemField.class.getSimpleName() + " is null");
|
||||
LOG.info(ItemField.class.getSimpleName() + " is null");
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -507,7 +531,7 @@ public class ConvertToDataValueObjectModel {
|
|||
ifDV.setSearchable(itemField.isSearchable());
|
||||
ifDV.setSortable(itemField.isSortable());
|
||||
|
||||
LOG.info("returning: " + ifDV);
|
||||
LOG.debug("returning: " + ifDV);
|
||||
return ifDV;
|
||||
}
|
||||
|
||||
|
@ -534,7 +558,9 @@ public class ConvertToDataValueObjectModel {
|
|||
actDef.setTitle(actionDefinition.getTitle());
|
||||
actDef.setRoles(roles);
|
||||
|
||||
LOG.info("returning: " + actionDefinition);
|
||||
LOG.info("returning {}", StringUtil.ellipsize(actionDefinition.toString(), _MAX_LENGHT_STRING_AT_INFO));
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("returning {}", actionDefinition);
|
||||
return actDef;
|
||||
}
|
||||
|
||||
|
@ -548,7 +574,7 @@ public class ConvertToDataValueObjectModel {
|
|||
LOG.trace("toFilePathDV called");
|
||||
|
||||
if (filePath == null) {
|
||||
LOG.warn("List of " + FilePath.class.getSimpleName() + " is null");
|
||||
LOG.info("List of " + FilePath.class.getSimpleName() + " is null for {}", filePath);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -557,7 +583,9 @@ public class ConvertToDataValueObjectModel {
|
|||
fpVO.setFieldDefinition(filePath.getFieldDefinition());
|
||||
fpVO.setGcubeProfileFieldName(filePath.getGcubeProfileFieldName());
|
||||
|
||||
LOG.info("returning: " + fpVO);
|
||||
LOG.info("returning {}", StringUtil.ellipsize(fpVO.toString(), _MAX_LENGHT_STRING_AT_INFO));
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("returning {}", fpVO);
|
||||
return fpVO;
|
||||
}
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ public class SerializerUtil {
|
|||
|
||||
@Override
|
||||
public GeoServerPlatformInfoDV[] deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
|
||||
LOG.info("Sono qui: " +jp.getValueAsString());
|
||||
LOG.info("deserialize: " +jp.getValueAsString());
|
||||
return jp.readValueAs(GeoServerPlatformInfoDV[].class);
|
||||
//return jp.readValueAs(GeoServerPlatformInfoDV[].class);
|
||||
//List<GeoServerPlatformInfoDV> listPlatform = jp.readValueAs(new TypeReference<List<GeoServerPlatformInfoDV>>() {});
|
||||
|
|
|
@ -57,7 +57,7 @@ public class GeoportalConfigUtil {
|
|||
JSONArray arrayRoles = new JSONArray(data.get(0).toString());
|
||||
for (int i = 0; i < arrayRoles.length(); i++) {
|
||||
String role = arrayRoles.get(i).toString();
|
||||
LOG.info("for STEP_ID {} read role {}", stepID, role);
|
||||
LOG.debug("for STEP_ID {} read role {}", stepID, role);
|
||||
listdata.add(role);
|
||||
}
|
||||
}catch (Exception e) {
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
package org.gcube.application.geoportalcommon.util;
|
||||
|
||||
/**
|
||||
* The Class StringUtil.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||
*
|
||||
* Aug 31, 2023
|
||||
*/
|
||||
public class StringUtil {
|
||||
|
||||
/**
|
||||
* Ellipsize.
|
||||
*
|
||||
* @param input the input
|
||||
* @param maxLength the max length
|
||||
* @return the string
|
||||
*/
|
||||
public static String ellipsize(String input, int maxLength) {
|
||||
String ellip = "...";
|
||||
if (input == null || input.length() <= maxLength || input.length() < ellip.length()) {
|
||||
return input;
|
||||
}
|
||||
return input.substring(0, maxLength - ellip.length()).concat(ellip);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue