change the childtype of a DocumentLibrary to cm:folder

Showing results for 
Search instead for 
Did you mean: 
Member II

change the childtype of a DocumentLibrary to cm:folder

hello everyone, and thanks for reading this,

the document Library of one of my sites changed unexpectly to "type: websiteContainer", now it is not accesible anymore from the front-end in share.

is there a way to change it back to "type: cm_folder"?

Screen Shot 2022-01-05 at 11.08.50.png

1 Reply

Re: change the childtype of a DocumentLibrary to cm:folder

You can use JSConsole or write a js repository webscript to change the type back to cm:folder. You can use nodeService's setType method to change the type.

These amps works with acs7 if you would like to install and use the JSConsole:

Here is a video on how to use it:

Here is a sample code that can be used to change the type via JSConsole:

var nodeRefStr = 'workspace://SpacesStore/e0df9384-9472-472e-95c0-2e091f452700'; //Node ref of the corrupted folder
try {
	var node=search.findNode(nodeRefStr);
	logger.log("NodeRef: "+ node.nodeRef+" | Name: "
        var ctxt =;
        var nodeService =  ctxt.getBean('NodeService', org.alfresco.service.cmr.repository.NodeService);
        var QName =;
        var nodeTypeFolder = QName.createQName("{}folder");
        nodeService.setType(node.nodeRef, nodeTypeFolder);
} catch (ex) {
   logger.log("Exception occurred: " + ex.message);

If you prefer to use js repository web script, here are the documentations to start with: