03-09-2017 06:28 AM
Hi,
I've been searching all over for this functionality and cannot find it anywhere; basically, what's needed for a document is to have an expiry date (the 'effective to' property for example) and when that date comes, a notification is automatically sent to the user (an email for example).
Is there a built-in option in Alfresco Share for this ? Or is there any known plugins that provide such functionality ?
My apologies if this is a basic question but I couldn't find any answer for it; I even found the tag "document expire,document expire notification", but searching the forum by them, i got no results as well.
03-10-2017 03:31 AM
Hi:
Maybe this example helps:
A cronjob is used with cm:effectivity aspect, to unshare public documents when cm:to is reached. Instead of unsharing public urls, you have to send an email notification.
Regards.
--C.
03-09-2017 08:37 AM
This is a functionality that can usually be implemented quite easily using a CRON job to look up expired documents and the "mail" action to send the notification. Since the style, content and distribution rules for such notifications are usually quite different from customer to customer / use case to use case, no one (I know of) has built a generic solution for this because it would have to be really flexible/complex and each user of such a module would maybe only use 10% of it for their individually simple case.
03-09-2017 09:05 AM
Thanks Axel, you've been really helpful and to the point in all your answers.
I haven't started in any alfresco development activities though since all our needs were already existing . Do you have any ready links that can help me start to understand how to develop and deploy such a functionality?
I don't need to be an expert, just something that would give me the basic step-by-step quick-start.
03-09-2017 09:10 AM
You should check out the Scheduled Jobs section in the documentation about extension points.
03-10-2017 03:31 AM
Hi:
Maybe this example helps:
A cronjob is used with cm:effectivity aspect, to unshare public documents when cm:to is reached. Instead of unsharing public urls, you have to send an email notification.
Regards.
--C.
03-12-2017 07:01 AM
Hi Cesar,
Thank you very much, that's exactly what I need, however I followed the steps on github and it didn't work yet:
1- I downloaded and Jared the source and placed it in "alfresco-community\tomcat\shared\lib" , the jar looks like this:
..
alfresco
META-INF
scrteenshots
build.xml
LICENSE
2- I Started Tomcat, opened alfresco share, went to repository--> data dictionary---> scripts and put the qshared.js file.
Now, when I create a new file in shared, I don't find the effective date added.
Was there anything that I missed ?
03-13-2017 07:23 PM
Hi:
The behaviour is triggered when a document is shared and has a public url, and not when creating a new file in shared (sorry for the misleading terms). The example shows how to program a simple js scheduled job.
Regards.
--C.
03-19-2017 08:47 AM
Thanks, it's working, I just have to refresh the webpage after clicking share for the new "effectivity" attributes to show.
However, when the document is expired, it's still shared, no action has been taken.. when I looked into the logs in "alfresco-community\tomcat\logs", I did not find the logs that were supposed to be written when running the "qshared.js" file, seems it's not being called, any idea what could've gone wrong ?
03-20-2017 07:25 AM
Hi:
Regarding about the logs and the execution of the job, please consider that the cronjob is configured to be executed by default at 00:00. Maybe you are testing the addon locally and your the server is always stopped at this time.
The cron expression is defined here:
You can change this cronjob expression like you want. In fact, there is a commented line for testing purposes.
Other checking may be to put this query in Alfresco Search:
ASPECT:"qshare:shared" AND @cm:to:[MIN TO NOW]
If nothing found you may have problems with your indices, or you do not have contents with qshared and effective aspects applied.
Regards.
--C.
03-21-2017 08:46 AM
Thanks C, the problem was with the execution time indeed, noob-fault from my part.
Explore our Alfresco products with the links below. Use labels to filter content by product module.