Login

Username

Password





Register   Reset password

This is a read-only archive of the forum.

# MadShad 8/9/2006 5:20 AM
After playing around for a day and a night I am driven to ask this question:

Is it possible to design several modules in a single dll?

Well it is, but I cannot use the install/uninstall administration as this seems to be based on the dll name and not the module name.

I currently have to run my uninstall script manually. Or is there a trick?

Kind regards.
# MadShad 8/9/2006 5:24 AM
Ok, I should mention that I am using the svn 1.x branch.
# gedw99 8/9/2006 8:02 AM
Hey Mad,

You can easily code many modules in the same Module.

Ths is exactly how the core modules are coded.

For each module you have a web dir and an install dir.
the web module has the web sutff and the install has the dataabse install scripts.

Have a look at the module i wrote here and it show this.

http://gedw99.dnsalias.net
there is a googel site maps module there, It is .ent 2.0, but the way to do it is the same.

Hope this helps

Gerard

# MadShad 8/9/2006 8:58 AM
Hi Gerard,

I had a look at your module, but it did not solve my query (my modules are constructed in an identical manner to yours, and as per the docs). The problem is the install/uninstall of a module with multiple 'modules' in the same dll, ie:

INSERT INTO cuyahoga_moduletype (name, assemblyname, classname, path, editpath, inserttimestamp, updatetimestamp)
VALUES ('Module1', 'MyAssembly', 'MyAssembly.Module1', 'Modules/MyModule1/Content.ascx', null, '2006-08-07T12:00:00.000', '2006-08-07T12:00:00.000');

INSERT INTO cuyahoga_moduletype (name, assemblyname, classname, path, editpath, inserttimestamp, updatetimestamp)
VALUES ('Module2', 'MyAssembly', 'MyAssembly.Module2', 'Modules/MyModule2/Content.ascx', null, '2006-08-07T12:00:00.000', '2006-08-07T12:00:00.000');

INSERT INTO cuyahoga_version (assembly, major, minor, patch) VALUES ('MyAssembly', 1, 0, 0);

The above works fine, and the modules are accessable after installing the 'MyAssembly' assembly.

However, under the modules administration you will see that is is not the 'name' field (Module1, Module2, etc.) that is used as a key, rather the 'assemblyname' field (MyAssembly).

The module appears as installed and uninstalled at the same time because the 'MyAssembly' name is used by the administration, and it thinks that the module is not installed because it looks for 'Module1' and 'Module2'.

My current solution is simply to create an new project for each module (hence a new dll) I am writing. This is not a problem as such, but it would have been nice to have a single project and a single dll.

I could solve this in the core, but I do not want branch the svn repo.
# martijnb 8/9/2006 3:01 PM
Could you create a Jira issue for this. After reading your post, I see that this is not too convenient when bundling multiple modules in one assembly. I haven't run into this, because I've only used module installers with assemblies that only contained one module, but you have a serious point here.
# MadShad 8/10/2006 2:33 AM
Hi Martijn,

Posted as issue: CUY-84
# gedw99 8/12/2006 6:18 PM
Madshad,

I did exactly the same thing for my modules too.
Having a different project for each Module is not that bad when you think about it from programmer usability and encapsulation.
From a life-cycle point fo view i thinks its a good thing to; i can easily add a new module to a LIVE web server by dropping the ModuoleName.dll and the Module/Modulename into the web folder, and then just install it from the admin module admin installer.

cheers,

Gerard
# chrisortman 9/26/2006 1:10 PM
I think I have a solution to this...posted to jira comments.

http://tijnthuus.demon.nl:8080/jira/browse/CUY-84

About jira....is it possible to have the site run via port 80...or does anyone know how to setup ssh tunnelling so that my ssh server will send its request via port 8080? I think I need to figure out one of the 2 since I still can't seem to figure out why I can't access the jira site from work.
# martijnb 9/26/2006 2:36 PM
chrisortmanI think I have a solution to this...posted to jira comments.

Thanks, it looks so simple, that I don't know why I didn't think of this in the first place :).
About jira....is it possible to have the site run via port 80...or does anyone know how to setup ssh tunnelling so that my ssh server will send its request via port 8080? I think I need to figure out one of the 2 since I still can't seem to figure out why I can't access the jira site from work.

We're curently looking at a few options to move Jira and the Wiki to a better place.
A long time ago, I have experimited with Apache as reverse proxy in front of Jira, but for some reason I couldn't get it to work nicely.
# chrisortman 9/26/2006 4:45 PM (edited 9/26/2006 5:00 PM)
Sorry, still at work or i'd put this in jira...simple question though it looks like the procedure for updates to the core cuyahoga database is to update a version file for upgrading and the install file for the base install.....so say for v 1.0.1 i want to add a column, i should create a 1.0.1.sql file and update install.sql? would it make more sense to run install and then all subsequent x.x.x.sql files after....that way its only one change


also once i got a little further on this, i realized that it will have to be a bit more complex than this because we probably don't want to name the module/* folders with assembly names and I don't see how to infer an assembly name from a directory, so I'm adding a packagename column to moduletypes...and in the upgrade script will just set it equal to the name of the module which shouldn't break any existing module per assembly people but the folks like myself will have a manual step to go and set up the package name based on our assembly, but that shouldn't be too bad. Also, I think we might need to have 1 folder per assembly underneath modules....so the Articles, statichtml etc would have to move under something like 'Base' or 'DefaultModules' not quite sure what you'd want to have for an upgrade process here, for people doing xcopy it should be fine, but if someone is just copying bin files then there'd be a manual step...which kinda leads me down a path of should the install / upgrade scripts be just sql or should we use an msbuild (or something similar) script....
# martijnb 9/27/2006 11:52 AM (edited 9/27/2006 11:55 AM)
chrisortmanit looks like the procedure for updates to the core cuyahoga database is to update a version file for upgrading and the install file for the base install.....so say for v 1.0.1 i want to add a column, i should create a 1.0.1.sql file and update install.sql? would it make more sense to run install and then all subsequent x.x.x.sql files after....that way its only one change

This is on purpose. In the past, I have worked on projects where everything was done with update scripts. At some point in time things can change so much that it is going to be a real pain to maintain all update scripts. With the system that Cuyahoga has, it's always possible to do a clean install, also when there are issues with update scripts and we may have to decide to stop support upgrading from a very old version.

# martijnb 9/27/2006 12:03 PM
chrisortmanalso once i got a little further on this, i realized that it will have to be a bit more complex than this because we probably don't want to name the module/* folders with assembly names and I don't see how to infer an assembly name from a directory, so I'm adding a packagename column to moduletypes...and in the upgrade script will just set it equal to the name of the module which shouldn't break any existing module per assembly people but the folks like myself will have a manual step to go and set up the package name based on our assembly, but that shouldn't be too bad. Also, I think we might need to have 1 folder per assembly underneath modules....so the Articles, statichtml etc would have to move under something like 'Base' or 'DefaultModules' not quite sure what you'd want to have for an upgrade process here, for people doing xcopy it should be fine, but if someone is just copying bin files then there'd be a manual step...which kinda leads me down a path of should the install / upgrade scripts be just sql or should we use an msbuild (or something similar) script....

I've read this a couple of times and I'm trying to figure out a solution but don't see anything that can be done with just a few minor tweaks. Your package idea looks interesting but is also a lot of work to get right (remember, we have to support at least three databases).
# chrisortman 9/28/2006 8:20 AM
I'm about done with the SQL server side....code is written but i want to test it a little more, i don't think scripting the postgres and mysql stuff will be too hard and hopefully i can get to it today.

I should then probably merge the latest trunk with my stuff and make sure everything is still fine.
# martijnb 9/29/2006 7:53 AM
Allright. Looking forward to see how it turns out.
# noah.liu 9/30/2006 1:18 PM
chrisortman

at present to instantiant module assambly depend on module name, and indirectly depend on module path. so if module name is translated into locale language, it is impossible.

if we consider this, to add a package column maybe is not enough.

# chrisortman 10/4/2006 8:46 AM
When does it depend on the path? I didn't change any of the instantiation rules because it seemed like all it should need is the assembly name. If you are referring to the individual "view" or ascx controls that go with any given module then yes, there is minor updating to the module to use a different path. It seemed like a reasonable trade off based on what little work I need to do to update the base cuayahoga modules.

There may be other ways to support this, and I'm all ears, but this seemed like the most logically correct way based on my limited understanding of the system. If several modules use the same tables then they all need to install / uninstall using the same scripts which with the way cuyahoga handles upgrades / installs means they all need to be in the same Modules /* folder. On a side note this seems to tie very well with the way (as done in Cuyahoga.Modules) to setup visual studio projects.