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

Examples of ch.entwine.weblounge.common.impl.util.doc.EndpointDocumentation.addEndpoint()


    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"));
    updateSiteEndpoint.addOptionalParameter(new Parameter("status", Parameter.Type.Text, "The site status", "on"));
    updateSiteEndpoint.setTestForm(new TestForm());
    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());
View Full Code Here


    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);
   
    // 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());
View Full Code Here

    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());
    docs.addEndpoint(Endpoint.Type.READ, moduleEndpoint);

    return EndpointDocumentationGenerator.generate(docs);
  }

}
View Full Code Here

    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);

    // PUT /
    Endpoint startCacheEndpoint = new Endpoint("/", Method.PUT, "start");
    startCacheEndpoint.setDescription("Enables caching for the current site");
    startCacheEndpoint.addFormat(Format.xml());
View Full Code Here

    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());
    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());
View Full Code Here

    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());
    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());
View Full Code Here

    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);

    return EndpointDocumentationGenerator.generate(docs);
  }

}
View Full Code Here

    createPDFEndpoint.addStatus(notFound("the xsl document could not be accessed at the given address"));
    createPDFEndpoint.addRequiredParameter(new Parameter("xml", Parameter.Type.String, "URL to the xml document"));
    createPDFEndpoint.addRequiredParameter(new Parameter("xsl", Parameter.Type.String, "URL to the xsl document"));
    createPDFEndpoint.addOptionalParameter(new Parameter("parameters", Parameter.Type.String, "Parameters, formatted as 'a=b;c=d'"));
    createPDFEndpoint.setTestForm(new TestForm());
    docs.addEndpoint(Endpoint.Type.WRITE, createPDFEndpoint);

    return EndpointDocumentationGenerator.generate(docs);
  }

}
View Full Code Here

    getFileByPathEndpoint.addOptionalParameter(new Parameter("type", Parameter.Type.String, "The file type, e. g. 'image'"));
    getFileByPathEndpoint.addOptionalParameter(new Parameter("sort", Parameter.Type.Enum, "The sort parameter", "modified-desc", sortParams));
    getFileByPathEndpoint.addOptionalParameter(new Parameter("limit", Parameter.Type.String, "Offset within the result set", "10"));
    getFileByPathEndpoint.addOptionalParameter(new Parameter("offset", Parameter.Type.String, "Number of result items to include", "0"));
    getFileByPathEndpoint.setTestForm(new TestForm());
    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());
View Full Code Here

    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"));
    getFileByURIEndpoint.setTestForm(new TestForm());
    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());
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.