It's all about the answers!

Ask a question

set creator of IAttachment (client side)


szasz gabor (812) | asked Aug 29 '14, 2:57 a.m.
Hi,

I've created some code with jazz plain api to export e-mail message to RTC. It's worked fine.

I tried to search how can I set creator of IAttachment but could not find. Is it possible to adjust the creator?
 
Thank you in advance for your answer.

Comments
szasz gabor commented Aug 29 '14, 3:06 a.m.

There is a method IAttachment IWorkItemServer.saveAttachment witch create IAttachment from Attachment. If I can use this method in client side, I have possibility to set the uploaded attachment creator.

Someone has tried to use this method in client side?


sam detweiler commented Sep 01 '14, 8:47 a.m. | edited Sep 01 '14, 8:54 a.m.

behind each I* interface class is a concrete class implementation of the interface.
those classes are in the internal libraries.

the Attachment implementation class has a setCreator(IContributorHandle);

you cast the IAttachment to Attachment, then you can use the setCreator method.

and then save like always

just a reminder, internal classes are not documented, and could change at any time, use at your own risk.  you cannot open a defect against and internal api change

Accepted answer


permanent link
Ralph Schoon (60.7k33643) | answered Sep 01 '14, 9:39 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Sep 01 '14, 9:41 a.m.
Well, you can try to use the INTERNAL interface com.ibm.team.workitem.common.internal.model.Attachment . Be warned, that is internal API and can change and so on. Example:
			((Attachment) newAttachment).setCreator(value);
szasz gabor selected this answer as the correct answer

Comments
Ralph Schoon commented Sep 01 '14, 9:42 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

PS: if you want to do things you shouldn't do, it is always an option to look into the implementation classes and other analogue interfaces that might be available.

The external interfaces limit what you can do compared to the internal model interfaces.


szasz gabor commented Sep 04 '14, 3:44 a.m.

It's work. Thank you.

One other answer



permanent link
Eric Jodet (6.3k5111120) | answered Sep 01 '14, 8:34 a.m.
JAZZ DEVELOPER
 Hello,
I guess that you can not set the creator of an attachment.
IAttachment API only enables you to getCreator().

Reading through the code, the creator is set at creation time, using the user id that performs the operation.
In your case, the process / code that exports the email to RTC.
Eric

Your answer


Register or to post your answer.