|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.di.connector.Connector
com.ibm.di.connector.sapr3.bor.SapR3BorConnector
public final class SapR3BorConnector
The SAP R/3 Business Object Repository Connector. Version %sapborcn.release.version% Build %sapborcn.release.build.version%.
The connector enables external applications, using TDI, to access BOR objects
in SAP R/3. It supports the following TDI Connector Modes: Add Only,
Delete, Update, Iterator, Lookup. The connector supports design time schema query
via querySchema(java.lang.Object)
.
A note about ABAP errors and warnings
The connector invokes BAPI/RFC functions in SAP to perform the connector mode operations. In some
cases, data passed to the BAPI/RFC functions from the XML input, may result in ABAP data validation
failures. The BAPI/RFC functions return the results of validation checks in the "RETURN" parameter
of the RFC.
The connector has been desingned to make the RFC return status available to the Assembly Line. The
connector does not interpret, or translate, ABAP errors or warnings into thrown exceptions. The
connector registers a script bean named "borcAbapErrorCache". The bean is registered for all connector
modes and can be accessed in connector hooks. The bean is an instance of AbapErrorCache
.
Script code in a connector hook can use this information to perform contingency actions as required.
The cache is reset before the execution of each connector method. Example script code is
shown below:
var errs = borcAbapErrorCache.getLastErrorSet();
if (errs.size() > 0) {
  task.logmsg("********** There were ABAP Errors *********");
  for (var i = 0; i < errs.size(); ++i) {
   var errInfo = errs.get(i);
   task.logmsg("The message is: " + errInfo.getMsg());
   task.logmsg("The message number is: " + errInfo.getMsgNum().toString());
  }
}
var warns = borcAbapErrorCache.getLastWarningSet();
if (warns.size() > 0) {
  task.logmsg("********** There were ABAP Warnings *********");
  for (var i = 0; i < warns.size(); ++i) {
   var errInfo = warns.get(i);
   task.logmsg("The message is: " + errInfo.getMsg());
   task.logmsg("The message number is: " + errInfo.getMsgNum().toString());
  }
}
A given SAP entry is represented as XML by the connector, and is set as the value of the connector attribute named "sapXml". The value of this attribute is always an XML string. Its XSchema is defined in the user guide for the connector. The format of the XML may be altered by modifying the XSL style sheets that are configured for the connector.
The configuration parameters of the connector are described below. The runtime
parameters appear within braces ():
R3 Client (client)
SAP R/3 Logon client for R/3 connection (for example, 100). This is passed directly
to the Tivoli Directory Integrator SAP R/3 RFC Function Component.
R3 User (user)
SAP R/3 Logon user for R/3 connection. This is passed directly to the Tivoli
Directory Integrator SAP R/3 RFC Function Component.
Password (passwd)
SAP R/3 Logon password for R/3 connection. This is passed directly to the Tivoli
Directory Integrator SAP R/3 RFC Function Component.
R3 System Number (sysnr)
The SAP R/3 system number for R/3 connection (for example, 100). This is passed
directly to the Tivoli Directory Integrator SAP R/3 RFC Function Component.
R3 Hostname (ashost)
SAP R/3 application server name for R/3 connection. This is passed directly to the
Tivoli Directory Integrator SAP R/3 RFC Function Component.
Gateway host (gwhost)
Gateway host name for R/3 connection. This is passed directly to the Tivoli
Directory Integrator SAP R/3 RFC Function Component.
RFC Trace (trace)
Set to one (1) to enable RFC API tracing. If enabled, the SAP RFC API will produce
separate rfc_nnnn.trc files in the working directory of Tivoli Directory Integrator. This
option may be useful to help diagnose RFC invocation problems. It logs the activity and
data between the Connector and SAP R/3. This should be set to zero (0) for production deployment.
BOR Class Name (sapr3.conn.borObjName)
The name of the BOR class that this connector will be integrating. The names of BOR classes are
available using transaction BAPI in SAP R/3. This value is used to obtain the keyfield names
of the BOR object when a schema query is performed.
RFC Function Component Name (sapr3.conn.rfcFC)
The name of the RFC Function Component registered with Tivoli Directory Integrator. This
option should be changed only on the advice of IBM support. The default
value is: ibmdi.SapR3RfcFC
Add Mode StyleSheets (sapr3.conn.putStylesheets)
The list of XSLT style sheets files to be executed by the Connector when deployed
in Add Only mode. Each XSLT file must be separated by a new line within the text box.
At runtime, each style sheet is applied to the XML contained within the Container Entry.
The XSL will be applied to the value of the attribute named sapXml. This configuration
parameter should be changed only at the direction of IBM support.
Modify Mode StyleSheets (sapr3.conn.modifyStylesheets)
The list of XSLT style sheets files to be executed by the Connector when deployed in
Modify mode. Each XSLT file must be separated by a new line within the text box. At runtime,
each style sheet is applied to the XML contained within the Container Entry. The XSL will be
applied to the value of the attribute named sapXml. This configuration parameter should
be changed only at the direction of IBM support.
Delete Mode StyleSheets (sapr3.conn.deleteStylesheets)
The list of XSLT style sheets files to be executed by the Connector when deployed in
Delete mode. Each XSLT file must be separated by a new line within the text box. At
runtime, each style sheet is applied to the XML contained within the Container Entry. The
XSL will be applied to the value of the attribute named sapXml. This configuration
parameter should be changed only at the direction of IBM support.
Lookup Mode Pre StyleSheet (sapr3.conn.findPreStylesheet)
The XSLT style sheet file to be executed by the Connector when creating an RFC XML request
able to obtain all user attributes for a given user. This configuration value must be set
when the Connector is deployed in Update, Delete, and Lookup modes. This configuration parameter
should be changed only at the direction of IBM support.
Lookup Mode Post StyleSheet (sapr3.conn.findPostStylesheet)
The XSLT style sheet file to be executed by the Connector when creating the user XML
formatted response from the Connector. This configuration value must be set when the
Connector is deployed in Update, Delete, and Lookup modes. The XSLT transforms the response
XML from the RFC executed as a result of the XSLT from Lookup Mode Pre StyleSheet
configuration. This configuration parameter should be changed only at the direction of
IBM support.
Select Entries Pre StyleSheet (sapr3.conn.selectEntriesPreStylesheet)
The XSLT style sheet file to be executed by the Connector when creating an RFC XML
request able to obtain all user names from SAP. This configuration value must be set
when the Connector is deployed in Iterator mode. This configuration parameter should be
changed only at the direction of IBM support.
Select Entries Post StyleSheet (sapr3.conn.selectEntriesPostStylesheet)
The XSLT style sheet file to be executed by the Connector when creating the user XML
for the getNextEntry() processing. This configuration value must be set when the Connector
is deployed in Iterator mode. The XSLT transforms the response XML from the RFC executed
as a result of the XSLT from Select Entries Pre StyleSheet configuration. This configuration
parameter should be changed only at the direction of IBM support.
Iterator Mode Pre StyleSheet (sapr3.conn.getNextPreStylesheet)
The XSLT style sheet file to be executed by the Connector when creating an RFC XML request
able to obtain all user attributes for a given user. This configuration value must be set
when the Connector is deployed in Iterator mode. This configuration parameter should be changed
only at the direction of IBM support.
Iterator Mode Post StyleSheet (sapr3.conn.getNextPostStylesheet)
The XSLT style sheet file to be executed by the Connector when creating the user XML
formatted response from the Connector. This configuration value must be set when the
Connector is deployed in Iterator mode. The XSLT transforms the response XML from the
RFC executed as a result of the XSLT from Iterator Mode Pre StyleSheet configuration. This
configuration parameter should be changed only at the direction of IBM support.
For a description of Add Only mode requirements, see putEntry(com.ibm.di.entry.Entry)
.
For a description of Update mode requirements, see modEntry(com.ibm.di.entry.Entry, com.ibm.di.server.SearchCriteria)
.
For a description of Delete mode requirements, see deleteEntry(com.ibm.di.entry.Entry, com.ibm.di.server.SearchCriteria)
.
For a description of Lookup mode requirements, see findEntry(com.ibm.di.server.SearchCriteria)
.
For a description of Iterator mode requirements, see getNextEntry()
and selectEntries()
.
Field Summary |
---|
Fields inherited from class com.ibm.di.connector.Connector |
---|
ALL_MODES, myLog, PROPERTY_MESSAGE, PROPERTY_READER, PROPERTY_WRITER |
Constructor Summary | |
---|---|
SapR3BorConnector()
Construct the Connector. |
Method Summary | |
---|---|
void |
deleteEntry(Entry entry,
SearchCriteria search)
Called by TDI AL to remove an existing user and associated attributes from SAP R/3 |
Entry |
findEntry(SearchCriteria search)
Called by TDI AL to find an existing BOR object instance and associated attributes in SAP R/3. |
List |
getLastErrorSet()
Allows the caller to obtain a list of ABAP errors that might have occured during the execution of any supported Connector method. |
List |
getLastWarningSet()
Allows the caller to obtain a list of ABAP warnings that might have occured during the execution of any supported Connecotor method. |
Entry |
getNextEntry()
This method is called to retrieve the next entry from the connector. |
String |
getVersion()
Get the version string. |
void |
initialize(Object o)
This method is called once after the connector configuration file has been provided by the caller. |
void |
modEntry(Entry entry,
SearchCriteria search)
Called by TDI AL to update an existing user and associated attributes in SAP R/3 |
void |
putEntry(Entry entry)
Called by TDI AL to add a new entry and associated attributes to SAP R/3. |
Object |
querySchema(Object source)
Return the TDI Entry schema supported by this connector. |
void |
registerScriptBeans(ScriptEngine se)
This method is called to register specific objects in the script context. |
void |
selectEntries()
Called by TDI AL when the connector operates in Iterator mode inside an assembly line. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.ibm.di.connector.ConnectorInterface |
---|
getConfiguration, getContext, getFindEntryCount, getFirstFindEntry, getMaxDuplicateEntries, getName, getNextClient, getNextFindEntry, getParam, getPushbackEntry, getRawConnectorConfiguration, isDeltaSupported, isExceptionFatal, isIOException, modEntry, pushback, queryOperations, queryReply, reconnect, replyEntry, setConfiguration, setContext, setCurrent, setLog, setMaxDuplicateEntries, setName, setParam, setRSInterface, terminate, terminateServer |
Constructor Detail |
---|
public SapR3BorConnector()
Method Detail |
---|
public List getLastWarningSet()
getLastWarningSet
in interface AbapErrorCache
public List getLastErrorSet()
getLastErrorSet
in interface AbapErrorCache
public void registerScriptBeans(ScriptEngine se) throws Exception
Connector
registerScriptBeans
in interface ConnectorInterface
registerScriptBeans
in class Connector
se
- The script engine context
Exception
public void initialize(Object o) throws SapR3ConnectorException, ConfigurationException
initialize
in interface ConnectorInterface
initialize
in class Connector
o
- TDI config object. Not used.
SapR3ConnectorException
- When an error happens during
super class init.
ConfigurationException
- if SAP connection parameters are invalid
or XSL files are invalid.public Object querySchema(Object source) throws SapR3ConnectorException
Return the TDI Entry schema supported by this connector. The connector supports one native attribute named "sapXml". sapXml is an XML string representing the attributes of a BOR object to be operated on.
Other attributes reflect the given BOR object keyfield names . A typical example of extra attributes would be the specification of BOR object key fields. They are supported to allow the definition of TDI "LinkCriteria" when the connector is deployed in Lookup, Delete, or Update modes.
querySchema
in interface ConnectorInterface
querySchema
in class Connector
source
- not used.
SapR3ConnectorException
- If an error occurs.Entry
,
Vector
public void putEntry(Entry entry) throws ConnectorMethodException, SapR3ConnectorException
putEntry
in interface ConnectorInterface
putEntry
in class Connector
entry
- The AL connector entry input. This connector must have an attribute
named "sapXml". Its value must be an XML string conforming to the SAP XML Schema.
The XML is transformed by the XSL style sheets into mulitple RFC requests that
altimately create the entry in SAP R/3.SapR3ConnectorException
- If the attribute is missing from the entry.
ConnectorMethodException
- if the SAP network call fails, or an XSL
transform error occurs.Connector.putEntry(com.ibm.di.entry.Entry)
public void deleteEntry(Entry entry, SearchCriteria search) throws ConnectorMethodException, SapR3ConnectorException
deleteEntry
in interface ConnectorInterface
deleteEntry
in class Connector
entry
- The AL connector entry input. This connector must have an attribute
named "sapXml". Its value must be an XML string conforming to the SAP
XML Schema supported by the configured XSL style sheets.search
- Passed through to XSL style sheet as an XSL param. Typically, the search
criteria include the keyfields of the given BOR object to be deleted.
SapR3ConnectorException
- If the attribute is missing from the entry.
ConnectorMethodException
- if the SAP network call fails, or an XSL
transform error occurs.Connector.deleteEntry(com.ibm.di.entry.Entry, com.ibm.di.server.SearchCriteria)
public void modEntry(Entry entry, SearchCriteria search) throws ConnectorMethodException, SapR3ConnectorException
modEntry
in interface ConnectorInterface
modEntry
in class Connector
entry
- The AL connector entry input. This connector must have an attribute
named "sapXml". Its value must be an XML string conforming to the SAP User
XML Schema. supported by the configured XSL style sheets.search
- Passed through to XSL style sheet as an XSL param. Typically, the search
criteria include the keyfields of the given BOR object to be modified.
SapR3ConnectorException
- If the attribute is missing from the entry.
ConnectorMethodException
- if the SAP network call fails, or an XSL
transform error occurs.Connector.modEntry(com.ibm.di.entry.Entry, com.ibm.di.server.SearchCriteria)
public Entry findEntry(SearchCriteria search) throws ConnectorMethodException, SapR3ConnectorException
findEntry
in interface ConnectorInterface
findEntry
in class Connector
search
- Defined in the "LinkCriteria" tab of the AL. Must have a criteria
names matching the key field names of the BOR object as required by the given BOR
read methods.
null
if
the BOR object instance could not be found.
SapR3ConnectorException
- If the attribute is missing from the entry.
ConnectorMethodException
- if the SAP network call fails, or an XSL
transform error occurs.Connector.findEntry(com.ibm.di.server.SearchCriteria)
public void selectEntries() throws ConnectorMethodException, SapR3ConnectorException
BorInstanceIdIterator
following an RFC lookup to obtain the names.
selectEntries
in interface ConnectorInterface
selectEntries
in class Connector
SapR3ConnectorException
- If the attribute is missing from the entry.
ConnectorMethodException
- if the SAP network call fails, or an XSL
transform error occurs.Connector.selectEntries()
public Entry getNextEntry() throws ConnectorMethodException
selectEntries()
.
getNextEntry
in interface ConnectorInterface
getNextEntry
in class Connector
null
when no more instances are available.
ConnectorMethodException
- if the SAP network call fails, or an XSL
transform error occurs.Connector.selectEntries()
public String getVersion()
getVersion
in interface VersionInfoInterface
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |