com.atlassian.gadgets.directory.internal
Class DirectoryResource

java.lang.Object
  extended by com.atlassian.gadgets.directory.internal.DirectoryResource

public class DirectoryResource
extends Object

Provides a JSON representation of the directory.


Constructor Summary
DirectoryResource(Directory directory, GadgetRequestContextFactory gadgetRequestContextFactory, ConfigurableExternalGadgetSpecStore configurableDirectory, DirectoryConfigurationPermissionChecker gadgetUrlChecker, com.atlassian.sal.api.message.I18nResolver i18n)
          Constructor.
 
Method Summary
 javax.ws.rs.core.Response deleteGadgetFromDirectory(javax.servlet.http.HttpServletRequest request, ExternalGadgetSpecId gadgetId)
           
 javax.ws.rs.core.Response getDirectory(javax.servlet.http.HttpServletRequest request)
          Returns a representation of the categories and gadgets contained in the directory.
 javax.ws.rs.core.Response putGadgetInDirectory(javax.servlet.http.HttpServletRequest request, Reader jsonContent)
          Adds the specified gadget URL to the directory listing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectoryResource

public DirectoryResource(Directory directory,
                         GadgetRequestContextFactory gadgetRequestContextFactory,
                         ConfigurableExternalGadgetSpecStore configurableDirectory,
                         DirectoryConfigurationPermissionChecker gadgetUrlChecker,
                         com.atlassian.sal.api.message.I18nResolver i18n)
Constructor.

Parameters:
directory - the Directory implementation to use
gadgetRequestContextFactory - the GadgetRequestContextFactory implementation to use
configurableDirectory - the ConfigurableExternalGadgetStore implementation to use
gadgetUrlChecker - the GadgetSpecUrlChecker implementation to
i18n - the I18nResolver implementation to use
Method Detail

getDirectory

public javax.ws.rs.core.Response getDirectory(@Context
                                              javax.servlet.http.HttpServletRequest request)
Returns a representation of the categories and gadgets contained in the directory.

Parameters:
request - context-supplied HttpServletRequest, used to resolve the user's locale
Returns:
a Response carrying the JSON/XML representation of the directory contents

putGadgetInDirectory

public javax.ws.rs.core.Response putGadgetInDirectory(@Context
                                                      javax.servlet.http.HttpServletRequest request,
                                                      Reader jsonContent)
Adds the specified gadget URL to the directory listing.

Parameters:
request - context-supplied HttpServletRequest, used to retrieve information for the user making the request
jsonContent - the post content in JSON
Returns:
a Response carrying the URL at which the gadget was added

deleteGadgetFromDirectory

public javax.ws.rs.core.Response deleteGadgetFromDirectory(@Context
                                                           javax.servlet.http.HttpServletRequest request,
                                                           ExternalGadgetSpecId gadgetId)


Copyright © 2009 Atlassian. All Rights Reserved.