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, getApplicationStartedOrder, getLastModified, registerExtension, setLastModified, unregisterExtension
public static final String GADGET_DIRECTORY
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
registerContribution
in class DefaultComponent
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
unregisterContribution
in class DefaultComponent
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 IOException, org.apache.shindig.gadgets.GadgetException
GadgetService
getGadgetSpec
in interface GadgetService
name
- the gadget symbolic nameIOException
org.apache.shindig.gadgets.GadgetException
public org.apache.shindig.gadgets.spec.GadgetSpec getGadgetSpec(GadgetDeclaration declaration) throws IOException, org.apache.shindig.gadgets.GadgetException
GadgetService
getGadgetSpec
in interface GadgetService
IOException
org.apache.shindig.gadgets.GadgetException
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 © 2015 Nuxeo SA. All rights reserved.