Class AcrolinxEndpoint

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class AcrolinxEndpoint
    extends java.lang.Object
    implements java.io.Closeable
    • Constructor Detail

      • AcrolinxEndpoint

        public AcrolinxEndpoint​(java.net.URI acrolinxURL,
                                java.lang.String signature,
                                java.lang.String clientVersion,
                                java.lang.String clientLocale)
        Parameters:
        acrolinxURL - URL to your Acrolinx Platform for example: https://yourcompany.acrolinx.com
        signature - License to use integration with Acrolinx.
        clientVersion - Version number of your Acrolinx Integration for example: 1.2.5.34
        clientLocale - Locale of environment in which the integration is deployed.
      • AcrolinxEndpoint

        public AcrolinxEndpoint​(java.net.URI sdkAcrolinxURL,
                                java.net.URI userFacingAcrolinxURL,
                                java.lang.String signature,
                                java.lang.String clientVersion,
                                java.lang.String clientLocale)
        Use this constructor in case the URL that is returned to the user have to differ to the URL the integration connects to.

        Examples:

        • An SSO-proxy is used to access the Scorecard and the Content Analysis dashboard, but the SDK in an automated environment isn't able to use the same route. https://yourcompany.myintegration.com/proxy/ vs. https://yourcompany.acrolinx.com.
        • An integration can connect directly to the Acrolinx Platform using an internal URL, where a user has to access it using an external URL. http://localhost:8031 vs. https://yourcompany.acrolinx.com.
        Parameters:
        sdkAcrolinxURL - URL to your Acrolinx Platform for example: https://yourcompany.acrolinx.com
        userFacingAcrolinxURL - URL to your Acrolinx Platform that is returned to the user: https://yourcompany.myintegration.com/proxy/
        signature - License to use integration with Acrolinx.
        clientVersion - Version number of your Acrolinx Integration for example: 1.2.5.34
        clientLocale - Locale of environment in which the integration is deployed.
      • AcrolinxEndpoint

        public AcrolinxEndpoint​(AcrolinxHttpClient acrolinxHttpClient,
                                java.net.URI acrolinxUri,
                                java.lang.String signature,
                                java.lang.String clientVersion,
                                java.lang.String clientLocale)
        Parameters:
        acrolinxHttpClient - Provide your own http Acrolinx Integration implementing AcrolinxHttpClient interface
        acrolinxUri - URL to your Acrolinx Platform for example: https://yourcompany.acrolinx.com
        signature - License to use integration with Acrolinx.
        clientVersion - Version number of your Acrolinx Integration for example: 1.2.5.37
        clientLocale - Locale of environment in which the integration is deployed.
    • Method Detail

      • close

        public void close()
                   throws java.io.IOException
        Close Endpoint after use.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException
      • signInWithSSO

        public SignInSuccess signInWithSSO​(java.lang.String genericToken,
                                           java.lang.String username)
                                    throws AcrolinxException
        Single sign-on
        Parameters:
        genericToken - Generic SSO token configured on your Acrolinx Platform.
        username - User who wants to authenticate
        Returns:
        SignInSuccess holds the access token that is required to initiate check
        Throws:
        AcrolinxException
      • signInInteractive

        public SignInSuccess signInInteractive​(InteractiveCallback interactiveCallback)
                                        throws AcrolinxException,
                                               java.lang.InterruptedException
        An interactive sign-in where user can open a URL in a browser to sign in.
        Parameters:
        interactiveCallback - Provide a method that can be called to open sign-in link in the browser.
        Returns:
        SignInSuccess holds the access token that is required to initiate check
        Throws:
        AcrolinxException
        java.lang.InterruptedException
      • signInInteractive

        public SignInSuccess signInInteractive​(InteractiveCallback interactiveCallback,
                                               AccessToken accessToken,
                                               long timeoutInMillis)
                                        throws AcrolinxException,
                                               java.lang.InterruptedException
        An interactive sign-in where user can open URL in a browser to sign in.
        Parameters:
        interactiveCallback - Provide a method that can be called to open sign-in link in the browser.
        accessToken - Provide an already available access to check its validity
        timeoutInMillis - Provide timeout in milliseconds
        Returns:
        SignInSuccess holds the access token that is required to initiate check
        Throws:
        AcrolinxException
        java.lang.InterruptedException
      • getCapabilities

        public Capabilities getCapabilities​(AccessToken accessToken)
                                     throws AcrolinxException
        Get check capabilities of the Platform
        Parameters:
        accessToken - Provide access token obtained from Sign-in Success Response or Acrolinx dashboard
        Returns:
        Checking capabilities available for Platform
        Throws:
        AcrolinxException
      • submitCheck

        public CheckResponse submitCheck​(AccessToken accessToken,
                                         CheckRequest checkRequest)
                                  throws AcrolinxException
        Submit a check request
        Parameters:
        accessToken - Provide access token obtained from Sign-in Success Response or Acrolinx dashboard.
        checkRequest - Use CheckRequestBuilder to simplify building check request.
        Returns:
        Check response contains the URL to fetch check result.
        Throws:
        AcrolinxException
      • getContentAnalysisDashboard

        public java.lang.String getContentAnalysisDashboard​(AccessToken accessToken,
                                                            java.lang.String batchId)
                                                     throws AcrolinxException
        Get URL to Content Analysis dashboard
        Parameters:
        accessToken - Provide access token obtained from Sign-in Success Response or Acrolinx dashboard
        batchId - Provide a batch Id submitted for performing a check
        Returns:
        String contains URL to Content Analysis dashboard.
        Throws:
        AcrolinxException
      • check

        public CheckResult check​(AccessToken accessToken,
                                 CheckRequest checkRequest,
                                 ProgressListener progressListener)
                          throws AcrolinxException
        Submits a check and waits until result is obtained.
        Parameters:
        accessToken - Provide access token obtained from Sign-in Success Response or Acrolinx dashboard
        checkRequest - Use CheckRequestBuilder to simplify building check request.
        progressListener - Provides statistical information about check progress
        Returns:
        Acrolinx Scorecard for the checked content.
        Throws:
        AcrolinxException
      • isDocumentTypeCheckable

        public boolean isDocumentTypeCheckable​(java.lang.String documentType,
                                               AccessToken accessToken)
                                        throws AcrolinxException
        Check if document you wish to check is supported by Platform
        Parameters:
        documentType - Type of your document for example: .xml, .md, .dita
        accessToken - Provide access token obtained from Sign-in Success Response or Acrolinx dashboard
        Returns:
        true if document type is checkable and false if not.
        Throws:
        AcrolinxException