本文整理汇总了Java中org.kuali.rice.krad.bo.Note.setNoteText方法的典型用法代码示例。如果您正苦于以下问题:Java Note.setNoteText方法的具体用法?Java Note.setNoteText怎么用?Java Note.setNoteText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.krad.bo.Note
的用法示例。
在下文中一共展示了Note.setNoteText方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createNoteFromDocument
import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
/**
* @see org.kuali.rice.krad.service.DocumentService#createNoteFromDocument(org.kuali.rice.krad.document.Document,
* java.lang.String)
*/
@Override
public Note createNoteFromDocument(Document document, String text) {
Note note = new Note();
note.setNotePostedTimestamp(getDateTimeService().getCurrentTimestamp());
note.setNoteText(text);
note.setNoteTypeCode(document.getNoteType().getCode());
GloballyUnique bo = document.getNoteTarget();
// TODO gah! this is awful
Person kualiUser = GlobalVariables.getUserSession().getPerson();
if (kualiUser == null) {
throw new IllegalStateException("Current UserSession has a null Person.");
}
return bo == null ? null : getNoteService().createNote(note, bo, kualiUser.getPrincipalId());
}
示例2: addMaintenanceLockedNotes
import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
protected void addMaintenanceLockedNotes(String documentNumber, Map<SubObjectCode, String> lockedSubObjects, String messageKey, PersistableBusinessObject noteParent, Note noteTemplate) {
for (Map.Entry<SubObjectCode, String> entry : lockedSubObjects.entrySet()) {
try {
SubObjectCode subObjCd = entry.getKey();
String subObjectString = subObjCd.getUniversityFiscalYear() + " - " + subObjCd.getChartOfAccountsCode() + " - " + subObjCd.getAccountNumber() + " - " + subObjCd.getFinancialObjectCode() + " - " + subObjCd.getFinancialSubObjectCode();
if (StringUtils.isNotBlank(subObjectString)) {
String noteTextTemplate = kualiConfigurationService.getPropertyValueAsString(messageKey);
String noteText = MessageFormat.format(noteTextTemplate, subObjectString, entry.getValue());
Note note = noteService.createNote(noteTemplate, noteParent, GlobalVariables.getUserSession().getPrincipalId());
note.setNoteText(noteText);
note.setNotePostedTimestampToCurrent();
noteService.save(note);
}
}
catch (Exception e) {
LOG.error("Unable to create/save notes for document " + documentNumber, e);
throw new RuntimeException("Unable to create/save notes for document " + documentNumber, e);
}
}
}
示例3: addMaintenanceLockedNotes
import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
protected void addMaintenanceLockedNotes(String documentNumber, Map<SubAccount, String> lockedSubAccounts, String messageKey, PersistableBusinessObject noteParent, Note noteTemplate) {
for (Map.Entry<SubAccount, String> entry : lockedSubAccounts.entrySet()) {
try {
SubAccount subAccount = entry.getKey();
String subAccountString = subAccount.getChartOfAccountsCode() + " - " + subAccount.getAccountNumber() + " - " + subAccount.getSubAccountNumber();
if (StringUtils.isNotBlank(subAccountString)) {
String noteTextTemplate = kualiConfigurationService.getPropertyValueAsString(messageKey);
String noteText = MessageFormat.format(noteTextTemplate, subAccountString, entry.getValue());
Note note = noteService.createNote(noteTemplate, noteParent, GlobalVariables.getUserSession().getPrincipalId());
note.setNoteText(noteText);
noteService.save(note);
}
}
catch (Exception e) {
LOG.error("Unable to create/save notes for document " + documentNumber, e);
throw new RuntimeException("Unable to create/save notes for document " + documentNumber, e);
}
}
}
示例4: buildNote
import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
/**
* Builds a note
* @param description a description to put into the message of the note
* @param messageKey the key of the note text in ApplicationResources.properties
* @param noteTemplate the template for the note
* @param noteParent the thing to stick the note on
* @return the built note
*/
protected Note buildNote(String description, String messageKey, Note noteTemplate, PersistableBusinessObject noteParent) {
Note note = null;
try {
final String noteTextTemplate = kualiConfigurationService.getPropertyValueAsString(messageKey);
final String noteText = MessageFormat.format(noteTextTemplate, description);
note = noteService.createNote(noteTemplate, noteParent, GlobalVariables.getUserSession().getPrincipalId());
note.setNoteText(noteText);
}
catch (Exception e) {
// noteService.createNote throws *Exception*???
// weak!!
throw new RuntimeException("Cannot create note", e);
}
return note;
}
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:24,代码来源:OrganizationReversionDetailTrickleDownInactivationServiceImpl.java
示例5: isVendorContractExpired
import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
/**
* @see org.kuali.kfs.vnd.document.service.VendorService#isVendorContractExpired(org.kuali.rice.krad.document.Document, java.lang.Integer, org.kuali.kfs.vnd.businessobject.VendorDetail)
*/
@Override
public boolean isVendorContractExpired(Document document, Integer vendorContractGeneratedIdentifier, VendorDetail vendorDetail) {
boolean isExpired = false;
if (ObjectUtils.isNotNull(vendorContractGeneratedIdentifier)) {
VendorContract vendorContract = SpringContext.getBean(BusinessObjectService.class).findBySinglePrimaryKey(VendorContract.class, vendorContractGeneratedIdentifier);
Date currentDate = SpringContext.getBean(DateTimeService.class).getCurrentSqlDate();
List<Note> notes = document.getNotes();
if ((currentDate.compareTo(vendorContract.getVendorContractEndDate()) > 0 && (vendorContract.getVendorContractExtensionDate() == null || currentDate.compareTo(vendorContract.getVendorContractExtensionDate()) > 0)) || !vendorContract.isActive()) {
Note newNote = new Note();
newNote.setNoteText("Vendor Contract: " + vendorContract.getVendorContractName() + " contract has expired contract end date.");
newNote.setNotePostedTimestampToCurrent();
newNote.setNoteTypeCode(KFSConstants.NoteTypeEnum.BUSINESS_OBJECT_NOTE_TYPE.getCode());
Note note = noteService.createNote(newNote, vendorDetail, GlobalVariables.getUserSession().getPrincipalId());
notes.add(note);
isExpired = true;
}
}
return isExpired;
}
示例6: isVendorContractExpired
import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
/**
* @see org.kuali.kfs.vnd.document.service.VendorService#isVendorContractExpired(org.kuali.kfs.vnd.businessobject.VendorDetail)
*/
@Override
public boolean isVendorContractExpired(Document document, VendorDetail vendorDetail) {
boolean isExpired = false;
Date currentDate = SpringContext.getBean(DateTimeService.class).getCurrentSqlDate();
List<VendorContract> vendorContracts = vendorDetail.getVendorContracts();
List<Note> notes = document.getNotes();
for (VendorContract vendorContract : vendorContracts) {
if (currentDate.compareTo(vendorContract.getVendorContractEndDate()) > 0 || !vendorContract.isActive()) {
Note newNote = new Note();
newNote.setNoteText("Vendor Contract: " + vendorContract.getVendorContractName() + " contract has expired contract end date.");
newNote.setNotePostedTimestampToCurrent();
newNote.setNoteTypeCode(OLEConstants.NoteTypeEnum.BUSINESS_OBJECT_NOTE_TYPE.getCode());
Note note = noteService.createNote(newNote, vendorDetail, GlobalVariables.getUserSession().getPrincipalId());
notes.add(note);
return true;
}
}
return isExpired;
}
示例7: addNoteForCommodityCodeToVendor
import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
/**
* Creates a note to be added to the Vendor Maintenance Document which is spawned from the PurchaseOrderDocument.
*
* @param maintainable
* @param documentNumber
* @param poID
*/
protected void addNoteForCommodityCodeToVendor(Maintainable maintainable, String documentNumber, Integer poID) {
Note newBONote = new Note();
newBONote.setNoteText("Change vendor document ID <" + documentNumber + ">. Document was automatically created from PO <" + poID + "> to add commodity codes used on this PO that were not yet assigned to this vendor.");
try {
newBONote = noteService.createNote(newBONote, maintainable.getBusinessObject(), GlobalVariables.getUserSession().getPrincipalId());
newBONote.setNotePostedTimestampToCurrent();
}
catch (Exception e) {
throw new RuntimeException("Caught Exception While Trying To Add Note to Vendor", e);
}
List<Note> noteList = noteService.getByRemoteObjectId(maintainable.getBusinessObject().getObjectId());
noteList.add(newBONote);
noteService.saveNoteList(noteList);
}
示例8: testNoteSave_LargePersonId
import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
/**
* tests saving notes
*
* @throws Exception
*/
@Test public void testNoteSave_LargePersonId() throws Exception {
Note note = new Note();
note.setAuthorUniversalIdentifier("superLongNameUsersFromWorkflow");
note.setNotePostedTimestamp(CoreApiServiceLocator.getDateTimeService().getCurrentTimestamp());
note.setNoteText("i like notes");
note.setRemoteObjectIdentifier("1209348109834u");
note.setNoteTypeCode(NoteType.BUSINESS_OBJECT.getCode());
try {
KRADServiceLocator.getNoteService().save(note);
} catch (Exception e) {
fail("Saving a note should not fail");
}
}
示例9: createVendorNote
import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
public void createVendorNote(VendorDetail vendorDetail, String vendorNote) {
try {
if (StringUtils.isNotBlank(vendorNote)) {
Note newBONote = new Note();
newBONote.setNoteText(vendorNote);
newBONote.setNotePostedTimestampToCurrent();
newBONote.setNoteTypeCode(KFSConstants.NoteTypeEnum.BUSINESS_OBJECT_NOTE_TYPE.getCode());
Note note = noteService.createNote(newBONote, vendorDetail, GlobalVariables.getUserSession().getPrincipalId());
noteService.save(note);
}
} catch (Exception e){
throw new RuntimeException("Problems creating note for Vendor " + vendorDetail);
}
}
示例10: createNote
import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
private Note createNote(String noteText, String noteTarget, String principalId) {
Note note = new Note();
note.setRemoteObjectIdentifier(noteTarget);
note.setNoteText(StringUtils.abbreviate(noteText,800));
note.setAuthorUniversalIdentifier(principalId);
note.setNotePostedTimestampToCurrent();
return note;
}
示例11: addNoteForCommodityCodeToVendor
import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
/**
* Creates a note to be added to the Vendor Maintenance Document which is spawned from the PurchaseOrderDocument.
*
* @param maintainable
* @param documentNumber
* @param poID
*/
protected void addNoteForCommodityCodeToVendor(Maintainable maintainable, String documentNumber, Integer poID) {
Note newBONote = new Note();
newBONote.setNoteText("Change vendor document ID <" + documentNumber + ">. Document was automatically created from PO <" + poID + "> to add commodity codes used on this PO that were not yet assigned to this vendor.");
try {
newBONote = noteService.createNote(newBONote, maintainable.getBusinessObject(), GlobalVariables.getUserSession().getPrincipalId());
newBONote.setNotePostedTimestampToCurrent();
} catch (Exception e) {
throw new RuntimeException("Caught Exception While Trying To Add Note to Vendor", e);
}
List<Note> noteList = noteService.getByRemoteObjectId(maintainable.getBusinessObject().getObjectId());
noteList.add(newBONote);
noteService.saveNoteList(noteList);
}
示例12: createVendorNote
import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
public void createVendorNote(VendorDetail vendorDetail, String vendorNote) {
try {
if (StringUtils.isNotBlank(vendorNote)) {
Note newBONote = new Note();
newBONote.setNoteText(vendorNote);
newBONote.setNotePostedTimestampToCurrent();
newBONote.setNoteTypeCode(OLEConstants.NoteTypeEnum.BUSINESS_OBJECT_NOTE_TYPE.getCode());
Note note = noteService.createNote(newBONote, vendorDetail, GlobalVariables.getUserSession().getPrincipalId());
noteService.save(note);
}
} catch (Exception e){
throw new RuntimeException("Problems creating note for Vendor " + vendorDetail);
}
}
示例13: getNewBoNoteForAdding
import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
/**
* creates a new bo note and sets the timestamp.
*
* @return a newly created note
*/
protected Note getNewBoNoteForAdding(String prefix) {
Note newBoNote = new Note();
newBoNote.setNoteText(prefix + " vendor document ID " + getDocumentNumber());
newBoNote.setNotePostedTimestampToCurrent();
try {
newBoNote = SpringContext.getBean(NoteService.class).createNote(newBoNote, this.getBusinessObject(), GlobalVariables.getUserSession().getPrincipalId());
}
catch (Exception e) {
throw new RuntimeException("Caught Exception While Trying To Add Note to Vendor", e);
}
return newBoNote;
}
示例14: addNoteForInvoiceReportFail
import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
protected void addNoteForInvoiceReportFail(ContractsGrantsInvoiceDocument document) {
Note note = new Note();
note.setNotePostedTimestampToCurrent();
note.setNoteText(configurationService.getPropertyValueAsString(ArKeyConstants.ERROR_FILE_UPLOAD_NO_PDF_FILE_SELECTED_FOR_SAVE));
note.setNoteTypeCode(KFSConstants.NoteTypeEnum.BUSINESS_OBJECT_NOTE_TYPE.getCode());
Person systemUser = personService.getPersonByPrincipalName(KFSConstants.SYSTEM_USER);
note = noteService.createNote(note, document.getNoteTarget(), systemUser.getPrincipalId());
noteService.save(note);
document.addNote(note);
}
示例15: addCustomerCreatedNote
import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
/**
* Reference getDocumentService.createNoteFromDocument
*
* This method creates a note on the maintenance doc indicating that a AR Customer record has been generated.
* @param temProfile
* @return
*/
protected Note addCustomerCreatedNote(TemProfile temProfile) {
String text = "AR Customer ID " + temProfile.getCustomer().getCustomerNumber() + " has been generated";
Note note = new Note();
note.setNotePostedTimestamp(SpringContext.getBean(DateTimeService.class).getCurrentTimestamp());
note.setVersionNumber(Long.valueOf(1));
note.setNoteText(text);
note.setNoteTypeCode(KFSConstants.NoteTypeEnum.BUSINESS_OBJECT_NOTE_TYPE.getCode());
Person kualiUser = GlobalVariables.getUserSession().getPerson();
note = getNoteService().createNote(note, temProfile, kualiUser.getPrincipalId());
return note;
}