Package org.imixs.workflow.wopi
Class WopiController
- java.lang.Object
-
- org.imixs.workflow.wopi.WopiController
-
- All Implemented Interfaces:
Serializable
@Named @ConversationScoped public class WopiController extends Object implements Serializable
The WopiController is a front end controller providing the access endpoint for a file.The controller expects the environment variable 'WOPI_HOST_ENDPOINT' with the internal URL the WopiClient can contact the WopiHostService
The controller also listens on the WorklfowEvent to update modified file content into the workItem before processing.
- Author:
- rsoika
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringITEM_WOPI_AUTO_OPENstatic StringWOPI_CONFIRM_CHANGES
-
Constructor Summary
Constructors Constructor Description WopiController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearAccessToken()Clears an existing access token.StringgetAccessToken()StringgetConfirmMessage()This helper method returns the confirm message string used in case the LibreOffice Online Editor is closed, but contains changes .StringgetWopiAccessURL(String uniqueid, String file, String userid, String username)Returns the access url for the wopi client.booleanisEnabled()Indicates if the wopi feature is enabledvoidonWorkflowEvent(org.imixs.workflow.faces.data.WorkflowEvent workflowEvent)This method transfers all cached file updates form the local wopi file cache into the current workitem, before the workitem is processed.
-
-
-
Field Detail
-
ITEM_WOPI_AUTO_OPEN
public static final String ITEM_WOPI_AUTO_OPEN
- See Also:
- Constant Field Values
-
WOPI_CONFIRM_CHANGES
public static final String WOPI_CONFIRM_CHANGES
- See Also:
- Constant Field Values
-
-
Method Detail
-
isEnabled
public boolean isEnabled()
Indicates if the wopi feature is enabled- Returns:
-
getAccessToken
public String getAccessToken()
-
clearAccessToken
public void clearAccessToken()
Clears an existing access token.
-
getWopiAccessURL
public String getWopiAccessURL(String uniqueid, String file, String userid, String username)
Returns the access url for the wopi client.The method creates an accessToken (JWT) including the username. https://localhost:9980/{libreoffice-editor}.html?WOPISrc=http://wopi-app:8080/api/wopi/files/{your-file}
-
onWorkflowEvent
public void onWorkflowEvent(@Observes org.imixs.workflow.faces.data.WorkflowEvent workflowEvent)This method transfers all cached file updates form the local wopi file cache into the current workitem, before the workitem is processed. The method also clears the file cache.To access the filedata object, the controller uses the access token
-
getConfirmMessage
public String getConfirmMessage()
This helper method returns the confirm message string used in case the LibreOffice Online Editor is closed, but contains changes .- Returns:
-
-