RetrieveHistory API question

This forum is now locked, since Gold Support is no longer offered.

Moderator: SourceGear

Locked
ismangil
Posts: 197
Joined: Wed Jun 30, 2004 10:49 am
Location: Sheffield, UK
Contact:

RetrieveHistory API question

Post by ismangil » Thu Sep 28, 2006 5:06 am

On Vault 3.5.1, can someone explain to me the interaction between req.DateFilterMask = VaultQueryRequestDates.HistoryBefore | VaultQueryRequestDates.HistoryAfter;

and BeginDate and EndDate?

I looked at cmdline.cs in the api package but couldn't really understand it.

My most frequent history request are: range of exact dates and all existing history.
Perry Ismangil

jclausius
Posts: 3702
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Post by jclausius » Thu Sep 28, 2006 7:47 am

The Client API uses a Date filter floor, ceiling, or both (a range). The filter mask takes an OR'ed int for the different kinds of filters. For example, in your example, it is using BOTH HistoryAFTER and HistoryBEFORE to get a range of dates.

If you want to do no date filtering, leave these members with their default values.
Jeff Clausius
SourceGear

ismangil
Posts: 197
Joined: Wed Jun 30, 2004 10:49 am
Location: Sheffield, UK
Contact:

Post by ismangil » Thu Sep 28, 2006 7:50 am

Can you elaborate on the concept of "date filtering"?

Why would one want after, before, both, or none?
Perry Ismangil

jclausius
Posts: 3702
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Post by jclausius » Thu Sep 28, 2006 8:03 am

It is easier to explain this by looking at the Vault client.

Do a Show History on a file or folder, and look at the "Dates & Labels" tab. The different Date options on that dialog are what is available in the API.
Jeff Clausius
SourceGear

ismangil
Posts: 197
Joined: Wed Jun 30, 2004 10:49 am
Location: Sheffield, UK
Contact:

Post by ismangil » Fri Sep 29, 2006 2:37 am

I guess what I am asking is why the need for a datefilter at all.

Isn't begindate and enddate enough info? That is all history request is always for a range: begindate=empty enddate=some date will mean anything up to that date, begindate=some date enddate=empty will mean from that date onwards, both empty I guess will mean enddate=now.

Thanks for the taking the time to explain this to me Jeff, I know this is fairly esoteric, however I found in all cases our custom tools really depends on correct and precise history retrieval (which from a plugin does not always happen but that's for another thread...).
Perry Ismangil

jclausius
Posts: 3702
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Post by jclausius » Fri Sep 29, 2006 7:33 am

Since you need both just set the DateFilterMask.
Jeff Clausius
SourceGear

Locked