Interface IWebServerPublishDelegate
-
- All Known Subinterfaces:
IWebServerManageDelegate
- All Known Implementing Classes:
ApachePublishDelegate
,ApachePublishDelegateLinux
,ApachePublishDelegateMock
,ApachePublishDelegateWin32
,IisPublishDelegate
public interface IWebServerPublishDelegate
Describes the basic operations to publish infobase or mobile application and configure a web server. A web server publish delegate extension is defined inplugin.xml
.Following is an example definition of a web server publish delegate extension:
<extension point="com._1c.g5.v8.dt.platform.services.core.webServerPublishDelegates"> <delegate class="com.example.ExamplePublishDelegateClass"> <supportedWebServerType webServerType="com.example.ExampleIdentifier"> </supportedWebServerType> <supportedRuntime runtime="com._1c.g5.v8.dt.platform.runtime.8.3.8"> </supportedRuntime> </delegate> </extension>
Defined web server publish delegates are automatically used for described web server type and 1C:Enterprise runtime publishing. Publication process depends on the
publication type
and may be various. Delegates are intended to support all types of publications.Clients may also implement
IWebServerManageDelegate
extension if they want target web server to be started and stopped with DT IDE launch and shutdown.This interface is intended to be implemented and registered by clients. Instances are not intended to be explicitly used by client. Clients may use
IPublicationManager
orIPublishExecutor
instead.- See Also:
IWebServerType
,PublicationType
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
contains(WebServer webServer, Publication publication)
Checks existence of a publication instance in the given web server.Publication
get(WebServer webServer, String name)
Returns a publication with the given name from the given web server.Collection<Publication>
getAll(WebServer webServer)
Returns all registered on the given web server publications.Path
getDefaultPublicationLocation(WebServer webServer)
Returns default location for the new publications for the given web server.URL
getPublicationUrl(WebServer webServer, String name)
ReturnsURL
of the publication by the provided publication name in the web server instance.Path
getWebExtension(Publication publication, WebServer webServer)
Returns path to the registered 1C:Enterprise runtime ornull
if no 1C:Enterprise runtime web extension component was registered.boolean
isPublishSupported(WebServer webServer, PublicationType type)
Check support of publish process on the given web server instance.boolean
isWebExtensionConfigured(Publication publication, Path webExtension, WebServer webServer)
Returns whether the provided 1C:Enterprise runtime web extension component is correctly configured for the web server publication.void
publish(Publication publication, WebServer webServer, Path webExtension)
Publish the given publication instance on the given web server.boolean
remove(WebServer webServer, Publication publication)
Removes publication with given name from given web server.boolean
restart(WebServer webServer)
Restart the target web server.void
update(Publication publication, String name, WebServer webServer, Path webExtension)
Edit the given publication on the server.
-
-
-
Method Detail
-
publish
void publish(Publication publication, WebServer webServer, Path webExtension) 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.Also can register the given 1C:Enterprise runtime web extension component on the given web server. Note, that some publication types does not support working without 1C:Enterprise runtime web extension component registration.
- Parameters:
publication
- the publication instance to publish, cannot benull
webServer
- the web server to publish the given publication instance to, cannot benull
webExtension
- the path to 1C:Enterprise runtime web component, ornull
if component publishing is not needed- Throws:
WebServerAccessException
- if publication process fails with some reason
-
update
void update(Publication publication, String name, WebServer webServer, Path webExtension) 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.Also can register the given 1C:Enterprise runtime web extension component on the given web server. Note, that some publication types does not support working without 1C:Enterprise runtime web extension component registration.
- Parameters:
publication
- the publication instance to overwrite found publication with, cannot benull
name
- of publication to edit, cannot benull
or emptywebServer
- the web server to edit the given publication instance in, cannot benull
webExtension
- the path to registered 1C:Enterprise runtime web component, ornull
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 a publication with the given name from the given web server.- Parameters:
webServer
- the web server to get publication on, cannot benull
name
- of publication to get, cannot benull
- Returns:
- found publication with given name, or
null
if publication not found - Throws:
WebServerAccessException
- request fails
-
getAll
Collection<Publication> getAll(WebServer webServer) throws WebServerAccessException
Returns all registered on the given web server publications.- Parameters:
webServer
- web server to get publications for, cannot benull
- Returns:
- list of all registered on the given web server publications, never
null
- Throws:
WebServerAccessException
- request 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 benull
publication
- to check for the existence in the web server, cannot benull
- Returns:
- whether the given publication exists on the target web server
- Throws:
WebServerAccessException
- if 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 benull
publication
- to remove, cannot benull
, 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
-
getWebExtension
Path getWebExtension(Publication publication, WebServer webServer) throws WebServerAccessException
Returns path to the registered 1C:Enterprise runtime ornull
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 extensionis configured
.- Parameters:
webServer
- the web server to get default publication location for, cannot benull
- 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. Iffalse
is returned then re-publish is required for this publication with this web extension for correct work.- Parameters:
publication
- the publication to check, cannot benull
webExtension
- path to the 1C:Enterprise runtime web extension component, cannot benull
webServer
- the web server to check, cannot benull
- Returns:
- whether the provided 1C:Enterprise runtime web extension component is correctly configured for the web server publication
- 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 returnnull
, if not defined or web server does not support default publication location.- Parameters:
webServer
- the web server to get default publication location for, cannot benull
- Returns:
- default location for the new publications for the given web server or
null
, if not defined
-
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 benull
type
- the publication type to check, cannot benull
- Returns:
true
if web server supports publishing with the given publication type,false
otherwise
-
restart
boolean restart(WebServer webServer) throws WebServerAccessException
Restart the target web server.Returns whether web server was successfully restarted. If delegate does not support restarting, it can return
false
immediately in method implementation.- Returns:
- whether the web server was successfully restarted
- Throws:
WebServerAccessException
- if request fails
-
getPublicationUrl
URL getPublicationUrl(WebServer webServer, String name) throws WebServerAccessException
ReturnsURL
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 benull
name
- the name of publication, cannot benull
or empty- Returns:
- the URL of publication, never
null
- Throws:
WebServerAccessException
- if request fails
-
-