cancel
Showing results for 
Search instead for 
Did you mean: 

Content/Document Expiry

msj4u
Champ in-the-making
Champ in-the-making
Hi,

I want to set expiry of a document that I am uploading the document in alfresco explorer.

And when the document is about to expire i want to notify the user who uploaded that.

How to achieve this ?

I can do the source code changes and have done some of those.

Thanks
9 REPLIES 9

niketapatel
Star Contributor
Star Contributor
You may implement as per below

1)You can have your custom model
2)Define aspect and expiry property of type date
3)Apply this aspect, may be by rule and set expiry date on contents
4)Implement custom scheduler which checks for expired contents and accordingly send email notification to user

Hope it helps!

msj4u
Champ in-the-making
Champ in-the-making
Thanks that helped

now looking to how to write a scheduler

jpotts
World-Class Innovator
World-Class Innovator
There is no reason to write a scheduler. Alfresco already ships with a built-in scheduler. What you need to write is a scheduled action. See if this helps: http://wiki.alfresco.com/wiki/Scheduled_Actions

Jeff

msj4u
Champ in-the-making
Champ in-the-making
Thanks Jeff,

Have added aspect with the expiry property; was already looking at scheduled action but your reply confirmed that am on right track.

msj4u
Champ in-the-making
Champ in-the-making
Hi Jeff,

For writing custom action i posted the question as well @ https://forums.alfresco.com/forum/developer-discussions/repository-services/scheduled-action-not-ret...

But I debugged into the advance search that was using the LuceneAlfrescoLuceneQueryLanguage.java class i got the lucene query as
+(+@{http://www.123company.com/product123/model/content/1.0}expiry:[2013-01-01 TO 2014-01-07] +((TYPE:{http://www.alfresco.org/model/calendar}calendarEvent TYPE:{http://www.alfresco.org/model/bpm/1.0}workflowTask TYPE:{http://www.alfresco.org/model/linksmodel/1.0}link TYPE:{http://www.alfresco.org/model/imap/1.0}imapBody TYPE:{http://www.alfresco.org/model/workflow/invite/nominated/1.0}invitePendingTask TYPE:{http://www.alfresco.org/model/workflow/invite/nominated/1.0}rejectInviteTask TYPE:{http://www.alfresco.org/model/workflow/invite/nominated/1.0}activitiInvitePendingTask TYPE:{http://www.alfresco.org/model/bpm/1.0}startTask TYPE:{http://www.alfresco.org/model/workflow/invite/moderated/1.0}moderatedInvitationReviewTask TYPE:{http://www.alfresco.org/model/wcmworkflow/1.0}submitReviewTask TYPE:{http://www.alfresco.org/model/wcmmodel/1.0}avmplaincontent TYPE:{http://www.alfresco.org/model/workflow/1.0}reviewTask TYPE:{http://www.alfresco.org/model/content/1.0}dictionaryModel TYPE:{http://www.alfresco.org/model/forum/1.0}post TYPE:{http://www.alfresco.org/model/transfer/1.0}transferReportDest TYPE:{http://www.alfresco.org/model/workflow/invite/nominated/1.0}inviteToSiteTask TYPE:{http://www.alfresco.org/model/wcmworkflow/1.0}submittedTask TYPE:{http://www.alfresco.org/model/wcmworkflow/1.0}approvedTask TYPE:{http://www.alfresco.org/model/workflow/1.0}submitGroupReviewTask TYPE:{http://www.alfresco.org/model/datalist/1.0}issue TYPE:{http://www.alfresco.org/model/workflow/1.0}rejectedTask TYPE:{http://www.alfresco.org/model/workflow/invite/nominated/1.0}acceptInviteTask TYPE:{http://www.alfresco.org/model/workflow/1.0}approvedTask TYPE:{http://www.alfresco.org/model/wcmworkflow/1.0}submitWebContentTask TYPE:{http://www.alfresco.org/model/wcmworkflow/1.0}startTask TYPE:{http://www.alfresco.org/model/wcmworkflow/1.0}parallelReviewTask TYPE:{http://www.alfresco.org/model/wcmappmodel/1.0}deploymentreport TYPE:{http://www.alfresco.org/model/workflow/1.0}completedAdhocTask TYPE:{http://www.alfresco.org/model/content/1.0}content TYPE:{http://www.alfresco.org/model/bpm/1.0}task TYPE:{http://www.alfresco.org/model/wcmworkflow/1.0}submittedDirectTask TYPE:{http://www.alfresco.org/model/transfer/1.0}tempTransferStore TYPE:{http://www.alfresco.org/model/calendar}ignoreEvent TYPE:{http://www.alfresco.org/model/datalist/1.0}meetingAgenda TYPE:{http://www.alfresco.org/model/bpm/1.0}activitiOutcomeTask TYPE:{http://www.alfresco.org/model/bpm/1.0}activitiStartTask TYPE:{http://www.alfresco.org/model/workflow/1.0}submitParallelReviewTask TYPE:{http://www.alfresco.org/model/wcmworkflow/1.0}reviewTask TYPE:{http://www.alfresco.org/model/workflow/1.0}approvedParallelTask TYPE:{http://www.alfresco.org/model/workflow/1.0}activitiReviewTask TYPE:{http://www.alfresco.org/model/workflow/1.0}adhocTask TYPE:{http://www.alfresco.org/model/content/1.0}savedquery TYPE:{http://www.alfresco.org/model/cmis/custom}document TYPE:{http://www.alfresco.org/model/transfer/1.0}transferReport TYPE:{http://www.alfresco.org/model/datalist/1.0}task TYPE:{http://www.alfresco.org/model/wcmworkflow/1.0}submitChangeRequestTask TYPE:{http://www.alfresco.org/model/transfer/1.0}transferRecord TYPE:{http://www.alfresco.org/model/transfer/1.0}transferLock TYPE:{http://www.alfresco.org/model/wcmmodel/1.0}avmlayeredcontent TYPE:{http://www.alfresco.org/model/workflow/1.0}submitAdhocTask TYPE:{http://www.alfresco.org/model/workflow/invite/moderated/1.0}moderatedInvitationSubmitTask TYPE:{http://www.alfresco.org/model/datalist/1.0}location TYPE:{http://www.alfresco.org/model/bpm/1.0}workflowDefinition TYPE:{http://www.alfresco.org/model/datalist/1.0}simpletask TYPE:{http://www.alfresco.org/model/workflow/invite/moderated/1.0}activitiModeratedInvitationReviewTask TYPE:{http://www.alfresco.org/model/workflow/1.0}submitReviewTask TYPE:{http://www.alfresco.org/model/datalist/1.0}dataListItem TYPE:{http://www.alfresco.org/model/wcmworkflow/1.0}rejectedTask TYPE:{http://www.alfresco.org/model/wcmworkflow/1.0}changeRequestTask TYPE:{http://www.alfresco.org/model/datalist/1.0}todoList TYPE:{http://www.alfresco.org/model/publishingworkflow/1.0}startPublish TYPE:{http://www.alfresco.org/model/datalist/1.0}contact TYPE:{http://www.alfresco.org/model/wcmworkflow/1.0}submitpendingTask TYPE:{http://www.alfresco.org/model/wcmworkflow/1.0}submitfailedTask TYPE:{http://www.alfresco.org/model/wcmmodel/1.0}avmcontent TYPE:{http://www.alfresco.org/model/wcmworkflow/1.0}workflowTask TYPE:{http://www.alfresco.org/model/workflow/1.0}inviteToSiteTask TYPE:{http://www.alfresco.org/model/workflow/1.0}submitConcurrentReviewTask TYPE:{http://www.alfresco.org/model/wcmworkflow/1.0}submitcancelledTask TYPE:{http://www.alfresco.org/model/wcmworkflow/1.0}submitDirectTask TYPE:{http://www.alfresco.org/model/wcmworkflow/1.0}verifyBrokenLinksTask TYPE:{http://www.alfresco.org/model/workflow/1.0}rejectedParallelTask TYPE:{http://www.alfresco.org/model/datalist/1.0}eventAgenda TYPE:{http://www.alfresco.org/model/imap/1.0}imapAttach TYPE:{http://www.alfresco.org/model/download/1.0}download TYPE:{http://www.alfresco.org/model/datalist/1.0}event) (TYPE:{http://www.alfresco.org/model/content/1.0}systemfolder TYPE:{http://www.alfresco.org/model/wcmappmodel/1.0}webfolder TYPE:{http://www.alfresco.org/model/transfer/1.0}fileTransferTarget TYPE:{http://www.alfresco.org/model/publishing/1.0}DeliveryChannel TYPE:{http://www.alfresco.org/model/wcmmodel/1.0}avmlayeredfolder TYPE:{http://www.alfresco.org/model/publishing/facebook/1.0}DeliveryChannel TYPE:{http://www.alfresco.org/model/wcmmodel/1.0}avmplainfolder TYPE:{http://www.alfresco.org/model/publishing/1.0}Environment TYPE:{http://www.alfresco.org/model/publishing/1.0}SiteChannelContainer TYPE:{http://www.alfresco.org/model/publishing/linkedin/1.0}DeliveryChannel TYPE:{http://www.alfresco.org/model/application/1.0}glossary TYPE:{http://www.alfresco.org/model/transfer/1.0}transferTarget TYPE:{http://www.alfresco.org/model/site/1.0}sites TYPE:{http://www.alfresco.org/model/action/1.0}savedactionfolder TYPE:{http://www.alfresco.org/model/publishing/twitter/1.0}DeliveryChannel TYPE:{http://www.alfresco.org/model/application/1.0}configurations TYPE:{http://www.alfresco.org/model/wcmmodel/1.0}avmfolder TYPE:{http://www.alfresco.org/model/datalist/1.0}dataList TYPE:{http://www.alfresco.org/model/wcmappmodel/1.0}formfolder TYPE:{http://www.alfresco.org/model/publishing/flickr/1.0}DeliveryChannel TYPE:{http://www.alfresco.org/model/forum/1.0}forum TYPE:{http://www.alfresco.org/model/transfer/1.0}transferGroup TYPE:{http://www.alfresco.org/model/content/1.0}folder TYPE:{http://www.alfresco.org/model/forum/1.0}forums TYPE:{http://www.alfresco.org/model/site/1.0}site TYPE:{http://www.alfresco.org/model/forum/1.0}topic TYPE:{http://www.alfresco.org/model/calendar}calendar TYPE:{http://www.alfresco.org/model/bpm/1.0}package TYPE:{http://www.alfresco.org/model/cmis/custom}folder TYPE:{http://www.alfresco.org/model/publishing/youtube/1.0}DeliveryChannel TYPE:{http://www.alfresco.org/model/publishing/slideshare/1.0}DeliveryChannel))) -(ASPECT:{http://www.alfresco.org/model/system/1.0}hidden)


and when i used the same query in the query template i still didn't got any hit.

it was really strange for me.

msj4u
Champ in-the-making
Champ in-the-making
Hi Jeff,

posted my question to a different thread i am unable to find the expirable nodes. Debugging the advance search in alfresco explorer code and <java>LuceneAlfrescoLuceneQueryLanguage</java> class i got the lucene query that was returning hits as
+(+@{http://www.123company.com/product123/model/content/1.0}expiry:[2013-01-01 TO 2014-01-07] +((TYPE:{http://www.alfresco.org/model/calendar}calendarEvent TYPE:{http://www.alfresco.org/model/bpm/1.0}workflowTask TYPE:{http://www.alfresco.org/model/linksmodel/1.0}link TYPE:{http://www.alfresco.org/model/imap/1.0}imapBody TYPE:{http://www.alfresco.org/model/workflow/invite/nominated/1.0}invitePendingTask TYPE:{http://www.alfresco.org/model/workflow/invite/nominated/1.0}rejectInviteTask TYPE:{http://www.alfresco.org/model/workflow/invite/nominated/1.0}activitiInvitePendingTask TYPE:{http://www.alfresco.org/model/bpm/1.0}startTask TYPE:{http://www.alfresco.org/model/workflow/invite/moderated/1.0}moderatedInvitationReviewTask TYPE:{http://www.alfresco.org/model/wcmworkflow/1.0}submitReviewTask TYPE:{http://www.alfresco.org/model/wcmmodel/1.0}avmplaincontent TYPE:{http://www.alfresco.org/model/workflow/1.0}reviewTask TYPE:{http://www.alfresco.org/model/content/1.0}dictionaryModel TYPE:{http://www.alfresco.org/model/forum/1.0}post TYPE:{http://www.alfresco.org/model/transfer/1.0}transferReportDest TYPE:{http://www.alfresco.org/model/workflow/invite/nominated/1.0}inviteToSiteTask TYPE:{http://www.alfresco.org/model/wcmworkflow/1.0}submittedTask TYPE:{http://www.alfresco.org/model/wcmworkflow/1.0}approvedTask TYPE:{http://www.alfresco.org/model/workflow/1.0}submitGroupReviewTask TYPE:{http://www.alfresco.org/model/datalist/1.0}issue TYPE:{http://www.alfresco.org/model/workflow/1.0}rejectedTask TYPE:{http://www.alfresco.org/model/workflow/invite/nominated/1.0}acceptInviteTask TYPE:{http://www.alfresco.org/model/workflow/1.0}approvedTask TYPE:{http://www.alfresco.org/model/wcmworkflow/1.0}submitWebContentTask TYPE:{http://www.alfresco.org/model/wcmworkflow/1.0}startTask TYPE:{http://www.alfresco.org/model/wcmworkflow/1.0}parallelReviewTask TYPE:{http://www.alfresco.org/model/wcmappmodel/1.0}deploymentreport TYPE:{http://www.alfresco.org/model/workflow/1.0}completedAdhocTask TYPE:{http://www.alfresco.org/model/content/1.0}content TYPE:{http://www.alfresco.org/model/bpm/1.0}task TYPE:{http://www.alfresco.org/model/wcmworkflow/1.0}submittedDirectTask TYPE:{http://www.alfresco.org/model/transfer/1.0}tempTransferStore TYPE:{http://www.alfresco.org/model/calendar}ignoreEvent TYPE:{http://www.alfresco.org/model/datalist/1.0}meetingAgenda TYPE:{http://www.alfresco.org/model/bpm/1.0}activitiOutcomeTask TYPE:{http://www.alfresco.org/model/bpm/1.0}activitiStartTask TYPE:{http://www.alfresco.org/model/workflow/1.0}submitParallelReviewTask TYPE:{http://www.alfresco.org/model/wcmworkflow/1.0}reviewTask TYPE:{http://www.alfresco.org/model/workflow/1.0}approvedParallelTask TYPE:{http://www.alfresco.org/model/workflow/1.0}activitiReviewTask TYPE:{http://www.alfresco.org/model/workflow/1.0}adhocTask TYPE:{http://www.alfresco.org/model/content/1.0}savedquery TYPE:{http://www.alfresco.org/model/cmis/custom}document TYPE:{http://www.alfresco.org/model/transfer/1.0}transferReport TYPE:{http://www.alfresco.org/model/datalist/1.0}task TYPE:{http://www.alfresco.org/model/wcmworkflow/1.0}submitChangeRequestTask TYPE:{http://www.alfresco.org/model/transfer/1.0}transferRecord TYPE:{http://www.alfresco.org/model/transfer/1.0}transferLock TYPE:{http://www.alfresco.org/model/wcmmodel/1.0}avmlayeredcontent TYPE:{http://www.alfresco.org/model/workflow/1.0}submitAdhocTask TYPE:{http://www.alfresco.org/model/workflow/invite/moderated/1.0}moderatedInvitationSubmitTask TYPE:{http://www.alfresco.org/model/datalist/1.0}location TYPE:{http://www.alfresco.org/model/bpm/1.0}workflowDefinition TYPE:{http://www.alfresco.org/model/datalist/1.0}simpletask TYPE:{http://www.alfresco.org/model/workflow/invite/moderated/1.0}activitiModeratedInvitationReviewTask TYPE:{http://www.alfresco.org/model/workflow/1.0}submitReviewTask TYPE:{http://www.alfresco.org/model/datalist/1.0}dataListItem TYPE:{http://www.alfresco.org/model/wcmworkflow/1.0}rejectedTask TYPE:{http://www.alfresco.org/model/wcmworkflow/1.0}changeRequestTask TYPE:{http://www.alfresco.org/model/datalist/1.0}todoList TYPE:{http://www.alfresco.org/model/publishingworkflow/1.0}startPublish TYPE:{http://www.alfresco.org/model/datalist/1.0}contact TYPE:{http://www.alfresco.org/model/wcmworkflow/1.0}submitpendingTask TYPE:{http://www.alfresco.org/model/wcmworkflow/1.0}submitfailedTask TYPE:{http://www.alfresco.org/model/wcmmodel/1.0}avmcontent TYPE:{http://www.alfresco.org/model/wcmworkflow/1.0}workflowTask TYPE:{http://www.alfresco.org/model/workflow/1.0}inviteToSiteTask TYPE:{http://www.alfresco.org/model/workflow/1.0}submitConcurrentReviewTask TYPE:{http://www.alfresco.org/model/wcmworkflow/1.0}submitcancelledTask TYPE:{http://www.alfresco.org/model/wcmworkflow/1.0}submitDirectTask TYPE:{http://www.alfresco.org/model/wcmworkflow/1.0}verifyBrokenLinksTask TYPE:{http://www.alfresco.org/model/workflow/1.0}rejectedParallelTask TYPE:{http://www.alfresco.org/model/datalist/1.0}eventAgenda TYPE:{http://www.alfresco.org/model/imap/1.0}imapAttach TYPE:{http://www.alfresco.org/model/download/1.0}download TYPE:{http://www.alfresco.org/model/datalist/1.0}event) (TYPE:{http://www.alfresco.org/model/content/1.0}systemfolder TYPE:{http://www.alfresco.org/model/wcmappmodel/1.0}webfolder TYPE:{http://www.alfresco.org/model/transfer/1.0}fileTransferTarget TYPE:{http://www.alfresco.org/model/publishing/1.0}DeliveryChannel TYPE:{http://www.alfresco.org/model/wcmmodel/1.0}avmlayeredfolder TYPE:{http://www.alfresco.org/model/publishing/facebook/1.0}DeliveryChannel TYPE:{http://www.alfresco.org/model/wcmmodel/1.0}avmplainfolder TYPE:{http://www.alfresco.org/model/publishing/1.0}Environment TYPE:{http://www.alfresco.org/model/publishing/1.0}SiteChannelContainer TYPE:{http://www.alfresco.org/model/publishing/linkedin/1.0}DeliveryChannel TYPE:{http://www.alfresco.org/model/application/1.0}glossary TYPE:{http://www.alfresco.org/model/transfer/1.0}transferTarget TYPE:{http://www.alfresco.org/model/site/1.0}sites TYPE:{http://www.alfresco.org/model/action/1.0}savedactionfolder TYPE:{http://www.alfresco.org/model/publishing/twitter/1.0}DeliveryChannel TYPE:{http://www.alfresco.org/model/application/1.0}configurations TYPE:{http://www.alfresco.org/model/wcmmodel/1.0}avmfolder TYPE:{http://www.alfresco.org/model/datalist/1.0}dataList TYPE:{http://www.alfresco.org/model/wcmappmodel/1.0}formfolder TYPE:{http://www.alfresco.org/model/publishing/flickr/1.0}DeliveryChannel TYPE:{http://www.alfresco.org/model/forum/1.0}forum TYPE:{http://www.alfresco.org/model/transfer/1.0}transferGroup TYPE:{http://www.alfresco.org/model/content/1.0}folder TYPE:{http://www.alfresco.org/model/forum/1.0}forums TYPE:{http://www.alfresco.org/model/site/1.0}site TYPE:{http://www.alfresco.org/model/forum/1.0}topic TYPE:{http://www.alfresco.org/model/calendar}calendar TYPE:{http://www.alfresco.org/model/bpm/1.0}package TYPE:{http://www.alfresco.org/model/cmis/custom}folder TYPE:{http://www.alfresco.org/model/publishing/youtube/1.0}DeliveryChannel TYPE:{http://www.alfresco.org/model/publishing/slideshare/1.0}DeliveryChannel))) -(ASPECT:{http://www.alfresco.org/model/system/1.0}hidden)


But when i used the same query in my query template of my scheduled-action-services-context.xml file i get no hit.

It's really strange the generated query is exactly same as it is in the explorer's advance search.

msj4u
Champ in-the-making
Champ in-the-making
scheduled the job but was unable to get the results

topic posted here https://forums.alfresco.com/forum/developer-discussions/repository-services/scheduled-action-not-ret...

any idea ?

jasonschroeder
Champ in-the-making
Champ in-the-making
Was wondering if you got this working.  We are looking at putting something into place to manage policy renewals and am reading through a lot of guides.  If you could share some working code and instructions I would be eternally grateful.  Thanks jason

msj4u
Champ in-the-making
Champ in-the-making
nope no body replied not getting my results; actually i was using it under multi tenant environment and i guess scheduler works and pulls results only works in non multi tenant or single tenant environment. so i got this working on my application side not from alfresco Smiley Sad