implementazione advanced search, alert per stringa vuota in simple query
This commit is contained in:
parent
0b9ce4073a
commit
e1857bb683
|
@ -168,7 +168,10 @@ $(document).ready(function() {
|
|||
esprlogica = []
|
||||
jsonQuery=getJsonQuery()
|
||||
console.log("got json query")
|
||||
|
||||
if(jsonQuery['QueryAvanzata']==0 && jsonQuery['Clausola0']['queryText']==''){
|
||||
alert('Digitare una stringa da cercare')
|
||||
return
|
||||
}
|
||||
jsonQuery = buildSQ(jsonQuery)
|
||||
|
||||
myquery = new sparqlGenerator().stringify(jsonQuery)
|
||||
|
|
12
js/utils.js
12
js/utils.js
|
@ -323,7 +323,7 @@ function buildSQ(stquery) {
|
|||
if (stquery['EsprLogica'] != null && stquery['EsprLogica'] != '' && stquery['EsprLogica'].length == 1) {
|
||||
clause = stquery['EsprLogica']
|
||||
|
||||
myquery = buildClause(stquery[clause], parsedquery, 0)
|
||||
myquery = buildClause(stquery[clause], parsedquery, 2)
|
||||
return (myquery)
|
||||
}
|
||||
|
||||
|
@ -349,6 +349,7 @@ function buildSQ(stquery) {
|
|||
parsedquery.where[0].expression.args[0].value = "lm";
|
||||
}
|
||||
else {
|
||||
console.log('Simple query, no param')
|
||||
parsedquery.where.splice(0, 1)
|
||||
}
|
||||
|
||||
|
@ -423,13 +424,14 @@ function buildClause(clause, parsedquery, whereind) {
|
|||
else
|
||||
strval = clause['queryText'].trim().slice(0, -1)
|
||||
|
||||
parsedquery.where[1].expression.args[1].value = strval;
|
||||
parsedquery.where[0].expression.args[1].value = strval;
|
||||
if (clause['lemma_forma'] == 'lemma')
|
||||
parsedquery.where[1].expression.args[0].value = "lm";
|
||||
parsedquery.where[0].expression.args[0].value = "lm";
|
||||
}
|
||||
else {
|
||||
if (parsedquery.where[1].type == 'filter' && parsedquery.where[1].expression.args[0].value == 'Rappresentazione')
|
||||
parsedquery.where.splice(1, 1)
|
||||
if (parsedquery.where[0].type == 'filter' && parsedquery.where[0].expression.args[0].value == 'Rappresentazione')
|
||||
parsedquery.where.splice(0, 1)
|
||||
whereind=whereind-1
|
||||
}
|
||||
if (clause['typeGramm0'] != null && clause['typeGramm0'] != "all")
|
||||
if (whereind > -1)
|
||||
|
|
Loading…
Reference in New Issue