W3C home > Mailing lists > Public > www-jigsaw@w3.org > September to October 1996

Solved: Putable Resource!

From: wplatzer <wplatzer@iaik.tu-graz.ac.at>
Date: Tue, 24 Sep 1996 09:46:38
To: Anselm Baird-Smith <abaird@w3.org>
Cc: Jigsaw Mailing List <www-jigsaw@w3.org>
Message-Id: <19960924084696.NTM0030@iaik.tu-graz.ac.at>

No it works fine for html documents. But I have to change it for every extension !!!

Is there a way that class PutableDirectory sets the flag putable to true ?

If I try to upload a file e.g. abc.abc and there is no extension abc defined 
the server responds with:

Failed to create resource abc.abc. The indexer wasn't able to deduce a resource for it.

Maybe it's useful to define a general default resource without binding it to an extension.

A nice application for PutableDirectory:

Everyone can browse to his homepage, modify it and put it back to the server.
For that purpose I defined the GenericAuthFilter only for method PUT on directory PEOPLE.


> > After checking everything I tried again to upload a file to a Jigsaw Puta > bleDirectory, but it still didn't work.
> > Because Anselm said, this should work I started my debugger.
> > 
> > .. a couple of days later ...
> > 
> > I think I have the solution of the problem:
> > 
> > 1) PutableDirectory uses createResource in its lookup method if there is  > no such resource
> > 
> > 2) createResource calls createDefaultResource from class DirectoryResourc > e and this one calls the indexer (indexer.createResource) to create a new >  resource.
> > 
> > 3) Now the indexer creates a new file resource (createFileResource) and u > ses the default attributes from FileResource (AttributeRegistery.getClass > Attributes(cls)).
> > 
> > 4) But the default value for attribute putable in FileResource is false
> > 
> > 5) ...
> > 
> > 6) At last method put in FileResource checks that putable flag and becaus > e it's false calls super.put(request), which is the put method from HTTPR > esource. And this put generates the message: Method PUT not implemented.
> > 
> >     public Reply put(Request request)
> > 	throws HTTPException
> >     {
> > 	Reply error = request.makeReply(HTTP.NOT_IMPLEMENTED) ;
> > 	error.setContent("Method PUT not implemented.") ;
> > 	throw new HTTPException (error) ;
> >     }
> > 
> > 
> > 
> > How can I fix this problem or is something different wrong?
>You are right (and your steps are exactly the right overview of what's
>happening). Sorry for the confusion (it's very difficult for me to
>make sure that everything is set properly, I often forget things that
>seems obvious to me, but which are not in fact, sorry again).
>What you want to do is to update the /Admin/Extensions/html extension,
>and make all html files editable by default (eg turn putable flag to
>true for the html extension). Once this is done, all html FileResource
>created *after that point*, will inherit the putable flag value (eg
>true), and in particular the resources created through PUT. Of course,
>once you have done this, make sure you have an authentication filter
>on the root resource of your server, that allows the PUT method only
>to the appropriate persons...
>Let me know how it goes,

Wolfgang Platzer
Technische Universitaet Graz - University of Technology Graz
Institut für Angewandte Informationsverarbeitung 
und Kommunikationstechnologien
Klosterwiesgasse 32/I, A-8010 Graz, 
Tel: ++43 316 873-5523
Fax: ++43 316 873-5520
Received on Tuesday, 24 September 1996 02:47:18 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:25:30 UTC