ConfigureGoogleApps.jsp revision e8721886dbfd32e88cc7077cbee4b6bb1b44b443
1fdd2470b625a58b57d0b155e6caf8c4fc0afe8aAutomatic Updater DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews Copyright (c) 2009 Sun Microsystems Inc. All Rights Reserved
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews The contents of this file are subject to the terms
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews of the Common Development and Distribution License
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews (the License). You may not use this file except in
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews compliance with the License.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews You can obtain a copy of the License at
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews https://opensso.dev.java.net/public/CDDLv1.0.html or
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews See the License for the specific language governing
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews permission and limitations under the License.
4a14ce5ba00ab7bc55c99ffdcf59c7a4ab902721Automatic Updater When distributing Covered Code, include this CDDL
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews Header Notice in each file and include the License file
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews If applicable, add the following below the CDDL Header,
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews with the fields enclosed by brackets [] replaced by
e21a2904f02a03fa06b6db04d348f65fe9c67b2bMark Andrews your own identifying information:
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "Portions Copyrighted [year] [name of copyright owner]"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $Id: ConfigureGoogleApps.jsp,v 1.8 2009/08/14 18:32:46 asyhuang Exp $
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews<%@ page info="CreateFedlet" language="java" %>
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews<%@taglib uri="/WEB-INF/jato.tld" prefix="jato" %>
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews<%@taglib uri="/WEB-INF/cc.tld" prefix="cc" %>
582f8b9a8d170a80ef67475bddb8ad5cf7cd7cadMark Andrews<jato:useViewBean
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews className="com.sun.identity.console.task.ConfigureGoogleAppsViewBean"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews fireChildDisplayEvents="true" >
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews<cc:i18nbundle baseName="amConsole" id="amConsole"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews locale="<%=((com.sun.identity.console.base.AMViewBeanBase)viewBean).getUserLocale()%>"/>
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews<cc:header name="hdrCommon" pageTitle="webconsole.title" bundleID="amConsole" copyrightYear="2009" fireDisplayEvents="true">
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews<link rel="stylesheet" type="text/css" href="../console/css/openam.css" />
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews<script language="javascript" src="../console/js/am.js"></script>
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews<script language="javascript" src="../console/js/tasksPage.js"></script>
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews<script language="javascript" src="../com_sun_web_ui/js/dynamic.js"></script>
a057e8e33baa5fa369be28a9680585200ce3ff73Mark Andrews<div id="main" style="position: absolute; margin: 0; border: none; padding: 0; width:auto; height:101%;">
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews<div id="divhelp" style="display: none; position:absolute; margin: 0; border: 1px solid #AABCC8; padding: 0; width:400px; height:200px; background:#FCFCFC">
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews<table border=0 cellpadding=2 cellspacing=0 width="100%">
4a14ce5ba00ab7bc55c99ffdcf59c7a4ab902721Automatic Updater<tr><td width=99%><span id="divHelpmsg" /></td>
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews<td width="1%" valign="top">
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews<img src="../console/images/tasks/close.gif" width="16" height="16" onClick="hideHelp()" />
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews<cc:form name="ConfigureGoogleApps" method="post">
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews<jato:hidden name="szCache" />
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews<script language="javascript">
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews function confirmLogout() {
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews return confirm("<cc:text name="txtLogout" defaultValue="masthead.logoutMessage" bundleID="amConsole"/>");
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews function cancelOp() {
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews return false;
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews function realmSelect(radio) {
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews hideCOTObjs();
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews hideIDPObjs();
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews getCircleOfTrust(radio.value);
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews var choiceCOT = frm.elements['ConfigureGoogleApps.choiceCOT'];
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews function cotSelect(radio) {
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews var idpobj = frm.elements['ConfigureGoogleApps.choiceIDP'];
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews showIDPObjs();
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews function hideRealm() {
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews var frm = document.forms['ConfigureGoogleApps'];
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews var realmobj = frm.elements['ConfigureGoogleApps.tfRealm'];
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews hideRealmObjs();
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews var cotobj = frm.elements['ConfigureGoogleApps.choiceCOT'];
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews document.getElementById('cotfld').style.display = 'none';
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews document.getElementById('cottxt').innerHTML = cotobj.value;
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews var idpobj = frm.elements['ConfigureGoogleApps.choiceIDP'];
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews document.getElementById('idpfld').style.display = 'none';
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews document.getElementById('idptxt').innerHTML = idpobj.value;
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews function hideRealmObjs() {
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews document.getElementById('realmlbl').style.display = 'none';
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews document.getElementById('realmfld').style.display = 'none';
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews function showCOTObjs() {
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews document.getElementById('cotlbl').style.display = '';
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews document.getElementById('cotfld').style.display = '';
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews function hideCOTObjs() {
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews document.getElementById('cotlbl').style.display = 'none';
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews document.getElementById('cotfld').style.display = 'none';
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews function showIDPObjs() {
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews document.getElementById('idplbl').style.display = '';
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews document.getElementById('idpfld').style.display = '';
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews function hideIDPObjs() {
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews document.getElementById('idplbl').style.display = 'none';
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews document.getElementById('idpfld').style.display = 'none';
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews<cc:primarymasthead name="mhCommon" bundleID="amConsole" logoutOnClick="return confirmLogout();" locale="<%=((com.sun.identity.console.base.AMViewBeanBase)viewBean).getUserLocale()%>"/>
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews<table border="0" cellpadding="10" cellspacing="0" width="100%">
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews <cc:alertinline name="ialertCommon" bundleID="amConsole" />
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews<%-- PAGE CONTENT --------------------------------------------------------- --%>
d71e2e0c61df16ff37c9934c371a4a60c08974f7Mark Andrews<cc:pagetitle name="pgtitle" bundleID="amConsole" pageTitleText="page.title.configure.google.apps" showPageTitleSeparator="true" viewMenuLabel="" pageTitleHelpMessage="" showPageButtonsTop="true" showPageButtonsBottom="false" />
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews<table border="0" cellpadding="20" cellspacing="0">
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews <cc:text name="txtDesc" defaultValue="page.desc.configure.google.apps" bundleID="amConsole" />
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews<cc:propertysheet name="propertyAttributes" bundleID="amConsole" showJumpLinks="false"/>
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews<div id="dlg" class="dvs" style="width:600px; height: 225px; margin-left:-300px"></div>
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews<script language="javascript">
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews var frm = document.forms['ConfigureGoogleApps'];
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews var idpNew = frm.elements['ConfigureGoogleApps.choiceIDP'].value;
d71e2e0c61df16ff37c9934c371a4a60c08974f7Mark Andrews var realmNew = frm.elements['ConfigureGoogleApps.tfRealm'].value;
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews var domainIdNew ;
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews var msgCreating = "<p><img src=\"../console/images/processing.gif\" width=\"66\" height\"66\"/></p><cc:text name="txtConfiguring" defaultValue="configuring.google.apps.waiting" bundleID="amConsole" escape="false" />";
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews var msgCreated = "<p> </p><input name=\"btnOK\" type=\"submit\" class=\"Btn1\" value=\"<cc:text name="txtOKBtn" defaultValue="ajax.ok.button" bundleID="amConsole" />\" onClick=\"document.location.replace(\'../task/ConfigureGoogleAppsComplete?idp=\' + idpNew + \'&realm=\' + realmNew + \'&domainId=\' + domainIdNew);return false;\" /></div></p>";
9fbbfb5757a1e3e86d7dea62c4e63ffc2303ca2bAutomatic Updater var ttlCreated = "<h3><cc:text name="txtTtlCreated" defaultValue="google.apps.configured.msg" escape="false" bundleID="amConsole" /></h3>";
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews var closeBtn = "<p> </p><p><div class=\"TtlBtnDiv\"><input name=\"btnClose\" type=\"submit\" class=\"Btn1\" value=\"<cc:text name="txtCloseBtn" defaultValue="ajax.close.button" bundleID="amConsole" />\" onClick=\"focusMain();return false;\" /></div></p>";
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews var btn1 = frm.elements['ConfigureGoogleApps.button1'];
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews var btn2 = frm.elements['ConfigureGoogleApps.button2'];
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews var ajaxObj = getXmlHttpRequestObject();
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews var selectOptionCache;
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews var userLocale = "<%= viewBean.getUserLocale().toString() %>";
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews function submitPage() {
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews document.getElementById('dlg').style.top = '300px';
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews document.getElementById('dlg').innerHTML = '<center>' +
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews msgCreating + '</center>';
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews var params = 'locale=' + userLocale +
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews '&class=com.sun.identity.workflow.ConfigureGoogleApps' + getData();
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews frm = document.forms['ConfigureGoogleApps'];
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews idpNew = frm.elements['ConfigureGoogleApps.choiceIDP'].value;
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews realmNew = frm.elements['ConfigureGoogleApps.tfRealm'].value;
a057e8e33baa5fa369be28a9680585200ce3ff73Mark Andrews var size = frm.elements['ConfigureGoogleApps.tfDomainId.listbox'].length ;
a057e8e33baa5fa369be28a9680585200ce3ff73Mark Andrews domainIdNew="";
a057e8e33baa5fa369be28a9680585200ce3ff73Mark Andrews for (i=0;i<size-1;i++)
a057e8e33baa5fa369be28a9680585200ce3ff73Mark Andrews domainIdNew += frm.elements['ConfigureGoogleApps.tfDomainId.listbox'].options[i].value + "," ;
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews ajaxPost(ajaxObj, url, params, configured);
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews return false;
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews function getData() {
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews var cot = frm.elements['ConfigureGoogleApps.choiceCOT'].value;
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews var idp = frm.elements['ConfigureGoogleApps.choiceIDP'].value;
4a14ce5ba00ab7bc55c99ffdcf59c7a4ab902721Automatic Updater var realm = frm.elements['ConfigureGoogleApps.tfRealm'].value;
057cafaa3df7be7a6dcca71fbaf8fb498fd83518Mark Andrews var size = frm.elements['ConfigureGoogleApps.tfDomainId.listbox'].length ;
057cafaa3df7be7a6dcca71fbaf8fb498fd83518Mark Andrews domainIdNew="";
057cafaa3df7be7a6dcca71fbaf8fb498fd83518Mark Andrews for (i=0;i<size-1;i++)
057cafaa3df7be7a6dcca71fbaf8fb498fd83518Mark Andrews domainIdNew += frm.elements['ConfigureGoogleApps.tfDomainId.listbox'].options[i].value + "," ;
057cafaa3df7be7a6dcca71fbaf8fb498fd83518Mark Andrews return "&realm=" + escapeEx(realm) +
057cafaa3df7be7a6dcca71fbaf8fb498fd83518Mark Andrews "&cot=" + escapeEx(cot) +
057cafaa3df7be7a6dcca71fbaf8fb498fd83518Mark Andrews "&idp=" + escapeEx(idp) +
057cafaa3df7be7a6dcca71fbaf8fb498fd83518Mark Andrews "&domainId=" + escapeEx(domainIdNew);
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews function configured() {
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews var result = hexToString(ajaxObj.responseText);
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews var status = result.substring(0, result.indexOf('|'));
4a14ce5ba00ab7bc55c99ffdcf59c7a4ab902721Automatic Updater var result = result.substring(result.indexOf('|') +1);
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews var msg = '<center><p>' + result + '</p></center>';
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews if (status == 0) {
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews msg = '<center>' + ttlCreated + msgCreated + '</center>';
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews msg = msg + '<center>' + closeBtn + '</center>';
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews frm = document.forms['ConfigureGoogleApps'];
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews idpNew = frm.elements['ConfigureGoogleApps.choiceIDP'].value;
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews realmNew = frm.elements['ConfigureGoogleApps.tfRealm'].value;
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews var size = frm.elements['ConfigureGoogleApps.tfDomainId.listbox'].length ;
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews i=0; domainIdNew="";
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews for (i=0;i<size-1;i++)
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews domainIdNew += frm.elements['ConfigureGoogleApps.tfDomainId.listbox'].options[i].value + "," ;
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews document.getElementById('dlg').innerHTML = msg;
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews function getCircleOfTrust(realm) {
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews var params = 'locale=' + userLocale +
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews '&class=com.sun.identity.workflow.GetCircleOfTrusts' +
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews '&realm=' + escapeEx(realm);
clearOptions(frm, 'ConfigureGoogleApps.choiceIDP');
var url = "../console/ajax/AjaxProxy.jsp";
'&class=com.sun.identity.workflow.GetHostedIDPs' +
if (ajaxObj.readyState == 4) {
var result = hexToString(ajaxObj.responseText);
result = result.replace(/^\s+/, '');
result = result.replace(/\s+$/, '');
if (result.length == 0) {
var cots = result.split('|');
for (var i = choiceCOT.length - 1; i>=0; i--) {
choiceCOT.remove(i);
for (var i = 0; i < cots.length; i++) {
choiceCOT.options[i] = new Option(cots[i], cots[i]);
selectOption(frm, 'ConfigureGoogleApps.choiceCOT', presetcot);
document.getElementById('dlg').innerHTML = msg;
if (ajaxObj.readyState == 4) {
var result = hexToString(ajaxObj.responseText);
result = result.replace(/^\s+/, '');
result = result.replace(/\s+$/, '');
if (result.length == 0) {
var idps = result.split('|');
for (var i = 0; i < idps.length; i++) {
choiceIDP.options[i] = new Option(idps[i], idps[i]);
document.getElementById('dlg').innerHTML = msg;
var nodes = document.getElementsByTagName("table");
var len = nodes.length;
String cot = request.getParameter("cot");
String idp = request.getParameter("entityId");
if ((cot != null) && (cot.trim().length() > 0)) {
out.println("hideRealmObjs();");
out.println("hideIDPObjs();");
out.println("presetcot = \"" + cot + "\";");
out.println("hideRealm();");
str = str.replace(/"/g, '"');
str = str.replace(/</g, '<');
str = str.replace(/>/g, '>');
var infoRealm = unescapeQuote("<cc:text name="txtInfoRealm" defaultValue="configure.google.apps.help.realm" bundleID="amConsole" />");
var infoEntityId = unescapeQuote("<cc:text name="txtInfoEntityId" defaultValue="configure.google.apps.help.entity.id" bundleID="amConsole" />");