Class AbstractApplicationClientDelegate

java.lang.Object
com.e1c.g5.dt.applications.ui.contributors.AbstractApplicationClientDelegate
All Implemented Interfaces:
IApplicationClientDelegate
Direct Known Subclasses:
InfobaseApplicationClientDelegate, ServerApplicationClientDelegate

public abstract class AbstractApplicationClientDelegate extends Object implements IApplicationClientDelegate
Abstract implementation of IApplicationClientDelegate provides common logic for running a 1C:Enterprise runtime platform client by IApplication
  • Constructor Details

    • AbstractApplicationClientDelegate

      public AbstractApplicationClientDelegate()
  • Method Details

    • supportsPlatform

      protected final boolean supportsPlatform(IApplication application)
      Checks that IApplication provides special attribute with name PLATFORM_ATTRIBUTE and value PLATFORM_V8
      Parameters:
      application - checking application, cannot be null
      Returns:
      true if special attribute PLATFORM_ATTRIBUTE with correct value PLATFORM_V8 found in application, false otherwise
    • getClientType

      protected String getClientType(ExecutionContext context) throws ApplicationException
      Gets 1C:Enterprise client type from ExecutionContext
      Parameters:
      context - to get client type from, cannot be null
      Returns:
      1C:Enterprise client type from ExecutionContext, never null
      Throws:
      ApplicationException - if there is no IApplication.CONTEXT_CLIENT_TYPE property in ExecutionContext
    • getLaunchUrl

      protected Optional<URL> getLaunchUrl(ExecutionContext context)
      Gets the launch (open) URL from execution context
      Parameters:
      context - to get client type from, cannot be null
      Returns:
      the launch (open) URL from execution context, never null, but may be empty if url was not stored in ExecutionContext
    • open

      Runs a 1C:Enterprise runtime platform client on the given infobase using the provided 1C:Enterprise runtime installation wrapper, that can be resolved to the real installation at any time. Returns the started process.
      Parameters:
      resolvableInstallation - actual 1C:Enterprise runtime installation for getting ILaunchableRuntimeComponent, cannot be null
      infobase - InfobaseReference for getting access settings and getting correct RuntimeInstallation, cannot be null
      context - to get client type from, cannot be null
      Returns:
      a process handle of launched 1C:Enterprise client, never null
      Throws:
      ApplicationException - if 1C:Enterprise runtime platform client cannot be running
      RuntimeExecutionException
    • getRuntimeExecutionArguments

      protected RuntimeExecutionArguments getRuntimeExecutionArguments(ExecutionContext context, InfobaseReference infobase) throws ApplicationException
      Gets 1C:Enterprise runtime client launch arguments by current execution context and infobase
      Parameters:
      context - to get client type from, cannot be null
      infobase - InfobaseReference for getting access settings, if it is null default RuntimeExecutionArguments will be created
      Returns:
      1C:Enterprise runtime client launch arguments by current execution context and infobase, never null
      Throws:
      ApplicationException - if error was occurred while getting access setting from infobase
    • launchUrlClient

      protected Optional<Process> launchUrlClient(IResolvableRuntimeInstallation installation, URL url, String clientType, RuntimeExecutionArguments arguments) throws ApplicationException
      Launches (opens) the provided URL as 1C:Enterprise runtime client. 1C:Enterprise runtime client component can be used if executor implementation needs component for execution. Returns the started process or none if started process cannot be obtained (e.g. browser opening).
      Parameters:
      installation - actual 1C:Enterprise runtime installation for getting ILaunchableRuntimeComponent, cannot be null
      url - the web URL to launch client with, cannot be null
      clientType - components identifiers, cannot be null
      arguments - the execution arguments, can be null, then will not be used
      Returns:
      the optional handle of the started process or none if started process cannot be obtained (e.g. browser opening)
      Throws:
      ApplicationException - if 1C:Enterprise runtime process execution fails