本文整理汇总了Java中org.kuali.rice.krad.bo.DocumentHeader类的典型用法代码示例。如果您正苦于以下问题:Java DocumentHeader类的具体用法?Java DocumentHeader怎么用?Java DocumentHeader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DocumentHeader类属于org.kuali.rice.krad.bo包,在下文中一共展示了DocumentHeader类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isDocumentOverviewValid
import org.kuali.rice.krad.bo.DocumentHeader; //导入依赖的package包/类
/**
* Verifies that the document's overview fields are valid - it does required and format checks.
*
* @param document
* @return boolean True if the document description is valid, false otherwise.
*/
public boolean isDocumentOverviewValid(Document document) {
// add in the documentHeader path
GlobalVariables.getMessageMap().addToErrorPath(KRADConstants.DOCUMENT_PROPERTY_NAME);
GlobalVariables.getMessageMap().addToErrorPath(KRADConstants.DOCUMENT_HEADER_PROPERTY_NAME);
// check the document header for fields like the description
getDictionaryValidationService().validateBusinessObject(document.getDocumentHeader());
validateSensitiveDataValue(KRADPropertyConstants.EXPLANATION, document.getDocumentHeader().getExplanation(),
getDataDictionaryService().getAttributeLabel(DocumentHeader.class, KRADPropertyConstants.EXPLANATION));
validateSensitiveDataValue(KRADPropertyConstants.DOCUMENT_DESCRIPTION,
document.getDocumentHeader().getDocumentDescription(), getDataDictionaryService().getAttributeLabel(
DocumentHeader.class, KRADPropertyConstants.DOCUMENT_DESCRIPTION));
// drop the error path keys off now
GlobalVariables.getMessageMap().removeFromErrorPath(KRADConstants.DOCUMENT_HEADER_PROPERTY_NAME);
GlobalVariables.getMessageMap().removeFromErrorPath(KRADConstants.DOCUMENT_PROPERTY_NAME);
return GlobalVariables.getMessageMap().hasNoErrors();
}
示例2: createTestingEntity
import org.kuali.rice.krad.bo.DocumentHeader; //导入依赖的package包/类
protected EntityDefault createTestingEntity() {
IdentityManagementPersonDocument personDoc = initPersonDoc();
WorkflowDocument document = WorkflowDocumentFactory.createDocument(adminPerson.getPrincipalId(),"TestDocumentType");
DocumentHeader documentHeader = new DocumentHeader();
documentHeader.setWorkflowDocument(document);
documentHeader.setDocumentNumber(document.getDocumentId());
personDoc.setDocumentHeader(documentHeader);
// first - save them so we can inactivate them
uiDocumentService.saveEntityPerson(personDoc);
// verify that the record was saved
EntityDefault entity = KimApiServiceLocator.getIdentityService().getEntityDefault(personDoc.getEntityId());
assertNotNull( "Entity was not saved: " + personDoc, entity);
assertNotNull( "Principal list was null on retrieved record", entity.getPrincipals() );
assertEquals( "Principal list was incorrect length", 1, entity.getPrincipals().size() );
assertTrue( "Principal is not active on saved record", entity.getPrincipals().get(0).isActive() );
return entity;
}
示例3: testInactivatePrincipal
import org.kuali.rice.krad.bo.DocumentHeader; //导入依赖的package包/类
@Test
public void testInactivatePrincipal() {
createTestingEntity();
// create a new person document and inactivate the record we just created
IdentityManagementPersonDocument personDoc = initPersonDoc();
WorkflowDocument document = WorkflowDocumentFactory.createDocument(adminPerson.getPrincipalId(),"TestDocumentType");
DocumentHeader documentHeader = new DocumentHeader();
documentHeader.setWorkflowDocument(document);
documentHeader.setDocumentNumber(document.getDocumentId());
personDoc.setDocumentHeader(documentHeader);
personDoc.setActive(false);
uiDocumentService.saveEntityPerson(personDoc);
EntityDefault entity = KimApiServiceLocator.getIdentityService().getEntityDefault(personDoc.getEntityId());
assertNotNull( "Entity missing after inactivation: " + personDoc, entity);
assertNotNull( "Principal list was null on retrieved record", entity.getPrincipals() );
assertEquals( "Principal list was incorrect length", 1, entity.getPrincipals().size() );
assertFalse( "Principal is active on saved record (after inactivation)", entity.getPrincipals().get(0).isActive() );
}
示例4: doRouteStatusChange
import org.kuali.rice.krad.bo.DocumentHeader; //导入依赖的package包/类
/**
* This method overrides the parent method to check the status of the award document and change the linked
* {@link ProposalStatus} to A (Approved) if the {@link Award} is now in approved status.
*
* @see org.kuali.rice.kns.maintenance.KualiMaintainableImpl#doRouteStatusChange(org.kuali.rice.krad.bo.DocumentHeader)
*/
@Override
public void doRouteStatusChange(DocumentHeader header) {
super.doRouteStatusChange(header);
Award award = getAward();
WorkflowDocument workflowDoc = header.getWorkflowDocument();
// Use the isProcessed() method so this code is only executed when the final approval occurs
if (workflowDoc.isProcessed()) {
Proposal proposal = award.getProposal();
proposal.setProposalStatusCode(Proposal.AWARD_CODE);
SpringContext.getBean(BusinessObjectService.class).save(proposal);
}
}
示例5: doRouteStatusChange
import org.kuali.rice.krad.bo.DocumentHeader; //导入依赖的package包/类
/**
* Override to push chart manager id into KIM
*
* @see org.kuali.rice.kns.maintenance.KualiMaintainableImpl#doRouteStatusChange(org.kuali.rice.kns.bo.DocumentHeader)
*/
@Override
public void doRouteStatusChange(DocumentHeader documentHeader) {
if (documentHeader.getWorkflowDocument().isProcessed()) {
Chart chart = (Chart) getBusinessObject();
Person oldChartManager = SpringContext.getBean(ChartService.class).getChartManager(chart.getChartOfAccountsCode());
// Only make the KIM calls if the chart manager was changed
if ( oldChartManager == null || !StringUtils.equals(chart.getFinCoaManagerPrincipalId(), oldChartManager.getPrincipalId() ) ) {
RoleService roleService = KimApiServiceLocator.getRoleService();
Map<String,String> qualification = new HashMap<String,String>(1);
qualification.put(OleKimAttributes.CHART_OF_ACCOUNTS_CODE, chart.getChartOfAccountsCode());
if (oldChartManager != null) {
roleService.removePrincipalFromRole(oldChartManager.getPrincipalId(), OLEConstants.CoreModuleNamespaces.OLE, OLEConstants.SysKimApiConstants.CHART_MANAGER_KIM_ROLE_NAME, qualification);
}
if (StringUtils.isNotBlank(chart.getFinCoaManagerPrincipalId())) {
roleService.assignPrincipalToRole(chart.getFinCoaManagerPrincipalId(), OLEConstants.CoreModuleNamespaces.OLE, OLEConstants.SysKimApiConstants.CHART_MANAGER_KIM_ROLE_NAME, qualification);
}
}
}
super.doRouteStatusChange(documentHeader);
}
示例6: initiateSearchableAttributes
import org.kuali.rice.krad.bo.DocumentHeader; //导入依赖的package包/类
private void initiateSearchableAttributes(LeaveRequestDocument leaveRequestDocument) {
DocumentHeader dh = leaveRequestDocument.getDocumentHeader();
WorkflowDocument workflowDocument = dh.getWorkflowDocument();
if (!DocumentStatus.FINAL.equals(workflowDocument.getStatus())) {
try {
workflowDocument.setApplicationContent(createSearchableAttributeXml(leaveRequestDocument, leaveRequestDocument.getLeaveBlock()));
workflowDocument.saveDocument("");
if (!"I".equals(workflowDocument.getStatus().getCode())) {
if (GlobalVariables.getUserSession() != null && workflowDocument.getInitiatorPrincipalId().equals(GlobalVariables.getUserSession().getPrincipalId())) {
workflowDocument.saveDocument("");
} else{
workflowDocument.saveDocumentData();
}
} else{
workflowDocument.saveDocument("");
}
} catch (Exception e) {
LOG.warn("Exception during searchable attribute update.");
throw new RuntimeException(e);
}
}
}
示例7: doRouteStatusChange
import org.kuali.rice.krad.bo.DocumentHeader; //导入依赖的package包/类
@Override
public void doRouteStatusChange(DocumentHeader documentHeader) {
LOG.debug("doRouteStatusChange() starting");
super.doRouteStatusChange(documentHeader);
try {
if (documentHeader.getWorkflowDocument().isFinal()) {
OLEClaimNoticeBo oleClaimNoticeBo = (OLEClaimNoticeBo) this.getDataObject();
OleMailer oleMail= GlobalResourceLoader.getService("oleMailer");
if(oleClaimNoticeBo.getMailAddress()!=null && !oleClaimNoticeBo.getMailAddress().isEmpty()){
LoanProcessor loanProcessor = new LoanProcessor();
String fromMail = loanProcessor.getParameter(OLEParameterConstants.NOTICE_FROM_MAIL);
oleMail.sendEmail(new EmailFrom(fromMail),new EmailTo(oleClaimNoticeBo.getMailAddress()), new EmailSubject("Claim Report"), new EmailBody(claimReportNotice(oleClaimNoticeBo)), true);
if (LOG.isInfoEnabled()){
LOG.info("Mail send successfully to "+oleClaimNoticeBo.getMailAddress());
}
}
}
} catch (Exception e) {
LOG.error("Exception saving routing data while saving document with id " + getDocumentNumber(), e);
}
LOG.debug("doRouteStatusChange() ending");
}
示例8: populateDocumentDescription
import org.kuali.rice.krad.bo.DocumentHeader; //导入依赖的package包/类
/**
* Defaults the document description based on the credit memo source type.
*
* @param cmDocument - Credit Memo Document to Populate
*/
protected void populateDocumentDescription(VendorCreditMemoDocument cmDocument) {
String description = "";
if (cmDocument.isSourceVendor()) {
description = "Vendor: " + cmDocument.getVendorName();
} else {
description = "PO: " + cmDocument.getPurchaseOrderDocument().getPurapDocumentIdentifier() + " Vendor: " + cmDocument.getVendorName();
}
// trim description if longer than whats specified in the data dictionary
int noteTextMaxLength = dataDictionaryService.getAttributeMaxLength(DocumentHeader.class, KRADPropertyConstants.DOCUMENT_DESCRIPTION).intValue();
if (noteTextMaxLength < description.length()) {
description = description.substring(0, noteTextMaxLength);
}
cmDocument.getDocumentHeader().setDocumentDescription(description);
}
示例9: processAfterRetrieve
import org.kuali.rice.krad.bo.DocumentHeader; //导入依赖的package包/类
/**
* This is the default implementation which ensures that document note attachment references are loaded.
*
* @see org.kuali.rice.krad.document.Document#processAfterRetrieve()
*/
@Override
public void processAfterRetrieve() {
// set correctedByDocumentId manually, since OJB doesn't maintain that relationship
try {
DocumentHeader correctingDocumentHeader = SpringContext.getBean(FinancialSystemDocumentHeaderDao.class).getCorrectingDocumentHeader(getDocumentHeader().getWorkflowDocument().getDocumentId());
if (correctingDocumentHeader != null) {
getFinancialSystemDocumentHeader().setCorrectedByDocumentId(correctingDocumentHeader.getDocumentNumber());
}
} catch (RuntimeException e) {
LOG.error("Received WorkflowException trying to get route header id from workflow document");
throw new WorkflowRuntimeException(e);
}
// set the ad hoc route recipients too, since OJB doesn't maintain that relationship
// TODO - see KULNRVSYS-1054
super.processAfterRetrieve();
}
示例10: processAfterRetrieve
import org.kuali.rice.krad.bo.DocumentHeader; //导入依赖的package包/类
/**
* This is the default implementation which ensures that document note attachment references are loaded.
*
* @see org.kuali.rice.krad.document.Document#processAfterRetrieve()
*/
@Override
public void processAfterRetrieve() {
// set correctedByDocumentId manually, since OJB doesn't maintain that relationship
try {
DocumentHeader correctingDocumentHeader = SpringContext.getBean(FinancialSystemDocumentHeaderDao.class).getCorrectingDocumentHeader(getFinancialSystemDocumentHeader().getDocumentNumber());
if (correctingDocumentHeader != null) {
getFinancialSystemDocumentHeader().setCorrectedByDocumentId(correctingDocumentHeader.getDocumentNumber());
}
} catch (Exception e) {
LOG.error("Received WorkflowException trying to get route header id from workflow document.", e);
throw new WorkflowRuntimeException(e);
}
// set the ad hoc route recipients too, since OJB doesn't maintain that relationship
// TODO - see KULNRVSYS-1054
super.processAfterRetrieve();
}
示例11: processAfterRetrieve
import org.kuali.rice.krad.bo.DocumentHeader; //导入依赖的package包/类
/**
* This is the default implementation which ensures that document note attachment references are loaded.
*
* @see org.kuali.rice.krad.document.Document#processAfterRetrieve()
*/
@Override
public void processAfterRetrieve() {
// set correctedByDocumentId manually, since OJB doesn't maintain that relationship
try {
DocumentHeader correctingDocumentHeader = SpringContext.getBean(FinancialSystemDocumentHeaderDao.class).getCorrectingDocumentHeader(getFinancialSystemDocumentHeader().getDocumentNumber());
if (ObjectUtils.isNotNull(correctingDocumentHeader) && !correctingDocumentHeader.getWorkflowDocument().isCanceled() && !correctingDocumentHeader.getWorkflowDocument().isDisapproved()) {
getFinancialSystemDocumentHeader().setCorrectedByDocumentId(correctingDocumentHeader.getDocumentNumber());
}
} catch (Exception e) {
LOG.error("Received WorkflowException trying to get route header id from workflow document.", e);
throw new WorkflowRuntimeException(e);
}
// set the ad hoc route recipients too, since OJB doesn't maintain that relationship
// TODO - see KULNRVSYS-1054
super.processAfterRetrieve();
}
示例12: doRouteStatusChange
import org.kuali.rice.krad.bo.DocumentHeader; //导入依赖的package包/类
@Override
public void doRouteStatusChange(DocumentHeader documentHeader) {
ClassificationBo classification = (ClassificationBo)this.getDataObject();
DocumentStatus documentStatus = documentHeader.getWorkflowDocument().getStatus();
//Set document description for real here
String docDescription = classification.getPositionClass() + ": " + classification.getClassificationTitle();
if (DocumentStatus.ENROUTE.equals(documentStatus)) {
try {
MaintenanceDocument md = (MaintenanceDocument)KRADServiceLocatorWeb.getDocumentService().getByDocumentHeaderId(documentHeader.getDocumentNumber());
md.getDocumentHeader().setDocumentDescription(docDescription);
md.getNewMaintainableObject().setDataObject(classification);
KRADServiceLocatorWeb.getDocumentService().saveDocument(md);
} catch (WorkflowException e) {
LOG.error("caught exception while handling doRouteStatusChange -> documentService.getByDocumentHeaderId(" + documentHeader.getDocumentNumber() + "). ", e);
throw new RuntimeException("caught exception while handling doRouteStatusChange -> documentService.getByDocumentHeaderId(" + documentHeader.getDocumentNumber() + "). ", e);
}
}
}
示例13: getWorkFlowStatusString
import org.kuali.rice.krad.bo.DocumentHeader; //导入依赖的package包/类
public static String getWorkFlowStatusString(DocumentHeader documentHeader) {
if (documentHeader.getWorkflowDocument().isInitiated()) {
return "INITIATED";
}
else if (documentHeader.getWorkflowDocument().isEnroute()) {
return "ENROUTE";
}
else if (documentHeader.getWorkflowDocument().isDisapproved()) {
return "DISAPPROVED";
}
else if (documentHeader.getWorkflowDocument().isCanceled()) {
return "CANCELLED";
}
else if (documentHeader.getWorkflowDocument().isApproved()) {
return "APPROVED";
}
else {
return StringUtils.EMPTY;
}
}
示例14: populateDocumentDescription
import org.kuali.rice.krad.bo.DocumentHeader; //导入依赖的package包/类
/**
* Defaults the document description based on the credit memo source type.
*
* @param cmDocument - Credit Memo Document to Populate
*/
protected void populateDocumentDescription(VendorCreditMemoDocument cmDocument) {
String description = "";
if (cmDocument.isSourceVendor()) {
description = "Vendor: " + cmDocument.getVendorName();
}
else {
description = "PO: " + cmDocument.getPurchaseOrderDocument().getPurapDocumentIdentifier() + " Vendor: " + cmDocument.getVendorName();
}
// trim description if longer than whats specified in the data dictionary
int noteTextMaxLength = dataDictionaryService.getAttributeMaxLength(DocumentHeader.class, KRADPropertyConstants.DOCUMENT_DESCRIPTION).intValue();
if (noteTextMaxLength < description.length()) {
description = description.substring(0, noteTextMaxLength);
}
cmDocument.getDocumentHeader().setDocumentDescription(description);
}
示例15: createPreqDocumentDescription
import org.kuali.rice.krad.bo.DocumentHeader; //导入依赖的package包/类
/**
* @see org.kuali.kfs.module.purap.document.service.PaymentRequestService#createPreqDocumentDescription(java.lang.Integer,
* java.lang.String)
*/
@Override
@NonTransactional
public String createPreqDocumentDescription(Integer purchaseOrderIdentifier, String vendorName) {
StringBuffer descr = new StringBuffer("");
descr.append("PO: ");
descr.append(purchaseOrderIdentifier);
descr.append(" Vendor: ");
descr.append(StringUtils.trimToEmpty(vendorName));
int noteTextMaxLength = dataDictionaryService.getAttributeMaxLength(DocumentHeader.class, KRADPropertyConstants.DOCUMENT_DESCRIPTION).intValue();
if (noteTextMaxLength >= descr.length()) {
return descr.toString();
}
else {
return descr.toString().substring(0, noteTextMaxLength);
}
}