}
}
private void restoreViewPhase()
{
phases.beforePhase(new PhaseEvent(facesContext, PhaseId.RESTORE_VIEW, MockLifecycle.INSTANCE));
try
{
UIViewRoot viewRoot = facesContext.getApplication().getViewHandler().createView(facesContext, getViewId());
facesContext.setViewRoot(viewRoot);
Map restoredViewRootAttributes = facesContext.getViewRoot().getAttributes();
if (conversationId != null)
{
if (isGetRequest())
{
setParameter(Manager.instance().getConversationIdParameter(), conversationId);
// TODO: what about conversationIsLongRunning????
}
else
{
if (conversationViewRootAttributes.containsKey(conversationId))
{
// should really only do this if the view id matches (not
// really possible to implement)
Map state = conversationViewRootAttributes.get(conversationId);
restoredViewRootAttributes.putAll(state);
}
}
}
if (isGetRequest())
{
facesContext.renderResponse();
}
else
{
restoredViewRootAttributes.putAll(pageParameters);
}
}
finally
{
phases.afterPhase(new PhaseEvent(facesContext, PhaseId.RESTORE_VIEW, MockLifecycle.INSTANCE));
}
}