public class TemplateFactory extends Object
Modifier and Type | Field and Description |
---|---|
protected static Logger |
logger
create a static logger.
|
static List<String> |
TEMPLATE_COLOR_AMBIANCE |
Constructor and Description |
---|
TemplateFactory() |
Modifier and Type | Method and Description |
---|---|
static void |
cleanAllRenderer(ContentContext ctx,
boolean secure) |
static void |
cleanRenderer(ContentContext ctx,
Collection<String> inTemplates,
boolean secure)
clear only template with id contains in inTemplates
|
static void |
clearTemplate(javax.servlet.ServletContext application) |
static void |
copyDefaultTemplate(javax.servlet.ServletContext application) |
static Template |
createDiskTemplates(javax.servlet.ServletContext application,
String name)
create new template with parent files.
|
static Template |
createDiskTemplates(javax.servlet.ServletContext application,
String name,
String source)
create new template.
|
static List<String> |
getAllAuthors(javax.servlet.ServletContext application) |
static Collection<String> |
getAllCategories(javax.servlet.ServletContext application) |
static Collection<String> |
getAllCategories(javax.servlet.ServletContext application,
User user)
list of categories for a specific user
|
static List<Template> |
getAllDiskTemplates(javax.servlet.ServletContext application)
get all templates from disk without cache
|
static List<String> |
getAllSources(javax.servlet.ServletContext application) |
static List<Template> |
getAllTemplates(javax.servlet.ServletContext application) |
static List<Template> |
getAllTemplatesFromContext(GlobalContext context) |
static List<Template> |
getAllValidTemplates(javax.servlet.ServletContext application) |
static Template |
getDiskTemplate(javax.servlet.ServletContext application,
String templateName)
get a template from disk
|
static Map<String,Template> |
getDiskTemplates(javax.servlet.ServletContext application)
get template from disk.
|
static Template |
getTemplate(ContentContext ctx,
MenuElement elem) |
static Collection<Template> |
getTemplateAllChildren(javax.servlet.ServletContext application,
Template template)
get all descendants of the template
|
static Collection<Template> |
getTemplateChildren(javax.servlet.ServletContext application,
Template template)
get children of the template.
|
static Map<String,Template> |
getTemplates(javax.servlet.ServletContext application)
get templates from template list cache or from disk if the cache does'nt
exist.
|
static boolean |
isTemplateExistOnDisk(javax.servlet.ServletContext application,
String templateID,
boolean mailing) |
static Collection<NavigationWithContent> |
searchPageNeedTemplate(ContentContext ctx,
String templateId) |
protected static Logger logger
public static void cleanAllRenderer(ContentContext ctx, boolean secure) throws Exception
Exception
public static void cleanRenderer(ContentContext ctx, Collection<String> inTemplates, boolean secure) throws Exception
ctx
- inTemplates
- a list of template idmailing
- true is mailing templatesecure
- IOException
Exception
public static void clearTemplate(javax.servlet.ServletContext application)
public static List<String> getAllAuthors(javax.servlet.ServletContext application) throws Exception
Exception
public static Collection<String> getAllCategories(javax.servlet.ServletContext application) throws Exception
Exception
public static Collection<String> getAllCategories(javax.servlet.ServletContext application, User user) throws Exception
session
- user
- mailling
- IOException
Exception
public static List<String> getAllSources(javax.servlet.ServletContext application) throws Exception
Exception
public static List<Template> getAllTemplates(javax.servlet.ServletContext application) throws Exception
Exception
public static List<Template> getAllTemplatesFromContext(GlobalContext context) throws Exception
Exception
public static Collection<Template> getTemplateChildren(javax.servlet.ServletContext application, Template template) throws Exception
application
- template
- IOException
Exception
public static Collection<Template> getTemplateAllChildren(javax.servlet.ServletContext application, Template template) throws Exception
application
- template
- IOException
Exception
public static List<Template> getAllDiskTemplates(javax.servlet.ServletContext application) throws Exception
application
- IOException
Exception
public static Template getDiskTemplate(javax.servlet.ServletContext application, String templateName) throws Exception
application
- appplication contexttemplateName
- the name of the templateIOException
Exception
public static List<Template> getAllValidTemplates(javax.servlet.ServletContext application) throws Exception
Exception
public static Map<String,Template> getDiskTemplates(javax.servlet.ServletContext application) throws Exception
application
- IOException
Exception
public static Template createDiskTemplates(javax.servlet.ServletContext application, String name) throws Exception
application
- IOException
Exception
public static Template createDiskTemplates(javax.servlet.ServletContext application, String name, String source) throws Exception
application
- name
- name of the new template, if all ready exist return null.source
- name of the source template, all files must be copied inside
new template (!with config.properties) null = no source
template.IOException
Exception
public static Map<String,Template> getTemplates(javax.servlet.ServletContext application) throws Exception
application
- IOException
Exception
public static boolean isTemplateExistOnDisk(javax.servlet.ServletContext application, String templateID, boolean mailing) throws Exception
Exception
public static Template getTemplate(ContentContext ctx, MenuElement elem) throws Exception
Exception
public static void copyDefaultTemplate(javax.servlet.ServletContext application)
public static Collection<NavigationWithContent> searchPageNeedTemplate(ContentContext ctx, String templateId) throws Exception
Exception
Copyright © 2012-2018. All Rights Reserved.