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.

Popular Discussion Post List and Popular Blog Post List  (Mono Support )

Viewed 14955 time(s), 10 post(s) 12/3/2013 6:24:41 AMby bkkmono
bkkmono

bkkmono

12/3/2013 6:28:09 AM
Hello,

I want to create custom web parts of Popular Discussion Post List and Popular Blog Post List so that I would use them on the font page of my MonoX website. I tried to read this example: http://www.mono-software.com/blog/post/Mono/93/Building-a-custom-Web-part/, it is a tutorial of creating a custom web part for the popular group list but I don't get how to use the example to create my own web parts of popular discussion post list and popular blog post list.

Could any MonoX's staff provide me source codes of custom web parts to display Popular Discussion Post List and Popular Blog Post List?
This content has not been rated yet. 
434 Reputation 51 Total posts
iruzak

iruzak

12/3/2013 7:12:46 AM
Hi BKKMONO,
you should download our custom web part example from this link and use the same approach. You will have to write your own repository methods for fetching discussions and blogs.
Unfortunately we don't have source codes we could share.

Regards,
Igor 
This content has not been rated yet. 
443 Reputation 50 Total posts
bkkmono

bkkmono

12/4/2013 7:58:44 AM
In WebPartSample folder, 
HelloWorld.ascx inherits from MonoSoftware.MonoX.Samples.HelloWorld
PopularGroupsList.ascx inherits from MonoSoftware.MonoX.ModuleGallery.SocialNetworking.PopularGroupsList

And if I want to create my own custom web parts to display the popular discussion posts list and popular blog posts list, 
What classes must they inherit from?
This content has not been rated yet. 
434 Reputation 51 Total posts
iruzak

iruzak

12/4/2013 8:24:29 AM
Hi bkkmono,
you are reading it wrong.
This is from the example:
01.namespace MonoSoftware.MonoX.ModuleGallery.SocialNetworking
02.{
03.     
04.    public partial class PopularGroupsList : GroupListBasePart
05.    {
06. 
07.    }
08. 
09.}
PopularGroupsList inherits GroupListBasePart and has MonoSoftware.MonoX.ModuleGallery.SocialNetworking namespace. Because of that markup looks like this:
1.<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="PopularGroupsList.ascx.cs" Inherits="MonoSoftware.MonoX.ModuleGallery.SocialNetworking.PopularGroupsList" %>
In your case you should have your own project namespace. You can also create your own base class but it's not necessary because you can use standard ASP.NET classes or MonoX base classes (BasePage, BaseUserControl, BaseAutoRegisterPart, BasePart etc.).
This content has not been rated yet. 
443 Reputation 50 Total posts
bkkmono

bkkmono

12/6/2013 1:04:56 PM
In the method lvItems_OnItemDataBound of PopularGroupsList web part, it uses SnGroupDTO as a data transfer object for the group entity.
If I would create a PopularDiscussionPostsList web part, 
What data transfer object should I use? Please advice me.
This content has not been rated yet. 
434 Reputation 51 Total posts
iruzak

iruzak

12/6/2013 1:26:58 PM
You can use SnDiscussionMessageEntity.

Regards,
Igor
This content has not been rated yet. 
443 Reputation 50 Total posts
bkkmono

bkkmono

12/6/2013 2:04:34 PM
thank you but sorry, i am a new. I don't find SnDiscussionMessageEntity in MonoX API
This content has not been rated yet. 
434 Reputation 51 Total posts
bkkmono

bkkmono

12/7/2013 5:44:05 AM
I gave up to create my own web parts because it is hard for a beginner to start developing without any useful tutorials.

I suggest you, if you would like to have more volunteer developers to develop MonoX, you should provide more tutorials.

Additionally, please provide additional build-in web parts in the next version of MonoX and I hope you would also include a popular blog web part and popular discussion post web part.
This content has not been rated yet. 
434 Reputation 51 Total posts
khorvat

khorvat

12/9/2013 8:28:16 AM
Hi,

"I gave up to create my own web parts because it is hard for a beginner to start developing without any useful tutorials."
- building MonoX WebParts is pretty straight forward as building standard ASP.NET UserControls, everything related to MonoX is exposed in the Online API documentation. Entity mentioned in the IRuzak post is placed in DAL (Data Access Layer) which is pretty standard and completely open sourced on GitHub. You can also check MonoX architecture articles that explain MonoX layers etc.

"I suggest you, if you would like to have more volunteer developers to develop MonoX, you should provide more tutorials."
- there are few tutorials on how to build WebParts, custom solutions based on MonoX etc. in our blog section.
How to use Web parts in MonoX
Building a custom Web part
MonoX-Notification-Module (Open sourced)
MonoX-Twitter-Module (Open sourced)
etc.

"Additionally, please provide additional build-in web parts in the next version of MonoX and I hope you would also include a popular blog web part and popular discussion post web part."
- we are considering exposing a source code for few more WebParts to community on the GitHub but that will be decided on next few meetings before we push v4.9 out.

Next MonoX release will include the MonoX v5.1 BETA that will introduce the concept of IoC (Inversion of Control) & DI (Dependency Injection) to MonoX and the community. This will allow even more control of the code and simple tweaks in WebPart behavior would be much easier to accomplish.

I hope you can find the information above helpful and that you will give it one more shot.

Regards
MonoX-Notification-Module
This content has not been rated yet. 
15993 Reputation 2214 Total posts
bkkmono

bkkmono

12/9/2013 11:30:41 AM
Thanks for your suggestions.
This content has not been rated yet. 
434 Reputation 51 Total posts