cancel
Showing results for 
Search instead for 
Did you mean: 

presence Root object

yesit
Champ in-the-making
Champ in-the-making
Hello,

I have a question regarding the presence root object.

In the documentation (http://docs.alfresco.com/5.0/references/API-JS-rootscoped.html), the following is stated:
<em>presence | org.alfresco.repo.jscript.Presence | Root object providing access to methods for detecting online presence of users</em>.

Well we're using the Alfresco SDK 2.1, but when I use the presence.getDetails(people.getPerson("admin")) method I just get a null|null string back.

I think I'm just using the object the wrong way.

Could maybe someone explain me the use of the presence root object and what it actually does.

Thanks
3 REPLIES 3

mrogers
Star Contributor
Star Contributor
what getDetails returns is presenceProvider | presenceUsername
{code}
      ParameterCheck.mandatory("Person", person);
      String presenceProvider = (String)person.getProperties().get(ContentModel.PROP_PRESENCEPROVIDER);
      String presenceUsername = (String)person.getProperties().get(ContentModel.PROP_PRESENCEUSERNAME);
      String detail = presenceProvider + "|" + presenceUsername;
{code}

So it would seem that your "admin" user is missing those two properties.

mrogers
Star Contributor
Star Contributor
I've alerted the docs team that this object is not well documented.  And I'll also get the ball rolling on getting rid of it.   Its unused code.

yesit
Champ in-the-making
Champ in-the-making
I understand, thank you very much for your quick reply.