## Macro title: Incoming Links ## Macro has a body: Y ## Body processing: ## Output: ## ## Developed by: Owen Conti with minor changes by Lars Strudsholm ## Date created: 21/03/2018 ## Installed by: Owen Conti/Lars Strudsholm ## @param IncomingLinkLabel:title=Incoming Link Label|type=string|desc=Label used to filter the incoming links.|required=false ## @param RequiresAllLabels:title=Requires All Labels|type=boolean|desc=If true, all labels specified must be present.|required=false ## @param IncomingLinkExclusionLabel:title=Incoming Link Exclusion Label|type=string|desc=Label used to filter the incoming links to exclude.|required=false ## @param RequiresAllLabelsToExclude:title=Exclusion Requires All Labels|type=boolean|desc=If true, all labels specified must be present to exclude the link.|required=false ## @param WhatToDisplay:title=What To Display|type=enum|enumValues=links,list,count|default=list|desc=Decide what to display #set($displayCount=0) ##incomingLinkIsExcluded determines if exclusion checks remove the link from being displayed, regardless of other checks #set( $incomingLinkIsExcluded=false ) ## Split the exclusion labels variable by comma and count how many labels we have to match against #set( $exclusionLabels = $paramIncomingLinkExclusionLabel.replaceAll(" ", "").split(",") ) #set( $exclusionLabelsCount = 0 ) #foreach( $exclusionLabel in $exclusionLabels) #set($exclusionLabel=$exclusionLabel.replaceAll(" ","")) #if($exclusionLabel.length() > 0) #set( $exclusionLabelsCount = $exclusionLabelsCount + 1 ) #end #end ## Split the labels variable by comma and count how many labels we have to match against #set( $matchingLabels = $paramIncomingLinkLabel.replaceAll(" ", "").split(",") ) #set( $matchingLabelsCount = 0 ) #foreach( $matchingLabel in $matchingLabels) #set($matchingLabel=$matchingLabel.replaceAll(" ","")) #if($matchingLabel.length() > 0) #set( $matchingLabelsCount = $matchingLabelsCount + 1 ) #end #end #if($paramWhatToDisplay.equals("links")) #elseif($paramWhatToDisplay.equals("list")) #elseif($paramWhatToDisplay.equals("count")) #if($displayCount==1) Found $displayCount Link. #else Found $displayCount Links. #end ##end if to display count #end