public class TaxonomyServiceImpl extends Object implements TaxonomyService, org.picocontainer.Startable
| Constructor and Description |
|---|
TaxonomyServiceImpl(org.exoplatform.container.xml.InitParams initParams,
org.exoplatform.services.jcr.ext.app.SessionProviderService providerService,
org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator nodeHierarchyCreator,
org.exoplatform.services.jcr.RepositoryService repoService,
LinkManager linkManager,
DMSConfiguration dmsConfiguration)
Constructor method
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCategories(javax.jcr.Node node,
String taxonomyName,
String[] categoryPaths)
Adds categories to a given node.
|
void |
addCategories(javax.jcr.Node node,
String taxonomyName,
String[] categoryPaths,
boolean system)
Adds categories to a given node.
|
void |
addCategory(javax.jcr.Node node,
String taxonomyName,
String categoryPath)
Adds a new category to a given node.
|
void |
addCategory(javax.jcr.Node node,
String taxonomyName,
String categoryPath,
boolean system)
Adds a new category to a given node.
|
void |
addTaxonomyNode(String workspace,
String parentPath,
String taxoNodeName,
String creatorUser)
Adds a new taxonomy node at the given location.
|
void |
addTaxonomyPlugin(org.exoplatform.container.component.ComponentPlugin plugin)
Adds a new taxonomy plugin to the Taxonomy Service.
|
void |
addTaxonomyTree(javax.jcr.Node taxonomyTree)
Creates a new taxonomy tree.
|
List<javax.jcr.Node> |
getAllCategories(javax.jcr.Node node)
Gets all categories that contain a given node under all taxonomy trees.
|
List<javax.jcr.Node> |
getAllCategories(javax.jcr.Node node,
boolean system)
Gets all categories that contain a given node under all taxonomy trees.
|
List<javax.jcr.Node> |
getAllTaxonomyTrees()
Gets all taxonomy trees using the user session.
|
List<javax.jcr.Node> |
getAllTaxonomyTrees(boolean system)
Gets all taxonomy trees.
|
List<javax.jcr.Node> |
getCategories(javax.jcr.Node node,
String taxonomyName)
Gets all categories that contain a given node under a taxonomy tree.
|
List<javax.jcr.Node> |
getCategories(javax.jcr.Node node,
String taxonomyName,
boolean system)
Gets all categories that contain a given node under a taxonomy tree.
|
String |
getCategoryNameLength()
Gets the limited length of a category name.
|
Map<String,String[]> |
getPermissions(List<TaxonomyTreeDefaultUserPermission.Permission> permissions) |
javax.jcr.Node |
getTaxonomyTree(String taxonomyName)
Gets a taxonomy tree using the user session.
|
javax.jcr.Node |
getTaxonomyTree(String taxonomyName,
boolean system)
Gets a taxonomy tree.
|
Map<String,String[]> |
getTaxonomyTreeDefaultUserPermission()
Gets default permissions of a taxonomy tree.
|
boolean |
hasCategories(javax.jcr.Node node,
String taxonomyName)
Checks if a category node exists in a given taxonomy by using the user session.
|
boolean |
hasCategories(javax.jcr.Node node,
String taxonomyName,
boolean system)
Checks if a category node exists in a given taxonomy.
|
boolean |
hasTaxonomyTree(String taxonomyName)
Checks if a taxonomy tree with the given name has already been defined.
|
void |
init()
Initializes all taxonomy plugins that have been set in the configuration files.
|
void |
moveTaxonomyNode(String workspace,
String srcPath,
String destPath,
String type)
Copies or cuts the taxonomy node from source path to destination path.
|
void |
removeCategory(javax.jcr.Node node,
String taxonomyName,
String categoryPath)
Removes a category from a given node.
|
void |
removeCategory(javax.jcr.Node node,
String taxonomyName,
String categoryPath,
boolean system)
Removes a category from a given node.
|
void |
removeTaxonomyNode(String workspace,
String absPath)
Removes a taxonomy node located at the given absolute path.
|
void |
removeTaxonomyTree(String taxonomyName)
Removes a taxonomy tree.
|
void |
start() |
void |
stop() |
void |
updateTaxonomyTree(String taxonomyName,
javax.jcr.Node taxonomyTree)
Updates a taxonomy tree.
|
public TaxonomyServiceImpl(org.exoplatform.container.xml.InitParams initParams,
org.exoplatform.services.jcr.ext.app.SessionProviderService providerService,
org.exoplatform.services.jcr.ext.hierarchy.NodeHierarchyCreator nodeHierarchyCreator,
org.exoplatform.services.jcr.RepositoryService repoService,
LinkManager linkManager,
DMSConfiguration dmsConfiguration)
throws Exception
providerService - create sessionnodeHierarchyCreator - get path by alias namerepoService - manage repositorylinkManager - create and reach linkdmsConfiguration - get dms-system workspaceExceptionpublic String getCategoryNameLength()
TaxonomyServicegetCategoryNameLength in interface TaxonomyServicepublic void init()
throws Exception
TaxonomyServiceinit in interface TaxonomyServiceExceptionTaxonomyPluginpublic void addTaxonomyPlugin(org.exoplatform.container.component.ComponentPlugin plugin)
addTaxonomyPlugin in interface TaxonomyServiceplugin - The plugin to be added.public List<javax.jcr.Node> getAllTaxonomyTrees() throws javax.jcr.RepositoryException
TaxonomyServicegetAllTaxonomyTrees in interface TaxonomyServicejavax.jcr.RepositoryException - if the taxonomies could not be found.public List<javax.jcr.Node> getAllTaxonomyTrees(boolean system) throws javax.jcr.RepositoryException
getAllTaxonomyTrees in interface TaxonomyServicesystem - If "true", the system session is used.
If "false", the user session is used.javax.jcr.RepositoryException - if the taxonomy trees could not be found.public javax.jcr.Node getTaxonomyTree(String taxonomyName) throws javax.jcr.RepositoryException
getTaxonomyTree in interface TaxonomyServicetaxonomyName - Name of the taxonomy tree.javax.jcr.RepositoryException - if the taxonomy tree could not be found.public javax.jcr.Node getTaxonomyTree(String taxonomyName, boolean system) throws javax.jcr.RepositoryException
getTaxonomyTree in interface TaxonomyServicetaxonomyName - Name of the taxonomy tree.system - If "true", the system session is used.
If "false", the user session is used.javax.jcr.RepositoryException - if the taxonomy tree could not be found.public boolean hasTaxonomyTree(String taxonomyName) throws javax.jcr.RepositoryException
hasTaxonomyTree in interface TaxonomyServicetaxonomyName - Name of the taxonomy tree to be checked.javax.jcr.RepositoryException - if the taxonomy name could not be checked.public void addTaxonomyTree(javax.jcr.Node taxonomyTree)
throws javax.jcr.RepositoryException,
TaxonomyAlreadyExistsException
addTaxonomyTree in interface TaxonomyServicetaxonomyTree - The taxonomy tree to be created.javax.jcr.RepositoryException - if the taxonomy tree could not be defined.TaxonomyAlreadyExistsException - if a taxonomy with the same name has
already been defined.public void updateTaxonomyTree(String taxonomyName, javax.jcr.Node taxonomyTree) throws javax.jcr.RepositoryException
updateTaxonomyTree in interface TaxonomyServicetaxonomyName - Name of the taxonomy.taxonomyTree - The taxonomy tree to be updated.javax.jcr.RepositoryException - if the taxonomy tree could not be updated.public void removeTaxonomyTree(String taxonomyName) throws javax.jcr.RepositoryException
removeTaxonomyTree in interface TaxonomyServicetaxonomyName - Name of the taxonomy to be removed.javax.jcr.RepositoryException - if the taxonomy tree could not be removed.public void addTaxonomyNode(String workspace, String parentPath, String taxoNodeName, String creatorUser) throws javax.jcr.RepositoryException, TaxonomyNodeAlreadyExistsException
addTaxonomyNode in interface TaxonomyServiceworkspace - Name of the workspace to which the taxonomy node is added.parentPath - The place where the taxonomy node will be added.taxoNodeName - Name of the taxonomy node.creatorUser - The user who created the taxonomy node.javax.jcr.RepositoryException - if the taxonomy node could not be added.TaxonomyNodeAlreadyExistsException - if a taxonomy node with the same
name has already been added.public void removeTaxonomyNode(String workspace, String absPath) throws javax.jcr.RepositoryException
removeTaxonomyNode in interface TaxonomyServiceworkspace - Name of the workspace from which the taxonomy node is removed.absPath - The given absolute path.javax.jcr.RepositoryException - if the taxonomy node could not be removed.public List<javax.jcr.Node> getCategories(javax.jcr.Node node, String taxonomyName) throws javax.jcr.RepositoryException
getCategories in interface TaxonomyServicenode - The given node.taxonomyName - The taxonomy tree where categories are got.javax.jcr.RepositoryException - if the categories cannot be retrieved.public List<javax.jcr.Node> getCategories(javax.jcr.Node node, String taxonomyName, boolean system) throws javax.jcr.RepositoryException
getCategories in interface TaxonomyServicenode - The given node.taxonomyName - The taxonomy tree where categories are got.system - If "true", the system session is used. If "false", the user session is used.javax.jcr.RepositoryException - if the categories cannot be retrieved.public List<javax.jcr.Node> getAllCategories(javax.jcr.Node node) throws javax.jcr.RepositoryException
getAllCategories in interface TaxonomyServicenode - The given node.javax.jcr.RepositoryExceptionpublic List<javax.jcr.Node> getAllCategories(javax.jcr.Node node, boolean system) throws javax.jcr.RepositoryException
getAllCategories in interface TaxonomyServicenode - The given node.system - If "true", the system session is used. If "false", the user session is used.javax.jcr.RepositoryExceptionpublic void addCategory(javax.jcr.Node node,
String taxonomyName,
String categoryPath)
throws javax.jcr.RepositoryException
addCategory in interface TaxonomyServicenode - The given node.taxonomyName - The taxonomy tree that contains the added category.categoryPath - Path of the added category.javax.jcr.RepositoryException - if the category cannot be added.public void addCategory(javax.jcr.Node node,
String taxonomyName,
String categoryPath,
boolean system)
throws javax.jcr.RepositoryException
addCategory in interface TaxonomyServicenode - The given node.taxonomyName - The taxonomy tree that contains the added category.categoryPath - Path of the added category.system - If "true", the system session is used. If "false", the user session is used.javax.jcr.RepositoryException - if the category cannot be added.public void addCategories(javax.jcr.Node node,
String taxonomyName,
String[] categoryPaths)
throws javax.jcr.RepositoryException
addCategories in interface TaxonomyServicenode - The given node.taxonomyName - The taxonomy tree that contains the added category.categoryPaths - Paths of the added categories.javax.jcr.RepositoryException - if the categories cannot be added.public void addCategories(javax.jcr.Node node,
String taxonomyName,
String[] categoryPaths,
boolean system)
throws javax.jcr.RepositoryException
addCategories in interface TaxonomyServicenode - The given node.taxonomyName - The taxonomy tree that contains the added category.categoryPaths - Paths of the added categories.system - If "true", the system session is used. If "false", the user session is used.javax.jcr.RepositoryException - if the categories cannot be added.public boolean hasCategories(javax.jcr.Node node,
String taxonomyName)
throws javax.jcr.RepositoryException
hasCategories in interface TaxonomyServicenode - The category node to be checked.taxonomyName - Name of the given taxonomy.javax.jcr.RepositoryException - if the category cannot be checked.public boolean hasCategories(javax.jcr.Node node,
String taxonomyName,
boolean system)
throws javax.jcr.RepositoryException
hasCategories in interface TaxonomyServicenode - The category node to be checked.taxonomyName - Name of the given taxonomy.system - If "true", the system session is used. If "false", the user session is used.javax.jcr.RepositoryException - if the category cannot be checked.public void moveTaxonomyNode(String workspace, String srcPath, String destPath, String type) throws javax.jcr.RepositoryException
TaxonomyServicemoveTaxonomyNode in interface TaxonomyServiceworkspace - Name of the workspace which contains the taxonomy node.srcPath - Source path of the taxonomy node.destPath - Destination path of the taxonomy node.type - Type of moving: copy or cut.javax.jcr.RepositoryException - if the taxonomy node could not be moved.public void removeCategory(javax.jcr.Node node,
String taxonomyName,
String categoryPath)
throws javax.jcr.RepositoryException
removeCategory in interface TaxonomyServicenode - The given node.taxonomyName - The taxonomy tree that contains the removed category.categoryPath - Path of the removed category.javax.jcr.RepositoryException - if the category cannot be removed.public void removeCategory(javax.jcr.Node node,
String taxonomyName,
String categoryPath,
boolean system)
throws javax.jcr.RepositoryException
removeCategory in interface TaxonomyServicenode - The given node.taxonomyName - The taxonomy tree that contains the removed category.categoryPath - Path of the removed category.system - If "true", the system session is used. If "false", the user session is used.javax.jcr.RepositoryException - if the category cannot be removed.public Map<String,String[]> getTaxonomyTreeDefaultUserPermission()
getTaxonomyTreeDefaultUserPermission in interface TaxonomyServicepublic Map<String,String[]> getPermissions(List<TaxonomyTreeDefaultUserPermission.Permission> permissions)
public void start()
start in interface org.picocontainer.Startablepublic void stop()
stop in interface org.picocontainer.StartableCopyright © 2003–2019 eXo Platform SAS. All rights reserved.