]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/searchEngine/html/index.html
New: the user can now refine the proposed constraints once that they are
[helm.git] / helm / searchEngine / html / index.html
index 7e09b91f3710ef8e1f7bcbc970b336b62b677436..e7b73b5d2eed625b1be717c6957d7d0e28ecdaae 100644 (file)
@@ -16,8 +16,7 @@ var wrong=0;
 var ricordaliaslist=0;
 var actinput=0;
 var numeroazioniannullate=0;
-var terminecic="";var listaliases="";vlds=new Array();//contengono i parametri per dialogare col server in caso di ambiguità nella Match Conclusion.
-var disambiguation_choices = "";
+var terminecic="";var listaliases="";var choices;var vlds=new Array();//contengono i parametri per dialogare col server in caso di ambiguità nella Match Conclusion.
 aliasglob=new Array();//per conservare la lista degli alias
 function initialize()
        {
@@ -42,6 +41,59 @@ function initialize()
        actinput=0;
        numeroazioniannullate=0;
        }
+
+// @variable@ will be substituted by the searchEngine with the param.variable
+// argument value
+var processorURL="@processorURL@";
+var getterURL="@getterURL@";
+var thkeys="@thkeys@";
+var proofcheckerURL="@proofcheckerURL@";
+var draw_graphURL="@draw_graphURL@";
+var uri_set_queueURL="@uri_set_queueURL@";
+var UNICODEvsSYMBOL="@UNICODEvsSYMBOL@";
+var keys="@keys@";
+var thkeys="@thkeys@";
+var embedkeys="@embedkeys@";
+var doctype_public="@doctype-public@";
+var encoding="@encoding@";
+var thencoding="@thencoding@";
+var media_type="@media-type@";
+var thmedia_type="@thmedia-type@";
+var interfaceURL="@interfaceURL@";
+var thinterfaceURL="@thinterfaceURL@";
+var CICURI="@CICURI@";
+var naturalLanguage="@naturalLanguage@";
+var annotations="@annotations@";
+var interface_topurl="@topurl@";
+
+function ask_uwobo(url)
+       {
+         return (top.topurl+"/ask_uwobo?url="+
+                 escape(processorURL + "apply?" +
+                         "xmluri=" + escape(url) +
+                         "&keys=" + escape(thkeys) +
+                         "&param.processorURL=" + escape(processorURL) +
+                         "&param.getterURL=" + escape(getterURL) +
+                         "&param.proofcheckerURL=" + escape(proofcheckerURL) +
+                         "&param.draw_graphURL=" + escape(draw_graphURL) +
+                         "&param.uri_set_queueURL=" + escape(uri_set_queueURL) +
+                         "&param.UNICODEvsSYMBOL=" + escape(UNICODEvsSYMBOL) +
+                         "&param.keys=" + escape(keys) +
+                         "&param.thkeys=" + escape(thkeys) +
+                         "&param.embedkeys=" + escape(embedkeys) +
+                         "&param.doctype-public=" + escape(doctype_public) +
+                         "&param.encoding=" + escape(encoding) +
+                         "&param.thencoding=" + escape(thencoding) +
+                         "&param.media-type=" + escape(media_type) +
+                         "&param.thmedia-type=" + escape(thmedia_type) +
+                         "&param.interfaceURL=" + escape(interfaceURL) +
+                         "&param.thinterfaceURL=" + escape(thinterfaceURL) +
+                         "&param.CICURI=" + escape(CICURI) +
+                         "&param.naturalLanguage=" + escape(naturalLanguage) +
+                         "&param.annotations=" + escape(annotations) +
+                         "&param.topurl=" + escape(interface_topurl) +
+                         "&prop.method=html"));
+       }
 function help(w) // quando invocata, visualizza l' help relativo ad un oggetto. Di solito è legata ad un evento onFocus o onMouseOver.  
        {
        hw.document.close();
@@ -394,13 +446,191 @@ function aggq() // aggiorna la query sostituendo l' ultimo link editato con la s
        aggcw();
        cw.focus();
        }
-var topurl=document.location.protocol+'//'+document.location.host;
-//var topurl="";
+var re1 = /(.*)\?.*/;
+var re2 = /(.*)\/.*/;
+var topurl=document.location+"";
+topurl = topurl.replace(re1,"$1");
+topurl = topurl.replace(re2,"$1");
+//var topurl=document.location.protocol+'//'+document.location.host;
 var action="/getpage?url=";
 //var action="";
+
+
+// UTILITY FUNCTIONS FOR templateambigpdq1.html
+function templateambigpdq1_armageddon()
+       {
+       top.initialize();
+       top.window.open(top.topurl+top.action+"start.html","qw");
+       top.window.open(top.topurl+top.action+"blank.html","cw");
+       top.window.open(top.topurl+top.action+"blank.html","hw");
+       top.window.open(top.topurl+top.action+"blank.html","gw");
+       top.window.open(top.topurl+top.action+"blank.html","sw");
+       }
+
+function templateambigpdq1_resetta()
+       {
+       if (confirm("This will erase your query and start a new one. Are you sure you want to do this?"))
+               {templateambigpdq1_armageddon();}
+       }
+
+function templateambigpdq1_listauri(document,elenco)
+       {
+       for (i=0;i<elenco.length;i++)
+               {
+               document.write("<input type=checkbox name=uricheck value="+elenco[i]+"> "+elenco[i]+"<br>"); 
+               }
+       }
+
+function templateambigpdq1_invia(document,top,elenco,ident)
+       {
+       vecchiavlds=top.vlds.length;
+       stringa=top.topurl+"/"+top.current_query+"?term="+top.terminecic;
+       stringa=stringa+"&aliases="+top.listaliases;
+       stringa=stringa+"&choices=";
+  var choices = "";
+       top.vlds[top.vlds.length]=ident;
+       for (j=0;j<elenco.length;j++)
+               {
+               if (document.disamb.uricheck[j].checked)
+                       {
+                       top.vlds[top.vlds.length]=document.disamb.uricheck[j].value;
+                       }
+               }
+       top.vlds[top.vlds.length]=";";
+       for (j=0;j<top.vlds.length;j++)
+       {
+           choices=choices+(top.vlds[j]==";"?";":escape(top.vlds[j]))+" ";
+       }
+       choices=choices.substring(0,choices.length-2);
+  top.choices = choices;
+  stringa=stringa+escape(choices);
+       if (top.vlds.length==vecchiavlds){alert("You must select at least one of the options.");}
+       else
+       {
+          window.open(ask_uwobo(stringa),"cw");
+       }
+       } 
+
+  function templateambigpdq1_selezionaCostanti(document,elenco) {
+    for (i=0; i<elenco.length; i++) {
+      if (elenco[i].substring(elenco[i].length-4, elenco[i].length) != ".var") {
+        document.disamb.uricheck[i].checked = true;
+      } else {
+        document.disamb.uricheck[i].checked = false;
+      }
+    }
+  }
+
+
+
+// UTILITY FUNCTIONS FOR templateambigpdq2.html
+function templateambigpdq2_armageddon()
+       {
+       top.initialize();
+       top.window.open(top.topurl+top.action+"start.html","qw");
+       top.window.open(top.topurl+top.action+"blank.html","cw");
+       top.window.open(top.topurl+top.action+"blank.html","hw");
+       top.window.open(top.topurl+top.action+"blank.html","gw");
+       top.window.open(top.topurl+top.action+"blank.html","sw");
+       }
+
+function templateambigpdq2_resetta()
+       {
+       if (confirm("This will erase your query and start a new one. Are you sure you want to do this?"))
+               {templateambigpdq2_armageddon();}
+       }
+
+function templateambigpdq2_listainterpretazioni(document,elenco,labels)
+       {
+       for (i=0;i<elenco.length;i++)
+               {
+                      document.write("<input type=radio name=interp value="+elenco[i]+"> "+labels[i]+"<br />"); 
+               }
+       }
+
+function templateambigpdq2_invia(document,elenco)
+       {
+       stringa=top.topurl+"/"+top.current_query+"?term="+top.terminecic;
+       stringa=stringa+"&aliases=";
+       controllo=stringa.length;
+       for (j=0;j<elenco.length;j++)
+               {
+               if (document.disamb.interp[j].checked)
+                       {
+                       stringa=stringa+escape(elenco[j]);
+
+      // TODO da implementare nella terza fase
+                       //top.aliasglob[top.aliasglob.length]=document.disamb.interp[j].value;
+
+                       //for (k=0;k<top.aliasglob.length;k++){alert(top.aliasglob[k])}
+                       //top.listaliases=top.listaliases+document.disamb.interp[j].value;//in caso di query ulteriori con la stessa lista di alias
+                       }
+                       
+               }
+       if (stringa.length!=controllo) 
+               {
+               window.open(ask_uwobo(stringa),"cw");
+               }
+               else {alert("You must choose one option.");}
+       } 
+
+
+
+// UTILITY FUNCTIONS FOR templateambigpdq3.html
+function templateambigpdq3_init(aliases)
+{
+   top.aliasglob = new Array();
+   for (i=0; i<aliases.length; i++) {
+      top.aliasglob[i] = aliases[i];
+   }
+   top.vlds=new Array();
+   top.window.open(top.topurl+top.action+"editorpdq.html", "sw");
+}
+
+// UTILITY FUNCTIONS FOR constraints_choice_template.html
+function get_value_of_checkbox(checkbox)
+  {
+    return (checkbox.checked ? "1" : "0");
+  }
+
+function constraints_choice_template_invia(document,aliases,constr_obj_len,constr_rel_len,constr_sort_len)
+       {
+       stringa=top.topurl+"/"+top.current_query+"?term="+top.terminecic;
+       stringa=stringa+"&aliases="+escape(aliases);
+       stringa=stringa+"&choices="+escape(top.choices);
+       stringa=stringa+"&constraints=";
+       for (j=0;j<constr_obj_len;j++)
+        {
+         stringa += document.constraints.constr_obj[j].checked ? "1" : "0";
+      stringa += !document.constraints.obj_depth[j] ||
+                 document.constraints.obj_depth[j].value == "" ? "_" :
+                 document.constraints.obj_depth[j].value;
+      if (j < constr_obj_len - 1) { stringa += "," }
+        }
+  stringa += ":";
+       for (j=0;j<constr_rel_len;j++)
+        {
+         stringa += document.constraints.constr_rel[j].checked ? "1" : "0";
+      stringa += document.constraints.rel_depth[j].value == "" ? "_" :
+                 document.constraints.rel_depth[j].value;
+        if (j < constr_rel_len - 1) { stringa += "," }
+        }
+  stringa += ":";
+       for (j=0;j<constr_sort_len;j++)
+        {
+         stringa += document.constraints.constr_sort[j].checked ? "1" : "0";
+      stringa += document.constraints.sort_depth[j].value == "" ? "_" :
+                 document.constraints.sort_depth[j].value;
+      if (j < constr_sort_len - 1) { stringa += "," }
+        }
+  stringa += ":"+get_value_of_checkbox(document.constraints.only_obj)+
+             ":"+get_value_of_checkbox(document.constraints.only_rel)+
+             ":"+get_value_of_checkbox(document.constraints.only_sort);
+       window.open(ask_uwobo(stringa),"cw");
+       } 
 </SCRIPT>
 </HEAD>
-  <script>
+  <SCRIPT>
     document.write(' <FRAMESET ROWS="69%,31%"> <FRAMESET COLS="40%,60%"> <FRAMESET ROWS="46%,54%"> <FRAME NAME="qw" SRC="'+topurl+action+'start.html"> <FRAME NAME="sw" SRC="'+topurl+action+'blank.html"> </FRAMESET> <FRAME NAME="cw" SRC="'+topurl+action+'blank.html"> </FRAMESET> <FRAMESET COLS="49%,51%"> <FRAME NAME="gw" SRC="'+topurl+action+'blank.html" onFocus="help(-1)";> <FRAME NAME="hw" SRC="'+topurl+action+'blank.html"> </FRAMESET> </FRAMESET>');
-  </script>
+  </SCRIPT>
 </HTML>