[opencms-dev] List the scheduled jobs

Sebastian Himberger sebastian.himberger at gmx.de
Tue Dec 18 13:54:49 CET 2007


Hi,

the problem in your code should be that your creating an new
CmsScheduleManager. Try to obtain an instance accessing the OpenCms
singleton:

CmsScheduleManager manager = OpenCms.getScheduleManager();
List jobs = manager.getJobs();

don't forget to add the "org.opencms.core.*" Import.

best regards,
Sebastian

Celio Faria Jr schrieb:
> Hi all,
>
> I´m using OpenCms 7.0.3, Tomcat 5.5.25 and JDK 1.5, and I want to do a
> very simple list of scheduled jobs, but... OpenCms lists no one, even
> if there are two of them at the Administration view list!
>
> The code I am using is as follows:
>
> <%@page import="org.opencms.main.CmsContextInfo,
>                         org.opencms.scheduler.CmsScheduledJobInfo,
>                         org.opencms.scheduler.CmsScheduleManager ,
>                         org.opencms.file.CmsObject,
>                         org.opencms.jsp.CmsJspBean,
>             java.util.*"%>
> <HTML><BODY>
> <%   
>     CmsJspBean cjb = new CmsJspBean();
>  
>     cjb.init(pageContext,request,response);
>  
>     CmsObject cmsObj = cjb.getCmsObject();
>
>     CmsScheduleManager csm = new CmsScheduleManager();
>         csm.initialize(cmsObj);%>
>     There are <%= csm.getJobs().size()%> scheduled jobs.<BR>
>     
>     <ul>
>
>     <% for (Object object : csm.getJobs()) {
>         CmsScheduledJobInfo jobInfo = (CmsScheduledJobInfo)object; %>
>         <li><%= jobInfo.getId()%> - <%=jobInfo.getJobName()%>
>        
>     <%}%>
>     </ul>
> </BODY></HTML>
>
> Anyone got this problem? Any clues?
>
>
> TIA,
> ------------------------------------------------------------------------
>
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev




More information about the opencms-dev mailing list