Hi Chris,
Event/activities stream Web part currently shows only the activities of the active users and users in his social network (the display of the events for the active user can be turned off, so only a list of activities of his friends is shown). By default it cannot show all activities without filtering them, but it is relatively easy to achieve by implementing a custom Web part based on the default MonoX event.ascx Web part.
You would have to know how to open a custom MonoX project and add Web parts and other classes to it. There are quite a few tutorials on this topic in our blog section, and you should check these two:
http://www.mono-software.com/blog/post/Mono/95/Building-a-custom-ASP-NET-project-based-on-MonoX/ and
http://www.mono-software.com/blog/post/Mono/93/Building-a-custom-Web-part/
There are several steps in this process:
1. make your own repository by inheriting from the MonoSoftware.MonoX.Repositories.EventRepository and add the following method. Its behavior is similar to the original GetEvents method, but does not filter anything:
public
virtual
EntityCollection<SnEventEntity> GetEvents(
int
numberOfEvents)
{
EntityCollection<SnEventEntity> events =
new
EntityCollection<SnEventEntity>(
new
SnEventEntityFactory());
IPrefetchPath2 prefetchPath =
new
PrefetchPath2(EntityType.SnEventEntity);
prefetchPath.Add(SnEventEntity.PrefetchPathFriendAspnetUsers);
prefetchPath.Add(SnEventEntity.PrefetchPathBlogPost);
prefetchPath.Add(SnEventEntity.PrefetchPathSnAlbum);
prefetchPath.Add(SnEventEntity.PrefetchPathSnFile);
prefetchPath.Add(SnEventEntity.PrefetchPathSnGroup);
prefetchPath.Add(SnEventEntity.PrefetchPathAspnetUsers).SubPath.Add(AspnetUsersEntity.PrefetchPathUserProfile);
prefetchPath.Add(SnEventEntity.PrefetchPathSnDiscussionBoard);
prefetchPath.Add(SnEventEntity.PrefetchPathSnDiscussionTopic);
ISortExpression sortExpression =
new
SortExpression(
new
SortClause(SnEventFields.DateCreated,
null
, SortOperator.Descending));
FetchEntityCollection(events,
null
, numberOfEvents, sortExpression, prefetchPath);
return
events;
}
2. make your own custom Web part by inhering from the MonoSoftware.MonoX.ModuleGallery.SocialNetworking.Events. Override the BindData methid like this:
public
override
void
BindData()
{
MonoXCacheManager cacheManager = MonoXCacheManager.GetInstance(CacheKeys.Events.EventList,
this
.CacheDuration);
EventRepository repository = EventRepository.GetInstance();
Guid userId =
this
.UserId;
if
(userId == Guid.Empty)
userId = SecurityUtility.GetUserId();
EntityCollection<SnEventEntity> events = cacheManager.Get<EntityCollection<SnEventEntity>>(
this
.NumberOfEventsToShow);
if
(events ==
null
)
{
events = repository.GetEvents(
this
.NumberOfEventsToShow);
cacheManager.Store(events,
this
.NumberOfEventsToShow);
}
if
(events !=
null
)
{
lvItems.DataSource = events;
lvItems.DataBind();
}
}
You can now place the inherited Web part wherever you want.
As for the "like" functionality, we will try to put together a small sample soon. The infrasctucture is ready for it, as the existing rating functionality (as seen here in the discussion forum and in the blog page) is basically a more complex version of it.