Class: HierarchicalFolderTitles

@bldr/media-server~HierarchicalFolderTitles

Hold metadata about a folder in a hierachical folder structure.

HierarchicalFolderTitles {
  titles_: [
    FolderTitle {
      path: '06',
      title: '6. Jahrgangsstufe',
      folderName: '06'
    },
    FolderTitle {
      path: '06/20_Mensch-Zeit',
      title: 'Lernbereich 2: Musik - Mensch - Zeit',
      folderName: '20_Mensch-Zeit'
    },
    FolderTitle {
      path: '06/20_Mensch-Zeit/10_Bach',
      title: 'Johann Sebastian Bach: Musik als Bekenntnis',
      folderName: '10_Bach'
    },
    FolderTitle {
      path: '06/20_Mensch-Zeit/10_Bach/40_Bachs-vergebliche-Reise',
      title: 'Johann Sebastian Bachs Reise nach Berlin 1747',
      folderName: '40_Bachs-vergebliche-Reise'
    }
  ]
}

new HierarchicalFolderTitles (filePath)

Name Type Description
filePath String

The path of a file in a folder with title.txt files.

Members

allTitles

All titles concatenated with / (Include the first and the last title) without the subtitles.

for example:

  1. Jahrgangsstufe / Lernbereich 2: Musik - Mensch - Zeit / Johann Sebastian Bach: Musik als Bekenntnis / Johann Sebastian Bachs Reise nach Berlin 1747

curriculum

Not the title of the first and the last folder.

HierarchicalFolderTitles {
  titles_: [
    FolderTitle {
      title: '6. Jahrgangsstufe'
    },
    FolderTitle {
      title: 'Lernbereich 2: Musik - Mensch - Zeit'
    },
    FolderTitle {
      title: 'Johann Sebastian Bach: Musik als Bekenntnis'
    },
    FolderTitle {
      title: 'Johann Sebastian Bachs Reise nach Berlin 1747'
    }
  ]
}

-> Lernbereich 2: Musik - Mensch - Zeit / Johann Sebastian Bach: Musik als Bekenntnis

curriculumTitlesArray Array

Not the first and last title as a array.

grade

The first folder level in the hierachical folder structure must be named with numbers.

id

lastFolderTitleObject_ private

subtitle

The subtitle. It is the second line in the text file title.txt in the same folder as the constructor filePath file.

title

The title. It is the first line in the text file title.txt in the same folder as the constructor filePath file.

titlesArray_ array private

An array of title strings.

Methods

list ()Array

List all FolderTitle() objects.

Returns:
Type Description
Array

read_ (filePath) private

Read all title.txt files. Descend to all parent folders which contain a title.txt file.

Name Type Description
filePath String

The path of the presentation file.

readTitleTxt_ (filePath) private

Parse the title.txt text file. The first line of this file contains the title, the second lines contains the subtitle.

Name Type Description
filePath String

The absolute path of a title.txt file.