Class FavoriteService
java.lang.Object
fr.paris.lutece.plugins.mydashboard.modules.favorites.service.FavoriteService
- Author:
- alexandre
-
Method Summary
Modifier and TypeMethodDescriptionCreate an instance of the favorite classLoad all the activated favoritesfindAllActivatedFavoritesByCode(String strCode) Load all the activated favorites attached to a categoryReturn category listReturn default favorite listLoad all the favoritesfindByPrimaryKey(int idFavorite) Load the favorite for the given idfindFavoritesByCategoryCode(String categoryCode) Return default favorite listfr.paris.lutece.util.ReferenceListReturn reference list of favorites without categorystatic FavoriteServiceGet the instance of this service singletonorg.json.simple.JSONObjectgetLastFavoritesJson(String strGuid, int nNbFavoriteToShow) Get user favoritesvoidremoveFavorite(int nIdFavorite) Remove favorite with specific id, and delete all the users subscription to that favoriteUpdate favorite
-
Method Details
-
getInstance
Get the instance of this service singleton- Returns:
- the singleton of this service
-
findByPrimaryKey
Load the favorite for the given id- Parameters:
idFavorite- the id of the favorite to get- Returns:
- the favorite data corresponding to the provided id.
-
create
Create an instance of the favorite class- Parameters:
favorite- The instance of the Favorite which contains the informations to store- Returns:
- The instance of favorite which has been created with its primary key.
-
update
Update favorite- Parameters:
favorite-- Returns:
- an updated favorite
-
findAllFavorites
Load all the favorites- Returns:
- the list of all the favorites datas.
-
findAllActivatedFavorites
Load all the activated favorites- Returns:
- the list of all the activated favorites datas.
-
findAllActivatedFavoritesByCode
Load all the activated favorites attached to a category- Returns:
- the list of all the activated favorites datas attached to a category.
-
removeFavorite
public void removeFavorite(int nIdFavorite) Remove favorite with specific id, and delete all the users subscription to that favorite- Parameters:
nIdFavorite- the id of the favorite to delete
-
findAllDefaultFavorites
Return default favorite list- Returns:
- the default favorite list
-
findFavoritesByCategoryCode
Return default favorite list- Returns:
- the default favorite list
-
findAllCategories
Return category list- Returns:
- the category list
-
getLastFavoritesJson
Get user favorites- Parameters:
strGuid-nbFavoriteToShow-- Returns:
- json {favorites:[{"order":1,"label":"test","url":"url"}],[{"order":2,"label":"test2","url":"url"}]}
-
getFavoritesWithoutCategory
public fr.paris.lutece.util.ReferenceList getFavoritesWithoutCategory()Return reference list of favorites without category- Returns:
- the reference list of favorites without category
-