org.exoplatform.application.gadget.jcr
Class GadgetRegistryServiceImpl

java.lang.Object
  extended by org.exoplatform.application.gadget.jcr.GadgetRegistryServiceImpl
All Implemented Interfaces:
GadgetRegistryService

public class GadgetRegistryServiceImpl
extends java.lang.Object
implements GadgetRegistryService

Created by The eXo Platform SAS Author : Pham Thanh Tung thanhtungty@gmail.com Jun 18, 2008


Constructor Summary
GadgetRegistryServiceImpl(org.exoplatform.container.xml.InitParams params, org.exoplatform.services.jcr.ext.registry.RegistryService service)
           
 
Method Summary
 java.util.List<Gadget> getAllGadgets()
          Gets all of available gadgets from the database.
 java.util.List<Gadget> getAllGadgets(java.util.Comparator<Gadget> sortComparator)
          Gets all of available gadgets from the database.
The list of gadgets are sorted.
 Gadget getGadget(java.lang.String name)
          Gets the gadget from database by name.
 boolean isGadgetDeveloper(java.lang.String username)
          return true is the user is defined as a gadget developer
 void removeGadget(java.lang.String name)
          Removes the gadget from the database.
 void saveGadget(Gadget gadget)
          Adds the gadget to the database.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GadgetRegistryServiceImpl

public GadgetRegistryServiceImpl(org.exoplatform.container.xml.InitParams params,
                                 org.exoplatform.services.jcr.ext.registry.RegistryService service)
                          throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

getGadget

public Gadget getGadget(java.lang.String name)
                 throws java.lang.Exception
Description copied from interface: GadgetRegistryService
Gets the gadget from database by name.

Specified by:
getGadget in interface GadgetRegistryService
Parameters:
name - the name of gadget
Returns:
the gadget or null if not found
Throws:
java.lang.Exception

getAllGadgets

public java.util.List<Gadget> getAllGadgets()
                                     throws java.lang.Exception
Description copied from interface: GadgetRegistryService
Gets all of available gadgets from the database.

Specified by:
getAllGadgets in interface GadgetRegistryService
Returns:
a list of gadgets
Throws:
java.lang.Exception

getAllGadgets

public java.util.List<Gadget> getAllGadgets(java.util.Comparator<Gadget> sortComparator)
                                     throws java.lang.Exception
Description copied from interface: GadgetRegistryService
Gets all of available gadgets from the database.
The list of gadgets are sorted.

Specified by:
getAllGadgets in interface GadgetRegistryService
Parameters:
sortComparator - The comparator is used to control the order of gadgets
Returns:
a list of gadgets
Throws:
java.lang.Exception

saveGadget

public void saveGadget(Gadget gadget)
                throws java.lang.Exception
Description copied from interface: GadgetRegistryService
Adds the gadget to the database. If the gadget is existing, it will be updated.

Specified by:
saveGadget in interface GadgetRegistryService
Throws:
java.lang.Exception

removeGadget

public void removeGadget(java.lang.String name)
                  throws java.lang.Exception
Description copied from interface: GadgetRegistryService
Removes the gadget from the database.

Specified by:
removeGadget in interface GadgetRegistryService
Throws:
java.lang.Exception

isGadgetDeveloper

public boolean isGadgetDeveloper(java.lang.String username)
return true is the user is defined as a gadget developer

Specified by:
isGadgetDeveloper in interface GadgetRegistryService
Parameters:
username -


Copyright © 2010 eXo Platform SAS. All Rights Reserved.