use of org.kuali.rice.kew.api.doctype.DocumentType in project cu-kfs by CU-CommunityApps.
the class AutoCancelBatchDaoJdbc method canAutoCancelDocType.
private boolean canAutoCancelDocType(String docTypeId) {
DocumentType docType = docTypes.get(docTypeId);
if (ObjectUtils.isNull(docType)) {
docType = KewApiServiceLocator.getDocumentTypeService().getDocumentTypeById(docTypeId);
docTypes.put(docTypeId, docType);
}
if (cancelDocumentTypes.isEmpty()) {
cancelDocumentTypes = parameterService.getParameterValuesAsString(AutoCancelBatchStep.class, CUKFSParameterKeyConstants.AUTO_CANCEL_DOC_TYPES_PARAMETER);
}
return cancelDocumentTypes.contains(docType.getName());
}
use of org.kuali.rice.kew.api.doctype.DocumentType in project cu-kfs by CU-CommunityApps.
the class AbstractRelatedView method getUrl.
public String getUrl() {
String documentTypeName = this.getDocumentTypeName();
DocumentType docType = KewApiServiceLocator.getDocumentTypeService().getDocumentTypeByName(documentTypeName);
String docHandlerUrl = docType.getResolvedDocumentHandlerUrl();
int endSubString = docHandlerUrl.lastIndexOf("/");
String serverName = docHandlerUrl.substring(0, endSubString);
String handler = docHandlerUrl.substring(endSubString + 1, docHandlerUrl.lastIndexOf("?"));
return serverName + "/" + handler + "?channelTitle=" + docType.getName() + "&" + KRADConstants.DISPATCH_REQUEST_PARAMETER + "=" + KRADConstants.DOC_HANDLER_METHOD + "&" + KRADConstants.PARAMETER_DOC_ID + "=" + this.getDocumentNumber() + "&" + KRADConstants.PARAMETER_COMMAND + "=" + KewApiConstants.DOCSEARCH_COMMAND;
}
use of org.kuali.rice.kew.api.doctype.DocumentType in project cu-kfs by CU-CommunityApps.
the class CuAutoDisapproveDocumentsServiceImpl method checkIfParentDocumentTypeParameterExists.
protected boolean checkIfParentDocumentTypeParameterExists() {
boolean parameterExists = true;
// check to make sure the system parameter for Parent Document Type = FP has been setup...
if (!getParameterService().parameterExists(AutoDisapproveDocumentsStep.class, KFSParameterKeyConstants.YearEndAutoDisapprovalConstants.YEAR_END_AUTO_DISAPPROVE_PARENT_DOCUMENT_TYPE)) {
LOG.warn("YEAR_END_AUTO_DISAPPROVE_PARENT_DOCUMENT_TYPE System parameter does not exist in the parameters list. The job can not continue without this parameter");
getAutoDisapproveErrorReportWriterService().writeFormattedMessageLine("YEAR_END_AUTO_DISAPPROVE_PARENT_DOCUMENT_TYPE System parameter does not exist in the parameters list. The job can not continue without this parameter");
return false;
}
List<DocumentType> parentDocumentTypes = this.getYearEndAutoDisapproveParentDocumentTypes();
for (DocumentType parentDocumentType : parentDocumentTypes) {
if (ObjectUtils.isNull(getDocumentTypeService().getDocumentTypeByName(parentDocumentType.getName()))) {
LOG.warn("Invalid Document Type: The value for System Parameter YEAR_END_AUTO_DISAPPROVE_PARENT_DOCUMENT_TYPE is invalid. The auto disapproval job cannot use this value.");
getAutoDisapproveErrorReportWriterService().writeFormattedMessageLine("Invalid Document Type: The value for System Parameter YEAR_END_AUTO_DISAPPROVE_PARENT_DOCUMENT_TYPE is invalid. The auto disapproval job cannot use this value.");
}
}
return parameterExists;
}
use of org.kuali.rice.kew.api.doctype.DocumentType in project cu-kfs by CU-CommunityApps.
the class CuAutoDisapproveDocumentsServiceImpl method checkIfDocumentEligibleForAutoDispproval.
/**
* @see org.kuali.kfs.sys.batch.service.impl.AutoDisapproveDocumentsServiceImpl#checkIfDocumentEligibleForAutoDispproval(org.kuali.rice.krad.bo.DocumentHeader)
*/
@Override
protected boolean checkIfDocumentEligibleForAutoDispproval(DocumentHeader documentHeader) {
boolean documentEligible = false;
List<DocumentType> parentDocumentTypes = this.getYearEndAutoDisapproveParentDocumentTypes();
String documentTypeName = documentHeader.getWorkflowDocument().getDocumentTypeName();
DocumentType childDocumentType = getDocumentTypeService().getDocumentTypeByName(documentTypeName);
for (DocumentType parentDocumentType : parentDocumentTypes) {
documentEligible = childDocumentType.getParentId().equals(parentDocumentType.getId());
if (documentEligible) {
break;
}
}
return documentEligible;
}
use of org.kuali.rice.kew.api.doctype.DocumentType in project cu-kfs by CU-CommunityApps.
the class CuAutoDisapproveDocumentsServiceImpl method getYearEndAutoDisapproveParentDocumentTypes.
/**
* Gets the year end auto disapprove parent document types.
* @return Returns the parentDocumentTypes.
*/
protected List<DocumentType> getYearEndAutoDisapproveParentDocumentTypes() {
List<DocumentType> parentDocumentTypes = new ArrayList<DocumentType>();
Collection<String> documentTypeCodes = getParameterService().getParameterValuesAsString(AutoDisapproveDocumentsStep.class, KFSParameterKeyConstants.YearEndAutoDisapprovalConstants.YEAR_END_AUTO_DISAPPROVE_PARENT_DOCUMENT_TYPE);
for (String documentTypeCode : documentTypeCodes) {
DocumentType parentDocumentType = (DocumentType) getDocumentTypeService().getDocumentTypeByName(documentTypeCode);
if (ObjectUtils.isNotNull(parentDocumentType)) {
parentDocumentTypes.add(parentDocumentType);
}
}
return parentDocumentTypes;
}
Aggregations