5

I'm trying to understand this question: Not able to get list of schema names when I pass publication ID and with ItemTypeCriteria schema by using Broker API and this strikes me as odd (pointed out in my answer):

ItemTypeCriteria IsSchema = new ItemTypeCriteria(ItemTypes.SCHEMA);

As far as I know, in the CD API, we can get back items such as:

  • Component IDs
  • ComponentPresentations (based on a Component + Template)
  • Pages
  • Custom Metadata

But can you get a list of schemas back?

Following the example, I couldn't get ItemTypes.SCHEMA to work without Com.Tridion. But does that belong in CD?

3 Answers 3

6

Content Delivery does have Schemas (if they are published, which by default they will), your cd_deployer_conf.xml should have the following module:

<Module Type="SchemaDeploy" Class="com.tridion.deployer.modules.SchemaDeploy"/>

But they are not queryable as a list, the following will return you zero results always:

Criteria criteria = new ItemTypeCriteria(8);
Query query = new Query(criteria);
string[] result = query.ExecuteQuery();

While if you use ItemTypeCriteria(16) or ItemTypeCriteria(64) you will get all the Components or Pages in your Broker DB.

They used to be there for Schema validation, not sure if and how that still can be used through the available APIs.

1
  • 2
    Wow.... that's a flash back to when Content Delivery still had the option to store the XML Component Presentations in Tamino (an XML database). Nov 15, 2013 at 15:29
4

Yes, com.tridion.ItemTypes.SCHEMA belongs in CD. The cd_core.jar (part of content delivery api) has com.tridion.ItemTypes, this also defines ItemTypes.SCHEMA.

The com.tridion.ItemTypes is also documented in the Java API documentaiton (HTML apidocs), but not in the .NET documentation (chm file). That may be a documentation bug in the .NET documentation, or would it not be available in .NET? I did not try.

It makes sense that the Content Delivery API is aware of schemas and the broker even stores them. After all, you are able to query on schema id and schema name.

I think you cannot query a list of schemas like you would query Tridion.ContentDelivery.DynamicContent..ComponentPresentation.

3

It makes sense to me. What does not make sense is that the Schemas table only contains Schemas of Components published as DCPs. Components published embedded statically on pages do not get Schemas inserted into he Broker DB as far as I can tell.

1
  • It is true you only have the Schemas for DCPs, I think the reasoning behind that has something to do with the fact that you can Publish a DCP with a Dynamic Template (XSLT) and then the Component Content will be a valid XML Document (which apparently should then match the Schema). But the Schemas date back to the time Tridion supported Tamino as a Broker DB, there it was required to have the Schemas, what their current use is I don't know. Nov 15, 2013 at 12:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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