本文整理汇总了Java中org.kuali.rice.kew.notes.Note类的典型用法代码示例。如果您正苦于以下问题:Java Note类的具体用法?Java Note怎么用?Java Note使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Note类属于org.kuali.rice.kew.notes包,在下文中一共展示了Note类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAuthorData
import org.kuali.rice.kew.notes.Note; //导入依赖的package包/类
private void getAuthorData(Note note) throws Exception {
Person user = null;
String id = "";
if (note != null && note.getNoteAuthorWorkflowId() != null && ! "".equalsIgnoreCase(note.getNoteAuthorWorkflowId())) {
user = KimApiServiceLocator.getPersonService().getPerson(note.getNoteAuthorWorkflowId());
id = note.getNoteAuthorWorkflowId();
}
if (user != null) {
note.setNoteAuthorFullName(user.getName());
note.setNoteAuthorEmailAddress(user.getEmailAddressUnmasked());
note.setNoteAuthorNetworkId(user.getPrincipalId());
} else {
note.setNoteAuthorFullName(id + " (Name not Available)");
note.setNoteAuthorEmailAddress("Not Available");
note.setNoteAuthorNetworkId("Not Available");
}
}
示例2: sortNotes
import org.kuali.rice.kew.notes.Note; //导入依赖的package包/类
private List<Note> sortNotes(List<Note> allNotes, String sortOrder) {
final int returnCode = KewApiConstants.Sorting.SORT_SEQUENCE_DSC.equalsIgnoreCase(sortOrder) ? -1 : 1;
try {
Collections.sort(allNotes,
new Comparator<Note>() {
@Override
public int compare(Note o1, Note o2) {
Timestamp date1 = o1.getNoteCreateDate();
Timestamp date2 = o2.getNoteCreateDate();
if (date1.before(date2)) {
return returnCode * -1;
} else if (date1.after(date2)) {
return returnCode;
} else {
return 0;
}
}
});
} catch (Throwable e) {
LOG.error(e.getMessage(), e);
}
return allNotes;
}
示例3: sortNotes
import org.kuali.rice.kew.notes.Note; //导入依赖的package包/类
/**
* Method added for notes editing function. Called by retrieveNoteList method
* @param allNotes
* @param sortOrder
* @return
*/
private List sortNotes(List allNotes, String sortOrder) {
final int returnCode = KewApiConstants.Sorting.SORT_SEQUENCE_DSC.equalsIgnoreCase(sortOrder) ? -1 : 1;
try {
Collections.sort(allNotes,
new Comparator() {
public int compare(Object o1, Object o2) {
Timestamp date1 = ((Note) o1).getNoteCreateDate();
Timestamp date2 = ((Note) o2).getNoteCreateDate();
if (date1.before(date2)) {
return returnCode * -1;
} else if (date1.after(date2)) {
return returnCode;
} else {
return 0;
}
}
});
} catch (Throwable e) {
LOG.error(e.getMessage(), e);
}
return allNotes;
}
示例4: getAuthorData
import org.kuali.rice.kew.notes.Note; //导入依赖的package包/类
/**
* Method added for notes editing function. Called by retrieveNoteList method
* @param note
* @throws Exception
*/
private void getAuthorData(Note note) throws Exception {
Person workflowUser = null;
String id = "";
if (note != null && note.getNoteAuthorWorkflowId() != null
&& !"".equalsIgnoreCase(note.getNoteAuthorWorkflowId())) {
workflowUser = KimApiServiceLocator.getPersonService().getPerson(note.getNoteAuthorWorkflowId());
id = note.getNoteAuthorWorkflowId();
}
if (workflowUser != null) {
note.setNoteAuthorFullName(workflowUser.getName());
note.setNoteAuthorEmailAddress(workflowUser.getEmailAddress());
note.setNoteAuthorNetworkId(workflowUser.getPrincipalName());
} else {
note.setNoteAuthorFullName(id + " (Name not Available)");
note.setNoteAuthorEmailAddress("Not Available");
note.setNoteAuthorNetworkId("Not Available");
}
}
示例5: deleteAttachment
import org.kuali.rice.kew.notes.Note; //导入依赖的package包/类
public ActionForward deleteAttachment(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
NoteForm noteForm = (NoteForm) form;
NoteService noteService = KEWServiceLocator.getNoteService();
Note note = noteService.getNoteByNoteId(noteForm.getNote().getNoteId());
noteService.deleteAttachment(note.getAttachments().remove(0));
noteForm.setDocId(note.getDocumentId());
noteForm.setNoteIdNumber(note.getNoteId());
edit(mapping, form, request, response);
return start(mapping, form, request, response);
//return mapping.findForward("allNotesReport");
}
示例6: edit
import org.kuali.rice.kew.notes.Note; //导入依赖的package包/类
public ActionForward edit(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
NoteForm noteForm = (NoteForm) form;
if ("yes".equalsIgnoreCase(noteForm.getShowEdit())) {
noteForm.setNoteIdNumber(noteForm.getNote().getNoteId());
} else {
noteForm.setShowEdit("yes");
Note noteToEdit = getNoteService().getNoteByNoteId(noteForm.getNoteIdNumber());
noteForm.setNote(noteToEdit);
noteForm.getNote().setNoteCreateLongDate(new Long(noteForm.getNote().getNoteCreateDate().getTime()));
}
retrieveNoteList(request, noteForm);
return start(mapping, form, request, response);
}
示例7: delete
import org.kuali.rice.kew.notes.Note; //导入依赖的package包/类
public ActionForward delete(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
NoteForm noteForm = (NoteForm) form;
Note existingNote = getNoteService().getNoteByNoteId(noteForm.getNoteIdNumber());
getNoteService().deleteNote(existingNote);
noteForm.setShowEdit("no");
noteForm.setNoteIdNumber(null);
retrieveNoteList(request, noteForm);
return start(mapping, form, request, response);
}
示例8: cancel
import org.kuali.rice.kew.notes.Note; //导入依赖的package包/类
public ActionForward cancel(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
NoteForm noteForm = (NoteForm) form;
noteForm.setShowEdit("no");
noteForm.setNote(new Note());
noteForm.setNoteIdNumber(null);
retrieveNoteList(request, noteForm);
return start(mapping, form, request, response);
}
示例9: saveNote
import org.kuali.rice.kew.notes.Note; //导入依赖的package包/类
public Note saveNote(Note note) {
try {
if (! note.getAttachments().isEmpty()){
for (Iterator iter = note.getAttachments().iterator(); iter.hasNext();) {
Attachment attachment = (Attachment) iter.next();
if (attachment.getAttachedObject()!= null){
attachmentService.persistAttachedFileAndSetAttachmentBusinessObjectValue(attachment);
}
}
}
return getDataObjectService().save(note);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
示例10: deleteNote
import org.kuali.rice.kew.notes.Note; //导入依赖的package包/类
public void deleteNote(Note note) {
try {
if (note != null && !note.getAttachments().isEmpty()){
for (Iterator iter = note.getAttachments().iterator(); iter.hasNext();) {
Attachment attachment = (Attachment) iter.next();
attachmentService.deleteAttachedFile(attachment);
}
}
if (note != null) {
getDataObjectService().delete(note);
}
} catch (Exception e) {
throw new RuntimeException("caught exception deleting attachment", e);
}
}
示例11: testNote
import org.kuali.rice.kew.notes.Note; //导入依赖的package包/类
@Test
public void testNote() throws Exception{
Note note = setupNote();
assertTrue("Note persisted correctly",note != null && StringUtils.isNotBlank(note.getNoteId()));
note.setNoteText("ModifiedText");
KRADServiceLocator.getDataObjectService().save(note);
note = KRADServiceLocator.getDataObjectService().find(Note.class,note.getNoteId());
assertTrue("Note persisted correctly",note != null && StringUtils.equals(note.getNoteText(), "ModifiedText"));
}
示例12: testNoteService
import org.kuali.rice.kew.notes.Note; //导入依赖的package包/类
@Test
public void testNoteService() throws Exception{
Note note = setupNote();
assertTrue("Note persisted correctly",note != null && StringUtils.isNotBlank(note.getNoteId()));
List<Note> notes = KEWServiceLocator.getNoteService().getNotesByDocumentId(TEST_DOC_ID);
assertTrue("getNotesByDocumentId fetched correctly",notes != null && notes.size() == 1);
}
示例13: testAttachment
import org.kuali.rice.kew.notes.Note; //导入依赖的package包/类
@Test
public void testAttachment() throws Exception {
Note note = setupNote();
Attachment attachment = setupAttachment(note);
note.getAttachments().add(attachment);
assertTrue("Attachment persisted correctly", attachment != null &&
StringUtils.isNotBlank(attachment.getAttachmentId()));
note = KEWServiceLocator.getNoteService().getNoteByNoteId(note.getNoteId());
assertTrue("Attachment fetched on note fetch",note != null && note.getAttachments() != null &&
note.getAttachments().size() == 1 &&
StringUtils.equals(note.getAttachments().get(0).getAttachmentId(),attachment.getAttachmentId()));
}
示例14: setupNote
import org.kuali.rice.kew.notes.Note; //导入依赖的package包/类
private Note setupNote(){
Note note = new Note();
note.setNoteText(NOTE_TXT);
note.setNoteAuthorWorkflowId("1");
note.setNoteCreateDate(new Timestamp(System.currentTimeMillis()));
note.setDocumentId(TEST_DOC_ID);
return KradDataServiceLocator.getDataObjectService().save(note);
}
示例15: setupAttachment
import org.kuali.rice.kew.notes.Note; //导入依赖的package包/类
private Attachment setupAttachment(Note note){
Attachment attachment = new Attachment();
attachment.setFileLoc("/testfile");
attachment.setMimeType("test");
attachment.setFileName("test.txt");
attachment.setNote(note);
return KRADServiceLocator.getDataObjectService().save(attachment, PersistenceOption.FLUSH);
}