• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java MaintenanceDocument类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.kuali.rice.kns.document.MaintenanceDocument的典型用法代码示例。如果您正苦于以下问题:Java MaintenanceDocument类的具体用法?Java MaintenanceDocument怎么用?Java MaintenanceDocument使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MaintenanceDocument类属于org.kuali.rice.kns.document包,在下文中一共展示了MaintenanceDocument类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: toggleInactiveRecordDisplay

import org.kuali.rice.kns.document.MaintenanceDocument; //导入依赖的package包/类
/**
 * Turns on (or off) the inactive record display for a maintenance collection.
 */
public ActionForward toggleInactiveRecordDisplay(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
	KualiMaintenanceForm maintenanceForm = (KualiMaintenanceForm) form;
	MaintenanceDocument document = (MaintenanceDocument) maintenanceForm.getDocument();
	Maintainable oldMaintainable = document.getOldMaintainableObject();
	Maintainable newMaintainable = document.getNewMaintainableObject();

	String collectionName = extractCollectionName(request, KRADConstants.TOGGLE_INACTIVE_METHOD);
	if (collectionName == null) {
		LOG.error("Unable to get find collection name in request.");
		throw new RuntimeException("Unable to get find collection class in request.");
	}  

	String parameterName = (String) request.getAttribute(KRADConstants.METHOD_TO_CALL_ATTRIBUTE);
	boolean showInactive = Boolean.parseBoolean(StringUtils.substringBetween(parameterName, KRADConstants.METHOD_TO_CALL_BOPARM_LEFT_DEL, "."));

	oldMaintainable.setShowInactiveRecords(collectionName, showInactive);
	newMaintainable.setShowInactiveRecords(collectionName, showInactive);

	return mapping.findForward(RiceConstants.MAPPING_BASIC);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:24,代码来源:KualiMaintenanceDocumentAction.java


示例2: clearPrimaryKeyFields

import org.kuali.rice.kns.document.MaintenanceDocument; //导入依赖的package包/类
/**
 * This method clears the value of the primary key fields on a Business Object.
 * 
 * @param document - document to clear the pk fields on
 */
   protected void clearPrimaryKeyFields(MaintenanceDocument document) {
	// get business object being maintained and its keys
	PersistableBusinessObject bo = document.getNewMaintainableObject().getBusinessObject();
	List<String> keyFieldNames = KRADServiceLocatorWeb.getLegacyDataAdapter().listPrimaryKeyFieldNames(bo.getClass());

	for (String keyFieldName : keyFieldNames) {
		try {
			ObjectUtils.setObjectProperty(bo, keyFieldName, null);
		}
		catch (Exception e) {
			LOG.error("Unable to clear primary key field: " + e.getMessage());
			throw new RuntimeException("Unable to clear primary key field: " + e.getMessage());
		}
	}
       bo.setObjectId(null);
       bo.setVersionNumber(new Long(1));
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:23,代码来源:KualiMaintenanceDocumentAction.java


示例3: processInactivationBlockChecking

import org.kuali.rice.kns.document.MaintenanceDocument; //导入依赖的package包/类
/**
 * Determines whether this document has been inactivation blocked
 *
 * @param maintenanceDocument
 * @return true iff there is NOTHING that blocks this record
 */
protected boolean processInactivationBlockChecking(MaintenanceDocument maintenanceDocument) {
    if (isDocumentInactivatingBusinessObject(maintenanceDocument)) {
        Class boClass = maintenanceDocument.getNewMaintainableObject().getDataObjectClass();
        Set<InactivationBlockingMetadata> inactivationBlockingMetadatas =
                ddService.getAllInactivationBlockingDefinitions(boClass);

        if (inactivationBlockingMetadatas != null) {
            for (InactivationBlockingMetadata inactivationBlockingMetadata : inactivationBlockingMetadatas) {
                // for the purposes of maint doc validation, we only need to look for the first blocking record

                // we found a blocking record, so we return false
                if (!processInactivationBlockChecking(maintenanceDocument, inactivationBlockingMetadata)) {
                    return false;
                }
            }
        }
    }
    return true;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:26,代码来源:MaintenanceDocumentRuleBase.java


示例4: validateMaintenanceDocument

import org.kuali.rice.kns.document.MaintenanceDocument; //导入依赖的package包/类
/**
 * This method checks to make sure the document is a valid maintenanceDocument, and has the necessary values
 * populated such that
 * it will not cause exceptions in later routing or business rules testing.
 *
 * This is not a business rules test.
 *
 * @param maintenanceDocument - document to be tested
 * @return whether maintenance doc passes
 * @throws org.kuali.rice.krad.exception.ValidationException
 *
 */
protected boolean validateMaintenanceDocument(MaintenanceDocument maintenanceDocument) {
    boolean success = true;
    Maintainable newMaintainable = maintenanceDocument.getNewMaintainableObject();

    // document must have a newMaintainable object
    if (newMaintainable == null) {
        throw new ValidationException(
                "Maintainable object from Maintenance Document '" + maintenanceDocument.getDocumentTitle() +
                        "' is null, unable to proceed.");
    }

    // document's newMaintainable must contain an object (ie, not null)
    if (newMaintainable.getDataObject() == null) {
        throw new ValidationException("Maintainable's component data object is null.");
    }

    return success;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:31,代码来源:MaintenanceDocumentRuleBase.java


示例5: setupBaseConvenienceObjects

import org.kuali.rice.kns.document.MaintenanceDocument; //导入依赖的package包/类
/**
 * @see org.kuali.rice.krad.rules.MaintenanceDocumentRule#setupBaseConvenienceObjects(org.kuali.rice.krad.maintenance.MaintenanceDocument)
 */
public void setupBaseConvenienceObjects(MaintenanceDocument document) {

    // setup oldAccount convenience objects, make sure all possible sub-objects are populated
    oldBo = document.getOldMaintainableObject().getDataObject();
    if (oldBo != null && oldBo instanceof PersistableBusinessObject) {
        ((PersistableBusinessObject) oldBo).refreshNonUpdateableReferences();
    }

    // setup newAccount convenience objects, make sure all possible sub-objects are populated
    newBo = document.getNewMaintainableObject().getDataObject();
    if (newBo instanceof PersistableBusinessObject) {
        ((PersistableBusinessObject) newBo).refreshNonUpdateableReferences();
    }

    boClass = document.getNewMaintainableObject().getDataObjectClass();

    // call the setupConvenienceObjects in the subclass, if a subclass exists
    setupConvenienceObjects();
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:23,代码来源:MaintenanceDocumentRuleBase.java


示例6: processAfterCopy

import org.kuali.rice.kns.document.MaintenanceDocument; //导入依赖的package包/类
/**
	 * Set the new collection records back to true so they can be deleted (copy
	 * should act like new)
	 *
	 * @see KualiMaintainableImpl#processAfterCopy()
	 */
	@Override
	public void processAfterCopy(MaintenanceDocument document, Map<String, String[]> parameters) {
		try {
			// This was the only remaining use of this method, as the operation with the wrapper
			// below is not necessarily safe to use in all situations, I am calling it here
			// from within the document code where we know it's safe:
			
			KradDataServiceLocator.getDataObjectService().wrap(businessObject).materializeReferencedObjectsToDepth(2
					, MaterializeOption.COLLECTIONS, MaterializeOption.UPDATE_UPDATABLE_REFS);
			
			KRADServiceLocatorWeb.getLegacyDataAdapter().setObjectPropertyDeep(businessObject, KRADPropertyConstants.NEW_COLLECTION_RECORD,
					boolean.class, true);
//			ObjectUtils.setObjectPropertyDeep(businessObject, KRADPropertyConstants.NEW_COLLECTION_RECORD,
//					boolean.class, true, 2);
		} catch (Exception e) {
			LOG.error("unable to set newCollectionRecord property: " + e.getMessage(), e);
			throw new RuntimeException("unable to set newCollectionRecord property: " + e.getMessage(), e);
		}
	}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:26,代码来源:KualiMaintainableImpl.java


示例7: validateMaintenanceRequiredFields

import org.kuali.rice.kns.document.MaintenanceDocument; //导入依赖的package包/类
/**
 * @see org.kuali.rice.kns.service.MaintenanceDocumentDictionaryService#validateMaintenanceRequiredFields(org.kuali.rice.krad.maintenance.MaintenanceDocument)
 */
public void validateMaintenanceRequiredFields(MaintenanceDocument document) {
    Maintainable newMaintainableObject = document.getNewMaintainableObject();
    if (newMaintainableObject == null) {
        LOG.error("New maintainable is null");
        throw new RuntimeException("New maintainable is null");
    }

    List<MaintainableSectionDefinition> maintainableSectionDefinitions = getMaintainableSections(getDocumentTypeName(newMaintainableObject.getBoClass()));
    for (MaintainableSectionDefinition maintainableSectionDefinition : maintainableSectionDefinitions) {
        for (MaintainableItemDefinition maintainableItemDefinition : maintainableSectionDefinition.getMaintainableItems()) {
            // validate fields
            if (maintainableItemDefinition instanceof MaintainableFieldDefinition) {
                validateMaintainableFieldRequiredFields((MaintainableFieldDefinition) maintainableItemDefinition, newMaintainableObject.getBusinessObject(), maintainableItemDefinition.getName());
            }
            // validate collections
            else if (maintainableItemDefinition instanceof MaintainableCollectionDefinition) {
                validateMaintainableCollectionsRequiredFields(newMaintainableObject.getBusinessObject(), (MaintainableCollectionDefinition) maintainableItemDefinition);
            }
        }
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:25,代码来源:MaintenanceDocumentDictionaryServiceImpl.java


示例8: validateMaintainableCollectionsAddLineRequiredFields

import org.kuali.rice.kns.document.MaintenanceDocument; //导入依赖的package包/类
/**
 * calls code to generate error messages if maintainableFields within any collections or sub-collections are marked as required
 * 
 * @param document
 * @param businessObject
 * @param collectionName
 * @param maintainableCollectionDefinition
 * @param depth
 */
private void validateMaintainableCollectionsAddLineRequiredFields(MaintenanceDocument document, PersistableBusinessObject businessObject, String collectionName, MaintainableCollectionDefinition maintainableCollectionDefinition, int depth) {
    if ( depth == 0 ) {
        GlobalVariables.getMessageMap().addToErrorPath("add");
    }
    // validate required fields on fields withing collection definition
    PersistableBusinessObject element = document.getNewMaintainableObject().getNewCollectionLine( collectionName );
    GlobalVariables.getMessageMap().addToErrorPath(collectionName);
    for (MaintainableFieldDefinition maintainableFieldDefinition : maintainableCollectionDefinition.getMaintainableFields()) {
        final String fieldName = maintainableFieldDefinition.getName();
        validateMaintainableFieldRequiredFields(maintainableFieldDefinition, element, fieldName);
        
    }

    GlobalVariables.getMessageMap().removeFromErrorPath(collectionName);
    if ( depth == 0 ) {
        GlobalVariables.getMessageMap().removeFromErrorPath("add");
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:28,代码来源:MaintenanceDocumentDictionaryServiceImpl.java


示例9: createNewKualiMaintenanceForm

import org.kuali.rice.kns.document.MaintenanceDocument; //导入依赖的package包/类
/**
 * Creates a KualiMaintenanceForm with the given rule template inside of its RuleBaseValues instance.
 * 
 * @param rtName The rule template to use.
 */
private void createNewKualiMaintenanceForm(String rtName) {
	// Initialize the required variables.
	final KualiMaintenanceForm kmForm = new KualiMaintenanceForm();
	final MaintenanceDocument maintDoc = new MaintenanceDocumentBase();
	final Maintainable oldMaint = new RoutingRuleMaintainable();
	final Maintainable newMaint = new RoutingRuleMaintainable();
	final RuleBaseValues rbValues = new RuleBaseValues();
	// Setup the rule base and the maintainables.
	rbValues.setRuleTemplate(KEWServiceLocator.getRuleTemplateService().findByRuleTemplateName(rtName));
	oldMaint.setBusinessObject(rbValues);
	oldMaint.setBoClass(rbValues.getClass());
	newMaint.setBusinessObject(rbValues);
	newMaint.setBoClass(rbValues.getClass());
	// Setup the maintenance document and the maintenance form.
	maintDoc.setOldMaintainableObject(oldMaint);
	maintDoc.setNewMaintainableObject(newMaint);
	kmForm.setDocument(maintDoc);
	KNSGlobalVariables.setKualiForm(kmForm);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:25,代码来源:RuleTemplateDefaultsTest.java


示例10: getSections

import org.kuali.rice.kns.document.MaintenanceDocument; //导入依赖的package包/类
/**
 * Override the getSections method on this maintainable so that the Section Containing the various Rule Attributes
 * can be dynamically generated based on the RuleTemplate which is selected.
 */
@Override
public List getSections(MaintenanceDocument document, Maintainable oldMaintainable) {
    // since the child lists are not repopulated upon loading the objects, we need to re-load them manually so the section
    // generation functions.
       if ( getNewRule(document) != null ) {   
           getNewRule(document).setRuleTemplate( getDataObjectService().find(RuleTemplateBo.class, getNewRule(document).getRuleTemplateId() ) );
       }
       
       if ( getOldRule(document) != null ) {   
           getOldRule(document).setRuleTemplate( getDataObjectService().find(RuleTemplateBo.class, getOldRule(document).getRuleTemplateId() ) );
       }

    List<Section> sections = super.getSections(document, oldMaintainable);
	return WebRuleUtils.customizeSections(getThisRule(), sections, false);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:20,代码来源:RoutingRuleMaintainable.java


示例11: validateMaintainableCollectionsForDuplicateEntries

import org.kuali.rice.kns.document.MaintenanceDocument; //导入依赖的package包/类
/**
 * default implementation checks for duplicats based on keys of objects only
 * 
 * @see org.kuali.rice.kns.service.MaintenanceDocumentDictionaryService#validateMaintainableCollectionsForDuplicateEntries(org.kuali.rice.krad.maintenance.MaintenanceDocument)
 */
public void validateMaintainableCollectionsForDuplicateEntries(MaintenanceDocument document) {
    Maintainable newMaintainableObject = document.getNewMaintainableObject();
    if (newMaintainableObject == null) {
        LOG.error("New maintainable is null");
        throw new RuntimeException("New maintainable is null");
    }

    List<MaintainableSectionDefinition> maintainableSectionDefinitions = getMaintainableSections(getDocumentTypeName(newMaintainableObject.getBoClass()));
    for (MaintainableSectionDefinition maintainableSectionDefinition : maintainableSectionDefinitions) {
        for (MaintainableItemDefinition maintainableItemDefinition : maintainableSectionDefinition.getMaintainableItems()) {
            // validate collections
            if (maintainableItemDefinition instanceof MaintainableCollectionDefinition) {
                validateMaintainableCollectionsForDuplicateEntries(newMaintainableObject.getBusinessObject(), (MaintainableCollectionDefinition) maintainableItemDefinition);
            }
        }
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:23,代码来源:MaintenanceDocumentDictionaryServiceImpl.java


示例12: processAfterCopy

import org.kuali.rice.kns.document.MaintenanceDocument; //导入依赖的package包/类
/**
 * Pre-populates the ID field of the new PermissionBo to be created.
 *
 * @see org.kuali.rice.kns.maintenance.KualiMaintainableImpl#saveBusinessObject()
 */
@Override
public void processAfterCopy(MaintenanceDocument document, Map<String, String[]> parameters) {
    super.processAfterCopy(document,parameters);

    GenericPermissionBo permissionBo = (GenericPermissionBo) document.getNewMaintainableObject().getDataObject();
    initializePermissionId(permissionBo);
    permissionBo.setVersionNumber(null);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:14,代码来源:GenericPermissionMaintainable.java


示例13: docHandler

import org.kuali.rice.kns.document.MaintenanceDocument; //导入依赖的package包/类
/**
 * Handles creating and loading of documents.
 */
@Override
public ActionForward docHandler(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
	ActionForward af = super.docHandler(mapping, form, request, response);
       if (af.getName().equals(KRADConstants.KRAD_INITIATED_DOCUMENT_VIEW_NAME))
       {
           return af;
       }
	KualiMaintenanceForm kualiMaintenanceForm = (KualiMaintenanceForm) form;

	if (KewApiConstants.ACTIONLIST_COMMAND.equals(kualiMaintenanceForm.getCommand()) || KewApiConstants.DOCSEARCH_COMMAND.equals(kualiMaintenanceForm.getCommand()) || KewApiConstants.SUPERUSER_COMMAND.equals(kualiMaintenanceForm.getCommand()) || KewApiConstants.HELPDESK_ACTIONLIST_COMMAND.equals(kualiMaintenanceForm.getCommand()) && kualiMaintenanceForm.getDocId() != null) {
		if (kualiMaintenanceForm.getDocument() instanceof MaintenanceDocument) {
			kualiMaintenanceForm.setReadOnly(true);
			kualiMaintenanceForm.setMaintenanceAction(((MaintenanceDocument) kualiMaintenanceForm.getDocument()).getNewMaintainableObject().getMaintenanceAction());

			//Retrieving the FileName from BO table
			Maintainable tmpMaintainable = ((MaintenanceDocument) kualiMaintenanceForm.getDocument()).getNewMaintainableObject();
			if(tmpMaintainable.getBusinessObject() instanceof PersistableAttachment) {
				PersistableAttachment bo = (PersistableAttachment) getBusinessObjectService().retrieve(tmpMaintainable.getBusinessObject());
                   if (bo != null) {
                       request.setAttribute("fileName", bo.getFileName());
                   }
			}
		}
		else {
			LOG.error("Illegal State: document is not a maintenance document");
			throw new IllegalArgumentException("Document is not a maintenance document");
		}
	}
	else if (KewApiConstants.INITIATE_COMMAND.equals(kualiMaintenanceForm.getCommand())) {
		kualiMaintenanceForm.setReadOnly(false);
		return setupMaintenance(mapping, form, request, response, KRADConstants.MAINTENANCE_NEW_ACTION);
	}
	else {
		LOG.error("We should never have gotten to here");
		throw new IllegalArgumentException("docHandler called with invalid parameters");
	}
	return mapping.findForward(RiceConstants.MAPPING_BASIC);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:42,代码来源:KualiMaintenanceDocumentAction.java


示例14: clearUnauthorizedNewFields

import org.kuali.rice.kns.document.MaintenanceDocument; //导入依赖的package包/类
/**
 * This method is used as part of the Copy functionality, to clear any field values that the user making the copy does not have
 * permissions to modify. This will prevent authorization errors on a copy.
 * 
 * @param document - document to be adjusted
 */
   protected void clearUnauthorizedNewFields(MaintenanceDocument document) {
	// get a reference to the current user
	Person user = GlobalVariables.getUserSession().getPerson();

	// get a new instance of MaintenanceDocumentAuthorizations for this context
	MaintenanceDocumentRestrictions maintenanceDocumentRestrictions = getBusinessObjectAuthorizationService().getMaintenanceDocumentRestrictions(document, user);

	document.getNewMaintainableObject().clearBusinessObjectOfRestrictedValues(maintenanceDocumentRestrictions);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:16,代码来源:KualiMaintenanceDocumentAction.java


示例15: doProcessingAfterPost

import org.kuali.rice.kns.document.MaintenanceDocument; //导入依赖的package包/类
/**
 * This method does all special processing on a document that should happen on each HTTP post (ie, save, route, approve, etc).
 * 
 * @param form
 */
@SuppressWarnings("unchecked")
protected void doProcessingAfterPost( KualiForm form, HttpServletRequest request ) {
	MaintenanceDocument document = (MaintenanceDocument) ((KualiMaintenanceForm)form).getDocument();
	Maintainable maintainable = document.getNewMaintainableObject();
	Object bo = maintainable.getBusinessObject();

	getBusinessObjectService().linkUserFields(bo);

	maintainable.processAfterPost(document, request.getParameterMap() );
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:16,代码来源:KualiMaintenanceDocumentAction.java


示例16: populateAuthorizationFields

import org.kuali.rice.kns.document.MaintenanceDocument; //导入依赖的package包/类
protected void populateAuthorizationFields(KualiDocumentFormBase formBase){
	super.populateAuthorizationFields(formBase);

	KualiMaintenanceForm maintenanceForm = (KualiMaintenanceForm) formBase;
	MaintenanceDocument maintenanceDocument = (MaintenanceDocument) maintenanceForm.getDocument();
	MaintenanceDocumentAuthorizer maintenanceDocumentAuthorizer = (MaintenanceDocumentAuthorizer) getDocumentHelperService().getDocumentAuthorizer(maintenanceDocument);
	Person user = GlobalVariables.getUserSession().getPerson();
	maintenanceForm.setReadOnly(!formBase.getDocumentActions().containsKey(KRADConstants.KUALI_ACTION_CAN_EDIT));
	MaintenanceDocumentRestrictions maintenanceDocumentAuthorizations = getBusinessObjectAuthorizationService().getMaintenanceDocumentRestrictions(maintenanceDocument, user);
	maintenanceForm.setAuthorizations(maintenanceDocumentAuthorizations);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:12,代码来源:KualiMaintenanceDocumentAction.java


示例17: processCustomRouteDocumentBusinessRules

import org.kuali.rice.kns.document.MaintenanceDocument; //导入依赖的package包/类
@Override
protected boolean processCustomRouteDocumentBusinessRules(MaintenanceDocument document) {
    boolean result = super.processCustomRouteDocumentBusinessRules(document);

    result &= checkDoctypeName(document);
    result &= checkDoctypeLabel(document);

    return result;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:10,代码来源:DocumentTypeMaintainableBusRule.java


示例18: processCustomSaveDocumentBusinessRules

import org.kuali.rice.kns.document.MaintenanceDocument; //导入依赖的package包/类
@Override
protected boolean processCustomSaveDocumentBusinessRules(MaintenanceDocument document) {
    boolean result = super.processCustomSaveDocumentBusinessRules(document);

    result &= checkDoctypeName(document);
    result &= checkDoctypeLabel(document);

    return result;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:10,代码来源:DocumentTypeMaintainableBusRule.java


示例19: processAfterNew

import org.kuali.rice.kns.document.MaintenanceDocument; //导入依赖的package包/类
/**
 * Pre-populates the ID field of the new PermissionBo to be created.
 *
 * @see org.kuali.rice.kns.maintenance.KualiMaintainableImpl#saveBusinessObject()
 */
@Override
public void processAfterNew(MaintenanceDocument document, Map<String, String[]> parameters) {
    super.processAfterNew(document,parameters);

    GenericPermissionBo permissionBo = (GenericPermissionBo) document.getNewMaintainableObject().getDataObject();
    initializePermissionId(permissionBo);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:13,代码来源:GenericPermissionMaintainable.java


示例20: processSaveDocument

import org.kuali.rice.kns.document.MaintenanceDocument; //导入依赖的package包/类
/**
 * @see org.kuali.rice.krad.rules.MaintenanceDocumentRule#processSaveDocument(org.kuali.rice.krad.document.Document)
 */
@Override
public boolean processSaveDocument(Document document) {

    MaintenanceDocument maintenanceDocument = (MaintenanceDocument) document;

    // remove all items from the errorPath temporarily (because it may not
    // be what we expect, or what we need)
    clearErrorPath();

    // setup convenience pointers to the old & new bo
    setupBaseConvenienceObjects(maintenanceDocument);

    // the document must be in a valid state for saving. this does not include business
    // rules, but just enough testing that the document is populated and in a valid state
    // to not cause exceptions when saved. if this passes, then the save will always occur,
    // regardless of business rules.
    if (!isDocumentValidForSave(maintenanceDocument)) {
        resumeErrorPath();
        return false;
    }

    // apply rules that are specific to the class of the maintenance document
    // (if implemented). this will always succeed if not overloaded by the
    // subclass
    processCustomSaveDocumentBusinessRules(maintenanceDocument);

    // return the original set of items to the errorPath
    resumeErrorPath();

    // return the original set of items to the errorPath, to ensure no impact
    // on other upstream or downstream items that rely on the errorPath
    return true;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:37,代码来源:MaintenanceDocumentRuleBase.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java OBR类代码示例发布时间:2022-05-22
下一篇:
Java ProgramCommandLine类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap