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

HomeHomeDevelopment and...Development and...Getting StartedGetting StartedWhen to use which DNN IDWhen to use which DNN ID
Previous
 
Next
New Post
7/15/2010 11:07 PM
 
Hello all..

I'm creating my first module and I've got my new db tables setup and properly assoicated in the DNN db to each other, however I'm not completely sure which DNN IDs I should include in my tables, PortalID, ModuleID, and/or TabID.

The module wouldn't be used across different portals, such as new Parent Portals or Child Portals, even though that something I'd like to incorporate in the future, but like I said this is my first module so I'm trying to keep it simple, so I'm thinking I don't need the PortalID assoication, at least not yet.  May be a good idea to add it now though saving me the trouble later, but I'm not sure.

One of the module features will be a scheduling section for different elements, so I'd like to make it so the Admin can set a view of the Schedule(s) on different pages, For example one view of the Schedule on one page and a second on the home page, or where ever they choose, but both showing the same data. Would that require the TabID to be included?

I'm pretty sure I need the ModuleID no matter what, but a bit confused on the other two.

Thanks,
Bob   
 
New Post
7/15/2010 11:30 PM
 
As the data will be segregated on a per module basis, you will definitely need ModuleId (usually with a foreign key relationship to the core Modules table with cascade delete enabled) as well as an ItemID  (primary key - identity) or similarly meaningful column name to distinguish between multiple items of data associated witht he same module.

Since ModuleID is unique to a each portal, you do not need to include a PortalID column even if the module will be used (with different data) on multiple portals. The only time that I include PortalID (and not a ModuleID) is when writing a module whose data will be available to any instance of the module across an entire portal but not across all portals of the same installation.

You do not need to include a TabID column. If only the views and other presentation settings (and not the data) of the module will be different between copies of the same module (placed with the Add EXISTING Module rather than Add NEW Module command, you can take advantage that copy modules will all have the same ModuleID but different TabModuleID's. The DNN framework provides a means of storing a module's custom settings in either the ModuleSettings table (by ModuleID and settings key) or the TabModuleSettings table (by TabModuleID and settings key). Include on the module's custom settings control a way of specifying the desired view of the data and store that value to TabModuleSettings. Then, in the module controls Init or Load handler you can first obtain which view is to be displayed then render the view accordingly. That way, you can have multiple copies of the same module each with a different view to the data.

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
7/16/2010 12:05 AM
 
Wow..When I thought I was just starting to get the gist of this.. :-)

Thanks for the reply Bill, however I have a couple of follow up questions now.
 
"with cascade delete enabled"
I'm not sure I follow this, are you referring to my module code having that or is that something I've completely missed in setting up in SQL with my new tables?

"as well as an ItemID (primary key - identity) or similarly meaningful column name to distinguish between multiple items of data associated witht he same module"
Just to confirm your saying make sure I have an ID column, such as ModuleFKID setup in my table and set the foreign key relationship from ModuleID to that ID column for example ModuleID -> ModuleFKID, correct?
 
"Include on the module's custom settings control a way of specifying the desired view of the data and store that value to TabModuleSettings."
Are you suggesting I need to use the TabModuleID as well as the ModuleID?

If you, or anyone, has any suggested reading on this please feel free to point me in that direction. I'd perfer to get this as right as possible the first time to save a lot of trouble down the road. Obviously I don't know that I'm ready to start yet, if I can't even get the table assoications correct. Thanks, Bob
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Getting StartedGetting StartedWhen to use which DNN IDWhen to use which DNN ID


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