Interface OpenProjectDocumentResource


  • public interface OpenProjectDocumentResource
    Resource for creating and retrieving document based on unique identifiers.
    Since:
    1.2.0-rc-1
    Version:
    $Id$
    • Method Detail

      • getDocument

        javax.ws.rs.core.Response getDocument​(String id,
                                              Boolean withPrettyNames,
                                              Boolean withObjects,
                                              Boolean withClass,
                                              Boolean withAttachments)
                                       throws org.xwiki.rest.XWikiRestException
        Retrieve the reference of a document given its unique identifier.
        Parameters:
        id - the unique identifier associated to a xwiki document.
        withPrettyNames - whether the properties that support pretty names should be displayed as such. i.e. users.
        withObjects - whether the objects attached to the page should also be returned.
        withClass - not sure, actually.
        withAttachments - whether the attachments of the page should also be listed.
        Returns:
        200 and the reference of the xwiki document that can be used for the rest api. 404 if the id was not found.
        Throws:
        org.xwiki.rest.XWikiRestException - if something went wrong during the retrieval of the page.
      • updateDocument

        javax.ws.rs.core.Response updateDocument​(String documentReference,
                                                 Boolean minorRevision,
                                                 org.xwiki.rest.model.jaxb.Page page)
                                          throws org.xwiki.rest.XWikiRestException
        Updates or creates a xwiki document based on an unique identifier. Can also be used to attach an unique identifier to existing pages.
        Parameters:
        documentReference - the reference of the document that will be updated/created.
        minorRevision - whether the update will create a minor version or a major version.
        page - the model of the page that will be used to update/create the document.
        Returns:
        201: If the page was created. 202: If the page was updated. 304: If the page was not modified. 401: If the user is not authorized.
        Throws:
        org.xwiki.rest.XWikiRestException - if something went wrong during the update/creation of the page.