com.atlassian.gadgets.dashboard.internal.rest
Class AddGadgetHandlerImpl

java.lang.Object
  extended by com.atlassian.gadgets.dashboard.internal.rest.AddGadgetHandlerImpl
All Implemented Interfaces:
AddGadgetHandler

public class AddGadgetHandlerImpl
extends Object
implements AddGadgetHandler

Default implementation that adds a gadget to a live dashboard.


Constructor Summary
AddGadgetHandlerImpl(GadgetSpecUrlChecker gadgetUrlChecker, GadgetFactory gadgetFactory, DashboardRepository repository, RepresentationFactory representationFactory, com.atlassian.sal.api.message.I18nResolver i18n, com.atlassian.sal.api.transaction.TransactionTemplate txTemplate)
          Constructor.
 
Method Summary
 javax.ws.rs.core.Response addGadget(DashboardId dashboardId, GadgetRequestContext gadgetRequestContext, String gadgetUrl)
          Adds the specified gadget to the specified dashboard.
 javax.ws.rs.core.Response addGadget(DashboardId dashboardId, GadgetRequestContext gadgetRequestContext, String gadgetUrl, DashboardState.ColumnIndex columnIndex)
          Adds the specified gadget to the specified dashboard in the specified column.
 javax.ws.rs.core.Response moveGadget(DashboardId targetDashboardId, GadgetId gadgetId, DashboardId sourceDashboardId, DashboardState.ColumnIndex columnIndex, int rowIndex, GadgetRequestContext gadgetRequestContext)
          Moves the gadget specified by id from the source dashboard to the target dashboard.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AddGadgetHandlerImpl

public AddGadgetHandlerImpl(GadgetSpecUrlChecker gadgetUrlChecker,
                            GadgetFactory gadgetFactory,
                            DashboardRepository repository,
                            RepresentationFactory representationFactory,
                            com.atlassian.sal.api.message.I18nResolver i18n,
                            com.atlassian.sal.api.transaction.TransactionTemplate txTemplate)
Constructor.

Parameters:
gadgetUrlChecker - checks that the gadget can be added to a dashboard
gadgetFactory - used to create the gadget domain object
repository - persists dashboard changes
representationFactory - Factory used to create the JAXB representation of a gadget
i18n - the SAL I18nResolver to use
txTemplate - transaction template needed for the 'move' operation
Method Detail

addGadget

public javax.ws.rs.core.Response addGadget(DashboardId dashboardId,
                                           GadgetRequestContext gadgetRequestContext,
                                           String gadgetUrl)
Description copied from interface: AddGadgetHandler
Adds the specified gadget to the specified dashboard.

Specified by:
addGadget in interface AddGadgetHandler
Parameters:
dashboardId - the ID of the dashboard to add to
gadgetRequestContext - the context of this request
gadgetUrl - the URL to the gadget spec
Returns:
a Response for the client with details on the success or failure

addGadget

public javax.ws.rs.core.Response addGadget(DashboardId dashboardId,
                                           GadgetRequestContext gadgetRequestContext,
                                           String gadgetUrl,
                                           DashboardState.ColumnIndex columnIndex)
Description copied from interface: AddGadgetHandler
Adds the specified gadget to the specified dashboard in the specified column.

Specified by:
addGadget in interface AddGadgetHandler
Parameters:
dashboardId - the ID of the dashboard to add to
gadgetRequestContext - the context of this request
gadgetUrl - the URL to the gadget spec
columnIndex - the column index to add the gadget to
Returns:
a Response for the client with details on the success or failure

moveGadget

public javax.ws.rs.core.Response moveGadget(DashboardId targetDashboardId,
                                            GadgetId gadgetId,
                                            DashboardId sourceDashboardId,
                                            DashboardState.ColumnIndex columnIndex,
                                            int rowIndex,
                                            GadgetRequestContext gadgetRequestContext)
Description copied from interface: AddGadgetHandler
Moves the gadget specified by id from the source dashboard to the target dashboard.

Specified by:
moveGadget in interface AddGadgetHandler
Parameters:
targetDashboardId - The dashboard to move the gadget to
gadgetId - The gadget to move
sourceDashboardId - The source dashboard where the gadget will be deleted
columnIndex - The column to add the gadget to
rowIndex - The row to insert the gadget in
gadgetRequestContext - the context of this request
Returns:
a Response for the client with details on the success or failure


Copyright © 2010 Atlassian. All Rights Reserved.