AW: [opencms-dev] Scheduled tasks / Access denied

Peter Glantschnig peter.glantschnig at gmx.at
Wed Nov 19 19:02:01 CET 2003


ok, thanks, that works! But now I have another very strange behaviour...

basically I do the following:

cms.getRequestContext().setCurrentProject(4);
cms.createResource(rss_path,xml_name,"plain",null,xml_content.getBytes());
cms.unlockResource(rss_path+xml_name);
cms.publishResource(rss_path+xml_name);

now the resource gets created, and in the Workplace I can see it in offline
and online mode. BUT, I can only see the content of the resource in offline
mode...trying to open the resource in online mode results to this message in
the browser: 

The requested resource (/opencms/export/syndication/topstories.xml) is not
available. 

hmmm...any ideas??

thanks,
Peter

> Peter,
> 
> A scheduled task always runs in the "Online" project and even the
> administrator cannot create or modify resources in the "Online" project.
> Change to an offline project before attempting to create a resource
> (e.g. with cms.getRequestContext().setCurrentProject(projectId))...
> 
> Regards,
> 
> Andreas Zahner
> Alkacon Software - The OpenCms Experts
> http://www.alkacon.com 
> 
> -----Ursprüngliche Nachricht-----
> Von: opencms-dev-admin at opencms.org
> [mailto:opencms-dev-admin at opencms.org] Im Auftrag von Peter Glantschnig
> Gesendet: Mittwoch, 19. November 2003 15:57
> An: opencms-dev at opencms.org
> Betreff: [opencms-dev] Scheduled tasks / Access denied
> 
> 
> hello,
> 
> I am having a problem with scheduled tasks and I don't really know what
> else I could do? Well, my class or my scheduled task runs and works, but
> what I want to to is to create a new resource in the vfs, but there is
> always this CmsException which tells me 'Access denied'.
> 
> But I'm running the task as Admin and I already wrote some code that
> created some resources and worked...but in an different context. Is
> there something tricky about this scheduled tasks? I saw this question
> already in the mail archiev, but that didn't help. And yes, I set the
> scheduled task in Offline mode. 
> 
> This is my scheduled task:
> 
> 42 15 * * * Admin Administrators
> com.opencms.modules.homepage.news.ImportRSS
> Test
> 
> I have no idea about the last param...I don't need it, but I guess I
> have to write something?
> 
> Someone has an idea, why the scheduled task gets no write permission??
> 
> thanks,
> Peter
> 
> -- 
> NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien... 
> Fotoalbum,
> File Sharing, MMS, Multimedia-Gruß, GMX FotoService
> 
> Jetzt kostenlos anmelden unter http://www.gmx.net
> 
> +++ GMX - die erste Adresse für Mail, Message, More! +++
> 
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please
> visit http://mail.opencms.org/mailman/listinfo/opencms-dev
> 
> 
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://mail.opencms.org/mailman/listinfo/opencms-dev
> 

-- 
NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien...
Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService

Jetzt kostenlos anmelden unter http://www.gmx.net

+++ GMX - die erste Adresse für Mail, Message, More! +++




More information about the opencms-dev mailing list