Package com.orchestranetworks.service

# Class ServiceContext

java.lang.Object
com.orchestranetworks.service.ServiceContext

All Implemented Interfaces:
  `UIResourceLocator`

@Deprecated public abstract class ServiceContext extends Object implements UIResourceLocator
Deprecated.
From release 6.0, this API is no longer supported. The new `UserService` API should be used instead.
This class provides the necessary context and navigation functions for integrating legacy user services.

Please refer to the current documentation on user services for more information.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `abstract void`
  `addMessage(UserMessage aMessage)`
  Deprecated.
  Adds a message regarding the validation of the form in the page.
  `abstract ProcedureResult`
  `execute(boolean addErrorMessageIfException, Procedure aProcedure)`
  Deprecated.
  Executes the specified procedure and calls its implementation of the method `Procedure.execute`.
  `abstract ProcedureResult`
  `execute(Procedure aProcedure)`
  Deprecated.
  Executes the specified procedure.
  `abstract Adaptation`
  `getCurrentAdaptation()`
  Deprecated.
  Returns the dataset or record currently selected in the user interface.
  `abstract HierarchyNode`
  `getCurrentHierarchyNode()`
  Deprecated.
  `abstract AdaptationHome`
  `getCurrentHome()`
  Deprecated.
  Returns the dataspace currently selected in the user interface.
  `abstract SchemaNode`
  `getCurrentNode()`
  Deprecated.
  Returns the data model node currently selected in the current Adaptation.
  `abstract Path`
  `getCurrentPathInAdaptation()`
  Deprecated.
  Returns the path of the node currently selected in the user interface.
  `abstract Request`
  `getCurrentRequest()`
  Deprecated.
  Returns the request corresponding to the current table view in the EBX® user interface, including the filters and sort criteria set on the view.
  `abstract Request`
  `getCurrentRequestOnHierarchyLeaves()`
  Deprecated.
  Returns the request over the records of the current hierarchy leaves.
  `abstract Request`
  `getCurrentRequestOnSelectedOccurrences()`
  Deprecated.
  Returns the request over the records currently selected in the EBX® user interface.
  `abstract SchemaNode`
  `getCurrentTable()`
  Deprecated.
  Returns the table node currently selected in EBX®.
  `abstract Locale`
  `getLocale()`
  Deprecated.
  Returns the current locale of the user interface session.
  `abstract String`
  `getModuleName()`
  Deprecated.
  Returns the name of the module that declares the service being executed.
  `abstract List<HierarchyNode>`
  `getSelectedHierarchyNodes()`
  Deprecated.
  Returns the nodes currently selected in a hierarchy.
  `abstract List<Adaptation>`
  `getSelectedOccurrences()`
  Deprecated.
  Returns the records currently selected in the user interface.
  `static final ServiceContext`
  `getServiceContext(HttpServletRequest aRequest)`
  Deprecated.
  Retrieves a context instance from HTTP request attributes.
  `abstract String`
  `getServiceDescription()`
  Deprecated.
  Returns the description of the service, localized for the session's current locale.
  `abstract ServiceKey`
  `getServiceKey()`
  Deprecated.
  Returns the key of the current service.
  `abstract String`
  `getServiceLabel()`
  Deprecated.
  Returns the label of the service, localized for the session's current locale.
  `abstract Session`
  `getSession()`
  Deprecated.
  Returns the current session context.
  `abstract UIServiceComponentWriter`
  `getUIComponentWriter()`
  Deprecated.
  This method can be used in a Servlet to get a component writer in order to add standard EBX® components.
  `abstract UIServiceComponentWriter`
  `getUIComponentWriterForJSP(JspWriter aJspWriter)`
  Deprecated.
  This method can be used in a JSP to get a component writer to add some integrated components.
  `abstract String`
  `getURLForEndingService()`
  Deprecated.
  Returns a user interface URL indicating that the execution of this service is finished.
  `abstract String`
  `getURLForEndingServiceInPopup()`
  Deprecated.
  Returns a user interface URL indicating that the execution of this service is finished.
  `abstract String`
  `getURLForForwardingToResource(String aResourcePath)`
  Deprecated.
  Returns a user interface URL forwarding this service execution to the specified resource.
  `abstract String`
  `getURLForIncludingResource(String aResourcePath)`
  Deprecated.
  Returns a user interface URL indicating that this service execution continues to the resource specified.
  `abstract String`
  `getURLForServiceSelection(AdaptationHome aHome, Adaptation aRecordOrInstance, SchemaNode aNode, ServiceKey aServiceKey)`
  Deprecated.
  Returns a user interface URL that selects the specified node in the given record or dataset and starts the specified service on it, in the context of the given `AdaptationHome`.
  `abstract String`
  `getURLForServiceSelection(AdaptationHome aHome, Adaptation aRecordOrInstance, ServiceKey aServiceKey)`
  Deprecated.
  Returns a user interface URL that selects the specified record or dataset and starts the specified service on it, in the context of the given `AdaptationHome`.
  `abstract String`
  `getURLForServiceSelection(AdaptationHome aHome, ServiceKey aServiceKey)`
  Deprecated.
  Returns a user interface URL that selects the specified dataspace and starts the specified service on it.
  `abstract String`
  `getURLForServiceSelection(Adaptation aRecordOrInstance, SchemaNode aNode, ServiceKey aServiceKey)`
  Deprecated.
  Returns a user interface URL which selects the specified node in the given record or dataset and starts the specified service on it.
  `abstract String`
  `getURLForServiceSelection(Adaptation aRecordOrInstance, ServiceKey aServiceKey)`
  Deprecated.
  Returns a user interface URL which selects the specified record or dataset and starts the specified service on it.
  `abstract String`
  `getURLForServiceSelection(ServiceKey aServiceKey)`
  Deprecated.
  Returns a user interface URL to start the specified service.
  `abstract List<SchemaNode>`
  `getViewedSchemaNodes()`
  Deprecated.
  Returns the nodes (or "columns" from a user perspective) that are currently displayed by the tabular view.
  `abstract boolean`
  `isCalledOnHierarchyNode()`
  Deprecated.
  `abstract boolean`
  `isCalledOnHome()`
  Deprecated.
  Returns `true` if the current service is called from a dataspace or snapshot menu.
  `abstract boolean`
  `isCalledOnInstance()`
  Deprecated.
  Returns `true` if the current service is called from a dataset menu.
  `abstract boolean`
  `isCalledOnOccurrencePage()`
  Deprecated.
  Returns `true` if the current service is called from a record page.
  `abstract boolean`
  `isCalledOnTable()`
  Deprecated.
  Returns `true` if the current service is called on the whole table view.
  `abstract boolean`
  `isCalledOnTableSelection()`
  Deprecated.
  Returns `true` if the current service is called on the selected records of the view.
  `final void`
  `setContextSensitiveHelpURL(String aURL)`
  Deprecated.
  Enables the context-sensitive help button in the header of the workspace.
  `final void`
  `setTitle(UserMessage aMessage)`
  Deprecated.
  Replaces the default title of the user service in the header of the workspace.

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface com.orchestranetworks.ui.UIResourceLocator

  `createWebComponentForRootSession, createWebComponentForSubSession, getURLForAjaxComponent, getURLForAjaxComponent, getURLForPerspectiveSelection, getURLForPerspectiveSelection, getURLForResource, getURLForResource, getURLForResource, getURLForResource, getURLForResource, getURLForRest, getURLForSelection, getURLForSelection, getURLForSelection, getURLForSelection, getURLForSelection, getURLForSelection, getURLForViewSelection`

- ## Method Details

  - ### getServiceContext

    public static final ServiceContext getServiceContext(HttpServletRequest aRequest)
    Deprecated.
    Retrieves a context instance from HTTP request attributes. This method will not return `null` while in the context of a service execution (this means that the user interface is performing a server-side include).

  - ### execute

    public abstract ProcedureResult execute(Procedure aProcedure)
    Deprecated.
    Executes the specified procedure.

    This method is equivalent to:

    > `ServiceContext.execute(true, aProcedure);`

    See Also:
      - `execute(boolean, Procedure)`

  - ### execute

    public abstract ProcedureResult execute(boolean addErrorMessageIfException, Procedure aProcedure)
    Deprecated.
    Executes the specified procedure and calls its implementation of the method `Procedure.execute`.
    Parameters:
      `addErrorMessageIfException` - specifies whether the user interface automatically reports an error message whenever the execution has encountered an error.
      `aProcedure` - the procedure to be executed.
    Returns:
      the result of the execution (particularly, whether it has thrown an exception).
    Since:
      5.2.1

  - ### getCurrentHome

    public abstract AdaptationHome getCurrentHome()
    Deprecated.
    Returns the dataspace currently selected in the user interface.

  - ### getCurrentAdaptation

    public abstract Adaptation getCurrentAdaptation()
    Deprecated.
    Returns the dataset or record currently selected in the user interface.

    This method returns a dataset if:

    - the current service is running from a dataset menu (see `isCalledOnInstance()` );
    - the current service is running on a whole table, from "Services on table" menu category (see `isCalledOnTable()` );
    - the current service is running on a table selection, from "Services on selected records" menu category, and more than one record is selected (see `isCalledOnTableSelection()` ).

    This method returns a record if:

    - the current service is running on a table selection and exactly one record is selected (see `isCalledOnTableSelection()`);
    - the current service is running on a page record (see `isCalledOnOccurrencePage()`);
    - the current service is running on a hierarchy node (see `isCalledOnHierarchyNode()`).
    Throws:
      `IllegalStateException` - if the current service is running on a dataspace or snapshot (see `isCalledOnHome()` ).
    See Also:
      - `getSelectedOccurrences()`

  - ### getCurrentRequest

    public abstract Request getCurrentRequest()
    Deprecated.
    Returns the request corresponding to the current table view in the EBX® user interface, including the filters and sort criteria set on the view. Returns `null` if this service is called outside a table context.

    If this service is invoked in a hierarchy view, returns the request on the target table. Filters are not applied (except record-level permission rules, if any).

    See Also:
      - `isCalledOnTable()`

  - ### getCurrentRequestOnSelectedOccurrences

    public abstract Request getCurrentRequestOnSelectedOccurrences()
    Deprecated.
    Returns the request over the records currently selected in the EBX® user interface. Returns `null` if this service is called outside the context of a table.

    If no records are selected, the returned request will have an empty result.

    See Also:
      - `isCalledOnTableSelection()`

  - ### getCurrentRequestOnHierarchyLeaves

    public abstract Request getCurrentRequestOnHierarchyLeaves()
    Deprecated.
    Returns the request over the records of the current hierarchy leaves. Returns `null` if this service is called outside the context of a hierarchy.
    Since:
      5.8.0
    See Also:
      - `isCalledOnTable()`

  - ### getSelectedOccurrences

    public abstract List<Adaptation> getSelectedOccurrences() throws UnsupportedOperationException
    Deprecated.
    Returns the records currently selected in the user interface.
    Returns:
      a List of `Adaptation` that correspond to the records selected in the user interface, or an empty list if the service is being executed on a data set or from the contextual menu of a hierarchy node.
    Throws:
      `UnsupportedOperationException` - if too many records are specified; the limit is specified by the property `ebx.view.restrictSelectionsOnLargeLists.threshold`. If large volumes of data are involved, it is recommended to use the method `getCurrentRequestOnSelectedOccurrences()` instead.
    See Also:
      - `getCurrentRequestOnSelectedOccurrences()`

  - ### getViewedSchemaNodes

    public abstract List<SchemaNode> getViewedSchemaNodes()
    Deprecated.
    Returns the nodes (or "columns" from a user perspective) that are currently displayed by the tabular view.

    Returns `null` if this service is called outside a table view or if no specific filtering has been applied to columns.

    See Also:
      - `isCalledOnTable()`
      - `ExportSpec.setRequestSchemaNodes(List)`

  - ### getCurrentNode

    public abstract SchemaNode getCurrentNode()
    Deprecated.
    Returns the data model node currently selected in the current Adaptation. If called on a table records selection, this method always returns the current table node.
    Throws:
      `IllegalStateException` - if the current service is running on a dataspace or snapshot (see `isCalledOnHome()` ).
    See Also:
      - `getCurrentAdaptation()`

  - ### getCurrentTable

    public abstract SchemaNode getCurrentTable()
    Deprecated.
    Returns the table node currently selected in EBX®. In a hierarchy view, this is the target table.
    Throws:
      `IllegalStateException` - if the current service is running outside a table context.
    Since:
      5.6.0

  - ### getCurrentHierarchyNode

    public abstract HierarchyNode getCurrentHierarchyNode()
    Deprecated.

  - ### getSelectedHierarchyNodes

    public abstract List<HierarchyNode> getSelectedHierarchyNodes()
    Deprecated.
    Returns the nodes currently selected in a hierarchy.
    Returns:
      List of `HierarchyNode` that corresponds to the nodes selected in the user interface displayed hierarchy. Returns `null` if the current service is not called in the context of a hierarchy.

  - ### getCurrentPathInAdaptation

    public abstract Path getCurrentPathInAdaptation()
    Deprecated.
    Returns the path of the node currently selected in the user interface.
    Throws:
      `IllegalStateException` - if the current service is running on a dataspace or on a snapshot (see `isCalledOnHome()` ).

  - ### getLocale

    public abstract Locale getLocale()
    Deprecated.
    Returns the current locale of the user interface session.
    See Also:
      - `Session.getLocale()`

  - ### getSession

    public abstract Session getSession()
    Deprecated.
    Returns the current session context.

  - ### getServiceLabel

    public abstract String getServiceLabel()
    Deprecated.
    Returns the label of the service, localized for the session's current locale.

    The label of the service is specified in the data model, under the node `xs:annotation/xs:documentation`.

    See Also:
      - `setTitle(UserMessage)`

  - ### getServiceKey

    public abstract ServiceKey getServiceKey()
    Deprecated.
    Returns the key of the current service.
    Since:
      5.4.1
    See Also:
      - `ServiceKey`

  - ### getServiceDescription

    public abstract String getServiceDescription()
    Deprecated.
    Returns the description of the service, localized for the session's current locale.

    The description of the service is specified in the data model, under the node `xs:annotation/xs:documentation`.

  - ### addMessage

    public abstract void addMessage(UserMessage aMessage)
    Deprecated.
    Adds a message regarding the validation of the form in the page. This message will be displayed in the standard message pane of the user interface.

  - ### setContextSensitiveHelpURL

    public final void setContextSensitiveHelpURL(String aURL)
    Deprecated.
    Enables the context-sensitive help button in the header of the workspace.

    Clicking on the button displays the help pop-up with the target URL.

    The simple help button can also be placed anywhere with `UIComponentWriter.addButtonHelp(String)`.

    Parameters:
      `aURL` - the URL of the pop-up content.
    Since:
      5.2.3

  - ### setTitle

    public final void setTitle(UserMessage aMessage)
    Deprecated.
    Replaces the default title of the user service in the header of the workspace.
    Parameters:
      `aMessage` - the text of the title.
    Since:
      5.2.3

  - ### getURLForIncludingResource

    public abstract String getURLForIncludingResource(String aResourcePath)
    Deprecated.
    Returns a user interface URL indicating that this service execution continues to the resource specified.

    The resource must be in the same web application as the service.

    Parameters:
      `aResourcePath` - path of the resource in its web application (it must not contain the web application's specific path).
    See Also:
      - `UIResourceLocator`

  - ### getURLForForwardingToResource

    public abstract String getURLForForwardingToResource(String aResourcePath)
    Deprecated.
    Returns a user interface URL forwarding this service execution to the specified resource.

    The resource must be in the same web application as the service.

    Parameters:
      `aResourcePath` - absolute path of the resource in its web application (it must not contain the web application's specific path, and must start with '/').
    Since:
      5.5.0
    See Also:
      - `UIResourceLocator`

  - ### getURLForEndingService

    public abstract String getURLForEndingService()
    Deprecated.
    Returns a user interface URL indicating that the execution of this service is finished.
    See Also:
      - `UIResourceLocator`

  - ### getURLForEndingServiceInPopup

    public abstract String getURLForEndingServiceInPopup()
    Deprecated.
    Returns a user interface URL indicating that the execution of this service is finished. After closing the service, the pop-up in which it was displayed is closed automatically. The service must have been called using a preview button, displaying it in an inner pop-up. This method must not be called to close a service in the main window.
    Since:
      5.4.1
    See Also:
      - `UIResourceLocator`
      - `getURLForEndingService()`
      - `UIComponentWriter.buildButtonPreview(String)`
      - `UIComponentWriter.buildButtonPreview(String, UserMessage)`
      - `UIHttpManagerComponent.setCloseButtonSpec(com.orchestranetworks.ui.UIHttpManagerComponent.CloseButtonSpec)`

  - ### getURLForServiceSelection

    public abstract String getURLForServiceSelection(ServiceKey aServiceKey)
    Deprecated.
    Returns a user interface URL to start the specified service. When the URL is accessed, the service will be launched on the current content, unless this service automatically selects its own target content (for example, `ServiceKey.WORKFLOW`).
    Throws:
      `IllegalArgumentException` - if the built-in service is not supported by this method; this is the case for `MASSDELETE`, `COMPARE`, and `CLOSE`.
    Since:
      5.4.3
    See Also:
      - `UIResourceLocator`

  - ### getURLForServiceSelection

    public abstract String getURLForServiceSelection(Adaptation aRecordOrInstance, ServiceKey aServiceKey)
    Deprecated.
    Returns a user interface URL which selects the specified record or dataset and starts the specified service on it.
    Throws:
      `IllegalArgumentException` - if the built-in service is not supported by this method; this is the case for `MASSDELETE`, `COMPARE`, and `CLOSE`.
    Since:
      5.3.0
    See Also:
      - `UIResourceLocator`

  - ### getURLForServiceSelection

    public abstract String getURLForServiceSelection(AdaptationHome aHome, ServiceKey aServiceKey)
    Deprecated.
    Returns a user interface URL that selects the specified dataspace and starts the specified service on it.
    Throws:
      `IllegalArgumentException` - if the built-in service is not supported by this method; this is the case for `MASSDELETE`, `COMPARE`, and `CLOSE`.
    Since:
      5.4.2
    See Also:
      - `UIResourceLocator`

  - ### getURLForServiceSelection

    public abstract String getURLForServiceSelection(AdaptationHome aHome, Adaptation aRecordOrInstance, ServiceKey aServiceKey)
    Deprecated.
    Returns a user interface URL that selects the specified record or dataset and starts the specified service on it, in the context of the given `AdaptationHome`.
    Throws:
      `IllegalArgumentException` - if the built-in service is not supported by this method; this is the case for `MASSDELETE`, `COMPARE`, and `CLOSE`.
    Since:
      5.4.2
    See Also:
      - `UIResourceLocator`

  - ### getURLForServiceSelection

    public abstract String getURLForServiceSelection(Adaptation aRecordOrInstance, SchemaNode aNode, ServiceKey aServiceKey)
    Deprecated.
    Returns a user interface URL which selects the specified node in the given record or dataset and starts the specified service on it.
    Throws:
      `IllegalArgumentException` - if the built-in service is not supported by this method; this is the case for `MASSDELETE`, `COMPARE`, and `CLOSE`.
    Since:
      5.3.1
    See Also:
      - `UIResourceLocator`

  - ### getURLForServiceSelection

    public abstract String getURLForServiceSelection(AdaptationHome aHome, Adaptation aRecordOrInstance, SchemaNode aNode, ServiceKey aServiceKey)
    Deprecated.
    Returns a user interface URL that selects the specified node in the given record or dataset and starts the specified service on it, in the context of the given `AdaptationHome`.
    Throws:
      `IllegalArgumentException` - if the built-in service is not supported by this method; this is the case for `MASSDELETE`, `COMPARE`, and `CLOSE`.
    Since:
      5.4.2
    See Also:
      - `UIResourceLocator`

  - ### isCalledOnHome

    public abstract boolean isCalledOnHome()
    Deprecated.
    Returns `true` if the current service is called from a dataspace or snapshot menu.
    See Also:
      - `getCurrentHome()`

  - ### isCalledOnInstance

    public abstract boolean isCalledOnInstance()
    Deprecated.
    Returns `true` if the current service is called from a dataset menu.
    See Also:
      - `getCurrentAdaptation()`

  - ### isCalledOnTable

    public abstract boolean isCalledOnTable()
    Deprecated.
    Returns `true` if the current service is called on the whole table view.

    In this case, it is expected that the service will be applied to the whole view or to the filtered view. It is obtained by calling the method `getCurrentRequest()`.

    See Also:
      - `getCurrentRequest()`

  - ### isCalledOnHierarchyNode

    public abstract boolean isCalledOnHierarchyNode()
    Deprecated.

  - ### isCalledOnTableSelection

    public abstract boolean isCalledOnTableSelection()
    Deprecated.
    Returns `true` if the current service is called on the selected records of the view.

    In this case, it is expected that the service be applied to the selected records. They are obtained by calling the method `getSelectedOccurrences()`.

    See Also:
      - `getSelectedOccurrences()`

  - ### isCalledOnOccurrencePage

    public abstract boolean isCalledOnOccurrencePage()
    Deprecated.
    Returns `true` if the current service is called from a record page.

    In this case, it is expected that the service will be applied to the current record. It is obtained by calling the method `getCurrentAdaptation()`.

    See Also:
      - `getCurrentAdaptation()`

  - ### getUIComponentWriter

    public abstract UIServiceComponentWriter getUIComponentWriter()
    Deprecated.
    This method can be used in a Servlet to get a component writer in order to add standard EBX® components.

    Attention: This getter must not be called from a JSP. Use `getUIComponentWriterForJSP(JspWriter)` instead.

    Since:
      5.2.0

  - ### getUIComponentWriterForJSP

    public abstract UIServiceComponentWriter getUIComponentWriterForJSP(JspWriter aJspWriter)
    Deprecated.
    This method can be used in a JSP to get a component writer to add some integrated components.

    Attention: This method must be called by only one JSP page. In the case of `jsp:include`, this method must not be called from the initial page and the target page at the same time.

    Parameters:
      `aJspWriter` - the `out` buffer used to write HTML
    Since:
      5.2.0

  - ### getModuleName

    public abstract String getModuleName()
    Deprecated.
    Returns the name of the module that declares the service being executed.
    Since:
      5.2.3