2

We are trying to read the contents of a page (published as XML) from the Tridion Broker database using .NET code through the Tridion Service API (which requires license).

We already have a similar implementation working fine in JAVA/JSP. However, now we have a requirement to do the same in .NET.

Please can someone help with details on how to use Tridion Service API in .NET?

Thanks in advance.

  • Also - do consider using the Content Delivery Web Service (OData), it would make your life a lot easier. – Nuno Linhares Aug 2 '13 at 12:09
  • Doing the same in .NET using the Content Delivery API (broker queries) should be relatively the same minus syntax changes. But I think referring to the "Tridion Service API" makes this confusing--in delivery we have a "Service" (OData that Nuno mentions) AND an "API." – Alvin Reyes Sep 21 '13 at 17:23
4

The best approach really depends on what exactly you're trying to achieve. So far, this is what I can understand from your question and the way it's written:

  1. You have no experience with Tridion, given how you mix TOM.NET, CoreService and Content Delivery in the same question. TOM.NET and CoreService are Content Management APIs, not Content Delivery
  2. You say you want to access the data in the Tridion Broker Database using .NET. If the data you're trying to read is contained within a page published to the file system, access to the database may not be sufficient.
  3. If all you need is metadata about the published content I would seriously recommend configuring an OData endpoint linked to the same database, and use this to talk to Tridion. The instructions in the link above are for a Java-based OData server, but you can also do the same with a .NET-based OData server, the Tridion installation files include a sample .NET webapp for this.

If you explain a bit more about your use case, we may be able to help you further. As is, this question is really not clear enough.

If all you want is API-level access, then follow Bart's recommendation.

UPDATE

Since you added some information, here's some more info from my side too:

The content you want to read is in the page content. Do you know if these pages are published to the database or to the file system? If they are published to the database, my recommendation to use the web service still stands - you need a license to run the webservice server, but not for the clients. If you run the API then you need a license for the machine running the code.

3

On the 2011 installation CD you can find all the DLLs you need under Content Delivery\roles. From the documentation (requires login):

To simplify installation, in SDL Tridion 2011 SPI the various Content Delivery modules have been separated into Content Delivery Server Roles. A Server Role encapsulates the files and resources you need to install on a particular server to deploy and run a certain piece of Content Delivery functionality.

For querying the Content Data Store (i.e. Broker database), you will need the API role, so depending on whether you will use a 32bit or 64bit Windows/IIS installation on your delivery side, you will find the DLLs you need under Content Delivery\roles\api\dotNet\x86 or Content Delivery\roles\api\dotNet\x86_64

0

Here some basic samples:

Retrieve Component Presentation

ComponentPresentationFactory factory = new ComponentPresentationFactory(publicationId);
ComponentPresentation presentation = factory.GetComponentPresentation(componentId, templateId);

Retrieve Componet Metadata

ComponentMetaFactory metaFactory = new ComponentMetaFactory(publicationId);
IComponentMeta componentMeta = metaFactory.GetMeta(componentId);
CustomMeta customMeta = componentMeta.CustomMeta;

Query Content

SchemaTitleCriteria schemaCriteria = new SchemaTitleCriteria("MySchema");
CustomMetaValueCriteria metaCriteria = new CustomMetaValueCriteria(new CustomMetaKeyCriteria("CustomMetaField"), "Value", Criteria.Equal);

Query query = new Query();
query.Criteria = CriteriaFactory.And(new Criteria[] { metaCriteria, schemaCriteria });
string[] componentIds = query.ExecuteQuery();

foreach (string id in componentIds)
{
    // Execute your logic per component
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.