Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Version Control Add-in Binaries
# (This should be built from source and not committed to version control)
*.mdb
*.accda
*.accdb
*.accd[aber]
*.zip

# Database lock files
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION 1.0 CLASS
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
END
Expand Down
3 changes: 1 addition & 2 deletions source/forms/ACLibImportWizardForm.cls
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ Private Const APPFILE_PROPNAME_APPICON As String = "AppIcon"
Private Const RepositorySource_GitHub As Long = 1
Private Const RepositorySource_LocalRepository As Long = 2


Private Const TEMPDB_TABNAME As String = "tRepositoryFiles"
Private Const TEMPDB_TABDDL As String = "create table " & TEMPDB_TABNAME & " (LocalRepositoryPath varchar(255) primary key, ObjectName varchar(255), Description memo)"
Private m_TempDb As TempDbHandler
Expand Down Expand Up @@ -172,7 +171,7 @@ On Error GoTo HandleErr
Me.Repaint

Set ACLibFileMngr = CurrentACLibFileManager
If Me.ogRepositorySource = 1 Then
If Me.ogRepositorySource = RepositorySource_GitHub Then
Set m_ACLibFileManager = ACLibFileMngr
Else '
Set m_ACLibFileManager = Nothing
Expand Down
91 changes: 85 additions & 6 deletions source/modules/ACLibFileManager.cls
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ Private Const SEARCHSTRING_CODELIB_BEGIN As String = "<codelib>"
Private Const SEARCHSTRING_CODELIB_END As String = "</codelib>"
Private Const SEARCHSTRING_FILE_BEGIN As String = "<file>"
Private Const SEARCHSTRING_FILE_END As String = "</file>"
Private Const SEARCHSTRING_PACKAGE_BEGIN As String = "<package>"
Private Const SEARCHSTRING_PACKAGE_END As String = "</package>"
Private Const SEARCHSTRING_LICENSE_BEGIN As String = "<license>"
Private Const SEARCHSTRING_LICENSE_END As String = "</license>"
Private Const SEARCHSTRING_DESCRIPTION_BEGIN As String = "<description>"
Expand Down Expand Up @@ -79,9 +81,10 @@ Private Const SEARCHSTRING_REPORTIDENTIFER As String = "Begin Report"

Private Const MODULNAME_CONFIG_APPLICATION As String = "_config_Application"

Private Const REPOSTITORY_ROOT_CODE_APPLICATIONROOT As String = "%AppFolder%"
Private Const REPOSTITORY_ROOT_CODE_WithoutCodeLibInfoExportFolder As String = "source"
Private Const REPOSTITORY_ROOT_CODE_APPLICATIONROOT As String = "%AppFolder%"
Private Const REPOSTITORY_ROOT_CODE_PRIVATEROOT As String = "%PrivateRoot%"
Private Const REPOSTITORY_ROOT_CODE_GITHUBROOT As String = "%GitHub%"

Private m_ImportFileCollection As Collection
Private m_ReplacedFilesCollection As Collection
Expand Down Expand Up @@ -184,11 +187,20 @@ End Sub

Private Sub Dispose()
On Error Resume Next
RemoveTempFiles
Set m_ImportFileCollection = Nothing
Set m_FSO = Nothing
Set m_CurrentVbProject = Nothing
End Sub

Private Sub RemoveTempFiles()

If FileTools.DirExists(GitHubTempRepositoryPath) Then
CreateObject("Scripting.FileSystemObject").DeleteFolder GitHubTempRepositoryPath, True
End If

End Sub

Public Property Let ExportAllToApplicationSourceFolder(ByVal NewValue As Boolean)
m_ExportAllToApplicationSourceFolder = NewValue
End Property
Expand Down Expand Up @@ -309,8 +321,6 @@ Public Sub ImportRepositoryFile(ByVal RepositoryPath As String, _

PathString = GetRepositoryFullPath(RepositoryPath)



Dim TempFile As Object
Set TempFile = fso.GetFile(PathString)
AddMissingFile TempFile, ImportMode
Expand Down Expand Up @@ -642,7 +652,21 @@ Public Function GetRepositoryFullPath(ByVal ReleativPath As String) As String
End If
ReleativPath = Mid$(ReleativPath, Len(REPOSTITORY_ROOT_CODE_PRIVATEROOT) + 1)

ElseIf Left(ReleativPath, Len(REPOSTITORY_ROOT_CODE_GITHUBROOT)) = REPOSTITORY_ROOT_CODE_GITHUBROOT Then
' %GITHUB%\owner\repo@branch\Path
ReleativPath = Replace(ReleativPath, "\", "/")
If Not DownLoadFromGitHub(ReleativPath, RepPath) Then
Err.Raise vbObjectError, "getRepositoryFullPath", "Download aus GitHub ist fehlgeschlagen"
Exit Function
End If

If Len(RepPath) = 0 Then
Err.Raise vbObjectError, "getRepositoryFullPath", "Wert für lokales GitHub-Temp-Verzeichnis fehlt."
Exit Function
End If

Else

If m_ExportAllToApplicationSourceFolder Then
RepPath = CurrentProject.Path & "\source\codelib\"
Else
Expand All @@ -654,7 +678,6 @@ Public Function GetRepositoryFullPath(ByVal ReleativPath As String) As String
Exit Function
End If


End If

Do While Left$(ReleativPath, 1) = "\"
Expand All @@ -671,6 +694,48 @@ Public Function GetRepositoryFullPath(ByVal ReleativPath As String) As String

End Function

Private Function DownLoadFromGitHub(ByRef ReleativPath As String, ByRef RepPath As String) As Boolean
' %GITHUB%/owner/repo@branch/Path

Dim FullFilePath As String
Dim GitHubDataCutPos As Long
Dim GitHubUrlDataString As String
Dim GitHubPath As String
Dim GitHubUrlData() As String
Dim RelativeFileUrl As String

'%GITHUB%/owner/repo@branch/Path
GitHubPath = Mid(Replace(ReleativPath, "\", "/"), Len(REPOSTITORY_ROOT_CODE_GITHUBROOT) + 2)
GitHubDataCutPos = InStr(InStr(1, GitHubPath, "@") + 1, GitHubPath, "/")
GitHubUrlDataString = Left(GitHubPath, GitHubDataCutPos - 1)
RelativeFileUrl = Mid(GitHubPath, GitHubDataCutPos + 1)
GitHubUrlDataString = Replace(GitHubUrlDataString, "@", "/")

GitHubUrlData = Split(GitHubUrlDataString, "/")
RepPath = GitHubTempRepositoryPath & "\"
ReleativPath = Replace(RelativeFileUrl, "/", "\")
FullFilePath = RepPath & ReleativPath

If Not FileTools.FileExists(FullFilePath) Then

With New ACLibGitHubImporter
.RepositoryOwner = GitHubUrlData(0)
.RepositoryName = GitHubUrlData(1)
.BranchName = GitHubUrlData(2)
CreateDirectoryIfMissing FileTools.PathFromFullFileName(FullFilePath)
.DownloadACLibFileFromWeb RelativeFileUrl, FullFilePath
End With

End If

DownLoadFromGitHub = True

End Function

Private Property Get GitHubTempRepositoryPath() As String
GitHubTempRepositoryPath = FileTools.TempPath & "ACLibTempRepo"
End Property

Private Sub ImportFile(ByRef ImportFile As Object, ByRef ImportMode As CodeLibImportMode, _
Optional ByVal ImportTestFiles As Boolean = False)

Expand Down Expand Up @@ -726,6 +791,8 @@ Private Sub ImportFile(ByRef ImportFile As Object, ByRef ImportMode As CodeLibIm
ImportAccessObject acForm, m_CLI, ImportFile, ImportMode
Case CodeLibElementType.clet_Report
ImportAccessObject acReport, m_CLI, ImportFile, ImportMode
Case CodeLibElementType.clet_Package
' don't import package file
Case Else
' eventuell Fehler auslösen?
End Select
Expand Down Expand Up @@ -1325,8 +1392,11 @@ Private Sub GetCodeLibInfoFromFile(ByRef CodeLibInf As CodeLibInfo, ByVal InputF
'Read CODELIB block
CheckString = FindSubString(CheckString, SEARCHSTRING_CODELIB_BEGIN, SEARCHSTRING_CODELIB_END)
If Len(CheckString) > 0 Then
GetCodeLibInfoRepositoryFile CodeLibInf, CheckString
GetCodeLibInfoRepositoryFileReplacement CodeLibInf, CheckString
GetCodeLibInfoPackage CodeLibInf, CheckString
If CodeLibInf.Type <> clet_Package Then
GetCodeLibInfoRepositoryFile CodeLibInf, CheckString
GetCodeLibInfoRepositoryFileReplacement CodeLibInf, CheckString
End If
GetCodeLibInfoLicenseFile CodeLibInf, CheckString
If FindDependency Then GetCodeLibInfoDependency CodeLibInf, CheckString
GetCodeLibInfoReferences CodeLibInf, CheckString
Expand All @@ -1337,6 +1407,15 @@ Private Sub GetCodeLibInfoFromFile(ByRef CodeLibInf As CodeLibInfo, ByVal InputF

End Sub

Private Sub GetCodeLibInfoPackage(ByRef CodeLibInf As CodeLibInfo, ByRef SourceString As String)
Dim PackageName As String
PackageName = Trim(FindSubString(SourceString, SEARCHSTRING_PACKAGE_BEGIN, SEARCHSTRING_PACKAGE_END))
If Len(PackageName) > 0 Then
CodeLibInf.Name = PackageName
CodeLibInf.Type = clet_Package
End If
End Sub

Private Sub GetCodeLibInfoRepositoryFile(ByRef CodeLibInf As CodeLibInfo, ByRef SourceString As String)
CodeLibInf.RepositoryFile = Replace(FindSubString(SourceString, SEARCHSTRING_FILE_BEGIN, SEARCHSTRING_FILE_END), "\", "/")
End Sub
Expand Down
98 changes: 0 additions & 98 deletions source/modules/AccUnit_Factory.bas

This file was deleted.

8 changes: 0 additions & 8 deletions source/modules/AccUnit_TestClassFactory.bas

This file was deleted.

2 changes: 1 addition & 1 deletion source/modules/WinApiShortcutMenu.cls
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ Private Declare Function TranslateMessage _
Private Declare Function GetWindowRect _
Lib "user32.dll" ( _
ByVal Hwnd As Long, _
ByRef lpRect As RECT _
ByRef lpRect As Rect _
) As Long

Private Declare Function SetMenuDefaultItem _
Expand Down
2 changes: 1 addition & 1 deletion source/modules/_config_Application.bas
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Option Compare Database
Option Explicit

'Versionsnummer
Private Const APPLICATION_VERSION As String = "1.3.3"
Private Const APPLICATION_VERSION As String = "1.4.0"

#Const USE_CLASS_ApplicationHandler_AppFile = 1
#Const USE_CLASS_ApplicationHandler_DirTextbox = 1
Expand Down
1 change: 1 addition & 0 deletions source/modules/defGlobal_ACLibImportWizard.bas
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Public Enum CodeLibElementType 'angelehnt an Enum vbext_ComponentType
clet_ClassModule = 2 ' = vbext_ComponentType.vbext_ct_ClassModule
clet_Form = 101 ' = vbext_ComponentType.vbext_ct_Document + 1
clet_Report = 102 ' = vbext_ComponentType.vbext_ct_Document + 2
clet_Package = 256 ' = Package (don't import file, only interpret codelib block)
End Enum

Public Enum CodeLibImportMode
Expand Down
10 changes: 10 additions & 0 deletions source/tables/L10n_Dict.xml
Original file line number Diff line number Diff line change
Expand Up @@ -393,4 +393,14 @@ Marked entries can be removed from the list with {Del} key.</LngText>
<KeyText>ACLib Import Wizard: Incorrect start</KeyText>
<LngText>ACLib Import Wizard: Incorrect start</LngText>
</L10n_Dict>
<L10n_Dict>
<LangCode>DE</LangCode>
<KeyText>The add-in must be installed into the Access add-in directory using the add-in manager. Afterwards it has to be started via the menu entry 'ACLib Import Wizard'.</KeyText>
<LngText>DE:The add-in must be installed into the Access add-in directory using the add-in manager. Afterwards it has to be started via the menu entry 'ACLib Import Wizard'.</LngText>
</L10n_Dict>
<L10n_Dict>
<LangCode>DE</LangCode>
<KeyText>ACLib Import Wizard: Incorrect start</KeyText>
<LngText>DE:ACLib Import Wizard: Incorrect start</LngText>
</L10n_Dict>
</dataroot>