Hi,
Some analysis that took me time so I’m putting it here in case it helps someone
and for us to consider changing the way this velocity parameter works.
Problem: I was moving the Annotation functional test from enterprise to
platform and the test was failing because there are 2 Annotations entries
displayed in the More Actions menu and the PageObjects picks the first one (the
wrong one). This doesn’t show in XE, nor in an empty wiki.
Cause:
* If you’re in XE, then we provide a custom XWikiPreferences which has
showannotations set to false. Thus Comments and Annotations are merged
* If you’re in an empty wiki, then there’s no XWikiPreferences but there’s also
no AnnotationConfig page and thus this code in xwikivars.vm sets
showannotations to false:
#retrieveSetting('showannotations' $settingValue)
#set ($showannotations = $settingValue)
#if ($showannotations)
## The general settings allow displaying the tab
#set ($showannotations = false)
#if ($xwiki.exists('AnnotationCode.AnnotationConfig'))
#set ($annotationConfigObject =
$xwiki.getDocument('AnnotationCode.AnnotationConfig').getObject('AnnotationCode.AnnotationConfig'))
#if ($annotationConfigObject.getProperty('activated').value != 0 &&
!$annotationConfigObject.getProperty('exceptionSpaces').value.contains($doc.space))
#set ($showannotations = true)
#set ($annotationClass =
$annotationConfigObject.getProperty('annotationClass').value)
#set ($annotationCount = $doc.getObjects($annotationClass).size())
#end
#end
#end
* If you’re in the functional test of the annotation module. You don’t have
XWikiPreferences but you do have an AnnotationConfig object and thus
showannotations = true, thus displaying the 2 tabs: both the Comments tab and
the Annotation tab.
Am I the only one to believe that Comments and Annotations should be merged by
default, ie that by default showannotations = false without having to override
it in XWikiPreferences? I guess we did this for backward compatibility? Can you
imagine what problem we would have if we changed the default now?
Thanks
-Vincent
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs