Google Groups Home
Help | Sign in
Places query system API
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  13 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Brett Wilson  
View profile
 More options Feb 28 2006, 4:37 pm
Newsgroups: mozilla.dev.apps.firefox
From: Brett Wilson <bre...@gmail.com>
Date: Tue, 28 Feb 2006 13:37:12 -0800
Local: Tues, Feb 28 2006 4:37 pm
Subject: Places query system API
Hi everybody,

One of the things that still needs to be finalized for FF2 is the
parameters for querying the history system. I'm interested in what
parameters people think would be most useful so that I can make the
query system accomodate them.

You can see the current query object here:
http://lxr.mozilla.org/seamonkey/source/browser/components/places/pub...

You can also specify some options (see nsINavHistoryQueryOptions in the
same file) which allows you to specify some more parameters.

To review, the overall structure of a query is that you pass in an array
of these query objects. Everything inside one query object is ANDed
together, and then each query object is ORed. This will likely not
change, as this is able to cover most cases (I vaguely remember some
theorem that states any boolean expression can be expanded this way as
long as you have a NOT operator).

The major things missing is the ability to specify visit counts, express
NOT operations, express < or > operations.

There was some talk about implementing the query as a property bag, with
some parsing rules for names, but from an API perspective I don't like
this. I was thinking something like:

SetQueryParameter(parameter, operator, value);

and then having constants in the query object defining each type of
parameter and operator we would have. Thus, you would say

query.SetQueryParameterStr(query.PARAMETER_HOST, query.OP_EQUALS,
                            "mozilla.org");
query.SetQueryParameterInt(query.PARAMETER_VISITCOUNT, query.OP_LESS,
                            5);

For all pages from host mozilla.org visited less than 5 times.

Then we would delete all the properties on the query object. You would
only be able to set each parameter once per query object, and subsequent
sets would overwrite the old ones. Not all parameters would support all
operators.

We would have to change the serialization of place: URIs (queries). Most
things could be kept the same, except for the things currently
accessible by flags (like "uriIsPrefix" would go away and we'd get a
separate URI_PREFIX parameter that would be mutually exclusive to the
URI parameter). This will not affect most things.

Are there important query cases that this can't handle? Are there any
special queries that you're particularly interested in writing a smart
query folder for?

Brett


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Axel Hecht  
View profile
 More options Feb 28 2006, 5:17 pm
Newsgroups: mozilla.dev.apps.firefox
From: Axel Hecht <a...@pike.org>
Date: Tue, 28 Feb 2006 23:17:46 +0100
Local: Tues, Feb 28 2006 5:17 pm
Subject: Re: Places query system API
Brett,

what's the difference between
(foo.hasDomain) and (foo.domain != null)
?

Same for the other string properties.

Should the code be able to match http://www.bar.com/foo/baz.gif? Thus
having domainIsHost == false and uriIsPrefix ==  true?

Axel


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brett Wilson  
View profile
 More options Feb 28 2006, 5:32 pm
Newsgroups: mozilla.dev.apps.firefox
From: Brett Wilson <bre...@gmail.com>
Date: Tue, 28 Feb 2006 14:32:49 -0800
Local: Tues, Feb 28 2006 5:32 pm
Subject: Re: Places query system API

Axel Hecht wrote:
> what's the difference between
> (foo.hasDomain) and (foo.domain != null)
> ?

> Same for the other string properties.

> Should the code be able to match http://www.bar.com/foo/baz.gif? Thus
> having domainIsHost == false and uriIsPrefix ==  true?

> Axel

The point is that this old API will go away, so don't worry about it too
much. hasDomain just checks if the fomain is empty. Some of the other
items have more complex existance rules, they all have one for
consistency. uriIsPrefix does not matter in your example, since you
didn't specify a URI. URI is different than domain.

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben Goodger  
View profile
 More options Feb 28 2006, 9:30 pm
Newsgroups: mozilla.dev.apps.firefox
From: Ben Goodger <bengood...@gmail.com>
Date: Tue, 28 Feb 2006 18:30:32 -0800
Local: Tues, Feb 28 2006 9:30 pm
Subject: Re: Places query system API

Brett Wilson wrote:
> Hi everybody,

> One of the things that still needs to be finalized for FF2 is the
> parameters for querying the history system. I'm interested in what
> parameters people think would be most useful so that I can make the
> query system accomodate them.

This might be a good "call for comment" thing to broadcast on MDN, too.

-Ben


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Boris Zbarsky  
View profile
 More options Feb 28 2006, 11:06 pm
Newsgroups: mozilla.dev.apps.firefox
From: Boris Zbarsky <bzbar...@mit.edu>
Date: Tue, 28 Feb 2006 22:06:51 -0600
Local: Tues, Feb 28 2006 11:06 pm
Subject: Re: Places query system API
What does "uriIsPrefix" actually mean?  Is "javascript:x" a prefix of
"javascript:xhtml" for example?  Is "http://web.mit.edu/b" a prefix of
"http://web.mit.edu/bzbarsky"?

-Boris


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mike Beltzner  
View profile
 More options Mar 1 2006, 3:55 am
Newsgroups: mozilla.dev.apps.firefox
From: Mike Beltzner <beltz...@mozilla.com>
Date: Wed, 01 Mar 2006 00:55:01 -0800
Local: Wed, Mar 1 2006 3:55 am
Subject: Re: Places query system API

Ben Goodger wrote:
> This might be a good "call for comment" thing to broadcast on MDN, too.

Good idea, Ben. BTW, d  o we have a reference page in place for Places on
MDC yet? If not, we should create one and make sure that final
documentation is placed there as we move forward.

cheers,
mike

--
mike beltzner, user experience lead, mozilla corporation


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brett Wilson  
View profile
 More options Mar 1 2006, 11:49 am
Newsgroups: mozilla.dev.apps.firefox
From: Brett Wilson <bre...@gmail.com>
Date: Wed, 01 Mar 2006 08:49:39 -0800
Local: Wed, Mar 1 2006 11:49 am
Subject: Re: Places query system API

Boris Zbarsky wrote:
> What does "uriIsPrefix" actually mean?  Is "javascript:x" a prefix of
> "javascript:xhtml" for example?  Is "http://web.mit.edu/b" a prefix of
> "http://web.mit.edu/bzbarsky"?

Yes and yes.

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ben Goodger  
View profile
 More options Mar 1 2006, 3:29 pm
Newsgroups: mozilla.dev.apps.firefox
From: Ben Goodger <bengood...@gmail.com>
Date: Wed, 01 Mar 2006 12:29:23 -0800
Local: Wed, Mar 1 2006 3:29 pm
Subject: Re: Places query system API

Mike Beltzner wrote:
> Ben Goodger wrote:
>> This might be a good "call for comment" thing to broadcast on MDN, too.

> Good idea, Ben. BTW, d    o we have a reference page in place for Places
> on MDC yet? If not, we should create one and make sure that final
> documentation is placed there as we move forward.

I have created and stubbed out: http://developer.mozilla.org/en/docs/Places

-Ben


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Boris Zbarsky  
View profile
 More options Mar 1 2006, 6:58 pm
Newsgroups: mozilla.dev.apps.firefox
From: Boris Zbarsky <bzbar...@mit.edu>
Date: Wed, 01 Mar 2006 17:58:45 -0600
Local: Wed, Mar 1 2006 6:58 pm
Subject: Re: Places query system API

Brett Wilson wrote:
> Boris Zbarsky wrote:
>> What does "uriIsPrefix" actually mean?  Is "javascript:x" a prefix of
>> "javascript:xhtml" for example?  Is "http://web.mit.edu/b" a prefix of
>> "http://web.mit.edu/bzbarsky"?

> Yes and yes.

Probably worth documenting that clearly; the examples made it look like prefix
was a "can be a base URI for" thing...

-Boris


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brett Wilson  
View profile
 More options Mar 1 2006, 8:40 pm
Newsgroups: mozilla.dev.apps.firefox
From: Brett Wilson <bre...@gmail.com>
Date: Wed, 01 Mar 2006 17:40:19 -0800
Local: Wed, Mar 1 2006 8:40 pm
Subject: Re: Places query system API

Boris Zbarsky wrote:
> Probably worth documenting that clearly; the examples made it look like
> prefix was a "can be a base URI for" thing...

The whole point of this thread is that this interface is getting redone.
I'll probably make two separate parameters called URI_PREFIX and
URI_MATCH or something. It just would not make sense to define them
both. I'll try to write good documentation for each parameter.

Brett


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Axel Hecht  
View profile
 More options Mar 2 2006, 8:24 am
Newsgroups: mozilla.dev.apps.firefox
From: Axel Hecht <a...@pike.org>
Date: Thu, 02 Mar 2006 14:24:32 +0100
Local: Thurs, Mar 2 2006 8:24 am
Subject: Re: Places query system API

I may have assumed too much of the context that i was reading right now.

The question I had was, can I query for:

subdomains of foo.com AND
path startswith "somedir/"

thus matching http://foo.com/somedir/hi and
http://www.foo.com/somedir/hello, but not matching http://www.foo.com/bar.

Axel


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brett Wilson  
View profile
 More options Mar 2 2006, 11:30 am
Newsgroups: mozilla.dev.apps.firefox
From: Brett Wilson <bre...@gmail.com>
Date: Thu, 02 Mar 2006 08:30:04 -0800
Local: Thurs, Mar 2 2006 11:30 am
Subject: Re: Places query system API

> subdomains of foo.com AND
> path startswith "somedir/"

> thus matching http://foo.com/somedir/hi and
> http://www.foo.com/somedir/hello, but not matching http://www.foo.com/bar.

I see what you mean. No.

:) startsWith matches the whole beginning of the URL. This is efficient
because we have an index over the URL. We can also efficiently query for
hosts, so that query is efficient. With your query, we would have to
brute-force parse each URI, extract the path, and compare.

Just a note: there is some small possibility that I'll remove the
capability to efficiently match host names. Currently this is supported
by having an extra column in the database of host names written in
reverse with an index. However, it makes the file bigger (we store each
host name once in the URL and once separately), the extra index makes
inserts slower, and there's not out-of-the box uses of this query. If I
determine that the size/space this capability is using is not
insignificant, I will probably drop the host.

Brett


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Axel Hecht  
View profile
 More options Mar 3 2006, 3:47 am
Newsgroups: mozilla.dev.apps.firefox
From: Axel Hecht <a...@pike.org>
Date: Fri, 03 Mar 2006 09:47:57 +0100
Local: Fri, Mar 3 2006 3:47 am
Subject: Re: Places query system API