[Building Sakai] Uploading files to Resources via RESTful API?

Sam Ottenhoff ottenhoff at longsight.com
Thu May 8 06:37:30 PDT 2014


One note: John Bush from ANI led a rewrite of the Axis-based webservices
for Sakai 10.  This work is in webservices/cxf.  One of the main complaints
we heard about Axis webservices were odd issues with the JWS compilation
especially if the webservices were accessed during node startup.  Here is
an example of a method signature in SakaiScript.java in the new CXF-based
webservices. This method would be accessible via REST or SOAP.

    @WebMethod
    @Path("/addNewUser")
    @Produces("text/plain")
    @GET
    public String addNewUser(
            @WebParam(name = "sessionid", partName = "sessionid")
@QueryParam("sessionid") String sessionid,
            @WebParam(name = "eid", partName = "eid") @QueryParam("eid")
String eid,
            @WebParam(name = "firstname", partName = "firstname")
@QueryParam("firstname") String firstname,
            @WebParam(name = "lastname", partName = "lastname")
@QueryParam("lastname") String lastname,
            @WebParam(name = "email", partName = "email")
@QueryParam("email") String email,
            @WebParam(name = "type", partName = "type") @QueryParam("type")
String type,
            @WebParam(name = "password", partName = "password")
@QueryParam("password") String password) {





On Wed, May 7, 2014 at 7:52 PM, Lydia Li <lydial at stanford.edu> wrote:

> Thanks Taper.
>
> I found that I could just use Sakai's WebServlet to upload a file to the
> Content Resources so that's what I will be using.  BTW, for the project I'm
> working on I need to use REST.
>
> For your question, maybe you can start by looking at the
> entitybroker/rest/src/java/org/sakaiproject/entitybroker/rest/EntityHandlerImpl.java.
>
>
>
> thanks,
> Lydia
>
>
>
> ------------------------------
>
> *From: *"cn19998" <cn19998 at qq.com>
> *To: *"sakai_dev" <sakai-dev at collab.sakaiproject.org>
> *Sent: *Wednesday, May 7, 2014 8:49:20 AM
>
> *Subject: *Re: [Building Sakai] Uploading files to Resources via RESTful
> API?
>
> Hi Lydia,
>
>    I found that SOAP services provided in Sakai can be used to upload
> contents. Maybe you can try:
> http://localhost:8080/sakai-axis/ContentHosting.jws?wsdl.
>
>   By the way. I found it hard to use the RESTful Services in Sakai without
> documentation. Maybe viewing the
> source code could help me understand it more. However, I tried to search
> for "@Path" or "@GET"(something
> typical in REST services" in Sakai source distribution but resulted in
> vain. Can someone tell me where those classes
> providing REST services are located? (There should be some, I think.)
>
> Thanks,
> Taper.
>
> source code
> On 2014/4/15 9:42, Lydia Li wrote:
>
>  Hi Steve,
>
>      It would be great if you could put your PDF on the mobile confluence
> page.   Yes I've been looking at the /direct/describe.
>      Back to my first question, are you aware of anyone working on
> developing the REST web services for uploading a file to the Resources
> Tool? Is that in the plan for Keitai?
>
>  thanks,
>  Lydia
>
>
>
>
>  ------------------------------
>
> *From: *"Steve Swinsburg" <steve.swinsburg at gmail.com><steve.swinsburg at gmail.com>
> *To: *"Aaron Zeckoski" <azeckoski at unicon.net> <azeckoski at unicon.net>
> *Cc: *"sakai-dev" <sakai-dev at collab.sakaiproject.org><sakai-dev at collab.sakaiproject.org>,
> "Li Lydia" <lydial at stanford.edu> <lydial at stanford.edu>
> *Sent: *Monday, April 14, 2014 6:34:00 PM
> *Subject: *Re: [Building Sakai] Uploading files to Resources via RESTful
> API?
>
>  Best doco is at /direct/describe. I have a PDF that summarises the work
> done in Keitai if you'd like a copy. Could put it on the mobile confluence
> page.
>
> sent from my mobile device
> On 15/04/2014 8:47 AM, "Aaron Zeckoski" <azeckoski at unicon.net> wrote:
>
>> It's meant to be self documenting (or at least, that was my intent).
>> http://nightly2.sakaiproject.org:8082/direct/describe
>>
>> -AZ
>>
>>
>> On Mon, Apr 14, 2014 at 6:40 PM, Lydia Li <lydial at stanford.edu> wrote:
>> > Hi all,
>> >
>> >     Has anyone worked on uploading contents to the Resources tool via
>> > RESTful API in Sakai?   As far as I can tell from reading what's listed
>> > under /direct/describe, there are no existing APIs yet.
>> >     Also, are there any other documentations for Sakai's RESTful web
>> > services besides what's here:
>> > https://confluence.sakaiproject.org/display/MOBILE/Home?   I can't
>> seem to
>> > find a lot of documentations on this topic.   I guess I can also go
>> read the
>> > code.
>> >
>> > thanks,
>> > Lydia
>> >
>> > _______________________________________________
>> > 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"
>>
>>
>>
>> --
>> Aaron Zeckoski - Software Architect - http://tinyurl.com/azprofile
>> _______________________________________________
>> 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"
>>
>
>
>
> _______________________________________________
> sakai-dev mailing listsakai-dev at collab.sakaiproject.orghttp://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>
> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of "unsubscribe"
>
>
>
> _______________________________________________
> 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"
>
>
>
> _______________________________________________
> 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"
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20140508/4c63611e/attachment.html 


More information about the sakai-dev mailing list