[vote] Missing searchDocumentsNames functionality
com.xpn.xwiki.store.XWikiHibernateStore.searchDocumentsNames supports a selectColumns parameter which is supposed to specify which columns should be selected. This parameter is used when building the select string, but the columns are not included in the returned list, so this parameter just makes a bigger select string and increases the execution time. In order to include the specified columns in the result, I propose this: - if selectedColumns is the empty string, keep the previous behavior (return a list of document names) - if selectedColumns is not empty, then return a list of hashmaps, with the column name as the key, with a special name for the document name (for example docname)
0 I think we need to make a more complete review of the current search APIs. There are some security issues with sending column data in the search results. searchDocumentNames is an API sending back non sensitive data (only the document names). I believe it should be a different API sending more complex results. I think also which should add a parameter to filter search results according to viewer rights. Also the HQL search API should start to be depreciated since we now have the QueryPlugin API based on XQuery. However I've seen that the XQuery api does not have the full capabilities of the HQL API so our API will need to have a way to call the storage specific search API. So maybe te right way to do it is to keep the current API for compatibility and put the new APIs on the QueryPlugin and implement a clean and nice search API in the QueryPlugin, including a storage specific API. Ludovic Sergiu Dumitriu a écrit :
com.xpn.xwiki.store.XWikiHibernateStore.searchDocumentsNames supports a selectColumns parameter which is supposed to specify which columns should be selected.
This parameter is used when building the select string, but the columns are not included in the returned list, so this parameter just makes a bigger select string and increases the execution time.
In order to include the specified columns in the result, I propose this: - if selectedColumns is the empty string, keep the previous behavior (return a list of document names) - if selectedColumns is not empty, then return a list of hashmaps, with the column name as the key, with a special name for the document name (for example docname)
------------------------------------------------------------------------
-- You receive this message as a subscriber of the xwiki-dev@objectweb.org mailing list. To unsubscribe: mailto:xwiki-dev-unsubscribe@objectweb.org For general help: mailto:sympa@objectweb.org?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
-- Ludovic Dubost Blog: http://www.ludovic.org/blog/ XWiki: http://www.xwiki.com Skype: ldubost GTalk: ldubost AIM: nvludo Yahoo: ludovic
I don’t have an opinion on this yet. I’ll follow what you guys says is best. -Vincent From: Sergiu Dumitriu [mailto:sergiu.dumitriu@gmail.com] Sent: dimanche 31 décembre 2006 02:35 To: xwiki-dev@objectweb.org Subject: [xwiki-dev] [vote] Missing searchDocumentsNames functionality com.xpn.xwiki.store.XWikiHibernateStore.searchDocumentsNames supports a selectColumns parameter which is supposed to specify which columns should be selected. This parameter is used when building the select string, but the columns are not included in the returned list, so this parameter just makes a bigger select string and increases the execution time. In order to include the specified columns in the result, I propose this: - if selectedColumns is the empty string, keep the previous behavior (return a list of document names) - if selectedColumns is not empty, then return a list of hashmaps, with the column name as the key, with a special name for the document name (for example docname)
Ludovic, you are right. searchDocumentNames should not return anything else than document names. Then we could completely ignore the selectColumns parameter in this function, since it is not used. This will have no impact on the code. I'll write a private function that treats the selectColumns parameter as specified, and if we will ever find it useful, we can make it public and link it to an API. On 1/2/07, Vincent Massol <vincent@massol.net> wrote:
I don't have an opinion on this yet. I'll follow what you guys says is best.
-Vincent
*From:* Sergiu Dumitriu [mailto:sergiu.dumitriu@gmail.com] *Sent:* dimanche 31 décembre 2006 02:35 *To:* xwiki-dev@objectweb.org *Subject:* [xwiki-dev] [vote] Missing searchDocumentsNames functionality
com.xpn.xwiki.store.XWikiHibernateStore.searchDocumentsNames supports a selectColumns parameter which is supposed to specify which columns should be selected.
This parameter is used when building the select string, but the columns are not included in the returned list, so this parameter just makes a bigger select string and increases the execution time.
In order to include the specified columns in the result, I propose this: - if selectedColumns is the empty string, keep the previous behavior (return a list of document names) - if selectedColumns is not empty, then return a list of hashmaps, with the column name as the key, with a special name for the document name (for example docname)
-- You receive this message as a subscriber of the xwiki-dev@objectweb.orgmailing list. To unsubscribe: mailto:xwiki-dev-unsubscribe@objectweb.org For general help: mailto:sympa@objectweb.org?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
This was committed already like this: - the searchDocumentsNames function completely ignores the selectColumns parameter - a protected function called searchDocumentsNamesAdvanced works as I described (the code was already written, so I should have put it somewhere). Being a protected method, means that it won't be accessible from outside the class. On 1/4/07, Jean-Vincent Drean <jv@xwiki.com> wrote:
2007/1/2, Vincent Massol <vincent@massol.net>:
I don't have an opinion on this yet. I'll follow what you guys says is
best.
ibid so, 0.
JV.
-- You receive this message as a subscriber of the xwiki-dev@objectweb.orgmailing list. To unsubscribe: mailto:xwiki-dev-unsubscribe@objectweb.org For general help: mailto:sympa@objectweb.org?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
participants (4)
-
Jean-Vincent Drean -
Ludovic Dubost -
Sergiu Dumitriu -
Vincent Massol