(Arrays.asList(JavaScript.JQUERY_UI.path(),
JavaScript.UTILS.path(),
JavaScript.CUSTOM_FORM_UTILS.path(),
- "/edit/forms/js/customFormWithAdvanceTypeSelection.js"
+ "/edit/forms/js/customFormWithAdvanceTypeSelection.js"
));
request.setAttribute("customJs", customJs);
@@ -202,15 +212,21 @@ SPARQL queries for existing values. --%>
+
+
-
+
Create a new publication entry for <%= subjectName %>
" >
-
- ">
-
diff --git a/productMods/edit/forms/js/addAuthorsToInformationResource.js b/productMods/edit/forms/js/addAuthorsToInformationResource.js
index bb490fcb..8b5ffdbf 100644
--- a/productMods/edit/forms/js/addAuthorsToInformationResource.js
+++ b/productMods/edit/forms/js/addAuthorsToInformationResource.js
@@ -178,7 +178,7 @@ var addAuthorForm = {
url: addAuthorForm.acUrl,
dataType: 'json',
data: request,
- complete: function(xhr) {
+ complete: function(xhr, status) {
// Not sure why, but we need an explicit json parse here. jQuery
// should parse the response text and return a json object.
var results = jQuery.parseJSON(xhr.responseText);
diff --git a/productMods/edit/forms/js/customFormWithAdvanceTypeSelection.js b/productMods/edit/forms/js/customFormWithAdvanceTypeSelection.js
index fd60ea91..e8efcc86 100644
--- a/productMods/edit/forms/js/customFormWithAdvanceTypeSelection.js
+++ b/productMods/edit/forms/js/customFormWithAdvanceTypeSelection.js
@@ -102,9 +102,11 @@ var customForm = {
},
initAutocomplete: function() {
-
+
+ var acFilter = this.getAcFilter();
+
this.acCache = {};
- this.baseAcUrl = $('.acUrl').attr('id');
+ this.baseAcUrl = customFormData.acUrl;
this.acSelector.autocomplete({
minLength: 3,
@@ -120,11 +122,13 @@ var customForm = {
url: customForm.acUrl,
dataType: 'json',
data: request,
- complete: function(xhr) {
+ complete: function(xhr, status) {
// Not sure why, but we need an explicit json parse here. jQuery
// should parse the response text and return a json object.
var results = jQuery.parseJSON(xhr.responseText);
- customForm.acCache[request.term] = results;
+
+ customForm.acCache[request.term] = results;
+
response(results);
}
@@ -137,6 +141,22 @@ var customForm = {
});
},
+
+ getAcFilter: function() {
+ // RY This gets put on the page for now. May want to put into a js file instead.
+ var url = $('.sparqlQueryUrl').attr('id');
+
+ $.ajax({
+ url: customFormData.sparqlQueryUrl,
+ data: {
+ resultFormat: 'RS_JSON',
+ query: customFormData.sparqlForAcFilter
+ },
+ success: function(data, status, xhr) {
+ console.log(data);
+ }
+ })
+ },
// Reset some autocomplete values after type is changed
resetAutocomplete: function(typeVal) {