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

Offer the script languages and the Velocity filters as lists in the Edit Macro dialog

    XMLWordPrintable

Details

    • Unknown

    Description

      The script and velocity macros take an identifier chosen among the components installed on the wiki in a free text field, so the user has to know it and a wrong one is accepted or refused with a technical message.

      The macros to change, with the file where most of the fix is done:

      The main problem:

      • The values are components, script engines and Velocity filters, so the list has to be computed on the wiki rather than fixed in the macro.

      A value outside these lists must also fail when the macro renders, with an error that names the parameter and lists the accepted values, instead of being ignored or giving a technical message.

      Depends on

      Most of these fields cannot be offered before these generic changes, each giving the macro the means to declare the expected value:

      • XWIKI-23045, which lets a parameter get its values from a provider, with or without custom values.

      KOs covered

      Macro Criterion Parameter Problem Depends on
      script C4 input-assistance language A free text field for an identifier chosen among the script engines installed on the wiki; a wrong value is refused with a message about the engine. XWIKI-23045
      velocity C4 input-assistance filter A free text field for one of the filters none, indent and html; a wrong value is accepted silently. XWIKI-23045
      script E2 errors language A wrong language, like "nosuchlanguage" or "PYTHON", gives "Can't find script engine with name [...]", which names the engine but not the parameter, and an empty language renders the script as plain text. Partly covered, see below.  
      velocity E2 errors filter filter="nosuchfilter", filter="Indent" with a wrong case and filter="a b" render as if the parameter was not set, with no message. Partly covered, see below.  

      Impact found on macro fluidity

      These 4 KOs come from the WYSIWYG usability audit of the macros, under the criteria C4 input-assistance and E2 errors of its usability criteria. The page of each macro, linked in the table, has the full notes and the steps to reproduce. Fixing them means changing the declaration of the parameters in the macro definitions.

      The E2 errors KOs of script and velocity are only partly covered here, for the language and the filter. The same KOs also report other invalid values, covered by the other issues listed on the page of each macro, among them XCOMMONS-3847 for the conversion of the values and XRENDERING-823 for the wording of the error. The jars parameter of both is covered by XWIKI-25509 and by its own issue.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Lucas C Charpentier Lucas
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: