Example #1
0
 static {
   DESC.setTitle("Patch");
   DESC.setBackUrl("../__describe__");
   DESC.setShortDescription("Patches a json resource name value pairs.");
   DESC.addSection(
       1,
       "Introduction",
       "This service allows the modification of name value pairs within a resource.");
   DESC.addSection(
       2,
       "Patch ",
       "Performs a patch operation, and returns  "
           + HttpServletResponse.SC_OK
           + " on sucess, if the resource does not exis a "
           + HttpServletResponse.SC_NOT_FOUND
           + " is returned ");
   DESC.addURLTemplate(
       "/rest/" + KEY + "/" + PRIVATE + "/<resource>",
       "Accepts POST to patch the contents of a private file");
   DESC.addURLTemplate(
       "/rest/" + KEY + "/" + SHARED + "/<resource>",
       "Accepts POST to patch the contents of a private file");
   DESC.addSection(2, "POST", "");
   DESC.addParameter(NAME, "multiple value, An array of property names");
   DESC.addParameter(VALUE, "multiple value, An array of property values");
   DESC.addParameter(
       ACTION,
       "multiple value, An array of action values "
           + UPDATE_ACTION
           + " or "
           + REMOVE_ACTION
           + " where "
           + UPDATE_ACTION
           + " will add a value that is not present ");
   DESC.addParameter(
       INDEX,
       "multiple value, An array of property idex flags, if 1 the corresponding key is indexed, if 0 it is not");
   DESC.addResponse(String.valueOf(HttpServletResponse.SC_OK), "If the action completed Ok");
   DESC.addResponse(
       String.valueOf(HttpServletResponse.SC_FORBIDDEN),
       "If permission to modify the resource is denied");
   DESC.addResponse(
       String.valueOf(HttpServletResponse.SC_INTERNAL_SERVER_ERROR), " Any other error");
 }
Example #2
0
  static {
    DESC.setTitle("Friends");
    DESC.setBackUrl("../__describe__");
    DESC.setShortDescription("Managed Friend Pairs");
    DESC.addSection(1, "Introduction", "This service allows the management of a friends list.");
    DESC.addSection(
        2,
        "Connect ",
        "A client may request a connection to a friend, with with the connect/request service. This starts a simple workflow"
            + "between the users. Once requesting, the requesting user may cancel the request. The invited friend may accept, reject or ignore"
            + "the request. For all these actions the response status code is "
            + HttpServletResponse.SC_OK
            + ", if the operation is denied "
            + "as a result of a conflicting record the response status code is  "
            + HttpServletResponse.SC_CONFLICT);
    DESC.addSection(
        2,
        "Status ",
        "Responds with the current users friends records. Super admins may request other users friends records.  ");

    DESC.addURLTemplate(
        "/rest/" + KEY + "/" + PathElement.status + "/" + "/<userid>",
        "Accepts GET to remove get the friend list for a user. A super user may specify the user who is performing the "
            + "accept, otherwise its the current user. ");
    DESC.addURLTemplate(
        "/rest/" + KEY + "/" + PathElement.connect + "/" + PathElement.request + "/<userid>",
        "Accepts POST to invite a friend to this user id. A super user may specify the user who is performing the "
            + "invite, otherwise its the current user. The post must be accompanied by a text message and a friend to invite.");
    DESC.addURLTemplate(
        "/rest/" + KEY + "/" + PathElement.connect + "/" + PathElement.accept + "/<userid>",
        "Accepts POST to accept an earlier invitation. A super user may specify the user who is performing the "
            + "accept, otherwise its the current user. The post must be accompanied by friend to accept.");
    DESC.addURLTemplate(
        "/rest/" + KEY + "/" + PathElement.connect + "/" + PathElement.reject + "/<userid>",
        "Accepts POST to reject an earlier invitation. A super user may specify the user who is performing the "
            + "reject, otherwise its the current user. The post must be accompanied by friend to reject, the target user will be notified.");
    DESC.addURLTemplate(
        "/rest/" + KEY + "/" + PathElement.connect + "/" + PathElement.ignore + "/<userid>",
        "Accepts POST to ignore an earlier invitation. A super user may specify the user who is performing the "
            + "ignore, otherwise its the current user. The post must be accompanied by friend to reject, the target user will not be notified.");
    DESC.addURLTemplate(
        "/rest/" + KEY + "/" + PathElement.connect + "/" + PathElement.cancel + "/<userid>",
        "Accepts POST to cancel an earlier invitation. A super user may specify the user who is performing the "
            + "accept, otherwise its the current user. The post must be accompanied by friend to cancel.");
    DESC.addURLTemplate(
        "/rest/" + KEY + "/" + PathElement.connect + "/" + PathElement.remove + "/<userid>",
        "Accepts POST to remove an earlier connection. A super user may specify the user who is performing the "
            + "accept, otherwise its the current user. The post must be accompanied by friend to cancel.");
    DESC.addSection(2, "POST", "");
    DESC.addParameter(FriendsParams.FRIENDUUID, "the UUID of the friend");
    DESC.addParameter(
        FriendsParams.FRIENDTYPE,
        "the type of the friend, a string associated with the connection.");
    DESC.addParameter(
        FriendsParams.FRIENDSTATUS, "filter a status request to only retrune the type requested.");
    DESC.addParameter(
        FriendsParams.MESSAGE, "the message associated with the request, required for requests");
    DESC.addParameter(
        FriendsParams.PAGE, "the page of friends to respond with. (optional, default all)");
    DESC.addParameter(
        FriendsParams.NRESUTS_PER_PAGE, "the number of friends per page. (optional, default 10)");
    DESC.addParameter(
        FriendsParams.SORT,
        "an array of fields to sort on from "
            + Arrays.toString(FriendsSortField.values())
            + " (optional)");
    DESC.addParameter(
        FriendsParams.SORTORDER,
        "an array of directions to sort, from "
            + Arrays.toString(FriendsSortOrder.values())
            + " (optional)");
    DESC.addResponse(String.valueOf(HttpServletResponse.SC_OK), "If the action completed Ok");
    DESC.addResponse(
        String.valueOf(HttpServletResponse.SC_CONFLICT),
        "If the request could not be compelted at this time");
    DESC.addResponse(
        String.valueOf(HttpServletResponse.SC_FORBIDDEN),
        "If permission to manage the connection is denied");
    DESC.addResponse(
        String.valueOf(HttpServletResponse.SC_INTERNAL_SERVER_ERROR), " Any other error");
  }