cancel
Showing results for 
Search instead for 
Did you mean: 

(How) Does the complianceable aspect (remove after) work?

bvsoest
Champ in-the-making
Champ in-the-making
Hi,

I added the complianceable aspect to a document. I set the remove after date. I waited …
Nothing. Do I have to do a search & destroy myself?
If so, do you have an example script?
Thanks in advance for any info!
Regards, Berno.
5 REPLIES 5

lock999
Champ in-the-making
Champ in-the-making
Hi,

Did you find out how this works? Is removeAfter like the expiration date of the document? Will the document come up in search beyond its removeAfter date?

Thanks

chandu7ee
Champ in-the-making
Champ in-the-making
Even its not working for me also ., i tried it in alfresco and share.

any solution.

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

The Complianceable aspect doesn't have behaviour associated with it.  See:

http://wiki.alfresco.com/wiki/Complianceable

Darryl

chandu7ee
Champ in-the-making
Champ in-the-making
Is there any way to find out  "remove after date"   using java script API , so that i can run script to delete file.  after that specified date.

chandu7ee
Champ in-the-making
Champ in-the-making
Hey guys got it….  Smiley Very Happy


here is the code to work with complianceable aspect, add this js to scheduled task, so that ur aspect will work perfectly.

var log = "Script Excecuted For complianceable aspect (remove after) work?  \n\n";
var logFile = companyhome.childByNamePath("complianceable_log.txt");
var presentDate =  new Date();
var docRemoveDate;

  if (logFile == null)
{
   logFile = companyhome.createFile("complianceable_log.txt");
}

var isCompAdded = "ASPECT:\"{http://www.alfresco.org/model/content/1.0}complianceable\"";

var searchQuery = isCompAdded  ;

var results = search.luceneSearch(searchQuery);


for(var i=0; i<=results.length; i++)
{
  if(results != null)
   {
      docRemoveDate =  results.removeAfter;
      log +=  "File Name:" + results.properties.name  + "\t" +"Remove Date:" + results.removeAfter  + "\n";
      if(docRemoveDate < presentDate)
             results.remove();      
   }
}

logFile.content += log;