本文整理汇总了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);
}
}
示例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();
}