<#if node.isDocument && !isImage && !isVideo>
<#assign c=cropContent(node.properties.content, 512)>
<#if c?length != 0>
<tr>
<td colspan='2'>Preview:</td>
</tr>
<tr>
<td colspan='2'>
${c?html?replace('$', '<br>', 'rm')}<#if (c?length >= 512)>…</#if>
</td>
</tr>
</#if>
</#if>
Como no me he podido resistir , he ampliado los parámetros 512 a 1024, y he comprobado que la previsualización de los documentos es justamente el doble model.put("cropContent", new CropContentMethod());
Para ver lo que hace este método, debemos echarle un vistazo a la clase org.alfresco.repo.template.CropContentMethod, que básicamente es esto:
if (arg0 instanceof BeanModel && arg1 instanceof TemplateNumberModel)
{
Object wrapped = ((BeanModel)arg0).getWrappedObject();
if (wrapped instanceof TemplateContentData)
{
int bytes = ((TemplateNumberModel)arg1).getAsNumber().intValue();
result = ((TemplateContentData)wrapped).getContentAsText(bytes);
}
}
Donde arg1 representa el nº de bytes y arg0 el contenido a cortar…Content from pre 2016 and from language groups that have been closed.
Content is read-only.
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.