2 function getParam(name, def)
4 var search = top.location.search;
5 search = search.slice(1);
6 var args = search.split("&");
8 for (var i = 0 ; i < args.length ; i++) {
9 var couple = args[i].split("=");
10 if (couple[0] == name) value = couple[1];
12 if (value == "-1") value = def;
16 function getInitialPort()
21 function getInitialProcessorURL()
23 return getParam("processorURL", "http://mowgli.cs.unibo.it:58080/");
26 function getInitialGetterURL()
28 return getParam("getterURL", "http://mowgli.cs.unibo.it:58081/");
31 function getUwoboURL()
33 return document.uwoboURL.elements[0].value;
36 function getGetterURL()
38 return document.getterURL.elements[0].value;
41 function selectUwoboURL(ss)
43 if (ss.selectedIndex == 0) {
44 document.uwoboURL.elements[0].value = "";
46 document.uwoboURL.elements[0].value = "http://" + ss.options[ss.selectedIndex].value + ":58080/";
50 function selectGetterURL(ss)
52 if (ss.selectedIndex == 0) {
53 document.getterURL.elements[0].value = "";
55 document.getterURL.elements[0].value = "http://" + ss.options[ss.selectedIndex].value + ":8081/";
59 function getPredefinedStylesheetKey(i)
61 var v = document.predefinedStylesheets.elements[0].options[i].value;
62 var va = v.split(",");
66 function getPredefinedStylesheetURI(i)
68 var v = document.predefinedStylesheets.elements[0].options[i].value;
69 var va = v.split(",");
73 function getPredefinedStylesheetUseGetter(i)
75 var v = document.predefinedStylesheets.elements[0].options[i].value;
76 var va = v.split(",");
80 function selectPredefinedStylesheet(ss)
82 if (ss.selectedIndex == 0) {
83 document.stylesheetURI.elements[0].value = "";
84 document.stylesheetKey.elements[0].value = "";
86 document.stylesheetURI.elements[0].value = getPredefinedStylesheetURI(ss.selectedIndex);
87 document.stylesheetKey.elements[0].value = getPredefinedStylesheetKey(ss.selectedIndex);
90 document.loadUseGetter.elements[0].checked = getPredefinedStylesheetUseGetter(ss.selectedIndex) == "true" ? true : false;
91 document.loadEscape.elements[0].checked = true;
94 function getStylesheetURL()
98 if (document.loadUseGetter.elements[0].checked) {
99 s = getGetterURL() + "getxslt?uri=" + document.stylesheetURI.elements[0].value;
101 s = document.stylesheetURI.elements[0].value;
104 if (document.loadEscape.elements[0].checked) s = escape(s);
109 function loadStylesheet()
111 top.result.location.replace(getUwoboURL() + "add?bind=" + document.stylesheetKey.elements[0].value + "," + getStylesheetURL());
114 function removeStylesheet()
116 top.result.location.replace(getUwoboURL() + "remove?keys=" + document.stylesheetKey.elements[0].value);
119 function removeAllStylesheets()
121 top.result.location.replace(getUwoboURL() + "remove?keys=");
124 function reloadStylesheet()
126 top.result.location.replace(getUwoboURL() + "reload?keys=" + document.stylesheetKey.elements[0].value);
129 function reloadAllStylesheets()
131 top.result.location.replace(getUwoboURL() + 'reload?keys=');
134 function loadAllPredefined()
136 with (document.predefinedStylesheets.elements[0]) {
140 for (i = 1; i < length; i++)
142 (request == "" ? "" : "&") +
143 "bind=" + getPredefinedStylesheetKey(i) + "," + escape((getPredefinedStylesheetUseGetter(i) == "true" ? (getGetterURL() + "getxslt?uri=") : "") + getPredefinedStylesheetURI(i));
144 top.result.location.replace(getUwoboURL() + "add?" + request);
148 function removeAllPredefined()
150 with (document.predefinedStylesheets.elements[0]) {
154 for (i = 1; i < length; i++)
155 request += getPredefinedStylesheetKey(i) + (i == length - 1 ? "" : ",");
156 top.result.location.replace(getUwoboURL() + "remove?keys=" + request);
160 function applyStylesheets()
163 var keyList = document.keyList.elements[0].value.split(" ");
165 var url = getUwoboURL() + "apply?xmluri=";
169 if (document.applyUseGetter.elements[0].checked)
170 sourceURL += getGetterURL() + "getxml?uri=";
172 sourceURL += document.sourceDocument.elements[0].value;
174 if (document.escapeSource.elements[0].checked)
175 url += escape(sourceURL);
180 for (i = 0; i < keyList.length; i++) {
182 if (i < keyList.length - 1) url += ",";
185 var paramList = document.parameters.elements[0].value.split(" ");
186 for (i = 0; i < paramList.length; i++)
187 if (paramList[i].length > 0) {
188 if (document.escapeParameters.elements[0].checked) {
189 var p = paramList[i].split("=");
190 url += "¶m." + p[0] + "=" + escape(p[1]);
192 url += "¶m." + paramList[i];
195 top.result.location.replace(url);