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) {
|
||||
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
|
||||
populatePageContentSection:function(existingContentObject, pageContentSection) {
|
||||
//var classGroupValue = existingContentObject["classGroup"];
|
||||
//var classesSelected = existingContentObject["classesSelectedInClassGroup"];
|
||||
var isInternal = existingContentObject["isInternal"];
|
||||
//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
|
||||
//select class group in dropdown and append the classes within that class group
|
||||
processClassGroupDataGetterContent.populatePageContentSection(existingContentObject, pageContentSection);
|
||||
var classesSelected = existingContentObject["classesSelectedInClassGroup"];
|
||||
var numberSelected = classesSelected.length;
|
||||
var i;
|
||||
//Uncheck all since default is checked
|
||||
pageContentSection.find("input[name='classInClassGroup']").removeAttr("checked");
|
||||
for(i = 0; i < numberSelected; i++) {
|
||||
var classSelected = classesSelected[i];
|
||||
pageContentSection.find("input[name='classInClassGroup'][value='" + classSelected + "']").attr("checked", "checked");
|
||||
}*/
|
||||
}
|
||||
//internal class
|
||||
var isInternal = existingContentObject["isInternal"];
|
||||
//Also internal class needs to be selected
|
||||
if(isInternal == "true") {
|
||||
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
|
||||
retrieveContentLabel:function() {
|
||||
return processClassGroupDataGetterContent.retrieveContentLabel();
|
||||
},
|
||||
//For the label of the content section for editing, need to add additional value
|
||||
retrieveAdditionalLabelText:function(existingContentObject) {
|
||||
return processClassGroupDataGetterContent.retrieveAdditionalLabelText(existingContentObject);
|
||||
|
||||
},
|
||||
//Validation on form submit: Check to see that class group has been selected
|
||||
validateFormSubmission: function(pageContentSection) {
|
||||
return processClassGroupDataGetterContent.validateFormSubmission(pageContentSection);
|
||||
validateFormSubmission: function(pageContentSection, pageContentSectionLabel) {
|
||||
return processClassGroupDataGetterContent.validateFormSubmission(pageContentSection, pageContentSectionLabel);
|
||||
}
|
||||
|
||||
}
|
|
@ -37,8 +37,8 @@ public class ProcessInternalClassDataGetterN3 extends ProcessIndividualsForClas
|
|||
private static String internalClassVarNameBase = "isInternal";
|
||||
private Log log = LogFactory.getLog(ProcessInternalClassDataGetterN3.class);
|
||||
|
||||
public ProcessInternalClassDataGetterN3(JSONObject jsonObject){
|
||||
super(jsonObject);
|
||||
public ProcessInternalClassDataGetterN3(){
|
||||
super();
|
||||
|
||||
}
|
||||
//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
|
||||
public List<String> retrieveN3Required(int 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);
|
||||
//this is a json array
|
||||
jObject.element("individualsForClasses", individualsForClasses);
|
||||
jObject.element(individualClassVarNameBase, individualsForClasses);
|
||||
//Internal class - if null then add false otherwise use the value
|
||||
if(internalClassLiteral != null) {
|
||||
jObject.element("internalClass", internalClassLiteral.getString());
|
||||
jObject.element(internalClassVarNameBase, internalClassLiteral.getString());
|
||||
} else {
|
||||
jObject.element("internalClass", "false");
|
||||
jObject.element(internalClassVarNameBase, "false");
|
||||
}
|
||||
} catch(Exception ex) {
|
||||
log.error("Exception occurred in retrieving existing values with query " + querystr, ex);
|
||||
|
|
Loading…
Add table
Reference in a new issue