MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

GroupCategory  (Mono Support )

Viewed 14402 time(s), 6 post(s) 12/23/2010 9:56:56 AMby Alby
Alby

Alby

12/23/2010 9:56:56 AM
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
This content has not been rated yet. 
0 Reputation 4 Total posts
denis

denis

12/23/2010 6:14:29 PM
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.
This content has not been rated yet. 
7207 Reputation 956 Total posts
Alby

Alby

1/4/2011 11:29:32 AM
Oh yes, it would be very useful, thank you
This content has not been rated yet. 
0 Reputation 4 Total posts
denis

denis

2/15/2011 12:51:03 PM
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.
Rated 5.00, 1 vote(s). 
7207 Reputation 956 Total posts
Alby

Alby

1/11/2011 9:12:52 AM
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?
This content has not been rated yet. 
0 Reputation 4 Total posts
denis

denis

2/15/2011 12:51:25 PM
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.
This content has not been rated yet. 
7207 Reputation 956 Total posts