Interface XWikiStoreInterface
-
- All Known Subinterfaces:
XWikiCacheStoreInterface
- All Known Implementing Classes:
XWikiCacheStore
,XWikiDefaultStore
,XWikiHibernateStore
@Role public interface XWikiStoreInterface
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description void
cleanUp(XWikiContext context)
int
countDocuments(String wheresql, XWikiContext context)
API allowing to count the total number of documents that would be returned by a query.int
countDocuments(String parametrizedSqlClause, List<?> parameterValues, XWikiContext context)
API allowing to count the total number of documents that would be returned by a parameterized query.void
createWiki(String wikiName, XWikiContext context)
Allows to create a new wiki database and initialize the default tables.void
deleteLinks(long docId, XWikiContext context, boolean bTransaction)
Deprecated.link storage and indexing moved to Solr (implemented in xwiki-platform-search-solr-api)void
deleteLock(XWikiLock lock, XWikiContext context, boolean bTransaction)
void
deleteWiki(String wikiName, XWikiContext context)
Delete a wiki database.void
deleteXWikiDoc(XWikiDocument doc, XWikiContext context)
boolean
exists(XWikiDocument doc, XWikiContext context)
List<String>
getClassList(XWikiContext context)
List<String>
getCustomMappingPropertyList(BaseClass bclass)
int
getLimitSize(XWikiContext context, Class<?> entityType, String property)
Get the limit size of a property.QueryManager
getQueryManager()
List<String>
getTranslationList(XWikiDocument doc, XWikiContext context)
default boolean
injectCustomMapping(BaseClass doc1class)
boolean
injectCustomMapping(BaseClass doc1class, XWikiContext xWikiContext)
Deprecated.useinjectCustomMapping(BaseClass)
insteadboolean
injectCustomMappings(XWikiDocument doc, XWikiContext context)
void
injectCustomMappings(XWikiContext context)
void
injectUpdatedCustomMappings(XWikiContext context)
default boolean
isCustomMappingValid(BaseClass bclass, String custommapping1)
boolean
isCustomMappingValid(BaseClass bclass, String custommapping1, XWikiContext context)
Deprecated.boolean
isWikiNameAvailable(String wikiName, XWikiContext context)
Indicate if the provided wiki name could be used to create a new wiki.List<String>
loadBacklinks(String fullName, XWikiContext context, boolean bTransaction)
Deprecated.useLinkStore
APIs insteaddefault List<DocumentReference>
loadBacklinks(AttachmentReference documentReference, boolean bTransaction, XWikiContext context)
Deprecated.useLinkStore
APIs insteadList<DocumentReference>
loadBacklinks(DocumentReference documentReference, boolean bTransaction, XWikiContext context)
Deprecated.useLinkStore
APIs insteadList<XWikiLink>
loadLinks(long docId, XWikiContext context, boolean bTransaction)
Deprecated.useLinkStore
APIs insteadXWikiLock
loadLock(long docId, XWikiContext context, boolean bTransaction)
XWikiDocument
loadXWikiDoc(XWikiDocument doc, XWikiContext context)
default void
renameXWikiDoc(XWikiDocument doc, DocumentReference newReference, XWikiContext context)
Atomic operation for renaming a document.void
saveLinks(XWikiDocument doc, XWikiContext context, boolean bTransaction)
Deprecated.link storage and indexing moved to Solr (implemented in xwiki-platform-search-solr-api)void
saveLock(XWikiLock lock, XWikiContext context, boolean bTransaction)
void
saveXWikiDoc(XWikiDocument doc, XWikiContext context)
void
saveXWikiDoc(XWikiDocument doc, XWikiContext context, boolean bTransaction)
<T> List<T>
search(String sql, int nb, int start, XWikiContext context)
Execute a reading request and return result.<T> List<T>
search(String sql, int nb, int start, Object[][] whereParams, XWikiContext context)
Execute a reading request and return result.<T> List<T>
search(String sql, int nb, int start, Object[][] whereParams, List<?> parameterValues, XWikiContext context)
Execute a reading request with parameters and return result.<T> List<T>
search(String sql, int nb, int start, List<?> parameterValues, XWikiContext context)
Execute a reading request with parameters and return result.List<DocumentReference>
searchDocumentReferences(String wheresql, int nb, int start, XWikiContext context)
List<DocumentReference>
searchDocumentReferences(String wheresql, int nb, int start, String selectColumns, XWikiContext context)
List<DocumentReference>
searchDocumentReferences(String parametrizedSqlClause, int nb, int start, List<?> parameterValues, XWikiContext context)
Search documents by passing HQL where clause values as parameters.List<DocumentReference>
searchDocumentReferences(String wheresql, XWikiContext context)
List<DocumentReference>
searchDocumentReferences(String parametrizedSqlClause, List<?> parameterValues, XWikiContext context)
Same assearchDocumentReferences(String, int, int, List, XWikiContext)
but returns all rows.List<XWikiDocument>
searchDocuments(String wheresql, boolean distinctbylanguage, boolean customMapping, boolean checkRight, int nb, int start, XWikiContext context)
Search documents in the storing system.List<XWikiDocument>
searchDocuments(String wheresql, boolean distinctbylanguage, boolean customMapping, boolean checkRight, int nb, int start, List<?> parameterValues, XWikiContext context)
Search documents in the storing system.List<XWikiDocument>
searchDocuments(String wheresql, boolean distinctbylanguage, boolean customMapping, int nb, int start, XWikiContext context)
Search documents in the storing system.List<XWikiDocument>
searchDocuments(String wheresql, boolean distinctbylanguage, boolean customMapping, int nb, int start, List<?> parameterValues, XWikiContext context)
Search documents in the storing system.List<XWikiDocument>
searchDocuments(String wheresql, boolean distinctbylanguage, boolean customMapping, XWikiContext context)
Search documents in the storing system.List<XWikiDocument>
searchDocuments(String wheresql, boolean distinctbylanguage, int nb, int start, XWikiContext context)
Search documents in the storing system.List<XWikiDocument>
searchDocuments(String wheresql, boolean distinctbylanguage, int nb, int start, List<?> parameterValues, XWikiContext context)
Search documents in the storing system.List<XWikiDocument>
searchDocuments(String wheresql, boolean distinctbylanguage, XWikiContext context)
Search documents in the storing system.List<XWikiDocument>
searchDocuments(String wheresql, int nb, int start, XWikiContext context)
Search documents in the storing system.List<XWikiDocument>
searchDocuments(String wheresql, int nb, int start, List<?> parameterValues, XWikiContext context)
Search documents in the storing system.List<XWikiDocument>
searchDocuments(String wheresql, XWikiContext context)
Search documents in the storing system.List<XWikiDocument>
searchDocuments(String wheresql, List<?> parameterValues, XWikiContext context)
Search documents in the storing system.List<String>
searchDocumentsNames(String wheresql, int nb, int start, XWikiContext context)
List<String>
searchDocumentsNames(String wheresql, int nb, int start, String selectColumns, XWikiContext context)
Deprecated.List<String>
searchDocumentsNames(String parametrizedSqlClause, int nb, int start, List<?> parameterValues, XWikiContext context)
Deprecated.List<String>
searchDocumentsNames(String wheresql, XWikiContext context)
Deprecated.List<String>
searchDocumentsNames(String parametrizedSqlClause, List<?> parameterValues, XWikiContext context)
Deprecated.
-
-
-
Method Detail
-
saveXWikiDoc
void saveXWikiDoc(XWikiDocument doc, XWikiContext context) throws XWikiException
- Throws:
XWikiException
-
renameXWikiDoc
default void renameXWikiDoc(XWikiDocument doc, DocumentReference newReference, XWikiContext context) throws XWikiException
Atomic operation for renaming a document. This operation will rename the document in DB by performing updates in all tables the document name is used.- Parameters:
doc
- the actual document instance to rename.newReference
- the new reference to use for renaming.context
- the current context.- Throws:
XWikiException
- in case of problem during the rename.- Since:
- 12.5RC1
-
saveXWikiDoc
void saveXWikiDoc(XWikiDocument doc, XWikiContext context, boolean bTransaction) throws XWikiException
- Throws:
XWikiException
-
loadXWikiDoc
XWikiDocument loadXWikiDoc(XWikiDocument doc, XWikiContext context) throws XWikiException
- Throws:
XWikiException
-
deleteXWikiDoc
void deleteXWikiDoc(XWikiDocument doc, XWikiContext context) throws XWikiException
- Throws:
XWikiException
-
getClassList
List<String> getClassList(XWikiContext context) throws XWikiException
- Throws:
XWikiException
-
countDocuments
int countDocuments(String wheresql, XWikiContext context) throws XWikiException
API allowing to count the total number of documents that would be returned by a query.- Parameters:
wheresql
- Query to use, similar to the ones accepted bysearchDocuments(String, XWikiContext)
. It should not containorder by
orgroup
clauses, since this kind of queries are not portable.context
- The current request context.- Returns:
- The number of documents that matched the query.
- Throws:
XWikiException
- if there was a problem executing the query.
-
searchDocumentReferences
List<DocumentReference> searchDocumentReferences(String wheresql, XWikiContext context) throws XWikiException
- Throws:
XWikiException
- Since:
- 2.2M2
-
searchDocumentsNames
@Deprecated(since="2.2M2") List<String> searchDocumentsNames(String wheresql, XWikiContext context) throws XWikiException
Deprecated.- Throws:
XWikiException
-
searchDocumentReferences
List<DocumentReference> searchDocumentReferences(String wheresql, int nb, int start, XWikiContext context) throws XWikiException
- Throws:
XWikiException
- Since:
- 2.2M2
-
searchDocumentsNames
@Deprecated(since="2.2M2") List<String> searchDocumentsNames(String wheresql, int nb, int start, XWikiContext context) throws XWikiException
- Throws:
XWikiException
-
searchDocumentReferences
List<DocumentReference> searchDocumentReferences(String wheresql, int nb, int start, String selectColumns, XWikiContext context) throws XWikiException
- Throws:
XWikiException
- Since:
- 2.2M2
-
searchDocumentsNames
@Deprecated(since="2.2M2") List<String> searchDocumentsNames(String wheresql, int nb, int start, String selectColumns, XWikiContext context) throws XWikiException
Deprecated.- Throws:
XWikiException
-
searchDocumentReferences
List<DocumentReference> searchDocumentReferences(String parametrizedSqlClause, int nb, int start, List<?> parameterValues, XWikiContext context) throws XWikiException
Search documents by passing HQL where clause values as parameters. This allows generating a Named HQL query which will automatically encode the passed values (like escaping single quotes). This API is recommended to be used over the other similar methods where the values are passed inside the where clause and for which you'll need to do the encoding/escaping yourself before calling them.Example:
#set($orphans = $xwiki.searchDocuments(" where doc.fullName <> ?1 and (doc.parent = ?2 or " + "(doc.parent = ?3 and doc.space = ?4))", ["${doc.fullName}as", ${doc.fullName}, ${doc.name}, ${doc.space}]))
- Parameters:
parametrizedSqlClause
- the HQL where clause. For example:where doc.fullName <> ?1 and (doc.parent = ?2 or (doc.parent = ?3 and doc.space = ?4))
nb
- the number of rows to return. If 0 then all rows are returnedstart
- the number of rows to skip. If 0 don't skip any rowparameterValues
- the where clause values that replace the question marks (?)context
- the XWiki context required for getting information about the execution context- Returns:
- a list of document references
- Throws:
XWikiException
- in case of error while performing the query- Since:
- 2.2M1
-
searchDocumentsNames
@Deprecated(since="2.2M2") List<String> searchDocumentsNames(String parametrizedSqlClause, int nb, int start, List<?> parameterValues, XWikiContext context) throws XWikiException
Deprecated.- Throws:
XWikiException
-
searchDocumentReferences
List<DocumentReference> searchDocumentReferences(String parametrizedSqlClause, List<?> parameterValues, XWikiContext context) throws XWikiException
Same assearchDocumentReferences(String, int, int, List, XWikiContext)
but returns all rows.- Throws:
XWikiException
- Since:
- 2.2M2
- See Also:
searchDocumentReferences(String, int, int, java.util.List, com.xpn.xwiki.XWikiContext)
-
searchDocumentsNames
@Deprecated(since="2.2M2") List<String> searchDocumentsNames(String parametrizedSqlClause, List<?> parameterValues, XWikiContext context) throws XWikiException
Deprecated.- Throws:
XWikiException
-
countDocuments
int countDocuments(String parametrizedSqlClause, List<?> parameterValues, XWikiContext context) throws XWikiException
API allowing to count the total number of documents that would be returned by a parameterized query.- Parameters:
parametrizedSqlClause
- Parameterized query to use, similar to the ones accepted bysearchDocuments(String, List, XWikiContext)
. It should not containorder by
orgroup
clauses, since this kind of queries are not portable.parameterValues
- The parameter values that replace the question marks.context
- The current request context.- Returns:
- The number of documents that matched the query.
- Throws:
XWikiException
- if there was a problem executing the query.
-
searchDocuments
List<XWikiDocument> searchDocuments(String wheresql, boolean distinctbylanguage, XWikiContext context) throws XWikiException
Search documents in the storing system.- Parameters:
wheresql
- the HQL where clause. For example:where doc.fullName <> ?1 and (doc.parent = ?2 or (doc.parent = ?3 and doc.space = ?4))
distinctbylanguage
- when a document has multiple version for each language it is returned as one document a language.context
- the XWiki context required for getting information about the execution context.- Returns:
- a list of XWikiDocument.
- Throws:
XWikiException
- in case of error while performing the query.
-
searchDocuments
List<XWikiDocument> searchDocuments(String wheresql, int nb, int start, XWikiContext context) throws XWikiException
Search documents in the storing system.- Parameters:
wheresql
- the HQL where clause. For example:where doc.fullName <> ?1 and (doc.parent = ?2 or (doc.parent = ?3 and doc.space = ?4))
nb
- the number of rows to return. If 0 then all rows are returned.start
- the number of rows to skip. If 0 don't skip any row.context
- the XWiki context required for getting information about the execution context.- Returns:
- a list of XWikiDocument.
- Throws:
XWikiException
- in case of error while performing the query.
-
searchDocuments
List<XWikiDocument> searchDocuments(String wheresql, boolean distinctbylanguage, boolean customMapping, XWikiContext context) throws XWikiException
Search documents in the storing system.- Parameters:
wheresql
- the HQL where clause. For example:where doc.fullName <> ?1 and (doc.parent = ?2 or (doc.parent = ?3 and doc.space = ?4))
distinctbylanguage
- when a document has multiple version for each language it is returned as one document a language.customMapping
- inject custom mapping in session.context
- the XWiki context required for getting information about the execution context.- Returns:
- a list of XWikiDocument.
- Throws:
XWikiException
- in case of error while performing the query.
-
searchDocuments
List<XWikiDocument> searchDocuments(String wheresql, boolean distinctbylanguage, int nb, int start, XWikiContext context) throws XWikiException
Search documents in the storing system.- Parameters:
wheresql
- the HQL where clause. For example:where doc.fullName <> ?1 and (doc.parent = ?2 or (doc.parent = ?3 and doc.space = ?4))
distinctbylanguage
- when a document has multiple version for each language it is returned as one document a language.nb
- the number of rows to return. If 0 then all rows are returned.start
- the number of rows to skip. If 0 don't skip any row.context
- the XWiki context required for getting information about the execution context.- Returns:
- a list of XWikiDocument.
- Throws:
XWikiException
- in case of error while performing the query.
-
searchDocuments
List<XWikiDocument> searchDocuments(String wheresql, boolean distinctbylanguage, int nb, int start, List<?> parameterValues, XWikiContext context) throws XWikiException
Search documents in the storing system.- Parameters:
wheresql
- the HQL where clause. For example:where doc.fullName <> ?1 and (doc.parent = ?2 or (doc.parent = ?3 and doc.space = ?4))
distinctbylanguage
- when a document has multiple version for each language it is returned as one document a language.nb
- the number of rows to return. If 0 then all rows are returned.start
- the number of rows to skip. If 0 don't skip any row.parameterValues
- the where clause values that replace the question marks (?).context
- the XWiki context required for getting information about the execution context.- Returns:
- a list of XWikiDocument.
- Throws:
XWikiException
- in case of error while performing the query.- Since:
- 1.1.2, 1.2M2
-
searchDocuments
List<XWikiDocument> searchDocuments(String wheresql, boolean distinctbylanguage, boolean customMapping, int nb, int start, XWikiContext context) throws XWikiException
Search documents in the storing system.- Parameters:
wheresql
- the HQL where clause. For example:where doc.fullName <> ?1 and (doc.parent = ?2 or (doc.parent = ?3 and doc.space = ?4))
distinctbylanguage
- when a document has multiple version for each language it is returned as one document a language.customMapping
- inject custom mapping in session.nb
- the number of rows to return. If 0 then all rows are returned.start
- the number of rows to skip. If 0 don't skip any row.context
- the XWiki context required for getting information about the execution context.- Returns:
- a list of XWikiDocument.
- Throws:
XWikiException
- in case of error while performing the query.
-
searchDocuments
List<XWikiDocument> searchDocuments(String wheresql, XWikiContext context) throws XWikiException
Search documents in the storing system.- Parameters:
wheresql
- the HQL where clause. For example:where doc.fullName <> ?1 and (doc.parent = ?2 or (doc.parent = ?3 and doc.space = ?4))
context
- the XWiki context required for getting information about the execution context.- Returns:
- a list of XWikiDocument.
- Throws:
XWikiException
- in case of error while performing the query.
-
searchDocuments
List<XWikiDocument> searchDocuments(String wheresql, boolean distinctbylanguage, boolean customMapping, boolean checkRight, int nb, int start, XWikiContext context) throws XWikiException
Search documents in the storing system.- Parameters:
wheresql
- the HQL where clause. For example:where doc.fullName <> ?1 and (doc.parent = ?2 or (doc.parent = ?3 and doc.space = ?4))
distinctbylanguage
- when a document has multiple version for each language it is returned as one document a language.customMapping
- inject custom mapping in session.checkRight
- if true check for each found document if context's user has "view" rights for it.nb
- the number of rows to return. If 0 then all rows are returned.start
- the number of rows to skip. If 0 don't skip any row.context
- the XWiki context required for getting information about the execution context.- Returns:
- a list of XWikiDocument.
- Throws:
XWikiException
- in case of error while performing the query.
-
searchDocuments
List<XWikiDocument> searchDocuments(String wheresql, List<?> parameterValues, XWikiContext context) throws XWikiException
Search documents in the storing system.Search documents by passing HQL where clause values as parameters. This allows generating a Named HQL query which will automatically encode the passed values (like escaping single quotes). This API is recommended to be used over the other similar methods where the values are passed inside the where clause and for which you'll need to do the encoding/escpaing yourself before calling them.
- Parameters:
wheresql
- the HQL where clause. For example:where doc.fullName <> ?1 and (doc.parent = ?2 or (doc.parent = ?3 and doc.space = ?4))
parameterValues
- the where clause values that replace the question marks (?).context
- the XWiki context required for getting information about the execution context.- Returns:
- a list of XWikiDocument.
- Throws:
XWikiException
- in case of error while performing the query.- Since:
- 1.1.2, 1.2M2
-
searchDocuments
List<XWikiDocument> searchDocuments(String wheresql, boolean distinctbylanguage, boolean customMapping, int nb, int start, List<?> parameterValues, XWikiContext context) throws XWikiException
Search documents in the storing system.Search documents by passing HQL where clause values as parameters. This allows generating a Named HQL query which will automatically encode the passed values (like escaping single quotes). This API is recommended to be used over the other similar methods where the values are passed inside the where clause and for which you'll need to do the encoding/escpaing yourself before calling them.
- Parameters:
wheresql
- the HQL where clause. For example:where doc.fullName <> ?1 and (doc.parent = ?2 or (doc.parent = ?3 and doc.space = ?4))
distinctbylanguage
- when a document has multiple version for each language it is returned as one document a language.customMapping
- inject custom mapping in session.nb
- the number of rows to return. If 0 then all rows are returned.start
- the number of rows to skip. If 0 don't skip any row.parameterValues
- the where clause values that replace the question marks (?).context
- the XWiki context required for getting information about the execution context.- Returns:
- a list of XWikiDocument.
- Throws:
XWikiException
- in case of error while performing the query.- Since:
- 1.1.2, 1.2M2
-
searchDocuments
List<XWikiDocument> searchDocuments(String wheresql, int nb, int start, List<?> parameterValues, XWikiContext context) throws XWikiException
Search documents in the storing system.Search documents by passing HQL where clause values as parameters. This allows generating a Named HQL query which will automatically encode the passed values (like escaping single quotes). This API is recommended to be used over the other similar methods where the values are passed inside the where clause and for which you'll need to do the encoding/escpaing yourself before calling them.
- Parameters:
wheresql
- the HQL where clause. For example:where doc.fullName <> ?1 and (doc.parent = ?2 or (doc.parent = ?3 and doc.space = ?4))
nb
- the number of rows to return. If 0 then all rows are returned.start
- the number of rows to skip. If 0 don't skip any row.parameterValues
- the where clause values that replace the question marks (?).context
- the XWiki context required for getting information about the execution context.- Returns:
- a list of XWikiDocument.
- Throws:
XWikiException
- in case of error while performing the query.- Since:
- 1.1.2, 1.2M2
-
searchDocuments
List<XWikiDocument> searchDocuments(String wheresql, boolean distinctbylanguage, boolean customMapping, boolean checkRight, int nb, int start, List<?> parameterValues, XWikiContext context) throws XWikiException
Search documents in the storing system.Search documents by passing HQL where clause values as parameters. This allows generating a Named HQL query which will automatically encode the passed values (like escaping single quotes). This API is recommended to be used over the other similar methods where the values are passed inside the where clause and for which you'll need to do the encoding/escpaing yourself before calling them.
- Parameters:
wheresql
- the HQL where clause. For example:where doc.fullName <> ?1 and (doc.parent = ?2 or (doc.parent = ?3 and doc.space = ?4))
distinctbylanguage
- when a document has multiple version for each language it is returned as one document a language.customMapping
- inject custom mapping in session.checkRight
- if true check for each found document if context's user has "view" rights for it.nb
- the number of rows to return. If 0 then all rows are returned.start
- the number of rows to skip. If 0 don't skip any row.parameterValues
- the where clause values that replace the question marks (?).context
- the XWiki context required for getting information about the execution context.- Returns:
- a list of XWikiDocument.
- Throws:
XWikiException
- in case of error while performing the query.- Since:
- 1.1.2, 1.2M2
-
loadLock
XWikiLock loadLock(long docId, XWikiContext context, boolean bTransaction) throws XWikiException
- Throws:
XWikiException
-
saveLock
void saveLock(XWikiLock lock, XWikiContext context, boolean bTransaction) throws XWikiException
- Throws:
XWikiException
-
deleteLock
void deleteLock(XWikiLock lock, XWikiContext context, boolean bTransaction) throws XWikiException
- Throws:
XWikiException
-
loadLinks
@Deprecated(since="14.8RC1") List<XWikiLink> loadLinks(long docId, XWikiContext context, boolean bTransaction) throws XWikiException
Deprecated.useLinkStore
APIs instead- Throws:
XWikiException
-
loadBacklinks
@Deprecated(since="14.8RC1") List<DocumentReference> loadBacklinks(DocumentReference documentReference, boolean bTransaction, XWikiContext context) throws XWikiException
Deprecated.useLinkStore
APIs insteadReturns the backlinks for the given document reference.- Parameters:
documentReference
- the document reference to search backlinks forbTransaction
-true
if a transaction must be createcontext
- the current context- Throws:
XWikiException
- Since:
- 2.2M2
-
loadBacklinks
@Unstable @Deprecated(since="14.8RC1") default List<DocumentReference> loadBacklinks(AttachmentReference documentReference, boolean bTransaction, XWikiContext context) throws XWikiException
Deprecated.useLinkStore
APIs insteadReturns the backlinks for the given attachment reference.- Parameters:
documentReference
- the attachment reference to search backlinks forbTransaction
-true
if a transaction must be createcontext
- the current context- Throws:
XWikiException
- Since:
- 14.2RC1
-
loadBacklinks
@Deprecated(since="2.2M2") List<String> loadBacklinks(String fullName, XWikiContext context, boolean bTransaction) throws XWikiException
Deprecated.useLinkStore
APIs instead- Throws:
XWikiException
-
saveLinks
@Deprecated(since="14.8RC1") void saveLinks(XWikiDocument doc, XWikiContext context, boolean bTransaction) throws XWikiException
Deprecated.link storage and indexing moved to Solr (implemented in xwiki-platform-search-solr-api)- Throws:
XWikiException
-
deleteLinks
@Deprecated(since="14.8RC1") void deleteLinks(long docId, XWikiContext context, boolean bTransaction) throws XWikiException
Deprecated.link storage and indexing moved to Solr (implemented in xwiki-platform-search-solr-api)- Throws:
XWikiException
-
search
<T> List<T> search(String sql, int nb, int start, XWikiContext context) throws XWikiException
Execute a reading request and return result.- Parameters:
sql
- the HQL request clause. For example:where doc.fullName <> ?1 and (doc.parent = ?2 or (doc.parent = ?3 and doc.space = ?4))
nb
- the number of rows to return. If 0 then all rows are returned.start
- the number of rows to skip. If 0 don't skip any row.context
- the XWiki context required for getting information about the execution context.- Returns:
- a list of XWikiDocument.
- Throws:
XWikiException
- in case of error while performing the query.
-
search
<T> List<T> search(String sql, int nb, int start, List<?> parameterValues, XWikiContext context) throws XWikiException
Execute a reading request with parameters and return result.Execute query by passing HQL request values as parameters. This allows generating a Named HQL query which will automatically encode the passed values (like escaping single quotes). This API is recommended to be used over the other similar methods where the values are passed inside the where clause and for which you'll need to do the encoding/escaping yourself before calling them.
- Parameters:
sql
- the HQL request.nb
- the number of rows to return. If 0 then all rows are returned.start
- the number of rows to skip. If 0 don't skip any row.parameterValues
- the where clause values that replace the question marks (?).context
- the XWiki context required for getting information about the execution context.- Returns:
- a list of XWikiDocument.
- Throws:
XWikiException
- in case of error while performing the query.- Since:
- 1.1.2, 1.2M2
-
search
<T> List<T> search(String sql, int nb, int start, Object[][] whereParams, XWikiContext context) throws XWikiException
Execute a reading request and return result.- Parameters:
sql
- the HQL request.nb
- the number of rows to return. If 0 then all rows are returned.start
- the number of rows to skip. If 0 don't skip any row.whereParams
- if not null add tosql
a where clause based on a table of table containing field name, field value and compared symbol (=
,>
, etc.).context
- the XWiki context required for getting information about the execution context.- Returns:
- a list of XWikiDocument.
- Throws:
XWikiException
- in case of error while performing the query.
-
search
<T> List<T> search(String sql, int nb, int start, Object[][] whereParams, List<?> parameterValues, XWikiContext context) throws XWikiException
Execute a reading request with parameters and return result.Execute query by passing HQL request values as parameters. This allows generating a Named HQL query which will automatically encode the passed values (like escaping single quotes). This API is recommended to be used over the other similar methods where the values are passed inside the where clause and for which you'll need to do the encoding/escaping yourself before calling them.
- Parameters:
sql
- the HQL request.nb
- the number of rows to return. If 0 then all rows are returned.start
- the number of rows to skip. If 0 don't skip any row.whereParams
- if not null add tosql
a where clause based on a table of table containing field name, field value and compared symbol (=
,>
, etc.).parameterValues
- the where clause values that replace the question marks (?).context
- the XWiki context required for getting information about the execution context.- Returns:
- a list of XWikiDocument.
- Throws:
XWikiException
- in case of error while performing the query.- Since:
- 1.1.2, 1.2M2
-
cleanUp
void cleanUp(XWikiContext context)
-
isWikiNameAvailable
boolean isWikiNameAvailable(String wikiName, XWikiContext context) throws XWikiException
Indicate if the provided wiki name could be used to create a new wiki.- Parameters:
wikiName
- the name of the wiki.context
- the XWiki context.- Returns:
- true if the name is already used, false otherwise.
- Throws:
XWikiException
- error when looking if wiki name already used.
-
createWiki
void createWiki(String wikiName, XWikiContext context) throws XWikiException
Allows to create a new wiki database and initialize the default tables.- Parameters:
wikiName
- the name of the new wiki.context
- the XWiki context.- Throws:
XWikiException
- error when creating new wiki.
-
deleteWiki
void deleteWiki(String wikiName, XWikiContext context) throws XWikiException
Delete a wiki database.- Parameters:
wikiName
- the name of the wiki.context
- the XWiki context.- Throws:
XWikiException
- error when deleting wiki database.
-
exists
boolean exists(XWikiDocument doc, XWikiContext context) throws XWikiException
- Throws:
XWikiException
-
isCustomMappingValid
@Deprecated(since="11.5RC1") boolean isCustomMappingValid(BaseClass bclass, String custommapping1, XWikiContext context) throws XWikiException
Deprecated.- Throws:
XWikiException
-
isCustomMappingValid
default boolean isCustomMappingValid(BaseClass bclass, String custommapping1)
- Since:
- 11.5RC1
-
injectCustomMapping
@Deprecated(since="11.5RC1") boolean injectCustomMapping(BaseClass doc1class, XWikiContext xWikiContext) throws XWikiException
Deprecated.useinjectCustomMapping(BaseClass)
instead- Throws:
XWikiException
-
injectCustomMapping
default boolean injectCustomMapping(BaseClass doc1class) throws XWikiException
- Throws:
XWikiException
- Since:
- 11.5RC1
-
injectCustomMappings
boolean injectCustomMappings(XWikiDocument doc, XWikiContext context) throws XWikiException
- Throws:
XWikiException
-
injectCustomMappings
void injectCustomMappings(XWikiContext context) throws XWikiException
- Throws:
XWikiException
-
injectUpdatedCustomMappings
void injectUpdatedCustomMappings(XWikiContext context) throws XWikiException
- Throws:
XWikiException
-
getTranslationList
List<String> getTranslationList(XWikiDocument doc, XWikiContext context) throws XWikiException
- Throws:
XWikiException
-
getQueryManager
QueryManager getQueryManager()
- Returns:
- QueryManager used for creating queries to store. Use QueryManager instead of #search* methods because it is more abstract from store implementation and support multiple query languages.
-
getLimitSize
int getLimitSize(XWikiContext context, Class<?> entityType, String property)
Get the limit size of a property.- Parameters:
entityType
- the entityType where the property is located.property
- the property on which we want the limit size.context
- the context of the wiki to retrieve the property- Returns:
- an integer representing the limit size.
- Since:
- 11.4RC1
-
-