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

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! 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