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

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


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

    // PUT /{site}
    Endpoint updateSiteEndpoint = new Endpoint("/{site}", Method.PUT, "updatesite");
    updateSiteEndpoint.setDescription("Updates the specified site");
    updateSiteEndpoint.addFormat(Format.xml());
    updateSiteEndpoint.addStatus(ok("the site was updated"));
    updateSiteEndpoint.addStatus(badRequest("the site identifier was not specified"));
    updateSiteEndpoint.addStatus(badRequest("the site status is malformed"));
    updateSiteEndpoint.addStatus(notFound("the site to update was not found"));
    updateSiteEndpoint.addPathParameter(new Parameter("site", Parameter.Type.String, "The site identifier"));
View Full Code Here


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

    // GET /{site}/modules
    Endpoint modulesEndpoint = new Endpoint("/{site}/modules", Method.GET, "getmodules");
    modulesEndpoint.setDescription("Returns the modules of the site with the given id");
    modulesEndpoint.addFormat(Format.xml());
    modulesEndpoint.addStatus(ok("the site was found and its modules are returned as part of the response"));
    modulesEndpoint.addStatus(notFound("the site was not found"));
    modulesEndpoint.addPathParameter(new Parameter("site", Parameter.Type.String, "The site identifier"));
    modulesEndpoint.setTestForm(new TestForm());
    docs.addEndpoint(Endpoint.Type.READ, modulesEndpoint);
View Full Code Here

    docs.addEndpoint(Endpoint.Type.READ, modulesEndpoint);
   
    // GET /{site}/modules/{module}
    Endpoint moduleEndpoint = new Endpoint("/{site}/modules/{module}", Method.GET, "getmodule");
    moduleEndpoint.setDescription("Returns the module with the given id");
    moduleEndpoint.addFormat(Format.xml());
    moduleEndpoint.addStatus(ok("the module was found and is returned as part of the response"));
    moduleEndpoint.addStatus(notFound("either the site or the module was not found"));
    moduleEndpoint.addPathParameter(new Parameter("site", Parameter.Type.String, "The site identifier"));
    moduleEndpoint.addPathParameter(new Parameter("module", Parameter.Type.String, "The module identifier"));
    moduleEndpoint.setTestForm(new TestForm());
View Full Code Here

    docs.setTitle("Weblounge Cache");

    // GET /
    Endpoint getStatistics = new Endpoint("/", Method.GET, "stats");
    getStatistics.setDescription("Returns cache statistics");
    getStatistics.addFormat(Format.xml());
    getStatistics.addStatus(ok("statistics have been compiled and sent back to the client"));
    getStatistics.addStatus(notFound("the site does not exist"));
    getStatistics.addStatus(serviceUnavailable("the site is temporarily offline"));
    getStatistics.setTestForm(new TestForm());
    docs.addEndpoint(Endpoint.Type.READ, getStatistics);
View Full Code Here

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

    // PUT /
    Endpoint startCacheEndpoint = new Endpoint("/", Method.PUT, "start");
    startCacheEndpoint.setDescription("Enables caching for the current site");
    startCacheEndpoint.addFormat(Format.xml());
    startCacheEndpoint.addStatus(ok("the cache was enabled"));
    startCacheEndpoint.addStatus(notModified("the cache was already enabled"));
    startCacheEndpoint.addStatus(notFound("the site does not exist"));
    startCacheEndpoint.addStatus(serviceUnavailable("the site is temporarily offline"));
    startCacheEndpoint.setTestForm(new TestForm());
View Full Code Here

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

    // DELETE /
    Endpoint stopCacheEndpoint = new Endpoint("/", Method.DELETE, "stop");
    stopCacheEndpoint.setDescription("Disables caching for the current site");
    stopCacheEndpoint.addFormat(Format.xml());
    stopCacheEndpoint.addStatus(ok("the cache was disabled"));
    stopCacheEndpoint.addStatus(notModified("the cache was already disabled"));
    stopCacheEndpoint.addStatus(notFound("the site does not exist"));
    stopCacheEndpoint.addStatus(serviceUnavailable("the site is temporarily offline"));
    stopCacheEndpoint.setTestForm(new TestForm());
View Full Code Here

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

    // DELETE /content
    Endpoint clearCacheEndpoint = new Endpoint("/content", Method.DELETE, "clear");
    clearCacheEndpoint.setDescription("Clear the cache for the current site");
    clearCacheEndpoint.addFormat(Format.xml());
    clearCacheEndpoint.addStatus(ok("the cache was cleared"));
    clearCacheEndpoint.addStatus(notFound("the site does not exist"));
    clearCacheEndpoint.addStatus(serviceUnavailable("the site is temporarily offline"));
    clearCacheEndpoint.setTestForm(new TestForm());
    docs.addEndpoint(Endpoint.Type.WRITE, clearCacheEndpoint);
View Full Code Here

    docs.setTitle("Weblounge Formatting Object Processor Endpoint");

    // POST /pdf
    Endpoint createPDFEndpoint = new Endpoint("/pdf", Method.POST, "createpdf");
    createPDFEndpoint.setDescription("Creates a PDF document");
    createPDFEndpoint.addFormat(new Format("pdf", "Portable Document Format", "http://en.wikipedia.org/wiki/Portable_Document_Format"));
    createPDFEndpoint.addStatus(ok("the document was created"));
    createPDFEndpoint.addStatus(badRequest("the xml document url is not a regular url"));
    createPDFEndpoint.addStatus(badRequest("the xsl document url is not a regular url"));
    createPDFEndpoint.addStatus(notFound("the xml document could not be accessed at the given address"));
    createPDFEndpoint.addStatus(notFound("the xsl document could not be accessed at the given address"));
View Full Code Here

        "modified-desc" };

    // GET /?path=x&...
    Endpoint getFileByPathEndpoint = new Endpoint("/", Method.GET, "getfile");
    getFileByPathEndpoint.setDescription("Returns a set of files or a single file if the path parameter is specified");
    getFileByPathEndpoint.addFormat(Format.xml());
    getFileByPathEndpoint.addStatus(ok("A resultset was compiled and returned as part of the response"));
    getFileByPathEndpoint.addStatus(notFound("When a path parameter was specified, and no resource was found"));
    getFileByPathEndpoint.addStatus(badRequest("An invalid path was received"));
    getFileByPathEndpoint.addStatus(serviceUnavailable("The site or its content repository is temporarily offline"));
    getFileByPathEndpoint.addOptionalParameter(new Parameter("path", Parameter.Type.String, "The resource path"));
View Full Code Here

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

    // GET /{resource}
    Endpoint getFileByURIEndpoint = new Endpoint("/{resource}", Method.GET, "getfile");
    getFileByURIEndpoint.setDescription("Returns the file with the given id");
    getFileByURIEndpoint.addFormat(Format.xml());
    getFileByURIEndpoint.addStatus(ok("the file was found and is returned as part of the response"));
    getFileByURIEndpoint.addStatus(notFound("the file was not found or could not be loaded"));
    getFileByURIEndpoint.addStatus(badRequest("an invalid file identifier was received"));
    getFileByURIEndpoint.addStatus(serviceUnavailable("the site or its content repository is temporarily offline"));
    getFileByURIEndpoint.addPathParameter(new Parameter("resource", Parameter.Type.String, "The resource identifier"));
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.