use of org.kuali.kfs.kew.doctype.bo.DocumentType in project cu-kfs by CU-CommunityApps.
the class DocumentTypeServiceImpl method hasRouteNodeForDocumentTypeName.
@Override
public boolean hasRouteNodeForDocumentTypeName(String routeNodeName, String documentTypeName) throws IllegalArgumentException {
if (StringUtils.isBlank(routeNodeName)) {
throw new IllegalArgumentException("routeNodeName was null or blank");
}
if (StringUtils.isBlank(documentTypeName)) {
throw new IllegalArgumentException("documentTypeName was null or blank");
}
DocumentType documentType = getDocumentTypeByName(documentTypeName);
if (documentType == null) {
throw new IllegalArgumentException("Failed to locate a document type for the given name: " + documentTypeName);
}
RouteNode routeNode = KEWServiceLocator.getRouteNodeService().findRouteNodeByName(documentType.getId(), routeNodeName);
if (routeNode == null) {
if (documentType.getParentId() == null) {
return false;
} else {
return hasRouteNodeForDocumentTypeId(routeNodeName, documentType.getParentId());
}
} else {
return true;
}
}
use of org.kuali.kfs.kew.doctype.bo.DocumentType in project cu-kfs by CU-CommunityApps.
the class DocumentTypeServiceImpl method isSuperUserForDocumentTypeId.
@Override
public boolean isSuperUserForDocumentTypeId(String principalId, String documentTypeId) {
if (LOG.isDebugEnabled()) {
LOG.debug("Determining super user status [principalId=" + principalId + ", documentTypeId=" + documentTypeId + "]");
}
if (StringUtils.isBlank(principalId)) {
throw new IllegalArgumentException("principalId was null or blank");
}
if (StringUtils.isBlank(documentTypeId)) {
throw new IllegalArgumentException("documentTypeId was null or blank");
}
DocumentType documentType = KEWServiceLocator.getDocumentTypeService().findById(documentTypeId);
boolean isSuperUser = KEWServiceLocator.getDocumentTypePermissionService().canAdministerRouting(principalId, documentType);
if (LOG.isDebugEnabled()) {
LOG.debug("Super user status is " + isSuperUser + ".");
}
return isSuperUser;
}
use of org.kuali.kfs.kew.doctype.bo.DocumentType in project cu-kfs by CU-CommunityApps.
the class DocumentTypeServiceImpl method canSuperUserApproveSingleActionRequest.
@Override
public boolean canSuperUserApproveSingleActionRequest(String principalId, String documentTypeName, List<RouteNodeInstance> routeNodeInstances, String routeStatusCode) {
checkSuperUserInput(principalId, documentTypeName);
DocumentType documentType = KEWServiceLocator.getDocumentTypeService().findByName(documentTypeName);
List<org.kuali.kfs.kew.engine.node.RouteNodeInstance> currentNodeInstances = null;
if (routeNodeInstances != null && !routeNodeInstances.isEmpty()) {
currentNodeInstances = KEWServiceLocator.getRouteNodeService().getCurrentNodeInstances(routeNodeInstances.get(0).getDocumentId());
}
boolean isSuperUser = KEWServiceLocator.getDocumentTypePermissionService().canSuperUserApproveSingleActionRequest(principalId, documentType, currentNodeInstances, routeStatusCode);
if (LOG.isDebugEnabled()) {
LOG.debug("Super user approve single action request status is " + isSuperUser + ".");
}
return isSuperUser;
}
use of org.kuali.kfs.kew.doctype.bo.DocumentType in project cu-kfs by CU-CommunityApps.
the class DocumentTypeServiceImpl method canSuperUserDisapproveDocument.
@Override
public boolean canSuperUserDisapproveDocument(String principalId, String documentTypeName, List<RouteNodeInstance> routeNodeInstances, String routeStatusCode) {
checkSuperUserInput(principalId, documentTypeName);
DocumentType documentType = KEWServiceLocator.getDocumentTypeService().findByName(documentTypeName);
List<org.kuali.kfs.kew.engine.node.RouteNodeInstance> currentNodeInstances = null;
if (routeNodeInstances != null && !routeNodeInstances.isEmpty()) {
currentNodeInstances = KEWServiceLocator.getRouteNodeService().getCurrentNodeInstances(routeNodeInstances.get(0).getDocumentId());
}
boolean isSuperUser = KEWServiceLocator.getDocumentTypePermissionService().canSuperUserDisapproveDocument(principalId, documentType, currentNodeInstances, routeStatusCode);
if (LOG.isDebugEnabled()) {
LOG.debug("Super user disapprove document status is " + isSuperUser + ".");
}
return isSuperUser;
}
use of org.kuali.kfs.kew.doctype.bo.DocumentType in project cu-kfs by CU-CommunityApps.
the class DocumentTypeServiceImpl method canSuperUserApproveDocument.
@Override
public boolean canSuperUserApproveDocument(String principalId, String documentTypeName, List<RouteNodeInstance> routeNodeInstances, String routeStatusCode) {
checkSuperUserInput(principalId, documentTypeName);
DocumentType documentType = KEWServiceLocator.getDocumentTypeService().findByName(documentTypeName);
List<org.kuali.kfs.kew.engine.node.RouteNodeInstance> currentNodeInstances = null;
if (routeNodeInstances != null && !routeNodeInstances.isEmpty()) {
currentNodeInstances = KEWServiceLocator.getRouteNodeService().getCurrentNodeInstances(routeNodeInstances.get(0).getDocumentId());
}
boolean isSuperUser = KEWServiceLocator.getDocumentTypePermissionService().canSuperUserApproveDocument(principalId, documentType, currentNodeInstances, routeStatusCode);
if (LOG.isDebugEnabled()) {
LOG.debug("Super user approve document status is " + isSuperUser + ".");
}
return isSuperUser;
}
Aggregations