|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.xpn.xwiki.api.Api
com.xpn.xwiki.plugin.PluginApi<GlobalSearchPlugin>
com.xpn.xwiki.plugin.globalsearch.GlobalSearchPluginApi
public class GlobalSearchPluginApi
API tool to be able to make and merge multi wikis search queries.
| Field Summary | |
|---|---|
static String |
CONTEXT_LASTERRORCODE
Field name of the last error code inserted in context. |
static String |
CONTEXT_LASTEXCEPTION
Field name of the last API exception inserted in context. |
protected static org.slf4j.Logger |
LOGGER
Logging tool. |
| Fields inherited from class com.xpn.xwiki.api.Api |
|---|
context |
| Constructor Summary | |
|---|---|
GlobalSearchPluginApi(GlobalSearchPlugin plugin,
XWikiContext context)
Create an instance of GlobalSearchPluginApi. |
|
| Method Summary | |
|---|---|
void |
logError(String errorMessage,
XWikiException e)
Log error and store details in the context. |
GlobalSearchQuery |
newQuery()
Create a new instance of GlobalSearchQuery and return it. |
Collection<GlobalSearchResult> |
search(GlobalSearchQuery query)
Execute query in all provided wikis and return list containing all results. |
Collection<Document> |
searchDocuments(GlobalSearchQuery query,
boolean distinctbylanguage)
Search wiki pages in all provided wikis and return list containing found Document. |
Collection<String> |
searchDocumentsNames(GlobalSearchQuery query,
boolean distinctbylanguage,
boolean checkRight)
Search wiki pages in all provided wikis and return list containing found Document. |
| Methods inherited from class com.xpn.xwiki.plugin.PluginApi |
|---|
getInternalPlugin, getProtectedPlugin, setPlugin |
| Methods inherited from class com.xpn.xwiki.api.Api |
|---|
convert, convert, getXWikiContext, hasAccessLevel, hasAdminRights, hasProgrammingRights, hasWikiAdminRights |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String CONTEXT_LASTERRORCODE
public static final String CONTEXT_LASTEXCEPTION
protected static final org.slf4j.Logger LOGGER
| Constructor Detail |
|---|
public GlobalSearchPluginApi(GlobalSearchPlugin plugin,
XWikiContext context)
plugin - the entry point of the Global Search plugin.context - the XWiki context.| Method Detail |
|---|
public void logError(String errorMessage,
XWikiException e)
errorMessage - error message.e - the catched exception.public GlobalSearchQuery newQuery()
GlobalSearchQuery and return it.
GlobalSearchQuery and return it.
public Collection<GlobalSearchResult> search(GlobalSearchQuery query)
throws XWikiException
query - the query parameters. The hql has some constraints:
GlobalSearchResult containing all selected fields values.
XWikiException - error when executing query.
public Collection<Document> searchDocuments(GlobalSearchQuery query,
boolean distinctbylanguage)
throws XWikiException
Document.
Compared to XWiki Platform search, searchDocuments and searchDocumentsName it's potentially "time-consuming"
since it issues one request per provided wiki.
query - the query parameters. The hql has some constraints:
distinctbylanguage - when a document has multiple version for each language it is returned as one document a
language.
Document.
XWikiException - error when executing query.
public Collection<String> searchDocumentsNames(GlobalSearchQuery query,
boolean distinctbylanguage,
boolean checkRight)
throws XWikiException
Document.
Compared to XWiki Platform search, searchDocuments and searchDocumentsName it's potentially "time-consuming"
since it issues one request per provided wiki.
query - the query parameters. The hql has some constraints:
distinctbylanguage - when a document has multiple version for each language it is returned as one document a
language.checkRight - if true check for each found document if context's user has "view" rights for it.
Document.
XWikiException - error when executing query.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||