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


Java WorkflowDocument.setAttributeContent方法代码示例

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


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

示例1: flagWorkflowDocument

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
/**
 * Marks the workflow document as originating from the Notification System, so that the
 * Notification post-processor does not route the action back through the Notification System.
 * @param doc the doc to monogram
 */
protected void flagWorkflowDocument(WorkflowDocument doc) {
    Properties p = new Properties();
    p.setProperty(INTERNAL_COMMAND_FLAG, "true");
    ByteArrayOutputStream baos = new ByteArrayOutputStream(100);
    try {
        p.store(baos, null);
    } catch (IOException ioe) {
        throw new RuntimeException("Could not store properties", ioe);
    }
    doc.setAttributeContent("<whatever>" + new String(baos.toByteArray()) + "</whatever>");
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:17,代码来源:KEWActionListMessageDeliverer.java

示例2: testDirtyContent

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
@Test public void testDirtyContent() {
    WorkflowDocument document = WorkflowDocumentFactory.createDocument(getPrincipalIdForName("rkirkend"), "UnitTestDocument");
    document.setApplicationContent("application content");
    document.setAttributeContent("attribute content");
    document.setSearchableContent("searchable content");
    assertEquals("application content", document.getApplicationContent());
    assertEquals("application content", document.getDocumentContent().getApplicationContent());
    assertEquals("attribute content", document.getAttributeContent());
    assertEquals("attribute content", document.getDocumentContent().getAttributeContent());
    assertEquals("searchable content", document.getDocumentContent().getSearchableContent());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:12,代码来源:WorkflowDocumentTest.java

示例3: createNotificationWorkflowDocument

import org.kuali.rice.kew.api.WorkflowDocument; //导入方法依赖的package包/类
/**
 * Creates a notification {@link WorkflowDocument}.
 *
 * @param request the servlet request
 * @param initiatorId the user sending the notification
 * @param model the Spring MVC model
 *
 * @return a {@link WorkflowDocument} for the notification
 * @throws java.lang.IllegalArgumentException
 * @throws org.kuali.rice.ken.exception.ErrorList
 */
protected WorkflowDocument createNotificationWorkflowDocument(HttpServletRequest request, String initiatorId,
        Map<String, Object> model) throws IllegalArgumentException, ErrorList {
    WorkflowDocument document = NotificationWorkflowDocument.createNotificationDocument(initiatorId,
            NotificationConstants.KEW_CONSTANTS.SEND_NOTIFICATION_REQ_DOC_TYPE);

    //parse out the application content into a Notification BO
    NotificationBo notification = populateNotificationInstance(request, model);

    // now get that content in an understandable XML format and pass into document
    String notificationAsXml = notificationMessageContentService.generateNotificationMessage(notification);

    Map<String, String> attrFields = new HashMap<String,String>();
    List<NotificationChannelReviewerBo> reviewers = notification.getChannel().getReviewers();
    int ui = 0;
    int gi = 0;
    for (NotificationChannelReviewerBo reviewer: reviewers) {
        String prefix;
        int index;
        if (KimConstants.KimGroupMemberTypes.PRINCIPAL_MEMBER_TYPE.getCode().equals(reviewer.getReviewerType())) {
            prefix = "user";
            index = ui;
            ui++;
        } else if (KimConstants.KimGroupMemberTypes.GROUP_MEMBER_TYPE.getCode().equals(reviewer.getReviewerType())) {
            prefix = "group";
            index = gi;
            gi++;
        } else {
            LOG.error("Invalid type for reviewer " + reviewer.getReviewerId() + ": " + reviewer.getReviewerType());
            continue;
        }
        attrFields.put(prefix + index, reviewer.getReviewerId());
    }
    GenericAttributeContent gac = new GenericAttributeContent("channelReviewers");
    document.setApplicationContent(notificationAsXml);
    document.setAttributeContent("<attributeContent>" + gac.generateContent(attrFields) + "</attributeContent>");

    document.setTitle(notification.getTitle());

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


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