AnsweredAssumed Answered

.write() method on  ScriptContent nodes:  what is the point?

Question asked by sacco on May 31, 2008
I'm failing to see the point of having a  .write()  method on ScriptContent
to copy properties of type  d:content, e.g.
destNode.properties.content.write(srcNode.properties.content);

Certainly, this copies the contents of srcNode to destNode, but then
apparently so does:
destNode.properties.content = srcNode.properties.content;
destnode.save();

The difference?  The only thing I can see is that the version using .write
creates a new file containing a copy of the content of srcNode in the content
store;  both, for example, will create a entry in the version history of destNode
if autoVersioning is enabled.

But with Alfresco's 'write once' approach to content, what is the use of creating
another (effectively immutable) copy of the same sequence of bits in the content store?'
In fact, isn't it better to avoid doing so?

Is there something important that I'm missing here?

Outcomes