public static ModelObject buildModelObject(UIComponent uiComponent) {
ModelObject model = null;
if (uiComponent instanceof UIPortal) {
model = toPortal((UIPortal) uiComponent);
} else if (uiComponent instanceof UIPageBody) {
model = new PageBody(((UIPageBody) uiComponent).getStorageId());
} else if (uiComponent instanceof UIPage) {
model = toPageModel((UIPage) uiComponent);
} else if (uiComponent instanceof UIPortlet) {
model = toPortletModel((UIPortlet<Object, ?>) uiComponent);
} else if (uiComponent instanceof UIContainer) {