Class OfficeServerScriptService

  • All Implemented Interfaces:
    org.xwiki.script.service.ScriptService

    @Component
    @Named("officemanager")
    @Singleton
    public class OfficeServerScriptService
    extends Object
    implements org.xwiki.script.service.ScriptService
    Exposes the office manager APIs to server-side scripts.
    Since:
    4.1M1
    Version:
    $Id: 6af704e73ed6231f7d73e504c15575438c5647c4 $
    • Field Detail

      • OFFICE_MANAGER_ERROR

        public static final String OFFICE_MANAGER_ERROR
        The key used to place any error messages while trying to control the office server instance.
        See Also:
        Constant Field Values
    • Constructor Detail

      • OfficeServerScriptService

        public OfficeServerScriptService()
    • Method Detail

      • startServer

        public boolean startServer()
        Tries to start the office server process.
        Returns:
        true if the operation succeeds, false otherwise
      • stopServer

        public boolean stopServer()
        Tries to stop the office server process.
        Returns:
        true if the operation succeeds, false otherwise
      • isConnected

        public boolean isConnected()
        Determine if the server is connected. This method should be used as a check whenever to activate a feature that needs Office Server.
        Returns:
        true iff the server state is connected.
        Since:
        12.3, 11.10.5
      • displayServerState

        public String displayServerState()
        Display the translated state of the server. This should only be used in the administration to have a precise view on the state. For other usages, isConnected() should be used.
        Returns:
        a translated string describing the server state.
        Since:
        12.3, 11.10.5
      • getServerState

        @Deprecated
        public String getServerState()
        Deprecated.
        Since 12.3 this method shouldn't be used anymore: if the goal is to know if the server is connected or not, then isConnected() should be used instead. If the goal is to display the state of the server then displayServerState() should be used.
        Returns:
        current status of the office server process as a string
      • getLastErrorMessage

        public String getLastErrorMessage()
        Returns:
        any error messages encountered