public class CatalogDAO extends Object implements Serviceable, Component, Contextualizable
Modifier and Type | Field and Description |
---|---|
protected CatalogsManager |
_catalogsManager
The catalog manager
|
protected Context |
_context
The avalon context.
|
protected CurrentUserProvider |
_currentUserProvider
The current user provider
|
protected ServiceManager |
_manager
The manager
|
protected AmetysObjectResolver |
_resolver
The ametys object resolver
|
protected UserManager |
_userManager
The users manager
|
static String |
ROLE
The Avalon role
|
Constructor and Description |
---|
CatalogDAO() |
Modifier and Type | Method and Description |
---|---|
void |
contextualize(Context context) |
Map<String,String> |
createCatalog(String title,
String name,
String catalogNameToCopy)
Creates a new ODF catalog.
|
Map<String,String> |
editCatalog(String id,
String title)
Edits an ODF catalog.
|
Map<String,Object> |
generatePDF(String name,
Map<String,Object> contextualParameters)
Generates the PDF of this catalog.
|
Map<String,Object> |
getCatalogProperties(Catalog catalog)
Get the properties of a catalog as a Map
|
Map<String,Object> |
getCatalogProperties(String id)
Gets the properties of a catalog.
|
Map<String,Object> |
getCatalogsProperties(List<String> ids)
Gets the properties of a set of catalogs.
|
Map<String,Object> |
removeCatalog(String id)
Removes an ODF catalog.
|
void |
service(ServiceManager manager) |
Map<String,String> |
setDefaultCatalog(String id)
Set a catalog as default catalog
|
protected CatalogsManager _catalogsManager
protected AmetysObjectResolver _resolver
protected CurrentUserProvider _currentUserProvider
protected UserManager _userManager
protected ServiceManager _manager
public CatalogDAO()
public void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
ContextException
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public Map<String,String> createCatalog(String title, String name, String catalogNameToCopy) throws ProcessingException
title
- The title of the catalogname
- The code of the catalogcatalogNameToCopy
- The catalog name to copy or nullProcessingException
- if creation failedpublic Map<String,String> editCatalog(String id, String title)
id
- The id of the catalog to edittitle
- The title of the catalogpublic Map<String,String> setDefaultCatalog(String id)
id
- The id of catalogpublic Map<String,Object> removeCatalog(String id)
id
- The id of the catalog to removepublic Map<String,Object> getCatalogProperties(String id)
id
- The catalog idpublic Map<String,Object> getCatalogsProperties(List<String> ids)
ids
- The catalogs' idpublic Map<String,Object> generatePDF(String name, Map<String,Object> contextualParameters)
name
- The name (code) of the catalog to exportcontextualParameters
- the contextual parameterspublic Map<String,Object> getCatalogProperties(Catalog catalog)
catalog
- The catalog