Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-3468

Document information shows documents for each language for childrens and backlinks

    Details

    • keywords:
      macros.vm informationinline.vm
    • Difficulty:
      Easy
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      Site odo.lv has several pages (documents) which are translated in 3 languages.
      Document information tab shows several entries for the same document for each language for childrens and backlinks.

      Here is proposed workaround for /webapps/xwiki/templates/macros.vm (not optimized for speed):

      ...
      #macro(displayDocumentList $docNames $displaySpaces $blacklistedSpaces)
        #set($prevspace=true)
        #set($prevdoc=true)
        #set($documentList = $util.getArrayList())
        #foreach($docName in $docNames)
          #if($xwiki.hasAccessLevel("view", $context.user, $docName))
            #set($document = $xwiki.getDocument($docName).getTranslatedDocument())
            #if(!$blacklistedSpaces.contains($document.getSpace()))
              #if($prevspace!=$document.getSpace())      
                #set($discard = $documentList.add($document))
      	#else
                #if($prevdoc.name!=$document.name)
                  #set($discard = $documentList.add($document))
      	  #end
      	#end  
            #end
            #set($prevspace=$document.getSpace())
            #set($prevdoc=$document)      
          #end
        #end
        #if($documentList.size() > 0)
      ...
      

      Probably to speed it up informationinline.vm macro should be fixed.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                vmassol Vincent Massol
                Reporter:
                valdisvi Valdis Vitolins
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Date of First Response: