Changes for page XML-RPC Java Examples
Last modified by Thomas Mortagne on 2023/10/10 14:31
From version 1.3
edited by dilipkumarj
on 2010/01/26 04:10
on 2010/01/26 04:10
Change comment:
Corrected mistake in warning for Create Page example
Summary
-
Page properties (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Author
-
... ... @@ -1,1 +1,1 @@ 1 -xwiki:XWiki. dilipkumarj1 +xwiki:XWiki.VincentMassol - Content
-
... ... @@ -18,7 +18,7 @@ 18 18 |xwiki-core-xmlrpc-client-2.1.1.jar|For XWiki 2.1.1 the jar is available [[here>>http://maven.xwiki.org/releases/org/xwiki/platform/xwiki-core-xmlrpc-client/2.1.1/xwiki-core-xmlrpc-client-2.1.1jar]] 19 19 |xwiki-core-xmlrpc-model-2.1.1.jar|WEB-INF/lib folder of XWiki 2.1.1 20 20 21 -= =Authentication: Login Example ==21 += Authentication: Login Example = 22 22 23 23 Try Providing an incorrect username & password. The application will throw an exception 24 24 For correct username & password, the application will compile & run successfully. ... ... @@ -50,7 +50,7 @@ 50 50 } 51 51 {{/code}} 52 52 53 -= =Authentication: Logout Example ==53 += Authentication: Logout Example = 54 54 55 55 Let's build on the previous example where we "Logged In". We test logout action using a boolean variable since rpc.logout() method returns true on successful logout. 56 56 ... ... @@ -88,7 +88,7 @@ 88 88 } 89 89 {{/code}} 90 90 91 -= =Search documents ==91 += Search documents = 92 92 93 93 {{code language="java"}} 94 94 import java.net.MalformedURLException; ... ... @@ -129,7 +129,7 @@ 129 129 } 130 130 {{/code}} 131 131 132 -= =Space: Get A List Of Spaces ==132 += Space: Get A List Of Spaces = 133 133 134 134 Now, that we can log in and log out, let's move to finding out what's inside your wiki. How about a list of all the spaces inside the wiki. Compare the above two examples and you will see the new import that we added viz. the SpaceSummary class. 135 135 ... ... @@ -169,7 +169,7 @@ 169 169 } 170 170 {{/code}} 171 171 172 -= =Space: Create A Space ==172 += Space: Create A Space = 173 173 174 174 So far, we logged in, logged out & also were able to see a list of spaces in the xwiki instance. Let's go ahead and create a new space. And not just that we will also assign the default home page for the space. In this example, we use "XMLRPC" as the space name & "xmlrpc.WebHome" as the home page 175 175 ... ... @@ -213,7 +213,7 @@ 213 213 } 214 214 {{/code}} 215 215 216 -= =Space: Delete A Space ==216 += Space: Delete A Space = 217 217 218 218 Removal of a space is far more easier than creating one. All it requires is the "Key" (the visible name of the space) to be provided to the remove() method. 219 219 ... ... @@ -253,13 +253,13 @@ 253 253 } 254 254 {{/code}} 255 255 256 -= =Page: Retrieve/Search A Page ==256 += Page: Retrieve/Search A Page = 257 257 258 258 A page is probably the most important unit of any wiki around which everything else is built. Spaces/Categories, Attachments, Comments, etc are more or less meaningless without a supporting page in a wiki system. 259 259 One of the most widely performed action on any wiki has to be searching for pages. Searches may happen through search boxes provided in a wiki or may be through following links from one page to another. On the XMLRPC side too, searching pages has been given a lot of importance and quite a few methods are available for the same. 260 260 Since, this topic is an important one, all the page retrieval/search examples [[can be found here>>XMLRPCJavaExamples2]] 261 261 262 -= =Page: Create A Page ==262 += Page: Create A Page = 263 263 264 264 Now for the moment of truth. Addition of Pages to a Wiki is as simple as searching for them. Thankfully, the XWiki XMLRPC api has just the tools you need to do your job. 265 265 At the very least, you would require the following three parameters to create a Page: