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


Java Note.setEditingNote方法代码示例

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


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

示例1: retrieveNoteList

import org.kuali.rice.kew.notes.Note; //导入方法依赖的package包/类
private void retrieveNoteList(HttpServletRequest request, NoteForm noteForm) throws Exception {
        if (noteForm.getDocId() != null) {
//            List allNotes = getNoteService().getNotesByDocumentId(noteForm.getDocId());

            CustomNoteAttribute customNoteAttribute = null;
            flushDocumentHeaderCache();
            DocumentRouteHeaderValue routeHeader = getRouteHeaderService().getRouteHeader(noteForm.getDocId());

            List<Note> allNotes = routeHeader.getNotes();
            boolean canAddNotes = false;
            if (routeHeader != null) {
                customNoteAttribute = routeHeader.getCustomNoteAttribute();
                if (customNoteAttribute != null) {
                    customNoteAttribute.setUserSession(GlobalVariables.getUserSession());
                    canAddNotes = customNoteAttribute.isAuthorizedToAddNotes();
                }
            }
            Iterator<Note> notesIter = allNotes.iterator();
            while (notesIter.hasNext()) {
                Note singleNote = notesIter.next();
                singleNote.setNoteCreateLongDate(new Long(singleNote.getNoteCreateDate().getTime()));
                getAuthorData(singleNote);
                boolean canEditNote = false;
                if (customNoteAttribute != null) {
                	canEditNote = customNoteAttribute.isAuthorizedToEditNote(singleNote);
                }
                singleNote.setAuthorizedToEdit(new Boolean(canEditNote));
                // KULRICE-5201 - added StringUtils.equals to check equally since this is no longer a numeric (int) comparison
                if (StringUtils.equals(noteForm.getNoteIdNumber(), singleNote.getNoteId())) {
                    singleNote.setEditingNote(Boolean.TRUE);
                }
            }
            if (noteForm.getSortNotes() != null && noteForm.getSortNotes().booleanValue()) {
                if (KewApiConstants.Sorting.SORT_SEQUENCE_DSC.equalsIgnoreCase(noteForm.getSortOrder())) {
                    noteForm.setSortOrder(KewApiConstants.Sorting.SORT_SEQUENCE_ASC);
                    noteForm.setSortNotes(Boolean.FALSE);
                } else {
                    noteForm.setSortOrder(KewApiConstants.Sorting.SORT_SEQUENCE_DSC);
                    noteForm.setSortNotes(Boolean.FALSE);
                }
            } else {
                noteForm.setSortOrder(noteForm.getSortOrder());
            }
            noteForm.setNoteList(sortNotes(allNotes, noteForm.getSortOrder()));
            noteForm.setNumberOfNotes(new Integer(allNotes.size()));
            noteForm.setAuthorizedToAdd(new Boolean(canAddNotes));
            noteForm.setShowAdd(Boolean.TRUE);
            if (! canAddNotes) {
                noteForm.setShowAdd(Boolean.FALSE);
            } else if (noteForm.getNoteList().size() == 0) {
                noteForm.setShowAdd(Boolean.FALSE);
            }

            EntityManager entityManager = (EntityManager) GlobalResourceLoader.getService("rice.kew.entityManager");
            entityManager.detach(routeHeader);
        }
    }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:58,代码来源:NoteAction.java

示例2: retrieveNoteList

import org.kuali.rice.kew.notes.Note; //导入方法依赖的package包/类
/**
 * Method added for notes editing function. Retrieve Note Listing from Route Header and put that
 * in EdocLiteForm.
 * @param request
 * @param noteForm
 * @throws Exception
 */

private void retrieveNoteList(NoteForm form, EDLContext edlContext) throws Exception {
    if (form.getDocId() != null) {
        List allNotes = getNoteService().getNotesByDocumentId(form.getDocId());
        CustomNoteAttribute customNoteAttribute = null;
        DocumentRouteHeaderValue routeHeader = getRouteHeaderService().getRouteHeader(form.getDocId());
        boolean canAddNotes = false;
        if (routeHeader != null) {
            customNoteAttribute = routeHeader.getCustomNoteAttribute();
            if (customNoteAttribute != null) {
                customNoteAttribute.setUserSession(edlContext.getUserSession());
                canAddNotes = customNoteAttribute.isAuthorizedToAddNotes();
            }
        }
        Iterator notesIter = allNotes.iterator();
        while (notesIter.hasNext()) {
            Note singleNote = (Note) notesIter.next();
            singleNote.setNoteCreateLongDate(new Long(singleNote.getNoteCreateDate().getTime()));
            getAuthorData(singleNote);
            boolean canEditNote = false;
            if (customNoteAttribute != null) {
                canEditNote = customNoteAttribute.isAuthorizedToEditNote(singleNote);
            }
            singleNote.setAuthorizedToEdit(Boolean.valueOf(canEditNote));
            if (form.getNoteIdNumber() != null
                    && (StringUtils.equals(form.getNoteIdNumber(), singleNote.getNoteId()))) {
                singleNote.setEditingNote(Boolean.TRUE);
            }
        }
        if (form.getSortNotes() != null && form.getSortNotes().booleanValue()) {
            if (KewApiConstants.Sorting.SORT_SEQUENCE_DSC.equalsIgnoreCase(form.getSortOrder())) {
                form.setSortOrder(KewApiConstants.Sorting.SORT_SEQUENCE_ASC);
                form.setSortNotes(Boolean.FALSE);
            } else {
                form.setSortOrder(KewApiConstants.Sorting.SORT_SEQUENCE_DSC);
                form.setSortNotes(Boolean.FALSE);
            }
        } else {
            form.setSortOrder(form.getSortOrder());
        }
        form.setNoteList(sortNotes(allNotes, form.getSortOrder()));
        form.setNumberOfNotes(new Integer(allNotes.size()));
        form.setAuthorizedToAdd(new Boolean(canAddNotes));
        form.setShowAdd(Boolean.TRUE);
        if (!canAddNotes) {
            form.setShowAdd(Boolean.FALSE);
        } else if (form.getNoteList().size() == 0) {
            //form.setShowAdd(Boolean.TRUE);
        }
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:59,代码来源:NoteConfigComponent.java

示例3: retrieveNoteList

import org.kuali.rice.kew.notes.Note; //导入方法依赖的package包/类
private void retrieveNoteList(HttpServletRequest request, NoteForm noteForm) throws Exception {
        if (noteForm.getDocId() != null) {
//            List allNotes = getNoteService().getNotesByDocumentId(noteForm.getDocId());

            CustomNoteAttribute customNoteAttribute = null;
            DocumentRouteHeaderValue routeHeader = getRouteHeaderService().getRouteHeader(noteForm.getDocId());

            List<Note> allNotes = routeHeader.getNotes();
            boolean canAddNotes = false;
            if (routeHeader != null) {
                customNoteAttribute = routeHeader.getCustomNoteAttribute();
                if (customNoteAttribute != null) {
                    customNoteAttribute.setUserSession(GlobalVariables.getUserSession());
                    canAddNotes = customNoteAttribute.isAuthorizedToAddNotes();
                }
            }
            Iterator<Note> notesIter = allNotes.iterator();
            while (notesIter.hasNext()) {
                Note singleNote = notesIter.next();
                singleNote.setNoteCreateLongDate(new Long(singleNote.getNoteCreateDate().getTime()));
                getAuthorData(singleNote);
                boolean canEditNote = false;
                if (customNoteAttribute != null) {
                	canEditNote = customNoteAttribute.isAuthorizedToEditNote(singleNote);
                }
                singleNote.setAuthorizedToEdit(new Boolean(canEditNote));
                // KULRICE-5201 - added StringUtils.equals to check equally since this is no longer a numeric (int) comparison
                if (StringUtils.equals(noteForm.getNoteIdNumber(), singleNote.getNoteId())) {
                    singleNote.setEditingNote(Boolean.TRUE);
                }
            }
            if (noteForm.getSortNotes() != null && noteForm.getSortNotes().booleanValue()) {
                if (KewApiConstants.Sorting.SORT_SEQUENCE_DSC.equalsIgnoreCase(noteForm.getSortOrder())) {
                    noteForm.setSortOrder(KewApiConstants.Sorting.SORT_SEQUENCE_ASC);
                    noteForm.setSortNotes(Boolean.FALSE);
                } else {
                    noteForm.setSortOrder(KewApiConstants.Sorting.SORT_SEQUENCE_DSC);
                    noteForm.setSortNotes(Boolean.FALSE);
                }
            } else {
                noteForm.setSortOrder(noteForm.getSortOrder());
            }
            noteForm.setNoteList(sortNotes(allNotes, noteForm.getSortOrder()));
            noteForm.setNumberOfNotes(new Integer(allNotes.size()));
            noteForm.setAuthorizedToAdd(new Boolean(canAddNotes));
            noteForm.setShowAdd(Boolean.TRUE);
            if (! canAddNotes) {
                noteForm.setShowAdd(Boolean.FALSE);
            } else if (noteForm.getNoteList().size() == 0) {
                noteForm.setShowAdd(Boolean.FALSE);
            }
        }
    }
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:54,代码来源:NoteAction.java


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