cancel
Showing results for 
Search instead for 
Did you mean: 

The customizing use of 'Alfresco.DocumentList' component

kot4
Champ in-the-making
Champ in-the-making
Hi everyone
I am developing an extension of alfresco and need to view a specific directory as the root directory. I use "Alfresco.DocumentList" component in Repo Browser mode like this:

<#include "include/documentlist.lib.ftl" /><@documentlistTemplate><script type="text/javascript">//<![CDATA[   new Alfresco.DocumentList("${args.htmlid}").setOptions({      <#–<#if repositoryUrl??>repositoryUrl: "${repositoryUrl}",</#if>–>      siteId: "",      containerId: "",      rootNode: ${rootFolderPath},      usePagination: ${(args.pagination!false)?string},      sortAscending: ${(preferences.sortAscending!true)?string},      sortField: "${(preferences.sortField!"cm:name")?js_string}",      showFolders: ${(preferences.showFolders!true)?string},      simpleView: ${(preferences.simpleView!false)?string},      highlightFile: "${(page.url.args["file"]!"")?js_string}",      replicationUrlMapping: ${replicationUrlMappingJSON!"{}"},      repositoryBrowsing: true,      useTitle: ${(useTitle!true)?string},      userIsSiteManager: false   }).setMessages(      ${messages}   );//]]></script></@>‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
where ${rootFolderPath} is my custom path to some root node.

Everything works correctly, but I have a slight problem: "Alfresco.DocumentList" component can display the new directory is not earlier than a few seconds after its creation. And if I try to open a new directory as the root directory before the expiration of a few seconds after its creation, "Alfresco.DocumentList" component shows Company Home as root directory. User can try to open a new directory without wait, so I need fix this problem, or I should learn to recognize the time after which the component is working properly.

Thanks
1 REPLY 1

kot4
Champ in-the-making
Champ in-the-making
path of the root node pars in "Alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\templates\webscripts\org\alfresco\slingshot\documentlibrary-v2\parse-args.lib.js" with this code:

…resolveNode: function ParseArgs_resolveNode(reference)   {      var node = null;      try      {         if (reference == "alfresco://company/home")         {            node = companyhome;         }         else if (reference == "alfresco://user/home")         {            node = userhome;         }         else if (reference == "alfresco://sites/home")         {            node = companyhome.childrenByXPath("st:sites")[0];         }         else if (reference.indexOf("://") > 0)         {            node = search.findNode(reference);         }         else if (reference.substring(0, 1) == "/")         {            node = search.xpathSearch(reference)[0];         }      }      catch (e)      {         return null;      }      return node;   }…‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

When 'reference' var is 'xpath' I have some problem, but if I use 'a node reference as a string' everything works correctly. Now I use a 'workspace://SpacesStore/6ff2f6f5-1e7f-4515-a4bf-1abe6c8b6ade' instead of 'alfresco://company/home/re-management-data-dictionary/real-estate/re-1', for example.

Thank you for your attention