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

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


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

    // GET /suggest/subjects/{hint}
    Endpoint suggestSubjects = new Endpoint("/suggest/subjects/{seed}", Method.GET, "suggestsubjects");
    suggestSubjects.setDescription("Returns suggestions for subjects based on the given seed");
    suggestSubjects.addFormat(new Format("xml", null, null));
    suggestSubjects.addStatus(ok("suggestions based on the seed are returned"));
    suggestSubjects.addStatus(serviceUnavailable("the site is temporarily offline"));
    suggestSubjects.addPathParameter(new Parameter("seed", Parameter.Type.String, "The seed on which suggestions are based"));
    suggestSubjects.addOptionalParameter(new Parameter("limit", Parameter.Type.String, "The maximum number of suggestions"));
    suggestSubjects.addOptionalParameter(new Parameter("highlight", Parameter.Type.String, "The tag name used to highlight matches"));
View Full Code Here


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

    // DELETE /account/{login}
    Endpoint deleteAccount = new Endpoint("/account/{login}", Method.DELETE, "removeaccount");
    deleteAccount.setDescription("Removes the account from the site");
    deleteAccount.addFormat(Format.xml());
    deleteAccount.addStatus(ok("the account has been removed"));
    deleteAccount.addStatus(notFound("the account does not exist"));
    deleteAccount.addStatus(notFound("the site does not exist"));
    deleteAccount.addStatus(serviceUnavailable("the site is temporarily offline"));
    deleteAccount.setTestForm(new TestForm());
View Full Code Here

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

    // PUT /account/{login}/status
    Endpoint enableAccount = new Endpoint("/account/{login}/status", Method.PUT, "enableaccount");
    enableAccount.setDescription("Enables the account");
    enableAccount.addFormat(Format.xml());
    enableAccount.addStatus(ok("the account has been enabled"));
    enableAccount.addStatus(notModified("the account was already enabled"));
    enableAccount.addStatus(forbidden("insufficient rights to enable the account"));
    enableAccount.addStatus(notFound("the account does not exist"));
    enableAccount.addStatus(notFound("the site does not exist"));
View Full Code Here

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

    // DELETE /account/{login}/status
    Endpoint disableAccount = new Endpoint("/account/{login}/status", Method.DELETE, "disableaccount");
    disableAccount.setDescription("Disables the account");
    disableAccount.addFormat(Format.xml());
    disableAccount.addStatus(ok("the account has been disabled"));
    disableAccount.addStatus(notModified("the account is already disabled"));
    disableAccount.addStatus(forbidden("insufficient rights to disable the account"));
    disableAccount.addStatus(notFound("the account does not exist"));
    disableAccount.addStatus(notFound("the site does not exist"));
View Full Code Here

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

    // POST /account/{login}/roles/{context}
    Endpoint addRole = new Endpoint("/account/{login}/roles/{context}", Method.POST, "addrole");
    addRole.setDescription("Adds a role to the account");
    addRole.addFormat(Format.xml());
    addRole.addStatus(ok("the role has been added"));
    addRole.addStatus(notModified("the role is already owned by the account"));
    addRole.addStatus(badRequest("the role parameter is blank"));
    addRole.addStatus(forbidden("insufficient rights to add the role"));
    addRole.addStatus(notFound("the account does not exist"));
View Full Code Here

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

    // DELETE /account/{login}/roles/{context}
    Endpoint removeRole = new Endpoint("/account/{login}/roles/{context}", Method.DELETE, "removerole");
    removeRole.setDescription("Removes a role from the account");
    removeRole.addFormat(Format.xml());
    removeRole.addStatus(ok("the role has been removed"));
    removeRole.addStatus(notModified("the role had not been owned by the account"));
    removeRole.addStatus(badRequest("the role parameter is blank"));
    removeRole.addStatus(forbidden("insufficient rights to remove the role"));
    removeRole.addStatus(notFound("the account does not exist"));
View Full Code Here

    docs.setTitle("Weblounge Runtime Information");

    // GET /
    Endpoint sitesEndpoint = new Endpoint("/", Method.GET, "getinfo");
    sitesEndpoint.setDescription("Returns all runtime information");
    sitesEndpoint.addFormat(Format.xml());
    sitesEndpoint.addStatus(ok("the runtime information is returned as part of the response"));
    sitesEndpoint.setTestForm(new TestForm());
    docs.addEndpoint(Endpoint.Type.READ, sitesEndpoint);

    // GET /{component}
View Full Code Here

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

    // GET /{component}
    Endpoint siteEndpoint = new Endpoint("/{component}", Method.GET, "getcomponent");
    siteEndpoint.setDescription("Returns the specified part of the runtime information");
    siteEndpoint.addFormat(Format.xml());
    siteEndpoint.addStatus(ok("the component was found and the corresponding runtime information is returned as part of the response"));
    siteEndpoint.addStatus(notFound("the component was not found"));
    siteEndpoint.addPathParameter(new Parameter("component", Parameter.Type.String, "The runtime information component"));
    siteEndpoint.setTestForm(new TestForm());
    docs.addEndpoint(Endpoint.Type.READ, siteEndpoint);
View Full Code Here

    docs.setTitle("Weblounge Sites");

    // GET /
    Endpoint sitesEndpoint = new Endpoint("/", Method.GET, "getsites");
    sitesEndpoint.setDescription("Returns all sites");
    sitesEndpoint.addFormat(Format.xml());
    sitesEndpoint.addStatus(ok("the sites are returned as part of the response"));
    sitesEndpoint.setTestForm(new TestForm());
    docs.addEndpoint(Endpoint.Type.READ, sitesEndpoint);

    // GET /{site}
View Full Code Here

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

    // GET /{site}
    Endpoint siteEndpoint = new Endpoint("/{site}", Method.GET, "getsite");
    siteEndpoint.setDescription("Returns the site with the given id");
    siteEndpoint.addFormat(Format.xml());
    siteEndpoint.addStatus(ok("the site was found and is returned as part of the response"));
    siteEndpoint.addStatus(notFound("the site was not found"));
    siteEndpoint.addPathParameter(new Parameter("site", Parameter.Type.String, "The site identifier"));
    siteEndpoint.setTestForm(new TestForm());
    docs.addEndpoint(Endpoint.Type.READ, siteEndpoint);
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.