|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.gadgets.dashboard.internal.rest.GadgetResource
public class GadgetResource
Provides REST endpoints for manipulating a Gadget.
Constructor Summary | |
---|---|
GadgetResource(com.atlassian.gadgets.dashboard.spi.DashboardPermissionService permissionService,
DashboardRepository repository,
com.atlassian.gadgets.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(com.atlassian.gadgets.dashboard.DashboardId dashboardId,
com.atlassian.gadgets.GadgetId gadgetId,
javax.servlet.http.HttpServletRequest request,
String entity)
Changes the specified gadget's color in response to a PUT request. |
javax.ws.rs.core.Response |
changeGadgetColorViaPOST(String method,
com.atlassian.gadgets.dashboard.DashboardId dashboardId,
com.atlassian.gadgets.GadgetId gadgetId,
javax.servlet.http.HttpServletRequest request,
String entity)
Forwards POST requests (coming from Ajax or web browsers) to the PUT handler for color changing. |
javax.ws.rs.core.Response |
deleteGadget(com.atlassian.gadgets.dashboard.DashboardId dashboardId,
com.atlassian.gadgets.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,
com.atlassian.gadgets.dashboard.DashboardId dashboardId,
com.atlassian.gadgets.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(com.atlassian.gadgets.dashboard.DashboardId dashboardId,
com.atlassian.gadgets.GadgetId gadgetId,
javax.servlet.http.HttpServletRequest request)
Returns a Gadget's JSON or XMl representation. |
javax.ws.rs.core.Response |
moveGadget(com.atlassian.gadgets.dashboard.DashboardId targetDashboardId,
com.atlassian.gadgets.GadgetId gadgetId,
javax.servlet.http.HttpServletRequest request)
Moves the specified gadget to the specified dashboard. |
javax.ws.rs.core.Response |
updateUserPrefsViaPOST(String method,
com.atlassian.gadgets.dashboard.DashboardId dashboardId,
com.atlassian.gadgets.GadgetId gadgetId,
javax.servlet.http.HttpServletRequest request,
String entity)
Forwards POST requests (coming from Ajax or web browsers) to the PUT handler for user pref changes. |
javax.ws.rs.core.Response |
updateUserPrefsViaPUT(com.atlassian.gadgets.dashboard.DashboardId dashboardId,
com.atlassian.gadgets.GadgetId gadgetId,
javax.servlet.http.HttpServletRequest request,
String entity)
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(com.atlassian.gadgets.dashboard.spi.DashboardPermissionService permissionService, DashboardRepository repository, com.atlassian.gadgets.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 representationsMethod Detail |
---|
public javax.ws.rs.core.Response getRenderedGadget(com.atlassian.gadgets.dashboard.DashboardId dashboardId, com.atlassian.gadgets.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(@HeaderParam(value="X-HTTP-Method-Override") String method, com.atlassian.gadgets.dashboard.DashboardId dashboardId, com.atlassian.gadgets.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
failurepublic javax.ws.rs.core.Response deleteGadget(com.atlassian.gadgets.dashboard.DashboardId dashboardId, com.atlassian.gadgets.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
failurepublic javax.ws.rs.core.Response moveGadget(com.atlassian.gadgets.dashboard.DashboardId targetDashboardId, com.atlassian.gadgets.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 failurepublic javax.ws.rs.core.Response changeGadgetColorViaPOST(@HeaderParam(value="X-HTTP-Method-Override") String method, com.atlassian.gadgets.dashboard.DashboardId dashboardId, com.atlassian.gadgets.GadgetId gadgetId, @Context javax.servlet.http.HttpServletRequest request, String entity)
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 colorrequest
- the request object (used for providing the locale)entity
- JSON object containing one key, "color", mapped to the new color of the gadget
Response
with details on the request's success or failurepublic javax.ws.rs.core.Response changeGadgetColor(com.atlassian.gadgets.dashboard.DashboardId dashboardId, com.atlassian.gadgets.GadgetId gadgetId, @Context javax.servlet.http.HttpServletRequest request, String entity)
dashboardId
- ID of the dashboard hosting the gadgetgadgetId
- ID of the gadget which will change colorrequest
- the request object (used for providing the locale)entity
- JSON object containing one key, "color", mapped to the new color of the gadget
Response
with details on the request's success or failurepublic javax.ws.rs.core.Response updateUserPrefsViaPOST(@HeaderParam(value="X-HTTP-Method-Override") String method, com.atlassian.gadgets.dashboard.DashboardId dashboardId, com.atlassian.gadgets.GadgetId gadgetId, @Context javax.servlet.http.HttpServletRequest request, String entity)
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)entity
- the container for the form parameters
Response
with details on the request's success or failurepublic javax.ws.rs.core.Response updateUserPrefsViaPUT(com.atlassian.gadgets.dashboard.DashboardId dashboardId, com.atlassian.gadgets.GadgetId gadgetId, @Context javax.servlet.http.HttpServletRequest request, String entity)
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)entity
- the container 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 |