updates for adding external concept

This commit is contained in:
hjkhjk54 2011-11-28 20:55:23 +00:00
parent 7223392ece
commit 3e0e617f94
3 changed files with 11 additions and 8 deletions

View file

@ -120,7 +120,6 @@ var addConceptForm = {
submitSearchTerm: function() {
//Get value of search term
var searchValue = this.searchTerm.val();
this.entryTerm.val(searchValue);
var dataServiceUrl = addConceptForm.dataServiceUrl + "?searchTerm=" + encodeURIComponent(searchValue);
$.getJSON(dataServiceUrl, function(results) {
if ( results.array.length == 0 ) {
@ -170,7 +169,7 @@ var addConceptForm = {
return bestMatchResults;
},
addResultsHeader:function() {
var htmlAdd = "<li class='terminology'><div class='row'><span class='column conceptLabel'>Label (Type) </span><span class='column conceptDefinition'>Definition</span></div></li>";
var htmlAdd = "<li class='concepts'><div class='row'><span class='column conceptLabel'>Label (Type) </span><span class='column conceptDefinition'>Definition</span></div></li>";
return htmlAdd;
},
hideSearchResults:function() {
@ -190,11 +189,11 @@ var addConceptForm = {
checkedElements.each(function() {
checkedConceptElement = $(this);
checkedConcept = checkedTermElement.val();
checkedConcept = checkedConceptElement.val();
conceptLabel = checkedConceptElement.attr("label");
conceptSource = checkedConceptElement.attr("conceptDefinedBy");
conceptNodes.push(checkedConcept);
conceptLabels.push(termLabel);
conceptLabels.push(conceptLabel);
conceptSources.push(conceptSource);
});
this.externalConceptURI.val(conceptNodes);

View file

@ -92,7 +92,7 @@
<input type="button" id="searchButton" name="searchButton" value="Search"/>
</p>
<input type="hidden" id="conceptNode" name="conceptNode" value=""/> <!-- Field value populated by JavaScript -->
<input type="hidden" id="ConceptLabel" name="conceptLabel" value="" /> <!-- Field value populated by JavaScript -->
<input type="hidden" id="conceptLabel" name="conceptLabel" value="" /> <!-- Field value populated by JavaScript -->
<!--TODO: Change this so this is populated by the javascript-->
<input type="hidden" id="conceptSource" name="conceptSource" value="" /> <!-- Field value populated by JavaScript -->
<div id="selectedConcept" name="selectedConcept" class="acSelection">
@ -102,8 +102,9 @@
<!-- Field value populated by JavaScript -->
</div>
<a href="${userDefinedConceptUrl}" > Can't find the concept you want? Create your own.</a>
<div><a href="${userDefinedConceptUrl}" > Can't find the concept you want? Create your own.</a>
</div>
<input type="hidden" name="editKey" id="editKey" value="${editKey}"/>
<p class="submit">
<input type="submit" id="submit" name="submit" value="Add Term" />
<span class="or"> or <a class="cancel" href="${cancelUrl}">Cancel</a>
@ -125,7 +126,9 @@ ${stylesheets.add('<link rel="stylesheet" href="${urls.base}/js/jquery-ui/css/sm
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/edit/forms/css/customForm.css" />')}
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/edit/forms/css/addConcept.css" />')}
${scripts.add('<script type="text/javascript" src="${urls.base}/js/jquery-ui/js/jquery-ui-1.8.9.custom.min.js"></script>')}
${scripts.add('<script type="text/javascript" src="${urls.base}/js/customFormUtils.js"></script>')}
${scripts.add('<script type="text/javascript" src="${urls.base}/js/browserUtils.js"></script>')}
${scripts.add('<script type="text/javascript" src="${urls.base}/edit/forms/js/addConcept.js"></script>')}

View file

@ -223,6 +223,7 @@ public class AddAssociatedConceptGenerator extends VivoBaseGenerator implements
//The URI of the node that defines the concept
urisOnForm.add("conceptNode");
urisOnForm.add("conceptSource");
editConfiguration.setUrisOnform(urisOnForm);
//Also need to add the label of the concept
literalsOnForm.add("conceptLabel");
editConfiguration.setLiteralsOnForm(literalsOnForm);