Project

General

Profile

« Previous | Next » 

Revision 53091

Fixed rules for the generation of a name suitable for ckan.

View differences:

modules/dnet-parthenos-publisher/trunk/src/main/java/eu/dnetlib/parthenos/catalogue/CatalogueRegistrator.java
117 117
	 */
118 118
	protected String getNameForCatalogue(final String name) throws UnsupportedEncodingException {
119 119
		//need to double decode for URLs like: http://parthenos.d4science.org/handle/Parthenos/REG/Dataset/Appellation/Isidore%2520Dataset
120
		String n = URLDecoder.decode(URLDecoder.decode(name,"UTF-8" ).replaceAll("/", "_").toLowerCase().replaceAll(" ", "_"), "UTF-8");
120
		String n =  StringUtils.replaceChars(URLDecoder.decode(name,"UTF-8" ),"/ .:", "_").toLowerCase().replaceAll("[^A-Za-z0-9]", "_");
121 121
		if(n.length() > 100){
122 122
			log.warn("Catalog name > 100: " + name);
123 123
			n = n.substring(0,99);

Also available in: Unified diff