[xwiki-devs] [Proposal] Add support for Default Values for XWiki Wiki Macros
Hi, I would like to add support for Default Values for XWiki Wiki Macros. It's not very difficult, as the XWiki Java Macros already have it. The required changes would be: - add default value property to XWiki.WikiMacroParameterClass - update DefaultWikiMacroFactory#buildMacro() to parse the new parameter - update WikiMacroParameterDescriptor with a new property for default value parameter, a new constructor and also update the getDefaultValue method Thanks, Anamaria
+1 Thanks, Marius Anamaria Stoica wrote:
Hi,
I would like to add support for Default Values for XWiki Wiki Macros. It's not very difficult, as the XWiki Java Macros already have it.
The required changes would be: - add default value property to XWiki.WikiMacroParameterClass - update DefaultWikiMacroFactory#buildMacro() to parse the new parameter - update WikiMacroParameterDescriptor with a new property for default value parameter, a new constructor and also update the getDefaultValue method
Thanks, Anamaria _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
On 02/26/2010 11:43 AM, Anamaria Stoica wrote:
Hi,
I would like to add support for Default Values for XWiki Wiki Macros. It's not very difficult, as the XWiki Java Macros already have it.
The required changes would be: - add default value property to XWiki.WikiMacroParameterClass - update DefaultWikiMacroFactory#buildMacro() to parse the new parameter - update WikiMacroParameterDescriptor with a new property for default value parameter, a new constructor and also update the getDefaultValue method
+1 -- Sergiu Dumitriu http://purl.org/net/sergiu/
Hi, I created the Jira issue: http://jira.xwiki.org/jira/browse/XWIKI-4944 and attached the corresponding patch to it. Thanks, Anamaria On Fri, Feb 26, 2010 at 1:07 PM, Sergiu Dumitriu <[email protected]> wrote:
On 02/26/2010 11:43 AM, Anamaria Stoica wrote:
Hi,
I would like to add support for Default Values for XWiki Wiki Macros. It's not very difficult, as the XWiki Java Macros already have it.
The required changes would be: - add default value property to XWiki.WikiMacroParameterClass - update DefaultWikiMacroFactory#buildMacro() to parse the new parameter - update WikiMacroParameterDescriptor with a new property for default value parameter, a new constructor and also update the getDefaultValue method
+1
-- Sergiu Dumitriu http://purl.org/net/sergiu/ _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
+1 Guillaume On Fri, Feb 26, 2010 at 12:41 PM, Anamaria Stoica <[email protected]>wrote:
Hi,
I created the Jira issue: http://jira.xwiki.org/jira/browse/XWIKI-4944 and attached the corresponding patch to it.
Thanks, Anamaria
On Fri, Feb 26, 2010 at 1:07 PM, Sergiu Dumitriu <[email protected]> wrote:
On 02/26/2010 11:43 AM, Anamaria Stoica wrote:
Hi,
I would like to add support for Default Values for XWiki Wiki Macros. It's not very difficult, as the XWiki Java Macros already have it.
The required changes would be: - add default value property to XWiki.WikiMacroParameterClass - update DefaultWikiMacroFactory#buildMacro() to parse the new parameter - update WikiMacroParameterDescriptor with a new property for default value parameter, a new constructor and also update the getDefaultValue method
+1
-- Sergiu Dumitriu http://purl.org/net/sergiu/ _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Guillaume Lerouge Product Manager - XWiki SAS Skype: wikibc Twitter: glerouge http://guillaumelerouge.com/
+1 - Asiri On Fri, Feb 26, 2010 at 4:13 PM, Anamaria Stoica <[email protected]>wrote:
Hi,
I would like to add support for Default Values for XWiki Wiki Macros. It's not very difficult, as the XWiki Java Macros already have it.
The required changes would be: - add default value property to XWiki.WikiMacroParameterClass - update DefaultWikiMacroFactory#buildMacro() to parse the new parameter - update WikiMacroParameterDescriptor with a new property for default value parameter, a new constructor and also update the getDefaultValue method
Thanks, Anamaria _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
+1 for the general: as soon as it's part of Macro and parameter descriptor it should be supported by wiki macros at some point anyway On Fri, Feb 26, 2010 at 11:43, Anamaria Stoica <[email protected]> wrote:
Hi,
I would like to add support for Default Values for XWiki Wiki Macros. It's not very difficult, as the XWiki Java Macros already have it.
The required changes would be: - add default value property to XWiki.WikiMacroParameterClass - update DefaultWikiMacroFactory#buildMacro() to parse the new parameter - update WikiMacroParameterDescriptor with a new property for default value parameter, a new constructor and also update the getDefaultValue method
Thanks, Anamaria _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne
Hi, Is my patch OK http://jira.xwiki.org/jira/browse/XWIKI-4944 ? Thanks, Anamaria On Fri, Feb 26, 2010 at 3:50 PM, Thomas Mortagne <[email protected]> wrote:
+1 for the general: as soon as it's part of Macro and parameter descriptor it should be supported by wiki macros at some point anyway
On Fri, Feb 26, 2010 at 11:43, Anamaria Stoica <[email protected]> wrote:
Hi,
I would like to add support for Default Values for XWiki Wiki Macros. It's not very difficult, as the XWiki Java Macros already have it.
The required changes would be: - add default value property to XWiki.WikiMacroParameterClass - update DefaultWikiMacroFactory#buildMacro() to parse the new parameter - update WikiMacroParameterDescriptor with a new property for default value parameter, a new constructor and also update the getDefaultValue method
Thanks, Anamaria _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
Anamaria Stoica wrote:
Hi,
Is my patch OK http://jira.xwiki.org/jira/browse/XWIKI-4944 ?
Looks good to me. I'll commit my fix for http://jira.xwiki.org/jira/browse/XWIKI-4946 as soon as I have support for default value in wiki macro (I need it to be able to test the fix, since currently there's no Java macro in the standard XE distribution that has required parameters with default value). Thanks, Marius
Thanks, Anamaria
On Fri, Feb 26, 2010 at 3:50 PM, Thomas Mortagne <[email protected]> wrote:
+1 for the general: as soon as it's part of Macro and parameter descriptor it should be supported by wiki macros at some point anyway
On Fri, Feb 26, 2010 at 11:43, Anamaria Stoica <[email protected]> wrote:
Hi,
I would like to add support for Default Values for XWiki Wiki Macros. It's not very difficult, as the XWiki Java Macros already have it.
The required changes would be: - add default value property to XWiki.WikiMacroParameterClass - update DefaultWikiMacroFactory#buildMacro() to parse the new parameter - update WikiMacroParameterDescriptor with a new property for default value parameter, a new constructor and also update the getDefaultValue method
Thanks, Anamaria _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
Hi, On Tue, Mar 9, 2010 at 4:10 PM, Marius Dumitru Florea < [email protected]> wrote:
Anamaria Stoica wrote:
Hi,
Is my patch OK http://jira.xwiki.org/jira/browse/XWIKI-4944 ?
Looks good to me. I'll commit my fix for http://jira.xwiki.org/jira/browse/XWIKI-4946 as soon as I have support for default value in wiki macro (I need it to be able to test the fix, since currently there's no Java macro in the standard XE distribution that has required parameters with default value).
I've applied anamaria's patch. See http://jira.xwiki.org/jira/browse/XWIKI-4944 The wysiwyg displays the default value as expected but it doesn't seem to set it correctly. I think this is what your patch is about. One question for anamaria: - If a default value is specified for a wiki macro parameter which is optional, shouldn't that default value be available to the wiki macro code even if the user does not specify anything? I did a quick test but did not get this result. May be i have understood the "default value" wrong. Thanks. - Asiri
Thanks, Marius
Thanks, Anamaria
On Fri, Feb 26, 2010 at 3:50 PM, Thomas Mortagne <[email protected]> wrote:
+1 for the general: as soon as it's part of Macro and parameter descriptor it should be supported by wiki macros at some point anyway
On Fri, Feb 26, 2010 at 11:43, Anamaria Stoica <[email protected]>
wrote:
Hi,
I would like to add support for Default Values for XWiki Wiki Macros. It's not very difficult, as the XWiki Java Macros already have it.
The required changes would be: - add default value property to XWiki.WikiMacroParameterClass - update DefaultWikiMacroFactory#buildMacro() to parse the new parameter - update WikiMacroParameterDescriptor with a new property for default value parameter, a new constructor and also update the getDefaultValue method
Thanks, Anamaria _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
On Wed, Mar 10, 2010 at 07:48, Asiri Rathnayake <[email protected]> wrote:
Hi,
On Tue, Mar 9, 2010 at 4:10 PM, Marius Dumitru Florea < [email protected]> wrote:
Anamaria Stoica wrote:
Hi,
Is my patch OK http://jira.xwiki.org/jira/browse/XWIKI-4944 ?
Looks good to me. I'll commit my fix for http://jira.xwiki.org/jira/browse/XWIKI-4946 as soon as I have support for default value in wiki macro (I need it to be able to test the fix, since currently there's no Java macro in the standard XE distribution that has required parameters with default value).
I've applied anamaria's patch. See http://jira.xwiki.org/jira/browse/XWIKI-4944
The wysiwyg displays the default value as expected but it doesn't seem to set it correctly. I think this is what your patch is about.
One question for anamaria:
- If a default value is specified for a wiki macro parameter which is optional, shouldn't that default value be available to the wiki macro code even if the user does not specify anything? I did a quick test but did not get this result. May be i have understood the "default value" wrong.
AFAIR the default value was supposed to be provided automatically as a parameter if not provided by the user.
Thanks.
- Asiri
Thanks, Marius
Thanks, Anamaria
On Fri, Feb 26, 2010 at 3:50 PM, Thomas Mortagne <[email protected]> wrote:
+1 for the general: as soon as it's part of Macro and parameter descriptor it should be supported by wiki macros at some point anyway
On Fri, Feb 26, 2010 at 11:43, Anamaria Stoica <[email protected]>
wrote:
Hi,
I would like to add support for Default Values for XWiki Wiki Macros. It's not very difficult, as the XWiki Java Macros already have it.
The required changes would be: - add default value property to XWiki.WikiMacroParameterClass - update DefaultWikiMacroFactory#buildMacro() to parse the new parameter - update WikiMacroParameterDescriptor with a new property for default value parameter, a new constructor and also update the getDefaultValue method
Thanks, Anamaria _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne
Hi, On Wed, Mar 10, 2010 at 12:17 PM, Thomas Mortagne <[email protected]> wrote:
On Wed, Mar 10, 2010 at 07:48, Asiri Rathnayake <[email protected]> wrote:
Hi,
On Tue, Mar 9, 2010 at 4:10 PM, Marius Dumitru Florea < [email protected]> wrote:
Anamaria Stoica wrote:
Hi,
Is my patch OK http://jira.xwiki.org/jira/browse/XWIKI-4944 ?
Looks good to me. I'll commit my fix for http://jira.xwiki.org/jira/browse/XWIKI-4946 as soon as I have support for default value in wiki macro (I need it to be able to test the fix, since currently there's no Java macro in the standard XE distribution that has required parameters with default value).
I've applied anamaria's patch. See http://jira.xwiki.org/jira/browse/XWIKI-4944
The wysiwyg displays the default value as expected but it doesn't seem to set it correctly. I think this is what your patch is about.
One question for anamaria:
- If a default value is specified for a wiki macro parameter which is optional, shouldn't that default value be available to the wiki macro code even if the user does not specify anything? I did a quick test but did not get this result. May be i have understood the "default value" wrong.
AFAIR the default value was supposed to be provided automatically as a parameter if not provided by the user.
Yes, that's how it should behave. I created a small patch to take care of that too, see: http://jira.xwiki.org/jira/browse/XWIKI-4944?focusedCommentId=49570&page=com... ( XWIKI-4944_patch_return_default_values.txt ) Thanks, Anamaria
Thanks.
- Asiri
Thanks, Marius
Thanks, Anamaria
On Fri, Feb 26, 2010 at 3:50 PM, Thomas Mortagne <[email protected]> wrote:
+1 for the general: as soon as it's part of Macro and parameter descriptor it should be supported by wiki macros at some point anyway
On Fri, Feb 26, 2010 at 11:43, Anamaria Stoica <[email protected]>
wrote:
Hi,
I would like to add support for Default Values for XWiki Wiki Macros. It's not very difficult, as the XWiki Java Macros already have it.
The required changes would be: - add default value property to XWiki.WikiMacroParameterClass - update DefaultWikiMacroFactory#buildMacro() to parse the new parameter - update WikiMacroParameterDescriptor with a new property for default value parameter, a new constructor and also update the getDefaultValue method
Thanks, Anamaria _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
Hi Anamaria, Yes, that's how it should behave. I created a small patch to take care
of that too, see:
http://jira.xwiki.org/jira/browse/XWIKI-4944?focusedCommentId=49570&page=com... ( XWIKI-4944_patch_return_default_values.txt )
You need a test case to make sure that this works. There are two options: 1. Check DefaultWikiMacroTest, you need to add a test which registers a wiki macro containing a script like {{velocity}}$xcontext.macro.params.param1{{/velocity}} and verify the output of the wiki macro. 2. Use mocks to avoid actual macro execution and check whether parameters are set correctly. I would prefer (1) because it sounds easy ;) Thanks. - Asiri
Thanks, Anamaria
Thanks.
- Asiri
Thanks, Marius
Thanks, Anamaria
On Fri, Feb 26, 2010 at 3:50 PM, Thomas Mortagne <[email protected]> wrote:
+1 for the general: as soon as it's part of Macro and parameter descriptor it should be supported by wiki macros at some point
anyway
On Fri, Feb 26, 2010 at 11:43, Anamaria Stoica <
[email protected]> wrote:
> Hi, > > I would like to add support for Default Values for XWiki Wiki Macros. > It's not very difficult, as the XWiki Java Macros already have it. > > The required changes would be: > - add default value property to XWiki.WikiMacroParameterClass > - update DefaultWikiMacroFactory#buildMacro() to parse the new parameter > - update WikiMacroParameterDescriptor with a new property for default > value parameter, a new constructor and also > update the getDefaultValue method > > Thanks, > Anamaria > _______________________________________________ > devs mailing list > [email protected] > http://lists.xwiki.org/mailman/listinfo/devs >
-- Thomas Mortagne _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
Hi, Is my patch OK http://jira.xwiki.org/jira/browse/XWIKI-4944 ?
I'll review and apply this patch by tomorrow. I've been bit involved with some other stuff. Thanks. - Asiri
participants (6)
-
Anamaria Stoica -
Asiri Rathnayake -
Guillaume Lerouge -
Marius Dumitru Florea -
Sergiu Dumitriu -
Thomas Mortagne