YAFLogo

nucholsh
  • nucholsh
  • 52.4% (Neutral)
  • YAF Forumling Topic Starter
12 years ago
I have an MVC4 and a YAF site that I have completely merged. It was not that had hard after I found the right references. The key was to start with the YAF site, and pull in he MVC site.

http://www.hanselman.com/blog/PlugInHybridsASPNETWebFormsAndASPMVCAndASPNETDynamicDataSideBySide.aspx 

Anyway, the MVC website is really the main part of application. Users create accounts (YAF membership accounts) and then create reports and data. Do calculations. etc... Finally they produce reports that they want to share these in a forum. They only want to share these with other users of this same website. But it needs to be in a full feature forum. That is why I am using YAF. I did not want to redirect to another another website, that is why I did the merge. LOTS of advantages.

NOW, I need to create a new Topic in a specific Forum of the YAF portion of my application. I have already all of my forums, and I have a specific forum that I want to use. When the user presses a button to share their report on one of my pages I want to do the following.

1) Create a new Topic

2) Create Attachments

3) Append attachments to topic

4) Get the Topic Id for the new Topic or get a link to the new topic

Is there an API reference you can point me to please?

Or just help me get started.

Since the MVC side of the application uses the same membership provider, I have the same ownerId and everything else I need. I just don't know where to start.

My VS2010 solution looks just like the default that everyone downloads, but my website has all the MVC stuff (Controllers, Views, Models, global.asax, etc...).

Thanks

Sponsor
Jaben
  • Jaben
  • 100% (Exalted)
  • YAF Developer
12 years ago
Take a look at the existing YafWebService.

Source code here:

http://yafnet.codeplex.com/SourceControl/changeset/view/b5858975b5dc#yafsrc%2fYetAnotherForum.NET%2fClasses%2fYafWebService.cs 

YourForum.com/YafWebService.asmx

There is a function called CreateNewTopic that requires a token (set in the Host Settings) to call.

It does not support attachments. But in the /pages/attachments.aspx.cs file you can find the code to add attachments to the web service.

Nice you're mixing MVC and YAF.NET. My goal is to get the whole project into two parts: SocialWebAPI (leaning towards ServiceStack) and YAF.NET will become an independent (and MIT licensed) layer on that API.

nucholsh
  • nucholsh
  • 52.4% (Neutral)
  • YAF Forumling Topic Starter
12 years ago
That should be all I need. Thanks.

I love YAF.

I am glad it is accessiable too.

http://www.forum-software.org/yet-another-forum/review 

Thanks.

Zero2Cool
  • Zero2Cool
  • 100% (Exalted)
  • YAF Leader YAF Version: YAF 3.1.16
12 years ago

That should be all I need. Thanks.

I love YAF.

I am glad it is accessiable too.

http://www.forum-software.org/yet-another-forum/review 

Thanks.

Originally Posted by: nucholsh 

Jaben, not critical or anything, but the link has the Last Version as 1.9.4 RC1 (December 8, 2009)

Jaben
  • Jaben
  • 100% (Exalted)
  • YAF Developer
12 years ago

That should be all I need. Thanks.

I love YAF.

I am glad it is accessiable too.

http://www.forum-software.org/yet-another-forum/review 

Thanks.

Originally Posted by: Zero2Cool 

Jaben, not critical or anything, but the link has the Last Version as 1.9.4 RC1 (December 8, 2009)

Originally Posted by: nucholsh 

Not sure why that was posted... wasn't my link. Yeah, that's an old version.

Zero2Cool
  • Zero2Cool
  • 100% (Exalted)
  • YAF Leader YAF Version: YAF 3.1.16
12 years ago

That should be all I need. Thanks.

I love YAF.

I am glad it is accessiable too.

http://www.forum-software.org/yet-another-forum/review 

Thanks.

Originally Posted by: Jaben 

Jaben, not critical or anything, but the link has the Last Version as 1.9.4 RC1 (December 8, 2009)

Originally Posted by: Zero2Cool 

Not sure why that was posted... wasn't my link. Yeah, that's an old version.

Originally Posted by: nucholsh 

My mistake, I thought you could edit that. Sorry.

pskaushik
11 years ago
Hi,

Please let me know how to get token id for create new topic. I am in need to call this webmethod from my windows service. So I do not have YAF context there.

Thanks

Pushpendra

pskaushik
11 years ago
Ok Got it under Host settings in yaf UI .

Thanks

Pushpendra

Zero2Cool
  • Zero2Cool
  • 100% (Exalted)
  • YAF Leader YAF Version: YAF 3.1.16
11 years ago
I used the stored procedure for yaf_topic_save (I might have that wrong, but you will know it when you see it). Worked great for me.