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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String
getClientType
(ExecutionContext context) Gets 1C:Enterprise client type fromExecutionContext
getLaunchUrl
(ExecutionContext context) Gets the launch (open) URL from execution contextprotected RuntimeExecutionArguments
getRuntimeExecutionArguments
(ExecutionContext context, InfobaseReference infobase) Gets 1C:Enterprise runtime client launch arguments by current execution context and infobaselaunchUrlClient
(IResolvableRuntimeInstallation installation, URL url, String clientType, RuntimeExecutionArguments arguments) 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.open
(IResolvableRuntimeInstallation resolvableInstallation, InfobaseReference infobase, ExecutionContext context) 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.protected final boolean
supportsPlatform
(IApplication application) Checks thatIApplication
provides special attribute with namePLATFORM_ATTRIBUTE
and valuePLATFORM_V8
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.e1c.g5.dt.applications.contributors.IApplicationClientDelegate
open, supports
-
Constructor Details
-
AbstractApplicationClientDelegate
public AbstractApplicationClientDelegate()
-
-
Method Details
-
supportsPlatform
Checks thatIApplication
provides special attribute with namePLATFORM_ATTRIBUTE
and valuePLATFORM_V8
- Parameters:
application
- checking application, cannot benull
- Returns:
true
if special attributePLATFORM_ATTRIBUTE
with correct valuePLATFORM_V8
found in application,false
otherwise
-
getClientType
Gets 1C:Enterprise client type fromExecutionContext
- Parameters:
context
- to get client type from, cannot benull
- Returns:
- 1C:Enterprise client type from
ExecutionContext
, nevernull
- Throws:
ApplicationException
- if there is noIApplication.CONTEXT_CLIENT_TYPE
property inExecutionContext
-
getLaunchUrl
Gets the launch (open) URL from execution context- Parameters:
context
- to get client type from, cannot benull
- Returns:
- the launch (open) URL from execution context, never
null
, but may be empty if url was not stored inExecutionContext
-
open
protected Optional<Process> open(IResolvableRuntimeInstallation resolvableInstallation, InfobaseReference infobase, ExecutionContext context) throws RuntimeExecutionException, ApplicationException 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 gettingILaunchableRuntimeComponent
, cannot benull
infobase
-InfobaseReference
for getting access settings and getting correctRuntimeInstallation
, cannot benull
context
- to get client type from, cannot benull
- Returns:
- a process handle of launched 1C:Enterprise client, never
null
- Throws:
ApplicationException
- if 1C:Enterprise runtime platform client cannot be runningRuntimeExecutionException
-
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 benull
infobase
-InfobaseReference
for getting access settings, if it isnull
defaultRuntimeExecutionArguments
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 gettingILaunchableRuntimeComponent
, cannot benull
url
- the web URL to launch client with, cannot benull
clientType
- components identifiers, cannot benull
arguments
- the execution arguments, can benull
, 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
-