Interface IOAdapter


public interface IOAdapter
The IOAdapter interface represents an installed content management system (CMS) adapter. Each configured CMS adapter will have one associated IOAdapter object.
Since:
Epic 5.2
  • Method Summary

    Modifier and Type
    Method
    Description
    connect(String loginId, String password, String cmsId, IOHost host)
    Establishes a new CMS session.
    Specifies a list of prefixes used by the adapter-specific Logical IDs and Persistent Object Identifiers (POIDs).
    Retrieves application data from the adapter.
    boolean
    hasFeature(String feature)
    Indicates whether the adapter implements a specified feature.
    void
    Enables the Adapter to initialize structures needed by every session.
    void
    Stores application data on the adapter.
    void
    Shuts down the adapter and frees all resources.
  • Method Details

    • getLogicalIdPrefixes

      StringList getLogicalIdPrefixes()
      Specifies a list of prefixes used by the adapter-specific Logical IDs and Persistent Object Identifiers (POIDs). For example, an adapter's Logical ID might start with "http://". This attribute helps determine whether a particular Logical ID or POID is associated with an adapter. Multiple adapters can have the same Logical ID prefix. PTC Arbortext Editor and PTC Arbortext Publishing Engine calls the IOSession.ownsLogicalID method for each CMS session that has a Logical ID prefix matching a prefix in the list.For this release, PTC Arbortext Editor and PTC Arbortext Publishing Engine only use the first Logical ID prefix. The Logical ID syntax chosen by an implementation must avoid using the following characters: # % &
    • hasFeature

      boolean hasFeature(String feature)
      Indicates whether the adapter implements a specified feature.
      The following features are defined:
      • SiblingsAreDistinctObjectsThis feature controls how the application treats the insertion of references to child objects.If this feature is on then the application will ensure that the reference (e.g. file-entity, xinclude) is stored outside of any sibling object. Thus each child object is entirely distinct from its sibling objects.If this feature is off then the application may, under some circumstances, insert the reference inside of a checked-out child object. Such a child object would then consist of its original content followed by a reference (e.g. file-entity, xinclude) to some other object.It is recommended that the implementation turn this feature on by returning true for this feature.
      Parameters:
      feature - Specifies the name of the feature.
      Returns:
      Returns true if the feature is supported. Returns false if it is not supported.
    • initialize

      void initialize() throws IOException
      Enables the Adapter to initialize structures needed by every session. This method is called once, when the adapter is loaded by PTC Arbortext Editor or PTC Arbortext Publishing Engine.
      Throws:
      IOException - CANT_INIT_ERR: Raised if initialization fails.
    • terminate

      void terminate() throws IOException
      Shuts down the adapter and frees all resources. This method is called once, immediately before the adapter is unloaded during the PTC Arbortext Editor or PTC Arbortext Publishing Engine shutdown process. While you can force an adapter with no open sessions to be unloaded using the sess_terminate() ACL function, you should not use sess_terminate() directly.
      Throws:
      IOException - STILL_CONNECTED_ERR: Raised if any sessions are still connected.
    • connect

      IOSession connect(String loginId, String password, String cmsId, IOHost host) throws IOException
      Establishes a new CMS session. The session should store the IOHost interface for later use. That IOHost is specific to the new session and cannot be used by other sessions.
      Parameters:
      loginId - Specifies the CMS user name.
      password - Specifies the password for the loginId parameter.
      cmsId - Specifies the CMS-specific identifier for the repository domain, library, docbase, and so forth.
      host - Specifies the interface for the session to access Editor functionality.
      Returns:
      A new CMS session.
      Throws:
      IOException - INVALID_CREDENTIALS_ERR: Raised if the login ID or password is not valid for the CMS. CANT_CONNECT_ERR: Raised if there is a problem connecting to the CMS.
    • getUserData

      String getUserData(String key)
      Retrieves application data from the adapter. This method enables user interface or application code to retrieve named data that was previously stored through the setUserData method.
      Parameters:
      key - Specifies the unique key used to identify the data.
      Returns:
      Specifies the data associated with the given key, or null if there is none.
    • setUserData

      void setUserData(String key, String data)
      Stores application data on the adapter. Any existing data for the same key is replaced by the new data. This method enables user interface or application code to associate named data with the adapter, which can be retrieved later by calling the getUserData method. User data only exists in memory and is not stored persistently.
      Another use of this may be to allow the adapter to accept additional arguments to methods. The adapter documentation must fully document such additional arguments.
      Here is hypothetical application developer code sample using this technique:

      // The adapter supports an additional argument called "role"
      // for the connect() method.
      adapter.setUserData("role", "guest");
      CMSSession session = adapter.connect("username", "password", "server");

      It is expected that the adapter implementation will check for additional arguments and then clear them out of the user-data map before returning (on success or failure). This relieves the application developer from having to perform this cleanup and avoids the possibility of unintended side-effects on subsequent method calls. The adapter documentation should also describe this behavior (for the benefit of the application developer).
      Parameters:
      key - Specifies the unique key used to identify the data.
      data - Specifies the data to associate with the given key, or null to remove any existing data for the key.