You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by "Harding, Christopher (Student Assistant)" <Ch...@softwareag.com> on 2000/12/01 11:40:28 UTC

RE: Displaying files

Hello,
  Thank you Remy for your help. The null was returned bacuse the
NodeRevsionDescriptors did not have the URL set, as you said in the email. I
have changed it so it uses -
		NodeRevisionDescriptors s = new
NodeRevisionDescriptors(path.toString(),new NodeRevisionNumber(), new
Hashtable(),new 
			Hashtable(),new Hashtable(),true);

  Which nows displays the resources corretly.

Chris Harding

-----Original Message-----
From: Remy Maucherat [mailto:remm@apache.org]
Sent: Thursday, November 30, 2000 7:13 PM
To: slide-dev@jakarta.apache.org
Subject: Re: Displaying files


> Hello,
>   Thank you for your reply it did help clear some things up for me. I'm
> working at the store level to create the folders and files, so I don't
want
> to use the helpers.
>
>   I have three methods (as well as the standard methods in
> MemoryDescriptorStore), 1) get the names from the database and if the name
> is to be displayed as a collection or a resource. 2) Creates either the
> collection, by creating a SubjectNode and adding the URI to the parent
> children list, or a resource, by creating a NodeRevisionDescriptor with
the
> properties. 3) Creates the NodeRevisionDescriptor with the properties set.

The root cause of the exception is simple enough to find :
Namespace.getUri(String) is called with a null parameter. We still have to
find why.

According to the stack trace, I would say that :
- the problem happens when the PROPFIND method enumerates the children
(structure.getChildren(...))
- for some reason, it looks like some of the object node returned in the
enumeration have a null Uri
- since you're using code from MemDescrStore, it will just store the object,
and won't care about whether or not the Uri field of the object is null
- the line numbers don't match the current Slide sources, for some reason,
so I'm not 100% sure

In the structure helper, here's what I'm doing to create an object :

                    newObject.setUri(courUri.toString());
                    courUri.getStore().createObject
                        (courUri, newObject);

                    // Add the newly created object to its parent's
                    // children list
                    parentObject.addChild(newObject);
                    //namespace.getUri(parentObject.getUri())
                    //.getDataSource().storeObject(parentObject, false);
                    store(token, parentObject);

Note that you can't use some of these methods because they have package
access.

I'll try to find the root cause of the problem.

Note 1 : I'll add the calls to begin() and commit() in the helpers shortly.
Note 2 : I'm still not 100% comfortable that you're mutating objects in a
store (but it should work). Basically, the store is more or less trusted, so
Slide is not robust at all if the store does wrong things. I think I'll add
some checking on the returned objects eventually, so that it's easier to
develop (since the root cause of the problem would be very easy to spot).

Thanks,
Remy