In almost every tender, RFQ, RFI, or whatever you want to call it, that goes out in Australia there is a mandatory request to support the AGLS Metadata Standard. In governmental type of tenders there are no exception to this rule. To best describe what AGLS Metadata is I’m going to quote the AGLS Metadata web site;
“The AGLS Metadata Standard is a set of descriptive properties to improve visibility and availability of online resources.”
It is a standard used to add metadata to almost any type of resource, but in my case – since I’m working with EPiServer CMS – I’m going to apply it to web pages and also talk about it from this perspective. There are a number of ways to add custom metadata tags to EPiServer pages, and this is also what I tend to say to partners responsible for replying to the already mentioned tenders, RFQs, RFIs… But since the AGLS Metadata support is so common I decided to create an out-of-the-box solution that will add the AGLS Metadata Standard support to EPiServer.
In my work I have used the AGLS Metadata Standard Part 2, Usage Guide (PDF) as reference on how to implement AGLS on web sites. This document is recently updated (mid August 2010) and if you have a look around at random governmental web sites in Australia you will find that most of them still use the legacy implementation mentioned in the document. However since I’m doing a fresh implementation I will go for the new way of adding the metadata tags.
From the Usage Guide you will find that AGLS Metadata is an application profile of Dublin Core metadata standard. This is almost the same as saying that AGLS is a superset of Dublin Core. With this said I decided to make a component that supports both Dublin Core and AGLS, you can simply choose which of these two metadata standards you want to use on your web site.
Dublin Core support for EPiServer CMS has been built before. I think Ben’s implementation is pretty cool, however I decided to take a slightly different approach since I wanted to give the editors an easy way of overriding the default values. To solve this I decided to make use of PageTypeBuilder and create two page base classes; one for Dublin Core and one for AGLS. These base classes will add properties to your PageType corresponding to the elements in Dublin Core and AGLS. All the properties will show up on a Metadata tab on the page with a few exceptions, since some of the properties are always automatically added. The automatic properties are;
- DCTERMS.created – The creation date of the page
- DCTERMS.modified – The modified date of the page
- DCTERMS.format – Will be “text/html”
- DCTERMS.identifier – Url to the page
- DCTERMS.language – Language branch of the page
- AGLSTERMS.availability – Url to the page
To add support for either of the metadata standards you simply inherit from either EPiXternal.Metadata.PageTypes.DublinCore or EPiXternal.Metadata.PageTypes.AGLS – as you have understood by now you have to be using PageTypeBuilder in your project. Then you just have to add the MetadataIncluder web control to the head tag of your MasterPage. This control will look at the current page type and include metadata elements if the page is of type DublinCore or AGLS.
<EPiXternal:MetaData ID="MetaData" runat="server" />
This is how it would like if you view the source of a page implementing AGLS.
<link rel="schema.DCTERMS" href="http://purl.org/dc/terms/" /> <link rel="schema.AGLSTERMS" href="http://www.agls.gov.au/agls/terms/" /> <meta name="DCTERMS.title" content="Sample Article" /> <meta name="DCTERMS.description" content="This is a sample article using the AGLS plugin" /> <meta name="DCTERMS.created" scheme="DCTERMS.ISO8601" content="2010-08-19T21:24+10:00" /> <meta name="DCTERMS.modified" scheme="DCTERMS.ISO8601" content="2010-08-19T21:24+10:00" /> <meta name="DCTERMS.format" scheme="DCTERMS.IMT" content="text/html" /> <meta name="DCTERMS.language" scheme="DCTERMS.RFC4646" content="en" /> <meta name="DCTERMS.publisher" content="EPiServer Australia Pty Ltd" /> <meta name="DCTERMS.creator" content="tom" /> <meta name="DCTERMS.coverage" content="World" /> <meta name="DCTERMS.rights" scheme="DCTERMS.URI" content="http://pagetypebuilder.local/Copyright/" /> <meta name="DCTERMS.identifier" scheme="DCTERMS.URI" content="http://pagetypebuilder.local/Sample-Article/" /> <meta name="DCTERMS.type" scheme="DCMIType" content="episerver sample code" /> <meta name="DCTERMS.subject" content="episerver sample code" /> <meta name="AGLSTERMS.availability" scheme="DCTERMS.URI" content="http://pagetypebuilder.local/Sample-Article/" /> <meta name="AGLSTERMS.function" content="education" /> <meta name="AGLSTERMS.aggregationLevel" content="collection" /> <meta name="AGLSTERMS.category" content="service" /> <meta name="AGLSTERMS.documentType" content="guidelines" /> <meta name="AGLSTERMS.serviceType" content="training" />
Almost all of the properties will have default values if the properties are not set on the specific page. The default value of each of the properties in edit mode is stated in the help text. The editor also have the possibility to override the defaults by specifying a fallback value on the corresponding properties on the start page. If for some reason you have a fallback value on the start page, but you don’t want it to be displayed for a specific property on a specific page you can just insert a “-“ which will cause the MetadataIncluder to omit that property on the page.
I hope this will make all of our partners in Australia, and maybe some in UK as well since Dublin Core is big over there. The source code can be downloaded here – enjoy!
Disclaimer: Please not that the code comes as-is and I will not be held responsible.