com.atlassian.gadgets.renderer.internal
Class AtlassianContainerConfig

java.lang.Object
  extended by com.atlassian.gadgets.renderer.internal.AtlassianContainerConfig
All Implemented Interfaces:
org.apache.shindig.common.ContainerConfig

public class AtlassianContainerConfig
extends Object
implements org.apache.shindig.common.ContainerConfig

Overrides the default implementation of ContainerConfig so that we can use our own configuration and have a chance to customize it for the specific deployment of the application using ApplicationProperties.


Field Summary
 
Fields inherited from interface org.apache.shindig.common.ContainerConfig
DEFAULT_CONTAINER
 
Constructor Summary
AtlassianContainerConfig(com.atlassian.sal.api.ApplicationProperties applicationProperties)
           
 
Method Summary
 String get(String container, String parameter)
           
 Collection<String> getContainers()
           
 Object getJson(String container, String parameter)
          Fetches a configuration parameter as a JSON object, array, string, or number, ensuring that it can be safely passed to javascript without any additional filtering.
 org.json.JSONArray getJsonArray(String container, String parameter)
           
 org.json.JSONObject getJsonObject(String container, String parameter)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AtlassianContainerConfig

public AtlassianContainerConfig(com.atlassian.sal.api.ApplicationProperties applicationProperties)
                         throws org.apache.shindig.common.ContainerConfigException
Throws:
org.apache.shindig.common.ContainerConfigException
Method Detail

getContainers

public Collection<String> getContainers()
Specified by:
getContainers in interface org.apache.shindig.common.ContainerConfig
Returns:
The set of all containers that are currently registered.

getJson

public Object getJson(String container,
                      String parameter)
Fetches a configuration parameter as a JSON object, array, string, or number, ensuring that it can be safely passed to javascript without any additional filtering.

Specified by:
getJson in interface org.apache.shindig.common.ContainerConfig
Parameters:
container - the name of the container whose configuration should be retrieved. If a value that is not equal to AtlassianContainerConfig.Containers.ATLASSIAN or AtlassianContainerConfig.Containers.DEFAULT is specified, the return value will always be null.
parameter - the value to fetch. May be specified as an x-path like object reference such as "gadgets/features/views".
Returns:
a configuration parameter as a JSON object or null if not set or can't be interpreted as JSON.

get

public String get(String container,
                  String parameter)
Specified by:
get in interface org.apache.shindig.common.ContainerConfig

getJsonObject

public org.json.JSONObject getJsonObject(String container,
                                         String parameter)
Specified by:
getJsonObject in interface org.apache.shindig.common.ContainerConfig

getJsonArray

public org.json.JSONArray getJsonArray(String container,
                                       String parameter)
Specified by:
getJsonArray in interface org.apache.shindig.common.ContainerConfig


Copyright © 2010 Atlassian. All Rights Reserved.