Login

Username

Password





Register   Reset password

This is a read-only archive of the forum.

Page: 1 2
# Constructor 10/14/2009 11:29 AM (edited 10/14/2009 11:33 AM)
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.

# bheeks 10/14/2009 11:46 AM
Hi

Oh yes of course..the opposite to MVC

Thanks...will go through this

Regards
# bheeks 10/14/2009 3:21 PM
Hi Constructor

Hope you are well.

Why did you use the Common interface in the Module Controller class?
# Constructor 10/14/2009 3:31 PM
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 :)
# bheeks 10/19/2009 11:15 AM
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

# Constructor 10/19/2009 12:48 PM
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.
# bheeks 10/19/2009 3:31 PM
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
# Constructor 10/19/2009 5:49 PM (edited 10/19/2009 5:51 PM)
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.

# bheeks 10/20/2009 3:48 PM (edited 10/20/2009 3:54 PM)
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
# Constructor 10/20/2009 11:22 PM
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 :)
# bheeks 10/22/2009 8:45 AM
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
# bheeks 10/23/2009 10:47 AM
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
# Constructor 10/23/2009 12:31 PM
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.
# bheeks 10/23/2009 2:18 PM
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
# bheeks 10/23/2009 3:27 PM
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
# bheeks 10/26/2009 11:33 AM
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
# Constructor 10/26/2009 12:58 PM (edited 10/26/2009 1:00 PM)
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.
# bheeks 10/26/2009 2:42 PM
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
# Constructor 10/26/2009 4:06 PM (edited 10/26/2009 4:09 PM)
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.
# bheeks 10/30/2009 3:44 PM
Hi

Thanks for this and the advice

Regards
Page: 1 2