@@ -36,6 +36,16 @@ var setup = function(){
3636 /*
3737 Helper Functions
3838 */
39+ //Helper Function for Process Queries that displays the results after hitting "Process Query"
40+ function createResultFrame ( message ) {
41+ var resultFrame = $ ( '<div class="result-frame"><div class="result-box"><div class="result-box-band">Return Result<div class="result-frame-close"><img src="img/close-icon.png"></div></div><div class="return-result"></div></div></div>' ) ;
42+ $ ( 'body' ) . append ( resultFrame ) ;
43+
44+ var node = new PrettyJSON . view . Node ( {
45+ el :$ ( '.return-result' ) ,
46+ data :message
47+ } ) ;
48+ }
3949
4050 //Create Operator Helper Function
4151 function getExtraOperators ( userInput , panel ) {
@@ -53,7 +63,6 @@ var setup = function(){
5363 }
5464 extraOperators [ 'keyword' ] = userInput ;
5565 extraOperators [ 'matching_type' ] = $ ( '#' + panel + ' .matching-type' ) . val ( ) ;
56-
5766 }
5867 else if ( panel == 'dictionary-panel' ) {
5968 if ( userInput == null || userInput == '' ) {
@@ -233,6 +242,49 @@ var setup = function(){
233242 var operators = [ ] ;
234243 var links = [ ] ;
235244
245+ var DUMMYJSON = {
246+ glossary : {
247+ title : 'example glossary' ,
248+ GlossDiv : {
249+ title : 'S' ,
250+ GlossList : {
251+ GlossEntry : {
252+ ID : 'SGML' ,
253+ SortAs : 'SGML' ,
254+ GlossTerm : 'Standard Generalized Markup Language' ,
255+ Acronym : 'SGML' ,
256+ Abbrev : 'ISO 8879:1986' ,
257+ GlossDef : {
258+ para : 'A meta-markup language, used to create markup languages such as DocBook.' ,
259+ GlossSeeAlso : [ 'GML' , 'XML' ]
260+ } ,
261+ GlossSee : 'markup'
262+ }
263+ }
264+ }
265+ } ,
266+ glossary2 : {
267+ title : 'example glossary' ,
268+ GlossDiv : {
269+ title : 'S' ,
270+ GlossList : {
271+ GlossEntry : {
272+ ID : 'SGML' ,
273+ SortAs : 'SGML' ,
274+ GlossTerm : 'Standard Generalized Markup Language' ,
275+ Acronym : 'SGML' ,
276+ Abbrev : 'ISO 8879:1986' ,
277+ GlossDef : {
278+ para : 'A meta-markup language, used to create markup languages such as DocBook.' ,
279+ GlossSeeAlso : [ 'GML' , 'XML' ]
280+ } ,
281+ GlossSee : 'markup'
282+ }
283+ }
284+ }
285+ }
286+ }
287+
236288 for ( var operatorIndex in GUIJSON . operators ) {
237289 var currentOperator = GUIJSON [ 'operators' ]
238290 if ( currentOperator . hasOwnProperty ( operatorIndex ) ) {
@@ -257,9 +309,6 @@ var setup = function(){
257309 }
258310 TEXTDBJSON . operators = operators ;
259311 TEXTDBJSON . links = links ;
260-
261- // console.log(JSON.stringify(TEXTDBJSON));
262- // console.log(JSON.stringify(GUIJSON));
263312
264313 $ . ajax ( {
265314 url : "http://localhost:8080/queryplan/execute" ,
@@ -270,9 +319,12 @@ var setup = function(){
270319 success : function ( returnedData ) {
271320 console . log ( "SUCCESS\n" ) ;
272321 console . log ( JSON . stringify ( returnedData ) ) ;
322+ createResultFrame ( returnedData ) ;
273323 } ,
274324 error : function ( xhr , status , err ) {
275- console . log ( "ERROR" ) ;
325+ console . log ( JSON . stringify ( xhr ) ) ;
326+ console . log ( JSON . stringify ( err ) ) ;
327+ createResultFrame ( DUMMYJSON ) ;
276328 }
277329 } ) ;
278330 } ;
@@ -300,7 +352,7 @@ var setup = function(){
300352 var deleteButton = $ ( '<button class="delete-operator">Delete</button>' ) ;
301353 $ ( '#attributes' ) . append ( deleteButton ) ;
302354
303- $ ( '.band' ) . html ( 'Attributes for <em>' + title + '</em>' ) ;
355+ $ ( '.attributes- band' ) . html ( 'Attributes for <em>' + title + '</em>' ) ;
304356 } ;
305357
306358 //Create Operator to send to flowchart.js and display on flowchart
@@ -418,7 +470,7 @@ var setup = function(){
418470 output = data [ 'operators' ] [ selectedOperator ] [ 'properties' ] [ 'attributes' ] ;
419471
420472 var title = data [ 'operators' ] [ selectedOperator ] [ 'properties' ] [ 'title' ] ;
421- $ ( '.band' ) . html ( 'Attributes for <em>' + title + '</em>' ) ;
473+ $ ( '.attributes- band' ) . html ( 'Attributes for <em>' + title + '</em>' ) ;
422474
423475 $ ( '#attributes' ) . text ( getPopupText ( output ) ) ;
424476 $ ( '#attributes' ) . html ( $ ( '#attributes' ) . text ( ) ) ;
@@ -437,7 +489,7 @@ var setup = function(){
437489 'visibility' : 'hidden'
438490 } ) ;
439491
440- $ ( '.band' ) . text ( 'Attributes' ) ;
492+ $ ( '.attributes- band' ) . text ( 'Attributes' ) ;
441493
442494 $ ( '#the-flowchart' ) . flowchart ( 'deleteSelected' ) ;
443495 data = $ ( '#the-flowchart' ) . flowchart ( 'getData' ) ;
0 commit comments