Creating External Repository Connection programmatically
Hi,
I want to create external repository connections programmatically. I am able to fetch all the connections and iterate through their properties to validate them, but the com.ibm.team.interop.common.service.IInteropService and IExternalRepositoryConnection APIs don't allow me to create a new connection.
Should I try debugging the "Create External Repository Connection" wizard to find the API calls for creating external repository connections ?
Thanks,
Atul
I want to create external repository connections programmatically. I am able to fetch all the connections and iterate through their properties to validate them, but the com.ibm.team.interop.common.service.IInteropService and IExternalRepositoryConnection APIs don't allow me to create a new connection.
Should I try debugging the "Create External Repository Connection" wizard to find the API calls for creating external repository connections ?
Thanks,
Atul
Accepted answer
You don't say whether your code is running in the server, or in a client, so you can use either IInteropService.saveExternalRepositoryConnection() (if running in the server) or IItemConnectorAdminClient.saveExternalRepositoryConnection() (if running in a client). The first few lines of javadoc for each method are
This is the standard pattern for creating new items - first you would create an in-memory item using
Then set the attributes on the item the way you want, and save it.
* Save a new or updated external repository connection. The incoming object
* must be either a new item or a working copy of an existing item.
This is the standard pattern for creating new items - first you would create an in-memory item using
IExternalRepositoryConnection.ITEM_TYPE.createItem()
Then set the attributes on the item the way you want, and save it.
Hi,
I want to create external repository connections programmatically. I am able to fetch all the connections and iterate through their properties to validate them, but the com.ibm.team.interop.common.service.IInteropService and IExternalRepositoryConnection APIs don't allow me to create a new connection.
Should I try debugging the "Create External Repository Connection" wizard to find the API calls for creating external repository connections ?
Thanks,
Atul