0 Votes

Changes for page IncidentGallery

Last modified by Ryan C on 2025/07/17 06:41

From version 2.16
edited by Ryan C
on 2025/07/17 05:07
Change comment: There is no comment for this version
To version 3.5
edited by Ryan C
on 2025/07/17 05:39
Change comment: There is no comment for this version

Summary

Details

XWiki.WikiMacroClass[0]
Macro code
... ... @@ -1,6 +1,6 @@
1 -{{groovy}}
1 +{{groovy bindings="tags"}}
2 2  def includeTags = tags?.split(',')*.trim()*.toLowerCase().findAll { it }
3 -def maxCount = max?.toInteger() ?: 999
3 +def maxCount = 100
4 4  
5 5  def hql = """
6 6   select doc.fullName
... ... @@ -14,8 +14,6 @@
14 14  def results = []
15 15  
16 16  docs.each { docName ->
17 - if (results.size() >= maxCount) return
18 -
19 19   def doc = xwiki.getDocument(docName)
20 20   def obj = doc.getObject("Main Categories.Anti White Incidents.Code.MoviesClass")
21 21   if (!obj) return
... ... @@ -28,8 +28,8 @@
28 28   if (!title || !summary) return
29 29  
30 30   if (includeTags && tagList) {
31 - def tagNames = tagList.collect { it.toString().toLowerCase() }
32 - if (!tagNames.any { includeTags.contains(it) }) return
29 + def docTags = tagList.collect { it.toString().toLowerCase() }
30 + if (!docTags.any { includeTags.contains(it) }) return
33 33   }
34 34  
35 35   def isValidURL = externalURL?.startsWith("http://") || externalURL?.startsWith("https://")
... ... @@ -60,7 +60,7 @@
60 60  
61 61  if (results.isEmpty()) {
62 62   if (includeTags) {
63 - println "⚠️ No incidents found for tags: ${tags}"
61 + println "⚠️ No incidents found with selected tag(s): ${tags}"
64 64   } else {
65 65   println "⚠️ No incidents to display."
66 66   }
XWiki.WikiMacroParameterClass[0]
Parameter description
... ... @@ -1,1 +1,1 @@
1 -Comma-separated tag filters
1 +Categorize by tag
Parameter type
... ... @@ -1,1 +1,1 @@
1 -Wiki
1 +Macros.AntiWhiteTagClassClass.tags
XWiki.WikiMacroParameterClass[1]
Parameter description
... ... @@ -1,1 +1,0 @@
1 -Max number of returned incidents
Parameter mandatory
... ... @@ -1,1 +1,0 @@
1 -No
Parameter name
... ... @@ -1,1 +1,0 @@
1 -max
Parameter type
... ... @@ -1,1 +1,0 @@
1 -Wiki