We can actually get rid of the Office Importer auto suggest.
Discussions with users have shown that either we access the office
import using a menu item "import to the current page" and then the page
is finally set, or we access it using "import to a new page" and then we
don't need a picker.
Ludovic
Sergiu Dumitriu a écrit :
asiri (SVN) wrote:
Author: asiri
Date: 2009-05-27 22:12:57 +0200 (Wed, 27 May 2009)
New Revision: 20576
Added:
platform/xwiki-applications/trunk/officeimporter/src/main/resources/XWiki/OfficeImporterSuggest.xml
Modified:
platform/xwiki-applications/trunk/officeimporter/src/main/resources/XWiki/OfficeImporter.xml
Log:
XAOFFICE-14: Improve the Office Importer Application User Experience
* Modularized the suggest mechanism by introducing XWiki.OfficeImporterSuggest page and
the use of plain.vm template.
Added:
platform/xwiki-applications/trunk/officeimporter/src/main/resources/XWiki/OfficeImporterSuggest.xml
===================================================================
---
platform/xwiki-applications/trunk/officeimporter/src/main/resources/XWiki/OfficeImporterSuggest.xml
(rev 0)
+++
platform/xwiki-applications/trunk/officeimporter/src/main/resources/XWiki/OfficeImporterSuggest.xml 2009-05-27
20:12:57 UTC (rev 20576)
@@ -0,0 +1,44 @@
+#if("" == "$!{request.xpage}")
+ #warning("This page contains the office importer auto-suggest script")
+#end
+#set($ok = $response.setContentType("text/xml"))
+#set($typeParam = "$!{request.type}")
+#set($numberParam = "$!{request.number}")
+#set($inputParam = "$!{request.input}")
+<results>
+#if("spaces" == $typeParam)
+ #set($number = $util.parseInt($numberParam))
+ #if($number == 0)#set($number = 10)#end
+ #set($matchingSpaces = $xwiki.searchSpacesNames("where lower(doc.space) like
'%$inputParam.toLowerCase()%'", $number, 0, []))
You should sanitize the inputParam, otherwise it will cause problems
with ' and %.
+ #foreach($space in $matchingSpaces)
+ <rs id="$velocityCount"
info="">$space</rs>
+ #end
+#end
+</results>
+</content>
+</xwikidoc>