|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.xpn.xwiki.api.Api
com.xpn.xwiki.api.XWiki
public class XWiki
Field Summary | |
---|---|
protected static org.slf4j.Logger |
LOGGER
Logging helper object. |
Fields inherited from class com.xpn.xwiki.api.Api |
---|
context |
Constructor Summary | |
---|---|
XWiki(XWiki xwiki,
XWikiContext context)
XWiki API Constructor |
Method Summary | ||
---|---|---|
String |
addMandatory()
|
|
void |
addToAllGroup(String fullwikiname)
Priviledged API to add a user to the XWiki.XWikiAllGroup |
|
String |
addTooltip(String html,
String message)
Inserts a tooltip using toolTip.js |
|
String |
addTooltip(String html,
String message,
String params)
Inserts a tooltip using toolTip.js |
|
String |
addTooltipJS()
Inserts the tooltip Javascript |
|
boolean |
checkAccess(String docname,
String right)
Verify the rights the current user has on a document. |
|
XWikiUser |
checkAuth()
Check authentication from request and set according persitent login information If it fails user is unlogged |
|
XWikiUser |
checkAuth(String username,
String password,
String rememberme)
Check authentication from username and password and set according persitent login information If it fails user is unlogged |
|
String |
convertUsername(String username)
API to convert the username depending on the configuration The username can be converted from email to a valid XWiki page name hidding the email address The username can be then used to login and link to the right user page |
|
boolean |
copyDocument(DocumentReference sourceDocumentReference,
DocumentReference targetDocumentReference,
String wikilanguage,
boolean resetHistory,
boolean overwrite)
API to copy a translation of a document to another document of the same name in another wiki additionally resetting the version and overwriting the previous document |
|
boolean |
copyDocument(String docname,
String targetdocname)
API to copy a document to another document in the same wiki |
|
boolean |
copyDocument(String docname,
String targetdocname,
String wikilanguage)
API to copy a translation of a document to another document in the same wiki |
|
boolean |
copyDocument(String docname,
String sourceWiki,
String targetWiki,
String wikilanguage)
API to copy a translation of a document to another document of the same name in another wiki |
|
boolean |
copyDocument(String docname,
String targetdocname,
String sourceWiki,
String targetWiki,
String wikilanguage,
boolean reset)
API to copy a translation of a document to another document of the same name in another wiki additionally resetting the version |
|
boolean |
copyDocument(String docname,
String targetdocname,
String sourceWiki,
String targetWiki,
String wikilanguage,
boolean reset,
boolean force)
API to copy a translation of a document to another document of the same name in another wiki additionally resetting the version and overwriting the previous document |
|
int |
copySpaceBetweenWikis(String space,
String sourceWiki,
String targetWiki,
String language,
boolean clean)
Privileged API to copy a space to another wiki, optionally deleting all document of the target space |
|
int |
countAttachments(String parametrizedSqlClause,
List<?> parameterValues)
Count attachments returned by a given parameterized query |
|
int |
countDocuments(String wheresql)
API allowing to count the total number of documents that would be returned by a query. |
|
int |
countDocuments(String parameterizedWhereClause,
List<?> parameterValues)
API allowing to count the total number of documents that would be returned by a parameterized query. |
|
Document |
createDocument()
API to create an empty document |
|
int |
createUser()
Priviledged API to create a new user from the request This API is used by RegisterNewUser wiki page |
|
int |
createUser(boolean withValidation)
Priviledged API to create a new user from the request This API is used by RegisterNewUser wiki page This version sends a validation email to the user Configuration of validation email is in the XWiki Preferences |
|
int |
createUser(boolean withValidation,
String userRights)
Priviledged API to create a new user from the request This API is used by RegisterNewUser wiki page This version sends a validation email to the user Configuration of validation email is in the XWiki Preferences |
|
boolean |
exists(DocumentReference reference)
Returns whether a document exists or not |
|
boolean |
exists(String fullname)
Returns whether a document exists or not |
|
void |
flushCache()
Priviledged API to flush the cache of the Wiki installation This flushed the cache of all wikis, all plugins, all renderers |
|
String |
formatDate(Date date)
API allowing to format a date according to the default Wiki setting The date format is provided in the 'dateformat' parameter of the XWiki Preferences |
|
String |
formatDate(Date date,
String format)
API allowing to format a date according to a custom format The date format is from java.text.SimpleDateFormat Example: "dd/MM/yyyy HH:mm:ss" or "d MMM yyyy" If the format is invalid the default format will be used to show the date |
|
Api |
get(String name)
Returns a plugin from the plugin API. |
|
String |
getAdClientId()
Returns the Advertisement client ID from the preferences |
|
String |
getAdType()
Returns the Advertisement system from the preferences |
|
String |
getAttachmentURL(String fullname,
String filename)
API to retrieve the URL of an attached file in a Wiki Document The URL is generated differently depending on the environement (Servlet, Portlet, PDF, etc..) The URL generation can be modified by implementing a new XWikiURLFactory object For compatibility with any target environement (and especially the portlet environment) It is important to always use the URL functions to generate URL and never hardcode URLs |
|
org.xwiki.rendering.syntax.Syntax |
getAvailableRendererSyntax(String syntaxType,
String syntaxVersion)
Find the corresponding available renderer syntax. |
|
String |
getBaseSkin()
API to retrieve the current skin for this request and user. |
|
Class |
getClass(String documentName)
Get the XWiki Class object defined in the passed Document name. |
|
List<String> |
getClassList()
Get the list of available classes in the wiki |
|
List<String> |
getConfiguredSyntaxes()
|
|
String |
getCounter(String name)
Provides an absolute counter |
|
CriteriaService |
getCriteriaService()
API to get the xwiki criteria service which allow to create various criteria : integer ranges, date periods, date intervals, etc. |
|
String |
getCurrentContentSyntaxId()
Get the syntax of the document currently being executed. |
|
DocumentStats |
getCurrentMonthXWikiStats(String action)
Deprecated. use getStatsService() instead |
|
String |
getDefaultDocumentSyntax()
|
|
DeletedAttachment |
getDeletedAttachment(String id)
Retrieve a specific attachment from the trash. |
|
List<DeletedAttachment> |
getDeletedAttachments(String docName)
Retrieve all the deleted attachments that belonged to a certain document. |
|
List<DeletedAttachment> |
getDeletedAttachments(String docName,
String filename)
Retrieve all the deleted attachments that belonged to a certain document and had the specified name. |
|
DeletedDocument |
getDeletedDocument(String fullname,
String lang,
String index)
|
|
List<DeletedDocument> |
getDeletedDocuments(String fullname,
String lang)
|
|
Document |
getDocument(DocumentReference reference)
Loads an Document from the database. |
|
Document |
getDocument(Document doc,
String rev)
Load a specific revision of a document |
|
Document |
getDocument(String fullName)
Loads an Document from the database. |
|
Document |
getDocument(String space,
String fullname)
Loads an Document from the database. |
|
Document |
getDocumentAsAuthor(DocumentReference reference)
Loads an Document from the database. |
|
Document |
getDocumentAsAuthor(String fullName)
Loads an Document from the database. |
|
String |
getEditorPreference()
Retrieves the current editor preference for the request The preference is first looked up in the user preference and then in the space and wiki preference |
|
String |
getEncoding()
API to retrieve the current encoding of the wiki engine The encoding is stored in xwiki.cfg Default encoding is ISO-8891-1 |
|
String |
getFullNameSQL()
Deprecated. |
|
List<String> |
getIncludedMacros(String defaultSpace,
String content)
Returns the list of Macros documents in the specified content |
|
String |
getInterfaceLanguagePreference()
API to access the interface language preference for the request Order of evaluation is: Language of the wiki in mono-lingual mode language request paramater language in context language user preference language in cookie language accepted by the navigator |
|
String |
getLanguagePreference()
First try to find the current language in use from the XWiki context. |
|
String |
getLocalUserName(String user)
API to retrieve a link to the User Name page displayed for the first name and last name of the user. |
|
String |
getLocalUserName(String user,
boolean link)
API to retrieve a text representing the user with the first name and last name of the user. |
|
String |
getLocalUserName(String user,
String format)
API to retrieve a link to the User Name page displayed with a custom view. |
|
String |
getLocalUserName(String user,
String format,
boolean link)
API to retrieve a text representing the user with a custom view. |
|
String |
getMacroList()
API to get the macro list from the XWiki Preferences The macro list are the macros available from the Macro Mapping System |
|
MetaClass |
getMetaclass()
Get the global MetaClass object |
|
Object |
getObjectFromRequest(String className)
API to create an object from the request The parameters are the ones that are created from doc.display("field","edit") calls |
|
Api |
getPlugin(String name)
Returns a plugin from the plugin API. |
|
PropertyClass |
getPropertyClassFromName(String propPath)
API to get the Property object from a class based on a property path A property path looks like XWiki.ArticleClass_fieldname |
|
QueryManager |
getQueryManager()
Deprecated. since XE 2.4M2 use the Query Manager Script Service |
|
String |
getRefererText(String referer)
API to retrieve a viewable referer text for a referer Referers are URL where users have clicked on a link to an XWiki page Search engine referer URLs are transformed to a nicer view (Google: search query string) For other URL the http:// part is stripped |
|
String |
getRelativeRequestURL()
API Allowing to access the current request URL being requested as a relative URL. |
|
String |
getRequestURL()
API Allowing to access the current request URL being requested. |
|
long |
getSectionEditingDepth()
|
|
String |
getServletPath()
API to get the Servlet path for the current wiki. |
|
String |
getServletPath(String wikiName)
API to get the Servlet path for a given wiki. |
|
String |
getShortRefererText(String referer,
int length)
API to retrieve a viewable referer text for a referer with a maximum length Referers are URL where users have clicked on a link to an XWiki page Search engine referer URLs are transformed to a nicer view (Google: search query string) For other URL the http:// part is stripped |
|
String |
getSkin()
API to retrieve the current skin for this request and user The skin is first derived from the request "skin" parameter If this parameter does not exist, the user preference "skin" is looked up If this parameter does not exist or is empty, the space preference "skin" is looked up If this parameter does not exist or is empty, the XWiki preference "skin" is looked up If this parameter does not exist or is empty, the xwiki.cfg parameter xwiki.defaultskin is looked up If this parameter does not exist or is empty, the xwiki.cfg parameter xwiki.defaultbaseskin is looked up If this parameter does not exist or is empty, the skin is "colibri" |
|
String |
getSkinFile(String filename)
Return the URL of the static file provided by the current skin The file is first looked in the skin active for the user, the space or the wiki. |
|
String |
getSkinFile(String filename,
boolean forceSkinAction)
Return the URL of the static file provided by the current skin The file is first looked in the skin active for the user, the space or the wiki. |
|
String |
getSkinPreference(String preference)
API to access a Skin Preference The skin object is the current user's skin |
|
String |
getSkinPreference(String preference,
String defaultValue)
API to access a Skin Preference The skin object is the current user's skin |
|
String |
getSpaceCopyright()
API to access the copyright for this space. |
|
List<String> |
getSpaceDocsName(String SpaceName)
API to list all documents in a space |
|
String |
getSpacePreference(String preference)
API to access an Space Preference There can be one preference object per language This function will find the right preference object associated to the current active language If no preference is found it will look in the XWiki Preferences |
|
String |
getSpacePreference(String preference,
String defaultValue)
API to access an Space Preference There can be one preference object per language This function will find the right preference object associated to the current active language If no preference is found it will look in the XWiki Preferences |
|
int |
getSpacePreferenceAsInt(String preference)
API to access a Space Preference as a int number There can be one preference object per language This function will find the right preference object associated to the current active language If no preference is found it will look for the XWiki Preference |
|
int |
getSpacePreferenceAsInt(String preference,
int defaultValue)
API to access a space Preference as a int number There can be one preference object per language This function will find the right preference object associated to the current active language If no preference is found it will look for the XWiki Preference |
|
long |
getSpacePreferenceAsLong(String preference)
API to access a Space Preference as a long number There can be one preference object per language This function will find the right preference object associated to the current active language If no preference is found it will look for the XWiki Preference |
|
long |
getSpacePreferenceAsLong(String preference,
long defaultValue)
API to access a Space Preference as a long number There can be one preference object per language This function will find the right preference object associated to the current active language If no preference is found it will look for the XWiki Preference |
|
String |
getSpacePreferenceFor(String preference,
String space)
API to access an Space Preference There can be one preference object per language This function will find the right preference object associated to the current active language If no preference is found it will look in the XWiki Preferences |
|
String |
getSpacePreferenceFor(String preference,
String space,
String defaultValue)
API to access an XWiki Preference as a long number There can be one preference object per language This function will find the right preference object associated to the current active language |
|
List<String> |
getSpaces()
API to list the current spaces in thiswiki |
|
StatsService |
getStatsService()
Access statistics api |
|
String |
getTextArea(String content)
Output content in the edit content textarea |
|
String |
getUniquePageName(String name)
Generates a unique page name based on initial page name and already existing pages |
|
String |
getUniquePageName(String space,
String name)
Generates a unique page name based on initial page name and already existing pages |
|
String |
getURL(DocumentReference reference)
API to retrieve the URL of an a Wiki Document in view mode The URL is generated differently depending on the environement (Servlet, Portlet, PDF, etc..) The URL generation can be modified by implementing a new XWikiURLFactory object For compatibility with any target environement (and especially the portlet environment) It is important to always use the URL functions to generate URL and never hardcode URLs |
|
String |
getURL(DocumentReference reference,
String action,
String querystring)
API to retrieve the URL of a Wiki Document in any mode, optionally adding a query string The URL is generated differently depending on the environment (Servlet, Portlet, PDF, etc..) The URL generation can be modified by implementing a new XWikiURLFactory object. |
|
String |
getURL(String fullname)
API to retrieve the URL of an a Wiki Document in view mode The URL is generated differently depending on the environement (Servlet, Portlet, PDF, etc..) The URL generation can be modified by implementing a new XWikiURLFactory object For compatibility with any target environement (and especially the portlet environment) It is important to always use the URL functions to generate URL and never hardcode URLs |
|
String |
getURL(String fullname,
String action)
API to retrieve the URL of an a Wiki Document in any mode. |
|
String |
getURL(String fullname,
String action,
String querystring)
API to retrieve the URL of a Wiki Document in any mode, optionally adding a query string The URL is generated differently depending on the environment (Servlet, Portlet, PDF, etc..) The URL generation can be modified by implementing a new XWikiURLFactory object. |
|
String |
getURL(String fullname,
String action,
String querystring,
String anchor)
API to retrieve the URL of an a Wiki Document in any mode, optionally adding an anchor. |
|
String |
getURLContent(String surl)
Returns the content of an HTTP/HTTPS URL |
|
String |
getURLContent(String surl,
int timeout)
Returns the content of an HTTP/HTTPS URL |
|
String |
getURLContent(String surl,
String username,
String password)
Returns the content of an HTTP/HTTPS URL protected using Basic Authentication |
|
String |
getURLContent(String surl,
String username,
String password,
int timeout)
Returns the content of an HTTP/HTTPS URL protected using Basic Authentication |
|
byte[] |
getURLContentAsBytes(String surl)
Returns the content of an HTTP/HTTPS URL as Bytes |
|
byte[] |
getURLContentAsBytes(String surl,
String username,
String password)
Returns the content of an HTTP/HTTPS URL protected using Basic Authentication as Bytes |
|
User |
getUser()
|
|
User |
getUser(String username)
|
|
String |
getUserName(String user)
API to retrieve a link to the User Name page displayed for the first name and last name of the user. |
|
String |
getUserName(String user,
boolean link)
API to retrieve a text representing the user with the first name and last name of the user. |
|
String |
getUserName(String user,
String format)
API to retrieve a link to the User Name page displayed with a custom view. |
|
String |
getUserName(String user,
String format,
boolean link)
API to retrieve a text representing the user with a custom view With the link param set to false it will not link to the user page. |
|
String |
getUserPreference(String preference)
API to access a User Preference This function will look in the User profile for the preference If no preference is found it will look in the Space Preferences If no preference is found it will look in the XWiki Preferences |
|
String |
getUserPreferenceFromCookie(String preference)
API to access a User Preference from cookie This function will look in the session cookie for the preference |
|
String |
getUserTimeZone()
|
|
String |
getVersion()
|
|
String |
getWebAppPath()
API to get the webapp path for the current wiki. |
|
List<String> |
getWikiNames()
|
|
String |
getWysiwygToolbars()
API to check if using which toolbars in Wysiwyg editor |
|
XWiki |
getXWiki()
Privileged API allowing to access the underlying main XWiki Object |
|
String |
getXWikiPreference(String preference)
API to access an XWiki Preference There can be one preference object per language This function will find the right preference object associated to the current active language |
|
String |
getXWikiPreference(String preference,
String defaultValue)
API to access an XWiki Preference There can be one preference object per language This function will find the right preference object associated to the current active language |
|
int |
getXWikiPreferenceAsInt(String preference)
API to access an XWiki Preference as a int number There can be one preference object per language This function will find the right preference object associated to the current active language |
|
int |
getXWikiPreferenceAsInt(String preference,
int defaultValue)
API to access an XWiki Preference as an int number There can be one preference object per language This function will find the right preference object associated to the current active language |
|
long |
getXWikiPreferenceAsLong(String preference)
API to access an XWiki Preference as a long number There can be one preference object per language This function will find the right preference object associated to the current active language |
|
long |
getXWikiPreferenceAsLong(String preference,
long defaultValue)
API to access an XWiki Preference as a long number There can be one preference object per language This function will find the right preference object associated to the current active language |
|
boolean |
hasAccessLevel(String level)
API to check rights on the current document for the current user |
|
boolean |
hasAccessLevel(String level,
String user,
String docname)
API to check rights on a document for a given user |
|
boolean |
hasBacklinks()
API to check if the backlinks feature is active Backlinks are activated in xwiki.cfg or in the XWiki Preferences |
|
boolean |
hasEditComment()
API to check if the edit comment feature is active Edit comments are activated in xwiki.cfg or in the XWiki Preferences |
|
boolean |
hasMinorEdit()
API to check if the minor edit feature is active minor edit is activated in xwiki.cfg or in the XWiki Preferences |
|
boolean |
hasRecycleBin()
API to check if the recycle bin feature is active recycle bin is activated in xwiki.cfg or in the XWiki Preferences |
|
boolean |
hasSubWikis()
Convenience method to ask if the current XWiki instance contains subwikis (in addition to the main wiki) |
|
boolean |
hasTags()
API to check if the tags feature is active. |
|
String |
includeForm(String topic)
API to execute a form in the context of an including topic The rendering is evaluated in the context of the including topic All velocity variables are the one of the including topic This api is usually called using #includeForm in a page, which modifies the behavior of "Edit this page" button to direct for Form mode (inline) |
|
String |
includeForm(String topic,
boolean pre)
API to execute a form in the context of an including topic, optionnaly surrounding the content with {pre}{/pre} to avoid future wiki rendering The rendering is evaluated in the context of the including topic All velocity variables are the one of the including topic This api is usually called using #includeForm in a page, which modifies the behavior of "Edit this page" button to direct for Form mode (inline). |
|
String |
includeTopic(String topic)
API to include a topic into another The topic is rendered fully in the context of itself |
|
String |
includeTopic(String topic,
boolean pre)
API to include a topic into another, optionally surrounding the content with {pre}{/pre} to avoid future wiki rendering. |
|
String |
invokeServletAndReturnAsString(String url)
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()
API to check if the edit comment field is shown in the edit form Edit comments are activated in xwiki.cfg or in the XWiki Preferences |
|
boolean |
isEditCommentMandatory()
API to check if the edit comment is mandatory (prompted by Javascript if empty) Edit comments are activated in xwiki.cfg or in the XWiki Preferences |
|
boolean |
isEditCommentSuggested()
API to check if the edit comment is suggested (prompted once by Javascript if empty) Edit comments are activated in xwiki.cfg or in the XWiki Preferences |
|
boolean |
isMultiLingual()
API to check is wiki is multi-lingual |
|
boolean |
isReadOnly()
returns true if xwiki.readonly is set in the configuration file |
|
boolean |
isTitleInCompatibilityMode()
|
|
boolean |
isVirtualMode()
Deprecated. Virtual mode is on by default, starting with XWiki 5.0M2. |
|
String |
parseContent(String content)
API allowing to parse a text content to evaluate velocity scripts |
|
Object |
parseGroovyFromPage(String fullname)
Privileged API to retrieve an object instanciated from groovy code in a String Groovy scripts compilation is cached |
|
Object |
parseGroovyFromPage(String script,
String jarWikiPage)
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)
Privileged API to retrieve an object instantiated from groovy code in a String. |
|
String |
parseMessage()
Deprecated. use LocalizationManager instead. From velocity you can access it
using the $services.localization binding, see LocalizationScriptService |
|
String |
parseTemplate(String template)
API to parse a velocity template provided by the current Skin The template is first looked in the skin active for the user, the space or the wiki. |
|
void |
refreshLinks()
Priviledge API to regenerate the links/backlinks table Normally links and backlinks are stored when a page is modified This function will regenerate all the backlinks This function can be long to run |
|
boolean |
renamePage(Document doc,
String newFullName)
API to rename a page (experimental) Rights are necessary to edit the source and target page All objects and attachments ID are modified in the process to link to the new page name |
|
String |
renderChunk(org.suigeneris.jrcs.diff.delta.Chunk chunk,
boolean source,
Document doc)
API to render a chunk (difference between two versions |
|
String |
renderChunk(org.suigeneris.jrcs.diff.delta.Chunk chunk,
Document doc)
API to render a chunk (difference between two versions |
|
String |
renderTemplate(String template)
API to render a velocity template provided by the current Skin The template is first looked in the skin active for the user, the space or the wiki. |
|
String |
renderText(String text,
Document doc)
API to render a text in the context of a document |
|
void |
resetRenderingEngine()
Priviledged API to reset the rendenring engine This would restore the rendering engine evaluation loop and take into account new configuration parameters |
|
|
search(String wheresql)
Privileged API allowing to run a search on the database returning a list of data This search is send to the store engine (Hibernate HQL, JCR XPATH or other) |
|
|
search(String wheresql,
int nb,
int start)
Privileged API allowing to run a search on the database returning a list of data. |
|
|
search(String parameterizedWhereClause,
int maxResults,
int startOffset,
List<?> parameterValues)
Privileged API allowing to run a search on the database returning a list of data. |
|
|
search(String parameterizedWhereClause,
List<?> parameterValues)
Privileged API allowing to run a search on the database returning a list of data. |
|
List<Attachment> |
searchAttachments(String parametrizedSqlClause,
int nb,
int start,
List<?> parameterValues)
Search attachments by passing HQL where clause values as parameters. |
|
List<String> |
searchDocuments(String wheresql)
API allowing to search for document names matching a query. |
|
List<Document> |
searchDocuments(String wheresql,
boolean distinctbylanguage)
API allowing to search for documents allowing to have mutliple entries per language |
|
List<Document> |
searchDocuments(String wheresql,
boolean distinctbylanguage,
int nb,
int start)
API allowing to search for documents allowing to have multiple entries per language |
|
List<String> |
searchDocuments(String wheresql,
int nb,
int start)
API allowing to search for document names matching a query return only a limited number of elements and skipping the first rows. |
|
List<String> |
searchDocuments(String parameterizedWhereClause,
int maxResults,
int startOffset,
List<?> parameterValues)
Search documents by passing HQL where clause values as parameters. |
|
List<String> |
searchDocuments(String wheresql,
int nb,
int start,
String selectColumns)
Privileged API allowing to search for document names matching a query return only a limited number of elements and skipping the first rows. |
|
List<String> |
searchDocuments(String parameterizedWhereClause,
List<?> parameterValues)
Same as searchDocuments(String, int, int, java.util.List) but returns all rows. |
|
List<String> |
searchDocumentsNames(String wikiName,
String parameterizedWhereClause,
int maxResults,
int startOffset,
List<?> parameterValues)
Search documents in the provided wiki by passing HQL where clause values as parameters. |
|
List<String> |
searchSpacesNames(String parametrizedSqlClause,
int nb,
int start,
List<?> parameterValues)
Search spaces by passing HQL where clause values as parameters. |
|
void |
sendConfirmationMail(String xwikiname,
String password,
String email,
String contentfield)
Priviledged API to send a confirmation email to a user |
|
void |
sendConfirmationMail(String xwikiname,
String password,
String email,
String add_message,
String contentfield)
Priviledged API to send a confirmation email to a user |
|
void |
setReadOnly(boolean ro)
Privileged API to set/unset the readonly status of the Wiki After setting this to true no writing to the database will be performed All Edit buttons will be removed and save actions disabled This is used for maintenance purposes |
|
int |
validateUser(boolean withConfirmEmail)
Priviledged API to validate the return code given by a user in response to an email validation email The validation information are taken from the request object |
|
List<Document> |
wrapDocs(List<?> docs)
Function to wrap a list of XWikiDocument into Document objects |
Methods inherited from class com.xpn.xwiki.api.Api |
---|
convert, convert, convert, convertAttachments, getXWikiContext, hasAccessLevel, hasAdminRights, hasProgrammingRights, hasWikiAdminRights |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final org.slf4j.Logger LOGGER
Constructor Detail |
---|
public XWiki(XWiki xwiki, XWikiContext context)
xwiki
- XWiki Main Object to wrapcontext
- XWikiContext to wrapMethod Detail |
---|
@Programming public XWiki getXWiki()
public String getVersion()
(version).(SVN build number)
, or "Unknown version" if it
failed to be retrievedpublic String getRequestURL() throws XWikiException
XWikiException
- failed to create the URLpublic String getRelativeRequestURL() throws XWikiException
XWikiException
- failed to create the URLpublic Document getDocument(String fullName) throws XWikiException
fullName
- the full name of the XWiki document to be loaded
Document.isNew()
XWikiException
public Document getDocument(DocumentReference reference) throws XWikiException
reference
- the reference of the XWiki document to be loaded
Document.isNew()
XWikiException
public Document getDocumentAsAuthor(String fullName) throws XWikiException
fullName
- the full name of the XWiki document to be loaded
Document.isNew()
XWikiException
public Document getDocumentAsAuthor(DocumentReference reference) throws XWikiException
reference
- the reference of the XWiki document to be loaded
Document.isNew()
XWikiException
public List<DeletedDocument> getDeletedDocuments(String fullname, String lang) throws XWikiException
fullname
- the name
of the document to search for.lang
- an optional language
to filter results.
XWikiException
- if any errorpublic DeletedDocument getDeletedDocument(String fullname, String lang, String index) throws XWikiException
fullname
- - XWikiDocument.getFullName()
lang
- - XWikiDocument.getLanguage()
XWikiException
- if any errorpublic List<DeletedAttachment> getDeletedAttachments(String docName)
docName
- the name
of the owner document
public List<DeletedAttachment> getDeletedAttachments(String docName, String filename)
docName
- the name of the document
the attachment belonged tofilename
- the name
of the attachment to search for
public DeletedAttachment getDeletedAttachment(String id)
id
- the unique identifier of the entry in the trash
null
if not foundpublic boolean exists(String fullname) throws XWikiException
fullname
- Fullname of the XWiki document to be loaded
XWikiException
public boolean exists(DocumentReference reference) throws XWikiException
reference
- the reference of the document to check for its existence
XWikiException
public boolean checkAccess(String docname, String right)
docname
- fullname of the documentright
- right to check ("view", "edit", "admin", "delete")
public Document getDocument(String space, String fullname) throws XWikiException
space
- Space to use in case no space is defined in the provided fullname
fullname
- the full name or relative name of the document to load
Document.isNew()
XWikiException
public Document getDocument(Document doc, String rev) throws XWikiException
doc
- Document for which to load a specific revisionrev
- Revision number
XWikiException
public String getTextArea(String content)
content
- content to output
public List<String> getClassList() throws XWikiException
XWikiException
public MetaClass getMetaclass()
public <T> List<T> search(String wheresql) throws XWikiException
wheresql
- Query to be run (HQL, XPath)
XWikiException
public <T> List<T> search(String parameterizedWhereClause, List<?> parameterValues) throws XWikiException
parameterizedWhereClause
- query to be run (HQL)parameterValues
- the where clause values that replace the question marks
XWikiDocument
, String
,
Integer
, etc.), or Object[]
if more than one column was selected
XWikiException
public <T> List<T> search(String wheresql, int nb, int start) throws XWikiException
wheresql
- Query to be run (HQL, XPath)nb
- return only 'nb' rowsstart
- skip the 'start' first elements
XWikiException
public <T> List<T> search(String parameterizedWhereClause, int maxResults, int startOffset, List<?> parameterValues) throws XWikiException
parameterizedWhereClause
- query to be run (HQL)maxResults
- maximum number of results to return; if 0 all results are returnedstartOffset
- skip the first N results; if 0 no items are skippedparameterValues
- the where clause values that replace the question marks
XWikiDocument
, String
,
Integer
, etc.), or Object[]
if more than one column was selected
XWikiException
public List<String> searchDocuments(String wheresql) throws XWikiException
where doc.space='Main' order by doc.creationDate desc
. Result: All the documents in space
'Main' ordered by the creation date from the most recentwhere doc.name like '%sport%' order by doc.name asc
. Result: All the documents containing
'sport' in their name ordered by document namewhere doc.content like '%sport%' order by doc.author
Result: All the documents containing
'sport' in their content ordered by the authorwhere doc.creator = 'XWiki.LudovicDubost' order by doc.creationDate
desc
. Result: All the documents with creator LudovicDubost ordered by the creation date from the
most recentwhere doc.author = 'XWiki.LudovicDubost' order by doc.date desc
. Result: All the
documents with last author LudovicDubost ordered by the last modification date from the most recent.,BaseObject as obj where doc.fullName=obj.name and
obj.className='XWiki.XWikiComments' order by doc.date desc
. Result: All the documents with at least
one comment ordered by the last modification date from the most recent,BaseObject as obj, StringProperty as prop where
doc.fullName=obj.name and obj.className='XWiki.XWikiComments' and obj.id=prop.id.id
and prop.id.name='author' and prop.value='XWiki.LudovicDubost' order by doc.date
desc
. Result: All the documents with at least one comment from LudovicDubost ordered by the last
modification date from the most recent
wheresql
- Query to be run (either starting with ", BaseObject as obj where.." or by "where ..."
XWikiException
public int countDocuments(String wheresql) throws XWikiException
wheresql
- Query to use, similar to the ones accepted by searchDocuments(String)
. If possible, it
should not contain order by
or group
clauses, since this kind of queries are
not portable.
XWikiException
- if there was a problem executing the query.public List<String> searchDocuments(String wheresql, int nb, int start) throws XWikiException
wheresql
- query to use similar to searchDocuments(wheresql)nb
- return only 'nb' rowsstart
- skip the first 'start' rows
XWikiException
searchDocuments(String where sql)
public List<String> searchDocuments(String wheresql, int nb, int start, String selectColumns) throws XWikiException
wheresql
- query to use similar to searchDocuments(wheresql)nb
- return only 'nb' rowsstart
- skip the first 'start' rowsselectColumns
- List of columns to add to the result
XWikiException
public List<Document> searchDocuments(String wheresql, boolean distinctbylanguage) throws XWikiException
wheresql
- query to use similar to searchDocuments(wheresql)distinctbylanguage
- true to return multiple rows per language
XWikiException
public List<Document> searchDocuments(String wheresql, boolean distinctbylanguage, int nb, int start) throws XWikiException
wheresql
- query to use similar to searchDocuments(wheresql)distinctbylanguage
- true to return multiple rows per languagenb
- return only 'nb' rowsstart
- skip the first 'start' rows
XWikiException
public List<String> searchDocuments(String parameterizedWhereClause, int maxResults, int startOffset, List<?> parameterValues) throws XWikiException
Example
<code> #set($orphans = $xwiki.searchDocuments(" where doc.fullName <> ? and (doc.parent = ? or " + "(doc.parent = ? and doc.space = ?))", ["${doc.fullName}as", ${doc.fullName}, ${doc.name}, ${doc.space}])) </code>
parameterizedWhereClause
- the HQL where clause. For example " where doc.fullName
<> ? and (doc.parent = ? or (doc.parent = ? and doc.space = ?))"
maxResults
- the number of rows to return. If 0 then all rows are returnedstartOffset
- the number of rows to skip. If 0 don't skip any rowparameterValues
- the where clause values that replace the question marks (?)
XWikiException
- in case of error while performing the querypublic List<String> searchDocuments(String parameterizedWhereClause, List<?> parameterValues) throws XWikiException
searchDocuments(String, int, int, java.util.List)
but returns all rows.
XWikiException
searchDocuments(String, int, int, java.util.List)
public int countDocuments(String parameterizedWhereClause, List<?> parameterValues) throws XWikiException
parameterizedWhereClause
- the parameterized query to use, similar to the ones accepted by
searchDocuments(String, List)
. If possible, it should not contain order by
or
group
clauses, since this kind of queries are not portable.parameterValues
- The parameter values that replace the question marks.
XWikiException
- if there was a problem executing the query.public List<String> searchDocumentsNames(String wikiName, String parameterizedWhereClause, int maxResults, int startOffset, List<?> parameterValues) throws XWikiException
searchDocuments(String, int, int, java.util.List)
for more details.
wikiName
- the name of the wiki where to search.parameterizedWhereClause
- the HQL where clause. For example " where doc.fullName
<> ? and (doc.parent = ? or (doc.parent = ? and doc.space = ?))"
maxResults
- the number of rows to return. If 0 then all rows are returnedstartOffset
- the number of rows to skip. If 0 don't skip any rowparameterValues
- the where clause values that replace the question marks (?)
XWikiException
- in case of error while performing the querysearchDocuments(String, int, int, java.util.List)
public List<String> searchSpacesNames(String parametrizedSqlClause, int nb, int start, List<?> parameterValues) throws XWikiException
searchDocuments(String, int, int, List)
for more about parameterized hql clauses.
parametrizedSqlClause
- the HQL where clause. For example " where doc.fullName
<> ? and (doc.parent = ? or (doc.parent = ? and doc.space = ?))"
nb
- the number of rows to return. If 0 then all rows are returnedstart
- the number of rows to skip. If 0 don't skip any rowparameterValues
- the where clause values that replace the question marks (?)
XWikiException
- in case of error while performing the query@Unstable public List<Attachment> searchAttachments(String parametrizedSqlClause, int nb, int start, List<?> parameterValues) throws XWikiException
searchDocuments(String, int, int, List)
for more about parameterized hql clauses.
You can specify properties of attach (the attachment) or doc (the document it is attached to)
parametrizedSqlClause
- The HQL where clause. For example " where doc.fullName
<> ? and (attach.author = ? or (attach.filename = ? and doc.space = ?))"
nb
- The number of rows to return. If 0 then all rows are returnedstart
- The number of rows to skip at the beginning.parameterValues
- A List
of the where clause values that replace the question marks (?)
Attachment
objects.
XWikiException
- in case of error while performing the query@Unstable public int countAttachments(String parametrizedSqlClause, List<?> parameterValues) throws XWikiException
parametrizedSqlClause
- Everything which would follow the "WHERE" in HQL see: searchDocuments(String, int, int, List)
parameterValues
- A List
of the where clause values that replace the question marks (?)
XWikiException
searchAttachments(String, int, int, List)
public List<Document> wrapDocs(List<?> docs)
docs
- list of XWikiDocument
public String parseContent(String content)
content
-
public String parseTemplate(String template)
template
- Template name ("view", "edit", "comment")
public String renderTemplate(String template)
template
- Template name ("view", "edit", "comment")
public String invokeServletAndReturnAsString(String url)
url
- URL of the servlet
public String getSkinFile(String filename)
filename
- Filename to be looked up in the skin (logo.gif, style.css)
public String getSkinFile(String filename, boolean forceSkinAction)
filename
- Filename to be looked up in the skin (logo.gif, style.css)forceSkinAction
- true to make sure that static files are retrieved through the skin action, to allow
parsing of velocity on CSS files
public String getSkin()
public String getBaseSkin()
public String getSpaceCopyright()
public String getXWikiPreference(String preference)
preference
- Preference name
public String getXWikiPreference(String preference, String defaultValue)
preference
- Preference namedefaultValue
- default value to return if the prefenrece does not exist or is empty
public String getSpacePreference(String preference)
preference
- Preference name
public String getSpacePreferenceFor(String preference, String space)
preference
- Preference namespace
- The space for which this preference is requested
public String getSpacePreference(String preference, String defaultValue)
preference
- Preference namedefaultValue
- default value to return if the preference does not exist or is empty
public String getSkinPreference(String preference)
preference
- Preference name
public String getSkinPreference(String preference, String defaultValue)
preference
- Preference namedefaultValue
- default value to return if the preference does not exist or is empty
public String getSpacePreferenceFor(String preference, String space, String defaultValue)
preference
- Preference namespace
- The space for which this preference is requesteddefaultValue
- default value to return if the prefenrece does not exist or is empty
public long getXWikiPreferenceAsLong(String preference, long defaultValue)
preference
- Preference namedefaultValue
- default value to return if the prefenrece does not exist or is empty
public long getXWikiPreferenceAsLong(String preference)
preference
- Preference name
public long getSpacePreferenceAsLong(String preference, long defaultValue)
preference
- Preference namedefaultValue
- default value to return if the prefenrece does not exist or is empty
public long getSpacePreferenceAsLong(String preference)
preference
- Preference name
public int getXWikiPreferenceAsInt(String preference, int defaultValue)
preference
- Preference namedefaultValue
- default value to return if the prefenrece does not exist or is empty
public int getXWikiPreferenceAsInt(String preference)
preference
- Preference name
public int getSpacePreferenceAsInt(String preference, int defaultValue)
preference
- Preference namedefaultValue
- default value to return if the prefenrece does not exist or is empty
public int getSpacePreferenceAsInt(String preference)
preference
- Preference name
public String getUserPreference(String preference)
preference
- Preference name
public String getUserPreferenceFromCookie(String preference)
preference
- Preference name
public String getLanguagePreference()
public String getInterfaceLanguagePreference()
public boolean isVirtualMode()
public List<String> getWikiNames()
XWiki.getVirtualWikisDatabaseNames(XWikiContext)
public boolean hasSubWikis()
getWikiNames()
public boolean isMultiLingual()
public void flushCache()
public void resetRenderingEngine()
public int createUser() throws XWikiException
XWikiException
public int createUser(boolean withValidation) throws XWikiException
withValidation
- true to send the validationemail
XWikiException
public int createUser(boolean withValidation, String userRights) throws XWikiException
withValidation
- true to send the validation emailuserRights
- Rights to set for the user for it's own page(defaults to "edit")
XWikiException
public int validateUser(boolean withConfirmEmail) throws XWikiException
withConfirmEmail
- true to send a account confirmation email/false to not send it
XWikiException
public void addToAllGroup(String fullwikiname) throws XWikiException
fullwikiname
- user name to add
XWikiException
public void sendConfirmationMail(String xwikiname, String password, String email, String add_message, String contentfield) throws XWikiException
xwikiname
- user to send the email topassword
- password to put in the mailemail
- email to send toadd_message
- Additional message to send to the usercontentfield
- Preference field to use as a mail template
XWikiException
- if the mail was not send successfullypublic void sendConfirmationMail(String xwikiname, String password, String email, String contentfield) throws XWikiException
xwikiname
- user to send the email topassword
- password to put in the mailemail
- email to send tocontentfield
- Preference field to use as a mail template
XWikiException
- if the mail was not send successfullypublic boolean copyDocument(String docname, String targetdocname) throws XWikiException
docname
- source documenttargetdocname
- target document
XWikiException
- if the document was not copied properlypublic boolean copyDocument(String docname, String targetdocname, String wikilanguage) throws XWikiException
docname
- source documenttargetdocname
- target documentwikilanguage
- language to copy
XWikiException
- if the document was not copied properlypublic boolean copyDocument(String docname, String sourceWiki, String targetWiki, String wikilanguage) throws XWikiException
docname
- source documentsourceWiki
- source wikitargetWiki
- target wikiwikilanguage
- language to copy
XWikiException
- if the document was not copied properlypublic boolean copyDocument(String docname, String targetdocname, String sourceWiki, String targetWiki, String wikilanguage, boolean reset) throws XWikiException
docname
- source documentsourceWiki
- source wikitargetWiki
- target wikiwikilanguage
- language to copyreset
- true to reset versions
XWikiException
- if the document was not copied properlypublic boolean copyDocument(String docname, String targetdocname, String sourceWiki, String targetWiki, String wikilanguage, boolean reset, boolean force) throws XWikiException
docname
- source document nametargetdocname
- target document namesourceWiki
- source wikitargetWiki
- target wikiwikilanguage
- language to copyreset
- true to reset versionsforce
- true to overwrite the previous document
XWikiException
- if the document was not copied properlypublic boolean copyDocument(DocumentReference sourceDocumentReference, DocumentReference targetDocumentReference, String wikilanguage, boolean resetHistory, boolean overwrite) throws XWikiException
sourceDocumentReference
- the reference to the document to copytargetDocumentReference
- the reference to the document to createwikilanguage
- language to copyresetHistory
- true
to reset versionsoverwrite
- true
to overwrite the previous document
true
if the copy was sucessful
XWikiException
- if the document was not copied properlypublic int copySpaceBetweenWikis(String space, String sourceWiki, String targetWiki, String language, boolean clean) throws XWikiException
space
- source SpacesourceWiki
- source WikitargetWiki
- target Wikilanguage
- language to copyclean
- true to delete all document of the target space
XWikiException
- if the space was not copied properlypublic String includeTopic(String topic) throws XWikiException
topic
- page name of the topic to include
XWikiException
- if the include failedpublic String includeForm(String topic) throws XWikiException
topic
- page name of the form to execute
XWikiException
- if the include failedpublic String includeTopic(String topic, boolean pre) throws XWikiException
topic
- page name of the topic to includepre
- true to add {pre} {/pre} (only if includer document is 1.0 syntax)
XWikiException
- if the include failedpublic String includeForm(String topic, boolean pre) throws XWikiException
topic
- page name of the form to executepre
- true to add {pre} {/pre} (only if includer document is 1.0 syntax)
XWikiException
- if the include failedpublic boolean hasAccessLevel(String level)
level
- right to check (view, edit, comment, delete)
public boolean hasAccessLevel(String level, String user, String docname)
level
- right to check (view, edit, comment, delete)user
- user for which to check the rightdocname
- document on which to check the rights
public String renderText(String text, Document doc) throws XWikiException
text
- text to renderdoc
- the text is evaluated in the content of this document
XWikiException
- if the evaluation went wrongpublic String renderChunk(org.suigeneris.jrcs.diff.delta.Chunk chunk, Document doc)
chunk
- difference between versions to renderdoc
- document to use as a context for rendering
public String renderChunk(org.suigeneris.jrcs.diff.delta.Chunk chunk, boolean source, Document doc)
chunk
- difference between versions to renderdoc
- document to use as a context for renderingsource
- true to render the difference as wiki source and not as wiki rendered text
public List<String> getSpaces() throws XWikiException
XWikiException
- if something went wrongpublic List<String> getSpaceDocsName(String SpaceName) throws XWikiException
SpaceName
- space tolest
XWikiException
- if the loading went wrongpublic String getEncoding()
public String getAttachmentURL(String fullname, String filename) throws XWikiException
fullname
- page name which includes the attached filefilename
- attached filename to create a link for
XWikiException
- if the URL could not be generated properlypublic String getURL(String fullname) throws XWikiException
fullname
- the name of the document for which to return the URL for
XWikiException
- if the URL could not be generated properlypublic String getURL(DocumentReference reference) throws XWikiException
reference
- the reference to the document for which to return the URL for
XWikiException
- if the URL could not be generated properlypublic String getURL(String fullname, String action) throws XWikiException
fullname
- the page name which includes the attached fileaction
- the mode in which to access the document (view/edit/save/..). Any valid XWiki action is possible.
XWikiException
- if the URL could not be generated properlypublic String getURL(String fullname, String action, String querystring) throws XWikiException
fullname
- the page name which includes the attached fileaction
- the mode in which to access the document (view/edit/save/..). Any valid XWiki action is possiblequerystring
- the Query String to provide in the usual mode (name1=value1&name2=value=2) including encoding
XWikiException
- if the URL could not be generated properlypublic String getURL(DocumentReference reference, String action, String querystring) throws XWikiException
reference
- the reference to the document for which to return the URL foraction
- the mode in which to access the document (view/edit/save/..). Any valid XWiki action is possiblequerystring
- the Query String to provide in the usual mode (name1=value1&name2=value=2) including encoding
XWikiException
- if the URL could not be generated properlypublic String getURL(String fullname, String action, String querystring, String anchor) throws XWikiException
fullname
- the page name which includes the attached fileaction
- the mode in which to access the document (view/edit/save/..). Any valid XWiki action is possiblequerystring
- the Query String to provide in the usual mode (name1=value1&name2=value=2) including encodinganchor
- the anchor that points at a location within the passed document name
XWikiException
- if the URL could not be generated properly@Deprecated public DocumentStats getCurrentMonthXWikiStats(String action)
getStatsService()
instead
action
- action for which to retrieve statistics (view/save/download)
public String getRefererText(String referer)
referer
- referer URL to transform
public String getShortRefererText(String referer, int length)
referer
- referer URL to transformlength
- Maximum length. "..." is added to the end of the text
@Deprecated public String getFullNameSQL()
public String getUserName(String user)
user
- Fully qualified username as retrieved from $context.user (XWiki.LudovicDubost)
public String getUserName(String user, String format)
user
- Fully qualified username as retrieved from $context.user (XWiki.LudovicDubost)format
- formatting to be used ("$first_name $last_name", "$first_name")
public String getLocalUserName(String user)
user
- Fully qualified username as retrieved from $context.user (XWiki.LudovicDubost)
public String getLocalUserName(String user, String format)
user
- Fully qualified username as retrieved from $context.user (XWiki.LudovicDubost)format
- formatting to be used ("$first_name $last_name", "$first_name")
public String getUserName(String user, boolean link)
user
- Fully qualified username as retrieved from $context.user (XWiki.LudovicDubost)link
- false to not add an HTML link to the user profile
public String getUserName(String user, String format, boolean link)
user
- Fully qualified username as retrieved from $context.user (XWiki.LudovicDubost)format
- formatting to be used ("$first_name $last_name", "$first_name")link
- false to not add an HTML link to the user profile
public String getLocalUserName(String user, boolean link)
user
- Fully qualified username as retrieved from $context.user (XWiki.LudovicDubost)link
- false to not add an HTML link to the user profile
public String getLocalUserName(String user, String format, boolean link)
user
- Fully qualified username as retrieved from $context.user (XWiki.LudovicDubost)format
- formatting to be used ("$first_name $last_name", "$first_name")link
- false to not add an HTML link to the user profile
public User getUser()
public User getUser(String username)
public String formatDate(Date date)
date
- date object to format
public String formatDate(Date date, String format)
date
- date to formatformat
- format of the date to be used
SimpleDateFormat
public String getUserTimeZone()
public Api get(String name)
getPlugin(String)
it used to provide an easy access from Velocity to XWiki plugins. Indeed Velocity
has a feature in that if a class has a get method, using the dot notation will automatically call the get method
for the class. See http://velocity.apache.org/engine/releases/velocity-1.5/user-guide.html#propertylookuprules.
This this allows the following constructs: $xwiki.pluginName.somePluginMethod()
name
- Name of the plugin to retrieve (either short of full class name)
public Api getPlugin(String name)
name
- Name of the plugin to retrieve (either short of full class name)
public String getAdType()
public String getAdClientId()
public String getURLContent(String surl, String username, String password) throws IOException
surl
- url to retrieveusername
- username for the basic authenticationpassword
- password for the basic authentication
IOException
public String getURLContent(String surl) throws IOException
surl
- url to retrieve
IOException
public String getURLContent(String surl, String username, String password, int timeout) throws IOException
surl
- url to retrieveusername
- username for the basic authenticationpassword
- password for the basic authenticationtimeout
- manuel timeout in milliseconds
IOException
public String getURLContent(String surl, int timeout) throws IOException
surl
- url to retrievetimeout
- manuel timeout in milliseconds
IOException
public byte[] getURLContentAsBytes(String surl, String username, String password) throws IOException
surl
- url to retrieveusername
- username for the basic authenticationpassword
- password for the basic authentication
IOException
public byte[] getURLContentAsBytes(String surl) throws IOException
surl
- url to retrieve
IOException
public List<String> getIncludedMacros(String defaultSpace, String content)
defaultSpace
- Default space to use for relative path namescontent
- Content to parse
public boolean isReadOnly()
XWiki
public void setReadOnly(boolean ro)
ro
- true to set read-only mode/false to unsetpublic void refreshLinks() throws XWikiException
XWikiException
- exception if the generation failspublic boolean hasBacklinks() throws XWikiException
XWikiException
- exception if the preference could not be retrievedpublic boolean hasTags() throws XWikiException
XWikiException
- exception if the preference could not be retrievedpublic boolean hasEditComment()
public boolean isEditCommentFieldHidden()
public boolean isEditCommentSuggested()
public boolean isEditCommentMandatory()
public boolean hasMinorEdit()
public boolean hasRecycleBin()
public boolean renamePage(Document doc, String newFullName)
doc
- page to renamenewFullName
- target page name to move the information topublic String getEditorPreference()
public Object parseGroovyFromString(String script) throws XWikiException
script
- the Groovy class definition string (public class MyClass { ... })
XWikiException
public Object parseGroovyFromPage(String script, String jarWikiPage) throws XWikiException
script
- the Groovy class definition string (public class MyClass { ... })
XWikiException
public Object parseGroovyFromPage(String fullname) throws XWikiException
fullname
- // script containing a Groovy class definition (public class MyClass { ... })
XWikiException
public String getMacroList()
public String getWysiwygToolbars()
public Object getObjectFromRequest(String className) throws XWikiException
className
- XWiki Class Name to create the object from
XWikiException
- exception if the object could not be readpublic Document createDocument()
public String convertUsername(String username)
username
- username to use for login
public PropertyClass getPropertyClassFromName(String propPath)
propPath
- Property path
public String getUniquePageName(String name)
name
-
public String getUniquePageName(String space, String name)
space
- name
-
public String addTooltip(String html, String message, String params)
html
- HTML viewedmessage
- HTML Tooltip messageparams
- Parameters in Javascropt added to the tooltip config
public String addTooltip(String html, String message)
html
- HTML viewedmessage
- HTML Tooltip message
public String addTooltipJS()
public String addMandatory()
public Class getClass(String documentName) throws XWikiException
Note: This method doesn't require any rights for accessing the passed Document (as opposed to the
Object.getClass()
method which does require to get a Document object first. This is
thus useful in cases where the calling code doesn't have the access right to the specified Document. It is safe
because there are no sensitive data stored in a Class definition.
documentName
- the name of the document for which to get the Class object. For example
"XWiki.XWikiPreferences"
XWikiException
- if the passed document name doesn't point to a valid Documentpublic String getCounter(String name)
name
- Counter name
public XWikiUser checkAuth() throws XWikiException
XWikiException
public XWikiUser checkAuth(String username, String password, String rememberme) throws XWikiException
username
- username to checkpassword
- password to checkrememberme
- "1" if you want to remember the login accross navigator restart
XWikiException
public StatsService getStatsService()
public CriteriaService getCriteriaService()
public List<String> getConfiguredSyntaxes()
@Deprecated public QueryManager getQueryManager()
QueryManager
for execute queries to store.public String getServletPath(String wikiName)
wikiName
- wiki for which to get the path
public String getServletPath()
public String getWebAppPath()
public String getDefaultDocumentSyntax()
public org.xwiki.rendering.syntax.Syntax getAvailableRendererSyntax(String syntaxType, String syntaxVersion)
If syntaxVersion
is null the last version of the available provided syntax type is returned.
syntaxType
- the syntax typesyntaxVersion
- the syntax version
Syntax
. Null if no available renderer can be found.public long getSectionEditingDepth()
xwiki.section.depth
configuration property. Defaults to 2 when not definedpublic boolean isTitleInCompatibilityMode()
public String getCurrentContentSyntaxId()
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).
@Deprecated public String parseMessage()
LocalizationManager
instead. From velocity you can access it
using the $services.localization
binding, see LocalizationScriptService
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |