TemplateCreator
in package
Description of TemplateCreator
Tags
Table of Contents
Constants
- LOCK_PSWD = 'ARCHE'
- AGENT_CLASS = 'https://vocabs.acdh.oeaw.ac.at/schema#Agent'
- ENTRY_ROWS = 200
- FIRST_ROW_ID_ONLY = 9
- FIRST_ROW_OTHER = 8
- HORIZONTAL_ROW_HEIGHT = 2
- ID_ONLY_CLASSES = ['https://vocabs.acdh.oeaw.ac.at/schema#Person', 'https://vocabs.acdh.oeaw.ac.at/schema#Organisation', 'https://vocabs.acdh.oeaw.ac.at/schema#Place']
- SKIP_PROPERTIES = ['https://vocabs.acdh.oeaw.ac.at/schema#hasPid']
- STYLES = ['title' => ['font' => ['name' => 'Calibri', 'size' => 14, 'bold' => true], 'fill' => ['fillType' => 'solid', 'startColor' => ['argb' => 'FF88DBDF']], 'alignment' => ['wrapText' => true, 'horizontal' => 'center', 'vertical' => 'center']], 'header1' => ['font' => ['name' => 'Calibri', 'size' => 11, 'bold' => false], 'fill' => ['fillType' => 'solid', 'startColor' => ['argb' => 'FFD7F3F4']], 'alignment' => ['wrapText' => true, 'horizontal' => 'center', 'vertical' => 'bottom']], 'header2' => ['font' => ['name' => 'Calibri', 'size' => 11, 'bold' => false], 'fill' => ['fillType' => 'solid', 'startColor' => ['argb' => 'FFE1F6F7']], 'alignment' => ['wrapText' => true, 'horizontal' => 'center', 'vertical' => 'bottom']], 'header3' => ['font' => ['name' => 'Calibri', 'size' => 11, 'bold' => false], 'fill' => ['fillType' => 'solid', 'startColor' => ['argb' => 'FFEBF9FA']], 'alignment' => ['wrapText' => true, 'horizontal' => 'center', 'vertical' => 'bottom']], 'content' => ['font' => ['name' => 'Calibri', 'size' => 11], 'alignment' => ['wrapText' => true, 'horizontal' => 'left', 'vertical' => 'bottom']]]
- URL_FORMULA = '=LEFT(%cell%, 4)="http"'
- VOCABULARY_SHEET = 'Vocabularies'
Properties
Methods
- __construct() : mixed
- createHorizontalTemplate() : void
- createNamedEntitiesTemplate() : void
- addGuidelines() : void
- covers() : bool
- createInstanceList() : string
- getCardinality() : string
- getFirstRow() : int
- getStyle() : array<string|int, mixed>
- importVocabulary() : string
- initVocabulary() : array<string|int, mixed>
- processValidation() : void
- protectSheet() : void
- setValidation() : void
- shortenUri() : string
Constants
LOCK_PSWD
public
mixed
LOCK_PSWD
= 'ARCHE'
AGENT_CLASS
private
mixed
AGENT_CLASS
= 'https://vocabs.acdh.oeaw.ac.at/schema#Agent'
ENTRY_ROWS
private
mixed
ENTRY_ROWS
= 200
FIRST_ROW_ID_ONLY
private
mixed
FIRST_ROW_ID_ONLY
= 9
FIRST_ROW_OTHER
private
mixed
FIRST_ROW_OTHER
= 8
HORIZONTAL_ROW_HEIGHT
private
mixed
HORIZONTAL_ROW_HEIGHT
= 2
ID_ONLY_CLASSES
private
mixed
ID_ONLY_CLASSES
= ['https://vocabs.acdh.oeaw.ac.at/schema#Person', 'https://vocabs.acdh.oeaw.ac.at/schema#Organisation', 'https://vocabs.acdh.oeaw.ac.at/schema#Place']
SKIP_PROPERTIES
private
mixed
SKIP_PROPERTIES
= ['https://vocabs.acdh.oeaw.ac.at/schema#hasPid']
STYLES
private
mixed
STYLES
= ['title' => ['font' => ['name' => 'Calibri', 'size' => 14, 'bold' => true], 'fill' => ['fillType' => 'solid', 'startColor' => ['argb' => 'FF88DBDF']], 'alignment' => ['wrapText' => true, 'horizontal' => 'center', 'vertical' => 'center']], 'header1' => ['font' => ['name' => 'Calibri', 'size' => 11, 'bold' => false], 'fill' => ['fillType' => 'solid', 'startColor' => ['argb' => 'FFD7F3F4']], 'alignment' => ['wrapText' => true, 'horizontal' => 'center', 'vertical' => 'bottom']], 'header2' => ['font' => ['name' => 'Calibri', 'size' => 11, 'bold' => false], 'fill' => ['fillType' => 'solid', 'startColor' => ['argb' => 'FFE1F6F7']], 'alignment' => ['wrapText' => true, 'horizontal' => 'center', 'vertical' => 'bottom']], 'header3' => ['font' => ['name' => 'Calibri', 'size' => 11, 'bold' => false], 'fill' => ['fillType' => 'solid', 'startColor' => ['argb' => 'FFEBF9FA']], 'alignment' => ['wrapText' => true, 'horizontal' => 'center', 'vertical' => 'bottom']], 'content' => ['font' => ['name' => 'Calibri', 'size' => 11], 'alignment' => ['wrapText' => true, 'horizontal' => 'left', 'vertical' => 'bottom']]]
URL_FORMULA
private
mixed
URL_FORMULA
= '=LEFT(%cell%, 4)="http"'
VOCABULARY_SHEET
private
mixed
VOCABULARY_SHEET
= 'Vocabularies'
Properties
$log
private
LoggerInterface|null
$log
= null
$ontology
private
Ontology
$ontology
$repoBaseUrl
private
string
$repoBaseUrl
$schema
private
Schema
$schema
Methods
__construct()
public
__construct(Ontology $ontology, Schema $schema, string $repoBaseUrl[, LoggerInterface|null $log = null ]) : mixed
Parameters
createHorizontalTemplate()
public
createHorizontalTemplate(string $path, string $class, string $guidelines) : void
Parameters
- $path : string
- $class : string
- $guidelines : string
createNamedEntitiesTemplate()
public
createNamedEntitiesTemplate(string $path, array<string|int, string> $classes, string $guidelines) : void
Parameters
- $path : string
- $classes : array<string|int, string>
- $guidelines : string
addGuidelines()
private
addGuidelines(Worksheet $sheet, string $guidelines) : void
Parameters
- $sheet : Worksheet
- $guidelines : string
covers()
private
covers(array<string|int, mixed> $coveredClasses, ClassDesc $class) : bool
Parameters
- $coveredClasses : array<string|int, mixed>
- $class : ClassDesc
Return values
boolcreateInstanceList()
private
createInstanceList(string $name, array<string|int, mixed> $classes, Worksheet $sheet, string $prevRange) : string
Parameters
- $name : string
- $classes : array<string|int, mixed>
- $sheet : Worksheet
- $prevRange : string
Return values
stringgetCardinality()
private
getCardinality(PropertyDesc $prop) : string
Parameters
- $prop : PropertyDesc
Return values
stringgetFirstRow()
private
getFirstRow(string $class) : int
Parameters
- $class : string
Return values
intgetStyle()
private
getStyle(string $name[, bool|null $bold = null ][, bool|null $border = null ][, string|null $align = null ]) : array<string|int, mixed>
Parameters
- $name : string
- $bold : bool|null = null
- $border : bool|null = null
- $align : string|null = null
Return values
array<string|int, mixed>importVocabulary()
private
importVocabulary(string $name, array<string|int, SkosConceptDesc> $values, Worksheet $sheet, string $prevRange) : string
Parameters
- $name : string
- $values : array<string|int, SkosConceptDesc>
- $sheet : Worksheet
- $prevRange : string
Return values
stringinitVocabulary()
private
initVocabulary(Worksheet $sheet, string $name, string $prevRange) : array<string|int, mixed>
Parameters
- $sheet : Worksheet
- $name : string
- $prevRange : string
Return values
array<string|int, mixed>processValidation()
private
processValidation(PropertyDesc $prop, array<string|int, mixed> &$vocabularies, Worksheet $sheet, string $valuesRange, Worksheet $vocabularySheet, array<string|int, mixed> $classes) : void
Parameters
- $prop : PropertyDesc
- $vocabularies : array<string|int, mixed>
- $sheet : Worksheet
- $valuesRange : string
- $vocabularySheet : Worksheet
- $classes : array<string|int, mixed>
protectSheet()
private
protectSheet(Worksheet $sheet) : void
Parameters
- $sheet : Worksheet
setValidation()
private
setValidation(Worksheet $sheet, string $type, string $range, string $formula1, string $formula2, bool $allowBlank) : void
Parameters
- $sheet : Worksheet
- $type : string
- $range : string
- $formula1 : string
- $formula2 : string
- $allowBlank : bool
shortenUri()
private
shortenUri(string $uri) : string
Parameters
- $uri : string