Interface PublishUtils


  • @ProviderType
    public interface PublishUtils
    Utility to help viewers create urls pointing to production publish dc's Created by agangam on 7/21/14.
    • Method Detail

      • getPublishNodeURL

        java.lang.String getPublishNodeURL​(Resource resource)
                                    throws RepositoryException
        Retrieve the publish node URL from the replication agent. NOTE: This URL does not include the context path of the publish node!
        Parameters:
        resource - Resource for an asset
        Returns:
        Publish root path
        Throws:
        RepositoryException - when an error occurs interacting with the repository
      • externalizeImageDeliveryAsset

        @Deprecated
        java.lang.String externalizeImageDeliveryAsset​(Resource resource,
                                                       java.lang.String assetPath)
                                                throws RepositoryException
        Externalize an asset reference to a image delivery URL. Will resolve to the Image Delivery cloud service if configured, otherwise it will resolve to the publish node.
        Parameters:
        resource - Resource for an asset
        assetPath - Path to the asset in the JCR
        Returns:
        Image Serving Delivery URL
        Throws:
        RepositoryException - when an error occurs interacting with the repository
      • externalizeImageDeliveryAsset

        java.lang.String[] externalizeImageDeliveryAsset​(Resource resource)
                                                  throws RepositoryException
        Externalize an asset reference to a image delivery URL. Will resolve to the Image Delivery cloud service if configured, otherwise it will resolve to the publish node.
        Parameters:
        resource - Resource for an asset
        Returns:
        The image server url and the image path
        Throws:
        RepositoryException - when an error occurs interacting with the repository
      • externalizeImageDeliveryUrl

        java.lang.String externalizeImageDeliveryUrl​(Resource resource,
                                                     java.lang.String url)
                                              throws RepositoryException
        Externalize an image delivery URL The input url can be a relative path (e.g [/ctx]/is/image/[url]) or an absolute url (e.g. http://[host]:[port]/[ctx]/is/image/[url]). The method will direct the url to the Image Delivery cloud service if configured, if no Image Delivery cloud service is configured the passed url will be returned back.
        Parameters:
        resource - Resource for an asset
        url - Image Delivery URL
        Returns:
        Externalized Image Serving Delivery URL or url if Image Delivery cloud service is not configured.
        Throws:
        RepositoryException - when an error occurs interacting with the repository
      • getISProperty

        java.lang.String getISProperty​(java.lang.String tenantId,
                                       java.lang.String property)
        Get Image Server settings
        Parameters:
        tenantId - blank or the tenantId
        property - to be fetched from values
        Returns:
        property requested or an empty string