Welcome to weblogs.com.pk Sign in | Join | Help

Dotnetnuke - Knowing which controls are being used in the portal

If you inherit something; and you are asked to keep the thing updated; the first thing one should do is to “Refactor”. I tend to first remove all the unwanted things. Today I was doing the same; its Dotnetnuke based application and I was seeing many module control definitions in the portal. I needed to know out of this how many ASCXs actually are being used. Here is the simply query that I came up with after refreshing my knowledge on DNN’s database schema.

 

select mc.controlsrc, mc.modulecontrolid, md.moduledefid, dm.friendlyname, dm.desktopmoduleid

from modulecontrols mc join moduledefinitions md on mc.moduledefid = md.moduledefid

            join desktopmodules dm on md.desktopmoduleid = dm.desktopmoduleid

where mc.moduledefid in

(

            select moduledefid

            from modules

            where moduleid in (

                        select moduleid from tabmodules

            )

                        and moduledefid in (

                                    select moduledefid from moduledefinitions where desktopmoduleid in

                                    (

                                                select desktopmoduleid

                                                from desktopmodules

                                                where friendlyname like 'CP RM%'

                                                            or friendlyname like 'CP SM%'

                                    )

                        )

)

order by controlsrc

 

The query starts from DesktopModule’s FriendlyName; which are known; it then find out all the Module Definitions and their related Module Controls. It then finds out of all these; how many module controls are actually used in portal tabs (Pages)

 

Published Friday, October 6, 2006 6:41 PM by khurram
Filed under:

Comments

No Comments

New Comments to this post are disabled