Sametime: Cleanup recorded meetings files in Classic meetings

From Wiki

In Sametime recorded meetings are not cleanup by agent PurgeMeetings.

Se more details in Maintaining the Sametime Meeting Center

To delete Recorded Meetings change the agent PurgeMeetings with the follow code.

search for this line at NotesMain function

else if (safeGetIntegerItem(doc, "STRecord", 0) == 1)
{
   // do nothing 
}

and change to

else if (safeGetIntegerItem(doc, "STRecord", 0) == 1)
{	  
//prn("STRecord=1");
  if (hasDocExpired(doc))
  {
    if (deleteRecordFile(doc))
    {
      deleteDoc(doc);	
    }
  }
}


and add this following code

void sprn(String s)
{
  System.out.println(s);
}

boolean deleteRecordFile(Document doc) {

  boolean deleteSucess = false;

  try
  {
    // Remember to change Here!!!
    String fileRecordPath = "c:\\IBM\\Lotus\\Domino\\MeetingArchive\\";

    String fileRecord = safeGetItem(doc, "STRecordFile", "");     			

    if (!fileRecord.equals("")) {
      String fileName =  fileRecordPath + fileRecord;
      			
      // A File object to represent the filename
      File f = new File(fileName);
    
      // Make sure the file or directory exists and isn't write protected
      if (!f.exists()) {
        sprn("Delete: no such file or directory: " + fileName);
        doc.replaceItemValue("Excluded_STRecordFile", fileRecord);
        doc.replaceItemValue("STRecord", new Integer(0));
        doc.replaceItemValue("STRecordFile", "");
        doc.save();
        return true;
      }
	
      if (!f.canWrite()) {
        sprn("Delete: write protected: " + fileName);
        return false;
      }		
   			
      // If it is a directory, make sure it is empty
      if (f.isDirectory())  {
        sprn("Delete: directory " + fileName);
        return false;
      }
		    
      // Attempt to delete it	     
      boolean success = f.delete();
      //boolean success = true;
			    
      if (!success) { 
        sprn("Delete: deletion failed");
      } else {		    
        sprn("Delete: deletion sucess  [" + fileName + "]");
        doc.replaceItemValue("Excluded_STRecordFile", fileRecord);
        doc.replaceItemValue("STRecord", new Integer(0));
        doc.replaceItemValue("STRecordFile", "");
        doc.save();
        deleteSucess = true;
      }
   }
 }
 catch (Exception e)
 {
   e.printStackTrace();
 }

 return deleteSucess;

}


Ver também