Fixed a bug that shows itself when placing a new rendition directly under Company Home, and also tweaked the name of the "companyHome" object on the path template model to be "companyhome" to be consistent with the naming in the script API.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@20056 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Brian Remmington
2010-04-30 12:11:57 +00:00
parent 133ddec64a
commit 5c87d5eb87

View File

@@ -144,11 +144,16 @@ public class StandardRenditionLocationResolverImpl implements RenditionLocationR
{
throw new RenditionServiceException("The path must include a valid filename! Path: " + path);
}
FileFolderService fileFolderService = serviceRegistry.getFileFolderService();
NodeRef parent = companyHome;
if (!folderElements.isEmpty())
{
FileInfo parentInfo = FileFolderServiceImpl.makeFolders(fileFolderService,
companyHome, folderElements,
ContentModel.TYPE_FOLDER);
NodeRef parent = parentInfo.getNodeRef();
parent = parentInfo.getNodeRef();
}
NodeRef child = fileFolderService.searchSimple(parent, fileName);
return new RenditionLocationImpl(parent, child, fileName);
}
@@ -200,7 +205,9 @@ public class StandardRenditionLocationResolverImpl implements RenditionLocationR
root.put("extension", sourceExtension);
root.put("date", new SimpleDate(new Date(), SimpleDate.DATETIME));
root.put("cwd", cwd);
root.put("companyHome", new TemplateNode(companyHome, serviceRegistry, null));
TemplateNode companyHomeNode = new TemplateNode(companyHome, serviceRegistry, null);
root.put("companyHome", companyHomeNode);
root.put("companyhome", companyHomeNode); //Added this to be consistent with the script API
root.put("sourceNode", new TemplateNode(sourceNode, serviceRegistry, null));
root.put("sourceContentType", nodeService.getType(sourceNode).getLocalName());
root.put("renditionContentType", nodeService.getType(tempRenditionLocation).getLocalName());