Wednesday, December 31, 2014

A peek into the Broker database with the Content Delivery Web Service

The Content Delivery (CD) web service, aka OData service, can be used to inspect component presentations or other entities in the Content Delivery broker.

I sometimes see Tridion developers looking into the MS SQL or Oracle database if they want to check what is published. Most Tridion implementations use the CD web service and it is much easier and faster to look into this service. There are exceptions of course, if you want to inspect REL TCDL tags you still want to look into the database, the TCDL tags will get parsed by the Tridion stack when you retrieve content through the CD web service.

Here are a few simple steps to get started browsing though the OData endpoint of the CD web service.


1. Get the Content Delivery web service URL

You can find the URL of the CD web service in the Session Preview settings of the publication targets.


2. Browse the Content Delivery web service

Use Chrome. Firefox and IE try to parse the feed generated by the CD web service and do not show the Atom XML.

Browse to the URL, you will see this listing. Do not forget the tailing / in the URL or you will get the service’s WCF info page instead of the feed. In this example the base URL is http://stg2013sp1demo.ams.dev:84/odata.svc/


This page shows lists all entities available in the Content Delivery web service, ranging from BinaryVariants to Schemas.

3. Digg in into collections

Explore the collections of entities, for example the dynamic component presentations: http://stg2013sp1demo.ams.dev:84/odata.svc/ComponentPresentations


Each component presentation is vieved in a < entry > element. the element contains the full URL to this entry, for example http://stg2013sp1demo.ams.dev:84/odata.svc/ComponentPresentations(PublicationId=6,ComponentId=111,TemplateId=123)

4. Select an entity by id

Grab one specific entity, for example to check it is published correctly:
http://stg2013sp1demo.ams.dev:84/odata.svc/ComponentPresentations(PublicationId=6,ComponentId=111,TemplateId=123) 
 
The Content Delivery web service is aware of typical CD entities like pages and component presentations, but also the underlying items like schemas and components.

5. Get related entities

The feed is self-explanatory, the nodes show the URLs to dig in deeper into the feed. In the previous example you see the link elements which link to related entities and entity collections.
  • Entity URL
    ComponentPresentations(PublicationId=6,ComponentId=111,TemplateId=123)
  • Component entity for this component presentation
    ComponentPresentations(PublicationId=6,ComponentId=111,TemplateId=123)/Component
  • Component template for this component presentaiton
    ComponentPresentations(PublicationId=6,ComponentId=111,TemplateId=123)/Template
  • Pages where this component presentation is used
    ComponentPresentations(PublicationId=6,ComponentId=111,TemplateId=123)/Pages

 

6. Expand

Entities can be expanded to show more information in one go, for example you can show the full component entity in the component presentation entity.

For example get a component presentation and the linked component:
http://localhost:84/odata.svc/ComponentPresentations(PublicationId=6,ComponentId=111,TemplateId=123)?$expand=Component


Note the < m:inline > element which contains the component entity.


7. Get a field

The OData protocol used for the CD web service also allows to select specific field or field value of an entity. For example the title of the component in the previous example.

http://localhost:84/odata.svc/Components(ItemId=111,PublicationId=6)/title/$value
or
http://localhost:84/odata.svc/ComponentPresentations(PublicationId=6,ComponentId=111,TemplateId=123)/Component/title/$value

 

9 comments:

  1. Excellent .. Amazing .. I’ll bookmark your blog and take the feeds also…I’m happy to find so many useful info here in the post, we need work out more techniques in this regard, thanks for sharing. south african brokers forex

    ReplyDelete
  2. Auto bitcoin bot Celeste Barber is an actor, standup comedian, and TV presenter known for her role in the famous Australian TV series, All Saints. She is estimated to be worth nearly half a billion dollars. There are rumours that Celeste Barber has invested in several bitcoin robots to grow her wealth.

    ReplyDelete
  3. The sector is big. According to CB Insights, there are "41 VC-backed fintech unicorns worth a mixed $154.1 B." One driving element is that lots of conventional financial institutions are supporters and also adopters of the technology, actively investing in, partnering or obtaining with fintech start-ups since it is simpler to offer digitally-minded customers what they want, while additionally relocating the industry onward and also staying pertinent. Bruc Bond endeavor to lead the financial sector with sustainability, customizable product offering, and open communication. At Bruc Bond we aim to make 21st century banking straightforward, simple, and transparent.

    ReplyDelete
  4. Fintech additionally cause a disturbance of the insurance policy sector (InsureTech) including everything from on-line plan handling, data protection and giving customized insurance coverages.

    integration of multiple bank accounts

    ReplyDelete
  5. Good broker with decent trading conditions. The option of opening a training account is very useful and helped me a lot when deciding to choose a broker. Assets are numerous, which is also a big benefit. samtrade

    ReplyDelete
  6. I am extremely impressed with your writing skills and also with the layout on your blog. Is this a paid theme or did you modify it yourself? Anyway keep up the nice quality writing, it is rare to see a great blog like this one these days.. Astrologer in Texas,
    Astrologer in Maryland,

    ReplyDelete
  7. excellent submit, very informative aximtrade login I’m wondering why the opposite specialists of this sector don’t realize this. You should continue your writing. I’m confident, you have a great readers’ base already!


    ReplyDelete
  8. As a broker i guess this is quite a bit informative post. If you are looking for Business Opportunities in Canada contact me. I will help you out in buying/selling a business.

    ReplyDelete
  9. This Is Great Advice! Very Reliable And Efficient. I Enjoyed This Post. Nice Post!! These Tips May Help Great Post, Jo! My Ideal Work Advice.thanks So Much For A Complete Post! It Is Very Helpful. Your Free Forex Signlas Post Is Helpful To Avoid The Mistakes

    ReplyDelete