[gradebook2-dev] Gradebook2 webservices

Thomas Amsler tpamsler at ucdavis.edu
Mon Jan 31 13:56:22 PST 2011


Sid,

Assuming you are doing this from a browser with some sort of REST
plugin (e.g.Chrome and cREST client), you can make the (GET, POST,
DELETE, PUT) REST calls as long as:

- You have established a valid Sakai session
- You provide the valid path parameters

All the gradebook2 REST resources are located here:

https://source.sakaiproject.org/contrib/gradebook2/trunk/server/src/java/org/sakaiproject/gradebook/gwt/sakai/rest/resource/

So you should be able to look at those classes and determine what the
path parameters are. Also, if you develop gradebook2 in GWT DEV mode,
you can use the following url:

http://127.0.0.1:8888/gradebook/rest/application.wadl

... to get the Jersey generated WADL. I have attached the generated
sample output.

I hope this helps.

Best,
-- Thomas


On Mon, Jan 31, 2011 at 12:32 PM, Jayanna, Sid <jayannsd at muohio.edu> wrote:
> Hi Thomas,
> Thanks for taking the time to reply to my emails.
> If I understand the REST implementation correctly, don't gradebook2 provide
> some kind of URI to manipulate (get/post/put/delete) resources?
> please bear with me here, I noticed on our log while working with gradebook2
> these messages (ipaddress have been masked to protect the guilty) -
> ------
> [31/Jan/2011:14:41:46 -0500] x.x.x.x TLSv1 AES256-SHA "GET
> /portal/tool/d10a1c9e-66af-4084-ac1c-c5a07d059e8a/gradebook/rest/roster/87450467-8cab-4fc3-be7c-00a3e6245965/1/?sortField=S_LST_NM_FRST&sortDir=ASC&offset=0&limit=19
> HTTP/1.1"
> [31/Jan/2011:14:15:16 -0500] x.x.x.x TLSv1 DHE-RSA-AES256-SHA "POST
> /portal/tool/d10a1c9e-66af-4084-ac1c-c5a07d059e8a/gradebook/rest/item/87450467-8cab-4fc3-be7c-00a3e6245965/1/
> HTTP/1.1"
> -----------------
> So it appears like the GWT client is making GET/POST REST calls to work with
> the resources on the server? but when I copy the above url and try to run it
> from the address bar I get "ERROR: SESSIONID is null".
> So, theoretically I should be able to call the same URI from my broker
> application to get a roster with grades, is my understanding correct?
> Also, if you can point me to some documentation of the REST implementation
> will be very helpful.
> Please let me know if you have any questions.
> Thanks,
> Sid
>
>
>
> On Jan 28, 2011, at 4:27 PM, Thomas Amsler wrote:
>
> That would be one way to extend the existing Sakai (Axis) SOAP service
> endpoints. Gradebook2 uses REST (JAX-RS) to communicate between client
> and the server. So you could potentially expand on that by providing a
> new REST resource that returns the required data. Both approaches are
> valid.
> -- Thomas
>
> On Fri, Jan 28, 2011 at 1:21 PM, Jayanna, Sid <jayannsd at muohio.edu> wrote:
>
> Thanks Thomas, that helps.
>
> So, there are no webservices listening by default which can provide me the
> roster with grades (like a REST Get call) from the broker application.
>
> That webservice needs to be designed on the sakai end similar to the
> SakaiLogin.jws. Is my understanding correct?
>
> Thanks,
>
> Sid
>
> On Jan 28, 2011, at 4:14 PM, Thomas Amsler wrote:
>
> Sid,
>
> The details of the final grade submission handling  is implemented by
>
> and implementation of the InstitutionalAdvisor.java interface. When
>
> the user clicks on the submit final grade menu item, it makes a REST
>
> call to SubmitFinalGrades.java
>
> That class calls the Gradebook2ComponentService.submitFinalGrade(...)
>
> method, which in turn calls the
>
> InstitutionalAdvisor.submitFinalGrade(...) method. So you should
>
> implement your version of the InstitutionalAdvisor interface and use
>
> it via Spring injection. There is a default implementation of the
>
> InstitutionalAdvisor interface in SampleInstitutionalAdvisor.java
>
> I hope this helps.
>
> Best,
>
> -- Thomas
>
> On Fri, Jan 28, 2011 at 11:55 AM, Jayanna, Sid <jayannsd at muohio.edu> wrote:
>
> Hi Thomas,
>
> I was wondering if gradebook2 exposes any REST webservices for me to consume
> to submit the final grades to another broker application which will send it
> to our SIS.
>
> If you could point me to some resources will be very helpful.
>
> Thanks,
>
> Sid
>
> On Oct 6, 2010, at 2:26 PM, Thomas Amsler wrote:
>
> Yes
>
> On Wednesday, October 6, 2010, Jayanna, Sid <jayannsd at muohio.edu> wrote:
>
> Sure, I will create my first jira.
>
> That will be a feature request right?
>
> Thanks,
>
> Sid
>
> On Oct 6, 2010, at 2:11 PM, Thomas Amsler wrote:
>
> As far as I know, we haven't added a tool icon for gradebook2 yet. Would you
> mind creating a GRBK jira for this:
>
> http://jira.sakaiproject.org/browse/GRBK
>
> Best,
>
> -- Thomas
>
> On Wed, Oct 6, 2010 at 10:53 AM, Jayanna, Sid <jayannsd at muohio.edu> wrote:
>
> The reason I wanted to test gradebook2 on a nightly server is due to a
> missing icon on my Sakai build. I am using Sakai src tag 2.7.1 and
> gradebook2 1.3.0
>
> I have attached a screen shot. As you can see from the screen shot, the icon
> for gradebook2 is missing.
>
> I would appreciate if you can shed some light on why the icon is missing.
>
> Thanks,
>
> Sid
>
>
>
>
>
>
>
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: application.wadl
Type: application/octet-stream
Size: 20903 bytes
Desc: not available
Url : http://collab.sakaiproject.org/pipermail/gradebook2-dev/attachments/20110131/1dfcb081/attachment-0001.obj 


More information about the gradebook2-dev mailing list