PowerDNN

Recently Viewed...
SnowCovered Top Sellers

Version 5 of the perennial best-selling tool for creating data-based solutions in DNN without custom programming. This version focuses on greater flexibility, expandability, and ease-of-use.

Live Content uses Web 2.0 approach to provide a Rich User Interface and streamlines content presentation by overlaying content on current page. Overlay images, videos, audio, text/html content, flash, dotnetnuke modules, and external content. Experience the demo...

Ultra Video Gallery is a brother product of Ultra Media Gallery, UVG allows you to add videos in various format and automatically convert them to flv format, you also can add videos from embed code and play them in our integrated flash video player.

Powerful, Ajax Enabled, Easy to Use. Document Management has never been better. Open-DocumentLibrary allows DotNetNuke users to share and manage documents in a flexible, intelligent way, offering granular control over Folder and Document access.

'Relationship Building' and 'Communication' are two essential nuts and bolts for a business to prosper. This module allows you to bridge both of these and easily generate continuous awareness of your web site, products and services. Your prospects and customers will greatly appreciate this featur

In this day and age, knowing as much detailed information as possible about your customer, prospect or web site user is essential. Thankfully, the new 'Dynamics Forms' module from Data Springs, makes it easier than ever to segment your data collection efforts.

Capture your users attention, enrich your site with multimedia flash, and create and opt in distribution list for your DNN site. These are just a few of the many features the Data Springs Module Collection can provide you.

Ultra Media Gallery is the most popular photo gallery and media gallery solution for DotNetNuke, UMG offers 10 different flash player to browse your gallery with completely different user interface experience.

The Catalyst skins are professionally designed, coded and packaged by a team of DotNetNuke experts. The skins are available in 12 great colours. This skin is easily customisable with our unique DrNuke EasyMod technology. Try our demo!

ALL NEW ! - Minimalist includes skin packs in 12 great colors. Each color has Flat, Gradient and Glass versions. Feature rich XML Flash header, perfect for just about any purpose. 9 Different menu options in each skin pack; 3 horizontal menus, 3 vertical menus and 3 all-new Twin level menus . . .

    |   Register   |   Thursday, November 20, 2008   
You are here:Resources  Articles & Information  Implementing IPortable in a Module  


Implementing IPortable in a Module

How and Why to Implement IPortable in a Module

 

The DotNetNuke framework provides many different interfaces that module developers can implement to allow modules to provide common functionality. IActionable is used for adding items to the action menu; ISearchable is used to provide content to the search indexer system. These two interfaces are pretty well known by developers as they are much needed items to create functional modules. IPortable is one additional interface that many developers overlook, however, from an end users perspective it is a very needed piece of functionality allowing them to manage their content.

 

Why Implement IPortable?

 

Implementing IPortable is a simple process and involves adding two simple methods to your Business Controller class, so it is not something that will cost you a large amount of time to implement. However, the user benefits in most cases are great. If a module implements IPortable uses with edit permissions will see the following two actions in the action menu for your module.

 

 

These options give your users the ability to import/export content using a familiar interface. This might help someone that tests your module on a different environment than their production environment and wants to move the content from one server to the other. It also helps when users create Site Templates, if a module supports IPortable they can include the content as well as the actual module instance.

 

How Does it Work (User Experience)?

 

The user experience when working with modules that implement IPortable is very easy. To export content the user simply selects “Export Content” from the action menu, they are presented with the following page.

 

 

The user simply specifies the file name they wish to create, without an extension and they click “Export”. After clicking export they are redirected to the module page. If we look at the File Manager for the site you will see the newly created file, circled in red below.

 

 

This is important to note as DotNetNuke adds the content.. To the beginning of the users desired file name. This portion must NOT be removed as if it is, the user will NOT be able to import the content into the module.
Importing works in a very similar fashion the user is presented with a control allowing them to select the input file, once selected they can click “Import” and the records will be applied to the module.
Now that you know how it works from a user perspective, lets dig into the code.

 

How to Implement in Code?

 


You implement IPortable inside your modules BusinessControllerClass after modifying your controller class to implement the IPortable interface which is part of the DotNetNuke.Entities.Modules namespace you will need to implement the following two methods.


Export Module

 


We will start looking at the export module function first. DotNetNuke provides you on piece of information, the moduleId, and expects you to return a string value. The string value that you return must be a valid piece of XML as it is injected into the final XML document created by DotNetNuke that includes additional information. Typically a very simple process can be used to get all data elements from your module and loop through them formatting them in XML. Below is an example implementation of ExportModule from the Expandable Text/HTML module provided by Mitchel Sellers

 

 

This is very simple code, obtaining a listing of all info objects for the current module, and a simple for each loop to write it in XML format using a string builder. Other methods could be used to create the XML structure, however, since a string is the desired end result, the use of a string builder is the most common practice.
After providing this information back to DotNetNuke when it creates the actual content file it will add information regarding the current version of the module which can be used later to ensure that your import process matches to the correct XML structure.

 

Import Module

 


The import module method is provided four pieces of input data; moduleid, content, version, and userid. You will use these methods to successfully import the content. The passed module id is the id of the module to which content should be inserted. Below is the ImportModule method from the Expandable Text/HTML module.

This code is another fairly simple piece, at the base of it you use .NET XML methods to work with the XML content to build your own information objects and insert the records using your standard controller class methods. The important item to note here is actually the first few lines of code. A version check is done to determine if the export is supposed to have a specific field. Using a technique similar to this you can handle imports from different versions of the module without incident if you add/remove items from the import process.

 

Conclusion

 


Following the above simple steps you should be able to implement the IPortable interface without issue. This is a very powerful addition to a module’s functionality that can be of great benefit to the users of the module.

Records per Page
Page 1 of 1First   Previous   Next   Last   
Eric         9/25/2008 6:02:48 AM
Very helpful Very helpful, thank you! Submitted By: Eric

Feedback





Enter the code shown above in the box below
Send

 
DNN Modules
Data Springs DNN Modules

View Dynamic Registration 2.4 Enterprise Edition

Just released Nov 08!

Data Springs Module Collection 2.0 (20 + Modules!)

Capture your users attention, enrich your site with multimedia flash, and create and opt in distribution list for your DNN site. These are just a few of the many features the Data Springs Module Collection can provide you.....more

List Price: $479.99
Price: $349.99
 
View Dynamic Registration 2.4 Enterprise Edition

Dynamic Registration 3.2 

Frustrated over the lack of customization for your user's registration fields? Dynamically setup your DNN Portal with custom registration fields, layout, questions, and other core integration options.........more

List Price: $159.99
Price: $139.99
 
Opt In Email
Opt In Email V4.0
'Relationship Building' and 'Communication' are two essential nuts and bolts for a business to prosper. This module allows you to bridge both of these and easily generate continuous awareness of your web site, products and services. Your prospects and customers will greatly appreciate this featur ...more
List Price: $159.99
Price: $135.00
 
View Dynamic Forms 2.2 - Enterprise Edition
Dynamic Forms 2.7 
In this day and age, knowing as much detailed information as possible about your customer, prospect or web site user is essential. Thankfully, the new 'Dynamics Forms' module from Data Springs, makes it easier than ever to segment your data collection efforts. ...more
List Price: $129.99
Price: $119.99
 
View Tailored Text v2.0 Enterprise Edition
Tailored Text v2.0 
Personalization allows you to go the extra mile in communicating or connecting one to one with your clients. When it comes to technology and web site content, you now have the power to leverage this personalization directly with your users on your DotNetNuke site. ...more
List Price: $79.99
Price: $59.99
 
 
View Dynamic User Directory v2.0 Enterprise Edition
Dynamic User Directory v2.4
The perfect compliment for extending your portals users and community! An essential ingredient for managing dynamic user information, is being able to sort key fields and create useful user directories and custom report information. ...more
List Price: $129.99
Price: $119.99
 
View Stock Quote - Enterprise Edition
Stock Quote 1.2 
Giving your site visitors relevant information is critical. With the Data Springs Stock Module you can provide your users with up to date financial information....more
List Price: $139.99
Price: $109.99
 
View Presentation Archive 1.0 Enterprise Edition
Presentation Archive  
With so much content on your web site, its important to give users an easy method for finding and retrieving content. Presentation Archive allows you to categorize, organize and present content within your DotNetNuke site for presentations, educational material, videos, and almost any document or co...more
List Price: $189.99
Price: $124.99
Search Engine Optimization Cloud Module for DotNetNuke

Dynamic Tags

Nearly every web site developer would agree that search engine optimization is one of key aspects to a successful web site. Part of search engine optimization requires providing search engines that crawl your web site with appropriate and meaningful content......more

List Price: $89.99
Price: $69.99
 
Google Grabber SEO Module for DotnetNuke

Page Tags

'Page Tags' pulls in search terms that users searched to find the current page. There are many benefits to displaying these search words that delivered the user to the site, find our more details .......more

List Price: $79.99
Price: $59.99
 
View Dynamic Registration 2.4 Enterprise Edition

Interactive User Import

Interactive User Import provides you with the functionality to easily and quickly import users into DotNetNuke and Dynamic Registration, through a streamlined and well-documented wizard that includes many advanced features........more

List Price: $149.99
Price: $119.99
 
 
View Real Estate 2.0 Enterprise Edition
Real Estate 2.3
Real Estate 2.3 is a feature rich and user-friendly module that allows your portal users the ability to create real estate listings on your site....more
Price: $149.99
 

View Info Pics Gallery Enterprise Edition
Info Pics Gallery 
The Info Pics Gallery Module allows you to display thumbnail pictures with information to the user about each picture, along with a detailed description regarding the set of pictures and several other optional links. ...more
Price: $39.99
View Flash Info Cube

Flash Info Cube

Take your web site out of the box! Looking for a creative and interesting way to showcase information and content on your site? With millions of web sites offering information you need a fun way to display information and the solution is Flash Info Cube...more
List Price: $59.99
Price: $39.99
 
DotNetNuke Testimonials Module

Testimonials

The Testimonials Module allows you to display customer testimonials on your site, as well as an easy method for users to submit testimonials about your web site, services, or products....more
List Price: $69.99
Price: $49.99
 
View News Ticker Enterprise Edition
News Ticker 
Provide timely and quality news to your users, without much space! Easily present rotating news and announcements to your users with the News Ticker module for DNN. Several extended and optional features allow you to select the time to rotate each news item, include text, HTML, images, and hype...more
List Price: $14.99
Price: $9.99
View Quote Creator
Quote Creator 
Quote Creator can easily help you in creating quotes for your potential customers, current customers, or even offer you other means of communication with clients. With Quote Creator, you can send custom professional quotes and file attachments to your customers. ...more
List Price: $30.00
Price: $17.99
View Quick Poll - no license restrictions

Quick Poll 

Give your users a voice, while also providing an important way for you to gather opinions from your users and measure visitors' responses to questions on your site! Polls are significant because they can provide a way for your web site visitors to share ideas and vote on topics of your choosi...more
List Price: $39.99
Price: $20.99
Flash Image Rotator
Flash Image Rotator
Who would have thought? The Flash Image Rotator displays selected images and then rotates between the images. Several extended and optional features allow you to select the time to rotate each image, fade between images, and also display ...more
List Price: $47.99
Price: $39.99
Dynamic Login Module for DNN
Dynamic Login 
The content on your site isn’t vanilla, so why is your portals login? The user login page is used by every user registered in your portal, but yet once they sign in they go to the exact same page? Customize your portal with Dynamic Login to offer additional features and enhancements during the login...more
List Price: $119.99
Price: $89.99