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...Building ExtensionsBuilding ExtensionsModulesModulesMultiple Modules one PackageMultiple Modules one Package
Previous
 
Next
New Post
4/4/2012 1:41 PM
 

Hello -

I'm working on the DNN 6.1.4 using the lastest templates provided by Chris Hammond. I've been trying to setup the .dnn file so that it installs two views as separate modules that I can drop onto a page and so far have not been able to get them to register properly. When I look at some samples like the store, the .dnn file uses completely different tags.

I was thinking I would just have a separate  <component type="Module"> tag for each view I wanted to appear as a droppable module? They all piggy back on the same core code. I've read through this post but I'm still not getting it...any help is appreciated. Below is my config file.

 <dotnetnuke type="Package" version="5.0">
<packages>
<package name="eCommerce" type="Module" version="00.00.01">
<friendlyName>eCommerce</friendlyName>
<description>DotNetNuke Corporation eCommerce module</description>
<iconFile>Images/icon_extensions.gif</iconFile>
<owner>
<name>DotNetNuke Corporation</name>
<organization>DotNetNuke Corporation</organization>
<url>http://www.dotnetnuke.com</url>
<email>training@dotnetnuke.com</email>
</owner>
<license src="License.txt"></license>
<releaseNotes src="ReleaseNotes.txt"></releaseNotes>
<dependencies>
<dependency type="CoreVersion">06.00.00</dependency>
</dependencies>

<components>
<component type="Script">
<scripts>
<basePath>DesktopModules\eCommerce</basePath>
<script type="Install">
<path>Providers\DataProviders\SqlDataProvider</path>
<name>00.00.01.SqlDataProvider</name>
<version>00.00.01</version>
</script>
<script type="UnInstall">
<path>Providers\DataProviders\SqlDataProvider</path>
<name>Uninstall.SqlDataProvider</name>
<version>00.00.01</version>
</script>
</scripts>
</component>

<component type="ResourceFile">
<resourceFiles>
<basePath>DesktopModules/eCommerce</basePath>
<resourceFile>
<name>Resources.zip</name>
</resourceFile>
</resourceFiles>
</component>

<component type="Module">
<desktopModule>
<moduleName>eCommerce</moduleName>
<foldername>eCommerce</foldername>
<businessControllerClass>DotNetNuke.Modules.eCommerce.Components.FeatureController</businessControllerClass>
<supportedFeatures />
<moduleDefinitions>
<moduleDefinition>
<friendlyName>eCommerce</friendlyName>
<defaultCacheTime>0</defaultCacheTime>
<moduleControls>
<moduleControl>
<controlKey />
<controlSrc>DesktopModules/eCommerce/View.ascx</controlSrc>
<supportsPartialRendering>False</supportsPartialRendering>
<controlTitle />
<controlType>View</controlType>
<iconFile />
<helpUrl />
<viewOrder>0</viewOrder>
</moduleControl>
<moduleControl>
<controlKey>Edit</controlKey>
<controlSrc>DesktopModules/eCommerce/Edit.ascx</controlSrc>
<supportsPartialRendering>False</supportsPartialRendering>
<controlTitle>Edit Content</controlTitle>
<controlType>Edit</controlType>
<iconFile />
<helpUrl />
<viewOrder>0</viewOrder>
<supportsPopUps>True</supportsPopUps>
</moduleControl>
<moduleControl>
<controlKey>Settings</controlKey>
<controlSrc>DesktopModules/eCommerce/Settings.ascx</controlSrc>
<supportsPartialRendering>False</supportsPartialRendering>
<controlTitle>eCommerce Settings</controlTitle>
<controlType>Edit</controlType>
<iconFile />
<helpUrl />
<viewOrder>0</viewOrder>
</moduleControl>
</moduleControls>
</moduleDefinition>
</moduleDefinitions>
</desktopModule>
</component>
<component type="Module">
<desktopModule>
<moduleName>eCommerce Maintain Quote</moduleName>
<foldername>eCommerce</foldername>
<businessControllerClass>DotNetNuke.Modules.eCommerce.Components.FeatureController</businessControllerClass>
<supportedFeatures />
<moduleDefinitions>
<moduleDefinition>
<friendlyName>eCommerce Maintain Quote</friendlyName>
<defaultCacheTime>0</defaultCacheTime>
<moduleControls>
<moduleControl>
<controlKey />
<controlSrc>DesktopModules/eCommerce/maintain_quote.ascx</controlSrc>
<supportsPartialRendering>False</supportsPartialRendering>
<controlTitle />
<controlType>View</controlType>
<iconFile />
<helpUrl />
<viewOrder>0</viewOrder>
</moduleControl>
<moduleControl>
<controlKey>Edit</controlKey>
<controlSrc>DesktopModules/eCommerce/maintain_quote_edit.ascx</controlSrc>
<supportsPartialRendering>False</supportsPartialRendering>
<controlTitle>Maintain Quote Edit Content</controlTitle>
<controlType>Edit</controlType>
<iconFile />
<helpUrl />
<viewOrder>0</viewOrder>
<supportsPopUps>True</supportsPopUps>
</moduleControl>
<moduleControl>
<controlKey>Settings</controlKey>
<controlSrc>DesktopModules/eCommerce/maintain_quote_settings.ascx</controlSrc>
<supportsPartialRendering>False</supportsPartialRendering>
<controlTitle>Maintain Quote eCommerce Settings</controlTitle>
<controlType>Edit</controlType>
<iconFile />
<helpUrl />
<viewOrder>0</viewOrder>
</moduleControl>
</moduleControls>
</moduleDefinition>
</moduleDefinitions>
</desktopModule>
</component>
<component type="Assembly">
<assemblies>
<basePath>bin</basePath>
<assembly>
<name>eCommerce.dll</name>
</assembly>
</assemblies>
</component>
</components>
</package>
</packages>
</dotnetnuke>

 

 
New Post
4/5/2012 12:18 PM
 

I think what you want to do is create 2 separate <moduleDefinition> sections.

Here is an overview of the idea:

 package
 - components
   - component
     - desktop module

       - module definition (1)
         - module controls
           - module control (view)
           - module control (settings)
           - module control (edit)
         / module controls
       / module definition

       - module definition (2)
         - module controls
           - module control (view)
           - module control (settings)
           - module control (edit)
         / module controls
       / module definition

... and so on.

here is an example from my file:

      <!--===============================================-->

      <!--              OPS: My Offers                   -->
      <!--===============================================-->

      <package name="OPS_MyOffers" type="Module" version="01.00.00">
          <friendlyName>OPS: My Offers</friendlyName>
          <description>Part of Offer Posting System. Use this module to view, modify and create your offers.</description>
          <iconFile>DesktopModules/OfferPostingSystem/images/ITM_48x48.png</iconFile>
          <license src="License.txt"/>
          <releaseNotes src="ReleaseNotes.txt" />
          <dependencies>
              <dependency type="CoreVersion">06.00.00</dependency>
          </dependencies>
          <components>
              <component type="Module">
                  <desktopModule>
                      <moduleName>OPS_MyOffers</moduleName>
                      <foldername>OfferPostingSystem</foldername>
                      <businessControllerClass>OfferPostingSystem.Components.FeatureController</businessControllerClass>
                      <supportedFeatures />
                      <moduleDefinitions>
                          
                          <!--MO Offers-->
                          <moduleDefinition>
                              <friendlyName>My Offers</friendlyName>
                              <defaultCacheTime>0</defaultCacheTime>
                              <moduleControls>
                                  <moduleControl>
                                      <controlKey />
                                      <controlSrc>DesktopModules/OfferPostingSystem/MO_Offers.ascx</controlSrc>
                                      <supportsPartialRendering>False</supportsPartialRendering>
                                      <controlTitle />
                                      <controlType>View</controlType>
                                      <iconFile />
                                      <helpUrl />
                                      <viewOrder>1</viewOrder>
                                  </moduleControl>
                                  <moduleControl>
                                      <controlKey>Settings</controlKey>
                                      <controlSrc>DesktopModules/OfferPostingSystem/Settings/MO_OffersSettings.ascx</controlSrc>
                                      <supportsPartialRendering>False</supportsPartialRendering>
                                      <controlTitle>Settings</controlTitle>
                                      <controlType>Edit</controlType>
                                      <iconFile />
                                      <helpUrl />
                                      <viewOrder>0</viewOrder>
                                  </moduleControl>
                              </moduleControls>
                          </moduleDefinition>

                          <!--MO Offer Details-->
                          <moduleDefinition>
                              <friendlyName>My Offer Details</friendlyName>
                              <defaultCacheTime>0</defaultCacheTime>
                              <moduleControls>
                                  <moduleControl>
                                      <controlKey />
                                      <controlSrc>DesktopModules/OfferPostingSystem/MO_OfferDetails.ascx</controlSrc>
                                      <supportsPartialRendering>False</supportsPartialRendering>
                                      <controlTitle />
                                      <controlType>View</controlType>
                                      <iconFile />
                                      <helpUrl />
                                      <viewOrder>2</viewOrder>
                                  </moduleControl>
                                  <moduleControl>
                                      <controlKey>Settings</controlKey>
                                      <controlSrc>DesktopModules/OfferPostingSystem/Settings/MO_OfferDetailsSettings.ascx</controlSrc>
                                      <supportsPartialRendering>False</supportsPartialRendering>
                                      <controlTitle>Settings</controlTitle>
                                      <controlType>Edit</controlType>
                                      <iconFile />
                                      <helpUrl />
                                      <viewOrder>0</viewOrder>
                                  </moduleControl>
                              </moduleControls>
                          </moduleDefinition>
                          
                      </moduleDefinitions>
                  </desktopModule>
              </component>
              <component type="Assembly">
                  <assemblies>
                      <basePath>bin</basePath>
                      <assembly>
                          <name>OfferPostingSystem.dll</name>
                      </assembly>
                  </assemblies>
              </component>
          </components>
      </package>

      Not sure if this is what you want, but I hope it helps.
 
New Post
4/5/2012 2:11 PM
 

BTW, if you are using DNN 6 (I have never used the other versions so I don't know if they have this also) you can also go to host > extensions and click edit on one of the modules to look around. The settings that you edit in there are the tags for the .dnn file. So if you can get your module to register with just one view ascx file then you can add the others by clicking the edit icon (tool tip= 'Edit This Extension') > 'Module Definitions' > 'Add Definition'. Just keep in mind that you have 2 types of things you can add:

  1. Module Definition - this contains the Module Controls (see #2 below) and is what you will see on your page. For example, if you have 2 Module Definitions, you will see 2 modules on your page.
  2. Module Control - the .ascx files that should be of types view or edit (edit.ascx and settings.ascx would both be type edit). There is only one view file (not sure if you can have more), the edit and settings files just support the view file. You only see the edit and settings files when you edit the settings or content for the view file.

If you want multiple modules to show up in the Extensions list, then you need to make multiple 'packages' in you .dnn file. For example:

 <dotnetnuke type="Package" version="6.0">
  <packages>

    <package name="....1">
       .......
    </package>
    <package name="....2">
       .......
    </package>
  </packages>
</dotnetnuke>

Also, I don't know what you are building but if you need the modules to communicate, use DNN's IMC: http://kemmis.info/blog/archive/2008/02/22/dotnetnuke-inter-module-communication-or-how-your-modules-can-get-their.aspx

Disclaimer: I'm still new to this so some of the info may not be 100%. Hope it helps.

 
New Post
4/13/2012 3:07 PM
 
Joe wrote:

I might be misunderstanding.  But what I would like is to do this.

MyPackage
  -- View1
  -- View2
  -- View3

Now on the a page I want to edit, I would like to be able to ONLY add View two.  On another page add  ONLY View1 and View2.  So will the method you menioned work or would I need to create multiple packages with in the .dnn for each view I want to use seperately one each page.  So in this example I would need 3 seperate packages to show up in the "Add Modules" dropdown?

Thanks Joe

 You may have your question answered, but I thought I add this for anyone else who may find it useful...

If all you want is one module with different views for different pages, use a Multiview. In the Settings create textboxes such as txtView1, txtView2,..... when you initially install the  module on a page, set the TabIds or the TabNames of the pages you want your module to appear. Then programatically you can do something like this;

        private const int user1View = 0;
        private const int user2View = 1;
        private const int user3View = 2;

        protected void Page_Load(object sender, System.EventArgs e)
        {
            try
            {
                
                if (!IsPostBack)
                {
                    int User1TabID = Int32.Parse(txtView1.Text);
                    int User2TabID = Int32.Parse(txtView2.Text);
                    int User3TabID = Int32.Parse(txtView3.Text);

                    if (TabId == User1TabID)
                    {
                        myMultiview.ActiveViewIndex = user1View;
                        //your other logic here

                    }
                    else if (TabId == User2TabID)
                    {
                        myMultiview.ActiveViewIndex = user2View;
                        //your other logic here
                    }
                    else
                    {
                        myMultiview.ActiveViewIndex = user3View;
                        //your other logic here
                    }

                }
            }

            catch (Exception exc)
            {
                //Module failed to load
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }

Install this module in other pages by selecting Install EXISTING MODULE


Mackeny

pendelea.com -The #1 website for properties in Kenya
 
New Post
4/13/2012 5:53 PM
 

Corrections on my posting above:

To set pageTabId in settings, you'd do something like this;

public override void UpdateSettings()
        {
            try
            {
                DotNetNuke.Entities.Modules.ModuleController objModules = new      DotNetNuke.Entities.Modules.ModuleController();

                objModules.UpdateModuleSetting(ModuleId, "user1TabId", txtView1.Text);
                objModules.UpdateModuleSetting(ModuleId, "user2TabId", txtView2.Text);
                objModules.UpdateModuleSetting(ModuleId, "user3TabId", txtView3.Text);

                // refresh cache
                DotNetNuke.Entities.Modules.ModuleController.SynchronizeModule(ModuleId);

            }
            catch (Exception ex)
            {
                ProcessModuleLoadException(this, ex);
            }
        }

So the settings the view would be like;

protected void Page_Load(object sender, System.EventArgs e)
        {
            try
            {
                
                if (!IsPostBack)
                {
                    int User1TabID = Int32.Parse(Settings("
user1TabId"));
                    int User2TabID = Int32.Parse(Settings("
user2TabId"));
                    int User3TabID = Int32.Parse(Settings("
user3TabId"));

                    if (TabId == User1TabID)
                    {
                        myMultiview.ActiveViewIndex = user1View;
                        //your other logic here

                    }
                    else if (TabId == User2TabID)
                    {
                        myMultiview.ActiveViewIndex = user2View;
                        //your other logic here
                    }
                    else
                    {
                        myMultiview.ActiveViewIndex = user3View;
                        //your other logic here
                    }

                }
            }

            catch (Exception exc)
            {
                //Module failed to load
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        } 


Mackeny

pendelea.com -The #1 website for properties in Kenya
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesMultiple Modules one PackageMultiple Modules one Package


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