when we set custom attribute for stream in web UI. how to get those custom attrbute value in java (in SCM )
Raj Kumar (21●2●17)
| asked Aug 31 '18, 8:21 a.m.
edited Sep 04 '18, 12:12 p.m. by David Lafreniere (4.8k●7) I am checking the RTC 6.0.5 feature.When in the Web UI Project Area configuration page, on the left hand navigator, click 'Source Control' --> 'Attribute Definition' and configure custom attribute value for a Stream as below figure.
|
Accepted answer
David Lafreniere (4.8k●7)
| answered Sep 04 '18, 9:51 a.m.
FORUM MODERATOR / JAZZ DEVELOPER edited Sep 04 '18, 10:08 a.m.
IWorkspace.getCustomAttributes(); is the API to call on both the client and server to get (read) the custom attributes on a stream.
If you want to 'set' custom attributes on a Stream using server code, see:
IScmService.setWorkspaceCustomAttributes(
IWorkspaceHandle stream,
IGenericAttributes attributesToAdd, String[] attributesToRemove, ISynchronizationTimes[] syncTimes, IRepositoryProgressMonitorHandle monitor)
Also, see the following article by Ralph that shows programming examples related to SCM custom attributes: https://rsjazz.wordpress.com/2016/02/04/setting-custom-attributes-for-scm-versionables/
In RTC 6.0.6, server-side API was added to IScmService that will return the list of custom attributes that are available on a given project area.
The API and Javadoc is shown below:
/**
* Return the defined custom attribute identifiers for the given type in the given project area. * * @param projectArea * The project area. Never {@code null}. * @param artifactType * The artifact type. One of: * <ul> * <li>{@link CustomAttributeConstants#ARTIFACT_FILE}</li> * <li>{@link CustomAttributeConstants#ARTIFACT_STREAM}</li> * <li>{@link CustomAttributeConstants#ARTIFACT_BASELINE}</li> * <li>{@link CustomAttributeConstants#ARTIFACT_BASELINE_SET}</li> * <li>{@link CustomAttributeConstants#COMPONENT}</li> * </ul> * @param monitor * A repository progress monitor, may be {@code null} if * progress reporting and cancellation is not required. * * @return the defined attribute identifiers. * * @throws TeamRepositoryException * * @since 0.11.0.6 (RTC 6.0.6) * * @see CustomAttributeConstants */ public String[] getDefinedCustomAttributeIdentifiers(
IProjectAreaHandle projectArea,
int artifactType,
IRepositoryProgressMonitorHandle monitor)
throws TeamRepositoryException;
In RTC 6.0.6, client-side API was added to IWorkspaceManager that will return the list of custom attributes that are available on a given project area.
The API and Javadoc is shown below:
/**
* Return the defined custom attribute identifiers for the given type in the given project area. * * @param projectArea * The project area. Never {@code null}. * @param artifactType * The artifact type. One of: * <ul> * <li>{@link CustomAttributeConstants#ARTIFACT_FILE}</li> * <li>{@link CustomAttributeConstants#ARTIFACT_STREAM}</li> * <li>{@link CustomAttributeConstants#ARTIFACT_BASELINE}</li> * <li>{@link CustomAttributeConstants#ARTIFACT_BASELINE_SET}</li> * <li>{@link CustomAttributeConstants#COMPONENT}</li> * </ul> * @param monitor * A progress monitor, or {@code null} if progress reporting is not desired. * * @return the defined attribute identifiers. * * @throws TeamRepositoryException * * @LongOp This is a long operation; it may block indefinitely; must not be * called from a responsive thread. * * @since 0.11.0.6 (RTC 6.0.6) */ public String[] getDefinedCustomAttributeIdentifiers(
IProjectAreaHandle projectArea,
int type,
IProgressMonitor monitor)
throws TeamRepositoryException; Ralph Schoon selected this answer as the correct answer
|
One other answer
Ralph Schoon (63.3k●3●36●46)
| answered Sep 01 '18, 2:13 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER I believe that https://rsjazz.wordpress.com/2016/02/04/setting-custom-attributes-for-scm-versionables/ shows the API involved. Comments
Raj Kumar
commented Sep 03 '18, 7:42 a.m.
Thank you @Ralph Schoon for information but i just want to know, how i will get those custom attribute for server side. In the below uri its deal with client side
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.