home *** CD-ROM | disk | FTP | other *** search
- <html>
- <head>
- <STYLE>
- body{
- font-size : medium;
- }
- td {
- font-size : medium;
- }
- </STYLE>
- </head>
-
- <body bgcolor="silver" text="maroon">
-
- <h1><div align="center">Configure SetProfileData Worknode</div></h1><!--<form method="POST" action="http://">-->
- <form method="post" name="configure" action="CALLBACKID-ConfigureWorknode">
- <P>
- Enter the instance name:
- <input name="instance_name" size=50 maxlength=80 > </P>
- <P>
- <TABLE cellSpacing=1 cellPadding=1 width="75%" border=0>
-
- <TR>
- <TD noWrap>Profile Hive</TD>
- <TD noWrap><SELECT id="profile_hive" name="profile_hive"
- > <OPTION value=System
- selected>System</OPTION><OPTION value=User>User</OPTION><OPTION
- value=Agent>Agent</OPTION><OPTION
- value=Subscriber>Subscriber</OPTION></SELECT></TD></TR>
- <TR>
- <TD noWrap>Profile Path</TD>
- <TD noWrap><INPUT style="WIDTH: 335px; HEIGHT: 22px" size=40
- name="profile_path"></TD></TR>
- <TR>
- <TD noWrap>Value</TD>
- <TD noWrap><INPUT style="WIDTH: 335px; HEIGHT: 22px" size=40
- name="value"></TD></TR>
- <TR>
- <TD noWrap>Data Type</TD>
- <TD noWrap><SELECT id="data_type" name="data_type">
- <OPTION value=str selected>String</OPTION><OPTION
- value=int>Integer</OPTION><OPTION
- value=dbl>Double</OPTION><OPTION
- value=bool>Boolean</OPTION></SELECT></TD></TR></TABLE></P>
- <P>
- <input type="button" name="Key_ADD" value="Add" style="WIDTH: 55px; HEIGHT: 24px" onClick="Add();">
- <input type="button" name="Key_Option" value="Clear" style="WIDTH: 55px; HEIGHT: 24px" onClick="HandleOption();">
- <br><br>
- List of Keys:....<br>
- <SELECT id="Key_Select" name="Key_Select" size=2 style="WIDTH: 350px; HEIGHT: 170px">
- </SELECT>
- <input type="hidden" name="KeyRepository" >
- <br>
- <input type="button" name="Key_REMOVE" value="Remove" onClick="Remove();">
- <input type="button" name="Key_EDIT" value="Edit" style="WIDTH: 63px; HEIGHT: 24px" onClick="Edit();">
- </P>
-
- <p>
-
- <P><input type="button" name="config" value="Configure" onClick="ConfigClick();">
-
- </form><hr>
-
- <form method="post" name="cancel_config" action="CALLBACKID-CancelConfigure">
- <P><input type="submit" name="cancel" value="Cancel">
- </form><hr>
-
- <BR>
-
- <A target=_blank href="ConfigHelp.html">Click here for help</A>
-
- </body>
- </html>
-
- <SCRIPT LANGUAGE="JavaScript">
- var nCurrentlyEditing = -1;
- var strCurrentlyEditing = "";
- var strInstanceName="";
- var strKeysRepository = "";
-
- /*VARS*/
-
- /*ENDVARS*/
- document.forms[0].instance_name.value = strInstanceName;
- document.forms[0].KeyRepository.value = strKeysRepository;
-
- PopulateSelectBox(document.forms[0].KeyRepository.value, document.forms[0].Key_Select);
-
-
- function Add()
- {
- var strProfileHive;
- var strProfilePath;
- var strValue;
- var strDataType;
- var bReleaseGUI;
- var KeyDisplayName;
- var index;
-
- index = document.forms[0].profile_hive.selectedIndex;
- strProfileHive = document.forms[0].profile_hive.options[index].value;
- strProfilePath = document.forms[0].profile_path.value;
- strValue = document.forms[0].value.value;
- index = document.forms[0].data_type.selectedIndex;
- strDataType = document.forms[0].data_type.options[index].value;
-
- KeyDisplayName = strProfileHive + "," + strProfilePath;
-
- if (IsStringEmpty(strProfilePath))
- {
- document.forms[0].profile_path.value = "";
- alert("Please enter a Profile Path.");
- }
- else if(strProfilePath.charAt(0) == '/')
- {
- alert("Please enter a Valid profile path (should not start with '/').");
- }
- else if (IsStringEmpty(strValue))
- {
- document.forms[0].value.value = "";
- alert("Please enter a Value.");
- }
- else if (IsValidKey(KeyDisplayName))
- {
-
- UpdateRepository(strProfileHive, strProfilePath, strValue, strDataType);
- document.forms[0].profile_path.value = "";
- document.forms[0].value.value = "";
- }
- }
-
- function Remove()
- {
- var nIndex = document.forms[0].Key_Select.selectedIndex;
- var strArray;
- var strTemp;
- var strKeyRepository;
- var nLength;
-
- if(nIndex > -1)
- {
- strKeyRepository = new String(document.forms[0].KeyRepository.value.toString());
- nLength = strKeyRepository.length - 2;
- strTemp = strKeyRepository.substring(0, nLength); //knock off trailing delimeters
- strArray = strTemp.split(";~");
-
- if (strArray.length == 1)
- {
- strKeyRepository = "";
- }
- else
- {
- strArray = RemoveArrayElement(strArray, nIndex);
- strKeyRepository = strArray.join(";~") + ";~";
- HandleOption();
- }
-
- document.forms[0].KeyRepository.value = strKeyRepository;
-
- document.forms[0].Key_Select.options[nIndex] = null;
- }
- }
-
- function UpdateRepository(strNewProfileHive, strNewProfilePath, strNewValue, strNewDataType)
- {
- var strRepository;
-
- if (nCurrentlyEditing > -1)
- {
- var strArray;
- var strTemp;
- var nLength;
- var strNewValPair;
- var strNewdisplayValue;
-
- strNewValPair = strNewProfileHive + "=" + strNewProfilePath + "=" + strNewValue + "=" + strNewDataType;
- strRepository = new String(document.forms[0].KeyRepository.value.toString());
- nLength = strRepository.length - 2;
- strTemp = strRepository.substring(0, nLength);
- strArray = strRepository.split(";~");
- strArray[nCurrentlyEditing] = strNewValPair;
- strRepository = strArray.join(";~");
-
-
- strNewdisplayValue = strNewProfileHive + "," + strNewProfilePath;
- document.forms[0].KeyRepository.value = strRepository;
- document.forms[0].Key_Select.options[nCurrentlyEditing].text = strNewdisplayValue;
-
- document.forms[0].Key_ADD.value = "Add";
- document.forms[0].Key_Option.value = "Clear";
- nCurrentlyEditing = -1;
- strCurrentlyEditing = "";
- }
- else
- {
- var opOption = new Option;
-
- strRepository = document.forms[0].KeyRepository.value + strNewProfileHive + "=" + strNewProfilePath + "=" + strNewValue + "=" + strNewDataType + ";~";
- document.forms[0].KeyRepository.value = strRepository;
-
-
- strNewdisplayValue = strNewProfileHive + "," + strNewProfilePath;
- opOption.text = strNewdisplayValue;
- document.forms[0].Key_Select.options[document.forms[0].Key_Select.options.length] = opOption;
- }
- }
-
- function Edit()
- {
- var nIndex = document.forms[0].Key_Select.selectedIndex;
- var strArray;
- var strTemp;
- var strRepository;
- var nLength;
- var strStringToEdit;
-
- if(nIndex > -1)
- {
- strRepository = new String(document.forms[0].KeyRepository.value.toString());
- nLength = strRepository.length - 2;
- strTemp = strRepository.substring(0, nLength);
- strArray = strRepository.split(";~");
-
- strStringToEdit = strArray[nIndex];
- strArray = strStringToEdit.split("=");
- nCurrentlyEditing = nIndex;
-
- document.forms[0].Key_ADD.value = "Update";
- document.forms[0].Key_Option.value = "Cancel";
- if(strArray[0] == "System")
- document.forms[0].profile_hive.selectedIndex = 0;
- else if (strArray[0] == "User")
- document.forms[0].profile_hive.selectedIndex = 1;
- else if (strArray[0] == "Agent")
- document.forms[0].profile_hive.selectedIndex = 2;
- else if (strArray[0] == "Subscriber")
- document.forms[0].profile_hive.selectedIndex = 3;
-
- document.forms[0].profile_path.value = strArray[1];
- document.forms[0].value.value = strArray[2];
- if(strArray[3] == "str")
- document.forms[0].data_type.selectedIndex = 0;
- else if (strArray[3] == "int")
- document.forms[0].data_type.selectedIndex = 1;
- else if (strArray[3] == "dbl")
- document.forms[0].data_type.selectedIndex = 2;
- else if (strArray[3] == "bool")
- document.forms[0].data_type.selectedIndex = 3;
- strCurrentlyEditing = strArray[0] + "," + strArray[1];
- }
- }
-
- function HandleOption()
- {
- if (nCurrentlyEditing > -1)
- {
- nCurrentlyEditing = -1;
- strCurrentlyEditing = "";
- document.forms[0].Key_Option.value = "Clear";
- document.forms[0].Key_ADD.value = "Add";
- }
- document.forms[0].profile_path.value = "";
- document.forms[0].value.value = "";
- }
-
- function RemoveArrayElement(strArray, nIndex)
- {
- var tempArray = new Array();
- var nCounter;
- var nArrCounter;
- var nLength;
-
- nArrCounter = 0;
- nLength = strArray.length;
- nCounter = 0;
- while (nCounter < nLength)
- {
- if ((strArray[nCounter].length != 0) && (nCounter != nIndex))
- {
- tempArray[nArrCounter] = strArray[nCounter];
- nArrCounter = nArrCounter + 1;
- }
- nCounter = nCounter + 1;
- }
-
- return tempArray;
- }
-
-
- function PopulateSelectBox(strValues, selectBox)
- {
- var strArray;
- var strTemp;
- var nLength;
- var strStringToAdd;
- var nCounter=0;
- var aTempArray;
- var tempOption;
-
- if (strValues == "")
- {
- return;
- }
- nLength = strValues.length - 2;
- strTemp = strValues.substring(0, nLength);
- strArray = strTemp.split(";~");
- nLength = strArray.length;
-
- while (nCounter < nLength)
- {
- tempOption = new Option();
- aTempArray = strArray[nCounter].split("=");
- tempOption.text = aTempArray[0] + "," + aTempArray[1];
- selectBox.options[selectBox.length] = tempOption;
- nCounter = nCounter + 1;
- }
- }
-
- function IsValidKey(strKeyDisplayName)
- {
- var nLength;
- var nCounter = 0;
- var tempdisplayname;
-
- nLength = document.forms[0].Key_Select.length;
- while (nCounter < nLength)
- {
- if ((strKeyDisplayName == document.forms[0].Key_Select.options[nCounter].text) && (strKeyDisplayName != strCurrentlyEditing))
- {
- window.alert("Duplicate Key already exists.");
- return false;
- }
- nCounter++;
- }
-
- return true;
- }
-
- function IsStringEmpty(strString)
- {
- var nCounter = 0;
- var nLength = strString.length;
-
- while (nCounter < nLength)
- {
- if (strString.charAt(nCounter) != ' ')
- {
- return false;
- }
-
- nCounter++;
- }
-
- return true;
- }
-
- </SCRIPT>
-
- <SCRIPT LANGUAGE="VBScript">
- Function ConfigClick()
- if (VerifyData()) then
- if (document.forms(0).onSubmit()) then
- document.forms(0).submit()
- end if
- end if
- end function
-
- Function VerifyData()
- dim strInstanceName
- dim bReturn
-
- bReturn = True
-
- strInstanceName = document.forms(0).instance_name.value
-
- if (strInstanceName="") then
- MsgBox("Please enter an Instance Name")
- bReturn = False
- end if
- VerifyData = bReturn
- end function
-
- </SCRIPT>