How to use createAttachment to upload attachments on server using RTC Java API
3 answers
IWorkItemCommon.createAttachment(projectArea, monitor)
Then you use the code from IWorkItemClient....
IAttachment attachment= IWorkItemCommon.createAttachment(projectArea, monitor); Attachment attachment= (Attachment) fAuditableCommon.createAuditable(IAttachment.ITEM_TYPE); attachment.setName(name); attachment.setDescription(description); IContent content= fTeamRepository.contentManager().storeContent(contentType, characterEncoding, inputStream, null, monitor); attachment.setContent(content);The WorkItemCommon should be available in the server API. The rest should be doable with the server API.
Comments
It's strange that it could not find ITeamRepository or IContentManager in the SDK libraries.
Not sure how your setup looks like, but I have multiple hits if I do a search for references or a Java class search.
I followed your extension workshop development. Everything seems working fine. Is it because I am using the 3.0.1.x version?
No, independent of the version you should have plenty of hits. ITeamRepository shows several thousand times in my setup. Check if https://rsjazz.wordpress.com/2013/02/28/setting-up-rational-team-concert-for-api-development/ and the following post https://rsjazz.wordpress.com/2013/03/20/understanding-and-using-the-rtc-java-client-api/ help. DId you add the sources to the Java Search as explained in the first lab of the Extensions Workshop? If not, do it again.