Long targetLimit = null;
if (limit != null) {
targetLimit = limit.longValue();
}
SocialWorkspace socialWorkspace = socialWorkspaceService.getDetachedSocialWorkspace(
session, new PathRef(contextPath));
Locale locale = language != null && !language.isEmpty() ? new Locale(
language) : Locale.ENGLISH;
Map<String, Serializable> props = new HashMap<String, Serializable>();
props.put(SOCIAL_WORKSPACE_ID_PROPERTY, socialWorkspace.getId());
props.put(REPOSITORY_NAME_PROPERTY,
socialWorkspace.getDocument().getRepositoryName());
props.put(LOCALE_PROPERTY, locale);
props.put(CORE_SESSION_PROPERTY, (Serializable) session);
props.put(ACTIVITY_LINK_BUILDER_NAME_PROPERTY, activityLinkBuilder);
PageProvider<ActivityMessage> pageProvider = (PageProvider<ActivityMessage>) pageProviderService.getPageProvider(
PROVIDER_NAME, null, targetLimit, 0L, props);