DynamicRequestViewBean.java revision 582e60f5478cf04cad2b208c3e8013fef3617942
/*
* 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 legal/CDDLv1.0.txt. See the License for the
* specific language governing permission and limitations under the License.
*
* When distributing Covered Software, include this CDDL Header Notice in each file and include
* the License file at 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 copyright [year] [name of copyright owner]".
*
* Copyright 2015 ForgeRock AS.
*/
/**
* This view bean handles dynamic requests made from the client.
*
* @since 13.0.0
*/
public abstract class DynamicRequestViewBean extends AMPrimaryMastHeadViewBean {
protected boolean dynamicRequest = false;
protected AMPropertySheetModel propertySheetModel;
/**
* Creates an instance of {@link DynamicRequestViewBean}.
*
* @param name Name of page.
*/
super(name);
}
/**
* Extract the URL for the dynamic link and pass it to subclass to handle the link request.
*
* @param event Request invocation event.
*/
setDynamicRequest(false);
forwardTo();
} else {
}
}
/**
* Populate the requested URL with the realm and pass it to subclass to handle the link request.
*
* @param event Request invocation event.
*/
handleDynamicLinkRequest(MessageFormat.format(request.getParameter("url"), getCurrentRealmEncoded(), ""));
}
/**
* Populate the requested URL with the realm and ID of the attribute to edit, then pass it to subclass
* to handle the link request.
*
* @param event Request invocation event.
*/
String attrValue = CollectionHelper.getMapAttr(getAttributeValueMap(), request.getParameter("attrname"));
handleDynamicLinkRequest(MessageFormat.format(request.getParameter("url"), getCurrentRealmEncoded(), attrValue));
}
/**
* Store the unsaved attributes and reload the page.
*
* @param event Request invocation event.
*/
setDynamicRequest(true);
forwardTo();
}
private void setDynamicRequest(boolean dynamic) {
// Store the current attribute values from the UI to render when beginDisplay is called
}
/**
* Handle the appropriate dynamic link request.
*
* @param url The URL to link to.
*/
/**
* Get the current (could be unsaved) attribute values for the view bean.
*
* @return the attribute values
*/
}