package nl.idgis.publisher.harvester.sources;

public class ProviderUtils {

	public static String getTableName(String alternateTitle) {
		if(alternateTitle != null 
			&& !alternateTitle.trim().isEmpty()) {			 
		
			final String tableName;
			if(alternateTitle.contains(" ")) {
				tableName = alternateTitle.substring(0, alternateTitle.indexOf(" ")).trim();
			} else {
				tableName = alternateTitle.trim();
			}
			
			return tableName.replace(":", ".").toUpperCase();
		}
		
		return null;
	}
	
	public static String getCategoryId(String alternateTitle) {
		String tableName = getTableName(alternateTitle);
		
		if(tableName != null) {
			int separator = tableName.indexOf(".");
			if(separator != -1) {
				String schemaName = tableName.substring(0, separator);
				return schemaName;
			}
		}
		
		return null;
	}
}

@@ -473,11 +473,11 @@
 ).to
-Upp
+Low
 erCa
@@ -807,24 +807,38 @@
 n schemaName
+.toLowerCase()
 ;%0D%0A%09%09%09%7D%0D%0A%09%09%7D

tableName and schemaName to lowercase