Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some PostConnector (public API) improvements #11

Closed
roman-yagodin opened this issue Mar 23, 2017 · 8 comments
Closed

Some PostConnector (public API) improvements #11

roman-yagodin opened this issue Mar 23, 2017 · 8 comments

Comments

@roman-yagodin
Copy link

roman-yagodin commented Mar 23, 2017

Some nice things to have in public API:

  • Ability to customize IsPinned then calling SubmitExternalPost() - currently always False, and PostValidation() method is private.
  • Ability to get newly created post id somehow - e.g. to generate link to it. PostToDatabase() returns it, but it also private and heavily wrapped in PostValidation().
@juvander
Copy link
Member

Need to see, especially this new post id is buried quite deep.

juvander pushed a commit that referenced this issue Mar 23, 2017
@juvander
Copy link
Member

Added another SubmitExternalPost with IsPinned as a new parameter

@roman-yagodin
Copy link
Author

Wow, thanks for IsPinned - you are very kind! It will sure help with creating new forum post to discuss from external source!

About new post id: it could be resolved by returning some structure (or class) like that:

public struct SubmitPostResult
{
    public int PostId;
    public PostMessage PostMessage;
}

It can be extended in the future to have more fields to return. But surely it looks like major change in API.

Similar approach could be applied to pass parameters to SubmitExternalPost():

public struct SubmitPostParams
{
    public int TabId;
    public int ModuleId;
    public int ForumId;
    public int UserId;
    ...
    public List<Term> Terms;
}

public SubmitPostResult SubmitExternalPost (SubmitPostParams postParams);

@juvander
Copy link
Member

That was my idea as well, but yes, there is lots of places where this is checked. Need to review this carefully.

@juvander
Copy link
Member

Did a quick refactoring, see with this https://github.com/juvander/DotNetNuke-Forum/releases/tag/05.01.00_DNN8

@roman-yagodin
Copy link
Author

roman-yagodin commented Mar 24, 2017

Thanks, I'll check it.

@roman-yagodin
Copy link
Author

Seems to work as intended.

@juvander
Copy link
Member

Excellent!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants