Login

Username

Password





Register   Reset password

Get Cuyahoga at SourceForge.net. Fast, secure and Free Open Source software downloads

Forum

Welcome Guest Search | Active Topics | Members

how to programmitically tell what the current site is from a web service Options
webolize
Posted: Saturday, August 28, 2010 3:01:31 PM
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
Constructor
Posted: Saturday, August 28, 2010 4:16:57 PM
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.
Monkeyface
Posted: Sunday, February 6, 2011 12:14:28 PM
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 sad
Constructor
Posted: Sunday, February 6, 2011 3:09:55 PM
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 sad


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.
Monkeyface
Posted: Sunday, February 6, 2011 5:19:05 PM
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 happy

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 tonguestickingout

I would suppose the solution might be for the Cuyahoga framework to have some kind of "GetModuleByFolder" or some such that it could call.
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

Yet Another Forum.net version 1.9.0 running under Cuyahoga.
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.