[Xesam] Relative date queries / Mono XESAM library

Jamie McCracken jamie.mccrack at googlemail.com
Tue Jan 15 12:03:56 PST 2008


On Tue, 2008-01-15 at 20:52 +0100, Mikkel Kamstrup Erlandsen wrote:
> On 15/01/2008, Evgeny Egorochkin <phreedom.stdin at gmail.com> wrote:
> > В сообщении от Tuesday 15 January 2008 18:13:02 Jamie McCracken написал(а):
> > > On Tue, 2008-01-15 at 10:02 -0600, Gabriel Burt wrote:
> > > > On Jan 15, 2008 2:10 AM, Evgeny Egorochkin <phreedom.stdin at gmail.com>
> > wrote:
> > > > > В сообщении от Tuesday 15 January 2008 06:51:33 Gabriel Burt написал(а):
> > > > > > What do you think of an optional 'relative' attribute on the date
> > > > > > value specifying the seconds to add to the date, and allowing 'now'
> > > > > > as a valid date?
> > > > > >
> > > > > > <lessThan>
> > > > > >   <field name="lastplayed" />
> > > > > >   <date relative="-7200">now</date>
> > > > > > </lessThan>
> > > > >
> > > > > I can very well understand why user-level language needs constructs
> > > > > like this, but for internal api, probably this would needlessly
> > > > > complicate the spec. Somehow this resembles alowing Pi to be a valid
> > > > > value for a float field.
> > > >
> > > > Except 'now' is a constantly changing value, making it much more
> > > > suitable to represent as a special variable , and impossible to
> > > > represent otherwise.
> > >
> > > we should probably include a "now"  for saved searches as it would be
> > > impossible to do stuff relative to the current datetime without it
> >
> > Sounds sane. Better implement it once in Xesam backend than in all client
> > apps.
> 
> Well, first of all it has never been a design criterion for the Xesam
> QL that you could drop a file containing only that and have saved
> search/smart folder (how about a user definable name fx?).
> 
> Another important thing to note is that we currently have an invariant
> that says that a given XML query always produce the same result on the
> same index. This makes testing easier (possibly with other benefits
> too). This is no longer an invariant if we allow a "now" date element.
> 
> A saved search should probably consist of a .desktop file and a Xesam
> query.  Where the .desktop contains a display name and such.
> 
> Another solution than defining a "now" value of the date element,
> would be to define a simple templating system that could go
> hand-in-hand with the .desktop file. This might be more extensible.
> One could define values in the .desktop that where to be substituted
> in the query xml, or what ever.
> 
> All I am saying is; please let's think this through before we define a
> smart-folder system.
> 

yeah agree we dont want to go overboard but the request was for one
trivial special case date thingy rather than a whole raft of template
terms.

If we dont implement it xesam side then we pass the buck to the clients
meaning the file manager/music player/photo manager all have to
implement their own templating systems. Putting it in xesam seems the
logical thing to do

jamie




More information about the Xesam mailing list