Package ch.entwine.weblounge.common.impl.util.doc

Examples of ch.entwine.weblounge.common.impl.util.doc.Endpoint.addFormat()


    docs.addEndpoint(Endpoint.Type.READ, getReferrerByURIEndpoint);

    // PUT /{page}/lock
    Endpoint lockPageEndpoint = new Endpoint("/{page}/lock", Method.PUT, "lockpage");
    lockPageEndpoint.setDescription("Locks the specified page. If the client supplies an If-Match header, the lock is processed only if the header value matches the page's ETag");
    lockPageEndpoint.addFormat(Format.xml());
    lockPageEndpoint.addStatus(ok("the page was locked"));
    lockPageEndpoint.addStatus(badRequest("the page was not specified"));
    lockPageEndpoint.addStatus(preconditionFailed("the page's etag does not match the value specified in the If-Match header"));
    lockPageEndpoint.addStatus(notFound("the page was not found"));
    lockPageEndpoint.addStatus(forbidden("the page is already locked by another user"));
View Full Code Here


    docs.addEndpoint(Endpoint.Type.WRITE, lockPageEndpoint);

    // DELETE /{page}/unlock
    Endpoint unlockPageEndpoint = new Endpoint("/{page}/lock", Method.DELETE, "unlockpage");
    unlockPageEndpoint.setDescription("Unlocks the specified page. If the client supplies an If-Match header, the unlock is processed only if the header value matches the page's ETag");
    unlockPageEndpoint.addFormat(Format.xml());
    unlockPageEndpoint.addStatus(ok("the page was unlocked"));
    unlockPageEndpoint.addStatus(badRequest("the page was not specified"));
    unlockPageEndpoint.addStatus(preconditionFailed("the page's etag does not match the value specified in the If-Match header"));
    unlockPageEndpoint.addStatus(notFound("the page was not found"));
    unlockPageEndpoint.addStatus(forbidden("the current user does not have the rights to unlock the page"));
View Full Code Here

    docs.addEndpoint(Endpoint.Type.WRITE, unlockPageEndpoint);

    // PUT /{page}/publish
    Endpoint publishPageEndpoint = new Endpoint("/{page}/publish", Method.PUT, "publishpage");
    publishPageEndpoint.setDescription("Publishes the specified page. If the client supplies an If-Match header, the publish is processed only if the header value matches the page's ETag");
    publishPageEndpoint.addFormat(Format.xml());
    publishPageEndpoint.addStatus(ok("the page was published"));
    publishPageEndpoint.addStatus(badRequest("the page was not specified"));
    publishPageEndpoint.addStatus(preconditionFailed("the page's etag does not match the value specified in the If-Match header"));
    publishPageEndpoint.addStatus(preconditionFailed("the page references resources that are no longer present or published"));
    publishPageEndpoint.addStatus(notFound("the page was not found"));
View Full Code Here

    docs.addEndpoint(Endpoint.Type.WRITE, publishPageEndpoint);

    // DELETE /{page}/publish
    Endpoint unpublishPageEndpoint = new Endpoint("/{page}/publish", Method.DELETE, "unpublishpage");
    unpublishPageEndpoint.setDescription("Unpublishs the specified page. If the client supplies an If-Match header, the unpublish is processed only if the header value matches the page's ETag");
    unpublishPageEndpoint.addFormat(Format.xml());
    unpublishPageEndpoint.addStatus(ok("the page was unpublished"));
    unpublishPageEndpoint.addStatus(badRequest("the page was not specified"));
    unpublishPageEndpoint.addStatus(preconditionFailed("the page's etag does not match the value specified in the If-Match header"));
    unpublishPageEndpoint.addStatus(notFound("the page was not found"));
    unpublishPageEndpoint.addStatus(forbidden("the page is locked by a different user"));
View Full Code Here

    String[] versions = { "0", "1" };

    // GET /
    Endpoint getAllPagesEndpoint = new Endpoint("/", Method.GET, "getallpages");
    getAllPagesEndpoint.setDescription("Returns a collection of pages matching the given parameters");
    getAllPagesEndpoint.addFormat(Format.xml());
    getAllPagesEndpoint.addStatus(ok("a collection (may be empty) of pages is returned as part of the response"));
    getAllPagesEndpoint.addStatus(badRequest("an invalid request was received"));
    getAllPagesEndpoint.addStatus(serviceUnavailable("the site or its content repository is temporarily offline"));
    getAllPagesEndpoint.addOptionalParameter(new Parameter("path", Parameter.Type.String, "The page path"));
    getAllPagesEndpoint.addOptionalParameter(new Parameter("subjects", Parameter.Type.String, "The page subjects, separated by a comma"));
View Full Code Here

    docs.addEndpoint(Endpoint.Type.READ, getAllPagesEndpoint);

    // GET /{page}
    Endpoint getPageByIdEndpoint = new Endpoint("/{page}", Method.GET, "getpagebyid");
    getPageByIdEndpoint.setDescription("Returns the page with the given id");
    getPageByIdEndpoint.addFormat(Format.xml());
    getPageByIdEndpoint.addStatus(ok("the page was found and is returned as part of the response"));
    getPageByIdEndpoint.addStatus(notFound("the page was not found or could not be loaded"));
    getPageByIdEndpoint.addStatus(badRequest("an invalid page identifier was received"));
    getPageByIdEndpoint.addStatus(serviceUnavailable("the site or its content repository is temporarily offline"));
    getPageByIdEndpoint.addPathParameter(new Parameter("page", Parameter.Type.String, "The page identifier"));
View Full Code Here

    docs.addEndpoint(Endpoint.Type.READ, getPageByIdEndpoint);

    // GET /pending
    Endpoint getPending = new Endpoint("/pending", Method.GET, "getpending");
    getPending.setDescription("Returns all unmodified or unpublished pages");
    getPending.addFormat(Format.xml());
    getPending.addStatus(ok("A resultset was compiled and returned as part of the response"));
    getPending.addStatus(serviceUnavailable("The site or its content repository is temporarily offline"));
    getPending.addOptionalParameter(new Parameter("filter", Parameter.Type.String, "Filter for the current result set"));
    getPending.addOptionalParameter(new Parameter("sort", Parameter.Type.Enum, "The sort parameter", "modified-desc", sortParams));
    getPending.addOptionalParameter(new Parameter("limit", Parameter.Type.String, "Number of result items to include", "10"));
View Full Code Here

    // POST /{page}
    Endpoint createPageEndpoint = new Endpoint("/", Method.POST, "createpage");
    createPageEndpoint.setDescription("Creates a new page, either at the given path or at a random location and returns the REST url of the created resource.");
    createPageEndpoint.addNote("If a page body is provided, existing identifiers will be overwritten");
    createPageEndpoint.addNote("The inital version is set to 'work'");
    createPageEndpoint.addFormat(Format.xml());
    createPageEndpoint.addStatus(ok("the page was created and the response body contains it's resource url"));
    createPageEndpoint.addStatus(badRequest("the path was not specified"));
    createPageEndpoint.addStatus(badRequest("the page content is malformed"));
    createPageEndpoint.addStatus(conflict("a page already exists at the specified path"));
    createPageEndpoint.addStatus(methodNotAllowed("the site or its content repository is read-only"));
View Full Code Here

    docs.addEndpoint(Endpoint.Type.WRITE, createPageEndpoint);

    // PUT /{page}
    Endpoint updatePageEndpoint = new Endpoint("/{page}", Method.PUT, "updatepage");
    updatePageEndpoint.setDescription("Updates the specified page. If the client supplies an If-Match header, the update is processed only if the header value matches the page's ETag");
    updatePageEndpoint.addFormat(Format.xml());
    updatePageEndpoint.addStatus(ok("the page was updated"));
    updatePageEndpoint.addStatus(badRequest("the page content was not specified"));
    updatePageEndpoint.addStatus(badRequest("the page content is malformed"));
    updatePageEndpoint.addStatus(notFound("the site or the page to update were not found"));
    updatePageEndpoint.addStatus(preconditionFailed("the page's etag does not match the value specified in the If-Match header"));
View Full Code Here

    docs.addEndpoint(Endpoint.Type.WRITE, updatePageEndpoint);

    // DELETE /{page}
    Endpoint deletePageEndpoint = new Endpoint("/{page}", Method.DELETE, "deletepage");
    deletePageEndpoint.setDescription("Deletes the specified page.");
    deletePageEndpoint.addFormat(Format.xml());
    deletePageEndpoint.addStatus(ok("the page was deleted"));
    deletePageEndpoint.addStatus(badRequest("the page was not specified"));
    deletePageEndpoint.addStatus(notFound("the page was not found"));
    deletePageEndpoint.addStatus(preconditionFailed("the page is still being referenced"));
    deletePageEndpoint.addStatus(methodNotAllowed("the site or its content repository is read-only"));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.