AMViewBeanBase.java revision f48118365a7f4f1240516dbe66e47b24a896ff16
/**
* 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]"
*
* $Id: AMViewBeanBase.java,v 1.15 2009/10/19 18:17:33 asyhuang Exp $
*
* Portions Copyrighted 2011-2016 ForgeRock AS.
*/
/**
* This is the base class for all view beans in Console.
*/
public abstract class AMViewBeanBase extends ConsoleViewBeanBase {
protected boolean initialized = false;
private boolean pageSessionInSessionStore = false;
static {
}
/**
* Creates an instance of base view bean object
*
* @param name of page
*/
super(name);
}
throws NavigationException {
initialize();
}
super.setRequestContext(context);
}
initialize();
}
protected void initialize() {
}
/**
* Registers user interface components used by this view bean.
*/
protected void registerChildren() {
}
/**
* Creates user interface components used by this view bean.
*
* @param name of component
* @return child component
*/
} else {
throw new IllegalArgumentException(
}
return view;
}
/**
* Picks up page session information for request and update page session
* map.
*
* @param context request context
*/
try {
}
}
} catch (ClassNotFoundException e) {
} catch (IOException e) {
}
}
}
/**
* Gets current charset
*
* @param model object
* @return current charset
*/
return jCharset;
}
throws ModelControlException
{
super.beginDisplay(event);
}
/**
* Pass session attribute map to other view bean
*
* @param other view bean
*/
}
/**
* Pass session attribute map to other view bean
*
* @param other view bean
* @param attributes Map of attribute name to values.
*/
}
}
}
/**
* Returns model for this view bean.
* Dervived class need to implement this method.
*
* @return model for this view bean.
*/
}
return dataModel;
}
/**
* Set inline alert message.
*
* @param type Type of message such as Error, Warning, etc.
* @param title Title of message.
* @param message Message.
* @param encode Should the message be encoded for HTML.
*/
if (encode) {
} else {
}
}
/**
* Set inline alert message.
*
* @param type Type of message such as Error, Warning, etc.
* @param title Title of message.
* @param message Message.
*/
}
/**
* Returns true if inline alert message is set.
*
* @return true if inline alert message is set.
*/
protected boolean isInlineAlertMessageSet() {
}
// Hacks -------------------------------------------------------------------
/**
* Overwriting this map so that we correct the set value for
* OpenSSO's proprietory taglib component,
* <code>SerializedField</code>. Without doing this, string value
* will be set to the value of this component, this is incorrect
* because the string value of this component is actually
* a serialized string of the value. Doing a <code>setValue</code>
* on this component will serialize the original twice and thus
* this component returns incorrect value in the execution cycle.
*
* @param field Display field.
* @param childValues Values of child component.
*/
{
if (field instanceof SerializedField) {
}
} else {
}
}
// Abstract Methods --------------------------------------------------------
/**
* Returns model for this view bean.
* Dervived class need to implement this method.
*
* @return model for this view bean.
*/
protected abstract AMModel getModelInternal();
// End of Abstract Methods ------------------------------------------------
/**
* Returns a option list object that contains options for a given map
* of value to its localized string.
*
* @param map Map of value to its localized string.
* @return a option list object that contains options for a given map
* of value to its localized string.
*/
}
}
return optionList;
}
/**
* Returns a option list object that contains options for a given map
* of value to its localized string.
*
* @param map Map of value to its localized string.
* @return a option list object that contains options for a given map
* of value to its localized string.
*/
}
}
return optionList;
}
/**
* Returns an option list object that contains options for a given
* collection of string.
*
* @param collection Collection of strings to be included in option list.
* @param locale Locale defining how the entries should be sorted.
* @return a option list object that contains options for a given
* collection of string.
*/
public static OptionList createOptionList(
) {
}
/**
* Returns an option list object that contains options for a given
* collection of string.
*
* @param collection Collection of strings to be included in option list.
* @return a option list object that contains options for a given
* collection of string.
*/
// first sort the entries in the collection
}
}
return optionList;
}
/**
* Returns an option list object that contains options for a given
* collection of string.
*
* @param collection Collection of strings to be included in option list.
* @param locale Locale defining how the entries should be sorted.
* @param bSort <code>true</code> to sort the options.
* @return a option list object that contains options for a given
* collection of string.
*/
public static OptionList createOptionList(
boolean bSort
) {
if (bSort) {
}
}
}
return optionList;
}
/**
* Returns a set of string from a option list items.
*
* @param optList Option list that contains the items.
* @return Set of string from a option list items.
*/
set = new OrderedSet();
for (int i = 0; i < sz; i++) {
}
}
}
/**
* Returns a list of string from a option list items.
*
* @param optList Option list that contains the items.
* @return list of string from a option list items.
*/
for (int i = 0; i < sz; i++) {
}
return list;
}
/**
* Appends page session string to URL
*
* @param url Target URL
*/
} else {
}
.append("=")
}
private String encodePageSessionMap() {
try {
} catch (IOException e) {
}
return encoded;
}
}
}
protected String getCharset() {
}
protected String getContentType() {
return content_type;
}
}
/**
* Does nothing, just forwards to the same view bean
*
* @param event - request invocation event
*/
forwardTo();
}
/**
* Reset the view bean.
*/
public void resetView() {
}
}
/**
* Set location DN
*
* @param dn
*/
}
}
/**
* Gets the current location DN.
*
* @return location DN
*/
public String getCurrentLocationDN() {
return (String)getPageSessionAttribute(
}
/**
* Gets the name of the current location.
*
* @return name of location
*/
public String getCurrentLocation() {
}
return tmp;
}
/**
* Hides the selection checkboxes in table.
*
* @param tableName Name of table.
*/
}
/**
* Returns a set of static text field' names that should be blanked.
* This field is a a action table as a label for a hyperlink. Blanking it
* out will hide the hyperlink accordingly.
*
* @return Set of static text field' names that should be blanked.
*/
public Set getBlankTextFields() {
return blankTextFields;
}
/**
* Includes a static text field that should be blanked. This field
* is a a action table as a label for a hyperlink. Blanking it out
* will hide the hyperlink accordingly.
*
* @param name Name of static text field.
*/
}
/* Delegation *************************************************************/
protected void performDelegationTasks() {
getServiceNameForAccessControl(), getModel(), this);
}
boolean display = false;
try {
} catch (IllegalAccessException e) {
} catch (InvocationTargetException e) {
}
} else {
super.endDisplay(event);
}
return display;
}
try {
} catch (NoSuchMethodException e) {
// Do nothing. OK to not find a begin display method for the child.
} catch (SecurityException e) {
// Do nothing. OK to not find a begin display method for the child.
}
return method;
}
protected String getServiceNameForAccessControl() {
return null;
}
public AMViewBeanBase getCallingView() {
return null;
} else {
try {
return vb;
} catch (ClassNotFoundException cnfe) {
return null;
}
}
}
public Locale getUserLocale() {
}
public String getPageSessionAttributeString() {
if (pageSessionInSessionStore) {
pageSessionInSessionStore = false;
strAttr = super.getPageSessionAttributeString();
pageSessionInSessionStore = true;
} else {
strAttr = super.getPageSessionAttributeString();
/*
* We are storing the SSOToken ID because it is needed to
* retrieve the page session map later on. We cannot call
* getModel().getUserSSOToken() because the model may depend on
* the page session map for initialization. This avoids getting
* into a chicken or the egg problem.
*/
super.setPageSessionAttributes(tmp);
strAttr = super.getPageSessionAttributeString();
pageSessionInSessionStore = true;
}
}
return strAttr;
}
protected void deserializePageAttributes() {
super.deserializePageAttributes();
pageSessionInSessionStore = false;
// store can be null, if sso token has expired.
super.setPageSessionAttributes(savedAttr);
}
}
}
if (pageSessionInSessionStore) {
.getTokenID().toString();
} else {
super.setPageSessionAttributes(value);
}
}
protected Map getPageSessionAttributes() {
if (pageSessionInSessionStore) {
.getTokenID().toString();
} else {
attributes = super.getPageSessionAttributes();
}
return attributes;
}
protected void redirectToStartURL() {
AMAdminFrameViewBean.class);
}
/**
* The Page Session Store will be created if a ViewBean's page session
* size exceeds MAX_PG_SESSION_SIZE, which is currently set to little
* less than 2KB.
*/
private static class SessionStore {
try {
}
} catch(SSOException ssoe) {
}
}
};
try {
} catch (SSOTokenListenersUnsupportedException ex) {
} catch(SSOException ssoe) {
}
}
return store;
}
}
}
/**
* Creates the label used to take the user back to the previous page
* they were viewing. The label is defined in the property file as
* "Back to {0}" which lets us control the format of the label in
* different locales. If the label passed in cannot be found it will
* use the default value of "previous view".
*/
}
return MessageFormat.format(
}
protected String getCurrentRealm() {
}
return curRealm;
}
/**
* Get the current realm, encoded as a path element.
*
* @return The current realm encoded as a path element.
*/
protected String getCurrentRealmEncoded() {
}
// this builds a display string only
}
}
while (st.hasMoreTokens()) {
}
}
}
protected String getRequestURL() {
}
for (int i = 0; i < len; i++) {
}
}
if (c <= 0x7E) {
} else {
}
}
}
while (idx != -1) {
boolean done = false;
if (idx > 0) {
done = true;
}
}
if (!done) {
.append(
}
}
}
}