Mono Support GroupCategory 

Viewed 23676 time(s), 6 post(s), 12/23/2010 9:56:56 AM - by Alby
12/23/2010 9:56:56 AM
0 Reputation 4 Total posts

Do you know if there is a way to have a page with a [b]list of all categories [/b]of groups (not only the account subscriptions, a kind of sitemap for category), and a way to [b]show all groups of a category [/b]and not only the ones you are joined?
I know the trick of using a "blank" search but...

thanx
Alby

1
12/23/2010 6:14:29 PM
7207 Reputation 956 Total posts

Hi Alby,
This would require a bit of programming - we can send you the code sample (it is really simple) if you already know the basics of working with MonoX Web parts.

2
1/4/2011 11:29:32 AM
0 Reputation 4 Total posts

Oh yes, it would be very useful, thank you

3
2/15/2011 12:51:03 PM
7207 Reputation 956 Total posts

Hi,
After I went through your intial question again I realized that MonoX already includes a part that lists all groups of a category - it is a part that is already present on the groups page and is located in the MonoX/ModuleGallery/SocialNetworking/Groups/GroupList.ascx
You just need to pass the category name to it via its URL: http://monox.mono-software.com/MonoX/Pages/SocialNetworking/Groups/GroupCategory/Software-development/ where the "slug" of your category is Software development (slugs are automatically generated when a category is created), URL format can be controlled through the web.config settings.

As for the list of all categories, you just need to put an ordinary repeater in your custom Web part and bind it to the list of categories that is returned by the GetGroupCategories() methods in the GroupRepository class - you could also use its overload that offers a complete control over the filtering and paging features. From the top of my head, your data binding method would contain something like this:

EntityCollection<SnGroupCategoryEntity> categories = GroupRepository.GetInstance().GetGroupCategories();
rptCategories.DataSource = categories;
rptCategories.DataBind();


All properties and methods of the SnGroupCategoryEntity are exposed by IntelliSense in VS.

4
1/11/2011 9:12:52 AM
0 Reputation 4 Total posts

Hi Denis,
You are right, going here [url=http://monox.mono-software.com/MonoX/Pages/SocialNetworking/Groups/GroupCategory/Software-development/]http://monox.mono-software.com/.../GroupCategory/Software-development/[/url] I see all the groups connected with this category, but if you are logged in, you'll see only the one you have subscribed; so, if you are a new user it seems that the category is empty.
Could I have a list all the groups of a category even if i'm logged in and have no sobscriptions?

5
2/15/2011 12:51:25 PM
7207 Reputation 956 Total posts

Hi Alby,
That is correct, the default behavior is to show only the groups that the active user is a member of. You can use other methods from the GroupRepository class to show categories with your custom filter criteria. For example, the following method signature

public List<SnGroupDTO> GetGroups(Guid userId, string category, Guid categoryId, string searchValue, bool useFullTextIndex, int pageNumber, int pageSize, out int recordCount)


shows all groups for a user with a specific UserId. If you set this parameter to Guid.Empty and pass the category ID or category name, you will get all groups in a requested category. Again, the list of SnGroupDTO can be bound to your repeater or any other similar control.

6
This is a demo site for MonoX. Please visit Mono Software for more info.