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 ExtensionsModulesModulesUsing IMC to transfer large amounts of dataUsing IMC to transfer large amounts of data
Previous
 
Next
New Post
7/26/2010 11:09 AM
 
Hi Everyone,

I have two modules which I have created.  One is called Gallery, this just handles how to display images and there meta data, albums and things like that.  The second module called UserFiles this module handles the IO of saving the file to a particular place on the server and also some Rjindal encryption.

At the moment the two module are linked together using a normal dll reference to help make debugging easier.  I would now like to replace the dll reference with IMC.  I've never used IMC before but it doesn't seem to intended for this type of processing.  So I'm wondering if people know of alternatives?  I've tried to use a WCF project but there references required seem to conflick with those in the main web.config or DNN.  At the moment I've implemented IMC in a two way configuration but because of the return types byte[] System.IO.Stream etc its all getting very messy at the moment.

So could anyone please suggest a different approach to this?  Should I go back to WCF or maybe try ASP.Net 2.0 web references?  I read a different article recommending something called the  ModuleCommunicator but after much googling I only got IMC related results.
 
New Post
7/26/2010 12:47 PM
 
Inter-Module Communication (IMC) is passing information between two separate modules on a site (generally, a page too). Although technically one module project may need to reference another module project (or assembly), IMC itself doesn't really have anything to do with references. IMC, simply put, allows one module instance to communicate with another module instance (module here = module definition, which equates to a module in the control panel's drop down list). I am having a difficult time understanding why exactly you need to have the two modules communicate with each other but if that is your intent IMC is an option. 

Also, something you might not be aware but as of DNN 5.4 there are user folders available via the DNN API. This means that each user has their own folder, when needed, to upload files anywhere in the site that takes advantage of this. 

Chris Paterra

Get direct answers to your questions in the Community Exchange.
 
New Post
7/27/2010 5:11 AM
 
I'll try and give a little more info.  The UserFiles module is admin configurable.  This allows the admin to enter the pass phrase and salt value etc in order for the encryption to work.  This is all done in a settings control.

The gallery is the more conventional DNN module with several view controls and again an admin configurable settings page.  Once the image(s) have been uploaded, again a different module but we'll ignore this for now, the gallery needs to pull back the images from the user files module.  The transport medium here really doesn't matter, whether IMC or WCF.  However the place were the image processing is happening is in a generic handler like so:

public void ProcessRequest(HttpContext context)
{
    //Parse the querystring
    string cipherText = context.Request.QueryString["CipherText"];
    cipherText = cipherText.Replace(" ", "+");
 
    context.Response.ContentType = "image/jpeg";
 
    DotNetNuke.Modules.UserFiles.StorageController storageController = new UserFiles.StorageController(PortalId, StorageType.FileSystem);
 
    System.Drawing.Image image = new Bitmap(storageController.GetStream(cipherText));
 
    image.Save(context.Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
    image.Dispose();
}

The parts in bold is were I am currently using a dll reference to access the user files module.  I need to decouple this.

So this is were I was hoping IMC or WCF or something like that would fit in.  I've tried with IMC but because this is a handler I need to pass the HttpContext through with the request otherwise it will get lost.

The more I think of this the more I think this isn't suited to IMC and more related to WCF.  Has anyone successfully integrated a WCF service in a DNN module? I've created the service before already but when i add a service reference I then get errors between the project web.config and the main DNN web.config.

Any ideas would be really appreciated.

Phil



 
New Post
7/27/2010 7:49 AM
 
1.  IMC is intended for multiple modules all sitting on the same page.  It will not work the way you wish to use it because your HTTPModule is handling the IIS Request which means that DotNetNuke page handling code is almost completely out of the loop.
2.  WCF is really designed for use between multiple applications which don't exist in the same process.  All of the assemblies in a DotNetNuke installation are part of the same process and don't need to resort to WCF for communication as they can instantiate instances of the classes they need without going through out-of-process calls.  WCF will pay a heavy performance penalty because it is designed to marshall data across process boundaries and to do that requires a lot of processing to get the data in a process agnostic format.
3.  The best approach is to decouple the design using a base class or interface.  There are many approaches for handling this, but the one that is used extensively in DotNetNuke is a provider based approach.

Joe Brinkman
DNN Corp.
 
New Post
7/27/2010 8:42 AM
 
Thanks Joe,

So as an example would this be the way the store module uses Address, Cart, Shipping and Tax providers?

Thanks again
Phil
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesUsing IMC to transfer large amounts of dataUsing IMC to transfer large amounts of data


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