Fixing problem with EdBackground form. processRdfForm2 now checks new resource URIs for duplicates.

This commit is contained in:
bdc34 2010-04-05 15:27:21 +00:00
parent 87a690a69c
commit 6ab4cdb63c

View file

@ -382,11 +382,18 @@ are well formed.
/* ******************** Utility methods ********************** */
public Map<String,String> newToUriMap(Map<String,String> newResources, WebappDaoFactory wdf){
HashMap<String,String> newUris = new HashMap<String,String>();
for( String key : newResources.keySet()){
newUris.put(key,makeNewUri(newResources.get(key), wdf));
HashMap<String,String> newVarsToUris = new HashMap<String,String>();
HashSet<String> newUris = new HashSet<String>();
for( String key : newResources.keySet()){
String prefix = newResources.get(key);
String uri = makeNewUri(prefix, wdf);
while( newUris.contains(uri) ){
uri = makeNewUri(prefix,wdf);
}
newVarsToUris.put(key,uri);
newUris.add(uri);
}
return newUris;
return newVarsToUris;
}