In the HTML rendering engine, when extracting out images, don't include WCM specific associations. (We'll put back some more general ones once composite content hopefully offers a suitable one)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@22737 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Nick Burch
2010-09-28 10:46:20 +00:00
parent 778078e26c
commit 798e35c455
4 changed files with 27 additions and 46 deletions

View File

@@ -284,10 +284,11 @@ public class HTMLRenderingEngineTest extends BaseAlfrescoSpringTest
// Check we didn't get any images
for(ChildAssociationRef ref : nodeService.getChildAssocs(htmlNode))
{
if(ref.getTypeQName().equals(HTMLRenderingEngine.PRIMARY_IMAGE))
fail("Found unexpected primary image of rendered html");
if(ref.getTypeQName().equals(HTMLRenderingEngine.SECONDARY_IMAGE))
fail("Found unexpected secondary image of rendered html");
// TODO Check against composite content associations when present
// if(ref.getTypeQName().equals(HTMLRenderingEngine.PRIMARY_IMAGE))
// fail("Found unexpected primary image of rendered html");
// if(ref.getTypeQName().equals(HTMLRenderingEngine.SECONDARY_IMAGE))
// fail("Found unexpected secondary image of rendered html");
}
// All done
@@ -376,21 +377,22 @@ public class HTMLRenderingEngineTest extends BaseAlfrescoSpringTest
assertEquals(1, nodeService.getChildAssocs(imgFolder).size());
// TODO Check against composite content associations when present
// Check the associations if supported
if(dictionaryService.getAssociation(HTMLRenderingEngine.PRIMARY_IMAGE) != null)
{
boolean hasPrimary = false;
boolean hasSecondary = false;
for(ChildAssociationRef ref : nodeService.getChildAssocs(htmlNode))
{
if(ref.getTypeQName().equals(HTMLRenderingEngine.PRIMARY_IMAGE))
hasPrimary = true;
if(ref.getTypeQName().equals(HTMLRenderingEngine.SECONDARY_IMAGE))
hasSecondary = true;
}
assertEquals(true, hasPrimary);
assertEquals(false, hasSecondary);
}
// if(dictionaryService.getAssociation(HTMLRenderingEngine.PRIMARY_IMAGE) != null)
// {
// boolean hasPrimary = false;
// boolean hasSecondary = false;
// for(ChildAssociationRef ref : nodeService.getChildAssocs(htmlNode))
// {
// if(ref.getTypeQName().equals(HTMLRenderingEngine.PRIMARY_IMAGE))
// hasPrimary = true;
// if(ref.getTypeQName().equals(HTMLRenderingEngine.SECONDARY_IMAGE))
// hasSecondary = true;
// }
// assertEquals(true, hasPrimary);
// assertEquals(false, hasSecondary);
// }
// All done
tidyUpSourceDoc();