docView.setDocumentLocation(new DocumentLocationImpl(
session.getChild(doc.getRef(), "social")));
docView.setViewId("dashboard");
} else {
TypeManager typeService = Framework.getLocalService(TypeManager.class);
Type type = typeService.getType(doc.getType());
if (doc.hasFacet(FacetNames.FOLDERISH)
|| (!typeService.getAllowedSubTypes(SOCIAL_WORKSPACE_TYPE).contains(
type) && !typeService.getAllowedSubTypes(
NEWS_ITEM_ROOT_TYPE).contains(type))) {
docView.setViewId(type.getDefaultView());
docView.addParameter("tabIds", "MAIN_TAB:documents");
}
}
return docView;
}