|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.xwiki.rest.XWikiResource
@InstantiationStrategy(value=PER_LOOKUP) public class XWikiResource
Base class for all XWiki-related JAX-RS resources. This class provides to subclasses a set of protected fields to access the XWiki API and a method for retrieving documents in their different incarnations.
| Nested Class Summary | |
|---|---|
protected static class |
XWikiResource.DocumentInfo
A wrapper class for returning an XWiki document enriched with information about its status. |
| Field Summary | |
|---|---|
protected org.xwiki.component.manager.ComponentManager |
componentManager
The XWiki component manager that is used to lookup XWiki components and context. |
protected Logger |
logger
The logger to be used to output log messages. |
protected ObjectFactory |
objectFactory
The object factory for model objects to be used when creating representations. |
protected org.xwiki.query.QueryManager |
queryManager
The query manager to be used to perform low-level queries for retrieving information about wiki content. |
protected javax.ws.rs.core.UriInfo |
uriInfo
The actual URI information about the JAX-RS resource being called. |
| Constructor Summary | |
|---|---|
XWikiResource()
|
|
| Method Summary | |
|---|---|
XWikiResource.DocumentInfo |
getDocumentInfo(String wikiName,
String spaceName,
String pageName,
String language,
String version,
boolean failIfDoesntExist,
boolean failIfLocked)
Retrieve a document. |
String |
getUriTemplate()
A special GET method that produces the ad-hoc "uritemplate" media type used for retrieving the URI template associated to a resource. |
protected XWikiContext |
getXWikiContext()
Retrieve the XWiki context from the current execution context. |
void |
initialize()
Resource initialization. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
@Context protected javax.ws.rs.core.UriInfo uriInfo
The actual URI information about the JAX-RS resource being called. This variable is useful when generating links to other resources in representations.
protected Logger logger
The logger to be used to output log messages.
protected ObjectFactory objectFactory
The object factory for model objects to be used when creating representations.
@Inject protected org.xwiki.component.manager.ComponentManager componentManager
The XWiki component manager that is used to lookup XWiki components and context.
@Inject protected org.xwiki.query.QueryManager queryManager
The query manager to be used to perform low-level queries for retrieving information about wiki content.
| Constructor Detail |
|---|
public XWikiResource()
| Method Detail |
|---|
public void initialize()
throws org.xwiki.component.phase.InitializationException
Resource initialization.
initialize in interface org.xwiki.component.phase.Initializableorg.xwiki.component.phase.InitializationException
public XWikiResource.DocumentInfo getDocumentInfo(String wikiName,
String spaceName,
String pageName,
String language,
String version,
boolean failIfDoesntExist,
boolean failIfLocked)
throws XWikiException
Retrieve a document. This method never returns null. If something goes wrong with respect to some precondition an exception is thrown.
wikiName - The wiki name. Cannot be null.spaceName - The space name. Cannot be null.pageName - The page name. Cannot be null.language - The language. Null for the default language.version - The version. Null for the latest version.failIfDoesntExist - True if an exception should be raised whenever the page doesn't exist.failIfLocked - True if an exception should be raised whenever the page is locked.
IllegalArgumentException - If a parameter has an incorrect value (e.g. null)
javax.ws.rs.WebApplicationException - NOT_FOUND if failIfDoesntExist is true and the page doesn't exist.
PRECONDITION_FAILED if failIfLocked is true and the document is locked.
XWikiExceptionpublic String getUriTemplate()
A special GET method that produces the ad-hoc "uritemplate" media type used for retrieving the URI template associated to a resource. This is an auxiliary method that is used for documenting the REST API.
protected XWikiContext getXWikiContext()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||