Changes for page SubmitIncidentMacro
Summary
Details
- XWiki.WikiMacroClass[0]
-
- Macro code
-
... ... @@ -1,31 +1,41 @@ 1 1 {{velocity}} 2 -# # Justdisplay formatted text,don'ttry to modify thepage3 -# set($headline= "$!wikimacro.parameters.headline")4 -#set($ url ="$!wikimacro.parameters.url")5 -#set($ description="$!wikimacro.parameters.description")6 -#set($ image ="$!wikimacro.parameters.image")2 +#set($request = $request) 3 +#if($request.getParameter("submitIncident")) 4 + #set($headline = $request.getParameter("headline")) 5 + #set($url = $request.getParameter("url")) 6 + #set($desc = $request.getParameter("description")) 7 7 8 -## Format for display only 9 -=== Incident Preview === 8 +#set($block = ''' 9 +(% style="margin-bottom:20px; width:100%" %) 10 +|[[image:PLACEHOLDER.jpg||alt="image" data-xwiki-image-style="thumbnail-clickable" style="border:1px solid #cccccc" width="200"]]| 10 10 11 -|#if($image && $image != "")[[image:$image||width="200"]]#{else}No image#{end}| 12 -=== [[$headline>>$url]] === 12 +=== [[${headline}>>${url}]] === 13 13 14 -$description 14 +${desc} 15 +[[Read More>>${url}]] 16 +''') 15 15 16 -[[Read More>>$url]] 17 17 18 -<div style="margin-top:10px; background-color:#f8f9fa; padding:10px; border:1px solid #ddd; border-radius:4px;"> 19 - <strong>Note:</strong> This is just a preview. Copy the wiki syntax below and paste it where needed. 20 -</div> 19 + #set($doc = $xwiki.getDocument($doc.fullName)) 20 + #set($content = $doc.getContent()) 21 + $doc.setContent("${content}\n\n${block}") 22 + $doc.save() 21 21 22 -<pre style="background-color:#f5f5f5; padding:10px; border:1px solid #ddd; overflow:auto;"> 23 -(% style="margin-bottom:20px; width:100%" %) 24 -|#if($image && $image != "")[[image:$image||data-xwiki-image-style="thumbnail-clickable" style="border:1px solid #ccc" width="200"]]#{else}No image provided.#{end}| 24 + <div class=\"xwiki-messages xwiki-successmessage\">Incident added to page.</div> 25 +#end 25 25 26 -=== [[$headline>>$url]] === 27 +<form method="post"> 28 + <h3>Add Incident</h3> 29 + <label>Headline:</label><br/> 30 + <input type="text" name="headline" style="width:100%" /><br/><br/> 27 27 28 -$description 29 -[[Read More>>$url]] 30 -</pre> 32 + <label>URL:</label><br/> 33 + <input type="text" name="url" style="width:100%" /><br/><br/> 34 + 35 + <label>Description:</label><br/> 36 + <textarea name="description" rows="4" style="width:100%"></textarea><br/><br/> 37 + 38 + <input type="submit" name="submitIncident" value="Submit Incident" /> 39 +</form> 31 31 {{/velocity}} 41 + - Macro content type
-
... ... @@ -1,1 +1,0 @@ 1 -Unknown - Macro visibility
-
... ... @@ -1,1 +1,0 @@ 1 -Current Wiki
- XWiki.WikiMacroParameterClass[0]
-
- Parameter advanced
-
... ... @@ -1,0 +1,1 @@ 1 +No - Parameter feature mandatory.
-
... ... @@ -1,0 +1,1 @@ 1 +No - Parameter hidden
-
... ... @@ -1,0 +1,1 @@ 1 +No - Parameter type
-
... ... @@ -1,1 +1,0 @@ 1 -Unknown
- XWiki.WikiMacroParameterClass[1]
-
- Parameter advanced
-
... ... @@ -1,0 +1,1 @@ 1 +No - Parameter description
-
... ... @@ -1,1 +1,5 @@ 1 + 2 + 1 1 The source URL of the incident (link) 4 + 5 + - Parameter feature mandatory.
-
... ... @@ -1,0 +1,1 @@ 1 +No - Parameter hidden
-
... ... @@ -1,0 +1,1 @@ 1 +No - Parameter type
-
... ... @@ -1,1 +1,0 @@ 1 -Unknown
- XWiki.WikiMacroParameterClass[3]
-
- Parameter deprecated
-
... ... @@ -1,1 +1,0 @@ 1 -No - Parameter description
-
... ... @@ -1,1 +1,0 @@ 1 -Description of the incident - Parameter group
-
... ... @@ -1,1 +1,0 @@ 1 -Main Info - Parameter mandatory
-
... ... @@ -1,1 +1,0 @@ 1 -Yes - Parameter name
-
... ... @@ -1,1 +1,0 @@ 1 -description - Parameter type
-
... ... @@ -1,1 +1,0 @@ 1 -Wiki
- XWiki.WikiMacroParameterClass[4]
-
- Parameter description
-
... ... @@ -1,1 +1,0 @@ 1 -Upload or select an image to display with the incident (e.g. myimage.jpg) - Parameter mandatory
-
... ... @@ -1,1 +1,0 @@ 1 -No - Parameter name
-
... ... @@ -1,1 +1,0 @@ 1 -image - Parameter type
-
... ... @@ -1,1 +1,0 @@ 1 -Unknown
- XWiki.WikiMacroParameterClass[2]
-
- Parameter advanced
-
... ... @@ -1,0 +1,1 @@ 1 +No - Parameter deprecated
-
... ... @@ -1,0 +1,1 @@ 1 +No - Parameter description
-
... ... @@ -1,0 +1,1 @@ 1 +The name of the image attached to this page (e.g. myimage.jpg) - Parameter feature mandatory.
-
... ... @@ -1,0 +1,1 @@ 1 +No - Parameter group
-
... ... @@ -1,0 +1,1 @@ 1 +Media - Parameter hidden
-
... ... @@ -1,0 +1,1 @@ 1 +No - Parameter mandatory
-
... ... @@ -1,0 +1,1 @@ 1 +No - Parameter name
-
... ... @@ -1,0 +1,1 @@ 1 +Image - Parameter type
-
... ... @@ -1,0 +1,1 @@ 1 +org.xwiki.rendering.macro.descriptor.parameter.DocumentResourceReference