Generating Checksums for Alfresco Content

Inspired from Chris Paul’s blog and work

I was reading about Alfresco Global Virtual Hack-a-thon scheduled to be on 17th April 2015 and going through the list of Projects came across - Document Checksuming and display in Share. My bookmark’s collection had Chris’s blog and thought of bootstrapping myself for hackathon by rewriting the whole work done by Chris using Alfresco SDK 2.0 on 5.0.c.

Below are the brief details about my approach:

    mvn archetype:generate -Dfilter=org.alfresco.maven.archetype:


package org.ootb.model;
import org.alfresco.service.namespace.QName;

public interface ChecksumModel {
    static final String CHKSUM_MODEL_URI    = "";
    static final String CHKSUM_MODEL_PREFIX = "ootb";
    static final QName ASPECT_HASHABLE = QName.createQName(CHKSUM_MODEL_URI, "hashable");
    static final QName PROP_HASHTYPE   = QName.createQName(CHKSUM_MODEL_URI, "hashType");
    static final QName PROP_HASHVALUE  = QName.createQName(CHKSUM_MODEL_URI, "hashValue");
<config evaluator="string-compare" condition="DocumentLibrary" replace="true">
     <!-- Aspects that a user can see -->
        <aspect name="ootb:hashable" />

This should make the Hashable aspect visible in the list of aspects available to add when the user clicks on “Manage Aspects” from document-actions. Manage Aspects

<bean id="ootb.custom.resources" class="">
  <property name="resourceBundles">
<!-- Display the Hashable properties -->
<config evaluator="node-type" condition="cm:content">
                <show id="ootb:hashType" />
                <show id="ootb:hashValue" />
                <field id="ootb:hashValue" read-only="true" />
  • Defined within the DocumentLibrary config section, status indicators are small icons typically used to indicate the presence of an aspect.
  • Indicator images are by default reference by id: /res/components/documentlibrary/indicators/{id}-16.png unless the name is overridden by the “icon” attribute.
<indicator id="hashable" index="10" icon="hashable-16.png">
<bean id="evaluator.doclib.indicator.hashable" class="org.ootb.web.evaluator.doclib.indicator.ChecksumEvaluator">
The complete source code for this example is available on GitHub.