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


Java Document.getClass方法代码示例

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


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

示例1: loadNotes

import org.kuali.rice.krad.document.Document; //导入方法依赖的package包/类
/**
 * Loads the Notes for the note target on this Document.
 *
 * @param document the document for which to load the notes
 */
protected void loadNotes(final Document document) {
    if (isNoteTargetReady(document)) {
        Object legacyObjectClass;
        if (document instanceof MaintenanceDocument) {
            MaintenanceDocument mdoc = (MaintenanceDocument) document;
            legacyObjectClass = ((Maintainable) org.apache.commons.lang.ObjectUtils.defaultIfNull(mdoc.getOldMaintainableObject(), mdoc.getNewMaintainableObject())).getDataObjectClass();
        } else {
            legacyObjectClass = document.getClass();
        }

        List<Note> notes = new ArrayList<Note>();
        if (StringUtils.isNotBlank(document.getNoteTarget().getObjectId())) {
            notes.addAll(getNoteService().getByRemoteObjectId(document.getNoteTarget().getObjectId()));
        }
        //notes created on 'disapprove' are linked to Doc Header, so this checks that even if notetype = BO
        if (document.getNoteType().equals(NoteType.BUSINESS_OBJECT) && document.getDocumentHeader()
                .getWorkflowDocument().isDisapproved()) {
            notes.addAll(getNoteService().getByRemoteObjectId(document.getDocumentHeader().getObjectId()));
        }

        document.setNotes(notes);
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:29,代码来源:DocumentServiceImpl.java

示例2: isAddHocRoutePersonValid

import org.kuali.rice.krad.document.Document; //导入方法依赖的package包/类
/**
 * Verifies that the adHocRoutePerson's fields are valid - it does required and format checks.
 *
 * @param person
 * @return boolean True if valid, false otherwise.
 */
public boolean isAddHocRoutePersonValid(Document document, AdHocRoutePerson person) {
    MessageMap errorMap = GlobalVariables.getMessageMap();

    // new recipients are not embedded in the error path; existing lines should be
    if (errorMap.getErrorPath().size() == 0) {
        // add the error path keys on the stack
        errorMap.addToErrorPath(KRADConstants.NEW_AD_HOC_ROUTE_PERSON_PROPERTY_NAME);
    }

    String actionRequestedCode = person.getActionRequested();
    if (StringUtils.isNotBlank(person.getId())) {
        Person user = getPersonService().getPersonByPrincipalName(person.getId());

        if (user == null) {
            GlobalVariables.getMessageMap().putError(KRADPropertyConstants.ID,
                    RiceKeyConstants.ERROR_INVALID_ADHOC_PERSON_ID);
        } 
        else if (!getPermissionService().hasPermission(user.getPrincipalId(),
                KimConstants.KIM_TYPE_DEFAULT_NAMESPACE, KimConstants.PermissionNames.LOG_IN)) {
            GlobalVariables.getMessageMap().putError(KRADPropertyConstants.ID,
                    RiceKeyConstants.ERROR_INACTIVE_ADHOC_PERSON_ID);
        }
        else if(this.isAdHocRouteCompletionToInitiator(document, user, actionRequestedCode)){
            // KULRICE-7419: Adhoc route completion validation rule (should not route to initiator for completion)
            GlobalVariables.getMessageMap().putError(KRADPropertyConstants.ID,
                    RiceKeyConstants.ERROR_ADHOC_COMPLETE_PERSON_IS_INITIATOR);
        } 
        else if(StringUtils.equals(actionRequestedCode, KewApiConstants.ACTION_REQUEST_COMPLETE_REQ) && this.hasAdHocRouteCompletion(document, person)){
            // KULRICE-8760: Multiple complete adhoc requests should not be allowed on the same document
            GlobalVariables.getMessageMap().putError(KRADPropertyConstants.ID,
                    RiceKeyConstants.ERROR_ADHOC_COMPLETE_MORE_THAN_ONE);
        }
        else {
            Class docOrBoClass = null;
            if (document instanceof MaintenanceDocument) {
                docOrBoClass = ((MaintenanceDocument) document).getNewMaintainableObject().getDataObjectClass();
            } else {
                docOrBoClass = document.getClass();
            }

            if (!getDocumentDictionaryService().getDocumentAuthorizer(document).canReceiveAdHoc(document, user, actionRequestedCode)) {
                GlobalVariables.getMessageMap().putError(KRADPropertyConstants.ID,
                        RiceKeyConstants.ERROR_UNAUTHORIZED_ADHOC_PERSON_ID);
            }
        }
    } else {
        GlobalVariables.getMessageMap().putError(KRADPropertyConstants.ID,
                RiceKeyConstants.ERROR_MISSING_ADHOC_PERSON_ID);
    }

    // drop the error path keys off now
    errorMap.removeFromErrorPath(KRADConstants.NEW_AD_HOC_ROUTE_PERSON_PROPERTY_NAME);

    return GlobalVariables.getMessageMap().hasNoErrors();
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:62,代码来源:DocumentRuleBase.java


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