diff --git a/productMods/edit/forms/js/customFormWithAutocomplete.js b/productMods/edit/forms/js/customFormWithAutocomplete.js index 4b4d92f8..b42da315 100644 --- a/productMods/edit/forms/js/customFormWithAutocomplete.js +++ b/productMods/edit/forms/js/customFormWithAutocomplete.js @@ -236,6 +236,9 @@ var customForm = { } this.getAcFilter(); + //If specific individuals are to be filtered out, add them here + //to the filtering list + this.getAcFilterForIndividuals(); this.acCache = {}; this.acSelector.autocomplete({ @@ -289,7 +292,7 @@ var customForm = { this.verifyMatch.data('baseHref', this.verifyMatch.attr('href')); }, - + //get autocomplete filter with sparql query getAcFilter: function() { if (!this.sparqlForAcFilter) { @@ -344,7 +347,18 @@ var customForm = { }); return filteredResults; }, + //To filter out specific individuals, not part of a query + //Pass in list of individuals to be filtered out + getAcFilterForIndividuals: function() { + if (!this.acFilterForIndividuals || !this.acFilterForIndividuals.length) { + this.acFilterForIndividuals = null; + return; + } + //add this list to the ac filter list + customForm.acFilter = customForm.acFilter.concat(this.acFilterForIndividuals); + + }, // Reset some autocomplete values after type is changed resetAutocomplete: function(typeVal) { // Append the type parameter to the base autocomplete url diff --git a/productMods/templates/freemarker/edit/forms/autoCompleteObjectPropForm.ftl b/productMods/templates/freemarker/edit/forms/autoCompleteObjectPropForm.ftl index 5303fba9..a864e68d 100644 --- a/productMods/templates/freemarker/edit/forms/autoCompleteObjectPropForm.ftl +++ b/productMods/templates/freemarker/edit/forms/autoCompleteObjectPropForm.ftl @@ -37,6 +37,8 @@ <#else> <#assign formTitle = editConfiguration.formTitle /> +<#--In order to fill out the subject--> +<#assign acFilterForIndividuals = "['" + editConfiguration.subjectUri + "']" />

${formTitle}

@@ -115,6 +117,7 @@ Also multiple types parameter set to true only if more than one type returned--> supportEdit: 'true', sparqlForAcFilter: '${sparqlForAcFilter}', sparqlQueryUrl: '${sparqlQueryUrl}', + acFilterForIndividuals: ${acFilterForIndividuals}, defaultTypeName: '${propertyNameForDisplay}' // used in repair mode to generate button text };