本文整理汇总了Java中org.kuali.rice.kew.api.document.DocumentContent.getFullContent方法的典型用法代码示例。如果您正苦于以下问题:Java DocumentContent.getFullContent方法的具体用法?Java DocumentContent.getFullContent怎么用?Java DocumentContent.getFullContent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.kew.api.document.DocumentContent
的用法示例。
在下文中一共展示了DocumentContent.getFullContent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getEDLContent
import org.kuali.rice.kew.api.document.DocumentContent; //导入方法依赖的package包/类
public static Document getEDLContent(String documentId) {
try {
DocumentContent documentContent = KewApiServiceLocator.getWorkflowDocumentService().getDocumentContent(documentId);
String content = documentContent.getFullContent();
Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new InputSource(new StringReader(content)));
return doc;
} catch (Exception e) {
if (e instanceof RuntimeException) {
throw (RuntimeException)e;
}
throw new RuntimeException(e);
}
}
示例2: testBuildUpdatedDocumentContent
import org.kuali.rice.kew.api.document.DocumentContent; //导入方法依赖的package包/类
/**
* Tests the conversion of a DocumentContentVO object into an XML String. Includes generating content
* for any attributes which are on the DocumentContentVO object.
*
* TODO there is some crossover between this test and the DocumentContentTest, do we really need both of them???
*/
@Test public void testBuildUpdatedDocumentContent() throws Exception {
String startContent = "<"+DOCUMENT_CONTENT+">";
String endContent = "</"+DOCUMENT_CONTENT+">";
/*
* // test no content, this should return null which indicates an unchanged document content VO
* //RouteHeaderVO routeHeaderVO = new RouteHeaderVO();
*/
// test no content, this should return empty document content
DocumentContent contentVO = DocumentContent.Builder.create("1234").build();
String content = contentVO.getFullContent();
assertEquals("Invalid content conversion.", KewApiConstants.DEFAULT_DOCUMENT_CONTENT, content);
// test simple case, no attributes
String attributeContent = "<attribute1><id value=\"3\"/></attribute1>";
String searchableContent = "<searchable1><data>hello</data></searchable1>";
DocumentContent.Builder contentBuilder = DocumentContent.Builder.create("1234");
contentBuilder.setAttributeContent(constructContent(ATTRIBUTE_CONTENT, attributeContent));
contentBuilder.setSearchableContent(constructContent(SEARCHABLE_CONTENT, searchableContent));
contentVO = contentBuilder.build();
content = contentVO.getFullContent();
String fullContent = startContent+constructContent(ATTRIBUTE_CONTENT, attributeContent)+constructContent(SEARCHABLE_CONTENT, searchableContent)+endContent;
assertEquals("Invalid content conversion.", StringUtils.deleteWhitespace(fullContent), StringUtils.deleteWhitespace(content));
// now, add an attribute
String testAttributeContent = new TestRuleAttribute().getDocContent();
WorkflowAttributeDefinition attributeDefinition = WorkflowAttributeDefinition.Builder.create(TestRuleAttribute.class.getName()).build();
DocumentContentUpdate.Builder contentUpdate = DocumentContentUpdate.Builder.create();
contentUpdate.getAttributeDefinitions().add(attributeDefinition);
content = DTOConverter.buildUpdatedDocumentContent(KewApiConstants.DEFAULT_DOCUMENT_CONTENT, contentUpdate.build(), null);
fullContent = startContent+
constructContent(ATTRIBUTE_CONTENT, attributeContent+testAttributeContent)+
constructContent(SEARCHABLE_CONTENT, searchableContent)+
endContent;
assertEquals("Invalid content conversion.", StringUtils.deleteWhitespace(fullContent), StringUtils.deleteWhitespace(content));
}