Package org.ametys.plugins.workspaces
Class WorkspacesHelper
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.workspaces.WorkspacesHelper
- All Implemented Interfaces:
LogEnabled
,Component
,Contextualizable
,Serviceable
public class WorkspacesHelper
extends AbstractLogEnabled
implements Component, Serviceable, Contextualizable
Utility classes for workspaces
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
contextualize
(Context context) getAvatar
(UserIdentity userIdentity, String lang, int size) Get user avatargetFileType
(String filename) Get the file type of a resource from its namegetFileType
(Resource file) Get the file type of a resource fileboolean
Determines if the resource file is an imagevoid
service
(ServiceManager smanager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
Avalon role
-
-
Constructor Details
-
WorkspacesHelper
public WorkspacesHelper()
-
-
Method Details
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
isImage
Determines if the resource file is an image- Parameters:
file
- the resource- Returns:
- true if the resource file is an image
-
getFileType
Get the file type of a resource file- Parameters:
file
- the resource- Returns:
- the
WorkspacesHelper.FileType
-
getFileType
Get the file type of a resource from its name- Parameters:
filename
- the resource's name- Returns:
- the
WorkspacesHelper.FileType
-
getAvatar
Get user avatar- Parameters:
userIdentity
- the user identitylang
- the lang for user's contentsize
- the size in pixel of image- Returns:
- the avatar url
-