mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Fix for ALF-5373 Renditions being generated to the same location (e.g. through use of paths/templates) can lead to incorrect renditions/exceptions.
Added new policy to aspect rn:rendition. Rendition nodes, before deletion, have their non-primary parent assocs removed. Otherwise the deletion of rendition nodes (which just moves them to the archive store) means that renditionService.getRenditions() returns those deleted assocs. Enabled HTMLRenderingEngineTest.testImagesSameFolder test case. Changed it slightly so that it deletes renditions/extracted images between test runs to prevent unwanted overwriting of renditions Enabled RenditionServiceIntegrationTest.testRenditionPlacements test case. Fixed the test path to point to /.../filename.txt as it should. Rewrote the end of the test to cover the cases where a rendition is attempting to overwrite another. Refactoring: renamed numerous private variables to aid readability Changes to RenditionNodeManager. If: a rendition is to an existing node that is not a rendition OR a rendition is to an existing rendition node whose source is not the same as the current one OR a rendition is to an existing rendition node whose renditionDef's name has changed Then throw an exception. We explicitly disallow these use cases now. We may support them in the future with a "forceOverwrite" option somewhere. StandardRenditionLocationResolverImpl now uses a RepositoryHelper to locate CompanyHome rather than a Lucene search Extensive debug logging added to the service. Added some javadoc git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@23330 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -422,7 +422,7 @@ public class HTMLRenderingEngineTest extends BaseAlfrescoSpringTest
|
||||
*
|
||||
* TODO Re-enable when we've figured out why the rendition service sulkts
|
||||
*/
|
||||
public void DISABLEDtestImagesSameFolder() throws Exception
|
||||
public void testImagesSameFolder() throws Exception
|
||||
{
|
||||
def.setParameterValue(
|
||||
RenditionService.PARAM_DESTINATION_PATH_TEMPLATE,
|
||||
@@ -441,6 +441,10 @@ public class HTMLRenderingEngineTest extends BaseAlfrescoSpringTest
|
||||
String baseName = name.substring(0, name.lastIndexOf('.'));
|
||||
|
||||
int numItemsStart = nodeService.getChildAssocs(targetFolder).size();
|
||||
if (log.isDebugEnabled())
|
||||
{
|
||||
log.debug("targetFolder " + targetFolder + " has " + numItemsStart + " children at start.");
|
||||
}
|
||||
|
||||
ChildAssociationRef rendition = renditionService.render(sourceDoc, def);
|
||||
assertNotNull(rendition);
|
||||
@@ -508,6 +512,14 @@ public class HTMLRenderingEngineTest extends BaseAlfrescoSpringTest
|
||||
}
|
||||
}
|
||||
assertEquals(expectedImageCount, images);
|
||||
|
||||
// Until the rendition service supports a forced overwrite of other renditions, we must
|
||||
// delete the old rendition node & the images.
|
||||
nodeService.deleteNode(rendition.getChildRef());
|
||||
for (ChildAssociationRef chAssRef : nodeService.getChildAssocs(targetFolder))
|
||||
{
|
||||
nodeService.deleteNode(chAssRef.getChildRef());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user