Attachment 'wikirpc.py'
Download 1 # -*- coding: iso-8859-1 -*-
2 """
3 MoinMoin - Wiki XMLRPC v3 Interface
4
5
6 """
7
8 def xmlrpc_searchText(self, query_string):
9 """ Search pages of remote wiki
10
11 @param query_string: the search string
12 @rtype: tuple of unicode and list
13 @return: formatted statistics and list of searchresults (pagename, URL)
14 """
15 from MoinMoin import search
16 query = search.QueryParser().parse_query(query_string)
17 results = search.searchPages(self.request, query)
18 results.formatter = text_html.Formatter(self.request)
19 results.request = self.request
20 return (self._outstr(results.stat), [(self._outstr(hit.page_name),
21 self._outstr(results.formatContext(hit, 180, 1)))
22 for hit in results.hits])
23
24
25
26 def xmlrpc_searchTitle(self, query_string):
27 """ Search titles of remote wiki
28
29 @param query_string: the search string
30 @rtype: tuple of unicode and list
31 @return: formatted statistics and list of searchresults (pagename, URL)
32 """
33 from MoinMoin import search
34 query = search.QueryParser(titlesearch=1).parse_query(query_string)
35 results = search.searchPages(self.request, query)
36 results.formatter = text_html.Formatter(self.request)
37 results.request = self.request
38 return (self._outstr(results.stat), [(self._outstr(hit.page_name),
39 self._outstr(results.formatContext(hit, 180, 1)))
40 for hit in results.hits])
41
42
43 def xmlrpc_searchFull(self, query_string):
44 """ Search pages and attachments of remote wiki with xapian
45
46 @param query_string: the search string
47 @rtype: tuple of unicode and list
48 @return: formatted statistics and list of searchresults (pagename, URL)
49 """
50 ToDo..
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.