From 3bed795ea4952ccc5b741e3b1cc011b48d7b6b44 Mon Sep 17 00:00:00 2001 From: hjkhjk54 Date: Thu, 30 Aug 2012 17:53:35 +0000 Subject: [PATCH] page management: updates to allow for class group content to change to internal class/selected classes and vice versa. --- .../utils/ProcessInternalClassDataGetterN3.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/preprocessors/utils/ProcessInternalClassDataGetterN3.java b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/preprocessors/utils/ProcessInternalClassDataGetterN3.java index 97f6bea6..a8e3a320 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/preprocessors/utils/ProcessInternalClassDataGetterN3.java +++ b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/preprocessors/utils/ProcessInternalClassDataGetterN3.java @@ -104,6 +104,8 @@ public class ProcessInternalClassDataGetterN3 extends ProcessIndividualsForClas //First, put dataGetterURI within scope as well //((ProcessDataGetterAbstract)this).populateExistingDataGetterURI(dataGetterURI, counter); this.populateExistingDataGetterURI(dataGetterURI, counter); + //Put in type + this.populateExistingClassType(this.getClassType(), counter); //Sparql queries for values to be executed //And then placed in the correct place/literal or uri String querystr = getExistingValuesInternalClass(dataGetterURI); @@ -132,7 +134,7 @@ public class ProcessInternalClassDataGetterN3 extends ProcessIndividualsForClas if(qs.get("internalClass") != null && internalClassLiteral == null) { internalClassLiteral= qs.getLiteral("internalClass"); - existingLiteralValues.put(this.getVarName("internalClass", counter), + existingLiteralValues.put(this.getVarName(internalClassVarNameBase, counter), new ArrayList(Arrays.asList(internalClassLiteral))); } } @@ -141,7 +143,7 @@ public class ProcessInternalClassDataGetterN3 extends ProcessIndividualsForClas new ArrayList(individualsForClasses)); //Final check, in case no internal class flag was returned, set to false if(internalClassLiteral == null) { - existingLiteralValues.put(this.getVarName("internalClass", counter), + existingLiteralValues.put(this.getVarName(internalClassVarNameBase, counter), new ArrayList( Arrays.asList(ResourceFactory.createPlainLiteral("false")) )); @@ -168,6 +170,8 @@ public class ProcessInternalClassDataGetterN3 extends ProcessIndividualsForClas public JSONObject getExistingValuesJSON(String dataGetterURI, OntModel queryModel, ServletContext context) { JSONObject jObject = new JSONObject(); jObject.element("dataGetterClass", classType); + //Update to include class type as variable + jObject.element(classTypeVarBase, classType); //Get selected class group, if internal class, and classes selected from class group getExistingClassGroupAndInternalClass(dataGetterURI, jObject, queryModel); //Get all classes in the class group