cancel
Showing results for 
Search instead for 
Did you mean: 

[Résolu] JS people api : Person is a mandatory parameter

zomurn
Champ in-the-making
Champ in-the-making
J'ai un script qui plante sur l'instruction suivante :

      
      groups = people.getContainerGroups(person);

erreur : Person is a mandatory parameter

juste avant je fais :


var person = people.getPerson(userHomeFolder.getOwner());
            logger.log(person);

La log sort à l'écran :

Node Type: {http://www.alfresco.org/model/content/1.0}person, Node Aspects: [{http://www.alfresco.org/model/system/1.0}referenceable, {http://www.alfresco.org/model/application/1.0}configurable]

Donc mon paratre est bon…pourquoi cette erreur ????????
3 REPLIES 3

zomurn
Champ in-the-making
Champ in-the-making
Résolu : il faut faire .owner (propriété) et pas .getOwner() (cf. wiki)

zomurn
Champ in-the-making
Champ in-the-making
En fait ça merde dans tous les cas avec getPerson() SI ET SEULEMENT SI l'argument est dynamique (une variable).
l'argument doit être en dur pour que ça marche ? D'où provient cette limitation ?  :?:

exemple ok : getPerson("toto");

exemple ko :

var username = new String(folder.getOwner());
getPerson(username); => erreur

zomurn
Champ in-the-making
Champ in-the-making
Hé non ! j'ai trouvé !

En fait j'avais un repertoire d'accueil de l'utilisateur…mais si je supprime cet utilisateur, ce rep reste présent. Dans ma boucle, je tombe donc sur des rep utilisateurs dont leur owner n'existe plus.