Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

XWIKI-8152: Documents Macro shouldn't accept any content

XWIKI-8153: Allow passing the list of columns to use for the Documents macro
  • Loading branch information...
commit eed04f7855ac43372595528a1ae1dd5c9e698907 1 parent 2ba9572
@vmassol vmassol authored
View
87 .../xwiki-platform-index/xwiki-platform-index-ui/src/main/resources/XWiki/DocumentsMacro.xml
@@ -12,8 +12,8 @@
<customClass/>
<contentAuthor>xwiki:XWiki.Admin</contentAuthor>
<creationDate>1329065296000</creationDate>
- <date>1329123052000</date>
- <contentUpdateDate>1329123052000</contentUpdateDate>
+ <date>1345365384000</date>
+ <contentUpdateDate>1345365384000</contentUpdateDate>
<version>1.1</version>
<title>Documents Macro</title>
<template/>
@@ -139,8 +139,17 @@
<guid>27ec7479-a26b-4b03-a6ec-576f00eecbf3</guid>
<property>
<code>{{velocity}}
-#set($collist = ['doc.name', 'doc.space', 'doc.date', 'doc.author'])
+#if ("$!xcontext.macro.params.columns" != "")
+ #set ($collist = [])
+ #foreach ($colname in $xcontext.macro.params.columns.split(','))
+ #set ($discard = $collist.add($colname.trim()))
+ #end
+#else
+ #set($collist = ['doc.name', 'doc.space', 'doc.date', 'doc.author'])
+#end
#set($colprops = {
+ 'doc.title' : { 'type' : 'text' , 'size' : 30, 'link' : 'view' },
+ 'doc.fullName' : { 'type' : 'text' , 'size' : 30, 'link' : 'view' },
'doc.name' : { 'type' : 'text' , 'size' : 30, 'link' : 'view' },
'doc.space' : { 'type' : 'text', 'link' : 'space' },
'doc.date' : { 'type' : 'date' },
@@ -177,7 +186,7 @@
<contentDescription/>
</property>
<property>
- <contentType>Optional</contentType>
+ <contentType>No content</contentType>
</property>
<property>
<defaultCategory>Content</defaultCategory>
@@ -528,15 +537,81 @@
<name>parent</name>
</property>
</object>
+ <object>
+ <class>
+ <name>XWiki.WikiMacroParameterClass</name>
+ <customClass/>
+ <customMapping/>
+ <defaultViewSheet/>
+ <defaultEditSheet/>
+ <defaultWeb/>
+ <nameField/>
+ <validationScript/>
+ <defaultValue>
+ <disabled>0</disabled>
+ <name>defaultValue</name>
+ <number>4</number>
+ <prettyName>Parameter default value</prettyName>
+ <size>30</size>
+ <unmodifiable>0</unmodifiable>
+ <classType>com.xpn.xwiki.objects.classes.StringClass</classType>
+ </defaultValue>
+ <description>
+ <disabled>0</disabled>
+ <name>description</name>
+ <number>2</number>
+ <prettyName>Parameter description</prettyName>
+ <rows>5</rows>
+ <size>40</size>
+ <unmodifiable>0</unmodifiable>
+ <classType>com.xpn.xwiki.objects.classes.TextAreaClass</classType>
+ </description>
+ <mandatory>
+ <disabled>0</disabled>
+ <displayFormType>select</displayFormType>
+ <displayType>yesno</displayType>
+ <name>mandatory</name>
+ <number>3</number>
+ <prettyName>Parameter mandatory</prettyName>
+ <unmodifiable>0</unmodifiable>
+ <classType>com.xpn.xwiki.objects.classes.BooleanClass</classType>
+ </mandatory>
+ <name>
+ <disabled>0</disabled>
+ <name>name</name>
+ <number>1</number>
+ <prettyName>Parameter name</prettyName>
+ <size>30</size>
+ <unmodifiable>0</unmodifiable>
+ <classType>com.xpn.xwiki.objects.classes.StringClass</classType>
+ </name>
+ </class>
+ <name>XWiki.DocumentsMacro</name>
+ <number>5</number>
+ <className>XWiki.WikiMacroParameterClass</className>
+ <guid>48fedb20-7177-4998-b377-feae7128b0eb</guid>
+ <property>
+ <defaultValue/>
+ </property>
+ <property>
+ <description>Specifies the list of columns to display (e.g. "doc.name,doc.space"). If not specified then the default column list of used ("doc.name,doc.space,doc.date,doc.author")</description>
+ </property>
+ <property>
+ <mandatory>0</mandatory>
+ </property>
+ <property>
+ <name>columns</name>
+ </property>
+ </object>
<content>Example:
{{box}}
{{{
-{{documents count="5" actions="false" space="Main" parent="Main.WebHome"/}}
+{{documents count="5" actions="false" space="Main" parent="Main.WebHome" columns="doc.title"/}}
}}}
{{/box}}
Generates:
-{{documents count="5" actions="false" space="Main" parent="Main.WebHome"/}}</content>
+{{documents count="5" actions="false" space="Main" parent="Main.WebHome" columns="doc.title"/}}</content>
</xwikidoc>
View
2  ...i-platform-core/xwiki-platform-oldcore/src/main/resources/ApplicationResources.properties
@@ -2884,6 +2884,8 @@ platform.index.doc.name=Page
platform.index.doc.space=Space
platform.index.doc.date=Date
platform.index.doc.author=Last Author
+platform.index.doc.title=Page
+platform.index.doc.fullName=Page
platform.index._actions=Actions
platform.index.emptyvalue=
Please sign in to comment.
Something went wrong with that request. Please try again.