Show last authors
1 #includeMacros("Main.MacroSheet")#includeMacros("Theses.MacroSheet")
2 1 Thesis Class
3 #set( $class = $doc.name.substring(0,$doc.name.indexOf("Class")))
4 #set($defaultparent = "Theses.${class}Class")
5 #set($defaultweb = "Theses")
6 ## $doc1new is set to ThesisClassSheet
7 #set( $doc1new = $xwiki.getDocument("${doc.web}.${class}ClassSheet").isNew())
8 ## $doc2new is set to ThesisClassTemplate
9 #set( $doc2new = $xwiki.getDocument("${doc.web}.${class}ClassTemplate").isNew())
10 ##
11 #if ($context.getUser() != "XWiki.XWikiGuest")
12
13 1.1 Edit Thesis Class
14
15 * Read the [List of Fields| Theses.Fields] page to understand the meaning and role of each field (property).
16 * <a href="$doc.getURL("edit", "xpage=editclass")">Edit the Class</a> to add &amp; modify properties.
17
18 #if (!($doc1new||$doc2new))
19
20 1.1 Edit Thesis Sheet and Template
21
22 #set($templatedoc = $xwiki.getDocument("${doc.web}.${class}ClassTemplate"))
23 #set($hasobj = $templatedoc.getObject("${doc.web}.${class}Class"))
24 #if(!$hasobj)
25 #set($xredirect = $request.getRequestURL())
26 #set($createUrl = $templatedoc.getURL("objectadd", "classname=${doc.web}.${class}Class&amp;xredirect=${xredirect}"))
27 #set($m = "The template does not have an object of class ${class}Class. <a href='$createUrl'>Click here to add it</a>.")
28 #warning($m)
29 #end
30
31 * Sheet: [${doc.web}.${class}ClassSheet]
32 * Template: [${doc.web}.${class}ClassTemplate]
33 * [View the sample code to show the document list and create new documents>XWiki.ClassSheet?xpage=code]
34
35 1.1 Edit Macro Sheet
36
37 * Macro Sheet: [${doc.web}.MacroSheet]
38
39 1.1 Existing Thesis Documents
40
41 #set ($sql = ", BaseObject as obj where obj.name=doc.fullName and obj.className='${doc.web}.${class}Class' and obj.name<>'${doc.web}.${class}ClassTemplate'")
42 #set($thesisDocList = $xwiki.searchDocuments($sql))
43 #set($thesisDocNo = $thesisDocList.size())
44 Currently, there are $thesisDocNo Thesis documents in the #apice() space.
45
46 #set($sortedThesisDocs=$xwiki.sort($thesisDocList))
47 #foreach ($thesis in $sortedThesisDocs)
48 #if ($velocityCount > 1) | #end[$thesis] #if($context.getUser() != "XWiki.XWikiGuest")<a href="$xwiki.getURL("$thesis", "inline")"><img alt="$msg.get('panels.documentInformation.editIncluded', [$page])" src="$xwiki.getSkinFile('icons/silk/page_white_edit.gif')" /></a>#end#end
49 #else
50
51 1 Create templates and sheets
52
53 Before using this class you must first create the sheet and template for it. Follow the instructions below to do this.
54
55 #if ($doc1new)
56 <form action="$xwiki.getURL("${doc.web}.${class}ClassSheet","edit")" method="post">
57 <div>
58 <input type="hidden" name="parent" value="${doc.web}.${class}Class"/>
59 <input type="hidden" name="template" value="XWiki.ClassItemSheet"/>
60 <input type="hidden" name="sheet" value="1"/>
61 <input type="submit" value="Create the document sheet"/>
62 </div>
63 </form>
64 #else
65 The Sheet allows to control the presentation of documents using the class you define. You can use the default presentation which looks for all available fields and presents them in a table, or you can decide to write your own presentation showing only part of the fields. You can also decide to have a different presentation for the viewing and for the editing modes.
66 * [${class}ClassSheet]
67 #end
68
69 #if ($doc2new)
70 <form action="$xwiki.getURL("${doc.web}.${class}ClassTemplate","edit")" method="post">
71 <div>
72 <input type="hidden" name="parent" value="${doc.web}.${class}Class"/>
73 <input type="hidden" name="template" value="XWiki.ClassItemTemplate"/>
74 <input type="hidden" name="sheet" value="1"/>
75 <input type="submit" value="Create the document template"/>
76 </div>
77 </form>
78 #else
79 The template is the document that will be "copied" into the new document that you create. It will automatically contain a reference to the Sheet defined previously and an instance of the object of your Class.
80
81 You need to add the instance of your class manually using the "Edit Objects" link in the right menu and also modify the content of the template to reference update the class name. You should also customize the parent field which will be the default parent of all documents that are created using the class.
82 * [${class}ClassTemplate]
83 #end
84 #end
85
86 #else
87
88 #warning("This page is not available for inspection by external viewers!")
89
90 #end

2008 © aliCE Research Group @ DEIS, Alma Mater Studiorum-Università di Bologna
0.2