Hi All,
I have a requirement where i as a Superadmin will be allowing access to my features of customizations on the basis of the credential of Documentum . i.e. after identifying the Login Name of the currently logged in user.
As far as my current requirement of creating an IDF session through createSessionManager was concerned , i used the following approach.
private Boolean createSessionManager() { try { DfClientX clientx = new DfClientX(); IDfClient client = clientx.getLocalClient();IDfLoginInfo loginInfo = clientx.getLoginInfo();
String s = loginInfo.getUser();
System.out.println ("This is the value of getUser " + s); // Trying to getUserloginInfo.setUser("Myname"); loginInfo.setPassword("MyPassword"); m_sessionManager.setIdentity("documentum", loginInfo); return true; }
catch (Exception ex) { ex.printStackTrace();
return false; }
}
My attempt at the Sysout seen in the code resulted in no value being printed when i tried to utilize loginInfo.getUser.I am not sure whether the approach was right.I have been using my credentials 'hardcoded' to carry out my customizations. I need the currently logged in users credentials to avoid the hardcoding.
How can this be achieved?
As an attempt to track the username, i analysed the Login class through the java decompiler and found that the Login.CONTROL_USERNAME seen in the 'appintglogin.jsp' has the value of username in the class as:
public static final String CONTROL_USERNAME = "username";
So here are my questions :
1) Is my approach at getting/identifying the currently logged in user inside my Java behaviour class going in the right direction from the above steps? Or is there a class or method which will provide me the credentials?
2) Can there be a hint in any of the database tables that can provide me the Login name of the currently logged in user so that i can query it out through DQL?
Looking forward for your support as always.
Thanks & Regards
Vishnu S