Class NoteSpaceScopeResolver

java.lang.Object
io.meeds.notes.mcp.NoteSpaceScopeResolver
All Implemented Interfaces:
io.meeds.mcp.server.plugin.SpaceScopeResolver

@Service("noteSpaceScopeResolver") @Profile("mcp-server") public class NoteSpaceScopeResolver extends Object implements io.meeds.mcp.server.plugin.SpaceScopeResolver
Tells which space a note belongs to, for the space scope of the notes tools: the space whose group owns the notebook the note is in. A note of a personal (user) or portal notebook, a notebook owned by a group outside the spaces, a space that no longer exists, a missing note and an id that isn't one belong to no space. Read as the system, for the space scope decision only.
  • Field Details

  • Constructor Details

    • NoteSpaceScopeResolver

      public NoteSpaceScopeResolver()
  • Method Details

    • getName

      public String getName()
      Specified by:
      getName in interface io.meeds.mcp.server.plugin.SpaceScopeResolver
      Returns:
      "note"
    • spaceOf

      public Long spaceOf(String objectId)
      Specified by:
      spaceOf in interface io.meeds.mcp.server.plugin.SpaceScopeResolver
      Parameters:
      objectId - the note id
      Returns:
      the id of the space whose notebook holds the note, or null for a note of a personal or portal notebook, a missing note or space, an id that isn't one, or a lookup that fails
    • spaceOfNote

      public static Long spaceOfNote(Page note, org.exoplatform.social.core.space.spi.SpaceService spaceService)
      Tells the space a note belongs to, by the same rule as spaceOf(String), for a caller that already holds the note.
      Parameters:
      note - the note, null for a missing one
      spaceService - reads the space of a group
      Returns:
      the id of the space whose notebook holds the note, or null for a missing note, a note of a personal or portal notebook, or a space that no longer exists