8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts<%--
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts ~ The contents of this file are subject to the terms of the Common Development and
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts ~ Distribution License (the License). You may not use this file except in compliance with the
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts ~ License.
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts ~
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts ~ You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts ~ specific language governing permission and limitations under the License.
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts ~
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts ~ When distributing Covered Software, include this CDDL Header Notice in each file and include
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts ~ the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts ~ Header, with the fields enclosed by brackets [] replaced by your own identifying
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts ~ information: "Portions copyright [year] [name of copyright owner]".
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts ~
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts ~ Copyright 2015 ForgeRock AS.
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts --%>
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts<%@ page info="ServerEditUMA" language="java" %>
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts<%@taglib uri="/WEB-INF/jato.tld" prefix="jato" %>
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts<%@taglib uri="/WEB-INF/cc.tld" prefix="cc" %>
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts<jato:useViewBean className="com.sun.identity.console.service.ServerEditUMAViewBean" fireChildDisplayEvents="true" >
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts <cc:i18nbundle baseName="amConsole" id="amConsole" locale="<%=((com.sun.identity.console.base.AMViewBeanBase)viewBean).getUserLocale()%>"/>
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts <cc:header name="hdrCommon" pageTitle="webconsole.title" bundleID="amConsole" copyrightYear="2007" fireDisplayEvents="true">
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts <script language="javascript">
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts // Field names.
7d395d5d4197d1648464cb3606f69c23f08ffbd6James Phillpotts var fields = {
7d395d5d4197d1648464cb3606f69c23f08ffbd6James Phillpotts resourcesets: {
7d395d5d4197d1648464cb3606f69c23f08ffbd6James Phillpotts storeLocationRadioButtonName: 'ServerEditUMA.cscorg-forgerock-services-resourcesets-store-location',
7d395d5d4197d1648464cb3606f69c23f08ffbd6James Phillpotts sslEnableCheckBoxName: 'ServerEditUMA.cscorg-forgerock-services-resourcesets-store-ssl-enabled',
7d395d5d4197d1648464cb3606f69c23f08ffbd6James Phillpotts directoryNameFieldName: 'ServerEditUMA.cscorg-forgerock-services-resourcesets-store-directory-name',
7d395d5d4197d1648464cb3606f69c23f08ffbd6James Phillpotts portFieldName: 'ServerEditUMA.cscorg-forgerock-services-resourcesets-store-port',
7d395d5d4197d1648464cb3606f69c23f08ffbd6James Phillpotts loginIdFieldName: 'ServerEditUMA.cscorg-forgerock-services-resourcesets-store-loginid',
7d395d5d4197d1648464cb3606f69c23f08ffbd6James Phillpotts passwordFieldName: 'ServerEditUMA.cscorg-forgerock-services-resourcesets-store-password',
7d395d5d4197d1648464cb3606f69c23f08ffbd6James Phillpotts maxConnectionsFieldName: 'ServerEditUMA.cscorg-forgerock-services-resourcesets-store-max-connections',
7d395d5d4197d1648464cb3606f69c23f08ffbd6James Phillpotts heartbeat: 'ServerEditUMA.cscorg-forgerock-services-resourcesets-store-heartbeat'
7d395d5d4197d1648464cb3606f69c23f08ffbd6James Phillpotts },
7d395d5d4197d1648464cb3606f69c23f08ffbd6James Phillpotts audit: {
7d395d5d4197d1648464cb3606f69c23f08ffbd6James Phillpotts storeLocationRadioButtonName: 'ServerEditUMA.cscorg-forgerock-services-umaaudit-store-location',
7d395d5d4197d1648464cb3606f69c23f08ffbd6James Phillpotts sslEnableCheckBoxName: 'ServerEditUMA.cscorg-forgerock-services-umaaudit-store-ssl-enabled',
7d395d5d4197d1648464cb3606f69c23f08ffbd6James Phillpotts directoryNameFieldName: 'ServerEditUMA.cscorg-forgerock-services-umaaudit-store-directory-name',
7d395d5d4197d1648464cb3606f69c23f08ffbd6James Phillpotts portFieldName: 'ServerEditUMA.cscorg-forgerock-services-umaaudit-store-port',
7d395d5d4197d1648464cb3606f69c23f08ffbd6James Phillpotts loginIdFieldName: 'ServerEditUMA.cscorg-forgerock-services-umaaudit-store-loginid',
7d395d5d4197d1648464cb3606f69c23f08ffbd6James Phillpotts passwordFieldName: 'ServerEditUMA.cscorg-forgerock-services-umaaudit-store-password',
7d395d5d4197d1648464cb3606f69c23f08ffbd6James Phillpotts maxConnectionsFieldName: 'ServerEditUMA.cscorg-forgerock-services-umaaudit-store-max-connections',
7d395d5d4197d1648464cb3606f69c23f08ffbd6James Phillpotts heartbeat: 'ServerEditUMA.cscorg-forgerock-services-umaaudit-store-heartbeat'
a6bf4d9e39eae70c6b74d0d91d35704662c84ff7Phill Cunnington },
a6bf4d9e39eae70c6b74d0d91d35704662c84ff7Phill Cunnington pendingrequests: {
c289b3af72dda73e53e6886c920c198b779ebf37Rich Riley storeLocationRadioButtonName: 'ServerEditUMA.cscorg-forgerock-services-uma-pendingrequests-store-location',
c289b3af72dda73e53e6886c920c198b779ebf37Rich Riley sslEnableCheckBoxName: 'ServerEditUMA.cscorg-forgerock-services-uma-pendingrequests-store-ssl-enabled',
c289b3af72dda73e53e6886c920c198b779ebf37Rich Riley directoryNameFieldName: 'ServerEditUMA.cscorg-forgerock-services-uma-pendingrequests-store-directory-name',
c289b3af72dda73e53e6886c920c198b779ebf37Rich Riley portFieldName: 'ServerEditUMA.cscorg-forgerock-services-uma-pendingrequests-store-port',
c289b3af72dda73e53e6886c920c198b779ebf37Rich Riley loginIdFieldName: 'ServerEditUMA.cscorg-forgerock-services-uma-pendingrequests-store-loginid',
c289b3af72dda73e53e6886c920c198b779ebf37Rich Riley passwordFieldName: 'ServerEditUMA.cscorg-forgerock-services-uma-pendingrequests-store-password',
c289b3af72dda73e53e6886c920c198b779ebf37Rich Riley maxConnectionsFieldName: 'ServerEditUMA.cscorg-forgerock-services-uma-pendingrequests-store-max-connections',
c289b3af72dda73e53e6886c920c198b779ebf37Rich Riley heartbeat: 'ServerEditUMA.cscorg-forgerock-services-uma-pendingrequests-store-heartbeat'
c289b3af72dda73e53e6886c920c198b779ebf37Rich Riley },
c289b3af72dda73e53e6886c920c198b779ebf37Rich Riley labels: {
c289b3af72dda73e53e6886c920c198b779ebf37Rich Riley storeLocationRadioButtonName: 'ServerEditUMA.cscorg-forgerock-services-uma-labels-store-location',
c289b3af72dda73e53e6886c920c198b779ebf37Rich Riley sslEnableCheckBoxName: 'ServerEditUMA.cscorg-forgerock-services-uma-labels-store-ssl-enabled',
c289b3af72dda73e53e6886c920c198b779ebf37Rich Riley directoryNameFieldName: 'ServerEditUMA.cscorg-forgerock-services-uma-labels-store-directory-name',
c289b3af72dda73e53e6886c920c198b779ebf37Rich Riley portFieldName: 'ServerEditUMA.cscorg-forgerock-services-uma-labels-store-port',
c289b3af72dda73e53e6886c920c198b779ebf37Rich Riley loginIdFieldName: 'ServerEditUMA.cscorg-forgerock-services-uma-labels-store-loginid',
c289b3af72dda73e53e6886c920c198b779ebf37Rich Riley passwordFieldName: 'ServerEditUMA.cscorg-forgerock-services-uma-labels-store-password',
c289b3af72dda73e53e6886c920c198b779ebf37Rich Riley maxConnectionsFieldName: 'ServerEditUMA.cscorg-forgerock-services-uma-labels-store-max-connections',
c289b3af72dda73e53e6886c920c198b779ebf37Rich Riley heartbeat: 'ServerEditUMA.cscorg-forgerock-services-uma-labels-store-heartbeat'
7d395d5d4197d1648464cb3606f69c23f08ffbd6James Phillpotts }
7d395d5d4197d1648464cb3606f69c23f08ffbd6James Phillpotts };
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts window.onload = function() {
7d395d5d4197d1648464cb3606f69c23f08ffbd6James Phillpotts setState(fields.audit);
7d395d5d4197d1648464cb3606f69c23f08ffbd6James Phillpotts setState(fields.resourcesets);
a6bf4d9e39eae70c6b74d0d91d35704662c84ff7Phill Cunnington setState(fields.pendingrequests);
c289b3af72dda73e53e6886c920c198b779ebf37Rich Riley setState(fields.labels);
7d395d5d4197d1648464cb3606f69c23f08ffbd6James Phillpotts };
7d395d5d4197d1648464cb3606f69c23f08ffbd6James Phillpotts
7d395d5d4197d1648464cb3606f69c23f08ffbd6James Phillpotts function setState(fieldset) {
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts // Set the initial state of the fields.
7d395d5d4197d1648464cb3606f69c23f08ffbd6James Phillpotts var radioBtns = document.getElementsByName(fieldset.storeLocationRadioButtonName);
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts if (radioBtns.length != 2) {
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts // Do nothing, there must be two radio buttons.
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts return;
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts }
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts
7d395d5d4197d1648464cb3606f69c23f08ffbd6James Phillpotts toggleExternalConfig(fieldset, (radioBtns[0].checked) ? radioBtns[0] : radioBtns[1]);
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts }
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts // Retrieves the first element of the given name.
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts function getFirstElementByName(name) {
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts var elements = document.getElementsByName(name);
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts return (elements.length > 0) ? elements[0] : null;
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts }
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts // Toggles the status of the external configuration fields.
7d395d5d4197d1648464cb3606f69c23f08ffbd6James Phillpotts function toggleExternalConfig(fieldset, storeLocationRadioButton) {
7d395d5d4197d1648464cb3606f69c23f08ffbd6James Phillpotts var readonly = storeLocationRadioButton.value === 'default';
7d395d5d4197d1648464cb3606f69c23f08ffbd6James Phillpotts toggleField(fieldset.sslEnableCheckBoxName, readonly);
7d395d5d4197d1648464cb3606f69c23f08ffbd6James Phillpotts toggleField(fieldset.directoryNameFieldName, readonly);
7d395d5d4197d1648464cb3606f69c23f08ffbd6James Phillpotts toggleField(fieldset.portFieldName, readonly);
7d395d5d4197d1648464cb3606f69c23f08ffbd6James Phillpotts toggleField(fieldset.loginIdFieldName, readonly);
7d395d5d4197d1648464cb3606f69c23f08ffbd6James Phillpotts toggleField(fieldset.passwordFieldName, readonly);
c9f1d3043c1f8394a35ebfd5aad3bdeb841e55dfPhill Cunnington toggleField(fieldset.maxConnectionsFieldName, false);
7d395d5d4197d1648464cb3606f69c23f08ffbd6James Phillpotts toggleField(fieldset.heartbeat, readonly);
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts }
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts // Toggles the status of a given field.
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts function toggleField(fieldName, readonly) {
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts var field = getFirstElementByName(fieldName);
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts if (field != null) {
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts if (readonly) {
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts field.setAttribute('readonly', 'readonly');
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts field.className = 'TxtFldDis';
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts } else {
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts field.removeAttribute('readonly');
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts field.className = 'TxtFld';
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts }
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts }
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts }
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts </script>
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts <cc:form name="ServerEditUMA" method="post" defaultCommandChild="/button1">
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts <script language="javascript">
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts function confirmLogout() {
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts return confirm("<cc:text name="txtLogout" defaultValue="masthead.logoutMessage" bundleID="amConsole"/>");
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts }
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts </script>
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts <cc:primarymasthead name="mhCommon" bundleID="amConsole" logoutOnClick="return confirmLogout();" locale="<%=((com.sun.identity.console.base.AMViewBeanBase)viewBean).getUserLocale()%>"/>
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts <cc:breadcrumbs name="breadCrumb" bundleID="amConsole" />
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts <cc:tabs name="tabCommon" bundleID="amConsole" />
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts <table border="0" cellpadding="10" cellspacing="0" width="100%">
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts <tr>
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts <td>
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts <cc:alertinline name="ialertCommon" bundleID="amConsole" />
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts </td>
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts </tr>
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts </table>
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts <%-- PAGE CONTENT --------------------------------------------------------- --%>
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts <cc:pagetitle name="pgtitleThreeBtns" bundleID="amConsole" pageTitleText="page.title.server.edit" showPageTitleSeparator="true" viewMenuLabel="" pageTitleHelpMessage="" showPageButtonsTop="true" showPageButtonsBottom="false" />
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts <table border="0" cellpadding="10" cellspacing="0" width="100%">
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts <tr><td>
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts <cc:button name="btnInherit" bundleID="amConsole" defaultValue="serverconfig.button.inherit" type="primary" />
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts </td></tr>
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts </table>
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts <cc:propertysheet name="propertyAttributes" bundleID="amConsole" showJumpLinks="true"/>
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts </cc:form>
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts </cc:header>
8df974db6a280f05491e26c4f0f59e7568fe5b02James Phillpotts</jato:useViewBean>