Will "the Mighty" Strohl

DotNetNuke - Get Tab Information from URL

I recently needed to retrieve Tab information from a URL for the Google Search Provider I am writing for DotNetNuke. (You can translate "tab" information into "page" information if you are not familiar with the term.)

With some much appreciated help from the DotNetNuke forums, and more specifically John Mitchell from the Core Team, I was able to write the following function that really helped me out. I hope it can help you out too.

Basically, I take the URL (hopefully it is properly formed) and return a TabInfo object from it. This will give me the basis for getting any of the information it provides, as well as portal information.

Private Function GetTabInformation(ByVal TabUrl As String) As DotNetNuke.Entities.Tabs.TabInfo
TabUrl = TabUrl.ToLower
Dim _TabId As Integer = 0
Dim _tc As New DotNetNuke.Entities.Tabs.TabController

If TabUrl.IndexOf("tabid") > 0 Then
_TabId = Integer.Parse(Regex.Match(TabUrl, "tabid[=/](\d+)", RegexOptions.IgnoreCase).Groups(1).Value)
Return _tc.GetTab(_TabId)
Else
Return Nothing
End If
End Function

DotNetNuke Google Search Provider Update
On a separate note, in developing this provider I have run into some unexpected snags that I might not have ran into if I were creating a provider for one of the other pieces of functionality. The search provider inherits from a separate provider source. In turn, I cannot implement the parameters like the other providers use. However, I have come up with a work-around which will require the user to use a "config" file to adjust the Google Appliance ip number (location) and collection name.



blog comments powered by Disqus