com.xpn.xwiki
Class XWiki

java.lang.Object
  extended by com.xpn.xwiki.XWiki
All Implemented Interfaces:
org.xwiki.observation.EventListener

public class XWiki
extends Object
implements org.xwiki.observation.EventListener


Field Summary
static String CFG_ENV_NAME
           
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_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 Summary
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(XWikiConfig, XWikiContext, XWikiEngineContext, boolean) instead
XWiki(String xwikicfgpath, XWikiContext context)
          Deprecated. use XWiki(XWikiConfig, XWikiContext) instead
XWiki(String xwikicfgpath, XWikiContext context, XWikiEngineContext engine_context, boolean noupdate)
          Deprecated. use XWiki(XWikiConfig, XWikiContext, XWikiEngineContext, boolean) instead
XWiki(XWikiConfig config, XWikiContext context)
           
XWiki(XWikiConfig config, XWikiContext context, XWikiEngineContext engine_context, boolean noupdate)
           
 
Method Summary
 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)
           
 int checkActive(XWikiContext context)
           
 XWikiUser checkAuth(XWikiContext context)
           
 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 wikilanguage, boolean reset, boolean force, boolean resetCreationData, XWikiContext context)
           
 boolean copyDocument(DocumentReference sourceDocumentReference, DocumentReference targetDocumentReference, String wikilanguage, boolean reset, boolean force, XWikiContext context)
           
 boolean copyDocument(DocumentReference sourceDocumentReference, DocumentReference targetDocumentReference, String wikilanguage, boolean reset, XWikiContext context)
           
 boolean copyDocument(DocumentReference sourceDocumentReference, DocumentReference targetDocumentReference, String wikilanguage, XWikiContext context)
           
 boolean copyDocument(DocumentReference sourceDocumentReference, DocumentReference targetDocumentReference, XWikiContext context)
           
 int copySpaceBetweenWikis(String space, String sourceWiki, String targetWiki, String language, boolean clean, XWikiContext context)
           
 int copySpaceBetweenWikis(String space, String sourceWiki, String targetWiki, String language, XWikiContext context)
           
 int copyWiki(String sourceWiki, String targetWiki, String language, boolean clean, XWikiContext context)
          Copy an entire wiki to a target wiki.
 int copyWiki(String sourceWiki, String targetWiki, String language, XWikiContext context)
          Copy an entire wiki to a target wiki.
 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 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(String xwikiname, Map 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(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)
          Evaluate provided template content using velocity engine.
 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()
           
 XWikiAttachmentStoreInterface getAttachmentStore()
           
 String getAttachmentURL(String fullname, String filename, String queryString, XWikiContext context)
           
 String getAttachmentURL(String fullname, String filename, XWikiContext context)
           
 AttachmentVersioningStore getAttachmentVersioningStore()
           
 XWikiAuthService getAuthService()
           
 String getBaseSkin(String skin, XWikiContext context)
           
 String getBaseSkin(XWikiContext context)
           
 String getBaseSkin(XWikiContext context, boolean fromRenderSkin)
           
 CacheFactory getCacheFactory()
          Deprecated. Since 1.7M1, use CacheManager component instead using Utils.getComponent(Class)
 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()
           
static String getConfigPath()
           
 List<String> getConfiguredSyntaxes()
           
 String getConvertingUserNameType(XWikiContext context)
           
 XWikiCriteriaService getCriteriaService(XWikiContext context)
           
 String getCurrentContentSyntaxId(String defaultSyntaxId, XWikiContext context)
          Get the syntax of the document currently being executed.
 String getCurrentContentSyntaxId(XWikiContext context)
          Get the syntax of the document currently being executed.
 Date getCurrentDate()
           
 String getDatabase()
           
 Date getDate(long time)
           
 String getDefaultBaseSkin(XWikiContext context)
           
 String getDefaultDocumentSyntax()
           
 String getDefaultLanguage(XWikiContext context)
           
 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(String fullname, String lang, int index, XWikiContext context)
           
 XWikiDeletedDocument[] getDeletedDocuments(String fullname, String lang, XWikiContext context)
           
 String getDocLanguagePreferenceNew(XWikiContext context)
           
 String getDocName(String docname)
           
 XWikiDocument getDocument(DocumentReference reference, XWikiContext context)
           
 XWikiDocument getDocument(EntityReference reference, XWikiContext context)
           
 XWikiDocument getDocument(String space, 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 doc, String revision, XWikiContext context)
           
 XWikiDocument getDocument(XWikiDocument doc, XWikiContext context)
           
 XWikiDocument getDocumentFromPath(String path, XWikiContext context)
           
 String getDocumentName(XWikiRequest request, XWikiContext context)
          Deprecated. since 2.3M1 use getDocumentReferenceFromPath(String, XWikiContext) instead
 String getDocumentNameFromPath(String path, XWikiContext context)
          Deprecated. since 2.3M1 use getDocumentReferenceFromPath(String, XWikiContext) instead
 DocumentReference getDocumentReference(XWikiRequest request, XWikiContext context)
           
 DocumentReference getDocumentReferenceFromPath(String path, 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(String fullname, String action, String querystring, XWikiContext context)
           
 String getExternalURL(String fullname, String action, XWikiContext context)
           
 String getFlash(String url, String width, String height, 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)
           
 String getLanguagePreference(XWikiContext context)
          First try to find the current language in use from the XWiki context.
 CacheFactory getLocalCacheFactory()
          Deprecated. Since 1.7M1, use CacheManager component instead using Utils.getComponent(Class)
 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(XWikiContext context)
           
 int getMaxRecursiveSpaceChecks(XWikiContext context)
           
 MetaClass getMetaclass()
           
 String getName()
           
 XWikiStoreInterface getNotCacheStore()
           
 BaseObject getObjectFromRequest(String className, XWikiContext context)
           
 XWikiPluginInterface getPlugin(String name, XWikiContext context)
           
 Api getPluginApi(String name, XWikiContext context)
           
 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)
           
 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)
           
 XWikiRenderingEngine getRenderingEngine()
           
static URL getRequestURL(XWikiRequest request)
           
 String getRequestWikiName(XWikiContext context)
          Extracts the name of the wiki from a context's 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 database, XWikiContext context)
           
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)
           
 BaseClass getSkinClass(XWikiContext context)
           
 String getSkinFile(String filename, boolean forceSkinAction, XWikiContext context)
           
 String getSkinFile(String filename, String skin, boolean forceSkinAction, XWikiContext context)
           
 String getSkinFile(String filename, String skin, XWikiContext context)
           
 String getSkinFile(String filename, XWikiContext context)
           
 String getSkinPreference(String prefname, String default_value, XWikiContext context)
           
 String getSkinPreference(String prefname, XWikiContext context)
           
 String getSpaceCopyright(XWikiContext context)
           
 List<String> getSpaceDocsName(String spaceName, XWikiContext context)
           
 String getSpacePreference(String preference, String space, String defaultValue, XWikiContext context)
           
 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)
           
 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(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(String username, XWikiContext context)
           
 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(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()
           
 Cache<DocumentReference> getVirtualWikiCache()
           
 List<String> getVirtualWikiList()
           
 List<String> getVirtualWikisDatabaseNames(XWikiContext context)
           
 String getWebAppPath(XWikiContext context)
           
 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(XWikiContext context)
          Return the XWiki object (as in "the Wiki API") corresponding to the requested wiki.
 String getXWikiPreference(String prefname, String fallback_param, String default_value, 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 default_value, 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 hasCaptcha(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(String fullName, XWikiContext context)
          Deprecated. since 2.3M1 use hasVersioning(XWikiContext) instead
 boolean hasVersioning(XWikiContext context)
           
 String include(String topic, boolean isForm, XWikiContext context)
           
 String include(String topic, XWikiContext context, boolean isForm)
          Deprecated. replaced by include(String topic, boolean isForm, XWikiContext context)
 void initXWiki(XWikiConfig config, XWikiContext context, XWikiEngineContext engine_context, boolean noupdate)
          Initialize all xwiki subsystems.
 String invokeServletAndReturnAsString(String url, XWikiContext xwikiContext)
          Designed to include dynamic content, such as Servlets or JSPs, inside Velocity templates; works by creating a RequestDispatcher, buffering the output, then returning it as a string.
 boolean isEditCommentFieldHidden(XWikiContext context)
           
 boolean isEditCommentMandatory(XWikiContext context)
           
 boolean isEditCommentSuggested(XWikiContext context)
           
 boolean isLDAP()
           
 boolean isMultiLingual(XWikiContext context)
           
 boolean isMySQL()
           
 boolean isReadOnly()
          accessor for the isReadOnly instance var.
 boolean isTest()
          Deprecated. No longer used.
 boolean isTitleInCompatibilityMode()
           
 boolean isVirtualMode()
          Deprecated. Virtual mode is on by default, starting with XWiki 5.0M2. Use getVirtualWikisDatabaseNames(XWikiContext) to get the list of wikis if needed.
 long maxMemory()
           
 void onEvent(org.xwiki.observation.event.Event event, Object source, Object data)
           
 String Param(String key)
           
 String Param(String key, String default_value)
           
 long ParamAsLong(String key)
           
 long ParamAsLong(String key, long default_value)
           
 String ParamAsRealPath(String key)
           
 String ParamAsRealPath(String key, XWikiContext context)
           
 String ParamAsRealPathVerified(String param)
           
 String parseContent(String content, XWikiContext context)
           
 Object parseGroovyFromPage(String fullName, String jarWikiPage, XWikiContext context)
           
 Object parseGroovyFromPage(String fullname, XWikiContext context)
           
 Object parseGroovyFromString(String script, String jarWikiPage, XWikiContext context)
          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 context)
          Privileged API to retrieve an object instantiated from groovy code in a String.
 String parseMessage(String id, XWikiContext context)
          Deprecated. use LocalizationManager instead. From velocity you can access it using the $services.localization binding, see LocalizationScriptService
 String parseMessage(XWikiContext context)
          Deprecated. use LocalizationManager instead. From velocity you can access it using the $services.localization binding, see LocalizationScriptService
 String parseTemplate(String template, String skin, XWikiContext context)
           
 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 language.
 String printStrackTrace(Throwable e)
           
 void protectUserPage(String userName, String userRights, XWikiDocument doc, XWikiContext context)
           
 void ProtectUserPage(XWikiContext context, String fullwikiname, String userRights, XWikiDocument doc)
          Deprecated. replaced by protectUserPage(String,String,XWikiDocument,XWikiContext)
 void refreshLinks(XWikiContext context)
           
 void renamePage(String fullName, String newFullName, XWikiContext context)
           
 XWikiDocument renamePage(XWikiDocument doc, String newFullName, XWikiContext context)
          Deprecated. use XWikiDocument.rename(String, XWikiContext) instead
 XWikiDocument renamePage(XWikiDocument doc, XWikiContext context, String newFullName)
          Deprecated. use XWikiDocument.rename(String, XWikiContext) instead
 String renderTemplate(String template, String skin, XWikiContext context)
           
 String renderTemplate(String template, XWikiContext context)
           
 void resetRenderingEngine(XWikiContext context)
           
 boolean resourceExists(String name)
           
 XWikiDocument rollback(XWikiDocument tdoc, String rev, XWikiContext context)
           
 void saveDocument(XWikiDocument doc, String comment, boolean isMinorEdit, XWikiContext context)
           
 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)
          Search attachments by passing HQL where clause values as parameters.
 void sendConfirmationEmail(String xwikiname, String password, String email, String message, String contentfield, XWikiContext context)
           
 void sendMessage(String sender, String[] recipients, String rawMessage, XWikiContext context)
          Deprecated. replaced by the Mail Sender Plugin
 void sendMessage(String sender, String recipient, String message, XWikiContext context)
          Deprecated. replaced by the Mail Sender Plugin
 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)
           
 void setAttachmentVersioningStore(AttachmentVersioningStore avStore)
           
 void setAuthService(XWikiAuthService authService)
           
 void setConfig(XWikiConfig config)
           
 void setCriteriaService(XWikiCriteriaService criteriaService)
           
 void setDatabase(String database)
           
 void setEngineContext(XWikiEngineContext engine_context)
           
 void setGroupService(XWikiGroupService groupService)
           
 void setMetaclass(MetaClass metaclass)
           
 void setPhonyDocument(DocumentReference reference, XWikiContext context, org.apache.velocity.VelocityContext vcontext)
           
 void setPhonyDocument(String docName, XWikiContext context, org.apache.velocity.VelocityContext vcontext)
          Deprecated. since 2.3M1 use setPhonyDocument(DocumentReference, XWikiContext, VelocityContext)
 void setPluginManager(XWikiPluginManager pluginManager)
           
 void setReadOnly(boolean readOnly)
           
 void setRecycleBinStore(XWikiRecycleBinStoreInterface recycleBinStore)
           
 void setRenderingEngine(XWikiRenderingEngine renderingEngine)
           
 void setRightService(XWikiRightService rightService)
           
 void setStore(XWikiStoreInterface store)
           
 void setTest(boolean test)
          Deprecated. No longer used.
 void setUserDefaultGroup(String fullwikiname, XWikiContext context)
           
 void SetUserDefaultGroup(XWikiContext context, String fullwikiname)
          Deprecated. replaced by setUserDefaultGroup(String fullwikiname, XWikiContext context)
 void setVersion(String version)
           
 void setVersioningStore(XWikiVersioningStoreInterface versioningStore)
           
 boolean showViewAction(XWikiContext context)
           
 boolean skipDefaultSpaceInURLs(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 wikiName, boolean force, boolean initClasses, XWikiContext context)
           
 void updateDatabase(String wikiName, boolean force, XWikiContext context)
           
 void updateDatabase(String wikiName, XWikiContext context)
           
 boolean useDefaultAction(XWikiContext context)
           
 boolean validateDocument(XWikiDocument doc, XWikiContext context)
           
 int validateUser(boolean withConfirmEmail, XWikiContext context)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MAIN_WIKI

public static final String DEFAULT_MAIN_WIKI
Name of the default wiki.

See Also:
Constant Field Values

DEFAULT_HOME_SPACE

public static final String DEFAULT_HOME_SPACE
Name of the default home space.

See Also:
Constant Field Values

SYSTEM_SPACE

public static final String SYSTEM_SPACE
Name of the default system space.

See Also:
Constant Field Values

DEFAULT_SPACE_HOMEPAGE

public static final String DEFAULT_SPACE_HOMEPAGE
Name of the default space homepage.

See Also:
Constant Field Values

LOGGER

protected static final org.slf4j.Logger LOGGER
Logging helper object.


DEFAULT_ENCODING

public static final String DEFAULT_ENCODING
The default encoding, and the internally used encoding when dealing with byte representation of strings.

See Also:
Constant Field Values

CFG_ENV_NAME

public static final String CFG_ENV_NAME
See Also:
Constant Field Values

MACROS_FILE

public static final String MACROS_FILE
See Also:
Constant Field Values
Constructor Detail

XWiki

public XWiki()
This provide a way to create an XWiki object without initializing the whole XWiki (including plugins, storage, etc.).

Needed for tools or tests which need XWiki because it is used everywhere in the API.


XWiki

public XWiki(XWikiConfig config,
             XWikiContext context)
      throws XWikiException
Throws:
XWikiException

XWiki

public XWiki(XWikiConfig config,
             XWikiContext context,
             XWikiEngineContext engine_context,
             boolean noupdate)
      throws XWikiException
Throws:
XWikiException

XWiki

@Deprecated
public XWiki(String xwikicfgpath,
                        XWikiContext context)
      throws XWikiException
Deprecated. use XWiki(XWikiConfig, XWikiContext) instead

Throws:
XWikiException

XWiki

@Deprecated
public XWiki(String xwikicfgpath,
                        XWikiContext context,
                        XWikiEngineContext engine_context,
                        boolean noupdate)
      throws XWikiException
Deprecated. use XWiki(XWikiConfig, XWikiContext, XWikiEngineContext, boolean) instead

Throws:
XWikiException

XWiki

@Deprecated
public XWiki(InputStream is,
                        XWikiContext context,
                        XWikiEngineContext engine_context)
      throws XWikiException
Deprecated. use XWiki(XWikiConfig, XWikiContext, XWikiEngineContext, boolean) instead

Throws:
XWikiException
Method Detail

getConfigPath

public static String getConfigPath()
                            throws NamingException
Throws:
NamingException

getMainXWiki

public static XWiki getMainXWiki(XWikiContext context)
                          throws XWikiException
Throws:
XWikiException

getXWiki

public static XWiki getXWiki(XWikiContext context)
                      throws XWikiException
Return the XWiki object (as in "the Wiki API") corresponding to the requested wiki.

Parameters:
context - the current context
Returns:
an XWiki object configured for the wiki corresponding to the current request
Throws:
XWikiException - if the requested URL does not correspond to a real wiki, or if there's an error in the storage

getRequestWikiName

public String getRequestWikiName(XWikiContext context)
                          throws XWikiException
Extracts the name of the wiki from a context's request. In some cases, including autowww, the main wiki may be returned instead of what was requested, as a result of some assumptions. Even so, the resulting wiki name is not guaranteed to exist, it is just what XWiki understood from the request.

Parameters:
context - the context which contains the request
Returns:
the name of the wiki that was requested
Throws:
XWikiException - if problems occur

getRequestURL

public static URL getRequestURL(XWikiRequest request)
                         throws XWikiException
Throws:
XWikiException

callPrivateMethod

public static Object callPrivateMethod(Object obj,
                                       String methodName)

callPrivateMethod

public static Object callPrivateMethod(Object obj,
                                       String methodName,
                                       Class<?>[] classes,
                                       Object[] args)

getHttpClient

public static org.apache.commons.httpclient.HttpClient getHttpClient(int timeout,
                                                                     String userAgent)

getPrivateField

public static Object getPrivateField(Object obj,
                                     String fieldName)

getServerWikiPage

public static String getServerWikiPage(String servername)

getTextArea

public static String getTextArea(String content,
                                 XWikiContext context)

initXWiki

public void initXWiki(XWikiConfig config,
                      XWikiContext context,
                      XWikiEngineContext engine_context,
                      boolean noupdate)
               throws XWikiException
Initialize all xwiki subsystems.

Throws:
XWikiException

getNotCacheStore

public XWikiStoreInterface getNotCacheStore()

getHibernateStore

public XWikiHibernateStore getHibernateStore()

updateDatabase

public void updateDatabase(String wikiName,
                           XWikiContext context)
                    throws org.hibernate.HibernateException,
                           XWikiException
Throws:
org.hibernate.HibernateException
XWikiException

updateDatabase

public void updateDatabase(String wikiName,
                           boolean force,
                           XWikiContext context)
                    throws org.hibernate.HibernateException,
                           XWikiException
Throws:
org.hibernate.HibernateException
XWikiException

updateDatabase

public void updateDatabase(String wikiName,
                           boolean force,
                           boolean initClasses,
                           XWikiContext context)
                    throws org.hibernate.HibernateException,
                           XWikiException
Throws:
org.hibernate.HibernateException
XWikiException

getVirtualWikiList

public List<String> getVirtualWikiList()
Returns:
a cached list of all active virtual wikis (i.e. wikis who have been hit by a user request). To get a full list of all virtual wikis database names use getVirtualWikisDatabaseNames(XWikiContext).

getVirtualWikisDatabaseNames

public List<String> getVirtualWikisDatabaseNames(XWikiContext context)
                                          throws XWikiException
Returns:
the full list of all wiki names of all defined wikis. The wiki names are computed from the names of documents having a XWiki.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 databse 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.

Throws:
XWikiException

getVirtualWikiCache

public Cache<DocumentReference> getVirtualWikiCache()
Returns:
the cache containing the names of the wikis already initialized.
Since:
1.5M2.

getWikiOwner

public String getWikiOwner(String wikiName,
                           XWikiContext context)
                    throws XWikiException
Get the reference of the owner for the provider wiki.

Parameters:
wikiName - the technical name of the wiki
context - the XWiki context
Returns:
the wiki owner or null if none is set
Throws:
XWikiException - failed to get wiki descriptor document

createClassFromConfig

protected Object createClassFromConfig(String param,
                                       String defClass,
                                       XWikiContext context)
                                throws XWikiException
Throws:
XWikiException

resetRenderingEngine

public void resetRenderingEngine(XWikiContext context)
                          throws XWikiException
Throws:
XWikiException

getVersion

public String getVersion()
Returns:
the XWiki core version as specified in the VERSION_FILE file

getResource

public URL getResource(String s)
                throws MalformedURLException
Throws:
MalformedURLException

getResourceAsStream

public InputStream getResourceAsStream(String s)
                                throws MalformedURLException
Throws:
MalformedURLException

getResourceContent

public String getResourceContent(String name)
                          throws IOException
Throws:
IOException

getResourceLastModificationDate

public Date getResourceLastModificationDate(String name)

getResourceContentAsBytes

public byte[] getResourceContentAsBytes(String name)
                                 throws IOException
Throws:
IOException

resourceExists

public boolean resourceExists(String name)

getConfig

public XWikiConfig getConfig()

getRealPath

public String getRealPath(String path)

Param

public String Param(String key)

ParamAsRealPath

public String ParamAsRealPath(String key)

ParamAsRealPath

public String ParamAsRealPath(String key,
                              XWikiContext context)

ParamAsRealPathVerified

public String ParamAsRealPathVerified(String param)

Param

public String Param(String key,
                    String default_value)

ParamAsLong

public long ParamAsLong(String key)

ParamAsLong

public long ParamAsLong(String key,
                        long default_value)

getStore

public XWikiStoreInterface getStore()

getAttachmentStore

public XWikiAttachmentStoreInterface getAttachmentStore()

getAttachmentVersioningStore

public AttachmentVersioningStore getAttachmentVersioningStore()

getVersioningStore

public XWikiVersioningStoreInterface getVersioningStore()

getRecycleBinStore

public XWikiRecycleBinStoreInterface getRecycleBinStore()

getAttachmentRecycleBinStore

public AttachmentRecycleBinStore getAttachmentRecycleBinStore()

saveDocument

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

saveDocument

public void saveDocument(XWikiDocument doc,
                         String comment,
                         XWikiContext context)
                  throws XWikiException
Throws:
XWikiException

saveDocument

public void saveDocument(XWikiDocument doc,
                         String comment,
                         boolean isMinorEdit,
                         XWikiContext context)
                  throws XWikiException
Throws:
XWikiException

getDocument

@Unstable
public XWikiDocument getDocument(EntityReference reference,
                                          XWikiContext context)
                          throws XWikiException
Throws:
XWikiException
Since:
5.0M1

getDocument

public XWikiDocument getDocument(XWikiDocument doc,
                                 XWikiContext context)
                          throws XWikiException
Throws:
XWikiException

getDocument

public XWikiDocument getDocument(XWikiDocument doc,
                                 String revision,
                                 XWikiContext context)
                          throws XWikiException
Throws:
XWikiException

getDocument

public XWikiDocument getDocument(DocumentReference reference,
                                 XWikiContext context)
                          throws XWikiException
Throws:
XWikiException
Since:
2.2M1

getDocument

@Deprecated
public XWikiDocument getDocument(String fullname,
                                            XWikiContext context)
                          throws XWikiException
Deprecated. since 2.2M1 use getDocument(DocumentReference, XWikiContext) instead

Throws:
XWikiException

getDocument

@Deprecated
public XWikiDocument getDocument(String space,
                                            String fullname,
                                            XWikiContext context)
                          throws XWikiException
Deprecated. since 2.2M1 use getDocument(DocumentReference, XWikiContext) instead

Throws:
XWikiException

getDocumentFromPath

public XWikiDocument getDocumentFromPath(String path,
                                         XWikiContext context)
                                  throws XWikiException
Throws:
XWikiException

getDocumentReferenceFromPath

public DocumentReference getDocumentReferenceFromPath(String path,
                                                      XWikiContext context)
Since:
2.3M1

getDocumentNameFromPath

@Deprecated
public String getDocumentNameFromPath(String path,
                                                 XWikiContext context)
Deprecated. since 2.3M1 use getDocumentReferenceFromPath(String, XWikiContext) instead


getDeletedDocuments

public XWikiDeletedDocument[] getDeletedDocuments(String fullname,
                                                  String lang,
                                                  XWikiContext context)
                                           throws XWikiException
Throws:
XWikiException
See Also:
XWiki.getDeletedDocuments(String, String)

getDeletedDocument

public XWikiDeletedDocument getDeletedDocument(String fullname,
                                               String lang,
                                               int index,
                                               XWikiContext context)
                                        throws XWikiException
Throws:
XWikiException
See Also:
XWiki.getDeletedDocument(String, String, String)

getDeletedAttachments

public List<DeletedAttachment> getDeletedAttachments(String docName,
                                                     XWikiContext context)
                                              throws XWikiException
Retrieve all the deleted attachments that belonged to a certain document. Note that this does not distinguish between different incarnations of a document name, and it does not require that the document still exists, it returns all the attachments that at the time of their deletion had a document with the specified name as their owner.

Parameters:
docName - the name of the owner document
context - the current request context
Returns:
A list with all the deleted attachments which belonged to the specified document. If no such attachments are found in the trash, an empty list is returned.
Throws:
XWikiException - if an error occurs while loading the attachments

getDeletedAttachments

public List<DeletedAttachment> getDeletedAttachments(String docName,
                                                     String filename,
                                                     XWikiContext context)
                                              throws XWikiException
Retrieve all the deleted attachments that belonged to a certain document and had the specified name. Multiple versions can be returned since the same file can be uploaded and deleted several times, creating different instances in the trash. Note that this does not distinguish between different incarnations of a document name, and it does not require that the document still exists, it returns all the attachments that at the time of their deletion had a document with the specified name as their owner.

Parameters:
docName - the name of the document the attachment belonged to
filename - the name of the attachment to search for
context - the current request context
Returns:
A list with all the deleted attachments which belonged to the specified document and had the specified filename. If no such attachments are found in the trash, an empty list is returned.
Throws:
XWikiException - if an error occurs while loading the attachments

getDeletedAttachment

public DeletedAttachment getDeletedAttachment(String id,
                                              XWikiContext context)
                                       throws XWikiException
Retrieve a specific attachment from the trash.

Parameters:
id - the unique identifier of the entry in the trash
Returns:
specified attachment from the trash, null if not found
Throws:
XWikiException - if an error occurs while loading the attachments

getRenderingEngine

public XWikiRenderingEngine getRenderingEngine()

setRenderingEngine

public void setRenderingEngine(XWikiRenderingEngine renderingEngine)

getMetaclass

public MetaClass getMetaclass()

setMetaclass

public void setMetaclass(MetaClass metaclass)

getClassList

public List<String> getClassList(XWikiContext context)
                          throws XWikiException
Throws:
XWikiException

search

public <T> List<T> search(String sql,
                          XWikiContext context)
               throws XWikiException
Throws:
XWikiException

search

public <T> List<T> search(String sql,
                          int nb,
                          int start,
                          XWikiContext context)
               throws XWikiException
Throws:
XWikiException

search

public <T> List<T> search(String sql,
                          Object[][] whereParams,
                          XWikiContext context)
               throws XWikiException
Throws:
XWikiException

search

public <T> List<T> search(String sql,
                          int nb,
                          int start,
                          Object[][] whereParams,
                          XWikiContext context)
               throws XWikiException
Throws:
XWikiException

isTest

@Deprecated
public boolean isTest()
Deprecated. No longer used.

Checks if the wiki is running in test mode.

Returns:
true if the wiki is running Cactus tests, false otherwise

setTest

@Deprecated
public void setTest(boolean test)
Deprecated. No longer used.

Marks that the wiki is running in test mode.

Parameters:
test - whether tests are being executed

parseContent

public String parseContent(String content,
                           XWikiContext context)

parseTemplate

@Deprecated
public String parseTemplate(String template,
                                       XWikiContext context)
Deprecated. use evaluateTemplate(String, XWikiContext) instead


evaluateTemplate

public String evaluateTemplate(String template,
                               XWikiContext context)
                        throws IOException
Evaluate provided template content using velocity engine.

Parameters:
template - the template to evaluate
context - the XWiki context
Returns:
the return of the velocity script
Throws:
IOException - failed to get the template content
Since:
2.2.2

parseTemplate

public String parseTemplate(String template,
                            String skin,
                            XWikiContext context)

renderTemplate

public String renderTemplate(String template,
                             String skin,
                             XWikiContext context)

renderTemplate

public String renderTemplate(String template,
                             XWikiContext context)

invokeServletAndReturnAsString

public String invokeServletAndReturnAsString(String url,
                                             XWikiContext xwikiContext)
Designed to include dynamic content, such as Servlets or JSPs, inside Velocity templates; works by creating a RequestDispatcher, buffering the output, then returning it as a string.


getIconURL

public String getIconURL(String iconName,
                         XWikiContext context)
Parameters:
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 icon
Returns:
the URL to the icon resource
Since:
2.6M1

getSkinFile

public String getSkinFile(String filename,
                          XWikiContext context)

getSkinFile

public String getSkinFile(String filename,
                          boolean forceSkinAction,
                          XWikiContext context)

getSkinFile

public String getSkinFile(String filename,
                          String skin,
                          XWikiContext context)

getSkinFile

public String getSkinFile(String filename,
                          String skin,
                          boolean forceSkinAction,
                          XWikiContext context)

getSkin

public String getSkin(XWikiContext context)

getSkinPreference

public String getSkinPreference(String prefname,
                                XWikiContext context)

getSkinPreference

public String getSkinPreference(String prefname,
                                String default_value,
                                XWikiContext context)

getDefaultBaseSkin

public String getDefaultBaseSkin(XWikiContext context)

getBaseSkin

public String getBaseSkin(XWikiContext context)

getBaseSkin

public String getBaseSkin(XWikiContext context,
                          boolean fromRenderSkin)

getBaseSkin

public String getBaseSkin(String skin,
                          XWikiContext context)
Parameters:
skin - the full name of the skin document for which to return the base skin. For example : XWiki.DefaultSkin
context - the XWiki context
Returns:
if found, the name of the base skin the asked skin inherits from. If not found, returns an empty string.
Since:
2.0.2, 2.1M1

getSpaceCopyright

public String getSpaceCopyright(XWikiContext context)

getXWikiPreference

public String getXWikiPreference(String prefname,
                                 XWikiContext context)

getXWikiPreference

public String getXWikiPreference(String prefname,
                                 String fallback_param,
                                 String default_value,
                                 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.

Parameters:
prefname - the parameter to look for in the XWiki.XWikiPreferences object corresponding to the context's language in the XWiki.XWikiPreferences document of the wiki (or the first XWiki.XWikiPreferences object contained, if the one for the context'ds language could not be found).
fallback_param - the parameter in xwiki.cfg to fallback on, in case the XWiki.XWikiPreferences object gave no result
default_value - the default value to fallback on, in case both XWiki.XWikiPreferences and the fallback xwiki.cfg parameter gave no result

getXWikiPreference

public String getXWikiPreference(String prefname,
                                 String default_value,
                                 XWikiContext context)

getSpacePreference

public String getSpacePreference(String preference,
                                 XWikiContext context)

getSpacePreference

public String getSpacePreference(String preference,
                                 String defaultValue,
                                 XWikiContext context)

getSpacePreference

public String getSpacePreference(String preference,
                                 String space,
                                 String defaultValue,
                                 XWikiContext context)

getUserPreference

public String getUserPreference(String prefname,
                                XWikiContext context)

getUserPreferenceFromCookie

public String getUserPreferenceFromCookie(String prefname,
                                          XWikiContext context)

getUserPreference

public String getUserPreference(String prefname,
                                boolean useCookie,
                                XWikiContext context)

getLanguagePreference

public String getLanguagePreference(XWikiContext context)
First try to find the current language in use from the XWiki context. If none is used and if the wiki is not multilingual use the default language defined in the XWiki preferences. If the wiki is multilingual try to get the language passed in the request. If none was passed try to get it from a cookie. If no language cookie exists then use the user default language and barring that use the browser's "Accept-Language" header sent in HTTP request. If none is defined use the default language.

Returns:
the language to use

getDefaultLanguage

public String getDefaultLanguage(XWikiContext context)

getDocLanguagePreferenceNew

public String getDocLanguagePreferenceNew(XWikiContext context)

getInterfaceLanguagePreference

public String getInterfaceLanguagePreference(XWikiContext context)

getXWikiPreferenceAsLong

public long getXWikiPreferenceAsLong(String preference,
                                     XWikiContext context)

getSpacePreferenceAsLong

public long getSpacePreferenceAsLong(String preference,
                                     XWikiContext context)

getXWikiPreferenceAsLong

public long getXWikiPreferenceAsLong(String preference,
                                     long defaultValue,
                                     XWikiContext context)

getXWikiPreferenceAsLong

public long getXWikiPreferenceAsLong(String preference,
                                     String fallbackParameter,
                                     long defaultValue,
                                     XWikiContext context)

getSpacePreferenceAsLong

public long getSpacePreferenceAsLong(String preference,
                                     long defaultValue,
                                     XWikiContext context)

getUserPreferenceAsLong

public long getUserPreferenceAsLong(String preference,
                                    XWikiContext context)

getXWikiPreferenceAsInt

public int getXWikiPreferenceAsInt(String preference,
                                   XWikiContext context)

getSpacePreferenceAsInt

public int getSpacePreferenceAsInt(String preference,
                                   XWikiContext context)

getXWikiPreferenceAsInt

public int getXWikiPreferenceAsInt(String preference,
                                   int defaultValue,
                                   XWikiContext context)

getXWikiPreferenceAsInt

public int getXWikiPreferenceAsInt(String preference,
                                   String fallbackParameter,
                                   int defaultValue,
                                   XWikiContext context)

getSpacePreferenceAsInt

public int getSpacePreferenceAsInt(String preference,
                                   int defaultValue,
                                   XWikiContext context)

getUserPreferenceAsInt

public int getUserPreferenceAsInt(String prefname,
                                  XWikiContext context)

flushCache

public void flushCache(XWikiContext context)

getPluginManager

public XWikiPluginManager getPluginManager()

setPluginManager

public void setPluginManager(XWikiPluginManager pluginManager)

setConfig

public void setConfig(XWikiConfig config)

setStore

public void setStore(XWikiStoreInterface store)

setAttachmentStore

public void setAttachmentStore(XWikiAttachmentStoreInterface attachmentStore)

setAttachmentVersioningStore

public void setAttachmentVersioningStore(AttachmentVersioningStore avStore)

setVersioningStore

public void setVersioningStore(XWikiVersioningStoreInterface versioningStore)

setRecycleBinStore

public void setRecycleBinStore(XWikiRecycleBinStoreInterface recycleBinStore)

setAttachmentRecycleBinStore

public void setAttachmentRecycleBinStore(AttachmentRecycleBinStore attachmentRecycleBinStore)

setCriteriaService

public void setCriteriaService(XWikiCriteriaService criteriaService)

setVersion

public void setVersion(String version)

getTagClass

public BaseClass getTagClass(XWikiContext context)
                      throws XWikiException
Verify if the 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.

Parameters:
context - the XWiki Context
Returns:
the TagClass Base Class object containing the properties
Throws:
XWikiException - if an error happens during the save to the datavase

getSheetClass

@Deprecated
public BaseClass getSheetClass(XWikiContext context)
                        throws XWikiException
Deprecated. since 3.1M2 edit mode class should be used for this purpose, not the sheet class

Verify if the 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).

Parameters:
context - the XWiki Context
Returns:
the SheetClass Base Class object containing the properties
Throws:
XWikiException - if an error happens during the save to the database
See Also:
getEditModeClass(XWikiContext)

getEditModeClass

public BaseClass getEditModeClass(XWikiContext context)
                           throws XWikiException
Verify if the 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)).

Parameters:
context - the XWiki Context
Returns:
the EditModeClass Base Class object containing the properties
Throws:
XWikiException - if an error happens during the save to the database
Since:
3.1M2

getUserClass

public BaseClass getUserClass(XWikiContext context)
                       throws XWikiException
Verify if the 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.

Parameters:
context - the XWiki Context
Returns:
the XWikiUsers Base Class object containing the properties
Throws:
XWikiException - if an error happens during the save to the datavase

getRedirectClass

public BaseClass getRedirectClass(XWikiContext context)
                           throws XWikiException
Verify if the 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.

Parameters:
context - the XWiki Context
Returns:
the GlobalRedirect Base Class object containing the properties
Throws:
XWikiException - if an error happens during the save to the datavase

getPrefsClass

public BaseClass getPrefsClass(XWikiContext context)
                        throws XWikiException
Verify if the 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.

Parameters:
context - the XWiki Context
Returns:
the XWiki Base Class object containing the properties
Throws:
XWikiException - if an error happens during the save to the datavase

getGroupClass

public BaseClass getGroupClass(XWikiContext context)
                        throws XWikiException
Throws:
XWikiException

getRightsClass

public BaseClass getRightsClass(String pagename,
                                XWikiContext context)
                         throws XWikiException
Throws:
XWikiException

getRightsClass

public BaseClass getRightsClass(XWikiContext context)
                         throws XWikiException
Throws:
XWikiException

getGlobalRightsClass

public BaseClass getGlobalRightsClass(XWikiContext context)
                               throws XWikiException
Throws:
XWikiException

getCommentsClass

public BaseClass getCommentsClass(XWikiContext context)
                           throws XWikiException
Throws:
XWikiException

getSkinClass

public BaseClass getSkinClass(XWikiContext context)
                       throws XWikiException
Throws:
XWikiException

createUser

public int createUser(XWikiContext context)
               throws XWikiException
Throws:
XWikiException

validateUser

public int validateUser(boolean withConfirmEmail,
                        XWikiContext context)
                 throws XWikiException
Throws:
XWikiException

createUser

public int createUser(boolean withValidation,
                      String userRights,
                      XWikiContext context)
               throws XWikiException
Throws:
XWikiException

createEmptyUser

public boolean createEmptyUser(String xwikiname,
                               String userRights,
                               XWikiContext context)
                        throws XWikiException
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

Parameters:
xwikiname -
userRights -
context -
Returns:
true if success
Throws:
XWikiException

sendConfirmationEmail

public void sendConfirmationEmail(String xwikiname,
                                  String password,
                                  String email,
                                  String message,
                                  String contentfield,
                                  XWikiContext context)
                           throws XWikiException
Throws:
XWikiException

sendValidationEmail

public void sendValidationEmail(String xwikiname,
                                String password,
                                String email,
                                String validkey,
                                String contentfield,
                                XWikiContext context)
                         throws XWikiException
Throws:
XWikiException

sendValidationEmail

public void sendValidationEmail(String xwikiname,
                                String password,
                                String email,
                                String addfieldname,
                                String addfieldvalue,
                                String contentfield,
                                XWikiContext context)
                         throws XWikiException
Throws:
XWikiException

sendMessage

@Deprecated
public void sendMessage(String sender,
                                   String[] recipients,
                                   String rawMessage,
                                   XWikiContext context)
                 throws XWikiException
Deprecated. replaced by the Mail Sender Plugin

Throws:
XWikiException

sendMessage

@Deprecated
public void sendMessage(String sender,
                                   String recipient,
                                   String message,
                                   XWikiContext context)
                 throws XWikiException
Deprecated. replaced by the Mail Sender Plugin

Throws:
XWikiException

generateRandomString

public String generateRandomString(int size)

generateValidationKey

public String generateValidationKey(int size)

createUser

public int createUser(String userName,
                      Map<String,?> map,
                      XWikiContext context)
               throws XWikiException
Create a new user.

Parameters:
userName - the name of the user (without the space)
map - extra datas to add to user profile object
context - the XWiki context
Returns:
  • 1: ok
  • -3: user already exists
Throws:
XWikiException - failed to create the new user

createUser

public int createUser(String userName,
                      Map<String,?> map,
                      String userRights,
                      XWikiContext context)
               throws XWikiException
Create a new user.

Parameters:
userName - the name of the user (without the space)
map - extra datas to add to user profile object
userRights - the right of the user on his own profile page
context - the XWiki context
Returns:
  • 1: ok
  • -3: user already exists
Throws:
XWikiException - failed to create the new user

createUser

@Deprecated
public int createUser(String userName,
                                 Map<String,?> map,
                                 String parent,
                                 String content,
                                 String syntaxId,
                                 String userRights,
                                 XWikiContext context)
               throws XWikiException
Deprecated. since 2.4RC1 use createUser(String, Map, EntityReference, String, Syntax, String, XWikiContext) instead

Throws:
XWikiException

createUser

public int createUser(String userName,
                      Map<String,?> map,
                      EntityReference parentReference,
                      String content,
                      org.xwiki.rendering.syntax.Syntax syntax,
                      String userRights,
                      XWikiContext context)
               throws XWikiException
Create a new user.

Parameters:
userName - the name of the user (without the space)
map - extra datas to add to user profile object
parentReference - the parent of the user profile
content - the content of the user profile
syntax - the syntax of the provided content
userRights - the right of the user on his own profile page
context - the XWiki context
Returns:
  • 1: ok
  • -3: user already exists
Throws:
XWikiException - failed to create the new user

createUser

@Deprecated
public int createUser(String xwikiname,
                                 Map map,
                                 String parent,
                                 String content,
                                 String userRights,
                                 XWikiContext context)
               throws XWikiException
Deprecated. starting with XE 1.8.1 use createUser(String, Map, String, String, String, String, XWikiContext) instead

Throws:
XWikiException

setUserDefaultGroup

public void setUserDefaultGroup(String fullwikiname,
                                XWikiContext context)
                         throws XWikiException
Throws:
XWikiException

addUserToGroup

protected void addUserToGroup(String userName,
                              String groupName,
                              XWikiContext context)
                       throws XWikiException
Throws:
XWikiException

SetUserDefaultGroup

@Deprecated
public void SetUserDefaultGroup(XWikiContext context,
                                           String fullwikiname)
                         throws XWikiException
Deprecated. replaced by setUserDefaultGroup(String fullwikiname, XWikiContext context)

Parameters:
context -
fullwikiname -
Throws:
XWikiException

protectUserPage

public void protectUserPage(String userName,
                            String userRights,
                            XWikiDocument doc,
                            XWikiContext context)
                     throws XWikiException
Throws:
XWikiException

ProtectUserPage

@Deprecated
public void ProtectUserPage(XWikiContext context,
                                       String fullwikiname,
                                       String userRights,
                                       XWikiDocument doc)
                     throws XWikiException
Deprecated. replaced by protectUserPage(String,String,XWikiDocument,XWikiContext)

Parameters:
context -
fullwikiname -
userRights -
doc -
Throws:
XWikiException

getUser

public User getUser(XWikiContext context)

getUser

public User getUser(String username,
                    XWikiContext context)

prepareResources

public void prepareResources(XWikiContext context)
Prepares the localized resources, according to the selected language. From any point in the code (java, velocity or groovy) the "msg" parameter holds an instance of the localized resource bundle, and the "locale" parameter holds the current locale settings.

Parameters:
context - The request context.

checkAuth

public XWikiUser checkAuth(XWikiContext context)
                    throws XWikiException
Throws:
XWikiException

checkAccess

public boolean checkAccess(String action,
                           XWikiDocument doc,
                           XWikiContext context)
                    throws XWikiException
Throws:
XWikiException

include

@Deprecated
public String include(String topic,
                                 XWikiContext context,
                                 boolean isForm)
               throws XWikiException
Deprecated. replaced by include(String topic, boolean isForm, XWikiContext context)

Parameters:
topic -
context -
isForm -
Returns:
Throws:
XWikiException

include

public String include(String topic,
                      boolean isForm,
                      XWikiContext context)
               throws XWikiException
Throws:
XWikiException

deleteDocument

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

deleteDocument

public void deleteDocument(XWikiDocument doc,
                           boolean totrash,
                           XWikiContext context)
                    throws XWikiException
Throws:
XWikiException

getDatabase

public String getDatabase()

setDatabase

public void setDatabase(String database)

gc

public void gc()

freeMemory

public long freeMemory()

totalMemory

public long totalMemory()

maxMemory

public long maxMemory()

split

public String[] split(String str,
                      String sep)

printStrackTrace

public String printStrackTrace(Throwable e)

copyDocument

public boolean copyDocument(DocumentReference sourceDocumentReference,
                            DocumentReference targetDocumentReference,
                            XWikiContext context)
                     throws XWikiException
Throws:
XWikiException
Since:
2.2M2

copyDocument

public boolean copyDocument(DocumentReference sourceDocumentReference,
                            DocumentReference targetDocumentReference,
                            boolean reset,
                            XWikiContext context)
                     throws XWikiException
Throws:
XWikiException
Since:
2.2M2

copyDocument

public boolean copyDocument(DocumentReference sourceDocumentReference,
                            DocumentReference targetDocumentReference,
                            boolean reset,
                            boolean force,
                            boolean resetCreationData,
                            XWikiContext context)
                     throws XWikiException
Throws:
XWikiException
Since:
2.2M2

copyDocument

public boolean copyDocument(DocumentReference sourceDocumentReference,
                            DocumentReference targetDocumentReference,
                            String wikilanguage,
                            XWikiContext context)
                     throws XWikiException
Throws:
XWikiException
Since:
2.2M2

copyDocument

public boolean copyDocument(DocumentReference sourceDocumentReference,
                            DocumentReference targetDocumentReference,
                            String wikilanguage,
                            boolean reset,
                            XWikiContext context)
                     throws XWikiException
Throws:
XWikiException
Since:
2.2M2

copyDocument

public boolean copyDocument(DocumentReference sourceDocumentReference,
                            DocumentReference targetDocumentReference,
                            String wikilanguage,
                            boolean reset,
                            boolean force,
                            XWikiContext context)
                     throws XWikiException
Throws:
XWikiException
Since:
2.2M2

copyDocument

public boolean copyDocument(DocumentReference sourceDocumentReference,
                            DocumentReference targetDocumentReference,
                            String wikilanguage,
                            boolean reset,
                            boolean force,
                            boolean resetCreationData,
                            XWikiContext context)
                     throws XWikiException
Throws:
XWikiException
Since:
2.2M2

copySpaceBetweenWikis

public int copySpaceBetweenWikis(String space,
                                 String sourceWiki,
                                 String targetWiki,
                                 String language,
                                 XWikiContext context)
                          throws XWikiException
Throws:
XWikiException

copySpaceBetweenWikis

public int copySpaceBetweenWikis(String space,
                                 String sourceWiki,
                                 String targetWiki,
                                 String language,
                                 boolean clean,
                                 XWikiContext context)
                          throws XWikiException
Throws:
XWikiException

copyWiki

public int copyWiki(String sourceWiki,
                    String targetWiki,
                    String language,
                    XWikiContext context)
             throws XWikiException
Copy an entire wiki to a target wiki.

It does not override document already existing in target wiki.

Parameters:
sourceWiki - the source wiki identifier
targetWiki - the target wiki identifier
language - the language to copy
context - the XWiki context
Returns:
the number of copied documents
Throws:
XWikiException - failed to copy wiki

copyWiki

public int copyWiki(String sourceWiki,
                    String targetWiki,
                    String language,
                    boolean clean,
                    XWikiContext context)
             throws XWikiException
Copy an entire wiki to a target wiki.

Parameters:
sourceWiki - the source wiki identifier
targetWiki - the target wiki identifier
language - the language to copy
clean - clean the target wiki before copying
context - the XWiki context
Returns:
the number of copied documents
Throws:
XWikiException - failed to copy wiki

getEncoding

public String getEncoding()

getServerURL

public URL getServerURL(String database,
                        XWikiContext context)
                 throws MalformedURLException
Throws:
MalformedURLException

getServletPath

public String getServletPath(String wikiName,
                             XWikiContext context)

getWebAppPath

public String getWebAppPath(XWikiContext context)

getURL

public String getURL(DocumentReference documentReference,
                     String action,
                     String queryString,
                     String anchor,
                     XWikiContext context)
Since:
2.2.1

getURL

@Deprecated
public String getURL(String fullname,
                                String action,
                                String queryString,
                                String anchor,
                                XWikiContext context)
Deprecated. since 2.2.1 use getURL(DocumentReference, String, String, String, XWikiContext)


getURL

public String getURL(String fullname,
                     String action,
                     String querystring,
                     XWikiContext context)

getURL

public String getURL(DocumentReference reference,
                     String action,
                     XWikiContext context)
Since:
2.3M2

getURL

@Deprecated
public String getURL(String fullname,
                                String action,
                                XWikiContext context)
Deprecated. since 2.3M2 use getURL(DocumentReference, String, XWikiContext)


getExternalURL

public String getExternalURL(String fullname,
                             String action,
                             XWikiContext context)
                      throws XWikiException
Throws:
XWikiException

getExternalURL

public String getExternalURL(String fullname,
                             String action,
                             String querystring,
                             XWikiContext context)
                      throws XWikiException
Throws:
XWikiException

getAttachmentURL

public String getAttachmentURL(String fullname,
                               String filename,
                               XWikiContext context)
                        throws XWikiException
Throws:
XWikiException

getAttachmentURL

public String getAttachmentURL(String fullname,
                               String filename,
                               String queryString,
                               XWikiContext context)
                        throws XWikiException
Throws:
XWikiException
Since:
2.5RC1

getCurrentDate

public Date getCurrentDate()

getTimeDelta

public int getTimeDelta(long time)

getDate

public Date getDate(long time)

isMultiLingual

public boolean isMultiLingual(XWikiContext context)

isVirtualMode

public boolean isVirtualMode()
Deprecated. Virtual mode is on by default, starting with XWiki 5.0M2. Use getVirtualWikisDatabaseNames(XWikiContext) to get the list of wikis if needed.

Returns:
true for multi-wiki/false for mono-wiki

isLDAP

public boolean isLDAP()

checkActive

public int checkActive(XWikiContext context)
                throws XWikiException
Throws:
XWikiException

checkActive

public int checkActive(String user,
                       XWikiContext context)
                throws XWikiException
Throws:
XWikiException

getDocumentReference

public DocumentReference getDocumentReference(XWikiRequest request,
                                              XWikiContext context)
Since:
2.3M1

getDocumentName

@Deprecated
public String getDocumentName(XWikiRequest request,
                                         XWikiContext context)
Deprecated. since 2.3M1 use getDocumentReferenceFromPath(String, XWikiContext) instead


stripSegmentFromPath

public 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. This method is needed because special characters in the path can be URL-encoded, depending on whether the request is forwarded through the request dispatcher or not, and also depending on the client (some browsers encode -, while some don't).

Parameters:
path - the path, as taken from the requested URI
segment - the segment to remove, as reported by the container
Returns:
the path with the specified segment trimmed from its start

prepareDocuments

public boolean prepareDocuments(XWikiRequest request,
                                XWikiContext context,
                                org.apache.velocity.VelocityContext vcontext)
                         throws XWikiException
Throws:
XWikiException

setPhonyDocument

public void setPhonyDocument(DocumentReference reference,
                             XWikiContext context,
                             org.apache.velocity.VelocityContext vcontext)
Since:
2.3M1

setPhonyDocument

@Deprecated
public void setPhonyDocument(String docName,
                                        XWikiContext context,
                                        org.apache.velocity.VelocityContext vcontext)
Deprecated. since 2.3M1 use setPhonyDocument(DocumentReference, XWikiContext, VelocityContext)


getEngineContext

public XWikiEngineContext getEngineContext()

setEngineContext

public void setEngineContext(XWikiEngineContext engine_context)

setAuthService

public void setAuthService(XWikiAuthService authService)

setRightService

public void setRightService(XWikiRightService rightService)

getGroupService

public XWikiGroupService getGroupService(XWikiContext context)
                                  throws XWikiException
Throws:
XWikiException

setGroupService

public void setGroupService(XWikiGroupService groupService)

getAuthService

public XWikiAuthService getAuthService()

getRightService

public XWikiRightService getRightService()

getStatsService

public XWikiStatsService getStatsService(XWikiContext context)

getURLFactoryService

public XWikiURLFactoryService getURLFactoryService()

getCriteriaService

public XWikiCriteriaService getCriteriaService(XWikiContext context)

getZipOutputStream

public ZipOutputStream getZipOutputStream(XWikiContext context)
                                   throws IOException
Throws:
IOException

getRefererText

public String getRefererText(String referer,
                             XWikiContext context)

isMySQL

public boolean isMySQL()

getFullNameSQL

public String getFullNameSQL()

getFullNameSQL

public String getFullNameSQL(boolean newFullName)

getDocName

public String getDocName(String docname)

getUserName

public String getUserName(String user,
                          XWikiContext context)

getUserName

public String getUserName(String user,
                          String format,
                          XWikiContext context)

getUserName

public String getUserName(String user,
                          String format,
                          boolean link,
                          XWikiContext context)
Returns:
a formatted and pretty printed user name for displaying

hasCentralizedAuthentication

public boolean hasCentralizedAuthentication(XWikiContext context)

getLocalUserName

public String getLocalUserName(String user,
                               XWikiContext context)

getLocalUserName

public String getLocalUserName(String user,
                               String format,
                               XWikiContext context)

getLocalUserName

public String getLocalUserName(String user,
                               String format,
                               boolean link,
                               XWikiContext context)

formatDate

public String formatDate(Date date,
                         String format,
                         XWikiContext context)

getUserTimeZone

public String getUserTimeZone(XWikiContext context)

exists

@Deprecated
public boolean exists(String fullname,
                                 XWikiContext context)
Deprecated. since 2.2.1 use exists(DocumentReference, XWikiContext)


exists

public boolean exists(DocumentReference documentReference,
                      XWikiContext context)

getAdType

public String getAdType(XWikiContext context)

getAdClientId

public String getAdClientId(XWikiContext context)

getPlugin

public XWikiPluginInterface getPlugin(String name,
                                      XWikiContext context)

getPluginApi

public Api getPluginApi(String name,
                        XWikiContext context)

getCacheFactory

@Deprecated
public CacheFactory getCacheFactory()
Deprecated. Since 1.7M1, use CacheManager component instead using Utils.getComponent(Class)

Returns:
the cache factory.
Since:
1.5M2.

getLocalCacheFactory

@Deprecated
public CacheFactory getLocalCacheFactory()
Deprecated. Since 1.7M1, use CacheManager component instead using Utils.getComponent(Class)

Returns:
the cache factory creating local caches.
Since:
1.5M2.

getHttpTimeout

public int getHttpTimeout(XWikiContext context)

getHttpUserAgent

public String getHttpUserAgent(XWikiContext context)

getURLContent

public String getURLContent(String surl,
                            XWikiContext context)
                     throws IOException
Throws:
IOException

getURLContent

public String getURLContent(String surl,
                            int timeout,
                            String userAgent)
                     throws IOException
Throws:
IOException

getURLContent

public String getURLContent(String surl,
                            String username,
                            String password,
                            XWikiContext context)
                     throws IOException
Throws:
IOException

getURLContent

public String getURLContent(String surl,
                            String username,
                            String password,
                            int timeout,
                            String userAgent)
                     throws IOException
Throws:
IOException

getURLContentAsBytes

public byte[] getURLContentAsBytes(String surl,
                                   XWikiContext context)
                            throws IOException
Throws:
IOException

getURLContentAsBytes

public byte[] getURLContentAsBytes(String surl,
                                   int timeout,
                                   String userAgent)
                            throws IOException
Throws:
IOException

getURLContentAsBytes

public byte[] getURLContentAsBytes(String surl,
                                   String username,
                                   String password,
                                   XWikiContext context)
                            throws IOException
Throws:
IOException

getURLContentAsBytes

public byte[] getURLContentAsBytes(String surl,
                                   String username,
                                   String password,
                                   int timeout,
                                   String userAgent)
                            throws IOException
Throws:
IOException

getSpaces

public List<String> getSpaces(XWikiContext context)
                       throws XWikiException
Throws:
XWikiException

getSpaceDocsName

public List<String> getSpaceDocsName(String spaceName,
                                     XWikiContext context)
                              throws XWikiException
Throws:
XWikiException

getIncludedMacros

public List<String> getIncludedMacros(String defaultSpace,
                                      String content,
                                      XWikiContext context)

getFlash

public String getFlash(String url,
                       String width,
                       String height,
                       XWikiContext context)

isReadOnly

public boolean isReadOnly()
accessor for the isReadOnly instance var.

See Also:
isReadOnly

setReadOnly

public void setReadOnly(boolean readOnly)

deleteAllDocuments

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

deleteAllDocuments

public void deleteAllDocuments(XWikiDocument doc,
                               boolean totrash,
                               XWikiContext context)
                        throws XWikiException
Throws:
XWikiException

refreshLinks

public void refreshLinks(XWikiContext context)
                  throws XWikiException
Throws:
XWikiException

hasBacklinks

public boolean hasBacklinks(XWikiContext context)

hasTags

public boolean hasTags(XWikiContext context)

hasCustomMappings

public boolean hasCustomMappings()

hasDynamicCustomMappings

public boolean hasDynamicCustomMappings()

getDefaultSpace

public String getDefaultSpace(XWikiContext context)

skipDefaultSpaceInURLs

public boolean skipDefaultSpaceInURLs(XWikiContext context)

showViewAction

public boolean showViewAction(XWikiContext context)

useDefaultAction

public boolean useDefaultAction(XWikiContext context)

getDefaultPage

public String getDefaultPage(XWikiContext context)

hasEditComment

public boolean hasEditComment(XWikiContext context)

isEditCommentFieldHidden

public boolean isEditCommentFieldHidden(XWikiContext context)

isEditCommentSuggested

public boolean isEditCommentSuggested(XWikiContext context)

isEditCommentMandatory

public boolean isEditCommentMandatory(XWikiContext context)

hasMinorEdit

public boolean hasMinorEdit(XWikiContext context)
See Also:
XWiki.hasMinorEdit()

hasRecycleBin

public boolean hasRecycleBin(XWikiContext context)
Parameters:
context - maybe will be useful
See Also:
XWiki.hasRecycleBin()

hasAttachmentRecycleBin

public boolean hasAttachmentRecycleBin(XWikiContext context)
Indicates whether deleted attachments are stored in a recycle bin or not. This can be configured using the key storage.attachment.recyclebin.

Parameters:
context - The current context, maybe will be useful.

renamePage

@Deprecated
public XWikiDocument renamePage(XWikiDocument doc,
                                           String newFullName,
                                           XWikiContext context)
                         throws XWikiException
Deprecated. use XWikiDocument.rename(String, XWikiContext) instead

Throws:
XWikiException

renamePage

@Deprecated
public XWikiDocument renamePage(XWikiDocument doc,
                                           XWikiContext context,
                                           String newFullName)
                         throws XWikiException
Deprecated. use XWikiDocument.rename(String, XWikiContext) instead

Throws:
XWikiException

getXClass

public BaseClass getXClass(DocumentReference documentReference,
                           XWikiContext context)
                    throws XWikiException
Throws:
XWikiException
Since:
2.2M2

getClass

@Deprecated
public BaseClass getClass(String fullName,
                                     XWikiContext context)
                   throws XWikiException
Deprecated. since 2.2M2 use getXClass(DocumentReference, XWikiContext)

Throws:
XWikiException

getEditorPreference

public String getEditorPreference(XWikiContext context)

parseGroovyFromString

public Object parseGroovyFromString(String script,
                                    XWikiContext context)
                             throws XWikiException
Privileged API to retrieve an object instantiated from groovy code in a String. Note that Groovy scripts compilation is cached.

Parameters:
script - the Groovy class definition string (public class MyClass { ... })
Returns:
An object instantiating this class
Throws:
XWikiException

parseGroovyFromString

public Object parseGroovyFromString(String script,
                                    String jarWikiPage,
                                    XWikiContext context)
                             throws XWikiException
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. Note that Groovy scripts compilation is cached

Parameters:
script - the Groovy class definition string (public class MyClass { ... })
Returns:
An object instantiating this class
Throws:
XWikiException

parseGroovyFromPage

public Object parseGroovyFromPage(String fullname,
                                  XWikiContext context)
                           throws XWikiException
Throws:
XWikiException

parseGroovyFromPage

public Object parseGroovyFromPage(String fullName,
                                  String jarWikiPage,
                                  XWikiContext context)
                           throws XWikiException
Throws:
XWikiException

getMacroList

public String getMacroList(XWikiContext context)

getObjectFromRequest

public BaseObject getObjectFromRequest(String className,
                                       XWikiContext context)
                                throws XWikiException
Throws:
XWikiException

getConvertingUserNameType

public String getConvertingUserNameType(XWikiContext context)

convertUsername

public String convertUsername(String username,
                              XWikiContext context)

hasSectionEdit

public boolean hasSectionEdit(XWikiContext context)

getSectionEditingDepth

public long getSectionEditingDepth()
Returns:
The maximum section depth for which section editing is available. This can be customized through the xwiki.section.depth configuration property. Defaults to 2 when not defined.

hasCaptcha

public boolean hasCaptcha(XWikiContext context)

getWysiwygToolbars

public String getWysiwygToolbars(XWikiContext context)

clearName

public String clearName(String name,
                        XWikiContext context)

clearName

public String clearName(String name,
                        boolean stripDots,
                        boolean ascii,
                        XWikiContext context)

getUniquePageName

public String getUniquePageName(String space,
                                XWikiContext context)

getUniquePageName

public String getUniquePageName(String space,
                                String name,
                                XWikiContext context)

getPropertyClassFromName

public PropertyClass getPropertyClassFromName(String propPath,
                                              XWikiContext context)

validateDocument

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

addTooltip

public String addTooltip(String html,
                         String message,
                         String params,
                         XWikiContext context)

addTooltipJS

public String addTooltipJS(XWikiContext context)

addTooltip

public String addTooltip(String html,
                         String message,
                         XWikiContext context)

renamePage

public void renamePage(String fullName,
                       String newFullName,
                       XWikiContext context)
                throws XWikiException
Throws:
XWikiException

addMandatory

public String addMandatory(XWikiContext context)

hasVersioning

public boolean hasVersioning(XWikiContext context)
Since:
2.3M1

hasVersioning

@Deprecated
public boolean hasVersioning(String fullName,
                                        XWikiContext context)
Deprecated. since 2.3M1 use hasVersioning(XWikiContext) instead


hasAttachmentVersioning

public boolean hasAttachmentVersioning(XWikiContext context)

getExternalAttachmentURL

public String getExternalAttachmentURL(String fullName,
                                       String filename,
                                       XWikiContext context)

getMaxRecursiveSpaceChecks

public int getMaxRecursiveSpaceChecks(XWikiContext context)

rollback

public XWikiDocument rollback(XWikiDocument tdoc,
                              String rev,
                              XWikiContext context)
                       throws XWikiException
Throws:
XWikiException

getConfiguredSyntaxes

public List<String> getConfiguredSyntaxes()
Returns:
the ids of configured syntaxes for this wiki (eg "xwiki/1.0", "xwiki/2.0", "mediawiki/1.0", etc)

getDefaultDocumentSyntax

public String getDefaultDocumentSyntax()
Returns:
the syntax id of the syntax to use when creating new documents.

getCurrentContentSyntaxId

public String getCurrentContentSyntaxId(String defaultSyntaxId,
                                        XWikiContext context)
Get the syntax of the document currently being executed.

The document currently being executed is not the same than the context document since when including a page with velocity #includeForm(), method for example the context doc is the includer document even if includeForm() fully execute and render the included document before insert it in the includer document.

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).

Parameters:
defaultSyntaxId - the default value to return if no document can be found
Returns:
the syntax identifier

getCurrentContentSyntaxId

public String getCurrentContentSyntaxId(XWikiContext context)
Get the syntax of the document currently being executed.

The document currently being executed is not the same than the context document since when including a page with velocity #includeForm(), method for example the context doc is the includer document even if includeForm() fully execute and render the included document before insert it in the includer document.

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).

Returns:
the syntax identifier

isTitleInCompatibilityMode

public boolean isTitleInCompatibilityMode()
Returns:
true if title handling should be using the compatibility mode or not. When the compatibility mode is active, if the document's content first header (level 1 or level 2) matches the document's title the first header is stripped.

onEvent

public void onEvent(org.xwiki.observation.event.Event event,
                    Object source,
                    Object data)
Specified by:
onEvent in interface org.xwiki.observation.EventListener

getEvents

public List<org.xwiki.observation.event.Event> getEvents()
Specified by:
getEvents in interface org.xwiki.observation.EventListener

getName

public String getName()
Specified by:
getName in interface org.xwiki.observation.EventListener

parseMessage

@Deprecated
public String parseMessage(XWikiContext context)
Deprecated. use LocalizationManager instead. From velocity you can access it using the $services.localization binding, see LocalizationScriptService


parseMessage

@Deprecated
public String parseMessage(String id,
                                      XWikiContext context)
Deprecated. use LocalizationManager instead. From velocity you can access it using the $services.localization binding, see LocalizationScriptService


searchAttachments

@Unstable
public List<XWikiAttachment> searchAttachments(String parametrizedSqlClause,
                                                        boolean checkRight,
                                                        int nb,
                                                        int start,
                                                        List<?> parameterValues,
                                                        XWikiContext context)
                                        throws XWikiException
Search attachments by passing HQL where clause values as parameters. You can specify properties of the "attach" (the attachment) or "doc" (the document it is attached to)

Parameters:
parametrizedSqlClause - The HQL where clause. For example " where doc.fullName <> ? and (attach.author = ? or (attach.filename = ? and doc.space = ?))"
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 returned
start - The number of rows to skip at the beginning.
parameterValues - A List of the where clause values that replace the question marks (?)
XWikiContext - The underlying context used for running the database query
Returns:
A List of XWikiAttachment objects.
Throws:
XWikiException - in case of error while performing the query
Since:
5.0M2
See Also:
com.xpn.xwiki.store.XWikiStoreInterface#searchDocuments(String, int, int, List)

countAttachments

@Unstable
public int countAttachments(String parametrizedSqlClause,
                                     List<?> parameterValues,
                                     XWikiContext context)
                     throws XWikiException
Count attachments returned by a given parameterized query

Parameters:
parametrizedSqlClause - Everything which would follow the "WHERE" in HQL
parameterValues - A List of the where clause values that replace the question marks (?)
XWikiContext - The underlying context used for running the database query
Returns:
int number of attachments found.
Throws:
XWikiException - in event of an exception querying the database
Since:
5.0M2
See Also:
#searchAttachments(String, int, int, List, XWikiContext)


Copyright © 2004-2013 XWiki. All Rights Reserved.