Page 1 of 1

TreeCache

Posted: Thu Nov 06, 2008 9:04 am
by gregg1022
I am using the API version 3.1.9 with Vault version 3.1.8

I am trying to find a way to test to see that the TreeCache exists on the client machine before I call refresh.
Snippet:
(VaultInstance.Refresh())


Another thing I would like to do is when I get latest is to show the progress like in the GUI
Snippet:
Dim CbOverWrite As New VaultClientOperationsLib.PromptForOverwriteCallback(AddressOf GetResponse)
Dim OverWritePrompt As New VaultClientOperationsLib.OverwritePrompt(MergeType.OverwriteWorkingCopy, CbOverWrite)
.Get(VaultFolder, True, True, MakeWritableType.MakeAllFilesReadOnly, SetFileTimeType.Current, MergeType.OverwriteWorkingCopy, OverWritePrompt)



Thanks

Re: TreeCache

Posted: Thu Nov 06, 2008 1:46 pm
by jeremy_sg
I think that you could check for ClientInstance.TreeCache.Repository for null or not.

As for your second idea, look at the ClientInstance.ProgressChanged event.

Re: TreeCache/GetLatest

Posted: Thu Nov 06, 2008 4:37 pm
by gregg1022
Thanks for the quick reply
I added this code:

AddHandler _VaultInstance.ProgressChanged, AddressOf ProgressChange

Private Sub ProgressChange(ByVal sender As Object, ByVal Percent As Integer)
System.Diagnostics.Debug.WriteLine(Percent.ToString)
End Sub

and that works fine as far as getting the percentage. I looked through what was returned and did not see anything that indicated what file it is was getting. Is there something coming back that indicates the file that I am missing or do I need to use some other functionality ?

also:

does function below also get the files in the specified folder from the server or do I need to call the .get on the array of files in the folder itself (Seems like I have to call the overloaded get function on a list of the files)
and once I do the get is there any function I should call after it completes to ensure everything is up to date?
Snippet:
.Get(VaultFolder, True, True, MakeWritableType.MakeAllFilesReadOnly, SetFileTimeType.Current, MergeType.AttemptAutomaticMerge, OverWritePrompt)

Thanks

Re: TreeCache

Posted: Thu Nov 06, 2008 4:56 pm
by jeremy_sg
Look at these events for get progress:

ClientInstance.NewMessage
ClientInstance.NewBulkMessage
and
ClientInstance.StatusMessage

Get on the folder will get everything and will return when everything is up to date. If you have AttemptAutomaticMerge set, it's possible that a merge conflict may prevent a file from being updated.