@Component @Named(value="wiki") @Singleton public class WikiManagerScriptService extends Object implements org.xwiki.script.service.ScriptService
Modifier and Type | Field and Description |
---|---|
static String |
CONTEXT_LASTEXCEPTION
Deprecated.
|
static String |
ROLEHINT
Hint of the component.
|
Constructor and Description |
---|
WikiManagerScriptService() |
Modifier and Type | Method and Description |
---|---|
boolean |
canDeleteWiki(String userId,
String wikiId)
Test if a given user can delete a given wiki.
|
WikiDescriptor |
createWiki(String wikiId,
String wikiAlias,
String ownerId,
boolean failOnExist)
Create a new wiki.
|
boolean |
deleteWiki(String wikiId)
Delete the specified wiki.
|
Boolean |
exists(String wikiId)
Test if a wiki exists.
|
org.xwiki.script.service.ScriptService |
get(String serviceName)
Get a sub script service related to wiki.
|
String |
getAliasSuffix() |
Collection<WikiDescriptor> |
getAll()
Get all the wiki descriptors.
|
Collection<String> |
getAllIds()
Get all the wiki identifiers.
|
WikiDescriptor |
getByAlias(String wikiAlias)
Get a wiki descriptor from one of its alias.
|
WikiDescriptor |
getById(String wikiId)
Get a wiki descriptor from its unique identifier.
|
String |
getCurrentWikiId() |
Exception |
getLastError()
Get the error generated while performing the previously called action.
|
Exception |
getLastException()
Deprecated.
since 5.4RC1 use
getLastError() ()} instead |
WikiDescriptor |
getMainWikiDescriptor() |
String |
getMainWikiId() |
Boolean |
idAvailable(String wikiId)
Check if the wikiId is valid and available (the name is not already taken for technical reasons).
|
boolean |
isPathMode()
Tell if the path mode is used for subwikis.
|
boolean |
saveDescriptor(WikiDescriptor descriptor)
Save the specified descriptor (if you have the right).
|
public static final String ROLEHINT
@Deprecated public static final String CONTEXT_LASTEXCEPTION
public org.xwiki.script.service.ScriptService get(String serviceName)
$services.wiki.name
is
equivalent to writing $services.wiki.get("name")
). It also makes it a short and easy API name for
other scripting languages.serviceName
- id of the script servicepublic Exception getLastError()
null
if no exception was thrownpublic WikiDescriptor createWiki(String wikiId, String wikiAlias, String ownerId, boolean failOnExist)
wikiId
- unique identifier of the new wikiwikiAlias
- default alias of the new wikiownerId
- Id of the user that will own the wikifailOnExist
- Fail the operation if the wiki id already existspublic boolean deleteWiki(String wikiId)
wikiId
- unique identifier of the wiki to deletepublic boolean canDeleteWiki(String userId, String wikiId)
userId
- the id of the user to testwikiId
- the id of the wikipublic WikiDescriptor getByAlias(String wikiAlias)
wikiAlias
- alias to searchpublic WikiDescriptor getById(String wikiId)
wikiId
- unique identifier of the wiki to searchpublic Collection<WikiDescriptor> getAll()
public Collection<String> getAllIds()
public Boolean exists(String wikiId)
wikiId
- unique identifier to testpublic Boolean idAvailable(String wikiId)
wikiId
- the Id to testpublic WikiDescriptor getMainWikiDescriptor()
public String getMainWikiId()
public String getCurrentWikiId()
public boolean saveDescriptor(WikiDescriptor descriptor)
descriptor
- descriptor to savepublic boolean isPathMode()
wiki alias: subwiki
URL if path mode is enabled:
/xwiki/wiki/subwiki/
URL if path mode is disabled:
http://subwiki/
public String getAliasSuffix()
@Deprecated public Exception getLastException()
getLastError()
()} insteadCopyright © 2004–2014 XWiki. All rights reserved.