Package io.meeds.social.space.plugin
Class SpaceCategoryPlugin
java.lang.Object
io.meeds.social.space.plugin.SpaceCategoryPlugin
- All Implemented Interfaces:
io.meeds.social.category.plugin.CategoryPlugin
@Component
public class SpaceCategoryPlugin
extends Object
implements io.meeds.social.category.plugin.CategoryPlugin
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanio.meeds.social.category.model.CategoryObjectgetObject(io.meeds.social.category.model.CategoryObject categoryObject) Normalizes the identifier carried by the incomingCategoryObjectto the canonical space technical id (Space.getSpaceId()) before the link is stored, read back or broadcast.getType()voidinit()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.meeds.social.category.plugin.CategoryPlugin
getCategoryIds, getCategoryIds, getEntryItem
-
Field Details
-
OBJECT_TYPE
- See Also:
-
-
Constructor Details
-
SpaceCategoryPlugin
public SpaceCategoryPlugin()
-
-
Method Details
-
init
@PostConstruct public void init() -
getType
- Specified by:
getTypein interfaceio.meeds.social.category.plugin.CategoryPlugin
-
canAccess
- Specified by:
canAccessin interfaceio.meeds.social.category.plugin.CategoryPlugin
-
canEdit
- Specified by:
canEditin interfaceio.meeds.social.category.plugin.CategoryPlugin
-
getCategoryIds
- Specified by:
getCategoryIdsin interfaceio.meeds.social.category.plugin.CategoryPlugin
-
getObject
public io.meeds.social.category.model.CategoryObject getObject(io.meeds.social.category.model.CategoryObject categoryObject) Normalizes the identifier carried by the incomingCategoryObjectto the canonical space technical id (Space.getSpaceId()) before the link is stored, read back or broadcast. Category links are stored generically on(type, id), but the space UI/REST relies on the denormalizedspace.getCategoryIds()that is only kept in sync byCategoryLinkModifiedListener, whose SPACE branch resolves the space throughspaceService.getSpaceById(object.getId())and therefore requires the technical id. Callers (e.g. the MCP tooling) may pass the space identity id or its pretty name instead; normalizing here makes the write, the read-back and the denormalization listener all agree whichever id form was supplied.- Specified by:
getObjectin interfaceio.meeds.social.category.plugin.CategoryPlugin- Parameters:
categoryObject- The incomingCategoryObjectwhose id may be a space technical id, a socialIdentityid or a pretty name- Returns:
- A
CategoryObjectcarrying the canonical space technical id, or the object unchanged when the id cannot be resolved to a space
-