AuthPropertiesViewBean.java revision 6328925537fd7e5d853fe7540b10d6f909057805
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2007 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* Portions Copyrighted 2014-2015 ForgeRock AS.
*
* $Id: AuthPropertiesViewBean.java,v 1.5 2008/07/07 20:39:19 veiming Exp $
*
*/
/**
* This is the main authentication properties view page which displays the
* authentication instances, authentication configurations, and a few of
* the core authentication properties (with a link to the full set of
* properties). From this view the user can create new auth instances,
* configurations, and basic property editing. The XML file used to build
* the layout is propertyRealmAuth.xml. tblAuthInstance.xml and
* tblAuthConfig.xml define the table structures for the instance and config
* tables respectively.
*/
public class AuthPropertiesViewBean
extends RealmPropertiesBase
{
public static final String DEFAULT_DISPLAY_URL =
private boolean tablePopulated = false;
private boolean initialized = false;
private AMPropertySheetModel propertySheetModel;
// instance table properties
private static final String AUTH_INSTANCE_TABLE =
"authenticationModuleInstanceTable";
private static final String NAME_COLUMN_DATA_NO_HREF =
"nameColumnDataNoHref";
private static final String ACTION_COLUMN_HREF_LABEL =
"actionColumnHREFLabel";
// configuration table properties
private static final String AUTH_CONFIG_TABLE =
"authenticationConfigurationTable";
private static final String CONFIG_NAME_COLUMN_LABEL =
"configNameColumnLabel";
private static final String CONFIG_NAME_COLUMN_DATA =
"configNameColumnData";
private static final String CONFIG_ACTION_COLUMN_LABEL =
"configActionColumnLabel";
private static final String CONFIG_ACTION_COLUMN_HREF =
"configActionColumnHREF";
private static final String CONFIG_ACTION_COLUMN_HREF_LABEL =
"configActionColumnHREFLabel";
private static final String ADMIN_AUTH_CONFIG =
"iplanet-am-auth-admin-auth-module";
/**
* Creates a authentication domains view bean.
*/
public AuthPropertiesViewBean() {
super("AuthProperties");
}
protected void initialize() {
if (!initialized) {
initialized = true;
super.initialize();
}
}
}
protected void registerChildren() {
ptModel.registerChildren(this);
super.registerChildren();
}
if (!tablePopulated) {
}
} else {
}
return view;
}
if (isXuiAdminConsoleEnabled()) {
try {
} catch (UnsupportedEncodingException e) {
throw new IllegalStateException("UTF-8 encoding not supported", e);
}
}
}
private void populateConfigTable() {
tablePopulated = true;
// get config names from previous pass. Need to use an ordered set
// here to assure the same order is retained during the request cycle.
// no instances if this is the 1st pass, create it now
getRequestContext().getRequest());
}
configSet = new OrderedSet();
}
// add the data to the table
boolean firstEntry = true;
if (!firstEntry) {
} else {
firstEntry = false;
}
stringToHex(name));
"authentication.module.instances.action.label");
}
// set the instances in the page session so when a request comes in
// we can prepopulate the table model.
}
private void populateConfigMenu() {
}
}
}
private void populateInstanceTable() {
tablePopulated = true;
boolean firstEntry = true;
/*
* These instance were deleted in the previous request. This
* is needed because the getAuthInstances call may return the
* instances that were just deleted.
*/
(AMAuthenticationInstance)i.next();
if ((removedInstances == null) ||
{
}
}
/*
* get instance names from previous pass. Need to use an ordered set
* here to assure the same order is retained during the request cycle.
*/
// no instances if this is the 1st pass, create it now
if (instanceSet == null) {
instanceSet = new OrderedSet();
}
try {
} catch (AMConfigurationException e) {
}
/*
* check if instance still exists. This can happen if user goes
* the the advanced core properties page and removes an auth type
* from the available auth instances list.
*/
if (!firstEntry) {
} else {
firstEntry = false;
}
stringToHex(name));
} else {
stringToHex(name));
}
try {
} catch (AMConfigurationException e) {
if (debug.warningEnabled()) {
}
}
}
}
}
/*
* set the instances in the page session so when a request comes in
* we can prepopulate the table model.
*/
}
private AMModel getConfigModel() {
}
protected AMModel getModelInternal() {
}
private void createPageTitleModel() {
ptModel = new CCPageTitleModel(
}
}
/*
* Responsible for creating the model used for the authentication instances
*/
private void createInstanceTable() {
"authentication.instance.table.name.column");
"authentication.instance.table.type.column");
"authentication.instance.table.action.column");
"authentication.instance.table.create.button");
"authentication.instance.table.delete.button");
}
/*
* Responsible for creating the model used for the authentication instances
* configurations.
*/
private void createConfigurationTable() {
"authentication.configuration.table.name.column");
"authentication.configuration.table.action.column");
"authentication.configuration.table.create.button");
"authentication.configuration.table.delete.button");
}
/*****************************************************************
*
* Event handlers
*
*****************************************************************/
/**
* Handles new authentication configuration request.
*
* @param event Request Invocation Event.
*/
public void handleAdvancedOptionButtonRequest(
) throws ModelControlException {
getViewBean(CoreAttributesViewBean.class);
}
/**
* Handles new authentication configuration request.
*
* @param event Request Invocation Event.
*/
public void handleCreateConfigButtonRequest(
) throws ModelControlException {
getViewBean(NewAuthConfigViewBean.class);
}
/**
* Handles the delete authentication instance request.
*
* @param event Request Invocation Event.
*/
public void handleDeleteConfigButtonRequest(
) throws ModelControlException
{
}
try {
getRequestContext().getRequest());
}
"authentication.config.deleted");
} else {
"authentication.config.deleted.multiple");
}
} catch (AMConsoleException e) {
e.getMessage());
}
forwardTo();
}
/**
* Handles the new authentication instance request.
*
* @param event Request Invocation Event.
*/
public void handleCreateInstanceButtonRequest(
) {
getViewBean(NewAuthInstanceViewBean.class);
}
/**
* Handles the delete authentication instance request.
*
* @param event Request Invocation Event.
*/
public void handleDeleteInstanceButtonRequest(
) throws ModelControlException
{
}
try {
/*
* There is a timing issue with the backend after an
* instance is deleted causing the UI to be out of synch with the
* backend. We are storing the instances removed to be used when
* the page is redrawn to ensure the deleted instances are not
* put back into the instance table.
*/
"authentication.instance.deleted");
} else {
"authentication.instance.deleted.multiple");
}
} catch (AMConsoleException e) {
e.getMessage());
}
forwardTo();
}
/**
* Handles save button request.
*
* @param event Request invocation event
*/
throws ModelControlException
{
try {
"authentication.profile.updated");
} catch (AMConsoleException a) {
}
forwardTo();
}
/**
* Handles reset request.
*
* @param event Request invocation event
*/
forwardTo();
}
/**
* Handles the edit authentication instance request.
*
* @param event Request Invocation Event.
*/
public void handleActionColumnHREFRequest(
) throws ModelControlException
{
forwardTo();
} else {
/*
* EditAuthTypeViewBean displays the properties for the auth
* instance selected. We need to set the current profile value
* to be the name of the current realm. Current Profile is use
* by AMServiceProfileViewBeanBase.getPropertySheetXML() when
* building the page.
*/
getViewBean(EditAuthTypeViewBean.class);
}
}
/**
* Handles the edit authentication configuration request.
*
* @param event Request Invocation Event.
*/
public void handleConfigActionColumnHREFRequest(
) throws ModelControlException
{
getViewBean(AuthConfigViewBean.class);
}
throws NavigationException
{
// set the realm selected in the parentage path in the model.
m.setCurrentRealm(tmp);
super.forwardTo(reqContext);
}
}