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


Java Note.getNoteIdentifier方法代码示例

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


在下文中一共展示了Note.getNoteIdentifier方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: save

import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
/**
    * @see org.kuali.rice.krad.service.NoteService#save(org.kuali.rice.krad.bo.Note)
    */
   @Override
public Note save(Note note) {
   	validateNoteNotNull(note);
   	if (StringUtils.isBlank(note.getRemoteObjectIdentifier())) {
   		throw new IllegalStateException("The remote object identifier must be established on a Note before it can be saved.  Given note had a null or empty remote object identifier.");
   	}
       if (note.getAttachment() != null && note.getAttachment().getAttachmentFileName() == null) {
           note.setAttachment(null);
       }
       if (note != null && note.getNoteIdentifier() == null && note.getAttachment() != null) {
           Attachment attachment = note.getAttachment();
           note.setAttachment(null);
           // store without attachment
           note = dataObjectService.save(note);
           attachment.setNoteIdentifier(note.getNoteIdentifier());
           // put attachment back
           note.setAttachment(attachment);
       }
       note = dataObjectService.save(note);
       // move attachment from pending directory
       if (note.getAttachment() != null) {
       	attachmentService.moveAttachmentWherePending(note);
       }
       return note;
   }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:29,代码来源:NoteServiceImpl.java

示例2: deleteBONote

import org.kuali.rice.krad.bo.Note; //导入方法依赖的package包/类
/**
     * delete a note from the document
     *
     * @param mapping
     * @param form
     * @param request
     * @param response
     * @return ActionForward
     * @throws Exception
     */
    public ActionForward deleteBONote(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
        KualiDocumentFormBase kualiDocumentFormBase = (KualiDocumentFormBase) form;
        Document document = kualiDocumentFormBase.getDocument();


//        DataDictionary dataDictionary = getDataDictionaryService().getDataDictionary();
//        DocumentEntry entry = dataDictionary.getDocumentEntry(document.getClass().getName());

        // check authorization for adding notes
        //DocumentActionFlags flags = getDocumentActionFlags(document);
        //if (!kualiDocumentFormBase.getDocumentActions().containsKey(KRADConstants.KUALI_ACTION_CAN_ANNOTATE)) {
        //    buildAuthorizationException("annotate", document);
        //    return mapping.findForward(RiceConstants.MAPPING_BASIC);
        //}

        // ok to delete the note/attachment
        // derive the note property from the newNote on the form
        Note newNote = kualiDocumentFormBase.getNewNote();
        Note note = document.getNote(getLineToDelete(request));
        Attachment attachment = note.getAttachment();
        String attachmentTypeCode = null;
        if (attachment != null) {
            attachmentTypeCode = attachment.getAttachmentTypeCode();
        }
        String authorUniversalIdentifier = note.getAuthorUniversalIdentifier();
        if (!WebUtils.canDeleteNoteAttachment(document, attachmentTypeCode, authorUniversalIdentifier)) {
            throw buildAuthorizationException("annotate", document);
        }

        if (attachment != null) { // only do this if the note has been persisted
            //KFSMI-798 - refresh() changed to refreshNonUpdateableReferences()
            //All references for the business object Attachment are auto-update="none",
            //so refreshNonUpdateableReferences() should work the same as refresh()
            if (note.getNoteIdentifier() != null) { // KULRICE-2343 don't blow away note reference if the note wasn't persisted
                attachment.refreshNonUpdateableReferences();
            }
            getAttachmentService().deleteAttachmentContents(attachment);
        }
        // Removed the if check so it no longer checks if the document is initiated before deleting the BO's note per KULRICE- 12327
        getNoteService().deleteNote(note);

        document.removeNote(note);
        if(!document.getDocumentHeader().getWorkflowDocument().isInitiated() && document instanceof MaintenanceDocument && NoteType.BUSINESS_OBJECT.getCode().equals(note.getNoteTypeCode())) {
            // If this is a maintenance document and we're deleting a BO note then try to save the document so the note is removed from the content
            getDocumentService().saveDocument(document);
        }
        return mapping.findForward(RiceConstants.MAPPING_BASIC);
    }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:59,代码来源:KualiDocumentActionBase.java


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