class AfxTemplateGenerator extends GeneratorService implements SitePackageGeneratorInterface (View source)

Service to generate site packages

Properties

protected PackageManager $packageManager
protected SimpleTemplateRenderer $simpleTemplateRenderer
protected $contentDimensionZookeeper

TODO: FIX ME ES CR Flow\Inject var ContentDimensionZookeeper

Methods

array
generateSitePackage(string $packageKey, string $siteName)

Generate a site package and fill it with boilerplate data.

void
generateSitesXml(string $packageKey, string $siteName)

Generate a "Sites.xml" for the given package and name.

void
generateSitesRootFusion(string $packageKey, string $siteName)

Generate basic root Fusion file.

void
generateSitesFusionDirectory(string $packageKey, string $siteName)

Render the whole directory of the fusion part

string
generateSiteNodeName(string $packageKey)

Generate site node name based on the given package key

void
generateNodeTypesConfiguration(string $packageKey)

Generate a example NodeTypes.yaml

void
generateAdditionalFolders(string $packageKey)

Generate additional folders for site packages.

string
getResourcePathForFile(string $pathToFile)

returns resource path for the generator

string
getGeneratorName()

returns the human readable name of the generator

Details

array generateSitePackage(string $packageKey, string $siteName)

Generate a site package and fill it with boilerplate data.

Parameters

string $packageKey
string $siteName

Return Value

array

Exceptions

InvalidConfigurationException
Exception
CorruptPackageException
InvalidPackageKeyException
PackageKeyAlreadyExistsException
UnknownPackageException
Exception
FilesException

protected void generateSitesXml(string $packageKey, string $siteName)

Generate a "Sites.xml" for the given package and name.

Parameters

string $packageKey
string $siteName

Return Value

void

Exceptions

UnknownPackageException
Exception

protected void generateSitesRootFusion(string $packageKey, string $siteName)

Generate basic root Fusion file.

Parameters

string $packageKey
string $siteName

Return Value

void

Exceptions

UnknownPackageException

protected void generateSitesFusionDirectory(string $packageKey, string $siteName)

Render the whole directory of the fusion part

Parameters

string $packageKey
string $siteName

Return Value

void

Exceptions

UnknownPackageException

protected string generateSiteNodeName(string $packageKey)

Generate site node name based on the given package key

Parameters

string $packageKey

Return Value

string

protected void generateNodeTypesConfiguration(string $packageKey)

Generate a example NodeTypes.yaml

Parameters

string $packageKey

Return Value

void

Exceptions

UnknownPackageException

protected void generateAdditionalFolders(string $packageKey)

Generate additional folders for site packages.

Parameters

string $packageKey

Return Value

void

Exceptions

UnknownPackageException
FilesException

protected string getResourcePathForFile(string $pathToFile)

returns resource path for the generator

Parameters

string $pathToFile

Return Value

string

string getGeneratorName()

returns the human readable name of the generator

Return Value

string