Cannot obtain user first and last name in report

Hi,

I’m developing a centrasite report that at some point has to list user names that are associated with a certain asset.

When I try to get the user real name (“personName” attribute) I always get null, only when I use “name” I obtain a result but not exactly what I want as “name” is a network user name.

I checked the structure of “User” type and I get the following:

  • key
  • owner
  • name
  • description
  • submittingOrganization
  • classifications
  • organization
  • personName

The person name exists but is always null, in Centrasite the users have a first and last name attribute, but I cannot get them, can someone help me on this?

I’m using the following code to get the user name (only relevant code is shown):


declare function local:getUserName($node as node()) as xs:string
{
    xs:string(($node/cs:name/cs:localString)[1])
};
declare function local:followAssocOnce($entry as node(), $assoc as xs:string) as node()*
{
  for $key in $entry//cs:association
    [cs:associationType=$assoc]/cs:targetObject
  return collection("CentraSite")/*[cs:key=$key]
}

let $managerConcept     := collection("CentraSite")/cs:concept[cs:key = "uddi:47c8a069-881a-11e2-b660-b3209cbe383c"]/cs:key
...
<User>
     {
         for $user in local:followAssocOnce($project,$managerConcept)
             return
                 (local:getUserName($user))
      }
</User>
...

Maybe a bit late… but have you tried this?


import module namespace ut = "http://namespaces.CentraSite.com/modules/util";

let $user := ut:getUserName("uddi:fc21a166-... <key of the owner>")
return $user

Regards,
Andreas