From e99114ce44e69decd5a9f815833f1b89db574cf5 Mon Sep 17 00:00:00 2001 From: hjkhjk54 Date: Wed, 30 Nov 2011 21:45:59 +0000 Subject: [PATCH] Updates to include addSparqlForAdditionalUrisInScope and addSparqlForAdditionalLiteralsInScope and also updated addSparqlForExistingLiteral (as it wasn't setting the map created if map did not exist). --- .../n3editing/VTwo/EditConfigurationVTwo.java | 35 ++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/VTwo/EditConfigurationVTwo.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/VTwo/EditConfigurationVTwo.java index 99dce76dc..a79abf141 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/VTwo/EditConfigurationVTwo.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/VTwo/EditConfigurationVTwo.java @@ -941,7 +941,8 @@ public class EditConfigurationVTwo { Map map = sparqlForExistingLiterals; if( map == null ) { map = new HashMap(); - map.put(key, sparql); + map.put(key, sparql); + setSparqlForExistingLiterals(map); }else{ map.put(key, sparql); } @@ -962,6 +963,38 @@ public class EditConfigurationVTwo { map.put(key, sparql); } } + + public void addSparqlForAdditionalLiteralsInScope(String key, String sparql){ + if( key == null || key.isEmpty() ) + throw new IllegalArgumentException("key must not be null"); + if( sparql == null || sparql .isEmpty() ) + throw new IllegalArgumentException("sparql must not be null"); + + Map map = sparqlForAdditionalLiteralsInScope; + if( map == null ) { + map = new HashMap(); + map.put(key, sparql); + setSparqlForAdditionalLiteralsInScope(map); + }else{ + map.put(key, sparql); + } + } + + public void addSparqlForAdditionalUrisInScope(String key, String sparql){ + if( key == null || key.isEmpty() ) + throw new IllegalArgumentException("key must not be null"); + if( sparql == null || sparql .isEmpty() ) + throw new IllegalArgumentException("sparql must not be null"); + + Map map = sparqlForAdditionalUrisInScope; + if( map == null ) { + map = new HashMap(); + map.put(key, sparql); + setSparqlForAdditionalUrisInScope(map); + }else{ + map.put(key, sparql); + } + } public void addField( FieldVTwo field){ if( field == null )