AnsweredAssumed Answered

Content update via API results in 'cm:content' property missing in Share properties dialog/page

Question asked by pt-tier2 on Nov 20, 2014
Hi there.

We have a client on 4.0.0 community and we're seeing this problem in Share after updating a node's content via the API.

The scenario is:

- user selects action in webapp
- webapp performs API call to update NodeRef content
- admin logs into Share, locates node and clicks 'Edit Properties'
- Node properties dialog/page has no row with 'Content' and/or content HTML textarea

The code is updating the content, which can be verified via an API call to get the content or when the admin clicks the 'View In Browser' link that opens the update content in a new browser window.

The CMIS code used is simply:

            InputStream stream = new ByteArrayInputStream(data);
            ContentStream contentStream = new ContentStreamImpl(document.getName(), BigInteger.valueOf(data.length), "application/xml", stream);
            document.setContentStream(contentStream, true, true);

We have also tried via a WebScript, using:

        NodeRef nodeRef = new NodeRef(NodeServiceUtils.STORE_REF + docId);
        ContentWriter writer = contentService.getWriter(nodeRef, ContentModel.PROP_CONTENT, true);
This works like a charm when creating new content - everything appears correct in Share, etc.  This only appears to be a problem when updating content for a NodeRef that already exists.

Really appreciate any help.  Many thanks.