ignore tags longer than 100 chars
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-catalogue/grsf-publisher-ws@158989 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
c620324cef
commit
4e45429796
|
@ -3,6 +3,9 @@
|
||||||
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
|
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
|
||||||
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
||||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
||||||
|
<dependent-module archiveName="grsf-common-library-1.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/grsf-common-library/grsf-common-library">
|
||||||
|
<dependency-type>uses</dependency-type>
|
||||||
|
</dependent-module>
|
||||||
<property name="context-root" value="grsf-publisher-ws"/>
|
<property name="context-root" value="grsf-publisher-ws"/>
|
||||||
<property name="java-output-path" value="/grsf-publisher-ws/target/classes"/>
|
<property name="java-output-path" value="/grsf-publisher-ws/target/classes"/>
|
||||||
</wb-module>
|
</wb-module>
|
||||||
|
|
|
@ -49,6 +49,7 @@ import eu.trentorise.opendata.jackan.model.CkanLicense;
|
||||||
public class CommonServiceUtils {
|
public class CommonServiceUtils {
|
||||||
|
|
||||||
private static final org.slf4j.Logger logger = LoggerFactory.getLogger(CommonServiceUtils.class);
|
private static final org.slf4j.Logger logger = LoggerFactory.getLogger(CommonServiceUtils.class);
|
||||||
|
private static final int TAG_MAX_SIZE = 100;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the list of licenses for stocks and fisheries
|
* Retrieve the list of licenses for stocks and fisheries
|
||||||
|
@ -183,12 +184,14 @@ public class CommonServiceUtils {
|
||||||
elementsToConsider = Math.min(elementsToConsider, Constants.TIME_SERIES_TAKE_LAST_VALUES);
|
elementsToConsider = Math.min(elementsToConsider, Constants.TIME_SERIES_TAKE_LAST_VALUES);
|
||||||
for (int i = (asList.size() - elementsToConsider); i < asList.size(); i++) {
|
for (int i = (asList.size() - elementsToConsider); i < asList.size(); i++) {
|
||||||
String finalTag = asList.get(i).toString().trim().replaceAll(Constants.REGEX_TAGS, "");
|
String finalTag = asList.get(i).toString().trim().replaceAll(Constants.REGEX_TAGS, "");
|
||||||
|
if(finalTag.length() <= TAG_MAX_SIZE)
|
||||||
tags.add(finalTag);
|
tags.add(finalTag);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
// else add all the available elements
|
// else add all the available elements
|
||||||
for (int i = 0; i < elementsToConsider; i++) {
|
for (int i = 0; i < elementsToConsider; i++) {
|
||||||
String finalTag = asList.get(i).toString().trim().replaceAll(Constants.REGEX_TAGS, "");
|
String finalTag = asList.get(i).toString().trim().replaceAll(Constants.REGEX_TAGS, "");
|
||||||
|
if(finalTag.length() <= TAG_MAX_SIZE)
|
||||||
tags.add(finalTag);
|
tags.add(finalTag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -197,6 +200,7 @@ public class CommonServiceUtils {
|
||||||
logger.debug("The object annotated with @Tag is a simple one. Adding ... ");
|
logger.debug("The object annotated with @Tag is a simple one. Adding ... ");
|
||||||
String finalTag = f.toString().trim().replaceAll(Constants.REGEX_TAGS, "");
|
String finalTag = f.toString().trim().replaceAll(Constants.REGEX_TAGS, "");
|
||||||
logger.debug(finalTag);
|
logger.debug(finalTag);
|
||||||
|
if(finalTag.length() <= TAG_MAX_SIZE)
|
||||||
tags.add(finalTag);
|
tags.add(finalTag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue