bheeksHi
IOC?....International Olympic Committee?...lol...just kidding....okay poor joke...but what does IOC stand for?
Inversion of Control (IoC)/Dependancy Injection (DI)
Take a look at:
http://dimecasts.net/Casts/CastDetails/41
http://dimecasts.net/Casts/CastDetails/33
You could also chech this video called 'Introduction to NHibernate: Collection Relationships' (I made a post this earlier) :
http://dimecasts.net/Casts/CastDetails/63
There are other videos also.
Hi
Oh yes of course..the opposite to MVC
Thanks...will go through this
Regards
Hi Constructor
Hope you are well.
Why did you use the Common interface in the Module Controller class?
bheeksHi Constructor
Hope you are well.
Why did you use the Common interface in the Module Controller class?
This would be a question for Martijn. He is the Cuyahoga dev so all questions regarding Cuyahoga architecture would best be addressed to him :)
Hi Costructor
I have managed to create my own data driven module, but I am having a slight problem.....Once installed, it is still reading as inactive
I have checked the DB and autoactive is set to true on the module
Regards
bheeksHi Costructor
I have managed to create my own data driven module, but I am having a slight problem.....Once installed, it is still reading as inactive
I have checked the DB and autoactive is set to true on the module
Regards
In the modules list uncheck and then re-check the activation check box. See if that works. If you get an error at the top of the screen post it. It should work if all your POCO and mappings are ok.
Hi
I have checked and unchecked the active status check box....once I check it it comes up with this error "An error occured: Loading failed for University. Value cannot be null. Parameter name: classType " . I have checked if the module service entry is in the database and it is in there. Any ideas?
Regards
bheeksHi
I have checked and unchecked the active status check box....once I check it it comes up with this error "An error occured: Loading failed for University. Value cannot be null. Parameter name: classType " . I have checked if the module service entry is in the database and it is in there. Any ideas?
Regards
Check in your cuyahoga_moduleservice table and check the 'classtype' value: (something
like this)
Cuyahoga.Modules.University.DataAccess.UniversityDao, Cuyahoga.Modules.University
and check that it is exactly the same as your class name.
Also check your 'servicetype' (again something
like this)
Cuyahoga.Modules.University.DataAccess.IUniversityDao, Cuyahoga.Modules.University
They have to appear in your SQL Install script exactly (case sensitive) as they are in existence. I have made this mistake.
Check your DataAccess filenames against the install script / database.
So you should have in your DataAccess folder files 'UniversityDao' and 'IUniversityDao' (case sensitive). Not 'UniversityDAO' or anything else. Reference your file precisely.
Hi C
Hope you are well.
Thanks again for all your help and effort
I have attached the University module, hopefully some fresh eyes could do the trick
Regards
Bheeks
A couple of things I found.
Firstly, I can not see why you called the person class and mapping files 'IPerson'. I renamed those.
The problem was that you did not have the 'UniverityDao.cs' file in the correct namespace. Although it was in the correct folder, the namespace did not reflect this. The 'IUniverityDao.cs' was in the correct namespace.
It was:
namespace Cuyahoga.Modules.University
should be
namespace Cuyahoga.Modules.University.DataAccess
Also changed the install and uninstall a little.
Now installs/activates and uninstalls. The rest is up to you :)
Hi
Thanks a lot....shu..I did not even notice that. Definitely will not make that mistake again.
I really appreciate all the effort. Wonders of what a fresh pair of eyes could do.... :)
Regards
Hi
After installing that module and when setting it to active it gives an error saying UniversityClass.hbm.xml does not want to compile. I tried redoing it and comparing it to other hbm.xml files, but no joy
Regards
bheeksHi
After installing that module and when setting it to active it gives an error saying UniversityClass.hbm.xml does not want to compile. I tried redoing it and comparing it to other hbm.xml files, but no joy
Regards
The NHibernate mapping files need each to have their build actions set to 'Embedded Resource'. If not you get errors. (Check previous page of posts). :)
Click the mapping file and go to its properties. Set the build action from there.
Hi
Thanks for the reply.
That is the first thing I checked as I remembered you had a nightmare full of nhibernate errors when you first created this type of file :)....hence they are all set to embedded resource
Regards
Hi
I found the problem. Again my naming of the department class was incorrect in the mapping file. It was Department instead of UniversityDepartment - ;)
Regards
Hi Constructor
I seemed to have run into another problem after installing the University Module. I have uploaded the latest build of the university module with a pic of the Error. It seems that when return the University ModuleType into the declared variable, it returns NULL. Any ideas?
Regards
Try something like:
namespace Cuyahoga.Modules.University.Web
{
public partial class University : BaseModuleControl
{
private UniversityModule _Module;
protected void Page_Load(object sender, EventArgs e)
{
this._Module = this.Module as UniversityModule;
}
OTHER CODE.....
}
Rebuild your solution.
Check your post build events paths.
Hi
Yip..that worked. Thanks again for taking me through this. Really appreciate it. I just need to get my head around the mappings file, most of my errors were in there
Regards
bheeksHi
Yip..that worked. Thanks again for taking me through this. Really appreciate it. I just need to get my head around the mappings file, most of my errors were in there
Regards
Check this:
http://nhforge.org/doc/nh/en/index.html#quickstart-mapping
Keep the mapping simple.
Use the correct types like:
< property name="Title" column="title" type="String" length="100" />
not like this
< property name="Title" column="title" type="String(100)" />
or simpler even:
< property name="Title" column="title" type="String" />
< property name="TotalUnits" column="units" type="Int32" />
Refer to the reference material and keep it as simple as required. You can get on to joined subclasses etc later (using the content item etc..)
Use reference to find the mapping equivalents to your database cols.
Hi
Thanks for this and the advice
Regards