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

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


    getPageletEditor.addPathParameter(new Parameter("page", Parameter.Type.String, "The page uri"));
    getPageletEditor.addPathParameter(new Parameter("composer", Parameter.Type.String, "The composer identifier"));
    getPageletEditor.addPathParameter(new Parameter("pageletindex", Parameter.Type.String, "The pagelet's index within the composer (0 based)"));
    getPageletEditor.addOptionalParameter(new Parameter("language", Parameter.Type.String, "The language id"));
    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"));
View Full Code Here


    getRenderer.addPathParameter(new Parameter("page", Parameter.Type.String, "The page uri"));
    getRenderer.addPathParameter(new Parameter("composer", Parameter.Type.String, "The composer identifier"));
    getRenderer.addPathParameter(new Parameter("pageletindex", Parameter.Type.String, "The pagelet's index within the composer (0 based)"));
    getRenderer.addOptionalParameter(new Parameter("language", Parameter.Type.String, "The language id"));
    getRenderer.setTestForm(new TestForm());
    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));
View Full Code Here

    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"));
    suggestSubjects.setTestForm(new TestForm());
    docs.addEndpoint(Endpoint.Type.READ, suggestSubjects);

    return EndpointDocumentationGenerator.generate(docs);
  }

}
View Full Code Here

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

    // PUT /status
    Endpoint enableSiteLogins = new Endpoint("/status", Method.PUT, "enable");
    enableSiteLogins.setDescription("Enables login to the site");
    enableSiteLogins.addFormat(Format.xml());
View Full Code Here

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

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

    createAccount.addStatus(serviceUnavailable("the site is temporarily offline"));
    createAccount.setTestForm(new TestForm());
    createAccount.addRequiredParameter(new Parameter("login", Parameter.Type.String, "Unique login name"));
    createAccount.addRequiredParameter(new Parameter("password", Parameter.Type.Password, "Password"));
    createAccount.addOptionalParameter(new Parameter("email", Parameter.Type.String, "E-mail address"));
    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());
View Full Code Here

    getAccount.addStatus(notFound("the account does not exist"));
    getAccount.addStatus(notFound("the site does not exist"));
    getAccount.addStatus(serviceUnavailable("the site is temporarily offline"));
    getAccount.setTestForm(new TestForm());
    getAccount.addPathParameter(new Parameter("login", Parameter.Type.String, "Login name"));
    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());
View Full Code Here

    updateAccount.addOptionalParameter(new Parameter("email", Parameter.Type.String, "E-mail address"));
    updateAccount.addOptionalParameter(new Parameter("firstname", Parameter.Type.String, "First name"));
    updateAccount.addOptionalParameter(new Parameter("lastname", Parameter.Type.String, "Last name"));
    updateAccount.addOptionalParameter(new Parameter("initials", Parameter.Type.String, "Initials"));
    updateAccount.addOptionalParameter(new Parameter("language", Parameter.Type.String, "Two letter ISO code for the preferred language"));
    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());
View Full Code Here

    updateAccountPassword.addStatus(notFound("the site does not exist"));
    updateAccountPassword.addStatus(serviceUnavailable("the site is temporarily offline"));
    updateAccountPassword.setTestForm(new TestForm());
    updateAccountPassword.addPathParameter(new Parameter("login", Parameter.Type.String, "Unique login name"));
    updateAccountPassword.addOptionalParameter(new Parameter("password", Parameter.Type.Password, "Password"));
    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());
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.