Class ProgramPermanentLinkPlugin

java.lang.Object
io.meeds.gamification.plugin.ProgramPermanentLinkPlugin
All Implemented Interfaces:
io.meeds.portal.permlink.plugin.PermanentLinkPlugin

@Component public class ProgramPermanentLinkPlugin extends Object implements io.meeds.portal.permlink.plugin.PermanentLinkPlugin
Permanent link plugin of a gamification program: it resolves a program id into the program page of the engagement site, the page the platform's own program chips open (eXo.env.portal.engagementSiteName is the meta portal, as UserPortalConfigService.getMetaPortal() returns it).
  • Field Details

  • Constructor Details

    • ProgramPermanentLinkPlugin

      public ProgramPermanentLinkPlugin()
  • Method Details

    • init

      @PostConstruct public void init()
      Registers this plugin in the portal's PermanentLinkService.
    • getObjectType

      public String getObjectType()
      Specified by:
      getObjectType in interface io.meeds.portal.permlink.plugin.PermanentLinkPlugin
      Returns:
      OBJECT_TYPE
    • canAccess

      public boolean canAccess(io.meeds.portal.permlink.model.PermanentLinkObject object, org.exoplatform.services.security.Identity identity) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Grants the redirection only to an identity that may view the program, as ProgramService.canViewProgram(long, String) decides it.
      Specified by:
      canAccess in interface io.meeds.portal.permlink.plugin.PermanentLinkPlugin
      Parameters:
      object - the program reference, its object id being the program id
      identity - the identity following the link, null when unknown
      Returns:
      true when the identity may view the program
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException - when the object id is not a program id
    • getDirectAccessUrl

      public String getDirectAccessUrl(io.meeds.portal.permlink.model.PermanentLinkObject object) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Builds the program page path on the engagement site.
      Specified by:
      getDirectAccessUrl in interface io.meeds.portal.permlink.plugin.PermanentLinkPlugin
      Parameters:
      object - the program reference, its object id being the program id
      Returns:
      the program page path, without the domain
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException - when the object id is not a program id