@Serializable(value=false) public class XWiki extends Object implements org.xwiki.observation.EventListener
| Modifier and Type | Field and Description |
|---|---|
static String |
CACHE_VERSION
Query parameters used to control the browser cache version of a resource.
|
static String |
CFG_ENV_NAME
Deprecated.
since 6.1M2, use
XWikiCfgConfigurationSource.CFG_ENV_NAME instead |
static String |
CKEY_BASESKIN |
static String |
CKEY_SKIN |
static String |
DEFAULT_ENCODING
The default encoding, and the internally used encoding when dealing with byte representation of strings.
|
static String |
DEFAULT_HOME_SPACE
Name of the default home space.
|
static String |
DEFAULT_MAIN_WIKI
Name of the default wiki.
|
static String |
DEFAULT_SKIN |
static String |
DEFAULT_SPACE_HOMEPAGE
Name of the default space homepage.
|
protected static org.slf4j.Logger |
LOGGER
Logging helper object.
|
static String |
MACROS_FILE |
static String |
SYSTEM_SPACE
Name of the default system space.
|
| Constructor and Description |
|---|
XWiki()
This provide a way to create an XWiki object without initializing the whole XWiki (including plugins, storage,
etc.).
|
XWiki(InputStream is,
XWikiContext context,
XWikiEngineContext engine_context)
Deprecated.
use
XWiki(XWikiContext, XWikiEngineContext, boolean) instead |
XWiki(String xwikicfgpath,
XWikiContext context)
Deprecated.
use
XWiki(XWikiContext) instead |
XWiki(String xwikicfgpath,
XWikiContext context,
XWikiEngineContext engine_context,
boolean noupdate)
Deprecated.
use
XWiki(XWikiContext, XWikiEngineContext, boolean) instead |
XWiki(XWikiConfig config,
XWikiContext context)
Deprecated.
since 6.1M3, use
XWiki(XWikiContext) instead |
XWiki(XWikiConfig config,
XWikiContext context,
XWikiEngineContext engine_context,
boolean noupdate)
Deprecated.
since 6.1M3, use
XWiki(XWikiContext, XWikiEngineContext, boolean) instead |
XWiki(XWikiContext context)
Initialize all xwiki subsystems.
|
XWiki(XWikiContext context,
XWikiEngineContext engineContext,
boolean noupdate)
Initialize all xwiki subsystems.
|
| Modifier and Type | Method and Description |
|---|---|
String |
addMandatory(XWikiContext context) |
String |
addTooltip(String html,
String message,
String params,
XWikiContext context) |
String |
addTooltip(String html,
String message,
XWikiContext context) |
String |
addTooltipJS(XWikiContext context) |
protected void |
addUserToGroup(String userName,
String groupName,
XWikiContext context) |
static Object |
callPrivateMethod(Object obj,
String methodName) |
static Object |
callPrivateMethod(Object obj,
String methodName,
Class<?>[] classes,
Object[] args) |
boolean |
checkAccess(String action,
XWikiDocument doc,
XWikiContext context) |
int |
checkActive(String user,
XWikiContext context)
Deprecated.
since 11.8RC1 prefer using
XWikiUser.isDisabled(XWikiContext). |
int |
checkActive(XWikiContext context)
Deprecated.
since 11.8RC1 prefer using
XWikiUser.isDisabled(XWikiContext). |
XWikiUser |
checkAuth(XWikiContext context) |
void |
checkDeletingDocument(DocumentReference userReference,
XWikiDocument document,
XWikiContext context)
Check if the user is allowed to delete the document.
|
void |
checkSavingDocument(DocumentReference userReference,
XWikiDocument document,
String comment,
boolean isMinorEdit,
XWikiContext context)
Check if the user is allowed to save the document.
|
void |
checkSavingDocument(DocumentReference userReference,
XWikiDocument document,
String comment,
XWikiContext context)
Check if the user is allowed to save the document.
|
void |
checkSavingDocument(DocumentReference userReference,
XWikiDocument document,
XWikiContext context)
Check if the user is allowed to save the document.
|
String |
clearName(String name,
boolean stripDots,
boolean ascii,
XWikiContext context) |
String |
clearName(String name,
XWikiContext context) |
String |
convertUsername(String username,
XWikiContext context) |
boolean |
copyDocument(DocumentReference sourceDocumentReference,
DocumentReference targetDocumentReference,
boolean reset,
boolean force,
boolean resetCreationData,
XWikiContext context) |
boolean |
copyDocument(DocumentReference sourceDocumentReference,
DocumentReference targetDocumentReference,
boolean reset,
XWikiContext context) |
boolean |
copyDocument(DocumentReference sourceDocumentReference,
DocumentReference targetDocumentReference,
String wikilocale,
boolean reset,
boolean force,
boolean resetCreationData,
XWikiContext context) |
boolean |
copyDocument(DocumentReference sourceDocumentReference,
DocumentReference targetDocumentReference,
String wikilocale,
boolean reset,
boolean force,
XWikiContext context) |
boolean |
copyDocument(DocumentReference sourceDocumentReference,
DocumentReference targetDocumentReference,
String wikilocale,
boolean reset,
XWikiContext context) |
boolean |
copyDocument(DocumentReference sourceDocumentReference,
DocumentReference targetDocumentReference,
String wikilocale,
XWikiContext context) |
boolean |
copyDocument(DocumentReference sourceDocumentReference,
DocumentReference targetDocumentReference,
XWikiContext context) |
int |
copySpaceBetweenWikis(String space,
String sourceWiki,
String targetWiki,
String locale,
boolean clean,
XWikiContext context) |
int |
copySpaceBetweenWikis(String space,
String sourceWiki,
String targetWiki,
String locale,
XWikiContext context) |
int |
copyWiki(String sourceWiki,
String targetWiki,
String locale,
boolean clean,
XWikiContext context)
Deprecated.
since 5.3, use
WikiManager.copy(String, String, String, boolean, boolean, boolean) instead |
int |
copyWiki(String sourceWiki,
String targetWiki,
String locale,
XWikiContext context)
Deprecated.
since 5.3, use
WikiManager.copy(String, String, String, boolean, boolean, boolean) instead |
int |
countAttachments(String parametrizedSqlClause,
List<?> parameterValues,
XWikiContext context)
Count attachments returned by a given parameterized query
|
protected Object |
createClassFromConfig(String param,
String defClass,
XWikiContext context) |
boolean |
createEmptyUser(String xwikiname,
String userRights,
XWikiContext context)
Method allows to create an empty user with no password (he won't be able to login) This method is usefull for
authentication like LDAP or App Server trusted
|
int |
createUser(boolean withValidation,
String userRights,
XWikiContext context) |
int |
createUser(String userName,
Map<String,?> map,
EntityReference parentReference,
String content,
org.xwiki.rendering.syntax.Syntax syntax,
String userRights,
XWikiContext context)
Create a new user.
|
int |
createUser(String userName,
Map<String,?> map,
String parent,
String content,
String syntaxId,
String userRights,
XWikiContext context)
Deprecated.
since 2.4RC1 use
createUser(String, Map, EntityReference, String, Syntax, String, XWikiContext) instead |
int |
createUser(String xwikiname,
Map<String,?> map,
String parent,
String content,
String userRights,
XWikiContext context)
Deprecated.
starting with XE 1.8.1 use
createUser(String, Map, String, String, String, String, XWikiContext) instead |
int |
createUser(String userName,
Map<String,?> map,
String userRights,
XWikiContext context)
Create a new user.
|
int |
createUser(String userName,
Map<String,?> map,
XWikiContext context)
Create a new user.
|
int |
createUser(XWikiContext context) |
void |
deleteAllDocuments(XWikiDocument doc,
boolean toTrash,
XWikiContext context) |
void |
deleteAllDocuments(XWikiDocument doc,
XWikiContext context) |
void |
deleteDocument(XWikiDocument doc,
boolean totrash,
XWikiContext context) |
void |
deleteDocument(XWikiDocument doc,
XWikiContext context) |
String |
evaluateTemplate(String template,
XWikiContext context)
Deprecated.
since 7.0M1, use
TemplateManager.render(String) instead |
String |
evaluateVelocity(String content,
String name) |
String |
evaluateVelocity(String content,
String namespace,
org.apache.velocity.VelocityContext vcontext) |
boolean |
exists(DocumentReference documentReference,
XWikiContext context) |
boolean |
exists(String fullname,
XWikiContext context)
Deprecated.
since 2.2.1 use
exists(DocumentReference, XWikiContext) |
void |
flushCache(XWikiContext context) |
String |
formatDate(Date date,
String format,
XWikiContext context) |
long |
freeMemory() |
void |
gc() |
String |
generateRandomString(int size) |
String |
generateValidationKey(int size) |
String |
getAdClientId(XWikiContext context) |
String |
getAdType(XWikiContext context) |
AttachmentRecycleBinStore |
getAttachmentRecycleBinStore() |
String |
getAttachmentRevisionURL(AttachmentReference attachmentReference,
String revision,
String queryString,
XWikiContext context) |
XWikiAttachmentStoreInterface |
getAttachmentStore()
Deprecated.
since 9.9RC1, use
getDefaultAttachmentContentStore() instead |
String |
getAttachmentURL(AttachmentReference attachmentReference,
String action,
String queryString,
XWikiContext context) |
String |
getAttachmentURL(AttachmentReference attachmentReference,
String queryString,
XWikiContext context) |
String |
getAttachmentURL(String fullname,
String filename,
String queryString,
XWikiContext context) |
String |
getAttachmentURL(String fullname,
String filename,
XWikiContext context) |
AttachmentVersioningStore |
getAttachmentVersioningStore()
Deprecated.
since 9.9RC1, use
getDefaultAttachmentArchiveStore() instead |
XWikiAuthService |
getAuthService() |
List<Locale> |
getAvailableLocales(XWikiContext xcontext)
Get the available locales according to the preferences.
|
String |
getBaseSkin(String skin,
XWikiContext context)
Deprecated.
since 7.0M1, use
SkinManager.getCurrentSkin(boolean) and Skin.getParent() instead |
String |
getBaseSkin(XWikiContext context)
Deprecated.
since 7.0M1
|
String |
getBaseSkin(XWikiContext context,
boolean fromRenderSkin)
Deprecated.
since 7.0M1
|
BaseClass |
getClass(String fullName,
XWikiContext context)
Deprecated.
since 2.2M2 use
getXClass(DocumentReference, XWikiContext) |
List<String> |
getClassList(XWikiContext context) |
BaseClass |
getCommentsClass(XWikiContext context) |
XWikiConfig |
getConfig()
Deprecated.
since 6.1M2, use
ConfigurationSource component with hint xwikicfg instead |
static String |
getConfigPath()
Deprecated.
since 6.1M2, use
XWikiCfgConfigurationSource.getConfigPath() instead |
List<String> |
getConfiguredSyntaxes()
Deprecated.
since 8.2M1, use the XWiki Rendering Configuration component or the Rendering Script Service one
instead
|
String |
getConvertingUserNameType(XWikiContext context) |
XWikiCriteriaService |
getCriteriaService(XWikiContext context) |
String |
getCurrentContentSyntaxId(String defaultSyntaxId,
XWikiContext context)
Get the syntax of the content currently being executed.
|
String |
getCurrentContentSyntaxId(XWikiContext context)
Get the syntax of the content currently being executed.
|
String |
getDatabase() |
AttachmentVersioningStore |
getDefaultAttachmentArchiveStore() |
XWikiAttachmentStoreInterface |
getDefaultAttachmentContentStore() |
String |
getDefaultBaseSkin(XWikiContext context)
Deprecated.
since 7.0M1, use
SkinManager.getDefaultParentSkin() instead |
String |
getDefaultDocumentSyntax() |
String |
getDefaultLanguage(XWikiContext xcontext)
Deprecated.
since 5.1M2 use
getDefaultLocale(XWikiContext) instead |
Locale |
getDefaultLocale(XWikiContext xcontext)
The default locale in the preferences.
|
String |
getDefaultPage(XWikiContext context) |
String |
getDefaultSpace(XWikiContext context) |
DeletedAttachment |
getDeletedAttachment(String id,
XWikiContext context)
Retrieve a specific attachment from the trash.
|
List<DeletedAttachment> |
getDeletedAttachments(String docName,
String filename,
XWikiContext context)
Retrieve all the deleted attachments that belonged to a certain document and had the specified name.
|
List<DeletedAttachment> |
getDeletedAttachments(String docName,
XWikiContext context)
Retrieve all the deleted attachments that belonged to a certain document.
|
XWikiDeletedDocument |
getDeletedDocument(long index,
XWikiContext context) |
XWikiDeletedDocument |
getDeletedDocument(String fullname,
String locale,
int index,
XWikiContext context)
Deprecated.
since 9.4RC1. Use
getDeletedDocument(long, XWikiContext) instead. |
XWikiDeletedDocument[] |
getDeletedDocuments(String fullname,
String locale,
XWikiContext context) |
XWikiDeletedDocument[] |
getDeletedDocuments(String batchId,
XWikiContext context) |
String |
getDocLanguagePreferenceNew(XWikiContext context)
Deprecated.
since 8.0M1, use
getDocLocalePreferenceNew(XWikiContext) instead |
Locale |
getDocLocalePreferenceNew(XWikiContext context) |
XWikiDocument |
getDocument(DocumentReference reference,
String revision,
XWikiContext context)
Deprecated.
sine 9.10RC1, use
DocumentRevisionProvider.getRevision(DocumentReference, String) instead |
XWikiDocument |
getDocument(DocumentReference reference,
XWikiContext context) |
XWikiDocument |
getDocument(EntityReference reference,
XWikiContext context)
Loads a XWikiDocument from the store.
|
XWikiDocument |
getDocument(PageReference reference,
XWikiContext context) |
XWikiDocument |
getDocument(String reference,
EntityType type,
XWikiContext xcontext)
Loads a XWikiDocument from the store.
|
XWikiDocument |
getDocument(String spaces,
String fullname,
XWikiContext context)
Deprecated.
since 2.2M1 use
getDocument(DocumentReference, XWikiContext) instead |
XWikiDocument |
getDocument(String fullname,
XWikiContext context)
Deprecated.
since 2.2M1 use
getDocument(DocumentReference, XWikiContext) instead |
XWikiDocument |
getDocument(XWikiDocument document,
String revision,
XWikiContext context)
Deprecated.
sine 9.10RC1, use
DocumentRevisionProvider.getRevision(XWikiDocument, String) instead |
XWikiDocument |
getDocument(XWikiDocument doc,
XWikiContext context) |
DocumentReference |
getDocumentReference(EntityReference reference,
XWikiContext context)
Find the document reference corresponding to the entity reference based on what exist in the database (page
reference can means two different documents for example).
|
DocumentReference |
getDocumentReference(XWikiRequest request,
XWikiContext context) |
BaseClass |
getEditModeClass(XWikiContext context)
Verify if the
XWiki.EditModeClass page exists and that it contains all the required configuration
properties to make the edit mode feature work properly. |
String |
getEditorPreference(XWikiContext context) |
String |
getEncoding() |
XWikiEngineContext |
getEngineContext() |
List<org.xwiki.observation.event.Event> |
getEvents() |
String |
getExternalAttachmentURL(String fullName,
String filename,
XWikiContext context) |
String |
getExternalURL(DocumentReference documentReference,
String action,
String querystring,
String anchor,
XWikiContext context)
Get the full URL of the given
DocumentReference. |
String |
getExternalURL(String fullname,
String action,
String querystring,
XWikiContext context) |
String |
getExternalURL(String fullname,
String action,
XWikiContext context) |
String |
getFullNameSQL() |
String |
getFullNameSQL(boolean newFullName) |
BaseClass |
getGlobalRightsClass(XWikiContext context) |
BaseClass |
getGroupClass(XWikiContext context) |
XWikiGroupService |
getGroupService(XWikiContext context) |
XWikiHibernateStore |
getHibernateStore() |
static org.apache.commons.httpclient.HttpClient |
getHttpClient(int timeout,
String userAgent) |
int |
getHttpTimeout(XWikiContext context) |
String |
getHttpUserAgent(XWikiContext context) |
String |
getIconURL(String iconName,
XWikiContext context) |
List<String> |
getIncludedMacros(String defaultSpace,
String content,
XWikiContext context) |
String |
getInterfaceLanguagePreference(XWikiContext context)
Deprecated.
since 8.0M1, use
getInterfaceLocalePreference(XWikiContext) instead |
Locale |
getInterfaceLocalePreference(XWikiContext context) |
String |
getLanguagePreference(XWikiContext context)
Deprecated.
since 8.0M1, use
getLocalePreference(XWikiContext) instead |
Locale |
getLocalePreference(XWikiContext context)
The algorithm to find the locale to use is the following, in this order:
Try to find the current locale in use from the XWiki contex
If the wiki is not multilingual use the wiki default locale (
default_language xproperty in
XWikiPreferences xobject or English if not found)
If the wiki is multilingual
Try to get the locale passed in the request (looking for a language query string parameter). |
String |
getLocalUserName(String user,
String format,
boolean link,
XWikiContext context) |
String |
getLocalUserName(String user,
String format,
XWikiContext context) |
String |
getLocalUserName(String user,
XWikiContext context) |
String |
getMacroList(XWikiContext context) |
static XWiki |
getMainXWiki(boolean wait,
XWikiContext context) |
static XWiki |
getMainXWiki(XWikiContext context) |
int |
getMaxRecursiveSpaceChecks(XWikiContext context) |
MetaClass |
getMetaclass() |
String |
getName() |
XWikiStoreInterface |
getNotCacheStore() |
BaseObject |
getObjectFromRequest(String className,
XWikiContext context) |
String |
getPlainUserName(DocumentReference userReference,
XWikiContext context)
Generate and return an unescaped user display name.
|
XWikiPluginInterface |
getPlugin(String name,
XWikiContext context)
Deprecated.
|
Api |
getPluginApi(String name,
XWikiContext context)
Deprecated.
|
XWikiPluginManager |
getPluginManager() |
BaseClass |
getPrefsClass(XWikiContext context)
Verify if the
XWiki.XWikiPreferences page exists and that it contains all the required configuration
properties to make XWiki work properly. |
static Object |
getPrivateField(Object obj,
String fieldName)
Deprecated.
use
FieldUtils.readDeclaredField(Object, String, boolean) instead |
PropertyClass |
getPropertyClassFromName(String propPath,
XWikiContext context) |
String |
getRealPath(String path) |
XWikiRecycleBinStoreInterface |
getRecycleBinStore() |
BaseClass |
getRedirectClass(XWikiContext context)
Verify if the
XWiki.GlobalRedirect page exists and that it contains all the required configuration
properties to make the redirection feature work properly. |
String |
getRefererText(String referer,
XWikiContext context) |
static URL |
getRequestURL(XWikiRequest request) |
URL |
getResource(String s) |
InputStream |
getResourceAsStream(String s) |
String |
getResourceContent(String name) |
byte[] |
getResourceContentAsBytes(String name) |
Date |
getResourceLastModificationDate(String name) |
BaseClass |
getRightsClass(String pagename,
XWikiContext context) |
BaseClass |
getRightsClass(XWikiContext context) |
XWikiRightService |
getRightService() |
long |
getSectionEditingDepth() |
URL |
getServerURL(String wikiId,
XWikiContext xcontext) |
static String |
getServerWikiPage(String servername) |
String |
getServletPath(String wikiName,
XWikiContext context) |
BaseClass |
getSheetClass(XWikiContext context)
Deprecated.
since 3.1M2 edit mode class should be used for this purpose, not the sheet class
|
String |
getSkin(XWikiContext context)
Deprecated.
since 7.0M1, use
SkinManager.getCurrentSkin(boolean) instead |
BaseClass |
getSkinClass(XWikiContext context) |
String |
getSkinFile(String filename,
boolean forceSkinAction,
XWikiContext context)
Build and return a skin file url based on the given parameters.
|
String |
getSkinFile(String fileName,
String skinId,
boolean forceSkinAction,
XWikiContext context) |
String |
getSkinFile(String filename,
String skin,
XWikiContext context) |
String |
getSkinFile(String filename,
XWikiContext context) |
String |
getSkinPreference(String prefname,
String defaultValue,
XWikiContext context) |
String |
getSkinPreference(String prefname,
XWikiContext context) |
String |
getSpaceCopyright(XWikiContext context) |
List<String> |
getSpaceDocsName(String spaceReference,
XWikiContext context)
Deprecated.
use query service instead
|
String |
getSpacePreference(String preferenceKey,
SpaceReference spaceReference,
String defaultValue,
XWikiContext context)
Get the preference key for the space and fallback on parent space or wiki in case nothing is found.
|
String |
getSpacePreference(String preferenceKey,
SpaceReference spaceReference,
XWikiContext context)
Get the reference of the space and fallback on parent space or wiki in case nothing is found.
|
String |
getSpacePreference(String preference,
String space,
String defaultValue,
XWikiContext context)
Deprecated.
since 7.4M1, use
getSpacePreference(String, SpaceReference, String, XWikiContext) instead |
String |
getSpacePreference(String preference,
String defaultValue,
XWikiContext context) |
String |
getSpacePreference(String preference,
XWikiContext context) |
int |
getSpacePreferenceAsInt(String preference,
int defaultValue,
XWikiContext context) |
int |
getSpacePreferenceAsInt(String preference,
XWikiContext context) |
long |
getSpacePreferenceAsLong(String preference,
long defaultValue,
XWikiContext context) |
long |
getSpacePreferenceAsLong(String preference,
XWikiContext context) |
List<String> |
getSpaces(XWikiContext context)
Deprecated.
use query service instead
|
XWikiStatsService |
getStatsService(XWikiContext context) |
XWikiStoreInterface |
getStore() |
BaseClass |
getTagClass(XWikiContext context)
Verify if the
XWiki.TagClass page exists and that it contains all the required configuration
properties to make the tag feature work properly. |
static String |
getTextArea(String content,
XWikiContext context) |
int |
getTimeDelta(long time) |
String |
getUniquePageName(String space,
String name,
XWikiContext context) |
String |
getUniquePageName(String space,
XWikiContext context) |
String |
getURL(DocumentReference documentReference,
String action,
String queryString,
String anchor,
XWikiContext context) |
String |
getURL(DocumentReference reference,
String action,
XWikiContext context) |
String |
getURL(EntityReference entityReference,
String action,
String queryString,
String anchor,
XWikiContext context) |
String |
getURL(EntityReference reference,
String action,
XWikiContext context) |
String |
getURL(EntityReference reference,
XWikiContext context) |
String |
getURL(String fullname,
String action,
String queryString,
String anchor,
XWikiContext context)
Deprecated.
since 2.2.1 use
getURL(DocumentReference, String, String, String, XWikiContext) |
String |
getURL(String fullname,
String action,
String querystring,
XWikiContext context) |
String |
getURL(String fullname,
String action,
XWikiContext context)
Deprecated.
since 2.3M2 use
getURL(DocumentReference, String, XWikiContext) |
String |
getURLContent(String surl,
int timeout,
String userAgent) |
String |
getURLContent(String surl,
String username,
String password,
int timeout,
String userAgent) |
String |
getURLContent(String surl,
String username,
String password,
XWikiContext context) |
String |
getURLContent(String surl,
XWikiContext context) |
byte[] |
getURLContentAsBytes(String surl,
int timeout,
String userAgent) |
byte[] |
getURLContentAsBytes(String surl,
String username,
String password,
int timeout,
String userAgent) |
byte[] |
getURLContentAsBytes(String surl,
String username,
String password,
XWikiContext context) |
byte[] |
getURLContentAsBytes(String surl,
XWikiContext context) |
XWikiURLFactoryService |
getURLFactoryService() |
User |
getUser(DocumentReference userReference,
XWikiContext context)
Retrieve a user from its document reference.
|
User |
getUser(String username,
XWikiContext context)
Deprecated.
since 11.8RC1 prefer using
getUser(DocumentReference, XWikiContext). |
User |
getUser(XWikiContext context) |
BaseClass |
getUserClass(XWikiContext context)
Verify if the
XWiki.XWikiUsers page exists and that it contains all the required configuration
properties to make the user feature work properly. |
String |
getUserName(DocumentReference userReference,
String format,
boolean link,
boolean escapeXML,
XWikiContext context)
Generate a display user name and return it.
|
String |
getUserName(String user,
String format,
boolean link,
XWikiContext context) |
String |
getUserName(String user,
String format,
XWikiContext context) |
String |
getUserName(String user,
XWikiContext context) |
String |
getUserPreference(String prefname,
boolean useCookie,
XWikiContext context) |
String |
getUserPreference(String prefname,
XWikiContext context) |
int |
getUserPreferenceAsInt(String prefname,
XWikiContext context) |
long |
getUserPreferenceAsLong(String preference,
XWikiContext context) |
String |
getUserPreferenceFromCookie(String prefname,
XWikiContext context) |
String |
getUserTimeZone(XWikiContext context) |
String |
getVersion() |
XWikiVersioningStoreInterface |
getVersioningStore() |
org.xwiki.cache.Cache<DocumentReference> |
getVirtualWikiCache()
Deprecated.
|
List<String> |
getVirtualWikiList()
Deprecated.
|
List<String> |
getVirtualWikisDatabaseNames(XWikiContext context)
Deprecated.
since 5.3, use
WikiDescriptorManager.getAllIds() instead |
String |
getWebAppPath(XWikiContext context) |
org.xwiki.job.Job |
getWikiInitializerJob(String wikiId) |
String |
getWikiOwner(String wikiName,
XWikiContext context)
Get the reference of the owner for the provider wiki.
|
String |
getWysiwygToolbars(XWikiContext context) |
BaseClass |
getXClass(DocumentReference documentReference,
XWikiContext context) |
static XWiki |
getXWiki(boolean wait,
XWikiContext xcontext)
Return the XWiki object (as in "the Wiki API") corresponding to the requested wiki.
|
static XWiki |
getXWiki(XWikiContext context)
Return the XWiki object (as in "the Wiki API") corresponding to the requested wiki.
|
String |
getXWikiPreference(String prefname,
String wiki,
String fallbackParam,
String defaultValue,
XWikiContext xcontext)
Obtain a preference value for the wiki, looking up first in the XWiki.XWikiPreferences document, then fallbacking
on a config parameter when the first lookup gives an empty string, then returning the default value if the config
parameter returned itself an empty string.
|
String |
getXWikiPreference(String prefname,
String fallbackParam,
String defaultValue,
XWikiContext context)
Obtain a preference value for the wiki, looking up first in the XWiki.XWikiPreferences document, then fallbacking
on a config parameter when the first lookup gives an empty string, then returning the default value if the config
parameter returned itself an empty string.
|
String |
getXWikiPreference(String prefname,
String defaultValue,
XWikiContext context) |
String |
getXWikiPreference(String prefname,
XWikiContext context) |
int |
getXWikiPreferenceAsInt(String preference,
int defaultValue,
XWikiContext context) |
int |
getXWikiPreferenceAsInt(String preference,
String fallbackParameter,
int defaultValue,
XWikiContext context) |
int |
getXWikiPreferenceAsInt(String preference,
XWikiContext context) |
long |
getXWikiPreferenceAsLong(String preference,
long defaultValue,
XWikiContext context) |
long |
getXWikiPreferenceAsLong(String preference,
String fallbackParameter,
long defaultValue,
XWikiContext context) |
long |
getXWikiPreferenceAsLong(String preference,
XWikiContext context) |
ZipOutputStream |
getZipOutputStream(XWikiContext context) |
boolean |
hasAttachmentRecycleBin(XWikiContext context)
Indicates whether deleted attachments are stored in a recycle bin or not.
|
boolean |
hasAttachmentVersioning(XWikiContext context) |
boolean |
hasBacklinks(XWikiContext context) |
boolean |
hasCentralizedAuthentication(XWikiContext context) |
boolean |
hasCustomMappings() |
boolean |
hasDynamicCustomMappings() |
boolean |
hasEditComment(XWikiContext context) |
boolean |
hasMinorEdit(XWikiContext context) |
boolean |
hasRecycleBin(XWikiContext context) |
boolean |
hasSectionEdit(XWikiContext context) |
boolean |
hasTags(XWikiContext context) |
boolean |
hasVersioning(XWikiContext context) |
String |
include(String topic,
boolean isForm,
XWikiContext context) |
void |
initializeMandatoryDocuments(XWikiContext context)
Ensure that mandatory classes (ie classes XWiki needs to work properly) exist and create them if they don't
exist.
|
boolean |
initializeWiki(String wikiId,
boolean wait,
XWikiContext xcontext)
Make sure the wiki is initializing or wait for it.
|
void |
initXWiki(XWikiConfig config,
XWikiContext context,
XWikiEngineContext engineContext,
boolean noupdate)
Deprecated.
since 6.1M2, use
initXWiki(XWikiContext, XWikiEngineContext, boolean) instead |
void |
initXWiki(XWikiContext context,
XWikiEngineContext engineContext,
boolean noupdate)
Initialize all xwiki subsystems.
|
boolean |
isAllGroupImplicit() |
boolean |
isEditCommentFieldHidden(XWikiContext context) |
boolean |
isEditCommentMandatory(XWikiContext context) |
boolean |
isEditCommentSuggested(XWikiContext context) |
static boolean |
isInitializing(XWikiContext xcontext) |
boolean |
isLDAP() |
boolean |
isMultiLingual(XWikiContext context) |
boolean |
isMySQL() |
boolean |
isPathBased() |
boolean |
isReadOnly()
accessor for the isReadOnly instance var.
|
boolean |
isTitleInCompatibilityMode() |
long |
maxMemory() |
void |
onEvent(org.xwiki.observation.event.Event event,
Object source,
Object data) |
String |
Param(String key)
Deprecated.
since 6.1M2, use
ConfigurationSource component with hint xwikicfg instead |
String |
Param(String key,
String default_value)
Deprecated.
since 6.1M2, use
ConfigurationSource component with hint xwikicfg instead |
long |
ParamAsLong(String key)
Deprecated.
since 6.1M2, use
ConfigurationSource component with hint xwikicfg instead |
long |
ParamAsLong(String key,
long default_value)
Deprecated.
since 6.1M2, use
ConfigurationSource component with hint xwikicfg instead |
String |
ParamAsRealPath(String key) |
String |
ParamAsRealPath(String key,
XWikiContext context) |
String |
ParamAsRealPathVerified(String param) |
String |
parseContent(String content,
XWikiContext context)
Deprecated.
Since 7.2M1. Use specific rendering/parsing options for the content type you want to parse/render.
|
Object |
parseGroovyFromPage(String fullName,
String jarWikiPage,
XWikiContext context) |
Object |
parseGroovyFromPage(String fullName,
XWikiContext context) |
Object |
parseGroovyFromString(String script,
String jarWikiPage,
XWikiContext xcontext)
Privileged API to retrieve an object instantiated from groovy code in a String, using a classloader including all
JAR files located in the passed page as attachments.
|
Object |
parseGroovyFromString(String script,
XWikiContext xcontext)
Privileged API to retrieve an object instantiated from groovy code in a String.
|
String |
parseTemplate(String template,
String skinId,
XWikiContext context)
Deprecated.
since 7.0M1, use
TemplateManager.renderFromSkin(java.lang.String, org.xwiki.skin.Skin) instead |
String |
parseTemplate(String template,
XWikiContext context)
Deprecated.
use
evaluateTemplate(String, XWikiContext) instead |
boolean |
prepareDocuments(XWikiRequest request,
XWikiContext context,
org.apache.velocity.VelocityContext vcontext) |
void |
prepareResources(XWikiContext context)
Prepares the localized resources, according to the selected locale.
|
String |
printStrackTrace(Throwable e)
Deprecated.
use
ExceptionUtils.getStackTrace(Throwable) instead |
void |
protectUserPage(String userName,
String userRights,
XWikiDocument doc,
XWikiContext context) |
void |
refreshLinks(XWikiContext context) |
void |
renameByCopyAndDelete(XWikiDocument sourceDoc,
DocumentReference newDocumentReference,
List<DocumentReference> backlinkDocumentReferences,
List<DocumentReference> childDocumentReferences,
XWikiContext context)
Deprecated.
Old implementation of the rename by copy and delete. Since 12.5 the implementation using
XWikiStoreInterface.renameXWikiDoc(XWikiDocument, DocumentReference, XWikiContext) should be preferred. |
boolean |
renameDocument(DocumentReference sourceDocumentReference,
DocumentReference targetDocumentReference,
boolean overwrite,
List<DocumentReference> backlinkDocumentReferences,
List<DocumentReference> childDocumentReferences,
XWikiContext context)
API to rename a document to another document.
|
String |
renderTemplate(String template,
String skin,
XWikiContext context) |
String |
renderTemplate(String template,
XWikiContext context) |
boolean |
resourceExists(String name) |
void |
restoreFromRecycleBin(long index,
String comment,
XWikiContext context)
Restore a document with passed index from recycle bin.
|
void |
restoreFromRecycleBin(XWikiDocument doc,
long index,
String comment,
XWikiContext context)
Deprecated.
since 9.4RC1. Use
restoreFromRecycleBin(long, String, XWikiContext) instead. |
void |
restoreFromRecycleBin(XWikiDocument doc,
String comment,
XWikiContext context)
Restore a document with passed index from recycle bin.
|
XWikiDocument |
rollback(XWikiDocument tdoc,
String rev,
boolean addRevision,
XWikiContext xcontext) |
XWikiDocument |
rollback(XWikiDocument tdoc,
String rev,
XWikiContext context) |
void |
saveDocument(XWikiDocument document,
String comment,
boolean isMinorEdit,
XWikiContext context)
Save the passed document in the store.
|
void |
saveDocument(XWikiDocument doc,
String comment,
XWikiContext context) |
void |
saveDocument(XWikiDocument doc,
XWikiContext context) |
<T> List<T> |
search(String sql,
int nb,
int start,
Object[][] whereParams,
XWikiContext context) |
<T> List<T> |
search(String sql,
int nb,
int start,
XWikiContext context) |
<T> List<T> |
search(String sql,
Object[][] whereParams,
XWikiContext context) |
<T> List<T> |
search(String sql,
XWikiContext context) |
List<XWikiAttachment> |
searchAttachments(String parametrizedSqlClause,
boolean checkRight,
int nb,
int start,
List<?> parameterValues,
XWikiContext context)
Deprecated.
since 9.7RC1, use the QueryManager instead along with the "attachment" query filter
|
void |
sendConfirmationEmail(String xwikiname,
String password,
String email,
String message,
String contentfield,
XWikiContext context) |
void |
sendValidationEmail(String xwikiname,
String password,
String email,
String addfieldname,
String addfieldvalue,
String contentfield,
XWikiContext context) |
void |
sendValidationEmail(String xwikiname,
String password,
String email,
String validkey,
String contentfield,
XWikiContext context) |
void |
setAttachmentRecycleBinStore(AttachmentRecycleBinStore attachmentRecycleBinStore) |
void |
setAttachmentStore(XWikiAttachmentStoreInterface attachmentStore)
Deprecated.
since 9.9RC1, use
setDefaultAttachmentContentStore(XWikiAttachmentStoreInterface) instead |
void |
setAttachmentVersioningStore(AttachmentVersioningStore attachmentArchiveStore)
Deprecated.
since 9.10RC1, use
setDefaultAttachmentArchiveStore(AttachmentVersioningStore) instead |
void |
setAuthService(XWikiAuthService authService) |
void |
setConfig(XWikiConfig config)
Deprecated.
since 6.1M2
|
void |
setCriteriaService(XWikiCriteriaService criteriaService) |
void |
setDatabase(String database) |
void |
setDefaultAttachmentArchiveStore(AttachmentVersioningStore attachmentArchiveStore) |
void |
setDefaultAttachmentContentStore(XWikiAttachmentStoreInterface attachmentContentStore) |
void |
setEngineContext(XWikiEngineContext engine_context) |
void |
setGroupService(XWikiGroupService groupService) |
void |
setMetaclass(MetaClass metaclass) |
void |
setPhonyDocument(DocumentReference reference,
XWikiContext context) |
void |
setPhonyDocument(DocumentReference reference,
XWikiContext context,
org.apache.velocity.VelocityContext vcontext)
Deprecated.
since 8.3M1, use
setPhonyDocument(DocumentReference, XWikiContext) instead |
void |
setPhonyDocument(String docName,
XWikiContext context,
org.apache.velocity.VelocityContext vcontext)
Deprecated.
|
void |
setPluginManager(XWikiPluginManager pluginManager) |
void |
setReadOnly(boolean readOnly) |
void |
setRecycleBinStore(XWikiRecycleBinStoreInterface recycleBinStore) |
void |
setRightService(XWikiRightService rightService) |
void |
setStore(XWikiStoreInterface store) |
void |
setUserDefaultGroup(String fullwikiname,
XWikiContext context) |
void |
setVersion(String version) |
void |
setVersioningStore(XWikiVersioningStoreInterface versioningStore) |
boolean |
showViewAction(XWikiContext context) |
String[] |
split(String str,
String sep) |
static String |
stripSegmentFromPath(String path,
String segment)
Helper method, removes a predefined path segment (the context path or the servel path) from the start of the
requested URI and returns the remainder.
|
long |
totalMemory() |
void |
updateDatabase(String wikiId,
boolean force,
boolean initDocuments,
XWikiContext context)
Deprecated.
since 8.4RC1, use
initializeWiki(String, boolean, XWikiContext) instead |
void |
updateDatabase(String wikiId,
boolean force,
XWikiContext context)
Deprecated.
since 8.4RC1, use
initializeWiki(String, boolean, XWikiContext) instead |
void |
updateDatabase(String wikiId,
XWikiContext context)
Deprecated.
since 8.4RC1, use
initializeWiki(String, boolean, XWikiContext) instead |
boolean |
useDefaultAction(XWikiContext context) |
boolean |
validateDocument(XWikiDocument doc,
XWikiContext context) |
int |
validateUser(boolean withConfirmEmail,
XWikiContext context) |
public static final String DEFAULT_MAIN_WIKI
public static final String DEFAULT_HOME_SPACE
public static final String SYSTEM_SPACE
public static final String DEFAULT_SPACE_HOMEPAGE
public static final String CKEY_SKIN
public static final String CKEY_BASESKIN
public static final String DEFAULT_SKIN
public static final String CACHE_VERSION
protected static final org.slf4j.Logger LOGGER
public static final String DEFAULT_ENCODING
@Deprecated public static final String CFG_ENV_NAME
XWikiCfgConfigurationSource.CFG_ENV_NAME insteadpublic static final String MACROS_FILE
public XWiki()
Needed for tools or tests which need XWiki because it is used everywhere in the API.
public XWiki(XWikiContext context, XWikiEngineContext engineContext, boolean noupdate) throws XWikiException
context - see XWikiContextengineContext - the XWiki object wrapping the ServletContext and which allows to set
data that live on as long as the XWiki webapp is not stopped in the Servlet Containernoupdate - true if the whole initialization should be done (create mandatory xlcasses, initialize stats
service), i.e. if this is not an update, and false otherwiseXWikiException - if an error happened during initialization (failure to initialize some cache for example)public XWiki(XWikiContext context) throws XWikiException
context - see XWikiContextXWikiException - if an error happened during initialization (failure to initialize some cache for example)@Deprecated public XWiki(XWikiConfig config, XWikiContext context) throws XWikiException
XWiki(XWikiContext) insteadXWikiException@Deprecated public XWiki(XWikiConfig config, XWikiContext context, XWikiEngineContext engine_context, boolean noupdate) throws XWikiException
XWiki(XWikiContext, XWikiEngineContext, boolean) insteadXWikiException@Deprecated public XWiki(String xwikicfgpath, XWikiContext context) throws XWikiException
XWiki(XWikiContext) insteadXWikiException@Deprecated public XWiki(String xwikicfgpath, XWikiContext context, XWikiEngineContext engine_context, boolean noupdate) throws XWikiException
XWiki(XWikiContext, XWikiEngineContext, boolean) insteadXWikiException@Deprecated public XWiki(InputStream is, XWikiContext context, XWikiEngineContext engine_context) throws XWikiException
XWiki(XWikiContext, XWikiEngineContext, boolean) insteadXWikiExceptionpublic static XWiki getMainXWiki(XWikiContext context) throws XWikiException
context - see XWikiContextXWikiExceptionpublic static XWiki getMainXWiki(boolean wait, XWikiContext context) throws XWikiException
wait - true if the method should way for XWiki instance to be initializedcontext - see XWikiContextXWikiExceptionpublic static boolean isInitializing(XWikiContext xcontext)
public static XWiki getXWiki(XWikiContext context) throws XWikiException
context - see XWikiContextXWikiException - if the requested URL does not correspond to a real wiki, or if there's an error in the
storagepublic static XWiki getXWiki(boolean wait, XWikiContext xcontext) throws XWikiException
Unless wait is false the method return right away null if XWiki is not yet initialized.
wait - wait until XWiki is initializedxcontext - see XWikiContextXWikiException - if the requested URL does not correspond to a real wiki, or if there's an error in the
storagepublic org.xwiki.job.Job getWikiInitializerJob(String wikiId)
wikiId - the identifier of the wikiWikiInitializerJob associated to the passed wiki or null if there is nonepublic boolean initializeWiki(String wikiId, boolean wait, XWikiContext xcontext) throws XWikiException
wikiId - the identifier of the wiki to initializewait - true if the method should return only when the wiki is fully initializedxcontext - the XWiki contextXWikiException - when the initialization failedpublic static URL getRequestURL(XWikiRequest request) throws XWikiException
XWikiExceptionpublic static Object callPrivateMethod(Object obj, String methodName, Class<?>[] classes, Object[] args)
public static org.apache.commons.httpclient.HttpClient getHttpClient(int timeout,
String userAgent)
@Deprecated public static Object getPrivateField(Object obj, String fieldName)
FieldUtils.readDeclaredField(Object, String, boolean) insteadobj - the java object on which to read the private field valuefieldName - the object member field for which to read the valuepublic static String getTextArea(String content, XWikiContext context)
content - the content of the text areacontext - see XWikiContextpublic void initXWiki(XWikiContext context, XWikiEngineContext engineContext, boolean noupdate) throws XWikiException
context - see XWikiContextengineContext - the XWiki object wrapping the ServletContext and which allows to set
data that live on as long as the XWiki webapp is not stopped in the Servlet Containernoupdate - true if the whole initialization should be done (create mandatory xlcasses, initialize stats
service), i.e. if this is not an update, and false otherwiseXWikiException - if an error happened during initialization (failure to initialize some cache for example)@Deprecated public void initXWiki(XWikiConfig config, XWikiContext context, XWikiEngineContext engineContext, boolean noupdate) throws XWikiException
initXWiki(XWikiContext, XWikiEngineContext, boolean) insteadconfig - the object holding the XWiki configuration read from xwiki.cfgcontext - see XWikiContextengineContext - the XWiki object wrapping the ServletContext and which allows to set
data that live on as long as the XWiki webapp is not stopped in the Servlet Containernoupdate - true if the whole initialization should be done (create mandatory xlcasses, initialize stats
service), i.e. if this is not an update, and false otherwiseXWikiException - if an error happened during initialization (failure to initialize some cache for example)public void initializeMandatoryDocuments(XWikiContext context)
context - see XWikiContextpublic XWikiStoreInterface getNotCacheStore()
public XWikiHibernateStore getHibernateStore()
@Deprecated public void updateDatabase(String wikiId, XWikiContext context) throws org.hibernate.HibernateException, XWikiException
initializeWiki(String, boolean, XWikiContext) insteadwikiId - the id of the wikicontext - see XWikiContextorg.hibernate.HibernateExceptionXWikiException@Deprecated public void updateDatabase(String wikiId, boolean force, XWikiContext context) throws org.hibernate.HibernateException, XWikiException
initializeWiki(String, boolean, XWikiContext) insteadwikiId - the id of the wikicontext - see XWikiContextorg.hibernate.HibernateExceptionXWikiException@Deprecated public void updateDatabase(String wikiId, boolean force, boolean initDocuments, XWikiContext context) throws org.hibernate.HibernateException, XWikiException
initializeWiki(String, boolean, XWikiContext) insteadwikiId - the id of the wikiforce - if the update of the databse should be forcedinitDocuments - if mandatory document and plugin should be initialized for passed wikicontext - see XWikiContextorg.hibernate.HibernateExceptionXWikiException@Deprecated public List<String> getVirtualWikiList()
WikiDescriptorManager.getAllIds().@Deprecated public List<String> getVirtualWikisDatabaseNames(XWikiContext context) throws XWikiException
WikiDescriptorManager.getAllIds() insteadcontext - see XWikiContextXWiki.XWikiServerClass object attached to them by removing the
XWiki.XWikiServer prefix and making it lower case. For example a page named
XWiki.XWikiServerMyDatabase would return mydatabase as the wiki name. This list will also
contain the main wiki.
Note: the wiki name is commonly also the name of the database where the wiki's data is stored. However, if configured accordingly, the database can be diferent from the wiki name, like for example when setting a wiki database prefix.
XWikiException@Deprecated public org.xwiki.cache.Cache<DocumentReference> getVirtualWikiCache()
public String getWikiOwner(String wikiName, XWikiContext context) throws XWikiException
wikiName - the technical name of the wikicontext - see XWikiContextXWikiException - failed to get wiki descriptor documentprotected Object createClassFromConfig(String param, String defClass, XWikiContext context) throws XWikiException
context - see XWikiContextXWikiExceptionpublic String getVersion()
VERSION_FILE filepublic URL getResource(String s) throws MalformedURLException
MalformedURLExceptionpublic InputStream getResourceAsStream(String s) throws MalformedURLException
MalformedURLExceptionpublic String getResourceContent(String name) throws IOException
IOExceptionpublic byte[] getResourceContentAsBytes(String name) throws IOException
IOExceptionpublic boolean resourceExists(String name)
public String ParamAsRealPath(String key, XWikiContext context)
context - see XWikiContextpublic XWikiStoreInterface getStore()
@Deprecated public XWikiAttachmentStoreInterface getAttachmentStore()
getDefaultAttachmentContentStore() insteadpublic XWikiAttachmentStoreInterface getDefaultAttachmentContentStore()
public AttachmentVersioningStore getDefaultAttachmentArchiveStore()
@Deprecated public AttachmentVersioningStore getAttachmentVersioningStore()
getDefaultAttachmentArchiveStore() insteadpublic XWikiVersioningStoreInterface getVersioningStore()
public XWikiRecycleBinStoreInterface getRecycleBinStore()
public AttachmentRecycleBinStore getAttachmentRecycleBinStore()
@Unstable public void checkSavingDocument(DocumentReference userReference, XWikiDocument document, String comment, XWikiContext context) throws XWikiException
userReference - the user responsible for the changesdocument - the document to savecomment - the comment to associated to the new version of the saved documentcontext - see XWikiContextXWikiException@Unstable public void checkSavingDocument(DocumentReference userReference, XWikiDocument document, XWikiContext context) throws XWikiException
userReference - the user responsible for the changesdocument - the document to savecontext - see XWikiContextXWikiException@Unstable public void checkSavingDocument(DocumentReference userReference, XWikiDocument document, String comment, boolean isMinorEdit, XWikiContext context) throws XWikiException
userReference - the user responsible for the changesdocument - the document to savecomment - the comment to associated to the new version of the saved documentisMinorEdit - true if the new version is a minor versioncontext - see XWikiContextXWikiExceptionpublic void saveDocument(XWikiDocument doc, XWikiContext context) throws XWikiException
doc - the document to savecontext - see XWikiContextXWikiExceptionpublic void saveDocument(XWikiDocument doc, String comment, XWikiContext context) throws XWikiException
doc - the document to savecomment - the comment to associated to the new version of the saved documentcontext - see XWikiContextXWikiExceptionpublic void saveDocument(XWikiDocument document, String comment, boolean isMinorEdit, XWikiContext context) throws XWikiException
If document is not new and metadata and content dirty flags are false, the version/history won't be incremented (only the current state will be updated).
Since 11.1, if document#isNew() return true, any pre existing document will be backuped in the deleted documents store automatically and completely replaced.
document - the document to savecomment - the comment to associated to the new version of the saved documentisMinorEdit - true if the new version is a minor versioncontext - see XWikiContextXWikiExceptionpublic XWikiDocument getDocument(EntityReference reference, XWikiContext context) throws XWikiException
Before 7.2M1 the reference is assumed to be a complete or incomplete document reference.
Since 7.2M1, the passed reference can be anything. If if a document child, the document reference will be extracted from it. If it's a document parent it will be completed with the necessary default references (for example if it's a space reference it will load the space home page).
reference - the reference of the documentcontext - see XWikiContextXWikiExceptionpublic XWikiDocument getDocument(String reference, EntityType type, XWikiContext xcontext) throws XWikiException
reference - the reference of the document to be loadedtype - the type of the referenceDocument.isNew()XWikiExceptionpublic XWikiDocument getDocument(XWikiDocument doc, XWikiContext context) throws XWikiException
doc - the documentcontext - see XWikiContextXWikiException@Deprecated public XWikiDocument getDocument(DocumentReference reference, String revision, XWikiContext context) throws XWikiException
DocumentRevisionProvider.getRevision(DocumentReference, String) insteadreference - the reference of the document to loadrevision - the revision of the document to loadcontext - the XWiki contextXWikiException - when failing to load the document revision@Deprecated public XWikiDocument getDocument(XWikiDocument document, String revision, XWikiContext context) throws XWikiException
DocumentRevisionProvider.getRevision(XWikiDocument, String) insteaddocument - the reference documentrevision - the revision of the document to loadcontext - the XWiki contextXWikiException - when failing to load the document revisionpublic XWikiDocument getDocument(DocumentReference reference, XWikiContext context) throws XWikiException
reference - the reference of the documentcontext - see XWikiContextXWikiExceptionpublic XWikiDocument getDocument(PageReference reference, XWikiContext context) throws XWikiException
reference - the reference of the pagecontext - see XWikiContextXWikiExceptionpublic DocumentReference getDocumentReference(EntityReference reference, XWikiContext context)
reference - the reference to resolvecontext - the XWiki context@Deprecated public XWikiDocument getDocument(String fullname, XWikiContext context) throws XWikiException
getDocument(DocumentReference, XWikiContext) insteadfullname - the reference of the document as Stringcontext - see XWikiContextXWikiException@Deprecated public XWikiDocument getDocument(String spaces, String fullname, XWikiContext context) throws XWikiException
getDocument(DocumentReference, XWikiContext) insteadspaces - the reference of the space as Stringfullname - the reference of the document as Stringcontext - see XWikiContextXWikiExceptionpublic XWikiDeletedDocument[] getDeletedDocuments(String fullname, String locale, XWikiContext context) throws XWikiException
XWikiExceptionXWiki.getDeletedDocuments(String, String)public XWikiDeletedDocument[] getDeletedDocuments(String batchId, XWikiContext context) throws XWikiException
XWikiExceptionXWiki.getDeletedDocuments(String)@Deprecated public XWikiDeletedDocument getDeletedDocument(String fullname, String locale, int index, XWikiContext context) throws XWikiException
getDeletedDocument(long, XWikiContext) instead.XWikiExceptionXWiki.getDeletedDocument(String, String, String)public XWikiDeletedDocument getDeletedDocument(long index, XWikiContext context) throws XWikiException
XWikiExceptionXWiki.getDeletedDocument(String)public List<DeletedAttachment> getDeletedAttachments(String docName, XWikiContext context) throws XWikiException
docName - the name of the owner documentcontext - see XWikiContextXWikiException - if an error occurs while loading the attachmentspublic List<DeletedAttachment> getDeletedAttachments(String docName, String filename, XWikiContext context) throws XWikiException
docName - the name of the document the attachment belonged tofilename - the name of the attachment to search forcontext - see XWikiContextXWikiException - if an error occurs while loading the attachmentspublic DeletedAttachment getDeletedAttachment(String id, XWikiContext context) throws XWikiException
id - the unique identifier of the entry in the trashcontext - the XWiki contextnull if not foundXWikiException - if an error occurs while loading the attachmentspublic MetaClass getMetaclass()
public void setMetaclass(MetaClass metaclass)
public List<String> getClassList(XWikiContext context) throws XWikiException
context - see XWikiContextXWikiExceptionpublic <T> List<T> search(String sql, XWikiContext context) throws XWikiException
sql - the sql query to executecontext - see XWikiContextXWikiExceptionpublic <T> List<T> search(String sql, int nb, int start, XWikiContext context) throws XWikiException
sql - the sql query to executenb - limit the number of results to returnstart - the offset from which to start return resultscontext - see XWikiContextXWikiExceptionpublic <T> List<T> search(String sql, Object[][] whereParams, XWikiContext context) throws XWikiException
sql - the sql query to executecontext - see XWikiContextXWikiExceptionpublic <T> List<T> search(String sql, int nb, int start, Object[][] whereParams, XWikiContext context) throws XWikiException
sql - the sql query to executenb - limit the number of results to returnstart - the offset from which to start return resultscontext - see XWikiContextXWikiException@Deprecated public String parseContent(String content, XWikiContext context)
content - the content to parsecontext - see XWikiContext@Deprecated public String parseTemplate(String template, XWikiContext context)
evaluateTemplate(String, XWikiContext) insteadtemplate - the name of the templatecontext - see XWikiContext@Deprecated public String evaluateTemplate(String template, XWikiContext context) throws IOException
TemplateManager.render(String) insteadtemplate - the template to evaluatecontext - see XWikiContextIOException - failed to get the template content@Deprecated public String parseTemplate(String template, String skinId, XWikiContext context)
TemplateManager.renderFromSkin(java.lang.String, org.xwiki.skin.Skin) insteadtemplate - the name of the templateskinId - the id of the skin from which to load the templatecontext - see XWikiContextpublic String renderTemplate(String template, String skin, XWikiContext context)
template - the name of the templateskin - the id of the skin from which to load the templatecontext - see XWikiContextpublic String renderTemplate(String template, XWikiContext context)
template - the name of the templatecontext - see XWikiContextpublic String getIconURL(String iconName, XWikiContext context)
iconName - the standard name of an icon (it's not the name of the file on the filesystem, it's a generic
name, for example "success" for a success iconcontext - see XWikiContextpublic String getSkinFile(String filename, XWikiContext context)
public String getSkinFile(String filename, boolean forceSkinAction, XWikiContext context)
filename - the file name of the skin file wantedforceSkinAction - if true force the usage of directory /skins/ in the URLcontext - current context for the requestpublic String getSkinFile(String filename, String skin, XWikiContext context)
public String getSkinFile(String fileName, String skinId, boolean forceSkinAction, XWikiContext context)
@Deprecated public String getSkin(XWikiContext context)
SkinManager.getCurrentSkin(boolean) insteadpublic String getSkinPreference(String prefname, XWikiContext context)
public String getSkinPreference(String prefname, String defaultValue, XWikiContext context)
@Deprecated public String getDefaultBaseSkin(XWikiContext context)
SkinManager.getDefaultParentSkin() instead@Deprecated public String getBaseSkin(XWikiContext context)
@Deprecated public String getBaseSkin(XWikiContext context, boolean fromRenderSkin)
@Deprecated public String getBaseSkin(String skin, XWikiContext context)
SkinManager.getCurrentSkin(boolean) and Skin.getParent() insteadskin - the name of the skin for which to return the base skin. For example : XWiki.DefaultSkincontext - see XWikiContextpublic String getSpaceCopyright(XWikiContext context)
public String getXWikiPreference(String prefname, XWikiContext context)
public String getXWikiPreference(String prefname, String fallbackParam, String defaultValue, XWikiContext context)
prefname - the parameter to look for in the XWiki.XWikiPreferences object in the XWiki.XWikiPreferences
document of the wiki.fallbackParam - the parameter in xwiki.cfg to fallback on, in case the XWiki.XWikiPreferences object gave no
resultdefaultValue - the default value to fallback on, in case both XWiki.XWikiPreferences and the fallback
xwiki.cfg parameter gave no resultpublic String getXWikiPreference(String prefname, String wiki, String fallbackParam, String defaultValue, XWikiContext xcontext)
prefname - the parameter to look for in the XWiki.XWikiPreferences object in the XWiki.XWikiPreferences
document of the wiki.wiki - the wiki to get preference fromfallbackParam - the parameter in xwiki.cfg to fallback on, in case the XWiki.XWikiPreferences object gave no
resultdefaultValue - the default value to fallback on, in case both XWiki.XWikiPreferences and the fallback
xwiki.cfg parameter gave no resultpublic String getXWikiPreference(String prefname, String defaultValue, XWikiContext context)
public String getSpacePreference(String preference, XWikiContext context)
public String getSpacePreference(String preference, String defaultValue, XWikiContext context)
@Deprecated public String getSpacePreference(String preference, String space, String defaultValue, XWikiContext context)
getSpacePreference(String, SpaceReference, String, XWikiContext) insteadpublic String getSpacePreference(String preferenceKey, SpaceReference spaceReference, XWikiContext context)
If the property is not set on any level then empty String is returned.
preferenceKey - the name of the preference keyspaceReference - the reference of the spacecontext - see XWikiContextpublic String getSpacePreference(String preferenceKey, SpaceReference spaceReference, String defaultValue, XWikiContext context)
If the property is not set on any level then defaultValue is returned.
preferenceKey - the name of the preference keyspaceReference - the reference of the space. If null and there's a current document then the current space
is used. If null and there's no current document then fall back to the wiki preferences.defaultValue - the value to return if the preference can't be foundcontext - see XWikiContextdefaultValue if it could not be foundpublic String getUserPreference(String prefname, XWikiContext context)
public String getUserPreferenceFromCookie(String prefname, XWikiContext context)
public String getUserPreference(String prefname, boolean useCookie, XWikiContext context)
public Locale getLocalePreference(XWikiContext context)
default_language xproperty in
XWikiPreferences xobject or English if not found)language query string parameter).
If the language value is default use the wiki default locale. If a parameter is found sets a
language cookie to remember the language in use.language cookiexwiki.language.preferDefault from xwiki.cfg
or preferDefaultLanguage property from the space preferences (WebPreferences xobject) or
wiki preferences (XWikiPreferences xobject})), and since the user didn't explicitly ask for a
language already, then use the wiki default locale.Accept-Language header sent in HTTP request.@Deprecated public String getLanguagePreference(XWikiContext context)
getLocalePreference(XWikiContext) instead@Deprecated public String getDefaultLanguage(XWikiContext xcontext)
getDefaultLocale(XWikiContext) insteadpublic Locale getDefaultLocale(XWikiContext xcontext)
xcontext - the XWiki context.public List<Locale> getAvailableLocales(XWikiContext xcontext)
xcontext - the XWiki contextpublic Locale getDocLocalePreferenceNew(XWikiContext context)
@Deprecated public String getDocLanguagePreferenceNew(XWikiContext context)
getDocLocalePreferenceNew(XWikiContext) insteadpublic Locale getInterfaceLocalePreference(XWikiContext context)
@Deprecated public String getInterfaceLanguagePreference(XWikiContext context)
getInterfaceLocalePreference(XWikiContext) insteadpublic long getXWikiPreferenceAsLong(String preference, XWikiContext context)
public long getSpacePreferenceAsLong(String preference, XWikiContext context)
public long getXWikiPreferenceAsLong(String preference, long defaultValue, XWikiContext context)
public long getXWikiPreferenceAsLong(String preference, String fallbackParameter, long defaultValue, XWikiContext context)
public long getSpacePreferenceAsLong(String preference, long defaultValue, XWikiContext context)
public long getUserPreferenceAsLong(String preference, XWikiContext context)
public int getXWikiPreferenceAsInt(String preference, XWikiContext context)
public int getSpacePreferenceAsInt(String preference, XWikiContext context)
public int getXWikiPreferenceAsInt(String preference, int defaultValue, XWikiContext context)
public int getXWikiPreferenceAsInt(String preference, String fallbackParameter, int defaultValue, XWikiContext context)
public int getSpacePreferenceAsInt(String preference, int defaultValue, XWikiContext context)
public int getUserPreferenceAsInt(String prefname, XWikiContext context)
public void flushCache(XWikiContext context)
public XWikiPluginManager getPluginManager()
public void setPluginManager(XWikiPluginManager pluginManager)
public void setStore(XWikiStoreInterface store)
public void setDefaultAttachmentContentStore(XWikiAttachmentStoreInterface attachmentContentStore)
attachmentContentStore - the store to use by default when saving a new attachment content@Deprecated public void setAttachmentStore(XWikiAttachmentStoreInterface attachmentStore)
setDefaultAttachmentContentStore(XWikiAttachmentStoreInterface) insteadpublic void setDefaultAttachmentArchiveStore(AttachmentVersioningStore attachmentArchiveStore)
attachmentArchiveStore - the store to use by default when saving a new attachment archive@Deprecated public void setAttachmentVersioningStore(AttachmentVersioningStore attachmentArchiveStore)
setDefaultAttachmentArchiveStore(AttachmentVersioningStore) insteadpublic void setVersioningStore(XWikiVersioningStoreInterface versioningStore)
public void setRecycleBinStore(XWikiRecycleBinStoreInterface recycleBinStore)
public void setAttachmentRecycleBinStore(AttachmentRecycleBinStore attachmentRecycleBinStore)
public void setCriteriaService(XWikiCriteriaService criteriaService)
public void setVersion(String version)
public BaseClass getTagClass(XWikiContext context) throws XWikiException
XWiki.TagClass page exists and that it contains all the required configuration
properties to make the tag feature work properly. If some properties are missing they are created and saved in
the database.context - see XWikiContextXWikiException - if an error happens during the save to the datavase@Deprecated public BaseClass getSheetClass(XWikiContext context) throws XWikiException
XWiki.SheetClass page exists and that it contains all the required configuration
properties to make the sheet feature work properly. If some properties are missing they are created and saved in
the database. SheetClass is used to a page as a sheet. When a page is tagged as a sheet and that page is included
in another page using the include macro then editing it triggers automatic inline edition (for XWiki Syntax 2.0
only - for XWiki Syntax 1.0 automatic inline edition is triggered using #includeForm).context - see XWikiContextXWikiException - if an error happens during the save to the databasegetEditModeClass(XWikiContext)public BaseClass getEditModeClass(XWikiContext context) throws XWikiException
XWiki.EditModeClass page exists and that it contains all the required configuration
properties to make the edit mode feature work properly. If some properties are missing they are created and saved
in the database. EditModeClass is used to specify the default edit mode of a page. It can also be used to mark a
page as a sheet. When a page is marked as a sheet and that page is included in another page using the include
macro then editing it triggers automatic inline edition (for XWiki Syntax 2.0 only - for XWiki Syntax 1.0
automatic inline edition is triggered using #includeForm). It replaces and enhances the SheetClass mechanism (see
getSheetClass(XWikiContext)).context - see XWikiContextXWikiException - if an error happens during the save to the databasepublic BaseClass getUserClass(XWikiContext context) throws XWikiException
XWiki.XWikiUsers page exists and that it contains all the required configuration
properties to make the user feature work properly. If some properties are missing they are created and saved in
the database.context - see XWikiContextXWikiException - if an error happens during the save to the datavasepublic BaseClass getRedirectClass(XWikiContext context) throws XWikiException
XWiki.GlobalRedirect page exists and that it contains all the required configuration
properties to make the redirection feature work properly. If some properties are missing they are created and
saved in the database.context - see XWikiContextXWikiException - if an error happens during the save to the datavasepublic BaseClass getPrefsClass(XWikiContext context) throws XWikiException
XWiki.XWikiPreferences page exists and that it contains all the required configuration
properties to make XWiki work properly. If some properties are missing they are created and saved in the
database.context - see XWikiContextXWikiException - if an error happens during the save to the datavasepublic BaseClass getGroupClass(XWikiContext context) throws XWikiException
XWikiExceptionpublic BaseClass getRightsClass(String pagename, XWikiContext context) throws XWikiException
XWikiExceptionpublic BaseClass getRightsClass(XWikiContext context) throws XWikiException
XWikiExceptionpublic BaseClass getGlobalRightsClass(XWikiContext context) throws XWikiException
XWikiExceptionpublic BaseClass getCommentsClass(XWikiContext context) throws XWikiException
XWikiExceptionpublic BaseClass getSkinClass(XWikiContext context) throws XWikiException
XWikiExceptionpublic int createUser(XWikiContext context) throws XWikiException
XWikiExceptionpublic int validateUser(boolean withConfirmEmail,
XWikiContext context)
throws XWikiException
XWikiExceptionpublic int createUser(boolean withValidation,
String userRights,
XWikiContext context)
throws XWikiException
XWikiExceptionpublic boolean createEmptyUser(String xwikiname, String userRights, XWikiContext context) throws XWikiException
xwikiname - userRights - context - see XWikiContextXWikiExceptionpublic void sendConfirmationEmail(String xwikiname, String password, String email, String message, String contentfield, XWikiContext context) throws XWikiException
XWikiExceptionpublic void sendValidationEmail(String xwikiname, String password, String email, String validkey, String contentfield, XWikiContext context) throws XWikiException
XWikiExceptionpublic void sendValidationEmail(String xwikiname, String password, String email, String addfieldname, String addfieldvalue, String contentfield, XWikiContext context) throws XWikiException
XWikiExceptionpublic String generateRandomString(int size)
public String generateValidationKey(int size)
public int createUser(String userName, Map<String,?> map, XWikiContext context) throws XWikiException
userName - the name of the user (without the space)map - extra datas to add to user profile objectcontext - see XWikiContextXWikiException - failed to create the new userpublic int createUser(String userName, Map<String,?> map, String userRights, XWikiContext context) throws XWikiException
userName - the name of the user (without the space)map - extra datas to add to user profile objectuserRights - the right of the user on his own profile pagecontext - see XWikiContextXWikiException - failed to create the new user@Deprecated public int createUser(String userName, Map<String,?> map, String parent, String content, String syntaxId, String userRights, XWikiContext context) throws XWikiException
createUser(String, Map, EntityReference, String, Syntax, String, XWikiContext) insteadXWikiExceptionpublic int createUser(String userName, Map<String,?> map, EntityReference parentReference, String content, org.xwiki.rendering.syntax.Syntax syntax, String userRights, XWikiContext context) throws XWikiException
userName - the name of the user (without the space)map - extra datas to add to user profile objectparentReference - the parent of the user profilecontent - the content of the user profilesyntax - the syntax of the provided contentuserRights - the right of the user on his own profile pagecontext - see XWikiContextXWikiException - failed to create the new user@Deprecated public int createUser(String xwikiname, Map<String,?> map, String parent, String content, String userRights, XWikiContext context) throws XWikiException
createUser(String, Map, String, String, String, String, XWikiContext) insteadXWikiExceptionpublic void setUserDefaultGroup(String fullwikiname, XWikiContext context) throws XWikiException
XWikiExceptionprotected void addUserToGroup(String userName, String groupName, XWikiContext context) throws XWikiException
XWikiExceptionpublic void protectUserPage(String userName, String userRights, XWikiDocument doc, XWikiContext context) throws XWikiException
XWikiExceptionpublic User getUser(XWikiContext context)
@Deprecated public User getUser(String username, XWikiContext context)
getUser(DocumentReference, XWikiContext).@Unstable public User getUser(DocumentReference userReference, XWikiContext context)
userReference - the reference of the user.context - the current context.public void prepareResources(XWikiContext context)
context - see XWikiContextpublic XWikiUser checkAuth(XWikiContext context) throws XWikiException
XWikiExceptionpublic boolean checkAccess(String action, XWikiDocument doc, XWikiContext context) throws XWikiException
XWikiExceptionpublic String include(String topic, boolean isForm, XWikiContext context) throws XWikiException
XWikiExceptionpublic void deleteDocument(XWikiDocument doc, XWikiContext context) throws XWikiException
XWikiExceptionpublic void deleteDocument(XWikiDocument doc, boolean totrash, XWikiContext context) throws XWikiException
XWikiExceptionpublic void checkDeletingDocument(DocumentReference userReference, XWikiDocument document, XWikiContext context) throws XWikiException
userReference - the user responsible for the deletedocument - the document to deletecontext - the XWiki contextXWikiException - when failing to deletepublic String getDatabase()
public void setDatabase(String database)
public void gc()
public long freeMemory()
public long totalMemory()
public long maxMemory()
@Deprecated public String printStrackTrace(Throwable e)
ExceptionUtils.getStackTrace(Throwable) instead@Unstable public boolean renameDocument(DocumentReference sourceDocumentReference, DocumentReference targetDocumentReference, boolean overwrite, List<DocumentReference> backlinkDocumentReferences, List<DocumentReference> childDocumentReferences, XWikiContext context) throws XWikiException
sourceDocumentReference - the source document to rename.targetDocumentReference - the target reference to rename the document to.overwrite - if true the target document reference will be overwritten if it exists
(deleted to the recycle bin before the rename). If false and the target document exist
the rename won't be performed.backlinkDocumentReferences - the list of references of documents to parse and for which links will be
modified to point to the new document referencechildDocumentReferences - the list of references of document whose parent field will be set to the new
document referencetrue if the rename succeeded. false if there was any issue.XWikiException - if the document cannot be renamed properly.@Deprecated @Unstable public void renameByCopyAndDelete(XWikiDocument sourceDoc, DocumentReference newDocumentReference, List<DocumentReference> backlinkDocumentReferences, List<DocumentReference> childDocumentReferences, XWikiContext context) throws XWikiException
XWikiStoreInterface.renameXWikiDoc(XWikiDocument, DocumentReference, XWikiContext) should be preferred.newDocumentReference - the new document referencebacklinkDocumentReferences - the list of references of documents to parse and for which links will be
modified to point to the new document referencechildDocumentReferences - the list of references of document whose parent field will be set to the new
document referencecontext - the ubiquitous XWiki ContextXWikiException - in case of an errorpublic boolean copyDocument(DocumentReference sourceDocumentReference, DocumentReference targetDocumentReference, XWikiContext context) throws XWikiException
XWikiExceptionpublic boolean copyDocument(DocumentReference sourceDocumentReference, DocumentReference targetDocumentReference, boolean reset, XWikiContext context) throws XWikiException
XWikiExceptionpublic boolean copyDocument(DocumentReference sourceDocumentReference, DocumentReference targetDocumentReference, boolean reset, boolean force, boolean resetCreationData, XWikiContext context) throws XWikiException
XWikiExceptionpublic boolean copyDocument(DocumentReference sourceDocumentReference, DocumentReference targetDocumentReference, String wikilocale, XWikiContext context) throws XWikiException
XWikiExceptionpublic boolean copyDocument(DocumentReference sourceDocumentReference, DocumentReference targetDocumentReference, String wikilocale, boolean reset, XWikiContext context) throws XWikiException
XWikiExceptionpublic boolean copyDocument(DocumentReference sourceDocumentReference, DocumentReference targetDocumentReference, String wikilocale, boolean reset, boolean force, XWikiContext context) throws XWikiException
XWikiExceptionpublic boolean copyDocument(DocumentReference sourceDocumentReference, DocumentReference targetDocumentReference, String wikilocale, boolean reset, boolean force, boolean resetCreationData, XWikiContext context) throws XWikiException
XWikiExceptionpublic int copySpaceBetweenWikis(String space, String sourceWiki, String targetWiki, String locale, XWikiContext context) throws XWikiException
XWikiExceptionpublic int copySpaceBetweenWikis(String space, String sourceWiki, String targetWiki, String locale, boolean clean, XWikiContext context) throws XWikiException
XWikiException@Deprecated public int copyWiki(String sourceWiki, String targetWiki, String locale, XWikiContext context) throws XWikiException
WikiManager.copy(String, String, String, boolean, boolean, boolean) insteadIt does not override document already existing in target wiki.
sourceWiki - the source wiki identifiertargetWiki - the target wiki identifierlocale - the locale to copycontext - see XWikiContextXWikiException - failed to copy wiki@Deprecated public int copyWiki(String sourceWiki, String targetWiki, String locale, boolean clean, XWikiContext context) throws XWikiException
WikiManager.copy(String, String, String, boolean, boolean, boolean) insteadsourceWiki - the source wiki identifiertargetWiki - the target wiki identifierlocale - the locale to copyclean - clean the target wiki before copyingcontext - see XWikiContextXWikiException - failed to copy wikipublic String getEncoding()
public URL getServerURL(String wikiId, XWikiContext xcontext) throws MalformedURLException
MalformedURLExceptionpublic String getServletPath(String wikiName, XWikiContext context)
public String getWebAppPath(XWikiContext context)
public String getURL(EntityReference entityReference, String action, String queryString, String anchor, XWikiContext context)
public String getURL(EntityReference reference, String action, XWikiContext context)
public String getURL(EntityReference reference, XWikiContext context)
public String getURL(DocumentReference documentReference, String action, String queryString, String anchor, XWikiContext context)
@Deprecated public String getURL(String fullname, String action, String queryString, String anchor, XWikiContext context)
getURL(DocumentReference, String, String, String, XWikiContext)public String getURL(String fullname, String action, String querystring, XWikiContext context)
public String getURL(DocumentReference reference, String action, XWikiContext context)
@Deprecated public String getURL(String fullname, String action, XWikiContext context)
getURL(DocumentReference, String, XWikiContext)public String getExternalURL(String fullname, String action, XWikiContext context) throws XWikiException
XWikiExceptionpublic String getExternalURL(String fullname, String action, String querystring, XWikiContext context) throws XWikiException
XWikiExceptionpublic String getExternalURL(DocumentReference documentReference, String action, String querystring, String anchor, XWikiContext context)
DocumentReference. This also includes the server name of the wiki.documentReference - the document that should be resolvedaction - the action of the URLquerystring - the URL parametersanchor - the anchor of the documentcontext - the current XWikiContextpublic String getAttachmentURL(AttachmentReference attachmentReference, String action, String queryString, XWikiContext context)
public String getAttachmentURL(AttachmentReference attachmentReference, String queryString, XWikiContext context)
public String getAttachmentRevisionURL(AttachmentReference attachmentReference, String revision, String queryString, XWikiContext context)
public String getAttachmentURL(String fullname, String filename, XWikiContext context) throws XWikiException
XWikiExceptionpublic String getAttachmentURL(String fullname, String filename, String queryString, XWikiContext context) throws XWikiException
XWikiExceptionpublic int getTimeDelta(long time)
public boolean isMultiLingual(XWikiContext context)
public boolean isLDAP()
public boolean isAllGroupImplicit()
@Deprecated public int checkActive(XWikiContext context) throws XWikiException
XWikiUser.isDisabled(XWikiContext).XWikiException@Deprecated public int checkActive(String user, XWikiContext context) throws XWikiException
XWikiUser.isDisabled(XWikiContext).XWikiExceptionpublic DocumentReference getDocumentReference(XWikiRequest request, XWikiContext context)
public static String stripSegmentFromPath(String path, String segment)
path - the path, as taken from the requested URIsegment - the segment to remove, as reported by the containerpublic boolean prepareDocuments(XWikiRequest request, XWikiContext context, org.apache.velocity.VelocityContext vcontext) throws XWikiException
XWikiExceptionpublic void setPhonyDocument(DocumentReference reference, XWikiContext context)
@Deprecated public void setPhonyDocument(DocumentReference reference, XWikiContext context, org.apache.velocity.VelocityContext vcontext)
setPhonyDocument(DocumentReference, XWikiContext) instead@Deprecated public void setPhonyDocument(String docName, XWikiContext context, org.apache.velocity.VelocityContext vcontext)
setPhonyDocument(DocumentReference, XWikiContext, VelocityContext)public XWikiEngineContext getEngineContext()
public void setEngineContext(XWikiEngineContext engine_context)
public void setAuthService(XWikiAuthService authService)
public void setRightService(XWikiRightService rightService)
public XWikiGroupService getGroupService(XWikiContext context) throws XWikiException
XWikiExceptionpublic void setGroupService(XWikiGroupService groupService)
public XWikiAuthService getAuthService()
public XWikiRightService getRightService()
public XWikiStatsService getStatsService(XWikiContext context)
public XWikiURLFactoryService getURLFactoryService()
public XWikiCriteriaService getCriteriaService(XWikiContext context)
public ZipOutputStream getZipOutputStream(XWikiContext context) throws IOException
IOExceptionpublic String getRefererText(String referer, XWikiContext context)
public boolean isMySQL()
public String getFullNameSQL()
public String getFullNameSQL(boolean newFullName)
public String getUserName(String user, XWikiContext context)
public String getUserName(String user, String format, XWikiContext context)
public String getUserName(String user, String format, boolean link, XWikiContext context)
public String getUserName(DocumentReference userReference, String format, boolean link, boolean escapeXML, XWikiContext context)
userReference - format - a Velocity scnippet used to format the user namelink - true if a full html link snippet should be returnedescapeXML - true if the returned name should be escaped (forced true if link is true)context - see XWikiContextpublic String evaluateVelocity(String content, String namespace, org.apache.velocity.VelocityContext vcontext)
content - the Velocity content to evaluatenamespace - the namespace under which to evaluate it (used for isolation)vcontext - the Velocity context to use when evaluating. If null, then a new context will be created,
initialized and used.public String evaluateVelocity(String content, String name)
content - the Velocity content to evaluatename - the namespace under which to evaluate it (used for isolation)public String getPlainUserName(DocumentReference userReference, XWikiContext context)
userReference - the user referencecontext - see XWikiContextpublic boolean hasCentralizedAuthentication(XWikiContext context)
public String getLocalUserName(String user, XWikiContext context)
public String getLocalUserName(String user, String format, XWikiContext context)
public String getLocalUserName(String user, String format, boolean link, XWikiContext context)
public String formatDate(Date date, String format, XWikiContext context)
public String getUserTimeZone(XWikiContext context)
@Deprecated public boolean exists(String fullname, XWikiContext context)
exists(DocumentReference, XWikiContext)public boolean exists(DocumentReference documentReference, XWikiContext context)
public String getAdType(XWikiContext context)
public String getAdClientId(XWikiContext context)
@Deprecated public XWikiPluginInterface getPlugin(String name, XWikiContext context)
@Deprecated public Api getPluginApi(String name, XWikiContext context)
public int getHttpTimeout(XWikiContext context)
public String getHttpUserAgent(XWikiContext context)
public String getURLContent(String surl, XWikiContext context) throws IOException
IOExceptionpublic String getURLContent(String surl, int timeout, String userAgent) throws IOException
IOExceptionpublic String getURLContent(String surl, String username, String password, XWikiContext context) throws IOException
IOExceptionpublic String getURLContent(String surl, String username, String password, int timeout, String userAgent) throws IOException
IOExceptionpublic byte[] getURLContentAsBytes(String surl, XWikiContext context) throws IOException
IOExceptionpublic byte[] getURLContentAsBytes(String surl, int timeout, String userAgent) throws IOException
IOExceptionpublic byte[] getURLContentAsBytes(String surl, String username, String password, XWikiContext context) throws IOException
IOExceptionpublic byte[] getURLContentAsBytes(String surl, String username, String password, int timeout, String userAgent) throws IOException
IOException@Deprecated public List<String> getSpaces(XWikiContext context) throws XWikiException
Hidden spaces are filtered unless current user enabled them.
XWikiException - if something went wrong@Deprecated public List<String> getSpaceDocsName(String spaceReference, XWikiContext context) throws XWikiException
spaceReference - the local reference of the space for which to return all non-hidden documentsSpace.Page) for non-hidden documents in the specified
spaceXWikiException - if the loading went wrongpublic List<String> getIncludedMacros(String defaultSpace, String content, XWikiContext context)
public boolean isReadOnly()
isReadOnlypublic void setReadOnly(boolean readOnly)
public void deleteAllDocuments(XWikiDocument doc, XWikiContext context) throws XWikiException
XWikiExceptionpublic void deleteAllDocuments(XWikiDocument doc, boolean toTrash, XWikiContext context) throws XWikiException
XWikiExceptionpublic void refreshLinks(XWikiContext context) throws XWikiException
XWikiExceptionpublic boolean hasBacklinks(XWikiContext context)
public boolean hasTags(XWikiContext context)
public boolean hasCustomMappings()
public boolean hasDynamicCustomMappings()
public String getDefaultSpace(XWikiContext context)
public boolean showViewAction(XWikiContext context)
public boolean useDefaultAction(XWikiContext context)
public String getDefaultPage(XWikiContext context)
public boolean hasEditComment(XWikiContext context)
public boolean isEditCommentFieldHidden(XWikiContext context)
public boolean isEditCommentSuggested(XWikiContext context)
public boolean isEditCommentMandatory(XWikiContext context)
public boolean hasMinorEdit(XWikiContext context)
XWiki.hasMinorEdit()public boolean hasRecycleBin(XWikiContext context)
context - see XWikiContextXWiki.hasRecycleBin()public boolean hasAttachmentRecycleBin(XWikiContext context)
context - see XWikiContextpublic BaseClass getXClass(DocumentReference documentReference, XWikiContext context) throws XWikiException
XWikiException@Deprecated public BaseClass getClass(String fullName, XWikiContext context) throws XWikiException
getXClass(DocumentReference, XWikiContext)XWikiExceptionpublic String getEditorPreference(XWikiContext context)
public Object parseGroovyFromString(String script, XWikiContext xcontext) throws XWikiException
script - the Groovy class definition string (public class MyClass { ... })XWikiExceptionpublic Object parseGroovyFromString(String script, String jarWikiPage, XWikiContext xcontext) throws XWikiException
script - the Groovy class definition string (public class MyClass { ... })XWikiExceptionpublic Object parseGroovyFromPage(String fullName, XWikiContext context) throws XWikiException
XWikiExceptionpublic Object parseGroovyFromPage(String fullName, String jarWikiPage, XWikiContext context) throws XWikiException
XWikiExceptionpublic String getMacroList(XWikiContext context)
public BaseObject getObjectFromRequest(String className, XWikiContext context) throws XWikiException
XWikiExceptionpublic String getConvertingUserNameType(XWikiContext context)
public String convertUsername(String username, XWikiContext context)
public boolean hasSectionEdit(XWikiContext context)
public long getSectionEditingDepth()
xwiki.section.depth configuration property. Defaults to 2 when not defined.public String getWysiwygToolbars(XWikiContext context)
public String clearName(String name, XWikiContext context)
public String clearName(String name, boolean stripDots, boolean ascii, XWikiContext context)
public String getUniquePageName(String space, XWikiContext context)
public String getUniquePageName(String space, String name, XWikiContext context)
public PropertyClass getPropertyClassFromName(String propPath, XWikiContext context)
public boolean validateDocument(XWikiDocument doc, XWikiContext context) throws XWikiException
XWikiExceptionpublic String addTooltip(String html, String message, String params, XWikiContext context)
public String addTooltipJS(XWikiContext context)
public String addTooltip(String html, String message, XWikiContext context)
public String addMandatory(XWikiContext context)
public boolean hasVersioning(XWikiContext context)
public boolean hasAttachmentVersioning(XWikiContext context)
public String getExternalAttachmentURL(String fullName, String filename, XWikiContext context)
public int getMaxRecursiveSpaceChecks(XWikiContext context)
public void restoreFromRecycleBin(XWikiDocument doc, String comment, XWikiContext context) throws XWikiException
doc - the document to restorecomment - the comment to use when saving the documentcontext - see XWikiContextXWikiException - when failing to restore document@Deprecated public void restoreFromRecycleBin(XWikiDocument doc, long index, String comment, XWikiContext context) throws XWikiException
restoreFromRecycleBin(long, String, XWikiContext) instead.doc - the document to restoreindex - the index of the document in the recycle bincomment - the comment to use when saving the documentcontext - see XWikiContextXWikiException - when failing to restore documentpublic void restoreFromRecycleBin(long index,
String comment,
XWikiContext context)
throws XWikiException
index - the index of the document in the recycle bincomment - the comment to use when saving the documentcontext - see XWikiContextXWikiException - when failing to restore documentpublic XWikiDocument rollback(XWikiDocument tdoc, String rev, XWikiContext context) throws XWikiException
XWikiExceptionpublic XWikiDocument rollback(XWikiDocument tdoc, String rev, boolean addRevision, XWikiContext xcontext) throws XWikiException
tdoc - the document to rollbackrev - the revision to rollback toaddRevision - true if a new revision should be createdxcontext - the XWiki contextXWikiException - when failing to rollback the document@Deprecated public List<String> getConfiguredSyntaxes()
xwiki/2.0, xwiki/2.1,
mediawiki/1.0, etc)public String getDefaultDocumentSyntax()
public String getCurrentContentSyntaxId(String defaultSyntaxId, XWikiContext context)
The document currently being executed is not the same than the actual content syntax since the executed code
might come from an included page or some macro that change the context syntax. The same logic used inside
rendering macros is used (see MacroContentParser).
If the current document can't be found, the method assume that the executed document is the context document
(it's generally the case when a document is directly rendered with
XWikiDocument.getRenderedContent(XWikiContext) for example).
defaultSyntaxId - the default value to return if no document can be foundpublic String getCurrentContentSyntaxId(XWikiContext context)
The document currently being executed is not the same than the actual content syntax since the executed code
might come from an included page or some macro that change the context syntax. The same logic used inside
rendering macros is used (see MacroContentParser).
If the current document can't be found, the method assume that the executed document is the context document
(it's generally the case when a document is directly rendered with
XWikiDocument.getRenderedContent(XWikiContext) for example).
public boolean isTitleInCompatibilityMode()
public void onEvent(org.xwiki.observation.event.Event event,
Object source,
Object data)
onEvent in interface org.xwiki.observation.EventListenerpublic List<org.xwiki.observation.event.Event> getEvents()
getEvents in interface org.xwiki.observation.EventListenerpublic String getName()
getName in interface org.xwiki.observation.EventListener@Deprecated public List<XWikiAttachment> searchAttachments(String parametrizedSqlClause, boolean checkRight, int nb, int start, List<?> parameterValues, XWikiContext context) throws XWikiException
parametrizedSqlClause - The HQL where clause. For example where doc.fullName
<> ?1 and (attach.author = ?2 or (attach.filename = ?3 and doc.space = ?4))checkRight - if true, only return attachments in documents which the "current user" has permission to view.nb - The number of rows to return. If 0 then all rows are returnedstart - The number of rows to skip at the beginning.parameterValues - A List of the where clause values that replace the question marks (?)context - see XWikiContextXWikiAttachment objects.XWikiException - in case of error while performing the queryXWikiStoreInterface.searchDocuments(String, int, int, java.util.List, XWikiContext)public int countAttachments(String parametrizedSqlClause, List<?> parameterValues, XWikiContext context) throws XWikiException
parametrizedSqlClause - Everything which would follow the "WHERE" in HQLparameterValues - A List of the where clause values that replace the question marks (?)context - see XWikiContextXWikiException - in event of an exception querying the databasesearchAttachments(String, boolean, int, int, java.util.List, XWikiContext)@Deprecated public static String getConfigPath() throws NamingException
XWikiCfgConfigurationSource.getConfigPath() insteadNamingException@Deprecated public XWikiConfig getConfig()
ConfigurationSource component with hint xwikicfg instead@Deprecated public void setConfig(XWikiConfig config)
@Deprecated public String Param(String key)
ConfigurationSource component with hint xwikicfg instead@Deprecated public String Param(String key, String default_value)
ConfigurationSource component with hint xwikicfg instead@Deprecated public long ParamAsLong(String key)
ConfigurationSource component with hint xwikicfg instead@Deprecated public long ParamAsLong(String key, long default_value)
ConfigurationSource component with hint xwikicfg insteadpublic boolean isPathBased()
Copyright © 2004–2021 XWiki. All rights reserved.