Skip to content

Commit b6731f2

Browse files
author
Gaurav SinghaRoy
committed
added a configured download button
1 parent 7e6b6fa commit b6731f2

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

app/assets/javascripts/resources/sparql.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,23 @@ SPARQL = {
6969
download_url += "&properties="+encodeURIComponent(QueryBuilder.properties.get_checked_properties());
7070
}
7171
window.open(download_url);
72+
},
73+
configured : function(){
74+
var download_url = Utils.rdf2any.server+Utils.rdf2any.actions.convert+"configured-converter?dataset="+QueryBuilder.datasets.get_selected()+"&query="+encodeURIComponent($("#txt_sparql_query").val());
75+
download_url += "&for_class="+QueryBuilder.classes.get_selected_class();
76+
download_url += "&properties="+encodeURIComponent(QueryBuilder.properties.get_checked_properties());
77+
var str_variable_disctionary = "";
78+
for(i=0;i<configured_convert.variable_dictionary.length;i++){
79+
if (i>0)
80+
str_variable_disctionary += ",";
81+
str_variable_disctionary += configured_convert.variable_dictionary.variable + "::" + configured_convert.variable_dictionary.value;
82+
83+
}
84+
download_url += "&variable_dictionary="+encodeURIComponent(str_variable_disctionary);
85+
download_url += "&header="+encodeURIComponent(configured_convert.head);
86+
download_url += "&body="+encodeURIComponent(configured_convert.body);
87+
download_url += "&footer="+encodeURIComponent(configured_convert.footer);
88+
window.open(download_url);
7289
}
7390

7491
},

app/views/query/_search_results.html.erb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@
5757
<output id="list"></output>
5858
</div>
5959
</div>
60+
<div class="div-configured-download row" style="display:none;">
61+
<div class="col-md-12">
62+
<button type="button" onclick="SPARQL.download.configured()">download final file !!</button>
63+
</div>
64+
</div>
6065
<%end%>
6166
</div>
6267
<div class="modal-footer">

0 commit comments

Comments
 (0)