@ApplicationScoped public class WopiAccessHandler extends Object
The wopi client endpoint can be set by the environment variable WOPI_PUBLIC_ENDPOINT
Optional a discoveryEndpoint (WOPI_DISCOVERY_ENDPOINT) can be set to resolve the WOPI Client endpoints dynamically. In most cases this is not necessary and a wopi.public.endpoint can be set.
The method cacheFileData and fetchFileData are used to store a modified file object temporarily into the wopi local file cache.
| Constructor and Description |
|---|
WopiAccessHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
cacheFileData(String accessToken,
org.imixs.workflow.FileData fileData)
This method caches a fileData temporarily into the servers filesystem.
|
void |
clearFileCache(String accessToken)
Deletes all existing files cached for a given token.
|
org.imixs.workflow.FileData |
fetchFileData(String accessToken,
String filename)
This method tries the fetch a file content from the local wopi file cache.
|
String |
generateAccessToken(String userid,
String username)
Generates a new access token
|
List<org.imixs.workflow.FileData> |
getAllFileData(String accessToken)
This method is called by the WopiController before a workitem is processed.
|
String |
getClientEndpointByFilename(String filename)
Returns a WOPI Client endpoint by a file extension
If wopi.public.endpoint is set than this endpoint will be returned.
|
String |
getClientEndpointByMimeType(String mimeType)
Returns a WOPI Client endpoint by a file mime type
If wopi.public.endpoint is set than this endpoint will be returned.
|
String |
purgeAccessToken(String access_token)
For some reason the LibreOffice Online adds additional query params starting
with '?'
|
javax.json.JsonObject |
validateAccessToken(String access_token)
Validates if a given access_token is still valid.
|
public void cacheFileData(String accessToken, org.imixs.workflow.FileData fileData) throws IOException
The method also deletes outdated cached files.
jsessionid - file - IOExceptionpublic org.imixs.workflow.FileData fetchFileData(String accessToken, String filename)
If no cached file data exits, the method returns null.
accessToken - IOExceptionpublic List<org.imixs.workflow.FileData> getAllFileData(String accessToken)
accessToken - public void clearFileCache(String accessToken)
accessToken - public String generateAccessToken(String userid, String username) throws org.imixs.jwt.JWTException
org.imixs.jwt.JWTExceptionpublic javax.json.JsonObject validateAccessToken(String access_token)
The method also clears the token form invalid query params. For some reasons Collabora sends additional query params starting with '?' which is not expected here!
In case the token is valid, the method returns the paylod, otherwise the method returns null.
access_token - public String purgeAccessToken(String access_token)
accesstoken - public String getClientEndpointByFilename(String filename)
If wopi.public.endpoint is set than this endpoint will be returned. If not the endpoint is resolved dynamically by the wopi.desovery.endpoint
ext - public String getClientEndpointByMimeType(String mimeType)
If wopi.public.endpoint is set than this endpoint will be returned. If not the endpoint is resolved dynamically by the wopi.desovery.endpoint
ext - Copyright © 2021 Imixs Software Solutions GmbH. All rights reserved.