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:
  • Field Details

  • Constructor Details

    • WopiController

      public WopiController()
  • Method Details

    • 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: