Package io.meeds.gamification.plugin
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanAccess(io.meeds.portal.permlink.model.PermanentLinkObject object, org.exoplatform.services.security.Identity identity) Grants the redirection only to an identity that may view the program, asProgramService.canViewProgram(long, String)decides it.getDirectAccessUrl(io.meeds.portal.permlink.model.PermanentLinkObject object) Builds the program page path on the engagement site.voidinit()Registers this plugin in the portal'sPermanentLinkService.
-
Field Details
-
OBJECT_TYPE
- See Also:
-
URL_FORMAT
- See Also:
-
-
Constructor Details
-
ProgramPermanentLinkPlugin
public ProgramPermanentLinkPlugin()
-
-
Method Details
-
init
@PostConstruct public void init()Registers this plugin in the portal'sPermanentLinkService. -
getObjectType
- Specified by:
getObjectTypein interfaceio.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, asProgramService.canViewProgram(long, String)decides it.- Specified by:
canAccessin interfaceio.meeds.portal.permlink.plugin.PermanentLinkPlugin- Parameters:
object- the program reference, its object id being the program ididentity- 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:
getDirectAccessUrlin interfaceio.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
-