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

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


    docs.setTitle("Weblounge SQL Directory Provider");

    // GET /
    Endpoint getStatus = new Endpoint("/", Method.GET, "status");
    getStatus.setDescription("Returns the directory provider status");
    getStatus.addFormat(Format.xml());
    getStatus.addStatus(ok("status has been sent back to the client"));
    getStatus.addStatus(notFound("the site does not exist"));
    getStatus.addStatus(serviceUnavailable("the site is temporarily offline"));
    getStatus.setTestForm(new TestForm());
    docs.addEndpoint(Endpoint.Type.READ, getStatus);
View Full Code Here


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

    // PUT /status
    Endpoint enableSiteLogins = new Endpoint("/status", Method.PUT, "enable");
    enableSiteLogins.setDescription("Enables login to the site");
    enableSiteLogins.addFormat(Format.xml());
    enableSiteLogins.addStatus(ok("site logins have been enabled"));
    enableSiteLogins.addStatus(notModified("site logins were already enabled"));
    enableSiteLogins.addStatus(notFound("the site does not exist"));
    enableSiteLogins.addStatus(serviceUnavailable("the site is temporarily offline"));
    enableSiteLogins.setTestForm(new TestForm());
View Full Code Here

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

    // DELETE /status
    Endpoint disableSiteLogins = new Endpoint("/status", Method.DELETE, "disable");
    disableSiteLogins.setDescription("Disables login to the site");
    disableSiteLogins.addFormat(Format.xml());
    disableSiteLogins.addStatus(ok("site logins have been disabled"));
    disableSiteLogins.addStatus(notModified("site logins were already disabled"));
    disableSiteLogins.addStatus(notFound("the site does not exist"));
    disableSiteLogins.addStatus(serviceUnavailable("the site is temporarily offline"));
    disableSiteLogins.setTestForm(new TestForm());
View Full Code Here

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

    // POST /account
    Endpoint createAccount = new Endpoint("/account", Method.POST, "createaccount");
    createAccount.setDescription("Creates a new account in this site");
    createAccount.addFormat(Format.xml());
    createAccount.addStatus(created("the account has been created and the account's location is part of the response"));
    createAccount.addStatus(conflict("an account with that login already exists"));
    createAccount.addStatus(badRequest("the login is malformed or empty"));
    createAccount.addStatus(notFound("the site does not exist"));
    createAccount.addStatus(serviceUnavailable("the site is temporarily offline"));
View Full Code Here

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

    // GET /account/{login}
    Endpoint getAccount = new Endpoint("/account/{login}", Method.GET, "getaccount");
    getAccount.setDescription("Returns the account");
    getAccount.addFormat(Format.xml());
    getAccount.addStatus(ok("the account information has been sent back to the client"));
    getAccount.addStatus(forbidden("insufficient rights to access the account"));
    getAccount.addStatus(notFound("the account does not exist"));
    getAccount.addStatus(notFound("the site does not exist"));
    getAccount.addStatus(serviceUnavailable("the site is temporarily offline"));
View Full Code Here

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

    // PUT /account/{login}
    Endpoint updateAccount = new Endpoint("/account/{login}", Method.PUT, "updateaccount");
    updateAccount.setDescription("Updates the account");
    updateAccount.addFormat(Format.xml());
    updateAccount.addStatus(ok("the account has been updated"));
    updateAccount.addStatus(forbidden("insufficient rights to update the account"));
    updateAccount.addStatus(badRequest("if a non-existing language identifier is provided"));
    updateAccount.addStatus(notFound("the account does not exist"));
    updateAccount.addStatus(notFound("the site does not exist"));
View Full Code Here

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

    // PUT /account/{login}/password
    Endpoint updateAccountPassword = new Endpoint("/account/{login}/password", Method.PUT, "updateaccountpassword");
    updateAccountPassword.setDescription("Updates the account password");
    updateAccountPassword.addFormat(Format.xml());
    updateAccountPassword.addStatus(ok("the password has been updated"));
    updateAccountPassword.addStatus(forbidden("insufficient rights to update the account"));
    updateAccountPassword.addStatus(notFound("the account does not exist"));
    updateAccountPassword.addStatus(notFound("the site does not exist"));
    updateAccountPassword.addStatus(serviceUnavailable("the site is temporarily offline"));
View Full Code Here

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

    // PUT /account/{login}/challenge
    Endpoint updateAccountChallenge = new Endpoint("/account/{login}/challenge", Method.PUT, "updateaccountchallenge");
    updateAccountChallenge.setDescription("Updates the account challenge");
    updateAccountChallenge.addFormat(Format.xml());
    updateAccountChallenge.addStatus(ok("the challenge has been updated"));
    updateAccountChallenge.addStatus(forbidden("insufficient rights to update the account"));
    updateAccountChallenge.addStatus(notFound("the account does not exist"));
    updateAccountChallenge.addStatus(notFound("the site does not exist"));
    updateAccountChallenge.addStatus(serviceUnavailable("the site is temporarily offline"));
View Full Code Here

    docs.setTitle("Weblounge Workbench");

    // GET /edit/{page}/{composer}/{pageletindex}
    Endpoint getPageletEditor = new Endpoint("/edit/{page}/{composer}/{pageletindex}", Method.GET, "getpageleteditor");
    getPageletEditor.setDescription("Returns the editor for the given pagelet");
    getPageletEditor.addFormat(new Format("xml", null, null));
    getPageletEditor.addStatus(ok("the pagelet was found and it's editing information is returned"));
    getPageletEditor.addStatus(notFound("the page, the composer or the pagelet were not found"));
    getPageletEditor.addStatus(serviceUnavailable("the site is temporarily offline"));
    getPageletEditor.addPathParameter(new Parameter("page", Parameter.Type.String, "The page uri"));
    getPageletEditor.addPathParameter(new Parameter("composer", Parameter.Type.String, "The composer identifier"));
View Full Code Here

    getPageletEditor.setTestForm(new TestForm());
    docs.addEndpoint(Endpoint.Type.READ, getPageletEditor);
   
    Endpoint getRenderer = new Endpoint("/renderer/{page}/{composer}/{pageletindex}", Method.GET, "getrenderer");
    getRenderer.setDescription("Returns the renderer for the given pagelet");
    getRenderer.addFormat(new Format("html", null, null));
    getRenderer.addStatus(ok("the pagelet was found and it's renderer is returned"));
    getRenderer.addStatus(notFound("the page, the composer, the pagelet or the renderer were not found"));
    getRenderer.addStatus(serviceUnavailable("the site is temporarily offline"));
    getRenderer.addPathParameter(new Parameter("page", Parameter.Type.String, "The page uri"));
    getRenderer.addPathParameter(new Parameter("composer", Parameter.Type.String, "The composer 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.