1.18 ContactNotes on a Contact

ContactNotes provide the ability to add a list of notes to a contact. These notes operate as attachments on a contact. Each attachment has a unique id and creation date. Comments are also available and have been augmented with ContactNotes.

Getting contact notes can place a heavy load on the POA. In 8.0 SP2, the keyword (“noContactNotes”) was added to not get the contact notes when getting the personal address book items.

In GroupWise 8.0 SP3, it was decided to make the default be that contact notes are not returned. You must explicitly ask for the contact notes by putting “contactNotes” in the view.

1.18.1 Creation of a ContactNote

Below is a trace creating a ContactNote on an existing contact. The method modifyItemRequest is called with the id of the contact to modify.

<ns0:modifyItemRequest>
<ns0:id>48FEE952.domain1.po1.104.16A6163.1.4A.1@56:4847C63F.domain1.po1.104.16A6163.1.3.1@53</ns0:id>
<ns0:updates>
<ans1:add xmlns:ans1="http://schemas.novell.com/2005/01/GroupWise/types" xsi:type="ans1:Contact">
<ans1:version>0</ans1:version>
<ans1:contactNotes>
<ans1:contactNote>
<ans1:attachment>
<ans1:contentType>text/plain</ans1:contentType>
<ans1:size>0</ans1:size>
<ans1:data>QWRkaW5nlHZpYSBTT0FQIC0gMQ==</ans1:data>
</ans1:attachment>
</ans1:contactNote>
</ans1:contactNotes>
</ans1:add>
</ns0:updates>
<ns0:recurrenceAllInstances>0</ns0:recurrenceAllInstances>
</ns0:modifyItemRequest>

Below is Java code that demonstrates how to create a ContactNote:

private void addContactNote()
{
    ModifyItemResponse mRes = new ModifyItemResponse();
    ItemChanges iChanges = new ItemChanges();
    
    ContactNote[] gwContactNote = new ContactNote[1];
    ContactNotes gwContactNotes = new ContactNotes();
    Contact gwContact = new Contact();
    AttachmentItemInfo attachment = new AttachmentItemInfo();
    String sNote = new String("Adding via SOAP - 1");
    byte[] gwByte = new byte[sNote.length()+1];

    try
    {
     gwByte=new byte[sNote.length()+1];
    gwByte=sNote.getBytes("UTF8");
    }
    catch (UnsupportedEncodingException ex)
    }
      ex.printStackTrace();
    }

    attachment=new AttachmentItemInfo();
    attachment.setContentType("text/plain");
    attachment.setData(gwByte);

    gwContactNote[0]=new ContactNote();
    gwContactNote[0].setAttachment(attachment);
    gwContactNote.setContactNote(gwContactNote);
    gwContact.setContactNotes(gwContactNotes);
    iChanges.setAdd(gwContact);

    GetItemsResponse res=getContactNotes();

    try
    {
     mRes = m_gwMain.getGroupWiseService().modifyItemRequest(                            res.getItem().getItem()[0].getId(), null, iChanges,0,           m_gwMain.getGroupWiseServiceId(), false);
    }
    catch (RemoteException ex)
    {
      ex.printStackTrace();
    }
}

1.18.2 Modification of a ContactNote

Below is a trace modifying an existing ContactNote on a contact. Notice the contact id is just below the modifyitemrequest method call. The ContactNote id is in the updates > update > contactnotes > contactnote section.

<ns0:modifyItemRequest>
<ns0id>48FEE952.domain1.po1.104.16A6163.1.4A.1@56:4847C63F.domain1.po1.104.16A6163.1.3.1@53</ns0:id>
<ns0:updates>
<ans1:update xmlns:ans1="http://schemas.novell.com/2005/01/GroupWise/types" xsi:type="ans1:Contact">
<ans1:version>0</ans1:version>
<ans1:contactNotes>
<ans1:contactNote>
<ans1:id>4906DFDF.domain1.po1.100.16A6163.1.1413.1@2:A.domain1.po1.100.0.1.0.1@19</ans1:id>
<ans1:attachment>
<ans1:id itemReference="false">4906DFDF.domain1.po1.100.16A6163.1.1412.1@65</ans1:id>
<ans1:contentType>text/plain</ans1:contentType>
<ans1:size>0</ans1:size>
<ans1:data>TW9kaWZpY2F0aW9ulHZpYSBTT0FQIC0gMQ==</ans1:data>
</ans1:attachment>
</ans1:contactNote>
</ans1:contactNotes>
</ans1:update>
</ns0:updates>
</ns0:modifyItemRequest>

1.18.3 Deletion of a ContactNote

Below is a trace deleting an existing ContactNote on a contact. Notice the contact id is just below the modifyitemrequest method call. The ContactNote id is in the updates > delete > contactnotes > contactnote section.

<ns0:modifyItemRequest>
<ns0:id>48FEE952.domain1.po1.104.16A6163.1.4A.1@56:4847C63F.domain1.po1.104.16A6163.1.3.1@53</ns0:id>
<ns0:updates>
<ans1:delete xmlns:ans1="http://schemas.novell.com/2005/01/GroupWise/types" xsi:type="ans1:Contact">
<ans1:version>0</ans1:version>
<ans1:contactNotes>
<ans1:contactNote>
<ans1:id>4906DFDF.domain1.po1.100.16A6163.1.1413.1@2:A.domain1.po1.100.0.1.0.1@19</ans1:id>
</ans1:contactNote>
</ans1:contactNotes>
</ans1:delete>
</ns0:updates>
<ns0:recurrenceAllInstances>0</ns0:recurrenceAllInstances>
</ns0:modifyItemRequest>