Creating appointment in another user's mail file

Hi Forum Members,

Well I am trying to create an appointment in another user’s mail file whose delegation rights I am having. Most of the things are working fine but not all, [:-)]

Problem which I am facing is what values I pass in to following fileds:

String username = s.getUserName();

doc.replaceItemValue(“Chair”, username);

doc.replaceItemValue(“Principal”, username);

If I supply the name of my current user then it appears like meeting, and if I pass the name of user who owns mail file then it worked fine (I tried by hard coding these values.)

Can anyone tell how can I get the name of the user who owns file. As I am logged in using the user account who is having delegated rights on this, so I dont know any mechanism to find out the name of user. I am using java-corba classes for creating appoitment.

I hope problem is clear to you. If require any clearification then plz let me know…

Thanks for you help in advance.

~Will Turner

Subject: Creating appointment in another user’s mail file…

Hello Will,

I found this one in my snippet db. Even if it’s not working correctly, I thnik it’ll be helpful.

idp

Dim ui As New NotesUIWorkspace

Dim s As New NotesSession

Dim db As NotesDatabase

Dim appt As NotesDocument

Dim start As NotesDateTime

Dim enddt As NotesDateTime



Set start = s.CreateDateTime("23.02.2006 04:00:00")

Set enddt = s.CreateDateTime("23.02.2006 20:00:00")



Const server = "notes-app-mail"

Const mailfile = "mailfile.nsf"





Set db = s.GetDatabase(server, mailfile, False)

Set appt = db.CreateDocument



appt.Form = "Appointment"

appt.Chair = "CN=Mike Dynamic/O=deltaalpha"

appt.AltChair = "CN=Mike Dynamic/O=deltaalpha"

appt.Principal = "CN=Mike Dynamic/O=deltaalpha" 

appt.SendTo = "CN=Mike Dynamic/O=deltaalpha" 

appt.Subject = "Project Kickoff

appt.AppendStartTime = start

Set appt.AppendEndTime = enddt

Set appt.EndDateTime = enddt

Set appt.CalendarDateTime = start

Set appt.StartDateTime = start

appt.AppointmentType = "2" 

appt.MeetingType = "1"

appt.Categories = "V"

Call appt.AppendItemValue("ExcludeFromView", "D")

Call appt.AppendItemValue("ExcludeFromView", "S")

Call appt.ComputeWithForm(True, False)

Call appt.Save(True, False)

Subject: Creating appointment in another user’s mail file…

Hi Will,It is possible get the owner of the Mail file using the profile document … named “CalendarProfile” and the field name is “Owner”(names field).

@GetProfileField ( “Owner”,“CalendarProfile”)

will return the Current owner of the database (this is confined only to the mail file).

~R,

Ramesh D.

Subject: RE: Creating appointment in another user’s mail file…

Hello Mr Ramesh D,

Thanks for your response.

Actually I am using JAVACORBA classes for communicating with Domino Server. Can you tell me the way to get the profile document using JAVA classes.

Thanks,

Will Turner

Subject: RE: Creating appointment in another user’s mail file…

Hello Mr Ramesh D,

Thanks for your response.

Actually I am using JAVACORBA classes for communicating with Domino Server. Can you tell me the way to get the profile document using JAVA classes.

Thanks,

Will Turner

Subject: RE: Creating appointment in another user’s mail file…

Hhi Will,

Try this,

Document doc = db.getProfileDocument

  ("CalenderProfile", "UserName");

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

Best Regards,

Munish Kaushik

Subject: RE: Creating appointment in another user’s mail file…

hey will did u get the solution…

Let me know as i am facing a similar problem.

Thanks,

Gaurav

Subject: RE: Creating appointment in another user’s mail file…

hey will did u get the solution…

Let me know as i am facing a similar problem.

Thanks,

Gaurav

Subject: RE: Creating appointment in another user’s mail file…

Hi Munish,

Thanks for your response.

I tried that but getting following exception:

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

at lotus.domino.NotesExceptionHelper.read(Unknown Source)

at lotus.domino.NotesExceptionHolder._read(Unknown Source)

at lotus.priv.CORBA.iiop.RepImpl.invoke(Unknown Source)

at lotus.priv.CORBA.portable.ObjectImpl._invoke(Unknown Source)

at lotus.domino.corba._IDatabaseStub.getProfileDocument(Unknown Source)

at lotus.domino.cso.Database.getProfileDocument(Unknown Source)

at Test.main(Test.java:77)

Let me know the possible reason for it.

Thanks,

Will Turner

Subject: Creating appointment in another user’s mail file…

Hello Will,

I found this one in my snippet db. Even if it’s not working correctly, I thnik it’ll be helpful.

idp

Dim ui As New NotesUIWorkspace

Dim s As New NotesSession

Dim db As NotesDatabase

Dim appt As NotesDocument

Dim start As NotesDateTime

Dim enddt As NotesDateTime



Set start = s.CreateDateTime("23.02.2006 04:00:00")

Set enddt = s.CreateDateTime("23.02.2006 20:00:00")



Const server = "notes-app-mail"

Const mailfile = "mailfile.nsf"





Set db = s.GetDatabase(server, mailfile, False)

Set appt = db.CreateDocument



appt.Form = "Appointment"

appt.Chair = "CN=Mike Dynamic/O=deltaalpha"

appt.AltChair = "CN=Mike Dynamic/O=deltaalpha"

appt.Principal = "CN=Mike Dynamic/O=deltaalpha" 

appt.SendTo = "CN=Mike Dynamic/O=deltaalpha" 

appt.Subject = "Project Kickoff

appt.AppendStartTime = start

Set appt.AppendEndTime = enddt

Set appt.EndDateTime = enddt

Set appt.CalendarDateTime = start

Set appt.StartDateTime = start

appt.AppointmentType = "2" 

appt.MeetingType = "1"

appt.Categories = "V"

Call appt.AppendItemValue("ExcludeFromView", "D")

Call appt.AppendItemValue("ExcludeFromView", "S")

Call appt.ComputeWithForm(True, False)

Call appt.Save(True, False)