Notification when "Effective to" date is reached (document expired)

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

Notification when "Effective to" date is reached (document expired)

Jump to solution

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.

(https://community.alfresco.com/community/ecm/content?filterID=contentstatus%5Bpublished%5D~objecttyp... )

1 Solution

Accepted Solutions
cesarista
Customer

Re: Notification when "Effective to" date is reached (document expired)

Jump to solution

Hi:

Maybe this example helps:

GitHub - zylklab/zk-qshared-effectivity: Public url documents (qshared) with effectivity in Alfresco... 

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.

View solution in original post

9 Replies
afaust
Master

Re: Notification when "Effective to" date is reached (document expired)

Jump to solution

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.

okaboudan
Active Member II

Re: Notification when "Effective to" date is reached (document expired)

Jump to solution

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.

afaust
Master

Re: Notification when "Effective to" date is reached (document expired)

Jump to solution

You should check out the Scheduled Jobs section in the documentation about extension points.

cesarista
Customer

Re: Notification when "Effective to" date is reached (document expired)

Jump to solution

Hi:

Maybe this example helps:

GitHub - zylklab/zk-qshared-effectivity: Public url documents (qshared) with effectivity in Alfresco... 

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.

View solution in original post

okaboudan
Active Member II

Re: Notification when "Effective to" date is reached (document expired)

Jump to solution

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 ?

cesarista
Customer

Re: Notification when "Effective to" date is reached (document expired)

Jump to solution

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.

okaboudan
Active Member II

Re: Notification when "Effective to" date is reached (document expired)

Jump to solution

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 ?

cesarista
Customer

Re: Notification when "Effective to" date is reached (document expired)

Jump to solution

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:

zk-qshared-effectivity/zk-scheduled-action-services-context.xml at master · zylklab/zk-qshared-effec... 

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.

okaboudan
Active Member II

Re: Notification when "Effective to" date is reached (document expired)

Jump to solution

Thanks C, the problem was with the execution time indeed, noob-fault from my part.