- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Get current user name in F.S in content creator
I tried this: #global.project.getUserService().getUser().getLoginName() but this returns "SYSTEM".
Why? What I would like to have is the current user.
I want to retrieve currently logged in user name
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I had the same requirement Aktueller FS-User รผber globale Systemvariable global im Contentcreator
kind regards
Marcel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
but i need code for same
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Write a executable where you get the current user.
The ClientScriptContext has a method "getUser".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
but unfortunately my complete code is written in HTML o/p channel.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
getting the user during generation time is not possible as the generation is not user/session specific. For example, the generated files are cached in the preview for a while, so it is not even guaranteed that a preview generation is performed at all when a user calls a preview page.
Could you describe your use case in more detail?
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Michael
We require only login user name in content creator. currently we're getting only "SYSTEM" with following API.
#global.project.getUserService().getUser().getLoginName()
#global.project.getUserService().getUser().getEMail()
#global.project.getUserService().getUser().getName()
#global.project.getUserService().getUser().getLDAPSection()
Regards Tanmay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Tanmay,
could you explain the purpose / scenario why and when you need the user name in CC? Maybe there is another solution than trying to use template syntax (which will not be successful).
Regards
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
write a executable like that
public final synchronized Object execute(Map<String, Object> params) {
ClientScriptContext context = params.get("context");
Map<String, String> returnMap = params.get("returnMap");
User user = context.getUser();
returnMap.put("userName", user.getLoginName());
}
This executable is callable from a FirstSpirit Script and also with WE_API.
kind regards
Marcel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
HI
Could please help me where should I write this & how to call this on HTML o/p channel?

