[opencms-dev] scheduler still not working

bub habub japorami at yahoo.com
Thu Jul 21 09:01:14 CEST 2005


hello,

unfortunately my scheduler is still not working.

somehow it doesn't find the class that it should
schedule. i couldn't find the class in the real files
either, even though i published the whole project once
more. 

where should that class be in the real file system?

what is the exact path?

here is once more my vfs where i put the
ProjectUpdateReminder class

/system/modules/com.authentication/classes/org/opencms/project/update/ProjectUpdateReminder.class

the package i called org.opencms.proejct.update

my entry in the scheduler class box looks like this:
org.opencms.project.update.ProjectUpdateReminder

by the way what are the parameters good for in 
public String launch(CmsObject cms, java.util.Map
parameters)

what kind of parameters are they and how can i use
them, if i need?

my class looks like this:


package org.opencms.project.update;

import org.apache.commons.mail.*;
import org.opencms.file.*;
import org.opencms.file.collectors.*;
import org.opencms.mail.*;
import org.opencms.flex.*;
import org.opencms.flex.*;
import org.opencms.jsp.*;
import org.opencms.util.CmsUUID;
import org.opencms.scheduler.*;
import java.io.*;
import java.util.*;

public class ProjectUpdateReminder implements
I_CmsScheduledJob
{

	public String launch(CmsObject cms, java.util.Map
parameters) throws java.lang.Exception
	{
	
		

		CmsObject cmsobject =  cms;
		String folder = "/sites/default/release/";
		System.out.println("Current folder=" + folder);
		
		

		
		List listfiles =
cmsobject.getResourcesInFolder(folder,
CmsResourceFilter.DEFAULT_FILES);

		Iterator iterator = listfiles.iterator();
		System.out.println("Items in this folder: list:");
		long lastdate, time;
		Date today = new Date();
		String user = "";

		while (iterator.hasNext())
		{
			CmsFile temp = (CmsFile)iterator.next();
			//out.println(temp);
			lastdate = temp.getDateLastModified();
			//out.println(date);
	
			time = today.getTime();
			//out.println(time);
			if(time-lastdate > 111840950)
			{
				CmsUUID userid = temp.getUserLastModified();
				CmsUser projectleader =
cmsobject.readUser(userid);
		
				//out.println(userid);
				String emailofuser = projectleader.getEmail();
				String lastname = projectleader.getLastname();
				System.out.println(emailofuser);
		
				String url = temp.getRootPath();
				String filename = temp.getName();
				//out.println(url);
				System.out.println(filename);				
				String forwardUri = "mail.jsp";
 		
				

		
				org.opencms.mail.CmsHtmlMail amail = new
org.opencms.mail.CmsHtmlMail();


				amail.addTo(emailofuser);

				//Set From

				String from = "onkel puenktlich";

				amail.setSubject("Please update project"); //
better with a variable for multiple use

				
				CmsFile contentmail=
cmsobject.readFile("user_entry.html");
				
					
				
				String htmlcontent = contentmail.toString();
				System.out.println(htmlcontent);

				amail.setHtmlMsg(htmlcontent);

				// Sending the Email
				amail.send();
				
				user = user + lastname + ","+"";
				 
			}
		}
		return(user);
	}

	
}


/*
try 
{
CmsFile contentmail=
cmsobject.readFile("user_entry.html");
}
catch(Exception e)
{
e.printStackTrace();
}

*/

thank you for your advice

jap


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the opencms-dev mailing list