Login

Username

Password





Register   Reset password

This is a read-only archive of the forum.

# Locutus 11/19/2007 3:11 PM
Hey,

I have been trying to get something done for a while now, and I'm more than a little lost.

What I want to do is to use the Albums from a Gallery module for an image in the Articles module. These modules are not related at all, and I want to keep it that way.

Is there a convenient way to generate a list of a certain type of items (Gallery albums, Articles, etc) from within another module? Perhaps the Gallery module (in my case) could provide a list of Albums it has for a given Site Id, and return that list. But how would a totally different module go about requesting that list?

Right now I just have the path to the album as an ugly string ('~/Userfiles/Gallery/....') and I'd rather offer the user a nice drop-down list of all the available albums by name.

Please help!

-L.
# Efie 11/19/2007 4:14 PM
This might be a problem, you can reference the gallery module and talk to its services, but you'll get an exception because the services from the gallery-module are loaded when the module is loaded into a page, so you can't use them from another page. I've tried this once with the gallery module but it didn't work out. After the gallery-module has been loaded (just once), you can talk to the services within the module. I didn't find a solution for this (I stopped thinking about it after 15 minutes, so maybe someone else has a nice solution for this)
# martijnb 11/20/2007 12:36 AM
You might try to add connections to the modules. This way, it's possible to let one module use functionality of another connected module in a pretty loosely coupled way. See the module development guide for an explanation.

A different option is to try and see if you can decouple the AlbumService and PhotoService classes from the Gallery module. When decoupled, they can be registered in the Castle container (via configuration) and all other modules can access these services.

And finally, in the current trunk of Cuyahoga, modules are not loaded on demand anymore, but when the application starts. This also solves the problem that a module might not be loaded when you try to access some of its functionality.

Feel free to ask more if things are not clear yet.