From: <sk...@us...> - 2008-08-15 13:44:42
|
Revision: 1090 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1090&view=rev Author: sknappe Date: 2008-08-15 13:44:39 +0000 (Fri, 15 Aug 2008) Log Message: ----------- added other functions (stop server call and get subjects from concept) Modified Paths: -------------- trunk/src/dbpedia-navigator/ajax_learn_concepts.php trunk/src/dbpedia-navigator/index.php Added Paths: ----------- trunk/src/dbpedia-navigator/ajax_get_subjects_from_concept.php trunk/src/dbpedia-navigator/ajax_stop_server_call.php Added: trunk/src/dbpedia-navigator/ajax_get_subjects_from_concept.php =================================================================== --- trunk/src/dbpedia-navigator/ajax_get_subjects_from_concept.php (rev 0) +++ trunk/src/dbpedia-navigator/ajax_get_subjects_from_concept.php 2008-08-15 13:44:39 UTC (rev 1090) @@ -0,0 +1,27 @@ +<?php + include('helper_functions.php'); + + $concept=$_POST['concept']; + + session_start(); + $id=$_SESSION['id']; + $ksID=$_SESSION['ksID']; + session_write_close(); + + setRunning($id,"true"); + + $concept=html_entity_decode($concept); + $content=""; + try{ + require_once("DLLearnerConnection.php"); + $sc=new DLLearnerConnection($id,$ksID); + $subjects=$sc->getSubjectsFromConcept($concept); + $content.=getResultsTable($subjects); + } catch (Exception $e){ + $content=$e->getMessage(); + } + + print $content; + print '$$'; + print "Instances for Concept ".$concept; +?> \ No newline at end of file Modified: trunk/src/dbpedia-navigator/ajax_learn_concepts.php =================================================================== --- trunk/src/dbpedia-navigator/ajax_learn_concepts.php 2008-08-15 13:33:38 UTC (rev 1089) +++ trunk/src/dbpedia-navigator/ajax_learn_concepts.php 2008-08-15 13:44:39 UTC (rev 1090) @@ -1,4 +1,6 @@ <?php + include('helper_functions.php'); + session_start(); if (isset($_SESSION['positive'])) $positives=$_SESSION['positive']; Added: trunk/src/dbpedia-navigator/ajax_stop_server_call.php =================================================================== --- trunk/src/dbpedia-navigator/ajax_stop_server_call.php (rev 0) +++ trunk/src/dbpedia-navigator/ajax_stop_server_call.php 2008-08-15 13:44:39 UTC (rev 1090) @@ -0,0 +1,8 @@ +<?php + include('helper_functions.php'); + + session_start(); + $id=$_SESSION['id']; + session_write_close(); + setRunning($id,"false"); +?> \ No newline at end of file Modified: trunk/src/dbpedia-navigator/index.php =================================================================== --- trunk/src/dbpedia-navigator/index.php 2008-08-15 13:33:38 UTC (rev 1089) +++ trunk/src/dbpedia-navigator/index.php 2008-08-15 13:44:39 UTC (rev 1090) @@ -335,6 +335,55 @@ XhrObj.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); XhrObj.send(); } + + function stopServerCall() + { + if (document.all){ + //IE + var XhrObj = new ActiveXObject("Microsoft.XMLHTTP"); + } + else{ + //Mozilla + var XhrObj = new XMLHttpRequest(); + } + + XhrObj.open("POST",'ajax_stop_server_call.php'); + + XhrObj.onreadystatechange = function() + { + if (XhrObj.readyState == 4 && XhrObj.status == 200){ + } + } + + XhrObj.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); + XhrObj.send(); + } + + function getSubjectsFromConcept(param) + { + if (document.all){ + //IE + var XhrObj = new ActiveXObject("Microsoft.XMLHTTP"); + } + else{ + //Mozilla + var XhrObj = new XMLHttpRequest(); + } + + XhrObj.open("POST",'ajax_get_subjects_from_concept.php'); + + XhrObj.onreadystatechange = function() + { + if (XhrObj.readyState == 4 && XhrObj.status == 200){ + var response = XhrObj.responseText.split('$$'); + document.getElementById('articlecontent').innerHTML=response[0]; + document.getElementById('ArticleTitle').innerHTML=response[1]; + } + } + + XhrObj.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); + XhrObj.send(param); + } </script> </head> <body> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |