【问题标题】:Alfresco: get first name and lastname from personAlfresco:从人那里获取名字和姓氏
【发布时间】:2014-07-02 12:03:10
【问题描述】:

我需要帮助从 personInfo 中获取姓名和姓氏,我有来自用户的用户名。

我的代码是:

    //get person from username
    NodeRef person = personService.getPerson(username);

    //error
    PersonInfo personInfo = personService.getPerson(person);

    String firstName = personInfo.getFirstName();
    String lastName = personInfo.getLastName();

错误是:

java.lang.NoSuchMethodError: org.alfresco.service.cmr.security.PersonService.getPerson(Lorg/alfresco/service/cmr/repository/NodeRef;)Lorg/alfresco/service/cmr/security/PersonService$PersonInfo;

方法是:

我的错在哪里?

Alfresco 是 4.2.c 版本,alfresco-maven-sdk 是 1.1.1

提前致谢

【问题讨论】:

    标签: alfresco-share


    【解决方案1】:

    我没有适合 alfresco 4.2.c 的 SDK,它不包含上述方法。我找到了另一个解决方案:

        NodeRef personRef = personService.getPerson(assignee);
    
        String firstName = nodeService.getProperty(personRef, ContentModel.PROP_FIRSTNAME).toString();
        String lastName = nodeService.getProperty(personRef, ContentModel.PROP_LASTNAME).toString();
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-10-11
      • 2011-05-17
      • 2015-04-30
      • 2019-01-27
      • 1970-01-01
      • 2016-08-01
      • 1970-01-01
      相关资源
      最近更新 更多