Class OnlyOfficeManager
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.plugins.workspaces.documents.onlyoffice.OnlyOfficeManager
-
- All Implemented Interfaces:
LogEnabled,Component,Serviceable
public class OnlyOfficeManager extends AbstractLogEnabled implements Component, Serviceable
Main helper for OnlyOffice edition
-
-
Field Summary
Fields Modifier and Type Field Description protected CurrentUserProvider_currentUserProviderThe current user providerprotected OnlyOfficeKeyManager_onlyOfficeKeyManagerThe Only Office key managerprotected AmetysObjectResolver_resolverThe Ametys object resolverprotected AuthenticationTokenManager_tokenManagerThe token managerstatic StringROLEThe Avalon role
-
Constructor Summary
Constructors Constructor Description OnlyOfficeManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgenerateToken(String fileId)Generate a token for OnlyOffice useMap<String,Object>getOnlyOfficeInfo(String resourceId)Get the needed information for Only Office editionbooleanisOnlyOfficeEditionAvailable()Determines if OnlyOffice edition is availablevoidservice(ServiceManager manager)Map<String,Object>signConfiguration(String toSign)Sign a json configuration for OnlyOffice using a secret parametrized key-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
_tokenManager
protected AuthenticationTokenManager _tokenManager
The token manager
-
_currentUserProvider
protected CurrentUserProvider _currentUserProvider
The current user provider
-
_resolver
protected AmetysObjectResolver _resolver
The Ametys object resolver
-
_onlyOfficeKeyManager
protected OnlyOfficeKeyManager _onlyOfficeKeyManager
The Only Office key manager
-
-
Constructor Detail
-
OnlyOfficeManager
public OnlyOfficeManager()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
isOnlyOfficeEditionAvailable
public boolean isOnlyOfficeEditionAvailable()
Determines if OnlyOffice edition is available- Returns:
- true if OnlyOffice edition is available
-
getOnlyOfficeInfo
public Map<String,Object> getOnlyOfficeInfo(String resourceId)
Get the needed information for Only Office edition- Parameters:
resourceId- the id of resource to edit- Returns:
- the only office informations
-
generateToken
public String generateToken(String fileId)
Generate a token for OnlyOffice use- Parameters:
fileId- id of the resource that will be used by OnlyOffice- Returns:
- the token
-
signConfiguration
public Map<String,Object> signConfiguration(String toSign)
Sign a json configuration for OnlyOffice using a secret parametrized key- Parameters:
toSign- The json to sign- Returns:
- The signed json
-
-