Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...DNN and Friendly urls everywhereDNN and Friendly urls everywhere
Previous
 
Next
New Post
10/12/2010 7:22 PM
 
Thanks David for pointing to the Active Forum custom solution.
Will seem to have adopted a strategy similar to ours.

However, he came out with a specific rewriting engine with its own reversing http module. And he's not the only one; as most 3rd party rewriting providers hardly account for module specifics, many module developers have started pushing their own rewriting engine.
We believe that this is going in the wrong direction and it could even harm the whole ecosystem while the native rewriter architecture gets increasingly hijacked in favor of custom module-specific solutions : our generic engine comes with an open interface that ease adding friendly urls capabilities to any module out there at no performance cost.
 
Below is for instance what it takes to implement a dedicated provider for the Dnn Core Forum; It's just about declaring the human readable groups mentioned in my earlier post, and implementing the corresponding computation of those SEO parts. I'm positive a similar provider for Active Forums would require less than 100 lines of code, it would provide all of the features that Will's new "vantity url" engine will bring and the many more, which come with our module.

Our vision is that module developers should stick dealing with real urls, while enabling human urls only requires implementing a similar provider.
Think of it like the IPortable or ISearchable of Url rewriting.

Public Class DnnForumUrlRewriter
        Implements IUrlRewriterProvider

        Public Function GetModuleRewrites() As List(Of GroupParamsRewrite) Implements IUrlRewriterProvider.GetRewrites
            Dim toReturn As New List(Of GroupParamsRewrite)
            Dim desc As String = "Name of the current forums' group browsed, filtered accordingly to the general parameters"
            toReturn.Add(New GroupParamsRewrite("GroupName", desc, RewriteType.SubPath, UrlParam.FromSyntax("groupid")))
            desc = "Name of the current forum browsed, or the current thread's forum, filtered accordingly to the general parameters"
            toReturn.Add(New GroupParamsRewrite("ForumName", desc, RewriteType.SubPath, UrlParam.FromSyntax("forumid")))
            desc = "Name of the current thread browsed, or the current post's thread, filtered accordingly to the general parameters"
            toReturn.Add(New GroupParamsRewrite("ThreadName", desc, RewriteType.SubPath, UrlParam.FromSyntax("threadid")))
            Return toReturn
        End Function

        Public Function RewriteParams(ByVal groupName As String, ByVal objRewriteType As RewriteType, ByVal params As Dictionary(Of UrlParam, String), _
                        ByVal behaviour As FriendlierUrlStrategy) As GroupRewriteResult Implements IUrlRewriterProvider.RewriteParams
            Dim toReturn As New GroupRewriteResult()
            Select Case groupName.ToLowerInvariant
                Case "groupname"
                    Dim groupeId As Integer = Integer.Parse(params(UrlParam.FromSyntax("groupid")), CultureInfo.InvariantCulture)
                    toReturn.RewriteValue = GetGroupName(groupeId, behaviour)
                    toReturn.ConsumedParameters(UrlParam.FromSyntax("groupid")) = True
                Case "forumname"
                    Dim forumId As Integer = Integer.Parse(params(UrlParam.FromSyntax("forumid")), CultureInfo.InvariantCulture)
                    toReturn.RewriteValue = GetForumName(forumId, behaviour)
                    toReturn.ConsumedParameters(UrlParam.FromSyntax("forumid")) = True
                Case "threadname"
                    Dim threadId As Integer = Integer.Parse(params(UrlParam.FromSyntax("threadid")), CultureInfo.InvariantCulture)
                    toReturn.RewriteValue = GetThreadName(threadId, behaviour)
                    toReturn.ConsumedParameters(UrlParam.FromSyntax("threadid")) = True
            End Select
            Return toReturn
        End Function

        Public Function GetGroupName(ByVal groupeId As Integer, ByVal strategy As FriendlierUrlStrategy) As String
            Dim GroupInf As GroupInfo = New GroupController().GroupGet(groupeId)
            Dim toReturn As String = String.Empty
            If GroupInf IsNot Nothing Then
                toReturn = GroupInf.Name
            End If
            Return strategy.StringEscaper.EscapeString(toReturn)
        End Function

        Public Function GetForumName(ByVal forumId As Integer, ByVal strategy As FriendlierUrlStrategy) As String
            Dim fc As New ForumController
            Dim ForumInf As ForumInfo = fc.GetForum(forumId)
            Dim toReturn As String = String.Empty
            If ForumInf IsNot Nothing Then
                toReturn = ForumInf.Name
            Else
                toReturn = forumId
            End If
            Return strategy.StringEscaper.EscapeString(toReturn)
        End Function

        Public Function GetThreadName(ByVal threadId As Integer, ByVal strategy As FriendlierUrlStrategy) As String
            Dim tc As New ThreadController
            Dim ThreadInf As ThreadInfo = tc.ThreadGet(threadId)
            Dim toReturn As String = String.Empty
            If ThreadInf IsNot Nothing Then
                toReturn = ThreadInf.Subject
            End If
            Return strategy.StringEscaper.EscapeString(toReturn)
        End Function
    End Class

Jesse
CTO - Aricie
 
New Post
10/12/2010 7:58 PM
 
I just asked a simple question. And now the thread is Highjacked from Aricie.com and i don't understand a single word they say. Pitty.
 
New Post
10/13/2010 4:24 AM
 
Hi Dimitris,

I'm sorry if this is the way you feel about it. In my last lengthy posts, I have been trying the give the most precise answers about your very question.
If there are things you don't understand, please ask. If there are others you don't agree with, please say.

You could be left with those answers:
  • There's no way for now to bring friendly urls to the core forum
  • You should switch to another 3r party forum with it's own embedded rewriter or wait till such a system is added to the core forum
  • Or wait till someone comes out with a hard wired solution in a custom friendly url provider
I reckon all of those answers are wrong, and by explaining why I've given out most technical details on what I think is the right way of doing it, be it to our competitors or to the core team itself.
If you believe it was just about pushing our commercial solution, then that's a pitty indeed.

Jesse
CTO - Aricie
 
New Post
10/13/2010 1:59 PM
 
It is not the length of the posts but the included information that matters.

Of cource there are things i don't understand and no DNN user does, since i'm not a coder. Do we agree on that ? I think we do.

And since i'm a very active moderator to a huge (non-dnn) forum in my country (Greece), your posts would BAN you in a sec, as they would be considered a shamless plug for your company and are off topic. I'm pretty sure DNN forums here have a specific developer area, where you can talk about the ecosystem and things you know and deal with.

thanks
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...DNN and Friendly urls everywhereDNN and Friendly urls everywhere


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out