[Building Sakai] Web services questions

Boyd, Amy E amyboyd at txstate.edu
Fri Jan 21 15:48:51 PST 2011


Bryan -

Actually I had already tried that, got the same result.  Then I tried just adding the tool to an existing site/page.  Same result.  I tried this:

$newPage = $active->addNewPageToSite($session, "52ae25e2-e880-41fd-bf71-17b30c67af20", "Mailtool", 0);
Returned org.sakaiproject.exception.IdUnusedException : null.
 I'm passing a valid session id and the site id is also valid.

I've also tried adding the tool to an existing page as opposed to a new page.  Now I'm just trying to get a tool (any tool) added to an existing page (any page), and regardless of what site and what page I use, I keep getting that same error message.

Thanks Bryan!  Let me know if you have any more suggestions because obviously I'm missing something here!


-          Amy



From: Bryan Bakotich [mailto:bakotibj at plu.edu]
Sent: Friday, January 21, 2011 5:35 PM
To: Boyd, Amy E
Cc: sakai-dev at collab.sakaiproject.org
Subject: Re: [Building Sakai] Web services questions

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<mailto: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<mailto: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<mailto: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/b946522e/attachment.html 


More information about the sakai-dev mailing list