3
votes

To be specific, I'm going to use Orchard CMS as a back-end for content editors for an existing website.

My website is too complicated to wrap it into an Orchard custom Module, so I decided to use stand-alone instance of Orchard as backend, and query and show content items manually in the code of my side.

I want to find the way how I could get content items from Orchard using it's API.

Here is some pseudocode I want to achieve:

// somewhere in my site, not in the Orchard application

IOrchardServices orchardFacade = CreateOrchardSystemSomeWay();

IContentManager contentManager = orchardFacade.ContentManager;

var myNeededItems = contentManager.Query("MyContenItemType").ToList();

I have troubles with the implementation of CreateOrchardtSystemSomeWay.

Did anyone try to implement such a way of accessing Orchard CMS data?

Another alternative is to use the database directly, but it would not be very nice approach.

2

2 Answers

2
votes

The best bet would be to look at how the Orchard command line instance spins up and try to copy what it is doing. You have full access to the content from the command line, so if you could reproduce how it works somewhat you may be able to pull it off.

1
votes

I havent attempted to do this, but the way I thought I would have done this if I tried would be to create an abstraction between Orchard and your system through a service like WCF, some sort of anti corruption layer.