On Wed, May 20, 2009 at 16:58, PERINAUD Christophe <christophe.perin...@kbl-bank.com> wrote: > Thank you Thomas > > The problem is that i tried both of this solutions with no result.
Sorry i misread your first mail. > Just to be sure i tested that code : > <br>---->Context = $context.database > <br>---->Wanted context = $context.mainWikiName > #set($ok = $context.setDatabase($context.mainWikiName)) > <br>---->New context = $context.database > > And the result is : > ---->Context = template18 > ---->Wanted context = xwiki > ---->New context = template18 > > > Even if i am admin of all wikis (virtuals and main one) and i forced admin > rights, i can't switch the context Admin right are not the same than programming right, go to the main wiki and check that your user has programming right or is in a group which has programming right. But anyway it should work with XWiki.searchDocumentsNames(String wikiName, String parametrizedSqlClause, int nb, int start, List< ? > parameterValues) without programming right. Are you sure "$wikiSearch" variable contains the right wiki name ? > > I don't see what's the problem with that. > > > -----Message d'origine----- > De : users-boun...@xwiki.org [mailto:users-boun...@xwiki.org] De la part de > Thomas Mortagne > Envoyé : mercredi 20 mai 2009 16:38 > À : XWiki Users > Objet : Re: [xwiki-users] WebSearch and multi wikis > > On Wed, May 20, 2009 at 16:24, PERINAUD Christophe > <christophe.perin...@kbl-bank.com> wrote: >> Hello >> >> I try to make the WebSearch to search for documents in different wikis. >> In the WebSearchCode, i loop on 3 wikis, changing the context >> ($context.setDatabase)but it does not work. I try to give each wiki's name >> to the searchDocuments function (like #foreach ($item in >> $xwiki.searchDocuments("$wikiSearch", $sql , $nbitems, 0, null)) But still >> does not work. >> >> Any idea if it's possible and how ? > > You need programing right to use $context.setDatabase(database), > otherwise it does nothing. But you can use > XWiki.searchDocumentsNames(String wikiName, String > parametrizedSqlClause, int nb, int start, List< ? > parameterValues) > which support the name of the wiki. See > http://maven.xwiki.org/site/xwiki-core-parent/xwiki-core/apidocs/com/xpn/xwiki/api/XWiki.html#searchDocumentsNames%28java.lang.String,%20java.lang.String,%20int,%20int,%20java.util.List%29 > >> >> Thank you all >> >> Christophe Périnaud >> Windows Server 2003 SP2 in a VMWare instance >> Oracle 10g >> Java 1.6.0_12 >> Xwiki 1.8 from the pack Jetty/HSQL >> >> >> -------------------------------------------------------------------------------- >> >> This e-mail is intended only for the addressee named above. It does not bind >> the sender, except in the case of an existing written convention with the >> addressee. This e-mail may contain material that is confidential and >> privileged for the sole use of the intended recipient. Any review, reliance >> or distribution by others or forwarding without express permission is >> strictly prohibited and may be unlawful. If you are not the intended >> recipient, please contact the sender and delete all copies. >> >> While reasonable precautions have been taken to ensure that this e-mail and >> any attachments are free from any computer virus or similar defect, no >> liability will be accepted in that respect. Anyone accessing this e-mail >> must take their own precautions as to security and virus protection. >> >> KBL European Private Bankers S.A., 43 boulevard Royal L-2955 Luxembourg, >> R.C.S. Luxembourg B 6395, T (352) 47 97 1 >> _______________________________________________ >> users mailing list >> users@xwiki.org >> http://lists.xwiki.org/mailman/listinfo/users >> > > > > -- > Thomas Mortagne > _______________________________________________ > users mailing list > users@xwiki.org > http://lists.xwiki.org/mailman/listinfo/users > -------------------------------------------------------------------------------- > > This e-mail is intended only for the addressee named above. It does not bind > the sender, except in the case of an existing written convention with the > addressee. This e-mail may contain material that is confidential and > privileged for the sole use of the intended recipient. Any review, reliance > or distribution by others or forwarding without express permission is > strictly prohibited and may be unlawful. If you are not the intended > recipient, please contact the sender and delete all copies. > > While reasonable precautions have been taken to ensure that this e-mail and > any attachments are free from any computer virus or similar defect, no > liability will be accepted in that respect. Anyone accessing this e-mail must > take their own precautions as to security and virus protection. > > KBL European Private Bankers S.A., 43 boulevard Royal L-2955 Luxembourg, > R.C.S. Luxembourg B 6395, T (352) 47 97 1 > _______________________________________________ > users mailing list > users@xwiki.org > http://lists.xwiki.org/mailman/listinfo/users > -- Thomas Mortagne _______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users