cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

Update (replace) primary content

VasiliyRepecki
12-Amethyst

Update (replace) primary content

Hi.

I have data presented by outputstream or byte array (data contains excel file).

How can i replace primary content of WTDocument by this new file?

Should i use ContentServerHelper.service.updatePrimary method? How to create ApplicationData instance from my data?

Thanks.

1 REPLY 1

I am using this code now:

ContentHolder refreshedContentHolder = ContentHelper.service.getContents(document);

ContentItem contentItem = ContentHelper.getPrimary((FormatContentHolder) refreshedContentHolder);

ContentHolderHelper.deleteContents(document, contentItem);

ContentHolderHelper.setContents(document, byteArray, ContentRoleType.PRIMARY, "name", "", false);

Announcements


Top Tags