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://phd.cs.unibo.it:8080/helm/servlet/uwobo/");
26 function getInitialGetterURL()
28 return getParam("getterURL", "http://phd.cs.unibo.it:8081/");
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 + ":8080/helm/servlet/uwobo/";
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");
124 function reloadStylesheet()
126 top.result.location.replace(getUwoboURL() + "reload?keys=" + document.stylesheetKey.elements[0].value);
129 function loadAllPredefined()
131 with (document.predefinedStylesheets.elements[0]) {
135 for (i = 1; i < length; i++)
137 (request == "" ? "" : "&") +
138 "bind=" + getPredefinedStylesheetKey(i) + "," + escape((getPredefinedStylesheetUseGetter(i) == "true" ? (getGetterURL() + "getxslt?uri=") : "") + getPredefinedStylesheetURI(i));
139 top.result.location.replace(getUwoboURL() + "add?" + request);
143 function removeAllPredefined()
145 with (document.predefinedStylesheets.elements[0]) {
149 for (i = 1; i < length; i++)
150 request += getPredefinedStylesheetKey(i) + (i == length - 1 ? "" : ",");
151 top.result.location.replace(getUwoboURL() + "remove?keys=" + request);
155 function applyStylesheets()
158 var keyList = document.keyList.elements[0].value.split(" ");
160 var url = getUwoboURL() + "apply?xmluri=";
164 if (document.applyUseGetter.elements[0].checked)
165 sourceURL += getGetterURL() + "getxml?uri=";
167 sourceURL += document.sourceDocument.elements[0].value;
169 if (document.escapeSource.elements[0].checked)
170 url += escape(sourceURL);
175 for (i = 0; i < keyList.length; i++) {
177 if (i < keyList.length - 1) url += ",";
180 var paramList = document.parameters.elements[0].value.split(" ");
181 for (i = 0; i < paramList.length; i++)
182 if (paramList[i].length > 0) {
183 if (document.escapeParameters.elements[0].checked) {
184 var p = paramList[i].split("=");
185 url += "¶m." + p[0] + "=" + escape(p[1]);
187 url += "¶m." + paramList[i];
190 top.result.location.replace(url);