Search in sources :

Example 11 with DocumentType

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;
    }
}
Also used : RouteNode(org.kuali.kfs.kew.engine.node.RouteNode) DocumentType(org.kuali.kfs.kew.doctype.bo.DocumentType)

Example 12 with DocumentType

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;
}
Also used : DocumentType(org.kuali.kfs.kew.doctype.bo.DocumentType)

Example 13 with DocumentType

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;
}
Also used : DocumentType(org.kuali.kfs.kew.doctype.bo.DocumentType) RouteNodeInstance(org.kuali.kfs.kew.engine.node.RouteNodeInstance)

Example 14 with DocumentType

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;
}
Also used : DocumentType(org.kuali.kfs.kew.doctype.bo.DocumentType) RouteNodeInstance(org.kuali.kfs.kew.engine.node.RouteNodeInstance)

Example 15 with DocumentType

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;
}
Also used : DocumentType(org.kuali.kfs.kew.doctype.bo.DocumentType) RouteNodeInstance(org.kuali.kfs.kew.engine.node.RouteNodeInstance)

Aggregations

DocumentType (org.kuali.kfs.kew.doctype.bo.DocumentType)18 ArrayList (java.util.ArrayList)3 RouteNodeInstance (org.kuali.kfs.kew.engine.node.RouteNodeInstance)3 Timestamp (java.sql.Timestamp)2 Criteria (org.apache.ojb.broker.query.Criteria)2 QueryByCriteria (org.apache.ojb.broker.query.QueryByCriteria)2 RouteNode (org.kuali.kfs.kew.engine.node.RouteNode)2 AutoCancelBatchStep (edu.cornell.kfs.sys.batch.AutoCancelBatchStep)1 Collection (java.util.Collection)1 Iterator (java.util.Iterator)1 List (java.util.List)1 Account (org.kuali.kfs.coa.businessobject.Account)1 Chart (org.kuali.kfs.coa.businessobject.Chart)1 ObjectCode (org.kuali.kfs.coa.businessobject.ObjectCode)1 ProjectCode (org.kuali.kfs.coa.businessobject.ProjectCode)1 SubAccount (org.kuali.kfs.coa.businessobject.SubAccount)1 SubObjectCode (org.kuali.kfs.coa.businessobject.SubObjectCode)1 DocumentAttributeIndexingQueue (org.kuali.kfs.kew.api.document.attribute.DocumentAttributeIndexingQueue)1 WorkflowException (org.kuali.kfs.kew.api.exception.WorkflowException)1 DocumentAuthorizer (org.kuali.kfs.krad.document.DocumentAuthorizer)1