UIWorkingWorkspace uiWorkingWS = uiPortalApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
UIEditInlineWorkspace uiEditWS = uiWorkingWS.getChild(UIEditInlineWorkspace.class);
uiEditWS.getComposer().setEditted(false);
uiEditWS.setRendered(false);
uiWorkingWS.setRenderedChild(UIPortalApplication.UI_VIEWING_WS_ID);
prContext.ignoreAJAXUpdateOnPortlets(true);
UISiteBody siteBody = uiWorkingWS.findFirstComponentOfType(UISiteBody.class);
UIPortal uiPortal = uiWorkingWS.getBackupUIPortal();
siteBody.setUIComponent(uiPortal);