mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
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:
@@ -144,11 +144,16 @@ public class StandardRenditionLocationResolverImpl implements RenditionLocationR
|
|||||||
{
|
{
|
||||||
throw new RenditionServiceException("The path must include a valid filename! Path: " + path);
|
throw new RenditionServiceException("The path must include a valid filename! Path: " + path);
|
||||||
}
|
}
|
||||||
|
|
||||||
FileFolderService fileFolderService = serviceRegistry.getFileFolderService();
|
FileFolderService fileFolderService = serviceRegistry.getFileFolderService();
|
||||||
FileInfo parentInfo = FileFolderServiceImpl.makeFolders(fileFolderService,
|
NodeRef parent = companyHome;
|
||||||
companyHome, folderElements,
|
if (!folderElements.isEmpty())
|
||||||
ContentModel.TYPE_FOLDER);
|
{
|
||||||
NodeRef parent = parentInfo.getNodeRef();
|
FileInfo parentInfo = FileFolderServiceImpl.makeFolders(fileFolderService,
|
||||||
|
companyHome, folderElements,
|
||||||
|
ContentModel.TYPE_FOLDER);
|
||||||
|
parent = parentInfo.getNodeRef();
|
||||||
|
}
|
||||||
NodeRef child = fileFolderService.searchSimple(parent, fileName);
|
NodeRef child = fileFolderService.searchSimple(parent, fileName);
|
||||||
return new RenditionLocationImpl(parent, child, fileName);
|
return new RenditionLocationImpl(parent, child, fileName);
|
||||||
}
|
}
|
||||||
@@ -200,7 +205,9 @@ public class StandardRenditionLocationResolverImpl implements RenditionLocationR
|
|||||||
root.put("extension", sourceExtension);
|
root.put("extension", sourceExtension);
|
||||||
root.put("date", new SimpleDate(new Date(), SimpleDate.DATETIME));
|
root.put("date", new SimpleDate(new Date(), SimpleDate.DATETIME));
|
||||||
root.put("cwd", cwd);
|
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("sourceNode", new TemplateNode(sourceNode, serviceRegistry, null));
|
||||||
root.put("sourceContentType", nodeService.getType(sourceNode).getLocalName());
|
root.put("sourceContentType", nodeService.getType(sourceNode).getLocalName());
|
||||||
root.put("renditionContentType", nodeService.getType(tempRenditionLocation).getLocalName());
|
root.put("renditionContentType", nodeService.getType(tempRenditionLocation).getLocalName());
|
||||||
|
Reference in New Issue
Block a user