The tagging capabilities in Alfresco and Share provide an easy way for users to associate tags with a piece of content and filter content sets by those tags. It's an excellent way to add more context for other members of a team, and is particularly useful for visual content where there may not be any associated text to describe or enable searching for what's depicted.
Some file formats may contain metadata that can aid in that description and searching, and that metadata is likely something Alfresco can already extract, but we wouldn't get the slick user experience that tags afford us.
'Wait! What if we could map extracted metadata to standard tags?' Hey, that's a great idea!
We introduced the ability to map metadata extraction to tags in 4.2.c, but it's not enabled out of the box. Let's take a quick look at how things worked, what was changed, then how you might use it.
Alfresco's tags are stored and displayed using the cm:taggable property inside the cm:taggable aspect. A type of category node is created for each tag (or linked to if it already exists) and is associated with the tagged content as a property by the TaggingService.
In the past you couldn't just map your free-form string metadata fields to cm:taggable as it's expecting a nodeRef to perform that property linking.
Now we've caught MalformedNodeRefExceptions related to tags in AbstractMappingMetadataExtracter, and if enableStringTagging=true the raw string values will be passed on as is to the next step. There may be some cases where you actually have a tag's nodeRef as a metadata field in your binary file, in which case no MalformedNodeRefException would be thrown and your content would be linked to that existing tag.
Once we've returned to ContentMetadataExtracter the properties modified by the metadata extractor are iterated and set by the NodeService. It's during that process that we look for cm:taggable and use the TaggingService to create or link the raw string tags, provided enableStringTagging=true and the TaggingService is set.
Multi-valued metadata fields are supported of course, and a tag will be created or linked for each value.
How to Use it
Again, to make all this magic happen you must currently set the taggingService property on ContentMetadataExtracter and set enableStringTagging=true. Your overriding bean definition might look like this:
then define your metadata extractor mapping, something like:
IPTC Keywords Example
The Media Management module supports full IPTC extraction for images, which is where keywords used by so many photo editing and organization programs is stored, and a perfect candidate for mapping to Alfresco tags:
What are other metadata fields are you thinking of mapping to tags?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.