As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
document.copy(currentFolder);
changeFile = document.copy(currentFolder); var typeChanged = changeFile.specializeType("cm:content");
var typeChanged = changeFile.specializeType("{http://www.alfresco.org/model/content/1.0}content");
public boolean specializeType(String type) { ParameterCheck.mandatoryString("Type", type); QName qnameType = createQName(type); if (getType().equals(qnameType) == false && this.services.getDictionaryService().isSubClass(qnameType, getType()) == true) { this.nodeService.setType(this.nodeRef, qnameType); this.type = qnameType; return true; } return false; }
The JavaScript API supports modification of the object type and setting of various properties and aspects. You can either "specializeType()" the type using that API call and clear the properties you don't want or you can try creating a new object of the desired type (again all the APIs are there - see the examples) and then setting the content property of the destination object to a copy of the source object.
write(ScriptContent content) Copy the content from the specified ScriptContent (sorry, available from 2.1 Enterprise onwards).