当前位置: 首页>>代码示例>>Java>>正文


Java Note.setNotePostedTimestamp方法代码示例

本文整理汇总了Java中org.kuali.rice.krad.bo.Note.setNotePostedTimestamp方法的典型用法代码示例。如果您正苦于以下问题:Java Note.setNotePostedTimestamp方法的具体用法?Java Note.setNotePostedTimestamp怎么用?Java Note.setNotePostedTimestamp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.kuali.rice.krad.bo.Note的用法示例。


在下文中一共展示了Note.setNotePostedTimestamp方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:21,代码来源:DocumentServiceImpl.java

示例2: 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");
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:19,代码来源:NoteServiceTest.java

示例3: 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;
}
 
开发者ID:kuali,项目名称:kfs,代码行数:21,代码来源:TemProfileMaintainable.java

示例4: cancelQuote

import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
/**
 * Cancels the process of obtaining quotes. Checks whether any of the quote requests have been transmitted. If none have, tries
 * to obtain confirmation from the user for the cancellation. If confirmation is obtained, clears out the list of Vendors from
 * which to obtain quotes and writes the given reason to a note on the PO.
 *
 * @param mapping  An ActionMapping
 * @param form     An ActionForm
 * @param request  The HttpServletRequest
 * @param response The HttpServletResponse
 * @return An ActionForward
 * @throws Exception
 */
public ActionForward cancelQuote(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    PurchaseOrderForm poForm = (PurchaseOrderForm) form;
    PurchaseOrderDocument document = (PurchaseOrderDocument) poForm.getDocument();

    for (PurchaseOrderVendorQuote quotedVendors : document.getPurchaseOrderVendorQuotes()) {
        if (quotedVendors.getPurchaseOrderQuoteTransmitTimestamp() != null) {
            GlobalVariables.getMessageMap().putError(PurapPropertyConstants.VENDOR_QUOTES, PurapKeyConstants.ERROR_PURCHASE_ORDER_QUOTE_ALREADY_TRASNMITTED);

            return mapping.findForward(OLEConstants.MAPPING_BASIC);
        }
    }

    String message = SpringContext.getBean(ConfigurationService.class).getPropertyValueAsString(PurapKeyConstants.PURCHASE_ORDER_QUESTION_CONFIRM_CANCEL_QUOTE);
    Object question = request.getParameter(OLEConstants.QUESTION_INST_ATTRIBUTE_NAME);

    if (question == null) {

        // ask question if not already asked
        return performQuestionWithInput(mapping, form, request, response, PODocumentsStrings.CONFIRM_CANCEL_QUESTION, message, OLEConstants.CONFIRMATION_QUESTION, PODocumentsStrings.CONFIRM_CANCEL_RETURN, "");
    } else {
        Object buttonClicked = request.getParameter(OLEConstants.QUESTION_CLICKED_BUTTON);
        if ((PODocumentsStrings.CONFIRM_CANCEL_QUESTION.equals(question)) && ConfirmationQuestion.YES.equals(buttonClicked)) {
            String reason = request.getParameter(OLEConstants.QUESTION_REASON_ATTRIBUTE_NAME);

            if (StringUtils.isEmpty(reason)) {

                return performQuestionWithInputAgainBecauseOfErrors(mapping, form, request, response, PODocumentsStrings.CONFIRM_CANCEL_QUESTION, message, OLEConstants.CONFIRMATION_QUESTION, PODocumentsStrings.CONFIRM_CANCEL_RETURN, "", "", PurapKeyConstants.ERROR_PURCHASE_ORDER_REASON_REQUIRED, OLEConstants.QUESTION_REASON_ATTRIBUTE_NAME, "250");
            }
            document.getPurchaseOrderVendorQuotes().clear();
            Note cancelNote = new Note();
            cancelNote.setAuthorUniversalIdentifier(GlobalVariables.getUserSession().getPerson().getPrincipalId());
            String reasonPrefix = SpringContext.getBean(ConfigurationService.class).getPropertyValueAsString(PurapKeyConstants.PURCHASE_ORDER_CANCEL_QUOTE_NOTE_TEXT);
            cancelNote.setNoteText(reasonPrefix + reason);
            cancelNote.setNoteTypeCode(document.getNoteType().getCode());
            cancelNote.setNotePostedTimestamp(SpringContext.getBean(DateTimeService.class).getCurrentTimestamp());
            document.addNote(cancelNote);

            document.updateAndSaveAppDocStatus(PurapConstants.PurchaseOrderStatuses.APPDOC_IN_PROCESS);

            //being required to add notes about changing po status even though i'm not changing status
            document.setStatusChange(null);
            SpringContext.getBean(PurapService.class).saveDocumentNoValidation(document);
        }
    }

    return mapping.findForward(OLEConstants.MAPPING_BASIC);
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:60,代码来源:PurchaseOrderAction.java

示例5: cancelQuote

import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
/**
 * Cancels the process of obtaining quotes. Checks whether any of the quote requests have been transmitted. If none have, tries
 * to obtain confirmation from the user for the cancellation. If confirmation is obtained, clears out the list of Vendors from
 * which to obtain quotes and writes the given reason to a note on the PO.
 *
 * @param mapping An ActionMapping
 * @param form An ActionForm
 * @param request The HttpServletRequest
 * @param response The HttpServletResponse
 * @throws Exception
 * @return An ActionForward
 */
public ActionForward cancelQuote(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    PurchaseOrderForm poForm = (PurchaseOrderForm) form;
    PurchaseOrderDocument document = (PurchaseOrderDocument) poForm.getDocument();

    for (PurchaseOrderVendorQuote quotedVendors : document.getPurchaseOrderVendorQuotes()) {
        if (quotedVendors.getPurchaseOrderQuoteTransmitTimestamp() != null) {
            GlobalVariables.getMessageMap().putError(PurapPropertyConstants.VENDOR_QUOTES, PurapKeyConstants.ERROR_PURCHASE_ORDER_QUOTE_ALREADY_TRASNMITTED);

            return mapping.findForward(KFSConstants.MAPPING_BASIC);
        }
    }

    String message = SpringContext.getBean(ConfigurationService.class).getPropertyValueAsString(PurapKeyConstants.PURCHASE_ORDER_QUESTION_CONFIRM_CANCEL_QUOTE);
    Object question = request.getParameter(KFSConstants.QUESTION_INST_ATTRIBUTE_NAME);

    if (question == null) {

        // ask question if not already asked
        return performQuestionWithInput(mapping, form, request, response, PODocumentsStrings.CONFIRM_CANCEL_QUESTION, message, KFSConstants.CONFIRMATION_QUESTION, PODocumentsStrings.CONFIRM_CANCEL_RETURN, "");
    }
    else {
        Object buttonClicked = request.getParameter(KFSConstants.QUESTION_CLICKED_BUTTON);
        if ((PODocumentsStrings.CONFIRM_CANCEL_QUESTION.equals(question)) && ConfirmationQuestion.YES.equals(buttonClicked)) {
            String reason = request.getParameter(KFSConstants.QUESTION_REASON_ATTRIBUTE_NAME);

            if (StringUtils.isEmpty(reason)) {

                return performQuestionWithInputAgainBecauseOfErrors(mapping, form, request, response, PODocumentsStrings.CONFIRM_CANCEL_QUESTION, message, KFSConstants.CONFIRMATION_QUESTION, PODocumentsStrings.CONFIRM_CANCEL_RETURN, "", "", PurapKeyConstants.ERROR_PURCHASE_ORDER_REASON_REQUIRED, KFSConstants.QUESTION_REASON_ATTRIBUTE_NAME, "250");
            }
            document.getPurchaseOrderVendorQuotes().clear();
            Note cancelNote = new Note();
            cancelNote.setAuthorUniversalIdentifier(GlobalVariables.getUserSession().getPerson().getPrincipalId());
            String reasonPrefix = SpringContext.getBean(ConfigurationService.class).getPropertyValueAsString(PurapKeyConstants.PURCHASE_ORDER_CANCEL_QUOTE_NOTE_TEXT);
            cancelNote.setNoteText(reasonPrefix + reason);
            cancelNote.setNoteTypeCode(document.getNoteType().getCode());
            cancelNote.setNotePostedTimestamp(SpringContext.getBean(DateTimeService.class).getCurrentTimestamp());
            document.addNote(cancelNote);

            document.updateAndSaveAppDocStatus(PurapConstants.PurchaseOrderStatuses.APPDOC_IN_PROCESS);

            // being required to add notes about changing po status even though i'm not changing status
            document.setStatusChange(null);
            SpringContext.getBean(PurapService.class).saveDocumentNoValidation(document);
        }
    }

    return mapping.findForward(KFSConstants.MAPPING_BASIC);
}
 
开发者ID:kuali,项目名称:kfs,代码行数:61,代码来源:PurchaseOrderAction.java


注:本文中的org.kuali.rice.krad.bo.Note.setNotePostedTimestamp方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。