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


Java DocumentRouteHeaderValue.to方法代码示例

本文整理汇总了Java中org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue.to方法的典型用法代码示例。如果您正苦于以下问题:Java DocumentRouteHeaderValue.to方法的具体用法?Java DocumentRouteHeaderValue.to怎么用?Java DocumentRouteHeaderValue.to使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue的用法示例。


在下文中一共展示了DocumentRouteHeaderValue.to方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: generateXmlInput

import org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue; //导入方法依赖的package包/类
protected Document generateXmlInput(RouteContext context) throws Exception {
DocumentBuilder db = getDocumentBuilder(true);
       Document doc = db.newDocument();
       Element emailNodeElem = doc.createElement("emailNode");
       doc.appendChild(emailNodeElem);
       String principalId = null;  // Added to the convertRouteHeader is not ambigious.
       org.kuali.rice.kew.api.document.Document routeHeaderVO = DocumentRouteHeaderValue.to(context.getDocument());
       RouteNodeInstance routeNodeInstanceVO = org.kuali.rice.kew.engine.node.RouteNodeInstance.to(context.getNodeInstance());
       Document documentContent = context.getDocumentContent().getDocument();
       XStream xstream = new XStream();
       Element docElem = XmlHelper.readXml(xstream.toXML(routeHeaderVO)).getDocumentElement();
       Element nodeElem = XmlHelper.readXml(xstream.toXML(routeNodeInstanceVO)).getDocumentElement();
       emailNodeElem.appendChild(doc.importNode(docElem, true));
       emailNodeElem.appendChild(doc.importNode(nodeElem, true));
       emailNodeElem.appendChild(doc.importNode(documentContent.getDocumentElement(), true));
       Element dConElem = context.getDocumentContent().getApplicationContent();//Add document Content element for
	 	emailNodeElem.appendChild(doc.importNode(dConElem, true));//access by the stylesheet when creating the email
       return doc;
   }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:20,代码来源:EmailNode.java

示例2: delete

import org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue; //导入方法依赖的package包/类
@Override
public Document delete(String documentId, String principalId) {
    incomingParamCheck(documentId, "documentId");
    incomingParamCheck(principalId, "principalId");
    DocumentRouteHeaderValue documentBo = init(DocumentActionParameters.create(documentId, principalId, null));
    if (LOG.isDebugEnabled()) {
        LOG.debug("Delete [principalId=" + principalId + ", documentId=" + documentId + "]");
    }
    Document document = null;
    try {
        document = DocumentRouteHeaderValue.to(documentBo);
        KEWServiceLocator.getWorkflowDocumentService().deleteDocument(principalId, documentBo);

    } catch (WorkflowException e) {
        translateException(e);
    }
    return document;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:19,代码来源:WorkflowDocumentActionsServiceImpl.java

示例3: getCustomEmailAttribute

import org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue; //导入方法依赖的package包/类
protected static CustomEmailAttribute getCustomEmailAttribute(Person user, ActionItem actionItem) throws WorkflowException {
	DocumentRouteHeaderValue routeHeader = KEWServiceLocator.getRouteHeaderService().getRouteHeader(actionItem.getDocumentId());
    CustomEmailAttribute customEmailAttribute = routeHeader.getCustomEmailAttribute();
    if (customEmailAttribute != null) {
        Document routeHeaderVO = DocumentRouteHeaderValue.to(routeHeader);
        ActionRequestValue actionRequest = KEWServiceLocator.getActionRequestService().findByActionRequestId(actionItem.getActionRequestId());
        ActionRequest actionRequestVO = ActionRequestValue.to(actionRequest);
        customEmailAttribute.setRouteHeaderVO(routeHeaderVO);
        customEmailAttribute.setActionRequestVO(actionRequestVO);
    }
    return customEmailAttribute;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:13,代码来源:BaseEmailContentServiceImpl.java

示例4: routeLogAuthorized

import org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue; //导入方法依赖的package包/类
@Override
public boolean routeLogAuthorized(String principalId, DocumentRouteHeaderValue routeHeader,
        SecuritySession securitySession) {
    Document document = DocumentRouteHeaderValue.to(routeHeader);
    if(document != null) {
        Set<String> authorizationResults = checkAuthorizations(principalId, securitySession, Collections.singletonList(document));
        return authorizationResults.contains(routeHeader.getDocumentId());
    } else {
        return false;
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:12,代码来源:DocumentSecurityServiceImpl.java

示例5: loadRoleQualifiers

import org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue; //导入方法依赖的package包/类
/**
 * Uses the appropriate {@link PeopleFlowTypeService} to get the role qualifier maps for the given document and
 * role.
 *
 * <p>Note that the PeopleFlowTypeService is selected based on the type id of the PeopleFlow.</p>
 *
 * @param context the context for request generation
 * @param roleId the ID of the role for whom qualifiers are being loaded
 * @return the qualifier maps, or an empty list if there are none
 */
protected List<Map<String, String>> loadRoleQualifiers(Context context, String roleId) {
    PeopleFlowTypeService peopleFlowTypeService = context.getPeopleFlowTypeService();
    List<Map<String, String>> roleQualifierList = new ArrayList<Map<String, String>>();

    if (peopleFlowTypeService != null) {
        Document document = DocumentRouteHeaderValue.to(context.getRouteContext().getDocument());
        DocumentRouteHeaderValueContent content = new DocumentRouteHeaderValueContent(document.getDocumentId());
        content.setDocumentContent(context.getRouteContext().getDocumentContent().getDocContent());
        DocumentContent documentContent = DocumentRouteHeaderValueContent.to(content);

        Map<String, String> roleQualifiers = peopleFlowTypeService.resolveRoleQualifiers(
                context.getPeopleFlow().getTypeId(), roleId, document, documentContent
        );

        if (roleQualifiers != null) {
            roleQualifierList.add(roleQualifiers);
        }

        boolean versionOk = VersionHelper.compareVersion(context.getPeopleFlowTypeServiceVersion(), CoreConstants.Versions.VERSION_2_3_0) != -1;
        if(versionOk) {
            List<Map<String, String>> multipleRoleQualifiers = peopleFlowTypeService.resolveMultipleRoleQualifiers(
                    context.getPeopleFlow().getTypeId(), roleId, document, documentContent);

            if (multipleRoleQualifiers != null) {
                roleQualifierList.addAll(multipleRoleQualifiers);
            }
        }

    }

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

示例6: getDocument

import org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue; //导入方法依赖的package包/类
@Override
public Document getDocument(String documentId) {
	if (StringUtils.isBlank(documentId)) {
		throw new RiceIllegalArgumentException("documentId was blank or null");
	}
	DocumentRouteHeaderValue documentBo = KEWServiceLocator.getRouteHeaderService().getRouteHeader(documentId);
	return DocumentRouteHeaderValue.to(documentBo);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:9,代码来源:WorkflowDocumentServiceImpl.java

示例7: sendImmediateReminder

import org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue; //导入方法依赖的package包/类
@Override
public void sendImmediateReminder(org.kuali.rice.kew.api.action.ActionItem actionItem, Boolean skipOnApprovals) {
    if (actionItem == null) {
        LOG.warn("Request to send immediate reminder to recipient of a null action item... aborting.");
        return;
    }

    if (actionItem.getPrincipalId() == null) {
        LOG.warn("Request to send immediate reminder to null recipient of an action item... aborting.");
        return;
    }

    if (skipOnApprovals != null && skipOnApprovals.booleanValue()
            && actionItem.getActionRequestCd().equals(KewApiConstants.ACTION_REQUEST_APPROVE_REQ)) {
        LOG.debug("As requested, skipping immediate reminder notification on action item approval for " + actionItem.getPrincipalId());
        return;
    }

    Preferences preferences = KewApiServiceLocator.getPreferencesService().getPreferences(actionItem.getPrincipalId());
    if(!checkEmailNotificationPreferences(actionItem, preferences, KewApiConstants.EMAIL_RMNDR_IMMEDIATE)) {
        LOG.debug("Email suppressed due to the user's preferences");
        return;
    }

    boolean shouldSendActionListEmailNotification = sendActionListEmailNotification();
    if (shouldSendActionListEmailNotification) {
        LOG.debug("sending immediate reminder");

        Person person = KimApiServiceLocator.getPersonService().getPerson(actionItem.getPrincipalId());

        DocumentRouteHeaderValue document = KEWServiceLocator.getRouteHeaderService().getRouteHeader(
                actionItem.getDocumentId());
        StringBuffer emailBody = new StringBuffer(buildImmediateReminderBody(person, actionItem,
                document.getDocumentType()));
        StringBuffer emailSubject = new StringBuffer();
        try {
            CustomEmailAttribute customEmailAttribute = document.getCustomEmailAttribute();
            if (customEmailAttribute != null) {
                Document routeHeaderVO = DocumentRouteHeaderValue.to(document);
                ActionRequestValue actionRequest = KEWServiceLocator
                        .getActionRequestService().findByActionRequestId(actionItem.getActionRequestId());
                ActionRequest actionRequestVO = ActionRequestValue.to(actionRequest);
                customEmailAttribute.setRouteHeaderVO(routeHeaderVO);
                customEmailAttribute.setActionRequestVO(actionRequestVO);
                String customBody = customEmailAttribute
                        .getCustomEmailBody();
                if (!org.apache.commons.lang.StringUtils.isEmpty(customBody)) {
                    emailBody.append(customBody);
                }
                String customEmailSubject = customEmailAttribute
                        .getCustomEmailSubject();
                if (!org.apache.commons.lang.StringUtils.isEmpty(customEmailSubject)) {
                    emailSubject.append(customEmailSubject);
                }
            }
        } catch (Exception e) {
            LOG
                    .error(
                            "Error when checking for custom email body and subject.",
                            e);
        }
        LOG.debug("Sending email to " + person);
        sendEmail(person, getEmailSubject(emailSubject.toString()),
                new EmailBody(emailBody.toString()), document
                        .getDocumentType());
    }

}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:69,代码来源:ActionListEmailServiceImpl.java

示例8: create

import org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue; //导入方法依赖的package包/类
@Override
public Document create(String documentTypeName,
        String initiatorPrincipalId, DocumentUpdate documentUpdate,
        DocumentContentUpdate documentContentUpdate)
        throws RiceIllegalArgumentException, IllegalDocumentTypeException, InvalidActionTakenException {

    incomingParamCheck(documentTypeName, "documentTypeName");
    incomingParamCheck(initiatorPrincipalId, "initiatorPrincipalId");

    if (LOG.isDebugEnabled()) {
        LOG.debug("Create Document [documentTypeName=" + documentTypeName + ", initiatorPrincipalId="
                + initiatorPrincipalId + "]");
    }

    String documentTypeId = documentTypeService.getIdByName(documentTypeName);
    if (documentTypeId == null) {
        throw new RiceIllegalArgumentException("Failed to locate a document type with the given name: "
                + documentTypeName);
    }

    DocumentRouteHeaderValue documentBo = new DocumentRouteHeaderValue();
    documentBo.setDocumentTypeId(documentTypeId);
    documentBo.setInitiatorWorkflowId(initiatorPrincipalId);
    if (documentUpdate != null) {
        documentBo.setDocTitle(documentUpdate.getTitle());
        documentBo.setAppDocId(documentUpdate.getApplicationDocumentId());
    }
    if (documentContentUpdate != null) {
        String newDocumentContent = DTOConverter.buildUpdatedDocumentContent(null, documentContentUpdate,
                documentTypeName);
        documentBo.setDocContent(newDocumentContent);
    }

    try {
        documentBo = KEWServiceLocator.getWorkflowDocumentService()
                .createDocument(initiatorPrincipalId, documentBo);
    } catch (WorkflowException e) {
        // TODO remove this once we stop throwing WorkflowException everywhere!
        translateException(e);
    }
    return DocumentRouteHeaderValue.to(documentBo);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:43,代码来源:WorkflowDocumentActionsServiceImpl.java

示例9: constructDocumentActionResult

import org.kuali.rice.kew.routeheader.DocumentRouteHeaderValue; //导入方法依赖的package包/类
protected DocumentActionResult constructDocumentActionResult(DocumentRouteHeaderValue documentBo, String principalId) {
    Document document = DocumentRouteHeaderValue.to(documentBo);
    ValidActions validActions = determineValidActionsInternal(documentBo, principalId);
    RequestedActions requestedActions = determineRequestedActionsInternal(documentBo, principalId);
    return DocumentActionResult.create(document, validActions, requestedActions);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:7,代码来源:WorkflowDocumentActionsServiceImpl.java


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