|
||||||||||
| 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.apache.commons.logging.Log |
LOG
|
| Fields inherited from class com.xpn.xwiki.api.Api |
|---|
context |
| Constructor Summary | |
|---|---|
XWiki(XWiki xwiki,
XWikiContext context)
XWiki API Constructor |
|
| Method Summary | |
|---|---|
java.lang.String |
addMandatory()
|
void |
addToAllGroup(java.lang.String fullwikiname)
Priviledged API to add a user to the XWiki.XWikiAllGroup |
java.lang.String |
addTooltip(java.lang.String html,
java.lang.String message)
Inserts a tooltip using toolTip.js |
java.lang.String |
addTooltip(java.lang.String html,
java.lang.String message,
java.lang.String params)
Inserts a tooltip using toolTip.js |
java.lang.String |
addTooltipJS()
Inserts the tooltip Javascript |
boolean |
checkAccess(java.lang.String docname,
java.lang.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(java.lang.String username,
java.lang.String password,
java.lang.String rememberme)
Check authentication from username and password and set according persitent login information If it fails user is unlogged |
java.lang.String |
convertUsername(java.lang.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(java.lang.String docname,
java.lang.String targetdocname)
Privileged API to copy a document to another document in the same wiki |
boolean |
copyDocument(java.lang.String docname,
java.lang.String targetdocname,
java.lang.String wikilanguage)
Privileged API to copy a translation of a document to another document in the same wiki |
boolean |
copyDocument(java.lang.String docname,
java.lang.String sourceWiki,
java.lang.String targetWiki,
java.lang.String wikilanguage)
Privileged API to copy a translation of a document to another document of the same name in another wiki |
boolean |
copyDocument(java.lang.String docname,
java.lang.String targetdocname,
java.lang.String sourceWiki,
java.lang.String targetWiki,
java.lang.String wikilanguage,
boolean reset)
Privileged API to copy a translation of a document to another document of the same name in another wiki additionally resetting the version |
boolean |
copyDocument(java.lang.String docname,
java.lang.String targetdocname,
java.lang.String sourceWiki,
java.lang.String targetWiki,
java.lang.String wikilanguage,
boolean reset,
boolean force)
Privileged 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 |
copyWikiWeb(java.lang.String web,
java.lang.String sourceWiki,
java.lang.String targetWiki,
java.lang.String wikiLanguage,
boolean clean)
Privileged API to copy a space to another wiki, optionally deleting all document of the target space |
int |
countDocuments(java.lang.String wheresql)
API allowing to count the total number of documents that would be returned by a query. |
int |
countDocuments(java.lang.String parametrizedSqlClause,
java.util.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 |
createNewWiki(java.lang.String wikiName,
java.lang.String wikiUrl,
java.lang.String wikiAdmin,
java.lang.String baseWikiName,
boolean failOnExist)
Priviledged API to create a new Wiki from an existing wiki This creates the database, copies to documents from a existing wiki Assigns the admin rights, creates the Wiki identification page in the main wiki |
int |
createNewWiki(java.lang.String wikiName,
java.lang.String wikiUrl,
java.lang.String wikiAdmin,
java.lang.String baseWikiName,
java.lang.String description,
boolean failOnExist)
Priviledged API to create a new Wiki from an existing wiki This creates the database, copies to documents from a existing wiki Assigns the admin rights, creates the Wiki identification page in the main wiki |
int |
createNewWiki(java.lang.String wikiName,
java.lang.String wikiUrl,
java.lang.String wikiAdmin,
java.lang.String baseWikiName,
java.lang.String description,
java.lang.String language,
boolean failOnExist)
Priviledged API to create a new Wiki from an existing wiki This creates the database, copies to documents from a existing wiki Assigns the admin rights, creates the Wiki identification page in the main wiki Copy is limited to documents of a specified language. |
XWikiQuery |
createQueryFromRequest(java.lang.String className)
API to create a query from a request Object The request object is the result of a form created from the displaySearch() and displaySearchColumns() functions |
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,
java.lang.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 |
java.lang.String |
displaySearch(java.lang.String fieldname,
java.lang.String className)
API to display a field in search mode for a specific class without preselected values This field data can then be used to generate an XWiki Query showing a table with the relevant data |
java.lang.String |
displaySearch(java.lang.String fieldname,
java.lang.String className,
java.lang.String prefix,
XWikiCriteria criteria)
API to display a field in search mode for a specific class with preselected values, optionally adding a prefix to the field name This field data can then be used to generate an XWiki Query showing a table with the relevant data |
java.lang.String |
displaySearch(java.lang.String fieldname,
java.lang.String className,
XWikiCriteria criteria)
API to display a field in search mode for a specific class with preselected values This field data can then be used to generate an XWiki Query showing a table with the relevant data |
java.lang.String |
displaySearchColumns(java.lang.String className,
java.lang.String prefix,
XWikiQuery query)
API to display a select box for the list of available field for a specific class, optionally adding a prefix This field data can then be used to generate an XWiki Query showing a table with the relevant data |
java.lang.String |
displaySearchColumns(java.lang.String className,
XWikiQuery query)
API to display a select box for the list of available field for a specific class This field data can then be used to generate an XWiki Query showing a table with the relevant data |
java.lang.String |
displaySearchOrder(java.lang.String className,
java.lang.String prefix,
XWikiQuery query)
API to display a select box for the list of available field for a specific class, optionally adding a prefix This field data can then be used to generate the order element of an XWiki Query showing a table with the relevant data |
java.lang.String |
displaySearchOrder(java.lang.String className,
XWikiQuery query)
API to display a select box for the list of available field for a specific class This field data can then be used to generate the order element of an XWiki Query showing a table with the relevant data |
boolean |
exists(java.lang.String fullname)
Returns wether 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 |
java.lang.String |
formatDate(java.util.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 |
java.lang.String |
formatDate(java.util.Date date,
java.lang.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(java.lang.String name)
Returns a plugin from the plugin API. |
java.lang.String |
getAdClientId()
Returns the Advertisement client ID from the preferences |
java.lang.String |
getAdType()
Returns the Advertisement system from the preferences |
java.lang.String |
getAttachmentURL(java.lang.String fullname,
java.lang.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 |
java.lang.String |
getBaseSkin()
API to retrieve the current skin for this request and user. |
Class |
getClass(java.lang.String documentName)
Get the XWiki Class object defined in the passed Document name. |
java.util.List<java.lang.String> |
getClassList()
Get the list of available classes in the wiki |
java.util.List<java.lang.String> |
getConfiguredSyntaxes()
|
java.lang.String |
getCounter(java.lang.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. |
DocumentStats |
getCurrentMonthXWikiStats(java.lang.String action)
Deprecated. use getStatsService() instead |
DeletedDocument |
getDeletedDocument(java.lang.String fullname,
java.lang.String lang,
java.lang.String index)
|
java.util.List<DeletedDocument> |
getDeletedDocuments(java.lang.String fullname,
java.lang.String lang)
|
Document |
getDocument(Document doc,
java.lang.String rev)
Load a specific revision of a document |
Document |
getDocument(java.lang.String fullname)
Loads an Document from the database. |
Document |
getDocument(java.lang.String web,
java.lang.String fullname)
Loads an Document from the database. |
java.lang.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 |
java.lang.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 |
java.lang.Object |
getExoPortalService(java.lang.String className)
Privileged API to access an eXo Platform Portal service from the Wiki Engine |
java.lang.Object |
getExoService(java.lang.String className)
Privileged API to access an eXo Platform service from the Wiki Engine |
java.lang.String |
getFormEncoded(java.lang.String content)
Transform a text in a form compatible text |
java.lang.String |
getFullNameSQL()
Deprecated. |
java.lang.String |
getHTMLArea(java.lang.String content)
Output content in the edit content htmlarea |
java.util.List<java.lang.String> |
getIncludedMacros(java.lang.String defaultweb,
java.lang.String content)
Returns the list of Macros documents in the specified content |
java.lang.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 |
java.lang.String |
getLanguagePreference()
First try to find the current language in use from the XWiki context. |
java.lang.String |
getLocalUserName(java.lang.String user)
API to retrieve a link to the User Name page displayed for the first name and last name of the user The link will link to the page on the local wiki even if the user is registered on a different wiki (in virtual wiki mode) |
java.lang.String |
getLocalUserName(java.lang.String user,
boolean link)
API to retrieve a text representing the user with the first name and last name of the user With the link param set to false it will not link to the user page With the link param set to true, the link will link to the page on the local wiki even if the user is registered on a different wiki (in virtual wiki mode) |
java.lang.String |
getLocalUserName(java.lang.String user,
java.lang.String format)
API to retrieve a link to the User Name page displayed with a custom view The link will link to the page on the local wiki even if the user is registered on a different wiki (in virtual wiki mode) The formating is done using the format parameter which can contain velocity scripting and access all properties of the User profile using variables ($first_name $last_name $email $city) |
java.lang.String |
getLocalUserName(java.lang.String user,
java.lang.String format,
boolean link)
API to retrieve a text representing the user with a custom view The formating is done using the format parameter which can contain velocity scripting and access all properties of the User profile using variables ($first_name $last_name $email $city) With the link param set to false it will not link to the user page With the link param set to true, the link will link to the page on the local wiki even if the user is registered on a different wiki (in virtual wiki mode) |
java.lang.String |
getMacroList()
API to get the macro list from the XWiki Preferences The macro list are the macros available from the Macro Mapping System |
java.lang.String |
getMessage(java.lang.String id)
API to get a message A message can be an error message or an information message either as text or as a message ID pointing to ApplicationResources The message is also parsed for velocity scripts |
MetaClass |
getMetaclass()
Get the global MetaClass object |
Object |
getObjectFromRequest(java.lang.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(java.lang.String name)
Returns a plugin from the plugin API. |
PropertyClass |
getPropertyClassFromName(java.lang.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()
|
java.lang.String |
getRefererText(java.lang.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 |
java.lang.String |
getRequestURL()
API Allowing to access the current request URL being requested |
java.lang.String |
getServletPath()
API to get the Servlet path for the current wiki. |
java.lang.String |
getServletPath(java.lang.String wikiName)
API to get the Servlet path for a given wiki. |
java.lang.String |
getShortRefererText(java.lang.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 |
java.lang.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 "albatross" |
java.lang.String |
getSkinFile(java.lang.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. |
java.lang.String |
getSkinFile(java.lang.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. |
java.lang.String |
getSkinPreference(java.lang.String prefname)
API to access a Skin Preference The skin object is the current user's skin |
java.lang.String |
getSkinPreference(java.lang.String prefname,
java.lang.String default_value)
API to access a Skin Preference The skin object is the current user's skin |
java.util.List<java.lang.String> |
getSpaceDocsName(java.lang.String SpaceName)
API to list all documents in a space |
java.util.List<java.lang.String> |
getSpaces()
API to list the current spaces in thiswiki |
StatsService |
getStatsService()
Access statistics api |
java.lang.String |
getTextArea(java.lang.String content)
Output content in the edit content textarea |
java.lang.String |
getUniquePageName(java.lang.String name)
Generates a unique page name based on initial page name and already existing pages |
java.lang.String |
getUniquePageName(java.lang.String space,
java.lang.String name)
Generates a unique page name based on initial page name and already existing pages |
java.lang.String |
getURL(java.lang.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 |
java.lang.String |
getURL(java.lang.String fullname,
java.lang.String action)
API to retrieve the URL of an a Wiki Document in any 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 |
java.lang.String |
getURL(java.lang.String fullname,
java.lang.String action,
java.lang.String querystring)
API to retrieve the URL of an a Wiki Document in any mode, optionally adding a query string 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 The query string will be modified to be added in the way the environement needs it It is important to not add the query string parameter manually after a URL Some environements will not accept this (like the Portlet environement) |
java.lang.String |
getURLContent(java.lang.String surl)
Returns the content of an HTTP/HTTPS URL |
java.lang.String |
getURLContent(java.lang.String surl,
int timeout)
Returns the content of an HTTP/HTTPS URL |
java.lang.String |
getURLContent(java.lang.String surl,
java.lang.String username,
java.lang.String password)
Returns the content of an HTTP/HTTPS URL protected using Basic Authentication |
java.lang.String |
getURLContent(java.lang.String surl,
java.lang.String username,
java.lang.String password,
int timeout)
Returns the content of an HTTP/HTTPS URL protected using Basic Authentication |
byte[] |
getURLContentAsBytes(java.lang.String surl)
Returns the content of an HTTP/HTTPS URL as Bytes |
byte[] |
getURLContentAsBytes(java.lang.String surl,
java.lang.String username,
java.lang.String password)
Returns the content of an HTTP/HTTPS URL protected using Basic Authentication as Bytes |
User |
getUser()
|
User |
getUser(java.lang.String username)
|
java.lang.String |
getUserName(java.lang.String user)
API to retrieve a link to the User Name page displayed for the first name and last name of the user The link will link to the page on the wiki where the user is registered (in virtual wiki mode) |
java.lang.String |
getUserName(java.lang.String user,
boolean link)
API to retrieve a text representing the user with the first name and last name of the user With the link param set to false it will not link to the user page With the link param set to true, the link will link to the page on the wiki where the user was registered (in virtual wiki mode) |
java.lang.String |
getUserName(java.lang.String user,
java.lang.String format)
API to retrieve a link to the User Name page displayed with a custom view The link will link to the page on the wiki where the user is registered (in virtual wiki mode) The formating is done using the format parameter which can contain velocity scripting and access all properties of the User profile using variables ($first_name $last_name $email $city) |
java.lang.String |
getUserName(java.lang.String user,
java.lang.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 With the link param set to true, the link will link to the page on the wiki where the user was registered (in virtual wiki mode) The formating is done using the format parameter which can contain velocity scripting and access all properties of the User profile using variables ($first_name $last_name $email $city) |
java.lang.String |
getUserPreference(java.lang.String prefname)
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 |
java.lang.String |
getUserPreferenceFromCookie(java.lang.String prefname)
API to access a User Preference from cookie This function will look in the session cookie for the preference |
java.lang.String |
getUserTimeZone()
|
java.lang.String |
getVersion()
|
java.lang.String |
getWebAppPath()
API to get the webapp path for the current wiki. |
java.lang.String |
getWebCopyright()
API to access the copyright for this space. |
java.lang.String |
getWebPreference(java.lang.String prefname)
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 |
java.lang.String |
getWebPreference(java.lang.String prefname,
java.lang.String default_value)
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 |
getWebPreferenceAsInt(java.lang.String prefname)
API to access an Web 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 |
getWebPreferenceAsInt(java.lang.String prefname,
int default_value)
API to access an Web 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 |
getWebPreferenceAsLong(java.lang.String prefname)
API to access an Web 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 |
getWebPreferenceAsLong(java.lang.String prefname,
long default_value)
API to access an Web 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 |
java.lang.String |
getWebPreferenceFor(java.lang.String prefname,
java.lang.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 |
java.lang.String |
getWebPreferenceFor(java.lang.String prefname,
java.lang.String space,
java.lang.String default_value)
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 |
java.lang.String |
getWysiwygToolbars()
API to check if using which toolbars in Wysiwyg editor |
java.lang.String |
getXMLEncoded(java.lang.String content)
Transform a text in a XML compatible text |
XWiki |
getXWiki()
Priviledge API allowing to access the underlying main XWiki Object |
java.lang.String |
getXWikiPreference(java.lang.String prefname)
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 |
java.lang.String |
getXWikiPreference(java.lang.String prefname,
java.lang.String default_value)
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(java.lang.String prefname)
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(java.lang.String prefname,
int default_value)
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(java.lang.String prefname)
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(java.lang.String prefname,
long default_value)
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(java.lang.String level)
API to check rights on the current document for the current user |
boolean |
hasAccessLevel(java.lang.String level,
java.lang.String user,
java.lang.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 |
hasTags()
API to check if the tags feature is active. |
java.lang.String |
includeForm(java.lang.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) |
java.lang.String |
includeForm(java.lang.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) |
java.lang.String |
includeTopic(java.lang.String topic)
API to include a topic into another The topic is rendered fully in the context of itself |
java.lang.String |
includeTopic(java.lang.String topic,
boolean pre)
API to include a topic into another, optionnaly surrounding the content with {pre}{/pre} to avoid future wiki rendering The topic is rendered fully in the context of itself |
java.lang.String |
invokeServletAndReturnAsString(java.lang.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 |
isVirtualMode()
API to check if wiki is in multi-wiki mode (virtual) |
java.lang.String |
parseContent(java.lang.String content)
API allowing to parse a text content to evaluate velocity scripts |
java.lang.Object |
parseGroovyFromPage(java.lang.String fullname)
Privileged API to retrieve an object instanciated from groovy code in a String Groovy scripts compilation is cached |
java.lang.Object |
parseGroovyFromPage(java.lang.String script,
java.lang.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. |
java.lang.Object |
parseGroovyFromString(java.lang.String script)
Privileged API to retrieve an object instantiated from groovy code in a String. |
java.lang.String |
parseMessage()
API to parse the message being stored in the Context A message can be an error message or an information message either as text or as a message ID pointing to ApplicationResources The message is also parse for velocity scripts |
java.lang.String |
parseMessage(java.lang.String id)
API to parse a message A message can be an error message or an information message either as text or as a message ID pointing to ApplicationResources The message is also parse for velocity scripts |
java.lang.String |
parseTemplate(java.lang.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,
java.lang.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 |
java.lang.String |
renderChunk(org.suigeneris.jrcs.diff.delta.Chunk chunk,
boolean source,
Document doc)
API to render a chunk (difference between two versions |
java.lang.String |
renderChunk(org.suigeneris.jrcs.diff.delta.Chunk chunk,
Document doc)
API to render a chunk (difference between two versions |
java.lang.String |
renderTemplate(java.lang.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. |
java.lang.String |
renderText(java.lang.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 |
java.util.List |
search(java.lang.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) |
java.util.List |
search(java.lang.String wheresql,
int nb,
int start)
Priviledged 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) |
java.util.List |
search(XWikiQuery query)
API to run a search from an XWikiQuery Object An XWikiQuery object can be created from a request using the createQueryFromRequest function |
java.lang.String |
searchAsTable(XWikiQuery query)
API to run a search from an XWikiQuery Object and display it as a HTML table An XWikiQuery object can be created from a request using the createQueryFromRequest function |
java.util.List<java.lang.String> |
searchDocuments(java.lang.String wheresql)
API allowing to search for document names matching a query. |
java.util.List<Document> |
searchDocuments(java.lang.String wheresql,
boolean distinctbylanguage)
API allowing to search for documents allowing to have mutliple entries per language |
java.util.List<Document> |
searchDocuments(java.lang.String wheresql,
boolean distinctbylanguage,
int nb,
int start)
API allowing to search for documents allowing to have mutliple entries per language |
java.util.List<java.lang.String> |
searchDocuments(java.lang.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. |
java.util.List<java.lang.String> |
searchDocuments(java.lang.String parametrizedSqlClause,
int nb,
int start,
java.util.List<?> parameterValues)
Search documents by passing HQL where clause values as parameters. |
java.util.List<java.lang.String> |
searchDocuments(java.lang.String wheresql,
int nb,
int start,
java.lang.String selectColumns)
Priviledged API allowing to search for document names matching a query return only a limited number of elements and skipping the first rows. |
java.util.List<java.lang.String> |
searchDocuments(java.lang.String parametrizedSqlClause,
java.util.List<?> parameterValues)
Same as searchDocuments(String, int, int, java.util.List) but returns all rows. |
java.util.List<java.lang.String> |
searchDocumentsNames(java.lang.String wikiName,
java.lang.String parametrizedSqlClause,
int nb,
int start,
java.util.List<?> parameterValues)
Search documents in the provided wiki by passing HQL where clause values as parameters. |
java.util.List<java.lang.String> |
searchSpacesNames(java.lang.String parametrizedSqlClause,
int nb,
int start,
java.util.List<?> parameterValues)
Search spaces by passing HQL where clause values as parameters. |
void |
sendConfirmationMail(java.lang.String xwikiname,
java.lang.String password,
java.lang.String email,
java.lang.String contentfield)
Priviledged API to send a confirmation email to a user |
void |
sendConfirmationMail(java.lang.String xwikiname,
java.lang.String password,
java.lang.String email,
java.lang.String add_message,
java.lang.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 |
java.util.List<Document> |
wrapDocs(java.util.List<?> docs)
Function to wrap a list of XWikiDocument into Document objects |
| Methods inherited from class com.xpn.xwiki.api.Api |
|---|
convert, convert, getXWikiContext, hasAccessLevel, hasAdminRights, hasProgrammingRights |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final org.apache.commons.logging.Log LOG
| Constructor Detail |
|---|
public XWiki(XWiki xwiki,
XWikiContext context)
xwiki - XWiki Main Object to wrapcontext - XWikiContext to wrap| Method Detail |
|---|
public XWiki getXWiki()
public java.lang.String getVersion()
(version).(SVN build number), or "Unknown version" if it
failed to be retrieved
public java.lang.String getRequestURL()
throws XWikiException
XWikiException
public Document getDocument(java.lang.String fullname)
throws XWikiException
fullname - the full name of the XWiki document to be loaded
XWikiException
public java.util.List<DeletedDocument> getDeletedDocuments(java.lang.String fullname,
java.lang.String lang)
throws XWikiException
fullname - the name of the document to search for.lang - an optional language to filter results.
XWikiException - if any error
public DeletedDocument getDeletedDocument(java.lang.String fullname,
java.lang.String lang,
java.lang.String index)
throws XWikiException
fullname - - XWikiDocument.getFullName()lang - - XWikiDocument.getLanguage()
XWikiException - if any error
public boolean exists(java.lang.String fullname)
throws XWikiException
fullname - Fullname of the XWiki document to be loaded
XWikiException
public boolean checkAccess(java.lang.String docname,
java.lang.String right)
docname - fullname of the documentright - right to check ("view", "edit", "admin", "delete")
public Document getDocument(java.lang.String web,
java.lang.String fullname)
throws XWikiException
web - Space to use in case no space is defined in the provided fullnamefullname - the full name or relative name of the document to load
XWikiException
public Document getDocument(Document doc,
java.lang.String rev)
throws XWikiException
doc - Document for which to load a specific revisionrev - Revision number
XWikiExceptionpublic java.lang.String getFormEncoded(java.lang.String content)
content - text to transform
public java.lang.String getXMLEncoded(java.lang.String content)
content - text to transform
public java.lang.String getTextArea(java.lang.String content)
content - content to output
public java.lang.String getHTMLArea(java.lang.String content)
content - content to output
public java.util.List<java.lang.String> getClassList()
throws XWikiException
XWikiExceptionpublic MetaClass getMetaclass()
public java.util.List search(java.lang.String wheresql)
throws XWikiException
wheresql - Query to be run (HQL, XPath)
XWikiException
public java.util.List search(java.lang.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 java.util.List<java.lang.String> searchDocuments(java.lang.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(java.lang.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 java.util.List<java.lang.String> searchDocuments(java.lang.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
XWikiExceptionsearchDocuments(String where sql)
public java.util.List<java.lang.String> searchDocuments(java.lang.String wheresql,
int nb,
int start,
java.lang.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 java.util.List<Document> searchDocuments(java.lang.String wheresql,
boolean distinctbylanguage)
throws XWikiException
wheresql - query to use similar to searchDocuments(wheresql)distinctbylanguage - true to return multiple rows per language
XWikiException
public java.util.List<Document> searchDocuments(java.lang.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 java.util.List<java.lang.String> searchDocuments(java.lang.String parametrizedSqlClause,
int nb,
int start,
java.util.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>
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
public java.util.List<java.lang.String> searchDocuments(java.lang.String parametrizedSqlClause,
java.util.List<?> parameterValues)
throws XWikiException
searchDocuments(String, int, int, java.util.List) but returns all rows.
XWikiExceptionsearchDocuments(String, int, int, java.util.List)
public int countDocuments(java.lang.String parametrizedSqlClause,
java.util.List<?> parameterValues)
throws XWikiException
wheresql - 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 java.util.List<java.lang.String> searchDocumentsNames(java.lang.String wikiName,
java.lang.String parametrizedSqlClause,
int nb,
int start,
java.util.List<?> parameterValues)
throws XWikiException
searchDocuments(String, int, int, java.util.List) for more details.
wikiName - the name of the wiki where to search.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 querysearchDocuments(String, int, int, java.util.List)
public java.util.List<java.lang.String> searchSpacesNames(java.lang.String parametrizedSqlClause,
int nb,
int start,
java.util.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 querypublic java.util.List<Document> wrapDocs(java.util.List<?> docs)
docs - list of XWikiDocument
public java.lang.String parseContent(java.lang.String content)
content -
public java.lang.String parseMessage()
public java.lang.String parseMessage(java.lang.String id)
id -
public java.lang.String getMessage(java.lang.String id)
id -
public java.lang.String parseTemplate(java.lang.String template)
template - Template name ("view", "edit", "comment")
public java.lang.String renderTemplate(java.lang.String template)
template - Template name ("view", "edit", "comment")
public java.lang.String invokeServletAndReturnAsString(java.lang.String url)
url - URL of the servlet
public java.lang.String getSkinFile(java.lang.String filename)
filename - Filename to be looked up in the skin (logo.gif, style.css)
public java.lang.String getSkinFile(java.lang.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 java.lang.String getSkin()
public java.lang.String getBaseSkin()
public java.lang.String getWebCopyright()
public java.lang.String getXWikiPreference(java.lang.String prefname)
prefname - Preference name
public java.lang.String getXWikiPreference(java.lang.String prefname,
java.lang.String default_value)
prefname - Preference namedefault_value - default value to return if the prefenrece does not exist or is empty
public java.lang.String getWebPreference(java.lang.String prefname)
prefname - Preference name
public java.lang.String getWebPreferenceFor(java.lang.String prefname,
java.lang.String space)
prefname - Preference namespace - The space for which this preference is requested
public java.lang.String getWebPreference(java.lang.String prefname,
java.lang.String default_value)
prefname - Preference namedefault_value - default value to return if the preference does not exist or is empty
public java.lang.String getSkinPreference(java.lang.String prefname)
prefname - Preference name
public java.lang.String getSkinPreference(java.lang.String prefname,
java.lang.String default_value)
prefname - Preference namedefault_value - default value to return if the preference does not exist or is empty
public java.lang.String getWebPreferenceFor(java.lang.String prefname,
java.lang.String space,
java.lang.String default_value)
prefname - Preference namespace - The space for which this preference is requesteddefault_value - default value to return if the prefenrece does not exist or is empty
public long getXWikiPreferenceAsLong(java.lang.String prefname,
long default_value)
prefname - Preference namedefault_value - default value to return if the prefenrece does not exist or is empty
public long getXWikiPreferenceAsLong(java.lang.String prefname)
prefname - Preference name
public long getWebPreferenceAsLong(java.lang.String prefname,
long default_value)
prefname - Preference namedefault_value - default value to return if the prefenrece does not exist or is empty
public long getWebPreferenceAsLong(java.lang.String prefname)
prefname - Preference name
public int getXWikiPreferenceAsInt(java.lang.String prefname,
int default_value)
prefname - Preference namedefault_value - default value to return if the prefenrece does not exist or is empty
public int getXWikiPreferenceAsInt(java.lang.String prefname)
prefname - Preference name
public int getWebPreferenceAsInt(java.lang.String prefname,
int default_value)
prefname - Preference namedefault_value - default value to return if the prefenrece does not exist or is empty
public int getWebPreferenceAsInt(java.lang.String prefname)
prefname - Preference name
public java.lang.String getUserPreference(java.lang.String prefname)
prefname - Preference name
public java.lang.String getUserPreferenceFromCookie(java.lang.String prefname)
prefname - Preference name
public java.lang.String getLanguagePreference()
public java.lang.String getInterfaceLanguagePreference()
public boolean isVirtualMode()
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,
java.lang.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 createNewWiki(java.lang.String wikiName,
java.lang.String wikiUrl,
java.lang.String wikiAdmin,
java.lang.String baseWikiName,
boolean failOnExist)
throws XWikiException
wikiName - Wiki Name to createwikiUrl - Wiki URL to accept requests fromwikiAdmin - Wiki admin userbaseWikiName - Wiki to copy documents fromfailOnExist - true to fail if the wiki already exists, false to overwrite
XWikiException
public int createNewWiki(java.lang.String wikiName,
java.lang.String wikiUrl,
java.lang.String wikiAdmin,
java.lang.String baseWikiName,
java.lang.String description,
boolean failOnExist)
throws XWikiException
wikiName - Wiki Name to createwikiUrl - Wiki URL to accept requests fromwikiAdmin - Wiki admin userbaseWikiName - Wiki to copy documents fromdescription - Description of the WikifailOnExist - true to fail if the wiki already exists, false to overwrite
XWikiException
public int createNewWiki(java.lang.String wikiName,
java.lang.String wikiUrl,
java.lang.String wikiAdmin,
java.lang.String baseWikiName,
java.lang.String description,
java.lang.String language,
boolean failOnExist)
throws XWikiException
wikiName - Wiki Name to createwikiUrl - Wiki URL to accept requests fromwikiAdmin - Wiki admin userbaseWikiName - Wiki to copy documents fromdescription - Description of the Wikilanguage - Language to copyfailOnExist - true to fail if the wiki already exists, false to overwrite
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(java.lang.String fullwikiname)
throws XWikiException
fullwikiname - user name to add
XWikiException
public void sendConfirmationMail(java.lang.String xwikiname,
java.lang.String password,
java.lang.String email,
java.lang.String add_message,
java.lang.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 successfully
public void sendConfirmationMail(java.lang.String xwikiname,
java.lang.String password,
java.lang.String email,
java.lang.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 successfully
public boolean copyDocument(java.lang.String docname,
java.lang.String targetdocname)
throws XWikiException
docname - source documenttargetdocname - target document
XWikiException - if the document was not copied properly
public boolean copyDocument(java.lang.String docname,
java.lang.String targetdocname,
java.lang.String wikilanguage)
throws XWikiException
docname - source documenttargetdocname - target documentwikilanguage - language to copy
XWikiException - if the document was not copied properly
public boolean copyDocument(java.lang.String docname,
java.lang.String sourceWiki,
java.lang.String targetWiki,
java.lang.String wikilanguage)
throws XWikiException
docname - source documentsourceWiki - source wikitargetWiki - target wikiwikilanguage - language to copy
XWikiException - if the document was not copied properly
public boolean copyDocument(java.lang.String docname,
java.lang.String targetdocname,
java.lang.String sourceWiki,
java.lang.String targetWiki,
java.lang.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 properly
public boolean copyDocument(java.lang.String docname,
java.lang.String targetdocname,
java.lang.String sourceWiki,
java.lang.String targetWiki,
java.lang.String wikilanguage,
boolean reset,
boolean force)
throws XWikiException
docname - source documentsourceWiki - source wikitargetWiki - target wikiwikilanguage - language to copyreset - true to reset versionsforce - true to overwrite the previous document
XWikiException - if the document was not copied properly
public int copyWikiWeb(java.lang.String web,
java.lang.String sourceWiki,
java.lang.String targetWiki,
java.lang.String wikiLanguage,
boolean clean)
throws XWikiException
web - source SpacesourceWiki - source WikitargetWiki - target WikiwikiLanguage - language to copyclean - true to delete all document of the target space
XWikiException - if the space was not copied properly
public java.lang.String includeTopic(java.lang.String topic)
throws XWikiException
topic - page name of the topic to include
XWikiException - if the include failed
public java.lang.String includeForm(java.lang.String topic)
throws XWikiException
topic - page name of the form to execute
XWikiException - if the include failed
public java.lang.String includeTopic(java.lang.String topic,
boolean pre)
throws XWikiException
topic - page name of the topic to includepre - true to add {pre} {/pre}
XWikiException - if the include failed
public java.lang.String includeForm(java.lang.String topic,
boolean pre)
throws XWikiException
topic - page name of the form to executepre - true to add {pre} {/pre}
XWikiException - if the include failedpublic boolean hasAccessLevel(java.lang.String level)
level - right to check (view, edit, comment, delete)
public boolean hasAccessLevel(java.lang.String level,
java.lang.String user,
java.lang.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 java.lang.String renderText(java.lang.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 wrong
public java.lang.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 java.lang.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 java.util.List<java.lang.String> getSpaces()
throws XWikiException
XWikiException - if something went wrong
public java.util.List<java.lang.String> getSpaceDocsName(java.lang.String SpaceName)
throws XWikiException
SpaceName - space tolest
XWikiException - if the loading went wrongpublic java.lang.String getEncoding()
public java.lang.String getAttachmentURL(java.lang.String fullname,
java.lang.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 properly
public java.lang.String getURL(java.lang.String fullname)
throws XWikiException
fullname - page name which includes the attached file
XWikiException - if the URL could not be generated properly
public java.lang.String getURL(java.lang.String fullname,
java.lang.String action)
throws XWikiException
fullname - page name which includes the attached fileaction - mode in which to access the document (view/edit/save/..). Any valid XWiki action is possible.
XWikiException - if the URL could not be generated properly
public java.lang.String getURL(java.lang.String fullname,
java.lang.String action,
java.lang.String querystring)
throws XWikiException
fullname - page name which includes the attached fileaction - mode in which to access the document (view/edit/save/..). Any valid XWiki action is possible.querystring - Query String to provide in the usual mode (name1=value1&name2=value=2) including encoding.
XWikiException - if the URL could not be generated properly
public java.lang.Object getExoService(java.lang.String className)
throws XWikiException
className - eXo classname to retrieve the service from
XWikiException - if the service cannot be loaded
public java.lang.Object getExoPortalService(java.lang.String className)
throws XWikiException
className - eXo classname to retrieve the service from
XWikiException - if the service cannot be loaded@Deprecated public DocumentStats getCurrentMonthXWikiStats(java.lang.String action)
getStatsService() instead
action - action for which to retrieve statistics (view/save/download)
public java.lang.String getRefererText(java.lang.String referer)
referer - referer URL to transform
public java.lang.String getShortRefererText(java.lang.String referer,
int length)
referer - referer URL to transformlength - Maximum length. "..." is added to the end of the text
@Deprecated public java.lang.String getFullNameSQL()
public java.lang.String getUserName(java.lang.String user)
user - Fully qualified username as retrieved from $context.user (XWiki.LudovicDubost)
public java.lang.String getUserName(java.lang.String user,
java.lang.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 java.lang.String getLocalUserName(java.lang.String user)
user - Fully qualified username as retrieved from $context.user (XWiki.LudovicDubost)
public java.lang.String getLocalUserName(java.lang.String user,
java.lang.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 java.lang.String getUserName(java.lang.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 java.lang.String getUserName(java.lang.String user,
java.lang.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 java.lang.String getLocalUserName(java.lang.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 java.lang.String getLocalUserName(java.lang.String user,
java.lang.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(java.lang.String username)
public java.lang.String formatDate(java.util.Date date)
date - date object to format
public java.lang.String formatDate(java.util.Date date,
java.lang.String format)
date - date to formatformat - format of the date to be used
SimpleDateFormatpublic java.lang.String getUserTimeZone()
public Api get(java.lang.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(java.lang.String name)
name - Name of the plugin to retrieve (either short of full class name)
public java.lang.String getAdType()
public java.lang.String getAdClientId()
public java.lang.String getURLContent(java.lang.String surl,
java.lang.String username,
java.lang.String password)
throws java.io.IOException
surl - url to retrieveusername - username for the basic authenticationpassword - password for the basic authentication
java.io.IOException
public java.lang.String getURLContent(java.lang.String surl)
throws java.io.IOException
surl - url to retrieve
java.io.IOException
public java.lang.String getURLContent(java.lang.String surl,
java.lang.String username,
java.lang.String password,
int timeout)
throws java.io.IOException
surl - url to retrieveusername - username for the basic authenticationpassword - password for the basic authenticationtimeout - manuel timeout in milliseconds
java.io.IOException
public java.lang.String getURLContent(java.lang.String surl,
int timeout)
throws java.io.IOException
surl - url to retrievetimeout - manuel timeout in milliseconds
java.io.IOException
public byte[] getURLContentAsBytes(java.lang.String surl,
java.lang.String username,
java.lang.String password)
throws java.io.IOException
surl - url to retrieveusername - username for the basic authenticationpassword - password for the basic authentication
java.io.IOException
public byte[] getURLContentAsBytes(java.lang.String surl)
throws java.io.IOException
surl - url to retrieve
java.io.IOException
public java.util.List<java.lang.String> getIncludedMacros(java.lang.String defaultweb,
java.lang.String content)
defaultweb - Default Web to use for relative path namescontent - Content to parse
public boolean isReadOnly()
XWikipublic void setReadOnly(boolean ro)
ro - true to set read-only mode/false to unset
public void refreshLinks()
throws XWikiException
XWikiException - exception if the generation fails
public boolean hasBacklinks()
throws XWikiException
XWikiException - exception if the preference could not be retrieved
public 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,
java.lang.String newFullName)
doc - page to renamenewFullName - target page name to move the information to
XWikiException - exception if the rename failspublic java.lang.String getEditorPreference()
public java.lang.Object parseGroovyFromString(java.lang.String script)
throws XWikiException
script - the Groovy class definition string (public class MyClass { ... })
XWikiException
public java.lang.Object parseGroovyFromPage(java.lang.String script,
java.lang.String jarWikiPage)
throws XWikiException
script - the Groovy class definition string (public class MyClass { ... })
XWikiException
public java.lang.Object parseGroovyFromPage(java.lang.String fullname)
throws XWikiException
fullname - // script containing a Groovy class definition (public class MyClass { ... })
XWikiExceptionpublic java.lang.String getMacroList()
public java.lang.String getWysiwygToolbars()
public Object getObjectFromRequest(java.lang.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 java.lang.String convertUsername(java.lang.String username)
username - username to use for login
public java.lang.String displaySearchColumns(java.lang.String className,
XWikiQuery query)
throws XWikiException
className - XWiki Class Name to display the list of columns forquery - Query to pre-select the currently selected columns
XWikiException - exception is a failure occured
public java.lang.String displaySearchColumns(java.lang.String className,
java.lang.String prefix,
XWikiQuery query)
throws XWikiException
className - XWiki Class Name to display the list of columns forprefix - Prefix to add to the field namequery - Query to pre-select the currently selected columns
XWikiException - exception is a failure occured
public java.lang.String displaySearchOrder(java.lang.String className,
XWikiQuery query)
throws XWikiException
className - XWiki Class Name to display the list of columns forquery - Query to pre-select the currently selected columns
XWikiException - exception is a failure occured
public java.lang.String displaySearchOrder(java.lang.String className,
java.lang.String prefix,
XWikiQuery query)
throws XWikiException
className - XWiki Class Name to display the list of columns forprefix - Prefix to add to the field namequery - Query to pre-select the currently selected columns
XWikiException - exception is a failure occured
public java.lang.String displaySearch(java.lang.String fieldname,
java.lang.String className)
throws XWikiException
fieldname - field name in the classclassName - class name to display the field from
XWikiException - exception is a failure occured
public java.lang.String displaySearch(java.lang.String fieldname,
java.lang.String className,
XWikiCriteria criteria)
throws XWikiException
fieldname - field name in the classclassName - class name to display the field fromcriteria - XWikiCriteria object (usually the XWikiQuery object) to take the preselected values from
XWikiException - exception is a failure occured
public java.lang.String displaySearch(java.lang.String fieldname,
java.lang.String className,
java.lang.String prefix,
XWikiCriteria criteria)
throws XWikiException
fieldname - field name in the classclassName - class name to display the field fromprefix - prefix to add to the field namecriteria - XWikiCriteria object (usually the XWikiQuery object) to take the preselected values from
XWikiException - exception is a failure occured
public java.util.List search(XWikiQuery query)
throws XWikiException
query - query to run the search for
XWikiException - exception is a failure occured
public XWikiQuery createQueryFromRequest(java.lang.String className)
throws XWikiException
className - class name to create the query from
XWikiException - exception is a failure occured
public java.lang.String searchAsTable(XWikiQuery query)
throws XWikiException
query - query to run the search for
XWikiException - exception is a failure occuredpublic PropertyClass getPropertyClassFromName(java.lang.String propPath)
propPath - Property path
public java.lang.String getUniquePageName(java.lang.String name)
name -
public java.lang.String getUniquePageName(java.lang.String space,
java.lang.String name)
space - name -
public java.lang.String addTooltip(java.lang.String html,
java.lang.String message,
java.lang.String params)
html - HTML viewedmessage - HTML Tooltip messageparams - Parameters in Javascropt added to the tooltip config
public java.lang.String addTooltip(java.lang.String html,
java.lang.String message)
html - HTML viewedmessage - HTML Tooltip message
public java.lang.String addTooltipJS()
public java.lang.String addMandatory()
public Class getClass(java.lang.String documentName)
throws XWikiException
Note: This method doesn't require any rights for accessing the passed Document (as opposed to the
Document.getxWikiClass() 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 java.lang.String getCounter(java.lang.String name)
name - Counter name
public XWikiUser checkAuth()
throws XWikiException
XWikiException
public XWikiUser checkAuth(java.lang.String username,
java.lang.String password,
java.lang.String rememberme)
throws XWikiException
username - username to checkpassword - password to checkrememberme - "1" if you want to remember the login accross navigator restart
XWikiExceptionpublic StatsService getStatsService()
public CriteriaService getCriteriaService()
public java.util.List<java.lang.String> getConfiguredSyntaxes()
public QueryManager getQueryManager()
QueryManager for execute queries to store.public java.lang.String getServletPath(java.lang.String wikiName)
wikiName - wiki for which to get the path
public java.lang.String getServletPath()
public java.lang.String getWebAppPath()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||