On 08/01/2011 08:29 AM, 许凌志(Jamesxu) wrote: > Thank you Marius, I got it now. > So, could I only get the rencent modified pages and attachments in current > wiki only, are they enough?
Yes. Thanks, Marius > > On Sat, Jul 30, 2011 at 4:56 AM, Marius Dumitru Florea< > [email protected]> wrote: > >> Hi James, >> >> On 07/29/2011 07:27 PM, 许凌志(Jamesxu) wrote: >>> 2011/7/29 Marius Dumitru Florea<[email protected]> >>> >>>> Hi James, >>>> >>>> On 07/28/2011 06:27 AM, 许凌志(Jamesxu) wrote: >>>>> Hi,Marius, I have some problems with the processes of the suggestions. >>>>> >>>>> (1) As we discussed, when "[[" is triggered at first without any >>>>> queries, we should give user some default suggestions like recently >>>>> modified. However I indeed can the recent modified pages now, but I can >>>>> not get recently upload attachments, the question is is the recently >>>>> upload attachments necessary? if so, how can I get it, and can I add it >>>>> to the same wikipage "XWiki.recently modified"? >>>> >>>> You can use something like this to get the list of recently uploaded >>>> attachments: >>>> >>>> ----------8<---------- >>>> {{velocity}} >>>> #set($result = $services.query.hql('select doc.fullName, attach.filename >>>> from XWikiDocument as doc, XWikiAttachment as attach where >>>> attach.docId=doc.id order by attach.date desc').setLimit(5).execute()) >>>> |Document|Attachment >>>> #foreach($item in $result) >>>> |$item.get(0)|$item.get(1) >>>> #end >>>> {{/velocity}} >>>> ---------->8---------- >>>> >>>> >> >>> If I want to get the doc's wiki name, how is the query, I have tried >>> doc.wiki, and doc.wikiName, no one is right; >> >> The above query is executed by default on the current wiki so all >> documents will obviously have the same wiki name. You can specify the wiki: >> >> $services.query.hql(yourHqlQuery).setWiki("foo").execute() >> >> as indicated on the first link below, but you can't execute an HQL query >> across multiple wikis because they use different schemas. >> >> The reason you can't select the wiki name from the document in the query >> is because the wiki name is not stored in the document table. It is of >> course implied by the schema where the document table is. >> >> I think Eduard mentioned before that REST search is limited to one wiki, >> the reason being that is uses HQL queries. Lucene search on the other >> hand allows you to search across wikis. >> >> You have to know that there are cases (see myxwiki.org) when wikis have >> different owners who don't want to share their information. In this case >> it is not desirable to suggest wiki pages from wiki A to users of wiki B. >> >> Suggesting only wiki pages and attachments from the current wiki is >> enough for now. >> >> Hope this helps, >> Marius >> >>> >>>> (Note: I've written this based on >>>> >>>> >> http://platform.xwiki.org/xwiki/bin/view/DevGuide/QueryGuide#HUsingtheQueryManager >>>> and >>>> >>>> >> http://extensions.xwiki.org/xwiki/bin/view/Extension/All+Attachments+Livetable >>>> ) >>>> >>>> You can add your code to the "Recently modified" panel for now, but >>>> return the list of attachments only when a specific request parameter is >>>> present. >>>> >>>>> >>>>> (2) When user keeps typing, then he can trigger some sub link triggers >>>>> like "attach:", ".", "@" and "||" >>>> >>>>> If "attach:" is triggered without any queries, should we give the user >>>>> some default suggestions, if so, what suggestions should we give, till >>>>> now, I give the the attachments start with "a" as default. >>>> >>>> You need to propose something. We can help you make the choice but you >>>> should be the one coming with great ideas. >>>> >>>>> if "." is triggered, there are two situations: first is under the >>>>> wikipage context, so when it is triggered without any queries, what >>>>> should we give to user as default suggestions, >>>> >>>> Again, you have to propose something. >>>> >>>>> because when "." is >>>>> trigger, we must narrow the search range to the specific space, for >>>>> example, when user type "[[Main.", then the suggestions and also the >>>>> default suggestions should under the Main space. >>>>> second is under attachment context, like "[[attach:Main.", what should >>>>> be the default suggestions for users? >>>> >>>> Is there really a difference between "[[Main." and "[[attach:Main." with >>>> respect to the list of wiki pages that you could suggest? >>>> >>>>> if "@" is triggered, we must give the attachment suggestions to users >>>>> under attachment context, like "[[attach:Main.mypage@", so what is the >>>>> default suggestions for this situation? >>>> >>>> What do you propose? >>>> >>>>> if "||" is triggered, I think we may not query the server, because the >>>>> attributes of link are static, but what attributes are supported? >>>> >>>> First check the syntax help, then try some random parameters and check >>>> what HTML is generated when the page is rendered. >>>> >>>> Hope this helps, >>>> Marius >>>> >>>>> >>>>> On Tue, Jul 26, 2011 at 3:37 AM, Marius Dumitru Florea >>>>> <[email protected]<mailto:[email protected] >>>> >>>>> wrote: >>>>> >>>>> Hi James, >>>>> >>>>> On 07/24/2011 05:15 PM, 许凌志(Jamesxu) wrote: >>>>> > Hi, Last week I have done following things: >>>>> > 1. Refine the suggest lucene service, and a query "media", >> which >>>> have >>>>> > two options: "xml" and "json", each gives the xml >>>>> > and json results. >>>>> > 2. Thanks Eduard, Marius and Sergiu, with their help, I >> finnally >>>> find >>>>> > the right search queries of suggest lucene service to get >> right >>>>> > suggestion results. >>>>> > 3. The autosuggestion can use the real datas from xwiki now. >>>>> > >>>>> >>>>> > In this week, I am going to do the following things: >>>>> > 1. Implement the whole context for link suggestion, include >>>>> "attach:", >>>>> > "@", "." and "||".( I have done some designations, but still >> want >>>> to >>>>> > discuss with mentors) >>>>> > 2. Consider to implement the ctrl+space to re-open the >> suggestion >>>> box >>>>> > according to the different contexts of link suggestion.(after >> the >>>>> 1 is >>>>> > finished) >>>>> >>>>> Sounds good. Ping me on IRC when you need help. >>>>> >>>>> Thanks, >>>>> Marius >>>>> >>>>> > >>>>> > -- >>>>> > Best wishes, >>>>> > >>>>> > 许凌志(Jame Xu) >>>>> > >>>>> > MOE KLINNS Lab and SKLMS Lab, Xi'an Jiaotong University >>>>> > >>>>> > Department of Computer Science and Technology, Xi’an Jiaotong >>>>> University >>>>> _______________________________________________ >>>>> devs mailing list >>>>> [email protected]<mailto:[email protected]> >>>>> http://lists.xwiki.org/mailman/listinfo/devs >>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Best wishes, >>>>> >>>>> 许凌志(Jame Xu) >>>>> >>>>> MOE KLINNS Lab and SKLMS Lab, Xi'an Jiaotong University >>>>> >>>>> Department of Computer Science and Technology, Xi’an Jiaotong >> University >>>> _______________________________________________ >>>> devs mailing list >>>> [email protected] >>>> http://lists.xwiki.org/mailman/listinfo/devs >>>> >>> >>> >>> >> _______________________________________________ >> devs mailing list >> [email protected] >> http://lists.xwiki.org/mailman/listinfo/devs >> > > > _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs

