Saturday 9 July 2011

Mid-Term Report

Its been amost a month and a half since GSOC started and this is the mid-term report for the 1st phase of the project which is writing all the basic WebDav methods.
I am glad to say that I have been able to do that without encountering many problems.As I described in my proposal I used milton to rewrite the webdav methods.

Milton is an opensource library for adding webdav support for an existing web application.

Integration
The most common way of using milton is to add the MiltonServlet to web.xml.Milton is agnostic about the nature of the data. we can simply implement the interfaces needed for it to locate the resources.
The central concept to Milton is Resource so we extend the resource interface
for each HTTP method with methods to support that method .We can choose which http methods to allow on your data by choosing which Milton Resource interfaces
to implement.Thus a class which implements a resource will contain methods for GET,POST,MKCOL etc based on the interfaces we implemented.
Its completely appropriate to not implement any method if we do not want to support the method.

Progress
At first I thought milton was confusing but after some great support from the author(Brad Mcevoy) I found that milton is very easy to use.
I created 4 classes 3 implementing the milton interfaces and 1 helper class.The first thing that I did was to implement the File(SakaiFileResource) and Folder(SakaiFolderResource) Resources which represent
a Resource and a collection respectively.Then I implemented the ResourceFactory(SakaiResourceFactoryImpl) for finding the File and Folder Resources from the URL.
We take the path in the url entered by the user and check if it represents a resource or a collection based on this it returns instances of SakaiFileResource or SakaiFolderResource.
And finally I wrote the SakaiDavHelper Class which contains accessory methods.
The last step is to add the MiltonServlet to web.xml.

As of now I have written all the webdav methods using milton but without authentication (its a bit tricky with milton and the current dav code is confusing).The final
step is to add the milton jars to our pom.xml and we are good to go.

In my proposal I mentioned the rewrite of the nested classes DirContextSAKAI,ResourceInfoSAKAI and SakaidavServletInfo This proved unnecessary as milton
is resource centric and all the required information about a resource or a collection is contained within the file and folder objects(The function gerResourceInfo() does the job) thus eliminating the need for the rewrite.

Finally Thanks to my mentors Anthony Whyte and Seth Theriault for their support.

1 comment:

  1. I am very much impressed from your post.It has amazing information.I learned lot of new things which explores my knowledge in various developments.So i must appreciate your efforts on posting this information.
    Android development

    ReplyDelete