Reputation: 21
In my application, for Neo4j db, Team is using standalone instead of server. But team is provided with one jsp to view results in string format.
In JSP page, we are having one form to write the cypher query in textarea, and having button to fire the request to server. after firing the request to server, test result will be printed in web page in the form of String.
Here, We need a kind of mechanism to convert printed string in web page to neo4j "ExecutionResult" Object.
Can some one provide the code snippet for conversion?
Upvotes: 0
Views: 396
Reputation: 41676
There is no reverse way, you would have to write a parser yourself.
But you could have the client not only have a textual result but at the same time a richer JSON result and/or a link to post that json to your site.
For some ideas look at the code for http://console.neo4j.org which is at http://github.com/neo4j-contrib/rabbithole
It converts the ExecutionResult
into JSON and renders it as a jquery datatable in the client. And also has an additional popup (query details) for detailed data.
Upvotes: 0
Reputation: 6331
You could simply send a JSON request from your web page back to the server, something like
$(document).ready(function() {
$("#log").append($("#query").html());
})
http://jsfiddle.net/peterneubauer/WnPYp/ to grab the HTML element and send it with an AJAX request to the server?
Upvotes: 1