mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
ALF-2620: Fixed problem with the paths being used in rendition path template model. "cwd" is now a file/display path and "companyHome" is a TemplateNode.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@20037 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -112,6 +112,37 @@ public class XSLTRenderingEngineTest extends BaseAlfrescoSpringTest
|
||||
}
|
||||
|
||||
|
||||
public void testSimplestTemplateWithTargetPath() throws Exception
|
||||
{
|
||||
try
|
||||
{
|
||||
FileInfo file = createXmlFile(companyHome);
|
||||
FileInfo xslFile = createXmlFile(companyHome, verySimpleXSLT);
|
||||
|
||||
RenditionDefinition def = renditionService.createRenditionDefinition(QName.createQName("Test"), XSLTRenderingEngine.NAME);
|
||||
def.setParameterValue(XSLTRenderingEngine.PARAM_TEMPLATE_NODE, xslFile.getNodeRef());
|
||||
def.setParameterValue(RenditionService.PARAM_DESTINATION_PATH_TEMPLATE, "output/path/for/rendition/output.txt");
|
||||
|
||||
ChildAssociationRef rendition = renditionService.render(file.getNodeRef(), def);
|
||||
|
||||
assertNotNull(rendition);
|
||||
assertEquals(2, nodeService.getParentAssocs(rendition.getChildRef()).size());
|
||||
|
||||
ContentReader reader = contentService.getReader(rendition.getChildRef(), ContentModel.PROP_CONTENT);
|
||||
assertNotNull(reader);
|
||||
String output = reader.getContentString();
|
||||
|
||||
log.debug("XSLT Processor output: " + output);
|
||||
assertEquals("Avocado DipBagels, New York StyleBeef Frankfurter, Quarter PoundChicken Pot PieCole SlawEggsHazelnut SpreadPotato ChipsSoy Patties, GrilledTruffles, Dark Chocolate", output);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.error("Error!", ex);
|
||||
fail();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void testParseXMLDocument() throws Exception
|
||||
{
|
||||
try
|
||||
|
Reference in New Issue
Block a user