{
// ok, here's the tricky part. We need to take this content,
// parse it into individual notes, and figure out which to
// change/delete/create. This could prove troublesome...
NoteHome noteHome = (NoteHome)CVUtility.getHomeObject("com.centraview.note.NoteHome", "Note");
Note noteRemote = (Note)noteHome.create();
noteRemote.setDataSource(dataSource);
NoteVO noteVO = new NoteVO();
// the "title" of the note will be the first 22 characters of the content,
// plus "...", unless the content is less than 22 characters, in which case
// it will be the same as the content...
String noteTitle = "";
if (noteContent.length() > 22)
{
noteTitle = noteContent.substring(0, 22) + "...";
}else{
noteTitle = noteContent;
}
noteVO.setTitle(noteTitle);
noteVO.setDetail(noteContent);
noteVO.setPriority(NoteVO.NP_MEDIUM);
noteVO.setCreatedBy(individualID);
noteVO.setOwner(individualID);
noteVO.setRelateEntity(individualVO.getEntityID());
noteVO.setRelateIndividual(contactID);
try
{
noteRemote.addNote(individualID, noteVO);
}catch(NoteException ne){
// TODO: clean up this NoteException handling
System.out.println("[Exception][ContactAdd] Note Exception caught!: " + ne);
//ne.printStackTrace();
}