Last modified by Simon Urli on 2023/10/10

From version 48.3
edited by Silvia Macovei
on 2010/02/25
Change comment: Fixed Inconsistency
To version 48.5
edited by yang ningJian
on 2010/06/01
Change comment: Added comment

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.SilviaRusu
1 +XWiki.YangNingYuan
Content
... ... @@ -33,11 +33,11 @@
33 33  * On the Class Editor wizard entry page (XWiki.XWikiClasses), under the heading "Create a new data type", enter the following web space and class name:
34 34  ** Space: FAQ
35 35  ** Class: FAQ
36 -
36 +(((
37 37  image:CreateANewClass.PNG
38 -
38 +)))
39 39  * Click the "Create this Class" button. You should then see a code page with the following code:
40 -
40 +(((
41 41  {{code language="none"}}
42 42  {{velocity}}
43 43  ## Replace Main with the Space where you want your documents to be created.
... ... @@ -49,6 +49,7 @@
49 49  {{/velocity}}
50 50  {{include document="XWiki.ClassSheet"/}}
51 51  {{/code}}
52 +)))
52 52  
53 53  In the code, change the word "Main" with the name of the space where you want you FAQ pages to be created as the commented instructions in the page code suggest. Replace the word "Main" with the word "FAQ". The line of code should now look like this:
54 54  
... ... @@ -73,13 +73,13 @@
73 73  
74 74  * Enter the text //question// in the "NAME" field of the Class Editor panel: the "ADD PROPERTY" panel is in the right column.
75 75  * Choose a TextArea type for the property and then click the "ADD PROPERTY" button. The TextArea will ultimately give us a multi-line text field in our authoring template.
76 -
77 +(((
77 77  image:AddQuestionProperty.PNG
78 -
79 +)))
79 79  * Configure this property with the following values (actually, if you are using the current XWiki version, you don't need to change anything but the Pretty name ? all the rest are the default values):
80 -
81 +(((
81 81  image:QuestionProperty.PNG
82 -
83 +)))
83 83  * Now add a property called //answer// in the same way that you did for the "question" property (choosing TextArea for the property type)
84 84  * Choose it from the property list on the left and configure this property with the same values as the "question" property, except for the //name// and //pretty name// which will, obviously, match the new property we're creating
85 85  * When you are done adding and configuring the properties, click the "Save & View" button.
... ... @@ -87,9 +87,9 @@
87 87  = Create the Page Design Sheet =
88 88  
89 89  * After the previous step you are now on the FAQClass page which should look like this:
90 -
91 +(((
91 91  image:FAQClass2.PNG
92 -
93 +)))
93 93  * 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.
94 94  * Click on "View the sheet document"
95 95  * Edit that page in Object edition mode
... ... @@ -97,7 +97,7 @@
97 97  ** **Adding the XWiki.SheetClass object is important. It's because of this object that users will be sent to form edition mode when editing FAQ entries**
98 98  * Click "Save & View"
99 99  * If you edit the page in wiki mode, you will see the following code:
100 -
101 +(((
101 101  {{code language="none"}}
102 102  {{velocity}}
103 103  ## You can modify this page to customize the presentation of your object.
... ... @@ -112,7 +112,7 @@
112 112  #end
113 113  {{/velocity}}
114 114  {{/code}}
115 -
116 +)))
116 116  Let's take a moment now and analyze this code:
117 117  
118 118  * The first line retrieves the FAQ.FAQClass from the wiki
... ... @@ -132,14 +132,14 @@
132 132  = Create the Authoring Template =
133 133  
134 134  * Click on "FAQClass" in the breadcrumb. The document should look like this:
135 -
136 +(((
136 136  image:FAQClass3.PNG
137 -
138 +)))
138 138  * Notice that now, there is a link for the FAQSheet in place of the button that was previously there
139 139  * Click on the "CREATE THE DOCUMENT TEMPLATE" button. The Authoring Template will be automatically created. If you click on "View the template document" and edit that page in wiki mode, you will see the following code:
140 -
141 +(((
141 141  {{code language="none"}}{{include document="FAQ.FAQSheet"/}}{{/code}}
142 -
143 +)))
143 143  * Note that we changed the space name preceding the page name also because we want all of our FAQ pages to reside in the same XWiki space
144 144  * Remember that all our documents will be copies of the Authoring Template used as a prototype so the content will be copied in all our FAQs documents and will execute the Design Sheet code in the context of the current document. See the [[dedicated page>>DevGuide.IncludeInVelocity]] for more information regarding this technique.
145 145  
... ... @@ -149,9 +149,9 @@
149 149  * At the bottom of the page, look for the following error message: "The template does not contain an object of type FAQClass. Add a FAQ object to the template »."
150 150  * Click on "Add a FAQ object to the template »"
151 151  * Congratulations: you just created an Authoring Template! You're almost done now.
152 -
153 +(((
153 153  image:FAQClass4.PNG
154 -
155 +)))
155 155  = Create a home page for the FAQ application =
156 156  
157 157  You want your users to be able to see a list of all existing questions and answers and to add new questions. The best way to do this is to put the FAQ application in its own space and to use that space's homepage to display existing questions.
... ... @@ -254,13 +254,13 @@
254 254  
255 255  * Under the "Add a new question" header, enter a document title in the //Document// field and click //Create this FAQ//. For example, enter //What is the meaning of life?//.
256 256  * You can then enter your question in longer form using the //Question// field on the template, like this:
257 -
258 +(((
258 258  image:FAQSheetEdit.PNG
259 -
260 +)))
260 260  * Click //Save & View// and then you will see the newly created document, like this:
261 -
262 +(((
262 262  image:FAQSheetView.PNG
263 -
264 +)))
264 264  * Go back to the "FAQ.WebHome" page to see the list of existing questions
265 265  
266 266  = Conclusion =
XWiki.XWikiComments[11]
Author
... ... @@ -1,0 +1,1 @@
1 +xwiki:XWiki.YangNingYuan
Comment
... ... @@ -1,0 +1,3 @@
1 +Hello xwikier. I downloaded xwiki Enterprise Edition, version 2.1.1. Where installed in tomcat. Using a mysql database. The default language of Chinese or English. The operating system is WIN XP. Because I live in Shanghai, China, so I use Chinese. According to this document, I create a FAQ application, found a small bug. In FAQ.Existing FAQ entries (FAQ.webHome) page, in the name of the docName of <input> years, if the input of Chinese characters (such as '?????'), then FAQ.Existing FAQ entries page will prompt "The target document already exists. Please choose a different name ...", fact does not exist "Foxconn jumped" this page. Tracking in FAQ.Existing FAQ entries on the velocity code and found that statement "# set ($ docName = $ util.clearName ($ (request.docName)))" always null value assigned to docName, so to determine whether the presence Logic ($ xwiki.exists ($ targetDocName)) returns true. Then I trace the jar file, suspected com.xpn.xwiki.XWiki's public String clearName method caused problems - the Chinese characters are replaced with a null value. Current temporary solution is to comment out this $ util.clearName code. Hope xwikier to fix this bug, because the use of Chinese to abandon this code, the code will be wasted. And now more and more young people in China using Chinese and English characters mixed. Thank you.
2 +PS: I want to know com.xpn.xwiki.XWiki's public String clearName way in the end is what to do, now I know that this method is used to replace some of the non-Chinese characters. Thank you.
3 +
Date
... ... @@ -1,0 +1,1 @@
1 +2010-06-01 05:07:34.676

Get Connected