SocialWorkspaceContainerDescriptor socialWorkspaceContainer = socialWorkspaceService.getSocialWorkspaceContainerDescriptor();
DocumentRef docRef = new PathRef(socialWorkspaceContainer.getPath());
if (!session.exists(docRef)) {
Path path = new Path(socialWorkspaceContainer.getPath());
String parentPath = path.removeLastSegments(1).toString();
String name = path.lastSegment();
DocumentModel container = session.createDocumentModel(
parentPath, name, SOCIAL_WORKSPACE_CONTAINER_TYPE);
container.setPropertyValue(DC_TITLE,
socialWorkspaceContainer.getTitle());