From version 1.1 >
edited by Alexandru Colesnicov
on 2018/10/23 18:31
To version < 7.1 >
edited by Alexandru Colesnicov
on 2018/10/31 16:23
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -1,0 +1,62 @@
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 +{{/velocity}}
15 +
16 +{{python}}
17 +import sys
18 +print sys.path
19 +{{/python}}
20 +
21 +{{velocity}}
22 +
23 += Add a new record =
24 +
25 +#if("$!targetDocName" != '' && $xwiki.exists($targetDocName))
26 + {{warning}}The target document already exists. Please choose a different name, or [[view the existing document>>$targetDocName]]{{/warning}}
27 +#elseif("$!targetDocName" != '')
28 + {{warning}}You don't have permission to create that document{{/warning}}
29 +#end
30 +
31 +{{html}}
32 + <form action="" id="newdoc" method="post">
33 + <div>
34 + <input type="hidden" name="parent" value="${doc.fullName}"/>
35 + <input type="hidden" name="template" value="Duncan1.Code.GDataTemplate"/>
36 + <input type="hidden" name="sheet" value="1"/>
37 + <input type="hidden" name="spaceName" value="Duncan1"/>
38 + Document: <input type="text" name="docName" value="Enter profession name here" class="withTip" size="50"/>
39 + <span class="buttonwrapper"><input type="submit" value="Create this record" class="button"/></span>
40 + </div>
41 + </form>
42 +{{/html}}
43 +
44 +
45 +#set ($columnsProperties = {
46 + 'doc.title': {"link":"view"},
47 + 'QuaWoman': {"filterable":true,"sortable":true},
48 + 'QuaMan': {"filterable":true,"sortable":true},
49 + 'doc.author': {"link":"author"},
50 + '_actions': {"sortable":false,"filterable":false,"html":true,"actions":["edit","delete"]}
51 +})
52 +#set ($options = {
53 + 'className': 'Duncan1.Code.GDataClass',
54 + 'translationPrefix': 'Duncan1.livetable.',
55 + 'rowCount': 15,
56 + 'maxPages': 10,
57 + 'selectedColumn': 'doc.title',
58 + 'defaultOrder': 'asc'
59 +})
60 +#set ($columns = ['doc.title', 'QuaWoman', 'QuaMan', 'doc.author', '_actions'])
61 +#livetable('Duncan1' $columns $columnsProperties $options)
62 +{{/velocity}}

Need help?

If you need help with XWiki you can contact: