online source control
back to content
sign up free version control plan

ISAWHAppObject::GetAllRepositories

Description

Retrieves information of all available repositories on the server.

Syntax

long GetAllRepositories(
        ISAWHRepositoryInfoSet* RepositoryInfoSet,
        VARIANT_BOOL* Cancelled,
        BSTR* ResultDescription
);

Parameters

RepositoriesInfoSet
[out] Returns the information set of all available repositories in SourceAnywhere database.

Cancelled
[out] If the method fails, returns whether the operation is cancelled.

ResultDescription
[out] Returns the description of the result. If the operation succeeds, returns 'Completed'. If the operation fails, returns the error information.

Return Value

If the method succeeds, returns 0. If the method fails, returns other error codes.

See Also

Sample

VB Sample:

Dim WithEvents sdkObject As SAWHSDKLib.SAWHAppObject

Set sdkObject = New SAWHSDKLib.SAWHAppObject

'Login, GetAllRepositories
Private Sub Login_Click()

	Dim UserName As String
	Dim Password As String
	Dim RepositoryName As String
	Dim KeyFileSet As New SAWHKeyFileSet
	Dim MustChangePassword As Boolean
	Dim DaysOfExpiration As Long
	Dim Cancelled As Boolean
	Dim ResultDescription As String


	Dim RepositoryInfoSet As New SAWHRepositoryInfoSet
	sdkObject.GetAllRepositories RepositoryInfoSet, Cancelled, ResultDescription

	dlgLogin.Combo1.Clear
	Dim Index As Long
	For Index = 0 To RepositoryInfoSet.GetCount() - 1
		Dim RepositoryInfo As New SAWHRepositoryInfo
		RepositoryInfoSet.Get Index, RepositoryInfo
		dlgLogin.Combo1.AddItem (RepositoryInfo.RepositoryName)
	Next
	If RepositoryInfoSet.GetCount() > 0 Then
		dlgLogin.Combo1.ListIndex = 0
	Else
		MsgBox "Database name not found."
		Exit Sub
	End If

	dlgLogin.Text1.Text = "admin"
	dlgLogin.Text2.Text = ""
	Dim Result As Long
	dlgLogin.Show 1, Me

	UserName = dlgLogin.Text1.Text
	Password = dlgLogin.Text2.Text
	RepositoryName = dlgLogin.Combo1.Text

	Dim ResultValue As Long
	ResultValue = sdkObject.Login(UserName, Password, DBName, RepositoryName, KeyFileSet, MustChangePassword, DaysOfExpiration, Cancelled, ResultDescription)

	If ResultValue <> 0 Then
		MsgBox ("Failed to log on server.")
	End If

End Sub