397 lines
10 KiB
HTML
397 lines
10 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 4.0//EN">
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<title>Define your own outbound application</title>
|
|
<meta name="Copyright" content="Copyright (c) 2004 by IBM Corporation">
|
|
<!-- All rights reserved. Licensed Materials Property of IBM -->
|
|
<!-- US Government Users Restricted Rights -->
|
|
<!-- Use, duplication or disclosure restricted by -->
|
|
<!-- GSA ADP Schedule Contract with IBM Corp. -->
|
|
<!--
|
|
----------------------------------------------------------------------------
|
|
START_DESCRIPTION
|
|
Page Function: Define outbound app/port
|
|
|
|
Stored Values:
|
|
parent.hidden.customapps[clientNum][pos][0] = newappname //stores app name
|
|
parent.hidden.customapps[clientNum][pos][1] = port //stores port num
|
|
parent.hidden.customapps[clientNum][pos][2] = 'N'
|
|
|
|
Next and Back:
|
|
[Next]: rzalladvqos51.htm
|
|
[Back]: rzalladvqos11.htm
|
|
END_DESCRIPTION
|
|
----------------------------------------------------------------------------
|
|
-->
|
|
<LINK rel="stylesheet" type="text/css" href="../rzahg/ic.css">
|
|
<script language = "Javascript" src = "../rzahg/iccommon.js"></script>
|
|
<script language="Javascript" type="text/javascript">
|
|
|
|
var ports = new Array()
|
|
var pos
|
|
|
|
error2 = "You cannot add an application on a port that you have already defined."
|
|
error3 = "You must define at least one application"
|
|
error4 = "To add an application, you must define both an application name and port number."
|
|
error5 = "You cannot define multiple applications with the same name."
|
|
error6 = "A port must be a numeric value between 1 and 65535."
|
|
|
|
//START NON-TRANSLATABLE
|
|
clientNum = parent.hidden.retClientNumber()
|
|
customStart = parent.hidden.clientInfo[clientNum][3];
|
|
|
|
|
|
|
|
|
|
var app_name
|
|
|
|
|
|
function onNext(nextURL,direction) {
|
|
clearApps();
|
|
var pos = 0
|
|
|
|
selectlength = document.otherapps.newapplist.length
|
|
|
|
if ( selectlength != 0 && !isNaN(customStart) ) {
|
|
|
|
//find end of applist
|
|
//need to intercept if custom apps have been defined
|
|
|
|
app_length = parent.hidden.retCustomAppLength(clientNum)
|
|
|
|
for ( var i=0; i<selectlength; i++ ) {
|
|
appname = document.otherapps.newapplist.options[i].text
|
|
start = appname.indexOf("(")
|
|
newappname = appname.substring(0,start)
|
|
end = appname.length
|
|
port = appname.substring(start+1,end-1)
|
|
|
|
//storing values now
|
|
|
|
parent.hidden.customapps[clientNum][pos][0] = newappname //stores app name
|
|
parent.hidden.customapps[clientNum][pos][1] = port //stores port num
|
|
parent.hidden.customapps[clientNum][pos][2] = 'N'
|
|
pos ++;
|
|
|
|
}
|
|
|
|
window.location = nextURL;
|
|
combineIt();
|
|
|
|
//alert("Custom end is " + parent.hidden.clientInfo[clientNum][13])
|
|
}
|
|
|
|
else if ( selectlength == 0 && direction =='back' ) {
|
|
window.location = nextURL;
|
|
}
|
|
|
|
else {
|
|
alert(error3)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function addapp() {
|
|
appname = document.otherapps.addappname.value
|
|
portnum = document.otherapps.addappport.value
|
|
myInteger = document.otherapps.addappport.value;
|
|
var isOK = true;
|
|
|
|
listlength = document.otherapps.newapplist.length
|
|
|
|
|
|
|
|
isOK = checkcomplete()
|
|
|
|
//positive = isPosInteger(myInteger) //added by ljs in response to review comment on 1/30
|
|
positive = parent.hidden.isPosInteger(myInteger);
|
|
if ( !positive ) {
|
|
alert(error6)
|
|
document.otherapps.addappport.focus()
|
|
return false;
|
|
}
|
|
|
|
if (isOK){ //checking for duplicate user defined ports
|
|
|
|
isOK = checkuserdefinedports(portnum,appname)
|
|
|
|
}
|
|
|
|
|
|
if ( isOK ) {
|
|
|
|
isOK = checkuserdefinedapps(portnum,appname)
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( isOK ) {
|
|
|
|
document.otherapps.newapplist.options[listlength] = new Option(appname + "(" + portnum + ")",portnum)
|
|
document.otherapps.addappname.value = ""
|
|
document.otherapps.addappport.value = ""
|
|
document.otherapps.addappname.focus();
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function checkcomplete() {
|
|
if ( document.otherapps.addappport.value == '' || document.otherapps.addappname.value == '' ) {
|
|
alert(error4)
|
|
|
|
return false;
|
|
|
|
}
|
|
else {return true;}
|
|
}
|
|
|
|
|
|
|
|
function checkuserdefinedports(portnum,appname) {
|
|
//myInteger = document.otherapps.addappport.value;
|
|
listlength = document.otherapps.newapplist.length
|
|
for ( var i=0; i<listlength; i++ ) {
|
|
if ( document.otherapps.newapplist.options[i].value == portnum ) {
|
|
alert(error2);
|
|
document.otherapps.addappport.focus()
|
|
return false;
|
|
break;
|
|
|
|
}
|
|
/*positive = isPosInteger(myInteger) //added by ljs in response to review comment on 1/30
|
|
if ( !positive ) {
|
|
alert(error6)
|
|
document.otherapps.addappport.focus()
|
|
return false;
|
|
}
|
|
|
|
*/
|
|
|
|
|
|
}
|
|
return true;
|
|
}
|
|
|
|
|
|
function isPosInteger(myInteger) { //checking for positive integer //added by ljs in response to review comment on 1/30
|
|
|
|
myInteger = myInteger.toString();
|
|
|
|
for ( var i=0; i<myInteger.length; i++ ) {
|
|
var onechar = myInteger.charAt(i)
|
|
if ( onechar < "0" || onechar > "9" ) {
|
|
return false;
|
|
}
|
|
|
|
|
|
}
|
|
return true;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function checkuserdefinedapps(portnum,appname){
|
|
listlength = document.otherapps.newapplist.length
|
|
|
|
for ( var i=0; i<listlength; i++ ) {
|
|
testApp = document.otherapps.newapplist.options[i].text
|
|
|
|
end = testApp.indexOf('(')
|
|
newAppName = testApp.substring(0,end)
|
|
|
|
|
|
if ( appname == newAppName ) {
|
|
|
|
alert(error5);
|
|
document.otherapps.addappname.focus()
|
|
return false;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
return true;
|
|
|
|
}
|
|
|
|
function removeapp() {
|
|
|
|
selected = document.otherapps.newapplist.options[document.otherapps.newapplist.selectedIndex].value
|
|
remove_pos = 0
|
|
for ( var i=0; i<document.otherapps.newapplist.length; i++ ) {
|
|
if ( document.otherapps.newapplist.options[i].value == selected ) {
|
|
remove_pos = i
|
|
}
|
|
}
|
|
|
|
document.otherapps.newapplist.options[remove_pos] = null;
|
|
|
|
}
|
|
|
|
function removeit() {
|
|
document.otherapps.newapplist.options[0] = null;
|
|
document.otherapps.addappname.focus();
|
|
|
|
}
|
|
|
|
//Obtain name of HTML file in parent frame.
|
|
var parentDir = parent.window.location.href.substring(0,location.href.lastIndexOf('/')+1);
|
|
var parentUrl = parent.window.location.href.substring(parentDir.length,parent.window.location.href.length+1);
|
|
if (parentUrl.indexOf("#") >= 0) { parentUrl = parentUrl.substring(0,parentUrl.indexOf("#"));}
|
|
|
|
function fillin() {
|
|
//Is the hidden frame already loaded with the correct html?
|
|
if (parentUrl != "rzalladvqoswelcome.htm") {
|
|
window.location = "rzalladvqoswelcome.htm"; //load advisor frameset
|
|
return;
|
|
} else {
|
|
//Obtain name of HTML file in hidden frame.
|
|
var hiddenDir = parent.hidden.window.location.href.substring(0,location.href.lastIndexOf('/')+1);
|
|
var hiddenUrl = parent.hidden.window.location.href.substring(hiddenDir.length,parent.hidden.window.location.href.length+1);
|
|
if (hiddenUrl.indexOf("#") >= 0) { hiddenUrl = hiddenUrl.substring(0,hiddenUrl.indexOf("#"));}
|
|
if (hiddenUrl != "rzalladvqoshidden.htm") {
|
|
//Correct HTML not loaded, load it
|
|
parent.hidden.window.location = "rzalladvqoshidden.htm";
|
|
} else { //already loaded
|
|
fillin2();
|
|
}
|
|
}
|
|
}
|
|
|
|
function fillin2() {
|
|
|
|
if ( parent.hidden.customapps[clientNum][0][0] == '' ) {
|
|
removeit()
|
|
}
|
|
|
|
else { // adding previously defined application
|
|
removeit();
|
|
app_length = parent.hidden.retCustomAppLength(clientNum)
|
|
mypos = 0;
|
|
for ( var i=0; i<app_length; i++ ) {
|
|
appname = parent.hidden.customapps[clientNum][i][0]
|
|
|
|
if ( appname == null || appname == "" ) {
|
|
break;
|
|
}
|
|
else {
|
|
portnum = parent.hidden.customapps[clientNum][i][1]
|
|
document.otherapps.newapplist.options[mypos] = new Option(appname + "(" + portnum + ")",portnum)
|
|
mypos++;
|
|
}
|
|
}
|
|
}
|
|
|
|
clearCustomApps();
|
|
}
|
|
|
|
|
|
function clearCustomApps() {
|
|
|
|
app_length = parent.hidden.retCustomAppLength(clientNum)
|
|
|
|
for ( var i=0; i<app_length; i++ ) {
|
|
if ( parent.hidden.customapps[clientNum][i][0] != '') {
|
|
parent.hidden.customapps[clientNum][i][0] = '' //stores app name
|
|
parent.hidden.customapps[clientNum][i][1] = ''
|
|
parent.hidden.customapps[clientNum][i][2] = ''
|
|
}
|
|
else {
|
|
break;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function clearApps() {
|
|
|
|
app_length = parent.hidden.retAppLength(clientNum)
|
|
for ( var i=customStart; i<app_length; i++ ) {
|
|
parent.hidden.clientapps[clientNum][i][0] = ''
|
|
parent.hidden.clientapps[clientNum][i][1] = ''
|
|
parent.hidden.clientapps[clientNum][i][2] = ''
|
|
}
|
|
}
|
|
|
|
|
|
function combineIt() { //this function combines the two arrays if there are custom apps
|
|
|
|
|
|
if ( customStart != null) {
|
|
|
|
app_length = parent.hidden.retCustomAppLength(clientNum)
|
|
myPos = customStart
|
|
|
|
for ( var i=0; i<app_length; i++ ) {
|
|
appname = parent.hidden.customapps[clientNum][i][0]
|
|
port = parent.hidden.customapps[clientNum][i][1]
|
|
rsvpAnswer = parent.hidden.customapps[clientNum][i][2]
|
|
|
|
if ( appname == '' || appname == null ) {
|
|
|
|
break;
|
|
}
|
|
|
|
else {
|
|
parent.hidden.clientapps[clientNum][myPos][0] = appname //stores app name
|
|
parent.hidden.clientapps[clientNum][myPos][1] = port //stores port num
|
|
parent.hidden.clientapps[clientNum][myPos][2] = rsvpAnswer // stores R or N
|
|
myPos ++;
|
|
}
|
|
|
|
}
|
|
|
|
parent.hidden.clientInfo[clientNum][13] = myPos; //setting the start point for outbound intserv apps
|
|
|
|
}
|
|
}
|
|
|
|
//END NON-TRANSLATABLE
|
|
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<BODY onload="fillin()">
|
|
<h2>QoS planning advisor: Additional applications</h2>
|
|
<P>Define any other applications that were not listed previously. <P> What other applications do you want to define?</P>
|
|
|
|
<form name="otherapps">
|
|
<label for="application">Application:</label>
|
|
<INPUT TYPE="text" SIZE=25 MAXLENGTH=25 NAME="addappname" id="application">
|
|
<label for="port">Port:</label>
|
|
<INPUT TYPE="text" SIZE=5 MAXLENGTH=5 NAME="addappport" id="port">
|
|
|
|
<INPUT TYPE="button" NAME="Add" VALUE=" Add " onClick="addapp()">
|
|
<p></p>
|
|
<table>
|
|
<tr><td>
|
|
<label for="myapps2">My Applications:</label><br>
|
|
<SELECT NAME="newapplist" SIZE=10 onClick = "displayit()" id="myapps2">
|
|
<OPTION VALUE="first">xxxxxxxxxxxxxxxxxxxxxxxx
|
|
</SELECT>
|
|
</td><td><center>
|
|
<br><INPUT TYPE="button" NAME="Remove" VALUE="Remove" onClick="removeapp()"></center>
|
|
</td></tr>
|
|
</table>
|
|
<p></p>
|
|
<center>
|
|
<input name=submit type="button" value="<< Back " onClick="onNext('rzalladvqos11.htm','back')">
|
|
<input name=submit type="button" value=" Next >>" onClick="onNext('rzalladvqos51.htm','forward')">
|
|
</CENTER>
|
|
</form>
|
|
|
|
</BODY>
|
|
|
|
</html>
|
|
|