如何在“我的任务”小面板中获取登录用户的名称

时间:2014-05-12 16:57:43

标签: alfresco alfresco-share

如何获取已登录用户的名称,以便My task dashlet显示为Username Task。我试过了${person.properties.userName},但我收到了错误。我的代码段是

<#assign name = person.properties.userName>
 <div class="dashlet my-tasks">
 <div class="title"> ${name} Task </div> 

但它显示错误

An error has occured in the Share component: /share/service/components/dashlets/my-tasks.
It responded with a status of 500 - Internal Error.
Error Code Information: 500 - An error inside the HTTP server which prevented it from fulfilling the request.
Error Message: 04120000 Failed to process template org/alfresco/components/dashlets/my-tasks.get.html.ftl

1 个答案:

答案 0 :(得分:3)

与根对象的存储库不同。

您有一个变量user(java类型org.springframework.extensions.webscripts.ScriptUser),其方法为getName()

要在freemarker模板中获取用户名(在分享中),您可以使用${user.name}${user.getName()}