Retrieve links from files under scm via API
Accepted answer
Julian,
The following service call on the IScmService which can be invoked from plain java will give you all the links associated with one or more SCM files:
/**
* Get related artifacts for the specified versionable states.
*
* @param itemStateHandles
* Versionable item handles including the state. Must not be {@code null} and
* all elements must not be {@code null} and have a state ID.
* @param gcURL
* The URL of the global configuration in which the results should be resolved.
* if this field is {@code null}, this method will only return outgoing links
* and the related artifact URIs may not point to a concrete resource.
* @param options
* Options; See {@link #LINK_FETCH_OPTIONS} for all options.
* @param monitor
* Progress monitor.
* @return
* An array with an element for each handle in {@code itemStateHandles}. The value of each element
* contains all of the related artifacts for the corresponding state handle.
* @throws TeamRepositoryException
* If the operation fails.
* @since 0.11.0.4 (RTC 6.0.4)
*/
public RelatedArtifactsDTO[] getRelatedArtifacts(IVersionableHandle[] itemStateHandles,
String gcURL, String[] options,
IRepositoryProgressMonitorHandle monitor)
throws TeamRepositoryException;
* Get related artifacts for the specified versionable states.
*
* @param itemStateHandles
* Versionable item handles including the state. Must not be {@code null} and
* all elements must not be {@code null} and have a state ID.
* @param gcURL
* The URL of the global configuration in which the results should be resolved.
* if this field is {@code null}, this method will only return outgoing links
* and the related artifact URIs may not point to a concrete resource.
* @param options
* Options; See {@link #LINK_FETCH_OPTIONS} for all options.
* @param monitor
* Progress monitor.
* @return
* An array with an element for each handle in {@code itemStateHandles}. The value of each element
* contains all of the related artifacts for the corresponding state handle.
* @throws TeamRepositoryException
* If the operation fails.
* @since 0.11.0.4 (RTC 6.0.4)
*/
public RelatedArtifactsDTO[] getRelatedArtifacts(IVersionableHandle[] itemStateHandles,
String gcURL, String[] options,
IRepositoryProgressMonitorHandle monitor)
throws TeamRepositoryException;
If you have any further questions, let me know.
Michael