How to get Username in Openkm Stamp instead of UserID

OpenKM has many interesting features, but requires some configuration process to show its full potential.
Forum rules
Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
Post Reply
jahir
Fresh Boarder
Fresh Boarder
Posts: 11
Joined: Thu Aug 15, 2019 6:41 am

How to get Username in Openkm Stamp instead of UserID

Post by jahir » Thu Aug 15, 2019 8:10 am

Hi,
How can i get Username in OpenKM stamp instead of UserID

Am using Openkm Version : 6.4.48-Pro Dev with Professional Extension

Example :
Username : Jahir
My Login ID : It1

I wants to get username: Jahir as a Stamp in documents.

jllort
Moderator
Moderator
Posts: 10910
Joined: Fri Dec 21, 2007 11:23 am
Location: Sineu - ( Illes Balears ) - Spain
Contact:

Re: How to get Username in Openkm Stamp instead of UserID

Post by jllort » Fri Aug 16, 2019 9:28 pm

As a customer of the professional edition you have the customer website to get direct support from us. The public forum is not the right place to ask for it.

Anyway in the script you should convert the userId to userName calling:

Code: Select all

String userId = "someUserId";
String userName = OKMAuth.getInstance().getName(null, "userId");
API information at: https://docs.openkm.com/kcenter/view/ok ... ml#getName

Post Reply