I posted this question in the Extend It forum but I have had no reply, I am hoping someone here might be able to shine some light on it and help me work out what I need, i have been able to get so far but then i get stuck.
Any advice would be greatly appreicated
I have 600+ user accounts on my DNN install,
I have a Quick Poll module and I just managed to write a SQL script to generate a Poll for every user account which included the users name within the poll name. I was really impressed with myself , my skills are getting better but not quite their yet.
My next task is to get create a Poll page for every user , add the Quick Poll module , choose the relevant poll for that user and then link that Poll page to their profile. So what I need to know , is their away I can create say 600+ standard web pages, and then add a specific module to those pages. As yous can quess this would save me days and days of work.
I dont know if their is a stored procedure in the DNN database that would let me do that. Any advice that would help me go in the right direction would be appreciated.
-=============
I have been relentlessy trying to solve this issue,
I have been ploughing through the source code version of DNN looking for the method that creates the web page, what I am planing to do when i find the relevant method/s is create a simple .aspx page with some custom code behind with some loops ,
So that i can pass to the custom method a value say 600 (number of pages i need) and other paramters like page title, page name, and other required parameters. Then call the create page method passing the parameters, go round the loop change the counter, call the method again and pass the parameters for as long as the loop goes.
If any one could enlighten me as to which classes i should be looking at , it would really be helpful.
So where i have got to is
I have looked at the Iconbar.ascx and the Iconbar.ascx.vb, i know that their is an AddPage link on the control panel when you log in as the admin.
So i have got to that link, went to code behind and I have found this method. I assume this is called when i click AddTab.
Private Sub PageFunctions_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdAddTab.Click, cmdAddTabIcon.Click, cmdEditTab.Click, cmdEditTabIcon.Click, cmdDeleteTab.Click, cmdDeleteTabIcon.Click, cmdCopyTab.Click, cmdCopyTabIcon.Click, cmdExportTab.Click, cmdExportTabIcon.Click, cmdImportTab.Click, cmdImportTabIcon.Click
Try
Dim URL As String = Request.RawUrl
Select Case CType(sender, LinkButton).ID
Case "cmdAddTab", "cmdAddTabIcon"
URL = NavigateURL("Tab")
Case "cmdEditTab", "cmdEditTabIcon"
URL = NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=edit")
Case "cmdDeleteTab", "cmdDeleteTabIcon"
URL = NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=delete")
Case "cmdCopyTab", "cmdCopyTabIcon"
URL = NavigateURL(PortalSettings.ActiveTab.TabID, "Tab", "action=copy")
Case "cmdExportTab", "cmdExportTabIcon"
URL = NavigateURL(PortalSettings.ActiveTab.TabID, "ExportTab")
Case "cmdImportTab", "cmdImportTabIcon"
URL = NavigateURL(PortalSettings.ActiveTab.TabID, "ImportTab")
End Select
Response.Redirect(URL, True)
Catch exc As Exception 'Module failed to load
ProcessModuleLoadException(Me, exc)
End Try
End Sub
so this line :
URL = NavigateURL("Tab")
I dont know where this goes to , i thought maybe it went to the Tabs folder and the tabs.ascx control but it doesnt,
if someone could can see where i am going with this could they point me the right way,
i am assuming that when i find out where this goes to , i will then be able to find the method i am looking for, the one where i can pass the page(tab) parameters and create pages dynamiclly.
=========
So moving along i seem to have moved on I have now found this method
Public Shared Function NavigateURL(ByVal ControlKey As String) As String
If (ControlKey = "Access Denied") Then
Return Globals.AccessDeniedURL
End If
Return Globals.NavigateURL(PortalController.GetCurrentPortalSettings.ActiveTab.TabID, ControlKey)
End Function
So what i can see and if im reading this correct, Globals.NavigateURL(PortalController.GetCurrentPortalSettings.ActiveTabID, ControlKey)
i assume that the control key is "Tab" , and the first part is the TabID of the current Tab ,
So i then go to the other method that is called,
Public Shared Function NavigateURL(ByVal TabID As Integer, ByVal ControlKey As String) As String
Dim currentPortalSettings As PortalSettings = PortalController.GetCurrentPortalSettings
Return Globals.NavigateURL(TabID, currentPortalSettings, ControlKey, Nothing)
End Function
The above function takes the TabID and the ControlKey, it declares a local variable "currentPortalSettings" it then calls another NavigateURL() method passing the TabID, currentPortalSettings, ControlKey and nothing
Moving along to the next method,
Public Shared Function NavigateURL(ByVal TabID As Integer, ByVal settings As PortalSettings, ByVal ControlKey As String, ByVal ParamArray AdditionalParameters As String()) As String
Dim isSuperTab As Boolean = False
If ((Not settings Is Nothing) AndAlso settings.ActiveTab.IsSuperTab) Then
isSuperTab = True
End If
Return Globals.NavigateURL(TabID, isSuperTab, settings, ControlKey, AdditionalParameters)
End Function
this has an if statement to check if its a superTab, (not to sure what a SuperTab is) not to clear on this statement "If ((Not settings Is Nothing) AndAlso settings.ActiveTab.IsSuperTab) Then"
So what i see is it seems to be building up the parameters by going through the same shared method.
Public Shared Function NavigateURL(ByVal TabID As Integer, ByVal IsSuperTab As Boolean, ByVal settings As PortalSettings, ByVal ControlKey As String, ByVal ParamArray AdditionalParameters As String()) As String
Return Globals.NavigateURL(TabID, IsSuperTab, settings, ControlKey, Thread.CurrentThread.CurrentCulture.Name, AdditionalParameters)
End Function
It then gets to this method
Public Shared Function NavigateURL(ByVal TabID As Integer, ByVal IsSuperTab As Boolean, ByVal settings As PortalSettings, ByVal ControlKey As String, ByVal Language As String, ByVal ParamArray AdditionalParameters As String()) As String
Dim str2 As String
Dim enumerator As IEnumerator
If (TabID = Null.NullInteger) Then
str2 = Globals.ApplicationURL
Else
str2 = Globals.ApplicationURL(TabID)
End If
If (ControlKey <> "") Then
str2 = (str2 & "&ctl=" & ControlKey)
End If
If (Not AdditionalParameters Is Nothing) Then
Dim str3 As String
For Each str3 In AdditionalParameters
If Not String.IsNullOrEmpty(str3) Then
str2 = (str2 & "&" & str3)
End If
Next
End If
If IsSuperTab Then
str2 = (str2 & "&portalid=" & settings.PortalId.ToString)
End If
If ((Localization.GetEnabledLocales.Count > 1) AndAlso Localization.UseLanguageInUrl) Then
If (Language = "") Then
str2 = (str2 & "&language=" & Thread.CurrentThread.CurrentCulture.Name)
Else
str2 = (str2 & "&language=" & Language)
End If
End If
If (HostSettings.GetHostSetting("UseFriendlyUrls") <> "Y") Then
Return Globals.ResolveUrl(str2)
End If
Try
enumerator = settings.DesktopTabs.GetEnumerator
Do While enumerator.MoveNext
Dim current As TabInfo = DirectCast(enumerator.Current, TabInfo)
If (current.TabID = TabID) Then
Return Globals.FriendlyUrl(current, str2, settings)
End If
Loop
Finally
If TypeOf enumerator Is IDisposable Then
TryCast(enumerator,IDisposable).Dispose
End If
End Try
Return Globals.FriendlyUrl(Nothing, str2, settings)
End Function
This method is a bit much to take i am trying to follow it through "str2" is used in one of the methods I am assuming its " Globals.ResolveUrl(str2)"
Round about here is where im getting lost and confused, im trying to get the user control up which allows me to enter in new Page information and click update to create a new page(Tab)
please someone must know how to easily access this particular control and then call the associated method, its driving me
I have been reading the book Professional Dotnetnuke 4 it is not answering my question.