]> matita.cs.unibo.it Git - helm.git/commitdiff
Initial revision
authorLuca Padovani <luca.padovani@unito.it>
Fri, 6 Apr 2001 14:02:02 +0000 (14:02 +0000)
committerLuca Padovani <luca.padovani@unito.it>
Fri, 6 Apr 2001 14:02:02 +0000 (14:02 +0000)
helm/uwobo-panel/.cvsignore [new file with mode: 0644]
helm/uwobo-panel/Makefile [new file with mode: 0644]
helm/uwobo-panel/control.html [new file with mode: 0644]
helm/uwobo-panel/control.js [new file with mode: 0644]
helm/uwobo-panel/index.html [new file with mode: 0644]
helm/uwobo-panel/welcome.html [new file with mode: 0644]

diff --git a/helm/uwobo-panel/.cvsignore b/helm/uwobo-panel/.cvsignore
new file mode 100644 (file)
index 0000000..335ec95
--- /dev/null
@@ -0,0 +1 @@
+*.tar.gz
diff --git a/helm/uwobo-panel/Makefile b/helm/uwobo-panel/Makefile
new file mode 100644 (file)
index 0000000..cb5610d
--- /dev/null
@@ -0,0 +1,12 @@
+
+all:
+
+clean:
+       rm -f uwobo-panel.tar.gz
+
+cleanbak:
+       rm -rf *~
+
+dist: clean cleanbak
+       cd ..; tar cvfz uwobo-panel.tar.gz panel ; mv uwobo-panel.tar.gz panel
+
diff --git a/helm/uwobo-panel/control.html b/helm/uwobo-panel/control.html
new file mode 100644 (file)
index 0000000..91c2e07
--- /dev/null
@@ -0,0 +1,425 @@
+<html>
+
+<head>
+<title>UWOBO Control Panel</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 }
+</style>
+
+<script language="JavaScript" src="control.js">
+</script>
+
+</head>
+
+<body id="normal">
+<a name="top"/>
+<table border="0" width="100%" cellpadding="4">
+<tr><td class="head" align="center"><big><big>UWOBO Control Panel</big></big></td></tr>
+</table>
+
+<br />
+
+<div id="indent">
+This is a control panel for the UWOBO servlet. You can control a local or remote UWOBO servlet by filling
+the appropriate fields <a href="#params">below</a> and sending the desired commands. In most cases, results of commands, such as error
+messages or documents, will be opened in the frame at the bottom of this page. For those commands sending multiple
+requests to the UWOBO server, a new window will be opened for each request issued. Note that in order to use
+this page <i>you must have JavaScript enabled</i>.
+If you have troubles, please send an email to the author:
+<a href="mailto:luca.padovani@cs.unibo.it">luca.padovani@cs.unibo.it</a>
+
+<br /><br />
+
+The sections:
+<ul>
+  <li><a href="#params">Global Parameters</a></li>
+  <li><a href="#queries">Queries</a></li>
+  <li><a href="#stylesheets">Stylesheet Management</a></li>
+  <li><a href="#process">Processing</a></li>
+</ul>
+
+In case you want to customize the panel for your own needs, you can download the source archive
+(HTML + JavaScript):
+<ul>
+  <li>UWOBO Panel [<a href="uwobo-panel.tar.gz">.tar.gz</a>]</li>
+</ul>
+
+</div>
+
+<a name="params"/>
+<table border="0" width="100%" cellpadding="4" cellspacing="0">
+<tr>
+  <td class="head" align="left"><big>Global Parameters</big></td>
+  <td class="back" align="right"><a href="#top">top</a></td>
+</tr>
+</table>
+
+<br />
+
+<div id="indent">
+The following are global parameters used by all the other section to contact the UWOBO servlet and possibly a
+getter. The getter is not required for some operations and can be excluded by unchecking the proper buttons
+below.
+
+<br /><br />
+
+The following is the URL used to contact the UWOBO servlet. Note that the servlet is usually launched by
+<a href="http://jakarta.apache.org" target="top">TOMCAT</a>. <tt>localhost</tt> is relative to your machine. 
+
+<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>
+
+The following is the URL used to contact the getter. The getter is usually launched manually.
+In all cases except for the check button below, 
+<tt>localhost</tt> is relative to the host running UWOBO, because the getter URL is sent as
+a parameter along with UWOBO commands. In other words, <tt>localhost</tt> <i>is</i> the host
+running UWOBO and not your machine.
+
+<br /><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>
+
+<a name="queries"/>
+<table border="0" width="100%" cellpadding="4" cellspacing="0">
+<tr>
+  <td class="head" align="left"><big>Queries</big></td>
+  <td class="back" align="right"><a href="#top">top</a></td>
+</tr>
+</table>
+
+<div id="indent">
+
+<br />
+
+The following are commands to do some simple queries about the UWOBO servlet.
+
+<br /><br />
+
+<table border="0">
+<tr>
+  <td>
+    Retrieve the version of the UWOBO servlet running at the UWOBO URL and list the syntax
+    of the accepted commands.
+    You can use this button to verify that a UWOBO servlet
+    is actually running there:
+  </td>
+</tr>
+<tr>
+  <td><form><input type="button" value="Help" onClick="top.result.location = getUwoboURL() + 'help'"/></form></td>
+</tr>
+<tr>
+  <td>
+    Ask UWOBO for a list of the stylesheets currently compiled inside the servlet, along with their keys:
+  </td>
+</tr>
+<tr>
+  <td><form><input type="button" value="List Stylesheets" onClick="top.result.location = getUwoboURL() + 'list'"/></form></td>
+</tr>
+</table>
+
+<br />
+
+</div>
+
+<a name="stylesheets"/>
+<table border="0" width="100%" cellpadding="4" cellspacing="0">
+<tr>
+  <td class="head" align="left"><big>Stylesheet Management</big></td>
+  <td class="back" align="right"><a href="#top">top</a></td>
+</tr>
+</table>
+
+<div id="indent">
+
+<br />
+
+In this section you can add, remove and reload stylesheet into the server. There are
+some frequently used stylesheets whose URIs and keys can be automatically filled in
+by selecting one of the options of the box below. Note that for such stylesheets
+the getter is used by default (you can deselect it, however):
+
+<br /><br 7>
+
+<table border="0">
+<tr>
+  <th align="left">Predefined Stylesheets</th>
+</tr>
+<tr>
+  <td>
+    <form name="predefinedStylesheets">
+      <select size="1" onChange="selectPredefinedStylesheet(this)">
+        <option value="">---</option>
+        <option value="C1,rootcontent.xsl,true">CIC ==&gt; MathML Content</option>
+        <option value="TC1,objtheorycontent.xsl,true">CIC ==&gt; MathML Content (Show only the thesis)</option>
+        <option value="C2,annotatedpres.xsl,true">MathML Content ==&gt; MathML Presentation</option>
+        <option value="T1,theory_content.xsl,true">Theory CIC ==&gt; MathML Content</option>
+        <option value="T2,theory_pres.xsl,true">Theory Content ==&gt; MathML Presentation</option>
+        <option value="E,expandobj.xsl,true">Expander</option>
+        <option value="HC2,content_to_html.xsl,true">MathML Content ==&gt; HTML</option>
+        <option value="L,link.xsl,true">Resolve links</option>
+        <option value="L2H,http://phd.cs.unibo.it/helm/xslt/ls2html.xsl,false">Getter LS ==&gt; HTML</option>
+        <option value="GP,http://phd.cs.unibo.it/helm/xslt/getParam.xsl,false">Get Param</option>
+      </select>
+    </form>
+  </td>
+  <td>
+    <form>
+      <input type="button" value="Load All Predefined" onClick="loadAllPredefined()"/>
+    </form>
+  </td>
+  <td>
+    <form>
+      <input type="button" value="Remove All Predefined" onClick="removeAllPredefined()"/>
+    </form>
+  </td>
+</tr>
+</table>
+
+Here you have to identify a stylesheet by means of a relative or absolute URI. Usually
+you will specify a relative URI when using the getter to retrieve the stylesheet.
+Moreover, you can specify a key associated to this stylesheet, so that it will be easier to
+refer to it in subsequent operations. If escaping is enabled, then the stylesheet URI will
+be escaped. This might be particularly useful if the stylesheet is loaded by the getter.
+
+<br /><br />
+
+<table border="0">
+<tr>
+  <th align="left">Stylesheet</th>
+  <th align="left">Key</th>
+  <th align="left">Use Getter</th>
+  <th align="left">Escape</th>
+</tr>
+<tr>
+  <td>
+    <form name="stylesheetURI">
+      <input type="text" size="50"/>
+    </form>
+  </td>
+  <td>
+    <form name="stylesheetKey">
+      <input type="text" size="10"/>
+    </form>
+  </td>
+  <td>
+    <form name="loadUseGetter">
+      <input type="checkbox" checked="true"/>
+    </form>
+  </td>
+  <td>
+    <form name="loadEscape">
+      <input type="checkbox" checked="true"/>
+    </form>
+  </td>
+  <td>
+    <form>
+      <input type="button" value="Load" onClick="loadStylesheet()"/>
+    </form>
+  </td>
+  <td>
+    <form>
+      <input type="button" value="Reload" onClick="reloadStylesheet()"/>
+    </form>
+  </td>
+  <td>
+    <form>
+      <input type="button" value="Remove" onClick="removeStylesheet()"/>
+    </form>
+  </td>
+</tr>
+</table>
+
+Use the buttons below to remove or reload <i>all</i> the stylesheets inside the servlet. Use these commands with
+care, and remember that the servlet can be shared among different users:
+
+<br /><br />
+
+<table border="0">
+<tr>
+  <td>
+    <form>
+      <input type="button" value="Remove All" onClick="removeAllStylesheets()"/>
+    </form>
+  </td>
+  <td>
+    <form>
+      <input type="button" value="Reload All" onClick="top.result.location = getUwoboURL() + 'reload'"/>
+    </form>
+  </td>
+</tr>
+</table>
+</div>
+
+<a name="process"/>
+<table border="0" width="100%" cellpadding="4" cellspacing="0">
+<tr>
+  <td class="head" align="left"><big>Processing</big></td>
+  <td class="back" align="right"><a href="#top">top</a></td>
+</tr>
+</table>
+
+<div id="indent">
+
+<br />
+
+You can use the &quot;Apply&quot; command to perform a transformation. Specify the URI of the source
+document in the form below. The URI can be relative or absolute (in the former case you
+will probably want to enable the use of the getter).
+If escaping is enabled, then special characters are escaped. This might be particularly useful
+if the source is loaded by the getter.
+
+<br /><br />
+
+<table border="0">
+<tr>
+  <th align="left">Source Document</th>
+  <th align="left">Escape</th>
+</tr>
+<tr>
+  <td>
+    <form name="sourceDocument">
+      <input type="text" size="50"/>
+    </form>
+  </td>
+  <td>
+    <form name="escapeSource">
+      <input type="checkbox" checked="true"/>
+    </form>
+  </td>
+</tr>
+</table>
+
+You can specify a sequence of zero or more parameters separated by blanks. Each
+parameter is made of a name immediately followed by <tt>=</tt> and then a value.
+If &quot;Escape&quot; is checked, then parameters are escaped in the final
+URI.
+
+<br /><br />
+
+<table border="0">
+<tr>
+  <th align="left">Parameters (optional)</th>
+  <th align="left">Escape</th>
+</tr>
+<tr>
+  <td>
+    <form name="parameters">
+      <input type="text" size="50"/>
+    </form>
+  </td>
+  <td>
+    <form name="escapeParameters">
+      <input type="checkbox" checked="true"/>
+    </form>
+  </td>
+</tr>
+</table>
+
+In the key list specify a list of keys
+separated by blanks. This is the list of stylesheets to be applied in sequence to the
+source document.
+When ready, click on the button and have fun!
+
+<br /><br />
+
+<table border="0">
+<tr>
+  <th align="left">Key list</th>
+  <th align="left">Use Getter</th>
+</tr>
+<tr>
+  <td>
+    <form name="keyList">
+      <input type="text" size="50"/>
+    </form>
+  </td>
+  <td>
+    <form name="applyUseGetter">
+      <input type="checkbox" checked="true"/>
+    </form>
+  </td>
+  <td>
+    <form>
+      <input type="button" value="Apply" onClick="applyStylesheets()"/>
+    </form>
+  </td>
+</tr>
+</table>
+
+</div>
+
+<table border="0" width="100%" cellpadding="4" cellspacing="0">
+<tr>
+  <td class="back" align="left">Page maintained by: <a href="mailto:luca.padovani@cs.unibo.it">Luca Padovani</a></td>
+  <td class="back" align="right"><a href="#top">top</a></td>
+</tr>
+</table>
+
+</body>
+
+</html>
+
diff --git a/helm/uwobo-panel/control.js b/helm/uwobo-panel/control.js
new file mode 100644 (file)
index 0000000..258163f
--- /dev/null
@@ -0,0 +1,186 @@
+
+function getParam(name, def)
+{
+  var search = top.location.search;
+  search = search.slice(1);
+  var args = search.split("&");
+  var value = "-1";
+  for (var i = 0 ; i < args.length ; i++) {
+    var couple = args[i].split("=");
+    if (couple[0] == name) value = couple[1];
+  }
+  if (value == "-1") value = def;
+  return value;
+}
+
+function getInitialProcessorURL()
+{
+  return getParam("processorURL", "http://phd.cs.unibo.it:8080/helm/servlet/uwobo/");
+}
+
+function getInitialGetterURL()
+{
+  return getParam("getterURL", "http://phd.cs.unibo.it:8081/");
+}
+
+function getUwoboURL()
+{
+  return document.uwoboURL.elements[0].value;
+}
+
+function getGetterURL()
+{
+  return document.getterURL.elements[0].value;
+}
+
+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/";
+  }
+}
+
+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/";
+  }
+}
+
+function getPredefinedStylesheetKey(i)
+{
+  var v = document.predefinedStylesheets.elements[0].options[i].value;
+  var va = v.split(",");
+  return va[0];
+}
+
+function getPredefinedStylesheetURI(i)
+{
+  var v = document.predefinedStylesheets.elements[0].options[i].value;
+  var va = v.split(",");
+  return va[1];
+}
+
+function getPredefinedStylesheetUseGetter(i)
+{
+  var v = document.predefinedStylesheets.elements[0].options[i].value;
+  var va = v.split(",");
+  return va[2];
+}
+
+function selectPredefinedStylesheet(ss)
+{
+  if (ss.selectedIndex == 0) {
+    document.stylesheetURI.elements[0].value = "";
+    document.stylesheetKey.elements[0].value = "";
+  } else {
+    document.stylesheetURI.elements[0].value = getPredefinedStylesheetURI(ss.selectedIndex);
+    document.stylesheetKey.elements[0].value = getPredefinedStylesheetKey(ss.selectedIndex);
+  }
+
+  document.loadUseGetter.elements[0].checked = getPredefinedStylesheetUseGetter(ss.selectedIndex) == "true" ? true : false;
+  document.loadEscape.elements[0].checked = true;
+}
+
+function getStylesheetURL()
+{
+  var s;
+
+  if (document.loadUseGetter.elements[0].checked) {
+    s = getGetterURL() + "getxslt?uri=" + document.stylesheetURI.elements[0].value;
+  } else {
+    s = document.stylesheetURI.elements[0].value;
+  }
+
+  if (document.loadEscape.elements[0].checked) s = escape(s);
+  
+  return s;
+}
+
+function loadStylesheet()
+{
+  top.result.location = getUwoboURL() + "add?xsluri=" + getStylesheetURL() + "&key=" + document.stylesheetKey.elements[0].value;
+}
+
+function removeStylesheet()
+{
+  top.result.location = getUwoboURL() + "remove?key=" + document.stylesheetKey.elements[0].value;
+}
+
+function removeAllStylesheets()
+{
+  top.result.location = getUwoboURL() + "remove";
+}
+
+function reloadStylesheet()
+{
+  top.result.location = getUwoboURL() + "reload?key=" + document.stylesheetKey.elements[0].value;
+}
+
+function loadAllPredefined()
+{
+  with (document.predefinedStylesheets.elements[0]) {
+    var i;
+
+    for (i = 1; i < length; i++)
+      open(getUwoboURL() +
+       "add?xsluri=" +  escape((getPredefinedStylesheetUseGetter(i) == "true" ? (getGetterURL() + "getxslt?uri=") : "") + getPredefinedStylesheetURI(i)) +
+       "&key=" + getPredefinedStylesheetKey(i),
+       getPredefinedStylesheetKey(i),
+       "toolbar=0,location=0,directories=0,status=0,menubar=0,width=400,height=200");
+  }
+}
+
+function removeAllPredefined()
+{
+  with (document.predefinedStylesheets.elements[0]) {
+    var i;
+
+    for (i = 1; i < length; i++)
+      open(getUwoboURL() + "remove?key=" + getPredefinedStylesheetKey(i),
+       getPredefinedStylesheetKey(i),
+       "toolbar=0,location=0,directories=0,status=0,menubar=0,width=400,height=200");
+  }
+}
+
+function applyStylesheets()
+{
+  var i = 0;
+  var keyList = document.keyList.elements[0].value.split(" ");
+
+  var url = getUwoboURL() + "apply?xmluri=";
+  
+  var sourceURL = "";
+
+  if (document.applyUseGetter.elements[0].checked)
+    sourceURL += getGetterURL() + "getxml?uri=";
+    
+  sourceURL += document.sourceDocument.elements[0].value;
+
+  if (document.escapeSource.elements[0].checked)
+    url += escape(sourceURL);
+  else
+    url += sourceURL;
+
+  url += "&keys=";
+  for (i = 0; i < keyList.length; i++) {
+    url += keyList[i];
+    if (i < keyList.length - 1) url += ",";
+  }
+
+  var paramList = document.parameters.elements[0].value.split(" ");
+  for (i = 0; i < paramList.length; i++)
+    if (paramList[i].length > 0) {
+      if (document.escapeParameters.elements[0].checked) {
+        var p = paramList[i].split("=");
+        url += "&param." + p[0] + "=" + escape(p[1]);
+      } else
+        url += "&param." + paramList[i];
+    }
+  
+  top.result.location = url;
+}
diff --git a/helm/uwobo-panel/index.html b/helm/uwobo-panel/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/uwobo-panel/welcome.html b/helm/uwobo-panel/welcome.html
new file mode 100644 (file)
index 0000000..f6fbed4
--- /dev/null
@@ -0,0 +1,6 @@
+<html>
+
+<body bgcolor="white">
+</body>
+
+</html>