You need the context of a repository to determine the user via the callbacks instance. So make sure that you also pass repository information with PluginServices (in PluginRequest/ResponseFilters you already should have this information).
On the client side in the dojo part you can simply access the user id (but only the id!) via ecm.model.desktop.userId - since ICN version 2.0.2: JsDoc Reference - ecm.model.Desktop (ibm.com)
Original Message:
Sent: Wed September 20, 2023 01:29 AM
From: JIE ZHANG
Subject: How to retrieve user info of logged in user in custom Content Navigator Plugin
Great! I will try it when I got an ODServer to play with.
------------------------------
JIE ZHANG
Original Message:
Sent: Tue September 19, 2023 09:09 AM
From: Andreas Baaserud Hauge
Subject: How to retrieve user info of logged in user in custom Content Navigator Plugin
Here's what I did to get hold of the user id
# Preliminary - Passing PluginServiceCallbacks callbacks Plugin# get hold of the ODServer object by the repositoryIDODServer server = callbacks.getODServer(repositoryId);# Now we can retrieve user infoString userId = server.getUserId();
------------------------------
Andreas Baaserud Hauge
Original Message:
Sent: Tue September 19, 2023 07:40 AM
From: Andreas Baaserud Hauge
Subject: How to retrieve user info of logged in user in custom Content Navigator Plugin
Hi @JIE ZHANG,
I might be missing something
calling PluginServiceCallbacks.getUserid() return null
You got an idea what I'm doing wrong here?
------------------------------
Andreas Baaserud Hauge
Original Message:
Sent: Tue September 19, 2023 02:21 AM
From: JIE ZHANG
Subject: How to retrieve user info of logged in user in custom Content Navigator Plugin
Hi,
Did you tried to get the user id from ecm.model.desktop.userId in browser side or callbacks.getUserId in java side?
------------------------------
JIE ZHANG
Original Message:
Sent: Mon September 18, 2023 08:39 AM
From: Andreas Baaserud Hauge
Subject: How to retrieve user info of logged in user in custom Content Navigator Plugin
Hi,
Not sure if I am posting in the correct groupa - its the only group I got access to.
I am working on a Content Navigator Plugin where I need to get hold of the user id for the logged in user in Content Navigator.
Does anyone have any clue how I can achieve this?
------------------------------
Andreas Baaserud Hauge
------------------------------