AMServiceProfileViewBeanBase.java revision 44533057912ac5c4bca52935b8fbc8e6d59d0671
/**
* 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: AMServiceProfileViewBeanBase.java,v 1.3 2009/11/10 04:16:17 bhavnab Exp $
*
*/
public abstract class AMServiceProfileViewBeanBase extends DynamicRequestViewBean {
protected CCPageTitleModel ptModel;
protected boolean initialized;
protected boolean submitCycle;
protected AMPropertySheetModel propertySheetModel;
protected String serviceName;
/**
* Creates a service profile view bean.
*
* @param name Name of view bean.
* @param url Default display URL.
* @param serviceName Name of service.
*/
public AMServiceProfileViewBeanBase(
) {
super(name);
if (serviceName != null) {
}
}
super.setRequestContext(rc);
if (serviceName != null) {
}
}
if (!initialized) {
initialized = true;
this.serviceName = serviceName;
}
}
protected void registerChildren() {
super.registerChildren();
ptModel.registerChildren(this);
if (propertySheetModel != null) {
}
}
} else if ((propertySheetModel != null) &&
) {
} else {
}
return view;
}
public void setSubmitCycle(boolean cycle) {
submitCycle = cycle;
}
protected boolean isSubmitCycle() {
return submitCycle;
}
throws ModelControlException
{
super.beginDisplay(event);
if (propertySheetModel != null) {
if (!submitCycle) {
}
}
} else {
disableButton("button1", true);
disableButton("button2", true);
"propertysheet.no.attributes.message");
}
}
return (propertySheetModel != null);
}
protected AMModel getModelInternal() {
try {
return new AMServiceProfileModelImpl(
} catch (AMConsoleException e) {
e.getMessage());
}
return null;
}
protected void createPageTitleModel() {
}
protected void createTwoButtonPageTitleModel() {
ptModel = new CCPageTitleModel(
getModel();
}
}
protected void createThreeButtonPageTitleModel() {
ptModel = new CCPageTitleModel(
getModel();
}
}
/*
* Overridden in the following classes
*/
protected String getBackButtonLabel() {
return getBackButtonLabel("breadcrumbs.services.config");
}
protected void createPropertyModel() {
try {
} catch (AMConsoleException e) {
e.getMessage());
}
}
}
throws AMConsoleException {
}
/**
* Handles save request.
*
* @param event Request invocation event.
*/
throws ModelControlException
{
submitCycle = true;
try {
"message.updated");
} catch (AMConsoleException e) {
e.getMessage());
}
}
forwardTo();
}
/**
* Handles reset request.
*
* @param event Request invocation event
*/
throws ModelControlException
{
forwardTo();
}
{
}
return values;
}
/**
* Dervived class can overwrite this method to alter attribute values
* before are the saved.
*
* @return true to proceed with saving attribute values.
*/
return true;
}
/**
* Dervived class can overwrite this method to perform some necessary
* tasks before reseting profile.
*/
protected void onBeforeResetProfile() {
}
submitCycle = true;
try {
} catch (IOException e) {
forwardTo();
}
} else {
forwardTo();
}
}
// Not used here and not required for all sub classes
}
if (propertySheetModel == null) {
return Collections.emptyMap();
}
@SuppressWarnings("unchecked")
}
return convertedValueMap;
}
protected Map getAttributeValues() {
}
protected String getServiceNameForAccessControl() {
return serviceName;
}
}