|
Rank: Advanced Member Groups: Member
Joined: 7/3/2007 Posts: 44 Points: 132
|
What class or method can I use to tell what the current site is from a web service.
I have tried IoC.Container.Resolve<Cuyahoga.Core.ICuyahogaContext>().CurrentSite.Id which works from a cuyahoga module, but not from a web service?
I'm using the Cuy2010 (aka 2.0) Alpha code base
|
|
Rank: Administration Groups: Administration
, Member
Joined: 10/7/2008 Posts: 505 Points: 1,515
|
You will have to create your own web service.
To find the site use the Cuyahoga.Core.Service.SiteStructure.SiteService. There you could use the GetSiteBySiteUrl(string siteUrl) that returns a site. You can get the id or anything else from that.
|
|
Rank: Advanced Member Groups: Member
Joined: 6/22/2010 Posts: 33 Points: 99
|
I am having trouble with this now too... I can get the site but then how do I get a handle on the current section or current module? At the moment I am having to pass sectionid with every ajax call in order that the web service knows what module it's serving
|
|
Rank: Administration Groups: Administration
, Member
Joined: 10/7/2008 Posts: 505 Points: 1,515
|
Monkeyface wrote:I am having trouble with this now too... I can get the site but then how do I get a handle on the current section or current module? At the moment I am having to pass sectionid with every ajax call in order that the web service knows what module it's serving When one starts to take control of things at such a low level, it shows just how much asp.net takes care of things for us.
|
|
Rank: Advanced Member Groups: Member
Joined: 6/22/2010 Posts: 33 Points: 99
|
Constructor wrote: When one starts to take control of things at such a low level, it shows just how much asp.net takes care of things for us.
Very true. Thats why I love having an ASP.NET CMS instead of PHP rubbish I am struggling to work out how to convince the web service it's part of the module though... it can't extend any cuyahoga class because it has to extend the web service stuff, and it is stateless so I can't pass the settings to the constructor either. My only solution so far is to pass the necessary info with every single Ajax call... but there must be a better way than that I would suppose the solution might be for the Cuyahoga framework to have some kind of "GetModuleByFolder" or some such that it could call.
|
|
Guest |