Ticket #41 (closed Defect: Software changed)
use locateResource instead of getChild when doing index based resource lookups
| Reported by: | cdaboo@… | Owned by: | cdaboo@… |
|---|---|---|---|
| Priority: | 2: Expected | Milestone: | CalendarServer-1.0 |
| Component: | Calendar Server | Severity: | Serious |
| Keywords: | Cc: |
Description
Currently, when looking up calendar resources via the index, the resource name is returned and a getChild(name) is used. This does not work when ther URI of the child resource is subsequently needed as the resource->URI mapping has not been created. As a result the registerResourceURI method was made public and manual registertion doen. THis is not good.
What should be done instead is take the child name from the index and do joinURL(request.uri, child) and then use locateResource - this is guaranteed to generate the resource->URI mapping that will later be needed. One thing we do have to check is that the name stored in the index is the last path segment of the resource URI and NOT the file name of the child (even though those will be the same in our current implementation).
