Skip to content
Snippets Groups Projects
Commit f5733b72 authored by Vincent Massol's avatar Vincent Massol
Browse files

XWIKI-13645: Editing a wiki macro in object mode should show the wiki editor...

XWIKI-13645: Editing a wiki macro in object mode should show the wiki editor for all text area properties
* For the 8.2.x branch

XWIKI-13668: The code xproperty for XWikiMacroClass should be "Text" and not "PureText"
* For master
parent 5549353c
No related branches found
No related tags found
No related merge requests found
...@@ -138,12 +138,14 @@ private WikiMacro buildMacro(XWikiDocument doc) throws WikiMacroException ...@@ -138,12 +138,14 @@ private WikiMacro buildMacro(XWikiDocument doc) throws WikiMacroException
// Extract macro definition. // Extract macro definition.
String macroId = macroDefinition.getStringValue(MACRO_ID_PROPERTY); String macroId = macroDefinition.getStringValue(MACRO_ID_PROPERTY);
String macroName = macroDefinition.getStringValue(MACRO_NAME_PROPERTY); String macroName = macroDefinition.getStringValue(MACRO_NAME_PROPERTY);
// The macro description as plain text
String macroDescription = macroDefinition.getStringValue(MACRO_DESCRIPTION_PROPERTY); String macroDescription = macroDefinition.getStringValue(MACRO_DESCRIPTION_PROPERTY);
String macroDefaultCategory = macroDefinition.getStringValue(MACRO_DEFAULT_CATEGORY_PROPERTY); String macroDefaultCategory = macroDefinition.getStringValue(MACRO_DEFAULT_CATEGORY_PROPERTY);
WikiMacroVisibility macroVisibility = WikiMacroVisibility macroVisibility =
WikiMacroVisibility.fromString(macroDefinition.getStringValue(MACRO_VISIBILITY_PROPERTY)); WikiMacroVisibility.fromString(macroDefinition.getStringValue(MACRO_VISIBILITY_PROPERTY));
boolean macroSupportsInlineMode = (macroDefinition.getIntValue(MACRO_INLINE_PROPERTY) == 0) ? false : true; boolean macroSupportsInlineMode = (macroDefinition.getIntValue(MACRO_INLINE_PROPERTY) == 0) ? false : true;
String macroContentType = macroDefinition.getStringValue(MACRO_CONTENT_TYPE_PROPERTY); String macroContentType = macroDefinition.getStringValue(MACRO_CONTENT_TYPE_PROPERTY);
// The macro content description as plain text
String macroContentDescription = macroDefinition.getStringValue(MACRO_CONTENT_DESCRIPTION_PROPERTY); String macroContentDescription = macroDefinition.getStringValue(MACRO_CONTENT_DESCRIPTION_PROPERTY);
String macroCode = macroDefinition.getStringValue(MACRO_CODE_PROPERTY); String macroCode = macroDefinition.getStringValue(MACRO_CODE_PROPERTY);
......
...@@ -61,6 +61,7 @@ public boolean updateDocument(XWikiDocument document) ...@@ -61,6 +61,7 @@ public boolean updateDocument(XWikiDocument document)
needsUpdate |= bclass.addTextField(MACRO_ID_PROPERTY, "Macro id", 30); needsUpdate |= bclass.addTextField(MACRO_ID_PROPERTY, "Macro id", 30);
needsUpdate |= bclass.addTextField(MACRO_NAME_PROPERTY, "Macro name", 30); needsUpdate |= bclass.addTextField(MACRO_NAME_PROPERTY, "Macro name", 30);
// The Macro description is using plain text (same as for Java Macros).
needsUpdate |= bclass.addTextAreaField(MACRO_DESCRIPTION_PROPERTY, "Macro description", 40, 5, needsUpdate |= bclass.addTextAreaField(MACRO_DESCRIPTION_PROPERTY, "Macro description", 40, 5,
TextAreaClass.EditorType.PURE_TEXT); TextAreaClass.EditorType.PURE_TEXT);
needsUpdate |= bclass.addTextField(MACRO_DEFAULT_CATEGORY_PROPERTY, "Default category", 30); needsUpdate |= bclass.addTextField(MACRO_DEFAULT_CATEGORY_PROPERTY, "Default category", 30);
...@@ -69,11 +70,13 @@ public boolean updateDocument(XWikiDocument document) ...@@ -69,11 +70,13 @@ public boolean updateDocument(XWikiDocument document)
"Current User|Current Wiki|Global", ListClass.DISPLAYTYPE_SELECT, PROPERTY_PIPE); "Current User|Current Wiki|Global", ListClass.DISPLAYTYPE_SELECT, PROPERTY_PIPE);
needsUpdate |= bclass.addStaticListField(MACRO_CONTENT_TYPE_PROPERTY, "Macro content type", 1, false, needsUpdate |= bclass.addStaticListField(MACRO_CONTENT_TYPE_PROPERTY, "Macro content type", 1, false,
"Optional|Mandatory|No content", ListClass.DISPLAYTYPE_SELECT, PROPERTY_PIPE); "Optional|Mandatory|No content", ListClass.DISPLAYTYPE_SELECT, PROPERTY_PIPE);
// The Macro content description is using plain text (same as for Java Macros).
needsUpdate |= bclass.addTextAreaField(MACRO_CONTENT_DESCRIPTION_PROPERTY, needsUpdate |= bclass.addTextAreaField(MACRO_CONTENT_DESCRIPTION_PROPERTY,
"Content description (Not applicable for \"No content\" type)", 40, 5, "Content description (Not applicable for \"No content\" type)", 40, 5,
TextAreaClass.EditorType.PURE_TEXT); TextAreaClass.EditorType.PURE_TEXT);
// The code property contains wiki markup
needsUpdate |= bclass.addTextAreaField(MACRO_CODE_PROPERTY, "Macro code", 40, 20, needsUpdate |= bclass.addTextAreaField(MACRO_CODE_PROPERTY, "Macro code", 40, 20,
TextAreaClass.EditorType.PURE_TEXT); TextAreaClass.EditorType.TEXT);
needsUpdate |= setClassDocumentFields(document, "XWiki Wiki Macro Class"); needsUpdate |= setClassDocumentFields(document, "XWiki Wiki Macro Class");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment