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

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


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

    // GET /{page}/referrer
    Endpoint getReferrerByURIEndpoint = new Endpoint("/{resource}/referrer", Method.GET, "getreferrer");
    getReferrerByURIEndpoint.setDescription("Returns pages containing references to the page with the given id");
    getReferrerByURIEndpoint.addFormat(Format.xml());
    getReferrerByURIEndpoint.addStatus(ok("the referring pages were found and are returned as part of the response"));
    getReferrerByURIEndpoint.addStatus(badRequest("an invalid page identifier was received"));
    getReferrerByURIEndpoint.addStatus(serviceUnavailable("the site or its content repository is temporarily offline"));
    getReferrerByURIEndpoint.addPathParameter(new Parameter("resource", Parameter.Type.String, "The resource identifier"));
    getReferrerByURIEndpoint.setTestForm(new TestForm());
View Full Code Here


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

    // GET /{resource}/content/{language}
    Endpoint getFileContentEndpoint = new Endpoint("/{resource}/content/{language}", Method.GET, "getfilecontent");
    getFileContentEndpoint.setDescription("Returns the localized file contents with the given id");
    getFileContentEndpoint.addFormat(Format.xml());
    getFileContentEndpoint.addStatus(ok("the file content was found and is returned as part of the response"));
    getFileContentEndpoint.addStatus(notFound("the file was not found or could not be loaded"));
    getFileContentEndpoint.addStatus(notFound("the file content don't exist in the specified language"));
    getFileContentEndpoint.addStatus(badRequest("an invalid file identifier was received"));
    getFileContentEndpoint.addStatus(serviceUnavailable("the site or its content repository is temporarily offline"));
View Full Code Here

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

    // GET /pending
    Endpoint getPending = new Endpoint("/pending", Method.GET, "getpending");
    getPending.setDescription("Returns all unmodified resources");
    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("type", Parameter.Type.String, "The file type, e. g. 'image'"));
    getPending.addOptionalParameter(new Parameter("sort", Parameter.Type.Enum, "The sort parameter", "modified-desc", sortParams));
View Full Code Here

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

    // POST /
    Endpoint createFileEndpoint = new Endpoint("/", Method.POST, "createfile");
    createFileEndpoint.setDescription("Creates a new file, either at the given path or at a random location and returns the REST url of the created resource.");
    createFileEndpoint.addFormat(Format.xml());
    createFileEndpoint.addStatus(ok("the file was created and the response body contains it's resource url"));
    createFileEndpoint.addStatus(badRequest("the path was invalid"));
    createFileEndpoint.addStatus(conflict("a file already exists at the specified path"));
    createFileEndpoint.addStatus(methodNotAllowed("the site or its content repository is read-only"));
    createFileEndpoint.addStatus(serviceUnavailable("the site or its content repository is temporarily offline"));
View Full Code Here

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

    // PUT /{resource}
    Endpoint updateFileEndpoint = new Endpoint("/{resource}", Method.PUT, "updatefile");
    updateFileEndpoint.setDescription("Updates the specified file. If the client supplies an If-Match header, the update is processed only if the header value matches the file's ETag");
    updateFileEndpoint.addFormat(Format.xml());
    updateFileEndpoint.addStatus(ok("the file was updated"));
    updateFileEndpoint.addStatus(badRequest("the file content was not specified"));
    updateFileEndpoint.addStatus(badRequest("the file content is malformed"));
    updateFileEndpoint.addStatus(preconditionFailed("the file's etag does not match the value specified in the If-Match header"));
    updateFileEndpoint.addStatus(methodNotAllowed("the site or its content repository is read-only"));
View Full Code Here

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

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

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

    // PUT /{resource}/content/{language}
    Endpoint addFileContentEndpoint = new Endpoint("/{resource}/content/{language}", Method.POST, "addfilecontent");
    addFileContentEndpoint.setDescription("Updates the specified file contents. If the client supplies an If-Match header, the update is processed only if the header value matches the file's ETag");
    addFileContentEndpoint.addFormat(Format.xml());
    addFileContentEndpoint.addStatus(ok("the file content was updated"));
    addFileContentEndpoint.addStatus(badRequest("the file content was not specified"));
    addFileContentEndpoint.addStatus(badRequest("the language does not exist"));
    addFileContentEndpoint.addStatus(badRequest("the file content is malformed"));
    addFileContentEndpoint.addStatus(preconditionFailed("the file's etag does not match the value specified in the If-Match header"));
View Full Code Here

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

    // DELETE /{resource}/content/{language}
    Endpoint deleteFileContentEndpoint = new Endpoint("/{resource}/content/{language}", Method.DELETE, "deletefilecontent");
    deleteFileContentEndpoint.setDescription("Deletes the specified file content.");
    deleteFileContentEndpoint.addFormat(Format.xml());
    deleteFileContentEndpoint.addStatus(ok("the file content was deleted"));
    deleteFileContentEndpoint.addStatus(badRequest("the file content was not specified"));
    deleteFileContentEndpoint.addStatus(notFound("the file was not found"));
    deleteFileContentEndpoint.addStatus(notFound("the file content was not found"));
    deleteFileContentEndpoint.addStatus(methodNotAllowed("the site or its content repository is read-only"));
View Full Code Here

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

    // POST /uploads
    Endpoint uploadFileEndpoint = new Endpoint("/uploads", Method.POST, "uploadfile");
    uploadFileEndpoint.setDescription("Creates a new file as well as content, either at the given path or at a random location and returns the REST url of the created resource.");
    uploadFileEndpoint.addFormat(Format.xml());
    uploadFileEndpoint.addStatus(ok("the file was created and the response body contains it's resource url"));
    uploadFileEndpoint.addStatus(badRequest("the path was not specified"));
    uploadFileEndpoint.addStatus(badRequest("the file content is malformed"));
    uploadFileEndpoint.addStatus(badRequest("the language does not exist"));
    uploadFileEndpoint.addStatus(conflict("a file already exists at the specified path"));
View Full Code Here

    docs.setTitle("Weblounge Search");

    // GET /{searchterms:*}
    Endpoint searchEndpoint = new Endpoint("/{searchterms}", Method.GET, "search");
    searchEndpoint.setDescription("Returns the search result");
    searchEndpoint.addFormat(Format.xml());
    searchEndpoint.addStatus(ok("the search query was executed and the result is returned as part of the response"));
    searchEndpoint.addStatus(badRequest("no search terms have been specified"));
    searchEndpoint.addStatus(error("executing the query resulted in an error"));
    searchEndpoint.addStatus(serviceUnavailable("the site or its content repository is temporarily offline"));
    searchEndpoint.addPathParameter(new Parameter("searchterms", Parameter.Type.String, "The search terms"));
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.