updates for page management - specifically handling of internal class etc.
This commit is contained in:
parent
3e34e4cdb2
commit
c391a35b3d
3 changed files with 25 additions and 25 deletions
|
@ -30,5 +30,11 @@ var processDataGetterUtils = {
|
||||||
},
|
},
|
||||||
isRelatedToBrowseClassGroup:function(contentType) {
|
isRelatedToBrowseClassGroup:function(contentType) {
|
||||||
return (contentType == "browseClassGroup" || contentType == "internalClass");
|
return (contentType == "browseClassGroup" || contentType == "internalClass");
|
||||||
|
},
|
||||||
|
getContentTypeForCloning:function(contentType) {
|
||||||
|
if(contentType == "browseClassGroup" || contentType == "internalClass") {
|
||||||
|
return "browseClassGroup";
|
||||||
|
}
|
||||||
|
return contentType;
|
||||||
}
|
}
|
||||||
};
|
};
|
|
@ -31,22 +31,19 @@ var processInternalClassDataGetterContent = {
|
||||||
},
|
},
|
||||||
//For an existing set of content where form is already set, fill in the values
|
//For an existing set of content where form is already set, fill in the values
|
||||||
populatePageContentSection:function(existingContentObject, pageContentSection) {
|
populatePageContentSection:function(existingContentObject, pageContentSection) {
|
||||||
//var classGroupValue = existingContentObject["classGroup"];
|
//select class group in dropdown and append the classes within that class group
|
||||||
//var classesSelected = existingContentObject["classesSelectedInClassGroup"];
|
processClassGroupDataGetterContent.populatePageContentSection(existingContentObject, pageContentSection);
|
||||||
var isInternal = existingContentObject["isInternal"];
|
var classesSelected = existingContentObject["classesSelectedInClassGroup"];
|
||||||
//Select the class group, display classes in class group, and select classes that are included
|
|
||||||
processIndividualsForClassesDataGetterContent.populatePageContentSection(existingContentObject, pageContentSection);
|
|
||||||
/*
|
|
||||||
//Set class group
|
|
||||||
pageContentSection.find("select[name='selectClassGroup']").val(classGroupValue);
|
|
||||||
//Set classes selected within class group
|
|
||||||
//TODO: Add magic for "all" if all classes selected
|
|
||||||
var numberSelected = classesSelected.length;
|
var numberSelected = classesSelected.length;
|
||||||
var i;
|
var i;
|
||||||
|
//Uncheck all since default is checked
|
||||||
|
pageContentSection.find("input[name='classInClassGroup']").removeAttr("checked");
|
||||||
for(i = 0; i < numberSelected; i++) {
|
for(i = 0; i < numberSelected; i++) {
|
||||||
var classSelected = classesSelected[i];
|
var classSelected = classesSelected[i];
|
||||||
pageContentSection.find("input[name='classInClassGroup'][value='" + classSelected + "']").attr("checked", "checked");
|
pageContentSection.find("input[name='classInClassGroup'][value='" + classSelected + "']").attr("checked", "checked");
|
||||||
}*/
|
}
|
||||||
|
//internal class
|
||||||
|
var isInternal = existingContentObject["isInternal"];
|
||||||
//Also internal class needs to be selected
|
//Also internal class needs to be selected
|
||||||
if(isInternal == "true") {
|
if(isInternal == "true") {
|
||||||
pageContentSection.find("input[name='display-internalClass']").attr("checked", "checked");
|
pageContentSection.find("input[name='display-internalClass']").attr("checked", "checked");
|
||||||
|
@ -60,13 +57,17 @@ var processInternalClassDataGetterContent = {
|
||||||
|
|
||||||
},
|
},
|
||||||
//For the label of the content section for editing, need to add additional value
|
//For the label of the content section for editing, need to add additional value
|
||||||
|
retrieveContentLabel:function() {
|
||||||
|
return processClassGroupDataGetterContent.retrieveContentLabel();
|
||||||
|
},
|
||||||
|
//For the label of the content section for editing, need to add additional value
|
||||||
retrieveAdditionalLabelText:function(existingContentObject) {
|
retrieveAdditionalLabelText:function(existingContentObject) {
|
||||||
return processClassGroupDataGetterContent.retrieveAdditionalLabelText(existingContentObject);
|
return processClassGroupDataGetterContent.retrieveAdditionalLabelText(existingContentObject);
|
||||||
|
|
||||||
},
|
},
|
||||||
//Validation on form submit: Check to see that class group has been selected
|
//Validation on form submit: Check to see that class group has been selected
|
||||||
validateFormSubmission: function(pageContentSection) {
|
validateFormSubmission: function(pageContentSection, pageContentSectionLabel) {
|
||||||
return processClassGroupDataGetterContent.validateFormSubmission(pageContentSection);
|
return processClassGroupDataGetterContent.validateFormSubmission(pageContentSection, pageContentSectionLabel);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -37,8 +37,8 @@ public class ProcessInternalClassDataGetterN3 extends ProcessIndividualsForClas
|
||||||
private static String internalClassVarNameBase = "isInternal";
|
private static String internalClassVarNameBase = "isInternal";
|
||||||
private Log log = LogFactory.getLog(ProcessInternalClassDataGetterN3.class);
|
private Log log = LogFactory.getLog(ProcessInternalClassDataGetterN3.class);
|
||||||
|
|
||||||
public ProcessInternalClassDataGetterN3(JSONObject jsonObject){
|
public ProcessInternalClassDataGetterN3(){
|
||||||
super(jsonObject);
|
super();
|
||||||
|
|
||||||
}
|
}
|
||||||
//Pass in variable that represents the counter
|
//Pass in variable that represents the counter
|
||||||
|
@ -46,13 +46,6 @@ public class ProcessInternalClassDataGetterN3 extends ProcessIndividualsForClas
|
||||||
//That can be included here if need be, but for now just adding the type alone
|
//That can be included here if need be, but for now just adding the type alone
|
||||||
public List<String> retrieveN3Required(int counter) {
|
public List<String> retrieveN3Required(int counter) {
|
||||||
return super.retrieveN3Required(counter);
|
return super.retrieveN3Required(counter);
|
||||||
/*
|
|
||||||
List<String> requiredN3 = new ArrayList<String>();
|
|
||||||
String partialN3 = this.getN3ForTypePartial(counter) + ".";
|
|
||||||
requiredN3.add(getPrefixes() + partialN3);
|
|
||||||
requiredN3.addAll(this.addIndividualClassesN3(counter));
|
|
||||||
return requiredN3;
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -211,12 +204,12 @@ public class ProcessInternalClassDataGetterN3 extends ProcessIndividualsForClas
|
||||||
|
|
||||||
jObject.element("classGroup", classGroupURI);
|
jObject.element("classGroup", classGroupURI);
|
||||||
//this is a json array
|
//this is a json array
|
||||||
jObject.element("individualsForClasses", individualsForClasses);
|
jObject.element(individualClassVarNameBase, individualsForClasses);
|
||||||
//Internal class - if null then add false otherwise use the value
|
//Internal class - if null then add false otherwise use the value
|
||||||
if(internalClassLiteral != null) {
|
if(internalClassLiteral != null) {
|
||||||
jObject.element("internalClass", internalClassLiteral.getString());
|
jObject.element(internalClassVarNameBase, internalClassLiteral.getString());
|
||||||
} else {
|
} else {
|
||||||
jObject.element("internalClass", "false");
|
jObject.element(internalClassVarNameBase, "false");
|
||||||
}
|
}
|
||||||
} catch(Exception ex) {
|
} catch(Exception ex) {
|
||||||
log.error("Exception occurred in retrieving existing values with query " + querystr, ex);
|
log.error("Exception occurred in retrieving existing values with query " + querystr, ex);
|
||||||
|
|
Loading…
Add table
Reference in a new issue