There is 1 update.
 
 
PlantUML Macro / cid:jira-generated-image-avatar-22e1cb94-030f-4055-ad55-011c58c9f275 PLANTUML-37 Open

Declare the URL format of the server parameter of the PlantUML macro

 
View issue   ยท   Add comment
 

1 update

 
cid:jira-generated-image-avatar-3c0ec129-c792-49af-be9b-d1cca512c1dd Changes by Charpentier Lucas on 23/Oct/26 16:53
 
Description: The server parameter of the PlantUML macro takes a URL in a text field of the Edit Macro dialog, but declares no format, so the dialog accepts any text and the user only finds out at rendering.

The fix is done in [PlantUMLMacroParameters.java|https://github.com/xwiki-contrib/macro-plantuml/blob/master/macro-plantuml-macro/src/main/java/org/xwiki/contrib/plantuml/PlantUMLMacroParameters.java]:
* Declare the URL format of the server parameter, for example with a {{@Pattern}} annotation. Whether the domain is trusted can still only be checked at rendering.

A call with no content must also fail with a message saying that a diagram is expected, instead of a NullPointerException message.

h2. Depends on
* XWIKI-25287, without which the Edit Macro dialog does not enforce the declared format and the value is only checked when the macro is rendered.

h2. KOs covered
||Macro||Criterion||Parameter||Problem||Depends on||
|[plantuml|https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Macros/plantuml/]|C13 constraints|{{server}}|A URL with no declared format: "abc" is accepted and fails at rendering with "no protocol: abc".|XWIKI-25287|
|[plantuml|https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Macros/plantuml/]|E2 errors|{{server}}, {{$content}}|server="abc" gives "no protocol: abc", the cause "Invalid PlantUML Server URL" being only in the details, and a call with no content gives "Cannot invoke "String.trim()" because "content" is null". Partly covered, see below.| |

h2. Impact found on macro fluidity
This KO comes These 2 KOs come from the [WYSIWYG usability audit of the macros|https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Macros/], under the criterion criteria C13 constraints and E2 errors of its [usability criteria|https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Usability%20criteria/]. The page of the macro, linked in the table, has the full notes and the steps to reproduce. Fixing it means declaring the format of one parameter of the macro.

The E2 errors KO of plantuml is only partly covered here, for the server and the content. The same KO also reports other invalid values, covered by the other issues listed on the page of the macro, among them XCOMMONS-3847 for the conversion of the values and XRENDERING-823 for the wording of the error.