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