[OGo-Developer] Changing the folder creation paradigm
Helge Hess
developer@opengroupware.org
Fri, 14 Sep 2007 18:21:35 +0200
On 14.09.2007, at 17:49, Wolfgang Sourdeau wrote:
> Currently, when a user creates an addressbook, its nameInContainer
> will be the same as its display name, which can be a problem
> whenever the user specifies special characters (:+&/" etc...).
Well, not really since all characters in the URL can be properly
escaped. But I agree that it doesn't make it simpler :-)
> To avoid this and to make things easier, I have been thinking that
> the nameInContainer should be set to the lowest available positive
> integer,
I suppose by "lowest positive integer" you mean that you want to use
a numeric primary key in the folder table?
> and that the display name should be as wild as the user wants it too.
> The webui would relies on the displayName, and any correct DAV
> client module would do the same with the DAV:displayname property.
Hm. Outlook actually treats those values as two separate entities
(folder name and PR_DISPLAY_NAME) and so does CalDAV/WebDAV etc.
Though the names are usually 1:1 the same (and things start to get
confusing when you rename a folder).
I see the biggest problem with external clients which create new
collections. If you create a new calendar via CalDAV the client would
most likely issue a MKCALENDAR request with a readable URL name.
Actually the point is that the client will use whatever it likes
(most likely the name the user chooses for the calendar properly
encoded in UTF-8/URL encoding).
And IMHO it would be quite bad not to use the name requested by the
client (only leads to a sequence of other issues).
Another minor annoyance is that browsing using Cadaver (and pretty
much every other generic WebDAV agent) will be much harder, with just
the numeric index exposed.
IMHO you should maintain the folder displayname and the folders
relative URL as separate entities (I think we currently miss a
separate displayname which we should add to allow for arbitary crap
in the displayname - and in the same run we could add a folder
description [longer text associated with the folder aka
CALDAV:calendar-description]).
When the user creates a new calendar/ab from inside SOGo, I would
scan the choosen name for non-letter characters. If its plain
letters, I would use the choosen name. Otherwise I would either
flatten the name and append a number or use just the number. (the
former is easier to debug)
I don't think its a good idea to always use the numeric primary key,
even though it is simpler to deal with at the server.
In any case you do not really get around implementing proper encoding/
escaping if you want to allow external clients to create ABs/cals ...
Greets,
Helge
--
Helge Hess
http://www.helgehess.eu/