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.0IPortable import and exportIPortable import and export
Previous
 
Next
New Post
2/26/2007 10:53 AM
 
Hi I'm currently trying to write a function to copy a page between portals, updating the destination page if it already exists. To do this I need to update the content of modules in the destination page which I am trying to do with the following code:

if (source.BusinessControllerClass != "")
            {
                object controller = DotNetNuke.Framework.Reflection.CreateObject(source.BusinessControllerClass, source.BusinessControllerClass);
                if(controller is IPortable)
                {
                    IPortable p = (IPortable)controller;
                    string content = p.ExportModule(source.ModuleID);
                    if (content != "")
                    {
                        p.ImportModule(destination.ModuleID, content, source.Version, 0);
                    }
                }
            }


This sort of works, except that the source content is appended to the destination, instead of replacing it as I would have expected. Is there any way to make this function as I want it to? Since IPortable only implements import and export, I'm at a bit of a loss...
Thanks in advance,
Rupert
 
New Post
2/26/2007 5:00 PM
 

see:

IPortable: Easily export content from your module to deploy on your production server

Since IPortable is just an interface the implementation of that interface is totally up to you. In the module that receives the data, it should delete the current information first if that is what you desire.



Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
New Post
2/27/2007 4:52 AM
 
Thanks for your reply, I should have mentioned that the problem I am having is with the Text/Html module and the Links module, ie. core modules for which the IPortable implementation is already provided, so I don't have the option of changing the behaviour. At the moment my choices seem to be:
1. Inherit from HtmlText etc. to provide my own implementation (quite a lot of work and very non-standard).
2. Delete the modules that exist on the destination page and create new ones (probably less work to code, but incurs a performance overhead, and seems like a  very inelegant solution).
Could anyone suggest any better way?
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0IPortable import and exportIPortable import and export


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