<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic change the childtype of a DocumentLibrary to cm:folder in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/change-the-childtype-of-a-documentlibrary-to-cm-folder/m-p/121946#M33437</link>
    <description>&lt;P&gt;hello everyone, and thanks for reading this,&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;is there a way to change it back to "type: cm_folder"?&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-01-05 at 11.08.50.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://connect.hyland.com/t5/image/serverpage/image-id/1337iC4E18F5A44E4F8F5/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 05 Jan 2022 10:15:45 GMT</pubDate>
    <dc:creator>yohanmaker</dc:creator>
    <dc:date>2022-01-05T10:15:45Z</dc:date>
    <item>
      <title>change the childtype of a DocumentLibrary to cm:folder</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/change-the-childtype-of-a-documentlibrary-to-cm-folder/m-p/121946#M33437</link>
      <description>&lt;P&gt;hello everyone, and thanks for reading this,&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;is there a way to change it back to "type: cm_folder"?&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2022-01-05 at 11.08.50.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://connect.hyland.com/t5/image/serverpage/image-id/1337iC4E18F5A44E4F8F5/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2022 10:15:45 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/change-the-childtype-of-a-documentlibrary-to-cm-folder/m-p/121946#M33437</guid>
      <dc:creator>yohanmaker</dc:creator>
      <dc:date>2022-01-05T10:15:45Z</dc:date>
    </item>
    <item>
      <title>Re: change the childtype of a DocumentLibrary to cm:folder</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/change-the-childtype-of-a-documentlibrary-to-cm-folder/m-p/121947#M33438</link>
      <description>&lt;P&gt;You can use &lt;A href="https://github.com/share-extras/js-console" target="_self" rel="nofollow noopener noreferrer"&gt;JSConsole&lt;/A&gt; 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.&lt;/P&gt;
&lt;P&gt;These amps works with acs7 if you would like to install and use the JSConsole:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/abhinavmishra14/js-console/releases/download/0.7-rc/javascript-console-repo-0.7.amp" target="_blank" rel="noopener nofollow noreferrer"&gt;https://github.com/abhinavmishra14/js-console/releases/download/0.7-rc/javascript-console-repo-0.7.amp&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/abhinavmishra14/js-console/releases/download/0.7-rc/javascript-console-share-0.7.amp" target="_blank" rel="noopener nofollow noreferrer"&gt;https://github.com/abhinavmishra14/js-console/releases/download/0.7-rc/javascript-console-share-0.7.amp&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Here is a video on how to use it:&amp;nbsp;&lt;A href="https://www.youtube.com/watch?v=c3JIeVY8Nnk" target="_blank" rel="noopener nofollow noreferrer"&gt;https://www.youtube.com/watch?v=c3JIeVY8Nnk&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Here is a sample code that can be used to change the type via JSConsole:&lt;/P&gt;
&lt;PRE&gt;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: "+node.name)
        var ctxt = Packages.org.springframework.web.context.ContextLoader.getCurrentWebApplicationContext();
        var nodeService =  ctxt.getBean('NodeService', org.alfresco.service.cmr.repository.NodeService);
        var QName = Packages.org.alfresco.service.namespace.QName;
        var nodeTypeFolder = QName.createQName("{http://www.alfresco.org/model/content/1.0}folder");
        nodeService.setType(node.nodeRef, nodeTypeFolder);
} catch (ex) {
   logger.log("Exception occurred: " + ex.message);
}&lt;/PRE&gt;
&lt;P&gt;If you prefer to use js repository web script, here are the documentations to start with:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.alfresco.com/content-services/7.0/tutorial/platform/web-scripts/" target="_blank" rel="noopener nofollow noreferrer"&gt;https://docs.alfresco.com/content-services/7.0/tutorial/platform/web-scripts/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.alfresco.com/content-services/5.2/develop/repo-ext-points/web-scripts/" target="_blank" rel="noopener nofollow noreferrer"&gt;https://docs.alfresco.com/content-services/5.2/develop/repo-ext-points/web-scripts/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2022 15:25:37 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/change-the-childtype-of-a-documentlibrary-to-cm-folder/m-p/121947#M33438</guid>
      <dc:creator>abhinavmishra14</dc:creator>
      <dc:date>2022-01-05T15:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: change the childtype of a DocumentLibrary to cm:folder</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/change-the-childtype-of-a-documentlibrary-to-cm-folder/m-p/121948#M33439</link>
      <description>&lt;P&gt;Namaskaram &lt;SPAN class=""&gt;&lt;A href="https://hub.alfresco.com/t5/user/viewprofilepage/user-id/74498" target="_self" rel="nofollow noopener noreferrer"&gt;&lt;SPAN class=""&gt;abhinavmishra14,&amp;nbsp;&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt; I have been trying to solve this problem for almost one month and i gave up at some point and this generated a lot of work, and lost time. if you are interested and your current situation allows it, i would like to stay in contact with you for future consultancies. regards. Yohan&lt;/P&gt;</description>
      <pubDate>Wed, 02 Feb 2022 10:42:36 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/change-the-childtype-of-a-documentlibrary-to-cm-folder/m-p/121948#M33439</guid>
      <dc:creator>yohanmaker</dc:creator>
      <dc:date>2022-02-02T10:42:36Z</dc:date>
    </item>
  </channel>
</rss>

