{
if (log.isLoggable(Level.FINE)) log.fine("Exiting restoreTreeStructure - No tree structure state found in client request");
return null;
}
TreeStructureManager tsm = new TreeStructureManager();
uiViewRoot = tsm.restoreTreeStructure(treeStructure);
if (log.isLoggable(Level.FINEST)) log.finest("Tree structure restored from client request");
}
else
{
//reconstruct tree structure from ServletSession
Integer serverStateId = getServerStateId((Object[]) responseStateManager.getState(facesContext, viewId));
Object[] stateObj = (Object[])( (serverStateId == null)? null : getSerializedViewFromServletSession(facesContext, viewId, serverStateId) );
if (stateObj == null)
{
if (log.isLoggable(Level.FINE)) log.fine("Exiting restoreTreeStructure - No serialized view found in server session!");
return null;
}
SerializedView serializedView = new SerializedView(stateObj[0], stateObj[1]);
Object treeStructure = serializedView.getStructure();
if (treeStructure == null)
{
if (log.isLoggable(Level.FINE)) log.fine("Exiting restoreTreeStructure - No tree structure state found in server session, former UIViewRoot must have been transient");
return null;
}
TreeStructureManager tsm = new TreeStructureManager();
uiViewRoot = tsm.restoreTreeStructure(serializedView.getStructure());
if (log.isLoggable(Level.FINEST)) log.finest("Tree structure restored from server session");
}
if (log.isLoggable(Level.FINEST)) log.finest("Exiting restoreTreeStructure");
return uiViewRoot;