* @param formName of the form whose fragmentation state should be updated
* @return String current form fragment name. May be null.
*/
public String updateFormFragmentationState(String formName) {
FragmentationState state = null;
getPageGenerationCache().createFormFragmentationStates(formName);
MarinerURL localRequestURL = getRequestURL(false);
String value = localRequestURL.getParameterValue("vffrag");
if (value == null) {
if (logger.isDebugEnabled()) {
logger.debug("No form fragmentation state.");
}
} else {
if (logger.isDebugEnabled()) {
logger.debug("Getting form fragmentation states for value " +
value);
}
state = pageGenerationCache.getFormFragmentationState(formName,
value);
formFragmentationStates.put(formName, state);
}
// Get the page identifier, this is the String which we use to
// check whether the page being included in a region is the same as the
// page which was in the region when the fragmentation occurred. For
// now we use the layout name as we know that if the layouts are the
// same name then the fragmentation name will still be valid.
String pageIdentifier = getDeviceLayout().getName();
if (logger.isDebugEnabled()) {
logger.debug("Updating form fragment for page identifier "
+ pageIdentifier + " with parameters "
+ localRequestURL.getQuery());
}
String inclusionPath = getInclusionPath();
if (logger.isDebugEnabled()) {
logger.debug("FormFragmentation state for " + inclusionPath
+ "(" + pageIdentifier + ") "
+ " parameters " +
localRequestURL.getQuery() +
" is " +
state);
// Get the fragment for the current region and page identifier.
}
String formFragmentName = null;
if (state != null) {
formFragmentName = state.getFragmentName(inclusionPath, pageIdentifier);
}
if (logger.isDebugEnabled()) {
logger.debug("Current form fragment in region " +
getInclusionPath() + " is " + formFragmentName);