Skip navigation
All Places > Alfresco Content Services (ECM) > Blog > 2009 > November
2009
wabson

Site tags dashlet improvements

Posted by wabson Employee Nov 16, 2009
If you attended one of the recent Meetups in Europe of the US you may have caught us using the site tags dashlet as an example of how to develop a custom dashlet for Alfresco Share.



Mike Hatfield did a great job of taking my original code and re-working it to shift most of the logic to client-side JS where it should be, as well as adding some funky scoping stuff using a couple of YUI controls.



The resulting code that we demonstrated ourselves in Madrid, and which others showed in other locations has been posted under the Meetups Worldwide space on share.alfresco.com (free login required) as a ZIP file. Also in the bundle is an example of how to extend the Document Library actions in Share with your own custom action.



For the latest version of the dashlet, however, you'll need to head over to the site tags dashlet page. Version 0.1.1 contains a couple of extra lines to sort the tags into alphabetical order before they're displayed - more consistent with other tag clouds I'm told - and the code has also been back-ported to Alfresco 3.1 because a few people asked for this.



The subject of porting dashlets between v3.1 and v3.2 is another topic in itself, as the pattern used to define JS modules in the latest version has improved substantially. I'll try post more on this soon.
pmonks2

Version Baselining

Posted by pmonks2 Nov 3, 2009
One of the great things about working with Alfresco is the vast number of extension points the system offers to developers.  Some of these stem from the pervasive use of the Spring framework, some of them to a well thought out application architecture, and many of them from a number of guiding principles that are consistently applied even when their potential uses aren't necessarily known with certainty ahead of time.



I recently had the pleasure of being reminded of this latter case when a customer asked for an extension that allowed their content contributors to control the 'baseline' version number of documents in their Alfresco installation.  The idea was to allow their contributors to (optionally) enter a version number along with each document, and have the Alfresco versioning system start with that version number instead of the default of 1.0.



Although I didn't know how this might be achieved, in less than 10 minutes I had my answer and it relied on a slight variation of a mechanism that I'd used in the past.  The customer was also gracious enough to release the IP, so I've made the initial version of the extension available on google code.



Here is a brief overview of its usage:



This extension works by extending Alfresco with a custom content type called 'Version Baselined Content' that includes a single property called 'Base Version'.  This property is where the content contributor can set the base version to be used if/when versioning is enabled on the document.



In order to create content of this type, 'Version Baselined Content' needs to be selected in the 'Type' dropdown of the 'Add Content Dialog':





Provided the 'Modify all properties when this page closes' checkbox is left checked (the default), the contributor will then be presented with the option to specify the base version number for this document (if/when versioning is enabled):





The default value for this field is '0.1' – if the contributor elects to skip modification of the new content's properties, this is the base version number it will be assigned automatically.



The base version number must be a valid non-negative decimal number (ie. it must be a number greater than or equal to 0.0).  If an invalid value is entered, an error will be displayed when the user clicks the 'OK' button.



Once the version number is populated, it may be edited via the document's properties as many times as are necessary, up until the time versioning is enabled for the document:





Once versioning is enabled for the document, the initial version number will be set to the value of the 'Base Version Number' property at that time:





From this point on, any modifications to the 'Base Version Number' property will be ignored as it is not possible to renumber an existing Alfresco version history.



Other than allowing explicit control over the initial version number for a document, this extension does not change any other versioning behavior in the system.  For example creating a new minor revision of a document (via checkout and checkin) will increment the version number by 0.1.  Similarly, creating a new major revision of a document (via checkout and checkin) will increment the major component of the version number by 1, and set the minor component to 0:

 







While the extension is quite neat and (due to the generosity of the customer) available for anyone to use, refine and extend, what really grabbed me as I developed it was how, despite having no prior experience with this particular extension point, it was familiar enough that I was able to understand it almost immediately and leverage it to achieve the desired goal.

Filter Blog

By date: By tag: