nl.surfnet.coin.portal.service.impl
Class TabServiceHibernateImpl

java.lang.Object
  extended by nl.surfnet.coin.shared.service.GenericServiceHibernateImpl<Tab>
      extended by nl.surfnet.coin.portal.service.impl.TabServiceHibernateImpl
All Implemented Interfaces:
TabService, nl.surfnet.coin.shared.service.GenericService<Tab>

@Component(value="tabService")
public class TabServiceHibernateImpl
extends nl.surfnet.coin.shared.service.GenericServiceHibernateImpl<Tab>
implements TabService


Constructor Summary
TabServiceHibernateImpl()
           
 
Method Summary
 ClonedTab cloneTab(Tab tab, List<Gadget> sharedGadgets)
          Clone a tab.
protected  List<Tab> findByCriteria(org.hibernate.criterion.Criterion... criterion)
           
 Tab findByIdAndOwner(Long id, String ownerId)
          Finds a tab by Id and owner
 List<Tab> findFavorites(String ownerId, boolean favorites)
          Find favorites.
 int getCountByOwner(String ownerId, boolean favorites)
          Get a count of all tabs.
 List<Tab> getTabsByOwner(String ownerId)
          Get all the tabs of a person.
 boolean reorderTabs(String[] newOrder, String ownerId, boolean favorites)
          Reorder favorite tabs.
 
Methods inherited from class nl.surfnet.coin.shared.service.GenericServiceHibernateImpl
createCriteria, delete, detachFromSession, findAll, findByCriteriaOrdered, findByExample, findByExample, findById, getCount, getPersistentClass, getSession, saveOrUpdate, saveOrUpdate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface nl.surfnet.coin.shared.service.GenericService
createCriteria, delete, detachFromSession, findAll, findByExample, findByExample, findById, getCount, getPersistentClass, saveOrUpdate, saveOrUpdate
 

Constructor Detail

TabServiceHibernateImpl

public TabServiceHibernateImpl()
Method Detail

findFavorites

public List<Tab> findFavorites(String ownerId,
                               boolean favorites)
Find favorites.

Specified by:
findFavorites in interface TabService
Parameters:
ownerId - the String with the Id of the owner
favorites - true for all favorites, false for non-favorites.
Returns:
Tabs

reorderTabs

public boolean reorderTabs(String[] newOrder,
                           String ownerId,
                           boolean favorites)
Description copied from interface: TabService
Reorder favorite tabs.

Specified by:
reorderTabs in interface TabService
Parameters:
newOrder - the String[] containing the new order
ownerId - the String with the Id of the owner
Returns:
true if the reordering was succesful false if it wasn't

getCountByOwner

public int getCountByOwner(String ownerId,
                           boolean favorites)
Description copied from interface: TabService
Get a count of all tabs.

Specified by:
getCountByOwner in interface TabService
Parameters:
ownerId - the String with the Id of the owner
favorites - boolean indicating the favorite nature.
Returns:
int the number of all tabs by the given owner

cloneTab

public ClonedTab cloneTab(Tab tab,
                          List<Gadget> sharedGadgets)
Description copied from interface: TabService
Clone a tab.

Specified by:
cloneTab in interface TabService
Parameters:
tab - the tab to clone.
sharedGadgets - the List containing the Gadgets
Returns:
the ClonedTab

findByCriteria

protected List<Tab> findByCriteria(org.hibernate.criterion.Criterion... criterion)
Overrides:
findByCriteria in class nl.surfnet.coin.shared.service.GenericServiceHibernateImpl<Tab>

getTabsByOwner

public List<Tab> getTabsByOwner(String ownerId)
Description copied from interface: TabService
Get all the tabs of a person.

Specified by:
getTabsByOwner in interface TabService
Returns:
a List of all Gadgets

findByIdAndOwner

public Tab findByIdAndOwner(Long id,
                            String ownerId)
Finds a tab by Id and owner

Specified by:
findByIdAndOwner in interface TabService
Parameters:
id - of the Tab
ownerId - the String with the Id of the owner
Returns:
Tab or null if it can't be found


Copyright © 2009-2012 SURFnet bv, The Netherlands. All Rights Reserved.