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


Java DocumentContent.getFullContent方法代码示例

本文整理汇总了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);
	}
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:14,代码来源:EDocLitePostProcessor.java

示例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));
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:44,代码来源:BeanConverterTester.java


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