Login

Username

Password





Register   Reset password

This is a read-only archive of the forum.

# leecook 6/26/2007 9:50 AM (edited 6/26/2007 10:56 AM)
I have changed the static html module so it consumes a IStaticHtmlService which works as expected when adding new content ect. However I need to consume this service from the web project as well. It seems to find and initilize the service ok, but stepping through a simple query, such as:

IQuery query = _sessionManager.OpenSession().CreateQuery("from StaticHtmlContent shc");
I get the usual error:

in expected: shc [from StaticHtmlContent shc]

This suggests to me that it cant resolve the mapping file across dll's? Which is strange as I noticed the section service goes dll's.

My set up is as follows:

I added this to the AdminBasePage.cs:
 this._htmlService = Container.Resolve< IStaticHtmlService >( );
my services.config looks like this:
		id="modules.StaticHtml" 
		service="Cuyahoga.Modules.StaticHtml.IStaticHtmlService, Cuyahoga.Modules"
		type="Cuyahoga.Modules.StaticHtml.StaticHtmlService, Cuyahoga.Modules">
What else do I need to do to access my service from the a different dll?

Cheers,

lee


As a Follow up:

doing this:
this._commonDao.GetObjectById(typeof(StaticHtmlContent), 1)

throws an error of: Unknown entity class: Cuyahoga.Modules.StaticHtml.StaticHtmlContent

However from within my service calling this :
this._commonDao.GetObjectById(typeof(Section), 1)

works as expected. Please help! I think i am going insane!

# martijnb 6/26/2007 12:56 PM
Your module needs to implement INHibernateModule. This is just a marker interface so that moduleloader automagically registers the mappings from the module assembly.

As an alternative you could also add the module assembly to the facilities.config.
# leecook 6/26/2007 1:21 PM (edited 6/26/2007 1:55 PM)
My Module does Implement INHibernateModule already. Can you explain what I would need to put in facilities.config?

It's ok I worked it out. Cheers for your help!