step3.htm revision bd74afd3d3a48aed63cf319b1f7506429e0346c3
<script type="text/javascript">
var multiServer = "false";
var validServerURL = "true";
function configStoreServerValidated( response ) {
storeServerValidated( '$type', response );
}
function configStoreBaseDNValidated( response ) {
storeBaseDNValidated('$type', response );
}
function configStoreSessionDNValidated( response ) {
storeSessionDNValidated('$type', response );
}
function configStoreLoginIdValidated( response ) {
storeLoginIdValidated( '$type', response );
}
function validateUserFields(response) {
if (response.responseText == "ok") {
eval(field + "Valid = true;" );
$(field + 'Status').innerHTML = okString;
allValid();
} else {
eval(field + "Valid = false;" );
$(field + 'Status').innerHTML = errorImage +
}
field = "";
}
function validatePort() {
field = "configStorePort";
var callUrl = "$context$path?actionLink=validateLocalPort";
var param = "&port=" + $('configStorePort').value;
ie7fix++;
callUrl = callUrl + "&ie7fix=" + ie7fix;
setTimeout("enableNextButton()", 500);
AjaxUtils.call(callUrl+param, validateUserFields);
}
function validateAdminPort() {
field = "configStoreAdminPort";
var callUrl = "$context$path?actionLink=validateLocalAdminPort";
var param = "&port=" + $('configStoreAdminPort').value;
ie7fix++;
callUrl = callUrl + "&ie7fix=" + ie7fix;
setTimeout("enableNextButton()", 500);
AjaxUtils.call(callUrl+param, validateUserFields);
}
function validateJmxPort() {
field = "configStoreJmxPort";
var callUrl = "$context$path?actionLink=validateLocalJmxPort";
var param = "&port=" + $('configStoreJmxPort').value;
ie7fix++;
callUrl = callUrl + "&ie7fix=" + ie7fix;
setTimeout("enableNextButton()", 500);
AjaxUtils.call(callUrl+param, validateUserFields);
}
function validateEncKey() {
$('nextTabButton').disabled = true;
var value = escape($('encryptionKey').value);
var callUrl =
"$context$path?actionLink=validateEncKey&encKey=" + value;
setTimeout("enableNextButton()", 500);
AjaxUtils.call(callUrl, validateEncKeyResponse);
}
function validateEncKeyResponse(response) {
if (response.responseText == "true") {
$('encryptionKeyStatus').innerHTML = okString;
} else {
$('encryptionKeyStatus').innerHTML = warningImage +
}
}
function validateConfigStoreSSL() {
var value = ($('configStoreSSL').checked) ? "SSL" : "SIMPLE";
var callUrl =
"$context$path?actionLink=validateInput&key=configStoreSSL&value=" +
value;
ie7fix++;
callUrl = callUrl + "&ie7fix=" + ie7fix;
AjaxUtils.call(callUrl, validateConfigSSL);
}
function validateConfigSSL(response) {
// no ops
}
function validateConfigStoreHost() {
var call = "$context$path?actionLink=validateConfigStoreHost";
var hostname = "&configStoreHost=" + $('configStoreHost').value;
$('nextTabButton').disabled = true;
field = "configStoreHost";
ie7fix++;
call = call + "&ie7fix=" + ie7fix;
AjaxUtils.call(call+hostname, validateSMHost);
}
function validateConfigStoreLoginId() {
$('nextTabButton').disabled = true;
field = "configStoreLoginId";
setTimeout("enableNextButton()", 500);
validate();
}
function validateConfigStorePassword() {
$('nextTabButton').disabled = true;
field = "configStorePassword";
setTimeout("enableNextButton()", 500);
validatePost();
}
function validateRootSuffix() {
$('nextTabButton').disabled = true;
ie7fix++;
field = "rootSuffix";
var callUrl = "$context$path?actionLink=validateRootSuffix&ie7fix=" +
ie7fix + "&rootSuffix=" + escape($(field).value);
setTimeout("enableNextButton()", 500);
AjaxUtils.call(callUrl, fieldValidated);
}
function setSessionStoreType() {
$('nextTabButton').disabled = true;
field = "sessionStoreType";
var call = "$context$path?actionLink=setSessionStoreType";
var sessionStoreTypeVal = "&sessionStoreType=" + escape($(field).value);
ie7fix++;
call = call + "&ie7fix=" + ie7fix;
setTimeout("enableNextButton()", 500);
AjaxUtils.call(call+sessionStoreTypeVal, fieldValidated);
}
function validateSessionRootSuffix() {
$('nextTabButton').disabled = true;
ie7fix++;
field = "sessionRootSuffix";
var callUrl = "$context$path?actionLink=validateSessionRootSuffix&ie7fix=" +
ie7fix + "&sessionRootSuffix=" + escape($(field).value);
setTimeout("enableNextButton()", 500);
AjaxUtils.call(callUrl, fieldValidated);
}
function validateServerURL(response) {
var resp = eval('('+response.responseText+')');
var image = okImage;
if (resp.code == "100") {
// url was a valid OpenAM server
validServerURL = true;
document.getElementById("existingPort").disabled = true;
document.getElementById("existingPort").value = resp.existingPort;
if (resp.embedded == "true") {
document.getElementById("replicationPorts").style.display = "";
var message = "";
if (resp.replication == "true") {
document.getElementById("existingRepPort").disabled = true;
message = '<small>$page.getQuoteEscapedLocalizedString("existing.port.values.replication")</small>';
} else {
document.getElementById("existingRepPort").disabled = false;
message='<small>$page.getQuoteEscapedLocalizedString("existing.port.values.noreplication")</small>';
}
document.getElementById("replicationMessage").innerHTML= message;
document.getElementById("existingRepPort").value = resp.replicationPort;
} else {
document.getElementById("existingLDAP").style.display = "";
document.getElementById("existingStoreHost").disabled = true;
document.getElementById("existingStoreHost").value = resp.existingStoreHost;
document.getElementById("existingStorePort").disabled = true;
document.getElementById("existingStorePort").value = resp.existingStorePort;
}
$('nextTabButton').disabled = false;
} else{
// error handling
validServerURL = false;
image = errorImage;
document.getElementById("replicationPorts").style.display = "none";
document.getElementById("existingLDAP").style.display = "none";
$('nextTabButton').disabled = true;
}
$('existingHostStatus').innerHTML = image +
}
function validateHostName() {
$('existingHostStatus').innerHTML = '$page.getQuoteEscapedLocalizedString("validating.url.string")';
var call = "$context$path?actionLink=validateHostName";
var hostname = "&hostName=" + $('existingHost').value;
$('nextTabButton').disabled = true;
ie7fix++;
call = call + "&ie7fix=" + ie7fix;
AjaxUtils.call(call+hostname, validateServerURL);
}
function localPortResponse(response) {
var message = response.responseText;
if (message == "ok") {
eval(field + "Valid = true;" );
$(field + 'Status').innerHTML = okString;
} else {
eval(field + "Valid = false;" );
$(field + 'Status').innerHTML = errorImage +
'<small>' + message + '</small>';
$('nextTabButton').disabled = true;
}
field = "";
}
function validateLocalConfigPort() {
field = "localConfigPort";
var call = "$context$path?actionLink=validateLocalPort";
var portVal = "&port=" + $('localConfigPort').value;
ie7fix++;
call = call + "&ie7fix=" + ie7fix;
AjaxUtils.call(call+portVal, localPortResponse);
}
function validateLocalConfigAdminPort() {
field = "localConfigAdminPort";
var call = "$context$path?actionLink=validateLocalAdminPort";
var portVal = "&port=" + $('localConfigAdminPort').value;
ie7fix++;
call = call + "&ie7fix=" + ie7fix;
AjaxUtils.call(call+portVal, localPortResponse);
}
function validateLocalConfigJmxPort() {
field = "localConfigJmxPort";
var call = "$context$path?actionLink=validateLocalJmxPort";
var portVal = "&port=" + $('localConfigJmxPort').value;
ie7fix++;
call = call + "&ie7fix=" + ie7fix;
AjaxUtils.call(call+portVal, localPortResponse);
}
function validateLocalRepPort() {
field = "localRepPort";
validate();
}
function validateExistingPort() {
field = "existingPort";
validate();
}
function validateExistingRepPort() {
field = "existingRepPort";
validate();
}
function enableExisting() {
multiServer = "true";
$('nextTabButton').disabled = true;
// controls for displaying step6
firstFAMInstance = false;
$('tab4').style.color = "#D3D3D3";
$('tab6').style.color = "#D3D3D3";
nextTab = 5;
document.getElementById("newInstanceOptions").style.display = "none";
document.getElementById("existingInstanceURL").style.display = "";
document.getElementById("replicationPorts").style.display = "none";
document.getElementById("existingLDAP").style.display = "none";
ie7fix++;
AjaxUtils.call("$context$path?actionLink=setReplication&multi=enable&ie7fix=" + ie7fix);
}
function disableExisting() {
enableNextButton();
multiServer = "false";
// controls for displaying step6
firstFAMInstance = true;
$('tab6').style.color = "";
$('tab4').style.color = "";
nextTab = 4;
document.getElementById("newInstanceOptions").style.display = "";
document.getElementById("existingInstanceURL").style.display = "none";
document.getElementById("replicationPorts").style.display = "none";
document.getElementById("existingLDAP").style.display = "none";
ie7fix++;
AjaxUtils.call("$context$path?actionLink=setReplication&multi=disable&ie7fix=" + ie7fix);
}
function setExternalFieldsDisplay(display) {
document.getElementById("login").style.display = display;
document.getElementById("password").style.display = display;
if (display == "none") {
document.getElementById("configStoreSSL").disabled = true;
document.getElementById("configStoreHost").disabled = true;
document.getElementById("configStoreHost").value = "localhost";
document.getElementById("adminport").style.display = "";
document.getElementById("jmxport").style.display = "";
} else {
document.getElementById("configStoreSSL").disabled = false;
document.getElementById("configStoreHost").disabled = false;
remoteDSHost = document.getElementById("configStoreHost").value;
document.getElementById("configStoreHost").value = remoteDSHost;
document.getElementById("adminport").style.display = "none";
document.getElementById("jmxport").style.display = "none";
}
}
function enableRemote() {
userStore = "external";
enableNextButton();
ie7fix++;
AjaxUtils.call("$context$path?actionLink=setConfigType&type=remote&ie7fix=" + ie7fix);
setExternalFieldsDisplay("");
}
function disableRemote() {
setExternalFieldsDisplay("none");
userStore = "embedded";
enableNextButton();
ie7fix++;
AjaxUtils.call("$context$path?actionLink=setConfigType&type=embedded&ie7fix=" + ie7fix);
}
function initConfig() {
if ("$DATA_STORE" == 'embedded') {
disableRemote();
} else {
enableRemote();
}
if ("$FIRST_INSTANCE" == "1") {
enableExisting();
}
}
function enableNextButton() {
if (userStore == "embedded") {
$('nextTabButton').disabled =
!isFieldOK('configStoreHost') ||
!isFieldOK('configStorePort') ||
!isFieldOK('configStoreAdminPort') ||
!isFieldOK('configStoreJmxPort') ||
!isEncryptionKeyOk() ||
!isFieldOK('rootSuffix') ||
!isFieldOK('sessionRootSuffix') ||
!isFieldOK('sessionStoreType');
} else {
var allFieldsValid = isFieldOK('configStoreHost') &&
isFieldOK('configStorePort') && isEncryptionKeyOk() &&
isFieldOK('rootSuffix') && isFieldOK('sessionRootSuffix') && isFieldOK('sessionStoreType') &&
isFieldOK('configStoreLoginId') &&
isFieldOK('configStorePassword') &&
(document.getElementById('configStorePassword').value != '');
if (allFieldsValid) {
ie7fix++;
AjaxUtils.call("$context$path?actionLink=validateSMHost&ie7fix=" + ie7fix,
validateSMHost);
} else {
$('nextTabButton').disabled = true;
}
}
}
function isEncryptionKeyOk() {
var value = escape($('encryptionKey').value);
return (value.length > 0);
}
function validateSMHost(response) {
if (response.responseText == "ok") {
$('nextTabButton').disabled = false;
$('configStoreHostStatusEx').innerHTML = "";
} else {
$('nextTabButton').disabled = true;
$('configStoreHostStatus').innerHTML = "";
$('configStoreHostStatusEx').innerHTML = errorImage +
}
}
function isFieldOK(field) {
var x = $(field + 'Status').innerHTML;
}
YAHOO.util.Event.onDOMReady(initConfig);
</script>
<div style="margin-left:10px;">
src="$context/assets/images/message.gif"/></h1>
<input type="radio" id="existingNo" name="existingInstance"
value="false" $selectFirstSetup onclick="disableExisting();"/>
<input type="radio" $selectExistingSetup id="existingYes" name="existingInstance"
value="true" onclick="enableExisting();"/>
<!-- EMBEDDED STORE PROPERTIES -->
<div id="configStoreProperties" style="width:620px;" >
<p id="allfields"><em>*</em>
<b class="xtop">
<b class="xt1"></b>
<b class="xt2"></b>
<b class="xt3"></b>
<b class="xt4"></b>
</b>
<div class="headerBox">
</div>
<div class="bodyBox" style="height:340px;">
<span>
<!-- New Instances -->
<div id="newInstanceOptions">
<table class="temp">
<tr>
<td><label for="configStoreCustom">
</label></td>
<td>
<input type="radio" id="configStoreDefault" name="configStoreCustom"
style="margin-left:1em" value="false" $selectEmbedded
onclick="disableRemote();"/>
<input type="radio" id="configStoreCustom" name="configStoreCustom"
style="margin-left:1em" value="true" $selectExternal
onclick="enableRemote();"/>
</td>
</tr>
</table>
<!-- Embedded Store -->
<table class="temp">
<tr id="ssl">
<td><label for="configStoreSSL"><em>* </em>
<td>
<input id="configStoreSSL" name="configStoreSSL"
type="checkbox" value="SSL" $selectConfigStoreSSL
onClick="APP.callDelayed(this, validateConfigStoreSSL)"/></td>
</tr>
<tr id="host">
<td><label for="configStoreHost"><em>* </em>
<td>
<input id="configStoreHost" name="configStoreHost"
type="text" class="text" style="width:150px"
value="$configStoreHost"
onkeyup="APP.callDelayed(this, validateConfigStoreHost)"
onchange="APP.callDelayed(this, validateConfigStoreHost)"/>
<span id="configStoreHostStatus"></span>
<span id="configStoreHostStatusEx"></span>
</td>
</tr>
<tr>
<td><label for="configStorePort"><em>* </em>
<td>
<input id="configStorePort" name="configStorePort"
type="text" size="5" maxLength="5"
value="$configStorePort"
onkeyup="APP.callDelayed(this, validatePort)"
onchange="APP.callDelayed(this, validatePort)"/>
<span id="configStorePortStatus"></span></td>
</tr>
<tr id="adminport">
<td><label for="configStoreAdminPort"><em>* </em>
<td>
<input id="configStoreAdminPort" name="configStoreAdminPort"
type="text" size="5" maxLength="5"
value="$configStoreAdminPort"
onkeyup="APP.callDelayed(this, validateAdminPort)"
onchange="APP.callDelayed(this, validateAdminPort)"/>
<span id="configStoreAdminPortStatus"></span></td>
</tr>
<tr id="jmxport">
<td><label for="configStoreJmxPort"><em>* </em>
<td>
<input id="configStoreJmxPort" name="configStoreJmxPort"
type="text" size="5" maxLength="5"
value="$configStoreJmxPort"
onkeyup="APP.callDelayed(this, validateJmxPort)"
onchange="APP.callDelayed(this, validateJmxPort)"/>
<span id="configStoreJmxPortStatus"></span></td>
</tr>
<tr>
<td><label for="encryptionKey"><em>* </em>
<td>
<input id="encryptionKey" name="encryptionKey"
type="text" class="text" style="width:200px"
value="$encryptionKey"
onkeyup="APP.callDelayed(this, validateEncKey)"
onchange="APP.callDelayed(this, validateEncKey)"/>
<span id="encryptionKeyStatus"></span></td>
</tr>
<tr>
<td><label for="rootSuffix"><em>* </em>
<td>
<input id="rootSuffix" name="rootSuffix"
type="text" class="text" style="width:200px"
value="$rootSuffix"
onkeyup="APP.callDelayed(this, validateRootSuffix)"
onchange="APP.callDelayed(this, validateRootSuffix)"/>
<span id="rootSuffixStatus"></span>
</td>
</tr>
<tr>
<td><label for="sessionStoreType"><em> </em>
<td>
<select name="sessionStoreType" id="sessionStoreType" size="1"
onkeyup="APP.callDelayed(this, setSessionStoreType)"
onchange="APP.callDelayed(this, setSessionStoreType)">
</select>
<span id="sessionStoreTypeStatus"></span>
</td>
</tr>
<tr>
<td><label for="sessionRootSuffix"><em> </em>
<td>
<input id="sessionRootSuffix" name="sessionRootSuffix"
type="text" class="text" style="width:240px"
value="$sessionRootSuffix"
onkeyup="APP.callDelayed(this, validateSessionRootSuffix)"
onchange="APP.callDelayed(this, validateSessionRootSuffix)"/>
<span id="sessionRootSuffixStatus"></span>
</td>
</tr>
<tr id="login">
<td><label for="configStoreLoginId"><em>* </em>
<td>
<input id="configStoreLoginId" name="configStoreLoginId"
type="text" class="text" style="width:150px"
value="$configStoreLoginId"
onkeyup="APP.callDelayed(this, validateConfigStoreLoginId )"
onchange="APP.callDelayed(this, validateConfigStoreLoginId )"/>
<span id="configStoreLoginIdStatus"></span>
</td>
</tr>
<tr id="password">
<td><label for="configStorePassword"><em>* </em>
<td>
<input id="configStorePassword"
name="configStorePassword"
type="password" class="text" style="width:100px"
value="#if($store.password)$store.password#{end}"
onkeyup="APP.callDelayed(this, validateConfigStorePassword )"
onchange="APP.callDelayed(this, validateConfigStorePassword )"/>
<span id="configStorePasswordStatus"></span></td>
</tr>
</table>
</div>
<!-- Existing -->
<div id="existingInstanceURL" style="display:none">
<table class="temp">
<tr>
<td><label for="existingHost"><em>* </em>
<td>
<input id="existingHost" name="existingHost" type="text"
class="text" size="60"
onkeyup="APP.callDelayed(this, validateHostName)"
onchange="APP.callDelayed(this, validateHostName)"/>
<span id="existingHostStatus"></span>
</td>
</tr>
<tr>
<td> </td>
<td>
</td>
</tr>
</table>
</div>
<!-- replication ports -->
<div id="replicationPorts" style="display:none">
<table class="temp">
<tr>
<td><label for="localConfigPort"><em>* </em>
<td>
<input id="localConfigPort" name="localConfigPort"
type="text" class="text" size="5" maxLength="5"
value="$localConfigPort"
onkeyup="APP.callDelayed(this, validateLocalConfigPort)"
onchange="APP.callDelayed(this, validateLocalConfigPort)"/>
<span id="localConfigPortStatus"></span>
</td>
<td><label for="localConfigAdminPort"><em>* </em>
<td>
<input id="localConfigAdminPort" name="localConfigAdminPort"
type="text" class="text" size="5" maxLength="5"
value="$localConfigAdminPort"
onkeyup="APP.callDelayed(this, validateLocalConfigAdminPort)"
onchange="APP.callDelayed(this, validateLocalConfigAdminPort)"/>
<span id="localConfigAdminPortStatus"></span>
</td>
</tr>
<tr>
<td><label for="localRepPort"><em>* </em>
<td>
<input id="localRepPort" name="localRepPort"
type="text" class="text" size="5" maxLength="5"
value="$localRepPort"
onkeyup="APP.callDelayed(this, validateLocalRepPort)"
onchange="APP.callDelayed(this, validateLocalRepPort)"/>
<span id="localRepPortStatus"></span>
</td>
<td><label for="localConfigJmxPort"><em>* </em>
<td>
<input id="localConfigJmxPort" name="localConfigJmxPort"
type="text" class="text" size="5" maxLength="5"
value="$localConfigJmxPort"
onkeyup="APP.callDelayed(this, validateLocalConfigJmxPort)"
onchange="APP.callDelayed(this, validateLocalConfigJmxPort)"/>
<span id="localConfigJmxPortStatus"></span>
</td>
</tr>
<tr>
<td colspan="4">
<span id="replicationMessage"></span></td>
</tr>
<tr>
<td><label for="existingPort"><em>* </em>
<td>
<input id="existingPort" name="existingPort" type="text"
class="text" size="5" maxLength="5"
value="$existingPort"
onkeyup="APP.callDelayed(this, validateExistingPort)"
onchange="APP.callDelayed(this, validateExistingPort)"/>
<span id="existingPortStatus"></span>
</td>
<td></td><td></td>
</tr>
<tr>
<td><label for="existingRepPort"><em>* </em>
<td>
<input id="existingRepPort" name="existingRepPort"
type="text" class="text" size="5" maxLength="5"
value="$existingRepPort"
onkeyup="APP.callDelayed(this, validateExistingRepPort)"
onchange="APP.callDelayed(this, validateExistingRepPort)"/>
<span id="existingRepPortStatus"></span>
</td>
<td></td><td></td>
</tr>
</table>
</div>
<!-- existing LDAP -->
<div id="existingLDAP" style="display:none">
<table class="temp">
<tr>
<td><label for="existingStoreHost"><em>* </em>
<td><input id="existingStoreHost" name="existingStoreHost" type="text"
class="text" size="60" style="width:150px"
value="$existingStoreHost"
onkeyup="APP.callDelayed(this, validateHostName)"
onchange="APP.callDelayed(this, validateHostName)"/>
<span id="existingStoreHostStatus"></span>
</td>
</tr>
<tr>
<td><label for="existingStorePort"><em>* </em>
<td>
<input id="existingStorePort" name="existingStorePort"
type="text" size="5" maxLength="5"
value="$existingStorePort"
onkeyup="APP.callDelayed(this, validatePort)"
onchange="APP.callDelayed(this, validatePort)"/>
<span id="existingStorePortStatus"></span>
</td>
</tr>
</table>
</div>
</span>
</div>
<div>
<b class="xbottom">
<b class="xbGray1"></b>
<b class="xbGray2"></b>
<b class="xbGray3"></b>
<b class="xbGray4"></b>
</b>
</div>
</div>
</div>