|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.gadgets.dashboard.internal.rest.GadgetResource
public class GadgetResource
Provides REST endpoints for manipulating a Gadget.
| Constructor Summary | |
|---|---|
GadgetResource(DashboardPermissionService permissionService,
DashboardRepository repository,
GadgetRequestContextFactory gadgetRequestContextFactory,
AddGadgetHandler addGadgetHandler,
DeleteGadgetHandler deleteGadgetHandler,
ChangeGadgetColorHandler changeGadgetColorHandler,
UpdateGadgetUserPrefsHandler updateGadgetUserPrefsHandler,
com.atlassian.sal.api.message.I18nResolver i18n,
RepresentationFactory representationFactory)
Constructor. |
|
| Method Summary | |
|---|---|
javax.ws.rs.core.Response |
changeGadgetColor(DashboardId dashboardId,
GadgetId gadgetId,
String colorParam,
javax.servlet.http.HttpServletRequest request)
Changes the specified gadget's color in response to a PUT request. |
javax.ws.rs.core.Response |
changeGadgetColorViaPOST(String method,
DashboardId dashboardId,
GadgetId gadgetId,
String colorParam,
javax.servlet.http.HttpServletRequest request)
Forwards POST requests (coming from Ajax or web browsers) to the PUT handler for color changing. |
javax.ws.rs.core.Response |
deleteGadget(DashboardId dashboardId,
GadgetId gadgetId,
javax.servlet.http.HttpServletRequest request)
Deletes the specified gadget from the specified dashboard when invoked as a DELETE request. |
javax.ws.rs.core.Response |
deleteOrMoveGadgetViaPost(String method,
DashboardId dashboardId,
GadgetId gadgetId,
javax.servlet.http.HttpServletRequest request)
Deletes or moves the specified gadget from the specified dashboard when invoked as a POST request. |
javax.ws.rs.core.Response |
getRenderedGadget(DashboardId dashboardId,
GadgetId gadgetId,
javax.servlet.http.HttpServletRequest request)
Returns a Gadget's JSON or XMl representation. |
javax.ws.rs.core.Response |
moveGadget(DashboardId targetDashboardId,
GadgetId gadgetId,
javax.servlet.http.HttpServletRequest request)
Moves the specified gadget to the specified dashboard. |
javax.ws.rs.core.Response |
updateUserPrefsViaPOST(String method,
DashboardId dashboardId,
GadgetId gadgetId,
javax.servlet.http.HttpServletRequest request,
javax.ws.rs.core.MultivaluedMap<String,String> formParams)
Forwards POST requests (coming from Ajax or web browsers) to the PUT handler for user pref changes. |
javax.ws.rs.core.Response |
updateUserPrefsViaPUT(DashboardId dashboardId,
GadgetId gadgetId,
javax.servlet.http.HttpServletRequest request,
javax.ws.rs.core.UriInfo uriInfo)
Updates the user prefs of the specified gadget. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GadgetResource(DashboardPermissionService permissionService,
DashboardRepository repository,
GadgetRequestContextFactory gadgetRequestContextFactory,
AddGadgetHandler addGadgetHandler,
DeleteGadgetHandler deleteGadgetHandler,
ChangeGadgetColorHandler changeGadgetColorHandler,
UpdateGadgetUserPrefsHandler updateGadgetUserPrefsHandler,
com.atlassian.sal.api.message.I18nResolver i18n,
RepresentationFactory representationFactory)
permissionService - the PermissionService to userepository - the DashboardRepository to usegadgetRequestContextFactory - the GadgetRequestContextFactory to useaddGadgetHandler - the AddGadgetHandler to usedeleteGadgetHandler - the DeleteGadgetHandler to usechangeGadgetColorHandler - the ChangeGadgetColorHandler to useupdateGadgetUserPrefsHandler - the UpdateGadgetUserPrefsHandler to usei18n - the SAL I18nResolver to userepresentationFactory - Used to created JAXB Gadget representations| Method Detail |
|---|
public javax.ws.rs.core.Response getRenderedGadget(DashboardId dashboardId,
GadgetId gadgetId,
@Context
javax.servlet.http.HttpServletRequest request)
dashboardId - the id of the dashboard which it belongs togadgetId - the ID of the gadget to returnrequest - the HttpServletRequest that was routed here
public javax.ws.rs.core.Response deleteOrMoveGadgetViaPost(String method,
DashboardId dashboardId,
GadgetId gadgetId,
@Context
javax.servlet.http.HttpServletRequest request)
method - the HTTP method to forward to ("delete" does a delete, "put" does a move)dashboardId - ID of the dashboard hosting the gadgetgadgetId - ID of the gadgetrequest - the request object (used for providing the locale)
Response with details on the request's success or
failure
public javax.ws.rs.core.Response deleteGadget(DashboardId dashboardId,
GadgetId gadgetId,
@Context
javax.servlet.http.HttpServletRequest request)
dashboardId - ID of the dashboard hosting the gadgetgadgetId - ID of the gadget to removerequest - the request object (used for providing the locale)
Response with details on the request's success or
failure
public javax.ws.rs.core.Response moveGadget(DashboardId targetDashboardId,
GadgetId gadgetId,
@Context
javax.servlet.http.HttpServletRequest request)
targetDashboardId - the dashboard id for the dashboard to which this gadget should be addedgadgetId - the id of the gadget to moverequest - the request object
Response with details on the request's success or failure
public javax.ws.rs.core.Response changeGadgetColorViaPOST(String method,
DashboardId dashboardId,
GadgetId gadgetId,
String colorParam,
@Context
javax.servlet.http.HttpServletRequest request)
method - the HTTP method to forward to (must be "put")dashboardId - ID of the dashboard hosting the gadgetgadgetId - ID of the gadget which will change colorcolorParam - new color of the gadgetrequest - the request object (used for providing the locale)
Response with details on the request's success or
failure
public javax.ws.rs.core.Response changeGadgetColor(DashboardId dashboardId,
GadgetId gadgetId,
String colorParam,
@Context
javax.servlet.http.HttpServletRequest request)
dashboardId - ID of the dashboard hosting the gadgetgadgetId - ID of the gadget which will change colorcolorParam - new color of the gadgetrequest - the request object (used for providing the locale)
Response with details on the request's success or
failure
public javax.ws.rs.core.Response updateUserPrefsViaPOST(String method,
DashboardId dashboardId,
GadgetId gadgetId,
@Context
javax.servlet.http.HttpServletRequest request,
javax.ws.rs.core.MultivaluedMap<String,String> formParams)
Forwards POST requests (coming from Ajax or web browsers) to the PUT handler for user pref changes.
method - the HTTP method to forward to (must be "put")dashboardId - ID of the dashboard hosting the gadgetgadgetId - ID of the gadget to update the prefs forrequest - the request object (used for providing the locale)formParams - the container for the form parameters
Response with details on the request's success or
failure
public javax.ws.rs.core.Response updateUserPrefsViaPUT(DashboardId dashboardId,
GadgetId gadgetId,
@Context
javax.servlet.http.HttpServletRequest request,
@Context
javax.ws.rs.core.UriInfo uriInfo)
dashboardId - ID of the dashboard hosting the gadgetgadgetId - ID of the gadget to update the prefs forrequest - the request object (used for providing the locale)uriInfo - provides the query parameters for the user pref
values
Response with details on the request's success or
failure
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||