1
votes

I am using Lotus Domino Java API for iNotes 8.5. I am able to create an meeting and add rooms, resources for the meeting request and send to all attendees from my Java program. But I have a problem while cancelling the meeting:

When I cancel the meeting, the calender entry is getting deleted from the calendar, but the rooms and resources are getting release.

Here is what I am trying to do for cancellation: option-1: 1. get the notes document from Database with the UNID 2. delete the document

option-2: 1. get the notes document from Database with UNID 2. remove rooms and resources from document 3. save document 4. remove document

After using the above two options, I am still seeing that resources are not getting released. Can some one please help me with a solution or idea's for resolving this issue.

Since the I am not able to release the rooms and resources programmatically, I have a over head of releasing the rooms manually every time the meeting is cancelled.

code I am using:

public boolean removeResources(Document d) throws Exception 
{ 
     if(null!= d.getItemValue("Room")) 
         d.removeItem("Room");
     if(null!= d.getItemValue("RequiredResources")) 
         d.removeItem("RequiredResources");
     return d.save(true); 
}
1
public boolean removeResources(Document d) throws Exception { if(null!= d.getItemValue("Room")) d.removeItem("Room"); if(null!= d.getItemValue("RequiredResources")) d.removeItem("RequiredResources"); return d.save(true); }Vinay Kumar
I have edited and added.Vinay Kumar

1 Answers

0
votes

I am not an expert with the C&E system in Domino but if you need to remove a field from a document in the method you're writing, then try this:

public boolean removeResources(Document d) throws NotesException 
{ 
    boolean bUpdated = false;
    if(d.hasItem("Room")) {
        d.removeItem("Room");
        bUpdated=true;
    }

    if(d.hasItem("RequiredResources")) {
        d.removeItem("RequiredResources");
        bUpdated=true;
    }

    if (bUpdated) {
        // something changed, so commit to document (d)
        if (d.save(true)) {
            return true;
        } else {
            return false;
        } 
    }else {
        // no changes therefore no resources were in the document, so return true anyway
        return true;
    }
}