Class MSAccessProjectLayout

java.lang.Object
org.machanism.machai.project.layout.ProjectLayout
org.machanism.machai.project.layout.MSAccessProjectLayout

public class MSAccessProjectLayout extends ProjectLayout
Detects MS Access projects managed with the msaccess-vcs-addin (Version Control System add-in for Microsoft Access).

The add-in exports an Access database (for example MyDb.accdb) into a source folder, by default MyDb.accdb.src, which contains the vcs-options.json configuration file. isAccessProject(File) accepts a directory when vcs-options.json is found either directly in it or in one of its immediate subdirectories.

Exported database objects (VBA modules, forms, reports, queries, macros, table definitions) are reported as source directories. The add-in does not define documentation or test directories, so those accessors return empty lists.

Since:
1.4.3
Author:
Viktor Tovstyi
  • Field Details

    • VCS_OPTIONS_FILE_NAME

      private static final String VCS_OPTIONS_FILE_NAME
      Configuration file created by msaccess-vcs-addin in the export folder.
      See Also:
  • Constructor Details

    • MSAccessProjectLayout

      public MSAccessProjectLayout()
      Creates an MS Access project layout instance.
  • Method Details

    • isAccessProject

      public static boolean isAccessProject(File projectDir)
      Checks whether a directory contains an MS Access project exported by msaccess-vcs-addin.

      The directory qualifies when it contains vcs-options.json itself or when one of its immediate subdirectories (such as MyDb.accdb.src or source) does.

      Parameters:
      projectDir - directory to examine
      Returns:
      true when an msaccess-vcs-addin export folder is detected; false otherwise
    • findSourceDir

      private static File findSourceDir(File projectDir)
      Locates the msaccess-vcs-addin export folder for a project directory.
      Parameters:
      projectDir - project directory to examine
      Returns:
      the folder containing vcs-options.json, or null if none is found
    • getSources

      public List<String> getSources()
      Returns source directories exported by msaccess-vcs-addin.

      Paths are relative to the project directory and only existing folders (modules, forms, reports, queries, macros, tables, table definitions, relations) are included.

      Specified by:
      getSources in class ProjectLayout
      Returns:
      list of existing export subdirectories; empty if none are found
    • getDocuments

      public List<String> getDocuments()
      Returns documentation directories for the Access project.
      Specified by:
      getDocuments in class ProjectLayout
      Returns:
      empty list; msaccess-vcs-addin does not define a documentation folder
    • getTests

      public List<String> getTests()
      Returns test source directories for the Access project.
      Specified by:
      getTests in class ProjectLayout
      Returns:
      empty list; msaccess-vcs-addin does not define a test folder