custom dashlet displaying MS word press release improperly
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2007 02:04 PM
Based on the Shariff ebook, I created a custom dashlet to display press releases. I stuck a couple of MS Word documents into the space but the text displayed in the press release area is:
CF999-00482.doc
�� à ¡± �����������������>� ��� � …
The title is indeed CF999-00482, but all the question marks are not part of the document.
The dashlet that is displaying the document is below, customized a little from the ebook
What could it be? Thanks.
CF999-00482.doc
�� à ¡± �����������������>� ��� � …
The title is indeed CF999-00482, but all the question marks are not part of the document.
The dashlet that is displaying the document is below, customized a little from the ebook
<table><#assign l_space = companyhome.childByNamePath["Corporate/News and Announcements"]><#list l_space.children as doc><#if doc.isDocument><tr><td><a class="title" href="/alfresco/${doc.url}">${doc.properties.title}</a></td></tr><tr><td style="padding-left:8px"><#if (doc.content?length > 500)><small>${doc.content[0..30]}…</small><#else><small>${doc.content}</small></#if></td></tr><tr><td> <HR> </td></tr></#if></#list></table>
What could it be? Thanks.
Labels:
- Labels:
-
Archive
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2007 06:32 PM
Yes, when you hit the part of the MS Word doc file outside of the icon area within My Spaces, you can get a preview of the file in plain text. That's what I need.
I am not sure what the myspaces-webscript.jsp dashlet calls, but I found the
myspaces_preview_panel.ftl which appears to be the file used in the "My Spaces" bubble up preview.
Here's the first block of code of that file:
so I snipped out this section and put it into my custom FTL. I got this error message
According to the Alfresco Wiki, the function cropContent is part of the default model for Templatenodes. What else needs to be done?
I am not sure what the myspaces-webscript.jsp dashlet calls, but I found the
myspaces_preview_panel.ftl which appears to be the file used in the "My Spaces" bubble up preview.
Here's the first block of code of that file:
<#assign isImage=node.isDocument && (node.mimetype = "image/gif" || node.mimetype = "image/jpeg" || node.mimetype = "image/png")><table width="690" cellpadding="2" cellspacing="0" border="0" onclick="event.cancelBubble=true;"> <tr> <td> <div class="spacePreview"> <#if node.isDocument && !isImage> <#assign c=cropContent(node.properties.content, 2048)> <#if c?length != 0> ${c?html?replace('$', '<br>', 'rm')}<#if (c?length >= 2048)>…</#if> <#else> Sorry, no preview currently available for this document. </#if>…
so I snipped out this section and put it into my custom FTL. I got this error message
Error during processing of the template 'Expression cropContent is undefined on line 20, column 14 in alfresco/templates/press_releases.ftl.'. Please contact your system administrator.
According to the Alfresco Wiki, the function cropContent is part of the default model for Templatenodes. What else needs to be done?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2008 12:14 PM
cropContent method was only added relatively recently i think. You might need a newer build.
Kevin
Kevin
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2008 11:18 AM
So, is it in 2.9C or 3.x only?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2008 10:53 AM
I had a quick look in the codebase, in Alfresco 2.9 cropContent() was only available to the freemarker template that builds the pop-up dialog that you mention - it is not available to other templates. This has been rectified in latest 3.0 code (i.e. a much more recent build) and it now available to all templates in the repository.
Thanks,
Kevin
Thanks,
Kevin

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2009 06:50 AM
Hi aatamer,
I'm also facing the same problem. It is working fine with .txt files but with office documents i'm facing the
same kind of problem. did you resolve this one? if yes, can you tell me the changes were needed for the same.
I'm also facing the same problem. It is working fine with .txt files but with office documents i'm facing the
same kind of problem. did you resolve this one? if yes, can you tell me the changes were needed for the same.
