Metadata Service: Doc type, required field, and RDFa date format Velocity snippets

These snippets are useful when working with the Percussion Metadata service.

The Metadata service can parse content with the following document type and html tags:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:perc="http://percussion.com/" lang="en" xml:lang="en">

Date properties need to be in the following format to be parsed correctly:


#set($rdf_date_format = "yyyy-MM-dd'T'HH:mm:ss")##
<meta property="dcterms:created" content="$tools.date.format(${rdf_date_format}, $sys.item.getProperty('rx:yourdatefield').Date)" name="DCTERMS.created" /> 

The dcterms:alternative property is required for content to be indexed. The title field is a good candidate for this:

<title property="dcterms:alternative">#displayfield('displaytitle')</title>

-n