本文整理汇总了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>");
}
示例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());
}
示例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;
}