Package com.arbortext.epic.io
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 TypeMethodDescriptionEstablishes a new CMS session.Specifies a list of prefixes used by the adapter-specific Logical IDs and Persistent Object Identifiers (POIDs).getUserData(String key) Retrieves application data from the adapter.booleanhasFeature(String feature) Indicates whether the adapter implements a specified feature.voidEnables theAdapterto initialize structures needed by every session.voidsetUserData(String key, String data) Stores application data on the adapter.voidShuts 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 theIOSession.ownsLogicalIDmethod 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
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 returningtruefor this feature.
- Parameters:
feature- Specifies the name of the feature.- Returns:
- Returns
trueif the feature is supported. Returnsfalseif it is not supported.
-
-
initialize
Enables theAdapterto 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
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
Establishes a new CMS session. The session should store theIOHostinterface for later use. ThatIOHostis specific to the new session and cannot be used by other sessions.- Parameters:
loginId- Specifies the CMS user name.password- Specifies the password for theloginIdparameter.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
Retrieves application data from the adapter. This method enables user interface or application code to retrieve named data that was previously stored through thesetUserDatamethod.- Parameters:
key- Specifies the unique key used to identify the data.- Returns:
- Specifies the data associated with the given key, or
nullif there is none.
-
setUserData
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 thegetUserDatamethod. 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, ornullto remove any existing data for the key.
-