Package io.meeds.social.category.storage
Class CategoryStorage
java.lang.Object
io.meeds.social.category.storage.CategoryStorage
TODO change to component when CategoryIndexingConnector moved to be managed
by Spring
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongcountSubcategories(long categoryId) intcountSubcategories(io.meeds.social.category.model.CategorySearchFilter filter, List<Long> identityIds, Locale locale) io.meeds.social.category.model.CategorycreateCategory(io.meeds.social.category.model.Category category) io.meeds.social.category.model.CategorydeleteCategory(long id) List<io.meeds.social.category.model.Category> findCategories(io.meeds.social.category.model.CategorySearchFilter filter, List<Long> identityIds, List<Long> categoryIds, Locale locale) List<io.meeds.social.category.model.Category> findCategories(io.meeds.social.category.model.CategorySearchFilter filter, List<Long> identityIds, Locale locale) findCategoryIds(io.meeds.social.category.model.CategorySearchFilter filter, List<Long> identityIds, Locale locale) getAllCategoryIds(int offset, int limit) io.meeds.social.category.model.CategorygetCategory(long categoryId) getLinkedIds(io.meeds.social.category.model.CategoryObject object) getLinkedIds(String objectType) getLinkedIds(String objectType, List<String> objectIds) The categories each of several objects is filed under, in one query.List<io.meeds.social.category.model.CategoryObject> getLinkedItems(long categoryId, List<String> objectTypes, int offset, int limit) org.exoplatform.social.metadata.model.MetadataItemgetMetadataItem(long categoryId, io.meeds.social.category.model.CategoryObject object) io.meeds.social.category.model.CategorygetRootCategory(long ownerId) longgetRootCategoryId(long ownerId) getSubcategoryIds(long categoryId, long offset, long limit) booleanisLinked(long categoryId, io.meeds.social.category.model.CategoryObject object) voidlink(long categoryId, io.meeds.social.category.model.CategoryObject object, long userIdentityId) voidunlink(long categoryId, io.meeds.social.category.model.CategoryObject object) io.meeds.social.category.model.CategoryupdateCategory(io.meeds.social.category.model.Category category)
-
Constructor Details
-
CategoryStorage
public CategoryStorage()
-
-
Method Details
-
createCategory
public io.meeds.social.category.model.Category createCategory(io.meeds.social.category.model.Category category) -
updateCategory
@CacheEvict(cacheNames="social.category", key="#root.args[0].getId()") public io.meeds.social.category.model.Category updateCategory(io.meeds.social.category.model.Category category) -
deleteCategory
@CacheEvict(cacheNames="social.category") public io.meeds.social.category.model.Category deleteCategory(long id) -
getCategory
@Cacheable(cacheNames="social.category") public io.meeds.social.category.model.Category getCategory(long categoryId) -
getRootCategoryId
@Cacheable(cacheNames="social.categoryRootId") public long getRootCategoryId(long ownerId) -
getRootCategory
public io.meeds.social.category.model.Category getRootCategory(long ownerId) -
getSubcategoryIds
-
countSubcategories
public long countSubcategories(long categoryId) -
findCategories
-
findCategories
public List<io.meeds.social.category.model.Category> findCategories(io.meeds.social.category.model.CategorySearchFilter filter, List<Long> identityIds, List<Long> categoryIds, Locale locale) - Parameters:
filter- search filteridentityIds- identities of the user, used for link permissionscategoryIds- when not null, only these categories may matchlocale- locale of the searched and sorted name- Returns:
- the matching categories
-
findCategoryIds
-
countSubcategories
-
getLinkedIds
-
getLinkedIds
The categories each of several objects is filed under, in one query.The single-object
getLinkedIds(CategoryObject)is the right call for a reader looking at one thing, and the wrong one for a list: a page of rows showing what each is filed under would ask it once per row, which is a query per message on a mail folder and per document on a drive. This answers the page, so the caller decorates its rows by lookup.It is not a drop-in replacement in one respect: the ids are used as given, where the single-object call puts its object through the category plugin first. See the caveat on
CategoryLinkService.getLinkedIds(String, java.util.List).- Parameters:
objectType- the objects' type, as registered by a category pluginobjectIds- the objects' identifiers- Returns:
- the category identifiers of each object, keyed by object id; an object with no category is absent from the map rather than present with an empty list
-
getLinkedIds
-
getLinkedItems
-
isLinked
public boolean isLinked(long categoryId, io.meeds.social.category.model.CategoryObject object) -
link
public void link(long categoryId, io.meeds.social.category.model.CategoryObject object, long userIdentityId) -
unlink
public void unlink(long categoryId, io.meeds.social.category.model.CategoryObject object) -
getMetadataItem
public org.exoplatform.social.metadata.model.MetadataItem getMetadataItem(long categoryId, io.meeds.social.category.model.CategoryObject object) -
getAllCategoryIds
-