com.atlassian.gadgets.dashboard.internal.impl
Class DashboardUrlBuilderImpl

java.lang.Object
  extended by com.atlassian.gadgets.util.AbstractUrlBuilder
      extended by com.atlassian.gadgets.dashboard.internal.impl.DashboardUrlBuilderImpl
All Implemented Interfaces:
DashboardUrlBuilder, UrlBuilder

public class DashboardUrlBuilderImpl
extends AbstractUrlBuilder
implements DashboardUrlBuilder


Field Summary
 
Fields inherited from class com.atlassian.gadgets.util.AbstractUrlBuilder
applicationProperties, webResourceManager
 
Constructor Summary
DashboardUrlBuilderImpl(com.atlassian.sal.api.ApplicationProperties applicationProperties, com.atlassian.plugin.webresource.WebResourceManager webResourceManager)
           
 
Method Summary
 String buildDashboardDiagnosticsRelativeUrl()
          Returns a relative URL that can be used to access the Dashboard Diagnostics Servlet.
 String buildDashboardDirectoryBaseUrl()
          Returns the base URL of the directory
 String buildDashboardDirectoryResourceUrl()
          Returns a URL that can be used to retrieve the list of available gadgets in the directory or to post a new gadget spec URL to the directory.
 String buildDashboardDirectoryUrl(DashboardId dashboardId)
          Returns a URL that can be used to post a new gadget to the directory.
 String buildDashboardLayoutUrl(DashboardId dashboardId)
          Returns the URL to the layout resource of a dashboard.
 String buildDashboardResourceUrl(DashboardId dashboardId)
          Returns a URL that can be used to access the Dashboard resource, to post new gadgets.
 String buildDashboardUrl(DashboardId dashboardId)
          Returns the URL to the dashboard container.
 String buildErrorGadgetUrl()
          Returns a URL that can be used to display an error message when there is a problem loading a gadget.
 String buildGadgetColorUrl(DashboardId dashboardId, GadgetId gadgetId)
          Returns the URL to the color resource of a gadget.
 String buildGadgetUrl(DashboardId dashboardId, GadgetId gadgetId)
          Returns the URL to a gadget resource on a dashboard.
 String buildGadgetUserPrefsUrl(DashboardId dashboardId, GadgetId gadgetId)
          Returns the URL to the user prefs resource of a gadget.
 String buildSecurityTokensUrl()
          Returns the URL for getting new security tokens.
protected  String getBaseUrl()
          Overridden to return REST URIs instead of servlet URLs.
 
Methods inherited from class com.atlassian.gadgets.util.AbstractUrlBuilder
buildImageUrl, buildRpcJsUrl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.gadgets.dashboard.internal.DashboardUrlBuilder
buildRpcJsUrl
 
Methods inherited from interface com.atlassian.gadgets.util.UrlBuilder
buildImageUrl
 

Constructor Detail

DashboardUrlBuilderImpl

public DashboardUrlBuilderImpl(com.atlassian.sal.api.ApplicationProperties applicationProperties,
                               com.atlassian.plugin.webresource.WebResourceManager webResourceManager)
Method Detail

getBaseUrl

protected String getBaseUrl()
Overridden to return REST URIs instead of servlet URLs.

Overrides:
getBaseUrl in class AbstractUrlBuilder
Returns:
the base of the REST URI to a dashboard/gadget resource

buildDashboardUrl

public String buildDashboardUrl(DashboardId dashboardId)
Description copied from interface: DashboardUrlBuilder
Returns the URL to the dashboard container.

Specified by:
buildDashboardUrl in interface DashboardUrlBuilder
Parameters:
dashboardId - the dashboard ID to return the URL for
Returns:
the URL to the dashboard container.

buildDashboardLayoutUrl

public String buildDashboardLayoutUrl(DashboardId dashboardId)
Description copied from interface: DashboardUrlBuilder
Returns the URL to the layout resource of a dashboard.

Specified by:
buildDashboardLayoutUrl in interface DashboardUrlBuilder
Parameters:
dashboardId - DashboardId of the dashboard that we want the layout resource URL of
Returns:
the URL to the layout resource of the dashboard

buildGadgetUrl

public String buildGadgetUrl(DashboardId dashboardId,
                             GadgetId gadgetId)
Description copied from interface: DashboardUrlBuilder
Returns the URL to a gadget resource on a dashboard.

Specified by:
buildGadgetUrl in interface DashboardUrlBuilder
Parameters:
dashboardId - DashboardId to find the GadgetId on
gadgetId - GadgetId of the gadget we want the resource URL of
Returns:
the URL to a gadget resource on a dashboard

buildGadgetColorUrl

public String buildGadgetColorUrl(DashboardId dashboardId,
                                  GadgetId gadgetId)
Description copied from interface: DashboardUrlBuilder
Returns the URL to the color resource of a gadget.

Specified by:
buildGadgetColorUrl in interface DashboardUrlBuilder
Parameters:
dashboardId - DashboardId to find the GadgetId on
gadgetId - GadgetId of the gadget we want the color resource URL of
Returns:
the URL to the color resource of a gadget

buildGadgetUserPrefsUrl

public String buildGadgetUserPrefsUrl(DashboardId dashboardId,
                                      GadgetId gadgetId)
Description copied from interface: DashboardUrlBuilder
Returns the URL to the user prefs resource of a gadget.

Specified by:
buildGadgetUserPrefsUrl in interface DashboardUrlBuilder
Parameters:
dashboardId - DashboardId to find the GadgetId on
gadgetId - GadgetId of the gadget we want the user prefs resource URL of
Returns:
the URL to the user prefs resource of a gadget

buildErrorGadgetUrl

public String buildErrorGadgetUrl()
Description copied from interface: DashboardUrlBuilder
Returns a URL that can be used to display an error message when there is a problem loading a gadget.

Specified by:
buildErrorGadgetUrl in interface DashboardUrlBuilder
Returns:
URL that can be used to display an error message when there is a problem loading a gadget.

buildDashboardResourceUrl

public String buildDashboardResourceUrl(DashboardId dashboardId)
Description copied from interface: DashboardUrlBuilder
Returns a URL that can be used to access the Dashboard resource, to post new gadgets.

Specified by:
buildDashboardResourceUrl in interface DashboardUrlBuilder
Parameters:
dashboardId - the ID of the dashboard to post gadgets to
Returns:
URL that can be used to access the Dashboard resource, to post new gadgets.

buildDashboardDirectoryResourceUrl

public String buildDashboardDirectoryResourceUrl()
Description copied from interface: DashboardUrlBuilder
Returns a URL that can be used to retrieve the list of available gadgets in the directory or to post a new gadget spec URL to the directory.

Specified by:
buildDashboardDirectoryResourceUrl in interface DashboardUrlBuilder
Returns:
URL that can be used to retrieve the list of available gadgets in the directory or to post a new gadget spec URL to the directory.

buildDashboardDirectoryBaseUrl

public String buildDashboardDirectoryBaseUrl()
Description copied from interface: DashboardUrlBuilder
Returns the base URL of the directory

Specified by:
buildDashboardDirectoryBaseUrl in interface DashboardUrlBuilder
Returns:
the base URL of the directory

buildDashboardDirectoryUrl

public String buildDashboardDirectoryUrl(DashboardId dashboardId)
Description copied from interface: DashboardUrlBuilder
Returns a URL that can be used to post a new gadget to the directory.

Specified by:
buildDashboardDirectoryUrl in interface DashboardUrlBuilder
Parameters:
dashboardId - the ID of the dashboard to post gadgets to
Returns:
URL that can be used to post a new gadget to the directory.

buildDashboardDiagnosticsRelativeUrl

public String buildDashboardDiagnosticsRelativeUrl()
Description copied from interface: DashboardUrlBuilder
Returns a relative URL that can be used to access the Dashboard Diagnostics Servlet.

Specified by:
buildDashboardDiagnosticsRelativeUrl in interface DashboardUrlBuilder
Returns:
relative URL that can be used to access the Dashboard Diagnostics Servlet.

buildSecurityTokensUrl

public String buildSecurityTokensUrl()
Description copied from interface: DashboardUrlBuilder
Returns the URL for getting new security tokens.

Specified by:
buildSecurityTokensUrl in interface DashboardUrlBuilder
Returns:
URL for getting new security tokens.


Copyright © 2010 Atlassian. All Rights Reserved.