|
Rank: Administration Groups: Administration
, Member
Joined: 10/7/2008 Posts: 505 Points: 1,515
|
bheeks wrote:Hi 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/41http://dimecasts.net/Casts/CastDetails/33You could also chech this video called 'Introduction to NHibernate: Collection Relationships' (I made a post this earlier) : http://dimecasts.net/Casts/CastDetails/63There are other videos also.
|
|
Rank: Member Groups: Member
Joined: 9/29/2009 Posts: 23 Points: 69
|
Hi
Oh yes of course..the opposite to MVC
Thanks...will go through this
Regards
|
|
Rank: Member Groups: Member
Joined: 9/29/2009 Posts: 23 Points: 69
|
Hi Constructor
Hope you are well.
Why did you use the Common interface in the Module Controller class?
|
|
Rank: Administration Groups: Administration
, Member
Joined: 10/7/2008 Posts: 505 Points: 1,515
|
bheeks wrote:Hi 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
|
|
Rank: Member Groups: Member
Joined: 9/29/2009 Posts: 23 Points: 69
|
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
|
|
Rank: Administration Groups: Administration
, Member
Joined: 10/7/2008 Posts: 505 Points: 1,515
|
bheeks wrote: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
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.
|
|
Rank: Member Groups: Member
Joined: 9/29/2009 Posts: 23 Points: 69
|
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
|
|
Rank: Administration Groups: Administration
, Member
Joined: 10/7/2008 Posts: 505 Points: 1,515
|
bheeks wrote: 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
Check in your cuyahoga_moduleservice table and check the 'classtype' value: (something like this) Code: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) Code: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.
|
|
Rank: Member Groups: Member
Joined: 9/29/2009 Posts: 23 Points: 69
|
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 File Attachment(s): Cuyahoga.Modules.University.rar (938kb) downloaded 70 time(s).
|
|
Rank: Administration Groups: Administration
, Member
Joined: 10/7/2008 Posts: 505 Points: 1,515
|
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: Code:namespace Cuyahoga.Modules.University should be Code:namespace Cuyahoga.Modules.University.DataAccess Also changed the install and uninstall a little. Now installs/activates and uninstalls. The rest is up to you File Attachment(s): Cuyahoga.Modules.University.zip (46kb) downloaded 72 time(s).
|
|
Rank: Member Groups: Member
Joined: 9/29/2009 Posts: 23 Points: 69
|
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
|
|
Rank: Member Groups: Member
Joined: 9/29/2009 Posts: 23 Points: 69
|
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
|
|
Rank: Administration Groups: Administration
, Member
Joined: 10/7/2008 Posts: 505 Points: 1,515
|
bheeks wrote: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
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.
|
|
Rank: Member Groups: Member
Joined: 9/29/2009 Posts: 23 Points: 69
|
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
|
|
Rank: Member Groups: Member
Joined: 9/29/2009 Posts: 23 Points: 69
|
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
|
|
Rank: Member Groups: Member
Joined: 9/29/2009 Posts: 23 Points: 69
|
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 File Attachment(s): Cuyahoga.Modules.University.rar (950kb) downloaded 72 time(s).
bheeks attached the following image(s):
|
|
Rank: Administration Groups: Administration
, Member
Joined: 10/7/2008 Posts: 505 Points: 1,515
|
Try something like: Code: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.
|
|
Rank: Member Groups: Member
Joined: 9/29/2009 Posts: 23 Points: 69
|
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
|
|
Rank: Administration Groups: Administration
, Member
Joined: 10/7/2008 Posts: 505 Points: 1,515
|
bheeks wrote: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
Check this: http://nhforge.org/doc/nh/en/index.html#quickstart-mappingKeep the mapping simple. Use the correct types like: Quote: < property name="Title" column="title" type="String" length="100" />
not like thisQuote: < property name="Title" column="title" type="String(100)" />
or simpler even: Quote: < 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.
|
|
Rank: Member Groups: Member
Joined: 9/29/2009 Posts: 23 Points: 69
|
Hi
Thanks for this and the advice
Regards
|
|
Guest |