cancel
Showing results for 
Search instead for 
Did you mean: 

Expire Web Content

preetigupta
Champ in-the-making
Champ in-the-making
Hi,

I am testing expiration capabilities in Alfresco 3.2
I tested the change request workflow. I have a requirement where on reaching the expiration date, content should be physically deleted from the file system(deployment target), but not from the repository

Please let me know, how can I achieve this.

Thanks and Regards
Preeti Gupta
7 REPLIES 7

mrogers
Star Contributor
Star Contributor
Normally content would be "deleted" after expiration and then this change can be deployed.

Why do you want and mean by "to keep deleted content"?  Remember that the even though you have deleted the content it is still there in the version history.

preetigupta
Champ in-the-making
Champ in-the-making
Hi,

I just tested in Alfresco 3.2 Community Edition and 3.1. It does not delete from the target file system. It keeps it there and sends a workflow task to review and resubmit it.
My requirement is that the file should be deleted from the target site at time of expiration. That is, it should not be available to users any more.

Its upto reviewer then to resubmit it.

Kindly help me in this.

Regards
Preeti Gupta

tommorris
Champ in-the-making
Champ in-the-making
Hi there,

One way to achieve what you want (which is also what we've done) is to define your own expirey component.

If you look inside the file 'scheduled-jobs-context.xml' (alfresco version 2.2.5) you'll see a scheduled task defined by a bean named 'avmExpiredContentTrigger'. It's scheduled to activate at 3:30am every morning.

This bean executes the java class 'org.alfresco.repo.avm.AVMExpiredContentJob'.

Instead of using this you could write you own version of this class, to simply the delete the content instead of activating a workflow with the expirey-reminder task (which is what it currently does). You could reference the source code of this existing class as inspiration for your own.

It's pretty straightforward to do, but it's a bit laborious to write the routine to delete the node from a user sandbox (dedicated for this process alone), and then activate the workflow which asynchronously promotes the deletion to the staging sandbox.

Tom
http://www.ixxus.com

preetigupta
Champ in-the-making
Champ in-the-making
Hi,

Thanks so much for the direction. I would try to do the way you have suggested.
So as per my understanding, you suggest me to call my custom class , and then delete the file from the physical file system. (Normal Java File operation)
Is there anything else I need to do?


Regards,
Preeti Gupta

tommorris
Champ in-the-making
Champ in-the-making
Well, I suppose you could delete from the file system if you've enabled CIFS (or FTP / WebDAV), but it's probably better to use the 'removeNode' method on the AVMService service.

Remember, I believe best-practice is not to edit the staging sandbox directly, but instead to make changes within a user-sandbox, which then needs to be submitted/promoted to the staging sandbox.

mrogers
Star Contributor
Star Contributor
Never, ever modify the file system directly, to do so will corrupt your repository! 

The staging sandbox should be read-only to prevent you from being able to edit it directly.    You may decide to "undo" your delete some time in the future.

Look at these methods
     AssetService.deleteAsset();
     SandboxService.submitAll()

tommorris
Champ in-the-making
Champ in-the-making
It depends which alfresco version you're using.
But mrogers is correct in asserting that you shouldn't change the staging-sandbox directly, even if you can.

Incidentally Preeti, I assumed you meant alfresco's virtual-filesystem, not the actual content-store. If you did not mean the virtual-filesystem (i.e. Alfresco-CIFS), then heed the advice of mrogers. Either way, I'd stick to the AVMService (or useful equivalent), if I were you.