I am trying to customize the node-header of document list page in alfresco.what I am doing is checking for the presence of pdffolder aspect that compresses all the files inside a folder and if the aspect is present,then compressed label is added,otherwise original label is added.for this I have added the following code in node-header.get.html.ftl
<#if !isContainer>
<#assign nodeType = node.type?replace(":","_") + ".title">
<#assign fileExtIndex = item.fileName?last_index_of(".")>
<#if fileExtIndex gt -1>
<#assign fileExt = item.fileName?substring(fileExtIndex + 1)?lower_case>
<#elseif node.mimetype?? && mimetypes.getExtension(node.mimetype)??><#-- Mimetype may be null if it is not known in the repository -->
<#assign fileExt = mimetypes.getExtension(node.mimetype)>
<#else>
<#assign fileExt = "generic">
</#if>
<#if node.hasAspect("evdffolder")>
<#assign viewType = "Compressed">
<#else>
<#assign viewType = "Original">
</#if>
</#if>
but it is showing the exception "FreeMarker template error:
The following has evaluated to null or missing:
==> node.hasAspect [in template "org/alfresco/components/node-details/node-header.get.html.ftl""
You are trying to use the repository api on share freemarker script.On share side you will not be able to use hasAspect method.Infact, I think the node object itself is not available on share side.Its just an json object.You need to override the get.js file and call repository webscript to check this.You can make ajax call as well to custom webscript for making check of aspects.
You can check more details of hasaspect method of freemarker on below page.
thanks krutik,
can u tell me if there is any out of the box webscript which checks for the presence of aspect in alfresco
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.