0
votes

I need to Change Subject Of Out Of Office Message through Java. At the same time I wish to enable Out of Office through java. I tried something by myself like this :

Document dc = db.getProfileDocument("OutOfOfficeProfile", s.getUserName());
Vector vc = dc.getItems();
for(int i=0;i<vc.size();i++){
  Item it = (Item) vc.get(i);
  System.out.println(it.toString()+":::::::>>>>>>"
                   + dc.getItemValueString(it.toString()));
}

I got the Item names as :

$Name:::::::>>>>>>$profile_018outofofficeprofile_cn=sachin jain/o=tcsapp 
$UpdatedBy:::::::>>>>>>CN=Sachin Jain/O=TCSAPP
$NoPurge:::::::>>>>>> 
$ConflictAction:::::::>>>>>>2

I had searched for it a lot. I came across OutOfOffice Agent though Domino Designer. But I don't know how I can change the Subject and Body Of OOO Message and how can I enable it through Java?

1

1 Answers

2
votes

The OutOfOfficeProfile profile document contains all necessary data for the OutOfOffice agent to run. So if you change data in this profile document, the changes will be reflected when the OutOfOffice agent runs.

I suggest that you look at the OutOfOffice agent and see what fields it uses - and thereby what fields you need to modify to change the subject for the Out Of Office mail. A quick look in the agent tells me that the field GeneralSubject is used for the general OoO messages while the field SpecialSubject is used for the special OoO messages.

With Java you can change the profile data using the Document class (as you have alrady started to use). Remember to call dc.Save() when you change the NotesDocument fields.

With Java you can enable the agent using the Agent class and agent.setEnabled(true);.

Look in the Domino Designer Help database for more information on the classes, properties and methods.