Getting user name from Java/CORBA classe

Hi All,

I am trying to get the user name from JAVA/CORBA classes of Lotus Domino. First see my sceanrio, I am logged in to server using a user account, and providing dbFileName(ie mailfile of user). I want to find out that this dbFile’s actul owner ie username of that user.

Any help will be appreciated.

–Gaurav

Subject: Getting user name from Java/CORBA classe.

Hello Gaurav,

You can get it using profile document “CalendarProfile” and the field name is “Owner”(names field).

Document doc = db.getProfileDocument

  ("CalendarProfile", "UserName");

  String who = doc.getItemValueString("owner");

Hope it helps.

Best Regards,

Subject: RE: Getting user name from Java/CORBA classe.

Hi Munish,

Can you tell some brief about profile document as I new to this concept. What is this ‘CalendarProfile’ and ‘UserName’. Actually what values should I pass here.

Sorry if it seems silly questions but plz help me out.

Thanks,

Gaurav Daga

Subject: RE: Getting user name from Java/CORBA classe.

Hi Gaurav,

Profile documents are useful for collecting user-specific or database-specific values. Only one profile document per form can exist for each user of a database. Or, only one profile document can exist for a database if that form is available to all users. Profile documents allow for quick data retrieval, because they are cached while the database that stores them is open. Profile documents are like other database documents except they are somewhat invisible – they do not display in views and are not included in a document count for the database.

Calenderprofile is a profile document for mail database. It contains the field called “Owner” which lists down the name of the mail file owner.

Username will be the name of the person, whose mail file you want to access. eg. Session.getUserName()

Hope this helps.

Best Regards,

Munish Kaushik

Subject: RE: Getting user name from Java/CORBA classe.

Hi Munish,

It really helped me alots.

Thanks for your kind support. I would like to be in touch with you, you can reach me at togauravdaga@gmail.com.

BRgds,

Gaurav Daga

Subject: RE: Getting user name from Java/CORBA classe.

Hi Munish,

It really helped me alots.

Thanks for your kind support. I would like to be in touch with you, you can reach me at togauravdaga@gmail.com.

BRgds,

Gaurav Daga

Subject: RE: Getting user name from Java/CORBA classe.

Hi Munish,

One proble you can say ambiguity I am facing. I accessed profile document using

databse.getProfileDocumentCollection(“CalendarProfile”)

by using this I am able to get the document. But when I tried using the following code then it is throwing exception:

Document doc = database.getProfileDocument(“CalendarProfile”, session.getUserName());

		String who = doc.getItemValueString("owner");

		System.out.println(who);

Exception is showing message something like following:

NotesException: Notes error: You are not authorized to perform that operation (CalendarProfile)

This code I am trying to run from the delegated user account.

Dont know what is going wrong…? Plz help me out once more.

Thanks,

Gaurav

Subject: RE: Getting user name from Java/CORBA classe.

Hello Gaurav,

When you do getProfileDocCollection retreives a profile documents associated with a profile form. so when you do that it retrieves current user’s profile document and no errors. and when you try to retrieve getProfileDocument of a specific user, so it restricts you to perform that as you might not have sufficient rights to perform the operation.

Hope this helps…

Regards,

Munish Kaushik

Subject: RE: Getting user name from Java/CORBA classe.

Hi Munish,

One proble you can say ambiguity I am facing. I accessed profile document using

databse.getProfileDocumentCollection(“CalendarProfile”)

by using this I am able to get the document. But when I tried using the following code then it is throwing exception:

Document doc = database.getProfileDocument(“CalendarProfile”, session.getUserName());

		String who = doc.getItemValueString("owner");

		System.out.println(who);

Exception is showing message something like following:

NotesException: Notes error: You are not authorized to perform that operation (CalendarProfile)

This code I am trying to run from the delegated user account.

Dont know what is going wrong…? Plz help me out once more.

Thanks,

Gaurav