Package org.appng.core.service
Class TemplateService
- java.lang.Object
-
- org.appng.core.service.TemplateService
-
@Transactional public class TemplateService extends Object
A service offering methods to deal with templates.- Author:
- Matthias Müller
-
-
Field Summary
Fields Modifier and Type Field Description static String
PLATFORM_XML
protected TemplateRepository
templateRepository
protected TemplateResourceRepository
templateResourceRepository
-
Constructor Summary
Constructors Constructor Description TemplateService()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
copyTemplate(Properties platformConfig, Properties siteProps, String templateRealPath)
The active template for the givenSite
is being copied toInteger
deleteTemplate(Template template)
protected static void
deleteTemplateFolder(File templateTargetDir)
List<Identifier>
getInstalledTemplates()
Returns a list of all installed templates.Template
getTemplate(String templateDir)
Template
getTemplateByDisplayName(String name)
Template
getTemplateByName(String name)
ZipFileProcessor<Template>
getTemplateExtractor()
static ZipFileProcessor<Template>
getTemplateInfo(String originalFilename)
static File
getTemplateRepoFolder(Properties platformConfig, Properties siteProps)
Template
installTemplate(PackageArchive packageArchive)
static void
materializeTemplate(Template template, Properties platformConfig, Properties siteProps)
Materializes the given template into the filesystem.
-
-
-
Field Detail
-
PLATFORM_XML
public static final String PLATFORM_XML
- See Also:
- Constant Field Values
-
templateRepository
@Autowired protected TemplateRepository templateRepository
-
templateResourceRepository
@Autowired protected TemplateResourceRepository templateResourceRepository
-
-
Method Detail
-
getTemplateExtractor
public ZipFileProcessor<Template> getTemplateExtractor()
- Returns:
- the
ZipFileProcessor
-
getTemplateInfo
public static ZipFileProcessor<Template> getTemplateInfo(String originalFilename)
- Parameters:
originalFilename
- the original file name of theZipFile
- Returns:
- the
ZipFileProcessor
-
getInstalledTemplates
public List<Identifier> getInstalledTemplates()
Returns a list of all installed templates.- Returns:
- a list containing the
Identifier
s of all installed templates
-
materializeTemplate
public static void materializeTemplate(Template template, Properties platformConfig, Properties siteProps)
Materializes the given template into the filesystem.- Parameters:
template
- theTemplate
to materializeplatformConfig
- the platform configurationsiteProps
- theSite
'sProperties
-
copyTemplate
public static void copyTemplate(Properties platformConfig, Properties siteProps, String templateRealPath)
The active template for the givenSite
is being copied to"siteRootDir"/"wwwDir"/"templatePrefix"
- Parameters:
platformConfig
- the platform configurationsiteProps
- theSite
'sProperties
templateRealPath
- the root path to the platform's template directory
-
installTemplate
public Template installTemplate(PackageArchive packageArchive) throws BusinessException
- Throws:
BusinessException
-
getTemplateRepoFolder
public static File getTemplateRepoFolder(Properties platformConfig, Properties siteProps)
-
deleteTemplateFolder
protected static void deleteTemplateFolder(File templateTargetDir)
-
getTemplate
public Template getTemplate(String templateDir) throws IOException, JAXBException
- Throws:
IOException
JAXBException
-
-