Changes for page Duncan1
Last modified by Alexandru Colesnicov on 2018/11/06 17:06
edited by Alexandru Colesnicov
on 2018/10/23 18:31
on 2018/10/23 18:31
edited by Alexandru Colesnicov
on 2018/10/31 16:22
on 2018/10/31 16:22
Change comment: There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -1,0 +1,58 @@ 1 +{{velocity}} 2 + 3 +#if("$!request.docName" != '') 4 + ## Request for creating a new instance 5 + #set($docName = ${request.docName}) 6 + #set($targetDocName = "${request.spaceName}.${docName}") 7 + #if(!$xwiki.exists($targetDocName) && $xwiki.hasAccessLevel('edit', $xcontext.user, $targetDocName)) 8 + $response.sendRedirect($xwiki.getURL($targetDocName, 'inline', "template=${escapetool.url($request.template)}&title=${request.docName}&parent=${escapetool.url($request.parent)}")) 9 + ## Stop processing, since we already sent a redirect. 10 + #stop 11 + #end 12 +#end 13 + 14 +{{python}} 15 +import sys 16 +print sys.path 17 +{{/python}} 18 + 19 += Add a new record = 20 + 21 +#if("$!targetDocName" != '' && $xwiki.exists($targetDocName)) 22 + {{warning}}The target document already exists. Please choose a different name, or [[view the existing document>>$targetDocName]]{{/warning}} 23 +#elseif("$!targetDocName" != '') 24 + {{warning}}You don't have permission to create that document{{/warning}} 25 +#end 26 + 27 +{{html}} 28 + <form action="" id="newdoc" method="post"> 29 + <div> 30 + <input type="hidden" name="parent" value="${doc.fullName}"/> 31 + <input type="hidden" name="template" value="Duncan1.Code.GDataTemplate"/> 32 + <input type="hidden" name="sheet" value="1"/> 33 + <input type="hidden" name="spaceName" value="Duncan1"/> 34 + Document: <input type="text" name="docName" value="Enter profession name here" class="withTip" size="50"/> 35 + <span class="buttonwrapper"><input type="submit" value="Create this record" class="button"/></span> 36 + </div> 37 + </form> 38 +{{/html}} 39 + 40 + 41 +#set ($columnsProperties = { 42 + 'doc.title': {"link":"view"}, 43 + 'QuaWoman': {"filterable":true,"sortable":true}, 44 + 'QuaMan': {"filterable":true,"sortable":true}, 45 + 'doc.author': {"link":"author"}, 46 + '_actions': {"sortable":false,"filterable":false,"html":true,"actions":["edit","delete"]} 47 +}) 48 +#set ($options = { 49 + 'className': 'Duncan1.Code.GDataClass', 50 + 'translationPrefix': 'Duncan1.livetable.', 51 + 'rowCount': 15, 52 + 'maxPages': 10, 53 + 'selectedColumn': 'doc.title', 54 + 'defaultOrder': 'asc' 55 +}) 56 +#set ($columns = ['doc.title', 'QuaWoman', 'QuaMan', 'doc.author', '_actions']) 57 +#livetable('Duncan1' $columns $columnsProperties $options) 58 +{{/velocity}}