Configure & Use Broker API in .Net Project

1.5k views Asked by At

Can someone point me to documentation for setting up the Broker API to use from a .Net app? I've reviewed the documentation on livecontent, but I don't see anything specific on setting up & configuring the broker API to be used from a .net project: The documentation is all related to the server.

I've tried to piece this together by checking out how the OData service is set up, but I keep getting the errors listed below. So I've missed a step, but what step? Do I need to update some of the CD_*_CONF.xml config files?

One more question. Is it me or is the Tridion documentation somewhat incomplete? Basic instructions for how to use one of the product's key API's seem like a reasonable request. I apologize ahead of time if this document exists but I missed it.

ERRORS I'M GETTING

Could not initialize class com.tridion.storage.StorageManagerFactory

or

ClassNotFoundException: com.tridion.broker.querying.Query

Link to "install" topic on Live Content

UPDATE

Thanks for the quick response. I looked at the "Installing a Server role as a .net..." article. It looks like I've followed the steps but my app can't find the JAR files. In this case the cd_broker.jar is in the root/bin/lib directory of my .net project

Java.Lang.ClassNotFoundException: com.tridion.broker.querying.Query

UPDATE 2

I'm using Tridion 2011 SP1.

2

There are 2 answers

1
Chris Summers On BEST ANSWER

I will assume for now you are using SDL Tridion 2011 SP1, so I think this is the link you are looking for:

http://sdllivecontent.sdl.com/LiveContent/content/en-US/SDL_Tridion_2011_SPONE/task_708AA488429D4457AC303DD121B22183

You will need to create a lib and config folder inside the bin directory of your application. The *.config files go in the config folder, and the jar files of from the roles in the install folder go in the lib directory.

You will need to make sure you have a valid license file on accessible, and make sure all your config files point to it (or you can save the file in the config folder itself).

If you are using OData, I suggest you set that up as a separate web application and query it from your app. The docs for that are here:

http://sdllivecontent.sdl.com/LiveContent/content/en-US/SDL_Tridion_2011_SPONE/task_3E3A2FB1B4E34C20934B5A841C2E0930

You will need to update all your config files to set up the correct bindings etc, and point to your Broker DB or File System. That is described here:

http://sdllivecontent.sdl.com/LiveContent/content/en-US/SDL_Tridion_2011_SPONE/task_005JJFGGGD8858699HHFHJF

Hope that helps

1
Frank van Puffelen On

If you've set up Tridion Content Delivery on a server, you have two broad ways of interacting with that server from your .NET application.

  1. you can use the Content Delivery .NET API
  2. you can use the Content Delivery OData Web Service

Option 1 means that your code must run on a machine where you installed the relevant Tridion Content Delivery modules. The pointers given by Chris should help you there. You can also get the API reference in CHM format from here (first log in to SDLTridionWorld, then go the URL).

Option 2 means that your code can run anywhere and you just interact with Tridion's Content Delivery through the OData Web Service. Andrew walked through setting that up in this article on SDL Tridion World.

Many Microsoft technologies have intimate integration with OData services, so setting up an ASP.NET web service that lists Component Presentations of a certain Schema can be accomplished in a large part by wiring up existing ASP.NET controls.

If you feel especially managerial: Excel can also connect to an OData service and read its source data from there. Fun stuff if you want to get some quick counts of certain item types in the Content Delivery Storage.