Class TranslationPlugin
java.lang.Object
org.exoplatform.container.component.BaseComponentPlugin
io.meeds.social.translation.plugin.TranslationPlugin
- All Implemented Interfaces:
org.exoplatform.container.component.ComponentPlugin
public abstract class TranslationPlugin
extends org.exoplatform.container.component.BaseComponentPlugin
A plugin that will be used by
TranslationService to check the edit
and access permission of fields translations-
Field Summary
Fields inherited from class org.exoplatform.container.component.BaseComponentPlugin
desc, name -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract longgetAudienceId(String objectId) Retrieves the identity Id of the target audience for which the translations will be accessibleabstract Stringabstract longgetSpaceId(String objectId) Retrieves the Space Id of the target space for which the translations will be accessibleabstract booleanhasAccessPermission(String objectId, String username) Checks whether the user can access to an objectabstract booleanhasEditPermission(String objectId, String username) Checks whether the user can edit an objectMethods inherited from class org.exoplatform.container.component.BaseComponentPlugin
getDescription, getName, setDescription, setName
-
Constructor Details
-
TranslationPlugin
public TranslationPlugin()
-
-
Method Details
-
getObjectType
- Returns:
- object types that plugin handles
-
hasAccessPermission
public abstract boolean hasAccessPermission(String objectId, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException Checks whether the user can access to an object- Parameters:
objectId- object technical unique identifierusername- user name- Returns:
- true if the user can access to an object, else false.
- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- thrown when the object doesn't exists
-
hasEditPermission
public abstract boolean hasEditPermission(String objectId, String username) throws org.exoplatform.commons.exception.ObjectNotFoundException Checks whether the user can edit an object- Parameters:
objectId- object technical unique identifierusername- user name- Returns:
- true if the user can edit an object, else false.
- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- thrown when the object doesn't exists
-
getAudienceId
public abstract long getAudienceId(String objectId) throws org.exoplatform.commons.exception.ObjectNotFoundException Retrieves the identity Id of the target audience for which the translations will be accessible- Parameters:
objectId- Object Identifier- Returns:
IdentityId as long- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- thrown when the object doesn't exists
-
getSpaceId
public abstract long getSpaceId(String objectId) throws org.exoplatform.commons.exception.ObjectNotFoundException Retrieves the Space Id of the target space for which the translations will be accessible- Parameters:
objectId- Object Identifier- Returns:
SpaceId as long- Throws:
org.exoplatform.commons.exception.ObjectNotFoundException- thrown when the object doesn't exists
-