<
From version < 110.2 >
edited by Hassan Ali
on 2020/02/22
To version < 111.1 >
edited by Vincent Massol
on 2020/03/22
>
Change comment: Rollback to version 109.1

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.Haxsen
1 +XWiki.VincentMassol
Content
... ... @@ -12,7 +12,6 @@
12 12  
13 13  {{warning}}
14 14  If you've already followed the [[AWM FAQ Tutorial>>Documentation.DevGuide.FAQTutorial.FAQTutorialAWM]] or installed the [[FAQ Application>>extensions:Extension.FAQ Application]] you'll need to do one of 2 things before you can take this tutorial:
15 -
16 16  * Delete the ##FAQ## space (if you've followed the AWM FAQ Tutorial) or uninstall the FAQ Application (if you've installed the FAQ Application)
17 17  * or simply follow the tutorial below but replace the space ##FAQ## with another value everywhere it's used. For example use ##MyFAQ## as the space name instead.
18 18  {{/warning}}
... ... @@ -31,31 +31,13 @@
31 31  
32 32  Let us begin by taking a look at what we are going to build. The new application will have the following views:
33 33  
34 -* (((
35 -(% class="wikigeneratedid" id="HTheFAQClass" %)
36 -The FAQ [[Class>>FAQ.WhatIsAClass]]
33 +* The FAQ [[Class>>FAQ.WhatIsAClass]]
34 +{{image reference="FAQsSummary.png"/}}
35 +* An FAQ entry in View mode
36 +{{image reference="FAQSheetView.PNG"/}}
37 +* An FAQ entry in Edit mode
38 +{{image reference="FAQSheetEdit.PNG"/}}
37 37  
38 -* {{image reference="FAQsSummary.png"/}}
39 -)))
40 -
41 -* (((
42 -(% class="wikigeneratedid" id="HAnFAQentryinViewmode" %)
43 -An FAQ entry in View mode
44 -
45 -* (((
46 -==== {{image reference="FAQSheetView.PNG"/}} ====
47 -)))
48 -)))
49 -
50 -* (((
51 -(% class="wikigeneratedid" id="HAnFAQentryinEditmode" %)
52 -An FAQ entry in Edit mode
53 -
54 -* (((
55 -==== {{image reference="FAQSheetEdit.PNG"/}} ====
56 -)))
57 -)))
58 -
59 59  = Authoring Templates and Page Design Sheets =
60 60  
61 61  An Authoring Template is a template for creating documents of a specific type. Unlike a regular content page in edit mode with one field for freeform editing, an Authoring Template presents a custom set of form fields for creating a document with specific type of data. These form elements are defined by the properties of a class.
... ... @@ -72,14 +72,11 @@
72 72  
73 73  = Create the FAQ Class =
74 74  
75 -* On the Class Editor wizard entry page (XWiki.XWikiClasses), under the heading "Create a new data type", in the "Title" field, enter ##FAQ## as the name of the page to create:
76 -** (((
56 +* On the Class Editor wizard entry page (XWiki.XWikiClasses), under the heading "Create a new data type", in the "Title" field, enter ##FAQ## as the name of the page to create:(((
77 77  {{image reference="CreateANewClass1.png"/}}
78 78  )))
79 -
80 80  * As you can see in the Breadcrumb below the new page will be created at location ##XWiki > FAQ##. In practice the Class Wizard will automatically prefix the page name with ##Class## (you could also enter ##FAQClass## as the page name directly).
81 -* Now it would be nice to have it created in a new location such as ##FAQ > FAQ Class##. Since the ##FAQ## parent doesn't exist we cannot use the Tree picker button. Thus click the Pencil button as shown in the following image and replace ##XWiki## by ##FAQ##.
82 -** (((
60 +* Now it would be nice to have it created in a new location such as ##FAQ > FAQ Class##. Since the ##FAQ## parent doesn't exist we cannot use the Tree picker button. Thus click the Pencil button as shown in the following image and replace ##XWiki## by ##FAQ##.(((
83 83  {{image reference="CreateANewClass2.png"/}}
84 84  )))
85 85  * In technical terms you're creating a page named ##FAQClass## (with a title of "FAQ Class") located in a space also called ##FAQ## and thus the technical reference is ##FAQ.FAQClass##.
... ... @@ -123,13 +123,11 @@
123 123  In our document, we'll store both a //question// and an //answer//. So we need to create a property for each of them.
124 124  
125 125  * Enter the text //question// in the "name" field
126 -* Choose a TextArea type for the property and then click on "Add". The TextArea will ultimately give us a multi-line text field in our authoring template.
127 -** (((
104 +* Choose a TextArea type for the property and then click on "Add". The TextArea will ultimately give us a multi-line text field in our authoring template.(((
128 128  {{image reference="AddQuestionProperty.PNG"/}}
129 129  )))
130 130  * Click on the "+" icon to expand the options for the newly created property
131 -* Change the value of the "Pretty Name" field to "Question"(capital Q):
132 -** (((
108 +* Change the value of the "Pretty Name" field to "Question"(capital Q):(((
133 133  {{image reference="QuestionProperty.PNG"/}}
134 134  )))
135 135  * Now create another property called //answer// the same way that you did for the previous "question" property (choose TextArea for the property type)
... ... @@ -138,8 +138,7 @@
138 138  
139 139  = Create the Page Design Sheet =
140 140  
141 -* After the previous step you are now on the FAQClass page which should look like this:
142 -** (((
117 +* After the previous step you are now on the FAQClass page which should look like this:(((
143 143  {{image reference="FAQClass2.PNG"/}}
144 144  )))
145 145  * Click the first button ("Create the document sheet") to create the document sheet (the Page Design Sheet). This sheet determines how your page's objects will be rendered to the user. The document is automatically created.
... ... @@ -146,10 +146,7 @@
146 146  * You should see a warning message with the text "The sheet is not bound to the class so it won't be applied automatically when a page that has an object of this class is displayed". Click the "Bind the sheet to the class" link that appears after the text. **What this does is important**:
147 147  ** It adds an object of type ##XWiki.ClassSheetBinding## to the ##FAQ.FAQClass" document. Basically it ties the FAQ Class to the Sheet.##
148 148  ** **It's because of this object that users will be sent to form edition mode when editing FAQ entries**
149 -* (((
150 -Now click on "View the sheet document". This takes you to the ##FAQ.FAQSheet## page which you can edit in wiki mode and see its default content:
151 -
152 -(((
124 +* Now click on "View the sheet document". This takes you to the ##FAQ.FAQSheet## page which you can edit in wiki mode and see its default content:(((
153 153  {{code language="none"}}
154 154  {{velocity}}
155 155  ## You can modify this page to customize the presentation of your object.
... ... @@ -162,11 +162,7 @@
162 162  #end
163 163  {{/velocity}}
164 164  {{/code}}
165 -)))
166 -
167 -Let's take a moment now and analyze this code:
168 -
169 -(((
137 +)))Let's take a moment now and analyze this code:(((
170 170  * The first line retrieves the ##FAQ.FAQClass## from the wiki
171 171  * Then we iterate through all its properties and display their values for the current document in a definition list.
172 172  
... ... @@ -186,12 +186,10 @@
186 186  
187 187  * Click "Save & View"
188 188  )))
189 -)))
190 190  
191 191  = Create the Authoring Template =
192 192  
193 -* Navigate back to the ##FAQ.FAQClass## document (you can use the arrows in the breadcrumb to do so). The document should look like this:
194 -** (((
160 +* Navigate back to the ##FAQ.FAQClass## document (you can use the arrows in the breadcrumb to do so). The document should look like this:(((
195 195  {{image reference="FAQClass3.PNG"/}}
196 196  )))
197 197  * Click on the "Create the document template" button. The Authoring Template will be automatically created.
... ... @@ -202,8 +202,7 @@
202 202  
203 203  * If you're on the template page, navigate back to the ##FAQ.FAQClass## document.
204 204  * At the bottom of the page, look for the following warning message: "The template does not contain an object of type FAQClass. Add a FAQ object to the template »."
205 -* Click on "Add a FAQ object to the template »":
206 -** (((
171 +* Click on "Add a FAQ object to the template »":(((
207 207  {{image reference="FAQObject.png"/}}
208 208  )))
209 209  
... ... @@ -416,8 +416,7 @@
416 416  
417 417  * Copy this code and paste it as Wiki content inside ##FAQ.WebHome##, below the code that's already there
418 418  * Click "Save and View"
419 -* A form to create new FAQ entries is now available on the page:
420 -** (((
384 +* A form to create new FAQ entries is now available on the page:(((
421 421  {{image reference="FAQsWithForm.png"/}}
422 422  )))
423 423  
... ... @@ -430,16 +430,13 @@
430 430  * Go to ##FAQ.WebHome##
431 431  * Below the "Add a new question" header, enter a question (which will also be used as the document title) in the //Document// field
432 432  * Click //Create this FAQ//
433 -* You can then enter your question in longer form using the //Question// field on the template, like this:
434 -** (((
397 +* You can then enter your question in longer form using the //Question// field on the template, like this:(((
435 435  {{image reference="FAQSheetEdit.PNG"/}}
436 436  )))
437 -* Click //Save & View// and then you will see the newly created document, like this:
438 -** (((
400 +* Click //Save & View// and then you will see the newly created document, like this:(((
439 439  {{image reference="FAQSheetView.PNG"/}}
440 440  )))
441 -* Go back to the ##FAQ.WebHome## page (you can use the breadcrumbs) to see the list of existing questions
442 -** (((
403 +* Go back to the ##FAQ.WebHome## page (you can use the breadcrumbs) to see the list of existing questions(((
443 443  {{image reference="FAQsWithEntry.png"/}}
444 444  )))
445 445  

Get Connected