当前位置: 首页>>代码示例>>Java>>正文


Java KewApiServiceLocator类代码示例

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


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

示例1: testGetSearchableAttributeDateTimeValuesByKey

import org.kuali.rice.kew.api.KewApiServiceLocator; //导入依赖的package包/类
@Test public void testGetSearchableAttributeDateTimeValuesByKey() throws Exception {
    String documentTypeName = SeqSetup.DOCUMENT_TYPE_NAME;
    String userNetworkId = "ewestfal";
    WorkflowDocument workflowDocument = WorkflowDocumentFactory.createDocument(getPrincipalIdForName(userNetworkId), documentTypeName);
    workflowDocument.setTitle("Respect my Authoritah");
    workflowDocument.route("routing this document.");
    userNetworkId = "rkirkend";
    WorkflowDocument workflowDocument2 = WorkflowDocumentFactory.createDocument(getPrincipalIdForName(userNetworkId), documentTypeName);
    workflowDocument2.setTitle("Routing Style");
    workflowDocument2.route("routing this document.");

    WorkflowDocumentService wds = KewApiServiceLocator.getWorkflowDocumentService();
    List<DateTime> dateTimes = wds.getSearchableAttributeDateTimeValuesByKey(workflowDocument.getDocumentId(), TestXMLSearchableAttributeDateTime.SEARCH_STORAGE_KEY);
    assertNotNull("dateTimes should not be null", dateTimes);
    assertTrue("dateTimes should not be empty", !dateTimes.isEmpty());
    verifyTimestampToSecond(TestXMLSearchableAttributeDateTime.SEARCH_STORAGE_VALUE_IN_MILLS, dateTimes.get(0).getMillis());

    dateTimes = wds.getSearchableAttributeDateTimeValuesByKey(workflowDocument2.getDocumentId(), TestXMLSearchableAttributeDateTime.SEARCH_STORAGE_KEY);
    assertNotNull("dateTimes should not be null", dateTimes);
    assertTrue("dateTimes should not be empty", !dateTimes.isEmpty());
    verifyTimestampToSecond(TestXMLSearchableAttributeDateTime.SEARCH_STORAGE_VALUE_IN_MILLS, dateTimes.get(0).getMillis());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:23,代码来源:WorkflowUtilityTest.java

示例2: getWorkflowDocumentActionsService

import org.kuali.rice.kew.api.KewApiServiceLocator; //导入依赖的package包/类
/**
 * Helper method to get the correct {@link WorkflowDocumentActionsService} from the {@code applicationId} of the
 * document type.
 *
 * @param documentTypeId the document type to get the application id from
 *
 * @return the correct {@link WorkflowDocumentActionsService} from the {@code applicationId} of the document type
 */
protected WorkflowDocumentActionsService getWorkflowDocumentActionsService(String documentTypeId) {
    DocumentType documentType = KewApiServiceLocator.getDocumentTypeService().getDocumentTypeById(documentTypeId);
    String applicationId = documentType.getApplicationId();
    QName serviceName = new QName(KewApiConstants.Namespaces.KEW_NAMESPACE_2_0,
            KewApiConstants.ServiceNames.WORKFLOW_DOCUMENT_ACTIONS_SERVICE_SOAP);

    WorkflowDocumentActionsService service = (WorkflowDocumentActionsService) KsbApiServiceLocator.getServiceBus()
            .getService(serviceName, applicationId);

    if (service == null) {
        service = KewApiServiceLocator.getWorkflowDocumentActionsService();
    }

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

示例3: getDocumentTitle

import org.kuali.rice.kew.api.KewApiServiceLocator; //导入依赖的package包/类
/**
 * Retrieves the title of the document
 *
 * <p>
 * This is the default document title implementation. It concatenates the document's data dictionary file label
 * attribute and
 * the document's document header description together. This title is used to populate workflow and will show up in
 * document
 * search results and user action lists.
 * </p>
 *
 * return String representing the title of the document
 *
 * @see org.kuali.rice.krad.document.Document#getDocumentTitle()
 */
@Override
public String getDocumentTitle() {
    String documentTypeLabel = KewApiServiceLocator.getDocumentTypeService().getDocumentTypeByName(
            this.getDocumentHeader().getWorkflowDocument().getDocumentTypeName()).getLabel();
    if (null == documentTypeLabel) {
        documentTypeLabel = "";
    }

    String description = this.getDocumentHeader().getDocumentDescription();
    if (null == description) {
        description = "";
    }

    return documentTypeLabel + " - " + description;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:31,代码来源:DocumentBase.java

示例4: canSendAnyTypeAdHocRequests

import org.kuali.rice.kew.api.KewApiServiceLocator; //导入依赖的package包/类
public boolean canSendAnyTypeAdHocRequests(Document document, Person user) {
    if (canSendAdHocRequests(document, KewApiConstants.ACTION_REQUEST_FYI_REQ, user)) {
        RoutePath routePath = KewApiServiceLocator.getDocumentTypeService().getRoutePathForDocumentTypeName(
                document.getDocumentHeader().getWorkflowDocument().getDocumentTypeName());
        ProcessDefinition processDefinition = routePath.getPrimaryProcess();
        if (processDefinition != null) {
            if (processDefinition.getInitialRouteNode() == null) {
                return false;
            }
        } else {
            return false;
        }

        return true;
    } else if (canSendAdHocRequests(document, KewApiConstants.ACTION_REQUEST_ACKNOWLEDGE_REQ, user)) {
        return true;
    }

    return canSendAdHocRequests(document, KewApiConstants.ACTION_REQUEST_APPROVE_REQ, user);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:21,代码来源:DocumentAuthorizerBase.java

示例5: runPerformDocumentSearch_RouteNodeSearch

import org.kuali.rice.kew.api.KewApiServiceLocator; //导入依赖的package包/类
private void runPerformDocumentSearch_RouteNodeSearch(String principalId, String routeNodeName, String documentTypeName, int countBeforeNode, int countAtNode, int countAfterNode) throws RemoteException, WorkflowException {

        DocumentSearchCriteria.Builder criteria = DocumentSearchCriteria.Builder.create();
        criteria.setDocumentTypeName(documentTypeName);
        criteria.setRouteNodeName(routeNodeName);
        DocumentSearchResults results = KewApiServiceLocator.getWorkflowDocumentService().documentSearch(principalId,
                criteria.build());
        assertEquals("Wrong number of search results when checking docs at default node logic.", countAtNode, results.getSearchResults().size());

        criteria.setRouteNodeLookupLogic(RouteNodeLookupLogic.EXACTLY);
        results = KewApiServiceLocator.getWorkflowDocumentService().documentSearch(principalId, criteria.build());
        assertEquals("Wrong number of search results when checking docs at exact node.", countAtNode, results.getSearchResults().size());

        criteria.setRouteNodeLookupLogic(RouteNodeLookupLogic.BEFORE);
        results = KewApiServiceLocator.getWorkflowDocumentService().documentSearch(principalId, criteria.build());
        assertEquals("Wrong number of search results when checking docs before node.", countBeforeNode, results.getSearchResults().size());

        criteria.setRouteNodeLookupLogic(RouteNodeLookupLogic.AFTER);
        results = KewApiServiceLocator.getWorkflowDocumentService().documentSearch(principalId, criteria.build());
        assertEquals("Wrong number of search results when checking docs after node.", countAfterNode, results.getSearchResults().size());
    }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:22,代码来源:WorkflowUtilityTest.java

示例6: canSuperUserDisapprove

import org.kuali.rice.kew.api.KewApiServiceLocator; //导入依赖的package包/类
public boolean canSuperUserDisapprove(Document document, Person user) {
    if (!document.getDocumentHeader().hasWorkflowDocument()) {
        return false;
    }

    String principalId = user.getPrincipalId();

    String documentTypeId = document.getDocumentHeader().getWorkflowDocument().getDocumentTypeId();
    if (KewApiServiceLocator.getDocumentTypeService().isSuperUserForDocumentTypeId(principalId, documentTypeId)) {
        return true;
    }

    String documentTypeName = document.getDocumentHeader().getWorkflowDocument().getDocumentTypeName();
    List<RouteNodeInstance> routeNodeInstances = document.getDocumentHeader().getWorkflowDocument().getRouteNodeInstances();
    String documentStatus =  document.getDocumentHeader().getWorkflowDocument().getStatus().getCode();
    return KewApiServiceLocator.getDocumentTypeService().canSuperUserDisapproveDocument(
            principalId, documentTypeName, routeNodeInstances, documentStatus);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:19,代码来源:DocumentAuthorizerBase.java

示例7: runTestPerformDocumentSearch_CustomThreshold

import org.kuali.rice.kew.api.KewApiServiceLocator; //导入依赖的package包/类
private void runTestPerformDocumentSearch_CustomThreshold(String principalId) throws Exception {
    String documentTypeName = SeqSetup.DOCUMENT_TYPE_NAME;
    String docTitle = "Routing Style";
    setupPerformDocumentSearchTests(documentTypeName, null, docTitle);

    DocumentSearchCriteria.Builder criteria = DocumentSearchCriteria.Builder.create();
    criteria.setDocumentTypeName(documentTypeName);
    DocumentSearchResults results = KewApiServiceLocator.getWorkflowDocumentService().documentSearch(principalId,
            criteria.build());
    assertEquals("Search results should have two documents.", 2, results.getSearchResults().size());

    int threshold = 1;
    criteria.setMaxResults(1);
    results = KewApiServiceLocator.getWorkflowDocumentService().documentSearch(principalId, criteria.build());
    assertTrue("Search results should signify search went over the given threshold: " + threshold, results.isOverThreshold());
    assertEquals("Search results should have one document.", threshold, results.getSearchResults().size());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:18,代码来源:WorkflowUtilityTest.java

示例8: testGetRouteHeader

import org.kuali.rice.kew.api.KewApiServiceLocator; //导入依赖的package包/类
/**
 * Tests the loading of a RouteHeaderVO using the WorkflowInfo.
 * 
 * Verifies that an NPE no longer occurrs as mentioned in KULRICE-765.
 */
@Test
public void testGetRouteHeader() throws Exception {
    // ensure the UserSession is cleared out (could have been set up by other tests)
    GlobalVariables.setUserSession(null);
    String ewestfalPrincipalId = KimApiServiceLocator.getIdentityService().getPrincipalByPrincipalName("ewestfal")
            .getPrincipalId();
    GlobalVariables.setUserSession(new UserSession("ewestfal"));
    WorkflowDocument workflowDocument = WorkflowDocumentFactory.createDocument(ewestfalPrincipalId,
            "TestDocumentType");
    String documentId = workflowDocument.getDocumentId();
    assertNotNull(documentId);

    Document document = KewApiServiceLocator.getWorkflowDocumentService().getDocument(documentId);
    assertNotNull(document);

    assertEquals(documentId, document.getDocumentId());
    assertEquals(DocumentStatus.INITIATED, document.getStatus());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:24,代码来源:WorkflowInfoTest.java

示例9: isNodeInPreviousNodeList

import org.kuali.rice.kew.api.KewApiServiceLocator; //导入依赖的package包/类
public static boolean isNodeInPreviousNodeList(String nodeName, String id) {
	LOG.debug("nodeName came in as: " + nodeName);
	LOG.debug("id came in as: " + id);
	//get list of previous node names
	List<String> previousNodeNames;
	try {
		previousNodeNames = KewApiServiceLocator.getWorkflowDocumentService().getPreviousRouteNodeNames(id);
	} catch (Exception e) {
		throw new WorkflowRuntimeException("Problem generating list of previous node names for documentID = " + id, e);
	}
	//see if node name is in the list of previous node names
	for (String previousNodeName : previousNodeNames) {
		if (previousNodeName.equals(nodeName)) {
			return true;
		}
	}
	return false;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:19,代码来源:EDLFunctions.java

示例10: retrieveTypeAttributes

import org.kuali.rice.kew.api.KewApiServiceLocator; //导入依赖的package包/类
/**
 * Invokes the {@link org.kuali.rice.kew.api.repository.type.KewTypeRepositoryService} to retrieve the remotable
 * field definitions for the attributes associated with the selected type
 *
 * @param view - view instance
 * @param model - object containing the form data, from which the selected type will be pulled
 * @param container - container that holds the remotable fields
 * @return List<RemotableAttributeField> instances for the type attributes, or empty list if not attributes exist
 */
public List<RemotableAttributeField> retrieveTypeAttributes(View view, Object model, Container container) {
    List<RemotableAttributeField> remoteFields = new ArrayList<RemotableAttributeField>();

    PeopleFlowBo peopleFlow =
            (PeopleFlowBo) ((MaintenanceDocumentForm) model).getDocument().getNewMaintainableObject().getDataObject();

    // retrieve the type service and invoke to get the remotable field definitions
    String typeId = peopleFlow.getTypeId();
    if (StringUtils.isNotBlank(typeId)) {
        KewTypeDefinition typeDefinition = KewApiServiceLocator.getKewTypeRepositoryService().getTypeById(typeId);
        PeopleFlowTypeService peopleFlowTypeService = GlobalResourceLoader.<PeopleFlowTypeService>getService(
            QName.valueOf(typeDefinition.getServiceName()));
        remoteFields = peopleFlowTypeService.getAttributeFields(typeId);
    }

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

示例11: saveDataObject

import org.kuali.rice.kew.api.KewApiServiceLocator; //导入依赖的package包/类
/**
 * Calls {@link org.kuali.rice.kew.api.peopleflow.PeopleFlowService} to save the people flow instance
 */
@Override
public void saveDataObject() {
    PeopleFlowDefinition peopleFlowDefinition;
    if (KRADConstants.MAINTENANCE_COPY_ACTION.equals(getMaintenanceAction())) {
        peopleFlowDefinition = PeopleFlowBo.maintenanceCopy(((PeopleFlowBo) getDataObject()));
    } else {
    // this to method ends up copying a versionNumber to null versionNumber 
        peopleFlowDefinition = PeopleFlowBo.to(((PeopleFlowBo) getDataObject()));
    }
    if (StringUtils.isNotBlank(peopleFlowDefinition.getId())) {
        KewApiServiceLocator.getPeopleFlowService().updatePeopleFlow(peopleFlowDefinition);
    } else {
        KewApiServiceLocator.getPeopleFlowService().createPeopleFlow(peopleFlowDefinition);
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:19,代码来源:PeopleFlowMaintainableImpl.java

示例12: isSuperUserApproveDocumentAuthorized

import org.kuali.rice.kew.api.KewApiServiceLocator; //导入依赖的package包/类
public boolean isSuperUserApproveDocumentAuthorized() {
       String principalId =  GlobalVariables.getUserSession().getPrincipalId();
       String docId = this.getDocId();
       DocumentType documentType = KewApiServiceLocator.getDocumentTypeService().getDocumentTypeByName(docTypeName);
       String docTypeId = null;
       if (documentType != null) {
           docTypeId = documentType.getId();
       }
       if ( KewApiServiceLocator.getDocumentTypeService().isSuperUserForDocumentTypeId(principalId, docTypeId) ) {
           return true;
       }
    List<RouteNodeInstance> routeNodeInstances= KewApiServiceLocator.getWorkflowDocumentService().getRouteNodeInstances(docId);
       String documentStatus =  KewApiServiceLocator.getWorkflowDocumentService().getDocumentStatus(docId).getCode();
       return KewApiServiceLocator.getDocumentTypeService().canSuperUserApproveDocument(
                   principalId, this.getDocTypeName(), routeNodeInstances, documentStatus);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:17,代码来源:KualiDocumentFormBase.java

示例13: isSuperUserDisapproveDocumentAuthorized

import org.kuali.rice.kew.api.KewApiServiceLocator; //导入依赖的package包/类
public boolean isSuperUserDisapproveDocumentAuthorized() {
    String principalId =  GlobalVariables.getUserSession().getPrincipalId();
    String docId = this.getDocId();
    DocumentType documentType = KewApiServiceLocator.getDocumentTypeService().getDocumentTypeByName(docTypeName);
    String docTypeId = null;
    if (documentType != null) {
        docTypeId = documentType.getId();
    }
    if ( KewApiServiceLocator.getDocumentTypeService().isSuperUserForDocumentTypeId(principalId, docTypeId) ) {
        return true;
    }
 List<RouteNodeInstance> routeNodeInstances= KewApiServiceLocator.getWorkflowDocumentService().getRouteNodeInstances(docId);
    String documentStatus =  KewApiServiceLocator.getWorkflowDocumentService().getDocumentStatus(docId).getCode();
    return KewApiServiceLocator.getDocumentTypeService().canSuperUserDisapproveDocument(
        principalId, this.getDocTypeName(), routeNodeInstances, documentStatus);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:17,代码来源:KualiDocumentFormBase.java

示例14: isSuperUserAuthorized

import org.kuali.rice.kew.api.KewApiServiceLocator; //导入依赖的package包/类
public boolean isSuperUserAuthorized() {
    String docId = this.getDocId();
    if (StringUtils.isBlank(docId) || ObjectUtils.isNull(docTypeName)) {
        return false;
    }

    DocumentType documentType = KewApiServiceLocator.getDocumentTypeService().getDocumentTypeByName(docTypeName);
    String docTypeId = null;
    if (documentType != null) {
        docTypeId = documentType.getId();
    }
    String principalId =  GlobalVariables.getUserSession().getPrincipalId();
    if ( KewApiServiceLocator.getDocumentTypeService().isSuperUserForDocumentTypeId(principalId, docTypeId) ) {
        return true;
    }
    List<RouteNodeInstance> routeNodeInstances= KewApiServiceLocator.getWorkflowDocumentService().getRouteNodeInstances(
            docId);
    String documentStatus =  KewApiServiceLocator.getWorkflowDocumentService().getDocumentStatus(docId).getCode();
    return ((KewApiServiceLocator.getDocumentTypeService().canSuperUserApproveSingleActionRequest(
                principalId, this.getDocTypeName(), routeNodeInstances, documentStatus)) ||
            (KewApiServiceLocator.getDocumentTypeService().canSuperUserApproveDocument(
                principalId, this.getDocTypeName(), routeNodeInstances, documentStatus)) ||
            (KewApiServiceLocator.getDocumentTypeService().canSuperUserDisapproveDocument (
                principalId, this.getDocTypeName(), routeNodeInstances, documentStatus))) ;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:26,代码来源:KualiDocumentFormBase.java

示例15: canSendAnyTypeAdHocRequests

import org.kuali.rice.kew.api.KewApiServiceLocator; //导入依赖的package包/类
public boolean canSendAnyTypeAdHocRequests(Document document, Person user) {
    if (canSendAdHocRequests(document, KewApiConstants.ACTION_REQUEST_FYI_REQ, user)) {
        RoutePath routePath = KewApiServiceLocator.getDocumentTypeService().getRoutePathForDocumentTypeName(
                document.getDocumentHeader().getWorkflowDocument().getDocumentTypeName());
        ProcessDefinition processDefinition = routePath.getPrimaryProcess();
        if (processDefinition != null) {
            if (processDefinition.getInitialRouteNode() == null) {
                return false;
            }
        } else {
            return false;
        }
        return true;
    } else if (canSendAdHocRequests(document, KewApiConstants.ACTION_REQUEST_ACKNOWLEDGE_REQ, user)) {
        return true;
    }
    return canSendAdHocRequests(document, KewApiConstants.ACTION_REQUEST_APPROVE_REQ, user);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:19,代码来源:DocumentAuthorizerBase.java


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