public class TemplateServiceImpl extends Object implements TemplateService, org.picocontainer.Startable
DEFAULT_DIALOG, DEFAULT_DIALOGS_PATH, DEFAULT_SKIN, DEFAULT_VIEW, DEFAULT_VIEWS_PATH, DIALOGS, DOCUMENT_TEMPLATE_PROP, LTR, NT_UNSTRUCTURED, RTL, SKINS, TEMPLATE_LABEL, UNDELETABLE_TEMPLATES, VIEWS| Constructor and Description |
|---|
TemplateServiceImpl(org.exoplatform.services.jcr.RepositoryService jcrService,
org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator nodeHierarchyCreator,
org.exoplatform.services.security.IdentityRegistry identityRegistry,
org.exoplatform.groovyscript.text.TemplateService templateService,
DMSConfiguration dmsConfiguration,
org.exoplatform.services.resources.LocaleConfigService localeConfigService,
org.exoplatform.services.cache.CacheService caService)
Constructor method.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addContentTypeFilterPlugin(ContentTypeFilterPlugin filterPlugin)
This method is used to filter types of NodeType which is added in folder.
|
String |
addTemplate(String templateType,
String nodeTypeName,
String label,
boolean isDocumentTemplate,
String templateName,
String[] roles,
InputStream templateFile)
Insert a new template into NodeType by giving the following parameters.
|
String |
addTemplate(String templateType,
String nodeTypeName,
String label,
boolean isDocumentTemplate,
String templateName,
String[] roles,
InputStream templateFile,
javax.jcr.Node templatesHome)
Insert a new template into NodeType by giving the following parameters.
|
void |
addTemplates(org.exoplatform.container.component.ComponentPlugin plugin) |
String |
buildDialogForm(String nodeTypeName)
Build string of dialog form template base on properties of nodetype.
|
String |
buildStyleSheet(String nodeTypeName)
Build string of view template form base on properties of nodetype.
|
String |
buildViewForm(String nodeTypeName)
Build string of view template form base on properties of nodetype.
|
String |
createTemplate(javax.jcr.Node templateFolder,
String name,
InputStream data,
String[] roles)
Deprecated.
|
String |
createTemplate(javax.jcr.Node templateFolder,
String title,
String templateName,
InputStream data,
String[] roles)
Insert a template into JCR database as an nt:file node.
|
Set<String> |
getAllConfiguredNodeTypes()
gets all node types configured
|
List<String> |
getAllDocumentNodeTypes()
Get All Document NodeTypes of the current repository.
|
Set<String> |
getAllEditedConfiguredNodeTypes()
Gets all node types configured whose templates were edited.
|
Set<String> |
getAllowanceFolderType()
Get set of folder type.
|
javax.jcr.NodeIterator |
getAllTemplatesOfNodeType(boolean isDialog,
String nodeTypeName,
org.exoplatform.services.jcr.ext.common.SessionProvider provider)
Return all teamplate of the specified NodeType.
|
List<String> |
getCreationableContentTypes(javax.jcr.Node node)
Return CreationableContent Types to the given node.
|
String |
getDefaultTemplatePath(boolean isDialog,
String nodeTypeName)
Return path of default template by giving the following parameters.
|
List<String> |
getDocumentTemplates()
Get all templates is document type of the specified repository.
|
String |
getSkinPath(String nodeTypeName,
String skinName,
String locale)
Get path of css file which included in view template.
|
String |
getTemplate(javax.jcr.Node template)
Get a template from JCR database.
|
String |
getTemplate(String type,
String nodeTypeName,
String templateName)
Return template file of the specified node.
|
String |
getTemplateLabel(String nodeTypeName)
Return the label of the specified template by giving the following parameters.
|
javax.jcr.Node |
getTemplateNode(String type,
String nodeTypeName,
String templateName,
org.exoplatform.services.jcr.ext.common.SessionProvider provider)
Return template Node (Name of NodeType, Name of Template) by giving the following parameters.
|
String |
getTemplatePath(boolean isDialog,
String nodeTypeName,
String templateName)
Return path template of the specified node.
|
String |
getTemplatePath(javax.jcr.Node node,
boolean isDialog)
Return path template of the specified node.
|
String |
getTemplatePathByAnonymous(boolean isDialog,
String nodeTypeName)
Return the path public template.
|
String |
getTemplatePathByUser(boolean isDialog,
String nodeTypeName,
String userName)
Return the template by user.
|
String |
getTemplateRoles(javax.jcr.Node template)
Get roles from a template.
|
javax.jcr.Node |
getTemplatesHome(org.exoplatform.services.jcr.ext.common.SessionProvider provider)
Return template home of current repository.
|
void |
init()
Get all template that is configured in XML file of current repository.
|
boolean |
isChildNodePrimaryTypeAllowed(javax.jcr.Node parent,
String childNodeTypeName) |
boolean |
isManagedNodeType(String nodeTypeName)
Return true if the given repository has document type named 'nodeTypeName'.
|
void |
removeAllTemplateCached()
Remove all templates cached.
|
void |
removeCacheTemplate(String name)
Remove cache of template.
|
void |
removeManagedNodeType(String nodeTypeName)
Removes the NodeType by giving the name of NodeType.
|
void |
removeTemplate(String type,
String nodeTypeName,
String templateName)
Remove a template of NodeType by giving the following parameters.
|
void |
start() |
void |
stop() |
String |
updateTemplate(javax.jcr.Node template,
InputStream data,
String[] roles)
Update a template inside JCR database.
|
public TemplateServiceImpl(org.exoplatform.services.jcr.RepositoryService jcrService,
org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator nodeHierarchyCreator,
org.exoplatform.services.security.IdentityRegistry identityRegistry,
org.exoplatform.groovyscript.text.TemplateService templateService,
DMSConfiguration dmsConfiguration,
org.exoplatform.services.resources.LocaleConfigService localeConfigService,
org.exoplatform.services.cache.CacheService caService)
throws Exception
jcrService - RepositoryServicenodeHierarchyCreator - NodeHierarchyCreatoridentityRegistry - IdentityRegistrylocaleConfigService - LocaleConfigServicecaService - CacheServicedmsConfiguration - DMSConfigurationExceptionpublic void start()
start in interface org.picocontainer.Startablepublic void stop()
stop in interface org.picocontainer.Startablepublic void addContentTypeFilterPlugin(ContentTypeFilterPlugin filterPlugin)
addContentTypeFilterPlugin in interface TemplateServicefilterPlugin - Content filer pluginpublic Set<String> getAllowanceFolderType()
getAllowanceFolderType in interface TemplateServicepublic void addTemplates(org.exoplatform.container.component.ComponentPlugin plugin)
public void init()
throws Exception
init in interface TemplateServiceExceptionTemplatePluginpublic javax.jcr.Node getTemplatesHome(org.exoplatform.services.jcr.ext.common.SessionProvider provider)
throws Exception
getTemplatesHome in interface TemplateServiceprovider - SessionProvider
The SessionProvider object is used to managed SessionsExceptionNodepublic List<String> getCreationableContentTypes(javax.jcr.Node node) throws Exception
getCreationableContentTypes in interface TemplateServicenode - The specified nodeExceptionNodepublic boolean isChildNodePrimaryTypeAllowed(javax.jcr.Node parent,
String childNodeTypeName)
throws Exception
Exceptionpublic boolean isManagedNodeType(String nodeTypeName) throws javax.jcr.RepositoryException
isManagedNodeType in interface TemplateServicenodeTypeName - String
The name of NodeTypejavax.jcr.RepositoryExceptionSessionProvider,
Session,
Nodepublic String getTemplatePath(javax.jcr.Node node, boolean isDialog) throws Exception
getTemplatePath in interface TemplateServicenode - Node
The specified nodeisDialog - boolean
The boolean value which specify the type of templateExceptionNodepublic javax.jcr.NodeIterator getAllTemplatesOfNodeType(boolean isDialog,
String nodeTypeName,
org.exoplatform.services.jcr.ext.common.SessionProvider provider)
throws Exception
getAllTemplatesOfNodeType in interface TemplateServiceisDialog - boolean The boolean value which specify the type of
templatenodeTypeName - String The name of NodeTypeprovider - SessionProvider The SessionProvider object is used to
managed SessionsExceptionSessionProvider,
Nodepublic String getDefaultTemplatePath(boolean isDialog, String nodeTypeName)
getDefaultTemplatePath in interface TemplateServiceisDialog - boolean
The boolean value which specify the type of templatenodeTypeName - String
The name of NodeTypepublic javax.jcr.Node getTemplateNode(String type, String nodeTypeName, String templateName, org.exoplatform.services.jcr.ext.common.SessionProvider provider) throws Exception
getTemplateNode in interface TemplateServicetype - String
The value which specify the type of templatenodeTypeName - String
The name of NodeTypetemplateName - String
The name of templateprovider - SessionProvider
The SessionProvider object is used to managed SessionsExceptionSessionProvider,
Nodepublic String getTemplatePathByUser(boolean isDialog, String nodeTypeName, String userName) throws javax.jcr.RepositoryException
getTemplatePathByUser in interface TemplateServiceisDialog - boolean
The boolean value which specify the type of templatenodeTypeName - String
The specify name of node typeuserName - String
The current userjavax.jcr.RepositoryExceptionNode,
Sessionpublic String getTemplatePath(boolean isDialog, String nodeTypeName, String templateName) throws Exception
getTemplatePath in interface TemplateServiceisDialog - boolean
The boolean value which specify the type of templatenodeTypeName - String
The specify name of node typetemplateName - String
The name of templateExceptionSession,
Nodepublic String getTemplateLabel(String nodeTypeName) throws Exception
getTemplateLabel in interface TemplateServicenodeTypeName - String
The specified name of NodeTypeExceptionSessionProvider,
Nodepublic String getTemplate(String type, String nodeTypeName, String templateName) throws Exception
getTemplate in interface TemplateServicetype - String
The string value which specify the type of templatenodeTypeName - String
The specify name of node typetemplateName - String
The name of templateExceptionSession,
Nodepublic void removeTemplate(String type, String nodeTypeName, String templateName) throws Exception
removeTemplate in interface TemplateServicetype - String
The value which specify the type of templatenodeTypeName - String
The specify name of NodTypetemplateName - String
The name of templateExceptionSession,
Nodepublic void removeManagedNodeType(String nodeTypeName) throws Exception
removeManagedNodeType in interface TemplateServicenodeTypeName - String
The name of NodeTypeExceptionSession,
Nodepublic List<String> getDocumentTemplates() throws javax.jcr.RepositoryException
getDocumentTemplates in interface TemplateServicejavax.jcr.RepositoryExceptionSession,
Nodepublic String getTemplatePathByAnonymous(boolean isDialog, String nodeTypeName) throws javax.jcr.RepositoryException
getTemplatePathByAnonymous in interface TemplateServiceisDialog - boolean
The boolean value which specify the type of templatenodeTypeName - String
The specify name of node typejavax.jcr.RepositoryExceptionpublic void removeCacheTemplate(String name) throws Exception
removeCacheTemplate in interface TemplateServicename - String
jcr path of templateExceptionpublic void removeAllTemplateCached()
removeAllTemplateCached in interface TemplateServicepublic List<String> getAllDocumentNodeTypes() throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException
TemplateServicegetAllDocumentNodeTypes in interface TemplateServicejavax.jcr.PathNotFoundExceptionjavax.jcr.RepositoryExceptionpublic String getSkinPath(String nodeTypeName, String skinName, String locale) throws Exception
getSkinPath in interface TemplateServicenodeTypeName - String
The node type nameskinName - String
The name of css filelocale - String
The locale which specified by userExceptionpublic String buildDialogForm(String nodeTypeName) throws Exception
buildDialogForm in interface TemplateServiceExceptionpublic String buildViewForm(String nodeTypeName) throws Exception
buildViewForm in interface TemplateServiceExceptionpublic String buildStyleSheet(String nodeTypeName) throws Exception
buildStyleSheet in interface TemplateServiceExceptionpublic String addTemplate(String templateType, String nodeTypeName, String label, boolean isDocumentTemplate, String templateName, String[] roles, InputStream templateFile) throws Exception
addTemplate in interface TemplateServicetemplateType - The value which specify the type of templatenodeTypeName - The specify name of NodTypelabel - The label of the specified templateisDocumentTemplate - The boolean value which yes or no is DocumentTemplatetemplateName - The name of templateroles - The roles of templatetemplateFile - The file of templateExceptionSession,
Nodepublic String addTemplate(String templateType, String nodeTypeName, String label, boolean isDocumentTemplate, String templateName, String[] roles, InputStream templateFile, javax.jcr.Node templatesHome) throws Exception
addTemplate in interface TemplateServicetemplateType - The value which specify the type of templatenodeTypeName - The specify name of NodTypelabel - The label of the specified templateisDocumentTemplate - The boolean value which yes or no is DocumentTemplatetemplateName - The name of templateroles - The roles of templatetemplateFile - The file of templatetemplatesHome - NodeExceptionSession,
Node@Deprecated public String createTemplate(javax.jcr.Node templateFolder, String name, InputStream data, String[] roles)
createTemplate in interface TemplateServicetemplateFolder - The parent node which contains the template nodename - The template's namedata - The template's dataroles - The template's rolespublic String createTemplate(javax.jcr.Node templateFolder, String title, String templateName, InputStream data, String[] roles)
createTemplate in interface TemplateServicetemplateFolder - The parent node which contains the template nodetitle - The template titletemplateName - The template's namedata - The template's dataroles - The template's rolespublic String updateTemplate(javax.jcr.Node template, InputStream data, String[] roles)
updateTemplate in interface TemplateServicetemplate - The template nodedata - The template's dataroles - The template's rolespublic String getTemplate(javax.jcr.Node template)
getTemplate in interface TemplateServicetemplate - The template nodepublic String getTemplateRoles(javax.jcr.Node template)
getTemplateRoles in interface TemplateServicetemplate - The template nodepublic Set<String> getAllConfiguredNodeTypes()
TemplateServicegetAllConfiguredNodeTypes in interface TemplateServicepublic Set<String> getAllEditedConfiguredNodeTypes() throws Exception
TemplateServicegetAllEditedConfiguredNodeTypes in interface TemplateServiceExceptionCopyright © 2003–2019 eXo Platform SAS. All rights reserved.