Again: Putable Resource!

>wplatzer@iaik.tu-graz.ac.at writes:
> > 
> > I tried to upload a html document using Netscape Gold 3.0, but it doesn't=
> >  work.
> > 
> > I did the following:
> > 
> > 1) On Admin/Directories I used Add directory to add a new directory templ=
> > ate. I called it Upload and used the class w3c.jigsaw.resources.PutableDi=
> > rectory.
> > 
> > 2) I created physically this directory in Jigsaw/WWW.
>
>At this step, make sure (by checking /Admin/Editor/Upload) that the
>classes used to export the Upload directory is really
>PutableDirectory. If not reindex it.
>
> > 3) With Navigator Gold 3.0 I pressed Publish... and specified the URL: ht=
> > tp://host:port/Upload/Test.html
> > 
> > 4) I always get the message:
> > 
> >     Error uploading files
> > 
> >     The server responded:
> > 
> >     Target resource not found !
> > 
> > 
> > Am I doing something wrong ?
>
>First of, this should work (I have tested it myself). I guess you have
>created the Upload directory *before* defining the template, so it was
>indexed using a DirectoryResource which will not allow you to create
>new documents.
>
>Anselm.

After checking everything I tried again to upload a file to a Jigsaw PutableDirectory, 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 DirectoryResource and this one calls the indexer (indexer.createResource) to create a new resource.

3) Now the indexer creates a new file resource (createFileResource) and uses the default attributes from FileResource (AttributeRegistery.getClassAttributes(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 because it's false calls super.put(request), which is the put method from HTTPResource. 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?


Wolfgang








--
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 Monday, 23 September 1996 10:22:02 UTC