[Building Sakai] PodcastService implementation

Matthew Buckett matthew.buckett at it.ox.ac.uk
Fri Feb 21 07:49:17 PST 2014


Normally a service will allow you to pass the current context (siteId) into
requests, however it seems that the podcasting service doesn't do this. To
get the calls to work you have todo some evil hackery:

import org.sakaiproject.util.Placement;
import org.sakaiproject.thread_local.cover.ThreadLocalManager;

Placement placement = new Placement();
placement.setContext(siteId);
ThreadLocalManager.set("sakai:ToolComponent:current.placement", placement);

This might get you a little further, but the service may depend on other
things being set on the threadlocal. In the long run the service should be
refactored so that the siteId is passed to methods as an argument.




On 21 February 2014 11:11, Jaco Gillman <jaco at opencollab.co.za> wrote:

> Hi all
>
> I am trying to add Podcast content to a Sakai instance using a Batch Job.
> I have debugged the PodcastServiceImpl and found that getSiteId() throws a
> NPE from the source extract below.
>
> final String resourceCollection = retrievePodcastFolderId(getSiteId());
>
> Obviously I am not in any Site/Tool (although I have these Ids/data)
> context when I execute the Batch Job, but surely this must be possible. I
> have looked at existing source in Sakai 2.9.3 for example implementations,
> but could not manage to get this working. Any suggestions?
>
> Regards,
>
> *Jaco Gillman*
>
> Java Developer
>
> opencollab
>
> *Tel*: +27 21 970 4017  |  *Fax*: +27 21 914 3098
>
> *Email*: jaco at opencollab.co.za  |  *Skype*: gillmanjc
>
> *Web*: www.opencollab.co.za
>
>
> ------------------------------
> See OpenCollab email disclaimer at http://www.opencollab.co.
> za/email-disclaimer
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>
> TO UNSUBSCRIBE: send email to
> sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of
> "unsubscribe"
>



-- 
  Matthew Buckett, VLE Developer, IT Services, University of Oxford
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20140221/d5d66f2f/attachment.html 


More information about the sakai-dev mailing list