services.jsp revision e8721886dbfd32e88cc7077cbee4b6bb1b44b443
18727N/A<%--
12779N/A DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
12779N/A
12779N/A Copyright (c) 2011 ForgeRock AS. All Rights Reserved
12779N/A
12779N/A The contents of this file are subject to the terms
12779N/A of the Common Development and Distribution License
12779N/A (the License). You may not use this file except in
12779N/A compliance with the License.
12779N/A
12779N/A You can obtain a copy of the License at
12779N/A http://forgerock.org/license/CDDLv1.0.html
12779N/A See the License for the specific language governing
12779N/A permission and limitations under the License.
12779N/A
12779N/A When distributing Covered Code, include this CDDL
12779N/A Header Notice in each file and include the License file
12779N/A at http://forgerock.org/license/CDDLv1.0.html
12779N/A If applicable, add the following below the CDDL Header,
12779N/A with the fields enclosed by brackets [] replaced by
12779N/A your own identifying information:
12779N/A "Portions Copyrighted [year] [name of copyright owner]"
12779N/A
12779N/A--%>
12779N/A
12779N/A<%@ page language="java"
12779N/A import="java.security.AccessController,
12779N/A com.sun.identity.security.AdminTokenAction,
12779N/A com.iplanet.sso.SSOTokenManager,
12779N/A com.iplanet.sso.SSOException,
12779N/A com.iplanet.sso.SSOToken"
12779N/A %>
12779N/A<%@ page import="com.sun.identity.sm.*" %>
12779N/A<%@ page import="java.util.*" %>
12779N/A
12779N/A<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
12779N/A<html xmlns="http://www.w3.org/1999/xhtml">
12779N/A<head>
12779N/A <title>OpenAM</title>
12779N/A <link rel="stylesheet" type="text/css" href="com_sun_web_ui/css/css_ns6up.css"/>
12779N/A <link rel="shortcut icon" href="com_sun_web_ui/images/favicon/favicon.ico" type="image/x-icon"/>
12779N/A
12779N/A <style type="text/css">
12779N/A
12779N/A .attribute {
12779N/A color: red;
12779N/A width: 550px;
12779N/A padding: 0px;
12779N/A /*background-color: #eeeeee;*/
12779N/A }
12779N/A
12779N/A .attributeRowA {
12779N/A width: 100%;
12779N/A background-color: #eeeeee;
12779N/A padding: 6px;
12779N/A }
12779N/A
12779N/A .attributeRowB {
12779N/A width: 100%;
12779N/A background-color: #dddddd;
12779N/A padding: 6px;
12779N/A }
12779N/A
12779N/A .attribute .name {
12779N/A color: blue;
12779N/A font-size: 12px;
12779N/A font-family: courier;
12779N/A /*background-color: #00008b;*/
12779N/A }
12779N/A
12779N/A .attribute .description {
12779N/A color: black;
12779N/A font-size: 15px;
12779N/A /*background-color: #b8860b;*/
12779N/A }
12779N/A
12779N/A .attribute .descriptionMissing {
12779N/A color: #666666;
12779N/A font-size: 15px;
12779N/A }
12779N/A
12779N/A .attribute .help {
12779N/A color: green;
12779N/A font-size: 12px;
12779N/A /*background-color: #006400;*/
12779N/A }
12779N/A
12779N/A .schemaType {
12779N/A position: relative;
12779N/A float: left;
12779N/A clear: left;
12779N/A padding: 2px;
12779N/A width: 750px;
12779N/A font-family: arial, helvetica;
12779N/A }
12779N/A
12779N/A .schemaBlock {
12779N/A position: relative;
12779N/A float: left;
12779N/A width: 630px;
12779N/A display: block;
12779N/A font-family: arial, helvetica;
12779N/A }
12779N/A
12779N/A .schemaTitle {
12779N/A width: 120px;
12779N/A float: left;
12779N/A font-size: 12px;
12779N/A }
12779N/A
12779N/A .service {
12779N/A position: relative;
12779N/A float: left;
12779N/A padding-top: 10px;
12779N/A width: 800px;
12779N/A font-family: arial, helvetica;
12779N/A }
12779N/A
12779N/A .serviceName {
12779N/A position: relative;
12779N/A float: left;
12779N/A font-weight: bold;
12779N/A font-size: 16px;
12779N/A /*background-color: #bbbbcc;*/
12779N/A padding: 2px;
12779N/A width: 796px;
12779N/A }
12779N/A
12779N/A .serviceBlock {
12779N/A position: relative;
12779N/A float: left;
12779N/A clear: left;
12779N/A left: 10px;
12779N/A width: 790px;
12779N/A display: block;
12779N/A }
12779N/A
12779N/A
12779N/A </style>
12779N/A
12779N/A <script src="js/jquery.js"></script>
12779N/A
12779N/A <script type="text/javascript">
12779N/A
12779N/A $(document).ready(function () {
12779N/A $(".schemaTitle").click(function () {
12779N/A $(this).parent().children(".schemaBlock").toggle("fast");
12779N/A });
12779N/A $(".serviceName").click(function () {
12779N/A $(this).parent().children(".serviceBlock").toggle("fast");
12779N/A });
12779N/A });
12779N/A
12779N/A </script>
12779N/A
12779N/A</head>
12779N/A
12779N/A
12779N/A<body class="DefBdy">
12779N/A<div class="SkpMedGry1"><a href="#SkipAnchor3860"><img src="com_sun_web_ui/images/other/dot.gif" alt="Jump to End of Masthead" border="0" height="1" width="1"/></a></div>
12779N/A<div class="MstDiv">
12779N/A <table class="MstTblBot" title="" border="0" cellpadding="0" cellspacing="0" width="100%">
12779N/A <tr>
12779N/A <td class="MstTdTtl" width="99%">
12779N/A <div class="MstDivTtl"><img name="AMConfig.configurator.ProdName" src="console/images/PrimaryProductName.png" alt="OpenSSO" border="0"/></div>
12779N/A </td>
12779N/A <td class="MstTdLogo" width="1%"><img name="AMConfig.configurator.BrandLogo" src="com_sun_web_ui/images/other/javalogo.gif" alt="Java(TM) Logo" border="0" height="55" width="31"/></td>
12779N/A </tr>
12779N/A </table>
12779N/A <table class="MstTblEnd" border="0" cellpadding="0" cellspacing="0" width="100%">
12779N/A <tr>
12779N/A <td><img name="RMRealm.mhCommon.EndorserLogo" src="com_sun_web_ui/images/masthead/masthead-sunname.gif" alt="Sun(TM) Microsystems, Inc." align="right" border="0" height="10" width="108"/></td>
12779N/A </tr>
12779N/A </table>
12779N/A</div>
12779N/A<table class="SkpMedGry1" border="0" cellpadding="5" cellspacing="0" width="100%">
12779N/A <tr>
12779N/A <td><img src="com_sun_web_ui/images/other/dot.gif" alt="Jump to End of Masthead" border="0" height="1" width="1"/></a></td>
12779N/A </tr>
12779N/A</table>
12779N/A<table border="0" cellpadding="10" cellspacing="0" width="100%">
12779N/A <tr>
12779N/A <td></td>
12779N/A </tr>
12779N/A</table>
12779N/A
12779N/A<table cellpadding=15>
12779N/A <tr>
12779N/A <td>
12779N/A
12779N/A
12779N/A <div id="doc" style="max-width: 800px; display: block;">
12779N/A
12779N/A <p><strong>OpenAM Service Attributes</strong></p>
12779N/A
12779N/A <p>In order to translate configuration changes made in OpenAM console to
12779N/A <code>ssoadm</code> commands, you must first match the GUI settings to
12779N/A service attributes used by <code>ssoadm</code>. This page lists
12779N/A available service attributes, including their labels and online help from
12779N/A OpenAM console where available. Service attributes apply according to their type:</p>
12779N/A
12779N/A <dl>
12779N/A <dt>Dynamic</dt>
12779N/A <dd>Applies to a role or a realm</dd>
12779N/A
12779N/A <dt>Global</dt>
12779N/A <dd>Applies to the entire OpenAM server</dd>
12779N/A
12779N/A <dt>Organization</dt>
12779N/A <dd>Applies to a realm</dd>
12779N/A </dl>
12779N/A
12779N/A <p>To find the service attribute that corresponds to a particular GUI
12779N/A setting, click Expand below, and then search for the label of the GUI
12779N/A setting within this page.</p>
12779N/A
12779N/A <p>For example, suppose you changed <code>Maximum Session Time</code> in
12779N/A the OpenAM console to 240 seconds. You search this page for
12779N/A <code>Maximum Session Time</code> and find the dynamic attribute
12779N/A <code>iplanet-am-session-max-session-time</code> on the
12779N/A <code>iPlanetAMSessionService</code> service. To set maximum session
12779N/A time to 240 seconds by script, you use the following command.</p>
12779N/A
12779N/A<pre>ssoadm set-attr-defs -u amadmin -f /tmp/pwd.txt -s iPlanetAMSessionService \
12779N/A -t dynamic -a "iplanet-am-session-max-session-time=240"</pre>
12779N/A
12779N/A <hr>
12779N/A
12779N/A </div>
12779N/A
12779N/A <br/>
12779N/A <div>
12779N/A <div style="font-size: 12px; display: inline; text-color: #666666; text-decoration: underline;"
12779N/A onclick="$(document).find('.serviceBlock').show(); $(document).find('.schemaBlock').show();">Expand all
12779N/A </div>
12779N/A &nbsp;|&nbsp;
12779N/A <div style="font-size: 12px; display: inline; text-color: #666666; text-decoration: underline;"
12779N/A onclick="$(document).find('.serviceBlock').hide(); $(document).find('.schemaBlock').hide();">Collapse all
12779N/A </div>
12779N/A </div>
12779N/A <br/>
12779N/A
12779N/A <%
12779N/A
12779N/A // Get valid SSOToken (must be logged in as amadmin)
12779N/A SSOTokenManager sMgr;
12779N/A SSOToken token;
12779N/A try {
12779N/A sMgr = SSOTokenManager.getInstance();
12779N/A token = sMgr.createSSOToken(request);
12779N/A } catch (SSOException e) {
12779N/A response.sendRedirect("UI/Login?goto=../services.jsp");
12779N/A return;
12779N/A }
12779N/A
12779N/A ServiceManager sm = new ServiceManager(token);
12779N/A Set serviceNames = sm.getServiceNames();
12779N/A
12779N/A for (Object o : serviceNames) {
12779N/A String serviceName = o.toString();
12779N/A
12779N/A out.println("<div class='service' name='" + o + "'>");
12779N/A out.println("<div class='serviceName'>" + serviceName + "</div>");
12779N/A out.println("<div class='serviceBlock'>");
12779N/A
12779N/A // Assume version 1.0 (as of 2012-06 all services are version 1.0)
12779N/A ServiceConfigManager scm = sm.getConfigManager(serviceName, "1.0");
12779N/A Set<String> instances = scm.getInstanceNames();
12779N/A
12779N/A // To list instances
12779N/A// for (String instance : instances) {
12779N/A// out.println("Instance: " + instance + "");
12779N/A// }
12779N/A
12779N/A
12779N/A ServiceSchemaManager ssm = sm.getSchemaManager(serviceName, "1.0");
12779N/A
12779N/A if (ssm != null) {
12779N/A
12779N/A Map<String, ServiceSchema> serviceSchemaList = new HashMap<String, ServiceSchema>();
12779N/A ServiceSchema dynamic = ssm.getDynamicSchema();
12779N/A if (dynamic != null) {
12779N/A serviceSchemaList.put("Dynamic", dynamic);
12779N/A }
12779N/A ServiceSchema global = ssm.getGlobalSchema();
12779N/A if (global != null) {
12779N/A serviceSchemaList.put("Global", global);
12779N/A }
12779N/A ServiceSchema org = ssm.getOrganizationSchema();
12779N/A if (org != null) {
12779N/A serviceSchemaList.put("Organization", org);
12779N/A }
12779N/A
12779N/A for (String schemaType : serviceSchemaList.keySet()) {
12779N/A
12779N/A ServiceSchema ss = serviceSchemaList.get(schemaType);
12779N/A String i18nFilename = ss.getI18NFileName();
12779N/A ResourceBundle bundle = ResourceBundle.getBundle(i18nFilename);
12779N/A
12779N/A if (ss != null) {
12779N/A Set<String> serviceAttributeNames = ss.getServiceAttributeNames();
12779N/A
12779N/A // Ignore this schema if it is empty
12779N/A if (serviceAttributeNames == null || serviceAttributeNames.isEmpty()) {
12779N/A continue;
12779N/A }
12779N/A
12779N/A out.println("<div class='schemaType'><div class='schemaTitle'>" + schemaType + "</div>");
12779N/A out.println("<div class='schemaBlock'>");
12779N/A
12779N/A boolean rowAlternator = true;
12779N/A for (String s : serviceAttributeNames) {
12779N/A // Alternating row backgrounds
12779N/A rowAlternator = !rowAlternator;
12779N/A
12779N/A AttributeSchema as = ss.getAttributeSchema(s);
12779N/A out.println("<div class='attribute'>");
12779N/A
12779N/A if (rowAlternator)
12779N/A out.println("<div class='attributeRowA'>");
12779N/A else
12779N/A out.println("<div class='attributeRowB'>");
12779N/A
12779N/A out.println("<div class='name'>" + s + "</div>");
12779N/A try {
12779N/A if (as.getI18NKey() != null)
12779N/A out.println("<div class='description'>" + bundle.getString(as.getI18NKey()) + "</div>");
12779N/A } catch (MissingResourceException mre) {
12779N/A out.println("<div class='descriptionMissing'>" + s + " (missing description)</div>");
12779N/A }
12779N/A try {
12779N/A if (as.getI18NKey() != null)
12779N/A out.println("<div class='help'>" + bundle.getString(as.getI18NKey().concat(".help")) + "</div>");
12779N/A } catch (MissingResourceException mre) {
12779N/A }
12779N/A out.println("</div>");
12779N/A out.println("</div>");
12779N/A }
12779N/A out.println("</div>");
12779N/A out.println("</div>");
12779N/A }
12779N/A }
12779N/A }
12779N/A
12779N/A out.println("</div></div>");
12779N/A }
12779N/A
12779N/A %>
12779N/A
12779N/A
12779N/A </td>
12779N/A </tr>
12779N/A</table>
12779N/A</body>
12779N/A</html>
12779N/A
12779N/A