views:

303

answers:

4

I'm looking into doing inter-module communication with DotNetNuke 4.8.4 - and am wondering if anyone has any good examples of doing this.

I understand that you implement IModuleCommunicator on the sender, and IModuleListener on the receiver - but don't see a way to tie them together besides just dropping them both on the same page.

Do ALL of the listeners on a given page listen to ALL of the senders on a given page? If so, what's the best practice for filtering out the noise?

A: 

I haven't used IMC personally, but as I understand it, all listeners do listen for all senders. The ModuleCommunicationEventArgs that gets sent to the listener includes a Target property, which I think should be the first thing that you'd check, i.e. check whether this message is to you.

bdukes
Are you using a differnet way to communicate between modules, or do you just never have the need? Should I be looking at something else, maybe a better way to do this?
Scott Ivey
Yeah, I've never had a use for it. I suppose we just try to have self-contained modules. Any communication that we would do between modules would probably take place on the querystring.
bdukes
+3  A: 

I was just reading up on IMC last night in Mitchel Sellers DotNetNuke Module Programming book.

Here are some of the main takeaways:

  1. Only works between modules on the same page.
  2. AJAX considerations - probably won't work with partial postbacks
  3. Events raised are sent to any module that implements IModuleListner, so you have to be sure that you're consuming the right thing.

Here is an example of sending information:

if (ModuleCommunication != null)
{
 var args = new ModuleCommunicationEventArgs();
 args.Sender = "Something";
 args.Target = "Something Else";
 args.Text = "Something";
 args.Type = "Something";
 args.Value = new Object();
 ModuleCommunication(this, args);
}

To filter out the noise you'd want to make sure you include some very specific identifying information. It looks like you have plenty of opportunity to do that though when setting up the the EventArgs to be consumed.

Ian Robinson
A: 

I use Open Web Studio. It is an interesting tool, although it lacks robust documentation. It enables me to communicate two DotNetNuke modules in the same page and automatically reload info on the second based on something clicked on the first. I don't know if this is what you are looking for. If it is, I can give you some more tips and some links to tutorials on how to put this thing to work.

OWS is free (with paid support) but as I said, it lacks deep documentation, although you can get past with some patience and fussing.

Marcos Buarque
A: 

Hi Marcos, I' ve just started with OWS and I looking for IMC options. I 'd to hear your tips about it, if you 're willing to share.

Thanks in advance, Fivos