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 getInitialProcessorURL()
18 return getParam("processorURL", "http://phd.cs.unibo.it:8080/helm/servlet/uwobo/");
21 function getInitialGetterURL()
23 return getParam("getterURL", "http://phd.cs.unibo.it:8081/");
26 function getUwoboURL()
28 return document.uwoboURL.elements[0].value;
31 function getGetterURL()
33 return document.getterURL.elements[0].value;
36 function selectUwoboURL(ss)
38 if (ss.selectedIndex == 0) {
39 document.uwoboURL.elements[0].value = "";
41 document.uwoboURL.elements[0].value = "http://" + ss.options[ss.selectedIndex].value + ":8080/helm/servlet/uwobo/";
45 function selectGetterURL(ss)
47 if (ss.selectedIndex == 0) {
48 document.getterURL.elements[0].value = "";
50 document.getterURL.elements[0].value = "http://" + ss.options[ss.selectedIndex].value + ":8081/";
54 function getPredefinedStylesheetKey(i)
56 var v = document.predefinedStylesheets.elements[0].options[i].value;
57 var va = v.split(",");
61 function getPredefinedStylesheetURI(i)
63 var v = document.predefinedStylesheets.elements[0].options[i].value;
64 var va = v.split(",");
68 function getPredefinedStylesheetUseGetter(i)
70 var v = document.predefinedStylesheets.elements[0].options[i].value;
71 var va = v.split(",");
75 function selectPredefinedStylesheet(ss)
77 if (ss.selectedIndex == 0) {
78 document.stylesheetURI.elements[0].value = "";
79 document.stylesheetKey.elements[0].value = "";
81 document.stylesheetURI.elements[0].value = getPredefinedStylesheetURI(ss.selectedIndex);
82 document.stylesheetKey.elements[0].value = getPredefinedStylesheetKey(ss.selectedIndex);
85 document.loadUseGetter.elements[0].checked = getPredefinedStylesheetUseGetter(ss.selectedIndex) == "true" ? true : false;
86 document.loadEscape.elements[0].checked = true;
89 function getStylesheetURL()
93 if (document.loadUseGetter.elements[0].checked) {
94 s = getGetterURL() + "getxslt?uri=" + document.stylesheetURI.elements[0].value;
96 s = document.stylesheetURI.elements[0].value;
99 if (document.loadEscape.elements[0].checked) s = escape(s);
104 function loadStylesheet()
106 top.result.location.replace(getUwoboURL() + "add?bind=" + document.stylesheetKey.elements[0].value + "," + getStylesheetURL());
109 function removeStylesheet()
111 top.result.location.replace(getUwoboURL() + "remove?keys=" + document.stylesheetKey.elements[0].value);
114 function removeAllStylesheets()
116 top.result.location.replace(getUwoboURL() + "remove");
119 function reloadStylesheet()
121 top.result.location.replace(getUwoboURL() + "reload?keys=" + document.stylesheetKey.elements[0].value);
124 function loadAllPredefined()
126 with (document.predefinedStylesheets.elements[0]) {
128 var request = "dummy=0";
130 for (i = 1; i < length; i++)
132 "&bind=" + getPredefinedStylesheetKey(i) + "," + escape((getPredefinedStylesheetUseGetter(i) == "true" ? (getGetterURL() + "getxslt?uri=") : "") + getPredefinedStylesheetURI(i));
133 top.result.location.replace(getUwoboURL() + "add?" + request);
137 function removeAllPredefined()
139 with (document.predefinedStylesheets.elements[0]) {
143 for (i = 1; i < length; i++)
144 request += getPredefinedStylesheetKey(i) + ",";
145 top.result.location.replace(getUwoboURL() + "remove?keys=" + request);
149 function applyStylesheets()
152 var keyList = document.keyList.elements[0].value.split(" ");
154 var url = getUwoboURL() + "apply?xmluri=";
158 if (document.applyUseGetter.elements[0].checked)
159 sourceURL += getGetterURL() + "getxml?uri=";
161 sourceURL += document.sourceDocument.elements[0].value;
163 if (document.escapeSource.elements[0].checked)
164 url += escape(sourceURL);
169 for (i = 0; i < keyList.length; i++) {
171 if (i < keyList.length - 1) url += ",";
174 var paramList = document.parameters.elements[0].value.split(" ");
175 for (i = 0; i < paramList.length; i++)
176 if (paramList[i].length > 0) {
177 if (document.escapeParameters.elements[0].checked) {
178 var p = paramList[i].split("=");
179 url += "¶m." + p[0] + "=" + escape(p[1]);
181 url += "¶m." + paramList[i];
184 top.result.location.replace(url);