com.xpn.xwiki.store
Interface XWikiStoreInterface

All Known Subinterfaces:
XWikiCacheStoreInterface
All Known Implementing Classes:
XWikiCacheStore, XWikiDefaultStore, XWikiHibernateStore

@Role
public interface XWikiStoreInterface


Method Summary
 void cleanUp(XWikiContext context)
           
 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.
 int countDocuments(String wheresql, XWikiContext context)
          API allowing to count the total number of documents that would be returned by a 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)
           
 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)
           
 QueryManager getQueryManager()
           
 List<String> getTranslationList(XWikiDocument doc, XWikiContext context)
           
 boolean injectCustomMapping(BaseClass doc1class, XWikiContext xWikiContext)
           
 void injectCustomMappings(XWikiContext context)
           
 boolean injectCustomMappings(XWikiDocument doc, XWikiContext context)
           
 void injectUpdatedCustomMappings(XWikiContext context)
           
 boolean isCustomMappingValid(BaseClass bclass, String custommapping1, XWikiContext context)
           
 boolean isWikiNameAvailable(String wikiName, XWikiContext context)
          Indicate if the provided wiki name could be used to create a new wiki.
 List<DocumentReference> loadBacklinks(DocumentReference documentReference, boolean bTransaction, XWikiContext context)
           
 List<String> loadBacklinks(String fullName, XWikiContext context, boolean bTransaction)
          Deprecated. since 2.2M2 use loadBacklinks(DocumentReference, boolean, XWikiContext)
 List<XWikiLink> loadLinks(long docId, XWikiContext context, boolean bTransaction)
           
 XWikiLock loadLock(long docId, XWikiContext context, boolean bTransaction)
           
 XWikiDocument loadXWikiDoc(XWikiDocument doc, XWikiContext context)
           
 void saveLinks(XWikiDocument doc, XWikiContext context, boolean bTransaction)
           
 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, List<?> parameterValues, XWikiContext context)
          Execute a reading request with parameters 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, Object[][] whereParams, XWikiContext context)
          Execute a reading request and return result.
<T> List<T>
search(String sql, int nb, int start, XWikiContext context)
          Execute a reading request and return result.
 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, int nb, int start, String selectColumns, XWikiContext context)
           
 List<DocumentReference> searchDocumentReferences(String wheresql, int nb, int start, XWikiContext context)
           
 List<DocumentReference> searchDocumentReferences(String parametrizedSqlClause, List<?> parameterValues, XWikiContext context)
          Same as searchDocumentReferences(String, int, int, List, XWikiContext) but returns all rows.
 List<DocumentReference> searchDocumentReferences(String wheresql, XWikiContext context)
           
 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, boolean checkRight, 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, int nb, int start, 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, List<?> parameterValues, 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, 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, int nb, int start, XWikiContext context)
          Search documents in the storing system.
 List<XWikiDocument> searchDocuments(String wheresql, List<?> parameterValues, XWikiContext context)
          Search documents in the storing system.
 List<XWikiDocument> searchDocuments(String wheresql, XWikiContext context)
          Search documents in the storing system.
 List<String> searchDocumentsNames(String parametrizedSqlClause, int nb, int start, List<?> parameterValues, XWikiContext context)
          Deprecated. since 2.2M2 use searchDocumentReferences(String, int, int, List, XWikiContext)
 List<String> searchDocumentsNames(String wheresql, int nb, int start, String selectColumns, XWikiContext context)
          Deprecated. since 2.2M2 use searchDocumentReferences(String, int, int, String, XWikiContext)
 List<String> searchDocumentsNames(String wheresql, int nb, int start, XWikiContext context)
          Deprecated. since 2.2M2 use searchDocumentReferences(String, int, int, com.xpn.xwiki.XWikiContext)
 List<String> searchDocumentsNames(String parametrizedSqlClause, List<?> parameterValues, XWikiContext context)
          Deprecated. since 2.2M2 use searchDocumentReferences(String, List, XWikiContext)
 List<String> searchDocumentsNames(String wheresql, XWikiContext context)
          Deprecated. since 2.2M2 use searchDocumentReferences(String, com.xpn.xwiki.XWikiContext)
 

Method Detail

saveXWikiDoc

void saveXWikiDoc(XWikiDocument doc,
                  XWikiContext context)
                  throws XWikiException
Throws:
XWikiException

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 by searchDocuments(String, XWikiContext). It should not contain order by or group 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
List<String> searchDocumentsNames(String wheresql,
                                             XWikiContext context)
                                  throws XWikiException
Deprecated. since 2.2M2 use searchDocumentReferences(String, com.xpn.xwiki.XWikiContext)

Throws:
XWikiException

searchDocumentReferences

List<DocumentReference> searchDocumentReferences(String wheresql,
                                                 int nb,
                                                 int start,
                                                 XWikiContext context)
                                                 throws XWikiException
Throws:
XWikiException
Since:
2.2M2

searchDocumentsNames

@Deprecated
List<String> searchDocumentsNames(String wheresql,
                                             int nb,
                                             int start,
                                             XWikiContext context)
                                  throws XWikiException
Deprecated. since 2.2M2 use searchDocumentReferences(String, int, int, com.xpn.xwiki.XWikiContext)

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
List<String> searchDocumentsNames(String wheresql,
                                             int nb,
                                             int start,
                                             String selectColumns,
                                             XWikiContext context)
                                  throws XWikiException
Deprecated. since 2.2M2 use searchDocumentReferences(String, int, int, String, XWikiContext)

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/escpaing yourself before calling them.

Example

 <code>
 #set($orphans = $xwiki.searchDocuments(" where doc.fullName <> ? and (doc.parent = ? or "
     + "(doc.parent = ? and doc.space = ?))",
     ["${doc.fullName}as", ${doc.fullName}, ${doc.name}, ${doc.space}]))
 </code>
 

Parameters:
parametrizedSqlClause - the HQL where clause. For example " where doc.fullName <> ? and (doc.parent = ? or (doc.parent = ? and doc.space = ?))"
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 document references
Throws:
XWikiException - in case of error while performing the query
Since:
2.2M1

searchDocumentsNames

@Deprecated
List<String> searchDocumentsNames(String parametrizedSqlClause,
                                             int nb,
                                             int start,
                                             List<?> parameterValues,
                                             XWikiContext context)
                                  throws XWikiException
Deprecated. since 2.2M2 use searchDocumentReferences(String, int, int, List, XWikiContext)

Throws:
XWikiException

searchDocumentReferences

List<DocumentReference> searchDocumentReferences(String parametrizedSqlClause,
                                                 List<?> parameterValues,
                                                 XWikiContext context)
                                                 throws XWikiException
Same as searchDocumentReferences(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
List<String> searchDocumentsNames(String parametrizedSqlClause,
                                             List<?> parameterValues,
                                             XWikiContext context)
                                  throws XWikiException
Deprecated. since 2.2M2 use searchDocumentReferences(String, List, XWikiContext)

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 by searchDocuments(String, List, XWikiContext). It should not contain order by or group 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 <> ? and (doc.parent = ? or (doc.parent = ? and doc.space = ?))".
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 <> ? and (doc.parent = ? or (doc.parent = ? and doc.space = ?))".
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 <> ? and (doc.parent = ? or (doc.parent = ? and doc.space = ?))".
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 <> ? and (doc.parent = ? or (doc.parent = ? and doc.space = ?))".
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 <> ? and (doc.parent = ? or (doc.parent = ? and doc.space = ?))".
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:
XWiki Core 1.1.2, XWiki Core 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 <> ? and (doc.parent = ? or (doc.parent = ? and doc.space = ?))".
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 <> ? and (doc.parent = ? or (doc.parent = ? and doc.space = ?))".
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 <> ? and (doc.parent = ? or (doc.parent = ? and doc.space = ?))".
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 <> ? and (doc.parent = ? or (doc.parent = ? and doc.space = ?))".
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:
XWiki Core 1.1.2, XWiki Core 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 <> ? and (doc.parent = ? or (doc.parent = ? and doc.space = ?))".
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:
XWiki Core 1.1.2, XWiki Core 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 <> ? and (doc.parent = ? or (doc.parent = ? and doc.space = ?))".
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:
XWiki Core 1.1.2, XWiki Core 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 <> ? and (doc.parent = ? or (doc.parent = ? and doc.space = ?))".
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:
XWiki Core 1.1.2, XWiki Core 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

List<XWikiLink> loadLinks(long docId,
                          XWikiContext context,
                          boolean bTransaction)
                          throws XWikiException
Throws:
XWikiException

loadBacklinks

List<DocumentReference> loadBacklinks(DocumentReference documentReference,
                                      boolean bTransaction,
                                      XWikiContext context)
                                      throws XWikiException
Throws:
XWikiException
Since:
2.2M2

loadBacklinks

@Deprecated
List<String> loadBacklinks(String fullName,
                                      XWikiContext context,
                                      boolean bTransaction)
                           throws XWikiException
Deprecated. since 2.2M2 use loadBacklinks(DocumentReference, boolean, XWikiContext)

Throws:
XWikiException

saveLinks

void saveLinks(XWikiDocument doc,
               XWikiContext context,
               boolean bTransaction)
               throws XWikiException
Throws:
XWikiException

deleteLinks

void deleteLinks(long docId,
                 XWikiContext context,
                 boolean bTransaction)
                 throws XWikiException
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 <> ? and (doc.parent = ? or (doc.parent = ? and doc.space = ?))".
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:
XWiki Core 1.1.2, XWiki Core 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 to sql 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 to sql 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:
XWiki Core 1.1.2, XWiki Core 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

boolean isCustomMappingValid(BaseClass bclass,
                             String custommapping1,
                             XWikiContext context)
                             throws XWikiException
Throws:
XWikiException

injectCustomMapping

boolean injectCustomMapping(BaseClass doc1class,
                            XWikiContext xWikiContext)
                            throws XWikiException
Throws:
XWikiException

injectCustomMappings

boolean injectCustomMappings(XWikiDocument doc,
                             XWikiContext context)
                             throws XWikiException
Throws:
XWikiException

getCustomMappingPropertyList

List<String> getCustomMappingPropertyList(BaseClass bclass)

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.


Copyright © 2004–2014 XWiki. All rights reserved.