cancel
Showing results for 
Search instead for 
Did you mean: 

Workflow Assignee People Finder

johnpelquingua
Champ in-the-making
Champ in-the-making
Hi Everyone,

I'm trying to customize the search results when I'm trying to assign on a workflow.

By the default this is the result when Im trying to search for a user:

Juan Dela Cruz(jdelacruz)

What I want to do is to add a site info as where that user is coming from.

This is what I should do:

Juan Dela Cruz(jdelacruz) - Site A

So, basically just adding the Site's info after the username. My question is where should I customize this? I have tried doing it in the people-finder.js file and so far no luck for me.
Can you guys please advise?

Thanks!


Best Regards,
JP

4 REPLIES 4

johnpelquingua
Champ in-the-making
Champ in-the-making
Hi guys,

I found the files to configure the file is on pickerresults.lib.js.

My question is now what will be the properties to get the user's membership of a site?
Is it only just a node.properties property??

Please advise thanks!


Best Regards,
JP

hey I'm using alfresco community 5.0.d and I could not find this file in the directory.

I want to filter the people search in workflow assignee. (Refer to screenshot)

I need to find the right file which execute or get the list of people after search is made.

Thanks

zladuric
Champ on-the-rise
Champ on-the-rise
There are a few ways to get this, but you use it on client side js, right? Not 100% sure, but there is already a lot of properties for each user. Log it to the console and then see if the site memberships are already in (I think they are), and if not, you can fetch site memberships by a simple ajax call to the backend.

johnpelquingua
Champ in-the-making
Champ in-the-making
Hi zladuric,

Thank you for your prompt reply, basically this is now my pickerresults.lib.js:

And yes Im using js. On this snippet code: is where I want to show the user's current site membership.


  personObject.properties.userName = node.properties.userName;
   personObject.properties.name = (node.properties.firstName ? node.properties.firstName + " " : "") +
      (node.properties.lastName ? node.properties.lastName : "") +
         " (" + node.properties.userName + ")" + (node.properties.site ? node.properties.site + " " : "");
   personObject.properties.jobtitle = (node.properties.jobtitle ? node.properties.jobtitle  : "");
  



My question is how do I fetch it via a simple ajax call?

Thank you for your reply.


/**
* Creates an Object representing the given person node.
*
* @method createPersonResult
* @param node
* @return Object representing the person
*/
function createPersonResult(node)
{
   var personObject =
   {
      typeShort: node.typeShort,
      isContainer: false,
      properties: {},
      displayPath: node.displayPath,
      nodeRef: "" + node.nodeRef
   }
  
   // define properties for person
   personObject.properties.userName = node.properties.userName;
   personObject.properties.name = (node.properties.firstName ? node.properties.firstName + " " : "") +
      (node.properties.lastName ? node.properties.lastName : "") +
         " (" + node.properties.userName + ")" + (node.properties.site ? node.properties.site + " " : "");
   personObject.properties.jobtitle = (node.properties.jobtitle ? node.properties.jobtitle  : "");
  
   return personObject;
}

/**
* Creates an Object representing the given group node.
*
* @method createGroupResult
* @param node
* @return Object representing the group
*/
function createGroupResult(node)
{
   var groupObject =
   {
      typeShort: node.typeShort,
      isContainer: false,
      properties: {},
      displayPath: node.displayPath,
      nodeRef: "" + node.nodeRef
   }
  
   // find most appropriate name for the group
   var name = node.properties.name;
   if (node.properties.authorityDisplayName != null && node.properties.authorityDisplayName.length > 0)
   {
      name = node.properties.authorityDisplayName;
   }
   else if (node.properties.authorityName != null && node.properties.authorityName.length > 0)
   {
      var authName = node.properties.authorityName;
      if (authName.indexOf("GROUP_") == 0)
      {
         name = authName.substring(6);
      }
      else
      {
         name = authName;
      }
   }
  
   // set the name
   groupObject.properties.name = (node.properties.authorityDesignationTag ? "[D] "  : "") + name;
  
   return groupObject;
}