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 Details

  • Constructor Details

    • SpaceCategoryPlugin

      public SpaceCategoryPlugin()
  • Method Details

    • init

      @PostConstruct public void init()
    • getType

      public String getType()
      Specified by:
      getType in interface io.meeds.social.category.plugin.CategoryPlugin
    • canAccess

      public boolean canAccess(String spaceId, String username)
      Specified by:
      canAccess in interface io.meeds.social.category.plugin.CategoryPlugin
    • canEdit

      public boolean canEdit(String spaceId, String username)
      Specified by:
      canEdit in interface io.meeds.social.category.plugin.CategoryPlugin
    • getCategoryIds

      public List<Long> getCategoryIds()
      Specified by:
      getCategoryIds in interface io.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 incoming CategoryObject to 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 denormalized space.getCategoryIds() that is only kept in sync by CategoryLinkModifiedListener, whose SPACE branch resolves the space through spaceService.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:
      getObject in interface io.meeds.social.category.plugin.CategoryPlugin
      Parameters:
      categoryObject - The incoming CategoryObject whose id may be a space technical id, a social Identity id or a pretty name
      Returns:
      A CategoryObject carrying the canonical space technical id, or the object unchanged when the id cannot be resolved to a space