]> matita.cs.unibo.it Git - helm.git/commitdiff
This commit was manufactured by cvs2svn to create branch 'helm'.
authorno author <no.author@nowhere.it>
Tue, 13 Mar 2001 09:13:42 +0000 (09:13 +0000)
committerno author <no.author@nowhere.it>
Tue, 13 Mar 2001 09:13:42 +0000 (09:13 +0000)
17 files changed:
helm/on-line/html/control.html [new file with mode: 0644]
helm/on-line/html/index.html [new file with mode: 0644]
helm/on-line/html/library/control.html [new file with mode: 0644]
helm/on-line/html/library/header.html [new file with mode: 0644]
helm/on-line/html/library/index.html [new file with mode: 0644]
helm/on-line/html/welcome.html [new file with mode: 0644]
helm/on-line/icons/back.gif [new file with mode: 0644]
helm/on-line/icons/folder.gif [new file with mode: 0644]
helm/on-line/icons/generic.red.gif [new file with mode: 0644]
helm/on-line/javascript/.cvsignore [new file with mode: 0644]
helm/on-line/javascript/Makefile [new file with mode: 0644]
helm/on-line/javascript/control.js [new file with mode: 0644]
helm/on-line/javascript/defaults.js [new file with mode: 0644]
helm/on-line/javascript/prelude.js [new file with mode: 0644]
helm/on-line/javascript/utils.js [new file with mode: 0644]
helm/on-line/xslt/getParam.xsl [new file with mode: 0644]
helm/on-line/xslt/ls2html.xsl [new file with mode: 0644]

diff --git a/helm/on-line/html/control.html b/helm/on-line/html/control.html
new file mode 100644 (file)
index 0000000..6e8662d
--- /dev/null
@@ -0,0 +1,119 @@
+<html>
+
+<head>
+<title>On-Line Library Configuration</title>
+
+<style type="text/css">
+#normal { background-color: white; font-family: sans-serif }
+td.head { font-weight: bold; background-color: #e6e6fa; color: brown }
+td.back { background-color: #e6e6fa; color: brown }
+#indent { margin-left: 1cm; margin-right: 1cm }
+#centered { text-align: center }
+</style>
+
+<script language="JavaScript" src="../javascript/defaults.js"></script>
+<script language="JavaScript" src="../javascript/prelude.js"></script>
+
+</head>
+
+<body id="normal" onLoad="refreshLinks()">
+<a name="top"/>
+<table border="0" width="100%" cellpadding="4">
+<tr><td class="head" align="center"><big><big>On-Line Library Configuration</big></big></td></tr>
+</table>
+
+<br />
+
+<div id="indent">
+The on-line interface will use a
+<a href="http://www.cs.unibo.it/helm/getter" target="_top">Getter</a> to locate and
+download documents and an
+<a href="http://www.cs.unibo.it/helm/uwobo" target="_top">UWOBO</a> to apply transformations
+to them.
+
+
+<br /><br />
+
+Here you can choose the Getter and the UWOBO to use, providing valid URLs
+to instances of them.
+
+<br /><br />
+
+To control the behaviour of them, use the apposite
+<a onClick="refreshLinks();" href="http://www.cs.unibo.it/helm/getter/panel/index.html" target="_top">Getter panel</a>
+and
+<a onClick="refreshLinks();" href="http://www.cs.unibo.it/helm/uwobo/panel/index.html" target="_top">UWOBO panel</a>.
+
+<br /><br />
+
+<table border="0">
+  <tr>
+    <th colspan="2" align="left">UWOBO URL</th>
+  </tr>
+  <tr>
+    <td>
+      <form name="uwoboURL">
+      <script>
+        document.write('<input type="text" value="' + getInitialProcessorURL() + '" size="50"/>');
+      </script>
+      </form>
+    </td>
+    <td>
+      <form>
+        <select onChange="selectUwoboURL(this)">
+         <option value="">---</option>
+         <option value="localhost">localhost</option>
+         <option value="marcello.cs.unibo.it">marcello</option>
+         <option value="phd.cs.unibo.it">phd</option>
+         <option value="eolo.cs.unibo.it">eolo</option>
+       </select>
+      </form>
+    </td>
+    <td>
+      <form>
+        <input type="button" value="Check" onClick="top.result.location = getUwoboURL() + 'help'"/>
+      </form>
+    </td>
+  </tr>
+</table>
+
+<br />
+
+<table border="0">
+  <tr>
+    <th colspan="2" align="left">Getter URL</th>
+  </tr>
+  <tr>
+    <td>
+      <form name="getterURL">
+        <script>
+         document.write('<input type="text" value="' + getInitialGetterURL() + '" size="50"/>');
+       </script>
+      </form>
+    </td>
+    <td>
+      <form>
+        <select onChange="selectGetterURL(this)">
+         <option value="">---</option>
+         <option value="localhost">localhost</option>
+         <option value="marcello.cs.unibo.it">marcello</option>
+         <option value="phd.cs.unibo.it">phd</option>
+         <option value="eolo.cs.unibo.it">eolo</option>
+       </select>
+      </form>
+    </td>
+    <td>
+      <form>
+        <input type="button" value="Check" onClick="top.result.location = getGetterURL() + 'help'"/>
+      </form>
+    </td>
+  </tr>
+</table>
+</div>
+
+<div id="centered">
+<h1><a onClick="refreshLinks();" href="" target="_top"><script>if (top.location.search == '') document.write('ENTER THE LIBRARY'); else document.write('RETURN TO THE LIBRARY');</script></a></h1>
+</div>
+</body>
+</html>
+
diff --git a/helm/on-line/html/index.html b/helm/on-line/html/index.html
new file mode 100644 (file)
index 0000000..caeebcf
--- /dev/null
@@ -0,0 +1,8 @@
+<html>
+
+<frameset rows="75%,*">
+  <frame src="control.html" name="control"/>
+  <frame src="welcome.html" name="result"/>
+</frameset>
+
+</html>
diff --git a/helm/on-line/html/library/control.html b/helm/on-line/html/library/control.html
new file mode 100644 (file)
index 0000000..8450f32
--- /dev/null
@@ -0,0 +1,91 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
+"http://www.w3.org/TR/REC-html40/loose.dtd">
+<html>
+<head>
+<title>Control panel</title>
+<script language="JavaScript" src="../../javascript/defaults.js"></script>
+<script language="JavaScript" src="../../javascript/utils.js"></script>
+<script language="JavaScript" src="../../javascript/control.js"></script>
+</head>
+<body bgcolor="#ffffff" text="#000000">
+<form>
+<table>
+  <tr>
+    <td>
+      <b>Format</b>:
+    </td>
+    <td>
+      <select name="output" onChange="updateOutput(this,document.forms[0].format)">
+      <script>
+       var mode = getParam('mode');
+       var mode_list = mode.split(',');
+       outputOption(document, "processed", "Processed", mode_list[0]);
+       outputOption(document, "raw", "Raw", mode_list[0]);
+      </script>
+      </select>
+    </td>
+    <td>
+      <select name="format" onChange="updateFormat(this)">
+      <script>
+       var mode = getParam('mode');
+       var mode_list = mode.split(',');
+       if (mode_list[0] == "raw") {
+         outputOption(document, "cic", "CIC", mode_list[1]);
+         outputOption(document, "zcic", "CIC GZipped", mode_list[1]);
+       } else {
+         outputOption(document, "html", "HTML", mode_list[2]);
+         outputOption(document, "mml_cont", "MathML Content", mode_list[2]);
+         outputOption(document, "mml_pres", "MathML Presentation", mode_list[2]);
+       }
+      </script>
+      </select>
+    </td>
+    <td>
+     <script>
+       document.write('<a target="_top" href="' +
+         getParam('topurl') +
+        '?mode=' + getParam('mode') +
+        '&cicuri=' + getParam('cicuri') +
+        '&theoryuri=' + getParam('theoryuri') +
+        '&processorURL=' + getParam('processorURL') +
+        '&getterURL=' + getParam('getterURL') +
+        '" onClick="refreshReload()">Reload</a>');
+     </script>
+     <br>
+     (do it also before attempting to take a link to the current page)
+     <script>
+       top.processorURL = getParam('processorURL');
+       top.getterURL = getParam('getterURL');
+       top.topurl = getParam('topurl');
+       top.mode = getParam('mode');
+       top.cicuri = getParam('cicuri');
+       top.theoryuri = getParam('theoryuri');
+     </script>
+    </td>
+  </tr>
+  <tr>
+    <td colspan="3">
+      <script>
+       var mode = getParam('mode');
+       var mode_list = mode.split(',');
+        outputCheckbox(document, "updateNatural(this)", "&nbsp;Natural Language", mode_list[3] == "yes");
+        outputCheckbox(document, "updateAnnotations(this)", "&nbsp;Annotations", mode_list[4] == "yes");
+      </script>
+    </td>
+    <td>
+     <script>
+       document.write('<a target="_top" href="../../html/index.html' +
+         '?mode=' + getParam('mode') +
+        '&cicuri=' + getParam('cicuri') +
+        '&theoryuri=' + getParam('theoryuri') +
+        '&processorURL=' + getParam('processorURL') +
+        '&getterURL=' + getParam('getterURL') +
+        '">Configuration Panel</a>');
+     </script>
+     <br>
+    </td>
+  </tr>
+</table>
+</form>
+</body>
+</html>
diff --git a/helm/on-line/html/library/header.html b/helm/on-line/html/library/header.html
new file mode 100644 (file)
index 0000000..a1dcbda
--- /dev/null
@@ -0,0 +1,18 @@
+<!--
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+-->
+<html xmlns:helm="http://www.cs.unibo.it/helm">
+<head>
+<title>Control panel</title>
+</head>
+<body bgcolor="#ffffff" text="#000000">
+<table width="100%">
+<tr>
+ <td width="50%">
+  <font size="+3" face="Helvetica,Arial,sans-serif"><b>Index of <helm:getParam name="uri"/></b></font>
+  <hr noshade="yes" align="left" width="80%"/>
+ </td>
+</tr>
+</table>
+</body>
+</html>
diff --git a/helm/on-line/html/library/index.html b/helm/on-line/html/library/index.html
new file mode 100644 (file)
index 0000000..fb9afb3
--- /dev/null
@@ -0,0 +1,60 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
+"http://www.w3.org/TR/REC-html40/loose.dtd">
+<html>
+<head>
+ <script language="JavaScript" src="../../javascript/defaults.js"></script>
+ <script language="JavaScript" src="../../javascript/utils.js"></script>
+ <title>Index</script></title>
+</head>
+<script>
+  document.write('<frameset rows="18%,*" border="0" scrolling="no">');
+  document.write('<frame src="control.html' +
+       '?topurl=' + location.protocol + "//" + location.host + location.pathname +
+       '&mode=' + getParam('mode') +
+       '&cicuri=' + getParam('cicuri') +
+       '&theoryuri=' + getParam('theoryuri') +
+       '&processorURL=' + getParam('processorURL') +
+       '&getterURL=' + getParam('getterURL') +
+       '" name="control"/>');
+  document.write('<frameset cols="50%,50%" border="0" scrolling="no">');
+  document.write('<frameset rows="11%,*" border="0" scrolling="no">');
+  document.write('<frame src="' +
+       getParam('processorURL') + 'apply' +
+       '?keys=GP' +
+       '&xmluri=' + location.protocol + "//" + location.host + chopSlash(location.pathname) + "/header.html" +
+       '&param.uri=' + getParam('theoryuri') + 
+       '" name="theoryheader"/>');
+  document.write('<frame src="' +
+       getParam('processorURL') + 'apply' +
+       '?keys=L2H' +
+       '&xmluri=' + escape(getParam('getterURL') + 'ls?format=xml&baseuri=' + getParam('theoryuri')) +
+        '&param.keys=L2H' +
+       '&param.uri=' + getParam('theoryuri') +
+       '&param.getterURL=' + getParam('getterURL') +
+        '&param.target=theory' +
+       '&param.interfaceURL=' + location.protocol + "//" + location.host + chopSlash(chopSlash(chopSlash(location.pathname))) + 
+       '" name="theoryresult"/>');
+  document.write('</frameset>');
+  document.write('<frameset rows="11%,*" border="0" scrolling="no">');
+  document.write('<frame src="' +
+       getParam('processorURL') + 'apply' +
+       '?keys=GP' +
+       '&xmluri=' + location.protocol + "//" + location.host + chopSlash(location.pathname) + "/header.html" +
+       '&param.uri=' + getParam('cicuri') + 
+       '" name="cicheader"/>');
+  document.write('<frame src="' +
+       getParam('processorURL') + 'apply' +
+       '?keys=L2H' +
+       '&xmluri=' + escape(getParam('getterURL') + 'ls?format=xml&baseuri=' + getParam('cicuri')) +
+        '&param.keys=L2H' +
+       '&param.uri=' + getParam('cicuri') +
+       '&param.getterURL=' + getParam('getterURL') +
+        '&param.target=cic' +
+       '&param.interfaceURL=' + location.protocol + "//" + location.host + chopSlash(chopSlash(chopSlash(location.pathname))) +
+       '" name="cicresult"/>');
+  document.write('</frameset>');
+  document.write('</frameset>');
+  document.write('</frameset>');
+</script>
+
+</html>
diff --git a/helm/on-line/html/welcome.html b/helm/on-line/html/welcome.html
new file mode 100644 (file)
index 0000000..f6fbed4
--- /dev/null
@@ -0,0 +1,6 @@
+<html>
+
+<body bgcolor="white">
+</body>
+
+</html>
diff --git a/helm/on-line/icons/back.gif b/helm/on-line/icons/back.gif
new file mode 100644 (file)
index 0000000..a694ae1
Binary files /dev/null and b/helm/on-line/icons/back.gif differ
diff --git a/helm/on-line/icons/folder.gif b/helm/on-line/icons/folder.gif
new file mode 100644 (file)
index 0000000..4826460
Binary files /dev/null and b/helm/on-line/icons/folder.gif differ
diff --git a/helm/on-line/icons/generic.red.gif b/helm/on-line/icons/generic.red.gif
new file mode 100644 (file)
index 0000000..9474398
Binary files /dev/null and b/helm/on-line/icons/generic.red.gif differ
diff --git a/helm/on-line/javascript/.cvsignore b/helm/on-line/javascript/.cvsignore
new file mode 100644 (file)
index 0000000..e268d4a
--- /dev/null
@@ -0,0 +1 @@
+*.js_xml
diff --git a/helm/on-line/javascript/Makefile b/helm/on-line/javascript/Makefile
new file mode 100644 (file)
index 0000000..a2e2808
--- /dev/null
@@ -0,0 +1,19 @@
+
+TARGETS = control.js_xml defaults.js_xml utils.js_xml
+
+.SUFFIXES:
+.SUFFIXES: .js .js_xml
+
+.js.js_xml:
+       @echo "<?xml version='1.0'?>" >$@
+       @echo "<script>" >>$@
+       @echo "<![CDATA[" >>$@
+       @cat $< >>$@
+       @echo "]]>" >>$@
+       @echo "</script>" >>$@
+
+all: $(TARGETS)
+
+clean:
+       rm -rf $(TARGETS)
+
diff --git a/helm/on-line/javascript/control.js b/helm/on-line/javascript/control.js
new file mode 100644 (file)
index 0000000..66412aa
--- /dev/null
@@ -0,0 +1,138 @@
+
+function updateMode(i, s)
+{
+  var mode = top.mode;
+  var mode_list = mode.split(",");
+  var res = "";
+  var j;
+
+  for (j = 0; j < mode_list.length; j++) {
+    if (j == i) res += s;
+    else res += mode_list[j];
+    if (j < mode_list.length - 1) res += ",";
+  }
+  
+  top.mode = res;
+}
+
+function updateOutput(output,format)
+{
+  var theoryuri = top.theoryuri;
+  var cicuri = top.cicuri;
+  var mode = top.mode;
+  var topurl = top.topurl;
+  var processorURL = top.processorURL;
+  var getterURL = top.getterURL;
+  var mode_list = mode.split(",");
+  var new_mode = output.options[output.selectedIndex].value;
+  var dest = "?theoryuri=" + theoryuri + "&cicuri=" + cicuri + "&topurl=" + topurl + "&processorURL=" + processorURL + "&getterURL=" + getterURL + "&mode=";
+  
+  if (new_mode != mode_list[0]) {
+    updateMode(0, new_mode);
+    if (new_mode == "raw") updateMode(2, format.options[format.selectedIndex].value);
+    else updateMode(1, format.options[format.selectedIndex].value);
+    location.search = dest + top.mode;
+  }
+}
+
+function updateFormat(format)
+{
+  var mode = top.mode;
+  var mode_list = mode.split(",");
+
+  if (mode_list[0] == "raw") {
+    updateMode(1, format.options[format.selectedIndex].value);
+  } else {
+    updateMode(2, format.options[format.selectedIndex].value);
+  }
+
+  refreshReload();
+}
+
+function updateNatural(checkbox)
+{
+  if (checkbox.checked) updateMode(3, "yes");
+  else updateMode(3, "no");
+  refreshReload();
+}
+
+function updateAnnotations(checkbox)
+{
+  if (checkbox.checked) updateMode(4, "yes");
+  else updateMode(4, "no");
+  refreshReload();
+}
+
+function refreshReload()
+{
+   var search = 
+      "?mode=" + top.mode +
+      "&cicuri=" + top.cicuri +
+      "&theoryuri=" + top.theoryuri +
+      "&processorURL=" + top.processorURL +
+      "&getterURL=" + top.getterURL;
+
+   top.frames[0].document.links[0].search = search;
+   top.frames[0].document.links[1].search = search;
+
+   return true;
+}
+
+function refreshcicHeader(headerURL)
+{
+   top.cicheader.location.search = "?keys=GP&xmluri=" + headerURL + "&param.uri=" + top.cicuri;
+   return true;
+}
+
+function refreshtheoryHeader(headerURL)
+{
+   top.theoryheader.location.search = "?keys=GP&xmluri=" + headerURL + "&param.uri=" + top.theoryuri;
+   return true;
+}
+
+function makeURL(type,uri,cicflags,typesflags)
+{
+  var mode = top.mode;
+  var processorURL = top.processorURL;
+  var getterURL = top.getterURL;
+  var mode_list = mode.split(",");
+  
+  var keys = "";
+  var url = "";
+
+  var output = mode_list[0];
+  var format;
+  if (output == "raw") format = mode_list[1];
+  else format = mode_list[2];
+  
+  if (output == "raw") {
+    url = getterURL + "get?uri=" + uri;
+  } else {
+    if (format == "html" && type == "cic") {
+      keys = "C1,HC2&param.processorURL=" + escape(processorURL) +
+       "&param.getterURL=" + escape(getterURL) +
+       "&param.keys=" + escape("C1,HC2");
+    } else if (format == "html" && type == "theory") {
+      keys = "T1,T2,E&param.processorURL=" + escape(processorURL) +
+       "&param.getterURL=" + escape(getterURL) +
+       "&param.keys=" + escape("C1,HC2");
+    } else if (format == "mml_cont" && type == "cic") {
+      keys = "C1";
+    } else if (format == "mml_cont" && type == "theory") {
+      keys = "T1,E&param.keys=C1";
+    } else if (format == "mml_pres" && type == "cic") {
+      keys = "C1,C2";
+    } else if (format == "mml_pres" && type == "theory") {
+      keys = "T1,T2,E&param.keys=C1,C2";
+    }
+
+    var naturalLanguage = typesflags;
+    if (typesflags != "NO" || type == "theory") {
+       naturalLanguage = mode_list[3];
+    }
+    url = processorURL + "apply?xmluri=" + escape(getterURL + "get?uri=" + uri) + "&keys=" + keys + "&param.CICURI=" + uri + "&param.naturalLanguage=" + naturalLanguage;
+  }
+
+  return url;
+}
+
diff --git a/helm/on-line/javascript/defaults.js b/helm/on-line/javascript/defaults.js
new file mode 100644 (file)
index 0000000..f6abf7f
--- /dev/null
@@ -0,0 +1,19 @@
+
+function getDefaultParam(name)
+{
+  switch (name) {
+  case "processorURL":
+    return "http://phd.cs.unibo.it:8080/helm/servlet/uwobo/";
+  case "getterURL":
+    return "http://phd.cs.unibo.it:8081/"; 
+  case "cicuri":
+    return "cic:/";
+  case "theoryuri":
+    return "theory:/";
+  case "mode":
+    return "processed,cic,html,yes,no";
+  }
+  
+  return "???";
+}
+
diff --git a/helm/on-line/javascript/prelude.js b/helm/on-line/javascript/prelude.js
new file mode 100644 (file)
index 0000000..dff8c31
--- /dev/null
@@ -0,0 +1,91 @@
+
+function getInitialProcessorURL()
+{
+  var search = top.location.search;
+  search = search.slice(1);
+  var args = search.split("&");
+  var processorURL = "-1";
+  for (var i = 0 ; i < args.length ; i++) {
+     var couple = args[i].split("=");
+     if (couple[0] == "processorURL") processorURL = couple[1];
+  }
+  if (processorURL == "-1") processorURL = getDefaultParam("processorURL");
+  return processorURL;
+}
+
+function getInitialGetterURL()
+{
+  var search = top.location.search;
+  search = search.slice(1);
+  var args = search.split("&");
+  var getterURL = "-1";
+  for (var i = 0 ; i < args.length ; i++) {
+     var couple = args[i].split("=");
+     if (couple[0] == "getterURL") getterURL = couple[1];
+  }
+  if (getterURL == "-1") getterURL = getDefaultParam("getterURL");
+  return getterURL;
+}
+
+function getUwoboURL()
+{
+  return document.uwoboURL.elements[0].value;
+}
+
+function getGetterURL()
+{
+  return document.getterURL.elements[0].value;
+}
+
+function refreshLinks()
+{
+  var search = top.location.search;
+  search = search.slice(1);
+  var args = search.split("&");
+  var cicuri = "-1", theoryuri = "-1", mode = "-1";
+  for (var i = 0 ; i < args.length ; i++) {
+     var couple = args[i].split("=");
+     switch (couple[0]) {
+        case "cicuri"       : cicuri       =couple[1]; break;
+        case "theoryuri"    : theoryicuri  =couple[1]; break;
+        case "mode"         : mode         =couple[1]; break;
+     }
+  }
+  if (cicuri == "-1") cicuri = getDefaultParam("cicuri");
+  if (theoryuri == "-1") theoryuri = getDefaultParam("theoryuri");
+  if (mode == "-1") mode = getDefaultParam("mode");
+
+  document.links[2].search = "?getterURL=" + getGetterURL();
+  
+  document.links[3].search = 
+    "?processorURL=" + getUwoboURL() +
+    "&getterURL=" + getGetterURL();
+
+  document.links[4].href = "../html/library/index.html?cicuri=" + cicuri
+     + "&theoryuri=" + theoryuri
+     + "&mode=" + mode
+     + "&processorURL=" + getUwoboURL()
+     + "&getterURL=" + getGetterURL();
+}
+
+function selectUwoboURL(ss)
+{
+  if (ss.selectedIndex == 0) {
+    document.uwoboURL.elements[0].value = "";
+  } else {
+    document.uwoboURL.elements[0].value = "http://" + ss.options[ss.selectedIndex].value + ":8080/helm/servlet/uwobo/";
+  }
+
+  refreshLink();
+}
+
+function selectGetterURL(ss)
+{
+  if (ss.selectedIndex == 0) {
+    document.getterURL.elements[0].value = "";
+  } else {
+    document.getterURL.elements[0].value = "http://" + ss.options[ss.selectedIndex].value + ":8081/";
+  }
+
+  refreshLink();
+}
diff --git a/helm/on-line/javascript/utils.js b/helm/on-line/javascript/utils.js
new file mode 100644 (file)
index 0000000..7a52b7c
--- /dev/null
@@ -0,0 +1,36 @@
+function chopSlash(url)
+{
+  return url.slice(0,url.lastIndexOf('/'));
+}
+
+function getParam(name)
+{
+  var search = location.search;
+  search = search.slice(1);
+  var args = search.split("&");
+  var value = "???";
+
+  for (var i = 0 ; i < args.length ; i++) {
+     var couple = args[i].split("=");
+     if (couple[0] == name) value = couple[1];
+  }
+
+  if (value == "???") value = getDefaultParam(name);
+
+  return value;
+}
+
+function outputOption(doc, value, content, selected)
+{
+  doc.write("<option value=\"" + value + "\" ");
+  if (value == selected) doc.write("selected ");
+  doc.write(">" + content + "</option>");
+}
+
+function outputCheckbox(doc, onclick, content, checked)
+{
+  doc.write("<input type=\"checkbox\" onClick=\"" + onclick + "\" ");
+  if (checked) doc.write("checked");
+  doc.write(">" + content + "</input>");
+}
+
diff --git a/helm/on-line/xslt/getParam.xsl b/helm/on-line/xslt/getParam.xsl
new file mode 100644 (file)
index 0000000..0ec71a8
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+
+
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:helm="http://www.cs.unibo.it/helm">
+
+<xsl:output 
+       method="xml"
+       encoding="iso-8859-1" 
+       media-type="text/html"
+       doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
+       doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" />
+
+<xsl:param name="uri" select="''"/>
+
+<xsl:template match="helm:getParam">
+ <xsl:value-of select="$uri"/>
+</xsl:template>
+
+<xsl:template match = "/|*">
+  <xsl:copy>
+   <xsl:copy-of select="@*"/>
+   <xsl:apply-templates/>
+  </xsl:copy>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/helm/on-line/xslt/ls2html.xsl b/helm/on-line/xslt/ls2html.xsl
new file mode 100644 (file)
index 0000000..fc38877
--- /dev/null
@@ -0,0 +1,116 @@
+<?xml version="1.0"?>
+
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:output method="html" encoding="iso-8859-1"/>
+
+<!-- uri must end with '/' -->
+<xsl:param name="uri" select="''"/>
+<xsl:param name="keys" select="''"/>
+<xsl:param name="getterURL" select="''"/>
+<xsl:param name="interfaceURL" select="''"/>
+<xsl:param name="target" select="''"/>
+
+<xsl:template name="chop">
+ <xsl:param name="uri" select="''"/>
+ <xsl:param name="prefix" select="''"/>
+ <xsl:variable name="newprefix" select="substring-before($uri,'/')"/>
+ <xsl:choose>
+  <xsl:when test="$newprefix = ''"><xsl:value-of select="$prefix"/></xsl:when>
+  <xsl:otherwise>
+   <xsl:call-template name="chop">
+    <xsl:with-param name="uri" select="substring-after($uri,'/')"/>
+    <xsl:with-param name="prefix" select="concat($prefix,$newprefix,'/')"/>
+   </xsl:call-template>
+  </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:variable name="uridotdot">
+ <xsl:call-template name="chop">
+  <xsl:with-param name="uri" select="substring($uri,1,string-length($uri)-1)"/>
+ </xsl:call-template>
+</xsl:variable>
+
+<xsl:template name="makeDir">
+ <xsl:param name="uri" select="''"/>
+ <xsl:param name="basename" select="''"/>
+ <xsl:param name="icon" select="''"/>
+ <xsl:param name="alt" select="''"/>
+ <tr>
+  <td>
+   <img border="0" src="{concat($interfaceURL,'/icons/',$icon)}" alt="[{$alt}]"/>
+  </td>
+  <td>
+    <a
+      onClick=
+       "top.{$target}uri='{$uri}';
+        refresh{$target}Header('{$interfaceURL}/html/library/header.html');
+        this.search='?keys={$keys}' +
+         '&amp;xmluri=' + escape('{$getterURL}ls?format=xml'+'&amp;baseuri={$uri}')+
+         '&amp;param.uri={$uri}' +
+         '&amp;param.keys={$keys}' +
+         '&amp;param.getterURL={$getterURL}' +
+         '&amp;param.target={$target}' +
+         '&amp;param.interfaceURL={$interfaceURL}';"
+      onMouseOver="window.status='{$uri}'; return true"
+      href="apply"
+   ><xsl:value-of select="$basename"/></a>
+  </td>
+ </tr>
+</xsl:template>
+
+<xsl:template match="/">
+ <html>
+  <head>
+   <title>Index of <xsl:value-of select="$uri"/></title>
+   <xsl:copy-of select="document(concat($interfaceURL,'/javascript/control.js_xml'))" />
+  </head>
+  <body bgcolor="#ffffff" text="#000000">
+   <table>
+    <xsl:if test="$uridotdot != ''">
+     <xsl:call-template name="makeDir">
+      <xsl:with-param name="uri" select="$uridotdot"/>
+      <xsl:with-param name="basename" select="'Parent Directory'"/>
+      <xsl:with-param name="icon" select="'back.gif'"/>
+      <xsl:with-param name="alt" select="'Parent Directory'"/>
+     </xsl:call-template>
+    </xsl:if>
+    <xsl:apply-templates select="*"/>
+   </table>
+   <hr noshade="yes" align="left" width="80%"/>
+  </body>
+ </html>
+</xsl:template>
+
+<xsl:template match="section">
+ <xsl:variable name="diruri">
+  <xsl:value-of select="."/>
+ </xsl:variable>
+ <xsl:call-template name="makeDir">
+  <xsl:with-param name="uri" select="concat($uri,$diruri,'/')"/>
+  <xsl:with-param name="basename" select="$diruri"/>
+  <xsl:with-param name="icon" select="'folder.gif'"/>
+  <xsl:with-param name="alt" select="$uri"/>
+ </xsl:call-template>
+</xsl:template>
+
+<xsl:template match="object">
+ <xsl:variable name="name" select="@name"/>
+ <xsl:variable name="ann" select="ann/@value"/>
+ <xsl:variable name="types" select="types/@value"/>
+ <tr>
+  <td>
+   <img border="0" src="{concat($interfaceURL,'/icons/generic.red.gif')}" alt="[{@name}]"/>
+  </td>
+  <td>
+   <a href="" target="{$target}"
+      onClick="this.href=makeURL('{$target}','{concat($uri,$name)}','{$ann}','{$types}')"
+      onMouseOver="window.status='{concat($uri,$name)}'; return true"
+   ><xsl:value-of select="$name"/></a>
+  </td>
+ </tr>
+</xsl:template>
+
+</xsl:stylesheet>