Interface IPublicationManager


  • public interface IPublicationManager
    Web servers publication management service. Service supports only operations with publications.

    To manage 1C:Enterprise runtime web extension component publishing clients may use IRuntimeComponentManager and IPublishExecutor.

    • Method Detail

      • publish

        void publish​(Publication publication,
                     WebServer webServer)
              throws WebServerAccessException
        Publish the given publication instance on the given web server. Publications can configure the web server ability to work with 1C:Enterprise web clients, mobile devices, etc.

        Publication process depends on the publication type and may be various.

        Parameters:
        publication - the publication instance to publish, cannot be null
        webServer - the web server to publish the given publication instance to, cannot be null
        webExtensions - the path to registered 1C:Enterprise runtime web component, or null if component publishing is not needed
        Throws:
        WebServerAccessException - if publication process fails with some reason
      • update

        void update​(Publication publication,
                    String name,
                    WebServer webServer)
             throws WebServerAccessException
        Edit the given publication on the server. Searches publication by the given name in the target web server. Does nothing, if publication not found. Overwrite old publication properties with new values from the given publication.

        Publication process depends on the publication type and may be various.

        Parameters:
        publication - the publication instance to overwrite found publication with, cannot be null
        name - of publication to edit, cannot be null or empty
        webServer - the web server to edit the given publication instance in, cannot be null
        webExtensions - the path to registered 1C:Enterprise runtime web component, or null if component publishing is not needed
        Throws:
        WebServerAccessException - if publication process fails with some reason
      • get

        Publication get​(WebServer webServer,
                        String name)
                 throws WebServerAccessException
        Returns publication with given name from given web server.
        Parameters:
        webServer - the web server to get publication on, cannot be null
        name - of publication to get, cannot be null
        Returns:
        found publication with given name, or null if publication not found
        Throws:
        WebServerAccessException - request fails
      • remove

        boolean remove​(WebServer webServer,
                       Publication publication)
                throws WebServerAccessException
        Removes publication with given name from given web server. Returns whether specified publication was actually removed.

        Note, that actual publication content will not be deleted, but only removed from web server configuration.

        Parameters:
        webServer - the web server to remove publication from, cannot be null
        publication - to remove, cannot be null, publication must contain non-null and non-empty name and location values
        Returns:
        whether if an element was removed as a result of this call
        Throws:
        WebServerAccessException - if removing fails
      • contains

        boolean contains​(WebServer webServer,
                         Publication publication)
                  throws WebServerAccessException
        Checks existence of a publication instance in the given web server.
        Parameters:
        webServer - the web server to check publication existence on, cannot be null
        publication - to check for the existence in the web-server, cannot be null
        Returns:
        whether the given publication exists on the target web server
        Throws:
        WebServerAccessException - if request fails
      • getDefaultPublicationLocation

        Path getDefaultPublicationLocation​(WebServer webServer)
        Returns default location for the new publications for the given web server. The default publication location is a folder, that can contain sub-folders with publications. Can return null, if not defined or web server does not support default publication location.
        Parameters:
        webServer - the web server to get default publication location for, cannot be null
        Returns:
        default location for the new publications for the given web server or null, if not defined
      • getWebExtension

        Path getWebExtension​(Publication publication,
                             WebServer webServer)
                      throws WebServerAccessException
        Returns path to the registered 1C:Enterprise runtime or null if no 1C:Enterprise runtime web extension component was registered. However returned web extension may not be correctly configured and clients need to check whether web extension is configured.
        Parameters:
        webServer - the web server to get default publication location for, cannot be null
        Returns:
        default location for the new publications for the given web server or null, if not defined
        Throws:
        WebServerAccessException
      • isWebExtensionConfigured

        boolean isWebExtensionConfigured​(Publication publication,
                                         Path webExtension,
                                         WebServer webServer)
                                  throws WebServerAccessException
        Returns whether the provided 1C:Enterprise runtime web extension component is correctly configured for the web server publication. If false is returned then re-publish is required for this publication with this web extension for correct work.
        Parameters:
        publication - the publication to check, cannot be null
        webExtension - path to the 1C:Enterprise runtime web extension component, cannot be null
        webServer - the web server to check, cannot be null
        Returns:
        whether the provided 1C:Enterprise runtime web extension component is correctly configured for the web server publication
        Throws:
        WebServerAccessException - if request fails
      • getPublicationUrl

        String getPublicationUrl​(WebServer webServer,
                                 String name)
                          throws WebServerAccessException
        Returns URL of the publication by the provided publication name in the web server instance.
        Parameters:
        webServer - the web server to get URL for web server, cannot be null
        name - the name of publication, cannot be null or empty
        Returns:
        the URL of publication, never null
        Throws:
        WebServerAccessException - if request fails
      • isPublishSupported

        boolean isPublishSupported​(WebServer webServer,
                                   PublicationType type)
        Check support of publish process on the given web server instance.
        Parameters:
        webServer - the web server to check publish support for, cannot be null
        type - the publication type to check, cannot be null
        Returns:
        true if web server supports publishing with the given publication type, false otherwise
      • addPublicationChangeListener

        void addPublicationChangeListener​(IPublicationChangeListener publicationChangeListener)
        Add Publications change listener to service. Listener will be notified on publications changes.

        Causes no effect if given listener is already registered.

        Parameters:
        publicationChangeListener - publications change listener to add, cannot be null
        See Also:
        IPublicationChangeListener
      • removePublicationChangeListener

        void removePublicationChangeListener​(IPublicationChangeListener publicationChangeListener)
        Remove Publications listener from service. Listener will no longer be notified on publications changes changes.
        Parameters:
        publicationChangeListener - publications change listener to remove, cannot be null
        See Also:
        IPublicationChangeListener