How to add Document 'Title' and 'Description' fields into the 'Recent Activities' which only contains the Document 'Name'?

cancel
Showing results for 
Search instead for 
Did you mean: 
polc
Member II

How to add Document 'Title' and 'Description' fields into the 'Recent Activities' which only contains the Document 'Name'?

Hi all,

Were using 'Recent activities' dashlet and related email notifications to keep all members aware of each document created or updated.

Given the nature of our documentary policy it isn't enough knowing the document name to understand what's about.

So, we want to add some additional fields on the 'Recent activities' dashlet or into the related email notifications (which use the activities-email.ftl file; if I'm not wrong).

Currently it's only showing the 'Document name'. But we will need to show at least the 'Title' field. Will be great if we can add too the Document Description field.

See attached screenshots for more details.

Does anyone know if is it posible?

Thanks in advance and best regards!

3 Replies
angelborroy
Alfresco Employee

Re: How to add Document 'Title' and 'Description' fields into the 'Recent Activities' which only contains the Document 'Name'?

Probably it's not so simple: you should extend activity list to include description (https://github.com/Alfresco/share/blob/master/share/src/main/resources/alfresco/site-webscripts/org/...) before extending site-activities.get webscript.

Hyland Developer Evangelist
afaust
Master

Re: How to add Document 'Title' and 'Description' fields into the 'Recent Activities' which only contains the Document 'Name'?

It is indeed not so simple. Most (if not all) data for activities is collected at the time the activity is triggered / recorded (to ensure consistency, i.e. the document was named XY at the time it was changed, but now might be named something else). The activities are posted from various places in the Alfresco code, primarily by the client JavaScript POSTing JSON to a specific web script. The JSON is - AFAIK - saved verbatim in the activity post DB table without much processing. Asynchronously, these JSON structures are processed by the FeedProcessor that then generates the personal activity feed entries. At that time, the data of an activity entry is "fixed".

You could extend the activity list to include the "current" description, but you would get a view that may not be consistent with the historic state of the affected element. If you wanted to enhance the data at the time of capture, you might add a facade around ActivityPostService, parse the raw activity JSON, add missing data to it and stringify it again before passing it to the actual service. The inclusion of the title/description in the activity list is then only a matter of overriding the activity templates via custom I18n resource bundles on the Repository-tier (see alfresco/messages/activity-list.properties - custom0/custom1 could be your additions of the title/description, unless provided in the original JSON).

polc
Member II

Re: How to add Document 'Title' and 'Description' fields into the 'Recent Activities' which only contains the Document 'Name'?

Thank @Angel Borroy and @Axel Faust for your replies.

I will keep in mind all information you provided until we've enough time to work on that.

Any other related information will be well received.

I hope it will be useful for other teams.

Thanks again!

PolC