cancel
Showing results for 
Search instead for 
Did you mean: 

Moving expired content to a separate folder

davix
Champ in-the-making
Champ in-the-making
Hi,

I was looking at Content Expiry in Alfresco 3.4.

What I want is, when content expires, the content should be moved to a predefined location(a folder). Now I looked at scheduled-jobs-context.xml for the bean avmExpiredContentTrigger that executes the java class 'org.alfresco.repo.avm.AVMExpiredContentJob'. My intention is to look at this class for possible modification that I can do to achieve my requirement.

Now, I've got access to Alfresco svn and have the source code but can't seem to build the solution. Is there a documentation that shows how to proceed once one has the source code?

Please let me know. Thanks!
3 REPLIES 3

mrogers
Star Contributor
Star Contributor
Yes.  Please refer to the wiki.

davix
Champ in-the-making
Champ in-the-making
Thanks, I found what I was looking for.

I need to move expired content to separate folder. So I wanted to modify org.alfresco.repo.avm.AVMExpiredContentProcessor.java. I see that there's a copy method in org.alfresco.service.cmr.avm.AVMServiceImpl.java . I tried using the method like this

String folderPath = nodePath.substring(0, nodePath.lastIndexOf("/")+1);
String destinationFolder = folderPath + "ExpiredContent";
AVMServiceImpl avmImpl = new AVMServiceImpl();
avmImpl.copy(node.getVersionID(), node.getPath(), destinationFolder, "ExpiredContent");
I guess I'm not passing the parameters in the expected format because it doesn't seem to be working. Has anyone used this function to move content to another folder?

Please let me know. Thanks!

romschn
Star Collaborator
Star Collaborator
You do not need to instantiate AVMServiceImpl.

Instead, you can inject the avmService in your class and call the copy method of it.

It will work for you.