public class CategoryServiceImpl extends CategoryService
Title: Category management service database implementation
Description: Category management service database implementation, allows browsing of categories as well as navigation and manipulating categories and associated objects. This service should not be used directly but rather the Category class should be used to manipulate categories and associations.
Copyright: Copyright (c) 2002
Company: Jahia Ltd
settingsBean| Modifier | Constructor and Description |
|---|---|
protected |
CategoryServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
Category |
addCategory(String key,
Category parentCategory)
Add a new category under a specified category.
|
void |
addObjectKeyToCategory(Category parentCategory,
ObjectKey childKey)
Associate a category with an object key
|
List<Category> |
findCategoriesByPropNameAndValue(String propName,
String propValue,
JahiaUser user) |
List<Category> |
getCategoriesContainingStringInTitle(String string,
String languageCode)
Retrieves the list of categories which have a title that contains a given String.
|
javax.jcr.Node |
getCategoriesRoot() |
List<Category> |
getCategory(String key) |
Category |
getCategory(String key,
Category parentCategory) |
Category |
getCategoryByPath(String categoryPath) |
Category |
getCategoryByUUID(String categoryUUID) |
List<Category> |
getCategoryChildCategories(Category parentCategory,
JahiaUser user)
Retrieves the child category keys that are associated with the given
parent category.
|
List<ObjectKey> |
getCategoryChildKeys(Category parentCategory)
Retrieves the child object keys that are associated with the given
parent category.
|
List<ObjectKey> |
getCategoryParentKeys(Category parentCategory)
Retrieves the parent object keys that are associated with the given
child category.
|
List<Category> |
getCategoryStartingByKeyPrefix(String keyPrefix)
Retrieves the list of categories which have a categoryKey that starts with a given prefix.
|
List<Category> |
getCategoryStartingByTitlePrefix(String titlePrefix,
String languageCode)
Retrieves the list of categories which have a title that starts with a given prefix.
|
static CategoryServiceImpl |
getInstance()
Return the unique service instance.
|
Set<Category> |
getObjectCategories(ObjectKey objectKey)
Returns a set of categories with which this object is associated.
|
Properties |
getProperties(String categoryId) |
List<Category> |
getRootCategories(JahiaUser user) |
String |
getTitleForCategory(Category category,
Locale locale)
Retrieves a title in a certain locale for a category.
|
Map<String,String> |
getTitlesForCategory(Category category)
Retrieves all titles in all locales for a category.
|
void |
removeCategory(Category category)
Removes a category and all the associations with it, including all the
title translations.
|
void |
removeObjectKeyFromCategory(Category parentCategory,
ObjectKey childKey)
Remove an association between a category and an object key
|
void |
removeProperties(String categoryId) |
void |
removeTitleForCategory(Category category,
Locale locale)
Remove a title for a category in a given locale.
|
void |
setCategoryProvider(JCRCategoryProvider categoryProvider) |
void |
setProperties(String categoryId,
Properties properties) |
void |
setTitleForCategory(Category category,
Locale locale,
String title)
Set a title for a category in a given locale.
|
void |
start() |
void |
stop() |
getSettingsBean, setSettingsBeanpublic static CategoryServiceImpl getInstance()
public void setCategoryProvider(JCRCategoryProvider categoryProvider)
public void start()
throws JahiaInitializationException
start in class JahiaServiceJahiaInitializationExceptionpublic void stop()
stop in class JahiaServicepublic javax.jcr.Node getCategoriesRoot()
throws JahiaException
getCategoriesRoot in class CategoryServiceJahiaException - thrown if there was a problem communicating with
the databasepublic List<Category> getRootCategories(JahiaUser user) throws JahiaException
getRootCategories in class CategoryServiceuser - the user name executing the operationJahiaException - thrown if there was a problem communicating with
the databasepublic List<Category> getCategory(String key) throws JahiaException
getCategory in class CategoryServicekey - the key for the category to retrieveJahiaException - thrown if there was a problem communicating with
the databasepublic Category getCategory(String key, Category parentCategory) throws JahiaException
JahiaExceptionpublic Category getCategoryByUUID(String categoryUUID) throws JahiaException
getCategoryByUUID in class CategoryServicecategoryUUID - the identifier of the category to retrieve from the
persistent storageJahiaException - thrown if there was a problem communicating with
the databasepublic Category getCategoryByPath(String categoryPath) throws JahiaException
getCategoryByPath in class CategoryServicecategoryPath - the identifier of the category to retrieve from the
persistent storageJahiaException - thrown if there was a problem communicating with
the databasepublic List<Category> getCategoryChildCategories(Category parentCategory, JahiaUser user) throws JahiaException
CategoryServicegetCategoryChildCategories in class CategoryServiceparentCategory - the category for which to retrieve the sub-categoriesJahiaException - thrown if there was a problem communicating with
the databasepublic List<ObjectKey> getCategoryChildKeys(Category parentCategory) throws JahiaException
CategoryServicegetCategoryChildKeys in class CategoryServiceparentCategory - the category for which to retrieve the child
object key listJahiaException - thrown if there was a problem communicating with
the databasepublic List<ObjectKey> getCategoryParentKeys(Category parentCategory) throws JahiaException
CategoryServicegetCategoryParentKeys in class CategoryServiceparentCategory - the category for which to retrieve the parent
object key list.JahiaException - JahiaException thrown if there was a problem
communicating with the databasepublic Category addCategory(String key, Category parentCategory) throws JahiaException
CategoryServiceaddCategory in class CategoryServiceparentCategory - the parent category which will contain as a
child the newCategory.JahiaException - thrown if there was a problem communicating with
the databasepublic void removeCategory(Category category) throws JahiaException
CategoryServiceremoveCategory in class CategoryServicecategory - the category to be removedJahiaException - thrown if there was a problem communicating with
the databasepublic void addObjectKeyToCategory(Category parentCategory, ObjectKey childKey) throws JahiaException
CategoryServiceaddObjectKeyToCategory in class CategoryServiceparentCategory - the category that will be associated with the
object keychildKey - the object key that will become a "child" of the
specified category.JahiaException - thrown if there was a problem communicating with
the databasepublic void removeObjectKeyFromCategory(Category parentCategory, ObjectKey childKey) throws JahiaException
CategoryServiceremoveObjectKeyFromCategory in class CategoryServiceparentCategory - the category currently involved in this associationchildKey - the category child object that we want to remove from
this associationJahiaException - thrown if there was a problem communicating with
the databasepublic Set<Category> getObjectCategories(ObjectKey objectKey) throws JahiaException
CategoryServicegetObjectCategories in class CategoryServiceobjectKey - the object key for the object for which to retrieve the
categoriesJahiaException - thrown if there was a problem communicating with
the database.public Map<String,String> getTitlesForCategory(Category category) throws JahiaException
CategoryServicegetTitlesForCategory in class CategoryServicecategory - the category for which to retrieve the titleJahiaException - thrown if there was a problem communicating with
the databasepublic String getTitleForCategory(Category category, Locale locale) throws JahiaException
CategoryServicegetTitleForCategory in class CategoryServicecategory - the category for which to retrieve the titlelocale - the locale for which to retrieve the titleJahiaException - thrown if there was a problem communicating with
the databasepublic void setTitleForCategory(Category category, Locale locale, String title) throws JahiaException
CategoryServicesetTitleForCategory in class CategoryServicecategory - the category for which to set the titlelocale - the locale for which to set the titletitle - the title in the given localeJahiaException - thrown if there was a problem communicating with
the databasepublic void removeTitleForCategory(Category category, Locale locale) throws JahiaException
CategoryServiceremoveTitleForCategory in class CategoryServicecategory - the category for which to remove the titlelocale - the locale in which to remove the titleJahiaException - thrown if there was a problem communicating with
the databasepublic List<Category> getCategoryStartingByKeyPrefix(String keyPrefix) throws JahiaException
CategoryServicegetCategoryStartingByKeyPrefix in class CategoryServicekeyPrefix - the key prefix to search forJahiaException - thrown if there was a problem communicating with the databasepublic List<Category> getCategoryStartingByTitlePrefix(String titlePrefix, String languageCode) throws JahiaException
CategoryServicegetCategoryStartingByTitlePrefix in class CategoryServicetitlePrefix - the title prefix to search forlanguageCode - the current languageJahiaException - thrown if there was a problem communicating with the databasepublic List<Category> getCategoriesContainingStringInTitle(String string, String languageCode) throws JahiaException
CategoryServicegetCategoriesContainingStringInTitle in class CategoryServicestring - the string to search forlanguageCode - the current languageJahiaException - thrown if there was a problem communicating with the databasepublic List<Category> findCategoriesByPropNameAndValue(String propName, String propValue, JahiaUser user)
findCategoriesByPropNameAndValue in class CategoryServicepublic void removeProperties(String categoryId)
removeProperties in class CategoryServicepublic Properties getProperties(String categoryId)
getProperties in class CategoryServicepublic void setProperties(String categoryId, Properties properties)
setProperties in class CategoryServiceCopyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.