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

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0"Proper" was to get PortalId in ModuleController"Proper" was to get PortalId in ModuleController
Previous
 
Next
New Post
2/9/2009 4:55 PM
 

In the .ascx components you inherit from PortalModuleBase so PortalId is always visable and it's easy to use to populate business objects that require it.

When importing/exporting from the module controller that is not the case. The Import/Export provides the ModuleId, but not the PortalId. When you have Portal based modules you need the PortalId to do the ListAll functions for export, and to populate the business objects during the Add on import.

Is something like:

            Dim mi As New Entities.Modules.ModuleInfo
           colObjects = ListObjects(mi.PortalId)

considered kosher?

 

 
New Post
2/10/2009 6:35 AM
 

Generally, the best way to obtain the PortalId in ImportModule or ExportModule is as follows:

Dim ps As PortalSettings = New DotNetNuke.Entities.Portals.PortalSettings()
Dim PortalId As Integer = ps.PortalId

If you also need to obtain the ModuleInfo for that ModuleID, you may use:

Dim mc As New DotNetNuke.Entities.Modules.ModuleController
Dim mi As DotNetNuke.Entities.Modules.ModuleInfo = mc.GetModule(ModuleID, ps.ActiveTab.TabID)

Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
2/10/2009 7:15 PM
 

Thank you for the reply, that solves 95% of my problem. The last 5% will require a core change.

Currrent DNN assumes Module centric only import/export. Portal centric will only work if you use the method you described while logged into the portal in question.

If you're logged in to a "Host" account and do an Export Portal Template on another portal on that installtion you will retrieve the portalid of the portal you're currently logged in to and it doesn't match if you export something different.  On the import side I want to be able to template a portal complete with data. I'll have to see how reacts when I get to that point.

On import/export the ModuleId, but not PortalId is retrieved from the calling parameters. It would be nice if the iPortable interface supported PortalId but the workaround about logging into the portal you're templating is not a crisis.

 
New Post
5/20/2009 7:27 PM
 

yeah, I have the same problem. I try to get the portalId with the folloing way:

      Private _PortalSettings As PortalSettings

        Protected ReadOnly Property PortalSettings() As PortalSettings
            Get
                _PortalSettings = CType(HttpContext.Current.Items("PortalSettings"), PortalSettings)

                Return _PortalSettings
            End Get
        End Property

but it look like not work well if you login as the host account to do import/export operation. anyone help?


sunblognuke v5 for dnn

Ultimate Blogging Module for DotNetNuke Platform
The professional provider of DotNetNuke support, skin design and custom module development.

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0"Proper" was to get PortalId in ModuleController"Proper" was to get PortalId in ModuleController


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