Point IMAP templates to Share

Alfresco offers the great feature to access the repository using the IMAP interface. From within Thunderbird or Outlook one can browse the content in the repository, and store/archive emails in the Spaces of choice. Great feature, however, the IMAP template that is displayed in the IMAP client (e.g. Thunderbird) generates links that point to the Alfresco Explorer interface instead of to the Share interface. This post will describe how to change this behaviour.

Like almost everything in Alfresco, this is easy fixable. modified the link section in theFreemarker template as stored in Company Home/Data Dictionary/Imap Configs/Templates

I replace /alfresco for /share:
${contextUrl?replace("/alfresco","/share")}
Actually, you could possibly add/change the property web.application.context.url in %tomcat%/shared/classses/alfresco-global.properties, but I am not sure what I will break if I did so.

Share url’s always start with a substring pointing at the particular site:
/page/site/${document.location.site}
The part ${document.location.site} actually represents the name of the Site.

I either construct the details page:
/document-details?nodeRef=workspace://SpacesStore/${document.properties["sys:node-uuid"]}

Or I construct the view on the parent folder:
/documentlibrary#filter=path|/${document.displayPath?substring(document.displayPath?index_of("/documentLibrary/")+17, document.displayPath?length)}

ToDo: Nothing prevents me to add the link that opens the (Office) document uting the Sharepoint protocol. I expect this should work in MS-OUtlook…

//removed the top part of the Freemarker template
//...
//
<legend> Content links </legend>
<table class="links">
  <tr>
    <td>Content folder: </td><td>
      <a href="${contextUrl?replace("/alfresco","/share")}/page/site/${document.location.site}/documentlibrary#filter=path|/${document.displayPath?substring(document.displayPath?index_of("/documentLibrary/")+17, document.displayPath?length)}">
${contextUrl?replace("/alfresco","/share")}/page/site/${document.location.site}/documentlibrary#filter=path|/${document.displayPath?substring(document.displayPath?index_of("/documentLibrary/")+17, document.displayPath?length)}</a>
    </td>
  </tr>
  <tr>
    <td>Content URL:</td><td>
      <a href="${contextUrl?replace("/alfresco","/share")}/page/site/${document.location.site}/document-details?nodeRef=workspace://SpacesStore/${document.properties["sys:node-uuid"]}"> ${contextUrl?replace("/alfresco","/share")}/page/site/${document.location.site}/document-details?nodeRef=workspace://SpacesStore/${document.properties["sys:node-uuid"]} </a>
    </td>
  </tr>
  <tr>
    <td>Download URL:</td><td>
      <a href="${contextUrl?replace("/alfresco","/share")}/proxy/alfresco-feed/api/node/content/workspace/SpacesStore/${document.properties["sys:node-uuid"]}/${document.name}?a=true">${contextUrl?replace("/alfresco","/share")}/proxy/alfresco-feed/api/node/content/workspace/SpacesStore/${document.properties["sys:node-uuid"]}/${document.name}?a=true </a>
    </td>
  </tr>
</table>
//
// removed the last section of the Freemarker template
Advertisements

1 Response to “Point IMAP templates to Share”


  1. 1 Diana George July 19, 2010 at 16:16

    Hi,

    Thanks for this great article!
    I try to test it, but I have a error when I use ${document.location.site} (Alfresco CE 3.2r2).
    Can you help me?

    Thanks!

    Best Regards,
    Diana


Comments are currently closed.