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


Java StyleService类代码示例

本文整理汇总了Java中org.kuali.rice.coreservice.api.style.StyleService的典型用法代码示例。如果您正苦于以下问题:Java StyleService类的具体用法?Java StyleService怎么用?Java StyleService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


StyleService类属于org.kuali.rice.coreservice.api.style包,在下文中一共展示了StyleService类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testLoadXML

import org.kuali.rice.coreservice.api.style.StyleService; //导入依赖的package包/类
@Test public void testLoadXML() throws FileNotFoundException {
    loadXmlFile("EDocLiteContent.xml");
    loadXmlFile("edlstyle.xml");

    EDocLiteService edls = EdlServiceLocator.getEDocLiteService();
    StyleService styleService = CoreServiceApiServiceLocator.getStyleService();
    //edls.loadXml(new FileInputStream("conf/examples/xml/EDocLiteContent.xml"));
    assertTrue("Definition not found", edls.getEDocLiteDefinition("profile") != null);
    Style defaultStyle = styleService.getStyle("Default");
    assertNotNull("Style not found", defaultStyle);
    assertEquals(1, edls.getEDocLiteAssociations().size());
    EDocLiteDefinition def = edls.getEDocLiteDefinition("profile");
    assertNotNull("'profile' definition not found", def);
    assertEquals("profile", def.getName());
    assertNotNull(def.getActiveInd());
    assertTrue(def.getActiveInd().booleanValue());
    Style style = styleService.getStyle("Default");
    assertNotNull("'Default' style not found", style);
    assertEquals("Default", style.getName());
    assertTrue(style.isActive());
    assertNotNull(style.getXmlContent());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:23,代码来源:EDocLiteServiceImplTest.java

示例2: exportStyles

import org.kuali.rice.coreservice.api.style.StyleService; //导入依赖的package包/类
private void exportStyles(Element parentEl, EDocLiteAssociation edl) {

		try {
			StyleService styleService = CoreServiceApiServiceLocator.getStyleService();

			if (edl.getStyle() != null) {//this probably shouldn't be supported on the entry side...
				Element styleWrapperEl = renderer.renderElement(parentEl, EDL_STYLE);
				renderer.renderAttribute(styleWrapperEl, "name", edl.getStyle());
				Style style = styleService.getStyle(edl.getStyle());
				if (style == null) {
					LOG.error("Attempted to export style " + edl.getStyle() + " which was not found");
					return;
				}
				Element styleEl = XmlHelper.buildJDocument(new StringReader(style.getXmlContent())).getRootElement();
				styleWrapperEl.addContent(styleEl.detach());
			}
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:21,代码来源:EDocLiteXmlExporter.java

示例3: testLoadXML

import org.kuali.rice.coreservice.api.style.StyleService; //导入依赖的package包/类
@Test public void testLoadXML() throws FileNotFoundException {
    loadXmlFile("EDocLiteContent.xml");
    loadXmlFile("edlstyle.xml");

    EDocLiteService edls = EdlServiceLocator.getEDocLiteService();
    StyleService styleService = CoreServiceApiServiceLocator.getStyleService();
    //edls.loadXml(new FileInputStream("conf/examples/xml/EDocLiteContent.xml"));
    assertTrue("Definition not found", edls.getEDocLiteDefinitions().contains("profile"));
    Style defaultStyle = styleService.getStyle("Default");
    assertNotNull("Style not found", defaultStyle);
    assertEquals(1, edls.getEDocLiteAssociations().size());
    EDocLiteDefinition def = edls.getEDocLiteDefinition("profile");
    assertNotNull("'profile' definition not found", def);
    assertEquals("profile", def.getName());
    assertNotNull(def.getActiveInd());
    assertTrue(def.getActiveInd().booleanValue());
    Style style = styleService.getStyle("Default");
    assertNotNull("'Default' style not found", style);
    assertEquals("Default", style.getName());
    assertTrue(style.isActive());
    assertNotNull(style.getXmlContent());
}
 
开发者ID:kuali,项目名称:rice,代码行数:23,代码来源:EDocLiteServiceImplTest.java

示例4: testLoadXML

import org.kuali.rice.coreservice.api.style.StyleService; //导入依赖的package包/类
@Test public void testLoadXML() throws FileNotFoundException {
    loadXmlFile("style.xml");

    StyleService styleService = CoreServiceApiServiceLocator.getStyleService();
    assertNotNull("Style 'an_arbitrary_style' not found", styleService.getStyle("an_arbitrary_style"));

    Style style = styleService.getStyle("an_arbitrary_style");
    assertNotNull("'an_arbitrary_style' style not found", style);
    assertEquals("an_arbitrary_style", style.getName());
    assertTrue(style.isActive());
    assertNotNull(style.getXmlContent());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:13,代码来源:StyleServiceImplTest.java

示例5: setStyleService

import org.kuali.rice.coreservice.api.style.StyleService; //导入依赖的package包/类
public void setStyleService(StyleService styleService) {
    this.styleService = styleService;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:4,代码来源:StyleableEmailContentServiceImpl.java

示例6: testInclusions

import org.kuali.rice.coreservice.api.style.StyleService; //导入依赖的package包/类
@Test public void testInclusions() throws FileNotFoundException, TransformerConfigurationException, TransformerException {
    loadXmlFile("style.xml");

    StyleService styleService = CoreServiceApiServiceLocator.getStyleService();

    // ignoring the duplicate definition via inclusion test as the behavior seems
    // unspecified
    // XML.com claims it is an "error": http://www.xml.com/pub/a/2000/11/01/xslt/index.html
    // XLST 1.0 spec doesn't seem to specify anything regarding this: http://www.w3.org/TR/xslt
    // Michael Kay's XSLT Programmer's Reference states "...it is implementation-defined
    // whether an XSLT processor will report duplicate declarations as an error , so
    // the behavior may vary from on product to another
    // (although it is not clear to me whether he is speaking specifically of identical
    // literal definitions introduced by re-inclusion of the same exact stylesheet twice, or
    // "logical" duplication of template match criteria)
    /*Templates t = styleService.getStyleAsTranslet("test_includer");
    StringWriter w = new StringWriter();
    StreamResult result = new StreamResult(w);
    try {
        t.newTransformer().transform(new StreamSource(new StringReader("<a/>")), result);
        System.err.println(w.toString());
        fail("Exception not thrown on ambiguous template defs");
    } catch (Exception e) {
        // expected
    }*/

    Writer w = new StringWriter();
    StreamResult result = new StreamResult(w);
    Templates t = styleService.getStyleAsTranslet("test_includer2");
    t.newTransformer().transform(new StreamSource(new StringReader("<a/>")), result);
    assertEquals("oneoneoneoneone", w.toString());

    w = new StringWriter();
    result = new StreamResult(w);
    t.newTransformer().transform(new StreamSource(new StringReader("<b/>")), result);
    assertEquals("22222", w.toString());

    w = new StringWriter();
    result = new StreamResult(w);
    t = styleService.getStyleAsTranslet("test_importer");
    t.newTransformer().transform(new StreamSource(new StringReader("<a/>")), result);
    assertEquals("aaaaa", w.toString());

    w = new StringWriter();
    result = new StreamResult(w);
    t.newTransformer().transform(new StreamSource(new StringReader("<b/>")), result);
    assertEquals("BBBBB", w.toString());

    w = new StringWriter();
    result = new StreamResult(w);
    t.newTransformer().transform(new StreamSource(new StringReader("<c/>")), result);
    assertEquals("CCCCC", w.toString());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:54,代码来源:StyleServiceImplTest.java

示例7: getStyleService

import org.kuali.rice.coreservice.api.style.StyleService; //导入依赖的package包/类
public static StyleService getStyleService() {
	return getService(STYLE_SERVICE);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:4,代码来源:CoreServiceApiServiceLocator.java

示例8: StyleUriResolver

import org.kuali.rice.coreservice.api.style.StyleService; //导入依赖的package包/类
StyleUriResolver(StyleService styleService) {
	if (styleService == null) {
		throw new IllegalArgumentException("styleService cannot be null");
	}
	this.styleService = styleService;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:7,代码来源:StyleUriResolver.java

示例9: setStyleService

import org.kuali.rice.coreservice.api.style.StyleService; //导入依赖的package包/类
public void setStyleService(StyleService styleService) {
	this.styleService = styleService;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:4,代码来源:StyleXmlParserImpl.java

示例10: getStyleService

import org.kuali.rice.coreservice.api.style.StyleService; //导入依赖的package包/类
private static StyleService getStyleService() {
	return CoreServiceApiServiceLocator.getStyleService();
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:4,代码来源:EDocLiteXmlParser.java


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