[Building Sakai] Web services questions

Bryan Bakotich bakotibj at plu.edu
Fri Jan 21 15:34:30 PST 2011


Amy,

You have to add a new page to the site first before you add a tool to the
page. Something like this:

// Add the page to the site
// Last param is pagelayout: 0 for single column, 1 for double
$active->addNewPageToSite($

session, "52ae25e2-e880-41fd-bf71-17b30c67af20", "Mailtool", 0);

// Now add the tool to the page

$active->addNewToolToPage($

session, "52ae25e2-e880-41fd-bf71-17b30c67af20", "Mailtool", "Mailtool",
"sakai.mailtool", "0,0");


Hope that helps!


-Bryan


On Fri, Jan 21, 2011 at 3:18 PM, Boyd, Amy E <amyboyd at txstate.edu> wrote:

> I’m trying to write a php script that will add a tool to several sites.  I
> know web services is a slow way to do this, but accessing the db directly is
> a scary prospect…  :O
>
>
>
> I keep getting the following error when trying to add the tool to a page:
>
>
>
> org.sakaiproject.exception.IdUnusedException : null
>
>
>
> I’ve got a session, and the call goes like this:
>
>
>
> $active->addNewToolToPage($session, "52ae25e2-e880-41fd-bf71-17b30c67af20",
> "Mailtool", "Mailtool", "sakai.mailtool", "0,0");
>
>
>
> The page actually exists so that’s not the problem.  I think it’s a problem
> with the siteid, but I’ve tried everything I know of to try, including
> prepending “/site/” to the id.
>
>
>
> Does anyone have any working  samples of this call in php?  I’d love to see
> a few different scripts if anyone has them.  I’ve been googling for hours
> and haven’t come up with what I’m looking for.
>
>
>
> Running 2.6.2.
>
>
>
> Thanks all!
>
> -Amy
>
> _______________________________________________
> 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"
>



-- 
Bryan Bakotich
Open Source Implementation Specialist
Digital Media Center, Information & Technology Services
Pacific Lutheran University
Tacoma, WA 98447-0013
Phone: 253-536-5021
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20110121/d065af33/attachment.html 


More information about the sakai-dev mailing list