public class GadgetServiceImpl extends DefaultComponent implements GadgetService
Modifier and Type | Field and Description |
---|---|
static String |
GADGET_DIRECTORY |
Constructor and Description |
---|
GadgetServiceImpl() |
Modifier and Type | Method and Description |
---|---|
GadgetDeclaration |
getGadget(String name)
Return a gadget declaration
|
List<String> |
getGadgetCategory()
Returns the list of gadget categories
|
URL |
getGadgetDefinition(String gadgetName)
Returns a URL to the gadget definition
|
List<GadgetDeclaration> |
getGadgetList()
Returns the list of all registered gadgets declarations
|
List<GadgetDeclaration> |
getGadgetList(String category)
Returns the list of the registered gadgets for a given category
|
HashMap<String,ArrayList<String>> |
getGadgetNameByCategory()
Return a hashed map of all registered gadgets by category TODO: check if
this is necessary in the API (perhaps a GWT tweak)
|
InputStream |
getGadgetResource(String gadgetName,
String resourcePath)
Returns a stream on a resource of a gadget
|
org.apache.shindig.gadgets.spec.GadgetSpec |
getGadgetSpec(GadgetDeclaration declaration)
Return the parsed Gadget Spec (may require an http fetch)
|
org.apache.shindig.gadgets.spec.GadgetSpec |
getGadgetSpec(String name)
Return the parsed Gadget Spec (may require an http fetch)
|
String |
getIconUrl(String gadgetName)
Returns a relative URL to the gadget icon
|
void |
registerContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
void |
registerNewGadget(GadgetDeclaration gadget) |
void |
unregisterContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
activate, applicationStarted, deactivate, getAdapter, registerExtension, unregisterExtension
public static final String GADGET_DIRECTORY
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor) throws Exception
registerContribution
in class DefaultComponent
Exception
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor) throws Exception
unregisterContribution
in class DefaultComponent
Exception
public void registerNewGadget(GadgetDeclaration gadget)
public GadgetDeclaration getGadget(String name)
GadgetService
getGadget
in interface GadgetService
name
- the symbolic name of the gadgetpublic InputStream getGadgetResource(String gadgetName, String resourcePath) throws IOException
GadgetService
getGadgetResource
in interface GadgetService
gadgetName
- the symbolic name of the gadgetresourcePath
- the relative path to the resourcesIOException
public org.apache.shindig.gadgets.spec.GadgetSpec getGadgetSpec(String name) throws Exception
GadgetService
getGadgetSpec
in interface GadgetService
name
- the gadget symbolic nameException
public org.apache.shindig.gadgets.spec.GadgetSpec getGadgetSpec(GadgetDeclaration declaration) throws Exception
GadgetService
getGadgetSpec
in interface GadgetService
Exception
public List<GadgetDeclaration> getGadgetList()
GadgetService
getGadgetList
in interface GadgetService
public List<GadgetDeclaration> getGadgetList(String category)
GadgetService
getGadgetList
in interface GadgetService
category
- the categorypublic HashMap<String,ArrayList<String>> getGadgetNameByCategory()
GadgetService
getGadgetNameByCategory
in interface GadgetService
public URL getGadgetDefinition(String gadgetName)
GadgetService
getGadgetDefinition
in interface GadgetService
gadgetName
- the gadget symbolic namepublic List<String> getGadgetCategory()
GadgetService
getGadgetCategory
in interface GadgetService
public String getIconUrl(String gadgetName)
GadgetService
getIconUrl
in interface GadgetService
gadgetName
- the gadget symbolic nameCopyright © 2011 Nuxeo SA. All Rights Reserved.